@webex/contact-center 3.9.0-next.9 → 3.10.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.
Files changed (95) hide show
  1. package/dist/cc.js +182 -47
  2. package/dist/cc.js.map +1 -1
  3. package/dist/constants.js +1 -0
  4. package/dist/constants.js.map +1 -1
  5. package/dist/index.js +9 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/logger-proxy.js +24 -1
  8. package/dist/logger-proxy.js.map +1 -1
  9. package/dist/metrics/behavioral-events.js +89 -0
  10. package/dist/metrics/behavioral-events.js.map +1 -1
  11. package/dist/metrics/constants.js +30 -2
  12. package/dist/metrics/constants.js.map +1 -1
  13. package/dist/services/AddressBook.js +271 -0
  14. package/dist/services/AddressBook.js.map +1 -0
  15. package/dist/services/EntryPoint.js +227 -0
  16. package/dist/services/EntryPoint.js.map +1 -0
  17. package/dist/services/Queue.js +261 -0
  18. package/dist/services/Queue.js.map +1 -0
  19. package/dist/services/config/constants.js +36 -2
  20. package/dist/services/config/constants.js.map +1 -1
  21. package/dist/services/config/index.js +29 -21
  22. package/dist/services/config/index.js.map +1 -1
  23. package/dist/services/config/types.js +33 -1
  24. package/dist/services/config/types.js.map +1 -1
  25. package/dist/services/core/Utils.js +42 -1
  26. package/dist/services/core/Utils.js.map +1 -1
  27. package/dist/services/task/TaskManager.js +113 -3
  28. package/dist/services/task/TaskManager.js.map +1 -1
  29. package/dist/services/task/TaskUtils.js +76 -0
  30. package/dist/services/task/TaskUtils.js.map +1 -0
  31. package/dist/services/task/constants.js +26 -1
  32. package/dist/services/task/constants.js.map +1 -1
  33. package/dist/services/task/contact.js +86 -0
  34. package/dist/services/task/contact.js.map +1 -1
  35. package/dist/services/task/index.js +241 -5
  36. package/dist/services/task/index.js.map +1 -1
  37. package/dist/services/task/types.js +14 -0
  38. package/dist/services/task/types.js.map +1 -1
  39. package/dist/types/cc.d.ts +115 -35
  40. package/dist/types/constants.d.ts +1 -0
  41. package/dist/types/index.d.ts +3 -2
  42. package/dist/types/metrics/constants.d.ts +24 -1
  43. package/dist/types/services/AddressBook.d.ts +74 -0
  44. package/dist/types/services/EntryPoint.d.ts +67 -0
  45. package/dist/types/services/Queue.d.ts +76 -0
  46. package/dist/types/services/config/constants.d.ts +35 -1
  47. package/dist/types/services/config/index.d.ts +6 -9
  48. package/dist/types/services/config/types.d.ts +79 -58
  49. package/dist/types/services/core/Utils.d.ts +14 -1
  50. package/dist/types/services/task/TaskUtils.d.ts +28 -0
  51. package/dist/types/services/task/constants.d.ts +23 -0
  52. package/dist/types/services/task/contact.d.ts +10 -0
  53. package/dist/types/services/task/index.d.ts +64 -1
  54. package/dist/types/services/task/types.d.ts +221 -19
  55. package/dist/types/types.d.ts +162 -0
  56. package/dist/types/utils/PageCache.d.ts +173 -0
  57. package/dist/types.js +17 -0
  58. package/dist/types.js.map +1 -1
  59. package/dist/utils/PageCache.js +192 -0
  60. package/dist/utils/PageCache.js.map +1 -0
  61. package/dist/webex.js +1 -1
  62. package/package.json +10 -9
  63. package/src/cc.ts +206 -52
  64. package/src/constants.ts +1 -0
  65. package/src/index.ts +16 -2
  66. package/src/logger-proxy.ts +24 -1
  67. package/src/metrics/behavioral-events.ts +94 -0
  68. package/src/metrics/constants.ts +34 -1
  69. package/src/services/AddressBook.ts +291 -0
  70. package/src/services/EntryPoint.ts +241 -0
  71. package/src/services/Queue.ts +277 -0
  72. package/src/services/config/constants.ts +42 -2
  73. package/src/services/config/index.ts +30 -30
  74. package/src/services/config/types.ts +59 -58
  75. package/src/services/core/Utils.ts +44 -0
  76. package/src/services/task/TaskManager.ts +122 -5
  77. package/src/services/task/TaskUtils.ts +81 -0
  78. package/src/services/task/constants.ts +25 -0
  79. package/src/services/task/contact.ts +80 -0
  80. package/src/services/task/index.ts +300 -4
  81. package/src/services/task/types.ts +239 -18
  82. package/src/types.ts +180 -0
  83. package/src/utils/PageCache.ts +252 -0
  84. package/test/unit/spec/cc.ts +282 -85
  85. package/test/unit/spec/metrics/behavioral-events.ts +42 -0
  86. package/test/unit/spec/services/AddressBook.ts +332 -0
  87. package/test/unit/spec/services/EntryPoint.ts +259 -0
  88. package/test/unit/spec/services/Queue.ts +323 -0
  89. package/test/unit/spec/services/config/index.ts +279 -65
  90. package/test/unit/spec/services/task/TaskManager.ts +382 -0
  91. package/test/unit/spec/services/task/TaskUtils.ts +131 -0
  92. package/test/unit/spec/services/task/contact.ts +31 -1
  93. package/test/unit/spec/services/task/index.ts +242 -8
  94. package/umd/contact-center.min.js +2 -2
  95. package/umd/contact-center.min.js.map +1 -1
package/src/cc.ts CHANGED
@@ -38,19 +38,20 @@ import {
38
38
  MERCURY_DISCONNECTED_SUCCESS,
39
39
  METHODS,
40
40
  } from './constants';
41
+ import {AGENT_STATE_AVAILABLE, AGENT_STATE_AVAILABLE_ID} from './services/config/constants';
41
42
  import {AGENT, WEB_RTC_PREFIX} from './services/constants';
42
43
  import Services from './services';
43
44
  import WebexRequest from './services/core/WebexRequest';
44
45
  import LoggerProxy from './logger-proxy';
45
46
  import {StateChange, Logout, StateChangeSuccess, AGENT_EVENTS} from './services/agent/types';
46
47
  import {getErrorDetails, isValidDialNumber} from './services/core/Utils';
47
- import {Profile, WelcomeEvent, CC_EVENTS, ContactServiceQueue} from './services/config/types';
48
48
  import {
49
- AGENT_STATE_AVAILABLE,
50
- AGENT_STATE_AVAILABLE_ID,
51
- DEFAULT_PAGE,
52
- DEFAULT_PAGE_SIZE,
53
- } from './services/config/constants';
49
+ Profile,
50
+ WelcomeEvent,
51
+ CC_EVENTS,
52
+ OutdialAniEntriesResponse,
53
+ OutdialAniParams,
54
+ } from './services/config/types';
54
55
  import {ConnectionLostDetails} from './services/core/websocket/types';
55
56
  import TaskManager from './services/task/TaskManager';
56
57
  import WebCallingService from './services/WebCallingService';
@@ -58,6 +59,15 @@ import {ITask, TASK_EVENTS, TaskResponse, DialerPayload} from './services/task/t
58
59
  import MetricsManager from './metrics/MetricsManager';
59
60
  import {METRIC_EVENT_NAMES} from './metrics/constants';
60
61
  import {Failure} from './services/core/GlobalTypes';
62
+ import EntryPoint from './services/EntryPoint';
63
+ import AddressBook from './services/AddressBook';
64
+ import Queue from './services/Queue';
65
+ import type {
66
+ EntryPointListResponse,
67
+ EntryPointSearchParams,
68
+ ContactServiceQueuesResponse,
69
+ ContactServiceQueueSearchParams,
70
+ } from './types';
61
71
 
62
72
  /**
63
73
  * The main Contact Center plugin class that enables integration with Webex Contact Center.
@@ -163,6 +173,7 @@ import {Failure} from './services/core/GlobalTypes';
163
173
  *
164
174
  * @public
165
175
  */
176
+
166
177
  export default class ContactCenter extends WebexPlugin implements IContactCenter {
167
178
  /**
168
179
  * The plugin's unique namespace identifier in the Webex SDK.
@@ -243,6 +254,71 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
243
254
  */
244
255
  private metricsManager: MetricsManager;
245
256
 
257
+ /**
258
+ * API instance for managing Webex Contact Center entry points
259
+ * Provides functionality to fetch entry points with caching support
260
+ * @type {EntryPoint}
261
+ * @public
262
+ * @example
263
+ * ```typescript
264
+ * const cc = webex.cc;
265
+ * await cc.register();
266
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
267
+ *
268
+ * // Access EntryPointRecord
269
+ * const response = await cc.entryPoint.getEntryPoints({
270
+ * page: 0,
271
+ * pageSize: 50
272
+ * });
273
+ * ```
274
+ */
275
+ private entryPoint: EntryPoint;
276
+
277
+ /**
278
+ * API instance for managing Webex Contact Center address book contacts
279
+ * Provides functionality to fetch address book entries with caching support
280
+ * @type {AddressBook}
281
+ * @public
282
+ * @example
283
+ * ```typescript
284
+ * const cc = webex.cc;
285
+ * await cc.register();
286
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
287
+ *
288
+ * // Access AddressBook API
289
+ * const response = await cc.addressBook.getEntries({
290
+ * page: 0,
291
+ * pageSize: 25
292
+ * });
293
+ * ```
294
+ */
295
+ public addressBook: AddressBook;
296
+
297
+ /**
298
+ * API instance for managing Webex Contact Center queues
299
+ * Provides functionality to fetch queues with caching support
300
+ * @type {Queue}
301
+ * @public
302
+ * @example
303
+ * ```typescript
304
+ * const cc = webex.cc;
305
+ * await cc.register();
306
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
307
+ *
308
+ * // Access Queue API
309
+ * const response = await cc.queue.getQueues({
310
+ * page: 0,
311
+ * pageSize: 50
312
+ * });
313
+ *
314
+ * // Filter queues by specific criteria
315
+ * const filteredQueues = await cc.queue.getQueues({
316
+ * filter: 'id=="queue-id-123"'
317
+ * });
318
+ * ```
319
+ */
320
+ private queue: Queue;
321
+
246
322
  /**
247
323
  * Logger utility for Contact Center plugin
248
324
  * Provides consistent logging across the plugin
@@ -289,6 +365,12 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
289
365
  );
290
366
  this.incomingTaskListener();
291
367
 
368
+ // Initialize API instances
369
+ // will have future function for indivdual fetch etc so better be in an object
370
+ this.entryPoint = new EntryPoint(this.$webex);
371
+ this.addressBook = new AddressBook(this.$webex, () => this.agentConfig?.addressBookId);
372
+ this.queue = new Queue(this.$webex);
373
+
292
374
  // Initialize logger
293
375
  LoggerProxy.initialize(this.$webex.logger);
294
376
  });
@@ -615,6 +697,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
615
697
  });
616
698
  // TODO: Make profile a singleton to make it available throughout app/sdk so we dont need to inject info everywhere
617
699
  this.taskManager.setWrapupData(this.agentConfig.wrapUpData);
700
+ this.taskManager.setAgentId(this.agentConfig.agentId);
618
701
 
619
702
  if (
620
703
  this.agentConfig.webRtcEnabled &&
@@ -701,7 +784,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
701
784
  throw error;
702
785
  }
703
786
 
704
- const loginResponse = this.services.agent.stationLogin({
787
+ const loginResponse = await this.services.agent.stationLogin({
705
788
  data: {
706
789
  dialNumber:
707
790
  data.loginOption === LoginOption.BROWSER ? this.agentConfig.agentId : data.dialNumber,
@@ -1253,6 +1336,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1253
1336
  * Makes an outbound call to a specified phone number.
1254
1337
  *
1255
1338
  * @param {string} destination - The phone number to dial (e.g., '+1234567890').
1339
+ * @param {string} origin - The contact center number that will be used while making a call to the customer.
1256
1340
  * Should include country code and be in E.164 format.
1257
1341
  * @returns {Promise<TaskResponse>} Resolves with the task response containing:
1258
1342
  * - interactionId: Unique identifier for the outbound call
@@ -1288,7 +1372,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1288
1372
  *
1289
1373
  * // Start the outbound call
1290
1374
  * const destination = '+1234567890';
1291
- * const task = await cc.startOutdial(destination);
1375
+ * const task = await cc.startOutdial(destination, origin);
1292
1376
  *
1293
1377
  * // Listen for all relevant task events
1294
1378
  * task.on('task:ringing', () => {
@@ -1356,7 +1440,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1356
1440
  * }
1357
1441
  * ```
1358
1442
  */
1359
- public async startOutdial(destination: string): Promise<TaskResponse> {
1443
+ public async startOutdial(destination: string, origin: string): Promise<TaskResponse> {
1360
1444
  LoggerProxy.info('Starting outbound dial', {
1361
1445
  module: CC_FILE,
1362
1446
  method: METHODS.START_OUTDIAL,
@@ -1370,6 +1454,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1370
1454
  // Construct the outdial payload.
1371
1455
  const outDialPayload: DialerPayload = {
1372
1456
  destination,
1457
+ origin,
1373
1458
  entryPointId: this.agentConfig.outDialEp,
1374
1459
  direction: OUTDIAL_DIRECTION,
1375
1460
  attributes: ATTRIBUTES,
@@ -1384,6 +1469,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1384
1469
  {
1385
1470
  ...MetricsManager.getCommonTrackingFieldForAQMResponse(result),
1386
1471
  destination,
1472
+ origin,
1387
1473
  mediaType: OUTDIAL_MEDIA_TYPE,
1388
1474
  },
1389
1475
  ['behavioral', 'business', 'operational']
@@ -1404,6 +1490,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1404
1490
  {
1405
1491
  ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(failure),
1406
1492
  destination,
1493
+ origin,
1407
1494
  mediaType: OUTDIAL_MEDIA_TYPE,
1408
1495
  },
1409
1496
  ['behavioral', 'business', 'operational']
@@ -1414,55 +1501,55 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1414
1501
  }
1415
1502
 
1416
1503
  /**
1417
- * This is used for getting the list of queues to which a task can be consulted or transferred.
1418
- * @param {string} [search] - Optional search string to filter queues by name
1419
- * @param {string} [filter] - Optional OData filter expression (e.g., 'teamId eq "team123"')
1420
- * @param {number} [page=0] - Page number for paginated results, starting at 0
1421
- * @param {number} [pageSize=100] - Number of queues to return per page
1422
- * @returns Promise<ContactServiceQueue[]> Resolves with the list of queues
1423
- * @throws Error If the operation fails
1504
+ * Fetches outdial ANI (Automatic Number Identification) entries for an outdial ANI ID.
1505
+ *
1506
+ * This method retrieves the list of phone numbers that can be used as caller ID when making
1507
+ * outbound calls. The ANI data is associated with an outdial ANI ID and can be filtered
1508
+ * and paginated as needed.
1509
+ *
1510
+ * @param {string} outdialANI - The outdial ANI ID to fetch ANI data for
1511
+ * @param {number} [page] - Optional page number for pagination (0-based)
1512
+ * @param {number} [pageSize] - Optional number of items per page
1513
+ * @param {string} [search] - Optional search term to filter results by name or number
1514
+ * @param {string} [filter] - Optional filter string
1515
+ * @param {string} [attributes] - Optional attributes to include in response
1516
+ * @returns {Promise<OutdialAniEntriesResponse>} Promise resolving to outdial ANI response containing:
1517
+ * - data: Array of ANI entries with number and name
1518
+ * - meta: Pagination metadata
1519
+ * @throws {Error} If the operation fails or agent is not registered
1424
1520
  * @public
1425
1521
  * @example
1426
1522
  * ```typescript
1427
1523
  * const cc = webex.cc;
1428
1524
  * await cc.register();
1429
- * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
1430
1525
  *
1431
- * // Basic usage - get all queues
1432
- * const allQueues = await cc.getQueues();
1526
+ * // Get agent profile to obtain outdial ANI ID
1527
+ * const agentProfile = cc.agentConfig;
1528
+ * const outdialANI = agentProfile.outdialANIId;
1433
1529
  *
1434
- * // Search for specific queues
1435
- * const salesQueues = await cc.getQueues('sales'); // Search for 'sales' in queue names
1530
+ * // Basic usage - get all ANI data for an outdial ANI ID
1531
+ * const aniData = await cc.getOutdialAniEntries({ outdialANI });
1436
1532
  *
1437
- * // Use filtering and pagination
1438
- * const filteredQueues = await cc.getQueues(
1439
- * '', // No search term
1440
- * 'teamId eq "team123"', // Filter by team
1441
- * 0, // First page
1442
- * 50 // 50 items per page
1443
- * );
1533
+ * // With pagination and search
1534
+ * const paginatedAni = await cc.getOutdialAniEntries({
1535
+ * outdialANI,
1536
+ * page: 0,
1537
+ * pageSize: 50,
1538
+ * search: '555' // search for numbers containing '555'
1539
+ * });
1444
1540
  *
1445
- * // Process queue results
1446
- * queues.forEach(queue => {
1447
- * console.log('Queue:', {
1448
- * id: queue.queueId,
1449
- * name: queue.queueName,
1450
- * channelType: queue.channelType,
1451
- * isActive: queue.isActive,
1452
- * description: queue.description
1453
- * });
1541
+ * // Process the results
1542
+ * paginatedAni.forEach(ani => {
1543
+ * console.log(`ANI: ${ani.number} - ${ani.name}`);
1454
1544
  * });
1455
1545
  * ```
1456
1546
  */
1457
- public async getQueues(
1458
- search?: string,
1459
- filter?: string,
1460
- page = DEFAULT_PAGE,
1461
- pageSize = DEFAULT_PAGE_SIZE
1462
- ): Promise<ContactServiceQueue[]> {
1463
- LoggerProxy.info('Fetching queues', {
1547
+ public async getOutdialAniEntries(params: OutdialAniParams): Promise<OutdialAniEntriesResponse> {
1548
+ const {outdialANI, page, pageSize, search, filter, attributes} = params;
1549
+
1550
+ LoggerProxy.info('Fetching outdial ANI entries', {
1464
1551
  module: CC_FILE,
1465
- method: METHODS.GET_QUEUES,
1552
+ method: METHODS.GET_OUTDIAL_ANI_ENTRIES,
1466
1553
  });
1467
1554
 
1468
1555
  const orgId = this.$webex.credentials.getOrgId();
@@ -1470,20 +1557,65 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1470
1557
  if (!orgId) {
1471
1558
  LoggerProxy.error('Org ID not found.', {
1472
1559
  module: CC_FILE,
1473
- method: METHODS.GET_QUEUES,
1560
+ method: METHODS.GET_OUTDIAL_ANI_ENTRIES,
1474
1561
  });
1475
1562
 
1476
1563
  throw new Error('Org ID not found.');
1477
1564
  }
1478
1565
 
1479
- const result = await this.services.config.getQueues(orgId, page, pageSize, search, filter);
1566
+ try {
1567
+ const result = await this.services.config.getOutdialAniEntries(orgId, {
1568
+ outdialANI,
1569
+ page,
1570
+ pageSize,
1571
+ search,
1572
+ filter,
1573
+ attributes,
1574
+ });
1480
1575
 
1481
- LoggerProxy.log(`Successfully retrieved ${result?.length} queues`, {
1482
- module: CC_FILE,
1483
- method: METHODS.GET_QUEUES,
1484
- });
1576
+ this.metricsManager.trackEvent(
1577
+ METRIC_EVENT_NAMES.OUTDIAL_ANI_EP_FETCH_SUCCESS,
1578
+ {
1579
+ outdialANI,
1580
+ resultCount: result?.length || 0,
1581
+ },
1582
+ ['behavioral', 'business', 'operational']
1583
+ );
1485
1584
 
1486
- return result;
1585
+ LoggerProxy.log(`Successfully retrieved outdial ANI entries for ANI ID ${outdialANI}`, {
1586
+ module: CC_FILE,
1587
+ method: METHODS.GET_OUTDIAL_ANI_ENTRIES,
1588
+ });
1589
+
1590
+ return result;
1591
+ } catch (error) {
1592
+ const failure = error.details as Failure;
1593
+ this.metricsManager.trackEvent(
1594
+ METRIC_EVENT_NAMES.OUTDIAL_ANI_EP_FETCH_FAILED,
1595
+ {
1596
+ ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(failure),
1597
+ outdialANI,
1598
+ error,
1599
+ },
1600
+ ['behavioral', 'business', 'operational']
1601
+ );
1602
+
1603
+ LoggerProxy.error(
1604
+ `Failed to fetch outdial ANI entries for ANI ID ${outdialANI} due to: ${error}`,
1605
+ {
1606
+ module: CC_FILE,
1607
+ method: METHODS.GET_OUTDIAL_ANI_ENTRIES,
1608
+ trackingId: failure.trackingId,
1609
+ }
1610
+ );
1611
+
1612
+ const {error: detailedError} = getErrorDetails(
1613
+ error,
1614
+ METHODS.GET_OUTDIAL_ANI_ENTRIES,
1615
+ CC_FILE
1616
+ );
1617
+ throw detailedError;
1618
+ }
1487
1619
  }
1488
1620
 
1489
1621
  /**
@@ -1630,4 +1762,26 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1630
1762
  throw error;
1631
1763
  }
1632
1764
  }
1765
+
1766
+ /**
1767
+ * Returns paginated entry points for the organization.
1768
+ * Thin wrapper around internal EntryPoint instance.
1769
+ * @public
1770
+ */
1771
+ public async getEntryPoints(
1772
+ params: EntryPointSearchParams = {}
1773
+ ): Promise<EntryPointListResponse> {
1774
+ return this.entryPoint.getEntryPoints(params);
1775
+ }
1776
+
1777
+ /**
1778
+ * Returns paginated contact service queues for the organization.
1779
+ * Thin wrapper around internal Queue instance.
1780
+ * @public
1781
+ */
1782
+ public async getQueues(
1783
+ params: ContactServiceQueueSearchParams = {}
1784
+ ): Promise<ContactServiceQueuesResponse> {
1785
+ return this.queue.getQueues(params);
1786
+ }
1633
1787
  }
package/src/constants.ts CHANGED
@@ -42,6 +42,7 @@ export const METHODS = {
42
42
  HANDLE_DEVICE_TYPE: 'handleDeviceType',
43
43
  START_OUTDIAL: 'startOutdial',
44
44
  GET_QUEUES: 'getQueues',
45
+ GET_OUTDIAL_ANI_ENTRIES: 'getOutdialAniEntries',
45
46
  UPLOAD_LOGS: 'uploadLogs',
46
47
  UPDATE_AGENT_PROFILE: 'updateAgentProfile',
47
48
  GET_DEVICE_ID: 'getDeviceId',
package/src/index.ts CHANGED
@@ -26,6 +26,22 @@ export {default as Task} from './services/task';
26
26
  */
27
27
  export {default as routingAgent} from './services/agent';
28
28
 
29
+ // API exports (AddressBook is public, EntryPoint and Queue are accessed via cc wrappers)
30
+ export {default as AddressBook} from './services/AddressBook';
31
+
32
+ /** EntryPoint API types */
33
+ export type {
34
+ EntryPointRecord,
35
+ EntryPointListResponse,
36
+ EntryPointSearchParams,
37
+ AddressBookEntry,
38
+ AddressBookEntriesResponse,
39
+ AddressBookEntrySearchParams,
40
+ ContactServiceQueuesResponse,
41
+ ContactServiceQueueSearchParams,
42
+ ContactServiceQueue,
43
+ } from './types';
44
+
29
45
  // Enums
30
46
  /**
31
47
  * Task Events for Contact Center operations
@@ -157,8 +173,6 @@ export type {
157
173
  export type {
158
174
  /** Profile interface */
159
175
  Profile,
160
- /** Contact service queue interface */
161
- ContactServiceQueue,
162
176
  /** Response type from getUserUsingCI method */
163
177
  AgentResponse,
164
178
  /** Response from getDesktopProfileById */
@@ -105,6 +105,29 @@ export default class LoggerProxy {
105
105
  const interactionId = context.interactionId ? ` - interactionId:${context.interactionId}` : '';
106
106
  const trackingId = context.trackingId ? ` - trackingId:${context.trackingId}` : '';
107
107
 
108
- return `${timestamp} ${LOG_PREFIX} - [${level}]: module:${moduleName} - method:${methodName}${interactionId}${trackingId} - ${message}`;
108
+ // Format additional data if provided
109
+ let dataString = '';
110
+ if (context.data) {
111
+ try {
112
+ dataString = ` - data:${JSON.stringify(context.data)}`;
113
+ } catch (e) {
114
+ dataString = ` - data:[object]`;
115
+ }
116
+ }
117
+
118
+ // Format error if provided
119
+ let errorString = '';
120
+ if (context.error) {
121
+ if (context.error instanceof Error) {
122
+ errorString = ` - error:${context.error.name}:${context.error.message}`;
123
+ if (context.error.stack && level === LOGGING_LEVEL.error) {
124
+ errorString += ` - stack:${context.error.stack}`;
125
+ }
126
+ } else {
127
+ errorString = ` - error:${String(context.error)}`;
128
+ }
129
+ }
130
+
131
+ return `${timestamp} ${LOG_PREFIX} - [${level}]: module:${moduleName} - method:${methodName}${interactionId}${trackingId}${dataString}${errorString} - ${message}`;
109
132
  }
110
133
  }
@@ -302,6 +302,44 @@ const eventTaxonomyMap: Record<string, BehavioralEventTaxonomy> = {
302
302
  verb: 'fail',
303
303
  },
304
304
 
305
+ // Conference Tasks
306
+ [METRIC_EVENT_NAMES.TASK_CONFERENCE_START_SUCCESS]: {
307
+ product,
308
+ agent: 'user',
309
+ target: 'task_conference_start',
310
+ verb: 'complete',
311
+ },
312
+ [METRIC_EVENT_NAMES.TASK_CONFERENCE_START_FAILED]: {
313
+ product,
314
+ agent: 'user',
315
+ target: 'task_conference_start',
316
+ verb: 'fail',
317
+ },
318
+ [METRIC_EVENT_NAMES.TASK_CONFERENCE_END_SUCCESS]: {
319
+ product,
320
+ agent: 'user',
321
+ target: 'task_conference_end',
322
+ verb: 'complete',
323
+ },
324
+ [METRIC_EVENT_NAMES.TASK_CONFERENCE_END_FAILED]: {
325
+ product,
326
+ agent: 'user',
327
+ target: 'task_conference_end',
328
+ verb: 'fail',
329
+ },
330
+ [METRIC_EVENT_NAMES.TASK_CONFERENCE_TRANSFER_SUCCESS]: {
331
+ product,
332
+ agent: 'user',
333
+ target: 'task_conference_transfer',
334
+ verb: 'complete',
335
+ },
336
+ [METRIC_EVENT_NAMES.TASK_CONFERENCE_TRANSFER_FAILED]: {
337
+ product,
338
+ agent: 'user',
339
+ target: 'task_conference_transfer',
340
+ verb: 'fail',
341
+ },
342
+
305
343
  // upload logs
306
344
  [METRIC_EVENT_NAMES.UPLOAD_LOGS_SUCCESS]: {
307
345
  product,
@@ -329,6 +367,62 @@ const eventTaxonomyMap: Record<string, BehavioralEventTaxonomy> = {
329
367
  target: 'agent_device_type_update',
330
368
  verb: 'fail',
331
369
  },
370
+
371
+ // EntryPoint API Events
372
+ [METRIC_EVENT_NAMES.ENTRYPOINT_FETCH_SUCCESS]: {
373
+ product,
374
+ agent: 'user',
375
+ target: 'entrypoint_fetch',
376
+ verb: 'complete',
377
+ },
378
+ [METRIC_EVENT_NAMES.ENTRYPOINT_FETCH_FAILED]: {
379
+ product,
380
+ agent: 'user',
381
+ target: 'entrypoint_fetch',
382
+ verb: 'fail',
383
+ },
384
+
385
+ // AddressBook API Events
386
+ [METRIC_EVENT_NAMES.ADDRESSBOOK_FETCH_SUCCESS]: {
387
+ product,
388
+ agent: 'user',
389
+ target: 'addressbook_fetch',
390
+ verb: 'complete',
391
+ },
392
+ [METRIC_EVENT_NAMES.ADDRESSBOOK_FETCH_FAILED]: {
393
+ product,
394
+ agent: 'user',
395
+ target: 'addressbook_fetch',
396
+ verb: 'fail',
397
+ },
398
+
399
+ // Queue API Events
400
+ [METRIC_EVENT_NAMES.QUEUE_FETCH_SUCCESS]: {
401
+ product,
402
+ agent: 'user',
403
+ target: 'queue_fetch',
404
+ verb: 'complete',
405
+ },
406
+ [METRIC_EVENT_NAMES.QUEUE_FETCH_FAILED]: {
407
+ product,
408
+ agent: 'user',
409
+ target: 'queue_fetch',
410
+ verb: 'fail',
411
+ },
412
+
413
+ // Outdial ANI API Events
414
+ [METRIC_EVENT_NAMES.OUTDIAL_ANI_EP_FETCH_SUCCESS]: {
415
+ product,
416
+ agent: 'user',
417
+ target: 'outdial_ani_ep_fetch',
418
+ verb: 'complete',
419
+ },
420
+ [METRIC_EVENT_NAMES.OUTDIAL_ANI_EP_FETCH_FAILED]: {
421
+ product,
422
+ agent: 'user',
423
+ target: 'outdial_ani_ep_fetch',
424
+ verb: 'fail',
425
+ },
332
426
  };
333
427
 
334
428
  /**
@@ -37,7 +37,6 @@ type Enum<T extends Record<string, unknown>> = T[keyof T];
37
37
  * @property {string} TASK_HOLD_FAILED - Event name for failed task hold.
38
38
  * @property {string} TASK_RESUME_SUCCESS - Event name for successful task resume.
39
39
  * @property {string} TASK_RESUME_FAILED - Event name for failed task resume.
40
- *
41
40
  * @property {string} TASK_CONSULT_START_SUCCESS - Event name for successful consult start.
42
41
  * @property {string} TASK_CONSULT_START_FAILED - Event name for failed consult start.
43
42
  * @property {string} TASK_CONSULT_END_SUCCESS - Event name for successful consult end.
@@ -51,6 +50,13 @@ type Enum<T extends Record<string, unknown>> = T[keyof T];
51
50
  * @property {string} TASK_ACCEPT_CONSULT_SUCCESS - Event name for successful consult acceptance.
52
51
  * @property {string} TASK_ACCEPT_CONSULT_FAILED - Event name for failed consult acceptance.
53
52
  *
53
+ * @property {string} TASK_CONFERENCE_START_SUCCESS - Event name for successful conference start.
54
+ * @property {string} TASK_CONFERENCE_START_FAILED - Event name for failed conference start.
55
+ * @property {string} TASK_CONFERENCE_END_SUCCESS - Event name for successful conference end.
56
+ * @property {string} TASK_CONFERENCE_END_FAILED - Event name for failed conference end.
57
+ * @property {string} TASK_CONFERENCE_TRANSFER_SUCCESS - Event name for successful conference transfer.
58
+ * @property {string} TASK_CONFERENCE_TRANSFER_FAILED - Event name for failed conference transfer.
59
+ *
54
60
  * @property {string} TASK_OUTDIAL_SUCCESS - Event name for successful outdial task.
55
61
  * @property {string} TASK_OUTDIAL_FAILED - Event name for failed outdial task.
56
62
  *
@@ -62,6 +68,9 @@ type Enum<T extends Record<string, unknown>> = T[keyof T];
62
68
  * @property {string} AGENT_DEVICE_TYPE_UPDATE_SUCCESS - Event name for successful agent device type update.
63
69
  * @property {string} AGENT_DEVICE_TYPE_UPDATE_FAILED - Event name for failed agent device type update.
64
70
  *
71
+ * @property {string} OUTDIAL_ANI_EP_FETCH_SUCCESS - Event name for successful outdial ANI entries fetch.
72
+ * @property {string} OUTDIAL_ANI_EP_FETCH_FAILED - Event name for failed outdial ANI entries fetch.
73
+ *
65
74
  * @readonly
66
75
  */
67
76
  export const METRIC_EVENT_NAMES = {
@@ -109,6 +118,14 @@ export const METRIC_EVENT_NAMES = {
109
118
  TASK_ACCEPT_CONSULT_SUCCESS: 'Task Accept Consult Success',
110
119
  TASK_ACCEPT_CONSULT_FAILED: 'Task Accept Consult Failed',
111
120
 
121
+ // Conference Tasks
122
+ TASK_CONFERENCE_START_SUCCESS: 'Task Conference Start Success',
123
+ TASK_CONFERENCE_START_FAILED: 'Task Conference Start Failed',
124
+ TASK_CONFERENCE_END_SUCCESS: 'Task Conference End Success',
125
+ TASK_CONFERENCE_END_FAILED: 'Task Conference End Failed',
126
+ TASK_CONFERENCE_TRANSFER_SUCCESS: 'Task Conference Transfer Success',
127
+ TASK_CONFERENCE_TRANSFER_FAILED: 'Task Conference Transfer Failed',
128
+
112
129
  TASK_OUTDIAL_SUCCESS: 'Task Outdial Success',
113
130
  TASK_OUTDIAL_FAILED: 'Task Outdial Failed',
114
131
 
@@ -122,6 +139,22 @@ export const METRIC_EVENT_NAMES = {
122
139
 
123
140
  AGENT_DEVICE_TYPE_UPDATE_SUCCESS: 'Agent Device Type Update Success',
124
141
  AGENT_DEVICE_TYPE_UPDATE_FAILED: 'Agent Device Type Update Failed',
142
+
143
+ // EntryPoint API Events
144
+ ENTRYPOINT_FETCH_SUCCESS: 'Entrypoint Fetch Success',
145
+ ENTRYPOINT_FETCH_FAILED: 'Entrypoint Fetch Failed',
146
+
147
+ // AddressBook API Events
148
+ ADDRESSBOOK_FETCH_SUCCESS: 'AddressBook Fetch Success',
149
+ ADDRESSBOOK_FETCH_FAILED: 'AddressBook Fetch Failed',
150
+
151
+ // Queue API Events
152
+ QUEUE_FETCH_SUCCESS: 'Queue Fetch Success',
153
+ QUEUE_FETCH_FAILED: 'Queue Fetch Failed',
154
+
155
+ // Outdial ANI Entries API Events
156
+ OUTDIAL_ANI_EP_FETCH_SUCCESS: 'Outdial ANI Entries Fetch Success',
157
+ OUTDIAL_ANI_EP_FETCH_FAILED: 'Outdial ANI Entries Fetch Failed',
125
158
  } as const;
126
159
 
127
160
  /**