@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 / developer-approved
|
|
15
|
-
| Validation status |
|
|
14
|
+
| generated_by / approved_by / updated_at | Codex generator / developer-approved desktop-login aggregate migration delta / 2026-10-05 |
|
|
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.
|
|
@@ -27,21 +27,21 @@ Config is one of nine confirmed Contact Center SDK modules. Own retrieval and ag
|
|
|
27
27
|
|
|
28
28
|
The Config Service is an **internal service** that builds the comprehensive AgentProfile (`Profile` type) by:
|
|
29
29
|
|
|
30
|
-
1. Fetching user
|
|
30
|
+
1. Fetching the user desktop-login aggregate (agent identity plus `agentProfile`)
|
|
31
31
|
|
|
32
|
-
2. Fetching desktop
|
|
32
|
+
2. Fetching the organization desktop-login aggregate (org info, org settings, tenant configuration, URL mappings, AI feature, Microsoft/Webex config)
|
|
33
33
|
|
|
34
34
|
3. Fetching teams
|
|
35
35
|
|
|
36
36
|
4. Fetching aux codes (idle/wrapup codes)
|
|
37
37
|
|
|
38
|
-
5. Fetching
|
|
38
|
+
5. Fetching site and, when the agent profile enables it, dial-plan data
|
|
39
39
|
|
|
40
40
|
6. Aggregating all data into a single AgentProfile
|
|
41
41
|
|
|
42
42
|
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.
|
|
43
43
|
|
|
44
|
-
- **AgentProfile Aggregation**: Combines data from
|
|
44
|
+
- **AgentProfile Aggregation**: Combines data from 6 API endpoints (5 when the agent profile disables dial plans)
|
|
45
45
|
|
|
46
46
|
- **Aux Codes Fetching**: Gets all idle and wrapup codes with pagination
|
|
47
47
|
|
|
@@ -53,7 +53,7 @@ The AgentProfile is the central configuration object required for an agent to op
|
|
|
53
53
|
|
|
54
54
|
- **Multimedia Profile**: Fetches channel capacity and blending config (standalone, not yet publicly exposed)
|
|
55
55
|
|
|
56
|
-
- **Paginated Data Access**: `getListOfTeams` and `getListOfAuxCodes` support custom pagination independent of profile building
|
|
56
|
+
- **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
|
|
57
57
|
|
|
58
58
|
## Purpose / Responsibility
|
|
59
59
|
Own retrieval and aggregation of remote organization, agent, team, profile, auxiliary-code, dial-plan, and feature configuration.
|
|
@@ -94,12 +94,15 @@ services/config/
|
|
|
94
94
|
|---|---|---|
|
|
95
95
|
| `getAgentConfig(orgId, agentId)` | staged, all-or-nothing `Promise<Profile>` aggregation | `src/services/config/index.ts` |
|
|
96
96
|
| User/profile/site/team/aux-code fetches | typed REST methods including pagination helpers | `src/services/config/index.ts`, `src/services/config/types.ts` |
|
|
97
|
-
| `
|
|
98
|
-
| `
|
|
97
|
+
| `getOrgDesktopLoginConfig(orgId)` | `OrgDesktopLoginResponse` from `organization/{orgId}/desktop-login` | `src/services/config/index.ts`, `src/services/config/constants.ts` |
|
|
98
|
+
| `getUserDesktopLoginConfig(orgId, ciUserId)` | `UserDesktopLoginResponse` from `organization/{orgId}/v2/user/by-ci-user-id/{ciUserId}/desktop-login` | `src/services/config/index.ts`, `src/services/config/constants.ts` |
|
|
99
|
+
| `Profile.aiFeature` | optional `aiFeature` section of the organization aggregate, mapped by `parseAgentConfigs` | `src/services/config/Util.ts`, `src/services/config/types.ts` |
|
|
99
100
|
| Multimedia profile | `MultimediaProfileResponse` | `src/services/config/types.ts` |
|
|
100
101
|
| Organization masking | `OrgSettings.maskSensitiveData` | `src/services/config/types.ts`, `src/services/config/Util.ts` |
|
|
101
102
|
| Auxiliary-code list URL | includes `desktopProfileFilter=true` | `src/services/config/constants.ts` |
|
|
102
103
|
| Outdial ANI entries | public wrapper through ContactCenter | `src/services/config/index.ts`, `src/cc.ts` |
|
|
104
|
+
| `Profile.isWellnessBreakEnabled` | required effective flag derived from backend AI feature configuration and organization license quantity | `src/services/config/Util.ts`, `src/services/config/types.ts` |
|
|
105
|
+
| `getWellbeingBreakIdleCode(orgId)` | paginated exact lookup for the active system idle code named `WellbeingBreak`, exposed and registration-cached by ContactCenter | `src/services/config/index.ts`, `src/services/config/constants.ts`, `src/cc.ts` |
|
|
103
106
|
|
|
104
107
|
The service has no `TeamList.channelMap` contract. Exact package exports are indexed in root `CONTRACTS.md`.
|
|
105
108
|
|
|
@@ -111,11 +114,13 @@ The service has no `TeamList.channelMap` contract. Exact package exports are ind
|
|
|
111
114
|
## Requirements
|
|
112
115
|
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
113
116
|
|---|---|---|---|---|---|---|
|
|
114
|
-
| CONFIG-R-001 | Fetch user
|
|
115
|
-
| CONFIG-R-002 | Include `
|
|
117
|
+
| CONFIG-R-001 | Fetch the user desktop-login aggregate first, then aggregate five dependent promises: the organization desktop-login aggregate, auxiliary codes, teams, site, and the conditional dial plan. | Dependent IDs and all-or-nothing consistency require staged orchestration. | `src/services/config/index.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
|
|
118
|
+
| CONFIG-R-002 | Include the organization aggregate's `aiFeature` section in `parseAgentConfigs` so `Profile.aiFeature` reflects the organization feature contract. | ApiAIAssistant behavior is gated by the remote organization feature contract. | `src/services/config/index.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
|
|
116
119
|
| CONFIG-R-003 | Paginate teams and auxiliary codes until completion and include `desktopProfileFilter=true` for auxiliary-code requests. | A partial or unfiltered set yields invalid profile/team/auxiliary choices. | `src/services/config/constants.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
|
|
117
120
|
| CONFIG-R-004 | Expose current response/field names: `MultimediaProfileResponse`, `OrgSettings.maskSensitiveData`, and real TeamList fields only. | Type-name drift causes invalid consumer code and incorrect privacy behavior. | `src/services/config/types.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
|
|
118
121
|
| CONFIG-R-005 | Reject the entire profile aggregation when any required dependent request fails. | Consumers must never receive an internally inconsistent partial Profile. | `src/services/config/index.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
|
|
122
|
+
| CONFIG-R-006 | Always populate `Profile.isWellnessBreakEnabled`; set it true only when `agentWellbeing.enable` is true, `wellnessBreakReminders` is `ENABLED`, and `OrgSettings.aiAssistantQuantity` is greater than zero. Missing or null inputs fail closed. | Hosts need one license-and-server-rollout-aware signal rather than reconstructing partial configuration. | `src/services/config/Util.ts`, `src/services/config/types.ts` | `test/unit/spec/services/config/Util.ts` | The supported SDK contracts expose no separate rollout response field; backend delivery of enabled `agentWellbeing` configuration is the rollout decision. | PRESENT |
|
|
123
|
+
| CONFIG-R-007 | Retrieve the wellness idle code from `/v2/auxiliary-code` using `workType=IDLE_CODE`, `customFilter=isSystemCode==true`, and `desktopProfileFilter=false`; follow pagination and accept only the exact active system code name `WellbeingBreak`. | The dedicated state must be independent of desktop-profile filtering and must never fall back to a similarly named or non-system code. | `src/services/config/index.ts`, `src/services/config/constants.ts` | `test/unit/spec/services/config/index.ts` | None. | PRESENT |
|
|
119
124
|
|
|
120
125
|
## Design Overview
|
|
121
126
|
Config separates its stable consumption boundary from collaborators so ownership and failure behavior stay explicit. Profile creation is all-or-nothing across dependent API calls so consumers never receive internally inconsistent partial configuration.
|
|
@@ -158,31 +163,28 @@ The AgentProfile is defined as the [`Profile`](../types.ts) type. This is not an
|
|
|
158
163
|
| `dialPlan` | [`DialPlan`](../types.ts) | Number transformation rules |
|
|
159
164
|
| `isOutboundEnabledForAgent` | boolean | Outbound calling allowed |
|
|
160
165
|
| `outDialEp` | string | Outbound entry point ID |
|
|
166
|
+
| `allowConsultToQueue` | boolean | Whether consult-to-queue is enabled on the Desktop Profile |
|
|
167
|
+
| `accessQueue` | `'ALL' \| 'SPECIFIC' \| 'NONE'` | Collaboration tab queue access scope from Desktop Profile |
|
|
168
|
+
| `accessEntryPoint` | `'ALL' \| 'SPECIFIC' \| 'NONE'` | Collaboration tab entry-point access scope from Desktop Profile |
|
|
169
|
+
| `accessBuddyTeam` | `'ALL' \| 'SPECIFIC' \| 'NONE'` | Collaboration tab buddy-team access scope from Desktop Profile |
|
|
170
|
+
| `isWellnessBreakEnabled` | boolean | Effective wellness gate derived from backend enablement/reminder configuration and positive AI Assistant license quantity |
|
|
161
171
|
|
|
162
|
-
|
|
172
|
+
`parseAgentConfigs()` maps the three `access*` fields from the user aggregate's `AgentProfile` section onto the public `Profile` returned by `cc.register()`.
|
|
173
|
+
|
|
174
|
+
The following diagram shows how `getAgentConfig` orchestrates six API calls and combines their results into the AgentProfile via `parseAgentConfigs()`:
|
|
163
175
|
|
|
164
176
|
```text
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
│
|
|
177
|
-
getAllAuxCodes ─────────────┤
|
|
178
|
-
│
|
|
179
|
-
getDesktopProfileById ─────┤
|
|
180
|
-
│
|
|
181
|
-
getSiteInfo ───────────────┤ (computes multimediaProfileId)
|
|
182
|
-
│
|
|
183
|
-
getAllTeams ────────────────┤
|
|
184
|
-
│
|
|
185
|
-
getDialPlanData ───────────┘
|
|
177
|
+
getUserDesktopLoginConfig ──┐ (awaited first; supplies dbId, siteId, dialPlanEnabled)
|
|
178
|
+
│
|
|
179
|
+
getOrgDesktopLoginConfig ───┤ (org info, org settings, tenant config, urlMappings,
|
|
180
|
+
│ aiFeature, microsoftConfig, webexConfig)
|
|
181
|
+
getAllAuxCodes ─────────────┼──► parseAgentConfigs() ──► AgentProfile
|
|
182
|
+
│
|
|
183
|
+
getAllTeams ────────────────┤ (filtered by userId == user.dbId)
|
|
184
|
+
│
|
|
185
|
+
getSiteInfo ────────────────┤ (team → site fallback for multimediaProfileId)
|
|
186
|
+
│
|
|
187
|
+
getDialPlanData ────────────┘ (only when agentProfile.dialPlanEnabled)
|
|
186
188
|
```
|
|
187
189
|
|
|
188
190
|
Types used by the config service, all defined in [`types.ts`](../types.ts):
|
|
@@ -190,23 +192,26 @@ Types used by the config service, all defined in [`types.ts`](../types.ts):
|
|
|
190
192
|
| Type | Description |
|
|
191
193
|
|---|---|
|
|
192
194
|
| `Profile` | Final aggregated agent config returned by `getAgentConfig()` |
|
|
193
|
-
| `
|
|
194
|
-
| `
|
|
195
|
+
| `OrgDesktopLoginResponse` | Response from `getOrgDesktopLoginConfig()` — `organization`, `organizationSetting`, `tenantConfiguration`, `urlMappings`, `aiFeature`, `microsoftConfig`, `webexConfig` |
|
|
196
|
+
| `UserDesktopLoginResponse` | Response from `getUserDesktopLoginConfig()` — `user` and `agentProfile` sections |
|
|
197
|
+
| `AgentResponse` | `user` section of the user aggregate — agent metadata, `dbId`, `siteId`, `agentProfileId` |
|
|
198
|
+
| `AgentProfile` | `agentProfile` section of the user aggregate — layout, dial-plan enablement, login options |
|
|
195
199
|
| `TeamList` | Team record from API — `id`, `name`, `teamType`, `siteId`, `multiMediaProfileId` |
|
|
196
200
|
| `ListTeamsResponse` | Paginated wrapper around `TeamList[]` with `meta` for pagination |
|
|
197
201
|
| `OrgInfo` | Organization info — `tenantId`, timezone |
|
|
198
202
|
| `OrgSettings` | Org feature flags — `webRtcEnabled`, `maskSensitiveData` |
|
|
199
203
|
| `TenantData` | Tenant-level config — inactivity timeout, `forceDefaultDn`, `outdialEnabled` |
|
|
200
204
|
| `SiteInfo` | Site config — `id`, `name`, `multimediaProfileId` |
|
|
201
|
-
| `
|
|
205
|
+
| `OrgUrlMappings` | Keyed external URL mappings — `ACQUEON_API_URL`, `ACQUEON_CONSOLE_URL` |
|
|
206
|
+
| `MicrosoftConfig` | Org-level Microsoft presence config — `showUserDetails`, `stateSynchronization` |
|
|
207
|
+
| `WebexConfig` | Org-level Webex presence config — `showUserDetails`, `stateSynchronization` |
|
|
202
208
|
| `MultimediaProfileResponse` | Multimedia profile — channel capacities and settings |
|
|
203
209
|
| `AuxCode` | Auxiliary code record — `id`, `name`, `description`, `workTypeCode` |
|
|
204
210
|
| `ListAuxCodesResponse` | Paginated wrapper around `AuxCode[]` with `meta` |
|
|
205
|
-
| `DialPlanEntity` | Dial plan rule — regex pattern, prefix, strip digits |
|
|
211
|
+
| `DialPlanEntity` | Dial plan rule — regex pattern, prefix, strip digits, `active` |
|
|
206
212
|
| `Entity` | Basic entity info — `isSystem`, `name`, `id`, `description` |
|
|
207
213
|
| `WrapupData` | Wrap-up config — auto-wrapup settings, available wrapup codes |
|
|
208
214
|
| `OutdialAniParams` | Parameters for `getOutdialAniEntries()` — ANI ID, pagination, filtering |
|
|
209
|
-
| `Team` | Simplified team shape in `Profile` — `teamId`, `teamName`, `desktopLayoutId` |
|
|
210
215
|
|
|
211
216
|
```typescript
|
|
212
217
|
// In register() -> connectWebsocket()
|
|
@@ -222,19 +227,19 @@ For endpoints with pagination (teams, aux codes):
|
|
|
222
227
|
```typescript
|
|
223
228
|
import {DEFAULT_PAGE} from './constants'; // DEFAULT_PAGE = 0
|
|
224
229
|
|
|
225
|
-
public async getAllTeams(orgId, pageSize,
|
|
230
|
+
public async getAllTeams(orgId, pageSize, userDbId): Promise<TeamList[]> {
|
|
226
231
|
let allTeams: TeamList[] = [];
|
|
227
232
|
let page = DEFAULT_PAGE;
|
|
228
233
|
|
|
229
234
|
// First request to get totalPages
|
|
230
|
-
const firstResponse = await this.getListOfTeams(orgId, page, pageSize,
|
|
235
|
+
const firstResponse = await this.getListOfTeams(orgId, page, pageSize, userDbId);
|
|
231
236
|
allTeams = allTeams.concat(firstResponse.data);
|
|
232
237
|
const totalPages = firstResponse.meta.totalPages;
|
|
233
238
|
|
|
234
239
|
// Parallel requests for remaining pages
|
|
235
240
|
const requests = [];
|
|
236
241
|
for (page = DEFAULT_PAGE + 1; page < totalPages; page += 1) {
|
|
237
|
-
requests.push(this.getListOfTeams(orgId, page, pageSize,
|
|
242
|
+
requests.push(this.getListOfTeams(orgId, page, pageSize, userDbId));
|
|
238
243
|
}
|
|
239
244
|
|
|
240
245
|
const responses = await Promise.all(requests);
|
|
@@ -252,50 +257,44 @@ The service fetches data from multiple APIs with these response structures:
|
|
|
252
257
|
|
|
253
258
|
| API Method | Response Type | Key Fields | Usage |
|
|
254
259
|
|---|---|---|---|
|
|
255
|
-
| `
|
|
256
|
-
| `
|
|
260
|
+
| `getUserDesktopLoginConfig` | `UserDesktopLoginResponse` | `user`: `ciUserId`, `id`, `dbId`, `firstName`, `lastName`, `email`, `agentProfileId`, `siteId`. `agentProfile`: `dialPlanEnabled`, `accessWrapUpCode`, `accessIdleCode`, `loginVoiceOptions`, `viewableStatistics` | Agent identity, team-filter id, site reference, and desktop settings in one call |
|
|
261
|
+
| `getOrgDesktopLoginConfig` | `OrgDesktopLoginResponse` | `organization`: `tenantId`, `timezone`. `organizationSetting`: `webRtcEnabled`, `maskSensitiveData`, `campaignManagerEnabled`, `aiAssistantQuantity`. `tenantConfiguration`: `outdialEnabled`, `forceDefaultDn`, `privacyShieldVisible`, `timeoutDesktopInactivityEnabled`. Optional `urlMappings`, `aiFeature`, `microsoftConfig`, `webexConfig` | All organization-, tenant- and feature-scoped configuration in one call |
|
|
257
262
|
| `getAllTeams` | `TeamList[]` | real `TeamList` fields from `src/services/config/types.ts` | Team identity, name, type, and site assignment; channel capacities belong to `MultimediaProfileResponse` |
|
|
258
|
-
| `getTenantData` | `TenantData` | `outdialEnabled`, `forceDefaultDn`, `privacyShieldVisible`, `timeoutDesktopInactivityEnabled` | Tenant-level feature flags |
|
|
259
|
-
| `getOrgInfo` | `OrgInfo` | `tenantId`, `timezone` | Organization metadata |
|
|
260
263
|
| `getAllAuxCodes` | `AuxCode[]` | `id`, `name`, `workTypeCode`, `active`, `isSystemCode`, `defaultCode` | Auxiliary codes for idle/wrap-up states |
|
|
261
|
-
| `
|
|
262
|
-
| `
|
|
263
|
-
| `getURLMapping` | `URLMapping[]` | `name`, `url` | External service URL mappings |
|
|
264
|
-
| `getSiteInfo` | `SiteInfo` | Site-specific configuration | Site details |
|
|
264
|
+
| `getDialPlanData` | `DialPlanEntity[]` | `id`, `name`, `regularExpression`, `prefix`, `strippedChars`, `active` | Dial plan rules for outbound calling |
|
|
265
|
+
| `getSiteInfo` | `SiteInfo` | Site-specific configuration | Site details, including the `multimediaProfileId` fallback |
|
|
265
266
|
|
|
266
267
|
These responses are parsed and aggregated into a single `Profile` object by the `parseAgentConfigs` function.
|
|
267
268
|
|
|
268
269
|
```typescript
|
|
269
270
|
// See full implementation in Util.ts
|
|
270
271
|
function parseAgentConfigs(profileData: {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
auxCodes: AuxCode[];
|
|
276
|
-
|
|
277
|
-
agentProfileData: DesktopProfileResponse; // See types.ts:DesktopProfileResponse
|
|
278
|
-
dialPlanData: DialPlanEntity[]; // See types.ts:DialPlanEntity
|
|
279
|
-
urlMapping: URLMapping[]; // See types.ts:URLMapping
|
|
272
|
+
orgConfig: OrgDesktopLoginResponse; // See types.ts:OrgDesktopLoginResponse
|
|
273
|
+
userData: AgentResponse; // `user` section; see types.ts:AgentResponse
|
|
274
|
+
agentProfileData: AgentProfile; // `agentProfile` section; see types.ts:AgentProfile
|
|
275
|
+
teamData: TeamList[]; // See types.ts:TeamList
|
|
276
|
+
auxCodes: AuxCode[]; // See types.ts:AuxCode
|
|
277
|
+
dialPlanData: DialPlanEntity[]; // See types.ts:DialPlanEntity
|
|
280
278
|
multimediaProfileId: string;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
279
|
+
}): Profile { // See types.ts:Profile
|
|
280
|
+
const { orgConfig, userData, agentProfileData, teamData, auxCodes,
|
|
281
|
+
dialPlanData } = profileData;
|
|
282
|
+
const {
|
|
283
|
+
organization: orgInfoData,
|
|
284
|
+
organizationSetting: orgSettingsData,
|
|
285
|
+
tenantConfiguration: tenantData,
|
|
286
|
+
urlMappings,
|
|
287
|
+
aiFeature,
|
|
288
|
+
microsoftConfig,
|
|
289
|
+
webexConfig,
|
|
290
|
+
} = orgConfig;
|
|
290
291
|
|
|
291
292
|
// Aux code filtering via getFilterAuxCodes():
|
|
292
|
-
// - checks auxCode.active
|
|
293
|
-
// -
|
|
293
|
+
// - checks auxCode.workTypeCode and auxCode.active
|
|
294
|
+
// - the aggregate returns the full org pool, so no per-agent restriction is applied
|
|
294
295
|
// - maps to Entity {id, name, isSystem, isDefault}
|
|
295
|
-
const wrapupCodes = getFilterAuxCodes(auxCodes, WRAP_UP_CODE
|
|
296
|
-
|
|
297
|
-
const idleCodes = getFilterAuxCodes(auxCodes, IDLE_CODE,
|
|
298
|
-
agentProfileData.accessIdleCode === 'ALL' ? [] : agentProfileData.idleCodes);
|
|
296
|
+
const wrapupCodes = getFilterAuxCodes(auxCodes, WRAP_UP_CODE);
|
|
297
|
+
const idleCodes = getFilterAuxCodes(auxCodes, IDLE_CODE);
|
|
299
298
|
|
|
300
299
|
// Hardcoded "Available" state always appended to idle codes
|
|
301
300
|
idleCodes.push({ id: '0', name: 'Available', isSystem: false, isDefault: false });
|
|
@@ -304,7 +303,7 @@ function parseAgentConfigs(profileData: {
|
|
|
304
303
|
agentId: userData.ciUserId, // NOTE: uses ciUserId for agent identification
|
|
305
304
|
analyserUserId: userData.id, // NOTE: userData.id is used for analytics/reporting
|
|
306
305
|
agentName: `${userData.firstName} ${userData.lastName}`,
|
|
307
|
-
teams: teamData, //
|
|
306
|
+
teams: teamData, // TeamList[] straight from the team API; Profile.teams is TeamList[]
|
|
308
307
|
idleCodes, // NOTE: Filtered via getFilterAuxCodes() + hardcoded "Available" state
|
|
309
308
|
wrapupCodes, // NOTE: Filtered via getFilterAuxCodes()
|
|
310
309
|
webRtcEnabled: orgSettingsData.webRtcEnabled,
|
|
@@ -321,31 +320,22 @@ function parseAgentConfigs(profileData: {
|
|
|
321
320
|
## Data Flow
|
|
322
321
|
```mermaid
|
|
323
322
|
flowchart TD
|
|
324
|
-
Start[getAgentConfig orgId + agentId] --> User[
|
|
325
|
-
Start --> Org[
|
|
326
|
-
Start --> OrgSettings[getOrganizationSetting]
|
|
327
|
-
Start --> Tenant[getTenantData]
|
|
328
|
-
Start --> URL[getURLMapping]
|
|
329
|
-
Start --> AI[getAIFeatureFlags]
|
|
323
|
+
Start[getAgentConfig orgId + agentId] --> User[getUserDesktopLoginConfig awaited first]
|
|
324
|
+
Start --> Org[getOrgDesktopLoginConfig]
|
|
330
325
|
Start --> Aux[getAllAuxCodes]
|
|
331
|
-
User -->
|
|
332
|
-
User -->
|
|
333
|
-
User -->
|
|
334
|
-
Profile --> Dial{dialPlanEnabled?}
|
|
326
|
+
User --> Site[getSiteInfo siteId]
|
|
327
|
+
User --> Teams[getAllTeams filtered by dbId]
|
|
328
|
+
User --> Dial{agentProfile.dialPlanEnabled?}
|
|
335
329
|
Dial -->|yes| DialPlan[getDialPlanData]
|
|
336
330
|
Dial -->|no| Empty[empty dial plan]
|
|
337
|
-
|
|
338
|
-
Site --> All
|
|
331
|
+
Site --> All[Promise.all of five result promises]
|
|
339
332
|
Teams --> All
|
|
340
333
|
DialPlan --> All
|
|
341
334
|
Empty --> All
|
|
342
335
|
Org --> All
|
|
343
|
-
OrgSettings --> All
|
|
344
|
-
Tenant --> All
|
|
345
|
-
URL --> All
|
|
346
|
-
AI --> All
|
|
347
336
|
Aux --> All
|
|
348
|
-
All -->
|
|
337
|
+
All --> Mm[multimediaProfileId: team value else site value]
|
|
338
|
+
Mm --> Parse[parseAgentConfigs with orgConfig + userData + agentProfileData]
|
|
349
339
|
Parse --> Result[Profile with aiFeature + maskSensitiveData]
|
|
350
340
|
```
|
|
351
341
|
|
|
@@ -369,19 +359,19 @@ sequenceDiagram
|
|
|
369
359
|
participant Util as parseAgentConfigs
|
|
370
360
|
CC->>Cfg: getAgentConfig(orgId, agentId)
|
|
371
361
|
par requests started before user data resolves
|
|
372
|
-
Cfg->>API:
|
|
373
|
-
Cfg->>API:
|
|
374
|
-
Cfg->>API:
|
|
362
|
+
Cfg->>API: getUserDesktopLoginConfig
|
|
363
|
+
Cfg->>API: getOrgDesktopLoginConfig
|
|
364
|
+
Cfg->>API: getAllAuxCodes
|
|
375
365
|
end
|
|
376
|
-
API-->>Cfg: user
|
|
366
|
+
API-->>Cfg: user.dbId / user.siteId / agentProfile.dialPlanEnabled
|
|
377
367
|
par user-dependent requests
|
|
378
|
-
Cfg->>API:
|
|
379
|
-
Cfg->>API: conditional dial plan
|
|
368
|
+
Cfg->>API: getSiteInfo + getAllTeams(filter userId==dbId)
|
|
369
|
+
Cfg->>API: conditional dial plan gated on agentProfile.dialPlanEnabled
|
|
380
370
|
end
|
|
381
|
-
Note over Cfg,API: Promise.all awaits
|
|
371
|
+
Note over Cfg,API: Promise.all awaits 5 result promises after the user aggregate
|
|
382
372
|
alt all succeed
|
|
383
|
-
API-->>Cfg:
|
|
384
|
-
Cfg->>Util: parseAgentConfigs(
|
|
373
|
+
API-->>Cfg: five results
|
|
374
|
+
Cfg->>Util: parseAgentConfigs(orgConfig, userData, agentProfileData, ...)
|
|
385
375
|
Util-->>CC: Profile including aiFeature
|
|
386
376
|
else any fails
|
|
387
377
|
Cfg-->>CC: throw; no partial Profile
|
|
@@ -396,7 +386,7 @@ sequenceDiagram
|
|
|
396
386
|
participant Cfg as AgentConfigService
|
|
397
387
|
participant WR as WebexRequest
|
|
398
388
|
participant API as WCC API
|
|
399
|
-
Caller->>Cfg: getAllTeams/getAllAuxCodes(orgId, pageSize, filters)
|
|
389
|
+
Caller->>Cfg: getAllTeams(orgId, pageSize, userDbId) / getAllAuxCodes(orgId, pageSize, filters)
|
|
400
390
|
Cfg->>WR: request page 0
|
|
401
391
|
WR->>API: authenticated GET
|
|
402
392
|
alt first page succeeds
|
|
@@ -426,7 +416,7 @@ classDiagram
|
|
|
426
416
|
class parseAgentConfigs
|
|
427
417
|
class Profile
|
|
428
418
|
ContactCenter --> AgentConfigService : getAgentConfig
|
|
429
|
-
AgentConfigService --> WebexRequest :
|
|
419
|
+
AgentConfigService --> WebexRequest : six dependent requests
|
|
430
420
|
AgentConfigService --> parseAgentConfigs : aggregate results
|
|
431
421
|
parseAgentConfigs --> Profile : aiFeature + maskSensitiveData
|
|
432
422
|
```
|
|
@@ -439,28 +429,34 @@ classDiagram
|
|
|
439
429
|
| `types` | `config/types.ts` | Types, events, interfaces |
|
|
440
430
|
|
|
441
431
|
## Use Cases
|
|
442
|
-
- **UC-1 Two-wave profile aggregation:** retrieve the user first, run
|
|
432
|
+
- **UC-1 Two-wave profile aggregation:** retrieve the user desktop-login aggregate first, run five dependent promises including the organization aggregate, then parse one complete Profile or reject the whole operation. Evidence: `src/services/config/index.ts`, `src/services/config/Util.ts`, `test/unit/spec/services/config/index.ts`.
|
|
443
433
|
- **UC-2 Paginated teams/aux codes:** follow backend page metadata to completion; auxiliary-code requests include `desktopProfileFilter=true`. Evidence: `src/services/config/index.ts`, `test/unit/spec/services/config/index.ts`.
|
|
444
|
-
- **UC-3 Dial plan and URL
|
|
434
|
+
- **UC-3 Dial plan and URL mappings:** request dial-plan data only when the agent profile enables it, keep only `active` plans, and map the organization aggregate's `urlMappings` into the profile. Evidence: `src/services/config/index.ts`, `src/services/config/Util.ts`, `test/unit/spec/services/config/index.ts`.
|
|
445
435
|
- **UC-4 Outdial ANI retrieval:** return the organization-scoped ANI list through authenticated WebexRequest and propagate failures without a partial substitute. Evidence: `src/services/config/index.ts`, `test/unit/spec/services/config/index.ts`.
|
|
436
|
+
- **UC-5 Wellness configuration:** produce one fail-closed effective profile flag and retrieve the exact system wellness idle code across pages. Evidence: `src/services/config/Util.ts`, `src/services/config/index.ts`, `test/unit/spec/services/config/Util.ts`, `test/unit/spec/services/config/index.ts`.
|
|
446
437
|
|
|
447
438
|
## Business Rules & Invariants
|
|
448
439
|
- `getAgentConfig` rejects when any required dependent request rejects; it never returns a partial Profile.
|
|
449
440
|
- `Profile.aiFeature` is derived from the AI-feature response, and sensitive-data masking uses the real `maskSensitiveData` field.
|
|
450
441
|
- Team data has no `channelMap` contract; multimedia profile responses use `MultimediaProfileResponse`.
|
|
442
|
+
- `isWellnessBreakEnabled` is always boolean and defaults false when any gate is absent, disabled, or unlicensed.
|
|
443
|
+
- The system wellness code lookup is separate from profile auxiliary-code aggregation and uses `desktopProfileFilter=false`.
|
|
451
444
|
|
|
452
445
|
## Concurrency & Reactive Flow
|
|
453
|
-
- The initial user lookup supplies identifiers for a
|
|
446
|
+
- The initial user desktop-login lookup supplies identifiers for a five-promise `Promise.all`; pagination loops await pages in order and stop from returned metadata.
|
|
454
447
|
|
|
455
448
|
## Protocol / Wire Format
|
|
456
449
|
All Config operations are authenticated REST calls through WebexRequest. Important current routes include:
|
|
457
450
|
|
|
458
451
|
| Operation | Resource shape |
|
|
459
452
|
|---|---|
|
|
460
|
-
|
|
|
453
|
+
| Organization desktop-login aggregate | `organization/{orgId}/desktop-login` |
|
|
454
|
+
| User desktop-login aggregate | `organization/{orgId}/v2/user/by-ci-user-id/{ciUserId}/desktop-login` |
|
|
455
|
+
| Teams | `organization/{orgId}/v2/team?page={page}&pageSize={pageSize}&agentView=true&filter=userId=={userDbId}` — the wire field is `userId` but the value is the user's database id; filter value unquoted, no `attributes=` projection |
|
|
461
456
|
| Auxiliary codes | pagination/filter/attributes plus `desktopProfileFilter=true` |
|
|
457
|
+
| Wellness system idle code | `organization/{orgId}/v2/auxiliary-code?page={page}&pageSize={pageSize}&workType=IDLE_CODE&customFilter=isSystemCode==true&desktopProfileFilter=false` |
|
|
462
458
|
| Multimedia profile | organization-scoped multimedia-profile resource |
|
|
463
|
-
| Dial plan | organization-scoped dial-plan resource when
|
|
459
|
+
| Dial plan | organization-scoped dial-plan resource when the agent profile enables it |
|
|
464
460
|
|
|
465
461
|
Exact resources live in `src/services/config/constants.ts`; response/profile fields live in `src/services/config/types.ts`.
|
|
466
462
|
|
|
@@ -470,7 +466,7 @@ Exact resources live in `src/services/config/constants.ts`; response/profile fie
|
|
|
470
466
|
| Dependency rejection | Typed/rethrown error or failure event | Inspect structured details, preserve tracking id, and retry only when the operation is safe. |
|
|
471
467
|
| Timeout or missing async completion | Timeout/recovery state | Follow the module-specific recovery path; never synthesize success. |
|
|
472
468
|
|
|
473
|
-
All API methods within the config service throw errors on failure. After `
|
|
469
|
+
All API methods within the config service throw errors on failure. After `getUserDesktopLoginConfig`, `getAgentConfig` awaits five dependent requests via `Promise.all`: site, conditional dial plan, teams, the organization desktop-login aggregate, and all auxiliary codes. A failure in any required request, including `getOrgDesktopLoginConfig`, causes the entire AgentProfile fetch to fail. There is no partial profile — either all data is successfully fetched and aggregated, or the operation throws.
|
|
474
470
|
|
|
475
471
|
```typescript
|
|
476
472
|
try {
|
|
@@ -487,14 +483,17 @@ try {
|
|
|
487
483
|
Each method follows consistent error handling:
|
|
488
484
|
|
|
489
485
|
```typescript
|
|
490
|
-
public async
|
|
491
|
-
|
|
486
|
+
public async getUserDesktopLoginConfig(
|
|
487
|
+
orgId: string,
|
|
488
|
+
ciUserId: string
|
|
489
|
+
): Promise<UserDesktopLoginResponse> {
|
|
490
|
+
LoggerProxy.info('Fetching user desktop-login configuration', {
|
|
492
491
|
module: CONFIG_FILE_NAME,
|
|
493
|
-
method: METHODS.
|
|
492
|
+
method: METHODS.GET_USER_DESKTOP_LOGIN_CONFIG,
|
|
494
493
|
});
|
|
495
494
|
|
|
496
495
|
try {
|
|
497
|
-
const resource = endPointMap.
|
|
496
|
+
const resource = endPointMap.userDesktopLogin(orgId, ciUserId);
|
|
498
497
|
const response = await this.webexReq.request({
|
|
499
498
|
service: WCC_API_GATEWAY,
|
|
500
499
|
resource,
|
|
@@ -505,16 +504,16 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
|
|
|
505
504
|
throw new Error(`API call failed with ${response.statusCode}`);
|
|
506
505
|
}
|
|
507
506
|
|
|
508
|
-
LoggerProxy.log('
|
|
507
|
+
LoggerProxy.log('getUserDesktopLoginConfig api success.', {
|
|
509
508
|
module: CONFIG_FILE_NAME,
|
|
510
|
-
method: METHODS.
|
|
509
|
+
method: METHODS.GET_USER_DESKTOP_LOGIN_CONFIG,
|
|
511
510
|
});
|
|
512
511
|
|
|
513
512
|
return Promise.resolve(response.body);
|
|
514
513
|
} catch (error) {
|
|
515
|
-
LoggerProxy.error(`
|
|
514
|
+
LoggerProxy.error(`getUserDesktopLoginConfig API call failed with ${error}`, {
|
|
516
515
|
module: CONFIG_FILE_NAME,
|
|
517
|
-
method: METHODS.
|
|
516
|
+
method: METHODS.GET_USER_DESKTOP_LOGIN_CONFIG,
|
|
518
517
|
});
|
|
519
518
|
throw error;
|
|
520
519
|
}
|
|
@@ -531,8 +530,8 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
|
|
|
531
530
|
"module": "config/index.ts", "method": "getAgentConfig"
|
|
532
531
|
|
|
533
532
|
// Specific API method failures
|
|
534
|
-
"
|
|
535
|
-
"
|
|
533
|
+
"getUserDesktopLoginConfig API call failed"
|
|
534
|
+
"getOrgDesktopLoginConfig API call failed"
|
|
536
535
|
"getAllTeams API call failed"
|
|
537
536
|
"getAllAuxCodes API call failed"
|
|
538
537
|
|
|
@@ -568,7 +567,7 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
|
|
|
568
567
|
|
|
569
568
|
1. Check `totalPages` in first response
|
|
570
569
|
|
|
571
|
-
2. Verify filter
|
|
570
|
+
2. Verify the team filter carries a valid `userDbId` (`user.dbId`, not the CI user id) and that aux-code filters contain valid IDs
|
|
572
571
|
|
|
573
572
|
3. Check if pageSize is appropriate (default: 100)
|
|
574
573
|
|
|
@@ -579,8 +578,8 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
|
|
|
579
578
|
**Log patterns:**
|
|
580
579
|
|
|
581
580
|
```typescript
|
|
582
|
-
"
|
|
583
|
-
"
|
|
581
|
+
"getOrgDesktopLoginConfig api success."
|
|
582
|
+
"getUserDesktopLoginConfig api success."
|
|
584
583
|
```
|
|
585
584
|
|
|
586
585
|
**Solution**:
|
|
@@ -603,7 +602,7 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
|
|
|
603
602
|
|
|
604
603
|
3. Note: dial plan fetch only happens if `dialPlanEnabled === true`
|
|
605
604
|
|
|
606
|
-
**Cause**:
|
|
605
|
+
**Cause**: Expected auxiliary codes missing from the returned pool
|
|
607
606
|
|
|
608
607
|
**Log patterns:**
|
|
609
608
|
|
|
@@ -613,23 +612,22 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
|
|
|
613
612
|
|
|
614
613
|
**Solution**:
|
|
615
614
|
|
|
616
|
-
1.
|
|
617
|
-
|
|
618
|
-
2. Check `agentProfileData.accessIdleCode`
|
|
615
|
+
1. `getFilterAuxCodes` no longer applies a per-agent restriction list — the full organization pool is returned for every agent
|
|
619
616
|
|
|
620
|
-
|
|
617
|
+
2. `Profile.idleCodesAccess` / `wrapupCodesAccess` still report `ALL` or `SPECIFIC` from `agentProfileData`
|
|
621
618
|
|
|
622
|
-
|
|
619
|
+
3. Ensure aux codes have `active: true` status and the expected `workTypeCode`
|
|
623
620
|
|
|
624
|
-
|
|
621
|
+
4. Note: "Available" state is always appended to idle codes
|
|
625
622
|
|
|
626
623
|
## Pitfalls
|
|
627
|
-
- `
|
|
628
|
-
-
|
|
624
|
+
- `getUserDesktopLoginConfig` must complete before site/team/dial-plan requests are constructed, while the five dependent promises remain all-or-nothing.
|
|
625
|
+
- The `aiFeature` section is part of the organization aggregate and must be passed into `parseAgentConfigs`; omitting it silently removes `Profile.aiFeature`.
|
|
626
|
+
- The team filter value must stay unquoted (`filter=userId=={dbId}`) — the quoted form returns HTTP 400 — and must not carry an `attributes=` projection, which would strip `multiMediaProfileId`, `teamType` and `siteName`.
|
|
629
627
|
- Team responses do not own channel configuration, and auxiliary-code requests require `desktopProfileFilter=true` during profile construction.
|
|
630
628
|
|
|
631
629
|
## Module Do's / Don'ts
|
|
632
|
-
- DO preserve the user-first dependency boundary and the exact
|
|
630
|
+
- DO preserve the user-first dependency boundary and the exact five-promise result order.
|
|
633
631
|
- DO paginate team and auxiliary-code endpoints until their metadata indicates completion.
|
|
634
632
|
- DON'T return a partially assembled Profile after any required dependency fails.
|
|
635
633
|
- DON'T invent TeamList fields such as `channelMap` or omit `maskSensitiveData`/`aiFeature` mappings.
|
|
@@ -638,7 +636,7 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
|
|
|
638
636
|
- Profile creation is all-or-nothing across dependent API calls so consumers never receive internally inconsistent partial configuration.
|
|
639
637
|
|
|
640
638
|
## Test-Case Strategy (module)
|
|
641
|
-
`test/unit/spec/services/config/index.ts` must cover staged user-first orchestration,
|
|
639
|
+
`test/unit/spec/services/config/index.ts` must cover staged user-first orchestration, five-promise aggregation, AI-feature mapping, conditional dial plan, the `userDbId` team filter, pagination, auxiliary-code URL filtering, real response field names, and whole-profile rejection on any required failure.
|
|
642
640
|
|
|
643
641
|
| Behavior / Requirement | Existing test evidence | Gap |
|
|
644
642
|
|---|---|---|
|
|
@@ -647,6 +645,8 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
|
|
|
647
645
|
| `CONFIG-R-003` | `test/unit/spec/services/config/index.ts` | None. |
|
|
648
646
|
| `CONFIG-R-004` | `test/unit/spec/services/config/index.ts` | None. |
|
|
649
647
|
| `CONFIG-R-005` | `test/unit/spec/services/config/index.ts` | Keep an explicit rejection assertion for each required dependency category. |
|
|
648
|
+
| `CONFIG-R-006` | `test/unit/spec/services/config/Util.ts` | None. |
|
|
649
|
+
| `CONFIG-R-007` | `test/unit/spec/services/config/index.ts` | None. |
|
|
650
650
|
|
|
651
651
|
## Traceability
|
|
652
652
|
- Repo architecture: `../../../../ai-docs/ARCHITECTURE.md` · Registry: `../../../../ai-docs/SPEC_INDEX.md`
|