@webex/contact-center 3.12.0-webex-services-ready.4 → 3.13.0
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.
- package/.sdd/manifest.json +24 -13
- package/ai-docs/ARCHITECTURE.md +1 -1
- package/ai-docs/CONTRACTS.md +19 -3
- package/ai-docs/SECURITY.md +1 -1
- package/ai-docs/SERVICE_STATE.md +4 -0
- package/ai-docs/contact-center-spec.md +50 -6
- package/ai-docs/features/consult-transfer-list-policy/spec/feature-spec.md +362 -0
- package/ai-docs/features/contact-owner-change-refactor.md +78 -0
- package/dist/cc.js +757 -22
- package/dist/cc.js.map +1 -1
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +23 -2
- package/dist/constants.js.map +1 -1
- package/dist/index.js +34 -12
- package/dist/index.js.map +1 -1
- package/dist/metrics/MetricsManager.js +16 -0
- package/dist/metrics/MetricsManager.js.map +1 -1
- package/dist/metrics/behavioral-events.js +110 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +33 -0
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/AddressBook.js +18 -15
- package/dist/services/AddressBook.js.map +1 -1
- package/dist/services/AnswerCallOnWebexService.js +202 -0
- package/dist/services/AnswerCallOnWebexService.js.map +1 -0
- package/dist/services/ApiAiAssistant.js +221 -11
- package/dist/services/ApiAiAssistant.js.map +1 -1
- package/dist/services/EntryPoint.js +46 -68
- package/dist/services/EntryPoint.js.map +1 -1
- package/dist/services/Queue.js +27 -22
- package/dist/services/Queue.js.map +1 -1
- package/dist/services/WebCallingService.js +10 -2
- package/dist/services/WebCallingService.js.map +1 -1
- package/dist/services/WebexCrossClientService.js +225 -0
- package/dist/services/WebexCrossClientService.js.map +1 -0
- package/dist/services/WxAppTelephonyMercurySync.js +111 -0
- package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
- package/dist/services/config/Util.js +46 -46
- package/dist/services/config/Util.js.map +1 -1
- package/dist/services/config/constants.js +34 -77
- package/dist/services/config/constants.js.map +1 -1
- package/dist/services/config/index.js +100 -226
- package/dist/services/config/index.js.map +1 -1
- package/dist/services/config/types.js +51 -18
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/constants.js +11 -1
- package/dist/services/constants.js.map +1 -1
- package/dist/services/core/Err.js.map +1 -1
- package/dist/services/core/Utils.js +25 -1
- package/dist/services/core/Utils.js.map +1 -1
- package/dist/services/core/WebexRequest.js +6 -2
- package/dist/services/core/WebexRequest.js.map +1 -1
- package/dist/services/core/aqm-reqs.js +17 -11
- package/dist/services/core/aqm-reqs.js.map +1 -1
- package/dist/services/core/constants.js +9 -1
- package/dist/services/core/constants.js.map +1 -1
- package/dist/services/core/types.js.map +1 -1
- package/dist/services/core/websocket/WebSocketManager.js +17 -1
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
- package/dist/services/task/Task.js +275 -8
- package/dist/services/task/Task.js.map +1 -1
- package/dist/services/task/TaskFactory.js +11 -6
- package/dist/services/task/TaskFactory.js.map +1 -1
- package/dist/services/task/TaskManager.js +590 -42
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/TaskUtils.js +11 -1
- package/dist/services/task/TaskUtils.js.map +1 -1
- package/dist/services/task/WebexCallingUtils.js +70 -0
- package/dist/services/task/WebexCallingUtils.js.map +1 -0
- package/dist/services/task/constants.js +14 -2
- package/dist/services/task/constants.js.map +1 -1
- package/dist/services/task/contact.js +29 -0
- package/dist/services/task/contact.js.map +1 -1
- package/dist/services/task/digital/Digital.js +4 -3
- package/dist/services/task/digital/Digital.js.map +1 -1
- package/dist/services/task/state-machine/TaskStateMachine.js +162 -53
- package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -1
- package/dist/services/task/state-machine/actions.js +6 -1
- package/dist/services/task/state-machine/actions.js.map +1 -1
- package/dist/services/task/state-machine/guards.js +7 -10
- package/dist/services/task/state-machine/guards.js.map +1 -1
- package/dist/services/task/state-machine/types.js.map +1 -1
- package/dist/services/task/state-machine/uiControlsComputer.js +118 -18
- package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -1
- package/dist/services/task/types.js +47 -1
- package/dist/services/task/types.js.map +1 -1
- package/dist/services/task/voice/Voice.js +477 -17
- package/dist/services/task/voice/Voice.js.map +1 -1
- package/dist/services/task/voice/WebRTC.js +6 -3
- package/dist/services/task/voice/WebRTC.js.map +1 -1
- package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
- package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
- package/dist/services/task/voice/wxAppVoiceMethods.js +395 -0
- package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
- package/dist/services/wxAppDiagnosticLogging.js +159 -0
- package/dist/services/wxAppDiagnosticLogging.js.map +1 -0
- package/dist/services/wxAppTelephonyUtils.js +19 -0
- package/dist/services/wxAppTelephonyUtils.js.map +1 -0
- package/dist/types/cc.d.ts +102 -8
- package/dist/types/config.d.ts +7 -0
- package/dist/types/constants.d.ts +21 -0
- package/dist/types/index.d.ts +34 -15
- package/dist/types/metrics/MetricsManager.d.ts +6 -0
- package/dist/types/metrics/constants.d.ts +31 -0
- package/dist/types/services/AddressBook.d.ts +2 -1
- package/dist/types/services/AnswerCallOnWebexService.d.ts +38 -0
- package/dist/types/services/ApiAiAssistant.d.ts +48 -4
- package/dist/types/services/EntryPoint.d.ts +7 -5
- package/dist/types/services/Queue.d.ts +5 -3
- package/dist/types/services/WebexCrossClientService.d.ts +32 -0
- package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
- package/dist/types/services/config/Util.d.ts +4 -8
- package/dist/types/services/config/constants.d.ts +28 -76
- package/dist/types/services/config/index.d.ts +16 -64
- package/dist/types/services/config/types.d.ts +146 -173
- package/dist/types/services/constants.d.ts +9 -0
- package/dist/types/services/core/Err.d.ts +2 -0
- package/dist/types/services/core/Utils.d.ts +10 -0
- package/dist/types/services/core/WebexRequest.d.ts +1 -0
- package/dist/types/services/core/constants.d.ts +7 -0
- package/dist/types/services/core/types.d.ts +2 -0
- package/dist/types/services/task/Task.d.ts +34 -5
- package/dist/types/services/task/TaskFactory.d.ts +4 -2
- package/dist/types/services/task/TaskUtils.d.ts +6 -0
- package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
- package/dist/types/services/task/constants.d.ts +12 -0
- package/dist/types/services/task/contact.d.ts +4 -0
- package/dist/types/services/task/digital/Digital.d.ts +4 -3
- package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +304 -56
- package/dist/types/services/task/state-machine/guards.d.ts +6 -5
- package/dist/types/services/task/state-machine/types.d.ts +9 -1
- package/dist/types/services/task/types.d.ts +192 -5
- package/dist/types/services/task/voice/Voice.d.ts +68 -11
- package/dist/types/services/task/voice/WebRTC.d.ts +5 -4
- package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
- package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +68 -0
- package/dist/types/services/wxAppDiagnosticLogging.d.ts +63 -0
- package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
- package/dist/types/types.d.ts +80 -13
- package/dist/types/utils/PageCache.d.ts +20 -3
- package/dist/types.js +54 -8
- package/dist/types.js.map +1 -1
- package/dist/utils/PageCache.js +19 -5
- package/dist/utils/PageCache.js.map +1 -1
- package/dist/webex.js +9 -1
- package/dist/webex.js.map +1 -1
- package/package.json +10 -9
- package/src/cc.ts +969 -38
- package/src/config.ts +7 -0
- package/src/constants.ts +24 -0
- package/src/index.ts +39 -10
- package/src/metrics/MetricsManager.ts +16 -0
- package/src/metrics/ai-docs/metrics-spec.md +138 -21
- package/src/metrics/behavioral-events.ts +112 -0
- package/src/metrics/constants.ts +36 -0
- package/src/services/AddressBook.ts +17 -6
- package/src/services/AnswerCallOnWebexService.ts +239 -0
- package/src/services/ApiAiAssistant.ts +297 -13
- package/src/services/EntryPoint.ts +59 -60
- package/src/services/Queue.ts +29 -12
- package/src/services/WebCallingService.ts +16 -2
- package/src/services/WebexCrossClientService.ts +298 -0
- package/src/services/WxAppTelephonyMercurySync.ts +142 -0
- package/src/services/agent/ai-docs/AGENTS.md +1 -1
- package/src/services/agent/ai-docs/agent-spec.md +1 -0
- package/src/services/ai-docs/AGENTS.md +10 -10
- package/src/services/ai-docs/services-spec.md +25 -5
- package/src/services/config/Util.ts +52 -82
- package/src/services/config/ai-docs/AGENTS.md +35 -40
- package/src/services/config/ai-docs/ARCHITECTURE.md +90 -103
- package/src/services/config/ai-docs/config-spec.md +132 -132
- package/src/services/config/constants.ts +39 -85
- package/src/services/config/index.ts +116 -277
- package/src/services/config/types.ts +140 -195
- package/src/services/constants.ts +10 -0
- package/src/services/core/Err.ts +1 -0
- package/src/services/core/Utils.ts +28 -0
- package/src/services/core/WebexRequest.ts +3 -1
- package/src/services/core/ai-docs/core-spec.md +25 -11
- package/src/services/core/aqm-reqs.ts +18 -12
- package/src/services/core/constants.ts +8 -0
- package/src/services/core/types.ts +33 -1
- package/src/services/core/websocket/WebSocketManager.ts +26 -2
- package/src/services/task/Task.ts +386 -12
- package/src/services/task/TaskFactory.ts +33 -6
- package/src/services/task/TaskManager.ts +857 -41
- package/src/services/task/TaskUtils.ts +13 -0
- package/src/services/task/WebexCallingUtils.ts +136 -0
- package/src/services/task/ai-docs/ARCHITECTURE.md +1 -0
- package/src/services/task/ai-docs/task-spec.md +190 -8
- package/src/services/task/constants.ts +13 -0
- package/src/services/task/contact.ts +30 -0
- package/src/services/task/digital/Digital.ts +11 -4
- package/src/services/task/state-machine/TaskStateMachine.ts +235 -81
- package/src/services/task/state-machine/actions.ts +5 -2
- package/src/services/task/state-machine/ai-docs/AGENTS.md +6 -4
- package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +35 -16
- package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +103 -33
- package/src/services/task/state-machine/guards.ts +7 -10
- package/src/services/task/state-machine/types.ts +16 -1
- package/src/services/task/state-machine/uiControlsComputer.ts +206 -32
- package/src/services/task/types.ts +269 -4
- package/src/services/task/voice/Voice.ts +625 -17
- package/src/services/task/voice/WebRTC.ts +11 -4
- package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
- package/src/services/task/voice/wxAppVoiceMethods.ts +575 -0
- package/src/services/wxAppDiagnosticLogging.ts +286 -0
- package/src/services/wxAppTelephonyUtils.ts +14 -0
- package/src/types.ts +108 -13
- package/src/utils/AGENTS.md +21 -10
- package/src/utils/PageCache.ts +38 -5
- package/src/utils/ai-docs/utils-spec.md +21 -11
- package/src/webex.js +8 -0
- package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
- package/test/unit/spec/cc.ts +3408 -152
- package/test/unit/spec/index.ts +885 -0
- package/test/unit/spec/metrics/MetricsManager.ts +25 -0
- package/test/unit/spec/metrics/behavioral-events.ts +60 -0
- package/test/unit/spec/services/AddressBook.ts +37 -6
- package/test/unit/spec/services/AnswerCallOnWebexService.ts +264 -0
- package/test/unit/spec/services/ApiAiAssistant.ts +269 -8
- package/test/unit/spec/services/EntryPoint.ts +87 -40
- package/test/unit/spec/services/Queue.ts +123 -12
- package/test/unit/spec/services/WebCallingService.ts +38 -0
- package/test/unit/spec/services/WebexCrossClientService.ts +509 -0
- package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +136 -0
- package/test/unit/spec/services/config/Util.ts +501 -0
- package/test/unit/spec/services/config/index.ts +313 -543
- package/test/unit/spec/services/core/Utils.ts +22 -0
- package/test/unit/spec/services/core/WebexRequest.ts +8 -7
- package/test/unit/spec/services/core/aqm-reqs.ts +142 -1
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +64 -14
- package/test/unit/spec/services/task/Task.ts +2257 -11
- package/test/unit/spec/services/task/TaskFactory.ts +56 -2
- package/test/unit/spec/services/task/TaskManager.ts +5559 -1493
- package/test/unit/spec/services/task/TaskUtils.ts +72 -0
- package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
- package/test/unit/spec/services/task/contact.ts +33 -0
- package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +1501 -92
- package/test/unit/spec/services/task/state-machine/guards.ts +210 -8
- package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +445 -7
- package/test/unit/spec/services/task/voice/Voice.ts +1710 -4
- package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
- package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +719 -0
- package/test/unit/spec/services/wxAppDiagnosticLogging.ts +179 -0
- package/test/unit/spec/wellnessSampleUtils.ts +288 -0
- package/typedoc.md +1 -1
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
| Doc kind | Module spec |
|
|
12
12
|
| Coverage score | Partial (manifest-authoritative); 15/15 required document fields present |
|
|
13
13
|
| Generated from | `module-spec` @ SDLC template library `0.2.1` |
|
|
14
|
-
| generated_by / approved_by / updated_at | Codex generator /
|
|
15
|
-
| Validation status |
|
|
14
|
+
| generated_by / approved_by / updated_at | Codex generator / Agent Wellness Break v0.4 intake audit / 2026-09-07 |
|
|
15
|
+
| Validation status | Agent Wellness Break v0.4 delta independently validated by claude-code on 2026-09-07; coverage remains Partial until the remaining baseline promotion criteria are satisfied |
|
|
16
16
|
|
|
17
17
|
## Evidence Rules
|
|
18
18
|
Every requirement cites stable source and test file paths. Code/tests are the behavioral referee; routed source text supplies explicit intent and rationale. Missing or contradictory evidence blocks promotion.
|
|
@@ -54,6 +54,8 @@ The `src/services/` directory is the service layer of the `@webex/contact-center
|
|
|
54
54
|
| **User Preferences** | [`UserPreference.ts`](../UserPreference.ts) | Direct REST CRUD service exposed as `cc.userPreference`; it resolves the default user from agent configuration and does not use PageCache |
|
|
55
55
|
| **Utilities** | [`src/utils/PageCache.ts`](../../utils/PageCache.ts) | Shared `PageCache<T>` generic class for pagination caching, plus `BaseSearchParams`, `PaginatedResponse`, and `PaginationMeta` types used by all data services |
|
|
56
56
|
| **WebRTC Calling** | [`WebCallingService.ts`](../WebCallingService.ts) | Browser-based voice calling via `@webex/calling`, line registration, call answer/mute/decline |
|
|
57
|
+
| **WxApp Better Together** | [`WebexCrossClientService.ts`](../WebexCrossClientService.ts), [`AnswerCallOnWebexService.ts`](../AnswerCallOnWebexService.ts), [`WxAppTelephonyMercurySync.ts`](../WxAppTelephonyMercurySync.ts) | usersub cross-client publish (`answer-calls-on-wxcc`), Hydra telephony REST (answer/reject/mute/DTMF/GET call), Mercury mute sync — orchestrated from `cc.ts` when `enableWxBetterTogether` is active |
|
|
58
|
+
| **AI Assistant / Wellness** | [`ApiAiAssistant.ts`](../ApiAiAssistant.ts) | Existing transcript/suggestion requests plus direct, session-validated wellness custom-event reporting. |
|
|
57
59
|
|
|
58
60
|
Each service folder contains its own `ai-docs/` with detailed documentation. **Always load the relevant service docs before making changes.**
|
|
59
61
|
|
|
@@ -68,7 +70,7 @@ Each service folder contains its own `ai-docs/` with detailed documentation. **A
|
|
|
68
70
|
|
|
69
71
|
**Paginated data services** (AddressBook, Queue, EntryPoint) do not have dedicated ai-docs. Read their source files directly — they follow shared REST/pagination/caching patterns documented in [`ai-docs/patterns/typescript-patterns.md`](../../../ai-docs/patterns/typescript-patterns.md). `UserPreference` is also a direct REST service, but it has CRUD semantics and does not use their PageCache pattern.
|
|
70
72
|
|
|
71
|
-
**WebCallingService** also has no dedicated ai-docs, but it follows a different pattern: EventEmitter-based call lifecycle orchestration around `@webex/calling` (`createClient`, line registration/deregistration, `ICall` events), `callTaskMap` tracking, and async registration flows with timeout handling. Read [`WebCallingService.ts`](../WebCallingService.ts) directly when changing browser calling behavior.
|
|
73
|
+
**WebCallingService** also has no dedicated ai-docs, but it follows a different pattern: EventEmitter-based call lifecycle orchestration around `@webex/calling` (`createClient`, line registration/deregistration, `ICall` events), `callTaskMap` tracking, and async registration flows with timeout handling. Before registering the calling line it resolves the RTMS domain from the u2c service catalog through `getRTMSDomain()`, which trusts the catalog host only when it is on the `ALLOWED_RTMS_DOMAIN` allow-list and otherwise falls back to `DEFAULT_RTMS_DOMAIN`. Read [`WebCallingService.ts`](../WebCallingService.ts) directly when changing browser calling behavior.
|
|
72
74
|
|
|
73
75
|
The `ContactCenter` plugin class (`cc.ts`) is the **only public entry point**. It delegates all backend work to the services layer:
|
|
74
76
|
|
|
@@ -210,6 +212,8 @@ Use [`constants.ts`](../constants.ts) as the canonical source for service-level
|
|
|
210
212
|
|
|
211
213
|
- `DEFAULT_RTMS_DOMAIN`, `WCC_CALLING_RTMS_DOMAIN` — RTMS/WebRTC domain constants
|
|
212
214
|
|
|
215
|
+
- `ALLOWED_RTMS_DOMAIN` — trusted RTMS domain suffix (`rtmsprod.net`); a catalog-provided RTMS host is used only when its hostname equals or is a subdomain of this value, otherwise `DEFAULT_RTMS_DOMAIN` is used
|
|
216
|
+
|
|
213
217
|
- `METHODS` — method name constants used by `WebCallingService`
|
|
214
218
|
|
|
215
219
|
## Key Files (source of truth)
|
|
@@ -227,7 +231,9 @@ Use [`constants.ts`](../constants.ts) as the canonical source for service-level
|
|
|
227
231
|
| Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
|
|
228
232
|
|---|---|---|---|---|---|---|
|
|
229
233
|
| `services.surface` | SDK / event / internal API | Internal `Services.getInstance()` composition root plus data-service and calling collaborators consumed by `ContactCenter`. | Stable module consumption boundary. | Additive changes by default; breaking package exports require a major-version transition. | `src/services/index.ts` | `../../../ai-docs/CONTRACTS.md` |
|
|
234
|
+
| `services.destination-lists` | SDK data API | Existing `Queue.getQueues(ContactServiceQueueSearchParams)` and `EntryPoint.getEntryPoints(EntryPointSearchParams)` methods with full-record paginated responses. | Apply consult/transfer telephony eligibility, profile views, and backend name ordering as overridable defaults. | Behavioral default correction on existing methods; no specialized method, projected response, or replacement signature. | `src/services/Queue.ts`, `src/services/EntryPoint.ts`, `src/types.ts` | `../../../ai-docs/CONTRACTS.md` |
|
|
230
235
|
| `services.user-preference` | SDK data API | `UserPreference` and `cc.userPreference`. | Direct REST CRUD for user preferences; separate from PageCache-based pagination services. | Additive semver-public API; removals or signature changes are breaking. | `src/services/UserPreference.ts`, `src/services/config/types.ts` | `../../../ai-docs/CONTRACTS.md` |
|
|
236
|
+
| `services.agent-wellness-break` | SDK data / action API | `ApiAIAssistant.requestWellnessBreak` and `respondToWellnessBreak`, invoked through `ContactCenter`. | Submit validated `WellnessBreakAction` custom events through direct HTTP. | Additive semver-public behavior; exact action/event payload is backend-owned. | `src/services/ApiAiAssistant.ts`, `src/types.ts` | `../../../ai-docs/CONTRACTS.md` |
|
|
231
237
|
|
|
232
238
|
Compatibility notes:
|
|
233
239
|
- Do not remove or reinterpret exported symbols/events without a documented consumer migration.
|
|
@@ -261,6 +267,10 @@ ContactCenter READY callback
|
|
|
261
267
|
| SERVICES-R-004 | Pass ApiAIAssistant, contact routing, WebCallingService, primary WebSocket, and RTD WebSocket into TaskManager. | Voice, task, transcript, and suggestion behavior depend on the complete collaborator set. | `src/cc.ts` | `test/unit/spec/services/task/TaskManager.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
|
|
262
268
|
| SERVICES-R-005 | Inherit authenticated request identity from the host Webex SDK through Core/WebexRequest; Services must not store, parse, or refresh credentials. | One host-owned authentication boundary avoids duplicate token handling and credential leakage across composed services. | `src/services/index.ts`, `src/services/core/WebexRequest.ts` | `test/unit/spec/services/core/WebexRequest.ts` | None; authentication ownership is explicit. | PRESENT |
|
|
263
269
|
| SERVICES-R-006 | Treat Services composition as unconditionally created by the ContactCenter READY callback; Services owns no rollout or feature-flag decision. | Capability flags belong to the consuming config/task/calling collaborators, so the composition root must not silently gate construction. | `src/services/index.ts`, `src/cc.ts` | `test/unit/spec/cc.ts` | None; rollout applicability is explicitly N/A for Services. | PRESENT |
|
|
270
|
+
| SERVICES-R-007 | Existing Queue and EntryPoint list methods must apply inbound, active, telephony, profile/agent-view, and `name,ASC` defaults while retaining their established parameter and full-record response types. Caller-supplied existing filter, sort, or profile inputs override defaults. Queue must also treat `sortOrder` without `sortBy` as a name sort and bypass the simple-page cache. | Defaults on the established methods let thin consumers request lists without a parallel API, while existing parameters preserve specialized behavior for other consumers and full-record types remain truthful because no field projection is requested. | `src/services/Queue.ts`, `src/services/EntryPoint.ts`, `src/types.ts` | `test/unit/spec/services/Queue.ts`, `test/unit/spec/services/EntryPoint.ts`, `test/unit/spec/cc.ts` | The backend honors the view flags and combined CMS sort value. | PRESENT |
|
|
271
|
+
| SERVICES-R-008 | ApiAIAssistant wellness requests must accept no public identity or context-mutating input, read effective enablement and non-empty SDK-owned organization/agent/session context from a read-only provider supplied at construction, then POST the exact `WellnessBreakAction` custom-event body directly to `/event`; only HTTP 202 resolves successfully. Public action unions derive from exported `as const` action-value objects. | SDK-owned live context prevents callers from supplying stale/different login identities to action calls, one value/type source prevents wire drift, and direct HTTP matches the AI event endpoint rather than AQM completion semantics. | `src/services/ApiAiAssistant.ts`, `src/types.ts`, `src/index.ts`, `src/cc.ts` | `test/unit/spec/services/ApiAiAssistant.ts`, `test/unit/spec/cc.ts` | None. | PRESENT |
|
|
272
|
+
| SERVICES-R-009 | `WebCallingService.getRTMSDomain()` returns a catalog-provided RTMS hostname only when it equals `ALLOWED_RTMS_DOMAIN` (`rtmsprod.net`) or is a subdomain of it; a parseable but non-allow-listed host, or a catalog value that is not a valid URL, falls back to `DEFAULT_RTMS_DOMAIN`. The rejected host is logged as a diagnostic before fallback. | The u2c service catalog is an untrusted input at the calling trust boundary; allow-listing the RTMS host prevents WebRTC registration against an attacker-controlled domain. | `src/services/WebCallingService.ts`, `src/services/constants.ts` | `test/unit/spec/services/WebCallingService.ts` | The `@webex/calling` client accepts the resolved domain string. | PRESENT |
|
|
273
|
+
| SERVICES-R-010 | `ApiAIAssistant.fetchHistoricTranscripts(agentId: string, interactionId: string): Promise<HistoricTranscriptsResponse>` validates both caller-supplied identifiers before building the authenticated request, accepting only non-empty strings matching the identifier format `^[A-Za-z0-9_-]{1,128}$`. Invalid inputs reject with a typed error and no request is sent. | `agentId`/`interactionId` are caller-controlled inputs on an authenticated request boundary; validating them before use rejects malformed identifiers instead of forwarding them to the backend. | `src/services/ApiAiAssistant.ts` | `test/unit/spec/services/ApiAiAssistant.ts` | Real-time transcription feature flag must already be enabled; format validation runs after that gate. | PRESENT |
|
|
264
274
|
|
|
265
275
|
## Design Overview
|
|
266
276
|
`Services` is a singleton composition root for transport-facing capabilities only. It constructs two `WebSocketManager` instances (primary Contact Center and RTD), creates `AqmReqs` on the primary manager, then creates config, agent, contact, dialer, and ConnectionService collaborators.
|
|
@@ -269,6 +279,8 @@ ContactCenter owns the broader READY-time graph: WebCallingService, ApiAIAssista
|
|
|
269
279
|
|
|
270
280
|
AQM factories return functions whose HTTP request is initiation and whose promise settles on correlated primary-WebSocket notifications. Direct config/data services return authenticated REST responses.
|
|
271
281
|
|
|
282
|
+
ApiAIAssistant wellness reporting is also direct REST, but it reads live context through a read-only provider supplied by ContactCenter at construction rather than a separate factory or context setter. It fails closed unless wellness is effectively enabled and the SDK owns a current organization, agent, and session; public action calls do not accept identity fields.
|
|
283
|
+
|
|
272
284
|
## Data Flow
|
|
273
285
|
```mermaid
|
|
274
286
|
flowchart TD
|
|
@@ -396,6 +408,7 @@ classDiagram
|
|
|
396
408
|
- **UC-2 Direct REST:** configuration, data, and user-preference services return authenticated HTTP results directly. Evidence: `src/services/config/index.ts`, `src/services/UserPreference.ts`, `test/unit/spec/services/config/index.ts`, `test/unit/spec/services/UserPreference.ts`.
|
|
397
409
|
- **UC-3 AQM operation:** initiate HTTP and settle only on matching WebSocket notification or timeout. Evidence: `src/services/core/aqm-reqs.ts`, `test/unit/spec/services/core/aqm-reqs.ts`.
|
|
398
410
|
- **UC-4 Task/AI realtime:** TaskManager consumes primary and RTD streams with ApiAIAssistant/calling collaborators. Evidence: `src/services/task/TaskManager.ts`, `test/unit/spec/services/task/TaskManager.ts`.
|
|
411
|
+
- **UC-5 Wellness action reporting:** validate the current profile/session context and submit a direct AI custom event that completes only on HTTP 202. Evidence: `src/services/ApiAiAssistant.ts`, `test/unit/spec/services/ApiAiAssistant.ts`.
|
|
399
412
|
|
|
400
413
|
## State Model
|
|
401
414
|
`Services` is a process-local singleton. Its first `getInstance({webex, connectionConfig})` call synchronously constructs the two WebSocket managers, AqmReqs-backed factories, config service, and ConnectionService; later calls return that same composed graph. Socket lifecycle and domain records are owned by the corresponding collaborators, not by a Services state machine.
|
|
@@ -406,6 +419,8 @@ classDiagram
|
|
|
406
419
|
- ApiAIAssistant, TaskManager, and UserPreference are READY-time ContactCenter collaborators, not fields constructed by Services.
|
|
407
420
|
- Authentication is inherited from the host SDK through Core/WebexRequest; Services owns no credential lifecycle.
|
|
408
421
|
- Rollout applicability is N/A for the Services composition root: it is created at READY and does not evaluate a feature flag.
|
|
422
|
+
- Untrusted external inputs are validated at the service trust boundary: catalog-provided RTMS hosts must pass the `ALLOWED_RTMS_DOMAIN` allow-list before use, and caller-supplied `agentId`/`interactionId` must match the accepted identifier format before an authenticated transcript request is built.
|
|
423
|
+
- ApiAIAssistant evaluates the current effective wellness flag and identities through its constructor-supplied read-only provider; the public object exposes no context mutator, and the Services singleton itself remains unconditionally composed.
|
|
409
424
|
|
|
410
425
|
## Concurrency & Reactive Flow
|
|
411
426
|
- `getInstance` composition is synchronous in the JavaScript execution turn. Direct REST promises can proceed independently, while each AQM promise remains pending until its matching primary-WebSocket notification, HTTP failure, or timeout.
|
|
@@ -419,7 +434,8 @@ These three services share an identical pattern. Use any one as a reference when
|
|
|
419
434
|
| **HTTP calls** | `this.webexRequest.request({service: WCC_API_GATEWAY, resource, method: HTTP_METHODS.GET})` |
|
|
420
435
|
| **Endpoints** | Uses `endPointMap` functions from `config/constants.ts` to build URL paths |
|
|
421
436
|
| **Pagination** | Query params with `page`, `pageSize`; uses `PageCache` for caching |
|
|
422
|
-
| **Caching** | `PageCache<T>` — caches pages for simple pagination
|
|
437
|
+
| **Caching** | `PageCache<T>` — caches pages for simple pagination and bypasses cache for result/shape variants, including an effective Queue sort |
|
|
438
|
+
| **Consult/transfer policy** | Existing Queue and EntryPoint methods apply telephony eligibility, profile views, and backend name ordering by default, accept overrides through their existing query parameters, and return full-record responses unchanged |
|
|
423
439
|
| **Metrics** | `timeEvent` on API call start, `trackEvent` on success/failure |
|
|
424
440
|
| **Logging** | `LoggerProxy` with `{module: 'ClassName', method: 'methodName'}` context |
|
|
425
441
|
| **Error handling** | try/catch with `LoggerProxy.error` + `metricsManager.trackEvent` for failures, then re-throw so callers receive the error |
|
|
@@ -443,7 +459,7 @@ stateDiagram-v2
|
|
|
443
459
|
```
|
|
444
460
|
|
|
445
461
|
## Protocol / Wire Format
|
|
446
|
-
- Request, response, and event payload ownership is anchored in `src/services/index.ts`. HTTP initiates backend work where applicable; WebSocket messages provide realtime events and, for AQM flows, correlated completion.
|
|
462
|
+
- Request, response, and event payload ownership is anchored in `src/services/index.ts`. HTTP initiates backend work where applicable; WebSocket messages provide realtime events and, for AQM flows, correlated completion. Wellness actions POST `CUSTOM_EVENT` / `WellnessBreakAction` bodies directly to `/event` and accept only status 202; wellness offers arrive as primary `Wellness_Break_Handler` notifications.
|
|
447
463
|
|
|
448
464
|
## Error Handling & Failure Modes
|
|
449
465
|
| Condition | Signal (error/code/result) | Caller recovery |
|
|
@@ -476,6 +492,10 @@ Unit tests mirror module paths under `test/unit/spec/services`. Preserve positiv
|
|
|
476
492
|
| `SERVICES-R-004` | `test/unit/spec/services/task/TaskManager.ts`, `test/unit/spec/cc.ts` | None. |
|
|
477
493
|
| `SERVICES-R-005` | `test/unit/spec/services/core/WebexRequest.ts` | None. |
|
|
478
494
|
| `SERVICES-R-006` | `test/unit/spec/cc.ts` | None. |
|
|
495
|
+
| `SERVICES-R-007` | `test/unit/spec/services/Queue.ts`, `test/unit/spec/services/EntryPoint.ts`, `test/unit/spec/cc.ts` | None. |
|
|
496
|
+
| `SERVICES-R-008` | `test/unit/spec/services/ApiAiAssistant.ts` | None. |
|
|
497
|
+
| `SERVICES-R-009` | `test/unit/spec/services/WebCallingService.ts` | Cover allowed host, subdomain, non-allow-listed host, and unparseable catalog value fallback. |
|
|
498
|
+
| `SERVICES-R-010` | `test/unit/spec/services/ApiAiAssistant.ts` | Cover valid identifiers plus empty, over-length, and disallowed-character rejections. |
|
|
479
499
|
|
|
480
500
|
## Traceability
|
|
481
501
|
- Repo architecture: `../../../ai-docs/ARCHITECTURE.md` · Registry: `../../../ai-docs/SPEC_INDEX.md`
|
|
@@ -1,56 +1,42 @@
|
|
|
1
1
|
import {LOST_CONNECTION_RECOVERY_TIMEOUT} from '../core/constants';
|
|
2
|
+
import {WELLNESS_BREAK_REMINDERS_ENABLED} from './constants';
|
|
2
3
|
import {
|
|
4
|
+
AgentProfile,
|
|
3
5
|
AgentResponse,
|
|
4
6
|
AuxCode,
|
|
5
7
|
AuxCodeType,
|
|
6
|
-
DesktopProfileResponse,
|
|
7
8
|
DialPlanEntity,
|
|
8
9
|
Entity,
|
|
9
10
|
IDLE_CODE,
|
|
10
|
-
|
|
11
|
-
OrgSettings,
|
|
11
|
+
OrgDesktopLoginResponse,
|
|
12
12
|
Profile,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
TeamList,
|
|
14
|
+
MicrosoftConfig,
|
|
15
|
+
WebexConfig,
|
|
16
16
|
WRAP_UP_CODE,
|
|
17
|
-
AIFeatureFlagsResponse,
|
|
18
|
-
AIFeatureFlags,
|
|
19
17
|
} from './types';
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
|
-
* Get the
|
|
23
|
-
* @param {
|
|
24
|
-
* @param {string} name
|
|
25
|
-
* @returns {string}
|
|
26
|
-
*/
|
|
27
|
-
const getUrlMapping = (urlMappings: Array<URLMapping>, name: string) => {
|
|
28
|
-
const mappedUrl = urlMappings.find((mapping) => mapping.name === name)?.url;
|
|
29
|
-
|
|
30
|
-
return mappedUrl || '';
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Get the MSFT and Webex configuration
|
|
35
|
-
* @param {DesktopProfileResponse} agentProfileData
|
|
20
|
+
* Get the MSFT configuration
|
|
21
|
+
* @param {MicrosoftConfig} microsoftConfig
|
|
36
22
|
* @returns {Object}
|
|
37
23
|
*/
|
|
38
|
-
const getMsftConfig = (
|
|
24
|
+
const getMsftConfig = (microsoftConfig?: MicrosoftConfig) => {
|
|
39
25
|
return {
|
|
40
|
-
showUserDetailsMS:
|
|
41
|
-
stateSynchronizationMS:
|
|
26
|
+
showUserDetailsMS: microsoftConfig?.showUserDetails ?? false,
|
|
27
|
+
stateSynchronizationMS: microsoftConfig?.stateSynchronization ?? false,
|
|
42
28
|
};
|
|
43
29
|
};
|
|
44
30
|
|
|
45
31
|
/**
|
|
46
32
|
* Get the Webex configuration
|
|
47
|
-
* @param {
|
|
33
|
+
* @param {WebexConfig} webexConfig
|
|
48
34
|
* @returns {Object}
|
|
49
35
|
*/
|
|
50
|
-
const getWebexConfig = (
|
|
36
|
+
const getWebexConfig = (webexConfig?: WebexConfig) => {
|
|
51
37
|
return {
|
|
52
|
-
showUserDetailsWebex:
|
|
53
|
-
stateSynchronizationWebex:
|
|
38
|
+
showUserDetailsWebex: webexConfig?.showUserDetails ?? false,
|
|
39
|
+
stateSynchronizationWebex: webexConfig?.stateSynchronization ?? false,
|
|
54
40
|
};
|
|
55
41
|
};
|
|
56
42
|
|
|
@@ -64,15 +50,16 @@ const getDefaultAgentDN = (agentDNValidation: string) => {
|
|
|
64
50
|
};
|
|
65
51
|
|
|
66
52
|
/**
|
|
67
|
-
* Get the
|
|
53
|
+
* Get the dialplan entries for every active plan in the organization.
|
|
54
|
+
* The desktop-login aggregate does not carry the per-profile `dialPlans` selection, so all active
|
|
55
|
+
* plans apply.
|
|
68
56
|
* @param {Array<DialPlanEntity>} dialPlanData
|
|
69
|
-
* @param {Array<string>} profileDialPlans
|
|
70
57
|
* @returns {Array<Entity>}
|
|
71
58
|
*/
|
|
72
|
-
const getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[]
|
|
59
|
+
const getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[]) => {
|
|
73
60
|
const dialPlanEntries = [];
|
|
74
61
|
dialPlanData.forEach((dailPlan: DialPlanEntity) => {
|
|
75
|
-
if (
|
|
62
|
+
if (dailPlan.active) {
|
|
76
63
|
const filteredPlan = {
|
|
77
64
|
regex: dailPlan.regularExpression,
|
|
78
65
|
prefix: dailPlan.prefix,
|
|
@@ -87,24 +74,17 @@ const getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[], profileDialP
|
|
|
87
74
|
};
|
|
88
75
|
|
|
89
76
|
/**
|
|
90
|
-
* Get the
|
|
77
|
+
* Get the active aux codes of the given type.
|
|
78
|
+
* The desktop-login aggregate does not carry the per-agent restriction lists, so the whole pool
|
|
79
|
+
* returned by the aux-code API applies.
|
|
91
80
|
* @param {Array<AuxCode>} auxCodes
|
|
92
81
|
* @param {AuxCodeType} type
|
|
93
|
-
* @param {Array<string>} specificCodes
|
|
94
82
|
* @returns {Array<Entity>}
|
|
95
83
|
*/
|
|
96
|
-
const getFilterAuxCodes = (
|
|
97
|
-
auxCodes: Array<AuxCode>,
|
|
98
|
-
type: AuxCodeType,
|
|
99
|
-
specificCodes: string[]
|
|
100
|
-
) => {
|
|
84
|
+
const getFilterAuxCodes = (auxCodes: Array<AuxCode>, type: AuxCodeType) => {
|
|
101
85
|
const filteredAuxCodes: Array<Entity> = [];
|
|
102
86
|
auxCodes.forEach((auxCode: AuxCode) => {
|
|
103
|
-
if (
|
|
104
|
-
auxCode.workTypeCode === type &&
|
|
105
|
-
auxCode.active &&
|
|
106
|
-
(specificCodes.length === 0 || specificCodes.includes(auxCode.id))
|
|
107
|
-
) {
|
|
87
|
+
if (auxCode.workTypeCode === type && auxCode.active) {
|
|
108
88
|
filteredAuxCodes.push({
|
|
109
89
|
id: auxCode.id,
|
|
110
90
|
name: auxCode.name,
|
|
@@ -132,30 +112,24 @@ function getDefaultWrapUpCode(wrapUpReasonList: Entity[]) {
|
|
|
132
112
|
* @returns {Profile}
|
|
133
113
|
*/
|
|
134
114
|
function parseAgentConfigs(profileData: {
|
|
115
|
+
orgConfig: OrgDesktopLoginResponse;
|
|
135
116
|
userData: AgentResponse;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
orgInfoData: OrgInfo;
|
|
117
|
+
agentProfileData: AgentProfile;
|
|
118
|
+
teamData: TeamList[];
|
|
139
119
|
auxCodes: AuxCode[];
|
|
140
|
-
orgSettingsData: OrgSettings;
|
|
141
|
-
agentProfileData: DesktopProfileResponse;
|
|
142
120
|
dialPlanData: DialPlanEntity[];
|
|
143
|
-
urlMapping: URLMapping[];
|
|
144
121
|
multimediaProfileId: string;
|
|
145
|
-
aiFeatureFlags: AIFeatureFlagsResponse;
|
|
146
122
|
}): Profile {
|
|
123
|
+
const {orgConfig, userData, agentProfileData, teamData, auxCodes, dialPlanData} = profileData;
|
|
147
124
|
const {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
tenantData,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
urlMapping,
|
|
157
|
-
aiFeatureFlags,
|
|
158
|
-
} = profileData;
|
|
125
|
+
organization: orgInfoData,
|
|
126
|
+
organizationSetting: orgSettingsData,
|
|
127
|
+
tenantConfiguration: tenantData,
|
|
128
|
+
urlMappings,
|
|
129
|
+
aiFeature,
|
|
130
|
+
microsoftConfig,
|
|
131
|
+
webexConfig,
|
|
132
|
+
} = orgConfig;
|
|
159
133
|
|
|
160
134
|
const tenantDataTimeout = tenantData.timeoutDesktopInactivityEnabled
|
|
161
135
|
? tenantData.timeoutDesktopInactivityMins
|
|
@@ -164,17 +138,9 @@ function parseAgentConfigs(profileData: {
|
|
|
164
138
|
? agentProfileData.timeoutDesktopInactivityMins
|
|
165
139
|
: tenantDataTimeout;
|
|
166
140
|
|
|
167
|
-
const wrapupCodes = getFilterAuxCodes(
|
|
168
|
-
auxCodes,
|
|
169
|
-
WRAP_UP_CODE,
|
|
170
|
-
agentProfileData.accessWrapUpCode === 'ALL' ? [] : agentProfileData.wrapUpCodes
|
|
171
|
-
);
|
|
141
|
+
const wrapupCodes = getFilterAuxCodes(auxCodes, WRAP_UP_CODE);
|
|
172
142
|
|
|
173
|
-
const idleCodes = getFilterAuxCodes(
|
|
174
|
-
auxCodes,
|
|
175
|
-
IDLE_CODE,
|
|
176
|
-
agentProfileData.accessIdleCode === 'ALL' ? [] : agentProfileData.idleCodes
|
|
177
|
-
);
|
|
143
|
+
const idleCodes = getFilterAuxCodes(auxCodes, IDLE_CODE);
|
|
178
144
|
|
|
179
145
|
idleCodes.push({
|
|
180
146
|
id: '0',
|
|
@@ -184,8 +150,10 @@ function parseAgentConfigs(profileData: {
|
|
|
184
150
|
}); // pushing available state to idle codes
|
|
185
151
|
|
|
186
152
|
const defaultWrapUpData = getDefaultWrapUpCode(wrapupCodes);
|
|
187
|
-
const
|
|
188
|
-
|
|
153
|
+
const isWellnessConfigured =
|
|
154
|
+
aiFeature?.agentWellbeing?.enable === true &&
|
|
155
|
+
aiFeature.agentWellbeing.wellnessBreakReminders === WELLNESS_BREAK_REMINDERS_ENABLED;
|
|
156
|
+
const hasAIAssistantLicense = (orgSettingsData.aiAssistantQuantity ?? 0) > 0;
|
|
189
157
|
|
|
190
158
|
const finalData = {
|
|
191
159
|
teams: teamData,
|
|
@@ -198,11 +166,10 @@ function parseAgentConfigs(profileData: {
|
|
|
198
166
|
agentName: `${userData.firstName} ${userData.lastName}`,
|
|
199
167
|
agentMailId: userData.email,
|
|
200
168
|
agentProfileID: userData.agentProfileId,
|
|
201
|
-
autoAnswer: agentProfileData.autoAnswer,
|
|
202
169
|
dialPlan: agentProfileData.dialPlanEnabled
|
|
203
170
|
? {
|
|
204
171
|
type: 'adhocDial',
|
|
205
|
-
dialPlanEntity: getFilteredDialplanEntries(dialPlanData
|
|
172
|
+
dialPlanEntity: getFilteredDialplanEntries(dialPlanData),
|
|
206
173
|
}
|
|
207
174
|
: undefined,
|
|
208
175
|
multimediaProfileId: profileData.multimediaProfileId,
|
|
@@ -210,7 +177,6 @@ function parseAgentConfigs(profileData: {
|
|
|
210
177
|
siteId: userData.siteId,
|
|
211
178
|
enterpriseId: orgInfoData.tenantId,
|
|
212
179
|
tenantTimezone: orgInfoData.timezone,
|
|
213
|
-
environment: orgInfoData.environment,
|
|
214
180
|
privacyShieldVisible: tenantData.privacyShieldVisible,
|
|
215
181
|
organizationIdleCodes: [], // TODO: for supervisor, getOrgFilteredIdleCodes(auxCodes, false),
|
|
216
182
|
idleCodesAccess: agentProfileData.accessIdleCode as 'ALL' | 'SPECIFIC',
|
|
@@ -238,6 +204,9 @@ function parseAgentConfigs(profileData: {
|
|
|
238
204
|
callVariablesSuppressed: tenantData.callVariablesSuppressed,
|
|
239
205
|
agentDbId: userData.dbId,
|
|
240
206
|
allowConsultToQueue: agentProfileData.consultToQueue,
|
|
207
|
+
accessQueue: agentProfileData.accessQueue,
|
|
208
|
+
accessEntryPoint: agentProfileData.accessEntryPoint,
|
|
209
|
+
accessBuddyTeam: agentProfileData.accessBuddyTeam,
|
|
241
210
|
agentPersonalStatsEnabled: agentProfileData.viewableStatistics
|
|
242
211
|
? agentProfileData.viewableStatistics.agentStats
|
|
243
212
|
: false,
|
|
@@ -246,8 +215,8 @@ function parseAgentConfigs(profileData: {
|
|
|
246
215
|
analyserUserId: userData.id,
|
|
247
216
|
|
|
248
217
|
urlMappings: {
|
|
249
|
-
acqueonApiUrl:
|
|
250
|
-
acqueonConsoleUrl:
|
|
218
|
+
acqueonApiUrl: urlMappings?.ACQUEON_API_URL ?? '',
|
|
219
|
+
acqueonConsoleUrl: urlMappings?.ACQUEON_CONSOLE_URL ?? '',
|
|
251
220
|
},
|
|
252
221
|
isTimeoutDesktopInactivityEnabled: tenantData.timeoutDesktopInactivityEnabled,
|
|
253
222
|
timeoutDesktopInactivityMins: inactivityTimeoutTimer,
|
|
@@ -256,11 +225,12 @@ function parseAgentConfigs(profileData: {
|
|
|
256
225
|
maskSensitiveData: orgSettingsData.maskSensitiveData
|
|
257
226
|
? orgSettingsData.maskSensitiveData
|
|
258
227
|
: false,
|
|
259
|
-
microsoftConfig: getMsftConfig(
|
|
260
|
-
webexConfig: getWebexConfig(
|
|
228
|
+
microsoftConfig: getMsftConfig(microsoftConfig),
|
|
229
|
+
webexConfig: getWebexConfig(webexConfig),
|
|
261
230
|
lostConnectionRecoveryTimeout:
|
|
262
231
|
tenantData.lostConnectionRecoveryTimeout || LOST_CONNECTION_RECOVERY_TIMEOUT,
|
|
263
232
|
aiFeature,
|
|
233
|
+
isWellnessBreakEnabled: isWellnessConfigured && hasAIAssistantLicense,
|
|
264
234
|
};
|
|
265
235
|
|
|
266
236
|
return finalData;
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
## Overview
|
|
12
12
|
|
|
13
13
|
The Config Service is an **internal service** that builds the comprehensive AgentProfile (`Profile` type) by:
|
|
14
|
-
1. Fetching user
|
|
15
|
-
2. Fetching desktop
|
|
14
|
+
1. Fetching the user desktop-login aggregate (agent identity plus `agentProfile`)
|
|
15
|
+
2. Fetching the organization desktop-login aggregate (org info, org settings, tenant configuration, URL mappings, AI feature, Microsoft/Webex config)
|
|
16
16
|
3. Fetching teams
|
|
17
17
|
4. Fetching aux codes (idle/wrapup codes)
|
|
18
|
-
5. Fetching
|
|
18
|
+
5. Fetching site and, when the agent profile enables it, dial-plan data
|
|
19
19
|
6. Aggregating all data into a single AgentProfile
|
|
20
20
|
|
|
21
21
|
The AgentProfile is the central configuration object required for an agent to operate within the contact center. It is built during the registration flow (`cc.register()`) and contains all the data an agent needs: identity, team assignments, dial plans, aux codes, login options, and feature flags. Once constructed, the AgentProfile is stored on the `ContactCenter` plugin instance as `this.agentConfig` and is used by other services (Agent, Task) throughout the session.
|
|
@@ -62,13 +62,13 @@ LoggerProxy.info(`Teams: ${this.agentConfig.teams}`, {
|
|
|
62
62
|
|
|
63
63
|
## Key Capabilities
|
|
64
64
|
|
|
65
|
-
- **AgentProfile Aggregation**: Combines data from
|
|
65
|
+
- **AgentProfile Aggregation**: Combines data from 6 API endpoints (5 when the agent profile disables dial plans)
|
|
66
66
|
- **Aux Codes Fetching**: Gets all idle and wrapup codes with pagination
|
|
67
67
|
- **Team Data**: Retrieves agent's team assignments
|
|
68
68
|
- **Dial Plan**: Fetches number transformation rules
|
|
69
69
|
- **Outdial ANI**: Retrieves outbound caller ID options (standalone, publicly exposed via `cc.ts`)
|
|
70
70
|
- **Multimedia Profile**: Fetches channel capacity and blending config (standalone, not yet publicly exposed)
|
|
71
|
-
- **Paginated Data Access**: `getListOfTeams` and `getListOfAuxCodes` support custom pagination independent of profile building
|
|
71
|
+
- **Paginated Data Access**: `getListOfTeams` and `getListOfAuxCodes` support custom pagination independent of profile building. `getListOfTeams` takes a `userDbId` — the `user.dbId` carried by the user desktop-login aggregate, not the CI user id — rather than a list of team ids
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
|
|
@@ -95,28 +95,20 @@ The AgentProfile is defined as the [`Profile`](../types.ts) type. This is not an
|
|
|
95
95
|
|
|
96
96
|
## Data Aggregation Flow
|
|
97
97
|
|
|
98
|
-
The following diagram shows how `getAgentConfig` orchestrates
|
|
98
|
+
The following diagram shows how `getAgentConfig` orchestrates six API calls and combines their results into the AgentProfile via `parseAgentConfigs()`:
|
|
99
99
|
|
|
100
100
|
```
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
│
|
|
113
|
-
getDesktopProfileById ─────┤
|
|
114
|
-
│
|
|
115
|
-
getSiteInfo ───────────────┤ (computes multimediaProfileId)
|
|
116
|
-
│
|
|
117
|
-
getAllTeams ────────────────┤
|
|
118
|
-
│
|
|
119
|
-
getDialPlanData ───────────┘
|
|
101
|
+
getUserDesktopLoginConfig ──┐ (awaited first; supplies dbId, siteId, dialPlanEnabled)
|
|
102
|
+
│
|
|
103
|
+
getOrgDesktopLoginConfig ───┤ (org info, org settings, tenant config, urlMappings,
|
|
104
|
+
│ aiFeature, microsoftConfig, webexConfig)
|
|
105
|
+
getAllAuxCodes ─────────────┼──► parseAgentConfigs() ──► AgentProfile
|
|
106
|
+
│
|
|
107
|
+
getAllTeams ────────────────┤ (filtered by userId == user.dbId)
|
|
108
|
+
│
|
|
109
|
+
getSiteInfo ────────────────┤ (team → site fallback for multimediaProfileId)
|
|
110
|
+
│
|
|
111
|
+
getDialPlanData ────────────┘ (only when agentProfile.dialPlanEnabled)
|
|
120
112
|
```
|
|
121
113
|
|
|
122
114
|
---
|
|
@@ -130,12 +122,12 @@ Main method that aggregates all configuration data into the AgentProfile.
|
|
|
130
122
|
**Returns**: `Promise<Profile>`
|
|
131
123
|
|
|
132
124
|
**Flow**:
|
|
133
|
-
1.
|
|
134
|
-
2.
|
|
135
|
-
3. Fetch
|
|
136
|
-
4. Fetch
|
|
137
|
-
5.
|
|
138
|
-
6.
|
|
125
|
+
1. Fire the user aggregate (`getUserDesktopLoginConfig`), the org aggregate (`getOrgDesktopLoginConfig`) and aux codes (`getAllAuxCodes`) in parallel
|
|
126
|
+
2. Await the user aggregate — it supplies `user.dbId`, `user.siteId` and `agentProfile.dialPlanEnabled`
|
|
127
|
+
3. Fetch site info (`getSiteInfo`) and teams filtered by `userId` (`getAllTeams`)
|
|
128
|
+
4. Fetch dial plan if `agentProfile.dialPlanEnabled` (`getDialPlanData`)
|
|
129
|
+
5. `Promise.all` the five remaining promises
|
|
130
|
+
6. Resolve `multimediaProfileId` from the team value, falling back to the site value
|
|
139
131
|
7. Parse and combine all data (`parseAgentConfigs`)
|
|
140
132
|
|
|
141
133
|
---
|
|
@@ -148,7 +140,7 @@ These methods exist in `AgentConfigService` but are **not** part of the `getAgen
|
|
|
148
140
|
|--------|--------|---------|-------------|
|
|
149
141
|
| `getOutdialAniEntries(orgId, params)` | **Publicly exposed** via `cc.getOutdialAniEntries()` | `OutdialAniEntriesResponse` | Fetch outbound ANI entries for caller ID selection. Supports pagination and search via [`OutdialAniParams`](../types.ts). |
|
|
150
142
|
| `getMultimediaProfileById(orgId, multimediaProfileId)` | **Not exposed, never called** | `MultimediaProfileResponse` | Fetch channel capacities (chat, email, telephony, social) and blending config. Available but unused anywhere. |
|
|
151
|
-
| `getListOfTeams(orgId, page, pageSize,
|
|
143
|
+
| `getListOfTeams(orgId, page, pageSize, userDbId)` | Used internally by `getAllTeams()` | `ListTeamsResponse` | Single-page team fetch with pagination metadata, filtered by `user.dbId` (the wire field is `filter=userId==` but the value is the database id, not the CI user id). The filter value must stay unquoted — the quoted form returns HTTP 400. |
|
|
152
144
|
| `getListOfAuxCodes(orgId, page, pageSize, filter, attributes)` | Used internally by `getAllAuxCodes()` | `ListAuxCodesResponse` | Single-page aux code fetch with pagination metadata. Useful for custom pagination. |
|
|
153
145
|
|
|
154
146
|
Additionally, the following endpoints are defined in `constants.ts` `endPointMap` but are consumed by separate service classes, not by `AgentConfigService`:
|
|
@@ -156,7 +148,7 @@ Additionally, the following endpoints are defined in `constants.ts` `endPointMap
|
|
|
156
148
|
| Endpoint | Used By | Description |
|
|
157
149
|
|----------|---------|-------------|
|
|
158
150
|
| `queueList` | [`Queue.ts`](../../Queue.ts) | Fetch contact service queues |
|
|
159
|
-
| `
|
|
151
|
+
| `entryPointDialNumberList` | [`EntryPoint.ts`](../../EntryPoint.ts) | Fetch profile-scoped entry-point dial-number mappings |
|
|
160
152
|
| `addressBookEntries` | [`AddressBook.ts`](../../AddressBook.ts) | Fetch address book entries |
|
|
161
153
|
|
|
162
154
|
---
|
|
@@ -168,23 +160,26 @@ Types used by the config service, all defined in [`types.ts`](../types.ts):
|
|
|
168
160
|
| Type | Description |
|
|
169
161
|
|------|-------------|
|
|
170
162
|
| `Profile` | Final aggregated agent config returned by `getAgentConfig()` |
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
163
|
+
| `OrgDesktopLoginResponse` | Response from `getOrgDesktopLoginConfig()` — `organization`, `organizationSetting`, `tenantConfiguration`, `urlMappings`, `aiFeature`, `microsoftConfig`, `webexConfig` |
|
|
164
|
+
| `UserDesktopLoginResponse` | Response from `getUserDesktopLoginConfig()` — `user` and `agentProfile` sections |
|
|
165
|
+
| `AgentResponse` | `user` section of the user aggregate — agent metadata, `dbId`, `siteId`, `agentProfileId` |
|
|
166
|
+
| `AgentProfile` | `agentProfile` section of the user aggregate — layout, dial-plan enablement, login options |
|
|
173
167
|
| `TeamList` | Team record from API — `id`, `name`, `teamType`, `siteId`, `multiMediaProfileId` |
|
|
174
168
|
| `ListTeamsResponse` | Paginated wrapper around `TeamList[]` with `meta` for pagination |
|
|
175
169
|
| `OrgInfo` | Organization info — `tenantId`, timezone |
|
|
176
170
|
| `OrgSettings` | Org feature flags — `webRtcEnabled`, `sensitiveDataMaskingEnabled` |
|
|
177
171
|
| `TenantData` | Tenant-level config — inactivity timeout, `forceDefaultDn`, `outdialEnabled` |
|
|
178
172
|
| `SiteInfo` | Site config — `id`, `name`, `multimediaProfileId` |
|
|
179
|
-
| `
|
|
173
|
+
| `OrgUrlMappings` | Keyed external URL mappings — `ACQUEON_API_URL`, `ACQUEON_CONSOLE_URL` |
|
|
174
|
+
| `MicrosoftConfig` | Org-level Microsoft presence config — `showUserDetails`, `stateSynchronization` |
|
|
175
|
+
| `WebexConfig` | Org-level Webex presence config — `showUserDetails`, `stateSynchronization` |
|
|
180
176
|
| `MultimediaProfileResponse` | Multimedia profile — channel capacities and settings |
|
|
181
177
|
| `AuxCode` | Auxiliary code record — `id`, `name`, `description`, `workTypeCode` |
|
|
182
178
|
| `ListAuxCodesResponse` | Paginated wrapper around `AuxCode[]` with `meta` |
|
|
183
|
-
| `DialPlanEntity` | Dial plan rule — regex pattern, prefix, strip digits |
|
|
179
|
+
| `DialPlanEntity` | Dial plan rule — regex pattern, prefix, strip digits, `active` |
|
|
184
180
|
| `Entity` | Basic entity info — `isSystem`, `name`, `id`, `description` |
|
|
185
181
|
| `WrapupData` | Wrap-up config — auto-wrapup settings, available wrapup codes |
|
|
186
182
|
| `OutdialAniParams` | Parameters for `getOutdialAniEntries()` — ANI ID, pagination, filtering |
|
|
187
|
-
| `Team` | Simplified team shape in `Profile` — `teamId`, `teamName`, `desktopLayoutId` |
|
|
188
183
|
|
|
189
184
|
## Events (CC_EVENTS)
|
|
190
185
|
|
|
@@ -212,14 +207,14 @@ Key types in `services/config/types.ts`:
|
|
|
212
207
|
| `CC_TASK_EVENTS` | Task-specific events |
|
|
213
208
|
| `AuxCode` | Idle/wrapup code definition |
|
|
214
209
|
| `Team` | Team configuration |
|
|
215
|
-
| `
|
|
210
|
+
| `AgentProfile` | Agent profile settings from the user aggregate |
|
|
216
211
|
| `LoginOption` | Login types (BROWSER, EXTENSION, AGENT_DN) |
|
|
217
212
|
|
|
218
213
|
---
|
|
219
214
|
|
|
220
215
|
## Error Handling
|
|
221
216
|
|
|
222
|
-
All API methods within the config service throw errors on failure. Since `getAgentConfig` calls multiple sub-APIs (`
|
|
217
|
+
All API methods within the config service throw errors on failure. Since `getAgentConfig` calls multiple sub-APIs (`getUserDesktopLoginConfig`, `getOrgDesktopLoginConfig`, `getAllAuxCodes`, `getAllTeams`, `getSiteInfo`, `getDialPlanData`) and awaits them via `Promise.all`, **a failure in any single sub-API will cause the entire AgentProfile fetch to fail**. There is no partial profile — either all data is successfully fetched and aggregated, or the operation throws.
|
|
223
218
|
|
|
224
219
|
```typescript
|
|
225
220
|
try {
|