webitel-sdk 0.1.87 → 0.1.91

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 (64) hide show
  1. package/bundles/index.esm.js +166 -34
  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 +209 -38
  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/call-service-api.js +14 -7
  10. package/esm2015/api/call-service-api.js.map +1 -1
  11. package/esm2015/api/engine-patch-queue-bucket-request.js +13 -0
  12. package/esm2015/api/engine-patch-queue-bucket-request.js.map +1 -0
  13. package/esm2015/api/index.js.map +1 -1
  14. package/esm2015/api/queue-bucket-service-api.js +125 -27
  15. package/esm2015/api/queue-bucket-service-api.js.map +1 -1
  16. package/esm2015/api-consumers/list-getter/endpoint-list-getter-api-consumer/endpoint-list-getter-api-consumer.js +7 -5
  17. package/esm2015/api-consumers/list-getter/endpoint-list-getter-api-consumer/endpoint-list-getter-api-consumer.js.map +1 -1
  18. package/esm2015/sip/webrtc/index.js +1 -0
  19. package/esm2015/sip/webrtc/index.js.map +1 -1
  20. package/esm2015/socket/client.js +26 -0
  21. package/esm2015/socket/client.js.map +1 -1
  22. package/esm5/api/call-service-api.js +14 -7
  23. package/esm5/api/call-service-api.js.map +1 -1
  24. package/esm5/api/engine-patch-queue-bucket-request.js +13 -0
  25. package/esm5/api/engine-patch-queue-bucket-request.js.map +1 -0
  26. package/esm5/api/index.js.map +1 -1
  27. package/esm5/api/queue-bucket-service-api.js +138 -27
  28. package/esm5/api/queue-bucket-service-api.js.map +1 -1
  29. package/esm5/api-consumers/list-getter/endpoint-list-getter-api-consumer/endpoint-list-getter-api-consumer.js +15 -13
  30. package/esm5/api-consumers/list-getter/endpoint-list-getter-api-consumer/endpoint-list-getter-api-consumer.js.map +1 -1
  31. package/esm5/sip/webrtc/index.js +1 -0
  32. package/esm5/sip/webrtc/index.js.map +1 -1
  33. package/esm5/socket/client.js +56 -4
  34. package/esm5/socket/client.js.map +1 -1
  35. package/package.json +1 -1
  36. package/types/api/call-service-api.d.ts +8 -4
  37. package/types/api/call-service-api.d.ts.map +1 -1
  38. package/types/api/engine-attempt-callback-request.d.ts +6 -0
  39. package/types/api/engine-attempt-callback-request.d.ts.map +1 -1
  40. package/types/api/engine-attempt-result-request.d.ts +6 -0
  41. package/types/api/engine-attempt-result-request.d.ts.map +1 -1
  42. package/types/api/engine-create-queue-bucket-request.d.ts +8 -2
  43. package/types/api/engine-create-queue-bucket-request.d.ts.map +1 -1
  44. package/types/api/engine-member-communication-create-request.d.ts +6 -0
  45. package/types/api/engine-member-communication-create-request.d.ts.map +1 -1
  46. package/types/api/engine-member-communication.d.ts +6 -0
  47. package/types/api/engine-member-communication.d.ts.map +1 -1
  48. package/types/api/engine-patch-queue-bucket-request.d.ts +62 -0
  49. package/types/api/engine-patch-queue-bucket-request.d.ts.map +1 -0
  50. package/types/api/engine-queue-bucket.d.ts +12 -0
  51. package/types/api/engine-queue-bucket.d.ts.map +1 -1
  52. package/types/api/engine-update-queue-bucket-request.d.ts +8 -2
  53. package/types/api/engine-update-queue-bucket-request.d.ts.map +1 -1
  54. package/types/api/index.d.ts +1 -0
  55. package/types/api/index.d.ts.map +1 -1
  56. package/types/api/queue-bucket-service-api.d.ts +46 -16
  57. package/types/api/queue-bucket-service-api.d.ts.map +1 -1
  58. package/types/api-consumers/list-getter/endpoint-list-getter-api-consumer/endpoint-list-getter-api-consumer.d.ts +1 -1
  59. package/types/api-consumers/list-getter/endpoint-list-getter-api-consumer/endpoint-list-getter-api-consumer.d.ts.map +1 -1
  60. package/types/api-consumers/list-getter/endpoint-list-getter-api-consumer/interfaces/endpoint-get-list-params.d.ts +1 -0
  61. package/types/api-consumers/list-getter/endpoint-list-getter-api-consumer/interfaces/endpoint-get-list-params.d.ts.map +1 -1
  62. package/types/sip/webrtc/index.d.ts.map +1 -1
  63. package/types/socket/client.d.ts +4 -0
  64. package/types/socket/client.d.ts.map +1 -1
@@ -6982,10 +6982,11 @@ const CallServiceApiAxiosParamCreator = function (configuration) {
6982
6982
  * @param {Array<string>} [transferTo]
6983
6983
  * @param {Array<string>} [dependencyId]
6984
6984
  * @param {Array<string>} [tags]
6985
+ * @param {Array<string>} [amdResult]
6985
6986
  * @param {*} [options] Override http request option.
6986
6987
  * @throws {RequiredError}
6987
6988
  */
6988
- searchHistoryCall: async (page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, options = {}) => {
6989
+ searchHistoryCall: async (page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, amdResult, options = {}) => {
6989
6990
  const localVarPath = `/calls/history`;
6990
6991
  const localVarUrlObj = parse(localVarPath, true);
6991
6992
  let baseOptions;
@@ -7102,6 +7103,9 @@ const CallServiceApiAxiosParamCreator = function (configuration) {
7102
7103
  if (tags) {
7103
7104
  localVarQueryParameter['tags'] = tags;
7104
7105
  }
7106
+ if (amdResult) {
7107
+ localVarQueryParameter['amd_result'] = amdResult;
7108
+ }
7105
7109
  localVarUrlObj.query = {
7106
7110
  ...localVarUrlObj.query,
7107
7111
  ...localVarQueryParameter,
@@ -7504,11 +7508,12 @@ const CallServiceApiFp = function (configuration) {
7504
7508
  * @param {Array<string>} [transferTo]
7505
7509
  * @param {Array<string>} [dependencyId]
7506
7510
  * @param {Array<string>} [tags]
7511
+ * @param {Array<string>} [amdResult]
7507
7512
  * @param {*} [options] Override http request option.
7508
7513
  * @throws {RequiredError}
7509
7514
  */
7510
- async searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, options) {
7511
- const localVarAxiosArgs = await CallServiceApiAxiosParamCreator(configuration).searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, options);
7515
+ async searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, amdResult, options) {
7516
+ const localVarAxiosArgs = await CallServiceApiAxiosParamCreator(configuration).searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, amdResult, options);
7512
7517
  return (axios = globalAxios, basePath = BASE_PATH) => {
7513
7518
  const axiosRequestArgs = {
7514
7519
  ...localVarAxiosArgs.options,
@@ -7754,12 +7759,13 @@ const CallServiceApiFactory = function (configuration, basePath, axios) {
7754
7759
  * @param {Array<string>} [transferTo]
7755
7760
  * @param {Array<string>} [dependencyId]
7756
7761
  * @param {Array<string>} [tags]
7762
+ * @param {Array<string>} [amdResult]
7757
7763
  * @param {*} [options] Override http request option.
7758
7764
  * @throws {RequiredError}
7759
7765
  */
7760
- searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, options) {
7766
+ searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, amdResult, options) {
7761
7767
  return CallServiceApiFp(configuration)
7762
- .searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, options)
7768
+ .searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, amdResult, options)
7763
7769
  .then((request) => request(axios, basePath));
7764
7770
  },
7765
7771
  /**
@@ -8001,13 +8007,14 @@ class CallServiceApi extends BaseAPI {
8001
8007
  * @param {Array<string>} [transferTo]
8002
8008
  * @param {Array<string>} [dependencyId]
8003
8009
  * @param {Array<string>} [tags]
8010
+ * @param {Array<string>} [amdResult]
8004
8011
  * @param {*} [options] Override http request option.
8005
8012
  * @throws {RequiredError}
8006
8013
  * @memberof CallServiceApi
8007
8014
  */
8008
- searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, options) {
8015
+ searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, amdResult, options) {
8009
8016
  return CallServiceApiFp(this.configuration)
8010
- .searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, options)
8017
+ .searchHistoryCall(page, size, q, sort, fields, createdAtFrom, createdAtTo, userId, agentId, queueId, teamId, memberId, gatewayId, durationFrom, durationTo, skipParent, parentId, cause, hasFile, domainId, number, direction, answeredAtFrom, answeredAtTo, missed, storedAtFrom, storedAtTo, id, transferFrom, transferTo, dependencyId, tags, amdResult, options)
8011
8018
  .then((request) => request(this.axios, this.basePath));
8012
8019
  }
8013
8020
  /**
@@ -15162,11 +15169,10 @@ const QueueBucketServiceApiAxiosParamCreator = function (configuration) {
15162
15169
  * @summary DeleteQueueRouting
15163
15170
  * @param {string} queueId
15164
15171
  * @param {string} id
15165
- * @param {string} [domainId]
15166
15172
  * @param {*} [options] Override http request option.
15167
15173
  * @throws {RequiredError}
15168
15174
  */
15169
- deleteQueueBucket: async (queueId, id, domainId, options = {}) => {
15175
+ deleteQueueBucket: async (queueId, id, options = {}) => {
15170
15176
  // verify required parameter 'queueId' is not null or undefined
15171
15177
  if (queueId === null || queueId === undefined) {
15172
15178
  throw new RequiredError('queueId', 'Required parameter queueId was null or undefined when calling deleteQueueBucket.');
@@ -15197,9 +15203,68 @@ const QueueBucketServiceApiAxiosParamCreator = function (configuration) {
15197
15203
  : await configuration.apiKey;
15198
15204
  localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
15199
15205
  }
15200
- if (domainId !== undefined) {
15201
- 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;
15202
15266
  }
15267
+ localVarHeaderParameter['Content-Type'] = 'application/json';
15203
15268
  localVarUrlObj.query = {
15204
15269
  ...localVarUrlObj.query,
15205
15270
  ...localVarQueryParameter,
@@ -15213,6 +15278,11 @@ const QueueBucketServiceApiAxiosParamCreator = function (configuration) {
15213
15278
  ...headersFromBaseOptions,
15214
15279
  ...options.headers,
15215
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 || '';
15216
15286
  return {
15217
15287
  url: format(localVarUrlObj),
15218
15288
  options: localVarRequestOptions,
@@ -15223,11 +15293,10 @@ const QueueBucketServiceApiAxiosParamCreator = function (configuration) {
15223
15293
  * @summary ReadQueueRouting
15224
15294
  * @param {string} queueId
15225
15295
  * @param {string} id
15226
- * @param {string} [domainId]
15227
15296
  * @param {*} [options] Override http request option.
15228
15297
  * @throws {RequiredError}
15229
15298
  */
15230
- readQueueBucket: async (queueId, id, domainId, options = {}) => {
15299
+ readQueueBucket: async (queueId, id, options = {}) => {
15231
15300
  // verify required parameter 'queueId' is not null or undefined
15232
15301
  if (queueId === null || queueId === undefined) {
15233
15302
  throw new RequiredError('queueId', 'Required parameter queueId was null or undefined when calling readQueueBucket.');
@@ -15258,9 +15327,6 @@ const QueueBucketServiceApiAxiosParamCreator = function (configuration) {
15258
15327
  : await configuration.apiKey;
15259
15328
  localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
15260
15329
  }
15261
- if (domainId !== undefined) {
15262
- localVarQueryParameter['domain_id'] = domainId;
15263
- }
15264
15330
  localVarUrlObj.query = {
15265
15331
  ...localVarUrlObj.query,
15266
15332
  ...localVarQueryParameter,
@@ -15452,12 +15518,29 @@ const QueueBucketServiceApiFp = function (configuration) {
15452
15518
  * @summary DeleteQueueRouting
15453
15519
  * @param {string} queueId
15454
15520
  * @param {string} id
15455
- * @param {string} [domainId]
15456
15521
  * @param {*} [options] Override http request option.
15457
15522
  * @throws {RequiredError}
15458
15523
  */
15459
- async deleteQueueBucket(queueId, id, domainId, options) {
15460
- 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);
15461
15544
  return (axios = globalAxios, basePath = BASE_PATH) => {
15462
15545
  const axiosRequestArgs = {
15463
15546
  ...localVarAxiosArgs.options,
@@ -15471,12 +15554,11 @@ const QueueBucketServiceApiFp = function (configuration) {
15471
15554
  * @summary ReadQueueRouting
15472
15555
  * @param {string} queueId
15473
15556
  * @param {string} id
15474
- * @param {string} [domainId]
15475
15557
  * @param {*} [options] Override http request option.
15476
15558
  * @throws {RequiredError}
15477
15559
  */
15478
- async readQueueBucket(queueId, id, domainId, options) {
15479
- 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);
15480
15562
  return (axios = globalAxios, basePath = BASE_PATH) => {
15481
15563
  const axiosRequestArgs = {
15482
15564
  ...localVarAxiosArgs.options,
@@ -15553,13 +15635,25 @@ const QueueBucketServiceApiFactory = function (configuration, basePath, axios) {
15553
15635
  * @summary DeleteQueueRouting
15554
15636
  * @param {string} queueId
15555
15637
  * @param {string} id
15556
- * @param {string} [domainId]
15557
15638
  * @param {*} [options] Override http request option.
15558
15639
  * @throws {RequiredError}
15559
15640
  */
15560
- deleteQueueBucket(queueId, id, domainId, options) {
15641
+ deleteQueueBucket(queueId, id, options) {
15561
15642
  return QueueBucketServiceApiFp(configuration)
15562
- .deleteQueueBucket(queueId, id, domainId, options)
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) {
15655
+ return QueueBucketServiceApiFp(configuration)
15656
+ .patchQueueBucket(queueId, id, body, options)
15563
15657
  .then((request) => request(axios, basePath));
15564
15658
  },
15565
15659
  /**
@@ -15567,13 +15661,12 @@ const QueueBucketServiceApiFactory = function (configuration, basePath, axios) {
15567
15661
  * @summary ReadQueueRouting
15568
15662
  * @param {string} queueId
15569
15663
  * @param {string} id
15570
- * @param {string} [domainId]
15571
15664
  * @param {*} [options] Override http request option.
15572
15665
  * @throws {RequiredError}
15573
15666
  */
15574
- readQueueBucket(queueId, id, domainId, options) {
15667
+ readQueueBucket(queueId, id, options) {
15575
15668
  return QueueBucketServiceApiFp(configuration)
15576
- .readQueueBucket(queueId, id, domainId, options)
15669
+ .readQueueBucket(queueId, id, options)
15577
15670
  .then((request) => request(axios, basePath));
15578
15671
  },
15579
15672
  /**
@@ -15636,14 +15729,27 @@ class QueueBucketServiceApi extends BaseAPI {
15636
15729
  * @summary DeleteQueueRouting
15637
15730
  * @param {string} queueId
15638
15731
  * @param {string} id
15639
- * @param {string} [domainId]
15640
15732
  * @param {*} [options] Override http request option.
15641
15733
  * @throws {RequiredError}
15642
15734
  * @memberof QueueBucketServiceApi
15643
15735
  */
15644
- deleteQueueBucket(queueId, id, domainId, options) {
15736
+ deleteQueueBucket(queueId, id, options) {
15645
15737
  return QueueBucketServiceApiFp(this.configuration)
15646
- .deleteQueueBucket(queueId, id, domainId, options)
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) {
15751
+ return QueueBucketServiceApiFp(this.configuration)
15752
+ .patchQueueBucket(queueId, id, body, options)
15647
15753
  .then((request) => request(this.axios, this.basePath));
15648
15754
  }
15649
15755
  /**
@@ -15651,14 +15757,13 @@ class QueueBucketServiceApi extends BaseAPI {
15651
15757
  * @summary ReadQueueRouting
15652
15758
  * @param {string} queueId
15653
15759
  * @param {string} id
15654
- * @param {string} [domainId]
15655
15760
  * @param {*} [options] Override http request option.
15656
15761
  * @throws {RequiredError}
15657
15762
  * @memberof QueueBucketServiceApi
15658
15763
  */
15659
- readQueueBucket(queueId, id, domainId, options) {
15764
+ readQueueBucket(queueId, id, options) {
15660
15765
  return QueueBucketServiceApiFp(this.configuration)
15661
- .readQueueBucket(queueId, id, domainId, options)
15766
+ .readQueueBucket(queueId, id, options)
15662
15767
  .then((request) => request(this.axios, this.basePath));
15663
15768
  }
15664
15769
  /**
@@ -22158,6 +22263,7 @@ class SipPhone extends EventEmitter {
22158
22263
  }
22159
22264
  async unregister() {
22160
22265
  if (this.ua) {
22266
+ this.ua.terminateSessions();
22161
22267
  this.ua.removeAllListeners();
22162
22268
  await this.ua.stop();
22163
22269
  delete this.ua;
@@ -23387,6 +23493,7 @@ const API_HEADER_TOKEN = 'X-Webitel-Access';
23387
23493
  const WEBSOCKET_AUTHENTICATION_CHALLENGE = 'authentication_challenge';
23388
23494
  const WEBSOCKET_DEFAULT_DEVICE_CONFIG = 'user_default_device';
23389
23495
  const WEBSOCKET_AGENT_SESSION = 'cc_agent_session';
23496
+ const WEBSOCKET_PING = 'ping';
23390
23497
  // const WEBSOCKET_CALL_BY_USER = 'call_by_user'
23391
23498
  const WEBSOCKET_MAKE_OUTBOUND_CALL = 'call_invite';
23392
23499
  const WEBSOCKET_MAKE_USER_CALL = 'call_user';
@@ -23413,6 +23520,7 @@ class Client extends EventEmitter {
23413
23520
  this.eventHandler = new EventEmitter();
23414
23521
  this.callStore = new Map();
23415
23522
  this.conversationStore = new Map();
23523
+ this.pingTimer = null;
23416
23524
  this.basePath = `${formatBaseUri(_config.storageEndpoint || _config.endpoint)}`;
23417
23525
  }
23418
23526
  async connect() {
@@ -23575,6 +23683,11 @@ class Client extends EventEmitter {
23575
23683
  token: this._config.token,
23576
23684
  });
23577
23685
  }
23686
+ async ping() {
23687
+ return this.request(WEBSOCKET_PING, {
23688
+ ping: 1,
23689
+ });
23690
+ }
23578
23691
  sessionInfo() {
23579
23692
  return this.connectionInfo.session;
23580
23693
  }
@@ -23813,8 +23926,24 @@ class Client extends EventEmitter {
23813
23926
  this.eventHandler.emit(TASK_EVENT, e.status, task);
23814
23927
  }
23815
23928
  }
23929
+ async pingServer() {
23930
+ if (this.pingTimer && this.connectionInfo.ping_interval) {
23931
+ const t = setTimeout(async () => {
23932
+ this.socket.close(3005);
23933
+ }, +this.connectionInfo.ping_interval / 2);
23934
+ await this.ping();
23935
+ clearTimeout(t);
23936
+ }
23937
+ if (this.connectionInfo.ping_interval) {
23938
+ // @ts-ignore
23939
+ this.pingTimer = setTimeout(this.pingServer.bind(this), +this.connectionInfo.ping_interval);
23940
+ }
23941
+ }
23816
23942
  async connected(info) {
23817
23943
  this.connectionInfo = info;
23944
+ if (info.ping_interval) {
23945
+ await this.pingServer();
23946
+ }
23818
23947
  if (!this.useWebPhone()) {
23819
23948
  return;
23820
23949
  }
@@ -23861,6 +23990,9 @@ class Client extends EventEmitter {
23861
23990
  }
23862
23991
  this.socket.on('message', this.onMessage.bind(this));
23863
23992
  this.socket.on('close', (code) => {
23993
+ if (this.pingTimer) {
23994
+ clearTimeout(this.pingTimer);
23995
+ }
23864
23996
  this.log.error('socket close code: ', code);
23865
23997
  this.eventHandler.off('*');
23866
23998
  if (code !== 1000) {