webitel-sdk 0.1.90 → 0.1.94

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 (98) hide show
  1. package/bundles/index.esm.js +973 -249
  2. package/bundles/index.esm.js.map +1 -1
  3. package/bundles/index.esm.min.js +1 -1
  4. package/bundles/index.esm.min.js.map +1 -1
  5. package/bundles/index.umd.js +1078 -253
  6. package/bundles/index.umd.js.map +1 -1
  7. package/bundles/index.umd.min.js +1 -1
  8. package/bundles/index.umd.min.js.map +1 -1
  9. package/esm2015/api/engine-chat-plan.js +13 -0
  10. package/esm2015/api/engine-chat-plan.js.map +1 -0
  11. package/esm2015/api/engine-create-chat-plan-request.js +13 -0
  12. package/esm2015/api/engine-create-chat-plan-request.js.map +1 -0
  13. package/esm2015/api/engine-list-chat-plan.js +13 -0
  14. package/esm2015/api/engine-list-chat-plan.js.map +1 -0
  15. package/esm2015/api/engine-patch-chat-plan-request.js +13 -0
  16. package/esm2015/api/engine-patch-chat-plan-request.js.map +1 -0
  17. package/esm2015/api/engine-patch-queue-bucket-request.js +13 -0
  18. package/esm2015/api/engine-patch-queue-bucket-request.js.map +1 -0
  19. package/esm2015/api/engine-update-chat-plan-request.js +13 -0
  20. package/esm2015/api/engine-update-chat-plan-request.js.map +1 -0
  21. package/esm2015/api/index.js.map +1 -1
  22. package/esm2015/api/queue-bucket-service-api.js +125 -27
  23. package/esm2015/api/queue-bucket-service-api.js.map +1 -1
  24. package/esm2015/api/routing-chat-plan-service-api.js +572 -0
  25. package/esm2015/api/routing-chat-plan-service-api.js.map +1 -0
  26. package/esm2015/api.js +1 -0
  27. package/esm2015/api.js.map +1 -1
  28. package/esm2015/socket/client.js +54 -5
  29. package/esm2015/socket/client.js.map +1 -1
  30. package/esm2015/socket/conversation.js +26 -9
  31. package/esm2015/socket/conversation.js.map +1 -1
  32. package/esm2015/socket/task.js +6 -2
  33. package/esm2015/socket/task.js.map +1 -1
  34. package/esm5/api/engine-chat-plan.js +13 -0
  35. package/esm5/api/engine-chat-plan.js.map +1 -0
  36. package/esm5/api/engine-create-chat-plan-request.js +13 -0
  37. package/esm5/api/engine-create-chat-plan-request.js.map +1 -0
  38. package/esm5/api/engine-list-chat-plan.js +13 -0
  39. package/esm5/api/engine-list-chat-plan.js.map +1 -0
  40. package/esm5/api/engine-patch-chat-plan-request.js +13 -0
  41. package/esm5/api/engine-patch-chat-plan-request.js.map +1 -0
  42. package/esm5/api/engine-patch-queue-bucket-request.js +13 -0
  43. package/esm5/api/engine-patch-queue-bucket-request.js.map +1 -0
  44. package/esm5/api/engine-update-chat-plan-request.js +13 -0
  45. package/esm5/api/engine-update-chat-plan-request.js.map +1 -0
  46. package/esm5/api/index.js.map +1 -1
  47. package/esm5/api/queue-bucket-service-api.js +138 -27
  48. package/esm5/api/queue-bucket-service-api.js.map +1 -1
  49. package/esm5/api/routing-chat-plan-service-api.js +645 -0
  50. package/esm5/api/routing-chat-plan-service-api.js.map +1 -0
  51. package/esm5/api.js +1 -0
  52. package/esm5/api.js.map +1 -1
  53. package/esm5/socket/client.js +58 -6
  54. package/esm5/socket/client.js.map +1 -1
  55. package/esm5/socket/conversation.js +31 -9
  56. package/esm5/socket/conversation.js.map +1 -1
  57. package/esm5/socket/task.js +11 -2
  58. package/esm5/socket/task.js.map +1 -1
  59. package/package.json +1 -1
  60. package/types/api/create-call-request-call-settings.d.ts +6 -0
  61. package/types/api/create-call-request-call-settings.d.ts.map +1 -1
  62. package/types/api/engine-chat-plan.d.ts +50 -0
  63. package/types/api/engine-chat-plan.d.ts.map +1 -0
  64. package/types/api/engine-create-chat-plan-request.d.ts +44 -0
  65. package/types/api/engine-create-chat-plan-request.d.ts.map +1 -0
  66. package/types/api/engine-create-queue-bucket-request.d.ts +8 -2
  67. package/types/api/engine-create-queue-bucket-request.d.ts.map +1 -1
  68. package/types/api/engine-history-call.d.ts +6 -0
  69. package/types/api/engine-history-call.d.ts.map +1 -1
  70. package/types/api/engine-list-chat-plan.d.ts +32 -0
  71. package/types/api/engine-list-chat-plan.d.ts.map +1 -0
  72. package/types/api/engine-patch-chat-plan-request.d.ts +56 -0
  73. package/types/api/engine-patch-chat-plan-request.d.ts.map +1 -0
  74. package/types/api/engine-patch-queue-bucket-request.d.ts +62 -0
  75. package/types/api/engine-patch-queue-bucket-request.d.ts.map +1 -0
  76. package/types/api/engine-queue-bucket.d.ts +12 -0
  77. package/types/api/engine-queue-bucket.d.ts.map +1 -1
  78. package/types/api/engine-queue-resource-group.d.ts +6 -0
  79. package/types/api/engine-queue-resource-group.d.ts.map +1 -1
  80. package/types/api/engine-update-chat-plan-request.d.ts +50 -0
  81. package/types/api/engine-update-chat-plan-request.d.ts.map +1 -0
  82. package/types/api/engine-update-queue-bucket-request.d.ts +8 -2
  83. package/types/api/engine-update-queue-bucket-request.d.ts.map +1 -1
  84. package/types/api/index.d.ts +6 -0
  85. package/types/api/index.d.ts.map +1 -1
  86. package/types/api/queue-bucket-service-api.d.ts +46 -16
  87. package/types/api/queue-bucket-service-api.d.ts.map +1 -1
  88. package/types/api/routing-chat-plan-service-api.d.ts +225 -0
  89. package/types/api/routing-chat-plan-service-api.d.ts.map +1 -0
  90. package/types/api.d.ts +1 -0
  91. package/types/api.d.ts.map +1 -1
  92. package/types/socket/call.d.ts +2 -2
  93. package/types/socket/call.d.ts.map +1 -1
  94. package/types/socket/client.d.ts.map +1 -1
  95. package/types/socket/conversation.d.ts +15 -5
  96. package/types/socket/conversation.d.ts.map +1 -1
  97. package/types/socket/task.d.ts +3 -0
  98. package/types/socket/task.d.ts.map +1 -1
@@ -15169,11 +15169,10 @@ const QueueBucketServiceApiAxiosParamCreator = function (configuration) {
15169
15169
  * @summary DeleteQueueRouting
15170
15170
  * @param {string} queueId
15171
15171
  * @param {string} id
15172
- * @param {string} [domainId]
15173
15172
  * @param {*} [options] Override http request option.
15174
15173
  * @throws {RequiredError}
15175
15174
  */
15176
- deleteQueueBucket: async (queueId, id, domainId, options = {}) => {
15175
+ deleteQueueBucket: async (queueId, id, options = {}) => {
15177
15176
  // verify required parameter 'queueId' is not null or undefined
15178
15177
  if (queueId === null || queueId === undefined) {
15179
15178
  throw new RequiredError('queueId', 'Required parameter queueId was null or undefined when calling deleteQueueBucket.');
@@ -15204,9 +15203,68 @@ const QueueBucketServiceApiAxiosParamCreator = function (configuration) {
15204
15203
  : await configuration.apiKey;
15205
15204
  localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
15206
15205
  }
15207
- if (domainId !== undefined) {
15208
- localVarQueryParameter['domain_id'] = domainId;
15206
+ localVarUrlObj.query = {
15207
+ ...localVarUrlObj.query,
15208
+ ...localVarQueryParameter,
15209
+ ...options.query,
15210
+ };
15211
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
15212
+ delete localVarUrlObj.search;
15213
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
15214
+ localVarRequestOptions.headers = {
15215
+ ...localVarHeaderParameter,
15216
+ ...headersFromBaseOptions,
15217
+ ...options.headers,
15218
+ };
15219
+ return {
15220
+ url: format(localVarUrlObj),
15221
+ options: localVarRequestOptions,
15222
+ };
15223
+ },
15224
+ /**
15225
+ *
15226
+ * @param {string} queueId
15227
+ * @param {string} id
15228
+ * @param {EnginePatchQueueBucketRequest} body
15229
+ * @param {*} [options] Override http request option.
15230
+ * @throws {RequiredError}
15231
+ */
15232
+ patchQueueBucket: async (queueId, id, body, options = {}) => {
15233
+ // verify required parameter 'queueId' is not null or undefined
15234
+ if (queueId === null || queueId === undefined) {
15235
+ throw new RequiredError('queueId', 'Required parameter queueId was null or undefined when calling patchQueueBucket.');
15236
+ }
15237
+ // verify required parameter 'id' is not null or undefined
15238
+ if (id === null || id === undefined) {
15239
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling patchQueueBucket.');
15240
+ }
15241
+ // verify required parameter 'body' is not null or undefined
15242
+ if (body === null || body === undefined) {
15243
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling patchQueueBucket.');
15244
+ }
15245
+ const localVarPath = `/call_center/queues/{queue_id}/buckets/{id}`
15246
+ .replace(`{${'queue_id'}}`, encodeURIComponent(String(queueId)))
15247
+ .replace(`{${'id'}}`, encodeURIComponent(String(id)));
15248
+ const localVarUrlObj = parse(localVarPath, true);
15249
+ let baseOptions;
15250
+ if (configuration) {
15251
+ baseOptions = configuration.baseOptions;
15252
+ }
15253
+ const localVarRequestOptions = {
15254
+ method: 'PATCH',
15255
+ ...baseOptions,
15256
+ ...options,
15257
+ };
15258
+ const localVarHeaderParameter = {};
15259
+ const localVarQueryParameter = {};
15260
+ // authentication AccessToken required
15261
+ if (configuration && configuration.apiKey) {
15262
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
15263
+ ? await configuration.apiKey('X-Webitel-Access')
15264
+ : await configuration.apiKey;
15265
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
15209
15266
  }
15267
+ localVarHeaderParameter['Content-Type'] = 'application/json';
15210
15268
  localVarUrlObj.query = {
15211
15269
  ...localVarUrlObj.query,
15212
15270
  ...localVarQueryParameter,
@@ -15220,6 +15278,11 @@ const QueueBucketServiceApiAxiosParamCreator = function (configuration) {
15220
15278
  ...headersFromBaseOptions,
15221
15279
  ...options.headers,
15222
15280
  };
15281
+ const needsSerialization = typeof body !== 'string' ||
15282
+ localVarRequestOptions.headers['Content-Type'] === 'application/json';
15283
+ localVarRequestOptions.data = needsSerialization
15284
+ ? JSON.stringify(body !== undefined ? body : {})
15285
+ : body || '';
15223
15286
  return {
15224
15287
  url: format(localVarUrlObj),
15225
15288
  options: localVarRequestOptions,
@@ -15230,11 +15293,10 @@ const QueueBucketServiceApiAxiosParamCreator = function (configuration) {
15230
15293
  * @summary ReadQueueRouting
15231
15294
  * @param {string} queueId
15232
15295
  * @param {string} id
15233
- * @param {string} [domainId]
15234
15296
  * @param {*} [options] Override http request option.
15235
15297
  * @throws {RequiredError}
15236
15298
  */
15237
- readQueueBucket: async (queueId, id, domainId, options = {}) => {
15299
+ readQueueBucket: async (queueId, id, options = {}) => {
15238
15300
  // verify required parameter 'queueId' is not null or undefined
15239
15301
  if (queueId === null || queueId === undefined) {
15240
15302
  throw new RequiredError('queueId', 'Required parameter queueId was null or undefined when calling readQueueBucket.');
@@ -15265,9 +15327,6 @@ const QueueBucketServiceApiAxiosParamCreator = function (configuration) {
15265
15327
  : await configuration.apiKey;
15266
15328
  localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
15267
15329
  }
15268
- if (domainId !== undefined) {
15269
- localVarQueryParameter['domain_id'] = domainId;
15270
- }
15271
15330
  localVarUrlObj.query = {
15272
15331
  ...localVarUrlObj.query,
15273
15332
  ...localVarQueryParameter,
@@ -15459,12 +15518,29 @@ const QueueBucketServiceApiFp = function (configuration) {
15459
15518
  * @summary DeleteQueueRouting
15460
15519
  * @param {string} queueId
15461
15520
  * @param {string} id
15462
- * @param {string} [domainId]
15463
15521
  * @param {*} [options] Override http request option.
15464
15522
  * @throws {RequiredError}
15465
15523
  */
15466
- async deleteQueueBucket(queueId, id, domainId, options) {
15467
- const localVarAxiosArgs = await QueueBucketServiceApiAxiosParamCreator(configuration).deleteQueueBucket(queueId, id, domainId, options);
15524
+ async deleteQueueBucket(queueId, id, options) {
15525
+ const localVarAxiosArgs = await QueueBucketServiceApiAxiosParamCreator(configuration).deleteQueueBucket(queueId, id, options);
15526
+ return (axios = globalAxios, basePath = BASE_PATH) => {
15527
+ const axiosRequestArgs = {
15528
+ ...localVarAxiosArgs.options,
15529
+ url: basePath + localVarAxiosArgs.url,
15530
+ };
15531
+ return axios.request(axiosRequestArgs);
15532
+ };
15533
+ },
15534
+ /**
15535
+ *
15536
+ * @param {string} queueId
15537
+ * @param {string} id
15538
+ * @param {EnginePatchQueueBucketRequest} body
15539
+ * @param {*} [options] Override http request option.
15540
+ * @throws {RequiredError}
15541
+ */
15542
+ async patchQueueBucket(queueId, id, body, options) {
15543
+ const localVarAxiosArgs = await QueueBucketServiceApiAxiosParamCreator(configuration).patchQueueBucket(queueId, id, body, options);
15468
15544
  return (axios = globalAxios, basePath = BASE_PATH) => {
15469
15545
  const axiosRequestArgs = {
15470
15546
  ...localVarAxiosArgs.options,
@@ -15478,12 +15554,11 @@ const QueueBucketServiceApiFp = function (configuration) {
15478
15554
  * @summary ReadQueueRouting
15479
15555
  * @param {string} queueId
15480
15556
  * @param {string} id
15481
- * @param {string} [domainId]
15482
15557
  * @param {*} [options] Override http request option.
15483
15558
  * @throws {RequiredError}
15484
15559
  */
15485
- async readQueueBucket(queueId, id, domainId, options) {
15486
- const localVarAxiosArgs = await QueueBucketServiceApiAxiosParamCreator(configuration).readQueueBucket(queueId, id, domainId, options);
15560
+ async readQueueBucket(queueId, id, options) {
15561
+ const localVarAxiosArgs = await QueueBucketServiceApiAxiosParamCreator(configuration).readQueueBucket(queueId, id, options);
15487
15562
  return (axios = globalAxios, basePath = BASE_PATH) => {
15488
15563
  const axiosRequestArgs = {
15489
15564
  ...localVarAxiosArgs.options,
@@ -15560,13 +15635,25 @@ const QueueBucketServiceApiFactory = function (configuration, basePath, axios) {
15560
15635
  * @summary DeleteQueueRouting
15561
15636
  * @param {string} queueId
15562
15637
  * @param {string} id
15563
- * @param {string} [domainId]
15564
15638
  * @param {*} [options] Override http request option.
15565
15639
  * @throws {RequiredError}
15566
15640
  */
15567
- deleteQueueBucket(queueId, id, domainId, options) {
15641
+ deleteQueueBucket(queueId, id, options) {
15642
+ return QueueBucketServiceApiFp(configuration)
15643
+ .deleteQueueBucket(queueId, id, options)
15644
+ .then((request) => request(axios, basePath));
15645
+ },
15646
+ /**
15647
+ *
15648
+ * @param {string} queueId
15649
+ * @param {string} id
15650
+ * @param {EnginePatchQueueBucketRequest} body
15651
+ * @param {*} [options] Override http request option.
15652
+ * @throws {RequiredError}
15653
+ */
15654
+ patchQueueBucket(queueId, id, body, options) {
15568
15655
  return QueueBucketServiceApiFp(configuration)
15569
- .deleteQueueBucket(queueId, id, domainId, options)
15656
+ .patchQueueBucket(queueId, id, body, options)
15570
15657
  .then((request) => request(axios, basePath));
15571
15658
  },
15572
15659
  /**
@@ -15574,13 +15661,12 @@ const QueueBucketServiceApiFactory = function (configuration, basePath, axios) {
15574
15661
  * @summary ReadQueueRouting
15575
15662
  * @param {string} queueId
15576
15663
  * @param {string} id
15577
- * @param {string} [domainId]
15578
15664
  * @param {*} [options] Override http request option.
15579
15665
  * @throws {RequiredError}
15580
15666
  */
15581
- readQueueBucket(queueId, id, domainId, options) {
15667
+ readQueueBucket(queueId, id, options) {
15582
15668
  return QueueBucketServiceApiFp(configuration)
15583
- .readQueueBucket(queueId, id, domainId, options)
15669
+ .readQueueBucket(queueId, id, options)
15584
15670
  .then((request) => request(axios, basePath));
15585
15671
  },
15586
15672
  /**
@@ -15643,14 +15729,27 @@ class QueueBucketServiceApi extends BaseAPI {
15643
15729
  * @summary DeleteQueueRouting
15644
15730
  * @param {string} queueId
15645
15731
  * @param {string} id
15646
- * @param {string} [domainId]
15647
15732
  * @param {*} [options] Override http request option.
15648
15733
  * @throws {RequiredError}
15649
15734
  * @memberof QueueBucketServiceApi
15650
15735
  */
15651
- deleteQueueBucket(queueId, id, domainId, options) {
15736
+ deleteQueueBucket(queueId, id, options) {
15737
+ return QueueBucketServiceApiFp(this.configuration)
15738
+ .deleteQueueBucket(queueId, id, options)
15739
+ .then((request) => request(this.axios, this.basePath));
15740
+ }
15741
+ /**
15742
+ *
15743
+ * @param {string} queueId
15744
+ * @param {string} id
15745
+ * @param {EnginePatchQueueBucketRequest} body
15746
+ * @param {*} [options] Override http request option.
15747
+ * @throws {RequiredError}
15748
+ * @memberof QueueBucketServiceApi
15749
+ */
15750
+ patchQueueBucket(queueId, id, body, options) {
15652
15751
  return QueueBucketServiceApiFp(this.configuration)
15653
- .deleteQueueBucket(queueId, id, domainId, options)
15752
+ .patchQueueBucket(queueId, id, body, options)
15654
15753
  .then((request) => request(this.axios, this.basePath));
15655
15754
  }
15656
15755
  /**
@@ -15658,14 +15757,13 @@ class QueueBucketServiceApi extends BaseAPI {
15658
15757
  * @summary ReadQueueRouting
15659
15758
  * @param {string} queueId
15660
15759
  * @param {string} id
15661
- * @param {string} [domainId]
15662
15760
  * @param {*} [options] Override http request option.
15663
15761
  * @throws {RequiredError}
15664
15762
  * @memberof QueueBucketServiceApi
15665
15763
  */
15666
- readQueueBucket(queueId, id, domainId, options) {
15764
+ readQueueBucket(queueId, id, options) {
15667
15765
  return QueueBucketServiceApiFp(this.configuration)
15668
- .readQueueBucket(queueId, id, domainId, options)
15766
+ .readQueueBucket(queueId, id, options)
15669
15767
  .then((request) => request(this.axios, this.basePath));
15670
15768
  }
15671
15769
  /**
@@ -18521,76 +18619,727 @@ class QueueSkillServiceApi extends BaseAPI {
18521
18619
  }
18522
18620
  /**
18523
18621
  *
18524
- * @param {number} queueId
18622
+ * @param {number} queueId
18623
+ * @param {number} id
18624
+ * @param {*} [options] Override http request option.
18625
+ * @throws {RequiredError}
18626
+ * @memberof QueueSkillServiceApi
18627
+ */
18628
+ readQueueSkill(queueId, id, options) {
18629
+ return QueueSkillServiceApiFp(this.configuration)
18630
+ .readQueueSkill(queueId, id, options)
18631
+ .then((request) => request(this.axios, this.basePath));
18632
+ }
18633
+ /**
18634
+ *
18635
+ * @param {number} queueId
18636
+ * @param {number} [page]
18637
+ * @param {number} [size]
18638
+ * @param {string} [q]
18639
+ * @param {string} [sort]
18640
+ * @param {Array<string>} [fields]
18641
+ * @param {Array<number>} [id]
18642
+ * @param {Array<number>} [skillId]
18643
+ * @param {Array<number>} [bucketId]
18644
+ * @param {Array<number>} [lvl]
18645
+ * @param {Array<number>} [minCapacity]
18646
+ * @param {Array<number>} [maxCapacity]
18647
+ * @param {boolean} [enabled]
18648
+ * @param {*} [options] Override http request option.
18649
+ * @throws {RequiredError}
18650
+ * @memberof QueueSkillServiceApi
18651
+ */
18652
+ searchQueueSkill(queueId, page, size, q, sort, fields, id, skillId, bucketId, lvl, minCapacity, maxCapacity, enabled, options) {
18653
+ return QueueSkillServiceApiFp(this.configuration)
18654
+ .searchQueueSkill(queueId, page, size, q, sort, fields, id, skillId, bucketId, lvl, minCapacity, maxCapacity, enabled, options)
18655
+ .then((request) => request(this.axios, this.basePath));
18656
+ }
18657
+ /**
18658
+ *
18659
+ * @param {number} queueId
18660
+ * @param {number} id
18661
+ * @param {EngineUpdateQueueSkillRequest} body
18662
+ * @param {*} [options] Override http request option.
18663
+ * @throws {RequiredError}
18664
+ * @memberof QueueSkillServiceApi
18665
+ */
18666
+ updateQueueSkill(queueId, id, body, options) {
18667
+ return QueueSkillServiceApiFp(this.configuration)
18668
+ .updateQueueSkill(queueId, id, body, options)
18669
+ .then((request) => request(this.axios, this.basePath));
18670
+ }
18671
+ }
18672
+
18673
+ // tslint:disable
18674
+ /**
18675
+ * RegionServiceApi - axios parameter creator
18676
+ * @export
18677
+ */
18678
+ const RegionServiceApiAxiosParamCreator = function (configuration) {
18679
+ return {
18680
+ /**
18681
+ *
18682
+ * @param {EngineCreateRegionRequest} body
18683
+ * @param {*} [options] Override http request option.
18684
+ * @throws {RequiredError}
18685
+ */
18686
+ createRegion: async (body, options = {}) => {
18687
+ // verify required parameter 'body' is not null or undefined
18688
+ if (body === null || body === undefined) {
18689
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling createRegion.');
18690
+ }
18691
+ const localVarPath = `/regions`;
18692
+ const localVarUrlObj = parse(localVarPath, true);
18693
+ let baseOptions;
18694
+ if (configuration) {
18695
+ baseOptions = configuration.baseOptions;
18696
+ }
18697
+ const localVarRequestOptions = {
18698
+ method: 'POST',
18699
+ ...baseOptions,
18700
+ ...options,
18701
+ };
18702
+ const localVarHeaderParameter = {};
18703
+ const localVarQueryParameter = {};
18704
+ // authentication AccessToken required
18705
+ if (configuration && configuration.apiKey) {
18706
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
18707
+ ? await configuration.apiKey('X-Webitel-Access')
18708
+ : await configuration.apiKey;
18709
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
18710
+ }
18711
+ localVarHeaderParameter['Content-Type'] = 'application/json';
18712
+ localVarUrlObj.query = {
18713
+ ...localVarUrlObj.query,
18714
+ ...localVarQueryParameter,
18715
+ ...options.query,
18716
+ };
18717
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
18718
+ delete localVarUrlObj.search;
18719
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18720
+ localVarRequestOptions.headers = {
18721
+ ...localVarHeaderParameter,
18722
+ ...headersFromBaseOptions,
18723
+ ...options.headers,
18724
+ };
18725
+ const needsSerialization = typeof body !== 'string' ||
18726
+ localVarRequestOptions.headers['Content-Type'] === 'application/json';
18727
+ localVarRequestOptions.data = needsSerialization
18728
+ ? JSON.stringify(body !== undefined ? body : {})
18729
+ : body || '';
18730
+ return {
18731
+ url: format(localVarUrlObj),
18732
+ options: localVarRequestOptions,
18733
+ };
18734
+ },
18735
+ /**
18736
+ *
18737
+ * @param {number} id
18738
+ * @param {*} [options] Override http request option.
18739
+ * @throws {RequiredError}
18740
+ */
18741
+ deleteRegion: async (id, options = {}) => {
18742
+ // verify required parameter 'id' is not null or undefined
18743
+ if (id === null || id === undefined) {
18744
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling deleteRegion.');
18745
+ }
18746
+ const localVarPath = `/regions/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
18747
+ const localVarUrlObj = parse(localVarPath, true);
18748
+ let baseOptions;
18749
+ if (configuration) {
18750
+ baseOptions = configuration.baseOptions;
18751
+ }
18752
+ const localVarRequestOptions = {
18753
+ method: 'DELETE',
18754
+ ...baseOptions,
18755
+ ...options,
18756
+ };
18757
+ const localVarHeaderParameter = {};
18758
+ const localVarQueryParameter = {};
18759
+ // authentication AccessToken required
18760
+ if (configuration && configuration.apiKey) {
18761
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
18762
+ ? await configuration.apiKey('X-Webitel-Access')
18763
+ : await configuration.apiKey;
18764
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
18765
+ }
18766
+ localVarUrlObj.query = {
18767
+ ...localVarUrlObj.query,
18768
+ ...localVarQueryParameter,
18769
+ ...options.query,
18770
+ };
18771
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
18772
+ delete localVarUrlObj.search;
18773
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18774
+ localVarRequestOptions.headers = {
18775
+ ...localVarHeaderParameter,
18776
+ ...headersFromBaseOptions,
18777
+ ...options.headers,
18778
+ };
18779
+ return {
18780
+ url: format(localVarUrlObj),
18781
+ options: localVarRequestOptions,
18782
+ };
18783
+ },
18784
+ /**
18785
+ *
18786
+ * @param {number} id
18787
+ * @param {EnginePatchRegionRequest} body
18788
+ * @param {*} [options] Override http request option.
18789
+ * @throws {RequiredError}
18790
+ */
18791
+ patchRegion: async (id, body, options = {}) => {
18792
+ // verify required parameter 'id' is not null or undefined
18793
+ if (id === null || id === undefined) {
18794
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling patchRegion.');
18795
+ }
18796
+ // verify required parameter 'body' is not null or undefined
18797
+ if (body === null || body === undefined) {
18798
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling patchRegion.');
18799
+ }
18800
+ const localVarPath = `/regions/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
18801
+ const localVarUrlObj = parse(localVarPath, true);
18802
+ let baseOptions;
18803
+ if (configuration) {
18804
+ baseOptions = configuration.baseOptions;
18805
+ }
18806
+ const localVarRequestOptions = {
18807
+ method: 'PATCH',
18808
+ ...baseOptions,
18809
+ ...options,
18810
+ };
18811
+ const localVarHeaderParameter = {};
18812
+ const localVarQueryParameter = {};
18813
+ // authentication AccessToken required
18814
+ if (configuration && configuration.apiKey) {
18815
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
18816
+ ? await configuration.apiKey('X-Webitel-Access')
18817
+ : await configuration.apiKey;
18818
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
18819
+ }
18820
+ localVarHeaderParameter['Content-Type'] = 'application/json';
18821
+ localVarUrlObj.query = {
18822
+ ...localVarUrlObj.query,
18823
+ ...localVarQueryParameter,
18824
+ ...options.query,
18825
+ };
18826
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
18827
+ delete localVarUrlObj.search;
18828
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18829
+ localVarRequestOptions.headers = {
18830
+ ...localVarHeaderParameter,
18831
+ ...headersFromBaseOptions,
18832
+ ...options.headers,
18833
+ };
18834
+ const needsSerialization = typeof body !== 'string' ||
18835
+ localVarRequestOptions.headers['Content-Type'] === 'application/json';
18836
+ localVarRequestOptions.data = needsSerialization
18837
+ ? JSON.stringify(body !== undefined ? body : {})
18838
+ : body || '';
18839
+ return {
18840
+ url: format(localVarUrlObj),
18841
+ options: localVarRequestOptions,
18842
+ };
18843
+ },
18844
+ /**
18845
+ *
18846
+ * @param {number} id
18847
+ * @param {*} [options] Override http request option.
18848
+ * @throws {RequiredError}
18849
+ */
18850
+ readRegion: async (id, options = {}) => {
18851
+ // verify required parameter 'id' is not null or undefined
18852
+ if (id === null || id === undefined) {
18853
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling readRegion.');
18854
+ }
18855
+ const localVarPath = `/regions/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
18856
+ const localVarUrlObj = parse(localVarPath, true);
18857
+ let baseOptions;
18858
+ if (configuration) {
18859
+ baseOptions = configuration.baseOptions;
18860
+ }
18861
+ const localVarRequestOptions = {
18862
+ method: 'GET',
18863
+ ...baseOptions,
18864
+ ...options,
18865
+ };
18866
+ const localVarHeaderParameter = {};
18867
+ const localVarQueryParameter = {};
18868
+ // authentication AccessToken required
18869
+ if (configuration && configuration.apiKey) {
18870
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
18871
+ ? await configuration.apiKey('X-Webitel-Access')
18872
+ : await configuration.apiKey;
18873
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
18874
+ }
18875
+ localVarUrlObj.query = {
18876
+ ...localVarUrlObj.query,
18877
+ ...localVarQueryParameter,
18878
+ ...options.query,
18879
+ };
18880
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
18881
+ delete localVarUrlObj.search;
18882
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18883
+ localVarRequestOptions.headers = {
18884
+ ...localVarHeaderParameter,
18885
+ ...headersFromBaseOptions,
18886
+ ...options.headers,
18887
+ };
18888
+ return {
18889
+ url: format(localVarUrlObj),
18890
+ options: localVarRequestOptions,
18891
+ };
18892
+ },
18893
+ /**
18894
+ *
18895
+ * @param {number} [page]
18896
+ * @param {number} [size]
18897
+ * @param {string} [q]
18898
+ * @param {string} [sort]
18899
+ * @param {Array<string>} [fields]
18900
+ * @param {Array<number>} [id]
18901
+ * @param {string} [name]
18902
+ * @param {string} [description]
18903
+ * @param {Array<number>} [timezoneId]
18904
+ * @param {*} [options] Override http request option.
18905
+ * @throws {RequiredError}
18906
+ */
18907
+ searchRegion: async (page, size, q, sort, fields, id, name, description, timezoneId, options = {}) => {
18908
+ const localVarPath = `/regions`;
18909
+ const localVarUrlObj = parse(localVarPath, true);
18910
+ let baseOptions;
18911
+ if (configuration) {
18912
+ baseOptions = configuration.baseOptions;
18913
+ }
18914
+ const localVarRequestOptions = {
18915
+ method: 'GET',
18916
+ ...baseOptions,
18917
+ ...options,
18918
+ };
18919
+ const localVarHeaderParameter = {};
18920
+ const localVarQueryParameter = {};
18921
+ // authentication AccessToken required
18922
+ if (configuration && configuration.apiKey) {
18923
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
18924
+ ? await configuration.apiKey('X-Webitel-Access')
18925
+ : await configuration.apiKey;
18926
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
18927
+ }
18928
+ if (page !== undefined) {
18929
+ localVarQueryParameter['page'] = page;
18930
+ }
18931
+ if (size !== undefined) {
18932
+ localVarQueryParameter['size'] = size;
18933
+ }
18934
+ if (q !== undefined) {
18935
+ localVarQueryParameter['q'] = q;
18936
+ }
18937
+ if (sort !== undefined) {
18938
+ localVarQueryParameter['sort'] = sort;
18939
+ }
18940
+ if (fields) {
18941
+ localVarQueryParameter['fields'] = fields;
18942
+ }
18943
+ if (id) {
18944
+ localVarQueryParameter['id'] = id;
18945
+ }
18946
+ if (name !== undefined) {
18947
+ localVarQueryParameter['name'] = name;
18948
+ }
18949
+ if (description !== undefined) {
18950
+ localVarQueryParameter['description'] = description;
18951
+ }
18952
+ if (timezoneId) {
18953
+ localVarQueryParameter['timezone_id'] = timezoneId;
18954
+ }
18955
+ localVarUrlObj.query = {
18956
+ ...localVarUrlObj.query,
18957
+ ...localVarQueryParameter,
18958
+ ...options.query,
18959
+ };
18960
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
18961
+ delete localVarUrlObj.search;
18962
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18963
+ localVarRequestOptions.headers = {
18964
+ ...localVarHeaderParameter,
18965
+ ...headersFromBaseOptions,
18966
+ ...options.headers,
18967
+ };
18968
+ return {
18969
+ url: format(localVarUrlObj),
18970
+ options: localVarRequestOptions,
18971
+ };
18972
+ },
18973
+ /**
18974
+ *
18975
+ * @param {number} id
18976
+ * @param {EngineUpdateRegionRequest} body
18977
+ * @param {*} [options] Override http request option.
18978
+ * @throws {RequiredError}
18979
+ */
18980
+ updateRegion: async (id, body, options = {}) => {
18981
+ // verify required parameter 'id' is not null or undefined
18982
+ if (id === null || id === undefined) {
18983
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling updateRegion.');
18984
+ }
18985
+ // verify required parameter 'body' is not null or undefined
18986
+ if (body === null || body === undefined) {
18987
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling updateRegion.');
18988
+ }
18989
+ const localVarPath = `/regions/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
18990
+ const localVarUrlObj = parse(localVarPath, true);
18991
+ let baseOptions;
18992
+ if (configuration) {
18993
+ baseOptions = configuration.baseOptions;
18994
+ }
18995
+ const localVarRequestOptions = {
18996
+ method: 'PUT',
18997
+ ...baseOptions,
18998
+ ...options,
18999
+ };
19000
+ const localVarHeaderParameter = {};
19001
+ const localVarQueryParameter = {};
19002
+ // authentication AccessToken required
19003
+ if (configuration && configuration.apiKey) {
19004
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
19005
+ ? await configuration.apiKey('X-Webitel-Access')
19006
+ : await configuration.apiKey;
19007
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
19008
+ }
19009
+ localVarHeaderParameter['Content-Type'] = 'application/json';
19010
+ localVarUrlObj.query = {
19011
+ ...localVarUrlObj.query,
19012
+ ...localVarQueryParameter,
19013
+ ...options.query,
19014
+ };
19015
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
19016
+ delete localVarUrlObj.search;
19017
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
19018
+ localVarRequestOptions.headers = {
19019
+ ...localVarHeaderParameter,
19020
+ ...headersFromBaseOptions,
19021
+ ...options.headers,
19022
+ };
19023
+ const needsSerialization = typeof body !== 'string' ||
19024
+ localVarRequestOptions.headers['Content-Type'] === 'application/json';
19025
+ localVarRequestOptions.data = needsSerialization
19026
+ ? JSON.stringify(body !== undefined ? body : {})
19027
+ : body || '';
19028
+ return {
19029
+ url: format(localVarUrlObj),
19030
+ options: localVarRequestOptions,
19031
+ };
19032
+ },
19033
+ };
19034
+ };
19035
+ /**
19036
+ * RegionServiceApi - functional programming interface
19037
+ * @export
19038
+ */
19039
+ const RegionServiceApiFp = function (configuration) {
19040
+ return {
19041
+ /**
19042
+ *
19043
+ * @param {EngineCreateRegionRequest} body
19044
+ * @param {*} [options] Override http request option.
19045
+ * @throws {RequiredError}
19046
+ */
19047
+ async createRegion(body, options) {
19048
+ const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).createRegion(body, options);
19049
+ return (axios = globalAxios, basePath = BASE_PATH) => {
19050
+ const axiosRequestArgs = {
19051
+ ...localVarAxiosArgs.options,
19052
+ url: basePath + localVarAxiosArgs.url,
19053
+ };
19054
+ return axios.request(axiosRequestArgs);
19055
+ };
19056
+ },
19057
+ /**
19058
+ *
19059
+ * @param {number} id
19060
+ * @param {*} [options] Override http request option.
19061
+ * @throws {RequiredError}
19062
+ */
19063
+ async deleteRegion(id, options) {
19064
+ const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).deleteRegion(id, options);
19065
+ return (axios = globalAxios, basePath = BASE_PATH) => {
19066
+ const axiosRequestArgs = {
19067
+ ...localVarAxiosArgs.options,
19068
+ url: basePath + localVarAxiosArgs.url,
19069
+ };
19070
+ return axios.request(axiosRequestArgs);
19071
+ };
19072
+ },
19073
+ /**
19074
+ *
19075
+ * @param {number} id
19076
+ * @param {EnginePatchRegionRequest} body
19077
+ * @param {*} [options] Override http request option.
19078
+ * @throws {RequiredError}
19079
+ */
19080
+ async patchRegion(id, body, options) {
19081
+ const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).patchRegion(id, body, options);
19082
+ return (axios = globalAxios, basePath = BASE_PATH) => {
19083
+ const axiosRequestArgs = {
19084
+ ...localVarAxiosArgs.options,
19085
+ url: basePath + localVarAxiosArgs.url,
19086
+ };
19087
+ return axios.request(axiosRequestArgs);
19088
+ };
19089
+ },
19090
+ /**
19091
+ *
19092
+ * @param {number} id
19093
+ * @param {*} [options] Override http request option.
19094
+ * @throws {RequiredError}
19095
+ */
19096
+ async readRegion(id, options) {
19097
+ const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).readRegion(id, options);
19098
+ return (axios = globalAxios, basePath = BASE_PATH) => {
19099
+ const axiosRequestArgs = {
19100
+ ...localVarAxiosArgs.options,
19101
+ url: basePath + localVarAxiosArgs.url,
19102
+ };
19103
+ return axios.request(axiosRequestArgs);
19104
+ };
19105
+ },
19106
+ /**
19107
+ *
19108
+ * @param {number} [page]
19109
+ * @param {number} [size]
19110
+ * @param {string} [q]
19111
+ * @param {string} [sort]
19112
+ * @param {Array<string>} [fields]
19113
+ * @param {Array<number>} [id]
19114
+ * @param {string} [name]
19115
+ * @param {string} [description]
19116
+ * @param {Array<number>} [timezoneId]
19117
+ * @param {*} [options] Override http request option.
19118
+ * @throws {RequiredError}
19119
+ */
19120
+ async searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options) {
19121
+ const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options);
19122
+ return (axios = globalAxios, basePath = BASE_PATH) => {
19123
+ const axiosRequestArgs = {
19124
+ ...localVarAxiosArgs.options,
19125
+ url: basePath + localVarAxiosArgs.url,
19126
+ };
19127
+ return axios.request(axiosRequestArgs);
19128
+ };
19129
+ },
19130
+ /**
19131
+ *
19132
+ * @param {number} id
19133
+ * @param {EngineUpdateRegionRequest} body
19134
+ * @param {*} [options] Override http request option.
19135
+ * @throws {RequiredError}
19136
+ */
19137
+ async updateRegion(id, body, options) {
19138
+ const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).updateRegion(id, body, options);
19139
+ return (axios = globalAxios, basePath = BASE_PATH) => {
19140
+ const axiosRequestArgs = {
19141
+ ...localVarAxiosArgs.options,
19142
+ url: basePath + localVarAxiosArgs.url,
19143
+ };
19144
+ return axios.request(axiosRequestArgs);
19145
+ };
19146
+ },
19147
+ };
19148
+ };
19149
+ /**
19150
+ * RegionServiceApi - factory interface
19151
+ * @export
19152
+ */
19153
+ const RegionServiceApiFactory = function (configuration, basePath, axios) {
19154
+ return {
19155
+ /**
19156
+ *
19157
+ * @param {EngineCreateRegionRequest} body
19158
+ * @param {*} [options] Override http request option.
19159
+ * @throws {RequiredError}
19160
+ */
19161
+ createRegion(body, options) {
19162
+ return RegionServiceApiFp(configuration)
19163
+ .createRegion(body, options)
19164
+ .then((request) => request(axios, basePath));
19165
+ },
19166
+ /**
19167
+ *
19168
+ * @param {number} id
19169
+ * @param {*} [options] Override http request option.
19170
+ * @throws {RequiredError}
19171
+ */
19172
+ deleteRegion(id, options) {
19173
+ return RegionServiceApiFp(configuration)
19174
+ .deleteRegion(id, options)
19175
+ .then((request) => request(axios, basePath));
19176
+ },
19177
+ /**
19178
+ *
19179
+ * @param {number} id
19180
+ * @param {EnginePatchRegionRequest} body
19181
+ * @param {*} [options] Override http request option.
19182
+ * @throws {RequiredError}
19183
+ */
19184
+ patchRegion(id, body, options) {
19185
+ return RegionServiceApiFp(configuration)
19186
+ .patchRegion(id, body, options)
19187
+ .then((request) => request(axios, basePath));
19188
+ },
19189
+ /**
19190
+ *
19191
+ * @param {number} id
19192
+ * @param {*} [options] Override http request option.
19193
+ * @throws {RequiredError}
19194
+ */
19195
+ readRegion(id, options) {
19196
+ return RegionServiceApiFp(configuration)
19197
+ .readRegion(id, options)
19198
+ .then((request) => request(axios, basePath));
19199
+ },
19200
+ /**
19201
+ *
19202
+ * @param {number} [page]
19203
+ * @param {number} [size]
19204
+ * @param {string} [q]
19205
+ * @param {string} [sort]
19206
+ * @param {Array<string>} [fields]
19207
+ * @param {Array<number>} [id]
19208
+ * @param {string} [name]
19209
+ * @param {string} [description]
19210
+ * @param {Array<number>} [timezoneId]
19211
+ * @param {*} [options] Override http request option.
19212
+ * @throws {RequiredError}
19213
+ */
19214
+ searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options) {
19215
+ return RegionServiceApiFp(configuration)
19216
+ .searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options)
19217
+ .then((request) => request(axios, basePath));
19218
+ },
19219
+ /**
19220
+ *
19221
+ * @param {number} id
19222
+ * @param {EngineUpdateRegionRequest} body
19223
+ * @param {*} [options] Override http request option.
19224
+ * @throws {RequiredError}
19225
+ */
19226
+ updateRegion(id, body, options) {
19227
+ return RegionServiceApiFp(configuration)
19228
+ .updateRegion(id, body, options)
19229
+ .then((request) => request(axios, basePath));
19230
+ },
19231
+ };
19232
+ };
19233
+ /**
19234
+ * RegionServiceApi - object-oriented interface
19235
+ * @export
19236
+ * @class RegionServiceApi
19237
+ * @extends {BaseAPI}
19238
+ */
19239
+ class RegionServiceApi extends BaseAPI {
19240
+ /**
19241
+ *
19242
+ * @param {EngineCreateRegionRequest} body
19243
+ * @param {*} [options] Override http request option.
19244
+ * @throws {RequiredError}
19245
+ * @memberof RegionServiceApi
19246
+ */
19247
+ createRegion(body, options) {
19248
+ return RegionServiceApiFp(this.configuration)
19249
+ .createRegion(body, options)
19250
+ .then((request) => request(this.axios, this.basePath));
19251
+ }
19252
+ /**
19253
+ *
19254
+ * @param {number} id
19255
+ * @param {*} [options] Override http request option.
19256
+ * @throws {RequiredError}
19257
+ * @memberof RegionServiceApi
19258
+ */
19259
+ deleteRegion(id, options) {
19260
+ return RegionServiceApiFp(this.configuration)
19261
+ .deleteRegion(id, options)
19262
+ .then((request) => request(this.axios, this.basePath));
19263
+ }
19264
+ /**
19265
+ *
19266
+ * @param {number} id
19267
+ * @param {EnginePatchRegionRequest} body
19268
+ * @param {*} [options] Override http request option.
19269
+ * @throws {RequiredError}
19270
+ * @memberof RegionServiceApi
19271
+ */
19272
+ patchRegion(id, body, options) {
19273
+ return RegionServiceApiFp(this.configuration)
19274
+ .patchRegion(id, body, options)
19275
+ .then((request) => request(this.axios, this.basePath));
19276
+ }
19277
+ /**
19278
+ *
18525
19279
  * @param {number} id
18526
19280
  * @param {*} [options] Override http request option.
18527
19281
  * @throws {RequiredError}
18528
- * @memberof QueueSkillServiceApi
19282
+ * @memberof RegionServiceApi
18529
19283
  */
18530
- readQueueSkill(queueId, id, options) {
18531
- return QueueSkillServiceApiFp(this.configuration)
18532
- .readQueueSkill(queueId, id, options)
19284
+ readRegion(id, options) {
19285
+ return RegionServiceApiFp(this.configuration)
19286
+ .readRegion(id, options)
18533
19287
  .then((request) => request(this.axios, this.basePath));
18534
19288
  }
18535
19289
  /**
18536
19290
  *
18537
- * @param {number} queueId
18538
19291
  * @param {number} [page]
18539
19292
  * @param {number} [size]
18540
19293
  * @param {string} [q]
18541
19294
  * @param {string} [sort]
18542
19295
  * @param {Array<string>} [fields]
18543
19296
  * @param {Array<number>} [id]
18544
- * @param {Array<number>} [skillId]
18545
- * @param {Array<number>} [bucketId]
18546
- * @param {Array<number>} [lvl]
18547
- * @param {Array<number>} [minCapacity]
18548
- * @param {Array<number>} [maxCapacity]
18549
- * @param {boolean} [enabled]
19297
+ * @param {string} [name]
19298
+ * @param {string} [description]
19299
+ * @param {Array<number>} [timezoneId]
18550
19300
  * @param {*} [options] Override http request option.
18551
19301
  * @throws {RequiredError}
18552
- * @memberof QueueSkillServiceApi
19302
+ * @memberof RegionServiceApi
18553
19303
  */
18554
- searchQueueSkill(queueId, page, size, q, sort, fields, id, skillId, bucketId, lvl, minCapacity, maxCapacity, enabled, options) {
18555
- return QueueSkillServiceApiFp(this.configuration)
18556
- .searchQueueSkill(queueId, page, size, q, sort, fields, id, skillId, bucketId, lvl, minCapacity, maxCapacity, enabled, options)
19304
+ searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options) {
19305
+ return RegionServiceApiFp(this.configuration)
19306
+ .searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options)
18557
19307
  .then((request) => request(this.axios, this.basePath));
18558
19308
  }
18559
19309
  /**
18560
19310
  *
18561
- * @param {number} queueId
18562
19311
  * @param {number} id
18563
- * @param {EngineUpdateQueueSkillRequest} body
19312
+ * @param {EngineUpdateRegionRequest} body
18564
19313
  * @param {*} [options] Override http request option.
18565
19314
  * @throws {RequiredError}
18566
- * @memberof QueueSkillServiceApi
19315
+ * @memberof RegionServiceApi
18567
19316
  */
18568
- updateQueueSkill(queueId, id, body, options) {
18569
- return QueueSkillServiceApiFp(this.configuration)
18570
- .updateQueueSkill(queueId, id, body, options)
19317
+ updateRegion(id, body, options) {
19318
+ return RegionServiceApiFp(this.configuration)
19319
+ .updateRegion(id, body, options)
18571
19320
  .then((request) => request(this.axios, this.basePath));
18572
19321
  }
18573
19322
  }
18574
19323
 
18575
19324
  // tslint:disable
18576
19325
  /**
18577
- * RegionServiceApi - axios parameter creator
19326
+ * RoutingChatPlanServiceApi - axios parameter creator
18578
19327
  * @export
18579
19328
  */
18580
- const RegionServiceApiAxiosParamCreator = function (configuration) {
19329
+ const RoutingChatPlanServiceApiAxiosParamCreator = function (configuration) {
18581
19330
  return {
18582
19331
  /**
18583
19332
  *
18584
- * @param {EngineCreateRegionRequest} body
19333
+ * @param {EngineCreateChatPlanRequest} body
18585
19334
  * @param {*} [options] Override http request option.
18586
19335
  * @throws {RequiredError}
18587
19336
  */
18588
- createRegion: async (body, options = {}) => {
19337
+ createChatPlan: async (body, options = {}) => {
18589
19338
  // verify required parameter 'body' is not null or undefined
18590
19339
  if (body === null || body === undefined) {
18591
- throw new RequiredError('body', 'Required parameter body was null or undefined when calling createRegion.');
19340
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling createChatPlan.');
18592
19341
  }
18593
- const localVarPath = `/regions`;
19342
+ const localVarPath = `/routing/outbound/chat`;
18594
19343
  const localVarUrlObj = parse(localVarPath, true);
18595
19344
  let baseOptions;
18596
19345
  if (configuration) {
@@ -18637,69 +19386,20 @@ const RegionServiceApiAxiosParamCreator = function (configuration) {
18637
19386
  /**
18638
19387
  *
18639
19388
  * @param {number} id
19389
+ * @param {EnginePatchChatPlanRequest} body
18640
19390
  * @param {*} [options] Override http request option.
18641
19391
  * @throws {RequiredError}
18642
19392
  */
18643
- deleteRegion: async (id, options = {}) => {
18644
- // verify required parameter 'id' is not null or undefined
18645
- if (id === null || id === undefined) {
18646
- throw new RequiredError('id', 'Required parameter id was null or undefined when calling deleteRegion.');
18647
- }
18648
- const localVarPath = `/regions/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
18649
- const localVarUrlObj = parse(localVarPath, true);
18650
- let baseOptions;
18651
- if (configuration) {
18652
- baseOptions = configuration.baseOptions;
18653
- }
18654
- const localVarRequestOptions = {
18655
- method: 'DELETE',
18656
- ...baseOptions,
18657
- ...options,
18658
- };
18659
- const localVarHeaderParameter = {};
18660
- const localVarQueryParameter = {};
18661
- // authentication AccessToken required
18662
- if (configuration && configuration.apiKey) {
18663
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
18664
- ? await configuration.apiKey('X-Webitel-Access')
18665
- : await configuration.apiKey;
18666
- localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
18667
- }
18668
- localVarUrlObj.query = {
18669
- ...localVarUrlObj.query,
18670
- ...localVarQueryParameter,
18671
- ...options.query,
18672
- };
18673
- // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
18674
- delete localVarUrlObj.search;
18675
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
18676
- localVarRequestOptions.headers = {
18677
- ...localVarHeaderParameter,
18678
- ...headersFromBaseOptions,
18679
- ...options.headers,
18680
- };
18681
- return {
18682
- url: format(localVarUrlObj),
18683
- options: localVarRequestOptions,
18684
- };
18685
- },
18686
- /**
18687
- *
18688
- * @param {number} id
18689
- * @param {EnginePatchRegionRequest} body
18690
- * @param {*} [options] Override http request option.
18691
- * @throws {RequiredError}
18692
- */
18693
- patchRegion: async (id, body, options = {}) => {
19393
+ patchChatPlan: async (id, body, options = {}) => {
18694
19394
  // verify required parameter 'id' is not null or undefined
18695
19395
  if (id === null || id === undefined) {
18696
- throw new RequiredError('id', 'Required parameter id was null or undefined when calling patchRegion.');
19396
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling patchChatPlan.');
18697
19397
  }
18698
19398
  // verify required parameter 'body' is not null or undefined
18699
19399
  if (body === null || body === undefined) {
18700
- throw new RequiredError('body', 'Required parameter body was null or undefined when calling patchRegion.');
19400
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling patchChatPlan.');
18701
19401
  }
18702
- const localVarPath = `/regions/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
19402
+ const localVarPath = `/routing/outbound/chat/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
18703
19403
  const localVarUrlObj = parse(localVarPath, true);
18704
19404
  let baseOptions;
18705
19405
  if (configuration) {
@@ -18749,12 +19449,12 @@ const RegionServiceApiAxiosParamCreator = function (configuration) {
18749
19449
  * @param {*} [options] Override http request option.
18750
19450
  * @throws {RequiredError}
18751
19451
  */
18752
- readRegion: async (id, options = {}) => {
19452
+ readChatPlan: async (id, options = {}) => {
18753
19453
  // verify required parameter 'id' is not null or undefined
18754
19454
  if (id === null || id === undefined) {
18755
- throw new RequiredError('id', 'Required parameter id was null or undefined when calling readRegion.');
19455
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling readChatPlan.');
18756
19456
  }
18757
- const localVarPath = `/regions/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
19457
+ const localVarPath = `/routing/outbound/chat/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
18758
19458
  const localVarUrlObj = parse(localVarPath, true);
18759
19459
  let baseOptions;
18760
19460
  if (configuration) {
@@ -18801,13 +19501,12 @@ const RegionServiceApiAxiosParamCreator = function (configuration) {
18801
19501
  * @param {Array<string>} [fields]
18802
19502
  * @param {Array<number>} [id]
18803
19503
  * @param {string} [name]
18804
- * @param {string} [description]
18805
- * @param {Array<number>} [timezoneId]
19504
+ * @param {boolean} [enabled]
18806
19505
  * @param {*} [options] Override http request option.
18807
19506
  * @throws {RequiredError}
18808
19507
  */
18809
- searchRegion: async (page, size, q, sort, fields, id, name, description, timezoneId, options = {}) => {
18810
- const localVarPath = `/regions`;
19508
+ searchChatPlan: async (page, size, q, sort, fields, id, name, enabled, options = {}) => {
19509
+ const localVarPath = `/routing/outbound/chat`;
18811
19510
  const localVarUrlObj = parse(localVarPath, true);
18812
19511
  let baseOptions;
18813
19512
  if (configuration) {
@@ -18848,11 +19547,8 @@ const RegionServiceApiAxiosParamCreator = function (configuration) {
18848
19547
  if (name !== undefined) {
18849
19548
  localVarQueryParameter['name'] = name;
18850
19549
  }
18851
- if (description !== undefined) {
18852
- localVarQueryParameter['description'] = description;
18853
- }
18854
- if (timezoneId) {
18855
- localVarQueryParameter['timezone_id'] = timezoneId;
19550
+ if (enabled !== undefined) {
19551
+ localVarQueryParameter['enabled'] = enabled;
18856
19552
  }
18857
19553
  localVarUrlObj.query = {
18858
19554
  ...localVarUrlObj.query,
@@ -18875,20 +19571,20 @@ const RegionServiceApiAxiosParamCreator = function (configuration) {
18875
19571
  /**
18876
19572
  *
18877
19573
  * @param {number} id
18878
- * @param {EngineUpdateRegionRequest} body
19574
+ * @param {EngineUpdateChatPlanRequest} body
18879
19575
  * @param {*} [options] Override http request option.
18880
19576
  * @throws {RequiredError}
18881
19577
  */
18882
- updateRegion: async (id, body, options = {}) => {
19578
+ updateChatPlan: async (id, body, options = {}) => {
18883
19579
  // verify required parameter 'id' is not null or undefined
18884
19580
  if (id === null || id === undefined) {
18885
- throw new RequiredError('id', 'Required parameter id was null or undefined when calling updateRegion.');
19581
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling updateChatPlan.');
18886
19582
  }
18887
19583
  // verify required parameter 'body' is not null or undefined
18888
19584
  if (body === null || body === undefined) {
18889
- throw new RequiredError('body', 'Required parameter body was null or undefined when calling updateRegion.');
19585
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling updateChatPlan.');
18890
19586
  }
18891
- const localVarPath = `/regions/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
19587
+ const localVarPath = `/routing/outbound/chat/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
18892
19588
  const localVarUrlObj = parse(localVarPath, true);
18893
19589
  let baseOptions;
18894
19590
  if (configuration) {
@@ -18935,35 +19631,19 @@ const RegionServiceApiAxiosParamCreator = function (configuration) {
18935
19631
  };
18936
19632
  };
18937
19633
  /**
18938
- * RegionServiceApi - functional programming interface
19634
+ * RoutingChatPlanServiceApi - functional programming interface
18939
19635
  * @export
18940
19636
  */
18941
- const RegionServiceApiFp = function (configuration) {
19637
+ const RoutingChatPlanServiceApiFp = function (configuration) {
18942
19638
  return {
18943
19639
  /**
18944
19640
  *
18945
- * @param {EngineCreateRegionRequest} body
18946
- * @param {*} [options] Override http request option.
18947
- * @throws {RequiredError}
18948
- */
18949
- async createRegion(body, options) {
18950
- const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).createRegion(body, options);
18951
- return (axios = globalAxios, basePath = BASE_PATH) => {
18952
- const axiosRequestArgs = {
18953
- ...localVarAxiosArgs.options,
18954
- url: basePath + localVarAxiosArgs.url,
18955
- };
18956
- return axios.request(axiosRequestArgs);
18957
- };
18958
- },
18959
- /**
18960
- *
18961
- * @param {number} id
19641
+ * @param {EngineCreateChatPlanRequest} body
18962
19642
  * @param {*} [options] Override http request option.
18963
19643
  * @throws {RequiredError}
18964
19644
  */
18965
- async deleteRegion(id, options) {
18966
- const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).deleteRegion(id, options);
19645
+ async createChatPlan(body, options) {
19646
+ const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).createChatPlan(body, options);
18967
19647
  return (axios = globalAxios, basePath = BASE_PATH) => {
18968
19648
  const axiosRequestArgs = {
18969
19649
  ...localVarAxiosArgs.options,
@@ -18975,12 +19655,12 @@ const RegionServiceApiFp = function (configuration) {
18975
19655
  /**
18976
19656
  *
18977
19657
  * @param {number} id
18978
- * @param {EnginePatchRegionRequest} body
19658
+ * @param {EnginePatchChatPlanRequest} body
18979
19659
  * @param {*} [options] Override http request option.
18980
19660
  * @throws {RequiredError}
18981
19661
  */
18982
- async patchRegion(id, body, options) {
18983
- const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).patchRegion(id, body, options);
19662
+ async patchChatPlan(id, body, options) {
19663
+ const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).patchChatPlan(id, body, options);
18984
19664
  return (axios = globalAxios, basePath = BASE_PATH) => {
18985
19665
  const axiosRequestArgs = {
18986
19666
  ...localVarAxiosArgs.options,
@@ -18995,8 +19675,8 @@ const RegionServiceApiFp = function (configuration) {
18995
19675
  * @param {*} [options] Override http request option.
18996
19676
  * @throws {RequiredError}
18997
19677
  */
18998
- async readRegion(id, options) {
18999
- const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).readRegion(id, options);
19678
+ async readChatPlan(id, options) {
19679
+ const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).readChatPlan(id, options);
19000
19680
  return (axios = globalAxios, basePath = BASE_PATH) => {
19001
19681
  const axiosRequestArgs = {
19002
19682
  ...localVarAxiosArgs.options,
@@ -19014,13 +19694,12 @@ const RegionServiceApiFp = function (configuration) {
19014
19694
  * @param {Array<string>} [fields]
19015
19695
  * @param {Array<number>} [id]
19016
19696
  * @param {string} [name]
19017
- * @param {string} [description]
19018
- * @param {Array<number>} [timezoneId]
19697
+ * @param {boolean} [enabled]
19019
19698
  * @param {*} [options] Override http request option.
19020
19699
  * @throws {RequiredError}
19021
19700
  */
19022
- async searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options) {
19023
- const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options);
19701
+ async searchChatPlan(page, size, q, sort, fields, id, name, enabled, options) {
19702
+ const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).searchChatPlan(page, size, q, sort, fields, id, name, enabled, options);
19024
19703
  return (axios = globalAxios, basePath = BASE_PATH) => {
19025
19704
  const axiosRequestArgs = {
19026
19705
  ...localVarAxiosArgs.options,
@@ -19032,12 +19711,12 @@ const RegionServiceApiFp = function (configuration) {
19032
19711
  /**
19033
19712
  *
19034
19713
  * @param {number} id
19035
- * @param {EngineUpdateRegionRequest} body
19714
+ * @param {EngineUpdateChatPlanRequest} body
19036
19715
  * @param {*} [options] Override http request option.
19037
19716
  * @throws {RequiredError}
19038
19717
  */
19039
- async updateRegion(id, body, options) {
19040
- const localVarAxiosArgs = await RegionServiceApiAxiosParamCreator(configuration).updateRegion(id, body, options);
19718
+ async updateChatPlan(id, body, options) {
19719
+ const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).updateChatPlan(id, body, options);
19041
19720
  return (axios = globalAxios, basePath = BASE_PATH) => {
19042
19721
  const axiosRequestArgs = {
19043
19722
  ...localVarAxiosArgs.options,
@@ -19049,43 +19728,32 @@ const RegionServiceApiFp = function (configuration) {
19049
19728
  };
19050
19729
  };
19051
19730
  /**
19052
- * RegionServiceApi - factory interface
19731
+ * RoutingChatPlanServiceApi - factory interface
19053
19732
  * @export
19054
19733
  */
19055
- const RegionServiceApiFactory = function (configuration, basePath, axios) {
19734
+ const RoutingChatPlanServiceApiFactory = function (configuration, basePath, axios) {
19056
19735
  return {
19057
19736
  /**
19058
19737
  *
19059
- * @param {EngineCreateRegionRequest} body
19060
- * @param {*} [options] Override http request option.
19061
- * @throws {RequiredError}
19062
- */
19063
- createRegion(body, options) {
19064
- return RegionServiceApiFp(configuration)
19065
- .createRegion(body, options)
19066
- .then((request) => request(axios, basePath));
19067
- },
19068
- /**
19069
- *
19070
- * @param {number} id
19738
+ * @param {EngineCreateChatPlanRequest} body
19071
19739
  * @param {*} [options] Override http request option.
19072
19740
  * @throws {RequiredError}
19073
19741
  */
19074
- deleteRegion(id, options) {
19075
- return RegionServiceApiFp(configuration)
19076
- .deleteRegion(id, options)
19742
+ createChatPlan(body, options) {
19743
+ return RoutingChatPlanServiceApiFp(configuration)
19744
+ .createChatPlan(body, options)
19077
19745
  .then((request) => request(axios, basePath));
19078
19746
  },
19079
19747
  /**
19080
19748
  *
19081
19749
  * @param {number} id
19082
- * @param {EnginePatchRegionRequest} body
19750
+ * @param {EnginePatchChatPlanRequest} body
19083
19751
  * @param {*} [options] Override http request option.
19084
19752
  * @throws {RequiredError}
19085
19753
  */
19086
- patchRegion(id, body, options) {
19087
- return RegionServiceApiFp(configuration)
19088
- .patchRegion(id, body, options)
19754
+ patchChatPlan(id, body, options) {
19755
+ return RoutingChatPlanServiceApiFp(configuration)
19756
+ .patchChatPlan(id, body, options)
19089
19757
  .then((request) => request(axios, basePath));
19090
19758
  },
19091
19759
  /**
@@ -19094,9 +19762,9 @@ const RegionServiceApiFactory = function (configuration, basePath, axios) {
19094
19762
  * @param {*} [options] Override http request option.
19095
19763
  * @throws {RequiredError}
19096
19764
  */
19097
- readRegion(id, options) {
19098
- return RegionServiceApiFp(configuration)
19099
- .readRegion(id, options)
19765
+ readChatPlan(id, options) {
19766
+ return RoutingChatPlanServiceApiFp(configuration)
19767
+ .readChatPlan(id, options)
19100
19768
  .then((request) => request(axios, basePath));
19101
19769
  },
19102
19770
  /**
@@ -19108,72 +19776,59 @@ const RegionServiceApiFactory = function (configuration, basePath, axios) {
19108
19776
  * @param {Array<string>} [fields]
19109
19777
  * @param {Array<number>} [id]
19110
19778
  * @param {string} [name]
19111
- * @param {string} [description]
19112
- * @param {Array<number>} [timezoneId]
19779
+ * @param {boolean} [enabled]
19113
19780
  * @param {*} [options] Override http request option.
19114
19781
  * @throws {RequiredError}
19115
19782
  */
19116
- searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options) {
19117
- return RegionServiceApiFp(configuration)
19118
- .searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options)
19783
+ searchChatPlan(page, size, q, sort, fields, id, name, enabled, options) {
19784
+ return RoutingChatPlanServiceApiFp(configuration)
19785
+ .searchChatPlan(page, size, q, sort, fields, id, name, enabled, options)
19119
19786
  .then((request) => request(axios, basePath));
19120
19787
  },
19121
19788
  /**
19122
19789
  *
19123
19790
  * @param {number} id
19124
- * @param {EngineUpdateRegionRequest} body
19791
+ * @param {EngineUpdateChatPlanRequest} body
19125
19792
  * @param {*} [options] Override http request option.
19126
19793
  * @throws {RequiredError}
19127
19794
  */
19128
- updateRegion(id, body, options) {
19129
- return RegionServiceApiFp(configuration)
19130
- .updateRegion(id, body, options)
19795
+ updateChatPlan(id, body, options) {
19796
+ return RoutingChatPlanServiceApiFp(configuration)
19797
+ .updateChatPlan(id, body, options)
19131
19798
  .then((request) => request(axios, basePath));
19132
19799
  },
19133
19800
  };
19134
19801
  };
19135
19802
  /**
19136
- * RegionServiceApi - object-oriented interface
19803
+ * RoutingChatPlanServiceApi - object-oriented interface
19137
19804
  * @export
19138
- * @class RegionServiceApi
19805
+ * @class RoutingChatPlanServiceApi
19139
19806
  * @extends {BaseAPI}
19140
19807
  */
19141
- class RegionServiceApi extends BaseAPI {
19142
- /**
19143
- *
19144
- * @param {EngineCreateRegionRequest} body
19145
- * @param {*} [options] Override http request option.
19146
- * @throws {RequiredError}
19147
- * @memberof RegionServiceApi
19148
- */
19149
- createRegion(body, options) {
19150
- return RegionServiceApiFp(this.configuration)
19151
- .createRegion(body, options)
19152
- .then((request) => request(this.axios, this.basePath));
19153
- }
19808
+ class RoutingChatPlanServiceApi extends BaseAPI {
19154
19809
  /**
19155
19810
  *
19156
- * @param {number} id
19811
+ * @param {EngineCreateChatPlanRequest} body
19157
19812
  * @param {*} [options] Override http request option.
19158
19813
  * @throws {RequiredError}
19159
- * @memberof RegionServiceApi
19814
+ * @memberof RoutingChatPlanServiceApi
19160
19815
  */
19161
- deleteRegion(id, options) {
19162
- return RegionServiceApiFp(this.configuration)
19163
- .deleteRegion(id, options)
19816
+ createChatPlan(body, options) {
19817
+ return RoutingChatPlanServiceApiFp(this.configuration)
19818
+ .createChatPlan(body, options)
19164
19819
  .then((request) => request(this.axios, this.basePath));
19165
19820
  }
19166
19821
  /**
19167
19822
  *
19168
19823
  * @param {number} id
19169
- * @param {EnginePatchRegionRequest} body
19824
+ * @param {EnginePatchChatPlanRequest} body
19170
19825
  * @param {*} [options] Override http request option.
19171
19826
  * @throws {RequiredError}
19172
- * @memberof RegionServiceApi
19827
+ * @memberof RoutingChatPlanServiceApi
19173
19828
  */
19174
- patchRegion(id, body, options) {
19175
- return RegionServiceApiFp(this.configuration)
19176
- .patchRegion(id, body, options)
19829
+ patchChatPlan(id, body, options) {
19830
+ return RoutingChatPlanServiceApiFp(this.configuration)
19831
+ .patchChatPlan(id, body, options)
19177
19832
  .then((request) => request(this.axios, this.basePath));
19178
19833
  }
19179
19834
  /**
@@ -19181,11 +19836,11 @@ class RegionServiceApi extends BaseAPI {
19181
19836
  * @param {number} id
19182
19837
  * @param {*} [options] Override http request option.
19183
19838
  * @throws {RequiredError}
19184
- * @memberof RegionServiceApi
19839
+ * @memberof RoutingChatPlanServiceApi
19185
19840
  */
19186
- readRegion(id, options) {
19187
- return RegionServiceApiFp(this.configuration)
19188
- .readRegion(id, options)
19841
+ readChatPlan(id, options) {
19842
+ return RoutingChatPlanServiceApiFp(this.configuration)
19843
+ .readChatPlan(id, options)
19189
19844
  .then((request) => request(this.axios, this.basePath));
19190
19845
  }
19191
19846
  /**
@@ -19197,28 +19852,27 @@ class RegionServiceApi extends BaseAPI {
19197
19852
  * @param {Array<string>} [fields]
19198
19853
  * @param {Array<number>} [id]
19199
19854
  * @param {string} [name]
19200
- * @param {string} [description]
19201
- * @param {Array<number>} [timezoneId]
19855
+ * @param {boolean} [enabled]
19202
19856
  * @param {*} [options] Override http request option.
19203
19857
  * @throws {RequiredError}
19204
- * @memberof RegionServiceApi
19858
+ * @memberof RoutingChatPlanServiceApi
19205
19859
  */
19206
- searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options) {
19207
- return RegionServiceApiFp(this.configuration)
19208
- .searchRegion(page, size, q, sort, fields, id, name, description, timezoneId, options)
19860
+ searchChatPlan(page, size, q, sort, fields, id, name, enabled, options) {
19861
+ return RoutingChatPlanServiceApiFp(this.configuration)
19862
+ .searchChatPlan(page, size, q, sort, fields, id, name, enabled, options)
19209
19863
  .then((request) => request(this.axios, this.basePath));
19210
19864
  }
19211
19865
  /**
19212
19866
  *
19213
19867
  * @param {number} id
19214
- * @param {EngineUpdateRegionRequest} body
19868
+ * @param {EngineUpdateChatPlanRequest} body
19215
19869
  * @param {*} [options] Override http request option.
19216
19870
  * @throws {RequiredError}
19217
- * @memberof RegionServiceApi
19871
+ * @memberof RoutingChatPlanServiceApi
19218
19872
  */
19219
- updateRegion(id, body, options) {
19220
- return RegionServiceApiFp(this.configuration)
19221
- .updateRegion(id, body, options)
19873
+ updateChatPlan(id, body, options) {
19874
+ return RoutingChatPlanServiceApiFp(this.configuration)
19875
+ .updateChatPlan(id, body, options)
19222
19876
  .then((request) => request(this.axios, this.basePath));
19223
19877
  }
19224
19878
  }
@@ -22332,6 +22986,7 @@ class Task {
22332
22986
  this.offeringAt = 0;
22333
22987
  this.answeredAt = 0;
22334
22988
  this.bridgedAt = 0;
22989
+ this.reportedAt = 0;
22335
22990
  this.startProcessingAt = 0;
22336
22991
  this.stopAt = 0;
22337
22992
  this.closedAt = 0;
@@ -22386,11 +23041,12 @@ class Task {
22386
23041
  this.lastStatusChange = Date.now();
22387
23042
  }
22388
23043
  setProcessing(p) {
23044
+ this.state = 'processing'; // todo
22389
23045
  if (!this.startProcessingAt) {
22390
23046
  this.startProcessingAt = Date.now();
22391
23047
  }
22392
23048
  if (p.sec) {
22393
- p.timeout = Date.now() + p.sec * 1000; // bug
23049
+ p.timeout = this.startProcessingAt + p.sec * 1000; // bug
22394
23050
  }
22395
23051
  this._processing = p;
22396
23052
  }
@@ -22442,10 +23098,12 @@ class Task {
22442
23098
  });
22443
23099
  }
22444
23100
  async reporting(reporting) {
22445
- return this.client.request('cc_reporting', {
23101
+ const res = await this.client.request('cc_reporting', {
22446
23102
  attempt_id: this.id,
22447
23103
  ...reporting,
22448
23104
  });
23105
+ this.reportedAt = Date.now();
23106
+ return res;
22449
23107
  }
22450
23108
  async renew(sec) {
22451
23109
  return this.client.request('cc_renewal', {
@@ -23149,7 +23807,13 @@ class Conversation {
23149
23807
  this.members = (members || []).map((i) => wrapChannelMember(i));
23150
23808
  this._messages = messages || [];
23151
23809
  this.state = ConversationState.Invite;
23152
- this.variables = variables;
23810
+ this.variables = {};
23811
+ this._hasReporting = !!(variables && variables.cc_reporting === 'true');
23812
+ for (const k in variables) {
23813
+ if (!k.startsWith('cc_') && variables.hasOwnProperty(k)) {
23814
+ this.variables[k] = variables[k];
23815
+ }
23816
+ }
23153
23817
  if (variables &&
23154
23818
  variables.hasOwnProperty('cc_attempt_id') &&
23155
23819
  this.client.agent) {
@@ -23172,7 +23836,7 @@ class Conversation {
23172
23836
  this.closedAt = timestamp;
23173
23837
  }
23174
23838
  get id() {
23175
- return this.conversationId;
23839
+ return this.channelId || this.inviteId || this.conversationId;
23176
23840
  }
23177
23841
  get messages() {
23178
23842
  return this.getMessages();
@@ -23186,6 +23850,7 @@ class Conversation {
23186
23850
  channelId: i.channel_id,
23187
23851
  createdAt: i.created_at,
23188
23852
  updatedAt: i.updated_at,
23853
+ contact: null,
23189
23854
  };
23190
23855
  if (i.hasOwnProperty('file')) {
23191
23856
  i.file.url = this.client.fileUrlDownload(i.file.id);
@@ -23194,6 +23859,9 @@ class Conversation {
23194
23859
  if (i.hasOwnProperty('text')) {
23195
23860
  msg.text = i.text;
23196
23861
  }
23862
+ if (i.hasOwnProperty('contact')) {
23863
+ msg.contact = i.contact;
23864
+ }
23197
23865
  return msg;
23198
23866
  });
23199
23867
  }
@@ -23219,7 +23887,14 @@ class Conversation {
23219
23887
  return this.answeredAt > 0 && this.hasReporting;
23220
23888
  }
23221
23889
  get hasReporting() {
23222
- return this.variables && this.variables.cc_reporting === 'true';
23890
+ return this._hasReporting;
23891
+ }
23892
+ get membersId() {
23893
+ const res = [this.id];
23894
+ for (const m of this.members) {
23895
+ res.push(m.id);
23896
+ }
23897
+ return res;
23223
23898
  }
23224
23899
  /*
23225
23900
  Actions
@@ -23243,7 +23918,7 @@ class Conversation {
23243
23918
  throw new Error('This conversation not active');
23244
23919
  return this.client.request(`close_chat`, {
23245
23920
  channel_id: this.channelId,
23246
- conversation_id: this.id,
23921
+ conversation_id: this.conversationId,
23247
23922
  cause,
23248
23923
  });
23249
23924
  }
@@ -23252,7 +23927,7 @@ class Conversation {
23252
23927
  throw new Error('This conversation not active');
23253
23928
  return this.client.request(`leave_chat`, {
23254
23929
  channel_id: this.channelId,
23255
- conversation_id: this.id,
23930
+ conversation_id: this.conversationId,
23256
23931
  cause,
23257
23932
  });
23258
23933
  }
@@ -23272,12 +23947,12 @@ class Conversation {
23272
23947
  }
23273
23948
  }
23274
23949
  async sendFile(file, cb) {
23275
- const storedFiles = await this.client.storeFile(this.id, [file], cb);
23950
+ const storedFiles = await this.client.storeFile(this.conversationId, [file], cb);
23276
23951
  const f = storedFiles[0];
23277
23952
  // todo bug if chat response error
23278
23953
  return this.client.request(`send_file_chat`, {
23279
23954
  channel_id: this.channelId,
23280
- conversation_id: this.id,
23955
+ conversation_id: this.conversationId,
23281
23956
  id: f.id,
23282
23957
  name: file.name,
23283
23958
  mime: f.mime,
@@ -23299,7 +23974,7 @@ class Conversation {
23299
23974
  async addToChat(userId, title) {
23300
23975
  return this.client.request(`add_to_chat`, {
23301
23976
  channel_id: this.channelId,
23302
- conversation_id: this.id,
23977
+ conversation_id: this.conversationId,
23303
23978
  user_id: userId,
23304
23979
  title,
23305
23980
  });
@@ -23329,7 +24004,7 @@ class Conversation {
23329
24004
  sendMessageTextChunk(text) {
23330
24005
  return this.client.request(`send_text_chat`, {
23331
24006
  channel_id: this.channelId,
23332
- conversation_id: this.id,
24007
+ conversation_id: this.conversationId,
23333
24008
  text,
23334
24009
  });
23335
24010
  }
@@ -23466,7 +24141,7 @@ class Client extends EventEmitter {
23466
24141
  call.answeredAt = c.answered_at || 0;
23467
24142
  call.bridgedAt = c.bridged_at || 0;
23468
24143
  call.hangupAt = c.hangup_at || 0;
23469
- call.reportingAt = c.reporting_at || 0;
24144
+ // call.reportingAt = c.reporting_at || 0
23470
24145
  if (c.task) {
23471
24146
  call.task = new Task(this, {
23472
24147
  attempt_id: c.task.attempt_id,
@@ -23476,6 +24151,14 @@ class Client extends EventEmitter {
23476
24151
  }, c.task // todo add app_id
23477
24152
  );
23478
24153
  call.queue.reporting = 'true';
24154
+ if (c.leaving_at && c.task.processing_sec) {
24155
+ call.task.startProcessingAt = c.leaving_at;
24156
+ call.task.setProcessing({
24157
+ sec: c.task.processing_sec || 0,
24158
+ timeout: Date.now() - c.leaving_at + (c.task.processing_sec || 0) * 1000,
24159
+ renewal_sec: c.task.processing_renewal_sec || 0,
24160
+ });
24161
+ }
23479
24162
  }
23480
24163
  this.callStore.set(call.id, call);
23481
24164
  }
@@ -23491,6 +24174,26 @@ class Client extends EventEmitter {
23491
24174
  const messages = conv.messages.reverse();
23492
24175
  const c = new Conversation(this, conv.id, conv.title, conv.members, messages, conv.variables);
23493
24176
  c.createdAt = conv.created_at;
24177
+ c.closedAt = conv.closed_at;
24178
+ if (conv.task) {
24179
+ c.task = new Task(this, {
24180
+ attempt_id: conv.task.attempt_id,
24181
+ channel: conv.task.channel,
24182
+ status: conv.task.status,
24183
+ timestamp: Date.now(),
24184
+ }, conv.task // todo add app_id
24185
+ );
24186
+ if (conv.leaving_at && conv.task.processing_sec) {
24187
+ c.task.startProcessingAt = conv.leaving_at;
24188
+ c.task.setProcessing({
24189
+ sec: conv.task.processing_sec || 0,
24190
+ timeout: Date.now() -
24191
+ conv.leaving_at +
24192
+ (conv.task.processing_sec || 0) * 1000,
24193
+ renewal_sec: conv.task.processing_renewal_sec || 0,
24194
+ });
24195
+ }
24196
+ }
23494
24197
  if (conv.invite_id) {
23495
24198
  c.setInvite(conv.invite_id, conv.created_at);
23496
24199
  }
@@ -23990,7 +24693,7 @@ class Client extends EventEmitter {
23990
24693
  break;
23991
24694
  case ChatActions.Joined:
23992
24695
  const joined = event.data;
23993
- conversation = this.conversationById(joined.conversation_id);
24696
+ conversation = this.conversationById(joined.member.id);
23994
24697
  if (conversation) {
23995
24698
  conversation.setAnswered(joined.member.id, timestamp, joined.member);
23996
24699
  }
@@ -23998,17 +24701,38 @@ class Client extends EventEmitter {
23998
24701
  case ChatActions.Message:
23999
24702
  const message = event.data;
24000
24703
  message.timestamp = timestamp;
24001
- conversation = this.conversationById(message.conversation_id);
24704
+ // fixme
24705
+ for (const v of this.allConversations()) {
24706
+ if (!v.closedAt && v.membersId.indexOf(message.channel_id) > -1) {
24707
+ conversation = v;
24708
+ }
24709
+ }
24002
24710
  if (conversation) {
24003
24711
  conversation.newMessage(message);
24004
24712
  }
24005
24713
  break;
24006
24714
  case ChatActions.Close:
24715
+ const c = event.data;
24716
+ // fixme
24717
+ for (const v of this.allConversations()) {
24718
+ if (!v.closedAt && v.membersId.indexOf(c.from_channel_id) > -1) {
24719
+ conversation = v;
24720
+ }
24721
+ }
24722
+ if (conversation) {
24723
+ conversation.setClosed(timestamp);
24724
+ }
24725
+ break;
24007
24726
  case ChatActions.Leave:
24727
+ const l = event.data;
24728
+ conversation = this.conversationById(l.leaved_channel_id);
24729
+ if (conversation) {
24730
+ conversation.setClosed(timestamp);
24731
+ }
24732
+ break;
24008
24733
  case ChatActions.Decline:
24009
- // TODO leave & CLOSE:
24010
24734
  const e = event.data;
24011
- conversation = this.conversationById(e.conversation_id);
24735
+ conversation = this.conversationById(e.invite_id);
24012
24736
  if (conversation) {
24013
24737
  conversation.setClosed(timestamp);
24014
24738
  }
@@ -24431,5 +25155,5 @@ class ExternalClient extends ee_3 {
24431
25155
 
24432
25156
  // tslint:disable
24433
25157
 
24434
- export { AgentPauseCauseServiceApiAxiosParamCreator, AgentPauseCauseServiceApiFp, AgentPauseCauseServiceApiFactory, AgentPauseCauseServiceApi, AgentServiceApiAxiosParamCreator, AgentServiceApiFp, AgentServiceApiFactory, AgentServiceApi, AgentSkillServiceApiAxiosParamCreator, AgentSkillServiceApiFp, AgentSkillServiceApiFactory, AgentSkillServiceApi, AgentTeamServiceApiAxiosParamCreator, AgentTeamServiceApiFp, AgentTeamServiceApiFactory, AgentTeamServiceApi, BackendProfileServiceApiAxiosParamCreator, BackendProfileServiceApiFp, BackendProfileServiceApiFactory, BackendProfileServiceApi, BucketServiceApiAxiosParamCreator, BucketServiceApiFp, BucketServiceApiFactory, BucketServiceApi, CalendarServiceApiAxiosParamCreator, CalendarServiceApiFp, CalendarServiceApiFactory, CalendarServiceApi, CallServiceApiAxiosParamCreator, CallServiceApiFp, CallServiceApiFactory, CallServiceApi, CommunicationTypeServiceApiAxiosParamCreator, CommunicationTypeServiceApiFp, CommunicationTypeServiceApiFactory, CommunicationTypeServiceApi, EmailProfileServiceApiAxiosParamCreator, EmailProfileServiceApiFp, EmailProfileServiceApiFactory, EmailProfileServiceApi, ListServiceApiAxiosParamCreator, ListServiceApiFp, ListServiceApiFactory, ListServiceApi, MediaFileServiceApiAxiosParamCreator, MediaFileServiceApiFp, MediaFileServiceApiFactory, MediaFileServiceApi, MemberServiceApiAxiosParamCreator, MemberServiceApiFp, MemberServiceApiFactory, MemberServiceApi, OutboundResourceGroupServiceApiAxiosParamCreator, OutboundResourceGroupServiceApiFp, OutboundResourceGroupServiceApiFactory, OutboundResourceGroupServiceApi, OutboundResourceServiceApiAxiosParamCreator, OutboundResourceServiceApiFp, OutboundResourceServiceApiFactory, OutboundResourceServiceApi, QueueBucketServiceApiAxiosParamCreator, QueueBucketServiceApiFp, QueueBucketServiceApiFactory, QueueBucketServiceApi, QueueHookServiceApiAxiosParamCreator, QueueHookServiceApiFp, QueueHookServiceApiFactory, QueueHookServiceApi, QueueResourcesServiceApiAxiosParamCreator, QueueResourcesServiceApiFp, QueueResourcesServiceApiFactory, QueueResourcesServiceApi, QueueServiceApiAxiosParamCreator, QueueServiceApiFp, QueueServiceApiFactory, QueueServiceApi, QueueSkillServiceApiAxiosParamCreator, QueueSkillServiceApiFp, QueueSkillServiceApiFactory, QueueSkillServiceApi, RegionServiceApiAxiosParamCreator, RegionServiceApiFp, RegionServiceApiFactory, RegionServiceApi, RoutingOutboundCallServiceApiAxiosParamCreator, RoutingOutboundCallServiceApiFp, RoutingOutboundCallServiceApiFactory, RoutingOutboundCallServiceApi, RoutingSchemaServiceApiAxiosParamCreator, RoutingSchemaServiceApiFp, RoutingSchemaServiceApiFactory, RoutingSchemaServiceApi, RoutingVariableServiceApiAxiosParamCreator, RoutingVariableServiceApiFp, RoutingVariableServiceApiFactory, RoutingVariableServiceApi, SkillServiceApiAxiosParamCreator, SkillServiceApiFp, SkillServiceApiFactory, SkillServiceApi, UserHelperServiceApiAxiosParamCreator, UserHelperServiceApiFp, UserHelperServiceApiFactory, UserHelperServiceApi, Configuration, Response, Client, CallReportingStatus, CallActions, CallDirection, Call, AgentStatus, ChannelState, ChannelType, Agent, ChatActions, ConversationState, Conversation, SipClient, ExternalClient, SipPhone, Log };
25158
+ export { AgentPauseCauseServiceApiAxiosParamCreator, AgentPauseCauseServiceApiFp, AgentPauseCauseServiceApiFactory, AgentPauseCauseServiceApi, AgentServiceApiAxiosParamCreator, AgentServiceApiFp, AgentServiceApiFactory, AgentServiceApi, AgentSkillServiceApiAxiosParamCreator, AgentSkillServiceApiFp, AgentSkillServiceApiFactory, AgentSkillServiceApi, AgentTeamServiceApiAxiosParamCreator, AgentTeamServiceApiFp, AgentTeamServiceApiFactory, AgentTeamServiceApi, BackendProfileServiceApiAxiosParamCreator, BackendProfileServiceApiFp, BackendProfileServiceApiFactory, BackendProfileServiceApi, BucketServiceApiAxiosParamCreator, BucketServiceApiFp, BucketServiceApiFactory, BucketServiceApi, CalendarServiceApiAxiosParamCreator, CalendarServiceApiFp, CalendarServiceApiFactory, CalendarServiceApi, CallServiceApiAxiosParamCreator, CallServiceApiFp, CallServiceApiFactory, CallServiceApi, CommunicationTypeServiceApiAxiosParamCreator, CommunicationTypeServiceApiFp, CommunicationTypeServiceApiFactory, CommunicationTypeServiceApi, EmailProfileServiceApiAxiosParamCreator, EmailProfileServiceApiFp, EmailProfileServiceApiFactory, EmailProfileServiceApi, ListServiceApiAxiosParamCreator, ListServiceApiFp, ListServiceApiFactory, ListServiceApi, MediaFileServiceApiAxiosParamCreator, MediaFileServiceApiFp, MediaFileServiceApiFactory, MediaFileServiceApi, MemberServiceApiAxiosParamCreator, MemberServiceApiFp, MemberServiceApiFactory, MemberServiceApi, OutboundResourceGroupServiceApiAxiosParamCreator, OutboundResourceGroupServiceApiFp, OutboundResourceGroupServiceApiFactory, OutboundResourceGroupServiceApi, OutboundResourceServiceApiAxiosParamCreator, OutboundResourceServiceApiFp, OutboundResourceServiceApiFactory, OutboundResourceServiceApi, QueueBucketServiceApiAxiosParamCreator, QueueBucketServiceApiFp, QueueBucketServiceApiFactory, QueueBucketServiceApi, QueueHookServiceApiAxiosParamCreator, QueueHookServiceApiFp, QueueHookServiceApiFactory, QueueHookServiceApi, QueueResourcesServiceApiAxiosParamCreator, QueueResourcesServiceApiFp, QueueResourcesServiceApiFactory, QueueResourcesServiceApi, QueueServiceApiAxiosParamCreator, QueueServiceApiFp, QueueServiceApiFactory, QueueServiceApi, QueueSkillServiceApiAxiosParamCreator, QueueSkillServiceApiFp, QueueSkillServiceApiFactory, QueueSkillServiceApi, RegionServiceApiAxiosParamCreator, RegionServiceApiFp, RegionServiceApiFactory, RegionServiceApi, RoutingChatPlanServiceApiAxiosParamCreator, RoutingChatPlanServiceApiFp, RoutingChatPlanServiceApiFactory, RoutingChatPlanServiceApi, RoutingOutboundCallServiceApiAxiosParamCreator, RoutingOutboundCallServiceApiFp, RoutingOutboundCallServiceApiFactory, RoutingOutboundCallServiceApi, RoutingSchemaServiceApiAxiosParamCreator, RoutingSchemaServiceApiFp, RoutingSchemaServiceApiFactory, RoutingSchemaServiceApi, RoutingVariableServiceApiAxiosParamCreator, RoutingVariableServiceApiFp, RoutingVariableServiceApiFactory, RoutingVariableServiceApi, SkillServiceApiAxiosParamCreator, SkillServiceApiFp, SkillServiceApiFactory, SkillServiceApi, UserHelperServiceApiAxiosParamCreator, UserHelperServiceApiFp, UserHelperServiceApiFactory, UserHelperServiceApi, Configuration, Response, Client, CallReportingStatus, CallActions, CallDirection, Call, AgentStatus, ChannelState, ChannelType, Agent, ChatActions, ConversationState, Conversation, SipClient, ExternalClient, SipPhone, Log };
24435
25159
  //# sourceMappingURL=index.esm.js.map