@webex/contact-center 3.12.0-next.15 → 3.12.0-next.151
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 +887 -0
- package/AGENTS.md +94 -0
- package/ai-docs/ARCHITECTURE.md +168 -0
- package/ai-docs/CONTRACTS.md +62 -0
- package/ai-docs/GETTING_STARTED.md +168 -0
- package/ai-docs/GLOSSARY.md +43 -0
- package/ai-docs/README.md +138 -0
- package/ai-docs/REVIEW_CHECKLIST.md +41 -0
- package/ai-docs/RULES.md +444 -0
- package/ai-docs/SECURITY.md +52 -0
- package/ai-docs/SERVICE_STATE.md +52 -0
- package/ai-docs/SPEC_INDEX.md +65 -0
- package/ai-docs/adr/0001-spec-source-policy.md +55 -0
- package/ai-docs/adr/README.md +8 -0
- package/ai-docs/adr/_adr-template.md +31 -0
- package/ai-docs/contact-center-spec.md +382 -0
- 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/ai-docs/features/generated-spec-conformance-fidelity-remediation/spec/feature-spec.md +117 -0
- package/ai-docs/features/residual-warning-coverage-completion/spec/feature-spec.md +203 -0
- package/ai-docs/features/validator-code-fidelity-drift-fix/spec/feature-spec.md +315 -0
- package/ai-docs/patterns/event-driven-patterns.md +485 -0
- package/ai-docs/patterns/testing-patterns.md +480 -0
- package/ai-docs/patterns/typescript-patterns.md +365 -0
- package/ai-docs/templates/README.md +102 -0
- package/ai-docs/templates/documentation/create-agents-md.md +240 -0
- package/ai-docs/templates/documentation/create-architecture-md.md +295 -0
- package/ai-docs/templates/existing-service/bug-fix.md +254 -0
- package/ai-docs/templates/existing-service/feature-enhancement.md +450 -0
- package/ai-docs/templates/new-method/00-master.md +80 -0
- package/ai-docs/templates/new-method/01-requirements.md +232 -0
- package/ai-docs/templates/new-method/02-implementation.md +295 -0
- package/ai-docs/templates/new-method/03-tests.md +201 -0
- package/ai-docs/templates/new-method/04-validation.md +141 -0
- package/ai-docs/templates/new-service/00-master.md +109 -0
- package/ai-docs/templates/new-service/01-pre-questions.md +159 -0
- package/ai-docs/templates/new-service/02-code-generation.md +346 -0
- package/ai-docs/templates/new-service/03-integration.md +178 -0
- package/ai-docs/templates/new-service/04-test-generation.md +205 -0
- package/ai-docs/templates/new-service/05-validation.md +145 -0
- package/dist/cc.js +1010 -47
- package/dist/cc.js.map +1 -1
- package/dist/config.js +13 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +40 -3
- package/dist/constants.js.map +1 -1
- package/dist/index.js +54 -17
- 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 +211 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +58 -4
- 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 +351 -14
- 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/UserPreference.js +427 -0
- package/dist/services/UserPreference.js.map +1 -0
- 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 +48 -48
- package/dist/services/config/Util.js.map +1 -1
- package/dist/services/config/constants.js +56 -78
- 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 +97 -24
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/core/Err.js.map +1 -1
- package/dist/services/core/Utils.js +111 -32
- 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 +28 -14
- package/dist/services/core/aqm-reqs.js.map +1 -1
- package/dist/services/core/types.js.map +1 -1
- package/dist/services/core/websocket/WebSocketManager.js +2 -1
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
- package/dist/services/core/websocket/types.js.map +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/task/Task.js +955 -0
- package/dist/services/task/Task.js.map +1 -0
- package/dist/services/task/TaskFactory.js +50 -0
- package/dist/services/task/TaskFactory.js.map +1 -0
- package/dist/services/task/TaskManager.js +1272 -523
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/TaskUtils.js +221 -27
- 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 +21 -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/dialer.js +78 -0
- package/dist/services/task/dialer.js.map +1 -1
- package/dist/services/task/digital/Digital.js +78 -0
- package/dist/services/task/digital/Digital.js.map +1 -0
- package/dist/services/task/state-machine/TaskStateMachine.js +982 -0
- package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
- package/dist/services/task/state-machine/actions.js +572 -0
- package/dist/services/task/state-machine/actions.js.map +1 -0
- package/dist/services/task/state-machine/constants.js +161 -0
- package/dist/services/task/state-machine/constants.js.map +1 -0
- package/dist/services/task/state-machine/guards.js +379 -0
- package/dist/services/task/state-machine/guards.js.map +1 -0
- package/dist/services/task/state-machine/index.js +53 -0
- package/dist/services/task/state-machine/index.js.map +1 -0
- package/dist/services/task/state-machine/types.js +54 -0
- package/dist/services/task/state-machine/types.js.map +1 -0
- package/dist/services/task/state-machine/uiControlsComputer.js +703 -0
- package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
- package/dist/services/task/taskDataNormalizer.js +99 -0
- package/dist/services/task/taskDataNormalizer.js.map +1 -0
- package/dist/services/task/types.js +259 -5
- package/dist/services/task/types.js.map +1 -1
- package/dist/services/task/voice/Voice.js +1504 -0
- package/dist/services/task/voice/Voice.js.map +1 -0
- package/dist/services/task/voice/WebRTC.js +152 -0
- package/dist/services/task/voice/WebRTC.js.map +1 -0
- 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 +196 -9
- package/dist/types/config.d.ts +13 -0
- package/dist/types/constants.d.ts +38 -1
- package/dist/types/index.d.ts +54 -20
- package/dist/types/metrics/MetricsManager.d.ts +6 -0
- package/dist/types/metrics/constants.d.ts +52 -1
- 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 +58 -5
- package/dist/types/services/EntryPoint.d.ts +7 -5
- package/dist/types/services/Queue.d.ts +5 -3
- package/dist/types/services/UserPreference.d.ts +118 -0
- 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 +49 -76
- package/dist/types/services/config/index.d.ts +16 -64
- package/dist/types/services/config/types.d.ts +248 -114
- package/dist/types/services/core/Err.d.ts +6 -0
- package/dist/types/services/core/Utils.d.ts +35 -13
- package/dist/types/services/core/WebexRequest.d.ts +1 -0
- package/dist/types/services/core/types.d.ts +2 -0
- package/dist/types/services/core/websocket/WebSocketManager.d.ts +1 -0
- package/dist/types/services/core/websocket/types.d.ts +1 -1
- package/dist/types/services/index.d.ts +1 -1
- package/dist/types/services/task/Task.d.ts +186 -0
- package/dist/types/services/task/TaskFactory.d.ts +14 -0
- package/dist/types/services/task/TaskUtils.d.ts +54 -2
- package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
- package/dist/types/services/task/constants.d.ts +19 -0
- package/dist/types/services/task/contact.d.ts +4 -0
- package/dist/types/services/task/dialer.d.ts +30 -0
- package/dist/types/services/task/digital/Digital.d.ts +23 -0
- package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1442 -0
- package/dist/types/services/task/state-machine/actions.d.ts +10 -0
- package/dist/types/services/task/state-machine/constants.d.ts +107 -0
- package/dist/types/services/task/state-machine/guards.d.ts +103 -0
- package/dist/types/services/task/state-machine/index.d.ts +13 -0
- package/dist/types/services/task/state-machine/types.d.ts +277 -0
- package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
- package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
- package/dist/types/services/task/types.d.ts +790 -66
- package/dist/types/services/task/voice/Voice.d.ts +241 -0
- package/dist/types/services/task/voice/WebRTC.d.ts +54 -0
- 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 +213 -11
- package/dist/types/utils/PageCache.d.ts +20 -3
- package/dist/types/webex.d.ts +1 -0
- package/dist/types.js +168 -6
- 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 +22 -2
- package/dist/webex.js.map +1 -1
- package/package.json +16 -12
- package/src/cc.ts +1338 -121
- package/src/config.ts +13 -0
- package/src/constants.ts +41 -1
- package/src/index.ts +62 -15
- package/src/metrics/MetricsManager.ts +16 -0
- package/src/metrics/ai-docs/AGENTS.md +350 -0
- package/src/metrics/ai-docs/ARCHITECTURE.md +338 -0
- package/src/metrics/ai-docs/metrics-spec.md +971 -0
- package/src/metrics/behavioral-events.ts +218 -0
- package/src/metrics/constants.ts +63 -4
- package/src/services/AddressBook.ts +17 -6
- package/src/services/AnswerCallOnWebexService.ts +239 -0
- package/src/services/ApiAiAssistant.ts +470 -15
- package/src/services/EntryPoint.ts +59 -60
- package/src/services/Queue.ts +29 -12
- package/src/services/UserPreference.ts +509 -0
- package/src/services/WebexCrossClientService.ts +298 -0
- package/src/services/WxAppTelephonyMercurySync.ts +142 -0
- package/src/services/agent/ai-docs/AGENTS.md +240 -0
- package/src/services/agent/ai-docs/ARCHITECTURE.md +304 -0
- package/src/services/agent/ai-docs/agent-spec.md +505 -0
- package/src/services/ai-docs/AGENTS.md +386 -0
- package/src/services/ai-docs/services-spec.md +505 -0
- package/src/services/config/Util.ts +54 -84
- package/src/services/config/ai-docs/AGENTS.md +250 -0
- package/src/services/config/ai-docs/ARCHITECTURE.md +413 -0
- package/src/services/config/ai-docs/config-spec.md +669 -0
- package/src/services/config/constants.ts +63 -85
- package/src/services/config/index.ts +116 -277
- package/src/services/config/types.ts +233 -125
- package/src/services/core/Err.ts +3 -0
- package/src/services/core/Utils.ts +127 -37
- package/src/services/core/WebexRequest.ts +3 -1
- package/src/services/core/ai-docs/AGENTS.md +381 -0
- package/src/services/core/ai-docs/ARCHITECTURE.md +698 -0
- package/src/services/core/ai-docs/core-spec.md +787 -0
- package/src/services/core/aqm-reqs.ts +30 -15
- package/src/services/core/types.ts +33 -1
- package/src/services/core/websocket/WebSocketManager.ts +2 -0
- package/src/services/core/websocket/types.ts +1 -1
- package/src/services/index.ts +1 -1
- package/src/services/task/Task.ts +1211 -0
- package/src/services/task/TaskFactory.ts +82 -0
- package/src/services/task/TaskManager.ts +1584 -643
- package/src/services/task/TaskUtils.ts +316 -25
- package/src/services/task/WebexCallingUtils.ts +136 -0
- package/src/services/task/ai-docs/AGENTS.md +457 -0
- package/src/services/task/ai-docs/ARCHITECTURE.md +595 -0
- package/src/services/task/ai-docs/task-spec.md +1501 -0
- package/src/services/task/constants.ts +20 -0
- package/src/services/task/contact.ts +30 -0
- package/src/services/task/dialer.ts +80 -0
- package/src/services/task/digital/Digital.ts +102 -0
- package/src/services/task/state-machine/TaskStateMachine.ts +1320 -0
- package/src/services/task/state-machine/actions.ts +741 -0
- package/src/services/task/state-machine/ai-docs/AGENTS.md +460 -0
- package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1156 -0
- package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +2247 -0
- package/src/services/task/state-machine/constants.ts +172 -0
- package/src/services/task/state-machine/guards.ts +442 -0
- package/src/services/task/state-machine/index.ts +28 -0
- package/src/services/task/state-machine/types.ts +258 -0
- package/src/services/task/state-machine/uiControlsComputer.ts +1135 -0
- package/src/services/task/taskDataNormalizer.ts +137 -0
- package/src/services/task/types.ts +974 -70
- package/src/services/task/voice/Voice.ts +1878 -0
- package/src/services/task/voice/WebRTC.ts +194 -0
- 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 +272 -13
- package/src/utils/AGENTS.md +289 -0
- package/src/utils/PageCache.ts +38 -5
- package/src/utils/ai-docs/utils-spec.md +391 -0
- package/src/webex.js +10 -0
- package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
- package/test/unit/spec/cc.ts +3705 -150
- package/test/unit/spec/index.ts +885 -0
- package/test/unit/spec/logger-proxy.ts +70 -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 +429 -23
- package/test/unit/spec/services/EntryPoint.ts +87 -40
- package/test/unit/spec/services/Queue.ts +123 -12
- package/test/unit/spec/services/UserPreference.ts +401 -0
- package/test/unit/spec/services/WebCallingService.ts +7 -1
- 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 +317 -547
- package/test/unit/spec/services/core/Utils.ts +425 -8
- package/test/unit/spec/services/core/WebexRequest.ts +8 -7
- package/test/unit/spec/services/core/aqm-reqs.ts +113 -1
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +66 -40
- package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
- package/test/unit/spec/services/task/Task.ts +2723 -0
- package/test/unit/spec/services/task/TaskFactory.ts +116 -0
- package/test/unit/spec/services/task/TaskManager.ts +4781 -1585
- package/test/unit/spec/services/task/TaskUtils.ts +307 -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/dialer.ts +190 -0
- package/test/unit/spec/services/task/digital/Digital.ts +105 -0
- package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +4060 -0
- package/test/unit/spec/services/task/state-machine/guards.ts +839 -0
- package/test/unit/spec/services/task/state-machine/types.ts +18 -0
- package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +3101 -0
- package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
- package/test/unit/spec/services/task/voice/Voice.ts +2355 -0
- package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
- 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
- package/dist/services/task/index.js +0 -1530
- package/dist/services/task/index.js.map +0 -1
- package/dist/types/services/task/index.d.ts +0 -650
- package/src/services/task/index.ts +0 -1806
- package/test/unit/spec/services/task/index.ts +0 -2205
|
@@ -37,40 +37,35 @@ class AgentConfigService {
|
|
|
37
37
|
*/
|
|
38
38
|
async getAgentConfig(orgId, agentId) {
|
|
39
39
|
try {
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const orgSettingsPromise = this.getOrganizationSetting(orgId);
|
|
43
|
-
const tenantDataPromise = this.getTenantData(orgId);
|
|
44
|
-
const urlMappingPromise = this.getURLMapping(orgId);
|
|
45
|
-
const aiFeatureFlagsPromise = this.getAIFeatureFlags(orgId);
|
|
40
|
+
const orgConfigPromise = this.getOrgDesktopLoginConfig(orgId);
|
|
41
|
+
const userConfigPromise = this.getUserDesktopLoginConfig(orgId, agentId);
|
|
46
42
|
const auxCodesPromise = this.getAllAuxCodes(orgId, _constants3.DEFAULT_PAGE_SIZE, [], _constants3.DEFAULT_AUXCODE_ATTRIBUTES);
|
|
47
|
-
const
|
|
48
|
-
|
|
43
|
+
const userConfig = await userConfigPromise;
|
|
44
|
+
const {
|
|
45
|
+
user: userData,
|
|
46
|
+
agentProfile: agentProfileData
|
|
47
|
+
} = userConfig;
|
|
48
|
+
_loggerProxy.default.info(`Fetched user data, userId: ${userData.ciUserId}`, {
|
|
49
49
|
module: _constants2.CONFIG_FILE_NAME,
|
|
50
50
|
method: _constants3.METHODS.GET_AGENT_CONFIG
|
|
51
51
|
});
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const userDialPlanPromise =
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const multimediaProfileId = userConfigData.multimediaProfileId || userTeamData[0]?.multiMediaProfileId || siteInfo.multimediaProfileId;
|
|
52
|
+
const siteInfoPromise = this.getSiteInfo(orgId, userData.siteId);
|
|
53
|
+
const userTeamPromise = this.getAllTeams(orgId, _constants3.DEFAULT_PAGE_SIZE, userData.dbId);
|
|
54
|
+
const userDialPlanPromise = agentProfileData.dialPlanEnabled ? this.getDialPlanData(orgId) : Promise.resolve([]);
|
|
55
|
+
const [siteInfo, userDialPlanData, userTeamData, orgConfig, auxCodesData] = await Promise.all([siteInfoPromise, userDialPlanPromise, userTeamPromise, orgConfigPromise, auxCodesPromise]);
|
|
56
|
+
const multimediaProfileId = userTeamData[0]?.multiMediaProfileId || siteInfo.multimediaProfileId;
|
|
58
57
|
_loggerProxy.default.info('Fetched all required data', {
|
|
59
58
|
module: _constants2.CONFIG_FILE_NAME,
|
|
60
59
|
method: _constants3.METHODS.GET_AGENT_CONFIG
|
|
61
60
|
});
|
|
62
61
|
const response = (0, _Util.parseAgentConfigs)({
|
|
63
|
-
|
|
62
|
+
orgConfig,
|
|
63
|
+
userData,
|
|
64
|
+
agentProfileData,
|
|
64
65
|
teamData: userTeamData,
|
|
65
|
-
tenantData,
|
|
66
|
-
orgInfoData: orgInfo,
|
|
67
66
|
auxCodes: auxCodesData,
|
|
68
|
-
orgSettingsData,
|
|
69
|
-
agentProfileData: agentProfileConfigData,
|
|
70
67
|
dialPlanData: userDialPlanData,
|
|
71
|
-
|
|
72
|
-
multimediaProfileId,
|
|
73
|
-
aiFeatureFlags: aiFeatureFlagsData
|
|
68
|
+
multimediaProfileId
|
|
74
69
|
});
|
|
75
70
|
_loggerProxy.default.info('Parsing completed for agent-config', {
|
|
76
71
|
module: _constants2.CONFIG_FILE_NAME,
|
|
@@ -91,21 +86,20 @@ class AgentConfigService {
|
|
|
91
86
|
}
|
|
92
87
|
|
|
93
88
|
/**
|
|
94
|
-
* Fetches the
|
|
89
|
+
* Fetches the aggregated organization desktop-login configuration for the given orgId.
|
|
95
90
|
* @ignore
|
|
96
|
-
* @param {string} orgId - organization ID for which the
|
|
97
|
-
* @
|
|
98
|
-
* @returns {Promise<AgentResponse>} - A promise that resolves to the agent configuration response.
|
|
91
|
+
* @param {string} orgId - organization ID for which the configuration is to be fetched.
|
|
92
|
+
* @returns {Promise<OrgDesktopLoginResponse>} - A promise that resolves to the organization configuration.
|
|
99
93
|
* @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
|
|
100
94
|
* @private
|
|
101
95
|
*/
|
|
102
|
-
async
|
|
103
|
-
_loggerProxy.default.info('Fetching
|
|
96
|
+
async getOrgDesktopLoginConfig(orgId) {
|
|
97
|
+
_loggerProxy.default.info('Fetching organization desktop-login configuration', {
|
|
104
98
|
module: _constants2.CONFIG_FILE_NAME,
|
|
105
|
-
method: _constants3.METHODS.
|
|
99
|
+
method: _constants3.METHODS.GET_ORG_DESKTOP_LOGIN_CONFIG
|
|
106
100
|
});
|
|
107
101
|
try {
|
|
108
|
-
const resource = _constants3.endPointMap.
|
|
102
|
+
const resource = _constants3.endPointMap.orgDesktopLogin(orgId);
|
|
109
103
|
const response = await this.webexReq.request({
|
|
110
104
|
service: _constants.WCC_API_GATEWAY,
|
|
111
105
|
resource,
|
|
@@ -114,36 +108,36 @@ class AgentConfigService {
|
|
|
114
108
|
if (response.statusCode !== 200) {
|
|
115
109
|
throw new Error(`API call failed with ${response.statusCode}`);
|
|
116
110
|
}
|
|
117
|
-
_loggerProxy.default.log('
|
|
111
|
+
_loggerProxy.default.log('getOrgDesktopLoginConfig api success.', {
|
|
118
112
|
module: _constants2.CONFIG_FILE_NAME,
|
|
119
|
-
method: _constants3.METHODS.
|
|
113
|
+
method: _constants3.METHODS.GET_ORG_DESKTOP_LOGIN_CONFIG
|
|
120
114
|
});
|
|
121
115
|
return Promise.resolve(response.body);
|
|
122
116
|
} catch (error) {
|
|
123
|
-
_loggerProxy.default.error(`
|
|
117
|
+
_loggerProxy.default.error(`getOrgDesktopLoginConfig API call failed with ${error}`, {
|
|
124
118
|
module: _constants2.CONFIG_FILE_NAME,
|
|
125
|
-
method: _constants3.METHODS.
|
|
119
|
+
method: _constants3.METHODS.GET_ORG_DESKTOP_LOGIN_CONFIG
|
|
126
120
|
});
|
|
127
121
|
throw error;
|
|
128
122
|
}
|
|
129
123
|
}
|
|
130
124
|
|
|
131
125
|
/**
|
|
132
|
-
* Fetches the desktop
|
|
126
|
+
* Fetches the aggregated user desktop-login configuration for the given orgId and ciUserId.
|
|
133
127
|
* @ignore
|
|
134
|
-
* @param {string} orgId - organization ID for which the
|
|
135
|
-
* @param {string}
|
|
136
|
-
* @returns {Promise<
|
|
128
|
+
* @param {string} orgId - organization ID for which the configuration is to be fetched.
|
|
129
|
+
* @param {string} ciUserId - CI user ID of the agent whose configuration is to be fetched.
|
|
130
|
+
* @returns {Promise<UserDesktopLoginResponse>} - A promise that resolves to the user configuration.
|
|
137
131
|
* @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
|
|
138
132
|
* @private
|
|
139
133
|
*/
|
|
140
|
-
async
|
|
141
|
-
_loggerProxy.default.info('Fetching desktop
|
|
134
|
+
async getUserDesktopLoginConfig(orgId, ciUserId) {
|
|
135
|
+
_loggerProxy.default.info('Fetching user desktop-login configuration', {
|
|
142
136
|
module: _constants2.CONFIG_FILE_NAME,
|
|
143
|
-
method: _constants3.METHODS.
|
|
137
|
+
method: _constants3.METHODS.GET_USER_DESKTOP_LOGIN_CONFIG
|
|
144
138
|
});
|
|
145
139
|
try {
|
|
146
|
-
const resource = _constants3.endPointMap.
|
|
140
|
+
const resource = _constants3.endPointMap.userDesktopLogin(orgId, ciUserId);
|
|
147
141
|
const response = await this.webexReq.request({
|
|
148
142
|
service: _constants.WCC_API_GATEWAY,
|
|
149
143
|
resource,
|
|
@@ -152,15 +146,15 @@ class AgentConfigService {
|
|
|
152
146
|
if (response.statusCode !== 200) {
|
|
153
147
|
throw new Error(`API call failed with ${response.statusCode}`);
|
|
154
148
|
}
|
|
155
|
-
_loggerProxy.default.log('
|
|
149
|
+
_loggerProxy.default.log('getUserDesktopLoginConfig api success.', {
|
|
156
150
|
module: _constants2.CONFIG_FILE_NAME,
|
|
157
|
-
method: _constants3.METHODS.
|
|
151
|
+
method: _constants3.METHODS.GET_USER_DESKTOP_LOGIN_CONFIG
|
|
158
152
|
});
|
|
159
153
|
return Promise.resolve(response.body);
|
|
160
154
|
} catch (error) {
|
|
161
|
-
_loggerProxy.default.error(`
|
|
155
|
+
_loggerProxy.default.error(`getUserDesktopLoginConfig API call failed with ${error}`, {
|
|
162
156
|
module: _constants2.CONFIG_FILE_NAME,
|
|
163
|
-
method: _constants3.METHODS.
|
|
157
|
+
method: _constants3.METHODS.GET_USER_DESKTOP_LOGIN_CONFIG
|
|
164
158
|
});
|
|
165
159
|
throw error;
|
|
166
160
|
}
|
|
@@ -205,24 +199,23 @@ class AgentConfigService {
|
|
|
205
199
|
}
|
|
206
200
|
|
|
207
201
|
/**
|
|
208
|
-
* fetches the list of teams
|
|
202
|
+
* fetches the list of teams the given user belongs to.
|
|
209
203
|
* @ignore
|
|
210
204
|
* @param {string} orgId - organization ID for which the teams are to be fetched.
|
|
211
205
|
* @param {number} page - the page number to fetch.
|
|
212
206
|
* @param {number} pageSize - the number of teams to fetch per page.
|
|
213
|
-
* @param {string
|
|
214
|
-
* @param {string[]} attributes - optional attributes to include in the response.
|
|
207
|
+
* @param {string} userDbId - database ID of the user whose teams are to be fetched.
|
|
215
208
|
* @returns {Promise<ListTeamsResponse>} - A promise that resolves to the list of teams response.
|
|
216
209
|
* @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
|
|
217
210
|
* @private
|
|
218
211
|
*/
|
|
219
|
-
async getListOfTeams(orgId, page, pageSize,
|
|
212
|
+
async getListOfTeams(orgId, page, pageSize, userDbId) {
|
|
220
213
|
_loggerProxy.default.info('Fetching list of teams', {
|
|
221
214
|
module: _constants2.CONFIG_FILE_NAME,
|
|
222
215
|
method: _constants3.METHODS.GET_LIST_OF_TEAMS
|
|
223
216
|
});
|
|
224
217
|
try {
|
|
225
|
-
const resource = _constants3.endPointMap.listTeams(orgId, page, pageSize,
|
|
218
|
+
const resource = _constants3.endPointMap.listTeams(orgId, page, pageSize, userDbId);
|
|
226
219
|
const response = await this.webexReq.request({
|
|
227
220
|
service: _constants.WCC_API_GATEWAY,
|
|
228
221
|
resource,
|
|
@@ -246,26 +239,25 @@ class AgentConfigService {
|
|
|
246
239
|
}
|
|
247
240
|
|
|
248
241
|
/**
|
|
249
|
-
* Fetches all teams
|
|
242
|
+
* Fetches all teams the given user belongs to, from all pages
|
|
250
243
|
* @ignore
|
|
251
244
|
* @param {string} orgId - organization ID for which the teams are to be fetched.
|
|
252
245
|
* @param {number} pageSize - the number of teams to fetch per page.
|
|
253
|
-
* @param {string
|
|
254
|
-
* @param {string[]} attributes - optional attributes to include in the response.
|
|
246
|
+
* @param {string} userDbId - database ID of the user whose teams are to be fetched.
|
|
255
247
|
* @returns {Promise<TeamList[]>} - A promise that resolves to the list of teams.
|
|
256
248
|
* @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
|
|
257
249
|
* @private
|
|
258
250
|
*/
|
|
259
|
-
async getAllTeams(orgId, pageSize,
|
|
251
|
+
async getAllTeams(orgId, pageSize, userDbId) {
|
|
260
252
|
try {
|
|
261
253
|
let allTeams = [];
|
|
262
254
|
let page = _constants3.DEFAULT_PAGE;
|
|
263
|
-
const firstResponse = await this.getListOfTeams(orgId, page, pageSize,
|
|
255
|
+
const firstResponse = await this.getListOfTeams(orgId, page, pageSize, userDbId);
|
|
264
256
|
const totalPages = firstResponse.meta.totalPages;
|
|
265
257
|
allTeams = allTeams.concat(firstResponse.data);
|
|
266
258
|
const requests = [];
|
|
267
259
|
for (page = _constants3.DEFAULT_PAGE + 1; page < totalPages; page += 1) {
|
|
268
|
-
requests.push(this.getListOfTeams(orgId, page, pageSize,
|
|
260
|
+
requests.push(this.getListOfTeams(orgId, page, pageSize, userDbId));
|
|
269
261
|
}
|
|
270
262
|
const responses = await Promise.all(requests);
|
|
271
263
|
for (const response of responses) {
|
|
@@ -359,190 +351,72 @@ class AgentConfigService {
|
|
|
359
351
|
}
|
|
360
352
|
|
|
361
353
|
/**
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
* @param
|
|
366
|
-
* @returns
|
|
367
|
-
* @throws
|
|
368
|
-
* @
|
|
354
|
+
* Retrieves the exact system-managed WellbeingBreak idle code.
|
|
355
|
+
* This query intentionally bypasses Desktop Profile filtering so the system code does not
|
|
356
|
+
* need to appear in the normal agent-selectable idle-code list.
|
|
357
|
+
* @param orgId - Organization identifier
|
|
358
|
+
* @returns The normalized WellbeingBreak entity
|
|
359
|
+
* @throws When the request fails or the exact system code is unavailable
|
|
360
|
+
* @internal
|
|
369
361
|
*/
|
|
370
|
-
async
|
|
371
|
-
_loggerProxy.default.info('Fetching
|
|
362
|
+
async getWellbeingBreakIdleCode(orgId) {
|
|
363
|
+
_loggerProxy.default.info('Fetching WellbeingBreak system idle code', {
|
|
372
364
|
module: _constants2.CONFIG_FILE_NAME,
|
|
373
|
-
method: _constants3.METHODS.
|
|
365
|
+
method: _constants3.METHODS.GET_WELLBEING_BREAK_IDLE_CODE
|
|
374
366
|
});
|
|
375
367
|
try {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
* @returns {Promise<OrgInfo>} - A promise that resolves to the organization info response.
|
|
404
|
-
* @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
|
|
405
|
-
* @private
|
|
406
|
-
*/
|
|
407
|
-
async getOrgInfo(orgId) {
|
|
408
|
-
try {
|
|
409
|
-
const resource = _constants3.endPointMap.orgInfo(orgId);
|
|
410
|
-
const response = await this.webexReq.request({
|
|
411
|
-
service: _constants.WCC_API_GATEWAY,
|
|
412
|
-
resource,
|
|
413
|
-
method: _types.HTTP_METHODS.GET
|
|
414
|
-
});
|
|
415
|
-
if (response.statusCode !== 200) {
|
|
416
|
-
throw new Error(`API call failed with ${response.statusCode}`);
|
|
417
|
-
}
|
|
418
|
-
_loggerProxy.default.log('getOrgInfo api success.', {
|
|
419
|
-
module: _constants2.CONFIG_FILE_NAME,
|
|
420
|
-
method: _constants3.METHODS.GET_ORG_INFO
|
|
421
|
-
});
|
|
422
|
-
return Promise.resolve(response.body);
|
|
423
|
-
} catch (error) {
|
|
424
|
-
_loggerProxy.default.error(`getOrgInfo API call failed with ${error}`, {
|
|
425
|
-
module: _constants2.CONFIG_FILE_NAME,
|
|
426
|
-
method: _constants3.METHODS.GET_ORG_INFO
|
|
427
|
-
});
|
|
428
|
-
throw error;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
/**
|
|
433
|
-
* Fetches the organization settings for the given orgId.
|
|
434
|
-
* @ignore
|
|
435
|
-
* @param {string} orgId - organization ID for which the organization settings are to be fetched.
|
|
436
|
-
* @returns {Promise<OrgSettings>} - A promise that resolves to the organization settings response.
|
|
437
|
-
* @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
|
|
438
|
-
* @private
|
|
439
|
-
*/
|
|
440
|
-
async getOrganizationSetting(orgId) {
|
|
441
|
-
try {
|
|
442
|
-
const resource = _constants3.endPointMap.orgSettings(orgId);
|
|
443
|
-
const response = await this.webexReq.request({
|
|
444
|
-
service: _constants.WCC_API_GATEWAY,
|
|
445
|
-
resource,
|
|
446
|
-
method: _types.HTTP_METHODS.GET
|
|
447
|
-
});
|
|
448
|
-
if (response.statusCode !== 200) {
|
|
449
|
-
throw new Error(`API call failed with ${response.statusCode}`);
|
|
450
|
-
}
|
|
451
|
-
_loggerProxy.default.log('getOrganizationSetting api success.', {
|
|
452
|
-
module: _constants2.CONFIG_FILE_NAME,
|
|
453
|
-
method: _constants3.METHODS.GET_ORGANIZATION_SETTING
|
|
454
|
-
});
|
|
455
|
-
return Promise.resolve(response.body.data[0]);
|
|
456
|
-
} catch (error) {
|
|
457
|
-
_loggerProxy.default.error(`getOrganizationSetting API call failed with ${error}`, {
|
|
458
|
-
module: _constants2.CONFIG_FILE_NAME,
|
|
459
|
-
method: _constants3.METHODS.GET_ORGANIZATION_SETTING
|
|
460
|
-
});
|
|
461
|
-
throw error;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* Fetches the tenant data for the given orgId.
|
|
467
|
-
* @ignore
|
|
468
|
-
* @param {string} orgId - organization ID for which the tenant data is to be fetched.
|
|
469
|
-
* @returns {Promise<TenantData>} - A promise that resolves to the tenant data response.
|
|
470
|
-
* @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
|
|
471
|
-
* @private
|
|
472
|
-
*/
|
|
473
|
-
async getTenantData(orgId) {
|
|
474
|
-
try {
|
|
475
|
-
const resource = _constants3.endPointMap.tenantData(orgId);
|
|
476
|
-
const response = await this.webexReq.request({
|
|
477
|
-
service: _constants.WCC_API_GATEWAY,
|
|
478
|
-
resource,
|
|
479
|
-
method: _types.HTTP_METHODS.GET
|
|
480
|
-
});
|
|
481
|
-
if (response.statusCode !== 200) {
|
|
482
|
-
throw new Error(`API call failed with ${response.statusCode}`);
|
|
483
|
-
}
|
|
484
|
-
_loggerProxy.default.log('getTenantData api success.', {
|
|
485
|
-
module: _constants2.CONFIG_FILE_NAME,
|
|
486
|
-
method: _constants3.METHODS.GET_TENANT_DATA
|
|
487
|
-
});
|
|
488
|
-
return Promise.resolve(response.body.data[0]);
|
|
489
|
-
} catch (error) {
|
|
490
|
-
_loggerProxy.default.error(`getTenantData API call failed with ${error}`, {
|
|
491
|
-
module: _constants2.CONFIG_FILE_NAME,
|
|
492
|
-
method: _constants3.METHODS.GET_TENANT_DATA
|
|
493
|
-
});
|
|
494
|
-
throw error;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
/**
|
|
499
|
-
* Fetches the URL mapping data for the given orgId.
|
|
500
|
-
* @ignore
|
|
501
|
-
* @param {string} orgId - organization ID for which the URL mapping is to be fetched.
|
|
502
|
-
* @returns {Promise<URLMapping[]>} - A promise that resolves to the URL mapping response.
|
|
503
|
-
* @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
|
|
504
|
-
* @private
|
|
505
|
-
*/
|
|
506
|
-
async getURLMapping(orgId) {
|
|
507
|
-
try {
|
|
508
|
-
const resource = _constants3.endPointMap.urlMapping(orgId);
|
|
509
|
-
const response = await this.webexReq.request({
|
|
510
|
-
service: _constants.WCC_API_GATEWAY,
|
|
511
|
-
resource,
|
|
512
|
-
method: _types.HTTP_METHODS.GET
|
|
513
|
-
});
|
|
514
|
-
if (response.statusCode !== 200) {
|
|
515
|
-
throw new Error(`API call failed with ${response.statusCode}`);
|
|
516
|
-
}
|
|
517
|
-
_loggerProxy.default.log('getURLMapping api success.', {
|
|
518
|
-
module: _constants2.CONFIG_FILE_NAME,
|
|
519
|
-
method: _constants3.METHODS.GET_URL_MAPPING
|
|
520
|
-
});
|
|
521
|
-
return Promise.resolve(response.body.data);
|
|
368
|
+
let page = _constants3.DEFAULT_PAGE;
|
|
369
|
+
let totalPages = 1;
|
|
370
|
+
do {
|
|
371
|
+
// Pagination is intentionally sequential so the lookup can stop as soon as the code is found.
|
|
372
|
+
// eslint-disable-next-line no-await-in-loop
|
|
373
|
+
const response = await this.webexReq.request({
|
|
374
|
+
service: _constants.WCC_API_GATEWAY,
|
|
375
|
+
resource: _constants3.endPointMap.systemIdleCodes(orgId, page, _constants3.DEFAULT_PAGE_SIZE),
|
|
376
|
+
method: _types.HTTP_METHODS.GET
|
|
377
|
+
});
|
|
378
|
+
if (response.statusCode !== 200) {
|
|
379
|
+
throw new Error(`API call failed with ${response.statusCode}`);
|
|
380
|
+
}
|
|
381
|
+
const result = response.body;
|
|
382
|
+
const wellbeingCode = result.data?.find(code => code.active === true && code.isSystemCode === true && code.name === _constants3.WELLBEING_BREAK_IDLE_CODE);
|
|
383
|
+
if (wellbeingCode) {
|
|
384
|
+
return {
|
|
385
|
+
id: wellbeingCode.id,
|
|
386
|
+
name: wellbeingCode.name,
|
|
387
|
+
isSystem: true,
|
|
388
|
+
isDefault: wellbeingCode.defaultCode
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
totalPages = result.meta?.totalPages ?? 1;
|
|
392
|
+
page += 1;
|
|
393
|
+
} while (page < totalPages);
|
|
394
|
+
throw new Error('WELLBEING_BREAK_IDLE_CODE_NOT_FOUND');
|
|
522
395
|
} catch (error) {
|
|
523
|
-
_loggerProxy.default.error(`
|
|
396
|
+
_loggerProxy.default.error(`getWellbeingBreakIdleCode API call failed with ${error}`, {
|
|
524
397
|
module: _constants2.CONFIG_FILE_NAME,
|
|
525
|
-
method: _constants3.METHODS.
|
|
398
|
+
method: _constants3.METHODS.GET_WELLBEING_BREAK_IDLE_CODE
|
|
526
399
|
});
|
|
527
400
|
throw error;
|
|
528
401
|
}
|
|
529
402
|
}
|
|
530
403
|
|
|
531
404
|
/**
|
|
532
|
-
* Fetches
|
|
405
|
+
* Fetches the site data for the given orgId and siteId.
|
|
533
406
|
* @ignore
|
|
534
|
-
* @param {string} orgId - organization ID for which
|
|
535
|
-
* @
|
|
407
|
+
* @param {string} orgId - organization ID for which the site info is to be fetched.
|
|
408
|
+
* @param {string} siteId - site ID for which the data is to be fetched.
|
|
409
|
+
* @returns {Promise<SiteInfo>} - A promise that resolves to the site info response.
|
|
536
410
|
* @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
|
|
537
411
|
* @private
|
|
538
412
|
*/
|
|
539
|
-
async
|
|
540
|
-
_loggerProxy.default.info('Fetching
|
|
413
|
+
async getSiteInfo(orgId, siteId) {
|
|
414
|
+
_loggerProxy.default.info('Fetching site information', {
|
|
541
415
|
module: _constants2.CONFIG_FILE_NAME,
|
|
542
|
-
method: _constants3.METHODS.
|
|
416
|
+
method: _constants3.METHODS.GET_SITE_INFO
|
|
543
417
|
});
|
|
544
418
|
try {
|
|
545
|
-
const resource = _constants3.endPointMap.
|
|
419
|
+
const resource = _constants3.endPointMap.siteInfo(orgId, siteId);
|
|
546
420
|
const response = await this.webexReq.request({
|
|
547
421
|
service: _constants.WCC_API_GATEWAY,
|
|
548
422
|
resource,
|
|
@@ -551,15 +425,15 @@ class AgentConfigService {
|
|
|
551
425
|
if (response.statusCode !== 200) {
|
|
552
426
|
throw new Error(`API call failed with ${response.statusCode}`);
|
|
553
427
|
}
|
|
554
|
-
_loggerProxy.default.log('
|
|
428
|
+
_loggerProxy.default.log('getSiteInfo api success.', {
|
|
555
429
|
module: _constants2.CONFIG_FILE_NAME,
|
|
556
|
-
method: _constants3.METHODS.
|
|
430
|
+
method: _constants3.METHODS.GET_SITE_INFO
|
|
557
431
|
});
|
|
558
432
|
return Promise.resolve(response.body);
|
|
559
433
|
} catch (error) {
|
|
560
|
-
_loggerProxy.default.error(`
|
|
434
|
+
_loggerProxy.default.error(`getSiteInfo API call failed with ${error}`, {
|
|
561
435
|
module: _constants2.CONFIG_FILE_NAME,
|
|
562
|
-
method: _constants3.METHODS.
|
|
436
|
+
method: _constants3.METHODS.GET_SITE_INFO
|
|
563
437
|
});
|
|
564
438
|
throw error;
|
|
565
439
|
}
|