@webex/contact-center 3.12.0-llmrefactor.13 → 3.12.0-llmrefactor.15
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 +3 -2
- package/ai-docs/CONTRACTS.md +7 -1
- package/ai-docs/contact-center-spec.md +7 -7
- package/ai-docs/features/contact-owner-change-refactor.md +78 -0
- package/dist/cc.js +39 -7
- package/dist/cc.js.map +1 -1
- package/dist/metrics/behavioral-events.js +6 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +1 -0
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/AnswerCallOnWebexService.js +4 -4
- package/dist/services/AnswerCallOnWebexService.js.map +1 -1
- package/dist/services/WebexCrossClientService.js +5 -2
- package/dist/services/WebexCrossClientService.js.map +1 -1
- package/dist/services/WxAppTelephonyMercurySync.js +6 -3
- package/dist/services/WxAppTelephonyMercurySync.js.map +1 -1
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/task/TaskFactory.js +1 -0
- package/dist/services/task/TaskFactory.js.map +1 -1
- package/dist/services/task/TaskManager.js +50 -58
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/types.js.map +1 -1
- package/dist/services/task/voice/Voice.js +63 -44
- package/dist/services/task/voice/Voice.js.map +1 -1
- package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
- package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
- package/dist/services/task/voice/wxAppVoiceMethods.js +52 -11
- package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -1
- package/dist/services/wxAppDiagnosticLogging.js +50 -13
- package/dist/services/wxAppDiagnosticLogging.js.map +1 -1
- package/dist/types/metrics/constants.d.ts +1 -0
- package/dist/types/services/config/types.d.ts +2 -0
- package/dist/types/services/task/types.d.ts +2 -0
- package/dist/types/services/task/voice/Voice.d.ts +15 -2
- package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
- package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +19 -6
- package/dist/types/services/wxAppDiagnosticLogging.d.ts +12 -0
- package/dist/types.js.map +1 -1
- package/dist/webex.js +1 -1
- package/package.json +9 -9
- package/src/cc.ts +43 -7
- package/src/metrics/ai-docs/metrics-spec.md +44 -2
- package/src/metrics/behavioral-events.ts +6 -0
- package/src/metrics/constants.ts +1 -0
- package/src/services/AnswerCallOnWebexService.ts +4 -4
- package/src/services/WebexCrossClientService.ts +7 -2
- package/src/services/WxAppTelephonyMercurySync.ts +3 -3
- package/src/services/config/types.ts +2 -0
- package/src/services/task/TaskFactory.ts +1 -0
- package/src/services/task/TaskManager.ts +85 -87
- package/src/services/task/ai-docs/task-spec.md +7 -3
- package/src/services/task/types.ts +16 -0
- package/src/services/task/voice/Voice.ts +74 -52
- package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
- package/src/services/task/voice/wxAppVoiceMethods.ts +83 -24
- package/src/services/wxAppDiagnosticLogging.ts +135 -23
- package/src/types.ts +2 -0
- package/test/unit/spec/cc.ts +201 -19
- package/test/unit/spec/services/WebexCrossClientService.ts +45 -3
- package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +1 -1
- package/test/unit/spec/services/task/TaskManager.ts +214 -3
- package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +33 -0
- package/test/unit/spec/services/task/voice/Voice.ts +10 -51
- package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
- package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +121 -5
- package/test/unit/spec/services/wxAppDiagnosticLogging.ts +44 -8
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_loggerProxy","_interopRequireDefault","require","e","__esModule","default","WXAPP_LOG_FEATURE","exports","WXAPP_LOG_PREFIX","callIdSuffix","callId","undefined","length","slice","logWxApp","message","method","data","LoggerProxy","info","module","feature","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","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 logWxApp(message: string, method: string, data: WxAppLogData): void {\n LoggerProxy.info(`${WXAPP_LOG_PREFIX} ${message}`, {\n module: 'wxAppDiagnosticLogging',\n method,\n data: {feature: WXAPP_LOG_FEATURE, ...data},\n });\n}\n\nfunction logWxAppError(message: string, method: string, data: WxAppLogData): void {\n LoggerProxy.error(`${WXAPP_LOG_PREFIX} ${message}`, {\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 logWxApp('session readiness', 'logWxAppSessionReadiness', {\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\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}): void {\n logWxApp('offer decision', 'logWxAppOfferDecision', {\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 });\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(`telephony ${params.action} ${params.phase}`, 'logWxAppTelephonyAction', payload);\n } else {\n logWxApp(`telephony ${params.action} ${params.phase}`, 'logWxAppTelephonyAction', payload);\n }\n}\n\nexport function logWxAppValidationFailure(reason: string, interactionId?: string): void {\n logWxAppError('validation failed', 'logWxAppValidationFailure', {\n event: 'validation_failed',\n reason,\n 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(`mercury mute sync ${params.phase}`, 'logWxAppMercuryMuteSync', {\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}\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,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AM,CAAC6B;EACxB,CAAC;EAED,IAAI7B,MAAM,CAAC0B,KAAK,KAAK,QAAQ,EAAE;IAC7B7B,aAAa,CAAC,aAAaG,MAAM,CAACyB,MAAM,IAAIzB,MAAM,CAAC0B,KAAK,EAAE,EAAE,yBAAyB,EAAEF,OAAO,CAAC;EACjG,CAAC,MAAM;IACLnC,QAAQ,CAAC,aAAaW,MAAM,CAACyB,MAAM,IAAIzB,MAAM,CAAC0B,KAAK,EAAE,EAAE,yBAAyB,EAAEF,OAAO,CAAC;EAC5F;AACF;AAEO,SAASM,yBAAyBA,CAACC,MAAc,EAAEb,aAAsB,EAAQ;EACtFrB,aAAa,CAAC,mBAAmB,EAAE,2BAA2B,EAAE;IAC9DI,KAAK,EAAE,mBAAmB;IAC1B8B,MAAM;IACNb;EACF,CAAC,CAAC;AACJ;AAEO,SAASc,uBAAuBA,CAAChC,MAMvC,EAAQ;EACPX,QAAQ,CAAC,qBAAqBW,MAAM,CAAC0B,KAAK,EAAE,EAAE,yBAAyB,EAAE;IACvEzB,KAAK,EAAE,mBAAmB;IAC1ByB,KAAK,EAAE1B,MAAM,CAAC0B,KAAK;IACnBO,KAAK,EAAEjC,MAAM,CAACiC,KAAK;IACnBjD,YAAY,EAAEgB,MAAM,CAAChB,YAAY;IACjCkC,aAAa,EAAElB,MAAM,CAACkB,aAAa;IACnCgB,UAAU,EAAElC,MAAM,CAACkC;EACrB,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
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', 'interaction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145,6 +145,7 @@ export declare const METRIC_EVENT_NAMES: {
|
|
|
145
145
|
readonly WXAPP_USERSUB_PUBLISH_FAILED: "WxApp Usersub Publish Failed";
|
|
146
146
|
readonly WXAPP_MERCURY_SUBSCRIBE_SUCCESS: "WxApp Mercury Subscribe Success";
|
|
147
147
|
readonly WXAPP_MERCURY_SUBSCRIBE_FAILED: "WxApp Mercury Subscribe Failed";
|
|
148
|
+
readonly WXAPP_OFFER_PARTICIPANT_FIELDS_MISSING: "WxApp Offer Participant Fields Missing";
|
|
148
149
|
readonly UPLOAD_LOGS_SUCCESS: "Upload Logs Success";
|
|
149
150
|
readonly UPLOAD_LOGS_FAILED: "Upload Logs Failed";
|
|
150
151
|
readonly WEBSOCKET_DEREGISTER_SUCCESS: "Websocket Deregister Success";
|
|
@@ -1271,6 +1271,8 @@ export type Profile = {
|
|
|
1271
1271
|
maskSensitiveData?: boolean;
|
|
1272
1272
|
/** Whether agent is currently logged in */
|
|
1273
1273
|
isAgentLoggedIn?: boolean;
|
|
1274
|
+
/** Active station session after a successful registered relogin. */
|
|
1275
|
+
agentSessionId?: string;
|
|
1274
1276
|
/** Last auxiliary code ID used for state change */
|
|
1275
1277
|
lastStateAuxCodeId?: string;
|
|
1276
1278
|
/** Timestamp of last state change */
|
|
@@ -1846,6 +1846,8 @@ export type VoiceUIControlOptions = {
|
|
|
1846
1846
|
enableWxBetterTogether?: boolean;
|
|
1847
1847
|
consultTransferConfig?: ConsultTransferDestinationConfig;
|
|
1848
1848
|
answerCallOnWebexService?: import('../AnswerCallOnWebexService').default;
|
|
1849
|
+
/** Read-only observability: whether usersub answer-calls-on-wxcc is active this session. */
|
|
1850
|
+
getUsersubPublished?: () => boolean;
|
|
1849
1851
|
};
|
|
1850
1852
|
/**
|
|
1851
1853
|
* Participant information for UI display
|
|
@@ -14,7 +14,9 @@ export default class Voice extends Task implements IVoice {
|
|
|
14
14
|
private wxAppMuteSyncInFlight?;
|
|
15
15
|
private wxAppMuteToggleTail;
|
|
16
16
|
private wxAppDtmfTail;
|
|
17
|
-
|
|
17
|
+
/** Lazy — `super()` may call `updateUiControls` before field initializers run. */
|
|
18
|
+
private wxAppOfferObservability;
|
|
19
|
+
private getUsersubPublished?;
|
|
18
20
|
constructor(contact: ReturnType<typeof routingContact>, data: TaskData, callOptions?: VoiceUIControlOptions, wrapupData?: WrapupData, agentId?: string);
|
|
19
21
|
private getWxAppVoiceDependencies;
|
|
20
22
|
/** @deprecated Use {@link Voice.getWxAppVoiceDependencies} */
|
|
@@ -24,8 +26,18 @@ export default class Voice extends Task implements IVoice {
|
|
|
24
26
|
private setWxAppAnswerPending;
|
|
25
27
|
private setWxAppAcceptInFlight;
|
|
26
28
|
setEnableWxBetterTogether(enabled: boolean): void;
|
|
29
|
+
private getOrCreateWxAppOfferObservability;
|
|
27
30
|
protected updateUiControls(forceEmit?: boolean): void;
|
|
28
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Re-run OFFERED wxApp diagnostics without emitting UI controls.
|
|
33
|
+
* Used after usersub publish so a pre-publish offer can schedule mismatch grace.
|
|
34
|
+
*/
|
|
35
|
+
refreshWxAppOfferObservability(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Cancel pending participant-mismatch grace timer. Observability only.
|
|
38
|
+
*/
|
|
39
|
+
disposeWxAppOfferObservability(): void;
|
|
40
|
+
private getWxAppOfferObservabilityContext;
|
|
29
41
|
applyWxAppMuteStateFromSync(incomingCallId: string, muted: boolean): void;
|
|
30
42
|
getWxAppMuted(): boolean;
|
|
31
43
|
private static delay;
|
|
@@ -40,6 +52,7 @@ export default class Voice extends Task implements IVoice {
|
|
|
40
52
|
getWebexCallingCallId(): string | null;
|
|
41
53
|
private createWxAppLifecycle;
|
|
42
54
|
private getStateMachineSnapshot;
|
|
55
|
+
private getWxAppAcceptReasonForMetrics;
|
|
43
56
|
/**
|
|
44
57
|
* Accepts the task. Routes to wxApp telephony answer when `enableWxBetterTogether` and wxApp offer.
|
|
45
58
|
*/
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import MetricsManager from '../../../metrics/MetricsManager';
|
|
2
|
+
import { TaskState } from '../state-machine';
|
|
3
|
+
import { VoiceVariant } from '../types';
|
|
4
|
+
import { WxAppVoiceDependencies } from './wxAppVoiceMethods';
|
|
5
|
+
/** Defer mismatch WARN/metric so transient WS ordering gaps (~200–300 ms) do not false-alarm. */
|
|
6
|
+
export declare const WXAPP_PARTICIPANT_MISMATCH_GRACE_MS = 500;
|
|
7
|
+
export type WxAppOfferObservabilityContext = {
|
|
8
|
+
getInteractionId: () => string;
|
|
9
|
+
getTaskState: () => TaskState | undefined;
|
|
10
|
+
getAcceptControl: () => {
|
|
11
|
+
isVisible: boolean;
|
|
12
|
+
isEnabled: boolean;
|
|
13
|
+
} | undefined;
|
|
14
|
+
getVoiceVariant: () => VoiceVariant;
|
|
15
|
+
isOutdial: () => boolean;
|
|
16
|
+
isWxAppInboundOffer: () => boolean;
|
|
17
|
+
isWxAppCallingOffer: () => boolean;
|
|
18
|
+
getWxAppAcceptInFlight: () => boolean;
|
|
19
|
+
getWxAppAnswerPending: () => boolean;
|
|
20
|
+
getEnableWxBetterTogether: () => boolean;
|
|
21
|
+
getUsersubPublished: () => boolean;
|
|
22
|
+
getWxAppVoiceDependencies: () => WxAppVoiceDependencies;
|
|
23
|
+
getMetricsManager: () => MetricsManager;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* OFFERED-state wxApp offer diagnostics: acceptReason logging and deferred participant mismatch.
|
|
27
|
+
* Invoked from Voice.updateUiControls — observability only.
|
|
28
|
+
*/
|
|
29
|
+
export declare class WxAppOfferObservability {
|
|
30
|
+
private lastLoggedWxAppAcceptReason?;
|
|
31
|
+
private lastLoggedWxAppParticipantMismatch;
|
|
32
|
+
private wxAppParticipantMismatchGraceTimer?;
|
|
33
|
+
private disposed;
|
|
34
|
+
handleUiControlsUpdate(ctx: WxAppOfferObservabilityContext): void;
|
|
35
|
+
dispose(): void;
|
|
36
|
+
private cancelGraceTimer;
|
|
37
|
+
private scheduleGraceTimer;
|
|
38
|
+
private emitParticipantMismatchIfStillNeeded;
|
|
39
|
+
}
|
|
@@ -3,6 +3,7 @@ import { TaskData, TaskToggleMuteOptions, TaskTransmitDtmfOptions } from '../typ
|
|
|
3
3
|
import { TaskState } from '../state-machine';
|
|
4
4
|
import MetricsManager from '../../../metrics/MetricsManager';
|
|
5
5
|
import { WebexCallingDeviceDetails } from '../WebexCallingUtils';
|
|
6
|
+
import { type WxAppAcceptReason } from '../../wxAppDiagnosticLogging';
|
|
6
7
|
export type WxAppVoiceDependencies = {
|
|
7
8
|
enableWxBetterTogether: boolean;
|
|
8
9
|
answerCallOnWebexService?: AnswerCallOnWebexService;
|
|
@@ -12,6 +13,14 @@ export type WxAppVoiceDependencies = {
|
|
|
12
13
|
getTaskState: () => TaskState | undefined;
|
|
13
14
|
getWxAppMuted: () => boolean;
|
|
14
15
|
setWxAppMuted: (muted: boolean) => void;
|
|
16
|
+
/** Read-only observability: whether usersub answer-calls-on-wxcc is active this session. */
|
|
17
|
+
getUsersubPublished?: () => boolean;
|
|
18
|
+
};
|
|
19
|
+
export type WxAppParticipantDiagnostics = {
|
|
20
|
+
participantDeviceType?: string;
|
|
21
|
+
hasDeviceCallId: boolean;
|
|
22
|
+
hasDeviceId: boolean;
|
|
23
|
+
hasValidWxAppParticipant: boolean;
|
|
15
24
|
};
|
|
16
25
|
/** @deprecated Use {@link WxAppVoiceDependencies} */
|
|
17
26
|
export type WxAppVoiceDeps = WxAppVoiceDependencies;
|
|
@@ -22,6 +31,7 @@ export type WxAppVoiceLifecycle = {
|
|
|
22
31
|
syncWxAppMuteFromCallDetails: () => Promise<boolean | undefined>;
|
|
23
32
|
mapWxAppVoiceError: (error: unknown, method: string) => never;
|
|
24
33
|
};
|
|
34
|
+
export declare function getWxAppParticipantDiagnostics(deps: WxAppVoiceDependencies): WxAppParticipantDiagnostics;
|
|
25
35
|
export declare function getCallingDeviceDetails(deps: WxAppVoiceDependencies): WebexCallingDeviceDetails | undefined;
|
|
26
36
|
export declare function isWebexAppCallingOffer(deps: WxAppVoiceDependencies): boolean;
|
|
27
37
|
/** Inbound wxApp offer only — outdial decline uses CC routing, not telephony reject. */
|
|
@@ -43,13 +53,16 @@ export declare function transmitDtmfOnWebex(deps: WxAppVoiceDependencies, option
|
|
|
43
53
|
dtmf: string;
|
|
44
54
|
lineOwnerId?: string;
|
|
45
55
|
}): Promise<void>;
|
|
46
|
-
export
|
|
47
|
-
lineOwnerId?: string;
|
|
48
|
-
}): Promise<void>;
|
|
49
|
-
export declare function runWxAppReject(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: {
|
|
56
|
+
export type WxAppAcceptRejectOptions = {
|
|
50
57
|
lineOwnerId?: string;
|
|
51
|
-
|
|
52
|
-
|
|
58
|
+
acceptReason?: WxAppAcceptReason;
|
|
59
|
+
};
|
|
60
|
+
export declare function runWxAppAccept(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: WxAppAcceptRejectOptions): Promise<void>;
|
|
61
|
+
export declare function runWxAppReject(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: WxAppAcceptRejectOptions): Promise<void>;
|
|
62
|
+
export type WxAppOutdialDeclineOptions = {
|
|
63
|
+
acceptReason?: WxAppAcceptReason;
|
|
64
|
+
};
|
|
65
|
+
export declare function runWxAppOutdialDecline<T>(deps: WxAppVoiceDependencies, executeCancel: () => Promise<T>, options?: WxAppOutdialDeclineOptions): Promise<T>;
|
|
53
66
|
export declare function runWxAppToggleMute(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: TaskToggleMuteOptions): Promise<void>;
|
|
54
67
|
export declare function runWxAppTransmitDtmf(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options: TaskTransmitDtmfOptions): Promise<void>;
|
|
55
68
|
export declare function mapWxAppVoiceError(error: unknown, method: string, module: string): never;
|
|
@@ -32,6 +32,18 @@ export declare function logWxAppOfferDecision(params: {
|
|
|
32
32
|
acceptReason: WxAppAcceptReason;
|
|
33
33
|
wxAppParticipantDeviceType?: string;
|
|
34
34
|
hasDeviceCallId: boolean;
|
|
35
|
+
hasDeviceId?: boolean;
|
|
36
|
+
usersubPublished?: boolean;
|
|
37
|
+
}): void;
|
|
38
|
+
export declare function logWxAppOfferParticipantMismatch(params: {
|
|
39
|
+
interactionId: string;
|
|
40
|
+
usersubPublished: boolean;
|
|
41
|
+
hasDeviceCallId: boolean;
|
|
42
|
+
hasDeviceId: boolean;
|
|
43
|
+
participantDeviceType?: string;
|
|
44
|
+
acceptVisible: boolean;
|
|
45
|
+
acceptEnabled: boolean;
|
|
46
|
+
acceptReason: WxAppAcceptReason;
|
|
35
47
|
}): void;
|
|
36
48
|
export declare function logWxAppTelephonyAction(params: {
|
|
37
49
|
action: WxAppTelephonyAction;
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HTTP_METHODS","exports","GET","POST","PATCH","PUT","DELETE","LOGGING_LEVEL","LoginOption","AGENT_DN","EXTENSION","BROWSER","RealTimeAssistanceUserActionId","LIKE","DISLIKE","COPY","WELLNESS_BREAK_NOTIFICATION_ACTIONS","PROVIDE_WELLNESS_BREAK","SUGGEST_WELLNESS_BREAK","WELLNESS_BREAK_NOT_ALLOWED","WELLNESS_BREAK_USER_ACTIONS","REQUESTED","ACCEPTED","REJECTED","NO_RESPONSE","AIAssistantEventType","CUSTOM_EVENT","CTI_EVENT","AIAssistantEventName","GET_TRANSCRIPTS","GET_SUGGESTIONS","ADD_SUGGESTIONS_EXTRA_CONTEXT","GET_MID_CALL_SUMMARY","GET_POST_CALL_SUMMARY","MID_CALL_SUMMARY_RESPONSE","POST_CALL_SUMMARY_RESPONSE","SUGGESTED_RESPONSES_DIGITAL","SUGGESTED_RESPONSES_USER_ACTION","WELLNESS_BREAK_ACTION"],"sources":["types.ts"],"sourcesContent":["import {CallingClientConfig} from '@webex/calling';\nimport {\n SubmitBehavioralEvent,\n SubmitOperationalEvent,\n SubmitBusinessEvent,\n} from '@webex/internal-plugin-metrics/src/metrics.types';\nimport * as Agent from './services/agent/types';\nimport * as Contact from './services/task/types';\nimport {\n AIFeatureFlags,\n Entity,\n Profile,\n CreateUserPreferenceRequest,\n UpdateUserPreferenceRequest,\n} from './services/config/types';\nimport {PaginatedResponse, BaseSearchParams} from './utils/PageCache';\n\n/**\n * Generic type for converting a const enum object into a union type of its values.\n * @template T The enum object type\n * @internal\n * @ignore\n */\ntype Enum<T extends Record<string, unknown>> = T[keyof T];\n\n/**\n * HTTP methods supported by WebexRequest.\n * @enum {string}\n * @public\n * @example\n * const method: HTTP_METHODS = HTTP_METHODS.GET;\n * @ignore\n */\nexport const HTTP_METHODS = {\n /** HTTP GET method for retrieving data */\n GET: 'GET',\n /** HTTP POST method for creating resources */\n POST: 'POST',\n /** HTTP PATCH method for partial updates */\n PATCH: 'PATCH',\n /** HTTP PUT method for complete updates */\n PUT: 'PUT',\n /** HTTP DELETE method for removing resources */\n DELETE: 'DELETE',\n} as const;\n\n/**\n * Union type of HTTP methods.\n * @public\n * @example\n * function makeRequest(method: HTTP_METHODS) { ... }\n * @ignore\n */\nexport type HTTP_METHODS = Enum<typeof HTTP_METHODS>;\n\n/**\n * Payload for making requests to Webex APIs.\n * @public\n * @example\n * const payload: WebexRequestPayload = {\n * service: 'identity',\n * resource: '/users',\n * method: HTTP_METHODS.GET\n * };\n * @ignore\n */\nexport type WebexRequestPayload = {\n /** Service name to target */\n service?: string;\n /** Resource path within the service */\n resource?: string;\n /** HTTP method to use */\n method?: HTTP_METHODS;\n /** Full URI if not using service/resource pattern */\n uri?: string;\n /** Whether to add authorization header */\n addAuthHeader?: boolean;\n /** Custom headers to include in request */\n headers?: {\n [key: string]: string | null;\n };\n /** Request body data */\n body?: object;\n /** Expected response status code */\n statusCode?: number;\n /** Whether to parse response as JSON */\n json?: boolean;\n};\n\n/**\n * Event listener function type.\n * @internal\n * @ignore\n */\ntype Listener = (e: string, data?: unknown) => void;\n\n/**\n * Mercury event handler callback.\n * @internal\n * @ignore\n */\ntype MercuryEventHandler = (data?: unknown) => void;\n\n/**\n * Event listener removal function type.\n * @internal\n * @ignore\n */\ntype ListenerOff = (e: string, handler?: MercuryEventHandler) => void;\n\n/**\n * Service host configuration.\n * @internal\n * @ignore\n */\ntype ServiceHost = {\n /** Host URL/domain for the service */\n host: string;\n /** Time-to-live in seconds */\n ttl: number;\n /** Priority level for load balancing (lower is higher priority) */\n priority: number;\n /** Unique identifier for this host */\n id: string;\n /** Whether this is the home cluster for the user */\n homeCluster?: boolean;\n};\n\n/**\n * Configuration options for the Contact Center Plugin.\n * @interface CCPluginConfig\n * @public\n * @example\n * const config: CCPluginConfig = {\n * allowMultiLogin: true,\n * allowAutomatedRelogin: false,\n * clientType: 'browser',\n * isKeepAliveEnabled: true,\n * force: false,\n * metrics: { clientName: 'myClient', clientType: 'browser' },\n * logging: { enable: true, verboseEvents: false },\n * callingClientConfig: { ... }\n * };\n */\nexport interface CCPluginConfig {\n /** Whether to allow multiple logins from different devices */\n allowMultiLogin: boolean;\n /** Whether to automatically attempt relogin on connection loss */\n allowAutomatedRelogin: boolean;\n /** The type of client making the connection */\n clientType: string;\n /** Whether to enable keep-alive messages */\n isKeepAliveEnabled: boolean;\n /** Whether to force registration */\n force: boolean;\n /** Metrics configuration */\n metrics: {\n /** Name of the client for metrics */\n clientName: string;\n /** Type of client for metrics */\n clientType: string;\n };\n /** Logging configuration */\n logging: {\n /** Whether to enable logging */\n enable: boolean;\n /** Whether to log verbose events */\n verboseEvents: boolean;\n };\n /** Configuration for the calling client */\n callingClientConfig: CallingClientConfig;\n /** Whether to skip Mobius/WebRTC registration for browser login flows */\n disableWebRTCRegistration?: boolean;\n /** Whether wxApp Better Together (telephony REST + usersub) is enabled at init (WXCC-6026) */\n enableWxBetterTogether?: boolean;\n}\n\n/**\n * Logger interface for standardized logging throughout the plugin.\n * @public\n * @example\n * logger.log('This is a log message');\n * logger.error('This is an error message');\n * @ignore\n */\nexport type Logger = {\n /** Log general messages */\n log: (payload: string) => void;\n /** Log error messages */\n error: (payload: string) => void;\n /** Log warning messages */\n warn: (payload: string) => void;\n /** Log informational messages */\n info: (payload: string) => void;\n /** Log detailed trace messages */\n trace: (payload: string) => void;\n /** Log debug messages */\n debug: (payload: string) => void;\n};\n\n/**\n * Contextual information for log entries.\n * @public\n * @ignore\n */\nexport interface LogContext {\n /** Module name where the log originated */\n module?: string;\n /** Method name where the log originated */\n method?: string;\n interactionId?: string;\n trackingId?: string;\n /** Additional structured data to include in logs */\n data?: Record<string, any>;\n /** Error object to include in logs */\n error?: Error | unknown;\n}\n\n/**\n * Available logging severity levels.\n * @enum {string}\n * @public\n * @example\n * const level: LOGGING_LEVEL = LOGGING_LEVEL.error;\n * @ignore\n */\nexport enum LOGGING_LEVEL {\n /** Critical failures that require immediate attention */\n error = 'ERROR',\n /** Important issues that don't prevent the system from working */\n warn = 'WARN',\n /** General informational logs */\n log = 'LOG',\n /** Detailed information about system operation */\n info = 'INFO',\n /** Highly detailed diagnostic information */\n trace = 'TRACE',\n}\n\n/**\n * Metadata for log uploads.\n * @public\n * @example\n * const meta: LogsMetaData = { feedbackId: 'fb123', correlationId: 'corr456' };\n * @ignore\n */\nexport type LogsMetaData = {\n /** Optional feedback ID to associate with logs */\n feedbackId?: string;\n /** Optional correlation ID to track related operations */\n correlationId?: string;\n};\n\n/**\n * Response from uploading logs to the server.\n * @public\n * @example\n * const response: UploadLogsResponse = { trackingid: 'track123', url: 'https://...', userId: 'user1' };\n */\nexport type UploadLogsResponse = {\n /** Tracking ID for the upload request */\n trackingid?: string;\n /** URL where the logs can be accessed */\n url?: string;\n /** ID of the user who uploaded logs */\n userId?: string;\n /** Feedback ID associated with the logs */\n feedbackId?: string;\n /** Correlation ID for tracking related operations */\n correlationId?: string;\n};\n\n/**\n * Internal Webex SDK interfaces needed for plugin integration.\n * @internal\n * @ignore\n */\ninterface IWebexInternal {\n /** Mercury service for real-time messaging */\n mercury: {\n /** Register an event listener */\n on: Listener;\n /** Remove an event listener */\n off: ListenerOff;\n /** Establish a connection to the Mercury service */\n connect: () => Promise<void>;\n /** Disconnect from the Mercury service */\n disconnect: () => Promise<void>;\n /** Whether Mercury is currently connected */\n connected: boolean;\n /** Whether Mercury is in the process of connecting */\n connecting: boolean;\n };\n /** Device information */\n device: {\n /** Current WDM URL */\n url: string;\n /** Current user's ID */\n userId: string;\n /** Current organization ID */\n orgId: string;\n /** Device version */\n version: string;\n /** Calling behavior configuration */\n callingBehavior: string;\n /** Whether the device is registered with WDM */\n registered?: boolean;\n /** Register the device with WDM */\n register?: () => Promise<void>;\n /** Unregister the device from WDM */\n unregister?: () => Promise<void>;\n };\n /** Presence service */\n presence: unknown;\n /** Services discovery and management */\n services: {\n /** Get a service URL by name */\n get: (service: string) => string;\n /** Wait for service catalog to be loaded */\n waitForCatalog: (service: string) => Promise<void>;\n /** Check if current environment is INT (integration) */\n isIntegrationEnvironment: () => boolean;\n /** Host catalog for service discovery */\n _hostCatalog: Record<string, ServiceHost[]>;\n /** Service URLs cache */\n _serviceUrls: {\n /** Mobius calling service */\n mobius: string;\n /** Identity service */\n identity: string;\n /** Janus media server */\n janus: string;\n /** WDM (WebEx Device Management) service */\n wdm: string;\n /** BroadWorks IDP proxy service */\n broadworksIdpProxy: string;\n /** Hydra API service */\n hydra: string;\n /** Mercury API service */\n mercuryApi: string;\n /** UC Management gateway service */\n 'ucmgmt-gateway': string;\n /** Contacts service */\n contactsService: string;\n };\n };\n /** Metrics collection services */\n newMetrics: {\n /** Submit behavioral events (user actions) */\n submitBehavioralEvent: SubmitBehavioralEvent;\n /** Submit operational events (system operations) */\n submitOperationalEvent: SubmitOperationalEvent;\n /** Submit business events (business outcomes) */\n submitBusinessEvent: SubmitBusinessEvent;\n };\n /** Support functionality */\n support: {\n /** Submit logs to server */\n submitLogs: (\n metaData: LogsMetaData,\n logs: string,\n options: {\n /** Whether to submit full logs or just differences */\n type: 'diff' | 'full';\n }\n ) => Promise<UploadLogsResponse>;\n };\n}\n\n/**\n * Interface representing the WebexSDK core functionality.\n * @interface WebexSDK\n * @public\n * @example\n * const sdk: WebexSDK = ...;\n * sdk.request({ service: 'identity', resource: '/users', method: HTTP_METHODS.GET });\n * @ignore\n */\nexport interface WebexSDK {\n /** Version of the WebexSDK */\n version: string;\n /** Whether the SDK can authorize requests */\n canAuthorize: boolean;\n /** Credentials management */\n credentials: {\n /** Get the user token for authentication */\n getUserToken: () => Promise<string>;\n /** Get the organization ID */\n getOrgId: () => string;\n };\n /** Whether the SDK is ready for use */\n ready: boolean;\n /** Make a request to the Webex APIs */\n request: <T>(payload: WebexRequestPayload) => Promise<T>;\n /** Register a one-time event handler */\n once: (event: string, callBack: () => void) => void;\n /** Internal plugins and services */\n internal: IWebexInternal;\n /** Logger instance */\n logger: Logger;\n}\n\n/**\n * An interface for the `ContactCenter` class.\n * The `ContactCenter` package is designed to provide a set of APIs to perform various operations for the Agent flow within Webex Contact Center.\n * @public\n * @example\n * const cc: IContactCenter = ...;\n * cc.register().then(profile => { ... });\n * @ignore\n */\nexport interface IContactCenter {\n /**\n * Initialize the CC SDK by setting up the contact center mercury connection.\n * This establishes WebSocket connectivity for real-time communication.\n *\n * @returns A Promise that resolves to the agent's profile upon successful registration\n * @public\n * @example\n * cc.register().then(profile => { ... });\n */\n register(): Promise<Profile>;\n\n /** Returns the system-managed WellbeingBreak idle code for the registered session. */\n getWellbeingBreakIdleCode(): Promise<Entity>;\n}\n\n/**\n * Generic HTTP response structure.\n * @public\n * @example\n * const response: IHttpResponse = { body: {}, statusCode: 200, method: 'GET', headers: {}, url: '...' };\n * @ignore\n */\nexport interface IHttpResponse {\n /** Response body content */\n body: any;\n /** HTTP status code */\n statusCode: number;\n /** HTTP method used for the request */\n method: string;\n /** Response headers */\n headers: Headers;\n /** Request URL */\n url: string;\n}\n\n/**\n * Supported login options for agent authentication.\n * @public\n * @example\n * const option: LoginOption = LoginOption.AGENT_DN;\n * @ignore\n */\nexport const LoginOption = {\n /** Login using agent's direct number */\n AGENT_DN: 'AGENT_DN',\n /** Login using an extension number */\n EXTENSION: 'EXTENSION',\n /** Login using browser WebRTC capabilities */\n BROWSER: 'BROWSER',\n} as const;\n\n/**\n * Union type of login options.\n * @public\n * @example\n * function login(option: LoginOption) { ... }\n * @ignore\n */\nexport type LoginOption = Enum<typeof LoginOption>;\n\n/**\n * Request payload for subscribing to the contact center websocket.\n * @public\n * @example\n * const req: SubscribeRequest = { force: true, isKeepAliveEnabled: true, clientType: 'browser', allowMultiLogin: false };\n * @ignore\n */\nexport type SubscribeRequest = {\n /** Whether to force connection even if another exists */\n force: boolean;\n /** Whether to send keepalive messages */\n isKeepAliveEnabled: boolean;\n /** Type of client connecting */\n clientType: string;\n /** Whether to allow login from multiple devices */\n allowMultiLogin: boolean;\n};\n\n/**\n * Represents the response from getListOfTeams method.\n * Teams are groups of agents that can be managed together.\n * @public\n * @example\n * const team: Team = { id: 'team1', name: 'Support', desktopLayoutId: 'layout1' };\n * @ignore\n */\nexport type Team = {\n /**\n * Unique identifier of the team.\n */\n id: string;\n\n /**\n * Display name of the team.\n */\n name: string;\n\n /**\n * Associated desktop layout ID for the team.\n * Controls how the agent desktop is displayed for team members.\n */\n desktopLayoutId?: string;\n};\n\n/**\n * Represents the request to perform agent login.\n * @public\n * @example\n * const login: AgentLogin = { dialNumber: '1234', teamId: 'team1', loginOption: LoginOption.AGENT_DN };\n */\nexport type AgentLogin = {\n /**\n * A dialNumber field contains the number to dial such as a route point or extension.\n * Required for AGENT_DN and EXTENSION login options.\n */\n dialNumber?: string;\n\n /**\n * The unique ID representing a team of users.\n * The agent must belong to this team.\n */\n teamId: string;\n\n /**\n * The loginOption field specifies the type of login method.\n * Controls how calls are delivered to the agent.\n */\n loginOption: LoginOption;\n};\n\n/**\n * Represents the request to update agent profile settings.\n * @public\n * @example\n * const update: AgentProfileUpdate = { loginOption: LoginOption.BROWSER, dialNumber: '5678' };\n */\nexport type AgentProfileUpdate = Pick<AgentLogin, 'loginOption' | 'dialNumber' | 'teamId'>;\n\n/**\n * Union type for all possible request body types.\n * @internal\n * @ignore\n */\nexport type RequestBody =\n | SubscribeRequest\n | Agent.Logout\n | Agent.UserStationLogin\n | Agent.StateChange\n | Agent.BuddyAgents\n | Contact.HoldResumePayload\n | Contact.ResumeRecordingPayload\n | Contact.ConsultPayload\n | Contact.ConsultEndAPIPayload // API Payload accepts only QueueId wheres SDK API allows more params\n | Contact.TransferPayLoad\n | Contact.ConsultTransferPayLoad\n | Contact.cancelCtq\n | Contact.WrapupPayLoad\n | Contact.DialerPayload\n | Contact.PreviewContactPayload\n | CreateUserPreferenceRequest\n | UpdateUserPreferenceRequest;\n\n/**\n * Represents the options to fetch buddy agents for the logged in agent.\n * Buddy agents are other agents who can be consulted or transferred to.\n * @public\n * @example\n * const opts: BuddyAgents = { mediaType: 'telephony', state: 'Available' };\n */\nexport type BuddyAgents = {\n /**\n * The media type channel to filter buddy agents. Defaults to telephony when omitted.\n */\n mediaType?: 'telephony' | 'chat' | 'social' | 'email';\n\n /**\n * Optional filter for agent state.\n * If specified, returns only agents in that state.\n * If omitted, returns both available and idle agents.\n */\n state?: 'Available' | 'Idle';\n\n /**\n * Applies the default state policy for the operation. An explicit state takes precedence.\n */\n action?: 'Consult' | 'Transfer';\n};\n\n/**\n * Holds the configuration flags for the Agent.\n * These flags determine the availability of certain features in the Agent UI.\n * @internal\n */\nexport type ConfigFlags = {\n isEndTaskEnabled: boolean;\n isEndConsultEnabled: boolean;\n webRtcEnabled: boolean;\n autoWrapup: boolean;\n aiFeature?: AIFeatureFlags;\n /** Agent-profile policy used to derive task consult/transfer destination controls. */\n consultTransfer?: Contact.ConsultTransferDestinationConfig;\n /**\n * Optional toggle to globally enable/disable recording controls.\n * Falls back to backend hints when omitted.\n */\n isRecordingEnabled?: boolean;\n /** Whether wxApp thick-client answer controls/APIs are enabled (WXCC-6026) */\n enableWxBetterTogether?: boolean;\n};\n\n/**\n\n * Generic error structure for Contact Center SDK errors.\n * Contains detailed information about the error context.\n * @public\n * @example\n * const err: GenericError = new Error('Failed');\n * err.details = { type: 'ERR', orgId: 'org1', trackingId: 'track1', data: {} };\n * @ignore\n */\nexport interface GenericError extends Error {\n /** Structured details about the error */\n details: {\n /** Error type identifier */\n type: string;\n /** Organization ID where the error occurred */\n orgId: string;\n /** Unique tracking ID for the error */\n trackingId: string;\n /** Additional error context data */\n data: Record<string, any>;\n };\n}\n\n/**\n * Response type for station login operations.\n * Either a success response with agent details or an error.\n * @public\n * @example\n * function handleLogin(resp: StationLoginResponse) { ... }\n */\nexport type StationLoginResponse = Agent.StationLoginSuccessResponse | Error;\n\n/**\n * Response type for station logout operations.\n * Either a success response with logout details or an error.\n * @public\n * @example\n * function handleLogout(resp: StationLogoutResponse) { ... }\n */\nexport type StationLogoutResponse = Agent.LogoutSuccess | Error;\n\n/**\n * Response type for station relogin operations.\n * Either a success response with relogin details or an error.\n * @public\n * @example\n * function handleReLogin(resp: StationReLoginResponse) { ... }\n * @ignore\n */\nexport type StationReLoginResponse = Agent.ReloginSuccess | Error;\n\n/**\n * Response type for agent state change operations.\n * Either a success response with state change details or an error.\n * @public\n * @example\n * function handleStateChange(resp: SetStateResponse) { ... }\n * @ignore\n */\nexport type SetStateResponse = Agent.StateChangeSuccess | Error;\n\n/**\n * AddressBook types\n */\nexport interface AddressBookEntry {\n id: string;\n organizationId?: string;\n version?: number;\n name: string;\n number: string;\n createdTime?: number;\n lastUpdatedTime?: number;\n}\n\nexport type AddressBookEntriesResponse = PaginatedResponse<AddressBookEntry>;\n\nexport interface AddressBookEntrySearchParams extends BaseSearchParams {\n addressBookId?: string;\n}\n\n/**\n * EntryPointRecord types\n */\nexport interface EntryPointRecord {\n id: string;\n name: string;\n /** Dialled number mapped to this entry point when included in the list response. */\n number?: string;\n description?: string;\n type?: string;\n isActive?: boolean;\n orgId?: string;\n createdAt?: string;\n updatedAt?: string;\n settings?: Record<string, any>;\n}\n\nexport type EntryPointListResponse = PaginatedResponse<EntryPointRecord>;\nexport type EntryPointSearchParams = BaseSearchParams;\n\n/**\n * Queue types\n */\nexport interface QueueSkillRequirement {\n organizationId?: string;\n id?: string;\n version?: number;\n skillId: string;\n skillName?: string;\n skillType?: string;\n condition: string;\n skillValue: string;\n createdTime?: number;\n lastUpdatedTime?: number;\n}\n\nexport interface QueueAgent {\n id: string;\n ciUserId?: string;\n}\n\nexport interface AgentGroup {\n teamId: string;\n}\n\nexport interface CallDistributionGroup {\n agentGroups: AgentGroup[];\n order: number;\n duration?: number;\n}\n\nexport interface AssistantSkillMapping {\n assistantSkillId?: string;\n assistantSkillUpdatedTime?: number;\n}\n\n/**\n * Configuration for a contact service queue\n * @public\n */\nexport interface ContactServiceQueue {\n /** Organization ID */\n organizationId?: string;\n /** Unique identifier for the queue */\n id?: string;\n /** Version of the queue */\n version?: number;\n /** Name of the Contact Service Queue */\n name: string;\n /** Description of the queue */\n description?: string;\n /** Queue type (INBOUND, OUTBOUND) */\n queueType: 'INBOUND' | 'OUTBOUND';\n /** Whether to check agent availability */\n checkAgentAvailability: boolean;\n /** Channel type (TELEPHONY, EMAIL, SOCIAL_CHANNEL, CHAT, etc.) */\n channelType: 'TELEPHONY' | 'EMAIL' | 'FAX' | 'CHAT' | 'VIDEO' | 'OTHERS' | 'SOCIAL_CHANNEL';\n /** Social channel type for SOCIAL_CHANNEL channelType */\n socialChannelType?:\n | 'MESSAGEBIRD'\n | 'MESSENGER'\n | 'WHATSAPP'\n | 'APPLE_BUSINESS_CHAT'\n | 'GOOGLE_BUSINESS_MESSAGES';\n /** Service level threshold in seconds */\n serviceLevelThreshold: number;\n /** Maximum number of simultaneous contacts */\n maxActiveContacts: number;\n /** Maximum time in queue in seconds */\n maxTimeInQueue: number;\n /** Default music in queue media file ID */\n defaultMusicInQueueMediaFileId: string;\n /** Timezone for routing strategies */\n timezone?: string;\n /** Whether the queue is active */\n active: boolean;\n /** Whether outdial campaign is enabled */\n outdialCampaignEnabled?: boolean;\n /** Whether monitoring is permitted */\n monitoringPermitted: boolean;\n /** Whether parking is permitted */\n parkingPermitted: boolean;\n /** Whether recording is permitted */\n recordingPermitted: boolean;\n /** Whether recording all calls is permitted */\n recordingAllCallsPermitted: boolean;\n /** Whether pausing recording is permitted */\n pauseRecordingPermitted: boolean;\n /** Recording pause duration in seconds */\n recordingPauseDuration?: number;\n /** Control flow script URL */\n controlFlowScriptUrl: string;\n /** IVR requeue URL */\n ivrRequeueUrl: string;\n /** Overflow number for telephony */\n overflowNumber?: string;\n /** Vendor ID */\n vendorId?: string;\n /** Routing type */\n routingType: 'LONGEST_AVAILABLE_AGENT' | 'SKILLS_BASED' | 'CIRCULAR' | 'LINEAR';\n /** Skills-based routing type */\n skillBasedRoutingType?: 'LONGEST_AVAILABLE_AGENT' | 'BEST_AVAILABLE_AGENT';\n /** Queue routing type */\n queueRoutingType: 'TEAM_BASED' | 'SKILL_BASED' | 'AGENT_BASED';\n /** Queue skill requirements */\n queueSkillRequirements?: QueueSkillRequirement[];\n /** List of agents for agent-based queue */\n agents?: QueueAgent[];\n /** Call distribution groups */\n callDistributionGroups: CallDistributionGroup[];\n /** XSP version */\n xspVersion?: string;\n /** Subscription ID */\n subscriptionId?: string;\n /** Assistant skill mapping */\n assistantSkill?: AssistantSkillMapping;\n /** Whether this is a system default queue */\n systemDefault?: boolean;\n /** User who last updated agents list */\n agentsLastUpdatedByUserName?: string;\n /** Email of user who last updated agents list */\n agentsLastUpdatedByUserEmailPrefix?: string;\n /** When agents list was last updated */\n agentsLastUpdatedTime?: number;\n /** Creation timestamp in epoch millis */\n createdTime?: number;\n /** Last updated timestamp in epoch millis */\n lastUpdatedTime?: number;\n}\n\nexport type ContactServiceQueuesResponse = PaginatedResponse<ContactServiceQueue>;\n\nexport interface ContactServiceQueueSearchParams extends BaseSearchParams {\n desktopProfileFilter?: boolean;\n provisioningView?: boolean;\n singleObjectResponse?: boolean;\n}\n\n/**\n * Response type for buddy agents query operations.\n * Either a success response with list of buddy agents or an error.\n * @public\n * @example\n * function handleBuddyAgents(resp: BuddyAgentsResponse) { ... }\n */\nexport type BuddyAgentsResponse = Agent.BuddyAgentsSuccess | Error;\n\n/**\n * Response type for device type update operations.\n * Either a success response with update confirmation or an error.\n * @public\n * @example\n * function handleUpdateDeviceType(resp: UpdateDeviceTypeResponse) { ... }\n */\nexport type UpdateDeviceTypeResponse = Agent.DeviceTypeUpdateSuccess | Error;\n\n/**\n * Supported transcript control actions for AI Assistant events.\n * @public\n * @example\n * const action: TranscriptAction = 'START';\n * @ignore\n */\nexport type TranscriptAction = 'START' | 'STOP';\n\n/**\n * Parameters used to request AI Assistant real-time assistance.\n * @public\n * @example\n * const params: RealTimeAssistanceParams = {\n * interactionId: 'interaction-123',\n * context: 'Need help with credit card payment due date',\n * };\n */\nexport type RealTimeAssistanceParams = {\n /** Agent identifier */\n agentId: string;\n /** Interaction identifier for which assistance should be generated */\n interactionId: string;\n /** Optional additional context that should refine the assistance */\n context?: string;\n /** Optional language code for assistance (for example, 'en'). Defaults to 'en'. */\n languageCode?: string;\n};\n\n/**\n * Supported user actions on an AI Assistant real-time assistance adaptive card.\n * @public\n */\nexport const RealTimeAssistanceUserActionId = {\n /** User liked the real-time assistance response */\n LIKE: 'likeButton',\n /** User disliked the real-time assistance response */\n DISLIKE: 'dislikeButton',\n /** User copied the real-time assistance response */\n COPY: 'copyButton',\n} as const;\n\n/**\n * Union type of supported real-time assistance user actions.\n * @public\n */\nexport type RealTimeAssistanceUserActionId = Enum<typeof RealTimeAssistanceUserActionId>;\n\n/**\n * Parameters used to send user action feedback for a real-time assistance adaptive card.\n * @public\n * @example\n * const params: RealTimeAssistanceUserActionParams = {\n * agentId: 'agent-123',\n * interactionId: 'interaction-123',\n * adaptiveCardId: 'adaptive-card-123',\n * actionId: RealTimeAssistanceUserActionId.LIKE,\n * };\n */\nexport type RealTimeAssistanceUserActionParams = {\n /** Agent identifier */\n agentId: string;\n /** Interaction identifier associated with the real-time assistance response */\n interactionId: string;\n /** Adaptive card identifier from the real-time assistance payload */\n adaptiveCardId: string;\n /** User action performed on the adaptive card */\n actionId: RealTimeAssistanceUserActionId;\n /** Optional language code. Defaults to 'en'. */\n languageCode?: string;\n};\n\n/**\n * Wellness notification actions delivered by the Contact Center notification service.\n * @public\n */\nexport const WELLNESS_BREAK_NOTIFICATION_ACTIONS = {\n PROVIDE_WELLNESS_BREAK: 'PROVIDE_WELLNESS_BREAK',\n SUGGEST_WELLNESS_BREAK: 'SUGGEST_WELLNESS_BREAK',\n WELLNESS_BREAK_NOT_ALLOWED: 'WELLNESS_BREAK_NOT_ALLOWED',\n} as const;\n\n/** Union of supported wellness notification actions. @public */\nexport type WellnessBreakNotificationAction = Enum<typeof WELLNESS_BREAK_NOTIFICATION_ACTIONS>;\n\n/**\n * Agent actions accepted by the wellness action API.\n * @public\n */\nexport const WELLNESS_BREAK_USER_ACTIONS = {\n REQUESTED: 'REQUESTED',\n ACCEPTED: 'ACCEPTED',\n REJECTED: 'REJECTED',\n NO_RESPONSE: 'NO_RESPONSE',\n} as const;\n\n/** Union of supported wellness action API values. @public */\nexport type WellnessBreakUserAction = Enum<typeof WELLNESS_BREAK_USER_ACTIONS>;\n\n/**\n * Validated, agent-scoped wellness notification emitted by Contact Center.\n * @public\n */\nexport interface WellnessBreakEvent {\n /** Agent identifier */\n agentId: string;\n /** Organization identifier */\n orgId: string;\n /** Session identifier supplied by the notification; it may differ from the consumer's active session */\n agentSessionId: string;\n /** Backend wellness action */\n actionEvent: WellnessBreakNotificationAction;\n /** Optional untrusted plain-text message supplied by the backend */\n actionText?: string;\n /** Optional normalized interaction diagnostic */\n interactionId?: string;\n /** Notification diagnostic only; never an action-request correlation identifier */\n trackingId?: string;\n}\n\n/**\n * Parameters for responding to a backend-provided wellness offer.\n * @public\n */\nexport interface RespondToWellnessBreakParams {\n /** Agent response; REQUESTED is available only through requestWellnessBreak */\n action: Exclude<WellnessBreakUserAction, typeof WELLNESS_BREAK_USER_ACTIONS.REQUESTED>;\n}\n\n/**\n * Supported AI Assistant event categories.\n * @public\n * @example\n * const eventType: AIAssistantEventType = AIAssistantEventType.CUSTOM_EVENT;\n * @ignore\n */\nexport const AIAssistantEventType = {\n /** Custom AI Assistant event */\n CUSTOM_EVENT: 'CUSTOM_EVENT',\n /** CTI-backed AI Assistant event */\n CTI_EVENT: 'CTI_EVENT',\n} as const;\n\n/**\n * Union type of AI Assistant event categories.\n * @public\n * @example\n * function send(type: AIAssistantEventType) { ... }\n * @ignore\n */\nexport type AIAssistantEventType = Enum<typeof AIAssistantEventType>;\n\n/**\n * Supported AI Assistant event names.\n * @public\n * @example\n * const name: AIAssistantEventName = AIAssistantEventName.GET_TRANSCRIPTS;\n * @ignore\n */\nexport const AIAssistantEventName = {\n /** Request transcript streaming for an interaction */\n GET_TRANSCRIPTS: 'GET_TRANSCRIPTS',\n /** Request a suggested response for an interaction */\n GET_SUGGESTIONS: 'GET_SUGGESTIONS',\n /** Add extra context to refine a suggested response */\n ADD_SUGGESTIONS_EXTRA_CONTEXT: 'ADD_SUGGESTIONS_EXTRA_CONTEXT',\n /** Request mid-call summary generation */\n GET_MID_CALL_SUMMARY: 'GET_MID_CALL_SUMMARY',\n /** Request post-call summary generation */\n GET_POST_CALL_SUMMARY: 'GET_POST_CALL_SUMMARY',\n /** Mid-call summary response event */\n MID_CALL_SUMMARY_RESPONSE: 'MID_CALL_SUMMARY_RESPONSE',\n /** Post-call summary response event */\n POST_CALL_SUMMARY_RESPONSE: 'POST_CALL_SUMMARY_RESPONSE',\n /** Suggested digital response event */\n SUGGESTED_RESPONSES_DIGITAL: 'SUGGESTED_RESPONSES_DIGITAL',\n /** User action on a suggested response adaptive card */\n SUGGESTED_RESPONSES_USER_ACTION: 'SUGGESTED_RESPONSES_USER_ACTION',\n /** Agent Wellness Break request/response action */\n WELLNESS_BREAK_ACTION: 'WellnessBreakAction',\n} as const;\n\n/**\n * Union type of AI Assistant event names.\n * @public\n * @example\n * function handle(name: AIAssistantEventName) { ... }\n * @ignore\n */\nexport type AIAssistantEventName = Enum<typeof AIAssistantEventName>;\n\n/**\n * A single transcript message entry returned by AI Assistant APIs.\n * @public\n * @example\n * const message: TranscriptMessage = { role: 'AGENT', content: 'Hello', messageId: '1', publishTimestamp: Date.now() };\n *\n */\nexport type TranscriptMessage = {\n /** Speaker role for this message */\n role: string;\n /** Transcript chunk content */\n content: string;\n /** Unique message identifier */\n messageId: string;\n /** Message publish timestamp (epoch milliseconds) */\n publishTimestamp: number;\n};\n\n/**\n * Response payload for historic transcripts API.\n * @public\n * @example\n * const resp: HistoricTranscriptsResponse = { orgId: 'org', agentId: 'agent', conversationId: null, interactionId: 'int', source: 'AI', data: [] };\n *\n */\nexport type HistoricTranscriptsResponse = {\n /** Organization identifier */\n orgId: string;\n /** Agent identifier */\n agentId: string;\n /** Conversation identifier when available */\n conversationId: string | null;\n /** Interaction identifier */\n interactionId: string;\n /** Data source identifier */\n source: string;\n /** Transcript messages */\n data: TranscriptMessage[];\n};\n"],"mappings":";;;;;;AAiBA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1B;EACAE,GAAG,EAAE,KAAK;EACV;EACAC,IAAI,EAAE,MAAM;EACZ;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,GAAG,EAAE,KAAK;EACV;EACAC,MAAM,EAAE;AACV,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQYC,aAAa,GAAAN,OAAA,CAAAM,aAAA,0BAAbA,aAAa;EACvB;EADUA,aAAa;EAGvB;EAHUA,aAAa;EAKvB;EALUA,aAAa;EAOvB;EAPUA,aAAa;EASvB;EATUA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAazB;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AA6FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,WAAW,GAAAP,OAAA,CAAAO,WAAA,GAAG;EACzB;EACAC,QAAQ,EAAE,UAAU;EACpB;EACAC,SAAS,EAAE,WAAW;EACtB;EACAC,OAAO,EAAE;AACX,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAiBA;AACA;AACA;;AAkBA;AACA;AACA;;AAkCA;AACA;AACA;AACA;;AAmGA;AACA;AACA;AAC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ACAC,qBAAqB,EAAE,uBAAuB;EAC9C;EACAC,yBAAyB,EAAE,2BAA2B;EACtD;EACAC,0BAA0B,EAAE,4BAA4B;EACxD;EACAC,2BAA2B,EAAE,6BAA6B;EAC1D;EACAC,+BAA+B,EAAE,iCAAiC;EAClE;EACAC,qBAAqB,EAAE;AACzB,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["HTTP_METHODS","exports","GET","POST","PATCH","PUT","DELETE","LOGGING_LEVEL","LoginOption","AGENT_DN","EXTENSION","BROWSER","RealTimeAssistanceUserActionId","LIKE","DISLIKE","COPY","WELLNESS_BREAK_NOTIFICATION_ACTIONS","PROVIDE_WELLNESS_BREAK","SUGGEST_WELLNESS_BREAK","WELLNESS_BREAK_NOT_ALLOWED","WELLNESS_BREAK_USER_ACTIONS","REQUESTED","ACCEPTED","REJECTED","NO_RESPONSE","AIAssistantEventType","CUSTOM_EVENT","CTI_EVENT","AIAssistantEventName","GET_TRANSCRIPTS","GET_SUGGESTIONS","ADD_SUGGESTIONS_EXTRA_CONTEXT","GET_MID_CALL_SUMMARY","GET_POST_CALL_SUMMARY","MID_CALL_SUMMARY_RESPONSE","POST_CALL_SUMMARY_RESPONSE","SUGGESTED_RESPONSES_DIGITAL","SUGGESTED_RESPONSES_USER_ACTION","WELLNESS_BREAK_ACTION"],"sources":["types.ts"],"sourcesContent":["import {CallingClientConfig} from '@webex/calling';\nimport {\n SubmitBehavioralEvent,\n SubmitOperationalEvent,\n SubmitBusinessEvent,\n} from '@webex/internal-plugin-metrics/src/metrics.types';\nimport * as Agent from './services/agent/types';\nimport * as Contact from './services/task/types';\nimport {\n AIFeatureFlags,\n Entity,\n Profile,\n CreateUserPreferenceRequest,\n UpdateUserPreferenceRequest,\n} from './services/config/types';\nimport {PaginatedResponse, BaseSearchParams} from './utils/PageCache';\n\n/**\n * Generic type for converting a const enum object into a union type of its values.\n * @template T The enum object type\n * @internal\n * @ignore\n */\ntype Enum<T extends Record<string, unknown>> = T[keyof T];\n\n/**\n * HTTP methods supported by WebexRequest.\n * @enum {string}\n * @public\n * @example\n * const method: HTTP_METHODS = HTTP_METHODS.GET;\n * @ignore\n */\nexport const HTTP_METHODS = {\n /** HTTP GET method for retrieving data */\n GET: 'GET',\n /** HTTP POST method for creating resources */\n POST: 'POST',\n /** HTTP PATCH method for partial updates */\n PATCH: 'PATCH',\n /** HTTP PUT method for complete updates */\n PUT: 'PUT',\n /** HTTP DELETE method for removing resources */\n DELETE: 'DELETE',\n} as const;\n\n/**\n * Union type of HTTP methods.\n * @public\n * @example\n * function makeRequest(method: HTTP_METHODS) { ... }\n * @ignore\n */\nexport type HTTP_METHODS = Enum<typeof HTTP_METHODS>;\n\n/**\n * Payload for making requests to Webex APIs.\n * @public\n * @example\n * const payload: WebexRequestPayload = {\n * service: 'identity',\n * resource: '/users',\n * method: HTTP_METHODS.GET\n * };\n * @ignore\n */\nexport type WebexRequestPayload = {\n /** Service name to target */\n service?: string;\n /** Resource path within the service */\n resource?: string;\n /** HTTP method to use */\n method?: HTTP_METHODS;\n /** Full URI if not using service/resource pattern */\n uri?: string;\n /** Whether to add authorization header */\n addAuthHeader?: boolean;\n /** Custom headers to include in request */\n headers?: {\n [key: string]: string | null;\n };\n /** Request body data */\n body?: object;\n /** Expected response status code */\n statusCode?: number;\n /** Whether to parse response as JSON */\n json?: boolean;\n};\n\n/**\n * Event listener function type.\n * @internal\n * @ignore\n */\ntype Listener = (e: string, data?: unknown) => void;\n\n/**\n * Mercury event handler callback.\n * @internal\n * @ignore\n */\ntype MercuryEventHandler = (data?: unknown) => void;\n\n/**\n * Event listener removal function type.\n * @internal\n * @ignore\n */\ntype ListenerOff = (e: string, handler?: MercuryEventHandler) => void;\n\n/**\n * Service host configuration.\n * @internal\n * @ignore\n */\ntype ServiceHost = {\n /** Host URL/domain for the service */\n host: string;\n /** Time-to-live in seconds */\n ttl: number;\n /** Priority level for load balancing (lower is higher priority) */\n priority: number;\n /** Unique identifier for this host */\n id: string;\n /** Whether this is the home cluster for the user */\n homeCluster?: boolean;\n};\n\n/**\n * Configuration options for the Contact Center Plugin.\n * @interface CCPluginConfig\n * @public\n * @example\n * const config: CCPluginConfig = {\n * allowMultiLogin: true,\n * allowAutomatedRelogin: false,\n * clientType: 'browser',\n * isKeepAliveEnabled: true,\n * force: false,\n * metrics: { clientName: 'myClient', clientType: 'browser' },\n * logging: { enable: true, verboseEvents: false },\n * callingClientConfig: { ... }\n * };\n */\nexport interface CCPluginConfig {\n /** Whether to allow multiple logins from different devices */\n allowMultiLogin: boolean;\n /** Whether to automatically attempt relogin on connection loss */\n allowAutomatedRelogin: boolean;\n /** The type of client making the connection */\n clientType: string;\n /** Whether to enable keep-alive messages */\n isKeepAliveEnabled: boolean;\n /** Whether to force registration */\n force: boolean;\n /** Metrics configuration */\n metrics: {\n /** Name of the client for metrics */\n clientName: string;\n /** Type of client for metrics */\n clientType: string;\n };\n /** Logging configuration */\n logging: {\n /** Whether to enable logging */\n enable: boolean;\n /** Whether to log verbose events */\n verboseEvents: boolean;\n };\n /** Configuration for the calling client */\n callingClientConfig: CallingClientConfig;\n /** Whether to skip Mobius/WebRTC registration for browser login flows */\n disableWebRTCRegistration?: boolean;\n /** Whether wxApp Better Together (telephony REST + usersub) is enabled at init (WXCC-6026) */\n enableWxBetterTogether?: boolean;\n}\n\n/**\n * Logger interface for standardized logging throughout the plugin.\n * @public\n * @example\n * logger.log('This is a log message');\n * logger.error('This is an error message');\n * @ignore\n */\nexport type Logger = {\n /** Log general messages */\n log: (payload: string) => void;\n /** Log error messages */\n error: (payload: string) => void;\n /** Log warning messages */\n warn: (payload: string) => void;\n /** Log informational messages */\n info: (payload: string) => void;\n /** Log detailed trace messages */\n trace: (payload: string) => void;\n /** Log debug messages */\n debug: (payload: string) => void;\n};\n\n/**\n * Contextual information for log entries.\n * @public\n * @ignore\n */\nexport interface LogContext {\n /** Module name where the log originated */\n module?: string;\n /** Method name where the log originated */\n method?: string;\n interactionId?: string;\n trackingId?: string;\n /** Additional structured data to include in logs */\n data?: Record<string, any>;\n /** Error object to include in logs */\n error?: Error | unknown;\n}\n\n/**\n * Available logging severity levels.\n * @enum {string}\n * @public\n * @example\n * const level: LOGGING_LEVEL = LOGGING_LEVEL.error;\n * @ignore\n */\nexport enum LOGGING_LEVEL {\n /** Critical failures that require immediate attention */\n error = 'ERROR',\n /** Important issues that don't prevent the system from working */\n warn = 'WARN',\n /** General informational logs */\n log = 'LOG',\n /** Detailed information about system operation */\n info = 'INFO',\n /** Highly detailed diagnostic information */\n trace = 'TRACE',\n}\n\n/**\n * Metadata for log uploads.\n * @public\n * @example\n * const meta: LogsMetaData = { feedbackId: 'fb123', correlationId: 'corr456' };\n * @ignore\n */\nexport type LogsMetaData = {\n /** Optional feedback ID to associate with logs */\n feedbackId?: string;\n /** Optional correlation ID to track related operations */\n correlationId?: string;\n};\n\n/**\n * Response from uploading logs to the server.\n * @public\n * @example\n * const response: UploadLogsResponse = { trackingid: 'track123', url: 'https://...', userId: 'user1' };\n */\nexport type UploadLogsResponse = {\n /** Tracking ID for the upload request */\n trackingid?: string;\n /** URL where the logs can be accessed */\n url?: string;\n /** ID of the user who uploaded logs */\n userId?: string;\n /** Feedback ID associated with the logs */\n feedbackId?: string;\n /** Correlation ID for tracking related operations */\n correlationId?: string;\n};\n\n/**\n * Internal Webex SDK interfaces needed for plugin integration.\n * @internal\n * @ignore\n */\ninterface IWebexInternal {\n /** Mercury service for real-time messaging */\n mercury: {\n /** Register an event listener */\n on: Listener;\n /** Remove an event listener */\n off: ListenerOff;\n /** Establish a connection to the Mercury service */\n connect: () => Promise<void>;\n /** Disconnect from the Mercury service */\n disconnect: () => Promise<void>;\n /** Whether Mercury is currently connected */\n connected: boolean;\n /** Whether Mercury is in the process of connecting */\n connecting: boolean;\n };\n /** Device information */\n device: {\n /** Current WDM URL */\n url: string;\n /** Current user's ID */\n userId: string;\n /** Current organization ID */\n orgId: string;\n /** Device version */\n version: string;\n /** Calling behavior configuration */\n callingBehavior: string;\n /** Whether the device is registered with WDM */\n registered?: boolean;\n /** Register the device with WDM */\n register?: () => Promise<void>;\n /** Unregister the device from WDM */\n unregister?: () => Promise<void>;\n };\n /** Presence service */\n presence: unknown;\n /** Services discovery and management */\n services: {\n /** Get a service URL by name */\n get: (service: string) => string;\n /** Wait for service catalog to be loaded */\n waitForCatalog: (service: string) => Promise<void>;\n /** Check if current environment is INT (integration) */\n isIntegrationEnvironment: () => boolean;\n /** Host catalog for service discovery */\n _hostCatalog: Record<string, ServiceHost[]>;\n /** Service URLs cache */\n _serviceUrls: {\n /** Mobius calling service */\n mobius: string;\n /** Identity service */\n identity: string;\n /** Janus media server */\n janus: string;\n /** WDM (WebEx Device Management) service */\n wdm: string;\n /** BroadWorks IDP proxy service */\n broadworksIdpProxy: string;\n /** Hydra API service */\n hydra: string;\n /** Mercury API service */\n mercuryApi: string;\n /** UC Management gateway service */\n 'ucmgmt-gateway': string;\n /** Contacts service */\n contactsService: string;\n };\n };\n /** Metrics collection services */\n newMetrics: {\n /** Submit behavioral events (user actions) */\n submitBehavioralEvent: SubmitBehavioralEvent;\n /** Submit operational events (system operations) */\n submitOperationalEvent: SubmitOperationalEvent;\n /** Submit business events (business outcomes) */\n submitBusinessEvent: SubmitBusinessEvent;\n };\n /** Support functionality */\n support: {\n /** Submit logs to server */\n submitLogs: (\n metaData: LogsMetaData,\n logs: string,\n options: {\n /** Whether to submit full logs or just differences */\n type: 'diff' | 'full';\n }\n ) => Promise<UploadLogsResponse>;\n };\n}\n\n/**\n * Interface representing the WebexSDK core functionality.\n * @interface WebexSDK\n * @public\n * @example\n * const sdk: WebexSDK = ...;\n * sdk.request({ service: 'identity', resource: '/users', method: HTTP_METHODS.GET });\n * @ignore\n */\nexport interface WebexSDK {\n /** Version of the WebexSDK */\n version: string;\n /** Whether the SDK can authorize requests */\n canAuthorize: boolean;\n /** Credentials management */\n credentials: {\n /** Get the user token for authentication */\n getUserToken: () => Promise<string>;\n /** Get the organization ID */\n getOrgId: () => string;\n };\n /** Whether the SDK is ready for use */\n ready: boolean;\n /** Make a request to the Webex APIs */\n request: <T>(payload: WebexRequestPayload) => Promise<T>;\n /** Register a one-time event handler */\n once: (event: string, callBack: () => void) => void;\n /** Internal plugins and services */\n internal: IWebexInternal;\n /** Logger instance */\n logger: Logger;\n}\n\n/**\n * An interface for the `ContactCenter` class.\n * The `ContactCenter` package is designed to provide a set of APIs to perform various operations for the Agent flow within Webex Contact Center.\n * @public\n * @example\n * const cc: IContactCenter = ...;\n * cc.register().then(profile => { ... });\n * @ignore\n */\nexport interface IContactCenter {\n /**\n * Initialize the CC SDK by setting up the contact center mercury connection.\n * This establishes WebSocket connectivity for real-time communication.\n *\n * @returns A Promise that resolves to the agent's profile upon successful registration\n * @public\n * @example\n * cc.register().then(profile => { ... });\n */\n register(): Promise<Profile>;\n\n /** Returns the system-managed WellbeingBreak idle code for the registered session. */\n getWellbeingBreakIdleCode(): Promise<Entity>;\n}\n\n/**\n * Generic HTTP response structure.\n * @public\n * @example\n * const response: IHttpResponse = { body: {}, statusCode: 200, method: 'GET', headers: {}, url: '...' };\n * @ignore\n */\nexport interface IHttpResponse {\n /** Response body content */\n body: any;\n /** HTTP status code */\n statusCode: number;\n /** HTTP method used for the request */\n method: string;\n /** Response headers */\n headers: Headers;\n /** Request URL */\n url: string;\n}\n\n/**\n * Supported login options for agent authentication.\n * @public\n * @example\n * const option: LoginOption = LoginOption.AGENT_DN;\n * @ignore\n */\nexport const LoginOption = {\n /** Login using agent's direct number */\n AGENT_DN: 'AGENT_DN',\n /** Login using an extension number */\n EXTENSION: 'EXTENSION',\n /** Login using browser WebRTC capabilities */\n BROWSER: 'BROWSER',\n} as const;\n\n/**\n * Union type of login options.\n * @public\n * @example\n * function login(option: LoginOption) { ... }\n * @ignore\n */\nexport type LoginOption = Enum<typeof LoginOption>;\n\n/**\n * Request payload for subscribing to the contact center websocket.\n * @public\n * @example\n * const req: SubscribeRequest = { force: true, isKeepAliveEnabled: true, clientType: 'browser', allowMultiLogin: false };\n * @ignore\n */\nexport type SubscribeRequest = {\n /** Whether to force connection even if another exists */\n force: boolean;\n /** Whether to send keepalive messages */\n isKeepAliveEnabled: boolean;\n /** Type of client connecting */\n clientType: string;\n /** Whether to allow login from multiple devices */\n allowMultiLogin: boolean;\n};\n\n/**\n * Represents the response from getListOfTeams method.\n * Teams are groups of agents that can be managed together.\n * @public\n * @example\n * const team: Team = { id: 'team1', name: 'Support', desktopLayoutId: 'layout1' };\n * @ignore\n */\nexport type Team = {\n /**\n * Unique identifier of the team.\n */\n id: string;\n\n /**\n * Display name of the team.\n */\n name: string;\n\n /**\n * Associated desktop layout ID for the team.\n * Controls how the agent desktop is displayed for team members.\n */\n desktopLayoutId?: string;\n};\n\n/**\n * Represents the request to perform agent login.\n * @public\n * @example\n * const login: AgentLogin = { dialNumber: '1234', teamId: 'team1', loginOption: LoginOption.AGENT_DN };\n */\nexport type AgentLogin = {\n /**\n * A dialNumber field contains the number to dial such as a route point or extension.\n * Required for AGENT_DN and EXTENSION login options.\n */\n dialNumber?: string;\n\n /**\n * The unique ID representing a team of users.\n * The agent must belong to this team.\n */\n teamId: string;\n\n /**\n * The loginOption field specifies the type of login method.\n * Controls how calls are delivered to the agent.\n */\n loginOption: LoginOption;\n};\n\n/**\n * Represents the request to update agent profile settings.\n * @public\n * @example\n * const update: AgentProfileUpdate = { loginOption: LoginOption.BROWSER, dialNumber: '5678' };\n */\nexport type AgentProfileUpdate = Pick<AgentLogin, 'loginOption' | 'dialNumber' | 'teamId'>;\n\n/**\n * Union type for all possible request body types.\n * @internal\n * @ignore\n */\nexport type RequestBody =\n | SubscribeRequest\n | Agent.Logout\n | Agent.UserStationLogin\n | Agent.StateChange\n | Agent.BuddyAgents\n | Contact.HoldResumePayload\n | Contact.ResumeRecordingPayload\n | Contact.ConsultPayload\n | Contact.ConsultEndAPIPayload // API Payload accepts only QueueId wheres SDK API allows more params\n | Contact.TransferPayLoad\n | Contact.ConsultTransferPayLoad\n | Contact.cancelCtq\n | Contact.WrapupPayLoad\n | Contact.DialerPayload\n | Contact.PreviewContactPayload\n | CreateUserPreferenceRequest\n | UpdateUserPreferenceRequest;\n\n/**\n * Represents the options to fetch buddy agents for the logged in agent.\n * Buddy agents are other agents who can be consulted or transferred to.\n * @public\n * @example\n * const opts: BuddyAgents = { mediaType: 'telephony', state: 'Available' };\n */\nexport type BuddyAgents = {\n /**\n * The media type channel to filter buddy agents. Defaults to telephony when omitted.\n */\n mediaType?: 'telephony' | 'chat' | 'social' | 'email';\n\n /**\n * Optional filter for agent state.\n * If specified, returns only agents in that state.\n * If omitted, returns both available and idle agents.\n */\n state?: 'Available' | 'Idle';\n\n /**\n * Applies the default state policy for the operation. An explicit state takes precedence.\n */\n action?: 'Consult' | 'Transfer';\n};\n\n/**\n * Holds the configuration flags for the Agent.\n * These flags determine the availability of certain features in the Agent UI.\n * @internal\n */\nexport type ConfigFlags = {\n isEndTaskEnabled: boolean;\n isEndConsultEnabled: boolean;\n webRtcEnabled: boolean;\n autoWrapup: boolean;\n aiFeature?: AIFeatureFlags;\n /** Agent-profile policy used to derive task consult/transfer destination controls. */\n consultTransfer?: Contact.ConsultTransferDestinationConfig;\n /**\n * Optional toggle to globally enable/disable recording controls.\n * Falls back to backend hints when omitted.\n */\n isRecordingEnabled?: boolean;\n /** Whether wxApp thick-client answer controls/APIs are enabled (WXCC-6026) */\n enableWxBetterTogether?: boolean;\n /** Read-only observability: live usersub answer-calls-on-wxcc state for wxApp offer diagnostics. */\n getWxAppUsersubPublished?: () => boolean;\n};\n\n/**\n\n * Generic error structure for Contact Center SDK errors.\n * Contains detailed information about the error context.\n * @public\n * @example\n * const err: GenericError = new Error('Failed');\n * err.details = { type: 'ERR', orgId: 'org1', trackingId: 'track1', data: {} };\n * @ignore\n */\nexport interface GenericError extends Error {\n /** Structured details about the error */\n details: {\n /** Error type identifier */\n type: string;\n /** Organization ID where the error occurred */\n orgId: string;\n /** Unique tracking ID for the error */\n trackingId: string;\n /** Additional error context data */\n data: Record<string, any>;\n };\n}\n\n/**\n * Response type for station login operations.\n * Either a success response with agent details or an error.\n * @public\n * @example\n * function handleLogin(resp: StationLoginResponse) { ... }\n */\nexport type StationLoginResponse = Agent.StationLoginSuccessResponse | Error;\n\n/**\n * Response type for station logout operations.\n * Either a success response with logout details or an error.\n * @public\n * @example\n * function handleLogout(resp: StationLogoutResponse) { ... }\n */\nexport type StationLogoutResponse = Agent.LogoutSuccess | Error;\n\n/**\n * Response type for station relogin operations.\n * Either a success response with relogin details or an error.\n * @public\n * @example\n * function handleReLogin(resp: StationReLoginResponse) { ... }\n * @ignore\n */\nexport type StationReLoginResponse = Agent.ReloginSuccess | Error;\n\n/**\n * Response type for agent state change operations.\n * Either a success response with state change details or an error.\n * @public\n * @example\n * function handleStateChange(resp: SetStateResponse) { ... }\n * @ignore\n */\nexport type SetStateResponse = Agent.StateChangeSuccess | Error;\n\n/**\n * AddressBook types\n */\nexport interface AddressBookEntry {\n id: string;\n organizationId?: string;\n version?: number;\n name: string;\n number: string;\n createdTime?: number;\n lastUpdatedTime?: number;\n}\n\nexport type AddressBookEntriesResponse = PaginatedResponse<AddressBookEntry>;\n\nexport interface AddressBookEntrySearchParams extends BaseSearchParams {\n addressBookId?: string;\n}\n\n/**\n * EntryPointRecord types\n */\nexport interface EntryPointRecord {\n id: string;\n name: string;\n /** Dialled number mapped to this entry point when included in the list response. */\n number?: string;\n description?: string;\n type?: string;\n isActive?: boolean;\n orgId?: string;\n createdAt?: string;\n updatedAt?: string;\n settings?: Record<string, any>;\n}\n\nexport type EntryPointListResponse = PaginatedResponse<EntryPointRecord>;\nexport type EntryPointSearchParams = BaseSearchParams;\n\n/**\n * Queue types\n */\nexport interface QueueSkillRequirement {\n organizationId?: string;\n id?: string;\n version?: number;\n skillId: string;\n skillName?: string;\n skillType?: string;\n condition: string;\n skillValue: string;\n createdTime?: number;\n lastUpdatedTime?: number;\n}\n\nexport interface QueueAgent {\n id: string;\n ciUserId?: string;\n}\n\nexport interface AgentGroup {\n teamId: string;\n}\n\nexport interface CallDistributionGroup {\n agentGroups: AgentGroup[];\n order: number;\n duration?: number;\n}\n\nexport interface AssistantSkillMapping {\n assistantSkillId?: string;\n assistantSkillUpdatedTime?: number;\n}\n\n/**\n * Configuration for a contact service queue\n * @public\n */\nexport interface ContactServiceQueue {\n /** Organization ID */\n organizationId?: string;\n /** Unique identifier for the queue */\n id?: string;\n /** Version of the queue */\n version?: number;\n /** Name of the Contact Service Queue */\n name: string;\n /** Description of the queue */\n description?: string;\n /** Queue type (INBOUND, OUTBOUND) */\n queueType: 'INBOUND' | 'OUTBOUND';\n /** Whether to check agent availability */\n checkAgentAvailability: boolean;\n /** Channel type (TELEPHONY, EMAIL, SOCIAL_CHANNEL, CHAT, etc.) */\n channelType: 'TELEPHONY' | 'EMAIL' | 'FAX' | 'CHAT' | 'VIDEO' | 'OTHERS' | 'SOCIAL_CHANNEL';\n /** Social channel type for SOCIAL_CHANNEL channelType */\n socialChannelType?:\n | 'MESSAGEBIRD'\n | 'MESSENGER'\n | 'WHATSAPP'\n | 'APPLE_BUSINESS_CHAT'\n | 'GOOGLE_BUSINESS_MESSAGES';\n /** Service level threshold in seconds */\n serviceLevelThreshold: number;\n /** Maximum number of simultaneous contacts */\n maxActiveContacts: number;\n /** Maximum time in queue in seconds */\n maxTimeInQueue: number;\n /** Default music in queue media file ID */\n defaultMusicInQueueMediaFileId: string;\n /** Timezone for routing strategies */\n timezone?: string;\n /** Whether the queue is active */\n active: boolean;\n /** Whether outdial campaign is enabled */\n outdialCampaignEnabled?: boolean;\n /** Whether monitoring is permitted */\n monitoringPermitted: boolean;\n /** Whether parking is permitted */\n parkingPermitted: boolean;\n /** Whether recording is permitted */\n recordingPermitted: boolean;\n /** Whether recording all calls is permitted */\n recordingAllCallsPermitted: boolean;\n /** Whether pausing recording is permitted */\n pauseRecordingPermitted: boolean;\n /** Recording pause duration in seconds */\n recordingPauseDuration?: number;\n /** Control flow script URL */\n controlFlowScriptUrl: string;\n /** IVR requeue URL */\n ivrRequeueUrl: string;\n /** Overflow number for telephony */\n overflowNumber?: string;\n /** Vendor ID */\n vendorId?: string;\n /** Routing type */\n routingType: 'LONGEST_AVAILABLE_AGENT' | 'SKILLS_BASED' | 'CIRCULAR' | 'LINEAR';\n /** Skills-based routing type */\n skillBasedRoutingType?: 'LONGEST_AVAILABLE_AGENT' | 'BEST_AVAILABLE_AGENT';\n /** Queue routing type */\n queueRoutingType: 'TEAM_BASED' | 'SKILL_BASED' | 'AGENT_BASED';\n /** Queue skill requirements */\n queueSkillRequirements?: QueueSkillRequirement[];\n /** List of agents for agent-based queue */\n agents?: QueueAgent[];\n /** Call distribution groups */\n callDistributionGroups: CallDistributionGroup[];\n /** XSP version */\n xspVersion?: string;\n /** Subscription ID */\n subscriptionId?: string;\n /** Assistant skill mapping */\n assistantSkill?: AssistantSkillMapping;\n /** Whether this is a system default queue */\n systemDefault?: boolean;\n /** User who last updated agents list */\n agentsLastUpdatedByUserName?: string;\n /** Email of user who last updated agents list */\n agentsLastUpdatedByUserEmailPrefix?: string;\n /** When agents list was last updated */\n agentsLastUpdatedTime?: number;\n /** Creation timestamp in epoch millis */\n createdTime?: number;\n /** Last updated timestamp in epoch millis */\n lastUpdatedTime?: number;\n}\n\nexport type ContactServiceQueuesResponse = PaginatedResponse<ContactServiceQueue>;\n\nexport interface ContactServiceQueueSearchParams extends BaseSearchParams {\n desktopProfileFilter?: boolean;\n provisioningView?: boolean;\n singleObjectResponse?: boolean;\n}\n\n/**\n * Response type for buddy agents query operations.\n * Either a success response with list of buddy agents or an error.\n * @public\n * @example\n * function handleBuddyAgents(resp: BuddyAgentsResponse) { ... }\n */\nexport type BuddyAgentsResponse = Agent.BuddyAgentsSuccess | Error;\n\n/**\n * Response type for device type update operations.\n * Either a success response with update confirmation or an error.\n * @public\n * @example\n * function handleUpdateDeviceType(resp: UpdateDeviceTypeResponse) { ... }\n */\nexport type UpdateDeviceTypeResponse = Agent.DeviceTypeUpdateSuccess | Error;\n\n/**\n * Supported transcript control actions for AI Assistant events.\n * @public\n * @example\n * const action: TranscriptAction = 'START';\n * @ignore\n */\nexport type TranscriptAction = 'START' | 'STOP';\n\n/**\n * Parameters used to request AI Assistant real-time assistance.\n * @public\n * @example\n * const params: RealTimeAssistanceParams = {\n * interactionId: 'interaction-123',\n * context: 'Need help with credit card payment due date',\n * };\n */\nexport type RealTimeAssistanceParams = {\n /** Agent identifier */\n agentId: string;\n /** Interaction identifier for which assistance should be generated */\n interactionId: string;\n /** Optional additional context that should refine the assistance */\n context?: string;\n /** Optional language code for assistance (for example, 'en'). Defaults to 'en'. */\n languageCode?: string;\n};\n\n/**\n * Supported user actions on an AI Assistant real-time assistance adaptive card.\n * @public\n */\nexport const RealTimeAssistanceUserActionId = {\n /** User liked the real-time assistance response */\n LIKE: 'likeButton',\n /** User disliked the real-time assistance response */\n DISLIKE: 'dislikeButton',\n /** User copied the real-time assistance response */\n COPY: 'copyButton',\n} as const;\n\n/**\n * Union type of supported real-time assistance user actions.\n * @public\n */\nexport type RealTimeAssistanceUserActionId = Enum<typeof RealTimeAssistanceUserActionId>;\n\n/**\n * Parameters used to send user action feedback for a real-time assistance adaptive card.\n * @public\n * @example\n * const params: RealTimeAssistanceUserActionParams = {\n * agentId: 'agent-123',\n * interactionId: 'interaction-123',\n * adaptiveCardId: 'adaptive-card-123',\n * actionId: RealTimeAssistanceUserActionId.LIKE,\n * };\n */\nexport type RealTimeAssistanceUserActionParams = {\n /** Agent identifier */\n agentId: string;\n /** Interaction identifier associated with the real-time assistance response */\n interactionId: string;\n /** Adaptive card identifier from the real-time assistance payload */\n adaptiveCardId: string;\n /** User action performed on the adaptive card */\n actionId: RealTimeAssistanceUserActionId;\n /** Optional language code. Defaults to 'en'. */\n languageCode?: string;\n};\n\n/**\n * Wellness notification actions delivered by the Contact Center notification service.\n * @public\n */\nexport const WELLNESS_BREAK_NOTIFICATION_ACTIONS = {\n PROVIDE_WELLNESS_BREAK: 'PROVIDE_WELLNESS_BREAK',\n SUGGEST_WELLNESS_BREAK: 'SUGGEST_WELLNESS_BREAK',\n WELLNESS_BREAK_NOT_ALLOWED: 'WELLNESS_BREAK_NOT_ALLOWED',\n} as const;\n\n/** Union of supported wellness notification actions. @public */\nexport type WellnessBreakNotificationAction = Enum<typeof WELLNESS_BREAK_NOTIFICATION_ACTIONS>;\n\n/**\n * Agent actions accepted by the wellness action API.\n * @public\n */\nexport const WELLNESS_BREAK_USER_ACTIONS = {\n REQUESTED: 'REQUESTED',\n ACCEPTED: 'ACCEPTED',\n REJECTED: 'REJECTED',\n NO_RESPONSE: 'NO_RESPONSE',\n} as const;\n\n/** Union of supported wellness action API values. @public */\nexport type WellnessBreakUserAction = Enum<typeof WELLNESS_BREAK_USER_ACTIONS>;\n\n/**\n * Validated, agent-scoped wellness notification emitted by Contact Center.\n * @public\n */\nexport interface WellnessBreakEvent {\n /** Agent identifier */\n agentId: string;\n /** Organization identifier */\n orgId: string;\n /** Session identifier supplied by the notification; it may differ from the consumer's active session */\n agentSessionId: string;\n /** Backend wellness action */\n actionEvent: WellnessBreakNotificationAction;\n /** Optional untrusted plain-text message supplied by the backend */\n actionText?: string;\n /** Optional normalized interaction diagnostic */\n interactionId?: string;\n /** Notification diagnostic only; never an action-request correlation identifier */\n trackingId?: string;\n}\n\n/**\n * Parameters for responding to a backend-provided wellness offer.\n * @public\n */\nexport interface RespondToWellnessBreakParams {\n /** Agent response; REQUESTED is available only through requestWellnessBreak */\n action: Exclude<WellnessBreakUserAction, typeof WELLNESS_BREAK_USER_ACTIONS.REQUESTED>;\n}\n\n/**\n * Supported AI Assistant event categories.\n * @public\n * @example\n * const eventType: AIAssistantEventType = AIAssistantEventType.CUSTOM_EVENT;\n * @ignore\n */\nexport const AIAssistantEventType = {\n /** Custom AI Assistant event */\n CUSTOM_EVENT: 'CUSTOM_EVENT',\n /** CTI-backed AI Assistant event */\n CTI_EVENT: 'CTI_EVENT',\n} as const;\n\n/**\n * Union type of AI Assistant event categories.\n * @public\n * @example\n * function send(type: AIAssistantEventType) { ... }\n * @ignore\n */\nexport type AIAssistantEventType = Enum<typeof AIAssistantEventType>;\n\n/**\n * Supported AI Assistant event names.\n * @public\n * @example\n * const name: AIAssistantEventName = AIAssistantEventName.GET_TRANSCRIPTS;\n * @ignore\n */\nexport const AIAssistantEventName = {\n /** Request transcript streaming for an interaction */\n GET_TRANSCRIPTS: 'GET_TRANSCRIPTS',\n /** Request a suggested response for an interaction */\n GET_SUGGESTIONS: 'GET_SUGGESTIONS',\n /** Add extra context to refine a suggested response */\n ADD_SUGGESTIONS_EXTRA_CONTEXT: 'ADD_SUGGESTIONS_EXTRA_CONTEXT',\n /** Request mid-call summary generation */\n GET_MID_CALL_SUMMARY: 'GET_MID_CALL_SUMMARY',\n /** Request post-call summary generation */\n GET_POST_CALL_SUMMARY: 'GET_POST_CALL_SUMMARY',\n /** Mid-call summary response event */\n MID_CALL_SUMMARY_RESPONSE: 'MID_CALL_SUMMARY_RESPONSE',\n /** Post-call summary response event */\n POST_CALL_SUMMARY_RESPONSE: 'POST_CALL_SUMMARY_RESPONSE',\n /** Suggested digital response event */\n SUGGESTED_RESPONSES_DIGITAL: 'SUGGESTED_RESPONSES_DIGITAL',\n /** User action on a suggested response adaptive card */\n SUGGESTED_RESPONSES_USER_ACTION: 'SUGGESTED_RESPONSES_USER_ACTION',\n /** Agent Wellness Break request/response action */\n WELLNESS_BREAK_ACTION: 'WellnessBreakAction',\n} as const;\n\n/**\n * Union type of AI Assistant event names.\n * @public\n * @example\n * function handle(name: AIAssistantEventName) { ... }\n * @ignore\n */\nexport type AIAssistantEventName = Enum<typeof AIAssistantEventName>;\n\n/**\n * A single transcript message entry returned by AI Assistant APIs.\n * @public\n * @example\n * const message: TranscriptMessage = { role: 'AGENT', content: 'Hello', messageId: '1', publishTimestamp: Date.now() };\n *\n */\nexport type TranscriptMessage = {\n /** Speaker role for this message */\n role: string;\n /** Transcript chunk content */\n content: string;\n /** Unique message identifier */\n messageId: string;\n /** Message publish timestamp (epoch milliseconds) */\n publishTimestamp: number;\n};\n\n/**\n * Response payload for historic transcripts API.\n * @public\n * @example\n * const resp: HistoricTranscriptsResponse = { orgId: 'org', agentId: 'agent', conversationId: null, interactionId: 'int', source: 'AI', data: [] };\n *\n */\nexport type HistoricTranscriptsResponse = {\n /** Organization identifier */\n orgId: string;\n /** Agent identifier */\n agentId: string;\n /** Conversation identifier when available */\n conversationId: string | null;\n /** Interaction identifier */\n interactionId: string;\n /** Data source identifier */\n source: string;\n /** Transcript messages */\n data: TranscriptMessage[];\n};\n"],"mappings":";;;;;;AAiBA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1B;EACAE,GAAG,EAAE,KAAK;EACV;EACAC,IAAI,EAAE,MAAM;EACZ;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,GAAG,EAAE,KAAK;EACV;EACAC,MAAM,EAAE;AACV,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQYC,aAAa,GAAAN,OAAA,CAAAM,aAAA,0BAAbA,aAAa;EACvB;EADUA,aAAa;EAGvB;EAHUA,aAAa;EAKvB;EALUA,aAAa;EAOvB;EAPUA,aAAa;EASvB;EATUA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAazB;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AA6FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,WAAW,GAAAP,OAAA,CAAAO,WAAA,GAAG;EACzB;EACAC,QAAQ,EAAE,UAAU;EACpB;EACAC,SAAS,EAAE,WAAW;EACtB;EACAC,OAAO,EAAE;AACX,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAiBA;AACA;AACA;;AAkBA;AACA;AACA;;AAkCA;AACA;AACA;AACA;;AAmGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACO,MAAMC,8BAA8B,GAAAX,OA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qB,EAAE;AACzB,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
package/dist/webex.js
CHANGED
|
@@ -43,7 +43,7 @@ if (!global.Buffer) {
|
|
|
43
43
|
*/
|
|
44
44
|
const Webex = _webexCore.default.extend({
|
|
45
45
|
webex: true,
|
|
46
|
-
version: `3.12.0-llmrefactor.
|
|
46
|
+
version: `3.12.0-llmrefactor.15`
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
// The standalone UMD bundle exports the Webex constructor as its default value. Attach the
|
package/package.json
CHANGED
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@types/platform": "1.3.4",
|
|
49
|
-
"@webex/calling": "3.12.0-llmrefactor.
|
|
50
|
-
"@webex/internal-plugin-mercury": "3.12.0-llmrefactor.
|
|
51
|
-
"@webex/internal-plugin-metrics": "3.12.0-llmrefactor.
|
|
52
|
-
"@webex/internal-plugin-support": "3.12.0-llmrefactor.
|
|
53
|
-
"@webex/plugin-authorization": "3.12.0-llmrefactor.
|
|
54
|
-
"@webex/plugin-logger": "3.12.0-llmrefactor.
|
|
55
|
-
"@webex/webex-core": "3.12.0-llmrefactor.
|
|
49
|
+
"@webex/calling": "3.12.0-llmrefactor.11",
|
|
50
|
+
"@webex/internal-plugin-mercury": "3.12.0-llmrefactor.12",
|
|
51
|
+
"@webex/internal-plugin-metrics": "3.12.0-llmrefactor.10",
|
|
52
|
+
"@webex/internal-plugin-support": "3.12.0-llmrefactor.13",
|
|
53
|
+
"@webex/plugin-authorization": "3.12.0-llmrefactor.10",
|
|
54
|
+
"@webex/plugin-logger": "3.12.0-llmrefactor.10",
|
|
55
|
+
"@webex/webex-core": "3.12.0-llmrefactor.10",
|
|
56
56
|
"jest-html-reporters": "3.0.11",
|
|
57
57
|
"lodash": "^4.17.21",
|
|
58
58
|
"uuid": "^3.3.2",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@webex/eslint-config-legacy": "0.0.0",
|
|
69
69
|
"@webex/jest-config-legacy": "0.0.0",
|
|
70
70
|
"@webex/legacy-tools": "0.0.0",
|
|
71
|
-
"@webex/test-helper-mock-webex": "3.12.0-llmrefactor.
|
|
71
|
+
"@webex/test-helper-mock-webex": "3.12.0-llmrefactor.3",
|
|
72
72
|
"@xstate/inspect": "^0.8.0",
|
|
73
73
|
"eslint": "^8.24.0",
|
|
74
74
|
"eslint-config-airbnb-base": "15.0.0",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"typedoc": "^0.25.0",
|
|
85
85
|
"typescript": "5.4.5"
|
|
86
86
|
},
|
|
87
|
-
"version": "3.12.0-llmrefactor.
|
|
87
|
+
"version": "3.12.0-llmrefactor.15"
|
|
88
88
|
}
|
package/src/cc.ts
CHANGED
|
@@ -643,6 +643,17 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
643
643
|
}
|
|
644
644
|
|
|
645
645
|
private handleRTDWebsocketMessage = (event: string) => {
|
|
646
|
+
let payload: unknown;
|
|
647
|
+
try {
|
|
648
|
+
payload = JSON.parse(event);
|
|
649
|
+
} catch {
|
|
650
|
+
// TaskManager retains its existing malformed RTD message handling.
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
if (isRecord(payload) && this.handleWellnessBreakWebsocketPayload(payload)) {
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
|
|
646
657
|
this.taskManager.handleRealtimeWebsocketEvent(event);
|
|
647
658
|
};
|
|
648
659
|
|
|
@@ -730,7 +741,12 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
730
741
|
method: METHODS.REGISTER,
|
|
731
742
|
});
|
|
732
743
|
|
|
733
|
-
|
|
744
|
+
// Registration can silently restore a station session without emitting a
|
|
745
|
+
// relogin event. Project the active session for consumers that must
|
|
746
|
+
// recover session-scoped state after a page refresh.
|
|
747
|
+
return resp.isAgentLoggedIn && this.currentAgentSessionId
|
|
748
|
+
? {...resp, agentSessionId: this.currentAgentSessionId}
|
|
749
|
+
: resp;
|
|
734
750
|
} catch (error) {
|
|
735
751
|
this.metricsManager.trackEvent(
|
|
736
752
|
METRIC_EVENT_NAMES.WEBSOCKET_REGISTER_FAILED,
|
|
@@ -1003,6 +1019,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
1003
1019
|
accessBuddyTeam: this.agentConfig.accessBuddyTeam,
|
|
1004
1020
|
},
|
|
1005
1021
|
enableWxBetterTogether: this.isWxBetterTogetherEnabled(),
|
|
1022
|
+
getWxAppUsersubPublished: () => this.webexCrossClientService.isAnswerCallsStateActive(),
|
|
1006
1023
|
};
|
|
1007
1024
|
this.taskManager.setConfigFlags(configFlags);
|
|
1008
1025
|
// TODO: Make profile a singleton to make it available throughout app/sdk so we dont need to inject info everywhere
|
|
@@ -1016,10 +1033,12 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
1016
1033
|
/**
|
|
1017
1034
|
* RTD websocket currently supports realtime transcripts and suggested responses.
|
|
1018
1035
|
* Extend this condition when additional AI RTD features are introduced.
|
|
1036
|
+
* Wellness break notifications also arrive on this websocket.
|
|
1019
1037
|
*/
|
|
1020
1038
|
if (
|
|
1021
1039
|
this.agentConfig.aiFeature?.realtimeTranscripts?.enable ||
|
|
1022
|
-
this.agentConfig.aiFeature?.suggestedResponses?.enable
|
|
1040
|
+
this.agentConfig.aiFeature?.suggestedResponses?.enable ||
|
|
1041
|
+
this.agentConfig.isWellnessBreakEnabled
|
|
1023
1042
|
) {
|
|
1024
1043
|
LoggerProxy.info('Connecting to RTD websocket', {
|
|
1025
1044
|
module: CC_FILE,
|
|
@@ -1774,6 +1793,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
1774
1793
|
await this.publishAnswerOnWebexCrossClientState(true);
|
|
1775
1794
|
publishedEnable = true;
|
|
1776
1795
|
this.taskManager.syncWxAppMuteFromCallDetailsForAllTasks();
|
|
1796
|
+
this.taskManager.refreshWxAppOfferObservabilityForAllTasks();
|
|
1777
1797
|
} else {
|
|
1778
1798
|
await this.publishAnswerOnWebexCrossClientState(false);
|
|
1779
1799
|
this.wxAppTelephonyMercurySync.unsubscribe();
|
|
@@ -1855,6 +1875,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
1855
1875
|
await this.publishAnswerOnWebexCrossClientState(true);
|
|
1856
1876
|
publishedEnable = true;
|
|
1857
1877
|
this.taskManager.syncWxAppMuteFromCallDetailsForAllTasks();
|
|
1878
|
+
this.taskManager.refreshWxAppOfferObservabilityForAllTasks();
|
|
1858
1879
|
|
|
1859
1880
|
const mercurySubscribed = this.wxAppTelephonyMercurySync.isSubscribed();
|
|
1860
1881
|
const usersubPublished = this.webexCrossClientService.isAnswerCallsStateActive();
|
|
@@ -1873,7 +1894,13 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
1873
1894
|
if (sessionInitReady) {
|
|
1874
1895
|
this.metricsManager.trackEvent(
|
|
1875
1896
|
METRIC_EVENT_NAMES.WXAPP_SESSION_INIT_SUCCESS,
|
|
1876
|
-
{
|
|
1897
|
+
{
|
|
1898
|
+
loginOption,
|
|
1899
|
+
enableWxBetterTogether: true,
|
|
1900
|
+
usersubPublished,
|
|
1901
|
+
mercurySubscribed,
|
|
1902
|
+
telephonyTaskType,
|
|
1903
|
+
},
|
|
1877
1904
|
['operational', 'behavioral']
|
|
1878
1905
|
);
|
|
1879
1906
|
} else {
|
|
@@ -1882,6 +1909,9 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
1882
1909
|
{
|
|
1883
1910
|
loginOption,
|
|
1884
1911
|
enableWxBetterTogether: true,
|
|
1912
|
+
usersubPublished,
|
|
1913
|
+
mercurySubscribed,
|
|
1914
|
+
telephonyTaskType,
|
|
1885
1915
|
skipReason: !usersubPublished ? 'usersub_not_published' : 'mercury_not_subscribed',
|
|
1886
1916
|
},
|
|
1887
1917
|
['operational', 'behavioral']
|
|
@@ -1925,6 +1955,9 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
1925
1955
|
{
|
|
1926
1956
|
loginOption,
|
|
1927
1957
|
enableWxBetterTogether: true,
|
|
1958
|
+
usersubPublished: this.webexCrossClientService.isAnswerCallsStateActive(),
|
|
1959
|
+
mercurySubscribed: this.wxAppTelephonyMercurySync.isSubscribed(),
|
|
1960
|
+
telephonyTaskType,
|
|
1928
1961
|
skipReason: sessionInitFailureReason,
|
|
1929
1962
|
error: error instanceof Error ? error.toString() : String(error),
|
|
1930
1963
|
},
|
|
@@ -1935,8 +1968,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
1935
1968
|
enableWxBetterTogether: true,
|
|
1936
1969
|
loginOption,
|
|
1937
1970
|
wxAppHooksApplied: false,
|
|
1938
|
-
usersubPublished:
|
|
1939
|
-
publishedEnable && this.webexCrossClientService.isAnswerCallsStateActive(),
|
|
1971
|
+
usersubPublished: this.webexCrossClientService.isAnswerCallsStateActive(),
|
|
1940
1972
|
mercurySubscribed: this.wxAppTelephonyMercurySync.isSubscribed(),
|
|
1941
1973
|
telephonyTaskType,
|
|
1942
1974
|
skipReason: sessionInitFailureReason,
|
|
@@ -2184,7 +2216,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
2184
2216
|
|
|
2185
2217
|
this.metricsManager.trackEvent(
|
|
2186
2218
|
METRIC_EVENT_NAMES.WXAPP_MERCURY_SUBSCRIBE_FAILED,
|
|
2187
|
-
{error: 'agentId unavailable'},
|
|
2219
|
+
{error: 'agentId unavailable', mercurySubscribed: false},
|
|
2188
2220
|
['operational', 'behavioral']
|
|
2189
2221
|
);
|
|
2190
2222
|
|
|
@@ -2203,7 +2235,10 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
2203
2235
|
});
|
|
2204
2236
|
this.metricsManager.trackEvent(
|
|
2205
2237
|
METRIC_EVENT_NAMES.WXAPP_MERCURY_SUBSCRIBE_FAILED,
|
|
2206
|
-
{
|
|
2238
|
+
{
|
|
2239
|
+
error: error instanceof Error ? error.toString() : String(error),
|
|
2240
|
+
mercurySubscribed: false,
|
|
2241
|
+
},
|
|
2207
2242
|
['operational', 'behavioral']
|
|
2208
2243
|
);
|
|
2209
2244
|
this.wxAppTelephonyMercurySync.unsubscribe();
|
|
@@ -2231,6 +2266,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
2231
2266
|
METRIC_EVENT_NAMES.WXAPP_USERSUB_PUBLISH_FAILED,
|
|
2232
2267
|
{
|
|
2233
2268
|
enableWxBetterTogether: true,
|
|
2269
|
+
usersubPublished: this.webexCrossClientService.isAnswerCallsStateActive(),
|
|
2234
2270
|
skipReason: 'user_id_unavailable',
|
|
2235
2271
|
error: 'User ID is unavailable for cross-client publish',
|
|
2236
2272
|
},
|