purecloud-platform-client-v2 137.0.1 → 138.0.1

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 (74) hide show
  1. package/README.md +9 -12
  2. package/dist/node/purecloud-platform-client-v2.js +289 -262
  3. package/dist/web-amd/purecloud-platform-client-v2.js +289 -262
  4. package/dist/web-amd/purecloud-platform-client-v2.min.js +1 -1
  5. package/dist/web-cjs/bundle.js +289 -262
  6. package/dist/web-cjs/purecloud-platform-client-v2.js +2080 -4490
  7. package/dist/web-cjs/purecloud-platform-client-v2.min.js +1 -1
  8. package/index.d.ts +419 -394
  9. package/package.json +2 -2
  10. package/src/purecloud-platform-client-v2/ApiClient.js +198 -176
  11. package/src/purecloud-platform-client-v2/api/AlertingApi.js +1 -1
  12. package/src/purecloud-platform-client-v2/api/AnalyticsApi.js +1 -1
  13. package/src/purecloud-platform-client-v2/api/ArchitectApi.js +1 -1
  14. package/src/purecloud-platform-client-v2/api/AuditApi.js +1 -1
  15. package/src/purecloud-platform-client-v2/api/AuthorizationApi.js +1 -1
  16. package/src/purecloud-platform-client-v2/api/BillingApi.js +1 -1
  17. package/src/purecloud-platform-client-v2/api/ChatApi.js +1 -1
  18. package/src/purecloud-platform-client-v2/api/CoachingApi.js +1 -1
  19. package/src/purecloud-platform-client-v2/api/ContentManagementApi.js +1 -1
  20. package/src/purecloud-platform-client-v2/api/ConversationsApi.js +1 -1
  21. package/src/purecloud-platform-client-v2/api/DataExtensionsApi.js +1 -1
  22. package/src/purecloud-platform-client-v2/api/ExternalContactsApi.js +1 -1
  23. package/src/purecloud-platform-client-v2/api/FaxApi.js +1 -1
  24. package/src/purecloud-platform-client-v2/api/FlowsApi.js +1 -1
  25. package/src/purecloud-platform-client-v2/api/GamificationApi.js +1 -1
  26. package/src/purecloud-platform-client-v2/api/GeneralDataProtectionRegulationApi.js +1 -1
  27. package/src/purecloud-platform-client-v2/api/GeolocationApi.js +1 -1
  28. package/src/purecloud-platform-client-v2/api/GreetingsApi.js +1 -1
  29. package/src/purecloud-platform-client-v2/api/GroupsApi.js +1 -1
  30. package/src/purecloud-platform-client-v2/api/IdentityProviderApi.js +1 -1
  31. package/src/purecloud-platform-client-v2/api/IntegrationsApi.js +1 -1
  32. package/src/purecloud-platform-client-v2/api/JourneyApi.js +1 -1
  33. package/src/purecloud-platform-client-v2/api/KnowledgeApi.js +1 -1
  34. package/src/purecloud-platform-client-v2/api/LanguageUnderstandingApi.js +1 -1
  35. package/src/purecloud-platform-client-v2/api/LanguagesApi.js +1 -1
  36. package/src/purecloud-platform-client-v2/api/LearningApi.js +1 -1
  37. package/src/purecloud-platform-client-v2/api/LicenseApi.js +1 -1
  38. package/src/purecloud-platform-client-v2/api/LocationsApi.js +1 -1
  39. package/src/purecloud-platform-client-v2/api/MessagingApi.js +1 -1
  40. package/src/purecloud-platform-client-v2/api/MobileDevicesApi.js +1 -1
  41. package/src/purecloud-platform-client-v2/api/NotificationsApi.js +1 -1
  42. package/src/purecloud-platform-client-v2/api/OAuthApi.js +1 -1
  43. package/src/purecloud-platform-client-v2/api/ObjectsApi.js +1 -1
  44. package/src/purecloud-platform-client-v2/api/OrganizationApi.js +1 -1
  45. package/src/purecloud-platform-client-v2/api/OrganizationAuthorizationApi.js +1 -1
  46. package/src/purecloud-platform-client-v2/api/OutboundApi.js +1 -1
  47. package/src/purecloud-platform-client-v2/api/PresenceApi.js +1 -1
  48. package/src/purecloud-platform-client-v2/api/QualityApi.js +1 -1
  49. package/src/purecloud-platform-client-v2/api/RecordingApi.js +1 -1
  50. package/src/purecloud-platform-client-v2/api/ResponseManagementApi.js +1 -1
  51. package/src/purecloud-platform-client-v2/api/RoutingApi.js +1 -1
  52. package/src/purecloud-platform-client-v2/api/SCIMApi.js +1 -1
  53. package/src/purecloud-platform-client-v2/api/ScriptsApi.js +4 -4
  54. package/src/purecloud-platform-client-v2/api/SearchApi.js +1 -1
  55. package/src/purecloud-platform-client-v2/api/SpeechTextAnalyticsApi.js +1 -1
  56. package/src/purecloud-platform-client-v2/api/StationsApi.js +1 -1
  57. package/src/purecloud-platform-client-v2/api/SuggestApi.js +1 -1
  58. package/src/purecloud-platform-client-v2/api/TelephonyApi.js +1 -1
  59. package/src/purecloud-platform-client-v2/api/TelephonyProvidersEdgeApi.js +1 -1
  60. package/src/purecloud-platform-client-v2/api/TextbotsApi.js +1 -1
  61. package/src/purecloud-platform-client-v2/api/TokensApi.js +1 -1
  62. package/src/purecloud-platform-client-v2/api/UploadsApi.js +1 -1
  63. package/src/purecloud-platform-client-v2/api/UsageApi.js +1 -1
  64. package/src/purecloud-platform-client-v2/api/UserRecordingsApi.js +1 -1
  65. package/src/purecloud-platform-client-v2/api/UsersApi.js +1 -1
  66. package/src/purecloud-platform-client-v2/api/UtilitiesApi.js +1 -1
  67. package/src/purecloud-platform-client-v2/api/VoicemailApi.js +1 -1
  68. package/src/purecloud-platform-client-v2/api/WebChatApi.js +1 -1
  69. package/src/purecloud-platform-client-v2/api/WebDeploymentsApi.js +1 -1
  70. package/src/purecloud-platform-client-v2/api/WebMessagingApi.js +1 -1
  71. package/src/purecloud-platform-client-v2/api/WidgetsApi.js +1 -1
  72. package/src/purecloud-platform-client-v2/api/WorkforceManagementApi.js +7 -7
  73. package/src/purecloud-platform-client-v2/index.js +1 -1
  74. package/src/purecloud-platform-client-v2/logger.js +17 -13
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var superagent = require('superagent');
3
+ var axios = require('axios');
4
4
 
5
5
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
6
 
7
- var superagent__default = /*#__PURE__*/_interopDefaultLegacy(superagent);
7
+ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
8
8
 
9
9
  var PureCloudRegionHosts = {
10
10
  us_east_1: 'mypurecloud.com',
@@ -2068,34 +2068,38 @@ class Logger {
2068
2068
 
2069
2069
  formatLog(level, statusCode, method, url, requestHeaders, responseHeaders, requestBody, responseBody) {
2070
2070
  var result;
2071
- if (requestHeaders) requestHeaders['Authorization'] = '[REDACTED]';
2072
- if (!this.log_request_body) requestBody = undefined;
2073
- if (!this.log_response_body) responseBody = undefined;
2071
+ var localRequestHeaders = requestHeaders ? JSON.parse(JSON.stringify(requestHeaders)) : null;
2072
+ var localResponseHeaders = responseHeaders ? JSON.parse(JSON.stringify(responseHeaders)) : null;
2073
+ var localRequestBody = requestBody ? JSON.parse(JSON.stringify(requestBody)) : null;
2074
+ var localResponseBody = responseBody ? JSON.parse(JSON.stringify(responseBody)) : null;
2075
+ if (requestHeaders) localRequestHeaders['Authorization'] = '[REDACTED]';
2076
+ if (!this.log_request_body) localRequestBody = undefined;
2077
+ if (!this.log_response_body) localResponseBody = undefined;
2074
2078
  if (this.log_format && this.log_format === logFormatEnum.formats.JSON) {
2075
2079
  result = {
2076
2080
  level: level,
2077
2081
  date: new Date().toISOString(),
2078
2082
  method: method,
2079
2083
  url: decodeURIComponent(url),
2080
- correlationId: responseHeaders ? (responseHeaders['inin-correlation-id'] ? responseHeaders['inin-correlation-id'] : '') : '',
2084
+ correlationId: localResponseHeaders ? (localResponseHeaders['inin-correlation-id'] ? localResponseHeaders['inin-correlation-id'] : '') : '',
2081
2085
  statusCode: statusCode,
2082
2086
  };
2083
- if (requestHeaders) result.requestHeaders = requestHeaders;
2084
- if (responseHeaders) result.responseHeaders = responseHeaders;
2085
- if (requestBody) result.requestBody = requestBody;
2086
- if (responseBody) result.responseBody = responseBody;
2087
+ if (localRequestHeaders) result.requestHeaders = localRequestHeaders;
2088
+ if (localResponseHeaders) result.responseHeaders = localResponseHeaders;
2089
+ if (localRequestBody) result.requestBody = localRequestBody;
2090
+ if (localResponseBody) result.responseBody = localResponseBody;
2087
2091
  } else {
2088
2092
  result = `${new Date().toISOString()}
2089
2093
  === REQUEST ===
2090
2094
  ${this.formatValue('URL', decodeURIComponent(url))}${this.formatValue('Method', method)}${this.formatValue(
2091
2095
  'Headers',
2092
- this.formatHeaderString(requestHeaders)
2093
- )}${this.formatValue('Body', requestBody ? JSON.stringify(requestBody, null, 2) : '')}
2096
+ this.formatHeaderString(localRequestHeaders)
2097
+ )}${this.formatValue('Body', localRequestBody ? JSON.stringify(localRequestBody, null, 2) : '')}
2094
2098
  === RESPONSE ===
2095
- ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.formatHeaderString(responseHeaders))}${this.formatValue(
2099
+ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.formatHeaderString(localResponseHeaders))}${this.formatValue(
2096
2100
  'CorrelationId',
2097
- responseHeaders ? (responseHeaders['inin-correlation-id'] ? responseHeaders['inin-correlation-id'] : '') : ''
2098
- )}${this.formatValue('Body', responseBody ? JSON.stringify(responseBody, null, 2) : '')}`;
2101
+ localResponseHeaders ? (localResponseHeaders['inin-correlation-id'] ? localResponseHeaders['inin-correlation-id'] : '') : ''
2102
+ )}${this.formatValue('Body', localResponseBody ? JSON.stringify(localResponseBody, null, 2) : '')}`;
2099
2103
  }
2100
2104
 
2101
2105
  return result;
@@ -2272,7 +2276,7 @@ class Configuration {
2272
2276
 
2273
2277
  /**
2274
2278
  * @module purecloud-platform-client-v2/ApiClient
2275
- * @version 137.0.1
2279
+ * @version 138.0.1
2276
2280
  */
2277
2281
  class ApiClient {
2278
2282
  /**
@@ -2374,9 +2378,6 @@ class ApiClient {
2374
2378
  this.authData = {};
2375
2379
  this.settingsPrefix = 'purecloud';
2376
2380
 
2377
- // Expose superagent module for use with superagent-proxy
2378
- this.superagent = superagent__default["default"];
2379
-
2380
2381
  // Transparently request a new access token when it expires (Code Authorization only)
2381
2382
  this.refreshInProgress = false;
2382
2383
 
@@ -2545,63 +2546,65 @@ class ApiClient {
2545
2546
  return;
2546
2547
  }
2547
2548
 
2548
- // Build token request
2549
- var request = superagent__default["default"]('POST', `https://login.${this.config.environment}/oauth/token`);
2550
- if (this.proxy && request.proxy) {
2551
- request.proxy(this.proxy);
2552
- }
2553
- request.set('Authorization', `Basic ${authHeader}`);
2554
- request.send('grant_type=client_credentials');
2555
-
2556
- // Execute request
2557
- request.end((error, response) => {
2558
- if (error) {
2559
- // Log error
2560
- this.config.logger.log(
2561
- 'error',
2562
- response.statusCode,
2563
- 'POST',
2564
- `https://login.${this.config.environment}/oauth/token`,
2565
- request.header,
2566
- response.headers,
2567
- { grant_type: 'client_credentials' },
2568
- response.body
2569
- );
2570
- reject(error);
2571
- } else {
2549
+ const headers = {
2550
+ 'Authorization': `Basic ${authHeader}`
2551
+ };
2552
+ axios__default["default"]({
2553
+ method: `POST`,
2554
+ url: `https://login.${this.config.environment}/oauth/token`,
2555
+ headers: headers,
2556
+ data: 'grant_type=client_credentials',
2557
+ proxy: this.proxy
2558
+ })
2559
+ .then((response) => {
2572
2560
  // Logging
2573
2561
  this.config.logger.log(
2574
2562
  'trace',
2575
- response.statusCode,
2563
+ response.status,
2576
2564
  'POST',
2577
2565
  `https://login.${this.config.environment}/oauth/token`,
2578
- request.header,
2566
+ headers,
2579
2567
  response.headers,
2580
2568
  { grant_type: 'client_credentials' },
2581
2569
  undefined
2582
2570
  );
2583
2571
  this.config.logger.log(
2584
2572
  'debug',
2585
- response.statusCode,
2573
+ response.status,
2586
2574
  'POST',
2587
2575
  `https://login.${this.config.environment}/oauth/token`,
2588
- request.header,
2576
+ headers,
2589
2577
  undefined,
2590
2578
  { grant_type: 'client_credentials' },
2591
2579
  undefined
2592
2580
  );
2593
2581
 
2594
2582
  // Save access token
2595
- this.setAccessToken(response.body['access_token']);
2583
+ this.setAccessToken(response.data['access_token']);
2596
2584
 
2597
2585
  // Set expiry time
2598
- this.authData.tokenExpiryTime = (new Date()).getTime() + (response.body['expires_in'] * 1000);
2586
+ this.authData.tokenExpiryTime = (new Date()).getTime() + (response.data['expires_in'] * 1000);
2599
2587
  this.authData.tokenExpiryTimeString = (new Date(this.authData.tokenExpiryTime)).toUTCString();
2600
2588
 
2601
2589
  // Return auth data
2602
2590
  resolve(this.authData);
2603
- }
2604
- });
2591
+ })
2592
+ .catch((error) => {
2593
+ // Log error
2594
+ if (error.response) {
2595
+ this.config.logger.log(
2596
+ 'error',
2597
+ error.response.status,
2598
+ 'POST',
2599
+ `https://login.${this.config.environment}/oauth/token`,
2600
+ headers,
2601
+ error.response.headers,
2602
+ { grant_type: 'client_credentials' },
2603
+ error.response.data
2604
+ );
2605
+ }
2606
+ reject(error);
2607
+ });
2605
2608
  });
2606
2609
  }
2607
2610
 
@@ -2624,9 +2627,7 @@ class ApiClient {
2624
2627
  { grant_type: 'urn:ietf:params:oauth:grant-type:saml2-bearer' },
2625
2628
  { orgName: orgName },
2626
2629
  { assertion: assertion });
2627
- if (this.proxy && request.proxy) {
2628
- request.proxy(this.proxy);
2629
- }
2630
+ request.proxy = this.proxy;
2630
2631
  var bodyParam = {
2631
2632
  grant_type: 'urn:ietf:params:oauth:grant-type:saml2-bearer',
2632
2633
  orgName: orgName,
@@ -2634,54 +2635,56 @@ class ApiClient {
2634
2635
  };
2635
2636
 
2636
2637
  // Handle response
2637
- request.end((error, response) => {
2638
- if (error) {
2639
- // Log error
2640
- this.config.logger.log(
2641
- 'error',
2642
- response.statusCode,
2643
- 'POST',
2644
- `https://login.${this.config.environment}/oauth/token`,
2645
- request.header,
2646
- response.headers,
2647
- bodyParam,
2648
- response.body
2649
- );
2650
- reject(error);
2651
- } else {
2638
+ request
2639
+ .then((response) => {
2652
2640
  // Logging
2653
2641
  this.config.logger.log(
2654
2642
  'trace',
2655
- response.statusCode,
2643
+ response.status,
2656
2644
  'POST',
2657
2645
  `https://login.${this.config.environment}/oauth/token`,
2658
- request.header,
2646
+ request.headers,
2659
2647
  response.headers,
2660
2648
  bodyParam,
2661
2649
  undefined
2662
2650
  );
2663
2651
  this.config.logger.log(
2664
2652
  'debug',
2665
- response.statusCode,
2653
+ response.status,
2666
2654
  'POST',
2667
2655
  `https://login.${this.config.environment}/oauth/token`,
2668
- request.header,
2656
+ request.headers,
2669
2657
  undefined,
2670
2658
  bodyParam,
2671
2659
  undefined
2672
2660
  );
2673
2661
 
2674
2662
  // Get access token from response
2675
- var access_token = response.body.access_token;
2663
+ var access_token = response.data.access_token;
2676
2664
 
2677
2665
  this.setAccessToken(access_token);
2678
- this.authData.tokenExpiryTime = new Date().getTime() + response.body['expires_in'] * 1000;
2666
+ this.authData.tokenExpiryTime = new Date().getTime() + response.data['expires_in'] * 1000;
2679
2667
  this.authData.tokenExpiryTimeString = new Date(this.authData.tokenExpiryTime).toUTCString();
2680
2668
 
2681
2669
  // Return auth data
2682
2670
  resolve(this.authData);
2683
- }
2684
- });
2671
+ })
2672
+ .catch((error) => {
2673
+ // Log error
2674
+ if (error.response) {
2675
+ this.config.logger.log(
2676
+ 'error',
2677
+ error.response.status,
2678
+ 'POST',
2679
+ `https://login.${this.config.environment}/oauth/token`,
2680
+ request.headers,
2681
+ error.response.headers,
2682
+ bodyParam,
2683
+ error.response.data
2684
+ );
2685
+ }
2686
+ reject(error);
2687
+ });
2685
2688
  });
2686
2689
  }
2687
2690
 
@@ -2705,9 +2708,7 @@ class ApiClient {
2705
2708
  { grant_type: 'authorization_code' },
2706
2709
  { code: authCode },
2707
2710
  { redirect_uri: redirectUri });
2708
- if (this.proxy && request.proxy) {
2709
- request.proxy(this.proxy);
2710
- }
2711
+ request.proxy = this.proxy;
2711
2712
  var bodyParam = {
2712
2713
  grant_type: 'authorization_code',
2713
2714
  code: authCode,
@@ -2733,9 +2734,7 @@ class ApiClient {
2733
2734
  }
2734
2735
  var encodedData = Buffer.from(clientId + ':' + clientSecret).toString('base64');
2735
2736
  var request = this._formAuthRequest(encodedData, { grant_type: 'refresh_token' }, { refresh_token: refreshToken });
2736
- if (this.proxy && request.proxy) {
2737
- request.proxy(this.proxy);
2738
- }
2737
+ request.proxy = this.proxy;
2739
2738
  var bodyParam = {
2740
2739
  grant_type: 'refresh_token',
2741
2740
  refresh_token: refreshToken,
@@ -2753,57 +2752,59 @@ class ApiClient {
2753
2752
  * @param {function} reject - Promise reject callback
2754
2753
  */
2755
2754
  _handleCodeAuthorizationResponse(request, bodyParam, resolve, reject) {
2756
- request.end((error, response) => {
2757
- if (error) {
2758
- // Log error
2759
- this.config.logger.log(
2760
- 'error',
2761
- response.statusCode,
2762
- 'POST',
2763
- `https://login.${this.config.environment}/oauth/token`,
2764
- request.header,
2765
- response.headers,
2766
- bodyParam,
2767
- response.body
2768
- );
2769
-
2770
- reject(error);
2771
- } else {
2755
+ request
2756
+ .then((response) => {
2772
2757
  // Logging
2773
2758
  this.config.logger.log(
2774
2759
  'trace',
2775
- response.statusCode,
2760
+ response.status,
2776
2761
  'POST',
2777
2762
  `https://login.${this.config.environment}/oauth/token`,
2778
- request.header,
2763
+ request.headers,
2779
2764
  response.headers,
2780
2765
  bodyParam,
2781
2766
  undefined
2782
2767
  );
2783
2768
  this.config.logger.log(
2784
2769
  'debug',
2785
- response.statusCode,
2770
+ response.status,
2786
2771
  'POST',
2787
2772
  `https://login.${this.config.environment}/oauth/token`,
2788
- request.header,
2773
+ request.headers,
2789
2774
  undefined,
2790
2775
  bodyParam,
2791
2776
  undefined
2792
2777
  );
2793
2778
 
2794
2779
  // Get access token from response
2795
- var access_token = response.body.access_token;
2796
- var refresh_token = response.body.refresh_token;
2780
+ var access_token = response.data.access_token;
2781
+ var refresh_token = response.data.refresh_token;
2797
2782
 
2798
2783
  this.setAccessToken(access_token);
2799
2784
  this.authData.refreshToken = refresh_token;
2800
- this.authData.tokenExpiryTime = new Date().getTime() + response.body['expires_in'] * 1000;
2785
+ this.authData.tokenExpiryTime = new Date().getTime() + response.data['expires_in'] * 1000;
2801
2786
  this.authData.tokenExpiryTimeString = new Date(this.authData.tokenExpiryTime).toUTCString();
2802
2787
 
2803
2788
  // Return auth data
2804
2789
  resolve(this.authData);
2805
- }
2806
- });
2790
+ })
2791
+ .catch((error) => {
2792
+ // Log error
2793
+ if (error.response) {
2794
+ this.config.logger.log(
2795
+ 'error',
2796
+ error.response.status,
2797
+ 'POST',
2798
+ `https://login.${this.config.environment}/oauth/token`,
2799
+ request.headers,
2800
+ error.response.headers,
2801
+ bodyParam,
2802
+ error.response.data
2803
+ );
2804
+ }
2805
+
2806
+ reject(error);
2807
+ });
2807
2808
  }
2808
2809
 
2809
2810
  /**
@@ -2811,15 +2812,15 @@ class ApiClient {
2811
2812
  * @param {string} encodedData - Base64 encoded client and clientSecret pair
2812
2813
  */
2813
2814
  _formAuthRequest(encodedData) {
2814
- var request = superagent__default["default"]('POST', `https://login.${this.config.environment}/oauth/token`);
2815
- // Set the headers
2816
- request.set('Authorization', 'Basic ' + encodedData);
2817
- request.set('Content-Type', 'application/x-www-form-urlencoded');
2818
- // Add form data
2819
- request.type('form');
2820
- for (var i = 0; i < arguments.length; i++) {
2821
- request.send(arguments[i]);
2822
- }
2815
+ var request = axios__default["default"]({
2816
+ method: `POST`,
2817
+ url: `https://login.${this.config.environment}/oauth/token`,
2818
+ headers: {
2819
+ 'Authorization': 'Basic ' + encodedData,
2820
+ 'Content-Type': 'application/x-www-form-urlencoded'
2821
+ },
2822
+ data: arguments
2823
+ });
2823
2824
 
2824
2825
  return request;
2825
2826
  }
@@ -3020,6 +3021,36 @@ class ApiClient {
3020
3021
  return param.toString();
3021
3022
  }
3022
3023
 
3024
+ /**
3025
+ * Returns query parameters serialized in the format needed for an axios request.
3026
+ * @param param The unserialized query parameters.
3027
+ * @returns {Object} The serialized representation the query parameters.
3028
+ */
3029
+ serialize(obj) {
3030
+ var result = {};
3031
+ for (var p in obj) {
3032
+ if (obj.hasOwnProperty(p) && obj[p] !== undefined) {
3033
+ result[encodeURIComponent(p)] = Array.isArray(obj[p]) ? obj[p].join(",") : this.paramToString(obj[p]);
3034
+ }
3035
+ }
3036
+ return result
3037
+ }
3038
+
3039
+ /**
3040
+ * Adds headers onto an existing header object (may be empty)
3041
+ * @param existingHeaders The existing header object.
3042
+ * @param newHeaders New headers.
3043
+ * @returns {Object} The combination of all headers.
3044
+ */
3045
+ addHeaders(existingHeaders, ...newHeaders) {
3046
+ if (existingHeaders) {
3047
+ existingHeaders = Object.assign(existingHeaders, ...newHeaders);
3048
+ } else {
3049
+ existingHeaders = Object.assign(...newHeaders);
3050
+ }
3051
+ return existingHeaders;
3052
+ }
3053
+
3023
3054
  /**
3024
3055
  * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values.
3025
3056
  * NOTE: query parameters are not handled here.
@@ -3128,6 +3159,9 @@ class ApiClient {
3128
3159
  */
3129
3160
  buildCollectionParam(param, collectionFormat) {
3130
3161
  if (!param) return;
3162
+ if (!Array.isArray(param)) {
3163
+ param = [param];
3164
+ }
3131
3165
 
3132
3166
  switch (collectionFormat) {
3133
3167
  case 'csv':
@@ -3139,7 +3173,7 @@ class ApiClient {
3139
3173
  case 'pipes':
3140
3174
  return param.map(this.paramToString).join('|');
3141
3175
  case 'multi':
3142
- // return the array directly as SuperAgent will handle it as expected
3176
+ // return the array directly as axios will handle it as expected
3143
3177
  return param.map(this.paramToString);
3144
3178
  default:
3145
3179
  throw new Error(`Unknown collection format: ${collectionFormat}`);
@@ -3148,7 +3182,7 @@ class ApiClient {
3148
3182
 
3149
3183
  /**
3150
3184
  * Applies authentication headers to the request.
3151
- * @param {Object} request The request object created by a <code>superagent()</code> call.
3185
+ * @param {Object} request The axios request config object.
3152
3186
  * @param {Array.<String>} authNames An array of authentication method names.
3153
3187
  */
3154
3188
  applyAuthToRequest(request, authNames) {
@@ -3157,7 +3191,10 @@ class ApiClient {
3157
3191
  switch (auth.type) {
3158
3192
  case 'basic':
3159
3193
  if (auth.username || auth.password) {
3160
- request.auth(auth.username || '', auth.password || '');
3194
+ request.auth = {
3195
+ username: auth.username || '',
3196
+ password: auth.password || ''
3197
+ };
3161
3198
  }
3162
3199
  break;
3163
3200
  case 'apiKey':
@@ -3169,15 +3206,15 @@ class ApiClient {
3169
3206
  data[auth.name] = auth.apiKey;
3170
3207
  }
3171
3208
  if (auth['in'] === 'header') {
3172
- request.set(data);
3209
+ request.headers = this.addHeaders(request.headers, data);
3173
3210
  } else {
3174
- request.query(data);
3211
+ request.params = this.serialize(data);
3175
3212
  }
3176
3213
  }
3177
3214
  break;
3178
3215
  case 'oauth2':
3179
3216
  if (auth.accessToken) {
3180
- request.set({'Authorization': `Bearer ${auth.accessToken}`});
3217
+ request.headers = this.addHeaders(request.headers, {'Authorization': `Bearer ${auth.accessToken}`});
3181
3218
  }
3182
3219
  break;
3183
3220
  default:
@@ -3206,86 +3243,71 @@ class ApiClient {
3206
3243
  sendRequest(this);
3207
3244
  function sendRequest(that) {
3208
3245
  var url = that.buildUrl(path, pathParams);
3209
- var request = superagent__default["default"](httpMethod, url);
3210
-
3211
- if (that.proxy && request.proxy) {
3212
- request.proxy(that.proxy);
3213
- }
3246
+ var request = {
3247
+ method: httpMethod,
3248
+ url: url,
3249
+ proxy: that.proxy,
3250
+ timeout: that.timeout,
3251
+ params: that.serialize(queryParams)
3252
+ };
3214
3253
 
3215
3254
  // apply authentications
3216
3255
  that.applyAuthToRequest(request, authNames);
3217
3256
 
3218
- // set query parameters
3219
- request.query(that.normalizeParams(queryParams));
3220
-
3221
3257
  // set header parameters
3222
- request.set(that.defaultHeaders).set(that.normalizeParams(headerParams));
3223
- //request.set({ 'purecloud-sdk': '137.0.1' });
3224
-
3225
- // set request timeout
3226
- request.timeout(that.timeout);
3258
+ const defaultHeaders = that.defaultHeaders;
3259
+ const normalizedHeaderParams = that.normalizeParams(headerParams);
3260
+ request.headers = that.addHeaders(request.headers, defaultHeaders, normalizedHeaderParams);
3227
3261
 
3228
3262
  var contentType = that.jsonPreferredMime(contentTypes);
3229
3263
  if (contentType) {
3230
- request.type(contentType);
3231
- } else if (!request.header['Content-Type']) {
3232
- request.type('application/json');
3264
+ request.headers['Content-Type'] = contentType;
3265
+ } else if (!request.headers['Content-Type']) {
3266
+ request.headers['Content-Type'] = 'application/json';
3233
3267
  }
3234
3268
 
3235
3269
  if (contentType === 'application/x-www-form-urlencoded') {
3236
- request.send(that.normalizeParams(formParams));
3270
+ request.data = that.normalizeParams(formParams);
3237
3271
  } else if (contentType == 'multipart/form-data') {
3238
3272
  var _formParams = that.normalizeParams(formParams);
3239
3273
  for (var key in _formParams) {
3240
3274
  if (_formParams.hasOwnProperty(key)) {
3241
- if (that.isFileParam(_formParams[key])) {
3242
- // file field
3243
- request.attach(key, _formParams[key]);
3244
- } else {
3245
- request.field(key, _formParams[key]);
3246
- }
3275
+ // Looks like axios handles files and forms the same way
3276
+ var formData = new FormData();
3277
+ formData.set(key, _formParams[key]);
3278
+ request.data = formData;
3247
3279
  }
3248
3280
  }
3249
3281
  } else if (bodyParam) {
3250
- request.send(bodyParam);
3282
+ request.data = bodyParam;
3251
3283
  }
3252
3284
 
3253
3285
  var accept = that.jsonPreferredMime(accepts);
3254
3286
  if (accept) {
3255
- request.accept(accept);
3287
+ request.headers['Accept'] = accept;
3256
3288
  }
3257
- request.end((error, response) => {
3258
- if (error) {
3259
- if (!response) {
3260
- reject({
3261
- status: 0,
3262
- statusText: 'error',
3263
- headers: [],
3264
- body: {},
3265
- text: 'error',
3266
- error: error
3267
- });
3268
- return;
3269
- }
3270
- }
3271
-
3272
- // Build response object
3273
- var data = (that.returnExtended === true || error) ? {
3274
- status: response.status,
3275
- statusText: response.statusText,
3276
- headers: response.headers,
3277
- body: response.body,
3278
- text: response.text,
3279
- error: error
3280
- } : response.body ? response.body : response.text;
3281
-
3282
- // Debug logging
3283
- that.config.logger.log('trace', response.statusCode, httpMethod, url, request.header, response.headers, bodyParam, undefined);
3284
- that.config.logger.log('debug', response.statusCode, httpMethod, url, request.header, undefined, bodyParam, undefined);
3285
-
3286
- // Resolve promise
3287
- if (error) {
3288
- if (data.status == 401 && that.config.refresh_access_token && that.authData.refreshToken !== "") {
3289
+ axios__default["default"].request(request)
3290
+ .then((response) => {
3291
+ // Build response object
3292
+ var data = (that.returnExtended === true) ? {
3293
+ status: response.status,
3294
+ statusText: response.statusText,
3295
+ headers: response.headers,
3296
+ body: response.data,
3297
+ text: response.text,
3298
+ error: null
3299
+ } : response.data ? response.data : response.text;
3300
+
3301
+ // Debug logging
3302
+ that.config.logger.log('trace', response.status, httpMethod, url, request.headers, response.headers, bodyParam, undefined);
3303
+ that.config.logger.log('debug', response.status, httpMethod, url, request.headers, undefined, bodyParam, undefined);
3304
+
3305
+ // Resolve promise
3306
+ resolve(data);
3307
+ })
3308
+ .catch((error) => {
3309
+ var data = error;
3310
+ if (error.response && error.response.status == 401 && that.config.refresh_access_token && that.authData.refreshToken !== "") {
3289
3311
  that._handleExpiredAccessToken()
3290
3312
  .then(() => {
3291
3313
  sendRequest(that);
@@ -3293,24 +3315,29 @@ class ApiClient {
3293
3315
  .catch((err) => {
3294
3316
  reject(err);
3295
3317
  });
3296
- } else {
3318
+ } else if (error.response) {
3297
3319
  // Log error
3298
3320
  that.config.logger.log(
3299
3321
  'error',
3300
- response.statusCode,
3322
+ error.response.status,
3301
3323
  httpMethod,
3302
3324
  url,
3303
- request.header,
3304
- response.headers,
3325
+ request.headers,
3326
+ error.response.headers,
3305
3327
  bodyParam,
3306
- response.body
3328
+ error.response.data
3307
3329
  );
3308
- reject(data);
3330
+ data = (that.returnExtended === true) ? {
3331
+ status: error.response.status,
3332
+ statusText: error.response.statusText,
3333
+ headers: error.response.headers,
3334
+ body: error.response.data,
3335
+ text: error.response.text,
3336
+ error: error
3337
+ } : error.response.data ? error.response.data : error.response.text;
3309
3338
  }
3310
- } else {
3311
- resolve(data);
3312
- }
3313
- });
3339
+ reject(data);
3340
+ });
3314
3341
  }
3315
3342
  });
3316
3343
  }
@@ -3320,7 +3347,7 @@ class AlertingApi {
3320
3347
  /**
3321
3348
  * Alerting service.
3322
3349
  * @module purecloud-platform-client-v2/api/AlertingApi
3323
- * @version 137.0.1
3350
+ * @version 138.0.1
3324
3351
  */
3325
3352
 
3326
3353
  /**
@@ -3634,7 +3661,7 @@ class AnalyticsApi {
3634
3661
  /**
3635
3662
  * Analytics service.
3636
3663
  * @module purecloud-platform-client-v2/api/AnalyticsApi
3637
- * @version 137.0.1
3664
+ * @version 138.0.1
3638
3665
  */
3639
3666
 
3640
3667
  /**
@@ -4816,7 +4843,7 @@ class ArchitectApi {
4816
4843
  /**
4817
4844
  * Architect service.
4818
4845
  * @module purecloud-platform-client-v2/api/ArchitectApi
4819
- * @version 137.0.1
4846
+ * @version 138.0.1
4820
4847
  */
4821
4848
 
4822
4849
  /**
@@ -7861,7 +7888,7 @@ class AuditApi {
7861
7888
  /**
7862
7889
  * Audit service.
7863
7890
  * @module purecloud-platform-client-v2/api/AuditApi
7864
- * @version 137.0.1
7891
+ * @version 138.0.1
7865
7892
  */
7866
7893
 
7867
7894
  /**
@@ -8032,7 +8059,7 @@ class AuthorizationApi {
8032
8059
  /**
8033
8060
  * Authorization service.
8034
8061
  * @module purecloud-platform-client-v2/api/AuthorizationApi
8035
- * @version 137.0.1
8062
+ * @version 138.0.1
8036
8063
  */
8037
8064
 
8038
8065
  /**
@@ -9215,7 +9242,7 @@ class BillingApi {
9215
9242
  /**
9216
9243
  * Billing service.
9217
9244
  * @module purecloud-platform-client-v2/api/BillingApi
9218
- * @version 137.0.1
9245
+ * @version 138.0.1
9219
9246
  */
9220
9247
 
9221
9248
  /**
@@ -9295,7 +9322,7 @@ class ChatApi {
9295
9322
  /**
9296
9323
  * Chat service.
9297
9324
  * @module purecloud-platform-client-v2/api/ChatApi
9298
- * @version 137.0.1
9325
+ * @version 138.0.1
9299
9326
  */
9300
9327
 
9301
9328
  /**
@@ -9386,7 +9413,7 @@ class CoachingApi {
9386
9413
  /**
9387
9414
  * Coaching service.
9388
9415
  * @module purecloud-platform-client-v2/api/CoachingApi
9389
- * @version 137.0.1
9416
+ * @version 138.0.1
9390
9417
  */
9391
9418
 
9392
9419
  /**
@@ -9963,7 +9990,7 @@ class ContentManagementApi {
9963
9990
  /**
9964
9991
  * ContentManagement service.
9965
9992
  * @module purecloud-platform-client-v2/api/ContentManagementApi
9966
- * @version 137.0.1
9993
+ * @version 138.0.1
9967
9994
  */
9968
9995
 
9969
9996
  /**
@@ -11103,7 +11130,7 @@ class ConversationsApi {
11103
11130
  /**
11104
11131
  * Conversations service.
11105
11132
  * @module purecloud-platform-client-v2/api/ConversationsApi
11106
- * @version 137.0.1
11133
+ * @version 138.0.1
11107
11134
  */
11108
11135
 
11109
11136
  /**
@@ -15767,7 +15794,7 @@ class DataExtensionsApi {
15767
15794
  /**
15768
15795
  * DataExtensions service.
15769
15796
  * @module purecloud-platform-client-v2/api/DataExtensionsApi
15770
- * @version 137.0.1
15797
+ * @version 138.0.1
15771
15798
  */
15772
15799
 
15773
15800
  /**
@@ -15853,7 +15880,7 @@ class ExternalContactsApi {
15853
15880
  /**
15854
15881
  * ExternalContacts service.
15855
15882
  * @module purecloud-platform-client-v2/api/ExternalContactsApi
15856
- * @version 137.0.1
15883
+ * @version 138.0.1
15857
15884
  */
15858
15885
 
15859
15886
  /**
@@ -17596,7 +17623,7 @@ class FaxApi {
17596
17623
  /**
17597
17624
  * Fax service.
17598
17625
  * @module purecloud-platform-client-v2/api/FaxApi
17599
- * @version 137.0.1
17626
+ * @version 138.0.1
17600
17627
  */
17601
17628
 
17602
17629
  /**
@@ -17767,7 +17794,7 @@ class FlowsApi {
17767
17794
  /**
17768
17795
  * Flows service.
17769
17796
  * @module purecloud-platform-client-v2/api/FlowsApi
17770
- * @version 137.0.1
17797
+ * @version 138.0.1
17771
17798
  */
17772
17799
 
17773
17800
  /**
@@ -17838,7 +17865,7 @@ class GamificationApi {
17838
17865
  /**
17839
17866
  * Gamification service.
17840
17867
  * @module purecloud-platform-client-v2/api/GamificationApi
17841
- * @version 137.0.1
17868
+ * @version 138.0.1
17842
17869
  */
17843
17870
 
17844
17871
  /**
@@ -19268,7 +19295,7 @@ class GeneralDataProtectionRegulationApi {
19268
19295
  /**
19269
19296
  * GeneralDataProtectionRegulation service.
19270
19297
  * @module purecloud-platform-client-v2/api/GeneralDataProtectionRegulationApi
19271
- * @version 137.0.1
19298
+ * @version 138.0.1
19272
19299
  */
19273
19300
 
19274
19301
  /**
@@ -19398,7 +19425,7 @@ class GeolocationApi {
19398
19425
  /**
19399
19426
  * Geolocation service.
19400
19427
  * @module purecloud-platform-client-v2/api/GeolocationApi
19401
- * @version 137.0.1
19428
+ * @version 138.0.1
19402
19429
  */
19403
19430
 
19404
19431
  /**
@@ -19529,7 +19556,7 @@ class GreetingsApi {
19529
19556
  /**
19530
19557
  * Greetings service.
19531
19558
  * @module purecloud-platform-client-v2/api/GreetingsApi
19532
- * @version 137.0.1
19559
+ * @version 138.0.1
19533
19560
  */
19534
19561
 
19535
19562
  /**
@@ -19984,7 +20011,7 @@ class GroupsApi {
19984
20011
  /**
19985
20012
  * Groups service.
19986
20013
  * @module purecloud-platform-client-v2/api/GroupsApi
19987
- * @version 137.0.1
20014
+ * @version 138.0.1
19988
20015
  */
19989
20016
 
19990
20017
  /**
@@ -20389,7 +20416,7 @@ class IdentityProviderApi {
20389
20416
  /**
20390
20417
  * IdentityProvider service.
20391
20418
  * @module purecloud-platform-client-v2/api/IdentityProviderApi
20392
- * @version 137.0.1
20419
+ * @version 138.0.1
20393
20420
  */
20394
20421
 
20395
20422
  /**
@@ -21145,7 +21172,7 @@ class IntegrationsApi {
21145
21172
  /**
21146
21173
  * Integrations service.
21147
21174
  * @module purecloud-platform-client-v2/api/IntegrationsApi
21148
- * @version 137.0.1
21175
+ * @version 138.0.1
21149
21176
  */
21150
21177
 
21151
21178
  /**
@@ -22822,7 +22849,7 @@ class JourneyApi {
22822
22849
  /**
22823
22850
  * Journey service.
22824
22851
  * @module purecloud-platform-client-v2/api/JourneyApi
22825
- * @version 137.0.1
22852
+ * @version 138.0.1
22826
22853
  */
22827
22854
 
22828
22855
  /**
@@ -23533,7 +23560,7 @@ class KnowledgeApi {
23533
23560
  /**
23534
23561
  * Knowledge service.
23535
23562
  * @module purecloud-platform-client-v2/api/KnowledgeApi
23536
- * @version 137.0.1
23563
+ * @version 138.0.1
23537
23564
  */
23538
23565
 
23539
23566
  /**
@@ -24433,7 +24460,7 @@ class LanguageUnderstandingApi {
24433
24460
  /**
24434
24461
  * LanguageUnderstanding service.
24435
24462
  * @module purecloud-platform-client-v2/api/LanguageUnderstandingApi
24436
- * @version 137.0.1
24463
+ * @version 138.0.1
24437
24464
  */
24438
24465
 
24439
24466
  /**
@@ -25337,7 +25364,7 @@ class LanguagesApi {
25337
25364
  /**
25338
25365
  * Languages service.
25339
25366
  * @module purecloud-platform-client-v2/api/LanguagesApi
25340
- * @version 137.0.1
25367
+ * @version 138.0.1
25341
25368
  */
25342
25369
 
25343
25370
  /**
@@ -25605,7 +25632,7 @@ class LearningApi {
25605
25632
  /**
25606
25633
  * Learning service.
25607
25634
  * @module purecloud-platform-client-v2/api/LearningApi
25608
- * @version 137.0.1
25635
+ * @version 138.0.1
25609
25636
  */
25610
25637
 
25611
25638
  /**
@@ -26196,7 +26223,7 @@ class LicenseApi {
26196
26223
  /**
26197
26224
  * License service.
26198
26225
  * @module purecloud-platform-client-v2/api/LicenseApi
26199
- * @version 137.0.1
26226
+ * @version 138.0.1
26200
26227
  */
26201
26228
 
26202
26229
  /**
@@ -26434,7 +26461,7 @@ class LocationsApi {
26434
26461
  /**
26435
26462
  * Locations service.
26436
26463
  * @module purecloud-platform-client-v2/api/LocationsApi
26437
- * @version 137.0.1
26464
+ * @version 138.0.1
26438
26465
  */
26439
26466
 
26440
26467
  /**
@@ -26670,7 +26697,7 @@ class MessagingApi {
26670
26697
  /**
26671
26698
  * Messaging service.
26672
26699
  * @module purecloud-platform-client-v2/api/MessagingApi
26673
- * @version 137.0.1
26700
+ * @version 138.0.1
26674
26701
  */
26675
26702
 
26676
26703
  /**
@@ -26821,7 +26848,7 @@ class MobileDevicesApi {
26821
26848
  /**
26822
26849
  * MobileDevices service.
26823
26850
  * @module purecloud-platform-client-v2/api/MobileDevicesApi
26824
- * @version 137.0.1
26851
+ * @version 138.0.1
26825
26852
  */
26826
26853
 
26827
26854
  /**
@@ -26972,7 +26999,7 @@ class NotificationsApi {
26972
26999
  /**
26973
27000
  * Notifications service.
26974
27001
  * @module purecloud-platform-client-v2/api/NotificationsApi
26975
- * @version 137.0.1
27002
+ * @version 138.0.1
26976
27003
  */
26977
27004
 
26978
27005
  /**
@@ -27197,7 +27224,7 @@ class OAuthApi {
27197
27224
  /**
27198
27225
  * OAuth service.
27199
27226
  * @module purecloud-platform-client-v2/api/OAuthApi
27200
- * @version 137.0.1
27227
+ * @version 138.0.1
27201
27228
  */
27202
27229
 
27203
27230
  /**
@@ -27563,7 +27590,7 @@ class ObjectsApi {
27563
27590
  /**
27564
27591
  * Objects service.
27565
27592
  * @module purecloud-platform-client-v2/api/ObjectsApi
27566
- * @version 137.0.1
27593
+ * @version 138.0.1
27567
27594
  */
27568
27595
 
27569
27596
  /**
@@ -27834,7 +27861,7 @@ class OrganizationApi {
27834
27861
  /**
27835
27862
  * Organization service.
27836
27863
  * @module purecloud-platform-client-v2/api/OrganizationApi
27837
- * @version 137.0.1
27864
+ * @version 138.0.1
27838
27865
  */
27839
27866
 
27840
27867
  /**
@@ -28237,7 +28264,7 @@ class OrganizationAuthorizationApi {
28237
28264
  /**
28238
28265
  * OrganizationAuthorization service.
28239
28266
  * @module purecloud-platform-client-v2/api/OrganizationAuthorizationApi
28240
- * @version 137.0.1
28267
+ * @version 138.0.1
28241
28268
  */
28242
28269
 
28243
28270
  /**
@@ -29162,7 +29189,7 @@ class OutboundApi {
29162
29189
  /**
29163
29190
  * Outbound service.
29164
29191
  * @module purecloud-platform-client-v2/api/OutboundApi
29165
- * @version 137.0.1
29192
+ * @version 138.0.1
29166
29193
  */
29167
29194
 
29168
29195
  /**
@@ -32417,7 +32444,7 @@ class PresenceApi {
32417
32444
  /**
32418
32445
  * Presence service.
32419
32446
  * @module purecloud-platform-client-v2/api/PresenceApi
32420
- * @version 137.0.1
32447
+ * @version 138.0.1
32421
32448
  */
32422
32449
 
32423
32450
  /**
@@ -32739,7 +32766,7 @@ class QualityApi {
32739
32766
  /**
32740
32767
  * Quality service.
32741
32768
  * @module purecloud-platform-client-v2/api/QualityApi
32742
- * @version 137.0.1
32769
+ * @version 138.0.1
32743
32770
  */
32744
32771
 
32745
32772
  /**
@@ -34317,7 +34344,7 @@ class RecordingApi {
34317
34344
  /**
34318
34345
  * Recording service.
34319
34346
  * @module purecloud-platform-client-v2/api/RecordingApi
34320
- * @version 137.0.1
34347
+ * @version 138.0.1
34321
34348
  */
34322
34349
 
34323
34350
  /**
@@ -35970,7 +35997,7 @@ class ResponseManagementApi {
35970
35997
  /**
35971
35998
  * ResponseManagement service.
35972
35999
  * @module purecloud-platform-client-v2/api/ResponseManagementApi
35973
- * @version 137.0.1
36000
+ * @version 138.0.1
35974
36001
  */
35975
36002
 
35976
36003
  /**
@@ -36454,7 +36481,7 @@ class RoutingApi {
36454
36481
  /**
36455
36482
  * Routing service.
36456
36483
  * @module purecloud-platform-client-v2/api/RoutingApi
36457
- * @version 137.0.1
36484
+ * @version 138.0.1
36458
36485
  */
36459
36486
 
36460
36487
  /**
@@ -39381,7 +39408,7 @@ class SCIMApi {
39381
39408
  /**
39382
39409
  * SCIM service.
39383
39410
  * @module purecloud-platform-client-v2/api/SCIMApi
39384
- * @version 137.0.1
39411
+ * @version 138.0.1
39385
39412
  */
39386
39413
 
39387
39414
  /**
@@ -40258,7 +40285,7 @@ class ScriptsApi {
40258
40285
  /**
40259
40286
  * Scripts service.
40260
40287
  * @module purecloud-platform-client-v2/api/ScriptsApi
40261
- * @version 137.0.1
40288
+ * @version 138.0.1
40262
40289
  */
40263
40290
 
40264
40291
  /**
@@ -40586,9 +40613,9 @@ class ScriptsApi {
40586
40613
  *
40587
40614
  * @param {String} scriptId Script ID
40588
40615
  * @param {Object} opts Optional parameters
40589
- * @param {String} opts.input input
40590
- * @param {String} opts.output output
40591
- * @param {String} opts.type type
40616
+ * @param {Object} opts.input input
40617
+ * @param {Object} opts.output output
40618
+ * @param {Object} opts.type type
40592
40619
  * @param {String} opts.scriptDataVersion Advanced usage - controls the data version of the script
40593
40620
  */
40594
40621
  getScriptsPublishedScriptIdVariables(scriptId, opts) {
@@ -40677,7 +40704,7 @@ class SearchApi {
40677
40704
  /**
40678
40705
  * Search service.
40679
40706
  * @module purecloud-platform-client-v2/api/SearchApi
40680
- * @version 137.0.1
40707
+ * @version 138.0.1
40681
40708
  */
40682
40709
 
40683
40710
  /**
@@ -41212,7 +41239,7 @@ class SpeechTextAnalyticsApi {
41212
41239
  /**
41213
41240
  * SpeechTextAnalytics service.
41214
41241
  * @module purecloud-platform-client-v2/api/SpeechTextAnalyticsApi
41215
- * @version 137.0.1
41242
+ * @version 138.0.1
41216
41243
  */
41217
41244
 
41218
41245
  /**
@@ -42065,7 +42092,7 @@ class StationsApi {
42065
42092
  /**
42066
42093
  * Stations service.
42067
42094
  * @module purecloud-platform-client-v2/api/StationsApi
42068
- * @version 137.0.1
42095
+ * @version 138.0.1
42069
42096
  */
42070
42097
 
42071
42098
  /**
@@ -42212,7 +42239,7 @@ class SuggestApi {
42212
42239
  /**
42213
42240
  * Suggest service.
42214
42241
  * @module purecloud-platform-client-v2/api/SuggestApi
42215
- * @version 137.0.1
42242
+ * @version 138.0.1
42216
42243
  */
42217
42244
 
42218
42245
  /**
@@ -42351,7 +42378,7 @@ class TelephonyApi {
42351
42378
  /**
42352
42379
  * Telephony service.
42353
42380
  * @module purecloud-platform-client-v2/api/TelephonyApi
42354
- * @version 137.0.1
42381
+ * @version 138.0.1
42355
42382
  */
42356
42383
 
42357
42384
  /**
@@ -42459,7 +42486,7 @@ class TelephonyProvidersEdgeApi {
42459
42486
  /**
42460
42487
  * TelephonyProvidersEdge service.
42461
42488
  * @module purecloud-platform-client-v2/api/TelephonyProvidersEdgeApi
42462
- * @version 137.0.1
42489
+ * @version 138.0.1
42463
42490
  */
42464
42491
 
42465
42492
  /**
@@ -46092,7 +46119,7 @@ class TextbotsApi {
46092
46119
  /**
46093
46120
  * Textbots service.
46094
46121
  * @module purecloud-platform-client-v2/api/TextbotsApi
46095
- * @version 137.0.1
46122
+ * @version 138.0.1
46096
46123
  */
46097
46124
 
46098
46125
  /**
@@ -46220,7 +46247,7 @@ class TokensApi {
46220
46247
  /**
46221
46248
  * Tokens service.
46222
46249
  * @module purecloud-platform-client-v2/api/TokensApi
46223
- * @version 137.0.1
46250
+ * @version 138.0.1
46224
46251
  */
46225
46252
 
46226
46253
  /**
@@ -46326,7 +46353,7 @@ class UploadsApi {
46326
46353
  /**
46327
46354
  * Uploads service.
46328
46355
  * @module purecloud-platform-client-v2/api/UploadsApi
46329
- * @version 137.0.1
46356
+ * @version 138.0.1
46330
46357
  */
46331
46358
 
46332
46359
  /**
@@ -46477,7 +46504,7 @@ class UsageApi {
46477
46504
  /**
46478
46505
  * Usage service.
46479
46506
  * @module purecloud-platform-client-v2/api/UsageApi
46480
- * @version 137.0.1
46507
+ * @version 138.0.1
46481
46508
  */
46482
46509
 
46483
46510
  /**
@@ -46548,7 +46575,7 @@ class UserRecordingsApi {
46548
46575
  /**
46549
46576
  * UserRecordings service.
46550
46577
  * @module purecloud-platform-client-v2/api/UserRecordingsApi
46551
- * @version 137.0.1
46578
+ * @version 138.0.1
46552
46579
  */
46553
46580
 
46554
46581
  /**
@@ -46732,7 +46759,7 @@ class UsersApi {
46732
46759
  /**
46733
46760
  * Users service.
46734
46761
  * @module purecloud-platform-client-v2/api/UsersApi
46735
- * @version 137.0.1
46762
+ * @version 138.0.1
46736
46763
  */
46737
46764
 
46738
46765
  /**
@@ -49034,7 +49061,7 @@ class UtilitiesApi {
49034
49061
  /**
49035
49062
  * Utilities service.
49036
49063
  * @module purecloud-platform-client-v2/api/UtilitiesApi
49037
- * @version 137.0.1
49064
+ * @version 138.0.1
49038
49065
  */
49039
49066
 
49040
49067
  /**
@@ -49145,7 +49172,7 @@ class VoicemailApi {
49145
49172
  /**
49146
49173
  * Voicemail service.
49147
49174
  * @module purecloud-platform-client-v2/api/VoicemailApi
49148
- * @version 137.0.1
49175
+ * @version 138.0.1
49149
49176
  */
49150
49177
 
49151
49178
  /**
@@ -49812,7 +49839,7 @@ class WebChatApi {
49812
49839
  /**
49813
49840
  * WebChat service.
49814
49841
  * @module purecloud-platform-client-v2/api/WebChatApi
49815
- * @version 137.0.1
49842
+ * @version 138.0.1
49816
49843
  */
49817
49844
 
49818
49845
  /**
@@ -50356,7 +50383,7 @@ class WebDeploymentsApi {
50356
50383
  /**
50357
50384
  * WebDeployments service.
50358
50385
  * @module purecloud-platform-client-v2/api/WebDeploymentsApi
50359
- * @version 137.0.1
50386
+ * @version 138.0.1
50360
50387
  */
50361
50388
 
50362
50389
  /**
@@ -50711,7 +50738,7 @@ class WebMessagingApi {
50711
50738
  /**
50712
50739
  * WebMessaging service.
50713
50740
  * @module purecloud-platform-client-v2/api/WebMessagingApi
50714
- * @version 137.0.1
50741
+ * @version 138.0.1
50715
50742
  */
50716
50743
 
50717
50744
  /**
@@ -50757,7 +50784,7 @@ class WidgetsApi {
50757
50784
  /**
50758
50785
  * Widgets service.
50759
50786
  * @module purecloud-platform-client-v2/api/WidgetsApi
50760
- * @version 137.0.1
50787
+ * @version 138.0.1
50761
50788
  */
50762
50789
 
50763
50790
  /**
@@ -50903,7 +50930,7 @@ class WorkforceManagementApi {
50903
50930
  /**
50904
50931
  * WorkforceManagement service.
50905
50932
  * @module purecloud-platform-client-v2/api/WorkforceManagementApi
50906
- * @version 137.0.1
50933
+ * @version 138.0.1
50907
50934
  */
50908
50935
 
50909
50936
  /**
@@ -53662,8 +53689,8 @@ class WorkforceManagementApi {
53662
53689
  *
53663
53690
  * @param {String} businessUnitId The ID of the business unit
53664
53691
  * @param {Object} opts Optional parameters
53665
- * @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification. For testing/app development purposes
53666
- * @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service. For testing/app development purposes
53692
+ * @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification. For testing/app development purposes
53693
+ * @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service. For testing/app development purposes
53667
53694
  * @param {Object} opts.body body
53668
53695
  */
53669
53696
  postWorkforcemanagementBusinessunitAgentschedulesSearch(businessUnitId, opts) {
@@ -53784,8 +53811,8 @@ class WorkforceManagementApi {
53784
53811
  * @param {String} scheduleId The ID of the schedule
53785
53812
  * @param {Object} body body
53786
53813
  * @param {Object} opts Optional parameters
53787
- * @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification. For testing/app development purposes
53788
- * @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service. For testing/app development purposes
53814
+ * @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification. For testing/app development purposes
53815
+ * @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service. For testing/app development purposes
53789
53816
  */
53790
53817
  postWorkforcemanagementBusinessunitWeekScheduleAgentschedulesQuery(businessUnitId, weekId, scheduleId, body, opts) {
53791
53818
  opts = opts || {};
@@ -54371,8 +54398,8 @@ class WorkforceManagementApi {
54371
54398
  *
54372
54399
  * @param {String} managementUnitId The ID of the management unit, or 'mine' for the management unit of the logged-in user.
54373
54400
  * @param {Object} opts Optional parameters
54374
- * @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification. For testing/app development purposes
54375
- * @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service. For testing/app development purposes
54401
+ * @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification. For testing/app development purposes
54402
+ * @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service. For testing/app development purposes
54376
54403
  * @param {Object} opts.body body
54377
54404
  */
54378
54405
  postWorkforcemanagementManagementunitAgentschedulesSearch(managementUnitId, opts) {
@@ -55154,7 +55181,7 @@ class WorkforceManagementApi {
55154
55181
  * </pre>
55155
55182
  * </p>
55156
55183
  * @module purecloud-platform-client-v2/index
55157
- * @version 137.0.1
55184
+ * @version 138.0.1
55158
55185
  */
55159
55186
  class platformClient {
55160
55187
  constructor() {