stream-chat 10.0.0-rc.21 → 10.0.0-rc.23
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 +2196 -3902
- package/dist/cjs/index.browser.js.map +3 -3
- package/dist/cjs/index.node.js +2197 -3902
- package/dist/cjs/index.node.js.map +3 -3
- package/dist/esm/index.mjs +2199 -3905
- package/dist/esm/index.mjs.map +4 -4
- package/dist/types/ChannelManager.d.ts +120 -233
- package/dist/types/CooldownTimer.d.ts +8 -23
- package/dist/types/EventHandlerPipeline.d.ts +17 -37
- package/dist/types/LiveLocationManager.d.ts +22 -50
- package/dist/types/api-client.d.ts +9 -14
- package/dist/types/channel.d.ts +253 -448
- package/dist/types/channel_state.d.ts +48 -95
- package/dist/types/client.d.ts +245 -370
- package/dist/types/client_state.d.ts +1 -3
- package/dist/types/configuration/ConfigController.d.ts +30 -124
- package/dist/types/configuration/InstanceConfigurationRegistry.d.ts +31 -123
- package/dist/types/configuration/keys.d.ts +5 -19
- package/dist/types/configuration/shape.d.ts +12 -29
- package/dist/types/configuration/types.d.ts +59 -87
- package/dist/types/configuration/utils/applyInstanceConfiguration.d.ts +13 -35
- package/dist/types/configuration/utils/copyConfigPatch.d.ts +8 -0
- package/dist/types/configuration/utils/declarativeSlices.d.ts +5 -16
- package/dist/types/configuration/utils/deepFreezeConfig.d.ts +3 -17
- package/dist/types/configuration/utils/serverAuthority.d.ts +9 -29
- package/dist/types/connection/ConnectionIdManager.d.ts +18 -40
- package/dist/types/connection/ConnectionRecoveryManager.d.ts +29 -120
- package/dist/types/connection/networkConnection/NetworkConnectionObserver.d.ts +32 -103
- package/dist/types/connection/networkConnection/reporters.d.ts +9 -32
- package/dist/types/connection/networkConnection/types.d.ts +12 -27
- package/dist/types/connection/wsConnection/StableWSConnection.d.ts +37 -116
- package/dist/types/connection/wsConnection/WSConnection.d.ts +41 -104
- package/dist/types/connection/wsConnection/WSConnectionFallback.d.ts +8 -16
- package/dist/types/connection/wsConnection/config.d.ts +8 -28
- package/dist/types/connection/wsConnection/types.d.ts +17 -70
- package/dist/types/entityStore/EntityStore.d.ts +153 -113
- package/dist/types/entityStore/StoreBackedItemIndex.d.ts +13 -46
- package/dist/types/errors.d.ts +7 -19
- package/dist/types/gen/chat/ChannelApi.d.ts +2 -1
- package/dist/types/gen/chat/ChatApi.d.ts +28 -14
- package/dist/types/gen/models/index.d.ts +769 -86
- package/dist/types/gen/moderation/ModerationApi.d.ts +4 -4
- package/dist/types/index.d.ts +2 -4
- package/dist/types/languageNames.d.ts +9 -24
- package/dist/types/logger.d.ts +1 -3
- package/dist/types/messageComposer/LocationComposer.d.ts +1 -1
- package/dist/types/messageComposer/attachmentIdentity.d.ts +1 -6
- package/dist/types/messageComposer/attachmentManager.d.ts +10 -32
- package/dist/types/messageComposer/attachmentUtils.d.ts +3 -14
- package/dist/types/messageComposer/configuration/configuration.d.ts +2 -5
- package/dist/types/messageComposer/configuration/types.d.ts +29 -56
- package/dist/types/messageComposer/linkPreviewsManager.d.ts +6 -9
- package/dist/types/messageComposer/messageComposer.d.ts +30 -164
- package/dist/types/messageComposer/middleware/attachmentManager/postUpload/attachmentEnrichment.d.ts +4 -14
- package/dist/types/messageComposer/middleware/messageComposer/attachments.d.ts +2 -9
- package/dist/types/messageComposer/middleware/pollComposer/types.d.ts +2 -4
- package/dist/types/messageComposer/middleware/pollComposer/validation.d.ts +7 -19
- package/dist/types/messageComposer/middleware/textComposer/commands.d.ts +9 -0
- package/dist/types/messageComposer/middleware/textComposer/mentions.d.ts +11 -18
- package/dist/types/messageComposer/middleware/textComposer/textMiddlewareUtils.d.ts +9 -3
- package/dist/types/messageComposer/middleware/textComposer/types.d.ts +1 -6
- package/dist/types/messageComposer/pollComposer.d.ts +8 -4
- package/dist/types/messageComposer/textComposer.d.ts +3 -9
- package/dist/types/messageComposer/types.d.ts +5 -8
- package/dist/types/messageDelivery/MessageDeliveryReporter.d.ts +25 -79
- package/dist/types/messageDelivery/MessageReceiptsTracker.d.ts +15 -82
- package/dist/types/messageOperations/FailedSendCache.d.ts +4 -9
- package/dist/types/messageOperations/MessageOperationStatePolicy.d.ts +10 -20
- package/dist/types/messageOperations/MessageOperations.d.ts +20 -40
- package/dist/types/messageOperations/applyReactionLocally.d.ts +5 -22
- package/dist/types/messageOperations/createMessageOperations.d.ts +3 -5
- package/dist/types/messageOperations/reflectReactionEvent.d.ts +5 -13
- package/dist/types/messageOperations/sendOrdering.d.ts +4 -7
- package/dist/types/messageOperations/settlePendingAttachmentUploads.d.ts +7 -15
- package/dist/types/messageOperations/types.d.ts +15 -30
- package/dist/types/middleware.d.ts +7 -5
- package/dist/types/moderation.d.ts +21 -14
- package/dist/types/notifications/NotificationManager.d.ts +8 -31
- package/dist/types/notifications/types.d.ts +19 -59
- package/dist/types/offline-support/offline_support_api.d.ts +145 -539
- package/dist/types/offline-support/offline_sync_manager.d.ts +18 -42
- package/dist/types/offline-support/queueableOperations.d.ts +24 -52
- package/dist/types/offline-support/types.d.ts +24 -187
- package/dist/types/pagination/ItemIndex.d.ts +4 -12
- package/dist/types/pagination/cursorDerivation/aroundPaginationFlags.d.ts +13 -0
- package/dist/types/pagination/cursorDerivation/createdAtAroundPaginationFlags.d.ts +2 -4
- package/dist/types/pagination/cursorDerivation/linearPaginationFlags.d.ts +2 -3
- package/dist/types/pagination/paginators/BasePaginator.d.ts +235 -622
- package/dist/types/pagination/paginators/ChannelPaginator.d.ts +67 -125
- package/dist/types/pagination/paginators/MessageIntervalPaginator.d.ts +133 -292
- package/dist/types/pagination/paginators/MessagePaginator.d.ts +69 -118
- package/dist/types/pagination/paginators/PinnedMessagePaginator.d.ts +7 -26
- package/dist/types/pagination/paginators/ReminderPaginator.d.ts +2 -2
- package/dist/types/pagination/paginators/ThreadPaginator.d.ts +15 -23
- package/dist/types/pagination/paginators/UserGroupPaginator.d.ts +2 -6
- package/dist/types/pagination/sortCompiler.d.ts +11 -22
- package/dist/types/pagination/utility.normalization.d.ts +5 -23
- package/dist/types/pagination/utility.search.d.ts +3 -8
- package/dist/types/poll.d.ts +14 -14
- package/dist/types/poll_manager.d.ts +11 -2
- package/dist/types/poll_optimistic_votes.d.ts +10 -14
- package/dist/types/reminders/Reminder.d.ts +4 -4
- package/dist/types/reminders/ReminderManager.d.ts +7 -20
- package/dist/types/search/BaseSearchSource.d.ts +7 -12
- package/dist/types/search/ChannelSearchSource.d.ts +7 -7
- package/dist/types/search/MessageSearchSource.d.ts +7 -9
- package/dist/types/search/SearchController.d.ts +17 -22
- package/dist/types/search/types.d.ts +6 -10
- package/dist/types/signing.d.ts +12 -3
- package/dist/types/thread.d.ts +23 -71
- package/dist/types/thread_manager.d.ts +45 -70
- package/dist/types/token_manager.d.ts +8 -13
- package/dist/types/types.d.ts +64 -125
- package/dist/types/types.utility.d.ts +3 -3
- package/dist/types/upload-utils.d.ts +5 -10
- package/dist/types/uploadManager.d.ts +17 -45
- package/dist/types/utils/FixedSizeQueueCache.d.ts +6 -11
- package/dist/types/utils/WithSubscriptions.d.ts +5 -15
- package/dist/types/utils/concurrency.d.ts +11 -19
- package/dist/types/utils/mergeWith/mergeWith.d.ts +8 -11
- package/dist/types/utils/mergeWith/mergeWithCore.d.ts +5 -13
- package/dist/types/utils/mergeWith/mergeWithDiff.d.ts +22 -0
- package/dist/types/utils/objectPath.d.ts +6 -41
- package/dist/types/utils/retryable.d.ts +8 -12
- package/dist/types/utils/throttling/throttle.d.ts +8 -23
- package/dist/types/utils/time.d.ts +24 -64
- package/dist/types/utils.d.ts +40 -86
- package/package.json +7 -2
- package/src/ChannelManager.ts +159 -300
- package/src/CooldownTimer.ts +11 -29
- package/src/EventHandlerPipeline.ts +21 -44
- package/src/LiveLocationManager.ts +35 -74
- package/src/api-client.ts +43 -61
- package/src/campaign.ts +1 -1
- package/src/channel.ts +396 -749
- package/src/channel_batch_updater.ts +1 -1
- package/src/channel_state.ts +50 -105
- package/src/client.ts +360 -588
- package/src/client_state.ts +1 -6
- package/src/configuration/ConfigController.ts +41 -157
- package/src/configuration/InstanceConfigurationRegistry.ts +42 -171
- package/src/configuration/index.ts +1 -1
- package/src/configuration/keys.ts +13 -32
- package/src/configuration/shape.ts +67 -70
- package/src/configuration/types.ts +60 -100
- package/src/configuration/utils/applyInstanceConfiguration.ts +21 -53
- package/src/configuration/utils/copyConfigPatch.ts +11 -32
- package/src/configuration/utils/declarativeSlices.ts +9 -39
- package/src/configuration/utils/deepFreezeConfig.ts +3 -17
- package/src/configuration/utils/index.ts +2 -4
- package/src/configuration/utils/serverAuthority.ts +20 -68
- package/src/connection/ConnectionIdManager.ts +20 -49
- package/src/connection/ConnectionRecoveryManager.ts +51 -178
- package/src/connection/networkConnection/NetworkConnectionObserver.ts +37 -114
- package/src/connection/networkConnection/reporters.ts +9 -36
- package/src/connection/networkConnection/types.ts +12 -27
- package/src/connection/wsConnection/StableWSConnection.ts +73 -193
- package/src/connection/wsConnection/WSConnection.ts +56 -131
- package/src/connection/wsConnection/WSConnectionFallback.ts +22 -31
- package/src/connection/wsConnection/config.ts +13 -48
- package/src/connection/wsConnection/types.ts +17 -70
- package/src/constants.ts +4 -4
- package/src/entityStore/EntityStore.ts +162 -167
- package/src/entityStore/StoreBackedItemIndex.ts +14 -47
- package/src/errors.ts +7 -19
- package/src/formatMessageMemo.ts +3 -9
- package/src/gen/chat/ChannelApi.ts +19 -0
- package/src/gen/chat/ChatApi.ts +87 -13
- package/src/gen/models/index.ts +793 -71
- package/src/gen/moderation/ModerationApi.ts +0 -4
- package/src/index.ts +10 -14
- package/src/languageNames.ts +9 -24
- package/src/logger.ts +1 -3
- package/src/messageComposer/LocationComposer.ts +7 -23
- package/src/messageComposer/MessageComposerEffectHandlers.ts +1 -2
- package/src/messageComposer/attachmentIdentity.ts +2 -13
- package/src/messageComposer/attachmentManager.ts +17 -63
- package/src/messageComposer/attachmentUtils.ts +3 -17
- package/src/messageComposer/configuration/configuration.ts +5 -8
- package/src/messageComposer/configuration/types.ts +29 -56
- package/src/messageComposer/fileUtils.ts +1 -1
- package/src/messageComposer/linkPreviewsManager.ts +8 -20
- package/src/messageComposer/messageComposer.ts +54 -222
- package/src/messageComposer/middleware/attachmentManager/postUpload/attachmentEnrichment.ts +4 -16
- package/src/messageComposer/middleware/attachmentManager/postUpload/uploadErrorHandler.ts +1 -2
- package/src/messageComposer/middleware/messageComposer/attachments.ts +14 -40
- package/src/messageComposer/middleware/messageComposer/linkPreviews.ts +3 -4
- package/src/messageComposer/middleware/messageComposer/textComposer.ts +1 -1
- package/src/messageComposer/middleware/messageComposer/userDataInjection.ts +4 -11
- package/src/messageComposer/middleware/pollComposer/state.ts +2 -2
- package/src/messageComposer/middleware/pollComposer/types.ts +2 -4
- package/src/messageComposer/middleware/pollComposer/validation.ts +8 -26
- package/src/messageComposer/middleware/textComposer/TextComposerMiddlewareExecutor.ts +1 -6
- package/src/messageComposer/middleware/textComposer/commandUtils.ts +1 -2
- package/src/messageComposer/middleware/textComposer/commands.ts +11 -16
- package/src/messageComposer/middleware/textComposer/mentions.ts +32 -70
- package/src/messageComposer/middleware/textComposer/textMiddlewareUtils.ts +10 -4
- package/src/messageComposer/middleware/textComposer/types.ts +1 -6
- package/src/messageComposer/pollComposer.ts +11 -8
- package/src/messageComposer/textComposer.ts +9 -59
- package/src/messageComposer/types.ts +9 -12
- package/src/messageDelivery/MessageDeliveryReporter.ts +60 -113
- package/src/messageDelivery/MessageReceiptsTracker.ts +21 -105
- package/src/messageOperations/FailedSendCache.ts +4 -9
- package/src/messageOperations/MessageOperationStatePolicy.ts +40 -67
- package/src/messageOperations/MessageOperations.ts +33 -62
- package/src/messageOperations/applyReactionLocally.ts +9 -28
- package/src/messageOperations/createMessageOperations.ts +17 -33
- package/src/messageOperations/reflectReactionEvent.ts +5 -13
- package/src/messageOperations/sendOrdering.ts +4 -7
- package/src/messageOperations/settlePendingAttachmentUploads.ts +10 -21
- package/src/messageOperations/types.ts +15 -30
- package/src/middleware.ts +7 -10
- package/src/moderation.ts +25 -21
- package/src/notifications/NotificationManager.ts +11 -35
- package/src/notifications/types.ts +19 -59
- package/src/offline-support/offline_support_api.ts +178 -608
- package/src/offline-support/offline_sync_manager.ts +25 -69
- package/src/offline-support/queueableOperations.ts +31 -84
- package/src/offline-support/types.ts +25 -188
- package/src/pagination/ItemIndex.ts +4 -12
- package/src/pagination/cursorDerivation/aroundPaginationFlags.ts +29 -0
- package/src/pagination/cursorDerivation/createdAtAroundPaginationFlags.ts +13 -62
- package/src/pagination/cursorDerivation/idAroundPaginationFlags.ts +11 -39
- package/src/pagination/cursorDerivation/linearPaginationFlags.ts +4 -6
- package/src/pagination/filterCompiler.ts +11 -25
- package/src/pagination/paginators/BasePaginator.ts +422 -976
- package/src/pagination/paginators/ChannelPaginator.ts +130 -190
- package/src/pagination/paginators/MessageIntervalPaginator.ts +226 -457
- package/src/pagination/paginators/MessagePaginator.ts +135 -175
- package/src/pagination/paginators/PinnedMessagePaginator.ts +13 -38
- package/src/pagination/paginators/ReminderPaginator.ts +12 -15
- package/src/pagination/paginators/ThreadPaginator.ts +16 -26
- package/src/pagination/paginators/UserGroupPaginator.ts +6 -17
- package/src/pagination/paginators/stateThrottling.ts +5 -10
- package/src/pagination/sortCompiler.ts +23 -50
- package/src/pagination/utility.normalization.ts +8 -30
- package/src/pagination/utility.search.ts +4 -11
- package/src/poll.ts +19 -19
- package/src/poll_manager.ts +16 -20
- package/src/poll_optimistic_votes.ts +17 -22
- package/src/reminders/Reminder.ts +5 -6
- package/src/reminders/ReminderManager.ts +9 -34
- package/src/reminders/ReminderTimer.ts +1 -2
- package/src/search/BaseSearchSource.ts +14 -29
- package/src/search/ChannelSearchSource.ts +8 -8
- package/src/search/MessageSearchSource.ts +19 -25
- package/src/search/SearchController.ts +18 -24
- package/src/search/types.ts +6 -10
- package/src/segment.ts +1 -1
- package/src/signing.ts +23 -3
- package/src/thread.ts +72 -173
- package/src/thread_manager.ts +59 -76
- package/src/token_manager.ts +11 -21
- package/src/types.ts +78 -126
- package/src/types.utility.ts +3 -3
- package/src/upload-utils.ts +5 -10
- package/src/uploadManager.ts +22 -54
- package/src/utils/FixedSizeQueueCache.ts +13 -21
- package/src/utils/WithSubscriptions.ts +5 -15
- package/src/utils/concurrency.ts +16 -55
- package/src/utils/mergeWith/mergeWith.ts +10 -13
- package/src/utils/mergeWith/mergeWithCore.ts +24 -81
- package/src/utils/mergeWith/mergeWithDiff.ts +15 -33
- package/src/utils/objectPath.ts +6 -41
- package/src/utils/retryable.ts +10 -14
- package/src/utils/throttling/throttle.ts +9 -25
- package/src/utils/time.ts +26 -66
- package/src/utils.ts +72 -128
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { StreamChat } from './client';
|
|
2
|
-
import type { CreatePollRequest, LocalMessage, MessageResponse,
|
|
2
|
+
import type { CreatePollRequest, LocalMessage, MessageResponse, StreamRequestOptions } from './types';
|
|
3
|
+
import type { QueryPollsRequest } from './gen/models';
|
|
3
4
|
import { Poll } from './poll';
|
|
4
5
|
import { WithSubscriptions } from './utils/WithSubscriptions';
|
|
5
6
|
export declare class PollManager extends WithSubscriptions {
|
|
@@ -13,7 +14,15 @@ export declare class PollManager extends WithSubscriptions {
|
|
|
13
14
|
registerSubscriptions: () => void;
|
|
14
15
|
createPoll: (poll: CreatePollRequest) => Promise<Poll | undefined>;
|
|
15
16
|
getPoll: (id: string) => Promise<Poll | undefined>;
|
|
16
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Queries polls and caches them as `Poll` instances. Takes the same request as `client.queryPolls`.
|
|
19
|
+
*
|
|
20
|
+
* @param request - The filter, sort and pagination of the query (optional).
|
|
21
|
+
* @param requestOptions - Per-request options such as an abort `signal`. Never serialized
|
|
22
|
+
* into the request (optional).
|
|
23
|
+
* @returns The `Poll` instances and the cursor of the next page.
|
|
24
|
+
*/
|
|
25
|
+
queryPolls: (request?: QueryPollsRequest, requestOptions?: StreamRequestOptions) => Promise<{
|
|
17
26
|
polls: (Poll | undefined)[];
|
|
18
27
|
next: string | undefined;
|
|
19
28
|
}>;
|
|
@@ -3,12 +3,11 @@ import type { Poll, PollState } from './poll';
|
|
|
3
3
|
import type { PollResponseData, PollVoteResponseData } from './types';
|
|
4
4
|
type OptionId = string;
|
|
5
5
|
/**
|
|
6
|
-
* Optimistic updates for the current user's votes on a poll.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* A lost WS event is recovered from after CATCH_UP_TIMEOUT_MS (see applySucceededChanges).
|
|
6
|
+
* Optimistic updates for the current user's votes on a poll. While any change awaits its WS event,
|
|
7
|
+
* vote events are only stored (the state they carry lacks the pending changes). Once all are
|
|
8
|
+
* confirmed (a failed request counts as confirmed), the server's vote state is shown, which reverts
|
|
9
|
+
* failed changes. A lost WS event is recovered from after CATCH_UP_TIMEOUT_MS (see
|
|
10
|
+
* applySucceededChanges).
|
|
12
11
|
*/
|
|
13
12
|
export declare class OptimisticPollVotes {
|
|
14
13
|
private serverVoteState;
|
|
@@ -40,20 +39,17 @@ export declare class OptimisticPollVotes {
|
|
|
40
39
|
private settleWithoutEvent;
|
|
41
40
|
private createPlaceholderVote;
|
|
42
41
|
/**
|
|
43
|
-
* The server
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* one, the server's own vote of the option is the vote being removed.
|
|
42
|
+
* The server ID of the vote to remove. Casts and removals of an option alternate, so the option's
|
|
43
|
+
* last succeeded change tells: a cast is the vote being removed (e.g. a placeholder), a removal
|
|
44
|
+
* means the cast in between failed. Without one, the server's own vote of the option is used.
|
|
47
45
|
*/
|
|
48
46
|
private getServerVoteId;
|
|
49
47
|
private takeServerVoteState;
|
|
50
48
|
private scheduleCatchUp;
|
|
51
49
|
/**
|
|
52
50
|
* A WS event of an own vote change got lost, so the server's own votes are stale. All requests
|
|
53
|
-
* have finished
|
|
54
|
-
*
|
|
55
|
-
* did arrive end up the same). They are shown with the vote counts of the last WS event, which
|
|
56
|
-
* contain the other users' votes too.
|
|
51
|
+
* have finished, so replaying the succeeded changes in order gives the server's own votes. They
|
|
52
|
+
* are shown with the vote counts of the last WS event, which include other users' votes.
|
|
57
53
|
*/
|
|
58
54
|
private applySucceededChanges;
|
|
59
55
|
}
|
|
@@ -3,10 +3,10 @@ import { StateStore } from '@stream-io/state-store';
|
|
|
3
3
|
import type { ReminderTimerConfig } from './ReminderTimer';
|
|
4
4
|
import type { MessageResponse, ReminderResponseData, TimestampNS, UserResponse } from '../types';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Computes the time left until a reminder is due.
|
|
7
7
|
*
|
|
8
|
-
* @param remindAt - Unix nanoseconds, as the API sends it.
|
|
9
|
-
*
|
|
8
|
+
* @param remindAt - Unix nanoseconds, as the API sends it.
|
|
9
|
+
* @returns Milliseconds until `remindAt`, negative once it has passed.
|
|
10
10
|
*/
|
|
11
11
|
export declare const timeLeftMs: (remindAt: TimestampNS) => number;
|
|
12
12
|
export type ReminderResponseBaseOrResponse = ReminderResponseData;
|
|
@@ -18,7 +18,7 @@ export type ReminderState = {
|
|
|
18
18
|
message_id: string;
|
|
19
19
|
/** Unix nanoseconds, as the API sends it. */
|
|
20
20
|
remind_at: TimestampNS | null;
|
|
21
|
-
/**
|
|
21
|
+
/** Milliseconds. See {@link timeLeftMs}. */
|
|
22
22
|
timeLeftMs: number | null;
|
|
23
23
|
/** Unix nanoseconds, as the API sends it. */
|
|
24
24
|
updated_at: TimestampNS;
|
|
@@ -22,36 +22,23 @@ export type ReminderManagerOptions = {
|
|
|
22
22
|
};
|
|
23
23
|
export declare class ReminderManager extends WithSubscriptions {
|
|
24
24
|
private client;
|
|
25
|
-
/** The shared configuration machinery — see {@link ConfigController}. */
|
|
26
25
|
private readonly configController;
|
|
27
|
-
/**
|
|
28
|
-
* Resolved configuration, as a store — the shape every configurable class exposes
|
|
29
|
-
* (`configState` / `config` / `updateConfig`). Delegates rather than holding a copy, so the field and
|
|
30
|
-
* the controller's store cannot drift.
|
|
31
|
-
*/
|
|
32
26
|
get configState(): StateStore<ReminderManagerConfig>;
|
|
33
27
|
state: StateStore<ReminderManagerState>;
|
|
34
28
|
paginator: ReminderPaginator;
|
|
35
29
|
constructor({ client, config }: ReminderManagerOptions);
|
|
30
|
+
get config(): Readonly<ReminderManagerConfig>;
|
|
36
31
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
32
|
+
* Merges a partial configuration into the resolved config.
|
|
33
|
+
*
|
|
34
|
+
* @param config - Fields to merge into the resolved config.
|
|
39
35
|
*/
|
|
40
|
-
get config(): Readonly<ReminderManagerConfig>;
|
|
41
36
|
updateConfig(config: Partial<ReminderManagerConfig>): void;
|
|
42
37
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* The derivation entry point every configurable entity exposes, so the owner routes a slice here and
|
|
46
|
-
* knows nothing about ReminderManager's defaults or merge semantics. This logic used to live in the owner,
|
|
47
|
-
* which is how `reset()` became a no-op for the client key (F4) and how a registered
|
|
48
|
-
* `notifications.sortComparator` became unremovable (G8) — an owner writing another object's
|
|
49
|
-
* derivation gets that object's rules wrong sooner or later.
|
|
38
|
+
* Re-derives the configuration from the declarative slice.
|
|
50
39
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* them amounts to a replacement. `NotificationManager` cannot do this — its `sortComparator` is
|
|
54
|
-
* optional with no default, so a patch can never remove one — which is why it replaces outright.
|
|
40
|
+
* @param config - The declarative slice. Leave it out to rebuild from the defaults and the
|
|
41
|
+
* constructor's `config`.
|
|
55
42
|
*/
|
|
56
43
|
initializeConfig(config?: Partial<ReminderManagerConfig>): void;
|
|
57
44
|
get stopTimerRefreshBoundaryMs(): number;
|
|
@@ -2,10 +2,8 @@ import { StateStore } from '@stream-io/state-store';
|
|
|
2
2
|
import { type DebouncedFunc } from '../utils';
|
|
3
3
|
import type { QueryReturnValue, SearchSourceOptions, SearchSourceState, SearchSourceType } from './types';
|
|
4
4
|
/**
|
|
5
|
-
* Passed to a search source's `query()`.
|
|
6
|
-
*
|
|
7
|
-
* ignore the signal. Where a source does issue requests, forward this straight through
|
|
8
|
-
* as the request options.
|
|
5
|
+
* Passed to a search source's `query()`. A source that issues requests forwards it as the request
|
|
6
|
+
* options; one that resolves from local data may ignore the signal.
|
|
9
7
|
*/
|
|
10
8
|
export type SearchQueryOptions = {
|
|
11
9
|
/** Aborted once a newer query supersedes this one. */
|
|
@@ -22,10 +20,7 @@ interface ISearchSource<T = any> {
|
|
|
22
20
|
activate(): void;
|
|
23
21
|
canExecuteQuery(newSearchString?: string): boolean;
|
|
24
22
|
deactivate(): void;
|
|
25
|
-
/**
|
|
26
|
-
* Releases what the source holds outside itself. Optional; a source that holds nothing outside
|
|
27
|
-
* itself leaves it out.
|
|
28
|
-
*/
|
|
23
|
+
/** Releases what the source holds outside itself. */
|
|
29
24
|
dispose?(): void;
|
|
30
25
|
readonly hasNext: boolean;
|
|
31
26
|
readonly hasResults: boolean;
|
|
@@ -36,7 +31,7 @@ interface ISearchSource<T = any> {
|
|
|
36
31
|
readonly lastQueryError: Error | undefined;
|
|
37
32
|
readonly next: string | undefined | null;
|
|
38
33
|
readonly offset: number | undefined;
|
|
39
|
-
/** Takes again what {@link ISearchSource.dispose} released.
|
|
34
|
+
/** Takes again what {@link ISearchSource.dispose} released. */
|
|
40
35
|
registerSubscriptions?(): void;
|
|
41
36
|
resetState(): void;
|
|
42
37
|
readonly searchQuery: string;
|
|
@@ -68,7 +63,7 @@ declare abstract class BaseSearchSourceBase<T, R extends void | Promise<void>> i
|
|
|
68
63
|
setDebounceOptions: (options?: DebounceOptions) => void;
|
|
69
64
|
/**
|
|
70
65
|
* Short queries match too much and are slow server-side, so they get a longer debounce.
|
|
71
|
-
* Resolved per call,
|
|
66
|
+
* Resolved per call, so the interval switches as the user keeps typing.
|
|
72
67
|
*/
|
|
73
68
|
protected getDebounceMs: (searchString?: string) => number;
|
|
74
69
|
/**
|
|
@@ -101,11 +96,11 @@ declare abstract class BaseSearchSourceBase<T, R extends void | Promise<void>> i
|
|
|
101
96
|
resetStateAndActivate(): void;
|
|
102
97
|
}
|
|
103
98
|
export declare abstract class BaseSearchSource<T> extends BaseSearchSourceBase<T, Promise<void>> implements SearchSource<T> {
|
|
104
|
-
/**
|
|
99
|
+
/** Aborted when a newer query is dispatched. */
|
|
105
100
|
protected queryAbortController: AbortController | null;
|
|
106
101
|
protected abstract query(searchQuery: string, options?: SearchQueryOptions): Promise<QueryReturnValue<T>>;
|
|
107
102
|
protected abstract filterQueryResults(items: T[]): T[] | Promise<T[]>;
|
|
108
|
-
/**
|
|
103
|
+
/** Returns true when a request was aborted. */
|
|
109
104
|
protected abortInFlightQuery(): boolean;
|
|
110
105
|
resetState(): void;
|
|
111
106
|
executeQuery(newSearchString?: string): Promise<void>;
|
|
@@ -14,8 +14,8 @@ export type ChannelSearchSourceOptions = SearchSourceOptions & {
|
|
|
14
14
|
filters?: ChannelFilters;
|
|
15
15
|
sort?: SortParamRequest[];
|
|
16
16
|
/**
|
|
17
|
-
* Query options. Results are not watched unless `watch: true
|
|
18
|
-
*
|
|
17
|
+
* Query options. Results are not watched unless `watch: true`: they are previews, and opening
|
|
18
|
+
* one watches it.
|
|
19
19
|
*/
|
|
20
20
|
searchOptions?: Omit<ChannelOptions, 'limit' | 'offset'>;
|
|
21
21
|
};
|
|
@@ -29,14 +29,14 @@ export declare class ChannelSearchSource<TFilterContext extends CustomContext =
|
|
|
29
29
|
private removeClaim?;
|
|
30
30
|
constructor(client: StreamChat, options?: ChannelSearchSourceOptions, filterBuilderOptions?: FilterBuilderOptions<ChannelFilters, ChannelSearchSourceFilterBuilderContext<TFilterContext>>);
|
|
31
31
|
/**
|
|
32
|
-
* While
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* While active, the results count as used in the channel store (see `EntityStore.addClaim`).
|
|
33
|
+
* Follows `isActive`; `SearchController.registerSubscriptions()` also calls it to re-register
|
|
34
|
+
* after `dispose()`.
|
|
35
35
|
*/
|
|
36
36
|
registerSubscriptions(): void;
|
|
37
37
|
/**
|
|
38
|
-
* Removes the
|
|
39
|
-
*
|
|
38
|
+
* Removes the channel-store claim, so the results' channels are no longer held and a dropped
|
|
39
|
+
* source can be collected.
|
|
40
40
|
*/
|
|
41
41
|
dispose(): void;
|
|
42
42
|
protected query(searchQuery: string, queryOptions?: SearchQueryOptions): Promise<{
|
|
@@ -36,9 +36,8 @@ export type MessageSearchSourceOptions = SearchSourceOptions & {
|
|
|
36
36
|
channelQueryFilters?: ChannelFilters;
|
|
37
37
|
channelQuerySort?: SortParamRequest[];
|
|
38
38
|
/**
|
|
39
|
-
* Options for the follow-up query that hydrates unknown channels.
|
|
40
|
-
*
|
|
41
|
-
* channel.
|
|
39
|
+
* Options for the follow-up query that hydrates unknown channels. They are not watched unless
|
|
40
|
+
* `watch: true`: a result is a preview, and opening one watches its channel.
|
|
42
41
|
*/
|
|
43
42
|
channelQueryOptions?: Omit<ChannelOptions, 'limit' | 'offset'>;
|
|
44
43
|
};
|
|
@@ -57,15 +56,14 @@ export declare class MessageSearchSource<TContexts extends MessageSearchSourceCo
|
|
|
57
56
|
private removeClaim?;
|
|
58
57
|
constructor(client: StreamChat, options?: MessageSearchSourceOptions, filterBuilderOptions?: MessageSearchSourceFilterBuilderOptions<TContexts>);
|
|
59
58
|
/**
|
|
60
|
-
* While the
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* registration again after `dispose()`.
|
|
59
|
+
* While active, the channels the results come from count as used in the channel store (see
|
|
60
|
+
* `EntityStore.addClaim`), so they stay the instances the results open. Follows `isActive`;
|
|
61
|
+
* `SearchController.registerSubscriptions()` also calls it to re-register after `dispose()`.
|
|
64
62
|
*/
|
|
65
63
|
registerSubscriptions(): void;
|
|
66
64
|
/**
|
|
67
|
-
* Removes the
|
|
68
|
-
*
|
|
65
|
+
* Removes the channel-store claim, so the results' channels are no longer held and a dropped
|
|
66
|
+
* source can be collected.
|
|
69
67
|
*/
|
|
70
68
|
dispose(): void;
|
|
71
69
|
private resultChannels;
|
|
@@ -7,16 +7,13 @@ export type SearchControllerState = {
|
|
|
7
7
|
sources: SearchSource[];
|
|
8
8
|
};
|
|
9
9
|
export type SearchControllerConfig = {
|
|
10
|
+
/** Keeps exactly one source active. Defaults to `true`. */
|
|
10
11
|
keepSingleActiveSource: boolean;
|
|
11
12
|
};
|
|
12
13
|
export type SearchControllerOptions = {
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* It is the one configurable class this package never constructs — an app or a downstream SDK does
|
|
17
|
-
* (`<Chat>` in `stream-chat-react`) — so there is no other route by which it could find the
|
|
18
|
-
* configuration registry. Left out, the controller still works and `updateConfig` still applies;
|
|
19
|
-
* only the declarative key and its setup function go unheard.
|
|
15
|
+
* Needed to take part in `client.config`. Without it the controller still works, but the
|
|
16
|
+
* declarative `searchController` key and its setup function are not applied.
|
|
20
17
|
*/
|
|
21
18
|
client?: StreamChat;
|
|
22
19
|
config?: Partial<SearchControllerConfig>;
|
|
@@ -25,38 +22,36 @@ export type SearchControllerOptions = {
|
|
|
25
22
|
export declare const DEFAULT_SEARCH_CONTROLLER_CONFIG: SearchControllerConfig;
|
|
26
23
|
export declare class SearchController {
|
|
27
24
|
state: StateStore<SearchControllerState>;
|
|
28
|
-
/** The shared configuration machinery — see {@link ConfigController}. */
|
|
29
25
|
private readonly configController;
|
|
30
26
|
private readonly client?;
|
|
31
|
-
/** Teardown for the configuration subscription, when this controller was given a client. */
|
|
32
27
|
private unsubscribeConfiguration?;
|
|
33
|
-
/**
|
|
34
|
-
* Resolved configuration, as a store so consumers can react to it — the same shape every configurable
|
|
35
|
-
* class exposes (`configState` for the store, {@link config} for the current value).
|
|
36
|
-
*/
|
|
37
28
|
get configState(): StateStore<SearchControllerConfig>;
|
|
38
29
|
constructor({ client, config, sources }?: SearchControllerOptions);
|
|
39
30
|
private subscribeConfiguration;
|
|
40
31
|
/**
|
|
41
32
|
* Takes again what {@link SearchController.dispose} released: the configuration subscription and
|
|
42
|
-
*
|
|
43
|
-
*
|
|
33
|
+
* what each source holds outside itself. A no-op for what is already held, so a UI can call it on
|
|
34
|
+
* every mount.
|
|
44
35
|
*/
|
|
45
36
|
registerSubscriptions(): void;
|
|
46
37
|
/**
|
|
47
|
-
* Releases the configuration subscription
|
|
48
|
-
* source holds outside itself
|
|
49
|
-
* store. {@link SearchController.registerSubscriptions} takes them again.
|
|
38
|
+
* Releases the configuration subscription (running the setup function's teardown) and what each
|
|
39
|
+
* source holds outside itself. {@link SearchController.registerSubscriptions} takes them again.
|
|
50
40
|
*/
|
|
51
41
|
dispose(): void;
|
|
42
|
+
get config(): Readonly<SearchControllerConfig>;
|
|
52
43
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
44
|
+
* Merges a partial configuration into the resolved config.
|
|
45
|
+
*
|
|
46
|
+
* @param config - Fields to merge into the resolved config.
|
|
55
47
|
*/
|
|
56
|
-
get config(): Readonly<SearchControllerConfig>;
|
|
57
|
-
/** Merges a partial configuration into the resolved config and notifies subscribers. */
|
|
58
48
|
updateConfig(config: Partial<SearchControllerConfig>): void;
|
|
59
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Re-derives the configuration from the declarative slice.
|
|
51
|
+
*
|
|
52
|
+
* @param config - The declarative slice. Leave it out to rebuild from the defaults and the
|
|
53
|
+
* constructor's `config`.
|
|
54
|
+
*/
|
|
60
55
|
initializeConfig(config?: Partial<SearchControllerConfig>): void;
|
|
61
56
|
get hasNext(): boolean;
|
|
62
57
|
get sources(): SearchSource<any>[];
|
|
@@ -9,25 +9,21 @@ export type SearchSourceState<T = any> = {
|
|
|
9
9
|
offset?: number;
|
|
10
10
|
};
|
|
11
11
|
export type SearchSourceOptions = {
|
|
12
|
-
/**
|
|
13
|
-
* Legacy single debounce interval. When set, it applies to both short and long queries,
|
|
14
|
-
* unless overridden by `shortQueryDebounceMs` / `longQueryDebounceMs`.
|
|
15
|
-
*/
|
|
12
|
+
/** Debounce interval for short and long queries, unless overridden by the options below. */
|
|
16
13
|
debounceMs?: number;
|
|
17
14
|
/**
|
|
18
|
-
* Debounce interval for queries no longer than `shortQueryMaxLength
|
|
19
|
-
*
|
|
20
|
-
* Defaults to 500ms.
|
|
15
|
+
* Debounce interval for queries no longer than `shortQueryMaxLength` (low selectivity, expensive
|
|
16
|
+
* server-side). Defaults to `debounceMs`, else 500ms.
|
|
21
17
|
*/
|
|
22
18
|
shortQueryDebounceMs?: number;
|
|
23
|
-
/** Debounce interval for queries
|
|
19
|
+
/** Debounce interval for longer queries. Defaults to `debounceMs`, else 300ms. */
|
|
24
20
|
longQueryDebounceMs?: number;
|
|
25
21
|
/** Query length (inclusive) that still counts as short. Defaults to 2. */
|
|
26
22
|
shortQueryMaxLength?: number;
|
|
27
23
|
pageSize?: number;
|
|
28
|
-
/**
|
|
24
|
+
/** Allows queries with an empty search string. Defaults to `false`. */
|
|
29
25
|
allowEmptySearchString?: boolean;
|
|
30
|
-
/**
|
|
26
|
+
/** Clears loaded items when a new search query starts. Defaults to `true`. */
|
|
31
27
|
resetOnNewSearchQuery?: boolean;
|
|
32
28
|
};
|
|
33
29
|
export type SearchSourceType = 'channels' | 'users' | 'messages' | (string & {});
|
package/dist/types/signing.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Decodes a JWT
|
|
2
|
+
* Decodes a JWT and returns the embedded `user_id`. The signature is not verified.
|
|
3
3
|
*
|
|
4
|
-
* @param token - The JWT
|
|
5
|
-
* @returns The `user_id`
|
|
4
|
+
* @param token - The JWT to decode.
|
|
5
|
+
* @returns The `user_id` from the token's payload, or an empty string when the token does not have
|
|
6
|
+
* three dot-separated segments.
|
|
6
7
|
*/
|
|
7
8
|
export declare function UserFromToken(token: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a development token for `userId`: an unsigned JWT the API accepts only while the app
|
|
11
|
+
* has auth checks disabled (`disable_auth_checks`). Never use one in production.
|
|
12
|
+
*
|
|
13
|
+
* @param userId - The ID of the user the token is for.
|
|
14
|
+
* @returns The development token.
|
|
15
|
+
*/
|
|
16
|
+
export declare function DevToken(userId: string): string;
|
package/dist/types/thread.d.ts
CHANGED
|
@@ -11,10 +11,7 @@ import type { MergeNewestPageOptions } from './pagination';
|
|
|
11
11
|
import type { ThreadDeclarativeConfig } from './configuration/types';
|
|
12
12
|
import type { PipelineEvent } from './EventHandlerPipeline';
|
|
13
13
|
export type ThreadState = {
|
|
14
|
-
/**
|
|
15
|
-
* Determines if the thread is currently opened and on-screen. When the thread is active,
|
|
16
|
-
* all new messages are immediately marked as read.
|
|
17
|
-
*/
|
|
14
|
+
/** Whether the thread is open and on-screen. While active, new messages are marked read. */
|
|
18
15
|
active: boolean;
|
|
19
16
|
channel: Channel;
|
|
20
17
|
/** Unix nanoseconds, as the API sends it. */
|
|
@@ -24,10 +21,7 @@ export type ThreadState = {
|
|
|
24
21
|
deletedAt: TimestampNS | null;
|
|
25
22
|
isLoading: boolean;
|
|
26
23
|
isStateStale: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Thread is identified by and has a one-to-one relation with its parent message.
|
|
29
|
-
* We use parent message id as a thread id.
|
|
30
|
-
*/
|
|
24
|
+
/** A thread maps one-to-one to its parent message, whose ID is the thread ID. */
|
|
31
25
|
parentMessage: LocalMessage;
|
|
32
26
|
participants: ThreadStateResponse['thread_participants'];
|
|
33
27
|
read: ThreadReadState;
|
|
@@ -54,14 +48,9 @@ export type ThreadConfig = {
|
|
|
54
48
|
markReadRequest?: CustomThreadMarkReadRequestFn;
|
|
55
49
|
};
|
|
56
50
|
};
|
|
57
|
-
/**
|
|
58
|
-
* Empty because every field of `ThreadConfig` is optional — a thread's own configuration is one handler
|
|
59
|
-
* wide. Declared and frozen anyway, so the entity carries the same defaults layer as every other
|
|
60
|
-
* configurable class rather than a special case.
|
|
61
|
-
*/
|
|
51
|
+
/** Empty: every field of `ThreadConfig` is optional. */
|
|
62
52
|
export declare const DEFAULT_THREAD_CONFIG: ThreadConfig;
|
|
63
53
|
export declare class Thread extends WithSubscriptions {
|
|
64
|
-
/** The shared configuration machinery — see {@link ConfigController}. */
|
|
65
54
|
private readonly configController;
|
|
66
55
|
readonly state: StateStore<ThreadState>;
|
|
67
56
|
readonly id: string;
|
|
@@ -70,7 +59,6 @@ export declare class Thread extends WithSubscriptions {
|
|
|
70
59
|
readonly messagePaginator: MessagePaginator;
|
|
71
60
|
private client;
|
|
72
61
|
private failedRepliesMap;
|
|
73
|
-
/** How many activations (`activate()` calls) have not been released yet. */
|
|
74
62
|
private _activeRefCount;
|
|
75
63
|
constructor({ client, threadData, channel, parentMessage, draft, }: {
|
|
76
64
|
client: StreamChat;
|
|
@@ -80,55 +68,35 @@ export declare class Thread extends WithSubscriptions {
|
|
|
80
68
|
draft?: DraftResponse;
|
|
81
69
|
});
|
|
82
70
|
/**
|
|
83
|
-
* Derives this thread's configuration
|
|
84
|
-
*
|
|
85
|
-
* Called by the constructor and by `client.config.reset()`. The thread owns only its own
|
|
86
|
-
* `requestHandlers`; the paginator derives its own configuration.
|
|
71
|
+
* Derives this thread's configuration, and its reply paginator's, from the declarative slice.
|
|
72
|
+
* Called by the constructor and by `client.config.reset()`.
|
|
87
73
|
*/
|
|
88
74
|
initializeConfig(declarativeConfig?: ThreadDeclarativeConfig): void;
|
|
89
|
-
/**
|
|
90
|
-
* Resolved configuration as a store, so consumers can react to it — the shape every configurable class
|
|
91
|
-
* exposes.
|
|
92
|
-
*/
|
|
93
75
|
get configState(): StateStore<ThreadConfig>;
|
|
76
|
+
get config(): Readonly<ThreadConfig>;
|
|
94
77
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
78
|
+
* Merges a partial configuration into the resolved config.
|
|
79
|
+
*
|
|
80
|
+
* @param config - The fields to change.
|
|
97
81
|
*/
|
|
98
|
-
get config(): Readonly<ThreadConfig>;
|
|
99
|
-
/** Merges a partial configuration into the resolved config and notifies subscribers. */
|
|
100
82
|
updateConfig(config: Partial<ThreadConfig>): void;
|
|
101
83
|
get channel(): Channel;
|
|
102
84
|
get hasStaleState(): boolean;
|
|
103
85
|
get ownUnreadCount(): number;
|
|
104
86
|
/**
|
|
105
|
-
* Declares that a consumer is displaying this thread
|
|
106
|
-
* `channel.activate()`
|
|
107
|
-
*
|
|
108
|
-
* release again does nothing, so a consumer can't end another one's activation.
|
|
109
|
-
*
|
|
110
|
-
* `active` is also what {@link ConnectionRecoveryManager} filters on to decide which threads to
|
|
111
|
-
* reload on reconnect, so an activation that is never released costs more than a missed auto-read.
|
|
87
|
+
* Declares that a consumer is displaying this thread and returns the function that ends it (as
|
|
88
|
+
* `channel.activate()`). Refcounted: the thread stays active until the last release, and each
|
|
89
|
+
* release is idempotent. `active` selects the threads reloaded on reconnect, so release it.
|
|
112
90
|
*
|
|
113
|
-
* The first activation
|
|
114
|
-
*
|
|
115
|
-
* whether or not the thread list holds it. Reopening it therefore needs no fetch unless it went stale.
|
|
91
|
+
* The first activation keeps the thread in `client.threads` for the session, subscribed and
|
|
92
|
+
* resolvable through `client.threads.get(id)` after release.
|
|
116
93
|
*/
|
|
117
94
|
activate: () => (() => void);
|
|
118
95
|
/**
|
|
119
|
-
* Re-queries
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* Preserves failed (unsent) replies. They are read out of the reply paginator rather than out of
|
|
124
|
-
* `failedRepliesMap`, because that map is only written by `upsertReplyLocally`, whose callers are
|
|
125
|
-
* this thread's own subscriptions and the offline-DB path resolved through `client.threads.get` —
|
|
126
|
-
* neither of which covers a thread that was never activated or listed. Reading the paginator
|
|
127
|
-
* is true for registered and unregistered threads alike. An overlap merge keeps them anyway (the
|
|
128
|
-
* reconcile's provenance guard never prunes a non-server message); only a disjoint rebuild can drop
|
|
129
|
-
* them, so any that actually fell out are re-ingested below.
|
|
130
|
-
*
|
|
131
|
-
* Rethrows, except for a not-found answer on a thread that never had replies (see the catch).
|
|
96
|
+
* Re-queries the replies, sized to the loaded window, and reconciles them in place (the thread
|
|
97
|
+
* analogue of {@link Channel.reload}; recovery calls it for active threads). Failed replies are
|
|
98
|
+
* kept, read from the reply paginator since `failedRepliesMap` misses threads never activated or
|
|
99
|
+
* listed. Rethrows, except for a not-found answer on a thread that never had replies.
|
|
132
100
|
*/
|
|
133
101
|
reload: () => Promise<void>;
|
|
134
102
|
hydrateState: (thread: Thread, options?: {
|
|
@@ -136,27 +104,11 @@ export declare class Thread extends WithSubscriptions {
|
|
|
136
104
|
}) => void;
|
|
137
105
|
registerSubscriptions: () => void;
|
|
138
106
|
/**
|
|
139
|
-
* Subscribes
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* - no *setup function* runs for it — matching how `MessageComposer` already behaves;
|
|
146
|
-
* - it sees the declarative slice **as it stood when the thread was constructed**, because the
|
|
147
|
-
* constructor applies it directly, but no *later* `client.config.set({ thread: … })` or
|
|
148
|
-
* `set({ messagePaginator: … })` reaches it;
|
|
149
|
-
* - it is absent from the registry's `liveInstances`, so `client.config.reset()` skips it, and
|
|
150
|
-
* `hasLiveInstances('thread')` does not count it when deciding whether to warn about a
|
|
151
|
-
* construction-only path registered too late.
|
|
152
|
-
*
|
|
153
|
-
* So read "declarative configuration is unaffected" as *at construction only*. A thread registered
|
|
154
|
-
* with a `ThreadManager` that has itself registered is covered — the manager calls
|
|
155
|
-
* `registerSubscriptions()` on every thread the list holds or that is active — so the common path
|
|
156
|
-
* is fine. A thread that is neither, or held by an unregistered manager, is not.
|
|
157
|
-
*
|
|
158
|
-
* The alternative — applying the setup function at construction — would break the teardown symmetry
|
|
159
|
-
* `WithSubscriptions` provides, which is why the asymmetry stands.
|
|
107
|
+
* Subscribes to the `'thread'` configuration key. Unlike `Channel`, which subscribes in its
|
|
108
|
+
* constructor, a thread that never registers sees the declarative slice only as of construction:
|
|
109
|
+
* no setup function runs, later `client.config.set` calls miss it and `client.config.reset()`
|
|
110
|
+
* skips it. `ThreadManager` registers the threads it holds (listed, `ensure()`d or active) while
|
|
111
|
+
* its own subscriptions are registered.
|
|
160
112
|
*/
|
|
161
113
|
private subscribeThreadSetupStateChange;
|
|
162
114
|
handleThreadUpdated: (event: EventPayload<"thread.updated">) => void;
|