stream-chat 9.35.1 → 9.36.1
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 +9 -30
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +9 -30
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +9 -30
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/channel_batch_updater.d.ts +0 -16
- package/dist/types/client.d.ts +5 -0
- package/dist/types/types.d.ts +1 -3
- package/package.json +1 -1
- package/src/channel_batch_updater.ts +0 -36
- package/src/channel_state.ts +6 -1
- package/src/client.ts +9 -0
- package/src/types.ts +1 -7
|
@@ -491,34 +491,6 @@ var ChannelBatchUpdater = class {
|
|
|
491
491
|
data
|
|
492
492
|
});
|
|
493
493
|
}
|
|
494
|
-
/**
|
|
495
|
-
* addFilterTags - Add filter tags to channels matching the filter
|
|
496
|
-
*
|
|
497
|
-
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
|
|
498
|
-
* @param {string[]} tags Tags to add
|
|
499
|
-
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
|
|
500
|
-
*/
|
|
501
|
-
async addFilterTags(filter, tags) {
|
|
502
|
-
return await this.client.updateChannelsBatch({
|
|
503
|
-
operation: "addFilterTags",
|
|
504
|
-
filter,
|
|
505
|
-
filter_tags_update: tags
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* removeFilterTags - Remove filter tags from channels matching the filter
|
|
510
|
-
*
|
|
511
|
-
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
|
|
512
|
-
* @param {string[]} tags Tags to remove
|
|
513
|
-
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
|
|
514
|
-
*/
|
|
515
|
-
async removeFilterTags(filter, tags) {
|
|
516
|
-
return await this.client.updateChannelsBatch({
|
|
517
|
-
operation: "removeFilterTags",
|
|
518
|
-
filter,
|
|
519
|
-
filter_tags_update: tags
|
|
520
|
-
});
|
|
521
|
-
}
|
|
522
494
|
};
|
|
523
495
|
|
|
524
496
|
// src/client.ts
|
|
@@ -1553,7 +1525,7 @@ var ChannelState = class {
|
|
|
1553
1525
|
if (message.user && this._channel?.cid) {
|
|
1554
1526
|
this._channel.getClient().state.updateUserReference(message.user, this._channel.cid);
|
|
1555
1527
|
}
|
|
1556
|
-
if (initializing && message.id && this.threads[message.id]) {
|
|
1528
|
+
if (initializing && message.id && this.threads[message.id] && !this._channel.getClient().preventThreadCleanup) {
|
|
1557
1529
|
delete this.threads[message.id];
|
|
1558
1530
|
}
|
|
1559
1531
|
const shouldSkipLastMessageAtUpdate = this._channel.getConfig()?.skip_last_msg_update_for_system_msgs && message.type === "system";
|
|
@@ -12778,6 +12750,11 @@ function isString2(x) {
|
|
|
12778
12750
|
}
|
|
12779
12751
|
var StreamChat = class _StreamChat {
|
|
12780
12752
|
constructor(key, secretOrOptions, options) {
|
|
12753
|
+
/**
|
|
12754
|
+
* If true, we will not clean up threads when channel state is in initializing state.
|
|
12755
|
+
* The main use case for SDKs who do independent state recovery for channels.
|
|
12756
|
+
*/
|
|
12757
|
+
this.preventThreadCleanup = false;
|
|
12781
12758
|
this.nextRequestAbortController = null;
|
|
12782
12759
|
/**
|
|
12783
12760
|
* @private
|
|
@@ -15060,6 +15037,8 @@ var StreamChat = class _StreamChat {
|
|
|
15060
15037
|
`${this.baseURL}/threads`,
|
|
15061
15038
|
requestBody
|
|
15062
15039
|
);
|
|
15040
|
+
const parentMessages = response.threads.map((thread) => thread.parent_message);
|
|
15041
|
+
this.polls.hydratePollCache(parentMessages);
|
|
15063
15042
|
return {
|
|
15064
15043
|
threads: response.threads.map(
|
|
15065
15044
|
(thread) => new Thread({ client: this, threadData: thread })
|
|
@@ -15134,7 +15113,7 @@ var StreamChat = class _StreamChat {
|
|
|
15134
15113
|
if (this.userAgent) {
|
|
15135
15114
|
return this.userAgent;
|
|
15136
15115
|
}
|
|
15137
|
-
const version = "9.
|
|
15116
|
+
const version = "9.36.1";
|
|
15138
15117
|
const clientBundle = "browser-cjs";
|
|
15139
15118
|
let userAgentString = "";
|
|
15140
15119
|
if (this.sdkIdentifier) {
|