@wxcc-desktop/sdk 1.3.16 → 2.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 +99 -37
- package/dist/index.js +10 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/jsapi/actions-jsapi.d.ts +1 -1
- package/dist/types/jsapi/agent-config-jsapi.d.ts +19 -0
- package/dist/types/jsapi/agent-contact-jsapi.d.ts +76 -549
- package/dist/types/jsapi/agent-state-info-jsapi.d.ts +9 -26
- package/dist/types/jsapi/agent-station-logout-jsapi.d.ts +5 -15
- package/dist/types/jsapi/call-monitoring-jsapi.d.ts +5 -5
- package/dist/types/jsapi/common/_logger.d.ts +1 -1
- package/dist/types/jsapi/common/_service-checker.d.ts +1 -1
- package/dist/types/jsapi/common/_service-events.d.ts +4 -4
- package/dist/types/jsapi/config-jsapi.d.ts +43 -3
- package/dist/types/jsapi/dialer-jsapi.d.ts +4 -36
- package/dist/types/jsapi/i18n-jsapi.d.ts +1 -1
- package/dist/types/jsapi/logger-jsapi.d.ts +1 -1
- package/dist/types/jsapi/post-interaction-jsapi.d.ts +1 -1
- package/dist/types/jsapi/rtdwc-jsapi.d.ts +1 -1
- package/dist/types/jsapi/screenpop-jsapi.d.ts +2 -2
- package/dist/types/jsapi/shortcut-key-jsapi.d.ts +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# WxCC Agent Desktop JS-API
|
2
|
+
|
2
3
|
WxCC Agent Desktop JS API modules set
|
3
4
|
|
4
5
|
## Root module (`Desktop`) includes:
|
6
|
+
|
5
7
|
- Config module
|
6
8
|
- I18N module
|
7
9
|
- Actions module
|
@@ -13,9 +15,10 @@ WxCC Agent Desktop JS API modules set
|
|
13
15
|
- AQM/Notifs **screenpop** service layer API module for WxCC Agent Desktop.
|
14
16
|
|
15
17
|
### `Desktop` module
|
18
|
+
|
16
19
|
Desktop module contains sub-modules:
|
17
20
|
|
18
|
-
|
21
|
+
````Javascript
|
19
22
|
import { Desktop } from "@wxcc-desktop/sdk";
|
20
23
|
|
21
24
|
const {
|
@@ -31,22 +34,27 @@ const {
|
|
31
34
|
dialer,
|
32
35
|
screenpop
|
33
36
|
} = Desktop;
|
34
|
-
|
37
|
+
|
38
|
+
###`Desktop config` sub-module
|
39
|
+
```Javascript
|
40
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
41
|
+
|
42
|
+
Desktop.config.init({widgetName: "widgetName", widgetProvider: "widgetProvider"});
|
35
43
|
|
36
44
|
### `Desktop.logger` sub-module
|
37
|
-
`Desktop.logger` sub-module is intended to create & maintain client-side logger's instances for third-party widgets.
|
45
|
+
`Desktop.logger` sub-module is intended to create & maintain client-side logger's instances for third-party widgets.
|
38
46
|
```Javascript
|
39
47
|
import { Desktop } from "@wxcc-desktop/sdk";
|
40
48
|
|
41
49
|
//...
|
42
50
|
|
43
|
-
/*
|
51
|
+
/*
|
44
52
|
Supposing Desktop.config.init() was called
|
45
53
|
*/
|
46
54
|
|
47
55
|
const logerOne = Desktop.logger.createLogger("for-service-one");
|
48
56
|
const logerTwo = Desktop.logger.createLogger("for-service-two");
|
49
|
-
|
57
|
+
|
50
58
|
logerOne.info("Info test"); // console.log => "for-service-one: Info:test"
|
51
59
|
logerTwo.warn("Warn test"); // console.log => "for-service-two: Warn:test"
|
52
60
|
logerOne.error("Error test"); // console.log => "for-service-one: Error:test"
|
@@ -70,12 +78,13 @@ Desktop.logger.getLogsTextUrl("for-service-one");
|
|
70
78
|
Desktop.logger.cleanupPrefixedLogs("for-service-one");
|
71
79
|
|
72
80
|
//...
|
73
|
-
|
81
|
+
````
|
74
82
|
|
75
83
|
### `Desktop.i18n` sub-module
|
76
|
-
`Desktop.i18n` sub-module is intended to create & maintain client-side i18n & lit-element i18nMixin instances for third-party widgets.
|
77
84
|
|
78
|
-
Desktop.i18n
|
85
|
+
`Desktop.i18n` sub-module is intended to create & maintain client-side i18n & lit-element i18nMixin instances for third-party widgets.
|
86
|
+
|
87
|
+
Desktop.i18n instantinating object is described in: https://www.i18next.com/overview/api#instance-creation
|
79
88
|
|
80
89
|
i18n instance backend configuration described in: https://github.com/i18next/i18next-http-backend
|
81
90
|
|
@@ -91,13 +100,13 @@ import { html } from "lit-html";
|
|
91
100
|
|
92
101
|
//...
|
93
102
|
|
94
|
-
/*
|
103
|
+
/*
|
95
104
|
Desktop.i18n service MAY NOT NEED to wait for Desktop.config.init({...}) was called for proper work
|
96
105
|
*/
|
97
106
|
|
98
107
|
// All CreateOotions for i18n are optional
|
99
108
|
type CreateOptions = {
|
100
|
-
logger?:
|
109
|
+
logger?:
|
101
110
|
| {
|
102
111
|
log(...args: any[]): void;
|
103
112
|
warn(...args: any[]): void;
|
@@ -142,6 +151,7 @@ export class MyAwesomeComponent extends i18nMixin(LitElement) {
|
|
142
151
|
```
|
143
152
|
|
144
153
|
### `Desktop.actions` sub-module
|
154
|
+
|
145
155
|
`Desktop.actions` sub-module is intended to make a calls into and/or get data from AgentX store.
|
146
156
|
|
147
157
|
```Javascript
|
@@ -149,7 +159,7 @@ import { Desktop } from "@wxcc-desktop/sdk";
|
|
149
159
|
|
150
160
|
//...
|
151
161
|
|
152
|
-
/*
|
162
|
+
/*
|
153
163
|
Supposing Desktop.config.init() was called
|
154
164
|
*/
|
155
165
|
|
@@ -157,8 +167,8 @@ import { Desktop } from "@wxcc-desktop/sdk";
|
|
157
167
|
// AgentX General Notifications:
|
158
168
|
Desktop.actions.fireGeneralSilentNotification({...}) // => Fires silent notification in AgentX. One way
|
159
169
|
|
160
|
-
// Unlike silent notification, autodismiss and acknowledge can have controlled responses, that may reflect in status, e.g.:
|
161
|
-
const [ status, reason, mode ]: [ Notifications.ItemMeta.Status, Notifications.ItemMeta.StatusChangeEventReason, Notifications.ItemMeta.Mode ] = await Desktop.actions.fireGeneralAutoDismissNotification({...}) // => Fires autudismiss notification in AgentX. Returns notification resolved status, reason, mode. NOTE: if AgentX notifications disabled - it will be converted into silent and reflected in "mode"
|
170
|
+
// Unlike silent notification, autodismiss and acknowledge can have controlled responses, that may reflect in status, e.g.:
|
171
|
+
const [ status, reason, mode ]: [ Notifications.ItemMeta.Status, Notifications.ItemMeta.StatusChangeEventReason, Notifications.ItemMeta.Mode ] = await Desktop.actions.fireGeneralAutoDismissNotification({...}) // => Fires autudismiss notification in AgentX. Returns notification resolved status, reason, mode. NOTE: if AgentX notifications disabled - it will be converted into silent and reflected in "mode"
|
162
172
|
const [ status, reason, mode ]: [ Notifications.ItemMeta.Status, Notifications.ItemMeta.StatusChangeEventReason, Notifications.ItemMeta.Mode ] = await Desktop.actions.fireGeneralAcknowledgeNotification({...}) // => Fires acknowledge notification in AgentX. Returns notification resolved status, reason, mode. NOTE: if AgentX notifications disabled - it will be converted into silent and reflected in "mode"
|
163
173
|
|
164
174
|
|
@@ -187,13 +197,15 @@ const toggle = Desktop.actions.toggleMiximizeRestore(e: Event) // => maximize/re
|
|
187
197
|
```
|
188
198
|
|
189
199
|
### `Desktop.shortcutKey` sub-module
|
190
|
-
|
200
|
+
|
201
|
+
`Desktop.shortcutKey` sub-module is intended to register and call shortcut keys actions from widgets.
|
202
|
+
|
191
203
|
```Javascript
|
192
204
|
import { Desktop } from "@wxcc-desktop/sdk";
|
193
205
|
|
194
206
|
//...
|
195
207
|
|
196
|
-
/*
|
208
|
+
/*
|
197
209
|
Supposing Desktop.config.init() was called
|
198
210
|
*/
|
199
211
|
|
@@ -219,13 +231,15 @@ Desktop.shortcutKey.unregisterKeys('widget-one-example'); //=> used to unregiste
|
|
219
231
|
```
|
220
232
|
|
221
233
|
### `Desktop.agentContact` sub-module
|
234
|
+
|
222
235
|
`Desktop.agentContact` sub-module is intended to make aqm requests and listen to notifs events related to agent-contact entity.
|
236
|
+
|
223
237
|
```Javascript
|
224
238
|
import { Desktop } from "@wxcc-desktop/sdk";
|
225
239
|
|
226
240
|
//...
|
227
241
|
|
228
|
-
/*
|
242
|
+
/*
|
229
243
|
Supposing Desktop.config.init() was called
|
230
244
|
*/
|
231
245
|
|
@@ -248,6 +262,22 @@ await Desktop.agentContact.vteamList({ ... });
|
|
248
262
|
await Desktop.agentContact.pauseRecording({ ... });
|
249
263
|
await Desktop.agentContact.resumeRecording({ ... });
|
250
264
|
|
265
|
+
// List of new routing API's
|
266
|
+
await Desktop.agentContact.acceptV2({ ... });
|
267
|
+
await Desktop.agentContact.cancelTaskV2({ ... });
|
268
|
+
await Desktop.agentContact.endV2({ ... });
|
269
|
+
await Desktop.agentContact.pauseRecordingV2({ ... });
|
270
|
+
await Desktop.agentContact.resumeRecordingV2({ ... });
|
271
|
+
await Desktop.agentContact.wrapupV2({ ... });
|
272
|
+
await Desktop.agentContact.consultV2({ ... });
|
273
|
+
await Desktop.agentContact.consultEndV2({ ... });
|
274
|
+
await Desktop.agentContact.consultConferenceV2({ ... });
|
275
|
+
await Desktop.agentContact.exitConference({ ... });
|
276
|
+
await Desktop.agentContact.vteamTransferV2({ ... });
|
277
|
+
await Desktop.agentContact.blindTransferV2({ ... });
|
278
|
+
await Desktop.agentContact.consultTransferV2({ ... });
|
279
|
+
await Desktop.agentContact.buddyAgentsV2({ ... });
|
280
|
+
|
251
281
|
// List of available agent-contact aqm notifs events:
|
252
282
|
Desktop.agentContact.addEventListener("eAgentContact", msg => console.log(msg));
|
253
283
|
Desktop.agentContact.addEventListener("eAgentContactAssigned", msg => console.log(msg));
|
@@ -290,7 +320,9 @@ Desktop.agentContact.removeAllEventListeners();
|
|
290
320
|
```
|
291
321
|
|
292
322
|
### `Desktop.agentStateInfo` sub-module
|
323
|
+
|
293
324
|
`Desktop.agentStateInfo` sub-module is intended to listen for latest data updates for data:
|
325
|
+
|
294
326
|
```Javascript
|
295
327
|
type LatestInfoData = {
|
296
328
|
teamId?: string;
|
@@ -311,18 +343,18 @@ import { Desktop } from "@wxcc-desktop/sdk";
|
|
311
343
|
|
312
344
|
//...
|
313
345
|
|
314
|
-
/*
|
346
|
+
/*
|
315
347
|
Supposing Desktop.config.init() was called
|
316
348
|
*/
|
317
349
|
|
318
|
-
// latestData inludes latest data fields
|
350
|
+
// latestData inludes latest data fields
|
319
351
|
const latestData: LatestInfoData = Desktop.agentStateInfo.latestData;
|
320
352
|
|
321
353
|
//...
|
322
354
|
// Cumulative update event supported
|
323
355
|
Desktop.agentStateInfo.addEventListener("updated", updatedList =>
|
324
|
-
console.log(updatedList)
|
325
|
-
/* will log (in case of "dn", "status", "subStatus" fields were updated
|
356
|
+
console.log(updatedList)
|
357
|
+
/* will log (in case of "dn", "status", "subStatus" fields were updated
|
326
358
|
[
|
327
359
|
{
|
328
360
|
"name": "dn",
|
@@ -339,7 +371,7 @@ Desktop.agentStateInfo.addEventListener("updated", updatedList =>
|
|
339
371
|
"value": "Available",
|
340
372
|
"oldValue": ""
|
341
373
|
}
|
342
|
-
]
|
374
|
+
]
|
343
375
|
*/
|
344
376
|
);
|
345
377
|
|
@@ -351,13 +383,15 @@ await Desktop.agentStateInfo.fetchAddressBooks({ ... });
|
|
351
383
|
```
|
352
384
|
|
353
385
|
### `Desktop.dialer` sub-module
|
386
|
+
|
354
387
|
`Desktop.dialer` sub-module is intended to make aqm requests and listen to notifs events related to dialer entity.
|
388
|
+
|
355
389
|
```Javascript
|
356
390
|
import { Desktop } from "@wxcc-desktop/sdk";
|
357
391
|
|
358
392
|
//...
|
359
393
|
|
360
|
-
/*
|
394
|
+
/*
|
361
395
|
Supposing Desktop.config.init() was called
|
362
396
|
*/
|
363
397
|
|
@@ -382,13 +416,15 @@ Desktop.dialer.removeAllEventListeners();
|
|
382
416
|
```
|
383
417
|
|
384
418
|
### `Desktop.monitoring` sub-module
|
419
|
+
|
385
420
|
`Desktop.monitoring` sub-module is intended to make aqm requests and listen to notifs events related to call monitoring entity.
|
421
|
+
|
386
422
|
```Javascript
|
387
423
|
import { Desktop } from "@wxcc-desktop/sdk";
|
388
424
|
|
389
425
|
//...
|
390
426
|
|
391
|
-
/*
|
427
|
+
/*
|
392
428
|
Supposing Desktop.config.init() was called
|
393
429
|
*/
|
394
430
|
|
@@ -419,8 +455,8 @@ Desktop.monitoring.addEventListener("eMonitoringHeld", listener);
|
|
419
455
|
Desktop.monitoring.addEventListener("eMonitoringHoldFailed", listener);
|
420
456
|
Desktop.monitoring.addEventListener("eMonitoringUnHeld", listener);
|
421
457
|
Desktop.monitoring.addEventListener("eMonitoringUnHoldFailed", listener);
|
422
|
-
Desktop.monitoring.addEventListener("
|
423
|
-
Desktop.monitoring.addEventListener("
|
458
|
+
Desktop.monitoring.addEventListener("eAgentMonitorStateChanged", listener);
|
459
|
+
Desktop.monitoring.addEventListener("eAgentMonitorStateChangeFailed", listener);
|
424
460
|
|
425
461
|
Desktop.monitoring.removeEventListener("eMonitoringOffered", listener);
|
426
462
|
Desktop.monitoring.removeEventListener("eMonitoringStarted", listener);
|
@@ -432,8 +468,8 @@ Desktop.monitoring.removeEventListener("eMonitoringHeld", listener);
|
|
432
468
|
Desktop.monitoring.removeEventListener("eMonitoringHoldFailed", listener);
|
433
469
|
Desktop.monitoring.removeEventListener("eMonitoringUnHeld", listener);
|
434
470
|
Desktop.monitoring.removeEventListener("eMonitoringUnHoldFailed", listener);
|
435
|
-
Desktop.monitoring.removeEventListener("
|
436
|
-
Desktop.monitoring.removeEventListener("
|
471
|
+
Desktop.monitoring.removeEventListener("eAgentMonitorStateChanged", listener);
|
472
|
+
Desktop.monitoring.removeEventListener("eAgentMonitorStateChangeFailed", listener);
|
437
473
|
|
438
474
|
|
439
475
|
// Module supports one-time added listeners like:
|
@@ -447,8 +483,8 @@ Desktop.monitoring.addOnceEventListener("eMonitoringHeld", listener);
|
|
447
483
|
Desktop.monitoring.addOnceEventListener("eMonitoringHoldFailed", listener);
|
448
484
|
Desktop.monitoring.addOnceEventListener("eMonitoringUnHeld", listener);
|
449
485
|
Desktop.monitoring.addOnceEventListener("eMonitoringUnHoldFailed", listener);
|
450
|
-
Desktop.monitoring.addOnceEventListener("
|
451
|
-
Desktop.monitoring.addOnceEventListener("
|
486
|
+
Desktop.monitoring.addOnceEventListener("eAgentMonitorStateChanged", listener);
|
487
|
+
Desktop.monitoring.addOnceEventListener("eAgentMonitorStateChangeFailed", listener);
|
452
488
|
|
453
489
|
Desktop.monitoring.removeOnceEventListener("eMonitoringOffered", listener);
|
454
490
|
Desktop.monitoring.removeOnceEventListener("eMonitoringStarted", listener);
|
@@ -460,21 +496,23 @@ Desktop.monitoring.removeOnceEventListener("eMonitoringHeld", listener);
|
|
460
496
|
Desktop.monitoring.removeOnceEventListener("eMonitoringHoldFailed", listener);
|
461
497
|
Desktop.monitoring.removeOnceEventListener("eMonitoringUnHeld", listener);
|
462
498
|
Desktop.monitoring.removeOnceEventListener("eMonitoringUnHoldFailed", listener);
|
463
|
-
Desktop.monitoring.removeOnceEventListener("
|
464
|
-
Desktop.monitoring.removeOnceEventListener("
|
499
|
+
Desktop.monitoring.removeOnceEventListener("eAgentMonitorStateChanged", listener);
|
500
|
+
Desktop.monitoring.removeOnceEventListener("eAgentMonitorStateChangeFailed", listener);
|
465
501
|
// Module supports removing all listeners like:
|
466
502
|
Desktop.monitoring.removeAllEventListeners();
|
467
503
|
|
468
504
|
```
|
469
505
|
|
470
506
|
### `Desktop.screenpop` sub-module
|
507
|
+
|
471
508
|
`Desktop.screenpop` sub-module is intended to make aqm requests and listen to notifs events related to screenpop entity.
|
509
|
+
|
472
510
|
```Javascript
|
473
511
|
import { Desktop } from "@wxcc-desktop/sdk";
|
474
512
|
|
475
513
|
//...
|
476
514
|
|
477
|
-
/*
|
515
|
+
/*
|
478
516
|
Supposing Desktop.config.init() was called
|
479
517
|
*/
|
480
518
|
|
@@ -495,10 +533,12 @@ Desktop.screenpop.removeAllEventListeners();
|
|
495
533
|
|
496
534
|
```
|
497
535
|
|
498
|
-
###
|
536
|
+
### `Desktop.postInteraction` sub-module
|
537
|
+
|
499
538
|
`Desktop.postInteraction` sub-module is intended to fetch lists of audio recordings and a specific captured audio recording for supervisors.
|
539
|
+
|
500
540
|
```Javascript
|
501
|
-
/*
|
541
|
+
/*
|
502
542
|
Supposing Desktop.config.init() was called
|
503
543
|
*/
|
504
544
|
|
@@ -510,8 +550,30 @@ await Desktop.postInteraction.fetchCapture({taskId});
|
|
510
550
|
|
511
551
|
```
|
512
552
|
|
513
|
-
###
|
514
|
-
|
515
|
-
|
553
|
+
### `Desktop.agentConfigJsApi` sub-module
|
554
|
+
|
555
|
+
`Desktop.agentConfigJsApi` sub-module is intended to fetch Agent configurations from contact center Backend service API's.
|
556
|
+
|
557
|
+
```Javascript
|
558
|
+
/*
|
559
|
+
Supposing Desktop.config.init() was called
|
560
|
+
*/
|
561
|
+
|
562
|
+
// AgentX paginated idleCodes/wrapupCodes:
|
563
|
+
const requestAuxCodes = {
|
564
|
+
workType: "IDLE_CODE" | "WRAP_UP_CODE";
|
565
|
+
page?: number;
|
566
|
+
pageSize?: number;
|
567
|
+
search?: string;
|
568
|
+
customFilter?: string;
|
569
|
+
}
|
570
|
+
const paginatedAuxCodes: await Desktop.agentConfigJsApi.fetchPaginatedAuxCodes(requestAuxCodes);
|
571
|
+
|
572
|
+
```
|
573
|
+
|
574
|
+
### Publishing the wxcc-desktop/js-api
|
575
|
+
|
576
|
+
For publishing internally to Internal Cisco Repository: `yarn npm:publish:internal`
|
577
|
+
For publishing to both Internal and public Repo : `yarn publish:external`
|
516
578
|
|
517
579
|
`publish:all` responsible for publishing in both first internal repository and then to the external public repository npmjs
|