text stringlengths 9 39.2M | dir stringlengths 25 226 | lang stringclasses 163
values | created_date timestamp[s] | updated_date timestamp[s] | repo_name stringclasses 751
values | repo_full_name stringclasses 752
values | star int64 1.01k 183k | len_tokens int64 1 18.5M |
|---|---|---|---|---|---|---|---|---|
```javascript
/* @flow strict-local */
import type { Store } from 'redux';
import invariant from 'invariant';
import type { Config, Persistor } from './types';
import * as logging from '../../utils/logging';
import { KEY_PREFIX } from './constants';
import purgeStoredState from './purgeStoredState';
export default fu... | /content/code_sandbox/src/third/redux-persist/createPersistor.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 972 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import Emoji from '../emoji/Emoji';
import { emojiTypeFromReactionType } from '../emoji/data';
import type { LocalizableText, UserOrBot } from '../types';
import styles, { createSty... | /content/code_sandbox/src/account-info/AccountDetails.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 854 |
```javascript
/**
*
* This source code is licensed under the MIT license found in the
* docs/THIRDPARTY file from the root directory of this source tree.
*
* @format
* @flow strict-local
*/
'use strict';
import React from 'react';
import type { ElementRef, Node } from 'react';
import { Keyboard, LayoutAnimatio... | /content/code_sandbox/src/third/react-native/KeyboardAvoidingView.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,628 |
```javascript
/* @flow strict-local */
import React, { useCallback } from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import invariant from 'invariant';
import type { RouteProp } from '../react-navigation';
import type { AppNavigationProp } from '../nav/AppNavigator';
import type {... | /content/code_sandbox/src/account-info/AccountDetailsScreen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 882 |
```javascript
// @flow strict-local
import * as React from 'react';
import { View } from 'react-native';
import { type UserOrBot, type UserId } from '../api/modelTypes';
import WebLink from '../common/WebLink';
import ZulipText from '../common/ZulipText';
import { ensureUnreachable } from '../generics';
import { useSe... | /content/code_sandbox/src/account-info/CustomProfileFields.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 800 |
```javascript
/* @flow strict-local */
/**
* This exposes the native CustomTabsAndroid module as a JS module. This has a
* function 'openURL' which takes the following parameters:
*
* 1. String url: A url to be opened in customTabs
*/
import { NativeModules } from 'react-native';
export default NativeModules.Shar... | /content/code_sandbox/src/nativeModules/ShareFileAndroid.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 75 |
```javascript
/* @flow strict-local */
import React, { useContext } from 'react';
import type { Node } from 'react';
import { ScrollView, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { type UserId } from '../api/idTypes';
import { TranslationContext } from '../boot/... | /content/code_sandbox/src/account-info/ProfileScreen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,296 |
```javascript
/* @flow strict-local */
import { EventTypes } from '../api/eventTypes';
import type { SubscriptionsState, PerAccountApplicableAction } from '../types';
import { ensureUnreachable } from '../types';
import { updateStreamProperties } from '../streams/streamsReducer';
import {
EVENT_SUBSCRIPTION,
REGIST... | /content/code_sandbox/src/subscriptions/subscriptionsReducer.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 538 |
```javascript
/* @flow strict-local */
import React, { useCallback, useMemo } from 'react';
import type { Node } from 'react';
import { FlatList } from 'react-native';
import Screen from '../common/Screen';
import type { RouteProp } from '../react-navigation';
import type { AppNavigationProp } from '../nav/AppNavigat... | /content/code_sandbox/src/subscriptions/StreamListScreen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 816 |
```javascript
/* @flow strict-local */
import { createSelector } from 'reselect';
import type { PerAccountState, Narrow, Selector, Stream, Subscription } from '../types';
import { isStreamOrTopicNarrow, streamIdOfNarrow } from '../utils/narrow';
import { getSubscriptions, getStreams } from '../directSelectors';
/**
... | /content/code_sandbox/src/subscriptions/subscriptionSelectors.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 700 |
```javascript
/* @flow strict-local */
import deepFreeze from 'deep-freeze';
import { EventTypes } from '../../api/eventTypes';
import { EVENT_SUBSCRIPTION, EVENT } from '../../actionConstants';
import subscriptionsReducer from '../subscriptionsReducer';
import * as eg from '../../__tests__/lib/exampleData';
describ... | /content/code_sandbox/src/subscriptions/__tests__/subscriptionsReducer-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,396 |
```javascript
// @flow strict-local
import {
getStreamsById,
getSubscriptionsById,
getIsActiveStreamSubscribed,
getStreamColorForNarrow,
} from '../subscriptionSelectors';
import {
HOME_NARROW,
streamNarrow,
topicNarrow,
pmNarrowFromUsersUnsafe,
pm1to1NarrowFromUser,
} from '../../utils/narrow';
impo... | /content/code_sandbox/src/subscriptions/__tests__/subscriptionSelectors-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 838 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import type { TextStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { UserOrBot } from '../types';
import { useSelector } from '../react-redux';
import { getUserLastActiveAsRelativeTimeStrin... | /content/code_sandbox/src/title/ActivityText.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 192 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { caseNarrow } from '../utils/narrow';
import type { Narrow, EditMessage } from '../types';
import TitlePrivate from './TitlePrivate';
import TitleGroup from './TitleGroup';
import TitleSpecial from './TitleSp... | /content/code_sandbox/src/title/Title.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 332 |
```javascript
/* @flow strict-local */
import React, { useContext } from 'react';
import type { Node } from 'react';
import { Text, View, TouchableWithoutFeedback } from 'react-native';
// $FlowFixMe[untyped-import]
import { useActionSheet } from '@expo/react-native-action-sheet';
import { TranslationContext } from '... | /content/code_sandbox/src/title/TitleStream.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 997 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import { useSelector } from '../react-redux';
import { getOwnUserId } from '../selectors';
import { pmUiRecipientsFromKeyRecipients, type PmKeyRecipients } from '../utils/recipient... | /content/code_sandbox/src/title/TitleGroup.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 286 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import ZulipTextIntl from '../common/ZulipTextIntl';
import { Icon } from '../common/Icons';
import styles from '../styles';
const specials = {
home: { name: 'Combined feed', ico... | /content/code_sandbox/src/title/TitleSpecial.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 269 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { Text } from 'react-native';
import styles from '../styles';
type Props = $ReadOnly<{|
text: string,
color: string,
|}>;
export default function TitlePlain(props: Props): Node {
const { text, color } = ... | /content/code_sandbox/src/title/TitlePlain.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 102 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import type { UserId } from '../types';
import styles, { createStyleSheet } from '../styles';
import { useSelector } from '../react-redux';
import Touchable from '../common/Touchab... | /content/code_sandbox/src/title/TitlePrivate.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 468 |
```javascript
/* @flow strict-local */
import type { Auth } from './apiTypes';
import { isUrlOnRealm } from '../utils/url';
import getFileTemporaryUrl from './messages/getFileTemporaryUrl';
/**
* Like getFileTemporaryUrl, but on error returns null instead of throwing.
*
* Validates `url` to give getFileTemporaryUrl... | /content/code_sandbox/src/api/tryGetFileTemporaryUrl.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 468 |
```javascript
/**
* Functions to interpret some data from the API.
*
* @flow strict-local
*/
import invariant from 'invariant';
import type { UpdateMessageEvent } from './eventTypes';
import * as logging from '../utils/logging';
export type MessageMove = $ReadOnly<{|
orig_stream_id: number,
new_stream_id: num... | /content/code_sandbox/src/api/misc.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 421 |
```javascript
// @flow strict-local
import { type UserId } from './idTypes';
//
// Note: No code actually refers to these type definitions!
//
// The code that consumes this part of the API is in:
// src/notification/extract.js
// android/app/src/main/java/com/zulipmobile/notifications/FcmMessage.kt
// of which t... | /content/code_sandbox/src/api/notificationTypes.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 710 |
```javascript
/* @flow strict-local */
/**
* The code here in src/api is like a self-contained, independent
* library that describes the server API. Therefore, it shouldn't
* import code from outside src/api. We've made a few exceptions to
* this rule -- we sometimes import functions from src/utils for
* convenie... | /content/code_sandbox/src/api/index.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 894 |
```javascript
/* @flow strict-local */
import userAgent from '../utils/userAgent';
// check with server if current mobile app is compatible with latest backend
// compatibility fails only if server responds with 400 (but not with 200 or 404)
export default (): Promise<Response> =>
fetch('path_to_url {
headers: {... | /content/code_sandbox/src/api/checkCompatibility.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 95 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from './transportTypes';
import { apiPost } from './apiFetch';
type TypingOperation = 'start' | 'stop';
/** See path_to_url */
export default (auth: Auth, recipients: string, operation: TypingOperation): Promise<ApiResponse> =>
apiPost(auth, '... | /content/code_sandbox/src/api/typing.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 90 |
```javascript
/* @flow strict-local */
import { ExtendableError } from '../utils/logging';
import type { ApiErrorCode, ApiResponseErrorData } from './transportTypes';
import { ZulipVersion } from '../utils/zulipVersion';
/**
* Some kind of error from a Zulip API network request.
*
* This is an abstract class: every... | /content/code_sandbox/src/api/apiErrors.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,669 |
```javascript
/* @flow strict-local */
import { networkActivityStart, networkActivityStop } from '../utils/networkActivity';
import {
MalformedResponseError,
NetworkError,
Server5xxError,
ServerError,
UnexpectedHttpStatusError,
} from './apiErrors';
import type { ServerEmojiData } from './modelTypes';
import ... | /content/code_sandbox/src/api/fetchServerEmojiData.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 862 |
```javascript
/* @flow strict-local */
import { typesEquivalent } from '../generics';
import { objectValues } from '../flowPonyfill';
/**
* Organization-level role of a user.
*
* Described in the server API doc, e.g., at `.role` in `realm_users` at
* path_to_url
*/
export enum Role {
Owner = 100,
Admin = 2... | /content/code_sandbox/src/api/permissionsTypes.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 613 |
```javascript
/**
* Types for events returned by the server.
*
* See server docs:
* path_to_url
* path_to_url
*
* NB this is just a start -- far from complete.
*
* @flow strict-local
*/
import type { BoundedDiff, SubsetProperties } from '../generics';
import { keyMirror } from '../utils/keyMirror';
impor... | /content/code_sandbox/src/api/eventTypes.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 3,464 |
```javascript
/* @flow strict-local */
import type { InitialDataRealm } from './initialDataTypes';
/**
* Property-value map for data in `update` or `update_dict` realm events.
*
* Use this as a source where we define the actual types for those events.
*
* We use our type InitialDataRealm for how the data appears ... | /content/code_sandbox/src/api/realmDataTypes.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,305 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from './transportTypes';
import type { Topic } from './apiTypes';
import { apiGet } from './apiFetch';
type ApiResponseTopics = {|
...$Exact<ApiResponseSuccess>,
topics: $ReadOnlyArray<Topic>,
|};
/** See path_to_url */
export default... | /content/code_sandbox/src/api/getTopics.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 104 |
```javascript
/* @flow strict-local */
/**
* A user ID.
*
* This is a number that identifies a particular Zulip user. Different
* users on the same Zulip server will have different user IDs. On the
* other hand, between different Zulip servers the same user ID may be used
* to refer to completely unrelated use... | /content/code_sandbox/src/api/idTypes.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 553 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from './transportTypes';
import { apiPost } from './apiFetch';
type ApiResponseDevFetchApiKey = {|
...$Exact<ApiResponseSuccess>,
api_key: string,
|};
export default (auth: Auth, email: string): Promise<ApiResponseDevFetchApiKey> =>
... | /content/code_sandbox/src/api/devFetchApiKey.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 89 |
```javascript
/* @flow strict-local */
/**
* An identity, plus secret, authenticating this user in some Zulip org.
*
* This consists of all the information the API client library needs in
* order to talk to the server on the user's behalf. All API functions
* for making (authenticated) requests to the server req... | /content/code_sandbox/src/api/transportTypes.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 869 |
```javascript
/* @flow strict-local */
import type { Identity } from '../types';
import type { PmMessage, StreamMessage, Message, MessageEdit, UserId } from './modelTypes';
import { AvatarURL } from '../utils/avatar';
/**
* The elements of Message.edit_history found in a fetch-message(s) response.
*
* Accurate for... | /content/code_sandbox/src/api/rawModelTypes.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 568 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from './transportTypes';
import { apiPost } from './apiFetch';
type ApiResponseFetchApiKey = {|
...$Exact<ApiResponseSuccess>,
email: string,
api_key: string,
|};
export default (auth: Auth, email: string, password: string): Promise... | /content/code_sandbox/src/api/fetchApiKey.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 97 |
```javascript
/* @flow strict-local */
/**
* The topic servers understand to mean "there is no topic".
*
* This should match
* path_to_url#L940
* or similar logic at the latest `main`.
*/
// This is hardcoded in the server, and therefore untranslated; that's
// zulip/zulip#3639.
export const kNoTopicTopic: str... | /content/code_sandbox/src/api/constants.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 290 |
```javascript
/**
* Types for things in the Zulip data model, as seen in the API.
*
* @flow strict-local
*/
import { typesEquivalent } from '../generics';
import { objectValues } from '../flowPonyfill';
import type { AvatarURL } from '../utils/avatar';
import type { UserId } from './idTypes';
import type { Role } ... | /content/code_sandbox/src/api/modelTypes.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 9,290 |
```javascript
/* @flow strict-local */
import type { ApiResponseSuccess, Auth } from './transportTypes';
import type { GeneralEvent } from './eventTypes';
import { apiGet } from './apiFetch';
type ApiResponsePollEvents = {|
...$Exact<ApiResponseSuccess>,
events: $ReadOnlyArray<GeneralEvent>,
|};
/** See path_to_u... | /content/code_sandbox/src/api/pollForEvents.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 181 |
```javascript
/* @flow strict-local */
import * as Sentry from '@sentry/react-native';
import type { UrlParams } from '../utils/url';
import type { Auth } from './transportTypes';
import { getAuthHeaders } from './transport';
import { encodeParamsForUrl } from '../utils/url';
import userAgent from '../utils/userAgent'... | /content/code_sandbox/src/api/apiFetch.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,161 |
```javascript
/* @flow strict-local */
export type * from './transportTypes';
export type * from './modelTypes';
export type * from './eventTypes';
export type * from './initialDataTypes';
export type * from './permissionsTypes';
``` | /content/code_sandbox/src/api/apiTypes.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 48 |
```javascript
/* @flow strict-local */
import invariant from 'invariant';
import type { RawInitialData, InitialData } from './initialDataTypes';
import type { Auth } from './transportTypes';
import type { CrossRealmBot, User } from './modelTypes';
import { apiPost } from './apiFetch';
import { AvatarURL } from '../uti... | /content/code_sandbox/src/api/registerForEvents.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,699 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from './transportTypes';
import { apiDelete } from './apiFetch';
/** See path_to_url */
export default (auth: Auth, queueId: string): Promise<ApiResponseSuccess> =>
apiDelete(auth, 'events', {
queue_id: queueId,
});
``` | /content/code_sandbox/src/api/deleteEventQueue.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 72 |
```javascript
/* @flow strict-local */
import type { Auth } from './transportTypes';
import { base64Utf8Encode } from '../utils/encoding';
export const getAuthHeaders = (auth: Auth): {| Authorization?: string |} =>
// The `Object.freeze`` in the `:` case avoids a Flow issue:
// path_to_url#issuecomment-695064325
... | /content/code_sandbox/src/api/transport.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 113 |
```javascript
/* @flow strict-local */
import type { Auth } from './transportTypes';
import updateMessageFlags from './messages/updateMessageFlags';
/** We batch up requests to avoid sending them twice in this much time. */
const debouncePeriodMs = 500;
const batchSize = 1000;
let unsentMessageIds: number[] = [];
le... | /content/code_sandbox/src/api/queueMarkAsRead.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 308 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from './transportTypes';
import { apiFile } from './apiFetch';
import { getFileExtension, getMimeTypeFromFileExtension } from '../utils/url';
type ApiResponseUploadFile = {|
...$Exact<ApiResponseSuccess>,
uri: string,
|};
export defau... | /content/code_sandbox/src/api/uploadFile.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 154 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from './transportTypes';
import type { DevUser } from './apiTypes';
import { apiGet } from './apiFetch';
type ApiResponseDevListUsers = {|
...$Exact<ApiResponseSuccess>,
direct_admins: $ReadOnlyArray<DevUser>,
direct_users: $ReadOnly... | /content/code_sandbox/src/api/devListUsers.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 106 |
```javascript
/* @flow strict-local */
import type { ApiResponseSuccess, Auth } from './transportTypes';
import type { PresenceSnapshot } from './apiTypes';
import { apiPost } from './apiFetch';
type ApiResponseWithPresence = {|
...$Exact<ApiResponseSuccess>,
server_timestamp: number,
presences: PresenceSnapshot... | /content/code_sandbox/src/api/reportPresence.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 144 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import type { Stream } from '../apiTypes';
import { apiGet } from '../apiFetch';
type ApiResponseStreams = {|
...$Exact<ApiResponseSuccess>,
streams: $ReadOnlyArray<Stream>,
|};
/** See path_to_url */
export ... | /content/code_sandbox/src/api/streams/getStreams.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 92 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import type { Stream } from '../modelTypes';
import { apiPatch } from '../apiFetch';
/**
* path_to_url
*
* NB the caller must adapt for old-server compatibility; see comments.
*/
// Current to FL 121; property orderi... | /content/code_sandbox/src/api/streams/updateStream.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 489 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import type { Stream } from '../modelTypes';
import { apiPost } from '../apiFetch';
/**
* See path_to_url
*
* NB the caller must adapt for old-server compatibility; see comments.
*/
// Current to FL 121.
// TODO(#465... | /content/code_sandbox/src/api/streams/createStream.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 555 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import { apiGet } from '../apiFetch';
type ApiResponseStreamId = {|
...$Exact<ApiResponseSuccess>,
stream_id: number,
|};
/** See path_to_url */
export default async (auth: Auth, stream: string): Promise<ApiR... | /content/code_sandbox/src/api/streams/getStreamId.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 91 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import type { MessageSnapshot } from '../apiTypes';
import { apiGet } from '../apiFetch';
type ApiResponseMessageHistory = {|
...$Exact<ApiResponseSuccess>,
message_history: $ReadOnlyArray<MessageSnapshot>,
|}... | /content/code_sandbox/src/api/messages/getMessageHistory.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 115 |
```javascript
/* @flow strict-local */
import type {
CrossRealmBot,
CustomProfileField,
MutedTopicTuple,
MutedUser,
PresenceSnapshot,
RealmEmojiById,
RealmFilter,
RealmLinkifier,
RecentPrivateConversation,
Stream,
Subscription,
User,
UserGroup,
UserId,
UserSettings,
UserStatusUpdate,
... | /content/code_sandbox/src/api/initialDataTypes.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 7,162 |
```javascript
// @flow strict-local
import type { ApiNarrow, UserMessageFlag } from '../modelTypes';
import type { ApiResponseSuccess, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
// TODO(server-3.0): Move `Anchor` to modelTypes and share with getMessages.
type Anchor = number | 'newest' | '... | /content/code_sandbox/src/api/messages/updateMessageFlagsForNarrow.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 267 |
```javascript
/* @flow strict-local */
import invariant from 'invariant';
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import { apiGet } from '../apiFetch';
import type { UserId } from '../idTypes';
type ServerApiResponseReadReceipts = {|
...$Exact<ApiResponseSuccess>,
+user_ids: $ReadOnlyAr... | /content/code_sandbox/src/api/messages/getReadReceipts.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 242 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import type { Identity } from '../../types';
import type { Message, ApiNarrow } from '../apiTypes';
import { transformFetchedMessage, type FetchedMessage } from '../rawModelTypes';
import { apiGet } from '../apiFet... | /content/code_sandbox/src/api/messages/getMessages.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 547 |
```javascript
/* @flow strict-local */
import type { ApiResponseSuccess, Auth } from '../transportTypes';
import type { UserMessageFlag } from '../modelTypes';
import { apiPost } from '../apiFetch';
export type ApiResponseUpdateMessageFlags = {|
...$Exact<ApiResponseSuccess>,
// The `messages` property is depreca... | /content/code_sandbox/src/api/messages/updateMessageFlags.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 184 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import type { PropagateMode } from '../modelTypes';
import { apiPatch } from '../apiFetch';
/**
* path_to_url
*
* NB the caller must manage old-server compatibility:
* `send_notification_to_old_thread` and `send_noti... | /content/code_sandbox/src/api/messages/updateMessage.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 225 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPatch } from '../apiFetch';
// TODO(#4701): Make an API method for DELETE /messages/{id}. Use it to
// implement the permanent message deletion capability:
// path_to_url
// To do so, we'll need input from ... | /content/code_sandbox/src/api/messages/deleteMessage.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 147 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import { apiGet } from '../apiFetch';
type ApiResponseTempFileUrl = {|
...$Exact<ApiResponseSuccess>,
url: string,
|};
/**
* Get a temporary, authless partial URL to a realm-uploaded file.
*
* This endpoin... | /content/code_sandbox/src/api/messages/getFileTemporaryUrl.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 346 |
```javascript
/* @flow strict-local */
import type { Auth } from '../transportTypes';
import updateMessageFlags from './updateMessageFlags';
import type { ApiResponseUpdateMessageFlags } from './updateMessageFlags';
export default (
auth: Auth,
messageIds: $ReadOnlyArray<number>,
starMessage: boolean,
): Promise... | /content/code_sandbox/src/api/messages/toggleMessageStarred.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 96 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import { type FetchedMessage } from '../rawModelTypes';
import { apiGet } from '../apiFetch';
// The actual response from a (current) server. We convert the message to a
// proper Message before looking at its co... | /content/code_sandbox/src/api/messages/getRawMessageContent.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 432 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import type { Message } from '../apiTypes';
import { transformFetchedMessage, type FetchedMessage } from '../rawModelTypes';
import { apiGet } from '../apiFetch';
import { identityOfAuth } from '../../account/acco... | /content/code_sandbox/src/api/messages/getSingleMessage.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 443 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
/**
* Delete all messages in a stream for a given topic.
*/
export default async (auth: Auth, streamId: number, topicName: string): Promise<ApiResponse> =>
apiPost(auth, `stream... | /content/code_sandbox/src/api/messages/deleteTopic.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 90 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
/** See path_to_url */
export default async (
auth: Auth,
params: {|
type: 'private' | 'stream',
to: string,
// TODO(server-2.0): Say "topic", not "subject"
sub... | /content/code_sandbox/src/api/messages/sendMessage.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 165 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import type { User } from '../apiTypes';
import { apiGet } from '../apiFetch';
type ApiResponseUsers = {|
...$Exact<ApiResponseSuccess>,
members: $ReadOnlyArray<{| ...User, avatar_url: string | null |}>,
|};
... | /content/code_sandbox/src/api/users/getUsers.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 159 |
```javascript
/* @flow strict-local */
import invariant from 'invariant';
import type { UserSettings } from '../modelTypes';
import type { ApiResponseSuccess, Auth } from '../transportTypes';
import { apiPatch } from '../apiFetch';
// Assumes FL 89+ because the UserSettings type does; see note there.
//
// Current to... | /content/code_sandbox/src/api/users/updateUserSettings.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 330 |
```javascript
/* @flow strict-local */
import type { UserStatus } from '../modelTypes';
import type { ApiResponseSuccess, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
/**
* path_to_url
*
* See doc for important requirements, like a character limit on the status
* text.
*/
export default... | /content/code_sandbox/src/api/users/updateUserStatus.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 224 |
```javascript
/* @flow strict-local */
import type { ApiResponseSuccess, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
/**
* See path_to_url
* Note: The requesting user must be an administrator.
*/
export default (
auth: Auth,
email: string,
password: string,
fullName: string,
sh... | /content/code_sandbox/src/api/users/createUser.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 115 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import { type UserId } from '../idTypes';
import { apiGet } from '../apiFetch';
type ApiResponseUserProfile = {|
...$Exact<ApiResponseSuccess>,
client_id: string,
email: string,
full_name: string,
is_adm... | /content/code_sandbox/src/api/users/getUserProfile.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 165 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPatch } from '../apiFetch';
const getRequestBody = (opp, value) => {
const data = {};
if (opp === 'offline_notification_change') {
data.enable_offline_push_notifications = value;
} else if (opp === ... | /content/code_sandbox/src/api/settings/toggleMobilePushSettings.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 177 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponse } from '../transportTypes';
import { apiDelete } from '../apiFetch';
export default (
auth: Auth,
messageId: number,
reactionType: string,
emojiCode: string,
emojiName: string,
): Promise<ApiResponse> =>
apiDelete(auth, `messages/${mess... | /content/code_sandbox/src/api/emoji_reactions/emojiReactionRemove.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 104 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
export default (
auth: Auth,
messageId: number,
reactionType: string,
emojiCode: string,
emojiName: string,
): Promise<ApiResponse> =>
apiPost(auth, `messages/${messageI... | /content/code_sandbox/src/api/emoji_reactions/emojiReactionAdd.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 104 |
```javascript
/* @flow strict-local */
import type { ApiResponseSuccess } from '../transportTypes';
import { apiGet } from '../apiFetch';
import { ApiError, ServerTooOldError, kMinAllowedServerVersion } from '../apiErrors';
import { ZulipVersion } from '../../utils/zulipVersion';
// This corresponds to AUTHENTICATION_... | /content/code_sandbox/src/api/settings/getServerSettings.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,051 |
```javascript
/* @flow strict-local */
import { transformFetchedMessage, type FetchedMessage } from '../rawModelTypes';
import { identityOfAuth } from '../../account/accountMisc';
import * as eg from '../../__tests__/lib/exampleData';
import type { Message } from '../modelTypes';
import { GravatarURL } from '../../util... | /content/code_sandbox/src/api/__tests__/rawModelTypes-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 575 |
```javascript
import { getFetchParams } from '../apiFetch';
global.FormData = jest.fn();
describe('getFetchParams', () => {
test('creates a `header` key with authorization data', () => {
const auth = {
email: 'john@example.com',
apiKey: 'some_key',
};
const params = {};
const actualResu... | /content/code_sandbox/src/api/__tests__/apiFetch-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 258 |
```javascript
/* @flow strict-local */
import queueMarkAsRead, { resetAll } from '../queueMarkAsRead';
import * as updateMessageFlags from '../messages/updateMessageFlags';
import * as eg from '../../__tests__/lib/exampleData';
// $FlowFixMe[cannot-write] Make flow understand about mocking
updateMessageFlags.default =... | /content/code_sandbox/src/api/__tests__/queueMarkAsRead-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 513 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
export default async (auth: Auth, streamId: number): Promise<ApiResponse> =>
apiPost(auth, 'mark_stream_as_read', {
stream_id: streamId,
});
``` | /content/code_sandbox/src/api/mark_as_read/markStreamAsRead.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 68 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import { apiPost } from '../apiFetch';
type ApiResponseRealmCreateFilters = {|
...$Exact<ApiResponseSuccess>,
id: number,
|};
/** path_to_url */
export default async (
auth: Auth,
pattern: string,
urlFo... | /content/code_sandbox/src/api/realm/createRealmFilter.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 109 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
export default async (auth: Auth, streamId: number, topic: string): Promise<ApiResponse> =>
apiPost(auth, 'mark_topic_as_read', {
stream_id: streamId,
topic_name: topic,
... | /content/code_sandbox/src/api/mark_as_read/markTopicAsRead.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 78 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
export default async (auth: Auth): Promise<ApiResponse> => apiPost(auth, 'mark_all_as_read');
``` | /content/code_sandbox/src/api/mark_as_read/markAllAsRead.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 52 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiDelete } from '../apiFetch';
/** See path_to_url */
export default (
auth: Auth,
// TODO(server-future): This should use a stream ID (#3918), not stream name.
// Server issue: path_to_url
subscripti... | /content/code_sandbox/src/api/subscriptions/subscriptionRemove.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 147 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPatch } from '../apiFetch';
/** See path_to_url */
export default async (
auth: Auth,
// TODO(server-2.0): Switch to stream ID (#3918), instead of name.
// (The version that was introduced in isn't do... | /content/code_sandbox/src/api/subscriptions/setTopicMute.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 174 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import type { Subscription } from '../apiTypes';
import { apiGet } from '../apiFetch';
type ApiResponseSubscriptions = {|
...$Exact<ApiResponseSuccess>,
subscriptions: $ReadOnlyArray<Subscription>,
|};
/** Se... | /content/code_sandbox/src/api/subscriptions/getSubscriptions.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 97 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
export type SubscriptionProperty = 'is_muted' | 'pin_to_top' | 'push_notifications';
/** See path_to_url */
export default async (
auth: Auth,
streamId: number,
property: Sub... | /content/code_sandbox/src/api/subscriptions/setSubscriptionProperty.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 248 |
```javascript
/* @flow strict-local */
import type { Auth, ApiResponseSuccess } from '../transportTypes';
import { type UserId } from '../idTypes';
import { apiGet } from '../apiFetch';
type ApiResponseSubscriptionStatus = {|
...$Exact<ApiResponseSuccess>,
is_subscribed: boolean,
|};
/**
* Get whether a user is ... | /content/code_sandbox/src/api/subscriptions/getSubscriptionToStream.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 134 |
```javascript
// @flow strict-local
import type { UserTopicVisibilityPolicy } from '../modelTypes';
import type { ApiResponseSuccess, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
/** path_to_url */
export default function updateUserTopic(
auth: Auth,
stream_id: number,
topic: string,
... | /content/code_sandbox/src/api/subscriptions/updateUserTopic.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 117 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
type SubscriptionObj = {|
// TODO(server-future): This should use a stream ID (#3918), not stream name.
// Server issue: path_to_url
name: string,
|};
/** See path_to_url *... | /content/code_sandbox/src/api/subscriptions/subscriptionAdd.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 162 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
/** See path_to_url#poll-todo-lists-and-games */
// `msg_type` only exists as widget at the moment, see #3205.
export default async (auth: Auth, messageId: number, content: string)... | /content/code_sandbox/src/api/submessages/sendSubmessage.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 111 |
```javascript
/* @flow strict-local */
import type { Auth } from '../transportTypes';
import { apiDelete } from '../apiFetch';
/**
* Tell the server to forget this device token for push notifications.
*
* @param mobileOS - Choose the server-side API intended for iOS or Android clients.
*/
export default (auth: Aut... | /content/code_sandbox/src/api/notifications/forgetPushToken.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 131 |
```javascript
/* @flow strict-local */
import type { Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
/**
* Tell the server our device token for push notifications.
*
* @param mobileOS - Choose the server-side API intended for iOS or Android clients.
*/
export default async (auth: Auth, mobi... | /content/code_sandbox/src/api/notifications/savePushToken.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 199 |
```javascript
/* @flow strict-local */
import type { ApiResponse, Auth } from '../transportTypes';
import { apiPost } from '../apiFetch';
/** See path_to_url */
export default async (
auth: Auth,
params: {|
token: string,
|},
): Promise<ApiResponse> =>
apiPost(auth, 'mobile_push/test_notification', {
... | /content/code_sandbox/src/api/notifications/sendTestNotification.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 83 |
```javascript
/* @flow strict-local */
import Immutable from 'immutable';
import type { MutedUsersState, PerAccountApplicableAction, UserId } from '../types';
import { REGISTER_COMPLETE, EVENT_MUTED_USERS, RESET_ACCOUNT_DATA } from '../actionConstants';
import type { MutedUser } from '../api/apiTypes';
const initialS... | /content/code_sandbox/src/mute/mutedUsersReducer.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 223 |
```javascript
// @flow strict-local
import Immutable from 'immutable';
import { type UserTopicVisibilityPolicy } from '../api/modelTypes';
/**
* The "visibility policy" our user has chosen for each topic.
*
* See jsdoc of UserTopicVisibilityPolicy for background.
*
* In this data structure, the keys are stream I... | /content/code_sandbox/src/mute/muteModelTypes.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 177 |
```javascript
/* @flow strict-local */
import { reducer } from '../muteModel';
import type { MuteState } from '../muteModelTypes';
import { type Stream, type UserTopic, UserTopicVisibilityPolicy } from '../../api/modelTypes';
import * as eg from '../../__tests__/lib/exampleData';
export const makeUserTopic = (
stre... | /content/code_sandbox/src/mute/__tests__/mute-testlib.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 282 |
```javascript
/* @flow strict-local */
import Immutable from 'immutable';
import type {
MuteState,
PerAccountApplicableAction,
PerAccountState,
Subscription,
} from '../types';
import { UserTopicVisibilityPolicy } from '../api/modelTypes';
import { EventTypes } from '../api/eventTypes';
import {
REGISTER_COM... | /content/code_sandbox/src/mute/muteModel.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,795 |
```javascript
/* @flow strict-local */
import Immutable from 'immutable';
import deepFreeze from 'deep-freeze';
import mutedUsersReducer from '../mutedUsersReducer';
import { EVENT_MUTED_USERS } from '../../actionConstants';
import * as eg from '../../__tests__/lib/exampleData';
describe('mutedUsersReducer', () => {
... | /content/code_sandbox/src/mute/__tests__/mutedUsersReducer-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 437 |
```javascript
/* @flow strict-local */
import type { AlertWordsState, PerAccountApplicableAction } from '../types';
import { REGISTER_COMPLETE, EVENT_ALERT_WORDS, RESET_ACCOUNT_DATA } from '../actionConstants';
import { NULL_ARRAY } from '../nullObjects';
const initialState = NULL_ARRAY;
export default (
state: Ale... | /content/code_sandbox/src/alertWords/alertWordsReducer.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 146 |
```javascript
/* @flow strict-local */
import deepFreeze from 'deep-freeze';
import alertWordsReducer from '../alertWordsReducer';
import { EVENT_ALERT_WORDS } from '../../actionConstants';
import * as eg from '../../__tests__/lib/exampleData';
describe('alertWordsReducer', () => {
describe('RESET_ACCOUNT_DATA', (... | /content/code_sandbox/src/alertWords/__tests__/alertWordsReducer-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 412 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.