File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
14
14
ModerationFlagOptions ,
15
15
ModerationMuteOptions ,
16
16
GetUserModerationReportOptions ,
17
+ SubmitActionOptions ,
17
18
} from './types' ;
18
19
import { StreamChat } from './client' ;
19
20
import { normalizeQuerySort } from './utils' ;
@@ -179,4 +180,15 @@ export class Moderation<StreamChatGenerics extends ExtendableGenerics = DefaultG
179
180
async getConfig ( key : string ) {
180
181
return await this . client . get < GetConfigResponse > ( this . client . baseURL + '/api/v2/moderation/config/' + key ) ;
181
182
}
183
+
184
+ async submitAction ( actionType : string , itemID : string , options : SubmitActionOptions = { } ) {
185
+ return await this . client . post < { item_id : string } & APIResponse > (
186
+ this . client . baseURL + '/api/v2/moderation/submit_action' ,
187
+ {
188
+ action_type : actionType ,
189
+ item_id : itemID ,
190
+ ...options ,
191
+ } ,
192
+ ) ;
193
+ }
182
194
}
Original file line number Diff line number Diff line change @@ -3215,6 +3215,27 @@ export type ReviewQueueItem = {
3215
3215
updated_at : string ;
3216
3216
} ;
3217
3217
3218
+ export type SubmitActionOptions = {
3219
+ ban ?: {
3220
+ channel_ban_only ?: boolean ;
3221
+ reason ?: string ;
3222
+ timeout ?: number ;
3223
+ } ;
3224
+ delete_message ?: {
3225
+ hard_delete ?: boolean ;
3226
+ } ;
3227
+ delete_user ?: {
3228
+ delete_conversation_channels ?: boolean ;
3229
+ hard_delete ?: boolean ;
3230
+ mark_messages_deleted ?: boolean ;
3231
+ } ;
3232
+ restore ?: { } ;
3233
+ unban ?: {
3234
+ channel_cid ?: string ;
3235
+ } ;
3236
+ user_id ?: string ;
3237
+ } ;
3238
+
3218
3239
export type GetUserModerationReportResponse < StreamChatGenerics extends ExtendableGenerics = DefaultGenerics > = {
3219
3240
user : UserResponse < StreamChatGenerics > ;
3220
3241
user_blocks ?: Array < {
You can’t perform that action at this time.
0 commit comments