webitel-sdk 0.1.191 → 0.1.193

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 (55) hide show
  1. package/bundles/index.esm.js +229 -1
  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 +255 -1
  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 +200 -0
  10. package/esm2015/api/call-service-api.js.map +1 -1
  11. package/esm2015/api/engine-patch-history-call-request.js +13 -0
  12. package/esm2015/api/engine-patch-history-call-request.js.map +1 -0
  13. package/esm2015/api/engine-search-history-call-request.js +13 -0
  14. package/esm2015/api/engine-search-history-call-request.js.map +1 -0
  15. package/esm2015/api/index.js +2 -0
  16. package/esm2015/api/index.js.map +1 -1
  17. package/esm2015/socket/client.js +2 -1
  18. package/esm2015/socket/client.js.map +1 -1
  19. package/esm2015/socket/socket.js +1 -0
  20. package/esm2015/socket/socket.js.map +1 -1
  21. package/esm5/api/call-service-api.js +226 -0
  22. package/esm5/api/call-service-api.js.map +1 -1
  23. package/esm5/api/engine-patch-history-call-request.js +13 -0
  24. package/esm5/api/engine-patch-history-call-request.js.map +1 -0
  25. package/esm5/api/engine-search-history-call-request.js +13 -0
  26. package/esm5/api/engine-search-history-call-request.js.map +1 -0
  27. package/esm5/api/index.js +2 -0
  28. package/esm5/api/index.js.map +1 -1
  29. package/esm5/socket/client.js +2 -1
  30. package/esm5/socket/client.js.map +1 -1
  31. package/esm5/socket/socket.js +1 -0
  32. package/esm5/socket/socket.js.map +1 -1
  33. package/package.json +1 -1
  34. package/types/api/call-service-api.d.ts +69 -0
  35. package/types/api/call-service-api.d.ts.map +1 -1
  36. package/types/api/create-call-request-call-settings.d.ts +6 -0
  37. package/types/api/create-call-request-call-settings.d.ts.map +1 -1
  38. package/types/api/engine-history-call.d.ts +6 -0
  39. package/types/api/engine-history-call.d.ts.map +1 -1
  40. package/types/api/engine-patch-history-call-request.d.ts +33 -0
  41. package/types/api/engine-patch-history-call-request.d.ts.map +1 -0
  42. package/types/api/engine-search-history-call-request.d.ts +281 -0
  43. package/types/api/engine-search-history-call-request.d.ts.map +1 -0
  44. package/types/api/index.d.ts +2 -0
  45. package/types/api/index.d.ts.map +1 -1
  46. package/types/api/storage-cognitive-profile.d.ts +2 -4
  47. package/types/api/storage-cognitive-profile.d.ts.map +1 -1
  48. package/types/api/storage-create-cognitive-profile-request.d.ts +2 -4
  49. package/types/api/storage-create-cognitive-profile-request.d.ts.map +1 -1
  50. package/types/api/storage-patch-cognitive-profile-request.d.ts +2 -4
  51. package/types/api/storage-patch-cognitive-profile-request.d.ts.map +1 -1
  52. package/types/api/storage-update-cognitive-profile-request.d.ts +2 -4
  53. package/types/api/storage-update-cognitive-profile-request.d.ts.map +1 -1
  54. package/types/socket/client.d.ts.map +1 -1
  55. package/types/socket/socket.d.ts.map +1 -1
@@ -8202,6 +8202,66 @@ const CallServiceApiAxiosParamCreator = function (configuration) {
8202
8202
  options: localVarRequestOptions,
8203
8203
  };
8204
8204
  },
8205
+ /**
8206
+ *
8207
+ * @param {string} id
8208
+ * @param {EnginePatchHistoryCallRequest} body
8209
+ * @param {*} [options] Override http request option.
8210
+ * @throws {RequiredError}
8211
+ */
8212
+ patchHistoryCall: async (id, body, options = {}) => {
8213
+ // verify required parameter 'id' is not null or undefined
8214
+ if (id === null || id === undefined) {
8215
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling patchHistoryCall.');
8216
+ }
8217
+ // verify required parameter 'body' is not null or undefined
8218
+ if (body === null || body === undefined) {
8219
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling patchHistoryCall.');
8220
+ }
8221
+ const localVarPath = `/calls/history/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
8222
+ const localVarUrlObj = parse(localVarPath, true);
8223
+ let baseOptions;
8224
+ if (configuration) {
8225
+ baseOptions = configuration.baseOptions;
8226
+ }
8227
+ const localVarRequestOptions = {
8228
+ method: 'PATCH',
8229
+ ...baseOptions,
8230
+ ...options,
8231
+ };
8232
+ const localVarHeaderParameter = {};
8233
+ const localVarQueryParameter = {};
8234
+ // authentication AccessToken required
8235
+ if (configuration && configuration.apiKey) {
8236
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
8237
+ ? await configuration.apiKey('X-Webitel-Access')
8238
+ : await configuration.apiKey;
8239
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
8240
+ }
8241
+ localVarHeaderParameter['Content-Type'] = 'application/json';
8242
+ localVarUrlObj.query = {
8243
+ ...localVarUrlObj.query,
8244
+ ...localVarQueryParameter,
8245
+ ...options.query,
8246
+ };
8247
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
8248
+ delete localVarUrlObj.search;
8249
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
8250
+ localVarRequestOptions.headers = {
8251
+ ...localVarHeaderParameter,
8252
+ ...headersFromBaseOptions,
8253
+ ...options.headers,
8254
+ };
8255
+ const needsSerialization = typeof body !== 'string' ||
8256
+ localVarRequestOptions.headers['Content-Type'] === 'application/json';
8257
+ localVarRequestOptions.data = needsSerialization
8258
+ ? JSON.stringify(body !== undefined ? body : {})
8259
+ : body || '';
8260
+ return {
8261
+ url: format(localVarUrlObj),
8262
+ options: localVarRequestOptions,
8263
+ };
8264
+ },
8205
8265
  /**
8206
8266
  *
8207
8267
  * @summary Call item
@@ -8657,6 +8717,62 @@ const CallServiceApiAxiosParamCreator = function (configuration) {
8657
8717
  options: localVarRequestOptions,
8658
8718
  };
8659
8719
  },
8720
+ /**
8721
+ *
8722
+ * @summary List of call
8723
+ * @param {EngineSearchHistoryCallRequest} body
8724
+ * @param {*} [options] Override http request option.
8725
+ * @throws {RequiredError}
8726
+ */
8727
+ searchHistoryCallPost: async (body, options = {}) => {
8728
+ // verify required parameter 'body' is not null or undefined
8729
+ if (body === null || body === undefined) {
8730
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling searchHistoryCallPost.');
8731
+ }
8732
+ const localVarPath = `/calls/history`;
8733
+ const localVarUrlObj = parse(localVarPath, true);
8734
+ let baseOptions;
8735
+ if (configuration) {
8736
+ baseOptions = configuration.baseOptions;
8737
+ }
8738
+ const localVarRequestOptions = {
8739
+ method: 'POST',
8740
+ ...baseOptions,
8741
+ ...options,
8742
+ };
8743
+ const localVarHeaderParameter = {};
8744
+ const localVarQueryParameter = {};
8745
+ // authentication AccessToken required
8746
+ if (configuration && configuration.apiKey) {
8747
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
8748
+ ? await configuration.apiKey('X-Webitel-Access')
8749
+ : await configuration.apiKey;
8750
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
8751
+ }
8752
+ localVarHeaderParameter['Content-Type'] = 'application/json';
8753
+ localVarUrlObj.query = {
8754
+ ...localVarUrlObj.query,
8755
+ ...localVarQueryParameter,
8756
+ ...options.query,
8757
+ };
8758
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
8759
+ delete localVarUrlObj.search;
8760
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
8761
+ localVarRequestOptions.headers = {
8762
+ ...localVarHeaderParameter,
8763
+ ...headersFromBaseOptions,
8764
+ ...options.headers,
8765
+ };
8766
+ const needsSerialization = typeof body !== 'string' ||
8767
+ localVarRequestOptions.headers['Content-Type'] === 'application/json';
8768
+ localVarRequestOptions.data = needsSerialization
8769
+ ? JSON.stringify(body !== undefined ? body : {})
8770
+ : body || '';
8771
+ return {
8772
+ url: format(localVarUrlObj),
8773
+ options: localVarRequestOptions,
8774
+ };
8775
+ },
8660
8776
  /**
8661
8777
  *
8662
8778
  * @param {string} id
@@ -9020,6 +9136,23 @@ const CallServiceApiFp = function (configuration) {
9020
9136
  return axios.request(axiosRequestArgs);
9021
9137
  };
9022
9138
  },
9139
+ /**
9140
+ *
9141
+ * @param {string} id
9142
+ * @param {EnginePatchHistoryCallRequest} body
9143
+ * @param {*} [options] Override http request option.
9144
+ * @throws {RequiredError}
9145
+ */
9146
+ async patchHistoryCall(id, body, options) {
9147
+ const localVarAxiosArgs = await CallServiceApiAxiosParamCreator(configuration).patchHistoryCall(id, body, options);
9148
+ return (axios = globalAxios, basePath = BASE_PATH) => {
9149
+ const axiosRequestArgs = {
9150
+ ...localVarAxiosArgs.options,
9151
+ url: basePath + localVarAxiosArgs.url,
9152
+ };
9153
+ return axios.request(axiosRequestArgs);
9154
+ };
9155
+ },
9023
9156
  /**
9024
9157
  *
9025
9158
  * @summary Call item
@@ -9147,6 +9280,23 @@ const CallServiceApiFp = function (configuration) {
9147
9280
  return axios.request(axiosRequestArgs);
9148
9281
  };
9149
9282
  },
9283
+ /**
9284
+ *
9285
+ * @summary List of call
9286
+ * @param {EngineSearchHistoryCallRequest} body
9287
+ * @param {*} [options] Override http request option.
9288
+ * @throws {RequiredError}
9289
+ */
9290
+ async searchHistoryCallPost(body, options) {
9291
+ const localVarAxiosArgs = await CallServiceApiAxiosParamCreator(configuration).searchHistoryCallPost(body, options);
9292
+ return (axios = globalAxios, basePath = BASE_PATH) => {
9293
+ const axiosRequestArgs = {
9294
+ ...localVarAxiosArgs.options,
9295
+ url: basePath + localVarAxiosArgs.url,
9296
+ };
9297
+ return axios.request(axiosRequestArgs);
9298
+ };
9299
+ },
9150
9300
  /**
9151
9301
  *
9152
9302
  * @param {string} id
@@ -9325,6 +9475,18 @@ const CallServiceApiFactory = function (configuration, basePath, axios) {
9325
9475
  .holdCall(id, body, options)
9326
9476
  .then((request) => request(axios, basePath));
9327
9477
  },
9478
+ /**
9479
+ *
9480
+ * @param {string} id
9481
+ * @param {EnginePatchHistoryCallRequest} body
9482
+ * @param {*} [options] Override http request option.
9483
+ * @throws {RequiredError}
9484
+ */
9485
+ patchHistoryCall(id, body, options) {
9486
+ return CallServiceApiFp(configuration)
9487
+ .patchHistoryCall(id, body, options)
9488
+ .then((request) => request(axios, basePath));
9489
+ },
9328
9490
  /**
9329
9491
  *
9330
9492
  * @summary Call item
@@ -9437,6 +9599,18 @@ const CallServiceApiFactory = function (configuration, basePath, axios) {
9437
9599
  .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, fts, directions, hasTranscript, agentDescription, ownerId, granteeId, amdAiResult, talkFrom, talkTo, rated, ratedBy, scoreRequiredFrom, scoreRequiredTo, scoreOptionalFrom, scoreOptionalTo, ratedUser, options)
9438
9600
  .then((request) => request(axios, basePath));
9439
9601
  },
9602
+ /**
9603
+ *
9604
+ * @summary List of call
9605
+ * @param {EngineSearchHistoryCallRequest} body
9606
+ * @param {*} [options] Override http request option.
9607
+ * @throws {RequiredError}
9608
+ */
9609
+ searchHistoryCallPost(body, options) {
9610
+ return CallServiceApiFp(configuration)
9611
+ .searchHistoryCallPost(body, options)
9612
+ .then((request) => request(axios, basePath));
9613
+ },
9440
9614
  /**
9441
9615
  *
9442
9616
  * @param {string} id
@@ -9611,6 +9785,19 @@ class CallServiceApi extends BaseAPI {
9611
9785
  .holdCall(id, body, options)
9612
9786
  .then((request) => request(this.axios, this.basePath));
9613
9787
  }
9788
+ /**
9789
+ *
9790
+ * @param {string} id
9791
+ * @param {EnginePatchHistoryCallRequest} body
9792
+ * @param {*} [options] Override http request option.
9793
+ * @throws {RequiredError}
9794
+ * @memberof CallServiceApi
9795
+ */
9796
+ patchHistoryCall(id, body, options) {
9797
+ return CallServiceApiFp(this.configuration)
9798
+ .patchHistoryCall(id, body, options)
9799
+ .then((request) => request(this.axios, this.basePath));
9800
+ }
9614
9801
  /**
9615
9802
  *
9616
9803
  * @summary Call item
@@ -9726,6 +9913,19 @@ class CallServiceApi extends BaseAPI {
9726
9913
  .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, fts, directions, hasTranscript, agentDescription, ownerId, granteeId, amdAiResult, talkFrom, talkTo, rated, ratedBy, scoreRequiredFrom, scoreRequiredTo, scoreOptionalFrom, scoreOptionalTo, ratedUser, options)
9727
9914
  .then((request) => request(this.axios, this.basePath));
9728
9915
  }
9916
+ /**
9917
+ *
9918
+ * @summary List of call
9919
+ * @param {EngineSearchHistoryCallRequest} body
9920
+ * @param {*} [options] Override http request option.
9921
+ * @throws {RequiredError}
9922
+ * @memberof CallServiceApi
9923
+ */
9924
+ searchHistoryCallPost(body, options) {
9925
+ return CallServiceApiFp(this.configuration)
9926
+ .searchHistoryCallPost(body, options)
9927
+ .then((request) => request(this.axios, this.basePath));
9928
+ }
9729
9929
  /**
9730
9930
  *
9731
9931
  * @param {string} id
@@ -31789,6 +31989,19 @@ var EngineBoolFilter;
31789
31989
  * Do not edit the class manually.
31790
31990
  */
31791
31991
 
31992
+ // tslint:disable
31993
+ /**
31994
+ * Webitel engine API
31995
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
31996
+ *
31997
+ * The version of the OpenAPI document: 23.02.0
31998
+ * Contact: support@webitel.com
31999
+ *
32000
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
32001
+ * https://openapi-generator.tech
32002
+ * Do not edit the class manually.
32003
+ */
32004
+
31792
32005
  // tslint:disable
31793
32006
  /**
31794
32007
  * Webitel engine API
@@ -32215,6 +32428,19 @@ var EngineRoutingSchemaType;
32215
32428
  * Do not edit the class manually.
32216
32429
  */
32217
32430
 
32431
+ // tslint:disable
32432
+ /**
32433
+ * Webitel engine API
32434
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
32435
+ *
32436
+ * The version of the OpenAPI document: 23.02.0
32437
+ * Contact: support@webitel.com
32438
+ *
32439
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
32440
+ * https://openapi-generator.tech
32441
+ * Do not edit the class manually.
32442
+ */
32443
+
32218
32444
  // tslint:disable
32219
32445
  /**
32220
32446
  * Webitel engine API
@@ -35091,6 +35317,7 @@ class Socket extends EventEmitter {
35091
35317
  close(code) {
35092
35318
  this.socket.close(code || 1000);
35093
35319
  delete this.socket;
35320
+ this.onClose(code || 1000);
35094
35321
  }
35095
35322
  onOpen() {
35096
35323
  this.emit('open');
@@ -35697,8 +35924,9 @@ class Client extends EventEmitter {
35697
35924
  async pingServer() {
35698
35925
  if (this.pingTimer && this.connectionInfo.ping_interval) {
35699
35926
  const t = setTimeout(async () => {
35927
+ this.log.error('close socket without pong');
35700
35928
  this.socket.close(3005);
35701
- }, +this.connectionInfo.ping_interval / 2);
35929
+ }, 2000);
35702
35930
  await this.ping();
35703
35931
  clearTimeout(t);
35704
35932
  }