@stream-io/node-sdk 0.2.6 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs.js +2461 -2124
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.es.js +2450 -2109
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/src/StreamCall.d.ts +1 -1
  7. package/dist/src/StreamChannel.d.ts +7 -9
  8. package/dist/src/StreamChatClient.d.ts +2 -5
  9. package/dist/src/StreamClient.d.ts +15 -26
  10. package/dist/src/gen/chat/apis/ProductchatApi.d.ts +1750 -0
  11. package/dist/src/gen/chat/apis/index.d.ts +1 -27
  12. package/dist/src/gen/chat/models/index.d.ts +5101 -5891
  13. package/dist/src/gen/chat/runtime.d.ts +2 -2
  14. package/dist/src/gen/video/apis/ProductvideoApi.d.ts +1 -1
  15. package/dist/src/gen/video/models/index.d.ts +189 -35
  16. package/dist/src/gen/video/runtime.d.ts +1 -1
  17. package/package.json +8 -1
  18. package/src/StreamCall.ts +7 -7
  19. package/src/StreamChannel.ts +44 -49
  20. package/src/StreamChatClient.ts +23 -35
  21. package/src/StreamClient.ts +71 -232
  22. package/src/gen/chat/.openapi-generator/FILES +1 -19
  23. package/src/gen/chat/apis/ProductchatApi.ts +7007 -0
  24. package/src/gen/chat/apis/index.ts +1 -27
  25. package/src/gen/chat/models/index.ts +5758 -6564
  26. package/src/gen/chat/runtime.ts +3 -3
  27. package/src/gen/video/apis/ProductvideoApi.ts +1 -1
  28. package/src/gen/video/models/index.ts +184 -36
  29. package/src/gen/video/runtime.ts +1 -1
  30. package/dist/src/gen/chat/apis/ChannelTypesApi.d.ts +0 -81
  31. package/dist/src/gen/chat/apis/ChannelsApi.d.ts +0 -280
  32. package/dist/src/gen/chat/apis/CustomCommandsApi.d.ts +0 -81
  33. package/dist/src/gen/chat/apis/DefaultApi.d.ts +0 -60
  34. package/dist/src/gen/chat/apis/DevicesApi.d.ts +0 -58
  35. package/dist/src/gen/chat/apis/EventsApi.d.ts +0 -47
  36. package/dist/src/gen/chat/apis/FilesApi.d.ts +0 -85
  37. package/dist/src/gen/chat/apis/GDPRApi.d.ts +0 -114
  38. package/dist/src/gen/chat/apis/ImportsApi.d.ts +0 -67
  39. package/dist/src/gen/chat/apis/MessagesApi.d.ts +0 -374
  40. package/dist/src/gen/chat/apis/ModerationApi.d.ts +0 -271
  41. package/dist/src/gen/chat/apis/PermissionsV2Api.d.ts +0 -77
  42. package/dist/src/gen/chat/apis/PushApi.d.ts +0 -65
  43. package/dist/src/gen/chat/apis/ReactionsApi.d.ts +0 -62
  44. package/dist/src/gen/chat/apis/ServerSideApi.d.ts +0 -31
  45. package/dist/src/gen/chat/apis/SettingsApi.d.ts +0 -257
  46. package/dist/src/gen/chat/apis/TasksApi.d.ts +0 -31
  47. package/dist/src/gen/chat/apis/TestingApi.d.ts +0 -57
  48. package/dist/src/gen/chat/apis/UsersApi.d.ts +0 -313
  49. package/src/gen/chat/apis/ChannelTypesApi.ts +0 -275
  50. package/src/gen/chat/apis/ChannelsApi.ts +0 -1096
  51. package/src/gen/chat/apis/CustomCommandsApi.ts +0 -276
  52. package/src/gen/chat/apis/DefaultApi.ts +0 -196
  53. package/src/gen/chat/apis/DevicesApi.ts +0 -180
  54. package/src/gen/chat/apis/EventsApi.ts +0 -147
  55. package/src/gen/chat/apis/FilesApi.ts +0 -312
  56. package/src/gen/chat/apis/GDPRApi.ts +0 -418
  57. package/src/gen/chat/apis/ImportsApi.ts +0 -222
  58. package/src/gen/chat/apis/MessagesApi.ts +0 -1475
  59. package/src/gen/chat/apis/ModerationApi.ts +0 -1038
  60. package/src/gen/chat/apis/PermissionsV2Api.ts +0 -259
  61. package/src/gen/chat/apis/PushApi.ts +0 -183
  62. package/src/gen/chat/apis/ReactionsApi.ts +0 -202
  63. package/src/gen/chat/apis/ServerSideApi.ts +0 -79
  64. package/src/gen/chat/apis/SettingsApi.ts +0 -948
  65. package/src/gen/chat/apis/TasksApi.ts +0 -75
  66. package/src/gen/chat/apis/TestingApi.ts +0 -185
  67. package/src/gen/chat/apis/UsersApi.ts +0 -1203
@@ -1,276 +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
- CreateCommandRequest,
20
- CreateCommandResponse,
21
- DeleteCommandResponse,
22
- GetCommandResponse,
23
- ListCommandsResponse,
24
- UpdateCommandRequest,
25
- UpdateCommandResponse,
26
- } from '../models';
27
-
28
- export interface CreateCommandOperationRequest {
29
- createCommandRequest: CreateCommandRequest | null;
30
- }
31
-
32
- export interface DeleteCommandRequest {
33
- name: string;
34
- }
35
-
36
- export interface GetCommandRequest {
37
- name: string;
38
- }
39
-
40
- export interface UpdateCommandOperationRequest {
41
- name: string;
42
- updateCommandRequest: UpdateCommandRequest | null;
43
- }
44
-
45
- /**
46
- *
47
- */
48
- export class CustomCommandsApi extends runtime.BaseAPI {
49
-
50
- /**
51
- * Creates custom chat command
52
- * Create command
53
- */
54
- async createCommandRaw(requestParameters: CreateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateCommandResponse>> {
55
- if (requestParameters.createCommandRequest === null || requestParameters.createCommandRequest === undefined) {
56
- throw new runtime.RequiredError('createCommandRequest','Required parameter requestParameters.createCommandRequest was null or undefined when calling createCommand.');
57
- }
58
-
59
- const queryParameters: any = {};
60
-
61
- const headerParameters: runtime.HTTPHeaders = {};
62
-
63
- headerParameters['Content-Type'] = 'application/json';
64
-
65
- if (this.configuration && this.configuration.apiKey) {
66
- headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
67
- }
68
-
69
- if (this.configuration && this.configuration.apiKey) {
70
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
71
- }
72
-
73
- if (this.configuration && this.configuration.apiKey) {
74
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
75
- }
76
-
77
- const response = await this.request({
78
- path: `/commands`,
79
- method: 'POST',
80
- headers: headerParameters,
81
- query: queryParameters,
82
- body: requestParameters.createCommandRequest,
83
- }, initOverrides);
84
-
85
- return new runtime.JSONApiResponse(response);
86
- }
87
-
88
- /**
89
- * Creates custom chat command
90
- * Create command
91
- */
92
- async createCommand(requestParameters: CreateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateCommandResponse> {
93
- const response = await this.createCommandRaw(requestParameters, initOverrides);
94
- return await response.value();
95
- }
96
-
97
- /**
98
- * Deletes custom chat command
99
- * Delete command
100
- */
101
- async deleteCommandRaw(requestParameters: DeleteCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DeleteCommandResponse>> {
102
- if (requestParameters.name === null || requestParameters.name === undefined) {
103
- throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteCommand.');
104
- }
105
-
106
- const queryParameters: any = {};
107
-
108
- const headerParameters: runtime.HTTPHeaders = {};
109
-
110
- if (this.configuration && this.configuration.apiKey) {
111
- headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
112
- }
113
-
114
- if (this.configuration && this.configuration.apiKey) {
115
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
116
- }
117
-
118
- if (this.configuration && this.configuration.apiKey) {
119
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
120
- }
121
-
122
- const response = await this.request({
123
- path: `/commands/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
124
- method: 'DELETE',
125
- headers: headerParameters,
126
- query: queryParameters,
127
- }, initOverrides);
128
-
129
- return new runtime.JSONApiResponse(response);
130
- }
131
-
132
- /**
133
- * Deletes custom chat command
134
- * Delete command
135
- */
136
- async deleteCommand(requestParameters: DeleteCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeleteCommandResponse> {
137
- const response = await this.deleteCommandRaw(requestParameters, initOverrides);
138
- return await response.value();
139
- }
140
-
141
- /**
142
- * Returns custom command by its name
143
- * Get command
144
- */
145
- async getCommandRaw(requestParameters: GetCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCommandResponse>> {
146
- if (requestParameters.name === null || requestParameters.name === undefined) {
147
- throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getCommand.');
148
- }
149
-
150
- const queryParameters: any = {};
151
-
152
- const headerParameters: runtime.HTTPHeaders = {};
153
-
154
- if (this.configuration && this.configuration.apiKey) {
155
- headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
156
- }
157
-
158
- if (this.configuration && this.configuration.apiKey) {
159
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
160
- }
161
-
162
- if (this.configuration && this.configuration.apiKey) {
163
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
164
- }
165
-
166
- const response = await this.request({
167
- path: `/commands/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
168
- method: 'GET',
169
- headers: headerParameters,
170
- query: queryParameters,
171
- }, initOverrides);
172
-
173
- return new runtime.JSONApiResponse(response);
174
- }
175
-
176
- /**
177
- * Returns custom command by its name
178
- * Get command
179
- */
180
- async getCommand(requestParameters: GetCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCommandResponse> {
181
- const response = await this.getCommandRaw(requestParameters, initOverrides);
182
- return await response.value();
183
- }
184
-
185
- /**
186
- * Returns all custom commands
187
- * List commands
188
- */
189
- async listCommandsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListCommandsResponse>> {
190
- const queryParameters: any = {};
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: `/commands`,
208
- method: 'GET',
209
- headers: headerParameters,
210
- query: queryParameters,
211
- }, initOverrides);
212
-
213
- return new runtime.JSONApiResponse(response);
214
- }
215
-
216
- /**
217
- * Returns all custom commands
218
- * List commands
219
- */
220
- async listCommands(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListCommandsResponse> {
221
- const response = await this.listCommandsRaw(initOverrides);
222
- return await response.value();
223
- }
224
-
225
- /**
226
- * Updates custom chat command
227
- * Update command
228
- */
229
- async updateCommandRaw(requestParameters: UpdateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UpdateCommandResponse>> {
230
- if (requestParameters.name === null || requestParameters.name === undefined) {
231
- throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling updateCommand.');
232
- }
233
-
234
- if (requestParameters.updateCommandRequest === null || requestParameters.updateCommandRequest === undefined) {
235
- throw new runtime.RequiredError('updateCommandRequest','Required parameter requestParameters.updateCommandRequest was null or undefined when calling updateCommand.');
236
- }
237
-
238
- const queryParameters: any = {};
239
-
240
- const headerParameters: runtime.HTTPHeaders = {};
241
-
242
- headerParameters['Content-Type'] = 'application/json';
243
-
244
- if (this.configuration && this.configuration.apiKey) {
245
- headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
246
- }
247
-
248
- if (this.configuration && this.configuration.apiKey) {
249
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
250
- }
251
-
252
- if (this.configuration && this.configuration.apiKey) {
253
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
254
- }
255
-
256
- const response = await this.request({
257
- path: `/commands/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
258
- method: 'PUT',
259
- headers: headerParameters,
260
- query: queryParameters,
261
- body: requestParameters.updateCommandRequest,
262
- }, initOverrides);
263
-
264
- return new runtime.JSONApiResponse(response);
265
- }
266
-
267
- /**
268
- * Updates custom chat command
269
- * Update command
270
- */
271
- async updateCommand(requestParameters: UpdateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateCommandResponse> {
272
- const response = await this.updateCommandRaw(requestParameters, initOverrides);
273
- return await response.value();
274
- }
275
-
276
- }
@@ -1,196 +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
- CreateCallRequest,
20
- CreateCallResponse,
21
- GetCallTokenRequest,
22
- GetCallTokenResponse,
23
- MessageResponse,
24
- } from '../models';
25
-
26
- export interface CommitMessageRequest {
27
- id: string;
28
- }
29
-
30
- export interface CreateCallOperationRequest {
31
- type: string;
32
- id: string;
33
- createCallRequest: CreateCallRequest | null;
34
- }
35
-
36
- export interface GetCallTokenOperationRequest {
37
- callId: string;
38
- getCallTokenRequest: GetCallTokenRequest | null;
39
- }
40
-
41
- /**
42
- *
43
- */
44
- export class DefaultApi extends runtime.BaseAPI {
45
-
46
- /**
47
- * Commits a pending message, which will make it visible in the channel Sends events: - message.new - message.updated
48
- * Commit message
49
- */
50
- async commitMessageRaw(requestParameters: CommitMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MessageResponse>> {
51
- if (requestParameters.id === null || requestParameters.id === undefined) {
52
- throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling commitMessage.');
53
- }
54
-
55
- const queryParameters: any = {};
56
-
57
- const headerParameters: runtime.HTTPHeaders = {};
58
-
59
- if (this.configuration && this.configuration.apiKey) {
60
- headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
61
- }
62
-
63
- if (this.configuration && this.configuration.apiKey) {
64
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
65
- }
66
-
67
- if (this.configuration && this.configuration.apiKey) {
68
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
69
- }
70
-
71
- const response = await this.request({
72
- path: `/messages/{id}/commit`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
73
- method: 'POST',
74
- headers: headerParameters,
75
- query: queryParameters,
76
- }, initOverrides);
77
-
78
- return new runtime.JSONApiResponse(response);
79
- }
80
-
81
- /**
82
- * Commits a pending message, which will make it visible in the channel Sends events: - message.new - message.updated
83
- * Commit message
84
- */
85
- async commitMessage(requestParameters: CommitMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageResponse> {
86
- const response = await this.commitMessageRaw(requestParameters, initOverrides);
87
- return await response.value();
88
- }
89
-
90
- /**
91
- * Creates a call Required permissions: - CreateCall - ReadChannel
92
- * Create a call
93
- */
94
- async createCallRaw(requestParameters: CreateCallOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateCallResponse>> {
95
- if (requestParameters.type === null || requestParameters.type === undefined) {
96
- throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling createCall.');
97
- }
98
-
99
- if (requestParameters.id === null || requestParameters.id === undefined) {
100
- throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling createCall.');
101
- }
102
-
103
- if (requestParameters.createCallRequest === null || requestParameters.createCallRequest === undefined) {
104
- throw new runtime.RequiredError('createCallRequest','Required parameter requestParameters.createCallRequest was null or undefined when calling createCall.');
105
- }
106
-
107
- const queryParameters: any = {};
108
-
109
- const headerParameters: runtime.HTTPHeaders = {};
110
-
111
- headerParameters['Content-Type'] = 'application/json';
112
-
113
- if (this.configuration && this.configuration.apiKey) {
114
- headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
115
- }
116
-
117
- if (this.configuration && this.configuration.apiKey) {
118
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
119
- }
120
-
121
- if (this.configuration && this.configuration.apiKey) {
122
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
123
- }
124
-
125
- const response = await this.request({
126
- path: `/channels/{type}/{id}/call`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
127
- method: 'POST',
128
- headers: headerParameters,
129
- query: queryParameters,
130
- body: requestParameters.createCallRequest,
131
- }, initOverrides);
132
-
133
- return new runtime.JSONApiResponse(response);
134
- }
135
-
136
- /**
137
- * Creates a call Required permissions: - CreateCall - ReadChannel
138
- * Create a call
139
- */
140
- async createCall(requestParameters: CreateCallOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateCallResponse> {
141
- const response = await this.createCallRaw(requestParameters, initOverrides);
142
- return await response.value();
143
- }
144
-
145
- /**
146
- * Retrieves the token to join a call Required permissions: - JoinCall - ReadChannel
147
- * Get Call Token
148
- */
149
- async getCallTokenRaw(requestParameters: GetCallTokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCallTokenResponse>> {
150
- if (requestParameters.callId === null || requestParameters.callId === undefined) {
151
- throw new runtime.RequiredError('callId','Required parameter requestParameters.callId was null or undefined when calling getCallToken.');
152
- }
153
-
154
- if (requestParameters.getCallTokenRequest === null || requestParameters.getCallTokenRequest === undefined) {
155
- throw new runtime.RequiredError('getCallTokenRequest','Required parameter requestParameters.getCallTokenRequest was null or undefined when calling getCallToken.');
156
- }
157
-
158
- const queryParameters: any = {};
159
-
160
- const headerParameters: runtime.HTTPHeaders = {};
161
-
162
- headerParameters['Content-Type'] = 'application/json';
163
-
164
- if (this.configuration && this.configuration.apiKey) {
165
- headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
166
- }
167
-
168
- if (this.configuration && this.configuration.apiKey) {
169
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
170
- }
171
-
172
- if (this.configuration && this.configuration.apiKey) {
173
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
174
- }
175
-
176
- const response = await this.request({
177
- path: `/calls/{call_id}`.replace(`{${"call_id"}}`, encodeURIComponent(String(requestParameters.callId))),
178
- method: 'POST',
179
- headers: headerParameters,
180
- query: queryParameters,
181
- body: requestParameters.getCallTokenRequest,
182
- }, initOverrides);
183
-
184
- return new runtime.JSONApiResponse(response);
185
- }
186
-
187
- /**
188
- * Retrieves the token to join a call Required permissions: - JoinCall - ReadChannel
189
- * Get Call Token
190
- */
191
- async getCallToken(requestParameters: GetCallTokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCallTokenResponse> {
192
- const response = await this.getCallTokenRaw(requestParameters, initOverrides);
193
- return await response.value();
194
- }
195
-
196
- }
@@ -1,180 +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
- CreateDeviceRequest,
20
- ListDevicesResponse,
21
- Response,
22
- } from '../models';
23
-
24
- export interface CreateDeviceOperationRequest {
25
- createDeviceRequest: CreateDeviceRequest | null;
26
- }
27
-
28
- export interface DeleteDeviceRequest {
29
- id?: string;
30
- userId?: string;
31
- }
32
-
33
- export interface ListDevicesRequest {
34
- userId?: string;
35
- }
36
-
37
- /**
38
- *
39
- */
40
- export class DevicesApi extends runtime.BaseAPI {
41
-
42
- /**
43
- * Adds a new device to a user, if the same device already exists the call will have no effect
44
- * Create device
45
- */
46
- async createDeviceRaw(requestParameters: CreateDeviceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
47
- if (requestParameters.createDeviceRequest === null || requestParameters.createDeviceRequest === undefined) {
48
- throw new runtime.RequiredError('createDeviceRequest','Required parameter requestParameters.createDeviceRequest was null or undefined when calling createDevice.');
49
- }
50
-
51
- const queryParameters: any = {};
52
-
53
- const headerParameters: runtime.HTTPHeaders = {};
54
-
55
- headerParameters['Content-Type'] = 'application/json';
56
-
57
- if (this.configuration && this.configuration.apiKey) {
58
- headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
59
- }
60
-
61
- if (this.configuration && this.configuration.apiKey) {
62
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
63
- }
64
-
65
- if (this.configuration && this.configuration.apiKey) {
66
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
67
- }
68
-
69
- const response = await this.request({
70
- path: `/devices`,
71
- method: 'POST',
72
- headers: headerParameters,
73
- query: queryParameters,
74
- body: requestParameters.createDeviceRequest,
75
- }, initOverrides);
76
-
77
- return new runtime.VoidApiResponse(response);
78
- }
79
-
80
- /**
81
- * Adds a new device to a user, if the same device already exists the call will have no effect
82
- * Create device
83
- */
84
- async createDevice(requestParameters: CreateDeviceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
85
- await this.createDeviceRaw(requestParameters, initOverrides);
86
- }
87
-
88
- /**
89
- * Deletes one device
90
- * Delete device
91
- */
92
- async deleteDeviceRaw(requestParameters: DeleteDeviceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Response>> {
93
- const queryParameters: any = {};
94
-
95
- if (requestParameters.id !== undefined) {
96
- queryParameters['id'] = requestParameters.id;
97
- }
98
-
99
- if (requestParameters.userId !== undefined) {
100
- queryParameters['user_id'] = requestParameters.userId;
101
- }
102
-
103
- const headerParameters: runtime.HTTPHeaders = {};
104
-
105
- if (this.configuration && this.configuration.apiKey) {
106
- headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
107
- }
108
-
109
- if (this.configuration && this.configuration.apiKey) {
110
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
111
- }
112
-
113
- if (this.configuration && this.configuration.apiKey) {
114
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
115
- }
116
-
117
- const response = await this.request({
118
- path: `/devices`,
119
- method: 'DELETE',
120
- headers: headerParameters,
121
- query: queryParameters,
122
- }, initOverrides);
123
-
124
- return new runtime.JSONApiResponse(response);
125
- }
126
-
127
- /**
128
- * Deletes one device
129
- * Delete device
130
- */
131
- async deleteDevice(requestParameters: DeleteDeviceRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Response> {
132
- const response = await this.deleteDeviceRaw(requestParameters, initOverrides);
133
- return await response.value();
134
- }
135
-
136
- /**
137
- * Returns all available devices
138
- * List devices
139
- */
140
- async listDevicesRaw(requestParameters: ListDevicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListDevicesResponse>> {
141
- const queryParameters: any = {};
142
-
143
- if (requestParameters.userId !== undefined) {
144
- queryParameters['user_id'] = requestParameters.userId;
145
- }
146
-
147
- const headerParameters: runtime.HTTPHeaders = {};
148
-
149
- if (this.configuration && this.configuration.apiKey) {
150
- headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication
151
- }
152
-
153
- if (this.configuration && this.configuration.apiKey) {
154
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
155
- }
156
-
157
- if (this.configuration && this.configuration.apiKey) {
158
- headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication
159
- }
160
-
161
- const response = await this.request({
162
- path: `/devices`,
163
- method: 'GET',
164
- headers: headerParameters,
165
- query: queryParameters,
166
- }, initOverrides);
167
-
168
- return new runtime.JSONApiResponse(response);
169
- }
170
-
171
- /**
172
- * Returns all available devices
173
- * List devices
174
- */
175
- async listDevices(requestParameters: ListDevicesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListDevicesResponse> {
176
- const response = await this.listDevicesRaw(requestParameters, initOverrides);
177
- return await response.value();
178
- }
179
-
180
- }