@webex/contact-center 3.12.0-task-refactor.10 → 3.12.0-task-refactor.12

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 (110) hide show
  1. package/dist/cc.js +345 -82
  2. package/dist/cc.js.map +1 -1
  3. package/dist/config.js +6 -0
  4. package/dist/config.js.map +1 -1
  5. package/dist/constants.js +3 -0
  6. package/dist/constants.js.map +1 -1
  7. package/dist/metrics/behavioral-events.js +39 -0
  8. package/dist/metrics/behavioral-events.js.map +1 -1
  9. package/dist/metrics/constants.js +8 -1
  10. package/dist/metrics/constants.js.map +1 -1
  11. package/dist/services/ApiAiAssistant.js +3 -0
  12. package/dist/services/ApiAiAssistant.js.map +1 -1
  13. package/dist/services/config/Util.js +1 -1
  14. package/dist/services/config/Util.js.map +1 -1
  15. package/dist/services/config/types.js +10 -0
  16. package/dist/services/config/types.js.map +1 -1
  17. package/dist/services/constants.js +1 -0
  18. package/dist/services/constants.js.map +1 -1
  19. package/dist/services/core/Err.js.map +1 -1
  20. package/dist/services/core/Utils.js +57 -6
  21. package/dist/services/core/Utils.js.map +1 -1
  22. package/dist/services/core/aqm-reqs.js +92 -17
  23. package/dist/services/core/aqm-reqs.js.map +1 -1
  24. package/dist/services/core/websocket/WebSocketManager.js +24 -3
  25. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  26. package/dist/services/index.js +1 -0
  27. package/dist/services/index.js.map +1 -1
  28. package/dist/services/task/Task.js +16 -4
  29. package/dist/services/task/Task.js.map +1 -1
  30. package/dist/services/task/TaskManager.js +158 -6
  31. package/dist/services/task/TaskManager.js.map +1 -1
  32. package/dist/services/task/TaskUtils.js +39 -11
  33. package/dist/services/task/TaskUtils.js.map +1 -1
  34. package/dist/services/task/constants.js +7 -1
  35. package/dist/services/task/constants.js.map +1 -1
  36. package/dist/services/task/dialer.js +129 -0
  37. package/dist/services/task/dialer.js.map +1 -1
  38. package/dist/services/task/state-machine/TaskStateMachine.js +30 -3
  39. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -1
  40. package/dist/services/task/state-machine/actions.js +4 -0
  41. package/dist/services/task/state-machine/actions.js.map +1 -1
  42. package/dist/services/task/state-machine/constants.js +3 -0
  43. package/dist/services/task/state-machine/constants.js.map +1 -1
  44. package/dist/services/task/state-machine/guards.js +23 -0
  45. package/dist/services/task/state-machine/guards.js.map +1 -1
  46. package/dist/services/task/state-machine/types.js.map +1 -1
  47. package/dist/services/task/state-machine/uiControlsComputer.js +1 -1
  48. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -1
  49. package/dist/services/task/types.js +69 -0
  50. package/dist/services/task/types.js.map +1 -1
  51. package/dist/types/cc.d.ts +93 -2
  52. package/dist/types/config.d.ts +6 -0
  53. package/dist/types/constants.d.ts +3 -0
  54. package/dist/types/metrics/constants.d.ts +6 -0
  55. package/dist/types/services/config/types.d.ts +22 -1
  56. package/dist/types/services/core/Err.d.ts +6 -0
  57. package/dist/types/services/core/Utils.d.ts +20 -2
  58. package/dist/types/services/core/aqm-reqs.d.ts +49 -0
  59. package/dist/types/services/core/websocket/WebSocketManager.d.ts +1 -0
  60. package/dist/types/services/core/websocket/connection-service.d.ts +1 -0
  61. package/dist/types/services/task/Task.d.ts +1 -0
  62. package/dist/types/services/task/TaskUtils.d.ts +13 -0
  63. package/dist/types/services/task/constants.d.ts +6 -0
  64. package/dist/types/services/task/dialer.d.ts +45 -0
  65. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +36 -8
  66. package/dist/types/services/task/state-machine/constants.d.ts +3 -0
  67. package/dist/types/services/task/state-machine/guards.d.ts +2 -0
  68. package/dist/types/services/task/state-machine/types.d.ts +11 -0
  69. package/dist/types/services/task/types.d.ts +85 -1
  70. package/dist/types/types.d.ts +2 -0
  71. package/dist/types.js.map +1 -1
  72. package/dist/webex.js +1 -1
  73. package/package.json +2 -2
  74. package/src/cc.ts +452 -102
  75. package/src/config.ts +6 -0
  76. package/src/constants.ts +3 -0
  77. package/src/metrics/behavioral-events.ts +42 -0
  78. package/src/metrics/constants.ts +9 -1
  79. package/src/services/ApiAiAssistant.ts +3 -0
  80. package/src/services/config/Util.ts +1 -1
  81. package/src/services/config/types.ts +12 -1
  82. package/src/services/constants.ts +1 -0
  83. package/src/services/core/Err.ts +3 -0
  84. package/src/services/core/Utils.ts +68 -5
  85. package/src/services/core/aqm-reqs.ts +100 -22
  86. package/src/services/core/websocket/WebSocketManager.ts +23 -2
  87. package/src/services/index.ts +1 -0
  88. package/src/services/task/Task.ts +22 -4
  89. package/src/services/task/TaskManager.ts +175 -7
  90. package/src/services/task/TaskUtils.ts +33 -1
  91. package/src/services/task/constants.ts +6 -0
  92. package/src/services/task/dialer.ts +136 -1
  93. package/src/services/task/state-machine/TaskStateMachine.ts +37 -5
  94. package/src/services/task/state-machine/actions.ts +4 -0
  95. package/src/services/task/state-machine/constants.ts +3 -0
  96. package/src/services/task/state-machine/guards.ts +30 -0
  97. package/src/services/task/state-machine/types.ts +14 -1
  98. package/src/services/task/state-machine/uiControlsComputer.ts +1 -1
  99. package/src/services/task/types.ts +91 -0
  100. package/src/types.ts +6 -1
  101. package/test/unit/spec/cc.ts +432 -26
  102. package/test/unit/spec/services/config/index.ts +30 -2
  103. package/test/unit/spec/services/core/Utils.ts +367 -1
  104. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +90 -1
  105. package/test/unit/spec/services/core/websocket/connection-service.ts +4 -5
  106. package/test/unit/spec/services/task/TaskManager.ts +2334 -145
  107. package/test/unit/spec/services/task/dialer.ts +372 -96
  108. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +47 -0
  109. package/umd/contact-center.min.js +2 -2
  110. package/umd/contact-center.min.js.map +1 -1
@@ -628,6 +628,77 @@ export enum TASK_EVENTS {
628
628
  * ```
629
629
  */
630
630
  TASK_POST_CALL_ACTIVITY = 'task:postCallActivity',
631
+
632
+ /**
633
+ * Triggered when a multi-login task update should hydrate SDK instances without Mobius registration.
634
+ * @example
635
+ * ```typescript
636
+ * task.on(TASK_EVENTS.TASK_MULTI_LOGIN_HYDRATE, (task: ITask) => {
637
+ * console.log('Multi-login hydrate:', task.data.interactionId);
638
+ * });
639
+ * ```
640
+ */
641
+ TASK_MULTI_LOGIN_HYDRATE = 'task:multiLoginHydrate',
642
+
643
+ /**
644
+ * Triggered when a campaign preview contact is offered to the agent
645
+ * @example
646
+ * ```typescript
647
+ * task.on(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_RESERVATION, (data: AgentContact) => {
648
+ * console.log('Campaign preview contact received:', data.interactionId);
649
+ * // Handle campaign preview reservation
650
+ * });
651
+ * ```
652
+ */
653
+ TASK_CAMPAIGN_PREVIEW_RESERVATION = 'task:campaignPreviewReservation',
654
+
655
+ /**
656
+ * Triggered when accepting a campaign preview contact fails
657
+ * @example
658
+ * ```typescript
659
+ * task.on(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_ACCEPT_FAILED, (task: ITask) => {
660
+ * console.log('Campaign preview accept failed:', task.data.interactionId);
661
+ * // Handle accept failure
662
+ * });
663
+ * ```
664
+ */
665
+ TASK_CAMPAIGN_PREVIEW_ACCEPT_FAILED = 'task:campaignPreviewAcceptFailed',
666
+
667
+ /**
668
+ * Triggered when skipping a campaign preview contact fails
669
+ * @example
670
+ * ```typescript
671
+ * task.on(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_SKIP_FAILED, (task: ITask) => {
672
+ * console.log('Campaign preview skip failed:', task.data.interactionId);
673
+ * // Handle skip failure
674
+ * });
675
+ * ```
676
+ */
677
+ TASK_CAMPAIGN_PREVIEW_SKIP_FAILED = 'task:campaignPreviewSkipFailed',
678
+
679
+ /**
680
+ * Triggered when removing a campaign preview contact fails
681
+ * @example
682
+ * ```typescript
683
+ * task.on(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_REMOVE_FAILED, (task: ITask) => {
684
+ * console.log('Campaign preview remove failed:', task.data.interactionId);
685
+ * // Handle remove failure
686
+ * });
687
+ * ```
688
+ */
689
+ TASK_CAMPAIGN_PREVIEW_REMOVE_FAILED = 'task:campaignPreviewRemoveFailed',
690
+
691
+ /**
692
+ * Triggered when a campaign contact is updated (e.g., after skip or remove, when the next contact is offered)
693
+ * @example
694
+ * ```typescript
695
+ * task.on(TASK_EVENTS.TASK_CAMPAIGN_CONTACT_UPDATED, (task: ITask) => {
696
+ * console.log('Campaign contact updated:', task.data.interactionId);
697
+ * // Handle updated campaign contact (e.g., display next contact)
698
+ * });
699
+ * ```
700
+ */
701
+ TASK_CAMPAIGN_CONTACT_UPDATED = 'task:campaignContactUpdated',
631
702
  }
632
703
 
633
704
  /**
@@ -937,6 +1008,14 @@ export type Interaction = {
937
1008
  outdialAgentId?: string;
938
1009
  /** Indicates if the customer has left the call during an active consult */
939
1010
  hasCustomerLeft?: string;
1011
+ /** Indicates if the skip action is disabled for campaign preview contacts */
1012
+ campaignPreviewSkipDisabled?: string;
1013
+ /** Indicates if the remove action is disabled for campaign preview contacts */
1014
+ campaignPreviewRemoveDisabled?: string;
1015
+ /** Auto-action to perform when campaign preview offer times out (ACCEPT, SKIP, REMOVE) */
1016
+ campaignPreviewAutoAction?: string;
1017
+ /** Timestamp (ms) when the campaign preview offer expires */
1018
+ campaignPreviewOfferTimeout?: string;
940
1019
  };
941
1020
  /** Main interaction identifier for related interactions */
942
1021
  mainInteractionId?: string;
@@ -1461,6 +1540,18 @@ export type DialerPayload = {
1461
1540
  origin: string;
1462
1541
  };
1463
1542
 
1543
+ /**
1544
+ * Payload for campaign preview contact operations (accept, skip, remove)
1545
+ * @public
1546
+ */
1547
+ export type PreviewContactPayload = {
1548
+ /** The interaction ID from the campaign reservation */
1549
+ interactionId: string;
1550
+ /** The campaign name (not a UUID). Available from the reservation event at
1551
+ * `task.data.interaction.callProcessingDetails.campaignId` or `task.data.campaignId`. */
1552
+ campaignId: string;
1553
+ };
1554
+
1464
1555
  /**
1465
1556
  * Data structure for cleaning up contact resources
1466
1557
  * @public
package/src/types.ts CHANGED
@@ -156,6 +156,8 @@ export interface CCPluginConfig {
156
156
  };
157
157
  /** Configuration for the calling client */
158
158
  callingClientConfig: CallingClientConfig;
159
+ /** Whether to skip Mobius/WebRTC registration for browser login flows */
160
+ disableWebRTCRegistration?: boolean;
159
161
  }
160
162
 
161
163
  /**
@@ -295,6 +297,8 @@ interface IWebexInternal {
295
297
  get: (service: string) => string;
296
298
  /** Wait for service catalog to be loaded */
297
299
  waitForCatalog: (service: string) => Promise<void>;
300
+ /** Check if current environment is INT (integration) */
301
+ isIntegrationEnvironment: () => boolean;
298
302
  /** Host catalog for service discovery */
299
303
  _hostCatalog: Record<string, ServiceHost[]>;
300
304
  /** Service URLs cache */
@@ -539,7 +543,8 @@ export type RequestBody =
539
543
  | Contact.ConsultTransferPayLoad
540
544
  | Contact.cancelCtq
541
545
  | Contact.WrapupPayLoad
542
- | Contact.DialerPayload;
546
+ | Contact.DialerPayload
547
+ | Contact.PreviewContactPayload;
543
548
 
544
549
  /**
545
550
  * Represents the options to fetch buddy agents for the logged in agent.