@webex/contact-center 3.9.0 → 3.10.0-multi-llms.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/cc.js +207 -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/MetricsManager.js +1 -1
  10. package/dist/metrics/MetricsManager.js.map +1 -1
  11. package/dist/metrics/behavioral-events.js +89 -0
  12. package/dist/metrics/behavioral-events.js.map +1 -1
  13. package/dist/metrics/constants.js +32 -2
  14. package/dist/metrics/constants.js.map +1 -1
  15. package/dist/services/AddressBook.js +271 -0
  16. package/dist/services/AddressBook.js.map +1 -0
  17. package/dist/services/EntryPoint.js +227 -0
  18. package/dist/services/EntryPoint.js.map +1 -0
  19. package/dist/services/Queue.js +261 -0
  20. package/dist/services/Queue.js.map +1 -0
  21. package/dist/services/config/constants.js +36 -2
  22. package/dist/services/config/constants.js.map +1 -1
  23. package/dist/services/config/index.js +29 -21
  24. package/dist/services/config/index.js.map +1 -1
  25. package/dist/services/config/types.js +33 -1
  26. package/dist/services/config/types.js.map +1 -1
  27. package/dist/services/core/GlobalTypes.js.map +1 -1
  28. package/dist/services/core/Utils.js +181 -2
  29. package/dist/services/core/Utils.js.map +1 -1
  30. package/dist/services/core/aqm-reqs.js +0 -4
  31. package/dist/services/core/aqm-reqs.js.map +1 -1
  32. package/dist/services/core/constants.js +17 -1
  33. package/dist/services/core/constants.js.map +1 -1
  34. package/dist/services/core/websocket/WebSocketManager.js +0 -4
  35. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  36. package/dist/services/task/TaskManager.js +151 -7
  37. package/dist/services/task/TaskManager.js.map +1 -1
  38. package/dist/services/task/TaskUtils.js +104 -0
  39. package/dist/services/task/TaskUtils.js.map +1 -0
  40. package/dist/services/task/constants.js +26 -1
  41. package/dist/services/task/constants.js.map +1 -1
  42. package/dist/services/task/contact.js +86 -0
  43. package/dist/services/task/contact.js.map +1 -1
  44. package/dist/services/task/index.js +428 -91
  45. package/dist/services/task/index.js.map +1 -1
  46. package/dist/services/task/types.js +12 -0
  47. package/dist/services/task/types.js.map +1 -1
  48. package/dist/types/cc.d.ts +121 -35
  49. package/dist/types/constants.d.ts +1 -0
  50. package/dist/types/index.d.ts +4 -3
  51. package/dist/types/metrics/constants.d.ts +25 -1
  52. package/dist/types/services/AddressBook.d.ts +74 -0
  53. package/dist/types/services/EntryPoint.d.ts +67 -0
  54. package/dist/types/services/Queue.d.ts +76 -0
  55. package/dist/types/services/config/constants.d.ts +35 -1
  56. package/dist/types/services/config/index.d.ts +6 -9
  57. package/dist/types/services/config/types.d.ts +79 -58
  58. package/dist/types/services/core/GlobalTypes.d.ts +25 -0
  59. package/dist/types/services/core/Utils.d.ts +55 -1
  60. package/dist/types/services/core/constants.d.ts +14 -0
  61. package/dist/types/services/task/TaskUtils.d.ts +42 -0
  62. package/dist/types/services/task/constants.d.ts +23 -0
  63. package/dist/types/services/task/contact.d.ts +10 -0
  64. package/dist/types/services/task/index.d.ts +85 -4
  65. package/dist/types/services/task/types.d.ts +245 -21
  66. package/dist/types/types.d.ts +162 -0
  67. package/dist/types/utils/PageCache.d.ts +173 -0
  68. package/dist/types.js +17 -0
  69. package/dist/types.js.map +1 -1
  70. package/dist/utils/PageCache.js +192 -0
  71. package/dist/utils/PageCache.js.map +1 -0
  72. package/dist/webex.js +1 -1
  73. package/package.json +10 -9
  74. package/src/cc.ts +232 -52
  75. package/src/constants.ts +1 -0
  76. package/src/index.ts +17 -2
  77. package/src/logger-proxy.ts +24 -1
  78. package/src/metrics/MetricsManager.ts +1 -1
  79. package/src/metrics/behavioral-events.ts +94 -0
  80. package/src/metrics/constants.ts +37 -1
  81. package/src/services/AddressBook.ts +291 -0
  82. package/src/services/EntryPoint.ts +241 -0
  83. package/src/services/Queue.ts +277 -0
  84. package/src/services/config/constants.ts +42 -2
  85. package/src/services/config/index.ts +30 -30
  86. package/src/services/config/types.ts +59 -58
  87. package/src/services/core/GlobalTypes.ts +27 -0
  88. package/src/services/core/Utils.ts +215 -1
  89. package/src/services/core/aqm-reqs.ts +0 -5
  90. package/src/services/core/constants.ts +16 -0
  91. package/src/services/core/websocket/WebSocketManager.ts +0 -4
  92. package/src/services/task/TaskManager.ts +182 -9
  93. package/src/services/task/TaskUtils.ts +113 -0
  94. package/src/services/task/constants.ts +25 -0
  95. package/src/services/task/contact.ts +80 -0
  96. package/src/services/task/index.ts +497 -71
  97. package/src/services/task/types.ts +264 -20
  98. package/src/types.ts +180 -0
  99. package/src/utils/PageCache.ts +252 -0
  100. package/test/unit/spec/cc.ts +282 -85
  101. package/test/unit/spec/metrics/MetricsManager.ts +0 -1
  102. package/test/unit/spec/metrics/behavioral-events.ts +42 -0
  103. package/test/unit/spec/services/AddressBook.ts +332 -0
  104. package/test/unit/spec/services/EntryPoint.ts +259 -0
  105. package/test/unit/spec/services/Queue.ts +323 -0
  106. package/test/unit/spec/services/config/index.ts +279 -65
  107. package/test/unit/spec/services/core/Utils.ts +282 -1
  108. package/test/unit/spec/services/core/aqm-reqs.ts +1 -3
  109. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +0 -4
  110. package/test/unit/spec/services/task/TaskManager.ts +760 -2
  111. package/test/unit/spec/services/task/TaskUtils.ts +131 -0
  112. package/test/unit/spec/services/task/contact.ts +31 -1
  113. package/test/unit/spec/services/task/index.ts +873 -163
  114. package/umd/contact-center.min.js +2 -2
  115. package/umd/contact-center.min.js.map +1 -1
@@ -110,6 +110,7 @@ export default class Task extends EventEmitter implements ITask {
110
110
  webCallMap: Record<TaskId, CallId>;
111
111
  private wrapupData;
112
112
  autoWrapup?: AutoWrapup;
113
+ private agentId;
113
114
  /**
114
115
  * Creates a new Task instance which provides the following features:
115
116
  * @param contact - The routing contact service instance
@@ -117,7 +118,7 @@ export default class Task extends EventEmitter implements ITask {
117
118
  * @param data - Initial task data
118
119
  * @param wrapupData - Wrap-up configuration data
119
120
  */
120
- constructor(contact: ReturnType<typeof routingContact>, webCallingService: WebCallingService, data: TaskData, wrapupData: WrapupData);
121
+ constructor(contact: ReturnType<typeof routingContact>, webCallingService: WebCallingService, data: TaskData, wrapupData: WrapupData, agentId: string);
121
122
  /**
122
123
  * Sets up the automatic wrap-up timer if wrap-up is required
123
124
  * @private
@@ -226,6 +227,7 @@ export default class Task extends EventEmitter implements ITask {
226
227
  * Puts the current task/interaction on hold.
227
228
  * Emits task:hold event when successful. For voice tasks, this mutes the audio.
228
229
  *
230
+ * @param mediaResourceId - Optional media resource ID to use for the hold operation. If not provided, uses the task's current mediaResourceId
229
231
  * @returns Promise<TaskResponse>
230
232
  * @throws Error if hold operation fails
231
233
  * @example
@@ -246,13 +248,22 @@ export default class Task extends EventEmitter implements ITask {
246
248
  * console.error('Failed to place task on hold:', error);
247
249
  * // Handle error (e.g., show error message, reset UI state)
248
250
  * }
251
+ *
252
+ * // Place task on hold with custom mediaResourceId
253
+ * try {
254
+ * await task.hold('custom-media-resource-id');
255
+ * console.log('Successfully placed task on hold with custom mediaResourceId');
256
+ * } catch (error) {
257
+ * console.error('Failed to place task on hold:', error);
258
+ * }
249
259
  * ```
250
260
  */
251
- hold(): Promise<TaskResponse>;
261
+ hold(mediaResourceId?: string): Promise<TaskResponse>;
252
262
  /**
253
263
  * Resumes the task/interaction that was previously put on hold.
254
264
  * Emits task:resume event when successful. For voice tasks, this restores the audio.
255
265
  *
266
+ * @param mediaResourceId - Optional media resource ID to use for the resume operation. If not provided, uses the task's current mediaResourceId from interaction media
256
267
  * @returns Promise<TaskResponse>
257
268
  * @throws Error if resume operation fails
258
269
  * @example
@@ -273,9 +284,17 @@ export default class Task extends EventEmitter implements ITask {
273
284
  * console.error('Failed to resume task:', error);
274
285
  * // Handle error (e.g., show error message)
275
286
  * }
287
+ *
288
+ * // Resume task from hold with custom mediaResourceId
289
+ * try {
290
+ * await task.resume('custom-media-resource-id');
291
+ * console.log('Successfully resumed task from hold with custom mediaResourceId');
292
+ * } catch (error) {
293
+ * console.error('Failed to resume task:', error);
294
+ * }
276
295
  * ```
277
296
  */
278
- resume(): Promise<TaskResponse>;
297
+ resume(mediaResourceId?: string): Promise<TaskResponse>;
279
298
  /**
280
299
  * Ends the task/interaction with the customer.
281
300
  * Emits task:end event when successful. If task requires wrap-up,
@@ -565,5 +584,67 @@ export default class Task extends EventEmitter implements ITask {
565
584
  * .catch(error => console.error('Failed to complete queue consultation transfer:', error));
566
585
  * ```
567
586
  */
568
- consultTransfer(consultTransferPayload: ConsultTransferPayLoad): Promise<TaskResponse>;
587
+ consultTransfer(consultTransferPayload?: ConsultTransferPayLoad): Promise<TaskResponse>;
588
+ /**
589
+ * Starts a consultation conference by merging the consultation call with the main call
590
+ *
591
+ * Creates a three-way conference between the agent, customer, and consulted party
592
+ * Extracts required consultation data from the current task data
593
+ * On success, emits a `task:conferenceStarted` event
594
+ *
595
+ * @returns Promise<TaskResponse> - Response from the consultation conference API
596
+ * @throws Error if the operation fails or if consultation data is invalid
597
+ *
598
+ * @example
599
+ * ```typescript
600
+ * try {
601
+ * await task.consultConference();
602
+ * console.log('Conference started successfully');
603
+ * } catch (error) {
604
+ * console.error('Failed to start conference:', error);
605
+ * }
606
+ * ```
607
+ */
608
+ consultConference(): Promise<TaskResponse>;
609
+ /**
610
+ * Exits the current conference by removing the agent from the conference call
611
+ *
612
+ * Exits the agent from the conference, leaving the customer and consulted party connected
613
+ * On success, emits a `task:conferenceEnded` event
614
+ *
615
+ * @returns Promise<TaskResponse> - Response from the conference exit API
616
+ * @throws Error if the operation fails or if no active conference exists
617
+ *
618
+ * @example
619
+ * ```typescript
620
+ * try {
621
+ * await task.exitConference();
622
+ * console.log('Successfully exited conference');
623
+ * } catch (error) {
624
+ * console.error('Failed to exit conference:', error);
625
+ * }
626
+ * ```
627
+ */
628
+ exitConference(): Promise<TaskResponse>;
629
+ /**
630
+ * Transfers the current conference to another agent
631
+ *
632
+ * Moves the entire conference (including all participants) to a new agent,
633
+ * while the current agent exits and goes to wrapup
634
+ * On success, the current agent receives `task:conferenceEnded` event
635
+ *
636
+ * @returns Promise<TaskResponse> - Response from the conference transfer API
637
+ * @throws Error if the operation fails or if no active conference exists
638
+ *
639
+ * @example
640
+ * ```typescript
641
+ * try {
642
+ * await task.transferConference();
643
+ * console.log('Conference transferred successfully');
644
+ * } catch (error) {
645
+ * console.error('Failed to transfer conference:', error);
646
+ * }
647
+ * ```
648
+ */
649
+ transferConference(): Promise<TaskResponse>;
569
650
  }
@@ -334,7 +334,139 @@ export declare enum TASK_EVENTS {
334
334
  * });
335
335
  * ```
336
336
  */
337
- TASK_OFFER_CONTACT = "task:offerContact"
337
+ TASK_OFFER_CONTACT = "task:offerContact",
338
+ /**
339
+ * Triggered when a conference is being established
340
+ * @example
341
+ * ```typescript
342
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_ESTABLISHING, (task: ITask) => {
343
+ * console.log('Conference establishing:', task.data.interactionId);
344
+ * // Handle conference setup in progress
345
+ * });
346
+ * ```
347
+ */
348
+ TASK_CONFERENCE_ESTABLISHING = "task:conferenceEstablishing",
349
+ /**
350
+ * Triggered when a conference is started successfully
351
+ * @example
352
+ * ```typescript
353
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_STARTED, (task: ITask) => {
354
+ * console.log('Conference started:', task.data.interactionId);
355
+ * // Handle conference start
356
+ * });
357
+ * ```
358
+ */
359
+ TASK_CONFERENCE_STARTED = "task:conferenceStarted",
360
+ /**
361
+ * Triggered when a conference fails to start
362
+ * @example
363
+ * ```typescript
364
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_FAILED, (task: ITask) => {
365
+ * console.log('Conference failed:', task.data.interactionId);
366
+ * // Handle conference failure
367
+ * });
368
+ * ```
369
+ */
370
+ TASK_CONFERENCE_FAILED = "task:conferenceFailed",
371
+ /**
372
+ * Triggered when a conference is ended successfully
373
+ * @example
374
+ * ```typescript
375
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_ENDED, (task: ITask) => {
376
+ * console.log('Conference ended:', task.data.interactionId);
377
+ * // Handle conference end
378
+ * });
379
+ * ```
380
+ */
381
+ TASK_CONFERENCE_ENDED = "task:conferenceEnded",
382
+ /**
383
+ * Triggered when a participant joins the conference
384
+ * @example
385
+ * ```typescript
386
+ * task.on(TASK_EVENTS.TASK_PARTICIPANT_JOINED, (task: ITask) => {
387
+ * console.log('Participant joined conference:', task.data.interactionId);
388
+ * // Handle participant joining
389
+ * });
390
+ * ```
391
+ */
392
+ TASK_PARTICIPANT_JOINED = "task:participantJoined",
393
+ /**
394
+ * Triggered when a participant leaves the conference
395
+ * @example
396
+ * ```typescript
397
+ * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT, (task: ITask) => {
398
+ * console.log('Participant left conference:', task.data.interactionId);
399
+ * // Handle participant leaving
400
+ * });
401
+ * ```
402
+ */
403
+ TASK_PARTICIPANT_LEFT = "task:participantLeft",
404
+ /**
405
+ * Triggered when conference transfer is successful
406
+ * @example
407
+ * ```typescript
408
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFERRED, (task: ITask) => {
409
+ * console.log('Conference transferred:', task.data.interactionId);
410
+ * // Handle successful conference transfer
411
+ * });
412
+ * ```
413
+ */
414
+ TASK_CONFERENCE_TRANSFERRED = "task:conferenceTransferred",
415
+ /**
416
+ * Triggered when conference transfer fails
417
+ * @example
418
+ * ```typescript
419
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFER_FAILED, (task: ITask) => {
420
+ * console.log('Conference transfer failed:', task.data.interactionId);
421
+ * // Handle failed conference transfer
422
+ * });
423
+ * ```
424
+ */
425
+ TASK_CONFERENCE_TRANSFER_FAILED = "task:conferenceTransferFailed",
426
+ /**
427
+ * Triggered when ending a conference fails
428
+ * @example
429
+ * ```typescript
430
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_END_FAILED, (task: ITask) => {
431
+ * console.log('Conference end failed:', task.data.interactionId);
432
+ * // Handle failed conference end
433
+ * });
434
+ * ```
435
+ */
436
+ TASK_CONFERENCE_END_FAILED = "task:conferenceEndFailed",
437
+ /**
438
+ * Triggered when participant exit from conference fails
439
+ * @example
440
+ * ```typescript
441
+ * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT_FAILED, (task: ITask) => {
442
+ * console.log('Participant failed to leave conference:', task.data.interactionId);
443
+ * // Handle failed participant exit
444
+ * });
445
+ * ```
446
+ */
447
+ TASK_PARTICIPANT_LEFT_FAILED = "task:participantLeftFailed",
448
+ /**
449
+ * Triggered when a contact is merged
450
+ * @example
451
+ * ```typescript
452
+ * task.on(TASK_EVENTS.TASK_MERGED, (task: ITask) => {
453
+ * console.log('Contact merged:', task.data.interactionId);
454
+ * // Handle contact merge
455
+ * });
456
+ * ```
457
+ */
458
+ TASK_MERGED = "task:merged",
459
+ /**
460
+ * Triggered when a participant enters post-call activity state
461
+ * @example
462
+ * ```typescript
463
+ * task.on(TASK_EVENTS.TASK_POST_CALL_ACTIVITY, (task: ITask) => {
464
+ * console.log('Participant in post-call activity:', task.data.interactionId);
465
+ * // Handle post-call activity
466
+ * });
467
+ * ```
468
+ */
469
+ TASK_POST_CALL_ACTIVITY = "task:postCallActivity"
338
470
  }
339
471
  /**
340
472
  * Represents a customer interaction within the contact center system
@@ -572,6 +704,8 @@ export type TaskData = {
572
704
  isConsulted?: boolean;
573
705
  /** Indicates if the task is in conference state */
574
706
  isConferencing: boolean;
707
+ /** Indicates if a conference is currently in progress (2+ active agents) */
708
+ isConferenceInProgress?: boolean;
575
709
  /** Identifier of agent who last updated the task */
576
710
  updatedBy?: string;
577
711
  /** Type of destination for transfer/consult */
@@ -594,6 +728,8 @@ export type TaskData = {
594
728
  isWebCallMute?: boolean;
595
729
  /** Identifier for reservation interaction */
596
730
  reservationInteractionId?: string;
731
+ /** Identifier for the reserved agent channel (used for campaign tasks) */
732
+ reservedAgentChannelId?: string;
597
733
  /** Indicates if wrap-up is required for this task */
598
734
  wrapUpRequired?: boolean;
599
735
  };
@@ -875,6 +1011,8 @@ export type DialerPayload = {
875
1011
  mediaType: 'telephony' | 'chat' | 'social' | 'email';
876
1012
  /** The outbound type for the task */
877
1013
  outboundType: 'OUTDIAL' | 'CALLBACK' | 'EXECUTE_FLOW';
1014
+ /** The Outdial ANI number that will be used while making a call to the customer. */
1015
+ origin: string;
878
1016
  };
879
1017
  /**
880
1018
  * Data structure for cleaning up contact resources
@@ -938,15 +1076,15 @@ export interface ITask extends EventEmitter {
938
1076
  */
939
1077
  autoWrapup?: AutoWrapup;
940
1078
  /**
941
- * cancels the auto-wrapup timer for the task
942
- * This method stops the auto-wrapup process if it is currently active
1079
+ * Cancels the auto-wrapup timer for the task.
1080
+ * This method stops the auto-wrapup process if it is currently active.
943
1081
  * Note: This is supported only in single session mode. Not supported in multi-session mode.
944
1082
  * @returns void
945
1083
  */
946
1084
  cancelAutoWrapupTimer(): void;
947
1085
  /**
948
- * Deregisters all web call event listeners
949
- * Used when cleaning up task resources
1086
+ * Deregisters all web call event listeners.
1087
+ * Used when cleaning up task resources.
950
1088
  * @ignore
951
1089
  */
952
1090
  unregisterWebCallListeners(): void;
@@ -964,7 +1102,7 @@ export interface ITask extends EventEmitter {
964
1102
  * @returns Promise<TaskResponse>
965
1103
  * @example
966
1104
  * ```typescript
967
- * task.accept();
1105
+ * await task.accept();
968
1106
  * ```
969
1107
  */
970
1108
  accept(): Promise<TaskResponse>;
@@ -973,44 +1111,54 @@ export interface ITask extends EventEmitter {
973
1111
  * @returns Promise<TaskResponse>
974
1112
  * @example
975
1113
  * ```typescript
976
- * task.decline();
1114
+ * await task.decline();
977
1115
  * ```
978
1116
  */
979
1117
  decline(): Promise<TaskResponse>;
980
1118
  /**
981
- * Places the current task on hold
1119
+ * Places the current task on hold.
1120
+ * @param mediaResourceId - Optional media resource ID to use for the hold operation. If not provided, uses the task's current mediaResourceId
982
1121
  * @returns Promise<TaskResponse>
983
1122
  * @example
984
1123
  * ```typescript
985
- * task.hold();
1124
+ * // Hold with default mediaResourceId
1125
+ * await task.hold();
1126
+ *
1127
+ * // Hold with custom mediaResourceId
1128
+ * await task.hold('custom-media-resource-id');
986
1129
  * ```
987
1130
  */
988
- hold(): Promise<TaskResponse>;
1131
+ hold(mediaResourceId?: string): Promise<TaskResponse>;
989
1132
  /**
990
- * Resumes a task that was previously on hold
1133
+ * Resumes a task that was previously on hold.
1134
+ * @param mediaResourceId - Optional media resource ID to use for the resume operation. If not provided, uses the task's current mediaResourceId from interaction media
991
1135
  * @returns Promise<TaskResponse>
992
1136
  * @example
993
1137
  * ```typescript
994
- * task.resume();
1138
+ * // Resume with default mediaResourceId
1139
+ * await task.resume();
1140
+ *
1141
+ * // Resume with custom mediaResourceId
1142
+ * await task.resume('custom-media-resource-id');
995
1143
  * ```
996
1144
  */
997
- resume(): Promise<TaskResponse>;
1145
+ resume(mediaResourceId?: string): Promise<TaskResponse>;
998
1146
  /**
999
- * Ends/terminates the current task
1147
+ * Ends/terminates the current task.
1000
1148
  * @returns Promise<TaskResponse>
1001
1149
  * @example
1002
1150
  * ```typescript
1003
- * task.end();
1151
+ * await task.end();
1004
1152
  * ```
1005
1153
  */
1006
1154
  end(): Promise<TaskResponse>;
1007
1155
  /**
1008
- * Initiates wrap-up process for the task with specified details
1156
+ * Initiates wrap-up process for the task with specified details.
1009
1157
  * @param wrapupPayload - Wrap-up details including reason and auxiliary code
1010
1158
  * @returns Promise<TaskResponse>
1011
1159
  * @example
1012
1160
  * ```typescript
1013
- * task.wrapup({
1161
+ * await task.wrapup({
1014
1162
  * wrapUpReason: "Customer issue resolved",
1015
1163
  * auxCodeId: "RESOLVED"
1016
1164
  * });
@@ -1018,24 +1166,100 @@ export interface ITask extends EventEmitter {
1018
1166
  */
1019
1167
  wrapup(wrapupPayload: WrapupPayLoad): Promise<TaskResponse>;
1020
1168
  /**
1021
- * Pauses the recording for current task
1169
+ * Pauses the recording for current task.
1022
1170
  * @returns Promise<TaskResponse>
1023
1171
  * @example
1024
1172
  * ```typescript
1025
- * task.pauseRecording();
1173
+ * await task.pauseRecording();
1026
1174
  * ```
1027
1175
  */
1028
1176
  pauseRecording(): Promise<TaskResponse>;
1029
1177
  /**
1030
- * Resumes a previously paused recording
1178
+ * Resumes a previously paused recording.
1031
1179
  * @param resumeRecordingPayload - Parameters for resuming the recording
1032
1180
  * @returns Promise<TaskResponse>
1033
1181
  * @example
1034
1182
  * ```typescript
1035
- * task.resumeRecording({
1183
+ * await task.resumeRecording({
1036
1184
  * autoResumed: false
1037
1185
  * });
1038
1186
  * ```
1039
1187
  */
1040
1188
  resumeRecording(resumeRecordingPayload: ResumeRecordingPayload): Promise<TaskResponse>;
1189
+ /**
1190
+ * Initiates a consultation with another agent or queue.
1191
+ * @param consultPayload - Consultation details including destination and type
1192
+ * @returns Promise<TaskResponse>
1193
+ * @example
1194
+ * ```typescript
1195
+ * await task.consult({ to: "agentId", destinationType: "agent" });
1196
+ * ```
1197
+ */
1198
+ consult(consultPayload: ConsultPayload): Promise<TaskResponse>;
1199
+ /**
1200
+ * Ends an ongoing consultation.
1201
+ * @param consultEndPayload - Details for ending the consultation
1202
+ * @returns Promise<TaskResponse>
1203
+ * @example
1204
+ * ```typescript
1205
+ * await task.endConsult({ isConsult: true, taskId: "taskId" });
1206
+ * ```
1207
+ */
1208
+ endConsult(consultEndPayload: ConsultEndPayload): Promise<TaskResponse>;
1209
+ /**
1210
+ * Transfers the task to another agent or queue.
1211
+ * @param transferPayload - Transfer details including destination and type
1212
+ * @returns Promise<TaskResponse>
1213
+ * @example
1214
+ * ```typescript
1215
+ * await task.transfer({ to: "queueId", destinationType: "queue" });
1216
+ * ```
1217
+ */
1218
+ transfer(transferPayload: TransferPayLoad): Promise<TaskResponse>;
1219
+ /**
1220
+ * Transfers the task after consultation.
1221
+ * @param consultTransferPayload - Details for consult transfer (optional)
1222
+ * @returns Promise<TaskResponse>
1223
+ * @example
1224
+ * ```typescript
1225
+ * await task.consultTransfer({ to: "agentId", destinationType: "agent" });
1226
+ * ```
1227
+ */
1228
+ consultTransfer(consultTransferPayload?: ConsultTransferPayLoad): Promise<TaskResponse>;
1229
+ /**
1230
+ * Initiates a consult conference (merge consult call with main call).
1231
+ * @returns Promise<TaskResponse>
1232
+ * @example
1233
+ * ```typescript
1234
+ * await task.consultConference();
1235
+ * ```
1236
+ */
1237
+ consultConference(): Promise<TaskResponse>;
1238
+ /**
1239
+ * Exits from an ongoing conference.
1240
+ * @returns Promise<TaskResponse>
1241
+ * @example
1242
+ * ```typescript
1243
+ * await task.exitConference();
1244
+ * ```
1245
+ */
1246
+ exitConference(): Promise<TaskResponse>;
1247
+ /**
1248
+ * Transfers the conference to another participant.
1249
+ * @returns Promise<TaskResponse>
1250
+ * @example
1251
+ * ```typescript
1252
+ * await task.transferConference();
1253
+ * ```
1254
+ */
1255
+ transferConference(): Promise<TaskResponse>;
1256
+ /**
1257
+ * Toggles mute/unmute for the local audio stream during a WebRTC task.
1258
+ * @returns Promise<void>
1259
+ * @example
1260
+ * ```typescript
1261
+ * await task.toggleMute();
1262
+ * ```
1263
+ */
1264
+ toggleMute(): Promise<void>;
1041
1265
  }
@@ -1,6 +1,7 @@
1
1
  import { CallingClientConfig } from '@webex/calling';
2
2
  import * as Agent from './services/agent/types';
3
3
  import { Profile } from './services/config/types';
4
+ import { PaginatedResponse, BaseSearchParams } from './utils/PageCache';
4
5
  /**
5
6
  * HTTP methods supported by WebexRequest.
6
7
  * @enum {string}
@@ -140,6 +141,10 @@ export interface LogContext {
140
141
  method?: string;
141
142
  interactionId?: string;
142
143
  trackingId?: string;
144
+ /** Additional structured data to include in logs */
145
+ data?: Record<string, any>;
146
+ /** Error object to include in logs */
147
+ error?: Error | unknown;
143
148
  }
144
149
  /**
145
150
  * Available logging severity levels.
@@ -434,6 +439,163 @@ export type StationReLoginResponse = Agent.ReloginSuccess | Error;
434
439
  * @ignore
435
440
  */
436
441
  export type SetStateResponse = Agent.StateChangeSuccess | Error;
442
+ /**
443
+ * AddressBook types
444
+ */
445
+ export interface AddressBookEntry {
446
+ id: string;
447
+ organizationId?: string;
448
+ version?: number;
449
+ name: string;
450
+ number: string;
451
+ createdTime?: number;
452
+ lastUpdatedTime?: number;
453
+ }
454
+ export type AddressBookEntriesResponse = PaginatedResponse<AddressBookEntry>;
455
+ export interface AddressBookEntrySearchParams extends BaseSearchParams {
456
+ addressBookId?: string;
457
+ }
458
+ /**
459
+ * EntryPointRecord types
460
+ */
461
+ export interface EntryPointRecord {
462
+ id: string;
463
+ name: string;
464
+ description?: string;
465
+ type: string;
466
+ isActive: boolean;
467
+ orgId: string;
468
+ createdAt?: string;
469
+ updatedAt?: string;
470
+ settings?: Record<string, any>;
471
+ }
472
+ export type EntryPointListResponse = PaginatedResponse<EntryPointRecord>;
473
+ export type EntryPointSearchParams = BaseSearchParams;
474
+ /**
475
+ * Queue types
476
+ */
477
+ export interface QueueSkillRequirement {
478
+ organizationId?: string;
479
+ id?: string;
480
+ version?: number;
481
+ skillId: string;
482
+ skillName?: string;
483
+ skillType?: string;
484
+ condition: string;
485
+ skillValue: string;
486
+ createdTime?: number;
487
+ lastUpdatedTime?: number;
488
+ }
489
+ export interface QueueAgent {
490
+ id: string;
491
+ ciUserId?: string;
492
+ }
493
+ export interface AgentGroup {
494
+ teamId: string;
495
+ }
496
+ export interface CallDistributionGroup {
497
+ agentGroups: AgentGroup[];
498
+ order: number;
499
+ duration?: number;
500
+ }
501
+ export interface AssistantSkillMapping {
502
+ assistantSkillId?: string;
503
+ assistantSkillUpdatedTime?: number;
504
+ }
505
+ /**
506
+ * Configuration for a contact service queue
507
+ * @public
508
+ */
509
+ export interface ContactServiceQueue {
510
+ /** Organization ID */
511
+ organizationId?: string;
512
+ /** Unique identifier for the queue */
513
+ id?: string;
514
+ /** Version of the queue */
515
+ version?: number;
516
+ /** Name of the Contact Service Queue */
517
+ name: string;
518
+ /** Description of the queue */
519
+ description?: string;
520
+ /** Queue type (INBOUND, OUTBOUND) */
521
+ queueType: 'INBOUND' | 'OUTBOUND';
522
+ /** Whether to check agent availability */
523
+ checkAgentAvailability: boolean;
524
+ /** Channel type (TELEPHONY, EMAIL, SOCIAL_CHANNEL, CHAT, etc.) */
525
+ channelType: 'TELEPHONY' | 'EMAIL' | 'FAX' | 'CHAT' | 'VIDEO' | 'OTHERS' | 'SOCIAL_CHANNEL';
526
+ /** Social channel type for SOCIAL_CHANNEL channelType */
527
+ socialChannelType?: 'MESSAGEBIRD' | 'MESSENGER' | 'WHATSAPP' | 'APPLE_BUSINESS_CHAT' | 'GOOGLE_BUSINESS_MESSAGES';
528
+ /** Service level threshold in seconds */
529
+ serviceLevelThreshold: number;
530
+ /** Maximum number of simultaneous contacts */
531
+ maxActiveContacts: number;
532
+ /** Maximum time in queue in seconds */
533
+ maxTimeInQueue: number;
534
+ /** Default music in queue media file ID */
535
+ defaultMusicInQueueMediaFileId: string;
536
+ /** Timezone for routing strategies */
537
+ timezone?: string;
538
+ /** Whether the queue is active */
539
+ active: boolean;
540
+ /** Whether outdial campaign is enabled */
541
+ outdialCampaignEnabled?: boolean;
542
+ /** Whether monitoring is permitted */
543
+ monitoringPermitted: boolean;
544
+ /** Whether parking is permitted */
545
+ parkingPermitted: boolean;
546
+ /** Whether recording is permitted */
547
+ recordingPermitted: boolean;
548
+ /** Whether recording all calls is permitted */
549
+ recordingAllCallsPermitted: boolean;
550
+ /** Whether pausing recording is permitted */
551
+ pauseRecordingPermitted: boolean;
552
+ /** Recording pause duration in seconds */
553
+ recordingPauseDuration?: number;
554
+ /** Control flow script URL */
555
+ controlFlowScriptUrl: string;
556
+ /** IVR requeue URL */
557
+ ivrRequeueUrl: string;
558
+ /** Overflow number for telephony */
559
+ overflowNumber?: string;
560
+ /** Vendor ID */
561
+ vendorId?: string;
562
+ /** Routing type */
563
+ routingType: 'LONGEST_AVAILABLE_AGENT' | 'SKILLS_BASED' | 'CIRCULAR' | 'LINEAR';
564
+ /** Skills-based routing type */
565
+ skillBasedRoutingType?: 'LONGEST_AVAILABLE_AGENT' | 'BEST_AVAILABLE_AGENT';
566
+ /** Queue routing type */
567
+ queueRoutingType: 'TEAM_BASED' | 'SKILL_BASED' | 'AGENT_BASED';
568
+ /** Queue skill requirements */
569
+ queueSkillRequirements?: QueueSkillRequirement[];
570
+ /** List of agents for agent-based queue */
571
+ agents?: QueueAgent[];
572
+ /** Call distribution groups */
573
+ callDistributionGroups: CallDistributionGroup[];
574
+ /** XSP version */
575
+ xspVersion?: string;
576
+ /** Subscription ID */
577
+ subscriptionId?: string;
578
+ /** Assistant skill mapping */
579
+ assistantSkill?: AssistantSkillMapping;
580
+ /** Whether this is a system default queue */
581
+ systemDefault?: boolean;
582
+ /** User who last updated agents list */
583
+ agentsLastUpdatedByUserName?: string;
584
+ /** Email of user who last updated agents list */
585
+ agentsLastUpdatedByUserEmailPrefix?: string;
586
+ /** When agents list was last updated */
587
+ agentsLastUpdatedTime?: number;
588
+ /** Creation timestamp in epoch millis */
589
+ createdTime?: number;
590
+ /** Last updated timestamp in epoch millis */
591
+ lastUpdatedTime?: number;
592
+ }
593
+ export type ContactServiceQueuesResponse = PaginatedResponse<ContactServiceQueue>;
594
+ export interface ContactServiceQueueSearchParams extends BaseSearchParams {
595
+ desktopProfileFilter?: boolean;
596
+ provisioningView?: boolean;
597
+ singleObjectResponse?: boolean;
598
+ }
437
599
  /**
438
600
  * Response type for buddy agents query operations.
439
601
  * Either a success response with list of buddy agents or an error.