stream-chat 5.3.0 → 6.0.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 (43) hide show
  1. package/README.md +21 -13
  2. package/dist/browser.es.js +290 -149
  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 +290 -149
  7. package/dist/browser.js.map +1 -1
  8. package/dist/index.es.js +290 -149
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/index.js +290 -149
  11. package/dist/index.js.map +1 -1
  12. package/dist/types/channel.d.ts +127 -123
  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 +200 -170
  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/events.d.ts +1 -0
  25. package/dist/types/events.d.ts.map +1 -1
  26. package/dist/types/insights.d.ts +2 -2
  27. package/dist/types/token_manager.d.ts +6 -6
  28. package/dist/types/token_manager.d.ts.map +1 -1
  29. package/dist/types/types.d.ts +370 -234
  30. package/dist/types/types.d.ts.map +1 -1
  31. package/dist/types/utils.d.ts +2 -2
  32. package/dist/types/utils.d.ts.map +1 -1
  33. package/package.json +4 -4
  34. package/src/channel.ts +195 -290
  35. package/src/channel_state.ts +54 -219
  36. package/src/client.ts +300 -521
  37. package/src/client_state.ts +6 -6
  38. package/src/connection.ts +10 -23
  39. package/src/connection_fallback.ts +9 -21
  40. package/src/events.ts +1 -0
  41. package/src/token_manager.ts +6 -6
  42. package/src/types.ts +482 -528
  43. package/src/utils.ts +7 -11
package/src/types.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
+ import { EVENT_MAP } from './events';
2
3
  import { Role } from './permissions';
3
4
 
4
5
  /**
@@ -33,6 +34,26 @@ export type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<
33
34
  export type UR = Record<string, unknown>;
34
35
  export type UnknownType = UR; //alias to avoid breaking change
35
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
+
36
57
  export type Unpacked<T> = T extends (infer U)[]
37
58
  ? U // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
59
  : T extends (...args: any[]) => infer U
@@ -49,7 +70,7 @@ export type APIResponse = {
49
70
  duration: string;
50
71
  };
51
72
 
52
- export type AppSettingsAPIResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
73
+ export type AppSettingsAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
53
74
  app?: {
54
75
  channel_configs: Record<
55
76
  string,
@@ -57,7 +78,7 @@ export type AppSettingsAPIResponse<CommandType extends string = LiteralStringFor
57
78
  automod?: ChannelConfigAutomod;
58
79
  automod_behavior?: ChannelConfigAutomodBehavior;
59
80
  blocklist_behavior?: ChannelConfigAutomodBehavior;
60
- commands?: CommandVariants<CommandType>[];
81
+ commands?: CommandVariants<StreamChatGenerics>[];
61
82
  connect_events?: boolean;
62
83
  created_at?: string;
63
84
  custom_events?: boolean;
@@ -126,79 +147,47 @@ export type ModerationResult = {
126
147
  moderated_by?: string;
127
148
  };
128
149
 
129
- export type MessageFlagsResponse<
130
- ChannelType extends UR = UR,
131
- CommandType extends string = LiteralStringForUnion,
132
- UserType extends UR = UR,
133
- AttachmentType = UR,
134
- MessageType = UR,
135
- ReactionType = UR
136
- > = APIResponse & {
150
+ export type MessageFlagsResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
137
151
  flags?: Array<{
138
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
139
- user: UserResponse<UserType>;
152
+ message: MessageResponse<StreamChatGenerics>;
153
+ user: UserResponse<StreamChatGenerics>;
140
154
  approved_at?: string;
141
155
  created_at?: string;
142
156
  created_by_automod?: boolean;
143
157
  moderation_result?: ModerationResult;
144
158
  rejected_at?: string;
145
159
  reviewed_at?: string;
146
- reviewed_by?: UserResponse<UserType>;
160
+ reviewed_by?: UserResponse<StreamChatGenerics>;
147
161
  updated_at?: string;
148
162
  }>;
149
163
  };
150
164
 
151
- export type FlagReport<
152
- ChannelType extends UR = UR,
153
- CommandType extends string = LiteralStringForUnion,
154
- UserType extends UR = UR,
155
- AttachmentType = UR,
156
- MessageType = UR,
157
- ReactionType = UR
158
- > = {
165
+ export type FlagReport<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
159
166
  flags_count: number;
160
167
  id: string;
161
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
162
- user: UserResponse<UserType>;
168
+ message: MessageResponse<StreamChatGenerics>;
169
+ user: UserResponse<StreamChatGenerics>;
163
170
  created_at?: string;
164
- review_details?: Object;
171
+ details?: Object;
165
172
  review_result?: string;
166
173
  reviewed_at?: string;
167
- reviewed_by?: UserResponse<UserType>;
174
+ reviewed_by?: UserResponse<StreamChatGenerics>;
168
175
  updated_at?: string;
169
176
  };
170
177
 
171
- export type FlagReportsResponse<
172
- ChannelType extends UR = UR,
173
- CommandType extends string = LiteralStringForUnion,
174
- UserType extends UR = UR,
175
- AttachmentType = UR,
176
- MessageType = UR,
177
- ReactionType = UR
178
- > = APIResponse & {
179
- flag_reports: Array<FlagReport<ChannelType, CommandType, UserType, AttachmentType, MessageType, ReactionType>>;
178
+ export type FlagReportsResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
179
+ flag_reports: Array<FlagReport<StreamChatGenerics>>;
180
180
  };
181
181
 
182
- export type ReviewFlagReportResponse<
183
- ChannelType extends UR = UR,
184
- CommandType extends string = LiteralStringForUnion,
185
- UserType extends UR = UR,
186
- AttachmentType = UR,
187
- MessageType = UR,
188
- ReactionType = UR
189
- > = APIResponse & {
190
- flag_report: FlagReport<ChannelType, CommandType, UserType, AttachmentType, MessageType, ReactionType>;
182
+ export type ReviewFlagReportResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
183
+ flag_report: FlagReport<StreamChatGenerics>;
191
184
  };
192
185
 
193
- export type BannedUsersResponse<
194
- ChannelType extends UR = UR,
195
- CommandType extends string = LiteralStringForUnion,
196
- UserType extends UR = UR
197
- > = APIResponse & {
186
+ export type BannedUsersResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
198
187
  bans?: Array<{
199
- user: UserResponse<UserType>;
200
- banned_by?: UserResponse<UserType>;
201
- channel?: ChannelResponse<ChannelType, CommandType, UserType>;
188
+ user: UserResponse<StreamChatGenerics>;
189
+ banned_by?: UserResponse<StreamChatGenerics>;
190
+ channel?: ChannelResponse<StreamChatGenerics>;
202
191
  expires?: string;
203
192
  ip_ban?: boolean;
204
193
  reason?: string;
@@ -212,10 +201,8 @@ export type BlockListResponse = BlockList & {
212
201
  };
213
202
 
214
203
  export type ChannelResponse<
215
- ChannelType = UR,
216
- CommandType extends string = LiteralStringForUnion,
217
- UserType = UR
218
- > = ChannelType & {
204
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
205
+ > = StreamChatGenerics['channelType'] & {
219
206
  cid: string;
220
207
  disabled: boolean;
221
208
  frozen: boolean;
@@ -223,17 +210,17 @@ export type ChannelResponse<
223
210
  type: string;
224
211
  auto_translation_enabled?: boolean;
225
212
  auto_translation_language?: TranslationLanguages | '';
226
- config?: ChannelConfigWithInfo<CommandType>;
213
+ config?: ChannelConfigWithInfo<StreamChatGenerics>;
227
214
  cooldown?: number;
228
215
  created_at?: string;
229
- created_by?: UserResponse<UserType> | null;
216
+ created_by?: UserResponse<StreamChatGenerics> | null;
230
217
  created_by_id?: string;
231
218
  deleted_at?: string;
232
219
  hidden?: boolean;
233
220
  invites?: string[];
234
221
  last_message_at?: string;
235
222
  member_count?: number;
236
- members?: ChannelMemberResponse<UserType>[];
223
+ members?: ChannelMemberResponse<StreamChatGenerics>[];
237
224
  muted?: boolean;
238
225
  name?: string;
239
226
  own_capabilities?: string[];
@@ -242,23 +229,16 @@ export type ChannelResponse<
242
229
  updated_at?: string;
243
230
  };
244
231
 
245
- export type ChannelAPIResponse<
246
- AttachmentType = UR,
247
- ChannelType = UR,
248
- CommandType extends string = LiteralStringForUnion,
249
- MessageType = UR,
250
- ReactionType = UR,
251
- UserType = UR
252
- > = APIResponse & {
253
- channel: ChannelResponse<ChannelType, CommandType, UserType>;
254
- members: ChannelMemberResponse<UserType>[];
255
- messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
256
- pinned_messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
232
+ export type ChannelAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
233
+ channel: ChannelResponse<StreamChatGenerics>;
234
+ members: ChannelMemberResponse<StreamChatGenerics>[];
235
+ messages: MessageResponse<StreamChatGenerics>[];
236
+ pinned_messages: MessageResponse<StreamChatGenerics>[];
257
237
  hidden?: boolean;
258
- membership?: ChannelMembership<UserType> | null;
259
- read?: ReadResponse<UserType>[];
238
+ membership?: ChannelMembership<StreamChatGenerics> | null;
239
+ read?: ReadResponse<StreamChatGenerics>[];
260
240
  watcher_count?: number;
261
- watchers?: UserResponse<UserType>[];
241
+ watchers?: UserResponse<StreamChatGenerics>[];
262
242
  };
263
243
 
264
244
  export type ChannelUpdateOptions = {
@@ -266,11 +246,11 @@ export type ChannelUpdateOptions = {
266
246
  skip_push?: boolean;
267
247
  };
268
248
 
269
- export type ChannelMemberAPIResponse<UserType = UR> = APIResponse & {
270
- members: ChannelMemberResponse<UserType>[];
249
+ export type ChannelMemberAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
250
+ members: ChannelMemberResponse<StreamChatGenerics>[];
271
251
  };
272
252
 
273
- export type ChannelMemberResponse<UserType = UR> = {
253
+ export type ChannelMemberResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
274
254
  banned?: boolean;
275
255
  channel_role?: Role;
276
256
  created_at?: string;
@@ -281,7 +261,7 @@ export type ChannelMemberResponse<UserType = UR> = {
281
261
  role?: string;
282
262
  shadow_banned?: boolean;
283
263
  updated_at?: string;
284
- user?: UserResponse<UserType>;
264
+ user?: UserResponse<StreamChatGenerics>;
285
265
  user_id?: string;
286
266
  };
287
267
 
@@ -305,52 +285,40 @@ export type CheckSQSResponse = APIResponse & {
305
285
  error?: string;
306
286
  };
307
287
 
308
- export type CommandResponse<CommandType extends string = LiteralStringForUnion> = Partial<CreatedAtUpdatedAt> & {
288
+ export type CommandResponse<
289
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
290
+ > = Partial<CreatedAtUpdatedAt> & {
309
291
  args?: string;
310
292
  description?: string;
311
- name?: CommandVariants<CommandType>;
312
- set?: CommandVariants<CommandType>;
293
+ name?: CommandVariants<StreamChatGenerics>;
294
+ set?: CommandVariants<StreamChatGenerics>;
313
295
  };
314
296
 
315
297
  export type ConnectAPIResponse<
316
- ChannelType extends UR = UR,
317
- CommandType extends string = LiteralStringForUnion,
318
- UserType extends UR = UR
319
- > = Promise<void | ConnectionOpen<ChannelType, CommandType, UserType>>;
298
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
299
+ > = Promise<void | ConnectionOpen<StreamChatGenerics>>;
320
300
 
321
- export type CreateChannelResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
322
- Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id'> & {
301
+ export type CreateChannelResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse &
302
+ Omit<CreateChannelOptions<StreamChatGenerics>, 'client_id' | 'connection_id'> & {
323
303
  created_at: string;
324
304
  updated_at: string;
325
305
  grants?: Record<string, string[]>;
326
306
  };
327
307
 
328
- export type CreateCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
329
- command: CreateCommandOptions<CommandType> & CreatedAtUpdatedAt;
308
+ export type CreateCommandResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
309
+ command: CreateCommandOptions<StreamChatGenerics> & CreatedAtUpdatedAt;
330
310
  };
331
311
 
332
- export type DeleteChannelAPIResponse<
333
- ChannelType = UR,
334
- CommandType extends string = LiteralStringForUnion,
335
- UserType = UR
336
- > = APIResponse & {
337
- channel: ChannelResponse<ChannelType, CommandType, UserType>;
312
+ export type DeleteChannelAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
313
+ channel: ChannelResponse<StreamChatGenerics>;
338
314
  };
339
315
 
340
- export type DeleteCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
341
- name?: CommandVariants<CommandType>;
316
+ export type DeleteCommandResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
317
+ name?: CommandVariants<StreamChatGenerics>;
342
318
  };
343
319
 
344
- export type EventAPIResponse<
345
- AttachmentType extends UR = UR,
346
- ChannelType extends UR = UR,
347
- CommandType extends string = LiteralStringForUnion,
348
- EventType extends UR = UR,
349
- MessageType extends UR = UR,
350
- ReactionType extends UR = UR,
351
- UserType extends UR = UR
352
- > = APIResponse & {
353
- event: Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>;
320
+ export type EventAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
321
+ event: Event<StreamChatGenerics>;
354
322
  };
355
323
 
356
324
  export type ExportChannelResponse = {
@@ -368,13 +336,13 @@ export type ExportChannelStatusResponse = {
368
336
  updated_at?: string;
369
337
  };
370
338
 
371
- export type FlagMessageResponse<UserType = UR> = APIResponse & {
339
+ export type FlagMessageResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
372
340
  flag: {
373
341
  created_at: string;
374
342
  created_by_automod: boolean;
375
343
  target_message_id: string;
376
344
  updated_at: string;
377
- user: UserResponse<UserType>;
345
+ user: UserResponse<StreamChatGenerics>;
378
346
  approved_at?: string;
379
347
  channel_cid?: string;
380
348
  details?: Object; // Any JSON
@@ -385,13 +353,13 @@ export type FlagMessageResponse<UserType = UR> = APIResponse & {
385
353
  };
386
354
  };
387
355
 
388
- export type FlagUserResponse<UserType = UR> = APIResponse & {
356
+ export type FlagUserResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
389
357
  flag: {
390
358
  created_at: string;
391
359
  created_by_automod: boolean;
392
- target_user: UserResponse<UserType>;
360
+ target_user: UserResponse<StreamChatGenerics>;
393
361
  updated_at: string;
394
- user: UserResponse<UserType>;
362
+ user: UserResponse<StreamChatGenerics>;
395
363
  approved_at?: string;
396
364
  details?: Object; // Any JSON
397
365
  rejected_at?: string;
@@ -400,45 +368,41 @@ export type FlagUserResponse<UserType = UR> = APIResponse & {
400
368
  };
401
369
  };
402
370
 
403
- export type FormatMessageResponse<
404
- AttachmentType = UR,
405
- ChannelType = UR,
406
- CommandType extends string = LiteralStringForUnion,
407
- MessageType = UR,
408
- ReactionType = UR,
409
- UserType = UR
410
- > = Omit<
411
- MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>,
371
+ export type FormatMessageResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Omit<
372
+ MessageResponse<{
373
+ attachmentType: StreamChatGenerics['attachmentType'];
374
+ channelType: StreamChatGenerics['channelType'];
375
+ commandType: StreamChatGenerics['commandType'];
376
+ eventType: StreamChatGenerics['eventType'];
377
+ messageType: {};
378
+ reactionType: StreamChatGenerics['reactionType'];
379
+ userType: StreamChatGenerics['userType'];
380
+ }>,
412
381
  'created_at' | 'pinned_at' | 'updated_at' | 'status'
413
382
  > &
414
- MessageType & {
383
+ StreamChatGenerics['messageType'] & {
415
384
  created_at: Date;
416
385
  pinned_at: Date | null;
417
386
  status: string;
418
387
  updated_at: Date;
419
388
  };
420
389
 
421
- export type GetChannelTypeResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
422
- Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id' | 'commands'> & {
390
+ export type GetChannelTypeResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse &
391
+ Omit<CreateChannelOptions<StreamChatGenerics>, 'client_id' | 'connection_id' | 'commands'> & {
423
392
  created_at: string;
424
393
  updated_at: string;
425
- commands?: CommandResponse<CommandType>[];
394
+ commands?: CommandResponse<StreamChatGenerics>[];
426
395
  grants?: Record<string, string[]>;
427
396
  };
428
397
 
429
- export type GetCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
430
- CreateCommandOptions<CommandType> &
398
+ export type GetCommandResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse &
399
+ CreateCommandOptions<StreamChatGenerics> &
431
400
  CreatedAtUpdatedAt;
432
401
 
433
402
  export type GetMultipleMessagesAPIResponse<
434
- AttachmentType = UR,
435
- ChannelType = UR,
436
- CommandType extends string = LiteralStringForUnion,
437
- MessageType = UR,
438
- ReactionType = UR,
439
- UserType = UR
403
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
440
404
  > = APIResponse & {
441
- messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
405
+ messages: MessageResponse<StreamChatGenerics>[];
442
406
  };
443
407
 
444
408
  export type GetRateLimitsResponse = APIResponse & {
@@ -448,26 +412,19 @@ export type GetRateLimitsResponse = APIResponse & {
448
412
  web?: RateLimitsMap;
449
413
  };
450
414
 
451
- export type GetReactionsAPIResponse<ReactionType = UR, UserType = UR> = APIResponse & {
452
- reactions: ReactionResponse<ReactionType, UserType>[];
415
+ export type GetReactionsAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
416
+ reactions: ReactionResponse<StreamChatGenerics>[];
453
417
  };
454
418
 
455
- export type GetRepliesAPIResponse<
456
- AttachmentType = UR,
457
- ChannelType = UR,
458
- CommandType extends string = LiteralStringForUnion,
459
- MessageType = UR,
460
- ReactionType = UR,
461
- UserType = UR
462
- > = APIResponse & {
463
- messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
419
+ export type GetRepliesAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
420
+ messages: MessageResponse<StreamChatGenerics>[];
464
421
  };
465
422
 
466
- export type ListChannelResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
423
+ export type ListChannelResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
467
424
  channel_types: Record<
468
425
  string,
469
- Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id' | 'commands'> & {
470
- commands: CommandResponse<CommandType>[];
426
+ Omit<CreateChannelOptions<StreamChatGenerics>, 'client_id' | 'connection_id' | 'commands'> & {
427
+ commands: CommandResponse<StreamChatGenerics>[];
471
428
  created_at: string;
472
429
  updated_at: string;
473
430
  grants?: Record<string, string[]>;
@@ -476,45 +433,31 @@ export type ListChannelResponse<CommandType extends string = LiteralStringForUni
476
433
  };
477
434
 
478
435
  export type ListChannelTypesAPIResponse<
479
- CommandType extends string = LiteralStringForUnion
480
- > = ListChannelResponse<CommandType>;
436
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
437
+ > = ListChannelResponse<StreamChatGenerics>;
481
438
 
482
- export type ListCommandsResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
483
- commands: Array<CreateCommandOptions<CommandType> & Partial<CreatedAtUpdatedAt>>;
439
+ export type ListCommandsResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
440
+ commands: Array<CreateCommandOptions<StreamChatGenerics> & Partial<CreatedAtUpdatedAt>>;
484
441
  };
485
442
 
486
- export type MuteChannelAPIResponse<
487
- ChannelType extends UR = UR,
488
- CommandType extends string = LiteralStringForUnion,
489
- UserType extends UR = UR
490
- > = APIResponse & {
491
- channel_mute: ChannelMute<ChannelType, CommandType, UserType>;
492
- own_user: OwnUserResponse<ChannelType, CommandType, UserType>;
493
- channel_mutes?: ChannelMute<ChannelType, CommandType, UserType>[];
494
- mute?: MuteResponse<UserType>;
443
+ export type MuteChannelAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
444
+ channel_mute: ChannelMute<StreamChatGenerics>;
445
+ own_user: OwnUserResponse<StreamChatGenerics>;
446
+ channel_mutes?: ChannelMute<StreamChatGenerics>[];
447
+ mute?: MuteResponse<StreamChatGenerics>;
495
448
  };
496
449
 
497
450
  export type MessageResponse<
498
- AttachmentType = UR,
499
- ChannelType = UR,
500
- CommandType extends string = LiteralStringForUnion,
501
- MessageType = UR,
502
- ReactionType = UR,
503
- UserType = UR
504
- > = MessageResponseBase<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType> & {
505
- quoted_message?: MessageResponseBase<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
451
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
452
+ > = MessageResponseBase<StreamChatGenerics> & {
453
+ quoted_message?: MessageResponseBase<StreamChatGenerics>;
506
454
  };
507
455
 
508
456
  export type MessageResponseBase<
509
- AttachmentType = UR,
510
- ChannelType = UR,
511
- CommandType extends string = LiteralStringForUnion,
512
- MessageType = UR,
513
- ReactionType = UR,
514
- UserType = UR
515
- > = MessageBase<AttachmentType, MessageType, UserType> & {
457
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
458
+ > = MessageBase<StreamChatGenerics> & {
516
459
  args?: string;
517
- channel?: ChannelResponse<ChannelType, CommandType, UserType>;
460
+ channel?: ChannelResponse<StreamChatGenerics>;
518
461
  cid?: string;
519
462
  command?: string;
520
463
  command_info?: { name?: string };
@@ -523,49 +466,41 @@ export type MessageResponseBase<
523
466
  i18n?: RequireAtLeastOne<Record<`${TranslationLanguages}_text`, string>> & {
524
467
  language: TranslationLanguages;
525
468
  };
526
- latest_reactions?: ReactionResponse<ReactionType, UserType>[];
527
- mentioned_users?: UserResponse<UserType>[];
528
- own_reactions?: ReactionResponse<ReactionType, UserType>[] | null;
469
+ latest_reactions?: ReactionResponse<StreamChatGenerics>[];
470
+ mentioned_users?: UserResponse<StreamChatGenerics>[];
471
+ own_reactions?: ReactionResponse<StreamChatGenerics>[] | null;
529
472
  pin_expires?: string | null;
530
473
  pinned_at?: string | null;
531
- pinned_by?: UserResponse<UserType> | null;
474
+ pinned_by?: UserResponse<StreamChatGenerics> | null;
532
475
  reaction_counts?: { [key: string]: number } | null;
533
476
  reaction_scores?: { [key: string]: number } | null;
534
477
  reply_count?: number;
535
478
  shadowed?: boolean;
536
479
  silent?: boolean;
537
480
  status?: string;
538
- thread_participants?: UserResponse<UserType>[];
481
+ thread_participants?: UserResponse<StreamChatGenerics>[];
539
482
  type?: MessageLabel;
540
483
  updated_at?: string;
541
484
  };
542
485
 
543
- export type MuteResponse<UserType = UR> = {
544
- user: UserResponse<UserType>;
486
+ export type MuteResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
487
+ user: UserResponse<StreamChatGenerics>;
545
488
  created_at?: string;
546
489
  expires?: string;
547
- target?: UserResponse<UserType>;
490
+ target?: UserResponse<StreamChatGenerics>;
548
491
  updated_at?: string;
549
492
  };
550
493
 
551
- export type MuteUserResponse<
552
- ChannelType extends UR = UR,
553
- CommandType extends string = LiteralStringForUnion,
554
- UserType extends UR = UR
555
- > = APIResponse & {
556
- mute?: MuteResponse<UserType>;
557
- mutes?: Array<Mute<UserType>>;
558
- own_user?: OwnUserResponse<ChannelType, CommandType, UserType>;
559
- };
560
-
561
- export type OwnUserBase<
562
- ChannelType extends UR = UR,
563
- CommandType extends string = LiteralStringForUnion,
564
- UserType extends UR = UR
565
- > = {
566
- channel_mutes: ChannelMute<ChannelType, CommandType, UserType>[];
567
- devices: Device<UserType>[];
568
- mutes: Mute<UserType>[];
494
+ export type MuteUserResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
495
+ mute?: MuteResponse<StreamChatGenerics>;
496
+ mutes?: Array<Mute<StreamChatGenerics>>;
497
+ own_user?: OwnUserResponse<StreamChatGenerics>;
498
+ };
499
+
500
+ export type OwnUserBase<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
501
+ channel_mutes: ChannelMute<StreamChatGenerics>[];
502
+ devices: Device<StreamChatGenerics>[];
503
+ mutes: Mute<StreamChatGenerics>[];
569
504
  total_unread_count: number;
570
505
  unread_channels: number;
571
506
  unread_count: number;
@@ -574,18 +509,14 @@ export type OwnUserBase<
574
509
  };
575
510
 
576
511
  export type OwnUserResponse<
577
- ChannelType extends UR = UR,
578
- CommandType extends string = LiteralStringForUnion,
579
- UserType extends UR = UR
580
- > = UserResponse<UserType> & OwnUserBase<ChannelType, CommandType, UserType>;
512
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
513
+ > = UserResponse<StreamChatGenerics> & OwnUserBase<StreamChatGenerics>;
581
514
 
582
515
  export type PartialUpdateChannelAPIResponse<
583
- ChannelType = UR,
584
- CommandType extends string = LiteralStringForUnion,
585
- UserType = UR
516
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
586
517
  > = APIResponse & {
587
- channel: ChannelResponse<ChannelType, CommandType, UserType>;
588
- members: ChannelMemberResponse<UserType>[];
518
+ channel: ChannelResponse<StreamChatGenerics>;
519
+ members: ChannelMemberResponse<StreamChatGenerics>[];
589
520
  };
590
521
 
591
522
  export type PermissionAPIResponse = APIResponse & {
@@ -596,39 +527,27 @@ export type PermissionsAPIResponse = APIResponse & {
596
527
  permissions?: PermissionAPIObject[];
597
528
  };
598
529
 
599
- export type ReactionAPIResponse<
600
- AttachmentType = UR,
601
- ChannelType = UR,
602
- CommandType extends string = LiteralStringForUnion,
603
- MessageType = UR,
604
- ReactionType = UR,
605
- UserType = UR
606
- > = APIResponse & {
607
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
608
- reaction: ReactionResponse<ReactionType, UserType>;
530
+ export type ReactionAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
531
+ message: MessageResponse<StreamChatGenerics>;
532
+ reaction: ReactionResponse<StreamChatGenerics>;
609
533
  };
610
534
 
611
- export type ReactionResponse<ReactionType = UR, UserType = UR> = Reaction<ReactionType, UserType> & {
535
+ export type ReactionResponse<
536
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
537
+ > = Reaction<StreamChatGenerics> & {
612
538
  created_at: string;
613
539
  updated_at: string;
614
540
  };
615
541
 
616
- export type ReadResponse<UserType = UR> = {
542
+ export type ReadResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
617
543
  last_read: string;
618
- user: UserResponse<UserType>;
544
+ user: UserResponse<StreamChatGenerics>;
619
545
  unread_messages?: number;
620
546
  };
621
547
 
622
- export type SearchAPIResponse<
623
- AttachmentType = UR,
624
- ChannelType = UR,
625
- CommandType extends string = LiteralStringForUnion,
626
- MessageType = UR,
627
- ReactionType = UR,
628
- UserType = UR
629
- > = APIResponse & {
548
+ export type SearchAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
630
549
  results: {
631
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
550
+ message: MessageResponse<StreamChatGenerics>;
632
551
  }[];
633
552
  next?: string;
634
553
  previous?: string;
@@ -643,75 +562,49 @@ export type SearchWarning = {
643
562
  };
644
563
  export type SendFileAPIResponse = APIResponse & { file: string };
645
564
 
646
- export type SendMessageAPIResponse<
647
- AttachmentType = UR,
648
- ChannelType = UR,
649
- CommandType extends string = LiteralStringForUnion,
650
- MessageType = UR,
651
- ReactionType = UR,
652
- UserType = UR
653
- > = APIResponse & {
654
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
565
+ export type SendMessageAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
566
+ message: MessageResponse<StreamChatGenerics>;
655
567
  };
656
568
 
657
569
  export type TruncateChannelAPIResponse<
658
- ChannelType = UR,
659
- CommandType extends string = LiteralStringForUnion,
660
- UserType = UR,
661
- AttachmentType = UR,
662
- MessageType = UR,
663
- ReactionType = UR
570
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
664
571
  > = APIResponse & {
665
- channel: ChannelResponse<ChannelType, CommandType, UserType>;
666
- message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
572
+ channel: ChannelResponse<StreamChatGenerics>;
573
+ message?: MessageResponse<StreamChatGenerics>;
667
574
  };
668
575
 
669
- export type UpdateChannelAPIResponse<
670
- AttachmentType = UR,
671
- ChannelType = UR,
672
- CommandType extends string = LiteralStringForUnion,
673
- MessageType = UR,
674
- ReactionType = UR,
675
- UserType = UR
676
- > = APIResponse & {
677
- channel: ChannelResponse<ChannelType, CommandType, UserType>;
678
- members: ChannelMemberResponse<UserType>[];
679
- message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
576
+ export type UpdateChannelAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
577
+ channel: ChannelResponse<StreamChatGenerics>;
578
+ members: ChannelMemberResponse<StreamChatGenerics>[];
579
+ message?: MessageResponse<StreamChatGenerics>;
680
580
  };
681
581
 
682
- export type UpdateChannelResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
683
- Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id'> & {
582
+ export type UpdateChannelResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse &
583
+ Omit<CreateChannelOptions<StreamChatGenerics>, 'client_id' | 'connection_id'> & {
684
584
  created_at: string;
685
585
  updated_at: string;
686
586
  };
687
587
 
688
- export type UpdateCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
689
- command: UpdateCommandOptions<CommandType> &
588
+ export type UpdateCommandResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
589
+ command: UpdateCommandOptions<StreamChatGenerics> &
690
590
  CreatedAtUpdatedAt & {
691
- name: CommandVariants<CommandType>;
591
+ name: CommandVariants<StreamChatGenerics>;
692
592
  };
693
593
  };
694
594
 
695
- export type UpdateMessageAPIResponse<
696
- AttachmentType = UR,
697
- ChannelType = UR,
698
- CommandType extends string = LiteralStringForUnion,
699
- MessageType = UR,
700
- ReactionType = UR,
701
- UserType = UR
702
- > = APIResponse & {
703
- message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
595
+ export type UpdateMessageAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
596
+ message: MessageResponse<StreamChatGenerics>;
704
597
  };
705
598
 
706
- export type UsersAPIResponse<UserType = UR> = APIResponse & {
707
- users: Array<UserResponse<UserType>>;
599
+ export type UsersAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
600
+ users: Array<UserResponse<StreamChatGenerics>>;
708
601
  };
709
602
 
710
- export type UpdateUsersAPIResponse<UserType = UR> = APIResponse & {
711
- users: { [key: string]: UserResponse<UserType> };
603
+ export type UpdateUsersAPIResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = APIResponse & {
604
+ users: { [key: string]: UserResponse<StreamChatGenerics> };
712
605
  };
713
606
 
714
- export type UserResponse<UserType = UR> = User<UserType> & {
607
+ export type UserResponse<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = User<StreamChatGenerics> & {
715
608
  banned?: boolean;
716
609
  created_at?: string;
717
610
  deactivated_at?: string;
@@ -751,8 +644,8 @@ export type ReviewFlagReportOptions = {
751
644
 
752
645
  export type BannedUsersPaginationOptions = Omit<PaginationOptions, 'id_gt' | 'id_gte' | 'id_lt' | 'id_lte'>;
753
646
 
754
- export type BanUserOptions<UserType = UR> = UnBanUserOptions & {
755
- banned_by?: UserResponse<UserType>;
647
+ export type BanUserOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = UnBanUserOptions & {
648
+ banned_by?: UserResponse<StreamChatGenerics>;
756
649
  banned_by_id?: string;
757
650
  ip_ban?: boolean;
758
651
  reason?: string;
@@ -770,10 +663,10 @@ export type ChannelOptions = {
770
663
  watch?: boolean;
771
664
  };
772
665
 
773
- export type ChannelQueryOptions<ChannelType = UR, CommandType extends string = LiteralStringForUnion, UserType = UR> = {
666
+ export type ChannelQueryOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
774
667
  client_id?: string;
775
668
  connection_id?: string;
776
- data?: ChannelResponse<ChannelType, CommandType, UserType>;
669
+ data?: ChannelResponse<StreamChatGenerics>;
777
670
  members?: PaginationOptions;
778
671
  messages?: MessagePaginationOptions;
779
672
  presence?: boolean;
@@ -786,14 +679,14 @@ export type ChannelStateOptions = {
786
679
  skipInitialization?: string[];
787
680
  };
788
681
 
789
- export type CreateChannelOptions<CommandType extends string = LiteralStringForUnion> = {
682
+ export type CreateChannelOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
790
683
  automod?: ChannelConfigAutomod;
791
684
  automod_behavior?: ChannelConfigAutomodBehavior;
792
685
  automod_thresholds?: ChannelConfigAutomodThresholds;
793
686
  blocklist?: string;
794
687
  blocklist_behavior?: ChannelConfigAutomodBehavior;
795
688
  client_id?: string;
796
- commands?: CommandVariants<CommandType>[];
689
+ commands?: CommandVariants<StreamChatGenerics>[];
797
690
  connect_events?: boolean;
798
691
  connection_id?: string;
799
692
  custom_events?: boolean;
@@ -814,11 +707,11 @@ export type CreateChannelOptions<CommandType extends string = LiteralStringForUn
814
707
  url_enrichment?: boolean;
815
708
  };
816
709
 
817
- export type CreateCommandOptions<CommandType extends string = LiteralStringForUnion> = {
710
+ export type CreateCommandOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
818
711
  description: string;
819
- name: CommandVariants<CommandType>;
712
+ name: CommandVariants<StreamChatGenerics>;
820
713
  args?: string;
821
- set?: CommandVariants<CommandType>;
714
+ set?: CommandVariants<StreamChatGenerics>;
822
715
  };
823
716
 
824
717
  export type CustomPermissionOptions = {
@@ -832,49 +725,44 @@ export type CustomPermissionOptions = {
832
725
  };
833
726
 
834
727
  // TODO: rename to UpdateChannelOptions in the next major update and use it in channel._update and/or channel.update
835
- export type InviteOptions<
836
- AttachmentType = UR,
837
- ChannelType = UR,
838
- CommandType extends string = LiteralStringForUnion,
839
- MessageType = UR,
840
- ReactionType = UR,
841
- UserType = UR
842
- > = {
728
+ export type InviteOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
843
729
  accept_invite?: boolean;
844
730
  add_members?: string[];
845
731
  add_moderators?: string[];
846
732
  client_id?: string;
847
733
  connection_id?: string;
848
- data?: Omit<ChannelResponse<ChannelType, CommandType, UserType>, 'id' | 'cid'>;
734
+ data?: Omit<ChannelResponse<StreamChatGenerics>, 'id' | 'cid'>;
849
735
  demote_moderators?: string[];
850
736
  invites?: string[];
851
- message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
737
+ message?: MessageResponse<StreamChatGenerics>;
852
738
  reject_invite?: boolean;
853
739
  remove_members?: string[];
854
- user?: UserResponse<UserType>;
740
+ user?: UserResponse<StreamChatGenerics>;
855
741
  user_id?: string;
856
742
  };
857
743
 
858
744
  /** @deprecated use MarkChannelsReadOptions instead */
859
- export type MarkAllReadOptions<UserType = UR> = MarkChannelsReadOptions<UserType>;
745
+ export type MarkAllReadOptions<
746
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
747
+ > = MarkChannelsReadOptions<StreamChatGenerics>;
860
748
 
861
- export type MarkChannelsReadOptions<UserType = UR> = {
749
+ export type MarkChannelsReadOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
862
750
  client_id?: string;
863
751
  connection_id?: string;
864
752
  read_by_channel?: Record<string, string>;
865
- user?: UserResponse<UserType>;
753
+ user?: UserResponse<StreamChatGenerics>;
866
754
  user_id?: string;
867
755
  };
868
756
 
869
- export type MarkReadOptions<UserType = UR> = {
757
+ export type MarkReadOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
870
758
  client_id?: string;
871
759
  connection_id?: string;
872
760
  message_id?: string;
873
- user?: UserResponse<UserType>;
761
+ user?: UserResponse<StreamChatGenerics>;
874
762
  user_id?: string;
875
763
  };
876
764
 
877
- export type MuteUserOptions<UserType = UR> = {
765
+ export type MuteUserOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
878
766
  client_id?: string;
879
767
  connection_id?: string;
880
768
  id?: string;
@@ -882,7 +770,7 @@ export type MuteUserOptions<UserType = UR> = {
882
770
  target_user_id?: string;
883
771
  timeout?: number;
884
772
  type?: string;
885
- user?: UserResponse<UserType>;
773
+ user?: UserResponse<StreamChatGenerics>;
886
774
  user_id?: string;
887
775
  };
888
776
 
@@ -928,11 +816,11 @@ export type QueryMembersOptions = {
928
816
  user_id_lte?: string;
929
817
  };
930
818
 
931
- export type SearchOptions<MessageType = UR> = {
819
+ export type SearchOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
932
820
  limit?: number;
933
821
  next?: string;
934
822
  offset?: number;
935
- sort?: SearchMessageSort<MessageType>;
823
+ sort?: SearchMessageSort<StreamChatGenerics>;
936
824
  };
937
825
 
938
826
  export type StreamChatOptions = AxiosRequestConfig & {
@@ -974,18 +862,18 @@ export type UnBanUserOptions = {
974
862
  };
975
863
 
976
864
  // TODO: rename to UpdateChannelTypeOptions in the next major update
977
- export type UpdateChannelOptions<CommandType extends string = LiteralStringForUnion> = Omit<
978
- CreateChannelOptions<CommandType>,
865
+ export type UpdateChannelOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Omit<
866
+ CreateChannelOptions<StreamChatGenerics>,
979
867
  'name'
980
868
  > & {
981
869
  created_at?: string;
982
870
  updated_at?: string;
983
871
  };
984
872
 
985
- export type UpdateCommandOptions<CommandType extends string = LiteralStringForUnion> = {
873
+ export type UpdateCommandOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
986
874
  description: string;
987
875
  args?: string;
988
- set?: CommandVariants<CommandType>;
876
+ set?: CommandVariants<StreamChatGenerics>;
989
877
  };
990
878
 
991
879
  export type UserOptions = {
@@ -1003,17 +891,9 @@ export type ConnectionChangeEvent = {
1003
891
  online?: boolean;
1004
892
  };
1005
893
 
1006
- export type Event<
1007
- AttachmentType extends UR = UR,
1008
- ChannelType extends UR = UR,
1009
- CommandType extends string = LiteralStringForUnion,
1010
- EventType extends UR = UR,
1011
- MessageType extends UR = UR,
1012
- ReactionType extends UR = UR,
1013
- UserType extends UR = UR
1014
- > = EventType & {
894
+ export type Event<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = StreamChatGenerics['eventType'] & {
1015
895
  type: EventTypes;
1016
- channel?: ChannelResponse<ChannelType, CommandType, UserType>;
896
+ channel?: ChannelResponse<StreamChatGenerics>;
1017
897
  channel_id?: string;
1018
898
  channel_type?: string;
1019
899
  cid?: string;
@@ -1022,80 +902,33 @@ export type Event<
1022
902
  created_at?: string;
1023
903
  hard_delete?: boolean;
1024
904
  mark_messages_deleted?: boolean;
1025
- me?: OwnUserResponse<ChannelType, CommandType, UserType>;
1026
- member?: ChannelMemberResponse<UserType>;
1027
- message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
905
+ me?: OwnUserResponse<StreamChatGenerics>;
906
+ member?: ChannelMemberResponse<StreamChatGenerics>;
907
+ message?: MessageResponse<StreamChatGenerics>;
1028
908
  online?: boolean;
1029
909
  parent_id?: string;
1030
- reaction?: ReactionResponse<ReactionType, UserType>;
910
+ reaction?: ReactionResponse<StreamChatGenerics>;
1031
911
  received_at?: string | Date;
1032
912
  team?: string;
1033
913
  total_unread_count?: number;
1034
914
  unread_channels?: number;
1035
915
  unread_count?: number;
1036
- user?: UserResponse<UserType>;
916
+ user?: UserResponse<StreamChatGenerics>;
1037
917
  user_id?: string;
1038
918
  watcher_count?: number;
1039
919
  };
1040
920
 
1041
- export type UserCustomEvent<EventType extends UR = UR> = EventType & {
921
+ export type UserCustomEvent<
922
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
923
+ > = StreamChatGenerics['eventType'] & {
1042
924
  type: string;
1043
925
  };
1044
926
 
1045
- export type EventHandler<
1046
- AttachmentType extends UR = UR,
1047
- ChannelType extends UR = UR,
1048
- CommandType extends string = LiteralStringForUnion,
1049
- EventType extends UR = UR,
1050
- MessageType extends UR = UR,
1051
- ReactionType extends UR = UR,
1052
- UserType extends UR = UR
1053
- > = (event: Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>) => void;
927
+ export type EventHandler<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = (
928
+ event: Event<StreamChatGenerics>,
929
+ ) => void;
1054
930
 
1055
- export type EventTypes =
1056
- | 'all'
1057
- | 'channel.created'
1058
- | 'channel.deleted'
1059
- | 'channel.hidden'
1060
- | 'channel.muted'
1061
- | 'channel.truncated'
1062
- | 'channel.unmuted'
1063
- | 'channel.updated'
1064
- | 'channel.visible'
1065
- | 'transport.changed' // ws vs longpoll
1066
- | 'connection.changed'
1067
- | 'connection.recovered'
1068
- | 'health.check'
1069
- | 'member.added'
1070
- | 'member.removed'
1071
- | 'member.updated'
1072
- | 'message.deleted'
1073
- | 'message.new'
1074
- | 'message.read'
1075
- | 'message.updated'
1076
- | 'notification.added_to_channel'
1077
- | 'notification.channel_deleted'
1078
- | 'notification.channel_mutes_updated'
1079
- | 'notification.channel_truncated'
1080
- | 'notification.invite_accepted'
1081
- | 'notification.invite_rejected'
1082
- | 'notification.invited'
1083
- | 'notification.mark_read'
1084
- | 'notification.message_new'
1085
- | 'notification.mutes_updated'
1086
- | 'notification.removed_from_channel'
1087
- | 'reaction.deleted'
1088
- | 'reaction.new'
1089
- | 'reaction.updated'
1090
- | 'typing.start'
1091
- | 'typing.stop'
1092
- | 'user.banned'
1093
- | 'user.deleted'
1094
- | 'user.presence.changed'
1095
- | 'user.unbanned'
1096
- | 'user.updated'
1097
- | 'user.watching.start'
1098
- | 'user.watching.stop';
931
+ export type EventTypes = 'all' | keyof typeof EVENT_MAP;
1099
932
 
1100
933
  /**
1101
934
  * Filter Types
@@ -1131,11 +964,13 @@ export type MessageFlagsFilters = QueryFilters<
1131
964
  >;
1132
965
 
1133
966
  export type FlagReportsFiltersOptions = {
967
+ channel_cid?: string;
1134
968
  is_reviewed?: boolean;
1135
969
  message_id?: string;
1136
970
  report_id?: string;
1137
971
  review_result?: string;
1138
972
  reviewed_by?: string;
973
+ team?: string;
1139
974
  user_id?: string;
1140
975
  };
1141
976
 
@@ -1160,6 +995,14 @@ export type FlagReportsFilters = QueryFilters<
1160
995
  message_id?:
1161
996
  | RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['message_id']>, '$eq' | '$in'>>
1162
997
  | PrimitiveFilter<FlagReportsFiltersOptions['message_id']>;
998
+ } & {
999
+ channel_cid?:
1000
+ | RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['channel_cid']>, '$eq' | '$in'>>
1001
+ | PrimitiveFilter<FlagReportsFiltersOptions['channel_cid']>;
1002
+ } & {
1003
+ team?:
1004
+ | RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['team']>, '$eq' | '$in'>>
1005
+ | PrimitiveFilter<FlagReportsFiltersOptions['team']>;
1163
1006
  } & {
1164
1007
  [Key in keyof Omit<
1165
1008
  FlagReportsFiltersOptions,
@@ -1195,12 +1038,8 @@ export type BannedUsersFilters = QueryFilters<
1195
1038
  }
1196
1039
  >;
1197
1040
 
1198
- export type ChannelFilters<
1199
- ChannelType = UR,
1200
- CommandType extends string = LiteralStringForUnion,
1201
- UserType = UR
1202
- > = QueryFilters<
1203
- ContainsOperator<ChannelType> & {
1041
+ export type ChannelFilters<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = QueryFilters<
1042
+ ContainsOperator<StreamChatGenerics['channelType']> & {
1204
1043
  members?:
1205
1044
  | RequireOnlyOne<Pick<QueryFilter<string>, '$in' | '$nin'>>
1206
1045
  | RequireOnlyOne<Pick<QueryFilter<string[]>, '$eq'>>
@@ -1209,14 +1048,47 @@ export type ChannelFilters<
1209
1048
  name?:
1210
1049
  | RequireOnlyOne<
1211
1050
  {
1212
- $autocomplete?: ChannelResponse<ChannelType, CommandType, UserType>['name'];
1213
- } & QueryFilter<ChannelResponse<ChannelType, CommandType, UserType>['name']>
1051
+ $autocomplete?: ChannelResponse<StreamChatGenerics>['name'];
1052
+ } & QueryFilter<ChannelResponse<StreamChatGenerics>['name']>
1214
1053
  >
1215
- | PrimitiveFilter<ChannelResponse<ChannelType, CommandType, UserType>['name']>;
1054
+ | PrimitiveFilter<ChannelResponse<StreamChatGenerics>['name']>;
1216
1055
  } & {
1217
- [Key in keyof Omit<ChannelResponse<{}, CommandType, UserType>, 'name' | 'members'>]:
1218
- | RequireOnlyOne<QueryFilter<ChannelResponse<{}, CommandType, UserType>[Key]>>
1219
- | PrimitiveFilter<ChannelResponse<{}, CommandType, UserType>[Key]>;
1056
+ [Key in keyof Omit<
1057
+ ChannelResponse<{
1058
+ attachmentType: StreamChatGenerics['attachmentType'];
1059
+ channelType: {};
1060
+ commandType: StreamChatGenerics['commandType'];
1061
+ eventType: StreamChatGenerics['eventType'];
1062
+ messageType: StreamChatGenerics['messageType'];
1063
+ reactionType: StreamChatGenerics['reactionType'];
1064
+ userType: StreamChatGenerics['userType'];
1065
+ }>,
1066
+ 'name' | 'members'
1067
+ >]:
1068
+ | RequireOnlyOne<
1069
+ QueryFilter<
1070
+ ChannelResponse<{
1071
+ attachmentType: StreamChatGenerics['attachmentType'];
1072
+ channelType: {};
1073
+ commandType: StreamChatGenerics['commandType'];
1074
+ eventType: StreamChatGenerics['eventType'];
1075
+ messageType: StreamChatGenerics['messageType'];
1076
+ reactionType: StreamChatGenerics['reactionType'];
1077
+ userType: StreamChatGenerics['userType'];
1078
+ }>[Key]
1079
+ >
1080
+ >
1081
+ | PrimitiveFilter<
1082
+ ChannelResponse<{
1083
+ attachmentType: StreamChatGenerics['attachmentType'];
1084
+ channelType: {};
1085
+ commandType: StreamChatGenerics['commandType'];
1086
+ eventType: StreamChatGenerics['eventType'];
1087
+ messageType: StreamChatGenerics['messageType'];
1088
+ reactionType: StreamChatGenerics['reactionType'];
1089
+ userType: StreamChatGenerics['userType'];
1090
+ }>[Key]
1091
+ >;
1220
1092
  }
1221
1093
  >;
1222
1094
 
@@ -1234,43 +1106,53 @@ export type ContainsOperator<CustomType = {}> = {
1234
1106
  : RequireOnlyOne<QueryFilter<CustomType[Key]>> | PrimitiveFilter<CustomType[Key]>;
1235
1107
  };
1236
1108
 
1237
- export type MessageFilters<
1238
- AttachmentType = UR,
1239
- ChannelType = UR,
1240
- CommandType extends string = LiteralStringForUnion,
1241
- MessageType = UR,
1242
- ReactionType = UR,
1243
- UserType = UR
1244
- > = QueryFilters<
1245
- ContainsOperator<MessageType> & {
1109
+ export type MessageFilters<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = QueryFilters<
1110
+ ContainsOperator<StreamChatGenerics['messageType']> & {
1246
1111
  text?:
1247
1112
  | RequireOnlyOne<
1248
1113
  {
1249
- $autocomplete?: MessageResponse<
1250
- AttachmentType,
1251
- ChannelType,
1252
- CommandType,
1253
- MessageType,
1254
- ReactionType,
1255
- UserType
1256
- >['text'];
1257
- $q?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>['text'];
1258
- } & QueryFilter<
1259
- MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>['text']
1260
- >
1114
+ $autocomplete?: MessageResponse<StreamChatGenerics>['text'];
1115
+ $q?: MessageResponse<StreamChatGenerics>['text'];
1116
+ } & QueryFilter<MessageResponse<StreamChatGenerics>['text']>
1261
1117
  >
1262
- | PrimitiveFilter<
1263
- MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>['text']
1264
- >;
1118
+ | PrimitiveFilter<MessageResponse<StreamChatGenerics>['text']>;
1265
1119
  } & {
1266
1120
  [Key in keyof Omit<
1267
- MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>,
1121
+ MessageResponse<{
1122
+ attachmentType: StreamChatGenerics['attachmentType'];
1123
+ channelType: StreamChatGenerics['channelType'];
1124
+ commandType: StreamChatGenerics['commandType'];
1125
+ eventType: StreamChatGenerics['eventType'];
1126
+ messageType: {};
1127
+ reactionType: StreamChatGenerics['reactionType'];
1128
+ userType: StreamChatGenerics['userType'];
1129
+ }>,
1268
1130
  'text'
1269
1131
  >]?:
1270
1132
  | RequireOnlyOne<
1271
- QueryFilter<MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>[Key]>
1133
+ QueryFilter<
1134
+ MessageResponse<{
1135
+ attachmentType: StreamChatGenerics['attachmentType'];
1136
+ channelType: StreamChatGenerics['channelType'];
1137
+ commandType: StreamChatGenerics['commandType'];
1138
+ eventType: StreamChatGenerics['eventType'];
1139
+ messageType: {};
1140
+ reactionType: StreamChatGenerics['reactionType'];
1141
+ userType: StreamChatGenerics['userType'];
1142
+ }>[Key]
1143
+ >
1272
1144
  >
1273
- | PrimitiveFilter<MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>[Key]>;
1145
+ | PrimitiveFilter<
1146
+ MessageResponse<{
1147
+ attachmentType: StreamChatGenerics['attachmentType'];
1148
+ channelType: StreamChatGenerics['channelType'];
1149
+ commandType: StreamChatGenerics['commandType'];
1150
+ eventType: StreamChatGenerics['eventType'];
1151
+ messageType: {};
1152
+ reactionType: StreamChatGenerics['reactionType'];
1153
+ userType: StreamChatGenerics['userType'];
1154
+ }>[Key]
1155
+ >;
1274
1156
  }
1275
1157
  >;
1276
1158
 
@@ -1307,29 +1189,72 @@ export type QueryLogicalOperators<Operators> = {
1307
1189
  $or?: ArrayTwoOrMore<QueryFilters<Operators>>;
1308
1190
  };
1309
1191
 
1310
- export type UserFilters<UserType = UR> = QueryFilters<
1311
- ContainsOperator<UserType> & {
1192
+ export type UserFilters<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = QueryFilters<
1193
+ ContainsOperator<StreamChatGenerics['userType']> & {
1312
1194
  id?:
1313
- | RequireOnlyOne<{ $autocomplete?: UserResponse<UserType>['id'] } & QueryFilter<UserResponse<UserType>['id']>>
1314
- | PrimitiveFilter<UserResponse<UserType>['id']>;
1195
+ | RequireOnlyOne<
1196
+ { $autocomplete?: UserResponse<StreamChatGenerics>['id'] } & QueryFilter<
1197
+ UserResponse<StreamChatGenerics>['id']
1198
+ >
1199
+ >
1200
+ | PrimitiveFilter<UserResponse<StreamChatGenerics>['id']>;
1315
1201
  name?:
1316
- | RequireOnlyOne<{ $autocomplete?: UserResponse<UserType>['name'] } & QueryFilter<UserResponse<UserType>['name']>>
1317
- | PrimitiveFilter<UserResponse<UserType>['name']>;
1202
+ | RequireOnlyOne<
1203
+ { $autocomplete?: UserResponse<StreamChatGenerics>['name'] } & QueryFilter<
1204
+ UserResponse<StreamChatGenerics>['name']
1205
+ >
1206
+ >
1207
+ | PrimitiveFilter<UserResponse<StreamChatGenerics>['name']>;
1318
1208
  teams?:
1319
1209
  | RequireOnlyOne<{
1320
1210
  $contains?: PrimitiveFilter<string>;
1321
- $eq?: PrimitiveFilter<UserResponse<UserType>['teams']>;
1211
+ $eq?: PrimitiveFilter<UserResponse<StreamChatGenerics>['teams']>;
1322
1212
  }>
1323
- | PrimitiveFilter<UserResponse<UserType>['teams']>;
1213
+ | PrimitiveFilter<UserResponse<StreamChatGenerics>['teams']>;
1324
1214
  username?:
1325
1215
  | RequireOnlyOne<
1326
- { $autocomplete?: UserResponse<UserType>['username'] } & QueryFilter<UserResponse<UserType>['username']>
1216
+ { $autocomplete?: UserResponse<StreamChatGenerics>['username'] } & QueryFilter<
1217
+ UserResponse<StreamChatGenerics>['username']
1218
+ >
1327
1219
  >
1328
- | PrimitiveFilter<UserResponse<UserType>['username']>;
1220
+ | PrimitiveFilter<UserResponse<StreamChatGenerics>['username']>;
1329
1221
  } & {
1330
- [Key in keyof Omit<UserResponse<{}>, 'id' | 'name' | 'teams' | 'username'>]?:
1331
- | RequireOnlyOne<QueryFilter<UserResponse<{}>[Key]>>
1332
- | PrimitiveFilter<UserResponse<{}>[Key]>;
1222
+ [Key in keyof Omit<
1223
+ UserResponse<{
1224
+ attachmentType: StreamChatGenerics['attachmentType'];
1225
+ channelType: StreamChatGenerics['channelType'];
1226
+ commandType: StreamChatGenerics['commandType'];
1227
+ eventType: StreamChatGenerics['eventType'];
1228
+ messageType: StreamChatGenerics['messageType'];
1229
+ reactionType: StreamChatGenerics['reactionType'];
1230
+ userType: {};
1231
+ }>,
1232
+ 'id' | 'name' | 'teams' | 'username'
1233
+ >]?:
1234
+ | RequireOnlyOne<
1235
+ QueryFilter<
1236
+ UserResponse<{
1237
+ attachmentType: StreamChatGenerics['attachmentType'];
1238
+ channelType: StreamChatGenerics['channelType'];
1239
+ commandType: StreamChatGenerics['commandType'];
1240
+ eventType: StreamChatGenerics['eventType'];
1241
+ messageType: StreamChatGenerics['messageType'];
1242
+ reactionType: StreamChatGenerics['reactionType'];
1243
+ userType: {};
1244
+ }>[Key]
1245
+ >
1246
+ >
1247
+ | PrimitiveFilter<
1248
+ UserResponse<{
1249
+ attachmentType: StreamChatGenerics['attachmentType'];
1250
+ channelType: StreamChatGenerics['channelType'];
1251
+ commandType: StreamChatGenerics['commandType'];
1252
+ eventType: StreamChatGenerics['eventType'];
1253
+ messageType: StreamChatGenerics['messageType'];
1254
+ reactionType: StreamChatGenerics['reactionType'];
1255
+ userType: {};
1256
+ }>[Key]
1257
+ >;
1333
1258
  }
1334
1259
  >;
1335
1260
 
@@ -1341,9 +1266,13 @@ export type BannedUsersSort = BannedUsersSortBase | Array<BannedUsersSortBase>;
1341
1266
 
1342
1267
  export type BannedUsersSortBase = { created_at?: AscDesc };
1343
1268
 
1344
- export type ChannelSort<ChannelType = UR> = ChannelSortBase<ChannelType> | Array<ChannelSortBase<ChannelType>>;
1269
+ export type ChannelSort<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1270
+ | ChannelSortBase<StreamChatGenerics>
1271
+ | Array<ChannelSortBase<StreamChatGenerics>>;
1345
1272
 
1346
- export type ChannelSortBase<ChannelType = UR> = Sort<ChannelType> & {
1273
+ export type ChannelSortBase<
1274
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1275
+ > = Sort<StreamChatGenerics> & {
1347
1276
  created_at?: AscDesc;
1348
1277
  has_unread?: AscDesc;
1349
1278
  last_message_at?: AscDesc;
@@ -1360,13 +1289,17 @@ export type Sort<T> = {
1360
1289
  [P in keyof T]?: AscDesc;
1361
1290
  };
1362
1291
 
1363
- export type UserSort<UserType = UR> = Sort<UserResponse<UserType>> | Array<Sort<UserResponse<UserType>>>;
1292
+ export type UserSort<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1293
+ | Sort<UserResponse<StreamChatGenerics>>
1294
+ | Array<Sort<UserResponse<StreamChatGenerics>>>;
1364
1295
 
1365
- export type MemberSort<UserType = UR> =
1366
- | Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>>
1367
- | Array<Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>>>;
1296
+ export type MemberSort<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1297
+ | Sort<Pick<UserResponse<StreamChatGenerics>, 'id' | 'created_at' | 'name'>>
1298
+ | Array<Sort<Pick<UserResponse<StreamChatGenerics>, 'id' | 'created_at' | 'name'>>>;
1368
1299
 
1369
- export type SearchMessageSortBase<MessageType = UR> = Sort<MessageType> & {
1300
+ export type SearchMessageSortBase<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Sort<
1301
+ StreamChatGenerics['messageType']
1302
+ > & {
1370
1303
  attachments?: AscDesc;
1371
1304
  'attachments.type'?: AscDesc;
1372
1305
  created_at?: AscDesc;
@@ -1382,15 +1315,15 @@ export type SearchMessageSortBase<MessageType = UR> = Sort<MessageType> & {
1382
1315
  'user.id'?: AscDesc;
1383
1316
  };
1384
1317
 
1385
- export type SearchMessageSort<MessageType = UR> =
1386
- | SearchMessageSortBase<MessageType>
1387
- | Array<SearchMessageSortBase<MessageType>>;
1318
+ export type SearchMessageSort<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1319
+ | SearchMessageSortBase<StreamChatGenerics>
1320
+ | Array<SearchMessageSortBase<StreamChatGenerics>>;
1388
1321
 
1389
- export type QuerySort<ChannelType = UR, UserType = UR, MessageType = UR> =
1322
+ export type QuerySort<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1390
1323
  | BannedUsersSort
1391
- | ChannelSort<ChannelType>
1392
- | SearchMessageSort<MessageType>
1393
- | UserSort<UserType>;
1324
+ | ChannelSort<StreamChatGenerics>
1325
+ | SearchMessageSort<StreamChatGenerics>
1326
+ | UserSort<StreamChatGenerics>;
1394
1327
 
1395
1328
  /**
1396
1329
  * Base Types
@@ -1466,7 +1399,9 @@ export type AppSettings = {
1466
1399
  };
1467
1400
  };
1468
1401
 
1469
- export type Attachment<T = UR> = T & {
1402
+ export type Attachment<
1403
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1404
+ > = StreamChatGenerics['attachmentType'] & {
1470
1405
  actions?: Action[];
1471
1406
  asset_url?: string;
1472
1407
  author_icon?: string;
@@ -1475,9 +1410,11 @@ export type Attachment<T = UR> = T & {
1475
1410
  color?: string;
1476
1411
  fallback?: string;
1477
1412
  fields?: Field[];
1413
+ file_size?: number | string;
1478
1414
  footer?: string;
1479
1415
  footer_icon?: string;
1480
1416
  image_url?: string;
1417
+ mime_type?: string;
1481
1418
  og_scrape_url?: string;
1482
1419
  original_height?: number;
1483
1420
  original_width?: number;
@@ -1507,9 +1444,9 @@ export type BlockList = {
1507
1444
  words: string[];
1508
1445
  };
1509
1446
 
1510
- export type ChannelConfig<CommandType extends string = LiteralStringForUnion> = ChannelConfigFields &
1447
+ export type ChannelConfig<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = ChannelConfigFields &
1511
1448
  CreatedAtUpdatedAt & {
1512
- commands?: CommandVariants<CommandType>[];
1449
+ commands?: CommandVariants<StreamChatGenerics>[];
1513
1450
  };
1514
1451
 
1515
1452
  export type ChannelConfigAutomod = '' | 'AI' | 'disabled' | 'simple';
@@ -1543,17 +1480,21 @@ export type ChannelConfigFields = {
1543
1480
  url_enrichment?: boolean;
1544
1481
  };
1545
1482
 
1546
- export type ChannelConfigWithInfo<CommandType extends string = LiteralStringForUnion> = ChannelConfigFields &
1483
+ export type ChannelConfigWithInfo<
1484
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1485
+ > = ChannelConfigFields &
1547
1486
  CreatedAtUpdatedAt & {
1548
- commands?: CommandResponse<CommandType>[];
1487
+ commands?: CommandResponse<StreamChatGenerics>[];
1549
1488
  };
1550
1489
 
1551
- export type ChannelData<ChannelType = UR> = ChannelType & {
1490
+ export type ChannelData<
1491
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1492
+ > = StreamChatGenerics['channelType'] & {
1552
1493
  members?: string[];
1553
1494
  name?: string;
1554
1495
  };
1555
1496
 
1556
- export type ChannelMembership<UserType = UR> = {
1497
+ export type ChannelMembership<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1557
1498
  banned?: boolean;
1558
1499
  channel_role?: Role;
1559
1500
  created_at?: string;
@@ -1561,16 +1502,12 @@ export type ChannelMembership<UserType = UR> = {
1561
1502
  role?: string;
1562
1503
  shadow_banned?: boolean;
1563
1504
  updated_at?: string;
1564
- user?: UserResponse<UserType>;
1505
+ user?: UserResponse<StreamChatGenerics>;
1565
1506
  };
1566
1507
 
1567
- export type ChannelMute<
1568
- ChannelType extends UR = UR,
1569
- CommandType extends string = LiteralStringForUnion,
1570
- UserType extends UR = UR
1571
- > = {
1572
- user: UserResponse<UserType>;
1573
- channel?: ChannelResponse<ChannelType, CommandType, UserType>;
1508
+ export type ChannelMute<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1509
+ user: UserResponse<StreamChatGenerics>;
1510
+ channel?: ChannelResponse<StreamChatGenerics>;
1574
1511
  created_at?: string;
1575
1512
  expires?: string;
1576
1513
  updated_at?: string;
@@ -1584,20 +1521,20 @@ export type ChannelRole = {
1584
1521
  same_team?: boolean;
1585
1522
  };
1586
1523
 
1587
- export type CheckPushInput<UserType = UR> = {
1524
+ export type CheckPushInput<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1588
1525
  apn_template?: string;
1589
1526
  client_id?: string;
1590
1527
  connection_id?: string;
1591
1528
  firebase_data_template?: string;
1592
1529
  firebase_template?: string;
1593
1530
  message_id?: string;
1594
- user?: UserResponse<UserType>;
1531
+ user?: UserResponse<StreamChatGenerics>;
1595
1532
  user_id?: string;
1596
1533
  };
1597
1534
 
1598
1535
  export type PushProvider = 'apn' | 'firebase' | 'huawei' | 'xiaomi';
1599
1536
 
1600
- export type CommandVariants<CommandType extends string = LiteralStringForUnion> =
1537
+ export type CommandVariants<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> =
1601
1538
  | 'all'
1602
1539
  | 'ban'
1603
1540
  | 'fun_set'
@@ -1606,21 +1543,17 @@ export type CommandVariants<CommandType extends string = LiteralStringForUnion>
1606
1543
  | 'mute'
1607
1544
  | 'unban'
1608
1545
  | 'unmute'
1609
- | CommandType;
1546
+ | StreamChatGenerics['commandType'];
1610
1547
 
1611
- export type Configs<CommandType extends string = LiteralStringForUnion> = {
1612
- [channel_type: string]: ChannelConfigWithInfo<CommandType> | undefined;
1548
+ export type Configs<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1549
+ [channel_type: string]: ChannelConfigWithInfo<StreamChatGenerics> | undefined;
1613
1550
  };
1614
1551
 
1615
- export type ConnectionOpen<
1616
- ChannelType extends UR = UR,
1617
- CommandType extends string = LiteralStringForUnion,
1618
- UserType extends UR = UR
1619
- > = {
1552
+ export type ConnectionOpen<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1620
1553
  connection_id: string;
1621
1554
  cid?: string;
1622
1555
  created_at?: string;
1623
- me?: OwnUserResponse<ChannelType, CommandType, UserType>;
1556
+ me?: OwnUserResponse<StreamChatGenerics>;
1624
1557
  type?: string;
1625
1558
  };
1626
1559
 
@@ -1629,9 +1562,9 @@ export type CreatedAtUpdatedAt = {
1629
1562
  updated_at: string;
1630
1563
  };
1631
1564
 
1632
- export type Device<UserType = UR> = DeviceFields & {
1565
+ export type Device<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = DeviceFields & {
1633
1566
  provider?: string;
1634
- user?: UserResponse<UserType>;
1567
+ user?: UserResponse<StreamChatGenerics>;
1635
1568
  user_id?: string;
1636
1569
  };
1637
1570
 
@@ -1785,15 +1718,17 @@ export type LogLevel = 'info' | 'error' | 'warn';
1785
1718
 
1786
1719
  export type Logger = (logLevel: LogLevel, message: string, extraData?: Record<string, unknown>) => void;
1787
1720
 
1788
- export type Message<AttachmentType = UR, MessageType = UR, UserType = UR> = Partial<
1789
- MessageBase<AttachmentType, MessageType, UserType>
1721
+ export type Message<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Partial<
1722
+ MessageBase<StreamChatGenerics>
1790
1723
  > & {
1791
1724
  mentioned_users?: string[];
1792
1725
  };
1793
1726
 
1794
- export type MessageBase<AttachmentType = UR, MessageType = UR, UserType = UR> = MessageType & {
1727
+ export type MessageBase<
1728
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1729
+ > = StreamChatGenerics['messageType'] & {
1795
1730
  id: string;
1796
- attachments?: Attachment<AttachmentType>[];
1731
+ attachments?: Attachment<StreamChatGenerics>[];
1797
1732
  html?: string;
1798
1733
  mml?: string;
1799
1734
  parent_id?: string;
@@ -1803,38 +1738,38 @@ export type MessageBase<AttachmentType = UR, MessageType = UR, UserType = UR> =
1803
1738
  quoted_message_id?: string;
1804
1739
  show_in_channel?: boolean;
1805
1740
  text?: string;
1806
- user?: UserResponse<UserType> | null;
1741
+ user?: UserResponse<StreamChatGenerics> | null;
1807
1742
  user_id?: string;
1808
1743
  };
1809
1744
 
1810
1745
  export type MessageLabel = 'deleted' | 'ephemeral' | 'error' | 'regular' | 'reply' | 'system';
1811
1746
 
1812
- export type Mute<UserType = UR> = {
1747
+ export type Mute<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1813
1748
  created_at: string;
1814
- target: UserResponse<UserType>;
1749
+ target: UserResponse<StreamChatGenerics>;
1815
1750
  updated_at: string;
1816
- user: UserResponse<UserType>;
1751
+ user: UserResponse<StreamChatGenerics>;
1817
1752
  };
1818
1753
 
1819
- export type PartialUpdateChannel<ChannelType = UR> = {
1820
- set?: Partial<ChannelResponse<ChannelType>>;
1821
- unset?: Array<keyof ChannelResponse<ChannelType>>;
1754
+ export type PartialUpdateChannel<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1755
+ set?: Partial<ChannelResponse<StreamChatGenerics>>;
1756
+ unset?: Array<keyof ChannelResponse<StreamChatGenerics>>;
1822
1757
  };
1823
1758
 
1824
- export type PartialUserUpdate<UserType = UR> = {
1759
+ export type PartialUserUpdate<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1825
1760
  id: string;
1826
- set?: Partial<UserResponse<UserType>>;
1827
- unset?: Array<keyof UserResponse<UserType>>;
1761
+ set?: Partial<UserResponse<StreamChatGenerics>>;
1762
+ unset?: Array<keyof UserResponse<StreamChatGenerics>>;
1828
1763
  };
1829
1764
 
1830
- export type MessageUpdatableFields<MessageType = UR> = Omit<
1831
- MessageResponse<MessageType>,
1765
+ export type MessageUpdatableFields<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Omit<
1766
+ MessageResponse<StreamChatGenerics>,
1832
1767
  'cid' | 'created_at' | 'updated_at' | 'deleted_at' | 'user' | 'user_id'
1833
1768
  >;
1834
1769
 
1835
- export type PartialMessageUpdate<MessageType = UR> = {
1836
- set?: Partial<MessageUpdatableFields<MessageType>>;
1837
- unset?: Array<keyof MessageUpdatableFields<MessageType>>;
1770
+ export type PartialMessageUpdate<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
1771
+ set?: Partial<MessageUpdatableFields<StreamChatGenerics>>;
1772
+ unset?: Array<keyof MessageUpdatableFields<StreamChatGenerics>>;
1838
1773
  };
1839
1774
 
1840
1775
  export type PermissionAPIObject = {
@@ -1878,11 +1813,13 @@ export type RateLimitsInfo = {
1878
1813
 
1879
1814
  export type RateLimitsMap = Record<EndpointName, RateLimitsInfo>;
1880
1815
 
1881
- export type Reaction<ReactionType = UR, UserType = UR> = ReactionType & {
1816
+ export type Reaction<
1817
+ StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
1818
+ > = StreamChatGenerics['reactionType'] & {
1882
1819
  type: string;
1883
1820
  message_id?: string;
1884
1821
  score?: number;
1885
- user?: UserResponse<UserType> | null;
1822
+ user?: UserResponse<StreamChatGenerics> | null;
1886
1823
  user_id?: string;
1887
1824
  };
1888
1825
 
@@ -1906,29 +1843,18 @@ export type Resource =
1906
1843
  | 'UpdateUser'
1907
1844
  | 'UploadAttachment';
1908
1845
 
1909
- export type SearchPayload<
1910
- AttachmentType = UR,
1911
- ChannelType = UR,
1912
- CommandType extends string = LiteralStringForUnion,
1913
- MessageType = UR,
1914
- ReactionType = UR,
1915
- UserType = UR
1916
- > = Omit<SearchOptions<MessageType>, 'sort'> & {
1846
+ export type SearchPayload<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Omit<
1847
+ SearchOptions<StreamChatGenerics>,
1848
+ 'sort'
1849
+ > & {
1917
1850
  client_id?: string;
1918
1851
  connection_id?: string;
1919
- filter_conditions?: ChannelFilters<ChannelType, CommandType, UserType>;
1920
- message_filter_conditions?: MessageFilters<
1921
- AttachmentType,
1922
- ChannelType,
1923
- CommandType,
1924
- MessageType,
1925
- ReactionType,
1926
- UserType
1927
- >;
1852
+ filter_conditions?: ChannelFilters<StreamChatGenerics>;
1853
+ message_filter_conditions?: MessageFilters<StreamChatGenerics>;
1928
1854
  query?: string;
1929
1855
  sort?: Array<{
1930
1856
  direction: AscDesc;
1931
- field: keyof SearchMessageSortBase<MessageType>;
1857
+ field: keyof SearchMessageSortBase<StreamChatGenerics>;
1932
1858
  }>;
1933
1859
  };
1934
1860
 
@@ -2024,19 +1950,12 @@ export type ReservedMessageFields =
2024
1950
  | 'user'
2025
1951
  | '__html';
2026
1952
 
2027
- export type UpdatedMessage<
2028
- AttachmentType = UR,
2029
- ChannelType = UR,
2030
- CommandType extends string = LiteralStringForUnion,
2031
- MessageType = UR,
2032
- ReactionType = UR,
2033
- UserType = UR
2034
- > = Omit<
2035
- MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>,
1953
+ export type UpdatedMessage<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = Omit<
1954
+ MessageResponse<StreamChatGenerics>,
2036
1955
  'mentioned_users'
2037
1956
  > & { mentioned_users?: string[] };
2038
1957
 
2039
- export type User<UserType = UR> = UserType & {
1958
+ export type User<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = StreamChatGenerics['userType'] & {
2040
1959
  id: string;
2041
1960
  anon?: boolean;
2042
1961
  name?: string;
@@ -2131,9 +2050,44 @@ export type TaskStatus = {
2131
2050
  result?: UR;
2132
2051
  };
2133
2052
 
2134
- export type TruncateOptions<AttachmentType, MessageType, UserType> = {
2053
+ export type TruncateOptions<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
2135
2054
  hard_delete?: boolean;
2136
- message?: Message<AttachmentType, MessageType, UserType>;
2055
+ message?: Message<StreamChatGenerics>;
2137
2056
  skip_push?: boolean;
2138
2057
  truncated_at?: Date;
2139
2058
  };
2059
+
2060
+ export type CreateImportResponse = {
2061
+ import_task: ImportTask;
2062
+ upload_url: string;
2063
+ };
2064
+
2065
+ export type GetImportResponse = {
2066
+ import_task: ImportTask;
2067
+ };
2068
+
2069
+ export type ListImportsPaginationOptions = {
2070
+ limit?: number;
2071
+ offset?: number;
2072
+ };
2073
+
2074
+ export type ListImportsResponse = {
2075
+ import_tasks: ImportTask[];
2076
+ };
2077
+
2078
+ export type ImportTaskHistory = {
2079
+ created_at: string;
2080
+ next_state: string;
2081
+ prev_state: string;
2082
+ };
2083
+
2084
+ export type ImportTask = {
2085
+ created_at: string;
2086
+ filename: string;
2087
+ history: ImportTaskHistory[];
2088
+ id: string;
2089
+ state: string;
2090
+ updated_at: string;
2091
+ result?: UR;
2092
+ size?: number;
2093
+ };