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/src/types.ts
CHANGED
|
@@ -1,55 +1,41 @@
|
|
|
1
1
|
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
CustomChannelData,
|
|
5
|
-
CustomCommandData,
|
|
6
|
-
CustomEventTypes,
|
|
7
|
-
} from './custom_types';
|
|
2
|
+
import type { CustomEventTypes } from './custom_types';
|
|
8
3
|
import type { NotificationManager } from './notifications';
|
|
9
|
-
import type {
|
|
4
|
+
import type { InstanceConfigTree } from './configuration/types';
|
|
5
|
+
import type { DeepPartial } from './types.utility';
|
|
10
6
|
import type {
|
|
11
7
|
APIError,
|
|
12
8
|
Attachment,
|
|
13
|
-
|
|
9
|
+
BanRequest,
|
|
14
10
|
ChannelConfigWithInfo,
|
|
15
|
-
ChannelInput,
|
|
16
|
-
ChannelMemberResponse,
|
|
17
|
-
ChannelMute,
|
|
18
11
|
ChannelOwnCapability,
|
|
19
|
-
ChannelResponse,
|
|
20
12
|
ChannelStateResponseFields,
|
|
21
13
|
CreateDeviceRequest,
|
|
14
|
+
CreatePollRequest,
|
|
22
15
|
DraftPayloadResponse,
|
|
16
|
+
FlagRequest,
|
|
23
17
|
Images,
|
|
24
18
|
MessageResponse,
|
|
25
|
-
ModerationPayload,
|
|
26
19
|
OwnUserResponse,
|
|
27
|
-
PollResponseData,
|
|
28
|
-
PollVoteResponseData,
|
|
29
|
-
PrivacySettingsResponse,
|
|
30
|
-
PushPreferencesResponse,
|
|
31
20
|
QueryChannelsRequest,
|
|
32
|
-
QueryFilters,
|
|
33
21
|
QueryMembersPayload,
|
|
22
|
+
QueryPollsRequest,
|
|
23
|
+
QueryPollVotesRequest,
|
|
24
|
+
QueryReactionsRequest,
|
|
25
|
+
QueryRemindersRequest,
|
|
34
26
|
QueryThreadsRequest,
|
|
35
27
|
QueryUsersPayload,
|
|
36
28
|
ReactionResponse,
|
|
37
|
-
ReminderResponseData,
|
|
38
|
-
RequireAtLeastOne,
|
|
39
29
|
SearchPayload,
|
|
40
|
-
SearchWarning,
|
|
41
30
|
SendMessageRequest,
|
|
42
31
|
SendMessageResponse,
|
|
43
|
-
SharedLocation,
|
|
44
32
|
SharedLocationResponseData,
|
|
45
|
-
|
|
33
|
+
TimestampNS,
|
|
46
34
|
TranslateMessageRequest,
|
|
47
35
|
UpdateChannelRequest,
|
|
48
36
|
UpdateMessageRequest,
|
|
49
37
|
UpdateMessageResponse,
|
|
50
|
-
UpdatePollOptionRequest,
|
|
51
38
|
UpdatePollRequest,
|
|
52
|
-
UserMuteResponse,
|
|
53
39
|
UserResponse,
|
|
54
40
|
WSEvent,
|
|
55
41
|
} from './gen/models';
|
|
@@ -64,207 +50,66 @@ export type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Omit<T, Keys> &
|
|
|
64
50
|
[K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
|
|
65
51
|
}[Keys];
|
|
66
52
|
|
|
67
|
-
export type
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
? U
|
|
71
|
-
: T extends (...args: any[]) => infer U
|
|
72
|
-
? U
|
|
73
|
-
: T extends Promise<infer U>
|
|
74
|
-
? U
|
|
75
|
-
: T;
|
|
53
|
+
export type RequireAtLeastOne<T> = {
|
|
54
|
+
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Omit<T, K>>;
|
|
55
|
+
}[keyof T];
|
|
76
56
|
|
|
77
57
|
/**
|
|
78
58
|
* Response Types
|
|
79
59
|
*/
|
|
80
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Legacy response envelope. Every generated response already carries `duration`, and the
|
|
63
|
+
* transport wraps results in `StreamResponse<T>`, which also carries `metadata`.
|
|
64
|
+
*
|
|
65
|
+
* Only still referenced by the hand-written `/moderation/*` methods on `StreamChat` that
|
|
66
|
+
* bypass the generated client. Delete this together with those.
|
|
67
|
+
*/
|
|
81
68
|
export type APIResponse = {
|
|
82
69
|
duration: string;
|
|
83
70
|
};
|
|
84
71
|
|
|
85
|
-
export type
|
|
86
|
-
automod?: AutomodDetailsResponse;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export type Flag = {
|
|
90
|
-
created_at: string;
|
|
91
|
-
created_by_automod: boolean;
|
|
92
|
-
updated_at: string;
|
|
93
|
-
details?: FlagDetails;
|
|
94
|
-
target_message?: MessageResponse;
|
|
95
|
-
target_user?: UserResponse;
|
|
96
|
-
user?: UserResponse;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export type ChannelUpdateOptions = Omit<UpdateChannelRequest, 'message' | 'members'>;
|
|
72
|
+
export type ChannelUpdateOptions = Omit<UpdateChannelRequest, 'message'>;
|
|
100
73
|
|
|
101
74
|
export type ConnectAPIResponse = Promise<void | ConnectionOpen>;
|
|
102
75
|
|
|
103
|
-
export type FlagMessageResponse = APIResponse & {
|
|
104
|
-
flag: {
|
|
105
|
-
created_at: string;
|
|
106
|
-
created_by_automod: boolean;
|
|
107
|
-
target_message_id: string;
|
|
108
|
-
updated_at: string;
|
|
109
|
-
user: UserResponse;
|
|
110
|
-
approved_at?: string;
|
|
111
|
-
channel_cid?: string;
|
|
112
|
-
details?: object; // Any JSON
|
|
113
|
-
message_user_id?: string;
|
|
114
|
-
rejected_at?: string;
|
|
115
|
-
reviewed_at?: string;
|
|
116
|
-
reviewed_by?: string;
|
|
117
|
-
};
|
|
118
|
-
review_queue_item_id?: string;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export type FlagUserResponse = APIResponse & {
|
|
122
|
-
flag: {
|
|
123
|
-
created_at: string;
|
|
124
|
-
created_by_automod: boolean;
|
|
125
|
-
target_user: UserResponse;
|
|
126
|
-
updated_at: string;
|
|
127
|
-
user: UserResponse;
|
|
128
|
-
approved_at?: string;
|
|
129
|
-
details?: object; // Any JSON
|
|
130
|
-
rejected_at?: string;
|
|
131
|
-
reviewed_at?: string;
|
|
132
|
-
reviewed_by?: string;
|
|
133
|
-
};
|
|
134
|
-
review_queue_item_id?: string;
|
|
135
|
-
};
|
|
136
|
-
|
|
137
76
|
export type LocalMessage = MessageResponse & {
|
|
138
77
|
status: string;
|
|
139
78
|
error?: StreamAPIError;
|
|
140
79
|
user_id?: string;
|
|
141
80
|
};
|
|
142
81
|
|
|
143
|
-
|
|
144
|
-
export type PartialThreadUpdate = {
|
|
145
|
-
set?: Partial<Record<string, unknown>>;
|
|
146
|
-
unset?: Array<string>;
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export type GetThreadOptions = Omit<Parameters<ChatApi['getThread']>[0], 'message_id'>;
|
|
82
|
+
export type GetThreadOptions = NonNullable<Parameters<ChatApi['getThread']>[1]>;
|
|
150
83
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
mutes?: Array<UserMuteResponse>;
|
|
165
|
-
own_user?: OwnUserResponse;
|
|
166
|
-
non_existing_users?: string[];
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
export type UnmuteUserResponse = APIResponse & {
|
|
170
|
-
non_existing_users?: string[];
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
export type OwnUserBase = {
|
|
174
|
-
channel_mutes: ChannelMute[];
|
|
175
|
-
devices: Device[];
|
|
176
|
-
mutes: UserMuteResponse[];
|
|
177
|
-
total_unread_count: number;
|
|
178
|
-
unread_channels: number;
|
|
179
|
-
unread_count: number;
|
|
180
|
-
unread_threads: number;
|
|
181
|
-
invisible?: boolean;
|
|
182
|
-
privacy_settings?: PrivacySettingsResponse;
|
|
183
|
-
push_preferences?: PushPreferencesResponse;
|
|
184
|
-
roles?: string[];
|
|
185
|
-
total_unread_count_by_team?: Record<string, number> | null;
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
export type ReactionAPIResponse = APIResponse & {
|
|
189
|
-
message: MessageResponse;
|
|
190
|
-
reaction: ReactionResponse;
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
export type SearchAPIResponse = APIResponse & {
|
|
194
|
-
results: {
|
|
195
|
-
message: MessageResponse;
|
|
196
|
-
}[];
|
|
197
|
-
next?: string;
|
|
198
|
-
previous?: string;
|
|
199
|
-
results_warning?: SearchWarning | null;
|
|
200
|
-
};
|
|
84
|
+
/**
|
|
85
|
+
* The fields that exist on the connected user (`OwnUserResponse`) but not on a plain
|
|
86
|
+
* `UserResponse` — i.e. the own-user-only slice of the user object.
|
|
87
|
+
*
|
|
88
|
+
* Derived, never hand-listed: `client._handleUserEvent` uses this set (through
|
|
89
|
+
* `isOwnUserBaseProperty`) to decide which keys survive a `user.updated` event, so a field
|
|
90
|
+
* missing from it is silently deleted off `client.user`. Deriving it means a spec change
|
|
91
|
+
* cannot desynchronise the two.
|
|
92
|
+
*/
|
|
93
|
+
export type OwnUserBase = Pick<
|
|
94
|
+
OwnUserResponse,
|
|
95
|
+
Exclude<keyof OwnUserResponse, keyof UserResponse>
|
|
96
|
+
>;
|
|
201
97
|
|
|
202
98
|
// Thumb URL(thumb_url) is added considering video attachments as the backend will return the thumbnail in the response.
|
|
203
|
-
export type
|
|
204
|
-
|
|
205
|
-
export type UpdateChannelAPIResponse = APIResponse & {
|
|
206
|
-
channel: ChannelResponse;
|
|
207
|
-
members: ChannelMemberResponse[];
|
|
208
|
-
message?: MessageResponse;
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
export type UsersAPIResponse = APIResponse & {
|
|
212
|
-
users: Array<UserResponse>;
|
|
213
|
-
membership_deletion_task_id?: string;
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
export type BanUserOptions = UnBanUserOptions & {
|
|
217
|
-
ban_from_future_channels?: boolean;
|
|
218
|
-
banned_by?: UserResponse;
|
|
219
|
-
banned_by_id?: string;
|
|
220
|
-
ip_ban?: boolean;
|
|
221
|
-
reason?: string;
|
|
222
|
-
timeout?: number;
|
|
223
|
-
delete_messages?: MessageDeletionStrategy;
|
|
224
|
-
delete_reactions?: boolean;
|
|
225
|
-
};
|
|
99
|
+
export type BanUserOptions = Omit<BanRequest, 'target_user_id'>;
|
|
226
100
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
*
|
|
240
|
-
* The backend resolves the filter template by name and interpolates it using
|
|
241
|
-
* `filter_values`.
|
|
242
|
-
*
|
|
243
|
-
* A regular `sort` can still be passed to `queryChannels()`, but backend
|
|
244
|
-
* precedence rules apply:
|
|
245
|
-
*
|
|
246
|
-
* - if the predefined filter has its own stored sort template, that stored
|
|
247
|
-
* sort takes precedence and the request `sort` is ignored
|
|
248
|
-
* - if the predefined filter does not define a sort template, the request
|
|
249
|
-
* `sort` can still be used
|
|
250
|
-
*/
|
|
251
|
-
predefined_filter?: string;
|
|
252
|
-
/**
|
|
253
|
-
* Values used to interpolate placeholders inside the predefined filter's
|
|
254
|
-
* `filter` template.
|
|
255
|
-
*
|
|
256
|
-
* Example: a template value like `{{user_id}}` can be resolved with
|
|
257
|
-
* `{ user_id: 'alice' }`.
|
|
258
|
-
*
|
|
259
|
-
* Only used when `predefined_filter` is provided.
|
|
260
|
-
*/
|
|
261
|
-
filter_values?: Record<string, unknown>;
|
|
262
|
-
/**
|
|
263
|
-
* Values to interpolate into the predefined filter sort template placeholders.
|
|
264
|
-
* Only used when predefined_filter is provided.
|
|
265
|
-
*/
|
|
266
|
-
sort_values?: Record<string, unknown>;
|
|
267
|
-
};
|
|
101
|
+
/**
|
|
102
|
+
* Everything `queryChannels()` accepts apart from the filter and the sort.
|
|
103
|
+
*
|
|
104
|
+
* Derived from the generated request so new query options appear here automatically.
|
|
105
|
+
*
|
|
106
|
+
* On `predefined_filter`: the backend resolves the named filter template and interpolates it
|
|
107
|
+
* with `filter_values`. A regular `sort` can still be passed, but backend precedence applies —
|
|
108
|
+
* if the predefined filter has its own stored sort template that template wins and the request
|
|
109
|
+
* `sort` is ignored; if it does not, the request `sort` is used. `sort_values` interpolates the
|
|
110
|
+
* stored sort template's placeholders. All three are only read when `predefined_filter` is set.
|
|
111
|
+
*/
|
|
112
|
+
export type ChannelOptions = Omit<QueryChannelsRequest, 'filter_conditions' | 'sort'>;
|
|
268
113
|
|
|
269
114
|
export type ChannelStateOptions = {
|
|
270
115
|
offlineMode?: boolean;
|
|
@@ -281,76 +126,16 @@ export type ChannelStateOptions = {
|
|
|
281
126
|
withResponse?: boolean;
|
|
282
127
|
};
|
|
283
128
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
*/
|
|
289
|
-
name: string;
|
|
290
|
-
/**
|
|
291
|
-
* @description Whether policy applies to resource owner or not
|
|
292
|
-
*/
|
|
293
|
-
owner: boolean;
|
|
294
|
-
priority: number;
|
|
295
|
-
/**
|
|
296
|
-
* @description List of resources to apply policy to
|
|
297
|
-
*/
|
|
298
|
-
resources: string[];
|
|
299
|
-
/**
|
|
300
|
-
* @description List of roles to apply policy to
|
|
301
|
-
*/
|
|
302
|
-
roles: string[];
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
export type Automod = 'disabled' | 'simple' | 'AI' | (string & {});
|
|
306
|
-
export type AutomodBehavior = 'flag' | 'block' | 'shadow_block' | (string & {});
|
|
129
|
+
/** The channel-type automod mode, as reported by `channel.getConfig()`. */
|
|
130
|
+
export type Automod = ChannelConfigWithInfo['automod'];
|
|
131
|
+
/** What automod does when it trips, as reported by `channel.getConfig()`. */
|
|
132
|
+
export type AutomodBehavior = ChannelConfigWithInfo['automod_behavior'];
|
|
307
133
|
|
|
308
|
-
export type
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
reason?: string;
|
|
313
|
-
target_user_id?: string;
|
|
314
|
-
timeout?: number;
|
|
315
|
-
type?: string;
|
|
316
|
-
user?: UserResponse;
|
|
317
|
-
user_id?: string;
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
export type PaginationOptions = {
|
|
321
|
-
created_at_after?: string | Date;
|
|
322
|
-
created_at_after_or_equal?: string | Date;
|
|
323
|
-
created_at_before?: string | Date;
|
|
324
|
-
created_at_before_or_equal?: string | Date;
|
|
325
|
-
id_gt?: string;
|
|
326
|
-
id_gte?: string;
|
|
327
|
-
id_lt?: string;
|
|
328
|
-
id_lte?: string;
|
|
329
|
-
limit?: number;
|
|
330
|
-
offset?: number; // should be avoided with channel.query()
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
export type MessagePaginationOptions = PaginationOptions & {
|
|
334
|
-
created_at_around?: string | Date;
|
|
335
|
-
id_around?: string;
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
export type PinnedMessagePaginationOptions = {
|
|
339
|
-
id_around?: string;
|
|
340
|
-
id_gt?: string;
|
|
341
|
-
id_gte?: string;
|
|
342
|
-
id_lt?: string;
|
|
343
|
-
id_lte?: string;
|
|
344
|
-
limit?: number;
|
|
345
|
-
offset?: number;
|
|
346
|
-
pinned_at_after?: string | Date;
|
|
347
|
-
pinned_at_after_or_equal?: string | Date;
|
|
348
|
-
pinned_at_around?: string | Date;
|
|
349
|
-
pinned_at_before?: string | Date;
|
|
350
|
-
pinned_at_before_or_equal?: string | Date;
|
|
351
|
-
};
|
|
134
|
+
export type PinnedMessagePaginationOptions = Omit<
|
|
135
|
+
NonNullable<Parameters<ChatApi['getPinnedMessages']>[1]>,
|
|
136
|
+
'sort'
|
|
137
|
+
>;
|
|
352
138
|
|
|
353
|
-
export type GetRepliesRequest = Parameters<ChatApi['getReplies']>[0];
|
|
354
139
|
export type QueryMembersOptions = Partial<Omit<QueryMembersPayload, 'filter_conditions'>>;
|
|
355
140
|
|
|
356
141
|
export type StreamChatOptions = {
|
|
@@ -365,31 +150,21 @@ export type StreamChatOptions = {
|
|
|
365
150
|
*/
|
|
366
151
|
baseURL?: string;
|
|
367
152
|
browser?: boolean;
|
|
368
|
-
device?: BaseDeviceFields;
|
|
369
|
-
/**
|
|
370
|
-
* Disables the hydration of all caches within the JS Client. This includes this.activeChannels,
|
|
371
|
-
* this.polls.pollCache and this.config.
|
|
372
|
-
* It is mainly meant to be used for integrations where stream-chat is used as a server-side service
|
|
373
|
-
* interacting with Stream's REST API, not depending on any state and purely serving as a wrapper
|
|
374
|
-
* around HTTP requests. Using this property on either the client side or a backend implementation
|
|
375
|
-
* that also relies on WS events will break these functionalities, so please use carefully.
|
|
376
|
-
*/
|
|
377
|
-
disableCache?: boolean;
|
|
378
|
-
enableInsights?: boolean;
|
|
379
|
-
/**
|
|
380
|
-
* When true, maintains a client-local unread count on channels that have read events disabled
|
|
381
|
-
* (e.g. livestreams). The count increments on incoming messages and is reset via
|
|
382
|
-
* `channel.markReadLocally()`. It is never sent to the backend, but is persisted to the offline DB.
|
|
383
|
-
*/
|
|
384
|
-
isLocalUnreadCountEnabled?: boolean;
|
|
385
|
-
/** experimental feature, please contact support if you want this feature enabled for you */
|
|
386
|
-
enableWSFallback?: boolean;
|
|
387
153
|
/**
|
|
388
154
|
* Custom notification manager service to use for the client.
|
|
389
155
|
* If not provided, a default notification manager will be created.
|
|
390
156
|
* Notifications are used to communicate events like errors, warnings, info, etc. Other services can publish notifications or subscribe to the NotificationManager state changes.
|
|
391
157
|
*/
|
|
392
158
|
notifications?: NotificationManager;
|
|
159
|
+
/**
|
|
160
|
+
* Declarative configuration for instances the SDK creates on your behalf, seeded before the client's
|
|
161
|
+
* own managers are constructed.
|
|
162
|
+
*
|
|
163
|
+
* Equivalent to calling `client.config.set(tree)` immediately after construction, except for the
|
|
164
|
+
* `client` subtree — the configuration registry is created inside the constructor, so this is the only
|
|
165
|
+
* way to configure `reminders` / `notifications` before they are built.
|
|
166
|
+
*/
|
|
167
|
+
config?: DeepPartial<InstanceConfigTree>;
|
|
393
168
|
/**
|
|
394
169
|
* When true, user will be persisted on client. Otherwise if `connectUser` call fails, then you need to
|
|
395
170
|
* call `connectUser` again to retry.
|
|
@@ -397,27 +172,6 @@ export type StreamChatOptions = {
|
|
|
397
172
|
* persist even if connectUser call fails.
|
|
398
173
|
*/
|
|
399
174
|
persistUserOnConnectionFailure?: boolean;
|
|
400
|
-
/**
|
|
401
|
-
* When network is recovered, we re-query the active channels on client. But in single query, you can recover
|
|
402
|
-
* only 30 channels. So its not guaranteed that all the channels in activeChannels object have updated state.
|
|
403
|
-
* Thus in UI sdks, state recovery is managed by components themselves, they don't rely on js client for this.
|
|
404
|
-
*
|
|
405
|
-
* `recoverStateOnReconnect` parameter can be used in such cases, to disable state recovery within js client.
|
|
406
|
-
* When false, user/consumer of this client will need to make sure all the channels present on UI by
|
|
407
|
-
* manually calling queryChannels endpoint.
|
|
408
|
-
*/
|
|
409
|
-
recoverStateOnReconnect?: boolean;
|
|
410
|
-
warmUp?: boolean;
|
|
411
|
-
/**
|
|
412
|
-
* Sets the instance of `StableWSConnection` on the chat client. Intended purely for testing and
|
|
413
|
-
* should not be used in production apps.
|
|
414
|
-
*/
|
|
415
|
-
wsConnection?: StableWSConnection;
|
|
416
|
-
/**
|
|
417
|
-
* Sets a suffix to the wsUrl when it is being built in `wsConnection`. Is meant to be
|
|
418
|
-
* used purely in testing suites and should not be used in production apps.
|
|
419
|
-
*/
|
|
420
|
-
wsUrlParams?: URLSearchParams;
|
|
421
175
|
};
|
|
422
176
|
|
|
423
177
|
export type UnBanUserOptions = {
|
|
@@ -430,12 +184,19 @@ export type UnBanUserOptions = {
|
|
|
430
184
|
type?: string;
|
|
431
185
|
};
|
|
432
186
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
187
|
+
/** Everything `queryUsers()` accepts apart from the filter and the sort. */
|
|
188
|
+
export type UserOptions = Omit<QueryUsersPayload, 'filter_conditions' | 'sort'>;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Which of the two connections a status refers to, and so which store it came from.
|
|
192
|
+
*
|
|
193
|
+
* `'network'` is the device's own network status, reported by the platform reporter installed on
|
|
194
|
+
* `client.networkConnection`. `'ws'` is this client's WebSocket. They are different facts and routinely
|
|
195
|
+
* disagree: a socket dies on a working network (server close, expired token, health-check timeout),
|
|
196
|
+
* and a device goes offline while the socket has not noticed yet — which is why each has its own
|
|
197
|
+
* store and neither is derived from the other.
|
|
198
|
+
*/
|
|
199
|
+
export type ConnectionType = 'network' | 'ws';
|
|
439
200
|
|
|
440
201
|
type LocalEvent = (
|
|
441
202
|
| ({ type: 'live_location_sharing.started' } & { message: MessageResponse })
|
|
@@ -448,9 +209,9 @@ type LocalEvent = (
|
|
|
448
209
|
isLatestMessageSet: boolean;
|
|
449
210
|
};
|
|
450
211
|
})
|
|
451
|
-
| ({ type: 'transport.changed' } & { mode: string })
|
|
452
|
-
| ({ type: 'connection.changed' } & { online: boolean })
|
|
453
212
|
| { type: 'connection.recovered' }
|
|
213
|
+
// `enableWSFallback` switched from the WebSocket to long-polling.
|
|
214
|
+
| ({ type: 'connection.fallback_activated' } & { mode: string })
|
|
454
215
|
| ({ type: 'offline_reactions.queried' } & {
|
|
455
216
|
offlineReactions: ReactionResponse[];
|
|
456
217
|
})
|
|
@@ -461,15 +222,19 @@ type LocalEvent = (
|
|
|
461
222
|
| ({ type: 'message.read_locally' } & {
|
|
462
223
|
channel_type: string;
|
|
463
224
|
cid: string;
|
|
464
|
-
created_at:
|
|
225
|
+
created_at: TimestampNS;
|
|
465
226
|
channel_id?: string;
|
|
466
227
|
last_read_message_id?: string;
|
|
467
228
|
team?: string;
|
|
468
229
|
user?: UserResponse;
|
|
469
230
|
})
|
|
470
|
-
) & { received_at?:
|
|
231
|
+
) & { received_at?: TimestampNS };
|
|
471
232
|
|
|
472
|
-
|
|
233
|
+
// Two WS events miss `received_at` in API spec, so we add it to typedef here
|
|
234
|
+
export type Event =
|
|
235
|
+
| (WSEvent & { received_at?: TimestampNS })
|
|
236
|
+
| LocalEvent
|
|
237
|
+
| keyof CustomEventTypes;
|
|
473
238
|
export type EventType = Event['type'] | 'all';
|
|
474
239
|
|
|
475
240
|
export type EventHandler<T = string> = (event: Extract<Event, { type: T }>) => void;
|
|
@@ -478,336 +243,44 @@ export type EventHandler<T = string> = (event: Extract<Event, { type: T }>) => v
|
|
|
478
243
|
* Filter Types
|
|
479
244
|
*/
|
|
480
245
|
|
|
481
|
-
export type ReactionFilters = NonNullable<
|
|
482
|
-
|
|
483
|
-
export type QueryReactionsRequestWithId = Parameters<ChatApi['queryReactions']>[0];
|
|
246
|
+
export type ReactionFilters = NonNullable<QueryReactionsRequest['filter']>;
|
|
484
247
|
|
|
485
248
|
export type ChannelFilters = NonNullable<QueryChannelsRequest['filter_conditions']>;
|
|
486
249
|
|
|
487
|
-
export type QueryPollsOptions =
|
|
250
|
+
export type QueryPollsOptions = Omit<QueryPollsRequest, 'filter' | 'sort'>;
|
|
488
251
|
|
|
489
|
-
export type
|
|
490
|
-
is_answer?: boolean;
|
|
491
|
-
option_id?: string;
|
|
492
|
-
user_id?: string;
|
|
493
|
-
};
|
|
252
|
+
export type QueryVotesOptions = Omit<QueryPollVotesRequest, 'filter' | 'sort'>;
|
|
494
253
|
|
|
495
|
-
export type
|
|
254
|
+
export type QueryPollsFilters = NonNullable<QueryPollsRequest['filter']>;
|
|
496
255
|
|
|
497
|
-
export type
|
|
498
|
-
{
|
|
499
|
-
id?:
|
|
500
|
-
| RequireOnlyOne<Pick<QueryFilter<PollResponse_old['id']>, '$eq' | '$in'>>
|
|
501
|
-
| PrimitiveFilter<PollResponse_old['id']>;
|
|
502
|
-
} & {
|
|
503
|
-
user_id?:
|
|
504
|
-
| RequireOnlyOne<Pick<QueryFilter<VotesFiltersOptions['user_id']>, '$eq' | '$in'>>
|
|
505
|
-
| PrimitiveFilter<VotesFiltersOptions['user_id']>;
|
|
506
|
-
} & {
|
|
507
|
-
is_closed?:
|
|
508
|
-
| RequireOnlyOne<Pick<QueryFilter<PollResponse_old['is_closed']>, '$eq'>>
|
|
509
|
-
| PrimitiveFilter<PollResponse_old['is_closed']>;
|
|
510
|
-
} & {
|
|
511
|
-
max_votes_allowed?:
|
|
512
|
-
| RequireOnlyOne<
|
|
513
|
-
Pick<
|
|
514
|
-
QueryFilter<PollResponse_old['max_votes_allowed']>,
|
|
515
|
-
'$eq' | '$gt' | '$lt' | '$gte' | '$lte'
|
|
516
|
-
>
|
|
517
|
-
>
|
|
518
|
-
| PrimitiveFilter<PollResponse_old['max_votes_allowed']>;
|
|
519
|
-
} & {
|
|
520
|
-
allow_answers?:
|
|
521
|
-
| RequireOnlyOne<Pick<QueryFilter<PollResponse_old['allow_answers']>, '$eq'>>
|
|
522
|
-
| PrimitiveFilter<PollResponse_old['allow_answers']>;
|
|
523
|
-
} & {
|
|
524
|
-
allow_user_suggested_options?:
|
|
525
|
-
| RequireOnlyOne<
|
|
526
|
-
Pick<QueryFilter<PollResponse_old['allow_user_suggested_options']>, '$eq'>
|
|
527
|
-
>
|
|
528
|
-
| PrimitiveFilter<PollResponse_old['allow_user_suggested_options']>;
|
|
529
|
-
} & {
|
|
530
|
-
voting_visibility?:
|
|
531
|
-
| RequireOnlyOne<Pick<QueryFilter<PollResponse_old['voting_visibility']>, '$eq'>>
|
|
532
|
-
| PrimitiveFilter<PollResponse_old['voting_visibility']>;
|
|
533
|
-
} & {
|
|
534
|
-
created_at?:
|
|
535
|
-
| RequireOnlyOne<
|
|
536
|
-
Pick<
|
|
537
|
-
QueryFilter<PollResponse_old['created_at']>,
|
|
538
|
-
'$eq' | '$gt' | '$lt' | '$gte' | '$lte'
|
|
539
|
-
>
|
|
540
|
-
>
|
|
541
|
-
| PrimitiveFilter<PollResponse_old['created_at']>;
|
|
542
|
-
} & {
|
|
543
|
-
created_by_id?:
|
|
544
|
-
| RequireOnlyOne<
|
|
545
|
-
Pick<QueryFilter<PollResponse_old['created_by_id']>, '$eq' | '$in'>
|
|
546
|
-
>
|
|
547
|
-
| PrimitiveFilter<PollResponse_old['created_by_id']>;
|
|
548
|
-
} & {
|
|
549
|
-
updated_at?:
|
|
550
|
-
| RequireOnlyOne<
|
|
551
|
-
Pick<
|
|
552
|
-
QueryFilter<PollResponse_old['updated_at']>,
|
|
553
|
-
'$eq' | '$gt' | '$lt' | '$gte' | '$lte'
|
|
554
|
-
>
|
|
555
|
-
>
|
|
556
|
-
| PrimitiveFilter<PollResponse_old['updated_at']>;
|
|
557
|
-
} & {
|
|
558
|
-
name?:
|
|
559
|
-
| RequireOnlyOne<Pick<QueryFilter<PollResponse_old['name']>, '$eq' | '$in'>>
|
|
560
|
-
| PrimitiveFilter<PollResponse_old['name']>;
|
|
561
|
-
}
|
|
562
|
-
>;
|
|
563
|
-
|
|
564
|
-
export type QueryVotesFilters = QueryFilters<
|
|
565
|
-
{
|
|
566
|
-
id?:
|
|
567
|
-
| RequireOnlyOne<Pick<QueryFilter<PollResponse_old['id']>, '$eq' | '$in'>>
|
|
568
|
-
| PrimitiveFilter<PollResponse_old['id']>;
|
|
569
|
-
} & {
|
|
570
|
-
option_id?:
|
|
571
|
-
| RequireOnlyOne<Pick<QueryFilter<VotesFiltersOptions['option_id']>, '$eq' | '$in'>>
|
|
572
|
-
| PrimitiveFilter<VotesFiltersOptions['option_id']>;
|
|
573
|
-
} & {
|
|
574
|
-
is_answer?:
|
|
575
|
-
| RequireOnlyOne<Pick<QueryFilter<VotesFiltersOptions['is_answer']>, '$eq'>>
|
|
576
|
-
| PrimitiveFilter<VotesFiltersOptions['is_answer']>;
|
|
577
|
-
} & {
|
|
578
|
-
user_id?:
|
|
579
|
-
| RequireOnlyOne<Pick<QueryFilter<VotesFiltersOptions['user_id']>, '$eq' | '$in'>>
|
|
580
|
-
| PrimitiveFilter<VotesFiltersOptions['user_id']>;
|
|
581
|
-
} & {
|
|
582
|
-
created_at?:
|
|
583
|
-
| RequireOnlyOne<
|
|
584
|
-
Pick<
|
|
585
|
-
QueryFilter<PollResponse_old['created_at']>,
|
|
586
|
-
'$eq' | '$gt' | '$lt' | '$gte' | '$lte'
|
|
587
|
-
>
|
|
588
|
-
>
|
|
589
|
-
| PrimitiveFilter<PollResponse_old['created_at']>;
|
|
590
|
-
} & {
|
|
591
|
-
created_by_id?:
|
|
592
|
-
| RequireOnlyOne<
|
|
593
|
-
Pick<QueryFilter<PollResponse_old['created_by_id']>, '$eq' | '$in'>
|
|
594
|
-
>
|
|
595
|
-
| PrimitiveFilter<PollResponse_old['created_by_id']>;
|
|
596
|
-
} & {
|
|
597
|
-
updated_at?:
|
|
598
|
-
| RequireOnlyOne<
|
|
599
|
-
Pick<
|
|
600
|
-
QueryFilter<PollResponse_old['updated_at']>,
|
|
601
|
-
'$eq' | '$gt' | '$lt' | '$gte' | '$lte'
|
|
602
|
-
>
|
|
603
|
-
>
|
|
604
|
-
| PrimitiveFilter<PollResponse_old['updated_at']>;
|
|
605
|
-
}
|
|
606
|
-
>;
|
|
256
|
+
export type QueryVotesFilters = NonNullable<QueryPollVotesRequest['filter']>;
|
|
607
257
|
|
|
608
258
|
export type MessageFilters = NonNullable<SearchPayload['message_filter_conditions']>;
|
|
609
259
|
|
|
610
|
-
export type PrimitiveFilter<ObjectType> = ObjectType | null;
|
|
611
|
-
|
|
612
|
-
export type QueryFilter<ObjectType = string> =
|
|
613
|
-
NonNullable<ObjectType> extends string | number | boolean | Date
|
|
614
|
-
? {
|
|
615
|
-
$eq?: PrimitiveFilter<ObjectType>;
|
|
616
|
-
$exists?: boolean;
|
|
617
|
-
$gt?: PrimitiveFilter<ObjectType>;
|
|
618
|
-
$gte?: PrimitiveFilter<ObjectType>;
|
|
619
|
-
$in?: PrimitiveFilter<ObjectType>[];
|
|
620
|
-
$lt?: PrimitiveFilter<ObjectType>;
|
|
621
|
-
$lte?: PrimitiveFilter<ObjectType>;
|
|
622
|
-
}
|
|
623
|
-
: {
|
|
624
|
-
$eq?: PrimitiveFilter<ObjectType>;
|
|
625
|
-
$exists?: boolean;
|
|
626
|
-
$in?: PrimitiveFilter<Unpacked<ObjectType>>[];
|
|
627
|
-
};
|
|
628
|
-
|
|
629
260
|
export type UserFilters = QueryUsersPayload['filter_conditions'];
|
|
630
261
|
|
|
631
262
|
export type MemberFilters = QueryMembersPayload['filter_conditions'];
|
|
632
263
|
|
|
633
|
-
/**
|
|
634
|
-
* Sort Types
|
|
635
|
-
*/
|
|
636
|
-
|
|
637
|
-
export type BannedUsersSort = SortParamRequest[];
|
|
638
|
-
|
|
639
|
-
export type ReactionSort = SortParamRequest[];
|
|
640
|
-
|
|
641
|
-
export type ChannelSort = SortParamRequest[];
|
|
642
|
-
|
|
643
|
-
export type PinnedMessagesSort = SortParamRequest[];
|
|
644
|
-
|
|
645
|
-
export type UserSort = SortParamRequest[];
|
|
646
|
-
|
|
647
|
-
export type MemberSort = SortParamRequest[];
|
|
648
|
-
|
|
649
|
-
export type SearchMessageSort = SortParamRequest[];
|
|
650
|
-
|
|
651
|
-
export type DraftSort = SortParamRequest[];
|
|
652
|
-
|
|
653
|
-
export type PollSort = SortParamRequest[];
|
|
654
|
-
|
|
655
|
-
export type VoteSort = SortParamRequest[];
|
|
656
|
-
|
|
657
|
-
/**
|
|
658
|
-
* Base Types
|
|
659
|
-
*/
|
|
660
|
-
|
|
661
|
-
export type APNConfig = {
|
|
662
|
-
auth_key?: string;
|
|
663
|
-
auth_type?: string;
|
|
664
|
-
bundle_id?: string;
|
|
665
|
-
development?: boolean;
|
|
666
|
-
enabled?: boolean;
|
|
667
|
-
host?: string;
|
|
668
|
-
key_id?: string;
|
|
669
|
-
notification_template?: string;
|
|
670
|
-
p12_cert?: string;
|
|
671
|
-
team_id?: string;
|
|
672
|
-
};
|
|
673
|
-
|
|
674
|
-
export type AsyncModerationOptions = {
|
|
675
|
-
callback?: {
|
|
676
|
-
mode?: 'CALLBACK_MODE_NONE' | 'CALLBACK_MODE_REST' | 'CALLBACK_MODE_TWIRP';
|
|
677
|
-
server_url?: string;
|
|
678
|
-
};
|
|
679
|
-
timeout_ms?: number;
|
|
680
|
-
};
|
|
681
|
-
|
|
682
|
-
// export type Attachment = ReplacePropertyTypes<
|
|
683
|
-
// Attachment,
|
|
684
|
-
// { custom: CustomAttachmentData & { file_size?: number; mime_type?: string } }
|
|
685
|
-
// >;
|
|
686
|
-
|
|
687
264
|
export type OGAttachment = RequireLiteral<Attachment, 'og_scrape_url'>;
|
|
688
265
|
|
|
689
|
-
export type BlockList = {
|
|
690
|
-
name: string;
|
|
691
|
-
words: string[];
|
|
692
|
-
team?: string;
|
|
693
|
-
type?: string;
|
|
694
|
-
validate?: boolean;
|
|
695
|
-
is_confusable_folding_enabled?: boolean;
|
|
696
|
-
is_leet_check_enabled?: boolean;
|
|
697
|
-
is_plural_check_enabled?: boolean;
|
|
698
|
-
};
|
|
699
|
-
|
|
700
|
-
export type ChannelData = ReplacePropertyTypes<
|
|
701
|
-
ChannelInput,
|
|
702
|
-
{ custom: CustomChannelData }
|
|
703
|
-
>;
|
|
704
|
-
|
|
705
266
|
export type PushProvider = CreateDeviceRequest['push_provider'];
|
|
706
267
|
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
PushProviderXiaomi;
|
|
713
|
-
|
|
714
|
-
export type PushProviderID = {
|
|
715
|
-
name: string;
|
|
716
|
-
type: PushProvider;
|
|
717
|
-
};
|
|
718
|
-
|
|
719
|
-
export type PushProviderCommon = {
|
|
720
|
-
created_at: string;
|
|
721
|
-
updated_at: string;
|
|
722
|
-
description?: string;
|
|
723
|
-
disabled_at?: string;
|
|
724
|
-
disabled_reason?: string;
|
|
725
|
-
};
|
|
726
|
-
|
|
727
|
-
export type PushProviderAPN = {
|
|
728
|
-
apn_auth_key?: string;
|
|
729
|
-
apn_auth_type?: 'token' | 'certificate';
|
|
730
|
-
apn_development?: boolean;
|
|
731
|
-
apn_host?: string;
|
|
732
|
-
apn_key_id?: string;
|
|
733
|
-
apn_notification_template?: string;
|
|
734
|
-
apn_p12_cert?: string;
|
|
735
|
-
apn_team_id?: string;
|
|
736
|
-
apn_topic?: string;
|
|
737
|
-
};
|
|
738
|
-
|
|
739
|
-
export type PushProviderFirebase = {
|
|
740
|
-
firebase_apn_template?: string;
|
|
741
|
-
firebase_credentials?: string;
|
|
742
|
-
firebase_data_template?: string;
|
|
743
|
-
firebase_notification_template?: string;
|
|
744
|
-
firebase_server_key?: string;
|
|
745
|
-
};
|
|
746
|
-
|
|
747
|
-
export type PushProviderHuawei = {
|
|
748
|
-
huawei_app_id?: string;
|
|
749
|
-
huawei_app_secret?: string;
|
|
750
|
-
};
|
|
751
|
-
|
|
752
|
-
export type PushProviderXiaomi = {
|
|
753
|
-
xiaomi_package_name?: string;
|
|
754
|
-
xiaomi_secret?: string;
|
|
755
|
-
};
|
|
756
|
-
|
|
757
|
-
export type CommandVariants =
|
|
758
|
-
| 'all'
|
|
759
|
-
| 'ban'
|
|
760
|
-
| 'fun_set'
|
|
761
|
-
| 'giphy'
|
|
762
|
-
| 'moderation_set'
|
|
763
|
-
| 'mute'
|
|
764
|
-
| 'unban'
|
|
765
|
-
| 'unmute'
|
|
766
|
-
| keyof CustomCommandData;
|
|
767
|
-
|
|
268
|
+
/**
|
|
269
|
+
* Server-provided channel configuration, keyed by **cid** (`messaging:general`, …). Most of
|
|
270
|
+
* `ChannelConfigWithInfo` is a type-level setting, but a channel's `config_overrides` can narrow it for
|
|
271
|
+
* that channel alone, so the effective answer is per channel. Read it via `channel.serverConfig`.
|
|
272
|
+
*/
|
|
768
273
|
export type Configs = Record<string, ChannelConfigWithInfo | undefined>;
|
|
769
274
|
|
|
770
|
-
export type ConnectionOpen = EventPayload<'health.check'>;
|
|
771
|
-
|
|
772
|
-
export type Device = DeviceFields & {
|
|
773
|
-
provider?: string;
|
|
774
|
-
user?: UserResponse;
|
|
775
|
-
user_id?: string;
|
|
776
|
-
};
|
|
777
|
-
|
|
778
|
-
export type BaseDeviceFields = {
|
|
779
|
-
id: string;
|
|
780
|
-
push_provider: PushProvider;
|
|
781
|
-
push_provider_name?: string;
|
|
782
|
-
};
|
|
783
|
-
|
|
784
|
-
export type DeviceFields = BaseDeviceFields & {
|
|
785
|
-
created_at: string;
|
|
786
|
-
disabled?: boolean;
|
|
787
|
-
disabled_reason?: string;
|
|
788
|
-
};
|
|
789
|
-
|
|
790
|
-
export type FirebaseConfig = {
|
|
791
|
-
apn_template?: string;
|
|
792
|
-
credentials_json?: string;
|
|
793
|
-
data_template?: string;
|
|
794
|
-
enabled?: boolean;
|
|
795
|
-
notification_template?: string;
|
|
796
|
-
server_key?: string;
|
|
797
|
-
};
|
|
798
|
-
|
|
799
|
-
export type HuaweiConfig = {
|
|
800
|
-
enabled?: boolean;
|
|
801
|
-
id?: string;
|
|
802
|
-
secret?: string;
|
|
803
|
-
};
|
|
804
|
-
|
|
805
|
-
export type XiaomiConfig = {
|
|
806
|
-
enabled?: boolean;
|
|
807
|
-
package_name?: string;
|
|
808
|
-
secret?: string;
|
|
809
|
-
};
|
|
275
|
+
export type ConnectionOpen = EventPayload<'health.check'> | EventPayload<'connection.ok'>;
|
|
810
276
|
|
|
277
|
+
/**
|
|
278
|
+
* The message `type` values the server can return.
|
|
279
|
+
*
|
|
280
|
+
* Hand-written because there is no generated equivalent: `MessageResponse['type']` is a bare
|
|
281
|
+
* `string`, so deriving it would widen rather than narrow. Both the React and React Native
|
|
282
|
+
* SDKs use this as a discriminant (RN types its SQLite message rows with it).
|
|
283
|
+
*/
|
|
811
284
|
export type MessageLabel =
|
|
812
285
|
| 'deleted'
|
|
813
286
|
| 'ephemeral'
|
|
@@ -818,54 +291,10 @@ export type MessageLabel =
|
|
|
818
291
|
|
|
819
292
|
export type SendMessageOptions = Omit<SendMessageRequest, 'message'>;
|
|
820
293
|
|
|
821
|
-
export type PermissionObject = {
|
|
822
|
-
action?: 'Deny' | 'Allow';
|
|
823
|
-
name?: string;
|
|
824
|
-
owner?: boolean;
|
|
825
|
-
priority?: number;
|
|
826
|
-
resources?: string[];
|
|
827
|
-
roles?: string[];
|
|
828
|
-
};
|
|
829
|
-
|
|
830
|
-
export type Policy = {
|
|
831
|
-
action?: 0 | 1;
|
|
832
|
-
created_at?: string;
|
|
833
|
-
name?: string;
|
|
834
|
-
owner?: boolean;
|
|
835
|
-
priority?: number;
|
|
836
|
-
resources?: string[];
|
|
837
|
-
roles?: string[] | null;
|
|
838
|
-
updated_at?: string;
|
|
839
|
-
};
|
|
840
|
-
|
|
841
294
|
export type TokenOrProvider = null | string | TokenProvider | undefined;
|
|
842
295
|
|
|
843
296
|
export type TokenProvider = () => Promise<string>;
|
|
844
297
|
|
|
845
|
-
export type ReservedUpdatedMessageFields = keyof typeof RESERVED_UPDATED_MESSAGE_FIELDS;
|
|
846
|
-
|
|
847
|
-
export type UpdatedMessage = Omit<
|
|
848
|
-
MessageResponse,
|
|
849
|
-
ReservedUpdatedMessageFields | 'mentioned_groups'
|
|
850
|
-
> & {
|
|
851
|
-
mentioned_users?: string[];
|
|
852
|
-
mentioned_channel?: boolean;
|
|
853
|
-
mentioned_here?: boolean;
|
|
854
|
-
mentioned_group_ids?: string[];
|
|
855
|
-
mentioned_roles?: string[];
|
|
856
|
-
type?: MessageLabel;
|
|
857
|
-
};
|
|
858
|
-
|
|
859
|
-
export type TaskResponse = {
|
|
860
|
-
task_id: string;
|
|
861
|
-
};
|
|
862
|
-
|
|
863
|
-
export type Pager = {
|
|
864
|
-
limit?: number;
|
|
865
|
-
next?: string;
|
|
866
|
-
prev?: string;
|
|
867
|
-
};
|
|
868
|
-
|
|
869
298
|
export type MessageSetType = 'latest' | 'current' | 'new';
|
|
870
299
|
|
|
871
300
|
export class StreamAPIError<T = APIError> extends Error {
|
|
@@ -934,47 +363,43 @@ export class StreamAPIError<T = APIError> extends Error {
|
|
|
934
363
|
}
|
|
935
364
|
}
|
|
936
365
|
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
public = 'public',
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
export type PollEnrichData = {
|
|
945
|
-
answers_count: number;
|
|
946
|
-
latest_answers: PollVoteResponseData[]; // not updated with WS events, ordered DESC by created_at, seems like updated_at cannot be different from created_at
|
|
947
|
-
latest_votes_by_option: Record<string, PollVoteResponseData[]>; // not updated with WS events; always null in anonymous polls
|
|
948
|
-
vote_count: number;
|
|
949
|
-
vote_counts_by_option: Record<string, number>;
|
|
950
|
-
own_votes?: PollVoteResponseData[]; // not updated with WS events
|
|
951
|
-
};
|
|
366
|
+
/**
|
|
367
|
+
* Poll vote visibility. Derived from the generated request shape so it tracks the spec.
|
|
368
|
+
*/
|
|
369
|
+
export type VotingVisibility = NonNullable<CreatePollRequest['voting_visibility']>;
|
|
952
370
|
|
|
953
371
|
export type PartialPollUpdate = {
|
|
954
372
|
set?: Partial<UpdatePollRequest>;
|
|
955
373
|
unset?: Array<keyof UpdatePollRequest>;
|
|
956
374
|
};
|
|
957
375
|
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
export type
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
custom?: Record<string, unknown>;
|
|
967
|
-
moderation_payload?: ModerationPayload;
|
|
968
|
-
user_id?: string;
|
|
969
|
-
};
|
|
376
|
+
/**
|
|
377
|
+
* Options accepted by `moderation.flagUser` / `moderation.flagMessage` on top of the
|
|
378
|
+
* entity they resolve and the `reason` they take positionally.
|
|
379
|
+
*/
|
|
380
|
+
export type ModerationFlagOptions = Omit<
|
|
381
|
+
FlagRequest,
|
|
382
|
+
'entity_id' | 'entity_type' | 'reason'
|
|
383
|
+
>;
|
|
970
384
|
|
|
971
385
|
export type AIState =
|
|
386
|
+
| 'AI_STATE_IDLE'
|
|
972
387
|
| 'AI_STATE_ERROR'
|
|
973
|
-
| '
|
|
388
|
+
| 'AI_STATE_EXTERNAL_SOURCES'
|
|
974
389
|
| 'AI_STATE_THINKING'
|
|
975
390
|
| 'AI_STATE_GENERATING'
|
|
391
|
+
| 'AI_STATE_STOP'
|
|
976
392
|
| (string & {});
|
|
977
393
|
|
|
394
|
+
export const AIStates = {
|
|
395
|
+
Error: 'AI_STATE_ERROR',
|
|
396
|
+
ExternalSources: 'AI_STATE_EXTERNAL_SOURCES',
|
|
397
|
+
Generating: 'AI_STATE_GENERATING',
|
|
398
|
+
Idle: 'AI_STATE_IDLE',
|
|
399
|
+
Stop: 'AI_STATE_STOP',
|
|
400
|
+
Thinking: 'AI_STATE_THINKING',
|
|
401
|
+
} as const satisfies Record<string, AIState>;
|
|
402
|
+
|
|
978
403
|
/**
|
|
979
404
|
* An identifier containing information about the downstream SDK using stream-chat. It
|
|
980
405
|
* is used to resolve the user agent.
|
|
@@ -1016,45 +441,9 @@ export type SharedLiveLocationResponse = RequireLiteral<
|
|
|
1016
441
|
'end_at'
|
|
1017
442
|
>;
|
|
1018
443
|
|
|
1019
|
-
export type LiveLocationPayload = RequireLiteral<SharedLocation, 'end_at'>;
|
|
1020
|
-
|
|
1021
|
-
export type ThreadSort = SortParamRequest[];
|
|
1022
|
-
|
|
1023
444
|
export type ThreadFilters = NonNullable<QueryThreadsRequest['filter']>;
|
|
1024
445
|
|
|
1025
|
-
export type
|
|
1026
|
-
|
|
1027
|
-
export type ReminderFilters = QueryFilters<{
|
|
1028
|
-
channel_cid?:
|
|
1029
|
-
| RequireOnlyOne<
|
|
1030
|
-
Pick<QueryFilter<ReminderResponseData['channel_cid']>, '$eq' | '$in'>
|
|
1031
|
-
>
|
|
1032
|
-
| PrimitiveFilter<ReminderResponseData['channel_cid']>;
|
|
1033
|
-
created_at?:
|
|
1034
|
-
| RequireOnlyOne<
|
|
1035
|
-
Pick<
|
|
1036
|
-
QueryFilter<ReminderResponseData['created_at']>,
|
|
1037
|
-
'$eq' | '$gt' | '$lt' | '$gte' | '$lte'
|
|
1038
|
-
>
|
|
1039
|
-
>
|
|
1040
|
-
| PrimitiveFilter<ReminderResponseData['created_at']>;
|
|
1041
|
-
message_id?:
|
|
1042
|
-
| RequireOnlyOne<Pick<QueryFilter<ReminderResponseData['message_id']>, '$eq' | '$in'>>
|
|
1043
|
-
| PrimitiveFilter<ReminderResponseData['message_id']>;
|
|
1044
|
-
remind_at?:
|
|
1045
|
-
| RequireOnlyOne<
|
|
1046
|
-
Pick<
|
|
1047
|
-
QueryFilter<ReminderResponseData['remind_at']>,
|
|
1048
|
-
'$exists' | '$eq' | '$gt' | '$lt' | '$gte' | '$lte'
|
|
1049
|
-
>
|
|
1050
|
-
>
|
|
1051
|
-
| PrimitiveFilter<ReminderResponseData['remind_at']>;
|
|
1052
|
-
user_id?:
|
|
1053
|
-
| RequireOnlyOne<Pick<QueryFilter<ReminderResponseData['user_id']>, '$eq' | '$in'>>
|
|
1054
|
-
| PrimitiveFilter<ReminderResponseData['user_id']>;
|
|
1055
|
-
}>;
|
|
1056
|
-
|
|
1057
|
-
export type ReminderSort = SortParamRequest[];
|
|
446
|
+
export type ReminderFilters = NonNullable<QueryRemindersRequest['filter']>;
|
|
1058
447
|
|
|
1059
448
|
export type ListUserGroupsOptions = NonNullable<Parameters<ChatApi['listUserGroups']>[0]>;
|
|
1060
449
|
|
|
@@ -1084,58 +473,48 @@ export type EventPayload<T extends Event['type'] | (string & {})> = Extract<
|
|
|
1084
473
|
|
|
1085
474
|
export type RequireLiteral<L, T extends keyof L> = Omit<L, T> & Required<Pick<L, T>>;
|
|
1086
475
|
|
|
1087
|
-
export type ReplacePropertyTypes<
|
|
1088
|
-
Base,
|
|
1089
|
-
Replacement extends RequireAtLeastOne<Record<keyof Base, any>>,
|
|
1090
|
-
> = keyof Replacement extends keyof Base
|
|
1091
|
-
? Omit<Base, keyof Replacement> & {
|
|
1092
|
-
[K in keyof Replacement as undefined extends Base[K] ? never : K]: Replacement[K];
|
|
1093
|
-
} & {
|
|
1094
|
-
[K in keyof Replacement as undefined extends Base[K] ? K : never]?: Replacement[K];
|
|
1095
|
-
}
|
|
1096
|
-
: never;
|
|
1097
|
-
|
|
1098
476
|
export type PartializeAllBut<T, K extends keyof T> = {
|
|
1099
477
|
[P in K]-?: T[P];
|
|
1100
478
|
} & { [P in Exclude<keyof T, K>]?: T[P] };
|
|
1101
479
|
|
|
1102
|
-
export type DeleteMessageOptions =
|
|
480
|
+
export type DeleteMessageOptions = NonNullable<Parameters<ChatApi['deleteMessage']>[1]>;
|
|
1103
481
|
export type SendMessageAPIResponse = StreamResponse<SendMessageResponse>;
|
|
1104
482
|
export type UpdateMessageOptions = Omit<UpdateMessageRequest, 'message'>;
|
|
1105
483
|
export type UpdateMessageAPIResponse = StreamResponse<UpdateMessageResponse>;
|
|
484
|
+
/**
|
|
485
|
+
* The Giphy rendition names, derived from the generated `Images` shape so the two cannot
|
|
486
|
+
* drift. Consumed by the React and React Native SDKs to pick a rendition size.
|
|
487
|
+
*/
|
|
1106
488
|
export type GiphyVersions = keyof Images;
|
|
1107
489
|
export type TranslationLanguage = TranslateMessageRequest['language'];
|
|
1108
490
|
|
|
1109
|
-
export
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
491
|
+
export type FileReferenceBase = {
|
|
492
|
+
uri: string;
|
|
493
|
+
type: string;
|
|
494
|
+
name?: string;
|
|
1113
495
|
};
|
|
1114
496
|
|
|
1115
|
-
export type
|
|
1116
|
-
|
|
1117
|
-
type ErrorResponseDetails = {
|
|
1118
|
-
code: number;
|
|
1119
|
-
messages: string[];
|
|
1120
|
-
};
|
|
497
|
+
export type FileUploadInput = File | Blob | FileReferenceBase | string;
|
|
1121
498
|
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
499
|
+
/**
|
|
500
|
+
* Structural subset of axios' `AxiosProgressEvent`, kept transport-agnostic on purpose so the
|
|
501
|
+
* public surface does not depend on axios.
|
|
502
|
+
*/
|
|
503
|
+
export type StreamProgressEvent = {
|
|
504
|
+
loaded: number;
|
|
505
|
+
total?: number;
|
|
506
|
+
lengthComputable?: boolean;
|
|
507
|
+
progress?: number;
|
|
1129
508
|
};
|
|
1130
509
|
|
|
1131
|
-
export type
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
510
|
+
export type StreamRequestOptions = {
|
|
511
|
+
signal?: AbortSignal;
|
|
512
|
+
/** Only meaningful for upload (multipart) requests; ignored everywhere else. */
|
|
513
|
+
onUploadProgress?: (event: StreamProgressEvent) => void;
|
|
514
|
+
/**
|
|
515
|
+
* Milliseconds before this request is aborted.
|
|
516
|
+
*/
|
|
517
|
+
timeout?: number;
|
|
1136
518
|
};
|
|
1137
519
|
|
|
1138
|
-
export
|
|
1139
|
-
filter?: ReminderFilters;
|
|
1140
|
-
sort?: ReminderSort;
|
|
1141
|
-
};
|
|
520
|
+
export * from './gen/models';
|