@webex/contact-center 0.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/README.md +81 -0
  2. package/__mocks__/workerMock.js +15 -0
  3. package/babel.config.js +15 -0
  4. package/dist/cc.js +1416 -0
  5. package/dist/cc.js.map +1 -0
  6. package/dist/config.js +72 -0
  7. package/dist/config.js.map +1 -0
  8. package/dist/constants.js +58 -0
  9. package/dist/constants.js.map +1 -0
  10. package/dist/index.js +142 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/logger-proxy.js +115 -0
  13. package/dist/logger-proxy.js.map +1 -0
  14. package/dist/metrics/MetricsManager.js +474 -0
  15. package/dist/metrics/MetricsManager.js.map +1 -0
  16. package/dist/metrics/behavioral-events.js +322 -0
  17. package/dist/metrics/behavioral-events.js.map +1 -0
  18. package/dist/metrics/constants.js +134 -0
  19. package/dist/metrics/constants.js.map +1 -0
  20. package/dist/services/WebCallingService.js +323 -0
  21. package/dist/services/WebCallingService.js.map +1 -0
  22. package/dist/services/agent/index.js +177 -0
  23. package/dist/services/agent/index.js.map +1 -0
  24. package/dist/services/agent/types.js +137 -0
  25. package/dist/services/agent/types.js.map +1 -0
  26. package/dist/services/config/Util.js +203 -0
  27. package/dist/services/config/Util.js.map +1 -0
  28. package/dist/services/config/constants.js +221 -0
  29. package/dist/services/config/constants.js.map +1 -0
  30. package/dist/services/config/index.js +607 -0
  31. package/dist/services/config/index.js.map +1 -0
  32. package/dist/services/config/types.js +334 -0
  33. package/dist/services/config/types.js.map +1 -0
  34. package/dist/services/constants.js +117 -0
  35. package/dist/services/constants.js.map +1 -0
  36. package/dist/services/core/Err.js +43 -0
  37. package/dist/services/core/Err.js.map +1 -0
  38. package/dist/services/core/GlobalTypes.js +6 -0
  39. package/dist/services/core/GlobalTypes.js.map +1 -0
  40. package/dist/services/core/Utils.js +126 -0
  41. package/dist/services/core/Utils.js.map +1 -0
  42. package/dist/services/core/WebexRequest.js +96 -0
  43. package/dist/services/core/WebexRequest.js.map +1 -0
  44. package/dist/services/core/aqm-reqs.js +246 -0
  45. package/dist/services/core/aqm-reqs.js.map +1 -0
  46. package/dist/services/core/constants.js +109 -0
  47. package/dist/services/core/constants.js.map +1 -0
  48. package/dist/services/core/types.js +6 -0
  49. package/dist/services/core/types.js.map +1 -0
  50. package/dist/services/core/websocket/WebSocketManager.js +187 -0
  51. package/dist/services/core/websocket/WebSocketManager.js.map +1 -0
  52. package/dist/services/core/websocket/connection-service.js +111 -0
  53. package/dist/services/core/websocket/connection-service.js.map +1 -0
  54. package/dist/services/core/websocket/keepalive.worker.js +94 -0
  55. package/dist/services/core/websocket/keepalive.worker.js.map +1 -0
  56. package/dist/services/core/websocket/types.js +6 -0
  57. package/dist/services/core/websocket/types.js.map +1 -0
  58. package/dist/services/index.js +78 -0
  59. package/dist/services/index.js.map +1 -0
  60. package/dist/services/task/AutoWrapup.js +88 -0
  61. package/dist/services/task/AutoWrapup.js.map +1 -0
  62. package/dist/services/task/TaskManager.js +369 -0
  63. package/dist/services/task/TaskManager.js.map +1 -0
  64. package/dist/services/task/constants.js +58 -0
  65. package/dist/services/task/constants.js.map +1 -0
  66. package/dist/services/task/contact.js +464 -0
  67. package/dist/services/task/contact.js.map +1 -0
  68. package/dist/services/task/dialer.js +60 -0
  69. package/dist/services/task/dialer.js.map +1 -0
  70. package/dist/services/task/index.js +1188 -0
  71. package/dist/services/task/index.js.map +1 -0
  72. package/dist/services/task/types.js +214 -0
  73. package/dist/services/task/types.js.map +1 -0
  74. package/dist/types/cc.d.ts +676 -0
  75. package/dist/types/config.d.ts +66 -0
  76. package/dist/types/constants.d.ts +45 -0
  77. package/dist/types/index.d.ts +178 -0
  78. package/dist/types/logger-proxy.d.ts +71 -0
  79. package/dist/types/metrics/MetricsManager.d.ts +223 -0
  80. package/dist/types/metrics/behavioral-events.d.ts +29 -0
  81. package/dist/types/metrics/constants.d.ts +127 -0
  82. package/dist/types/services/WebCallingService.d.ts +1 -0
  83. package/dist/types/services/agent/index.d.ts +46 -0
  84. package/dist/types/services/agent/types.d.ts +413 -0
  85. package/dist/types/services/config/Util.d.ts +19 -0
  86. package/dist/types/services/config/constants.d.ts +203 -0
  87. package/dist/types/services/config/index.d.ts +171 -0
  88. package/dist/types/services/config/types.d.ts +1113 -0
  89. package/dist/types/services/constants.d.ts +97 -0
  90. package/dist/types/services/core/Err.d.ts +119 -0
  91. package/dist/types/services/core/GlobalTypes.d.ts +33 -0
  92. package/dist/types/services/core/Utils.d.ts +36 -0
  93. package/dist/types/services/core/WebexRequest.d.ts +22 -0
  94. package/dist/types/services/core/aqm-reqs.d.ts +16 -0
  95. package/dist/types/services/core/constants.d.ts +85 -0
  96. package/dist/types/services/core/types.d.ts +47 -0
  97. package/dist/types/services/core/websocket/WebSocketManager.d.ts +34 -0
  98. package/dist/types/services/core/websocket/connection-service.d.ts +27 -0
  99. package/dist/types/services/core/websocket/keepalive.worker.d.ts +2 -0
  100. package/dist/types/services/core/websocket/types.d.ts +37 -0
  101. package/dist/types/services/index.d.ts +52 -0
  102. package/dist/types/services/task/AutoWrapup.d.ts +40 -0
  103. package/dist/types/services/task/TaskManager.d.ts +1 -0
  104. package/dist/types/services/task/constants.d.ts +46 -0
  105. package/dist/types/services/task/contact.d.ts +59 -0
  106. package/dist/types/services/task/dialer.d.ts +28 -0
  107. package/dist/types/services/task/index.d.ts +569 -0
  108. package/dist/types/services/task/types.d.ts +1041 -0
  109. package/dist/types/types.d.ts +452 -0
  110. package/dist/types/webex-config.d.ts +53 -0
  111. package/dist/types/webex.d.ts +7 -0
  112. package/dist/types.js +292 -0
  113. package/dist/types.js.map +1 -0
  114. package/dist/webex-config.js +60 -0
  115. package/dist/webex-config.js.map +1 -0
  116. package/dist/webex.js +99 -0
  117. package/dist/webex.js.map +1 -0
  118. package/jest.config.js +45 -0
  119. package/package.json +83 -0
  120. package/src/cc.ts +1618 -0
  121. package/src/config.ts +65 -0
  122. package/src/constants.ts +51 -0
  123. package/src/index.ts +220 -0
  124. package/src/logger-proxy.ts +110 -0
  125. package/src/metrics/MetricsManager.ts +512 -0
  126. package/src/metrics/behavioral-events.ts +332 -0
  127. package/src/metrics/constants.ts +135 -0
  128. package/src/services/WebCallingService.ts +351 -0
  129. package/src/services/agent/index.ts +149 -0
  130. package/src/services/agent/types.ts +440 -0
  131. package/src/services/config/Util.ts +261 -0
  132. package/src/services/config/constants.ts +249 -0
  133. package/src/services/config/index.ts +743 -0
  134. package/src/services/config/types.ts +1117 -0
  135. package/src/services/constants.ts +111 -0
  136. package/src/services/core/Err.ts +126 -0
  137. package/src/services/core/GlobalTypes.ts +34 -0
  138. package/src/services/core/Utils.ts +132 -0
  139. package/src/services/core/WebexRequest.ts +103 -0
  140. package/src/services/core/aqm-reqs.ts +272 -0
  141. package/src/services/core/constants.ts +106 -0
  142. package/src/services/core/types.ts +48 -0
  143. package/src/services/core/websocket/WebSocketManager.ts +196 -0
  144. package/src/services/core/websocket/connection-service.ts +142 -0
  145. package/src/services/core/websocket/keepalive.worker.js +88 -0
  146. package/src/services/core/websocket/types.ts +40 -0
  147. package/src/services/index.ts +71 -0
  148. package/src/services/task/AutoWrapup.ts +86 -0
  149. package/src/services/task/TaskManager.ts +420 -0
  150. package/src/services/task/constants.ts +52 -0
  151. package/src/services/task/contact.ts +429 -0
  152. package/src/services/task/dialer.ts +52 -0
  153. package/src/services/task/index.ts +1375 -0
  154. package/src/services/task/types.ts +1113 -0
  155. package/src/types.ts +639 -0
  156. package/src/webex-config.ts +54 -0
  157. package/src/webex.js +96 -0
  158. package/test/unit/spec/cc.ts +1985 -0
  159. package/test/unit/spec/metrics/MetricsManager.ts +491 -0
  160. package/test/unit/spec/metrics/behavioral-events.ts +102 -0
  161. package/test/unit/spec/services/WebCallingService.ts +416 -0
  162. package/test/unit/spec/services/agent/index.ts +65 -0
  163. package/test/unit/spec/services/config/index.ts +1035 -0
  164. package/test/unit/spec/services/core/Utils.ts +279 -0
  165. package/test/unit/spec/services/core/WebexRequest.ts +144 -0
  166. package/test/unit/spec/services/core/aqm-reqs.ts +570 -0
  167. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +378 -0
  168. package/test/unit/spec/services/core/websocket/connection-service.ts +178 -0
  169. package/test/unit/spec/services/task/TaskManager.ts +1351 -0
  170. package/test/unit/spec/services/task/contact.ts +204 -0
  171. package/test/unit/spec/services/task/dialer.ts +157 -0
  172. package/test/unit/spec/services/task/index.ts +1474 -0
  173. package/tsconfig.json +6 -0
  174. package/typedoc.json +37 -0
  175. package/typedoc.md +240 -0
  176. package/umd/contact-center.min.js +3 -0
  177. package/umd/contact-center.min.js.map +1 -0
@@ -0,0 +1,249 @@
1
+ // making query params configurable for List Teams and List Aux Codes API
2
+ export const DEFAULT_PAGE = 0;
3
+
4
+ /**
5
+ * Default page size for paginated API requests.
6
+ * @type {number}
7
+ * @public
8
+ * @example
9
+ * const pageSize = DEFAULT_PAGE_SIZE; // 100
10
+ * @ignore
11
+ */
12
+ export const DEFAULT_PAGE_SIZE = 100;
13
+
14
+ /**
15
+ * Agent state ID for 'Available'.
16
+ * @type {string}
17
+ * @public
18
+ * @ignore
19
+ */
20
+ export const AGENT_STATE_AVAILABLE_ID = '0';
21
+
22
+ /**
23
+ * Agent state label for 'Available'.
24
+ * @type {string}
25
+ * @public
26
+ * @ignore
27
+ */
28
+ export const AGENT_STATE_AVAILABLE = 'Available';
29
+
30
+ /**
31
+ * Description for the 'Available' agent state.
32
+ * @type {string}
33
+ * @public
34
+ * @ignore
35
+ */
36
+ export const AGENT_STATE_AVAILABLE_DESCRIPTION = 'Agent is available to receive calls';
37
+
38
+ /**
39
+ * Default attributes for auxiliary code API requests.
40
+ * @type {string[]}
41
+ * @public
42
+ * @ignore
43
+ */
44
+ export const DEFAULT_AUXCODE_ATTRIBUTES = [
45
+ 'id',
46
+ 'isSystemCode',
47
+ 'name',
48
+ 'defaultCode',
49
+ 'workTypeCode',
50
+ 'active',
51
+ ];
52
+
53
+ // Method names for config services
54
+ export const METHODS = {
55
+ // AgentConfigService methods
56
+ GET_AGENT_CONFIG: 'getAgentConfig',
57
+ GET_USER_USING_CI: 'getUserUsingCI',
58
+ GET_DESKTOP_PROFILE_BY_ID: 'getDesktopProfileById',
59
+ GET_MULTIMEDIA_PROFILE_BY_ID: 'getMultimediaProfileById',
60
+ GET_LIST_OF_TEAMS: 'getListOfTeams',
61
+ GET_ALL_TEAMS: 'getAllTeams',
62
+ GET_LIST_OF_AUX_CODES: 'getListOfAuxCodes',
63
+ GET_ALL_AUX_CODES: 'getAllAuxCodes',
64
+ GET_SITE_INFO: 'getSiteInfo',
65
+ GET_ORG_INFO: 'getOrgInfo',
66
+ GET_ORGANIZATION_SETTING: 'getOrganizationSetting',
67
+ GET_TENANT_DATA: 'getTenantData',
68
+ GET_URL_MAPPING: 'getURLMapping',
69
+ GET_DIAL_PLAN_DATA: 'getDialPlanData',
70
+ GET_QUEUES: 'getQueues',
71
+
72
+ // Util methods
73
+ PARSE_AGENT_CONFIGS: 'parseAgentConfigs',
74
+ GET_URL_MAPPING_UTIL: 'getUrlMapping',
75
+ GET_MSFT_CONFIG: 'getMsftConfig',
76
+ GET_WEBEX_CONFIG: 'getWebexConfig',
77
+ GET_DEFAULT_AGENT_DN: 'getDefaultAgentDN',
78
+ GET_FILTERED_DIALPLAN_ENTRIES: 'getFilteredDialplanEntries',
79
+ GET_FILTER_AUX_CODES: 'getFilterAuxCodes',
80
+ GET_DEFAULT_WRAP_UP_CODE: 'getDefaultWrapUpCode',
81
+ };
82
+
83
+ /**
84
+ * Maps API endpoint names to functions that generate endpoint URLs for various organization resources.
85
+ * @public
86
+ * @example
87
+ * const url = endPointMap.userByCI('org123', 'agent456');
88
+ */
89
+ export const endPointMap = {
90
+ /**
91
+ * Gets the endpoint for a user by CI user ID.
92
+ * @param orgId - Organization ID.
93
+ * @param agentId - Agent ID.
94
+ * @returns The endpoint URL string.
95
+ * @public
96
+ * @example
97
+ * const url = endPointMap.userByCI('org123', 'agent456');
98
+ * @ignore
99
+ */
100
+ userByCI: (orgId: string, agentId: string) =>
101
+ `organization/${orgId}/user/by-ci-user-id/${agentId}`,
102
+
103
+ /**
104
+ * Gets the endpoint for a desktop profile.
105
+ * @param orgId - Organization ID.
106
+ * @param desktopProfileId - Desktop profile ID.
107
+ * @returns The endpoint URL string.
108
+ * @public
109
+ * @example
110
+ * const url = endPointMap.desktopProfile('org123', 'profile789');
111
+ * @ignore
112
+ */
113
+ desktopProfile: (orgId: string, desktopProfileId: string) =>
114
+ `organization/${orgId}/agent-profile/${desktopProfileId}`,
115
+
116
+ /**
117
+ * Gets the endpoint for a multimedia profile.
118
+ * @param orgId - Organization ID.
119
+ * @param multimediaProfileId - Multimedia profile ID.
120
+ * @returns The endpoint URL string.
121
+ * @public
122
+ * @example
123
+ * const url = endPointMap.multimediaProfile('org123', 'multi456');
124
+ * @ignore
125
+ */
126
+ multimediaProfile: (orgId: string, multimediaProfileId: string) =>
127
+ `organization/${orgId}/multimedia-profile/${multimediaProfileId}`,
128
+
129
+ /**
130
+ * Gets the endpoint for listing teams with optional filters.
131
+ * @param orgId - Organization ID.
132
+ * @param page - Page number.
133
+ * @param pageSize - Page size.
134
+ * @param filter - Array of team IDs to filter.
135
+ * @returns The endpoint URL string.
136
+ * @public
137
+ * @example
138
+ * const url = endPointMap.listTeams('org123', 0, 100, ['team1', 'team2']);
139
+ * @ignore
140
+ */
141
+ listTeams: (orgId: string, page: number, pageSize: number, filter: string[]) =>
142
+ `organization/${orgId}/v2/team?page=${page}&pageSize=${pageSize}${
143
+ filter && filter.length > 0 ? `&filter=id=in=(${filter})` : ''
144
+ }`,
145
+
146
+ /**
147
+ * Gets the endpoint for listing auxiliary codes with optional filters and attributes.
148
+ * @param orgId - Organization ID.
149
+ * @param page - Page number.
150
+ * @param pageSize - Page size.
151
+ * @param filter - Array of auxiliary code IDs to filter.
152
+ * @param attributes - Array of attribute names to include.
153
+ * @returns The endpoint URL string.
154
+ * @public
155
+ * @example
156
+ * const url = endPointMap.listAuxCodes('org123', 0, 100, ['aux1'], ['id', 'name']);
157
+ * @ignore
158
+ */
159
+ listAuxCodes: (
160
+ orgId: string,
161
+ page: number,
162
+ pageSize: number,
163
+ filter: string[],
164
+ attributes: string[]
165
+ ) =>
166
+ `organization/${orgId}/v2/auxiliary-code?page=${page}&pageSize=${pageSize}${
167
+ filter && filter.length > 0 ? `&filter=id=in=(${filter})` : ''
168
+ }&attributes=${attributes}`,
169
+
170
+ /**
171
+ * Gets the endpoint for organization info.
172
+ * @param orgId - Organization ID.
173
+ * @returns The endpoint URL string.
174
+ * @public
175
+ * @example
176
+ * const url = endPointMap.orgInfo('org123');
177
+ * @ignore
178
+ */
179
+ orgInfo: (orgId: string) => `organization/${orgId}`,
180
+
181
+ /**
182
+ * Gets the endpoint for organization settings.
183
+ * @param orgId - Organization ID.
184
+ * @returns The endpoint URL string.
185
+ * @public
186
+ * @example
187
+ * const url = endPointMap.orgSettings('org123');
188
+ * @ignore
189
+ */
190
+ orgSettings: (orgId: string) => `organization/${orgId}/v2/organization-setting?agentView=true`,
191
+
192
+ /**
193
+ * Gets the endpoint for site info.
194
+ * @param orgId - Organization ID.
195
+ * @param siteId - Site ID.
196
+ * @returns The endpoint URL string.
197
+ * @public
198
+ * @example
199
+ * const url = endPointMap.siteInfo('org123', 'site456');
200
+ * @ignore
201
+ */
202
+ siteInfo: (orgId: string, siteId: string) => `organization/${orgId}/site/${siteId}`,
203
+
204
+ /**
205
+ * Gets the endpoint for tenant configuration data.
206
+ * @param orgId - Organization ID.
207
+ * @returns The endpoint URL string.
208
+ * @public
209
+ * @example
210
+ * const url = endPointMap.tenantData('org123');
211
+ * @ignore
212
+ */
213
+ tenantData: (orgId: string) => `organization/${orgId}/v2/tenant-configuration?agentView=true`,
214
+
215
+ /**
216
+ * Gets the endpoint for organization URL mapping.
217
+ * @param orgId - Organization ID.
218
+ * @returns The endpoint URL string.
219
+ * @public
220
+ * @example
221
+ * const url = endPointMap.urlMapping('org123');
222
+ * @ignore
223
+ */
224
+ urlMapping: (orgId: string) => `organization/${orgId}/v2/org-url-mapping?sort=name,ASC`,
225
+
226
+ /**
227
+ * Gets the endpoint for dial plan.
228
+ * @param orgId - Organization ID.
229
+ * @returns The endpoint URL string.
230
+ * @public
231
+ * @example
232
+ * const url = endPointMap.dialPlan('org123');
233
+ * @ignore
234
+ */
235
+ dialPlan: (orgId: string) => `organization/${orgId}/dial-plan?agentView=true`,
236
+
237
+ /**
238
+ * Gets the endpoint for the queue list with custom query parameters.
239
+ * @param orgId - Organization ID.
240
+ * @param queryParams - Query parameters string.
241
+ * @returns The endpoint URL string.
242
+ * @public
243
+ * @example
244
+ * const url = endPointMap.queueList('org123', 'page=0&pageSize=10');
245
+ * @ignore
246
+ */
247
+ queueList: (orgId: string, queryParams: string) =>
248
+ `organization/${orgId}/v2/contact-service-queue?${queryParams}`,
249
+ };