@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.
Files changed (39) hide show
  1. package/README.md +2 -2
  2. package/api.ts +1 -0
  3. package/apis/chats-api.ts +379 -0
  4. package/apis/sessions-api.ts +83 -0
  5. package/apis/tasks-api.ts +141 -0
  6. package/dist/api.d.ts +1 -0
  7. package/dist/api.js +1 -0
  8. package/dist/apis/chats-api.d.ts +149 -0
  9. package/dist/apis/chats-api.js +381 -0
  10. package/dist/apis/sessions-api.d.ts +33 -0
  11. package/dist/apis/sessions-api.js +86 -0
  12. package/dist/apis/tasks-api.d.ts +74 -0
  13. package/dist/apis/tasks-api.js +153 -0
  14. package/dist/models/chat-lifecycle-event-dto.d.ts +65 -0
  15. package/dist/models/chat-lifecycle-event-dto.js +26 -0
  16. package/dist/models/chat-lifecycle-events-response-dto.d.ts +25 -0
  17. package/dist/models/chat-lifecycle-events-response-dto.js +15 -0
  18. package/dist/models/create-chat-lifecycle-event-dto.d.ts +40 -0
  19. package/dist/models/create-chat-lifecycle-event-dto.js +26 -0
  20. package/dist/models/index.d.ts +6 -0
  21. package/dist/models/index.js +6 -0
  22. package/dist/models/repair-missing-message-keys-dto.d.ts +19 -0
  23. package/dist/models/repair-missing-message-keys-dto.js +15 -0
  24. package/dist/models/send-template-data-dto.d.ts +6 -0
  25. package/dist/models/update-agent-dto.d.ts +55 -0
  26. package/dist/models/update-agent-dto.js +15 -0
  27. package/dist/models/update-chat-status-dto.d.ts +43 -0
  28. package/dist/models/update-chat-status-dto.js +15 -0
  29. package/dist/models/whatsapp-chat-dto.d.ts +6 -0
  30. package/models/chat-lifecycle-event-dto.ts +74 -0
  31. package/models/chat-lifecycle-events-response-dto.ts +29 -0
  32. package/models/create-chat-lifecycle-event-dto.ts +47 -0
  33. package/models/index.ts +6 -0
  34. package/models/repair-missing-message-keys-dto.ts +22 -0
  35. package/models/send-template-data-dto.ts +7 -0
  36. package/models/update-agent-dto.ts +64 -0
  37. package/models/update-chat-status-dto.ts +50 -0
  38. package/models/whatsapp-chat-dto.ts +7 -0
  39. package/package.json +2 -2
@@ -139,6 +139,67 @@ const ChatsApiAxiosParamCreator = function (configuration) {
139
139
  options: localVarRequestOptions,
140
140
  };
141
141
  }),
142
+ /**
143
+ *
144
+ * @param {CreateChatLifecycleEventDto} body
145
+ * @param {string} apikey
146
+ * @param {number} branchId
147
+ * @param {number} id
148
+ * @param {*} [options] Override http request option.
149
+ * @throws {RequiredError}
150
+ */
151
+ createChatEvent: (body_1, apikey_1, branchId_1, id_1, ...args_1) => __awaiter(this, [body_1, apikey_1, branchId_1, id_1, ...args_1], void 0, function* (body, apikey, branchId, id, options = {}) {
152
+ // verify required parameter 'body' is not null or undefined
153
+ if (body === null || body === undefined) {
154
+ throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling createChatEvent.');
155
+ }
156
+ // verify required parameter 'apikey' is not null or undefined
157
+ if (apikey === null || apikey === undefined) {
158
+ throw new base_1.RequiredError('apikey', 'Required parameter apikey was null or undefined when calling createChatEvent.');
159
+ }
160
+ // verify required parameter 'branchId' is not null or undefined
161
+ if (branchId === null || branchId === undefined) {
162
+ throw new base_1.RequiredError('branchId', 'Required parameter branchId was null or undefined when calling createChatEvent.');
163
+ }
164
+ // verify required parameter 'id' is not null or undefined
165
+ if (id === null || id === undefined) {
166
+ throw new base_1.RequiredError('id', 'Required parameter id was null or undefined when calling createChatEvent.');
167
+ }
168
+ const localVarPath = `/api/chats/{id}/events`
169
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
170
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
171
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
172
+ let baseOptions;
173
+ if (configuration) {
174
+ baseOptions = configuration.baseOptions;
175
+ }
176
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
177
+ const localVarHeaderParameter = {};
178
+ const localVarQueryParameter = {};
179
+ if (branchId !== undefined) {
180
+ localVarQueryParameter['branchId'] = branchId;
181
+ }
182
+ if (apikey !== undefined && apikey !== null) {
183
+ localVarHeaderParameter['apikey'] = String(apikey);
184
+ }
185
+ localVarHeaderParameter['Content-Type'] = 'application/json';
186
+ const query = new URLSearchParams(localVarUrlObj.search);
187
+ for (const key in localVarQueryParameter) {
188
+ query.set(key, localVarQueryParameter[key]);
189
+ }
190
+ for (const key in options.params) {
191
+ query.set(key, options.params[key]);
192
+ }
193
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
194
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
195
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
196
+ const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
197
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
198
+ return {
199
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
200
+ options: localVarRequestOptions,
201
+ };
202
+ }),
142
203
  /**
143
204
  *
144
205
  * @param {number} id
@@ -184,6 +245,59 @@ const ChatsApiAxiosParamCreator = function (configuration) {
184
245
  options: localVarRequestOptions,
185
246
  };
186
247
  }),
248
+ /**
249
+ *
250
+ * @param {number} id
251
+ * @param {number} branchId
252
+ * @param {string} apikey
253
+ * @param {*} [options] Override http request option.
254
+ * @throws {RequiredError}
255
+ */
256
+ getChatEvents: (id_1, branchId_1, apikey_1, ...args_1) => __awaiter(this, [id_1, branchId_1, apikey_1, ...args_1], void 0, function* (id, branchId, apikey, options = {}) {
257
+ // verify required parameter 'id' is not null or undefined
258
+ if (id === null || id === undefined) {
259
+ throw new base_1.RequiredError('id', 'Required parameter id was null or undefined when calling getChatEvents.');
260
+ }
261
+ // verify required parameter 'branchId' is not null or undefined
262
+ if (branchId === null || branchId === undefined) {
263
+ throw new base_1.RequiredError('branchId', 'Required parameter branchId was null or undefined when calling getChatEvents.');
264
+ }
265
+ // verify required parameter 'apikey' is not null or undefined
266
+ if (apikey === null || apikey === undefined) {
267
+ throw new base_1.RequiredError('apikey', 'Required parameter apikey was null or undefined when calling getChatEvents.');
268
+ }
269
+ const localVarPath = `/api/chats/{id}/events`
270
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
271
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
272
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
273
+ let baseOptions;
274
+ if (configuration) {
275
+ baseOptions = configuration.baseOptions;
276
+ }
277
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
278
+ const localVarHeaderParameter = {};
279
+ const localVarQueryParameter = {};
280
+ if (branchId !== undefined) {
281
+ localVarQueryParameter['branchId'] = branchId;
282
+ }
283
+ if (apikey !== undefined && apikey !== null) {
284
+ localVarHeaderParameter['apikey'] = String(apikey);
285
+ }
286
+ const query = new URLSearchParams(localVarUrlObj.search);
287
+ for (const key in localVarQueryParameter) {
288
+ query.set(key, localVarQueryParameter[key]);
289
+ }
290
+ for (const key in options.params) {
291
+ query.set(key, options.params[key]);
292
+ }
293
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
294
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
295
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
296
+ return {
297
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
298
+ options: localVarRequestOptions,
299
+ };
300
+ }),
187
301
  /**
188
302
  *
189
303
  * @param {number} branchId
@@ -320,6 +434,100 @@ const ChatsApiAxiosParamCreator = function (configuration) {
320
434
  options: localVarRequestOptions,
321
435
  };
322
436
  }),
437
+ /**
438
+ *
439
+ * @param {UpdateAgentDto} body
440
+ * @param {string} apikey
441
+ * @param {*} [options] Override http request option.
442
+ * @throws {RequiredError}
443
+ */
444
+ updateAgent: (body_1, apikey_1, ...args_1) => __awaiter(this, [body_1, apikey_1, ...args_1], void 0, function* (body, apikey, options = {}) {
445
+ // verify required parameter 'body' is not null or undefined
446
+ if (body === null || body === undefined) {
447
+ throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling updateAgent.');
448
+ }
449
+ // verify required parameter 'apikey' is not null or undefined
450
+ if (apikey === null || apikey === undefined) {
451
+ throw new base_1.RequiredError('apikey', 'Required parameter apikey was null or undefined when calling updateAgent.');
452
+ }
453
+ const localVarPath = `/api/chats/update-agent`;
454
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
455
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
456
+ let baseOptions;
457
+ if (configuration) {
458
+ baseOptions = configuration.baseOptions;
459
+ }
460
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
461
+ const localVarHeaderParameter = {};
462
+ const localVarQueryParameter = {};
463
+ if (apikey !== undefined && apikey !== null) {
464
+ localVarHeaderParameter['apikey'] = String(apikey);
465
+ }
466
+ localVarHeaderParameter['Content-Type'] = 'application/json';
467
+ const query = new URLSearchParams(localVarUrlObj.search);
468
+ for (const key in localVarQueryParameter) {
469
+ query.set(key, localVarQueryParameter[key]);
470
+ }
471
+ for (const key in options.params) {
472
+ query.set(key, options.params[key]);
473
+ }
474
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
475
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
476
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
477
+ const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
478
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
479
+ return {
480
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
481
+ options: localVarRequestOptions,
482
+ };
483
+ }),
484
+ /**
485
+ *
486
+ * @param {UpdateChatStatusDto} body
487
+ * @param {string} apikey
488
+ * @param {*} [options] Override http request option.
489
+ * @throws {RequiredError}
490
+ */
491
+ updateChatStatus: (body_1, apikey_1, ...args_1) => __awaiter(this, [body_1, apikey_1, ...args_1], void 0, function* (body, apikey, options = {}) {
492
+ // verify required parameter 'body' is not null or undefined
493
+ if (body === null || body === undefined) {
494
+ throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling updateChatStatus.');
495
+ }
496
+ // verify required parameter 'apikey' is not null or undefined
497
+ if (apikey === null || apikey === undefined) {
498
+ throw new base_1.RequiredError('apikey', 'Required parameter apikey was null or undefined when calling updateChatStatus.');
499
+ }
500
+ const localVarPath = `/api/chats/status`;
501
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
502
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
503
+ let baseOptions;
504
+ if (configuration) {
505
+ baseOptions = configuration.baseOptions;
506
+ }
507
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
508
+ const localVarHeaderParameter = {};
509
+ const localVarQueryParameter = {};
510
+ if (apikey !== undefined && apikey !== null) {
511
+ localVarHeaderParameter['apikey'] = String(apikey);
512
+ }
513
+ localVarHeaderParameter['Content-Type'] = 'application/json';
514
+ const query = new URLSearchParams(localVarUrlObj.search);
515
+ for (const key in localVarQueryParameter) {
516
+ query.set(key, localVarQueryParameter[key]);
517
+ }
518
+ for (const key in options.params) {
519
+ query.set(key, options.params[key]);
520
+ }
521
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
522
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
523
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
524
+ const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
525
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
526
+ return {
527
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
528
+ options: localVarRequestOptions,
529
+ };
530
+ }),
323
531
  };
324
532
  };
325
533
  exports.ChatsApiAxiosParamCreator = ChatsApiAxiosParamCreator;
@@ -363,6 +571,24 @@ const ChatsApiFp = function (configuration) {
363
571
  };
364
572
  });
365
573
  },
574
+ /**
575
+ *
576
+ * @param {CreateChatLifecycleEventDto} body
577
+ * @param {string} apikey
578
+ * @param {number} branchId
579
+ * @param {number} id
580
+ * @param {*} [options] Override http request option.
581
+ * @throws {RequiredError}
582
+ */
583
+ createChatEvent(body, apikey, branchId, id, options) {
584
+ return __awaiter(this, void 0, void 0, function* () {
585
+ const localVarAxiosArgs = yield (0, exports.ChatsApiAxiosParamCreator)(configuration).createChatEvent(body, apikey, branchId, id, options);
586
+ return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
587
+ const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
588
+ return axios.request(axiosRequestArgs);
589
+ };
590
+ });
591
+ },
366
592
  /**
367
593
  *
368
594
  * @param {number} id
@@ -379,6 +605,23 @@ const ChatsApiFp = function (configuration) {
379
605
  };
380
606
  });
381
607
  },
608
+ /**
609
+ *
610
+ * @param {number} id
611
+ * @param {number} branchId
612
+ * @param {string} apikey
613
+ * @param {*} [options] Override http request option.
614
+ * @throws {RequiredError}
615
+ */
616
+ getChatEvents(id, branchId, apikey, options) {
617
+ return __awaiter(this, void 0, void 0, function* () {
618
+ const localVarAxiosArgs = yield (0, exports.ChatsApiAxiosParamCreator)(configuration).getChatEvents(id, branchId, apikey, options);
619
+ return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
620
+ const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
621
+ return axios.request(axiosRequestArgs);
622
+ };
623
+ });
624
+ },
382
625
  /**
383
626
  *
384
627
  * @param {number} branchId
@@ -421,6 +664,38 @@ const ChatsApiFp = function (configuration) {
421
664
  };
422
665
  });
423
666
  },
667
+ /**
668
+ *
669
+ * @param {UpdateAgentDto} body
670
+ * @param {string} apikey
671
+ * @param {*} [options] Override http request option.
672
+ * @throws {RequiredError}
673
+ */
674
+ updateAgent(body, apikey, options) {
675
+ return __awaiter(this, void 0, void 0, function* () {
676
+ const localVarAxiosArgs = yield (0, exports.ChatsApiAxiosParamCreator)(configuration).updateAgent(body, apikey, options);
677
+ return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
678
+ const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
679
+ return axios.request(axiosRequestArgs);
680
+ };
681
+ });
682
+ },
683
+ /**
684
+ *
685
+ * @param {UpdateChatStatusDto} body
686
+ * @param {string} apikey
687
+ * @param {*} [options] Override http request option.
688
+ * @throws {RequiredError}
689
+ */
690
+ updateChatStatus(body, apikey, options) {
691
+ return __awaiter(this, void 0, void 0, function* () {
692
+ const localVarAxiosArgs = yield (0, exports.ChatsApiAxiosParamCreator)(configuration).updateChatStatus(body, apikey, options);
693
+ return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
694
+ const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
695
+ return axios.request(axiosRequestArgs);
696
+ };
697
+ });
698
+ },
424
699
  };
425
700
  };
426
701
  exports.ChatsApiFp = ChatsApiFp;
@@ -456,6 +731,20 @@ const ChatsApiFactory = function (configuration, basePath, axios) {
456
731
  return (0, exports.ChatsApiFp)(configuration).assignmentType(body, apikey, cellphone, id, options).then((request) => request(axios, basePath));
457
732
  });
458
733
  },
734
+ /**
735
+ *
736
+ * @param {CreateChatLifecycleEventDto} body
737
+ * @param {string} apikey
738
+ * @param {number} branchId
739
+ * @param {number} id
740
+ * @param {*} [options] Override http request option.
741
+ * @throws {RequiredError}
742
+ */
743
+ createChatEvent(body, apikey, branchId, id, options) {
744
+ return __awaiter(this, void 0, void 0, function* () {
745
+ return (0, exports.ChatsApiFp)(configuration).createChatEvent(body, apikey, branchId, id, options).then((request) => request(axios, basePath));
746
+ });
747
+ },
459
748
  /**
460
749
  *
461
750
  * @param {number} id
@@ -468,6 +757,19 @@ const ChatsApiFactory = function (configuration, basePath, axios) {
468
757
  return (0, exports.ChatsApiFp)(configuration).getChat(id, apikey, options).then((request) => request(axios, basePath));
469
758
  });
470
759
  },
760
+ /**
761
+ *
762
+ * @param {number} id
763
+ * @param {number} branchId
764
+ * @param {string} apikey
765
+ * @param {*} [options] Override http request option.
766
+ * @throws {RequiredError}
767
+ */
768
+ getChatEvents(id, branchId, apikey, options) {
769
+ return __awaiter(this, void 0, void 0, function* () {
770
+ return (0, exports.ChatsApiFp)(configuration).getChatEvents(id, branchId, apikey, options).then((request) => request(axios, basePath));
771
+ });
772
+ },
471
773
  /**
472
774
  *
473
775
  * @param {number} branchId
@@ -502,6 +804,30 @@ const ChatsApiFactory = function (configuration, basePath, axios) {
502
804
  return (0, exports.ChatsApiFp)(configuration).markChatUnread(body, apikey, id, options).then((request) => request(axios, basePath));
503
805
  });
504
806
  },
807
+ /**
808
+ *
809
+ * @param {UpdateAgentDto} body
810
+ * @param {string} apikey
811
+ * @param {*} [options] Override http request option.
812
+ * @throws {RequiredError}
813
+ */
814
+ updateAgent(body, apikey, options) {
815
+ return __awaiter(this, void 0, void 0, function* () {
816
+ return (0, exports.ChatsApiFp)(configuration).updateAgent(body, apikey, options).then((request) => request(axios, basePath));
817
+ });
818
+ },
819
+ /**
820
+ *
821
+ * @param {UpdateChatStatusDto} body
822
+ * @param {string} apikey
823
+ * @param {*} [options] Override http request option.
824
+ * @throws {RequiredError}
825
+ */
826
+ updateChatStatus(body, apikey, options) {
827
+ return __awaiter(this, void 0, void 0, function* () {
828
+ return (0, exports.ChatsApiFp)(configuration).updateChatStatus(body, apikey, options).then((request) => request(axios, basePath));
829
+ });
830
+ },
505
831
  };
506
832
  };
507
833
  exports.ChatsApiFactory = ChatsApiFactory;
@@ -540,6 +866,21 @@ class ChatsApi extends base_1.BaseAPI {
540
866
  return (0, exports.ChatsApiFp)(this.configuration).assignmentType(body, apikey, cellphone, id, options).then((request) => request(this.axios, this.basePath));
541
867
  });
542
868
  }
869
+ /**
870
+ *
871
+ * @param {CreateChatLifecycleEventDto} body
872
+ * @param {string} apikey
873
+ * @param {number} branchId
874
+ * @param {number} id
875
+ * @param {*} [options] Override http request option.
876
+ * @throws {RequiredError}
877
+ * @memberof ChatsApi
878
+ */
879
+ createChatEvent(body, apikey, branchId, id, options) {
880
+ return __awaiter(this, void 0, void 0, function* () {
881
+ return (0, exports.ChatsApiFp)(this.configuration).createChatEvent(body, apikey, branchId, id, options).then((request) => request(this.axios, this.basePath));
882
+ });
883
+ }
543
884
  /**
544
885
  *
545
886
  * @param {number} id
@@ -553,6 +894,20 @@ class ChatsApi extends base_1.BaseAPI {
553
894
  return (0, exports.ChatsApiFp)(this.configuration).getChat(id, apikey, options).then((request) => request(this.axios, this.basePath));
554
895
  });
555
896
  }
897
+ /**
898
+ *
899
+ * @param {number} id
900
+ * @param {number} branchId
901
+ * @param {string} apikey
902
+ * @param {*} [options] Override http request option.
903
+ * @throws {RequiredError}
904
+ * @memberof ChatsApi
905
+ */
906
+ getChatEvents(id, branchId, apikey, options) {
907
+ return __awaiter(this, void 0, void 0, function* () {
908
+ return (0, exports.ChatsApiFp)(this.configuration).getChatEvents(id, branchId, apikey, options).then((request) => request(this.axios, this.basePath));
909
+ });
910
+ }
556
911
  /**
557
912
  *
558
913
  * @param {number} branchId
@@ -589,5 +944,31 @@ class ChatsApi extends base_1.BaseAPI {
589
944
  return (0, exports.ChatsApiFp)(this.configuration).markChatUnread(body, apikey, id, options).then((request) => request(this.axios, this.basePath));
590
945
  });
591
946
  }
947
+ /**
948
+ *
949
+ * @param {UpdateAgentDto} body
950
+ * @param {string} apikey
951
+ * @param {*} [options] Override http request option.
952
+ * @throws {RequiredError}
953
+ * @memberof ChatsApi
954
+ */
955
+ updateAgent(body, apikey, options) {
956
+ return __awaiter(this, void 0, void 0, function* () {
957
+ return (0, exports.ChatsApiFp)(this.configuration).updateAgent(body, apikey, options).then((request) => request(this.axios, this.basePath));
958
+ });
959
+ }
960
+ /**
961
+ *
962
+ * @param {UpdateChatStatusDto} body
963
+ * @param {string} apikey
964
+ * @param {*} [options] Override http request option.
965
+ * @throws {RequiredError}
966
+ * @memberof ChatsApi
967
+ */
968
+ updateChatStatus(body, apikey, options) {
969
+ return __awaiter(this, void 0, void 0, function* () {
970
+ return (0, exports.ChatsApiFp)(this.configuration).updateChatStatus(body, apikey, options).then((request) => request(this.axios, this.basePath));
971
+ });
972
+ }
592
973
  }
593
974
  exports.ChatsApi = ChatsApi;
@@ -19,6 +19,14 @@ import { SessionsResponseDataDto } from '../models';
19
19
  * @export
20
20
  */
21
21
  export declare const SessionsApiAxiosParamCreator: (configuration?: Configuration) => {
22
+ /**
23
+ *
24
+ * @param {number} chatId
25
+ * @param {string} apikey
26
+ * @param {*} [options] Override http request option.
27
+ * @throws {RequiredError}
28
+ */
29
+ getCurrentSessionByChatId: (chatId: number, apikey: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
22
30
  /**
23
31
  *
24
32
  * @param {string} sessionUuid
@@ -41,6 +49,14 @@ export declare const SessionsApiAxiosParamCreator: (configuration?: Configuratio
41
49
  * @export
42
50
  */
43
51
  export declare const SessionsApiFp: (configuration?: Configuration) => {
52
+ /**
53
+ *
54
+ * @param {number} chatId
55
+ * @param {string} apikey
56
+ * @param {*} [options] Override http request option.
57
+ * @throws {RequiredError}
58
+ */
59
+ getCurrentSessionByChatId(chatId: number, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<SessionResponseDataDto>>>;
44
60
  /**
45
61
  *
46
62
  * @param {string} sessionUuid
@@ -63,6 +79,14 @@ export declare const SessionsApiFp: (configuration?: Configuration) => {
63
79
  * @export
64
80
  */
65
81
  export declare const SessionsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
82
+ /**
83
+ *
84
+ * @param {number} chatId
85
+ * @param {string} apikey
86
+ * @param {*} [options] Override http request option.
87
+ * @throws {RequiredError}
88
+ */
89
+ getCurrentSessionByChatId(chatId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SessionResponseDataDto>>;
66
90
  /**
67
91
  *
68
92
  * @param {string} sessionUuid
@@ -87,6 +111,15 @@ export declare const SessionsApiFactory: (configuration?: Configuration, basePat
87
111
  * @extends {BaseAPI}
88
112
  */
89
113
  export declare class SessionsApi extends BaseAPI {
114
+ /**
115
+ *
116
+ * @param {number} chatId
117
+ * @param {string} apikey
118
+ * @param {*} [options] Override http request option.
119
+ * @throws {RequiredError}
120
+ * @memberof SessionsApi
121
+ */
122
+ getCurrentSessionByChatId(chatId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SessionResponseDataDto>>;
90
123
  /**
91
124
  *
92
125
  * @param {string} sessionUuid
@@ -33,6 +33,51 @@ const base_1 = require("../base");
33
33
  */
34
34
  const SessionsApiAxiosParamCreator = function (configuration) {
35
35
  return {
36
+ /**
37
+ *
38
+ * @param {number} chatId
39
+ * @param {string} apikey
40
+ * @param {*} [options] Override http request option.
41
+ * @throws {RequiredError}
42
+ */
43
+ getCurrentSessionByChatId: (chatId_1, apikey_1, ...args_1) => __awaiter(this, [chatId_1, apikey_1, ...args_1], void 0, function* (chatId, apikey, options = {}) {
44
+ // verify required parameter 'chatId' is not null or undefined
45
+ if (chatId === null || chatId === undefined) {
46
+ throw new base_1.RequiredError('chatId', 'Required parameter chatId was null or undefined when calling getCurrentSessionByChatId.');
47
+ }
48
+ // verify required parameter 'apikey' is not null or undefined
49
+ if (apikey === null || apikey === undefined) {
50
+ throw new base_1.RequiredError('apikey', 'Required parameter apikey was null or undefined when calling getCurrentSessionByChatId.');
51
+ }
52
+ const localVarPath = `/api/sessions/chat/{chatId}`
53
+ .replace(`{${"chatId"}}`, encodeURIComponent(String(chatId)));
54
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
55
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
56
+ let baseOptions;
57
+ if (configuration) {
58
+ baseOptions = configuration.baseOptions;
59
+ }
60
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
61
+ const localVarHeaderParameter = {};
62
+ const localVarQueryParameter = {};
63
+ if (apikey !== undefined && apikey !== null) {
64
+ localVarHeaderParameter['apikey'] = String(apikey);
65
+ }
66
+ const query = new URLSearchParams(localVarUrlObj.search);
67
+ for (const key in localVarQueryParameter) {
68
+ query.set(key, localVarQueryParameter[key]);
69
+ }
70
+ for (const key in options.params) {
71
+ query.set(key, options.params[key]);
72
+ }
73
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
74
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
75
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
76
+ return {
77
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
78
+ options: localVarRequestOptions,
79
+ };
80
+ }),
36
81
  /**
37
82
  *
38
83
  * @param {string} sessionUuid
@@ -134,6 +179,22 @@ exports.SessionsApiAxiosParamCreator = SessionsApiAxiosParamCreator;
134
179
  */
135
180
  const SessionsApiFp = function (configuration) {
136
181
  return {
182
+ /**
183
+ *
184
+ * @param {number} chatId
185
+ * @param {string} apikey
186
+ * @param {*} [options] Override http request option.
187
+ * @throws {RequiredError}
188
+ */
189
+ getCurrentSessionByChatId(chatId, apikey, options) {
190
+ return __awaiter(this, void 0, void 0, function* () {
191
+ const localVarAxiosArgs = yield (0, exports.SessionsApiAxiosParamCreator)(configuration).getCurrentSessionByChatId(chatId, apikey, options);
192
+ return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
193
+ const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
194
+ return axios.request(axiosRequestArgs);
195
+ };
196
+ });
197
+ },
137
198
  /**
138
199
  *
139
200
  * @param {string} sessionUuid
@@ -175,6 +236,18 @@ exports.SessionsApiFp = SessionsApiFp;
175
236
  */
176
237
  const SessionsApiFactory = function (configuration, basePath, axios) {
177
238
  return {
239
+ /**
240
+ *
241
+ * @param {number} chatId
242
+ * @param {string} apikey
243
+ * @param {*} [options] Override http request option.
244
+ * @throws {RequiredError}
245
+ */
246
+ getCurrentSessionByChatId(chatId, apikey, options) {
247
+ return __awaiter(this, void 0, void 0, function* () {
248
+ return (0, exports.SessionsApiFp)(configuration).getCurrentSessionByChatId(chatId, apikey, options).then((request) => request(axios, basePath));
249
+ });
250
+ },
178
251
  /**
179
252
  *
180
253
  * @param {string} sessionUuid
@@ -209,6 +282,19 @@ exports.SessionsApiFactory = SessionsApiFactory;
209
282
  * @extends {BaseAPI}
210
283
  */
211
284
  class SessionsApi extends base_1.BaseAPI {
285
+ /**
286
+ *
287
+ * @param {number} chatId
288
+ * @param {string} apikey
289
+ * @param {*} [options] Override http request option.
290
+ * @throws {RequiredError}
291
+ * @memberof SessionsApi
292
+ */
293
+ getCurrentSessionByChatId(chatId, apikey, options) {
294
+ return __awaiter(this, void 0, void 0, function* () {
295
+ return (0, exports.SessionsApiFp)(this.configuration).getCurrentSessionByChatId(chatId, apikey, options).then((request) => request(this.axios, this.basePath));
296
+ });
297
+ }
212
298
  /**
213
299
  *
214
300
  * @param {string} sessionUuid