@webex/contact-center 3.11.0 → 3.12.0-auth-prejoin-fetch.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 (325) hide show
  1. package/.sdd/manifest.json +883 -0
  2. package/AGENTS.md +94 -0
  3. package/ai-docs/ARCHITECTURE.md +168 -0
  4. package/ai-docs/CONTRACTS.md +50 -0
  5. package/ai-docs/GETTING_STARTED.md +168 -0
  6. package/ai-docs/GLOSSARY.md +43 -0
  7. package/ai-docs/README.md +138 -0
  8. package/ai-docs/REVIEW_CHECKLIST.md +41 -0
  9. package/ai-docs/RULES.md +444 -0
  10. package/ai-docs/SECURITY.md +52 -0
  11. package/ai-docs/SERVICE_STATE.md +48 -0
  12. package/ai-docs/SPEC_INDEX.md +65 -0
  13. package/ai-docs/adr/0001-spec-source-policy.md +55 -0
  14. package/ai-docs/adr/README.md +8 -0
  15. package/ai-docs/adr/_adr-template.md +31 -0
  16. package/ai-docs/contact-center-spec.md +359 -0
  17. package/ai-docs/features/consult-transfer-list-policy/spec/feature-spec.md +362 -0
  18. package/ai-docs/features/generated-spec-conformance-fidelity-remediation/spec/feature-spec.md +117 -0
  19. package/ai-docs/features/residual-warning-coverage-completion/spec/feature-spec.md +203 -0
  20. package/ai-docs/features/validator-code-fidelity-drift-fix/spec/feature-spec.md +315 -0
  21. package/ai-docs/patterns/event-driven-patterns.md +485 -0
  22. package/ai-docs/patterns/testing-patterns.md +480 -0
  23. package/ai-docs/patterns/typescript-patterns.md +365 -0
  24. package/ai-docs/templates/README.md +102 -0
  25. package/ai-docs/templates/documentation/create-agents-md.md +240 -0
  26. package/ai-docs/templates/documentation/create-architecture-md.md +295 -0
  27. package/ai-docs/templates/existing-service/bug-fix.md +254 -0
  28. package/ai-docs/templates/existing-service/feature-enhancement.md +450 -0
  29. package/ai-docs/templates/new-method/00-master.md +80 -0
  30. package/ai-docs/templates/new-method/01-requirements.md +232 -0
  31. package/ai-docs/templates/new-method/02-implementation.md +295 -0
  32. package/ai-docs/templates/new-method/03-tests.md +201 -0
  33. package/ai-docs/templates/new-method/04-validation.md +141 -0
  34. package/ai-docs/templates/new-service/00-master.md +109 -0
  35. package/ai-docs/templates/new-service/01-pre-questions.md +159 -0
  36. package/ai-docs/templates/new-service/02-code-generation.md +346 -0
  37. package/ai-docs/templates/new-service/03-integration.md +178 -0
  38. package/ai-docs/templates/new-service/04-test-generation.md +205 -0
  39. package/ai-docs/templates/new-service/05-validation.md +145 -0
  40. package/dist/cc.js +818 -59
  41. package/dist/cc.js.map +1 -1
  42. package/dist/config.js +13 -0
  43. package/dist/config.js.map +1 -1
  44. package/dist/constants.js +31 -3
  45. package/dist/constants.js.map +1 -1
  46. package/dist/index.js +27 -5
  47. package/dist/index.js.map +1 -1
  48. package/dist/metrics/behavioral-events.js +127 -0
  49. package/dist/metrics/behavioral-events.js.map +1 -1
  50. package/dist/metrics/constants.js +34 -3
  51. package/dist/metrics/constants.js.map +1 -1
  52. package/dist/services/AddressBook.js +18 -15
  53. package/dist/services/AddressBook.js.map +1 -1
  54. package/dist/services/AnswerCallOnWebexService.js +174 -0
  55. package/dist/services/AnswerCallOnWebexService.js.map +1 -0
  56. package/dist/services/ApiAiAssistant.js +318 -0
  57. package/dist/services/ApiAiAssistant.js.map +1 -0
  58. package/dist/services/EntryPoint.js +46 -68
  59. package/dist/services/EntryPoint.js.map +1 -1
  60. package/dist/services/Queue.js +27 -22
  61. package/dist/services/Queue.js.map +1 -1
  62. package/dist/services/UserPreference.js +427 -0
  63. package/dist/services/UserPreference.js.map +1 -0
  64. package/dist/services/WebexCrossClientService.js +171 -0
  65. package/dist/services/WebexCrossClientService.js.map +1 -0
  66. package/dist/services/WxAppTelephonyMercurySync.js +93 -0
  67. package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
  68. package/dist/services/agent/types.js.map +1 -1
  69. package/dist/services/config/Util.js +11 -4
  70. package/dist/services/config/Util.js.map +1 -1
  71. package/dist/services/config/constants.js +45 -8
  72. package/dist/services/config/constants.js.map +1 -1
  73. package/dist/services/config/index.js +41 -2
  74. package/dist/services/config/index.js.map +1 -1
  75. package/dist/services/config/types.js +70 -8
  76. package/dist/services/config/types.js.map +1 -1
  77. package/dist/services/constants.js +27 -1
  78. package/dist/services/constants.js.map +1 -1
  79. package/dist/services/core/Err.js.map +1 -1
  80. package/dist/services/core/Utils.js +122 -25
  81. package/dist/services/core/Utils.js.map +1 -1
  82. package/dist/services/core/WebexRequest.js +6 -2
  83. package/dist/services/core/WebexRequest.js.map +1 -1
  84. package/dist/services/core/aqm-reqs.js +119 -30
  85. package/dist/services/core/aqm-reqs.js.map +1 -1
  86. package/dist/services/core/types.js.map +1 -1
  87. package/dist/services/core/websocket/WebSocketManager.js +22 -6
  88. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  89. package/dist/services/core/websocket/connection-service.js +3 -1
  90. package/dist/services/core/websocket/connection-service.js.map +1 -1
  91. package/dist/services/core/websocket/types.js.map +1 -1
  92. package/dist/services/index.js +6 -0
  93. package/dist/services/index.js.map +1 -1
  94. package/dist/services/task/Task.js +754 -0
  95. package/dist/services/task/Task.js.map +1 -0
  96. package/dist/services/task/TaskFactory.js +49 -0
  97. package/dist/services/task/TaskFactory.js.map +1 -0
  98. package/dist/services/task/TaskManager.js +1073 -447
  99. package/dist/services/task/TaskManager.js.map +1 -1
  100. package/dist/services/task/TaskUtils.js +220 -23
  101. package/dist/services/task/TaskUtils.js.map +1 -1
  102. package/dist/services/task/WebexCallingUtils.js +70 -0
  103. package/dist/services/task/WebexCallingUtils.js.map +1 -0
  104. package/dist/services/task/constants.js +26 -2
  105. package/dist/services/task/constants.js.map +1 -1
  106. package/dist/services/task/contact.js +29 -0
  107. package/dist/services/task/contact.js.map +1 -1
  108. package/dist/services/task/dialer.js +129 -0
  109. package/dist/services/task/dialer.js.map +1 -1
  110. package/dist/services/task/digital/Digital.js +78 -0
  111. package/dist/services/task/digital/Digital.js.map +1 -0
  112. package/dist/services/task/state-machine/TaskStateMachine.js +971 -0
  113. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
  114. package/dist/services/task/state-machine/actions.js +572 -0
  115. package/dist/services/task/state-machine/actions.js.map +1 -0
  116. package/dist/services/task/state-machine/constants.js +161 -0
  117. package/dist/services/task/state-machine/constants.js.map +1 -0
  118. package/dist/services/task/state-machine/guards.js +409 -0
  119. package/dist/services/task/state-machine/guards.js.map +1 -0
  120. package/dist/services/task/state-machine/index.js +53 -0
  121. package/dist/services/task/state-machine/index.js.map +1 -0
  122. package/dist/services/task/state-machine/types.js +54 -0
  123. package/dist/services/task/state-machine/types.js.map +1 -0
  124. package/dist/services/task/state-machine/uiControlsComputer.js +703 -0
  125. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
  126. package/dist/services/task/taskDataNormalizer.js +99 -0
  127. package/dist/services/task/taskDataNormalizer.js.map +1 -0
  128. package/dist/services/task/types.js +243 -5
  129. package/dist/services/task/types.js.map +1 -1
  130. package/dist/services/task/voice/Voice.js +1380 -0
  131. package/dist/services/task/voice/Voice.js.map +1 -0
  132. package/dist/services/task/voice/WebRTC.js +152 -0
  133. package/dist/services/task/voice/WebRTC.js.map +1 -0
  134. package/dist/services/task/voice/wxAppVoiceMethods.js +201 -0
  135. package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
  136. package/dist/services/wxAppTelephonyUtils.js +19 -0
  137. package/dist/services/wxAppTelephonyUtils.js.map +1 -0
  138. package/dist/types/cc.d.ts +967 -0
  139. package/dist/types/config.d.ts +79 -0
  140. package/dist/types/constants.d.ts +74 -0
  141. package/dist/types/index.d.ts +201 -0
  142. package/dist/types/logger-proxy.d.ts +71 -0
  143. package/dist/types/metrics/MetricsManager.d.ts +223 -0
  144. package/dist/types/metrics/behavioral-events.d.ts +29 -0
  145. package/dist/types/metrics/constants.d.ts +183 -0
  146. package/dist/types/services/AddressBook.d.ts +75 -0
  147. package/dist/types/services/AnswerCallOnWebexService.d.ts +37 -0
  148. package/dist/types/services/ApiAiAssistant.d.ts +49 -0
  149. package/dist/types/services/EntryPoint.d.ts +69 -0
  150. package/dist/types/services/Queue.d.ts +78 -0
  151. package/dist/types/services/UserPreference.d.ts +118 -0
  152. package/dist/types/services/WebCallingService.d.ts +1 -0
  153. package/dist/types/services/WebexCrossClientService.d.ts +28 -0
  154. package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
  155. package/dist/types/services/agent/index.d.ts +46 -0
  156. package/dist/types/services/agent/types.d.ts +413 -0
  157. package/dist/types/services/config/Util.d.ts +20 -0
  158. package/dist/types/services/config/constants.d.ts +273 -0
  159. package/dist/types/services/config/index.d.ts +177 -0
  160. package/dist/types/services/config/types.d.ts +1381 -0
  161. package/dist/types/services/constants.d.ts +110 -0
  162. package/dist/types/services/core/Err.d.ts +127 -0
  163. package/dist/types/services/core/GlobalTypes.d.ts +58 -0
  164. package/dist/types/services/core/Utils.d.ts +121 -0
  165. package/dist/types/services/core/WebexRequest.d.ts +23 -0
  166. package/dist/types/services/core/aqm-reqs.d.ts +65 -0
  167. package/dist/types/services/core/constants.d.ts +99 -0
  168. package/dist/types/services/core/types.d.ts +49 -0
  169. package/dist/types/services/core/websocket/WebSocketManager.d.ts +36 -0
  170. package/dist/types/services/core/websocket/connection-service.d.ts +27 -0
  171. package/dist/types/services/core/websocket/keepalive.worker.d.ts +2 -0
  172. package/dist/types/services/core/websocket/types.d.ts +37 -0
  173. package/dist/types/services/index.d.ts +54 -0
  174. package/dist/types/services/task/AutoWrapup.d.ts +40 -0
  175. package/dist/types/services/task/Task.d.ts +175 -0
  176. package/dist/types/services/task/TaskFactory.d.ts +13 -0
  177. package/dist/types/services/task/TaskManager.d.ts +1 -0
  178. package/dist/types/services/task/TaskUtils.d.ts +138 -0
  179. package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
  180. package/dist/types/services/task/constants.d.ts +94 -0
  181. package/dist/types/services/task/contact.d.ts +73 -0
  182. package/dist/types/services/task/dialer.d.ts +73 -0
  183. package/dist/types/services/task/digital/Digital.d.ts +22 -0
  184. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1398 -0
  185. package/dist/types/services/task/state-machine/actions.d.ts +10 -0
  186. package/dist/types/services/task/state-machine/constants.d.ts +107 -0
  187. package/dist/types/services/task/state-machine/guards.d.ts +103 -0
  188. package/dist/types/services/task/state-machine/index.d.ts +13 -0
  189. package/dist/types/services/task/state-machine/types.d.ts +277 -0
  190. package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
  191. package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
  192. package/dist/types/services/task/types.d.ts +1933 -0
  193. package/dist/types/services/task/voice/Voice.d.ts +223 -0
  194. package/dist/types/services/task/voice/WebRTC.d.ts +53 -0
  195. package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +52 -0
  196. package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
  197. package/dist/types/types.d.ts +784 -0
  198. package/dist/types/utils/PageCache.d.ts +190 -0
  199. package/dist/types/webex-config.d.ts +53 -0
  200. package/dist/types/webex.d.ts +8 -0
  201. package/dist/types.js +137 -3
  202. package/dist/types.js.map +1 -1
  203. package/dist/utils/PageCache.js +19 -5
  204. package/dist/utils/PageCache.js.map +1 -1
  205. package/dist/webex.js +14 -2
  206. package/dist/webex.js.map +1 -1
  207. package/package.json +16 -12
  208. package/src/cc.ts +983 -60
  209. package/src/config.ts +13 -0
  210. package/src/constants.ts +29 -1
  211. package/src/index.ts +26 -5
  212. package/src/metrics/ai-docs/AGENTS.md +350 -0
  213. package/src/metrics/ai-docs/ARCHITECTURE.md +338 -0
  214. package/src/metrics/ai-docs/metrics-spec.md +860 -0
  215. package/src/metrics/behavioral-events.ts +134 -0
  216. package/src/metrics/constants.ts +39 -3
  217. package/src/services/AddressBook.ts +17 -6
  218. package/src/services/AnswerCallOnWebexService.ts +206 -0
  219. package/src/services/ApiAiAssistant.ts +412 -0
  220. package/src/services/EntryPoint.ts +59 -60
  221. package/src/services/Queue.ts +29 -12
  222. package/src/services/UserPreference.ts +509 -0
  223. package/src/services/WebexCrossClientService.ts +212 -0
  224. package/src/services/WxAppTelephonyMercurySync.ts +115 -0
  225. package/src/services/agent/ai-docs/AGENTS.md +240 -0
  226. package/src/services/agent/ai-docs/ARCHITECTURE.md +304 -0
  227. package/src/services/agent/ai-docs/agent-spec.md +504 -0
  228. package/src/services/agent/types.ts +1 -1
  229. package/src/services/ai-docs/AGENTS.md +386 -0
  230. package/src/services/ai-docs/services-spec.md +497 -0
  231. package/src/services/config/Util.ts +13 -2
  232. package/src/services/config/ai-docs/AGENTS.md +255 -0
  233. package/src/services/config/ai-docs/ARCHITECTURE.md +426 -0
  234. package/src/services/config/ai-docs/config-spec.md +675 -0
  235. package/src/services/config/constants.ts +47 -7
  236. package/src/services/config/index.ts +45 -1
  237. package/src/services/config/types.ts +253 -11
  238. package/src/services/constants.ts +29 -0
  239. package/src/services/core/Err.ts +4 -0
  240. package/src/services/core/Utils.ts +143 -30
  241. package/src/services/core/WebexRequest.ts +3 -1
  242. package/src/services/core/ai-docs/AGENTS.md +381 -0
  243. package/src/services/core/ai-docs/ARCHITECTURE.md +698 -0
  244. package/src/services/core/ai-docs/core-spec.md +787 -0
  245. package/src/services/core/aqm-reqs.ts +125 -32
  246. package/src/services/core/types.ts +2 -0
  247. package/src/services/core/websocket/WebSocketManager.ts +23 -6
  248. package/src/services/core/websocket/connection-service.ts +5 -1
  249. package/src/services/core/websocket/types.ts +1 -1
  250. package/src/services/index.ts +4 -0
  251. package/src/services/task/Task.ts +908 -0
  252. package/src/services/task/TaskFactory.ts +60 -0
  253. package/src/services/task/TaskManager.ts +1291 -513
  254. package/src/services/task/TaskUtils.ts +314 -24
  255. package/src/services/task/WebexCallingUtils.ts +136 -0
  256. package/src/services/task/ai-docs/AGENTS.md +457 -0
  257. package/src/services/task/ai-docs/ARCHITECTURE.md +595 -0
  258. package/src/services/task/ai-docs/task-spec.md +1469 -0
  259. package/src/services/task/constants.ts +26 -0
  260. package/src/services/task/contact.ts +30 -0
  261. package/src/services/task/dialer.ts +136 -1
  262. package/src/services/task/digital/Digital.ts +97 -0
  263. package/src/services/task/state-machine/TaskStateMachine.ts +1313 -0
  264. package/src/services/task/state-machine/actions.ts +741 -0
  265. package/src/services/task/state-machine/ai-docs/AGENTS.md +462 -0
  266. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1146 -0
  267. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +2209 -0
  268. package/src/services/task/state-machine/constants.ts +172 -0
  269. package/src/services/task/state-machine/guards.ts +498 -0
  270. package/src/services/task/state-machine/index.ts +28 -0
  271. package/src/services/task/state-machine/types.ts +258 -0
  272. package/src/services/task/state-machine/uiControlsComputer.ts +1135 -0
  273. package/src/services/task/taskDataNormalizer.ts +137 -0
  274. package/src/services/task/types.ts +843 -70
  275. package/src/services/task/voice/Voice.ts +1720 -0
  276. package/src/services/task/voice/WebRTC.ts +191 -0
  277. package/src/services/task/voice/wxAppVoiceMethods.ts +307 -0
  278. package/src/services/wxAppTelephonyUtils.ts +14 -0
  279. package/src/types.ts +238 -11
  280. package/src/utils/AGENTS.md +289 -0
  281. package/src/utils/PageCache.ts +38 -5
  282. package/src/utils/ai-docs/utils-spec.md +391 -0
  283. package/src/webex.js +2 -0
  284. package/test/unit/spec/cc.ts +1856 -122
  285. package/test/unit/spec/logger-proxy.ts +70 -0
  286. package/test/unit/spec/metrics/behavioral-events.ts +18 -0
  287. package/test/unit/spec/services/AddressBook.ts +37 -6
  288. package/test/unit/spec/services/AnswerCallOnWebexService.ts +223 -0
  289. package/test/unit/spec/services/ApiAiAssistant.ts +273 -0
  290. package/test/unit/spec/services/EntryPoint.ts +87 -40
  291. package/test/unit/spec/services/Queue.ts +123 -12
  292. package/test/unit/spec/services/UserPreference.ts +401 -0
  293. package/test/unit/spec/services/WebCallingService.ts +7 -1
  294. package/test/unit/spec/services/WebexCrossClientService.ts +261 -0
  295. package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +113 -0
  296. package/test/unit/spec/services/config/Util.ts +85 -0
  297. package/test/unit/spec/services/config/index.ts +85 -29
  298. package/test/unit/spec/services/core/Utils.ts +481 -2
  299. package/test/unit/spec/services/core/WebexRequest.ts +3 -1
  300. package/test/unit/spec/services/core/aqm-reqs.ts +113 -1
  301. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +137 -41
  302. package/test/unit/spec/services/core/websocket/connection-service.ts +3 -1
  303. package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
  304. package/test/unit/spec/services/task/Task.ts +677 -0
  305. package/test/unit/spec/services/task/TaskFactory.ts +99 -0
  306. package/test/unit/spec/services/task/TaskManager.ts +2209 -918
  307. package/test/unit/spec/services/task/TaskUtils.ts +235 -0
  308. package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
  309. package/test/unit/spec/services/task/contact.ts +33 -0
  310. package/test/unit/spec/services/task/dialer.ts +372 -96
  311. package/test/unit/spec/services/task/digital/Digital.ts +105 -0
  312. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +3433 -0
  313. package/test/unit/spec/services/task/state-machine/guards.ts +839 -0
  314. package/test/unit/spec/services/task/state-machine/types.ts +18 -0
  315. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +3101 -0
  316. package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
  317. package/test/unit/spec/services/task/voice/Voice.ts +1523 -0
  318. package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
  319. package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +459 -0
  320. package/umd/contact-center.min.js +2 -2
  321. package/umd/contact-center.min.js.map +1 -1
  322. package/dist/services/task/index.js +0 -1525
  323. package/dist/services/task/index.js.map +0 -1
  324. package/src/services/task/index.ts +0 -1801
  325. package/test/unit/spec/services/task/index.ts +0 -2184
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","_loggerProxy","_interopRequireDefault","_WebexRequest","_MetricsManager","_constants","_constants2","_constants3","e","__esModule","default","UserPreference","constructor","webex","getUserId","webexRequest","WebexRequest","getInstance","metricsManager","MetricsManager","getUserPreference","params","userId","page","pageSize","targetUserId","orgId","credentials","getOrgId","LoggerProxy","info","module","method","data","error","Error","resource","endPointMap","userPreference","queryParams","undefined","push","length","join","service","WCC_API_GATEWAY","timeEvent","METRIC_EVENT_NAMES","USER_PREFERENCE_GET_SUCCESS","USER_PREFERENCE_GET_FAILED","response","request","HTTP_METHODS","GET","statusCode","trackEvent","body","errorData","message","String","createUserPreference","userPreferenceCreate","USER_PREFERENCE_CREATE_SUCCESS","USER_PREFERENCE_CREATE_FAILED","POST","updateUserPreference","USER_PREFERENCE_UPDATE_SUCCESS","USER_PREFERENCE_UPDATE_FAILED","PUT","deleteUserPreference","USER_PREFERENCE_DELETE_SUCCESS","USER_PREFERENCE_DELETE_FAILED","DELETE","exports","_default"],"sources":["UserPreference.ts"],"sourcesContent":["import {HTTP_METHODS, WebexSDK} from '../types';\nimport type {\n UserPreference as UserPreferenceResponse,\n CreateUserPreferenceRequest,\n UpdateUserPreferenceRequest,\n GetUserPreferenceParams,\n} from './config/types';\nimport LoggerProxy from '../logger-proxy';\nimport WebexRequest from './core/WebexRequest';\nimport MetricsManager from '../metrics/MetricsManager';\nimport {WCC_API_GATEWAY} from './constants';\nimport {endPointMap} from './config/constants';\nimport {METRIC_EVENT_NAMES} from '../metrics/constants';\n\n/**\n * UserPreference API class for managing Webex Contact Center user preferences.\n * Provides functionality to get, create, update, and delete user preferences.\n *\n * @class UserPreference\n * @public\n * @example\n * ```typescript\n * import Webex from 'webex';\n *\n * const webex = new Webex({ credentials: 'YOUR_ACCESS_TOKEN' });\n * const cc = webex.cc;\n *\n * // Register and login first\n * await cc.register();\n * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });\n *\n * // Get UserPreference API instance from ContactCenter\n * const userPreferenceAPI = cc.userPreference;\n *\n * // Get user preferences for the current user\n * const preferences = await userPreferenceAPI.getUserPreference();\n *\n * // Create new user preferences\n * const newPreferences = await userPreferenceAPI.createUserPreference({\n * userId: 'user123',\n * preferences: { e911Reminder: true }\n * });\n *\n * // Update user preferences\n * const updatedPreferences = await userPreferenceAPI.updateUserPreference('user123', {\n * preferences: { e911Reminder: false }\n * });\n *\n * // Delete user preferences\n * await userPreferenceAPI.deleteUserPreference('user123');\n * ```\n */\nexport class UserPreference {\n private webexRequest: WebexRequest;\n private webex: WebexSDK;\n private getUserId: () => string;\n private metricsManager: MetricsManager;\n\n /**\n * Creates an instance of UserPreference\n * @param {WebexSDK} webex - The Webex SDK instance\n * @param {() => string} getUserId - Function to get the current user's CI user ID\n * @public\n */\n constructor(webex: WebexSDK, getUserId: () => string) {\n this.webex = webex;\n this.webexRequest = WebexRequest.getInstance({webex});\n this.getUserId = getUserId;\n this.metricsManager = MetricsManager.getInstance({webex});\n }\n\n /**\n * Fetches user preferences for a specific user\n * @param {GetUserPreferenceParams} [params] - Optional parameters for fetching preferences\n * @param {string} [params.userId] - User ID to fetch preferences for. Defaults to current user's CI user ID.\n * @param {number} [params.page=0] - Page number (0-indexed). Default: 0\n * @param {number} [params.pageSize=100] - Number of items per page. Default: 100\n * @returns {Promise<UserPreferenceResponse>} Promise resolving to user preferences\n * @throws {Error} If the API call fails\n * @public\n * @example\n * ```typescript\n * // Get preferences for current user\n * const preferences = await userPreferenceAPI.getUserPreference();\n *\n * // Get preferences for a specific user\n * const preferences = await userPreferenceAPI.getUserPreference({ userId: 'user123' });\n *\n * // Get preferences with pagination\n * const preferences = await userPreferenceAPI.getUserPreference({ page: 0, pageSize: 50 });\n * ```\n */\n public async getUserPreference(\n params?: GetUserPreferenceParams\n ): Promise<UserPreferenceResponse> {\n const {userId, page, pageSize} = params || {};\n const targetUserId = userId || this.getUserId();\n const orgId = this.webex.credentials.getOrgId();\n\n LoggerProxy.info('Fetching user preferences', {\n module: 'UserPreference',\n method: 'getUserPreference',\n data: {\n orgId,\n userId: targetUserId,\n page,\n pageSize,\n },\n });\n\n if (!targetUserId) {\n LoggerProxy.error('getUserPreference called without a valid userId', {\n module: 'UserPreference',\n method: 'getUserPreference',\n data: {\n orgId,\n userId: targetUserId,\n error: 'Missing userId. Ensure user is logged in or provide a userId.',\n },\n });\n\n throw new Error('UserPreference: userId is not available.');\n }\n\n try {\n let resource = endPointMap.userPreference(orgId, targetUserId);\n\n // Build query parameters if provided\n const queryParams: string[] = [];\n if (page !== undefined) queryParams.push(`page=${page}`);\n if (pageSize !== undefined) queryParams.push(`pageSize=${pageSize}`);\n if (queryParams.length > 0) {\n resource = `${resource}?${queryParams.join('&')}`;\n }\n\n LoggerProxy.info('Making API request to fetch user preferences', {\n module: 'UserPreference',\n method: 'getUserPreference',\n data: {\n resource,\n service: WCC_API_GATEWAY,\n },\n });\n\n this.metricsManager.timeEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_GET_SUCCESS);\n this.metricsManager.timeEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_GET_FAILED);\n\n const response = await this.webexRequest.request({\n service: WCC_API_GATEWAY,\n resource,\n method: HTTP_METHODS.GET,\n });\n\n LoggerProxy.info('Successfully retrieved user preferences', {\n module: 'UserPreference',\n method: 'getUserPreference',\n data: {\n statusCode: response.statusCode,\n userId: targetUserId,\n },\n });\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.USER_PREFERENCE_GET_SUCCESS,\n {\n orgId,\n userId: targetUserId,\n statusCode: response.statusCode,\n },\n ['behavioral', 'operational']\n );\n\n return response.body;\n } catch (error) {\n const errorData = {\n orgId,\n userId: targetUserId,\n error: error instanceof Error ? error.message : String(error),\n };\n\n LoggerProxy.error('Failed to fetch user preferences', {\n module: 'UserPreference',\n method: 'getUserPreference',\n data: errorData,\n error,\n });\n\n this.metricsManager.trackEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_GET_FAILED, errorData, [\n 'behavioral',\n 'operational',\n ]);\n\n throw error;\n }\n }\n\n /**\n * Creates new user preferences\n * @param {CreateUserPreferenceRequest} data - The user preference data to create\n * @returns {Promise<UserPreference>} Promise resolving to created user preferences\n * @throws {Error} If the API call fails\n * @public\n * @example\n * ```typescript\n * const newPreferences = await userPreferenceAPI.createUserPreference({\n * userId: 'user123',\n * preferences: { e911Reminder: true, notificationSettings: { email: true } }\n * });\n * ```\n */\n public async createUserPreference(\n data: CreateUserPreferenceRequest\n ): Promise<UserPreferenceResponse> {\n const orgId = this.webex.credentials.getOrgId();\n\n LoggerProxy.info('Creating user preferences', {\n module: 'UserPreference',\n method: 'createUserPreference',\n data: {\n orgId,\n userId: data.userId,\n },\n });\n\n if (!data.userId) {\n LoggerProxy.error('createUserPreference called without a valid userId', {\n module: 'UserPreference',\n method: 'createUserPreference',\n data: {\n orgId,\n error: 'Missing userId in request data.',\n },\n });\n\n throw new Error('UserPreference: userId is required to create user preferences.');\n }\n\n try {\n const resource = endPointMap.userPreferenceCreate(orgId);\n\n LoggerProxy.info('Making API request to create user preferences', {\n module: 'UserPreference',\n method: 'createUserPreference',\n data: {\n resource,\n service: WCC_API_GATEWAY,\n },\n });\n\n this.metricsManager.timeEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_CREATE_SUCCESS);\n this.metricsManager.timeEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_CREATE_FAILED);\n\n const response = await this.webexRequest.request({\n service: WCC_API_GATEWAY,\n resource,\n method: HTTP_METHODS.POST,\n body: data,\n });\n\n LoggerProxy.info('Successfully created user preferences', {\n module: 'UserPreference',\n method: 'createUserPreference',\n data: {\n statusCode: response.statusCode,\n userId: data.userId,\n },\n });\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.USER_PREFERENCE_CREATE_SUCCESS,\n {\n orgId,\n userId: data.userId,\n statusCode: response.statusCode,\n },\n ['behavioral', 'operational']\n );\n\n return response.body;\n } catch (error) {\n const errorData = {\n orgId,\n userId: data.userId,\n error: error instanceof Error ? error.message : String(error),\n };\n\n LoggerProxy.error('Failed to create user preferences', {\n module: 'UserPreference',\n method: 'createUserPreference',\n data: errorData,\n error,\n });\n\n this.metricsManager.trackEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_CREATE_FAILED, errorData, [\n 'behavioral',\n 'operational',\n ]);\n\n throw error;\n }\n }\n\n /**\n * Updates existing user preferences\n * @param {string} userId - User ID to update preferences for\n * @param {UpdateUserPreferenceRequest} data - The user preference data to update\n * @returns {Promise<UserPreference>} Promise resolving to updated user preferences\n * @throws {Error} If the API call fails\n * @public\n * @example\n * ```typescript\n * const updatedPreferences = await userPreferenceAPI.updateUserPreference('user123', {\n * preferences: { e911Reminder: false }\n * });\n * ```\n */\n public async updateUserPreference(\n userId: string,\n data: UpdateUserPreferenceRequest\n ): Promise<UserPreferenceResponse> {\n const orgId = this.webex.credentials.getOrgId();\n\n LoggerProxy.info('Updating user preferences', {\n module: 'UserPreference',\n method: 'updateUserPreference',\n data: {\n orgId,\n userId,\n },\n });\n\n if (!userId) {\n LoggerProxy.error('updateUserPreference called without a valid userId', {\n module: 'UserPreference',\n method: 'updateUserPreference',\n data: {\n orgId,\n error: 'Missing userId parameter.',\n },\n });\n\n throw new Error('UserPreference: userId is required to update user preferences.');\n }\n\n try {\n const resource = endPointMap.userPreference(orgId, userId);\n\n LoggerProxy.info('Making API request to update user preferences', {\n module: 'UserPreference',\n method: 'updateUserPreference',\n data: {\n resource,\n service: WCC_API_GATEWAY,\n },\n });\n\n this.metricsManager.timeEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_UPDATE_SUCCESS);\n this.metricsManager.timeEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_UPDATE_FAILED);\n\n const response = await this.webexRequest.request({\n service: WCC_API_GATEWAY,\n resource,\n method: HTTP_METHODS.PUT,\n body: data,\n });\n\n LoggerProxy.info('Successfully updated user preferences', {\n module: 'UserPreference',\n method: 'updateUserPreference',\n data: {\n statusCode: response.statusCode,\n userId,\n },\n });\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.USER_PREFERENCE_UPDATE_SUCCESS,\n {\n orgId,\n userId,\n statusCode: response.statusCode,\n },\n ['behavioral', 'operational']\n );\n\n return response.body;\n } catch (error) {\n const errorData = {\n orgId,\n userId,\n error: error instanceof Error ? error.message : String(error),\n };\n\n LoggerProxy.error('Failed to update user preferences', {\n module: 'UserPreference',\n method: 'updateUserPreference',\n data: errorData,\n error,\n });\n\n this.metricsManager.trackEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_UPDATE_FAILED, errorData, [\n 'behavioral',\n 'operational',\n ]);\n\n throw error;\n }\n }\n\n /**\n * Deletes user preferences for a specific user\n * @param {string} userId - User ID to delete preferences for\n * @returns {Promise<void>} Promise resolving when deletion is complete\n * @throws {Error} If the API call fails\n * @public\n * @example\n * ```typescript\n * await userPreferenceAPI.deleteUserPreference('user123');\n * ```\n */\n public async deleteUserPreference(userId: string): Promise<void> {\n const orgId = this.webex.credentials.getOrgId();\n\n LoggerProxy.info('Deleting user preferences', {\n module: 'UserPreference',\n method: 'deleteUserPreference',\n data: {\n orgId,\n userId,\n },\n });\n\n if (!userId) {\n LoggerProxy.error('deleteUserPreference called without a valid userId', {\n module: 'UserPreference',\n method: 'deleteUserPreference',\n data: {\n orgId,\n error: 'Missing userId parameter.',\n },\n });\n\n throw new Error('UserPreference: userId is required to delete user preferences.');\n }\n\n try {\n const resource = endPointMap.userPreference(orgId, userId);\n\n LoggerProxy.info('Making API request to delete user preferences', {\n module: 'UserPreference',\n method: 'deleteUserPreference',\n data: {\n resource,\n service: WCC_API_GATEWAY,\n },\n });\n\n this.metricsManager.timeEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_DELETE_SUCCESS);\n this.metricsManager.timeEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_DELETE_FAILED);\n\n const response = await this.webexRequest.request({\n service: WCC_API_GATEWAY,\n resource,\n method: HTTP_METHODS.DELETE,\n });\n\n LoggerProxy.info('Successfully deleted user preferences', {\n module: 'UserPreference',\n method: 'deleteUserPreference',\n data: {\n statusCode: response.statusCode,\n userId,\n },\n });\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.USER_PREFERENCE_DELETE_SUCCESS,\n {\n orgId,\n userId,\n statusCode: response.statusCode,\n },\n ['behavioral', 'operational']\n );\n } catch (error) {\n const errorData = {\n orgId,\n userId,\n error: error instanceof Error ? error.message : String(error),\n };\n\n LoggerProxy.error('Failed to delete user preferences', {\n module: 'UserPreference',\n method: 'deleteUserPreference',\n data: errorData,\n error,\n });\n\n this.metricsManager.trackEvent(METRIC_EVENT_NAMES.USER_PREFERENCE_DELETE_FAILED, errorData, [\n 'behavioral',\n 'operational',\n ]);\n\n throw error;\n }\n }\n}\n\nexport default UserPreference;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,eAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAwD,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,cAAc,CAAC;EAM1B;AACF;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,KAAe,EAAEC,SAAuB,EAAE;IACpD,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACE,YAAY,GAAGC,qBAAY,CAACC,WAAW,CAAC;MAACJ;IAAK,CAAC,CAAC;IACrD,IAAI,CAACC,SAAS,GAAGA,SAAS;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AAsB;QAC9BC,IAAI,EAAE;UACJqB,UAAU,EAAEJ,QAAQ,CAACI,UAAU;UAC/BhC;QACF;MACF,CAAC,CAAC;MAEF,IAAI,CAACJ,cAAc,CAACqC,UAAU,CAC5BR,8BAAkB,CAACuB,8BAA8B,EACjD;QACE5C,KAAK;QACLJ,MAAM;QACNgC,UAAU,EAAEJ,QAAQ,CAACI;MACvB,CAAC,EACD,CAAC,YAAY,EAAE,aAAa,CAC9B,CAAC;IACH,CAAC,CAAC,OAAOpB,KAAK,EAAE;MACd,MAAMuB,SAAS,GAAG;QAChB/B,KAAK;QACLJ,MAAM;QACNY,KAAK,EAAEA,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACwB,OAAO,GAAGC,MAAM,CAACzB,KAAK;MAC9D,CAAC;MAEDL,oBAAW,CAACK,KAAK,CAAC,mCAAmC,EAAE;QACrDH,MAAM,EAAE,gBAAgB;QACxBC,MAAM,EAAE,sBAAsB;QAC9BC,IAAI,EAAEwB,SAAS;QACfvB;MACF,CAAC,CAAC;MAEF,IAAI,CAAChB,cAAc,CAACqC,UAAU,CAACR,8BAAkB,CAACwB,6BAA6B,EAAEd,SAAS,EAAE,CAC1F,YAAY,EACZ,aAAa,CACd,CAAC;MAEF,MAAMvB,KAAK;IACb;EACF;AACF;AAACuC,OAAA,CAAA9D,cAAA,GAAAA,cAAA;AAAA,IAAA+D,QAAA,GAAAD,OAAA,CAAA/D,OAAA,GAEcC,cAAc","ignoreList":[]}
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _loggerProxy = _interopRequireDefault(require("../logger-proxy"));
8
+ var _constants = require("../constants");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const WEBEX_CROSS_CLIENT_FILE = 'WebexCrossClientService';
11
+ const DEFAULT_CROSS_CLIENT_STATE_TTL = 900;
12
+ const EXPIRATION_OFFSET_MS = 60_000;
13
+ /** Must match Agent Desktop usersub publish — Webex App reads `wxcc` cross-client state. */
14
+ const DEFAULT_APP_NAME = 'wxcc';
15
+ const REFRESH_RETRY_DELAY_MS = 30_000;
16
+ const MAX_REFRESH_RETRIES = 3;
17
+ /**
18
+ * Publishes usersub cross-client state so Webex App suppresses native calling toasts (WXCC-6026).
19
+ */
20
+ class WebexCrossClientService {
21
+ answerCallsState = false;
22
+ appName = DEFAULT_APP_NAME;
23
+ /** Incremented on teardown/disable to ignore stale refresh timer callbacks. */
24
+ refreshGeneration = 0;
25
+ constructor(webex) {
26
+ this.webex = webex;
27
+ }
28
+ extractDeviceIdFromUrl(url) {
29
+ const match = url.match(/\/devices\/([^/?]+)/);
30
+ return match ? match[1] : '';
31
+ }
32
+ getDeviceUrl() {
33
+ return this.webex.internal.device?.url;
34
+ }
35
+ clearRefreshTimer() {
36
+ if (this.refreshTimer) {
37
+ clearTimeout(this.refreshTimer);
38
+ this.refreshTimer = undefined;
39
+ }
40
+ if (this.refreshRetryTimer) {
41
+ clearTimeout(this.refreshRetryTimer);
42
+ this.refreshRetryTimer = undefined;
43
+ }
44
+ }
45
+ scheduleRefreshRetry(userId, ttl, scheduledGeneration, retryAttempt) {
46
+ if (retryAttempt >= MAX_REFRESH_RETRIES || scheduledGeneration !== this.refreshGeneration || !this.answerCallsState) {
47
+ return;
48
+ }
49
+ this.refreshRetryTimer = setTimeout(async () => {
50
+ if (scheduledGeneration !== this.refreshGeneration || !this.answerCallsState) {
51
+ return;
52
+ }
53
+ try {
54
+ await this.setManageWebexCallingInWxcc(true, {
55
+ userId,
56
+ ttl,
57
+ appName: this.appName
58
+ });
59
+ } catch (error) {
60
+ _loggerProxy.default.error(`WebexCrossClientService refresh retry failed: ${error}`, {
61
+ module: WEBEX_CROSS_CLIENT_FILE,
62
+ method: _constants.METHODS.SET_MANAGE_WEBEX_CALLING_IN_WXCC
63
+ });
64
+ this.scheduleRefreshRetry(userId, ttl, scheduledGeneration, retryAttempt + 1);
65
+ }
66
+ }, REFRESH_RETRY_DELAY_MS);
67
+ }
68
+ startRefreshTimer(userId, ttl) {
69
+ this.clearRefreshTimer();
70
+ if (!this.answerCallsState) {
71
+ return;
72
+ }
73
+ const refreshTime = ttl * 1000 - EXPIRATION_OFFSET_MS;
74
+ const scheduledGeneration = this.refreshGeneration;
75
+ this.refreshTimer = setTimeout(async () => {
76
+ if (scheduledGeneration !== this.refreshGeneration || !this.answerCallsState) {
77
+ return;
78
+ }
79
+ try {
80
+ await this.setManageWebexCallingInWxcc(true, {
81
+ userId,
82
+ ttl,
83
+ appName: this.appName
84
+ });
85
+ } catch (error) {
86
+ _loggerProxy.default.error(`WebexCrossClientService refresh failed: ${error}`, {
87
+ module: WEBEX_CROSS_CLIENT_FILE,
88
+ method: _constants.METHODS.SET_MANAGE_WEBEX_CALLING_IN_WXCC
89
+ });
90
+ this.scheduleRefreshRetry(userId, ttl, scheduledGeneration, 0);
91
+ }
92
+ }, refreshTime);
93
+ }
94
+ publishCrossClientState(users, ttl, composition, logContext) {
95
+ const body = {
96
+ users,
97
+ compositions: [{
98
+ type: 'cross-client-state',
99
+ ttl,
100
+ composition
101
+ }]
102
+ };
103
+ return this.webex.request({
104
+ method: 'POST',
105
+ service: 'usersub',
106
+ resource: 'publish',
107
+ body
108
+ }).then(response => response?.body).catch(error => {
109
+ _loggerProxy.default.error(`WebexCrossClientService.${logContext} failed: ${error}`, {
110
+ module: WEBEX_CROSS_CLIENT_FILE,
111
+ method: _constants.METHODS.SET_MANAGE_WEBEX_CALLING_IN_WXCC
112
+ });
113
+ return Promise.reject(error);
114
+ });
115
+ }
116
+ async setManageWebexCallingInWxcc(enable, options) {
117
+ const operationGeneration = this.refreshGeneration;
118
+ const userId = options?.userId ?? this.webex.internal.device?.userId;
119
+ const ttl = options?.ttl ?? DEFAULT_CROSS_CLIENT_STATE_TTL;
120
+ const appName = options?.appName ?? DEFAULT_APP_NAME;
121
+ this.appName = appName;
122
+ if (!userId) {
123
+ throw new Error('User ID is unavailable for cross-client publish');
124
+ }
125
+ const deviceUrl = this.getDeviceUrl();
126
+ if (!deviceUrl) {
127
+ throw new Error('Device URL is unavailable for cross-client publish');
128
+ }
129
+ const composition = {
130
+ devices: [{
131
+ deviceId: this.extractDeviceIdFromUrl(deviceUrl),
132
+ appName,
133
+ state: {
134
+ 'answer-calls-on-wxcc': enable
135
+ }
136
+ }]
137
+ };
138
+ await this.publishCrossClientState([userId], ttl, composition, 'setManageWebexCallingInWxcc');
139
+ if (operationGeneration !== this.refreshGeneration) {
140
+ return;
141
+ }
142
+ this.answerCallsState = enable;
143
+ if (enable) {
144
+ this.startRefreshTimer(userId, ttl);
145
+ } else {
146
+ this.refreshGeneration += 1;
147
+ this.clearRefreshTimer();
148
+ }
149
+ _loggerProxy.default.info(`Cross-client answer-calls-on-wxcc set to ${enable}`, {
150
+ module: WEBEX_CROSS_CLIENT_FILE,
151
+ method: _constants.METHODS.SET_MANAGE_WEBEX_CALLING_IN_WXCC,
152
+ data: {
153
+ appName,
154
+ deviceId: this.extractDeviceIdFromUrl(deviceUrl),
155
+ ttl
156
+ }
157
+ });
158
+ }
159
+ teardown() {
160
+ this.refreshGeneration += 1;
161
+ this.clearRefreshTimer();
162
+ this.answerCallsState = false;
163
+ }
164
+
165
+ /** Whether usersub `answer-calls-on-wxcc: true` was successfully published this session. */
166
+ isAnswerCallsStateActive() {
167
+ return this.answerCallsState;
168
+ }
169
+ }
170
+ exports.default = WebexCrossClientService;
171
+ //# sourceMappingURL=WebexCrossClientService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_constants","e","__esModule","default","WEBEX_CROSS_CLIENT_FILE","DEFAULT_CROSS_CLIENT_STATE_TTL","EXPIRATION_OFFSET_MS","DEFAULT_APP_NAME","REFRESH_RETRY_DELAY_MS","MAX_REFRESH_RETRIES","WebexCrossClientService","answerCallsState","appName","refreshGeneration","constructor","webex","extractDeviceIdFromUrl","url","match","getDeviceUrl","internal","device","clearRefreshTimer","refreshTimer","clearTimeout","undefined","refreshRetryTimer","scheduleRefreshRetry","userId","ttl","scheduledGeneration","retryAttempt","setTimeout","setManageWebexCallingInWxcc","error","LoggerProxy","module","method","METHODS","SET_MANAGE_WEBEX_CALLING_IN_WXCC","startRefreshTimer","refreshTime","publishCrossClientState","users","composition","logContext","body","compositions","type","request","service","resource","then","response","catch","Promise","reject","enable","options","operationGeneration","Error","deviceUrl","devices","deviceId","state","info","data","teardown","isAnswerCallsStateActive","exports"],"sources":["WebexCrossClientService.ts"],"sourcesContent":["import LoggerProxy from '../logger-proxy';\nimport {METHODS} from '../constants';\nimport {WebexSDK} from '../types';\n\nconst WEBEX_CROSS_CLIENT_FILE = 'WebexCrossClientService';\nconst DEFAULT_CROSS_CLIENT_STATE_TTL = 900;\nconst EXPIRATION_OFFSET_MS = 60_000;\n/** Must match Agent Desktop usersub publish — Webex App reads `wxcc` cross-client state. */\nconst DEFAULT_APP_NAME = 'wxcc';\nconst REFRESH_RETRY_DELAY_MS = 30_000;\nconst MAX_REFRESH_RETRIES = 3;\n\ntype RefreshTimer = ReturnType<typeof setTimeout>;\n\n/**\n * Publishes usersub cross-client state so Webex App suppresses native calling toasts (WXCC-6026).\n */\nexport default class WebexCrossClientService {\n private webex: WebexSDK;\n private refreshTimer?: RefreshTimer;\n private refreshRetryTimer?: RefreshTimer;\n private answerCallsState = false;\n private appName = DEFAULT_APP_NAME;\n /** Incremented on teardown/disable to ignore stale refresh timer callbacks. */\n private refreshGeneration = 0;\n\n constructor(webex: WebexSDK) {\n this.webex = webex;\n }\n\n private extractDeviceIdFromUrl(url: string): string {\n const match = url.match(/\\/devices\\/([^/?]+)/);\n\n return match ? match[1] : '';\n }\n\n private getDeviceUrl(): string | undefined {\n return this.webex.internal.device?.url;\n }\n\n private clearRefreshTimer(): void {\n if (this.refreshTimer) {\n clearTimeout(this.refreshTimer);\n this.refreshTimer = undefined;\n }\n\n if (this.refreshRetryTimer) {\n clearTimeout(this.refreshRetryTimer);\n this.refreshRetryTimer = undefined;\n }\n }\n\n private scheduleRefreshRetry(\n userId: string,\n ttl: number,\n scheduledGeneration: number,\n retryAttempt: number\n ): void {\n if (\n retryAttempt >= MAX_REFRESH_RETRIES ||\n scheduledGeneration !== this.refreshGeneration ||\n !this.answerCallsState\n ) {\n return;\n }\n\n this.refreshRetryTimer = setTimeout(async () => {\n if (scheduledGeneration !== this.refreshGeneration || !this.answerCallsState) {\n return;\n }\n\n try {\n await this.setManageWebexCallingInWxcc(true, {userId, ttl, appName: this.appName});\n } catch (error) {\n LoggerProxy.error(`WebexCrossClientService refresh retry failed: ${error}`, {\n module: WEBEX_CROSS_CLIENT_FILE,\n method: METHODS.SET_MANAGE_WEBEX_CALLING_IN_WXCC,\n });\n this.scheduleRefreshRetry(userId, ttl, scheduledGeneration, retryAttempt + 1);\n }\n }, REFRESH_RETRY_DELAY_MS);\n }\n\n private startRefreshTimer(userId: string, ttl: number): void {\n this.clearRefreshTimer();\n\n if (!this.answerCallsState) {\n return;\n }\n\n const refreshTime = ttl * 1000 - EXPIRATION_OFFSET_MS;\n const scheduledGeneration = this.refreshGeneration;\n this.refreshTimer = setTimeout(async () => {\n if (scheduledGeneration !== this.refreshGeneration || !this.answerCallsState) {\n return;\n }\n\n try {\n await this.setManageWebexCallingInWxcc(true, {userId, ttl, appName: this.appName});\n } catch (error) {\n LoggerProxy.error(`WebexCrossClientService refresh failed: ${error}`, {\n module: WEBEX_CROSS_CLIENT_FILE,\n method: METHODS.SET_MANAGE_WEBEX_CALLING_IN_WXCC,\n });\n this.scheduleRefreshRetry(userId, ttl, scheduledGeneration, 0);\n }\n }, refreshTime);\n }\n\n private publishCrossClientState(\n users: string[],\n ttl: number,\n composition: Record<string, unknown>,\n logContext: string\n ): Promise<unknown> {\n const body = {\n users,\n compositions: [\n {\n type: 'cross-client-state',\n ttl,\n composition,\n },\n ],\n };\n\n return this.webex\n .request({\n method: 'POST',\n service: 'usersub',\n resource: 'publish',\n body,\n })\n .then((response: {body?: unknown}) => response?.body)\n .catch((error: unknown) => {\n LoggerProxy.error(`WebexCrossClientService.${logContext} failed: ${error}`, {\n module: WEBEX_CROSS_CLIENT_FILE,\n method: METHODS.SET_MANAGE_WEBEX_CALLING_IN_WXCC,\n });\n\n return Promise.reject(error);\n });\n }\n\n public async setManageWebexCallingInWxcc(\n enable: boolean,\n options?: {userId?: string; ttl?: number; appName?: string}\n ): Promise<void> {\n const operationGeneration = this.refreshGeneration;\n const userId = options?.userId ?? this.webex.internal.device?.userId;\n const ttl = options?.ttl ?? DEFAULT_CROSS_CLIENT_STATE_TTL;\n const appName = options?.appName ?? DEFAULT_APP_NAME;\n this.appName = appName;\n\n if (!userId) {\n throw new Error('User ID is unavailable for cross-client publish');\n }\n\n const deviceUrl = this.getDeviceUrl();\n if (!deviceUrl) {\n throw new Error('Device URL is unavailable for cross-client publish');\n }\n\n const composition = {\n devices: [\n {\n deviceId: this.extractDeviceIdFromUrl(deviceUrl),\n appName,\n state: {\n 'answer-calls-on-wxcc': enable,\n },\n },\n ],\n };\n\n await this.publishCrossClientState([userId], ttl, composition, 'setManageWebexCallingInWxcc');\n\n if (operationGeneration !== this.refreshGeneration) {\n return;\n }\n\n this.answerCallsState = enable;\n\n if (enable) {\n this.startRefreshTimer(userId, ttl);\n } else {\n this.refreshGeneration += 1;\n this.clearRefreshTimer();\n }\n\n LoggerProxy.info(`Cross-client answer-calls-on-wxcc set to ${enable}`, {\n module: WEBEX_CROSS_CLIENT_FILE,\n method: METHODS.SET_MANAGE_WEBEX_CALLING_IN_WXCC,\n data: {\n appName,\n deviceId: this.extractDeviceIdFromUrl(deviceUrl),\n ttl,\n },\n });\n }\n\n public teardown(): void {\n this.refreshGeneration += 1;\n this.clearRefreshTimer();\n this.answerCallsState = false;\n }\n\n /** Whether usersub `answer-calls-on-wxcc: true` was successfully published this session. */\n public isAnswerCallsStateActive(): boolean {\n return this.answerCallsState;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA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EAAE,IAAI,CAAC/C,sBAAsB,CAAC6C,SAAS,CAAC;QAChDhC;MACF;IACF,CAAC,CAAC;EACJ;EAEOsC,QAAQA,CAAA,EAAS;IACtB,IAAI,CAACtD,iBAAiB,IAAI,CAAC;IAC3B,IAAI,CAACS,iBAAiB,CAAC,CAAC;IACxB,IAAI,CAACX,gBAAgB,GAAG,KAAK;EAC/B;;EAEA;EACOyD,wBAAwBA,CAAA,EAAY;IACzC,OAAO,IAAI,CAACzD,gBAAgB;EAC9B;AACF;AAAC0D,OAAA,CAAAlE,OAAA,GAAAO,uBAAA","ignoreList":[]}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.TELEPHONY_CALL_UNMUTED = exports.TELEPHONY_CALL_MUTED = void 0;
7
+ var _loggerProxy = _interopRequireDefault(require("../logger-proxy"));
8
+ var _constants = require("../constants");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const WXAPP_TELEPHONY_MERCURY_SYNC_FILE = 'WxAppTelephonyMercurySync';
11
+ const TELEPHONY_CALL_MUTED = exports.TELEPHONY_CALL_MUTED = 'event:telephony_calls.muted';
12
+ const TELEPHONY_CALL_UNMUTED = exports.TELEPHONY_CALL_UNMUTED = 'event:telephony_calls.unmuted';
13
+ /**
14
+ * Subscribes to Mercury telephony mute/unmute events for wxApp thick-client sync (AD parity).
15
+ */
16
+ class WxAppTelephonyMercurySync {
17
+ constructor(webex) {
18
+ this.webex = webex;
19
+ }
20
+ decodeBase64(value) {
21
+ try {
22
+ return atob(value);
23
+ } catch {
24
+ return value;
25
+ }
26
+ }
27
+ handleMuteStateEvent = (agentId, event) => {
28
+ const {
29
+ actorId,
30
+ callId,
31
+ muted
32
+ } = event?.data ?? {};
33
+ if (!actorId || !callId || muted === undefined) {
34
+ return;
35
+ }
36
+ const decodedActorId = this.decodeBase64(actorId);
37
+ const decodedCallId = this.decodeBase64(callId);
38
+ if (!decodedActorId.endsWith(agentId)) {
39
+ return;
40
+ }
41
+ _loggerProxy.default.info('WxApp telephony mute state sync received', {
42
+ module: WXAPP_TELEPHONY_MERCURY_SYNC_FILE,
43
+ method: _constants.METHODS.SYNC_WXAPP_MUTE_FROM_MERCURY,
44
+ data: {
45
+ muted
46
+ }
47
+ });
48
+ this.muteChangeHandler?.(decodedCallId, muted);
49
+ };
50
+ subscribe(agentId, onMuteChange) {
51
+ this.unsubscribe();
52
+ const mercury = this.webex.internal.mercury;
53
+ if (!mercury) {
54
+ _loggerProxy.default.error('Mercury is unavailable for wxApp mute sync', {
55
+ module: WXAPP_TELEPHONY_MERCURY_SYNC_FILE,
56
+ method: _constants.METHODS.SYNC_WXAPP_MUTE_FROM_MERCURY
57
+ });
58
+ return;
59
+ }
60
+ this.subscribedAgentId = agentId;
61
+ this.muteChangeHandler = onMuteChange;
62
+ this.boundMuteHandler = event => {
63
+ this.handleMuteStateEvent(agentId, event);
64
+ };
65
+ this.boundUnmuteHandler = event => {
66
+ this.handleMuteStateEvent(agentId, event);
67
+ };
68
+ mercury.on(TELEPHONY_CALL_MUTED, this.boundMuteHandler);
69
+ mercury.on(TELEPHONY_CALL_UNMUTED, this.boundUnmuteHandler);
70
+ _loggerProxy.default.info('Subscribed to wxApp telephony Mercury mute sync', {
71
+ module: WXAPP_TELEPHONY_MERCURY_SYNC_FILE,
72
+ method: _constants.METHODS.SYNC_WXAPP_MUTE_FROM_MERCURY
73
+ });
74
+ }
75
+ unsubscribe() {
76
+ const mercury = this.webex.internal.mercury;
77
+ if (mercury && this.boundMuteHandler) {
78
+ mercury.off(TELEPHONY_CALL_MUTED, this.boundMuteHandler);
79
+ }
80
+ if (mercury && this.boundUnmuteHandler) {
81
+ mercury.off(TELEPHONY_CALL_UNMUTED, this.boundUnmuteHandler);
82
+ }
83
+ this.subscribedAgentId = undefined;
84
+ this.muteChangeHandler = undefined;
85
+ this.boundMuteHandler = undefined;
86
+ this.boundUnmuteHandler = undefined;
87
+ }
88
+ isSubscribed() {
89
+ return Boolean(this.subscribedAgentId && this.muteChangeHandler);
90
+ }
91
+ }
92
+ exports.default = WxAppTelephonyMercurySync;
93
+ //# sourceMappingURL=WxAppTelephonyMercurySync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_constants","e","__esModule","default","WXAPP_TELEPHONY_MERCURY_SYNC_FILE","TELEPHONY_CALL_MUTED","exports","TELEPHONY_CALL_UNMUTED","WxAppTelephonyMercurySync","constructor","webex","decodeBase64","value","atob","handleMuteStateEvent","agentId","event","actorId","callId","muted","data","undefined","decodedActorId","decodedCallId","endsWith","LoggerProxy","info","module","method","METHODS","SYNC_WXAPP_MUTE_FROM_MERCURY","muteChangeHandler","subscribe","onMuteChange","unsubscribe","mercury","internal","error","subscribedAgentId","boundMuteHandler","boundUnmuteHandler","on","off","isSubscribed","Boolean"],"sources":["WxAppTelephonyMercurySync.ts"],"sourcesContent":["import LoggerProxy from '../logger-proxy';\nimport {METHODS} from '../constants';\nimport {WebexSDK} from '../types';\n\nconst WXAPP_TELEPHONY_MERCURY_SYNC_FILE = 'WxAppTelephonyMercurySync';\n\nexport const TELEPHONY_CALL_MUTED = 'event:telephony_calls.muted';\nexport const TELEPHONY_CALL_UNMUTED = 'event:telephony_calls.unmuted';\n\nexport type UpdatedCallMuteStateEvent = {\n data: {\n actorId: string;\n callId: string;\n muted: boolean;\n };\n};\n\ntype MuteChangeHandler = (callId: string, muted: boolean) => void;\n\n/**\n * Subscribes to Mercury telephony mute/unmute events for wxApp thick-client sync (AD parity).\n */\nexport default class WxAppTelephonyMercurySync {\n private webex: WebexSDK;\n private subscribedAgentId?: string;\n private muteChangeHandler?: MuteChangeHandler;\n private boundMuteHandler?: (event: UpdatedCallMuteStateEvent) => void;\n private boundUnmuteHandler?: (event: UpdatedCallMuteStateEvent) => void;\n\n constructor(webex: WebexSDK) {\n this.webex = webex;\n }\n\n private decodeBase64(value: string): string {\n try {\n return atob(value);\n } catch {\n return value;\n }\n }\n\n private handleMuteStateEvent = (agentId: string, event: UpdatedCallMuteStateEvent): void => {\n const {actorId, callId, muted} = event?.data ?? {};\n if (!actorId || !callId || muted === undefined) {\n return;\n }\n\n const decodedActorId = this.decodeBase64(actorId);\n const decodedCallId = this.decodeBase64(callId);\n\n if (!decodedActorId.endsWith(agentId)) {\n return;\n }\n\n LoggerProxy.info('WxApp telephony mute state sync received', {\n module: WXAPP_TELEPHONY_MERCURY_SYNC_FILE,\n method: METHODS.SYNC_WXAPP_MUTE_FROM_MERCURY,\n data: {muted},\n });\n\n this.muteChangeHandler?.(decodedCallId, muted);\n };\n\n public subscribe(agentId: string, onMuteChange: MuteChangeHandler): void {\n this.unsubscribe();\n\n const mercury = this.webex.internal.mercury;\n if (!mercury) {\n LoggerProxy.error('Mercury is unavailable for wxApp mute sync', {\n module: WXAPP_TELEPHONY_MERCURY_SYNC_FILE,\n method: METHODS.SYNC_WXAPP_MUTE_FROM_MERCURY,\n });\n\n return;\n }\n\n this.subscribedAgentId = agentId;\n this.muteChangeHandler = onMuteChange;\n\n this.boundMuteHandler = (event: UpdatedCallMuteStateEvent) => {\n this.handleMuteStateEvent(agentId, event);\n };\n this.boundUnmuteHandler = (event: UpdatedCallMuteStateEvent) => {\n this.handleMuteStateEvent(agentId, event);\n };\n\n mercury.on(TELEPHONY_CALL_MUTED, this.boundMuteHandler);\n mercury.on(TELEPHONY_CALL_UNMUTED, this.boundUnmuteHandler);\n\n LoggerProxy.info('Subscribed to wxApp telephony Mercury mute sync', {\n module: WXAPP_TELEPHONY_MERCURY_SYNC_FILE,\n method: METHODS.SYNC_WXAPP_MUTE_FROM_MERCURY,\n });\n }\n\n public unsubscribe(): void {\n const mercury = this.webex.internal.mercury;\n\n if (mercury && this.boundMuteHandler) {\n mercury.off(TELEPHONY_CALL_MUTED, this.boundMuteHandler);\n }\n if (mercury && this.boundUnmuteHandler) {\n mercury.off(TELEPHONY_CALL_UNMUTED, this.boundUnmuteHandler);\n }\n\n this.subscribedAgentId = undefined;\n this.muteChangeHandler = undefined;\n this.boundMuteHandler = undefined;\n this.boundUnmuteHandler = undefined;\n }\n\n public isSubscribed(): boolean {\n return Boolean(this.subscribedAgentId && this.muteChangeHandler);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAqC,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGrC,MAAMG,iCAAiC,GAAG,2BAA2B;AAE9D,MAAMC,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,6BAA6B;AAC1D,MAAME,sBAAsB,GAAAD,OAAA,CAAAC,sBAAA,GAAG,+BAA+B;AAYrE;AACA;AACA;AACe,MAAMC,yBAAyB,CAAC;EAO7CC,WAAWA,CAACC,KAAe,EAAE;IAC3B,IAAI,CAACA,KAAK,GAAGA,KAAK;EACpB;EAEQC,YAAYA,CAACC,KAAa,EAAU;IAC1C,IAAI;MACF,OAAOC,IAAI,CAACD,KAAK,CAAC;IACpB,CAAC,CAAC,MAAM;MACN,OAAOA,KAAK;IACd;EACF;EAEQE,oBAAoB,GAAGA,CAACC,OAAe,EAAEC,KAAgC,KAAW;IAC1F,MAAM;MAACC,OAAO;MAAEC,MAAM;MAAEC;IAAK,CAAC,GAAGH,KAAK,EAAEI,IAAI,IAAI,CAAC,CAAC;IAClD,IAAI,CAACH,OAAO,IAAI,CAACC,MAAM,IAAIC,KAAK,KAAKE,SAAS,EAAE;MAC9C;IACF;IAEA,MAAMC,cAAc,GAAG,IAAI,CAACX,YAAY,CAACM,OAAO,CAAC;IACjD,MAAMM,aAAa,GAAG,IAAI,CAACZ,YAAY,CAACO,MAAM,CAAC;IAE/C,IAAI,CAACI,cAAc,CAACE,QAAQ,CAACT,OAAO,CAAC,EAAE;MACrC;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AO,GAAG,IAAI,CAACzB,KAAK,CAAC0B,QAAQ,CAACD,OAAO;IAE3C,IAAIA,OAAO,IAAI,IAAI,CAACI,gBAAgB,EAAE;MACpCJ,OAAO,CAACO,GAAG,CAACrC,oBAAoB,EAAE,IAAI,CAACkC,gBAAgB,CAAC;IAC1D;IACA,IAAIJ,OAAO,IAAI,IAAI,CAACK,kBAAkB,EAAE;MACtCL,OAAO,CAACO,GAAG,CAACnC,sBAAsB,EAAE,IAAI,CAACiC,kBAAkB,CAAC;IAC9D;IAEA,IAAI,CAACF,iBAAiB,GAAGjB,SAAS;IAClC,IAAI,CAACU,iBAAiB,GAAGV,SAAS;IAClC,IAAI,CAACkB,gBAAgB,GAAGlB,SAAS;IACjC,IAAI,CAACmB,kBAAkB,GAAGnB,SAAS;EACrC;EAEOsB,YAAYA,CAAA,EAAY;IAC7B,OAAOC,OAAO,CAAC,IAAI,CAACN,iBAAiB,IAAI,IAAI,CAACP,iBAAiB,CAAC;EAClE;AACF;AAACzB,OAAA,CAAAH,OAAA,GAAAK,yBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["AGENT_EVENTS","exports"],"sources":["types.ts"],"sourcesContent":["import {Msg} from '../core/GlobalTypes';\n\n/**\n * Response type received when an agent successfully logs out from the system\n * @public\n * @remarks\n * This type represents the response message sent by the server when an agent\n * successfully logs out. It includes essential details about the logout action\n * and the agent's final state.\n */\nexport type LogoutSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the logout request */\n trackingId: string;\n /** Current session ID of the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** Current status of the agent (e.g., 'LoggedOut') */\n status: string;\n /** Detailed status information */\n subStatus: string;\n /** Identity of who initiated the logout if not the agent themselves */\n loggedOutBy?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Type identifier for logout success event */\n type: 'AgentLogoutSuccess';\n}>;\n\n/**\n * Response type received when an agent successfully relogins to the system\n * @public\n * @remarks\n * Represents the response message when an agent successfully re-authenticates.\n * Contains comprehensive information about the agent's new session, including\n * their state, assigned channels, and device information.\n */\nexport type ReloginSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the relogin request */\n trackingId: string;\n /** Auxiliary code ID for the agent's initial state */\n auxCodeId: string;\n /** ID of the team the agent belongs to */\n teamId: string;\n /** New session ID assigned to the agent */\n agentSessionId: string;\n /** Directory number assigned to the agent */\n dn: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** List of active interaction IDs */\n interactionIds: string[];\n /** Indicates if login is via extension */\n isExtension: boolean;\n /** Current login status */\n status: 'LoggedIn';\n /** Current sub-status */\n subStatus: 'Idle';\n /** ID of the site where the agent is located */\n siteId: string;\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of last state change */\n lastStateChangeTimestamp: number;\n /** Reason for the last state change */\n lastStateChangeReason?: string;\n /** Type of agent profile */\n profileType: string;\n /** Map of channel types to channel IDs */\n channelsMap: Record<string, string[]>;\n /** Phone number for dialing */\n dialNumber?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Type of device being used */\n deviceType?: DeviceType;\n /** Unique identifier of the device */\n deviceId?: string | null;\n /** Flag indicating if emergency modal was shown */\n isEmergencyModalAlreadyDisplayed?: boolean;\n /** Type identifier for relogin success event */\n type: 'AgentReloginSuccess';\n}>;\n\n/**\n * Response type received when an agent's state is successfully changed\n * @public\n * @remarks\n * Contains information about the agent's new state, including who initiated\n * the change and timestamps for tracking state transitions.\n */\nexport type StateChangeSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the state change request */\n trackingId: string;\n /** Auxiliary code ID associated with the new state */\n auxCodeId: string;\n /** Current session ID of the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** Current status of the agent */\n status: string;\n /** Detailed status indicating availability */\n subStatus: 'Available' | 'Idle';\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of current state change */\n lastStateChangeTimestamp: number;\n /** Type identifier for state change success event */\n type: 'AgentStateChangeSuccess';\n /** Identity of who initiated the state change */\n changedBy: string | null;\n /** ID of the user who initiated the change */\n changedById: string | null;\n /** Name of the user who initiated the change */\n changedByName: string | null;\n /** Reason for the state change */\n lastStateChangeReason: string;\n}>;\n\n/**\n * Response type received when an agent successfully logs into their station\n * @public\n * @remarks\n * Represents the success response when an agent logs into their workstation.\n * Includes details about the agent's initial state, assigned teams, and channels.\n */\nexport type StationLoginSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the station login request */\n trackingId: string;\n /** Auxiliary code ID for initial state */\n auxCodeId: string;\n /** ID of the team the agent belongs to */\n teamId: string;\n /** New session ID assigned to the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** List of active interaction IDs */\n interactionIds: string[];\n /** Current login status */\n status: string;\n /** Current availability status */\n subStatus: 'Available' | 'Idle';\n /** ID of the site where the agent is located */\n siteId: string;\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of last state change */\n lastStateChangeTimestamp: number;\n /** Type of agent profile */\n profileType: string;\n /** Map of channel types to channel IDs */\n channelsMap: Record<string, string[]>;\n /** Phone number for dialing */\n dialNumber?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Session ID of the supervising agent if applicable */\n supervisorSessionId?: string;\n /** Type identifier for station login success event */\n type: 'AgentStationLoginSuccess';\n}>;\n\n/**\n * Extended response type for station login success that includes notification tracking\n * @public\n * @remarks\n * Similar to StationLoginSuccess but includes additional fields for notification\n * tracking and multimedia profile settings.\n */\nexport type StationLoginSuccessResponse = {\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the station login request */\n trackingId: string;\n /** Auxiliary code ID for initial state */\n auxCodeId: string;\n /** ID of the team the agent belongs to */\n teamId: string;\n /** New session ID assigned to the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** List of active interaction IDs */\n interactionIds: string[];\n /** Current login status */\n status: string;\n /** Current availability status */\n subStatus: 'Available' | 'Idle';\n /** ID of the site where the agent is located */\n siteId: string;\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of last state change */\n lastStateChangeTimestamp: number;\n /** Type of agent profile */\n profileType: string;\n /** Multimedia profile capacity settings */\n mmProfile: {\n /** Maximum concurrent chat capacity */\n chat: number;\n /** Maximum concurrent email capacity */\n email: number;\n /** Maximum concurrent social media capacity */\n social: number;\n /** Maximum concurrent voice call capacity */\n telephony: number;\n };\n /** Phone number for dialing */\n dialNumber?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Session ID of the supervising agent if applicable */\n supervisorSessionId?: string;\n /** Type identifier for station login success event */\n type: 'AgentStationLoginSuccess';\n /** Tracking ID for notifications */\n notifsTrackingId: string;\n};\n\n/**\n * Extended response type for agent device type update success\n * @public\n * @remarks\n * Represents the response when an agent's device type is successfully updated.\n * Contains all the details of the agent's session and device configuration.\n */\nexport type DeviceTypeUpdateSuccess = Omit<StationLoginSuccessResponse, 'type'> & {\n type: 'AgentDeviceTypeUpdateSuccess';\n};\n/**\n * Parameters required for initiating an agent logout\n * @public\n * @remarks\n * Defines the parameters that can be provided when logging out an agent,\n * including the reason for logout which helps with reporting and auditing.\n */\nexport type Logout = {\n /** Reason for the logout action */\n logoutReason?:\n | 'User requested logout'\n | 'Inactivity Logout'\n | 'User requested agent device change';\n};\n\n/**\n * Represents the possible states an agent can be in\n * @public\n * @remarks\n * Defines the various states an agent can transition between during their session.\n * Common states include 'Available' (ready to handle interactions), 'Idle' (on break\n * or not ready), and 'RONA' (Response on No Answer).\n */\nexport type AgentState = 'Available' | 'Idle' | 'RONA' | string;\n\n/**\n * Parameters required for changing an agent's state\n * @public\n * @remarks\n * Defines the necessary information for transitioning an agent from one state to another.\n */\nexport type StateChange = {\n /** New state to transition the agent to */\n state: AgentState;\n /** Auxiliary code ID associated with the state change */\n auxCodeId: string;\n /** Reason for the state change */\n lastStateChangeReason?: string;\n /** ID of the agent whose state is being changed */\n agentId?: string;\n};\n\n/**\n * Parameters required for agent station login\n * @public\n * @remarks\n * Contains all the necessary information for logging an agent into their workstation,\n * including team assignments, roles, and device configurations.\n */\nexport type UserStationLogin = {\n /** Phone number for dialing */\n dialNumber?: string | null;\n /** Directory number */\n dn?: string | null;\n /** ID of the team the agent belongs to */\n teamId: string | null;\n /** Name of the team */\n teamName: string | null;\n /** List of roles assigned to the agent */\n roles?: Array<string>;\n /** ID of the site where the agent is located */\n siteId: string;\n /** Indicates if agent uses a different DN than their assigned one */\n usesOtherDN: boolean;\n /** ID of the agent's skill profile */\n skillProfileId?: string;\n /** ID of the initial auxiliary state code */\n auxCodeId: string;\n /** Indicates if login is via extension */\n isExtension?: boolean;\n /** Type of device being used */\n deviceType?: DeviceType;\n /** Unique identifier of the device */\n deviceId?: string | null;\n /** Flag indicating if emergency modal was shown */\n isEmergencyModalAlreadyDisplayed?: boolean;\n};\n\n/**\n * Available options for agent login methods\n * @public\n * @remarks\n * Defines the supported methods for agent login:\n * - AGENT_DN: Login using agent's direct number\n * - EXTENSION: Login using extension number\n * - BROWSER: Browser-based login\n */\nexport type LoginOption = 'AGENT_DN' | 'EXTENSION' | 'BROWSER';\n\n/**\n * Type of device used for agent login\n * @public\n * @remarks\n * Represents the type of device being used for login. Can be one of the standard\n * LoginOptions or a custom device type string.\n */\nexport type DeviceType = LoginOption | string;\n\n/**\n * Parameters for retrieving buddy agent information\n * @public\n * @remarks\n * Defines the criteria for fetching information about other agents (buddies)\n * in the system, allowing filtering by profile, media type, and state.\n */\nexport type BuddyAgents = {\n agentProfileId: string;\n mediaType: string;\n /** Filter for agent state eg : Available | Idle */\n state?: string;\n};\n\n/**\n * Detailed information about a buddy agent\n * @public\n * @remarks\n * Contains comprehensive information about a buddy agent including their\n * current state, assignments, and contact information.\n */\nexport type BuddyDetails = {\n agentId: string;\n state: string;\n teamId: string;\n dn: string;\n agentName: string;\n siteId: string;\n};\n\n/**\n * Response type received when successfully retrieving buddy agent information\n * @public\n * @remarks\n * Contains the list of buddy agents and their details returned from a buddy\n * agent lookup request. Used for monitoring team member statuses and availability.\n */\nexport type BuddyAgentsSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the requesting agent */\n agentId: string;\n /** Tracking ID for the buddy list request */\n trackingId: string;\n /** Current session ID of the requesting agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** Type identifier for buddy agents response */\n type: 'BuddyAgents';\n /** List of buddy agents and their details */\n agentList: Array<BuddyDetails>;\n}>;\n\n/**\n * Events emitted by the agent service for various state changes and actions\n * @public\n * @remarks\n * Enumeration of all possible events that can be emitted by the agent service.\n * These events can be used to track and respond to changes in agent state,\n * login status, and other important agent-related activities.\n */\nexport enum AGENT_EVENTS {\n /** Emitted when an agent's state changes (e.g., Available to Idle) */\n AGENT_STATE_CHANGE = 'agent:stateChange',\n\n /** Emitted when multiple logins are detected for the same agent */\n AGENT_MULTI_LOGIN = 'agent:multiLogin',\n\n /** Emitted when an agent successfully logs into their station */\n AGENT_STATION_LOGIN_SUCCESS = 'agent:stationLoginSuccess',\n\n /** Emitted when station login attempt fails */\n AGENT_STATION_LOGIN_FAILED = 'agent:stationLoginFailed',\n\n /** Emitted when an agent successfully logs out */\n AGENT_LOGOUT_SUCCESS = 'agent:logoutSuccess',\n\n /** Emitted when logout attempt fails */\n AGENT_LOGOUT_FAILED = 'agent:logoutFailed',\n\n /** Emitted when an agent's directory number is successfully registered */\n AGENT_DN_REGISTERED = 'agent:dnRegistered',\n\n /** Emitted when an agent successfully re-authenticates */\n AGENT_RELOGIN_SUCCESS = 'agent:reloginSuccess',\n\n /** Emitted when agent state change is successful */\n AGENT_STATE_CHANGE_SUCCESS = 'agent:stateChangeSuccess',\n\n /** Emitted when agent state change attempt fails */\n AGENT_STATE_CHANGE_FAILED = 'agent:stateChangeFailed',\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAoDA;AACA;AACA;AACA;AACA;AACA;AACA;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AA0CA;AACA;AACA;AACA;AACA;AACA;AACA;AAqDA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AA8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EACtB;EADUA,YAAY;EAItB;EAJUA,YAAY;EAOtB;EAPUA,YAAY;EAUtB;EAVUA,YAAY;EAatB;EAbUA,YAAY;EAgBtB;EAhBUA,YAAY;EAmBtB;EAnBUA,YAAY;EAsBtB;EAtBUA,YAAY;EAyBtB;EAzBUA,YAAY;EA4BtB;EA5BUA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["AGENT_EVENTS","exports"],"sources":["types.ts"],"sourcesContent":["import {Msg} from '../core/GlobalTypes';\n\n/**\n * Response type received when an agent successfully logs out from the system\n * @public\n * @remarks\n * This type represents the response message sent by the server when an agent\n * successfully logs out. It includes essential details about the logout action\n * and the agent's final state.\n */\nexport type LogoutSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the logout request */\n trackingId: string;\n /** Current session ID of the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** Current status of the agent (e.g., 'LoggedOut') */\n status: string;\n /** Detailed status information */\n subStatus: string;\n /** Identity of who initiated the logout if not the agent themselves */\n loggedOutBy?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Type identifier for logout success event */\n type: 'AgentLogoutSuccess';\n}>;\n\n/**\n * Response type received when an agent successfully relogins to the system\n * @public\n * @remarks\n * Represents the response message when an agent successfully re-authenticates.\n * Contains comprehensive information about the agent's new session, including\n * their state, assigned channels, and device information.\n */\nexport type ReloginSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the relogin request */\n trackingId: string;\n /** Auxiliary code ID for the agent's initial state */\n auxCodeId: string;\n /** ID of the team the agent belongs to */\n teamId: string;\n /** New session ID assigned to the agent */\n agentSessionId: string;\n /** Directory number assigned to the agent */\n dn: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** List of active interaction IDs */\n interactionIds: string[];\n /** Indicates if login is via extension */\n isExtension: boolean;\n /** Current login status */\n status: 'LoggedIn';\n /** Current sub-status */\n subStatus: 'Idle';\n /** ID of the site where the agent is located */\n siteId: string;\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of last state change */\n lastStateChangeTimestamp: number;\n /** Reason for the last state change */\n lastStateChangeReason?: string;\n /** Type of agent profile */\n profileType: string;\n /** Map of channel types to channel IDs */\n channelsMap: Record<string, string[]>;\n /** Phone number for dialing */\n dialNumber?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Type of device being used */\n deviceType?: DeviceType;\n /** Unique identifier of the device */\n deviceId?: string | null;\n /** Flag indicating if emergency modal was shown */\n isEmergencyModalAlreadyDisplayed?: boolean;\n /** Type identifier for relogin success event */\n type: 'AgentReloginSuccess';\n}>;\n\n/**\n * Response type received when an agent's state is successfully changed\n * @public\n * @remarks\n * Contains information about the agent's new state, including who initiated\n * the change and timestamps for tracking state transitions.\n */\nexport type StateChangeSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the state change request */\n trackingId: string;\n /** Auxiliary code ID associated with the new state */\n auxCodeId: string;\n /** Current session ID of the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** Current status of the agent */\n status: string;\n /** Detailed status indicating availability */\n subStatus: 'Available' | 'Idle';\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of current state change */\n lastStateChangeTimestamp: number;\n /** Type identifier for state change success event */\n type: 'AgentStateChangeSuccess';\n /** Identity of who initiated the state change */\n changedBy: string | null;\n /** ID of the user who initiated the change */\n changedById: string | null;\n /** Name of the user who initiated the change */\n changedByName: string | null;\n /** Reason for the state change */\n lastStateChangeReason: string;\n}>;\n\n/**\n * Response type received when an agent successfully logs into their station\n * @public\n * @remarks\n * Represents the success response when an agent logs into their workstation.\n * Includes details about the agent's initial state, assigned teams, and channels.\n */\nexport type StationLoginSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the station login request */\n trackingId: string;\n /** Auxiliary code ID for initial state */\n auxCodeId: string;\n /** ID of the team the agent belongs to */\n teamId: string;\n /** New session ID assigned to the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** List of active interaction IDs */\n interactionIds: string[];\n /** Current login status */\n status: string;\n /** Current availability status */\n subStatus: 'Available' | 'Idle';\n /** ID of the site where the agent is located */\n siteId: string;\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of last state change */\n lastStateChangeTimestamp: number;\n /** Type of agent profile */\n profileType: string;\n /** Map of channel types to channel IDs */\n channelsMap: Record<string, string[]>;\n /** Phone number for dialing */\n dialNumber?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Session ID of the supervising agent if applicable */\n supervisorSessionId?: string;\n /** Type identifier for station login success event */\n type: 'AgentStationLoginSuccess';\n}>;\n\n/**\n * Extended response type for station login success that includes notification tracking\n * @public\n * @remarks\n * Similar to StationLoginSuccess but includes additional fields for notification\n * tracking and multimedia profile settings.\n */\nexport type StationLoginSuccessResponse = {\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the station login request */\n trackingId: string;\n /** Auxiliary code ID for initial state */\n auxCodeId: string;\n /** ID of the team the agent belongs to */\n teamId: string;\n /** New session ID assigned to the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** List of active interaction IDs */\n interactionIds: string[];\n /** Current login status */\n status: string;\n /** Current availability status */\n subStatus: 'Available' | 'Idle';\n /** ID of the site where the agent is located */\n siteId: string;\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of last state change */\n lastStateChangeTimestamp: number;\n /** Type of agent profile */\n profileType: string;\n /** Multimedia profile capacity settings */\n mmProfile: {\n /** Maximum concurrent chat capacity */\n chat: number;\n /** Maximum concurrent email capacity */\n email: number;\n /** Maximum concurrent social media capacity */\n social: number;\n /** Maximum concurrent voice call capacity */\n telephony: number;\n };\n /** Phone number for dialing */\n dialNumber?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Session ID of the supervising agent if applicable */\n supervisorSessionId?: string;\n /** Type identifier for station login success event */\n type: 'AgentStationLoginSuccess';\n /** Tracking ID for notifications */\n notifsTrackingId: string;\n};\n\n/**\n * Extended response type for agent device type update success\n * @public\n * @remarks\n * Represents the response when an agent's device type is successfully updated.\n * Contains all the details of the agent's session and device configuration.\n */\nexport type DeviceTypeUpdateSuccess = Omit<StationLoginSuccessResponse, 'type'> & {\n type: 'AgentDeviceTypeUpdateSuccess';\n};\n/**\n * Parameters required for initiating an agent logout\n * @public\n * @remarks\n * Defines the parameters that can be provided when logging out an agent,\n * including the reason for logout which helps with reporting and auditing.\n */\nexport type Logout = {\n /** Reason for the logout action */\n logoutReason?:\n | 'User requested logout'\n | 'Inactivity Logout'\n | 'User requested agent profile update';\n};\n\n/**\n * Represents the possible states an agent can be in\n * @public\n * @remarks\n * Defines the various states an agent can transition between during their session.\n * Common states include 'Available' (ready to handle interactions), 'Idle' (on break\n * or not ready), and 'RONA' (Response on No Answer).\n */\nexport type AgentState = 'Available' | 'Idle' | 'RONA' | string;\n\n/**\n * Parameters required for changing an agent's state\n * @public\n * @remarks\n * Defines the necessary information for transitioning an agent from one state to another.\n */\nexport type StateChange = {\n /** New state to transition the agent to */\n state: AgentState;\n /** Auxiliary code ID associated with the state change */\n auxCodeId: string;\n /** Reason for the state change */\n lastStateChangeReason?: string;\n /** ID of the agent whose state is being changed */\n agentId?: string;\n};\n\n/**\n * Parameters required for agent station login\n * @public\n * @remarks\n * Contains all the necessary information for logging an agent into their workstation,\n * including team assignments, roles, and device configurations.\n */\nexport type UserStationLogin = {\n /** Phone number for dialing */\n dialNumber?: string | null;\n /** Directory number */\n dn?: string | null;\n /** ID of the team the agent belongs to */\n teamId: string | null;\n /** Name of the team */\n teamName: string | null;\n /** List of roles assigned to the agent */\n roles?: Array<string>;\n /** ID of the site where the agent is located */\n siteId: string;\n /** Indicates if agent uses a different DN than their assigned one */\n usesOtherDN: boolean;\n /** ID of the agent's skill profile */\n skillProfileId?: string;\n /** ID of the initial auxiliary state code */\n auxCodeId: string;\n /** Indicates if login is via extension */\n isExtension?: boolean;\n /** Type of device being used */\n deviceType?: DeviceType;\n /** Unique identifier of the device */\n deviceId?: string | null;\n /** Flag indicating if emergency modal was shown */\n isEmergencyModalAlreadyDisplayed?: boolean;\n};\n\n/**\n * Available options for agent login methods\n * @public\n * @remarks\n * Defines the supported methods for agent login:\n * - AGENT_DN: Login using agent's direct number\n * - EXTENSION: Login using extension number\n * - BROWSER: Browser-based login\n */\nexport type LoginOption = 'AGENT_DN' | 'EXTENSION' | 'BROWSER';\n\n/**\n * Type of device used for agent login\n * @public\n * @remarks\n * Represents the type of device being used for login. Can be one of the standard\n * LoginOptions or a custom device type string.\n */\nexport type DeviceType = LoginOption | string;\n\n/**\n * Parameters for retrieving buddy agent information\n * @public\n * @remarks\n * Defines the criteria for fetching information about other agents (buddies)\n * in the system, allowing filtering by profile, media type, and state.\n */\nexport type BuddyAgents = {\n agentProfileId: string;\n mediaType: string;\n /** Filter for agent state eg : Available | Idle */\n state?: string;\n};\n\n/**\n * Detailed information about a buddy agent\n * @public\n * @remarks\n * Contains comprehensive information about a buddy agent including their\n * current state, assignments, and contact information.\n */\nexport type BuddyDetails = {\n agentId: string;\n state: string;\n teamId: string;\n dn: string;\n agentName: string;\n siteId: string;\n};\n\n/**\n * Response type received when successfully retrieving buddy agent information\n * @public\n * @remarks\n * Contains the list of buddy agents and their details returned from a buddy\n * agent lookup request. Used for monitoring team member statuses and availability.\n */\nexport type BuddyAgentsSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the requesting agent */\n agentId: string;\n /** Tracking ID for the buddy list request */\n trackingId: string;\n /** Current session ID of the requesting agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** Type identifier for buddy agents response */\n type: 'BuddyAgents';\n /** List of buddy agents and their details */\n agentList: Array<BuddyDetails>;\n}>;\n\n/**\n * Events emitted by the agent service for various state changes and actions\n * @public\n * @remarks\n * Enumeration of all possible events that can be emitted by the agent service.\n * These events can be used to track and respond to changes in agent state,\n * login status, and other important agent-related activities.\n */\nexport enum AGENT_EVENTS {\n /** Emitted when an agent's state changes (e.g., Available to Idle) */\n AGENT_STATE_CHANGE = 'agent:stateChange',\n\n /** Emitted when multiple logins are detected for the same agent */\n AGENT_MULTI_LOGIN = 'agent:multiLogin',\n\n /** Emitted when an agent successfully logs into their station */\n AGENT_STATION_LOGIN_SUCCESS = 'agent:stationLoginSuccess',\n\n /** Emitted when station login attempt fails */\n AGENT_STATION_LOGIN_FAILED = 'agent:stationLoginFailed',\n\n /** Emitted when an agent successfully logs out */\n AGENT_LOGOUT_SUCCESS = 'agent:logoutSuccess',\n\n /** Emitted when logout attempt fails */\n AGENT_LOGOUT_FAILED = 'agent:logoutFailed',\n\n /** Emitted when an agent's directory number is successfully registered */\n AGENT_DN_REGISTERED = 'agent:dnRegistered',\n\n /** Emitted when an agent successfully re-authenticates */\n AGENT_RELOGIN_SUCCESS = 'agent:reloginSuccess',\n\n /** Emitted when agent state change is successful */\n AGENT_STATE_CHANGE_SUCCESS = 'agent:stateChangeSuccess',\n\n /** Emitted when agent state change attempt fails */\n AGENT_STATE_CHANGE_FAILED = 'agent:stateChangeFailed',\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAoDA;AACA;AACA;AACA;AACA;AACA;AACA;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AA0CA;AACA;AACA;AACA;AACA;AACA;AACA;AAqDA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AA8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EACtB;EADUA,YAAY;EAItB;EAJUA,YAAY;EAOtB;EAPUA,YAAY;EAUtB;EAVUA,YAAY;EAatB;EAbUA,YAAY;EAgBtB;EAhBUA,YAAY;EAmBtB;EAnBUA,YAAY;EAsBtB;EAtBUA,YAAY;EAyBtB;EAzBUA,YAAY;EA4BtB;EA5BUA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
@@ -118,7 +118,8 @@ function parseAgentConfigs(profileData) {
118
118
  orgSettingsData,
119
119
  agentProfileData,
120
120
  dialPlanData,
121
- urlMapping
121
+ urlMapping,
122
+ aiFeatureFlags
122
123
  } = profileData;
123
124
  const tenantDataTimeout = tenantData.timeoutDesktopInactivityEnabled ? tenantData.timeoutDesktopInactivityMins : null;
124
125
  const inactivityTimeoutTimer = agentProfileData.timeoutDesktopInactivityCustomEnabled ? agentProfileData.timeoutDesktopInactivityMins : tenantDataTimeout;
@@ -132,9 +133,10 @@ function parseAgentConfigs(profileData) {
132
133
  }); // pushing available state to idle codes
133
134
 
134
135
  const defaultWrapUpData = getDefaultWrapUpCode(wrapupCodes);
136
+ const aiFeature = aiFeatureFlags?.data?.length > 0 ? aiFeatureFlags.data[0] : undefined;
135
137
  const finalData = {
136
138
  teams: teamData,
137
- defaultDn: userData.defaultDialledNumber,
139
+ defaultDn: userData.deafultDialledNumber,
138
140
  forceDefaultDn: tenantData.forceDefaultDn,
139
141
  forceDefaultDnForAgent: getDefaultAgentDN(agentProfileData.agentDNValidation),
140
142
  regexUS: tenantData.dnDefaultRegex,
@@ -153,6 +155,7 @@ function parseAgentConfigs(profileData) {
153
155
  siteId: userData.siteId,
154
156
  enterpriseId: orgInfoData.tenantId,
155
157
  tenantTimezone: orgInfoData.timezone,
158
+ environment: orgInfoData.environment,
156
159
  privacyShieldVisible: tenantData.privacyShieldVisible,
157
160
  organizationIdleCodes: [],
158
161
  // TODO: for supervisor, getOrgFilteredIdleCodes(auxCodes, false),
@@ -176,11 +179,14 @@ function parseAgentConfigs(profileData) {
176
179
  isAgentAvailableAfterOutdial: agentProfileData.agentAvailableAfterOutdial,
177
180
  outDialEp: agentProfileData.outdialEntryPointId,
178
181
  isCampaignManagementEnabled: orgSettingsData.campaignManagerEnabled,
179
- isEndCallEnabled: tenantData.endCallEnabled,
182
+ isEndTaskEnabled: tenantData.endCallEnabled,
180
183
  isEndConsultEnabled: tenantData.endConsultEnabled,
181
184
  callVariablesSuppressed: tenantData.callVariablesSuppressed,
182
185
  agentDbId: userData.dbId,
183
186
  allowConsultToQueue: agentProfileData.consultToQueue,
187
+ accessQueue: agentProfileData.accessQueue,
188
+ accessEntryPoint: agentProfileData.accessEntryPoint,
189
+ accessBuddyTeam: agentProfileData.accessBuddyTeam,
184
190
  agentPersonalStatsEnabled: agentProfileData.viewableStatistics ? agentProfileData.viewableStatistics.agentStats : false,
185
191
  addressBookId: agentProfileData.addressBookId,
186
192
  outdialANIId: agentProfileData.outdialANIId,
@@ -196,7 +202,8 @@ function parseAgentConfigs(profileData) {
196
202
  maskSensitiveData: orgSettingsData.maskSensitiveData ? orgSettingsData.maskSensitiveData : false,
197
203
  microsoftConfig: getMsftConfig(agentProfileData),
198
204
  webexConfig: getWebexConfig(agentProfileData),
199
- lostConnectionRecoveryTimeout: tenantData.lostConnectionRecoveryTimeout || _constants.LOST_CONNECTION_RECOVERY_TIMEOUT
205
+ lostConnectionRecoveryTimeout: tenantData.lostConnectionRecoveryTimeout || _constants.LOST_CONNECTION_RECOVERY_TIMEOUT,
206
+ aiFeature
200
207
  };
201
208
  return finalData;
202
209
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","require","_types","getUrlMapping","urlMappings","name","mappedUrl","find","mapping","url","getMsftConfig","agentProfileData","showUserDetailsMS","stateSynchronizationMS","getWebexConfig","showUserDetailsWebex","stateSynchronizationWebex","getDefaultAgentDN","agentDNValidation","getFilteredDialplanEntries","dialPlanData","profileDialPlans","dialPlanEntries","forEach","dailPlan","includes","id","filteredPlan","regex","regularExpression","prefix","strippedChars","push","getFilterAuxCodes","auxCodes","type","specificCodes","filteredAuxCodes","auxCode","workTypeCode","active","length","isSystem","isSystemCode","isDefault","defaultCode","getDefaultWrapUpCode","wrapUpReasonList","c","parseAgentConfigs","profileData","userData","teamData","tenantData","orgInfoData","orgSettingsData","urlMapping","tenantDataTimeout","timeoutDesktopInactivityEnabled","timeoutDesktopInactivityMins","inactivityTimeoutTimer","timeoutDesktopInactivityCustomEnabled","wrapupCodes","WRAP_UP_CODE","accessWrapUpCode","wrapUpCodes","idleCodes","IDLE_CODE","accessIdleCode","defaultWrapUpData","finalData","teams","defaultDn","defaultDialledNumber","forceDefaultDn","forceDefaultDnForAgent","regexUS","dnDefaultRegex","regexOther","dnOtherRegex","agentId","ciUserId","agentName","firstName","lastName","agentMailId","email","agentProfileID","agentProfileId","autoAnswer","dialPlan","dialPlanEnabled","dialPlanEntity","dialPlans","undefined","multimediaProfileId","skillProfileId","siteId","enterpriseId","tenantId","tenantTimezone","timezone","privacyShieldVisible","organizationIdleCodes","idleCodesAccess","wrapUpData","wrapUpProps","autoWrapup","autoWrapUp","autoWrapupInterval","autoWrapAfterSeconds","lastAgentRoute","lastAgentRouting","wrapUpCodeAccess","allowCancelAutoWrapup","allowAutoWrapUpExtension","defaultWrapupCode","isOutboundEnabledForTenant","outdialEnabled","isOutboundEnabledForAgent","isAdhocDialingEnabled","isAgentAvailableAfterOutdial","agentAvailableAfterOutdial","outDialEp","outdialEntryPointId","isCampaignManagementEnabled","campaignManagerEnabled","isEndCallEnabled","endCallEnabled","isEndConsultEnabled","endConsultEnabled","callVariablesSuppressed","agentDbId","dbId","allowConsultToQueue","consultToQueue","agentPersonalStatsEnabled","viewableStatistics","agentStats","addressBookId","outdialANIId","analyserUserId","acqueonApiUrl","acqueonConsoleUrl","isTimeoutDesktopInactivityEnabled","loginVoiceOptions","webRtcEnabled","maskSensitiveData","microsoftConfig","webexConfig","lostConnectionRecoveryTimeout","LOST_CONNECTION_RECOVERY_TIMEOUT"],"sources":["Util.ts"],"sourcesContent":["import {LOST_CONNECTION_RECOVERY_TIMEOUT} from '../core/constants';\nimport {\n AgentResponse,\n AuxCode,\n AuxCodeType,\n DesktopProfileResponse,\n DialPlanEntity,\n Entity,\n IDLE_CODE,\n OrgInfo,\n OrgSettings,\n Profile,\n Team,\n TenantData,\n URLMapping,\n WRAP_UP_CODE,\n} from './types';\n\n/**\n * Get the URL mapping for the given name\n * @param {Array<URLMapping>} urlMappings\n * @param {string} name\n * @returns {string}\n */\nconst getUrlMapping = (urlMappings: Array<URLMapping>, name: string) => {\n const mappedUrl = urlMappings.find((mapping) => mapping.name === name)?.url;\n\n return mappedUrl || '';\n};\n\n/**\n * Get the MSFT and Webex configuration\n * @param {DesktopProfileResponse} agentProfileData\n * @returns {Object}\n */\nconst getMsftConfig = (agentProfileData: DesktopProfileResponse) => {\n return {\n showUserDetailsMS: agentProfileData.showUserDetailsMS ?? false,\n stateSynchronizationMS: agentProfileData.stateSynchronizationMS ?? false,\n };\n};\n\n/**\n * Get the Webex configuration\n * @param {DesktopProfileResponse} agentProfileData\n * @returns {Object}\n */\nconst getWebexConfig = (agentProfileData: DesktopProfileResponse) => {\n return {\n showUserDetailsWebex: agentProfileData.showUserDetailsWebex ?? false,\n stateSynchronizationWebex: agentProfileData.stateSynchronizationWebex ?? false,\n };\n};\n\n/**\n * Get the default agent DN\n * @param {string} agentDNValidation\n * @returns {boolean}\n */\nconst getDefaultAgentDN = (agentDNValidation: string) => {\n return agentDNValidation === 'PROVISIONED_VALUE';\n};\n\n/**\n * Get the filtered dialplan entries\n * @param {Array<DialPlanEntity>} dialPlanData\n * @param {Array<string>} profileDialPlans\n * @returns {Array<Entity>}\n */\nconst getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[], profileDialPlans: string[]) => {\n const dialPlanEntries = [];\n dialPlanData.forEach((dailPlan: DialPlanEntity) => {\n if (profileDialPlans.includes(dailPlan.id)) {\n const filteredPlan = {\n regex: dailPlan.regularExpression,\n prefix: dailPlan.prefix,\n strippedChars: dailPlan.strippedChars,\n name: dailPlan.name,\n };\n dialPlanEntries.push(filteredPlan);\n }\n });\n\n return dialPlanEntries;\n};\n\n/**\n * Get the filtered aux codes\n * @param {Array<AuxCode>} auxCodes\n * @param {AuxCodeType} type\n * @param {Array<string>} specificCodes\n * @returns {Array<Entity>}\n */\nconst getFilterAuxCodes = (\n auxCodes: Array<AuxCode>,\n type: AuxCodeType,\n specificCodes: string[]\n) => {\n const filteredAuxCodes: Array<Entity> = [];\n auxCodes.forEach((auxCode: AuxCode) => {\n if (\n auxCode.workTypeCode === type &&\n auxCode.active &&\n (specificCodes.length === 0 || specificCodes.includes(auxCode.id))\n ) {\n filteredAuxCodes.push({\n id: auxCode.id,\n name: auxCode.name,\n isSystem: auxCode.isSystemCode,\n isDefault: auxCode.defaultCode,\n });\n }\n });\n\n return filteredAuxCodes;\n};\n\n/**\n * Get the default wrapup code\n * @param {Array<Entity>} wrapUpReasonList\n * @returns {Entity}\n */\nfunction getDefaultWrapUpCode(wrapUpReasonList: Entity[]) {\n return wrapUpReasonList?.find((c: Entity) => c.isDefault);\n}\n\n/**\n * Parse the agent configurations\n * @param {Object} profileData\n * @returns {Profile}\n */\nfunction parseAgentConfigs(profileData: {\n userData: AgentResponse;\n teamData: Team[];\n tenantData: TenantData;\n orgInfoData: OrgInfo;\n auxCodes: AuxCode[];\n orgSettingsData: OrgSettings;\n agentProfileData: DesktopProfileResponse;\n dialPlanData: DialPlanEntity[];\n urlMapping: URLMapping[];\n multimediaProfileId: string;\n}): Profile {\n const {\n userData,\n teamData,\n tenantData,\n orgInfoData,\n auxCodes,\n orgSettingsData,\n agentProfileData,\n dialPlanData,\n urlMapping,\n } = profileData;\n\n const tenantDataTimeout = tenantData.timeoutDesktopInactivityEnabled\n ? tenantData.timeoutDesktopInactivityMins\n : null;\n const inactivityTimeoutTimer = agentProfileData.timeoutDesktopInactivityCustomEnabled\n ? agentProfileData.timeoutDesktopInactivityMins\n : tenantDataTimeout;\n\n const wrapupCodes = getFilterAuxCodes(\n auxCodes,\n WRAP_UP_CODE,\n agentProfileData.accessWrapUpCode === 'ALL' ? [] : agentProfileData.wrapUpCodes\n );\n\n const idleCodes = getFilterAuxCodes(\n auxCodes,\n IDLE_CODE,\n agentProfileData.accessIdleCode === 'ALL' ? [] : agentProfileData.idleCodes\n );\n\n idleCodes.push({\n id: '0',\n name: 'Available',\n isSystem: false,\n isDefault: false,\n }); // pushing available state to idle codes\n\n const defaultWrapUpData = getDefaultWrapUpCode(wrapupCodes);\n\n const finalData = {\n teams: teamData,\n defaultDn: userData.defaultDialledNumber,\n forceDefaultDn: tenantData.forceDefaultDn,\n forceDefaultDnForAgent: getDefaultAgentDN(agentProfileData.agentDNValidation),\n regexUS: tenantData.dnDefaultRegex,\n regexOther: tenantData.dnOtherRegex,\n agentId: userData.ciUserId,\n agentName: `${userData.firstName} ${userData.lastName}`,\n agentMailId: userData.email,\n agentProfileID: userData.agentProfileId,\n autoAnswer: agentProfileData.autoAnswer,\n dialPlan: agentProfileData.dialPlanEnabled\n ? {\n type: 'adhocDial',\n dialPlanEntity: getFilteredDialplanEntries(dialPlanData, agentProfileData.dialPlans),\n }\n : undefined,\n multimediaProfileId: profileData.multimediaProfileId,\n skillProfileId: userData.skillProfileId ? userData.skillProfileId : null,\n siteId: userData.siteId,\n enterpriseId: orgInfoData.tenantId,\n tenantTimezone: orgInfoData.timezone,\n privacyShieldVisible: tenantData.privacyShieldVisible,\n organizationIdleCodes: [], // TODO: for supervisor, getOrgFilteredIdleCodes(auxCodes, false),\n idleCodesAccess: agentProfileData.accessIdleCode as 'ALL' | 'SPECIFIC',\n idleCodes,\n wrapupCodes,\n wrapUpData: {\n wrapUpProps: {\n autoWrapup: agentProfileData.autoWrapUp,\n autoWrapupInterval: agentProfileData.autoWrapAfterSeconds,\n lastAgentRoute: agentProfileData.lastAgentRouting,\n wrapUpCodeAccess: agentProfileData.accessWrapUpCode,\n wrapUpReasonList: wrapupCodes,\n allowCancelAutoWrapup: agentProfileData.allowAutoWrapUpExtension,\n },\n },\n defaultWrapupCode: defaultWrapUpData?.id ?? '',\n isOutboundEnabledForTenant: tenantData.outdialEnabled,\n isOutboundEnabledForAgent: agentProfileData.outdialEnabled,\n isAdhocDialingEnabled: agentProfileData.dialPlanEnabled,\n isAgentAvailableAfterOutdial: agentProfileData.agentAvailableAfterOutdial,\n outDialEp: agentProfileData.outdialEntryPointId,\n isCampaignManagementEnabled: orgSettingsData.campaignManagerEnabled,\n isEndCallEnabled: tenantData.endCallEnabled,\n isEndConsultEnabled: tenantData.endConsultEnabled,\n callVariablesSuppressed: tenantData.callVariablesSuppressed,\n agentDbId: userData.dbId,\n allowConsultToQueue: agentProfileData.consultToQueue,\n agentPersonalStatsEnabled: agentProfileData.viewableStatistics\n ? agentProfileData.viewableStatistics.agentStats\n : false,\n addressBookId: agentProfileData.addressBookId,\n outdialANIId: agentProfileData.outdialANIId,\n analyserUserId: userData.id,\n\n urlMappings: {\n acqueonApiUrl: getUrlMapping(urlMapping, 'ACQUEON_API_URL'),\n acqueonConsoleUrl: getUrlMapping(urlMapping, 'ACQUEON_CONSOLE_URL'),\n },\n isTimeoutDesktopInactivityEnabled: tenantData.timeoutDesktopInactivityEnabled,\n timeoutDesktopInactivityMins: inactivityTimeoutTimer,\n loginVoiceOptions: agentProfileData.loginVoiceOptions ?? [],\n webRtcEnabled: orgSettingsData.webRtcEnabled,\n maskSensitiveData: orgSettingsData.maskSensitiveData\n ? orgSettingsData.maskSensitiveData\n : false,\n microsoftConfig: getMsftConfig(agentProfileData),\n webexConfig: getWebexConfig(agentProfileData),\n lostConnectionRecoveryTimeout:\n tenantData.lostConnectionRecoveryTimeout || LOST_CONNECTION_RECOVERY_TIMEOUT,\n };\n\n return finalData;\n}\n\nexport {parseAgentConfigs};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,aAAa,GAAGA,CAACC,WAA8B,EAAEC,IAAY,KAAK;EACtE,MAAMC,SAAS,GAAGF,WAAW,CAACG,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACH,IAAI,KAAKA,IAAI,CAAC,EAAEI,GAAG;EAE3E,OAAOH,SAAS,IAAI,EAAE;AACxB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMI,aAAa,GAAIC,gBAAwC,IAAK;EAClE,OAAO;IACLC,iBAAiB,EAAED,gBAAgB,CAACC,iBAAiB,IAAI,KAAK;IAC9DC,sBAAsB,EAAEF,gBAAgB,CAACE,sBAAsB,IAAI;EACrE,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAIH,gBAAwC,IAAK;EACnE,OAAO;IACLI,oBAAoB,EAAEJ,gBAAgB,CAACI,oBAAoB,IAAI,KAAK;IACpEC,yBAAyB,EAAEL,gBAAgB,CAACK,yBAAyB,IAAI;EAC3E,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAIC,iBAAyB,IAAK;EACvD,OAAOA,iBAAiB,KAAK,mBAAmB;AAClD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAGA,CAACC,YAA8B,EAAEC,gBAA0B,KAAK;EACjG,MAAMC,eAAe,GAAG,EAAE;EAC1BF,YAAY,CAACG,OAAO,CAAEC,QAAwB,IAAK;IACjD,IAAIH,gBAAgB,CAACI,QAAQ,CAACD,QAAQ,CAACE,EAAE,CAAC,EAAE;MAC1C,MAAMC,YAAY,GAAG;QACnBC,KAAK,EAAEJ,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iH,mBAAmB;IAC/CC,2BAA2B,EAAEtE,eAAe,CAACuE,sBAAsB;IACnEC,gBAAgB,EAAE1E,UAAU,CAAC2E,cAAc;IAC3CC,mBAAmB,EAAE5E,UAAU,CAAC6E,iBAAiB;IACjDC,uBAAuB,EAAE9E,UAAU,CAAC8E,uBAAuB;IAC3DC,SAAS,EAAEjF,QAAQ,CAACkF,IAAI;IACxBC,mBAAmB,EAAE3H,gBAAgB,CAAC4H,cAAc;IACpDC,yBAAyB,EAAE7H,gBAAgB,CAAC8H,kBAAkB,GAC1D9H,gBAAgB,CAAC8H,kBAAkB,CAACC,UAAU,GAC9C,KAAK;IACTC,aAAa,EAAEhI,gBAAgB,CAACgI,aAAa;IAC7CC,YAAY,EAAEjI,gBAAgB,CAACiI,YAAY;IAC3CC,cAAc,EAAE1F,QAAQ,CAACzB,EAAE;IAE3BtB,WAAW,EAAE;MACX0I,aAAa,EAAE3I,aAAa,CAACqD,UAAU,EAAE,iBAAiB,CAAC;MAC3DuF,iBAAiB,EAAE5I,aAAa,CAACqD,UAAU,EAAE,qBAAqB;IACpE,CAAC;IACDwF,iCAAiC,EAAE3F,UAAU,CAACK,+BAA+B;IAC7EC,4BAA4B,EAAEC,sBAAsB;IACpDqF,iBAAiB,EAAEtI,gBAAgB,CAACsI,iBAAiB,IAAI,EAAE;IAC3DC,aAAa,EAAE3F,eAAe,CAAC2F,aAAa;IAC5CC,iBAAiB,EAAE5F,eAAe,CAAC4F,iBAAiB,GAChD5F,eAAe,CAAC4F,iBAAiB,GACjC,KAAK;IACTC,eAAe,EAAE1I,aAAa,CAACC,gBAAgB,CAAC;IAChD0I,WAAW,EAAEvI,cAAc,CAACH,gBAAgB,CAAC;IAC7C2I,6BAA6B,EAC3BjG,UAAU,CAACiG,6BAA6B,IAAIC;EAChD,CAAC;EAED,OAAOjF,SAAS;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["_constants","require","_types","getUrlMapping","urlMappings","name","mappedUrl","find","mapping","url","getMsftConfig","agentProfileData","showUserDetailsMS","stateSynchronizationMS","getWebexConfig","showUserDetailsWebex","stateSynchronizationWebex","getDefaultAgentDN","agentDNValidation","getFilteredDialplanEntries","dialPlanData","profileDialPlans","dialPlanEntries","forEach","dailPlan","includes","id","filteredPlan","regex","regularExpression","prefix","strippedChars","push","getFilterAuxCodes","auxCodes","type","specificCodes","filteredAuxCodes","auxCode","workTypeCode","active","length","isSystem","isSystemCode","isDefault","defaultCode","getDefaultWrapUpCode","wrapUpReasonList","c","parseAgentConfigs","profileData","userData","teamData","tenantData","orgInfoData","orgSettingsData","urlMapping","aiFeatureFlags","tenantDataTimeout","timeoutDesktopInactivityEnabled","timeoutDesktopInactivityMins","inactivityTimeoutTimer","timeoutDesktopInactivityCustomEnabled","wrapupCodes","WRAP_UP_CODE","accessWrapUpCode","wrapUpCodes","idleCodes","IDLE_CODE","accessIdleCode","defaultWrapUpData","aiFeature","data","undefined","finalData","teams","defaultDn","deafultDialledNumber","forceDefaultDn","forceDefaultDnForAgent","regexUS","dnDefaultRegex","regexOther","dnOtherRegex","agentId","ciUserId","agentName","firstName","lastName","agentMailId","email","agentProfileID","agentProfileId","autoAnswer","dialPlan","dialPlanEnabled","dialPlanEntity","dialPlans","multimediaProfileId","skillProfileId","siteId","enterpriseId","tenantId","tenantTimezone","timezone","environment","privacyShieldVisible","organizationIdleCodes","idleCodesAccess","wrapUpData","wrapUpProps","autoWrapup","autoWrapUp","autoWrapupInterval","autoWrapAfterSeconds","lastAgentRoute","lastAgentRouting","wrapUpCodeAccess","allowCancelAutoWrapup","allowAutoWrapUpExtension","defaultWrapupCode","isOutboundEnabledForTenant","outdialEnabled","isOutboundEnabledForAgent","isAdhocDialingEnabled","isAgentAvailableAfterOutdial","agentAvailableAfterOutdial","outDialEp","outdialEntryPointId","isCampaignManagementEnabled","campaignManagerEnabled","isEndTaskEnabled","endCallEnabled","isEndConsultEnabled","endConsultEnabled","callVariablesSuppressed","agentDbId","dbId","allowConsultToQueue","consultToQueue","accessQueue","accessEntryPoint","accessBuddyTeam","agentPersonalStatsEnabled","viewableStatistics","agentStats","addressBookId","outdialANIId","analyserUserId","acqueonApiUrl","acqueonConsoleUrl","isTimeoutDesktopInactivityEnabled","loginVoiceOptions","webRtcEnabled","maskSensitiveData","microsoftConfig","webexConfig","lostConnectionRecoveryTimeout","LOST_CONNECTION_RECOVERY_TIMEOUT"],"sources":["Util.ts"],"sourcesContent":["import {LOST_CONNECTION_RECOVERY_TIMEOUT} from '../core/constants';\nimport {\n AgentResponse,\n AuxCode,\n AuxCodeType,\n DesktopProfileResponse,\n DialPlanEntity,\n Entity,\n IDLE_CODE,\n OrgInfo,\n OrgSettings,\n Profile,\n Team,\n TenantData,\n URLMapping,\n WRAP_UP_CODE,\n AIFeatureFlagsResponse,\n AIFeatureFlags,\n} from './types';\n\n/**\n * Get the URL mapping for the given name\n * @param {Array<URLMapping>} urlMappings\n * @param {string} name\n * @returns {string}\n */\nconst getUrlMapping = (urlMappings: Array<URLMapping>, name: string) => {\n const mappedUrl = urlMappings.find((mapping) => mapping.name === name)?.url;\n\n return mappedUrl || '';\n};\n\n/**\n * Get the MSFT and Webex configuration\n * @param {DesktopProfileResponse} agentProfileData\n * @returns {Object}\n */\nconst getMsftConfig = (agentProfileData: DesktopProfileResponse) => {\n return {\n showUserDetailsMS: agentProfileData.showUserDetailsMS ?? false,\n stateSynchronizationMS: agentProfileData.stateSynchronizationMS ?? false,\n };\n};\n\n/**\n * Get the Webex configuration\n * @param {DesktopProfileResponse} agentProfileData\n * @returns {Object}\n */\nconst getWebexConfig = (agentProfileData: DesktopProfileResponse) => {\n return {\n showUserDetailsWebex: agentProfileData.showUserDetailsWebex ?? false,\n stateSynchronizationWebex: agentProfileData.stateSynchronizationWebex ?? false,\n };\n};\n\n/**\n * Get the default agent DN\n * @param {string} agentDNValidation\n * @returns {boolean}\n */\nconst getDefaultAgentDN = (agentDNValidation: string) => {\n return agentDNValidation === 'PROVISIONED_VALUE';\n};\n\n/**\n * Get the filtered dialplan entries\n * @param {Array<DialPlanEntity>} dialPlanData\n * @param {Array<string>} profileDialPlans\n * @returns {Array<Entity>}\n */\nconst getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[], profileDialPlans: string[]) => {\n const dialPlanEntries = [];\n dialPlanData.forEach((dailPlan: DialPlanEntity) => {\n if (profileDialPlans.includes(dailPlan.id)) {\n const filteredPlan = {\n regex: dailPlan.regularExpression,\n prefix: dailPlan.prefix,\n strippedChars: dailPlan.strippedChars,\n name: dailPlan.name,\n };\n dialPlanEntries.push(filteredPlan);\n }\n });\n\n return dialPlanEntries;\n};\n\n/**\n * Get the filtered aux codes\n * @param {Array<AuxCode>} auxCodes\n * @param {AuxCodeType} type\n * @param {Array<string>} specificCodes\n * @returns {Array<Entity>}\n */\nconst getFilterAuxCodes = (\n auxCodes: Array<AuxCode>,\n type: AuxCodeType,\n specificCodes: string[]\n) => {\n const filteredAuxCodes: Array<Entity> = [];\n auxCodes.forEach((auxCode: AuxCode) => {\n if (\n auxCode.workTypeCode === type &&\n auxCode.active &&\n (specificCodes.length === 0 || specificCodes.includes(auxCode.id))\n ) {\n filteredAuxCodes.push({\n id: auxCode.id,\n name: auxCode.name,\n isSystem: auxCode.isSystemCode,\n isDefault: auxCode.defaultCode,\n });\n }\n });\n\n return filteredAuxCodes;\n};\n\n/**\n * Get the default wrapup code\n * @param {Array<Entity>} wrapUpReasonList\n * @returns {Entity}\n */\nfunction getDefaultWrapUpCode(wrapUpReasonList: Entity[]) {\n return wrapUpReasonList?.find((c: Entity) => c.isDefault);\n}\n\n/**\n * Parse the agent configurations\n * @param {Object} profileData\n * @returns {Profile}\n */\nfunction parseAgentConfigs(profileData: {\n userData: AgentResponse;\n teamData: Team[];\n tenantData: TenantData;\n orgInfoData: OrgInfo;\n auxCodes: AuxCode[];\n orgSettingsData: OrgSettings;\n agentProfileData: DesktopProfileResponse;\n dialPlanData: DialPlanEntity[];\n urlMapping: URLMapping[];\n multimediaProfileId: string;\n aiFeatureFlags: AIFeatureFlagsResponse;\n}): Profile {\n const {\n userData,\n teamData,\n tenantData,\n orgInfoData,\n auxCodes,\n orgSettingsData,\n agentProfileData,\n dialPlanData,\n urlMapping,\n aiFeatureFlags,\n } = profileData;\n\n const tenantDataTimeout = tenantData.timeoutDesktopInactivityEnabled\n ? tenantData.timeoutDesktopInactivityMins\n : null;\n const inactivityTimeoutTimer = agentProfileData.timeoutDesktopInactivityCustomEnabled\n ? agentProfileData.timeoutDesktopInactivityMins\n : tenantDataTimeout;\n\n const wrapupCodes = getFilterAuxCodes(\n auxCodes,\n WRAP_UP_CODE,\n agentProfileData.accessWrapUpCode === 'ALL' ? [] : agentProfileData.wrapUpCodes\n );\n\n const idleCodes = getFilterAuxCodes(\n auxCodes,\n IDLE_CODE,\n agentProfileData.accessIdleCode === 'ALL' ? [] : agentProfileData.idleCodes\n );\n\n idleCodes.push({\n id: '0',\n name: 'Available',\n isSystem: false,\n isDefault: false,\n }); // pushing available state to idle codes\n\n const defaultWrapUpData = getDefaultWrapUpCode(wrapupCodes);\n const aiFeature: AIFeatureFlags | undefined =\n aiFeatureFlags?.data?.length > 0 ? aiFeatureFlags.data[0] : undefined;\n\n const finalData = {\n teams: teamData,\n defaultDn: userData.deafultDialledNumber,\n forceDefaultDn: tenantData.forceDefaultDn,\n forceDefaultDnForAgent: getDefaultAgentDN(agentProfileData.agentDNValidation),\n regexUS: tenantData.dnDefaultRegex,\n regexOther: tenantData.dnOtherRegex,\n agentId: userData.ciUserId,\n agentName: `${userData.firstName} ${userData.lastName}`,\n agentMailId: userData.email,\n agentProfileID: userData.agentProfileId,\n autoAnswer: agentProfileData.autoAnswer,\n dialPlan: agentProfileData.dialPlanEnabled\n ? {\n type: 'adhocDial',\n dialPlanEntity: getFilteredDialplanEntries(dialPlanData, agentProfileData.dialPlans),\n }\n : undefined,\n multimediaProfileId: profileData.multimediaProfileId,\n skillProfileId: userData.skillProfileId ? userData.skillProfileId : null,\n siteId: userData.siteId,\n enterpriseId: orgInfoData.tenantId,\n tenantTimezone: orgInfoData.timezone,\n environment: orgInfoData.environment,\n privacyShieldVisible: tenantData.privacyShieldVisible,\n organizationIdleCodes: [], // TODO: for supervisor, getOrgFilteredIdleCodes(auxCodes, false),\n idleCodesAccess: agentProfileData.accessIdleCode as 'ALL' | 'SPECIFIC',\n idleCodes,\n wrapupCodes,\n wrapUpData: {\n wrapUpProps: {\n autoWrapup: agentProfileData.autoWrapUp,\n autoWrapupInterval: agentProfileData.autoWrapAfterSeconds,\n lastAgentRoute: agentProfileData.lastAgentRouting,\n wrapUpCodeAccess: agentProfileData.accessWrapUpCode,\n wrapUpReasonList: wrapupCodes,\n allowCancelAutoWrapup: agentProfileData.allowAutoWrapUpExtension,\n },\n },\n defaultWrapupCode: defaultWrapUpData?.id ?? '',\n isOutboundEnabledForTenant: tenantData.outdialEnabled,\n isOutboundEnabledForAgent: agentProfileData.outdialEnabled,\n isAdhocDialingEnabled: agentProfileData.dialPlanEnabled,\n isAgentAvailableAfterOutdial: agentProfileData.agentAvailableAfterOutdial,\n outDialEp: agentProfileData.outdialEntryPointId,\n isCampaignManagementEnabled: orgSettingsData.campaignManagerEnabled,\n isEndTaskEnabled: tenantData.endCallEnabled,\n isEndConsultEnabled: tenantData.endConsultEnabled,\n callVariablesSuppressed: tenantData.callVariablesSuppressed,\n agentDbId: userData.dbId,\n allowConsultToQueue: agentProfileData.consultToQueue,\n accessQueue: agentProfileData.accessQueue,\n accessEntryPoint: agentProfileData.accessEntryPoint,\n accessBuddyTeam: agentProfileData.accessBuddyTeam,\n agentPersonalStatsEnabled: agentProfileData.viewableStatistics\n ? agentProfileData.viewableStatistics.agentStats\n : false,\n addressBookId: agentProfileData.addressBookId,\n outdialANIId: agentProfileData.outdialANIId,\n analyserUserId: userData.id,\n\n urlMappings: {\n acqueonApiUrl: getUrlMapping(urlMapping, 'ACQUEON_API_URL'),\n acqueonConsoleUrl: getUrlMapping(urlMapping, 'ACQUEON_CONSOLE_URL'),\n },\n isTimeoutDesktopInactivityEnabled: tenantData.timeoutDesktopInactivityEnabled,\n timeoutDesktopInactivityMins: inactivityTimeoutTimer,\n loginVoiceOptions: agentProfileData.loginVoiceOptions ?? [],\n webRtcEnabled: orgSettingsData.webRtcEnabled,\n maskSensitiveData: orgSettingsData.maskSensitiveData\n ? orgSettingsData.maskSensitiveData\n : false,\n microsoftConfig: getMsftConfig(agentProfileData),\n webexConfig: getWebexConfig(agentProfileData),\n lostConnectionRecoveryTimeout:\n tenantData.lostConnectionRecoveryTimeout || LOST_CONNECTION_RECOVERY_TIMEOUT,\n aiFeature,\n };\n\n return finalData;\n}\n\nexport {parseAgentConfigs};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,aAAa,GAAGA,CAACC,WAA8B,EAAEC,IAAY,KAAK;EACtE,MAAMC,SAAS,GAAGF,WAAW,CAACG,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACH,IAAI,KAAKA,IAAI,CAAC,EAAEI,GAAG;EAE3E,OAAOH,SAAS,IAAI,EAAE;AACxB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMI,aAAa,GAAIC,gBAAwC,IAAK;EAClE,OAAO;IACLC,iBAAiB,EAAED,gBAAgB,CAACC,iBAAiB,IAAI,KAAK;IAC9DC,sBAAsB,EAAEF,gBAAgB,CAACE,sBAAsB,IAAI;EACrE,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAIH,gBAAwC,IAAK;EACnE,OAAO;IACLI,oBAAoB,EAAEJ,gBAAgB,CAACI,oBAAoB,IAAI,KAAK;IACpEC,yBAAyB,EAAEL,gBAAgB,CAACK,yBAAyB,IAAI;EAC3E,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAIC,iBAAyB,IAAK;EACvD,OAAOA,iBA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