@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,894 @@
1
+ /**
2
+ * @module CCPlugin
3
+ * @packageDocumentation
4
+ * Contact Center Plugin module that provides functionality for managing contact center agents,
5
+ * handling tasks, and interacting with contact center services. This module enables integration
6
+ * with Webex Contact Center features through the WebexSDK.
7
+ */
8
+ import { WebexPlugin } from '@webex/webex-core';
9
+ import { SetStateResponse, IContactCenter, AgentLogin, AgentProfileUpdate, StationLoginResponse, StationLogoutResponse, BuddyAgentsResponse, BuddyAgents, UploadLogsResponse, UpdateDeviceTypeResponse } from './types';
10
+ import LoggerProxy from './logger-proxy';
11
+ import { StateChange, Logout } from './services/agent/types';
12
+ import { Profile, OutdialAniEntriesResponse, OutdialAniParams } from './services/config/types';
13
+ import { TaskResponse, PreviewContactPayload } from './services/task/types';
14
+ import { AddressBook } from './services/AddressBook';
15
+ import { Queue } from './services/Queue';
16
+ import { ApiAIAssistant } from './services/ApiAiAssistant';
17
+ import { UserPreference } from './services/UserPreference';
18
+ import type { EntryPointListResponse, EntryPointSearchParams, ContactServiceQueuesResponse, ContactServiceQueueSearchParams } from './types';
19
+ /**
20
+ * The main Contact Center plugin class that enables integration with Webex Contact Center.
21
+ *
22
+ * @class ContactCenter
23
+ * @extends WebexPlugin
24
+ * @implements IContactCenter
25
+ * @description
26
+ * Features:
27
+ *
28
+ * 1. Session Management:
29
+ * - {@link register} - Initialize and register SDK with contact center
30
+ * - {@link deregister} - Cleanup and disconnect SDK resources
31
+ *
32
+ * 2. Agent Login/Logout:
33
+ * - {@link stationLogin} - Login with browser or desk phone
34
+ * - {@link stationLogout} - Logout from current station
35
+ * - {@link updateAgentProfile} - Update device type and settings
36
+ *
37
+ * 3. Agent State Control:
38
+ * - {@link setAgentState} - Change agent state (Available/Idle)
39
+ *
40
+ * 4. Task Management:
41
+ * - Inbound task handling via events
42
+ * - {@link startOutdial} - Make outbound calls
43
+ *
44
+ * 5. Routing & Distribution:
45
+ * - {@link getQueues} - Get available queues for routing
46
+ * - {@link getBuddyAgents} - Get available buddy agents
47
+ *
48
+ * 6. Diagnostics:
49
+ * - {@link uploadLogs} - Upload logs for troubleshooting
50
+ *
51
+ * * Key Events:
52
+ * - Agent State Events:
53
+ * - `agent:stateChange` - Agent's state has changed (Available, Idle, etc.)
54
+ * - `agent:stateChangeSuccess` - Agent state change was successful
55
+ * - `agent:stateChangeFailed` - Agent state change failed
56
+ *
57
+ * - Session Events:
58
+ * - `agent:stationLoginSuccess` - Agent login was successful
59
+ * - `agent:stationLoginFailed` - Agent login failed
60
+ * - `agent:logoutSuccess` - Agent logout was successful
61
+ * - `agent:logoutFailed` - Agent logout failed
62
+ *
63
+ * - Task Events:
64
+ * - `task:incoming` - New task is being offered
65
+ * - `task:hydrate` - Task data has been updated
66
+ * - `task:established` - Task/call has been connected
67
+ * - `task:ended` - Task/call has ended
68
+ * - `task:error` - An error occurred during task handling
69
+ * - `task:campaignPreviewReservation` - Campaign preview contact offered to agent
70
+ *
71
+ * @public
72
+ *
73
+ * @example
74
+ * ```typescript
75
+ * import Webex from 'webex';
76
+ *
77
+ * // Initialize SDK with access token
78
+ * const webex = new Webex({
79
+ * credentials: 'YOUR_ACCESS_TOKEN'
80
+ * });
81
+ *
82
+ * // Get Contact Center plugin instance
83
+ * const cc = webex.cc;
84
+ *
85
+ * // Setup event handlers
86
+ * cc.on('agent:stateChange', (event) => {
87
+ * console.log('Agent state changed:', event.state);
88
+ * });
89
+ *
90
+ * cc.on('task:incoming', (task) => {
91
+ * console.log('New task received:', task.interactionId);
92
+ * });
93
+ *
94
+ * // Initialize agent session
95
+ * async function initializeAgent() {
96
+ * try {
97
+ * // Register with contact center
98
+ * const profile = await cc.register();
99
+ *
100
+ * // Login with browser-based calling
101
+ * await cc.stationLogin({
102
+ * teamId: profile.teams[0].teamId,
103
+ * loginOption: 'BROWSER'
104
+ * });
105
+ *
106
+ * // Set agent to Available state
107
+ * await cc.setAgentState({
108
+ * state: 'Available',
109
+ * auxCodeId: '0'
110
+ * });
111
+ *
112
+ * console.log('Agent initialized and ready');
113
+ * } catch (error) {
114
+ * console.error('Initialization failed:', error);
115
+ * await cc.uploadLogs(); // Upload logs for troubleshooting
116
+ * }
117
+ * }
118
+ *
119
+ * initializeAgent();
120
+ * ```
121
+ *
122
+ * @public
123
+ */
124
+ export default class ContactCenter extends WebexPlugin implements IContactCenter {
125
+ /**
126
+ * The plugin's unique namespace identifier in the Webex SDK.
127
+ * Used to access the plugin via webex.cc
128
+ * @type {string}
129
+ * @public
130
+ */
131
+ namespace: string;
132
+ /**
133
+ * Plugin configuration settings including connection and authentication options
134
+ * @type {CCPluginConfig}
135
+ * @private
136
+ */
137
+ private $config;
138
+ /**
139
+ * Reference to the parent Webex SDK instance
140
+ * Used to access core Webex functionality and credentials
141
+ * @type {WebexSDK}
142
+ * @private
143
+ */
144
+ private $webex;
145
+ /**
146
+ * Event emitter for handling internal plugin events
147
+ * Manages event subscriptions and notifications
148
+ * @type {EventEmitter}
149
+ * @private
150
+ */
151
+ private eventEmitter;
152
+ /**
153
+ * Agent's profile and configuration data
154
+ * Includes capabilities, teams, settings, and current state
155
+ * @type {Profile}
156
+ * @private
157
+ */
158
+ private agentConfig;
159
+ /**
160
+ * Service for managing browser-based calling (WebRTC)
161
+ * Handles audio/video streaming and device management
162
+ * @type {WebCallingService}
163
+ * @private
164
+ */
165
+ private webCallingService;
166
+ /**
167
+ * Core service managers for Contact Center operations
168
+ * Includes agent, connection, and configuration services
169
+ * @type {Services}
170
+ * @private
171
+ */
172
+ private services;
173
+ /**
174
+ * Service for making authenticated HTTP requests to Webex APIs
175
+ * Handles request/response lifecycle and error handling
176
+ * @type {WebexRequest}
177
+ * @private
178
+ */
179
+ private webexRequest;
180
+ /**
181
+ * Manager for handling contact center tasks (calls, chats, etc.)
182
+ * Coordinates task lifecycle events and state
183
+ * @type {TaskManager}
184
+ * @private
185
+ */
186
+ private taskManager;
187
+ /**
188
+ * Manager for tracking and reporting SDK metrics and analytics
189
+ * Monitors performance, errors, and usage patterns
190
+ * @type {MetricsManager}
191
+ * @private
192
+ */
193
+ private metricsManager;
194
+ /**
195
+ * API instance for managing Webex Contact Center entry points
196
+ * Provides functionality to fetch entry points with caching support
197
+ * @type {EntryPoint}
198
+ * @public
199
+ * @example
200
+ * ```typescript
201
+ * const cc = webex.cc;
202
+ * await cc.register();
203
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
204
+ *
205
+ * // Access EntryPointRecord
206
+ * const response = await cc.entryPoint.getEntryPoints({
207
+ * page: 0,
208
+ * pageSize: 50
209
+ * });
210
+ * ```
211
+ */
212
+ private entryPoint;
213
+ /**
214
+ * API instance for managing Webex Contact Center address book contacts
215
+ * Provides functionality to fetch address book entries with caching support
216
+ * @type {AddressBook}
217
+ * @public
218
+ * @example
219
+ * ```typescript
220
+ * const cc = webex.cc;
221
+ * await cc.register();
222
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
223
+ *
224
+ * // Access AddressBook API
225
+ * const response = await cc.addressBook.getEntries({
226
+ * page: 0,
227
+ * pageSize: 25
228
+ * });
229
+ * ```
230
+ */
231
+ addressBook: AddressBook;
232
+ /**
233
+ * API instance for managing Webex Contact Center queues
234
+ * Provides functionality to fetch queues with caching support
235
+ * @type {Queue}
236
+ * @public
237
+ * @example
238
+ * ```typescript
239
+ * const cc = webex.cc;
240
+ * await cc.register();
241
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
242
+ *
243
+ * // Access Queue API
244
+ * const response = await cc.queue.getQueues({
245
+ * page: 0,
246
+ * pageSize: 50
247
+ * });
248
+ *
249
+ * // Filter queues by specific criteria
250
+ * const filteredQueues = await cc.queue.getQueues({
251
+ * filter: 'id=="queue-id-123"'
252
+ * });
253
+ * ```
254
+ */
255
+ queue: Queue;
256
+ /**
257
+ * API instance for managing Webex Contact Center user preferences
258
+ * Provides functionality to get, create, update, and delete user preferences
259
+ * @type {UserPreference}
260
+ * @public
261
+ * @example
262
+ * ```typescript
263
+ * const cc = webex.cc;
264
+ * await cc.register();
265
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
266
+ *
267
+ * // Get user preferences for current user
268
+ * const preferences = await cc.userPreference.getUserPreference();
269
+ *
270
+ * // Create new user preferences
271
+ * const newPrefs = await cc.userPreference.createUserPreference({
272
+ * userId: 'user123',
273
+ * preferences: { e911Reminder: true }
274
+ * });
275
+ *
276
+ * // Update user preferences
277
+ * const updatedPrefs = await cc.userPreference.updateUserPreference('user123', {
278
+ * preferences: { e911Reminder: false }
279
+ * });
280
+ *
281
+ * // Delete user preferences
282
+ * await cc.userPreference.deleteUserPreference('user123');
283
+ * ```
284
+ */
285
+ userPreference: UserPreference;
286
+ /**
287
+ * API instance for AI Assistant operations such as transcript controls.
288
+ * @type {ApiAIAssistant}
289
+ * @public
290
+ */
291
+ apiAIAssistant: ApiAIAssistant;
292
+ /**
293
+ * Logger utility for Contact Center plugin
294
+ * Provides consistent logging across the plugin
295
+ * @type {LoggerProxy}
296
+ * @public
297
+ */
298
+ LoggerProxy: typeof LoggerProxy;
299
+ /**
300
+ * @ignore
301
+ * Creates an instance of ContactCenter plugin
302
+ * @param {any[]} args Arguments passed to plugin constructor
303
+ */
304
+ constructor(...args: any[]);
305
+ /**
306
+ * Handles incoming task events and triggers appropriate notifications
307
+ * @private
308
+ * @param {ITask} task The incoming task object containing task details
309
+ */
310
+ private handleIncomingTask;
311
+ /**
312
+ * Handles task hydration events for updating task data
313
+ * @private
314
+ * @param {ITask} task The task object to be hydrated with additional data
315
+ */
316
+ private handleTaskHydrate;
317
+ /**
318
+ * Handles multi-login hydrate events for SDK instances without Mobius registration
319
+ * @private
320
+ * @param {ITask} task The task object associated with the multi-login hydrate
321
+ */
322
+ private handleTaskMultiLoginHydrate;
323
+ /**
324
+ * Handles task merged events when tasks are combined eg: EPDN merge/transfer
325
+ * @private
326
+ * @param {ITask} task The task object that has been merged
327
+ */
328
+ private handleTaskMerged;
329
+ /**
330
+ * Handles campaign preview reservation events when a contact is offered to the agent
331
+ * @private
332
+ * @param {ITask} task The campaign reservation task
333
+ */
334
+ private handleCampaignPreviewReservation;
335
+ private handleRTDWebsocketMessage;
336
+ /**
337
+ * Sets up event listeners for incoming tasks and task hydration
338
+ * Subscribes to task events from the task manager
339
+ * @private
340
+ */
341
+ private incomingTaskListener;
342
+ /**
343
+ * Initializes the Contact Center SDK by setting up the web socket connections.
344
+ * This method must be called before performing any agent operations such as login, state change, or handling tasks.
345
+ *
346
+ * @returns {Promise<Profile>} Agent profile information after successful registration.
347
+ * The returned `Profile` object contains details such as:
348
+ * - `agentId`: The unique identifier for the agent.
349
+ * - `defaultDn`: The default dial number associated with the agent.
350
+ * - `teams`: Array of teams the agent belongs to.
351
+ * - `webRtcEnabled`: Indicates if WebRTC (browser calling) is enabled.
352
+ * - `loginVoiceOptions`: Supported login options for the agent (e.g., BROWSER, EXTENSION).
353
+ * - ...and other agent configuration details.
354
+ *
355
+ * @throws {Error} If registration fails.
356
+ *
357
+ * @public
358
+ * @example
359
+ * ```typescript
360
+ * import Webex from 'webex';
361
+ *
362
+ * const webex = Webex.init({ credentials: 'YOUR_ACCESS_TOKEN' });
363
+ * const cc = webex.cc;
364
+ *
365
+ * // Register the SDK and fetch agent profile
366
+ * const profile = await cc.register();
367
+ *
368
+ * console.log('Agent ID:', profile.agentId);
369
+ * console.log('Default DN:', profile.defaultDn);
370
+ * console.log('Teams:', profile.teams.map(t => t.teamId));
371
+ * console.log('WebRTC Enabled:', profile.webRtcEnabled);
372
+ * console.log('Supported Login Options:', profile.loginVoiceOptions);
373
+ *
374
+ * // Now you can proceed with station login, state changes, etc.
375
+ * await cc.stationLogin({ teamId: profile.teams[0].teamId, loginOption: 'BROWSER' });
376
+ * ```
377
+ */
378
+ register(): Promise<Profile>;
379
+ /**
380
+ * Unregisters the Contact Center SDK by closing all web socket connections, removing event listeners,
381
+ * and cleaning up internal state.
382
+ *
383
+ * @remarks
384
+ * This method only disconnects the SDK from the backend and cleans up resources. It does NOT perform a station logout
385
+ * (i.e., the agent remains logged in to the contact center unless you explicitly call {@link stationLogout}).
386
+ * Use this when you want to fully tear down the SDK instance, such as during application shutdown or user sign-out.
387
+ *
388
+ * @returns {Promise<void>} Resolves when deregistration and cleanup are complete.
389
+ * @throws {Error} If deregistration fails.
390
+ *
391
+ * @public
392
+ * @example
393
+ * // Typical usage: clean up SDK before application exit or user logout
394
+ * import Webex from 'webex';
395
+ *
396
+ * const webex = Webex.init({ credentials: 'YOUR_ACCESS_TOKEN' });
397
+ * const cc = webex.cc;
398
+ *
399
+ * await cc.register();
400
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
401
+ * // ... perform agent operations ...
402
+ *
403
+ * // If you want to log out the agent as well, call:
404
+ * // await cc.stationLogout({ logoutReason: 'User signed out' });
405
+ * // On application shutdown or user sign-out:
406
+ * await cc.deregister();
407
+ *
408
+
409
+ */
410
+ deregister(): Promise<void>;
411
+ /**
412
+ * Returns the list of buddy agents who are in the given user state and media type based on their agent profile settings
413
+ * @param {BuddyAgents} data The data required to fetch buddy agents
414
+ * @returns {Promise<BuddyAgentsResponse>} A promise resolving to the buddy agents information
415
+ * @throws {Error} If fetching buddy agents fails
416
+ * @example
417
+ * ```typescript
418
+ * // Get list of available agents for consultation or transfer
419
+ * const cc = webex.cc;
420
+ *
421
+ * // First ensure you're registered and logged in
422
+ * await cc.register();
423
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
424
+ *
425
+ * // Get buddy agents filtered by state and media type
426
+ * const response = await cc.getBuddyAgents({
427
+ * state: 'Available', // Filter by agent state ('Available', 'Idle', etc.)
428
+ * mediaType: 'telephony' // Filter by media type ('telephony', 'chat', 'email', 'social')
429
+ * });
430
+ *
431
+ * // Process the buddy agents list
432
+ * if (response.data.agentList.length > 0) {
433
+ * const buddyAgents = response.data.agentList;
434
+ * console.log(`Found ${buddyAgents.length} available agents`);
435
+ *
436
+ * // Access agent details
437
+ * buddyAgents.forEach(agent => {
438
+ * console.log(`Agent ID: ${agent.agentId}`);
439
+ * console.log(`Name: ${agent.firstName} ${agent.lastName}`);
440
+ * console.log(`State: ${agent.state}`);
441
+ * console.log(`Team: ${agent.teamName}`);
442
+ * });
443
+ * }
444
+ * ```
445
+ */
446
+ getBuddyAgents(data: BuddyAgents): Promise<BuddyAgentsResponse>;
447
+ /**
448
+ * Connects to the websocket and fetches the agent profile
449
+ * @returns {Promise<Profile>} Agent profile information
450
+ * @throws {Error} If connection fails or profile cannot be fetched
451
+ * @private
452
+ */
453
+ private connectWebsocket;
454
+ /**
455
+ * Performs agent login with specified credentials and device type
456
+ * @param {AgentLogin} data Login parameters including teamId, loginOption and dialNumber
457
+ * @returns {Promise<StationLoginResponse>} Response containing login status and profile
458
+ * @throws {Error} If login fails
459
+ * @public
460
+ * @example
461
+ * ```typescript
462
+ * const cc = webex.cc;
463
+ * await cc.register();
464
+ *
465
+ * // Primary usage: using Promise response
466
+ * try {
467
+ * const response = await cc.stationLogin({
468
+ * teamId: 'team123',
469
+ * loginOption: 'EXTENSION',
470
+ * dialNumber: '1002'
471
+ * });
472
+ * console.log('Login successful:', response);
473
+ * } catch (error) {
474
+ * console.error('Login failed:', error);
475
+ * }
476
+ *
477
+ * // Optional: Also listen for events elsewhere in your application
478
+ * // cc.on('agent:stationLoginSuccess', (data) => { ... });
479
+ * // cc.on('agent:stationLoginFailed', (error) => { ... });
480
+ * ```
481
+ */
482
+ stationLogin(data: AgentLogin): Promise<StationLoginResponse>;
483
+ /**
484
+ * Performs a station logout operation for the agent
485
+ * @remarks
486
+ * A logout operation cannot happen if the agent is in an interaction or haven't logged in yet.
487
+ * @param {Logout} data Logout parameters with logoutReason - a string explaining why the agent is logging out
488
+ * @returns {Promise<StationLogoutResponse>} Response indicating logout status
489
+ * @throws {Error} If logout fails
490
+ * @public
491
+ * @example
492
+ * ```typescript
493
+ * // Basic logout
494
+ * try {
495
+ * await cc.stationLogout({
496
+ * logoutReason: 'End of shift'
497
+ * });
498
+ * console.log('Logged out successfully');
499
+ * } catch (error) {
500
+ * console.error('Logout failed:', error);
501
+ * }
502
+ * ```
503
+ */
504
+ stationLogout(data: Logout): Promise<StationLogoutResponse>;
505
+ /**
506
+ * Gets the device ID based on login option and dial number
507
+ * @param {string} loginOption The login option (BROWSER, EXTENSION, etc)
508
+ * @param {string} dialNumber The dial number if applicable
509
+ * @returns {string} The device ID
510
+ * @private
511
+ */
512
+ private getDeviceId;
513
+ /**
514
+ * Sets the state of the agent to Available or any of the Idle states.
515
+ * After a state change attempt, one of the following events will be emitted:
516
+ * - agent:stateChange: Emitted when agent's state changes (triggered for both local and remote changes)
517
+ * - agent:stateChangeSuccess: Emitted when agent state change is successful
518
+ * - agent:stateChangeFailed: Emitted when agent state change attempt fails
519
+ *
520
+ * @param {StateChange} data State change parameters including the new state
521
+ * @returns {Promise<SetStateResponse>} Response with updated state information
522
+ * @throws {Error} If state change fails
523
+ * @public
524
+ * @example
525
+ * ```typescript
526
+ * const cc = webex.cc;
527
+ * await cc.register();
528
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
529
+ *
530
+ * // Using promise-based approach
531
+ * try {
532
+ * await cc.setAgentState({
533
+ * state: 'Available',
534
+ * auxCodeId: '12345',
535
+ * lastStateChangeReason: 'Manual state change',
536
+ * agentId: 'agent123',
537
+ * });
538
+ * } catch (error) {
539
+ * console.error('State change failed:', error);
540
+ * }
541
+ *
542
+ * // Optionally, listen for events
543
+ * cc.on('agent:stateChange', (eventData) => {
544
+ * // Triggered for both local and remote state changes
545
+ * console.log('State changed:', eventData);
546
+ * });
547
+ *
548
+ * cc.on('agent:stateChangeSuccess', (eventData) => {
549
+ * console.log('State change succeeded:', eventData);
550
+ * });
551
+ *
552
+ * cc.on('agent:stateChangeFailed', (error) => {
553
+ * console.error('State change failed:', error);
554
+ * });
555
+ * ```
556
+ */
557
+ setAgentState(data: StateChange): Promise<SetStateResponse>;
558
+ /**
559
+ * Processes incoming websocket messages and emits corresponding events
560
+ * Handles various event types including agent state changes, login events,
561
+ * and other agent-related notifications
562
+ * @private
563
+ * @param {string} event The raw websocket event message
564
+ */
565
+ private handleWebsocketMessage;
566
+ /**
567
+ * Checks whether Mobius/WebRTC registration should be skipped by config
568
+ * @returns {boolean} True when browser WebRTC registration is disabled
569
+ * @private
570
+ */
571
+ private isWebRTCRegistrationDisabled;
572
+ /**
573
+ * Validates contact-center plugin configuration before service initialization
574
+ * @private
575
+ */
576
+ private validatePluginConfig;
577
+ /**
578
+ * Initializes event listeners for the Contact Center service
579
+ * Sets up handlers for connection state changes and other core events
580
+ * @private
581
+ */
582
+ private setupEventListeners;
583
+ /**
584
+ * Returns the connection configuration
585
+ * @returns {SubscribeRequest} Connection configuration
586
+ * @private
587
+ */
588
+ private getConnectionConfig;
589
+ /**
590
+ * Handles connection lost events and reconnection attempts
591
+ * @param {ConnectionLostDetails} msg Connection lost details
592
+ * @private
593
+ */
594
+ private handleConnectionLost;
595
+ /**
596
+ * Handles silent relogin after registration completion
597
+ * @private
598
+ */
599
+ private silentRelogin;
600
+ /**
601
+ * Handles device type specific configuration and setup
602
+ * Configures services and settings based on the login device type
603
+ * @param {LoginOption} deviceType The type of device being used for login
604
+ * @param {string} dn The dial number associated with the device
605
+ * @returns {Promise<void>}
606
+ * @private
607
+ */
608
+ private handleDeviceType;
609
+ /**
610
+ * Makes an outbound call to a specified phone number.
611
+ *
612
+ * @param {string} destination - The phone number to dial (e.g., '+1234567890').
613
+ * @param {string} origin - The contact center number that will be used while making a call to the customer.
614
+ * Should include country code and be in E.164 format.
615
+ * @returns {Promise<TaskResponse>} Resolves with the task response containing:
616
+ * - interactionId: Unique identifier for the outbound call
617
+ * - taskId: Identifier for the task instance
618
+ * - data: Task details including state, queue info, and media properties
619
+ * @throws {Error} If the outdial operation fails:
620
+ * - "Agent not configured for outbound calls" if isOutboundEnabledForAgent is false
621
+ * - "Invalid phone number format" if destination is not in E.164 format
622
+ * - "Agent not in Available state" if agent's state is not Available
623
+ * @public
624
+ * @example
625
+ * ```typescript
626
+ * // Initialize and prepare agent
627
+ * const cc = webex.cc;
628
+ * await cc.register();
629
+ * await cc.stationLogin({
630
+ * teamId: 'team123',
631
+ * loginOption: 'BROWSER'
632
+ * });
633
+ *
634
+ * // Set Available state before outbound call
635
+ * await cc.setAgentState({
636
+ * state: 'Available',
637
+ * auxCodeId: '0'
638
+ * });
639
+ *
640
+ * // Make outbound call with full error handling
641
+ * try {
642
+ * // Verify agent is properly configured for outdial
643
+ * if (!cc.agentConfig.isOutboundEnabledForAgent) {
644
+ * throw new Error('Agent not configured for outbound calls');
645
+ * }
646
+ *
647
+ * // Start the outbound call
648
+ * const destination = '+1234567890';
649
+ * const task = await cc.startOutdial(destination, origin);
650
+ *
651
+ * // Listen for all relevant task events
652
+ * task.on('task:ringing', () => {
653
+ * console.log('Call is ringing');
654
+ * updateCallStatus('Ringing...');
655
+ * });
656
+ *
657
+ * task.on('task:established', () => {
658
+ * console.log('Call connected');
659
+ * updateCallStatus('Connected');
660
+ * enableCallControls(); // Show mute, hold, transfer buttons
661
+ * });
662
+ *
663
+ * task.on('task:hold', () => {
664
+ * console.log('Call placed on hold');
665
+ * updateCallStatus('On Hold');
666
+ * });
667
+ *
668
+ * task.on('task:error', (error) => {
669
+ * console.error('Call error:', error);
670
+ * updateCallStatus('Error');
671
+ * showErrorDialog(error.message);
672
+ * });
673
+ *
674
+ * task.on('task:ended', () => {
675
+ * console.log('Call ended');
676
+ * updateCallStatus('Call Ended');
677
+ * resetCallControls();
678
+ *
679
+ * // Handle wrap-up if required
680
+ * if (task.data.wrapUpRequired) {
681
+ * showWrapupForm();
682
+ * }
683
+ * });
684
+ *
685
+ * // Example call control usage
686
+ * function handleMuteToggle() {
687
+ * await task.toggleMute();
688
+ * }
689
+ *
690
+ * function handleHoldToggle() {
691
+ * if (task.data.isOnHold) {
692
+ * await task.resume();
693
+ * } else {
694
+ * await task.hold();
695
+ * }
696
+ * }
697
+ *
698
+ * async function handleTransfer() {
699
+ * // Get available queues for transfer
700
+ * const queues = await cc.getQueues();
701
+ *
702
+ * // Transfer to first available queue
703
+ * if (queues.length > 0) {
704
+ * await task.transfer({
705
+ * to: queues[0].queueId,
706
+ * destinationType: 'QUEUE'
707
+ * });
708
+ * }
709
+ * }
710
+ *
711
+ * } catch (error) {
712
+ * console.error('Outdial failed:', error);
713
+ * showErrorNotification('Failed to place call: ' + error.message);
714
+ * }
715
+ * ```
716
+ */
717
+ startOutdial(destination: string, origin: string): Promise<TaskResponse>;
718
+ /**
719
+ * Accepts a campaign preview contact, initiating the outbound call.
720
+ *
721
+ * When a campaign manager reserves a contact for an agent, the agent receives an
722
+ * `AgentOfferCampaignReservation` event. The agent can then accept the preview contact
723
+ * to initiate the outbound call.
724
+ *
725
+ * @param {PreviewContactPayload} payload - The preview contact payload containing interactionId and campaignId (campaign name, not UUID).
726
+ * @returns {Promise<TaskResponse>} Promise resolving with agent contact on success.
727
+ * @throws {Error} If the operation fails (network error, customer unavailable, etc.)
728
+ *
729
+ * @example
730
+ * ```typescript
731
+ * webex.cc.on('task:campaignPreviewReservation', async (task) => {
732
+ * const { interactionId } = task.data;
733
+ * // campaignId is the campaign name (e.g. "MyCampaign"), not a UUID
734
+ * const campaignId = task.data.interaction.callProcessingDetails.campaignId;
735
+ *
736
+ * const result = await webex.cc.acceptPreviewContact({ interactionId, campaignId });
737
+ * });
738
+ * ```
739
+ */
740
+ acceptPreviewContact(payload: PreviewContactPayload): Promise<TaskResponse>;
741
+ /**
742
+ * Skips a campaign preview contact, requesting the next contact from the campaign.
743
+ *
744
+ * When a campaign manager reserves a contact for an agent, the agent receives an
745
+ * `AgentOfferCampaignReservation` event. Instead of accepting, the agent can skip the
746
+ * preview contact to move to the next contact in the campaign.
747
+ *
748
+ * @param {PreviewContactPayload} payload - The preview contact payload containing interactionId and campaignId (campaign name, not UUID).
749
+ * @returns {Promise<TaskResponse>} Promise resolving with agent contact on success.
750
+ * @throws {Error} If the operation fails (network error, etc.)
751
+ *
752
+ * @example
753
+ * ```typescript
754
+ * webex.cc.on('task:campaignPreviewReservation', async (task) => {
755
+ * const { interactionId } = task.data;
756
+ * const campaignId = task.data.interaction.callProcessingDetails.campaignId;
757
+ *
758
+ * const result = await webex.cc.skipPreviewContact({ interactionId, campaignId });
759
+ * });
760
+ * ```
761
+ */
762
+ skipPreviewContact(payload: PreviewContactPayload): Promise<TaskResponse>;
763
+ /**
764
+ * Removes a campaign preview contact from the campaign list entirely.
765
+ *
766
+ * When a campaign manager reserves a contact for an agent, the agent receives an
767
+ * `AgentOfferCampaignReservation` event. Instead of accepting or skipping, the agent can
768
+ * remove the preview contact to permanently take it out of the campaign contact list.
769
+ *
770
+ * @param {PreviewContactPayload} payload - The preview contact payload containing interactionId and campaignId (campaign name, not UUID).
771
+ * @returns {Promise<TaskResponse>} Promise resolving with agent contact on success.
772
+ * @throws {Error} If the operation fails (network error, etc.)
773
+ *
774
+ * @example
775
+ * ```typescript
776
+ * webex.cc.on('task:campaignPreviewReservation', async (task) => {
777
+ * const { interactionId } = task.data;
778
+ * const campaignId = task.data.interaction.callProcessingDetails.campaignId;
779
+ *
780
+ * const result = await webex.cc.removePreviewContact({ interactionId, campaignId });
781
+ * });
782
+ * ```
783
+ */
784
+ removePreviewContact(payload: PreviewContactPayload): Promise<TaskResponse>;
785
+ /**
786
+ * Fetches outdial ANI (Automatic Number Identification) entries for an outdial ANI ID.
787
+ *
788
+ * This method retrieves the list of phone numbers that can be used as caller ID when making
789
+ * outbound calls. The ANI data is associated with an outdial ANI ID and can be filtered
790
+ * and paginated as needed.
791
+ *
792
+ * @param {string} outdialANI - The outdial ANI ID to fetch ANI data for
793
+ * @param {number} [page] - Optional page number for pagination (0-based)
794
+ * @param {number} [pageSize] - Optional number of items per page
795
+ * @param {string} [search] - Optional search term to filter results by name or number
796
+ * @param {string} [filter] - Optional filter string
797
+ * @param {string} [attributes] - Optional attributes to include in response
798
+ * @returns {Promise<OutdialAniEntriesResponse>} Promise resolving to outdial ANI response containing:
799
+ * - data: Array of ANI entries with number and name
800
+ * - meta: Pagination metadata
801
+ * @throws {Error} If the operation fails or agent is not registered
802
+ * @public
803
+ * @example
804
+ * ```typescript
805
+ * const cc = webex.cc;
806
+ * await cc.register();
807
+ *
808
+ * // Get agent profile to obtain outdial ANI ID
809
+ * const agentProfile = cc.agentConfig;
810
+ * const outdialANI = agentProfile.outdialANIId;
811
+ *
812
+ * // Basic usage - get all ANI data for an outdial ANI ID
813
+ * const aniData = await cc.getOutdialAniEntries({ outdialANI });
814
+ *
815
+ * // With pagination and search
816
+ * const paginatedAni = await cc.getOutdialAniEntries({
817
+ * outdialANI,
818
+ * page: 0,
819
+ * pageSize: 50,
820
+ * search: '555' // search for numbers containing '555'
821
+ * });
822
+ *
823
+ * // Process the results
824
+ * paginatedAni.forEach(ani => {
825
+ * console.log(`ANI: ${ani.number} - ${ani.name}`);
826
+ * });
827
+ * ```
828
+ */
829
+ getOutdialAniEntries(params: OutdialAniParams): Promise<OutdialAniEntriesResponse>;
830
+ /**
831
+ * Uploads logs to help troubleshoot SDK issues.
832
+ *
833
+ * This method collects the current SDK logs including network requests, WebSocket
834
+ * messages, and client-side events, then securely submits them to Webex's diagnostics
835
+ * service. The returned tracking ID, feedbackID can be provided to Webex support for faster
836
+ * issue resolution.
837
+ * @returns Promise<UploadLogsResponse> Resolves with the upload logs response
838
+ * @throws Error If the upload fails
839
+ * @public
840
+ * @example
841
+ * ```typescript
842
+ * const cc = webex.cc;
843
+ * try {
844
+ * await cc.register();
845
+ * } catch (error) {
846
+ * console.error('Error:', error);
847
+ * const result = await cc.uploadLogs();
848
+ * console.log('Logs uploaded. Tracking ID:', result.trackingId);
849
+ * }
850
+ * ```
851
+ */
852
+ uploadLogs(): Promise<UploadLogsResponse>;
853
+ /**
854
+ * Updates the agent device type and login configuration.
855
+ * Use this method to change how an agent connects to the contact center system (e.g., switching from browser-based calling to a desk phone extension).
856
+ * Change to any field of the profile is allowed;
857
+ *
858
+ * @param {AgentDeviceUpdate} data Configuration containing:
859
+ * - loginOption: New device type ('BROWSER', 'EXTENSION', 'AGENT_DN')
860
+ * - dialNumber: Required phone number when using EXTENSION or AGENT_DN
861
+ * - teamId: Optional team ID (defaults to current team if not specified)
862
+ * @returns Promise<UpdateDeviceTypeResponse> Resolves with the device type update response
863
+ * @throws Error If the update fails
864
+ * @example
865
+ * ```typescript
866
+ * const cc = webex.cc;
867
+ *
868
+ * // Switch from browser to extension
869
+ * try {
870
+ * await cc.updateAgentProfile({
871
+ * loginOption: 'EXTENSION',
872
+ * dialNumber: '1234', // Required for EXTENSION
873
+ * teamId: 'currentTeam' // Optional: uses current team if not specified
874
+ * });
875
+ * } catch (error) {
876
+ * console.error('Failed to update device:', error.message);
877
+ * }
878
+ * ```
879
+ * @public
880
+ */
881
+ updateAgentProfile(data: AgentProfileUpdate): Promise<UpdateDeviceTypeResponse>;
882
+ /**
883
+ * Returns paginated entry points for the organization.
884
+ * Thin wrapper around internal EntryPoint instance.
885
+ * @public
886
+ */
887
+ getEntryPoints(params?: EntryPointSearchParams): Promise<EntryPointListResponse>;
888
+ /**
889
+ * Returns paginated contact service queues for the organization.
890
+ * Thin wrapper around internal Queue instance.
891
+ * @public
892
+ */
893
+ getQueues(params?: ContactServiceQueueSearchParams): Promise<ContactServiceQueuesResponse>;
894
+ }