webitel-sdk 23.12.8 → 23.12.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/index.esm.js +140 -9
- package/bundles/index.esm.js.map +1 -1
- package/bundles/index.esm.min.js +1 -1
- package/bundles/index.esm.min.js.map +1 -1
- package/bundles/index.umd.js +150 -9
- package/bundles/index.umd.js.map +1 -1
- package/bundles/index.umd.min.js +1 -1
- package/bundles/index.umd.min.js.map +1 -1
- package/esm2015/api/communication-type-service-api.js +116 -7
- package/esm2015/api/communication-type-service-api.js.map +1 -1
- package/esm2015/api/engine-patch-communication-type-request.js +13 -0
- package/esm2015/api/engine-patch-communication-type-request.js.map +1 -0
- package/esm2015/api/index.js +1 -0
- package/esm2015/api/index.js.map +1 -1
- package/esm2015/socket/client.js +11 -2
- package/esm2015/socket/client.js.map +1 -1
- package/esm5/api/communication-type-service-api.js +129 -7
- package/esm5/api/communication-type-service-api.js.map +1 -1
- package/esm5/api/engine-patch-communication-type-request.js +13 -0
- package/esm5/api/engine-patch-communication-type-request.js.map +1 -0
- package/esm5/api/index.js +1 -0
- package/esm5/api/index.js.map +1 -1
- package/esm5/socket/client.js +8 -2
- package/esm5/socket/client.js.map +1 -1
- package/package.json +1 -1
- package/types/api/communication-type-service-api.d.ts +42 -4
- package/types/api/communication-type-service-api.d.ts.map +1 -1
- package/types/api/engine-communication-type-request.d.ts +3 -3
- package/types/api/engine-communication-type-request.d.ts.map +1 -1
- package/types/api/engine-communication-type.d.ts +6 -0
- package/types/api/engine-communication-type.d.ts.map +1 -1
- package/types/api/engine-patch-communication-type-request.d.ts +62 -0
- package/types/api/engine-patch-communication-type-request.d.ts.map +1 -0
- package/types/api/engine-update-communication-type-request.d.ts +3 -3
- package/types/api/engine-update-communication-type-request.d.ts.map +1 -1
- package/types/api/index.d.ts +1 -0
- package/types/api/index.d.ts.map +1 -1
- package/types/api/webitel-chat-file.d.ts +3 -3
- package/types/socket/client.d.ts +1 -0
- package/types/socket/client.d.ts.map +1 -1
package/bundles/index.esm.js
CHANGED
|
@@ -11903,6 +11903,66 @@ const CommunicationTypeServiceApiAxiosParamCreator = function (configuration) {
|
|
|
11903
11903
|
options: localVarRequestOptions,
|
|
11904
11904
|
};
|
|
11905
11905
|
},
|
|
11906
|
+
/**
|
|
11907
|
+
*
|
|
11908
|
+
* @param {string} id
|
|
11909
|
+
* @param {EnginePatchCommunicationTypeRequest} body
|
|
11910
|
+
* @param {*} [options] Override http request option.
|
|
11911
|
+
* @throws {RequiredError}
|
|
11912
|
+
*/
|
|
11913
|
+
patchCommunicationType: async (id, body, options = {}) => {
|
|
11914
|
+
// verify required parameter 'id' is not null or undefined
|
|
11915
|
+
if (id === null || id === undefined) {
|
|
11916
|
+
throw new RequiredError('id', 'Required parameter id was null or undefined when calling patchCommunicationType.');
|
|
11917
|
+
}
|
|
11918
|
+
// verify required parameter 'body' is not null or undefined
|
|
11919
|
+
if (body === null || body === undefined) {
|
|
11920
|
+
throw new RequiredError('body', 'Required parameter body was null or undefined when calling patchCommunicationType.');
|
|
11921
|
+
}
|
|
11922
|
+
const localVarPath = `/call_center/communication_type/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
|
|
11923
|
+
const localVarUrlObj = parse(localVarPath, true);
|
|
11924
|
+
let baseOptions;
|
|
11925
|
+
if (configuration) {
|
|
11926
|
+
baseOptions = configuration.baseOptions;
|
|
11927
|
+
}
|
|
11928
|
+
const localVarRequestOptions = {
|
|
11929
|
+
method: 'PATCH',
|
|
11930
|
+
...baseOptions,
|
|
11931
|
+
...options,
|
|
11932
|
+
};
|
|
11933
|
+
const localVarHeaderParameter = {};
|
|
11934
|
+
const localVarQueryParameter = {};
|
|
11935
|
+
// authentication AccessToken required
|
|
11936
|
+
if (configuration && configuration.apiKey) {
|
|
11937
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
11938
|
+
? await configuration.apiKey('X-Webitel-Access')
|
|
11939
|
+
: await configuration.apiKey;
|
|
11940
|
+
localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
|
|
11941
|
+
}
|
|
11942
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
11943
|
+
localVarUrlObj.query = {
|
|
11944
|
+
...localVarUrlObj.query,
|
|
11945
|
+
...localVarQueryParameter,
|
|
11946
|
+
...options.query,
|
|
11947
|
+
};
|
|
11948
|
+
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
|
|
11949
|
+
delete localVarUrlObj.search;
|
|
11950
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
11951
|
+
localVarRequestOptions.headers = {
|
|
11952
|
+
...localVarHeaderParameter,
|
|
11953
|
+
...headersFromBaseOptions,
|
|
11954
|
+
...options.headers,
|
|
11955
|
+
};
|
|
11956
|
+
const needsSerialization = typeof body !== 'string' ||
|
|
11957
|
+
localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
11958
|
+
localVarRequestOptions.data = needsSerialization
|
|
11959
|
+
? JSON.stringify(body !== undefined ? body : {})
|
|
11960
|
+
: body || '';
|
|
11961
|
+
return {
|
|
11962
|
+
url: format(localVarUrlObj),
|
|
11963
|
+
options: localVarRequestOptions,
|
|
11964
|
+
};
|
|
11965
|
+
},
|
|
11906
11966
|
/**
|
|
11907
11967
|
*
|
|
11908
11968
|
* @summary CommunicationType item
|
|
@@ -11967,10 +12027,11 @@ const CommunicationTypeServiceApiAxiosParamCreator = function (configuration) {
|
|
|
11967
12027
|
* @param {Array<string>} [fields]
|
|
11968
12028
|
* @param {Array<number>} [id]
|
|
11969
12029
|
* @param {Array<'Undefined' | 'Phone' | 'Email' | 'Messaging'>} [channel]
|
|
12030
|
+
* @param {boolean} [_default]
|
|
11970
12031
|
* @param {*} [options] Override http request option.
|
|
11971
12032
|
* @throws {RequiredError}
|
|
11972
12033
|
*/
|
|
11973
|
-
searchCommunicationType: async (page, size, q, sort, fields, id, channel, options = {}) => {
|
|
12034
|
+
searchCommunicationType: async (page, size, q, sort, fields, id, channel, _default, options = {}) => {
|
|
11974
12035
|
const localVarPath = `/call_center/communication_type`;
|
|
11975
12036
|
const localVarUrlObj = parse(localVarPath, true);
|
|
11976
12037
|
let baseOptions;
|
|
@@ -12012,6 +12073,9 @@ const CommunicationTypeServiceApiAxiosParamCreator = function (configuration) {
|
|
|
12012
12073
|
if (channel) {
|
|
12013
12074
|
localVarQueryParameter['channel'] = channel;
|
|
12014
12075
|
}
|
|
12076
|
+
if (_default !== undefined) {
|
|
12077
|
+
localVarQueryParameter['default'] = _default;
|
|
12078
|
+
}
|
|
12015
12079
|
localVarUrlObj.query = {
|
|
12016
12080
|
...localVarUrlObj.query,
|
|
12017
12081
|
...localVarQueryParameter,
|
|
@@ -12134,6 +12198,23 @@ const CommunicationTypeServiceApiFp = function (configuration) {
|
|
|
12134
12198
|
return axios.request(axiosRequestArgs);
|
|
12135
12199
|
};
|
|
12136
12200
|
},
|
|
12201
|
+
/**
|
|
12202
|
+
*
|
|
12203
|
+
* @param {string} id
|
|
12204
|
+
* @param {EnginePatchCommunicationTypeRequest} body
|
|
12205
|
+
* @param {*} [options] Override http request option.
|
|
12206
|
+
* @throws {RequiredError}
|
|
12207
|
+
*/
|
|
12208
|
+
async patchCommunicationType(id, body, options) {
|
|
12209
|
+
const localVarAxiosArgs = await CommunicationTypeServiceApiAxiosParamCreator(configuration).patchCommunicationType(id, body, options);
|
|
12210
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
12211
|
+
const axiosRequestArgs = {
|
|
12212
|
+
...localVarAxiosArgs.options,
|
|
12213
|
+
url: basePath + localVarAxiosArgs.url,
|
|
12214
|
+
};
|
|
12215
|
+
return axios.request(axiosRequestArgs);
|
|
12216
|
+
};
|
|
12217
|
+
},
|
|
12137
12218
|
/**
|
|
12138
12219
|
*
|
|
12139
12220
|
* @summary CommunicationType item
|
|
@@ -12162,11 +12243,12 @@ const CommunicationTypeServiceApiFp = function (configuration) {
|
|
|
12162
12243
|
* @param {Array<string>} [fields]
|
|
12163
12244
|
* @param {Array<number>} [id]
|
|
12164
12245
|
* @param {Array<'Undefined' | 'Phone' | 'Email' | 'Messaging'>} [channel]
|
|
12246
|
+
* @param {boolean} [_default]
|
|
12165
12247
|
* @param {*} [options] Override http request option.
|
|
12166
12248
|
* @throws {RequiredError}
|
|
12167
12249
|
*/
|
|
12168
|
-
async searchCommunicationType(page, size, q, sort, fields, id, channel, options) {
|
|
12169
|
-
const localVarAxiosArgs = await CommunicationTypeServiceApiAxiosParamCreator(configuration).searchCommunicationType(page, size, q, sort, fields, id, channel, options);
|
|
12250
|
+
async searchCommunicationType(page, size, q, sort, fields, id, channel, _default, options) {
|
|
12251
|
+
const localVarAxiosArgs = await CommunicationTypeServiceApiAxiosParamCreator(configuration).searchCommunicationType(page, size, q, sort, fields, id, channel, _default, options);
|
|
12170
12252
|
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
12171
12253
|
const axiosRequestArgs = {
|
|
12172
12254
|
...localVarAxiosArgs.options,
|
|
@@ -12226,6 +12308,18 @@ const CommunicationTypeServiceApiFactory = function (configuration, basePath, ax
|
|
|
12226
12308
|
.deleteCommunicationType(id, domainId, options)
|
|
12227
12309
|
.then((request) => request(axios, basePath));
|
|
12228
12310
|
},
|
|
12311
|
+
/**
|
|
12312
|
+
*
|
|
12313
|
+
* @param {string} id
|
|
12314
|
+
* @param {EnginePatchCommunicationTypeRequest} body
|
|
12315
|
+
* @param {*} [options] Override http request option.
|
|
12316
|
+
* @throws {RequiredError}
|
|
12317
|
+
*/
|
|
12318
|
+
patchCommunicationType(id, body, options) {
|
|
12319
|
+
return CommunicationTypeServiceApiFp(configuration)
|
|
12320
|
+
.patchCommunicationType(id, body, options)
|
|
12321
|
+
.then((request) => request(axios, basePath));
|
|
12322
|
+
},
|
|
12229
12323
|
/**
|
|
12230
12324
|
*
|
|
12231
12325
|
* @summary CommunicationType item
|
|
@@ -12249,12 +12343,13 @@ const CommunicationTypeServiceApiFactory = function (configuration, basePath, ax
|
|
|
12249
12343
|
* @param {Array<string>} [fields]
|
|
12250
12344
|
* @param {Array<number>} [id]
|
|
12251
12345
|
* @param {Array<'Undefined' | 'Phone' | 'Email' | 'Messaging'>} [channel]
|
|
12346
|
+
* @param {boolean} [_default]
|
|
12252
12347
|
* @param {*} [options] Override http request option.
|
|
12253
12348
|
* @throws {RequiredError}
|
|
12254
12349
|
*/
|
|
12255
|
-
searchCommunicationType(page, size, q, sort, fields, id, channel, options) {
|
|
12350
|
+
searchCommunicationType(page, size, q, sort, fields, id, channel, _default, options) {
|
|
12256
12351
|
return CommunicationTypeServiceApiFp(configuration)
|
|
12257
|
-
.searchCommunicationType(page, size, q, sort, fields, id, channel, options)
|
|
12352
|
+
.searchCommunicationType(page, size, q, sort, fields, id, channel, _default, options)
|
|
12258
12353
|
.then((request) => request(axios, basePath));
|
|
12259
12354
|
},
|
|
12260
12355
|
/**
|
|
@@ -12306,6 +12401,19 @@ class CommunicationTypeServiceApi extends BaseAPI {
|
|
|
12306
12401
|
.deleteCommunicationType(id, domainId, options)
|
|
12307
12402
|
.then((request) => request(this.axios, this.basePath));
|
|
12308
12403
|
}
|
|
12404
|
+
/**
|
|
12405
|
+
*
|
|
12406
|
+
* @param {string} id
|
|
12407
|
+
* @param {EnginePatchCommunicationTypeRequest} body
|
|
12408
|
+
* @param {*} [options] Override http request option.
|
|
12409
|
+
* @throws {RequiredError}
|
|
12410
|
+
* @memberof CommunicationTypeServiceApi
|
|
12411
|
+
*/
|
|
12412
|
+
patchCommunicationType(id, body, options) {
|
|
12413
|
+
return CommunicationTypeServiceApiFp(this.configuration)
|
|
12414
|
+
.patchCommunicationType(id, body, options)
|
|
12415
|
+
.then((request) => request(this.axios, this.basePath));
|
|
12416
|
+
}
|
|
12309
12417
|
/**
|
|
12310
12418
|
*
|
|
12311
12419
|
* @summary CommunicationType item
|
|
@@ -12330,13 +12438,14 @@ class CommunicationTypeServiceApi extends BaseAPI {
|
|
|
12330
12438
|
* @param {Array<string>} [fields]
|
|
12331
12439
|
* @param {Array<number>} [id]
|
|
12332
12440
|
* @param {Array<'Undefined' | 'Phone' | 'Email' | 'Messaging'>} [channel]
|
|
12441
|
+
* @param {boolean} [_default]
|
|
12333
12442
|
* @param {*} [options] Override http request option.
|
|
12334
12443
|
* @throws {RequiredError}
|
|
12335
12444
|
* @memberof CommunicationTypeServiceApi
|
|
12336
12445
|
*/
|
|
12337
|
-
searchCommunicationType(page, size, q, sort, fields, id, channel, options) {
|
|
12446
|
+
searchCommunicationType(page, size, q, sort, fields, id, channel, _default, options) {
|
|
12338
12447
|
return CommunicationTypeServiceApiFp(this.configuration)
|
|
12339
|
-
.searchCommunicationType(page, size, q, sort, fields, id, channel, options)
|
|
12448
|
+
.searchCommunicationType(page, size, q, sort, fields, id, channel, _default, options)
|
|
12340
12449
|
.then((request) => request(this.axios, this.basePath));
|
|
12341
12450
|
}
|
|
12342
12451
|
/**
|
|
@@ -41338,6 +41447,19 @@ var EngineCommunicationChannels;
|
|
|
41338
41447
|
* Do not edit the class manually.
|
|
41339
41448
|
*/
|
|
41340
41449
|
|
|
41450
|
+
// tslint:disable
|
|
41451
|
+
/**
|
|
41452
|
+
* Webitel API
|
|
41453
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
41454
|
+
*
|
|
41455
|
+
* The version of the OpenAPI document: 23.09.0
|
|
41456
|
+
* Contact: support@webitel.com
|
|
41457
|
+
*
|
|
41458
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
41459
|
+
* https://openapi-generator.tech
|
|
41460
|
+
* Do not edit the class manually.
|
|
41461
|
+
*/
|
|
41462
|
+
|
|
41341
41463
|
// tslint:disable
|
|
41342
41464
|
/**
|
|
41343
41465
|
* Webitel API
|
|
@@ -46613,12 +46735,18 @@ class Client extends EventEmitter {
|
|
|
46613
46735
|
}
|
|
46614
46736
|
}
|
|
46615
46737
|
}
|
|
46738
|
+
deadlinePingTime(interval) {
|
|
46739
|
+
if (interval > 10000) {
|
|
46740
|
+
return interval / 2;
|
|
46741
|
+
}
|
|
46742
|
+
return 3000;
|
|
46743
|
+
}
|
|
46616
46744
|
async pingServer() {
|
|
46617
46745
|
if (this.pingTimer && this.connectionInfo.ping_interval) {
|
|
46618
46746
|
const t = setTimeout(async () => {
|
|
46619
46747
|
this.log.error('close socket without pong');
|
|
46620
46748
|
this.socket.close(3005);
|
|
46621
|
-
},
|
|
46749
|
+
}, this.deadlinePingTime(this.connectionInfo.ping_interval));
|
|
46622
46750
|
await this.ping();
|
|
46623
46751
|
clearTimeout(t);
|
|
46624
46752
|
}
|
|
@@ -46649,7 +46777,10 @@ class Client extends EventEmitter {
|
|
|
46649
46777
|
}
|
|
46650
46778
|
async calculateLatency(ack) {
|
|
46651
46779
|
ack.client_ts = Date.now();
|
|
46652
|
-
Object.assign(ack, await this.request(`latency_ack`,
|
|
46780
|
+
Object.assign(ack, await this.request(`latency_ack`, {
|
|
46781
|
+
...ack,
|
|
46782
|
+
last_latency: this.lastLatency || 0,
|
|
46783
|
+
}));
|
|
46653
46784
|
ack.client_ack_ts = Date.now();
|
|
46654
46785
|
this.lastLatency = Math.abs(ack.server_ack_ts -
|
|
46655
46786
|
ack.server_ts -
|