webitel-sdk 0.1.91 → 0.1.96

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 (80) hide show
  1. package/bundles/index.esm.js +642 -16
  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 +730 -16
  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 +54 -5
  25. package/esm2015/socket/client.js.map +1 -1
  26. package/esm2015/socket/conversation.js +26 -9
  27. package/esm2015/socket/conversation.js.map +1 -1
  28. package/esm2015/socket/task.js +5 -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 +58 -6
  46. package/esm5/socket/client.js.map +1 -1
  47. package/esm5/socket/conversation.js +31 -9
  48. package/esm5/socket/conversation.js.map +1 -1
  49. package/esm5/socket/task.js +10 -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/call.d.ts +2 -2
  75. package/types/socket/call.d.ts.map +1 -1
  76. package/types/socket/client.d.ts.map +1 -1
  77. package/types/socket/conversation.d.ts +15 -5
  78. package/types/socket/conversation.d.ts.map +1 -1
  79. package/types/socket/task.d.ts +3 -0
  80. 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
@@ -22430,6 +22986,7 @@ class Task {
22430
22986
  this.offeringAt = 0;
22431
22987
  this.answeredAt = 0;
22432
22988
  this.bridgedAt = 0;
22989
+ this.reportedAt = 0;
22433
22990
  this.startProcessingAt = 0;
22434
22991
  this.stopAt = 0;
22435
22992
  this.closedAt = 0;
@@ -22484,6 +23041,7 @@ class Task {
22484
23041
  this.lastStatusChange = Date.now();
22485
23042
  }
22486
23043
  setProcessing(p) {
23044
+ this.state = 'processing'; // todo
22487
23045
  if (!this.startProcessingAt) {
22488
23046
  this.startProcessingAt = Date.now();
22489
23047
  }
@@ -22540,10 +23098,12 @@ class Task {
22540
23098
  });
22541
23099
  }
22542
23100
  async reporting(reporting) {
22543
- return this.client.request('cc_reporting', {
23101
+ const res = await this.client.request('cc_reporting', {
22544
23102
  attempt_id: this.id,
22545
23103
  ...reporting,
22546
23104
  });
23105
+ this.reportedAt = Date.now();
23106
+ return res;
22547
23107
  }
22548
23108
  async renew(sec) {
22549
23109
  return this.client.request('cc_renewal', {
@@ -23247,7 +23807,13 @@ class Conversation {
23247
23807
  this.members = (members || []).map((i) => wrapChannelMember(i));
23248
23808
  this._messages = messages || [];
23249
23809
  this.state = ConversationState.Invite;
23250
- 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
+ }
23251
23817
  if (variables &&
23252
23818
  variables.hasOwnProperty('cc_attempt_id') &&
23253
23819
  this.client.agent) {
@@ -23270,7 +23836,7 @@ class Conversation {
23270
23836
  this.closedAt = timestamp;
23271
23837
  }
23272
23838
  get id() {
23273
- return this.conversationId;
23839
+ return this.channelId || this.inviteId || this.conversationId;
23274
23840
  }
23275
23841
  get messages() {
23276
23842
  return this.getMessages();
@@ -23284,6 +23850,7 @@ class Conversation {
23284
23850
  channelId: i.channel_id,
23285
23851
  createdAt: i.created_at,
23286
23852
  updatedAt: i.updated_at,
23853
+ contact: null,
23287
23854
  };
23288
23855
  if (i.hasOwnProperty('file')) {
23289
23856
  i.file.url = this.client.fileUrlDownload(i.file.id);
@@ -23292,6 +23859,9 @@ class Conversation {
23292
23859
  if (i.hasOwnProperty('text')) {
23293
23860
  msg.text = i.text;
23294
23861
  }
23862
+ if (i.hasOwnProperty('contact')) {
23863
+ msg.contact = i.contact;
23864
+ }
23295
23865
  return msg;
23296
23866
  });
23297
23867
  }
@@ -23317,7 +23887,14 @@ class Conversation {
23317
23887
  return this.answeredAt > 0 && this.hasReporting;
23318
23888
  }
23319
23889
  get hasReporting() {
23320
- 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;
23321
23898
  }
23322
23899
  /*
23323
23900
  Actions
@@ -23341,7 +23918,7 @@ class Conversation {
23341
23918
  throw new Error('This conversation not active');
23342
23919
  return this.client.request(`close_chat`, {
23343
23920
  channel_id: this.channelId,
23344
- conversation_id: this.id,
23921
+ conversation_id: this.conversationId,
23345
23922
  cause,
23346
23923
  });
23347
23924
  }
@@ -23350,7 +23927,7 @@ class Conversation {
23350
23927
  throw new Error('This conversation not active');
23351
23928
  return this.client.request(`leave_chat`, {
23352
23929
  channel_id: this.channelId,
23353
- conversation_id: this.id,
23930
+ conversation_id: this.conversationId,
23354
23931
  cause,
23355
23932
  });
23356
23933
  }
@@ -23370,12 +23947,12 @@ class Conversation {
23370
23947
  }
23371
23948
  }
23372
23949
  async sendFile(file, cb) {
23373
- const storedFiles = await this.client.storeFile(this.id, [file], cb);
23950
+ const storedFiles = await this.client.storeFile(this.conversationId, [file], cb);
23374
23951
  const f = storedFiles[0];
23375
23952
  // todo bug if chat response error
23376
23953
  return this.client.request(`send_file_chat`, {
23377
23954
  channel_id: this.channelId,
23378
- conversation_id: this.id,
23955
+ conversation_id: this.conversationId,
23379
23956
  id: f.id,
23380
23957
  name: file.name,
23381
23958
  mime: f.mime,
@@ -23397,7 +23974,7 @@ class Conversation {
23397
23974
  async addToChat(userId, title) {
23398
23975
  return this.client.request(`add_to_chat`, {
23399
23976
  channel_id: this.channelId,
23400
- conversation_id: this.id,
23977
+ conversation_id: this.conversationId,
23401
23978
  user_id: userId,
23402
23979
  title,
23403
23980
  });
@@ -23427,7 +24004,7 @@ class Conversation {
23427
24004
  sendMessageTextChunk(text) {
23428
24005
  return this.client.request(`send_text_chat`, {
23429
24006
  channel_id: this.channelId,
23430
- conversation_id: this.id,
24007
+ conversation_id: this.conversationId,
23431
24008
  text,
23432
24009
  });
23433
24010
  }
@@ -23564,7 +24141,7 @@ class Client extends EventEmitter {
23564
24141
  call.answeredAt = c.answered_at || 0;
23565
24142
  call.bridgedAt = c.bridged_at || 0;
23566
24143
  call.hangupAt = c.hangup_at || 0;
23567
- call.reportingAt = c.reporting_at || 0;
24144
+ // call.reportingAt = c.reporting_at || 0
23568
24145
  if (c.task) {
23569
24146
  call.task = new Task(this, {
23570
24147
  attempt_id: c.task.attempt_id,
@@ -23574,6 +24151,14 @@ class Client extends EventEmitter {
23574
24151
  }, c.task // todo add app_id
23575
24152
  );
23576
24153
  call.queue.reporting = 'true';
24154
+ if (c.leaving_at && c.task.processing_sec) {
24155
+ call.task.startProcessingAt = c.leaving_at;
24156
+ call.task.setProcessing({
24157
+ sec: c.task.processing_sec || 0,
24158
+ timeout: Date.now() - c.leaving_at + (c.task.processing_sec || 0) * 1000,
24159
+ renewal_sec: c.task.processing_renewal_sec || 0,
24160
+ });
24161
+ }
23577
24162
  }
23578
24163
  this.callStore.set(call.id, call);
23579
24164
  }
@@ -23589,6 +24174,26 @@ class Client extends EventEmitter {
23589
24174
  const messages = conv.messages.reverse();
23590
24175
  const c = new Conversation(this, conv.id, conv.title, conv.members, messages, conv.variables);
23591
24176
  c.createdAt = conv.created_at;
24177
+ c.closedAt = conv.closed_at;
24178
+ if (conv.task) {
24179
+ c.task = new Task(this, {
24180
+ attempt_id: conv.task.attempt_id,
24181
+ channel: conv.task.channel,
24182
+ status: conv.task.status,
24183
+ timestamp: Date.now(),
24184
+ }, conv.task // todo add app_id
24185
+ );
24186
+ if (conv.leaving_at && conv.task.processing_sec) {
24187
+ c.task.startProcessingAt = conv.leaving_at;
24188
+ c.task.setProcessing({
24189
+ sec: conv.task.processing_sec || 0,
24190
+ timeout: Date.now() -
24191
+ conv.leaving_at +
24192
+ (conv.task.processing_sec || 0) * 1000,
24193
+ renewal_sec: conv.task.processing_renewal_sec || 0,
24194
+ });
24195
+ }
24196
+ }
23592
24197
  if (conv.invite_id) {
23593
24198
  c.setInvite(conv.invite_id, conv.created_at);
23594
24199
  }
@@ -24088,7 +24693,7 @@ class Client extends EventEmitter {
24088
24693
  break;
24089
24694
  case ChatActions.Joined:
24090
24695
  const joined = event.data;
24091
- conversation = this.conversationById(joined.conversation_id);
24696
+ conversation = this.conversationById(joined.member.id);
24092
24697
  if (conversation) {
24093
24698
  conversation.setAnswered(joined.member.id, timestamp, joined.member);
24094
24699
  }
@@ -24096,17 +24701,38 @@ class Client extends EventEmitter {
24096
24701
  case ChatActions.Message:
24097
24702
  const message = event.data;
24098
24703
  message.timestamp = timestamp;
24099
- conversation = this.conversationById(message.conversation_id);
24704
+ // fixme
24705
+ for (const v of this.allConversations()) {
24706
+ if (!v.closedAt && v.membersId.indexOf(message.channel_id) > -1) {
24707
+ conversation = v;
24708
+ }
24709
+ }
24100
24710
  if (conversation) {
24101
24711
  conversation.newMessage(message);
24102
24712
  }
24103
24713
  break;
24104
24714
  case ChatActions.Close:
24715
+ const c = event.data;
24716
+ // fixme
24717
+ for (const v of this.allConversations()) {
24718
+ if (!v.closedAt && v.membersId.indexOf(c.from_channel_id) > -1) {
24719
+ conversation = v;
24720
+ }
24721
+ }
24722
+ if (conversation) {
24723
+ conversation.setClosed(timestamp);
24724
+ }
24725
+ break;
24105
24726
  case ChatActions.Leave:
24727
+ const l = event.data;
24728
+ conversation = this.conversationById(l.leaved_channel_id);
24729
+ if (conversation) {
24730
+ conversation.setClosed(timestamp);
24731
+ }
24732
+ break;
24106
24733
  case ChatActions.Decline:
24107
- // TODO leave & CLOSE:
24108
24734
  const e = event.data;
24109
- conversation = this.conversationById(e.conversation_id);
24735
+ conversation = this.conversationById(e.invite_id);
24110
24736
  if (conversation) {
24111
24737
  conversation.setClosed(timestamp);
24112
24738
  }
@@ -24529,5 +25155,5 @@ class ExternalClient extends ee_3 {
24529
25155
 
24530
25156
  // tslint:disable
24531
25157
 
24532
- export { AgentPauseCauseServiceApiAxiosParamCreator, AgentPauseCauseServiceApiFp, AgentPauseCauseServiceApiFactory, AgentPauseCauseServiceApi, AgentServiceApiAxiosParamCreator, AgentServiceApiFp, AgentServiceApiFactory, AgentServiceApi, AgentSkillServiceApiAxiosParamCreator, AgentSkillServiceApiFp, AgentSkillServiceApiFactory, AgentSkillServiceApi, AgentTeamServiceApiAxiosParamCreator, AgentTeamServiceApiFp, AgentTeamServiceApiFactory, AgentTeamServiceApi, BackendProfileServiceApiAxiosParamCreator, BackendProfileServiceApiFp, BackendProfileServiceApiFactory, BackendProfileServiceApi, BucketServiceApiAxiosParamCreator, BucketServiceApiFp, BucketServiceApiFactory, BucketServiceApi, CalendarServiceApiAxiosParamCreator, CalendarServiceApiFp, CalendarServiceApiFactory, CalendarServiceApi, CallServiceApiAxiosParamCreator, CallServiceApiFp, CallServiceApiFactory, CallServiceApi, CommunicationTypeServiceApiAxiosParamCreator, CommunicationTypeServiceApiFp, CommunicationTypeServiceApiFactory, CommunicationTypeServiceApi, EmailProfileServiceApiAxiosParamCreator, EmailProfileServiceApiFp, EmailProfileServiceApiFactory, EmailProfileServiceApi, ListServiceApiAxiosParamCreator, ListServiceApiFp, ListServiceApiFactory, ListServiceApi, MediaFileServiceApiAxiosParamCreator, MediaFileServiceApiFp, MediaFileServiceApiFactory, MediaFileServiceApi, MemberServiceApiAxiosParamCreator, MemberServiceApiFp, MemberServiceApiFactory, MemberServiceApi, OutboundResourceGroupServiceApiAxiosParamCreator, OutboundResourceGroupServiceApiFp, OutboundResourceGroupServiceApiFactory, OutboundResourceGroupServiceApi, OutboundResourceServiceApiAxiosParamCreator, OutboundResourceServiceApiFp, OutboundResourceServiceApiFactory, OutboundResourceServiceApi, QueueBucketServiceApiAxiosParamCreator, QueueBucketServiceApiFp, QueueBucketServiceApiFactory, QueueBucketServiceApi, QueueHookServiceApiAxiosParamCreator, QueueHookServiceApiFp, QueueHookServiceApiFactory, QueueHookServiceApi, QueueResourcesServiceApiAxiosParamCreator, QueueResourcesServiceApiFp, QueueResourcesServiceApiFactory, QueueResourcesServiceApi, QueueServiceApiAxiosParamCreator, QueueServiceApiFp, QueueServiceApiFactory, QueueServiceApi, QueueSkillServiceApiAxiosParamCreator, QueueSkillServiceApiFp, QueueSkillServiceApiFactory, QueueSkillServiceApi, RegionServiceApiAxiosParamCreator, RegionServiceApiFp, RegionServiceApiFactory, RegionServiceApi, RoutingOutboundCallServiceApiAxiosParamCreator, RoutingOutboundCallServiceApiFp, RoutingOutboundCallServiceApiFactory, RoutingOutboundCallServiceApi, RoutingSchemaServiceApiAxiosParamCreator, RoutingSchemaServiceApiFp, RoutingSchemaServiceApiFactory, RoutingSchemaServiceApi, RoutingVariableServiceApiAxiosParamCreator, RoutingVariableServiceApiFp, RoutingVariableServiceApiFactory, RoutingVariableServiceApi, SkillServiceApiAxiosParamCreator, SkillServiceApiFp, SkillServiceApiFactory, SkillServiceApi, UserHelperServiceApiAxiosParamCreator, UserHelperServiceApiFp, UserHelperServiceApiFactory, UserHelperServiceApi, Configuration, Response, Client, CallReportingStatus, CallActions, CallDirection, Call, AgentStatus, ChannelState, ChannelType, Agent, ChatActions, ConversationState, Conversation, SipClient, ExternalClient, SipPhone, Log };
25158
+ export { AgentPauseCauseServiceApiAxiosParamCreator, AgentPauseCauseServiceApiFp, AgentPauseCauseServiceApiFactory, AgentPauseCauseServiceApi, AgentServiceApiAxiosParamCreator, AgentServiceApiFp, AgentServiceApiFactory, AgentServiceApi, AgentSkillServiceApiAxiosParamCreator, AgentSkillServiceApiFp, AgentSkillServiceApiFactory, AgentSkillServiceApi, AgentTeamServiceApiAxiosParamCreator, AgentTeamServiceApiFp, AgentTeamServiceApiFactory, AgentTeamServiceApi, BackendProfileServiceApiAxiosParamCreator, BackendProfileServiceApiFp, BackendProfileServiceApiFactory, BackendProfileServiceApi, BucketServiceApiAxiosParamCreator, BucketServiceApiFp, BucketServiceApiFactory, BucketServiceApi, CalendarServiceApiAxiosParamCreator, CalendarServiceApiFp, CalendarServiceApiFactory, CalendarServiceApi, CallServiceApiAxiosParamCreator, CallServiceApiFp, CallServiceApiFactory, CallServiceApi, CommunicationTypeServiceApiAxiosParamCreator, CommunicationTypeServiceApiFp, CommunicationTypeServiceApiFactory, CommunicationTypeServiceApi, EmailProfileServiceApiAxiosParamCreator, EmailProfileServiceApiFp, EmailProfileServiceApiFactory, EmailProfileServiceApi, ListServiceApiAxiosParamCreator, ListServiceApiFp, ListServiceApiFactory, ListServiceApi, MediaFileServiceApiAxiosParamCreator, MediaFileServiceApiFp, MediaFileServiceApiFactory, MediaFileServiceApi, MemberServiceApiAxiosParamCreator, MemberServiceApiFp, MemberServiceApiFactory, MemberServiceApi, OutboundResourceGroupServiceApiAxiosParamCreator, OutboundResourceGroupServiceApiFp, OutboundResourceGroupServiceApiFactory, OutboundResourceGroupServiceApi, OutboundResourceServiceApiAxiosParamCreator, OutboundResourceServiceApiFp, OutboundResourceServiceApiFactory, OutboundResourceServiceApi, QueueBucketServiceApiAxiosParamCreator, QueueBucketServiceApiFp, QueueBucketServiceApiFactory, QueueBucketServiceApi, QueueHookServiceApiAxiosParamCreator, QueueHookServiceApiFp, QueueHookServiceApiFactory, QueueHookServiceApi, QueueResourcesServiceApiAxiosParamCreator, QueueResourcesServiceApiFp, QueueResourcesServiceApiFactory, QueueResourcesServiceApi, QueueServiceApiAxiosParamCreator, QueueServiceApiFp, QueueServiceApiFactory, QueueServiceApi, QueueSkillServiceApiAxiosParamCreator, QueueSkillServiceApiFp, QueueSkillServiceApiFactory, QueueSkillServiceApi, RegionServiceApiAxiosParamCreator, RegionServiceApiFp, RegionServiceApiFactory, RegionServiceApi, RoutingChatPlanServiceApiAxiosParamCreator, RoutingChatPlanServiceApiFp, RoutingChatPlanServiceApiFactory, RoutingChatPlanServiceApi, RoutingOutboundCallServiceApiAxiosParamCreator, RoutingOutboundCallServiceApiFp, RoutingOutboundCallServiceApiFactory, RoutingOutboundCallServiceApi, RoutingSchemaServiceApiAxiosParamCreator, RoutingSchemaServiceApiFp, RoutingSchemaServiceApiFactory, RoutingSchemaServiceApi, RoutingVariableServiceApiAxiosParamCreator, RoutingVariableServiceApiFp, RoutingVariableServiceApiFactory, RoutingVariableServiceApi, SkillServiceApiAxiosParamCreator, SkillServiceApiFp, SkillServiceApiFactory, SkillServiceApi, UserHelperServiceApiAxiosParamCreator, UserHelperServiceApiFp, UserHelperServiceApiFactory, UserHelperServiceApi, Configuration, Response, Client, CallReportingStatus, CallActions, CallDirection, Call, AgentStatus, ChannelState, ChannelType, Agent, ChatActions, ConversationState, Conversation, SipClient, ExternalClient, SipPhone, Log };
24533
25159
  //# sourceMappingURL=index.esm.js.map