@wxcc-desktop/sdk 1.3.16 → 2.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 +54 -29
- package/dist/index.js +1 -1
- package/dist/types/jsapi/config-jsapi.d.ts +41 -1
- package/package.json +1 -1
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
|
|
@@ -290,7 +304,9 @@ Desktop.agentContact.removeAllEventListeners();
|
|
290
304
|
```
|
291
305
|
|
292
306
|
### `Desktop.agentStateInfo` sub-module
|
307
|
+
|
293
308
|
`Desktop.agentStateInfo` sub-module is intended to listen for latest data updates for data:
|
309
|
+
|
294
310
|
```Javascript
|
295
311
|
type LatestInfoData = {
|
296
312
|
teamId?: string;
|
@@ -311,18 +327,18 @@ import { Desktop } from "@wxcc-desktop/sdk";
|
|
311
327
|
|
312
328
|
//...
|
313
329
|
|
314
|
-
/*
|
330
|
+
/*
|
315
331
|
Supposing Desktop.config.init() was called
|
316
332
|
*/
|
317
333
|
|
318
|
-
// latestData inludes latest data fields
|
334
|
+
// latestData inludes latest data fields
|
319
335
|
const latestData: LatestInfoData = Desktop.agentStateInfo.latestData;
|
320
336
|
|
321
337
|
//...
|
322
338
|
// Cumulative update event supported
|
323
339
|
Desktop.agentStateInfo.addEventListener("updated", updatedList =>
|
324
|
-
console.log(updatedList)
|
325
|
-
/* will log (in case of "dn", "status", "subStatus" fields were updated
|
340
|
+
console.log(updatedList)
|
341
|
+
/* will log (in case of "dn", "status", "subStatus" fields were updated
|
326
342
|
[
|
327
343
|
{
|
328
344
|
"name": "dn",
|
@@ -339,7 +355,7 @@ Desktop.agentStateInfo.addEventListener("updated", updatedList =>
|
|
339
355
|
"value": "Available",
|
340
356
|
"oldValue": ""
|
341
357
|
}
|
342
|
-
]
|
358
|
+
]
|
343
359
|
*/
|
344
360
|
);
|
345
361
|
|
@@ -351,13 +367,15 @@ await Desktop.agentStateInfo.fetchAddressBooks({ ... });
|
|
351
367
|
```
|
352
368
|
|
353
369
|
### `Desktop.dialer` sub-module
|
370
|
+
|
354
371
|
`Desktop.dialer` sub-module is intended to make aqm requests and listen to notifs events related to dialer entity.
|
372
|
+
|
355
373
|
```Javascript
|
356
374
|
import { Desktop } from "@wxcc-desktop/sdk";
|
357
375
|
|
358
376
|
//...
|
359
377
|
|
360
|
-
/*
|
378
|
+
/*
|
361
379
|
Supposing Desktop.config.init() was called
|
362
380
|
*/
|
363
381
|
|
@@ -382,13 +400,15 @@ Desktop.dialer.removeAllEventListeners();
|
|
382
400
|
```
|
383
401
|
|
384
402
|
### `Desktop.monitoring` sub-module
|
403
|
+
|
385
404
|
`Desktop.monitoring` sub-module is intended to make aqm requests and listen to notifs events related to call monitoring entity.
|
405
|
+
|
386
406
|
```Javascript
|
387
407
|
import { Desktop } from "@wxcc-desktop/sdk";
|
388
408
|
|
389
409
|
//...
|
390
410
|
|
391
|
-
/*
|
411
|
+
/*
|
392
412
|
Supposing Desktop.config.init() was called
|
393
413
|
*/
|
394
414
|
|
@@ -468,13 +488,15 @@ Desktop.monitoring.removeAllEventListeners();
|
|
468
488
|
```
|
469
489
|
|
470
490
|
### `Desktop.screenpop` sub-module
|
491
|
+
|
471
492
|
`Desktop.screenpop` sub-module is intended to make aqm requests and listen to notifs events related to screenpop entity.
|
493
|
+
|
472
494
|
```Javascript
|
473
495
|
import { Desktop } from "@wxcc-desktop/sdk";
|
474
496
|
|
475
497
|
//...
|
476
498
|
|
477
|
-
/*
|
499
|
+
/*
|
478
500
|
Supposing Desktop.config.init() was called
|
479
501
|
*/
|
480
502
|
|
@@ -495,10 +517,12 @@ Desktop.screenpop.removeAllEventListeners();
|
|
495
517
|
|
496
518
|
```
|
497
519
|
|
498
|
-
###
|
520
|
+
### `Desktop.postInteraction` sub-module
|
521
|
+
|
499
522
|
`Desktop.postInteraction` sub-module is intended to fetch lists of audio recordings and a specific captured audio recording for supervisors.
|
523
|
+
|
500
524
|
```Javascript
|
501
|
-
/*
|
525
|
+
/*
|
502
526
|
Supposing Desktop.config.init() was called
|
503
527
|
*/
|
504
528
|
|
@@ -510,8 +534,9 @@ await Desktop.postInteraction.fetchCapture({taskId});
|
|
510
534
|
|
511
535
|
```
|
512
536
|
|
513
|
-
### Publishing the wxcc-desktop/js-api
|
514
|
-
|
515
|
-
For publishing to
|
537
|
+
### Publishing the wxcc-desktop/js-api
|
538
|
+
|
539
|
+
For publishing internally to Internal Cisco Repository: `yarn npm:publish:internal`
|
540
|
+
For publishing to both Internal and public Repo : `yarn publish:external`
|
516
541
|
|
517
542
|
`publish:all` responsible for publishing in both first internal repository and then to the external public repository npmjs
|