@webex/contact-center 3.12.0 → 3.13.0-next.10

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 (297) hide show
  1. package/.repo-context.json +704 -0
  2. package/.sdd/manifest.json +1613 -0
  3. package/AGENTS.md +969 -0
  4. package/dist/cc.js +1102 -47
  5. package/dist/cc.js.map +1 -1
  6. package/dist/config.js +13 -0
  7. package/dist/config.js.map +1 -1
  8. package/dist/constants.js +46 -3
  9. package/dist/constants.js.map +1 -1
  10. package/dist/index.js +86 -17
  11. package/dist/index.js.map +1 -1
  12. package/dist/metrics/MetricsManager.js +16 -0
  13. package/dist/metrics/MetricsManager.js.map +1 -1
  14. package/dist/metrics/behavioral-events.js +211 -0
  15. package/dist/metrics/behavioral-events.js.map +1 -1
  16. package/dist/metrics/constants.js +58 -4
  17. package/dist/metrics/constants.js.map +1 -1
  18. package/dist/services/AddressBook.js +18 -15
  19. package/dist/services/AddressBook.js.map +1 -1
  20. package/dist/services/AnswerCallOnWebexService.js +202 -0
  21. package/dist/services/AnswerCallOnWebexService.js.map +1 -0
  22. package/dist/services/ApiAiAssistant.js +369 -14
  23. package/dist/services/ApiAiAssistant.js.map +1 -1
  24. package/dist/services/EntryPoint.js +46 -68
  25. package/dist/services/EntryPoint.js.map +1 -1
  26. package/dist/services/Queue.js +27 -22
  27. package/dist/services/Queue.js.map +1 -1
  28. package/dist/services/UserPreference.js +427 -0
  29. package/dist/services/UserPreference.js.map +1 -0
  30. package/dist/services/WebCallingService.js +287 -37
  31. package/dist/services/WebCallingService.js.map +1 -1
  32. package/dist/services/WebexCrossClientService.js +225 -0
  33. package/dist/services/WebexCrossClientService.js.map +1 -0
  34. package/dist/services/WxAppTelephonyMercurySync.js +111 -0
  35. package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
  36. package/dist/services/config/Util.js +48 -48
  37. package/dist/services/config/Util.js.map +1 -1
  38. package/dist/services/config/constants.js +57 -79
  39. package/dist/services/config/constants.js.map +1 -1
  40. package/dist/services/config/index.js +100 -226
  41. package/dist/services/config/index.js.map +1 -1
  42. package/dist/services/config/types.js +100 -40
  43. package/dist/services/config/types.js.map +1 -1
  44. package/dist/services/constants.js +19 -1
  45. package/dist/services/constants.js.map +1 -1
  46. package/dist/services/core/Err.js.map +1 -1
  47. package/dist/services/core/Utils.js +131 -32
  48. package/dist/services/core/Utils.js.map +1 -1
  49. package/dist/services/core/WebexRequest.js +6 -2
  50. package/dist/services/core/WebexRequest.js.map +1 -1
  51. package/dist/services/core/aqm-reqs.js +17 -11
  52. package/dist/services/core/aqm-reqs.js.map +1 -1
  53. package/dist/services/core/constants.js +9 -1
  54. package/dist/services/core/constants.js.map +1 -1
  55. package/dist/services/core/types.js.map +1 -1
  56. package/dist/services/core/websocket/WebSocketManager.js +26 -6
  57. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  58. package/dist/services/core/websocket/connection-service.js +3 -1
  59. package/dist/services/core/websocket/connection-service.js.map +1 -1
  60. package/dist/services/core/websocket/types.js.map +1 -1
  61. package/dist/services/index.js +6 -0
  62. package/dist/services/index.js.map +1 -1
  63. package/dist/services/task/Task.js +955 -0
  64. package/dist/services/task/Task.js.map +1 -0
  65. package/dist/services/task/TaskFactory.js +50 -0
  66. package/dist/services/task/TaskFactory.js.map +1 -0
  67. package/dist/services/task/TaskManager.js +1275 -504
  68. package/dist/services/task/TaskManager.js.map +1 -1
  69. package/dist/services/task/TaskUtils.js +221 -27
  70. package/dist/services/task/TaskUtils.js.map +1 -1
  71. package/dist/services/task/WebexCallingUtils.js +70 -0
  72. package/dist/services/task/WebexCallingUtils.js.map +1 -0
  73. package/dist/services/task/constants.js +22 -2
  74. package/dist/services/task/constants.js.map +1 -1
  75. package/dist/services/task/contact.js +29 -0
  76. package/dist/services/task/contact.js.map +1 -1
  77. package/dist/services/task/dialer.js +78 -0
  78. package/dist/services/task/dialer.js.map +1 -1
  79. package/dist/services/task/digital/Digital.js +78 -0
  80. package/dist/services/task/digital/Digital.js.map +1 -0
  81. package/dist/services/task/state-machine/TaskStateMachine.js +982 -0
  82. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
  83. package/dist/services/task/state-machine/actions.js +572 -0
  84. package/dist/services/task/state-machine/actions.js.map +1 -0
  85. package/dist/services/task/state-machine/constants.js +161 -0
  86. package/dist/services/task/state-machine/constants.js.map +1 -0
  87. package/dist/services/task/state-machine/guards.js +379 -0
  88. package/dist/services/task/state-machine/guards.js.map +1 -0
  89. package/dist/services/task/state-machine/index.js +53 -0
  90. package/dist/services/task/state-machine/index.js.map +1 -0
  91. package/dist/services/task/state-machine/types.js +54 -0
  92. package/dist/services/task/state-machine/types.js.map +1 -0
  93. package/dist/services/task/state-machine/uiControlsComputer.js +703 -0
  94. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
  95. package/dist/services/task/taskDataNormalizer.js +99 -0
  96. package/dist/services/task/taskDataNormalizer.js.map +1 -0
  97. package/dist/services/task/types.js +259 -5
  98. package/dist/services/task/types.js.map +1 -1
  99. package/dist/services/task/voice/Voice.js +1504 -0
  100. package/dist/services/task/voice/Voice.js.map +1 -0
  101. package/dist/services/task/voice/WebRTC.js +152 -0
  102. package/dist/services/task/voice/WebRTC.js.map +1 -0
  103. package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
  104. package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
  105. package/dist/services/task/voice/wxAppVoiceMethods.js +395 -0
  106. package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
  107. package/dist/services/wxAppDiagnosticLogging.js +159 -0
  108. package/dist/services/wxAppDiagnosticLogging.js.map +1 -0
  109. package/dist/services/wxAppTelephonyUtils.js +19 -0
  110. package/dist/services/wxAppTelephonyUtils.js.map +1 -0
  111. package/dist/types/cc.d.ts +222 -10
  112. package/dist/types/config.d.ts +13 -0
  113. package/dist/types/constants.d.ts +40 -1
  114. package/dist/types/index.d.ts +58 -22
  115. package/dist/types/metrics/MetricsManager.d.ts +6 -0
  116. package/dist/types/metrics/constants.d.ts +52 -1
  117. package/dist/types/services/AddressBook.d.ts +2 -1
  118. package/dist/types/services/AnswerCallOnWebexService.d.ts +38 -0
  119. package/dist/types/services/ApiAiAssistant.d.ts +67 -5
  120. package/dist/types/services/EntryPoint.d.ts +7 -5
  121. package/dist/types/services/Queue.d.ts +5 -3
  122. package/dist/types/services/UserPreference.d.ts +118 -0
  123. package/dist/types/services/WebexCrossClientService.d.ts +32 -0
  124. package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
  125. package/dist/types/services/config/Util.d.ts +4 -8
  126. package/dist/types/services/config/constants.d.ts +49 -76
  127. package/dist/types/services/config/index.d.ts +16 -64
  128. package/dist/types/services/config/types.d.ts +252 -114
  129. package/dist/types/services/constants.d.ts +16 -0
  130. package/dist/types/services/core/Err.d.ts +6 -0
  131. package/dist/types/services/core/Utils.d.ts +43 -13
  132. package/dist/types/services/core/WebexRequest.d.ts +1 -0
  133. package/dist/types/services/core/constants.d.ts +7 -0
  134. package/dist/types/services/core/types.d.ts +2 -0
  135. package/dist/types/services/core/websocket/WebSocketManager.d.ts +2 -0
  136. package/dist/types/services/core/websocket/types.d.ts +1 -1
  137. package/dist/types/services/index.d.ts +2 -0
  138. package/dist/types/services/task/Task.d.ts +186 -0
  139. package/dist/types/services/task/TaskFactory.d.ts +14 -0
  140. package/dist/types/services/task/TaskUtils.d.ts +54 -2
  141. package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
  142. package/dist/types/services/task/constants.d.ts +20 -0
  143. package/dist/types/services/task/contact.d.ts +4 -0
  144. package/dist/types/services/task/dialer.d.ts +30 -0
  145. package/dist/types/services/task/digital/Digital.d.ts +23 -0
  146. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1442 -0
  147. package/dist/types/services/task/state-machine/actions.d.ts +10 -0
  148. package/dist/types/services/task/state-machine/constants.d.ts +107 -0
  149. package/dist/types/services/task/state-machine/guards.d.ts +103 -0
  150. package/dist/types/services/task/state-machine/index.d.ts +13 -0
  151. package/dist/types/services/task/state-machine/types.d.ts +277 -0
  152. package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
  153. package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
  154. package/dist/types/services/task/types.d.ts +790 -66
  155. package/dist/types/services/task/voice/Voice.d.ts +241 -0
  156. package/dist/types/services/task/voice/WebRTC.d.ts +54 -0
  157. package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
  158. package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +68 -0
  159. package/dist/types/services/wxAppDiagnosticLogging.d.ts +63 -0
  160. package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
  161. package/dist/types/types.d.ts +258 -11
  162. package/dist/types/utils/PageCache.d.ts +20 -3
  163. package/dist/types/webex.d.ts +1 -0
  164. package/dist/types.js +204 -6
  165. package/dist/types.js.map +1 -1
  166. package/dist/utils/PageCache.js +19 -5
  167. package/dist/utils/PageCache.js.map +1 -1
  168. package/dist/webex.js +22 -2
  169. package/dist/webex.js.map +1 -1
  170. package/docs/adr/0001-spec-source-policy.md +97 -0
  171. package/docs/adr/0002-consult-transfer-list-policy.md +345 -0
  172. package/docs/adr/0003-repo-standards-migration.md +104 -0
  173. package/docs/adr/index.md +35 -0
  174. package/docs/architecture.md +460 -0
  175. package/docs/getting-started.md +142 -0
  176. package/docs/index.md +53 -0
  177. package/docs/specs/README.md +98 -0
  178. package/package.json +17 -12
  179. package/schemas/repo-context.schema.json +796 -0
  180. package/src/cc.ts +1439 -105
  181. package/src/config.ts +13 -0
  182. package/src/constants.ts +53 -1
  183. package/src/docs/README.md +727 -0
  184. package/src/index.ts +72 -16
  185. package/src/metrics/MetricsManager.ts +16 -0
  186. package/src/metrics/behavioral-events.ts +218 -0
  187. package/src/metrics/constants.ts +63 -4
  188. package/src/metrics/docs/README.md +710 -0
  189. package/src/services/AddressBook.ts +17 -6
  190. package/src/services/AnswerCallOnWebexService.ts +239 -0
  191. package/src/services/ApiAiAssistant.ts +494 -15
  192. package/src/services/EntryPoint.ts +59 -60
  193. package/src/services/Queue.ts +29 -12
  194. package/src/services/UserPreference.ts +509 -0
  195. package/src/services/WebCallingService.ts +362 -40
  196. package/src/services/WebexCrossClientService.ts +298 -0
  197. package/src/services/WxAppTelephonyMercurySync.ts +142 -0
  198. package/src/services/agent/docs/README.md +673 -0
  199. package/src/services/config/Util.ts +54 -84
  200. package/src/services/config/constants.ts +64 -86
  201. package/src/services/config/docs/README.md +530 -0
  202. package/src/services/config/index.ts +116 -277
  203. package/src/services/config/types.ts +238 -125
  204. package/src/services/constants.ts +18 -0
  205. package/src/services/core/Err.ts +3 -0
  206. package/src/services/core/Utils.ts +151 -37
  207. package/src/services/core/WebexRequest.ts +3 -1
  208. package/src/services/core/aqm-reqs.ts +18 -12
  209. package/src/services/core/constants.ts +8 -0
  210. package/src/services/core/docs/README.md +993 -0
  211. package/src/services/core/types.ts +33 -1
  212. package/src/services/core/websocket/WebSocketManager.ts +37 -8
  213. package/src/services/core/websocket/connection-service.ts +5 -1
  214. package/src/services/core/websocket/types.ts +1 -1
  215. package/src/services/docs/README.md +765 -0
  216. package/src/services/index.ts +4 -0
  217. package/src/services/task/Task.ts +1211 -0
  218. package/src/services/task/TaskFactory.ts +82 -0
  219. package/src/services/task/TaskManager.ts +1551 -584
  220. package/src/services/task/TaskUtils.ts +316 -25
  221. package/src/services/task/WebexCallingUtils.ts +136 -0
  222. package/src/services/task/constants.ts +21 -0
  223. package/src/services/task/contact.ts +30 -0
  224. package/src/services/task/dialer.ts +80 -0
  225. package/src/services/task/digital/Digital.ts +102 -0
  226. package/src/services/task/docs/README.md +1569 -0
  227. package/src/services/task/state-machine/TaskStateMachine.ts +1320 -0
  228. package/src/services/task/state-machine/actions.ts +741 -0
  229. package/src/services/task/state-machine/constants.ts +172 -0
  230. package/src/services/task/state-machine/docs/README.md +1388 -0
  231. package/src/services/task/state-machine/guards.ts +442 -0
  232. package/src/services/task/state-machine/index.ts +28 -0
  233. package/src/services/task/state-machine/types.ts +258 -0
  234. package/src/services/task/state-machine/uiControlsComputer.ts +1135 -0
  235. package/src/services/task/taskDataNormalizer.ts +137 -0
  236. package/src/services/task/types.ts +974 -70
  237. package/src/services/task/voice/Voice.ts +1878 -0
  238. package/src/services/task/voice/WebRTC.ts +194 -0
  239. package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
  240. package/src/services/task/voice/wxAppVoiceMethods.ts +575 -0
  241. package/src/services/wxAppDiagnosticLogging.ts +286 -0
  242. package/src/services/wxAppTelephonyUtils.ts +14 -0
  243. package/src/types.ts +323 -13
  244. package/src/utils/AGENTS.md +291 -0
  245. package/src/utils/PageCache.ts +38 -5
  246. package/src/utils/docs/README.md +413 -0
  247. package/src/webex.js +10 -0
  248. package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
  249. package/test/unit/spec/cc.ts +4046 -181
  250. package/test/unit/spec/index.ts +891 -0
  251. package/test/unit/spec/logger-proxy.ts +70 -0
  252. package/test/unit/spec/metrics/MetricsManager.ts +25 -0
  253. package/test/unit/spec/metrics/behavioral-events.ts +60 -0
  254. package/test/unit/spec/services/AddressBook.ts +37 -6
  255. package/test/unit/spec/services/AnswerCallOnWebexService.ts +264 -0
  256. package/test/unit/spec/services/ApiAiAssistant.ts +442 -23
  257. package/test/unit/spec/services/EntryPoint.ts +87 -40
  258. package/test/unit/spec/services/Queue.ts +123 -12
  259. package/test/unit/spec/services/UserPreference.ts +401 -0
  260. package/test/unit/spec/services/WebCallingService.ts +484 -49
  261. package/test/unit/spec/services/WebexCrossClientService.ts +509 -0
  262. package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +136 -0
  263. package/test/unit/spec/services/config/Util.ts +501 -0
  264. package/test/unit/spec/services/config/index.ts +318 -548
  265. package/test/unit/spec/services/core/Utils.ts +447 -8
  266. package/test/unit/spec/services/core/WebexRequest.ts +8 -7
  267. package/test/unit/spec/services/core/aqm-reqs.ts +142 -1
  268. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +132 -56
  269. package/test/unit/spec/services/core/websocket/connection-service.ts +3 -1
  270. package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
  271. package/test/unit/spec/services/task/Task.ts +2723 -0
  272. package/test/unit/spec/services/task/TaskFactory.ts +116 -0
  273. package/test/unit/spec/services/task/TaskManager.ts +4800 -1586
  274. package/test/unit/spec/services/task/TaskUtils.ts +307 -0
  275. package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
  276. package/test/unit/spec/services/task/contact.ts +33 -0
  277. package/test/unit/spec/services/task/dialer.ts +190 -0
  278. package/test/unit/spec/services/task/digital/Digital.ts +105 -0
  279. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +4060 -0
  280. package/test/unit/spec/services/task/state-machine/guards.ts +839 -0
  281. package/test/unit/spec/services/task/state-machine/types.ts +18 -0
  282. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +3101 -0
  283. package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
  284. package/test/unit/spec/services/task/voice/Voice.ts +2355 -0
  285. package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
  286. package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
  287. package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +719 -0
  288. package/test/unit/spec/services/wxAppDiagnosticLogging.ts +179 -0
  289. package/test/unit/spec/wellnessSampleUtils.ts +288 -0
  290. package/typedoc.md +1 -1
  291. package/umd/contact-center.min.js +2 -2
  292. package/umd/contact-center.min.js.map +1 -1
  293. package/dist/services/task/index.js +0 -1525
  294. package/dist/services/task/index.js.map +0 -1
  295. package/dist/types/services/task/index.d.ts +0 -650
  296. package/src/services/task/index.ts +0 -1801
  297. package/test/unit/spec/services/task/index.ts +0 -2184
@@ -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,12 +150,14 @@ 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 && 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,
192
- defaultDn: userData.defaultDialledNumber,
160
+ defaultDn: userData.deafultDialledNumber,
193
161
  forceDefaultDn: tenantData.forceDefaultDn,
194
162
  forceDefaultDnForAgent: getDefaultAgentDN(agentProfileData.agentDNValidation),
195
163
  regexUS: tenantData.dnDefaultRegex,
@@ -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',
@@ -233,11 +199,14 @@ function parseAgentConfigs(profileData: {
233
199
  isAgentAvailableAfterOutdial: agentProfileData.agentAvailableAfterOutdial,
234
200
  outDialEp: agentProfileData.outdialEntryPointId,
235
201
  isCampaignManagementEnabled: orgSettingsData.campaignManagerEnabled,
236
- isEndCallEnabled: tenantData.endCallEnabled,
202
+ isEndTaskEnabled: tenantData.endCallEnabled,
237
203
  isEndConsultEnabled: tenantData.endConsultEnabled,
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;
@@ -1,6 +1,13 @@
1
1
  // making query params configurable for List Teams and List Aux Codes API
2
2
  export const DEFAULT_PAGE = 0;
3
3
 
4
+ /** Desktop Profile access levels for collaboration destination categories. */
5
+ export const COLLABORATION_ACCESS = {
6
+ ALL: 'ALL',
7
+ SPECIFIC: 'SPECIFIC',
8
+ NONE: 'NONE',
9
+ } as const;
10
+
4
11
  /**
5
12
  * Default page size for paginated API requests.
6
13
  * @type {number}
@@ -27,6 +34,12 @@ export const AGENT_STATE_AVAILABLE_ID = '0';
27
34
  */
28
35
  export const AGENT_STATE_AVAILABLE = 'Available';
29
36
 
37
+ /** System idle-code name reserved for Agent Wellness Break. */
38
+ export const WELLBEING_BREAK_IDLE_CODE = 'WellbeingBreak';
39
+
40
+ /** Backend sentinel indicating wellness-break reminders are enabled. @internal */
41
+ export const WELLNESS_BREAK_REMINDERS_ENABLED = 'ENABLED';
42
+
30
43
  /**
31
44
  * Description for the 'Available' agent state.
32
45
  * @type {string}
@@ -54,25 +67,20 @@ export const DEFAULT_AUXCODE_ATTRIBUTES = [
54
67
  export const METHODS = {
55
68
  // AgentConfigService methods
56
69
  GET_AGENT_CONFIG: 'getAgentConfig',
57
- GET_USER_USING_CI: 'getUserUsingCI',
58
- GET_DESKTOP_PROFILE_BY_ID: 'getDesktopProfileById',
70
+ GET_ORG_DESKTOP_LOGIN_CONFIG: 'getOrgDesktopLoginConfig',
71
+ GET_USER_DESKTOP_LOGIN_CONFIG: 'getUserDesktopLoginConfig',
59
72
  GET_MULTIMEDIA_PROFILE_BY_ID: 'getMultimediaProfileById',
60
73
  GET_LIST_OF_TEAMS: 'getListOfTeams',
61
74
  GET_ALL_TEAMS: 'getAllTeams',
62
75
  GET_LIST_OF_AUX_CODES: 'getListOfAuxCodes',
63
76
  GET_ALL_AUX_CODES: 'getAllAuxCodes',
64
77
  GET_SITE_INFO: 'getSiteInfo',
65
- GET_ORG_INFO: 'getOrgInfo',
66
- GET_ORGANIZATION_SETTING: 'getOrganizationSetting',
67
- GET_TENANT_DATA: 'getTenantData',
68
- GET_URL_MAPPING: 'getURLMapping',
69
78
  GET_DIAL_PLAN_DATA: 'getDialPlanData',
70
- GET_AI_FEATURE_FLAGS: 'getAIFeatureFlags',
79
+ GET_WELLBEING_BREAK_IDLE_CODE: 'getWellbeingBreakIdleCode',
71
80
  GET_QUEUES: 'getQueues',
72
81
 
73
82
  // Util methods
74
83
  PARSE_AGENT_CONFIGS: 'parseAgentConfigs',
75
- GET_URL_MAPPING_UTIL: 'getUrlMapping',
76
84
  GET_MSFT_CONFIG: 'getMsftConfig',
77
85
  GET_WEBEX_CONFIG: 'getWebexConfig',
78
86
  GET_DEFAULT_AGENT_DN: 'getDefaultAgentDN',
@@ -85,34 +93,32 @@ export const METHODS = {
85
93
  * Maps API endpoint names to functions that generate endpoint URLs for various organization resources.
86
94
  * @public
87
95
  * @example
88
- * const url = endPointMap.userByCI('org123', 'agent456');
96
+ * const url = endPointMap.userDesktopLogin('org123', 'agent456');
89
97
  */
90
98
  export const endPointMap = {
91
99
  /**
92
- * Gets the endpoint for a user by CI user ID.
100
+ * Gets the endpoint for the aggregated organization desktop-login configuration.
93
101
  * @param orgId - Organization ID.
94
- * @param agentId - Agent ID.
95
102
  * @returns The endpoint URL string.
96
103
  * @public
97
104
  * @example
98
- * const url = endPointMap.userByCI('org123', 'agent456');
105
+ * const url = endPointMap.orgDesktopLogin('org123');
99
106
  * @ignore
100
107
  */
101
- userByCI: (orgId: string, agentId: string) =>
102
- `organization/${orgId}/user/by-ci-user-id/${agentId}`,
108
+ orgDesktopLogin: (orgId: string) => `organization/${orgId}/desktop-login`,
103
109
 
104
110
  /**
105
- * Gets the endpoint for a desktop profile.
111
+ * Gets the endpoint for the aggregated user desktop-login configuration.
106
112
  * @param orgId - Organization ID.
107
- * @param desktopProfileId - Desktop profile ID.
113
+ * @param ciUserId - CI user ID of the agent.
108
114
  * @returns The endpoint URL string.
109
115
  * @public
110
116
  * @example
111
- * const url = endPointMap.desktopProfile('org123', 'profile789');
117
+ * const url = endPointMap.userDesktopLogin('org123', 'agent456');
112
118
  * @ignore
113
119
  */
114
- desktopProfile: (orgId: string, desktopProfileId: string) =>
115
- `organization/${orgId}/agent-profile/${desktopProfileId}`,
120
+ userDesktopLogin: (orgId: string, ciUserId: string) =>
121
+ `organization/${orgId}/v2/user/by-ci-user-id/${ciUserId}/desktop-login`,
116
122
 
117
123
  /**
118
124
  * Gets the endpoint for a multimedia profile.
@@ -128,21 +134,21 @@ export const endPointMap = {
128
134
  `organization/${orgId}/multimedia-profile/${multimediaProfileId}`,
129
135
 
130
136
  /**
131
- * Gets the endpoint for listing teams with optional filters.
137
+ * Gets the endpoint for listing the teams a user belongs to.
138
+ * The filter value must stay unquoted — the quoted form returns HTTP 400.
132
139
  * @param orgId - Organization ID.
133
140
  * @param page - Page number.
134
141
  * @param pageSize - Page size.
135
- * @param filter - Array of team IDs to filter.
142
+ * @param userDbId - Database ID of the user whose teams are requested.
136
143
  * @returns The endpoint URL string.
137
144
  * @public
138
145
  * @example
139
- * const url = endPointMap.listTeams('org123', 0, 100, ['team1', 'team2']);
146
+ * const url = endPointMap.listTeams('org123', 0, 100, 'userDb456');
140
147
  * @ignore
141
148
  */
142
- listTeams: (orgId: string, page: number, pageSize: number, filter: string[]) =>
143
- `organization/${orgId}/v2/team?page=${page}&pageSize=${pageSize}${
144
- filter && filter.length > 0 ? `&filter=id=in=(${filter})` : ''
145
- }`,
149
+ listTeams: (orgId: string, page: number, pageSize: number, userDbId: string) =>
150
+ `organization/${orgId}/v2/team?page=${page}&pageSize=${pageSize}` +
151
+ `&agentView=true&filter=userId==${userDbId}`,
146
152
 
147
153
  /**
148
154
  * Gets the endpoint for listing auxiliary codes with optional filters and attributes.
@@ -166,29 +172,12 @@ export const endPointMap = {
166
172
  ) =>
167
173
  `organization/${orgId}/v2/auxiliary-code?page=${page}&pageSize=${pageSize}${
168
174
  filter && filter.length > 0 ? `&filter=id=in=(${filter})` : ''
169
- }&attributes=${attributes}`,
175
+ }&attributes=${attributes}&desktopProfileFilter=true`,
170
176
 
171
- /**
172
- * Gets the endpoint for organization info.
173
- * @param orgId - Organization ID.
174
- * @returns The endpoint URL string.
175
- * @public
176
- * @example
177
- * const url = endPointMap.orgInfo('org123');
178
- * @ignore
179
- */
180
- orgInfo: (orgId: string) => `organization/${orgId}`,
181
-
182
- /**
183
- * Gets the endpoint for organization settings.
184
- * @param orgId - Organization ID.
185
- * @returns The endpoint URL string.
186
- * @public
187
- * @example
188
- * const url = endPointMap.orgSettings('org123');
189
- * @ignore
190
- */
191
- orgSettings: (orgId: string) => `organization/${orgId}/v2/organization-setting?agentView=true`,
177
+ /** Lists system idle codes without applying the agent Desktop Profile filter. */
178
+ systemIdleCodes: (orgId: string, page: number, pageSize: number) =>
179
+ `organization/${orgId}/v2/auxiliary-code?page=${page}&pageSize=${pageSize}` +
180
+ '&workType=IDLE_CODE&customFilter=isSystemCode==true&desktopProfileFilter=false',
192
181
 
193
182
  /**
194
183
  * Gets the endpoint for site info.
@@ -202,28 +191,6 @@ export const endPointMap = {
202
191
  */
203
192
  siteInfo: (orgId: string, siteId: string) => `organization/${orgId}/site/${siteId}`,
204
193
 
205
- /**
206
- * Gets the endpoint for tenant configuration data.
207
- * @param orgId - Organization ID.
208
- * @returns The endpoint URL string.
209
- * @public
210
- * @example
211
- * const url = endPointMap.tenantData('org123');
212
- * @ignore
213
- */
214
- tenantData: (orgId: string) => `organization/${orgId}/v2/tenant-configuration?agentView=true`,
215
-
216
- /**
217
- * Gets the endpoint for organization URL mapping.
218
- * @param orgId - Organization ID.
219
- * @returns The endpoint URL string.
220
- * @public
221
- * @example
222
- * const url = endPointMap.urlMapping('org123');
223
- * @ignore
224
- */
225
- urlMapping: (orgId: string) => `organization/${orgId}/v2/org-url-mapping?sort=name,ASC`,
226
-
227
194
  /**
228
195
  * Gets the endpoint for dial plan.
229
196
  * @param orgId - Organization ID.
@@ -234,16 +201,6 @@ export const endPointMap = {
234
201
  * @ignore
235
202
  */
236
203
  dialPlan: (orgId: string) => `organization/${orgId}/dial-plan?agentView=true`,
237
- /**
238
- * Gets the endpoint for listing AI feature flags.
239
- * @param orgId - Organization ID.
240
- * @returns The endpoint URL string.
241
- * @public
242
- * @example
243
- * const url = endPointMap.aiFeatureFlags('org123');
244
- * @ignore
245
- */
246
- aiFeature: (orgId: string) => `organization/${orgId}/v2/ai-feature?page=0&pageSize=100`,
247
204
 
248
205
  /**
249
206
  * Gets the endpoint for the queue list with custom query parameters.
@@ -258,17 +215,14 @@ export const endPointMap = {
258
215
  queueList: (orgId: string, queryParams: string) =>
259
216
  `/organization/${orgId}/v2/contact-service-queue?${queryParams}`,
260
217
  /**
261
- * Gets the endpoint for entry points list with custom query parameters.
218
+ * Gets the desktop-profile-filtered dial-number mappings used by entry-point destination lists.
262
219
  * @param orgId - Organization ID.
263
220
  * @param queryParams - Query parameters string.
264
221
  * @returns The endpoint URL string.
265
- * @public
266
- * @example
267
- * const url = endPointMap.entryPointList('org123', 'page=0&pageSize=10');
268
222
  * @ignore
269
223
  */
270
- entryPointList: (orgId: string, queryParams: string) =>
271
- `/organization/${orgId}/v2/entry-point?${queryParams}`,
224
+ entryPointDialNumberList: (orgId: string, queryParams: string) =>
225
+ `/organization/${orgId}/v3/dial-number?${queryParams}`,
272
226
  /**
273
227
  * Gets the endpoint for address book entries with custom query parameters.
274
228
  * @param orgId - Organization ID.
@@ -298,4 +252,28 @@ export const endPointMap = {
298
252
  `organization/${orgId}/v2/outdial-ani/${outdialANI}/entry${
299
253
  queryParams ? `?${queryParams}` : ''
300
254
  }`,
255
+
256
+ /**
257
+ * Gets the endpoint for user preference by user ID.
258
+ * @param orgId - Organization ID.
259
+ * @param userId - User ID.
260
+ * @returns The endpoint URL string.
261
+ * @public
262
+ * @example
263
+ * const url = endPointMap.userPreference('org123', 'user456');
264
+ * @ignore
265
+ */
266
+ userPreference: (orgId: string, userId: string) =>
267
+ `organization/${orgId}/user-preference/${userId}`,
268
+
269
+ /**
270
+ * Gets the endpoint for creating user preference.
271
+ * @param orgId - Organization ID.
272
+ * @returns The endpoint URL string.
273
+ * @public
274
+ * @example
275
+ * const url = endPointMap.userPreferenceCreate('org123');
276
+ * @ignore
277
+ */
278
+ userPreferenceCreate: (orgId: string) => `organization/${orgId}/user-preference`,
301
279
  };