stream-chat 5.6.0 → 6.2.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.
Files changed (40) hide show
  1. package/README.md +59 -114
  2. package/dist/browser.es.js +464 -366
  3. package/dist/browser.es.js.map +1 -1
  4. package/dist/browser.full-bundle.min.js +1 -1
  5. package/dist/browser.full-bundle.min.js.map +1 -1
  6. package/dist/browser.js +464 -366
  7. package/dist/browser.js.map +1 -1
  8. package/dist/index.es.js +464 -366
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/index.js +464 -366
  11. package/dist/index.js.map +1 -1
  12. package/dist/types/channel.d.ts +124 -124
  13. package/dist/types/channel.d.ts.map +1 -1
  14. package/dist/types/channel_state.d.ts +41 -41
  15. package/dist/types/channel_state.d.ts.map +1 -1
  16. package/dist/types/client.d.ts +190 -163
  17. package/dist/types/client.d.ts.map +1 -1
  18. package/dist/types/client_state.d.ts +6 -6
  19. package/dist/types/client_state.d.ts.map +1 -1
  20. package/dist/types/connection.d.ts +10 -10
  21. package/dist/types/connection.d.ts.map +1 -1
  22. package/dist/types/connection_fallback.d.ts +7 -7
  23. package/dist/types/connection_fallback.d.ts.map +1 -1
  24. package/dist/types/insights.d.ts +2 -2
  25. package/dist/types/token_manager.d.ts +6 -6
  26. package/dist/types/token_manager.d.ts.map +1 -1
  27. package/dist/types/types.d.ts +404 -236
  28. package/dist/types/types.d.ts.map +1 -1
  29. package/dist/types/utils.d.ts +2 -2
  30. package/dist/types/utils.d.ts.map +1 -1
  31. package/package.json +2 -2
  32. package/src/channel.ts +196 -290
  33. package/src/channel_state.ts +54 -219
  34. package/src/client.ts +297 -524
  35. package/src/client_state.ts +6 -6
  36. package/src/connection.ts +7 -22
  37. package/src/connection_fallback.ts +7 -21
  38. package/src/token_manager.ts +6 -6
  39. package/src/types.ts +540 -487
  40. package/src/utils.ts +7 -11
package/src/types.ts CHANGED
@@ -34,6 +34,26 @@ export type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<
34
34
  export type UR = Record<string, unknown>;
35
35
  export type UnknownType = UR; //alias to avoid breaking change
36
36
 
37
+ export type DefaultGenerics = {
38
+ attachmentType: UR;
39
+ channelType: UR;
40
+ commandType: LiteralStringForUnion;
41
+ eventType: UR;
42
+ messageType: UR;
43
+ reactionType: UR;
44
+ userType: UR;
45
+ };
46
+
47
+ export type ExtendableGenerics = {
48
+ attachmentType: UR;
49
+ channelType: UR;
50
+ commandType: string;
51
+ eventType: UR;
52
+ messageType: UR;
53
+ reactionType: UR;
54
+ userType: UR;
55
+ };
56
+
37
57
  export type Unpacked<T> = T extends (infer U)[]
38
58
  ? U // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
59
  : T extends (...args: any[]) => infer U
@@ -50,7 +70,7 @@ export type APIResponse = {
50
70
  duration: string;
51
71
  };
52
72
 
53
- export type AppSettingsAPIResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
73
+ export type AppSettingsAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
54
74
  app?: {
55
75
  channel_configs: Record<
56
76
  string,
@@ -58,7 +78,7 @@ export type AppSettingsAPIResponse<CommandType extends string = LiteralStringFor
58
78
  automod?: ChannelConfigAutomod;
59
79
  automod_behavior?: ChannelConfigAutomodBehavior;
60
80
  blocklist_behavior?: ChannelConfigAutomodBehavior;
61
- commands?: CommandVariants<CommandType>[];
81
+ commands?: CommandVariants<StreamChatGenerics>[];
62
82
  connect_events?: boolean;
63
83
  created_at?: string;
64
84
  custom_events?: boolean;
@@ -127,79 +147,72 @@ export type ModerationResult = {
127
147
  moderated_by?: string;
128
148
  };
129
149
 
130
- export type MessageFlagsResponse<
131
- ChannelType extends UR = UR,
132
- CommandType extends string = LiteralStringForUnion,
133
- UserType extends UR = UR,
134
- AttachmentType = UR,
135
- MessageType = UR,
136
- ReactionType = UR
137
- > = APIResponse & {
150
+ export type AutomodDetails = {
151
+ action?: string;
152
+ image_labels?: Array<string>;
153
+ original_message_type?: string;
154
+ result?: ModerationResult;
155
+ };
156
+
157
+ export type FlagDetails = {
158
+ automod?: AutomodDetails;
159
+ };
160
+
161
+ export type Flag<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
162
+ created_at: string;
163
+ created_by_automod: boolean;
164
+ updated_at: string;
165
+ details?: FlagDetails;
166
+ target_message?: MessageResponse<StreamChatGenerics>;
167
+ target_user?: UserResponse<StreamChatGenerics>;
168
+ user?: UserResponse<StreamChatGenerics>;
169
+ };
170
+
171
+ export type FlagsResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
172
+ flags?: Array<Flag<StreamChatGenerics>>;
173
+ };
174
+
175
+ export type MessageFlagsResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
138
176
  flags?: Array<{
139
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
140
- user: UserResponse<UserType>;
177
+ message: MessageResponse<StreamChatGenerics>;
178
+ user: UserResponse<StreamChatGenerics>;
141
179
  approved_at?: string;
142
180
  created_at?: string;
143
181
  created_by_automod?: boolean;
144
182
  moderation_result?: ModerationResult;
145
183
  rejected_at?: string;
146
184
  reviewed_at?: string;
147
- reviewed_by?: UserResponse<UserType>;
185
+ reviewed_by?: UserResponse<StreamChatGenerics>;
148
186
  updated_at?: string;
149
187
  }>;
150
188
  };
151
189
 
152
- export type FlagReport<
153
- ChannelType extends UR = UR,
154
- CommandType extends string = LiteralStringForUnion,
155
- UserType extends UR = UR,
156
- AttachmentType = UR,
157
- MessageType = UR,
158
- ReactionType = UR
159
- > = {
190
+ export type FlagReport<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
160
191
  flags_count: number;
161
192
  id: string;
162
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
163
- user: UserResponse<UserType>;
193
+ message: MessageResponse<StreamChatGenerics>;
194
+ user: UserResponse<StreamChatGenerics>;
164
195
  created_at?: string;
165
- details?: Object;
196
+ details?: FlagDetails;
166
197
  review_result?: string;
167
198
  reviewed_at?: string;
168
- reviewed_by?: UserResponse<UserType>;
199
+ reviewed_by?: UserResponse<StreamChatGenerics>;
169
200
  updated_at?: string;
170
201
  };
171
202
 
172
- export type FlagReportsResponse<
173
- ChannelType extends UR = UR,
174
- CommandType extends string = LiteralStringForUnion,
175
- UserType extends UR = UR,
176
- AttachmentType = UR,
177
- MessageType = UR,
178
- ReactionType = UR
179
- > = APIResponse & {
180
- flag_reports: Array<FlagReport<ChannelType, CommandType, UserType, AttachmentType, MessageType, ReactionType>>;
203
+ export type FlagReportsResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
204
+ flag_reports: Array<FlagReport<StreamChatGenerics>>;
181
205
  };
182
206
 
183
- export type ReviewFlagReportResponse<
184
- ChannelType extends UR = UR,
185
- CommandType extends string = LiteralStringForUnion,
186
- UserType extends UR = UR,
187
- AttachmentType = UR,
188
- MessageType = UR,
189
- ReactionType = UR
190
- > = APIResponse & {
191
- flag_report: FlagReport<ChannelType, CommandType, UserType, AttachmentType, MessageType, ReactionType>;
207
+ export type ReviewFlagReportResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
208
+ flag_report: FlagReport<StreamChatGenerics>;
192
209
  };
193
210
 
194
- export type BannedUsersResponse<
195
- ChannelType extends UR = UR,
196
- CommandType extends string = LiteralStringForUnion,
197
- UserType extends UR = UR
198
- > = APIResponse & {
211
+ export type BannedUsersResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
199
212
  bans?: Array<{
200
- user: UserResponse<UserType>;
201
- banned_by?: UserResponse<UserType>;
202
- channel?: ChannelResponse<ChannelType, CommandType, UserType>;
213
+ user: UserResponse<StreamChatGenerics>;
214
+ banned_by?: UserResponse<StreamChatGenerics>;
215
+ channel?: ChannelResponse<StreamChatGenerics>;
203
216
  expires?: string;
204
217
  ip_ban?: boolean;
205
218
  reason?: string;
@@ -213,10 +226,8 @@ export type BlockListResponse = BlockList & {
213
226
  };
214
227
 
215
228
  export type ChannelResponse<
216
- ChannelType = UR,
217
- CommandType extends string = LiteralStringForUnion,
218
- UserType = UR
219
- > = ChannelType & {
229
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
230
+ > = StreamChatGenerics['channelType'] & {
220
231
  cid: string;
221
232
  disabled: boolean;
222
233
  frozen: boolean;
@@ -224,17 +235,17 @@ export type ChannelResponse<
224
235
  type: string;
225
236
  auto_translation_enabled?: boolean;
226
237
  auto_translation_language?: TranslationLanguages | '';
227
- config?: ChannelConfigWithInfo<CommandType>;
238
+ config?: ChannelConfigWithInfo<StreamChatGenerics>;
228
239
  cooldown?: number;
229
240
  created_at?: string;
230
- created_by?: UserResponse<UserType> | null;
241
+ created_by?: UserResponse<StreamChatGenerics> | null;
231
242
  created_by_id?: string;
232
243
  deleted_at?: string;
233
244
  hidden?: boolean;
234
245
  invites?: string[];
235
246
  last_message_at?: string;
236
247
  member_count?: number;
237
- members?: ChannelMemberResponse<UserType>[];
248
+ members?: ChannelMemberResponse<StreamChatGenerics>[];
238
249
  muted?: boolean;
239
250
  name?: string;
240
251
  own_capabilities?: string[];
@@ -243,23 +254,16 @@ export type ChannelResponse<
243
254
  updated_at?: string;
244
255
  };
245
256
 
246
- export type ChannelAPIResponse<
247
- AttachmentType = UR,
248
- ChannelType = UR,
249
- CommandType extends string = LiteralStringForUnion,
250
- MessageType = UR,
251
- ReactionType = UR,
252
- UserType = UR
253
- > = APIResponse & {
254
- channel: ChannelResponse<ChannelType, CommandType, UserType>;
255
- members: ChannelMemberResponse<UserType>[];
256
- messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
257
- pinned_messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
257
+ export type ChannelAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
258
+ channel: ChannelResponse<StreamChatGenerics>;
259
+ members: ChannelMemberResponse<StreamChatGenerics>[];
260
+ messages: MessageResponse<StreamChatGenerics>[];
261
+ pinned_messages: MessageResponse<StreamChatGenerics>[];
258
262
  hidden?: boolean;
259
- membership?: ChannelMembership<UserType> | null;
260
- read?: ReadResponse<UserType>[];
263
+ membership?: ChannelMembership<StreamChatGenerics> | null;
264
+ read?: ReadResponse<StreamChatGenerics>[];
261
265
  watcher_count?: number;
262
- watchers?: UserResponse<UserType>[];
266
+ watchers?: UserResponse<StreamChatGenerics>[];
263
267
  };
264
268
 
265
269
  export type ChannelUpdateOptions = {
@@ -267,11 +271,11 @@ export type ChannelUpdateOptions = {
267
271
  skip_push?: boolean;
268
272
  };
269
273
 
270
- export type ChannelMemberAPIResponse<UserType = UR> = APIResponse & {
271
- members: ChannelMemberResponse<UserType>[];
274
+ export type ChannelMemberAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
275
+ members: ChannelMemberResponse<StreamChatGenerics>[];
272
276
  };
273
277
 
274
- export type ChannelMemberResponse<UserType = UR> = {
278
+ export type ChannelMemberResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
275
279
  banned?: boolean;
276
280
  channel_role?: Role;
277
281
  created_at?: string;
@@ -282,7 +286,7 @@ export type ChannelMemberResponse<UserType = UR> = {
282
286
  role?: string;
283
287
  shadow_banned?: boolean;
284
288
  updated_at?: string;
285
- user?: UserResponse<UserType>;
289
+ user?: UserResponse<StreamChatGenerics>;
286
290
  user_id?: string;
287
291
  };
288
292
 
@@ -306,52 +310,40 @@ export type CheckSQSResponse = APIResponse & {
306
310
  error?: string;
307
311
  };
308
312
 
309
- export type CommandResponse<CommandType extends string = LiteralStringForUnion> = Partial<CreatedAtUpdatedAt> & {
313
+ export type CommandResponse<
314
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
315
+ > = Partial<CreatedAtUpdatedAt> & {
310
316
  args?: string;
311
317
  description?: string;
312
- name?: CommandVariants<CommandType>;
313
- set?: CommandVariants<CommandType>;
318
+ name?: CommandVariants<StreamChatGenerics>;
319
+ set?: CommandVariants<StreamChatGenerics>;
314
320
  };
315
321
 
316
322
  export type ConnectAPIResponse<
317
- ChannelType extends UR = UR,
318
- CommandType extends string = LiteralStringForUnion,
319
- UserType extends UR = UR
320
- > = Promise<void | ConnectionOpen<ChannelType, CommandType, UserType>>;
323
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
324
+ > = Promise<void | ConnectionOpen<StreamChatGenerics>>;
321
325
 
322
- export type CreateChannelResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
323
- Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id'> & {
326
+ export type CreateChannelResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse &
327
+ Omit<CreateChannelOptions<StreamChatGenerics>, 'client_id' | 'connection_id'> & {
324
328
  created_at: string;
325
329
  updated_at: string;
326
330
  grants?: Record<string, string[]>;
327
331
  };
328
332
 
329
- export type CreateCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
330
- command: CreateCommandOptions<CommandType> & CreatedAtUpdatedAt;
333
+ export type CreateCommandResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
334
+ command: CreateCommandOptions<StreamChatGenerics> & CreatedAtUpdatedAt;
331
335
  };
332
336
 
333
- export type DeleteChannelAPIResponse<
334
- ChannelType = UR,
335
- CommandType extends string = LiteralStringForUnion,
336
- UserType = UR
337
- > = APIResponse & {
338
- channel: ChannelResponse<ChannelType, CommandType, UserType>;
337
+ export type DeleteChannelAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
338
+ channel: ChannelResponse<StreamChatGenerics>;
339
339
  };
340
340
 
341
- export type DeleteCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
342
- name?: CommandVariants<CommandType>;
341
+ export type DeleteCommandResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
342
+ name?: CommandVariants<StreamChatGenerics>;
343
343
  };
344
344
 
345
- export type EventAPIResponse<
346
- AttachmentType extends UR = UR,
347
- ChannelType extends UR = UR,
348
- CommandType extends string = LiteralStringForUnion,
349
- EventType extends UR = UR,
350
- MessageType extends UR = UR,
351
- ReactionType extends UR = UR,
352
- UserType extends UR = UR
353
- > = APIResponse & {
354
- event: Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>;
345
+ export type EventAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
346
+ event: Event<StreamChatGenerics>;
355
347
  };
356
348
 
357
349
  export type ExportChannelResponse = {
@@ -369,13 +361,13 @@ export type ExportChannelStatusResponse = {
369
361
  updated_at?: string;
370
362
  };
371
363
 
372
- export type FlagMessageResponse<UserType = UR> = APIResponse & {
364
+ export type FlagMessageResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
373
365
  flag: {
374
366
  created_at: string;
375
367
  created_by_automod: boolean;
376
368
  target_message_id: string;
377
369
  updated_at: string;
378
- user: UserResponse<UserType>;
370
+ user: UserResponse<StreamChatGenerics>;
379
371
  approved_at?: string;
380
372
  channel_cid?: string;
381
373
  details?: Object; // Any JSON
@@ -386,13 +378,13 @@ export type FlagMessageResponse<UserType = UR> = APIResponse & {
386
378
  };
387
379
  };
388
380
 
389
- export type FlagUserResponse<UserType = UR> = APIResponse & {
381
+ export type FlagUserResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
390
382
  flag: {
391
383
  created_at: string;
392
384
  created_by_automod: boolean;
393
- target_user: UserResponse<UserType>;
385
+ target_user: UserResponse<StreamChatGenerics>;
394
386
  updated_at: string;
395
- user: UserResponse<UserType>;
387
+ user: UserResponse<StreamChatGenerics>;
396
388
  approved_at?: string;
397
389
  details?: Object; // Any JSON
398
390
  rejected_at?: string;
@@ -401,45 +393,41 @@ export type FlagUserResponse<UserType = UR> = APIResponse & {
401
393
  };
402
394
  };
403
395
 
404
- export type FormatMessageResponse<
405
- AttachmentType = UR,
406
- ChannelType = UR,
407
- CommandType extends string = LiteralStringForUnion,
408
- MessageType = UR,
409
- ReactionType = UR,
410
- UserType = UR
411
- > = Omit<
412
- MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>,
396
+ export type FormatMessageResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Omit<
397
+ MessageResponse<{
398
+ attachmentType: StreamChatGenerics['attachmentType'];
399
+ channelType: StreamChatGenerics['channelType'];
400
+ commandType: StreamChatGenerics['commandType'];
401
+ eventType: StreamChatGenerics['eventType'];
402
+ messageType: {};
403
+ reactionType: StreamChatGenerics['reactionType'];
404
+ userType: StreamChatGenerics['userType'];
405
+ }>,
413
406
  'created_at' | 'pinned_at' | 'updated_at' | 'status'
414
407
  > &
415
- MessageType & {
408
+ StreamChatGenerics['messageType'] & {
416
409
  created_at: Date;
417
410
  pinned_at: Date | null;
418
411
  status: string;
419
412
  updated_at: Date;
420
413
  };
421
414
 
422
- export type GetChannelTypeResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
423
- Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id' | 'commands'> & {
415
+ export type GetChannelTypeResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse &
416
+ Omit<CreateChannelOptions<StreamChatGenerics>, 'client_id' | 'connection_id' | 'commands'> & {
424
417
  created_at: string;
425
418
  updated_at: string;
426
- commands?: CommandResponse<CommandType>[];
419
+ commands?: CommandResponse<StreamChatGenerics>[];
427
420
  grants?: Record<string, string[]>;
428
421
  };
429
422
 
430
- export type GetCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
431
- CreateCommandOptions<CommandType> &
423
+ export type GetCommandResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse &
424
+ CreateCommandOptions<StreamChatGenerics> &
432
425
  CreatedAtUpdatedAt;
433
426
 
434
427
  export type GetMultipleMessagesAPIResponse<
435
- AttachmentType = UR,
436
- ChannelType = UR,
437
- CommandType extends string = LiteralStringForUnion,
438
- MessageType = UR,
439
- ReactionType = UR,
440
- UserType = UR
428
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
441
429
  > = APIResponse & {
442
- messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
430
+ messages: MessageResponse<StreamChatGenerics>[];
443
431
  };
444
432
 
445
433
  export type GetRateLimitsResponse = APIResponse & {
@@ -449,26 +437,19 @@ export type GetRateLimitsResponse = APIResponse & {
449
437
  web?: RateLimitsMap;
450
438
  };
451
439
 
452
- export type GetReactionsAPIResponse<ReactionType = UR, UserType = UR> = APIResponse & {
453
- reactions: ReactionResponse<ReactionType, UserType>[];
440
+ export type GetReactionsAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
441
+ reactions: ReactionResponse<StreamChatGenerics>[];
454
442
  };
455
443
 
456
- export type GetRepliesAPIResponse<
457
- AttachmentType = UR,
458
- ChannelType = UR,
459
- CommandType extends string = LiteralStringForUnion,
460
- MessageType = UR,
461
- ReactionType = UR,
462
- UserType = UR
463
- > = APIResponse & {
464
- messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
444
+ export type GetRepliesAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
445
+ messages: MessageResponse<StreamChatGenerics>[];
465
446
  };
466
447
 
467
- export type ListChannelResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
448
+ export type ListChannelResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
468
449
  channel_types: Record<
469
450
  string,
470
- Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id' | 'commands'> & {
471
- commands: CommandResponse<CommandType>[];
451
+ Omit<CreateChannelOptions<StreamChatGenerics>, 'client_id' | 'connection_id' | 'commands'> & {
452
+ commands: CommandResponse<StreamChatGenerics>[];
472
453
  created_at: string;
473
454
  updated_at: string;
474
455
  grants?: Record<string, string[]>;
@@ -477,45 +458,31 @@ export type ListChannelResponse<CommandType extends string = LiteralStringForUni
477
458
  };
478
459
 
479
460
  export type ListChannelTypesAPIResponse<
480
- CommandType extends string = LiteralStringForUnion
481
- > = ListChannelResponse<CommandType>;
461
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
462
+ > = ListChannelResponse<StreamChatGenerics>;
482
463
 
483
- export type ListCommandsResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
484
- commands: Array<CreateCommandOptions<CommandType> & Partial<CreatedAtUpdatedAt>>;
464
+ export type ListCommandsResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
465
+ commands: Array<CreateCommandOptions<StreamChatGenerics> & Partial<CreatedAtUpdatedAt>>;
485
466
  };
486
467
 
487
- export type MuteChannelAPIResponse<
488
- ChannelType extends UR = UR,
489
- CommandType extends string = LiteralStringForUnion,
490
- UserType extends UR = UR
491
- > = APIResponse & {
492
- channel_mute: ChannelMute<ChannelType, CommandType, UserType>;
493
- own_user: OwnUserResponse<ChannelType, CommandType, UserType>;
494
- channel_mutes?: ChannelMute<ChannelType, CommandType, UserType>[];
495
- mute?: MuteResponse<UserType>;
468
+ export type MuteChannelAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
469
+ channel_mute: ChannelMute<StreamChatGenerics>;
470
+ own_user: OwnUserResponse<StreamChatGenerics>;
471
+ channel_mutes?: ChannelMute<StreamChatGenerics>[];
472
+ mute?: MuteResponse<StreamChatGenerics>;
496
473
  };
497
474
 
498
475
  export type MessageResponse<
499
- AttachmentType = UR,
500
- ChannelType = UR,
501
- CommandType extends string = LiteralStringForUnion,
502
- MessageType = UR,
503
- ReactionType = UR,
504
- UserType = UR
505
- > = MessageResponseBase<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType> & {
506
- quoted_message?: MessageResponseBase<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
476
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
477
+ > = MessageResponseBase<StreamChatGenerics> & {
478
+ quoted_message?: MessageResponseBase<StreamChatGenerics>;
507
479
  };
508
480
 
509
481
  export type MessageResponseBase<
510
- AttachmentType = UR,
511
- ChannelType = UR,
512
- CommandType extends string = LiteralStringForUnion,
513
- MessageType = UR,
514
- ReactionType = UR,
515
- UserType = UR
516
- > = MessageBase<AttachmentType, MessageType, UserType> & {
482
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
483
+ > = MessageBase<StreamChatGenerics> & {
517
484
  args?: string;
518
- channel?: ChannelResponse<ChannelType, CommandType, UserType>;
485
+ channel?: ChannelResponse<StreamChatGenerics>;
519
486
  cid?: string;
520
487
  command?: string;
521
488
  command_info?: { name?: string };
@@ -524,49 +491,41 @@ export type MessageResponseBase<
524
491
  i18n?: RequireAtLeastOne<Record<`${TranslationLanguages}_text`, string>> & {
525
492
  language: TranslationLanguages;
526
493
  };
527
- latest_reactions?: ReactionResponse<ReactionType, UserType>[];
528
- mentioned_users?: UserResponse<UserType>[];
529
- own_reactions?: ReactionResponse<ReactionType, UserType>[] | null;
494
+ latest_reactions?: ReactionResponse<StreamChatGenerics>[];
495
+ mentioned_users?: UserResponse<StreamChatGenerics>[];
496
+ own_reactions?: ReactionResponse<StreamChatGenerics>[] | null;
530
497
  pin_expires?: string | null;
531
498
  pinned_at?: string | null;
532
- pinned_by?: UserResponse<UserType> | null;
499
+ pinned_by?: UserResponse<StreamChatGenerics> | null;
533
500
  reaction_counts?: { [key: string]: number } | null;
534
501
  reaction_scores?: { [key: string]: number } | null;
535
502
  reply_count?: number;
536
503
  shadowed?: boolean;
537
504
  silent?: boolean;
538
505
  status?: string;
539
- thread_participants?: UserResponse<UserType>[];
506
+ thread_participants?: UserResponse<StreamChatGenerics>[];
540
507
  type?: MessageLabel;
541
508
  updated_at?: string;
542
509
  };
543
510
 
544
- export type MuteResponse<UserType = UR> = {
545
- user: UserResponse<UserType>;
511
+ export type MuteResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
512
+ user: UserResponse<StreamChatGenerics>;
546
513
  created_at?: string;
547
514
  expires?: string;
548
- target?: UserResponse<UserType>;
515
+ target?: UserResponse<StreamChatGenerics>;
549
516
  updated_at?: string;
550
517
  };
551
518
 
552
- export type MuteUserResponse<
553
- ChannelType extends UR = UR,
554
- CommandType extends string = LiteralStringForUnion,
555
- UserType extends UR = UR
556
- > = APIResponse & {
557
- mute?: MuteResponse<UserType>;
558
- mutes?: Array<Mute<UserType>>;
559
- own_user?: OwnUserResponse<ChannelType, CommandType, UserType>;
560
- };
561
-
562
- export type OwnUserBase<
563
- ChannelType extends UR = UR,
564
- CommandType extends string = LiteralStringForUnion,
565
- UserType extends UR = UR
566
- > = {
567
- channel_mutes: ChannelMute<ChannelType, CommandType, UserType>[];
568
- devices: Device<UserType>[];
569
- mutes: Mute<UserType>[];
519
+ export type MuteUserResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
520
+ mute?: MuteResponse<StreamChatGenerics>;
521
+ mutes?: Array<Mute<StreamChatGenerics>>;
522
+ own_user?: OwnUserResponse<StreamChatGenerics>;
523
+ };
524
+
525
+ export type OwnUserBase<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
526
+ channel_mutes: ChannelMute<StreamChatGenerics>[];
527
+ devices: Device<StreamChatGenerics>[];
528
+ mutes: Mute<StreamChatGenerics>[];
570
529
  total_unread_count: number;
571
530
  unread_channels: number;
572
531
  unread_count: number;
@@ -575,18 +534,14 @@ export type OwnUserBase<
575
534
  };
576
535
 
577
536
  export type OwnUserResponse<
578
- ChannelType extends UR = UR,
579
- CommandType extends string = LiteralStringForUnion,
580
- UserType extends UR = UR
581
- > = UserResponse<UserType> & OwnUserBase<ChannelType, CommandType, UserType>;
537
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
538
+ > = UserResponse<StreamChatGenerics> & OwnUserBase<StreamChatGenerics>;
582
539
 
583
540
  export type PartialUpdateChannelAPIResponse<
584
- ChannelType = UR,
585
- CommandType extends string = LiteralStringForUnion,
586
- UserType = UR
541
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
587
542
  > = APIResponse & {
588
- channel: ChannelResponse<ChannelType, CommandType, UserType>;
589
- members: ChannelMemberResponse<UserType>[];
543
+ channel: ChannelResponse<StreamChatGenerics>;
544
+ members: ChannelMemberResponse<StreamChatGenerics>[];
590
545
  };
591
546
 
592
547
  export type PermissionAPIResponse = APIResponse & {
@@ -597,39 +552,27 @@ export type PermissionsAPIResponse = APIResponse & {
597
552
  permissions?: PermissionAPIObject[];
598
553
  };
599
554
 
600
- export type ReactionAPIResponse<
601
- AttachmentType = UR,
602
- ChannelType = UR,
603
- CommandType extends string = LiteralStringForUnion,
604
- MessageType = UR,
605
- ReactionType = UR,
606
- UserType = UR
607
- > = APIResponse & {
608
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
609
- reaction: ReactionResponse<ReactionType, UserType>;
555
+ export type ReactionAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
556
+ message: MessageResponse<StreamChatGenerics>;
557
+ reaction: ReactionResponse<StreamChatGenerics>;
610
558
  };
611
559
 
612
- export type ReactionResponse<ReactionType = UR, UserType = UR> = Reaction<ReactionType, UserType> & {
560
+ export type ReactionResponse<
561
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
562
+ > = Reaction<StreamChatGenerics> & {
613
563
  created_at: string;
614
564
  updated_at: string;
615
565
  };
616
566
 
617
- export type ReadResponse<UserType = UR> = {
567
+ export type ReadResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
618
568
  last_read: string;
619
- user: UserResponse<UserType>;
569
+ user: UserResponse<StreamChatGenerics>;
620
570
  unread_messages?: number;
621
571
  };
622
572
 
623
- export type SearchAPIResponse<
624
- AttachmentType = UR,
625
- ChannelType = UR,
626
- CommandType extends string = LiteralStringForUnion,
627
- MessageType = UR,
628
- ReactionType = UR,
629
- UserType = UR
630
- > = APIResponse & {
573
+ export type SearchAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
631
574
  results: {
632
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
575
+ message: MessageResponse<StreamChatGenerics>;
633
576
  }[];
634
577
  next?: string;
635
578
  previous?: string;
@@ -644,75 +587,49 @@ export type SearchWarning = {
644
587
  };
645
588
  export type SendFileAPIResponse = APIResponse & { file: string };
646
589
 
647
- export type SendMessageAPIResponse<
648
- AttachmentType = UR,
649
- ChannelType = UR,
650
- CommandType extends string = LiteralStringForUnion,
651
- MessageType = UR,
652
- ReactionType = UR,
653
- UserType = UR
654
- > = APIResponse & {
655
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
590
+ export type SendMessageAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
591
+ message: MessageResponse<StreamChatGenerics>;
656
592
  };
657
593
 
658
594
  export type TruncateChannelAPIResponse<
659
- ChannelType = UR,
660
- CommandType extends string = LiteralStringForUnion,
661
- UserType = UR,
662
- AttachmentType = UR,
663
- MessageType = UR,
664
- ReactionType = UR
595
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
665
596
  > = APIResponse & {
666
- channel: ChannelResponse<ChannelType, CommandType, UserType>;
667
- message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
597
+ channel: ChannelResponse<StreamChatGenerics>;
598
+ message?: MessageResponse<StreamChatGenerics>;
668
599
  };
669
600
 
670
- export type UpdateChannelAPIResponse<
671
- AttachmentType = UR,
672
- ChannelType = UR,
673
- CommandType extends string = LiteralStringForUnion,
674
- MessageType = UR,
675
- ReactionType = UR,
676
- UserType = UR
677
- > = APIResponse & {
678
- channel: ChannelResponse<ChannelType, CommandType, UserType>;
679
- members: ChannelMemberResponse<UserType>[];
680
- message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
601
+ export type UpdateChannelAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
602
+ channel: ChannelResponse<StreamChatGenerics>;
603
+ members: ChannelMemberResponse<StreamChatGenerics>[];
604
+ message?: MessageResponse<StreamChatGenerics>;
681
605
  };
682
606
 
683
- export type UpdateChannelResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
684
- Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id'> & {
607
+ export type UpdateChannelResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse &
608
+ Omit<CreateChannelOptions<StreamChatGenerics>, 'client_id' | 'connection_id'> & {
685
609
  created_at: string;
686
610
  updated_at: string;
687
611
  };
688
612
 
689
- export type UpdateCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
690
- command: UpdateCommandOptions<CommandType> &
613
+ export type UpdateCommandResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
614
+ command: UpdateCommandOptions<StreamChatGenerics> &
691
615
  CreatedAtUpdatedAt & {
692
- name: CommandVariants<CommandType>;
616
+ name: CommandVariants<StreamChatGenerics>;
693
617
  };
694
618
  };
695
619
 
696
- export type UpdateMessageAPIResponse<
697
- AttachmentType = UR,
698
- ChannelType = UR,
699
- CommandType extends string = LiteralStringForUnion,
700
- MessageType = UR,
701
- ReactionType = UR,
702
- UserType = UR
703
- > = APIResponse & {
704
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
620
+ export type UpdateMessageAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
621
+ message: MessageResponse<StreamChatGenerics>;
705
622
  };
706
623
 
707
- export type UsersAPIResponse<UserType = UR> = APIResponse & {
708
- users: Array<UserResponse<UserType>>;
624
+ export type UsersAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
625
+ users: Array<UserResponse<StreamChatGenerics>>;
709
626
  };
710
627
 
711
- export type UpdateUsersAPIResponse<UserType = UR> = APIResponse & {
712
- users: { [key: string]: UserResponse<UserType> };
628
+ export type UpdateUsersAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
629
+ users: { [key: string]: UserResponse<StreamChatGenerics> };
713
630
  };
714
631
 
715
- export type UserResponse<UserType = UR> = User<UserType> & {
632
+ export type UserResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = User<StreamChatGenerics> & {
716
633
  banned?: boolean;
717
634
  created_at?: string;
718
635
  deactivated_at?: string;
@@ -740,6 +657,11 @@ export type MessageFlagsPaginationOptions = {
740
657
  offset?: number;
741
658
  };
742
659
 
660
+ export type FlagsPaginationOptions = {
661
+ limit?: number;
662
+ offset?: number;
663
+ };
664
+
743
665
  export type FlagReportsPaginationOptions = {
744
666
  limit?: number;
745
667
  offset?: number;
@@ -752,8 +674,8 @@ export type ReviewFlagReportOptions = {
752
674
 
753
675
  export type BannedUsersPaginationOptions = Omit<PaginationOptions, 'id_gt' | 'id_gte' | 'id_lt' | 'id_lte'>;
754
676
 
755
- export type BanUserOptions<UserType = UR> = UnBanUserOptions & {
756
- banned_by?: UserResponse<UserType>;
677
+ export type BanUserOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = UnBanUserOptions & {
678
+ banned_by?: UserResponse<StreamChatGenerics>;
757
679
  banned_by_id?: string;
758
680
  ip_ban?: boolean;
759
681
  reason?: string;
@@ -771,10 +693,10 @@ export type ChannelOptions = {
771
693
  watch?: boolean;
772
694
  };
773
695
 
774
- export type ChannelQueryOptions<ChannelType = UR, CommandType extends string = LiteralStringForUnion, UserType = UR> = {
696
+ export type ChannelQueryOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
775
697
  client_id?: string;
776
698
  connection_id?: string;
777
- data?: ChannelResponse<ChannelType, CommandType, UserType>;
699
+ data?: ChannelResponse<StreamChatGenerics>;
778
700
  members?: PaginationOptions;
779
701
  messages?: MessagePaginationOptions;
780
702
  presence?: boolean;
@@ -787,14 +709,14 @@ export type ChannelStateOptions = {
787
709
  skipInitialization?: string[];
788
710
  };
789
711
 
790
- export type CreateChannelOptions<CommandType extends string = LiteralStringForUnion> = {
712
+ export type CreateChannelOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
791
713
  automod?: ChannelConfigAutomod;
792
714
  automod_behavior?: ChannelConfigAutomodBehavior;
793
715
  automod_thresholds?: ChannelConfigAutomodThresholds;
794
716
  blocklist?: string;
795
717
  blocklist_behavior?: ChannelConfigAutomodBehavior;
796
718
  client_id?: string;
797
- commands?: CommandVariants<CommandType>[];
719
+ commands?: CommandVariants<StreamChatGenerics>[];
798
720
  connect_events?: boolean;
799
721
  connection_id?: string;
800
722
  custom_events?: boolean;
@@ -815,11 +737,11 @@ export type CreateChannelOptions<CommandType extends string = LiteralStringForUn
815
737
  url_enrichment?: boolean;
816
738
  };
817
739
 
818
- export type CreateCommandOptions<CommandType extends string = LiteralStringForUnion> = {
740
+ export type CreateCommandOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
819
741
  description: string;
820
- name: CommandVariants<CommandType>;
742
+ name: CommandVariants<StreamChatGenerics>;
821
743
  args?: string;
822
- set?: CommandVariants<CommandType>;
744
+ set?: CommandVariants<StreamChatGenerics>;
823
745
  };
824
746
 
825
747
  export type CustomPermissionOptions = {
@@ -833,49 +755,44 @@ export type CustomPermissionOptions = {
833
755
  };
834
756
 
835
757
  // TODO: rename to UpdateChannelOptions in the next major update and use it in channel._update and/or channel.update
836
- export type InviteOptions<
837
- AttachmentType = UR,
838
- ChannelType = UR,
839
- CommandType extends string = LiteralStringForUnion,
840
- MessageType = UR,
841
- ReactionType = UR,
842
- UserType = UR
843
- > = {
758
+ export type InviteOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
844
759
  accept_invite?: boolean;
845
760
  add_members?: string[];
846
761
  add_moderators?: string[];
847
762
  client_id?: string;
848
763
  connection_id?: string;
849
- data?: Omit<ChannelResponse<ChannelType, CommandType, UserType>, 'id' | 'cid'>;
764
+ data?: Omit<ChannelResponse<StreamChatGenerics>, 'id' | 'cid'>;
850
765
  demote_moderators?: string[];
851
766
  invites?: string[];
852
- message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
767
+ message?: MessageResponse<StreamChatGenerics>;
853
768
  reject_invite?: boolean;
854
769
  remove_members?: string[];
855
- user?: UserResponse<UserType>;
770
+ user?: UserResponse<StreamChatGenerics>;
856
771
  user_id?: string;
857
772
  };
858
773
 
859
774
  /** @deprecated use MarkChannelsReadOptions instead */
860
- export type MarkAllReadOptions<UserType = UR> = MarkChannelsReadOptions<UserType>;
775
+ export type MarkAllReadOptions<
776
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
777
+ > = MarkChannelsReadOptions<StreamChatGenerics>;
861
778
 
862
- export type MarkChannelsReadOptions<UserType = UR> = {
779
+ export type MarkChannelsReadOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
863
780
  client_id?: string;
864
781
  connection_id?: string;
865
782
  read_by_channel?: Record<string, string>;
866
- user?: UserResponse<UserType>;
783
+ user?: UserResponse<StreamChatGenerics>;
867
784
  user_id?: string;
868
785
  };
869
786
 
870
- export type MarkReadOptions<UserType = UR> = {
787
+ export type MarkReadOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
871
788
  client_id?: string;
872
789
  connection_id?: string;
873
790
  message_id?: string;
874
- user?: UserResponse<UserType>;
791
+ user?: UserResponse<StreamChatGenerics>;
875
792
  user_id?: string;
876
793
  };
877
794
 
878
- export type MuteUserOptions<UserType = UR> = {
795
+ export type MuteUserOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
879
796
  client_id?: string;
880
797
  connection_id?: string;
881
798
  id?: string;
@@ -883,7 +800,7 @@ export type MuteUserOptions<UserType = UR> = {
883
800
  target_user_id?: string;
884
801
  timeout?: number;
885
802
  type?: string;
886
- user?: UserResponse<UserType>;
803
+ user?: UserResponse<StreamChatGenerics>;
887
804
  user_id?: string;
888
805
  };
889
806
 
@@ -929,11 +846,11 @@ export type QueryMembersOptions = {
929
846
  user_id_lte?: string;
930
847
  };
931
848
 
932
- export type SearchOptions<MessageType = UR> = {
849
+ export type SearchOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
933
850
  limit?: number;
934
851
  next?: string;
935
852
  offset?: number;
936
- sort?: SearchMessageSort<MessageType>;
853
+ sort?: SearchMessageSort<StreamChatGenerics>;
937
854
  };
938
855
 
939
856
  export type StreamChatOptions = AxiosRequestConfig & {
@@ -975,18 +892,18 @@ export type UnBanUserOptions = {
975
892
  };
976
893
 
977
894
  // TODO: rename to UpdateChannelTypeOptions in the next major update
978
- export type UpdateChannelOptions<CommandType extends string = LiteralStringForUnion> = Omit<
979
- CreateChannelOptions<CommandType>,
895
+ export type UpdateChannelOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Omit<
896
+ CreateChannelOptions<StreamChatGenerics>,
980
897
  'name'
981
898
  > & {
982
899
  created_at?: string;
983
900
  updated_at?: string;
984
901
  };
985
902
 
986
- export type UpdateCommandOptions<CommandType extends string = LiteralStringForUnion> = {
903
+ export type UpdateCommandOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
987
904
  description: string;
988
905
  args?: string;
989
- set?: CommandVariants<CommandType>;
906
+ set?: CommandVariants<StreamChatGenerics>;
990
907
  };
991
908
 
992
909
  export type UserOptions = {
@@ -1004,17 +921,9 @@ export type ConnectionChangeEvent = {
1004
921
  online?: boolean;
1005
922
  };
1006
923
 
1007
- export type Event<
1008
- AttachmentType extends UR = UR,
1009
- ChannelType extends UR = UR,
1010
- CommandType extends string = LiteralStringForUnion,
1011
- EventType extends UR = UR,
1012
- MessageType extends UR = UR,
1013
- ReactionType extends UR = UR,
1014
- UserType extends UR = UR
1015
- > = EventType & {
924
+ export type Event<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = StreamChatGenerics['eventType'] & {
1016
925
  type: EventTypes;
1017
- channel?: ChannelResponse<ChannelType, CommandType, UserType>;
926
+ channel?: ChannelResponse<StreamChatGenerics>;
1018
927
  channel_id?: string;
1019
928
  channel_type?: string;
1020
929
  cid?: string;
@@ -1023,35 +932,31 @@ export type Event<
1023
932
  created_at?: string;
1024
933
  hard_delete?: boolean;
1025
934
  mark_messages_deleted?: boolean;
1026
- me?: OwnUserResponse<ChannelType, CommandType, UserType>;
1027
- member?: ChannelMemberResponse<UserType>;
1028
- message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
935
+ me?: OwnUserResponse<StreamChatGenerics>;
936
+ member?: ChannelMemberResponse<StreamChatGenerics>;
937
+ message?: MessageResponse<StreamChatGenerics>;
1029
938
  online?: boolean;
1030
939
  parent_id?: string;
1031
- reaction?: ReactionResponse<ReactionType, UserType>;
940
+ reaction?: ReactionResponse<StreamChatGenerics>;
1032
941
  received_at?: string | Date;
1033
942
  team?: string;
1034
943
  total_unread_count?: number;
1035
944
  unread_channels?: number;
1036
945
  unread_count?: number;
1037
- user?: UserResponse<UserType>;
946
+ user?: UserResponse<StreamChatGenerics>;
1038
947
  user_id?: string;
1039
948
  watcher_count?: number;
1040
949
  };
1041
950
 
1042
- export type UserCustomEvent<EventType extends UR = UR> = EventType & {
951
+ export type UserCustomEvent<
952
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
953
+ > = StreamChatGenerics['eventType'] & {
1043
954
  type: string;
1044
955
  };
1045
956
 
1046
- export type EventHandler<
1047
- AttachmentType extends UR = UR,
1048
- ChannelType extends UR = UR,
1049
- CommandType extends string = LiteralStringForUnion,
1050
- EventType extends UR = UR,
1051
- MessageType extends UR = UR,
1052
- ReactionType extends UR = UR,
1053
- UserType extends UR = UR
1054
- > = (event: Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>) => void;
957
+ export type EventHandler<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = (
958
+ event: Event<StreamChatGenerics>,
959
+ ) => void;
1055
960
 
1056
961
  export type EventTypes = 'all' | keyof typeof EVENT_MAP;
1057
962
 
@@ -1088,10 +993,48 @@ export type MessageFlagsFilters = QueryFilters<
1088
993
  }
1089
994
  >;
1090
995
 
996
+ export type FlagsFiltersOptions = {
997
+ channel_cid?: string;
998
+ message_id?: string;
999
+ message_user_id?: string;
1000
+ reporter_id?: string;
1001
+ team?: string;
1002
+ user_id?: string;
1003
+ };
1004
+
1005
+ export type FlagsFilters = QueryFilters<
1006
+ {
1007
+ user_id?:
1008
+ | RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['user_id']>, '$eq' | '$in'>>
1009
+ | PrimitiveFilter<FlagsFiltersOptions['user_id']>;
1010
+ } & {
1011
+ message_id?:
1012
+ | RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['message_id']>, '$eq' | '$in'>>
1013
+ | PrimitiveFilter<FlagsFiltersOptions['message_id']>;
1014
+ } & {
1015
+ message_user_id?:
1016
+ | RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['message_user_id']>, '$eq' | '$in'>>
1017
+ | PrimitiveFilter<FlagsFiltersOptions['message_user_id']>;
1018
+ } & {
1019
+ channel_cid?:
1020
+ | RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['channel_cid']>, '$eq' | '$in'>>
1021
+ | PrimitiveFilter<FlagsFiltersOptions['channel_cid']>;
1022
+ } & {
1023
+ reporter_id?:
1024
+ | RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['reporter_id']>, '$eq' | '$in'>>
1025
+ | PrimitiveFilter<FlagsFiltersOptions['reporter_id']>;
1026
+ } & {
1027
+ team?:
1028
+ | RequireOnlyOne<Pick<QueryFilter<FlagsFiltersOptions['team']>, '$eq' | '$in'>>
1029
+ | PrimitiveFilter<FlagsFiltersOptions['team']>;
1030
+ }
1031
+ >;
1032
+
1091
1033
  export type FlagReportsFiltersOptions = {
1092
1034
  channel_cid?: string;
1093
1035
  is_reviewed?: boolean;
1094
1036
  message_id?: string;
1037
+ message_user_id?: string;
1095
1038
  report_id?: string;
1096
1039
  review_result?: string;
1097
1040
  reviewed_by?: string;
@@ -1120,6 +1063,10 @@ export type FlagReportsFilters = QueryFilters<
1120
1063
  message_id?:
1121
1064
  | RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['message_id']>, '$eq' | '$in'>>
1122
1065
  | PrimitiveFilter<FlagReportsFiltersOptions['message_id']>;
1066
+ } & {
1067
+ message_user_id?:
1068
+ | RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['message_user_id']>, '$eq' | '$in'>>
1069
+ | PrimitiveFilter<FlagReportsFiltersOptions['message_user_id']>;
1123
1070
  } & {
1124
1071
  channel_cid?:
1125
1072
  | RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['channel_cid']>, '$eq' | '$in'>>
@@ -1135,6 +1082,7 @@ export type FlagReportsFilters = QueryFilters<
1135
1082
  >]: RequireOnlyOne<QueryFilter<FlagReportsFiltersOptions[Key]>> | PrimitiveFilter<FlagReportsFiltersOptions[Key]>;
1136
1083
  }
1137
1084
  >;
1085
+
1138
1086
  export type BannedUsersFilterOptions = {
1139
1087
  banned_by_id?: string;
1140
1088
  channel_cid?: string;
@@ -1163,12 +1111,8 @@ export type BannedUsersFilters = QueryFilters<
1163
1111
  }
1164
1112
  >;
1165
1113
 
1166
- export type ChannelFilters<
1167
- ChannelType = UR,
1168
- CommandType extends string = LiteralStringForUnion,
1169
- UserType = UR
1170
- > = QueryFilters<
1171
- ContainsOperator<ChannelType> & {
1114
+ export type ChannelFilters<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = QueryFilters<
1115
+ ContainsOperator<StreamChatGenerics['channelType']> & {
1172
1116
  members?:
1173
1117
  | RequireOnlyOne<Pick<QueryFilter<string>, '$in' | '$nin'>>
1174
1118
  | RequireOnlyOne<Pick<QueryFilter<string[]>, '$eq'>>
@@ -1177,14 +1121,47 @@ export type ChannelFilters<
1177
1121
  name?:
1178
1122
  | RequireOnlyOne<
1179
1123
  {
1180
- $autocomplete?: ChannelResponse<ChannelType, CommandType, UserType>['name'];
1181
- } & QueryFilter<ChannelResponse<ChannelType, CommandType, UserType>['name']>
1124
+ $autocomplete?: ChannelResponse<StreamChatGenerics>['name'];
1125
+ } & QueryFilter<ChannelResponse<StreamChatGenerics>['name']>
1182
1126
  >
1183
- | PrimitiveFilter<ChannelResponse<ChannelType, CommandType, UserType>['name']>;
1127
+ | PrimitiveFilter<ChannelResponse<StreamChatGenerics>['name']>;
1184
1128
  } & {
1185
- [Key in keyof Omit<ChannelResponse<{}, CommandType, UserType>, 'name' | 'members'>]:
1186
- | RequireOnlyOne<QueryFilter<ChannelResponse<{}, CommandType, UserType>[Key]>>
1187
- | PrimitiveFilter<ChannelResponse<{}, CommandType, UserType>[Key]>;
1129
+ [Key in keyof Omit<
1130
+ ChannelResponse<{
1131
+ attachmentType: StreamChatGenerics['attachmentType'];
1132
+ channelType: {};
1133
+ commandType: StreamChatGenerics['commandType'];
1134
+ eventType: StreamChatGenerics['eventType'];
1135
+ messageType: StreamChatGenerics['messageType'];
1136
+ reactionType: StreamChatGenerics['reactionType'];
1137
+ userType: StreamChatGenerics['userType'];
1138
+ }>,
1139
+ 'name' | 'members'
1140
+ >]:
1141
+ | RequireOnlyOne<
1142
+ QueryFilter<
1143
+ ChannelResponse<{
1144
+ attachmentType: StreamChatGenerics['attachmentType'];
1145
+ channelType: {};
1146
+ commandType: StreamChatGenerics['commandType'];
1147
+ eventType: StreamChatGenerics['eventType'];
1148
+ messageType: StreamChatGenerics['messageType'];
1149
+ reactionType: StreamChatGenerics['reactionType'];
1150
+ userType: StreamChatGenerics['userType'];
1151
+ }>[Key]
1152
+ >
1153
+ >
1154
+ | PrimitiveFilter<
1155
+ ChannelResponse<{
1156
+ attachmentType: StreamChatGenerics['attachmentType'];
1157
+ channelType: {};
1158
+ commandType: StreamChatGenerics['commandType'];
1159
+ eventType: StreamChatGenerics['eventType'];
1160
+ messageType: StreamChatGenerics['messageType'];
1161
+ reactionType: StreamChatGenerics['reactionType'];
1162
+ userType: StreamChatGenerics['userType'];
1163
+ }>[Key]
1164
+ >;
1188
1165
  }
1189
1166
  >;
1190
1167
 
@@ -1202,43 +1179,53 @@ export type ContainsOperator<CustomType = {}> = {
1202
1179
  : RequireOnlyOne<QueryFilter<CustomType[Key]>> | PrimitiveFilter<CustomType[Key]>;
1203
1180
  };
1204
1181
 
1205
- export type MessageFilters<
1206
- AttachmentType = UR,
1207
- ChannelType = UR,
1208
- CommandType extends string = LiteralStringForUnion,
1209
- MessageType = UR,
1210
- ReactionType = UR,
1211
- UserType = UR
1212
- > = QueryFilters<
1213
- ContainsOperator<MessageType> & {
1182
+ export type MessageFilters<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = QueryFilters<
1183
+ ContainsOperator<StreamChatGenerics['messageType']> & {
1214
1184
  text?:
1215
1185
  | RequireOnlyOne<
1216
1186
  {
1217
- $autocomplete?: MessageResponse<
1218
- AttachmentType,
1219
- ChannelType,
1220
- CommandType,
1221
- MessageType,
1222
- ReactionType,
1223
- UserType
1224
- >['text'];
1225
- $q?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>['text'];
1226
- } & QueryFilter<
1227
- MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>['text']
1228
- >
1187
+ $autocomplete?: MessageResponse<StreamChatGenerics>['text'];
1188
+ $q?: MessageResponse<StreamChatGenerics>['text'];
1189
+ } & QueryFilter<MessageResponse<StreamChatGenerics>['text']>
1229
1190
  >
1230
- | PrimitiveFilter<
1231
- MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>['text']
1232
- >;
1191
+ | PrimitiveFilter<MessageResponse<StreamChatGenerics>['text']>;
1233
1192
  } & {
1234
1193
  [Key in keyof Omit<
1235
- MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>,
1194
+ MessageResponse<{
1195
+ attachmentType: StreamChatGenerics['attachmentType'];
1196
+ channelType: StreamChatGenerics['channelType'];
1197
+ commandType: StreamChatGenerics['commandType'];
1198
+ eventType: StreamChatGenerics['eventType'];
1199
+ messageType: {};
1200
+ reactionType: StreamChatGenerics['reactionType'];
1201
+ userType: StreamChatGenerics['userType'];
1202
+ }>,
1236
1203
  'text'
1237
1204
  >]?:
1238
1205
  | RequireOnlyOne<
1239
- QueryFilter<MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>[Key]>
1206
+ QueryFilter<
1207
+ MessageResponse<{
1208
+ attachmentType: StreamChatGenerics['attachmentType'];
1209
+ channelType: StreamChatGenerics['channelType'];
1210
+ commandType: StreamChatGenerics['commandType'];
1211
+ eventType: StreamChatGenerics['eventType'];
1212
+ messageType: {};
1213
+ reactionType: StreamChatGenerics['reactionType'];
1214
+ userType: StreamChatGenerics['userType'];
1215
+ }>[Key]
1216
+ >
1240
1217
  >
1241
- | PrimitiveFilter<MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>[Key]>;
1218
+ | PrimitiveFilter<
1219
+ MessageResponse<{
1220
+ attachmentType: StreamChatGenerics['attachmentType'];
1221
+ channelType: StreamChatGenerics['channelType'];
1222
+ commandType: StreamChatGenerics['commandType'];
1223
+ eventType: StreamChatGenerics['eventType'];
1224
+ messageType: {};
1225
+ reactionType: StreamChatGenerics['reactionType'];
1226
+ userType: StreamChatGenerics['userType'];
1227
+ }>[Key]
1228
+ >;
1242
1229
  }
1243
1230
  >;
1244
1231
 
@@ -1275,29 +1262,72 @@ export type QueryLogicalOperators<Operators> = {
1275
1262
  $or?: ArrayTwoOrMore<QueryFilters<Operators>>;
1276
1263
  };
1277
1264
 
1278
- export type UserFilters<UserType = UR> = QueryFilters<
1279
- ContainsOperator<UserType> & {
1265
+ export type UserFilters<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = QueryFilters<
1266
+ ContainsOperator<StreamChatGenerics['userType']> & {
1280
1267
  id?:
1281
- | RequireOnlyOne<{ $autocomplete?: UserResponse<UserType>['id'] } & QueryFilter<UserResponse<UserType>['id']>>
1282
- | PrimitiveFilter<UserResponse<UserType>['id']>;
1268
+ | RequireOnlyOne<
1269
+ { $autocomplete?: UserResponse<StreamChatGenerics>['id'] } & QueryFilter<
1270
+ UserResponse<StreamChatGenerics>['id']
1271
+ >
1272
+ >
1273
+ | PrimitiveFilter<UserResponse<StreamChatGenerics>['id']>;
1283
1274
  name?:
1284
- | RequireOnlyOne<{ $autocomplete?: UserResponse<UserType>['name'] } & QueryFilter<UserResponse<UserType>['name']>>
1285
- | PrimitiveFilter<UserResponse<UserType>['name']>;
1275
+ | RequireOnlyOne<
1276
+ { $autocomplete?: UserResponse<StreamChatGenerics>['name'] } & QueryFilter<
1277
+ UserResponse<StreamChatGenerics>['name']
1278
+ >
1279
+ >
1280
+ | PrimitiveFilter<UserResponse<StreamChatGenerics>['name']>;
1286
1281
  teams?:
1287
1282
  | RequireOnlyOne<{
1288
1283
  $contains?: PrimitiveFilter<string>;
1289
- $eq?: PrimitiveFilter<UserResponse<UserType>['teams']>;
1284
+ $eq?: PrimitiveFilter<UserResponse<StreamChatGenerics>['teams']>;
1290
1285
  }>
1291
- | PrimitiveFilter<UserResponse<UserType>['teams']>;
1286
+ | PrimitiveFilter<UserResponse<StreamChatGenerics>['teams']>;
1292
1287
  username?:
1293
1288
  | RequireOnlyOne<
1294
- { $autocomplete?: UserResponse<UserType>['username'] } & QueryFilter<UserResponse<UserType>['username']>
1289
+ { $autocomplete?: UserResponse<StreamChatGenerics>['username'] } & QueryFilter<
1290
+ UserResponse<StreamChatGenerics>['username']
1291
+ >
1295
1292
  >
1296
- | PrimitiveFilter<UserResponse<UserType>['username']>;
1293
+ | PrimitiveFilter<UserResponse<StreamChatGenerics>['username']>;
1297
1294
  } & {
1298
- [Key in keyof Omit<UserResponse<{}>, 'id' | 'name' | 'teams' | 'username'>]?:
1299
- | RequireOnlyOne<QueryFilter<UserResponse<{}>[Key]>>
1300
- | PrimitiveFilter<UserResponse<{}>[Key]>;
1295
+ [Key in keyof Omit<
1296
+ UserResponse<{
1297
+ attachmentType: StreamChatGenerics['attachmentType'];
1298
+ channelType: StreamChatGenerics['channelType'];
1299
+ commandType: StreamChatGenerics['commandType'];
1300
+ eventType: StreamChatGenerics['eventType'];
1301
+ messageType: StreamChatGenerics['messageType'];
1302
+ reactionType: StreamChatGenerics['reactionType'];
1303
+ userType: {};
1304
+ }>,
1305
+ 'id' | 'name' | 'teams' | 'username'
1306
+ >]?:
1307
+ | RequireOnlyOne<
1308
+ QueryFilter<
1309
+ UserResponse<{
1310
+ attachmentType: StreamChatGenerics['attachmentType'];
1311
+ channelType: StreamChatGenerics['channelType'];
1312
+ commandType: StreamChatGenerics['commandType'];
1313
+ eventType: StreamChatGenerics['eventType'];
1314
+ messageType: StreamChatGenerics['messageType'];
1315
+ reactionType: StreamChatGenerics['reactionType'];
1316
+ userType: {};
1317
+ }>[Key]
1318
+ >
1319
+ >
1320
+ | PrimitiveFilter<
1321
+ UserResponse<{
1322
+ attachmentType: StreamChatGenerics['attachmentType'];
1323
+ channelType: StreamChatGenerics['channelType'];
1324
+ commandType: StreamChatGenerics['commandType'];
1325
+ eventType: StreamChatGenerics['eventType'];
1326
+ messageType: StreamChatGenerics['messageType'];
1327
+ reactionType: StreamChatGenerics['reactionType'];
1328
+ userType: {};
1329
+ }>[Key]
1330
+ >;
1301
1331
  }
1302
1332
  >;
1303
1333
 
@@ -1309,9 +1339,13 @@ export type BannedUsersSort = BannedUsersSortBase | Array<BannedUsersSortBase>;
1309
1339
 
1310
1340
  export type BannedUsersSortBase = { created_at?: AscDesc };
1311
1341
 
1312
- export type ChannelSort<ChannelType = UR> = ChannelSortBase<ChannelType> | Array<ChannelSortBase<ChannelType>>;
1342
+ export type ChannelSort<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1343
+ | ChannelSortBase<StreamChatGenerics>
1344
+ | Array<ChannelSortBase<StreamChatGenerics>>;
1313
1345
 
1314
- export type ChannelSortBase<ChannelType = UR> = Sort<ChannelType> & {
1346
+ export type ChannelSortBase<
1347
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1348
+ > = Sort<StreamChatGenerics> & {
1315
1349
  created_at?: AscDesc;
1316
1350
  has_unread?: AscDesc;
1317
1351
  last_message_at?: AscDesc;
@@ -1328,13 +1362,17 @@ export type Sort<T> = {
1328
1362
  [P in keyof T]?: AscDesc;
1329
1363
  };
1330
1364
 
1331
- export type UserSort<UserType = UR> = Sort<UserResponse<UserType>> | Array<Sort<UserResponse<UserType>>>;
1365
+ export type UserSort<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1366
+ | Sort<UserResponse<StreamChatGenerics>>
1367
+ | Array<Sort<UserResponse<StreamChatGenerics>>>;
1332
1368
 
1333
- export type MemberSort<UserType = UR> =
1334
- | Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>>
1335
- | Array<Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>>>;
1369
+ export type MemberSort<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1370
+ | Sort<Pick<UserResponse<StreamChatGenerics>, 'id' | 'created_at' | 'name'>>
1371
+ | Array<Sort<Pick<UserResponse<StreamChatGenerics>, 'id' | 'created_at' | 'name'>>>;
1336
1372
 
1337
- export type SearchMessageSortBase<MessageType = UR> = Sort<MessageType> & {
1373
+ export type SearchMessageSortBase<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Sort<
1374
+ StreamChatGenerics['messageType']
1375
+ > & {
1338
1376
  attachments?: AscDesc;
1339
1377
  'attachments.type'?: AscDesc;
1340
1378
  created_at?: AscDesc;
@@ -1350,15 +1388,15 @@ export type SearchMessageSortBase<MessageType = UR> = Sort<MessageType> & {
1350
1388
  'user.id'?: AscDesc;
1351
1389
  };
1352
1390
 
1353
- export type SearchMessageSort<MessageType = UR> =
1354
- | SearchMessageSortBase<MessageType>
1355
- | Array<SearchMessageSortBase<MessageType>>;
1391
+ export type SearchMessageSort<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1392
+ | SearchMessageSortBase<StreamChatGenerics>
1393
+ | Array<SearchMessageSortBase<StreamChatGenerics>>;
1356
1394
 
1357
- export type QuerySort<ChannelType = UR, UserType = UR, MessageType = UR> =
1395
+ export type QuerySort<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1358
1396
  | BannedUsersSort
1359
- | ChannelSort<ChannelType>
1360
- | SearchMessageSort<MessageType>
1361
- | UserSort<UserType>;
1397
+ | ChannelSort<StreamChatGenerics>
1398
+ | SearchMessageSort<StreamChatGenerics>
1399
+ | UserSort<StreamChatGenerics>;
1362
1400
 
1363
1401
  /**
1364
1402
  * Base Types
@@ -1375,6 +1413,7 @@ export type Action = {
1375
1413
  export type AnonUserType = {};
1376
1414
 
1377
1415
  export type APNConfig = {
1416
+ auth_key?: string;
1378
1417
  auth_type?: string;
1379
1418
  bundle_id?: string;
1380
1419
  development?: boolean;
@@ -1382,6 +1421,7 @@ export type APNConfig = {
1382
1421
  host?: string;
1383
1422
  key_id?: string;
1384
1423
  notification_template?: string;
1424
+ p12_cert?: string;
1385
1425
  team_id?: string;
1386
1426
  };
1387
1427
 
@@ -1406,7 +1446,7 @@ export type AppSettings = {
1406
1446
  // all possible file mime types are https://www.iana.org/assignments/media-types/media-types.xhtml
1407
1447
  file_upload_config?: FileUploadConfig;
1408
1448
  firebase_config?: {
1409
- credentials_json: string;
1449
+ credentials_json?: string;
1410
1450
  data_template?: string;
1411
1451
  notification_template?: string;
1412
1452
  server_key?: string;
@@ -1434,7 +1474,9 @@ export type AppSettings = {
1434
1474
  };
1435
1475
  };
1436
1476
 
1437
- export type Attachment<T = UR> = T & {
1477
+ export type Attachment<
1478
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1479
+ > = StreamChatGenerics['attachmentType'] & {
1438
1480
  actions?: Action[];
1439
1481
  asset_url?: string;
1440
1482
  author_icon?: string;
@@ -1446,6 +1488,7 @@ export type Attachment<T = UR> = T & {
1446
1488
  file_size?: number | string;
1447
1489
  footer?: string;
1448
1490
  footer_icon?: string;
1491
+ giphy?: GiphyData;
1449
1492
  image_url?: string;
1450
1493
  mime_type?: string;
1451
1494
  og_scrape_url?: string;
@@ -1477,9 +1520,9 @@ export type BlockList = {
1477
1520
  words: string[];
1478
1521
  };
1479
1522
 
1480
- export type ChannelConfig<CommandType extends string = LiteralStringForUnion> = ChannelConfigFields &
1523
+ export type ChannelConfig<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = ChannelConfigFields &
1481
1524
  CreatedAtUpdatedAt & {
1482
- commands?: CommandVariants<CommandType>[];
1525
+ commands?: CommandVariants<StreamChatGenerics>[];
1483
1526
  };
1484
1527
 
1485
1528
  export type ChannelConfigAutomod = '' | 'AI' | 'disabled' | 'simple';
@@ -1513,17 +1556,21 @@ export type ChannelConfigFields = {
1513
1556
  url_enrichment?: boolean;
1514
1557
  };
1515
1558
 
1516
- export type ChannelConfigWithInfo<CommandType extends string = LiteralStringForUnion> = ChannelConfigFields &
1559
+ export type ChannelConfigWithInfo<
1560
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1561
+ > = ChannelConfigFields &
1517
1562
  CreatedAtUpdatedAt & {
1518
- commands?: CommandResponse<CommandType>[];
1563
+ commands?: CommandResponse<StreamChatGenerics>[];
1519
1564
  };
1520
1565
 
1521
- export type ChannelData<ChannelType = UR> = ChannelType & {
1566
+ export type ChannelData<
1567
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1568
+ > = StreamChatGenerics['channelType'] & {
1522
1569
  members?: string[];
1523
1570
  name?: string;
1524
1571
  };
1525
1572
 
1526
- export type ChannelMembership<UserType = UR> = {
1573
+ export type ChannelMembership<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1527
1574
  banned?: boolean;
1528
1575
  channel_role?: Role;
1529
1576
  created_at?: string;
@@ -1531,16 +1578,12 @@ export type ChannelMembership<UserType = UR> = {
1531
1578
  role?: string;
1532
1579
  shadow_banned?: boolean;
1533
1580
  updated_at?: string;
1534
- user?: UserResponse<UserType>;
1581
+ user?: UserResponse<StreamChatGenerics>;
1535
1582
  };
1536
1583
 
1537
- export type ChannelMute<
1538
- ChannelType extends UR = UR,
1539
- CommandType extends string = LiteralStringForUnion,
1540
- UserType extends UR = UR
1541
- > = {
1542
- user: UserResponse<UserType>;
1543
- channel?: ChannelResponse<ChannelType, CommandType, UserType>;
1584
+ export type ChannelMute<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1585
+ user: UserResponse<StreamChatGenerics>;
1586
+ channel?: ChannelResponse<StreamChatGenerics>;
1544
1587
  created_at?: string;
1545
1588
  expires?: string;
1546
1589
  updated_at?: string;
@@ -1554,20 +1597,20 @@ export type ChannelRole = {
1554
1597
  same_team?: boolean;
1555
1598
  };
1556
1599
 
1557
- export type CheckPushInput<UserType = UR> = {
1600
+ export type CheckPushInput<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1558
1601
  apn_template?: string;
1559
1602
  client_id?: string;
1560
1603
  connection_id?: string;
1561
1604
  firebase_data_template?: string;
1562
1605
  firebase_template?: string;
1563
1606
  message_id?: string;
1564
- user?: UserResponse<UserType>;
1607
+ user?: UserResponse<StreamChatGenerics>;
1565
1608
  user_id?: string;
1566
1609
  };
1567
1610
 
1568
1611
  export type PushProvider = 'apn' | 'firebase' | 'huawei' | 'xiaomi';
1569
1612
 
1570
- export type CommandVariants<CommandType extends string = LiteralStringForUnion> =
1613
+ export type CommandVariants<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1571
1614
  | 'all'
1572
1615
  | 'ban'
1573
1616
  | 'fun_set'
@@ -1576,21 +1619,17 @@ export type CommandVariants<CommandType extends string = LiteralStringForUnion>
1576
1619
  | 'mute'
1577
1620
  | 'unban'
1578
1621
  | 'unmute'
1579
- | CommandType;
1622
+ | StreamChatGenerics['commandType'];
1580
1623
 
1581
- export type Configs<CommandType extends string = LiteralStringForUnion> = {
1582
- [channel_type: string]: ChannelConfigWithInfo<CommandType> | undefined;
1624
+ export type Configs<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1625
+ [channel_type: string]: ChannelConfigWithInfo<StreamChatGenerics> | undefined;
1583
1626
  };
1584
1627
 
1585
- export type ConnectionOpen<
1586
- ChannelType extends UR = UR,
1587
- CommandType extends string = LiteralStringForUnion,
1588
- UserType extends UR = UR
1589
- > = {
1628
+ export type ConnectionOpen<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1590
1629
  connection_id: string;
1591
1630
  cid?: string;
1592
1631
  created_at?: string;
1593
- me?: OwnUserResponse<ChannelType, CommandType, UserType>;
1632
+ me?: OwnUserResponse<StreamChatGenerics>;
1594
1633
  type?: string;
1595
1634
  };
1596
1635
 
@@ -1599,9 +1638,9 @@ export type CreatedAtUpdatedAt = {
1599
1638
  updated_at: string;
1600
1639
  };
1601
1640
 
1602
- export type Device<UserType = UR> = DeviceFields & {
1641
+ export type Device<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = DeviceFields & {
1603
1642
  provider?: string;
1604
- user?: UserResponse<UserType>;
1643
+ user?: UserResponse<StreamChatGenerics>;
1605
1644
  user_id?: string;
1606
1645
  };
1607
1646
 
@@ -1739,14 +1778,38 @@ export type FirebaseConfig = {
1739
1778
  data_template?: string;
1740
1779
  enabled?: boolean;
1741
1780
  notification_template?: string;
1781
+ server_key?: string;
1782
+ };
1783
+
1784
+ type GiphyVersionInfo = {
1785
+ height: string;
1786
+ url: string;
1787
+ width: string;
1788
+ };
1789
+
1790
+ type GiphyVersions =
1791
+ | 'original'
1792
+ | 'fixed_height'
1793
+ | 'fixed_height_still'
1794
+ | 'fixed_height_downsampled'
1795
+ | 'fixed_width'
1796
+ | 'fixed_width_still'
1797
+ | 'fixed_width_downsampled';
1798
+
1799
+ type GiphyData = {
1800
+ [key in GiphyVersions]: GiphyVersionInfo;
1742
1801
  };
1743
1802
 
1744
1803
  export type HuaweiConfig = {
1745
1804
  enabled?: boolean;
1805
+ id?: string;
1806
+ secret?: string;
1746
1807
  };
1747
1808
 
1748
1809
  export type XiaomiConfig = {
1749
1810
  enabled?: boolean;
1811
+ package_name?: string;
1812
+ secret?: string;
1750
1813
  };
1751
1814
 
1752
1815
  export type LiteralStringForUnion = string & {};
@@ -1755,15 +1818,17 @@ export type LogLevel = 'info' | 'error' | 'warn';
1755
1818
 
1756
1819
  export type Logger = (logLevel: LogLevel, message: string, extraData?: Record<string, unknown>) => void;
1757
1820
 
1758
- export type Message<AttachmentType = UR, MessageType = UR, UserType = UR> = Partial<
1759
- MessageBase<AttachmentType, MessageType, UserType>
1821
+ export type Message<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Partial<
1822
+ MessageBase<StreamChatGenerics>
1760
1823
  > & {
1761
1824
  mentioned_users?: string[];
1762
1825
  };
1763
1826
 
1764
- export type MessageBase<AttachmentType = UR, MessageType = UR, UserType = UR> = MessageType & {
1827
+ export type MessageBase<
1828
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1829
+ > = StreamChatGenerics['messageType'] & {
1765
1830
  id: string;
1766
- attachments?: Attachment<AttachmentType>[];
1831
+ attachments?: Attachment<StreamChatGenerics>[];
1767
1832
  html?: string;
1768
1833
  mml?: string;
1769
1834
  parent_id?: string;
@@ -1773,38 +1838,38 @@ export type MessageBase<AttachmentType = UR, MessageType = UR, UserType = UR> =
1773
1838
  quoted_message_id?: string;
1774
1839
  show_in_channel?: boolean;
1775
1840
  text?: string;
1776
- user?: UserResponse<UserType> | null;
1841
+ user?: UserResponse<StreamChatGenerics> | null;
1777
1842
  user_id?: string;
1778
1843
  };
1779
1844
 
1780
1845
  export type MessageLabel = 'deleted' | 'ephemeral' | 'error' | 'regular' | 'reply' | 'system';
1781
1846
 
1782
- export type Mute<UserType = UR> = {
1847
+ export type Mute<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1783
1848
  created_at: string;
1784
- target: UserResponse<UserType>;
1849
+ target: UserResponse<StreamChatGenerics>;
1785
1850
  updated_at: string;
1786
- user: UserResponse<UserType>;
1851
+ user: UserResponse<StreamChatGenerics>;
1787
1852
  };
1788
1853
 
1789
- export type PartialUpdateChannel<ChannelType = UR> = {
1790
- set?: Partial<ChannelResponse<ChannelType>>;
1791
- unset?: Array<keyof ChannelResponse<ChannelType>>;
1854
+ export type PartialUpdateChannel<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1855
+ set?: Partial<ChannelResponse<StreamChatGenerics>>;
1856
+ unset?: Array<keyof ChannelResponse<StreamChatGenerics>>;
1792
1857
  };
1793
1858
 
1794
- export type PartialUserUpdate<UserType = UR> = {
1859
+ export type PartialUserUpdate<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1795
1860
  id: string;
1796
- set?: Partial<UserResponse<UserType>>;
1797
- unset?: Array<keyof UserResponse<UserType>>;
1861
+ set?: Partial<UserResponse<StreamChatGenerics>>;
1862
+ unset?: Array<keyof UserResponse<StreamChatGenerics>>;
1798
1863
  };
1799
1864
 
1800
- export type MessageUpdatableFields<MessageType = UR> = Omit<
1801
- MessageResponse<MessageType>,
1865
+ export type MessageUpdatableFields<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Omit<
1866
+ MessageResponse<StreamChatGenerics>,
1802
1867
  'cid' | 'created_at' | 'updated_at' | 'deleted_at' | 'user' | 'user_id'
1803
1868
  >;
1804
1869
 
1805
- export type PartialMessageUpdate<MessageType = UR> = {
1806
- set?: Partial<MessageUpdatableFields<MessageType>>;
1807
- unset?: Array<keyof MessageUpdatableFields<MessageType>>;
1870
+ export type PartialMessageUpdate<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1871
+ set?: Partial<MessageUpdatableFields<StreamChatGenerics>>;
1872
+ unset?: Array<keyof MessageUpdatableFields<StreamChatGenerics>>;
1808
1873
  };
1809
1874
 
1810
1875
  export type PermissionAPIObject = {
@@ -1848,11 +1913,13 @@ export type RateLimitsInfo = {
1848
1913
 
1849
1914
  export type RateLimitsMap = Record<EndpointName, RateLimitsInfo>;
1850
1915
 
1851
- export type Reaction<ReactionType = UR, UserType = UR> = ReactionType & {
1916
+ export type Reaction<
1917
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1918
+ > = StreamChatGenerics['reactionType'] & {
1852
1919
  type: string;
1853
1920
  message_id?: string;
1854
1921
  score?: number;
1855
- user?: UserResponse<UserType> | null;
1922
+ user?: UserResponse<StreamChatGenerics> | null;
1856
1923
  user_id?: string;
1857
1924
  };
1858
1925
 
@@ -1876,29 +1943,18 @@ export type Resource =
1876
1943
  | 'UpdateUser'
1877
1944
  | 'UploadAttachment';
1878
1945
 
1879
- export type SearchPayload<
1880
- AttachmentType = UR,
1881
- ChannelType = UR,
1882
- CommandType extends string = LiteralStringForUnion,
1883
- MessageType = UR,
1884
- ReactionType = UR,
1885
- UserType = UR
1886
- > = Omit<SearchOptions<MessageType>, 'sort'> & {
1946
+ export type SearchPayload<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Omit<
1947
+ SearchOptions<StreamChatGenerics>,
1948
+ 'sort'
1949
+ > & {
1887
1950
  client_id?: string;
1888
1951
  connection_id?: string;
1889
- filter_conditions?: ChannelFilters<ChannelType, CommandType, UserType>;
1890
- message_filter_conditions?: MessageFilters<
1891
- AttachmentType,
1892
- ChannelType,
1893
- CommandType,
1894
- MessageType,
1895
- ReactionType,
1896
- UserType
1897
- >;
1952
+ filter_conditions?: ChannelFilters<StreamChatGenerics>;
1953
+ message_filter_conditions?: MessageFilters<StreamChatGenerics>;
1898
1954
  query?: string;
1899
1955
  sort?: Array<{
1900
1956
  direction: AscDesc;
1901
- field: keyof SearchMessageSortBase<MessageType>;
1957
+ field: keyof SearchMessageSortBase<StreamChatGenerics>;
1902
1958
  }>;
1903
1959
  };
1904
1960
 
@@ -1994,19 +2050,12 @@ export type ReservedMessageFields =
1994
2050
  | 'user'
1995
2051
  | '__html';
1996
2052
 
1997
- export type UpdatedMessage<
1998
- AttachmentType = UR,
1999
- ChannelType = UR,
2000
- CommandType extends string = LiteralStringForUnion,
2001
- MessageType = UR,
2002
- ReactionType = UR,
2003
- UserType = UR
2004
- > = Omit<
2005
- MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>,
2053
+ export type UpdatedMessage<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Omit<
2054
+ MessageResponse<StreamChatGenerics>,
2006
2055
  'mentioned_users'
2007
2056
  > & { mentioned_users?: string[] };
2008
2057
 
2009
- export type User<UserType = UR> = UserType & {
2058
+ export type User<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = StreamChatGenerics['userType'] & {
2010
2059
  id: string;
2011
2060
  anon?: boolean;
2012
2061
  name?: string;
@@ -2101,16 +2150,20 @@ export type TaskStatus = {
2101
2150
  result?: UR;
2102
2151
  };
2103
2152
 
2104
- export type TruncateOptions<AttachmentType, MessageType, UserType> = {
2153
+ export type TruncateOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
2105
2154
  hard_delete?: boolean;
2106
- message?: Message<AttachmentType, MessageType, UserType>;
2155
+ message?: Message<StreamChatGenerics>;
2107
2156
  skip_push?: boolean;
2108
2157
  truncated_at?: Date;
2109
2158
  };
2110
2159
 
2160
+ export type CreateImportURLResponse = {
2161
+ path: string;
2162
+ upload_url: string;
2163
+ };
2164
+
2111
2165
  export type CreateImportResponse = {
2112
2166
  import_task: ImportTask;
2113
- upload_url: string;
2114
2167
  };
2115
2168
 
2116
2169
  export type GetImportResponse = {
@@ -2134,9 +2187,9 @@ export type ImportTaskHistory = {
2134
2187
 
2135
2188
  export type ImportTask = {
2136
2189
  created_at: string;
2137
- filename: string;
2138
2190
  history: ImportTaskHistory[];
2139
2191
  id: string;
2192
+ path: string;
2140
2193
  state: string;
2141
2194
  updated_at: string;
2142
2195
  result?: UR;