@webex/contact-center 3.12.0 → 3.13.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.sdd/manifest.json +887 -0
- package/AGENTS.md +94 -0
- package/ai-docs/ARCHITECTURE.md +168 -0
- package/ai-docs/CONTRACTS.md +64 -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 +388 -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 +1102 -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 +46 -3
- package/dist/constants.js.map +1 -1
- package/dist/index.js +86 -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 +369 -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/WebCallingService.js +287 -37
- 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 +48 -48
- package/dist/services/config/Util.js.map +1 -1
- package/dist/services/config/constants.js +57 -79
- 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 +100 -40
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/constants.js +19 -1
- package/dist/services/constants.js.map +1 -1
- package/dist/services/core/Err.js.map +1 -1
- package/dist/services/core/Utils.js +131 -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 +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 +26 -6
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
- package/dist/services/core/websocket/connection-service.js +3 -1
- package/dist/services/core/websocket/connection-service.js.map +1 -1
- package/dist/services/core/websocket/types.js.map +1 -1
- package/dist/services/index.js +6 -0
- 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 +1275 -504
- 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 +22 -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 +222 -10
- package/dist/types/config.d.ts +13 -0
- package/dist/types/constants.d.ts +40 -1
- package/dist/types/index.d.ts +58 -22
- 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 +67 -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 +252 -114
- package/dist/types/services/constants.d.ts +16 -0
- package/dist/types/services/core/Err.d.ts +6 -0
- package/dist/types/services/core/Utils.d.ts +43 -13
- 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/core/websocket/WebSocketManager.d.ts +2 -0
- package/dist/types/services/core/websocket/types.d.ts +1 -1
- package/dist/types/services/index.d.ts +2 -0
- 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 +20 -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 +258 -11
- package/dist/types/utils/PageCache.d.ts +20 -3
- package/dist/types/webex.d.ts +1 -0
- package/dist/types.js +204 -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 +1439 -105
- package/src/config.ts +13 -0
- package/src/constants.ts +53 -1
- package/src/index.ts +72 -16
- 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 +494 -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/WebCallingService.ts +362 -40
- 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 +512 -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 +64 -86
- package/src/services/config/index.ts +116 -277
- package/src/services/config/types.ts +238 -125
- package/src/services/constants.ts +18 -0
- package/src/services/core/Err.ts +3 -0
- package/src/services/core/Utils.ts +151 -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 +797 -0
- 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 +37 -8
- package/src/services/core/websocket/connection-service.ts +5 -1
- package/src/services/core/websocket/types.ts +1 -1
- package/src/services/index.ts +4 -0
- package/src/services/task/Task.ts +1211 -0
- package/src/services/task/TaskFactory.ts +82 -0
- package/src/services/task/TaskManager.ts +1551 -584
- 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 +21 -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 +323 -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 +4046 -181
- package/test/unit/spec/index.ts +891 -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 +442 -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 +484 -49
- 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 +318 -548
- package/test/unit/spec/services/core/Utils.ts +447 -8
- 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 +132 -56
- package/test/unit/spec/services/core/websocket/connection-service.ts +3 -1
- 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 +4800 -1586
- 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 -1525
- 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 -1801
- package/test/unit/spec/services/task/index.ts +0 -2184
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.WXAPP_LOG_PREFIX = exports.WXAPP_LOG_FEATURE = void 0;
|
|
7
|
+
exports.callIdSuffix = callIdSuffix;
|
|
8
|
+
exports.deriveWxAppAcceptReason = deriveWxAppAcceptReason;
|
|
9
|
+
exports.logWxAppMercuryMuteSync = logWxAppMercuryMuteSync;
|
|
10
|
+
exports.logWxAppOfferDecision = logWxAppOfferDecision;
|
|
11
|
+
exports.logWxAppOfferParticipantMismatch = logWxAppOfferParticipantMismatch;
|
|
12
|
+
exports.logWxAppSessionReadiness = logWxAppSessionReadiness;
|
|
13
|
+
exports.logWxAppTelephonyAction = logWxAppTelephonyAction;
|
|
14
|
+
exports.logWxAppValidationFailure = logWxAppValidationFailure;
|
|
15
|
+
var _loggerProxy = _interopRequireDefault(require("../logger-proxy"));
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
const WXAPP_LOG_FEATURE = exports.WXAPP_LOG_FEATURE = 'wxApp';
|
|
18
|
+
const WXAPP_LOG_PREFIX = exports.WXAPP_LOG_PREFIX = '[CC wxApp]';
|
|
19
|
+
/** Last 8 chars of callId for correlation without logging full id. */
|
|
20
|
+
function callIdSuffix(callId) {
|
|
21
|
+
if (!callId) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
return callId.length <= 8 ? callId : callId.slice(-8);
|
|
25
|
+
}
|
|
26
|
+
function formatLogSuffix(data, keys) {
|
|
27
|
+
const entries = keys ? keys.map(key => [key, data[key]]) : Object.entries(data).filter(([key]) => key !== 'feature' && key !== 'event');
|
|
28
|
+
const parts = entries.filter(([, value]) => value !== undefined && value !== null && value !== '').map(([key, value]) => `${key}=${String(value)}`);
|
|
29
|
+
return parts.length > 0 ? ` ${parts.join(' ')}` : '';
|
|
30
|
+
}
|
|
31
|
+
function logWxApp(message, method, data, suffixKeys) {
|
|
32
|
+
const suffix = formatLogSuffix(data, suffixKeys);
|
|
33
|
+
_loggerProxy.default.log(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {
|
|
34
|
+
module: 'wxAppDiagnosticLogging',
|
|
35
|
+
method,
|
|
36
|
+
data: {
|
|
37
|
+
feature: WXAPP_LOG_FEATURE,
|
|
38
|
+
...data
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function logWxAppWarn(message, method, data, suffixKeys) {
|
|
43
|
+
const suffix = formatLogSuffix(data, suffixKeys);
|
|
44
|
+
_loggerProxy.default.warn(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {
|
|
45
|
+
module: 'wxAppDiagnosticLogging',
|
|
46
|
+
method,
|
|
47
|
+
data: {
|
|
48
|
+
feature: WXAPP_LOG_FEATURE,
|
|
49
|
+
...data
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function logWxAppError(message, method, data, suffixKeys) {
|
|
54
|
+
const suffix = formatLogSuffix(data, suffixKeys);
|
|
55
|
+
_loggerProxy.default.error(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {
|
|
56
|
+
module: 'wxAppDiagnosticLogging',
|
|
57
|
+
method,
|
|
58
|
+
data: {
|
|
59
|
+
feature: WXAPP_LOG_FEATURE,
|
|
60
|
+
...data
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function logWxAppSessionReadiness(params) {
|
|
65
|
+
const data = {
|
|
66
|
+
event: 'session_readiness',
|
|
67
|
+
enableWxBetterTogether: params.enableWxBetterTogether,
|
|
68
|
+
loginOption: params.loginOption,
|
|
69
|
+
wxAppHooksApplied: params.wxAppHooksApplied,
|
|
70
|
+
usersubPublished: params.usersubPublished,
|
|
71
|
+
mercurySubscribed: params.mercurySubscribed,
|
|
72
|
+
telephonyTaskType: params.telephonyTaskType,
|
|
73
|
+
skipReason: params.skipReason
|
|
74
|
+
};
|
|
75
|
+
logWxApp('session readiness', 'logWxAppSessionReadiness', data, ['usersubPublished', 'mercurySubscribed', 'loginOption', 'enableWxBetterTogether', 'telephonyTaskType', 'skipReason']);
|
|
76
|
+
}
|
|
77
|
+
function deriveWxAppAcceptReason(params) {
|
|
78
|
+
if (params.isWxAppInboundOffer || params.isWxAppOutdialOffer) {
|
|
79
|
+
if (params.wxAppAcceptInFlight) {
|
|
80
|
+
return 'wxApp_accept_in_flight';
|
|
81
|
+
}
|
|
82
|
+
if (params.wxAppAnswerPending) {
|
|
83
|
+
return 'wxApp_answer_pending';
|
|
84
|
+
}
|
|
85
|
+
return 'wxApp_offer_ready';
|
|
86
|
+
}
|
|
87
|
+
if (params.isWebrtc && !params.isOutdial) {
|
|
88
|
+
return 'browser_webrtc_offer';
|
|
89
|
+
}
|
|
90
|
+
if (params.isOutdial) {
|
|
91
|
+
return 'outdial_auto_answer';
|
|
92
|
+
}
|
|
93
|
+
if (params.enableWxBetterTogether && !params.hasDeviceCallId) {
|
|
94
|
+
return 'extension_non_wxApp_offer';
|
|
95
|
+
}
|
|
96
|
+
return 'extension_non_wxApp_offer';
|
|
97
|
+
}
|
|
98
|
+
function logWxAppOfferDecision(params) {
|
|
99
|
+
const data = {
|
|
100
|
+
event: 'offer_decision',
|
|
101
|
+
interactionId: params.interactionId,
|
|
102
|
+
acceptVisible: params.acceptVisible,
|
|
103
|
+
acceptEnabled: params.acceptEnabled,
|
|
104
|
+
acceptReason: params.acceptReason,
|
|
105
|
+
wxAppParticipantDeviceType: params.wxAppParticipantDeviceType,
|
|
106
|
+
hasDeviceCallId: params.hasDeviceCallId,
|
|
107
|
+
hasDeviceId: params.hasDeviceId,
|
|
108
|
+
usersubPublished: params.usersubPublished
|
|
109
|
+
};
|
|
110
|
+
logWxApp('offer decision', 'logWxAppOfferDecision', data, ['acceptReason', 'hasDeviceCallId', 'hasDeviceId', 'usersubPublished', 'interactionId', 'acceptVisible', 'acceptEnabled']);
|
|
111
|
+
}
|
|
112
|
+
function logWxAppOfferParticipantMismatch(params) {
|
|
113
|
+
const data = {
|
|
114
|
+
event: 'participant_fields_mismatch',
|
|
115
|
+
interactionId: params.interactionId,
|
|
116
|
+
usersubPublished: params.usersubPublished,
|
|
117
|
+
hasDeviceCallId: params.hasDeviceCallId,
|
|
118
|
+
hasDeviceId: params.hasDeviceId,
|
|
119
|
+
participantDeviceType: params.participantDeviceType ?? 'missing',
|
|
120
|
+
acceptVisible: params.acceptVisible,
|
|
121
|
+
acceptEnabled: params.acceptEnabled,
|
|
122
|
+
acceptReason: params.acceptReason
|
|
123
|
+
};
|
|
124
|
+
logWxAppWarn('participant fields mismatch', 'logWxAppOfferParticipantMismatch', data, ['usersubPublished', 'hasDeviceCallId', 'hasDeviceId', 'acceptReason', 'interactionId', 'participantDeviceType']);
|
|
125
|
+
}
|
|
126
|
+
function logWxAppTelephonyAction(params) {
|
|
127
|
+
const payload = {
|
|
128
|
+
event: 'telephony_action',
|
|
129
|
+
action: params.action,
|
|
130
|
+
phase: params.phase,
|
|
131
|
+
interactionId: params.interactionId,
|
|
132
|
+
trackingId: params.trackingId,
|
|
133
|
+
httpStatus: params.httpStatus,
|
|
134
|
+
failureReason: params.failureReason
|
|
135
|
+
};
|
|
136
|
+
if (params.phase === 'failed') {
|
|
137
|
+
logWxAppError(`telephony ${params.action} ${params.phase}`, 'logWxAppTelephonyAction', payload, ['interactionId', 'trackingId', 'httpStatus', 'failureReason']);
|
|
138
|
+
} else {
|
|
139
|
+
logWxApp(`telephony ${params.action} ${params.phase}`, 'logWxAppTelephonyAction', payload, ['interactionId', 'action', 'phase']);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function logWxAppValidationFailure(reason, interactionId) {
|
|
143
|
+
logWxAppError('validation failed', 'logWxAppValidationFailure', {
|
|
144
|
+
event: 'validation_failed',
|
|
145
|
+
reason,
|
|
146
|
+
interactionId
|
|
147
|
+
}, ['reason', 'interactionId']);
|
|
148
|
+
}
|
|
149
|
+
function logWxAppMercuryMuteSync(params) {
|
|
150
|
+
logWxApp(`mercury mute sync ${params.phase}`, 'logWxAppMercuryMuteSync', {
|
|
151
|
+
event: 'mercury_mute_sync',
|
|
152
|
+
phase: params.phase,
|
|
153
|
+
muted: params.muted,
|
|
154
|
+
callIdSuffix: params.callIdSuffix,
|
|
155
|
+
interactionId: params.interactionId,
|
|
156
|
+
dropReason: params.dropReason
|
|
157
|
+
}, ['phase', 'muted', 'callIdSuffix', 'interactionId', 'dropReason']);
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=wxAppDiagnosticLogging.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_loggerProxy","_interopRequireDefault","require","e","__esModule","default","WXAPP_LOG_FEATURE","exports","WXAPP_LOG_PREFIX","callIdSuffix","callId","undefined","length","slice","formatLogSuffix","data","keys","entries","map","key","Object","filter","parts","value","String","join","logWxApp","message","method","suffixKeys","suffix","LoggerProxy","log","module","feature","logWxAppWarn","warn","logWxAppError","error","logWxAppSessionReadiness","params","event","enableWxBetterTogether","loginOption","wxAppHooksApplied","usersubPublished","mercurySubscribed","telephonyTaskType","skipReason","deriveWxAppAcceptReason","isWxAppInboundOffer","isWxAppOutdialOffer","wxAppAcceptInFlight","wxAppAnswerPending","isWebrtc","isOutdial","hasDeviceCallId","logWxAppOfferDecision","interactionId","acceptVisible","acceptEnabled","acceptReason","wxAppParticipantDeviceType","hasDeviceId","logWxAppOfferParticipantMismatch","participantDeviceType","logWxAppTelephonyAction","payload","action","phase","trackingId","httpStatus","failureReason","logWxAppValidationFailure","reason","logWxAppMercuryMuteSync","muted","dropReason"],"sources":["wxAppDiagnosticLogging.ts"],"sourcesContent":["import LoggerProxy from '../logger-proxy';\n\nexport const WXAPP_LOG_FEATURE = 'wxApp';\nexport const WXAPP_LOG_PREFIX = '[CC wxApp]';\n\nexport type WxAppAcceptReason =\n | 'wxApp_offer_ready'\n | 'wxApp_answer_pending'\n | 'wxApp_accept_in_flight'\n | 'extension_non_wxApp_offer'\n | 'browser_webrtc_offer'\n | 'outdial_auto_answer';\n\nexport type WxAppSessionSkipReason =\n | 'unsupported_browser_login'\n | 'flag_disabled'\n | 'mercury_subscribe_failed'\n | 'publish_failed';\n\nexport type WxAppTelephonyAction = 'accept' | 'decline' | 'mute' | 'dtmf';\nexport type WxAppTelephonyPhase = 'started' | 'success' | 'failed';\n\ntype WxAppLogData = Record<string, string | boolean | number | undefined>;\n\n/** Last 8 chars of callId for correlation without logging full id. */\nexport function callIdSuffix(callId: string | null | undefined): string | undefined {\n if (!callId) {\n return undefined;\n }\n\n return callId.length <= 8 ? callId : callId.slice(-8);\n}\n\nfunction formatLogSuffix(data: WxAppLogData, keys?: string[]): string {\n const entries = keys\n ? keys.map((key) => [key, data[key]] as const)\n : Object.entries(data).filter(([key]) => key !== 'feature' && key !== 'event');\n\n const parts = entries\n .filter(([, value]) => value !== undefined && value !== null && value !== '')\n .map(([key, value]) => `${key}=${String(value)}`);\n\n return parts.length > 0 ? ` ${parts.join(' ')}` : '';\n}\n\nfunction logWxApp(\n message: string,\n method: string,\n data: WxAppLogData,\n suffixKeys?: string[]\n): void {\n const suffix = formatLogSuffix(data, suffixKeys);\n LoggerProxy.log(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {\n module: 'wxAppDiagnosticLogging',\n method,\n data: {feature: WXAPP_LOG_FEATURE, ...data},\n });\n}\n\nfunction logWxAppWarn(\n message: string,\n method: string,\n data: WxAppLogData,\n suffixKeys?: string[]\n): void {\n const suffix = formatLogSuffix(data, suffixKeys);\n LoggerProxy.warn(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {\n module: 'wxAppDiagnosticLogging',\n method,\n data: {feature: WXAPP_LOG_FEATURE, ...data},\n });\n}\n\nfunction logWxAppError(\n message: string,\n method: string,\n data: WxAppLogData,\n suffixKeys?: string[]\n): void {\n const suffix = formatLogSuffix(data, suffixKeys);\n LoggerProxy.error(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {\n module: 'wxAppDiagnosticLogging',\n method,\n data: {feature: WXAPP_LOG_FEATURE, ...data},\n });\n}\n\nexport function logWxAppSessionReadiness(params: {\n enableWxBetterTogether: boolean;\n loginOption: string | undefined;\n wxAppHooksApplied: boolean;\n usersubPublished: boolean;\n mercurySubscribed: boolean;\n telephonyTaskType: 'Voice' | 'WebRTC' | 'unknown';\n skipReason?: WxAppSessionSkipReason;\n}): void {\n const data: WxAppLogData = {\n event: 'session_readiness',\n enableWxBetterTogether: params.enableWxBetterTogether,\n loginOption: params.loginOption,\n wxAppHooksApplied: params.wxAppHooksApplied,\n usersubPublished: params.usersubPublished,\n mercurySubscribed: params.mercurySubscribed,\n telephonyTaskType: params.telephonyTaskType,\n skipReason: params.skipReason,\n };\n\n logWxApp('session readiness', 'logWxAppSessionReadiness', data, [\n 'usersubPublished',\n 'mercurySubscribed',\n 'loginOption',\n 'enableWxBetterTogether',\n 'telephonyTaskType',\n 'skipReason',\n ]);\n}\n\nexport function deriveWxAppAcceptReason(params: {\n isWxAppInboundOffer: boolean;\n isWxAppOutdialOffer: boolean;\n isWebrtc: boolean;\n isOutdial: boolean;\n wxAppAcceptInFlight: boolean;\n wxAppAnswerPending: boolean;\n enableWxBetterTogether: boolean;\n hasDeviceCallId: boolean;\n}): WxAppAcceptReason {\n if (params.isWxAppInboundOffer || params.isWxAppOutdialOffer) {\n if (params.wxAppAcceptInFlight) {\n return 'wxApp_accept_in_flight';\n }\n if (params.wxAppAnswerPending) {\n return 'wxApp_answer_pending';\n }\n\n return 'wxApp_offer_ready';\n }\n\n if (params.isWebrtc && !params.isOutdial) {\n return 'browser_webrtc_offer';\n }\n\n if (params.isOutdial) {\n return 'outdial_auto_answer';\n }\n\n if (params.enableWxBetterTogether && !params.hasDeviceCallId) {\n return 'extension_non_wxApp_offer';\n }\n\n return 'extension_non_wxApp_offer';\n}\n\nexport function logWxAppOfferDecision(params: {\n interactionId: string;\n acceptVisible: boolean;\n acceptEnabled: boolean;\n acceptReason: WxAppAcceptReason;\n wxAppParticipantDeviceType?: string;\n hasDeviceCallId: boolean;\n hasDeviceId?: boolean;\n usersubPublished?: boolean;\n}): void {\n const data: WxAppLogData = {\n event: 'offer_decision',\n interactionId: params.interactionId,\n acceptVisible: params.acceptVisible,\n acceptEnabled: params.acceptEnabled,\n acceptReason: params.acceptReason,\n wxAppParticipantDeviceType: params.wxAppParticipantDeviceType,\n hasDeviceCallId: params.hasDeviceCallId,\n hasDeviceId: params.hasDeviceId,\n usersubPublished: params.usersubPublished,\n };\n\n logWxApp('offer decision', 'logWxAppOfferDecision', data, [\n 'acceptReason',\n 'hasDeviceCallId',\n 'hasDeviceId',\n 'usersubPublished',\n 'interactionId',\n 'acceptVisible',\n 'acceptEnabled',\n ]);\n}\n\nexport function logWxAppOfferParticipantMismatch(params: {\n interactionId: string;\n usersubPublished: boolean;\n hasDeviceCallId: boolean;\n hasDeviceId: boolean;\n participantDeviceType?: string;\n acceptVisible: boolean;\n acceptEnabled: boolean;\n acceptReason: WxAppAcceptReason;\n}): void {\n const data: WxAppLogData = {\n event: 'participant_fields_mismatch',\n interactionId: params.interactionId,\n usersubPublished: params.usersubPublished,\n hasDeviceCallId: params.hasDeviceCallId,\n hasDeviceId: params.hasDeviceId,\n participantDeviceType: params.participantDeviceType ?? 'missing',\n acceptVisible: params.acceptVisible,\n acceptEnabled: params.acceptEnabled,\n acceptReason: params.acceptReason,\n };\n\n logWxAppWarn('participant fields mismatch', 'logWxAppOfferParticipantMismatch', data, [\n 'usersubPublished',\n 'hasDeviceCallId',\n 'hasDeviceId',\n 'acceptReason',\n 'interactionId',\n 'participantDeviceType',\n ]);\n}\n\nexport function logWxAppTelephonyAction(params: {\n action: WxAppTelephonyAction;\n phase: WxAppTelephonyPhase;\n interactionId?: string;\n trackingId?: string;\n httpStatus?: number | string;\n failureReason?: string;\n}): void {\n const payload: WxAppLogData = {\n event: 'telephony_action',\n action: params.action,\n phase: params.phase,\n interactionId: params.interactionId,\n trackingId: params.trackingId,\n httpStatus: params.httpStatus,\n failureReason: params.failureReason,\n };\n\n if (params.phase === 'failed') {\n logWxAppError(\n `telephony ${params.action} ${params.phase}`,\n 'logWxAppTelephonyAction',\n payload,\n ['interactionId', 'trackingId', 'httpStatus', 'failureReason']\n );\n } else {\n logWxApp(`telephony ${params.action} ${params.phase}`, 'logWxAppTelephonyAction', payload, [\n 'interactionId',\n 'action',\n 'phase',\n ]);\n }\n}\n\nexport function logWxAppValidationFailure(reason: string, interactionId?: string): void {\n logWxAppError(\n 'validation failed',\n 'logWxAppValidationFailure',\n {\n event: 'validation_failed',\n reason,\n interactionId,\n },\n ['reason', 'interactionId']\n );\n}\n\nexport function logWxAppMercuryMuteSync(params: {\n phase: 'received' | 'applied' | 'dropped';\n muted?: boolean;\n callIdSuffix?: string;\n interactionId?: string;\n dropReason?: string;\n}): void {\n logWxApp(\n `mercury mute sync ${params.phase}`,\n 'logWxAppMercuryMuteSync',\n {\n event: 'mercury_mute_sync',\n phase: params.phase,\n muted: params.muted,\n callIdSuffix: params.callIdSuffix,\n interactionId: params.interactionId,\n dropReason: params.dropReason,\n },\n ['phase', 'muted', 'callIdSuffix', 'interactionId', 'dropReason']\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnC,MAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,OAAO;AACjC,MAAME,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,YAAY;AAqB5C;AACO,SAASC,YAAYA,CAACC,MAAiC,EAAsB;EAClF,IAAI,CAACA,MAAM,EAAE;IACX,OAAOC,SAAS;EAClB;EAEA,OAAOD,MAAM,CAACE,MAAM,IAAI,CAAC,GAAGF,MAAM,GAAGA,MAAM,CAACG,KAAK,CAAC,CAAC,CAAC,CAAC;AACvD;AAEA,SAASC,eAAeA,CAACC,IAAkB,EAAEC,IAAe,EAAU;EACpE,MAAMC,OAAO,GAAGD,IAAI,GAChBA,IAAI,CAACE,GAAG,CAAEC,GAAG,IAAK,CAACA,GAAG,EAAEJ,IAAI,CAACI,GAAG,CAAC,CAAU,CAAC,GAC5CC,MAAM,CAACH,OAAO,CAACF,IAAI,CAAC,CAACM,MAAM,CAAC,CAAC,CAACF,GAAG,CAAC,KAAKA,GAAG,KAAK,SAAS,IAAIA,GAAG,KAAK,OAAO,CAAC;EAEhF,MAAMG,KAAK,GAAGL,OAAO,CAClBI,MAAM,CAAC,CAAC,GAAGE,KAAK,CAAC,KAAKA,KAAK,KAAKZ,SAAS,IA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EpC,MAAM,CAACoC,KAAK;IACnBnE,YAAY,EAAE+B,MAAM,CAAC/B,YAAY;IACjCiD,aAAa,EAAElB,MAAM,CAACkB,aAAa;IACnCmB,UAAU,EAAErC,MAAM,CAACqC;EACrB,CAAC,EACD,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,CAClE,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isWxAppCallNotFoundError = isWxAppCallNotFoundError;
|
|
7
|
+
/**
|
|
8
|
+
* Expected Hydra responses when mute backfill races call creation (WXCC-6026).
|
|
9
|
+
* These must not be logged as errors — see task-spec wxApp mute backfill guard.
|
|
10
|
+
*/
|
|
11
|
+
function isWxAppCallNotFoundError(error) {
|
|
12
|
+
const err = error;
|
|
13
|
+
if (err?.status === 400 || err?.status === '400') {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
const message = String(err?.message ?? error ?? '');
|
|
17
|
+
return message.includes('Call not found') || message.includes('101002');
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=wxAppTelephonyUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isWxAppCallNotFoundError","error","err","status","message","String","includes"],"sources":["wxAppTelephonyUtils.ts"],"sourcesContent":["/**\n * Expected Hydra responses when mute backfill races call creation (WXCC-6026).\n * These must not be logged as errors — see task-spec wxApp mute backfill guard.\n */\nexport function isWxAppCallNotFoundError(error: unknown): boolean {\n const err = error as {status?: number | string; message?: string};\n if (err?.status === 400 || err?.status === '400') {\n return true;\n }\n\n const message = String(err?.message ?? error ?? '');\n\n return message.includes('Call not found') || message.includes('101002');\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACO,SAASA,wBAAwBA,CAACC,KAAc,EAAW;EAChE,MAAMC,GAAG,GAAGD,KAAqD;EACjE,IAAIC,GAAG,EAAEC,MAAM,KAAK,GAAG,IAAID,GAAG,EAAEC,MAAM,KAAK,KAAK,EAAE;IAChD,OAAO,IAAI;EACb;EAEA,MAAMC,OAAO,GAAGC,MAAM,CAACH,GAAG,EAAEE,OAAO,IAAIH,KAAK,IAAI,EAAE,CAAC;EAEnD,OAAOG,OAAO,CAACE,QAAQ,CAAC,gBAAgB,CAAC,IAAIF,OAAO,CAACE,QAAQ,CAAC,QAAQ,CAAC;AACzE","ignoreList":[]}
|
package/dist/types/cc.d.ts
CHANGED
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
* with Webex Contact Center features through the WebexSDK.
|
|
7
7
|
*/
|
|
8
8
|
import { WebexPlugin } from '@webex/webex-core';
|
|
9
|
-
import { SetStateResponse, IContactCenter, AgentLogin, AgentProfileUpdate, StationLoginResponse, StationLogoutResponse, BuddyAgentsResponse, BuddyAgents, UploadLogsResponse, UpdateDeviceTypeResponse } from './types';
|
|
9
|
+
import { SetStateResponse, IContactCenter, AgentLogin, AgentProfileUpdate, StationLoginResponse, StationLogoutResponse, BuddyAgentsResponse, BuddyAgents, UploadLogsResponse, UpdateDeviceTypeResponse, VoiceConnectionState } from './types';
|
|
10
10
|
import LoggerProxy from './logger-proxy';
|
|
11
11
|
import { StateChange, Logout } from './services/agent/types';
|
|
12
|
-
import { Profile, OutdialAniEntriesResponse, OutdialAniParams } from './services/config/types';
|
|
12
|
+
import { Profile, OutdialAniEntriesResponse, OutdialAniParams, Entity } from './services/config/types';
|
|
13
13
|
import { TaskResponse, PreviewContactPayload } from './services/task/types';
|
|
14
14
|
import { AddressBook } from './services/AddressBook';
|
|
15
|
+
import { Queue } from './services/Queue';
|
|
15
16
|
import { ApiAIAssistant } from './services/ApiAiAssistant';
|
|
17
|
+
import { UserPreference } from './services/UserPreference';
|
|
16
18
|
import type { EntryPointListResponse, EntryPointSearchParams, ContactServiceQueuesResponse, ContactServiceQueueSearchParams } from './types';
|
|
17
19
|
/**
|
|
18
20
|
* The main Contact Center plugin class that enables integration with Webex Contact Center.
|
|
@@ -97,7 +99,7 @@ import type { EntryPointListResponse, EntryPointSearchParams, ContactServiceQueu
|
|
|
97
99
|
*
|
|
98
100
|
* // Login with browser-based calling
|
|
99
101
|
* await cc.stationLogin({
|
|
100
|
-
* teamId: profile.teams[0].
|
|
102
|
+
* teamId: profile.teams[0].id,
|
|
101
103
|
* loginOption: 'BROWSER'
|
|
102
104
|
* });
|
|
103
105
|
*
|
|
@@ -161,6 +163,28 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
161
163
|
* @private
|
|
162
164
|
*/
|
|
163
165
|
private webCallingService;
|
|
166
|
+
/**
|
|
167
|
+
* REST telephony for wxApp thick-client answer (WXCC-6026)
|
|
168
|
+
* @private
|
|
169
|
+
*/
|
|
170
|
+
private answerCallOnWebexService;
|
|
171
|
+
/**
|
|
172
|
+
* usersub cross-client state for Webex App toast suppression
|
|
173
|
+
* @private
|
|
174
|
+
*/
|
|
175
|
+
private webexCrossClientService;
|
|
176
|
+
/**
|
|
177
|
+
* Mercury telephony mute sync for wxApp thick-client answer
|
|
178
|
+
* @private
|
|
179
|
+
*/
|
|
180
|
+
private wxAppTelephonyMercurySync;
|
|
181
|
+
/** True when wxApp mute sync opened Mercury (Extension/DN-only profiles). */
|
|
182
|
+
private wxAppMercuryConnectedByCc;
|
|
183
|
+
/** True when wxApp mute sync registered the Webex device. */
|
|
184
|
+
private wxAppDeviceRegisteredByCc;
|
|
185
|
+
private static readonly WXAPP_FALSE_PUBLISH_RETRY_DELAY_MS;
|
|
186
|
+
private static readonly WXAPP_FALSE_PUBLISH_MAX_RETRIES;
|
|
187
|
+
private wxAppFalsePublishRetryTimer?;
|
|
164
188
|
/**
|
|
165
189
|
* Core service managers for Contact Center operations
|
|
166
190
|
* Includes agent, connection, and configuration services
|
|
@@ -189,6 +213,13 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
189
213
|
* @private
|
|
190
214
|
*/
|
|
191
215
|
private metricsManager;
|
|
216
|
+
/** Current login/relogin session used for agent-scoped wellness validation. */
|
|
217
|
+
private currentAgentSessionId?;
|
|
218
|
+
/** Registered-session cache for the system WellbeingBreak idle code. */
|
|
219
|
+
private wellbeingBreakIdleCode?;
|
|
220
|
+
/** Registration generation that owns the wellness idle-code cache and in-flight lookups. */
|
|
221
|
+
private wellnessRegistrationGeneration;
|
|
222
|
+
private updateWellnessSession;
|
|
192
223
|
/**
|
|
193
224
|
* API instance for managing Webex Contact Center entry points
|
|
194
225
|
* Provides functionality to fetch entry points with caching support
|
|
@@ -250,7 +281,37 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
250
281
|
* });
|
|
251
282
|
* ```
|
|
252
283
|
*/
|
|
253
|
-
|
|
284
|
+
queue: Queue;
|
|
285
|
+
/**
|
|
286
|
+
* API instance for managing Webex Contact Center user preferences
|
|
287
|
+
* Provides functionality to get, create, update, and delete user preferences
|
|
288
|
+
* @type {UserPreference}
|
|
289
|
+
* @public
|
|
290
|
+
* @example
|
|
291
|
+
* ```typescript
|
|
292
|
+
* const cc = webex.cc;
|
|
293
|
+
* await cc.register();
|
|
294
|
+
* await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
|
|
295
|
+
*
|
|
296
|
+
* // Get user preferences for current user
|
|
297
|
+
* const preferences = await cc.userPreference.getUserPreference();
|
|
298
|
+
*
|
|
299
|
+
* // Create new user preferences
|
|
300
|
+
* const newPrefs = await cc.userPreference.createUserPreference({
|
|
301
|
+
* userId: 'user123',
|
|
302
|
+
* preferences: { e911Reminder: true }
|
|
303
|
+
* });
|
|
304
|
+
*
|
|
305
|
+
* // Update user preferences
|
|
306
|
+
* const updatedPrefs = await cc.userPreference.updateUserPreference('user123', {
|
|
307
|
+
* preferences: { e911Reminder: false }
|
|
308
|
+
* });
|
|
309
|
+
*
|
|
310
|
+
* // Delete user preferences
|
|
311
|
+
* await cc.userPreference.deleteUserPreference('user123');
|
|
312
|
+
* ```
|
|
313
|
+
*/
|
|
314
|
+
userPreference: UserPreference;
|
|
254
315
|
/**
|
|
255
316
|
* API instance for AI Assistant operations such as transcript controls.
|
|
256
317
|
* @type {ApiAIAssistant}
|
|
@@ -276,12 +337,19 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
276
337
|
* @param {ITask} task The incoming task object containing task details
|
|
277
338
|
*/
|
|
278
339
|
private handleIncomingTask;
|
|
340
|
+
private handleVoiceConnectionStateChange;
|
|
279
341
|
/**
|
|
280
342
|
* Handles task hydration events for updating task data
|
|
281
343
|
* @private
|
|
282
344
|
* @param {ITask} task The task object to be hydrated with additional data
|
|
283
345
|
*/
|
|
284
346
|
private handleTaskHydrate;
|
|
347
|
+
/**
|
|
348
|
+
* Handles multi-login hydrate events for SDK instances without Mobius registration
|
|
349
|
+
* @private
|
|
350
|
+
* @param {ITask} task The task object associated with the multi-login hydrate
|
|
351
|
+
*/
|
|
352
|
+
private handleTaskMultiLoginHydrate;
|
|
285
353
|
/**
|
|
286
354
|
* Handles task merged events when tasks are combined eg: EPDN merge/transfer
|
|
287
355
|
* @private
|
|
@@ -294,6 +362,10 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
294
362
|
* @param {ITask} task The campaign reservation task
|
|
295
363
|
*/
|
|
296
364
|
private handleCampaignPreviewReservation;
|
|
365
|
+
private trackInvalidWellnessEvent;
|
|
366
|
+
private normalizeWellnessBreakEvent;
|
|
367
|
+
private handleWellnessBreakWebsocketPayload;
|
|
368
|
+
private handleRTDWebsocketMessage;
|
|
297
369
|
/**
|
|
298
370
|
* Sets up event listeners for incoming tasks and task hydration
|
|
299
371
|
* Subscribes to task events from the task manager
|
|
@@ -328,12 +400,12 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
328
400
|
*
|
|
329
401
|
* console.log('Agent ID:', profile.agentId);
|
|
330
402
|
* console.log('Default DN:', profile.defaultDn);
|
|
331
|
-
* console.log('Teams:', profile.teams.map(t => t.
|
|
403
|
+
* console.log('Teams:', profile.teams.map(t => t.id));
|
|
332
404
|
* console.log('WebRTC Enabled:', profile.webRtcEnabled);
|
|
333
405
|
* console.log('Supported Login Options:', profile.loginVoiceOptions);
|
|
334
406
|
*
|
|
335
407
|
* // Now you can proceed with station login, state changes, etc.
|
|
336
|
-
* await cc.stationLogin({ teamId: profile.teams[0].
|
|
408
|
+
* await cc.stationLogin({ teamId: profile.teams[0].id, loginOption: 'BROWSER' });
|
|
337
409
|
* ```
|
|
338
410
|
*/
|
|
339
411
|
register(): Promise<Profile>;
|
|
@@ -516,6 +588,32 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
516
588
|
* ```
|
|
517
589
|
*/
|
|
518
590
|
setAgentState(data: StateChange): Promise<SetStateResponse>;
|
|
591
|
+
/**
|
|
592
|
+
* Returns the system-managed `WellbeingBreak` idle code for the current registration.
|
|
593
|
+
* The value is fetched outside Desktop Profile filtering and cached until deregistration.
|
|
594
|
+
* @returns The normalized system idle-code entity
|
|
595
|
+
* @throws Structured Contact Center error when wellness is disabled or the code is unavailable
|
|
596
|
+
* @example
|
|
597
|
+
* const idleCode = await webex.cc.getWellbeingBreakIdleCode();
|
|
598
|
+
* @public
|
|
599
|
+
*/
|
|
600
|
+
getWellbeingBreakIdleCode(): Promise<Entity>;
|
|
601
|
+
/**
|
|
602
|
+
* Returns the current browser voice connection state.
|
|
603
|
+
* Subscribe to `voice:connectionStateChange` to receive updates. The snapshot keeps line
|
|
604
|
+
* registration separate from Mobius socket connectivity and does not represent the Contact
|
|
605
|
+
* Center WebSocket connection.
|
|
606
|
+
*
|
|
607
|
+
* @returns {VoiceConnectionState} Current browser voice status and underlying connection states
|
|
608
|
+
* @fires voice:connectionStateChange When browser voice availability changes
|
|
609
|
+
* @public
|
|
610
|
+
* @example
|
|
611
|
+
* ```typescript
|
|
612
|
+
* cc.on('voice:connectionStateChange', onVoiceStateChange);
|
|
613
|
+
* const state = cc.getVoiceConnectionState();
|
|
614
|
+
* ```
|
|
615
|
+
*/
|
|
616
|
+
getVoiceConnectionState(): VoiceConnectionState;
|
|
519
617
|
/**
|
|
520
618
|
* Processes incoming websocket messages and emits corresponding events
|
|
521
619
|
* Handles various event types including agent state changes, login events,
|
|
@@ -524,6 +622,76 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
524
622
|
* @param {string} event The raw websocket event message
|
|
525
623
|
*/
|
|
526
624
|
private handleWebsocketMessage;
|
|
625
|
+
/**
|
|
626
|
+
* Checks whether Mobius/WebRTC registration should be skipped by config
|
|
627
|
+
* @returns {boolean} True when browser WebRTC registration is disabled
|
|
628
|
+
* @private
|
|
629
|
+
*/
|
|
630
|
+
private isWebRTCRegistrationDisabled;
|
|
631
|
+
/**
|
|
632
|
+
* Determines whether this local login should register a browser voice line.
|
|
633
|
+
* @param {LoginOption} loginOption Login device selected for this station login
|
|
634
|
+
* @returns {boolean} True when browser WebRTC registration is enabled
|
|
635
|
+
* @private
|
|
636
|
+
*/
|
|
637
|
+
private isBrowserVoiceRequired;
|
|
638
|
+
/**
|
|
639
|
+
* Validates contact-center plugin configuration before service initialization
|
|
640
|
+
* @private
|
|
641
|
+
*/
|
|
642
|
+
private validatePluginConfig;
|
|
643
|
+
/**
|
|
644
|
+
* Whether wxApp thick-client answer is enabled for this SDK instance.
|
|
645
|
+
* @public
|
|
646
|
+
*/
|
|
647
|
+
isWxBetterTogetherEnabled(): boolean;
|
|
648
|
+
/**
|
|
649
|
+
* Current station login option (Extension, Dial Number, or Browser/Desktop).
|
|
650
|
+
* Prefer webCallingService — updated on every stationLogin before wxApp hooks run.
|
|
651
|
+
* @private
|
|
652
|
+
*/
|
|
653
|
+
private getCurrentStationLoginOption;
|
|
654
|
+
/**
|
|
655
|
+
* wxApp thick-client answer is supported for Extension and Dial Number station login only —
|
|
656
|
+
* not Browser/Desktop (WebRTC) login.
|
|
657
|
+
* @private
|
|
658
|
+
*/
|
|
659
|
+
private assertWxAppStationLoginSupportedForEnable;
|
|
660
|
+
/**
|
|
661
|
+
* Clears runtime wxApp config after logout/deregister so stale flags do not apply on relogin.
|
|
662
|
+
* @private
|
|
663
|
+
*/
|
|
664
|
+
private resetEnableWxBetterTogetherConfig;
|
|
665
|
+
private getWxAppTelephonyTaskType;
|
|
666
|
+
private ensureWxAppPostStationLogin;
|
|
667
|
+
private clearWxAppFalsePublishRetryTimer;
|
|
668
|
+
private scheduleForcedFalsePublishRetry;
|
|
669
|
+
/**
|
|
670
|
+
* Retries compensating false publish after rollback failure, regardless of enabled flag.
|
|
671
|
+
* @private
|
|
672
|
+
*/
|
|
673
|
+
private scheduleCompensatingFalsePublishRetry;
|
|
674
|
+
private scheduleFalsePublishRetry;
|
|
675
|
+
/**
|
|
676
|
+
* Best-effort rollback when usersub true was published but wxApp setup did not complete.
|
|
677
|
+
* @private
|
|
678
|
+
*/
|
|
679
|
+
private revertWxAppCrossClientPublish;
|
|
680
|
+
private ensureWxAppDeviceRegistered;
|
|
681
|
+
private ensureWxAppMercuryConnected;
|
|
682
|
+
/**
|
|
683
|
+
* Disconnects Mercury and unregisters the device when wxApp mute sync opened them.
|
|
684
|
+
* @private
|
|
685
|
+
*/
|
|
686
|
+
private releaseWxAppMercuryResources;
|
|
687
|
+
/**
|
|
688
|
+
* Clears wxApp runtime state and feature-owned resources. Publish failures are logged;
|
|
689
|
+
* optional rethrow for deregister when callers need to surface usersub errors.
|
|
690
|
+
* @private
|
|
691
|
+
*/
|
|
692
|
+
private teardownWxAppLocalState;
|
|
693
|
+
private ensureWxAppMercuryAndSubscribe;
|
|
694
|
+
private publishAnswerOnWebexCrossClientState;
|
|
527
695
|
/**
|
|
528
696
|
* Initializes event listeners for the Contact Center service
|
|
529
697
|
* Sets up handlers for connection state changes and other core events
|
|
@@ -688,6 +856,50 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
688
856
|
* ```
|
|
689
857
|
*/
|
|
690
858
|
acceptPreviewContact(payload: PreviewContactPayload): Promise<TaskResponse>;
|
|
859
|
+
/**
|
|
860
|
+
* Skips a campaign preview contact, requesting the next contact from the campaign.
|
|
861
|
+
*
|
|
862
|
+
* When a campaign manager reserves a contact for an agent, the agent receives an
|
|
863
|
+
* `AgentOfferCampaignReservation` event. Instead of accepting, the agent can skip the
|
|
864
|
+
* preview contact to move to the next contact in the campaign.
|
|
865
|
+
*
|
|
866
|
+
* @param {PreviewContactPayload} payload - The preview contact payload containing interactionId and campaignId (campaign name, not UUID).
|
|
867
|
+
* @returns {Promise<TaskResponse>} Promise resolving with agent contact on success.
|
|
868
|
+
* @throws {Error} If the operation fails (network error, etc.)
|
|
869
|
+
*
|
|
870
|
+
* @example
|
|
871
|
+
* ```typescript
|
|
872
|
+
* webex.cc.on('task:campaignPreviewReservation', async (task) => {
|
|
873
|
+
* const { interactionId } = task.data;
|
|
874
|
+
* const campaignId = task.data.interaction.callProcessingDetails.campaignId;
|
|
875
|
+
*
|
|
876
|
+
* const result = await webex.cc.skipPreviewContact({ interactionId, campaignId });
|
|
877
|
+
* });
|
|
878
|
+
* ```
|
|
879
|
+
*/
|
|
880
|
+
skipPreviewContact(payload: PreviewContactPayload): Promise<TaskResponse>;
|
|
881
|
+
/**
|
|
882
|
+
* Removes a campaign preview contact from the campaign list entirely.
|
|
883
|
+
*
|
|
884
|
+
* When a campaign manager reserves a contact for an agent, the agent receives an
|
|
885
|
+
* `AgentOfferCampaignReservation` event. Instead of accepting or skipping, the agent can
|
|
886
|
+
* remove the preview contact to permanently take it out of the campaign contact list.
|
|
887
|
+
*
|
|
888
|
+
* @param {PreviewContactPayload} payload - The preview contact payload containing interactionId and campaignId (campaign name, not UUID).
|
|
889
|
+
* @returns {Promise<TaskResponse>} Promise resolving with agent contact on success.
|
|
890
|
+
* @throws {Error} If the operation fails (network error, etc.)
|
|
891
|
+
*
|
|
892
|
+
* @example
|
|
893
|
+
* ```typescript
|
|
894
|
+
* webex.cc.on('task:campaignPreviewReservation', async (task) => {
|
|
895
|
+
* const { interactionId } = task.data;
|
|
896
|
+
* const campaignId = task.data.interaction.callProcessingDetails.campaignId;
|
|
897
|
+
*
|
|
898
|
+
* const result = await webex.cc.removePreviewContact({ interactionId, campaignId });
|
|
899
|
+
* });
|
|
900
|
+
* ```
|
|
901
|
+
*/
|
|
902
|
+
removePreviewContact(payload: PreviewContactPayload): Promise<TaskResponse>;
|
|
691
903
|
/**
|
|
692
904
|
* Fetches outdial ANI (Automatic Number Identification) entries for an outdial ANI ID.
|
|
693
905
|
*
|
|
@@ -786,14 +998,14 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
786
998
|
*/
|
|
787
999
|
updateAgentProfile(data: AgentProfileUpdate): Promise<UpdateDeviceTypeResponse>;
|
|
788
1000
|
/**
|
|
789
|
-
* Returns paginated entry points
|
|
790
|
-
*
|
|
1001
|
+
* Returns paginated entry points using the EntryPoint service defaults.
|
|
1002
|
+
* Existing request parameters can override those defaults.
|
|
791
1003
|
* @public
|
|
792
1004
|
*/
|
|
793
1005
|
getEntryPoints(params?: EntryPointSearchParams): Promise<EntryPointListResponse>;
|
|
794
1006
|
/**
|
|
795
|
-
* Returns paginated contact service queues
|
|
796
|
-
*
|
|
1007
|
+
* Returns paginated contact service queues using the Queue service defaults.
|
|
1008
|
+
* Existing request parameters can override those defaults.
|
|
797
1009
|
* @public
|
|
798
1010
|
*/
|
|
799
1011
|
getQueues(params?: ContactServiceQueueSearchParams): Promise<ContactServiceQueuesResponse>;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -25,6 +25,19 @@ declare const _default: {
|
|
|
25
25
|
* @default true
|
|
26
26
|
*/
|
|
27
27
|
allowAutomatedRelogin: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether to skip Mobius/WebRTC registration for browser login flows.
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
disableWebRTCRegistration: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether wxApp Better Together is enabled at SDK init.
|
|
36
|
+
* Must be set before SDK init. Default false (WXCC-6026).
|
|
37
|
+
* @type {boolean}
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
enableWxBetterTogether: boolean;
|
|
28
41
|
/**
|
|
29
42
|
* The type of client making the connection.
|
|
30
43
|
* @type {string}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VoiceConnectionState } from './types';
|
|
1
2
|
export declare const EVENT = "event";
|
|
2
3
|
export declare const READY = "ready";
|
|
3
4
|
export declare const TIMEOUT_DURATION = 20000;
|
|
@@ -7,18 +8,21 @@ export declare const LOG_PREFIX = "PLUGIN_CC";
|
|
|
7
8
|
export declare const WEB_CALLING_SERVICE_FILE = "WebCallingService";
|
|
8
9
|
export declare const CONFIG_FILE_NAME = "config-index";
|
|
9
10
|
export declare const CC_FILE = "cc";
|
|
11
|
+
export declare const WELLNESS_BREAK_HANDLER = "Wellness_Break_Handler";
|
|
10
12
|
export declare const CONNECTION_SERVICE_FILE = "connection-service";
|
|
11
13
|
export declare const WEB_SOCKET_MANAGER_FILE = "WebSocketManager";
|
|
12
14
|
export declare const AQM_REQS_FILE = "aqm-reqs";
|
|
13
15
|
export declare const WEBEX_REQUEST_FILE = "WebexRequest";
|
|
14
16
|
export declare const TASK_MANAGER_FILE = "TaskManager";
|
|
15
17
|
export declare const TASK_FILE = "Task";
|
|
18
|
+
export declare const INBOUND_DIRECTION = "INBOUND";
|
|
16
19
|
export declare const OUTDIAL_DIRECTION = "OUTBOUND";
|
|
17
20
|
export declare const ATTRIBUTES: {};
|
|
18
21
|
export declare const OUTDIAL_MEDIA_TYPE = "telephony";
|
|
19
22
|
export declare const OUTBOUND_TYPE = "OUTDIAL";
|
|
20
23
|
export declare const UNKNOWN_ERROR = "Unknown error";
|
|
21
24
|
export declare const MERCURY_DISCONNECTED_SUCCESS = "Mercury disconnected successfully";
|
|
25
|
+
export declare const DEFAULT_VOICE_CONNECTION_STATE: Readonly<VoiceConnectionState>;
|
|
22
26
|
export declare const METHODS: {
|
|
23
27
|
REGISTER: string;
|
|
24
28
|
DEREGISTER: string;
|
|
@@ -36,15 +40,50 @@ export declare const METHODS: {
|
|
|
36
40
|
HANDLE_DEVICE_TYPE: string;
|
|
37
41
|
START_OUTDIAL: string;
|
|
38
42
|
GET_QUEUES: string;
|
|
39
|
-
GET_OUTDIAL_ANI_ENTRIES: string;
|
|
40
43
|
UPLOAD_LOGS: string;
|
|
41
44
|
UPDATE_AGENT_PROFILE: string;
|
|
42
45
|
GET_DEVICE_ID: string;
|
|
43
46
|
HANDLE_INCOMING_TASK: string;
|
|
44
47
|
HANDLE_TASK_HYDRATE: string;
|
|
45
48
|
INCOMING_TASK_LISTENER: string;
|
|
49
|
+
ACCEPT: string;
|
|
50
|
+
REJECT: string;
|
|
51
|
+
HOLD: string;
|
|
52
|
+
RESUME: string;
|
|
53
|
+
HOLD_RESUME: string;
|
|
54
|
+
TRANSFER_CALL: string;
|
|
55
|
+
CONSULT_TRANSFER: string;
|
|
56
|
+
CONSULT_CONFERENCE: string;
|
|
57
|
+
DROP_CONFERENCE_PARTICIPANT: string;
|
|
58
|
+
EXIT_CONFERENCE: string;
|
|
59
|
+
TRANSFER_CONFERENCE: string;
|
|
60
|
+
TOGGLE_MUTE: string;
|
|
61
|
+
TRANSMIT_DTMF: string;
|
|
62
|
+
COMPLETE_TRANSFER: string;
|
|
63
|
+
GET_OUTDIAL_ANI_ENTRIES: string;
|
|
46
64
|
ACCEPT_PREVIEW_CONTACT: string;
|
|
65
|
+
SKIP_PREVIEW_CONTACT: string;
|
|
66
|
+
REMOVE_PREVIEW_CONTACT: string;
|
|
47
67
|
GET_BASE_URL: string;
|
|
48
68
|
SEND_EVENT: string;
|
|
69
|
+
GET_REAL_TIME_ASSISTANCE: string;
|
|
70
|
+
SEND_REAL_TIME_ASSISTANCE_USER_ACTION: string;
|
|
49
71
|
FETCH_HISTORIC_TRANSCRIPTS: string;
|
|
72
|
+
REQUEST_WELLNESS_BREAK: string;
|
|
73
|
+
RESPOND_TO_WELLNESS_BREAK: string;
|
|
74
|
+
GET_WELLBEING_BREAK_IDLE_CODE: string;
|
|
75
|
+
SET_MANAGE_WEBEX_CALLING_IN_WXCC: string;
|
|
76
|
+
IS_WX_BETTER_TOGETHER_ENABLED: string;
|
|
77
|
+
SYNC_WXAPP_MUTE_FROM_MERCURY: string;
|
|
78
|
+
GET_CALL_DETAILS_ON_WEBEX: string;
|
|
79
|
+
ENSURE_WXAPP_MERCURY_CONNECTED: string;
|
|
80
|
+
};
|
|
81
|
+
export declare const AI_SUMMARY_ERROR_CODES: {
|
|
82
|
+
readonly POST_CALL_SUMMARY_DISABLED: "POST_CALL_SUMMARY_DISABLED";
|
|
83
|
+
readonly MID_CALL_SUMMARY_DISABLED: "MID_CALL_SUMMARY_DISABLED";
|
|
84
|
+
readonly AI_ASSISTANT_BASE_URL_NOT_AVAILABLE: "AI_ASSISTANT_BASE_URL_NOT_AVAILABLE";
|
|
85
|
+
readonly POST_CALL_SUMMARY_TIMEOUT: "POST_CALL_SUMMARY_TIMEOUT";
|
|
86
|
+
readonly MID_CALL_SUMMARY_TIMEOUT: "MID_CALL_SUMMARY_TIMEOUT";
|
|
50
87
|
};
|
|
88
|
+
export declare const AI_SUMMARY_INVALID_RESPONSE_PAYLOAD = "AI_SUMMARY_INVALID_RESPONSE_PAYLOAD";
|
|
89
|
+
export declare const AI_ASSISTANT_CLIENT_TYPE: "WxCC";
|