@webex/contact-center 3.12.0-next.9 → 3.12.0-next.90

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 (229) hide show
  1. package/.sdd/manifest.json +876 -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 +265 -29
  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 +17 -1
  44. package/dist/constants.js.map +1 -1
  45. package/dist/index.js +20 -5
  46. package/dist/index.js.map +1 -1
  47. package/dist/metrics/behavioral-events.js +101 -0
  48. package/dist/metrics/behavioral-events.js.map +1 -1
  49. package/dist/metrics/constants.js +25 -4
  50. package/dist/metrics/constants.js.map +1 -1
  51. package/dist/services/ApiAiAssistant.js +153 -8
  52. package/dist/services/ApiAiAssistant.js.map +1 -1
  53. package/dist/services/UserPreference.js +427 -0
  54. package/dist/services/UserPreference.js.map +1 -0
  55. package/dist/services/config/Util.js +3 -3
  56. package/dist/services/config/Util.js.map +1 -1
  57. package/dist/services/config/constants.js +23 -2
  58. package/dist/services/config/constants.js.map +1 -1
  59. package/dist/services/config/types.js +49 -9
  60. package/dist/services/config/types.js.map +1 -1
  61. package/dist/services/core/Err.js.map +1 -1
  62. package/dist/services/core/Utils.js +107 -32
  63. package/dist/services/core/Utils.js.map +1 -1
  64. package/dist/services/core/websocket/WebSocketManager.js +2 -1
  65. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  66. package/dist/services/core/websocket/types.js.map +1 -1
  67. package/dist/services/index.js +1 -1
  68. package/dist/services/index.js.map +1 -1
  69. package/dist/services/task/Task.js +688 -0
  70. package/dist/services/task/Task.js.map +1 -0
  71. package/dist/services/task/TaskFactory.js +45 -0
  72. package/dist/services/task/TaskFactory.js.map +1 -0
  73. package/dist/services/task/TaskManager.js +728 -527
  74. package/dist/services/task/TaskManager.js.map +1 -1
  75. package/dist/services/task/TaskUtils.js +162 -26
  76. package/dist/services/task/TaskUtils.js.map +1 -1
  77. package/dist/services/task/constants.js +9 -2
  78. package/dist/services/task/constants.js.map +1 -1
  79. package/dist/services/task/dialer.js +78 -0
  80. package/dist/services/task/dialer.js.map +1 -1
  81. package/dist/services/task/digital/Digital.js +77 -0
  82. package/dist/services/task/digital/Digital.js.map +1 -0
  83. package/dist/services/task/state-machine/TaskStateMachine.js +837 -0
  84. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
  85. package/dist/services/task/state-machine/actions.js +543 -0
  86. package/dist/services/task/state-machine/actions.js.map +1 -0
  87. package/dist/services/task/state-machine/constants.js +161 -0
  88. package/dist/services/task/state-machine/constants.js.map +1 -0
  89. package/dist/services/task/state-machine/guards.js +340 -0
  90. package/dist/services/task/state-machine/guards.js.map +1 -0
  91. package/dist/services/task/state-machine/index.js +53 -0
  92. package/dist/services/task/state-machine/index.js.map +1 -0
  93. package/dist/services/task/state-machine/types.js +54 -0
  94. package/dist/services/task/state-machine/types.js.map +1 -0
  95. package/dist/services/task/state-machine/uiControlsComputer.js +553 -0
  96. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
  97. package/dist/services/task/taskDataNormalizer.js +99 -0
  98. package/dist/services/task/taskDataNormalizer.js.map +1 -0
  99. package/dist/services/task/types.js +212 -4
  100. package/dist/services/task/types.js.map +1 -1
  101. package/dist/services/task/voice/Voice.js +1042 -0
  102. package/dist/services/task/voice/Voice.js.map +1 -0
  103. package/dist/services/task/voice/WebRTC.js +149 -0
  104. package/dist/services/task/voice/WebRTC.js.map +1 -0
  105. package/dist/types/cc.d.ts +94 -1
  106. package/dist/types/config.d.ts +6 -0
  107. package/dist/types/constants.d.ts +17 -1
  108. package/dist/types/index.d.ts +21 -6
  109. package/dist/types/metrics/constants.d.ts +21 -1
  110. package/dist/types/services/ApiAiAssistant.d.ts +22 -4
  111. package/dist/types/services/UserPreference.d.ts +118 -0
  112. package/dist/types/services/config/constants.d.ts +21 -0
  113. package/dist/types/services/config/types.d.ts +171 -10
  114. package/dist/types/services/core/Err.d.ts +4 -0
  115. package/dist/types/services/core/Utils.d.ts +33 -13
  116. package/dist/types/services/core/websocket/WebSocketManager.d.ts +1 -0
  117. package/dist/types/services/core/websocket/types.d.ts +1 -1
  118. package/dist/types/services/index.d.ts +1 -1
  119. package/dist/types/services/task/Task.d.ts +157 -0
  120. package/dist/types/services/task/TaskFactory.d.ts +12 -0
  121. package/dist/types/services/task/TaskUtils.d.ts +46 -2
  122. package/dist/types/services/task/constants.d.ts +7 -0
  123. package/dist/types/services/task/dialer.d.ts +30 -0
  124. package/dist/types/services/task/digital/Digital.d.ts +22 -0
  125. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1144 -0
  126. package/dist/types/services/task/state-machine/actions.d.ts +10 -0
  127. package/dist/types/services/task/state-machine/constants.d.ts +107 -0
  128. package/dist/types/services/task/state-machine/guards.d.ts +90 -0
  129. package/dist/types/services/task/state-machine/index.d.ts +13 -0
  130. package/dist/types/services/task/state-machine/types.d.ts +267 -0
  131. package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
  132. package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
  133. package/dist/types/services/task/types.d.ts +603 -66
  134. package/dist/types/services/task/voice/Voice.d.ts +184 -0
  135. package/dist/types/services/task/voice/WebRTC.d.ts +53 -0
  136. package/dist/types/types.d.ts +135 -0
  137. package/dist/types/webex.d.ts +1 -0
  138. package/dist/types.js +118 -2
  139. package/dist/types.js.map +1 -1
  140. package/dist/webex.js +14 -2
  141. package/dist/webex.js.map +1 -1
  142. package/package.json +15 -12
  143. package/src/cc.ts +329 -30
  144. package/src/config.ts +6 -0
  145. package/src/constants.ts +17 -1
  146. package/src/index.ts +23 -5
  147. package/src/metrics/ai-docs/AGENTS.md +350 -0
  148. package/src/metrics/ai-docs/ARCHITECTURE.md +338 -0
  149. package/src/metrics/ai-docs/metrics-spec.md +854 -0
  150. package/src/metrics/behavioral-events.ts +106 -0
  151. package/src/metrics/constants.ts +27 -4
  152. package/src/services/ApiAiAssistant.ts +203 -8
  153. package/src/services/UserPreference.ts +509 -0
  154. package/src/services/agent/ai-docs/AGENTS.md +240 -0
  155. package/src/services/agent/ai-docs/ARCHITECTURE.md +304 -0
  156. package/src/services/agent/ai-docs/agent-spec.md +504 -0
  157. package/src/services/ai-docs/AGENTS.md +386 -0
  158. package/src/services/ai-docs/services-spec.md +492 -0
  159. package/src/services/config/Util.ts +3 -3
  160. package/src/services/config/ai-docs/AGENTS.md +255 -0
  161. package/src/services/config/ai-docs/ARCHITECTURE.md +426 -0
  162. package/src/services/config/ai-docs/config-spec.md +669 -0
  163. package/src/services/config/constants.ts +25 -1
  164. package/src/services/config/types.ts +174 -11
  165. package/src/services/core/Err.ts +2 -0
  166. package/src/services/core/Utils.ts +123 -37
  167. package/src/services/core/ai-docs/AGENTS.md +381 -0
  168. package/src/services/core/ai-docs/ARCHITECTURE.md +698 -0
  169. package/src/services/core/ai-docs/core-spec.md +783 -0
  170. package/src/services/core/websocket/WebSocketManager.ts +2 -0
  171. package/src/services/core/websocket/types.ts +1 -1
  172. package/src/services/index.ts +1 -1
  173. package/src/services/task/Task.ts +837 -0
  174. package/src/services/task/TaskFactory.ts +55 -0
  175. package/src/services/task/TaskManager.ts +739 -614
  176. package/src/services/task/TaskUtils.ts +205 -25
  177. package/src/services/task/ai-docs/AGENTS.md +457 -0
  178. package/src/services/task/ai-docs/ARCHITECTURE.md +594 -0
  179. package/src/services/task/ai-docs/task-spec.md +1319 -0
  180. package/src/services/task/constants.ts +7 -0
  181. package/src/services/task/dialer.ts +80 -0
  182. package/src/services/task/digital/Digital.ts +95 -0
  183. package/src/services/task/state-machine/TaskStateMachine.ts +1077 -0
  184. package/src/services/task/state-machine/actions.ts +685 -0
  185. package/src/services/task/state-machine/ai-docs/AGENTS.md +458 -0
  186. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1137 -0
  187. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +2115 -0
  188. package/src/services/task/state-machine/constants.ts +172 -0
  189. package/src/services/task/state-machine/guards.ts +406 -0
  190. package/src/services/task/state-machine/index.ts +28 -0
  191. package/src/services/task/state-machine/types.ts +241 -0
  192. package/src/services/task/state-machine/uiControlsComputer.ts +867 -0
  193. package/src/services/task/taskDataNormalizer.ts +137 -0
  194. package/src/services/task/types.ts +710 -71
  195. package/src/services/task/voice/Voice.ts +1267 -0
  196. package/src/services/task/voice/WebRTC.ts +187 -0
  197. package/src/types.ts +166 -2
  198. package/src/utils/AGENTS.md +278 -0
  199. package/src/utils/ai-docs/utils-spec.md +381 -0
  200. package/src/webex.js +2 -0
  201. package/test/unit/spec/cc.ts +343 -23
  202. package/test/unit/spec/logger-proxy.ts +70 -0
  203. package/test/unit/spec/services/ApiAiAssistant.ts +178 -20
  204. package/test/unit/spec/services/UserPreference.ts +401 -0
  205. package/test/unit/spec/services/WebCallingService.ts +7 -1
  206. package/test/unit/spec/services/config/index.ts +30 -30
  207. package/test/unit/spec/services/core/Utils.ts +425 -8
  208. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +66 -40
  209. package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
  210. package/test/unit/spec/services/task/Task.ts +477 -0
  211. package/test/unit/spec/services/task/TaskFactory.ts +62 -0
  212. package/test/unit/spec/services/task/TaskManager.ts +834 -1704
  213. package/test/unit/spec/services/task/TaskUtils.ts +206 -0
  214. package/test/unit/spec/services/task/dialer.ts +190 -0
  215. package/test/unit/spec/services/task/digital/Digital.ts +105 -0
  216. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +1825 -0
  217. package/test/unit/spec/services/task/state-machine/guards.ts +479 -0
  218. package/test/unit/spec/services/task/state-machine/types.ts +18 -0
  219. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +2020 -0
  220. package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
  221. package/test/unit/spec/services/task/voice/Voice.ts +631 -0
  222. package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
  223. package/umd/contact-center.min.js +2 -2
  224. package/umd/contact-center.min.js.map +1 -1
  225. package/dist/services/task/index.js +0 -1525
  226. package/dist/services/task/index.js.map +0 -1
  227. package/dist/types/services/task/index.d.ts +0 -650
  228. package/src/services/task/index.ts +0 -1801
  229. 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;AACA;AACA;AACA;AACA;AACA;A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A+D,QAAA,GAAAD,OAAA,CAAA/D,OAAA,GAEcC,cAAc","ignoreList":[]}
@@ -133,10 +133,10 @@ function parseAgentConfigs(profileData) {
133
133
  }); // pushing available state to idle codes
134
134
 
135
135
  const defaultWrapUpData = getDefaultWrapUpCode(wrapupCodes);
136
- const aiFeature = aiFeatureFlags?.data && aiFeatureFlags.data.length > 0 ? aiFeatureFlags.data[0] : undefined;
136
+ const aiFeature = aiFeatureFlags?.data?.length > 0 ? aiFeatureFlags.data[0] : undefined;
137
137
  const finalData = {
138
138
  teams: teamData,
139
- defaultDn: userData.defaultDialledNumber,
139
+ defaultDn: userData.deafultDialledNumber,
140
140
  forceDefaultDn: tenantData.forceDefaultDn,
141
141
  forceDefaultDnForAgent: getDefaultAgentDN(agentProfileData.agentDNValidation),
142
142
  regexUS: tenantData.dnDefaultRegex,
@@ -179,7 +179,7 @@ function parseAgentConfigs(profileData) {
179
179
  isAgentAvailableAfterOutdial: agentProfileData.agentAvailableAfterOutdial,
180
180
  outDialEp: agentProfileData.outdialEntryPointId,
181
181
  isCampaignManagementEnabled: orgSettingsData.campaignManagerEnabled,
182
- isEndCallEnabled: tenantData.endCallEnabled,
182
+ isEndTaskEnabled: tenantData.endCallEnabled,
183
183
  isEndConsultEnabled: tenantData.endConsultEnabled,
184
184
  callVariablesSuppressed: tenantData.callVariablesSuppressed,
185
185
  agentDbId: userData.dbId,
@@ -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","aiFeatureFlags","tenantDataTimeout","timeoutDesktopInactivityEnabled","timeoutDesktopInactivityMins","inactivityTimeoutTimer","timeoutDesktopInactivityCustomEnabled","wrapupCodes","WRAP_UP_CODE","accessWrapUpCode","wrapUpCodes","idleCodes","IDLE_CODE","accessIdleCode","defaultWrapUpData","aiFeature","data","undefined","finalData","teams","defaultDn","defaultDialledNumber","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","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 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 && aiFeatureFlags.data.length > 0 ? aiFeatureFlags.data[0] : undefined;\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 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 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 aiFeature,\n };\n\n return finalData;\n}\n\nexport {parseAgentCon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AAIC,2CAAgC;IAC9EpF;EACF,CAAC;EAED,OAAOG,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","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 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,I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U,CAACM,+BAA+B;IAC7EC,4BAA4B,EAAEC,sBAAsB;IACpDwF,iBAAiB,EAAE1I,gBAAgB,CAAC0I,iBAAiB,IAAI,EAAE;IAC3DC,aAAa,EAAE/F,eAAe,CAAC+F,aAAa;IAC5CC,iBAAiB,EAAEhG,eAAe,CAACgG,iBAAiB,GAChDhG,eAAe,CAACgG,iBAAiB,GACjC,KAAK;IACTC,eAAe,EAAE9I,aAAa,CAACC,gBAAgB,CAAC;IAChD8I,WAAW,EAAE3I,cAAc,CAACH,gBAAgB,CAAC;IAC7C+I,6BAA6B,EAC3BrG,UAAU,CAACqG,6BAA6B,IAAIC,2CAAgC;IAC9EpF;EACF,CAAC;EAED,OAAOG,SAAS;AAClB","ignoreList":[]}
@@ -145,7 +145,7 @@ const endPointMap = exports.endPointMap = {
145
145
  * const url = endPointMap.listAuxCodes('org123', 0, 100, ['aux1'], ['id', 'name']);
146
146
  * @ignore
147
147
  */
148
- listAuxCodes: (orgId, page, pageSize, filter, attributes) => `organization/${orgId}/v2/auxiliary-code?page=${page}&pageSize=${pageSize}${filter && filter.length > 0 ? `&filter=id=in=(${filter})` : ''}&attributes=${attributes}`,
148
+ listAuxCodes: (orgId, page, pageSize, filter, attributes) => `organization/${orgId}/v2/auxiliary-code?page=${page}&pageSize=${pageSize}${filter && filter.length > 0 ? `&filter=id=in=(${filter})` : ''}&attributes=${attributes}&desktopProfileFilter=true`,
149
149
  /**
150
150
  * Gets the endpoint for organization info.
151
151
  * @param orgId - Organization ID.
@@ -262,6 +262,27 @@ const endPointMap = exports.endPointMap = {
262
262
  * const url = endPointMap.outdialAniEntries('org123', 'ani456', 'page=0&pageSize=10');
263
263
  * @ignore
264
264
  */
265
- outdialAniEntries: (orgId, outdialANI, queryParams) => `organization/${orgId}/v2/outdial-ani/${outdialANI}/entry${queryParams ? `?${queryParams}` : ''}`
265
+ outdialAniEntries: (orgId, outdialANI, queryParams) => `organization/${orgId}/v2/outdial-ani/${outdialANI}/entry${queryParams ? `?${queryParams}` : ''}`,
266
+ /**
267
+ * Gets the endpoint for user preference by user ID.
268
+ * @param orgId - Organization ID.
269
+ * @param userId - User ID.
270
+ * @returns The endpoint URL string.
271
+ * @public
272
+ * @example
273
+ * const url = endPointMap.userPreference('org123', 'user456');
274
+ * @ignore
275
+ */
276
+ userPreference: (orgId, userId) => `organization/${orgId}/user-preference/${userId}`,
277
+ /**
278
+ * Gets the endpoint for creating user preference.
279
+ * @param orgId - Organization ID.
280
+ * @returns The endpoint URL string.
281
+ * @public
282
+ * @example
283
+ * const url = endPointMap.userPreferenceCreate('org123');
284
+ * @ignore
285
+ */
286
+ userPreferenceCreate: orgId => `organization/${orgId}/user-preference`
266
287
  };
267
288
  //# sourceMappingURL=constants.js.map