stream-chat 10.0.0-rc.2 → 10.0.0-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -8
- package/dist/cjs/index.browser.js +15397 -12090
- package/dist/cjs/index.browser.js.map +4 -4
- package/dist/cjs/index.node.js +15349 -11991
- package/dist/cjs/index.node.js.map +4 -4
- package/dist/esm/index.mjs +15164 -11880
- package/dist/esm/index.mjs.map +4 -4
- package/dist/types/ChannelManager.d.ts +246 -6
- package/dist/types/CooldownTimer.d.ts +22 -8
- package/dist/types/EventHandlerPipeline.d.ts +12 -16
- package/dist/types/LiveLocationManager.d.ts +69 -6
- package/dist/types/api-client.d.ts +22 -9
- package/dist/types/channel.d.ts +550 -300
- package/dist/types/channel_state.d.ts +167 -22
- package/dist/types/client.d.ts +325 -305
- package/dist/types/configuration/ConfigController.d.ts +172 -0
- package/dist/types/configuration/InstanceConfigurationRegistry.d.ts +192 -0
- package/dist/types/configuration/index.d.ts +3 -0
- package/dist/types/configuration/keys.d.ts +31 -0
- package/dist/types/configuration/shape.d.ts +58 -0
- package/dist/types/configuration/types.d.ts +206 -50
- package/dist/types/configuration/utils/applyInstanceConfiguration.d.ts +59 -0
- package/dist/types/configuration/utils/copyConfigPatch.d.ts +1 -0
- package/dist/types/configuration/utils/declarativeSlices.d.ts +24 -0
- package/dist/types/configuration/utils/deepFreezeConfig.d.ts +22 -0
- package/dist/types/configuration/utils/index.d.ts +1 -0
- package/dist/types/configuration/utils/serverAuthority.d.ts +49 -0
- package/dist/types/connection/ConnectionIdManager.d.ts +67 -0
- package/dist/types/connection/ConnectionRecoveryManager.d.ts +164 -0
- package/dist/types/connection/index.d.ts +4 -0
- package/dist/types/connection/networkConnection/NetworkConnectionObserver.d.ts +153 -0
- package/dist/types/connection/networkConnection/index.d.ts +3 -0
- package/dist/types/connection/networkConnection/reporters.d.ts +43 -0
- package/dist/types/connection/networkConnection/types.d.ts +55 -0
- package/dist/types/connection/wsConnection/StableWSConnection.d.ts +204 -0
- package/dist/types/connection/wsConnection/WSConnection.d.ts +168 -0
- package/dist/types/connection/wsConnection/WSConnectionFallback.d.ts +55 -0
- package/dist/types/connection/wsConnection/config.d.ts +51 -0
- package/dist/types/connection/wsConnection/index.d.ts +4 -0
- package/dist/types/connection/wsConnection/types.d.ts +99 -0
- package/dist/types/constants.d.ts +3 -1
- package/dist/types/entityStore/EntityStore.d.ts +160 -40
- package/dist/types/entityStore/StoreBackedItemIndex.d.ts +48 -29
- package/dist/types/entityStore/index.d.ts +0 -1
- package/dist/types/errors.d.ts +24 -4
- package/dist/types/formatMessageMemo.d.ts +5 -0
- package/dist/types/gen/chat/ChannelApi.d.ts +51 -23
- package/dist/types/gen/chat/ChatApi.d.ts +215 -168
- package/dist/types/gen/models/index.d.ts +2164 -557
- package/dist/types/gen/models/timestamp-guard.d.ts +22 -0
- package/dist/types/gen/moderation/ModerationApi.d.ts +39 -32
- package/dist/types/gen-imports.d.ts +1 -0
- package/dist/types/index.d.ts +20 -7
- package/dist/types/languageNames.d.ts +97 -0
- package/dist/types/logger.d.ts +1 -1
- package/dist/types/messageComposer/CustomDataManager.d.ts +7 -1
- package/dist/types/messageComposer/LocationComposer.d.ts +10 -4
- package/dist/types/messageComposer/attachmentIdentity.d.ts +11 -0
- package/dist/types/messageComposer/attachmentManager.d.ts +48 -10
- package/dist/types/messageComposer/attachmentUtils.d.ts +34 -0
- package/dist/types/messageComposer/configuration/commands.configuration.d.ts +1 -3
- package/dist/types/messageComposer/configuration/configuration.d.ts +9 -1
- package/dist/types/messageComposer/configuration/index.d.ts +0 -1
- package/dist/types/messageComposer/configuration/types.d.ts +57 -1
- package/dist/types/messageComposer/index.d.ts +1 -0
- package/dist/types/messageComposer/linkPreviewsManager.d.ts +10 -4
- package/dist/types/messageComposer/messageComposer.d.ts +210 -14
- package/dist/types/messageComposer/middleware/attachmentManager/postUpload/attachmentEnrichment.d.ts +20 -1
- package/dist/types/messageComposer/middleware/messageComposer/attachments.d.ts +11 -0
- package/dist/types/messageComposer/middleware/messageComposer/types.d.ts +2 -2
- package/dist/types/messageComposer/middleware/pollComposer/index.d.ts +1 -0
- package/dist/types/messageComposer/middleware/pollComposer/state.d.ts +3 -2
- package/dist/types/messageComposer/middleware/pollComposer/types.d.ts +9 -2
- package/dist/types/messageComposer/middleware/pollComposer/validation.d.ts +44 -0
- package/dist/types/messageComposer/middleware/textComposer/commands.d.ts +2 -2
- package/dist/types/messageComposer/middleware/textComposer/mentions.d.ts +94 -229
- package/dist/types/messageComposer/pollComposer.d.ts +8 -3
- package/dist/types/messageComposer/textComposer.d.ts +9 -1
- package/dist/types/messageComposer/types.d.ts +7 -3
- package/dist/types/messageDelivery/MessageDeliveryReporter.d.ts +64 -8
- package/dist/types/messageDelivery/MessageReceiptsTracker.d.ts +48 -11
- package/dist/types/messageOperations/FailedSendCache.d.ts +34 -0
- package/dist/types/messageOperations/MessageOperationStatePolicy.d.ts +52 -6
- package/dist/types/messageOperations/MessageOperations.d.ts +94 -11
- package/dist/types/{entityStore → messageOperations}/applyReactionLocally.d.ts +8 -2
- package/dist/types/messageOperations/createMessageOperations.d.ts +11 -0
- package/dist/types/messageOperations/index.d.ts +7 -1
- package/dist/types/messageOperations/reflectReactionEvent.d.ts +24 -0
- package/dist/types/messageOperations/sendOrdering.d.ts +17 -0
- package/dist/types/messageOperations/settlePendingAttachmentUploads.d.ts +28 -0
- package/dist/types/messageOperations/types.d.ts +66 -1
- package/dist/types/middleware.d.ts +8 -0
- package/dist/types/moderation.d.ts +18 -4
- package/dist/types/notifications/NotificationManager.d.ts +43 -2
- package/dist/types/notifications/types.d.ts +55 -42
- package/dist/types/offline-support/offline_support_api.d.ts +128 -12
- package/dist/types/offline-support/offline_sync_manager.d.ts +26 -5
- package/dist/types/offline-support/queueableOperations.d.ts +106 -0
- package/dist/types/offline-support/types.d.ts +77 -28
- package/dist/types/pagination/FilterBuilder.d.ts +1 -18
- package/dist/types/pagination/cursorDerivation/createdAtAroundPaginationFlags.d.ts +2 -1
- package/dist/types/pagination/cursorDerivation/linearPaginationFlags.d.ts +21 -3
- package/dist/types/pagination/filterCompiler.d.ts +5 -0
- package/dist/types/pagination/paginators/BasePaginator.d.ts +331 -7
- package/dist/types/pagination/paginators/ChannelPaginator.d.ts +54 -11
- package/dist/types/pagination/paginators/MessageIntervalPaginator.d.ts +283 -66
- package/dist/types/pagination/paginators/MessagePaginator.d.ts +10 -9
- package/dist/types/pagination/paginators/PinnedMessagePaginator.d.ts +17 -1
- package/dist/types/pagination/paginators/ReminderPaginator.d.ts +8 -8
- package/dist/types/pagination/paginators/ThreadPaginator.d.ts +57 -0
- package/dist/types/pagination/paginators/index.d.ts +1 -0
- package/dist/types/pagination/utility.normalization.d.ts +29 -2
- package/dist/types/poll.d.ts +41 -14
- package/dist/types/poll_manager.d.ts +3 -2
- package/dist/types/poll_optimistic_votes.d.ts +61 -0
- package/dist/types/reminders/Reminder.d.ts +17 -7
- package/dist/types/reminders/ReminderManager.d.ts +34 -6
- package/dist/types/search/BaseSearchSource.d.ts +50 -25
- package/dist/types/search/ChannelMemberSearchSource.d.ts +11 -6
- package/dist/types/search/ChannelSearchSource.d.ts +27 -5
- package/dist/types/search/MessageSearchSource.d.ts +36 -6
- package/dist/types/search/SearchController.d.ts +44 -11
- package/dist/types/search/UserSearchSource.d.ts +11 -5
- package/dist/types/search/types.d.ts +14 -1
- package/dist/types/signing.d.ts +0 -157
- package/dist/types/thread.d.ts +118 -62
- package/dist/types/thread_manager.d.ts +124 -35
- package/dist/types/token_manager.d.ts +5 -8
- package/dist/types/types.d.ts +138 -562
- package/dist/types/types.utility.d.ts +8 -0
- package/dist/types/upload-utils.d.ts +20 -0
- package/dist/types/uploadManager.d.ts +50 -2
- package/dist/types/utils/FixedSizeQueueCache.d.ts +2 -0
- package/dist/types/utils/WithSubscriptions.d.ts +1 -1
- package/dist/types/utils/objectPath.d.ts +49 -0
- package/dist/types/utils/time.d.ts +85 -0
- package/dist/types/utils.d.ts +63 -40
- package/package.json +22 -33
- package/src/ChannelManager.ts +561 -109
- package/src/CooldownTimer.ts +55 -45
- package/src/EventHandlerPipeline.ts +13 -23
- package/src/LiveLocationManager.ts +191 -37
- package/src/api-client.ts +144 -53
- package/src/channel.ts +1573 -1050
- package/src/channel_state.ts +239 -129
- package/src/client.ts +843 -892
- package/src/client_state.ts +2 -2
- package/src/configuration/ConfigController.ts +298 -0
- package/src/configuration/InstanceConfigurationRegistry.ts +430 -0
- package/src/configuration/index.ts +7 -0
- package/src/configuration/keys.ts +86 -0
- package/src/configuration/shape.ts +776 -0
- package/src/configuration/types.ts +218 -60
- package/src/configuration/utils/applyInstanceConfiguration.ts +184 -0
- package/src/configuration/utils/copyConfigPatch.ts +61 -0
- package/src/configuration/utils/declarativeSlices.ts +81 -0
- package/src/configuration/utils/deepFreezeConfig.ts +33 -0
- package/src/configuration/utils/index.ts +5 -0
- package/src/configuration/utils/serverAuthority.ts +146 -0
- package/src/connection/ConnectionIdManager.ts +153 -0
- package/src/connection/ConnectionRecoveryManager.ts +371 -0
- package/src/connection/index.ts +4 -0
- package/src/connection/networkConnection/NetworkConnectionObserver.ts +281 -0
- package/src/connection/networkConnection/index.ts +3 -0
- package/src/connection/networkConnection/reporters.ts +85 -0
- package/src/connection/networkConnection/types.ts +60 -0
- package/src/{connection.ts → connection/wsConnection/StableWSConnection.ts} +242 -151
- package/src/connection/wsConnection/WSConnection.ts +345 -0
- package/src/connection/wsConnection/WSConnectionFallback.ts +259 -0
- package/src/connection/wsConnection/config.ts +108 -0
- package/src/connection/wsConnection/index.ts +4 -0
- package/src/connection/wsConnection/types.ts +101 -0
- package/src/constants.ts +5 -3
- package/src/entityStore/EntityStore.ts +350 -10
- package/src/entityStore/StoreBackedItemIndex.ts +66 -37
- package/src/entityStore/index.ts +0 -1
- package/src/errors.ts +40 -7
- package/src/formatMessageMemo.ts +23 -0
- package/src/gen/chat/ChannelApi.ts +230 -44
- package/src/gen/chat/ChatApi.ts +1047 -1745
- package/src/gen/models/index.ts +2378 -3721
- package/src/gen/models/timestamp-guard.ts +27 -0
- package/src/gen/moderation/ModerationApi.ts +218 -388
- package/src/gen-imports.ts +1 -0
- package/src/index.ts +82 -6
- package/src/languageNames.ts +103 -0
- package/src/logger.ts +1 -1
- package/src/messageComposer/CustomDataManager.ts +10 -1
- package/src/messageComposer/LocationComposer.ts +68 -20
- package/src/messageComposer/attachmentIdentity.ts +39 -0
- package/src/messageComposer/attachmentManager.ts +191 -68
- package/src/messageComposer/attachmentUtils.ts +58 -0
- package/src/messageComposer/configuration/commands.configuration.ts +1 -26
- package/src/messageComposer/configuration/configuration.ts +22 -3
- package/src/messageComposer/configuration/index.ts +0 -1
- package/src/messageComposer/configuration/types.ts +58 -1
- package/src/messageComposer/index.ts +1 -0
- package/src/messageComposer/linkPreviewsManager.ts +16 -10
- package/src/messageComposer/messageComposer.ts +487 -98
- package/src/messageComposer/middleware/attachmentManager/postUpload/AttachmentPostUploadMiddlewareExecutor.ts +1 -1
- package/src/messageComposer/middleware/attachmentManager/postUpload/attachmentEnrichment.ts +58 -33
- package/src/messageComposer/middleware/attachmentManager/postUpload/uploadErrorHandler.ts +7 -2
- package/src/messageComposer/middleware/attachmentManager/preUpload/blockedUploadNotification.ts +3 -2
- package/src/messageComposer/middleware/messageComposer/attachments.ts +98 -1
- package/src/messageComposer/middleware/messageComposer/linkPreviews.ts +20 -10
- package/src/messageComposer/middleware/messageComposer/sharedLocation.ts +7 -2
- package/src/messageComposer/middleware/messageComposer/types.ts +2 -7
- package/src/messageComposer/middleware/messageComposer/userDataInjection.ts +11 -6
- package/src/messageComposer/middleware/pollComposer/index.ts +1 -0
- package/src/messageComposer/middleware/pollComposer/state.ts +43 -11
- package/src/messageComposer/middleware/pollComposer/types.ts +9 -2
- package/src/messageComposer/middleware/pollComposer/validation.ts +76 -0
- package/src/messageComposer/middleware/textComposer/commandUtils.ts +3 -2
- package/src/messageComposer/middleware/textComposer/commands.ts +1 -2
- package/src/messageComposer/middleware/textComposer/mentions.ts +91 -39
- package/src/messageComposer/pollComposer.ts +11 -3
- package/src/messageComposer/textComposer.ts +36 -4
- package/src/messageComposer/types.ts +19 -14
- package/src/messageDelivery/MessageDeliveryReporter.ts +154 -53
- package/src/messageDelivery/MessageReceiptsTracker.ts +136 -64
- package/src/messageOperations/FailedSendCache.ts +90 -0
- package/src/messageOperations/MessageOperationStatePolicy.ts +269 -27
- package/src/messageOperations/MessageOperations.ts +340 -136
- package/src/{entityStore → messageOperations}/applyReactionLocally.ts +10 -3
- package/src/messageOperations/createMessageOperations.ts +192 -0
- package/src/messageOperations/index.ts +7 -0
- package/src/messageOperations/reflectReactionEvent.ts +51 -0
- package/src/messageOperations/sendOrdering.ts +28 -0
- package/src/messageOperations/settlePendingAttachmentUploads.ts +110 -0
- package/src/messageOperations/types.ts +74 -0
- package/src/middleware.ts +11 -0
- package/src/moderation.ts +47 -24
- package/src/notifications/NotificationManager.ts +73 -3
- package/src/notifications/configuration.ts +10 -8
- package/src/notifications/types.ts +58 -42
- package/src/offline-support/offline_support_api.ts +380 -197
- package/src/offline-support/offline_sync_manager.ts +105 -32
- package/src/offline-support/queueableOperations.ts +270 -0
- package/src/offline-support/types.ts +85 -39
- package/src/pagination/FilterBuilder.ts +1 -22
- package/src/pagination/cursorDerivation/createdAtAroundPaginationFlags.ts +11 -7
- package/src/pagination/cursorDerivation/linearPaginationFlags.ts +25 -7
- package/src/pagination/filterCompiler.ts +17 -0
- package/src/pagination/paginators/BasePaginator.ts +731 -81
- package/src/pagination/paginators/ChannelPaginator.ts +210 -102
- package/src/pagination/paginators/MessageIntervalPaginator.ts +703 -193
- package/src/pagination/paginators/MessagePaginator.ts +45 -36
- package/src/pagination/paginators/PinnedMessagePaginator.ts +74 -28
- package/src/pagination/paginators/ReminderPaginator.ts +15 -13
- package/src/pagination/paginators/ThreadPaginator.ts +181 -0
- package/src/pagination/paginators/UserGroupPaginator.ts +8 -1
- package/src/pagination/paginators/index.ts +1 -0
- package/src/pagination/utility.normalization.ts +37 -9
- package/src/poll.ts +189 -112
- package/src/poll_manager.ts +14 -8
- package/src/poll_optimistic_votes.ts +335 -0
- package/src/reminders/Reminder.ts +34 -16
- package/src/reminders/ReminderManager.ts +68 -41
- package/src/reminders/ReminderTimer.ts +7 -6
- package/src/search/BaseSearchSource.ts +133 -40
- package/src/search/ChannelMemberSearchSource.ts +27 -18
- package/src/search/ChannelSearchSource.ts +61 -7
- package/src/search/MessageSearchSource.ts +133 -28
- package/src/search/SearchController.ts +93 -16
- package/src/search/UserSearchSource.ts +27 -13
- package/src/search/types.ts +14 -1
- package/src/signing.ts +1 -315
- package/src/thread.ts +503 -511
- package/src/thread_manager.ts +339 -204
- package/src/token_manager.ts +12 -32
- package/src/types.ts +159 -780
- package/src/types.utility.ts +14 -0
- package/src/upload-utils.ts +53 -0
- package/src/uploadManager.ts +85 -7
- package/src/utils/FixedSizeQueueCache.ts +5 -0
- package/src/utils/WithSubscriptions.ts +1 -1
- package/src/utils/objectPath.ts +67 -0
- package/src/utils/time.ts +104 -0
- package/src/utils.ts +209 -157
- package/dist/types/base64.d.ts +0 -2
- package/dist/types/configuration/InstanceConfigurationService.d.ts +0 -26
- package/dist/types/connection.d.ts +0 -146
- package/dist/types/connection_fallback.d.ts +0 -42
- package/dist/types/gen/model-decoders/decoders.d.ts +0 -3
- package/dist/types/gen/model-decoders/event-decoder-mapping.d.ts +0 -6
- package/dist/types/insights.d.ts +0 -58
- package/dist/types/pagination/utility.queryChannel.d.ts +0 -26
- package/dist/types/permissions.d.ts +0 -55
- package/dist/types/store.d.ts +0 -125
- package/src/base64.ts +0 -78
- package/src/configuration/InstanceConfigurationService.ts +0 -73
- package/src/connection_fallback.ts +0 -215
- package/src/gen/model-decoders/decoders.ts +0 -2680
- package/src/gen/model-decoders/event-decoder-mapping.ts +0 -198
- package/src/insights.ts +0 -83
- package/src/pagination/utility.queryChannel.ts +0 -84
- package/src/permissions.ts +0 -102
- package/src/store.ts +0 -304
package/dist/types/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
-
import type {
|
|
3
|
-
import type { CustomChannelData, CustomCommandData, CustomEventTypes } from './custom_types';
|
|
2
|
+
import type { CustomEventTypes } from './custom_types';
|
|
4
3
|
import type { NotificationManager } from './notifications';
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
4
|
+
import type { InstanceConfigTree } from './configuration/types';
|
|
5
|
+
import type { DeepPartial } from './types.utility';
|
|
6
|
+
import type { APIError, Attachment, BanRequest, ChannelConfigWithInfo, ChannelOwnCapability, ChannelStateResponseFields, CreateDeviceRequest, CreatePollRequest, DraftPayloadResponse, FlagRequest, Images, MessageResponse, OwnUserResponse, QueryChannelsRequest, QueryMembersPayload, QueryPollsRequest, QueryPollVotesRequest, QueryReactionsRequest, QueryRemindersRequest, QueryThreadsRequest, QueryUsersPayload, ReactionResponse, SearchPayload, SendMessageRequest, SendMessageResponse, SharedLocationResponseData, TimestampNS, TranslateMessageRequest, UpdateChannelRequest, UpdateMessageRequest, UpdateMessageResponse, UpdatePollRequest, UserResponse, WSEvent } from './gen/models';
|
|
7
7
|
import type { ChatApi } from './gen-imports';
|
|
8
8
|
/**
|
|
9
9
|
* Utility Types
|
|
@@ -11,178 +11,53 @@ import type { ChatApi } from './gen-imports';
|
|
|
11
11
|
export type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Omit<T, Keys> & {
|
|
12
12
|
[K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
|
|
13
13
|
}[Keys];
|
|
14
|
-
export type
|
|
15
|
-
|
|
14
|
+
export type RequireAtLeastOne<T> = {
|
|
15
|
+
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Omit<T, K>>;
|
|
16
|
+
}[keyof T];
|
|
16
17
|
/**
|
|
17
18
|
* Response Types
|
|
18
19
|
*/
|
|
20
|
+
/**
|
|
21
|
+
* Legacy response envelope. Every generated response already carries `duration`, and the
|
|
22
|
+
* transport wraps results in `StreamResponse<T>`, which also carries `metadata`.
|
|
23
|
+
*
|
|
24
|
+
* Only still referenced by the hand-written `/moderation/*` methods on `StreamChat` that
|
|
25
|
+
* bypass the generated client. Delete this together with those.
|
|
26
|
+
*/
|
|
19
27
|
export type APIResponse = {
|
|
20
28
|
duration: string;
|
|
21
29
|
};
|
|
22
|
-
export type
|
|
23
|
-
automod?: AutomodDetailsResponse;
|
|
24
|
-
};
|
|
25
|
-
export type Flag = {
|
|
26
|
-
created_at: string;
|
|
27
|
-
created_by_automod: boolean;
|
|
28
|
-
updated_at: string;
|
|
29
|
-
details?: FlagDetails;
|
|
30
|
-
target_message?: MessageResponse;
|
|
31
|
-
target_user?: UserResponse;
|
|
32
|
-
user?: UserResponse;
|
|
33
|
-
};
|
|
34
|
-
export type ChannelUpdateOptions = Omit<UpdateChannelRequest, 'message' | 'members'>;
|
|
30
|
+
export type ChannelUpdateOptions = Omit<UpdateChannelRequest, 'message'>;
|
|
35
31
|
export type ConnectAPIResponse = Promise<void | ConnectionOpen>;
|
|
36
|
-
export type FlagMessageResponse = APIResponse & {
|
|
37
|
-
flag: {
|
|
38
|
-
created_at: string;
|
|
39
|
-
created_by_automod: boolean;
|
|
40
|
-
target_message_id: string;
|
|
41
|
-
updated_at: string;
|
|
42
|
-
user: UserResponse;
|
|
43
|
-
approved_at?: string;
|
|
44
|
-
channel_cid?: string;
|
|
45
|
-
details?: object;
|
|
46
|
-
message_user_id?: string;
|
|
47
|
-
rejected_at?: string;
|
|
48
|
-
reviewed_at?: string;
|
|
49
|
-
reviewed_by?: string;
|
|
50
|
-
};
|
|
51
|
-
review_queue_item_id?: string;
|
|
52
|
-
};
|
|
53
|
-
export type FlagUserResponse = APIResponse & {
|
|
54
|
-
flag: {
|
|
55
|
-
created_at: string;
|
|
56
|
-
created_by_automod: boolean;
|
|
57
|
-
target_user: UserResponse;
|
|
58
|
-
updated_at: string;
|
|
59
|
-
user: UserResponse;
|
|
60
|
-
approved_at?: string;
|
|
61
|
-
details?: object;
|
|
62
|
-
rejected_at?: string;
|
|
63
|
-
reviewed_at?: string;
|
|
64
|
-
reviewed_by?: string;
|
|
65
|
-
};
|
|
66
|
-
review_queue_item_id?: string;
|
|
67
|
-
};
|
|
68
32
|
export type LocalMessage = MessageResponse & {
|
|
69
33
|
status: string;
|
|
70
34
|
error?: StreamAPIError;
|
|
71
35
|
user_id?: string;
|
|
72
36
|
};
|
|
73
|
-
export type
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export type
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
export type
|
|
97
|
-
channel_mutes: ChannelMute[];
|
|
98
|
-
devices: Device[];
|
|
99
|
-
mutes: UserMuteResponse[];
|
|
100
|
-
total_unread_count: number;
|
|
101
|
-
unread_channels: number;
|
|
102
|
-
unread_count: number;
|
|
103
|
-
unread_threads: number;
|
|
104
|
-
invisible?: boolean;
|
|
105
|
-
privacy_settings?: PrivacySettingsResponse;
|
|
106
|
-
push_preferences?: PushPreferencesResponse;
|
|
107
|
-
roles?: string[];
|
|
108
|
-
total_unread_count_by_team?: Record<string, number> | null;
|
|
109
|
-
};
|
|
110
|
-
export type ReactionAPIResponse = APIResponse & {
|
|
111
|
-
message: MessageResponse;
|
|
112
|
-
reaction: ReactionResponse;
|
|
113
|
-
};
|
|
114
|
-
export type SearchAPIResponse = APIResponse & {
|
|
115
|
-
results: {
|
|
116
|
-
message: MessageResponse;
|
|
117
|
-
}[];
|
|
118
|
-
next?: string;
|
|
119
|
-
previous?: string;
|
|
120
|
-
results_warning?: SearchWarning | null;
|
|
121
|
-
};
|
|
122
|
-
export type SendFileAPIResponse = APIResponse & {
|
|
123
|
-
file: string;
|
|
124
|
-
thumb_url?: string;
|
|
125
|
-
};
|
|
126
|
-
export type UpdateChannelAPIResponse = APIResponse & {
|
|
127
|
-
channel: ChannelResponse;
|
|
128
|
-
members: ChannelMemberResponse[];
|
|
129
|
-
message?: MessageResponse;
|
|
130
|
-
};
|
|
131
|
-
export type UsersAPIResponse = APIResponse & {
|
|
132
|
-
users: Array<UserResponse>;
|
|
133
|
-
membership_deletion_task_id?: string;
|
|
134
|
-
};
|
|
135
|
-
export type BanUserOptions = UnBanUserOptions & {
|
|
136
|
-
ban_from_future_channels?: boolean;
|
|
137
|
-
banned_by?: UserResponse;
|
|
138
|
-
banned_by_id?: string;
|
|
139
|
-
ip_ban?: boolean;
|
|
140
|
-
reason?: string;
|
|
141
|
-
timeout?: number;
|
|
142
|
-
delete_messages?: MessageDeletionStrategy;
|
|
143
|
-
delete_reactions?: boolean;
|
|
144
|
-
};
|
|
145
|
-
export type ChannelOptions = {
|
|
146
|
-
limit?: number;
|
|
147
|
-
member_limit?: number;
|
|
148
|
-
message_limit?: number;
|
|
149
|
-
offset?: number;
|
|
150
|
-
presence?: boolean;
|
|
151
|
-
state?: boolean;
|
|
152
|
-
user_id?: string;
|
|
153
|
-
watch?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* Name of a predefined filter to use instead of sending raw
|
|
156
|
-
* `filter_conditions`.
|
|
157
|
-
*
|
|
158
|
-
* The backend resolves the filter template by name and interpolates it using
|
|
159
|
-
* `filter_values`.
|
|
160
|
-
*
|
|
161
|
-
* A regular `sort` can still be passed to `queryChannels()`, but backend
|
|
162
|
-
* precedence rules apply:
|
|
163
|
-
*
|
|
164
|
-
* - if the predefined filter has its own stored sort template, that stored
|
|
165
|
-
* sort takes precedence and the request `sort` is ignored
|
|
166
|
-
* - if the predefined filter does not define a sort template, the request
|
|
167
|
-
* `sort` can still be used
|
|
168
|
-
*/
|
|
169
|
-
predefined_filter?: string;
|
|
170
|
-
/**
|
|
171
|
-
* Values used to interpolate placeholders inside the predefined filter's
|
|
172
|
-
* `filter` template.
|
|
173
|
-
*
|
|
174
|
-
* Example: a template value like `{{user_id}}` can be resolved with
|
|
175
|
-
* `{ user_id: 'alice' }`.
|
|
176
|
-
*
|
|
177
|
-
* Only used when `predefined_filter` is provided.
|
|
178
|
-
*/
|
|
179
|
-
filter_values?: Record<string, unknown>;
|
|
180
|
-
/**
|
|
181
|
-
* Values to interpolate into the predefined filter sort template placeholders.
|
|
182
|
-
* Only used when predefined_filter is provided.
|
|
183
|
-
*/
|
|
184
|
-
sort_values?: Record<string, unknown>;
|
|
185
|
-
};
|
|
37
|
+
export type GetThreadOptions = NonNullable<Parameters<ChatApi['getThread']>[1]>;
|
|
38
|
+
/**
|
|
39
|
+
* The fields that exist on the connected user (`OwnUserResponse`) but not on a plain
|
|
40
|
+
* `UserResponse` — i.e. the own-user-only slice of the user object.
|
|
41
|
+
*
|
|
42
|
+
* Derived, never hand-listed: `client._handleUserEvent` uses this set (through
|
|
43
|
+
* `isOwnUserBaseProperty`) to decide which keys survive a `user.updated` event, so a field
|
|
44
|
+
* missing from it is silently deleted off `client.user`. Deriving it means a spec change
|
|
45
|
+
* cannot desynchronise the two.
|
|
46
|
+
*/
|
|
47
|
+
export type OwnUserBase = Pick<OwnUserResponse, Exclude<keyof OwnUserResponse, keyof UserResponse>>;
|
|
48
|
+
export type BanUserOptions = Omit<BanRequest, 'target_user_id'>;
|
|
49
|
+
/**
|
|
50
|
+
* Everything `queryChannels()` accepts apart from the filter and the sort.
|
|
51
|
+
*
|
|
52
|
+
* Derived from the generated request so new query options appear here automatically.
|
|
53
|
+
*
|
|
54
|
+
* On `predefined_filter`: the backend resolves the named filter template and interpolates it
|
|
55
|
+
* with `filter_values`. A regular `sort` can still be passed, but backend precedence applies —
|
|
56
|
+
* if the predefined filter has its own stored sort template that template wins and the request
|
|
57
|
+
* `sort` is ignored; if it does not, the request `sort` is used. `sort_values` interpolates the
|
|
58
|
+
* stored sort template's placeholders. All three are only read when `predefined_filter` is set.
|
|
59
|
+
*/
|
|
60
|
+
export type ChannelOptions = Omit<QueryChannelsRequest, 'filter_conditions' | 'sort'>;
|
|
186
61
|
export type ChannelStateOptions = {
|
|
187
62
|
offlineMode?: boolean;
|
|
188
63
|
skipInitialization?: string[];
|
|
@@ -197,70 +72,11 @@ export type ChannelStateOptions = {
|
|
|
197
72
|
*/
|
|
198
73
|
withResponse?: boolean;
|
|
199
74
|
};
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
name: string;
|
|
206
|
-
/**
|
|
207
|
-
* @description Whether policy applies to resource owner or not
|
|
208
|
-
*/
|
|
209
|
-
owner: boolean;
|
|
210
|
-
priority: number;
|
|
211
|
-
/**
|
|
212
|
-
* @description List of resources to apply policy to
|
|
213
|
-
*/
|
|
214
|
-
resources: string[];
|
|
215
|
-
/**
|
|
216
|
-
* @description List of roles to apply policy to
|
|
217
|
-
*/
|
|
218
|
-
roles: string[];
|
|
219
|
-
};
|
|
220
|
-
export type Automod = 'disabled' | 'simple' | 'AI' | (string & {});
|
|
221
|
-
export type AutomodBehavior = 'flag' | 'block' | 'shadow_block' | (string & {});
|
|
222
|
-
export type MuteUserOptions = {
|
|
223
|
-
client_id?: string;
|
|
224
|
-
connection_id?: string;
|
|
225
|
-
id?: string;
|
|
226
|
-
reason?: string;
|
|
227
|
-
target_user_id?: string;
|
|
228
|
-
timeout?: number;
|
|
229
|
-
type?: string;
|
|
230
|
-
user?: UserResponse;
|
|
231
|
-
user_id?: string;
|
|
232
|
-
};
|
|
233
|
-
export type PaginationOptions = {
|
|
234
|
-
created_at_after?: string | Date;
|
|
235
|
-
created_at_after_or_equal?: string | Date;
|
|
236
|
-
created_at_before?: string | Date;
|
|
237
|
-
created_at_before_or_equal?: string | Date;
|
|
238
|
-
id_gt?: string;
|
|
239
|
-
id_gte?: string;
|
|
240
|
-
id_lt?: string;
|
|
241
|
-
id_lte?: string;
|
|
242
|
-
limit?: number;
|
|
243
|
-
offset?: number;
|
|
244
|
-
};
|
|
245
|
-
export type MessagePaginationOptions = PaginationOptions & {
|
|
246
|
-
created_at_around?: string | Date;
|
|
247
|
-
id_around?: string;
|
|
248
|
-
};
|
|
249
|
-
export type PinnedMessagePaginationOptions = {
|
|
250
|
-
id_around?: string;
|
|
251
|
-
id_gt?: string;
|
|
252
|
-
id_gte?: string;
|
|
253
|
-
id_lt?: string;
|
|
254
|
-
id_lte?: string;
|
|
255
|
-
limit?: number;
|
|
256
|
-
offset?: number;
|
|
257
|
-
pinned_at_after?: string | Date;
|
|
258
|
-
pinned_at_after_or_equal?: string | Date;
|
|
259
|
-
pinned_at_around?: string | Date;
|
|
260
|
-
pinned_at_before?: string | Date;
|
|
261
|
-
pinned_at_before_or_equal?: string | Date;
|
|
262
|
-
};
|
|
263
|
-
export type GetRepliesRequest = Parameters<ChatApi['getReplies']>[0];
|
|
75
|
+
/** The channel-type automod mode, as reported by `channel.getConfig()`. */
|
|
76
|
+
export type Automod = ChannelConfigWithInfo['automod'];
|
|
77
|
+
/** What automod does when it trips, as reported by `channel.getConfig()`. */
|
|
78
|
+
export type AutomodBehavior = ChannelConfigWithInfo['automod_behavior'];
|
|
79
|
+
export type PinnedMessagePaginationOptions = Omit<NonNullable<Parameters<ChatApi['getPinnedMessages']>[1]>, 'sort'>;
|
|
264
80
|
export type QueryMembersOptions = Partial<Omit<QueryMembersPayload, 'filter_conditions'>>;
|
|
265
81
|
export type StreamChatOptions = {
|
|
266
82
|
/**
|
|
@@ -274,31 +90,21 @@ export type StreamChatOptions = {
|
|
|
274
90
|
*/
|
|
275
91
|
baseURL?: string;
|
|
276
92
|
browser?: boolean;
|
|
277
|
-
device?: BaseDeviceFields;
|
|
278
|
-
/**
|
|
279
|
-
* Disables the hydration of all caches within the JS Client. This includes this.activeChannels,
|
|
280
|
-
* this.polls.pollCache and this.config.
|
|
281
|
-
* It is mainly meant to be used for integrations where stream-chat is used as a server-side service
|
|
282
|
-
* interacting with Stream's REST API, not depending on any state and purely serving as a wrapper
|
|
283
|
-
* around HTTP requests. Using this property on either the client side or a backend implementation
|
|
284
|
-
* that also relies on WS events will break these functionalities, so please use carefully.
|
|
285
|
-
*/
|
|
286
|
-
disableCache?: boolean;
|
|
287
|
-
enableInsights?: boolean;
|
|
288
|
-
/**
|
|
289
|
-
* When true, maintains a client-local unread count on channels that have read events disabled
|
|
290
|
-
* (e.g. livestreams). The count increments on incoming messages and is reset via
|
|
291
|
-
* `channel.markReadLocally()`. It is never sent to the backend, but is persisted to the offline DB.
|
|
292
|
-
*/
|
|
293
|
-
isLocalUnreadCountEnabled?: boolean;
|
|
294
|
-
/** experimental feature, please contact support if you want this feature enabled for you */
|
|
295
|
-
enableWSFallback?: boolean;
|
|
296
93
|
/**
|
|
297
94
|
* Custom notification manager service to use for the client.
|
|
298
95
|
* If not provided, a default notification manager will be created.
|
|
299
96
|
* Notifications are used to communicate events like errors, warnings, info, etc. Other services can publish notifications or subscribe to the NotificationManager state changes.
|
|
300
97
|
*/
|
|
301
98
|
notifications?: NotificationManager;
|
|
99
|
+
/**
|
|
100
|
+
* Declarative configuration for instances the SDK creates on your behalf, seeded before the client's
|
|
101
|
+
* own managers are constructed.
|
|
102
|
+
*
|
|
103
|
+
* Equivalent to calling `client.config.set(tree)` immediately after construction, except for the
|
|
104
|
+
* `client` subtree — the configuration registry is created inside the constructor, so this is the only
|
|
105
|
+
* way to configure `reminders` / `notifications` before they are built.
|
|
106
|
+
*/
|
|
107
|
+
config?: DeepPartial<InstanceConfigTree>;
|
|
302
108
|
/**
|
|
303
109
|
* When true, user will be persisted on client. Otherwise if `connectUser` call fails, then you need to
|
|
304
110
|
* call `connectUser` again to retry.
|
|
@@ -306,27 +112,6 @@ export type StreamChatOptions = {
|
|
|
306
112
|
* persist even if connectUser call fails.
|
|
307
113
|
*/
|
|
308
114
|
persistUserOnConnectionFailure?: boolean;
|
|
309
|
-
/**
|
|
310
|
-
* When network is recovered, we re-query the active channels on client. But in single query, you can recover
|
|
311
|
-
* only 30 channels. So its not guaranteed that all the channels in activeChannels object have updated state.
|
|
312
|
-
* Thus in UI sdks, state recovery is managed by components themselves, they don't rely on js client for this.
|
|
313
|
-
*
|
|
314
|
-
* `recoverStateOnReconnect` parameter can be used in such cases, to disable state recovery within js client.
|
|
315
|
-
* When false, user/consumer of this client will need to make sure all the channels present on UI by
|
|
316
|
-
* manually calling queryChannels endpoint.
|
|
317
|
-
*/
|
|
318
|
-
recoverStateOnReconnect?: boolean;
|
|
319
|
-
warmUp?: boolean;
|
|
320
|
-
/**
|
|
321
|
-
* Sets the instance of `StableWSConnection` on the chat client. Intended purely for testing and
|
|
322
|
-
* should not be used in production apps.
|
|
323
|
-
*/
|
|
324
|
-
wsConnection?: StableWSConnection;
|
|
325
|
-
/**
|
|
326
|
-
* Sets a suffix to the wsUrl when it is being built in `wsConnection`. Is meant to be
|
|
327
|
-
* used purely in testing suites and should not be used in production apps.
|
|
328
|
-
*/
|
|
329
|
-
wsUrlParams?: URLSearchParams;
|
|
330
115
|
};
|
|
331
116
|
export type UnBanUserOptions = {
|
|
332
117
|
client_id?: string;
|
|
@@ -337,12 +122,18 @@ export type UnBanUserOptions = {
|
|
|
337
122
|
target_user_id?: string;
|
|
338
123
|
type?: string;
|
|
339
124
|
};
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
125
|
+
/** Everything `queryUsers()` accepts apart from the filter and the sort. */
|
|
126
|
+
export type UserOptions = Omit<QueryUsersPayload, 'filter_conditions' | 'sort'>;
|
|
127
|
+
/**
|
|
128
|
+
* Which of the two connections a status refers to, and so which store it came from.
|
|
129
|
+
*
|
|
130
|
+
* `'network'` is the device's own network status, reported by the platform reporter installed on
|
|
131
|
+
* `client.networkConnection`. `'ws'` is this client's WebSocket. They are different facts and routinely
|
|
132
|
+
* disagree: a socket dies on a working network (server close, expired token, health-check timeout),
|
|
133
|
+
* and a device goes offline while the socket has not noticed yet — which is why each has its own
|
|
134
|
+
* store and neither is derived from the other.
|
|
135
|
+
*/
|
|
136
|
+
export type ConnectionType = 'network' | 'ws';
|
|
346
137
|
type LocalEvent = (({
|
|
347
138
|
type: 'live_location_sharing.started';
|
|
348
139
|
} & {
|
|
@@ -358,17 +149,13 @@ type LocalEvent = (({
|
|
|
358
149
|
channels: ChannelStateResponseFields[];
|
|
359
150
|
isLatestMessageSet: boolean;
|
|
360
151
|
};
|
|
361
|
-
}) | ({
|
|
362
|
-
type: 'transport.changed';
|
|
363
|
-
} & {
|
|
364
|
-
mode: string;
|
|
365
|
-
}) | ({
|
|
366
|
-
type: 'connection.changed';
|
|
367
|
-
} & {
|
|
368
|
-
online: boolean;
|
|
369
152
|
}) | {
|
|
370
153
|
type: 'connection.recovered';
|
|
371
154
|
} | ({
|
|
155
|
+
type: 'connection.fallback_activated';
|
|
156
|
+
} & {
|
|
157
|
+
mode: string;
|
|
158
|
+
}) | ({
|
|
372
159
|
type: 'offline_reactions.queried';
|
|
373
160
|
} & {
|
|
374
161
|
offlineReactions: ReactionResponse[];
|
|
@@ -382,15 +169,17 @@ type LocalEvent = (({
|
|
|
382
169
|
} & {
|
|
383
170
|
channel_type: string;
|
|
384
171
|
cid: string;
|
|
385
|
-
created_at:
|
|
172
|
+
created_at: TimestampNS;
|
|
386
173
|
channel_id?: string;
|
|
387
174
|
last_read_message_id?: string;
|
|
388
175
|
team?: string;
|
|
389
176
|
user?: UserResponse;
|
|
390
177
|
})) & {
|
|
391
|
-
received_at?:
|
|
178
|
+
received_at?: TimestampNS;
|
|
392
179
|
};
|
|
393
|
-
export type Event = WSEvent
|
|
180
|
+
export type Event = (WSEvent & {
|
|
181
|
+
received_at?: TimestampNS;
|
|
182
|
+
}) | LocalEvent | keyof CustomEventTypes;
|
|
394
183
|
export type EventType = Event['type'] | 'all';
|
|
395
184
|
export type EventHandler<T = string> = (event: Extract<Event, {
|
|
396
185
|
type: T;
|
|
@@ -398,234 +187,35 @@ export type EventHandler<T = string> = (event: Extract<Event, {
|
|
|
398
187
|
/**
|
|
399
188
|
* Filter Types
|
|
400
189
|
*/
|
|
401
|
-
export type ReactionFilters = NonNullable<
|
|
402
|
-
export type QueryReactionsRequestWithId = Parameters<ChatApi['queryReactions']>[0];
|
|
190
|
+
export type ReactionFilters = NonNullable<QueryReactionsRequest['filter']>;
|
|
403
191
|
export type ChannelFilters = NonNullable<QueryChannelsRequest['filter_conditions']>;
|
|
404
|
-
export type QueryPollsOptions =
|
|
405
|
-
export type
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
user_id?: string;
|
|
409
|
-
};
|
|
410
|
-
export type QueryVotesOptions = Pager;
|
|
411
|
-
export type QueryPollsFilters = QueryFilters<{
|
|
412
|
-
id?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['id']>, '$eq' | '$in'>> | PrimitiveFilter<PollResponse_old['id']>;
|
|
413
|
-
} & {
|
|
414
|
-
user_id?: RequireOnlyOne<Pick<QueryFilter<VotesFiltersOptions['user_id']>, '$eq' | '$in'>> | PrimitiveFilter<VotesFiltersOptions['user_id']>;
|
|
415
|
-
} & {
|
|
416
|
-
is_closed?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['is_closed']>, '$eq'>> | PrimitiveFilter<PollResponse_old['is_closed']>;
|
|
417
|
-
} & {
|
|
418
|
-
max_votes_allowed?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['max_votes_allowed']>, '$eq' | '$gt' | '$lt' | '$gte' | '$lte'>> | PrimitiveFilter<PollResponse_old['max_votes_allowed']>;
|
|
419
|
-
} & {
|
|
420
|
-
allow_answers?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['allow_answers']>, '$eq'>> | PrimitiveFilter<PollResponse_old['allow_answers']>;
|
|
421
|
-
} & {
|
|
422
|
-
allow_user_suggested_options?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['allow_user_suggested_options']>, '$eq'>> | PrimitiveFilter<PollResponse_old['allow_user_suggested_options']>;
|
|
423
|
-
} & {
|
|
424
|
-
voting_visibility?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['voting_visibility']>, '$eq'>> | PrimitiveFilter<PollResponse_old['voting_visibility']>;
|
|
425
|
-
} & {
|
|
426
|
-
created_at?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['created_at']>, '$eq' | '$gt' | '$lt' | '$gte' | '$lte'>> | PrimitiveFilter<PollResponse_old['created_at']>;
|
|
427
|
-
} & {
|
|
428
|
-
created_by_id?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['created_by_id']>, '$eq' | '$in'>> | PrimitiveFilter<PollResponse_old['created_by_id']>;
|
|
429
|
-
} & {
|
|
430
|
-
updated_at?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['updated_at']>, '$eq' | '$gt' | '$lt' | '$gte' | '$lte'>> | PrimitiveFilter<PollResponse_old['updated_at']>;
|
|
431
|
-
} & {
|
|
432
|
-
name?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['name']>, '$eq' | '$in'>> | PrimitiveFilter<PollResponse_old['name']>;
|
|
433
|
-
}>;
|
|
434
|
-
export type QueryVotesFilters = QueryFilters<{
|
|
435
|
-
id?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['id']>, '$eq' | '$in'>> | PrimitiveFilter<PollResponse_old['id']>;
|
|
436
|
-
} & {
|
|
437
|
-
option_id?: RequireOnlyOne<Pick<QueryFilter<VotesFiltersOptions['option_id']>, '$eq' | '$in'>> | PrimitiveFilter<VotesFiltersOptions['option_id']>;
|
|
438
|
-
} & {
|
|
439
|
-
is_answer?: RequireOnlyOne<Pick<QueryFilter<VotesFiltersOptions['is_answer']>, '$eq'>> | PrimitiveFilter<VotesFiltersOptions['is_answer']>;
|
|
440
|
-
} & {
|
|
441
|
-
user_id?: RequireOnlyOne<Pick<QueryFilter<VotesFiltersOptions['user_id']>, '$eq' | '$in'>> | PrimitiveFilter<VotesFiltersOptions['user_id']>;
|
|
442
|
-
} & {
|
|
443
|
-
created_at?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['created_at']>, '$eq' | '$gt' | '$lt' | '$gte' | '$lte'>> | PrimitiveFilter<PollResponse_old['created_at']>;
|
|
444
|
-
} & {
|
|
445
|
-
created_by_id?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['created_by_id']>, '$eq' | '$in'>> | PrimitiveFilter<PollResponse_old['created_by_id']>;
|
|
446
|
-
} & {
|
|
447
|
-
updated_at?: RequireOnlyOne<Pick<QueryFilter<PollResponse_old['updated_at']>, '$eq' | '$gt' | '$lt' | '$gte' | '$lte'>> | PrimitiveFilter<PollResponse_old['updated_at']>;
|
|
448
|
-
}>;
|
|
192
|
+
export type QueryPollsOptions = Omit<QueryPollsRequest, 'filter' | 'sort'>;
|
|
193
|
+
export type QueryVotesOptions = Omit<QueryPollVotesRequest, 'filter' | 'sort'>;
|
|
194
|
+
export type QueryPollsFilters = NonNullable<QueryPollsRequest['filter']>;
|
|
195
|
+
export type QueryVotesFilters = NonNullable<QueryPollVotesRequest['filter']>;
|
|
449
196
|
export type MessageFilters = NonNullable<SearchPayload['message_filter_conditions']>;
|
|
450
|
-
export type PrimitiveFilter<ObjectType> = ObjectType | null;
|
|
451
|
-
export type QueryFilter<ObjectType = string> = NonNullable<ObjectType> extends string | number | boolean | Date ? {
|
|
452
|
-
$eq?: PrimitiveFilter<ObjectType>;
|
|
453
|
-
$exists?: boolean;
|
|
454
|
-
$gt?: PrimitiveFilter<ObjectType>;
|
|
455
|
-
$gte?: PrimitiveFilter<ObjectType>;
|
|
456
|
-
$in?: PrimitiveFilter<ObjectType>[];
|
|
457
|
-
$lt?: PrimitiveFilter<ObjectType>;
|
|
458
|
-
$lte?: PrimitiveFilter<ObjectType>;
|
|
459
|
-
} : {
|
|
460
|
-
$eq?: PrimitiveFilter<ObjectType>;
|
|
461
|
-
$exists?: boolean;
|
|
462
|
-
$in?: PrimitiveFilter<Unpacked<ObjectType>>[];
|
|
463
|
-
};
|
|
464
197
|
export type UserFilters = QueryUsersPayload['filter_conditions'];
|
|
465
198
|
export type MemberFilters = QueryMembersPayload['filter_conditions'];
|
|
199
|
+
export type OGAttachment = RequireLiteral<Attachment, 'og_scrape_url'>;
|
|
200
|
+
export type PushProvider = CreateDeviceRequest['push_provider'];
|
|
466
201
|
/**
|
|
467
|
-
*
|
|
202
|
+
* Server-provided channel configuration, keyed by **cid** (`messaging:general`, …). Most of
|
|
203
|
+
* `ChannelConfigWithInfo` is a type-level setting, but a channel's `config_overrides` can narrow it for
|
|
204
|
+
* that channel alone, so the effective answer is per channel. Read it via `channel.serverConfig`.
|
|
468
205
|
*/
|
|
469
|
-
export type
|
|
470
|
-
export type
|
|
471
|
-
export type ChannelSort = SortParamRequest[];
|
|
472
|
-
export type PinnedMessagesSort = SortParamRequest[];
|
|
473
|
-
export type UserSort = SortParamRequest[];
|
|
474
|
-
export type MemberSort = SortParamRequest[];
|
|
475
|
-
export type SearchMessageSort = SortParamRequest[];
|
|
476
|
-
export type DraftSort = SortParamRequest[];
|
|
477
|
-
export type PollSort = SortParamRequest[];
|
|
478
|
-
export type VoteSort = SortParamRequest[];
|
|
206
|
+
export type Configs = Record<string, ChannelConfigWithInfo | undefined>;
|
|
207
|
+
export type ConnectionOpen = EventPayload<'health.check'> | EventPayload<'connection.ok'>;
|
|
479
208
|
/**
|
|
480
|
-
*
|
|
209
|
+
* The message `type` values the server can return.
|
|
210
|
+
*
|
|
211
|
+
* Hand-written because there is no generated equivalent: `MessageResponse['type']` is a bare
|
|
212
|
+
* `string`, so deriving it would widen rather than narrow. Both the React and React Native
|
|
213
|
+
* SDKs use this as a discriminant (RN types its SQLite message rows with it).
|
|
481
214
|
*/
|
|
482
|
-
export type APNConfig = {
|
|
483
|
-
auth_key?: string;
|
|
484
|
-
auth_type?: string;
|
|
485
|
-
bundle_id?: string;
|
|
486
|
-
development?: boolean;
|
|
487
|
-
enabled?: boolean;
|
|
488
|
-
host?: string;
|
|
489
|
-
key_id?: string;
|
|
490
|
-
notification_template?: string;
|
|
491
|
-
p12_cert?: string;
|
|
492
|
-
team_id?: string;
|
|
493
|
-
};
|
|
494
|
-
export type AsyncModerationOptions = {
|
|
495
|
-
callback?: {
|
|
496
|
-
mode?: 'CALLBACK_MODE_NONE' | 'CALLBACK_MODE_REST' | 'CALLBACK_MODE_TWIRP';
|
|
497
|
-
server_url?: string;
|
|
498
|
-
};
|
|
499
|
-
timeout_ms?: number;
|
|
500
|
-
};
|
|
501
|
-
export type OGAttachment = RequireLiteral<Attachment, 'og_scrape_url'>;
|
|
502
|
-
export type BlockList = {
|
|
503
|
-
name: string;
|
|
504
|
-
words: string[];
|
|
505
|
-
team?: string;
|
|
506
|
-
type?: string;
|
|
507
|
-
validate?: boolean;
|
|
508
|
-
is_confusable_folding_enabled?: boolean;
|
|
509
|
-
is_leet_check_enabled?: boolean;
|
|
510
|
-
is_plural_check_enabled?: boolean;
|
|
511
|
-
};
|
|
512
|
-
export type ChannelData = ReplacePropertyTypes<ChannelInput, {
|
|
513
|
-
custom: CustomChannelData;
|
|
514
|
-
}>;
|
|
515
|
-
export type PushProvider = CreateDeviceRequest['push_provider'];
|
|
516
|
-
export type PushProviderConfig = PushProviderCommon & PushProviderID & PushProviderAPN & PushProviderFirebase & PushProviderHuawei & PushProviderXiaomi;
|
|
517
|
-
export type PushProviderID = {
|
|
518
|
-
name: string;
|
|
519
|
-
type: PushProvider;
|
|
520
|
-
};
|
|
521
|
-
export type PushProviderCommon = {
|
|
522
|
-
created_at: string;
|
|
523
|
-
updated_at: string;
|
|
524
|
-
description?: string;
|
|
525
|
-
disabled_at?: string;
|
|
526
|
-
disabled_reason?: string;
|
|
527
|
-
};
|
|
528
|
-
export type PushProviderAPN = {
|
|
529
|
-
apn_auth_key?: string;
|
|
530
|
-
apn_auth_type?: 'token' | 'certificate';
|
|
531
|
-
apn_development?: boolean;
|
|
532
|
-
apn_host?: string;
|
|
533
|
-
apn_key_id?: string;
|
|
534
|
-
apn_notification_template?: string;
|
|
535
|
-
apn_p12_cert?: string;
|
|
536
|
-
apn_team_id?: string;
|
|
537
|
-
apn_topic?: string;
|
|
538
|
-
};
|
|
539
|
-
export type PushProviderFirebase = {
|
|
540
|
-
firebase_apn_template?: string;
|
|
541
|
-
firebase_credentials?: string;
|
|
542
|
-
firebase_data_template?: string;
|
|
543
|
-
firebase_notification_template?: string;
|
|
544
|
-
firebase_server_key?: string;
|
|
545
|
-
};
|
|
546
|
-
export type PushProviderHuawei = {
|
|
547
|
-
huawei_app_id?: string;
|
|
548
|
-
huawei_app_secret?: string;
|
|
549
|
-
};
|
|
550
|
-
export type PushProviderXiaomi = {
|
|
551
|
-
xiaomi_package_name?: string;
|
|
552
|
-
xiaomi_secret?: string;
|
|
553
|
-
};
|
|
554
|
-
export type CommandVariants = 'all' | 'ban' | 'fun_set' | 'giphy' | 'moderation_set' | 'mute' | 'unban' | 'unmute' | keyof CustomCommandData;
|
|
555
|
-
export type Configs = Record<string, ChannelConfigWithInfo | undefined>;
|
|
556
|
-
export type ConnectionOpen = EventPayload<'health.check'>;
|
|
557
|
-
export type Device = DeviceFields & {
|
|
558
|
-
provider?: string;
|
|
559
|
-
user?: UserResponse;
|
|
560
|
-
user_id?: string;
|
|
561
|
-
};
|
|
562
|
-
export type BaseDeviceFields = {
|
|
563
|
-
id: string;
|
|
564
|
-
push_provider: PushProvider;
|
|
565
|
-
push_provider_name?: string;
|
|
566
|
-
};
|
|
567
|
-
export type DeviceFields = BaseDeviceFields & {
|
|
568
|
-
created_at: string;
|
|
569
|
-
disabled?: boolean;
|
|
570
|
-
disabled_reason?: string;
|
|
571
|
-
};
|
|
572
|
-
export type FirebaseConfig = {
|
|
573
|
-
apn_template?: string;
|
|
574
|
-
credentials_json?: string;
|
|
575
|
-
data_template?: string;
|
|
576
|
-
enabled?: boolean;
|
|
577
|
-
notification_template?: string;
|
|
578
|
-
server_key?: string;
|
|
579
|
-
};
|
|
580
|
-
export type HuaweiConfig = {
|
|
581
|
-
enabled?: boolean;
|
|
582
|
-
id?: string;
|
|
583
|
-
secret?: string;
|
|
584
|
-
};
|
|
585
|
-
export type XiaomiConfig = {
|
|
586
|
-
enabled?: boolean;
|
|
587
|
-
package_name?: string;
|
|
588
|
-
secret?: string;
|
|
589
|
-
};
|
|
590
215
|
export type MessageLabel = 'deleted' | 'ephemeral' | 'error' | 'regular' | 'reply' | 'system';
|
|
591
216
|
export type SendMessageOptions = Omit<SendMessageRequest, 'message'>;
|
|
592
|
-
export type PermissionObject = {
|
|
593
|
-
action?: 'Deny' | 'Allow';
|
|
594
|
-
name?: string;
|
|
595
|
-
owner?: boolean;
|
|
596
|
-
priority?: number;
|
|
597
|
-
resources?: string[];
|
|
598
|
-
roles?: string[];
|
|
599
|
-
};
|
|
600
|
-
export type Policy = {
|
|
601
|
-
action?: 0 | 1;
|
|
602
|
-
created_at?: string;
|
|
603
|
-
name?: string;
|
|
604
|
-
owner?: boolean;
|
|
605
|
-
priority?: number;
|
|
606
|
-
resources?: string[];
|
|
607
|
-
roles?: string[] | null;
|
|
608
|
-
updated_at?: string;
|
|
609
|
-
};
|
|
610
217
|
export type TokenOrProvider = null | string | TokenProvider | undefined;
|
|
611
218
|
export type TokenProvider = () => Promise<string>;
|
|
612
|
-
export type ReservedUpdatedMessageFields = keyof typeof RESERVED_UPDATED_MESSAGE_FIELDS;
|
|
613
|
-
export type UpdatedMessage = Omit<MessageResponse, ReservedUpdatedMessageFields | 'mentioned_groups'> & {
|
|
614
|
-
mentioned_users?: string[];
|
|
615
|
-
mentioned_channel?: boolean;
|
|
616
|
-
mentioned_here?: boolean;
|
|
617
|
-
mentioned_group_ids?: string[];
|
|
618
|
-
mentioned_roles?: string[];
|
|
619
|
-
type?: MessageLabel;
|
|
620
|
-
};
|
|
621
|
-
export type TaskResponse = {
|
|
622
|
-
task_id: string;
|
|
623
|
-
};
|
|
624
|
-
export type Pager = {
|
|
625
|
-
limit?: number;
|
|
626
|
-
next?: string;
|
|
627
|
-
prev?: string;
|
|
628
|
-
};
|
|
629
219
|
export type MessageSetType = 'latest' | 'current' | 'new';
|
|
630
220
|
export declare class StreamAPIError<T = APIError> extends Error {
|
|
631
221
|
code: number | undefined;
|
|
@@ -652,33 +242,28 @@ export declare class StreamAPIError<T = APIError> extends Error {
|
|
|
652
242
|
readonly status: number | undefined;
|
|
653
243
|
};
|
|
654
244
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
}
|
|
660
|
-
export type PollEnrichData = {
|
|
661
|
-
answers_count: number;
|
|
662
|
-
latest_answers: PollVoteResponseData[];
|
|
663
|
-
latest_votes_by_option: Record<string, PollVoteResponseData[]>;
|
|
664
|
-
vote_count: number;
|
|
665
|
-
vote_counts_by_option: Record<string, number>;
|
|
666
|
-
own_votes?: PollVoteResponseData[];
|
|
667
|
-
};
|
|
245
|
+
/**
|
|
246
|
+
* Poll vote visibility. Derived from the generated request shape so it tracks the spec.
|
|
247
|
+
*/
|
|
248
|
+
export type VotingVisibility = NonNullable<CreatePollRequest['voting_visibility']>;
|
|
668
249
|
export type PartialPollUpdate = {
|
|
669
250
|
set?: Partial<UpdatePollRequest>;
|
|
670
251
|
unset?: Array<keyof UpdatePollRequest>;
|
|
671
252
|
};
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
export type ModerationFlagOptions =
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
253
|
+
/**
|
|
254
|
+
* Options accepted by `moderation.flagUser` / `moderation.flagMessage` on top of the
|
|
255
|
+
* entity they resolve and the `reason` they take positionally.
|
|
256
|
+
*/
|
|
257
|
+
export type ModerationFlagOptions = Omit<FlagRequest, 'entity_id' | 'entity_type' | 'reason'>;
|
|
258
|
+
export type AIState = 'AI_STATE_IDLE' | 'AI_STATE_ERROR' | 'AI_STATE_EXTERNAL_SOURCES' | 'AI_STATE_THINKING' | 'AI_STATE_GENERATING' | 'AI_STATE_STOP' | (string & {});
|
|
259
|
+
export declare const AIStates: {
|
|
260
|
+
readonly Error: "AI_STATE_ERROR";
|
|
261
|
+
readonly ExternalSources: "AI_STATE_EXTERNAL_SOURCES";
|
|
262
|
+
readonly Generating: "AI_STATE_GENERATING";
|
|
263
|
+
readonly Idle: "AI_STATE_IDLE";
|
|
264
|
+
readonly Stop: "AI_STATE_STOP";
|
|
265
|
+
readonly Thinking: "AI_STATE_THINKING";
|
|
680
266
|
};
|
|
681
|
-
export type AIState = 'AI_STATE_ERROR' | 'AI_STATE_CHECKING_SOURCES' | 'AI_STATE_THINKING' | 'AI_STATE_GENERATING' | (string & {});
|
|
682
267
|
/**
|
|
683
268
|
* An identifier containing information about the downstream SDK using stream-chat. It
|
|
684
269
|
* is used to resolve the user agent.
|
|
@@ -707,18 +292,8 @@ export type AppIdentifier = {
|
|
|
707
292
|
};
|
|
708
293
|
export type DraftMessage = DraftPayloadResponse & Partial<Pick<MessageResponse, 'shared_location' | 'mentioned_channel' | 'mentioned_group_ids' | 'mentioned_groups' | 'mentioned_here' | 'mentioned_roles'>>;
|
|
709
294
|
export type SharedLiveLocationResponse = RequireLiteral<SharedLocationResponseData, 'end_at'>;
|
|
710
|
-
export type LiveLocationPayload = RequireLiteral<SharedLocation, 'end_at'>;
|
|
711
|
-
export type ThreadSort = SortParamRequest[];
|
|
712
295
|
export type ThreadFilters = NonNullable<QueryThreadsRequest['filter']>;
|
|
713
|
-
export type
|
|
714
|
-
export type ReminderFilters = QueryFilters<{
|
|
715
|
-
channel_cid?: RequireOnlyOne<Pick<QueryFilter<ReminderResponseData['channel_cid']>, '$eq' | '$in'>> | PrimitiveFilter<ReminderResponseData['channel_cid']>;
|
|
716
|
-
created_at?: RequireOnlyOne<Pick<QueryFilter<ReminderResponseData['created_at']>, '$eq' | '$gt' | '$lt' | '$gte' | '$lte'>> | PrimitiveFilter<ReminderResponseData['created_at']>;
|
|
717
|
-
message_id?: RequireOnlyOne<Pick<QueryFilter<ReminderResponseData['message_id']>, '$eq' | '$in'>> | PrimitiveFilter<ReminderResponseData['message_id']>;
|
|
718
|
-
remind_at?: RequireOnlyOne<Pick<QueryFilter<ReminderResponseData['remind_at']>, '$exists' | '$eq' | '$gt' | '$lt' | '$gte' | '$lte'>> | PrimitiveFilter<ReminderResponseData['remind_at']>;
|
|
719
|
-
user_id?: RequireOnlyOne<Pick<QueryFilter<ReminderResponseData['user_id']>, '$eq' | '$in'>> | PrimitiveFilter<ReminderResponseData['user_id']>;
|
|
720
|
-
}>;
|
|
721
|
-
export type ReminderSort = SortParamRequest[];
|
|
296
|
+
export type ReminderFilters = NonNullable<QueryRemindersRequest['filter']>;
|
|
722
297
|
export type ListUserGroupsOptions = NonNullable<Parameters<ChatApi['listUserGroups']>[0]>;
|
|
723
298
|
export type SearchUserGroupsOptions = Parameters<ChatApi['searchUserGroups']>[0];
|
|
724
299
|
export type RateLimit = {
|
|
@@ -739,43 +314,44 @@ export type EventPayload<T extends Event['type'] | (string & {})> = Extract<Even
|
|
|
739
314
|
type: T;
|
|
740
315
|
}>;
|
|
741
316
|
export type RequireLiteral<L, T extends keyof L> = Omit<L, T> & Required<Pick<L, T>>;
|
|
742
|
-
export type ReplacePropertyTypes<Base, Replacement extends RequireAtLeastOne<Record<keyof Base, any>>> = keyof Replacement extends keyof Base ? Omit<Base, keyof Replacement> & {
|
|
743
|
-
[K in keyof Replacement as undefined extends Base[K] ? never : K]: Replacement[K];
|
|
744
|
-
} & {
|
|
745
|
-
[K in keyof Replacement as undefined extends Base[K] ? K : never]?: Replacement[K];
|
|
746
|
-
} : never;
|
|
747
317
|
export type PartializeAllBut<T, K extends keyof T> = {
|
|
748
318
|
[P in K]-?: T[P];
|
|
749
319
|
} & {
|
|
750
320
|
[P in Exclude<keyof T, K>]?: T[P];
|
|
751
321
|
};
|
|
752
|
-
export type DeleteMessageOptions =
|
|
322
|
+
export type DeleteMessageOptions = NonNullable<Parameters<ChatApi['deleteMessage']>[1]>;
|
|
753
323
|
export type SendMessageAPIResponse = StreamResponse<SendMessageResponse>;
|
|
754
324
|
export type UpdateMessageOptions = Omit<UpdateMessageRequest, 'message'>;
|
|
755
325
|
export type UpdateMessageAPIResponse = StreamResponse<UpdateMessageResponse>;
|
|
326
|
+
/**
|
|
327
|
+
* The Giphy rendition names, derived from the generated `Images` shape so the two cannot
|
|
328
|
+
* drift. Consumed by the React and React Native SDKs to pick a rendition size.
|
|
329
|
+
*/
|
|
756
330
|
export type GiphyVersions = keyof Images;
|
|
757
331
|
export type TranslationLanguage = TranslateMessageRequest['language'];
|
|
758
|
-
export
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
export type PartializeKeys<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>;
|
|
763
|
-
type ErrorResponseDetails = {
|
|
764
|
-
code: number;
|
|
765
|
-
messages: string[];
|
|
766
|
-
};
|
|
767
|
-
export type APIErrorResponse = {
|
|
768
|
-
duration: string;
|
|
769
|
-
message: string;
|
|
770
|
-
more_info: string;
|
|
771
|
-
StatusCode: number;
|
|
772
|
-
code?: number;
|
|
773
|
-
details?: ErrorResponseDetails;
|
|
774
|
-
};
|
|
775
|
-
export type DraftMessagePayload = PartializeKeys<Omit<DraftMessage, 'mentioned_groups'>, 'id'> & {
|
|
776
|
-
user_id?: string;
|
|
332
|
+
export type FileReferenceBase = {
|
|
333
|
+
uri: string;
|
|
334
|
+
type: string;
|
|
335
|
+
name?: string;
|
|
777
336
|
};
|
|
778
|
-
export type
|
|
779
|
-
|
|
780
|
-
|
|
337
|
+
export type FileUploadInput = File | Blob | FileReferenceBase | string;
|
|
338
|
+
/**
|
|
339
|
+
* Structural subset of axios' `AxiosProgressEvent`, kept transport-agnostic on purpose so the
|
|
340
|
+
* public surface does not depend on axios.
|
|
341
|
+
*/
|
|
342
|
+
export type StreamProgressEvent = {
|
|
343
|
+
loaded: number;
|
|
344
|
+
total?: number;
|
|
345
|
+
lengthComputable?: boolean;
|
|
346
|
+
progress?: number;
|
|
347
|
+
};
|
|
348
|
+
export type StreamRequestOptions = {
|
|
349
|
+
signal?: AbortSignal;
|
|
350
|
+
/** Only meaningful for upload (multipart) requests; ignored everywhere else. */
|
|
351
|
+
onUploadProgress?: (event: StreamProgressEvent) => void;
|
|
352
|
+
/**
|
|
353
|
+
* Milliseconds before this request is aborted.
|
|
354
|
+
*/
|
|
355
|
+
timeout?: number;
|
|
781
356
|
};
|
|
357
|
+
export * from './gen/models';
|