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