@wxcc-desktop/sdk 2.0.1 → 2.0.3
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 +595 -579
- package/dist/index.js +3 -3
- package/dist/types/index.d.ts +33 -31
- package/dist/types/jsapi/actions-jsapi.d.ts +39 -39
- package/dist/types/jsapi/agent-config-jsapi.d.ts +19 -19
- package/dist/types/jsapi/agent-contact-jsapi.d.ts +186 -186
- package/dist/types/jsapi/agent-state-info-jsapi.d.ts +83 -83
- package/dist/types/jsapi/agent-station-logout-jsapi.d.ts +34 -34
- package/dist/types/jsapi/call-monitoring-jsapi.d.ts +56 -56
- package/dist/types/jsapi/common/_logger.d.ts +4 -4
- package/dist/types/jsapi/common/_service-checker.d.ts +12 -12
- package/dist/types/jsapi/common/_service-events.d.ts +31 -31
- package/dist/types/jsapi/config-jsapi.d.ts +66 -66
- package/dist/types/jsapi/dialer-jsapi.d.ts +40 -40
- package/dist/types/jsapi/i18n-jsapi.d.ts +23 -23
- package/dist/types/jsapi/logger-jsapi.d.ts +19 -19
- package/dist/types/jsapi/post-interaction-jsapi.d.ts +26 -26
- package/dist/types/jsapi/rtdwc-jsapi.d.ts +24 -24
- package/dist/types/jsapi/screenpop-jsapi.d.ts +29 -29
- package/dist/types/jsapi/shortcut-key-jsapi.d.ts +70 -70
- package/dist/types/jsapi/webex-metrics-internal-jsapi.d.ts +19 -0
- package/dist/types/sdk.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
@@ -1,579 +1,595 @@
|
|
1
|
-
# WxCC Agent Desktop JS-API
|
2
|
-
|
3
|
-
WxCC Agent Desktop JS API modules set
|
4
|
-
|
5
|
-
## Root module (`Desktop`) includes:
|
6
|
-
|
7
|
-
- Config module
|
8
|
-
- I18N module
|
9
|
-
- Actions module
|
10
|
-
- Logger service module
|
11
|
-
- ShortcutKey service module
|
12
|
-
-
|
13
|
-
- AQM/Notifs **agent-
|
14
|
-
- AQM/Notifs **
|
15
|
-
- AQM/Notifs **
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
logerOne.
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
`Desktop.i18n` sub-module
|
86
|
-
|
87
|
-
Desktop.i18n
|
88
|
-
|
89
|
-
i18n
|
90
|
-
|
91
|
-
i18n instance
|
92
|
-
|
93
|
-
i18n instance
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
import {
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
//
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
<!--
|
147
|
-
<p>${
|
148
|
-
|
149
|
-
}
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
`Desktop.actions` sub-module
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
//
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
//
|
183
|
-
|
184
|
-
|
185
|
-
// AgentX
|
186
|
-
|
187
|
-
|
188
|
-
// AgentX
|
189
|
-
|
190
|
-
|
191
|
-
// AgentX
|
192
|
-
|
193
|
-
|
194
|
-
//
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
`Desktop.shortcutKey` sub-module
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
console.log(Desktop.shortcutKey.
|
215
|
-
|
216
|
-
console.log(Desktop.shortcutKey.
|
217
|
-
|
218
|
-
console.log(Desktop.shortcutKey.
|
219
|
-
|
220
|
-
Desktop.shortcutKey.
|
221
|
-
|
222
|
-
Desktop.shortcutKey.
|
223
|
-
|
224
|
-
Desktop.shortcutKey.
|
225
|
-
|
226
|
-
Desktop.shortcutKey.
|
227
|
-
|
228
|
-
Desktop.shortcutKey.
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
`Desktop.agentContact` sub-module
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
await Desktop.agentContact.
|
250
|
-
await Desktop.agentContact.
|
251
|
-
await Desktop.agentContact.
|
252
|
-
await Desktop.agentContact.
|
253
|
-
await Desktop.agentContact.
|
254
|
-
await Desktop.agentContact.
|
255
|
-
await Desktop.agentContact.
|
256
|
-
await Desktop.agentContact.
|
257
|
-
await Desktop.agentContact.
|
258
|
-
await Desktop.agentContact.
|
259
|
-
await Desktop.agentContact.
|
260
|
-
await Desktop.agentContact.
|
261
|
-
await Desktop.agentContact.
|
262
|
-
await Desktop.agentContact.
|
263
|
-
await Desktop.agentContact.
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
await Desktop.agentContact.
|
269
|
-
await Desktop.agentContact.
|
270
|
-
await Desktop.agentContact.
|
271
|
-
await Desktop.agentContact.
|
272
|
-
await Desktop.agentContact.
|
273
|
-
await Desktop.agentContact.
|
274
|
-
await Desktop.agentContact.
|
275
|
-
await Desktop.agentContact.
|
276
|
-
await Desktop.agentContact.
|
277
|
-
await Desktop.agentContact.
|
278
|
-
await Desktop.agentContact.
|
279
|
-
await Desktop.agentContact.
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
Desktop.agentContact.addEventListener("
|
285
|
-
Desktop.agentContact.addEventListener("
|
286
|
-
Desktop.agentContact.addEventListener("
|
287
|
-
Desktop.agentContact.addEventListener("
|
288
|
-
Desktop.agentContact.addEventListener("
|
289
|
-
Desktop.agentContact.addEventListener("
|
290
|
-
Desktop.agentContact.addEventListener("
|
291
|
-
Desktop.agentContact.addEventListener("
|
292
|
-
Desktop.agentContact.addEventListener("
|
293
|
-
Desktop.agentContact.addEventListener("
|
294
|
-
Desktop.agentContact.addEventListener("
|
295
|
-
Desktop.agentContact.addEventListener("
|
296
|
-
Desktop.agentContact.addEventListener("
|
297
|
-
Desktop.agentContact.addEventListener("
|
298
|
-
Desktop.agentContact.addEventListener("
|
299
|
-
Desktop.agentContact.addEventListener("
|
300
|
-
Desktop.agentContact.addEventListener("
|
301
|
-
Desktop.agentContact.addEventListener("
|
302
|
-
Desktop.agentContact.addEventListener("
|
303
|
-
Desktop.agentContact.addEventListener("
|
304
|
-
Desktop.agentContact.addEventListener("
|
305
|
-
Desktop.agentContact.addEventListener("
|
306
|
-
Desktop.agentContact.addEventListener("
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
`Desktop.agentStateInfo` sub-module
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
```
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
"
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
"
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
"
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
`Desktop.dialer` sub-module
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
`Desktop.monitoring` sub-module
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
Desktop.monitoring.addEventListener("
|
451
|
-
Desktop.monitoring.addEventListener("
|
452
|
-
Desktop.monitoring.addEventListener("
|
453
|
-
Desktop.monitoring.addEventListener("
|
454
|
-
Desktop.monitoring.addEventListener("
|
455
|
-
Desktop.monitoring.addEventListener("
|
456
|
-
Desktop.monitoring.addEventListener("
|
457
|
-
Desktop.monitoring.addEventListener("
|
458
|
-
Desktop.monitoring.addEventListener("
|
459
|
-
Desktop.monitoring.addEventListener("
|
460
|
-
|
461
|
-
Desktop.monitoring.
|
462
|
-
|
463
|
-
Desktop.monitoring.removeEventListener("
|
464
|
-
Desktop.monitoring.removeEventListener("
|
465
|
-
Desktop.monitoring.removeEventListener("
|
466
|
-
Desktop.monitoring.removeEventListener("
|
467
|
-
Desktop.monitoring.removeEventListener("
|
468
|
-
Desktop.monitoring.removeEventListener("
|
469
|
-
Desktop.monitoring.removeEventListener("
|
470
|
-
Desktop.monitoring.removeEventListener("
|
471
|
-
Desktop.monitoring.removeEventListener("
|
472
|
-
Desktop.monitoring.removeEventListener("
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
Desktop.monitoring.addOnceEventListener("
|
479
|
-
Desktop.monitoring.addOnceEventListener("
|
480
|
-
Desktop.monitoring.addOnceEventListener("
|
481
|
-
Desktop.monitoring.addOnceEventListener("
|
482
|
-
Desktop.monitoring.addOnceEventListener("
|
483
|
-
Desktop.monitoring.addOnceEventListener("
|
484
|
-
Desktop.monitoring.addOnceEventListener("
|
485
|
-
Desktop.monitoring.addOnceEventListener("
|
486
|
-
Desktop.monitoring.addOnceEventListener("
|
487
|
-
Desktop.monitoring.addOnceEventListener("
|
488
|
-
|
489
|
-
Desktop.monitoring.
|
490
|
-
|
491
|
-
Desktop.monitoring.removeOnceEventListener("
|
492
|
-
Desktop.monitoring.removeOnceEventListener("
|
493
|
-
Desktop.monitoring.removeOnceEventListener("
|
494
|
-
Desktop.monitoring.removeOnceEventListener("
|
495
|
-
Desktop.monitoring.removeOnceEventListener("
|
496
|
-
Desktop.monitoring.removeOnceEventListener("
|
497
|
-
Desktop.monitoring.removeOnceEventListener("
|
498
|
-
Desktop.monitoring.removeOnceEventListener("
|
499
|
-
Desktop.monitoring.removeOnceEventListener("
|
500
|
-
Desktop.monitoring.removeOnceEventListener("
|
501
|
-
|
502
|
-
Desktop.monitoring.
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
`Desktop.screenpop` sub-module
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
`Desktop.postInteraction` sub-module
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
`Desktop.agentConfigJsApi` sub-module
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
1
|
+
# WxCC Agent Desktop JS-API
|
2
|
+
|
3
|
+
WxCC Agent Desktop JS API modules set
|
4
|
+
|
5
|
+
## Root module (`Desktop`) includes:
|
6
|
+
|
7
|
+
- Config module
|
8
|
+
- I18N module
|
9
|
+
- Actions module
|
10
|
+
- Logger service module
|
11
|
+
- ShortcutKey service module
|
12
|
+
- Webex Metrics module
|
13
|
+
- AQM/Notifs **agent-contact** service layer API module for WxCC Agent Desktop.
|
14
|
+
- AQM/Notifs **agent-state** service layer API module for WxCC Agent Desktop.
|
15
|
+
- AQM/Notifs **dialer** service layer API module for WxCC Agent Desktop.
|
16
|
+
- AQM/Notifs **screenpop** service layer API module for WxCC Agent Desktop.
|
17
|
+
|
18
|
+
### `Desktop` module
|
19
|
+
|
20
|
+
Desktop module contains sub-modules:
|
21
|
+
|
22
|
+
````Javascript
|
23
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
24
|
+
|
25
|
+
const {
|
26
|
+
config,
|
27
|
+
actions,
|
28
|
+
logger,
|
29
|
+
shortcutKey,
|
30
|
+
i18n,
|
31
|
+
webexMetricsInternal,
|
32
|
+
|
33
|
+
// AQM/Notifs modules
|
34
|
+
agentContact,
|
35
|
+
agentStateInfo,
|
36
|
+
dialer,
|
37
|
+
screenpop
|
38
|
+
} = Desktop;
|
39
|
+
|
40
|
+
###`Desktop config` sub-module
|
41
|
+
```Javascript
|
42
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
43
|
+
|
44
|
+
Desktop.config.init({widgetName: "widgetName", widgetProvider: "widgetProvider"});
|
45
|
+
|
46
|
+
### `Desktop.logger` sub-module
|
47
|
+
`Desktop.logger` sub-module is intended to create & maintain client-side logger's instances for third-party widgets.
|
48
|
+
```Javascript
|
49
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
50
|
+
|
51
|
+
//...
|
52
|
+
|
53
|
+
/*
|
54
|
+
Supposing Desktop.config.init() was called
|
55
|
+
*/
|
56
|
+
|
57
|
+
const logerOne = Desktop.logger.createLogger("for-service-one");
|
58
|
+
const logerTwo = Desktop.logger.createLogger("for-service-two");
|
59
|
+
|
60
|
+
logerOne.info("Info test"); // console.log => "for-service-one: Info:test"
|
61
|
+
logerTwo.warn("Warn test"); // console.log => "for-service-two: Warn:test"
|
62
|
+
logerOne.error("Error test"); // console.log => "for-service-one: Error:test"
|
63
|
+
|
64
|
+
// Start browser doanload logs as JSON for "for-service-one" prefix:
|
65
|
+
Desktop.logger.browserDownloadLogsJson("for-service-one");
|
66
|
+
|
67
|
+
// Start browser doanload logs as Test for "for-service-one" prefix:
|
68
|
+
Desktop.logger.browserDownloadLogsText("for-service-one");
|
69
|
+
|
70
|
+
// Get logs as Object's collection for "for-service-one" prefix:
|
71
|
+
Desktop.logger.getLogsCollection("for-service-one");
|
72
|
+
|
73
|
+
// Get logs as base64 encoded url ready to put into link href to initiate browser download as JSON for "for-service-one" prefix:
|
74
|
+
Desktop.logger.getLogsJsonUrl("for-service-one");
|
75
|
+
|
76
|
+
// Get logs as base64 encoded url ready to put into link href to initiate browser download as Text for "for-service-one" prefix:
|
77
|
+
Desktop.logger.getLogsTextUrl("for-service-one");
|
78
|
+
|
79
|
+
// Cleanup logs from LS for "for-service-one" prefix:
|
80
|
+
Desktop.logger.cleanupPrefixedLogs("for-service-one");
|
81
|
+
|
82
|
+
//...
|
83
|
+
````
|
84
|
+
|
85
|
+
### `Desktop.i18n` sub-module
|
86
|
+
|
87
|
+
`Desktop.i18n` sub-module is intended to create & maintain client-side i18n & lit-element i18nMixin instances for third-party widgets.
|
88
|
+
|
89
|
+
Desktop.i18n instantinating object is described in: https://www.i18next.com/overview/api#instance-creation
|
90
|
+
|
91
|
+
i18n instance backend configuration described in: https://github.com/i18next/i18next-http-backend
|
92
|
+
|
93
|
+
i18n instance languageDetector configuration described in: https://github.com/i18next/i18next-browser-languageDetector
|
94
|
+
|
95
|
+
i18n instance init options are described in: https://www.i18next.com/overview/configuration-options
|
96
|
+
|
97
|
+
```Javascript
|
98
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
99
|
+
import { customElement, LitElement } from "lit-element";
|
100
|
+
import { html } from "lit-html";
|
101
|
+
|
102
|
+
|
103
|
+
//...
|
104
|
+
|
105
|
+
/*
|
106
|
+
Desktop.i18n service MAY NOT NEED to wait for Desktop.config.init({...}) was called for proper work
|
107
|
+
*/
|
108
|
+
|
109
|
+
// All CreateOotions for i18n are optional
|
110
|
+
type CreateOptions = {
|
111
|
+
logger?:
|
112
|
+
| {
|
113
|
+
log(...args: any[]): void;
|
114
|
+
warn(...args: any[]): void;
|
115
|
+
error(...args: any[]): void;
|
116
|
+
}
|
117
|
+
| ReturnType<typof Desktop.createLogger>;
|
118
|
+
|
119
|
+
backend?: Backend // import Backend from "i18next-http-backend";
|
120
|
+
languageDetector?: LanguageDetector // import LanguageDetector from "i18next-browser-languagedetector";
|
121
|
+
};
|
122
|
+
|
123
|
+
const i18n = Desktop.i18n.createInstance(createOptions?: CreateOptions) // returns instance described in https://www.i18next.com/overview/api#instance-creation
|
124
|
+
const i18nMixin = Desktop.i18n.createMixin({ i18n /*Injecting i18n service instance into lit-element mixin */ })
|
125
|
+
|
126
|
+
console.log(Desktop.i18n.DEFAULT_INIT_OPTIONS); // => i18n.init options that are using by AgentX by default
|
127
|
+
|
128
|
+
// Init i18n with options to be able call "t" function translations
|
129
|
+
if (!i18n.isInitialized) {
|
130
|
+
const initOptions = Desktop.i18n.getMergedInitOptions(Desktop.i18n.DEFAULT_INIT_OPTIONS || {}, {
|
131
|
+
defaultNS: "my-ns",
|
132
|
+
ns: ["my-ns"],
|
133
|
+
fallbackLng: "en",
|
134
|
+
backend: {
|
135
|
+
loadPath: "/.../path-to-locales/.../{{lng}}/{{ns}}.json"
|
136
|
+
}
|
137
|
+
});
|
138
|
+
|
139
|
+
i18n.init(initOptions).catch(err => console.log(err));
|
140
|
+
}
|
141
|
+
|
142
|
+
@customElement("my-awesome-component")
|
143
|
+
export class MyAwesomeComponent extends i18nMixin(LitElement) {
|
144
|
+
render() {
|
145
|
+
return html`
|
146
|
+
<!-- i18nMixin will subscribe component tree updates on languages load & language change -->
|
147
|
+
<p>${i18n.t("my-ns:key1")}</p>
|
148
|
+
<!-- Component wrapped by i18nMixin can access t funcation via this.t(...) -->
|
149
|
+
<p>${this.t("my-ns:key2")}</p>`
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
```
|
154
|
+
|
155
|
+
### `Desktop.actions` sub-module
|
156
|
+
|
157
|
+
`Desktop.actions` sub-module is intended to make a calls into and/or get data from AgentX store.
|
158
|
+
|
159
|
+
```Javascript
|
160
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
161
|
+
|
162
|
+
//...
|
163
|
+
|
164
|
+
/*
|
165
|
+
Supposing Desktop.config.init() was called
|
166
|
+
*/
|
167
|
+
|
168
|
+
|
169
|
+
// AgentX General Notifications:
|
170
|
+
Desktop.actions.fireGeneralSilentNotification({...}) // => Fires silent notification in AgentX. One way
|
171
|
+
|
172
|
+
// Unlike silent notification, autodismiss and acknowledge can have controlled responses, that may reflect in status, e.g.:
|
173
|
+
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"
|
174
|
+
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"
|
175
|
+
|
176
|
+
|
177
|
+
// AgentX Tasks:
|
178
|
+
Desktop.actions.addCustomTask({...}) // => Add custom task object in AgentX store
|
179
|
+
|
180
|
+
|
181
|
+
// AgentX Task Map:
|
182
|
+
const currentTaskMap = await Desktop.actions.getTaskMap() // => Get current task map from AgentX store
|
183
|
+
|
184
|
+
// AgentX Media Type Queues:
|
185
|
+
const queue = await Desktop.actions.getMediaTypeQueue("telephony" | "social" | "email" | "chat") // => Get current media queue from AgentX store
|
186
|
+
|
187
|
+
// AgentX AccessToken:
|
188
|
+
const accessToken = await Desktop.actions.getToken() // => Get current accessToken from AgentX store
|
189
|
+
|
190
|
+
// AgentX idleCodes:
|
191
|
+
const idelCodes = await Desktop.actions.getIdleCodes() // => Get current idleCodes from AgentX store
|
192
|
+
|
193
|
+
// AgentX wrapUpCodes:
|
194
|
+
const wrapUpCodes = await Desktop.actions.getWrapUpCodes() // => Get current idleCodes from AgentX store
|
195
|
+
|
196
|
+
// AgentX Maximize/Restore Dynamic Widget.
|
197
|
+
const toggle = Desktop.actions.toggleMiximizeRestore(e: Event) // => maximize/restore widgets with toggle-maximize-restore.
|
198
|
+
|
199
|
+
```
|
200
|
+
|
201
|
+
### `Desktop.shortcutKey` sub-module
|
202
|
+
|
203
|
+
`Desktop.shortcutKey` sub-module is intended to register and call shortcut keys actions from widgets.
|
204
|
+
|
205
|
+
```Javascript
|
206
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
207
|
+
|
208
|
+
//...
|
209
|
+
|
210
|
+
/*
|
211
|
+
Supposing Desktop.config.init() was called
|
212
|
+
*/
|
213
|
+
|
214
|
+
console.log(Desktop.shortcutKey.DEFAULT_SHORTCUT_KEYS); //=> logs default shortcut keys
|
215
|
+
|
216
|
+
console.log(Desktop.shortcutKey.MODIFIERS); //=> logs keys modifiers
|
217
|
+
|
218
|
+
console.log(Desktop.shortcutKey.REGISTERED_KEYS); //=> logs registered keys
|
219
|
+
|
220
|
+
console.log(Desktop.shortcutKey.getRegisteredKeys()); //=> logs service registered keys
|
221
|
+
|
222
|
+
Desktop.shortcutKey.listenKeyPress((event) => {...}); //=> listen shortcuts key press
|
223
|
+
|
224
|
+
Desktop.shortcutKey.listenKeyConflict((event) => {...}); //=> listen shortcuts key conflict
|
225
|
+
|
226
|
+
Desktop.shortcutKey.listenConflictResolved(() => {}); //=> listen to shortcut key conflict resolved status
|
227
|
+
|
228
|
+
Desktop.shortcutKey.register([ {...}, {...}, ... ]); //=> registering shortcut keys actions
|
229
|
+
|
230
|
+
Desktop.shortcutKey.unregisterKeys('widget-one-example'); //=> used to unregister on unmount, widgetElement used for register should be provided
|
231
|
+
|
232
|
+
//...
|
233
|
+
```
|
234
|
+
|
235
|
+
### `Desktop.agentContact` sub-module
|
236
|
+
|
237
|
+
`Desktop.agentContact` sub-module is intended to make aqm requests and listen to notifs events related to agent-contact entity.
|
238
|
+
|
239
|
+
```Javascript
|
240
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
241
|
+
|
242
|
+
//...
|
243
|
+
|
244
|
+
/*
|
245
|
+
Supposing Desktop.config.init() was called
|
246
|
+
*/
|
247
|
+
|
248
|
+
// List of available agent-contact aqm reqs:
|
249
|
+
await Desktop.agentContact.accept({ ... });
|
250
|
+
await Desktop.agentContact.consultAccept({ ... });
|
251
|
+
await Desktop.agentContact.buddyAgents({ ... });
|
252
|
+
await Desktop.agentContact.end({ ... });
|
253
|
+
await Desktop.agentContact.consultEnd({ ... });
|
254
|
+
await Desktop.agentContact.cancelCtq({ ... });
|
255
|
+
await Desktop.agentContact.wrapup({ ... });
|
256
|
+
await Desktop.agentContact.vteamTransfer({ ... });
|
257
|
+
await Desktop.agentContact.blindTransfer({ ... });
|
258
|
+
await Desktop.agentContact.hold({ ... });
|
259
|
+
await Desktop.agentContact.unHold({ ... });
|
260
|
+
await Desktop.agentContact.consult({ ... });
|
261
|
+
await Desktop.agentContact.decline({ ... });
|
262
|
+
await Desktop.agentContact.consultTransfer({ ... });
|
263
|
+
await Desktop.agentContact.vteamList({ ... });
|
264
|
+
await Desktop.agentContact.pauseRecording({ ... });
|
265
|
+
await Desktop.agentContact.resumeRecording({ ... });
|
266
|
+
|
267
|
+
// List of new routing API's
|
268
|
+
await Desktop.agentContact.acceptV2({ ... });
|
269
|
+
await Desktop.agentContact.cancelTaskV2({ ... });
|
270
|
+
await Desktop.agentContact.endV2({ ... });
|
271
|
+
await Desktop.agentContact.pauseRecordingV2({ ... });
|
272
|
+
await Desktop.agentContact.resumeRecordingV2({ ... });
|
273
|
+
await Desktop.agentContact.wrapupV2({ ... });
|
274
|
+
await Desktop.agentContact.consultV2({ ... });
|
275
|
+
await Desktop.agentContact.consultEndV2({ ... });
|
276
|
+
await Desktop.agentContact.consultConferenceV2({ ... });
|
277
|
+
await Desktop.agentContact.exitConference({ ... });
|
278
|
+
await Desktop.agentContact.vteamTransferV2({ ... });
|
279
|
+
await Desktop.agentContact.blindTransferV2({ ... });
|
280
|
+
await Desktop.agentContact.consultTransferV2({ ... });
|
281
|
+
await Desktop.agentContact.buddyAgentsV2({ ... });
|
282
|
+
|
283
|
+
// List of available agent-contact aqm notifs events:
|
284
|
+
Desktop.agentContact.addEventListener("eAgentContact", msg => console.log(msg));
|
285
|
+
Desktop.agentContact.addEventListener("eAgentContactAssigned", msg => console.log(msg));
|
286
|
+
Desktop.agentContact.addEventListener("eAgentContactEnded", msg => console.log(msg));
|
287
|
+
Desktop.agentContact.addEventListener("eAgentContactWrappedUp", msg => console.log(msg));
|
288
|
+
Desktop.agentContact.addEventListener("eAgentOfferContact", msg => console.log(msg));
|
289
|
+
Desktop.agentContact.addEventListener("eAgentOfferContactRona", msg => console.log(msg));
|
290
|
+
Desktop.agentContact.addEventListener("eAgentOfferConsult", msg => console.log(msg));
|
291
|
+
Desktop.agentContact.addEventListener("eAgentWrapup", msg => console.log(msg));
|
292
|
+
Desktop.agentContact.addEventListener("eAgentContactHeld", msg => console.log(msg));
|
293
|
+
Desktop.agentContact.addEventListener("eAgentContactUnHeld", msg => console.log(msg));
|
294
|
+
Desktop.agentContact.addEventListener("eCallRecordingStarted", msg => console.log(msg));
|
295
|
+
Desktop.agentContact.addEventListener("eAgentConsultCreated", msg => console.log(msg));
|
296
|
+
Desktop.agentContact.addEventListener("eAgentConsultConferenced", msg => console.log(msg));
|
297
|
+
Desktop.agentContact.addEventListener("eAgentConsultEnded", msg => console.log(msg));
|
298
|
+
Desktop.agentContact.addEventListener("eAgentCtqCancelled", msg => console.log(msg));
|
299
|
+
Desktop.agentContact.addEventListener("eAgentConsulting", msg => console.log(msg));
|
300
|
+
Desktop.agentContact.addEventListener("eAgentConsultFailed", msg => console.log(msg));
|
301
|
+
Desktop.agentContact.addEventListener("eAgentConsultEndFailed", msg => console.log(msg));
|
302
|
+
Desktop.agentContact.addEventListener("eAgentCtqFailed", msg => console.log(msg));
|
303
|
+
Desktop.agentContact.addEventListener("eAgentCtqCancelFailed", msg => console.log(msg));
|
304
|
+
Desktop.agentContact.addEventListener("eAgentConsultConferenceEndFailed", msg => console.log(msg));
|
305
|
+
Desktop.agentContact.addEventListener("eAgentMonitorStateChanged", msg => console.log(msg));
|
306
|
+
Desktop.agentContact.addEventListener("eAgentMonitoringEnded", msg => console.log(msg));
|
307
|
+
Desktop.agentContact.addEventListener("eAgentOfferCampaignReserved", msg => console.log(msg));
|
308
|
+
Desktop.agentContact.addEventListener("eAgentAddCampaignReserved", msg => console.log(msg));
|
309
|
+
|
310
|
+
// Module supports removing added listeners like:
|
311
|
+
const listener = msg => console.log(msg);
|
312
|
+
Desktop.agentContact.addEventListener("eAgentContact", listener);
|
313
|
+
Desktop.agentContact.removeEventListener("eAgentContact", listener);
|
314
|
+
|
315
|
+
// Module supports one-time added listeners like:
|
316
|
+
Desktop.agentContact.addOnceEventListener("eAgentContact", listener);
|
317
|
+
Desktop.agentContact.removeOnceEventListener("eAgentContact", listener);
|
318
|
+
|
319
|
+
// Module supports removing all listeners like:
|
320
|
+
Desktop.agentContact.removeAllEventListeners();
|
321
|
+
|
322
|
+
```
|
323
|
+
|
324
|
+
### `Desktop.agentStateInfo` sub-module
|
325
|
+
|
326
|
+
`Desktop.agentStateInfo` sub-module is intended to listen for latest data updates for data:
|
327
|
+
|
328
|
+
```Javascript
|
329
|
+
type LatestInfoData = {
|
330
|
+
teamId?: string;
|
331
|
+
teamName?: string;
|
332
|
+
dn?: string;
|
333
|
+
status?: string;
|
334
|
+
subStatus?: string;
|
335
|
+
idleCodes?: Service.Aqm.Configs.Entity[];
|
336
|
+
wrapupCodes?: Service.Aqm.Configs.Entity[];
|
337
|
+
outDialRegex?: string;
|
338
|
+
isOutboundEnabledForTenant?: boolean;
|
339
|
+
isOutboundEnabledForAgent?: boolean;
|
340
|
+
};
|
341
|
+
```
|
342
|
+
|
343
|
+
```Javascript
|
344
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
345
|
+
|
346
|
+
//...
|
347
|
+
|
348
|
+
/*
|
349
|
+
Supposing Desktop.config.init() was called
|
350
|
+
*/
|
351
|
+
|
352
|
+
// latestData inludes latest data fields
|
353
|
+
const latestData: LatestInfoData = Desktop.agentStateInfo.latestData;
|
354
|
+
|
355
|
+
//...
|
356
|
+
// Cumulative update event supported
|
357
|
+
Desktop.agentStateInfo.addEventListener("updated", updatedList =>
|
358
|
+
console.log(updatedList)
|
359
|
+
/* will log (in case of "dn", "status", "subStatus" fields were updated
|
360
|
+
[
|
361
|
+
{
|
362
|
+
"name": "dn",
|
363
|
+
"value": "+12580258011",
|
364
|
+
"oldValue": ""
|
365
|
+
},
|
366
|
+
{
|
367
|
+
"name": "status",
|
368
|
+
"value": "LoggedIn",
|
369
|
+
"oldValue": "DefaultState"
|
370
|
+
},
|
371
|
+
{
|
372
|
+
"name": "subStatus",
|
373
|
+
"value": "Available",
|
374
|
+
"oldValue": ""
|
375
|
+
}
|
376
|
+
]
|
377
|
+
*/
|
378
|
+
);
|
379
|
+
|
380
|
+
|
381
|
+
// List of available agent-state aqm reqs:
|
382
|
+
await Desktop.agentStateInfo.stateChange({ ... });
|
383
|
+
await Desktop.agentStateInfo.fetchAddressBooks({ ... });
|
384
|
+
|
385
|
+
```
|
386
|
+
|
387
|
+
### `Desktop.dialer` sub-module
|
388
|
+
|
389
|
+
`Desktop.dialer` sub-module is intended to make aqm requests and listen to notifs events related to dialer entity.
|
390
|
+
|
391
|
+
```Javascript
|
392
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
393
|
+
|
394
|
+
//...
|
395
|
+
|
396
|
+
/*
|
397
|
+
Supposing Desktop.config.init() was called
|
398
|
+
*/
|
399
|
+
|
400
|
+
// List of available agent-contact aqm reqs:
|
401
|
+
await Desktop.dialer.startOutdial({ ... });
|
402
|
+
|
403
|
+
// List of available agent-contact aqm notifs events:
|
404
|
+
Desktop.dialer.addEventListener("eOutdialFailed", msg => console.log(msg));
|
405
|
+
|
406
|
+
// Module supports removing added listeners like:
|
407
|
+
const listener = msg => console.log(msg);
|
408
|
+
Desktop.dialer.addEventListener("eOutdialFailed", listener);
|
409
|
+
Desktop.dialer.removeEventListener("eOutdialFailed", listener);
|
410
|
+
|
411
|
+
// Module supports one-time added listeners like:
|
412
|
+
Desktop.dialer.addOnceEventListener("eOutdialFailed", listener);
|
413
|
+
Desktop.dialer.removeOnceEventListener("eOutdialFailed", listener);
|
414
|
+
|
415
|
+
// Module supports removing all listeners like:
|
416
|
+
Desktop.dialer.removeAllEventListeners();
|
417
|
+
|
418
|
+
```
|
419
|
+
|
420
|
+
### `Desktop.monitoring` sub-module
|
421
|
+
|
422
|
+
`Desktop.monitoring` sub-module is intended to make aqm requests and listen to notifs events related to call monitoring entity.
|
423
|
+
|
424
|
+
```Javascript
|
425
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
426
|
+
|
427
|
+
//...
|
428
|
+
|
429
|
+
/*
|
430
|
+
Supposing Desktop.config.init() was called
|
431
|
+
*/
|
432
|
+
|
433
|
+
// Start the monitoring request to aqm:
|
434
|
+
await Desktop.monitoring.startMonitoring({ ... });
|
435
|
+
|
436
|
+
// End the monitoring request to aqm:
|
437
|
+
await Desktop.monitoring.endMonitoring({ ... });
|
438
|
+
|
439
|
+
// Pause the monitoring request to aqm:
|
440
|
+
await Desktop.monitoring.holdMonitoring({ ... });
|
441
|
+
|
442
|
+
// Resume the pause monitoring request to aqm:
|
443
|
+
await Desktop.monitoring.unHoldMonitoring({ ... });
|
444
|
+
|
445
|
+
// Start BargIn request to aqm:
|
446
|
+
await Desktop.monitoring.bargeIn({ ... });
|
447
|
+
|
448
|
+
// Module supports removing added listeners like:
|
449
|
+
const listener = msg => console.log(msg);
|
450
|
+
Desktop.monitoring.addEventListener("eMonitoringOffered", listener);
|
451
|
+
Desktop.monitoring.addEventListener("eMonitoringStarted", listener);
|
452
|
+
Desktop.monitoring.addEventListener("eMonitoringRequestCreateFailed", listener);
|
453
|
+
Desktop.monitoring.addEventListener("eMonitoringFailed", listener);
|
454
|
+
Desktop.monitoring.addEventListener("eMonitoringEnded", listener);
|
455
|
+
Desktop.monitoring.addEventListener("eMonitoringEndFailed", listener);
|
456
|
+
Desktop.monitoring.addEventListener("eMonitoringHeld", listener);
|
457
|
+
Desktop.monitoring.addEventListener("eMonitoringHoldFailed", listener);
|
458
|
+
Desktop.monitoring.addEventListener("eMonitoringUnHeld", listener);
|
459
|
+
Desktop.monitoring.addEventListener("eMonitoringUnHoldFailed", listener);
|
460
|
+
Desktop.monitoring.addEventListener("eAgentMonitorStateChanged", listener);
|
461
|
+
Desktop.monitoring.addEventListener("eAgentMonitorStateChangeFailed", listener);
|
462
|
+
|
463
|
+
Desktop.monitoring.removeEventListener("eMonitoringOffered", listener);
|
464
|
+
Desktop.monitoring.removeEventListener("eMonitoringStarted", listener);
|
465
|
+
Desktop.monitoring.removeEventListener("eMonitoringRequestCreateFailed", listener);
|
466
|
+
Desktop.monitoring.removeEventListener("eMonitoringFailed", listener);
|
467
|
+
Desktop.monitoring.removeEventListener("eMonitoringEnded", listener);
|
468
|
+
Desktop.monitoring.removeEventListener("eMonitoringEndFailed", listener);
|
469
|
+
Desktop.monitoring.removeEventListener("eMonitoringHeld", listener);
|
470
|
+
Desktop.monitoring.removeEventListener("eMonitoringHoldFailed", listener);
|
471
|
+
Desktop.monitoring.removeEventListener("eMonitoringUnHeld", listener);
|
472
|
+
Desktop.monitoring.removeEventListener("eMonitoringUnHoldFailed", listener);
|
473
|
+
Desktop.monitoring.removeEventListener("eAgentMonitorStateChanged", listener);
|
474
|
+
Desktop.monitoring.removeEventListener("eAgentMonitorStateChangeFailed", listener);
|
475
|
+
|
476
|
+
|
477
|
+
// Module supports one-time added listeners like:
|
478
|
+
Desktop.monitoring.addOnceEventListener("eMonitoringOffered", listener);
|
479
|
+
Desktop.monitoring.addOnceEventListener("eMonitoringStarted", listener);
|
480
|
+
Desktop.monitoring.addOnceEventListener("eMonitoringRequestCreateFailed", listener);
|
481
|
+
Desktop.monitoring.addOnceEventListener("eMonitoringFailed", listener);
|
482
|
+
Desktop.monitoring.addOnceEventListener("eMonitoringEnded", listener);
|
483
|
+
Desktop.monitoring.addOnceEventListener("eMonitoringEndFailed", listener);
|
484
|
+
Desktop.monitoring.addOnceEventListener("eMonitoringHeld", listener);
|
485
|
+
Desktop.monitoring.addOnceEventListener("eMonitoringHoldFailed", listener);
|
486
|
+
Desktop.monitoring.addOnceEventListener("eMonitoringUnHeld", listener);
|
487
|
+
Desktop.monitoring.addOnceEventListener("eMonitoringUnHoldFailed", listener);
|
488
|
+
Desktop.monitoring.addOnceEventListener("eAgentMonitorStateChanged", listener);
|
489
|
+
Desktop.monitoring.addOnceEventListener("eAgentMonitorStateChangeFailed", listener);
|
490
|
+
|
491
|
+
Desktop.monitoring.removeOnceEventListener("eMonitoringOffered", listener);
|
492
|
+
Desktop.monitoring.removeOnceEventListener("eMonitoringStarted", listener);
|
493
|
+
Desktop.monitoring.removeOnceEventListener("eMonitoringRequestCreateFailed", listener);
|
494
|
+
Desktop.monitoring.removeOnceEventListener("eMonitoringFailed", listener);
|
495
|
+
Desktop.monitoring.removeOnceEventListener("eMonitoringEnded", listener);
|
496
|
+
Desktop.monitoring.removeOnceEventListener("eMonitoringEndFailed", listener);
|
497
|
+
Desktop.monitoring.removeOnceEventListener("eMonitoringHeld", listener);
|
498
|
+
Desktop.monitoring.removeOnceEventListener("eMonitoringHoldFailed", listener);
|
499
|
+
Desktop.monitoring.removeOnceEventListener("eMonitoringUnHeld", listener);
|
500
|
+
Desktop.monitoring.removeOnceEventListener("eMonitoringUnHoldFailed", listener);
|
501
|
+
Desktop.monitoring.removeOnceEventListener("eAgentMonitorStateChanged", listener);
|
502
|
+
Desktop.monitoring.removeOnceEventListener("eAgentMonitorStateChangeFailed", listener);
|
503
|
+
// Module supports removing all listeners like:
|
504
|
+
Desktop.monitoring.removeAllEventListeners();
|
505
|
+
|
506
|
+
```
|
507
|
+
|
508
|
+
### `Desktop.screenpop` sub-module
|
509
|
+
|
510
|
+
`Desktop.screenpop` sub-module is intended to make aqm requests and listen to notifs events related to screenpop entity.
|
511
|
+
|
512
|
+
```Javascript
|
513
|
+
import { Desktop } from "@wxcc-desktop/sdk";
|
514
|
+
|
515
|
+
//...
|
516
|
+
|
517
|
+
/*
|
518
|
+
Supposing Desktop.config.init() was called
|
519
|
+
*/
|
520
|
+
|
521
|
+
// List of available agent-contact aqm notifs events:
|
522
|
+
Desktop.screenpop.addEventListener("eScreenPop", msg => console.log(msg));
|
523
|
+
|
524
|
+
// Module supports removing added listeners like:
|
525
|
+
const listener = msg => console.log(msg);
|
526
|
+
Desktop.screenpop.addEventListener("eScreenPop", listener);
|
527
|
+
Desktop.screenpop.removeEventListener("eScreenPop", listener);
|
528
|
+
|
529
|
+
// Module supports one-time added listeners like:
|
530
|
+
Desktop.screenpop.addOnceEventListener("eScreenPop", listener);
|
531
|
+
Desktop.screenpop.removeOnceEventListener("eScreenPop", listener);
|
532
|
+
|
533
|
+
// Module supports removing all listeners like:
|
534
|
+
Desktop.screenpop.removeAllEventListeners();
|
535
|
+
|
536
|
+
```
|
537
|
+
|
538
|
+
### `Desktop.postInteraction` sub-module
|
539
|
+
|
540
|
+
`Desktop.postInteraction` sub-module is intended to fetch lists of audio recordings and a specific captured audio recording for supervisors.
|
541
|
+
|
542
|
+
```Javascript
|
543
|
+
/*
|
544
|
+
Supposing Desktop.config.init() was called
|
545
|
+
*/
|
546
|
+
|
547
|
+
// List of recordings between startTime and endTime (in milliseconds)
|
548
|
+
await Desktop.postInteraction.fetchTasks({startTime, endTime, pageNumber});
|
549
|
+
|
550
|
+
// Specific captured audio recording (taskId can be found using above call)
|
551
|
+
await Desktop.postInteraction.fetchCapture({taskId});
|
552
|
+
|
553
|
+
```
|
554
|
+
|
555
|
+
### `Desktop.agentConfigJsApi` sub-module
|
556
|
+
|
557
|
+
`Desktop.agentConfigJsApi` sub-module is intended to fetch Agent configurations from contact center Backend service API's.
|
558
|
+
|
559
|
+
```Javascript
|
560
|
+
/*
|
561
|
+
Supposing Desktop.config.init() was called
|
562
|
+
*/
|
563
|
+
|
564
|
+
// AgentX paginated idleCodes/wrapupCodes:
|
565
|
+
const requestAuxCodes = {
|
566
|
+
workType: "IDLE_CODE" | "WRAP_UP_CODE";
|
567
|
+
page?: number;
|
568
|
+
pageSize?: number;
|
569
|
+
search?: string;
|
570
|
+
customFilter?: string;
|
571
|
+
}
|
572
|
+
const paginatedAuxCodes: await Desktop.agentConfigJsApi.fetchPaginatedAuxCodes(requestAuxCodes);
|
573
|
+
|
574
|
+
```
|
575
|
+
|
576
|
+
### `Desktop.webexMetricsInternal` sub-module
|
577
|
+
|
578
|
+
`Desktop.webexMetricsInternal` sub-module is intended for tracking metrics and events from widgits
|
579
|
+
|
580
|
+
```Javascript
|
581
|
+
/*
|
582
|
+
Supposing Desktop.config.init() was called
|
583
|
+
*/
|
584
|
+
|
585
|
+
// Module supports tracking behavioral events within widgit
|
586
|
+
Desktop.webexMetricsInternal.trackBehavioralEvent(name: string, options?: EventPayload);
|
587
|
+
|
588
|
+
```
|
589
|
+
|
590
|
+
### Publishing the wxcc-desktop/js-api
|
591
|
+
|
592
|
+
For publishing internally to Internal Cisco Repository: `yarn npm:publish:internal`
|
593
|
+
For publishing to both Internal and public Repo : `yarn publish:external`
|
594
|
+
|
595
|
+
`publish:all` responsible for publishing in both first internal repository and then to the external public repository npmjs
|