@stream-io/node-sdk 0.4.23 → 0.4.25

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.
@@ -3,6 +3,8 @@ import { StreamResponse } from '../../types';
3
3
  import {
4
4
  BanRequest,
5
5
  BanResponse,
6
+ BulkImageModerationRequest,
7
+ BulkImageModerationResponse,
6
8
  CheckRequest,
7
9
  CheckResponse,
8
10
  CustomCheckRequest,
@@ -18,6 +20,8 @@ import {
18
20
  QueryFeedModerationTemplatesResponse,
19
21
  QueryModerationConfigsRequest,
20
22
  QueryModerationConfigsResponse,
23
+ QueryModerationFlagsRequest,
24
+ QueryModerationFlagsResponse,
21
25
  QueryModerationLogsRequest,
22
26
  QueryModerationLogsResponse,
23
27
  QueryReviewQueueRequest,
@@ -41,6 +45,7 @@ export class ModerationApi extends BaseApi {
41
45
  target_user_id: request?.target_user_id,
42
46
  banned_by_id: request?.banned_by_id,
43
47
  channel_cid: request?.channel_cid,
48
+ delete_messages: request?.delete_messages,
44
49
  ip_ban: request?.ip_ban,
45
50
  reason: request?.reason,
46
51
  shadow: request?.shadow,
@@ -61,6 +66,28 @@ export class ModerationApi extends BaseApi {
61
66
  return { ...response.body, metadata: response.metadata };
62
67
  };
63
68
 
69
+ bulkImageModeration = async (
70
+ request: BulkImageModerationRequest,
71
+ ): Promise<StreamResponse<BulkImageModerationResponse>> => {
72
+ const body = {
73
+ csv_file: request?.csv_file,
74
+ };
75
+
76
+ const response = await this.sendRequest<
77
+ StreamResponse<BulkImageModerationResponse>
78
+ >(
79
+ 'POST',
80
+ '/api/v2/moderation/bulk_image_moderation',
81
+ undefined,
82
+ undefined,
83
+ body,
84
+ );
85
+
86
+ decoders.BulkImageModerationResponse?.(response.body);
87
+
88
+ return { ...response.body, metadata: response.metadata };
89
+ };
90
+
64
91
  check = async (
65
92
  request: CheckRequest,
66
93
  ): Promise<StreamResponse<CheckResponse>> => {
@@ -109,8 +136,10 @@ export class ModerationApi extends BaseApi {
109
136
  block_list_config: request?.block_list_config,
110
137
  bodyguard_config: request?.bodyguard_config,
111
138
  google_vision_config: request?.google_vision_config,
139
+ rule_builder_config: request?.rule_builder_config,
112
140
  user: request?.user,
113
141
  velocity_filter_config: request?.velocity_filter_config,
142
+ video_call_rule_config: request?.video_call_rule_config,
114
143
  };
115
144
 
116
145
  const response = await this.sendRequest<
@@ -293,6 +322,26 @@ export class ModerationApi extends BaseApi {
293
322
  return { ...response.body, metadata: response.metadata };
294
323
  };
295
324
 
325
+ queryModerationFlags = async (
326
+ request?: QueryModerationFlagsRequest,
327
+ ): Promise<StreamResponse<QueryModerationFlagsResponse>> => {
328
+ const body = {
329
+ limit: request?.limit,
330
+ next: request?.next,
331
+ prev: request?.prev,
332
+ sort: request?.sort,
333
+ filter: request?.filter,
334
+ };
335
+
336
+ const response = await this.sendRequest<
337
+ StreamResponse<QueryModerationFlagsResponse>
338
+ >('POST', '/api/v2/moderation/flags', undefined, undefined, body);
339
+
340
+ decoders.QueryModerationFlagsResponse?.(response.body);
341
+
342
+ return { ...response.body, metadata: response.metadata };
343
+ };
344
+
296
345
  queryModerationLogs = async (
297
346
  request?: QueryModerationLogsRequest,
298
347
  ): Promise<StreamResponse<QueryModerationLogsResponse>> => {