@webex/contact-center 3.12.0-webex-services-ready.4 → 3.13.0-next.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.
- package/.sdd/manifest.json +24 -13
- package/ai-docs/ARCHITECTURE.md +1 -1
- package/ai-docs/CONTRACTS.md +21 -3
- package/ai-docs/SECURITY.md +1 -1
- package/ai-docs/SERVICE_STATE.md +4 -0
- package/ai-docs/contact-center-spec.md +53 -6
- package/ai-docs/features/consult-transfer-list-policy/spec/feature-spec.md +362 -0
- package/ai-docs/features/contact-owner-change-refactor.md +78 -0
- package/dist/cc.js +816 -26
- package/dist/cc.js.map +1 -1
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +29 -2
- package/dist/constants.js.map +1 -1
- package/dist/index.js +66 -12
- package/dist/index.js.map +1 -1
- package/dist/metrics/MetricsManager.js +16 -0
- package/dist/metrics/MetricsManager.js.map +1 -1
- package/dist/metrics/behavioral-events.js +110 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +33 -0
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/AddressBook.js +18 -15
- package/dist/services/AddressBook.js.map +1 -1
- package/dist/services/AnswerCallOnWebexService.js +202 -0
- package/dist/services/AnswerCallOnWebexService.js.map +1 -0
- package/dist/services/ApiAiAssistant.js +221 -11
- package/dist/services/ApiAiAssistant.js.map +1 -1
- package/dist/services/EntryPoint.js +46 -68
- package/dist/services/EntryPoint.js.map +1 -1
- package/dist/services/Queue.js +27 -22
- package/dist/services/Queue.js.map +1 -1
- package/dist/services/WebCallingService.js +287 -37
- package/dist/services/WebCallingService.js.map +1 -1
- package/dist/services/WebexCrossClientService.js +225 -0
- package/dist/services/WebexCrossClientService.js.map +1 -0
- package/dist/services/WxAppTelephonyMercurySync.js +111 -0
- package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
- package/dist/services/config/Util.js +46 -46
- package/dist/services/config/Util.js.map +1 -1
- package/dist/services/config/constants.js +34 -77
- package/dist/services/config/constants.js.map +1 -1
- package/dist/services/config/index.js +100 -226
- package/dist/services/config/index.js.map +1 -1
- package/dist/services/config/types.js +55 -35
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/constants.js +11 -1
- package/dist/services/constants.js.map +1 -1
- package/dist/services/core/Err.js.map +1 -1
- package/dist/services/core/Utils.js +25 -1
- package/dist/services/core/Utils.js.map +1 -1
- package/dist/services/core/WebexRequest.js +6 -2
- package/dist/services/core/WebexRequest.js.map +1 -1
- package/dist/services/core/aqm-reqs.js +17 -11
- package/dist/services/core/aqm-reqs.js.map +1 -1
- package/dist/services/core/constants.js +9 -1
- package/dist/services/core/constants.js.map +1 -1
- package/dist/services/core/types.js.map +1 -1
- package/dist/services/core/websocket/WebSocketManager.js +17 -1
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
- package/dist/services/task/Task.js +275 -8
- package/dist/services/task/Task.js.map +1 -1
- package/dist/services/task/TaskFactory.js +11 -6
- package/dist/services/task/TaskFactory.js.map +1 -1
- package/dist/services/task/TaskManager.js +590 -42
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/TaskUtils.js +11 -1
- package/dist/services/task/TaskUtils.js.map +1 -1
- package/dist/services/task/WebexCallingUtils.js +70 -0
- package/dist/services/task/WebexCallingUtils.js.map +1 -0
- package/dist/services/task/constants.js +14 -2
- package/dist/services/task/constants.js.map +1 -1
- package/dist/services/task/contact.js +29 -0
- package/dist/services/task/contact.js.map +1 -1
- package/dist/services/task/digital/Digital.js +4 -3
- package/dist/services/task/digital/Digital.js.map +1 -1
- package/dist/services/task/state-machine/TaskStateMachine.js +162 -53
- package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -1
- package/dist/services/task/state-machine/actions.js +6 -1
- package/dist/services/task/state-machine/actions.js.map +1 -1
- package/dist/services/task/state-machine/guards.js +7 -10
- package/dist/services/task/state-machine/guards.js.map +1 -1
- package/dist/services/task/state-machine/types.js.map +1 -1
- package/dist/services/task/state-machine/uiControlsComputer.js +118 -18
- package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -1
- package/dist/services/task/types.js +47 -1
- package/dist/services/task/types.js.map +1 -1
- package/dist/services/task/voice/Voice.js +477 -17
- package/dist/services/task/voice/Voice.js.map +1 -1
- package/dist/services/task/voice/WebRTC.js +6 -3
- package/dist/services/task/voice/WebRTC.js.map +1 -1
- package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
- package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
- package/dist/services/task/voice/wxAppVoiceMethods.js +395 -0
- package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
- package/dist/services/wxAppDiagnosticLogging.js +159 -0
- package/dist/services/wxAppDiagnosticLogging.js.map +1 -0
- package/dist/services/wxAppTelephonyUtils.js +19 -0
- package/dist/services/wxAppTelephonyUtils.js.map +1 -0
- package/dist/types/cc.d.ts +127 -9
- package/dist/types/config.d.ts +7 -0
- package/dist/types/constants.d.ts +23 -0
- package/dist/types/index.d.ts +38 -17
- package/dist/types/metrics/MetricsManager.d.ts +6 -0
- package/dist/types/metrics/constants.d.ts +31 -0
- package/dist/types/services/AddressBook.d.ts +2 -1
- package/dist/types/services/AnswerCallOnWebexService.d.ts +38 -0
- package/dist/types/services/ApiAiAssistant.d.ts +48 -4
- package/dist/types/services/EntryPoint.d.ts +7 -5
- package/dist/types/services/Queue.d.ts +5 -3
- package/dist/types/services/WebexCrossClientService.d.ts +32 -0
- package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
- package/dist/types/services/config/Util.d.ts +4 -8
- package/dist/types/services/config/constants.d.ts +28 -76
- package/dist/types/services/config/index.d.ts +16 -64
- package/dist/types/services/config/types.d.ts +150 -173
- package/dist/types/services/constants.d.ts +9 -0
- package/dist/types/services/core/Err.d.ts +2 -0
- package/dist/types/services/core/Utils.d.ts +10 -0
- package/dist/types/services/core/WebexRequest.d.ts +1 -0
- package/dist/types/services/core/constants.d.ts +7 -0
- package/dist/types/services/core/types.d.ts +2 -0
- package/dist/types/services/task/Task.d.ts +34 -5
- package/dist/types/services/task/TaskFactory.d.ts +4 -2
- package/dist/types/services/task/TaskUtils.d.ts +6 -0
- package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
- package/dist/types/services/task/constants.d.ts +12 -0
- package/dist/types/services/task/contact.d.ts +4 -0
- package/dist/types/services/task/digital/Digital.d.ts +4 -3
- package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +304 -56
- package/dist/types/services/task/state-machine/guards.d.ts +6 -5
- package/dist/types/services/task/state-machine/types.d.ts +9 -1
- package/dist/types/services/task/types.d.ts +192 -5
- package/dist/types/services/task/voice/Voice.d.ts +68 -11
- package/dist/types/services/task/voice/WebRTC.d.ts +5 -4
- package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
- package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +68 -0
- package/dist/types/services/wxAppDiagnosticLogging.d.ts +63 -0
- package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
- package/dist/types/types.d.ts +125 -13
- package/dist/types/utils/PageCache.d.ts +20 -3
- package/dist/types.js +90 -8
- package/dist/types.js.map +1 -1
- package/dist/utils/PageCache.js +19 -5
- package/dist/utils/PageCache.js.map +1 -1
- package/dist/webex.js +9 -1
- package/dist/webex.js.map +1 -1
- package/package.json +10 -9
- package/src/cc.ts +1047 -48
- package/src/config.ts +7 -0
- package/src/constants.ts +36 -0
- package/src/index.ts +49 -11
- package/src/metrics/MetricsManager.ts +16 -0
- package/src/metrics/ai-docs/metrics-spec.md +138 -21
- package/src/metrics/behavioral-events.ts +112 -0
- package/src/metrics/constants.ts +36 -0
- package/src/services/AddressBook.ts +17 -6
- package/src/services/AnswerCallOnWebexService.ts +239 -0
- package/src/services/ApiAiAssistant.ts +297 -13
- package/src/services/EntryPoint.ts +59 -60
- package/src/services/Queue.ts +29 -12
- package/src/services/WebCallingService.ts +362 -40
- package/src/services/WebexCrossClientService.ts +298 -0
- package/src/services/WxAppTelephonyMercurySync.ts +142 -0
- package/src/services/agent/ai-docs/AGENTS.md +1 -1
- package/src/services/agent/ai-docs/agent-spec.md +1 -0
- package/src/services/ai-docs/AGENTS.md +11 -11
- package/src/services/ai-docs/services-spec.md +25 -5
- package/src/services/config/Util.ts +52 -82
- package/src/services/config/ai-docs/AGENTS.md +35 -40
- package/src/services/config/ai-docs/ARCHITECTURE.md +90 -103
- package/src/services/config/ai-docs/config-spec.md +132 -132
- package/src/services/config/constants.ts +39 -85
- package/src/services/config/index.ts +116 -277
- package/src/services/config/types.ts +145 -195
- package/src/services/constants.ts +10 -0
- package/src/services/core/Err.ts +1 -0
- package/src/services/core/Utils.ts +28 -0
- package/src/services/core/WebexRequest.ts +3 -1
- package/src/services/core/ai-docs/core-spec.md +25 -11
- package/src/services/core/aqm-reqs.ts +18 -12
- package/src/services/core/constants.ts +8 -0
- package/src/services/core/types.ts +33 -1
- package/src/services/core/websocket/WebSocketManager.ts +26 -2
- package/src/services/task/Task.ts +386 -12
- package/src/services/task/TaskFactory.ts +33 -6
- package/src/services/task/TaskManager.ts +857 -41
- package/src/services/task/TaskUtils.ts +13 -0
- package/src/services/task/WebexCallingUtils.ts +136 -0
- package/src/services/task/ai-docs/ARCHITECTURE.md +1 -0
- package/src/services/task/ai-docs/task-spec.md +190 -8
- package/src/services/task/constants.ts +13 -0
- package/src/services/task/contact.ts +30 -0
- package/src/services/task/digital/Digital.ts +11 -4
- package/src/services/task/state-machine/TaskStateMachine.ts +235 -81
- package/src/services/task/state-machine/actions.ts +5 -2
- package/src/services/task/state-machine/ai-docs/AGENTS.md +6 -4
- package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +35 -16
- package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +103 -33
- package/src/services/task/state-machine/guards.ts +7 -10
- package/src/services/task/state-machine/types.ts +16 -1
- package/src/services/task/state-machine/uiControlsComputer.ts +206 -32
- package/src/services/task/types.ts +269 -4
- package/src/services/task/voice/Voice.ts +625 -17
- package/src/services/task/voice/WebRTC.ts +11 -4
- package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
- package/src/services/task/voice/wxAppVoiceMethods.ts +575 -0
- package/src/services/wxAppDiagnosticLogging.ts +286 -0
- package/src/services/wxAppTelephonyUtils.ts +14 -0
- package/src/types.ts +159 -13
- package/src/utils/AGENTS.md +21 -10
- package/src/utils/PageCache.ts +38 -5
- package/src/utils/ai-docs/utils-spec.md +21 -11
- package/src/webex.js +8 -0
- package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
- package/test/unit/spec/cc.ts +3595 -120
- package/test/unit/spec/index.ts +891 -0
- package/test/unit/spec/metrics/MetricsManager.ts +25 -0
- package/test/unit/spec/metrics/behavioral-events.ts +60 -0
- package/test/unit/spec/services/AddressBook.ts +37 -6
- package/test/unit/spec/services/AnswerCallOnWebexService.ts +264 -0
- package/test/unit/spec/services/ApiAiAssistant.ts +269 -8
- package/test/unit/spec/services/EntryPoint.ts +87 -40
- package/test/unit/spec/services/Queue.ts +123 -12
- package/test/unit/spec/services/WebCallingService.ts +483 -54
- package/test/unit/spec/services/WebexCrossClientService.ts +509 -0
- package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +136 -0
- package/test/unit/spec/services/config/Util.ts +501 -0
- package/test/unit/spec/services/config/index.ts +313 -543
- package/test/unit/spec/services/core/Utils.ts +22 -0
- package/test/unit/spec/services/core/WebexRequest.ts +8 -7
- package/test/unit/spec/services/core/aqm-reqs.ts +142 -1
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +64 -14
- package/test/unit/spec/services/task/Task.ts +2257 -11
- package/test/unit/spec/services/task/TaskFactory.ts +56 -2
- package/test/unit/spec/services/task/TaskManager.ts +5559 -1493
- package/test/unit/spec/services/task/TaskUtils.ts +72 -0
- package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
- package/test/unit/spec/services/task/contact.ts +33 -0
- package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +1501 -92
- package/test/unit/spec/services/task/state-machine/guards.ts +210 -8
- package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +445 -7
- package/test/unit/spec/services/task/voice/Voice.ts +1710 -4
- package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
- package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +719 -0
- package/test/unit/spec/services/wxAppDiagnosticLogging.ts +179 -0
- package/test/unit/spec/wellnessSampleUtils.ts +288 -0
- package/typedoc.md +1 -1
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
|
@@ -1,56 +1,42 @@
|
|
|
1
1
|
import {LOST_CONNECTION_RECOVERY_TIMEOUT} from '../core/constants';
|
|
2
|
+
import {WELLNESS_BREAK_REMINDERS_ENABLED} from './constants';
|
|
2
3
|
import {
|
|
4
|
+
AgentProfile,
|
|
3
5
|
AgentResponse,
|
|
4
6
|
AuxCode,
|
|
5
7
|
AuxCodeType,
|
|
6
|
-
DesktopProfileResponse,
|
|
7
8
|
DialPlanEntity,
|
|
8
9
|
Entity,
|
|
9
10
|
IDLE_CODE,
|
|
10
|
-
|
|
11
|
-
OrgSettings,
|
|
11
|
+
OrgDesktopLoginResponse,
|
|
12
12
|
Profile,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
TeamList,
|
|
14
|
+
MicrosoftConfig,
|
|
15
|
+
WebexConfig,
|
|
16
16
|
WRAP_UP_CODE,
|
|
17
|
-
AIFeatureFlagsResponse,
|
|
18
|
-
AIFeatureFlags,
|
|
19
17
|
} from './types';
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
|
-
* Get the
|
|
23
|
-
* @param {
|
|
24
|
-
* @param {string} name
|
|
25
|
-
* @returns {string}
|
|
26
|
-
*/
|
|
27
|
-
const getUrlMapping = (urlMappings: Array<URLMapping>, name: string) => {
|
|
28
|
-
const mappedUrl = urlMappings.find((mapping) => mapping.name === name)?.url;
|
|
29
|
-
|
|
30
|
-
return mappedUrl || '';
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Get the MSFT and Webex configuration
|
|
35
|
-
* @param {DesktopProfileResponse} agentProfileData
|
|
20
|
+
* Get the MSFT configuration
|
|
21
|
+
* @param {MicrosoftConfig} microsoftConfig
|
|
36
22
|
* @returns {Object}
|
|
37
23
|
*/
|
|
38
|
-
const getMsftConfig = (
|
|
24
|
+
const getMsftConfig = (microsoftConfig?: MicrosoftConfig) => {
|
|
39
25
|
return {
|
|
40
|
-
showUserDetailsMS:
|
|
41
|
-
stateSynchronizationMS:
|
|
26
|
+
showUserDetailsMS: microsoftConfig?.showUserDetails ?? false,
|
|
27
|
+
stateSynchronizationMS: microsoftConfig?.stateSynchronization ?? false,
|
|
42
28
|
};
|
|
43
29
|
};
|
|
44
30
|
|
|
45
31
|
/**
|
|
46
32
|
* Get the Webex configuration
|
|
47
|
-
* @param {
|
|
33
|
+
* @param {WebexConfig} webexConfig
|
|
48
34
|
* @returns {Object}
|
|
49
35
|
*/
|
|
50
|
-
const getWebexConfig = (
|
|
36
|
+
const getWebexConfig = (webexConfig?: WebexConfig) => {
|
|
51
37
|
return {
|
|
52
|
-
showUserDetailsWebex:
|
|
53
|
-
stateSynchronizationWebex:
|
|
38
|
+
showUserDetailsWebex: webexConfig?.showUserDetails ?? false,
|
|
39
|
+
stateSynchronizationWebex: webexConfig?.stateSynchronization ?? false,
|
|
54
40
|
};
|
|
55
41
|
};
|
|
56
42
|
|
|
@@ -64,15 +50,16 @@ const getDefaultAgentDN = (agentDNValidation: string) => {
|
|
|
64
50
|
};
|
|
65
51
|
|
|
66
52
|
/**
|
|
67
|
-
* Get the
|
|
53
|
+
* Get the dialplan entries for every active plan in the organization.
|
|
54
|
+
* The desktop-login aggregate does not carry the per-profile `dialPlans` selection, so all active
|
|
55
|
+
* plans apply.
|
|
68
56
|
* @param {Array<DialPlanEntity>} dialPlanData
|
|
69
|
-
* @param {Array<string>} profileDialPlans
|
|
70
57
|
* @returns {Array<Entity>}
|
|
71
58
|
*/
|
|
72
|
-
const getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[]
|
|
59
|
+
const getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[]) => {
|
|
73
60
|
const dialPlanEntries = [];
|
|
74
61
|
dialPlanData.forEach((dailPlan: DialPlanEntity) => {
|
|
75
|
-
if (
|
|
62
|
+
if (dailPlan.active) {
|
|
76
63
|
const filteredPlan = {
|
|
77
64
|
regex: dailPlan.regularExpression,
|
|
78
65
|
prefix: dailPlan.prefix,
|
|
@@ -87,24 +74,17 @@ const getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[], profileDialP
|
|
|
87
74
|
};
|
|
88
75
|
|
|
89
76
|
/**
|
|
90
|
-
* Get the
|
|
77
|
+
* Get the active aux codes of the given type.
|
|
78
|
+
* The desktop-login aggregate does not carry the per-agent restriction lists, so the whole pool
|
|
79
|
+
* returned by the aux-code API applies.
|
|
91
80
|
* @param {Array<AuxCode>} auxCodes
|
|
92
81
|
* @param {AuxCodeType} type
|
|
93
|
-
* @param {Array<string>} specificCodes
|
|
94
82
|
* @returns {Array<Entity>}
|
|
95
83
|
*/
|
|
96
|
-
const getFilterAuxCodes = (
|
|
97
|
-
auxCodes: Array<AuxCode>,
|
|
98
|
-
type: AuxCodeType,
|
|
99
|
-
specificCodes: string[]
|
|
100
|
-
) => {
|
|
84
|
+
const getFilterAuxCodes = (auxCodes: Array<AuxCode>, type: AuxCodeType) => {
|
|
101
85
|
const filteredAuxCodes: Array<Entity> = [];
|
|
102
86
|
auxCodes.forEach((auxCode: AuxCode) => {
|
|
103
|
-
if (
|
|
104
|
-
auxCode.workTypeCode === type &&
|
|
105
|
-
auxCode.active &&
|
|
106
|
-
(specificCodes.length === 0 || specificCodes.includes(auxCode.id))
|
|
107
|
-
) {
|
|
87
|
+
if (auxCode.workTypeCode === type && auxCode.active) {
|
|
108
88
|
filteredAuxCodes.push({
|
|
109
89
|
id: auxCode.id,
|
|
110
90
|
name: auxCode.name,
|
|
@@ -132,30 +112,24 @@ function getDefaultWrapUpCode(wrapUpReasonList: Entity[]) {
|
|
|
132
112
|
* @returns {Profile}
|
|
133
113
|
*/
|
|
134
114
|
function parseAgentConfigs(profileData: {
|
|
115
|
+
orgConfig: OrgDesktopLoginResponse;
|
|
135
116
|
userData: AgentResponse;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
orgInfoData: OrgInfo;
|
|
117
|
+
agentProfileData: AgentProfile;
|
|
118
|
+
teamData: TeamList[];
|
|
139
119
|
auxCodes: AuxCode[];
|
|
140
|
-
orgSettingsData: OrgSettings;
|
|
141
|
-
agentProfileData: DesktopProfileResponse;
|
|
142
120
|
dialPlanData: DialPlanEntity[];
|
|
143
|
-
urlMapping: URLMapping[];
|
|
144
121
|
multimediaProfileId: string;
|
|
145
|
-
aiFeatureFlags: AIFeatureFlagsResponse;
|
|
146
122
|
}): Profile {
|
|
123
|
+
const {orgConfig, userData, agentProfileData, teamData, auxCodes, dialPlanData} = profileData;
|
|
147
124
|
const {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
tenantData,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
urlMapping,
|
|
157
|
-
aiFeatureFlags,
|
|
158
|
-
} = profileData;
|
|
125
|
+
organization: orgInfoData,
|
|
126
|
+
organizationSetting: orgSettingsData,
|
|
127
|
+
tenantConfiguration: tenantData,
|
|
128
|
+
urlMappings,
|
|
129
|
+
aiFeature,
|
|
130
|
+
microsoftConfig,
|
|
131
|
+
webexConfig,
|
|
132
|
+
} = orgConfig;
|
|
159
133
|
|
|
160
134
|
const tenantDataTimeout = tenantData.timeoutDesktopInactivityEnabled
|
|
161
135
|
? tenantData.timeoutDesktopInactivityMins
|
|
@@ -164,17 +138,9 @@ function parseAgentConfigs(profileData: {
|
|
|
164
138
|
? agentProfileData.timeoutDesktopInactivityMins
|
|
165
139
|
: tenantDataTimeout;
|
|
166
140
|
|
|
167
|
-
const wrapupCodes = getFilterAuxCodes(
|
|
168
|
-
auxCodes,
|
|
169
|
-
WRAP_UP_CODE,
|
|
170
|
-
agentProfileData.accessWrapUpCode === 'ALL' ? [] : agentProfileData.wrapUpCodes
|
|
171
|
-
);
|
|
141
|
+
const wrapupCodes = getFilterAuxCodes(auxCodes, WRAP_UP_CODE);
|
|
172
142
|
|
|
173
|
-
const idleCodes = getFilterAuxCodes(
|
|
174
|
-
auxCodes,
|
|
175
|
-
IDLE_CODE,
|
|
176
|
-
agentProfileData.accessIdleCode === 'ALL' ? [] : agentProfileData.idleCodes
|
|
177
|
-
);
|
|
143
|
+
const idleCodes = getFilterAuxCodes(auxCodes, IDLE_CODE);
|
|
178
144
|
|
|
179
145
|
idleCodes.push({
|
|
180
146
|
id: '0',
|
|
@@ -184,8 +150,10 @@ function parseAgentConfigs(profileData: {
|
|
|
184
150
|
}); // pushing available state to idle codes
|
|
185
151
|
|
|
186
152
|
const defaultWrapUpData = getDefaultWrapUpCode(wrapupCodes);
|
|
187
|
-
const
|
|
188
|
-
|
|
153
|
+
const isWellnessConfigured =
|
|
154
|
+
aiFeature?.agentWellbeing?.enable === true &&
|
|
155
|
+
aiFeature.agentWellbeing.wellnessBreakReminders === WELLNESS_BREAK_REMINDERS_ENABLED;
|
|
156
|
+
const hasAIAssistantLicense = (orgSettingsData.aiAssistantQuantity ?? 0) > 0;
|
|
189
157
|
|
|
190
158
|
const finalData = {
|
|
191
159
|
teams: teamData,
|
|
@@ -198,11 +166,10 @@ function parseAgentConfigs(profileData: {
|
|
|
198
166
|
agentName: `${userData.firstName} ${userData.lastName}`,
|
|
199
167
|
agentMailId: userData.email,
|
|
200
168
|
agentProfileID: userData.agentProfileId,
|
|
201
|
-
autoAnswer: agentProfileData.autoAnswer,
|
|
202
169
|
dialPlan: agentProfileData.dialPlanEnabled
|
|
203
170
|
? {
|
|
204
171
|
type: 'adhocDial',
|
|
205
|
-
dialPlanEntity: getFilteredDialplanEntries(dialPlanData
|
|
172
|
+
dialPlanEntity: getFilteredDialplanEntries(dialPlanData),
|
|
206
173
|
}
|
|
207
174
|
: undefined,
|
|
208
175
|
multimediaProfileId: profileData.multimediaProfileId,
|
|
@@ -210,7 +177,6 @@ function parseAgentConfigs(profileData: {
|
|
|
210
177
|
siteId: userData.siteId,
|
|
211
178
|
enterpriseId: orgInfoData.tenantId,
|
|
212
179
|
tenantTimezone: orgInfoData.timezone,
|
|
213
|
-
environment: orgInfoData.environment,
|
|
214
180
|
privacyShieldVisible: tenantData.privacyShieldVisible,
|
|
215
181
|
organizationIdleCodes: [], // TODO: for supervisor, getOrgFilteredIdleCodes(auxCodes, false),
|
|
216
182
|
idleCodesAccess: agentProfileData.accessIdleCode as 'ALL' | 'SPECIFIC',
|
|
@@ -238,6 +204,9 @@ function parseAgentConfigs(profileData: {
|
|
|
238
204
|
callVariablesSuppressed: tenantData.callVariablesSuppressed,
|
|
239
205
|
agentDbId: userData.dbId,
|
|
240
206
|
allowConsultToQueue: agentProfileData.consultToQueue,
|
|
207
|
+
accessQueue: agentProfileData.accessQueue,
|
|
208
|
+
accessEntryPoint: agentProfileData.accessEntryPoint,
|
|
209
|
+
accessBuddyTeam: agentProfileData.accessBuddyTeam,
|
|
241
210
|
agentPersonalStatsEnabled: agentProfileData.viewableStatistics
|
|
242
211
|
? agentProfileData.viewableStatistics.agentStats
|
|
243
212
|
: false,
|
|
@@ -246,8 +215,8 @@ function parseAgentConfigs(profileData: {
|
|
|
246
215
|
analyserUserId: userData.id,
|
|
247
216
|
|
|
248
217
|
urlMappings: {
|
|
249
|
-
acqueonApiUrl:
|
|
250
|
-
acqueonConsoleUrl:
|
|
218
|
+
acqueonApiUrl: urlMappings?.ACQUEON_API_URL ?? '',
|
|
219
|
+
acqueonConsoleUrl: urlMappings?.ACQUEON_CONSOLE_URL ?? '',
|
|
251
220
|
},
|
|
252
221
|
isTimeoutDesktopInactivityEnabled: tenantData.timeoutDesktopInactivityEnabled,
|
|
253
222
|
timeoutDesktopInactivityMins: inactivityTimeoutTimer,
|
|
@@ -256,11 +225,12 @@ function parseAgentConfigs(profileData: {
|
|
|
256
225
|
maskSensitiveData: orgSettingsData.maskSensitiveData
|
|
257
226
|
? orgSettingsData.maskSensitiveData
|
|
258
227
|
: false,
|
|
259
|
-
microsoftConfig: getMsftConfig(
|
|
260
|
-
webexConfig: getWebexConfig(
|
|
228
|
+
microsoftConfig: getMsftConfig(microsoftConfig),
|
|
229
|
+
webexConfig: getWebexConfig(webexConfig),
|
|
261
230
|
lostConnectionRecoveryTimeout:
|
|
262
231
|
tenantData.lostConnectionRecoveryTimeout || LOST_CONNECTION_RECOVERY_TIMEOUT,
|
|
263
232
|
aiFeature,
|
|
233
|
+
isWellnessBreakEnabled: isWellnessConfigured && hasAIAssistantLicense,
|
|
264
234
|
};
|
|
265
235
|
|
|
266
236
|
return finalData;
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
## Overview
|
|
12
12
|
|
|
13
13
|
The Config Service is an **internal service** that builds the comprehensive AgentProfile (`Profile` type) by:
|
|
14
|
-
1. Fetching user
|
|
15
|
-
2. Fetching desktop
|
|
14
|
+
1. Fetching the user desktop-login aggregate (agent identity plus `agentProfile`)
|
|
15
|
+
2. Fetching the organization desktop-login aggregate (org info, org settings, tenant configuration, URL mappings, AI feature, Microsoft/Webex config)
|
|
16
16
|
3. Fetching teams
|
|
17
17
|
4. Fetching aux codes (idle/wrapup codes)
|
|
18
|
-
5. Fetching
|
|
18
|
+
5. Fetching site and, when the agent profile enables it, dial-plan data
|
|
19
19
|
6. Aggregating all data into a single AgentProfile
|
|
20
20
|
|
|
21
21
|
The AgentProfile is the central configuration object required for an agent to operate within the contact center. It is built during the registration flow (`cc.register()`) and contains all the data an agent needs: identity, team assignments, dial plans, aux codes, login options, and feature flags. Once constructed, the AgentProfile is stored on the `ContactCenter` plugin instance as `this.agentConfig` and is used by other services (Agent, Task) throughout the session.
|
|
@@ -62,13 +62,13 @@ LoggerProxy.info(`Teams: ${this.agentConfig.teams}`, {
|
|
|
62
62
|
|
|
63
63
|
## Key Capabilities
|
|
64
64
|
|
|
65
|
-
- **AgentProfile Aggregation**: Combines data from
|
|
65
|
+
- **AgentProfile Aggregation**: Combines data from 6 API endpoints (5 when the agent profile disables dial plans)
|
|
66
66
|
- **Aux Codes Fetching**: Gets all idle and wrapup codes with pagination
|
|
67
67
|
- **Team Data**: Retrieves agent's team assignments
|
|
68
68
|
- **Dial Plan**: Fetches number transformation rules
|
|
69
69
|
- **Outdial ANI**: Retrieves outbound caller ID options (standalone, publicly exposed via `cc.ts`)
|
|
70
70
|
- **Multimedia Profile**: Fetches channel capacity and blending config (standalone, not yet publicly exposed)
|
|
71
|
-
- **Paginated Data Access**: `getListOfTeams` and `getListOfAuxCodes` support custom pagination independent of profile building
|
|
71
|
+
- **Paginated Data Access**: `getListOfTeams` and `getListOfAuxCodes` support custom pagination independent of profile building. `getListOfTeams` takes a `userDbId` — the `user.dbId` carried by the user desktop-login aggregate, not the CI user id — rather than a list of team ids
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
|
|
@@ -95,28 +95,20 @@ The AgentProfile is defined as the [`Profile`](../types.ts) type. This is not an
|
|
|
95
95
|
|
|
96
96
|
## Data Aggregation Flow
|
|
97
97
|
|
|
98
|
-
The following diagram shows how `getAgentConfig` orchestrates
|
|
98
|
+
The following diagram shows how `getAgentConfig` orchestrates six API calls and combines their results into the AgentProfile via `parseAgentConfigs()`:
|
|
99
99
|
|
|
100
100
|
```
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
│
|
|
113
|
-
getDesktopProfileById ─────┤
|
|
114
|
-
│
|
|
115
|
-
getSiteInfo ───────────────┤ (computes multimediaProfileId)
|
|
116
|
-
│
|
|
117
|
-
getAllTeams ────────────────┤
|
|
118
|
-
│
|
|
119
|
-
getDialPlanData ───────────┘
|
|
101
|
+
getUserDesktopLoginConfig ──┐ (awaited first; supplies dbId, siteId, dialPlanEnabled)
|
|
102
|
+
│
|
|
103
|
+
getOrgDesktopLoginConfig ───┤ (org info, org settings, tenant config, urlMappings,
|
|
104
|
+
│ aiFeature, microsoftConfig, webexConfig)
|
|
105
|
+
getAllAuxCodes ─────────────┼──► parseAgentConfigs() ──► AgentProfile
|
|
106
|
+
│
|
|
107
|
+
getAllTeams ────────────────┤ (filtered by userId == user.dbId)
|
|
108
|
+
│
|
|
109
|
+
getSiteInfo ────────────────┤ (team → site fallback for multimediaProfileId)
|
|
110
|
+
│
|
|
111
|
+
getDialPlanData ────────────┘ (only when agentProfile.dialPlanEnabled)
|
|
120
112
|
```
|
|
121
113
|
|
|
122
114
|
---
|
|
@@ -130,12 +122,12 @@ Main method that aggregates all configuration data into the AgentProfile.
|
|
|
130
122
|
**Returns**: `Promise<Profile>`
|
|
131
123
|
|
|
132
124
|
**Flow**:
|
|
133
|
-
1.
|
|
134
|
-
2.
|
|
135
|
-
3. Fetch
|
|
136
|
-
4. Fetch
|
|
137
|
-
5.
|
|
138
|
-
6.
|
|
125
|
+
1. Fire the user aggregate (`getUserDesktopLoginConfig`), the org aggregate (`getOrgDesktopLoginConfig`) and aux codes (`getAllAuxCodes`) in parallel
|
|
126
|
+
2. Await the user aggregate — it supplies `user.dbId`, `user.siteId` and `agentProfile.dialPlanEnabled`
|
|
127
|
+
3. Fetch site info (`getSiteInfo`) and teams filtered by `userId` (`getAllTeams`)
|
|
128
|
+
4. Fetch dial plan if `agentProfile.dialPlanEnabled` (`getDialPlanData`)
|
|
129
|
+
5. `Promise.all` the five remaining promises
|
|
130
|
+
6. Resolve `multimediaProfileId` from the team value, falling back to the site value
|
|
139
131
|
7. Parse and combine all data (`parseAgentConfigs`)
|
|
140
132
|
|
|
141
133
|
---
|
|
@@ -148,7 +140,7 @@ These methods exist in `AgentConfigService` but are **not** part of the `getAgen
|
|
|
148
140
|
|--------|--------|---------|-------------|
|
|
149
141
|
| `getOutdialAniEntries(orgId, params)` | **Publicly exposed** via `cc.getOutdialAniEntries()` | `OutdialAniEntriesResponse` | Fetch outbound ANI entries for caller ID selection. Supports pagination and search via [`OutdialAniParams`](../types.ts). |
|
|
150
142
|
| `getMultimediaProfileById(orgId, multimediaProfileId)` | **Not exposed, never called** | `MultimediaProfileResponse` | Fetch channel capacities (chat, email, telephony, social) and blending config. Available but unused anywhere. |
|
|
151
|
-
| `getListOfTeams(orgId, page, pageSize,
|
|
143
|
+
| `getListOfTeams(orgId, page, pageSize, userDbId)` | Used internally by `getAllTeams()` | `ListTeamsResponse` | Single-page team fetch with pagination metadata, filtered by `user.dbId` (the wire field is `filter=userId==` but the value is the database id, not the CI user id). The filter value must stay unquoted — the quoted form returns HTTP 400. |
|
|
152
144
|
| `getListOfAuxCodes(orgId, page, pageSize, filter, attributes)` | Used internally by `getAllAuxCodes()` | `ListAuxCodesResponse` | Single-page aux code fetch with pagination metadata. Useful for custom pagination. |
|
|
153
145
|
|
|
154
146
|
Additionally, the following endpoints are defined in `constants.ts` `endPointMap` but are consumed by separate service classes, not by `AgentConfigService`:
|
|
@@ -156,7 +148,7 @@ Additionally, the following endpoints are defined in `constants.ts` `endPointMap
|
|
|
156
148
|
| Endpoint | Used By | Description |
|
|
157
149
|
|----------|---------|-------------|
|
|
158
150
|
| `queueList` | [`Queue.ts`](../../Queue.ts) | Fetch contact service queues |
|
|
159
|
-
| `
|
|
151
|
+
| `entryPointDialNumberList` | [`EntryPoint.ts`](../../EntryPoint.ts) | Fetch profile-scoped entry-point dial-number mappings |
|
|
160
152
|
| `addressBookEntries` | [`AddressBook.ts`](../../AddressBook.ts) | Fetch address book entries |
|
|
161
153
|
|
|
162
154
|
---
|
|
@@ -168,23 +160,26 @@ Types used by the config service, all defined in [`types.ts`](../types.ts):
|
|
|
168
160
|
| Type | Description |
|
|
169
161
|
|------|-------------|
|
|
170
162
|
| `Profile` | Final aggregated agent config returned by `getAgentConfig()` |
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
163
|
+
| `OrgDesktopLoginResponse` | Response from `getOrgDesktopLoginConfig()` — `organization`, `organizationSetting`, `tenantConfiguration`, `urlMappings`, `aiFeature`, `microsoftConfig`, `webexConfig` |
|
|
164
|
+
| `UserDesktopLoginResponse` | Response from `getUserDesktopLoginConfig()` — `user` and `agentProfile` sections |
|
|
165
|
+
| `AgentResponse` | `user` section of the user aggregate — agent metadata, `dbId`, `siteId`, `agentProfileId` |
|
|
166
|
+
| `AgentProfile` | `agentProfile` section of the user aggregate — layout, dial-plan enablement, login options |
|
|
173
167
|
| `TeamList` | Team record from API — `id`, `name`, `teamType`, `siteId`, `multiMediaProfileId` |
|
|
174
168
|
| `ListTeamsResponse` | Paginated wrapper around `TeamList[]` with `meta` for pagination |
|
|
175
169
|
| `OrgInfo` | Organization info — `tenantId`, timezone |
|
|
176
170
|
| `OrgSettings` | Org feature flags — `webRtcEnabled`, `sensitiveDataMaskingEnabled` |
|
|
177
171
|
| `TenantData` | Tenant-level config — inactivity timeout, `forceDefaultDn`, `outdialEnabled` |
|
|
178
172
|
| `SiteInfo` | Site config — `id`, `name`, `multimediaProfileId` |
|
|
179
|
-
| `
|
|
173
|
+
| `OrgUrlMappings` | Keyed external URL mappings — `ACQUEON_API_URL`, `ACQUEON_CONSOLE_URL` |
|
|
174
|
+
| `MicrosoftConfig` | Org-level Microsoft presence config — `showUserDetails`, `stateSynchronization` |
|
|
175
|
+
| `WebexConfig` | Org-level Webex presence config — `showUserDetails`, `stateSynchronization` |
|
|
180
176
|
| `MultimediaProfileResponse` | Multimedia profile — channel capacities and settings |
|
|
181
177
|
| `AuxCode` | Auxiliary code record — `id`, `name`, `description`, `workTypeCode` |
|
|
182
178
|
| `ListAuxCodesResponse` | Paginated wrapper around `AuxCode[]` with `meta` |
|
|
183
|
-
| `DialPlanEntity` | Dial plan rule — regex pattern, prefix, strip digits |
|
|
179
|
+
| `DialPlanEntity` | Dial plan rule — regex pattern, prefix, strip digits, `active` |
|
|
184
180
|
| `Entity` | Basic entity info — `isSystem`, `name`, `id`, `description` |
|
|
185
181
|
| `WrapupData` | Wrap-up config — auto-wrapup settings, available wrapup codes |
|
|
186
182
|
| `OutdialAniParams` | Parameters for `getOutdialAniEntries()` — ANI ID, pagination, filtering |
|
|
187
|
-
| `Team` | Simplified team shape in `Profile` — `teamId`, `teamName`, `desktopLayoutId` |
|
|
188
183
|
|
|
189
184
|
## Events (CC_EVENTS)
|
|
190
185
|
|
|
@@ -212,14 +207,14 @@ Key types in `services/config/types.ts`:
|
|
|
212
207
|
| `CC_TASK_EVENTS` | Task-specific events |
|
|
213
208
|
| `AuxCode` | Idle/wrapup code definition |
|
|
214
209
|
| `Team` | Team configuration |
|
|
215
|
-
| `
|
|
210
|
+
| `AgentProfile` | Agent profile settings from the user aggregate |
|
|
216
211
|
| `LoginOption` | Login types (BROWSER, EXTENSION, AGENT_DN) |
|
|
217
212
|
|
|
218
213
|
---
|
|
219
214
|
|
|
220
215
|
## Error Handling
|
|
221
216
|
|
|
222
|
-
All API methods within the config service throw errors on failure. Since `getAgentConfig` calls multiple sub-APIs (`
|
|
217
|
+
All API methods within the config service throw errors on failure. Since `getAgentConfig` calls multiple sub-APIs (`getUserDesktopLoginConfig`, `getOrgDesktopLoginConfig`, `getAllAuxCodes`, `getAllTeams`, `getSiteInfo`, `getDialPlanData`) and awaits them via `Promise.all`, **a failure in any single sub-API will cause the entire AgentProfile fetch to fail**. There is no partial profile — either all data is successfully fetched and aggregated, or the operation throws.
|
|
223
218
|
|
|
224
219
|
```typescript
|
|
225
220
|
try {
|