@stream-io/node-sdk 0.2.6 → 0.3.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.
Files changed (67) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs.js +2461 -2124
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.es.js +2450 -2109
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/src/StreamCall.d.ts +1 -1
  7. package/dist/src/StreamChannel.d.ts +7 -9
  8. package/dist/src/StreamChatClient.d.ts +2 -5
  9. package/dist/src/StreamClient.d.ts +15 -26
  10. package/dist/src/gen/chat/apis/ProductchatApi.d.ts +1750 -0
  11. package/dist/src/gen/chat/apis/index.d.ts +1 -27
  12. package/dist/src/gen/chat/models/index.d.ts +5101 -5891
  13. package/dist/src/gen/chat/runtime.d.ts +2 -2
  14. package/dist/src/gen/video/apis/ProductvideoApi.d.ts +1 -1
  15. package/dist/src/gen/video/models/index.d.ts +189 -35
  16. package/dist/src/gen/video/runtime.d.ts +1 -1
  17. package/package.json +8 -1
  18. package/src/StreamCall.ts +7 -7
  19. package/src/StreamChannel.ts +44 -49
  20. package/src/StreamChatClient.ts +23 -35
  21. package/src/StreamClient.ts +71 -232
  22. package/src/gen/chat/.openapi-generator/FILES +1 -19
  23. package/src/gen/chat/apis/ProductchatApi.ts +7007 -0
  24. package/src/gen/chat/apis/index.ts +1 -27
  25. package/src/gen/chat/models/index.ts +5758 -6564
  26. package/src/gen/chat/runtime.ts +3 -3
  27. package/src/gen/video/apis/ProductvideoApi.ts +1 -1
  28. package/src/gen/video/models/index.ts +184 -36
  29. package/src/gen/video/runtime.ts +1 -1
  30. package/dist/src/gen/chat/apis/ChannelTypesApi.d.ts +0 -81
  31. package/dist/src/gen/chat/apis/ChannelsApi.d.ts +0 -280
  32. package/dist/src/gen/chat/apis/CustomCommandsApi.d.ts +0 -81
  33. package/dist/src/gen/chat/apis/DefaultApi.d.ts +0 -60
  34. package/dist/src/gen/chat/apis/DevicesApi.d.ts +0 -58
  35. package/dist/src/gen/chat/apis/EventsApi.d.ts +0 -47
  36. package/dist/src/gen/chat/apis/FilesApi.d.ts +0 -85
  37. package/dist/src/gen/chat/apis/GDPRApi.d.ts +0 -114
  38. package/dist/src/gen/chat/apis/ImportsApi.d.ts +0 -67
  39. package/dist/src/gen/chat/apis/MessagesApi.d.ts +0 -374
  40. package/dist/src/gen/chat/apis/ModerationApi.d.ts +0 -271
  41. package/dist/src/gen/chat/apis/PermissionsV2Api.d.ts +0 -77
  42. package/dist/src/gen/chat/apis/PushApi.d.ts +0 -65
  43. package/dist/src/gen/chat/apis/ReactionsApi.d.ts +0 -62
  44. package/dist/src/gen/chat/apis/ServerSideApi.d.ts +0 -31
  45. package/dist/src/gen/chat/apis/SettingsApi.d.ts +0 -257
  46. package/dist/src/gen/chat/apis/TasksApi.d.ts +0 -31
  47. package/dist/src/gen/chat/apis/TestingApi.d.ts +0 -57
  48. package/dist/src/gen/chat/apis/UsersApi.d.ts +0 -313
  49. package/src/gen/chat/apis/ChannelTypesApi.ts +0 -275
  50. package/src/gen/chat/apis/ChannelsApi.ts +0 -1096
  51. package/src/gen/chat/apis/CustomCommandsApi.ts +0 -276
  52. package/src/gen/chat/apis/DefaultApi.ts +0 -196
  53. package/src/gen/chat/apis/DevicesApi.ts +0 -180
  54. package/src/gen/chat/apis/EventsApi.ts +0 -147
  55. package/src/gen/chat/apis/FilesApi.ts +0 -312
  56. package/src/gen/chat/apis/GDPRApi.ts +0 -418
  57. package/src/gen/chat/apis/ImportsApi.ts +0 -222
  58. package/src/gen/chat/apis/MessagesApi.ts +0 -1475
  59. package/src/gen/chat/apis/ModerationApi.ts +0 -1038
  60. package/src/gen/chat/apis/PermissionsV2Api.ts +0 -259
  61. package/src/gen/chat/apis/PushApi.ts +0 -183
  62. package/src/gen/chat/apis/ReactionsApi.ts +0 -202
  63. package/src/gen/chat/apis/ServerSideApi.ts +0 -79
  64. package/src/gen/chat/apis/SettingsApi.ts +0 -948
  65. package/src/gen/chat/apis/TasksApi.ts +0 -75
  66. package/src/gen/chat/apis/TestingApi.ts +0 -185
  67. package/src/gen/chat/apis/UsersApi.ts +0 -1203
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Stream Chat API
2
+ * Stream API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: v92.7.0
5
+ * The version of the OpenAPI document: v122.3.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Stream API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: v120.0.0
5
+ * The version of the OpenAPI document: v122.3.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -68,6 +68,33 @@ export interface VideoAPNS {
68
68
  */
69
69
  title?: string;
70
70
  }
71
+ /**
72
+ *
73
+ * @export
74
+ * @interface VideoAggregatedStats
75
+ */
76
+ export interface VideoAggregatedStats {
77
+ /**
78
+ *
79
+ * @type {{ [key: string]: VideoCountrywiseAggregateStats; }}
80
+ * @memberof VideoAggregatedStats
81
+ */
82
+ countrywise_aggregate_stats?: {
83
+ [key: string]: VideoCountrywiseAggregateStats;
84
+ };
85
+ /**
86
+ *
87
+ * @type {VideoPublisherAggregateStats}
88
+ * @memberof VideoAggregatedStats
89
+ */
90
+ publisher_aggregate_stats?: VideoPublisherAggregateStats;
91
+ /**
92
+ *
93
+ * @type {VideoTURNAggregatedStats}
94
+ * @memberof VideoAggregatedStats
95
+ */
96
+ turn?: VideoTURNAggregatedStats;
97
+ }
71
98
  /**
72
99
  *
73
100
  * @export
@@ -321,6 +348,20 @@ export interface VideoBroadcastSettingsResponse {
321
348
  * @interface VideoCallEvent
322
349
  */
323
350
  export interface VideoCallEvent {
351
+ /**
352
+ *
353
+ * @type {{ [key: string]: any; }}
354
+ * @memberof VideoCallEvent
355
+ */
356
+ additional?: {
357
+ [key: string]: any;
358
+ };
359
+ /**
360
+ *
361
+ * @type {string}
362
+ * @memberof VideoCallEvent
363
+ */
364
+ component?: string;
324
365
  /**
325
366
  *
326
367
  * @type {string}
@@ -1105,6 +1146,62 @@ export interface VideoCoordinates {
1105
1146
  */
1106
1147
  longitude: number;
1107
1148
  }
1149
+ /**
1150
+ *
1151
+ * @export
1152
+ * @interface VideoCount
1153
+ */
1154
+ export interface VideoCount {
1155
+ /**
1156
+ *
1157
+ * @type {boolean}
1158
+ * @memberof VideoCount
1159
+ */
1160
+ approximate: boolean;
1161
+ /**
1162
+ *
1163
+ * @type {number}
1164
+ * @memberof VideoCount
1165
+ */
1166
+ value: number;
1167
+ }
1168
+ /**
1169
+ *
1170
+ * @export
1171
+ * @interface VideoCountrywiseAggregateStats
1172
+ */
1173
+ export interface VideoCountrywiseAggregateStats {
1174
+ /**
1175
+ *
1176
+ * @type {VideoCount}
1177
+ * @memberof VideoCountrywiseAggregateStats
1178
+ */
1179
+ participant_count?: VideoCount;
1180
+ /**
1181
+ *
1182
+ * @type {VideoTimeStats}
1183
+ * @memberof VideoCountrywiseAggregateStats
1184
+ */
1185
+ publisher_jitter?: VideoTimeStats;
1186
+ /**
1187
+ *
1188
+ * @type {VideoTimeStats}
1189
+ * @memberof VideoCountrywiseAggregateStats
1190
+ */
1191
+ publisher_latency?: VideoTimeStats;
1192
+ /**
1193
+ *
1194
+ * @type {VideoTimeStats}
1195
+ * @memberof VideoCountrywiseAggregateStats
1196
+ */
1197
+ subscriber_jitter?: VideoTimeStats;
1198
+ /**
1199
+ *
1200
+ * @type {VideoTimeStats}
1201
+ * @memberof VideoCountrywiseAggregateStats
1202
+ */
1203
+ subscriber_latency?: VideoTimeStats;
1204
+ }
1108
1205
  /**
1109
1206
  *
1110
1207
  * @export
@@ -1837,6 +1934,12 @@ export interface VideoGetCallResponse {
1837
1934
  * @interface VideoGetCallStatsResponse
1838
1935
  */
1839
1936
  export interface VideoGetCallStatsResponse {
1937
+ /**
1938
+ *
1939
+ * @type {VideoAggregatedStats}
1940
+ * @memberof VideoGetCallStatsResponse
1941
+ */
1942
+ aggregated?: VideoAggregatedStats;
1840
1943
  /**
1841
1944
  *
1842
1945
  * @type {number}
@@ -1863,16 +1966,16 @@ export interface VideoGetCallStatsResponse {
1863
1966
  duration: string;
1864
1967
  /**
1865
1968
  *
1866
- * @type {VideoStats}
1969
+ * @type {VideoTimeStats}
1867
1970
  * @memberof VideoGetCallStatsResponse
1868
1971
  */
1869
- jitter?: VideoStats;
1972
+ jitter?: VideoTimeStats;
1870
1973
  /**
1871
1974
  *
1872
- * @type {VideoStats}
1975
+ * @type {VideoTimeStats}
1873
1976
  * @memberof VideoGetCallStatsResponse
1874
1977
  */
1875
- latency?: VideoStats;
1978
+ latency?: VideoTimeStats;
1876
1979
  /**
1877
1980
  *
1878
1981
  * @type {number}
@@ -2854,6 +2957,27 @@ export interface VideoPublishedTrackInfo {
2854
2957
  */
2855
2958
  track_type?: string;
2856
2959
  }
2960
+ /**
2961
+ *
2962
+ * @export
2963
+ * @interface VideoPublisherAggregateStats
2964
+ */
2965
+ export interface VideoPublisherAggregateStats {
2966
+ /**
2967
+ *
2968
+ * @type {{ [key: string]: VideoCount; }}
2969
+ * @memberof VideoPublisherAggregateStats
2970
+ */
2971
+ by_track_type?: {
2972
+ [key: string]: VideoCount;
2973
+ };
2974
+ /**
2975
+ *
2976
+ * @type {VideoCount}
2977
+ * @memberof VideoPublisherAggregateStats
2978
+ */
2979
+ total?: VideoCount;
2980
+ }
2857
2981
  /**
2858
2982
  *
2859
2983
  * @export
@@ -3189,6 +3313,11 @@ export declare const VideoRecordSettingsRequestQualityEnum: {
3189
3313
  readonly _720P: "720p";
3190
3314
  readonly _1080P: "1080p";
3191
3315
  readonly _1440P: "1440p";
3316
+ readonly PORTRAIT_360X640: "portrait-360x640";
3317
+ readonly PORTRAIT_480X854: "portrait-480x854";
3318
+ readonly PORTRAIT_720X1280: "portrait-720x1280";
3319
+ readonly PORTRAIT_1080X1920: "portrait-1080x1920";
3320
+ readonly PORTRAIT_1440X2560: "portrait-1440x2560";
3192
3321
  };
3193
3322
  export type VideoRecordSettingsRequestQualityEnum = typeof VideoRecordSettingsRequestQualityEnum[keyof typeof VideoRecordSettingsRequestQualityEnum];
3194
3323
  /**
@@ -3521,25 +3650,6 @@ export interface VideoStartTranscriptionResponse {
3521
3650
  */
3522
3651
  duration: string;
3523
3652
  }
3524
- /**
3525
- *
3526
- * @export
3527
- * @interface VideoStats
3528
- */
3529
- export interface VideoStats {
3530
- /**
3531
- *
3532
- * @type {number}
3533
- * @memberof VideoStats
3534
- */
3535
- average_seconds: number;
3536
- /**
3537
- *
3538
- * @type {number}
3539
- * @memberof VideoStats
3540
- */
3541
- max_seconds: number;
3542
- }
3543
3653
  /**
3544
3654
  *
3545
3655
  * @export
@@ -3629,6 +3739,25 @@ export interface VideoSubsession {
3629
3739
  */
3630
3740
  sfu_id: string;
3631
3741
  }
3742
+ /**
3743
+ *
3744
+ * @export
3745
+ * @interface VideoTURNAggregatedStats
3746
+ */
3747
+ export interface VideoTURNAggregatedStats {
3748
+ /**
3749
+ *
3750
+ * @type {VideoCount}
3751
+ * @memberof VideoTURNAggregatedStats
3752
+ */
3753
+ tcp?: VideoCount;
3754
+ /**
3755
+ *
3756
+ * @type {VideoCount}
3757
+ * @memberof VideoTURNAggregatedStats
3758
+ */
3759
+ total?: VideoCount;
3760
+ }
3632
3761
  /**
3633
3762
  *
3634
3763
  * @export
@@ -3693,6 +3822,25 @@ export interface VideoThumbnailsSettingsResponse {
3693
3822
  */
3694
3823
  enabled: boolean;
3695
3824
  }
3825
+ /**
3826
+ *
3827
+ * @export
3828
+ * @interface VideoTimeStats
3829
+ */
3830
+ export interface VideoTimeStats {
3831
+ /**
3832
+ *
3833
+ * @type {number}
3834
+ * @memberof VideoTimeStats
3835
+ */
3836
+ average_seconds: number;
3837
+ /**
3838
+ *
3839
+ * @type {number}
3840
+ * @memberof VideoTimeStats
3841
+ */
3842
+ max_seconds: number;
3843
+ }
3696
3844
  /**
3697
3845
  *
3698
3846
  * @export
@@ -4447,16 +4595,16 @@ export interface VideoUserSessionStats {
4447
4595
  geolocation?: VideoGeolocationResult;
4448
4596
  /**
4449
4597
  *
4450
- * @type {VideoStats}
4598
+ * @type {VideoTimeStats}
4451
4599
  * @memberof VideoUserSessionStats
4452
4600
  */
4453
- jitter?: VideoStats;
4601
+ jitter?: VideoTimeStats;
4454
4602
  /**
4455
4603
  *
4456
- * @type {VideoStats}
4604
+ * @type {VideoTimeStats}
4457
4605
  * @memberof VideoUserSessionStats
4458
4606
  */
4459
- latency?: VideoStats;
4607
+ latency?: VideoTimeStats;
4460
4608
  /**
4461
4609
  *
4462
4610
  * @type {number}
@@ -4543,16 +4691,16 @@ export interface VideoUserSessionStats {
4543
4691
  publisher_audio_mos?: VideoMOSStats;
4544
4692
  /**
4545
4693
  *
4546
- * @type {VideoStats}
4694
+ * @type {VideoTimeStats}
4547
4695
  * @memberof VideoUserSessionStats
4548
4696
  */
4549
- publisher_jitter?: VideoStats;
4697
+ publisher_jitter?: VideoTimeStats;
4550
4698
  /**
4551
4699
  *
4552
- * @type {VideoStats}
4700
+ * @type {VideoTimeStats}
4553
4701
  * @memberof VideoUserSessionStats
4554
4702
  */
4555
- publisher_latency?: VideoStats;
4703
+ publisher_latency?: VideoTimeStats;
4556
4704
  /**
4557
4705
  *
4558
4706
  * @type {number}
@@ -4647,16 +4795,16 @@ export interface VideoUserSessionStats {
4647
4795
  subscriber_audio_mos?: VideoMOSStats;
4648
4796
  /**
4649
4797
  *
4650
- * @type {VideoStats}
4798
+ * @type {VideoTimeStats}
4651
4799
  * @memberof VideoUserSessionStats
4652
4800
  */
4653
- subscriber_jitter?: VideoStats;
4801
+ subscriber_jitter?: VideoTimeStats;
4654
4802
  /**
4655
4803
  *
4656
- * @type {VideoStats}
4804
+ * @type {VideoTimeStats}
4657
4805
  * @memberof VideoUserSessionStats
4658
4806
  */
4659
- subscriber_latency?: VideoStats;
4807
+ subscriber_latency?: VideoTimeStats;
4660
4808
  /**
4661
4809
  *
4662
4810
  * @type {number}
@@ -4687,6 +4835,12 @@ export interface VideoUserSessionStats {
4687
4835
  * @memberof VideoUserSessionStats
4688
4836
  */
4689
4837
  total_pixels_out: number;
4838
+ /**
4839
+ *
4840
+ * @type {boolean}
4841
+ * @memberof VideoUserSessionStats
4842
+ */
4843
+ truncated?: boolean;
4690
4844
  /**
4691
4845
  *
4692
4846
  * @type {string}
@@ -2,7 +2,7 @@
2
2
  * Stream API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: v120.0.0
5
+ * The version of the OpenAPI document: v122.3.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/package.json CHANGED
@@ -1,7 +1,14 @@
1
1
  {
2
2
  "name": "@stream-io/node-sdk",
3
- "version": "0.2.6",
3
+ "version": "0.3.1",
4
4
  "description": "",
5
+ "exports": {
6
+ ".": {
7
+ "import": "./dist/index.es.js",
8
+ "require": "./dist/index.cjs.js",
9
+ "types": "./dist/index.d.ts"
10
+ }
11
+ },
5
12
  "main": "dist/index.cjs.js",
6
13
  "module": "dist/index.es.js",
7
14
  "types": "dist/index.d.ts",
package/src/StreamCall.ts CHANGED
@@ -48,13 +48,6 @@ export class StreamCall {
48
48
  });
49
49
  };
50
50
 
51
- delete = (videoDeleteCallRequest?: VideoDeleteCallRequest) => {
52
- return this.apiClient.deleteCall({
53
- ...this.baseRequest,
54
- videoDeleteCallRequest: videoDeleteCallRequest ?? null,
55
- });
56
- };
57
-
58
51
  endCall = () => {
59
52
  return this.apiClient.endCall({ ...this.baseRequest });
60
53
  };
@@ -63,6 +56,13 @@ export class StreamCall {
63
56
  return this.apiClient.getCall({ ...(request ?? {}), ...this.baseRequest });
64
57
  };
65
58
 
59
+ delete = (videoDeleteCallRequest?: VideoDeleteCallRequest) => {
60
+ return this.apiClient.deleteCall({
61
+ ...this.baseRequest,
62
+ videoDeleteCallRequest: videoDeleteCallRequest ?? null,
63
+ });
64
+ };
65
+
66
66
  getOrCreate = (videoGetOrCreateCallRequest?: VideoGetOrCreateCallRequest) => {
67
67
  return this.apiClient.getOrCreateCall({
68
68
  ...this.baseRequest,
@@ -1,12 +1,10 @@
1
1
  import { StreamClient } from './StreamClient';
2
2
  import {
3
3
  ChannelGetOrCreateRequest,
4
- ChannelsApi,
5
4
  DeleteChannelRequest,
6
5
  DeleteMessageRequest,
7
6
  DeleteReactionRequest,
8
7
  EventRequest,
9
- EventsApi,
10
8
  GetManyMessagesRequest,
11
9
  GetMessageRequest,
12
10
  GetOGRequest,
@@ -15,8 +13,8 @@ import {
15
13
  HideChannelRequest,
16
14
  MarkReadRequest,
17
15
  MarkUnreadRequest,
18
- MessagesApi,
19
16
  MuteChannelRequest,
17
+ ProductchatApi,
20
18
  QueryMembersRequest,
21
19
  SendMessageRequest,
22
20
  SendReactionRequest,
@@ -32,9 +30,7 @@ import {
32
30
  import { OmitTypeId } from './types';
33
31
 
34
32
  export class StreamChannel {
35
- private readonly channelsApi: ChannelsApi;
36
- private readonly messagesApi: MessagesApi;
37
- private readonly eventsApi: EventsApi;
33
+ private readonly chatApi: ProductchatApi;
38
34
 
39
35
  constructor(
40
36
  private readonly streamClient: StreamClient,
@@ -43,11 +39,7 @@ export class StreamChannel {
43
39
  ) {
44
40
  const configuration = this.streamClient.getConfiguration();
45
41
  /** @ts-expect-error */
46
- this.channelsApi = new ChannelsApi(configuration);
47
- /** @ts-expect-error */
48
- this.messagesApi = new MessagesApi(configuration);
49
- /** @ts-expect-error */
50
- this.eventsApi = new EventsApi(configuration);
42
+ this.chatApi = new ProductchatApi(configuration);
51
43
  }
52
44
 
53
45
  get cid() {
@@ -55,14 +47,14 @@ export class StreamChannel {
55
47
  }
56
48
 
57
49
  delete = (request?: OmitTypeId<DeleteChannelRequest>) => {
58
- return this.channelsApi.deleteChannel({
50
+ return this.chatApi.deleteChannel({
59
51
  ...this.baseRequest,
60
52
  ...(request ?? {}),
61
53
  });
62
54
  };
63
55
 
64
56
  update = (updateChannelRequest: OmitTypeId<UpdateChannelRequest>) => {
65
- return this.channelsApi.updateChannel({
57
+ return this.chatApi.updateChannel({
66
58
  ...this.baseRequest,
67
59
  updateChannelRequest,
68
60
  });
@@ -71,7 +63,7 @@ export class StreamChannel {
71
63
  updatePartial = (
72
64
  updateChannelPartialRequest: OmitTypeId<UpdateChannelPartialRequest>,
73
65
  ) => {
74
- return this.channelsApi.updateChannelPartial({
66
+ return this.chatApi.updateChannelPartial({
75
67
  ...this.baseRequest,
76
68
  updateChannelPartialRequest,
77
69
  });
@@ -81,61 +73,65 @@ export class StreamChannel {
81
73
  channelGetOrCreateRequest?: ChannelGetOrCreateRequest,
82
74
  ) => {
83
75
  if (this.id) {
84
- return await this.channelsApi.getOrCreateChannel({
76
+ return await this.chatApi.getOrCreateChannel({
85
77
  ...this.baseRequest,
86
78
  channelGetOrCreateRequest: channelGetOrCreateRequest ?? {},
87
79
  });
88
80
  } else {
89
- throw new Error(`This operation isn't yet implemented`);
90
- // if (!channelGetOrCreateRequest?.data?.members) {
91
- // throw new Error('You need to provide members to create a channel without ID');
92
- // }
93
- // const response = await this.channelsApi.getOrCreateChannelType1({type: this.type, channelGetOrCreateRequest});
94
- // this.id = response.channel?.id;
95
- // return response;
81
+ if (!channelGetOrCreateRequest?.data?.members) {
82
+ throw new Error(
83
+ 'You need to provide members to create a channel without ID',
84
+ );
85
+ }
86
+ const response = await this.chatApi.getOrCreateDistinctChannel({
87
+ type: this.type,
88
+ channelGetOrCreateRequest,
89
+ });
90
+ this.id = response.channel?.id;
91
+ return response;
96
92
  }
97
93
  };
98
94
 
99
95
  markRead = (markReadRequest: MarkReadRequest) => {
100
- return this.channelsApi.markRead({ ...this.baseRequest, markReadRequest });
96
+ return this.chatApi.markRead({ ...this.baseRequest, markReadRequest });
101
97
  };
102
98
 
103
99
  markUnread = (markUnreadRequest: MarkUnreadRequest) => {
104
- return this.channelsApi.markUnread({
100
+ return this.chatApi.markUnread({
105
101
  ...this.baseRequest,
106
102
  markUnreadRequest,
107
103
  });
108
104
  };
109
105
 
110
106
  show = (showChannelRequest: ShowChannelRequest) => {
111
- return this.channelsApi.showChannel({
107
+ return this.chatApi.showChannel({
112
108
  ...this.baseRequest,
113
109
  showChannelRequest,
114
110
  });
115
111
  };
116
112
 
117
113
  hide = (hideChannelRequest: HideChannelRequest) => {
118
- return this.channelsApi.hideChannel({
114
+ return this.chatApi.hideChannel({
119
115
  ...this.baseRequest,
120
116
  hideChannelRequest,
121
117
  });
122
118
  };
123
119
 
124
120
  truncate = (truncateChannelRequest: TruncateChannelRequest) => {
125
- return this.channelsApi.truncateChannel({
121
+ return this.chatApi.truncateChannel({
126
122
  ...this.baseRequest,
127
123
  truncateChannelRequest,
128
124
  });
129
125
  };
130
126
 
131
127
  queryMembers = (request: OmitTypeId<QueryMembersRequest>) => {
132
- return this.channelsApi.queryMembers({
128
+ return this.chatApi.queryMembers({
133
129
  payload: { ...this.baseRequest, ...request },
134
130
  });
135
131
  };
136
132
 
137
133
  mute = (muteChannelRequest: Omit<MuteChannelRequest, 'channel_cids'>) => {
138
- return this.channelsApi.muteChannel({
134
+ return this.chatApi.muteChannel({
139
135
  muteChannelRequest: { ...muteChannelRequest, channel_cids: [this.cid] },
140
136
  });
141
137
  };
@@ -146,63 +142,62 @@ export class StreamChannel {
146
142
  'channel_cids' | 'channel_cid'
147
143
  >,
148
144
  ) => {
149
- return this.channelsApi.unmuteChannel({
145
+ return this.chatApi.unmuteChannel({
150
146
  unmuteChannelRequest: {
151
147
  ...unmuteChannelRequest,
152
- channel_cid: this.cid,
153
- channel_cids: [],
148
+ channel_cids: [this.cid],
154
149
  },
155
150
  });
156
151
  };
157
152
 
158
153
  // TODO: there is probably an issue with the generated code here
159
154
  // uploadFile = (options: Omit<OmitTypeId<UploadFileRequest>, 'file'>, file: Buffer) => {
160
- // return this.messagesApi.uploadFile({...options, ...this.baseRequest, file: file as any as string});
155
+ // return this.chatApi.uploadFile({...options, ...this.baseRequest, file: file as any as string});
161
156
  // }
162
157
 
163
158
  // deleteFile = (request: OmitTypeId<DeleteFileRequest>) => {
164
- // return this.messagesApi.deleteFile({...request, ...this.baseRequest});
159
+ // return this.chatApi.deleteFile({...request, ...this.baseRequest});
165
160
  // }
166
161
 
167
162
  // uploadImage = (request: OmitTypeId<UploadImageRequest>) => {
168
- // return this.messagesApi.uploadImage({...request, ...this.baseRequest});
163
+ // return this.chatApi.uploadImage({...request, ...this.baseRequest});
169
164
  // }
170
165
 
171
166
  // deleteImage = (request: OmitTypeId<DeleteImageRequest>) => {
172
- // return this.messagesApi.deleteImage({...request, ...this.baseRequest});
167
+ // return this.chatApi.deleteImage({...request, ...this.baseRequest});
173
168
  // }
174
169
 
175
170
  sendMessage = (sendMessageRequest: SendMessageRequest) => {
176
- return this.messagesApi.sendMessage({
171
+ return this.chatApi.sendMessage({
177
172
  ...this.baseRequest,
178
173
  sendMessageRequest,
179
174
  });
180
175
  };
181
176
 
182
177
  deleteMessage = (request: DeleteMessageRequest) => {
183
- return this.messagesApi.deleteMessage(request);
178
+ return this.chatApi.deleteMessage(request);
184
179
  };
185
180
 
186
181
  updateMessage = (id: string, updateMessageRequest: UpdateMessageRequest) => {
187
- return this.messagesApi.updateMessage({ id, updateMessageRequest });
182
+ return this.chatApi.updateMessage({ id, updateMessageRequest });
188
183
  };
189
184
 
190
185
  updateMessagePartial = (
191
186
  id: string,
192
187
  updateMessagePartialRequest: UpdateMessagePartialRequest,
193
188
  ) => {
194
- return this.messagesApi.updateMessagePartial({
189
+ return this.chatApi.updateMessagePartial({
195
190
  id,
196
191
  updateMessagePartialRequest,
197
192
  });
198
193
  };
199
194
 
200
195
  getMessage = (request: GetMessageRequest) => {
201
- return this.messagesApi.getMessage(request);
196
+ return this.chatApi.getMessage(request);
202
197
  };
203
198
 
204
199
  getManyMessages = (request: OmitTypeId<GetManyMessagesRequest>) => {
205
- return this.messagesApi.getManyMessages({
200
+ return this.chatApi.getManyMessages({
206
201
  ...request,
207
202
  ...this.baseRequest,
208
203
  });
@@ -212,22 +207,22 @@ export class StreamChannel {
212
207
  id: string,
213
208
  translateMessageRequest: TranslateMessageRequest,
214
209
  ) => {
215
- return this.messagesApi.translateMessage({ id, translateMessageRequest });
210
+ return this.chatApi.translateMessage({ id, translateMessageRequest });
216
211
  };
217
212
 
218
213
  getMessagesAround = (request: GetRepliesRequest) => {
219
- return this.messagesApi.getReplies(request);
214
+ return this.chatApi.getReplies(request);
220
215
  };
221
216
 
222
217
  getOpenGraphData = (request: GetOGRequest) => {
223
- return this.messagesApi.getOG(request);
218
+ return this.chatApi.getOG(request);
224
219
  };
225
220
 
226
221
  sendMessageReaction = (
227
222
  messageId: string,
228
223
  sendReactionRequest: SendReactionRequest,
229
224
  ) => {
230
- return this.messagesApi.sendReaction({
225
+ return this.chatApi.sendReaction({
231
226
  id: messageId,
232
227
  sendReactionRequest,
233
228
  });
@@ -237,18 +232,18 @@ export class StreamChannel {
237
232
  messageId: string,
238
233
  request: Omit<DeleteReactionRequest, 'id'>,
239
234
  ) => {
240
- return this.messagesApi.deleteReaction({ ...request, id: messageId });
235
+ return this.chatApi.deleteReaction({ ...request, id: messageId });
241
236
  };
242
237
 
243
238
  getMessageReactions = (
244
239
  messageId: string,
245
240
  request?: Omit<GetReactionsRequest, 'id'>,
246
241
  ) => {
247
- return this.messagesApi.getReactions({ ...(request ?? {}), id: messageId });
242
+ return this.chatApi.getReactions({ ...(request ?? {}), id: messageId });
248
243
  };
249
244
 
250
245
  sendCustomEvent = (event: EventRequest) => {
251
- return this.eventsApi.sendEvent({
246
+ return this.chatApi.sendEvent({
252
247
  ...this.baseRequest,
253
248
  sendEventRequest: { event },
254
249
  });