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 {
1414 ModerationFlagOptions ,
1515 ModerationMuteOptions ,
1616 GetUserModerationReportOptions ,
17+ SubmitActionOptions ,
1718} from './types' ;
1819import { StreamChat } from './client' ;
1920import { normalizeQuerySort } from './utils' ;
@@ -179,4 +180,15 @@ export class Moderation<StreamChatGenerics extends ExtendableGenerics = DefaultG
179180 async getConfig ( key : string ) {
180181 return await this . client . get < GetConfigResponse > ( this . client . baseURL + '/api/v2/moderation/config/' + key ) ;
181182 }
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+ }
182194}
Original file line number Diff line number Diff line change @@ -3215,6 +3215,27 @@ export type ReviewQueueItem = {
32153215 updated_at : string ;
32163216} ;
32173217
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+
32183239export type GetUserModerationReportResponse < StreamChatGenerics extends ExtendableGenerics = DefaultGenerics > = {
32193240 user : UserResponse < StreamChatGenerics > ;
32203241 user_blocks ?: Array < {
You can’t perform that action at this time.
0 commit comments