@libgot/whatsapp-bridge-sdk 1.0.42 → 1.0.44-rc.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 +2 -2
- package/api.ts +1 -0
- package/apis/chats-api.ts +379 -0
- package/apis/sessions-api.ts +83 -0
- package/apis/tasks-api.ts +141 -0
- package/dist/api.d.ts +1 -0
- package/dist/api.js +1 -0
- package/dist/apis/chats-api.d.ts +149 -0
- package/dist/apis/chats-api.js +381 -0
- package/dist/apis/sessions-api.d.ts +33 -0
- package/dist/apis/sessions-api.js +86 -0
- package/dist/apis/tasks-api.d.ts +74 -0
- package/dist/apis/tasks-api.js +153 -0
- package/dist/models/chat-lifecycle-event-dto.d.ts +65 -0
- package/dist/models/chat-lifecycle-event-dto.js +26 -0
- package/dist/models/chat-lifecycle-events-response-dto.d.ts +25 -0
- package/dist/models/chat-lifecycle-events-response-dto.js +15 -0
- package/dist/models/create-chat-lifecycle-event-dto.d.ts +40 -0
- package/dist/models/create-chat-lifecycle-event-dto.js +26 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +6 -0
- package/dist/models/repair-missing-message-keys-dto.d.ts +19 -0
- package/dist/models/repair-missing-message-keys-dto.js +15 -0
- package/dist/models/send-template-data-dto.d.ts +6 -0
- package/dist/models/update-agent-dto.d.ts +55 -0
- package/dist/models/update-agent-dto.js +15 -0
- package/dist/models/update-chat-status-dto.d.ts +43 -0
- package/dist/models/update-chat-status-dto.js +15 -0
- package/dist/models/whatsapp-chat-dto.d.ts +6 -0
- package/models/chat-lifecycle-event-dto.ts +74 -0
- package/models/chat-lifecycle-events-response-dto.ts +29 -0
- package/models/create-chat-lifecycle-event-dto.ts +47 -0
- package/models/index.ts +6 -0
- package/models/repair-missing-message-keys-dto.ts +22 -0
- package/models/send-template-data-dto.ts +7 -0
- package/models/update-agent-dto.ts +64 -0
- package/models/update-chat-status-dto.ts +50 -0
- package/models/whatsapp-chat-dto.ts +7 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @1.0.
|
|
1
|
+
## @1.0.44-rc.1
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install @libgot/whatsapp-bridge-sdk@1.0.
|
|
39
|
+
npm install @libgot/whatsapp-bridge-sdk@1.0.44-rc.1 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/api.ts
CHANGED
package/apis/chats-api.ts
CHANGED
|
@@ -19,8 +19,13 @@ import { Configuration } from '../configuration';
|
|
|
19
19
|
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
20
20
|
import { AssignToMeDto } from '../models';
|
|
21
21
|
import { AssignmentTypeDto } from '../models';
|
|
22
|
+
import { ChatLifecycleEventDto } from '../models';
|
|
23
|
+
import { ChatLifecycleEventsResponseDto } from '../models';
|
|
24
|
+
import { CreateChatLifecycleEventDto } from '../models';
|
|
22
25
|
import { MarkChatUnreadDto } from '../models';
|
|
23
26
|
import { PaginationChatResponseDto } from '../models';
|
|
27
|
+
import { UpdateAgentDto } from '../models';
|
|
28
|
+
import { UpdateChatStatusDto } from '../models';
|
|
24
29
|
import { WhatsappChatResponseDTO } from '../models';
|
|
25
30
|
/**
|
|
26
31
|
* ChatsApi - axios parameter creator
|
|
@@ -142,6 +147,72 @@ export const ChatsApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
142
147
|
options: localVarRequestOptions,
|
|
143
148
|
};
|
|
144
149
|
},
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @param {CreateChatLifecycleEventDto} body
|
|
153
|
+
* @param {string} apikey
|
|
154
|
+
* @param {number} branchId
|
|
155
|
+
* @param {number} id
|
|
156
|
+
* @param {*} [options] Override http request option.
|
|
157
|
+
* @throws {RequiredError}
|
|
158
|
+
*/
|
|
159
|
+
createChatEvent: async (body: CreateChatLifecycleEventDto, apikey: string, branchId: number, id: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
160
|
+
// verify required parameter 'body' is not null or undefined
|
|
161
|
+
if (body === null || body === undefined) {
|
|
162
|
+
throw new RequiredError('body','Required parameter body was null or undefined when calling createChatEvent.');
|
|
163
|
+
}
|
|
164
|
+
// verify required parameter 'apikey' is not null or undefined
|
|
165
|
+
if (apikey === null || apikey === undefined) {
|
|
166
|
+
throw new RequiredError('apikey','Required parameter apikey was null or undefined when calling createChatEvent.');
|
|
167
|
+
}
|
|
168
|
+
// verify required parameter 'branchId' is not null or undefined
|
|
169
|
+
if (branchId === null || branchId === undefined) {
|
|
170
|
+
throw new RequiredError('branchId','Required parameter branchId was null or undefined when calling createChatEvent.');
|
|
171
|
+
}
|
|
172
|
+
// verify required parameter 'id' is not null or undefined
|
|
173
|
+
if (id === null || id === undefined) {
|
|
174
|
+
throw new RequiredError('id','Required parameter id was null or undefined when calling createChatEvent.');
|
|
175
|
+
}
|
|
176
|
+
const localVarPath = `/api/chats/{id}/events`
|
|
177
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
178
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
179
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
180
|
+
let baseOptions;
|
|
181
|
+
if (configuration) {
|
|
182
|
+
baseOptions = configuration.baseOptions;
|
|
183
|
+
}
|
|
184
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
185
|
+
const localVarHeaderParameter = {} as any;
|
|
186
|
+
const localVarQueryParameter = {} as any;
|
|
187
|
+
|
|
188
|
+
if (branchId !== undefined) {
|
|
189
|
+
localVarQueryParameter['branchId'] = branchId;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (apikey !== undefined && apikey !== null) {
|
|
193
|
+
localVarHeaderParameter['apikey'] = String(apikey);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
197
|
+
|
|
198
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
199
|
+
for (const key in localVarQueryParameter) {
|
|
200
|
+
query.set(key, localVarQueryParameter[key]);
|
|
201
|
+
}
|
|
202
|
+
for (const key in options.params) {
|
|
203
|
+
query.set(key, options.params[key]);
|
|
204
|
+
}
|
|
205
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
206
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
207
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
208
|
+
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
209
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
210
|
+
|
|
211
|
+
return {
|
|
212
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
213
|
+
options: localVarRequestOptions,
|
|
214
|
+
};
|
|
215
|
+
},
|
|
145
216
|
/**
|
|
146
217
|
*
|
|
147
218
|
* @param {number} id
|
|
@@ -190,6 +261,63 @@ export const ChatsApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
190
261
|
options: localVarRequestOptions,
|
|
191
262
|
};
|
|
192
263
|
},
|
|
264
|
+
/**
|
|
265
|
+
*
|
|
266
|
+
* @param {number} id
|
|
267
|
+
* @param {number} branchId
|
|
268
|
+
* @param {string} apikey
|
|
269
|
+
* @param {*} [options] Override http request option.
|
|
270
|
+
* @throws {RequiredError}
|
|
271
|
+
*/
|
|
272
|
+
getChatEvents: async (id: number, branchId: number, apikey: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
273
|
+
// verify required parameter 'id' is not null or undefined
|
|
274
|
+
if (id === null || id === undefined) {
|
|
275
|
+
throw new RequiredError('id','Required parameter id was null or undefined when calling getChatEvents.');
|
|
276
|
+
}
|
|
277
|
+
// verify required parameter 'branchId' is not null or undefined
|
|
278
|
+
if (branchId === null || branchId === undefined) {
|
|
279
|
+
throw new RequiredError('branchId','Required parameter branchId was null or undefined when calling getChatEvents.');
|
|
280
|
+
}
|
|
281
|
+
// verify required parameter 'apikey' is not null or undefined
|
|
282
|
+
if (apikey === null || apikey === undefined) {
|
|
283
|
+
throw new RequiredError('apikey','Required parameter apikey was null or undefined when calling getChatEvents.');
|
|
284
|
+
}
|
|
285
|
+
const localVarPath = `/api/chats/{id}/events`
|
|
286
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
287
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
288
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
289
|
+
let baseOptions;
|
|
290
|
+
if (configuration) {
|
|
291
|
+
baseOptions = configuration.baseOptions;
|
|
292
|
+
}
|
|
293
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
294
|
+
const localVarHeaderParameter = {} as any;
|
|
295
|
+
const localVarQueryParameter = {} as any;
|
|
296
|
+
|
|
297
|
+
if (branchId !== undefined) {
|
|
298
|
+
localVarQueryParameter['branchId'] = branchId;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (apikey !== undefined && apikey !== null) {
|
|
302
|
+
localVarHeaderParameter['apikey'] = String(apikey);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
306
|
+
for (const key in localVarQueryParameter) {
|
|
307
|
+
query.set(key, localVarQueryParameter[key]);
|
|
308
|
+
}
|
|
309
|
+
for (const key in options.params) {
|
|
310
|
+
query.set(key, options.params[key]);
|
|
311
|
+
}
|
|
312
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
313
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
314
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
315
|
+
|
|
316
|
+
return {
|
|
317
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
318
|
+
options: localVarRequestOptions,
|
|
319
|
+
};
|
|
320
|
+
},
|
|
193
321
|
/**
|
|
194
322
|
*
|
|
195
323
|
* @param {number} branchId
|
|
@@ -338,6 +466,108 @@ export const ChatsApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
338
466
|
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
339
467
|
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
340
468
|
|
|
469
|
+
return {
|
|
470
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
471
|
+
options: localVarRequestOptions,
|
|
472
|
+
};
|
|
473
|
+
},
|
|
474
|
+
/**
|
|
475
|
+
*
|
|
476
|
+
* @param {UpdateAgentDto} body
|
|
477
|
+
* @param {string} apikey
|
|
478
|
+
* @param {*} [options] Override http request option.
|
|
479
|
+
* @throws {RequiredError}
|
|
480
|
+
*/
|
|
481
|
+
updateAgent: async (body: UpdateAgentDto, apikey: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
482
|
+
// verify required parameter 'body' is not null or undefined
|
|
483
|
+
if (body === null || body === undefined) {
|
|
484
|
+
throw new RequiredError('body','Required parameter body was null or undefined when calling updateAgent.');
|
|
485
|
+
}
|
|
486
|
+
// verify required parameter 'apikey' is not null or undefined
|
|
487
|
+
if (apikey === null || apikey === undefined) {
|
|
488
|
+
throw new RequiredError('apikey','Required parameter apikey was null or undefined when calling updateAgent.');
|
|
489
|
+
}
|
|
490
|
+
const localVarPath = `/api/chats/update-agent`;
|
|
491
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
492
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
493
|
+
let baseOptions;
|
|
494
|
+
if (configuration) {
|
|
495
|
+
baseOptions = configuration.baseOptions;
|
|
496
|
+
}
|
|
497
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
498
|
+
const localVarHeaderParameter = {} as any;
|
|
499
|
+
const localVarQueryParameter = {} as any;
|
|
500
|
+
|
|
501
|
+
if (apikey !== undefined && apikey !== null) {
|
|
502
|
+
localVarHeaderParameter['apikey'] = String(apikey);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
506
|
+
|
|
507
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
508
|
+
for (const key in localVarQueryParameter) {
|
|
509
|
+
query.set(key, localVarQueryParameter[key]);
|
|
510
|
+
}
|
|
511
|
+
for (const key in options.params) {
|
|
512
|
+
query.set(key, options.params[key]);
|
|
513
|
+
}
|
|
514
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
515
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
516
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
517
|
+
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
518
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
519
|
+
|
|
520
|
+
return {
|
|
521
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
522
|
+
options: localVarRequestOptions,
|
|
523
|
+
};
|
|
524
|
+
},
|
|
525
|
+
/**
|
|
526
|
+
*
|
|
527
|
+
* @param {UpdateChatStatusDto} body
|
|
528
|
+
* @param {string} apikey
|
|
529
|
+
* @param {*} [options] Override http request option.
|
|
530
|
+
* @throws {RequiredError}
|
|
531
|
+
*/
|
|
532
|
+
updateChatStatus: async (body: UpdateChatStatusDto, apikey: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
533
|
+
// verify required parameter 'body' is not null or undefined
|
|
534
|
+
if (body === null || body === undefined) {
|
|
535
|
+
throw new RequiredError('body','Required parameter body was null or undefined when calling updateChatStatus.');
|
|
536
|
+
}
|
|
537
|
+
// verify required parameter 'apikey' is not null or undefined
|
|
538
|
+
if (apikey === null || apikey === undefined) {
|
|
539
|
+
throw new RequiredError('apikey','Required parameter apikey was null or undefined when calling updateChatStatus.');
|
|
540
|
+
}
|
|
541
|
+
const localVarPath = `/api/chats/status`;
|
|
542
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
543
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
544
|
+
let baseOptions;
|
|
545
|
+
if (configuration) {
|
|
546
|
+
baseOptions = configuration.baseOptions;
|
|
547
|
+
}
|
|
548
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
|
|
549
|
+
const localVarHeaderParameter = {} as any;
|
|
550
|
+
const localVarQueryParameter = {} as any;
|
|
551
|
+
|
|
552
|
+
if (apikey !== undefined && apikey !== null) {
|
|
553
|
+
localVarHeaderParameter['apikey'] = String(apikey);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
557
|
+
|
|
558
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
559
|
+
for (const key in localVarQueryParameter) {
|
|
560
|
+
query.set(key, localVarQueryParameter[key]);
|
|
561
|
+
}
|
|
562
|
+
for (const key in options.params) {
|
|
563
|
+
query.set(key, options.params[key]);
|
|
564
|
+
}
|
|
565
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
566
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
567
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
568
|
+
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
569
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
570
|
+
|
|
341
571
|
return {
|
|
342
572
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
343
573
|
options: localVarRequestOptions,
|
|
@@ -382,6 +612,22 @@ export const ChatsApiFp = function(configuration?: Configuration) {
|
|
|
382
612
|
return axios.request(axiosRequestArgs);
|
|
383
613
|
};
|
|
384
614
|
},
|
|
615
|
+
/**
|
|
616
|
+
*
|
|
617
|
+
* @param {CreateChatLifecycleEventDto} body
|
|
618
|
+
* @param {string} apikey
|
|
619
|
+
* @param {number} branchId
|
|
620
|
+
* @param {number} id
|
|
621
|
+
* @param {*} [options] Override http request option.
|
|
622
|
+
* @throws {RequiredError}
|
|
623
|
+
*/
|
|
624
|
+
async createChatEvent(body: CreateChatLifecycleEventDto, apikey: string, branchId: number, id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ChatLifecycleEventDto>>> {
|
|
625
|
+
const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).createChatEvent(body, apikey, branchId, id, options);
|
|
626
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
627
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
628
|
+
return axios.request(axiosRequestArgs);
|
|
629
|
+
};
|
|
630
|
+
},
|
|
385
631
|
/**
|
|
386
632
|
*
|
|
387
633
|
* @param {number} id
|
|
@@ -396,6 +642,21 @@ export const ChatsApiFp = function(configuration?: Configuration) {
|
|
|
396
642
|
return axios.request(axiosRequestArgs);
|
|
397
643
|
};
|
|
398
644
|
},
|
|
645
|
+
/**
|
|
646
|
+
*
|
|
647
|
+
* @param {number} id
|
|
648
|
+
* @param {number} branchId
|
|
649
|
+
* @param {string} apikey
|
|
650
|
+
* @param {*} [options] Override http request option.
|
|
651
|
+
* @throws {RequiredError}
|
|
652
|
+
*/
|
|
653
|
+
async getChatEvents(id: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ChatLifecycleEventsResponseDto>>> {
|
|
654
|
+
const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).getChatEvents(id, branchId, apikey, options);
|
|
655
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
656
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
657
|
+
return axios.request(axiosRequestArgs);
|
|
658
|
+
};
|
|
659
|
+
},
|
|
399
660
|
/**
|
|
400
661
|
*
|
|
401
662
|
* @param {number} branchId
|
|
@@ -434,6 +695,34 @@ export const ChatsApiFp = function(configuration?: Configuration) {
|
|
|
434
695
|
return axios.request(axiosRequestArgs);
|
|
435
696
|
};
|
|
436
697
|
},
|
|
698
|
+
/**
|
|
699
|
+
*
|
|
700
|
+
* @param {UpdateAgentDto} body
|
|
701
|
+
* @param {string} apikey
|
|
702
|
+
* @param {*} [options] Override http request option.
|
|
703
|
+
* @throws {RequiredError}
|
|
704
|
+
*/
|
|
705
|
+
async updateAgent(body: UpdateAgentDto, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
706
|
+
const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).updateAgent(body, apikey, options);
|
|
707
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
708
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
709
|
+
return axios.request(axiosRequestArgs);
|
|
710
|
+
};
|
|
711
|
+
},
|
|
712
|
+
/**
|
|
713
|
+
*
|
|
714
|
+
* @param {UpdateChatStatusDto} body
|
|
715
|
+
* @param {string} apikey
|
|
716
|
+
* @param {*} [options] Override http request option.
|
|
717
|
+
* @throws {RequiredError}
|
|
718
|
+
*/
|
|
719
|
+
async updateChatStatus(body: UpdateChatStatusDto, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
720
|
+
const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).updateChatStatus(body, apikey, options);
|
|
721
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
722
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
723
|
+
return axios.request(axiosRequestArgs);
|
|
724
|
+
};
|
|
725
|
+
},
|
|
437
726
|
}
|
|
438
727
|
};
|
|
439
728
|
|
|
@@ -465,6 +754,18 @@ export const ChatsApiFactory = function (configuration?: Configuration, basePath
|
|
|
465
754
|
async assignmentType(body: AssignmentTypeDto, apikey: string, cellphone: string, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
466
755
|
return ChatsApiFp(configuration).assignmentType(body, apikey, cellphone, id, options).then((request) => request(axios, basePath));
|
|
467
756
|
},
|
|
757
|
+
/**
|
|
758
|
+
*
|
|
759
|
+
* @param {CreateChatLifecycleEventDto} body
|
|
760
|
+
* @param {string} apikey
|
|
761
|
+
* @param {number} branchId
|
|
762
|
+
* @param {number} id
|
|
763
|
+
* @param {*} [options] Override http request option.
|
|
764
|
+
* @throws {RequiredError}
|
|
765
|
+
*/
|
|
766
|
+
async createChatEvent(body: CreateChatLifecycleEventDto, apikey: string, branchId: number, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ChatLifecycleEventDto>> {
|
|
767
|
+
return ChatsApiFp(configuration).createChatEvent(body, apikey, branchId, id, options).then((request) => request(axios, basePath));
|
|
768
|
+
},
|
|
468
769
|
/**
|
|
469
770
|
*
|
|
470
771
|
* @param {number} id
|
|
@@ -475,6 +776,17 @@ export const ChatsApiFactory = function (configuration?: Configuration, basePath
|
|
|
475
776
|
async getChat(id: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<WhatsappChatResponseDTO>> {
|
|
476
777
|
return ChatsApiFp(configuration).getChat(id, apikey, options).then((request) => request(axios, basePath));
|
|
477
778
|
},
|
|
779
|
+
/**
|
|
780
|
+
*
|
|
781
|
+
* @param {number} id
|
|
782
|
+
* @param {number} branchId
|
|
783
|
+
* @param {string} apikey
|
|
784
|
+
* @param {*} [options] Override http request option.
|
|
785
|
+
* @throws {RequiredError}
|
|
786
|
+
*/
|
|
787
|
+
async getChatEvents(id: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ChatLifecycleEventsResponseDto>> {
|
|
788
|
+
return ChatsApiFp(configuration).getChatEvents(id, branchId, apikey, options).then((request) => request(axios, basePath));
|
|
789
|
+
},
|
|
478
790
|
/**
|
|
479
791
|
*
|
|
480
792
|
* @param {number} branchId
|
|
@@ -505,6 +817,26 @@ export const ChatsApiFactory = function (configuration?: Configuration, basePath
|
|
|
505
817
|
async markChatUnread(body: MarkChatUnreadDto, apikey: string, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
506
818
|
return ChatsApiFp(configuration).markChatUnread(body, apikey, id, options).then((request) => request(axios, basePath));
|
|
507
819
|
},
|
|
820
|
+
/**
|
|
821
|
+
*
|
|
822
|
+
* @param {UpdateAgentDto} body
|
|
823
|
+
* @param {string} apikey
|
|
824
|
+
* @param {*} [options] Override http request option.
|
|
825
|
+
* @throws {RequiredError}
|
|
826
|
+
*/
|
|
827
|
+
async updateAgent(body: UpdateAgentDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
828
|
+
return ChatsApiFp(configuration).updateAgent(body, apikey, options).then((request) => request(axios, basePath));
|
|
829
|
+
},
|
|
830
|
+
/**
|
|
831
|
+
*
|
|
832
|
+
* @param {UpdateChatStatusDto} body
|
|
833
|
+
* @param {string} apikey
|
|
834
|
+
* @param {*} [options] Override http request option.
|
|
835
|
+
* @throws {RequiredError}
|
|
836
|
+
*/
|
|
837
|
+
async updateChatStatus(body: UpdateChatStatusDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
838
|
+
return ChatsApiFp(configuration).updateChatStatus(body, apikey, options).then((request) => request(axios, basePath));
|
|
839
|
+
},
|
|
508
840
|
};
|
|
509
841
|
};
|
|
510
842
|
|
|
@@ -539,6 +871,19 @@ export class ChatsApi extends BaseAPI {
|
|
|
539
871
|
public async assignmentType(body: AssignmentTypeDto, apikey: string, cellphone: string, id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
540
872
|
return ChatsApiFp(this.configuration).assignmentType(body, apikey, cellphone, id, options).then((request) => request(this.axios, this.basePath));
|
|
541
873
|
}
|
|
874
|
+
/**
|
|
875
|
+
*
|
|
876
|
+
* @param {CreateChatLifecycleEventDto} body
|
|
877
|
+
* @param {string} apikey
|
|
878
|
+
* @param {number} branchId
|
|
879
|
+
* @param {number} id
|
|
880
|
+
* @param {*} [options] Override http request option.
|
|
881
|
+
* @throws {RequiredError}
|
|
882
|
+
* @memberof ChatsApi
|
|
883
|
+
*/
|
|
884
|
+
public async createChatEvent(body: CreateChatLifecycleEventDto, apikey: string, branchId: number, id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<ChatLifecycleEventDto>> {
|
|
885
|
+
return ChatsApiFp(this.configuration).createChatEvent(body, apikey, branchId, id, options).then((request) => request(this.axios, this.basePath));
|
|
886
|
+
}
|
|
542
887
|
/**
|
|
543
888
|
*
|
|
544
889
|
* @param {number} id
|
|
@@ -550,6 +895,18 @@ export class ChatsApi extends BaseAPI {
|
|
|
550
895
|
public async getChat(id: number, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<WhatsappChatResponseDTO>> {
|
|
551
896
|
return ChatsApiFp(this.configuration).getChat(id, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
552
897
|
}
|
|
898
|
+
/**
|
|
899
|
+
*
|
|
900
|
+
* @param {number} id
|
|
901
|
+
* @param {number} branchId
|
|
902
|
+
* @param {string} apikey
|
|
903
|
+
* @param {*} [options] Override http request option.
|
|
904
|
+
* @throws {RequiredError}
|
|
905
|
+
* @memberof ChatsApi
|
|
906
|
+
*/
|
|
907
|
+
public async getChatEvents(id: number, branchId: number, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ChatLifecycleEventsResponseDto>> {
|
|
908
|
+
return ChatsApiFp(this.configuration).getChatEvents(id, branchId, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
909
|
+
}
|
|
553
910
|
/**
|
|
554
911
|
*
|
|
555
912
|
* @param {number} branchId
|
|
@@ -582,4 +939,26 @@ export class ChatsApi extends BaseAPI {
|
|
|
582
939
|
public async markChatUnread(body: MarkChatUnreadDto, apikey: string, id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
583
940
|
return ChatsApiFp(this.configuration).markChatUnread(body, apikey, id, options).then((request) => request(this.axios, this.basePath));
|
|
584
941
|
}
|
|
942
|
+
/**
|
|
943
|
+
*
|
|
944
|
+
* @param {UpdateAgentDto} body
|
|
945
|
+
* @param {string} apikey
|
|
946
|
+
* @param {*} [options] Override http request option.
|
|
947
|
+
* @throws {RequiredError}
|
|
948
|
+
* @memberof ChatsApi
|
|
949
|
+
*/
|
|
950
|
+
public async updateAgent(body: UpdateAgentDto, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
951
|
+
return ChatsApiFp(this.configuration).updateAgent(body, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
*
|
|
955
|
+
* @param {UpdateChatStatusDto} body
|
|
956
|
+
* @param {string} apikey
|
|
957
|
+
* @param {*} [options] Override http request option.
|
|
958
|
+
* @throws {RequiredError}
|
|
959
|
+
* @memberof ChatsApi
|
|
960
|
+
*/
|
|
961
|
+
public async updateChatStatus(body: UpdateChatStatusDto, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
962
|
+
return ChatsApiFp(this.configuration).updateChatStatus(body, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
963
|
+
}
|
|
585
964
|
}
|
package/apis/sessions-api.ts
CHANGED
|
@@ -25,6 +25,54 @@ import { SessionsResponseDataDto } from '../models';
|
|
|
25
25
|
*/
|
|
26
26
|
export const SessionsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
27
27
|
return {
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {number} chatId
|
|
31
|
+
* @param {string} apikey
|
|
32
|
+
* @param {*} [options] Override http request option.
|
|
33
|
+
* @throws {RequiredError}
|
|
34
|
+
*/
|
|
35
|
+
getCurrentSessionByChatId: async (chatId: number, apikey: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
36
|
+
// verify required parameter 'chatId' is not null or undefined
|
|
37
|
+
if (chatId === null || chatId === undefined) {
|
|
38
|
+
throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling getCurrentSessionByChatId.');
|
|
39
|
+
}
|
|
40
|
+
// verify required parameter 'apikey' is not null or undefined
|
|
41
|
+
if (apikey === null || apikey === undefined) {
|
|
42
|
+
throw new RequiredError('apikey','Required parameter apikey was null or undefined when calling getCurrentSessionByChatId.');
|
|
43
|
+
}
|
|
44
|
+
const localVarPath = `/api/sessions/chat/{chatId}`
|
|
45
|
+
.replace(`{${"chatId"}}`, encodeURIComponent(String(chatId)));
|
|
46
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
47
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
48
|
+
let baseOptions;
|
|
49
|
+
if (configuration) {
|
|
50
|
+
baseOptions = configuration.baseOptions;
|
|
51
|
+
}
|
|
52
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
53
|
+
const localVarHeaderParameter = {} as any;
|
|
54
|
+
const localVarQueryParameter = {} as any;
|
|
55
|
+
|
|
56
|
+
if (apikey !== undefined && apikey !== null) {
|
|
57
|
+
localVarHeaderParameter['apikey'] = String(apikey);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
61
|
+
for (const key in localVarQueryParameter) {
|
|
62
|
+
query.set(key, localVarQueryParameter[key]);
|
|
63
|
+
}
|
|
64
|
+
for (const key in options.params) {
|
|
65
|
+
query.set(key, options.params[key]);
|
|
66
|
+
}
|
|
67
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
68
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
69
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
73
|
+
options: localVarRequestOptions,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
28
76
|
/**
|
|
29
77
|
*
|
|
30
78
|
* @param {string} sessionUuid
|
|
@@ -133,6 +181,20 @@ export const SessionsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
133
181
|
*/
|
|
134
182
|
export const SessionsApiFp = function(configuration?: Configuration) {
|
|
135
183
|
return {
|
|
184
|
+
/**
|
|
185
|
+
*
|
|
186
|
+
* @param {number} chatId
|
|
187
|
+
* @param {string} apikey
|
|
188
|
+
* @param {*} [options] Override http request option.
|
|
189
|
+
* @throws {RequiredError}
|
|
190
|
+
*/
|
|
191
|
+
async getCurrentSessionByChatId(chatId: number, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<SessionResponseDataDto>>> {
|
|
192
|
+
const localVarAxiosArgs = await SessionsApiAxiosParamCreator(configuration).getCurrentSessionByChatId(chatId, apikey, options);
|
|
193
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
194
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
195
|
+
return axios.request(axiosRequestArgs);
|
|
196
|
+
};
|
|
197
|
+
},
|
|
136
198
|
/**
|
|
137
199
|
*
|
|
138
200
|
* @param {string} sessionUuid
|
|
@@ -170,6 +232,16 @@ export const SessionsApiFp = function(configuration?: Configuration) {
|
|
|
170
232
|
*/
|
|
171
233
|
export const SessionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
172
234
|
return {
|
|
235
|
+
/**
|
|
236
|
+
*
|
|
237
|
+
* @param {number} chatId
|
|
238
|
+
* @param {string} apikey
|
|
239
|
+
* @param {*} [options] Override http request option.
|
|
240
|
+
* @throws {RequiredError}
|
|
241
|
+
*/
|
|
242
|
+
async getCurrentSessionByChatId(chatId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SessionResponseDataDto>> {
|
|
243
|
+
return SessionsApiFp(configuration).getCurrentSessionByChatId(chatId, apikey, options).then((request) => request(axios, basePath));
|
|
244
|
+
},
|
|
173
245
|
/**
|
|
174
246
|
*
|
|
175
247
|
* @param {string} sessionUuid
|
|
@@ -200,6 +272,17 @@ export const SessionsApiFactory = function (configuration?: Configuration, baseP
|
|
|
200
272
|
* @extends {BaseAPI}
|
|
201
273
|
*/
|
|
202
274
|
export class SessionsApi extends BaseAPI {
|
|
275
|
+
/**
|
|
276
|
+
*
|
|
277
|
+
* @param {number} chatId
|
|
278
|
+
* @param {string} apikey
|
|
279
|
+
* @param {*} [options] Override http request option.
|
|
280
|
+
* @throws {RequiredError}
|
|
281
|
+
* @memberof SessionsApi
|
|
282
|
+
*/
|
|
283
|
+
public async getCurrentSessionByChatId(chatId: number, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<SessionResponseDataDto>> {
|
|
284
|
+
return SessionsApiFp(this.configuration).getCurrentSessionByChatId(chatId, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
285
|
+
}
|
|
203
286
|
/**
|
|
204
287
|
*
|
|
205
288
|
* @param {string} sessionUuid
|