@webex/contact-center 3.11.0 → 3.12.0-llmrefactor.2

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 (267) hide show
  1. package/.sdd/manifest.json +882 -0
  2. package/AGENTS.md +94 -0
  3. package/ai-docs/ARCHITECTURE.md +168 -0
  4. package/ai-docs/CONTRACTS.md +46 -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 +341 -0
  17. package/ai-docs/features/generated-spec-conformance-fidelity-remediation/spec/feature-spec.md +117 -0
  18. package/ai-docs/features/residual-warning-coverage-completion/spec/feature-spec.md +203 -0
  19. package/ai-docs/features/validator-code-fidelity-drift-fix/spec/feature-spec.md +315 -0
  20. package/ai-docs/patterns/event-driven-patterns.md +485 -0
  21. package/ai-docs/patterns/testing-patterns.md +480 -0
  22. package/ai-docs/patterns/typescript-patterns.md +365 -0
  23. package/ai-docs/templates/README.md +102 -0
  24. package/ai-docs/templates/documentation/create-agents-md.md +240 -0
  25. package/ai-docs/templates/documentation/create-architecture-md.md +295 -0
  26. package/ai-docs/templates/existing-service/bug-fix.md +254 -0
  27. package/ai-docs/templates/existing-service/feature-enhancement.md +450 -0
  28. package/ai-docs/templates/new-method/00-master.md +80 -0
  29. package/ai-docs/templates/new-method/01-requirements.md +232 -0
  30. package/ai-docs/templates/new-method/02-implementation.md +295 -0
  31. package/ai-docs/templates/new-method/03-tests.md +201 -0
  32. package/ai-docs/templates/new-method/04-validation.md +141 -0
  33. package/ai-docs/templates/new-service/00-master.md +109 -0
  34. package/ai-docs/templates/new-service/01-pre-questions.md +159 -0
  35. package/ai-docs/templates/new-service/02-code-generation.md +346 -0
  36. package/ai-docs/templates/new-service/03-integration.md +178 -0
  37. package/ai-docs/templates/new-service/04-test-generation.md +205 -0
  38. package/ai-docs/templates/new-service/05-validation.md +145 -0
  39. package/dist/cc.js +379 -50
  40. package/dist/cc.js.map +1 -1
  41. package/dist/config.js +6 -0
  42. package/dist/config.js.map +1 -1
  43. package/dist/constants.js +22 -2
  44. package/dist/constants.js.map +1 -1
  45. package/dist/index.js +27 -5
  46. package/dist/index.js.map +1 -1
  47. package/dist/metrics/behavioral-events.js +114 -0
  48. package/dist/metrics/behavioral-events.js.map +1 -1
  49. package/dist/metrics/constants.js +32 -3
  50. package/dist/metrics/constants.js.map +1 -1
  51. package/dist/services/ApiAiAssistant.js +318 -0
  52. package/dist/services/ApiAiAssistant.js.map +1 -0
  53. package/dist/services/UserPreference.js +427 -0
  54. package/dist/services/UserPreference.js.map +1 -0
  55. package/dist/services/agent/types.js.map +1 -1
  56. package/dist/services/config/Util.js +8 -4
  57. package/dist/services/config/Util.js.map +1 -1
  58. package/dist/services/config/constants.js +35 -2
  59. package/dist/services/config/constants.js.map +1 -1
  60. package/dist/services/config/index.js +41 -2
  61. package/dist/services/config/index.js.map +1 -1
  62. package/dist/services/config/types.js +66 -8
  63. package/dist/services/config/types.js.map +1 -1
  64. package/dist/services/constants.js +27 -1
  65. package/dist/services/constants.js.map +1 -1
  66. package/dist/services/core/Err.js.map +1 -1
  67. package/dist/services/core/Utils.js +122 -25
  68. package/dist/services/core/Utils.js.map +1 -1
  69. package/dist/services/core/aqm-reqs.js +92 -17
  70. package/dist/services/core/aqm-reqs.js.map +1 -1
  71. package/dist/services/core/websocket/WebSocketManager.js +22 -6
  72. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  73. package/dist/services/core/websocket/connection-service.js +3 -1
  74. package/dist/services/core/websocket/connection-service.js.map +1 -1
  75. package/dist/services/core/websocket/types.js.map +1 -1
  76. package/dist/services/index.js +6 -0
  77. package/dist/services/index.js.map +1 -1
  78. package/dist/services/task/Task.js +688 -0
  79. package/dist/services/task/Task.js.map +1 -0
  80. package/dist/services/task/TaskFactory.js +45 -0
  81. package/dist/services/task/TaskFactory.js.map +1 -0
  82. package/dist/services/task/TaskManager.js +751 -457
  83. package/dist/services/task/TaskManager.js.map +1 -1
  84. package/dist/services/task/TaskUtils.js +220 -23
  85. package/dist/services/task/TaskUtils.js.map +1 -1
  86. package/dist/services/task/constants.js +23 -2
  87. package/dist/services/task/constants.js.map +1 -1
  88. package/dist/services/task/dialer.js +129 -0
  89. package/dist/services/task/dialer.js.map +1 -1
  90. package/dist/services/task/digital/Digital.js +77 -0
  91. package/dist/services/task/digital/Digital.js.map +1 -0
  92. package/dist/services/task/state-machine/TaskStateMachine.js +873 -0
  93. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
  94. package/dist/services/task/state-machine/actions.js +567 -0
  95. package/dist/services/task/state-machine/actions.js.map +1 -0
  96. package/dist/services/task/state-machine/constants.js +161 -0
  97. package/dist/services/task/state-machine/constants.js.map +1 -0
  98. package/dist/services/task/state-machine/guards.js +382 -0
  99. package/dist/services/task/state-machine/guards.js.map +1 -0
  100. package/dist/services/task/state-machine/index.js +53 -0
  101. package/dist/services/task/state-machine/index.js.map +1 -0
  102. package/dist/services/task/state-machine/types.js +54 -0
  103. package/dist/services/task/state-machine/types.js.map +1 -0
  104. package/dist/services/task/state-machine/uiControlsComputer.js +603 -0
  105. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
  106. package/dist/services/task/taskDataNormalizer.js +99 -0
  107. package/dist/services/task/taskDataNormalizer.js.map +1 -0
  108. package/dist/services/task/types.js +227 -4
  109. package/dist/services/task/types.js.map +1 -1
  110. package/dist/services/task/voice/Voice.js +1044 -0
  111. package/dist/services/task/voice/Voice.js.map +1 -0
  112. package/dist/services/task/voice/WebRTC.js +149 -0
  113. package/dist/services/task/voice/WebRTC.js.map +1 -0
  114. package/dist/types/cc.d.ts +894 -0
  115. package/dist/types/config.d.ts +72 -0
  116. package/dist/types/constants.d.ts +66 -0
  117. package/dist/types/index.d.ts +199 -0
  118. package/dist/types/logger-proxy.d.ts +71 -0
  119. package/dist/types/metrics/MetricsManager.d.ts +223 -0
  120. package/dist/types/metrics/behavioral-events.d.ts +29 -0
  121. package/dist/types/metrics/constants.d.ts +181 -0
  122. package/dist/types/services/AddressBook.d.ts +74 -0
  123. package/dist/types/services/ApiAiAssistant.d.ts +49 -0
  124. package/dist/types/services/EntryPoint.d.ts +67 -0
  125. package/dist/types/services/Queue.d.ts +76 -0
  126. package/dist/types/services/UserPreference.d.ts +118 -0
  127. package/dist/types/services/WebCallingService.d.ts +1 -0
  128. package/dist/types/services/agent/index.d.ts +46 -0
  129. package/dist/types/services/agent/types.d.ts +413 -0
  130. package/dist/types/services/config/Util.d.ts +20 -0
  131. package/dist/types/services/config/constants.d.ts +270 -0
  132. package/dist/types/services/config/index.d.ts +177 -0
  133. package/dist/types/services/config/types.d.ts +1368 -0
  134. package/dist/types/services/constants.d.ts +110 -0
  135. package/dist/types/services/core/Err.d.ts +125 -0
  136. package/dist/types/services/core/GlobalTypes.d.ts +58 -0
  137. package/dist/types/services/core/Utils.d.ts +121 -0
  138. package/dist/types/services/core/WebexRequest.d.ts +22 -0
  139. package/dist/types/services/core/aqm-reqs.d.ts +65 -0
  140. package/dist/types/services/core/constants.d.ts +99 -0
  141. package/dist/types/services/core/types.d.ts +47 -0
  142. package/dist/types/services/core/websocket/WebSocketManager.d.ts +36 -0
  143. package/dist/types/services/core/websocket/connection-service.d.ts +27 -0
  144. package/dist/types/services/core/websocket/keepalive.worker.d.ts +2 -0
  145. package/dist/types/services/core/websocket/types.d.ts +37 -0
  146. package/dist/types/services/index.d.ts +54 -0
  147. package/dist/types/services/task/AutoWrapup.d.ts +40 -0
  148. package/dist/types/services/task/Task.d.ts +157 -0
  149. package/dist/types/services/task/TaskFactory.d.ts +12 -0
  150. package/dist/types/services/task/TaskManager.d.ts +1 -0
  151. package/dist/types/services/task/TaskUtils.d.ts +138 -0
  152. package/dist/types/services/task/constants.d.ts +91 -0
  153. package/dist/types/services/task/contact.d.ts +69 -0
  154. package/dist/types/services/task/dialer.d.ts +73 -0
  155. package/dist/types/services/task/digital/Digital.d.ts +22 -0
  156. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1194 -0
  157. package/dist/types/services/task/state-machine/actions.d.ts +10 -0
  158. package/dist/types/services/task/state-machine/constants.d.ts +107 -0
  159. package/dist/types/services/task/state-machine/guards.d.ts +102 -0
  160. package/dist/types/services/task/state-machine/index.d.ts +13 -0
  161. package/dist/types/services/task/state-machine/types.d.ts +269 -0
  162. package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
  163. package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
  164. package/dist/types/services/task/types.d.ts +1856 -0
  165. package/dist/types/services/task/voice/Voice.d.ts +184 -0
  166. package/dist/types/services/task/voice/WebRTC.d.ts +53 -0
  167. package/dist/types/types.d.ts +778 -0
  168. package/dist/types/utils/PageCache.d.ts +173 -0
  169. package/dist/types/webex-config.d.ts +53 -0
  170. package/dist/types/webex.d.ts +8 -0
  171. package/dist/types.js +130 -1
  172. package/dist/types.js.map +1 -1
  173. package/dist/webex.js +14 -2
  174. package/dist/webex.js.map +1 -1
  175. package/package.json +16 -12
  176. package/src/cc.ts +477 -51
  177. package/src/config.ts +6 -0
  178. package/src/constants.ts +21 -1
  179. package/src/index.ts +24 -5
  180. package/src/metrics/ai-docs/AGENTS.md +350 -0
  181. package/src/metrics/ai-docs/ARCHITECTURE.md +338 -0
  182. package/src/metrics/ai-docs/metrics-spec.md +854 -0
  183. package/src/metrics/behavioral-events.ts +120 -0
  184. package/src/metrics/constants.ts +37 -3
  185. package/src/services/ApiAiAssistant.ts +412 -0
  186. package/src/services/UserPreference.ts +509 -0
  187. package/src/services/agent/ai-docs/AGENTS.md +240 -0
  188. package/src/services/agent/ai-docs/ARCHITECTURE.md +304 -0
  189. package/src/services/agent/ai-docs/agent-spec.md +504 -0
  190. package/src/services/agent/types.ts +1 -1
  191. package/src/services/ai-docs/AGENTS.md +386 -0
  192. package/src/services/ai-docs/services-spec.md +492 -0
  193. package/src/services/config/Util.ts +10 -2
  194. package/src/services/config/ai-docs/AGENTS.md +255 -0
  195. package/src/services/config/ai-docs/ARCHITECTURE.md +426 -0
  196. package/src/services/config/ai-docs/config-spec.md +669 -0
  197. package/src/services/config/constants.ts +37 -1
  198. package/src/services/config/index.ts +45 -1
  199. package/src/services/config/types.ts +241 -11
  200. package/src/services/constants.ts +29 -0
  201. package/src/services/core/Err.ts +3 -0
  202. package/src/services/core/Utils.ts +143 -30
  203. package/src/services/core/ai-docs/AGENTS.md +381 -0
  204. package/src/services/core/ai-docs/ARCHITECTURE.md +698 -0
  205. package/src/services/core/ai-docs/core-spec.md +783 -0
  206. package/src/services/core/aqm-reqs.ts +100 -22
  207. package/src/services/core/websocket/WebSocketManager.ts +23 -6
  208. package/src/services/core/websocket/connection-service.ts +5 -1
  209. package/src/services/core/websocket/types.ts +1 -1
  210. package/src/services/index.ts +4 -0
  211. package/src/services/task/Task.ts +837 -0
  212. package/src/services/task/TaskFactory.ts +55 -0
  213. package/src/services/task/TaskManager.ts +793 -521
  214. package/src/services/task/TaskUtils.ts +314 -24
  215. package/src/services/task/ai-docs/AGENTS.md +457 -0
  216. package/src/services/task/ai-docs/ARCHITECTURE.md +594 -0
  217. package/src/services/task/ai-docs/task-spec.md +1319 -0
  218. package/src/services/task/constants.ts +23 -0
  219. package/src/services/task/dialer.ts +136 -1
  220. package/src/services/task/digital/Digital.ts +95 -0
  221. package/src/services/task/state-machine/TaskStateMachine.ts +1166 -0
  222. package/src/services/task/state-machine/actions.ts +738 -0
  223. package/src/services/task/state-machine/ai-docs/AGENTS.md +458 -0
  224. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1137 -0
  225. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +2177 -0
  226. package/src/services/task/state-machine/constants.ts +172 -0
  227. package/src/services/task/state-machine/guards.ts +445 -0
  228. package/src/services/task/state-machine/index.ts +28 -0
  229. package/src/services/task/state-machine/types.ts +243 -0
  230. package/src/services/task/state-machine/uiControlsComputer.ts +961 -0
  231. package/src/services/task/taskDataNormalizer.ts +137 -0
  232. package/src/services/task/types.ts +734 -71
  233. package/src/services/task/voice/Voice.ts +1270 -0
  234. package/src/services/task/voice/WebRTC.ts +187 -0
  235. package/src/types.ts +205 -2
  236. package/src/utils/AGENTS.md +278 -0
  237. package/src/utils/ai-docs/utils-spec.md +381 -0
  238. package/src/webex.js +2 -0
  239. package/test/unit/spec/cc.ts +503 -43
  240. package/test/unit/spec/logger-proxy.ts +70 -0
  241. package/test/unit/spec/services/ApiAiAssistant.ts +273 -0
  242. package/test/unit/spec/services/UserPreference.ts +401 -0
  243. package/test/unit/spec/services/WebCallingService.ts +7 -1
  244. package/test/unit/spec/services/config/index.ts +85 -29
  245. package/test/unit/spec/services/core/Utils.ts +481 -2
  246. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +137 -41
  247. package/test/unit/spec/services/core/websocket/connection-service.ts +3 -1
  248. package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
  249. package/test/unit/spec/services/task/Task.ts +477 -0
  250. package/test/unit/spec/services/task/TaskFactory.ts +62 -0
  251. package/test/unit/spec/services/task/TaskManager.ts +1001 -1003
  252. package/test/unit/spec/services/task/TaskUtils.ts +235 -0
  253. package/test/unit/spec/services/task/dialer.ts +372 -96
  254. package/test/unit/spec/services/task/digital/Digital.ts +105 -0
  255. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +2651 -0
  256. package/test/unit/spec/services/task/state-machine/guards.ts +637 -0
  257. package/test/unit/spec/services/task/state-machine/types.ts +18 -0
  258. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +2663 -0
  259. package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
  260. package/test/unit/spec/services/task/voice/Voice.ts +649 -0
  261. package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
  262. package/umd/contact-center.min.js +2 -2
  263. package/umd/contact-center.min.js.map +1 -1
  264. package/dist/services/task/index.js +0 -1525
  265. package/dist/services/task/index.js.map +0 -1
  266. package/src/services/task/index.ts +0 -1801
  267. package/test/unit/spec/services/task/index.ts +0 -2184
@@ -0,0 +1,427 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.UserPreference = void 0;
7
+ var _types = require("../types");
8
+ var _loggerProxy = _interopRequireDefault(require("../logger-proxy"));
9
+ var _WebexRequest = _interopRequireDefault(require("./core/WebexRequest"));
10
+ var _MetricsManager = _interopRequireDefault(require("../metrics/MetricsManager"));
11
+ var _constants = require("./constants");
12
+ var _constants2 = require("./config/constants");
13
+ var _constants3 = require("../metrics/constants");
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ /**
16
+ * UserPreference API class for managing Webex Contact Center user preferences.
17
+ * Provides functionality to get, create, update, and delete user preferences.
18
+ *
19
+ * @class UserPreference
20
+ * @public
21
+ * @example
22
+ * ```typescript
23
+ * import Webex from 'webex';
24
+ *
25
+ * const webex = new Webex({ credentials: 'YOUR_ACCESS_TOKEN' });
26
+ * const cc = webex.cc;
27
+ *
28
+ * // Register and login first
29
+ * await cc.register();
30
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
31
+ *
32
+ * // Get UserPreference API instance from ContactCenter
33
+ * const userPreferenceAPI = cc.userPreference;
34
+ *
35
+ * // Get user preferences for the current user
36
+ * const preferences = await userPreferenceAPI.getUserPreference();
37
+ *
38
+ * // Create new user preferences
39
+ * const newPreferences = await userPreferenceAPI.createUserPreference({
40
+ * userId: 'user123',
41
+ * preferences: { e911Reminder: true }
42
+ * });
43
+ *
44
+ * // Update user preferences
45
+ * const updatedPreferences = await userPreferenceAPI.updateUserPreference('user123', {
46
+ * preferences: { e911Reminder: false }
47
+ * });
48
+ *
49
+ * // Delete user preferences
50
+ * await userPreferenceAPI.deleteUserPreference('user123');
51
+ * ```
52
+ */
53
+ class UserPreference {
54
+ /**
55
+ * Creates an instance of UserPreference
56
+ * @param {WebexSDK} webex - The Webex SDK instance
57
+ * @param {() => string} getUserId - Function to get the current user's CI user ID
58
+ * @public
59
+ */
60
+ constructor(webex, getUserId) {
61
+ this.webex = webex;
62
+ this.webexRequest = _WebexRequest.default.getInstance({
63
+ webex
64
+ });
65
+ this.getUserId = getUserId;
66
+ this.metricsManager = _MetricsManager.default.getInstance({
67
+ webex
68
+ });
69
+ }
70
+
71
+ /**
72
+ * Fetches user preferences for a specific user
73
+ * @param {GetUserPreferenceParams} [params] - Optional parameters for fetching preferences
74
+ * @param {string} [params.userId] - User ID to fetch preferences for. Defaults to current user's CI user ID.
75
+ * @param {number} [params.page=0] - Page number (0-indexed). Default: 0
76
+ * @param {number} [params.pageSize=100] - Number of items per page. Default: 100
77
+ * @returns {Promise<UserPreferenceResponse>} Promise resolving to user preferences
78
+ * @throws {Error} If the API call fails
79
+ * @public
80
+ * @example
81
+ * ```typescript
82
+ * // Get preferences for current user
83
+ * const preferences = await userPreferenceAPI.getUserPreference();
84
+ *
85
+ * // Get preferences for a specific user
86
+ * const preferences = await userPreferenceAPI.getUserPreference({ userId: 'user123' });
87
+ *
88
+ * // Get preferences with pagination
89
+ * const preferences = await userPreferenceAPI.getUserPreference({ page: 0, pageSize: 50 });
90
+ * ```
91
+ */
92
+ async getUserPreference(params) {
93
+ const {
94
+ userId,
95
+ page,
96
+ pageSize
97
+ } = params || {};
98
+ const targetUserId = userId || this.getUserId();
99
+ const orgId = this.webex.credentials.getOrgId();
100
+ _loggerProxy.default.info('Fetching user preferences', {
101
+ module: 'UserPreference',
102
+ method: 'getUserPreference',
103
+ data: {
104
+ orgId,
105
+ userId: targetUserId,
106
+ page,
107
+ pageSize
108
+ }
109
+ });
110
+ if (!targetUserId) {
111
+ _loggerProxy.default.error('getUserPreference called without a valid userId', {
112
+ module: 'UserPreference',
113
+ method: 'getUserPreference',
114
+ data: {
115
+ orgId,
116
+ userId: targetUserId,
117
+ error: 'Missing userId. Ensure user is logged in or provide a userId.'
118
+ }
119
+ });
120
+ throw new Error('UserPreference: userId is not available.');
121
+ }
122
+ try {
123
+ let resource = _constants2.endPointMap.userPreference(orgId, targetUserId);
124
+
125
+ // Build query parameters if provided
126
+ const queryParams = [];
127
+ if (page !== undefined) queryParams.push(`page=${page}`);
128
+ if (pageSize !== undefined) queryParams.push(`pageSize=${pageSize}`);
129
+ if (queryParams.length > 0) {
130
+ resource = `${resource}?${queryParams.join('&')}`;
131
+ }
132
+ _loggerProxy.default.info('Making API request to fetch user preferences', {
133
+ module: 'UserPreference',
134
+ method: 'getUserPreference',
135
+ data: {
136
+ resource,
137
+ service: _constants.WCC_API_GATEWAY
138
+ }
139
+ });
140
+ this.metricsManager.timeEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_GET_SUCCESS);
141
+ this.metricsManager.timeEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_GET_FAILED);
142
+ const response = await this.webexRequest.request({
143
+ service: _constants.WCC_API_GATEWAY,
144
+ resource,
145
+ method: _types.HTTP_METHODS.GET
146
+ });
147
+ _loggerProxy.default.info('Successfully retrieved user preferences', {
148
+ module: 'UserPreference',
149
+ method: 'getUserPreference',
150
+ data: {
151
+ statusCode: response.statusCode,
152
+ userId: targetUserId
153
+ }
154
+ });
155
+ this.metricsManager.trackEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_GET_SUCCESS, {
156
+ orgId,
157
+ userId: targetUserId,
158
+ statusCode: response.statusCode
159
+ }, ['behavioral', 'operational']);
160
+ return response.body;
161
+ } catch (error) {
162
+ const errorData = {
163
+ orgId,
164
+ userId: targetUserId,
165
+ error: error instanceof Error ? error.message : String(error)
166
+ };
167
+ _loggerProxy.default.error('Failed to fetch user preferences', {
168
+ module: 'UserPreference',
169
+ method: 'getUserPreference',
170
+ data: errorData,
171
+ error
172
+ });
173
+ this.metricsManager.trackEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_GET_FAILED, errorData, ['behavioral', 'operational']);
174
+ throw error;
175
+ }
176
+ }
177
+
178
+ /**
179
+ * Creates new user preferences
180
+ * @param {CreateUserPreferenceRequest} data - The user preference data to create
181
+ * @returns {Promise<UserPreference>} Promise resolving to created user preferences
182
+ * @throws {Error} If the API call fails
183
+ * @public
184
+ * @example
185
+ * ```typescript
186
+ * const newPreferences = await userPreferenceAPI.createUserPreference({
187
+ * userId: 'user123',
188
+ * preferences: { e911Reminder: true, notificationSettings: { email: true } }
189
+ * });
190
+ * ```
191
+ */
192
+ async createUserPreference(data) {
193
+ const orgId = this.webex.credentials.getOrgId();
194
+ _loggerProxy.default.info('Creating user preferences', {
195
+ module: 'UserPreference',
196
+ method: 'createUserPreference',
197
+ data: {
198
+ orgId,
199
+ userId: data.userId
200
+ }
201
+ });
202
+ if (!data.userId) {
203
+ _loggerProxy.default.error('createUserPreference called without a valid userId', {
204
+ module: 'UserPreference',
205
+ method: 'createUserPreference',
206
+ data: {
207
+ orgId,
208
+ error: 'Missing userId in request data.'
209
+ }
210
+ });
211
+ throw new Error('UserPreference: userId is required to create user preferences.');
212
+ }
213
+ try {
214
+ const resource = _constants2.endPointMap.userPreferenceCreate(orgId);
215
+ _loggerProxy.default.info('Making API request to create user preferences', {
216
+ module: 'UserPreference',
217
+ method: 'createUserPreference',
218
+ data: {
219
+ resource,
220
+ service: _constants.WCC_API_GATEWAY
221
+ }
222
+ });
223
+ this.metricsManager.timeEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_CREATE_SUCCESS);
224
+ this.metricsManager.timeEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_CREATE_FAILED);
225
+ const response = await this.webexRequest.request({
226
+ service: _constants.WCC_API_GATEWAY,
227
+ resource,
228
+ method: _types.HTTP_METHODS.POST,
229
+ body: data
230
+ });
231
+ _loggerProxy.default.info('Successfully created user preferences', {
232
+ module: 'UserPreference',
233
+ method: 'createUserPreference',
234
+ data: {
235
+ statusCode: response.statusCode,
236
+ userId: data.userId
237
+ }
238
+ });
239
+ this.metricsManager.trackEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_CREATE_SUCCESS, {
240
+ orgId,
241
+ userId: data.userId,
242
+ statusCode: response.statusCode
243
+ }, ['behavioral', 'operational']);
244
+ return response.body;
245
+ } catch (error) {
246
+ const errorData = {
247
+ orgId,
248
+ userId: data.userId,
249
+ error: error instanceof Error ? error.message : String(error)
250
+ };
251
+ _loggerProxy.default.error('Failed to create user preferences', {
252
+ module: 'UserPreference',
253
+ method: 'createUserPreference',
254
+ data: errorData,
255
+ error
256
+ });
257
+ this.metricsManager.trackEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_CREATE_FAILED, errorData, ['behavioral', 'operational']);
258
+ throw error;
259
+ }
260
+ }
261
+
262
+ /**
263
+ * Updates existing user preferences
264
+ * @param {string} userId - User ID to update preferences for
265
+ * @param {UpdateUserPreferenceRequest} data - The user preference data to update
266
+ * @returns {Promise<UserPreference>} Promise resolving to updated user preferences
267
+ * @throws {Error} If the API call fails
268
+ * @public
269
+ * @example
270
+ * ```typescript
271
+ * const updatedPreferences = await userPreferenceAPI.updateUserPreference('user123', {
272
+ * preferences: { e911Reminder: false }
273
+ * });
274
+ * ```
275
+ */
276
+ async updateUserPreference(userId, data) {
277
+ const orgId = this.webex.credentials.getOrgId();
278
+ _loggerProxy.default.info('Updating user preferences', {
279
+ module: 'UserPreference',
280
+ method: 'updateUserPreference',
281
+ data: {
282
+ orgId,
283
+ userId
284
+ }
285
+ });
286
+ if (!userId) {
287
+ _loggerProxy.default.error('updateUserPreference called without a valid userId', {
288
+ module: 'UserPreference',
289
+ method: 'updateUserPreference',
290
+ data: {
291
+ orgId,
292
+ error: 'Missing userId parameter.'
293
+ }
294
+ });
295
+ throw new Error('UserPreference: userId is required to update user preferences.');
296
+ }
297
+ try {
298
+ const resource = _constants2.endPointMap.userPreference(orgId, userId);
299
+ _loggerProxy.default.info('Making API request to update user preferences', {
300
+ module: 'UserPreference',
301
+ method: 'updateUserPreference',
302
+ data: {
303
+ resource,
304
+ service: _constants.WCC_API_GATEWAY
305
+ }
306
+ });
307
+ this.metricsManager.timeEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_UPDATE_SUCCESS);
308
+ this.metricsManager.timeEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_UPDATE_FAILED);
309
+ const response = await this.webexRequest.request({
310
+ service: _constants.WCC_API_GATEWAY,
311
+ resource,
312
+ method: _types.HTTP_METHODS.PUT,
313
+ body: data
314
+ });
315
+ _loggerProxy.default.info('Successfully updated user preferences', {
316
+ module: 'UserPreference',
317
+ method: 'updateUserPreference',
318
+ data: {
319
+ statusCode: response.statusCode,
320
+ userId
321
+ }
322
+ });
323
+ this.metricsManager.trackEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_UPDATE_SUCCESS, {
324
+ orgId,
325
+ userId,
326
+ statusCode: response.statusCode
327
+ }, ['behavioral', 'operational']);
328
+ return response.body;
329
+ } catch (error) {
330
+ const errorData = {
331
+ orgId,
332
+ userId,
333
+ error: error instanceof Error ? error.message : String(error)
334
+ };
335
+ _loggerProxy.default.error('Failed to update user preferences', {
336
+ module: 'UserPreference',
337
+ method: 'updateUserPreference',
338
+ data: errorData,
339
+ error
340
+ });
341
+ this.metricsManager.trackEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_UPDATE_FAILED, errorData, ['behavioral', 'operational']);
342
+ throw error;
343
+ }
344
+ }
345
+
346
+ /**
347
+ * Deletes user preferences for a specific user
348
+ * @param {string} userId - User ID to delete preferences for
349
+ * @returns {Promise<void>} Promise resolving when deletion is complete
350
+ * @throws {Error} If the API call fails
351
+ * @public
352
+ * @example
353
+ * ```typescript
354
+ * await userPreferenceAPI.deleteUserPreference('user123');
355
+ * ```
356
+ */
357
+ async deleteUserPreference(userId) {
358
+ const orgId = this.webex.credentials.getOrgId();
359
+ _loggerProxy.default.info('Deleting user preferences', {
360
+ module: 'UserPreference',
361
+ method: 'deleteUserPreference',
362
+ data: {
363
+ orgId,
364
+ userId
365
+ }
366
+ });
367
+ if (!userId) {
368
+ _loggerProxy.default.error('deleteUserPreference called without a valid userId', {
369
+ module: 'UserPreference',
370
+ method: 'deleteUserPreference',
371
+ data: {
372
+ orgId,
373
+ error: 'Missing userId parameter.'
374
+ }
375
+ });
376
+ throw new Error('UserPreference: userId is required to delete user preferences.');
377
+ }
378
+ try {
379
+ const resource = _constants2.endPointMap.userPreference(orgId, userId);
380
+ _loggerProxy.default.info('Making API request to delete user preferences', {
381
+ module: 'UserPreference',
382
+ method: 'deleteUserPreference',
383
+ data: {
384
+ resource,
385
+ service: _constants.WCC_API_GATEWAY
386
+ }
387
+ });
388
+ this.metricsManager.timeEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_DELETE_SUCCESS);
389
+ this.metricsManager.timeEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_DELETE_FAILED);
390
+ const response = await this.webexRequest.request({
391
+ service: _constants.WCC_API_GATEWAY,
392
+ resource,
393
+ method: _types.HTTP_METHODS.DELETE
394
+ });
395
+ _loggerProxy.default.info('Successfully deleted user preferences', {
396
+ module: 'UserPreference',
397
+ method: 'deleteUserPreference',
398
+ data: {
399
+ statusCode: response.statusCode,
400
+ userId
401
+ }
402
+ });
403
+ this.metricsManager.trackEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_DELETE_SUCCESS, {
404
+ orgId,
405
+ userId,
406
+ statusCode: response.statusCode
407
+ }, ['behavioral', 'operational']);
408
+ } catch (error) {
409
+ const errorData = {
410
+ orgId,
411
+ userId,
412
+ error: error instanceof Error ? error.message : String(error)
413
+ };
414
+ _loggerProxy.default.error('Failed to delete user preferences', {
415
+ module: 'UserPreference',
416
+ method: 'deleteUserPreference',
417
+ data: errorData,
418
+ error
419
+ });
420
+ this.metricsManager.trackEvent(_constants3.METRIC_EVENT_NAMES.USER_PREFERENCE_DELETE_FAILED, errorData, ['behavioral', 'operational']);
421
+ throw error;
422
+ }
423
+ }
424
+ }
425
+ exports.UserPreference = UserPreference;
426
+ var _default = exports.default = UserPreference;
427
+ //# sourceMappingURL=UserPreference.js.map
@@ -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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AA,GAAAA,cAAA;AAAA,IAAA+D,QAAA,GAAAD,OAAA,CAAA/D,OAAA,GAEcC,cAAc","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,7 +179,7 @@ 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,
@@ -196,7 +199,8 @@ function parseAgentConfigs(profileData) {
196
199
  maskSensitiveData: orgSettingsData.maskSensitiveData ? orgSettingsData.maskSensitiveData : false,
197
200
  microsoftConfig: getMsftConfig(agentProfileData),
198
201
  webexConfig: getWebexConfig(agentProfileData),
199
- lostConnectionRecoveryTimeout: tenantData.lostConnectionRecoveryTimeout || _constants.LOST_CONNECTION_RECOVERY_TIMEOUT
202
+ lostConnectionRecoveryTimeout: tenantData.lostConnectionRecoveryTimeout || _constants.LOST_CONNECTION_RECOVERY_TIMEOUT,
203
+ aiFeature
200
204
  };
201
205
  return finalData;
202
206
  }