@wxcc-desktop/sdk 1.3.15 → 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 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
- ```Javascript
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 instantinating object is described in: https://www.i18next.com/overview/api#instance-creation
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
- `Desktop.shortcutKey` sub-module is intended to register and call shortcut keys actions from widgets.
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
 
@@ -272,6 +286,8 @@ Desktop.agentContact.addEventListener("eAgentCtqCancelFailed", msg => console.lo
272
286
  Desktop.agentContact.addEventListener("eAgentConsultConferenceEndFailed", msg => console.log(msg));
273
287
  Desktop.agentContact.addEventListener("eAgentMonitorStateChanged", msg => console.log(msg));
274
288
  Desktop.agentContact.addEventListener("eAgentMonitoringEnded", msg => console.log(msg));
289
+ Desktop.agentContact.addEventListener("eAgentOfferCampaignReserved", msg => console.log(msg));
290
+ Desktop.agentContact.addEventListener("eAgentAddCampaignReserved", msg => console.log(msg));
275
291
 
276
292
  // Module supports removing added listeners like:
277
293
  const listener = msg => console.log(msg);
@@ -288,7 +304,9 @@ Desktop.agentContact.removeAllEventListeners();
288
304
  ```
289
305
 
290
306
  ### `Desktop.agentStateInfo` sub-module
307
+
291
308
  `Desktop.agentStateInfo` sub-module is intended to listen for latest data updates for data:
309
+
292
310
  ```Javascript
293
311
  type LatestInfoData = {
294
312
  teamId?: string;
@@ -309,18 +327,18 @@ import { Desktop } from "@wxcc-desktop/sdk";
309
327
 
310
328
  //...
311
329
 
312
- /*
330
+ /*
313
331
  Supposing Desktop.config.init() was called
314
332
  */
315
333
 
316
- // latestData inludes latest data fields
334
+ // latestData inludes latest data fields
317
335
  const latestData: LatestInfoData = Desktop.agentStateInfo.latestData;
318
336
 
319
337
  //...
320
338
  // Cumulative update event supported
321
339
  Desktop.agentStateInfo.addEventListener("updated", updatedList =>
322
- console.log(updatedList)
323
- /* 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
324
342
  [
325
343
  {
326
344
  "name": "dn",
@@ -337,7 +355,7 @@ Desktop.agentStateInfo.addEventListener("updated", updatedList =>
337
355
  "value": "Available",
338
356
  "oldValue": ""
339
357
  }
340
- ]
358
+ ]
341
359
  */
342
360
  );
343
361
 
@@ -349,13 +367,15 @@ await Desktop.agentStateInfo.fetchAddressBooks({ ... });
349
367
  ```
350
368
 
351
369
  ### `Desktop.dialer` sub-module
370
+
352
371
  `Desktop.dialer` sub-module is intended to make aqm requests and listen to notifs events related to dialer entity.
372
+
353
373
  ```Javascript
354
374
  import { Desktop } from "@wxcc-desktop/sdk";
355
375
 
356
376
  //...
357
377
 
358
- /*
378
+ /*
359
379
  Supposing Desktop.config.init() was called
360
380
  */
361
381
 
@@ -380,13 +400,15 @@ Desktop.dialer.removeAllEventListeners();
380
400
  ```
381
401
 
382
402
  ### `Desktop.monitoring` sub-module
403
+
383
404
  `Desktop.monitoring` sub-module is intended to make aqm requests and listen to notifs events related to call monitoring entity.
405
+
384
406
  ```Javascript
385
407
  import { Desktop } from "@wxcc-desktop/sdk";
386
408
 
387
409
  //...
388
410
 
389
- /*
411
+ /*
390
412
  Supposing Desktop.config.init() was called
391
413
  */
392
414
 
@@ -466,13 +488,15 @@ Desktop.monitoring.removeAllEventListeners();
466
488
  ```
467
489
 
468
490
  ### `Desktop.screenpop` sub-module
491
+
469
492
  `Desktop.screenpop` sub-module is intended to make aqm requests and listen to notifs events related to screenpop entity.
493
+
470
494
  ```Javascript
471
495
  import { Desktop } from "@wxcc-desktop/sdk";
472
496
 
473
497
  //...
474
498
 
475
- /*
499
+ /*
476
500
  Supposing Desktop.config.init() was called
477
501
  */
478
502
 
@@ -493,10 +517,12 @@ Desktop.screenpop.removeAllEventListeners();
493
517
 
494
518
  ```
495
519
 
496
- ### `Desktop.postInteraction` sub-module
520
+ ### `Desktop.postInteraction` sub-module
521
+
497
522
  `Desktop.postInteraction` sub-module is intended to fetch lists of audio recordings and a specific captured audio recording for supervisors.
523
+
498
524
  ```Javascript
499
- /*
525
+ /*
500
526
  Supposing Desktop.config.init() was called
501
527
  */
502
528
 
@@ -508,8 +534,9 @@ await Desktop.postInteraction.fetchCapture({taskId});
508
534
 
509
535
  ```
510
536
 
511
- ### Publishing the wxcc-desktop/js-api
512
- For publishing internally to Internal Cisco Repository: `yarn npm:publish:internal`
513
- For publishing to both Internal and public Repo : `yarn publish:external`
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`
514
541
 
515
542
  `publish:all` responsible for publishing in both first internal repository and then to the external public repository npmjs