@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.
Files changed (250) hide show
  1. package/.sdd/manifest.json +24 -13
  2. package/ai-docs/ARCHITECTURE.md +1 -1
  3. package/ai-docs/CONTRACTS.md +21 -3
  4. package/ai-docs/SECURITY.md +1 -1
  5. package/ai-docs/SERVICE_STATE.md +4 -0
  6. package/ai-docs/contact-center-spec.md +53 -6
  7. package/ai-docs/features/consult-transfer-list-policy/spec/feature-spec.md +362 -0
  8. package/ai-docs/features/contact-owner-change-refactor.md +78 -0
  9. package/dist/cc.js +816 -26
  10. package/dist/cc.js.map +1 -1
  11. package/dist/config.js +7 -0
  12. package/dist/config.js.map +1 -1
  13. package/dist/constants.js +29 -2
  14. package/dist/constants.js.map +1 -1
  15. package/dist/index.js +66 -12
  16. package/dist/index.js.map +1 -1
  17. package/dist/metrics/MetricsManager.js +16 -0
  18. package/dist/metrics/MetricsManager.js.map +1 -1
  19. package/dist/metrics/behavioral-events.js +110 -0
  20. package/dist/metrics/behavioral-events.js.map +1 -1
  21. package/dist/metrics/constants.js +33 -0
  22. package/dist/metrics/constants.js.map +1 -1
  23. package/dist/services/AddressBook.js +18 -15
  24. package/dist/services/AddressBook.js.map +1 -1
  25. package/dist/services/AnswerCallOnWebexService.js +202 -0
  26. package/dist/services/AnswerCallOnWebexService.js.map +1 -0
  27. package/dist/services/ApiAiAssistant.js +221 -11
  28. package/dist/services/ApiAiAssistant.js.map +1 -1
  29. package/dist/services/EntryPoint.js +46 -68
  30. package/dist/services/EntryPoint.js.map +1 -1
  31. package/dist/services/Queue.js +27 -22
  32. package/dist/services/Queue.js.map +1 -1
  33. package/dist/services/WebCallingService.js +287 -37
  34. package/dist/services/WebCallingService.js.map +1 -1
  35. package/dist/services/WebexCrossClientService.js +225 -0
  36. package/dist/services/WebexCrossClientService.js.map +1 -0
  37. package/dist/services/WxAppTelephonyMercurySync.js +111 -0
  38. package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
  39. package/dist/services/config/Util.js +46 -46
  40. package/dist/services/config/Util.js.map +1 -1
  41. package/dist/services/config/constants.js +34 -77
  42. package/dist/services/config/constants.js.map +1 -1
  43. package/dist/services/config/index.js +100 -226
  44. package/dist/services/config/index.js.map +1 -1
  45. package/dist/services/config/types.js +55 -35
  46. package/dist/services/config/types.js.map +1 -1
  47. package/dist/services/constants.js +11 -1
  48. package/dist/services/constants.js.map +1 -1
  49. package/dist/services/core/Err.js.map +1 -1
  50. package/dist/services/core/Utils.js +25 -1
  51. package/dist/services/core/Utils.js.map +1 -1
  52. package/dist/services/core/WebexRequest.js +6 -2
  53. package/dist/services/core/WebexRequest.js.map +1 -1
  54. package/dist/services/core/aqm-reqs.js +17 -11
  55. package/dist/services/core/aqm-reqs.js.map +1 -1
  56. package/dist/services/core/constants.js +9 -1
  57. package/dist/services/core/constants.js.map +1 -1
  58. package/dist/services/core/types.js.map +1 -1
  59. package/dist/services/core/websocket/WebSocketManager.js +17 -1
  60. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  61. package/dist/services/task/Task.js +275 -8
  62. package/dist/services/task/Task.js.map +1 -1
  63. package/dist/services/task/TaskFactory.js +11 -6
  64. package/dist/services/task/TaskFactory.js.map +1 -1
  65. package/dist/services/task/TaskManager.js +590 -42
  66. package/dist/services/task/TaskManager.js.map +1 -1
  67. package/dist/services/task/TaskUtils.js +11 -1
  68. package/dist/services/task/TaskUtils.js.map +1 -1
  69. package/dist/services/task/WebexCallingUtils.js +70 -0
  70. package/dist/services/task/WebexCallingUtils.js.map +1 -0
  71. package/dist/services/task/constants.js +14 -2
  72. package/dist/services/task/constants.js.map +1 -1
  73. package/dist/services/task/contact.js +29 -0
  74. package/dist/services/task/contact.js.map +1 -1
  75. package/dist/services/task/digital/Digital.js +4 -3
  76. package/dist/services/task/digital/Digital.js.map +1 -1
  77. package/dist/services/task/state-machine/TaskStateMachine.js +162 -53
  78. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -1
  79. package/dist/services/task/state-machine/actions.js +6 -1
  80. package/dist/services/task/state-machine/actions.js.map +1 -1
  81. package/dist/services/task/state-machine/guards.js +7 -10
  82. package/dist/services/task/state-machine/guards.js.map +1 -1
  83. package/dist/services/task/state-machine/types.js.map +1 -1
  84. package/dist/services/task/state-machine/uiControlsComputer.js +118 -18
  85. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -1
  86. package/dist/services/task/types.js +47 -1
  87. package/dist/services/task/types.js.map +1 -1
  88. package/dist/services/task/voice/Voice.js +477 -17
  89. package/dist/services/task/voice/Voice.js.map +1 -1
  90. package/dist/services/task/voice/WebRTC.js +6 -3
  91. package/dist/services/task/voice/WebRTC.js.map +1 -1
  92. package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
  93. package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
  94. package/dist/services/task/voice/wxAppVoiceMethods.js +395 -0
  95. package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
  96. package/dist/services/wxAppDiagnosticLogging.js +159 -0
  97. package/dist/services/wxAppDiagnosticLogging.js.map +1 -0
  98. package/dist/services/wxAppTelephonyUtils.js +19 -0
  99. package/dist/services/wxAppTelephonyUtils.js.map +1 -0
  100. package/dist/types/cc.d.ts +127 -9
  101. package/dist/types/config.d.ts +7 -0
  102. package/dist/types/constants.d.ts +23 -0
  103. package/dist/types/index.d.ts +38 -17
  104. package/dist/types/metrics/MetricsManager.d.ts +6 -0
  105. package/dist/types/metrics/constants.d.ts +31 -0
  106. package/dist/types/services/AddressBook.d.ts +2 -1
  107. package/dist/types/services/AnswerCallOnWebexService.d.ts +38 -0
  108. package/dist/types/services/ApiAiAssistant.d.ts +48 -4
  109. package/dist/types/services/EntryPoint.d.ts +7 -5
  110. package/dist/types/services/Queue.d.ts +5 -3
  111. package/dist/types/services/WebexCrossClientService.d.ts +32 -0
  112. package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
  113. package/dist/types/services/config/Util.d.ts +4 -8
  114. package/dist/types/services/config/constants.d.ts +28 -76
  115. package/dist/types/services/config/index.d.ts +16 -64
  116. package/dist/types/services/config/types.d.ts +150 -173
  117. package/dist/types/services/constants.d.ts +9 -0
  118. package/dist/types/services/core/Err.d.ts +2 -0
  119. package/dist/types/services/core/Utils.d.ts +10 -0
  120. package/dist/types/services/core/WebexRequest.d.ts +1 -0
  121. package/dist/types/services/core/constants.d.ts +7 -0
  122. package/dist/types/services/core/types.d.ts +2 -0
  123. package/dist/types/services/task/Task.d.ts +34 -5
  124. package/dist/types/services/task/TaskFactory.d.ts +4 -2
  125. package/dist/types/services/task/TaskUtils.d.ts +6 -0
  126. package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
  127. package/dist/types/services/task/constants.d.ts +12 -0
  128. package/dist/types/services/task/contact.d.ts +4 -0
  129. package/dist/types/services/task/digital/Digital.d.ts +4 -3
  130. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +304 -56
  131. package/dist/types/services/task/state-machine/guards.d.ts +6 -5
  132. package/dist/types/services/task/state-machine/types.d.ts +9 -1
  133. package/dist/types/services/task/types.d.ts +192 -5
  134. package/dist/types/services/task/voice/Voice.d.ts +68 -11
  135. package/dist/types/services/task/voice/WebRTC.d.ts +5 -4
  136. package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
  137. package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +68 -0
  138. package/dist/types/services/wxAppDiagnosticLogging.d.ts +63 -0
  139. package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
  140. package/dist/types/types.d.ts +125 -13
  141. package/dist/types/utils/PageCache.d.ts +20 -3
  142. package/dist/types.js +90 -8
  143. package/dist/types.js.map +1 -1
  144. package/dist/utils/PageCache.js +19 -5
  145. package/dist/utils/PageCache.js.map +1 -1
  146. package/dist/webex.js +9 -1
  147. package/dist/webex.js.map +1 -1
  148. package/package.json +10 -9
  149. package/src/cc.ts +1047 -48
  150. package/src/config.ts +7 -0
  151. package/src/constants.ts +36 -0
  152. package/src/index.ts +49 -11
  153. package/src/metrics/MetricsManager.ts +16 -0
  154. package/src/metrics/ai-docs/metrics-spec.md +138 -21
  155. package/src/metrics/behavioral-events.ts +112 -0
  156. package/src/metrics/constants.ts +36 -0
  157. package/src/services/AddressBook.ts +17 -6
  158. package/src/services/AnswerCallOnWebexService.ts +239 -0
  159. package/src/services/ApiAiAssistant.ts +297 -13
  160. package/src/services/EntryPoint.ts +59 -60
  161. package/src/services/Queue.ts +29 -12
  162. package/src/services/WebCallingService.ts +362 -40
  163. package/src/services/WebexCrossClientService.ts +298 -0
  164. package/src/services/WxAppTelephonyMercurySync.ts +142 -0
  165. package/src/services/agent/ai-docs/AGENTS.md +1 -1
  166. package/src/services/agent/ai-docs/agent-spec.md +1 -0
  167. package/src/services/ai-docs/AGENTS.md +11 -11
  168. package/src/services/ai-docs/services-spec.md +25 -5
  169. package/src/services/config/Util.ts +52 -82
  170. package/src/services/config/ai-docs/AGENTS.md +35 -40
  171. package/src/services/config/ai-docs/ARCHITECTURE.md +90 -103
  172. package/src/services/config/ai-docs/config-spec.md +132 -132
  173. package/src/services/config/constants.ts +39 -85
  174. package/src/services/config/index.ts +116 -277
  175. package/src/services/config/types.ts +145 -195
  176. package/src/services/constants.ts +10 -0
  177. package/src/services/core/Err.ts +1 -0
  178. package/src/services/core/Utils.ts +28 -0
  179. package/src/services/core/WebexRequest.ts +3 -1
  180. package/src/services/core/ai-docs/core-spec.md +25 -11
  181. package/src/services/core/aqm-reqs.ts +18 -12
  182. package/src/services/core/constants.ts +8 -0
  183. package/src/services/core/types.ts +33 -1
  184. package/src/services/core/websocket/WebSocketManager.ts +26 -2
  185. package/src/services/task/Task.ts +386 -12
  186. package/src/services/task/TaskFactory.ts +33 -6
  187. package/src/services/task/TaskManager.ts +857 -41
  188. package/src/services/task/TaskUtils.ts +13 -0
  189. package/src/services/task/WebexCallingUtils.ts +136 -0
  190. package/src/services/task/ai-docs/ARCHITECTURE.md +1 -0
  191. package/src/services/task/ai-docs/task-spec.md +190 -8
  192. package/src/services/task/constants.ts +13 -0
  193. package/src/services/task/contact.ts +30 -0
  194. package/src/services/task/digital/Digital.ts +11 -4
  195. package/src/services/task/state-machine/TaskStateMachine.ts +235 -81
  196. package/src/services/task/state-machine/actions.ts +5 -2
  197. package/src/services/task/state-machine/ai-docs/AGENTS.md +6 -4
  198. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +35 -16
  199. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +103 -33
  200. package/src/services/task/state-machine/guards.ts +7 -10
  201. package/src/services/task/state-machine/types.ts +16 -1
  202. package/src/services/task/state-machine/uiControlsComputer.ts +206 -32
  203. package/src/services/task/types.ts +269 -4
  204. package/src/services/task/voice/Voice.ts +625 -17
  205. package/src/services/task/voice/WebRTC.ts +11 -4
  206. package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
  207. package/src/services/task/voice/wxAppVoiceMethods.ts +575 -0
  208. package/src/services/wxAppDiagnosticLogging.ts +286 -0
  209. package/src/services/wxAppTelephonyUtils.ts +14 -0
  210. package/src/types.ts +159 -13
  211. package/src/utils/AGENTS.md +21 -10
  212. package/src/utils/PageCache.ts +38 -5
  213. package/src/utils/ai-docs/utils-spec.md +21 -11
  214. package/src/webex.js +8 -0
  215. package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
  216. package/test/unit/spec/cc.ts +3595 -120
  217. package/test/unit/spec/index.ts +891 -0
  218. package/test/unit/spec/metrics/MetricsManager.ts +25 -0
  219. package/test/unit/spec/metrics/behavioral-events.ts +60 -0
  220. package/test/unit/spec/services/AddressBook.ts +37 -6
  221. package/test/unit/spec/services/AnswerCallOnWebexService.ts +264 -0
  222. package/test/unit/spec/services/ApiAiAssistant.ts +269 -8
  223. package/test/unit/spec/services/EntryPoint.ts +87 -40
  224. package/test/unit/spec/services/Queue.ts +123 -12
  225. package/test/unit/spec/services/WebCallingService.ts +483 -54
  226. package/test/unit/spec/services/WebexCrossClientService.ts +509 -0
  227. package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +136 -0
  228. package/test/unit/spec/services/config/Util.ts +501 -0
  229. package/test/unit/spec/services/config/index.ts +313 -543
  230. package/test/unit/spec/services/core/Utils.ts +22 -0
  231. package/test/unit/spec/services/core/WebexRequest.ts +8 -7
  232. package/test/unit/spec/services/core/aqm-reqs.ts +142 -1
  233. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +64 -14
  234. package/test/unit/spec/services/task/Task.ts +2257 -11
  235. package/test/unit/spec/services/task/TaskFactory.ts +56 -2
  236. package/test/unit/spec/services/task/TaskManager.ts +5559 -1493
  237. package/test/unit/spec/services/task/TaskUtils.ts +72 -0
  238. package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
  239. package/test/unit/spec/services/task/contact.ts +33 -0
  240. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +1501 -92
  241. package/test/unit/spec/services/task/state-machine/guards.ts +210 -8
  242. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +445 -7
  243. package/test/unit/spec/services/task/voice/Voice.ts +1710 -4
  244. package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
  245. package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +719 -0
  246. package/test/unit/spec/services/wxAppDiagnosticLogging.ts +179 -0
  247. package/test/unit/spec/wellnessSampleUtils.ts +288 -0
  248. package/typedoc.md +1 -1
  249. package/umd/contact-center.min.js +2 -2
  250. 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
- OrgInfo,
11
- OrgSettings,
11
+ OrgDesktopLoginResponse,
12
12
  Profile,
13
- Team,
14
- TenantData,
15
- URLMapping,
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 URL mapping for the given name
23
- * @param {Array<URLMapping>} urlMappings
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 = (agentProfileData: DesktopProfileResponse) => {
24
+ const getMsftConfig = (microsoftConfig?: MicrosoftConfig) => {
39
25
  return {
40
- showUserDetailsMS: agentProfileData.showUserDetailsMS ?? false,
41
- stateSynchronizationMS: agentProfileData.stateSynchronizationMS ?? false,
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 {DesktopProfileResponse} agentProfileData
33
+ * @param {WebexConfig} webexConfig
48
34
  * @returns {Object}
49
35
  */
50
- const getWebexConfig = (agentProfileData: DesktopProfileResponse) => {
36
+ const getWebexConfig = (webexConfig?: WebexConfig) => {
51
37
  return {
52
- showUserDetailsWebex: agentProfileData.showUserDetailsWebex ?? false,
53
- stateSynchronizationWebex: agentProfileData.stateSynchronizationWebex ?? false,
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 filtered dialplan entries
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[], profileDialPlans: string[]) => {
59
+ const getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[]) => {
73
60
  const dialPlanEntries = [];
74
61
  dialPlanData.forEach((dailPlan: DialPlanEntity) => {
75
- if (profileDialPlans.includes(dailPlan.id)) {
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 filtered aux codes
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
- teamData: Team[];
137
- tenantData: TenantData;
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
- userData,
149
- teamData,
150
- tenantData,
151
- orgInfoData,
152
- auxCodes,
153
- orgSettingsData,
154
- agentProfileData,
155
- dialPlanData,
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 aiFeature: AIFeatureFlags | undefined =
188
- aiFeatureFlags?.data?.length > 0 ? aiFeatureFlags.data[0] : undefined;
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, agentProfileData.dialPlans),
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: getUrlMapping(urlMapping, 'ACQUEON_API_URL'),
250
- acqueonConsoleUrl: getUrlMapping(urlMapping, 'ACQUEON_CONSOLE_URL'),
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(agentProfileData),
260
- webexConfig: getWebexConfig(agentProfileData),
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 data
15
- 2. Fetching desktop profile
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 organization settings
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 8+ API endpoints
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 multiple API calls and combines their results into the AgentProfile via `parseAgentConfigs()`:
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
- getUserUsingCI ────────────┐
102
- │
103
- getOrgInfo ────────────────┤
104
- │
105
- getOrganizationSetting ────┤
106
- │
107
- getTenantData ─────────────┤
108
- │
109
- getURLMapping ─────────────┼──► parseAgentConfigs() ──► AgentProfile
110
- │
111
- getAllAuxCodes ─────────────┤
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. Fetch user data (`getUserUsingCI`)
134
- 2. Fetch org info (`getOrgInfo`), settings (`getOrganizationSetting`), tenant data (`getTenantData`) in parallel
135
- 3. Fetch aux codes with pagination (`getAllAuxCodes`)
136
- 4. Fetch desktop profile (`getDesktopProfileById`), site info (`getSiteInfo`)
137
- 5. Fetch dial plan if enabled (`getDialPlanData`)
138
- 6. Fetch teams (`getAllTeams`)
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, filter)` | Used internally by `getAllTeams()` | `ListTeamsResponse` | Single-page team fetch with pagination metadata. Useful for custom pagination. |
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
- | `entryPointList` | [`EntryPoint.ts`](../../EntryPoint.ts) | Fetch entry points |
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
- | `AgentResponse` | Raw response from `getUserUsingCI()` — agent metadata, teamIds, siteId, agentProfileId |
172
- | `DesktopProfileResponse` | Desktop profile settings — layout, dial plan, login options |
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
- | `URLMapping` | External URL mapping — `id`, `name`, `url` |
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
- | `DesktopProfileResponse` | Desktop profile settings |
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 (`getUserUsingCI`, `getOrgInfo`, `getOrganizationSetting`, `getTenantData`, `getAllAuxCodes`, `getDesktopProfileById`, `getAllTeams`, `getDialPlanData`, etc.) 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.
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 {