@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.
- package/dist/cc.js +3 -4
- package/dist/cc.js.map +1 -1
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/metrics/constants.js +2 -0
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/ApiAiAssistant.js +74 -3
- package/dist/services/ApiAiAssistant.js.map +1 -1
- package/dist/services/config/types.js +9 -1
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/task/Task.js +32 -0
- package/dist/services/task/Task.js.map +1 -1
- package/dist/services/task/TaskManager.js +7 -2
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/TaskUtils.js +3 -1
- package/dist/services/task/TaskUtils.js.map +1 -1
- package/dist/services/task/state-machine/TaskStateMachine.js +76 -0
- package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -1
- package/dist/services/task/state-machine/actions.js +113 -23
- package/dist/services/task/state-machine/actions.js.map +1 -1
- package/dist/services/task/state-machine/uiControlsComputer.js +99 -21
- package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/metrics/constants.d.ts +2 -0
- package/dist/types/services/ApiAiAssistant.d.ts +10 -2
- package/dist/types/services/config/types.d.ts +16 -0
- package/dist/types/services/task/Task.d.ts +10 -0
- package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +110 -0
- package/dist/types/services/task/state-machine/actions.d.ts +2 -0
- package/dist/types/types.d.ts +24 -0
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -1
- package/dist/webex.js +1 -1
- package/package.json +1 -1
- package/src/cc.ts +6 -4
- package/src/constants.ts +1 -0
- package/src/metrics/constants.ts +2 -0
- package/src/services/ApiAiAssistant.ts +102 -2
- package/src/services/config/types.ts +8 -0
- package/src/services/task/Task.ts +34 -0
- package/src/services/task/TaskManager.ts +7 -2
- package/src/services/task/TaskUtils.ts +5 -3
- package/src/services/task/ai-docs/AGENTS.md +7 -0
- package/src/services/task/ai-docs/ARCHITECTURE.md +12 -0
- package/src/services/task/state-machine/TaskStateMachine.ts +104 -0
- package/src/services/task/state-machine/actions.ts +151 -25
- package/src/services/task/state-machine/uiControlsComputer.ts +173 -30
- package/src/types.ts +25 -0
- package/test/unit/spec/cc.ts +2 -0
- package/test/unit/spec/services/ApiAiAssistant.ts +105 -17
- package/test/unit/spec/services/task/Task.ts +61 -0
- package/test/unit/spec/services/task/TaskManager.ts +42 -0
- package/test/unit/spec/services/task/TaskUtils.ts +65 -0
- package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +676 -0
- package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +597 -0
- package/test/unit/spec/services/task/voice/WebRTC.ts +99 -106
- package/umd/contact-center.min.js +2 -2
- 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
|
});
|