@stream-io/node-sdk 0.8.0 → 0.8.1

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.
@@ -14,6 +14,8 @@ import {
14
14
  CreateChannelTypeResponse,
15
15
  CreateCommandRequest,
16
16
  CreateCommandResponse,
17
+ CreatePredefinedFilterRequest,
18
+ CreatePredefinedFilterResponse,
17
19
  CreateReminderRequest,
18
20
  CreateSegmentRequest,
19
21
  CreateSegmentResponse,
@@ -37,6 +39,8 @@ import {
37
39
  GetDraftResponse,
38
40
  GetManyMessagesResponse,
39
41
  GetMessageResponse,
42
+ GetPinnedMessagesResponse,
43
+ GetPredefinedFilterResponse,
40
44
  GetReactionsResponse,
41
45
  GetRepliesResponse,
42
46
  GetRetentionPolicyResponse,
@@ -77,6 +81,7 @@ import {
77
81
  QueryMessageFlagsResponse,
78
82
  QueryMessageHistoryRequest,
79
83
  QueryMessageHistoryResponse,
84
+ QueryPredefinedFiltersResponse,
80
85
  QueryReactionsRequest,
81
86
  QueryReactionsResponse,
82
87
  QueryRemindersRequest,
@@ -131,6 +136,8 @@ import {
131
136
  UpdateMessagePartialResponse,
132
137
  UpdateMessageRequest,
133
138
  UpdateMessageResponse,
139
+ UpdatePredefinedFilterRequest,
140
+ UpdatePredefinedFilterResponse,
134
141
  UpdateReminderRequest,
135
142
  UpdateReminderResponse,
136
143
  UpdateSegmentRequest,
@@ -179,7 +186,7 @@ export class ChatApi {
179
186
  'application/json',
180
187
  );
181
188
 
182
- decoders.CreateCampaignResponse?.(response.body);
189
+ decoders['CreateCampaignResponse']?.(response.body);
183
190
 
184
191
  return { ...response.body, metadata: response.metadata };
185
192
  }
@@ -207,7 +214,7 @@ export class ChatApi {
207
214
  'application/json',
208
215
  );
209
216
 
210
- decoders.QueryCampaignsResponse?.(response.body);
217
+ decoders['QueryCampaignsResponse']?.(response.body);
211
218
 
212
219
  return { ...response.body, metadata: response.metadata };
213
220
  }
@@ -223,7 +230,7 @@ export class ChatApi {
223
230
  StreamResponse<DeleteCampaignResponse>
224
231
  >('DELETE', '/api/v2/chat/campaigns/{id}', pathParams, undefined);
225
232
 
226
- decoders.DeleteCampaignResponse?.(response.body);
233
+ decoders['DeleteCampaignResponse']?.(response.body);
227
234
 
228
235
  return { ...response.body, metadata: response.metadata };
229
236
  }
@@ -247,7 +254,7 @@ export class ChatApi {
247
254
  StreamResponse<GetCampaignResponse>
248
255
  >('GET', '/api/v2/chat/campaigns/{id}', pathParams, queryParams);
249
256
 
250
- decoders.GetCampaignResponse?.(response.body);
257
+ decoders['GetCampaignResponse']?.(response.body);
251
258
 
252
259
  return { ...response.body, metadata: response.metadata };
253
260
  }
@@ -286,7 +293,7 @@ export class ChatApi {
286
293
  'application/json',
287
294
  );
288
295
 
289
- decoders.CampaignResponse?.(response.body);
296
+ decoders['CampaignResponse']?.(response.body);
290
297
 
291
298
  return { ...response.body, metadata: response.metadata };
292
299
  }
@@ -313,7 +320,7 @@ export class ChatApi {
313
320
  'application/json',
314
321
  );
315
322
 
316
- decoders.StartCampaignResponse?.(response.body);
323
+ decoders['StartCampaignResponse']?.(response.body);
317
324
 
318
325
  return { ...response.body, metadata: response.metadata };
319
326
  }
@@ -337,7 +344,7 @@ export class ChatApi {
337
344
  'application/json',
338
345
  );
339
346
 
340
- decoders.CampaignResponse?.(response.body);
347
+ decoders['CampaignResponse']?.(response.body);
341
348
 
342
349
  return { ...response.body, metadata: response.metadata };
343
350
  }
@@ -372,7 +379,7 @@ export class ChatApi {
372
379
  'application/json',
373
380
  );
374
381
 
375
- decoders.QueryChannelsResponse?.(response.body);
382
+ decoders['QueryChannelsResponse']?.(response.body);
376
383
 
377
384
  return { ...response.body, metadata: response.metadata };
378
385
  }
@@ -398,7 +405,7 @@ export class ChatApi {
398
405
  'application/json',
399
406
  );
400
407
 
401
- decoders.ChannelBatchUpdateResponse?.(response.body);
408
+ decoders['ChannelBatchUpdateResponse']?.(response.body);
402
409
 
403
410
  return { ...response.body, metadata: response.metadata };
404
411
  }
@@ -422,7 +429,7 @@ export class ChatApi {
422
429
  'application/json',
423
430
  );
424
431
 
425
- decoders.DeleteChannelsResponse?.(response.body);
432
+ decoders['DeleteChannelsResponse']?.(response.body);
426
433
 
427
434
  return { ...response.body, metadata: response.metadata };
428
435
  }
@@ -448,7 +455,7 @@ export class ChatApi {
448
455
  'application/json',
449
456
  );
450
457
 
451
- decoders.MarkDeliveredResponse?.(response.body);
458
+ decoders['MarkDeliveredResponse']?.(response.body);
452
459
 
453
460
  return { ...response.body, metadata: response.metadata };
454
461
  }
@@ -474,7 +481,7 @@ export class ChatApi {
474
481
  'application/json',
475
482
  );
476
483
 
477
- decoders.GroupedQueryChannelsResponse?.(response.body);
484
+ decoders['GroupedQueryChannelsResponse']?.(response.body);
478
485
 
479
486
  return { ...response.body, metadata: response.metadata };
480
487
  }
@@ -499,7 +506,7 @@ export class ChatApi {
499
506
  'application/json',
500
507
  );
501
508
 
502
- decoders.MarkReadResponse?.(response.body);
509
+ decoders['MarkReadResponse']?.(response.body);
503
510
 
504
511
  return { ...response.body, metadata: response.metadata };
505
512
  }
@@ -532,7 +539,7 @@ export class ChatApi {
532
539
  'application/json',
533
540
  );
534
541
 
535
- decoders.ChannelStateResponse?.(response.body);
542
+ decoders['ChannelStateResponse']?.(response.body);
536
543
 
537
544
  return { ...response.body, metadata: response.metadata };
538
545
  }
@@ -554,7 +561,7 @@ export class ChatApi {
554
561
  StreamResponse<DeleteChannelResponse>
555
562
  >('DELETE', '/api/v2/chat/channels/{type}/{id}', pathParams, queryParams);
556
563
 
557
- decoders.DeleteChannelResponse?.(response.body);
564
+ decoders['DeleteChannelResponse']?.(response.body);
558
565
 
559
566
  return { ...response.body, metadata: response.metadata };
560
567
  }
@@ -571,6 +578,7 @@ export class ChatApi {
571
578
  messages_id_gt?: string;
572
579
  messages_id_gte?: string;
573
580
  messages_id_around?: string;
581
+ user_id?: string;
574
582
  }): Promise<StreamResponse<ChannelStateResponse>> {
575
583
  const queryParams = {
576
584
  state: request?.state,
@@ -582,6 +590,7 @@ export class ChatApi {
582
590
  messages_id_gt: request?.messages_id_gt,
583
591
  messages_id_gte: request?.messages_id_gte,
584
592
  messages_id_around: request?.messages_id_around,
593
+ user_id: request?.user_id,
585
594
  };
586
595
  const pathParams = {
587
596
  type: request?.type,
@@ -592,7 +601,7 @@ export class ChatApi {
592
601
  StreamResponse<ChannelStateResponse>
593
602
  >('GET', '/api/v2/chat/channels/{type}/{id}', pathParams, queryParams);
594
603
 
595
- decoders.ChannelStateResponse?.(response.body);
604
+ decoders['ChannelStateResponse']?.(response.body);
596
605
 
597
606
  return { ...response.body, metadata: response.metadata };
598
607
  }
@@ -622,7 +631,7 @@ export class ChatApi {
622
631
  'application/json',
623
632
  );
624
633
 
625
- decoders.UpdateChannelPartialResponse?.(response.body);
634
+ decoders['UpdateChannelPartialResponse']?.(response.body);
626
635
 
627
636
  return { ...response.body, metadata: response.metadata };
628
637
  }
@@ -666,7 +675,7 @@ export class ChatApi {
666
675
  'application/json',
667
676
  );
668
677
 
669
- decoders.UpdateChannelResponse?.(response.body);
678
+ decoders['UpdateChannelResponse']?.(response.body);
670
679
 
671
680
  return { ...response.body, metadata: response.metadata };
672
681
  }
@@ -693,7 +702,7 @@ export class ChatApi {
693
702
  queryParams,
694
703
  );
695
704
 
696
- decoders.Response?.(response.body);
705
+ decoders['Response']?.(response.body);
697
706
 
698
707
  return { ...response.body, metadata: response.metadata };
699
708
  }
@@ -722,7 +731,7 @@ export class ChatApi {
722
731
  queryParams,
723
732
  );
724
733
 
725
- decoders.GetDraftResponse?.(response.body);
734
+ decoders['GetDraftResponse']?.(response.body);
726
735
 
727
736
  return { ...response.body, metadata: response.metadata };
728
737
  }
@@ -749,7 +758,7 @@ export class ChatApi {
749
758
  'application/json',
750
759
  );
751
760
 
752
- decoders.EventResponse?.(response.body);
761
+ decoders['EventResponse']?.(response.body);
753
762
 
754
763
  return { ...response.body, metadata: response.metadata };
755
764
  }
@@ -774,7 +783,7 @@ export class ChatApi {
774
783
  queryParams,
775
784
  );
776
785
 
777
- decoders.Response?.(response.body);
786
+ decoders['Response']?.(response.body);
778
787
 
779
788
  return { ...response.body, metadata: response.metadata };
780
789
  }
@@ -802,7 +811,7 @@ export class ChatApi {
802
811
  'multipart/form-data',
803
812
  );
804
813
 
805
- decoders.UploadChannelFileResponse?.(response.body);
814
+ decoders['UploadChannelFileResponse']?.(response.body);
806
815
 
807
816
  return { ...response.body, metadata: response.metadata };
808
817
  }
@@ -831,7 +840,7 @@ export class ChatApi {
831
840
  'application/json',
832
841
  );
833
842
 
834
- decoders.HideChannelResponse?.(response.body);
843
+ decoders['HideChannelResponse']?.(response.body);
835
844
 
836
845
  return { ...response.body, metadata: response.metadata };
837
846
  }
@@ -856,7 +865,7 @@ export class ChatApi {
856
865
  queryParams,
857
866
  );
858
867
 
859
- decoders.Response?.(response.body);
868
+ decoders['Response']?.(response.body);
860
869
 
861
870
  return { ...response.body, metadata: response.metadata };
862
871
  }
@@ -885,7 +894,7 @@ export class ChatApi {
885
894
  'multipart/form-data',
886
895
  );
887
896
 
888
- decoders.UploadChannelResponse?.(response.body);
897
+ decoders['UploadChannelResponse']?.(response.body);
889
898
 
890
899
  return { ...response.body, metadata: response.metadata };
891
900
  }
@@ -920,7 +929,7 @@ export class ChatApi {
920
929
  'application/json',
921
930
  );
922
931
 
923
- decoders.UpdateMemberPartialResponse?.(response.body);
932
+ decoders['UpdateMemberPartialResponse']?.(response.body);
924
933
 
925
934
  return { ...response.body, metadata: response.metadata };
926
935
  }
@@ -955,7 +964,7 @@ export class ChatApi {
955
964
  'application/json',
956
965
  );
957
966
 
958
- decoders.SendMessageResponse?.(response.body);
967
+ decoders['SendMessageResponse']?.(response.body);
959
968
 
960
969
  return { ...response.body, metadata: response.metadata };
961
970
  }
@@ -963,8 +972,8 @@ export class ChatApi {
963
972
  async getManyMessages(request: {
964
973
  type: string;
965
974
  id: string;
966
- ids: string[];
967
- member_custom_include?: string[];
975
+ ids: Array<string>;
976
+ member_custom_include?: Array<string>;
968
977
  }): Promise<StreamResponse<GetManyMessagesResponse>> {
969
978
  const queryParams = {
970
979
  ids: request?.ids,
@@ -984,7 +993,62 @@ export class ChatApi {
984
993
  queryParams,
985
994
  );
986
995
 
987
- decoders.GetManyMessagesResponse?.(response.body);
996
+ decoders['GetManyMessagesResponse']?.(response.body);
997
+
998
+ return { ...response.body, metadata: response.metadata };
999
+ }
1000
+
1001
+ async getPinnedMessages(request: {
1002
+ type: string;
1003
+ id: string;
1004
+ limit?: number;
1005
+ offset?: number;
1006
+ id_gte?: string;
1007
+ id_gt?: string;
1008
+ id_lte?: string;
1009
+ id_lt?: string;
1010
+ pinned_at_after_or_equal?: Date;
1011
+ pinned_at_after?: Date;
1012
+ pinned_at_before_or_equal?: Date;
1013
+ pinned_at_before?: Date;
1014
+ id_around?: string;
1015
+ pinned_at_around?: Date;
1016
+ user_id?: string;
1017
+ sort?: Array<SortParamRequest>;
1018
+ member_custom_include?: Array<string>;
1019
+ }): Promise<StreamResponse<GetPinnedMessagesResponse>> {
1020
+ const queryParams = {
1021
+ limit: request?.limit,
1022
+ offset: request?.offset,
1023
+ id_gte: request?.id_gte,
1024
+ id_gt: request?.id_gt,
1025
+ id_lte: request?.id_lte,
1026
+ id_lt: request?.id_lt,
1027
+ pinned_at_after_or_equal: request?.pinned_at_after_or_equal,
1028
+ pinned_at_after: request?.pinned_at_after,
1029
+ pinned_at_before_or_equal: request?.pinned_at_before_or_equal,
1030
+ pinned_at_before: request?.pinned_at_before,
1031
+ id_around: request?.id_around,
1032
+ pinned_at_around: request?.pinned_at_around,
1033
+ user_id: request?.user_id,
1034
+ sort: request?.sort,
1035
+ member_custom_include: request?.member_custom_include,
1036
+ };
1037
+ const pathParams = {
1038
+ type: request?.type,
1039
+ id: request?.id,
1040
+ };
1041
+
1042
+ const response = await this.apiClient.sendRequest<
1043
+ StreamResponse<GetPinnedMessagesResponse>
1044
+ >(
1045
+ 'GET',
1046
+ '/api/v2/chat/channels/{type}/{id}/pinned_messages',
1047
+ pathParams,
1048
+ queryParams,
1049
+ );
1050
+
1051
+ decoders['GetPinnedMessagesResponse']?.(response.body);
988
1052
 
989
1053
  return { ...response.body, metadata: response.metadata };
990
1054
  }
@@ -1018,7 +1082,7 @@ export class ChatApi {
1018
1082
  'application/json',
1019
1083
  );
1020
1084
 
1021
- decoders.ChannelStateResponse?.(response.body);
1085
+ decoders['ChannelStateResponse']?.(response.body);
1022
1086
 
1023
1087
  return { ...response.body, metadata: response.metadata };
1024
1088
  }
@@ -1048,7 +1112,7 @@ export class ChatApi {
1048
1112
  'application/json',
1049
1113
  );
1050
1114
 
1051
- decoders.MarkReadResponse?.(response.body);
1115
+ decoders['MarkReadResponse']?.(response.body);
1052
1116
 
1053
1117
  return { ...response.body, metadata: response.metadata };
1054
1118
  }
@@ -1076,7 +1140,7 @@ export class ChatApi {
1076
1140
  'application/json',
1077
1141
  );
1078
1142
 
1079
- decoders.ShowChannelResponse?.(response.body);
1143
+ decoders['ShowChannelResponse']?.(response.body);
1080
1144
 
1081
1145
  return { ...response.body, metadata: response.metadata };
1082
1146
  }
@@ -1109,7 +1173,7 @@ export class ChatApi {
1109
1173
  'application/json',
1110
1174
  );
1111
1175
 
1112
- decoders.TruncateChannelResponse?.(response.body);
1176
+ decoders['TruncateChannelResponse']?.(response.body);
1113
1177
 
1114
1178
  return { ...response.body, metadata: response.metadata };
1115
1179
  }
@@ -1138,7 +1202,7 @@ export class ChatApi {
1138
1202
  'application/json',
1139
1203
  );
1140
1204
 
1141
- decoders.Response?.(response.body);
1205
+ decoders['Response']?.(response.body);
1142
1206
 
1143
1207
  return { ...response.body, metadata: response.metadata };
1144
1208
  }
@@ -1148,7 +1212,7 @@ export class ChatApi {
1148
1212
  StreamResponse<ListChannelTypesResponse>
1149
1213
  >('GET', '/api/v2/chat/channeltypes', undefined, undefined);
1150
1214
 
1151
- decoders.ListChannelTypesResponse?.(response.body);
1215
+ decoders['ListChannelTypesResponse']?.(response.body);
1152
1216
 
1153
1217
  return { ...response.body, metadata: response.metadata };
1154
1218
  }
@@ -1204,7 +1268,7 @@ export class ChatApi {
1204
1268
  'application/json',
1205
1269
  );
1206
1270
 
1207
- decoders.CreateChannelTypeResponse?.(response.body);
1271
+ decoders['CreateChannelTypeResponse']?.(response.body);
1208
1272
 
1209
1273
  return { ...response.body, metadata: response.metadata };
1210
1274
  }
@@ -1223,7 +1287,7 @@ export class ChatApi {
1223
1287
  undefined,
1224
1288
  );
1225
1289
 
1226
- decoders.Response?.(response.body);
1290
+ decoders['Response']?.(response.body);
1227
1291
 
1228
1292
  return { ...response.body, metadata: response.metadata };
1229
1293
  }
@@ -1239,7 +1303,7 @@ export class ChatApi {
1239
1303
  StreamResponse<GetChannelTypeResponse>
1240
1304
  >('GET', '/api/v2/chat/channeltypes/{name}', pathParams, undefined);
1241
1305
 
1242
- decoders.GetChannelTypeResponse?.(response.body);
1306
+ decoders['GetChannelTypeResponse']?.(response.body);
1243
1307
 
1244
1308
  return { ...response.body, metadata: response.metadata };
1245
1309
  }
@@ -1300,7 +1364,7 @@ export class ChatApi {
1300
1364
  'application/json',
1301
1365
  );
1302
1366
 
1303
- decoders.UpdateChannelTypeResponse?.(response.body);
1367
+ decoders['UpdateChannelTypeResponse']?.(response.body);
1304
1368
 
1305
1369
  return { ...response.body, metadata: response.metadata };
1306
1370
  }
@@ -1310,7 +1374,7 @@ export class ChatApi {
1310
1374
  StreamResponse<ListCommandsResponse>
1311
1375
  >('GET', '/api/v2/chat/commands', undefined, undefined);
1312
1376
 
1313
- decoders.ListCommandsResponse?.(response.body);
1377
+ decoders['ListCommandsResponse']?.(response.body);
1314
1378
 
1315
1379
  return { ...response.body, metadata: response.metadata };
1316
1380
  }
@@ -1336,7 +1400,7 @@ export class ChatApi {
1336
1400
  'application/json',
1337
1401
  );
1338
1402
 
1339
- decoders.CreateCommandResponse?.(response.body);
1403
+ decoders['CreateCommandResponse']?.(response.body);
1340
1404
 
1341
1405
  return { ...response.body, metadata: response.metadata };
1342
1406
  }
@@ -1352,7 +1416,7 @@ export class ChatApi {
1352
1416
  StreamResponse<DeleteCommandResponse>
1353
1417
  >('DELETE', '/api/v2/chat/commands/{name}', pathParams, undefined);
1354
1418
 
1355
- decoders.DeleteCommandResponse?.(response.body);
1419
+ decoders['DeleteCommandResponse']?.(response.body);
1356
1420
 
1357
1421
  return { ...response.body, metadata: response.metadata };
1358
1422
  }
@@ -1368,7 +1432,7 @@ export class ChatApi {
1368
1432
  StreamResponse<GetCommandResponse>
1369
1433
  >('GET', '/api/v2/chat/commands/{name}', pathParams, undefined);
1370
1434
 
1371
- decoders.GetCommandResponse?.(response.body);
1435
+ decoders['GetCommandResponse']?.(response.body);
1372
1436
 
1373
1437
  return { ...response.body, metadata: response.metadata };
1374
1438
  }
@@ -1396,7 +1460,7 @@ export class ChatApi {
1396
1460
  'application/json',
1397
1461
  );
1398
1462
 
1399
- decoders.UpdateCommandResponse?.(response.body);
1463
+ decoders['UpdateCommandResponse']?.(response.body);
1400
1464
 
1401
1465
  return { ...response.body, metadata: response.metadata };
1402
1466
  }
@@ -1425,7 +1489,7 @@ export class ChatApi {
1425
1489
  'application/json',
1426
1490
  );
1427
1491
 
1428
- decoders.QueryDraftsResponse?.(response.body);
1492
+ decoders['QueryDraftsResponse']?.(response.body);
1429
1493
 
1430
1494
  return { ...response.body, metadata: response.metadata };
1431
1495
  }
@@ -1455,7 +1519,7 @@ export class ChatApi {
1455
1519
  'application/json',
1456
1520
  );
1457
1521
 
1458
- decoders.ExportChannelsResponse?.(response.body);
1522
+ decoders['ExportChannelsResponse']?.(response.body);
1459
1523
 
1460
1524
  return { ...response.body, metadata: response.metadata };
1461
1525
  }
@@ -1471,7 +1535,7 @@ export class ChatApi {
1471
1535
  StreamResponse<MembersResponse>
1472
1536
  >('GET', '/api/v2/chat/members', undefined, queryParams);
1473
1537
 
1474
- decoders.MembersResponse?.(response.body);
1538
+ decoders['MembersResponse']?.(response.body);
1475
1539
 
1476
1540
  return { ...response.body, metadata: response.metadata };
1477
1541
  }
@@ -1498,7 +1562,7 @@ export class ChatApi {
1498
1562
  'application/json',
1499
1563
  );
1500
1564
 
1501
- decoders.QueryMessageHistoryResponse?.(response.body);
1565
+ decoders['QueryMessageHistoryResponse']?.(response.body);
1502
1566
 
1503
1567
  return { ...response.body, metadata: response.metadata };
1504
1568
  }
@@ -1522,7 +1586,7 @@ export class ChatApi {
1522
1586
  StreamResponse<DeleteMessageResponse>
1523
1587
  >('DELETE', '/api/v2/chat/messages/{id}', pathParams, queryParams);
1524
1588
 
1525
- decoders.DeleteMessageResponse?.(response.body);
1589
+ decoders['DeleteMessageResponse']?.(response.body);
1526
1590
 
1527
1591
  return { ...response.body, metadata: response.metadata };
1528
1592
  }
@@ -1542,7 +1606,7 @@ export class ChatApi {
1542
1606
  StreamResponse<GetMessageResponse>
1543
1607
  >('GET', '/api/v2/chat/messages/{id}', pathParams, queryParams);
1544
1608
 
1545
- decoders.GetMessageResponse?.(response.body);
1609
+ decoders['GetMessageResponse']?.(response.body);
1546
1610
 
1547
1611
  return { ...response.body, metadata: response.metadata };
1548
1612
  }
@@ -1570,7 +1634,7 @@ export class ChatApi {
1570
1634
  'application/json',
1571
1635
  );
1572
1636
 
1573
- decoders.UpdateMessageResponse?.(response.body);
1637
+ decoders['UpdateMessageResponse']?.(response.body);
1574
1638
 
1575
1639
  return { ...response.body, metadata: response.metadata };
1576
1640
  }
@@ -1601,7 +1665,7 @@ export class ChatApi {
1601
1665
  'application/json',
1602
1666
  );
1603
1667
 
1604
- decoders.UpdateMessagePartialResponse?.(response.body);
1668
+ decoders['UpdateMessagePartialResponse']?.(response.body);
1605
1669
 
1606
1670
  return { ...response.body, metadata: response.metadata };
1607
1671
  }
@@ -1629,7 +1693,7 @@ export class ChatApi {
1629
1693
  'application/json',
1630
1694
  );
1631
1695
 
1632
- decoders.MessageActionResponse?.(response.body);
1696
+ decoders['MessageActionResponse']?.(response.body);
1633
1697
 
1634
1698
  return { ...response.body, metadata: response.metadata };
1635
1699
  }
@@ -1653,7 +1717,7 @@ export class ChatApi {
1653
1717
  'application/json',
1654
1718
  );
1655
1719
 
1656
- decoders.MessageActionResponse?.(response.body);
1720
+ decoders['MessageActionResponse']?.(response.body);
1657
1721
 
1658
1722
  return { ...response.body, metadata: response.metadata };
1659
1723
  }
@@ -1684,7 +1748,7 @@ export class ChatApi {
1684
1748
  'application/json',
1685
1749
  );
1686
1750
 
1687
- decoders.UpdateMessagePartialResponse?.(response.body);
1751
+ decoders['UpdateMessagePartialResponse']?.(response.body);
1688
1752
 
1689
1753
  return { ...response.body, metadata: response.metadata };
1690
1754
  }
@@ -1712,7 +1776,7 @@ export class ChatApi {
1712
1776
  'application/json',
1713
1777
  );
1714
1778
 
1715
- decoders.SendReactionResponse?.(response.body);
1779
+ decoders['SendReactionResponse']?.(response.body);
1716
1780
 
1717
1781
  return { ...response.body, metadata: response.metadata };
1718
1782
  }
@@ -1739,7 +1803,7 @@ export class ChatApi {
1739
1803
  queryParams,
1740
1804
  );
1741
1805
 
1742
- decoders.DeleteReactionResponse?.(response.body);
1806
+ decoders['DeleteReactionResponse']?.(response.body);
1743
1807
 
1744
1808
  return { ...response.body, metadata: response.metadata };
1745
1809
  }
@@ -1761,7 +1825,7 @@ export class ChatApi {
1761
1825
  StreamResponse<GetReactionsResponse>
1762
1826
  >('GET', '/api/v2/chat/messages/{id}/reactions', pathParams, queryParams);
1763
1827
 
1764
- decoders.GetReactionsResponse?.(response.body);
1828
+ decoders['GetReactionsResponse']?.(response.body);
1765
1829
 
1766
1830
  return { ...response.body, metadata: response.metadata };
1767
1831
  }
@@ -1793,7 +1857,7 @@ export class ChatApi {
1793
1857
  'application/json',
1794
1858
  );
1795
1859
 
1796
- decoders.QueryReactionsResponse?.(response.body);
1860
+ decoders['QueryReactionsResponse']?.(response.body);
1797
1861
 
1798
1862
  return { ...response.body, metadata: response.metadata };
1799
1863
  }
@@ -1819,7 +1883,7 @@ export class ChatApi {
1819
1883
  'application/json',
1820
1884
  );
1821
1885
 
1822
- decoders.MessageActionResponse?.(response.body);
1886
+ decoders['MessageActionResponse']?.(response.body);
1823
1887
 
1824
1888
  return { ...response.body, metadata: response.metadata };
1825
1889
  }
@@ -1845,7 +1909,7 @@ export class ChatApi {
1845
1909
  'application/json',
1846
1910
  );
1847
1911
 
1848
- decoders.UndeleteMessageResponse?.(response.body);
1912
+ decoders['UndeleteMessageResponse']?.(response.body);
1849
1913
 
1850
1914
  return { ...response.body, metadata: response.metadata };
1851
1915
  }
@@ -1874,7 +1938,7 @@ export class ChatApi {
1874
1938
  'application/json',
1875
1939
  );
1876
1940
 
1877
- decoders.PollVoteResponse?.(response.body);
1941
+ decoders['PollVoteResponse']?.(response.body);
1878
1942
 
1879
1943
  return { ...response.body, metadata: response.metadata };
1880
1944
  }
@@ -1903,7 +1967,7 @@ export class ChatApi {
1903
1967
  queryParams,
1904
1968
  );
1905
1969
 
1906
- decoders.PollVoteResponse?.(response.body);
1970
+ decoders['PollVoteResponse']?.(response.body);
1907
1971
 
1908
1972
  return { ...response.body, metadata: response.metadata };
1909
1973
  }
@@ -1928,7 +1992,7 @@ export class ChatApi {
1928
1992
  queryParams,
1929
1993
  );
1930
1994
 
1931
- decoders.DeleteReminderResponse?.(response.body);
1995
+ decoders['DeleteReminderResponse']?.(response.body);
1932
1996
 
1933
1997
  return { ...response.body, metadata: response.metadata };
1934
1998
  }
@@ -1956,7 +2020,7 @@ export class ChatApi {
1956
2020
  'application/json',
1957
2021
  );
1958
2022
 
1959
- decoders.UpdateReminderResponse?.(response.body);
2023
+ decoders['UpdateReminderResponse']?.(response.body);
1960
2024
 
1961
2025
  return { ...response.body, metadata: response.metadata };
1962
2026
  }
@@ -1984,7 +2048,7 @@ export class ChatApi {
1984
2048
  'application/json',
1985
2049
  );
1986
2050
 
1987
- decoders.ReminderResponseData?.(response.body);
2051
+ decoders['ReminderResponseData']?.(response.body);
1988
2052
 
1989
2053
  return { ...response.body, metadata: response.metadata };
1990
2054
  }
@@ -1997,8 +2061,8 @@ export class ChatApi {
1997
2061
  id_lte?: string;
1998
2062
  id_lt?: string;
1999
2063
  id_around?: string;
2000
- sort?: SortParamRequest[];
2001
- member_custom_include?: string[];
2064
+ sort?: Array<SortParamRequest>;
2065
+ member_custom_include?: Array<string>;
2002
2066
  }): Promise<StreamResponse<GetRepliesResponse>> {
2003
2067
  const queryParams = {
2004
2068
  limit: request?.limit,
@@ -2023,7 +2087,7 @@ export class ChatApi {
2023
2087
  queryParams,
2024
2088
  );
2025
2089
 
2026
- decoders.GetRepliesResponse?.(response.body);
2090
+ decoders['GetRepliesResponse']?.(response.body);
2027
2091
 
2028
2092
  return { ...response.body, metadata: response.metadata };
2029
2093
  }
@@ -2039,7 +2103,7 @@ export class ChatApi {
2039
2103
  StreamResponse<QueryMessageFlagsResponse>
2040
2104
  >('GET', '/api/v2/chat/moderation/flags/message', undefined, queryParams);
2041
2105
 
2042
- decoders.QueryMessageFlagsResponse?.(response.body);
2106
+ decoders['QueryMessageFlagsResponse']?.(response.body);
2043
2107
 
2044
2108
  return { ...response.body, metadata: response.metadata };
2045
2109
  }
@@ -2065,7 +2129,7 @@ export class ChatApi {
2065
2129
  'application/json',
2066
2130
  );
2067
2131
 
2068
- decoders.MuteChannelResponse?.(response.body);
2132
+ decoders['MuteChannelResponse']?.(response.body);
2069
2133
 
2070
2134
  return { ...response.body, metadata: response.metadata };
2071
2135
  }
@@ -2091,7 +2155,116 @@ export class ChatApi {
2091
2155
  'application/json',
2092
2156
  );
2093
2157
 
2094
- decoders.UnmuteResponse?.(response.body);
2158
+ decoders['UnmuteResponse']?.(response.body);
2159
+
2160
+ return { ...response.body, metadata: response.metadata };
2161
+ }
2162
+
2163
+ async getPredefinedFilters(request?: {
2164
+ include_stats?: boolean;
2165
+ sort?: Array<SortParamRequest>;
2166
+ }): Promise<StreamResponse<QueryPredefinedFiltersResponse>> {
2167
+ const queryParams = {
2168
+ include_stats: request?.include_stats,
2169
+ sort: request?.sort,
2170
+ };
2171
+
2172
+ const response = await this.apiClient.sendRequest<
2173
+ StreamResponse<QueryPredefinedFiltersResponse>
2174
+ >('GET', '/api/v2/chat/predefined_filters', undefined, queryParams);
2175
+
2176
+ decoders['QueryPredefinedFiltersResponse']?.(response.body);
2177
+
2178
+ return { ...response.body, metadata: response.metadata };
2179
+ }
2180
+
2181
+ async createPredefinedFilter(
2182
+ request: CreatePredefinedFilterRequest,
2183
+ ): Promise<StreamResponse<CreatePredefinedFilterResponse>> {
2184
+ const body = {
2185
+ name: request?.name,
2186
+ operation: request?.operation,
2187
+ filter: request?.filter,
2188
+ description: request?.description,
2189
+ sort: request?.sort,
2190
+ };
2191
+
2192
+ const response = await this.apiClient.sendRequest<
2193
+ StreamResponse<CreatePredefinedFilterResponse>
2194
+ >(
2195
+ 'POST',
2196
+ '/api/v2/chat/predefined_filters',
2197
+ undefined,
2198
+ undefined,
2199
+ body,
2200
+ 'application/json',
2201
+ );
2202
+
2203
+ decoders['CreatePredefinedFilterResponse']?.(response.body);
2204
+
2205
+ return { ...response.body, metadata: response.metadata };
2206
+ }
2207
+
2208
+ async deletePredefinedFilter(request: {
2209
+ name: string;
2210
+ }): Promise<StreamResponse<Response>> {
2211
+ const pathParams = {
2212
+ name: request?.name,
2213
+ };
2214
+
2215
+ const response = await this.apiClient.sendRequest<StreamResponse<Response>>(
2216
+ 'DELETE',
2217
+ '/api/v2/chat/predefined_filters/{name}',
2218
+ pathParams,
2219
+ undefined,
2220
+ );
2221
+
2222
+ decoders['Response']?.(response.body);
2223
+
2224
+ return { ...response.body, metadata: response.metadata };
2225
+ }
2226
+
2227
+ async getPredefinedFilter(request: {
2228
+ name: string;
2229
+ }): Promise<StreamResponse<GetPredefinedFilterResponse>> {
2230
+ const pathParams = {
2231
+ name: request?.name,
2232
+ };
2233
+
2234
+ const response = await this.apiClient.sendRequest<
2235
+ StreamResponse<GetPredefinedFilterResponse>
2236
+ >('GET', '/api/v2/chat/predefined_filters/{name}', pathParams, undefined);
2237
+
2238
+ decoders['GetPredefinedFilterResponse']?.(response.body);
2239
+
2240
+ return { ...response.body, metadata: response.metadata };
2241
+ }
2242
+
2243
+ async updatePredefinedFilter(
2244
+ request: UpdatePredefinedFilterRequest & { name: string },
2245
+ ): Promise<StreamResponse<UpdatePredefinedFilterResponse>> {
2246
+ const pathParams = {
2247
+ name: request?.name,
2248
+ };
2249
+ const body = {
2250
+ operation: request?.operation,
2251
+ filter: request?.filter,
2252
+ description: request?.description,
2253
+ sort: request?.sort,
2254
+ };
2255
+
2256
+ const response = await this.apiClient.sendRequest<
2257
+ StreamResponse<UpdatePredefinedFilterResponse>
2258
+ >(
2259
+ 'PUT',
2260
+ '/api/v2/chat/predefined_filters/{name}',
2261
+ pathParams,
2262
+ undefined,
2263
+ body,
2264
+ 'application/json',
2265
+ );
2266
+
2267
+ decoders['UpdatePredefinedFilterResponse']?.(response.body);
2095
2268
 
2096
2269
  return { ...response.body, metadata: response.metadata };
2097
2270
  }
@@ -2107,7 +2280,7 @@ export class ChatApi {
2107
2280
  StreamResponse<QueryBannedUsersResponse>
2108
2281
  >('GET', '/api/v2/chat/query_banned_users', undefined, queryParams);
2109
2282
 
2110
- decoders.QueryBannedUsersResponse?.(response.body);
2283
+ decoders['QueryBannedUsersResponse']?.(response.body);
2111
2284
 
2112
2285
  return { ...response.body, metadata: response.metadata };
2113
2286
  }
@@ -2123,7 +2296,7 @@ export class ChatApi {
2123
2296
  StreamResponse<QueryFutureChannelBansResponse>
2124
2297
  >('GET', '/api/v2/chat/query_future_channel_bans', undefined, queryParams);
2125
2298
 
2126
- decoders.QueryFutureChannelBansResponse?.(response.body);
2299
+ decoders['QueryFutureChannelBansResponse']?.(response.body);
2127
2300
 
2128
2301
  return { ...response.body, metadata: response.metadata };
2129
2302
  }
@@ -2152,7 +2325,7 @@ export class ChatApi {
2152
2325
  'application/json',
2153
2326
  );
2154
2327
 
2155
- decoders.QueryRemindersResponse?.(response.body);
2328
+ decoders['QueryRemindersResponse']?.(response.body);
2156
2329
 
2157
2330
  return { ...response.body, metadata: response.metadata };
2158
2331
  }
@@ -2164,7 +2337,7 @@ export class ChatApi {
2164
2337
  StreamResponse<GetRetentionPolicyResponse>
2165
2338
  >('GET', '/api/v2/chat/retention_policy', undefined, undefined);
2166
2339
 
2167
- decoders.GetRetentionPolicyResponse?.(response.body);
2340
+ decoders['GetRetentionPolicyResponse']?.(response.body);
2168
2341
 
2169
2342
  return { ...response.body, metadata: response.metadata };
2170
2343
  }
@@ -2188,7 +2361,7 @@ export class ChatApi {
2188
2361
  'application/json',
2189
2362
  );
2190
2363
 
2191
- decoders.SetRetentionPolicyResponse?.(response.body);
2364
+ decoders['SetRetentionPolicyResponse']?.(response.body);
2192
2365
 
2193
2366
  return { ...response.body, metadata: response.metadata };
2194
2367
  }
@@ -2211,7 +2384,7 @@ export class ChatApi {
2211
2384
  'application/json',
2212
2385
  );
2213
2386
 
2214
- decoders.DeleteRetentionPolicyResponse?.(response.body);
2387
+ decoders['DeleteRetentionPolicyResponse']?.(response.body);
2215
2388
 
2216
2389
  return { ...response.body, metadata: response.metadata };
2217
2390
  }
@@ -2238,7 +2411,7 @@ export class ChatApi {
2238
2411
  'application/json',
2239
2412
  );
2240
2413
 
2241
- decoders.GetRetentionPolicyRunsResponse?.(response.body);
2414
+ decoders['GetRetentionPolicyRunsResponse']?.(response.body);
2242
2415
 
2243
2416
  return { ...response.body, metadata: response.metadata };
2244
2417
  }
@@ -2254,7 +2427,7 @@ export class ChatApi {
2254
2427
  StreamResponse<SearchResponse>
2255
2428
  >('GET', '/api/v2/chat/search', undefined, queryParams);
2256
2429
 
2257
- decoders.SearchResponse?.(response.body);
2430
+ decoders['SearchResponse']?.(response.body);
2258
2431
 
2259
2432
  return { ...response.body, metadata: response.metadata };
2260
2433
  }
@@ -2283,7 +2456,7 @@ export class ChatApi {
2283
2456
  'application/json',
2284
2457
  );
2285
2458
 
2286
- decoders.CreateSegmentResponse?.(response.body);
2459
+ decoders['CreateSegmentResponse']?.(response.body);
2287
2460
 
2288
2461
  return { ...response.body, metadata: response.metadata };
2289
2462
  }
@@ -2310,7 +2483,7 @@ export class ChatApi {
2310
2483
  'application/json',
2311
2484
  );
2312
2485
 
2313
- decoders.QuerySegmentsResponse?.(response.body);
2486
+ decoders['QuerySegmentsResponse']?.(response.body);
2314
2487
 
2315
2488
  return { ...response.body, metadata: response.metadata };
2316
2489
  }
@@ -2329,7 +2502,7 @@ export class ChatApi {
2329
2502
  undefined,
2330
2503
  );
2331
2504
 
2332
- decoders.Response?.(response.body);
2505
+ decoders['Response']?.(response.body);
2333
2506
 
2334
2507
  return { ...response.body, metadata: response.metadata };
2335
2508
  }
@@ -2345,7 +2518,7 @@ export class ChatApi {
2345
2518
  StreamResponse<GetSegmentResponse>
2346
2519
  >('GET', '/api/v2/chat/segments/{id}', pathParams, undefined);
2347
2520
 
2348
- decoders.GetSegmentResponse?.(response.body);
2521
+ decoders['GetSegmentResponse']?.(response.body);
2349
2522
 
2350
2523
  return { ...response.body, metadata: response.metadata };
2351
2524
  }
@@ -2373,7 +2546,7 @@ export class ChatApi {
2373
2546
  'application/json',
2374
2547
  );
2375
2548
 
2376
- decoders.UpdateSegmentResponse?.(response.body);
2549
+ decoders['UpdateSegmentResponse']?.(response.body);
2377
2550
 
2378
2551
  return { ...response.body, metadata: response.metadata };
2379
2552
  }
@@ -2397,7 +2570,7 @@ export class ChatApi {
2397
2570
  'application/json',
2398
2571
  );
2399
2572
 
2400
- decoders.Response?.(response.body);
2573
+ decoders['Response']?.(response.body);
2401
2574
 
2402
2575
  return { ...response.body, metadata: response.metadata };
2403
2576
  }
@@ -2421,7 +2594,7 @@ export class ChatApi {
2421
2594
  'application/json',
2422
2595
  );
2423
2596
 
2424
- decoders.Response?.(response.body);
2597
+ decoders['Response']?.(response.body);
2425
2598
 
2426
2599
  return { ...response.body, metadata: response.metadata };
2427
2600
  }
@@ -2442,7 +2615,7 @@ export class ChatApi {
2442
2615
  undefined,
2443
2616
  );
2444
2617
 
2445
- decoders.Response?.(response.body);
2618
+ decoders['Response']?.(response.body);
2446
2619
 
2447
2620
  return { ...response.body, metadata: response.metadata };
2448
2621
  }
@@ -2472,7 +2645,7 @@ export class ChatApi {
2472
2645
  'application/json',
2473
2646
  );
2474
2647
 
2475
- decoders.QuerySegmentTargetsResponse?.(response.body);
2648
+ decoders['QuerySegmentTargetsResponse']?.(response.body);
2476
2649
 
2477
2650
  return { ...response.body, metadata: response.metadata };
2478
2651
  }
@@ -2486,6 +2659,7 @@ export class ChatApi {
2486
2659
  month: request?.month,
2487
2660
  next: request?.next,
2488
2661
  start_date: request?.start_date,
2662
+ team: request?.team,
2489
2663
  };
2490
2664
 
2491
2665
  const response = await this.apiClient.sendRequest<
@@ -2499,7 +2673,7 @@ export class ChatApi {
2499
2673
  'application/json',
2500
2674
  );
2501
2675
 
2502
- decoders.QueryTeamUsageStatsResponse?.(response.body);
2676
+ decoders['QueryTeamUsageStatsResponse']?.(response.body);
2503
2677
 
2504
2678
  return { ...response.body, metadata: response.metadata };
2505
2679
  }
@@ -2531,7 +2705,7 @@ export class ChatApi {
2531
2705
  'application/json',
2532
2706
  );
2533
2707
 
2534
- decoders.QueryThreadsResponse?.(response.body);
2708
+ decoders['QueryThreadsResponse']?.(response.body);
2535
2709
 
2536
2710
  return { ...response.body, metadata: response.metadata };
2537
2711
  }
@@ -2555,7 +2729,7 @@ export class ChatApi {
2555
2729
  StreamResponse<GetThreadResponse>
2556
2730
  >('GET', '/api/v2/chat/threads/{message_id}', pathParams, queryParams);
2557
2731
 
2558
- decoders.GetThreadResponse?.(response.body);
2732
+ decoders['GetThreadResponse']?.(response.body);
2559
2733
 
2560
2734
  return { ...response.body, metadata: response.metadata };
2561
2735
  }
@@ -2584,7 +2758,7 @@ export class ChatApi {
2584
2758
  'application/json',
2585
2759
  );
2586
2760
 
2587
- decoders.UpdateThreadPartialResponse?.(response.body);
2761
+ decoders['UpdateThreadPartialResponse']?.(response.body);
2588
2762
 
2589
2763
  return { ...response.body, metadata: response.metadata };
2590
2764
  }
@@ -2600,7 +2774,7 @@ export class ChatApi {
2600
2774
  StreamResponse<WrappedUnreadCountsResponse>
2601
2775
  >('GET', '/api/v2/chat/unread', undefined, queryParams);
2602
2776
 
2603
- decoders.WrappedUnreadCountsResponse?.(response.body);
2777
+ decoders['WrappedUnreadCountsResponse']?.(response.body);
2604
2778
 
2605
2779
  return { ...response.body, metadata: response.metadata };
2606
2780
  }
@@ -2623,7 +2797,7 @@ export class ChatApi {
2623
2797
  'application/json',
2624
2798
  );
2625
2799
 
2626
- decoders.UnreadCountsBatchResponse?.(response.body);
2800
+ decoders['UnreadCountsBatchResponse']?.(response.body);
2627
2801
 
2628
2802
  return { ...response.body, metadata: response.metadata };
2629
2803
  }
@@ -2647,7 +2821,7 @@ export class ChatApi {
2647
2821
  'application/json',
2648
2822
  );
2649
2823
 
2650
- decoders.Response?.(response.body);
2824
+ decoders['Response']?.(response.body);
2651
2825
 
2652
2826
  return { ...response.body, metadata: response.metadata };
2653
2827
  }