stream-chat 9.50.3 → 10.0.0-rc.2
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/dist/cjs/index.browser.js +19798 -14472
- package/dist/cjs/index.browser.js.map +4 -4
- package/dist/cjs/index.node.js +19817 -14482
- package/dist/cjs/index.node.js.map +4 -4
- package/dist/esm/index.mjs +19795 -14469
- package/dist/esm/index.mjs.map +4 -4
- package/dist/types/ChannelManager.d.ts +221 -0
- package/dist/types/EventHandlerPipeline.d.ts +104 -0
- package/dist/types/api-client.d.ts +26 -0
- package/dist/types/campaign.d.ts +0 -44
- package/dist/types/channel.d.ts +454 -479
- package/dist/types/channel_batch_updater.d.ts +0 -93
- package/dist/types/channel_state.d.ts +53 -201
- package/dist/types/client.d.ts +451 -1920
- package/dist/types/client_state.d.ts +4 -4
- package/dist/types/configuration/InstanceConfigurationService.d.ts +26 -0
- package/dist/types/configuration/index.d.ts +1 -0
- package/dist/types/configuration/types.d.ts +53 -0
- package/dist/types/connection.d.ts +49 -41
- package/dist/types/connection_fallback.d.ts +6 -4
- package/dist/types/constants.d.ts +0 -4
- package/dist/types/custom_types.d.ts +2 -0
- package/dist/types/entityStore/EntityStore.d.ts +111 -0
- package/dist/types/entityStore/StoreBackedItemIndex.d.ts +60 -0
- package/dist/types/entityStore/applyReactionLocally.d.ts +26 -0
- package/dist/types/entityStore/index.d.ts +2 -0
- package/dist/types/errors.d.ts +10 -2
- package/dist/types/gen/chat/ChannelApi.d.ts +45 -0
- package/dist/types/gen/chat/ChatApi.d.ts +334 -0
- package/dist/types/gen/model-decoders/decoders.d.ts +3 -0
- package/dist/types/gen/model-decoders/event-decoder-mapping.d.ts +6 -0
- package/dist/types/gen/models/index.d.ts +8836 -0
- package/dist/types/gen/moderation/ModerationApi.d.ts +50 -0
- package/dist/types/gen-imports.d.ts +3 -0
- package/dist/types/index.d.ts +8 -7
- package/dist/types/insights.d.ts +9 -8
- package/dist/types/logger.d.ts +9 -0
- package/dist/types/messageComposer/LocationComposer.d.ts +7 -4
- package/dist/types/messageComposer/attachmentIdentity.d.ts +2 -2
- package/dist/types/messageComposer/attachmentManager.d.ts +8 -4
- package/dist/types/messageComposer/configuration/types.d.ts +11 -11
- package/dist/types/messageComposer/linkPreviewsManager.d.ts +25 -13
- package/dist/types/messageComposer/messageComposer.d.ts +10 -10
- package/dist/types/messageComposer/middleware/messageComposer/types.d.ts +3 -3
- package/dist/types/messageComposer/middleware/pollComposer/types.d.ts +4 -7
- package/dist/types/messageComposer/middleware/textComposer/commandUtils.d.ts +3 -3
- package/dist/types/messageComposer/middleware/textComposer/commands.d.ts +7 -7
- package/dist/types/messageComposer/middleware/textComposer/mentions.d.ts +218 -4
- package/dist/types/messageComposer/middleware/textComposer/types.d.ts +9 -4
- package/dist/types/messageComposer/pollComposer.d.ts +5 -4
- package/dist/types/messageComposer/textComposer.d.ts +8 -3
- package/dist/types/messageComposer/types.d.ts +6 -28
- package/dist/types/messageDelivery/MessageDeliveryReporter.d.ts +40 -25
- package/dist/types/messageDelivery/MessageReceiptsTracker.d.ts +53 -12
- package/dist/types/messageOperations/MessageOperationStatePolicy.d.ts +19 -0
- package/dist/types/messageOperations/MessageOperations.d.ts +17 -0
- package/dist/types/messageOperations/index.d.ts +3 -0
- package/dist/types/messageOperations/types.d.ts +49 -0
- package/dist/types/moderation.d.ts +21 -203
- package/dist/types/notifications/types.d.ts +8 -7
- package/dist/types/offline-support/offline_support_api.d.ts +111 -87
- package/dist/types/offline-support/offline_sync_manager.d.ts +0 -7
- package/dist/types/offline-support/types.d.ts +19 -23
- package/dist/types/offline-support/util.d.ts +4 -2
- package/dist/types/pagination/FilterBuilder.d.ts +1 -1
- package/dist/types/pagination/ItemIndex.d.ts +25 -0
- package/dist/types/pagination/cursorDerivation/createdAtAroundPaginationFlags.d.ts +9 -0
- package/dist/types/pagination/cursorDerivation/idAroundPaginationFlags.d.ts +6 -0
- package/dist/types/pagination/cursorDerivation/index.d.ts +1 -0
- package/dist/types/pagination/cursorDerivation/linearPaginationFlags.d.ts +6 -0
- package/dist/types/pagination/filterCompiler.d.ts +7 -0
- package/dist/types/pagination/index.d.ts +1 -3
- package/dist/types/pagination/paginators/BasePaginator.d.ts +848 -0
- package/dist/types/pagination/paginators/ChannelPaginator.d.ts +212 -0
- package/dist/types/pagination/paginators/MessageIntervalPaginator.d.ts +282 -0
- package/dist/types/pagination/paginators/MessagePaginator.d.ts +208 -0
- package/dist/types/pagination/paginators/PinnedMessagePaginator.d.ts +39 -0
- package/dist/types/pagination/paginators/ReminderPaginator.d.ts +19 -0
- package/dist/types/pagination/paginators/UserGroupPaginator.d.ts +24 -0
- package/dist/types/pagination/paginators/index.d.ts +7 -0
- package/dist/types/pagination/paginators/stateThrottling.d.ts +2 -0
- package/dist/types/pagination/sortCompiler.d.ts +49 -0
- package/dist/types/pagination/types.normalization.d.ts +11 -0
- package/dist/types/pagination/utility.normalization.d.ts +18 -0
- package/dist/types/pagination/utility.queryChannel.d.ts +26 -0
- package/dist/types/pagination/utility.search.d.ts +13 -0
- package/dist/types/permissions.d.ts +1 -1
- package/dist/types/poll.d.ts +29 -32
- package/dist/types/poll_manager.d.ts +2 -2
- package/dist/types/reminders/Reminder.d.ts +2 -5
- package/dist/types/reminders/ReminderManager.d.ts +2 -9
- package/dist/types/search/MessageSearchSource.d.ts +4 -4
- package/dist/types/search/UserSearchSource.d.ts +1 -1
- package/dist/types/search/types.d.ts +3 -3
- package/dist/types/segment.d.ts +0 -34
- package/dist/types/signing.d.ts +105 -65
- package/dist/types/store.d.ts +1 -0
- package/dist/types/thread.d.ts +70 -34
- package/dist/types/thread_manager.d.ts +3 -3
- package/dist/types/token_manager.d.ts +15 -10
- package/dist/types/types.d.ts +197 -3404
- package/dist/types/utils/FixedSizeQueueCache.d.ts +12 -6
- package/dist/types/utils/WithSubscriptions.d.ts +2 -1
- package/dist/types/utils/concurrency.d.ts +4 -4
- package/dist/types/utils/mergeWith/mergeWith.d.ts +3 -3
- package/dist/types/utils/mergeWith/mergeWithCore.d.ts +8 -3
- package/dist/types/utils/retryable.d.ts +34 -0
- package/dist/types/utils/throttling/throttle.d.ts +36 -0
- package/dist/types/utils.d.ts +100 -194
- package/package.json +7 -3
- package/src/ChannelManager.ts +724 -0
- package/src/CooldownTimer.ts +2 -2
- package/src/EventHandlerPipeline.ts +228 -0
- package/src/LiveLocationManager.ts +12 -11
- package/src/api-client.ts +275 -0
- package/src/campaign.ts +1 -77
- package/src/channel.ts +1344 -1282
- package/src/channel_batch_updater.ts +1 -211
- package/src/channel_state.ts +144 -1013
- package/src/client.ts +936 -3995
- package/src/client_state.ts +4 -4
- package/src/configuration/InstanceConfigurationService.ts +73 -0
- package/src/configuration/index.ts +1 -0
- package/src/configuration/types.ts +81 -0
- package/src/connection.ts +145 -94
- package/src/connection_fallback.ts +29 -27
- package/src/constants.ts +1 -5
- package/src/custom_types.ts +4 -1
- package/src/entityStore/EntityStore.ts +208 -0
- package/src/entityStore/StoreBackedItemIndex.ts +115 -0
- package/src/entityStore/applyReactionLocally.ts +113 -0
- package/src/entityStore/index.ts +2 -0
- package/src/errors.ts +14 -2
- package/src/gen/chat/ChannelApi.ts +275 -0
- package/src/gen/chat/ChatApi.ts +2554 -0
- package/src/gen/model-decoders/decoders.ts +2680 -0
- package/src/gen/model-decoders/event-decoder-mapping.ts +198 -0
- package/src/gen/models/index.ts +12673 -0
- package/src/gen/moderation/ModerationApi.ts +607 -0
- package/src/gen-imports.ts +3 -0
- package/src/index.ts +11 -12
- package/src/insights.ts +6 -5
- package/src/logger.ts +28 -0
- package/src/messageComposer/LocationComposer.ts +9 -5
- package/src/messageComposer/MessageComposerEffectHandlers.ts +1 -0
- package/src/messageComposer/attachmentIdentity.ts +16 -9
- package/src/messageComposer/attachmentManager.ts +13 -8
- package/src/messageComposer/configuration/types.ts +11 -11
- package/src/messageComposer/linkPreviewsManager.ts +9 -10
- package/src/messageComposer/messageComposer.ts +57 -53
- package/src/messageComposer/middleware/messageComposer/attachments.ts +1 -2
- package/src/messageComposer/middleware/messageComposer/cleanData.ts +1 -1
- package/src/messageComposer/middleware/messageComposer/compositionValidation.ts +2 -2
- package/src/messageComposer/middleware/messageComposer/messageComposerState.ts +2 -2
- package/src/messageComposer/middleware/messageComposer/sharedLocation.ts +4 -3
- package/src/messageComposer/middleware/messageComposer/textComposer.ts +2 -2
- package/src/messageComposer/middleware/messageComposer/types.ts +3 -4
- package/src/messageComposer/middleware/messageComposer/userDataInjection.ts +9 -5
- package/src/messageComposer/middleware/pollComposer/state.ts +0 -2
- package/src/messageComposer/middleware/pollComposer/types.ts +4 -7
- package/src/messageComposer/middleware/textComposer/TextComposerMiddlewareExecutor.ts +10 -1
- package/src/messageComposer/middleware/textComposer/commandEffects.ts +4 -4
- package/src/messageComposer/middleware/textComposer/commandUtils.ts +3 -6
- package/src/messageComposer/middleware/textComposer/commands.ts +3 -3
- package/src/messageComposer/middleware/textComposer/mentionUtils.ts +1 -1
- package/src/messageComposer/middleware/textComposer/mentions.ts +31 -15
- package/src/messageComposer/middleware/textComposer/types.ts +9 -4
- package/src/messageComposer/pollComposer.ts +6 -8
- package/src/messageComposer/textComposer.ts +27 -2
- package/src/messageComposer/types.ts +6 -28
- package/src/messageDelivery/MessageDeliveryReporter.ts +101 -45
- package/src/messageDelivery/MessageReceiptsTracker.ts +294 -21
- package/src/messageOperations/MessageOperationStatePolicy.ts +77 -0
- package/src/messageOperations/MessageOperations.ts +212 -0
- package/src/messageOperations/index.ts +10 -0
- package/src/messageOperations/types.ts +64 -0
- package/src/moderation.ts +38 -431
- package/src/notifications/types.ts +8 -7
- package/src/offline-support/offline_support_api.ts +200 -133
- package/src/offline-support/offline_sync_manager.ts +23 -44
- package/src/offline-support/types.ts +23 -26
- package/src/offline-support/util.ts +5 -4
- package/src/pagination/FilterBuilder.ts +4 -1
- package/src/pagination/ItemIndex.ts +25 -0
- package/src/pagination/cursorDerivation/createdAtAroundPaginationFlags.ts +73 -0
- package/src/pagination/cursorDerivation/idAroundPaginationFlags.ts +53 -0
- package/src/pagination/cursorDerivation/index.ts +1 -0
- package/src/pagination/cursorDerivation/linearPaginationFlags.ts +86 -0
- package/src/pagination/filterCompiler.ts +196 -0
- package/src/pagination/index.ts +1 -3
- package/src/pagination/paginators/BasePaginator.ts +2859 -0
- package/src/pagination/paginators/ChannelPaginator.ts +729 -0
- package/src/pagination/paginators/MessageIntervalPaginator.ts +1116 -0
- package/src/pagination/paginators/MessagePaginator.ts +508 -0
- package/src/pagination/paginators/PinnedMessagePaginator.ts +108 -0
- package/src/pagination/paginators/ReminderPaginator.ts +107 -0
- package/src/pagination/paginators/UserGroupPaginator.ts +127 -0
- package/src/pagination/paginators/index.ts +7 -0
- package/src/pagination/paginators/stateThrottling.ts +31 -0
- package/src/pagination/sortCompiler.ts +193 -0
- package/src/pagination/types.normalization.ts +14 -0
- package/src/pagination/utility.normalization.ts +106 -0
- package/src/pagination/utility.queryChannel.ts +84 -0
- package/src/pagination/utility.search.ts +80 -0
- package/src/permissions.ts +7 -8
- package/src/poll.ts +101 -110
- package/src/poll_manager.ts +14 -8
- package/src/reminders/Reminder.ts +2 -5
- package/src/reminders/ReminderManager.ts +19 -21
- package/src/search/BaseSearchSource.ts +0 -3
- package/src/search/ChannelMemberSearchSource.ts +7 -1
- package/src/search/ChannelSearchSource.ts +10 -3
- package/src/search/MessageSearchSource.ts +29 -30
- package/src/search/UserSearchSource.ts +12 -8
- package/src/search/types.ts +3 -4
- package/src/segment.ts +1 -95
- package/src/signing.ts +107 -67
- package/src/store.ts +2 -1
- package/src/thread.ts +562 -238
- package/src/thread_manager.ts +37 -16
- package/src/token_manager.ts +21 -10
- package/src/types.ts +364 -4533
- package/src/uploadManager.ts +8 -0
- package/src/utils/FixedSizeQueueCache.ts +12 -6
- package/src/utils/WithSubscriptions.ts +2 -1
- package/src/utils/concurrency.ts +4 -4
- package/src/utils/mergeWith/mergeWith.ts +3 -3
- package/src/utils/mergeWith/mergeWithCore.ts +140 -164
- package/src/utils/mergeWith/mergeWithDiff.ts +3 -3
- package/src/utils/retryable.ts +117 -0
- package/src/utils/throttling/throttle.ts +130 -0
- package/src/utils.ts +208 -754
- package/dist/types/channel_manager.d.ts +0 -122
- package/dist/types/events.d.ts +0 -72
- package/dist/types/pagination/BasePaginator.d.ts +0 -69
- package/dist/types/pagination/ReminderPaginator.d.ts +0 -16
- package/dist/types/pagination/UserGroupPaginator.d.ts +0 -21
- package/src/channel_manager.ts +0 -830
- package/src/events.ts +0 -75
- package/src/pagination/BasePaginator.ts +0 -184
- package/src/pagination/ReminderPaginator.ts +0 -56
- package/src/pagination/UserGroupPaginator.ts +0 -93
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ApiClient, StreamResponse } from '../../gen-imports';
|
|
2
|
+
import type { AppealRequest, AppealResponse, BanRequest, BulkActionAppealsRequest, BulkActionAppealsResponse, BulkDeleteActionConfigRequest, BulkDeleteActionConfigResponse, BulkUpsertActionConfigRequest, BulkUpsertActionConfigResponse, CreateQueueRequest, DeleteActionConfigResponse, DeleteModerationConfigResponse, DeleteQueueRequest, FlagItemResponse, FlagRequest, GetActionConfigResponse, GetAppealResponse, GetConfigResponse, ListQueuesResponse, ModerationBanResponse, MuteRequest, MuteResponse, QueryAppealsRequest, QueryAppealsResponse, QueryModerationConfigsRequest, QueryModerationConfigsResponse, QueryReviewQueueRequest, QueryReviewQueueResponse, QueueResponse, SubmitActionRequest, SubmitActionResponse, UpdateQueueRequest, UpsertActionConfigRequest, UpsertActionConfigResponse, UpsertConfigRequest, UpsertConfigResponse } from '../models';
|
|
3
|
+
export declare class ModerationApi {
|
|
4
|
+
readonly apiClient: ApiClient;
|
|
5
|
+
constructor(apiClient: ApiClient);
|
|
6
|
+
getActionConfig(request?: {
|
|
7
|
+
queue_type?: string;
|
|
8
|
+
entity_type?: string;
|
|
9
|
+
exclude_defaults?: boolean;
|
|
10
|
+
only_defaults?: boolean;
|
|
11
|
+
}): Promise<StreamResponse<GetActionConfigResponse>>;
|
|
12
|
+
upsertActionConfig(request: UpsertActionConfigRequest): Promise<StreamResponse<UpsertActionConfigResponse>>;
|
|
13
|
+
bulkUpsertActionConfig(request: BulkUpsertActionConfigRequest): Promise<StreamResponse<BulkUpsertActionConfigResponse>>;
|
|
14
|
+
bulkDeleteActionConfig(request: BulkDeleteActionConfigRequest): Promise<StreamResponse<BulkDeleteActionConfigResponse>>;
|
|
15
|
+
deleteActionConfig(request: {
|
|
16
|
+
id: string;
|
|
17
|
+
}): Promise<StreamResponse<DeleteActionConfigResponse>>;
|
|
18
|
+
appeal(request: AppealRequest): Promise<StreamResponse<AppealResponse>>;
|
|
19
|
+
getAppeal(request: {
|
|
20
|
+
id: string;
|
|
21
|
+
}): Promise<StreamResponse<GetAppealResponse>>;
|
|
22
|
+
queryAppeals(request?: QueryAppealsRequest): Promise<StreamResponse<QueryAppealsResponse>>;
|
|
23
|
+
bulkActionAppeals(request: BulkActionAppealsRequest): Promise<StreamResponse<BulkActionAppealsResponse>>;
|
|
24
|
+
ban(request: BanRequest): Promise<StreamResponse<ModerationBanResponse>>;
|
|
25
|
+
upsertConfig(request: UpsertConfigRequest): Promise<StreamResponse<UpsertConfigResponse>>;
|
|
26
|
+
deleteConfig(request: {
|
|
27
|
+
key: string;
|
|
28
|
+
team?: string;
|
|
29
|
+
}): Promise<StreamResponse<DeleteModerationConfigResponse>>;
|
|
30
|
+
getConfig(request: {
|
|
31
|
+
key: string;
|
|
32
|
+
team?: string;
|
|
33
|
+
}): Promise<StreamResponse<GetConfigResponse>>;
|
|
34
|
+
queryModerationConfigs(request?: QueryModerationConfigsRequest): Promise<StreamResponse<QueryModerationConfigsResponse>>;
|
|
35
|
+
flag(request: FlagRequest): Promise<StreamResponse<FlagItemResponse>>;
|
|
36
|
+
mute(request: MuteRequest): Promise<StreamResponse<MuteResponse>>;
|
|
37
|
+
listQueues(): Promise<StreamResponse<ListQueuesResponse>>;
|
|
38
|
+
createQueue(request: CreateQueueRequest): Promise<StreamResponse<QueueResponse>>;
|
|
39
|
+
getQueue(request: {
|
|
40
|
+
id: string;
|
|
41
|
+
}): Promise<StreamResponse<QueueResponse>>;
|
|
42
|
+
updateQueue(request: UpdateQueueRequest & {
|
|
43
|
+
id: string;
|
|
44
|
+
}): Promise<StreamResponse<QueueResponse>>;
|
|
45
|
+
deleteQueue(request: DeleteQueueRequest & {
|
|
46
|
+
id: string;
|
|
47
|
+
}): Promise<StreamResponse<QueueResponse>>;
|
|
48
|
+
queryReviewQueue(request?: QueryReviewQueueRequest): Promise<StreamResponse<QueryReviewQueueResponse>>;
|
|
49
|
+
submitAction(request: SubmitActionRequest): Promise<StreamResponse<SubmitActionResponse>>;
|
|
50
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
export * from './base64';
|
|
2
|
-
export * from './campaign';
|
|
3
|
-
export * from './channel_batch_updater';
|
|
4
2
|
export * from './client';
|
|
5
3
|
export * from './client_state';
|
|
6
4
|
export * from './channel';
|
|
7
5
|
export * from './channel_state';
|
|
6
|
+
export * from './configuration';
|
|
8
7
|
export * from './connection';
|
|
9
8
|
export { type CooldownTimerState } from './CooldownTimer';
|
|
10
|
-
export * from './events';
|
|
11
9
|
export * from './insights';
|
|
10
|
+
export * from './logger';
|
|
12
11
|
export * from './messageComposer';
|
|
13
12
|
export * from './messageDelivery';
|
|
13
|
+
export { EntityStore } from './entityStore/EntityStore';
|
|
14
|
+
export type { EntityStoreChangeBatch, EntityStoreOptions, EntityStoreSubscriber, } from './entityStore/EntityStore';
|
|
14
15
|
export * from './middleware';
|
|
15
16
|
export * from './moderation';
|
|
16
17
|
export * from './notifications';
|
|
@@ -20,18 +21,18 @@ export * from './poll';
|
|
|
20
21
|
export * from './poll_manager';
|
|
21
22
|
export * from './reminders';
|
|
22
23
|
export * from './search';
|
|
23
|
-
export * from './segment';
|
|
24
24
|
export * from './signing';
|
|
25
25
|
export * from './store';
|
|
26
26
|
export { Thread } from './thread';
|
|
27
|
-
export type { ThreadState, ThreadReadState,
|
|
27
|
+
export type { ThreadState, ThreadReadState, ThreadUserReadState } from './thread';
|
|
28
28
|
export * from './thread_manager';
|
|
29
29
|
export * from './token_manager';
|
|
30
30
|
export * from './types';
|
|
31
31
|
export * from './uploadManager';
|
|
32
|
-
export * from './channel_manager';
|
|
33
32
|
export * from './offline-support';
|
|
34
33
|
export * from './LiveLocationManager';
|
|
35
34
|
export type { CustomAttachmentData, CustomChannelData, CustomCommandData, CustomEventData, CustomEventTypes, CustomMemberData, CustomMessageComposerData, CustomMessageData, CustomPollOptionData, CustomPollData, CustomReactionData, CustomUserData, CustomThreadData, } from './custom_types';
|
|
36
|
-
export { isOwnUser, chatCodes, logChatPromiseExecution, localMessageToNewMessagePayload, formatMessage,
|
|
35
|
+
export { isOwnUser, chatCodes, logChatPromiseExecution, localMessageToNewMessagePayload, formatMessage, } from './utils';
|
|
37
36
|
export { FixedSizeQueueCache } from './utils/FixedSizeQueueCache';
|
|
37
|
+
export * from './ChannelManager';
|
|
38
|
+
export * from './EventHandlerPipeline';
|
package/dist/types/insights.d.ts
CHANGED
|
@@ -8,15 +8,16 @@ export declare class InsightMetrics {
|
|
|
8
8
|
constructor();
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* from
|
|
11
|
+
* Posts internal insights telemetry to the Stream insights endpoint. Not intended for end-user use;
|
|
12
|
+
* kept isolated from the client/connection code/logic.
|
|
13
13
|
*
|
|
14
|
-
* @
|
|
15
|
-
* @param
|
|
14
|
+
* @internal
|
|
15
|
+
* @param insightType - The category of insight being reported (e.g. `'ws_fatal'`).
|
|
16
|
+
* @param insights - The insight payload to send.
|
|
16
17
|
*/
|
|
17
18
|
export declare const postInsights: (insightType: InsightTypes, insights: Record<string, unknown>) => Promise<void>;
|
|
18
19
|
export declare function buildWsFatalInsight(connection: StableWSConnection, event: Record<string, unknown>): {
|
|
19
|
-
ready_state: 0 |
|
|
20
|
+
ready_state: 0 | 1 | 2 | 3 | undefined;
|
|
20
21
|
url: string;
|
|
21
22
|
api_key: string;
|
|
22
23
|
start_ts: number | null;
|
|
@@ -24,7 +25,7 @@ export declare function buildWsFatalInsight(connection: StableWSConnection, even
|
|
|
24
25
|
auth_type: string;
|
|
25
26
|
token: string | undefined;
|
|
26
27
|
user_id: string | undefined;
|
|
27
|
-
user_details: import("./
|
|
28
|
+
user_details: import("./client").ClientUser | undefined;
|
|
28
29
|
device: import("./types").BaseDeviceFields | undefined;
|
|
29
30
|
client_id: string | undefined;
|
|
30
31
|
ws_details: import("ws") | undefined;
|
|
@@ -36,7 +37,7 @@ export declare function buildWsFatalInsight(connection: StableWSConnection, even
|
|
|
36
37
|
instance_client_id: string;
|
|
37
38
|
};
|
|
38
39
|
export declare function buildWsSuccessAfterFailureInsight(connection: StableWSConnection): {
|
|
39
|
-
ready_state: 0 |
|
|
40
|
+
ready_state: 0 | 1 | 2 | 3 | undefined;
|
|
40
41
|
url: string;
|
|
41
42
|
api_key: string;
|
|
42
43
|
start_ts: number | null;
|
|
@@ -44,7 +45,7 @@ export declare function buildWsSuccessAfterFailureInsight(connection: StableWSCo
|
|
|
44
45
|
auth_type: string;
|
|
45
46
|
token: string | undefined;
|
|
46
47
|
user_id: string | undefined;
|
|
47
|
-
user_details: import("./
|
|
48
|
+
user_details: import("./client").ClientUser | undefined;
|
|
48
49
|
device: import("./types").BaseDeviceFields | undefined;
|
|
49
50
|
client_id: string | undefined;
|
|
50
51
|
ws_details: import("ws") | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as scopedLogger from '@stream-io/logger';
|
|
2
|
+
export type ChatLoggerScope = 'api-client' | 'channel' | 'channel-manager' | 'client' | 'connection' | 'connection-fallback' | 'message-composer' | 'offline-db' | 'state-store' | 'text-composer' | 'thread' | 'thread-manager' | 'token-manager' | 'upload-manager' | 'utils';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export type ScopedLogger = scopedLogger.Logger<ChatLoggerScope>;
|
|
7
|
+
export { LogLevelEnum } from '@stream-io/logger';
|
|
8
|
+
export type { ConfigureLoggersOptions, LogLevel, Sink } from '@stream-io/logger';
|
|
9
|
+
export declare const chatLoggerSystem: scopedLogger.LoggerSystem<ChatLoggerScope>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StateStore } from '../store';
|
|
2
2
|
import type { MessageComposer } from './messageComposer';
|
|
3
|
-
import type { DraftMessage, LiveLocationPayload, LocalMessage,
|
|
3
|
+
import type { DraftMessage, LiveLocationPayload, LocalMessage, SharedLocation } from '../types';
|
|
4
4
|
export type Coords = {
|
|
5
5
|
latitude: number;
|
|
6
6
|
longitude: number;
|
|
@@ -9,9 +9,12 @@ export type LocationComposerOptions = {
|
|
|
9
9
|
composer: MessageComposer;
|
|
10
10
|
message?: DraftMessage | LocalMessage;
|
|
11
11
|
};
|
|
12
|
-
export type StaticLocationPreview =
|
|
12
|
+
export type StaticLocationPreview = SharedLocation & {
|
|
13
|
+
message_id?: string;
|
|
14
|
+
};
|
|
13
15
|
export type LiveLocationPreview = Omit<LiveLocationPayload, 'end_at'> & {
|
|
14
16
|
durationMs?: number;
|
|
17
|
+
message_id?: string;
|
|
15
18
|
};
|
|
16
19
|
export type LocationComposerState = {
|
|
17
20
|
location: StaticLocationPreview | LiveLocationPreview | null;
|
|
@@ -24,8 +27,8 @@ export declare class LocationComposer {
|
|
|
24
27
|
constructor({ composer, message }: LocationComposerOptions);
|
|
25
28
|
get config(): import("..").LocationComposerConfig;
|
|
26
29
|
get deviceId(): string;
|
|
27
|
-
get location():
|
|
28
|
-
get validLocation():
|
|
30
|
+
get location(): StaticLocationPreview | LiveLocationPreview | null;
|
|
31
|
+
get validLocation(): SharedLocation | null;
|
|
29
32
|
initState: ({ message }?: {
|
|
30
33
|
message?: DraftMessage | LocalMessage;
|
|
31
34
|
}) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Attachment,
|
|
1
|
+
import type { Attachment, SharedLocationResponseData } from '../types';
|
|
2
2
|
import type { AudioAttachment, FileAttachment, GiphyAttachment, ImageAttachment, LocalAttachment, LocalAudioAttachment, LocalFileAttachment, LocalImageAttachment, LocalUploadAttachment, LocalVideoAttachment, LocalVoiceRecordingAttachment, UploadedAttachment, VideoAttachment, VoiceRecordingAttachment } from './types';
|
|
3
3
|
export declare const isScrapedContent: (attachment: Attachment) => boolean;
|
|
4
4
|
export declare const isLocalAttachment: (attachment: unknown) => attachment is LocalAttachment;
|
|
@@ -14,5 +14,5 @@ export declare const isLocalVoiceRecordingAttachment: (attachment: Attachment |
|
|
|
14
14
|
export declare const isVideoAttachment: (attachment: Attachment | LocalAttachment, supportedVideoFormat?: string[]) => attachment is VideoAttachment;
|
|
15
15
|
export declare const isLocalVideoAttachment: (attachment: Attachment | LocalAttachment) => attachment is LocalVideoAttachment;
|
|
16
16
|
export declare const isUploadedAttachment: (attachment: Attachment) => attachment is UploadedAttachment;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const isSharedLocationResponseData: (location: unknown) => location is SharedLocationResponseData;
|
|
18
18
|
export declare const isGiphyAttachment: (attachment: Attachment) => attachment is GiphyAttachment;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AttachmentManagerConfig,
|
|
1
|
+
import type { AttachmentManagerConfig, UploadRequestFn, UploadRequestOptions } from './configuration';
|
|
2
2
|
import { AttachmentPostUploadMiddlewareExecutor, AttachmentPreUploadMiddlewareExecutor } from './middleware/attachmentManager';
|
|
3
3
|
import { StateStore } from '../store';
|
|
4
4
|
import type { AttachmentLoadingState, FileLike, FileReference, LocalAttachment, LocalUploadAttachment, UploadPermissionCheckResult } from './types';
|
|
@@ -26,7 +26,13 @@ export declare class AttachmentManager {
|
|
|
26
26
|
get config(): AttachmentManagerConfig;
|
|
27
27
|
get acceptedFiles(): AttachmentManagerConfig["acceptedFiles"];
|
|
28
28
|
set acceptedFiles(acceptedFiles: AttachmentManagerConfig['acceptedFiles']);
|
|
29
|
+
/**
|
|
30
|
+
@deprecated attachments can be filtered using injecting pre-upload middleware
|
|
31
|
+
*/
|
|
29
32
|
get fileUploadFilter(): AttachmentManagerConfig["fileUploadFilter"];
|
|
33
|
+
/**
|
|
34
|
+
@deprecated attachments can be filtered using injecting pre-upload middleware
|
|
35
|
+
*/
|
|
30
36
|
set fileUploadFilter(fileUploadFilter: AttachmentManagerConfig['fileUploadFilter']);
|
|
31
37
|
get maxNumberOfFilesPerMessage(): AttachmentManagerConfig["maxNumberOfFilesPerMessage"];
|
|
32
38
|
set maxNumberOfFilesPerMessage(maxNumberOfFilesPerMessage: AttachmentManagerConfig['maxNumberOfFilesPerMessage']);
|
|
@@ -67,15 +73,13 @@ export declare class AttachmentManager {
|
|
|
67
73
|
* to prevent recursive calls
|
|
68
74
|
*/
|
|
69
75
|
doDefaultUploadRequest: (fileLike: FileReference | FileLike, options?: UploadRequestOptions) => Promise<{
|
|
70
|
-
blocklist?: import("..").BlockListResponse;
|
|
71
76
|
file: string;
|
|
72
77
|
thumb_url?: string;
|
|
73
78
|
}>;
|
|
74
79
|
/**
|
|
75
80
|
* todo: docs how to customize the image and file upload by overriding do
|
|
76
81
|
*/
|
|
77
|
-
doUploadRequest: (fileLike: FileReference | FileLike, options?: UploadRequestOptions) => Promise<
|
|
78
|
-
blocklist?: import("..").BlockListResponse;
|
|
82
|
+
doUploadRequest: (fileLike: FileReference | FileLike, options?: UploadRequestOptions) => Promise<{
|
|
79
83
|
file: string;
|
|
80
84
|
thumb_url?: string;
|
|
81
85
|
}>;
|
|
@@ -2,7 +2,7 @@ import type { LinkPreview } from '../linkPreviewsManager';
|
|
|
2
2
|
import type { FileUploadFilter } from '../attachmentManager';
|
|
3
3
|
import type { MessageComposer } from '../messageComposer';
|
|
4
4
|
import type { FileLike, FileReference } from '../types';
|
|
5
|
-
import type {
|
|
5
|
+
import type { Command, UserResponse } from '../../types';
|
|
6
6
|
export type MinimumUploadRequestResult = {
|
|
7
7
|
file: string;
|
|
8
8
|
thumb_url?: string;
|
|
@@ -33,13 +33,13 @@ export type TextComposerConfig = {
|
|
|
33
33
|
maxLengthOnSend?: number;
|
|
34
34
|
};
|
|
35
35
|
export type CommandSendability = {
|
|
36
|
-
command:
|
|
36
|
+
command: Command;
|
|
37
37
|
ready: boolean;
|
|
38
38
|
reason?: string & {};
|
|
39
39
|
metadata?: Record<string, unknown>;
|
|
40
40
|
};
|
|
41
41
|
export type CommandSendValidationContext = {
|
|
42
|
-
command:
|
|
42
|
+
command: Command;
|
|
43
43
|
composer: MessageComposer;
|
|
44
44
|
commandArgsText: string;
|
|
45
45
|
mentionedUsersInText: UserResponse[];
|
|
@@ -65,16 +65,16 @@ export type AttachmentManagerConfig = {
|
|
|
65
65
|
/** Function that allows to customize the upload request. */
|
|
66
66
|
doUploadRequest?: UploadRequestFn;
|
|
67
67
|
/**
|
|
68
|
-
* When true
|
|
69
|
-
* to `doUploadRequest` (built-in and custom). Set to false to disable
|
|
70
|
-
*
|
|
68
|
+
* When `true`, the attachment manager sets `localMetadata.uploadProgress` and passes
|
|
69
|
+
* `options.onProgress` to `doUploadRequest` (built-in and custom). Set to `false` to disable
|
|
70
|
+
* progress tracking (defaults to `true`).
|
|
71
71
|
*/
|
|
72
72
|
trackUploadProgress: boolean;
|
|
73
73
|
};
|
|
74
74
|
export type LinkPreviewsManagerConfig = {
|
|
75
|
-
/** Number of milliseconds to debounce firing the URL enrichment queries when typing
|
|
75
|
+
/** Number of milliseconds to debounce firing the URL enrichment queries when typing (defaults to `1500`). */
|
|
76
76
|
debounceURLEnrichmentMs: number;
|
|
77
|
-
/** Allows for toggling the URL enrichment and link previews in `MessageInput
|
|
77
|
+
/** Allows for toggling the URL enrichment and link previews in `MessageInput` (defaults to `false`). */
|
|
78
78
|
enabled: boolean;
|
|
79
79
|
/** Custom function to identify URLs in a string and request OG data */
|
|
80
80
|
findURLFn: (text: string) => string[];
|
|
@@ -83,11 +83,11 @@ export type LinkPreviewsManagerConfig = {
|
|
|
83
83
|
};
|
|
84
84
|
export type LocationComposerConfig = {
|
|
85
85
|
/**
|
|
86
|
-
* Allows for toggling the location addition.
|
|
87
|
-
*
|
|
86
|
+
* Allows for toggling the location addition (defaults to `true`). The feature also has to be
|
|
87
|
+
* enabled at the channel-level config via `shared_locations`.
|
|
88
88
|
*/
|
|
89
89
|
enabled: boolean;
|
|
90
|
-
/** Function that provides a stable
|
|
90
|
+
/** Function that provides a stable ID for the device from which the location is shared. */
|
|
91
91
|
getDeviceId: () => string;
|
|
92
92
|
};
|
|
93
93
|
export type MessageComposerConfig = {
|
|
@@ -13,13 +13,13 @@ export interface ILinkPreviewsManager {
|
|
|
13
13
|
findAndEnrichUrls?: DebouncedFunc<(text: string) => void>;
|
|
14
14
|
}
|
|
15
15
|
export declare enum LinkPreviewStatus {
|
|
16
|
-
/** Link preview has been dismissed using
|
|
16
|
+
/** Link preview has been dismissed using */
|
|
17
17
|
DISMISSED = "dismissed",
|
|
18
|
-
/** Link preview could not be loaded, the enrichment request has failed.
|
|
18
|
+
/** Link preview could not be loaded, the enrichment request has failed. */
|
|
19
19
|
FAILED = "failed",
|
|
20
|
-
/** Link preview has been successfully loaded.
|
|
20
|
+
/** Link preview has been successfully loaded. */
|
|
21
21
|
LOADED = "loaded",
|
|
22
|
-
/** The enrichment query is in progress for a given link.
|
|
22
|
+
/** The enrichment query is in progress for a given link. */
|
|
23
23
|
LOADING = "loading",
|
|
24
24
|
/** The preview reference enrichment has not begun. Default status if not set. */
|
|
25
25
|
PENDING = "pending"
|
|
@@ -77,15 +77,27 @@ export declare class LinkPreviewsManager implements ILinkPreviewsManager {
|
|
|
77
77
|
static previewIsFailed: (preview: LinkPreview) => boolean;
|
|
78
78
|
static previewIsPending: (preview: LinkPreview) => boolean;
|
|
79
79
|
static getPreviewData: (preview: LinkPreview) => {
|
|
80
|
+
custom: import("..").CustomAttachmentData;
|
|
81
|
+
type?: string | undefined;
|
|
82
|
+
text?: string | undefined;
|
|
83
|
+
giphy?: import("..").Images | undefined;
|
|
84
|
+
actions?: Array<import("..").Action> | undefined;
|
|
85
|
+
title?: string | undefined;
|
|
86
|
+
thumb_url?: string | undefined;
|
|
87
|
+
asset_url?: string | undefined;
|
|
88
|
+
author_icon?: string | undefined;
|
|
89
|
+
author_link?: string | undefined;
|
|
90
|
+
author_name?: string | undefined;
|
|
91
|
+
color?: string | undefined;
|
|
92
|
+
fallback?: string | undefined;
|
|
93
|
+
footer?: string | undefined;
|
|
94
|
+
footer_icon?: string | undefined;
|
|
95
|
+
image_url?: string | undefined;
|
|
96
|
+
original_height?: number | undefined;
|
|
97
|
+
original_width?: number | undefined;
|
|
98
|
+
pretext?: string | undefined;
|
|
99
|
+
title_link?: string | undefined;
|
|
100
|
+
fields?: Array<import("..").Field> | undefined;
|
|
80
101
|
og_scrape_url: string;
|
|
81
|
-
asset_url?: string;
|
|
82
|
-
author_link?: string;
|
|
83
|
-
author_name?: string;
|
|
84
|
-
image_url?: string;
|
|
85
|
-
text?: string;
|
|
86
|
-
thumb_url?: string;
|
|
87
|
-
title?: string;
|
|
88
|
-
title_link?: string;
|
|
89
|
-
type?: string | "video" | "audio" | "image";
|
|
90
102
|
};
|
|
91
103
|
}
|
|
@@ -11,7 +11,7 @@ import { StateStore } from '../store';
|
|
|
11
11
|
import { generateUUIDv4 } from '../utils';
|
|
12
12
|
import { Channel } from '../channel';
|
|
13
13
|
import { Thread } from '../thread';
|
|
14
|
-
import type {
|
|
14
|
+
import type { ChannelStateResponseFields, Command, DraftResponse, LocalMessage, MessageResponse } from '../types';
|
|
15
15
|
import { WithSubscriptions } from '../utils/WithSubscriptions';
|
|
16
16
|
import type { StreamChat } from '../client';
|
|
17
17
|
import type { CommandSendability, MessageComposerConfig } from './configuration/types';
|
|
@@ -55,7 +55,7 @@ export type MessageComposerState = {
|
|
|
55
55
|
id: string;
|
|
56
56
|
draftId: string | null;
|
|
57
57
|
pollId: string | null;
|
|
58
|
-
quotedMessage:
|
|
58
|
+
quotedMessage: LocalMessage | null;
|
|
59
59
|
showReplyInChannel: boolean;
|
|
60
60
|
/**
|
|
61
61
|
* Baseline snapshot of the message being edited (if any).
|
|
@@ -86,26 +86,26 @@ export declare class MessageComposer extends WithSubscriptions {
|
|
|
86
86
|
private snapshots;
|
|
87
87
|
private effectHandlers;
|
|
88
88
|
constructor({ composition, config, compositionContext, client, }: MessageComposerOptions);
|
|
89
|
-
static evaluateContextType(compositionContext: CompositionContext): "
|
|
89
|
+
static evaluateContextType(compositionContext: CompositionContext): "channel" | "thread" | "message" | "legacy_thread";
|
|
90
90
|
static constructTag(compositionContext: CompositionContext): `${ReturnType<typeof MessageComposer.evaluateContextType>}_${string}`;
|
|
91
91
|
static generateId: typeof generateUUIDv4;
|
|
92
92
|
get config(): MessageComposerConfig;
|
|
93
93
|
get editedMessage(): LocalMessage | undefined;
|
|
94
94
|
set editedMessage(editedMessage: LocalMessage | undefined);
|
|
95
95
|
setEditedMessage: (editedMessage: LocalMessage | null | undefined) => void;
|
|
96
|
-
get contextType(): "
|
|
97
|
-
get tag(): `
|
|
96
|
+
get contextType(): "channel" | "thread" | "message" | "legacy_thread";
|
|
97
|
+
get tag(): `channel_${string}` | `thread_${string}` | `message_${string}` | `legacy_thread_${string}`;
|
|
98
98
|
get threadId(): string | null;
|
|
99
99
|
get client(): StreamChat;
|
|
100
100
|
get id(): string;
|
|
101
101
|
get draftId(): string | null;
|
|
102
102
|
get lastChange(): LastComposerChange;
|
|
103
|
-
get quotedMessage():
|
|
103
|
+
get quotedMessage(): LocalMessage | null;
|
|
104
104
|
get pollId(): string | null;
|
|
105
105
|
get showReplyInChannel(): boolean;
|
|
106
|
-
getCommandDisabledReason: (command:
|
|
107
|
-
isCommandDisabled: (command:
|
|
108
|
-
validateCommandSendability: (command:
|
|
106
|
+
getCommandDisabledReason: (command: Command) => CommandSuggestionDisabledReason | undefined;
|
|
107
|
+
isCommandDisabled: (command: Command) => boolean;
|
|
108
|
+
validateCommandSendability: (command: Command, text?: string) => CommandSendability;
|
|
109
109
|
get isCommandSendable(): boolean;
|
|
110
110
|
get hasSendableData(): boolean;
|
|
111
111
|
get compositionIsEmpty(): boolean;
|
|
@@ -116,7 +116,7 @@ export declare class MessageComposer extends WithSubscriptions {
|
|
|
116
116
|
initState: ({ composition, }?: {
|
|
117
117
|
composition?: DraftResponse | MessageResponse | LocalMessage;
|
|
118
118
|
}) => void;
|
|
119
|
-
initStateFromChannelResponse: (channelApiResponse:
|
|
119
|
+
initStateFromChannelResponse: (channelApiResponse: ChannelStateResponseFields) => void;
|
|
120
120
|
initEditingAuditState: (composition?: DraftResponse | MessageResponse | LocalMessage) => EditingAuditState;
|
|
121
121
|
clearSnapshots: () => void;
|
|
122
122
|
getSnapshot: () => MessageComposerSnapshot;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Middleware, MiddlewareExecutionResult } from '../../../middleware';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LocalMessage, MessageRequest, SendMessageOptions, UpdatedMessage } from '../../../types';
|
|
3
3
|
import type { MessageComposer } from '../../messageComposer';
|
|
4
4
|
export type MessageComposerMiddlewareState = {
|
|
5
|
-
message:
|
|
5
|
+
message: MessageRequest | UpdatedMessage;
|
|
6
6
|
localMessage: LocalMessage;
|
|
7
7
|
sendOptions: SendMessageOptions;
|
|
8
8
|
};
|
|
@@ -11,7 +11,7 @@ export type MessageComposerMiddlewareExecutorOptions = {
|
|
|
11
11
|
composer: MessageComposer;
|
|
12
12
|
};
|
|
13
13
|
export type MessageDraftComposerMiddlewareValueState = {
|
|
14
|
-
draft:
|
|
14
|
+
draft: MessageRequest;
|
|
15
15
|
};
|
|
16
16
|
export type MessageDraftComposerMiddlewareExecutorOptions = {
|
|
17
17
|
composer: MessageComposer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MiddlewareExecutionResult } from '../../../middleware';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CreatePollRequest, VotingVisibility } from '../../../types';
|
|
3
3
|
export type PollComposerOption = {
|
|
4
4
|
id: string;
|
|
5
5
|
text: string;
|
|
@@ -12,13 +12,12 @@ export type PollComposerOptionUpdate = PollComposerOption[] | TargetedPollOption
|
|
|
12
12
|
export type UpdateFieldsData = Partial<Omit<PollComposerState['data'], 'options'>> & {
|
|
13
13
|
options?: PollComposerOptionUpdate;
|
|
14
14
|
};
|
|
15
|
-
type
|
|
16
|
-
export type PollComposerFieldErrors = Partial<Omit<Record<keyof CreatePollData, string>, 'options'> & {
|
|
15
|
+
export type PollComposerFieldErrors = Partial<Omit<Record<keyof CreatePollRequest, string>, 'options'> & {
|
|
17
16
|
options?: Record<string, string>;
|
|
18
17
|
}>;
|
|
19
18
|
export type PollComposerState = {
|
|
20
19
|
data: {
|
|
21
|
-
id:
|
|
20
|
+
id: string;
|
|
22
21
|
max_votes_allowed: string;
|
|
23
22
|
name: string;
|
|
24
23
|
options: PollComposerOption[];
|
|
@@ -27,13 +26,12 @@ export type PollComposerState = {
|
|
|
27
26
|
description?: string;
|
|
28
27
|
enforce_unique_vote?: boolean;
|
|
29
28
|
is_closed?: boolean;
|
|
30
|
-
user_id?: string;
|
|
31
29
|
voting_visibility?: VotingVisibility;
|
|
32
30
|
};
|
|
33
31
|
errors: PollComposerFieldErrors;
|
|
34
32
|
};
|
|
35
33
|
export type PollComposerCompositionMiddlewareValueState = {
|
|
36
|
-
data:
|
|
34
|
+
data: CreatePollRequest;
|
|
37
35
|
errors: PollComposerFieldErrors;
|
|
38
36
|
};
|
|
39
37
|
export type PollComposerCompositionMiddlewareValue = MiddlewareExecutionResult<PollComposerCompositionMiddlewareValueState>;
|
|
@@ -46,4 +44,3 @@ export type PollComposerStateChangeMiddlewareValue = {
|
|
|
46
44
|
injectedFieldErrors?: PollComposerFieldErrors;
|
|
47
45
|
};
|
|
48
46
|
export type PollComposerStateMiddlewareValue = MiddlewareExecutionResult<PollComposerStateChangeMiddlewareValue>;
|
|
49
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MessageComposer } from '../../messageComposer';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Command, UserResponse } from '../../../types';
|
|
3
3
|
import type { CommandSendability } from '../../configuration';
|
|
4
4
|
import type { CommandSearchSource } from './commands';
|
|
5
5
|
export declare function escapeCommandRegExp(text: string): string;
|
|
@@ -8,8 +8,8 @@ export declare const getCompleteCommandInString: (text: string) => string | null
|
|
|
8
8
|
export declare const stripCommandFromText: (text: string, commandName: string) => string;
|
|
9
9
|
export declare const stripMentionTokens: (text: string, mentionedUsersInText: UserResponse[], trigger?: string) => string;
|
|
10
10
|
export declare const getMentionedUsersInText: (text: string, mentionedUsers: UserResponse[]) => UserResponse[];
|
|
11
|
-
export declare const getCommandByName: (searchSource: CommandSearchSource, commandName?: string) =>
|
|
12
|
-
export declare const notifyCommandDisabled: (composer: MessageComposer, command:
|
|
11
|
+
export declare const getCommandByName: (searchSource: CommandSearchSource, commandName?: string) => Command | undefined;
|
|
12
|
+
export declare const notifyCommandDisabled: (composer: MessageComposer, command: Command) => true | undefined;
|
|
13
13
|
export declare const notifyCommandNotReady: ({ composer, sendability, }: {
|
|
14
14
|
composer: MessageComposer;
|
|
15
15
|
sendability: CommandSendability;
|
|
@@ -22,13 +22,13 @@ export declare class CommandSearchSource extends BaseSearchSourceSync<CommandSug
|
|
|
22
22
|
};
|
|
23
23
|
query(searchQuery: string): {
|
|
24
24
|
items: {
|
|
25
|
-
id:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
id: string;
|
|
26
|
+
args: string;
|
|
27
|
+
description: string;
|
|
28
|
+
name: string;
|
|
29
|
+
set: string;
|
|
30
|
+
created_at?: Date;
|
|
31
|
+
updated_at?: Date;
|
|
32
32
|
}[];
|
|
33
33
|
next: null;
|
|
34
34
|
};
|