purecloud-platform-client-v2 183.0.0 → 185.0.0
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 +68 -2
- package/dist/node/purecloud-platform-client-v2.js +1395 -92
- package/dist/web-amd/purecloud-platform-client-v2.js +1395 -92
- package/dist/web-amd/purecloud-platform-client-v2.min.js +1 -1
- package/dist/web-cjs/bundle.js +411 -107
- package/dist/web-cjs/purecloud-platform-client-v2.js +411 -107
- package/dist/web-cjs/purecloud-platform-client-v2.min.js +1 -1
- package/index.d.ts +823 -54
- package/package.json +1 -1
- package/src/purecloud-platform-client-v2/ApiClient.js +334 -1
- package/src/purecloud-platform-client-v2/api/AlertingApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/AnalyticsApi.js +109 -1
- package/src/purecloud-platform-client-v2/api/ArchitectApi.js +3 -3
- package/src/purecloud-platform-client-v2/api/AuditApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/AuthorizationApi.js +8 -9
- package/src/purecloud-platform-client-v2/api/BillingApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/CarrierServicesApi.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/DownloadsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/EmailsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/EventsApi.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/InfrastructureAsCodeApi.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/LogCaptureApi.js +75 -0
- 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 +7 -8
- package/src/purecloud-platform-client-v2/api/OperationalEventsApi.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 +401 -1
- package/src/purecloud-platform-client-v2/api/PresenceApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/ProcessAutomationApi.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 +168 -1
- package/src/purecloud-platform-client-v2/api/SCIMApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/ScriptsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/SearchApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/SettingsApi.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/TaskManagementApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/TeamsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/TelephonyApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/TelephonyProvidersEdgeApi.js +3 -2
- 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 +222 -1
- package/src/purecloud-platform-client-v2/index.js +7 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ For direct use in a browser script:
|
|
|
31
31
|
|
|
32
32
|
```html
|
|
33
33
|
<!-- Include the CJS SDK -->
|
|
34
|
-
<script src="https://sdk-cdn.mypurecloud.com/javascript/
|
|
34
|
+
<script src="https://sdk-cdn.mypurecloud.com/javascript/185.0.0/purecloud-platform-client-v2.min.js"></script>
|
|
35
35
|
|
|
36
36
|
<script type="text/javascript">
|
|
37
37
|
// Obtain a reference to the platformClient object
|
|
@@ -48,7 +48,7 @@ For direct use in a browser script:
|
|
|
48
48
|
|
|
49
49
|
<script type="text/javascript">
|
|
50
50
|
// Obtain a reference to the platformClient object
|
|
51
|
-
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/
|
|
51
|
+
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/185.0.0/purecloud-platform-client-v2.min.js'], (platformClient) => {
|
|
52
52
|
console.log(platformClient);
|
|
53
53
|
});
|
|
54
54
|
</script>
|
|
@@ -160,6 +160,72 @@ client.refreshCodeAuthorizationGrant(clientId,clientSecret,refreshToken)
|
|
|
160
160
|
});
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
+
**Node.js** [PKCE Grant](https://developer.genesys.cloud/authorization/platform-auth/use-pkce)
|
|
164
|
+
|
|
165
|
+
```javascript
|
|
166
|
+
const client = platformClient.ApiClient.instance;
|
|
167
|
+
client.authorizePKCEGrant(clientId,codeVerifier,authCode,redirectUri)
|
|
168
|
+
.then(() => {
|
|
169
|
+
// Do authenticated things
|
|
170
|
+
})
|
|
171
|
+
.catch((err) => {
|
|
172
|
+
// Handle failure response
|
|
173
|
+
console.log(err);
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The SDK also provides methods to generate a PKCE Code Verifier and to compute PKCE Code Challenge.
|
|
178
|
+
**This requires Node version 18 (or above). The generatePKCECodeVerifier and computePKCECodeChallenge methods will fail with older Node versions.**
|
|
179
|
+
|
|
180
|
+
```javascript
|
|
181
|
+
let codeVerifier = client.generatePKCECodeVerifier(128);
|
|
182
|
+
let codeChallenge = await client.computePKCECodeChallenge(codeVerifier);
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Web** [PKCE Grant](https://developer.genesys.cloud/authorization/platform-auth/use-pkce)
|
|
186
|
+
|
|
187
|
+
The _loginPKCEGrant_ only works when used in a browser. This is because a node.js application does not have a browser interface that can display the Genesys Cloud login window.
|
|
188
|
+
|
|
189
|
+
Optional parameters may be specified in the optional third parameter for `loginPKCEGrant`. This parameter accepts an object with key/value pairs. Supported properties:
|
|
190
|
+
|
|
191
|
+
* `state` - An arbitrary string used to associate a login request with a login response. This value will be provided in the `state` property on the object when the promise is resolved. The state in the resolved promise will be identical to what was passed into `loginPKCEGrant`, except when the state is retrieved from the auth query upon completing a login; in that case, the state from the auth query will override the passed in state.
|
|
192
|
+
|
|
193
|
+
The _loginPKCEGrant_ supports an optional fourth parameter for `loginPKCEGrant`. This parameter accepts a string, used to provide a code verifier as input. When no code verifier is provider (Method 1), the SDK automatically generates a PKCE Code Verifier and saves it in _window sessionStorage_. If a code verifier is provided (Method 2), it is up to the custom application to store the code verifier value and pass it in _loginPKCEGrant_.
|
|
194
|
+
|
|
195
|
+
```javascript
|
|
196
|
+
const client = platformClient.ApiClient.instance;
|
|
197
|
+
|
|
198
|
+
// Method1: Let loginPKCEGrant generate the code verifier
|
|
199
|
+
client.loginPKCEGrant(clientId, redirectUri, { state: state })
|
|
200
|
+
.then((data) => {
|
|
201
|
+
console.log(data);
|
|
202
|
+
// Do authenticated things
|
|
203
|
+
})
|
|
204
|
+
.catch((err) => {
|
|
205
|
+
// Handle failure response
|
|
206
|
+
console.log(err);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
// Method2: code verifier as input parameter
|
|
210
|
+
let codeVerifier = client.generatePKCECodeVerifier(128);
|
|
211
|
+
client.loginPKCEGrant(clientId, redirectUri, { state: state }, codeVerifier)
|
|
212
|
+
.then((data) => {
|
|
213
|
+
console.log(data);
|
|
214
|
+
// Do authenticated things
|
|
215
|
+
})
|
|
216
|
+
.catch((err) => {
|
|
217
|
+
// Handle failure response
|
|
218
|
+
console.log(err);
|
|
219
|
+
});
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
The SDK also provides methods to generate a PKCE Code Verifier and to compute PKCE Code Challenge.
|
|
223
|
+
|
|
224
|
+
```javascript
|
|
225
|
+
let codeVerifier = client.generatePKCECodeVerifier(128);
|
|
226
|
+
let codeChallenge = await client.computePKCECodeChallenge(codeVerifier);
|
|
227
|
+
```
|
|
228
|
+
|
|
163
229
|
**Web** [Implicit grant](https://developer.genesys.cloud/authorization/platform-auth/use-implicit-grant)
|
|
164
230
|
|
|
165
231
|
The Implicit grant only works when used in a browser. This is because a node.js application does not have a browser interface that can display the Genesys Cloud login window.
|