stream-chat 9.45.2 → 9.45.4
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 +14 -13
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +14 -13
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +14 -13
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/moderation.d.ts +1 -2
- package/package.json +1 -1
- package/src/channel.ts +0 -7
- package/src/moderation.ts +3 -2
- package/src/search/UserSearchSource.ts +7 -1
package/dist/cjs/index.node.js
CHANGED
|
@@ -4976,7 +4976,13 @@ var UserSearchSource = class extends BaseSearchSource {
|
|
|
4976
4976
|
baseFilters: this.filters,
|
|
4977
4977
|
context: { searchQuery }
|
|
4978
4978
|
});
|
|
4979
|
-
|
|
4979
|
+
let sort;
|
|
4980
|
+
if (Array.isArray(this.sort)) {
|
|
4981
|
+
const hasIdSort = this.sort.some((entry) => "id" in entry);
|
|
4982
|
+
sort = hasIdSort ? this.sort : [...this.sort, { id: 1 }];
|
|
4983
|
+
} else {
|
|
4984
|
+
sort = { id: 1, ...this.sort };
|
|
4985
|
+
}
|
|
4980
4986
|
const options = { ...this.searchOptions, limit: this.pageSize, offset: this.offset };
|
|
4981
4987
|
const { users } = await this.client.queryUsers(filters, sort, options);
|
|
4982
4988
|
return { items: users };
|
|
@@ -10761,9 +10767,6 @@ var Channel = class {
|
|
|
10761
10767
|
...channelState.members,
|
|
10762
10768
|
[memberCopy.user.id]: memberCopy
|
|
10763
10769
|
};
|
|
10764
|
-
if (channel.data?.member_count && event.type === "member.added") {
|
|
10765
|
-
channel.data.member_count += 1;
|
|
10766
|
-
}
|
|
10767
10770
|
}
|
|
10768
10771
|
const currentUserId = this.getClient().userID;
|
|
10769
10772
|
if (typeof currentUserId === "string" && typeof memberCopy?.user?.id === "string" && memberCopy.user.id === currentUserId) {
|
|
@@ -10778,9 +10781,6 @@ var Channel = class {
|
|
|
10778
10781
|
};
|
|
10779
10782
|
delete newMembers[event.user.id];
|
|
10780
10783
|
channelState.members = newMembers;
|
|
10781
|
-
if (channel.data?.member_count) {
|
|
10782
|
-
channel.data.member_count = Math.max(channel.data.member_count - 1, 0);
|
|
10783
|
-
}
|
|
10784
10784
|
}
|
|
10785
10785
|
break;
|
|
10786
10786
|
case "notification.mark_unread": {
|
|
@@ -12346,7 +12346,7 @@ var Moderation = class {
|
|
|
12346
12346
|
* @param options
|
|
12347
12347
|
* @returns
|
|
12348
12348
|
*/
|
|
12349
|
-
async check(entityType, entityID, entityCreatorID, moderationPayload, configKey, options) {
|
|
12349
|
+
async check(entityType, entityID, entityCreatorID, moderationPayload, configKey, options, testMode) {
|
|
12350
12350
|
return await this.client.post(
|
|
12351
12351
|
this.client.baseURL + `/api/v2/moderation/check`,
|
|
12352
12352
|
{
|
|
@@ -12355,7 +12355,8 @@ var Moderation = class {
|
|
|
12355
12355
|
entity_creator_id: entityCreatorID,
|
|
12356
12356
|
moderation_payload: moderationPayload,
|
|
12357
12357
|
config_key: configKey,
|
|
12358
|
-
options
|
|
12358
|
+
options,
|
|
12359
|
+
test_mode: testMode
|
|
12359
12360
|
}
|
|
12360
12361
|
);
|
|
12361
12362
|
}
|
|
@@ -12402,9 +12403,9 @@ var Moderation = class {
|
|
|
12402
12403
|
moderationPayload,
|
|
12403
12404
|
"user_profile:default",
|
|
12404
12405
|
{
|
|
12405
|
-
force_sync: true
|
|
12406
|
-
|
|
12407
|
-
|
|
12406
|
+
force_sync: true
|
|
12407
|
+
},
|
|
12408
|
+
true
|
|
12408
12409
|
);
|
|
12409
12410
|
}
|
|
12410
12411
|
/**
|
|
@@ -16612,7 +16613,7 @@ var StreamChat = class _StreamChat {
|
|
|
16612
16613
|
if (this.userAgent) {
|
|
16613
16614
|
return this.userAgent;
|
|
16614
16615
|
}
|
|
16615
|
-
const version = "9.45.
|
|
16616
|
+
const version = "9.45.4";
|
|
16616
16617
|
const clientBundle = "node-cjs";
|
|
16617
16618
|
let userAgentString = "";
|
|
16618
16619
|
if (this.sdkIdentifier) {
|