webitel-sdk 0.1.92 → 0.1.97

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 (77) hide show
  1. package/bundles/index.esm.js +624 -15
  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 +715 -15
  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-update-chat-plan-request.js +13 -0
  18. package/esm2015/api/engine-update-chat-plan-request.js.map +1 -0
  19. package/esm2015/api/index.js.map +1 -1
  20. package/esm2015/api/routing-chat-plan-service-api.js +572 -0
  21. package/esm2015/api/routing-chat-plan-service-api.js.map +1 -0
  22. package/esm2015/api.js +1 -0
  23. package/esm2015/api.js.map +1 -1
  24. package/esm2015/socket/client.js +25 -4
  25. package/esm2015/socket/client.js.map +1 -1
  26. package/esm2015/socket/conversation.js +40 -9
  27. package/esm2015/socket/conversation.js.map +1 -1
  28. package/esm2015/socket/task.js +2 -1
  29. package/esm2015/socket/task.js.map +1 -1
  30. package/esm5/api/engine-chat-plan.js +13 -0
  31. package/esm5/api/engine-chat-plan.js.map +1 -0
  32. package/esm5/api/engine-create-chat-plan-request.js +13 -0
  33. package/esm5/api/engine-create-chat-plan-request.js.map +1 -0
  34. package/esm5/api/engine-list-chat-plan.js +13 -0
  35. package/esm5/api/engine-list-chat-plan.js.map +1 -0
  36. package/esm5/api/engine-patch-chat-plan-request.js +13 -0
  37. package/esm5/api/engine-patch-chat-plan-request.js.map +1 -0
  38. package/esm5/api/engine-update-chat-plan-request.js +13 -0
  39. package/esm5/api/engine-update-chat-plan-request.js.map +1 -0
  40. package/esm5/api/index.js.map +1 -1
  41. package/esm5/api/routing-chat-plan-service-api.js +645 -0
  42. package/esm5/api/routing-chat-plan-service-api.js.map +1 -0
  43. package/esm5/api.js +1 -0
  44. package/esm5/api.js.map +1 -1
  45. package/esm5/socket/client.js +29 -5
  46. package/esm5/socket/client.js.map +1 -1
  47. package/esm5/socket/conversation.js +53 -9
  48. package/esm5/socket/conversation.js.map +1 -1
  49. package/esm5/socket/task.js +2 -1
  50. package/esm5/socket/task.js.map +1 -1
  51. package/package.json +3 -3
  52. package/types/api/create-call-request-call-settings.d.ts +6 -0
  53. package/types/api/create-call-request-call-settings.d.ts.map +1 -1
  54. package/types/api/engine-chat-plan.d.ts +50 -0
  55. package/types/api/engine-chat-plan.d.ts.map +1 -0
  56. package/types/api/engine-create-chat-plan-request.d.ts +44 -0
  57. package/types/api/engine-create-chat-plan-request.d.ts.map +1 -0
  58. package/types/api/engine-history-call.d.ts +6 -0
  59. package/types/api/engine-history-call.d.ts.map +1 -1
  60. package/types/api/engine-list-chat-plan.d.ts +32 -0
  61. package/types/api/engine-list-chat-plan.d.ts.map +1 -0
  62. package/types/api/engine-patch-chat-plan-request.d.ts +56 -0
  63. package/types/api/engine-patch-chat-plan-request.d.ts.map +1 -0
  64. package/types/api/engine-queue-resource-group.d.ts +6 -0
  65. package/types/api/engine-queue-resource-group.d.ts.map +1 -1
  66. package/types/api/engine-update-chat-plan-request.d.ts +50 -0
  67. package/types/api/engine-update-chat-plan-request.d.ts.map +1 -0
  68. package/types/api/index.d.ts +5 -0
  69. package/types/api/index.d.ts.map +1 -1
  70. package/types/api/routing-chat-plan-service-api.d.ts +225 -0
  71. package/types/api/routing-chat-plan-service-api.d.ts.map +1 -0
  72. package/types/api.d.ts +1 -0
  73. package/types/api.d.ts.map +1 -1
  74. package/types/socket/client.d.ts.map +1 -1
  75. package/types/socket/conversation.d.ts +14 -4
  76. package/types/socket/conversation.d.ts.map +1 -1
  77. package/types/socket/task.d.ts.map +1 -1
@@ -19321,6 +19321,562 @@ class RegionServiceApi extends BaseAPI {
19321
19321
  }
19322
19322
  }
19323
19323
 
19324
+ // tslint:disable
19325
+ /**
19326
+ * RoutingChatPlanServiceApi - axios parameter creator
19327
+ * @export
19328
+ */
19329
+ const RoutingChatPlanServiceApiAxiosParamCreator = function (configuration) {
19330
+ return {
19331
+ /**
19332
+ *
19333
+ * @param {EngineCreateChatPlanRequest} body
19334
+ * @param {*} [options] Override http request option.
19335
+ * @throws {RequiredError}
19336
+ */
19337
+ createChatPlan: async (body, options = {}) => {
19338
+ // verify required parameter 'body' is not null or undefined
19339
+ if (body === null || body === undefined) {
19340
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling createChatPlan.');
19341
+ }
19342
+ const localVarPath = `/routing/outbound/chat`;
19343
+ const localVarUrlObj = parse(localVarPath, true);
19344
+ let baseOptions;
19345
+ if (configuration) {
19346
+ baseOptions = configuration.baseOptions;
19347
+ }
19348
+ const localVarRequestOptions = {
19349
+ method: 'POST',
19350
+ ...baseOptions,
19351
+ ...options,
19352
+ };
19353
+ const localVarHeaderParameter = {};
19354
+ const localVarQueryParameter = {};
19355
+ // authentication AccessToken required
19356
+ if (configuration && configuration.apiKey) {
19357
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
19358
+ ? await configuration.apiKey('X-Webitel-Access')
19359
+ : await configuration.apiKey;
19360
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
19361
+ }
19362
+ localVarHeaderParameter['Content-Type'] = 'application/json';
19363
+ localVarUrlObj.query = {
19364
+ ...localVarUrlObj.query,
19365
+ ...localVarQueryParameter,
19366
+ ...options.query,
19367
+ };
19368
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
19369
+ delete localVarUrlObj.search;
19370
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
19371
+ localVarRequestOptions.headers = {
19372
+ ...localVarHeaderParameter,
19373
+ ...headersFromBaseOptions,
19374
+ ...options.headers,
19375
+ };
19376
+ const needsSerialization = typeof body !== 'string' ||
19377
+ localVarRequestOptions.headers['Content-Type'] === 'application/json';
19378
+ localVarRequestOptions.data = needsSerialization
19379
+ ? JSON.stringify(body !== undefined ? body : {})
19380
+ : body || '';
19381
+ return {
19382
+ url: format(localVarUrlObj),
19383
+ options: localVarRequestOptions,
19384
+ };
19385
+ },
19386
+ /**
19387
+ *
19388
+ * @param {number} id
19389
+ * @param {EnginePatchChatPlanRequest} body
19390
+ * @param {*} [options] Override http request option.
19391
+ * @throws {RequiredError}
19392
+ */
19393
+ patchChatPlan: async (id, body, options = {}) => {
19394
+ // verify required parameter 'id' is not null or undefined
19395
+ if (id === null || id === undefined) {
19396
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling patchChatPlan.');
19397
+ }
19398
+ // verify required parameter 'body' is not null or undefined
19399
+ if (body === null || body === undefined) {
19400
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling patchChatPlan.');
19401
+ }
19402
+ const localVarPath = `/routing/outbound/chat/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
19403
+ const localVarUrlObj = parse(localVarPath, true);
19404
+ let baseOptions;
19405
+ if (configuration) {
19406
+ baseOptions = configuration.baseOptions;
19407
+ }
19408
+ const localVarRequestOptions = {
19409
+ method: 'PATCH',
19410
+ ...baseOptions,
19411
+ ...options,
19412
+ };
19413
+ const localVarHeaderParameter = {};
19414
+ const localVarQueryParameter = {};
19415
+ // authentication AccessToken required
19416
+ if (configuration && configuration.apiKey) {
19417
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
19418
+ ? await configuration.apiKey('X-Webitel-Access')
19419
+ : await configuration.apiKey;
19420
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
19421
+ }
19422
+ localVarHeaderParameter['Content-Type'] = 'application/json';
19423
+ localVarUrlObj.query = {
19424
+ ...localVarUrlObj.query,
19425
+ ...localVarQueryParameter,
19426
+ ...options.query,
19427
+ };
19428
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
19429
+ delete localVarUrlObj.search;
19430
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
19431
+ localVarRequestOptions.headers = {
19432
+ ...localVarHeaderParameter,
19433
+ ...headersFromBaseOptions,
19434
+ ...options.headers,
19435
+ };
19436
+ const needsSerialization = typeof body !== 'string' ||
19437
+ localVarRequestOptions.headers['Content-Type'] === 'application/json';
19438
+ localVarRequestOptions.data = needsSerialization
19439
+ ? JSON.stringify(body !== undefined ? body : {})
19440
+ : body || '';
19441
+ return {
19442
+ url: format(localVarUrlObj),
19443
+ options: localVarRequestOptions,
19444
+ };
19445
+ },
19446
+ /**
19447
+ *
19448
+ * @param {number} id
19449
+ * @param {*} [options] Override http request option.
19450
+ * @throws {RequiredError}
19451
+ */
19452
+ readChatPlan: async (id, options = {}) => {
19453
+ // verify required parameter 'id' is not null or undefined
19454
+ if (id === null || id === undefined) {
19455
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling readChatPlan.');
19456
+ }
19457
+ const localVarPath = `/routing/outbound/chat/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
19458
+ const localVarUrlObj = parse(localVarPath, true);
19459
+ let baseOptions;
19460
+ if (configuration) {
19461
+ baseOptions = configuration.baseOptions;
19462
+ }
19463
+ const localVarRequestOptions = {
19464
+ method: 'GET',
19465
+ ...baseOptions,
19466
+ ...options,
19467
+ };
19468
+ const localVarHeaderParameter = {};
19469
+ const localVarQueryParameter = {};
19470
+ // authentication AccessToken required
19471
+ if (configuration && configuration.apiKey) {
19472
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
19473
+ ? await configuration.apiKey('X-Webitel-Access')
19474
+ : await configuration.apiKey;
19475
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
19476
+ }
19477
+ localVarUrlObj.query = {
19478
+ ...localVarUrlObj.query,
19479
+ ...localVarQueryParameter,
19480
+ ...options.query,
19481
+ };
19482
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
19483
+ delete localVarUrlObj.search;
19484
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
19485
+ localVarRequestOptions.headers = {
19486
+ ...localVarHeaderParameter,
19487
+ ...headersFromBaseOptions,
19488
+ ...options.headers,
19489
+ };
19490
+ return {
19491
+ url: format(localVarUrlObj),
19492
+ options: localVarRequestOptions,
19493
+ };
19494
+ },
19495
+ /**
19496
+ *
19497
+ * @param {number} [page]
19498
+ * @param {number} [size]
19499
+ * @param {string} [q]
19500
+ * @param {string} [sort]
19501
+ * @param {Array<string>} [fields]
19502
+ * @param {Array<number>} [id]
19503
+ * @param {string} [name]
19504
+ * @param {boolean} [enabled]
19505
+ * @param {*} [options] Override http request option.
19506
+ * @throws {RequiredError}
19507
+ */
19508
+ searchChatPlan: async (page, size, q, sort, fields, id, name, enabled, options = {}) => {
19509
+ const localVarPath = `/routing/outbound/chat`;
19510
+ const localVarUrlObj = parse(localVarPath, true);
19511
+ let baseOptions;
19512
+ if (configuration) {
19513
+ baseOptions = configuration.baseOptions;
19514
+ }
19515
+ const localVarRequestOptions = {
19516
+ method: 'GET',
19517
+ ...baseOptions,
19518
+ ...options,
19519
+ };
19520
+ const localVarHeaderParameter = {};
19521
+ const localVarQueryParameter = {};
19522
+ // authentication AccessToken required
19523
+ if (configuration && configuration.apiKey) {
19524
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
19525
+ ? await configuration.apiKey('X-Webitel-Access')
19526
+ : await configuration.apiKey;
19527
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
19528
+ }
19529
+ if (page !== undefined) {
19530
+ localVarQueryParameter['page'] = page;
19531
+ }
19532
+ if (size !== undefined) {
19533
+ localVarQueryParameter['size'] = size;
19534
+ }
19535
+ if (q !== undefined) {
19536
+ localVarQueryParameter['q'] = q;
19537
+ }
19538
+ if (sort !== undefined) {
19539
+ localVarQueryParameter['sort'] = sort;
19540
+ }
19541
+ if (fields) {
19542
+ localVarQueryParameter['fields'] = fields;
19543
+ }
19544
+ if (id) {
19545
+ localVarQueryParameter['id'] = id;
19546
+ }
19547
+ if (name !== undefined) {
19548
+ localVarQueryParameter['name'] = name;
19549
+ }
19550
+ if (enabled !== undefined) {
19551
+ localVarQueryParameter['enabled'] = enabled;
19552
+ }
19553
+ localVarUrlObj.query = {
19554
+ ...localVarUrlObj.query,
19555
+ ...localVarQueryParameter,
19556
+ ...options.query,
19557
+ };
19558
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
19559
+ delete localVarUrlObj.search;
19560
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
19561
+ localVarRequestOptions.headers = {
19562
+ ...localVarHeaderParameter,
19563
+ ...headersFromBaseOptions,
19564
+ ...options.headers,
19565
+ };
19566
+ return {
19567
+ url: format(localVarUrlObj),
19568
+ options: localVarRequestOptions,
19569
+ };
19570
+ },
19571
+ /**
19572
+ *
19573
+ * @param {number} id
19574
+ * @param {EngineUpdateChatPlanRequest} body
19575
+ * @param {*} [options] Override http request option.
19576
+ * @throws {RequiredError}
19577
+ */
19578
+ updateChatPlan: async (id, body, options = {}) => {
19579
+ // verify required parameter 'id' is not null or undefined
19580
+ if (id === null || id === undefined) {
19581
+ throw new RequiredError('id', 'Required parameter id was null or undefined when calling updateChatPlan.');
19582
+ }
19583
+ // verify required parameter 'body' is not null or undefined
19584
+ if (body === null || body === undefined) {
19585
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling updateChatPlan.');
19586
+ }
19587
+ const localVarPath = `/routing/outbound/chat/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
19588
+ const localVarUrlObj = parse(localVarPath, true);
19589
+ let baseOptions;
19590
+ if (configuration) {
19591
+ baseOptions = configuration.baseOptions;
19592
+ }
19593
+ const localVarRequestOptions = {
19594
+ method: 'PUT',
19595
+ ...baseOptions,
19596
+ ...options,
19597
+ };
19598
+ const localVarHeaderParameter = {};
19599
+ const localVarQueryParameter = {};
19600
+ // authentication AccessToken required
19601
+ if (configuration && configuration.apiKey) {
19602
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
19603
+ ? await configuration.apiKey('X-Webitel-Access')
19604
+ : await configuration.apiKey;
19605
+ localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
19606
+ }
19607
+ localVarHeaderParameter['Content-Type'] = 'application/json';
19608
+ localVarUrlObj.query = {
19609
+ ...localVarUrlObj.query,
19610
+ ...localVarQueryParameter,
19611
+ ...options.query,
19612
+ };
19613
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
19614
+ delete localVarUrlObj.search;
19615
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
19616
+ localVarRequestOptions.headers = {
19617
+ ...localVarHeaderParameter,
19618
+ ...headersFromBaseOptions,
19619
+ ...options.headers,
19620
+ };
19621
+ const needsSerialization = typeof body !== 'string' ||
19622
+ localVarRequestOptions.headers['Content-Type'] === 'application/json';
19623
+ localVarRequestOptions.data = needsSerialization
19624
+ ? JSON.stringify(body !== undefined ? body : {})
19625
+ : body || '';
19626
+ return {
19627
+ url: format(localVarUrlObj),
19628
+ options: localVarRequestOptions,
19629
+ };
19630
+ },
19631
+ };
19632
+ };
19633
+ /**
19634
+ * RoutingChatPlanServiceApi - functional programming interface
19635
+ * @export
19636
+ */
19637
+ const RoutingChatPlanServiceApiFp = function (configuration) {
19638
+ return {
19639
+ /**
19640
+ *
19641
+ * @param {EngineCreateChatPlanRequest} body
19642
+ * @param {*} [options] Override http request option.
19643
+ * @throws {RequiredError}
19644
+ */
19645
+ async createChatPlan(body, options) {
19646
+ const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).createChatPlan(body, options);
19647
+ return (axios = globalAxios, basePath = BASE_PATH) => {
19648
+ const axiosRequestArgs = {
19649
+ ...localVarAxiosArgs.options,
19650
+ url: basePath + localVarAxiosArgs.url,
19651
+ };
19652
+ return axios.request(axiosRequestArgs);
19653
+ };
19654
+ },
19655
+ /**
19656
+ *
19657
+ * @param {number} id
19658
+ * @param {EnginePatchChatPlanRequest} body
19659
+ * @param {*} [options] Override http request option.
19660
+ * @throws {RequiredError}
19661
+ */
19662
+ async patchChatPlan(id, body, options) {
19663
+ const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).patchChatPlan(id, body, options);
19664
+ return (axios = globalAxios, basePath = BASE_PATH) => {
19665
+ const axiosRequestArgs = {
19666
+ ...localVarAxiosArgs.options,
19667
+ url: basePath + localVarAxiosArgs.url,
19668
+ };
19669
+ return axios.request(axiosRequestArgs);
19670
+ };
19671
+ },
19672
+ /**
19673
+ *
19674
+ * @param {number} id
19675
+ * @param {*} [options] Override http request option.
19676
+ * @throws {RequiredError}
19677
+ */
19678
+ async readChatPlan(id, options) {
19679
+ const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).readChatPlan(id, options);
19680
+ return (axios = globalAxios, basePath = BASE_PATH) => {
19681
+ const axiosRequestArgs = {
19682
+ ...localVarAxiosArgs.options,
19683
+ url: basePath + localVarAxiosArgs.url,
19684
+ };
19685
+ return axios.request(axiosRequestArgs);
19686
+ };
19687
+ },
19688
+ /**
19689
+ *
19690
+ * @param {number} [page]
19691
+ * @param {number} [size]
19692
+ * @param {string} [q]
19693
+ * @param {string} [sort]
19694
+ * @param {Array<string>} [fields]
19695
+ * @param {Array<number>} [id]
19696
+ * @param {string} [name]
19697
+ * @param {boolean} [enabled]
19698
+ * @param {*} [options] Override http request option.
19699
+ * @throws {RequiredError}
19700
+ */
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);
19703
+ return (axios = globalAxios, basePath = BASE_PATH) => {
19704
+ const axiosRequestArgs = {
19705
+ ...localVarAxiosArgs.options,
19706
+ url: basePath + localVarAxiosArgs.url,
19707
+ };
19708
+ return axios.request(axiosRequestArgs);
19709
+ };
19710
+ },
19711
+ /**
19712
+ *
19713
+ * @param {number} id
19714
+ * @param {EngineUpdateChatPlanRequest} body
19715
+ * @param {*} [options] Override http request option.
19716
+ * @throws {RequiredError}
19717
+ */
19718
+ async updateChatPlan(id, body, options) {
19719
+ const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).updateChatPlan(id, body, options);
19720
+ return (axios = globalAxios, basePath = BASE_PATH) => {
19721
+ const axiosRequestArgs = {
19722
+ ...localVarAxiosArgs.options,
19723
+ url: basePath + localVarAxiosArgs.url,
19724
+ };
19725
+ return axios.request(axiosRequestArgs);
19726
+ };
19727
+ },
19728
+ };
19729
+ };
19730
+ /**
19731
+ * RoutingChatPlanServiceApi - factory interface
19732
+ * @export
19733
+ */
19734
+ const RoutingChatPlanServiceApiFactory = function (configuration, basePath, axios) {
19735
+ return {
19736
+ /**
19737
+ *
19738
+ * @param {EngineCreateChatPlanRequest} body
19739
+ * @param {*} [options] Override http request option.
19740
+ * @throws {RequiredError}
19741
+ */
19742
+ createChatPlan(body, options) {
19743
+ return RoutingChatPlanServiceApiFp(configuration)
19744
+ .createChatPlan(body, options)
19745
+ .then((request) => request(axios, basePath));
19746
+ },
19747
+ /**
19748
+ *
19749
+ * @param {number} id
19750
+ * @param {EnginePatchChatPlanRequest} body
19751
+ * @param {*} [options] Override http request option.
19752
+ * @throws {RequiredError}
19753
+ */
19754
+ patchChatPlan(id, body, options) {
19755
+ return RoutingChatPlanServiceApiFp(configuration)
19756
+ .patchChatPlan(id, body, options)
19757
+ .then((request) => request(axios, basePath));
19758
+ },
19759
+ /**
19760
+ *
19761
+ * @param {number} id
19762
+ * @param {*} [options] Override http request option.
19763
+ * @throws {RequiredError}
19764
+ */
19765
+ readChatPlan(id, options) {
19766
+ return RoutingChatPlanServiceApiFp(configuration)
19767
+ .readChatPlan(id, options)
19768
+ .then((request) => request(axios, basePath));
19769
+ },
19770
+ /**
19771
+ *
19772
+ * @param {number} [page]
19773
+ * @param {number} [size]
19774
+ * @param {string} [q]
19775
+ * @param {string} [sort]
19776
+ * @param {Array<string>} [fields]
19777
+ * @param {Array<number>} [id]
19778
+ * @param {string} [name]
19779
+ * @param {boolean} [enabled]
19780
+ * @param {*} [options] Override http request option.
19781
+ * @throws {RequiredError}
19782
+ */
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)
19786
+ .then((request) => request(axios, basePath));
19787
+ },
19788
+ /**
19789
+ *
19790
+ * @param {number} id
19791
+ * @param {EngineUpdateChatPlanRequest} body
19792
+ * @param {*} [options] Override http request option.
19793
+ * @throws {RequiredError}
19794
+ */
19795
+ updateChatPlan(id, body, options) {
19796
+ return RoutingChatPlanServiceApiFp(configuration)
19797
+ .updateChatPlan(id, body, options)
19798
+ .then((request) => request(axios, basePath));
19799
+ },
19800
+ };
19801
+ };
19802
+ /**
19803
+ * RoutingChatPlanServiceApi - object-oriented interface
19804
+ * @export
19805
+ * @class RoutingChatPlanServiceApi
19806
+ * @extends {BaseAPI}
19807
+ */
19808
+ class RoutingChatPlanServiceApi extends BaseAPI {
19809
+ /**
19810
+ *
19811
+ * @param {EngineCreateChatPlanRequest} body
19812
+ * @param {*} [options] Override http request option.
19813
+ * @throws {RequiredError}
19814
+ * @memberof RoutingChatPlanServiceApi
19815
+ */
19816
+ createChatPlan(body, options) {
19817
+ return RoutingChatPlanServiceApiFp(this.configuration)
19818
+ .createChatPlan(body, options)
19819
+ .then((request) => request(this.axios, this.basePath));
19820
+ }
19821
+ /**
19822
+ *
19823
+ * @param {number} id
19824
+ * @param {EnginePatchChatPlanRequest} body
19825
+ * @param {*} [options] Override http request option.
19826
+ * @throws {RequiredError}
19827
+ * @memberof RoutingChatPlanServiceApi
19828
+ */
19829
+ patchChatPlan(id, body, options) {
19830
+ return RoutingChatPlanServiceApiFp(this.configuration)
19831
+ .patchChatPlan(id, body, options)
19832
+ .then((request) => request(this.axios, this.basePath));
19833
+ }
19834
+ /**
19835
+ *
19836
+ * @param {number} id
19837
+ * @param {*} [options] Override http request option.
19838
+ * @throws {RequiredError}
19839
+ * @memberof RoutingChatPlanServiceApi
19840
+ */
19841
+ readChatPlan(id, options) {
19842
+ return RoutingChatPlanServiceApiFp(this.configuration)
19843
+ .readChatPlan(id, options)
19844
+ .then((request) => request(this.axios, this.basePath));
19845
+ }
19846
+ /**
19847
+ *
19848
+ * @param {number} [page]
19849
+ * @param {number} [size]
19850
+ * @param {string} [q]
19851
+ * @param {string} [sort]
19852
+ * @param {Array<string>} [fields]
19853
+ * @param {Array<number>} [id]
19854
+ * @param {string} [name]
19855
+ * @param {boolean} [enabled]
19856
+ * @param {*} [options] Override http request option.
19857
+ * @throws {RequiredError}
19858
+ * @memberof RoutingChatPlanServiceApi
19859
+ */
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)
19863
+ .then((request) => request(this.axios, this.basePath));
19864
+ }
19865
+ /**
19866
+ *
19867
+ * @param {number} id
19868
+ * @param {EngineUpdateChatPlanRequest} body
19869
+ * @param {*} [options] Override http request option.
19870
+ * @throws {RequiredError}
19871
+ * @memberof RoutingChatPlanServiceApi
19872
+ */
19873
+ updateChatPlan(id, body, options) {
19874
+ return RoutingChatPlanServiceApiFp(this.configuration)
19875
+ .updateChatPlan(id, body, options)
19876
+ .then((request) => request(this.axios, this.basePath));
19877
+ }
19878
+ }
19879
+
19324
19880
  // tslint:disable
19325
19881
  /**
19326
19882
  * RoutingOutboundCallServiceApi - axios parameter creator
@@ -22485,11 +23041,12 @@ class Task {
22485
23041
  this.lastStatusChange = Date.now();
22486
23042
  }
22487
23043
  setProcessing(p) {
23044
+ this.state = 'processing'; // todo
22488
23045
  if (!this.startProcessingAt) {
22489
23046
  this.startProcessingAt = Date.now();
22490
23047
  }
22491
23048
  if (p.sec) {
22492
- p.timeout = this.startProcessingAt + p.sec * 1000; // bug
23049
+ p.timeout = Date.now() + p.sec * 1000; // bug
22493
23050
  }
22494
23051
  this._processing = p;
22495
23052
  }
@@ -23250,7 +23807,13 @@ class Conversation {
23250
23807
  this.members = (members || []).map((i) => wrapChannelMember(i));
23251
23808
  this._messages = messages || [];
23252
23809
  this.state = ConversationState.Invite;
23253
- 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
+ }
23254
23817
  if (variables &&
23255
23818
  variables.hasOwnProperty('cc_attempt_id') &&
23256
23819
  this.client.agent) {
@@ -23273,7 +23836,7 @@ class Conversation {
23273
23836
  this.closedAt = timestamp;
23274
23837
  }
23275
23838
  get id() {
23276
- return this.conversationId;
23839
+ return this.channelId || this.inviteId || this.conversationId;
23277
23840
  }
23278
23841
  get messages() {
23279
23842
  return this.getMessages();
@@ -23287,6 +23850,7 @@ class Conversation {
23287
23850
  channelId: i.channel_id,
23288
23851
  createdAt: i.created_at,
23289
23852
  updatedAt: i.updated_at,
23853
+ contact: null,
23290
23854
  };
23291
23855
  if (i.hasOwnProperty('file')) {
23292
23856
  i.file.url = this.client.fileUrlDownload(i.file.id);
@@ -23295,6 +23859,9 @@ class Conversation {
23295
23859
  if (i.hasOwnProperty('text')) {
23296
23860
  msg.text = i.text;
23297
23861
  }
23862
+ if (i.hasOwnProperty('contact')) {
23863
+ msg.contact = i.contact;
23864
+ }
23298
23865
  return msg;
23299
23866
  });
23300
23867
  }
@@ -23320,7 +23887,14 @@ class Conversation {
23320
23887
  return this.answeredAt > 0 && this.hasReporting;
23321
23888
  }
23322
23889
  get hasReporting() {
23323
- 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;
23324
23898
  }
23325
23899
  /*
23326
23900
  Actions
@@ -23344,7 +23918,7 @@ class Conversation {
23344
23918
  throw new Error('This conversation not active');
23345
23919
  return this.client.request(`close_chat`, {
23346
23920
  channel_id: this.channelId,
23347
- conversation_id: this.id,
23921
+ conversation_id: this.conversationId,
23348
23922
  cause,
23349
23923
  });
23350
23924
  }
@@ -23353,7 +23927,7 @@ class Conversation {
23353
23927
  throw new Error('This conversation not active');
23354
23928
  return this.client.request(`leave_chat`, {
23355
23929
  channel_id: this.channelId,
23356
- conversation_id: this.id,
23930
+ conversation_id: this.conversationId,
23357
23931
  cause,
23358
23932
  });
23359
23933
  }
@@ -23373,12 +23947,12 @@ class Conversation {
23373
23947
  }
23374
23948
  }
23375
23949
  async sendFile(file, cb) {
23376
- const storedFiles = await this.client.storeFile(this.id, [file], cb);
23950
+ const storedFiles = await this.client.storeFile(this.conversationId, [file], cb);
23377
23951
  const f = storedFiles[0];
23378
23952
  // todo bug if chat response error
23379
23953
  return this.client.request(`send_file_chat`, {
23380
23954
  channel_id: this.channelId,
23381
- conversation_id: this.id,
23955
+ conversation_id: this.conversationId,
23382
23956
  id: f.id,
23383
23957
  name: file.name,
23384
23958
  mime: f.mime,
@@ -23400,7 +23974,7 @@ class Conversation {
23400
23974
  async addToChat(userId, title) {
23401
23975
  return this.client.request(`add_to_chat`, {
23402
23976
  channel_id: this.channelId,
23403
- conversation_id: this.id,
23977
+ conversation_id: this.conversationId,
23404
23978
  user_id: userId,
23405
23979
  title,
23406
23980
  });
@@ -23427,10 +24001,24 @@ class Conversation {
23427
24001
  }
23428
24002
  return this.task.renew(sec);
23429
24003
  }
24004
+ async transferToPlan(planId) {
24005
+ return this.client.request(`blind_transfer_chat`, {
24006
+ conversation_id: this.conversationId,
24007
+ channel_id: this.channelId,
24008
+ plan_id: planId,
24009
+ });
24010
+ }
24011
+ async transferToUser(userId) {
24012
+ return this.client.request(`transfer_user_chat`, {
24013
+ conversation_id: this.conversationId,
24014
+ channel_id: this.channelId,
24015
+ user_id: userId,
24016
+ });
24017
+ }
23430
24018
  sendMessageTextChunk(text) {
23431
24019
  return this.client.request(`send_text_chat`, {
23432
24020
  channel_id: this.channelId,
23433
- conversation_id: this.id,
24021
+ conversation_id: this.conversationId,
23434
24022
  text,
23435
24023
  });
23436
24024
  }
@@ -24119,7 +24707,7 @@ class Client extends EventEmitter {
24119
24707
  break;
24120
24708
  case ChatActions.Joined:
24121
24709
  const joined = event.data;
24122
- conversation = this.conversationById(joined.conversation_id);
24710
+ conversation = this.conversationById(joined.member.id);
24123
24711
  if (conversation) {
24124
24712
  conversation.setAnswered(joined.member.id, timestamp, joined.member);
24125
24713
  }
@@ -24127,17 +24715,38 @@ class Client extends EventEmitter {
24127
24715
  case ChatActions.Message:
24128
24716
  const message = event.data;
24129
24717
  message.timestamp = timestamp;
24130
- conversation = this.conversationById(message.conversation_id);
24718
+ // fixme
24719
+ for (const v of this.allConversations()) {
24720
+ if (!v.closedAt && v.membersId.indexOf(message.channel_id) > -1) {
24721
+ conversation = v;
24722
+ }
24723
+ }
24131
24724
  if (conversation) {
24132
24725
  conversation.newMessage(message);
24133
24726
  }
24134
24727
  break;
24135
24728
  case ChatActions.Close:
24729
+ const c = event.data;
24730
+ // fixme
24731
+ for (const v of this.allConversations()) {
24732
+ if (!v.closedAt && v.membersId.indexOf(c.from_channel_id) > -1) {
24733
+ conversation = v;
24734
+ }
24735
+ }
24736
+ if (conversation) {
24737
+ conversation.setClosed(timestamp);
24738
+ }
24739
+ break;
24136
24740
  case ChatActions.Leave:
24741
+ const l = event.data;
24742
+ conversation = this.conversationById(l.leaved_channel_id);
24743
+ if (conversation) {
24744
+ conversation.setClosed(timestamp);
24745
+ }
24746
+ break;
24137
24747
  case ChatActions.Decline:
24138
- // TODO leave & CLOSE:
24139
24748
  const e = event.data;
24140
- conversation = this.conversationById(e.conversation_id);
24749
+ conversation = this.conversationById(e.invite_id);
24141
24750
  if (conversation) {
24142
24751
  conversation.setClosed(timestamp);
24143
24752
  }
@@ -24560,5 +25169,5 @@ class ExternalClient extends ee_3 {
24560
25169
 
24561
25170
  // tslint:disable
24562
25171
 
24563
- 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 };
25172
+ 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 };
24564
25173
  //# sourceMappingURL=index.esm.js.map