stream-chat 8.37.0 → 8.38.0
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/browser.es.js +593 -134
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.full-bundle.min.js +1 -1
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/browser.js +594 -133
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +593 -134
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +594 -133
- package/dist/index.js.map +1 -1
- package/dist/types/client.d.ts +31 -15
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/moderation.d.ts +107 -0
- package/dist/types/moderation.d.ts.map +1 -0
- package/dist/types/types.d.ts +139 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +73 -36
- package/src/index.ts +1 -0
- package/src/moderation.ts +194 -0
- package/src/types.ts +186 -0
package/src/types.ts
CHANGED
|
@@ -442,6 +442,7 @@ export type FlagMessageResponse<StreamChatGenerics extends ExtendableGenerics =
|
|
|
442
442
|
reviewed_at?: string;
|
|
443
443
|
reviewed_by?: string;
|
|
444
444
|
};
|
|
445
|
+
review_queue_item_id?: string;
|
|
445
446
|
};
|
|
446
447
|
|
|
447
448
|
export type FlagUserResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
|
|
@@ -457,6 +458,7 @@ export type FlagUserResponse<StreamChatGenerics extends ExtendableGenerics = Def
|
|
|
457
458
|
reviewed_at?: string;
|
|
458
459
|
reviewed_by?: string;
|
|
459
460
|
};
|
|
461
|
+
review_queue_item_id?: string;
|
|
460
462
|
};
|
|
461
463
|
|
|
462
464
|
export type FormatMessageResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Omit<
|
|
@@ -1899,6 +1901,7 @@ export type AsyncModerationOptions = {
|
|
|
1899
1901
|
|
|
1900
1902
|
export type AppSettings = {
|
|
1901
1903
|
agora_options?: AgoraOptions | null;
|
|
1904
|
+
allowed_flag_reasons?: string[];
|
|
1902
1905
|
apn_config?: {
|
|
1903
1906
|
auth_key?: string;
|
|
1904
1907
|
auth_type?: string;
|
|
@@ -2006,6 +2009,8 @@ export type OGAttachment = {
|
|
|
2006
2009
|
export type BlockList = {
|
|
2007
2010
|
name: string;
|
|
2008
2011
|
words: string[];
|
|
2012
|
+
type?: string;
|
|
2013
|
+
validate?: boolean;
|
|
2009
2014
|
};
|
|
2010
2015
|
|
|
2011
2016
|
export type ChannelConfig<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = ChannelConfigFields &
|
|
@@ -3149,3 +3154,184 @@ export type QueryMessageHistoryResponse<StreamChatGenerics extends ExtendableGen
|
|
|
3149
3154
|
next?: string;
|
|
3150
3155
|
prev?: string;
|
|
3151
3156
|
};
|
|
3157
|
+
|
|
3158
|
+
// Moderation v2
|
|
3159
|
+
export type ModerationPayload = {
|
|
3160
|
+
created_at: string;
|
|
3161
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3162
|
+
custom?: Record<string, any>;
|
|
3163
|
+
images?: string[];
|
|
3164
|
+
texts?: string[];
|
|
3165
|
+
videos?: string[];
|
|
3166
|
+
};
|
|
3167
|
+
|
|
3168
|
+
export type ModV2ReviewStatus = 'complete' | 'flagged' | 'partial';
|
|
3169
|
+
|
|
3170
|
+
export type ModerationFlag = {
|
|
3171
|
+
created_at: string;
|
|
3172
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3173
|
+
custom: Record<string, any>;
|
|
3174
|
+
entity_creator_id: string;
|
|
3175
|
+
entity_id: string;
|
|
3176
|
+
entity_type: string;
|
|
3177
|
+
id: string;
|
|
3178
|
+
reason: string;
|
|
3179
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3180
|
+
result: Record<string, any>[];
|
|
3181
|
+
review_queue_item_id: string;
|
|
3182
|
+
updated_at: string;
|
|
3183
|
+
user: UserResponse;
|
|
3184
|
+
moderation_payload?: ModerationPayload;
|
|
3185
|
+
moderation_payload_hash?: string;
|
|
3186
|
+
};
|
|
3187
|
+
|
|
3188
|
+
export type ReviewQueueItem = {
|
|
3189
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3190
|
+
actions_taken: any[];
|
|
3191
|
+
appealed_by: string;
|
|
3192
|
+
assigned_to: string;
|
|
3193
|
+
completed_at: string;
|
|
3194
|
+
config_key: string;
|
|
3195
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3196
|
+
context: any[];
|
|
3197
|
+
created_at: string;
|
|
3198
|
+
created_by: string;
|
|
3199
|
+
entity_id: string;
|
|
3200
|
+
entity_type: string;
|
|
3201
|
+
flags: ModerationFlag[];
|
|
3202
|
+
has_image: boolean;
|
|
3203
|
+
has_text: boolean;
|
|
3204
|
+
has_video: boolean;
|
|
3205
|
+
id: string;
|
|
3206
|
+
moderation_payload: ModerationPayload;
|
|
3207
|
+
moderation_payload_hash: string;
|
|
3208
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3209
|
+
options: any;
|
|
3210
|
+
recommended_action: string;
|
|
3211
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3212
|
+
results: any;
|
|
3213
|
+
reviewed_at: string;
|
|
3214
|
+
status: string;
|
|
3215
|
+
updated_at: string;
|
|
3216
|
+
};
|
|
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
|
+
|
|
3239
|
+
export type GetUserModerationReportResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
|
|
3240
|
+
user: UserResponse<StreamChatGenerics>;
|
|
3241
|
+
user_blocks?: Array<{
|
|
3242
|
+
blocked_at: string;
|
|
3243
|
+
blocked_by_user_id: string;
|
|
3244
|
+
blocked_user_id: string;
|
|
3245
|
+
}>;
|
|
3246
|
+
user_mutes?: Mute<StreamChatGenerics>[];
|
|
3247
|
+
};
|
|
3248
|
+
|
|
3249
|
+
export type ReviewQueueFilters = QueryFilters<
|
|
3250
|
+
{
|
|
3251
|
+
assigned_to?:
|
|
3252
|
+
| RequireOnlyOne<Pick<QueryFilter<ReviewQueueItem['assigned_to']>, '$eq' | '$in'>>
|
|
3253
|
+
| PrimitiveFilter<ReviewQueueItem['assigned_to']>;
|
|
3254
|
+
} & {
|
|
3255
|
+
completed_at?:
|
|
3256
|
+
| RequireOnlyOne<Pick<QueryFilter<ReviewQueueItem['completed_at']>, '$eq' | '$gt' | '$lt' | '$gte' | '$lte'>>
|
|
3257
|
+
| PrimitiveFilter<ReviewQueueItem['completed_at']>;
|
|
3258
|
+
} & {
|
|
3259
|
+
config_key?:
|
|
3260
|
+
| RequireOnlyOne<Pick<QueryFilter<ReviewQueueItem['config_key']>, '$eq' | '$in'>>
|
|
3261
|
+
| PrimitiveFilter<ReviewQueueItem['config_key']>;
|
|
3262
|
+
} & {
|
|
3263
|
+
entity_type?:
|
|
3264
|
+
| RequireOnlyOne<Pick<QueryFilter<ReviewQueueItem['entity_type']>, '$eq' | '$in'>>
|
|
3265
|
+
| PrimitiveFilter<ReviewQueueItem['entity_type']>;
|
|
3266
|
+
} & {
|
|
3267
|
+
created_at?:
|
|
3268
|
+
| RequireOnlyOne<Pick<QueryFilter<ReviewQueueItem['created_at']>, '$eq' | '$gt' | '$lt' | '$gte' | '$lte'>>
|
|
3269
|
+
| PrimitiveFilter<ReviewQueueItem['created_at']>;
|
|
3270
|
+
} & {
|
|
3271
|
+
id?:
|
|
3272
|
+
| RequireOnlyOne<Pick<QueryFilter<ReviewQueueItem['id']>, '$eq' | '$in'>>
|
|
3273
|
+
| PrimitiveFilter<ReviewQueueItem['id']>;
|
|
3274
|
+
} & {
|
|
3275
|
+
entity_id?:
|
|
3276
|
+
| RequireOnlyOne<Pick<QueryFilter<ReviewQueueItem['entity_id']>, '$eq' | '$in'>>
|
|
3277
|
+
| PrimitiveFilter<ReviewQueueItem['entity_id']>;
|
|
3278
|
+
} & {
|
|
3279
|
+
reviewed?: boolean;
|
|
3280
|
+
} & {
|
|
3281
|
+
reviewed_at?:
|
|
3282
|
+
| RequireOnlyOne<Pick<QueryFilter<ReviewQueueItem['reviewed_at']>, '$eq' | '$gt' | '$lt' | '$gte' | '$lte'>>
|
|
3283
|
+
| PrimitiveFilter<ReviewQueueItem['reviewed_at']>;
|
|
3284
|
+
} & {
|
|
3285
|
+
status?:
|
|
3286
|
+
| RequireOnlyOne<Pick<QueryFilter<ReviewQueueItem['status']>, '$eq' | '$in'>>
|
|
3287
|
+
| PrimitiveFilter<ReviewQueueItem['status']>;
|
|
3288
|
+
} & {
|
|
3289
|
+
updated_at?:
|
|
3290
|
+
| RequireOnlyOne<Pick<QueryFilter<ReviewQueueItem['updated_at']>, '$eq' | '$gt' | '$lt' | '$gte' | '$lte'>>
|
|
3291
|
+
| PrimitiveFilter<ReviewQueueItem['updated_at']>;
|
|
3292
|
+
} & {
|
|
3293
|
+
has_image?: boolean;
|
|
3294
|
+
} & {
|
|
3295
|
+
has_text?: boolean;
|
|
3296
|
+
} & {
|
|
3297
|
+
has_video?: boolean;
|
|
3298
|
+
}
|
|
3299
|
+
>;
|
|
3300
|
+
|
|
3301
|
+
export type ReviewQueueSort =
|
|
3302
|
+
| Sort<Pick<ReviewQueueItem, 'id' | 'created_at' | 'updated_at'>>
|
|
3303
|
+
| Array<Sort<Pick<ReviewQueueItem, 'id' | 'created_at' | 'updated_at'>>>;
|
|
3304
|
+
|
|
3305
|
+
export type ReviewQueuePaginationOptions = Pager;
|
|
3306
|
+
|
|
3307
|
+
export type ReviewQueueResponse = {
|
|
3308
|
+
items: ReviewQueueItem[];
|
|
3309
|
+
next?: string;
|
|
3310
|
+
prev?: string;
|
|
3311
|
+
};
|
|
3312
|
+
|
|
3313
|
+
export type ModerationConfig = {};
|
|
3314
|
+
|
|
3315
|
+
export type GetConfigResponse = {
|
|
3316
|
+
config: ModerationConfig;
|
|
3317
|
+
};
|
|
3318
|
+
|
|
3319
|
+
export type UpsertConfigResponse = {
|
|
3320
|
+
config: ModerationConfig;
|
|
3321
|
+
};
|
|
3322
|
+
|
|
3323
|
+
export type ModerationFlagOptions = {
|
|
3324
|
+
custom?: Record<string, unknown>;
|
|
3325
|
+
moderation_payload?: ModerationPayload;
|
|
3326
|
+
user_id?: string;
|
|
3327
|
+
};
|
|
3328
|
+
|
|
3329
|
+
export type ModerationMuteOptions = {
|
|
3330
|
+
timeout?: number;
|
|
3331
|
+
user_id?: string;
|
|
3332
|
+
};
|
|
3333
|
+
export type GetUserModerationReportOptions = {
|
|
3334
|
+
create_user_if_not_exists?: boolean;
|
|
3335
|
+
include_user_blocks?: boolean;
|
|
3336
|
+
include_user_mutes?: boolean;
|
|
3337
|
+
};
|