@webex/contact-center 0.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -0
- package/__mocks__/workerMock.js +15 -0
- package/babel.config.js +15 -0
- package/dist/cc.js +1416 -0
- package/dist/cc.js.map +1 -0
- package/dist/config.js +72 -0
- package/dist/config.js.map +1 -0
- package/dist/constants.js +58 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.js +142 -0
- package/dist/index.js.map +1 -0
- package/dist/logger-proxy.js +115 -0
- package/dist/logger-proxy.js.map +1 -0
- package/dist/metrics/MetricsManager.js +474 -0
- package/dist/metrics/MetricsManager.js.map +1 -0
- package/dist/metrics/behavioral-events.js +322 -0
- package/dist/metrics/behavioral-events.js.map +1 -0
- package/dist/metrics/constants.js +134 -0
- package/dist/metrics/constants.js.map +1 -0
- package/dist/services/WebCallingService.js +323 -0
- package/dist/services/WebCallingService.js.map +1 -0
- package/dist/services/agent/index.js +177 -0
- package/dist/services/agent/index.js.map +1 -0
- package/dist/services/agent/types.js +137 -0
- package/dist/services/agent/types.js.map +1 -0
- package/dist/services/config/Util.js +203 -0
- package/dist/services/config/Util.js.map +1 -0
- package/dist/services/config/constants.js +221 -0
- package/dist/services/config/constants.js.map +1 -0
- package/dist/services/config/index.js +607 -0
- package/dist/services/config/index.js.map +1 -0
- package/dist/services/config/types.js +334 -0
- package/dist/services/config/types.js.map +1 -0
- package/dist/services/constants.js +117 -0
- package/dist/services/constants.js.map +1 -0
- package/dist/services/core/Err.js +43 -0
- package/dist/services/core/Err.js.map +1 -0
- package/dist/services/core/GlobalTypes.js +6 -0
- package/dist/services/core/GlobalTypes.js.map +1 -0
- package/dist/services/core/Utils.js +126 -0
- package/dist/services/core/Utils.js.map +1 -0
- package/dist/services/core/WebexRequest.js +96 -0
- package/dist/services/core/WebexRequest.js.map +1 -0
- package/dist/services/core/aqm-reqs.js +246 -0
- package/dist/services/core/aqm-reqs.js.map +1 -0
- package/dist/services/core/constants.js +109 -0
- package/dist/services/core/constants.js.map +1 -0
- package/dist/services/core/types.js +6 -0
- package/dist/services/core/types.js.map +1 -0
- package/dist/services/core/websocket/WebSocketManager.js +187 -0
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -0
- package/dist/services/core/websocket/connection-service.js +111 -0
- package/dist/services/core/websocket/connection-service.js.map +1 -0
- package/dist/services/core/websocket/keepalive.worker.js +94 -0
- package/dist/services/core/websocket/keepalive.worker.js.map +1 -0
- package/dist/services/core/websocket/types.js +6 -0
- package/dist/services/core/websocket/types.js.map +1 -0
- package/dist/services/index.js +78 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/task/AutoWrapup.js +88 -0
- package/dist/services/task/AutoWrapup.js.map +1 -0
- package/dist/services/task/TaskManager.js +369 -0
- package/dist/services/task/TaskManager.js.map +1 -0
- package/dist/services/task/constants.js +58 -0
- package/dist/services/task/constants.js.map +1 -0
- package/dist/services/task/contact.js +464 -0
- package/dist/services/task/contact.js.map +1 -0
- package/dist/services/task/dialer.js +60 -0
- package/dist/services/task/dialer.js.map +1 -0
- package/dist/services/task/index.js +1188 -0
- package/dist/services/task/index.js.map +1 -0
- package/dist/services/task/types.js +214 -0
- package/dist/services/task/types.js.map +1 -0
- package/dist/types/cc.d.ts +676 -0
- package/dist/types/config.d.ts +66 -0
- package/dist/types/constants.d.ts +45 -0
- package/dist/types/index.d.ts +178 -0
- package/dist/types/logger-proxy.d.ts +71 -0
- package/dist/types/metrics/MetricsManager.d.ts +223 -0
- package/dist/types/metrics/behavioral-events.d.ts +29 -0
- package/dist/types/metrics/constants.d.ts +127 -0
- package/dist/types/services/WebCallingService.d.ts +1 -0
- package/dist/types/services/agent/index.d.ts +46 -0
- package/dist/types/services/agent/types.d.ts +413 -0
- package/dist/types/services/config/Util.d.ts +19 -0
- package/dist/types/services/config/constants.d.ts +203 -0
- package/dist/types/services/config/index.d.ts +171 -0
- package/dist/types/services/config/types.d.ts +1113 -0
- package/dist/types/services/constants.d.ts +97 -0
- package/dist/types/services/core/Err.d.ts +119 -0
- package/dist/types/services/core/GlobalTypes.d.ts +33 -0
- package/dist/types/services/core/Utils.d.ts +36 -0
- package/dist/types/services/core/WebexRequest.d.ts +22 -0
- package/dist/types/services/core/aqm-reqs.d.ts +16 -0
- package/dist/types/services/core/constants.d.ts +85 -0
- package/dist/types/services/core/types.d.ts +47 -0
- package/dist/types/services/core/websocket/WebSocketManager.d.ts +34 -0
- package/dist/types/services/core/websocket/connection-service.d.ts +27 -0
- package/dist/types/services/core/websocket/keepalive.worker.d.ts +2 -0
- package/dist/types/services/core/websocket/types.d.ts +37 -0
- package/dist/types/services/index.d.ts +52 -0
- package/dist/types/services/task/AutoWrapup.d.ts +40 -0
- package/dist/types/services/task/TaskManager.d.ts +1 -0
- package/dist/types/services/task/constants.d.ts +46 -0
- package/dist/types/services/task/contact.d.ts +59 -0
- package/dist/types/services/task/dialer.d.ts +28 -0
- package/dist/types/services/task/index.d.ts +569 -0
- package/dist/types/services/task/types.d.ts +1041 -0
- package/dist/types/types.d.ts +452 -0
- package/dist/types/webex-config.d.ts +53 -0
- package/dist/types/webex.d.ts +7 -0
- package/dist/types.js +292 -0
- package/dist/types.js.map +1 -0
- package/dist/webex-config.js +60 -0
- package/dist/webex-config.js.map +1 -0
- package/dist/webex.js +99 -0
- package/dist/webex.js.map +1 -0
- package/jest.config.js +45 -0
- package/package.json +83 -0
- package/src/cc.ts +1618 -0
- package/src/config.ts +65 -0
- package/src/constants.ts +51 -0
- package/src/index.ts +220 -0
- package/src/logger-proxy.ts +110 -0
- package/src/metrics/MetricsManager.ts +512 -0
- package/src/metrics/behavioral-events.ts +332 -0
- package/src/metrics/constants.ts +135 -0
- package/src/services/WebCallingService.ts +351 -0
- package/src/services/agent/index.ts +149 -0
- package/src/services/agent/types.ts +440 -0
- package/src/services/config/Util.ts +261 -0
- package/src/services/config/constants.ts +249 -0
- package/src/services/config/index.ts +743 -0
- package/src/services/config/types.ts +1117 -0
- package/src/services/constants.ts +111 -0
- package/src/services/core/Err.ts +126 -0
- package/src/services/core/GlobalTypes.ts +34 -0
- package/src/services/core/Utils.ts +132 -0
- package/src/services/core/WebexRequest.ts +103 -0
- package/src/services/core/aqm-reqs.ts +272 -0
- package/src/services/core/constants.ts +106 -0
- package/src/services/core/types.ts +48 -0
- package/src/services/core/websocket/WebSocketManager.ts +196 -0
- package/src/services/core/websocket/connection-service.ts +142 -0
- package/src/services/core/websocket/keepalive.worker.js +88 -0
- package/src/services/core/websocket/types.ts +40 -0
- package/src/services/index.ts +71 -0
- package/src/services/task/AutoWrapup.ts +86 -0
- package/src/services/task/TaskManager.ts +420 -0
- package/src/services/task/constants.ts +52 -0
- package/src/services/task/contact.ts +429 -0
- package/src/services/task/dialer.ts +52 -0
- package/src/services/task/index.ts +1375 -0
- package/src/services/task/types.ts +1113 -0
- package/src/types.ts +639 -0
- package/src/webex-config.ts +54 -0
- package/src/webex.js +96 -0
- package/test/unit/spec/cc.ts +1985 -0
- package/test/unit/spec/metrics/MetricsManager.ts +491 -0
- package/test/unit/spec/metrics/behavioral-events.ts +102 -0
- package/test/unit/spec/services/WebCallingService.ts +416 -0
- package/test/unit/spec/services/agent/index.ts +65 -0
- package/test/unit/spec/services/config/index.ts +1035 -0
- package/test/unit/spec/services/core/Utils.ts +279 -0
- package/test/unit/spec/services/core/WebexRequest.ts +144 -0
- package/test/unit/spec/services/core/aqm-reqs.ts +570 -0
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +378 -0
- package/test/unit/spec/services/core/websocket/connection-service.ts +178 -0
- package/test/unit/spec/services/task/TaskManager.ts +1351 -0
- package/test/unit/spec/services/task/contact.ts +204 -0
- package/test/unit/spec/services/task/dialer.ts +157 -0
- package/test/unit/spec/services/task/index.ts +1474 -0
- package/tsconfig.json +6 -0
- package/typedoc.json +37 -0
- package/typedoc.md +240 -0
- package/umd/contact-center.min.js +3 -0
- package/umd/contact-center.min.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_events","_interopRequireDefault","require","_calling","_Utils","_types","_constants","_constants2","_loggerProxy","_types2","_MetricsManager","_constants3","_AutoWrapup","obj","__esModule","default","Task","EventEmitter","constructor","contact","webCallingService","data","wrapupData","webCallMap","metricsManager","MetricsManager","getInstance","registerWebCallListeners","setupAutoWrapupTimer","wrapUpRequired","autoWrapup","wrapUpProps","LoggerProxy","info","module","TASK_FILE","method","METHODS","SETUP_AUTO_WRAPUP_TIMER","interactionId","defaultWrapupReason","wrapUpReasonList","find","r","isDefault","error","intervalMs","autoWrapupInterval","AutoWrapup","allowCancelAutoWrapup","start","wrapup","wrapUpReason","name","auxCodeId","id","cancelAutoWrapupTimer","clear","undefined","CANCEL_AUTO_WRAPUP_TIMER","handleRemoteMedia","track","emit","TASK_EVENTS","TASK_MEDIA","on","CALL_EVENT_KEYS","REMOTE_MEDIA","unregisterWebCallListeners","off","updateTaskData","updatedData","shouldOverwrite","reconcileData","oldData","newData","Object","keys","forEach","key","Array","isArray","accept","ACCEPT","timeEvent","METRIC_EVENT_NAMES","TASK_ACCEPT_SUCCESS","TASK_ACCEPT_FAILED","interaction","mediaType","MEDIA_CHANNEL","TELEPHONY","response","log","trackingId","trackEvent","taskId","getCommonTrackingFieldForAQMResponse","loginOption","LoginOption","BROWSER","constraints","audio","localStream","navigator","mediaDevices","getUserMedia","audioTrack","getAudioTracks","localAudioStream","LocalMicrophoneStream","MediaStream","answerCall","Promise","resolve","detailedError","getErrorDetails","toString","getCommonTrackingFieldForAQMResponseFailed","details","toggleMute","TOGGLE_MUTE","muteUnmuteCall","isCallMuted","decline","DECLINE","TASK_DECLINE_SUCCESS","TASK_DECLINE_FAILED","declineCall","hold","HOLD","TASK_HOLD_SUCCESS","TASK_HOLD_FAILED","mediaResourceId","resume","RESUME","mainInteractionId","media","TASK_RESUME_SUCCESS","TASK_RESUME_FAILED","unHold","end","END","TASK_END_SUCCESS","TASK_END_FAILED","wrapupPayload","WRAPUP","TASK_WRAPUP_SUCCESS","TASK_WRAPUP_FAILED","Error","length","wrapUpCode","pauseRecording","PAUSE_RECORDING","TASK_PAUSE_RECORDING_SUCCESS","TASK_PAUSE_RECORDING_FAILED","result","resumeRecording","resumeRecordingPayload","RESUME_RECORDING","TASK_RESUME_RECORDING_SUCCESS","TASK_RESUME_RECORDING_FAILED","autoResumed","consult","consultPayload","CONSULT","TASK_CONSULT_START_SUCCESS","TASK_CONSULT_START_FAILED","destination","to","destinationType","endConsult","consultEndPayload","END_CONSULT","TASK_CONSULT_END_SUCCESS","TASK_CONSULT_END_FAILED","consultEnd","transfer","transferPayload","TRANSFER","TASK_TRANSFER_SUCCESS","TASK_TRANSFER_FAILED","DESTINATION_TYPE","QUEUE","vteamTransfer","blindTransfer","isConsultTransfer","consultTransfer","consultTransferPayload","CONSULT_TRANSFER","CONSULT_TRANSFER_DESTINATION_TYPE","destAgentId","AGENT","exports"],"sources":["index.ts"],"sourcesContent":["import EventEmitter from 'events';\nimport {CALL_EVENT_KEYS, LocalMicrophoneStream} from '@webex/calling';\nimport {CallId} from '@webex/calling/dist/types/common/types';\nimport {getErrorDetails} from '../core/Utils';\nimport {LoginOption} from '../../types';\nimport {TASK_FILE} from '../../constants';\nimport {METHODS} from './constants';\nimport routingContact from './contact';\nimport LoggerProxy from '../../logger-proxy';\nimport {\n ITask,\n TaskResponse,\n TaskData,\n TaskId,\n TASK_EVENTS,\n WrapupPayLoad,\n ResumeRecordingPayload,\n ConsultPayload,\n ConsultEndPayload,\n TransferPayLoad,\n DESTINATION_TYPE,\n CONSULT_TRANSFER_DESTINATION_TYPE,\n ConsultTransferPayLoad,\n MEDIA_CHANNEL,\n} from './types';\nimport WebCallingService from '../WebCallingService';\nimport MetricsManager from '../../metrics/MetricsManager';\nimport {METRIC_EVENT_NAMES} from '../../metrics/constants';\nimport {Failure} from '../core/GlobalTypes';\nimport AutoWrapup from './AutoWrapup';\nimport {WrapupData} from '../config/types';\n\n/**\n * Task class represents a contact center task/interaction that can be managed by an agent.\n * This class provides all the necessary methods to manage tasks in a contact center environment,\n * handling various call control operations and task lifecycle management.\n *\n * - Task Lifecycle Management:\n * - {@link accept} - Accept incoming task\n * - {@link decline} - Decline incoming task\n * - {@link end} - End active task\n * - Media Controls:\n * - {@link toggleMute} - Mute/unmute microphone for voice tasks\n * - {@link hold} - Place task on hold\n * - {@link resume} - Resume held task\n * - Recording Controls:\n * - {@link pauseRecording} - Pause task recording\n * - {@link resumeRecording} - Resume paused recording\n * - Task Transfer & Consultation:\n * - {@link consult} - Initiate consultation with another agent/queue\n * - {@link endConsult} - End ongoing consultation\n * - {@link transfer} - Transfer task to another agent/queue\n * - {@link consultTransfer} - Transfer after consultation\n * - Task Completion:\n * - {@link wrapup} - Complete task wrap-up\n *\n * Key events emitted by Task instances (see {@link TASK_EVENTS} for details):\n *\n * - Task Lifecycle:\n * - task:incoming — New task is being offered\n * - task:assigned — Task assigned to agent\n * - task:unassigned — Task unassigned from agent\n * - task:end — Task has ended\n * - task:wrapup — Task entered wrap-up state\n * - task:wrappedup — Task wrap-up completed\n * - task:rejected — Task was rejected/unanswered\n * - task:hydrate — Task data populated\n *\n * - Media & Controls:\n * - task:media — Voice call media track received\n * - task:hold — Task placed on hold\n * - task:unhold — Task resumed from hold\n *\n * - Consultation & Transfer:\n * - task:consultCreated — Consultation initiated\n * - task:consulting — Consultation in progress\n * - task:consultAccepted — Consultation accepted\n * - task:consultEnd — Consultation ended\n * - task:consultQueueCancelled — Queue consultation cancelled\n * - task:consultQueueFailed — Queue consultation failed\n * - task:offerConsult — Consultation offered\n * - task:offerContact — New contact offered\n *\n * - Recording:\n * - task:recordingPaused — Recording paused\n * - task:recordingPauseFailed — Recording pause failed\n * - task:recordingResumed — Recording resumed\n * - task:recordingResumeFailed — Recording resume failed\n *\n * @implements {ITask}\n * @example\n * ```typescript\n * // 1. Initialize task\n * const task = new Task(contact, webCallingService, taskData);\n *\n * // 2. Set up event listeners\n * task.on('task:media', (track) => {\n * // Handle voice call media\n * const audioElement = document.getElementById('remote-audio');\n * audioElement.srcObject = new MediaStream([track]);\n * });\n *\n * task.on('task:hold', () => {\n * console.log('Task is on hold');\n * // Update UI to show hold state\n * });\n *\n * task.on('task:end', () => {\n * console.log('Task ended');\n * if (task.data.wrapUpRequired) {\n * // Show wrap-up form\n * }\n * });\n *\n * // 3. Example task operations\n * await task.accept(); // Accept incoming task\n * await task.hold(); // Place on hold\n * await task.resume(); // Resume from hold\n * await task.end(); // End task\n *\n * // 4. Handle wrap-up if required\n * await task.wrapup({\n * auxCodeId: 'RESOLVED',\n * wrapUpReason: 'Customer issue resolved'\n * });\n * ```\n */\n\nexport default class Task extends EventEmitter implements ITask {\n private contact: ReturnType<typeof routingContact>;\n private localAudioStream: LocalMicrophoneStream;\n private webCallingService: WebCallingService;\n public data: TaskData;\n private metricsManager: MetricsManager;\n public webCallMap: Record<TaskId, CallId>;\n private wrapupData: WrapupData;\n public autoWrapup?: AutoWrapup;\n\n /**\n * Creates a new Task instance which provides the following features:\n * @param contact - The routing contact service instance\n * @param webCallingService - The web calling service instance\n * @param data - Initial task data\n * @param wrapupData - Wrap-up configuration data\n */\n public constructor(\n contact: ReturnType<typeof routingContact>,\n webCallingService: WebCallingService,\n data: TaskData,\n wrapupData: WrapupData\n ) {\n super();\n this.contact = contact;\n this.data = data;\n this.webCallingService = webCallingService;\n this.webCallMap = {};\n this.wrapupData = wrapupData;\n this.metricsManager = MetricsManager.getInstance();\n this.registerWebCallListeners();\n this.setupAutoWrapupTimer();\n }\n\n /**\n * Sets up the automatic wrap-up timer if wrap-up is required\n * @private\n */\n private setupAutoWrapupTimer() {\n if (\n this.data.wrapUpRequired && // only when wrapup required\n !this.autoWrapup && // if autoWrapup is not already set\n this.wrapupData && // wrapupData is not defined\n this.wrapupData.wrapUpProps // wrapUpProps is defined\n ) {\n const wrapUpProps = this.wrapupData.wrapUpProps;\n if (!wrapUpProps || wrapUpProps.autoWrapup === false) {\n LoggerProxy.info(`Auto wrap-up is not required for this task`, {\n module: TASK_FILE,\n method: METHODS.SETUP_AUTO_WRAPUP_TIMER,\n interactionId: this.data.interactionId,\n });\n\n return;\n }\n const defaultWrapupReason =\n wrapUpProps.wrapUpReasonList?.find((r) => r.isDefault) ?? wrapUpProps.wrapUpReasonList?.[0];\n if (!defaultWrapupReason) {\n LoggerProxy.error('No wrap-up reason configured', {\n module: TASK_FILE,\n method: METHODS.SETUP_AUTO_WRAPUP_TIMER,\n });\n\n return;\n }\n const intervalMs = wrapUpProps.autoWrapupInterval;\n if (!intervalMs || intervalMs <= 0) {\n LoggerProxy.error(`Invalid auto wrap-up interval: ${intervalMs}`, {\n module: TASK_FILE,\n method: METHODS.SETUP_AUTO_WRAPUP_TIMER,\n });\n }\n this.autoWrapup = new AutoWrapup(intervalMs, wrapUpProps.allowCancelAutoWrapup);\n this.autoWrapup.start(async () => {\n LoggerProxy.info(`Auto wrap-up timer triggered`, {\n module: TASK_FILE,\n method: METHODS.SETUP_AUTO_WRAPUP_TIMER,\n interactionId: this.data.interactionId,\n });\n await this.wrapup({\n wrapUpReason: defaultWrapupReason.name,\n auxCodeId: defaultWrapupReason.id,\n });\n });\n }\n }\n\n /**\n * Cancels the automatic wrap-up timer if it's running\n * @public - Public so it can be called externally when needed\n * Note: This is supported only in single session mode. Not supported in multi-session mode.\n */\n public cancelAutoWrapupTimer() {\n this.autoWrapup?.clear();\n this.autoWrapup = undefined;\n LoggerProxy.info(`Auto wrap-up timer cancelled`, {\n module: TASK_FILE,\n method: METHODS.CANCEL_AUTO_WRAPUP_TIMER,\n interactionId: this.data?.interactionId,\n });\n }\n\n /**\n * @ignore\n * @private\n */\n private handleRemoteMedia = (track: MediaStreamTrack) => {\n this.emit(TASK_EVENTS.TASK_MEDIA, track);\n };\n\n /**\n * @ignore\n * @private\n */\n private registerWebCallListeners() {\n this.webCallingService.on(CALL_EVENT_KEYS.REMOTE_MEDIA, this.handleRemoteMedia);\n }\n\n /**\n * @ignore\n */\n public unregisterWebCallListeners() {\n this.webCallingService.off(CALL_EVENT_KEYS.REMOTE_MEDIA, this.handleRemoteMedia);\n }\n\n /**\n * Updates the task data with new information\n * @param updatedData - New task data to merge with existing data\n * @param shouldOverwrite - If true, completely replace data instead of merging\n * @returns The updated task instance\n * @example\n * ```typescript\n * task.updateTaskData(newData);\n * task.updateTaskData(newData, true); // completely replace data\n * ```\n */\n public updateTaskData = (updatedData: TaskData, shouldOverwrite = false) => {\n this.data = shouldOverwrite ? updatedData : this.reconcileData(this.data, updatedData);\n this.setupAutoWrapupTimer();\n\n return this;\n };\n\n /**\n * Recursively merges old data with new data\n * @private\n */\n private reconcileData(oldData: TaskData, newData: TaskData): TaskData {\n Object.keys(newData).forEach((key) => {\n if (newData[key] && typeof newData[key] === 'object' && !Array.isArray(newData[key])) {\n oldData[key] = this.reconcileData({...oldData[key]}, newData[key]);\n } else {\n oldData[key] = newData[key];\n }\n });\n\n return oldData;\n }\n\n /**\n * Agent accepts the incoming task.\n * After accepting, the task will emit task:assigned event and for voice calls,\n * a task:media event with the audio stream.\n *\n * @returns Promise<TaskResponse>\n * @throws Error if accepting task fails or media requirements not met\n * @example\n * ```typescript\n * // Set up event handlers before accepting\n * task.on(TASK_EVENTS.TASK_ASSIGNED, () => {\n * console.log('Task assigned, ID:', task.data.interactionId);\n * // Update UI to show active task\n * });\n *\n * // For voice calls, handle media\n * task.on(TASK_EVENTS.TASK_MEDIA, (track) => {\n * const audioElement = document.getElementById('remote-audio');\n * audioElement.srcObject = new MediaStream([track]);\n * });\n *\n * // Accept the task\n * try {\n * await task.accept();\n * console.log('Successfully accepted task');\n * } catch (error) {\n * console.error('Failed to accept task:', error);\n * // Handle error (e.g., show error message to agent)\n * }\n * ```\n */\n public async accept(): Promise<TaskResponse> {\n try {\n LoggerProxy.info(`Accepting task`, {\n module: TASK_FILE,\n method: METHODS.ACCEPT,\n interactionId: this.data.interactionId,\n });\n this.metricsManager.timeEvent([\n METRIC_EVENT_NAMES.TASK_ACCEPT_SUCCESS,\n METRIC_EVENT_NAMES.TASK_ACCEPT_FAILED,\n ]);\n\n if (this.data.interaction.mediaType !== MEDIA_CHANNEL.TELEPHONY) {\n const response = await this.contact.accept({interactionId: this.data.interactionId});\n LoggerProxy.log(`Task accepted successfully`, {\n module: TASK_FILE,\n method: METHODS.ACCEPT,\n trackingId: response.trackingId,\n interactionId: this.data.interactionId,\n });\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_ACCEPT_SUCCESS,\n {\n taskId: this.data.interactionId,\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(this.data),\n },\n ['operational', 'behavioral', 'business']\n );\n\n return response;\n }\n\n if (this.webCallingService.loginOption === LoginOption.BROWSER) {\n const constraints = {audio: true};\n\n const localStream = await navigator.mediaDevices.getUserMedia(constraints);\n const audioTrack = localStream.getAudioTracks()[0];\n this.localAudioStream = new LocalMicrophoneStream(new MediaStream([audioTrack]));\n this.webCallingService.answerCall(this.localAudioStream, this.data.interactionId);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_ACCEPT_SUCCESS,\n {\n taskId: this.data.interactionId,\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(this.data),\n },\n ['operational', 'behavioral', 'business']\n );\n\n LoggerProxy.log(`Task accepted successfully with webrtc calling`, {\n module: TASK_FILE,\n method: METHODS.ACCEPT,\n interactionId: this.data.interactionId,\n });\n }\n\n return Promise.resolve(); // TODO: reject for extension as part of refactor\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.ACCEPT, TASK_FILE);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_ACCEPT_FAILED,\n {\n taskId: this.data.interactionId,\n error: error.toString(),\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details as Failure),\n },\n ['operational', 'behavioral', 'business']\n );\n throw detailedError;\n }\n }\n\n /**\n * Agent can mute/unmute their microphone during a WebRTC task.\n * This method toggles between muted and unmuted states for the local audio stream.\n *\n * @returns Promise<void> - Resolves when mute/unmute operation completes\n * @throws Error if toggling mute state fails or audio stream is not available\n * @example\n * ```typescript\n * // Toggle mute state\n * task.toggleMute()\n * .then(() => console.log('Mute state toggled successfully'))\n * .catch(error => console.error('Failed to toggle mute:', error));\n * ```\n */\n public async toggleMute() {\n try {\n LoggerProxy.info(`Toggling mute state`, {\n module: TASK_FILE,\n method: METHODS.TOGGLE_MUTE,\n interactionId: this.data.interactionId,\n });\n\n this.webCallingService.muteUnmuteCall(this.localAudioStream);\n\n LoggerProxy.log(\n `Mute state toggled successfully isCallMuted: ${this.webCallingService.isCallMuted()}`,\n {\n module: TASK_FILE,\n method: METHODS.TOGGLE_MUTE,\n interactionId: this.data.interactionId,\n }\n );\n\n return Promise.resolve();\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.TOGGLE_MUTE, TASK_FILE);\n throw detailedError;\n }\n }\n\n /**\n * Declines the incoming task. This will reject the task and notify the routing system.\n * For voice calls, this is equivalent to declining the incoming call.\n *\n * @returns Promise<TaskResponse>\n * @throws Error if the decline operation fails\n * @example\n * ```typescript\n * // Decline an incoming task\n * task.decline()\n * .then(() => console.log('Task declined successfully'))\n * .catch(error => console.error('Failed to decline task:', error));\n * ```\n */\n public async decline(): Promise<TaskResponse> {\n try {\n LoggerProxy.info(`Declining task`, {\n module: TASK_FILE,\n method: METHODS.DECLINE,\n interactionId: this.data.interactionId,\n });\n this.metricsManager.timeEvent([\n METRIC_EVENT_NAMES.TASK_DECLINE_SUCCESS,\n METRIC_EVENT_NAMES.TASK_DECLINE_FAILED,\n ]);\n\n this.webCallingService.declineCall(this.data.interactionId);\n this.unregisterWebCallListeners();\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_DECLINE_SUCCESS,\n {taskId: this.data.interactionId},\n ['operational', 'behavioral']\n );\n\n LoggerProxy.log(`Task declined successfully`, {\n module: TASK_FILE,\n method: METHODS.DECLINE,\n interactionId: this.data.interactionId,\n });\n\n return Promise.resolve();\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.DECLINE, TASK_FILE);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_DECLINE_FAILED,\n {\n taskId: this.data.interactionId,\n error: error.toString(),\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),\n },\n ['operational', 'behavioral']\n );\n throw detailedError;\n }\n }\n\n /**\n * Puts the current task/interaction on hold.\n * Emits task:hold event when successful. For voice tasks, this mutes the audio.\n *\n * @returns Promise<TaskResponse>\n * @throws Error if hold operation fails\n * @example\n * ```typescript\n * // Set up hold event handler\n * task.on(TASK_EVENTS.TASK_HOLD, () => {\n * console.log('Task is now on hold');\n * // Update UI to show hold state (e.g., enable resume button, show hold indicator)\n * document.getElementById('resume-btn').disabled = false;\n * document.getElementById('hold-indicator').style.display = 'block';\n * });\n *\n * // Place task on hold\n * try {\n * await task.hold();\n * console.log('Successfully placed task on hold');\n * } catch (error) {\n * console.error('Failed to place task on hold:', error);\n * // Handle error (e.g., show error message, reset UI state)\n * }\n * ```\n */\n public async hold(): Promise<TaskResponse> {\n try {\n LoggerProxy.info(`Holding task`, {\n module: TASK_FILE,\n method: METHODS.HOLD,\n interactionId: this.data.interactionId,\n });\n\n this.metricsManager.timeEvent([\n METRIC_EVENT_NAMES.TASK_HOLD_SUCCESS,\n METRIC_EVENT_NAMES.TASK_HOLD_FAILED,\n ]);\n\n const response = await this.contact.hold({\n interactionId: this.data.interactionId,\n data: {mediaResourceId: this.data.mediaResourceId},\n });\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_HOLD_SUCCESS,\n {\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(response),\n taskId: this.data.interactionId,\n mediaResourceId: this.data.mediaResourceId,\n },\n ['operational', 'behavioral']\n );\n\n LoggerProxy.log(`Task placed on hold successfully`, {\n module: TASK_FILE,\n method: METHODS.HOLD,\n trackingId: response.trackingId,\n interactionId: this.data.interactionId,\n });\n\n return response;\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.HOLD, TASK_FILE);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_HOLD_FAILED,\n {\n taskId: this.data.interactionId,\n mediaResourceId: this.data.mediaResourceId,\n error: error.toString(),\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),\n },\n ['operational', 'behavioral']\n );\n throw detailedError;\n }\n }\n\n /**\n * Resumes the task/interaction that was previously put on hold.\n * Emits task:resume event when successful. For voice tasks, this restores the audio.\n *\n * @returns Promise<TaskResponse>\n * @throws Error if resume operation fails\n * @example\n * ```typescript\n * // Set up resume event handler\n * task.on(TASK_EVENTS.TASK_RESUME, () => {\n * console.log('Task resumed from hold');\n * // Update UI to show active state\n * document.getElementById('hold-btn').disabled = false;\n * document.getElementById('hold-indicator').style.display = 'none';\n * });\n *\n * // Resume task from hold\n * try {\n * await task.resume();\n * console.log('Successfully resumed task from hold');\n * } catch (error) {\n * console.error('Failed to resume task:', error);\n * // Handle error (e.g., show error message)\n * }\n * ```\n */\n public async resume(): Promise<TaskResponse> {\n try {\n LoggerProxy.info(`Resuming task`, {\n module: TASK_FILE,\n method: METHODS.RESUME,\n interactionId: this.data.interactionId,\n });\n const {mainInteractionId} = this.data.interaction;\n const {mediaResourceId} = this.data.interaction.media[mainInteractionId];\n\n this.metricsManager.timeEvent([\n METRIC_EVENT_NAMES.TASK_RESUME_SUCCESS,\n METRIC_EVENT_NAMES.TASK_RESUME_FAILED,\n ]);\n\n const response = await this.contact.unHold({\n interactionId: this.data.interactionId,\n data: {mediaResourceId},\n });\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_RESUME_SUCCESS,\n {\n taskId: this.data.interactionId,\n mainInteractionId,\n mediaResourceId,\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(response),\n },\n ['operational', 'behavioral']\n );\n\n LoggerProxy.log(`Task resumed successfully`, {\n module: TASK_FILE,\n method: METHODS.RESUME,\n trackingId: response.trackingId,\n interactionId: this.data.interactionId,\n });\n\n return response;\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.RESUME, TASK_FILE);\n const mainInteractionId = this.data.interaction?.mainInteractionId;\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_RESUME_FAILED,\n {\n taskId: this.data.interactionId,\n mainInteractionId,\n mediaResourceId: mainInteractionId\n ? this.data.interaction.media[mainInteractionId].mediaResourceId\n : '',\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),\n },\n ['operational', 'behavioral']\n );\n throw detailedError;\n }\n }\n\n /**\n * Ends the task/interaction with the customer.\n * Emits task:end event when successful. If task requires wrap-up,\n * this will be indicated in the task:end event data.\n *\n * @returns Promise<TaskResponse>\n * @throws Error if ending task fails\n * @example\n * ```typescript\n * // Set up task end event handler\n * task.on(TASK_EVENTS.TASK_END, (data) => {\n * console.log('Task ended:', task.data.interactionId);\n *\n * if (data.wrapUpRequired) {\n * // Show wrap-up form\n * showWrapupForm();\n * } else {\n * // Clean up and prepare for next task\n * cleanupTask();\n * }\n * });\n *\n * // End the task\n * try {\n * await task.end();\n * console.log('Task end request successful');\n * } catch (error) {\n * console.error('Failed to end task:', error);\n * // Handle error (e.g., show error message, retry option)\n * }\n *\n * function showWrapupForm() {\n * // Show wrap-up UI with required codes\n * document.getElementById('wrapup-form').style.display = 'block';\n * }\n *\n * function cleanupTask() {\n * // Reset UI state\n * document.getElementById('active-task').style.display = 'none';\n * document.getElementById('controls').style.display = 'none';\n * }\n * ```\n */\n public async end(): Promise<TaskResponse> {\n try {\n LoggerProxy.info(`Ending task`, {\n module: TASK_FILE,\n method: METHODS.END,\n interactionId: this.data.interactionId,\n });\n\n this.metricsManager.timeEvent([\n METRIC_EVENT_NAMES.TASK_END_SUCCESS,\n METRIC_EVENT_NAMES.TASK_END_FAILED,\n ]);\n\n const response = await this.contact.end({interactionId: this.data.interactionId});\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_END_SUCCESS,\n {\n taskId: this.data.interactionId,\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(response),\n },\n ['operational', 'behavioral', 'business']\n );\n\n LoggerProxy.log(`Task ended successfully`, {\n module: TASK_FILE,\n method: METHODS.END,\n trackingId: response.trackingId,\n interactionId: this.data.interactionId,\n });\n\n return response;\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.END, TASK_FILE);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_END_FAILED,\n {\n taskId: this.data.interactionId,\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),\n },\n ['operational', 'behavioral', 'business']\n );\n throw detailedError;\n }\n }\n\n /**\n * Wraps up the task/interaction with the customer.\n * This is called after task:end event if wrapUpRequired is true.\n * Emits task:wrappedup event when successful.\n *\n * @param wrapupPayload - WrapupPayLoad containing:\n * - auxCodeId: Required ID for the wrap-up code\n * - wrapUpReason: Required description of wrap-up reason\n * @returns Promise<TaskResponse>\n * @throws Error if task data is unavailable, auxCodeId is missing, or wrapUpReason is missing\n * @example\n * ```typescript\n * // Set up wrap-up events\n * task.on(TASK_EVENTS.TASK_WRAPUP, () => {\n * console.log('Task ready for wrap-up');\n * // Show wrap-up form\n * document.getElementById('wrapup-form').style.display = 'block';\n * });\n *\n * task.on(TASK_EVENTS.TASK_WRAPPEDUP, () => {\n * console.log('Task wrap-up completed');\n * // Clean up UI\n * document.getElementById('wrapup-form').style.display = 'none';\n * });\n *\n * // Submit wrap-up\n * try {\n * const wrapupPayload = {\n * auxCodeId: selectedCode, // e.g., 'ISSUE_RESOLVED'\n * wrapUpReason: 'Customer issue resolved successfully'\n * };\n * await task.wrapup(wrapupPayload);\n * console.log('Successfully submitted wrap-up');\n * } catch (error) {\n * console.error('Failed to submit wrap-up:', error);\n * // Handle validation errors\n * if (error.message.includes('required')) {\n * // Show validation error to agent\n * }\n * }\n * ```\n */\n public async wrapup(wrapupPayload: WrapupPayLoad): Promise<TaskResponse> {\n try {\n this.cancelAutoWrapupTimer();\n LoggerProxy.info(`Wrapping up task`, {\n module: TASK_FILE,\n method: METHODS.WRAPUP,\n interactionId: this.data.interactionId,\n });\n\n this.metricsManager.timeEvent([\n METRIC_EVENT_NAMES.TASK_WRAPUP_SUCCESS,\n METRIC_EVENT_NAMES.TASK_WRAPUP_FAILED,\n ]);\n\n if (!this.data) {\n throw new Error('No task data available');\n }\n if (!wrapupPayload.auxCodeId || wrapupPayload.auxCodeId.length === 0) {\n throw new Error('AuxCodeId is required');\n }\n if (!wrapupPayload.wrapUpReason || wrapupPayload.wrapUpReason.length === 0) {\n throw new Error('WrapUpReason is required');\n }\n\n const response = await this.contact.wrapup({\n interactionId: this.data.interactionId,\n data: wrapupPayload,\n });\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_WRAPUP_SUCCESS,\n {\n taskId: this.data.interactionId,\n wrapUpCode: wrapupPayload.auxCodeId,\n wrapUpReason: wrapupPayload.wrapUpReason,\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(response),\n },\n ['operational', 'behavioral', 'business']\n );\n\n LoggerProxy.log(`Task wrapped up successfully`, {\n module: TASK_FILE,\n method: METHODS.WRAPUP,\n trackingId: response.trackingId,\n interactionId: this.data.interactionId,\n });\n\n return response;\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.WRAPUP, TASK_FILE);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_WRAPUP_FAILED,\n {\n taskId: this.data.interactionId,\n wrapUpCode: wrapupPayload.auxCodeId,\n wrapUpReason: wrapupPayload.wrapUpReason,\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),\n },\n ['operational', 'behavioral', 'business']\n );\n throw detailedError;\n }\n }\n\n /**\n * Pauses the recording for the current voice task.\n * Emits task:recordingPaused event when successful.\n *\n * @returns Promise<TaskResponse>\n * @throws Error if pause recording fails\n * @example\n * ```typescript\n * // Set up recording events\n * task.on(TASK_EVENTS.TASK_RECORDING_PAUSED, () => {\n * console.log('Recording paused');\n * // Update UI to show recording paused state\n * document.getElementById('recording-status').textContent = 'Recording Paused';\n * document.getElementById('pause-recording-btn').style.display = 'none';\n * document.getElementById('resume-recording-btn').style.display = 'block';\n * });\n *\n * task.on(TASK_EVENTS.TASK_RECORDING_PAUSE_FAILED, (error) => {\n * console.error('Failed to pause recording:', error);\n * // Show error to agent\n * });\n *\n * // Pause recording\n * try {\n * await task.pauseRecording();\n * console.log('Pause recording request sent');\n * } catch (error) {\n * console.error('Error sending pause recording request:', error);\n * // Handle error\n * }\n * ```\n */\n public async pauseRecording(): Promise<TaskResponse> {\n try {\n LoggerProxy.info(`Pausing recording`, {\n module: TASK_FILE,\n method: METHODS.PAUSE_RECORDING,\n interactionId: this.data.interactionId,\n });\n\n this.metricsManager.timeEvent([\n METRIC_EVENT_NAMES.TASK_PAUSE_RECORDING_SUCCESS,\n METRIC_EVENT_NAMES.TASK_PAUSE_RECORDING_FAILED,\n ]);\n\n const result = await this.contact.pauseRecording({interactionId: this.data.interactionId});\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_PAUSE_RECORDING_SUCCESS,\n {\n taskId: this.data.interactionId,\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(result),\n },\n ['operational', 'behavioral', 'business']\n );\n\n LoggerProxy.log(`Recording paused successfully`, {\n module: TASK_FILE,\n method: METHODS.PAUSE_RECORDING,\n trackingId: result.trackingId,\n interactionId: this.data.interactionId,\n });\n\n return result;\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.PAUSE_RECORDING, TASK_FILE);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_PAUSE_RECORDING_FAILED,\n {\n taskId: this.data.interactionId,\n error: error.toString(),\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),\n },\n ['operational', 'behavioral', 'business']\n );\n throw detailedError;\n }\n }\n\n /**\n * Resumes the recording for the voice task that was previously paused.\n * Emits task:recordingResumed event when successful.\n *\n * @param resumeRecordingPayload - Configuration for resuming recording:\n * - autoResumed: Indicates if resume was automatic (defaults to false)\n * @returns Promise<TaskResponse>\n * @throws Error if resume recording fails\n * @example\n * ```typescript\n * // Set up recording resume events\n * task.on(TASK_EVENTS.TASK_RECORDING_RESUMED, () => {\n * console.log('Recording resumed');\n * // Update UI to show active recording state\n * document.getElementById('recording-status').textContent = 'Recording Active';\n * document.getElementById('pause-recording-btn').style.display = 'block';\n * document.getElementById('resume-recording-btn').style.display = 'none';\n * });\n *\n * task.on(TASK_EVENTS.TASK_RECORDING_RESUME_FAILED, (error) => {\n * console.error('Failed to resume recording:', error);\n * // Show error to agent\n * });\n *\n * // Resume recording\n * try {\n * const resumePayload = {\n * autoResumed: false // Set to true if triggered by system\n * };\n * await task.resumeRecording(resumePayload);\n * console.log('Resume recording request sent');\n * } catch (error) {\n * console.error('Error sending resume recording request:', error);\n * // Handle error\n * }\n * ```\n */\n public async resumeRecording(\n resumeRecordingPayload: ResumeRecordingPayload\n ): Promise<TaskResponse> {\n try {\n LoggerProxy.info(`Resuming recording`, {\n module: TASK_FILE,\n method: METHODS.RESUME_RECORDING,\n interactionId: this.data.interactionId,\n });\n\n this.metricsManager.timeEvent([\n METRIC_EVENT_NAMES.TASK_RESUME_RECORDING_SUCCESS,\n METRIC_EVENT_NAMES.TASK_RESUME_RECORDING_FAILED,\n ]);\n\n resumeRecordingPayload ??= {autoResumed: false};\n\n const result = await this.contact.resumeRecording({\n interactionId: this.data.interactionId,\n data: resumeRecordingPayload,\n });\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_RESUME_RECORDING_SUCCESS,\n {\n taskId: this.data.interactionId,\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(result),\n },\n ['operational', 'behavioral', 'business']\n );\n\n LoggerProxy.log(`Recording resumed successfully`, {\n module: TASK_FILE,\n method: METHODS.RESUME_RECORDING,\n trackingId: result.trackingId,\n interactionId: this.data.interactionId,\n });\n\n return result;\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.RESUME_RECORDING, TASK_FILE);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_RESUME_RECORDING_FAILED,\n {\n taskId: this.data.interactionId,\n error: error.toString(),\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),\n },\n ['operational', 'behavioral', 'business']\n );\n throw detailedError;\n }\n }\n\n /**\n * Consults another agent or queue on an ongoing task for further assistance.\n * During consultation, the original customer is typically placed on hold while\n * the agent seeks guidance from another agent or queue.\n *\n * @param consultPayload - Configuration for the consultation containing:\n * - to: ID of the agent or queue to consult with\n * - destinationType: Type of destination (AGENT, QUEUE, etc.)\n * - holdParticipants: Whether to hold other participants (defaults to true)\n * @returns Promise<TaskResponse> - Resolves with consultation result\n * @throws Error if consultation fails or invalid parameters provided\n * @example\n * ```typescript\n * // Consult with another agent\n * const consultPayload = {\n * to: 'agentId123',\n * destinationType: DESTINATION_TYPE.AGENT,\n * holdParticipants: true\n * };\n * task.consult(consultPayload)\n * .then(response => console.log('Consultation started successfully'))\n * .catch(error => console.error('Failed to start consultation:', error));\n *\n * // Consult with a queue\n * const queueConsultPayload = {\n * to: 'salesQueue123',\n * destinationType: DESTINATION_TYPE.QUEUE\n * };\n * task.consult(queueConsultPayload)\n * .then(response => console.log('Queue consultation started'))\n * .catch(error => console.error('Failed to start queue consultation:', error));\n * ```\n */\n public async consult(consultPayload: ConsultPayload): Promise<TaskResponse> {\n try {\n LoggerProxy.info(`Starting consult`, {\n module: TASK_FILE,\n method: METHODS.CONSULT,\n interactionId: this.data.interactionId,\n });\n\n this.metricsManager.timeEvent([\n METRIC_EVENT_NAMES.TASK_CONSULT_START_SUCCESS,\n METRIC_EVENT_NAMES.TASK_CONSULT_START_FAILED,\n ]);\n\n const result = await this.contact.consult({\n interactionId: this.data.interactionId,\n data: consultPayload,\n });\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_CONSULT_START_SUCCESS,\n {\n taskId: this.data.interactionId,\n destination: consultPayload.to,\n destinationType: consultPayload.destinationType,\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(result),\n },\n ['operational', 'behavioral', 'business']\n );\n\n LoggerProxy.log(`Consult started successfully to ${consultPayload.to}`, {\n module: TASK_FILE,\n method: METHODS.CONSULT,\n trackingId: result.trackingId,\n interactionId: this.data.interactionId,\n });\n\n return result;\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.CONSULT, TASK_FILE);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_CONSULT_START_FAILED,\n {\n taskId: this.data.interactionId,\n destination: consultPayload.to,\n destinationType: consultPayload.destinationType,\n error: error.toString(),\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),\n },\n ['operational', 'behavioral', 'business']\n );\n throw detailedError;\n }\n }\n\n /**\n * Ends an ongoing consultation session for the task.\n * This terminates the consultation while maintaining the original customer connection.\n *\n * @param consultEndPayload - Configuration for ending the consultation containing:\n * - isConsult: Must be true to indicate this is a consultation end\n * - taskId: ID of the task being consulted on\n * - queueId: (Optional) Queue ID if this was a queue consultation\n * - isSecondaryEpDnAgent: (Optional) Indicates if this involves a secondary entry point\n * @returns Promise<TaskResponse> - Resolves when consultation is ended\n * @throws Error if ending consultation fails or invalid parameters provided\n * @example\n * ```typescript\n * // End a direct agent consultation\n * const consultEndPayload = {\n * isConsult: true,\n * taskId: 'task123'\n * };\n * task.endConsult(consultEndPayload)\n * .then(response => console.log('Consultation ended successfully'))\n * .catch(error => console.error('Failed to end consultation:', error));\n *\n * // End a queue consultation\n * const queueConsultEndPayload = {\n * isConsult: true,\n * taskId: 'task123',\n * queueId: 'queue123'\n * };\n * task.endConsult(queueConsultEndPayload)\n * .then(response => console.log('Queue consultation ended'))\n * .catch(error => console.error('Failed to end queue consultation:', error));\n * ```\n */\n public async endConsult(consultEndPayload: ConsultEndPayload): Promise<TaskResponse> {\n try {\n LoggerProxy.info(`Ending consult`, {\n module: TASK_FILE,\n method: METHODS.END_CONSULT,\n interactionId: this.data.interactionId,\n });\n\n this.metricsManager.timeEvent([\n METRIC_EVENT_NAMES.TASK_CONSULT_END_SUCCESS,\n METRIC_EVENT_NAMES.TASK_CONSULT_END_FAILED,\n ]);\n\n const result = await this.contact.consultEnd({\n interactionId: this.data.interactionId,\n data: consultEndPayload,\n });\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_CONSULT_END_SUCCESS,\n {\n taskId: this.data.interactionId,\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(result),\n },\n ['operational', 'behavioral', 'business']\n );\n\n LoggerProxy.log(`Consult ended successfully`, {\n module: TASK_FILE,\n method: METHODS.END_CONSULT,\n trackingId: result.trackingId,\n interactionId: this.data.interactionId,\n });\n\n return result;\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.END_CONSULT, TASK_FILE);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_CONSULT_END_FAILED,\n {\n taskId: this.data.interactionId,\n error: error.toString(),\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),\n },\n ['operational', 'behavioral', 'business']\n );\n throw detailedError;\n }\n }\n\n /**\n * Transfer the task to an agent directly or to a queue.\n * This is a blind transfer that immediately redirects the task to the specified destination.\n *\n * @param transferPayload - Transfer configuration containing:\n * - to: ID of the agent or queue to transfer to\n * - destinationType: Type of destination (AGENT, QUEUE, etc.)\n * @returns Promise<TaskResponse> - Resolves when transfer is completed\n * @throws Error if transfer fails or invalid parameters provided\n * @example\n * ```typescript\n * // Transfer to a queue\n * const queueTransferPayload = {\n * to: 'salesQueue123',\n * destinationType: DESTINATION_TYPE.QUEUE\n * };\n * task.transfer(queueTransferPayload)\n * .then(response => console.log('Task transferred to queue successfully'))\n * .catch(error => console.error('Failed to transfer to queue:', error));\n *\n * // Transfer to an agent\n * const agentTransferPayload = {\n * to: 'agentId123',\n * destinationType: DESTINATION_TYPE.AGENT\n * };\n * task.transfer(agentTransferPayload)\n * .then(response => console.log('Task transferred to agent successfully'))\n * .catch(error => console.error('Failed to transfer to agent:', error));\n * ```\n */\n public async transfer(transferPayload: TransferPayLoad): Promise<TaskResponse> {\n try {\n LoggerProxy.info(`Transferring task to ${transferPayload.to}`, {\n module: TASK_FILE,\n method: METHODS.TRANSFER,\n interactionId: this.data.interactionId,\n });\n\n this.metricsManager.timeEvent([\n METRIC_EVENT_NAMES.TASK_TRANSFER_SUCCESS,\n METRIC_EVENT_NAMES.TASK_TRANSFER_FAILED,\n ]);\n\n let result: TaskResponse;\n if (transferPayload.destinationType === DESTINATION_TYPE.QUEUE) {\n result = await this.contact.vteamTransfer({\n interactionId: this.data.interactionId,\n data: transferPayload,\n });\n } else {\n result = await this.contact.blindTransfer({\n interactionId: this.data.interactionId,\n data: transferPayload,\n });\n }\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_TRANSFER_SUCCESS,\n {\n taskId: this.data.interactionId,\n destination: transferPayload.to,\n destinationType: transferPayload.destinationType,\n isConsultTransfer: false,\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(result),\n },\n ['operational', 'behavioral', 'business']\n );\n\n LoggerProxy.log(`Task transferred successfully to ${transferPayload.to}`, {\n module: TASK_FILE,\n method: METHODS.TRANSFER,\n trackingId: result.trackingId,\n interactionId: this.data.interactionId,\n });\n\n return result;\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.TRANSFER, TASK_FILE);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_TRANSFER_FAILED,\n {\n taskId: this.data.interactionId,\n destination: transferPayload.to,\n destinationType: transferPayload.destinationType,\n isConsultTransfer: false,\n error: error.toString(),\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),\n },\n ['operational', 'behavioral', 'business']\n );\n throw detailedError;\n }\n }\n\n /**\n * Transfer the task to the party that was consulted.\n * This completes a consultative transfer where the agent first consulted with the target\n * before transferring the task. For queue consultations, the transfer is automatically\n * directed to the agent who accepted the consultation.\n *\n * @param consultTransferPayload - Configuration for the consultation transfer containing:\n * - to: ID of the agent or queue to transfer to\n * - destinationType: Type of destination (AGENT, QUEUE, etc. from CONSULT_TRANSFER_DESTINATION_TYPE)\n * @returns Promise<TaskResponse> - Resolves when consultation transfer is completed\n * @throws Error if transfer fails, no agent has accepted a queue consultation, or other validation errors\n * @example\n * ```typescript\n * // Complete consultation transfer to an agent\n * const agentConsultTransfer = {\n * to: 'agentId123',\n * destinationType: CONSULT_TRANSFER_DESTINATION_TYPE.AGENT\n * };\n * task.consultTransfer(agentConsultTransfer)\n * .then(response => console.log('Consultation transfer to agent completed'))\n * .catch(error => console.error('Failed to complete agent consultation transfer:', error));\n *\n * // Complete consultation transfer to a queue agent\n * const queueConsultTransfer = {\n * to: 'queue123',\n * destinationType: CONSULT_TRANSFER_DESTINATION_TYPE.QUEUE\n * };\n * task.consultTransfer(queueConsultTransfer)\n * .then(response => console.log('Consultation transfer to queue agent completed'))\n * .catch(error => console.error('Failed to complete queue consultation transfer:', error));\n * ```\n */\n public async consultTransfer(\n consultTransferPayload: ConsultTransferPayLoad\n ): Promise<TaskResponse> {\n try {\n LoggerProxy.info(`Initiating consult transfer to ${consultTransferPayload.to}`, {\n module: TASK_FILE,\n method: METHODS.CONSULT_TRANSFER,\n interactionId: this.data.interactionId,\n });\n\n // For queue destinations, use the destAgentId from task data\n if (consultTransferPayload.destinationType === CONSULT_TRANSFER_DESTINATION_TYPE.QUEUE) {\n if (!this.data.destAgentId) {\n throw new Error('No agent has accepted this queue consult yet');\n }\n\n // Override the destination with the agent who accepted the queue consult\n consultTransferPayload = {\n to: this.data.destAgentId,\n destinationType: CONSULT_TRANSFER_DESTINATION_TYPE.AGENT,\n };\n }\n\n const result = await this.contact.consultTransfer({\n interactionId: this.data.interactionId,\n data: consultTransferPayload,\n });\n\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_TRANSFER_SUCCESS,\n {\n taskId: this.data.interactionId,\n destination: consultTransferPayload.to,\n destinationType: consultTransferPayload.destinationType,\n isConsultTransfer: true,\n ...MetricsManager.getCommonTrackingFieldForAQMResponse(result),\n },\n ['operational', 'behavioral', 'business']\n );\n\n LoggerProxy.log(`Consult transfer completed successfully to ${consultTransferPayload.to}`, {\n module: TASK_FILE,\n method: METHODS.CONSULT_TRANSFER,\n trackingId: result.trackingId,\n interactionId: this.data.interactionId,\n });\n\n return result;\n } catch (error) {\n const {error: detailedError} = getErrorDetails(error, METHODS.CONSULT_TRANSFER, TASK_FILE);\n this.metricsManager.trackEvent(\n METRIC_EVENT_NAMES.TASK_TRANSFER_FAILED,\n {\n taskId: this.data.interactionId,\n destination: consultTransferPayload.to,\n destinationType: consultTransferPayload.destinationType,\n isConsultTransfer: true,\n error: error.toString(),\n ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(error.details || {}),\n },\n ['operational', 'behavioral', 'business']\n );\n throw detailedError;\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAEA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAiBA,IAAAQ,eAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAEA,IAAAU,WAAA,GAAAX,sBAAA,CAAAC,OAAA;AAAsC,SAAAD,uBAAAY,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe,MAAMG,IAAI,SAASC,eAAY,CAAkB;EAU9D;AACF;AACA;AACA;AACA;AACA;AACA;EACSC,WAAWA,CAChBC,OAA0C,EAC1CC,iBAAoC,EACpCC,IAAc,EACdC,UAAsB,EACtB;IACA,KAAK,CAAC,CAAC;IACP,IAAI,CAACH,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACE,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACD,iBAAiB,GAAGA,iBAAiB;IAC1C,IAAI,CAACG,UAAU,GAAG,CAAC,CAAC;IACpB,IAAI,CAACD,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACE,cAAc,GAAGC,uBAAc,CAACC,WAAW,CAAC,CAAC;IAClD,IAAI,CAACC,wBAAwB,CAAC,CAAC;IAC/B,IAAI,CAACC,oBAAoB,CAAC,CAAC;EAC7B;;EAEA;AACF;AACA;AACA;EACUA,oBAAoBA,CAAA,EAAG;IAC7B,IACE,IAAI,CAACP,IAAI,CAACQ,cAAc;IAAI;IAC5B,CAAC,IAAI,CAACC,UAAU;IAAI;IACpB,IAAI,CAACR,UAAU;IAAI;IACnB,IAAI,CAACA,UAAU,CAACS,WAAW,CAAC;IAAA,EAC5B;MACA,MAAMA,WAAW,GAAG,IAAI,CAACT,UAAU,CAACS,WAAW;MAC/C,IAAI,CAACA,WAAW,IAAIA,WAAW,CAACD,UAAU,KAAK,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C,eAAe,EAAEkB,sBAAsB,CAAClB,eAAe;QACvDgB,iBAAiB,EAAE,IAAI;QACvB7I,KAAK,EAAEA,KAAK,CAACwE,QAAQ,CAAC,CAAC;QACvB,GAAG5F,uBAAc,CAAC6F,0CAA0C,CAACzE,KAAK,CAAC0E,OAAO,IAAI,CAAC,CAAC;MAClF,CAAC,EACD,CAAC,aAAa,EAAE,YAAY,EAAE,UAAU,CAC1C,CAAC;MACD,MAAMJ,aAAa;IACrB;EACF;AACF;AAAC8E,OAAA,CAAAlL,OAAA,GAAAC,IAAA"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TASK_EVENTS = exports.MEDIA_CHANNEL = exports.DESTINATION_TYPE = exports.CONSULT_TRANSFER_DESTINATION_TYPE = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Unique identifier for a task in the contact center system
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Helper type for creating enum-like objects with type safety
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Defines the valid destination types for routing tasks within the contact center
|
|
19
|
+
* Used to specify where a task should be directed
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
const DESTINATION_TYPE = exports.DESTINATION_TYPE = {
|
|
23
|
+
/** Route task to a specific queue */
|
|
24
|
+
QUEUE: 'queue',
|
|
25
|
+
/** Route task to a specific dial number */
|
|
26
|
+
DIALNUMBER: 'dialNumber',
|
|
27
|
+
/** Route task to a specific agent */
|
|
28
|
+
AGENT: 'agent',
|
|
29
|
+
/** Route task to an entry point (supported only for consult operations) */
|
|
30
|
+
ENTRYPOINT: 'entryPoint'
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Type representing valid destination types for task routing
|
|
35
|
+
* Derived from the DESTINATION_TYPE constant
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Defines the valid destination types for consult transfer operations
|
|
41
|
+
* Used when transferring a task after consultation
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
const CONSULT_TRANSFER_DESTINATION_TYPE = exports.CONSULT_TRANSFER_DESTINATION_TYPE = {
|
|
45
|
+
/** Transfer to a specific agent */
|
|
46
|
+
AGENT: 'agent',
|
|
47
|
+
/** Transfer to an entry point */
|
|
48
|
+
ENTRYPOINT: 'entryPoint',
|
|
49
|
+
/** Transfer to a dial number */
|
|
50
|
+
DIALNUMBER: 'dialNumber',
|
|
51
|
+
/** Transfer to a queue */
|
|
52
|
+
QUEUE: 'queue'
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Type representing valid destination types for consult transfers
|
|
57
|
+
* Derived from the CONSULT_TRANSFER_DESTINATION_TYPE constant
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Defines all supported media channel types for customer interactions
|
|
63
|
+
* These represent the different ways customers can communicate with agents
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
const MEDIA_CHANNEL = exports.MEDIA_CHANNEL = {
|
|
67
|
+
/** Email-based communication channel */
|
|
68
|
+
EMAIL: 'email',
|
|
69
|
+
/** Web-based chat communication channel */
|
|
70
|
+
CHAT: 'chat',
|
|
71
|
+
/** Voice/phone communication channel */
|
|
72
|
+
TELEPHONY: 'telephony',
|
|
73
|
+
/** Social media platform communication channel */
|
|
74
|
+
SOCIAL: 'social',
|
|
75
|
+
/** SMS text messaging communication channel */
|
|
76
|
+
SMS: 'sms',
|
|
77
|
+
/** Facebook Messenger communication channel */
|
|
78
|
+
FACEBOOK: 'facebook',
|
|
79
|
+
/** WhatsApp messaging communication channel */
|
|
80
|
+
WHATSAPP: 'whatsapp'
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Type representing valid media channels
|
|
85
|
+
* Derived from the MEDIA_CHANNEL constant
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
/**
|
|
89
|
+
* Enumeration of all task-related events that can occur in the contact center system
|
|
90
|
+
* These events represent different states and actions in the task lifecycle
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
let TASK_EVENTS = exports.TASK_EVENTS = /*#__PURE__*/function (TASK_EVENTS) {
|
|
94
|
+
TASK_EVENTS["TASK_INCOMING"] = "task:incoming";
|
|
95
|
+
TASK_EVENTS["TASK_ASSIGNED"] = "task:assigned";
|
|
96
|
+
TASK_EVENTS["TASK_MEDIA"] = "task:media";
|
|
97
|
+
TASK_EVENTS["TASK_UNASSIGNED"] = "task:unassigned";
|
|
98
|
+
TASK_EVENTS["TASK_HOLD"] = "task:hold";
|
|
99
|
+
TASK_EVENTS["TASK_RESUME"] = "task:resume";
|
|
100
|
+
TASK_EVENTS["TASK_CONSULT_END"] = "task:consultEnd";
|
|
101
|
+
TASK_EVENTS["TASK_CONSULT_QUEUE_CANCELLED"] = "task:consultQueueCancelled";
|
|
102
|
+
TASK_EVENTS["TASK_CONSULT_QUEUE_FAILED"] = "task:consultQueueFailed";
|
|
103
|
+
TASK_EVENTS["TASK_CONSULT_ACCEPTED"] = "task:consultAccepted";
|
|
104
|
+
TASK_EVENTS["TASK_CONSULTING"] = "task:consulting";
|
|
105
|
+
TASK_EVENTS["TASK_CONSULT_CREATED"] = "task:consultCreated";
|
|
106
|
+
TASK_EVENTS["TASK_OFFER_CONSULT"] = "task:offerConsult";
|
|
107
|
+
TASK_EVENTS["TASK_END"] = "task:end";
|
|
108
|
+
TASK_EVENTS["TASK_WRAPUP"] = "task:wrapup";
|
|
109
|
+
TASK_EVENTS["TASK_WRAPPEDUP"] = "task:wrappedup";
|
|
110
|
+
TASK_EVENTS["TASK_RECORDING_PAUSED"] = "task:recordingPaused";
|
|
111
|
+
TASK_EVENTS["TASK_RECORDING_PAUSE_FAILED"] = "task:recordingPauseFailed";
|
|
112
|
+
TASK_EVENTS["TASK_RECORDING_RESUMED"] = "task:recordingResumed";
|
|
113
|
+
TASK_EVENTS["TASK_RECORDING_RESUME_FAILED"] = "task:recordingResumeFailed";
|
|
114
|
+
TASK_EVENTS["TASK_REJECT"] = "task:rejected";
|
|
115
|
+
TASK_EVENTS["TASK_HYDRATE"] = "task:hydrate";
|
|
116
|
+
TASK_EVENTS["TASK_OFFER_CONTACT"] = "task:offerContact";
|
|
117
|
+
return TASK_EVENTS;
|
|
118
|
+
}({});
|
|
119
|
+
/**
|
|
120
|
+
* Represents a customer interaction within the contact center system
|
|
121
|
+
* Contains comprehensive details about an ongoing customer interaction
|
|
122
|
+
* @public
|
|
123
|
+
*/
|
|
124
|
+
/**
|
|
125
|
+
* Task payload containing detailed information about a contact center task
|
|
126
|
+
* This structure encapsulates all relevant data for task management
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
/**
|
|
130
|
+
* Type representing an agent contact message within the contact center system
|
|
131
|
+
* Contains comprehensive interaction and task related details for agent operations
|
|
132
|
+
* @public
|
|
133
|
+
*/
|
|
134
|
+
/**
|
|
135
|
+
* Information about a virtual team in the contact center
|
|
136
|
+
* @ignore
|
|
137
|
+
*/
|
|
138
|
+
/**
|
|
139
|
+
* Detailed information about a virtual team configuration
|
|
140
|
+
* @ignore
|
|
141
|
+
*/
|
|
142
|
+
/**
|
|
143
|
+
* Response type for successful virtual team operations
|
|
144
|
+
* Contains details about virtual teams and their capabilities
|
|
145
|
+
* @ignore
|
|
146
|
+
*/
|
|
147
|
+
/**
|
|
148
|
+
* Parameters for putting a task on hold or resuming from hold
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
|
+
/**
|
|
152
|
+
* Parameters for resuming a task's recording
|
|
153
|
+
* @public
|
|
154
|
+
*/
|
|
155
|
+
/**
|
|
156
|
+
* Parameters for transferring a task to another destination
|
|
157
|
+
* @public
|
|
158
|
+
*/
|
|
159
|
+
/**
|
|
160
|
+
* Parameters for initiating a consultative transfer
|
|
161
|
+
* @public
|
|
162
|
+
*/
|
|
163
|
+
/**
|
|
164
|
+
* Parameters for initiating a consultation with another agent or queue
|
|
165
|
+
* @public
|
|
166
|
+
*/
|
|
167
|
+
/**
|
|
168
|
+
* Parameters for ending a consultation task
|
|
169
|
+
* @public
|
|
170
|
+
*/
|
|
171
|
+
/**
|
|
172
|
+
* Parameters for transferring a task to another destination
|
|
173
|
+
* @public
|
|
174
|
+
*/
|
|
175
|
+
/**
|
|
176
|
+
* API payload for ending a consultation
|
|
177
|
+
* This is the actual payload that is sent to the developer API
|
|
178
|
+
* @public
|
|
179
|
+
*/
|
|
180
|
+
/**
|
|
181
|
+
* Data required for consulting and conferencing operations
|
|
182
|
+
* @public
|
|
183
|
+
*/
|
|
184
|
+
/**
|
|
185
|
+
* Parameters required for cancelling a consult to queue operation
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
/**
|
|
189
|
+
* Parameters required for declining a task
|
|
190
|
+
* @public
|
|
191
|
+
*/
|
|
192
|
+
/**
|
|
193
|
+
* Parameters for wrapping up a task with relevant completion details
|
|
194
|
+
* @public
|
|
195
|
+
*/
|
|
196
|
+
/**
|
|
197
|
+
* Configuration parameters for initiating outbound dialer tasks
|
|
198
|
+
* @public
|
|
199
|
+
*/
|
|
200
|
+
/**
|
|
201
|
+
* Data structure for cleaning up contact resources
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
/**
|
|
205
|
+
* Response type for task public methods
|
|
206
|
+
* Can be an {@link AgentContact} object containing updated task state,
|
|
207
|
+
* an Error in case of failure, or void for operations that don't return data
|
|
208
|
+
* @public
|
|
209
|
+
*/
|
|
210
|
+
/**
|
|
211
|
+
* Interface for managing task-related operations in the contact center
|
|
212
|
+
* Extends EventEmitter to support event-driven task updates
|
|
213
|
+
*/
|
|
214
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DESTINATION_TYPE","exports","QUEUE","DIALNUMBER","AGENT","ENTRYPOINT","CONSULT_TRANSFER_DESTINATION_TYPE","MEDIA_CHANNEL","EMAIL","CHAT","TELEPHONY","SOCIAL","SMS","FACEBOOK","WHATSAPP","TASK_EVENTS"],"sources":["types.ts"],"sourcesContent":["import {CallId} from '@webex/calling/dist/types/common/types';\nimport EventEmitter from 'events';\nimport {Msg} from '../core/GlobalTypes';\nimport AutoWrapup from './AutoWrapup';\n\n/**\n * Unique identifier for a task in the contact center system\n * @public\n */\nexport type TaskId = string;\n\n/**\n * Helper type for creating enum-like objects with type safety\n * @internal\n */\ntype Enum<T extends Record<string, unknown>> = T[keyof T];\n\n/**\n * Defines the valid destination types for routing tasks within the contact center\n * Used to specify where a task should be directed\n * @public\n */\nexport const DESTINATION_TYPE = {\n /** Route task to a specific queue */\n QUEUE: 'queue',\n /** Route task to a specific dial number */\n DIALNUMBER: 'dialNumber',\n /** Route task to a specific agent */\n AGENT: 'agent',\n /** Route task to an entry point (supported only for consult operations) */\n ENTRYPOINT: 'entryPoint',\n};\n\n/**\n * Type representing valid destination types for task routing\n * Derived from the DESTINATION_TYPE constant\n * @public\n */\nexport type DestinationType = Enum<typeof DESTINATION_TYPE>;\n\n/**\n * Defines the valid destination types for consult transfer operations\n * Used when transferring a task after consultation\n * @public\n */\nexport const CONSULT_TRANSFER_DESTINATION_TYPE = {\n /** Transfer to a specific agent */\n AGENT: 'agent',\n /** Transfer to an entry point */\n ENTRYPOINT: 'entryPoint',\n /** Transfer to a dial number */\n DIALNUMBER: 'dialNumber',\n /** Transfer to a queue */\n QUEUE: 'queue',\n};\n\n/**\n * Type representing valid destination types for consult transfers\n * Derived from the CONSULT_TRANSFER_DESTINATION_TYPE constant\n * @public\n */\nexport type ConsultTransferDestinationType = Enum<typeof CONSULT_TRANSFER_DESTINATION_TYPE>;\n\n/**\n * Defines all supported media channel types for customer interactions\n * These represent the different ways customers can communicate with agents\n * @public\n */\nexport const MEDIA_CHANNEL = {\n /** Email-based communication channel */\n EMAIL: 'email',\n /** Web-based chat communication channel */\n CHAT: 'chat',\n /** Voice/phone communication channel */\n TELEPHONY: 'telephony',\n /** Social media platform communication channel */\n SOCIAL: 'social',\n /** SMS text messaging communication channel */\n SMS: 'sms',\n /** Facebook Messenger communication channel */\n FACEBOOK: 'facebook',\n /** WhatsApp messaging communication channel */\n WHATSAPP: 'whatsapp',\n} as const;\n\n/**\n * Type representing valid media channels\n * Derived from the MEDIA_CHANNEL constant\n * @public\n */\nexport type MEDIA_CHANNEL = Enum<typeof MEDIA_CHANNEL>;\n\n/**\n * Enumeration of all task-related events that can occur in the contact center system\n * These events represent different states and actions in the task lifecycle\n * @public\n */\nexport enum TASK_EVENTS {\n /**\n * Triggered when a new task is received by the system\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_INCOMING, (task: ITask) => {\n * console.log('New task received:', task.data.interactionId);\n * // Handle incoming task\n * });\n * ```\n */\n TASK_INCOMING = 'task:incoming',\n\n /**\n * Triggered when a task is successfully assigned to an agent\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_ASSIGNED, (task: ITask) => {\n * console.log('Task assigned:', task.data.interactionId);\n * // Begin handling the assigned task\n * });\n * ```\n */\n TASK_ASSIGNED = 'task:assigned',\n\n /**\n * Triggered when the media state of a task changes\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_MEDIA, (track: MediaStreamTrack) => {\n * // Handle media track updates\n * });\n * ```\n */\n TASK_MEDIA = 'task:media',\n\n /**\n * Triggered when a task is removed from an agent\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_UNASSIGNED, (task: ITask) => {\n * console.log('Task unassigned:', task.data.interactionId);\n * // Clean up task resources\n * });\n * ```\n */\n TASK_UNASSIGNED = 'task:unassigned',\n\n /**\n * Triggered when a task is placed on hold\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_HOLD, (task: ITask) => {\n * console.log('Task placed on hold:', task.data.interactionId);\n * // Update UI to show hold state\n * });\n * ```\n */\n TASK_HOLD = 'task:hold',\n\n /**\n * Triggered when a task is resumed from hold\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RESUME, (task: ITask) => {\n * console.log('Task resumed from hold:', task.data.interactionId);\n * // Update UI to show active state\n * });\n * ```\n */\n TASK_RESUME = 'task:resume',\n\n /**\n * Triggered when a consultation session ends\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_END, (task: ITask) => {\n * console.log('Consultation ended:', task.data.interactionId);\n * // Clean up consultation resources\n * });\n * ```\n */\n TASK_CONSULT_END = 'task:consultEnd',\n\n /**\n * Triggered when a queue consultation is cancelled\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, (task: ITask) => {\n * console.log('Queue consultation cancelled:', task.data.interactionId);\n * // Handle consultation cancellation\n * });\n * ```\n */\n TASK_CONSULT_QUEUE_CANCELLED = 'task:consultQueueCancelled',\n\n /**\n * Triggered when a queue consultation fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_QUEUE_FAILED, (task: ITask) => {\n * console.log('Queue consultation failed:', task.data.interactionId);\n * // Handle consultation failure\n * });\n * ```\n */\n TASK_CONSULT_QUEUE_FAILED = 'task:consultQueueFailed',\n\n /**\n * Triggered when a consultation request is accepted\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_ACCEPTED, (task: ITask) => {\n * console.log('Consultation accepted:', task.data.interactionId);\n * // Begin consultation\n * });\n * ```\n */\n TASK_CONSULT_ACCEPTED = 'task:consultAccepted',\n\n /**\n * Triggered when consultation is in progress\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULTING, (task: ITask) => {\n * console.log('Consulting in progress:', task.data.interactionId);\n * // Handle ongoing consultation\n * });\n * ```\n */\n TASK_CONSULTING = 'task:consulting',\n\n /**\n * Triggered when a new consultation is created\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_CREATED, (task: ITask) => {\n * console.log('Consultation created:', task.data.interactionId);\n * // Initialize consultation\n * });\n * ```\n */\n TASK_CONSULT_CREATED = 'task:consultCreated',\n\n /**\n * Triggered when a consultation is offered\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_OFFER_CONSULT, (task: ITask) => {\n * console.log('Consultation offered:', task.data.interactionId);\n * // Handle consultation offer\n * });\n * ```\n */\n TASK_OFFER_CONSULT = 'task:offerConsult',\n\n /**\n * Triggered when a task is completed/terminated\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_END, (task: ITask) => {\n * console.log('Task ended:', task.data.interactionId);\n * // Clean up and finalize task\n * });\n * ```\n */\n TASK_END = 'task:end',\n\n /**\n * Triggered when a task enters wrap-up state\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_WRAPUP, (task: ITask) => {\n * console.log('Task in wrap-up:', task.data.interactionId);\n * // Begin wrap-up process\n * });\n * ```\n */\n TASK_WRAPUP = 'task:wrapup',\n\n /**\n * Triggered when task wrap-up is completed\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_WRAPPEDUP, (task: ITask) => {\n * console.log('Task wrapped up:', task.data.interactionId);\n * // Finalize task completion\n * });\n * ```\n */\n TASK_WRAPPEDUP = 'task:wrappedup',\n\n /**\n * Triggered when recording is paused\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_PAUSED, (task: ITask) => {\n * console.log('Recording paused:', task.data.interactionId);\n * // Update recording state\n * });\n * ```\n */\n TASK_RECORDING_PAUSED = 'task:recordingPaused',\n\n /**\n * Triggered when recording pause attempt fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_PAUSE_FAILED, (task: ITask) => {\n * console.log('Recording pause failed:', task.data.interactionId);\n * // Handle pause failure\n * });\n * ```\n */\n TASK_RECORDING_PAUSE_FAILED = 'task:recordingPauseFailed',\n\n /**\n * Triggered when recording is resumed\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_RESUMED, (task: ITask) => {\n * console.log('Recording resumed:', task.data.interactionId);\n * // Update recording state\n * });\n * ```\n */\n TASK_RECORDING_RESUMED = 'task:recordingResumed',\n\n /**\n * Triggered when recording resume attempt fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_RESUME_FAILED, (task: ITask) => {\n * console.log('Recording resume failed:', task.data.interactionId);\n * // Handle resume failure\n * });\n * ```\n */\n TASK_RECORDING_RESUME_FAILED = 'task:recordingResumeFailed',\n\n /**\n * Triggered when a task is rejected/unanswered\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_REJECT, (task: ITask) => {\n * console.log('Task rejected:', task.data.interactionId);\n * // Handle task rejection\n * });\n * ```\n */\n TASK_REJECT = 'task:rejected',\n\n /**\n * Triggered when a task is populated with data\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_HYDRATE, (task: ITask) => {\n * console.log('Task hydrated:', task.data.interactionId);\n * // Process task data\n * });\n * ```\n */\n TASK_HYDRATE = 'task:hydrate',\n\n /**\n * Triggered when a new contact is offered\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_OFFER_CONTACT, (task: ITask) => {\n * console.log('Contact offered:', task.data.interactionId);\n * // Handle contact offer\n * });\n * ```\n */\n TASK_OFFER_CONTACT = 'task:offerContact',\n}\n\n/**\n * Represents a customer interaction within the contact center system\n * Contains comprehensive details about an ongoing customer interaction\n * @public\n */\nexport type Interaction = {\n /** Indicates if the interaction is managed by Flow Control */\n isFcManaged: boolean;\n /** Indicates if the interaction has been terminated */\n isTerminated: boolean;\n /** The type of media channel for this interaction */\n mediaType: MEDIA_CHANNEL;\n /** List of previous virtual teams that handled this interaction */\n previousVTeams: string[];\n /** Current state of the interaction */\n state: string;\n /** Current virtual team handling the interaction */\n currentVTeam: string;\n /** List of participants in the interaction */\n participants: any; // TODO: Define specific participant type\n /** Unique identifier for the interaction */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Timestamp when the interaction was created */\n createdTimestamp?: number;\n /** Indicates if wrap-up assistance is enabled */\n isWrapUpAssist?: boolean;\n /** Detailed call processing information and metadata */\n callProcessingDetails: {\n /** Name of the Queue Manager handling this interaction */\n QMgrName: string;\n /** Indicates if the task should be self-serviced */\n taskToBeSelfServiced: string;\n /** Automatic Number Identification (caller's number) */\n ani: string;\n /** Display version of the ANI */\n displayAni: string;\n /** Dialed Number Identification Service number */\n dnis: string;\n /** Tenant identifier */\n tenantId: string;\n /** Queue identifier */\n QueueId: string;\n /** Virtual team identifier */\n vteamId: string;\n /** Indicates if pause/resume functionality is enabled */\n pauseResumeEnabled?: string;\n /** Duration of pause in seconds */\n pauseDuration?: string;\n /** Indicates if the interaction is currently paused */\n isPaused?: string;\n /** Indicates if recording is in progress */\n recordInProgress?: string;\n /** Indicates if recording has started */\n recordingStarted?: string;\n /** Indicates if Consult to Queue is in progress */\n ctqInProgress?: string;\n /** Indicates if outdial transfer to queue is enabled */\n outdialTransferToQueueEnabled?: string;\n /** IVR conversation transcript */\n convIvrTranscript?: string;\n /** Customer's name */\n customerName: string;\n /** Name of the virtual team */\n virtualTeamName: string;\n /** RONA (Redirection on No Answer) timeout in seconds */\n ronaTimeout: string;\n /** Category of the interaction */\n category: string;\n /** Reason for the interaction */\n reason: string;\n /** Source number for the interaction */\n sourceNumber: string;\n /** Source page that initiated the interaction */\n sourcePage: string;\n /** Application user identifier */\n appUser: string;\n /** Customer's contact number */\n customerNumber: string;\n /** Code indicating the reason for interaction */\n reasonCode: string;\n /** Path taken through the IVR system */\n IvrPath: string;\n /** Identifier for the IVR path */\n pathId: string;\n /** Email address or contact point that initiated the interaction */\n fromAddress: string;\n /** Identifier of the parent interaction for related interactions */\n parentInteractionId?: string;\n /** Identifier of the child interaction for related interactions */\n childInteractionId?: string;\n /** Type of relationship between parent and child interactions */\n relationshipType?: string;\n /** ANI of the parent interaction */\n parent_ANI?: string;\n /** DNIS of the parent interaction */\n parent_DNIS?: string;\n /** Indicates if the consulted destination agent has joined */\n consultDestinationAgentJoined?: boolean | string;\n /** Name of the destination agent for consultation */\n consultDestinationAgentName?: string;\n /** DN of the parent interaction's agent */\n parent_Agent_DN?: string;\n /** Name of the parent interaction's agent */\n parent_Agent_Name?: string;\n /** Team name of the parent interaction's agent */\n parent_Agent_TeamName?: string;\n /** Indicates if the interaction is in conference mode */\n isConferencing?: string;\n /** Type of monitoring being performed */\n monitorType?: string;\n /** Name of the workflow being executed */\n workflowName?: string;\n /** Identifier of the workflow */\n workflowId?: string;\n /** Indicates if monitoring is in invisible mode */\n monitoringInvisibleMode?: string;\n /** Identifier for the monitoring request */\n monitoringRequestId?: string;\n /** Timeout for participant invitation */\n participantInviteTimeout?: string;\n /** Filename for music on hold */\n mohFileName?: string;\n /** Flag for continuing recording during transfer */\n CONTINUE_RECORDING_ON_TRANSFER?: string;\n /** Entry point identifier */\n EP_ID?: string;\n /** Type of routing being used */\n ROUTING_TYPE?: string;\n /** Events registered with Flow Control Engine */\n fceRegisteredEvents?: string;\n /** Indicates if the interaction is parked */\n isParked?: string;\n /** Priority level of the interaction */\n priority?: string;\n /** Identifier for the routing strategy */\n routingStrategyId?: string;\n /** Current state of monitoring */\n monitoringState?: string;\n /** Indicates if blind transfer is in progress */\n BLIND_TRANSFER_IN_PROGRESS?: boolean;\n /** Desktop view configuration for Flow Control */\n fcDesktopView?: string;\n };\n /** Main interaction identifier for related interactions */\n mainInteractionId?: string;\n /** Media-specific information for the interaction */\n media: Record<\n string,\n {\n /** Unique identifier for the media resource */\n mediaResourceId: string;\n /** Type of media channel */\n mediaType: MEDIA_CHANNEL;\n /** Media manager handling this media */\n mediaMgr: string;\n /** List of participant identifiers */\n participants: string[];\n /** Type of media */\n mType: string;\n /** Indicates if media is on hold */\n isHold: boolean;\n /** Timestamp when media was put on hold */\n holdTimestamp: number | null;\n }\n >;\n /** Owner of the interaction */\n owner: string;\n /** Primary media channel for the interaction */\n mediaChannel: MEDIA_CHANNEL;\n /** Direction information for the contact */\n contactDirection: {type: string};\n /** Type of outbound interaction */\n outboundType?: string;\n /** Parameters passed through the call flow */\n callFlowParams: Record<\n string,\n {\n /** Name of the parameter */\n name: string;\n /** Qualifier for the parameter */\n qualifier: string;\n /** Description of the parameter */\n description: string;\n /** Data type of the parameter value */\n valueDataType: string;\n /** Value of the parameter */\n value: string;\n }\n >;\n};\n\n/**\n * Task payload containing detailed information about a contact center task\n * This structure encapsulates all relevant data for task management\n * @public\n */\nexport type TaskData = {\n /** Unique identifier for the media resource handling this task */\n mediaResourceId: string;\n /** Type of event that triggered this task data */\n eventType: string;\n /** Timestamp when the event occurred */\n eventTime?: number;\n /** Identifier of the agent handling the task */\n agentId: string;\n /** Identifier of the destination agent for transfers/consults */\n destAgentId: string;\n /** Unique tracking identifier for the task */\n trackingId: string;\n /** Media resource identifier for consultation operations */\n consultMediaResourceId: string;\n /** Detailed interaction information */\n interaction: Interaction;\n /** Unique identifier for the participant */\n participantId?: string;\n /** Indicates if the task is from the owner */\n fromOwner?: boolean;\n /** Indicates if the task is to the owner */\n toOwner?: boolean;\n /** Identifier for child interaction in consult/transfer scenarios */\n childInteractionId?: string;\n /** Unique identifier for the interaction */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Current owner of the task */\n owner: string;\n /** Queue manager handling the task */\n queueMgr: string;\n /** Name of the queue where task is queued */\n queueName?: string;\n /** Type of the task */\n type: string;\n /** Timeout value for RONA (Redirection on No Answer) in seconds */\n ronaTimeout?: number;\n /** Indicates if the task is in consultation state */\n isConsulted?: boolean;\n /** Indicates if the task is in conference state */\n isConferencing: boolean;\n /** Identifier of agent who last updated the task */\n updatedBy?: string;\n /** Type of destination for transfer/consult */\n destinationType?: string;\n /** Indicates if the task was automatically resumed */\n autoResumed?: boolean;\n /** Code indicating the reason for an action */\n reasonCode?: string | number;\n /** Description of the reason for an action */\n reason?: string;\n /** Identifier of the consulting agent */\n consultingAgentId?: string;\n /** Unique identifier for the task */\n taskId?: string;\n /** Task details including state and media information */\n task?: Interaction;\n /** Unique identifier for monitoring offered events */\n id?: string;\n /** Indicates if the web call is muted */\n isWebCallMute?: boolean;\n /** Identifier for reservation interaction */\n reservationInteractionId?: string;\n /** Indicates if wrap-up is required for this task */\n wrapUpRequired?: boolean;\n};\n\n/**\n * Type representing an agent contact message within the contact center system\n * Contains comprehensive interaction and task related details for agent operations\n * @public\n */\nexport type AgentContact = Msg<{\n /** Unique identifier for the media resource */\n mediaResourceId: string;\n /** Type of the event (e.g., 'AgentDesktopMessage') */\n eventType: string;\n /** Timestamp when the event occurred */\n eventTime?: number;\n /** Unique identifier of the agent handling the contact */\n agentId: string;\n /** Identifier of the destination agent for transfers/consults */\n destAgentId: string;\n /** Unique tracking identifier for the contact */\n trackingId: string;\n /** Media resource identifier for consult operations */\n consultMediaResourceId: string;\n /** Detailed interaction information including media and participant data */\n interaction: Interaction;\n /** Unique identifier for the participant */\n participantId?: string;\n /** Indicates if the message is from the owner of the interaction */\n fromOwner?: boolean;\n /** Indicates if the message is to the owner of the interaction */\n toOwner?: boolean;\n /** Identifier for child interaction in case of consult/transfer */\n childInteractionId?: string;\n /** Unique identifier for the interaction */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Current owner of the interaction */\n owner: string;\n /** Queue manager handling the interaction */\n queueMgr: string;\n /** Name of the queue where interaction is queued */\n queueName?: string;\n /** Type of the contact/interaction */\n type: string;\n /** Timeout value for RONA (Redirection on No Answer) in seconds */\n ronaTimeout?: number;\n /** Indicates if the interaction is in consult state */\n isConsulted?: boolean;\n /** Indicates if the interaction is in conference state */\n isConferencing: boolean;\n /** Identifier of the agent who last updated the interaction */\n updatedBy?: string;\n /** Type of destination for transfer/consult */\n destinationType?: string;\n /** Indicates if the interaction was automatically resumed */\n autoResumed?: boolean;\n /** Code indicating the reason for an action */\n reasonCode?: string | number;\n /** Description of the reason for an action */\n reason?: string;\n /** Identifier of the consulting agent */\n consultingAgentId?: string;\n /** Unique identifier for the task */\n taskId?: string;\n /** Task details including media and state information */\n task?: Interaction;\n /** Identifier of the supervisor monitoring the interaction */\n supervisorId?: string;\n /** Type of monitoring (e.g., 'SILENT', 'BARGE_IN') */\n monitorType?: string;\n /** Dial number of the supervisor */\n supervisorDN?: string;\n /** Unique identifier for monitoring offered events */\n id?: string;\n /** Indicates if the web call is muted */\n isWebCallMute?: boolean;\n /** Identifier for reservation interaction */\n reservationInteractionId?: string;\n /** Identifier for the reserved agent channel */\n reservedAgentChannelId?: string;\n /** Current monitoring state information */\n monitoringState?: {\n /** Type of monitoring state */\n type: string;\n };\n /** Name of the supervisor monitoring the interaction */\n supervisorName?: string;\n}>;\n\n/**\n * Information about a virtual team in the contact center\n * @ignore\n */\nexport type VTeam = {\n /** Profile ID of the agent in the virtual team */\n agentProfileId: string;\n /** Session ID of the agent in the virtual team */\n agentSessionId: string;\n /** Type of channel handled by the virtual team */\n channelType: string;\n /** Type of the virtual team */\n type: string;\n /** Optional tracking identifier */\n trackingId?: string;\n};\n\n/**\n * Detailed information about a virtual team configuration\n * @ignore\n */\nexport type VteamDetails = {\n /** Name of the virtual team */\n name: string;\n /** Type of channel handled by the virtual team */\n channelType: string;\n /** Unique identifier for the virtual team */\n id: string;\n /** Type of the virtual team */\n type: string;\n /** ID of the analyzer associated with the team */\n analyzerId: string;\n};\n\n/**\n * Response type for successful virtual team operations\n * Contains details about virtual teams and their capabilities\n * @ignore\n */\nexport type VTeamSuccess = Msg<{\n /** Response data containing team information */\n data: {\n /** List of virtual team details */\n vteamList: Array<VteamDetails>;\n /** Whether queue consultation is allowed */\n allowConsultToQueue: boolean;\n };\n /** Method name from JavaScript */\n jsMethod: string;\n /** Data related to the call */\n callData: string;\n /** Session ID of the agent */\n agentSessionId: string;\n}>;\n\n/**\n * Parameters for putting a task on hold or resuming from hold\n * @public\n */\nexport type HoldResumePayload = {\n /** Unique identifier for the media resource to hold/resume */\n mediaResourceId: string;\n};\n\n/**\n * Parameters for resuming a task's recording\n * @public\n */\nexport type ResumeRecordingPayload = {\n /** Indicates if the recording was automatically resumed */\n autoResumed: boolean;\n};\n\n/**\n * Parameters for transferring a task to another destination\n * @public\n */\nexport type TransferPayLoad = {\n /** Destination identifier where the task will be transferred to */\n to: string;\n /** Type of the destination (queue, agent, etc.) */\n destinationType: DestinationType;\n};\n\n/**\n * Parameters for initiating a consultative transfer\n * @public\n */\nexport type ConsultTransferPayLoad = {\n /** Destination identifier for the consultation transfer */\n to: string;\n /** Type of the consultation transfer destination */\n destinationType: ConsultTransferDestinationType;\n};\n\n/**\n * Parameters for initiating a consultation with another agent or queue\n * @public\n */\nexport type ConsultPayload = {\n /** Destination identifier for the consultation */\n to: string | undefined;\n /** Type of the consultation destination (agent, queue, etc.) */\n destinationType: DestinationType;\n /** Whether to hold other participants during consultation (always true) */\n holdParticipants?: boolean;\n};\n\n/**\n * Parameters for ending a consultation task\n * @public\n */\nexport type ConsultEndPayload = {\n /** Indicates if this is a consultation operation */\n isConsult: boolean;\n /** Indicates if this involves a secondary entry point or DN agent */\n isSecondaryEpDnAgent?: boolean;\n /** Optional queue identifier for the consultation */\n queueId?: string;\n /** Identifier of the task being consulted */\n taskId: string;\n};\n\n/**\n * Parameters for transferring a task to another destination\n * @public\n */\nexport type TransferPayload = {\n /** Destination identifier where the task will be transferred */\n to: string | undefined;\n /** Type of the transfer destination */\n destinationType: DestinationType;\n};\n\n/**\n * API payload for ending a consultation\n * This is the actual payload that is sent to the developer API\n * @public\n */\nexport type ConsultEndAPIPayload = {\n /** Optional identifier of the queue involved in the consultation */\n queueId?: string;\n};\n\n/**\n * Data required for consulting and conferencing operations\n * @public\n */\nexport type ConsultConferenceData = {\n /** Identifier of the agent initiating consult/conference */\n agentId?: string;\n /** Target destination for the consult/conference */\n to: string | undefined;\n /** Type of destination (e.g., 'agent', 'queue') */\n destinationType: string;\n};\n\n/**\n * Parameters required for cancelling a consult to queue operation\n * @public\n */\nexport type cancelCtq = {\n /** Identifier of the agent cancelling the CTQ */\n agentId: string;\n /** Identifier of the queue where consult was initiated */\n queueId: string;\n};\n\n/**\n * Parameters required for declining a task\n * @public\n */\nexport type declinePayload = {\n /** Identifier of the media resource to decline */\n mediaResourceId: string;\n};\n\n/**\n * Parameters for wrapping up a task with relevant completion details\n * @public\n */\nexport type WrapupPayLoad = {\n /** The reason provided for wrapping up the task */\n wrapUpReason: string;\n /** Auxiliary code identifier associated with the wrap-up state */\n auxCodeId: string;\n};\n\n/**\n * Configuration parameters for initiating outbound dialer tasks\n * @public\n */\nexport type DialerPayload = {\n /** An entryPointId for respective task */\n entryPointId: string;\n /** A valid customer DN, on which the response is expected, maximum length 36 characters */\n destination: string;\n /** The direction of the call */\n direction: 'OUTBOUND';\n /** Schema-free data tuples to pass specific data based on outboundType (max 30 tuples) */\n attributes: {[key: string]: string};\n /** The media type for the request */\n mediaType: 'telephony' | 'chat' | 'social' | 'email';\n /** The outbound type for the task */\n outboundType: 'OUTDIAL' | 'CALLBACK' | 'EXECUTE_FLOW';\n};\n\n/**\n * Data structure for cleaning up contact resources\n * @public\n */\nexport type ContactCleanupData = {\n /** Type of cleanup operation being performed */\n type: string;\n /** Organization identifier where cleanup is occurring */\n orgId: string;\n /** Identifier of the agent associated with the contacts */\n agentId: string;\n /** Detailed data about the cleanup operation */\n data: {\n /** Type of event that triggered the cleanup */\n eventType: string;\n /** Identifier of the interaction being cleaned up */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Media manager handling the cleanup */\n mediaMgr: string;\n /** Tracking identifier for the cleanup operation */\n trackingId: string;\n /** Type of media being cleaned up */\n mediaType: string;\n /** Optional destination information */\n destination?: string;\n /** Whether this is a broadcast cleanup */\n broadcast: boolean;\n /** Type of cleanup being performed */\n type: string;\n };\n};\n\n/**\n * Response type for task public methods\n * Can be an {@link AgentContact} object containing updated task state,\n * an Error in case of failure, or void for operations that don't return data\n * @public\n */\nexport type TaskResponse = AgentContact | Error | void;\n\n/**\n * Interface for managing task-related operations in the contact center\n * Extends EventEmitter to support event-driven task updates\n */\nexport interface ITask extends EventEmitter {\n /**\n * Event data received in the Contact Center events.\n * Contains detailed task information including interaction details, media resources,\n * and participant data as defined in {@link TaskData}\n */\n data: TaskData;\n\n /**\n * Map associating tasks with their corresponding call identifiers.\n */\n webCallMap: Record<TaskId, CallId>;\n\n /**\n * Auto-wrapup timer for the task\n * This is used to automatically wrap up tasks after a specified duration\n * as defined in {@link AutoWrapup}\n */\n autoWrapup?: AutoWrapup;\n\n /**\n * cancels the auto-wrapup timer for the task\n * This method stops the auto-wrapup process if it is currently active\n * Note: This is supported only in single session mode. Not supported in multi-session mode.\n * @returns void\n */\n cancelAutoWrapupTimer(): void;\n\n /**\n * Deregisters all web call event listeners\n * Used when cleaning up task resources\n * @ignore\n */\n unregisterWebCallListeners(): void;\n\n /**\n * Updates the task data with new information\n * @param newData - Updated task data to apply, must conform to {@link TaskData} structure\n * @returns Updated task instance\n * @ignore\n */\n updateTaskData(newData: TaskData): ITask;\n\n /**\n * Answers or accepts an incoming task.\n * Once accepted, the task will be assigned to the agent and trigger a {@link TASK_EVENTS.TASK_ASSIGNED} event.\n * The response will contain updated agent contact information as defined in {@link AgentContact}.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.accept();\n * ```\n */\n accept(): Promise<TaskResponse>;\n\n /**\n * Declines an incoming task for Browser Login\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.decline();\n * ```\n */\n decline(): Promise<TaskResponse>;\n\n /**\n * Places the current task on hold\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.hold();\n * ```\n */\n hold(): Promise<TaskResponse>;\n\n /**\n * Resumes a task that was previously on hold\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.resume();\n * ```\n */\n resume(): Promise<TaskResponse>;\n\n /**\n * Ends/terminates the current task\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.end();\n * ```\n */\n end(): Promise<TaskResponse>;\n\n /**\n * Initiates wrap-up process for the task with specified details\n * @param wrapupPayload - Wrap-up details including reason and auxiliary code\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.wrapup({\n * wrapUpReason: \"Customer issue resolved\",\n * auxCodeId: \"RESOLVED\"\n * });\n * ```\n */\n wrapup(wrapupPayload: WrapupPayLoad): Promise<TaskResponse>;\n\n /**\n * Pauses the recording for current task\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.pauseRecording();\n * ```\n */\n pauseRecording(): Promise<TaskResponse>;\n\n /**\n * Resumes a previously paused recording\n * @param resumeRecordingPayload - Parameters for resuming the recording\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.resumeRecording({\n * autoResumed: false\n * });\n * ```\n */\n resumeRecording(resumeRecordingPayload: ResumeRecordingPayload): Promise<TaskResponse>;\n}\n"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC9B;EACAE,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE,YAAY;EACxB;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMC,iCAAiC,GAAAL,OAAA,CAAAK,iCAAA,GAAG;EAC/C;EACAF,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE,YAAY;EACxB;EACAF,UAAU,EAAE,YAAY;EACxB;EACAD,KAAK,EAAE;AACT,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMK,aAAa,GAAAN,OAAA,CAAAM,aAAA,GAAG;EAC3B;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,IAAI,EAAE,MAAM;EACZ;EACAC,SAAS,EAA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