stream-chat 4.4.3-dev.2 → 5.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.
- package/README.md +4 -13
- package/dist/browser.es.js +1229 -720
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.full-bundle.min.js +1 -1
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/browser.js +1229 -719
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +1229 -720
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1229 -719
- package/dist/index.js.map +1 -1
- package/dist/types/base64.d.ts.map +1 -1
- package/dist/types/channel.d.ts +19 -15
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/channel_state.d.ts +2 -2
- package/dist/types/channel_state.d.ts.map +1 -1
- package/dist/types/client.d.ts +25 -42
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/client_state.d.ts +2 -2
- package/dist/types/client_state.d.ts.map +1 -1
- package/dist/types/connection.d.ts +14 -49
- package/dist/types/connection.d.ts.map +1 -1
- package/dist/types/connection_fallback.d.ts +41 -0
- package/dist/types/connection_fallback.d.ts.map +1 -0
- package/dist/types/errors.d.ts +14 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/insights.d.ts +17 -10
- package/dist/types/insights.d.ts.map +1 -1
- package/dist/types/permissions.d.ts.map +1 -1
- package/dist/types/signing.d.ts +3 -3
- package/dist/types/signing.d.ts.map +1 -1
- package/dist/types/token_manager.d.ts +2 -2
- package/dist/types/token_manager.d.ts.map +1 -1
- package/dist/types/types.d.ts +94 -88
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts +13 -3
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/base64.ts +1 -4
- package/src/channel.ts +133 -461
- package/src/channel_state.ts +31 -158
- package/src/client.ts +291 -712
- package/src/client_state.ts +2 -2
- package/src/connection.ts +146 -395
- package/src/connection_fallback.ts +205 -0
- package/src/errors.ts +58 -0
- package/src/insights.ts +38 -32
- package/src/permissions.ts +3 -24
- package/src/signing.ts +6 -17
- package/src/token_manager.ts +6 -18
- package/src/types.ts +268 -512
- package/src/utils.ts +58 -24
- package/CHANGELOG.md +0 -844
package/src/types.ts
CHANGED
|
@@ -24,15 +24,14 @@ export type RequireAtLeastOne<T> = {
|
|
|
24
24
|
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
|
|
25
25
|
}[keyof T];
|
|
26
26
|
|
|
27
|
-
export type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<
|
|
28
|
-
T,
|
|
29
|
-
Exclude<keyof T, Keys>
|
|
30
|
-
> &
|
|
27
|
+
export type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &
|
|
31
28
|
{
|
|
32
29
|
[K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
|
|
33
30
|
}[Keys];
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
/* Unknown Record */
|
|
33
|
+
export type UR = Record<string, unknown>;
|
|
34
|
+
export type UnknownType = UR; //alias to avoid breaking change
|
|
36
35
|
|
|
37
36
|
export type Unpacked<T> = T extends (infer U)[]
|
|
38
37
|
? U // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -50,9 +49,7 @@ export type APIResponse = {
|
|
|
50
49
|
duration: string;
|
|
51
50
|
};
|
|
52
51
|
|
|
53
|
-
export type AppSettingsAPIResponse<
|
|
54
|
-
CommandType extends string = LiteralStringForUnion
|
|
55
|
-
> = APIResponse & {
|
|
52
|
+
export type AppSettingsAPIResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
|
|
56
53
|
app?: {
|
|
57
54
|
channel_configs: Record<
|
|
58
55
|
string,
|
|
@@ -129,22 +126,15 @@ export type ModerationResult = {
|
|
|
129
126
|
};
|
|
130
127
|
|
|
131
128
|
export type MessageFlagsResponse<
|
|
132
|
-
ChannelType extends
|
|
129
|
+
ChannelType extends UR = UR,
|
|
133
130
|
CommandType extends string = LiteralStringForUnion,
|
|
134
|
-
UserType extends
|
|
135
|
-
AttachmentType =
|
|
136
|
-
MessageType =
|
|
137
|
-
ReactionType =
|
|
131
|
+
UserType extends UR = UR,
|
|
132
|
+
AttachmentType = UR,
|
|
133
|
+
MessageType = UR,
|
|
134
|
+
ReactionType = UR
|
|
138
135
|
> = APIResponse & {
|
|
139
136
|
flags?: Array<{
|
|
140
|
-
message: MessageResponse<
|
|
141
|
-
AttachmentType,
|
|
142
|
-
ChannelType,
|
|
143
|
-
CommandType,
|
|
144
|
-
MessageType,
|
|
145
|
-
ReactionType,
|
|
146
|
-
UserType
|
|
147
|
-
>;
|
|
137
|
+
message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
|
|
148
138
|
user: UserResponse<UserType>;
|
|
149
139
|
approved_at?: string;
|
|
150
140
|
created_at?: string;
|
|
@@ -158,9 +148,9 @@ export type MessageFlagsResponse<
|
|
|
158
148
|
};
|
|
159
149
|
|
|
160
150
|
export type BannedUsersResponse<
|
|
161
|
-
ChannelType extends
|
|
151
|
+
ChannelType extends UR = UR,
|
|
162
152
|
CommandType extends string = LiteralStringForUnion,
|
|
163
|
-
UserType extends
|
|
153
|
+
UserType extends UR = UR
|
|
164
154
|
> = APIResponse & {
|
|
165
155
|
bans?: Array<{
|
|
166
156
|
user: UserResponse<UserType>;
|
|
@@ -179,9 +169,9 @@ export type BlockListResponse = BlockList & {
|
|
|
179
169
|
};
|
|
180
170
|
|
|
181
171
|
export type ChannelResponse<
|
|
182
|
-
ChannelType =
|
|
172
|
+
ChannelType = UR,
|
|
183
173
|
CommandType extends string = LiteralStringForUnion,
|
|
184
|
-
UserType =
|
|
174
|
+
UserType = UR
|
|
185
175
|
> = ChannelType & {
|
|
186
176
|
cid: string;
|
|
187
177
|
disabled: boolean;
|
|
@@ -205,35 +195,22 @@ export type ChannelResponse<
|
|
|
205
195
|
name?: string;
|
|
206
196
|
own_capabilities?: string[];
|
|
207
197
|
team?: string;
|
|
198
|
+
truncated_at?: string;
|
|
208
199
|
updated_at?: string;
|
|
209
200
|
};
|
|
210
201
|
|
|
211
202
|
export type ChannelAPIResponse<
|
|
212
|
-
AttachmentType =
|
|
213
|
-
ChannelType =
|
|
203
|
+
AttachmentType = UR,
|
|
204
|
+
ChannelType = UR,
|
|
214
205
|
CommandType extends string = LiteralStringForUnion,
|
|
215
|
-
MessageType =
|
|
216
|
-
ReactionType =
|
|
217
|
-
UserType =
|
|
206
|
+
MessageType = UR,
|
|
207
|
+
ReactionType = UR,
|
|
208
|
+
UserType = UR
|
|
218
209
|
> = APIResponse & {
|
|
219
210
|
channel: ChannelResponse<ChannelType, CommandType, UserType>;
|
|
220
211
|
members: ChannelMemberResponse<UserType>[];
|
|
221
|
-
messages: MessageResponse<
|
|
222
|
-
|
|
223
|
-
ChannelType,
|
|
224
|
-
CommandType,
|
|
225
|
-
MessageType,
|
|
226
|
-
ReactionType,
|
|
227
|
-
UserType
|
|
228
|
-
>[];
|
|
229
|
-
pinned_messages: MessageResponse<
|
|
230
|
-
AttachmentType,
|
|
231
|
-
ChannelType,
|
|
232
|
-
CommandType,
|
|
233
|
-
MessageType,
|
|
234
|
-
ReactionType,
|
|
235
|
-
UserType
|
|
236
|
-
>[];
|
|
212
|
+
messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
|
|
213
|
+
pinned_messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
|
|
237
214
|
hidden?: boolean;
|
|
238
215
|
membership?: ChannelMembership<UserType> | null;
|
|
239
216
|
read?: ReadResponse<UserType>[];
|
|
@@ -241,11 +218,16 @@ export type ChannelAPIResponse<
|
|
|
241
218
|
watchers?: UserResponse<UserType>[];
|
|
242
219
|
};
|
|
243
220
|
|
|
244
|
-
export type
|
|
221
|
+
export type ChannelUpdateOptions = {
|
|
222
|
+
hide_history?: boolean;
|
|
223
|
+
skip_push?: boolean;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export type ChannelMemberAPIResponse<UserType = UR> = APIResponse & {
|
|
245
227
|
members: ChannelMemberResponse<UserType>[];
|
|
246
228
|
};
|
|
247
229
|
|
|
248
|
-
export type ChannelMemberResponse<UserType =
|
|
230
|
+
export type ChannelMemberResponse<UserType = UR> = {
|
|
249
231
|
banned?: boolean;
|
|
250
232
|
channel_role?: Role;
|
|
251
233
|
created_at?: string;
|
|
@@ -277,9 +259,7 @@ export type CheckSQSResponse = APIResponse & {
|
|
|
277
259
|
error?: string;
|
|
278
260
|
};
|
|
279
261
|
|
|
280
|
-
export type CommandResponse<
|
|
281
|
-
CommandType extends string = LiteralStringForUnion
|
|
282
|
-
> = Partial<CreatedAtUpdatedAt> & {
|
|
262
|
+
export type CommandResponse<CommandType extends string = LiteralStringForUnion> = Partial<CreatedAtUpdatedAt> & {
|
|
283
263
|
args?: string;
|
|
284
264
|
description?: string;
|
|
285
265
|
name?: CommandVariants<CommandType>;
|
|
@@ -287,56 +267,44 @@ export type CommandResponse<
|
|
|
287
267
|
};
|
|
288
268
|
|
|
289
269
|
export type ConnectAPIResponse<
|
|
290
|
-
ChannelType extends
|
|
270
|
+
ChannelType extends UR = UR,
|
|
291
271
|
CommandType extends string = LiteralStringForUnion,
|
|
292
|
-
UserType extends
|
|
272
|
+
UserType extends UR = UR
|
|
293
273
|
> = Promise<void | ConnectionOpen<ChannelType, CommandType, UserType>>;
|
|
294
274
|
|
|
295
|
-
export type CreateChannelResponse<
|
|
296
|
-
CommandType extends string = LiteralStringForUnion
|
|
297
|
-
> = APIResponse &
|
|
275
|
+
export type CreateChannelResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
|
|
298
276
|
Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id'> & {
|
|
299
277
|
created_at: string;
|
|
300
278
|
updated_at: string;
|
|
301
279
|
grants?: Record<string, string[]>;
|
|
302
280
|
};
|
|
303
281
|
|
|
304
|
-
export type CreateCommandResponse<
|
|
305
|
-
CommandType
|
|
306
|
-
|
|
282
|
+
export type CreateCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
|
|
283
|
+
command: CreateCommandOptions<CommandType> & CreatedAtUpdatedAt;
|
|
284
|
+
};
|
|
307
285
|
|
|
308
286
|
export type DeleteChannelAPIResponse<
|
|
309
|
-
ChannelType =
|
|
287
|
+
ChannelType = UR,
|
|
310
288
|
CommandType extends string = LiteralStringForUnion,
|
|
311
|
-
UserType =
|
|
289
|
+
UserType = UR
|
|
312
290
|
> = APIResponse & {
|
|
313
291
|
channel: ChannelResponse<ChannelType, CommandType, UserType>;
|
|
314
292
|
};
|
|
315
293
|
|
|
316
|
-
export type DeleteCommandResponse<
|
|
317
|
-
CommandType extends string = LiteralStringForUnion
|
|
318
|
-
> = APIResponse & {
|
|
294
|
+
export type DeleteCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
|
|
319
295
|
name?: CommandVariants<CommandType>;
|
|
320
296
|
};
|
|
321
297
|
|
|
322
298
|
export type EventAPIResponse<
|
|
323
|
-
AttachmentType extends
|
|
324
|
-
ChannelType extends
|
|
299
|
+
AttachmentType extends UR = UR,
|
|
300
|
+
ChannelType extends UR = UR,
|
|
325
301
|
CommandType extends string = LiteralStringForUnion,
|
|
326
|
-
EventType extends
|
|
327
|
-
MessageType extends
|
|
328
|
-
ReactionType extends
|
|
329
|
-
UserType extends
|
|
302
|
+
EventType extends UR = UR,
|
|
303
|
+
MessageType extends UR = UR,
|
|
304
|
+
ReactionType extends UR = UR,
|
|
305
|
+
UserType extends UR = UR
|
|
330
306
|
> = APIResponse & {
|
|
331
|
-
event: Event<
|
|
332
|
-
AttachmentType,
|
|
333
|
-
ChannelType,
|
|
334
|
-
CommandType,
|
|
335
|
-
EventType,
|
|
336
|
-
MessageType,
|
|
337
|
-
ReactionType,
|
|
338
|
-
UserType
|
|
339
|
-
>;
|
|
307
|
+
event: Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>;
|
|
340
308
|
};
|
|
341
309
|
|
|
342
310
|
export type ExportChannelResponse = {
|
|
@@ -350,7 +318,7 @@ export type ExportChannelStatusResponse = {
|
|
|
350
318
|
updated_at?: string;
|
|
351
319
|
};
|
|
352
320
|
|
|
353
|
-
export type FlagMessageResponse<UserType =
|
|
321
|
+
export type FlagMessageResponse<UserType = UR> = APIResponse & {
|
|
354
322
|
flag: {
|
|
355
323
|
created_at: string;
|
|
356
324
|
created_by_automod: boolean;
|
|
@@ -364,7 +332,7 @@ export type FlagMessageResponse<UserType = UnknownType> = APIResponse & {
|
|
|
364
332
|
};
|
|
365
333
|
};
|
|
366
334
|
|
|
367
|
-
export type FlagUserResponse<UserType =
|
|
335
|
+
export type FlagUserResponse<UserType = UR> = APIResponse & {
|
|
368
336
|
flag: {
|
|
369
337
|
created_at: string;
|
|
370
338
|
created_by_automod: boolean;
|
|
@@ -379,12 +347,12 @@ export type FlagUserResponse<UserType = UnknownType> = APIResponse & {
|
|
|
379
347
|
};
|
|
380
348
|
|
|
381
349
|
export type FormatMessageResponse<
|
|
382
|
-
AttachmentType =
|
|
383
|
-
ChannelType =
|
|
350
|
+
AttachmentType = UR,
|
|
351
|
+
ChannelType = UR,
|
|
384
352
|
CommandType extends string = LiteralStringForUnion,
|
|
385
|
-
MessageType =
|
|
386
|
-
ReactionType =
|
|
387
|
-
UserType =
|
|
353
|
+
MessageType = UR,
|
|
354
|
+
ReactionType = UR,
|
|
355
|
+
UserType = UR
|
|
388
356
|
> = Omit<
|
|
389
357
|
MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>,
|
|
390
358
|
'created_at' | 'pinned_at' | 'updated_at' | 'status'
|
|
@@ -396,9 +364,7 @@ export type FormatMessageResponse<
|
|
|
396
364
|
updated_at: Date;
|
|
397
365
|
};
|
|
398
366
|
|
|
399
|
-
export type GetChannelTypeResponse<
|
|
400
|
-
CommandType extends string = LiteralStringForUnion
|
|
401
|
-
> = APIResponse &
|
|
367
|
+
export type GetChannelTypeResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
|
|
402
368
|
Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id' | 'commands'> & {
|
|
403
369
|
created_at: string;
|
|
404
370
|
updated_at: string;
|
|
@@ -406,26 +372,19 @@ export type GetChannelTypeResponse<
|
|
|
406
372
|
grants?: Record<string, string[]>;
|
|
407
373
|
};
|
|
408
374
|
|
|
409
|
-
export type GetCommandResponse<
|
|
410
|
-
CommandType
|
|
411
|
-
|
|
375
|
+
export type GetCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
|
|
376
|
+
CreateCommandOptions<CommandType> &
|
|
377
|
+
CreatedAtUpdatedAt;
|
|
412
378
|
|
|
413
379
|
export type GetMultipleMessagesAPIResponse<
|
|
414
|
-
AttachmentType =
|
|
415
|
-
ChannelType =
|
|
380
|
+
AttachmentType = UR,
|
|
381
|
+
ChannelType = UR,
|
|
416
382
|
CommandType extends string = LiteralStringForUnion,
|
|
417
|
-
MessageType =
|
|
418
|
-
ReactionType =
|
|
419
|
-
UserType =
|
|
383
|
+
MessageType = UR,
|
|
384
|
+
ReactionType = UR,
|
|
385
|
+
UserType = UR
|
|
420
386
|
> = APIResponse & {
|
|
421
|
-
messages: MessageResponse<
|
|
422
|
-
AttachmentType,
|
|
423
|
-
ChannelType,
|
|
424
|
-
CommandType,
|
|
425
|
-
MessageType,
|
|
426
|
-
ReactionType,
|
|
427
|
-
UserType
|
|
428
|
-
>[];
|
|
387
|
+
messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
|
|
429
388
|
};
|
|
430
389
|
|
|
431
390
|
export type GetRateLimitsResponse = APIResponse & {
|
|
@@ -435,40 +394,25 @@ export type GetRateLimitsResponse = APIResponse & {
|
|
|
435
394
|
web?: RateLimitsMap;
|
|
436
395
|
};
|
|
437
396
|
|
|
438
|
-
export type GetReactionsAPIResponse<
|
|
439
|
-
ReactionType = UnknownType,
|
|
440
|
-
UserType = UnknownType
|
|
441
|
-
> = APIResponse & {
|
|
397
|
+
export type GetReactionsAPIResponse<ReactionType = UR, UserType = UR> = APIResponse & {
|
|
442
398
|
reactions: ReactionResponse<ReactionType, UserType>[];
|
|
443
399
|
};
|
|
444
400
|
|
|
445
401
|
export type GetRepliesAPIResponse<
|
|
446
|
-
AttachmentType =
|
|
447
|
-
ChannelType =
|
|
402
|
+
AttachmentType = UR,
|
|
403
|
+
ChannelType = UR,
|
|
448
404
|
CommandType extends string = LiteralStringForUnion,
|
|
449
|
-
MessageType =
|
|
450
|
-
ReactionType =
|
|
451
|
-
UserType =
|
|
405
|
+
MessageType = UR,
|
|
406
|
+
ReactionType = UR,
|
|
407
|
+
UserType = UR
|
|
452
408
|
> = APIResponse & {
|
|
453
|
-
messages: MessageResponse<
|
|
454
|
-
AttachmentType,
|
|
455
|
-
ChannelType,
|
|
456
|
-
CommandType,
|
|
457
|
-
MessageType,
|
|
458
|
-
ReactionType,
|
|
459
|
-
UserType
|
|
460
|
-
>[];
|
|
409
|
+
messages: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>[];
|
|
461
410
|
};
|
|
462
411
|
|
|
463
|
-
export type ListChannelResponse<
|
|
464
|
-
CommandType extends string = LiteralStringForUnion
|
|
465
|
-
> = APIResponse & {
|
|
412
|
+
export type ListChannelResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
|
|
466
413
|
channel_types: Record<
|
|
467
414
|
string,
|
|
468
|
-
Omit<
|
|
469
|
-
CreateChannelOptions<CommandType>,
|
|
470
|
-
'client_id' | 'connection_id' | 'commands'
|
|
471
|
-
> & {
|
|
415
|
+
Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id' | 'commands'> & {
|
|
472
416
|
commands: CommandResponse<CommandType>[];
|
|
473
417
|
created_at: string;
|
|
474
418
|
updated_at: string;
|
|
@@ -481,16 +425,14 @@ export type ListChannelTypesAPIResponse<
|
|
|
481
425
|
CommandType extends string = LiteralStringForUnion
|
|
482
426
|
> = ListChannelResponse<CommandType>;
|
|
483
427
|
|
|
484
|
-
export type ListCommandsResponse<
|
|
485
|
-
CommandType extends string = LiteralStringForUnion
|
|
486
|
-
> = APIResponse & {
|
|
428
|
+
export type ListCommandsResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
|
|
487
429
|
commands: Array<CreateCommandOptions<CommandType> & CreatedAtUpdatedAt>;
|
|
488
430
|
};
|
|
489
431
|
|
|
490
432
|
export type MuteChannelAPIResponse<
|
|
491
|
-
ChannelType extends
|
|
433
|
+
ChannelType extends UR = UR,
|
|
492
434
|
CommandType extends string = LiteralStringForUnion,
|
|
493
|
-
UserType extends
|
|
435
|
+
UserType extends UR = UR
|
|
494
436
|
> = APIResponse & {
|
|
495
437
|
channel_mute: ChannelMute<ChannelType, CommandType, UserType>;
|
|
496
438
|
own_user: OwnUserResponse<ChannelType, CommandType, UserType>;
|
|
@@ -499,37 +441,23 @@ export type MuteChannelAPIResponse<
|
|
|
499
441
|
};
|
|
500
442
|
|
|
501
443
|
export type MessageResponse<
|
|
502
|
-
AttachmentType =
|
|
503
|
-
ChannelType =
|
|
444
|
+
AttachmentType = UR,
|
|
445
|
+
ChannelType = UR,
|
|
504
446
|
CommandType extends string = LiteralStringForUnion,
|
|
505
|
-
MessageType =
|
|
506
|
-
ReactionType =
|
|
507
|
-
UserType =
|
|
508
|
-
> = MessageResponseBase<
|
|
509
|
-
AttachmentType,
|
|
510
|
-
ChannelType,
|
|
511
|
-
CommandType,
|
|
512
|
-
MessageType,
|
|
513
|
-
ReactionType,
|
|
514
|
-
UserType
|
|
515
|
-
> & {
|
|
516
|
-
quoted_message?: MessageResponseBase<
|
|
517
|
-
AttachmentType,
|
|
518
|
-
ChannelType,
|
|
519
|
-
CommandType,
|
|
520
|
-
MessageType,
|
|
521
|
-
ReactionType,
|
|
522
|
-
UserType
|
|
523
|
-
>;
|
|
447
|
+
MessageType = UR,
|
|
448
|
+
ReactionType = UR,
|
|
449
|
+
UserType = UR
|
|
450
|
+
> = MessageResponseBase<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType> & {
|
|
451
|
+
quoted_message?: MessageResponseBase<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
|
|
524
452
|
};
|
|
525
453
|
|
|
526
454
|
export type MessageResponseBase<
|
|
527
|
-
AttachmentType =
|
|
528
|
-
ChannelType =
|
|
455
|
+
AttachmentType = UR,
|
|
456
|
+
ChannelType = UR,
|
|
529
457
|
CommandType extends string = LiteralStringForUnion,
|
|
530
|
-
MessageType =
|
|
531
|
-
ReactionType =
|
|
532
|
-
UserType =
|
|
458
|
+
MessageType = UR,
|
|
459
|
+
ReactionType = UR,
|
|
460
|
+
UserType = UR
|
|
533
461
|
> = MessageBase<AttachmentType, MessageType, UserType> & {
|
|
534
462
|
args?: string;
|
|
535
463
|
channel?: ChannelResponse<ChannelType, CommandType, UserType>;
|
|
@@ -558,7 +486,7 @@ export type MessageResponseBase<
|
|
|
558
486
|
updated_at?: string;
|
|
559
487
|
};
|
|
560
488
|
|
|
561
|
-
export type MuteResponse<UserType =
|
|
489
|
+
export type MuteResponse<UserType = UR> = {
|
|
562
490
|
user: UserResponse<UserType>;
|
|
563
491
|
created_at?: string;
|
|
564
492
|
expires?: string;
|
|
@@ -567,9 +495,9 @@ export type MuteResponse<UserType = UnknownType> = {
|
|
|
567
495
|
};
|
|
568
496
|
|
|
569
497
|
export type MuteUserResponse<
|
|
570
|
-
ChannelType extends
|
|
498
|
+
ChannelType extends UR = UR,
|
|
571
499
|
CommandType extends string = LiteralStringForUnion,
|
|
572
|
-
UserType extends
|
|
500
|
+
UserType extends UR = UR
|
|
573
501
|
> = APIResponse & {
|
|
574
502
|
mute?: MuteResponse<UserType>;
|
|
575
503
|
mutes?: Array<Mute<UserType>>;
|
|
@@ -577,9 +505,9 @@ export type MuteUserResponse<
|
|
|
577
505
|
};
|
|
578
506
|
|
|
579
507
|
export type OwnUserBase<
|
|
580
|
-
ChannelType extends
|
|
508
|
+
ChannelType extends UR = UR,
|
|
581
509
|
CommandType extends string = LiteralStringForUnion,
|
|
582
|
-
UserType extends
|
|
510
|
+
UserType extends UR = UR
|
|
583
511
|
> = {
|
|
584
512
|
channel_mutes: ChannelMute<ChannelType, CommandType, UserType>[];
|
|
585
513
|
devices: Device<UserType>[];
|
|
@@ -592,15 +520,15 @@ export type OwnUserBase<
|
|
|
592
520
|
};
|
|
593
521
|
|
|
594
522
|
export type OwnUserResponse<
|
|
595
|
-
ChannelType extends
|
|
523
|
+
ChannelType extends UR = UR,
|
|
596
524
|
CommandType extends string = LiteralStringForUnion,
|
|
597
|
-
UserType extends
|
|
525
|
+
UserType extends UR = UR
|
|
598
526
|
> = UserResponse<UserType> & OwnUserBase<ChannelType, CommandType, UserType>;
|
|
599
527
|
|
|
600
528
|
export type PartialUpdateChannelAPIResponse<
|
|
601
|
-
ChannelType =
|
|
529
|
+
ChannelType = UR,
|
|
602
530
|
CommandType extends string = LiteralStringForUnion,
|
|
603
|
-
UserType =
|
|
531
|
+
UserType = UR
|
|
604
532
|
> = APIResponse & {
|
|
605
533
|
channel: ChannelResponse<ChannelType, CommandType, UserType>;
|
|
606
534
|
members: ChannelMemberResponse<UserType>[];
|
|
@@ -615,55 +543,38 @@ export type PermissionsAPIResponse = APIResponse & {
|
|
|
615
543
|
};
|
|
616
544
|
|
|
617
545
|
export type ReactionAPIResponse<
|
|
618
|
-
AttachmentType =
|
|
619
|
-
ChannelType =
|
|
546
|
+
AttachmentType = UR,
|
|
547
|
+
ChannelType = UR,
|
|
620
548
|
CommandType extends string = LiteralStringForUnion,
|
|
621
|
-
MessageType =
|
|
622
|
-
ReactionType =
|
|
623
|
-
UserType =
|
|
549
|
+
MessageType = UR,
|
|
550
|
+
ReactionType = UR,
|
|
551
|
+
UserType = UR
|
|
624
552
|
> = APIResponse & {
|
|
625
|
-
message: MessageResponse<
|
|
626
|
-
AttachmentType,
|
|
627
|
-
ChannelType,
|
|
628
|
-
CommandType,
|
|
629
|
-
MessageType,
|
|
630
|
-
ReactionType,
|
|
631
|
-
UserType
|
|
632
|
-
>;
|
|
553
|
+
message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
|
|
633
554
|
reaction: ReactionResponse<ReactionType, UserType>;
|
|
634
555
|
};
|
|
635
556
|
|
|
636
|
-
export type ReactionResponse<
|
|
637
|
-
ReactionType = UnknownType,
|
|
638
|
-
UserType = UnknownType
|
|
639
|
-
> = Reaction<ReactionType, UserType> & {
|
|
557
|
+
export type ReactionResponse<ReactionType = UR, UserType = UR> = Reaction<ReactionType, UserType> & {
|
|
640
558
|
created_at: string;
|
|
641
559
|
updated_at: string;
|
|
642
560
|
};
|
|
643
561
|
|
|
644
|
-
export type ReadResponse<UserType =
|
|
562
|
+
export type ReadResponse<UserType = UR> = {
|
|
645
563
|
last_read: string;
|
|
646
564
|
user: UserResponse<UserType>;
|
|
647
565
|
unread_messages?: number;
|
|
648
566
|
};
|
|
649
567
|
|
|
650
568
|
export type SearchAPIResponse<
|
|
651
|
-
AttachmentType =
|
|
652
|
-
ChannelType =
|
|
569
|
+
AttachmentType = UR,
|
|
570
|
+
ChannelType = UR,
|
|
653
571
|
CommandType extends string = LiteralStringForUnion,
|
|
654
|
-
MessageType =
|
|
655
|
-
ReactionType =
|
|
656
|
-
UserType =
|
|
572
|
+
MessageType = UR,
|
|
573
|
+
ReactionType = UR,
|
|
574
|
+
UserType = UR
|
|
657
575
|
> = APIResponse & {
|
|
658
576
|
results: {
|
|
659
|
-
message: MessageResponse<
|
|
660
|
-
AttachmentType,
|
|
661
|
-
ChannelType,
|
|
662
|
-
CommandType,
|
|
663
|
-
MessageType,
|
|
664
|
-
ReactionType,
|
|
665
|
-
UserType
|
|
666
|
-
>;
|
|
577
|
+
message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
|
|
667
578
|
}[];
|
|
668
579
|
next?: string;
|
|
669
580
|
previous?: string;
|
|
@@ -679,62 +590,48 @@ export type SearchWarning = {
|
|
|
679
590
|
export type SendFileAPIResponse = APIResponse & { file: string };
|
|
680
591
|
|
|
681
592
|
export type SendMessageAPIResponse<
|
|
682
|
-
AttachmentType =
|
|
683
|
-
ChannelType =
|
|
593
|
+
AttachmentType = UR,
|
|
594
|
+
ChannelType = UR,
|
|
684
595
|
CommandType extends string = LiteralStringForUnion,
|
|
685
|
-
MessageType =
|
|
686
|
-
ReactionType =
|
|
687
|
-
UserType =
|
|
596
|
+
MessageType = UR,
|
|
597
|
+
ReactionType = UR,
|
|
598
|
+
UserType = UR
|
|
688
599
|
> = APIResponse & {
|
|
689
|
-
message: MessageResponse<
|
|
690
|
-
AttachmentType,
|
|
691
|
-
ChannelType,
|
|
692
|
-
CommandType,
|
|
693
|
-
MessageType,
|
|
694
|
-
ReactionType,
|
|
695
|
-
UserType
|
|
696
|
-
>;
|
|
600
|
+
message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
|
|
697
601
|
};
|
|
698
602
|
|
|
699
603
|
export type TruncateChannelAPIResponse<
|
|
700
|
-
ChannelType =
|
|
604
|
+
ChannelType = UR,
|
|
701
605
|
CommandType extends string = LiteralStringForUnion,
|
|
702
|
-
UserType =
|
|
606
|
+
UserType = UR,
|
|
607
|
+
AttachmentType = UR,
|
|
608
|
+
MessageType = UR,
|
|
609
|
+
ReactionType = UR
|
|
703
610
|
> = APIResponse & {
|
|
704
611
|
channel: ChannelResponse<ChannelType, CommandType, UserType>;
|
|
612
|
+
message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
|
|
705
613
|
};
|
|
706
614
|
|
|
707
615
|
export type UpdateChannelAPIResponse<
|
|
708
|
-
AttachmentType =
|
|
709
|
-
ChannelType =
|
|
616
|
+
AttachmentType = UR,
|
|
617
|
+
ChannelType = UR,
|
|
710
618
|
CommandType extends string = LiteralStringForUnion,
|
|
711
|
-
MessageType =
|
|
712
|
-
ReactionType =
|
|
713
|
-
UserType =
|
|
619
|
+
MessageType = UR,
|
|
620
|
+
ReactionType = UR,
|
|
621
|
+
UserType = UR
|
|
714
622
|
> = APIResponse & {
|
|
715
623
|
channel: ChannelResponse<ChannelType, CommandType, UserType>;
|
|
716
624
|
members: ChannelMemberResponse<UserType>[];
|
|
717
|
-
message?: MessageResponse<
|
|
718
|
-
AttachmentType,
|
|
719
|
-
ChannelType,
|
|
720
|
-
CommandType,
|
|
721
|
-
MessageType,
|
|
722
|
-
ReactionType,
|
|
723
|
-
UserType
|
|
724
|
-
>;
|
|
625
|
+
message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
|
|
725
626
|
};
|
|
726
627
|
|
|
727
|
-
export type UpdateChannelResponse<
|
|
728
|
-
CommandType extends string = LiteralStringForUnion
|
|
729
|
-
> = APIResponse &
|
|
628
|
+
export type UpdateChannelResponse<CommandType extends string = LiteralStringForUnion> = APIResponse &
|
|
730
629
|
Omit<CreateChannelOptions<CommandType>, 'client_id' | 'connection_id'> & {
|
|
731
630
|
created_at: string;
|
|
732
631
|
updated_at: string;
|
|
733
632
|
};
|
|
734
633
|
|
|
735
|
-
export type UpdateCommandResponse<
|
|
736
|
-
CommandType extends string = LiteralStringForUnion
|
|
737
|
-
> = APIResponse & {
|
|
634
|
+
export type UpdateCommandResponse<CommandType extends string = LiteralStringForUnion> = APIResponse & {
|
|
738
635
|
command: UpdateCommandOptions<CommandType> &
|
|
739
636
|
CreatedAtUpdatedAt & {
|
|
740
637
|
name: CommandVariants<CommandType>;
|
|
@@ -742,32 +639,25 @@ export type UpdateCommandResponse<
|
|
|
742
639
|
};
|
|
743
640
|
|
|
744
641
|
export type UpdateMessageAPIResponse<
|
|
745
|
-
AttachmentType =
|
|
746
|
-
ChannelType =
|
|
642
|
+
AttachmentType = UR,
|
|
643
|
+
ChannelType = UR,
|
|
747
644
|
CommandType extends string = LiteralStringForUnion,
|
|
748
|
-
MessageType =
|
|
749
|
-
ReactionType =
|
|
750
|
-
UserType =
|
|
645
|
+
MessageType = UR,
|
|
646
|
+
ReactionType = UR,
|
|
647
|
+
UserType = UR
|
|
751
648
|
> = APIResponse & {
|
|
752
|
-
message: MessageResponse<
|
|
753
|
-
AttachmentType,
|
|
754
|
-
ChannelType,
|
|
755
|
-
CommandType,
|
|
756
|
-
MessageType,
|
|
757
|
-
ReactionType,
|
|
758
|
-
UserType
|
|
759
|
-
>;
|
|
649
|
+
message: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
|
|
760
650
|
};
|
|
761
651
|
|
|
762
|
-
export type UsersAPIResponse<UserType =
|
|
652
|
+
export type UsersAPIResponse<UserType = UR> = APIResponse & {
|
|
763
653
|
users: Array<UserResponse<UserType>>;
|
|
764
654
|
};
|
|
765
655
|
|
|
766
|
-
export type UpdateUsersAPIResponse<UserType =
|
|
656
|
+
export type UpdateUsersAPIResponse<UserType = UR> = APIResponse & {
|
|
767
657
|
users: { [key: string]: UserResponse<UserType> };
|
|
768
658
|
};
|
|
769
659
|
|
|
770
|
-
export type UserResponse<UserType =
|
|
660
|
+
export type UserResponse<UserType = UR> = User<UserType> & {
|
|
771
661
|
banned?: boolean;
|
|
772
662
|
created_at?: string;
|
|
773
663
|
deactivated_at?: string;
|
|
@@ -789,44 +679,28 @@ export type MessageFlagsPaginationOptions = {
|
|
|
789
679
|
offset?: number;
|
|
790
680
|
};
|
|
791
681
|
|
|
792
|
-
export type BannedUsersPaginationOptions = Omit<
|
|
793
|
-
PaginationOptions,
|
|
794
|
-
'id_gt' | 'id_gte' | 'id_lt' | 'id_lte'
|
|
795
|
-
>;
|
|
682
|
+
export type BannedUsersPaginationOptions = Omit<PaginationOptions, 'id_gt' | 'id_gte' | 'id_lt' | 'id_lte'>;
|
|
796
683
|
|
|
797
|
-
export type BanUserOptions<UserType =
|
|
684
|
+
export type BanUserOptions<UserType = UR> = UnBanUserOptions & {
|
|
798
685
|
banned_by?: UserResponse<UserType>;
|
|
799
686
|
banned_by_id?: string;
|
|
800
687
|
ip_ban?: boolean;
|
|
801
688
|
reason?: string;
|
|
802
689
|
timeout?: number;
|
|
803
|
-
/**
|
|
804
|
-
* @deprecated please use banned_by
|
|
805
|
-
*/
|
|
806
|
-
user?: UserResponse<UserType>;
|
|
807
|
-
/**
|
|
808
|
-
* @deprecated please use banned_by_id
|
|
809
|
-
*/
|
|
810
|
-
user_id?: string;
|
|
811
690
|
};
|
|
812
691
|
|
|
813
692
|
export type ChannelOptions = {
|
|
814
|
-
last_message_ids?: { [key: string]: string };
|
|
815
693
|
limit?: number;
|
|
694
|
+
member_limit?: number;
|
|
816
695
|
message_limit?: number;
|
|
817
696
|
offset?: number;
|
|
818
697
|
presence?: boolean;
|
|
819
|
-
recovery?: boolean;
|
|
820
698
|
state?: boolean;
|
|
821
699
|
user_id?: string;
|
|
822
700
|
watch?: boolean;
|
|
823
701
|
};
|
|
824
702
|
|
|
825
|
-
export type ChannelQueryOptions<
|
|
826
|
-
ChannelType = UnknownType,
|
|
827
|
-
CommandType extends string = LiteralStringForUnion,
|
|
828
|
-
UserType = UnknownType
|
|
829
|
-
> = {
|
|
703
|
+
export type ChannelQueryOptions<ChannelType = UR, CommandType extends string = LiteralStringForUnion, UserType = UR> = {
|
|
830
704
|
client_id?: string;
|
|
831
705
|
connection_id?: string;
|
|
832
706
|
data?: ChannelResponse<ChannelType, CommandType, UserType>;
|
|
@@ -889,12 +763,12 @@ export type CustomPermissionOptions = {
|
|
|
889
763
|
|
|
890
764
|
// TODO: rename to UpdateChannelOptions in the next major update and use it in channel._update and/or channel.update
|
|
891
765
|
export type InviteOptions<
|
|
892
|
-
AttachmentType =
|
|
893
|
-
ChannelType =
|
|
766
|
+
AttachmentType = UR,
|
|
767
|
+
ChannelType = UR,
|
|
894
768
|
CommandType extends string = LiteralStringForUnion,
|
|
895
|
-
MessageType =
|
|
896
|
-
ReactionType =
|
|
897
|
-
UserType =
|
|
769
|
+
MessageType = UR,
|
|
770
|
+
ReactionType = UR,
|
|
771
|
+
UserType = UR
|
|
898
772
|
> = {
|
|
899
773
|
accept_invite?: boolean;
|
|
900
774
|
add_members?: string[];
|
|
@@ -904,14 +778,7 @@ export type InviteOptions<
|
|
|
904
778
|
data?: Omit<ChannelResponse<ChannelType, CommandType, UserType>, 'id' | 'cid'>;
|
|
905
779
|
demote_moderators?: string[];
|
|
906
780
|
invites?: string[];
|
|
907
|
-
message?: MessageResponse<
|
|
908
|
-
AttachmentType,
|
|
909
|
-
ChannelType,
|
|
910
|
-
CommandType,
|
|
911
|
-
MessageType,
|
|
912
|
-
ReactionType,
|
|
913
|
-
UserType
|
|
914
|
-
>;
|
|
781
|
+
message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
|
|
915
782
|
reject_invite?: boolean;
|
|
916
783
|
remove_members?: string[];
|
|
917
784
|
user?: UserResponse<UserType>;
|
|
@@ -919,11 +786,9 @@ export type InviteOptions<
|
|
|
919
786
|
};
|
|
920
787
|
|
|
921
788
|
/** @deprecated use MarkChannelsReadOptions instead */
|
|
922
|
-
export type MarkAllReadOptions<
|
|
923
|
-
UserType = UnknownType
|
|
924
|
-
> = MarkChannelsReadOptions<UserType>;
|
|
789
|
+
export type MarkAllReadOptions<UserType = UR> = MarkChannelsReadOptions<UserType>;
|
|
925
790
|
|
|
926
|
-
export type MarkChannelsReadOptions<UserType =
|
|
791
|
+
export type MarkChannelsReadOptions<UserType = UR> = {
|
|
927
792
|
client_id?: string;
|
|
928
793
|
connection_id?: string;
|
|
929
794
|
read_by_channel?: Record<string, string>;
|
|
@@ -931,7 +796,7 @@ export type MarkChannelsReadOptions<UserType = UnknownType> = {
|
|
|
931
796
|
user_id?: string;
|
|
932
797
|
};
|
|
933
798
|
|
|
934
|
-
export type MarkReadOptions<UserType =
|
|
799
|
+
export type MarkReadOptions<UserType = UR> = {
|
|
935
800
|
client_id?: string;
|
|
936
801
|
connection_id?: string;
|
|
937
802
|
message_id?: string;
|
|
@@ -939,7 +804,7 @@ export type MarkReadOptions<UserType = UnknownType> = {
|
|
|
939
804
|
user_id?: string;
|
|
940
805
|
};
|
|
941
806
|
|
|
942
|
-
export type MuteUserOptions<UserType =
|
|
807
|
+
export type MuteUserOptions<UserType = UR> = {
|
|
943
808
|
client_id?: string;
|
|
944
809
|
connection_id?: string;
|
|
945
810
|
id?: string;
|
|
@@ -978,7 +843,7 @@ export type QueryMembersOptions = {
|
|
|
978
843
|
user_id_lte?: string;
|
|
979
844
|
};
|
|
980
845
|
|
|
981
|
-
export type SearchOptions<MessageType =
|
|
846
|
+
export type SearchOptions<MessageType = UR> = {
|
|
982
847
|
limit?: number;
|
|
983
848
|
next?: string;
|
|
984
849
|
offset?: number;
|
|
@@ -998,6 +863,8 @@ export type StreamChatOptions = AxiosRequestConfig & {
|
|
|
998
863
|
browser?: boolean;
|
|
999
864
|
device?: BaseDeviceFields;
|
|
1000
865
|
enableInsights?: boolean;
|
|
866
|
+
/** experimental feature, please contact support if you want this feature enabled for you */
|
|
867
|
+
enableWSFallback?: boolean;
|
|
1001
868
|
logger?: Logger;
|
|
1002
869
|
/**
|
|
1003
870
|
* When network is recovered, we re-query the active channels on client. But in single query, you can recover
|
|
@@ -1022,9 +889,10 @@ export type UnBanUserOptions = {
|
|
|
1022
889
|
};
|
|
1023
890
|
|
|
1024
891
|
// TODO: rename to UpdateChannelTypeOptions in the next major update
|
|
1025
|
-
export type UpdateChannelOptions<
|
|
1026
|
-
CommandType
|
|
1027
|
-
|
|
892
|
+
export type UpdateChannelOptions<CommandType extends string = LiteralStringForUnion> = Omit<
|
|
893
|
+
CreateChannelOptions<CommandType>,
|
|
894
|
+
'name'
|
|
895
|
+
> & {
|
|
1028
896
|
created_at?: string;
|
|
1029
897
|
updated_at?: string;
|
|
1030
898
|
};
|
|
@@ -1051,13 +919,13 @@ export type ConnectionChangeEvent = {
|
|
|
1051
919
|
};
|
|
1052
920
|
|
|
1053
921
|
export type Event<
|
|
1054
|
-
AttachmentType extends
|
|
1055
|
-
ChannelType extends
|
|
922
|
+
AttachmentType extends UR = UR,
|
|
923
|
+
ChannelType extends UR = UR,
|
|
1056
924
|
CommandType extends string = LiteralStringForUnion,
|
|
1057
|
-
EventType extends
|
|
1058
|
-
MessageType extends
|
|
1059
|
-
ReactionType extends
|
|
1060
|
-
UserType extends
|
|
925
|
+
EventType extends UR = UR,
|
|
926
|
+
MessageType extends UR = UR,
|
|
927
|
+
ReactionType extends UR = UR,
|
|
928
|
+
UserType extends UR = UR
|
|
1061
929
|
> = EventType & {
|
|
1062
930
|
type: EventTypes;
|
|
1063
931
|
channel?: ChannelResponse<ChannelType, CommandType, UserType>;
|
|
@@ -1071,14 +939,7 @@ export type Event<
|
|
|
1071
939
|
mark_messages_deleted?: boolean;
|
|
1072
940
|
me?: OwnUserResponse<ChannelType, CommandType, UserType>;
|
|
1073
941
|
member?: ChannelMemberResponse<UserType>;
|
|
1074
|
-
message?: MessageResponse<
|
|
1075
|
-
AttachmentType,
|
|
1076
|
-
ChannelType,
|
|
1077
|
-
CommandType,
|
|
1078
|
-
MessageType,
|
|
1079
|
-
ReactionType,
|
|
1080
|
-
UserType
|
|
1081
|
-
>;
|
|
942
|
+
message?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>;
|
|
1082
943
|
online?: boolean;
|
|
1083
944
|
parent_id?: string;
|
|
1084
945
|
reaction?: ReactionResponse<ReactionType, UserType>;
|
|
@@ -1092,29 +953,19 @@ export type Event<
|
|
|
1092
953
|
watcher_count?: number;
|
|
1093
954
|
};
|
|
1094
955
|
|
|
1095
|
-
export type UserCustomEvent<EventType extends
|
|
956
|
+
export type UserCustomEvent<EventType extends UR = UR> = EventType & {
|
|
1096
957
|
type: string;
|
|
1097
958
|
};
|
|
1098
959
|
|
|
1099
960
|
export type EventHandler<
|
|
1100
|
-
AttachmentType extends
|
|
1101
|
-
ChannelType extends
|
|
961
|
+
AttachmentType extends UR = UR,
|
|
962
|
+
ChannelType extends UR = UR,
|
|
1102
963
|
CommandType extends string = LiteralStringForUnion,
|
|
1103
|
-
EventType extends
|
|
1104
|
-
MessageType extends
|
|
1105
|
-
ReactionType extends
|
|
1106
|
-
UserType extends
|
|
1107
|
-
> = (
|
|
1108
|
-
event: Event<
|
|
1109
|
-
AttachmentType,
|
|
1110
|
-
ChannelType,
|
|
1111
|
-
CommandType,
|
|
1112
|
-
EventType,
|
|
1113
|
-
MessageType,
|
|
1114
|
-
ReactionType,
|
|
1115
|
-
UserType
|
|
1116
|
-
>,
|
|
1117
|
-
) => void;
|
|
964
|
+
EventType extends UR = UR,
|
|
965
|
+
MessageType extends UR = UR,
|
|
966
|
+
ReactionType extends UR = UR,
|
|
967
|
+
UserType extends UR = UR
|
|
968
|
+
> = (event: Event<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>) => void;
|
|
1118
969
|
|
|
1119
970
|
export type EventTypes =
|
|
1120
971
|
| 'all'
|
|
@@ -1176,27 +1027,18 @@ export type MessageFlagsFiltersOptions = {
|
|
|
1176
1027
|
export type MessageFlagsFilters = QueryFilters<
|
|
1177
1028
|
{
|
|
1178
1029
|
channel_cid?:
|
|
1179
|
-
| RequireOnlyOne<
|
|
1180
|
-
Pick<QueryFilter<MessageFlagsFiltersOptions['channel_cid']>, '$eq' | '$in'>
|
|
1181
|
-
>
|
|
1030
|
+
| RequireOnlyOne<Pick<QueryFilter<MessageFlagsFiltersOptions['channel_cid']>, '$eq' | '$in'>>
|
|
1182
1031
|
| PrimitiveFilter<MessageFlagsFiltersOptions['channel_cid']>;
|
|
1183
1032
|
} & {
|
|
1184
1033
|
team?:
|
|
1185
|
-
| RequireOnlyOne<
|
|
1186
|
-
Pick<QueryFilter<MessageFlagsFiltersOptions['team']>, '$eq' | '$in'>
|
|
1187
|
-
>
|
|
1034
|
+
| RequireOnlyOne<Pick<QueryFilter<MessageFlagsFiltersOptions['team']>, '$eq' | '$in'>>
|
|
1188
1035
|
| PrimitiveFilter<MessageFlagsFiltersOptions['team']>;
|
|
1189
1036
|
} & {
|
|
1190
1037
|
user_id?:
|
|
1191
|
-
| RequireOnlyOne<
|
|
1192
|
-
Pick<QueryFilter<MessageFlagsFiltersOptions['user_id']>, '$eq' | '$in'>
|
|
1193
|
-
>
|
|
1038
|
+
| RequireOnlyOne<Pick<QueryFilter<MessageFlagsFiltersOptions['user_id']>, '$eq' | '$in'>>
|
|
1194
1039
|
| PrimitiveFilter<MessageFlagsFiltersOptions['user_id']>;
|
|
1195
1040
|
} & {
|
|
1196
|
-
[Key in keyof Omit<
|
|
1197
|
-
MessageFlagsFiltersOptions,
|
|
1198
|
-
'channel_cid' | 'user_id' | 'is_reviewed'
|
|
1199
|
-
>]:
|
|
1041
|
+
[Key in keyof Omit<MessageFlagsFiltersOptions, 'channel_cid' | 'user_id' | 'is_reviewed'>]:
|
|
1200
1042
|
| RequireOnlyOne<QueryFilter<MessageFlagsFiltersOptions[Key]>>
|
|
1201
1043
|
| PrimitiveFilter<MessageFlagsFiltersOptions[Key]>;
|
|
1202
1044
|
}
|
|
@@ -1213,9 +1055,7 @@ export type BannedUsersFilterOptions = {
|
|
|
1213
1055
|
export type BannedUsersFilters = QueryFilters<
|
|
1214
1056
|
{
|
|
1215
1057
|
channel_cid?:
|
|
1216
|
-
| RequireOnlyOne<
|
|
1217
|
-
Pick<QueryFilter<BannedUsersFilterOptions['channel_cid']>, '$eq' | '$in'>
|
|
1218
|
-
>
|
|
1058
|
+
| RequireOnlyOne<Pick<QueryFilter<BannedUsersFilterOptions['channel_cid']>, '$eq' | '$in'>>
|
|
1219
1059
|
| PrimitiveFilter<BannedUsersFilterOptions['channel_cid']>;
|
|
1220
1060
|
} & {
|
|
1221
1061
|
reason?:
|
|
@@ -1233,9 +1073,9 @@ export type BannedUsersFilters = QueryFilters<
|
|
|
1233
1073
|
>;
|
|
1234
1074
|
|
|
1235
1075
|
export type ChannelFilters<
|
|
1236
|
-
ChannelType =
|
|
1076
|
+
ChannelType = UR,
|
|
1237
1077
|
CommandType extends string = LiteralStringForUnion,
|
|
1238
|
-
UserType =
|
|
1078
|
+
UserType = UR
|
|
1239
1079
|
> = QueryFilters<
|
|
1240
1080
|
ContainsOperator<ChannelType> & {
|
|
1241
1081
|
members?:
|
|
@@ -1251,10 +1091,7 @@ export type ChannelFilters<
|
|
|
1251
1091
|
>
|
|
1252
1092
|
| PrimitiveFilter<ChannelResponse<ChannelType, CommandType, UserType>['name']>;
|
|
1253
1093
|
} & {
|
|
1254
|
-
[Key in keyof Omit<
|
|
1255
|
-
ChannelResponse<{}, CommandType, UserType>,
|
|
1256
|
-
'name' | 'members'
|
|
1257
|
-
>]:
|
|
1094
|
+
[Key in keyof Omit<ChannelResponse<{}, CommandType, UserType>, 'name' | 'members'>]:
|
|
1258
1095
|
| RequireOnlyOne<QueryFilter<ChannelResponse<{}, CommandType, UserType>[Key]>>
|
|
1259
1096
|
| PrimitiveFilter<ChannelResponse<{}, CommandType, UserType>[Key]>;
|
|
1260
1097
|
}
|
|
@@ -1275,12 +1112,12 @@ export type ContainsOperator<CustomType = {}> = {
|
|
|
1275
1112
|
};
|
|
1276
1113
|
|
|
1277
1114
|
export type MessageFilters<
|
|
1278
|
-
AttachmentType =
|
|
1279
|
-
ChannelType =
|
|
1115
|
+
AttachmentType = UR,
|
|
1116
|
+
ChannelType = UR,
|
|
1280
1117
|
CommandType extends string = LiteralStringForUnion,
|
|
1281
|
-
MessageType =
|
|
1282
|
-
ReactionType =
|
|
1283
|
-
UserType =
|
|
1118
|
+
MessageType = UR,
|
|
1119
|
+
ReactionType = UR,
|
|
1120
|
+
UserType = UR
|
|
1284
1121
|
> = QueryFilters<
|
|
1285
1122
|
ContainsOperator<MessageType> & {
|
|
1286
1123
|
text?:
|
|
@@ -1294,78 +1131,29 @@ export type MessageFilters<
|
|
|
1294
1131
|
ReactionType,
|
|
1295
1132
|
UserType
|
|
1296
1133
|
>['text'];
|
|
1297
|
-
$q?: MessageResponse<
|
|
1298
|
-
AttachmentType,
|
|
1299
|
-
ChannelType,
|
|
1300
|
-
CommandType,
|
|
1301
|
-
MessageType,
|
|
1302
|
-
ReactionType,
|
|
1303
|
-
UserType
|
|
1304
|
-
>['text'];
|
|
1134
|
+
$q?: MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>['text'];
|
|
1305
1135
|
} & QueryFilter<
|
|
1306
|
-
MessageResponse<
|
|
1307
|
-
AttachmentType,
|
|
1308
|
-
ChannelType,
|
|
1309
|
-
CommandType,
|
|
1310
|
-
MessageType,
|
|
1311
|
-
ReactionType,
|
|
1312
|
-
UserType
|
|
1313
|
-
>['text']
|
|
1136
|
+
MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>['text']
|
|
1314
1137
|
>
|
|
1315
1138
|
>
|
|
1316
1139
|
| PrimitiveFilter<
|
|
1317
|
-
MessageResponse<
|
|
1318
|
-
AttachmentType,
|
|
1319
|
-
ChannelType,
|
|
1320
|
-
CommandType,
|
|
1321
|
-
MessageType,
|
|
1322
|
-
ReactionType,
|
|
1323
|
-
UserType
|
|
1324
|
-
>['text']
|
|
1140
|
+
MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>['text']
|
|
1325
1141
|
>;
|
|
1326
1142
|
} & {
|
|
1327
1143
|
[Key in keyof Omit<
|
|
1328
|
-
MessageResponse<
|
|
1329
|
-
AttachmentType,
|
|
1330
|
-
ChannelType,
|
|
1331
|
-
CommandType,
|
|
1332
|
-
{},
|
|
1333
|
-
ReactionType,
|
|
1334
|
-
UserType
|
|
1335
|
-
>,
|
|
1144
|
+
MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>,
|
|
1336
1145
|
'text'
|
|
1337
1146
|
>]?:
|
|
1338
1147
|
| RequireOnlyOne<
|
|
1339
|
-
QueryFilter<
|
|
1340
|
-
MessageResponse<
|
|
1341
|
-
AttachmentType,
|
|
1342
|
-
ChannelType,
|
|
1343
|
-
CommandType,
|
|
1344
|
-
{},
|
|
1345
|
-
ReactionType,
|
|
1346
|
-
UserType
|
|
1347
|
-
>[Key]
|
|
1348
|
-
>
|
|
1148
|
+
QueryFilter<MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>[Key]>
|
|
1349
1149
|
>
|
|
1350
|
-
| PrimitiveFilter<
|
|
1351
|
-
MessageResponse<
|
|
1352
|
-
AttachmentType,
|
|
1353
|
-
ChannelType,
|
|
1354
|
-
CommandType,
|
|
1355
|
-
{},
|
|
1356
|
-
ReactionType,
|
|
1357
|
-
UserType
|
|
1358
|
-
>[Key]
|
|
1359
|
-
>;
|
|
1150
|
+
| PrimitiveFilter<MessageResponse<AttachmentType, ChannelType, CommandType, {}, ReactionType, UserType>[Key]>;
|
|
1360
1151
|
}
|
|
1361
1152
|
>;
|
|
1362
1153
|
|
|
1363
1154
|
export type PrimitiveFilter<ObjectType> = ObjectType | null;
|
|
1364
1155
|
|
|
1365
|
-
export type QueryFilter<ObjectType = string> = NonNullable<ObjectType> extends
|
|
1366
|
-
| string
|
|
1367
|
-
| number
|
|
1368
|
-
| boolean
|
|
1156
|
+
export type QueryFilter<ObjectType = string> = NonNullable<ObjectType> extends string | number | boolean
|
|
1369
1157
|
? {
|
|
1370
1158
|
$eq?: PrimitiveFilter<ObjectType>;
|
|
1371
1159
|
$exists?: boolean;
|
|
@@ -1396,21 +1184,13 @@ export type QueryLogicalOperators<Operators> = {
|
|
|
1396
1184
|
$or?: ArrayTwoOrMore<QueryFilters<Operators>>;
|
|
1397
1185
|
};
|
|
1398
1186
|
|
|
1399
|
-
export type UserFilters<UserType =
|
|
1187
|
+
export type UserFilters<UserType = UR> = QueryFilters<
|
|
1400
1188
|
ContainsOperator<UserType> & {
|
|
1401
1189
|
id?:
|
|
1402
|
-
| RequireOnlyOne<
|
|
1403
|
-
{ $autocomplete?: UserResponse<UserType>['id'] } & QueryFilter<
|
|
1404
|
-
UserResponse<UserType>['id']
|
|
1405
|
-
>
|
|
1406
|
-
>
|
|
1190
|
+
| RequireOnlyOne<{ $autocomplete?: UserResponse<UserType>['id'] } & QueryFilter<UserResponse<UserType>['id']>>
|
|
1407
1191
|
| PrimitiveFilter<UserResponse<UserType>['id']>;
|
|
1408
1192
|
name?:
|
|
1409
|
-
| RequireOnlyOne<
|
|
1410
|
-
{ $autocomplete?: UserResponse<UserType>['name'] } & QueryFilter<
|
|
1411
|
-
UserResponse<UserType>['name']
|
|
1412
|
-
>
|
|
1413
|
-
>
|
|
1193
|
+
| RequireOnlyOne<{ $autocomplete?: UserResponse<UserType>['name'] } & QueryFilter<UserResponse<UserType>['name']>>
|
|
1414
1194
|
| PrimitiveFilter<UserResponse<UserType>['name']>;
|
|
1415
1195
|
teams?:
|
|
1416
1196
|
| RequireOnlyOne<{
|
|
@@ -1420,9 +1200,7 @@ export type UserFilters<UserType = UnknownType> = QueryFilters<
|
|
|
1420
1200
|
| PrimitiveFilter<UserResponse<UserType>['teams']>;
|
|
1421
1201
|
username?:
|
|
1422
1202
|
| RequireOnlyOne<
|
|
1423
|
-
{ $autocomplete?: UserResponse<UserType>['username'] } & QueryFilter<
|
|
1424
|
-
UserResponse<UserType>['username']
|
|
1425
|
-
>
|
|
1203
|
+
{ $autocomplete?: UserResponse<UserType>['username'] } & QueryFilter<UserResponse<UserType>['username']>
|
|
1426
1204
|
>
|
|
1427
1205
|
| PrimitiveFilter<UserResponse<UserType>['username']>;
|
|
1428
1206
|
} & {
|
|
@@ -1440,11 +1218,9 @@ export type BannedUsersSort = BannedUsersSortBase | Array<BannedUsersSortBase>;
|
|
|
1440
1218
|
|
|
1441
1219
|
export type BannedUsersSortBase = { created_at?: AscDesc };
|
|
1442
1220
|
|
|
1443
|
-
export type ChannelSort<ChannelType =
|
|
1444
|
-
| ChannelSortBase<ChannelType>
|
|
1445
|
-
| Array<ChannelSortBase<ChannelType>>;
|
|
1221
|
+
export type ChannelSort<ChannelType = UR> = ChannelSortBase<ChannelType> | Array<ChannelSortBase<ChannelType>>;
|
|
1446
1222
|
|
|
1447
|
-
export type ChannelSortBase<ChannelType =
|
|
1223
|
+
export type ChannelSortBase<ChannelType = UR> = Sort<ChannelType> & {
|
|
1448
1224
|
created_at?: AscDesc;
|
|
1449
1225
|
has_unread?: AscDesc;
|
|
1450
1226
|
last_message_at?: AscDesc;
|
|
@@ -1458,15 +1234,13 @@ export type Sort<T> = {
|
|
|
1458
1234
|
[P in keyof T]?: AscDesc;
|
|
1459
1235
|
};
|
|
1460
1236
|
|
|
1461
|
-
export type UserSort<UserType =
|
|
1462
|
-
| Sort<UserResponse<UserType>>
|
|
1463
|
-
| Array<Sort<UserResponse<UserType>>>;
|
|
1237
|
+
export type UserSort<UserType = UR> = Sort<UserResponse<UserType>> | Array<Sort<UserResponse<UserType>>>;
|
|
1464
1238
|
|
|
1465
|
-
export type MemberSort<UserType =
|
|
1239
|
+
export type MemberSort<UserType = UR> =
|
|
1466
1240
|
| Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>>
|
|
1467
1241
|
| Array<Sort<Pick<UserResponse<UserType>, 'id' | 'created_at' | 'name'>>>;
|
|
1468
1242
|
|
|
1469
|
-
export type SearchMessageSortBase<MessageType =
|
|
1243
|
+
export type SearchMessageSortBase<MessageType = UR> = Sort<MessageType> & {
|
|
1470
1244
|
attachments?: AscDesc;
|
|
1471
1245
|
'attachments.type'?: AscDesc;
|
|
1472
1246
|
created_at?: AscDesc;
|
|
@@ -1482,15 +1256,11 @@ export type SearchMessageSortBase<MessageType = UnknownType> = Sort<MessageType>
|
|
|
1482
1256
|
'user.id'?: AscDesc;
|
|
1483
1257
|
};
|
|
1484
1258
|
|
|
1485
|
-
export type SearchMessageSort<MessageType =
|
|
1259
|
+
export type SearchMessageSort<MessageType = UR> =
|
|
1486
1260
|
| SearchMessageSortBase<MessageType>
|
|
1487
1261
|
| Array<SearchMessageSortBase<MessageType>>;
|
|
1488
1262
|
|
|
1489
|
-
export type QuerySort<
|
|
1490
|
-
ChannelType = UnknownType,
|
|
1491
|
-
UserType = UnknownType,
|
|
1492
|
-
MessageType = UnknownType
|
|
1493
|
-
> =
|
|
1263
|
+
export type QuerySort<ChannelType = UR, UserType = UR, MessageType = UR> =
|
|
1494
1264
|
| BannedUsersSort
|
|
1495
1265
|
| ChannelSort<ChannelType>
|
|
1496
1266
|
| SearchMessageSort<MessageType>
|
|
@@ -1567,7 +1337,7 @@ export type AppSettings = {
|
|
|
1567
1337
|
webhook_url?: string;
|
|
1568
1338
|
};
|
|
1569
1339
|
|
|
1570
|
-
export type Attachment<T =
|
|
1340
|
+
export type Attachment<T = UR> = T & {
|
|
1571
1341
|
actions?: Action[];
|
|
1572
1342
|
asset_url?: string;
|
|
1573
1343
|
author_icon?: string;
|
|
@@ -1606,9 +1376,7 @@ export type BlockList = {
|
|
|
1606
1376
|
words: string[];
|
|
1607
1377
|
};
|
|
1608
1378
|
|
|
1609
|
-
export type ChannelConfig<
|
|
1610
|
-
CommandType extends string = LiteralStringForUnion
|
|
1611
|
-
> = ChannelConfigFields &
|
|
1379
|
+
export type ChannelConfig<CommandType extends string = LiteralStringForUnion> = ChannelConfigFields &
|
|
1612
1380
|
CreatedAtUpdatedAt & {
|
|
1613
1381
|
commands?: CommandVariants<CommandType>[];
|
|
1614
1382
|
};
|
|
@@ -1644,19 +1412,17 @@ export type ChannelConfigFields = {
|
|
|
1644
1412
|
url_enrichment?: boolean;
|
|
1645
1413
|
};
|
|
1646
1414
|
|
|
1647
|
-
export type ChannelConfigWithInfo<
|
|
1648
|
-
CommandType extends string = LiteralStringForUnion
|
|
1649
|
-
> = ChannelConfigFields &
|
|
1415
|
+
export type ChannelConfigWithInfo<CommandType extends string = LiteralStringForUnion> = ChannelConfigFields &
|
|
1650
1416
|
CreatedAtUpdatedAt & {
|
|
1651
1417
|
commands?: CommandResponse<CommandType>[];
|
|
1652
1418
|
};
|
|
1653
1419
|
|
|
1654
|
-
export type ChannelData<ChannelType =
|
|
1420
|
+
export type ChannelData<ChannelType = UR> = ChannelType & {
|
|
1655
1421
|
members?: string[];
|
|
1656
1422
|
name?: string;
|
|
1657
1423
|
};
|
|
1658
1424
|
|
|
1659
|
-
export type ChannelMembership<UserType =
|
|
1425
|
+
export type ChannelMembership<UserType = UR> = {
|
|
1660
1426
|
banned?: boolean;
|
|
1661
1427
|
channel_role?: Role;
|
|
1662
1428
|
created_at?: string;
|
|
@@ -1668,9 +1434,9 @@ export type ChannelMembership<UserType = UnknownType> = {
|
|
|
1668
1434
|
};
|
|
1669
1435
|
|
|
1670
1436
|
export type ChannelMute<
|
|
1671
|
-
ChannelType extends
|
|
1437
|
+
ChannelType extends UR = UR,
|
|
1672
1438
|
CommandType extends string = LiteralStringForUnion,
|
|
1673
|
-
UserType extends
|
|
1439
|
+
UserType extends UR = UR
|
|
1674
1440
|
> = {
|
|
1675
1441
|
user: UserResponse<UserType>;
|
|
1676
1442
|
channel?: ChannelResponse<ChannelType, CommandType, UserType>;
|
|
@@ -1687,7 +1453,7 @@ export type ChannelRole = {
|
|
|
1687
1453
|
same_team?: boolean;
|
|
1688
1454
|
};
|
|
1689
1455
|
|
|
1690
|
-
export type CheckPushInput<UserType =
|
|
1456
|
+
export type CheckPushInput<UserType = UR> = {
|
|
1691
1457
|
apn_template?: string;
|
|
1692
1458
|
client_id?: string;
|
|
1693
1459
|
connection_id?: string;
|
|
@@ -1717,9 +1483,9 @@ export type Configs<CommandType extends string = LiteralStringForUnion> = {
|
|
|
1717
1483
|
};
|
|
1718
1484
|
|
|
1719
1485
|
export type ConnectionOpen<
|
|
1720
|
-
ChannelType extends
|
|
1486
|
+
ChannelType extends UR = UR,
|
|
1721
1487
|
CommandType extends string = LiteralStringForUnion,
|
|
1722
|
-
UserType extends
|
|
1488
|
+
UserType extends UR = UR
|
|
1723
1489
|
> = {
|
|
1724
1490
|
connection_id: string;
|
|
1725
1491
|
cid?: string;
|
|
@@ -1733,7 +1499,7 @@ export type CreatedAtUpdatedAt = {
|
|
|
1733
1499
|
updated_at: string;
|
|
1734
1500
|
};
|
|
1735
1501
|
|
|
1736
|
-
export type Device<UserType =
|
|
1502
|
+
export type Device<UserType = UR> = DeviceFields & {
|
|
1737
1503
|
provider?: string;
|
|
1738
1504
|
user?: UserResponse<UserType>;
|
|
1739
1505
|
user_id?: string;
|
|
@@ -1875,25 +1641,17 @@ export type HuaweiConfig = {
|
|
|
1875
1641
|
|
|
1876
1642
|
export type LiteralStringForUnion = string & {};
|
|
1877
1643
|
|
|
1878
|
-
export type
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
AttachmentType = UnknownType,
|
|
1886
|
-
MessageType = UnknownType,
|
|
1887
|
-
UserType = UnknownType
|
|
1888
|
-
> = Partial<MessageBase<AttachmentType, MessageType, UserType>> & {
|
|
1644
|
+
export type LogLevel = 'info' | 'error' | 'warn';
|
|
1645
|
+
|
|
1646
|
+
export type Logger = (logLevel: LogLevel, message: string, extraData?: Record<string, unknown>) => void;
|
|
1647
|
+
|
|
1648
|
+
export type Message<AttachmentType = UR, MessageType = UR, UserType = UR> = Partial<
|
|
1649
|
+
MessageBase<AttachmentType, MessageType, UserType>
|
|
1650
|
+
> & {
|
|
1889
1651
|
mentioned_users?: string[];
|
|
1890
1652
|
};
|
|
1891
1653
|
|
|
1892
|
-
export type MessageBase<
|
|
1893
|
-
AttachmentType = UnknownType,
|
|
1894
|
-
MessageType = UnknownType,
|
|
1895
|
-
UserType = UnknownType
|
|
1896
|
-
> = MessageType & {
|
|
1654
|
+
export type MessageBase<AttachmentType = UR, MessageType = UR, UserType = UR> = MessageType & {
|
|
1897
1655
|
id: string;
|
|
1898
1656
|
attachments?: Attachment<AttachmentType>[];
|
|
1899
1657
|
html?: string;
|
|
@@ -1907,38 +1665,32 @@ export type MessageBase<
|
|
|
1907
1665
|
user_id?: string;
|
|
1908
1666
|
};
|
|
1909
1667
|
|
|
1910
|
-
export type MessageLabel =
|
|
1911
|
-
| 'deleted'
|
|
1912
|
-
| 'ephemeral'
|
|
1913
|
-
| 'error'
|
|
1914
|
-
| 'regular'
|
|
1915
|
-
| 'reply'
|
|
1916
|
-
| 'system';
|
|
1668
|
+
export type MessageLabel = 'deleted' | 'ephemeral' | 'error' | 'regular' | 'reply' | 'system';
|
|
1917
1669
|
|
|
1918
|
-
export type Mute<UserType =
|
|
1670
|
+
export type Mute<UserType = UR> = {
|
|
1919
1671
|
created_at: string;
|
|
1920
1672
|
target: UserResponse<UserType>;
|
|
1921
1673
|
updated_at: string;
|
|
1922
1674
|
user: UserResponse<UserType>;
|
|
1923
1675
|
};
|
|
1924
1676
|
|
|
1925
|
-
export type PartialUpdateChannel<ChannelType =
|
|
1677
|
+
export type PartialUpdateChannel<ChannelType = UR> = {
|
|
1926
1678
|
set?: Partial<ChannelResponse<ChannelType>>;
|
|
1927
1679
|
unset?: Array<keyof ChannelResponse<ChannelType>>;
|
|
1928
1680
|
};
|
|
1929
1681
|
|
|
1930
|
-
export type PartialUserUpdate<UserType =
|
|
1682
|
+
export type PartialUserUpdate<UserType = UR> = {
|
|
1931
1683
|
id: string;
|
|
1932
1684
|
set?: Partial<UserResponse<UserType>>;
|
|
1933
1685
|
unset?: Array<keyof UserResponse<UserType>>;
|
|
1934
1686
|
};
|
|
1935
1687
|
|
|
1936
|
-
export type MessageUpdatableFields<MessageType =
|
|
1688
|
+
export type MessageUpdatableFields<MessageType = UR> = Omit<
|
|
1937
1689
|
MessageResponse<MessageType>,
|
|
1938
1690
|
'cid' | 'created_at' | 'updated_at' | 'deleted_at' | 'user' | 'user_id'
|
|
1939
1691
|
>;
|
|
1940
1692
|
|
|
1941
|
-
export type PartialMessageUpdate<MessageType =
|
|
1693
|
+
export type PartialMessageUpdate<MessageType = UR> = {
|
|
1942
1694
|
set?: Partial<MessageUpdatableFields<MessageType>>;
|
|
1943
1695
|
unset?: Array<keyof MessageUpdatableFields<MessageType>>;
|
|
1944
1696
|
};
|
|
@@ -1982,10 +1734,7 @@ export type RateLimitsInfo = {
|
|
|
1982
1734
|
|
|
1983
1735
|
export type RateLimitsMap = Record<EndpointName, RateLimitsInfo>;
|
|
1984
1736
|
|
|
1985
|
-
export type Reaction<
|
|
1986
|
-
ReactionType = UnknownType,
|
|
1987
|
-
UserType = UnknownType
|
|
1988
|
-
> = ReactionType & {
|
|
1737
|
+
export type Reaction<ReactionType = UR, UserType = UR> = ReactionType & {
|
|
1989
1738
|
type: string;
|
|
1990
1739
|
message_id?: string;
|
|
1991
1740
|
score?: number;
|
|
@@ -2014,12 +1763,12 @@ export type Resource =
|
|
|
2014
1763
|
| 'UploadAttachment';
|
|
2015
1764
|
|
|
2016
1765
|
export type SearchPayload<
|
|
2017
|
-
AttachmentType =
|
|
2018
|
-
ChannelType =
|
|
1766
|
+
AttachmentType = UR,
|
|
1767
|
+
ChannelType = UR,
|
|
2019
1768
|
CommandType extends string = LiteralStringForUnion,
|
|
2020
|
-
MessageType =
|
|
2021
|
-
ReactionType =
|
|
2022
|
-
UserType =
|
|
1769
|
+
MessageType = UR,
|
|
1770
|
+
ReactionType = UR,
|
|
1771
|
+
UserType = UR
|
|
2023
1772
|
> = Omit<SearchOptions<MessageType>, 'sort'> & {
|
|
2024
1773
|
client_id?: string;
|
|
2025
1774
|
connection_id?: string;
|
|
@@ -2118,26 +1867,33 @@ export type TranslationLanguages =
|
|
|
2118
1867
|
|
|
2119
1868
|
export type TypingStartEvent = Event;
|
|
2120
1869
|
|
|
1870
|
+
export type ReservedMessageFields =
|
|
1871
|
+
| 'command'
|
|
1872
|
+
| 'created_at'
|
|
1873
|
+
| 'html'
|
|
1874
|
+
| 'latest_reactions'
|
|
1875
|
+
| 'own_reactions'
|
|
1876
|
+
| 'quoted_message'
|
|
1877
|
+
| 'reaction_counts'
|
|
1878
|
+
| 'reply_count'
|
|
1879
|
+
| 'type'
|
|
1880
|
+
| 'updated_at'
|
|
1881
|
+
| 'user'
|
|
1882
|
+
| '__html';
|
|
1883
|
+
|
|
2121
1884
|
export type UpdatedMessage<
|
|
2122
|
-
AttachmentType =
|
|
2123
|
-
ChannelType =
|
|
1885
|
+
AttachmentType = UR,
|
|
1886
|
+
ChannelType = UR,
|
|
2124
1887
|
CommandType extends string = LiteralStringForUnion,
|
|
2125
|
-
MessageType =
|
|
2126
|
-
ReactionType =
|
|
2127
|
-
UserType =
|
|
1888
|
+
MessageType = UR,
|
|
1889
|
+
ReactionType = UR,
|
|
1890
|
+
UserType = UR
|
|
2128
1891
|
> = Omit<
|
|
2129
|
-
MessageResponse<
|
|
2130
|
-
AttachmentType,
|
|
2131
|
-
ChannelType,
|
|
2132
|
-
CommandType,
|
|
2133
|
-
MessageType,
|
|
2134
|
-
ReactionType,
|
|
2135
|
-
UserType
|
|
2136
|
-
>,
|
|
1892
|
+
MessageResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>,
|
|
2137
1893
|
'mentioned_users'
|
|
2138
1894
|
> & { mentioned_users?: string[] };
|
|
2139
1895
|
|
|
2140
|
-
export type User<UserType =
|
|
1896
|
+
export type User<UserType = UR> = UserType & {
|
|
2141
1897
|
id: string;
|
|
2142
1898
|
anon?: boolean;
|
|
2143
1899
|
name?: string;
|
|
@@ -2203,14 +1959,7 @@ export type CampaignData = {
|
|
|
2203
1959
|
|
|
2204
1960
|
export type CampaignStatus = {
|
|
2205
1961
|
errors: string[];
|
|
2206
|
-
status:
|
|
2207
|
-
| 'draft'
|
|
2208
|
-
| 'stopped'
|
|
2209
|
-
| 'scheduled'
|
|
2210
|
-
| 'completed'
|
|
2211
|
-
| 'failed'
|
|
2212
|
-
| 'canceled'
|
|
2213
|
-
| 'in_progress';
|
|
1962
|
+
status: 'draft' | 'stopped' | 'scheduled' | 'completed' | 'failed' | 'canceled' | 'in_progress';
|
|
2214
1963
|
completed_at?: string;
|
|
2215
1964
|
failed_at?: string;
|
|
2216
1965
|
progress?: number;
|
|
@@ -2236,5 +1985,12 @@ export type TaskStatus = {
|
|
|
2236
1985
|
description: string;
|
|
2237
1986
|
type: string;
|
|
2238
1987
|
};
|
|
2239
|
-
result?:
|
|
1988
|
+
result?: UR;
|
|
1989
|
+
};
|
|
1990
|
+
|
|
1991
|
+
export type TruncateOptions<AttachmentType, MessageType, UserType> = {
|
|
1992
|
+
hard_delete?: boolean;
|
|
1993
|
+
message?: Message<AttachmentType, MessageType, UserType>;
|
|
1994
|
+
skip_push?: boolean;
|
|
1995
|
+
truncated_at?: Date;
|
|
2240
1996
|
};
|