purecloud-platform-client-v2 213.1.0 → 215.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 +31 -3
- package/dist/node/purecloud-platform-client-v2.js +446 -118
- package/dist/web-amd/purecloud-platform-client-v2.js +446 -118
- package/dist/web-amd/purecloud-platform-client-v2.min.js +1 -1
- package/dist/web-cjs/bundle.js +213 -149
- package/dist/web-cjs/purecloud-platform-client-v2.js +223 -156
- package/dist/web-cjs/purecloud-platform-client-v2.min.js +1 -1
- package/index.d.ts +369 -229
- package/package.json +1 -1
- package/src/purecloud-platform-client-v2/AbstractHttpClient.js +29 -0
- package/src/purecloud-platform-client-v2/ApiClient.js +21 -1
- package/src/purecloud-platform-client-v2/DefaultHttpClient.js +41 -0
- package/src/purecloud-platform-client-v2/api/AgentAssistantsApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/AgentCopilotApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/AgentUIApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/AlertingApi.js +45 -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/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/DataPrivacyApi.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/EmployeeEngagementApi.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 -6
- 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 +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/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 +1 -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 +1 -31
- package/src/purecloud-platform-client-v2/api/SCIMApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/ScreenRecordingApi.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/SocialMediaApi.js +1 -1
- package/src/purecloud-platform-client-v2/api/SpeechTextAnalyticsApi.js +107 -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 +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 -2
- 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 +125 -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 +1 -1
- package/src/purecloud-platform-client-v2/index.js +1 -1
package/package.json
CHANGED
|
@@ -21,6 +21,35 @@ class AbstractHttpClient {
|
|
|
21
21
|
request(httpRequestOptions) {
|
|
22
22
|
throw new Error("method must be implemented");
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
enableHooks() {
|
|
26
|
+
throw new Error("method must be implemented");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Set a PreHook function that modifies the request config before execution.
|
|
31
|
+
* @param {(config: object) => object | Promise<object> | void} hookFunction
|
|
32
|
+
*/
|
|
33
|
+
setPreHook(hookFunction) {
|
|
34
|
+
if (typeof hookFunction !== "function" || hookFunction.length !== 1) {
|
|
35
|
+
throw new Error("preHook must be a function that accepts (config)");
|
|
36
|
+
}
|
|
37
|
+
this.preHook = hookFunction;
|
|
38
|
+
this.enableHooks()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Set a PostHook function that processes the response or error after execution.
|
|
43
|
+
* @param {(response: object | null, error: Error | null) => object | Promise<object> | void} hookFunction
|
|
44
|
+
*/
|
|
45
|
+
setPostHook(hookFunction) {
|
|
46
|
+
if (typeof hookFunction !== "function" || hookFunction.length !== 1) {
|
|
47
|
+
throw new Error("postHook must be a function that accepts (response)");
|
|
48
|
+
}
|
|
49
|
+
this.postHook = hookFunction;
|
|
50
|
+
this.enableHooks()
|
|
51
|
+
}
|
|
52
|
+
|
|
24
53
|
}
|
|
25
54
|
|
|
26
55
|
export default AbstractHttpClient;
|
|
@@ -6,7 +6,7 @@ import { default as qs } from 'qs';
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @module purecloud-platform-client-v2/ApiClient
|
|
9
|
-
* @version
|
|
9
|
+
* @version 215.0.0
|
|
10
10
|
*/
|
|
11
11
|
class ApiClient {
|
|
12
12
|
/**
|
|
@@ -261,6 +261,24 @@ class ApiClient {
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
/**
|
|
265
|
+
* @description Sets preHook functions for the httpClient
|
|
266
|
+
* @param {string} preHook - method definition for prehook
|
|
267
|
+
*/
|
|
268
|
+
setPreHook(preHook) {
|
|
269
|
+
const httpClient = this.getHttpClient();
|
|
270
|
+
httpClient.setPreHook(preHook);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* @description Sets postHook functions for the httpClient
|
|
275
|
+
* @param {string} postHook - method definition for posthook
|
|
276
|
+
*/
|
|
277
|
+
setPostHook(postHook) {
|
|
278
|
+
const httpClient = this.getHttpClient();
|
|
279
|
+
httpClient.setPostHook(postHook);
|
|
280
|
+
}
|
|
281
|
+
|
|
264
282
|
/**
|
|
265
283
|
* @description Sets the certificate content if MTLS authentication is needed
|
|
266
284
|
* @param {string} certContent - content for certs
|
|
@@ -292,6 +310,8 @@ class ApiClient {
|
|
|
292
310
|
}
|
|
293
311
|
}
|
|
294
312
|
|
|
313
|
+
|
|
314
|
+
|
|
295
315
|
/**
|
|
296
316
|
* @description Sets the gateway used by the session
|
|
297
317
|
* @param {object} gateway - Gateway Configuration interface
|
|
@@ -14,6 +14,47 @@ class DefaultHttpClient extends AbstractHttpClient{
|
|
|
14
14
|
this._axiosInstance = axios.create({});
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
|
|
18
|
+
enableHooks() {
|
|
19
|
+
if (this.preHook && typeof this.preHook === 'function') {
|
|
20
|
+
|
|
21
|
+
if (this.requestInterceptorId !== undefined) {
|
|
22
|
+
axios.interceptors.request.eject(this.requestInterceptorId);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
this.requestInterceptorId = this._axiosInstance.interceptors.request.use(
|
|
26
|
+
async (config) => {
|
|
27
|
+
config = await this.preHook(config); // Call the custom pre-hook
|
|
28
|
+
return config
|
|
29
|
+
},
|
|
30
|
+
(error) => {
|
|
31
|
+
// Handle errors before the request is sent
|
|
32
|
+
console.error('Request Pre-Hook Error:', error.message);
|
|
33
|
+
return Promise.reject(error);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (this.postHook && typeof this.postHook === 'function') {
|
|
39
|
+
// Response interceptor (for post-hooks)
|
|
40
|
+
if (this.responseInterceptorId !== undefined) {
|
|
41
|
+
axios.interceptors.response.eject(this.responseInterceptorId);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
this.responseInterceptorId = this._axiosInstance.interceptors.response.use(
|
|
45
|
+
async (response) => {
|
|
46
|
+
response = await this.postHook(response); // Call the custom post-hook
|
|
47
|
+
return response
|
|
48
|
+
},
|
|
49
|
+
async (error) => {
|
|
50
|
+
console.error('Post-Hook: Response Error', error.message);
|
|
51
|
+
// Optionally call post-hook in case of errors
|
|
52
|
+
return Promise.reject(error);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
17
58
|
request(httpRequestOptions) {
|
|
18
59
|
if(!(httpRequestOptions instanceof HttpRequestOptions)) {
|
|
19
60
|
throw new Error(`httpRequestOptions must be instance of HttpRequestOptions `);
|
|
@@ -5,7 +5,7 @@ class AlertingApi {
|
|
|
5
5
|
/**
|
|
6
6
|
* Alerting service.
|
|
7
7
|
* @module purecloud-platform-client-v2/api/AlertingApi
|
|
8
|
-
* @version
|
|
8
|
+
* @version 215.0.0
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -45,6 +45,26 @@ class AlertingApi {
|
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Delete all alerts for the user
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
deleteAlertingAlertsAll() {
|
|
53
|
+
|
|
54
|
+
return this.apiClient.callApi(
|
|
55
|
+
'/api/v2/alerting/alerts/all',
|
|
56
|
+
'DELETE',
|
|
57
|
+
{ },
|
|
58
|
+
{ },
|
|
59
|
+
{ },
|
|
60
|
+
{ },
|
|
61
|
+
null,
|
|
62
|
+
['PureCloud OAuth'],
|
|
63
|
+
['application/json'],
|
|
64
|
+
['application/json']
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
48
68
|
/**
|
|
49
69
|
* Delete an interaction stats alert
|
|
50
70
|
* Apps should migrate to use DELETE /api/v2/alerting/alerts/{alertId}.
|
|
@@ -353,6 +373,30 @@ class AlertingApi {
|
|
|
353
373
|
);
|
|
354
374
|
}
|
|
355
375
|
|
|
376
|
+
/**
|
|
377
|
+
* Updates all alerts
|
|
378
|
+
*
|
|
379
|
+
* @param {Object} opts Optional parameters
|
|
380
|
+
* @param {Object} opts.body
|
|
381
|
+
*/
|
|
382
|
+
patchAlertingAlertsAll(opts) {
|
|
383
|
+
opts = opts || {};
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
return this.apiClient.callApi(
|
|
387
|
+
'/api/v2/alerting/alerts/all',
|
|
388
|
+
'PATCH',
|
|
389
|
+
{ },
|
|
390
|
+
{ },
|
|
391
|
+
{ },
|
|
392
|
+
{ },
|
|
393
|
+
opts['body'],
|
|
394
|
+
['PureCloud OAuth'],
|
|
395
|
+
['application/json'],
|
|
396
|
+
['application/json']
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
|
|
356
400
|
/**
|
|
357
401
|
* Bulk alert updates
|
|
358
402
|
*
|
|
@@ -5,7 +5,7 @@ class IntegrationsApi {
|
|
|
5
5
|
/**
|
|
6
6
|
* Integrations service.
|
|
7
7
|
* @module purecloud-platform-client-v2/api/IntegrationsApi
|
|
8
|
-
* @version
|
|
8
|
+
* @version 215.0.0
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -272,7 +272,6 @@ class IntegrationsApi {
|
|
|
272
272
|
* Get draft function settings for Action
|
|
273
273
|
*
|
|
274
274
|
* @param {String} actionId actionId
|
|
275
|
-
* getIntegrationsActionDraftFunction is a preview method and is subject to both breaking and non-breaking changes at any time without notice
|
|
276
275
|
*/
|
|
277
276
|
getIntegrationsActionDraftFunction(actionId) {
|
|
278
277
|
// verify the required parameter 'actionId' is set
|
|
@@ -387,7 +386,6 @@ class IntegrationsApi {
|
|
|
387
386
|
* Get published function settings for Action
|
|
388
387
|
*
|
|
389
388
|
* @param {String} actionId actionId
|
|
390
|
-
* getIntegrationsActionFunction is a preview method and is subject to both breaking and non-breaking changes at any time without notice
|
|
391
389
|
*/
|
|
392
390
|
getIntegrationsActionFunction(actionId) {
|
|
393
391
|
// verify the required parameter 'actionId' is set
|
|
@@ -619,7 +617,6 @@ class IntegrationsApi {
|
|
|
619
617
|
/**
|
|
620
618
|
* Get action function settings for Action
|
|
621
619
|
*
|
|
622
|
-
* getIntegrationsActionsFunctionsRuntimes is a preview method and is subject to both breaking and non-breaking changes at any time without notice
|
|
623
620
|
*/
|
|
624
621
|
getIntegrationsActionsFunctionsRuntimes() {
|
|
625
622
|
|
|
@@ -1909,7 +1906,6 @@ class IntegrationsApi {
|
|
|
1909
1906
|
*
|
|
1910
1907
|
* @param {String} actionId actionId
|
|
1911
1908
|
* @param {Object} body Input used to request URL upload.
|
|
1912
|
-
* postIntegrationsActionDraftFunctionUpload is a preview method and is subject to both breaking and non-breaking changes at any time without notice
|
|
1913
1909
|
*/
|
|
1914
1910
|
postIntegrationsActionDraftFunctionUpload(actionId, body) {
|
|
1915
1911
|
// verify the required parameter 'actionId' is set
|
|
@@ -2271,7 +2267,6 @@ class IntegrationsApi {
|
|
|
2271
2267
|
*
|
|
2272
2268
|
* @param {String} actionId actionId
|
|
2273
2269
|
* @param {Object} body Input used to update function settings.
|
|
2274
|
-
* putIntegrationsActionDraftFunction is a preview method and is subject to both breaking and non-breaking changes at any time without notice
|
|
2275
2270
|
*/
|
|
2276
2271
|
putIntegrationsActionDraftFunction(actionId, body) {
|
|
2277
2272
|
// verify the required parameter 'actionId' is set
|