hey-pharmacist-ecommerce 1.1.25 → 1.1.27

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 (63) hide show
  1. package/dist/index.d.mts +4 -207
  2. package/dist/index.d.ts +4 -207
  3. package/dist/index.js +188 -233
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +189 -235
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/CartItem.tsx +0 -10
  9. package/src/components/ProductCard.tsx +4 -5
  10. package/src/index.ts +1 -0
  11. package/src/lib/Apis/api.ts +0 -8
  12. package/src/lib/Apis/apis/product-variants-api.ts +0 -96
  13. package/src/lib/Apis/apis/products-api.ts +7 -15
  14. package/src/lib/Apis/apis/shipping-api.ts +12 -214
  15. package/src/lib/Apis/models/category-filters.ts +0 -6
  16. package/src/lib/Apis/models/create-variant-dto.ts +0 -6
  17. package/src/lib/Apis/models/discounts-insights-dto.ts +0 -6
  18. package/src/lib/Apis/models/index.ts +0 -29
  19. package/src/lib/Apis/models/orders-insights-dto.ts +0 -6
  20. package/src/lib/Apis/models/payment.ts +0 -7
  21. package/src/lib/Apis/models/product-variant.ts +0 -6
  22. package/src/lib/Apis/models/products-insights-dto.ts +0 -6
  23. package/src/lib/Apis/models/rate-dto.ts +0 -6
  24. package/src/lib/Apis/models/update-product-variant-dto.ts +0 -6
  25. package/src/providers/WishlistProvider.tsx +3 -4
  26. package/src/screens/CheckoutScreen.tsx +25 -73
  27. package/src/lib/Apis/apis/chats-api.ts +0 -1101
  28. package/src/lib/Apis/apis/drafts-api.ts +0 -448
  29. package/src/lib/Apis/apis/open-aiapi.ts +0 -513
  30. package/src/lib/Apis/apis/payment-methods-api.ts +0 -411
  31. package/src/lib/Apis/apis/product-attributes-api.ts +0 -538
  32. package/src/lib/Apis/apis/product-favorite-list-api.ts +0 -321
  33. package/src/lib/Apis/apis/roles-api.ts +0 -614
  34. package/src/lib/Apis/apis/statistics-api.ts +0 -234
  35. package/src/lib/Apis/models/add-message-dto.ts +0 -56
  36. package/src/lib/Apis/models/chat.ts +0 -33
  37. package/src/lib/Apis/models/create-chat-dto.ts +0 -39
  38. package/src/lib/Apis/models/create-draft-dto.ts +0 -67
  39. package/src/lib/Apis/models/create-product-attribute-dto.ts +0 -33
  40. package/src/lib/Apis/models/create-role-dto.ts +0 -57
  41. package/src/lib/Apis/models/create-zone-dto.ts +0 -82
  42. package/src/lib/Apis/models/default-payment-method-request-dto.ts +0 -27
  43. package/src/lib/Apis/models/draft.ts +0 -79
  44. package/src/lib/Apis/models/google-analytics-request-dto.ts +0 -55
  45. package/src/lib/Apis/models/google-analytics-response-dto.ts +0 -39
  46. package/src/lib/Apis/models/my-favorite-list-dto.ts +0 -52
  47. package/src/lib/Apis/models/open-api.ts +0 -33
  48. package/src/lib/Apis/models/payment-method-data.ts +0 -34
  49. package/src/lib/Apis/models/payment-method.ts +0 -51
  50. package/src/lib/Apis/models/populated-chat-dto.ts +0 -95
  51. package/src/lib/Apis/models/product-attribute.ts +0 -57
  52. package/src/lib/Apis/models/product.ts +0 -142
  53. package/src/lib/Apis/models/role.ts +0 -69
  54. package/src/lib/Apis/models/single-message-populated.ts +0 -59
  55. package/src/lib/Apis/models/single-suggest-attribute.ts +0 -33
  56. package/src/lib/Apis/models/statistic-dto.ts +0 -171
  57. package/src/lib/Apis/models/suggest-attributes.ts +0 -28
  58. package/src/lib/Apis/models/update-product-attribute-dto.ts +0 -33
  59. package/src/lib/Apis/models/update-role-dto.ts +0 -57
  60. package/src/lib/Apis/models/update-zone-dto.ts +0 -82
  61. package/src/lib/Apis/models/user.ts +0 -232
  62. package/src/lib/Apis/models/zone-single-size.ts +0 -51
  63. package/src/lib/Apis/models/zone.ts +0 -106
@@ -1,1101 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Hey Pharamcist API
5
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
6
- *
7
- * OpenAPI spec version: 1.0
8
- *
9
- *
10
- * NOTE: This class is auto generated by the swagger code generator program.
11
- * https://github.com/swagger-api/swagger-codegen.git
12
- * Do not edit the class manually.
13
- */
14
- import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
15
- import { Configuration } from '../configuration';
16
- // Some imports not used depending on template conditions
17
- // @ts-ignore
18
- import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
19
- import { Chat } from '../models';
20
- import { CreateChatDto } from '../models';
21
- import { PopulatedChatDto } from '../models';
22
- /**
23
- * ChatsApi - axios parameter creator
24
- * @export
25
- */
26
- export const ChatsApiAxiosParamCreator = function (configuration?: Configuration) {
27
- return {
28
- /**
29
- *
30
- * @summary Add a new message to a chat
31
- * @param {string} chatId
32
- * @param {string} message
33
- * @param {Blob} file
34
- * @param {string} type
35
- * @param {*} [options] Override http request option.
36
- * @throws {RequiredError}
37
- */
38
- addMessageToChatForm: async (chatId: string, message: string, file: Blob, type: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
39
- // verify required parameter 'chatId' is not null or undefined
40
- if (chatId === null || chatId === undefined) {
41
- throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling addMessageToChatForm.');
42
- }
43
- // verify required parameter 'message' is not null or undefined
44
- if (message === null || message === undefined) {
45
- throw new RequiredError('message','Required parameter message was null or undefined when calling addMessageToChatForm.');
46
- }
47
- // verify required parameter 'file' is not null or undefined
48
- if (file === null || file === undefined) {
49
- throw new RequiredError('file','Required parameter file was null or undefined when calling addMessageToChatForm.');
50
- }
51
- // verify required parameter 'type' is not null or undefined
52
- if (type === null || type === undefined) {
53
- throw new RequiredError('type','Required parameter type was null or undefined when calling addMessageToChatForm.');
54
- }
55
- const localVarPath = `/chats/addNewMessage`;
56
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
57
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
58
- let baseOptions;
59
- if (configuration) {
60
- baseOptions = configuration.baseOptions;
61
- }
62
- const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
63
- const localVarHeaderParameter = {} as any;
64
- const localVarQueryParameter = {} as any;
65
- const localVarFormParams = new FormData();
66
-
67
- // authentication bearer required
68
- // http bearer authentication required
69
- if (configuration && configuration.accessToken) {
70
- const accessToken = typeof configuration.accessToken === 'function'
71
- ? await configuration.accessToken()
72
- : await configuration.accessToken;
73
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
74
- }
75
-
76
-
77
- if (chatId !== undefined) {
78
- localVarFormParams.append('chatId', chatId as any);
79
- }
80
-
81
- if (message !== undefined) {
82
- localVarFormParams.append('message', message as any);
83
- }
84
-
85
- if (file !== undefined) {
86
- localVarFormParams.append('file', file as any);
87
- }
88
-
89
- if (type !== undefined) {
90
- localVarFormParams.append('type', type as any);
91
- }
92
-
93
- localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
94
- const query = new URLSearchParams(localVarUrlObj.search);
95
- for (const key in localVarQueryParameter) {
96
- query.set(key, localVarQueryParameter[key]);
97
- }
98
- for (const key in options.params) {
99
- query.set(key, options.params[key]);
100
- }
101
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
102
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
103
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
104
- localVarRequestOptions.data = localVarFormParams;
105
-
106
- return {
107
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
108
- options: localVarRequestOptions,
109
- };
110
- },
111
- /**
112
- *
113
- * @summary Archive a chat
114
- * @param {string} chatId
115
- * @param {*} [options] Override http request option.
116
- * @throws {RequiredError}
117
- */
118
- archiveChat: async (chatId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
119
- // verify required parameter 'chatId' is not null or undefined
120
- if (chatId === null || chatId === undefined) {
121
- throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling archiveChat.');
122
- }
123
- const localVarPath = `/chats/archive/{chatId}`
124
- .replace(`{${"chatId"}}`, encodeURIComponent(String(chatId)));
125
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
126
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
127
- let baseOptions;
128
- if (configuration) {
129
- baseOptions = configuration.baseOptions;
130
- }
131
- const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
132
- const localVarHeaderParameter = {} as any;
133
- const localVarQueryParameter = {} as any;
134
-
135
- // authentication bearer required
136
- // http bearer authentication required
137
- if (configuration && configuration.accessToken) {
138
- const accessToken = typeof configuration.accessToken === 'function'
139
- ? await configuration.accessToken()
140
- : await configuration.accessToken;
141
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
142
- }
143
-
144
- const query = new URLSearchParams(localVarUrlObj.search);
145
- for (const key in localVarQueryParameter) {
146
- query.set(key, localVarQueryParameter[key]);
147
- }
148
- for (const key in options.params) {
149
- query.set(key, options.params[key]);
150
- }
151
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
152
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
153
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
154
-
155
- return {
156
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
157
- options: localVarRequestOptions,
158
- };
159
- },
160
- /**
161
- *
162
- * @summary Close a chat
163
- * @param {string} chatId
164
- * @param {*} [options] Override http request option.
165
- * @throws {RequiredError}
166
- */
167
- closeChat: async (chatId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
168
- // verify required parameter 'chatId' is not null or undefined
169
- if (chatId === null || chatId === undefined) {
170
- throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling closeChat.');
171
- }
172
- const localVarPath = `/chats/close/{chatId}`
173
- .replace(`{${"chatId"}}`, encodeURIComponent(String(chatId)));
174
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
175
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
176
- let baseOptions;
177
- if (configuration) {
178
- baseOptions = configuration.baseOptions;
179
- }
180
- const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
181
- const localVarHeaderParameter = {} as any;
182
- const localVarQueryParameter = {} as any;
183
-
184
- // authentication bearer required
185
- // http bearer authentication required
186
- if (configuration && configuration.accessToken) {
187
- const accessToken = typeof configuration.accessToken === 'function'
188
- ? await configuration.accessToken()
189
- : await configuration.accessToken;
190
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
191
- }
192
-
193
- const query = new URLSearchParams(localVarUrlObj.search);
194
- for (const key in localVarQueryParameter) {
195
- query.set(key, localVarQueryParameter[key]);
196
- }
197
- for (const key in options.params) {
198
- query.set(key, options.params[key]);
199
- }
200
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
201
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
202
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
203
-
204
- return {
205
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
206
- options: localVarRequestOptions,
207
- };
208
- },
209
- /**
210
- *
211
- * @summary Create a new chat
212
- * @param {CreateChatDto} body
213
- * @param {*} [options] Override http request option.
214
- * @throws {RequiredError}
215
- */
216
- createChat: async (body: CreateChatDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
217
- // verify required parameter 'body' is not null or undefined
218
- if (body === null || body === undefined) {
219
- throw new RequiredError('body','Required parameter body was null or undefined when calling createChat.');
220
- }
221
- const localVarPath = `/chats`;
222
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
223
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
224
- let baseOptions;
225
- if (configuration) {
226
- baseOptions = configuration.baseOptions;
227
- }
228
- const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
229
- const localVarHeaderParameter = {} as any;
230
- const localVarQueryParameter = {} as any;
231
-
232
- // authentication bearer required
233
- // http bearer authentication required
234
- if (configuration && configuration.accessToken) {
235
- const accessToken = typeof configuration.accessToken === 'function'
236
- ? await configuration.accessToken()
237
- : await configuration.accessToken;
238
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
239
- }
240
-
241
- localVarHeaderParameter['Content-Type'] = 'application/json';
242
-
243
- const query = new URLSearchParams(localVarUrlObj.search);
244
- for (const key in localVarQueryParameter) {
245
- query.set(key, localVarQueryParameter[key]);
246
- }
247
- for (const key in options.params) {
248
- query.set(key, options.params[key]);
249
- }
250
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
251
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
252
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
253
- const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
254
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
255
-
256
- return {
257
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
258
- options: localVarRequestOptions,
259
- };
260
- },
261
- /**
262
- *
263
- * @summary Delete a message from a chat
264
- * @param {string} chatId
265
- * @param {string} msgId
266
- * @param {*} [options] Override http request option.
267
- * @throws {RequiredError}
268
- */
269
- deleteMessage: async (chatId: string, msgId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
270
- // verify required parameter 'chatId' is not null or undefined
271
- if (chatId === null || chatId === undefined) {
272
- throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling deleteMessage.');
273
- }
274
- // verify required parameter 'msgId' is not null or undefined
275
- if (msgId === null || msgId === undefined) {
276
- throw new RequiredError('msgId','Required parameter msgId was null or undefined when calling deleteMessage.');
277
- }
278
- const localVarPath = `/chats/deleteMessage/{chatId}/{msgId}`
279
- .replace(`{${"chatId"}}`, encodeURIComponent(String(chatId)))
280
- .replace(`{${"msgId"}}`, encodeURIComponent(String(msgId)));
281
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
282
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
283
- let baseOptions;
284
- if (configuration) {
285
- baseOptions = configuration.baseOptions;
286
- }
287
- const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
288
- const localVarHeaderParameter = {} as any;
289
- const localVarQueryParameter = {} as any;
290
-
291
- // authentication bearer required
292
- // http bearer authentication required
293
- if (configuration && configuration.accessToken) {
294
- const accessToken = typeof configuration.accessToken === 'function'
295
- ? await configuration.accessToken()
296
- : await configuration.accessToken;
297
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
298
- }
299
-
300
- const query = new URLSearchParams(localVarUrlObj.search);
301
- for (const key in localVarQueryParameter) {
302
- query.set(key, localVarQueryParameter[key]);
303
- }
304
- for (const key in options.params) {
305
- query.set(key, options.params[key]);
306
- }
307
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
308
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
309
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
310
-
311
- return {
312
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
313
- options: localVarRequestOptions,
314
- };
315
- },
316
- /**
317
- *
318
- * @summary Get all chats
319
- * @param {*} [options] Override http request option.
320
- * @throws {RequiredError}
321
- */
322
- getAllStoreChats: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
323
- const localVarPath = `/chats`;
324
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
325
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
326
- let baseOptions;
327
- if (configuration) {
328
- baseOptions = configuration.baseOptions;
329
- }
330
- const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
331
- const localVarHeaderParameter = {} as any;
332
- const localVarQueryParameter = {} as any;
333
-
334
- // authentication bearer required
335
- // http bearer authentication required
336
- if (configuration && configuration.accessToken) {
337
- const accessToken = typeof configuration.accessToken === 'function'
338
- ? await configuration.accessToken()
339
- : await configuration.accessToken;
340
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
341
- }
342
-
343
- const query = new URLSearchParams(localVarUrlObj.search);
344
- for (const key in localVarQueryParameter) {
345
- query.set(key, localVarQueryParameter[key]);
346
- }
347
- for (const key in options.params) {
348
- query.set(key, options.params[key]);
349
- }
350
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
351
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
352
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
353
-
354
- return {
355
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
356
- options: localVarRequestOptions,
357
- };
358
- },
359
- /**
360
- *
361
- * @summary Get my chats to be used from the user side
362
- * @param {*} [options] Override http request option.
363
- * @throws {RequiredError}
364
- */
365
- getMyChats: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
366
- const localVarPath = `/chats/mine`;
367
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
368
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
369
- let baseOptions;
370
- if (configuration) {
371
- baseOptions = configuration.baseOptions;
372
- }
373
- const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
374
- const localVarHeaderParameter = {} as any;
375
- const localVarQueryParameter = {} as any;
376
-
377
- // authentication bearer required
378
- // http bearer authentication required
379
- if (configuration && configuration.accessToken) {
380
- const accessToken = typeof configuration.accessToken === 'function'
381
- ? await configuration.accessToken()
382
- : await configuration.accessToken;
383
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
384
- }
385
-
386
- const query = new URLSearchParams(localVarUrlObj.search);
387
- for (const key in localVarQueryParameter) {
388
- query.set(key, localVarQueryParameter[key]);
389
- }
390
- for (const key in options.params) {
391
- query.set(key, options.params[key]);
392
- }
393
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
394
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
395
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
396
-
397
- return {
398
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
399
- options: localVarRequestOptions,
400
- };
401
- },
402
- /**
403
- *
404
- * @summary Open a chat
405
- * @param {string} chatId
406
- * @param {*} [options] Override http request option.
407
- * @throws {RequiredError}
408
- */
409
- openChat: async (chatId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
410
- // verify required parameter 'chatId' is not null or undefined
411
- if (chatId === null || chatId === undefined) {
412
- throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling openChat.');
413
- }
414
- const localVarPath = `/chats/open/{chatId}`
415
- .replace(`{${"chatId"}}`, encodeURIComponent(String(chatId)));
416
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
417
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
418
- let baseOptions;
419
- if (configuration) {
420
- baseOptions = configuration.baseOptions;
421
- }
422
- const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
423
- const localVarHeaderParameter = {} as any;
424
- const localVarQueryParameter = {} as any;
425
-
426
- // authentication bearer required
427
- // http bearer authentication required
428
- if (configuration && configuration.accessToken) {
429
- const accessToken = typeof configuration.accessToken === 'function'
430
- ? await configuration.accessToken()
431
- : await configuration.accessToken;
432
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
433
- }
434
-
435
- const query = new URLSearchParams(localVarUrlObj.search);
436
- for (const key in localVarQueryParameter) {
437
- query.set(key, localVarQueryParameter[key]);
438
- }
439
- for (const key in options.params) {
440
- query.set(key, options.params[key]);
441
- }
442
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
443
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
444
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
445
-
446
- return {
447
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
448
- options: localVarRequestOptions,
449
- };
450
- },
451
- /**
452
- *
453
- * @summary Delete chat permenantly
454
- * @param {string} chatId
455
- * @param {*} [options] Override http request option.
456
- * @throws {RequiredError}
457
- */
458
- removeChat: async (chatId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
459
- // verify required parameter 'chatId' is not null or undefined
460
- if (chatId === null || chatId === undefined) {
461
- throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling removeChat.');
462
- }
463
- const localVarPath = `/chats/{chatId}`
464
- .replace(`{${"chatId"}}`, encodeURIComponent(String(chatId)));
465
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
466
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
467
- let baseOptions;
468
- if (configuration) {
469
- baseOptions = configuration.baseOptions;
470
- }
471
- const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
472
- const localVarHeaderParameter = {} as any;
473
- const localVarQueryParameter = {} as any;
474
-
475
- // authentication bearer required
476
- // http bearer authentication required
477
- if (configuration && configuration.accessToken) {
478
- const accessToken = typeof configuration.accessToken === 'function'
479
- ? await configuration.accessToken()
480
- : await configuration.accessToken;
481
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
482
- }
483
-
484
- const query = new URLSearchParams(localVarUrlObj.search);
485
- for (const key in localVarQueryParameter) {
486
- query.set(key, localVarQueryParameter[key]);
487
- }
488
- for (const key in options.params) {
489
- query.set(key, options.params[key]);
490
- }
491
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
492
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
493
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
494
-
495
- return {
496
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
497
- options: localVarRequestOptions,
498
- };
499
- },
500
- /**
501
- *
502
- * @summary Temporary delete a chat .. so we have records of deleted chats before 100% delete
503
- * @param {string} chatId
504
- * @param {*} [options] Override http request option.
505
- * @throws {RequiredError}
506
- */
507
- temporaryDelete: async (chatId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
508
- // verify required parameter 'chatId' is not null or undefined
509
- if (chatId === null || chatId === undefined) {
510
- throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling temporaryDelete.');
511
- }
512
- const localVarPath = `/chats/temporaryDelete/{chatId}`
513
- .replace(`{${"chatId"}}`, encodeURIComponent(String(chatId)));
514
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
515
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
516
- let baseOptions;
517
- if (configuration) {
518
- baseOptions = configuration.baseOptions;
519
- }
520
- const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
521
- const localVarHeaderParameter = {} as any;
522
- const localVarQueryParameter = {} as any;
523
-
524
- // authentication bearer required
525
- // http bearer authentication required
526
- if (configuration && configuration.accessToken) {
527
- const accessToken = typeof configuration.accessToken === 'function'
528
- ? await configuration.accessToken()
529
- : await configuration.accessToken;
530
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
531
- }
532
-
533
- const query = new URLSearchParams(localVarUrlObj.search);
534
- for (const key in localVarQueryParameter) {
535
- query.set(key, localVarQueryParameter[key]);
536
- }
537
- for (const key in options.params) {
538
- query.set(key, options.params[key]);
539
- }
540
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
541
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
542
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
543
-
544
- return {
545
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
546
- options: localVarRequestOptions,
547
- };
548
- },
549
- /**
550
- *
551
- * @summary Unarchive a chat
552
- * @param {string} chatId
553
- * @param {*} [options] Override http request option.
554
- * @throws {RequiredError}
555
- */
556
- unarchiveChat: async (chatId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
557
- // verify required parameter 'chatId' is not null or undefined
558
- if (chatId === null || chatId === undefined) {
559
- throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling unarchiveChat.');
560
- }
561
- const localVarPath = `/chats/unarchive/{chatId}`
562
- .replace(`{${"chatId"}}`, encodeURIComponent(String(chatId)));
563
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
564
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
565
- let baseOptions;
566
- if (configuration) {
567
- baseOptions = configuration.baseOptions;
568
- }
569
- const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
570
- const localVarHeaderParameter = {} as any;
571
- const localVarQueryParameter = {} as any;
572
-
573
- // authentication bearer required
574
- // http bearer authentication required
575
- if (configuration && configuration.accessToken) {
576
- const accessToken = typeof configuration.accessToken === 'function'
577
- ? await configuration.accessToken()
578
- : await configuration.accessToken;
579
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
580
- }
581
-
582
- const query = new URLSearchParams(localVarUrlObj.search);
583
- for (const key in localVarQueryParameter) {
584
- query.set(key, localVarQueryParameter[key]);
585
- }
586
- for (const key in options.params) {
587
- query.set(key, options.params[key]);
588
- }
589
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
590
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
591
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
592
-
593
- return {
594
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
595
- options: localVarRequestOptions,
596
- };
597
- },
598
- /**
599
- *
600
- * @summary Update chat seen to be called once a chat tab is opened and scrolled to the bottom
601
- * @param {string} chatId
602
- * @param {*} [options] Override http request option.
603
- * @throws {RequiredError}
604
- */
605
- updateChatSeen: async (chatId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
606
- // verify required parameter 'chatId' is not null or undefined
607
- if (chatId === null || chatId === undefined) {
608
- throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling updateChatSeen.');
609
- }
610
- const localVarPath = `/chats/updateSeen/{chatId}`
611
- .replace(`{${"chatId"}}`, encodeURIComponent(String(chatId)));
612
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
613
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
614
- let baseOptions;
615
- if (configuration) {
616
- baseOptions = configuration.baseOptions;
617
- }
618
- const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
619
- const localVarHeaderParameter = {} as any;
620
- const localVarQueryParameter = {} as any;
621
-
622
- // authentication bearer required
623
- // http bearer authentication required
624
- if (configuration && configuration.accessToken) {
625
- const accessToken = typeof configuration.accessToken === 'function'
626
- ? await configuration.accessToken()
627
- : await configuration.accessToken;
628
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
629
- }
630
-
631
- const query = new URLSearchParams(localVarUrlObj.search);
632
- for (const key in localVarQueryParameter) {
633
- query.set(key, localVarQueryParameter[key]);
634
- }
635
- for (const key in options.params) {
636
- query.set(key, options.params[key]);
637
- }
638
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
639
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
640
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
641
-
642
- return {
643
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
644
- options: localVarRequestOptions,
645
- };
646
- },
647
- }
648
- };
649
-
650
- /**
651
- * ChatsApi - functional programming interface
652
- * @export
653
- */
654
- export const ChatsApiFp = function(configuration?: Configuration) {
655
- return {
656
- /**
657
- *
658
- * @summary Add a new message to a chat
659
- * @param {string} chatId
660
- * @param {string} message
661
- * @param {Blob} file
662
- * @param {string} type
663
- * @param {*} [options] Override http request option.
664
- * @throws {RequiredError}
665
- */
666
- async addMessageToChatForm(chatId: string, message: string, file: Blob, type: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PopulatedChatDto>>> {
667
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).addMessageToChatForm(chatId, message, file, type, options);
668
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
669
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
670
- return axios.request(axiosRequestArgs);
671
- };
672
- },
673
- /**
674
- *
675
- * @summary Archive a chat
676
- * @param {string} chatId
677
- * @param {*} [options] Override http request option.
678
- * @throws {RequiredError}
679
- */
680
- async archiveChat(chatId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
681
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).archiveChat(chatId, options);
682
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
683
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
684
- return axios.request(axiosRequestArgs);
685
- };
686
- },
687
- /**
688
- *
689
- * @summary Close a chat
690
- * @param {string} chatId
691
- * @param {*} [options] Override http request option.
692
- * @throws {RequiredError}
693
- */
694
- async closeChat(chatId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
695
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).closeChat(chatId, options);
696
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
697
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
698
- return axios.request(axiosRequestArgs);
699
- };
700
- },
701
- /**
702
- *
703
- * @summary Create a new chat
704
- * @param {CreateChatDto} body
705
- * @param {*} [options] Override http request option.
706
- * @throws {RequiredError}
707
- */
708
- async createChat(body: CreateChatDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PopulatedChatDto>>> {
709
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).createChat(body, options);
710
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
711
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
712
- return axios.request(axiosRequestArgs);
713
- };
714
- },
715
- /**
716
- *
717
- * @summary Delete a message from a chat
718
- * @param {string} chatId
719
- * @param {string} msgId
720
- * @param {*} [options] Override http request option.
721
- * @throws {RequiredError}
722
- */
723
- async deleteMessage(chatId: string, msgId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Chat>>> {
724
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).deleteMessage(chatId, msgId, options);
725
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
726
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
727
- return axios.request(axiosRequestArgs);
728
- };
729
- },
730
- /**
731
- *
732
- * @summary Get all chats
733
- * @param {*} [options] Override http request option.
734
- * @throws {RequiredError}
735
- */
736
- async getAllStoreChats(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<PopulatedChatDto>>>> {
737
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).getAllStoreChats(options);
738
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
739
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
740
- return axios.request(axiosRequestArgs);
741
- };
742
- },
743
- /**
744
- *
745
- * @summary Get my chats to be used from the user side
746
- * @param {*} [options] Override http request option.
747
- * @throws {RequiredError}
748
- */
749
- async getMyChats(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<PopulatedChatDto>>>> {
750
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).getMyChats(options);
751
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
752
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
753
- return axios.request(axiosRequestArgs);
754
- };
755
- },
756
- /**
757
- *
758
- * @summary Open a chat
759
- * @param {string} chatId
760
- * @param {*} [options] Override http request option.
761
- * @throws {RequiredError}
762
- */
763
- async openChat(chatId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
764
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).openChat(chatId, options);
765
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
766
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
767
- return axios.request(axiosRequestArgs);
768
- };
769
- },
770
- /**
771
- *
772
- * @summary Delete chat permenantly
773
- * @param {string} chatId
774
- * @param {*} [options] Override http request option.
775
- * @throws {RequiredError}
776
- */
777
- async removeChat(chatId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
778
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).removeChat(chatId, options);
779
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
780
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
781
- return axios.request(axiosRequestArgs);
782
- };
783
- },
784
- /**
785
- *
786
- * @summary Temporary delete a chat .. so we have records of deleted chats before 100% delete
787
- * @param {string} chatId
788
- * @param {*} [options] Override http request option.
789
- * @throws {RequiredError}
790
- */
791
- async temporaryDelete(chatId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Chat>>> {
792
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).temporaryDelete(chatId, options);
793
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
794
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
795
- return axios.request(axiosRequestArgs);
796
- };
797
- },
798
- /**
799
- *
800
- * @summary Unarchive a chat
801
- * @param {string} chatId
802
- * @param {*} [options] Override http request option.
803
- * @throws {RequiredError}
804
- */
805
- async unarchiveChat(chatId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
806
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).unarchiveChat(chatId, options);
807
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
808
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
809
- return axios.request(axiosRequestArgs);
810
- };
811
- },
812
- /**
813
- *
814
- * @summary Update chat seen to be called once a chat tab is opened and scrolled to the bottom
815
- * @param {string} chatId
816
- * @param {*} [options] Override http request option.
817
- * @throws {RequiredError}
818
- */
819
- async updateChatSeen(chatId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
820
- const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).updateChatSeen(chatId, options);
821
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
822
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
823
- return axios.request(axiosRequestArgs);
824
- };
825
- },
826
- }
827
- };
828
-
829
- /**
830
- * ChatsApi - factory interface
831
- * @export
832
- */
833
- export const ChatsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
834
- return {
835
- /**
836
- *
837
- * @summary Add a new message to a chat
838
- * @param {string} chatId
839
- * @param {string} message
840
- * @param {Blob} file
841
- * @param {string} type
842
- * @param {*} [options] Override http request option.
843
- * @throws {RequiredError}
844
- */
845
- async addMessageToChatForm(chatId: string, message: string, file: Blob, type: string, options?: AxiosRequestConfig): Promise<AxiosResponse<PopulatedChatDto>> {
846
- return ChatsApiFp(configuration).addMessageToChatForm(chatId, message, file, type, options).then((request) => request(axios, basePath));
847
- },
848
- /**
849
- *
850
- * @summary Archive a chat
851
- * @param {string} chatId
852
- * @param {*} [options] Override http request option.
853
- * @throws {RequiredError}
854
- */
855
- async archiveChat(chatId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
856
- return ChatsApiFp(configuration).archiveChat(chatId, options).then((request) => request(axios, basePath));
857
- },
858
- /**
859
- *
860
- * @summary Close a chat
861
- * @param {string} chatId
862
- * @param {*} [options] Override http request option.
863
- * @throws {RequiredError}
864
- */
865
- async closeChat(chatId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
866
- return ChatsApiFp(configuration).closeChat(chatId, options).then((request) => request(axios, basePath));
867
- },
868
- /**
869
- *
870
- * @summary Create a new chat
871
- * @param {CreateChatDto} body
872
- * @param {*} [options] Override http request option.
873
- * @throws {RequiredError}
874
- */
875
- async createChat(body: CreateChatDto, options?: AxiosRequestConfig): Promise<AxiosResponse<PopulatedChatDto>> {
876
- return ChatsApiFp(configuration).createChat(body, options).then((request) => request(axios, basePath));
877
- },
878
- /**
879
- *
880
- * @summary Delete a message from a chat
881
- * @param {string} chatId
882
- * @param {string} msgId
883
- * @param {*} [options] Override http request option.
884
- * @throws {RequiredError}
885
- */
886
- async deleteMessage(chatId: string, msgId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Chat>> {
887
- return ChatsApiFp(configuration).deleteMessage(chatId, msgId, options).then((request) => request(axios, basePath));
888
- },
889
- /**
890
- *
891
- * @summary Get all chats
892
- * @param {*} [options] Override http request option.
893
- * @throws {RequiredError}
894
- */
895
- async getAllStoreChats(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<PopulatedChatDto>>> {
896
- return ChatsApiFp(configuration).getAllStoreChats(options).then((request) => request(axios, basePath));
897
- },
898
- /**
899
- *
900
- * @summary Get my chats to be used from the user side
901
- * @param {*} [options] Override http request option.
902
- * @throws {RequiredError}
903
- */
904
- async getMyChats(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<PopulatedChatDto>>> {
905
- return ChatsApiFp(configuration).getMyChats(options).then((request) => request(axios, basePath));
906
- },
907
- /**
908
- *
909
- * @summary Open a chat
910
- * @param {string} chatId
911
- * @param {*} [options] Override http request option.
912
- * @throws {RequiredError}
913
- */
914
- async openChat(chatId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
915
- return ChatsApiFp(configuration).openChat(chatId, options).then((request) => request(axios, basePath));
916
- },
917
- /**
918
- *
919
- * @summary Delete chat permenantly
920
- * @param {string} chatId
921
- * @param {*} [options] Override http request option.
922
- * @throws {RequiredError}
923
- */
924
- async removeChat(chatId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
925
- return ChatsApiFp(configuration).removeChat(chatId, options).then((request) => request(axios, basePath));
926
- },
927
- /**
928
- *
929
- * @summary Temporary delete a chat .. so we have records of deleted chats before 100% delete
930
- * @param {string} chatId
931
- * @param {*} [options] Override http request option.
932
- * @throws {RequiredError}
933
- */
934
- async temporaryDelete(chatId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Chat>> {
935
- return ChatsApiFp(configuration).temporaryDelete(chatId, options).then((request) => request(axios, basePath));
936
- },
937
- /**
938
- *
939
- * @summary Unarchive a chat
940
- * @param {string} chatId
941
- * @param {*} [options] Override http request option.
942
- * @throws {RequiredError}
943
- */
944
- async unarchiveChat(chatId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
945
- return ChatsApiFp(configuration).unarchiveChat(chatId, options).then((request) => request(axios, basePath));
946
- },
947
- /**
948
- *
949
- * @summary Update chat seen to be called once a chat tab is opened and scrolled to the bottom
950
- * @param {string} chatId
951
- * @param {*} [options] Override http request option.
952
- * @throws {RequiredError}
953
- */
954
- async updateChatSeen(chatId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
955
- return ChatsApiFp(configuration).updateChatSeen(chatId, options).then((request) => request(axios, basePath));
956
- },
957
- };
958
- };
959
-
960
- /**
961
- * ChatsApi - object-oriented interface
962
- * @export
963
- * @class ChatsApi
964
- * @extends {BaseAPI}
965
- */
966
- export class ChatsApi extends BaseAPI {
967
- /**
968
- *
969
- * @summary Add a new message to a chat
970
- * @param {string} chatId
971
- * @param {string} message
972
- * @param {Blob} file
973
- * @param {string} type
974
- * @param {*} [options] Override http request option.
975
- * @throws {RequiredError}
976
- * @memberof ChatsApi
977
- */
978
- public async addMessageToChatForm(chatId: string, message: string, file: Blob, type: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<PopulatedChatDto>> {
979
- return ChatsApiFp(this.configuration).addMessageToChatForm(chatId, message, file, type, options).then((request) => request(this.axios, this.basePath));
980
- }
981
- /**
982
- *
983
- * @summary Archive a chat
984
- * @param {string} chatId
985
- * @param {*} [options] Override http request option.
986
- * @throws {RequiredError}
987
- * @memberof ChatsApi
988
- */
989
- public async archiveChat(chatId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
990
- return ChatsApiFp(this.configuration).archiveChat(chatId, options).then((request) => request(this.axios, this.basePath));
991
- }
992
- /**
993
- *
994
- * @summary Close a chat
995
- * @param {string} chatId
996
- * @param {*} [options] Override http request option.
997
- * @throws {RequiredError}
998
- * @memberof ChatsApi
999
- */
1000
- public async closeChat(chatId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1001
- return ChatsApiFp(this.configuration).closeChat(chatId, options).then((request) => request(this.axios, this.basePath));
1002
- }
1003
- /**
1004
- *
1005
- * @summary Create a new chat
1006
- * @param {CreateChatDto} body
1007
- * @param {*} [options] Override http request option.
1008
- * @throws {RequiredError}
1009
- * @memberof ChatsApi
1010
- */
1011
- public async createChat(body: CreateChatDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<PopulatedChatDto>> {
1012
- return ChatsApiFp(this.configuration).createChat(body, options).then((request) => request(this.axios, this.basePath));
1013
- }
1014
- /**
1015
- *
1016
- * @summary Delete a message from a chat
1017
- * @param {string} chatId
1018
- * @param {string} msgId
1019
- * @param {*} [options] Override http request option.
1020
- * @throws {RequiredError}
1021
- * @memberof ChatsApi
1022
- */
1023
- public async deleteMessage(chatId: string, msgId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Chat>> {
1024
- return ChatsApiFp(this.configuration).deleteMessage(chatId, msgId, options).then((request) => request(this.axios, this.basePath));
1025
- }
1026
- /**
1027
- *
1028
- * @summary Get all chats
1029
- * @param {*} [options] Override http request option.
1030
- * @throws {RequiredError}
1031
- * @memberof ChatsApi
1032
- */
1033
- public async getAllStoreChats(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<PopulatedChatDto>>> {
1034
- return ChatsApiFp(this.configuration).getAllStoreChats(options).then((request) => request(this.axios, this.basePath));
1035
- }
1036
- /**
1037
- *
1038
- * @summary Get my chats to be used from the user side
1039
- * @param {*} [options] Override http request option.
1040
- * @throws {RequiredError}
1041
- * @memberof ChatsApi
1042
- */
1043
- public async getMyChats(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<PopulatedChatDto>>> {
1044
- return ChatsApiFp(this.configuration).getMyChats(options).then((request) => request(this.axios, this.basePath));
1045
- }
1046
- /**
1047
- *
1048
- * @summary Open a chat
1049
- * @param {string} chatId
1050
- * @param {*} [options] Override http request option.
1051
- * @throws {RequiredError}
1052
- * @memberof ChatsApi
1053
- */
1054
- public async openChat(chatId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1055
- return ChatsApiFp(this.configuration).openChat(chatId, options).then((request) => request(this.axios, this.basePath));
1056
- }
1057
- /**
1058
- *
1059
- * @summary Delete chat permenantly
1060
- * @param {string} chatId
1061
- * @param {*} [options] Override http request option.
1062
- * @throws {RequiredError}
1063
- * @memberof ChatsApi
1064
- */
1065
- public async removeChat(chatId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1066
- return ChatsApiFp(this.configuration).removeChat(chatId, options).then((request) => request(this.axios, this.basePath));
1067
- }
1068
- /**
1069
- *
1070
- * @summary Temporary delete a chat .. so we have records of deleted chats before 100% delete
1071
- * @param {string} chatId
1072
- * @param {*} [options] Override http request option.
1073
- * @throws {RequiredError}
1074
- * @memberof ChatsApi
1075
- */
1076
- public async temporaryDelete(chatId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Chat>> {
1077
- return ChatsApiFp(this.configuration).temporaryDelete(chatId, options).then((request) => request(this.axios, this.basePath));
1078
- }
1079
- /**
1080
- *
1081
- * @summary Unarchive a chat
1082
- * @param {string} chatId
1083
- * @param {*} [options] Override http request option.
1084
- * @throws {RequiredError}
1085
- * @memberof ChatsApi
1086
- */
1087
- public async unarchiveChat(chatId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1088
- return ChatsApiFp(this.configuration).unarchiveChat(chatId, options).then((request) => request(this.axios, this.basePath));
1089
- }
1090
- /**
1091
- *
1092
- * @summary Update chat seen to be called once a chat tab is opened and scrolled to the bottom
1093
- * @param {string} chatId
1094
- * @param {*} [options] Override http request option.
1095
- * @throws {RequiredError}
1096
- * @memberof ChatsApi
1097
- */
1098
- public async updateChatSeen(chatId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1099
- return ChatsApiFp(this.configuration).updateChatSeen(chatId, options).then((request) => request(this.axios, this.basePath));
1100
- }
1101
- }