@stream-io/node-sdk 0.8.8 → 0.8.9
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/CHANGELOG.md +8 -0
- package/dist/index.cjs.js +1171 -2372
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +1171 -2372
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/ApiClient.d.ts +1 -2
- package/dist/src/gen/feeds/FeedsApi.d.ts +7 -1
- package/dist/src/gen/models/index.d.ts +279 -8
- package/package.json +1 -1
- package/src/ApiClient.ts +1 -1
- package/src/gen/chat/ChatApi.ts +563 -659
- package/src/gen/common/CommonApi.ts +545 -517
- package/src/gen/feeds/FeedsApi.ts +799 -856
- package/src/gen/model-decoders/decoders.ts +29 -0
- package/src/gen/models/index.ts +293 -8
- package/src/gen/moderation/ModerationApi.ts +339 -408
- package/src/gen/video/VideoApi.ts +470 -566
package/src/gen/chat/ChatApi.ts
CHANGED
|
@@ -176,20 +176,17 @@ export class ChatApi {
|
|
|
176
176
|
channel_template: request?.channel_template,
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
-
const response = await this.apiClient.sendRequest<
|
|
180
|
-
StreamResponse<CreateCampaignResponse>
|
|
181
|
-
>(
|
|
179
|
+
const response = await this.apiClient.sendRequest<CreateCampaignResponse>(
|
|
182
180
|
'POST',
|
|
183
181
|
'/api/v2/chat/campaigns',
|
|
184
182
|
undefined,
|
|
185
183
|
undefined,
|
|
186
184
|
body,
|
|
187
|
-
'application/json',
|
|
188
185
|
);
|
|
189
186
|
|
|
190
|
-
decoders['CreateCampaignResponse']?.(response
|
|
187
|
+
decoders['CreateCampaignResponse']?.(response);
|
|
191
188
|
|
|
192
|
-
return
|
|
189
|
+
return response;
|
|
193
190
|
}
|
|
194
191
|
|
|
195
192
|
async queryCampaigns(
|
|
@@ -204,20 +201,17 @@ export class ChatApi {
|
|
|
204
201
|
filter: request?.filter,
|
|
205
202
|
};
|
|
206
203
|
|
|
207
|
-
const response = await this.apiClient.sendRequest<
|
|
208
|
-
StreamResponse<QueryCampaignsResponse>
|
|
209
|
-
>(
|
|
204
|
+
const response = await this.apiClient.sendRequest<QueryCampaignsResponse>(
|
|
210
205
|
'POST',
|
|
211
206
|
'/api/v2/chat/campaigns/query',
|
|
212
207
|
undefined,
|
|
213
208
|
undefined,
|
|
214
209
|
body,
|
|
215
|
-
'application/json',
|
|
216
210
|
);
|
|
217
211
|
|
|
218
|
-
decoders['QueryCampaignsResponse']?.(response
|
|
212
|
+
decoders['QueryCampaignsResponse']?.(response);
|
|
219
213
|
|
|
220
|
-
return
|
|
214
|
+
return response;
|
|
221
215
|
}
|
|
222
216
|
|
|
223
217
|
async deleteCampaign(request: {
|
|
@@ -227,13 +221,16 @@ export class ChatApi {
|
|
|
227
221
|
id: request?.id,
|
|
228
222
|
};
|
|
229
223
|
|
|
230
|
-
const response = await this.apiClient.sendRequest<
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
const response = await this.apiClient.sendRequest<DeleteCampaignResponse>(
|
|
225
|
+
'DELETE',
|
|
226
|
+
'/api/v2/chat/campaigns/{id}',
|
|
227
|
+
pathParams,
|
|
228
|
+
undefined,
|
|
229
|
+
);
|
|
233
230
|
|
|
234
|
-
decoders['DeleteCampaignResponse']?.(response
|
|
231
|
+
decoders['DeleteCampaignResponse']?.(response);
|
|
235
232
|
|
|
236
|
-
return
|
|
233
|
+
return response;
|
|
237
234
|
}
|
|
238
235
|
|
|
239
236
|
async getCampaign(request: {
|
|
@@ -251,13 +248,16 @@ export class ChatApi {
|
|
|
251
248
|
id: request?.id,
|
|
252
249
|
};
|
|
253
250
|
|
|
254
|
-
const response = await this.apiClient.sendRequest<
|
|
255
|
-
|
|
256
|
-
|
|
251
|
+
const response = await this.apiClient.sendRequest<GetCampaignResponse>(
|
|
252
|
+
'GET',
|
|
253
|
+
'/api/v2/chat/campaigns/{id}',
|
|
254
|
+
pathParams,
|
|
255
|
+
queryParams,
|
|
256
|
+
);
|
|
257
257
|
|
|
258
|
-
decoders['GetCampaignResponse']?.(response
|
|
258
|
+
decoders['GetCampaignResponse']?.(response);
|
|
259
259
|
|
|
260
|
-
return
|
|
260
|
+
return response;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
async updateCampaign(
|
|
@@ -283,20 +283,17 @@ export class ChatApi {
|
|
|
283
283
|
channel_template: request?.channel_template,
|
|
284
284
|
};
|
|
285
285
|
|
|
286
|
-
const response = await this.apiClient.sendRequest<
|
|
287
|
-
StreamResponse<CampaignResponse>
|
|
288
|
-
>(
|
|
286
|
+
const response = await this.apiClient.sendRequest<CampaignResponse>(
|
|
289
287
|
'PUT',
|
|
290
288
|
'/api/v2/chat/campaigns/{id}',
|
|
291
289
|
pathParams,
|
|
292
290
|
undefined,
|
|
293
291
|
body,
|
|
294
|
-
'application/json',
|
|
295
292
|
);
|
|
296
293
|
|
|
297
|
-
decoders['CampaignResponse']?.(response
|
|
294
|
+
decoders['CampaignResponse']?.(response);
|
|
298
295
|
|
|
299
|
-
return
|
|
296
|
+
return response;
|
|
300
297
|
}
|
|
301
298
|
|
|
302
299
|
async startCampaign(
|
|
@@ -310,20 +307,17 @@ export class ChatApi {
|
|
|
310
307
|
stop_at: request?.stop_at,
|
|
311
308
|
};
|
|
312
309
|
|
|
313
|
-
const response = await this.apiClient.sendRequest<
|
|
314
|
-
StreamResponse<StartCampaignResponse>
|
|
315
|
-
>(
|
|
310
|
+
const response = await this.apiClient.sendRequest<StartCampaignResponse>(
|
|
316
311
|
'POST',
|
|
317
312
|
'/api/v2/chat/campaigns/{id}/start',
|
|
318
313
|
pathParams,
|
|
319
314
|
undefined,
|
|
320
315
|
body,
|
|
321
|
-
'application/json',
|
|
322
316
|
);
|
|
323
317
|
|
|
324
|
-
decoders['StartCampaignResponse']?.(response
|
|
318
|
+
decoders['StartCampaignResponse']?.(response);
|
|
325
319
|
|
|
326
|
-
return
|
|
320
|
+
return response;
|
|
327
321
|
}
|
|
328
322
|
|
|
329
323
|
async stopCampaign(
|
|
@@ -334,20 +328,17 @@ export class ChatApi {
|
|
|
334
328
|
};
|
|
335
329
|
const body = {};
|
|
336
330
|
|
|
337
|
-
const response = await this.apiClient.sendRequest<
|
|
338
|
-
StreamResponse<CampaignResponse>
|
|
339
|
-
>(
|
|
331
|
+
const response = await this.apiClient.sendRequest<CampaignResponse>(
|
|
340
332
|
'POST',
|
|
341
333
|
'/api/v2/chat/campaigns/{id}/stop',
|
|
342
334
|
pathParams,
|
|
343
335
|
undefined,
|
|
344
336
|
body,
|
|
345
|
-
'application/json',
|
|
346
337
|
);
|
|
347
338
|
|
|
348
|
-
decoders['CampaignResponse']?.(response
|
|
339
|
+
decoders['CampaignResponse']?.(response);
|
|
349
340
|
|
|
350
|
-
return
|
|
341
|
+
return response;
|
|
351
342
|
}
|
|
352
343
|
|
|
353
344
|
async queryChannels(
|
|
@@ -369,20 +360,17 @@ export class ChatApi {
|
|
|
369
360
|
user: request?.user,
|
|
370
361
|
};
|
|
371
362
|
|
|
372
|
-
const response = await this.apiClient.sendRequest<
|
|
373
|
-
StreamResponse<QueryChannelsResponse>
|
|
374
|
-
>(
|
|
363
|
+
const response = await this.apiClient.sendRequest<QueryChannelsResponse>(
|
|
375
364
|
'POST',
|
|
376
365
|
'/api/v2/chat/channels',
|
|
377
366
|
undefined,
|
|
378
367
|
undefined,
|
|
379
368
|
body,
|
|
380
|
-
'application/json',
|
|
381
369
|
);
|
|
382
370
|
|
|
383
|
-
decoders['QueryChannelsResponse']?.(response
|
|
371
|
+
decoders['QueryChannelsResponse']?.(response);
|
|
384
372
|
|
|
385
|
-
return
|
|
373
|
+
return response;
|
|
386
374
|
}
|
|
387
375
|
|
|
388
376
|
async channelBatchUpdate(
|
|
@@ -399,20 +387,18 @@ export class ChatApi {
|
|
|
399
387
|
data: request?.data,
|
|
400
388
|
};
|
|
401
389
|
|
|
402
|
-
const response =
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
'application/json',
|
|
411
|
-
);
|
|
390
|
+
const response =
|
|
391
|
+
await this.apiClient.sendRequest<ChannelBatchUpdateResponse>(
|
|
392
|
+
'PUT',
|
|
393
|
+
'/api/v2/chat/channels/batch',
|
|
394
|
+
undefined,
|
|
395
|
+
undefined,
|
|
396
|
+
body,
|
|
397
|
+
);
|
|
412
398
|
|
|
413
|
-
decoders['ChannelBatchUpdateResponse']?.(response
|
|
399
|
+
decoders['ChannelBatchUpdateResponse']?.(response);
|
|
414
400
|
|
|
415
|
-
return
|
|
401
|
+
return response;
|
|
416
402
|
}
|
|
417
403
|
|
|
418
404
|
async deleteChannels(
|
|
@@ -424,20 +410,17 @@ export class ChatApi {
|
|
|
424
410
|
skip_truncate: request?.skip_truncate,
|
|
425
411
|
};
|
|
426
412
|
|
|
427
|
-
const response = await this.apiClient.sendRequest<
|
|
428
|
-
StreamResponse<DeleteChannelsResponse>
|
|
429
|
-
>(
|
|
413
|
+
const response = await this.apiClient.sendRequest<DeleteChannelsResponse>(
|
|
430
414
|
'POST',
|
|
431
415
|
'/api/v2/chat/channels/delete',
|
|
432
416
|
undefined,
|
|
433
417
|
undefined,
|
|
434
418
|
body,
|
|
435
|
-
'application/json',
|
|
436
419
|
);
|
|
437
420
|
|
|
438
|
-
decoders['DeleteChannelsResponse']?.(response
|
|
421
|
+
decoders['DeleteChannelsResponse']?.(response);
|
|
439
422
|
|
|
440
|
-
return
|
|
423
|
+
return response;
|
|
441
424
|
}
|
|
442
425
|
|
|
443
426
|
async markDelivered(
|
|
@@ -450,20 +433,17 @@ export class ChatApi {
|
|
|
450
433
|
latest_delivered_messages: request?.latest_delivered_messages,
|
|
451
434
|
};
|
|
452
435
|
|
|
453
|
-
const response = await this.apiClient.sendRequest<
|
|
454
|
-
StreamResponse<MarkDeliveredResponse>
|
|
455
|
-
>(
|
|
436
|
+
const response = await this.apiClient.sendRequest<MarkDeliveredResponse>(
|
|
456
437
|
'POST',
|
|
457
438
|
'/api/v2/chat/channels/delivered',
|
|
458
439
|
undefined,
|
|
459
440
|
queryParams,
|
|
460
441
|
body,
|
|
461
|
-
'application/json',
|
|
462
442
|
);
|
|
463
443
|
|
|
464
|
-
decoders['MarkDeliveredResponse']?.(response
|
|
444
|
+
decoders['MarkDeliveredResponse']?.(response);
|
|
465
445
|
|
|
466
|
-
return
|
|
446
|
+
return response;
|
|
467
447
|
}
|
|
468
448
|
|
|
469
449
|
async groupedQueryChannels(
|
|
@@ -476,20 +456,18 @@ export class ChatApi {
|
|
|
476
456
|
user: request?.user,
|
|
477
457
|
};
|
|
478
458
|
|
|
479
|
-
const response =
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
'application/json',
|
|
488
|
-
);
|
|
459
|
+
const response =
|
|
460
|
+
await this.apiClient.sendRequest<GroupedQueryChannelsResponse>(
|
|
461
|
+
'POST',
|
|
462
|
+
'/api/v2/chat/channels/grouped',
|
|
463
|
+
undefined,
|
|
464
|
+
undefined,
|
|
465
|
+
body,
|
|
466
|
+
);
|
|
489
467
|
|
|
490
|
-
decoders['GroupedQueryChannelsResponse']?.(response
|
|
468
|
+
decoders['GroupedQueryChannelsResponse']?.(response);
|
|
491
469
|
|
|
492
|
-
return
|
|
470
|
+
return response;
|
|
493
471
|
}
|
|
494
472
|
|
|
495
473
|
async markChannelsRead(
|
|
@@ -501,20 +479,17 @@ export class ChatApi {
|
|
|
501
479
|
user: request?.user,
|
|
502
480
|
};
|
|
503
481
|
|
|
504
|
-
const response = await this.apiClient.sendRequest<
|
|
505
|
-
StreamResponse<MarkReadResponse>
|
|
506
|
-
>(
|
|
482
|
+
const response = await this.apiClient.sendRequest<MarkReadResponse>(
|
|
507
483
|
'POST',
|
|
508
484
|
'/api/v2/chat/channels/read',
|
|
509
485
|
undefined,
|
|
510
486
|
undefined,
|
|
511
487
|
body,
|
|
512
|
-
'application/json',
|
|
513
488
|
);
|
|
514
489
|
|
|
515
|
-
decoders['MarkReadResponse']?.(response
|
|
490
|
+
decoders['MarkReadResponse']?.(response);
|
|
516
491
|
|
|
517
|
-
return
|
|
492
|
+
return response;
|
|
518
493
|
}
|
|
519
494
|
|
|
520
495
|
async getOrCreateDistinctChannel(
|
|
@@ -534,20 +509,17 @@ export class ChatApi {
|
|
|
534
509
|
watchers: request?.watchers,
|
|
535
510
|
};
|
|
536
511
|
|
|
537
|
-
const response = await this.apiClient.sendRequest<
|
|
538
|
-
StreamResponse<ChannelStateResponse>
|
|
539
|
-
>(
|
|
512
|
+
const response = await this.apiClient.sendRequest<ChannelStateResponse>(
|
|
540
513
|
'POST',
|
|
541
514
|
'/api/v2/chat/channels/{type}/query',
|
|
542
515
|
pathParams,
|
|
543
516
|
undefined,
|
|
544
517
|
body,
|
|
545
|
-
'application/json',
|
|
546
518
|
);
|
|
547
519
|
|
|
548
|
-
decoders['ChannelStateResponse']?.(response
|
|
520
|
+
decoders['ChannelStateResponse']?.(response);
|
|
549
521
|
|
|
550
|
-
return
|
|
522
|
+
return response;
|
|
551
523
|
}
|
|
552
524
|
|
|
553
525
|
async deleteChannel(request: {
|
|
@@ -565,13 +537,16 @@ export class ChatApi {
|
|
|
565
537
|
id: request?.id,
|
|
566
538
|
};
|
|
567
539
|
|
|
568
|
-
const response = await this.apiClient.sendRequest<
|
|
569
|
-
|
|
570
|
-
|
|
540
|
+
const response = await this.apiClient.sendRequest<DeleteChannelResponse>(
|
|
541
|
+
'DELETE',
|
|
542
|
+
'/api/v2/chat/channels/{type}/{id}',
|
|
543
|
+
pathParams,
|
|
544
|
+
queryParams,
|
|
545
|
+
);
|
|
571
546
|
|
|
572
|
-
decoders['DeleteChannelResponse']?.(response
|
|
547
|
+
decoders['DeleteChannelResponse']?.(response);
|
|
573
548
|
|
|
574
|
-
return
|
|
549
|
+
return response;
|
|
575
550
|
}
|
|
576
551
|
|
|
577
552
|
async getChannel(request: {
|
|
@@ -605,13 +580,16 @@ export class ChatApi {
|
|
|
605
580
|
id: request?.id,
|
|
606
581
|
};
|
|
607
582
|
|
|
608
|
-
const response = await this.apiClient.sendRequest<
|
|
609
|
-
|
|
610
|
-
|
|
583
|
+
const response = await this.apiClient.sendRequest<ChannelStateResponse>(
|
|
584
|
+
'GET',
|
|
585
|
+
'/api/v2/chat/channels/{type}/{id}',
|
|
586
|
+
pathParams,
|
|
587
|
+
queryParams,
|
|
588
|
+
);
|
|
611
589
|
|
|
612
|
-
decoders['ChannelStateResponse']?.(response
|
|
590
|
+
decoders['ChannelStateResponse']?.(response);
|
|
613
591
|
|
|
614
|
-
return
|
|
592
|
+
return response;
|
|
615
593
|
}
|
|
616
594
|
|
|
617
595
|
async updateChannelPartial(
|
|
@@ -628,20 +606,18 @@ export class ChatApi {
|
|
|
628
606
|
user: request?.user,
|
|
629
607
|
};
|
|
630
608
|
|
|
631
|
-
const response =
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
'application/json',
|
|
640
|
-
);
|
|
609
|
+
const response =
|
|
610
|
+
await this.apiClient.sendRequest<UpdateChannelPartialResponse>(
|
|
611
|
+
'PATCH',
|
|
612
|
+
'/api/v2/chat/channels/{type}/{id}',
|
|
613
|
+
pathParams,
|
|
614
|
+
undefined,
|
|
615
|
+
body,
|
|
616
|
+
);
|
|
641
617
|
|
|
642
|
-
decoders['UpdateChannelPartialResponse']?.(response
|
|
618
|
+
decoders['UpdateChannelPartialResponse']?.(response);
|
|
643
619
|
|
|
644
|
-
return
|
|
620
|
+
return response;
|
|
645
621
|
}
|
|
646
622
|
|
|
647
623
|
async updateChannel(
|
|
@@ -672,20 +648,17 @@ export class ChatApi {
|
|
|
672
648
|
user: request?.user,
|
|
673
649
|
};
|
|
674
650
|
|
|
675
|
-
const response = await this.apiClient.sendRequest<
|
|
676
|
-
StreamResponse<UpdateChannelResponse>
|
|
677
|
-
>(
|
|
651
|
+
const response = await this.apiClient.sendRequest<UpdateChannelResponse>(
|
|
678
652
|
'POST',
|
|
679
653
|
'/api/v2/chat/channels/{type}/{id}',
|
|
680
654
|
pathParams,
|
|
681
655
|
undefined,
|
|
682
656
|
body,
|
|
683
|
-
'application/json',
|
|
684
657
|
);
|
|
685
658
|
|
|
686
|
-
decoders['UpdateChannelResponse']?.(response
|
|
659
|
+
decoders['UpdateChannelResponse']?.(response);
|
|
687
660
|
|
|
688
|
-
return
|
|
661
|
+
return response;
|
|
689
662
|
}
|
|
690
663
|
|
|
691
664
|
async deleteDraft(request: {
|
|
@@ -703,16 +676,16 @@ export class ChatApi {
|
|
|
703
676
|
id: request?.id,
|
|
704
677
|
};
|
|
705
678
|
|
|
706
|
-
const response = await this.apiClient.sendRequest<
|
|
679
|
+
const response = await this.apiClient.sendRequest<Response>(
|
|
707
680
|
'DELETE',
|
|
708
681
|
'/api/v2/chat/channels/{type}/{id}/draft',
|
|
709
682
|
pathParams,
|
|
710
683
|
queryParams,
|
|
711
684
|
);
|
|
712
685
|
|
|
713
|
-
decoders['Response']?.(response
|
|
686
|
+
decoders['Response']?.(response);
|
|
714
687
|
|
|
715
|
-
return
|
|
688
|
+
return response;
|
|
716
689
|
}
|
|
717
690
|
|
|
718
691
|
async getDraft(request: {
|
|
@@ -730,18 +703,16 @@ export class ChatApi {
|
|
|
730
703
|
id: request?.id,
|
|
731
704
|
};
|
|
732
705
|
|
|
733
|
-
const response = await this.apiClient.sendRequest<
|
|
734
|
-
StreamResponse<GetDraftResponse>
|
|
735
|
-
>(
|
|
706
|
+
const response = await this.apiClient.sendRequest<GetDraftResponse>(
|
|
736
707
|
'GET',
|
|
737
708
|
'/api/v2/chat/channels/{type}/{id}/draft',
|
|
738
709
|
pathParams,
|
|
739
710
|
queryParams,
|
|
740
711
|
);
|
|
741
712
|
|
|
742
|
-
decoders['GetDraftResponse']?.(response
|
|
713
|
+
decoders['GetDraftResponse']?.(response);
|
|
743
714
|
|
|
744
|
-
return
|
|
715
|
+
return response;
|
|
745
716
|
}
|
|
746
717
|
|
|
747
718
|
async sendEvent(
|
|
@@ -755,20 +726,17 @@ export class ChatApi {
|
|
|
755
726
|
event: request?.event,
|
|
756
727
|
};
|
|
757
728
|
|
|
758
|
-
const response = await this.apiClient.sendRequest<
|
|
759
|
-
StreamResponse<EventResponse>
|
|
760
|
-
>(
|
|
729
|
+
const response = await this.apiClient.sendRequest<EventResponse>(
|
|
761
730
|
'POST',
|
|
762
731
|
'/api/v2/chat/channels/{type}/{id}/event',
|
|
763
732
|
pathParams,
|
|
764
733
|
undefined,
|
|
765
734
|
body,
|
|
766
|
-
'application/json',
|
|
767
735
|
);
|
|
768
736
|
|
|
769
|
-
decoders['EventResponse']?.(response
|
|
737
|
+
decoders['EventResponse']?.(response);
|
|
770
738
|
|
|
771
|
-
return
|
|
739
|
+
return response;
|
|
772
740
|
}
|
|
773
741
|
|
|
774
742
|
async deleteChannelFile(request: {
|
|
@@ -784,16 +752,16 @@ export class ChatApi {
|
|
|
784
752
|
id: request?.id,
|
|
785
753
|
};
|
|
786
754
|
|
|
787
|
-
const response = await this.apiClient.sendRequest<
|
|
755
|
+
const response = await this.apiClient.sendRequest<Response>(
|
|
788
756
|
'DELETE',
|
|
789
757
|
'/api/v2/chat/channels/{type}/{id}/file',
|
|
790
758
|
pathParams,
|
|
791
759
|
queryParams,
|
|
792
760
|
);
|
|
793
761
|
|
|
794
|
-
decoders['Response']?.(response
|
|
762
|
+
decoders['Response']?.(response);
|
|
795
763
|
|
|
796
|
-
return
|
|
764
|
+
return response;
|
|
797
765
|
}
|
|
798
766
|
|
|
799
767
|
async uploadChannelFile(
|
|
@@ -808,20 +776,19 @@ export class ChatApi {
|
|
|
808
776
|
user: request?.user,
|
|
809
777
|
};
|
|
810
778
|
|
|
811
|
-
const response =
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
);
|
|
779
|
+
const response =
|
|
780
|
+
await this.apiClient.sendRequest<UploadChannelFileResponse>(
|
|
781
|
+
'POST',
|
|
782
|
+
'/api/v2/chat/channels/{type}/{id}/file',
|
|
783
|
+
pathParams,
|
|
784
|
+
undefined,
|
|
785
|
+
body,
|
|
786
|
+
'multipart/form-data',
|
|
787
|
+
);
|
|
821
788
|
|
|
822
|
-
decoders['UploadChannelFileResponse']?.(response
|
|
789
|
+
decoders['UploadChannelFileResponse']?.(response);
|
|
823
790
|
|
|
824
|
-
return
|
|
791
|
+
return response;
|
|
825
792
|
}
|
|
826
793
|
|
|
827
794
|
async hideChannel(
|
|
@@ -837,20 +804,17 @@ export class ChatApi {
|
|
|
837
804
|
user: request?.user,
|
|
838
805
|
};
|
|
839
806
|
|
|
840
|
-
const response = await this.apiClient.sendRequest<
|
|
841
|
-
StreamResponse<HideChannelResponse>
|
|
842
|
-
>(
|
|
807
|
+
const response = await this.apiClient.sendRequest<HideChannelResponse>(
|
|
843
808
|
'POST',
|
|
844
809
|
'/api/v2/chat/channels/{type}/{id}/hide',
|
|
845
810
|
pathParams,
|
|
846
811
|
undefined,
|
|
847
812
|
body,
|
|
848
|
-
'application/json',
|
|
849
813
|
);
|
|
850
814
|
|
|
851
|
-
decoders['HideChannelResponse']?.(response
|
|
815
|
+
decoders['HideChannelResponse']?.(response);
|
|
852
816
|
|
|
853
|
-
return
|
|
817
|
+
return response;
|
|
854
818
|
}
|
|
855
819
|
|
|
856
820
|
async deleteChannelImage(request: {
|
|
@@ -866,16 +830,16 @@ export class ChatApi {
|
|
|
866
830
|
id: request?.id,
|
|
867
831
|
};
|
|
868
832
|
|
|
869
|
-
const response = await this.apiClient.sendRequest<
|
|
833
|
+
const response = await this.apiClient.sendRequest<Response>(
|
|
870
834
|
'DELETE',
|
|
871
835
|
'/api/v2/chat/channels/{type}/{id}/image',
|
|
872
836
|
pathParams,
|
|
873
837
|
queryParams,
|
|
874
838
|
);
|
|
875
839
|
|
|
876
|
-
decoders['Response']?.(response
|
|
840
|
+
decoders['Response']?.(response);
|
|
877
841
|
|
|
878
|
-
return
|
|
842
|
+
return response;
|
|
879
843
|
}
|
|
880
844
|
|
|
881
845
|
async uploadChannelImage(
|
|
@@ -891,9 +855,7 @@ export class ChatApi {
|
|
|
891
855
|
user: request?.user,
|
|
892
856
|
};
|
|
893
857
|
|
|
894
|
-
const response = await this.apiClient.sendRequest<
|
|
895
|
-
StreamResponse<UploadChannelResponse>
|
|
896
|
-
>(
|
|
858
|
+
const response = await this.apiClient.sendRequest<UploadChannelResponse>(
|
|
897
859
|
'POST',
|
|
898
860
|
'/api/v2/chat/channels/{type}/{id}/image',
|
|
899
861
|
pathParams,
|
|
@@ -902,9 +864,9 @@ export class ChatApi {
|
|
|
902
864
|
'multipart/form-data',
|
|
903
865
|
);
|
|
904
866
|
|
|
905
|
-
decoders['UploadChannelResponse']?.(response
|
|
867
|
+
decoders['UploadChannelResponse']?.(response);
|
|
906
868
|
|
|
907
|
-
return
|
|
869
|
+
return response;
|
|
908
870
|
}
|
|
909
871
|
|
|
910
872
|
async updateMemberPartial(
|
|
@@ -926,20 +888,18 @@ export class ChatApi {
|
|
|
926
888
|
set: request?.set,
|
|
927
889
|
};
|
|
928
890
|
|
|
929
|
-
const response =
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
'application/json',
|
|
938
|
-
);
|
|
891
|
+
const response =
|
|
892
|
+
await this.apiClient.sendRequest<UpdateMemberPartialResponse>(
|
|
893
|
+
'PATCH',
|
|
894
|
+
'/api/v2/chat/channels/{type}/{id}/member',
|
|
895
|
+
pathParams,
|
|
896
|
+
queryParams,
|
|
897
|
+
body,
|
|
898
|
+
);
|
|
939
899
|
|
|
940
|
-
decoders['UpdateMemberPartialResponse']?.(response
|
|
900
|
+
decoders['UpdateMemberPartialResponse']?.(response);
|
|
941
901
|
|
|
942
|
-
return
|
|
902
|
+
return response;
|
|
943
903
|
}
|
|
944
904
|
|
|
945
905
|
async sendMessage(
|
|
@@ -961,20 +921,17 @@ export class ChatApi {
|
|
|
961
921
|
pending_message_metadata: request?.pending_message_metadata,
|
|
962
922
|
};
|
|
963
923
|
|
|
964
|
-
const response = await this.apiClient.sendRequest<
|
|
965
|
-
StreamResponse<SendMessageResponse>
|
|
966
|
-
>(
|
|
924
|
+
const response = await this.apiClient.sendRequest<SendMessageResponse>(
|
|
967
925
|
'POST',
|
|
968
926
|
'/api/v2/chat/channels/{type}/{id}/message',
|
|
969
927
|
pathParams,
|
|
970
928
|
undefined,
|
|
971
929
|
body,
|
|
972
|
-
'application/json',
|
|
973
930
|
);
|
|
974
931
|
|
|
975
|
-
decoders['SendMessageResponse']?.(response
|
|
932
|
+
decoders['SendMessageResponse']?.(response);
|
|
976
933
|
|
|
977
|
-
return
|
|
934
|
+
return response;
|
|
978
935
|
}
|
|
979
936
|
|
|
980
937
|
async getManyMessages(request: {
|
|
@@ -992,18 +949,16 @@ export class ChatApi {
|
|
|
992
949
|
id: request?.id,
|
|
993
950
|
};
|
|
994
951
|
|
|
995
|
-
const response = await this.apiClient.sendRequest<
|
|
996
|
-
StreamResponse<GetManyMessagesResponse>
|
|
997
|
-
>(
|
|
952
|
+
const response = await this.apiClient.sendRequest<GetManyMessagesResponse>(
|
|
998
953
|
'GET',
|
|
999
954
|
'/api/v2/chat/channels/{type}/{id}/messages',
|
|
1000
955
|
pathParams,
|
|
1001
956
|
queryParams,
|
|
1002
957
|
);
|
|
1003
958
|
|
|
1004
|
-
decoders['GetManyMessagesResponse']?.(response
|
|
959
|
+
decoders['GetManyMessagesResponse']?.(response);
|
|
1005
960
|
|
|
1006
|
-
return
|
|
961
|
+
return response;
|
|
1007
962
|
}
|
|
1008
963
|
|
|
1009
964
|
async getPinnedMessages(request: {
|
|
@@ -1047,18 +1002,17 @@ export class ChatApi {
|
|
|
1047
1002
|
id: request?.id,
|
|
1048
1003
|
};
|
|
1049
1004
|
|
|
1050
|
-
const response =
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
);
|
|
1005
|
+
const response =
|
|
1006
|
+
await this.apiClient.sendRequest<GetPinnedMessagesResponse>(
|
|
1007
|
+
'GET',
|
|
1008
|
+
'/api/v2/chat/channels/{type}/{id}/pinned_messages',
|
|
1009
|
+
pathParams,
|
|
1010
|
+
queryParams,
|
|
1011
|
+
);
|
|
1058
1012
|
|
|
1059
|
-
decoders['GetPinnedMessagesResponse']?.(response
|
|
1013
|
+
decoders['GetPinnedMessagesResponse']?.(response);
|
|
1060
1014
|
|
|
1061
|
-
return
|
|
1015
|
+
return response;
|
|
1062
1016
|
}
|
|
1063
1017
|
|
|
1064
1018
|
async getOrCreateChannel(
|
|
@@ -1079,20 +1033,17 @@ export class ChatApi {
|
|
|
1079
1033
|
watchers: request?.watchers,
|
|
1080
1034
|
};
|
|
1081
1035
|
|
|
1082
|
-
const response = await this.apiClient.sendRequest<
|
|
1083
|
-
StreamResponse<ChannelStateResponse>
|
|
1084
|
-
>(
|
|
1036
|
+
const response = await this.apiClient.sendRequest<ChannelStateResponse>(
|
|
1085
1037
|
'POST',
|
|
1086
1038
|
'/api/v2/chat/channels/{type}/{id}/query',
|
|
1087
1039
|
pathParams,
|
|
1088
1040
|
undefined,
|
|
1089
1041
|
body,
|
|
1090
|
-
'application/json',
|
|
1091
1042
|
);
|
|
1092
1043
|
|
|
1093
|
-
decoders['ChannelStateResponse']?.(response
|
|
1044
|
+
decoders['ChannelStateResponse']?.(response);
|
|
1094
1045
|
|
|
1095
|
-
return
|
|
1046
|
+
return response;
|
|
1096
1047
|
}
|
|
1097
1048
|
|
|
1098
1049
|
async markRead(
|
|
@@ -1109,20 +1060,17 @@ export class ChatApi {
|
|
|
1109
1060
|
user: request?.user,
|
|
1110
1061
|
};
|
|
1111
1062
|
|
|
1112
|
-
const response = await this.apiClient.sendRequest<
|
|
1113
|
-
StreamResponse<MarkReadResponse>
|
|
1114
|
-
>(
|
|
1063
|
+
const response = await this.apiClient.sendRequest<MarkReadResponse>(
|
|
1115
1064
|
'POST',
|
|
1116
1065
|
'/api/v2/chat/channels/{type}/{id}/read',
|
|
1117
1066
|
pathParams,
|
|
1118
1067
|
undefined,
|
|
1119
1068
|
body,
|
|
1120
|
-
'application/json',
|
|
1121
1069
|
);
|
|
1122
1070
|
|
|
1123
|
-
decoders['MarkReadResponse']?.(response
|
|
1071
|
+
decoders['MarkReadResponse']?.(response);
|
|
1124
1072
|
|
|
1125
|
-
return
|
|
1073
|
+
return response;
|
|
1126
1074
|
}
|
|
1127
1075
|
|
|
1128
1076
|
async showChannel(
|
|
@@ -1137,20 +1085,17 @@ export class ChatApi {
|
|
|
1137
1085
|
user: request?.user,
|
|
1138
1086
|
};
|
|
1139
1087
|
|
|
1140
|
-
const response = await this.apiClient.sendRequest<
|
|
1141
|
-
StreamResponse<ShowChannelResponse>
|
|
1142
|
-
>(
|
|
1088
|
+
const response = await this.apiClient.sendRequest<ShowChannelResponse>(
|
|
1143
1089
|
'POST',
|
|
1144
1090
|
'/api/v2/chat/channels/{type}/{id}/show',
|
|
1145
1091
|
pathParams,
|
|
1146
1092
|
undefined,
|
|
1147
1093
|
body,
|
|
1148
|
-
'application/json',
|
|
1149
1094
|
);
|
|
1150
1095
|
|
|
1151
|
-
decoders['ShowChannelResponse']?.(response
|
|
1096
|
+
decoders['ShowChannelResponse']?.(response);
|
|
1152
1097
|
|
|
1153
|
-
return
|
|
1098
|
+
return response;
|
|
1154
1099
|
}
|
|
1155
1100
|
|
|
1156
1101
|
async truncateChannel(
|
|
@@ -1170,20 +1115,17 @@ export class ChatApi {
|
|
|
1170
1115
|
user: request?.user,
|
|
1171
1116
|
};
|
|
1172
1117
|
|
|
1173
|
-
const response = await this.apiClient.sendRequest<
|
|
1174
|
-
StreamResponse<TruncateChannelResponse>
|
|
1175
|
-
>(
|
|
1118
|
+
const response = await this.apiClient.sendRequest<TruncateChannelResponse>(
|
|
1176
1119
|
'POST',
|
|
1177
1120
|
'/api/v2/chat/channels/{type}/{id}/truncate',
|
|
1178
1121
|
pathParams,
|
|
1179
1122
|
undefined,
|
|
1180
1123
|
body,
|
|
1181
|
-
'application/json',
|
|
1182
1124
|
);
|
|
1183
1125
|
|
|
1184
|
-
decoders['TruncateChannelResponse']?.(response
|
|
1126
|
+
decoders['TruncateChannelResponse']?.(response);
|
|
1185
1127
|
|
|
1186
|
-
return
|
|
1128
|
+
return response;
|
|
1187
1129
|
}
|
|
1188
1130
|
|
|
1189
1131
|
async markUnread(
|
|
@@ -1201,28 +1143,30 @@ export class ChatApi {
|
|
|
1201
1143
|
user: request?.user,
|
|
1202
1144
|
};
|
|
1203
1145
|
|
|
1204
|
-
const response = await this.apiClient.sendRequest<
|
|
1146
|
+
const response = await this.apiClient.sendRequest<Response>(
|
|
1205
1147
|
'POST',
|
|
1206
1148
|
'/api/v2/chat/channels/{type}/{id}/unread',
|
|
1207
1149
|
pathParams,
|
|
1208
1150
|
undefined,
|
|
1209
1151
|
body,
|
|
1210
|
-
'application/json',
|
|
1211
1152
|
);
|
|
1212
1153
|
|
|
1213
|
-
decoders['Response']?.(response
|
|
1154
|
+
decoders['Response']?.(response);
|
|
1214
1155
|
|
|
1215
|
-
return
|
|
1156
|
+
return response;
|
|
1216
1157
|
}
|
|
1217
1158
|
|
|
1218
1159
|
async listChannelTypes(): Promise<StreamResponse<ListChannelTypesResponse>> {
|
|
1219
|
-
const response = await this.apiClient.sendRequest<
|
|
1220
|
-
|
|
1221
|
-
|
|
1160
|
+
const response = await this.apiClient.sendRequest<ListChannelTypesResponse>(
|
|
1161
|
+
'GET',
|
|
1162
|
+
'/api/v2/chat/channeltypes',
|
|
1163
|
+
undefined,
|
|
1164
|
+
undefined,
|
|
1165
|
+
);
|
|
1222
1166
|
|
|
1223
|
-
decoders['ListChannelTypesResponse']?.(response
|
|
1167
|
+
decoders['ListChannelTypesResponse']?.(response);
|
|
1224
1168
|
|
|
1225
|
-
return
|
|
1169
|
+
return response;
|
|
1226
1170
|
}
|
|
1227
1171
|
|
|
1228
1172
|
async createChannelType(
|
|
@@ -1265,20 +1209,18 @@ export class ChatApi {
|
|
|
1265
1209
|
grants: request?.grants,
|
|
1266
1210
|
};
|
|
1267
1211
|
|
|
1268
|
-
const response =
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
'application/json',
|
|
1277
|
-
);
|
|
1212
|
+
const response =
|
|
1213
|
+
await this.apiClient.sendRequest<CreateChannelTypeResponse>(
|
|
1214
|
+
'POST',
|
|
1215
|
+
'/api/v2/chat/channeltypes',
|
|
1216
|
+
undefined,
|
|
1217
|
+
undefined,
|
|
1218
|
+
body,
|
|
1219
|
+
);
|
|
1278
1220
|
|
|
1279
|
-
decoders['CreateChannelTypeResponse']?.(response
|
|
1221
|
+
decoders['CreateChannelTypeResponse']?.(response);
|
|
1280
1222
|
|
|
1281
|
-
return
|
|
1223
|
+
return response;
|
|
1282
1224
|
}
|
|
1283
1225
|
|
|
1284
1226
|
async deleteChannelType(request: {
|
|
@@ -1288,16 +1230,16 @@ export class ChatApi {
|
|
|
1288
1230
|
name: request?.name,
|
|
1289
1231
|
};
|
|
1290
1232
|
|
|
1291
|
-
const response = await this.apiClient.sendRequest<
|
|
1233
|
+
const response = await this.apiClient.sendRequest<Response>(
|
|
1292
1234
|
'DELETE',
|
|
1293
1235
|
'/api/v2/chat/channeltypes/{name}',
|
|
1294
1236
|
pathParams,
|
|
1295
1237
|
undefined,
|
|
1296
1238
|
);
|
|
1297
1239
|
|
|
1298
|
-
decoders['Response']?.(response
|
|
1240
|
+
decoders['Response']?.(response);
|
|
1299
1241
|
|
|
1300
|
-
return
|
|
1242
|
+
return response;
|
|
1301
1243
|
}
|
|
1302
1244
|
|
|
1303
1245
|
async getChannelType(request: {
|
|
@@ -1307,13 +1249,16 @@ export class ChatApi {
|
|
|
1307
1249
|
name: request?.name,
|
|
1308
1250
|
};
|
|
1309
1251
|
|
|
1310
|
-
const response = await this.apiClient.sendRequest<
|
|
1311
|
-
|
|
1312
|
-
|
|
1252
|
+
const response = await this.apiClient.sendRequest<GetChannelTypeResponse>(
|
|
1253
|
+
'GET',
|
|
1254
|
+
'/api/v2/chat/channeltypes/{name}',
|
|
1255
|
+
pathParams,
|
|
1256
|
+
undefined,
|
|
1257
|
+
);
|
|
1313
1258
|
|
|
1314
|
-
decoders['GetChannelTypeResponse']?.(response
|
|
1259
|
+
decoders['GetChannelTypeResponse']?.(response);
|
|
1315
1260
|
|
|
1316
|
-
return
|
|
1261
|
+
return response;
|
|
1317
1262
|
}
|
|
1318
1263
|
|
|
1319
1264
|
async updateChannelType(
|
|
@@ -1362,30 +1307,31 @@ export class ChatApi {
|
|
|
1362
1307
|
grants: request?.grants,
|
|
1363
1308
|
};
|
|
1364
1309
|
|
|
1365
|
-
const response =
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
'application/json',
|
|
1374
|
-
);
|
|
1310
|
+
const response =
|
|
1311
|
+
await this.apiClient.sendRequest<UpdateChannelTypeResponse>(
|
|
1312
|
+
'PUT',
|
|
1313
|
+
'/api/v2/chat/channeltypes/{name}',
|
|
1314
|
+
pathParams,
|
|
1315
|
+
undefined,
|
|
1316
|
+
body,
|
|
1317
|
+
);
|
|
1375
1318
|
|
|
1376
|
-
decoders['UpdateChannelTypeResponse']?.(response
|
|
1319
|
+
decoders['UpdateChannelTypeResponse']?.(response);
|
|
1377
1320
|
|
|
1378
|
-
return
|
|
1321
|
+
return response;
|
|
1379
1322
|
}
|
|
1380
1323
|
|
|
1381
1324
|
async listCommands(): Promise<StreamResponse<ListCommandsResponse>> {
|
|
1382
|
-
const response = await this.apiClient.sendRequest<
|
|
1383
|
-
|
|
1384
|
-
|
|
1325
|
+
const response = await this.apiClient.sendRequest<ListCommandsResponse>(
|
|
1326
|
+
'GET',
|
|
1327
|
+
'/api/v2/chat/commands',
|
|
1328
|
+
undefined,
|
|
1329
|
+
undefined,
|
|
1330
|
+
);
|
|
1385
1331
|
|
|
1386
|
-
decoders['ListCommandsResponse']?.(response
|
|
1332
|
+
decoders['ListCommandsResponse']?.(response);
|
|
1387
1333
|
|
|
1388
|
-
return
|
|
1334
|
+
return response;
|
|
1389
1335
|
}
|
|
1390
1336
|
|
|
1391
1337
|
async createCommand(
|
|
@@ -1398,20 +1344,17 @@ export class ChatApi {
|
|
|
1398
1344
|
set: request?.set,
|
|
1399
1345
|
};
|
|
1400
1346
|
|
|
1401
|
-
const response = await this.apiClient.sendRequest<
|
|
1402
|
-
StreamResponse<CreateCommandResponse>
|
|
1403
|
-
>(
|
|
1347
|
+
const response = await this.apiClient.sendRequest<CreateCommandResponse>(
|
|
1404
1348
|
'POST',
|
|
1405
1349
|
'/api/v2/chat/commands',
|
|
1406
1350
|
undefined,
|
|
1407
1351
|
undefined,
|
|
1408
1352
|
body,
|
|
1409
|
-
'application/json',
|
|
1410
1353
|
);
|
|
1411
1354
|
|
|
1412
|
-
decoders['CreateCommandResponse']?.(response
|
|
1355
|
+
decoders['CreateCommandResponse']?.(response);
|
|
1413
1356
|
|
|
1414
|
-
return
|
|
1357
|
+
return response;
|
|
1415
1358
|
}
|
|
1416
1359
|
|
|
1417
1360
|
async deleteCommand(request: {
|
|
@@ -1421,13 +1364,16 @@ export class ChatApi {
|
|
|
1421
1364
|
name: request?.name,
|
|
1422
1365
|
};
|
|
1423
1366
|
|
|
1424
|
-
const response = await this.apiClient.sendRequest<
|
|
1425
|
-
|
|
1426
|
-
|
|
1367
|
+
const response = await this.apiClient.sendRequest<DeleteCommandResponse>(
|
|
1368
|
+
'DELETE',
|
|
1369
|
+
'/api/v2/chat/commands/{name}',
|
|
1370
|
+
pathParams,
|
|
1371
|
+
undefined,
|
|
1372
|
+
);
|
|
1427
1373
|
|
|
1428
|
-
decoders['DeleteCommandResponse']?.(response
|
|
1374
|
+
decoders['DeleteCommandResponse']?.(response);
|
|
1429
1375
|
|
|
1430
|
-
return
|
|
1376
|
+
return response;
|
|
1431
1377
|
}
|
|
1432
1378
|
|
|
1433
1379
|
async getCommand(request: {
|
|
@@ -1437,13 +1383,16 @@ export class ChatApi {
|
|
|
1437
1383
|
name: request?.name,
|
|
1438
1384
|
};
|
|
1439
1385
|
|
|
1440
|
-
const response = await this.apiClient.sendRequest<
|
|
1441
|
-
|
|
1442
|
-
|
|
1386
|
+
const response = await this.apiClient.sendRequest<GetCommandResponse>(
|
|
1387
|
+
'GET',
|
|
1388
|
+
'/api/v2/chat/commands/{name}',
|
|
1389
|
+
pathParams,
|
|
1390
|
+
undefined,
|
|
1391
|
+
);
|
|
1443
1392
|
|
|
1444
|
-
decoders['GetCommandResponse']?.(response
|
|
1393
|
+
decoders['GetCommandResponse']?.(response);
|
|
1445
1394
|
|
|
1446
|
-
return
|
|
1395
|
+
return response;
|
|
1447
1396
|
}
|
|
1448
1397
|
|
|
1449
1398
|
async updateCommand(
|
|
@@ -1458,20 +1407,17 @@ export class ChatApi {
|
|
|
1458
1407
|
set: request?.set,
|
|
1459
1408
|
};
|
|
1460
1409
|
|
|
1461
|
-
const response = await this.apiClient.sendRequest<
|
|
1462
|
-
StreamResponse<UpdateCommandResponse>
|
|
1463
|
-
>(
|
|
1410
|
+
const response = await this.apiClient.sendRequest<UpdateCommandResponse>(
|
|
1464
1411
|
'PUT',
|
|
1465
1412
|
'/api/v2/chat/commands/{name}',
|
|
1466
1413
|
pathParams,
|
|
1467
1414
|
undefined,
|
|
1468
1415
|
body,
|
|
1469
|
-
'application/json',
|
|
1470
1416
|
);
|
|
1471
1417
|
|
|
1472
|
-
decoders['UpdateCommandResponse']?.(response
|
|
1418
|
+
decoders['UpdateCommandResponse']?.(response);
|
|
1473
1419
|
|
|
1474
|
-
return
|
|
1420
|
+
return response;
|
|
1475
1421
|
}
|
|
1476
1422
|
|
|
1477
1423
|
async queryDrafts(
|
|
@@ -1487,20 +1433,17 @@ export class ChatApi {
|
|
|
1487
1433
|
user: request?.user,
|
|
1488
1434
|
};
|
|
1489
1435
|
|
|
1490
|
-
const response = await this.apiClient.sendRequest<
|
|
1491
|
-
StreamResponse<QueryDraftsResponse>
|
|
1492
|
-
>(
|
|
1436
|
+
const response = await this.apiClient.sendRequest<QueryDraftsResponse>(
|
|
1493
1437
|
'POST',
|
|
1494
1438
|
'/api/v2/chat/drafts/query',
|
|
1495
1439
|
undefined,
|
|
1496
1440
|
undefined,
|
|
1497
1441
|
body,
|
|
1498
|
-
'application/json',
|
|
1499
1442
|
);
|
|
1500
1443
|
|
|
1501
|
-
decoders['QueryDraftsResponse']?.(response
|
|
1444
|
+
decoders['QueryDraftsResponse']?.(response);
|
|
1502
1445
|
|
|
1503
|
-
return
|
|
1446
|
+
return response;
|
|
1504
1447
|
}
|
|
1505
1448
|
|
|
1506
1449
|
async exportChannels(
|
|
@@ -1517,20 +1460,17 @@ export class ChatApi {
|
|
|
1517
1460
|
include_fields: request?.include_fields,
|
|
1518
1461
|
};
|
|
1519
1462
|
|
|
1520
|
-
const response = await this.apiClient.sendRequest<
|
|
1521
|
-
StreamResponse<ExportChannelsResponse>
|
|
1522
|
-
>(
|
|
1463
|
+
const response = await this.apiClient.sendRequest<ExportChannelsResponse>(
|
|
1523
1464
|
'POST',
|
|
1524
1465
|
'/api/v2/chat/export_channels',
|
|
1525
1466
|
undefined,
|
|
1526
1467
|
undefined,
|
|
1527
1468
|
body,
|
|
1528
|
-
'application/json',
|
|
1529
1469
|
);
|
|
1530
1470
|
|
|
1531
|
-
decoders['ExportChannelsResponse']?.(response
|
|
1471
|
+
decoders['ExportChannelsResponse']?.(response);
|
|
1532
1472
|
|
|
1533
|
-
return
|
|
1473
|
+
return response;
|
|
1534
1474
|
}
|
|
1535
1475
|
|
|
1536
1476
|
async queryMembers(request?: {
|
|
@@ -1540,13 +1480,16 @@ export class ChatApi {
|
|
|
1540
1480
|
payload: request?.payload,
|
|
1541
1481
|
};
|
|
1542
1482
|
|
|
1543
|
-
const response = await this.apiClient.sendRequest<
|
|
1544
|
-
|
|
1545
|
-
|
|
1483
|
+
const response = await this.apiClient.sendRequest<MembersResponse>(
|
|
1484
|
+
'GET',
|
|
1485
|
+
'/api/v2/chat/members',
|
|
1486
|
+
undefined,
|
|
1487
|
+
queryParams,
|
|
1488
|
+
);
|
|
1546
1489
|
|
|
1547
|
-
decoders['MembersResponse']?.(response
|
|
1490
|
+
decoders['MembersResponse']?.(response);
|
|
1548
1491
|
|
|
1549
|
-
return
|
|
1492
|
+
return response;
|
|
1550
1493
|
}
|
|
1551
1494
|
|
|
1552
1495
|
async queryMessageHistory(
|
|
@@ -1560,20 +1503,18 @@ export class ChatApi {
|
|
|
1560
1503
|
sort: request?.sort,
|
|
1561
1504
|
};
|
|
1562
1505
|
|
|
1563
|
-
const response =
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
'application/json',
|
|
1572
|
-
);
|
|
1506
|
+
const response =
|
|
1507
|
+
await this.apiClient.sendRequest<QueryMessageHistoryResponse>(
|
|
1508
|
+
'POST',
|
|
1509
|
+
'/api/v2/chat/messages/history',
|
|
1510
|
+
undefined,
|
|
1511
|
+
undefined,
|
|
1512
|
+
body,
|
|
1513
|
+
);
|
|
1573
1514
|
|
|
1574
|
-
decoders['QueryMessageHistoryResponse']?.(response
|
|
1515
|
+
decoders['QueryMessageHistoryResponse']?.(response);
|
|
1575
1516
|
|
|
1576
|
-
return
|
|
1517
|
+
return response;
|
|
1577
1518
|
}
|
|
1578
1519
|
|
|
1579
1520
|
async deleteMessage(request: {
|
|
@@ -1591,13 +1532,16 @@ export class ChatApi {
|
|
|
1591
1532
|
id: request?.id,
|
|
1592
1533
|
};
|
|
1593
1534
|
|
|
1594
|
-
const response = await this.apiClient.sendRequest<
|
|
1595
|
-
|
|
1596
|
-
|
|
1535
|
+
const response = await this.apiClient.sendRequest<DeleteMessageResponse>(
|
|
1536
|
+
'DELETE',
|
|
1537
|
+
'/api/v2/chat/messages/{id}',
|
|
1538
|
+
pathParams,
|
|
1539
|
+
queryParams,
|
|
1540
|
+
);
|
|
1597
1541
|
|
|
1598
|
-
decoders['DeleteMessageResponse']?.(response
|
|
1542
|
+
decoders['DeleteMessageResponse']?.(response);
|
|
1599
1543
|
|
|
1600
|
-
return
|
|
1544
|
+
return response;
|
|
1601
1545
|
}
|
|
1602
1546
|
|
|
1603
1547
|
async getMessage(request: {
|
|
@@ -1611,13 +1555,16 @@ export class ChatApi {
|
|
|
1611
1555
|
id: request?.id,
|
|
1612
1556
|
};
|
|
1613
1557
|
|
|
1614
|
-
const response = await this.apiClient.sendRequest<
|
|
1615
|
-
|
|
1616
|
-
|
|
1558
|
+
const response = await this.apiClient.sendRequest<GetMessageResponse>(
|
|
1559
|
+
'GET',
|
|
1560
|
+
'/api/v2/chat/messages/{id}',
|
|
1561
|
+
pathParams,
|
|
1562
|
+
queryParams,
|
|
1563
|
+
);
|
|
1617
1564
|
|
|
1618
|
-
decoders['GetMessageResponse']?.(response
|
|
1565
|
+
decoders['GetMessageResponse']?.(response);
|
|
1619
1566
|
|
|
1620
|
-
return
|
|
1567
|
+
return response;
|
|
1621
1568
|
}
|
|
1622
1569
|
|
|
1623
1570
|
async updateMessage(
|
|
@@ -1632,20 +1579,17 @@ export class ChatApi {
|
|
|
1632
1579
|
skip_push: request?.skip_push,
|
|
1633
1580
|
};
|
|
1634
1581
|
|
|
1635
|
-
const response = await this.apiClient.sendRequest<
|
|
1636
|
-
StreamResponse<UpdateMessageResponse>
|
|
1637
|
-
>(
|
|
1582
|
+
const response = await this.apiClient.sendRequest<UpdateMessageResponse>(
|
|
1638
1583
|
'POST',
|
|
1639
1584
|
'/api/v2/chat/messages/{id}',
|
|
1640
1585
|
pathParams,
|
|
1641
1586
|
undefined,
|
|
1642
1587
|
body,
|
|
1643
|
-
'application/json',
|
|
1644
1588
|
);
|
|
1645
1589
|
|
|
1646
|
-
decoders['UpdateMessageResponse']?.(response
|
|
1590
|
+
decoders['UpdateMessageResponse']?.(response);
|
|
1647
1591
|
|
|
1648
|
-
return
|
|
1592
|
+
return response;
|
|
1649
1593
|
}
|
|
1650
1594
|
|
|
1651
1595
|
async updateMessagePartial(
|
|
@@ -1663,20 +1607,18 @@ export class ChatApi {
|
|
|
1663
1607
|
user: request?.user,
|
|
1664
1608
|
};
|
|
1665
1609
|
|
|
1666
|
-
const response =
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
'application/json',
|
|
1675
|
-
);
|
|
1610
|
+
const response =
|
|
1611
|
+
await this.apiClient.sendRequest<UpdateMessagePartialResponse>(
|
|
1612
|
+
'PUT',
|
|
1613
|
+
'/api/v2/chat/messages/{id}',
|
|
1614
|
+
pathParams,
|
|
1615
|
+
undefined,
|
|
1616
|
+
body,
|
|
1617
|
+
);
|
|
1676
1618
|
|
|
1677
|
-
decoders['UpdateMessagePartialResponse']?.(response
|
|
1619
|
+
decoders['UpdateMessagePartialResponse']?.(response);
|
|
1678
1620
|
|
|
1679
|
-
return
|
|
1621
|
+
return response;
|
|
1680
1622
|
}
|
|
1681
1623
|
|
|
1682
1624
|
async runMessageAction(
|
|
@@ -1691,20 +1633,17 @@ export class ChatApi {
|
|
|
1691
1633
|
user: request?.user,
|
|
1692
1634
|
};
|
|
1693
1635
|
|
|
1694
|
-
const response = await this.apiClient.sendRequest<
|
|
1695
|
-
StreamResponse<MessageActionResponse>
|
|
1696
|
-
>(
|
|
1636
|
+
const response = await this.apiClient.sendRequest<MessageActionResponse>(
|
|
1697
1637
|
'POST',
|
|
1698
1638
|
'/api/v2/chat/messages/{id}/action',
|
|
1699
1639
|
pathParams,
|
|
1700
1640
|
undefined,
|
|
1701
1641
|
body,
|
|
1702
|
-
'application/json',
|
|
1703
1642
|
);
|
|
1704
1643
|
|
|
1705
|
-
decoders['MessageActionResponse']?.(response
|
|
1644
|
+
decoders['MessageActionResponse']?.(response);
|
|
1706
1645
|
|
|
1707
|
-
return
|
|
1646
|
+
return response;
|
|
1708
1647
|
}
|
|
1709
1648
|
|
|
1710
1649
|
async commitMessage(
|
|
@@ -1715,20 +1654,17 @@ export class ChatApi {
|
|
|
1715
1654
|
};
|
|
1716
1655
|
const body = {};
|
|
1717
1656
|
|
|
1718
|
-
const response = await this.apiClient.sendRequest<
|
|
1719
|
-
StreamResponse<MessageActionResponse>
|
|
1720
|
-
>(
|
|
1657
|
+
const response = await this.apiClient.sendRequest<MessageActionResponse>(
|
|
1721
1658
|
'POST',
|
|
1722
1659
|
'/api/v2/chat/messages/{id}/commit',
|
|
1723
1660
|
pathParams,
|
|
1724
1661
|
undefined,
|
|
1725
1662
|
body,
|
|
1726
|
-
'application/json',
|
|
1727
1663
|
);
|
|
1728
1664
|
|
|
1729
|
-
decoders['MessageActionResponse']?.(response
|
|
1665
|
+
decoders['MessageActionResponse']?.(response);
|
|
1730
1666
|
|
|
1731
|
-
return
|
|
1667
|
+
return response;
|
|
1732
1668
|
}
|
|
1733
1669
|
|
|
1734
1670
|
async ephemeralMessageUpdate(
|
|
@@ -1746,20 +1682,18 @@ export class ChatApi {
|
|
|
1746
1682
|
user: request?.user,
|
|
1747
1683
|
};
|
|
1748
1684
|
|
|
1749
|
-
const response =
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
'application/json',
|
|
1758
|
-
);
|
|
1685
|
+
const response =
|
|
1686
|
+
await this.apiClient.sendRequest<UpdateMessagePartialResponse>(
|
|
1687
|
+
'PATCH',
|
|
1688
|
+
'/api/v2/chat/messages/{id}/ephemeral',
|
|
1689
|
+
pathParams,
|
|
1690
|
+
undefined,
|
|
1691
|
+
body,
|
|
1692
|
+
);
|
|
1759
1693
|
|
|
1760
|
-
decoders['UpdateMessagePartialResponse']?.(response
|
|
1694
|
+
decoders['UpdateMessagePartialResponse']?.(response);
|
|
1761
1695
|
|
|
1762
|
-
return
|
|
1696
|
+
return response;
|
|
1763
1697
|
}
|
|
1764
1698
|
|
|
1765
1699
|
async sendReaction(
|
|
@@ -1774,20 +1708,17 @@ export class ChatApi {
|
|
|
1774
1708
|
skip_push: request?.skip_push,
|
|
1775
1709
|
};
|
|
1776
1710
|
|
|
1777
|
-
const response = await this.apiClient.sendRequest<
|
|
1778
|
-
StreamResponse<SendReactionResponse>
|
|
1779
|
-
>(
|
|
1711
|
+
const response = await this.apiClient.sendRequest<SendReactionResponse>(
|
|
1780
1712
|
'POST',
|
|
1781
1713
|
'/api/v2/chat/messages/{id}/reaction',
|
|
1782
1714
|
pathParams,
|
|
1783
1715
|
undefined,
|
|
1784
1716
|
body,
|
|
1785
|
-
'application/json',
|
|
1786
1717
|
);
|
|
1787
1718
|
|
|
1788
|
-
decoders['SendReactionResponse']?.(response
|
|
1719
|
+
decoders['SendReactionResponse']?.(response);
|
|
1789
1720
|
|
|
1790
|
-
return
|
|
1721
|
+
return response;
|
|
1791
1722
|
}
|
|
1792
1723
|
|
|
1793
1724
|
async deleteReaction(request: {
|
|
@@ -1803,18 +1734,16 @@ export class ChatApi {
|
|
|
1803
1734
|
type: request?.type,
|
|
1804
1735
|
};
|
|
1805
1736
|
|
|
1806
|
-
const response = await this.apiClient.sendRequest<
|
|
1807
|
-
StreamResponse<DeleteReactionResponse>
|
|
1808
|
-
>(
|
|
1737
|
+
const response = await this.apiClient.sendRequest<DeleteReactionResponse>(
|
|
1809
1738
|
'DELETE',
|
|
1810
1739
|
'/api/v2/chat/messages/{id}/reaction/{type}',
|
|
1811
1740
|
pathParams,
|
|
1812
1741
|
queryParams,
|
|
1813
1742
|
);
|
|
1814
1743
|
|
|
1815
|
-
decoders['DeleteReactionResponse']?.(response
|
|
1744
|
+
decoders['DeleteReactionResponse']?.(response);
|
|
1816
1745
|
|
|
1817
|
-
return
|
|
1746
|
+
return response;
|
|
1818
1747
|
}
|
|
1819
1748
|
|
|
1820
1749
|
async getReactions(request: {
|
|
@@ -1830,13 +1759,16 @@ export class ChatApi {
|
|
|
1830
1759
|
id: request?.id,
|
|
1831
1760
|
};
|
|
1832
1761
|
|
|
1833
|
-
const response = await this.apiClient.sendRequest<
|
|
1834
|
-
|
|
1835
|
-
|
|
1762
|
+
const response = await this.apiClient.sendRequest<GetReactionsResponse>(
|
|
1763
|
+
'GET',
|
|
1764
|
+
'/api/v2/chat/messages/{id}/reactions',
|
|
1765
|
+
pathParams,
|
|
1766
|
+
queryParams,
|
|
1767
|
+
);
|
|
1836
1768
|
|
|
1837
|
-
decoders['GetReactionsResponse']?.(response
|
|
1769
|
+
decoders['GetReactionsResponse']?.(response);
|
|
1838
1770
|
|
|
1839
|
-
return
|
|
1771
|
+
return response;
|
|
1840
1772
|
}
|
|
1841
1773
|
|
|
1842
1774
|
async queryReactions(
|
|
@@ -1855,20 +1787,17 @@ export class ChatApi {
|
|
|
1855
1787
|
user: request?.user,
|
|
1856
1788
|
};
|
|
1857
1789
|
|
|
1858
|
-
const response = await this.apiClient.sendRequest<
|
|
1859
|
-
StreamResponse<QueryReactionsResponse>
|
|
1860
|
-
>(
|
|
1790
|
+
const response = await this.apiClient.sendRequest<QueryReactionsResponse>(
|
|
1861
1791
|
'POST',
|
|
1862
1792
|
'/api/v2/chat/messages/{id}/reactions',
|
|
1863
1793
|
pathParams,
|
|
1864
1794
|
undefined,
|
|
1865
1795
|
body,
|
|
1866
|
-
'application/json',
|
|
1867
1796
|
);
|
|
1868
1797
|
|
|
1869
|
-
decoders['QueryReactionsResponse']?.(response
|
|
1798
|
+
decoders['QueryReactionsResponse']?.(response);
|
|
1870
1799
|
|
|
1871
|
-
return
|
|
1800
|
+
return response;
|
|
1872
1801
|
}
|
|
1873
1802
|
|
|
1874
1803
|
async translateMessage(
|
|
@@ -1881,20 +1810,17 @@ export class ChatApi {
|
|
|
1881
1810
|
language: request?.language,
|
|
1882
1811
|
};
|
|
1883
1812
|
|
|
1884
|
-
const response = await this.apiClient.sendRequest<
|
|
1885
|
-
StreamResponse<TranslateMessageResponse>
|
|
1886
|
-
>(
|
|
1813
|
+
const response = await this.apiClient.sendRequest<TranslateMessageResponse>(
|
|
1887
1814
|
'POST',
|
|
1888
1815
|
'/api/v2/chat/messages/{id}/translate',
|
|
1889
1816
|
pathParams,
|
|
1890
1817
|
undefined,
|
|
1891
1818
|
body,
|
|
1892
|
-
'application/json',
|
|
1893
1819
|
);
|
|
1894
1820
|
|
|
1895
|
-
decoders['TranslateMessageResponse']?.(response
|
|
1821
|
+
decoders['TranslateMessageResponse']?.(response);
|
|
1896
1822
|
|
|
1897
|
-
return
|
|
1823
|
+
return response;
|
|
1898
1824
|
}
|
|
1899
1825
|
|
|
1900
1826
|
async undeleteMessage(
|
|
@@ -1907,20 +1833,17 @@ export class ChatApi {
|
|
|
1907
1833
|
undeleted_by: request?.undeleted_by,
|
|
1908
1834
|
};
|
|
1909
1835
|
|
|
1910
|
-
const response = await this.apiClient.sendRequest<
|
|
1911
|
-
StreamResponse<UndeleteMessageResponse>
|
|
1912
|
-
>(
|
|
1836
|
+
const response = await this.apiClient.sendRequest<UndeleteMessageResponse>(
|
|
1913
1837
|
'POST',
|
|
1914
1838
|
'/api/v2/chat/messages/{id}/undelete',
|
|
1915
1839
|
pathParams,
|
|
1916
1840
|
undefined,
|
|
1917
1841
|
body,
|
|
1918
|
-
'application/json',
|
|
1919
1842
|
);
|
|
1920
1843
|
|
|
1921
|
-
decoders['UndeleteMessageResponse']?.(response
|
|
1844
|
+
decoders['UndeleteMessageResponse']?.(response);
|
|
1922
1845
|
|
|
1923
|
-
return
|
|
1846
|
+
return response;
|
|
1924
1847
|
}
|
|
1925
1848
|
|
|
1926
1849
|
async castPollVote(
|
|
@@ -1936,20 +1859,17 @@ export class ChatApi {
|
|
|
1936
1859
|
vote: request?.vote,
|
|
1937
1860
|
};
|
|
1938
1861
|
|
|
1939
|
-
const response = await this.apiClient.sendRequest<
|
|
1940
|
-
StreamResponse<PollVoteResponse>
|
|
1941
|
-
>(
|
|
1862
|
+
const response = await this.apiClient.sendRequest<PollVoteResponse>(
|
|
1942
1863
|
'POST',
|
|
1943
1864
|
'/api/v2/chat/messages/{message_id}/polls/{poll_id}/vote',
|
|
1944
1865
|
pathParams,
|
|
1945
1866
|
undefined,
|
|
1946
1867
|
body,
|
|
1947
|
-
'application/json',
|
|
1948
1868
|
);
|
|
1949
1869
|
|
|
1950
|
-
decoders['PollVoteResponse']?.(response
|
|
1870
|
+
decoders['PollVoteResponse']?.(response);
|
|
1951
1871
|
|
|
1952
|
-
return
|
|
1872
|
+
return response;
|
|
1953
1873
|
}
|
|
1954
1874
|
|
|
1955
1875
|
async deletePollVote(request: {
|
|
@@ -1967,18 +1887,16 @@ export class ChatApi {
|
|
|
1967
1887
|
vote_id: request?.vote_id,
|
|
1968
1888
|
};
|
|
1969
1889
|
|
|
1970
|
-
const response = await this.apiClient.sendRequest<
|
|
1971
|
-
StreamResponse<PollVoteResponse>
|
|
1972
|
-
>(
|
|
1890
|
+
const response = await this.apiClient.sendRequest<PollVoteResponse>(
|
|
1973
1891
|
'DELETE',
|
|
1974
1892
|
'/api/v2/chat/messages/{message_id}/polls/{poll_id}/vote/{vote_id}',
|
|
1975
1893
|
pathParams,
|
|
1976
1894
|
queryParams,
|
|
1977
1895
|
);
|
|
1978
1896
|
|
|
1979
|
-
decoders['PollVoteResponse']?.(response
|
|
1897
|
+
decoders['PollVoteResponse']?.(response);
|
|
1980
1898
|
|
|
1981
|
-
return
|
|
1899
|
+
return response;
|
|
1982
1900
|
}
|
|
1983
1901
|
|
|
1984
1902
|
async deleteReminder(request: {
|
|
@@ -1992,18 +1910,16 @@ export class ChatApi {
|
|
|
1992
1910
|
message_id: request?.message_id,
|
|
1993
1911
|
};
|
|
1994
1912
|
|
|
1995
|
-
const response = await this.apiClient.sendRequest<
|
|
1996
|
-
StreamResponse<DeleteReminderResponse>
|
|
1997
|
-
>(
|
|
1913
|
+
const response = await this.apiClient.sendRequest<DeleteReminderResponse>(
|
|
1998
1914
|
'DELETE',
|
|
1999
1915
|
'/api/v2/chat/messages/{message_id}/reminders',
|
|
2000
1916
|
pathParams,
|
|
2001
1917
|
queryParams,
|
|
2002
1918
|
);
|
|
2003
1919
|
|
|
2004
|
-
decoders['DeleteReminderResponse']?.(response
|
|
1920
|
+
decoders['DeleteReminderResponse']?.(response);
|
|
2005
1921
|
|
|
2006
|
-
return
|
|
1922
|
+
return response;
|
|
2007
1923
|
}
|
|
2008
1924
|
|
|
2009
1925
|
async updateReminder(
|
|
@@ -2013,25 +1929,23 @@ export class ChatApi {
|
|
|
2013
1929
|
message_id: request?.message_id,
|
|
2014
1930
|
};
|
|
2015
1931
|
const body = {
|
|
1932
|
+
expires_at: request?.expires_at,
|
|
2016
1933
|
remind_at: request?.remind_at,
|
|
2017
1934
|
user_id: request?.user_id,
|
|
2018
1935
|
user: request?.user,
|
|
2019
1936
|
};
|
|
2020
1937
|
|
|
2021
|
-
const response = await this.apiClient.sendRequest<
|
|
2022
|
-
StreamResponse<UpdateReminderResponse>
|
|
2023
|
-
>(
|
|
1938
|
+
const response = await this.apiClient.sendRequest<UpdateReminderResponse>(
|
|
2024
1939
|
'PATCH',
|
|
2025
1940
|
'/api/v2/chat/messages/{message_id}/reminders',
|
|
2026
1941
|
pathParams,
|
|
2027
1942
|
undefined,
|
|
2028
1943
|
body,
|
|
2029
|
-
'application/json',
|
|
2030
1944
|
);
|
|
2031
1945
|
|
|
2032
|
-
decoders['UpdateReminderResponse']?.(response
|
|
1946
|
+
decoders['UpdateReminderResponse']?.(response);
|
|
2033
1947
|
|
|
2034
|
-
return
|
|
1948
|
+
return response;
|
|
2035
1949
|
}
|
|
2036
1950
|
|
|
2037
1951
|
async createReminder(
|
|
@@ -2041,25 +1955,23 @@ export class ChatApi {
|
|
|
2041
1955
|
message_id: request?.message_id,
|
|
2042
1956
|
};
|
|
2043
1957
|
const body = {
|
|
1958
|
+
expires_at: request?.expires_at,
|
|
2044
1959
|
remind_at: request?.remind_at,
|
|
2045
1960
|
user_id: request?.user_id,
|
|
2046
1961
|
user: request?.user,
|
|
2047
1962
|
};
|
|
2048
1963
|
|
|
2049
|
-
const response = await this.apiClient.sendRequest<
|
|
2050
|
-
StreamResponse<CreateReminderResponse>
|
|
2051
|
-
>(
|
|
1964
|
+
const response = await this.apiClient.sendRequest<CreateReminderResponse>(
|
|
2052
1965
|
'POST',
|
|
2053
1966
|
'/api/v2/chat/messages/{message_id}/reminders',
|
|
2054
1967
|
pathParams,
|
|
2055
1968
|
undefined,
|
|
2056
1969
|
body,
|
|
2057
|
-
'application/json',
|
|
2058
1970
|
);
|
|
2059
1971
|
|
|
2060
|
-
decoders['CreateReminderResponse']?.(response
|
|
1972
|
+
decoders['CreateReminderResponse']?.(response);
|
|
2061
1973
|
|
|
2062
|
-
return
|
|
1974
|
+
return response;
|
|
2063
1975
|
}
|
|
2064
1976
|
|
|
2065
1977
|
async getReplies(request: {
|
|
@@ -2087,18 +1999,16 @@ export class ChatApi {
|
|
|
2087
1999
|
parent_id: request?.parent_id,
|
|
2088
2000
|
};
|
|
2089
2001
|
|
|
2090
|
-
const response = await this.apiClient.sendRequest<
|
|
2091
|
-
StreamResponse<GetRepliesResponse>
|
|
2092
|
-
>(
|
|
2002
|
+
const response = await this.apiClient.sendRequest<GetRepliesResponse>(
|
|
2093
2003
|
'GET',
|
|
2094
2004
|
'/api/v2/chat/messages/{parent_id}/replies',
|
|
2095
2005
|
pathParams,
|
|
2096
2006
|
queryParams,
|
|
2097
2007
|
);
|
|
2098
2008
|
|
|
2099
|
-
decoders['GetRepliesResponse']?.(response
|
|
2009
|
+
decoders['GetRepliesResponse']?.(response);
|
|
2100
2010
|
|
|
2101
|
-
return
|
|
2011
|
+
return response;
|
|
2102
2012
|
}
|
|
2103
2013
|
|
|
2104
2014
|
async queryMessageFlags(request?: {
|
|
@@ -2108,13 +2018,17 @@ export class ChatApi {
|
|
|
2108
2018
|
payload: request?.payload,
|
|
2109
2019
|
};
|
|
2110
2020
|
|
|
2111
|
-
const response =
|
|
2112
|
-
|
|
2113
|
-
|
|
2021
|
+
const response =
|
|
2022
|
+
await this.apiClient.sendRequest<QueryMessageFlagsResponse>(
|
|
2023
|
+
'GET',
|
|
2024
|
+
'/api/v2/chat/moderation/flags/message',
|
|
2025
|
+
undefined,
|
|
2026
|
+
queryParams,
|
|
2027
|
+
);
|
|
2114
2028
|
|
|
2115
|
-
decoders['QueryMessageFlagsResponse']?.(response
|
|
2029
|
+
decoders['QueryMessageFlagsResponse']?.(response);
|
|
2116
2030
|
|
|
2117
|
-
return
|
|
2031
|
+
return response;
|
|
2118
2032
|
}
|
|
2119
2033
|
|
|
2120
2034
|
async muteChannel(
|
|
@@ -2127,20 +2041,17 @@ export class ChatApi {
|
|
|
2127
2041
|
user: request?.user,
|
|
2128
2042
|
};
|
|
2129
2043
|
|
|
2130
|
-
const response = await this.apiClient.sendRequest<
|
|
2131
|
-
StreamResponse<MuteChannelResponse>
|
|
2132
|
-
>(
|
|
2044
|
+
const response = await this.apiClient.sendRequest<MuteChannelResponse>(
|
|
2133
2045
|
'POST',
|
|
2134
2046
|
'/api/v2/chat/moderation/mute/channel',
|
|
2135
2047
|
undefined,
|
|
2136
2048
|
undefined,
|
|
2137
2049
|
body,
|
|
2138
|
-
'application/json',
|
|
2139
2050
|
);
|
|
2140
2051
|
|
|
2141
|
-
decoders['MuteChannelResponse']?.(response
|
|
2052
|
+
decoders['MuteChannelResponse']?.(response);
|
|
2142
2053
|
|
|
2143
|
-
return
|
|
2054
|
+
return response;
|
|
2144
2055
|
}
|
|
2145
2056
|
|
|
2146
2057
|
async unmuteChannel(
|
|
@@ -2153,20 +2064,17 @@ export class ChatApi {
|
|
|
2153
2064
|
user: request?.user,
|
|
2154
2065
|
};
|
|
2155
2066
|
|
|
2156
|
-
const response = await this.apiClient.sendRequest<
|
|
2157
|
-
StreamResponse<UnmuteResponse>
|
|
2158
|
-
>(
|
|
2067
|
+
const response = await this.apiClient.sendRequest<UnmuteResponse>(
|
|
2159
2068
|
'POST',
|
|
2160
2069
|
'/api/v2/chat/moderation/unmute/channel',
|
|
2161
2070
|
undefined,
|
|
2162
2071
|
undefined,
|
|
2163
2072
|
body,
|
|
2164
|
-
'application/json',
|
|
2165
2073
|
);
|
|
2166
2074
|
|
|
2167
|
-
decoders['UnmuteResponse']?.(response
|
|
2075
|
+
decoders['UnmuteResponse']?.(response);
|
|
2168
2076
|
|
|
2169
|
-
return
|
|
2077
|
+
return response;
|
|
2170
2078
|
}
|
|
2171
2079
|
|
|
2172
2080
|
async getPredefinedFilters(request?: {
|
|
@@ -2178,13 +2086,17 @@ export class ChatApi {
|
|
|
2178
2086
|
sort: request?.sort,
|
|
2179
2087
|
};
|
|
2180
2088
|
|
|
2181
|
-
const response =
|
|
2182
|
-
|
|
2183
|
-
|
|
2089
|
+
const response =
|
|
2090
|
+
await this.apiClient.sendRequest<QueryPredefinedFiltersResponse>(
|
|
2091
|
+
'GET',
|
|
2092
|
+
'/api/v2/chat/predefined_filters',
|
|
2093
|
+
undefined,
|
|
2094
|
+
queryParams,
|
|
2095
|
+
);
|
|
2184
2096
|
|
|
2185
|
-
decoders['QueryPredefinedFiltersResponse']?.(response
|
|
2097
|
+
decoders['QueryPredefinedFiltersResponse']?.(response);
|
|
2186
2098
|
|
|
2187
|
-
return
|
|
2099
|
+
return response;
|
|
2188
2100
|
}
|
|
2189
2101
|
|
|
2190
2102
|
async createPredefinedFilter(
|
|
@@ -2198,20 +2110,18 @@ export class ChatApi {
|
|
|
2198
2110
|
sort: request?.sort,
|
|
2199
2111
|
};
|
|
2200
2112
|
|
|
2201
|
-
const response =
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
'application/json',
|
|
2210
|
-
);
|
|
2113
|
+
const response =
|
|
2114
|
+
await this.apiClient.sendRequest<CreatePredefinedFilterResponse>(
|
|
2115
|
+
'POST',
|
|
2116
|
+
'/api/v2/chat/predefined_filters',
|
|
2117
|
+
undefined,
|
|
2118
|
+
undefined,
|
|
2119
|
+
body,
|
|
2120
|
+
);
|
|
2211
2121
|
|
|
2212
|
-
decoders['CreatePredefinedFilterResponse']?.(response
|
|
2122
|
+
decoders['CreatePredefinedFilterResponse']?.(response);
|
|
2213
2123
|
|
|
2214
|
-
return
|
|
2124
|
+
return response;
|
|
2215
2125
|
}
|
|
2216
2126
|
|
|
2217
2127
|
async deletePredefinedFilter(request: {
|
|
@@ -2221,16 +2131,16 @@ export class ChatApi {
|
|
|
2221
2131
|
name: request?.name,
|
|
2222
2132
|
};
|
|
2223
2133
|
|
|
2224
|
-
const response = await this.apiClient.sendRequest<
|
|
2134
|
+
const response = await this.apiClient.sendRequest<Response>(
|
|
2225
2135
|
'DELETE',
|
|
2226
2136
|
'/api/v2/chat/predefined_filters/{name}',
|
|
2227
2137
|
pathParams,
|
|
2228
2138
|
undefined,
|
|
2229
2139
|
);
|
|
2230
2140
|
|
|
2231
|
-
decoders['Response']?.(response
|
|
2141
|
+
decoders['Response']?.(response);
|
|
2232
2142
|
|
|
2233
|
-
return
|
|
2143
|
+
return response;
|
|
2234
2144
|
}
|
|
2235
2145
|
|
|
2236
2146
|
async getPredefinedFilter(request: {
|
|
@@ -2240,13 +2150,17 @@ export class ChatApi {
|
|
|
2240
2150
|
name: request?.name,
|
|
2241
2151
|
};
|
|
2242
2152
|
|
|
2243
|
-
const response =
|
|
2244
|
-
|
|
2245
|
-
|
|
2153
|
+
const response =
|
|
2154
|
+
await this.apiClient.sendRequest<GetPredefinedFilterResponse>(
|
|
2155
|
+
'GET',
|
|
2156
|
+
'/api/v2/chat/predefined_filters/{name}',
|
|
2157
|
+
pathParams,
|
|
2158
|
+
undefined,
|
|
2159
|
+
);
|
|
2246
2160
|
|
|
2247
|
-
decoders['GetPredefinedFilterResponse']?.(response
|
|
2161
|
+
decoders['GetPredefinedFilterResponse']?.(response);
|
|
2248
2162
|
|
|
2249
|
-
return
|
|
2163
|
+
return response;
|
|
2250
2164
|
}
|
|
2251
2165
|
|
|
2252
2166
|
async updatePredefinedFilter(
|
|
@@ -2262,20 +2176,18 @@ export class ChatApi {
|
|
|
2262
2176
|
sort: request?.sort,
|
|
2263
2177
|
};
|
|
2264
2178
|
|
|
2265
|
-
const response =
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
'application/json',
|
|
2274
|
-
);
|
|
2179
|
+
const response =
|
|
2180
|
+
await this.apiClient.sendRequest<UpdatePredefinedFilterResponse>(
|
|
2181
|
+
'PUT',
|
|
2182
|
+
'/api/v2/chat/predefined_filters/{name}',
|
|
2183
|
+
pathParams,
|
|
2184
|
+
undefined,
|
|
2185
|
+
body,
|
|
2186
|
+
);
|
|
2275
2187
|
|
|
2276
|
-
decoders['UpdatePredefinedFilterResponse']?.(response
|
|
2188
|
+
decoders['UpdatePredefinedFilterResponse']?.(response);
|
|
2277
2189
|
|
|
2278
|
-
return
|
|
2190
|
+
return response;
|
|
2279
2191
|
}
|
|
2280
2192
|
|
|
2281
2193
|
async queryBannedUsers(request?: {
|
|
@@ -2285,13 +2197,16 @@ export class ChatApi {
|
|
|
2285
2197
|
payload: request?.payload,
|
|
2286
2198
|
};
|
|
2287
2199
|
|
|
2288
|
-
const response = await this.apiClient.sendRequest<
|
|
2289
|
-
|
|
2290
|
-
|
|
2200
|
+
const response = await this.apiClient.sendRequest<QueryBannedUsersResponse>(
|
|
2201
|
+
'GET',
|
|
2202
|
+
'/api/v2/chat/query_banned_users',
|
|
2203
|
+
undefined,
|
|
2204
|
+
queryParams,
|
|
2205
|
+
);
|
|
2291
2206
|
|
|
2292
|
-
decoders['QueryBannedUsersResponse']?.(response
|
|
2207
|
+
decoders['QueryBannedUsersResponse']?.(response);
|
|
2293
2208
|
|
|
2294
|
-
return
|
|
2209
|
+
return response;
|
|
2295
2210
|
}
|
|
2296
2211
|
|
|
2297
2212
|
async queryFutureChannelBans(request?: {
|
|
@@ -2301,13 +2216,17 @@ export class ChatApi {
|
|
|
2301
2216
|
payload: request?.payload,
|
|
2302
2217
|
};
|
|
2303
2218
|
|
|
2304
|
-
const response =
|
|
2305
|
-
|
|
2306
|
-
|
|
2219
|
+
const response =
|
|
2220
|
+
await this.apiClient.sendRequest<QueryFutureChannelBansResponse>(
|
|
2221
|
+
'GET',
|
|
2222
|
+
'/api/v2/chat/query_future_channel_bans',
|
|
2223
|
+
undefined,
|
|
2224
|
+
queryParams,
|
|
2225
|
+
);
|
|
2307
2226
|
|
|
2308
|
-
decoders['QueryFutureChannelBansResponse']?.(response
|
|
2227
|
+
decoders['QueryFutureChannelBansResponse']?.(response);
|
|
2309
2228
|
|
|
2310
|
-
return
|
|
2229
|
+
return response;
|
|
2311
2230
|
}
|
|
2312
2231
|
|
|
2313
2232
|
async queryReminders(
|
|
@@ -2323,32 +2242,33 @@ export class ChatApi {
|
|
|
2323
2242
|
user: request?.user,
|
|
2324
2243
|
};
|
|
2325
2244
|
|
|
2326
|
-
const response = await this.apiClient.sendRequest<
|
|
2327
|
-
StreamResponse<QueryRemindersResponse>
|
|
2328
|
-
>(
|
|
2245
|
+
const response = await this.apiClient.sendRequest<QueryRemindersResponse>(
|
|
2329
2246
|
'POST',
|
|
2330
2247
|
'/api/v2/chat/reminders/query',
|
|
2331
2248
|
undefined,
|
|
2332
2249
|
undefined,
|
|
2333
2250
|
body,
|
|
2334
|
-
'application/json',
|
|
2335
2251
|
);
|
|
2336
2252
|
|
|
2337
|
-
decoders['QueryRemindersResponse']?.(response
|
|
2253
|
+
decoders['QueryRemindersResponse']?.(response);
|
|
2338
2254
|
|
|
2339
|
-
return
|
|
2255
|
+
return response;
|
|
2340
2256
|
}
|
|
2341
2257
|
|
|
2342
2258
|
async getRetentionPolicy(): Promise<
|
|
2343
2259
|
StreamResponse<GetRetentionPolicyResponse>
|
|
2344
2260
|
> {
|
|
2345
|
-
const response =
|
|
2346
|
-
|
|
2347
|
-
|
|
2261
|
+
const response =
|
|
2262
|
+
await this.apiClient.sendRequest<GetRetentionPolicyResponse>(
|
|
2263
|
+
'GET',
|
|
2264
|
+
'/api/v2/chat/retention_policy',
|
|
2265
|
+
undefined,
|
|
2266
|
+
undefined,
|
|
2267
|
+
);
|
|
2348
2268
|
|
|
2349
|
-
decoders['GetRetentionPolicyResponse']?.(response
|
|
2269
|
+
decoders['GetRetentionPolicyResponse']?.(response);
|
|
2350
2270
|
|
|
2351
|
-
return
|
|
2271
|
+
return response;
|
|
2352
2272
|
}
|
|
2353
2273
|
|
|
2354
2274
|
async setRetentionPolicy(
|
|
@@ -2359,20 +2279,18 @@ export class ChatApi {
|
|
|
2359
2279
|
policy: request?.policy,
|
|
2360
2280
|
};
|
|
2361
2281
|
|
|
2362
|
-
const response =
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
'application/json',
|
|
2371
|
-
);
|
|
2282
|
+
const response =
|
|
2283
|
+
await this.apiClient.sendRequest<SetRetentionPolicyResponse>(
|
|
2284
|
+
'POST',
|
|
2285
|
+
'/api/v2/chat/retention_policy',
|
|
2286
|
+
undefined,
|
|
2287
|
+
undefined,
|
|
2288
|
+
body,
|
|
2289
|
+
);
|
|
2372
2290
|
|
|
2373
|
-
decoders['SetRetentionPolicyResponse']?.(response
|
|
2291
|
+
decoders['SetRetentionPolicyResponse']?.(response);
|
|
2374
2292
|
|
|
2375
|
-
return
|
|
2293
|
+
return response;
|
|
2376
2294
|
}
|
|
2377
2295
|
|
|
2378
2296
|
async deleteRetentionPolicy(
|
|
@@ -2382,20 +2300,18 @@ export class ChatApi {
|
|
|
2382
2300
|
policy: request?.policy,
|
|
2383
2301
|
};
|
|
2384
2302
|
|
|
2385
|
-
const response =
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
'application/json',
|
|
2394
|
-
);
|
|
2303
|
+
const response =
|
|
2304
|
+
await this.apiClient.sendRequest<DeleteRetentionPolicyResponse>(
|
|
2305
|
+
'POST',
|
|
2306
|
+
'/api/v2/chat/retention_policy/delete',
|
|
2307
|
+
undefined,
|
|
2308
|
+
undefined,
|
|
2309
|
+
body,
|
|
2310
|
+
);
|
|
2395
2311
|
|
|
2396
|
-
decoders['DeleteRetentionPolicyResponse']?.(response
|
|
2312
|
+
decoders['DeleteRetentionPolicyResponse']?.(response);
|
|
2397
2313
|
|
|
2398
|
-
return
|
|
2314
|
+
return response;
|
|
2399
2315
|
}
|
|
2400
2316
|
|
|
2401
2317
|
async getRetentionPolicyRuns(
|
|
@@ -2409,20 +2325,18 @@ export class ChatApi {
|
|
|
2409
2325
|
filter_conditions: request?.filter_conditions,
|
|
2410
2326
|
};
|
|
2411
2327
|
|
|
2412
|
-
const response =
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
'application/json',
|
|
2421
|
-
);
|
|
2328
|
+
const response =
|
|
2329
|
+
await this.apiClient.sendRequest<GetRetentionPolicyRunsResponse>(
|
|
2330
|
+
'POST',
|
|
2331
|
+
'/api/v2/chat/retention_policy/runs',
|
|
2332
|
+
undefined,
|
|
2333
|
+
undefined,
|
|
2334
|
+
body,
|
|
2335
|
+
);
|
|
2422
2336
|
|
|
2423
|
-
decoders['GetRetentionPolicyRunsResponse']?.(response
|
|
2337
|
+
decoders['GetRetentionPolicyRunsResponse']?.(response);
|
|
2424
2338
|
|
|
2425
|
-
return
|
|
2339
|
+
return response;
|
|
2426
2340
|
}
|
|
2427
2341
|
|
|
2428
2342
|
async search(request?: {
|
|
@@ -2432,13 +2346,16 @@ export class ChatApi {
|
|
|
2432
2346
|
payload: request?.payload,
|
|
2433
2347
|
};
|
|
2434
2348
|
|
|
2435
|
-
const response = await this.apiClient.sendRequest<
|
|
2436
|
-
|
|
2437
|
-
|
|
2349
|
+
const response = await this.apiClient.sendRequest<SearchResponse>(
|
|
2350
|
+
'GET',
|
|
2351
|
+
'/api/v2/chat/search',
|
|
2352
|
+
undefined,
|
|
2353
|
+
queryParams,
|
|
2354
|
+
);
|
|
2438
2355
|
|
|
2439
|
-
decoders['SearchResponse']?.(response
|
|
2356
|
+
decoders['SearchResponse']?.(response);
|
|
2440
2357
|
|
|
2441
|
-
return
|
|
2358
|
+
return response;
|
|
2442
2359
|
}
|
|
2443
2360
|
|
|
2444
2361
|
async createSegment(
|
|
@@ -2454,20 +2371,17 @@ export class ChatApi {
|
|
|
2454
2371
|
filter: request?.filter,
|
|
2455
2372
|
};
|
|
2456
2373
|
|
|
2457
|
-
const response = await this.apiClient.sendRequest<
|
|
2458
|
-
StreamResponse<CreateSegmentResponse>
|
|
2459
|
-
>(
|
|
2374
|
+
const response = await this.apiClient.sendRequest<CreateSegmentResponse>(
|
|
2460
2375
|
'POST',
|
|
2461
2376
|
'/api/v2/chat/segments',
|
|
2462
2377
|
undefined,
|
|
2463
2378
|
undefined,
|
|
2464
2379
|
body,
|
|
2465
|
-
'application/json',
|
|
2466
2380
|
);
|
|
2467
2381
|
|
|
2468
|
-
decoders['CreateSegmentResponse']?.(response
|
|
2382
|
+
decoders['CreateSegmentResponse']?.(response);
|
|
2469
2383
|
|
|
2470
|
-
return
|
|
2384
|
+
return response;
|
|
2471
2385
|
}
|
|
2472
2386
|
|
|
2473
2387
|
async querySegments(
|
|
@@ -2481,20 +2395,17 @@ export class ChatApi {
|
|
|
2481
2395
|
sort: request?.sort,
|
|
2482
2396
|
};
|
|
2483
2397
|
|
|
2484
|
-
const response = await this.apiClient.sendRequest<
|
|
2485
|
-
StreamResponse<QuerySegmentsResponse>
|
|
2486
|
-
>(
|
|
2398
|
+
const response = await this.apiClient.sendRequest<QuerySegmentsResponse>(
|
|
2487
2399
|
'POST',
|
|
2488
2400
|
'/api/v2/chat/segments/query',
|
|
2489
2401
|
undefined,
|
|
2490
2402
|
undefined,
|
|
2491
2403
|
body,
|
|
2492
|
-
'application/json',
|
|
2493
2404
|
);
|
|
2494
2405
|
|
|
2495
|
-
decoders['QuerySegmentsResponse']?.(response
|
|
2406
|
+
decoders['QuerySegmentsResponse']?.(response);
|
|
2496
2407
|
|
|
2497
|
-
return
|
|
2408
|
+
return response;
|
|
2498
2409
|
}
|
|
2499
2410
|
|
|
2500
2411
|
async deleteSegment(request: {
|
|
@@ -2504,16 +2415,16 @@ export class ChatApi {
|
|
|
2504
2415
|
id: request?.id,
|
|
2505
2416
|
};
|
|
2506
2417
|
|
|
2507
|
-
const response = await this.apiClient.sendRequest<
|
|
2418
|
+
const response = await this.apiClient.sendRequest<Response>(
|
|
2508
2419
|
'DELETE',
|
|
2509
2420
|
'/api/v2/chat/segments/{id}',
|
|
2510
2421
|
pathParams,
|
|
2511
2422
|
undefined,
|
|
2512
2423
|
);
|
|
2513
2424
|
|
|
2514
|
-
decoders['Response']?.(response
|
|
2425
|
+
decoders['Response']?.(response);
|
|
2515
2426
|
|
|
2516
|
-
return
|
|
2427
|
+
return response;
|
|
2517
2428
|
}
|
|
2518
2429
|
|
|
2519
2430
|
async getSegment(request: {
|
|
@@ -2523,13 +2434,16 @@ export class ChatApi {
|
|
|
2523
2434
|
id: request?.id,
|
|
2524
2435
|
};
|
|
2525
2436
|
|
|
2526
|
-
const response = await this.apiClient.sendRequest<
|
|
2527
|
-
|
|
2528
|
-
|
|
2437
|
+
const response = await this.apiClient.sendRequest<GetSegmentResponse>(
|
|
2438
|
+
'GET',
|
|
2439
|
+
'/api/v2/chat/segments/{id}',
|
|
2440
|
+
pathParams,
|
|
2441
|
+
undefined,
|
|
2442
|
+
);
|
|
2529
2443
|
|
|
2530
|
-
decoders['GetSegmentResponse']?.(response
|
|
2444
|
+
decoders['GetSegmentResponse']?.(response);
|
|
2531
2445
|
|
|
2532
|
-
return
|
|
2446
|
+
return response;
|
|
2533
2447
|
}
|
|
2534
2448
|
|
|
2535
2449
|
async updateSegment(
|
|
@@ -2544,20 +2458,17 @@ export class ChatApi {
|
|
|
2544
2458
|
filter: request?.filter,
|
|
2545
2459
|
};
|
|
2546
2460
|
|
|
2547
|
-
const response = await this.apiClient.sendRequest<
|
|
2548
|
-
StreamResponse<UpdateSegmentResponse>
|
|
2549
|
-
>(
|
|
2461
|
+
const response = await this.apiClient.sendRequest<UpdateSegmentResponse>(
|
|
2550
2462
|
'PUT',
|
|
2551
2463
|
'/api/v2/chat/segments/{id}',
|
|
2552
2464
|
pathParams,
|
|
2553
2465
|
undefined,
|
|
2554
2466
|
body,
|
|
2555
|
-
'application/json',
|
|
2556
2467
|
);
|
|
2557
2468
|
|
|
2558
|
-
decoders['UpdateSegmentResponse']?.(response
|
|
2469
|
+
decoders['UpdateSegmentResponse']?.(response);
|
|
2559
2470
|
|
|
2560
|
-
return
|
|
2471
|
+
return response;
|
|
2561
2472
|
}
|
|
2562
2473
|
|
|
2563
2474
|
async addSegmentTargets(
|
|
@@ -2570,18 +2481,17 @@ export class ChatApi {
|
|
|
2570
2481
|
target_ids: request?.target_ids,
|
|
2571
2482
|
};
|
|
2572
2483
|
|
|
2573
|
-
const response = await this.apiClient.sendRequest<
|
|
2484
|
+
const response = await this.apiClient.sendRequest<Response>(
|
|
2574
2485
|
'POST',
|
|
2575
2486
|
'/api/v2/chat/segments/{id}/addtargets',
|
|
2576
2487
|
pathParams,
|
|
2577
2488
|
undefined,
|
|
2578
2489
|
body,
|
|
2579
|
-
'application/json',
|
|
2580
2490
|
);
|
|
2581
2491
|
|
|
2582
|
-
decoders['Response']?.(response
|
|
2492
|
+
decoders['Response']?.(response);
|
|
2583
2493
|
|
|
2584
|
-
return
|
|
2494
|
+
return response;
|
|
2585
2495
|
}
|
|
2586
2496
|
|
|
2587
2497
|
async deleteSegmentTargets(
|
|
@@ -2594,18 +2504,17 @@ export class ChatApi {
|
|
|
2594
2504
|
target_ids: request?.target_ids,
|
|
2595
2505
|
};
|
|
2596
2506
|
|
|
2597
|
-
const response = await this.apiClient.sendRequest<
|
|
2507
|
+
const response = await this.apiClient.sendRequest<Response>(
|
|
2598
2508
|
'POST',
|
|
2599
2509
|
'/api/v2/chat/segments/{id}/deletetargets',
|
|
2600
2510
|
pathParams,
|
|
2601
2511
|
undefined,
|
|
2602
2512
|
body,
|
|
2603
|
-
'application/json',
|
|
2604
2513
|
);
|
|
2605
2514
|
|
|
2606
|
-
decoders['Response']?.(response
|
|
2515
|
+
decoders['Response']?.(response);
|
|
2607
2516
|
|
|
2608
|
-
return
|
|
2517
|
+
return response;
|
|
2609
2518
|
}
|
|
2610
2519
|
|
|
2611
2520
|
async segmentTargetExists(request: {
|
|
@@ -2617,16 +2526,16 @@ export class ChatApi {
|
|
|
2617
2526
|
target_id: request?.target_id,
|
|
2618
2527
|
};
|
|
2619
2528
|
|
|
2620
|
-
const response = await this.apiClient.sendRequest<
|
|
2529
|
+
const response = await this.apiClient.sendRequest<Response>(
|
|
2621
2530
|
'GET',
|
|
2622
2531
|
'/api/v2/chat/segments/{id}/target/{target_id}',
|
|
2623
2532
|
pathParams,
|
|
2624
2533
|
undefined,
|
|
2625
2534
|
);
|
|
2626
2535
|
|
|
2627
|
-
decoders['Response']?.(response
|
|
2536
|
+
decoders['Response']?.(response);
|
|
2628
2537
|
|
|
2629
|
-
return
|
|
2538
|
+
return response;
|
|
2630
2539
|
}
|
|
2631
2540
|
|
|
2632
2541
|
async querySegmentTargets(
|
|
@@ -2643,20 +2552,18 @@ export class ChatApi {
|
|
|
2643
2552
|
filter: request?.filter,
|
|
2644
2553
|
};
|
|
2645
2554
|
|
|
2646
|
-
const response =
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
'application/json',
|
|
2655
|
-
);
|
|
2555
|
+
const response =
|
|
2556
|
+
await this.apiClient.sendRequest<QuerySegmentTargetsResponse>(
|
|
2557
|
+
'POST',
|
|
2558
|
+
'/api/v2/chat/segments/{id}/targets/query',
|
|
2559
|
+
pathParams,
|
|
2560
|
+
undefined,
|
|
2561
|
+
body,
|
|
2562
|
+
);
|
|
2656
2563
|
|
|
2657
|
-
decoders['QuerySegmentTargetsResponse']?.(response
|
|
2564
|
+
decoders['QuerySegmentTargetsResponse']?.(response);
|
|
2658
2565
|
|
|
2659
|
-
return
|
|
2566
|
+
return response;
|
|
2660
2567
|
}
|
|
2661
2568
|
|
|
2662
2569
|
async queryTeamUsageStats(
|
|
@@ -2671,20 +2578,18 @@ export class ChatApi {
|
|
|
2671
2578
|
team: request?.team,
|
|
2672
2579
|
};
|
|
2673
2580
|
|
|
2674
|
-
const response =
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
'application/json',
|
|
2683
|
-
);
|
|
2581
|
+
const response =
|
|
2582
|
+
await this.apiClient.sendRequest<QueryTeamUsageStatsResponse>(
|
|
2583
|
+
'POST',
|
|
2584
|
+
'/api/v2/chat/stats/team_usage',
|
|
2585
|
+
undefined,
|
|
2586
|
+
undefined,
|
|
2587
|
+
body,
|
|
2588
|
+
);
|
|
2684
2589
|
|
|
2685
|
-
decoders['QueryTeamUsageStatsResponse']?.(response
|
|
2590
|
+
decoders['QueryTeamUsageStatsResponse']?.(response);
|
|
2686
2591
|
|
|
2687
|
-
return
|
|
2592
|
+
return response;
|
|
2688
2593
|
}
|
|
2689
2594
|
|
|
2690
2595
|
async queryThreads(
|
|
@@ -2703,20 +2608,17 @@ export class ChatApi {
|
|
|
2703
2608
|
user: request?.user,
|
|
2704
2609
|
};
|
|
2705
2610
|
|
|
2706
|
-
const response = await this.apiClient.sendRequest<
|
|
2707
|
-
StreamResponse<QueryThreadsResponse>
|
|
2708
|
-
>(
|
|
2611
|
+
const response = await this.apiClient.sendRequest<QueryThreadsResponse>(
|
|
2709
2612
|
'POST',
|
|
2710
2613
|
'/api/v2/chat/threads',
|
|
2711
2614
|
undefined,
|
|
2712
2615
|
undefined,
|
|
2713
2616
|
body,
|
|
2714
|
-
'application/json',
|
|
2715
2617
|
);
|
|
2716
2618
|
|
|
2717
|
-
decoders['QueryThreadsResponse']?.(response
|
|
2619
|
+
decoders['QueryThreadsResponse']?.(response);
|
|
2718
2620
|
|
|
2719
|
-
return
|
|
2621
|
+
return response;
|
|
2720
2622
|
}
|
|
2721
2623
|
|
|
2722
2624
|
async getThread(request: {
|
|
@@ -2734,13 +2636,16 @@ export class ChatApi {
|
|
|
2734
2636
|
message_id: request?.message_id,
|
|
2735
2637
|
};
|
|
2736
2638
|
|
|
2737
|
-
const response = await this.apiClient.sendRequest<
|
|
2738
|
-
|
|
2739
|
-
|
|
2639
|
+
const response = await this.apiClient.sendRequest<GetThreadResponse>(
|
|
2640
|
+
'GET',
|
|
2641
|
+
'/api/v2/chat/threads/{message_id}',
|
|
2642
|
+
pathParams,
|
|
2643
|
+
queryParams,
|
|
2644
|
+
);
|
|
2740
2645
|
|
|
2741
|
-
decoders['GetThreadResponse']?.(response
|
|
2646
|
+
decoders['GetThreadResponse']?.(response);
|
|
2742
2647
|
|
|
2743
|
-
return
|
|
2648
|
+
return response;
|
|
2744
2649
|
}
|
|
2745
2650
|
|
|
2746
2651
|
async updateThreadPartial(
|
|
@@ -2756,20 +2661,18 @@ export class ChatApi {
|
|
|
2756
2661
|
user: request?.user,
|
|
2757
2662
|
};
|
|
2758
2663
|
|
|
2759
|
-
const response =
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
'application/json',
|
|
2768
|
-
);
|
|
2664
|
+
const response =
|
|
2665
|
+
await this.apiClient.sendRequest<UpdateThreadPartialResponse>(
|
|
2666
|
+
'PATCH',
|
|
2667
|
+
'/api/v2/chat/threads/{message_id}',
|
|
2668
|
+
pathParams,
|
|
2669
|
+
undefined,
|
|
2670
|
+
body,
|
|
2671
|
+
);
|
|
2769
2672
|
|
|
2770
|
-
decoders['UpdateThreadPartialResponse']?.(response
|
|
2673
|
+
decoders['UpdateThreadPartialResponse']?.(response);
|
|
2771
2674
|
|
|
2772
|
-
return
|
|
2675
|
+
return response;
|
|
2773
2676
|
}
|
|
2774
2677
|
|
|
2775
2678
|
async unreadCounts(request?: {
|
|
@@ -2779,13 +2682,17 @@ export class ChatApi {
|
|
|
2779
2682
|
user_id: request?.user_id,
|
|
2780
2683
|
};
|
|
2781
2684
|
|
|
2782
|
-
const response =
|
|
2783
|
-
|
|
2784
|
-
|
|
2685
|
+
const response =
|
|
2686
|
+
await this.apiClient.sendRequest<WrappedUnreadCountsResponse>(
|
|
2687
|
+
'GET',
|
|
2688
|
+
'/api/v2/chat/unread',
|
|
2689
|
+
undefined,
|
|
2690
|
+
queryParams,
|
|
2691
|
+
);
|
|
2785
2692
|
|
|
2786
|
-
decoders['WrappedUnreadCountsResponse']?.(response
|
|
2693
|
+
decoders['WrappedUnreadCountsResponse']?.(response);
|
|
2787
2694
|
|
|
2788
|
-
return
|
|
2695
|
+
return response;
|
|
2789
2696
|
}
|
|
2790
2697
|
|
|
2791
2698
|
async unreadCountsBatch(
|
|
@@ -2795,20 +2702,18 @@ export class ChatApi {
|
|
|
2795
2702
|
user_ids: request?.user_ids,
|
|
2796
2703
|
};
|
|
2797
2704
|
|
|
2798
|
-
const response =
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
'application/json',
|
|
2807
|
-
);
|
|
2705
|
+
const response =
|
|
2706
|
+
await this.apiClient.sendRequest<UnreadCountsBatchResponse>(
|
|
2707
|
+
'POST',
|
|
2708
|
+
'/api/v2/chat/unread_batch',
|
|
2709
|
+
undefined,
|
|
2710
|
+
undefined,
|
|
2711
|
+
body,
|
|
2712
|
+
);
|
|
2808
2713
|
|
|
2809
|
-
decoders['UnreadCountsBatchResponse']?.(response
|
|
2714
|
+
decoders['UnreadCountsBatchResponse']?.(response);
|
|
2810
2715
|
|
|
2811
|
-
return
|
|
2716
|
+
return response;
|
|
2812
2717
|
}
|
|
2813
2718
|
|
|
2814
2719
|
async sendUserCustomEvent(
|
|
@@ -2821,17 +2726,16 @@ export class ChatApi {
|
|
|
2821
2726
|
event: request?.event,
|
|
2822
2727
|
};
|
|
2823
2728
|
|
|
2824
|
-
const response = await this.apiClient.sendRequest<
|
|
2729
|
+
const response = await this.apiClient.sendRequest<Response>(
|
|
2825
2730
|
'POST',
|
|
2826
2731
|
'/api/v2/chat/users/{user_id}/event',
|
|
2827
2732
|
pathParams,
|
|
2828
2733
|
undefined,
|
|
2829
2734
|
body,
|
|
2830
|
-
'application/json',
|
|
2831
2735
|
);
|
|
2832
2736
|
|
|
2833
|
-
decoders['Response']?.(response
|
|
2737
|
+
decoders['Response']?.(response);
|
|
2834
2738
|
|
|
2835
|
-
return
|
|
2739
|
+
return response;
|
|
2836
2740
|
}
|
|
2837
2741
|
}
|