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
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import type { QueryChannelsResponseWithChannels, StreamChat } from './client';
|
|
2
|
-
import type { ChannelFilters, ChannelOptions, ChannelSort, ChannelStateOptions, Event } from './types';
|
|
3
|
-
import type { ValueOrPatch } from './store';
|
|
4
|
-
import { StateStore } from './store';
|
|
5
|
-
import type { Channel } from './channel';
|
|
6
|
-
import { WithSubscriptions } from './utils/WithSubscriptions';
|
|
7
|
-
export type ChannelManagerPagination = {
|
|
8
|
-
filters: ChannelFilters;
|
|
9
|
-
hasNext: boolean;
|
|
10
|
-
isLoading: boolean;
|
|
11
|
-
isLoadingNext: boolean;
|
|
12
|
-
options: ChannelOptions;
|
|
13
|
-
responseFilters?: ChannelFilters;
|
|
14
|
-
responseSort?: ChannelSort;
|
|
15
|
-
sort: ChannelSort;
|
|
16
|
-
};
|
|
17
|
-
export type ChannelManagerState = {
|
|
18
|
-
channels: Channel[];
|
|
19
|
-
/**
|
|
20
|
-
* This value will become true the first time queryChannels is successfully executed and
|
|
21
|
-
* will remain false otherwise. It's used as a control property regarding whether the list
|
|
22
|
-
* has been initialized yet (i.e a query has already been done at least once) or not. We do
|
|
23
|
-
* this to prevent state.channels from being forced to be nullable.
|
|
24
|
-
*/
|
|
25
|
-
initialized: boolean;
|
|
26
|
-
pagination: ChannelManagerPagination;
|
|
27
|
-
error: Error | undefined;
|
|
28
|
-
};
|
|
29
|
-
export type ChannelSetterParameterType = ValueOrPatch<ChannelManagerState['channels']>;
|
|
30
|
-
export type ChannelSetterType = (arg: ChannelSetterParameterType) => void;
|
|
31
|
-
export type GenericEventHandlerType<T extends unknown[]> = (...args: T) => void | (() => void) | ((...args: T) => Promise<void>) | Promise<void>;
|
|
32
|
-
export type EventHandlerType = GenericEventHandlerType<[Event]>;
|
|
33
|
-
export type EventHandlerOverrideType = GenericEventHandlerType<[
|
|
34
|
-
ChannelSetterType,
|
|
35
|
-
Event
|
|
36
|
-
]>;
|
|
37
|
-
export type ChannelManagerEventTypes = 'notification.added_to_channel' | 'notification.message_new' | 'notification.removed_from_channel' | 'message.new' | 'member.updated' | 'channel.deleted' | 'channel.hidden' | 'channel.truncated' | 'channel.visible' | 'channel.updated';
|
|
38
|
-
export type ChannelManagerEventHandlerNames = 'channelDeletedHandler' | 'channelHiddenHandler' | 'channelTruncatedHandler' | 'channelUpdatedHandler' | 'channelVisibleHandler' | 'newMessageHandler' | 'memberUpdatedHandler' | 'notificationAddedToChannelHandler' | 'notificationNewMessageHandler' | 'notificationRemovedFromChannelHandler';
|
|
39
|
-
export type ChannelManagerEventHandlerOverrides = Partial<Record<ChannelManagerEventHandlerNames, EventHandlerOverrideType>>;
|
|
40
|
-
export type ExecuteChannelsQueryPayload = Pick<ChannelManagerPagination, 'filters' | 'sort' | 'options'> & {
|
|
41
|
-
stateOptions: ChannelStateOptions;
|
|
42
|
-
};
|
|
43
|
-
export declare const channelManagerEventToHandlerMapping: {
|
|
44
|
-
[key in ChannelManagerEventTypes]: ChannelManagerEventHandlerNames;
|
|
45
|
-
};
|
|
46
|
-
export type ChannelManagerOptions = {
|
|
47
|
-
/**
|
|
48
|
-
* Aborts a channels query that is already in progress and runs the new one.
|
|
49
|
-
*/
|
|
50
|
-
abortInFlightQuery?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Allows channel promotion to be applied where applicable for channels that are
|
|
53
|
-
* currently not part of the channel list within the state. A good example of
|
|
54
|
-
* this would be a channel that is being watched and it receives a new message,
|
|
55
|
-
* but is not part of the list initially.
|
|
56
|
-
*/
|
|
57
|
-
allowNotLoadedChannelPromotionForEvent?: {
|
|
58
|
-
'channel.visible': boolean;
|
|
59
|
-
'message.new': boolean;
|
|
60
|
-
'notification.added_to_channel': boolean;
|
|
61
|
-
'notification.message_new': boolean;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Allows us to lock the order of channels within the list. Any event that would
|
|
65
|
-
* change the order of channels within the list will do nothing.
|
|
66
|
-
*/
|
|
67
|
-
lockChannelOrder?: boolean;
|
|
68
|
-
};
|
|
69
|
-
export type QueryChannelsRequestOutput = Channel[] | QueryChannelsResponseWithChannels;
|
|
70
|
-
export type QueryChannelsRequestType = (filters: ChannelFilters, sort?: ChannelSort, options?: ChannelOptions, stateOptions?: ChannelStateOptions) => Promise<QueryChannelsRequestOutput>;
|
|
71
|
-
export declare const DEFAULT_CHANNEL_MANAGER_OPTIONS: {
|
|
72
|
-
abortInFlightQuery: boolean;
|
|
73
|
-
allowNotLoadedChannelPromotionForEvent: {
|
|
74
|
-
'channel.visible': boolean;
|
|
75
|
-
'message.new': boolean;
|
|
76
|
-
'notification.added_to_channel': boolean;
|
|
77
|
-
'notification.message_new': boolean;
|
|
78
|
-
};
|
|
79
|
-
lockChannelOrder: boolean;
|
|
80
|
-
};
|
|
81
|
-
export declare const DEFAULT_CHANNEL_MANAGER_PAGINATION_OPTIONS: {
|
|
82
|
-
offset: number;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* A class that manages a list of channels and changes it based on configuration and WS events. The
|
|
86
|
-
* list of channels is reactive as well as the pagination and it can be subscribed to for state updates.
|
|
87
|
-
*
|
|
88
|
-
* @internal
|
|
89
|
-
*/
|
|
90
|
-
export declare class ChannelManager extends WithSubscriptions {
|
|
91
|
-
readonly state: StateStore<ChannelManagerState>;
|
|
92
|
-
private client;
|
|
93
|
-
private eventHandlers;
|
|
94
|
-
private eventHandlerOverrides;
|
|
95
|
-
private queryChannelsRequest;
|
|
96
|
-
private options;
|
|
97
|
-
private stateOptions;
|
|
98
|
-
private id;
|
|
99
|
-
constructor({ client, eventHandlerOverrides, options, queryChannelsOverride, }: {
|
|
100
|
-
client: StreamChat;
|
|
101
|
-
eventHandlerOverrides?: ChannelManagerEventHandlerOverrides;
|
|
102
|
-
options?: ChannelManagerOptions;
|
|
103
|
-
queryChannelsOverride?: QueryChannelsRequestType;
|
|
104
|
-
});
|
|
105
|
-
setChannels: (valueOrFactory: ChannelSetterParameterType) => void;
|
|
106
|
-
setEventHandlerOverrides: (eventHandlerOverrides?: ChannelManagerEventHandlerOverrides) => void;
|
|
107
|
-
setQueryChannelsRequest: (queryChannelsRequest: QueryChannelsRequestType) => void;
|
|
108
|
-
setOptions: (options?: ChannelManagerOptions) => void;
|
|
109
|
-
private executeChannelsQuery;
|
|
110
|
-
queryChannels: (filters: ChannelFilters, sort?: ChannelSort, options?: ChannelOptions, stateOptions?: ChannelStateOptions) => Promise<void>;
|
|
111
|
-
loadNext: () => Promise<void>;
|
|
112
|
-
private notificationAddedToChannelHandler;
|
|
113
|
-
private channelDeletedHandler;
|
|
114
|
-
private channelHiddenHandler;
|
|
115
|
-
private newMessageHandler;
|
|
116
|
-
private notificationNewMessageHandler;
|
|
117
|
-
private channelVisibleHandler;
|
|
118
|
-
private notificationRemovedFromChannelHandler;
|
|
119
|
-
private memberUpdatedHandler;
|
|
120
|
-
private subscriptionOrOverride;
|
|
121
|
-
registerSubscriptions: () => void;
|
|
122
|
-
}
|
package/dist/types/events.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export declare const EVENT_MAP: {
|
|
2
|
-
'channel.created': boolean;
|
|
3
|
-
'channel.deleted': boolean;
|
|
4
|
-
'channel.hidden': boolean;
|
|
5
|
-
'channel.kicked': boolean;
|
|
6
|
-
'channel.muted': boolean;
|
|
7
|
-
'channel.truncated': boolean;
|
|
8
|
-
'channel.unmuted': boolean;
|
|
9
|
-
'channel.updated': boolean;
|
|
10
|
-
'channel.visible': boolean;
|
|
11
|
-
'draft.deleted': boolean;
|
|
12
|
-
'draft.updated': boolean;
|
|
13
|
-
'health.check': boolean;
|
|
14
|
-
'member.added': boolean;
|
|
15
|
-
'member.removed': boolean;
|
|
16
|
-
'member.updated': boolean;
|
|
17
|
-
'message.deleted': boolean;
|
|
18
|
-
'message.new': boolean;
|
|
19
|
-
'message.read': boolean;
|
|
20
|
-
'message.updated': boolean;
|
|
21
|
-
'message.undeleted': boolean;
|
|
22
|
-
'notification.added_to_channel': boolean;
|
|
23
|
-
'notification.channel_deleted': boolean;
|
|
24
|
-
'message.delivered': boolean;
|
|
25
|
-
'notification.channel_mutes_updated': boolean;
|
|
26
|
-
'notification.channel_truncated': boolean;
|
|
27
|
-
'notification.invite_accepted': boolean;
|
|
28
|
-
'notification.invite_rejected': boolean;
|
|
29
|
-
'notification.invited': boolean;
|
|
30
|
-
'notification.mark_read': boolean;
|
|
31
|
-
'notification.mark_unread': boolean;
|
|
32
|
-
'notification.message_new': boolean;
|
|
33
|
-
'notification.mutes_updated': boolean;
|
|
34
|
-
'notification.reminder_due': boolean;
|
|
35
|
-
'notification.removed_from_channel': boolean;
|
|
36
|
-
'notification.thread_message_new': boolean;
|
|
37
|
-
'poll.closed': boolean;
|
|
38
|
-
'poll.updated': boolean;
|
|
39
|
-
'poll.vote_casted': boolean;
|
|
40
|
-
'poll.vote_changed': boolean;
|
|
41
|
-
'poll.vote_removed': boolean;
|
|
42
|
-
'reaction.deleted': boolean;
|
|
43
|
-
'reaction.new': boolean;
|
|
44
|
-
'reaction.updated': boolean;
|
|
45
|
-
'reminder.created': boolean;
|
|
46
|
-
'reminder.deleted': boolean;
|
|
47
|
-
'reminder.updated': boolean;
|
|
48
|
-
'thread.updated': boolean;
|
|
49
|
-
'typing.start': boolean;
|
|
50
|
-
'typing.stop': boolean;
|
|
51
|
-
'user.banned': boolean;
|
|
52
|
-
'user.deleted': boolean;
|
|
53
|
-
'user.messages.deleted': boolean;
|
|
54
|
-
'user.presence.changed': boolean;
|
|
55
|
-
'user.unbanned': boolean;
|
|
56
|
-
'user.unread_message_reminder': boolean;
|
|
57
|
-
'user.updated': boolean;
|
|
58
|
-
'user.watching.start': boolean;
|
|
59
|
-
'user.watching.stop': boolean;
|
|
60
|
-
'ai_indicator.update': boolean;
|
|
61
|
-
'ai_indicator.stop': boolean;
|
|
62
|
-
'ai_indicator.clear': boolean;
|
|
63
|
-
'message.read_locally': boolean;
|
|
64
|
-
'channels.queried': boolean;
|
|
65
|
-
'offline_reactions.queried': boolean;
|
|
66
|
-
'connection.changed': boolean;
|
|
67
|
-
'connection.recovered': boolean;
|
|
68
|
-
'transport.changed': boolean;
|
|
69
|
-
'capabilities.changed': boolean;
|
|
70
|
-
'live_location_sharing.started': boolean;
|
|
71
|
-
'live_location_sharing.stopped': boolean;
|
|
72
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { StateStore } from '../store';
|
|
2
|
-
import { type DebouncedFunc } from '../utils';
|
|
3
|
-
type PaginationDirection = 'next' | 'prev';
|
|
4
|
-
type Cursor = {
|
|
5
|
-
next: string | null;
|
|
6
|
-
prev: string | null;
|
|
7
|
-
};
|
|
8
|
-
export type PaginationQueryParams = {
|
|
9
|
-
direction: PaginationDirection;
|
|
10
|
-
};
|
|
11
|
-
export type PaginationQueryReturnValue<T> = {
|
|
12
|
-
items: T[];
|
|
13
|
-
} & {
|
|
14
|
-
next?: string;
|
|
15
|
-
prev?: string;
|
|
16
|
-
};
|
|
17
|
-
export type PaginatorDebounceOptions = {
|
|
18
|
-
debounceMs: number;
|
|
19
|
-
};
|
|
20
|
-
type DebouncedExecQueryFunction = DebouncedFunc<(params: {
|
|
21
|
-
direction: PaginationDirection;
|
|
22
|
-
}) => Promise<void>>;
|
|
23
|
-
export type PaginatorState<T = any> = {
|
|
24
|
-
hasNext: boolean;
|
|
25
|
-
hasPrev: boolean;
|
|
26
|
-
isLoading: boolean;
|
|
27
|
-
items: T[] | undefined;
|
|
28
|
-
lastQueryError?: Error;
|
|
29
|
-
cursor?: Cursor;
|
|
30
|
-
offset?: number;
|
|
31
|
-
};
|
|
32
|
-
export type PaginatorOptions = {
|
|
33
|
-
/** The number of milliseconds to debounce the search query. The default interval is 300ms. */
|
|
34
|
-
debounceMs?: number;
|
|
35
|
-
pageSize?: number;
|
|
36
|
-
};
|
|
37
|
-
export declare const DEFAULT_PAGINATION_OPTIONS: Required<PaginatorOptions>;
|
|
38
|
-
export declare abstract class BasePaginator<T> {
|
|
39
|
-
state: StateStore<PaginatorState<T>>;
|
|
40
|
-
pageSize: number;
|
|
41
|
-
protected _executeQueryDebounced: DebouncedExecQueryFunction;
|
|
42
|
-
protected _isCursorPagination: boolean;
|
|
43
|
-
protected constructor(options?: PaginatorOptions);
|
|
44
|
-
get lastQueryError(): Error | undefined;
|
|
45
|
-
get hasNext(): boolean;
|
|
46
|
-
get hasPrev(): boolean;
|
|
47
|
-
get hasResults(): boolean;
|
|
48
|
-
get isLoading(): boolean;
|
|
49
|
-
get initialState(): PaginatorState;
|
|
50
|
-
get items(): T[] | undefined;
|
|
51
|
-
get cursor(): Cursor | undefined;
|
|
52
|
-
get offset(): number | undefined;
|
|
53
|
-
abstract query(params: PaginationQueryParams): Promise<PaginationQueryReturnValue<T>>;
|
|
54
|
-
abstract filterQueryResults(items: T[]): T[] | Promise<T[]>;
|
|
55
|
-
setDebounceOptions: ({ debounceMs }: PaginatorDebounceOptions) => void;
|
|
56
|
-
canExecuteQuery: (direction: PaginationDirection) => boolean;
|
|
57
|
-
protected getStateBeforeFirstQuery(): PaginatorState<T>;
|
|
58
|
-
protected getStateAfterQuery(stateUpdate: Partial<PaginatorState<T>>, isFirstPage: boolean): PaginatorState<T>;
|
|
59
|
-
executeQuery({ direction }: {
|
|
60
|
-
direction: PaginationDirection;
|
|
61
|
-
}): Promise<void>;
|
|
62
|
-
cancelScheduledQuery(): void;
|
|
63
|
-
resetState(): void;
|
|
64
|
-
next: () => Promise<void>;
|
|
65
|
-
prev: () => Promise<void>;
|
|
66
|
-
nextDebounced: () => void;
|
|
67
|
-
prevDebounced: () => void;
|
|
68
|
-
}
|
|
69
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BasePaginator } from './BasePaginator';
|
|
2
|
-
import type { PaginationQueryParams, PaginationQueryReturnValue, PaginatorOptions } from './BasePaginator';
|
|
3
|
-
import type { ReminderFilters, ReminderResponse, ReminderSort } from '../types';
|
|
4
|
-
import type { StreamChat } from '../client';
|
|
5
|
-
export declare class ReminderPaginator extends BasePaginator<ReminderResponse> {
|
|
6
|
-
private client;
|
|
7
|
-
protected _filters: ReminderFilters | undefined;
|
|
8
|
-
protected _sort: ReminderSort | undefined;
|
|
9
|
-
get filters(): ReminderFilters | undefined;
|
|
10
|
-
get sort(): ReminderSort | undefined;
|
|
11
|
-
set filters(filters: ReminderFilters | undefined);
|
|
12
|
-
set sort(sort: ReminderSort | undefined);
|
|
13
|
-
constructor(client: StreamChat, options?: PaginatorOptions);
|
|
14
|
-
query: ({ direction, }: PaginationQueryParams) => Promise<PaginationQueryReturnValue<ReminderResponse>>;
|
|
15
|
-
filterQueryResults: (items: ReminderResponse[]) => ReminderResponse[];
|
|
16
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BasePaginator } from './BasePaginator';
|
|
2
|
-
import type { PaginationQueryParams, PaginationQueryReturnValue, PaginatorOptions, PaginatorState } from './BasePaginator';
|
|
3
|
-
import type { UserGroupResponse } from '../types';
|
|
4
|
-
import type { StreamChat } from '../client';
|
|
5
|
-
/**
|
|
6
|
-
* Paginates user-group listing through `/usergroups`.
|
|
7
|
-
*
|
|
8
|
-
* This entity only supports forward cursor pagination via `created_at_gt` and `id_gt`.
|
|
9
|
-
* Previous-page pagination is not available because the API does not expose a backward cursor.
|
|
10
|
-
*/
|
|
11
|
-
export declare class UserGroupPaginator extends BasePaginator<UserGroupResponse> {
|
|
12
|
-
private client;
|
|
13
|
-
protected _teamId: string | undefined;
|
|
14
|
-
constructor(client: StreamChat, options?: PaginatorOptions);
|
|
15
|
-
get initialState(): PaginatorState<UserGroupResponse>;
|
|
16
|
-
get teamId(): string | undefined;
|
|
17
|
-
set teamId(teamId: string | undefined);
|
|
18
|
-
private buildNextCursor;
|
|
19
|
-
query: ({ direction, }: PaginationQueryParams) => Promise<PaginationQueryReturnValue<UserGroupResponse>>;
|
|
20
|
-
filterQueryResults: (items: UserGroupResponse[]) => UserGroupResponse[];
|
|
21
|
-
}
|