stream-chat 4.4.3 → 5.1.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 (52) hide show
  1. package/README.md +4 -13
  2. package/dist/browser.es.js +1954 -1288
  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 +1954 -1288
  7. package/dist/browser.js.map +1 -1
  8. package/dist/index.es.js +1954 -1288
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/index.js +1954 -1288
  11. package/dist/index.js.map +1 -1
  12. package/dist/types/base64.d.ts.map +1 -1
  13. package/dist/types/channel.d.ts +31 -15
  14. package/dist/types/channel.d.ts.map +1 -1
  15. package/dist/types/channel_state.d.ts +2 -2
  16. package/dist/types/channel_state.d.ts.map +1 -1
  17. package/dist/types/client.d.ts +52 -43
  18. package/dist/types/client.d.ts.map +1 -1
  19. package/dist/types/client_state.d.ts +2 -2
  20. package/dist/types/client_state.d.ts.map +1 -1
  21. package/dist/types/connection.d.ts +14 -49
  22. package/dist/types/connection.d.ts.map +1 -1
  23. package/dist/types/connection_fallback.d.ts +41 -0
  24. package/dist/types/connection_fallback.d.ts.map +1 -0
  25. package/dist/types/errors.d.ts +14 -0
  26. package/dist/types/errors.d.ts.map +1 -0
  27. package/dist/types/insights.d.ts +6 -6
  28. package/dist/types/insights.d.ts.map +1 -1
  29. package/dist/types/permissions.d.ts.map +1 -1
  30. package/dist/types/signing.d.ts +3 -3
  31. package/dist/types/signing.d.ts.map +1 -1
  32. package/dist/types/token_manager.d.ts +2 -2
  33. package/dist/types/token_manager.d.ts.map +1 -1
  34. package/dist/types/types.d.ts +174 -90
  35. package/dist/types/types.d.ts.map +1 -1
  36. package/dist/types/utils.d.ts +12 -2
  37. package/dist/types/utils.d.ts.map +1 -1
  38. package/package.json +25 -31
  39. package/src/base64.ts +1 -4
  40. package/src/channel.ts +157 -461
  41. package/src/channel_state.ts +31 -158
  42. package/src/client.ts +332 -683
  43. package/src/client_state.ts +2 -2
  44. package/src/connection.ts +143 -394
  45. package/src/connection_fallback.ts +209 -0
  46. package/src/errors.ts +58 -0
  47. package/src/insights.ts +15 -23
  48. package/src/permissions.ts +3 -24
  49. package/src/signing.ts +6 -17
  50. package/src/token_manager.ts +6 -18
  51. package/src/types.ts +391 -513
  52. package/src/utils.ts +48 -19
@@ -21,7 +21,8 @@ export declare type RequireAtLeastOne<T> = {
21
21
  export declare type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
22
22
  [K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
23
23
  }[Keys];
24
- export declare type UnknownType = Record<string, unknown>;
24
+ export declare type UR = Record<string, unknown>;
25
+ export declare type UnknownType = UR;
25
26
  export declare type Unpacked<T> = T extends (infer U)[] ? U : T extends (...args: any[]) => infer U ? U : T extends Promise<infer U> ? U : T;
26
27
  /**
27
28
  * Response Types
@@ -100,7 +101,7 @@ export declare type ModerationResult = {
100
101
  blocklist_name?: string;
101
102
  moderated_by?: string;
102
103
  };
103
- export declare type MessageFlagsResponse<ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType extends UnknownType = UnknownType, AttachmentType = UnknownType, MessageType = UnknownType, ReactionType = UnknownType> = APIResponse & {
104
+ export declare type MessageFlagsResponse<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR, AttachmentType = UR, MessageType = UR, ReactionType = UR> = APIResponse & {
104
105
  flags?: Array<{
105
106
  message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
106
107
  user: UserResponse<UserType>;
@@ -114,7 +115,25 @@ export declare type MessageFlagsResponse<ChannelType extends UnknownType = Unkno
114
115
  updated_at?: string;
115
116
  }>;
116
117
  };
117
- export declare type BannedUsersResponse<ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType extends UnknownType = UnknownType> = APIResponse & {
118
+ export declare type FlagReport<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR, AttachmentType = UR, MessageType = UR, ReactionType = UR> = {
119
+ flags_count: number;
120
+ id: string;
121
+ message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
122
+ user: UserResponse<UserType>;
123
+ created_at?: string;
124
+ review_details?: Object;
125
+ review_result?: string;
126
+ reviewed_at?: string;
127
+ reviewed_by?: UserResponse<UserType>;
128
+ updated_at?: string;
129
+ };
130
+ export declare type FlagReportsResponse<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR, AttachmentType = UR, MessageType = UR, ReactionType = UR> = APIResponse & {
131
+ flag_reports: Array<FlagReport<ChannelType, CommandType, UserType, AttachmentType, MessageType, ReactionType>>;
132
+ };
133
+ export declare type ReviewFlagReportResponse<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR, AttachmentType = UR, MessageType = UR, ReactionType = UR> = APIResponse & {
134
+ flag_report: FlagReport<ChannelType, CommandType, UserType, AttachmentType, MessageType, ReactionType>;
135
+ };
136
+ export declare type BannedUsersResponse<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR> = APIResponse & {
118
137
  bans?: Array<{
119
138
  user: UserResponse<UserType>;
120
139
  banned_by?: UserResponse<UserType>;
@@ -129,7 +148,7 @@ export declare type BlockListResponse = BlockList & {
129
148
  created_at?: string;
130
149
  updated_at?: string;
131
150
  };
132
- export declare type ChannelResponse<ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType = UnknownType> = ChannelType & {
151
+ export declare type ChannelResponse<ChannelType = UR, CommandType extends string = LiteralStringForUnion, UserType = UR> = ChannelType & {
133
152
  cid: string;
134
153
  disabled: boolean;
135
154
  frozen: boolean;
@@ -152,9 +171,10 @@ export declare type ChannelResponse<ChannelType = UnknownType, CommandType exten
152
171
  name?: string;
153
172
  own_capabilities?: string[];
154
173
  team?: string;
174
+ truncated_at?: string;
155
175
  updated_at?: string;
156
176
  };
157
- export declare type ChannelAPIResponse<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = APIResponse & {
177
+ export declare type ChannelAPIResponse<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = APIResponse & {
158
178
  channel: ChannelResponse<ChannelType, CommandType, UserType>;
159
179
  members: ChannelMemberResponse<UserType>[];
160
180
  messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
@@ -165,10 +185,14 @@ export declare type ChannelAPIResponse<AttachmentType = UnknownType, ChannelType
165
185
  watcher_count?: number;
166
186
  watchers?: UserResponse<UserType>[];
167
187
  };
168
- export declare type ChannelMemberAPIResponse<UserType = UnknownType> = APIResponse & {
188
+ export declare type ChannelUpdateOptions = {
189
+ hide_history?: boolean;
190
+ skip_push?: boolean;
191
+ };
192
+ export declare type ChannelMemberAPIResponse<UserType = UR> = APIResponse & {
169
193
  members: ChannelMemberResponse<UserType>[];
170
194
  };
171
- export declare type ChannelMemberResponse<UserType = UnknownType> = {
195
+ export declare type ChannelMemberResponse<UserType = UR> = {
172
196
  banned?: boolean;
173
197
  channel_role?: Role;
174
198
  created_at?: string;
@@ -203,7 +227,7 @@ export declare type CommandResponse<CommandType extends string = LiteralStringFo
203
227
  name?: CommandVariants<CommandType>;
204
228
  set?: CommandVariants<CommandType>;
205
229
  };
206
- export declare type ConnectAPIResponse<ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType extends UnknownType = UnknownType> = Promise<void | ConnectionOpen<ChannelType, CommandType, UserType>>;
230
+ export declare type ConnectAPIResponse<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR> = Promise<void | ConnectionOpen<ChannelType, CommandType, UserType>>;
207
231
  export declare type CreateChannelResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id'> & {
208
232
  created_at: string;
209
233
  updated_at: string;
@@ -212,13 +236,13 @@ export declare type CreateChannelResponse<CommandType extends string = LiteralSt
212
236
  export declare type CreateCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
213
237
  command: CreateCommandOptions<CommandType> & CreatedAtUpdatedAt;
214
238
  };
215
- export declare type DeleteChannelAPIResponse<ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType = UnknownType> = APIResponse & {
239
+ export declare type DeleteChannelAPIResponse<ChannelType = UR, CommandType extends string = LiteralStringForUnion, UserType = UR> = APIResponse & {
216
240
  channel: ChannelResponse<ChannelType, CommandType, UserType>;
217
241
  };
218
242
  export declare type DeleteCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
219
243
  name?: CommandVariants<CommandType>;
220
244
  };
221
- export declare type EventAPIResponse<AttachmentType extends UnknownType = UnknownType, ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, EventType extends UnknownType = UnknownType, MessageType extends UnknownType = UnknownType, ReactionType extends UnknownType = UnknownType, UserType extends UnknownType = UnknownType> = APIResponse & {
245
+ export declare type EventAPIResponse<AttachmentType extends UR = UR, ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, EventType extends UR = UR, MessageType extends UR = UR, ReactionType extends UR = UR, UserType extends UR = UR> = APIResponse & {
222
246
  event: Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>;
223
247
  };
224
248
  export declare type ExportChannelResponse = {
@@ -230,7 +254,7 @@ export declare type ExportChannelStatusResponse = {
230
254
  result?: {};
231
255
  updated_at?: string;
232
256
  };
233
- export declare type FlagMessageResponse<UserType = UnknownType> = APIResponse & {
257
+ export declare type FlagMessageResponse<UserType = UR> = APIResponse & {
234
258
  flag: {
235
259
  created_at: string;
236
260
  created_by_automod: boolean;
@@ -238,12 +262,13 @@ export declare type FlagMessageResponse<UserType = UnknownType> = APIResponse &
238
262
  updated_at: string;
239
263
  user: UserResponse<UserType>;
240
264
  approved_at?: string;
265
+ details?: Object;
241
266
  rejected_at?: string;
242
267
  reviewed_at?: string;
243
268
  reviewed_by?: string;
244
269
  };
245
270
  };
246
- export declare type FlagUserResponse<UserType = UnknownType> = APIResponse & {
271
+ export declare type FlagUserResponse<UserType = UR> = APIResponse & {
247
272
  flag: {
248
273
  created_at: string;
249
274
  created_by_automod: boolean;
@@ -251,12 +276,13 @@ export declare type FlagUserResponse<UserType = UnknownType> = APIResponse & {
251
276
  updated_at: string;
252
277
  user: UserResponse<UserType>;
253
278
  approved_at?: string;
279
+ details?: Object;
254
280
  rejected_at?: string;
255
281
  reviewed_at?: string;
256
282
  reviewed_by?: string;
257
283
  };
258
284
  };
259
- export declare type FormatMessageResponse<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = Omit<MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>, 'created_at' | 'pinned_at' | 'updated_at' | 'status'> & MessageType & {
285
+ export declare type FormatMessageResponse<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = Omit<MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>, 'created_at' | 'pinned_at' | 'updated_at' | 'status'> & MessageType & {
260
286
  created_at: Date;
261
287
  pinned_at: Date | null;
262
288
  status: string;
@@ -269,7 +295,7 @@ export declare type GetChannelTypeResponse<CommandType extends string = LiteralS
269
295
  grants?: Record<string, string[]>;
270
296
  };
271
297
  export declare type GetCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & CreateCommandOptions<CommandType> & CreatedAtUpdatedAt;
272
- export declare type GetMultipleMessagesAPIResponse<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = APIResponse & {
298
+ export declare type GetMultipleMessagesAPIResponse<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = APIResponse & {
273
299
  messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
274
300
  };
275
301
  export declare type GetRateLimitsResponse = APIResponse & {
@@ -278,10 +304,10 @@ export declare type GetRateLimitsResponse = APIResponse & {
278
304
  server_side?: RateLimitsMap;
279
305
  web?: RateLimitsMap;
280
306
  };
281
- export declare type GetReactionsAPIResponse<ReactionType = UnknownType, UserType = UnknownType> = APIResponse & {
307
+ export declare type GetReactionsAPIResponse<ReactionType = UR, UserType = UR> = APIResponse & {
282
308
  reactions: ReactionResponse<ReactionType, UserType>[];
283
309
  };
284
- export declare type GetRepliesAPIResponse<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = APIResponse & {
310
+ export declare type GetRepliesAPIResponse<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = APIResponse & {
285
311
  messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
286
312
  };
287
313
  export declare type ListChannelResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
@@ -294,18 +320,18 @@ export declare type ListChannelResponse<CommandType extends string = LiteralStri
294
320
  };
295
321
  export declare type ListChannelTypesAPIResponse<CommandType extends string = LiteralStringForUnion> = ListChannelResponse<CommandType>;
296
322
  export declare type ListCommandsResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
297
- commands: Array<CreateCommandOptions<CommandType> & CreatedAtUpdatedAt>;
323
+ commands: Array<CreateCommandOptions<CommandType> & Partial<CreatedAtUpdatedAt>>;
298
324
  };
299
- export declare type MuteChannelAPIResponse<ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType extends UnknownType = UnknownType> = APIResponse & {
325
+ export declare type MuteChannelAPIResponse<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR> = APIResponse & {
300
326
  channel_mute: ChannelMute<ChannelType, CommandType, UserType>;
301
327
  own_user: OwnUserResponse<ChannelType, CommandType, UserType>;
302
328
  channel_mutes?: ChannelMute<ChannelType, CommandType, UserType>[];
303
329
  mute?: MuteResponse<UserType>;
304
330
  };
305
- export declare type MessageResponse<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = MessageResponseBase<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType> & {
331
+ export declare type MessageResponse<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = MessageResponseBase<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType> & {
306
332
  quoted_message?: MessageResponseBase<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
307
333
  };
308
- export declare type MessageResponseBase<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = MessageBase<AttachmentType, MessageType, UserType> & {
334
+ export declare type MessageResponseBase<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = MessageBase<AttachmentType, MessageType, UserType> & {
309
335
  args?: string;
310
336
  channel?: ChannelResponse<ChannelType, CommandType, UserType>;
311
337
  cid?: string;
@@ -338,19 +364,19 @@ export declare type MessageResponseBase<AttachmentType = UnknownType, ChannelTyp
338
364
  type?: MessageLabel;
339
365
  updated_at?: string;
340
366
  };
341
- export declare type MuteResponse<UserType = UnknownType> = {
367
+ export declare type MuteResponse<UserType = UR> = {
342
368
  user: UserResponse<UserType>;
343
369
  created_at?: string;
344
370
  expires?: string;
345
371
  target?: UserResponse<UserType>;
346
372
  updated_at?: string;
347
373
  };
348
- export declare type MuteUserResponse<ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType extends UnknownType = UnknownType> = APIResponse & {
374
+ export declare type MuteUserResponse<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR> = APIResponse & {
349
375
  mute?: MuteResponse<UserType>;
350
376
  mutes?: Array<Mute<UserType>>;
351
377
  own_user?: OwnUserResponse<ChannelType, CommandType, UserType>;
352
378
  };
353
- export declare type OwnUserBase<ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType extends UnknownType = UnknownType> = {
379
+ export declare type OwnUserBase<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR> = {
354
380
  channel_mutes: ChannelMute<ChannelType, CommandType, UserType>[];
355
381
  devices: Device<UserType>[];
356
382
  mutes: Mute<UserType>[];
@@ -360,8 +386,8 @@ export declare type OwnUserBase<ChannelType extends UnknownType = UnknownType, C
360
386
  invisible?: boolean;
361
387
  roles?: string[];
362
388
  };
363
- export declare type OwnUserResponse<ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType extends UnknownType = UnknownType> = UserResponse<UserType> & OwnUserBase<ChannelType, CommandType, UserType>;
364
- export declare type PartialUpdateChannelAPIResponse<ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType = UnknownType> = APIResponse & {
389
+ export declare type OwnUserResponse<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR> = UserResponse<UserType> & OwnUserBase<ChannelType, CommandType, UserType>;
390
+ export declare type PartialUpdateChannelAPIResponse<ChannelType = UR, CommandType extends string = LiteralStringForUnion, UserType = UR> = APIResponse & {
365
391
  channel: ChannelResponse<ChannelType, CommandType, UserType>;
366
392
  members: ChannelMemberResponse<UserType>[];
367
393
  };
@@ -371,20 +397,20 @@ export declare type PermissionAPIResponse = APIResponse & {
371
397
  export declare type PermissionsAPIResponse = APIResponse & {
372
398
  permissions?: PermissionAPIObject[];
373
399
  };
374
- export declare type ReactionAPIResponse<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = APIResponse & {
400
+ export declare type ReactionAPIResponse<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = APIResponse & {
375
401
  message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
376
402
  reaction: ReactionResponse<ReactionType, UserType>;
377
403
  };
378
- export declare type ReactionResponse<ReactionType = UnknownType, UserType = UnknownType> = Reaction<ReactionType, UserType> & {
404
+ export declare type ReactionResponse<ReactionType = UR, UserType = UR> = Reaction<ReactionType, UserType> & {
379
405
  created_at: string;
380
406
  updated_at: string;
381
407
  };
382
- export declare type ReadResponse<UserType = UnknownType> = {
408
+ export declare type ReadResponse<UserType = UR> = {
383
409
  last_read: string;
384
410
  user: UserResponse<UserType>;
385
411
  unread_messages?: number;
386
412
  };
387
- export declare type SearchAPIResponse<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = APIResponse & {
413
+ export declare type SearchAPIResponse<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = APIResponse & {
388
414
  results: {
389
415
  message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
390
416
  }[];
@@ -401,13 +427,14 @@ export declare type SearchWarning = {
401
427
  export declare type SendFileAPIResponse = APIResponse & {
402
428
  file: string;
403
429
  };
404
- export declare type SendMessageAPIResponse<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = APIResponse & {
430
+ export declare type SendMessageAPIResponse<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = APIResponse & {
405
431
  message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
406
432
  };
407
- export declare type TruncateChannelAPIResponse<ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType = UnknownType> = APIResponse & {
433
+ export declare type TruncateChannelAPIResponse<ChannelType = UR, CommandType extends string = LiteralStringForUnion, UserType = UR, AttachmentType = UR, MessageType = UR, ReactionType = UR> = APIResponse & {
408
434
  channel: ChannelResponse<ChannelType, CommandType, UserType>;
435
+ message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
409
436
  };
410
- export declare type UpdateChannelAPIResponse<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = APIResponse & {
437
+ export declare type UpdateChannelAPIResponse<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = APIResponse & {
411
438
  channel: ChannelResponse<ChannelType, CommandType, UserType>;
412
439
  members: ChannelMemberResponse<UserType>[];
413
440
  message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
@@ -421,18 +448,18 @@ export declare type UpdateCommandResponse<CommandType extends string = LiteralSt
421
448
  name: CommandVariants<CommandType>;
422
449
  };
423
450
  };
424
- export declare type UpdateMessageAPIResponse<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = APIResponse & {
451
+ export declare type UpdateMessageAPIResponse<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = APIResponse & {
425
452
  message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
426
453
  };
427
- export declare type UsersAPIResponse<UserType = UnknownType> = APIResponse & {
454
+ export declare type UsersAPIResponse<UserType = UR> = APIResponse & {
428
455
  users: Array<UserResponse<UserType>>;
429
456
  };
430
- export declare type UpdateUsersAPIResponse<UserType = UnknownType> = APIResponse & {
457
+ export declare type UpdateUsersAPIResponse<UserType = UR> = APIResponse & {
431
458
  users: {
432
459
  [key: string]: UserResponse<UserType>;
433
460
  };
434
461
  };
435
- export declare type UserResponse<UserType = UnknownType> = User<UserType> & {
462
+ export declare type UserResponse<UserType = UR> = User<UserType> & {
436
463
  banned?: boolean;
437
464
  created_at?: string;
438
465
  deactivated_at?: string;
@@ -440,10 +467,15 @@ export declare type UserResponse<UserType = UnknownType> = User<UserType> & {
440
467
  language?: TranslationLanguages | '';
441
468
  last_active?: string;
442
469
  online?: boolean;
470
+ push_notifications?: PushNotificationSettings;
443
471
  revoke_tokens_issued_before?: string;
444
472
  shadow_banned?: boolean;
445
473
  updated_at?: string;
446
474
  };
475
+ export declare type PushNotificationSettings = {
476
+ disabled?: boolean;
477
+ disabled_until?: string | null;
478
+ };
447
479
  /**
448
480
  * Option Types
449
481
  */
@@ -451,36 +483,33 @@ export declare type MessageFlagsPaginationOptions = {
451
483
  limit?: number;
452
484
  offset?: number;
453
485
  };
486
+ export declare type FlagReportsPaginationOptions = {
487
+ limit?: number;
488
+ offset?: number;
489
+ };
490
+ export declare type ReviewFlagReportOptions = {
491
+ review_details?: Object;
492
+ user_id?: string;
493
+ };
454
494
  export declare type BannedUsersPaginationOptions = Omit<PaginationOptions, 'id_gt' | 'id_gte' | 'id_lt' | 'id_lte'>;
455
- export declare type BanUserOptions<UserType = UnknownType> = UnBanUserOptions & {
495
+ export declare type BanUserOptions<UserType = UR> = UnBanUserOptions & {
456
496
  banned_by?: UserResponse<UserType>;
457
497
  banned_by_id?: string;
458
498
  ip_ban?: boolean;
459
499
  reason?: string;
460
500
  timeout?: number;
461
- /**
462
- * @deprecated please use banned_by
463
- */
464
- user?: UserResponse<UserType>;
465
- /**
466
- * @deprecated please use banned_by_id
467
- */
468
- user_id?: string;
469
501
  };
470
502
  export declare type ChannelOptions = {
471
- last_message_ids?: {
472
- [key: string]: string;
473
- };
474
503
  limit?: number;
504
+ member_limit?: number;
475
505
  message_limit?: number;
476
506
  offset?: number;
477
507
  presence?: boolean;
478
- recovery?: boolean;
479
508
  state?: boolean;
480
509
  user_id?: string;
481
510
  watch?: boolean;
482
511
  };
483
- export declare type ChannelQueryOptions<ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType = UnknownType> = {
512
+ export declare type ChannelQueryOptions<ChannelType = UR, CommandType extends string = LiteralStringForUnion, UserType = UR> = {
484
513
  client_id?: string;
485
514
  connection_id?: string;
486
515
  data?: ChannelResponse<ChannelType, CommandType, UserType>;
@@ -536,7 +565,7 @@ export declare type CustomPermissionOptions = {
536
565
  owner?: boolean;
537
566
  same_team?: boolean;
538
567
  };
539
- export declare type InviteOptions<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = {
568
+ export declare type InviteOptions<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = {
540
569
  accept_invite?: boolean;
541
570
  add_members?: string[];
542
571
  add_moderators?: string[];
@@ -552,22 +581,22 @@ export declare type InviteOptions<AttachmentType = UnknownType, ChannelType = Un
552
581
  user_id?: string;
553
582
  };
554
583
  /** @deprecated use MarkChannelsReadOptions instead */
555
- export declare type MarkAllReadOptions<UserType = UnknownType> = MarkChannelsReadOptions<UserType>;
556
- export declare type MarkChannelsReadOptions<UserType = UnknownType> = {
584
+ export declare type MarkAllReadOptions<UserType = UR> = MarkChannelsReadOptions<UserType>;
585
+ export declare type MarkChannelsReadOptions<UserType = UR> = {
557
586
  client_id?: string;
558
587
  connection_id?: string;
559
588
  read_by_channel?: Record<string, string>;
560
589
  user?: UserResponse<UserType>;
561
590
  user_id?: string;
562
591
  };
563
- export declare type MarkReadOptions<UserType = UnknownType> = {
592
+ export declare type MarkReadOptions<UserType = UR> = {
564
593
  client_id?: string;
565
594
  connection_id?: string;
566
595
  message_id?: string;
567
596
  user?: UserResponse<UserType>;
568
597
  user_id?: string;
569
598
  };
570
- export declare type MuteUserOptions<UserType = UnknownType> = {
599
+ export declare type MuteUserOptions<UserType = UR> = {
571
600
  client_id?: string;
572
601
  connection_id?: string;
573
602
  id?: string;
@@ -594,6 +623,20 @@ export declare type MessagePaginationOptions = PaginationOptions & {
594
623
  created_at_around?: string | Date;
595
624
  id_around?: string;
596
625
  };
626
+ export declare type PinnedMessagePaginationOptions = {
627
+ id_around?: string;
628
+ id_gt?: string;
629
+ id_gte?: string;
630
+ id_lt?: string;
631
+ id_lte?: string;
632
+ limit?: number;
633
+ offset?: number;
634
+ pinned_at_after?: string | Date;
635
+ pinned_at_after_or_equal?: string | Date;
636
+ pinned_at_around?: string | Date;
637
+ pinned_at_before?: string | Date;
638
+ pinned_at_before_or_equal?: string | Date;
639
+ };
597
640
  export declare type QueryMembersOptions = {
598
641
  limit?: number;
599
642
  offset?: number;
@@ -602,7 +645,7 @@ export declare type QueryMembersOptions = {
602
645
  user_id_lt?: string;
603
646
  user_id_lte?: string;
604
647
  };
605
- export declare type SearchOptions<MessageType = UnknownType> = {
648
+ export declare type SearchOptions<MessageType = UR> = {
606
649
  limit?: number;
607
650
  next?: string;
608
651
  offset?: number;
@@ -621,6 +664,8 @@ export declare type StreamChatOptions = AxiosRequestConfig & {
621
664
  browser?: boolean;
622
665
  device?: BaseDeviceFields;
623
666
  enableInsights?: boolean;
667
+ /** experimental feature, please contact support if you want this feature enabled for you */
668
+ enableWSFallback?: boolean;
624
669
  logger?: Logger;
625
670
  /**
626
671
  * When network is recovered, we re-query the active channels on client. But in single query, you can recover
@@ -663,7 +708,7 @@ export declare type ConnectionChangeEvent = {
663
708
  type: EventTypes;
664
709
  online?: boolean;
665
710
  };
666
- export declare type Event<AttachmentType extends UnknownType = UnknownType, ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, EventType extends UnknownType = UnknownType, MessageType extends UnknownType = UnknownType, ReactionType extends UnknownType = UnknownType, UserType extends UnknownType = UnknownType> = EventType & {
711
+ export declare type Event<AttachmentType extends UR = UR, ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, EventType extends UR = UR, MessageType extends UR = UR, ReactionType extends UR = UR, UserType extends UR = UR> = EventType & {
667
712
  type: EventTypes;
668
713
  channel?: ChannelResponse<ChannelType, CommandType, UserType>;
669
714
  channel_id?: string;
@@ -689,11 +734,11 @@ export declare type Event<AttachmentType extends UnknownType = UnknownType, Chan
689
734
  user_id?: string;
690
735
  watcher_count?: number;
691
736
  };
692
- export declare type UserCustomEvent<EventType extends UnknownType = UnknownType> = EventType & {
737
+ export declare type UserCustomEvent<EventType extends UR = UR> = EventType & {
693
738
  type: string;
694
739
  };
695
- export declare type EventHandler<AttachmentType extends UnknownType = UnknownType, ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, EventType extends UnknownType = UnknownType, MessageType extends UnknownType = UnknownType, ReactionType extends UnknownType = UnknownType, UserType extends UnknownType = UnknownType> = (event: Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>) => void;
696
- export declare type EventTypes = 'all' | 'channel.created' | 'channel.deleted' | 'channel.hidden' | 'channel.muted' | 'channel.truncated' | 'channel.unmuted' | 'channel.updated' | 'channel.visible' | 'connection.changed' | 'connection.recovered' | 'health.check' | 'member.added' | 'member.removed' | 'member.updated' | 'message.deleted' | 'message.new' | 'message.read' | 'message.updated' | 'notification.added_to_channel' | 'notification.channel_deleted' | 'notification.channel_mutes_updated' | 'notification.channel_truncated' | 'notification.invite_accepted' | 'notification.invite_rejected' | 'notification.invited' | 'notification.mark_read' | 'notification.message_new' | 'notification.mutes_updated' | 'notification.removed_from_channel' | 'reaction.deleted' | 'reaction.new' | 'reaction.updated' | 'typing.start' | 'typing.stop' | 'user.banned' | 'user.deleted' | 'user.presence.changed' | 'user.unbanned' | 'user.updated' | 'user.watching.start' | 'user.watching.stop';
740
+ export declare type EventHandler<AttachmentType extends UR = UR, ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, EventType extends UR = UR, MessageType extends UR = UR, ReactionType extends UR = UR, UserType extends UR = UR> = (event: Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>) => void;
741
+ export declare type EventTypes = 'all' | 'channel.created' | 'channel.deleted' | 'channel.hidden' | 'channel.muted' | 'channel.truncated' | 'channel.unmuted' | 'channel.updated' | 'channel.visible' | 'transport.changed' | 'connection.changed' | 'connection.recovered' | 'health.check' | 'member.added' | 'member.removed' | 'member.updated' | 'message.deleted' | 'message.new' | 'message.read' | 'message.updated' | 'notification.added_to_channel' | 'notification.channel_deleted' | 'notification.channel_mutes_updated' | 'notification.channel_truncated' | 'notification.invite_accepted' | 'notification.invite_rejected' | 'notification.invited' | 'notification.mark_read' | 'notification.message_new' | 'notification.mutes_updated' | 'notification.removed_from_channel' | 'reaction.deleted' | 'reaction.new' | 'reaction.updated' | 'typing.start' | 'typing.stop' | 'user.banned' | 'user.deleted' | 'user.presence.changed' | 'user.unbanned' | 'user.updated' | 'user.watching.start' | 'user.watching.stop';
697
742
  /**
698
743
  * Filter Types
699
744
  */
@@ -713,6 +758,27 @@ export declare type MessageFlagsFilters = QueryFilters<{
713
758
  } & {
714
759
  [Key in keyof Omit<MessageFlagsFiltersOptions, 'channel_cid' | 'user_id' | 'is_reviewed'>]: RequireOnlyOne<QueryFilter<MessageFlagsFiltersOptions[Key]>> | PrimitiveFilter<MessageFlagsFiltersOptions[Key]>;
715
760
  }>;
761
+ export declare type FlagReportsFiltersOptions = {
762
+ is_reviewed?: boolean;
763
+ message_id?: string;
764
+ report_id?: string;
765
+ review_result?: string;
766
+ reviewed_by?: string;
767
+ user_id?: string;
768
+ };
769
+ export declare type FlagReportsFilters = QueryFilters<{
770
+ report_id?: RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['report_id']>, '$eq' | '$in'>> | PrimitiveFilter<FlagReportsFiltersOptions['report_id']>;
771
+ } & {
772
+ review_result?: RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['review_result']>, '$eq' | '$in'>> | PrimitiveFilter<FlagReportsFiltersOptions['review_result']>;
773
+ } & {
774
+ reviewed_by?: RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['reviewed_by']>, '$eq' | '$in'>> | PrimitiveFilter<FlagReportsFiltersOptions['reviewed_by']>;
775
+ } & {
776
+ user_id?: RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['user_id']>, '$eq' | '$in'>> | PrimitiveFilter<FlagReportsFiltersOptions['user_id']>;
777
+ } & {
778
+ message_id?: RequireOnlyOne<Pick<QueryFilter<FlagReportsFiltersOptions['message_id']>, '$eq' | '$in'>> | PrimitiveFilter<FlagReportsFiltersOptions['message_id']>;
779
+ } & {
780
+ [Key in keyof Omit<FlagReportsFiltersOptions, 'report_id' | 'user_id' | 'message_id' | 'review_result' | 'reviewed_by'>]: RequireOnlyOne<QueryFilter<FlagReportsFiltersOptions[Key]>> | PrimitiveFilter<FlagReportsFiltersOptions[Key]>;
781
+ }>;
716
782
  export declare type BannedUsersFilterOptions = {
717
783
  banned_by_id?: string;
718
784
  channel_cid?: string;
@@ -729,7 +795,7 @@ export declare type BannedUsersFilters = QueryFilters<{
729
795
  } & {
730
796
  [Key in keyof Omit<BannedUsersFilterOptions, 'channel_cid' | 'reason'>]: RequireOnlyOne<QueryFilter<BannedUsersFilterOptions[Key]>> | PrimitiveFilter<BannedUsersFilterOptions[Key]>;
731
797
  }>;
732
- export declare type ChannelFilters<ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType = UnknownType> = QueryFilters<ContainsOperator<ChannelType> & {
798
+ export declare type ChannelFilters<ChannelType = UR, CommandType extends string = LiteralStringForUnion, UserType = UR> = QueryFilters<ContainsOperator<ChannelType> & {
733
799
  members?: RequireOnlyOne<Pick<QueryFilter<string>, '$in' | '$nin'>> | RequireOnlyOne<Pick<QueryFilter<string[]>, '$eq'>> | PrimitiveFilter<string[]>;
734
800
  } & {
735
801
  name?: RequireOnlyOne<{
@@ -743,7 +809,7 @@ export declare type ContainsOperator<CustomType = {}> = {
743
809
  $contains?: ContainType extends object ? PrimitiveFilter<RequireAtLeastOne<ContainType>> : PrimitiveFilter<ContainType>;
744
810
  } & QueryFilter<PrimitiveFilter<ContainType>[]>> | PrimitiveFilter<PrimitiveFilter<ContainType>[]> : RequireOnlyOne<QueryFilter<CustomType[Key]>> | PrimitiveFilter<CustomType[Key]>;
745
811
  };
746
- export declare type MessageFilters<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = QueryFilters<ContainsOperator<MessageType> & {
812
+ export declare type MessageFilters<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = QueryFilters<ContainsOperator<MessageType> & {
747
813
  text?: RequireOnlyOne<{
748
814
  $autocomplete?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>['text'];
749
815
  $q?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>['text'];
@@ -777,7 +843,7 @@ export declare type QueryLogicalOperators<Operators> = {
777
843
  $nor?: ArrayOneOrMore<QueryFilters<Operators>>;
778
844
  $or?: ArrayTwoOrMore<QueryFilters<Operators>>;
779
845
  };
780
- export declare type UserFilters<UserType = UnknownType> = QueryFilters<ContainsOperator<UserType> & {
846
+ export declare type UserFilters<UserType = UR> = QueryFilters<ContainsOperator<UserType> & {
781
847
  id?: RequireOnlyOne<{
782
848
  $autocomplete?: UserResponse<UserType>['id'];
783
849
  } & QueryFilter<UserResponse<UserType>['id']>> | PrimitiveFilter<UserResponse<UserType>['id']>;
@@ -801,8 +867,8 @@ export declare type BannedUsersSort = BannedUsersSortBase | Array<BannedUsersSor
801
867
  export declare type BannedUsersSortBase = {
802
868
  created_at?: AscDesc;
803
869
  };
804
- export declare type ChannelSort<ChannelType = UnknownType> = ChannelSortBase<ChannelType> | Array<ChannelSortBase<ChannelType>>;
805
- export declare type ChannelSortBase<ChannelType = UnknownType> = Sort<ChannelType> & {
870
+ export declare type ChannelSort<ChannelType = UR> = ChannelSortBase<ChannelType> | Array<ChannelSortBase<ChannelType>>;
871
+ export declare type ChannelSortBase<ChannelType = UR> = Sort<ChannelType> & {
806
872
  created_at?: AscDesc;
807
873
  has_unread?: AscDesc;
808
874
  last_message_at?: AscDesc;
@@ -811,12 +877,16 @@ export declare type ChannelSortBase<ChannelType = UnknownType> = Sort<ChannelTyp
811
877
  unread_count?: AscDesc;
812
878
  updated_at?: AscDesc;
813
879
  };
880
+ export declare type PinnedMessagesSort = PinnedMessagesSortBase | Array<PinnedMessagesSortBase>;
881
+ export declare type PinnedMessagesSortBase = {
882
+ pinned_at?: AscDesc;
883
+ };
814
884
  export declare type Sort<T> = {
815
885
  [P in keyof T]?: AscDesc;
816
886
  };
817
- export declare type UserSort<UserType = UnknownType> = Sort<UserResponse<UserType>> | Array<Sort<UserResponse<UserType>>>;
818
- export declare type MemberSort<UserType = UnknownType> = Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>> | Array<Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>>>;
819
- export declare type SearchMessageSortBase<MessageType = UnknownType> = Sort<MessageType> & {
887
+ export declare type UserSort<UserType = UR> = Sort<UserResponse<UserType>> | Array<Sort<UserResponse<UserType>>>;
888
+ export declare type MemberSort<UserType = UR> = Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>> | Array<Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>>>;
889
+ export declare type SearchMessageSortBase<MessageType = UR> = Sort<MessageType> & {
820
890
  attachments?: AscDesc;
821
891
  'attachments.type'?: AscDesc;
822
892
  created_at?: AscDesc;
@@ -831,8 +901,8 @@ export declare type SearchMessageSortBase<MessageType = UnknownType> = Sort<Mess
831
901
  updated_at?: AscDesc;
832
902
  'user.id'?: AscDesc;
833
903
  };
834
- export declare type SearchMessageSort<MessageType = UnknownType> = SearchMessageSortBase<MessageType> | Array<SearchMessageSortBase<MessageType>>;
835
- export declare type QuerySort<ChannelType = UnknownType, UserType = UnknownType, MessageType = UnknownType> = BannedUsersSort | ChannelSort<ChannelType> | SearchMessageSort<MessageType> | UserSort<UserType>;
904
+ export declare type SearchMessageSort<MessageType = UR> = SearchMessageSortBase<MessageType> | Array<SearchMessageSortBase<MessageType>>;
905
+ export declare type QuerySort<ChannelType = UR, UserType = UR, MessageType = UR> = BannedUsersSort | ChannelSort<ChannelType> | SearchMessageSort<MessageType> | UserSort<UserType>;
836
906
  /**
837
907
  * Base Types
838
908
  */
@@ -898,7 +968,7 @@ export declare type AppSettings = {
898
968
  webhook_events?: Array<string> | null;
899
969
  webhook_url?: string;
900
970
  };
901
- export declare type Attachment<T = UnknownType> = T & {
971
+ export declare type Attachment<T = UR> = T & {
902
972
  actions?: Action[];
903
973
  asset_url?: string;
904
974
  author_icon?: string;
@@ -976,11 +1046,11 @@ export declare type ChannelConfigFields = {
976
1046
  export declare type ChannelConfigWithInfo<CommandType extends string = LiteralStringForUnion> = ChannelConfigFields & CreatedAtUpdatedAt & {
977
1047
  commands?: CommandResponse<CommandType>[];
978
1048
  };
979
- export declare type ChannelData<ChannelType = UnknownType> = ChannelType & {
1049
+ export declare type ChannelData<ChannelType = UR> = ChannelType & {
980
1050
  members?: string[];
981
1051
  name?: string;
982
1052
  };
983
- export declare type ChannelMembership<UserType = UnknownType> = {
1053
+ export declare type ChannelMembership<UserType = UR> = {
984
1054
  banned?: boolean;
985
1055
  channel_role?: Role;
986
1056
  created_at?: string;
@@ -990,7 +1060,7 @@ export declare type ChannelMembership<UserType = UnknownType> = {
990
1060
  updated_at?: string;
991
1061
  user?: UserResponse<UserType>;
992
1062
  };
993
- export declare type ChannelMute<ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType extends UnknownType = UnknownType> = {
1063
+ export declare type ChannelMute<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR> = {
994
1064
  user: UserResponse<UserType>;
995
1065
  channel?: ChannelResponse<ChannelType, CommandType, UserType>;
996
1066
  created_at?: string;
@@ -1004,7 +1074,7 @@ export declare type ChannelRole = {
1004
1074
  resource?: string;
1005
1075
  same_team?: boolean;
1006
1076
  };
1007
- export declare type CheckPushInput<UserType = UnknownType> = {
1077
+ export declare type CheckPushInput<UserType = UR> = {
1008
1078
  apn_template?: string;
1009
1079
  client_id?: string;
1010
1080
  connection_id?: string;
@@ -1019,7 +1089,7 @@ export declare type CommandVariants<CommandType extends string = LiteralStringFo
1019
1089
  export declare type Configs<CommandType extends string = LiteralStringForUnion> = {
1020
1090
  [channel_type: string]: ChannelConfigWithInfo<CommandType> | undefined;
1021
1091
  };
1022
- export declare type ConnectionOpen<ChannelType extends UnknownType = UnknownType, CommandType extends string = LiteralStringForUnion, UserType extends UnknownType = UnknownType> = {
1092
+ export declare type ConnectionOpen<ChannelType extends UR = UR, CommandType extends string = LiteralStringForUnion, UserType extends UR = UR> = {
1023
1093
  connection_id: string;
1024
1094
  cid?: string;
1025
1095
  created_at?: string;
@@ -1030,7 +1100,7 @@ export declare type CreatedAtUpdatedAt = {
1030
1100
  created_at: string;
1031
1101
  updated_at: string;
1032
1102
  };
1033
- export declare type Device<UserType = UnknownType> = DeviceFields & {
1103
+ export declare type Device<UserType = UR> = DeviceFields & {
1034
1104
  provider?: string;
1035
1105
  user?: UserResponse<UserType>;
1036
1106
  user_id?: string;
@@ -1048,12 +1118,15 @@ export declare type EndpointName = 'Connect' | 'DeleteFile' | 'DeleteImage' | 'D
1048
1118
  export declare type ExportChannelRequest = {
1049
1119
  id: string;
1050
1120
  type: string;
1121
+ cid?: string;
1051
1122
  messages_since?: Date;
1052
1123
  messages_until?: Date;
1053
1124
  };
1054
1125
  export declare type ExportChannelOptions = {
1055
1126
  clear_deleted_message_text?: boolean;
1127
+ export_users?: boolean;
1056
1128
  include_truncated_messages?: boolean;
1129
+ version?: string;
1057
1130
  };
1058
1131
  export declare type Field = {
1059
1132
  short?: boolean;
@@ -1077,17 +1150,20 @@ export declare type HuaweiConfig = {
1077
1150
  enabled?: boolean;
1078
1151
  };
1079
1152
  export declare type LiteralStringForUnion = string & {};
1080
- export declare type Logger = (logLevel: 'info' | 'error' | 'warn', message: string, extraData?: Record<string, unknown>) => void;
1081
- export declare type Message<AttachmentType = UnknownType, MessageType = UnknownType, UserType = UnknownType> = Partial<MessageBase<AttachmentType, MessageType, UserType>> & {
1153
+ export declare type LogLevel = 'info' | 'error' | 'warn';
1154
+ export declare type Logger = (logLevel: LogLevel, message: string, extraData?: Record<string, unknown>) => void;
1155
+ export declare type Message<AttachmentType = UR, MessageType = UR, UserType = UR> = Partial<MessageBase<AttachmentType, MessageType, UserType>> & {
1082
1156
  mentioned_users?: string[];
1083
1157
  };
1084
- export declare type MessageBase<AttachmentType = UnknownType, MessageType = UnknownType, UserType = UnknownType> = MessageType & {
1158
+ export declare type MessageBase<AttachmentType = UR, MessageType = UR, UserType = UR> = MessageType & {
1085
1159
  id: string;
1086
1160
  attachments?: Attachment<AttachmentType>[];
1087
1161
  html?: string;
1088
1162
  mml?: string;
1089
1163
  parent_id?: string;
1164
+ pin_expires?: string;
1090
1165
  pinned?: boolean;
1166
+ pinned_at?: string;
1091
1167
  quoted_message_id?: string;
1092
1168
  show_in_channel?: boolean;
1093
1169
  text?: string;
@@ -1095,23 +1171,23 @@ export declare type MessageBase<AttachmentType = UnknownType, MessageType = Unkn
1095
1171
  user_id?: string;
1096
1172
  };
1097
1173
  export declare type MessageLabel = 'deleted' | 'ephemeral' | 'error' | 'regular' | 'reply' | 'system';
1098
- export declare type Mute<UserType = UnknownType> = {
1174
+ export declare type Mute<UserType = UR> = {
1099
1175
  created_at: string;
1100
1176
  target: UserResponse<UserType>;
1101
1177
  updated_at: string;
1102
1178
  user: UserResponse<UserType>;
1103
1179
  };
1104
- export declare type PartialUpdateChannel<ChannelType = UnknownType> = {
1180
+ export declare type PartialUpdateChannel<ChannelType = UR> = {
1105
1181
  set?: Partial<ChannelResponse<ChannelType>>;
1106
1182
  unset?: Array<keyof ChannelResponse<ChannelType>>;
1107
1183
  };
1108
- export declare type PartialUserUpdate<UserType = UnknownType> = {
1184
+ export declare type PartialUserUpdate<UserType = UR> = {
1109
1185
  id: string;
1110
1186
  set?: Partial<UserResponse<UserType>>;
1111
1187
  unset?: Array<keyof UserResponse<UserType>>;
1112
1188
  };
1113
- export declare type MessageUpdatableFields<MessageType = UnknownType> = Omit<MessageResponse<MessageType>, 'cid' | 'created_at' | 'updated_at' | 'deleted_at' | 'user' | 'user_id'>;
1114
- export declare type PartialMessageUpdate<MessageType = UnknownType> = {
1189
+ export declare type MessageUpdatableFields<MessageType = UR> = Omit<MessageResponse<MessageType>, 'cid' | 'created_at' | 'updated_at' | 'deleted_at' | 'user' | 'user_id'>;
1190
+ export declare type PartialMessageUpdate<MessageType = UR> = {
1115
1191
  set?: Partial<MessageUpdatableFields<MessageType>>;
1116
1192
  unset?: Array<keyof MessageUpdatableFields<MessageType>>;
1117
1193
  };
@@ -1121,6 +1197,7 @@ export declare type PermissionAPIObject = {
1121
1197
  custom?: boolean;
1122
1198
  description?: string;
1123
1199
  id?: string;
1200
+ level?: string;
1124
1201
  name?: string;
1125
1202
  owner?: boolean;
1126
1203
  same_team?: boolean;
@@ -1149,7 +1226,7 @@ export declare type RateLimitsInfo = {
1149
1226
  reset: number;
1150
1227
  };
1151
1228
  export declare type RateLimitsMap = Record<EndpointName, RateLimitsInfo>;
1152
- export declare type Reaction<ReactionType = UnknownType, UserType = UnknownType> = ReactionType & {
1229
+ export declare type Reaction<ReactionType = UR, UserType = UR> = ReactionType & {
1153
1230
  type: string;
1154
1231
  message_id?: string;
1155
1232
  score?: number;
@@ -1157,7 +1234,7 @@ export declare type Reaction<ReactionType = UnknownType, UserType = UnknownType>
1157
1234
  user_id?: string;
1158
1235
  };
1159
1236
  export declare type Resource = 'AddLinks' | 'BanUser' | 'CreateChannel' | 'CreateMessage' | 'CreateReaction' | 'DeleteAttachment' | 'DeleteChannel' | 'DeleteMessage' | 'DeleteReaction' | 'EditUser' | 'MuteUser' | 'ReadChannel' | 'RunMessageAction' | 'UpdateChannel' | 'UpdateChannelMembers' | 'UpdateMessage' | 'UpdateUser' | 'UploadAttachment';
1160
- export declare type SearchPayload<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = Omit<SearchOptions<MessageType>, 'sort'> & {
1237
+ export declare type SearchPayload<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = Omit<SearchOptions<MessageType>, 'sort'> & {
1161
1238
  client_id?: string;
1162
1239
  connection_id?: string;
1163
1240
  filter_conditions?: ChannelFilters<ChannelType, CommandType, UserType>;
@@ -1185,10 +1262,11 @@ export declare type TokenOrProvider = null | string | TokenProvider | undefined;
1185
1262
  export declare type TokenProvider = () => Promise<string>;
1186
1263
  export declare type TranslationLanguages = '' | 'af' | 'am' | 'ar' | 'az' | 'bg' | 'bn' | 'bs' | 'cs' | 'da' | 'de' | 'el' | 'en' | 'es' | 'es-MX' | 'et' | 'fa' | 'fa-AF' | 'fi' | 'fr' | 'fr-CA' | 'ha' | 'he' | 'hi' | 'hr' | 'hu' | 'id' | 'it' | 'ja' | 'ka' | 'ko' | 'lv' | 'ms' | 'nl' | 'no' | 'pl' | 'ps' | 'pt' | 'ro' | 'ru' | 'sk' | 'sl' | 'so' | 'sq' | 'sr' | 'sv' | 'sw' | 'ta' | 'th' | 'tl' | 'tr' | 'uk' | 'ur' | 'vi' | 'zh' | 'zh-TW';
1187
1264
  export declare type TypingStartEvent = Event;
1188
- export declare type UpdatedMessage<AttachmentType = UnknownType, ChannelType = UnknownType, CommandType extends string = LiteralStringForUnion, MessageType = UnknownType, ReactionType = UnknownType, UserType = UnknownType> = Omit<MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>, 'mentioned_users'> & {
1265
+ export declare type ReservedMessageFields = 'command' | 'created_at' | 'html' | 'latest_reactions' | 'own_reactions' | 'quoted_message' | 'reaction_counts' | 'reply_count' | 'type' | 'updated_at' | 'user' | '__html';
1266
+ export declare type UpdatedMessage<AttachmentType = UR, ChannelType = UR, CommandType extends string = LiteralStringForUnion, MessageType = UR, ReactionType = UR, UserType = UR> = Omit<MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>, 'mentioned_users'> & {
1189
1267
  mentioned_users?: string[];
1190
1268
  };
1191
- export declare type User<UserType = UnknownType> = UserType & {
1269
+ export declare type User<UserType = UR> = UserType & {
1192
1270
  id: string;
1193
1271
  anon?: boolean;
1194
1272
  name?: string;
@@ -1259,6 +1337,12 @@ export declare type TaskStatus = {
1259
1337
  description: string;
1260
1338
  type: string;
1261
1339
  };
1262
- result?: UnknownType;
1340
+ result?: UR;
1341
+ };
1342
+ export declare type TruncateOptions<AttachmentType, MessageType, UserType> = {
1343
+ hard_delete?: boolean;
1344
+ message?: Message<AttachmentType, MessageType, UserType>;
1345
+ skip_push?: boolean;
1346
+ truncated_at?: Date;
1263
1347
  };
1264
1348
  //# sourceMappingURL=types.d.ts.map