@stream-io/node-sdk 0.8.0 → 0.8.2

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
  }
@@ -1261,6 +1325,7 @@ export class ChatApi {
1261
1325
  custom_events: request?.custom_events,
1262
1326
  delivery_events: request?.delivery_events,
1263
1327
  mark_messages_pending: request?.mark_messages_pending,
1328
+ message_retention: request?.message_retention,
1264
1329
  mutes: request?.mutes,
1265
1330
  partition_size: request?.partition_size,
1266
1331
  partition_ttl: request?.partition_ttl,
@@ -1300,7 +1365,7 @@ export class ChatApi {
1300
1365
  'application/json',
1301
1366
  );
1302
1367
 
1303
- decoders.UpdateChannelTypeResponse?.(response.body);
1368
+ decoders['UpdateChannelTypeResponse']?.(response.body);
1304
1369
 
1305
1370
  return { ...response.body, metadata: response.metadata };
1306
1371
  }
@@ -1310,7 +1375,7 @@ export class ChatApi {
1310
1375
  StreamResponse<ListCommandsResponse>
1311
1376
  >('GET', '/api/v2/chat/commands', undefined, undefined);
1312
1377
 
1313
- decoders.ListCommandsResponse?.(response.body);
1378
+ decoders['ListCommandsResponse']?.(response.body);
1314
1379
 
1315
1380
  return { ...response.body, metadata: response.metadata };
1316
1381
  }
@@ -1336,7 +1401,7 @@ export class ChatApi {
1336
1401
  'application/json',
1337
1402
  );
1338
1403
 
1339
- decoders.CreateCommandResponse?.(response.body);
1404
+ decoders['CreateCommandResponse']?.(response.body);
1340
1405
 
1341
1406
  return { ...response.body, metadata: response.metadata };
1342
1407
  }
@@ -1352,7 +1417,7 @@ export class ChatApi {
1352
1417
  StreamResponse<DeleteCommandResponse>
1353
1418
  >('DELETE', '/api/v2/chat/commands/{name}', pathParams, undefined);
1354
1419
 
1355
- decoders.DeleteCommandResponse?.(response.body);
1420
+ decoders['DeleteCommandResponse']?.(response.body);
1356
1421
 
1357
1422
  return { ...response.body, metadata: response.metadata };
1358
1423
  }
@@ -1368,7 +1433,7 @@ export class ChatApi {
1368
1433
  StreamResponse<GetCommandResponse>
1369
1434
  >('GET', '/api/v2/chat/commands/{name}', pathParams, undefined);
1370
1435
 
1371
- decoders.GetCommandResponse?.(response.body);
1436
+ decoders['GetCommandResponse']?.(response.body);
1372
1437
 
1373
1438
  return { ...response.body, metadata: response.metadata };
1374
1439
  }
@@ -1396,7 +1461,7 @@ export class ChatApi {
1396
1461
  'application/json',
1397
1462
  );
1398
1463
 
1399
- decoders.UpdateCommandResponse?.(response.body);
1464
+ decoders['UpdateCommandResponse']?.(response.body);
1400
1465
 
1401
1466
  return { ...response.body, metadata: response.metadata };
1402
1467
  }
@@ -1425,7 +1490,7 @@ export class ChatApi {
1425
1490
  'application/json',
1426
1491
  );
1427
1492
 
1428
- decoders.QueryDraftsResponse?.(response.body);
1493
+ decoders['QueryDraftsResponse']?.(response.body);
1429
1494
 
1430
1495
  return { ...response.body, metadata: response.metadata };
1431
1496
  }
@@ -1455,7 +1520,7 @@ export class ChatApi {
1455
1520
  'application/json',
1456
1521
  );
1457
1522
 
1458
- decoders.ExportChannelsResponse?.(response.body);
1523
+ decoders['ExportChannelsResponse']?.(response.body);
1459
1524
 
1460
1525
  return { ...response.body, metadata: response.metadata };
1461
1526
  }
@@ -1471,7 +1536,7 @@ export class ChatApi {
1471
1536
  StreamResponse<MembersResponse>
1472
1537
  >('GET', '/api/v2/chat/members', undefined, queryParams);
1473
1538
 
1474
- decoders.MembersResponse?.(response.body);
1539
+ decoders['MembersResponse']?.(response.body);
1475
1540
 
1476
1541
  return { ...response.body, metadata: response.metadata };
1477
1542
  }
@@ -1498,7 +1563,7 @@ export class ChatApi {
1498
1563
  'application/json',
1499
1564
  );
1500
1565
 
1501
- decoders.QueryMessageHistoryResponse?.(response.body);
1566
+ decoders['QueryMessageHistoryResponse']?.(response.body);
1502
1567
 
1503
1568
  return { ...response.body, metadata: response.metadata };
1504
1569
  }
@@ -1522,7 +1587,7 @@ export class ChatApi {
1522
1587
  StreamResponse<DeleteMessageResponse>
1523
1588
  >('DELETE', '/api/v2/chat/messages/{id}', pathParams, queryParams);
1524
1589
 
1525
- decoders.DeleteMessageResponse?.(response.body);
1590
+ decoders['DeleteMessageResponse']?.(response.body);
1526
1591
 
1527
1592
  return { ...response.body, metadata: response.metadata };
1528
1593
  }
@@ -1542,7 +1607,7 @@ export class ChatApi {
1542
1607
  StreamResponse<GetMessageResponse>
1543
1608
  >('GET', '/api/v2/chat/messages/{id}', pathParams, queryParams);
1544
1609
 
1545
- decoders.GetMessageResponse?.(response.body);
1610
+ decoders['GetMessageResponse']?.(response.body);
1546
1611
 
1547
1612
  return { ...response.body, metadata: response.metadata };
1548
1613
  }
@@ -1570,7 +1635,7 @@ export class ChatApi {
1570
1635
  'application/json',
1571
1636
  );
1572
1637
 
1573
- decoders.UpdateMessageResponse?.(response.body);
1638
+ decoders['UpdateMessageResponse']?.(response.body);
1574
1639
 
1575
1640
  return { ...response.body, metadata: response.metadata };
1576
1641
  }
@@ -1601,7 +1666,7 @@ export class ChatApi {
1601
1666
  'application/json',
1602
1667
  );
1603
1668
 
1604
- decoders.UpdateMessagePartialResponse?.(response.body);
1669
+ decoders['UpdateMessagePartialResponse']?.(response.body);
1605
1670
 
1606
1671
  return { ...response.body, metadata: response.metadata };
1607
1672
  }
@@ -1629,7 +1694,7 @@ export class ChatApi {
1629
1694
  'application/json',
1630
1695
  );
1631
1696
 
1632
- decoders.MessageActionResponse?.(response.body);
1697
+ decoders['MessageActionResponse']?.(response.body);
1633
1698
 
1634
1699
  return { ...response.body, metadata: response.metadata };
1635
1700
  }
@@ -1653,7 +1718,7 @@ export class ChatApi {
1653
1718
  'application/json',
1654
1719
  );
1655
1720
 
1656
- decoders.MessageActionResponse?.(response.body);
1721
+ decoders['MessageActionResponse']?.(response.body);
1657
1722
 
1658
1723
  return { ...response.body, metadata: response.metadata };
1659
1724
  }
@@ -1684,7 +1749,7 @@ export class ChatApi {
1684
1749
  'application/json',
1685
1750
  );
1686
1751
 
1687
- decoders.UpdateMessagePartialResponse?.(response.body);
1752
+ decoders['UpdateMessagePartialResponse']?.(response.body);
1688
1753
 
1689
1754
  return { ...response.body, metadata: response.metadata };
1690
1755
  }
@@ -1712,7 +1777,7 @@ export class ChatApi {
1712
1777
  'application/json',
1713
1778
  );
1714
1779
 
1715
- decoders.SendReactionResponse?.(response.body);
1780
+ decoders['SendReactionResponse']?.(response.body);
1716
1781
 
1717
1782
  return { ...response.body, metadata: response.metadata };
1718
1783
  }
@@ -1739,7 +1804,7 @@ export class ChatApi {
1739
1804
  queryParams,
1740
1805
  );
1741
1806
 
1742
- decoders.DeleteReactionResponse?.(response.body);
1807
+ decoders['DeleteReactionResponse']?.(response.body);
1743
1808
 
1744
1809
  return { ...response.body, metadata: response.metadata };
1745
1810
  }
@@ -1761,7 +1826,7 @@ export class ChatApi {
1761
1826
  StreamResponse<GetReactionsResponse>
1762
1827
  >('GET', '/api/v2/chat/messages/{id}/reactions', pathParams, queryParams);
1763
1828
 
1764
- decoders.GetReactionsResponse?.(response.body);
1829
+ decoders['GetReactionsResponse']?.(response.body);
1765
1830
 
1766
1831
  return { ...response.body, metadata: response.metadata };
1767
1832
  }
@@ -1793,7 +1858,7 @@ export class ChatApi {
1793
1858
  'application/json',
1794
1859
  );
1795
1860
 
1796
- decoders.QueryReactionsResponse?.(response.body);
1861
+ decoders['QueryReactionsResponse']?.(response.body);
1797
1862
 
1798
1863
  return { ...response.body, metadata: response.metadata };
1799
1864
  }
@@ -1819,7 +1884,7 @@ export class ChatApi {
1819
1884
  'application/json',
1820
1885
  );
1821
1886
 
1822
- decoders.MessageActionResponse?.(response.body);
1887
+ decoders['MessageActionResponse']?.(response.body);
1823
1888
 
1824
1889
  return { ...response.body, metadata: response.metadata };
1825
1890
  }
@@ -1845,7 +1910,7 @@ export class ChatApi {
1845
1910
  'application/json',
1846
1911
  );
1847
1912
 
1848
- decoders.UndeleteMessageResponse?.(response.body);
1913
+ decoders['UndeleteMessageResponse']?.(response.body);
1849
1914
 
1850
1915
  return { ...response.body, metadata: response.metadata };
1851
1916
  }
@@ -1874,7 +1939,7 @@ export class ChatApi {
1874
1939
  'application/json',
1875
1940
  );
1876
1941
 
1877
- decoders.PollVoteResponse?.(response.body);
1942
+ decoders['PollVoteResponse']?.(response.body);
1878
1943
 
1879
1944
  return { ...response.body, metadata: response.metadata };
1880
1945
  }
@@ -1903,7 +1968,7 @@ export class ChatApi {
1903
1968
  queryParams,
1904
1969
  );
1905
1970
 
1906
- decoders.PollVoteResponse?.(response.body);
1971
+ decoders['PollVoteResponse']?.(response.body);
1907
1972
 
1908
1973
  return { ...response.body, metadata: response.metadata };
1909
1974
  }
@@ -1928,7 +1993,7 @@ export class ChatApi {
1928
1993
  queryParams,
1929
1994
  );
1930
1995
 
1931
- decoders.DeleteReminderResponse?.(response.body);
1996
+ decoders['DeleteReminderResponse']?.(response.body);
1932
1997
 
1933
1998
  return { ...response.body, metadata: response.metadata };
1934
1999
  }
@@ -1956,7 +2021,7 @@ export class ChatApi {
1956
2021
  'application/json',
1957
2022
  );
1958
2023
 
1959
- decoders.UpdateReminderResponse?.(response.body);
2024
+ decoders['UpdateReminderResponse']?.(response.body);
1960
2025
 
1961
2026
  return { ...response.body, metadata: response.metadata };
1962
2027
  }
@@ -1984,7 +2049,7 @@ export class ChatApi {
1984
2049
  'application/json',
1985
2050
  );
1986
2051
 
1987
- decoders.ReminderResponseData?.(response.body);
2052
+ decoders['ReminderResponseData']?.(response.body);
1988
2053
 
1989
2054
  return { ...response.body, metadata: response.metadata };
1990
2055
  }
@@ -1997,8 +2062,8 @@ export class ChatApi {
1997
2062
  id_lte?: string;
1998
2063
  id_lt?: string;
1999
2064
  id_around?: string;
2000
- sort?: SortParamRequest[];
2001
- member_custom_include?: string[];
2065
+ sort?: Array<SortParamRequest>;
2066
+ member_custom_include?: Array<string>;
2002
2067
  }): Promise<StreamResponse<GetRepliesResponse>> {
2003
2068
  const queryParams = {
2004
2069
  limit: request?.limit,
@@ -2023,7 +2088,7 @@ export class ChatApi {
2023
2088
  queryParams,
2024
2089
  );
2025
2090
 
2026
- decoders.GetRepliesResponse?.(response.body);
2091
+ decoders['GetRepliesResponse']?.(response.body);
2027
2092
 
2028
2093
  return { ...response.body, metadata: response.metadata };
2029
2094
  }
@@ -2039,7 +2104,7 @@ export class ChatApi {
2039
2104
  StreamResponse<QueryMessageFlagsResponse>
2040
2105
  >('GET', '/api/v2/chat/moderation/flags/message', undefined, queryParams);
2041
2106
 
2042
- decoders.QueryMessageFlagsResponse?.(response.body);
2107
+ decoders['QueryMessageFlagsResponse']?.(response.body);
2043
2108
 
2044
2109
  return { ...response.body, metadata: response.metadata };
2045
2110
  }
@@ -2065,7 +2130,7 @@ export class ChatApi {
2065
2130
  'application/json',
2066
2131
  );
2067
2132
 
2068
- decoders.MuteChannelResponse?.(response.body);
2133
+ decoders['MuteChannelResponse']?.(response.body);
2069
2134
 
2070
2135
  return { ...response.body, metadata: response.metadata };
2071
2136
  }
@@ -2091,7 +2156,116 @@ export class ChatApi {
2091
2156
  'application/json',
2092
2157
  );
2093
2158
 
2094
- decoders.UnmuteResponse?.(response.body);
2159
+ decoders['UnmuteResponse']?.(response.body);
2160
+
2161
+ return { ...response.body, metadata: response.metadata };
2162
+ }
2163
+
2164
+ async getPredefinedFilters(request?: {
2165
+ include_stats?: boolean;
2166
+ sort?: Array<SortParamRequest>;
2167
+ }): Promise<StreamResponse<QueryPredefinedFiltersResponse>> {
2168
+ const queryParams = {
2169
+ include_stats: request?.include_stats,
2170
+ sort: request?.sort,
2171
+ };
2172
+
2173
+ const response = await this.apiClient.sendRequest<
2174
+ StreamResponse<QueryPredefinedFiltersResponse>
2175
+ >('GET', '/api/v2/chat/predefined_filters', undefined, queryParams);
2176
+
2177
+ decoders['QueryPredefinedFiltersResponse']?.(response.body);
2178
+
2179
+ return { ...response.body, metadata: response.metadata };
2180
+ }
2181
+
2182
+ async createPredefinedFilter(
2183
+ request: CreatePredefinedFilterRequest,
2184
+ ): Promise<StreamResponse<CreatePredefinedFilterResponse>> {
2185
+ const body = {
2186
+ name: request?.name,
2187
+ operation: request?.operation,
2188
+ filter: request?.filter,
2189
+ description: request?.description,
2190
+ sort: request?.sort,
2191
+ };
2192
+
2193
+ const response = await this.apiClient.sendRequest<
2194
+ StreamResponse<CreatePredefinedFilterResponse>
2195
+ >(
2196
+ 'POST',
2197
+ '/api/v2/chat/predefined_filters',
2198
+ undefined,
2199
+ undefined,
2200
+ body,
2201
+ 'application/json',
2202
+ );
2203
+
2204
+ decoders['CreatePredefinedFilterResponse']?.(response.body);
2205
+
2206
+ return { ...response.body, metadata: response.metadata };
2207
+ }
2208
+
2209
+ async deletePredefinedFilter(request: {
2210
+ name: string;
2211
+ }): Promise<StreamResponse<Response>> {
2212
+ const pathParams = {
2213
+ name: request?.name,
2214
+ };
2215
+
2216
+ const response = await this.apiClient.sendRequest<StreamResponse<Response>>(
2217
+ 'DELETE',
2218
+ '/api/v2/chat/predefined_filters/{name}',
2219
+ pathParams,
2220
+ undefined,
2221
+ );
2222
+
2223
+ decoders['Response']?.(response.body);
2224
+
2225
+ return { ...response.body, metadata: response.metadata };
2226
+ }
2227
+
2228
+ async getPredefinedFilter(request: {
2229
+ name: string;
2230
+ }): Promise<StreamResponse<GetPredefinedFilterResponse>> {
2231
+ const pathParams = {
2232
+ name: request?.name,
2233
+ };
2234
+
2235
+ const response = await this.apiClient.sendRequest<
2236
+ StreamResponse<GetPredefinedFilterResponse>
2237
+ >('GET', '/api/v2/chat/predefined_filters/{name}', pathParams, undefined);
2238
+
2239
+ decoders['GetPredefinedFilterResponse']?.(response.body);
2240
+
2241
+ return { ...response.body, metadata: response.metadata };
2242
+ }
2243
+
2244
+ async updatePredefinedFilter(
2245
+ request: UpdatePredefinedFilterRequest & { name: string },
2246
+ ): Promise<StreamResponse<UpdatePredefinedFilterResponse>> {
2247
+ const pathParams = {
2248
+ name: request?.name,
2249
+ };
2250
+ const body = {
2251
+ operation: request?.operation,
2252
+ filter: request?.filter,
2253
+ description: request?.description,
2254
+ sort: request?.sort,
2255
+ };
2256
+
2257
+ const response = await this.apiClient.sendRequest<
2258
+ StreamResponse<UpdatePredefinedFilterResponse>
2259
+ >(
2260
+ 'PUT',
2261
+ '/api/v2/chat/predefined_filters/{name}',
2262
+ pathParams,
2263
+ undefined,
2264
+ body,
2265
+ 'application/json',
2266
+ );
2267
+
2268
+ decoders['UpdatePredefinedFilterResponse']?.(response.body);
2095
2269
 
2096
2270
  return { ...response.body, metadata: response.metadata };
2097
2271
  }
@@ -2107,7 +2281,7 @@ export class ChatApi {
2107
2281
  StreamResponse<QueryBannedUsersResponse>
2108
2282
  >('GET', '/api/v2/chat/query_banned_users', undefined, queryParams);
2109
2283
 
2110
- decoders.QueryBannedUsersResponse?.(response.body);
2284
+ decoders['QueryBannedUsersResponse']?.(response.body);
2111
2285
 
2112
2286
  return { ...response.body, metadata: response.metadata };
2113
2287
  }
@@ -2123,7 +2297,7 @@ export class ChatApi {
2123
2297
  StreamResponse<QueryFutureChannelBansResponse>
2124
2298
  >('GET', '/api/v2/chat/query_future_channel_bans', undefined, queryParams);
2125
2299
 
2126
- decoders.QueryFutureChannelBansResponse?.(response.body);
2300
+ decoders['QueryFutureChannelBansResponse']?.(response.body);
2127
2301
 
2128
2302
  return { ...response.body, metadata: response.metadata };
2129
2303
  }
@@ -2152,7 +2326,7 @@ export class ChatApi {
2152
2326
  'application/json',
2153
2327
  );
2154
2328
 
2155
- decoders.QueryRemindersResponse?.(response.body);
2329
+ decoders['QueryRemindersResponse']?.(response.body);
2156
2330
 
2157
2331
  return { ...response.body, metadata: response.metadata };
2158
2332
  }
@@ -2164,7 +2338,7 @@ export class ChatApi {
2164
2338
  StreamResponse<GetRetentionPolicyResponse>
2165
2339
  >('GET', '/api/v2/chat/retention_policy', undefined, undefined);
2166
2340
 
2167
- decoders.GetRetentionPolicyResponse?.(response.body);
2341
+ decoders['GetRetentionPolicyResponse']?.(response.body);
2168
2342
 
2169
2343
  return { ...response.body, metadata: response.metadata };
2170
2344
  }
@@ -2188,7 +2362,7 @@ export class ChatApi {
2188
2362
  'application/json',
2189
2363
  );
2190
2364
 
2191
- decoders.SetRetentionPolicyResponse?.(response.body);
2365
+ decoders['SetRetentionPolicyResponse']?.(response.body);
2192
2366
 
2193
2367
  return { ...response.body, metadata: response.metadata };
2194
2368
  }
@@ -2211,7 +2385,7 @@ export class ChatApi {
2211
2385
  'application/json',
2212
2386
  );
2213
2387
 
2214
- decoders.DeleteRetentionPolicyResponse?.(response.body);
2388
+ decoders['DeleteRetentionPolicyResponse']?.(response.body);
2215
2389
 
2216
2390
  return { ...response.body, metadata: response.metadata };
2217
2391
  }
@@ -2238,7 +2412,7 @@ export class ChatApi {
2238
2412
  'application/json',
2239
2413
  );
2240
2414
 
2241
- decoders.GetRetentionPolicyRunsResponse?.(response.body);
2415
+ decoders['GetRetentionPolicyRunsResponse']?.(response.body);
2242
2416
 
2243
2417
  return { ...response.body, metadata: response.metadata };
2244
2418
  }
@@ -2254,7 +2428,7 @@ export class ChatApi {
2254
2428
  StreamResponse<SearchResponse>
2255
2429
  >('GET', '/api/v2/chat/search', undefined, queryParams);
2256
2430
 
2257
- decoders.SearchResponse?.(response.body);
2431
+ decoders['SearchResponse']?.(response.body);
2258
2432
 
2259
2433
  return { ...response.body, metadata: response.metadata };
2260
2434
  }
@@ -2283,7 +2457,7 @@ export class ChatApi {
2283
2457
  'application/json',
2284
2458
  );
2285
2459
 
2286
- decoders.CreateSegmentResponse?.(response.body);
2460
+ decoders['CreateSegmentResponse']?.(response.body);
2287
2461
 
2288
2462
  return { ...response.body, metadata: response.metadata };
2289
2463
  }
@@ -2310,7 +2484,7 @@ export class ChatApi {
2310
2484
  'application/json',
2311
2485
  );
2312
2486
 
2313
- decoders.QuerySegmentsResponse?.(response.body);
2487
+ decoders['QuerySegmentsResponse']?.(response.body);
2314
2488
 
2315
2489
  return { ...response.body, metadata: response.metadata };
2316
2490
  }
@@ -2329,7 +2503,7 @@ export class ChatApi {
2329
2503
  undefined,
2330
2504
  );
2331
2505
 
2332
- decoders.Response?.(response.body);
2506
+ decoders['Response']?.(response.body);
2333
2507
 
2334
2508
  return { ...response.body, metadata: response.metadata };
2335
2509
  }
@@ -2345,7 +2519,7 @@ export class ChatApi {
2345
2519
  StreamResponse<GetSegmentResponse>
2346
2520
  >('GET', '/api/v2/chat/segments/{id}', pathParams, undefined);
2347
2521
 
2348
- decoders.GetSegmentResponse?.(response.body);
2522
+ decoders['GetSegmentResponse']?.(response.body);
2349
2523
 
2350
2524
  return { ...response.body, metadata: response.metadata };
2351
2525
  }
@@ -2373,7 +2547,7 @@ export class ChatApi {
2373
2547
  'application/json',
2374
2548
  );
2375
2549
 
2376
- decoders.UpdateSegmentResponse?.(response.body);
2550
+ decoders['UpdateSegmentResponse']?.(response.body);
2377
2551
 
2378
2552
  return { ...response.body, metadata: response.metadata };
2379
2553
  }
@@ -2397,7 +2571,7 @@ export class ChatApi {
2397
2571
  'application/json',
2398
2572
  );
2399
2573
 
2400
- decoders.Response?.(response.body);
2574
+ decoders['Response']?.(response.body);
2401
2575
 
2402
2576
  return { ...response.body, metadata: response.metadata };
2403
2577
  }
@@ -2421,7 +2595,7 @@ export class ChatApi {
2421
2595
  'application/json',
2422
2596
  );
2423
2597
 
2424
- decoders.Response?.(response.body);
2598
+ decoders['Response']?.(response.body);
2425
2599
 
2426
2600
  return { ...response.body, metadata: response.metadata };
2427
2601
  }
@@ -2442,7 +2616,7 @@ export class ChatApi {
2442
2616
  undefined,
2443
2617
  );
2444
2618
 
2445
- decoders.Response?.(response.body);
2619
+ decoders['Response']?.(response.body);
2446
2620
 
2447
2621
  return { ...response.body, metadata: response.metadata };
2448
2622
  }
@@ -2472,7 +2646,7 @@ export class ChatApi {
2472
2646
  'application/json',
2473
2647
  );
2474
2648
 
2475
- decoders.QuerySegmentTargetsResponse?.(response.body);
2649
+ decoders['QuerySegmentTargetsResponse']?.(response.body);
2476
2650
 
2477
2651
  return { ...response.body, metadata: response.metadata };
2478
2652
  }
@@ -2486,6 +2660,7 @@ export class ChatApi {
2486
2660
  month: request?.month,
2487
2661
  next: request?.next,
2488
2662
  start_date: request?.start_date,
2663
+ team: request?.team,
2489
2664
  };
2490
2665
 
2491
2666
  const response = await this.apiClient.sendRequest<
@@ -2499,7 +2674,7 @@ export class ChatApi {
2499
2674
  'application/json',
2500
2675
  );
2501
2676
 
2502
- decoders.QueryTeamUsageStatsResponse?.(response.body);
2677
+ decoders['QueryTeamUsageStatsResponse']?.(response.body);
2503
2678
 
2504
2679
  return { ...response.body, metadata: response.metadata };
2505
2680
  }
@@ -2531,7 +2706,7 @@ export class ChatApi {
2531
2706
  'application/json',
2532
2707
  );
2533
2708
 
2534
- decoders.QueryThreadsResponse?.(response.body);
2709
+ decoders['QueryThreadsResponse']?.(response.body);
2535
2710
 
2536
2711
  return { ...response.body, metadata: response.metadata };
2537
2712
  }
@@ -2555,7 +2730,7 @@ export class ChatApi {
2555
2730
  StreamResponse<GetThreadResponse>
2556
2731
  >('GET', '/api/v2/chat/threads/{message_id}', pathParams, queryParams);
2557
2732
 
2558
- decoders.GetThreadResponse?.(response.body);
2733
+ decoders['GetThreadResponse']?.(response.body);
2559
2734
 
2560
2735
  return { ...response.body, metadata: response.metadata };
2561
2736
  }
@@ -2584,7 +2759,7 @@ export class ChatApi {
2584
2759
  'application/json',
2585
2760
  );
2586
2761
 
2587
- decoders.UpdateThreadPartialResponse?.(response.body);
2762
+ decoders['UpdateThreadPartialResponse']?.(response.body);
2588
2763
 
2589
2764
  return { ...response.body, metadata: response.metadata };
2590
2765
  }
@@ -2600,7 +2775,7 @@ export class ChatApi {
2600
2775
  StreamResponse<WrappedUnreadCountsResponse>
2601
2776
  >('GET', '/api/v2/chat/unread', undefined, queryParams);
2602
2777
 
2603
- decoders.WrappedUnreadCountsResponse?.(response.body);
2778
+ decoders['WrappedUnreadCountsResponse']?.(response.body);
2604
2779
 
2605
2780
  return { ...response.body, metadata: response.metadata };
2606
2781
  }
@@ -2623,7 +2798,7 @@ export class ChatApi {
2623
2798
  'application/json',
2624
2799
  );
2625
2800
 
2626
- decoders.UnreadCountsBatchResponse?.(response.body);
2801
+ decoders['UnreadCountsBatchResponse']?.(response.body);
2627
2802
 
2628
2803
  return { ...response.body, metadata: response.metadata };
2629
2804
  }
@@ -2647,7 +2822,7 @@ export class ChatApi {
2647
2822
  'application/json',
2648
2823
  );
2649
2824
 
2650
- decoders.Response?.(response.body);
2825
+ decoders['Response']?.(response.body);
2651
2826
 
2652
2827
  return { ...response.body, metadata: response.metadata };
2653
2828
  }