@webex/contact-center 3.10.0-next.7 → 3.10.0-next.8
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/dist/cc.js +11 -0
- package/dist/cc.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/services/config/types.js +2 -2
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/core/Utils.js +90 -71
- package/dist/services/core/Utils.js.map +1 -1
- package/dist/services/core/constants.js +17 -1
- package/dist/services/core/constants.js.map +1 -1
- package/dist/services/task/TaskManager.js +61 -36
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/TaskUtils.js +33 -5
- package/dist/services/task/TaskUtils.js.map +1 -1
- package/dist/services/task/index.js +49 -58
- package/dist/services/task/index.js.map +1 -1
- package/dist/services/task/types.js +2 -4
- package/dist/services/task/types.js.map +1 -1
- package/dist/types/cc.d.ts +6 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/services/config/types.d.ts +4 -4
- package/dist/types/services/core/Utils.d.ts +32 -17
- package/dist/types/services/core/constants.d.ts +14 -0
- package/dist/types/services/task/TaskUtils.d.ts +17 -3
- package/dist/types/services/task/types.d.ts +25 -13
- package/dist/webex.js +1 -1
- package/package.json +1 -1
- package/src/cc.ts +11 -0
- package/src/index.ts +1 -0
- package/src/services/config/types.ts +2 -2
- package/src/services/core/Utils.ts +101 -85
- package/src/services/core/constants.ts +16 -0
- package/src/services/task/TaskManager.ts +75 -28
- package/src/services/task/TaskUtils.ts +37 -5
- package/src/services/task/index.ts +54 -89
- package/src/services/task/types.ts +26 -13
- package/test/unit/spec/services/core/Utils.ts +262 -31
- package/test/unit/spec/services/task/TaskManager.ts +224 -1
- package/test/unit/spec/services/task/TaskUtils.ts +6 -6
- package/test/unit/spec/services/task/index.ts +283 -86
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
|
@@ -1 +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 * Triggered when a conference is being established\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_ESTABLISHING, (task: ITask) => {\n * console.log('Conference establishing:', task.data.interactionId);\n * // Handle conference setup in progress\n * });\n * ```\n */\n TASK_CONFERENCE_ESTABLISHING = 'task:conferenceEstablishing',\n\n /**\n * Triggered when a conference is started successfully\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_STARTED, (task: ITask) => {\n * console.log('Conference started:', task.data.interactionId);\n * // Handle conference start\n * });\n * ```\n */\n TASK_CONFERENCE_STARTED = 'task:conferenceStarted',\n\n /**\n * Triggered when a conference fails to start\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_FAILED, (task: ITask) => {\n * console.log('Conference failed:', task.data.interactionId);\n * // Handle conference failure\n * });\n * ```\n */\n TASK_CONFERENCE_FAILED = 'task:conferenceFailed',\n\n /**\n * Triggered when a conference is ended successfully\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_ENDED, (task: ITask) => {\n * console.log('Conference ended:', task.data.interactionId);\n * // Handle conference end\n * });\n * ```\n */\n TASK_CONFERENCE_ENDED = 'task:conferenceEnded',\n\n /**\n * Triggered when a participant joins the conference\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_JOINED, (task: ITask) => {\n * console.log('Participant joined conference:', task.data.interactionId);\n * // Handle participant joining\n * });\n * ```\n */\n TASK_PARTICIPANT_JOINED = 'task:participantJoined',\n\n /**\n * Triggered when a participant leaves the conference\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT, (task: ITask) => {\n * console.log('Participant left conference:', task.data.interactionId);\n * // Handle participant leaving\n * });\n * ```\n */\n TASK_PARTICIPANT_LEFT = 'task:participantLeft',\n\n /**\n * Triggered when conference transfer is successful\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFERRED, (task: ITask) => {\n * console.log('Conference transferred:', task.data.interactionId);\n * // Handle successful conference transfer\n * });\n * ```\n */\n TASK_CONFERENCE_TRANSFERRED = 'task:conferenceTransferred',\n\n /**\n * Triggered when conference transfer fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFER_FAILED, (task: ITask) => {\n * console.log('Conference transfer failed:', task.data.interactionId);\n * // Handle failed conference transfer\n * });\n * ```\n */\n TASK_CONFERENCE_TRANSFER_FAILED = 'task:conferenceTransferFailed',\n\n /**\n * Triggered when ending a conference fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_END_FAILED, (task: ITask) => {\n * console.log('Conference end failed:', task.data.interactionId);\n * // Handle failed conference end\n * });\n * ```\n */\n TASK_CONFERENCE_END_FAILED = 'task:conferenceEndFailed',\n\n /**\n * Triggered when participant exit from conference fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT_FAILED, (task: ITask) => {\n * console.log('Participant failed to leave conference:', task.data.interactionId);\n * // Handle failed participant exit\n * });\n * ```\n */\n TASK_PARTICIPANT_LEFT_FAILED = 'task:participantLeftFailed',\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 /** Indicates if a conference is currently in progress (2+ active agents) */\n isConferenceInProgress?: 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 * Legacy consultation conference data type matching Agent Desktop\n * @public\n */\nexport type consultConferencePayloadData = {\n /** Identifier of the agent initiating consult/conference */\n agentId: string;\n /** Type of destination (e.g., 'agent', 'queue') */\n destinationType: string;\n /** Identifier of the destination agent */\n destAgentId: 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 /** The Outdial ANI number that will be used while making a call to the customer. */\n origin: string;\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 * await 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 * await task.decline();\n * ```\n */\n decline(): Promise<TaskResponse>;\n\n /**\n * Places the current task on hold.\n * @param mediaResourceId - Optional media resource ID to use for the hold operation. If not provided, uses the task's current mediaResourceId\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * // Hold with default mediaResourceId\n * await task.hold();\n *\n * // Hold with custom mediaResourceId\n * await task.hold('custom-media-resource-id');\n * ```\n */\n hold(mediaResourceId?: string): Promise<TaskResponse>;\n\n /**\n * Resumes a task that was previously on hold.\n * @param mediaResourceId - Optional media resource ID to use for the resume operation. If not provided, uses the task's current mediaResourceId from interaction media\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * // Resume with default mediaResourceId\n * await task.resume();\n *\n * // Resume with custom mediaResourceId\n * await task.resume('custom-media-resource-id');\n * ```\n */\n resume(mediaResourceId?: string): Promise<TaskResponse>;\n\n /**\n * Ends/terminates the current task.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await 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 * await 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 * await 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 * await task.resumeRecording({\n * autoResumed: false\n * });\n * ```\n */\n resumeRecording(resumeRecordingPayload: ResumeRecordingPayload): Promise<TaskResponse>;\n\n /**\n * Initiates a consultation with another agent or queue.\n * @param consultPayload - Consultation details including destination and type\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.consult({ to: \"agentId\", destinationType: \"agent\" });\n * ```\n */\n consult(consultPayload: ConsultPayload): Promise<TaskResponse>;\n\n /**\n * Ends an ongoing consultation.\n * @param consultEndPayload - Details for ending the consultation\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.endConsult({ isConsult: true, taskId: \"taskId\" });\n * ```\n */\n endConsult(consultEndPayload: ConsultEndPayload): Promise<TaskResponse>;\n\n /**\n * Transfers the task to another agent or queue.\n * @param transferPayload - Transfer details including destination and type\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.transfer({ to: \"queueId\", destinationType: \"queue\" });\n * ```\n */\n transfer(transferPayload: TransferPayLoad): Promise<TaskResponse>;\n\n /**\n * Transfers the task after consultation.\n * @param consultTransferPayload - Details for consult transfer (optional)\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.consultTransfer({ to: \"agentId\", destinationType: \"agent\" });\n * ```\n */\n consultTransfer(consultTransferPayload?: ConsultTransferPayLoad): Promise<TaskResponse>;\n\n /**\n * Initiates a consult conference (merge consult call with main call).\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.consultConference();\n * ```\n */\n consultConference(): Promise<TaskResponse>;\n\n /**\n * Exits from an ongoing conference.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.exitConference();\n * ```\n */\n exitConference(): Promise<TaskResponse>;\n\n /**\n * Transfers the conference to another participant.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.transferConference();\n * ```\n */\n transferConference(): Promise<TaskResponse>;\n\n /**\n * Toggles mute/unmute for the local audio stream during a WebRTC task.\n * @returns Promise<void>\n * @example\n * ```typescript\n * await task.toggleMute();\n * ```\n */\n toggleMute(): Promise<void>;\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,EAAE,WAAW;EACtB;EACAC,MAAM,EAAE,QAAQ;EAChB;EACAC,GAAG,EAAE,KAAK;EACV;EACAC,QAAQ,EAAE,UAAU;EACpB;EACAC,QAAQ,EAAE;AACZ,CAAU;;AAEV;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAJA,IAKYC,WAAW,GAAAd,OAAA,CAAAc,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AA6YvB;AACA;AACA;AACA;AACA;AA6LA;AACA;AACA;AACA;AACA;AAwEA;AACA;AACA;AACA;AACA;AAmFA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AA+BA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA"}
|
|
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 * Triggered when a conference is being established\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_ESTABLISHING, (task: ITask) => {\n * console.log('Conference establishing:', task.data.interactionId);\n * // Handle conference setup in progress\n * });\n * ```\n */\n TASK_CONFERENCE_ESTABLISHING = 'task:conferenceEstablishing',\n\n /**\n * Triggered when a conference is started successfully\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_STARTED, (task: ITask) => {\n * console.log('Conference started:', task.data.interactionId);\n * // Handle conference start\n * });\n * ```\n */\n TASK_CONFERENCE_STARTED = 'task:conferenceStarted',\n\n /**\n * Triggered when a conference fails to start\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_FAILED, (task: ITask) => {\n * console.log('Conference failed:', task.data.interactionId);\n * // Handle conference failure\n * });\n * ```\n */\n TASK_CONFERENCE_FAILED = 'task:conferenceFailed',\n\n /**\n * Triggered when a conference is ended successfully\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_ENDED, (task: ITask) => {\n * console.log('Conference ended:', task.data.interactionId);\n * // Handle conference end\n * });\n * ```\n */\n TASK_CONFERENCE_ENDED = 'task:conferenceEnded',\n\n /**\n * Triggered when a participant joins the conference\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_JOINED, (task: ITask) => {\n * console.log('Participant joined conference:', task.data.interactionId);\n * // Handle participant joining\n * });\n * ```\n */\n TASK_PARTICIPANT_JOINED = 'task:participantJoined',\n\n /**\n * Triggered when a participant leaves the conference\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT, (task: ITask) => {\n * console.log('Participant left conference:', task.data.interactionId);\n * // Handle participant leaving\n * });\n * ```\n */\n TASK_PARTICIPANT_LEFT = 'task:participantLeft',\n\n /**\n * Triggered when conference transfer is successful\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFERRED, (task: ITask) => {\n * console.log('Conference transferred:', task.data.interactionId);\n * // Handle successful conference transfer\n * });\n * ```\n */\n TASK_CONFERENCE_TRANSFERRED = 'task:conferenceTransferred',\n\n /**\n * Triggered when conference transfer fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFER_FAILED, (task: ITask) => {\n * console.log('Conference transfer failed:', task.data.interactionId);\n * // Handle failed conference transfer\n * });\n * ```\n */\n TASK_CONFERENCE_TRANSFER_FAILED = 'task:conferenceTransferFailed',\n\n /**\n * Triggered when ending a conference fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_END_FAILED, (task: ITask) => {\n * console.log('Conference end failed:', task.data.interactionId);\n * // Handle failed conference end\n * });\n * ```\n */\n TASK_CONFERENCE_END_FAILED = 'task:conferenceEndFailed',\n\n /**\n * Triggered when participant exit from conference fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT_FAILED, (task: ITask) => {\n * console.log('Participant failed to leave conference:', task.data.interactionId);\n * // Handle failed participant exit\n * });\n * ```\n */\n TASK_PARTICIPANT_LEFT_FAILED = 'task:participantLeftFailed',\n\n /**\n * Triggered when a contact is merged\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_MERGED, (task: ITask) => {\n * console.log('Contact merged:', task.data.interactionId);\n * // Handle contact merge\n * });\n * ```\n */\n TASK_MERGED = 'task:merged',\n\n /**\n * Triggered when a participant enters post-call activity state\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_POST_CALL_ACTIVITY, (task: ITask) => {\n * console.log('Participant in post-call activity:', task.data.interactionId);\n * // Handle post-call activity\n * });\n * ```\n */\n TASK_POST_CALL_ACTIVITY = 'task:postCallActivity',\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 /** Indicates if a conference is currently in progress (2+ active agents) */\n isConferenceInProgress?: 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 /** Identifier for the reserved agent channel (used for campaign tasks) */\n reservedAgentChannelId?: 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 /** The Outdial ANI number that will be used while making a call to the customer. */\n origin: string;\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 * await 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 * await task.decline();\n * ```\n */\n decline(): Promise<TaskResponse>;\n\n /**\n * Places the current task on hold.\n * @param mediaResourceId - Optional media resource ID to use for the hold operation. If not provided, uses the task's current mediaResourceId\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * // Hold with default mediaResourceId\n * await task.hold();\n *\n * // Hold with custom mediaResourceId\n * await task.hold('custom-media-resource-id');\n * ```\n */\n hold(mediaResourceId?: string): Promise<TaskResponse>;\n\n /**\n * Resumes a task that was previously on hold.\n * @param mediaResourceId - Optional media resource ID to use for the resume operation. If not provided, uses the task's current mediaResourceId from interaction media\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * // Resume with default mediaResourceId\n * await task.resume();\n *\n * // Resume with custom mediaResourceId\n * await task.resume('custom-media-resource-id');\n * ```\n */\n resume(mediaResourceId?: string): Promise<TaskResponse>;\n\n /**\n * Ends/terminates the current task.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await 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 * await 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 * await 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 * await task.resumeRecording({\n * autoResumed: false\n * });\n * ```\n */\n resumeRecording(resumeRecordingPayload: ResumeRecordingPayload): Promise<TaskResponse>;\n\n /**\n * Initiates a consultation with another agent or queue.\n * @param consultPayload - Consultation details including destination and type\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.consult({ to: \"agentId\", destinationType: \"agent\" });\n * ```\n */\n consult(consultPayload: ConsultPayload): Promise<TaskResponse>;\n\n /**\n * Ends an ongoing consultation.\n * @param consultEndPayload - Details for ending the consultation\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.endConsult({ isConsult: true, taskId: \"taskId\" });\n * ```\n */\n endConsult(consultEndPayload: ConsultEndPayload): Promise<TaskResponse>;\n\n /**\n * Transfers the task to another agent or queue.\n * @param transferPayload - Transfer details including destination and type\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.transfer({ to: \"queueId\", destinationType: \"queue\" });\n * ```\n */\n transfer(transferPayload: TransferPayLoad): Promise<TaskResponse>;\n\n /**\n * Transfers the task after consultation.\n * @param consultTransferPayload - Details for consult transfer (optional)\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.consultTransfer({ to: \"agentId\", destinationType: \"agent\" });\n * ```\n */\n consultTransfer(consultTransferPayload?: ConsultTransferPayLoad): Promise<TaskResponse>;\n\n /**\n * Initiates a consult conference (merge consult call with main call).\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.consultConference();\n * ```\n */\n consultConference(): Promise<TaskResponse>;\n\n /**\n * Exits from an ongoing conference.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.exitConference();\n * ```\n */\n exitConference(): Promise<TaskResponse>;\n\n /**\n * Transfers the conference to another participant.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.transferConference();\n * ```\n */\n transferConference(): Promise<TaskResponse>;\n\n /**\n * Toggles mute/unmute for the local audio stream during a WebRTC task.\n * @returns Promise<void>\n * @example\n * ```typescript\n * await task.toggleMute();\n * ```\n */\n toggleMute(): Promise<void>;\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,EAAE,WAAW;EACtB;EACAC,MAAM,EAAE,QAAQ;EAChB;EACAC,GAAG,EAAE,KAAK;EACV;EACAC,QAAQ,EAAE,UAAU;EACpB;EACAC,QAAQ,EAAE;AACZ,CAAU;;AAEV;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAJA,IAKYC,WAAW,GAAAd,OAAA,CAAAc,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAqavB;AACA;AACA;AACA;AACA;AA6LA;AACA;AACA;AACA;AACA;AA0EA;AACA;AACA;AACA;AACA;AAmFA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AA+BA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA"}
|
package/dist/types/cc.d.ts
CHANGED
|
@@ -274,6 +274,12 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
274
274
|
* @param {ITask} task The task object to be hydrated with additional data
|
|
275
275
|
*/
|
|
276
276
|
private handleTaskHydrate;
|
|
277
|
+
/**
|
|
278
|
+
* Handles task merged events when tasks are combined eg: EPDN merge/transfer
|
|
279
|
+
* @private
|
|
280
|
+
* @param {ITask} task The task object that has been merged
|
|
281
|
+
*/
|
|
282
|
+
private handleTaskMerged;
|
|
277
283
|
/**
|
|
278
284
|
* Sets up event listeners for incoming tasks and task hydration
|
|
279
285
|
* Subscribes to task events from the task manager
|
package/dist/types/index.d.ts
CHANGED
|
@@ -92,7 +92,7 @@ SetStateResponse, } from './types';
|
|
|
92
92
|
/** Task related types */
|
|
93
93
|
export type { AgentContact,
|
|
94
94
|
/** Task interface */
|
|
95
|
-
ITask, TaskData,
|
|
95
|
+
ITask, Interaction, TaskData,
|
|
96
96
|
/** Task response */
|
|
97
97
|
TaskResponse, ConsultPayload, ConsultEndPayload, ConsultTransferPayLoad,
|
|
98
98
|
/** Dialer payload */
|
|
@@ -56,8 +56,6 @@ export declare const CC_TASK_EVENTS: {
|
|
|
56
56
|
readonly AGENT_CONFERENCE_TRANSFERRED: "AgentConferenceTransferred";
|
|
57
57
|
/** Event emitted when conference transfer fails */
|
|
58
58
|
readonly AGENT_CONFERENCE_TRANSFER_FAILED: "AgentConferenceTransferFailed";
|
|
59
|
-
/** Event emitted when consulted participant is moving/being transferred */
|
|
60
|
-
readonly CONSULTED_PARTICIPANT_MOVING: "ConsultedParticipantMoving";
|
|
61
59
|
/** Event emitted for post-call activity by participant */
|
|
62
60
|
readonly PARTICIPANT_POST_CALL_ACTIVITY: "ParticipantPostCallActivity";
|
|
63
61
|
/** Event emitted when contact is blind transferred */
|
|
@@ -84,6 +82,8 @@ export declare const CC_TASK_EVENTS: {
|
|
|
84
82
|
readonly CONTACT_RECORDING_RESUME_FAILED: "ContactRecordingResumeFailed";
|
|
85
83
|
/** Event emitted when contact ends */
|
|
86
84
|
readonly CONTACT_ENDED: "ContactEnded";
|
|
85
|
+
/** Event emitted when contact is merged */
|
|
86
|
+
readonly CONTACT_MERGED: "ContactMerged";
|
|
87
87
|
/** Event emitted when ending contact fails */
|
|
88
88
|
readonly AGENT_CONTACT_END_FAILED: "AgentContactEndFailed";
|
|
89
89
|
/** Event emitted when agent enters wrap-up state */
|
|
@@ -205,8 +205,6 @@ export declare const CC_EVENTS: {
|
|
|
205
205
|
readonly AGENT_CONFERENCE_TRANSFERRED: "AgentConferenceTransferred";
|
|
206
206
|
/** Event emitted when conference transfer fails */
|
|
207
207
|
readonly AGENT_CONFERENCE_TRANSFER_FAILED: "AgentConferenceTransferFailed";
|
|
208
|
-
/** Event emitted when consulted participant is moving/being transferred */
|
|
209
|
-
readonly CONSULTED_PARTICIPANT_MOVING: "ConsultedParticipantMoving";
|
|
210
208
|
/** Event emitted for post-call activity by participant */
|
|
211
209
|
readonly PARTICIPANT_POST_CALL_ACTIVITY: "ParticipantPostCallActivity";
|
|
212
210
|
/** Event emitted when contact is blind transferred */
|
|
@@ -233,6 +231,8 @@ export declare const CC_EVENTS: {
|
|
|
233
231
|
readonly CONTACT_RECORDING_RESUME_FAILED: "ContactRecordingResumeFailed";
|
|
234
232
|
/** Event emitted when contact ends */
|
|
235
233
|
readonly CONTACT_ENDED: "ContactEnded";
|
|
234
|
+
/** Event emitted when contact is merged */
|
|
235
|
+
readonly CONTACT_MERGED: "ContactMerged";
|
|
236
236
|
/** Event emitted when ending contact fails */
|
|
237
237
|
readonly AGENT_CONTACT_END_FAILED: "AgentContactEndFailed";
|
|
238
238
|
/** Event emitted when agent enters wrap-up state */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Err from './Err';
|
|
2
2
|
import { LoginOption, WebexRequestPayload } from '../../types';
|
|
3
3
|
import { Failure, AugmentedError } from './GlobalTypes';
|
|
4
|
-
import { TaskData, ConsultTransferPayLoad,
|
|
4
|
+
import { TaskData, ConsultTransferPayLoad, Interaction } from '../task/types';
|
|
5
5
|
export declare const isValidDialNumber: (input: string) => boolean;
|
|
6
6
|
export declare const getStationLoginErrorData: (failure: Failure, loginOption: LoginOption) => {
|
|
7
7
|
message: any;
|
|
@@ -51,25 +51,40 @@ export declare const generateTaskErrorObject: (error: any, methodName: string, m
|
|
|
51
51
|
*/
|
|
52
52
|
export declare const createErrDetailsObject: (errObj: WebexRequestPayload) => Err.Details<"Service.reqs.generic.failure">;
|
|
53
53
|
/**
|
|
54
|
-
* Gets the
|
|
55
|
-
*
|
|
54
|
+
* Gets the consulted agent ID from the media object by finding the agent
|
|
55
|
+
* in the consult media participants (excluding the current agent).
|
|
56
56
|
*
|
|
57
|
-
* @param
|
|
57
|
+
* @param media - The media object from the interaction
|
|
58
58
|
* @param agentId - The current agent's ID to exclude from the search
|
|
59
|
-
* @returns The
|
|
59
|
+
* @returns The consulted agent ID, or empty string if none found
|
|
60
60
|
*/
|
|
61
|
-
export declare const
|
|
62
|
-
export declare const deriveConsultTransferDestinationType: (taskData?: TaskData) => ConsultTransferPayLoad['destinationType'];
|
|
61
|
+
export declare const getConsultedAgentId: (media: Interaction['media'], agentId: string) => string;
|
|
63
62
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
63
|
+
* Gets the destination agent ID for CBT (Capacity Based Team) scenarios.
|
|
64
|
+
* CBT refers to teams created in Control Hub with capacity-based routing
|
|
65
|
+
* (as opposed to agent-based routing). This handles cases where the consulted
|
|
66
|
+
* participant is not directly in participants but can be found by matching
|
|
67
|
+
* the dial number (dn).
|
|
66
68
|
*
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
69
|
-
* @returns
|
|
70
|
-
* @public
|
|
69
|
+
* @param interaction - The interaction object
|
|
70
|
+
* @param consultingAgent - The consulting agent identifier
|
|
71
|
+
* @returns The destination agent ID for CBT scenarios, or empty string if none found
|
|
71
72
|
*/
|
|
72
|
-
export declare const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
export declare const getDestAgentIdForCBT: (interaction: Interaction, consultingAgent: string) => string;
|
|
74
|
+
/**
|
|
75
|
+
* Calculates the destination agent ID for consult operations.
|
|
76
|
+
*
|
|
77
|
+
* @param interaction - The interaction object
|
|
78
|
+
* @param agentId - The current agent's ID
|
|
79
|
+
* @returns The destination agent ID
|
|
80
|
+
*/
|
|
81
|
+
export declare const calculateDestAgentId: (interaction: Interaction, agentId: string) => string;
|
|
82
|
+
/**
|
|
83
|
+
* Calculates the destination agent ID for fetching destination type.
|
|
84
|
+
*
|
|
85
|
+
* @param interaction - The interaction object
|
|
86
|
+
* @param agentId - The current agent's ID
|
|
87
|
+
* @returns The destination agent ID for determining destination type
|
|
88
|
+
*/
|
|
89
|
+
export declare const calculateDestType: (interaction: Interaction, agentId: string) => string;
|
|
90
|
+
export declare const deriveConsultTransferDestinationType: (taskData?: TaskData) => ConsultTransferPayLoad['destinationType'];
|
|
@@ -53,6 +53,20 @@ export declare const CONNECTIVITY_CHECK_INTERVAL = 5000;
|
|
|
53
53
|
* @ignore
|
|
54
54
|
*/
|
|
55
55
|
export declare const CLOSE_SOCKET_TIMEOUT = 16000;
|
|
56
|
+
/**
|
|
57
|
+
* Constants for participant types, destination types, and interaction states
|
|
58
|
+
* @ignore
|
|
59
|
+
*/
|
|
60
|
+
export declare const PARTICIPANT_TYPES: {
|
|
61
|
+
/** Participant type for Entry Point Dial Number */
|
|
62
|
+
EP_DN: string;
|
|
63
|
+
/** Participant type for dial number */
|
|
64
|
+
DN: string;
|
|
65
|
+
/** Participant type for Agent */
|
|
66
|
+
AGENT: string;
|
|
67
|
+
};
|
|
68
|
+
/** Interaction state for consultation */
|
|
69
|
+
export declare const STATE_CONSULT = "consult";
|
|
56
70
|
export declare const METHODS: {
|
|
57
71
|
REQUEST: string;
|
|
58
72
|
UPLOAD_LOGS: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ITask } from './types';
|
|
1
|
+
import { Interaction, ITask, TaskData } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Determines if the given agent is the primary agent (owner) of the task
|
|
4
4
|
* @param task - The task to check
|
|
@@ -22,7 +22,21 @@ export declare const isParticipantInMainInteraction: (task: ITask, agentId: stri
|
|
|
22
22
|
export declare const checkParticipantNotInInteraction: (task: ITask, agentId: string) => boolean;
|
|
23
23
|
/**
|
|
24
24
|
* Determines if a conference is currently in progress based on the number of active agent participants
|
|
25
|
-
* @param
|
|
25
|
+
* @param TaskData - The payLoad data to check for conference status
|
|
26
26
|
* @returns true if there are 2 or more active agent participants in the main call, false otherwise
|
|
27
27
|
*/
|
|
28
|
-
export declare const getIsConferenceInProgress: (
|
|
28
|
+
export declare const getIsConferenceInProgress: (data: TaskData) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Checks if the current agent is a secondary agent in a consultation scenario.
|
|
31
|
+
* Secondary agents are those who were consulted (not the original call owner).
|
|
32
|
+
* @param task - The task object containing interaction details
|
|
33
|
+
* @returns true if this is a secondary agent (consulted party), false otherwise
|
|
34
|
+
*/
|
|
35
|
+
export declare const isSecondaryAgent: (interaction: Interaction) => boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Checks if the current agent is a secondary EP-DN (Entry Point Dial Number) agent.
|
|
38
|
+
* This is specifically for telephony consultations to external numbers/entry points.
|
|
39
|
+
* @param task - The task object containing interaction details
|
|
40
|
+
* @returns true if this is a secondary EP-DN agent in telephony consultation, false otherwise
|
|
41
|
+
*/
|
|
42
|
+
export declare const isSecondaryEpDnAgent: (interaction: Interaction) => boolean;
|
|
@@ -444,7 +444,29 @@ export declare enum TASK_EVENTS {
|
|
|
444
444
|
* });
|
|
445
445
|
* ```
|
|
446
446
|
*/
|
|
447
|
-
TASK_PARTICIPANT_LEFT_FAILED = "task:participantLeftFailed"
|
|
447
|
+
TASK_PARTICIPANT_LEFT_FAILED = "task:participantLeftFailed",
|
|
448
|
+
/**
|
|
449
|
+
* Triggered when a contact is merged
|
|
450
|
+
* @example
|
|
451
|
+
* ```typescript
|
|
452
|
+
* task.on(TASK_EVENTS.TASK_MERGED, (task: ITask) => {
|
|
453
|
+
* console.log('Contact merged:', task.data.interactionId);
|
|
454
|
+
* // Handle contact merge
|
|
455
|
+
* });
|
|
456
|
+
* ```
|
|
457
|
+
*/
|
|
458
|
+
TASK_MERGED = "task:merged",
|
|
459
|
+
/**
|
|
460
|
+
* Triggered when a participant enters post-call activity state
|
|
461
|
+
* @example
|
|
462
|
+
* ```typescript
|
|
463
|
+
* task.on(TASK_EVENTS.TASK_POST_CALL_ACTIVITY, (task: ITask) => {
|
|
464
|
+
* console.log('Participant in post-call activity:', task.data.interactionId);
|
|
465
|
+
* // Handle post-call activity
|
|
466
|
+
* });
|
|
467
|
+
* ```
|
|
468
|
+
*/
|
|
469
|
+
TASK_POST_CALL_ACTIVITY = "task:postCallActivity"
|
|
448
470
|
}
|
|
449
471
|
/**
|
|
450
472
|
* Represents a customer interaction within the contact center system
|
|
@@ -706,6 +728,8 @@ export type TaskData = {
|
|
|
706
728
|
isWebCallMute?: boolean;
|
|
707
729
|
/** Identifier for reservation interaction */
|
|
708
730
|
reservationInteractionId?: string;
|
|
731
|
+
/** Identifier for the reserved agent channel (used for campaign tasks) */
|
|
732
|
+
reservedAgentChannelId?: string;
|
|
709
733
|
/** Indicates if wrap-up is required for this task */
|
|
710
734
|
wrapUpRequired?: boolean;
|
|
711
735
|
};
|
|
@@ -940,18 +964,6 @@ export type ConsultConferenceData = {
|
|
|
940
964
|
/** Type of destination (e.g., 'agent', 'queue') */
|
|
941
965
|
destinationType: string;
|
|
942
966
|
};
|
|
943
|
-
/**
|
|
944
|
-
* Legacy consultation conference data type matching Agent Desktop
|
|
945
|
-
* @public
|
|
946
|
-
*/
|
|
947
|
-
export type consultConferencePayloadData = {
|
|
948
|
-
/** Identifier of the agent initiating consult/conference */
|
|
949
|
-
agentId: string;
|
|
950
|
-
/** Type of destination (e.g., 'agent', 'queue') */
|
|
951
|
-
destinationType: string;
|
|
952
|
-
/** Identifier of the destination agent */
|
|
953
|
-
destAgentId: string;
|
|
954
|
-
};
|
|
955
967
|
/**
|
|
956
968
|
* Parameters required for cancelling a consult to queue operation
|
|
957
969
|
* @public
|
package/dist/webex.js
CHANGED
package/package.json
CHANGED
package/src/cc.ts
CHANGED
|
@@ -396,6 +396,16 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
396
396
|
this.trigger(TASK_EVENTS.TASK_HYDRATE, task);
|
|
397
397
|
};
|
|
398
398
|
|
|
399
|
+
/**
|
|
400
|
+
* Handles task merged events when tasks are combined eg: EPDN merge/transfer
|
|
401
|
+
* @private
|
|
402
|
+
* @param {ITask} task The task object that has been merged
|
|
403
|
+
*/
|
|
404
|
+
private handleTaskMerged = (task: ITask) => {
|
|
405
|
+
// @ts-ignore
|
|
406
|
+
this.trigger(TASK_EVENTS.TASK_MERGED, task);
|
|
407
|
+
};
|
|
408
|
+
|
|
399
409
|
/**
|
|
400
410
|
* Sets up event listeners for incoming tasks and task hydration
|
|
401
411
|
* Subscribes to task events from the task manager
|
|
@@ -404,6 +414,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
404
414
|
private incomingTaskListener() {
|
|
405
415
|
this.taskManager.on(TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);
|
|
406
416
|
this.taskManager.on(TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);
|
|
417
|
+
this.taskManager.on(TASK_EVENTS.TASK_MERGED, this.handleTaskMerged);
|
|
407
418
|
}
|
|
408
419
|
|
|
409
420
|
/**
|
package/src/index.ts
CHANGED
|
@@ -63,8 +63,6 @@ export const CC_TASK_EVENTS = {
|
|
|
63
63
|
AGENT_CONFERENCE_TRANSFERRED: 'AgentConferenceTransferred',
|
|
64
64
|
/** Event emitted when conference transfer fails */
|
|
65
65
|
AGENT_CONFERENCE_TRANSFER_FAILED: 'AgentConferenceTransferFailed',
|
|
66
|
-
/** Event emitted when consulted participant is moving/being transferred */
|
|
67
|
-
CONSULTED_PARTICIPANT_MOVING: 'ConsultedParticipantMoving',
|
|
68
66
|
/** Event emitted for post-call activity by participant */
|
|
69
67
|
PARTICIPANT_POST_CALL_ACTIVITY: 'ParticipantPostCallActivity',
|
|
70
68
|
/** Event emitted when contact is blind transferred */
|
|
@@ -91,6 +89,8 @@ export const CC_TASK_EVENTS = {
|
|
|
91
89
|
CONTACT_RECORDING_RESUME_FAILED: 'ContactRecordingResumeFailed',
|
|
92
90
|
/** Event emitted when contact ends */
|
|
93
91
|
CONTACT_ENDED: 'ContactEnded',
|
|
92
|
+
/** Event emitted when contact is merged */
|
|
93
|
+
CONTACT_MERGED: 'ContactMerged',
|
|
94
94
|
/** Event emitted when ending contact fails */
|
|
95
95
|
AGENT_CONTACT_END_FAILED: 'AgentContactEndFailed',
|
|
96
96
|
/** Event emitted when agent enters wrap-up state */
|