@stream-io/node-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/.readme-assets/Github-Graphic-JS.jpg +0 -0
  2. package/LICENSE +219 -0
  3. package/README.md +29 -0
  4. package/dist/__tests__/block-lists.test.d.ts +1 -0
  5. package/dist/__tests__/call-members.test.d.ts +1 -0
  6. package/dist/__tests__/call-types.test.d.ts +1 -0
  7. package/dist/__tests__/call.test.d.ts +1 -0
  8. package/dist/__tests__/channel-types.test.d.ts +1 -0
  9. package/dist/__tests__/channel.test.d.ts +1 -0
  10. package/dist/__tests__/command.test.d.ts +1 -0
  11. package/dist/__tests__/create-token.test.d.ts +1 -0
  12. package/dist/__tests__/devices-push.test.d.ts +1 -0
  13. package/dist/__tests__/messages.test.d.ts +1 -0
  14. package/dist/__tests__/permissions-app-settings.test.d.ts +1 -0
  15. package/dist/__tests__/user-compat.test.d.ts +1 -0
  16. package/dist/__tests__/users.test.d.ts +1 -0
  17. package/dist/index.cjs.js +8789 -0
  18. package/dist/index.cjs.js.map +1 -0
  19. package/dist/index.d.ts +7 -0
  20. package/dist/index.es.js +8708 -0
  21. package/dist/index.es.js.map +1 -0
  22. package/dist/src/StreamCall.d.ts +37 -0
  23. package/dist/src/StreamChannel.d.ts +39 -0
  24. package/dist/src/StreamChatClient.d.ts +31 -0
  25. package/dist/src/StreamClient.d.ts +68 -0
  26. package/dist/src/StreamVideoClient.d.ts +16 -0
  27. package/dist/src/gen/chat/apis/ChannelTypesApi.d.ts +81 -0
  28. package/dist/src/gen/chat/apis/ChannelsApi.d.ts +308 -0
  29. package/dist/src/gen/chat/apis/CustomCommandsApi.d.ts +81 -0
  30. package/dist/src/gen/chat/apis/DefaultApi.d.ts +60 -0
  31. package/dist/src/gen/chat/apis/DevicesApi.d.ts +58 -0
  32. package/dist/src/gen/chat/apis/EventsApi.d.ts +64 -0
  33. package/dist/src/gen/chat/apis/FilesApi.d.ts +81 -0
  34. package/dist/src/gen/chat/apis/GDPRApi.d.ts +114 -0
  35. package/dist/src/gen/chat/apis/ImportsApi.d.ts +67 -0
  36. package/dist/src/gen/chat/apis/MessagesApi.d.ts +370 -0
  37. package/dist/src/gen/chat/apis/ModerationApi.d.ts +271 -0
  38. package/dist/src/gen/chat/apis/PermissionsV2Api.d.ts +77 -0
  39. package/dist/src/gen/chat/apis/PushApi.d.ts +65 -0
  40. package/dist/src/gen/chat/apis/ReactionsApi.d.ts +62 -0
  41. package/dist/src/gen/chat/apis/ServerSideApi.d.ts +31 -0
  42. package/dist/src/gen/chat/apis/SettingsApi.d.ts +257 -0
  43. package/dist/src/gen/chat/apis/TasksApi.d.ts +31 -0
  44. package/dist/src/gen/chat/apis/TestingApi.d.ts +57 -0
  45. package/dist/src/gen/chat/apis/UsersApi.d.ts +313 -0
  46. package/dist/src/gen/chat/apis/index.d.ts +19 -0
  47. package/dist/src/gen/chat/index.d.ts +3 -0
  48. package/dist/src/gen/chat/models/index.d.ts +15624 -0
  49. package/dist/src/gen/chat/runtime.d.ts +180 -0
  50. package/dist/src/gen/video/apis/DefaultApi.d.ts +505 -0
  51. package/dist/src/gen/video/apis/ServerSideApi.d.ts +81 -0
  52. package/dist/src/gen/video/apis/index.d.ts +2 -0
  53. package/dist/src/gen/video/index.d.ts +3 -0
  54. package/dist/src/gen/video/models/index.d.ts +4733 -0
  55. package/dist/src/gen/video/runtime.d.ts +180 -0
  56. package/dist/src/types.d.ts +1 -0
  57. package/dist/src/utils/create-token.d.ts +3 -0
  58. package/index.ts +7 -0
  59. package/package.json +47 -0
  60. package/src/StreamCall.ts +161 -0
  61. package/src/StreamChannel.ts +165 -0
  62. package/src/StreamChatClient.ts +102 -0
  63. package/src/StreamClient.ts +440 -0
  64. package/src/StreamVideoClient.ts +63 -0
  65. package/src/gen/chat/.openapi-generator/FILES +24 -0
  66. package/src/gen/chat/.openapi-generator/VERSION +1 -0
  67. package/src/gen/chat/.openapi-generator-ignore +23 -0
  68. package/src/gen/chat/apis/ChannelTypesApi.ts +275 -0
  69. package/src/gen/chat/apis/ChannelsApi.ts +1221 -0
  70. package/src/gen/chat/apis/CustomCommandsApi.ts +276 -0
  71. package/src/gen/chat/apis/DefaultApi.ts +196 -0
  72. package/src/gen/chat/apis/DevicesApi.ts +180 -0
  73. package/src/gen/chat/apis/EventsApi.ts +220 -0
  74. package/src/gen/chat/apis/FilesApi.ts +312 -0
  75. package/src/gen/chat/apis/GDPRApi.ts +418 -0
  76. package/src/gen/chat/apis/ImportsApi.ts +222 -0
  77. package/src/gen/chat/apis/MessagesApi.ts +1475 -0
  78. package/src/gen/chat/apis/ModerationApi.ts +1038 -0
  79. package/src/gen/chat/apis/PermissionsV2Api.ts +259 -0
  80. package/src/gen/chat/apis/PushApi.ts +183 -0
  81. package/src/gen/chat/apis/ReactionsApi.ts +202 -0
  82. package/src/gen/chat/apis/ServerSideApi.ts +79 -0
  83. package/src/gen/chat/apis/SettingsApi.ts +948 -0
  84. package/src/gen/chat/apis/TasksApi.ts +75 -0
  85. package/src/gen/chat/apis/TestingApi.ts +185 -0
  86. package/src/gen/chat/apis/UsersApi.ts +1203 -0
  87. package/src/gen/chat/apis/index.ts +30 -0
  88. package/src/gen/chat/index.ts +5 -0
  89. package/src/gen/chat/models/index.ts +15541 -0
  90. package/src/gen/chat/runtime.ts +415 -0
  91. package/src/gen/video/.openapi-generator/FILES +7 -0
  92. package/src/gen/video/.openapi-generator/VERSION +1 -0
  93. package/src/gen/video/.openapi-generator-ignore +23 -0
  94. package/src/gen/video/apis/DefaultApi.ts +1997 -0
  95. package/src/gen/video/apis/ServerSideApi.ts +276 -0
  96. package/src/gen/video/apis/index.ts +4 -0
  97. package/src/gen/video/index.ts +5 -0
  98. package/src/gen/video/models/index.ts +4642 -0
  99. package/src/gen/video/runtime.ts +415 -0
  100. package/src/types.ts +1 -0
  101. package/src/utils/create-token.ts +49 -0
@@ -0,0 +1,1221 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Stream Chat API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: v89.9.2
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ APIError,
19
+ ChannelGetOrCreateRequest,
20
+ ChannelStateResponse,
21
+ ChannelStopWatchingRequest,
22
+ ChannelsResponse,
23
+ DeleteChannelResponse,
24
+ DeleteChannelsRequest,
25
+ DeleteChannelsResponse,
26
+ ExportChannelsRequest,
27
+ ExportChannelsResponse,
28
+ GetExportChannelsStatusResponse,
29
+ HideChannelRequest,
30
+ HideChannelResponse,
31
+ MarkChannelsReadRequest,
32
+ MarkReadRequest,
33
+ MarkReadResponse,
34
+ MarkUnreadRequest,
35
+ MembersResponse,
36
+ MuteChannelRequest,
37
+ MuteChannelResponse,
38
+ QueryChannelsRequest,
39
+ QueryMembersRequest,
40
+ Response,
41
+ SearchRequest,
42
+ SearchResponse,
43
+ ShowChannelRequest,
44
+ ShowChannelResponse,
45
+ StopWatchingResponse,
46
+ SyncRequest,
47
+ SyncResponse,
48
+ TruncateChannelRequest,
49
+ TruncateChannelResponse,
50
+ UnmuteChannelRequest,
51
+ UnmuteResponse,
52
+ UpdateChannelPartialRequest,
53
+ UpdateChannelPartialResponse,
54
+ UpdateChannelRequest,
55
+ UpdateChannelResponse,
56
+ } from '../models';
57
+
58
+ export interface DeleteChannelRequest {
59
+ type: string;
60
+ id: string;
61
+ hardDelete?: boolean;
62
+ }
63
+
64
+ export interface DeleteChannelsOperationRequest {
65
+ deleteChannelsRequest: DeleteChannelsRequest | null;
66
+ }
67
+
68
+ export interface ExportChannelsOperationRequest {
69
+ exportChannelsRequest: ExportChannelsRequest | null;
70
+ }
71
+
72
+ export interface GetExportChannelsStatusRequest {
73
+ id: string;
74
+ }
75
+
76
+ export interface GetOrCreateChannelRequest {
77
+ type: string;
78
+ id: string;
79
+ channelGetOrCreateRequest: ChannelGetOrCreateRequest | null;
80
+ clientId?: string;
81
+ connectionId?: string;
82
+ }
83
+
84
+ export interface HideChannelOperationRequest {
85
+ type: string;
86
+ id: string;
87
+ hideChannelRequest: HideChannelRequest | null;
88
+ }
89
+
90
+ export interface MarkChannelsReadOperationRequest {
91
+ markChannelsReadRequest: MarkChannelsReadRequest | null;
92
+ }
93
+
94
+ export interface MarkReadOperationRequest {
95
+ type: string;
96
+ id: string;
97
+ markReadRequest: MarkReadRequest | null;
98
+ }
99
+
100
+ export interface MarkUnreadOperationRequest {
101
+ type: string;
102
+ id: string;
103
+ markUnreadRequest: MarkUnreadRequest | null;
104
+ }
105
+
106
+ export interface MuteChannelOperationRequest {
107
+ muteChannelRequest: MuteChannelRequest | null;
108
+ }
109
+
110
+ export interface QueryChannelsOperationRequest {
111
+ queryChannelsRequest: QueryChannelsRequest | null;
112
+ clientId?: string;
113
+ connectionId?: string;
114
+ }
115
+
116
+ export interface QueryMembersOperationRequest {
117
+ payload?: QueryMembersRequest;
118
+ }
119
+
120
+ export interface SearchOperationRequest {
121
+ payload?: SearchRequest;
122
+ }
123
+
124
+ export interface ShowChannelOperationRequest {
125
+ type: string;
126
+ id: string;
127
+ showChannelRequest: ShowChannelRequest | null;
128
+ }
129
+
130
+ export interface StopWatchingChannelRequest {
131
+ type: string;
132
+ id: string;
133
+ channelStopWatchingRequest: ChannelStopWatchingRequest | null;
134
+ clientId?: string;
135
+ connectionId?: string;
136
+ }
137
+
138
+ export interface SyncOperationRequest {
139
+ syncRequest: SyncRequest | null;
140
+ withInaccessibleCids?: boolean;
141
+ watch?: boolean;
142
+ clientId?: string;
143
+ connectionId?: string;
144
+ }
145
+
146
+ export interface TruncateChannelOperationRequest {
147
+ type: string;
148
+ id: string;
149
+ truncateChannelRequest: TruncateChannelRequest | null;
150
+ }
151
+
152
+ export interface UnmuteChannelOperationRequest {
153
+ unmuteChannelRequest: UnmuteChannelRequest | null;
154
+ }
155
+
156
+ export interface UpdateChannelOperationRequest {
157
+ type: string;
158
+ id: string;
159
+ updateChannelRequest: UpdateChannelRequest | null;
160
+ }
161
+
162
+ export interface UpdateChannelPartialOperationRequest {
163
+ type: string;
164
+ id: string;
165
+ updateChannelPartialRequest: UpdateChannelPartialRequest | null;
166
+ }
167
+
168
+ /**
169
+ *
170
+ */
171
+ export class ChannelsApi extends runtime.BaseAPI {
172
+
173
+ /**
174
+ * Deletes channel Sends events: - channel.deleted Required permissions: - DeleteChannel
175
+ * Delete channel
176
+ */
177
+ async deleteChannelRaw(requestParameters: DeleteChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DeleteChannelResponse>> {
178
+ if (requestParameters.type === null || requestParameters.type === undefined) {
179
+ throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteChannel.');
180
+ }
181
+
182
+ if (requestParameters.id === null || requestParameters.id === undefined) {
183
+ throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteChannel.');
184
+ }
185
+
186
+ const queryParameters: any = {};
187
+
188
+ if (requestParameters.hardDelete !== undefined) {
189
+ queryParameters['hard_delete'] = requestParameters.hardDelete;
190
+ }
191
+
192
+ const headerParameters: runtime.HTTPHeaders = {};
193
+
194
+ if (this.configuration && this.configuration.apiKey) {
195
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
196
+ }
197
+
198
+ if (this.configuration && this.configuration.apiKey) {
199
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
200
+ }
201
+
202
+ if (this.configuration && this.configuration.apiKey) {
203
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
204
+ }
205
+
206
+ const response = await this.request({
207
+ path: `/channels/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
208
+ method: 'DELETE',
209
+ headers: headerParameters,
210
+ query: queryParameters,
211
+ }, initOverrides);
212
+
213
+ return new runtime.JSONApiResponse(response);
214
+ }
215
+
216
+ /**
217
+ * Deletes channel Sends events: - channel.deleted Required permissions: - DeleteChannel
218
+ * Delete channel
219
+ */
220
+ async deleteChannel(requestParameters: DeleteChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeleteChannelResponse> {
221
+ const response = await this.deleteChannelRaw(requestParameters, initOverrides);
222
+ return await response.value();
223
+ }
224
+
225
+ /**
226
+ * Allows to delete several channels at once asynchronously Sends events: - channel.deleted Required permissions: - DeleteChannel
227
+ * Deletes channels asynchronously
228
+ */
229
+ async deleteChannelsRaw(requestParameters: DeleteChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DeleteChannelsResponse>> {
230
+ if (requestParameters.deleteChannelsRequest === null || requestParameters.deleteChannelsRequest === undefined) {
231
+ throw new runtime.RequiredError('deleteChannelsRequest','Required parameter requestParameters.deleteChannelsRequest was null or undefined when calling deleteChannels.');
232
+ }
233
+
234
+ const queryParameters: any = {};
235
+
236
+ const headerParameters: runtime.HTTPHeaders = {};
237
+
238
+ headerParameters['Content-Type'] = 'application/json';
239
+
240
+ if (this.configuration && this.configuration.apiKey) {
241
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
242
+ }
243
+
244
+ if (this.configuration && this.configuration.apiKey) {
245
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
246
+ }
247
+
248
+ if (this.configuration && this.configuration.apiKey) {
249
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
250
+ }
251
+
252
+ const response = await this.request({
253
+ path: `/channels/delete`,
254
+ method: 'POST',
255
+ headers: headerParameters,
256
+ query: queryParameters,
257
+ body: requestParameters.deleteChannelsRequest,
258
+ }, initOverrides);
259
+
260
+ return new runtime.JSONApiResponse(response);
261
+ }
262
+
263
+ /**
264
+ * Allows to delete several channels at once asynchronously Sends events: - channel.deleted Required permissions: - DeleteChannel
265
+ * Deletes channels asynchronously
266
+ */
267
+ async deleteChannels(requestParameters: DeleteChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeleteChannelsResponse> {
268
+ const response = await this.deleteChannelsRaw(requestParameters, initOverrides);
269
+ return await response.value();
270
+ }
271
+
272
+ /**
273
+ * Exports channel data to JSON file
274
+ * Export channels
275
+ */
276
+ async exportChannelsRaw(requestParameters: ExportChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ExportChannelsResponse>> {
277
+ if (requestParameters.exportChannelsRequest === null || requestParameters.exportChannelsRequest === undefined) {
278
+ throw new runtime.RequiredError('exportChannelsRequest','Required parameter requestParameters.exportChannelsRequest was null or undefined when calling exportChannels.');
279
+ }
280
+
281
+ const queryParameters: any = {};
282
+
283
+ const headerParameters: runtime.HTTPHeaders = {};
284
+
285
+ headerParameters['Content-Type'] = 'application/json';
286
+
287
+ if (this.configuration && this.configuration.apiKey) {
288
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
289
+ }
290
+
291
+ if (this.configuration && this.configuration.apiKey) {
292
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
293
+ }
294
+
295
+ if (this.configuration && this.configuration.apiKey) {
296
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
297
+ }
298
+
299
+ const response = await this.request({
300
+ path: `/export_channels`,
301
+ method: 'POST',
302
+ headers: headerParameters,
303
+ query: queryParameters,
304
+ body: requestParameters.exportChannelsRequest,
305
+ }, initOverrides);
306
+
307
+ return new runtime.JSONApiResponse(response);
308
+ }
309
+
310
+ /**
311
+ * Exports channel data to JSON file
312
+ * Export channels
313
+ */
314
+ async exportChannels(requestParameters: ExportChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ExportChannelsResponse> {
315
+ const response = await this.exportChannelsRaw(requestParameters, initOverrides);
316
+ return await response.value();
317
+ }
318
+
319
+ /**
320
+ *
321
+ * Export channels status
322
+ */
323
+ async getExportChannelsStatusRaw(requestParameters: GetExportChannelsStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetExportChannelsStatusResponse>> {
324
+ if (requestParameters.id === null || requestParameters.id === undefined) {
325
+ throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getExportChannelsStatus.');
326
+ }
327
+
328
+ const queryParameters: any = {};
329
+
330
+ const headerParameters: runtime.HTTPHeaders = {};
331
+
332
+ if (this.configuration && this.configuration.apiKey) {
333
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
334
+ }
335
+
336
+ if (this.configuration && this.configuration.apiKey) {
337
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
338
+ }
339
+
340
+ if (this.configuration && this.configuration.apiKey) {
341
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
342
+ }
343
+
344
+ const response = await this.request({
345
+ path: `/export_channels/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
346
+ method: 'GET',
347
+ headers: headerParameters,
348
+ query: queryParameters,
349
+ }, initOverrides);
350
+
351
+ return new runtime.JSONApiResponse(response);
352
+ }
353
+
354
+ /**
355
+ *
356
+ * Export channels status
357
+ */
358
+ async getExportChannelsStatus(requestParameters: GetExportChannelsStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetExportChannelsStatusResponse> {
359
+ const response = await this.getExportChannelsStatusRaw(requestParameters, initOverrides);
360
+ return await response.value();
361
+ }
362
+
363
+ /**
364
+ * This method creates a channel or returns an existing one with matching attributes Sends events: - channel.created - member.added - member.removed - member.updated - user.watching.start
365
+ * Get or create channel
366
+ */
367
+ async getOrCreateChannelRaw(requestParameters: GetOrCreateChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChannelStateResponse>> {
368
+ if (requestParameters.type === null || requestParameters.type === undefined) {
369
+ throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling getOrCreateChannel.');
370
+ }
371
+
372
+ if (requestParameters.id === null || requestParameters.id === undefined) {
373
+ throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getOrCreateChannel.');
374
+ }
375
+
376
+ if (requestParameters.channelGetOrCreateRequest === null || requestParameters.channelGetOrCreateRequest === undefined) {
377
+ throw new runtime.RequiredError('channelGetOrCreateRequest','Required parameter requestParameters.channelGetOrCreateRequest was null or undefined when calling getOrCreateChannel.');
378
+ }
379
+
380
+ const queryParameters: any = {};
381
+
382
+ if (requestParameters.clientId !== undefined) {
383
+ queryParameters['client_id'] = requestParameters.clientId;
384
+ }
385
+
386
+ if (requestParameters.connectionId !== undefined) {
387
+ queryParameters['connection_id'] = requestParameters.connectionId;
388
+ }
389
+
390
+ const headerParameters: runtime.HTTPHeaders = {};
391
+
392
+ headerParameters['Content-Type'] = 'application/json';
393
+
394
+ if (this.configuration && this.configuration.apiKey) {
395
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
396
+ }
397
+
398
+ if (this.configuration && this.configuration.apiKey) {
399
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
400
+ }
401
+
402
+ if (this.configuration && this.configuration.apiKey) {
403
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
404
+ }
405
+
406
+ const response = await this.request({
407
+ path: `/channels/{type}/{id}/query`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
408
+ method: 'POST',
409
+ headers: headerParameters,
410
+ query: queryParameters,
411
+ body: requestParameters.channelGetOrCreateRequest,
412
+ }, initOverrides);
413
+
414
+ return new runtime.JSONApiResponse(response);
415
+ }
416
+
417
+ /**
418
+ * This method creates a channel or returns an existing one with matching attributes Sends events: - channel.created - member.added - member.removed - member.updated - user.watching.start
419
+ * Get or create channel
420
+ */
421
+ async getOrCreateChannel(requestParameters: GetOrCreateChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChannelStateResponse> {
422
+ const response = await this.getOrCreateChannelRaw(requestParameters, initOverrides);
423
+ return await response.value();
424
+ }
425
+
426
+ /**
427
+ * Marks channel as hidden for current user Sends events: - channel.hidden Required permissions: - ReadChannel
428
+ * Hide channel
429
+ */
430
+ async hideChannelRaw(requestParameters: HideChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HideChannelResponse>> {
431
+ if (requestParameters.type === null || requestParameters.type === undefined) {
432
+ throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling hideChannel.');
433
+ }
434
+
435
+ if (requestParameters.id === null || requestParameters.id === undefined) {
436
+ throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling hideChannel.');
437
+ }
438
+
439
+ if (requestParameters.hideChannelRequest === null || requestParameters.hideChannelRequest === undefined) {
440
+ throw new runtime.RequiredError('hideChannelRequest','Required parameter requestParameters.hideChannelRequest was null or undefined when calling hideChannel.');
441
+ }
442
+
443
+ const queryParameters: any = {};
444
+
445
+ const headerParameters: runtime.HTTPHeaders = {};
446
+
447
+ headerParameters['Content-Type'] = 'application/json';
448
+
449
+ if (this.configuration && this.configuration.apiKey) {
450
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
451
+ }
452
+
453
+ if (this.configuration && this.configuration.apiKey) {
454
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
455
+ }
456
+
457
+ if (this.configuration && this.configuration.apiKey) {
458
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
459
+ }
460
+
461
+ const response = await this.request({
462
+ path: `/channels/{type}/{id}/hide`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
463
+ method: 'POST',
464
+ headers: headerParameters,
465
+ query: queryParameters,
466
+ body: requestParameters.hideChannelRequest,
467
+ }, initOverrides);
468
+
469
+ return new runtime.JSONApiResponse(response);
470
+ }
471
+
472
+ /**
473
+ * Marks channel as hidden for current user Sends events: - channel.hidden Required permissions: - ReadChannel
474
+ * Hide channel
475
+ */
476
+ async hideChannel(requestParameters: HideChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HideChannelResponse> {
477
+ const response = await this.hideChannelRaw(requestParameters, initOverrides);
478
+ return await response.value();
479
+ }
480
+
481
+ /**
482
+ * Marks channels as read up to the specific message. If no channels is given, mark all channel as read Sends events: - message.read Required permissions: - ReadChannel
483
+ * Mark channels as read
484
+ */
485
+ async markChannelsReadRaw(requestParameters: MarkChannelsReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MarkReadResponse>> {
486
+ if (requestParameters.markChannelsReadRequest === null || requestParameters.markChannelsReadRequest === undefined) {
487
+ throw new runtime.RequiredError('markChannelsReadRequest','Required parameter requestParameters.markChannelsReadRequest was null or undefined when calling markChannelsRead.');
488
+ }
489
+
490
+ const queryParameters: any = {};
491
+
492
+ const headerParameters: runtime.HTTPHeaders = {};
493
+
494
+ headerParameters['Content-Type'] = 'application/json';
495
+
496
+ if (this.configuration && this.configuration.apiKey) {
497
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
498
+ }
499
+
500
+ if (this.configuration && this.configuration.apiKey) {
501
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
502
+ }
503
+
504
+ if (this.configuration && this.configuration.apiKey) {
505
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
506
+ }
507
+
508
+ const response = await this.request({
509
+ path: `/channels/read`,
510
+ method: 'POST',
511
+ headers: headerParameters,
512
+ query: queryParameters,
513
+ body: requestParameters.markChannelsReadRequest,
514
+ }, initOverrides);
515
+
516
+ return new runtime.JSONApiResponse(response);
517
+ }
518
+
519
+ /**
520
+ * Marks channels as read up to the specific message. If no channels is given, mark all channel as read Sends events: - message.read Required permissions: - ReadChannel
521
+ * Mark channels as read
522
+ */
523
+ async markChannelsRead(requestParameters: MarkChannelsReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MarkReadResponse> {
524
+ const response = await this.markChannelsReadRaw(requestParameters, initOverrides);
525
+ return await response.value();
526
+ }
527
+
528
+ /**
529
+ * Marks channel as read up to the specific message Sends events: - message.read Required permissions: - ReadChannel
530
+ * Mark read
531
+ */
532
+ async markReadRaw(requestParameters: MarkReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MarkReadResponse>> {
533
+ if (requestParameters.type === null || requestParameters.type === undefined) {
534
+ throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling markRead.');
535
+ }
536
+
537
+ if (requestParameters.id === null || requestParameters.id === undefined) {
538
+ throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling markRead.');
539
+ }
540
+
541
+ if (requestParameters.markReadRequest === null || requestParameters.markReadRequest === undefined) {
542
+ throw new runtime.RequiredError('markReadRequest','Required parameter requestParameters.markReadRequest was null or undefined when calling markRead.');
543
+ }
544
+
545
+ const queryParameters: any = {};
546
+
547
+ const headerParameters: runtime.HTTPHeaders = {};
548
+
549
+ headerParameters['Content-Type'] = 'application/json';
550
+
551
+ if (this.configuration && this.configuration.apiKey) {
552
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
553
+ }
554
+
555
+ if (this.configuration && this.configuration.apiKey) {
556
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
557
+ }
558
+
559
+ if (this.configuration && this.configuration.apiKey) {
560
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
561
+ }
562
+
563
+ const response = await this.request({
564
+ path: `/channels/{type}/{id}/read`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
565
+ method: 'POST',
566
+ headers: headerParameters,
567
+ query: queryParameters,
568
+ body: requestParameters.markReadRequest,
569
+ }, initOverrides);
570
+
571
+ return new runtime.JSONApiResponse(response);
572
+ }
573
+
574
+ /**
575
+ * Marks channel as read up to the specific message Sends events: - message.read Required permissions: - ReadChannel
576
+ * Mark read
577
+ */
578
+ async markRead(requestParameters: MarkReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MarkReadResponse> {
579
+ const response = await this.markReadRaw(requestParameters, initOverrides);
580
+ return await response.value();
581
+ }
582
+
583
+ /**
584
+ * Marks channel as unread from a specific message Required permissions: - ReadChannel
585
+ * Mark unread
586
+ */
587
+ async markUnreadRaw(requestParameters: MarkUnreadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Response>> {
588
+ if (requestParameters.type === null || requestParameters.type === undefined) {
589
+ throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling markUnread.');
590
+ }
591
+
592
+ if (requestParameters.id === null || requestParameters.id === undefined) {
593
+ throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling markUnread.');
594
+ }
595
+
596
+ if (requestParameters.markUnreadRequest === null || requestParameters.markUnreadRequest === undefined) {
597
+ throw new runtime.RequiredError('markUnreadRequest','Required parameter requestParameters.markUnreadRequest was null or undefined when calling markUnread.');
598
+ }
599
+
600
+ const queryParameters: any = {};
601
+
602
+ const headerParameters: runtime.HTTPHeaders = {};
603
+
604
+ headerParameters['Content-Type'] = 'application/json';
605
+
606
+ if (this.configuration && this.configuration.apiKey) {
607
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
608
+ }
609
+
610
+ if (this.configuration && this.configuration.apiKey) {
611
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
612
+ }
613
+
614
+ if (this.configuration && this.configuration.apiKey) {
615
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
616
+ }
617
+
618
+ const response = await this.request({
619
+ path: `/channels/{type}/{id}/unread`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
620
+ method: 'POST',
621
+ headers: headerParameters,
622
+ query: queryParameters,
623
+ body: requestParameters.markUnreadRequest,
624
+ }, initOverrides);
625
+
626
+ return new runtime.JSONApiResponse(response);
627
+ }
628
+
629
+ /**
630
+ * Marks channel as unread from a specific message Required permissions: - ReadChannel
631
+ * Mark unread
632
+ */
633
+ async markUnread(requestParameters: MarkUnreadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Response> {
634
+ const response = await this.markUnreadRaw(requestParameters, initOverrides);
635
+ return await response.value();
636
+ }
637
+
638
+ /**
639
+ * Mutes channel for user Sends events: - channel.muted Required permissions: - MuteChannel
640
+ * Mute channel
641
+ */
642
+ async muteChannelRaw(requestParameters: MuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MuteChannelResponse>> {
643
+ if (requestParameters.muteChannelRequest === null || requestParameters.muteChannelRequest === undefined) {
644
+ throw new runtime.RequiredError('muteChannelRequest','Required parameter requestParameters.muteChannelRequest was null or undefined when calling muteChannel.');
645
+ }
646
+
647
+ const queryParameters: any = {};
648
+
649
+ const headerParameters: runtime.HTTPHeaders = {};
650
+
651
+ headerParameters['Content-Type'] = 'application/json';
652
+
653
+ if (this.configuration && this.configuration.apiKey) {
654
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
655
+ }
656
+
657
+ if (this.configuration && this.configuration.apiKey) {
658
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
659
+ }
660
+
661
+ if (this.configuration && this.configuration.apiKey) {
662
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
663
+ }
664
+
665
+ const response = await this.request({
666
+ path: `/moderation/mute/channel`,
667
+ method: 'POST',
668
+ headers: headerParameters,
669
+ query: queryParameters,
670
+ body: requestParameters.muteChannelRequest,
671
+ }, initOverrides);
672
+
673
+ return new runtime.JSONApiResponse(response);
674
+ }
675
+
676
+ /**
677
+ * Mutes channel for user Sends events: - channel.muted Required permissions: - MuteChannel
678
+ * Mute channel
679
+ */
680
+ async muteChannel(requestParameters: MuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MuteChannelResponse> {
681
+ const response = await this.muteChannelRaw(requestParameters, initOverrides);
682
+ return await response.value();
683
+ }
684
+
685
+ /**
686
+ * Query channels with filter query Required permissions: - ReadChannel
687
+ * Query channels
688
+ */
689
+ async queryChannelsRaw(requestParameters: QueryChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChannelsResponse>> {
690
+ if (requestParameters.queryChannelsRequest === null || requestParameters.queryChannelsRequest === undefined) {
691
+ throw new runtime.RequiredError('queryChannelsRequest','Required parameter requestParameters.queryChannelsRequest was null or undefined when calling queryChannels.');
692
+ }
693
+
694
+ const queryParameters: any = {};
695
+
696
+ if (requestParameters.clientId !== undefined) {
697
+ queryParameters['client_id'] = requestParameters.clientId;
698
+ }
699
+
700
+ if (requestParameters.connectionId !== undefined) {
701
+ queryParameters['connection_id'] = requestParameters.connectionId;
702
+ }
703
+
704
+ const headerParameters: runtime.HTTPHeaders = {};
705
+
706
+ headerParameters['Content-Type'] = 'application/json';
707
+
708
+ if (this.configuration && this.configuration.apiKey) {
709
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
710
+ }
711
+
712
+ if (this.configuration && this.configuration.apiKey) {
713
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
714
+ }
715
+
716
+ if (this.configuration && this.configuration.apiKey) {
717
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
718
+ }
719
+
720
+ const response = await this.request({
721
+ path: `/channels`,
722
+ method: 'POST',
723
+ headers: headerParameters,
724
+ query: queryParameters,
725
+ body: requestParameters.queryChannelsRequest,
726
+ }, initOverrides);
727
+
728
+ return new runtime.JSONApiResponse(response);
729
+ }
730
+
731
+ /**
732
+ * Query channels with filter query Required permissions: - ReadChannel
733
+ * Query channels
734
+ */
735
+ async queryChannels(requestParameters: QueryChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChannelsResponse> {
736
+ const response = await this.queryChannelsRaw(requestParameters, initOverrides);
737
+ return await response.value();
738
+ }
739
+
740
+ /**
741
+ * Find and filter channel members Required permissions: - ReadChannel
742
+ * Query members
743
+ */
744
+ async queryMembersRaw(requestParameters: QueryMembersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MembersResponse>> {
745
+ const queryParameters: any = {};
746
+
747
+ if (requestParameters.payload !== undefined) {
748
+ queryParameters['payload'] = requestParameters.payload;
749
+ }
750
+
751
+ const headerParameters: runtime.HTTPHeaders = {};
752
+
753
+ if (this.configuration && this.configuration.apiKey) {
754
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
755
+ }
756
+
757
+ if (this.configuration && this.configuration.apiKey) {
758
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
759
+ }
760
+
761
+ if (this.configuration && this.configuration.apiKey) {
762
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
763
+ }
764
+
765
+ const response = await this.request({
766
+ path: `/members`,
767
+ method: 'GET',
768
+ headers: headerParameters,
769
+ query: queryParameters,
770
+ }, initOverrides);
771
+
772
+ return new runtime.JSONApiResponse(response);
773
+ }
774
+
775
+ /**
776
+ * Find and filter channel members Required permissions: - ReadChannel
777
+ * Query members
778
+ */
779
+ async queryMembers(requestParameters: QueryMembersOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MembersResponse> {
780
+ const response = await this.queryMembersRaw(requestParameters, initOverrides);
781
+ return await response.value();
782
+ }
783
+
784
+ /**
785
+ * Search messages across channels Required permissions: - ReadChannel
786
+ * Search messages
787
+ */
788
+ async searchRaw(requestParameters: SearchOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchResponse>> {
789
+ const queryParameters: any = {};
790
+
791
+ if (requestParameters.payload !== undefined) {
792
+ queryParameters['payload'] = requestParameters.payload;
793
+ }
794
+
795
+ const headerParameters: runtime.HTTPHeaders = {};
796
+
797
+ if (this.configuration && this.configuration.apiKey) {
798
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
799
+ }
800
+
801
+ if (this.configuration && this.configuration.apiKey) {
802
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
803
+ }
804
+
805
+ if (this.configuration && this.configuration.apiKey) {
806
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
807
+ }
808
+
809
+ const response = await this.request({
810
+ path: `/search`,
811
+ method: 'GET',
812
+ headers: headerParameters,
813
+ query: queryParameters,
814
+ }, initOverrides);
815
+
816
+ return new runtime.JSONApiResponse(response);
817
+ }
818
+
819
+ /**
820
+ * Search messages across channels Required permissions: - ReadChannel
821
+ * Search messages
822
+ */
823
+ async search(requestParameters: SearchOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchResponse> {
824
+ const response = await this.searchRaw(requestParameters, initOverrides);
825
+ return await response.value();
826
+ }
827
+
828
+ /**
829
+ * Shows previously hidden channel Sends events: - channel.visible
830
+ * Show channel
831
+ */
832
+ async showChannelRaw(requestParameters: ShowChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ShowChannelResponse>> {
833
+ if (requestParameters.type === null || requestParameters.type === undefined) {
834
+ throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling showChannel.');
835
+ }
836
+
837
+ if (requestParameters.id === null || requestParameters.id === undefined) {
838
+ throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling showChannel.');
839
+ }
840
+
841
+ if (requestParameters.showChannelRequest === null || requestParameters.showChannelRequest === undefined) {
842
+ throw new runtime.RequiredError('showChannelRequest','Required parameter requestParameters.showChannelRequest was null or undefined when calling showChannel.');
843
+ }
844
+
845
+ const queryParameters: any = {};
846
+
847
+ const headerParameters: runtime.HTTPHeaders = {};
848
+
849
+ headerParameters['Content-Type'] = 'application/json';
850
+
851
+ if (this.configuration && this.configuration.apiKey) {
852
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
853
+ }
854
+
855
+ if (this.configuration && this.configuration.apiKey) {
856
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
857
+ }
858
+
859
+ if (this.configuration && this.configuration.apiKey) {
860
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
861
+ }
862
+
863
+ const response = await this.request({
864
+ path: `/channels/{type}/{id}/show`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
865
+ method: 'POST',
866
+ headers: headerParameters,
867
+ query: queryParameters,
868
+ body: requestParameters.showChannelRequest,
869
+ }, initOverrides);
870
+
871
+ return new runtime.JSONApiResponse(response);
872
+ }
873
+
874
+ /**
875
+ * Shows previously hidden channel Sends events: - channel.visible
876
+ * Show channel
877
+ */
878
+ async showChannel(requestParameters: ShowChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ShowChannelResponse> {
879
+ const response = await this.showChannelRaw(requestParameters, initOverrides);
880
+ return await response.value();
881
+ }
882
+
883
+ /**
884
+ * Call this method to stop receiving channel events Sends events: - user.watching.stop
885
+ * Stop watching channel
886
+ */
887
+ async stopWatchingChannelRaw(requestParameters: StopWatchingChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StopWatchingResponse>> {
888
+ if (requestParameters.type === null || requestParameters.type === undefined) {
889
+ throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling stopWatchingChannel.');
890
+ }
891
+
892
+ if (requestParameters.id === null || requestParameters.id === undefined) {
893
+ throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling stopWatchingChannel.');
894
+ }
895
+
896
+ if (requestParameters.channelStopWatchingRequest === null || requestParameters.channelStopWatchingRequest === undefined) {
897
+ throw new runtime.RequiredError('channelStopWatchingRequest','Required parameter requestParameters.channelStopWatchingRequest was null or undefined when calling stopWatchingChannel.');
898
+ }
899
+
900
+ const queryParameters: any = {};
901
+
902
+ if (requestParameters.clientId !== undefined) {
903
+ queryParameters['client_id'] = requestParameters.clientId;
904
+ }
905
+
906
+ if (requestParameters.connectionId !== undefined) {
907
+ queryParameters['connection_id'] = requestParameters.connectionId;
908
+ }
909
+
910
+ const headerParameters: runtime.HTTPHeaders = {};
911
+
912
+ headerParameters['Content-Type'] = 'application/json';
913
+
914
+ if (this.configuration && this.configuration.apiKey) {
915
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
916
+ }
917
+
918
+ if (this.configuration && this.configuration.apiKey) {
919
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
920
+ }
921
+
922
+ if (this.configuration && this.configuration.apiKey) {
923
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
924
+ }
925
+
926
+ const response = await this.request({
927
+ path: `/channels/{type}/{id}/stop-watching`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
928
+ method: 'POST',
929
+ headers: headerParameters,
930
+ query: queryParameters,
931
+ body: requestParameters.channelStopWatchingRequest,
932
+ }, initOverrides);
933
+
934
+ return new runtime.JSONApiResponse(response);
935
+ }
936
+
937
+ /**
938
+ * Call this method to stop receiving channel events Sends events: - user.watching.stop
939
+ * Stop watching channel
940
+ */
941
+ async stopWatchingChannel(requestParameters: StopWatchingChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StopWatchingResponse> {
942
+ const response = await this.stopWatchingChannelRaw(requestParameters, initOverrides);
943
+ return await response.value();
944
+ }
945
+
946
+ /**
947
+ * Returns all events happened since client disconnect in specified channels Required permissions: - ReadChannel
948
+ * Sync
949
+ */
950
+ async syncRaw(requestParameters: SyncOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SyncResponse>> {
951
+ if (requestParameters.syncRequest === null || requestParameters.syncRequest === undefined) {
952
+ throw new runtime.RequiredError('syncRequest','Required parameter requestParameters.syncRequest was null or undefined when calling sync.');
953
+ }
954
+
955
+ const queryParameters: any = {};
956
+
957
+ if (requestParameters.withInaccessibleCids !== undefined) {
958
+ queryParameters['with_inaccessible_cids'] = requestParameters.withInaccessibleCids;
959
+ }
960
+
961
+ if (requestParameters.watch !== undefined) {
962
+ queryParameters['watch'] = requestParameters.watch;
963
+ }
964
+
965
+ if (requestParameters.clientId !== undefined) {
966
+ queryParameters['client_id'] = requestParameters.clientId;
967
+ }
968
+
969
+ if (requestParameters.connectionId !== undefined) {
970
+ queryParameters['connection_id'] = requestParameters.connectionId;
971
+ }
972
+
973
+ const headerParameters: runtime.HTTPHeaders = {};
974
+
975
+ headerParameters['Content-Type'] = 'application/json';
976
+
977
+ if (this.configuration && this.configuration.apiKey) {
978
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
979
+ }
980
+
981
+ if (this.configuration && this.configuration.apiKey) {
982
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
983
+ }
984
+
985
+ if (this.configuration && this.configuration.apiKey) {
986
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
987
+ }
988
+
989
+ const response = await this.request({
990
+ path: `/sync`,
991
+ method: 'POST',
992
+ headers: headerParameters,
993
+ query: queryParameters,
994
+ body: requestParameters.syncRequest,
995
+ }, initOverrides);
996
+
997
+ return new runtime.JSONApiResponse(response);
998
+ }
999
+
1000
+ /**
1001
+ * Returns all events happened since client disconnect in specified channels Required permissions: - ReadChannel
1002
+ * Sync
1003
+ */
1004
+ async sync(requestParameters: SyncOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SyncResponse> {
1005
+ const response = await this.syncRaw(requestParameters, initOverrides);
1006
+ return await response.value();
1007
+ }
1008
+
1009
+ /**
1010
+ * Truncates channel Sends events: - channel.truncated Required permissions: - DeleteChannel - TruncateChannel
1011
+ * Truncate channel
1012
+ */
1013
+ async truncateChannelRaw(requestParameters: TruncateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TruncateChannelResponse>> {
1014
+ if (requestParameters.type === null || requestParameters.type === undefined) {
1015
+ throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling truncateChannel.');
1016
+ }
1017
+
1018
+ if (requestParameters.id === null || requestParameters.id === undefined) {
1019
+ throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling truncateChannel.');
1020
+ }
1021
+
1022
+ if (requestParameters.truncateChannelRequest === null || requestParameters.truncateChannelRequest === undefined) {
1023
+ throw new runtime.RequiredError('truncateChannelRequest','Required parameter requestParameters.truncateChannelRequest was null or undefined when calling truncateChannel.');
1024
+ }
1025
+
1026
+ const queryParameters: any = {};
1027
+
1028
+ const headerParameters: runtime.HTTPHeaders = {};
1029
+
1030
+ headerParameters['Content-Type'] = 'application/json';
1031
+
1032
+ if (this.configuration && this.configuration.apiKey) {
1033
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
1034
+ }
1035
+
1036
+ if (this.configuration && this.configuration.apiKey) {
1037
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
1038
+ }
1039
+
1040
+ if (this.configuration && this.configuration.apiKey) {
1041
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
1042
+ }
1043
+
1044
+ const response = await this.request({
1045
+ path: `/channels/{type}/{id}/truncate`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
1046
+ method: 'POST',
1047
+ headers: headerParameters,
1048
+ query: queryParameters,
1049
+ body: requestParameters.truncateChannelRequest,
1050
+ }, initOverrides);
1051
+
1052
+ return new runtime.JSONApiResponse(response);
1053
+ }
1054
+
1055
+ /**
1056
+ * Truncates channel Sends events: - channel.truncated Required permissions: - DeleteChannel - TruncateChannel
1057
+ * Truncate channel
1058
+ */
1059
+ async truncateChannel(requestParameters: TruncateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TruncateChannelResponse> {
1060
+ const response = await this.truncateChannelRaw(requestParameters, initOverrides);
1061
+ return await response.value();
1062
+ }
1063
+
1064
+ /**
1065
+ * Unmutes channel for user Sends events: - channel.unmuted Required permissions: - MuteChannel
1066
+ * Unmute channel
1067
+ */
1068
+ async unmuteChannelRaw(requestParameters: UnmuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UnmuteResponse>> {
1069
+ if (requestParameters.unmuteChannelRequest === null || requestParameters.unmuteChannelRequest === undefined) {
1070
+ throw new runtime.RequiredError('unmuteChannelRequest','Required parameter requestParameters.unmuteChannelRequest was null or undefined when calling unmuteChannel.');
1071
+ }
1072
+
1073
+ const queryParameters: any = {};
1074
+
1075
+ const headerParameters: runtime.HTTPHeaders = {};
1076
+
1077
+ headerParameters['Content-Type'] = 'application/json';
1078
+
1079
+ if (this.configuration && this.configuration.apiKey) {
1080
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
1081
+ }
1082
+
1083
+ if (this.configuration && this.configuration.apiKey) {
1084
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
1085
+ }
1086
+
1087
+ if (this.configuration && this.configuration.apiKey) {
1088
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
1089
+ }
1090
+
1091
+ const response = await this.request({
1092
+ path: `/moderation/unmute/channel`,
1093
+ method: 'POST',
1094
+ headers: headerParameters,
1095
+ query: queryParameters,
1096
+ body: requestParameters.unmuteChannelRequest,
1097
+ }, initOverrides);
1098
+
1099
+ return new runtime.JSONApiResponse(response);
1100
+ }
1101
+
1102
+ /**
1103
+ * Unmutes channel for user Sends events: - channel.unmuted Required permissions: - MuteChannel
1104
+ * Unmute channel
1105
+ */
1106
+ async unmuteChannel(requestParameters: UnmuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UnmuteResponse> {
1107
+ const response = await this.unmuteChannelRaw(requestParameters, initOverrides);
1108
+ return await response.value();
1109
+ }
1110
+
1111
+ /**
1112
+ * Change channel data Sends events: - channel.updated - member.added - member.removed - member.updated - message.new Required permissions: - AddOwnChannelMembership - RemoveOwnChannelMembership - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen - UpdateChannelMembers
1113
+ * Update channel
1114
+ */
1115
+ async updateChannelRaw(requestParameters: UpdateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UpdateChannelResponse>> {
1116
+ if (requestParameters.type === null || requestParameters.type === undefined) {
1117
+ throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling updateChannel.');
1118
+ }
1119
+
1120
+ if (requestParameters.id === null || requestParameters.id === undefined) {
1121
+ throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateChannel.');
1122
+ }
1123
+
1124
+ if (requestParameters.updateChannelRequest === null || requestParameters.updateChannelRequest === undefined) {
1125
+ throw new runtime.RequiredError('updateChannelRequest','Required parameter requestParameters.updateChannelRequest was null or undefined when calling updateChannel.');
1126
+ }
1127
+
1128
+ const queryParameters: any = {};
1129
+
1130
+ const headerParameters: runtime.HTTPHeaders = {};
1131
+
1132
+ headerParameters['Content-Type'] = 'application/json';
1133
+
1134
+ if (this.configuration && this.configuration.apiKey) {
1135
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
1136
+ }
1137
+
1138
+ if (this.configuration && this.configuration.apiKey) {
1139
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
1140
+ }
1141
+
1142
+ if (this.configuration && this.configuration.apiKey) {
1143
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
1144
+ }
1145
+
1146
+ const response = await this.request({
1147
+ path: `/channels/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
1148
+ method: 'POST',
1149
+ headers: headerParameters,
1150
+ query: queryParameters,
1151
+ body: requestParameters.updateChannelRequest,
1152
+ }, initOverrides);
1153
+
1154
+ return new runtime.JSONApiResponse(response);
1155
+ }
1156
+
1157
+ /**
1158
+ * Change channel data Sends events: - channel.updated - member.added - member.removed - member.updated - message.new Required permissions: - AddOwnChannelMembership - RemoveOwnChannelMembership - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen - UpdateChannelMembers
1159
+ * Update channel
1160
+ */
1161
+ async updateChannel(requestParameters: UpdateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateChannelResponse> {
1162
+ const response = await this.updateChannelRaw(requestParameters, initOverrides);
1163
+ return await response.value();
1164
+ }
1165
+
1166
+ /**
1167
+ * Updates certain fields of the channel Sends events: - channel.updated Required permissions: - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen
1168
+ * Partially update channel
1169
+ */
1170
+ async updateChannelPartialRaw(requestParameters: UpdateChannelPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UpdateChannelPartialResponse>> {
1171
+ if (requestParameters.type === null || requestParameters.type === undefined) {
1172
+ throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling updateChannelPartial.');
1173
+ }
1174
+
1175
+ if (requestParameters.id === null || requestParameters.id === undefined) {
1176
+ throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateChannelPartial.');
1177
+ }
1178
+
1179
+ if (requestParameters.updateChannelPartialRequest === null || requestParameters.updateChannelPartialRequest === undefined) {
1180
+ throw new runtime.RequiredError('updateChannelPartialRequest','Required parameter requestParameters.updateChannelPartialRequest was null or undefined when calling updateChannelPartial.');
1181
+ }
1182
+
1183
+ const queryParameters: any = {};
1184
+
1185
+ const headerParameters: runtime.HTTPHeaders = {};
1186
+
1187
+ headerParameters['Content-Type'] = 'application/json';
1188
+
1189
+ if (this.configuration && this.configuration.apiKey) {
1190
+ headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
1191
+ }
1192
+
1193
+ if (this.configuration && this.configuration.apiKey) {
1194
+ queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
1195
+ }
1196
+
1197
+ if (this.configuration && this.configuration.apiKey) {
1198
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
1199
+ }
1200
+
1201
+ const response = await this.request({
1202
+ path: `/channels/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
1203
+ method: 'PATCH',
1204
+ headers: headerParameters,
1205
+ query: queryParameters,
1206
+ body: requestParameters.updateChannelPartialRequest,
1207
+ }, initOverrides);
1208
+
1209
+ return new runtime.JSONApiResponse(response);
1210
+ }
1211
+
1212
+ /**
1213
+ * Updates certain fields of the channel Sends events: - channel.updated Required permissions: - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen
1214
+ * Partially update channel
1215
+ */
1216
+ async updateChannelPartial(requestParameters: UpdateChannelPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateChannelPartialResponse> {
1217
+ const response = await this.updateChannelPartialRaw(requestParameters, initOverrides);
1218
+ return await response.value();
1219
+ }
1220
+
1221
+ }