@webex/contact-center 3.12.0-task-refactor.7 → 3.12.0-task-refactor.9

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 (58) hide show
  1. package/dist/cc.js +3 -4
  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/metrics/constants.js +2 -0
  6. package/dist/metrics/constants.js.map +1 -1
  7. package/dist/services/ApiAiAssistant.js +74 -3
  8. package/dist/services/ApiAiAssistant.js.map +1 -1
  9. package/dist/services/config/types.js +9 -1
  10. package/dist/services/config/types.js.map +1 -1
  11. package/dist/services/task/Task.js +32 -0
  12. package/dist/services/task/Task.js.map +1 -1
  13. package/dist/services/task/TaskManager.js +7 -2
  14. package/dist/services/task/TaskManager.js.map +1 -1
  15. package/dist/services/task/TaskUtils.js +3 -1
  16. package/dist/services/task/TaskUtils.js.map +1 -1
  17. package/dist/services/task/state-machine/TaskStateMachine.js +76 -0
  18. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -1
  19. package/dist/services/task/state-machine/actions.js +113 -23
  20. package/dist/services/task/state-machine/actions.js.map +1 -1
  21. package/dist/services/task/state-machine/uiControlsComputer.js +99 -21
  22. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -1
  23. package/dist/types/constants.d.ts +1 -0
  24. package/dist/types/metrics/constants.d.ts +2 -0
  25. package/dist/types/services/ApiAiAssistant.d.ts +10 -2
  26. package/dist/types/services/config/types.d.ts +16 -0
  27. package/dist/types/services/task/Task.d.ts +10 -0
  28. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +110 -0
  29. package/dist/types/services/task/state-machine/actions.d.ts +2 -0
  30. package/dist/types/types.d.ts +24 -0
  31. package/dist/types.js +15 -0
  32. package/dist/types.js.map +1 -1
  33. package/dist/webex.js +1 -1
  34. package/package.json +1 -1
  35. package/src/cc.ts +6 -4
  36. package/src/constants.ts +1 -0
  37. package/src/metrics/constants.ts +2 -0
  38. package/src/services/ApiAiAssistant.ts +102 -2
  39. package/src/services/config/types.ts +8 -0
  40. package/src/services/task/Task.ts +34 -0
  41. package/src/services/task/TaskManager.ts +7 -2
  42. package/src/services/task/TaskUtils.ts +5 -3
  43. package/src/services/task/ai-docs/AGENTS.md +7 -0
  44. package/src/services/task/ai-docs/ARCHITECTURE.md +12 -0
  45. package/src/services/task/state-machine/TaskStateMachine.ts +104 -0
  46. package/src/services/task/state-machine/actions.ts +151 -25
  47. package/src/services/task/state-machine/uiControlsComputer.ts +173 -30
  48. package/src/types.ts +25 -0
  49. package/test/unit/spec/cc.ts +2 -0
  50. package/test/unit/spec/services/ApiAiAssistant.ts +105 -17
  51. package/test/unit/spec/services/task/Task.ts +61 -0
  52. package/test/unit/spec/services/task/TaskManager.ts +42 -0
  53. package/test/unit/spec/services/task/TaskUtils.ts +65 -0
  54. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +676 -0
  55. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +597 -0
  56. package/test/unit/spec/services/task/voice/WebRTC.ts +99 -106
  57. package/umd/contact-center.min.js +2 -2
  58. package/umd/contact-center.min.js.map +1 -1
@@ -13,6 +13,7 @@ import {
13
13
  isSecondaryAgent,
14
14
  isSecondaryEpDnAgent,
15
15
  getConsultMediaResourceId,
16
+ getIsConsultInProgressForConferenceControls,
16
17
  } from '../../../../../src/services/task/TaskUtils';
17
18
  import {ITask, Interaction, TaskData} from '../../../../../src/services/task/types';
18
19
  import {LoginOption} from '../../../../../src/types';
@@ -571,4 +572,68 @@ describe('TaskUtils', () => {
571
572
  expect(result).toBe('direct-id');
572
573
  });
573
574
  });
575
+
576
+ describe('getIsConsultInProgressForConferenceControls', () => {
577
+ it('returns false when consultee is reserved but has not joined (RONA)', () => {
578
+ const interaction = {
579
+ participants: {
580
+ 'agent-1': {id: 'agent-1', pType: 'Agent', hasLeft: false, isConsulted: false},
581
+ 'agent-2': {
582
+ id: 'agent-2',
583
+ pType: 'Agent',
584
+ hasLeft: false,
585
+ hasJoined: false,
586
+ isConsulted: true,
587
+ consultState: 'consultReserved',
588
+ },
589
+ 'customer-1': {id: 'customer-1', pType: 'Customer', hasLeft: false},
590
+ },
591
+ media: {
592
+ 'interaction-1': {
593
+ mType: 'mainCall',
594
+ participants: ['customer-1', 'agent-1'],
595
+ },
596
+ 'consult-media': {
597
+ mType: 'consult',
598
+ participants: ['agent-2', 'agent-1'],
599
+ },
600
+ },
601
+ } as any;
602
+
603
+ expect(
604
+ getIsConsultInProgressForConferenceControls(interaction, 'interaction-1', 'agent-1')
605
+ ).toBe(false);
606
+ });
607
+
608
+ it('returns true when consultee is actively consulting', () => {
609
+ const interaction = {
610
+ participants: {
611
+ 'agent-1': {id: 'agent-1', pType: 'Agent', hasLeft: false, isConsulted: false},
612
+ 'agent-2': {
613
+ id: 'agent-2',
614
+ pType: 'Agent',
615
+ hasLeft: false,
616
+ hasJoined: true,
617
+ isConsulted: true,
618
+ consultState: 'consulting',
619
+ },
620
+ 'customer-1': {id: 'customer-1', pType: 'Customer', hasLeft: false},
621
+ },
622
+ media: {
623
+ 'interaction-1': {
624
+ mType: 'mainCall',
625
+ participants: ['customer-1', 'agent-1'],
626
+ },
627
+ 'consult-media': {
628
+ mType: 'consult',
629
+ participants: ['agent-2', 'agent-1'],
630
+ },
631
+ },
632
+ } as any;
633
+
634
+ expect(
635
+ getIsConsultInProgressForConferenceControls(interaction, 'interaction-1', 'agent-1')
636
+ ).toBe(true);
637
+ });
638
+ });
574
639
  });