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
|
@@ -133,8 +133,7 @@ export declare class Moderation {
|
|
|
133
133
|
videos?: string[];
|
|
134
134
|
}, configKey: string, options?: {
|
|
135
135
|
force_sync?: boolean;
|
|
136
|
-
|
|
137
|
-
}): Promise<CheckResponse>;
|
|
136
|
+
}, testMode?: boolean): Promise<CheckResponse>;
|
|
138
137
|
/**
|
|
139
138
|
* Experimental: Check user profile
|
|
140
139
|
*
|
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -2165,9 +2165,6 @@ export class Channel {
|
|
|
2165
2165
|
...channelState.members,
|
|
2166
2166
|
[memberCopy.user.id]: memberCopy,
|
|
2167
2167
|
};
|
|
2168
|
-
if (channel.data?.member_count && event.type === 'member.added') {
|
|
2169
|
-
channel.data.member_count += 1;
|
|
2170
|
-
}
|
|
2171
2168
|
}
|
|
2172
2169
|
|
|
2173
2170
|
const currentUserId = this.getClient().userID;
|
|
@@ -2190,10 +2187,6 @@ export class Channel {
|
|
|
2190
2187
|
|
|
2191
2188
|
channelState.members = newMembers;
|
|
2192
2189
|
|
|
2193
|
-
if (channel.data?.member_count) {
|
|
2194
|
-
channel.data.member_count = Math.max(channel.data.member_count - 1, 0);
|
|
2195
|
-
}
|
|
2196
|
-
|
|
2197
2190
|
// TODO?: unset membership
|
|
2198
2191
|
}
|
|
2199
2192
|
break;
|
package/src/moderation.ts
CHANGED
|
@@ -281,8 +281,8 @@ export class Moderation {
|
|
|
281
281
|
configKey: string,
|
|
282
282
|
options?: {
|
|
283
283
|
force_sync?: boolean;
|
|
284
|
-
test_mode?: boolean;
|
|
285
284
|
},
|
|
285
|
+
testMode?: boolean,
|
|
286
286
|
) {
|
|
287
287
|
return await this.client.post<CheckResponse>(
|
|
288
288
|
this.client.baseURL + `/api/v2/moderation/check`,
|
|
@@ -293,6 +293,7 @@ export class Moderation {
|
|
|
293
293
|
moderation_payload: moderationPayload,
|
|
294
294
|
config_key: configKey,
|
|
295
295
|
options,
|
|
296
|
+
test_mode: testMode,
|
|
296
297
|
},
|
|
297
298
|
);
|
|
298
299
|
}
|
|
@@ -346,8 +347,8 @@ export class Moderation {
|
|
|
346
347
|
'user_profile:default',
|
|
347
348
|
{
|
|
348
349
|
force_sync: true,
|
|
349
|
-
test_mode: true,
|
|
350
350
|
},
|
|
351
|
+
true,
|
|
351
352
|
);
|
|
352
353
|
}
|
|
353
354
|
|
|
@@ -60,7 +60,13 @@ export class UserSearchSource<
|
|
|
60
60
|
baseFilters: this.filters,
|
|
61
61
|
context: { searchQuery } as UserSearchSourceFilterBuilderContext<TFilterContext>,
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
let sort: UserSort;
|
|
64
|
+
if (Array.isArray(this.sort)) {
|
|
65
|
+
const hasIdSort = this.sort.some((entry) => 'id' in entry);
|
|
66
|
+
sort = hasIdSort ? this.sort : [...this.sort, { id: 1 }];
|
|
67
|
+
} else {
|
|
68
|
+
sort = { id: 1, ...this.sort };
|
|
69
|
+
}
|
|
64
70
|
const options = { ...this.searchOptions, limit: this.pageSize, offset: this.offset };
|
|
65
71
|
const { users } = await this.client.queryUsers(filters, sort, options);
|
|
66
72
|
return { items: users };
|