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.
- package/README.md +9 -12
- package/dist/node/purecloud-platform-client-v2.js +289 -262
- package/dist/web-amd/purecloud-platform-client-v2.js +289 -262
- package/dist/web-amd/purecloud-platform-client-v2.min.js +1 -1
- package/dist/web-cjs/bundle.js +289 -262
- package/dist/web-cjs/purecloud-platform-client-v2.js +2080 -4490
- package/dist/web-cjs/purecloud-platform-client-v2.min.js +1 -1
- package/index.d.ts +419 -394
- package/package.json +2 -2
- package/src/purecloud-platform-client-v2/ApiClient.js +198 -176
- package/src/purecloud-platform-client-v2/api/AlertingApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/AnalyticsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/ArchitectApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/AuditApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/AuthorizationApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/BillingApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/ChatApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/CoachingApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/ContentManagementApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/ConversationsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/DataExtensionsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/ExternalContactsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/FaxApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/FlowsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/GamificationApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/GeneralDataProtectionRegulationApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/GeolocationApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/GreetingsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/GroupsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/IdentityProviderApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/IntegrationsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/JourneyApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/KnowledgeApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/LanguageUnderstandingApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/LanguagesApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/LearningApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/LicenseApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/LocationsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/MessagingApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/MobileDevicesApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/NotificationsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/OAuthApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/ObjectsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/OrganizationApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/OrganizationAuthorizationApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/OutboundApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/PresenceApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/QualityApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/RecordingApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/ResponseManagementApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/RoutingApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/SCIMApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/ScriptsApi.js +4 -4
- package/src/purecloud-platform-client-v2/api/SearchApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/SpeechTextAnalyticsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/StationsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/SuggestApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/TelephonyApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/TelephonyProvidersEdgeApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/TextbotsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/TokensApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/UploadsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/UsageApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/UserRecordingsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/UsersApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/UtilitiesApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/VoicemailApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/WebChatApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/WebDeploymentsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/WebMessagingApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/WidgetsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/WorkforceManagementApi.js +7 -7
- package/src/purecloud-platform-client-v2/index.js +1 -1
- package/src/purecloud-platform-client-v2/logger.js +17 -13
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
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
|
|
7
|
+
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
8
8
|
|
|
9
9
|
var PureCloudRegionHosts = {
|
|
10
10
|
us_east_1: 'mypurecloud.com',
|
|
@@ -147,34 +147,38 @@ class Logger {
|
|
|
147
147
|
|
|
148
148
|
formatLog(level, statusCode, method, url, requestHeaders, responseHeaders, requestBody, responseBody) {
|
|
149
149
|
var result;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
var localRequestHeaders = requestHeaders ? JSON.parse(JSON.stringify(requestHeaders)) : null;
|
|
151
|
+
var localResponseHeaders = responseHeaders ? JSON.parse(JSON.stringify(responseHeaders)) : null;
|
|
152
|
+
var localRequestBody = requestBody ? JSON.parse(JSON.stringify(requestBody)) : null;
|
|
153
|
+
var localResponseBody = responseBody ? JSON.parse(JSON.stringify(responseBody)) : null;
|
|
154
|
+
if (requestHeaders) localRequestHeaders['Authorization'] = '[REDACTED]';
|
|
155
|
+
if (!this.log_request_body) localRequestBody = undefined;
|
|
156
|
+
if (!this.log_response_body) localResponseBody = undefined;
|
|
153
157
|
if (this.log_format && this.log_format === logFormatEnum.formats.JSON) {
|
|
154
158
|
result = {
|
|
155
159
|
level: level,
|
|
156
160
|
date: new Date().toISOString(),
|
|
157
161
|
method: method,
|
|
158
162
|
url: decodeURIComponent(url),
|
|
159
|
-
correlationId:
|
|
163
|
+
correlationId: localResponseHeaders ? (localResponseHeaders['inin-correlation-id'] ? localResponseHeaders['inin-correlation-id'] : '') : '',
|
|
160
164
|
statusCode: statusCode,
|
|
161
165
|
};
|
|
162
|
-
if (
|
|
163
|
-
if (
|
|
164
|
-
if (
|
|
165
|
-
if (
|
|
166
|
+
if (localRequestHeaders) result.requestHeaders = localRequestHeaders;
|
|
167
|
+
if (localResponseHeaders) result.responseHeaders = localResponseHeaders;
|
|
168
|
+
if (localRequestBody) result.requestBody = localRequestBody;
|
|
169
|
+
if (localResponseBody) result.responseBody = localResponseBody;
|
|
166
170
|
} else {
|
|
167
171
|
result = `${new Date().toISOString()}
|
|
168
172
|
=== REQUEST ===
|
|
169
173
|
${this.formatValue('URL', decodeURIComponent(url))}${this.formatValue('Method', method)}${this.formatValue(
|
|
170
174
|
'Headers',
|
|
171
|
-
this.formatHeaderString(
|
|
172
|
-
)}${this.formatValue('Body',
|
|
175
|
+
this.formatHeaderString(localRequestHeaders)
|
|
176
|
+
)}${this.formatValue('Body', localRequestBody ? JSON.stringify(localRequestBody, null, 2) : '')}
|
|
173
177
|
=== RESPONSE ===
|
|
174
|
-
${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.formatHeaderString(
|
|
178
|
+
${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.formatHeaderString(localResponseHeaders))}${this.formatValue(
|
|
175
179
|
'CorrelationId',
|
|
176
|
-
|
|
177
|
-
)}${this.formatValue('Body',
|
|
180
|
+
localResponseHeaders ? (localResponseHeaders['inin-correlation-id'] ? localResponseHeaders['inin-correlation-id'] : '') : ''
|
|
181
|
+
)}${this.formatValue('Body', localResponseBody ? JSON.stringify(localResponseBody, null, 2) : '')}`;
|
|
178
182
|
}
|
|
179
183
|
|
|
180
184
|
return result;
|
|
@@ -395,7 +399,7 @@ class Configuration {
|
|
|
395
399
|
|
|
396
400
|
/**
|
|
397
401
|
* @module purecloud-platform-client-v2/ApiClient
|
|
398
|
-
* @version
|
|
402
|
+
* @version 138.0.1
|
|
399
403
|
*/
|
|
400
404
|
class ApiClient {
|
|
401
405
|
/**
|
|
@@ -497,9 +501,6 @@ class ApiClient {
|
|
|
497
501
|
this.authData = {};
|
|
498
502
|
this.settingsPrefix = 'purecloud';
|
|
499
503
|
|
|
500
|
-
// Expose superagent module for use with superagent-proxy
|
|
501
|
-
this.superagent = superagent__default["default"];
|
|
502
|
-
|
|
503
504
|
// Transparently request a new access token when it expires (Code Authorization only)
|
|
504
505
|
this.refreshInProgress = false;
|
|
505
506
|
|
|
@@ -668,63 +669,65 @@ class ApiClient {
|
|
|
668
669
|
return;
|
|
669
670
|
}
|
|
670
671
|
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
// Log error
|
|
683
|
-
this.config.logger.log(
|
|
684
|
-
'error',
|
|
685
|
-
response.statusCode,
|
|
686
|
-
'POST',
|
|
687
|
-
`https://login.${this.config.environment}/oauth/token`,
|
|
688
|
-
request.header,
|
|
689
|
-
response.headers,
|
|
690
|
-
{ grant_type: 'client_credentials' },
|
|
691
|
-
response.body
|
|
692
|
-
);
|
|
693
|
-
reject(error);
|
|
694
|
-
} else {
|
|
672
|
+
const headers = {
|
|
673
|
+
'Authorization': `Basic ${authHeader}`
|
|
674
|
+
};
|
|
675
|
+
axios__default["default"]({
|
|
676
|
+
method: `POST`,
|
|
677
|
+
url: `https://login.${this.config.environment}/oauth/token`,
|
|
678
|
+
headers: headers,
|
|
679
|
+
data: 'grant_type=client_credentials',
|
|
680
|
+
proxy: this.proxy
|
|
681
|
+
})
|
|
682
|
+
.then((response) => {
|
|
695
683
|
// Logging
|
|
696
684
|
this.config.logger.log(
|
|
697
685
|
'trace',
|
|
698
|
-
response.
|
|
686
|
+
response.status,
|
|
699
687
|
'POST',
|
|
700
688
|
`https://login.${this.config.environment}/oauth/token`,
|
|
701
|
-
|
|
689
|
+
headers,
|
|
702
690
|
response.headers,
|
|
703
691
|
{ grant_type: 'client_credentials' },
|
|
704
692
|
undefined
|
|
705
693
|
);
|
|
706
694
|
this.config.logger.log(
|
|
707
695
|
'debug',
|
|
708
|
-
response.
|
|
696
|
+
response.status,
|
|
709
697
|
'POST',
|
|
710
698
|
`https://login.${this.config.environment}/oauth/token`,
|
|
711
|
-
|
|
699
|
+
headers,
|
|
712
700
|
undefined,
|
|
713
701
|
{ grant_type: 'client_credentials' },
|
|
714
702
|
undefined
|
|
715
703
|
);
|
|
716
704
|
|
|
717
705
|
// Save access token
|
|
718
|
-
this.setAccessToken(response.
|
|
706
|
+
this.setAccessToken(response.data['access_token']);
|
|
719
707
|
|
|
720
708
|
// Set expiry time
|
|
721
|
-
this.authData.tokenExpiryTime = (new Date()).getTime() + (response.
|
|
709
|
+
this.authData.tokenExpiryTime = (new Date()).getTime() + (response.data['expires_in'] * 1000);
|
|
722
710
|
this.authData.tokenExpiryTimeString = (new Date(this.authData.tokenExpiryTime)).toUTCString();
|
|
723
711
|
|
|
724
712
|
// Return auth data
|
|
725
713
|
resolve(this.authData);
|
|
726
|
-
}
|
|
727
|
-
|
|
714
|
+
})
|
|
715
|
+
.catch((error) => {
|
|
716
|
+
// Log error
|
|
717
|
+
if (error.response) {
|
|
718
|
+
this.config.logger.log(
|
|
719
|
+
'error',
|
|
720
|
+
error.response.status,
|
|
721
|
+
'POST',
|
|
722
|
+
`https://login.${this.config.environment}/oauth/token`,
|
|
723
|
+
headers,
|
|
724
|
+
error.response.headers,
|
|
725
|
+
{ grant_type: 'client_credentials' },
|
|
726
|
+
error.response.data
|
|
727
|
+
);
|
|
728
|
+
}
|
|
729
|
+
reject(error);
|
|
730
|
+
});
|
|
728
731
|
});
|
|
729
732
|
}
|
|
730
733
|
|
|
@@ -747,9 +750,7 @@ class ApiClient {
|
|
|
747
750
|
{ grant_type: 'urn:ietf:params:oauth:grant-type:saml2-bearer' },
|
|
748
751
|
{ orgName: orgName },
|
|
749
752
|
{ assertion: assertion });
|
|
750
|
-
|
|
751
|
-
request.proxy(this.proxy);
|
|
752
|
-
}
|
|
753
|
+
request.proxy = this.proxy;
|
|
753
754
|
var bodyParam = {
|
|
754
755
|
grant_type: 'urn:ietf:params:oauth:grant-type:saml2-bearer',
|
|
755
756
|
orgName: orgName,
|
|
@@ -757,54 +758,56 @@ class ApiClient {
|
|
|
757
758
|
};
|
|
758
759
|
|
|
759
760
|
// Handle response
|
|
760
|
-
request
|
|
761
|
-
|
|
762
|
-
// Log error
|
|
763
|
-
this.config.logger.log(
|
|
764
|
-
'error',
|
|
765
|
-
response.statusCode,
|
|
766
|
-
'POST',
|
|
767
|
-
`https://login.${this.config.environment}/oauth/token`,
|
|
768
|
-
request.header,
|
|
769
|
-
response.headers,
|
|
770
|
-
bodyParam,
|
|
771
|
-
response.body
|
|
772
|
-
);
|
|
773
|
-
reject(error);
|
|
774
|
-
} else {
|
|
761
|
+
request
|
|
762
|
+
.then((response) => {
|
|
775
763
|
// Logging
|
|
776
764
|
this.config.logger.log(
|
|
777
765
|
'trace',
|
|
778
|
-
response.
|
|
766
|
+
response.status,
|
|
779
767
|
'POST',
|
|
780
768
|
`https://login.${this.config.environment}/oauth/token`,
|
|
781
|
-
request.
|
|
769
|
+
request.headers,
|
|
782
770
|
response.headers,
|
|
783
771
|
bodyParam,
|
|
784
772
|
undefined
|
|
785
773
|
);
|
|
786
774
|
this.config.logger.log(
|
|
787
775
|
'debug',
|
|
788
|
-
response.
|
|
776
|
+
response.status,
|
|
789
777
|
'POST',
|
|
790
778
|
`https://login.${this.config.environment}/oauth/token`,
|
|
791
|
-
request.
|
|
779
|
+
request.headers,
|
|
792
780
|
undefined,
|
|
793
781
|
bodyParam,
|
|
794
782
|
undefined
|
|
795
783
|
);
|
|
796
784
|
|
|
797
785
|
// Get access token from response
|
|
798
|
-
var access_token = response.
|
|
786
|
+
var access_token = response.data.access_token;
|
|
799
787
|
|
|
800
788
|
this.setAccessToken(access_token);
|
|
801
|
-
this.authData.tokenExpiryTime = new Date().getTime() + response.
|
|
789
|
+
this.authData.tokenExpiryTime = new Date().getTime() + response.data['expires_in'] * 1000;
|
|
802
790
|
this.authData.tokenExpiryTimeString = new Date(this.authData.tokenExpiryTime).toUTCString();
|
|
803
791
|
|
|
804
792
|
// Return auth data
|
|
805
793
|
resolve(this.authData);
|
|
806
|
-
}
|
|
807
|
-
|
|
794
|
+
})
|
|
795
|
+
.catch((error) => {
|
|
796
|
+
// Log error
|
|
797
|
+
if (error.response) {
|
|
798
|
+
this.config.logger.log(
|
|
799
|
+
'error',
|
|
800
|
+
error.response.status,
|
|
801
|
+
'POST',
|
|
802
|
+
`https://login.${this.config.environment}/oauth/token`,
|
|
803
|
+
request.headers,
|
|
804
|
+
error.response.headers,
|
|
805
|
+
bodyParam,
|
|
806
|
+
error.response.data
|
|
807
|
+
);
|
|
808
|
+
}
|
|
809
|
+
reject(error);
|
|
810
|
+
});
|
|
808
811
|
});
|
|
809
812
|
}
|
|
810
813
|
|
|
@@ -828,9 +831,7 @@ class ApiClient {
|
|
|
828
831
|
{ grant_type: 'authorization_code' },
|
|
829
832
|
{ code: authCode },
|
|
830
833
|
{ redirect_uri: redirectUri });
|
|
831
|
-
|
|
832
|
-
request.proxy(this.proxy);
|
|
833
|
-
}
|
|
834
|
+
request.proxy = this.proxy;
|
|
834
835
|
var bodyParam = {
|
|
835
836
|
grant_type: 'authorization_code',
|
|
836
837
|
code: authCode,
|
|
@@ -856,9 +857,7 @@ class ApiClient {
|
|
|
856
857
|
}
|
|
857
858
|
var encodedData = Buffer.from(clientId + ':' + clientSecret).toString('base64');
|
|
858
859
|
var request = this._formAuthRequest(encodedData, { grant_type: 'refresh_token' }, { refresh_token: refreshToken });
|
|
859
|
-
|
|
860
|
-
request.proxy(this.proxy);
|
|
861
|
-
}
|
|
860
|
+
request.proxy = this.proxy;
|
|
862
861
|
var bodyParam = {
|
|
863
862
|
grant_type: 'refresh_token',
|
|
864
863
|
refresh_token: refreshToken,
|
|
@@ -876,57 +875,59 @@ class ApiClient {
|
|
|
876
875
|
* @param {function} reject - Promise reject callback
|
|
877
876
|
*/
|
|
878
877
|
_handleCodeAuthorizationResponse(request, bodyParam, resolve, reject) {
|
|
879
|
-
request
|
|
880
|
-
|
|
881
|
-
// Log error
|
|
882
|
-
this.config.logger.log(
|
|
883
|
-
'error',
|
|
884
|
-
response.statusCode,
|
|
885
|
-
'POST',
|
|
886
|
-
`https://login.${this.config.environment}/oauth/token`,
|
|
887
|
-
request.header,
|
|
888
|
-
response.headers,
|
|
889
|
-
bodyParam,
|
|
890
|
-
response.body
|
|
891
|
-
);
|
|
892
|
-
|
|
893
|
-
reject(error);
|
|
894
|
-
} else {
|
|
878
|
+
request
|
|
879
|
+
.then((response) => {
|
|
895
880
|
// Logging
|
|
896
881
|
this.config.logger.log(
|
|
897
882
|
'trace',
|
|
898
|
-
response.
|
|
883
|
+
response.status,
|
|
899
884
|
'POST',
|
|
900
885
|
`https://login.${this.config.environment}/oauth/token`,
|
|
901
|
-
request.
|
|
886
|
+
request.headers,
|
|
902
887
|
response.headers,
|
|
903
888
|
bodyParam,
|
|
904
889
|
undefined
|
|
905
890
|
);
|
|
906
891
|
this.config.logger.log(
|
|
907
892
|
'debug',
|
|
908
|
-
response.
|
|
893
|
+
response.status,
|
|
909
894
|
'POST',
|
|
910
895
|
`https://login.${this.config.environment}/oauth/token`,
|
|
911
|
-
request.
|
|
896
|
+
request.headers,
|
|
912
897
|
undefined,
|
|
913
898
|
bodyParam,
|
|
914
899
|
undefined
|
|
915
900
|
);
|
|
916
901
|
|
|
917
902
|
// Get access token from response
|
|
918
|
-
var access_token = response.
|
|
919
|
-
var refresh_token = response.
|
|
903
|
+
var access_token = response.data.access_token;
|
|
904
|
+
var refresh_token = response.data.refresh_token;
|
|
920
905
|
|
|
921
906
|
this.setAccessToken(access_token);
|
|
922
907
|
this.authData.refreshToken = refresh_token;
|
|
923
|
-
this.authData.tokenExpiryTime = new Date().getTime() + response.
|
|
908
|
+
this.authData.tokenExpiryTime = new Date().getTime() + response.data['expires_in'] * 1000;
|
|
924
909
|
this.authData.tokenExpiryTimeString = new Date(this.authData.tokenExpiryTime).toUTCString();
|
|
925
910
|
|
|
926
911
|
// Return auth data
|
|
927
912
|
resolve(this.authData);
|
|
928
|
-
}
|
|
929
|
-
|
|
913
|
+
})
|
|
914
|
+
.catch((error) => {
|
|
915
|
+
// Log error
|
|
916
|
+
if (error.response) {
|
|
917
|
+
this.config.logger.log(
|
|
918
|
+
'error',
|
|
919
|
+
error.response.status,
|
|
920
|
+
'POST',
|
|
921
|
+
`https://login.${this.config.environment}/oauth/token`,
|
|
922
|
+
request.headers,
|
|
923
|
+
error.response.headers,
|
|
924
|
+
bodyParam,
|
|
925
|
+
error.response.data
|
|
926
|
+
);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
reject(error);
|
|
930
|
+
});
|
|
930
931
|
}
|
|
931
932
|
|
|
932
933
|
/**
|
|
@@ -934,15 +935,15 @@ class ApiClient {
|
|
|
934
935
|
* @param {string} encodedData - Base64 encoded client and clientSecret pair
|
|
935
936
|
*/
|
|
936
937
|
_formAuthRequest(encodedData) {
|
|
937
|
-
var request =
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
938
|
+
var request = axios__default["default"]({
|
|
939
|
+
method: `POST`,
|
|
940
|
+
url: `https://login.${this.config.environment}/oauth/token`,
|
|
941
|
+
headers: {
|
|
942
|
+
'Authorization': 'Basic ' + encodedData,
|
|
943
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
944
|
+
},
|
|
945
|
+
data: arguments
|
|
946
|
+
});
|
|
946
947
|
|
|
947
948
|
return request;
|
|
948
949
|
}
|
|
@@ -1143,6 +1144,36 @@ class ApiClient {
|
|
|
1143
1144
|
return param.toString();
|
|
1144
1145
|
}
|
|
1145
1146
|
|
|
1147
|
+
/**
|
|
1148
|
+
* Returns query parameters serialized in the format needed for an axios request.
|
|
1149
|
+
* @param param The unserialized query parameters.
|
|
1150
|
+
* @returns {Object} The serialized representation the query parameters.
|
|
1151
|
+
*/
|
|
1152
|
+
serialize(obj) {
|
|
1153
|
+
var result = {};
|
|
1154
|
+
for (var p in obj) {
|
|
1155
|
+
if (obj.hasOwnProperty(p) && obj[p] !== undefined) {
|
|
1156
|
+
result[encodeURIComponent(p)] = Array.isArray(obj[p]) ? obj[p].join(",") : this.paramToString(obj[p]);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
return result
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* Adds headers onto an existing header object (may be empty)
|
|
1164
|
+
* @param existingHeaders The existing header object.
|
|
1165
|
+
* @param newHeaders New headers.
|
|
1166
|
+
* @returns {Object} The combination of all headers.
|
|
1167
|
+
*/
|
|
1168
|
+
addHeaders(existingHeaders, ...newHeaders) {
|
|
1169
|
+
if (existingHeaders) {
|
|
1170
|
+
existingHeaders = Object.assign(existingHeaders, ...newHeaders);
|
|
1171
|
+
} else {
|
|
1172
|
+
existingHeaders = Object.assign(...newHeaders);
|
|
1173
|
+
}
|
|
1174
|
+
return existingHeaders;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1146
1177
|
/**
|
|
1147
1178
|
* Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values.
|
|
1148
1179
|
* NOTE: query parameters are not handled here.
|
|
@@ -1258,6 +1289,9 @@ class ApiClient {
|
|
|
1258
1289
|
*/
|
|
1259
1290
|
buildCollectionParam(param, collectionFormat) {
|
|
1260
1291
|
if (!param) return;
|
|
1292
|
+
if (!Array.isArray(param)) {
|
|
1293
|
+
param = [param];
|
|
1294
|
+
}
|
|
1261
1295
|
|
|
1262
1296
|
switch (collectionFormat) {
|
|
1263
1297
|
case 'csv':
|
|
@@ -1269,7 +1303,7 @@ class ApiClient {
|
|
|
1269
1303
|
case 'pipes':
|
|
1270
1304
|
return param.map(this.paramToString).join('|');
|
|
1271
1305
|
case 'multi':
|
|
1272
|
-
// return the array directly as
|
|
1306
|
+
// return the array directly as axios will handle it as expected
|
|
1273
1307
|
return param.map(this.paramToString);
|
|
1274
1308
|
default:
|
|
1275
1309
|
throw new Error(`Unknown collection format: ${collectionFormat}`);
|
|
@@ -1278,7 +1312,7 @@ class ApiClient {
|
|
|
1278
1312
|
|
|
1279
1313
|
/**
|
|
1280
1314
|
* Applies authentication headers to the request.
|
|
1281
|
-
* @param {Object} request The request object
|
|
1315
|
+
* @param {Object} request The axios request config object.
|
|
1282
1316
|
* @param {Array.<String>} authNames An array of authentication method names.
|
|
1283
1317
|
*/
|
|
1284
1318
|
applyAuthToRequest(request, authNames) {
|
|
@@ -1287,7 +1321,10 @@ class ApiClient {
|
|
|
1287
1321
|
switch (auth.type) {
|
|
1288
1322
|
case 'basic':
|
|
1289
1323
|
if (auth.username || auth.password) {
|
|
1290
|
-
request.auth
|
|
1324
|
+
request.auth = {
|
|
1325
|
+
username: auth.username || '',
|
|
1326
|
+
password: auth.password || ''
|
|
1327
|
+
};
|
|
1291
1328
|
}
|
|
1292
1329
|
break;
|
|
1293
1330
|
case 'apiKey':
|
|
@@ -1299,15 +1336,15 @@ class ApiClient {
|
|
|
1299
1336
|
data[auth.name] = auth.apiKey;
|
|
1300
1337
|
}
|
|
1301
1338
|
if (auth['in'] === 'header') {
|
|
1302
|
-
request.
|
|
1339
|
+
request.headers = this.addHeaders(request.headers, data);
|
|
1303
1340
|
} else {
|
|
1304
|
-
request.
|
|
1341
|
+
request.params = this.serialize(data);
|
|
1305
1342
|
}
|
|
1306
1343
|
}
|
|
1307
1344
|
break;
|
|
1308
1345
|
case 'oauth2':
|
|
1309
1346
|
if (auth.accessToken) {
|
|
1310
|
-
request.
|
|
1347
|
+
request.headers = this.addHeaders(request.headers, {'Authorization': `Bearer ${auth.accessToken}`});
|
|
1311
1348
|
}
|
|
1312
1349
|
break;
|
|
1313
1350
|
default:
|
|
@@ -1336,86 +1373,71 @@ class ApiClient {
|
|
|
1336
1373
|
sendRequest(this);
|
|
1337
1374
|
function sendRequest(that) {
|
|
1338
1375
|
var url = that.buildUrl(path, pathParams);
|
|
1339
|
-
var request =
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1376
|
+
var request = {
|
|
1377
|
+
method: httpMethod,
|
|
1378
|
+
url: url,
|
|
1379
|
+
proxy: that.proxy,
|
|
1380
|
+
timeout: that.timeout,
|
|
1381
|
+
params: that.serialize(queryParams)
|
|
1382
|
+
};
|
|
1344
1383
|
|
|
1345
1384
|
// apply authentications
|
|
1346
1385
|
that.applyAuthToRequest(request, authNames);
|
|
1347
1386
|
|
|
1348
|
-
// set query parameters
|
|
1349
|
-
request.query(that.normalizeParams(queryParams));
|
|
1350
|
-
|
|
1351
1387
|
// set header parameters
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
// set request timeout
|
|
1356
|
-
request.timeout(that.timeout);
|
|
1388
|
+
const defaultHeaders = that.defaultHeaders;
|
|
1389
|
+
const normalizedHeaderParams = that.normalizeParams(headerParams);
|
|
1390
|
+
request.headers = that.addHeaders(request.headers, defaultHeaders, normalizedHeaderParams);
|
|
1357
1391
|
|
|
1358
1392
|
var contentType = that.jsonPreferredMime(contentTypes);
|
|
1359
1393
|
if (contentType) {
|
|
1360
|
-
request.
|
|
1361
|
-
} else if (!request.
|
|
1362
|
-
request.
|
|
1394
|
+
request.headers['Content-Type'] = contentType;
|
|
1395
|
+
} else if (!request.headers['Content-Type']) {
|
|
1396
|
+
request.headers['Content-Type'] = 'application/json';
|
|
1363
1397
|
}
|
|
1364
1398
|
|
|
1365
1399
|
if (contentType === 'application/x-www-form-urlencoded') {
|
|
1366
|
-
request.
|
|
1400
|
+
request.data = that.normalizeParams(formParams);
|
|
1367
1401
|
} else if (contentType == 'multipart/form-data') {
|
|
1368
1402
|
var _formParams = that.normalizeParams(formParams);
|
|
1369
1403
|
for (var key in _formParams) {
|
|
1370
1404
|
if (_formParams.hasOwnProperty(key)) {
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
request.field(key, _formParams[key]);
|
|
1376
|
-
}
|
|
1405
|
+
// Looks like axios handles files and forms the same way
|
|
1406
|
+
var formData = new FormData();
|
|
1407
|
+
formData.set(key, _formParams[key]);
|
|
1408
|
+
request.data = formData;
|
|
1377
1409
|
}
|
|
1378
1410
|
}
|
|
1379
1411
|
} else if (bodyParam) {
|
|
1380
|
-
request.
|
|
1412
|
+
request.data = bodyParam;
|
|
1381
1413
|
}
|
|
1382
1414
|
|
|
1383
1415
|
var accept = that.jsonPreferredMime(accepts);
|
|
1384
1416
|
if (accept) {
|
|
1385
|
-
request.accept
|
|
1417
|
+
request.headers['Accept'] = accept;
|
|
1386
1418
|
}
|
|
1387
|
-
request
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
error: error
|
|
1410
|
-
} : response.body ? response.body : response.text;
|
|
1411
|
-
|
|
1412
|
-
// Debug logging
|
|
1413
|
-
that.config.logger.log('trace', response.statusCode, httpMethod, url, request.header, response.headers, bodyParam, undefined);
|
|
1414
|
-
that.config.logger.log('debug', response.statusCode, httpMethod, url, request.header, undefined, bodyParam, undefined);
|
|
1415
|
-
|
|
1416
|
-
// Resolve promise
|
|
1417
|
-
if (error) {
|
|
1418
|
-
if (data.status == 401 && that.config.refresh_access_token && that.authData.refreshToken !== "") {
|
|
1419
|
+
axios__default["default"].request(request)
|
|
1420
|
+
.then((response) => {
|
|
1421
|
+
// Build response object
|
|
1422
|
+
var data = (that.returnExtended === true) ? {
|
|
1423
|
+
status: response.status,
|
|
1424
|
+
statusText: response.statusText,
|
|
1425
|
+
headers: response.headers,
|
|
1426
|
+
body: response.data,
|
|
1427
|
+
text: response.text,
|
|
1428
|
+
error: null
|
|
1429
|
+
} : response.data ? response.data : response.text;
|
|
1430
|
+
|
|
1431
|
+
// Debug logging
|
|
1432
|
+
that.config.logger.log('trace', response.status, httpMethod, url, request.headers, response.headers, bodyParam, undefined);
|
|
1433
|
+
that.config.logger.log('debug', response.status, httpMethod, url, request.headers, undefined, bodyParam, undefined);
|
|
1434
|
+
|
|
1435
|
+
// Resolve promise
|
|
1436
|
+
resolve(data);
|
|
1437
|
+
})
|
|
1438
|
+
.catch((error) => {
|
|
1439
|
+
var data = error;
|
|
1440
|
+
if (error.response && error.response.status == 401 && that.config.refresh_access_token && that.authData.refreshToken !== "") {
|
|
1419
1441
|
that._handleExpiredAccessToken()
|
|
1420
1442
|
.then(() => {
|
|
1421
1443
|
sendRequest(that);
|
|
@@ -1423,24 +1445,29 @@ class ApiClient {
|
|
|
1423
1445
|
.catch((err) => {
|
|
1424
1446
|
reject(err);
|
|
1425
1447
|
});
|
|
1426
|
-
} else {
|
|
1448
|
+
} else if (error.response) {
|
|
1427
1449
|
// Log error
|
|
1428
1450
|
that.config.logger.log(
|
|
1429
1451
|
'error',
|
|
1430
|
-
response.
|
|
1452
|
+
error.response.status,
|
|
1431
1453
|
httpMethod,
|
|
1432
1454
|
url,
|
|
1433
|
-
request.
|
|
1434
|
-
response.headers,
|
|
1455
|
+
request.headers,
|
|
1456
|
+
error.response.headers,
|
|
1435
1457
|
bodyParam,
|
|
1436
|
-
response.
|
|
1458
|
+
error.response.data
|
|
1437
1459
|
);
|
|
1438
|
-
|
|
1460
|
+
data = (that.returnExtended === true) ? {
|
|
1461
|
+
status: error.response.status,
|
|
1462
|
+
statusText: error.response.statusText,
|
|
1463
|
+
headers: error.response.headers,
|
|
1464
|
+
body: error.response.data,
|
|
1465
|
+
text: error.response.text,
|
|
1466
|
+
error: error
|
|
1467
|
+
} : error.response.data ? error.response.data : error.response.text;
|
|
1439
1468
|
}
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
}
|
|
1443
|
-
});
|
|
1469
|
+
reject(data);
|
|
1470
|
+
});
|
|
1444
1471
|
}
|
|
1445
1472
|
});
|
|
1446
1473
|
}
|
|
@@ -1450,7 +1477,7 @@ class AlertingApi {
|
|
|
1450
1477
|
/**
|
|
1451
1478
|
* Alerting service.
|
|
1452
1479
|
* @module purecloud-platform-client-v2/api/AlertingApi
|
|
1453
|
-
* @version
|
|
1480
|
+
* @version 138.0.1
|
|
1454
1481
|
*/
|
|
1455
1482
|
|
|
1456
1483
|
/**
|
|
@@ -1764,7 +1791,7 @@ class AnalyticsApi {
|
|
|
1764
1791
|
/**
|
|
1765
1792
|
* Analytics service.
|
|
1766
1793
|
* @module purecloud-platform-client-v2/api/AnalyticsApi
|
|
1767
|
-
* @version
|
|
1794
|
+
* @version 138.0.1
|
|
1768
1795
|
*/
|
|
1769
1796
|
|
|
1770
1797
|
/**
|
|
@@ -2946,7 +2973,7 @@ class ArchitectApi {
|
|
|
2946
2973
|
/**
|
|
2947
2974
|
* Architect service.
|
|
2948
2975
|
* @module purecloud-platform-client-v2/api/ArchitectApi
|
|
2949
|
-
* @version
|
|
2976
|
+
* @version 138.0.1
|
|
2950
2977
|
*/
|
|
2951
2978
|
|
|
2952
2979
|
/**
|
|
@@ -5991,7 +6018,7 @@ class AuditApi {
|
|
|
5991
6018
|
/**
|
|
5992
6019
|
* Audit service.
|
|
5993
6020
|
* @module purecloud-platform-client-v2/api/AuditApi
|
|
5994
|
-
* @version
|
|
6021
|
+
* @version 138.0.1
|
|
5995
6022
|
*/
|
|
5996
6023
|
|
|
5997
6024
|
/**
|
|
@@ -6162,7 +6189,7 @@ class AuthorizationApi {
|
|
|
6162
6189
|
/**
|
|
6163
6190
|
* Authorization service.
|
|
6164
6191
|
* @module purecloud-platform-client-v2/api/AuthorizationApi
|
|
6165
|
-
* @version
|
|
6192
|
+
* @version 138.0.1
|
|
6166
6193
|
*/
|
|
6167
6194
|
|
|
6168
6195
|
/**
|
|
@@ -7345,7 +7372,7 @@ class BillingApi {
|
|
|
7345
7372
|
/**
|
|
7346
7373
|
* Billing service.
|
|
7347
7374
|
* @module purecloud-platform-client-v2/api/BillingApi
|
|
7348
|
-
* @version
|
|
7375
|
+
* @version 138.0.1
|
|
7349
7376
|
*/
|
|
7350
7377
|
|
|
7351
7378
|
/**
|
|
@@ -7425,7 +7452,7 @@ class ChatApi {
|
|
|
7425
7452
|
/**
|
|
7426
7453
|
* Chat service.
|
|
7427
7454
|
* @module purecloud-platform-client-v2/api/ChatApi
|
|
7428
|
-
* @version
|
|
7455
|
+
* @version 138.0.1
|
|
7429
7456
|
*/
|
|
7430
7457
|
|
|
7431
7458
|
/**
|
|
@@ -7516,7 +7543,7 @@ class CoachingApi {
|
|
|
7516
7543
|
/**
|
|
7517
7544
|
* Coaching service.
|
|
7518
7545
|
* @module purecloud-platform-client-v2/api/CoachingApi
|
|
7519
|
-
* @version
|
|
7546
|
+
* @version 138.0.1
|
|
7520
7547
|
*/
|
|
7521
7548
|
|
|
7522
7549
|
/**
|
|
@@ -8093,7 +8120,7 @@ class ContentManagementApi {
|
|
|
8093
8120
|
/**
|
|
8094
8121
|
* ContentManagement service.
|
|
8095
8122
|
* @module purecloud-platform-client-v2/api/ContentManagementApi
|
|
8096
|
-
* @version
|
|
8123
|
+
* @version 138.0.1
|
|
8097
8124
|
*/
|
|
8098
8125
|
|
|
8099
8126
|
/**
|
|
@@ -9233,7 +9260,7 @@ class ConversationsApi {
|
|
|
9233
9260
|
/**
|
|
9234
9261
|
* Conversations service.
|
|
9235
9262
|
* @module purecloud-platform-client-v2/api/ConversationsApi
|
|
9236
|
-
* @version
|
|
9263
|
+
* @version 138.0.1
|
|
9237
9264
|
*/
|
|
9238
9265
|
|
|
9239
9266
|
/**
|
|
@@ -13897,7 +13924,7 @@ class DataExtensionsApi {
|
|
|
13897
13924
|
/**
|
|
13898
13925
|
* DataExtensions service.
|
|
13899
13926
|
* @module purecloud-platform-client-v2/api/DataExtensionsApi
|
|
13900
|
-
* @version
|
|
13927
|
+
* @version 138.0.1
|
|
13901
13928
|
*/
|
|
13902
13929
|
|
|
13903
13930
|
/**
|
|
@@ -13983,7 +14010,7 @@ class ExternalContactsApi {
|
|
|
13983
14010
|
/**
|
|
13984
14011
|
* ExternalContacts service.
|
|
13985
14012
|
* @module purecloud-platform-client-v2/api/ExternalContactsApi
|
|
13986
|
-
* @version
|
|
14013
|
+
* @version 138.0.1
|
|
13987
14014
|
*/
|
|
13988
14015
|
|
|
13989
14016
|
/**
|
|
@@ -15726,7 +15753,7 @@ class FaxApi {
|
|
|
15726
15753
|
/**
|
|
15727
15754
|
* Fax service.
|
|
15728
15755
|
* @module purecloud-platform-client-v2/api/FaxApi
|
|
15729
|
-
* @version
|
|
15756
|
+
* @version 138.0.1
|
|
15730
15757
|
*/
|
|
15731
15758
|
|
|
15732
15759
|
/**
|
|
@@ -15897,7 +15924,7 @@ class FlowsApi {
|
|
|
15897
15924
|
/**
|
|
15898
15925
|
* Flows service.
|
|
15899
15926
|
* @module purecloud-platform-client-v2/api/FlowsApi
|
|
15900
|
-
* @version
|
|
15927
|
+
* @version 138.0.1
|
|
15901
15928
|
*/
|
|
15902
15929
|
|
|
15903
15930
|
/**
|
|
@@ -15968,7 +15995,7 @@ class GamificationApi {
|
|
|
15968
15995
|
/**
|
|
15969
15996
|
* Gamification service.
|
|
15970
15997
|
* @module purecloud-platform-client-v2/api/GamificationApi
|
|
15971
|
-
* @version
|
|
15998
|
+
* @version 138.0.1
|
|
15972
15999
|
*/
|
|
15973
16000
|
|
|
15974
16001
|
/**
|
|
@@ -17398,7 +17425,7 @@ class GeneralDataProtectionRegulationApi {
|
|
|
17398
17425
|
/**
|
|
17399
17426
|
* GeneralDataProtectionRegulation service.
|
|
17400
17427
|
* @module purecloud-platform-client-v2/api/GeneralDataProtectionRegulationApi
|
|
17401
|
-
* @version
|
|
17428
|
+
* @version 138.0.1
|
|
17402
17429
|
*/
|
|
17403
17430
|
|
|
17404
17431
|
/**
|
|
@@ -17528,7 +17555,7 @@ class GeolocationApi {
|
|
|
17528
17555
|
/**
|
|
17529
17556
|
* Geolocation service.
|
|
17530
17557
|
* @module purecloud-platform-client-v2/api/GeolocationApi
|
|
17531
|
-
* @version
|
|
17558
|
+
* @version 138.0.1
|
|
17532
17559
|
*/
|
|
17533
17560
|
|
|
17534
17561
|
/**
|
|
@@ -17659,7 +17686,7 @@ class GreetingsApi {
|
|
|
17659
17686
|
/**
|
|
17660
17687
|
* Greetings service.
|
|
17661
17688
|
* @module purecloud-platform-client-v2/api/GreetingsApi
|
|
17662
|
-
* @version
|
|
17689
|
+
* @version 138.0.1
|
|
17663
17690
|
*/
|
|
17664
17691
|
|
|
17665
17692
|
/**
|
|
@@ -18114,7 +18141,7 @@ class GroupsApi {
|
|
|
18114
18141
|
/**
|
|
18115
18142
|
* Groups service.
|
|
18116
18143
|
* @module purecloud-platform-client-v2/api/GroupsApi
|
|
18117
|
-
* @version
|
|
18144
|
+
* @version 138.0.1
|
|
18118
18145
|
*/
|
|
18119
18146
|
|
|
18120
18147
|
/**
|
|
@@ -18519,7 +18546,7 @@ class IdentityProviderApi {
|
|
|
18519
18546
|
/**
|
|
18520
18547
|
* IdentityProvider service.
|
|
18521
18548
|
* @module purecloud-platform-client-v2/api/IdentityProviderApi
|
|
18522
|
-
* @version
|
|
18549
|
+
* @version 138.0.1
|
|
18523
18550
|
*/
|
|
18524
18551
|
|
|
18525
18552
|
/**
|
|
@@ -19275,7 +19302,7 @@ class IntegrationsApi {
|
|
|
19275
19302
|
/**
|
|
19276
19303
|
* Integrations service.
|
|
19277
19304
|
* @module purecloud-platform-client-v2/api/IntegrationsApi
|
|
19278
|
-
* @version
|
|
19305
|
+
* @version 138.0.1
|
|
19279
19306
|
*/
|
|
19280
19307
|
|
|
19281
19308
|
/**
|
|
@@ -20952,7 +20979,7 @@ class JourneyApi {
|
|
|
20952
20979
|
/**
|
|
20953
20980
|
* Journey service.
|
|
20954
20981
|
* @module purecloud-platform-client-v2/api/JourneyApi
|
|
20955
|
-
* @version
|
|
20982
|
+
* @version 138.0.1
|
|
20956
20983
|
*/
|
|
20957
20984
|
|
|
20958
20985
|
/**
|
|
@@ -21663,7 +21690,7 @@ class KnowledgeApi {
|
|
|
21663
21690
|
/**
|
|
21664
21691
|
* Knowledge service.
|
|
21665
21692
|
* @module purecloud-platform-client-v2/api/KnowledgeApi
|
|
21666
|
-
* @version
|
|
21693
|
+
* @version 138.0.1
|
|
21667
21694
|
*/
|
|
21668
21695
|
|
|
21669
21696
|
/**
|
|
@@ -22563,7 +22590,7 @@ class LanguageUnderstandingApi {
|
|
|
22563
22590
|
/**
|
|
22564
22591
|
* LanguageUnderstanding service.
|
|
22565
22592
|
* @module purecloud-platform-client-v2/api/LanguageUnderstandingApi
|
|
22566
|
-
* @version
|
|
22593
|
+
* @version 138.0.1
|
|
22567
22594
|
*/
|
|
22568
22595
|
|
|
22569
22596
|
/**
|
|
@@ -23467,7 +23494,7 @@ class LanguagesApi {
|
|
|
23467
23494
|
/**
|
|
23468
23495
|
* Languages service.
|
|
23469
23496
|
* @module purecloud-platform-client-v2/api/LanguagesApi
|
|
23470
|
-
* @version
|
|
23497
|
+
* @version 138.0.1
|
|
23471
23498
|
*/
|
|
23472
23499
|
|
|
23473
23500
|
/**
|
|
@@ -23735,7 +23762,7 @@ class LearningApi {
|
|
|
23735
23762
|
/**
|
|
23736
23763
|
* Learning service.
|
|
23737
23764
|
* @module purecloud-platform-client-v2/api/LearningApi
|
|
23738
|
-
* @version
|
|
23765
|
+
* @version 138.0.1
|
|
23739
23766
|
*/
|
|
23740
23767
|
|
|
23741
23768
|
/**
|
|
@@ -24326,7 +24353,7 @@ class LicenseApi {
|
|
|
24326
24353
|
/**
|
|
24327
24354
|
* License service.
|
|
24328
24355
|
* @module purecloud-platform-client-v2/api/LicenseApi
|
|
24329
|
-
* @version
|
|
24356
|
+
* @version 138.0.1
|
|
24330
24357
|
*/
|
|
24331
24358
|
|
|
24332
24359
|
/**
|
|
@@ -24564,7 +24591,7 @@ class LocationsApi {
|
|
|
24564
24591
|
/**
|
|
24565
24592
|
* Locations service.
|
|
24566
24593
|
* @module purecloud-platform-client-v2/api/LocationsApi
|
|
24567
|
-
* @version
|
|
24594
|
+
* @version 138.0.1
|
|
24568
24595
|
*/
|
|
24569
24596
|
|
|
24570
24597
|
/**
|
|
@@ -24800,7 +24827,7 @@ class MessagingApi {
|
|
|
24800
24827
|
/**
|
|
24801
24828
|
* Messaging service.
|
|
24802
24829
|
* @module purecloud-platform-client-v2/api/MessagingApi
|
|
24803
|
-
* @version
|
|
24830
|
+
* @version 138.0.1
|
|
24804
24831
|
*/
|
|
24805
24832
|
|
|
24806
24833
|
/**
|
|
@@ -24951,7 +24978,7 @@ class MobileDevicesApi {
|
|
|
24951
24978
|
/**
|
|
24952
24979
|
* MobileDevices service.
|
|
24953
24980
|
* @module purecloud-platform-client-v2/api/MobileDevicesApi
|
|
24954
|
-
* @version
|
|
24981
|
+
* @version 138.0.1
|
|
24955
24982
|
*/
|
|
24956
24983
|
|
|
24957
24984
|
/**
|
|
@@ -25102,7 +25129,7 @@ class NotificationsApi {
|
|
|
25102
25129
|
/**
|
|
25103
25130
|
* Notifications service.
|
|
25104
25131
|
* @module purecloud-platform-client-v2/api/NotificationsApi
|
|
25105
|
-
* @version
|
|
25132
|
+
* @version 138.0.1
|
|
25106
25133
|
*/
|
|
25107
25134
|
|
|
25108
25135
|
/**
|
|
@@ -25327,7 +25354,7 @@ class OAuthApi {
|
|
|
25327
25354
|
/**
|
|
25328
25355
|
* OAuth service.
|
|
25329
25356
|
* @module purecloud-platform-client-v2/api/OAuthApi
|
|
25330
|
-
* @version
|
|
25357
|
+
* @version 138.0.1
|
|
25331
25358
|
*/
|
|
25332
25359
|
|
|
25333
25360
|
/**
|
|
@@ -25693,7 +25720,7 @@ class ObjectsApi {
|
|
|
25693
25720
|
/**
|
|
25694
25721
|
* Objects service.
|
|
25695
25722
|
* @module purecloud-platform-client-v2/api/ObjectsApi
|
|
25696
|
-
* @version
|
|
25723
|
+
* @version 138.0.1
|
|
25697
25724
|
*/
|
|
25698
25725
|
|
|
25699
25726
|
/**
|
|
@@ -25964,7 +25991,7 @@ class OrganizationApi {
|
|
|
25964
25991
|
/**
|
|
25965
25992
|
* Organization service.
|
|
25966
25993
|
* @module purecloud-platform-client-v2/api/OrganizationApi
|
|
25967
|
-
* @version
|
|
25994
|
+
* @version 138.0.1
|
|
25968
25995
|
*/
|
|
25969
25996
|
|
|
25970
25997
|
/**
|
|
@@ -26367,7 +26394,7 @@ class OrganizationAuthorizationApi {
|
|
|
26367
26394
|
/**
|
|
26368
26395
|
* OrganizationAuthorization service.
|
|
26369
26396
|
* @module purecloud-platform-client-v2/api/OrganizationAuthorizationApi
|
|
26370
|
-
* @version
|
|
26397
|
+
* @version 138.0.1
|
|
26371
26398
|
*/
|
|
26372
26399
|
|
|
26373
26400
|
/**
|
|
@@ -27292,7 +27319,7 @@ class OutboundApi {
|
|
|
27292
27319
|
/**
|
|
27293
27320
|
* Outbound service.
|
|
27294
27321
|
* @module purecloud-platform-client-v2/api/OutboundApi
|
|
27295
|
-
* @version
|
|
27322
|
+
* @version 138.0.1
|
|
27296
27323
|
*/
|
|
27297
27324
|
|
|
27298
27325
|
/**
|
|
@@ -30547,7 +30574,7 @@ class PresenceApi {
|
|
|
30547
30574
|
/**
|
|
30548
30575
|
* Presence service.
|
|
30549
30576
|
* @module purecloud-platform-client-v2/api/PresenceApi
|
|
30550
|
-
* @version
|
|
30577
|
+
* @version 138.0.1
|
|
30551
30578
|
*/
|
|
30552
30579
|
|
|
30553
30580
|
/**
|
|
@@ -30869,7 +30896,7 @@ class QualityApi {
|
|
|
30869
30896
|
/**
|
|
30870
30897
|
* Quality service.
|
|
30871
30898
|
* @module purecloud-platform-client-v2/api/QualityApi
|
|
30872
|
-
* @version
|
|
30899
|
+
* @version 138.0.1
|
|
30873
30900
|
*/
|
|
30874
30901
|
|
|
30875
30902
|
/**
|
|
@@ -32447,7 +32474,7 @@ class RecordingApi {
|
|
|
32447
32474
|
/**
|
|
32448
32475
|
* Recording service.
|
|
32449
32476
|
* @module purecloud-platform-client-v2/api/RecordingApi
|
|
32450
|
-
* @version
|
|
32477
|
+
* @version 138.0.1
|
|
32451
32478
|
*/
|
|
32452
32479
|
|
|
32453
32480
|
/**
|
|
@@ -34100,7 +34127,7 @@ class ResponseManagementApi {
|
|
|
34100
34127
|
/**
|
|
34101
34128
|
* ResponseManagement service.
|
|
34102
34129
|
* @module purecloud-platform-client-v2/api/ResponseManagementApi
|
|
34103
|
-
* @version
|
|
34130
|
+
* @version 138.0.1
|
|
34104
34131
|
*/
|
|
34105
34132
|
|
|
34106
34133
|
/**
|
|
@@ -34584,7 +34611,7 @@ class RoutingApi {
|
|
|
34584
34611
|
/**
|
|
34585
34612
|
* Routing service.
|
|
34586
34613
|
* @module purecloud-platform-client-v2/api/RoutingApi
|
|
34587
|
-
* @version
|
|
34614
|
+
* @version 138.0.1
|
|
34588
34615
|
*/
|
|
34589
34616
|
|
|
34590
34617
|
/**
|
|
@@ -37511,7 +37538,7 @@ class SCIMApi {
|
|
|
37511
37538
|
/**
|
|
37512
37539
|
* SCIM service.
|
|
37513
37540
|
* @module purecloud-platform-client-v2/api/SCIMApi
|
|
37514
|
-
* @version
|
|
37541
|
+
* @version 138.0.1
|
|
37515
37542
|
*/
|
|
37516
37543
|
|
|
37517
37544
|
/**
|
|
@@ -38388,7 +38415,7 @@ class ScriptsApi {
|
|
|
38388
38415
|
/**
|
|
38389
38416
|
* Scripts service.
|
|
38390
38417
|
* @module purecloud-platform-client-v2/api/ScriptsApi
|
|
38391
|
-
* @version
|
|
38418
|
+
* @version 138.0.1
|
|
38392
38419
|
*/
|
|
38393
38420
|
|
|
38394
38421
|
/**
|
|
@@ -38716,9 +38743,9 @@ class ScriptsApi {
|
|
|
38716
38743
|
*
|
|
38717
38744
|
* @param {String} scriptId Script ID
|
|
38718
38745
|
* @param {Object} opts Optional parameters
|
|
38719
|
-
* @param {
|
|
38720
|
-
* @param {
|
|
38721
|
-
* @param {
|
|
38746
|
+
* @param {Object} opts.input input
|
|
38747
|
+
* @param {Object} opts.output output
|
|
38748
|
+
* @param {Object} opts.type type
|
|
38722
38749
|
* @param {String} opts.scriptDataVersion Advanced usage - controls the data version of the script
|
|
38723
38750
|
*/
|
|
38724
38751
|
getScriptsPublishedScriptIdVariables(scriptId, opts) {
|
|
@@ -38807,7 +38834,7 @@ class SearchApi {
|
|
|
38807
38834
|
/**
|
|
38808
38835
|
* Search service.
|
|
38809
38836
|
* @module purecloud-platform-client-v2/api/SearchApi
|
|
38810
|
-
* @version
|
|
38837
|
+
* @version 138.0.1
|
|
38811
38838
|
*/
|
|
38812
38839
|
|
|
38813
38840
|
/**
|
|
@@ -39342,7 +39369,7 @@ class SpeechTextAnalyticsApi {
|
|
|
39342
39369
|
/**
|
|
39343
39370
|
* SpeechTextAnalytics service.
|
|
39344
39371
|
* @module purecloud-platform-client-v2/api/SpeechTextAnalyticsApi
|
|
39345
|
-
* @version
|
|
39372
|
+
* @version 138.0.1
|
|
39346
39373
|
*/
|
|
39347
39374
|
|
|
39348
39375
|
/**
|
|
@@ -40195,7 +40222,7 @@ class StationsApi {
|
|
|
40195
40222
|
/**
|
|
40196
40223
|
* Stations service.
|
|
40197
40224
|
* @module purecloud-platform-client-v2/api/StationsApi
|
|
40198
|
-
* @version
|
|
40225
|
+
* @version 138.0.1
|
|
40199
40226
|
*/
|
|
40200
40227
|
|
|
40201
40228
|
/**
|
|
@@ -40342,7 +40369,7 @@ class SuggestApi {
|
|
|
40342
40369
|
/**
|
|
40343
40370
|
* Suggest service.
|
|
40344
40371
|
* @module purecloud-platform-client-v2/api/SuggestApi
|
|
40345
|
-
* @version
|
|
40372
|
+
* @version 138.0.1
|
|
40346
40373
|
*/
|
|
40347
40374
|
|
|
40348
40375
|
/**
|
|
@@ -40481,7 +40508,7 @@ class TelephonyApi {
|
|
|
40481
40508
|
/**
|
|
40482
40509
|
* Telephony service.
|
|
40483
40510
|
* @module purecloud-platform-client-v2/api/TelephonyApi
|
|
40484
|
-
* @version
|
|
40511
|
+
* @version 138.0.1
|
|
40485
40512
|
*/
|
|
40486
40513
|
|
|
40487
40514
|
/**
|
|
@@ -40589,7 +40616,7 @@ class TelephonyProvidersEdgeApi {
|
|
|
40589
40616
|
/**
|
|
40590
40617
|
* TelephonyProvidersEdge service.
|
|
40591
40618
|
* @module purecloud-platform-client-v2/api/TelephonyProvidersEdgeApi
|
|
40592
|
-
* @version
|
|
40619
|
+
* @version 138.0.1
|
|
40593
40620
|
*/
|
|
40594
40621
|
|
|
40595
40622
|
/**
|
|
@@ -44222,7 +44249,7 @@ class TextbotsApi {
|
|
|
44222
44249
|
/**
|
|
44223
44250
|
* Textbots service.
|
|
44224
44251
|
* @module purecloud-platform-client-v2/api/TextbotsApi
|
|
44225
|
-
* @version
|
|
44252
|
+
* @version 138.0.1
|
|
44226
44253
|
*/
|
|
44227
44254
|
|
|
44228
44255
|
/**
|
|
@@ -44350,7 +44377,7 @@ class TokensApi {
|
|
|
44350
44377
|
/**
|
|
44351
44378
|
* Tokens service.
|
|
44352
44379
|
* @module purecloud-platform-client-v2/api/TokensApi
|
|
44353
|
-
* @version
|
|
44380
|
+
* @version 138.0.1
|
|
44354
44381
|
*/
|
|
44355
44382
|
|
|
44356
44383
|
/**
|
|
@@ -44456,7 +44483,7 @@ class UploadsApi {
|
|
|
44456
44483
|
/**
|
|
44457
44484
|
* Uploads service.
|
|
44458
44485
|
* @module purecloud-platform-client-v2/api/UploadsApi
|
|
44459
|
-
* @version
|
|
44486
|
+
* @version 138.0.1
|
|
44460
44487
|
*/
|
|
44461
44488
|
|
|
44462
44489
|
/**
|
|
@@ -44607,7 +44634,7 @@ class UsageApi {
|
|
|
44607
44634
|
/**
|
|
44608
44635
|
* Usage service.
|
|
44609
44636
|
* @module purecloud-platform-client-v2/api/UsageApi
|
|
44610
|
-
* @version
|
|
44637
|
+
* @version 138.0.1
|
|
44611
44638
|
*/
|
|
44612
44639
|
|
|
44613
44640
|
/**
|
|
@@ -44678,7 +44705,7 @@ class UserRecordingsApi {
|
|
|
44678
44705
|
/**
|
|
44679
44706
|
* UserRecordings service.
|
|
44680
44707
|
* @module purecloud-platform-client-v2/api/UserRecordingsApi
|
|
44681
|
-
* @version
|
|
44708
|
+
* @version 138.0.1
|
|
44682
44709
|
*/
|
|
44683
44710
|
|
|
44684
44711
|
/**
|
|
@@ -44862,7 +44889,7 @@ class UsersApi {
|
|
|
44862
44889
|
/**
|
|
44863
44890
|
* Users service.
|
|
44864
44891
|
* @module purecloud-platform-client-v2/api/UsersApi
|
|
44865
|
-
* @version
|
|
44892
|
+
* @version 138.0.1
|
|
44866
44893
|
*/
|
|
44867
44894
|
|
|
44868
44895
|
/**
|
|
@@ -47164,7 +47191,7 @@ class UtilitiesApi {
|
|
|
47164
47191
|
/**
|
|
47165
47192
|
* Utilities service.
|
|
47166
47193
|
* @module purecloud-platform-client-v2/api/UtilitiesApi
|
|
47167
|
-
* @version
|
|
47194
|
+
* @version 138.0.1
|
|
47168
47195
|
*/
|
|
47169
47196
|
|
|
47170
47197
|
/**
|
|
@@ -47275,7 +47302,7 @@ class VoicemailApi {
|
|
|
47275
47302
|
/**
|
|
47276
47303
|
* Voicemail service.
|
|
47277
47304
|
* @module purecloud-platform-client-v2/api/VoicemailApi
|
|
47278
|
-
* @version
|
|
47305
|
+
* @version 138.0.1
|
|
47279
47306
|
*/
|
|
47280
47307
|
|
|
47281
47308
|
/**
|
|
@@ -47942,7 +47969,7 @@ class WebChatApi {
|
|
|
47942
47969
|
/**
|
|
47943
47970
|
* WebChat service.
|
|
47944
47971
|
* @module purecloud-platform-client-v2/api/WebChatApi
|
|
47945
|
-
* @version
|
|
47972
|
+
* @version 138.0.1
|
|
47946
47973
|
*/
|
|
47947
47974
|
|
|
47948
47975
|
/**
|
|
@@ -48486,7 +48513,7 @@ class WebDeploymentsApi {
|
|
|
48486
48513
|
/**
|
|
48487
48514
|
* WebDeployments service.
|
|
48488
48515
|
* @module purecloud-platform-client-v2/api/WebDeploymentsApi
|
|
48489
|
-
* @version
|
|
48516
|
+
* @version 138.0.1
|
|
48490
48517
|
*/
|
|
48491
48518
|
|
|
48492
48519
|
/**
|
|
@@ -48841,7 +48868,7 @@ class WebMessagingApi {
|
|
|
48841
48868
|
/**
|
|
48842
48869
|
* WebMessaging service.
|
|
48843
48870
|
* @module purecloud-platform-client-v2/api/WebMessagingApi
|
|
48844
|
-
* @version
|
|
48871
|
+
* @version 138.0.1
|
|
48845
48872
|
*/
|
|
48846
48873
|
|
|
48847
48874
|
/**
|
|
@@ -48887,7 +48914,7 @@ class WidgetsApi {
|
|
|
48887
48914
|
/**
|
|
48888
48915
|
* Widgets service.
|
|
48889
48916
|
* @module purecloud-platform-client-v2/api/WidgetsApi
|
|
48890
|
-
* @version
|
|
48917
|
+
* @version 138.0.1
|
|
48891
48918
|
*/
|
|
48892
48919
|
|
|
48893
48920
|
/**
|
|
@@ -49033,7 +49060,7 @@ class WorkforceManagementApi {
|
|
|
49033
49060
|
/**
|
|
49034
49061
|
* WorkforceManagement service.
|
|
49035
49062
|
* @module purecloud-platform-client-v2/api/WorkforceManagementApi
|
|
49036
|
-
* @version
|
|
49063
|
+
* @version 138.0.1
|
|
49037
49064
|
*/
|
|
49038
49065
|
|
|
49039
49066
|
/**
|
|
@@ -51792,8 +51819,8 @@ class WorkforceManagementApi {
|
|
|
51792
51819
|
*
|
|
51793
51820
|
* @param {String} businessUnitId The ID of the business unit
|
|
51794
51821
|
* @param {Object} opts Optional parameters
|
|
51795
|
-
* @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification.
|
|
51796
|
-
* @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service.
|
|
51822
|
+
* @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification. For testing/app development purposes
|
|
51823
|
+
* @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service. For testing/app development purposes
|
|
51797
51824
|
* @param {Object} opts.body body
|
|
51798
51825
|
*/
|
|
51799
51826
|
postWorkforcemanagementBusinessunitAgentschedulesSearch(businessUnitId, opts) {
|
|
@@ -51914,8 +51941,8 @@ class WorkforceManagementApi {
|
|
|
51914
51941
|
* @param {String} scheduleId The ID of the schedule
|
|
51915
51942
|
* @param {Object} body body
|
|
51916
51943
|
* @param {Object} opts Optional parameters
|
|
51917
|
-
* @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification.
|
|
51918
|
-
* @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service.
|
|
51944
|
+
* @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification. For testing/app development purposes
|
|
51945
|
+
* @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service. For testing/app development purposes
|
|
51919
51946
|
*/
|
|
51920
51947
|
postWorkforcemanagementBusinessunitWeekScheduleAgentschedulesQuery(businessUnitId, weekId, scheduleId, body, opts) {
|
|
51921
51948
|
opts = opts || {};
|
|
@@ -52501,8 +52528,8 @@ class WorkforceManagementApi {
|
|
|
52501
52528
|
*
|
|
52502
52529
|
* @param {String} managementUnitId The ID of the management unit, or 'mine' for the management unit of the logged-in user.
|
|
52503
52530
|
* @param {Object} opts Optional parameters
|
|
52504
|
-
* @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification.
|
|
52505
|
-
* @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service.
|
|
52531
|
+
* @param {Boolean} opts.forceAsync Force the result of this operation to be sent asynchronously via notification. For testing/app development purposes
|
|
52532
|
+
* @param {Boolean} opts.forceDownloadService Force the result of this operation to be sent via download service. For testing/app development purposes
|
|
52506
52533
|
* @param {Object} opts.body body
|
|
52507
52534
|
*/
|
|
52508
52535
|
postWorkforcemanagementManagementunitAgentschedulesSearch(managementUnitId, opts) {
|
|
@@ -53284,7 +53311,7 @@ class WorkforceManagementApi {
|
|
|
53284
53311
|
* </pre>
|
|
53285
53312
|
* </p>
|
|
53286
53313
|
* @module purecloud-platform-client-v2/index
|
|
53287
|
-
* @version
|
|
53314
|
+
* @version 138.0.1
|
|
53288
53315
|
*/
|
|
53289
53316
|
class platformClient {
|
|
53290
53317
|
constructor() {
|