stream-chat 9.47.1 → 9.48.0
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 +23 -1
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +23 -1
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +23 -1
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/channel.d.ts +2 -2
- package/dist/types/custom_types.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/thread.d.ts +2 -0
- package/dist/types/types.d.ts +45 -14
- package/package.json +1 -1
- package/src/channel.ts +2 -2
- package/src/custom_types.ts +1 -0
- package/src/index.ts +1 -0
- package/src/thread.ts +29 -0
- package/src/thread_manager.ts +1 -0
- package/src/types.ts +58 -14
package/dist/esm/index.mjs
CHANGED
|
@@ -7435,6 +7435,7 @@ var Thread = class extends WithSubscriptions {
|
|
|
7435
7435
|
this.addUnsubscribeFunction(this.subscribeMarkThreadStale());
|
|
7436
7436
|
this.addUnsubscribeFunction(this.subscribeNewReplies());
|
|
7437
7437
|
this.addUnsubscribeFunction(this.subscribeRepliesRead());
|
|
7438
|
+
this.addUnsubscribeFunction(this.subscribeRepliesUnread());
|
|
7438
7439
|
this.addUnsubscribeFunction(this.subscribeMessageDeleted());
|
|
7439
7440
|
this.addUnsubscribeFunction(this.subscribeMessageUpdated());
|
|
7440
7441
|
};
|
|
@@ -7476,6 +7477,26 @@ var Thread = class extends WithSubscriptions {
|
|
|
7476
7477
|
}
|
|
7477
7478
|
this.state.partialNext({ isStateStale: true });
|
|
7478
7479
|
}).unsubscribe;
|
|
7480
|
+
this.subscribeRepliesUnread = () => this.client.on("notification.mark_unread", (event) => {
|
|
7481
|
+
if (!event.user || !event.created_at || !event.thread_id) return;
|
|
7482
|
+
if (event.thread_id !== this.id) return;
|
|
7483
|
+
const userId = event.user.id;
|
|
7484
|
+
const createdAt = event.created_at;
|
|
7485
|
+
const user = event.user;
|
|
7486
|
+
this.state.next((current) => ({
|
|
7487
|
+
...current,
|
|
7488
|
+
read: {
|
|
7489
|
+
...current.read,
|
|
7490
|
+
[userId]: {
|
|
7491
|
+
...current.read[userId],
|
|
7492
|
+
lastReadAt: typeof event.last_read_at !== "undefined" ? new Date(event.last_read_at) : new Date(createdAt),
|
|
7493
|
+
user,
|
|
7494
|
+
firstUnreadMessageId: event.first_unread_message_id,
|
|
7495
|
+
unreadMessageCount: event.unread_messages ?? 0
|
|
7496
|
+
}
|
|
7497
|
+
}
|
|
7498
|
+
}));
|
|
7499
|
+
}).unsubscribe;
|
|
7479
7500
|
this.subscribeNewReplies = () => this.client.on("message.new", (event) => {
|
|
7480
7501
|
if (!this.client.userID || event.message?.parent_id !== this.id) {
|
|
7481
7502
|
return;
|
|
@@ -12403,6 +12424,7 @@ var ThreadManager = class extends WithSubscriptions {
|
|
|
12403
12424
|
const unsubscribeFunctions = [
|
|
12404
12425
|
"health.check",
|
|
12405
12426
|
"notification.mark_read",
|
|
12427
|
+
"notification.mark_unread",
|
|
12406
12428
|
"notification.thread_message_new",
|
|
12407
12429
|
"notification.channel_deleted"
|
|
12408
12430
|
].map(
|
|
@@ -16537,7 +16559,7 @@ var StreamChat = class _StreamChat {
|
|
|
16537
16559
|
if (this.userAgent) {
|
|
16538
16560
|
return this.userAgent;
|
|
16539
16561
|
}
|
|
16540
|
-
const version = "9.
|
|
16562
|
+
const version = "9.48.0";
|
|
16541
16563
|
const clientBundle = "browser-esm";
|
|
16542
16564
|
let userAgentString = "";
|
|
16543
16565
|
if (this.sdkIdentifier) {
|