@webex/contact-center 3.9.0 → 3.10.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cc.js +196 -47
- package/dist/cc.js.map +1 -1
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/logger-proxy.js +24 -1
- package/dist/logger-proxy.js.map +1 -1
- package/dist/metrics/MetricsManager.js +1 -1
- package/dist/metrics/MetricsManager.js.map +1 -1
- package/dist/metrics/behavioral-events.js +89 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +32 -2
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/AddressBook.js +271 -0
- package/dist/services/AddressBook.js.map +1 -0
- package/dist/services/EntryPoint.js +227 -0
- package/dist/services/EntryPoint.js.map +1 -0
- package/dist/services/Queue.js +261 -0
- package/dist/services/Queue.js.map +1 -0
- package/dist/services/config/constants.js +36 -2
- package/dist/services/config/constants.js.map +1 -1
- package/dist/services/config/index.js +29 -21
- package/dist/services/config/index.js.map +1 -1
- package/dist/services/config/types.js +33 -1
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/core/GlobalTypes.js.map +1 -1
- package/dist/services/core/Utils.js +162 -2
- package/dist/services/core/Utils.js.map +1 -1
- package/dist/services/core/aqm-reqs.js +0 -4
- package/dist/services/core/aqm-reqs.js.map +1 -1
- package/dist/services/core/websocket/WebSocketManager.js +0 -4
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
- package/dist/services/task/TaskManager.js +114 -3
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/TaskUtils.js +76 -0
- package/dist/services/task/TaskUtils.js.map +1 -0
- package/dist/services/task/constants.js +26 -1
- package/dist/services/task/constants.js.map +1 -1
- package/dist/services/task/contact.js +86 -0
- package/dist/services/task/contact.js.map +1 -1
- package/dist/services/task/index.js +418 -87
- package/dist/services/task/index.js.map +1 -1
- package/dist/services/task/types.js +14 -0
- package/dist/services/task/types.js.map +1 -1
- package/dist/types/cc.d.ts +115 -35
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/metrics/constants.d.ts +25 -1
- package/dist/types/services/AddressBook.d.ts +74 -0
- package/dist/types/services/EntryPoint.d.ts +67 -0
- package/dist/types/services/Queue.d.ts +76 -0
- package/dist/types/services/config/constants.d.ts +35 -1
- package/dist/types/services/config/index.d.ts +6 -9
- package/dist/types/services/config/types.d.ts +79 -58
- package/dist/types/services/core/GlobalTypes.d.ts +25 -0
- package/dist/types/services/core/Utils.d.ts +40 -1
- package/dist/types/services/task/TaskUtils.d.ts +28 -0
- package/dist/types/services/task/constants.d.ts +23 -0
- package/dist/types/services/task/contact.d.ts +10 -0
- package/dist/types/services/task/index.d.ts +85 -4
- package/dist/types/services/task/types.d.ts +233 -21
- package/dist/types/types.d.ts +162 -0
- package/dist/types/utils/PageCache.d.ts +173 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/PageCache.js +192 -0
- package/dist/utils/PageCache.js.map +1 -0
- package/dist/webex.js +1 -1
- package/package.json +10 -9
- package/src/cc.ts +221 -52
- package/src/constants.ts +1 -0
- package/src/index.ts +16 -2
- package/src/logger-proxy.ts +24 -1
- package/src/metrics/MetricsManager.ts +1 -1
- package/src/metrics/behavioral-events.ts +94 -0
- package/src/metrics/constants.ts +37 -1
- package/src/services/AddressBook.ts +291 -0
- package/src/services/EntryPoint.ts +241 -0
- package/src/services/Queue.ts +277 -0
- package/src/services/config/constants.ts +42 -2
- package/src/services/config/index.ts +30 -30
- package/src/services/config/types.ts +59 -58
- package/src/services/core/GlobalTypes.ts +27 -0
- package/src/services/core/Utils.ts +199 -1
- package/src/services/core/aqm-reqs.ts +0 -5
- package/src/services/core/websocket/WebSocketManager.ts +0 -4
- package/src/services/task/TaskManager.ts +123 -5
- package/src/services/task/TaskUtils.ts +81 -0
- package/src/services/task/constants.ts +25 -0
- package/src/services/task/contact.ts +80 -0
- package/src/services/task/index.ts +510 -71
- package/src/services/task/types.ts +251 -20
- package/src/types.ts +180 -0
- package/src/utils/PageCache.ts +252 -0
- package/test/unit/spec/cc.ts +282 -85
- package/test/unit/spec/metrics/MetricsManager.ts +0 -1
- package/test/unit/spec/metrics/behavioral-events.ts +42 -0
- package/test/unit/spec/services/AddressBook.ts +332 -0
- package/test/unit/spec/services/EntryPoint.ts +259 -0
- package/test/unit/spec/services/Queue.ts +323 -0
- package/test/unit/spec/services/config/index.ts +279 -65
- package/test/unit/spec/services/core/Utils.ts +50 -0
- package/test/unit/spec/services/core/aqm-reqs.ts +1 -3
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +0 -4
- package/test/unit/spec/services/task/TaskManager.ts +390 -1
- package/test/unit/spec/services/task/TaskUtils.ts +131 -0
- package/test/unit/spec/services/task/contact.ts +31 -1
- package/test/unit/spec/services/task/index.ts +585 -130
- 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/**\n * Represents a customer interaction within the contact center system\n * Contains comprehensive details about an ongoing customer interaction\n * @public\n */\nexport type Interaction = {\n /** Indicates if the interaction is managed by Flow Control */\n isFcManaged: boolean;\n /** Indicates if the interaction has been terminated */\n isTerminated: boolean;\n /** The type of media channel for this interaction */\n mediaType: MEDIA_CHANNEL;\n /** List of previous virtual teams that handled this interaction */\n previousVTeams: string[];\n /** Current state of the interaction */\n state: string;\n /** Current virtual team handling the interaction */\n currentVTeam: string;\n /** List of participants in the interaction */\n participants: any; // TODO: Define specific participant type\n /** Unique identifier for the interaction */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Timestamp when the interaction was created */\n createdTimestamp?: number;\n /** Indicates if wrap-up assistance is enabled */\n isWrapUpAssist?: boolean;\n /** Detailed call processing information and metadata */\n callProcessingDetails: {\n /** Name of the Queue Manager handling this interaction */\n QMgrName: string;\n /** Indicates if the task should be self-serviced */\n taskToBeSelfServiced: string;\n /** Automatic Number Identification (caller's number) */\n ani: string;\n /** Display version of the ANI */\n displayAni: string;\n /** Dialed Number Identification Service number */\n dnis: string;\n /** Tenant identifier */\n tenantId: string;\n /** Queue identifier */\n QueueId: string;\n /** Virtual team identifier */\n vteamId: string;\n /** Indicates if pause/resume functionality is enabled */\n pauseResumeEnabled?: string;\n /** Duration of pause in seconds */\n pauseDuration?: string;\n /** Indicates if the interaction is currently paused */\n isPaused?: string;\n /** Indicates if recording is in progress */\n recordInProgress?: string;\n /** Indicates if recording has started */\n recordingStarted?: string;\n /** Indicates if Consult to Queue is in progress */\n ctqInProgress?: string;\n /** Indicates if outdial transfer to queue is enabled */\n outdialTransferToQueueEnabled?: string;\n /** IVR conversation transcript */\n convIvrTranscript?: string;\n /** Customer's name */\n customerName: string;\n /** Name of the virtual team */\n virtualTeamName: string;\n /** RONA (Redirection on No Answer) timeout in seconds */\n ronaTimeout: string;\n /** Category of the interaction */\n category: string;\n /** Reason for the interaction */\n reason: string;\n /** Source number for the interaction */\n sourceNumber: string;\n /** Source page that initiated the interaction */\n sourcePage: string;\n /** Application user identifier */\n appUser: string;\n /** Customer's contact number */\n customerNumber: string;\n /** Code indicating the reason for interaction */\n reasonCode: string;\n /** Path taken through the IVR system */\n IvrPath: string;\n /** Identifier for the IVR path */\n pathId: string;\n /** Email address or contact point that initiated the interaction */\n fromAddress: string;\n /** Identifier of the parent interaction for related interactions */\n parentInteractionId?: string;\n /** Identifier of the child interaction for related interactions */\n childInteractionId?: string;\n /** Type of relationship between parent and child interactions */\n relationshipType?: string;\n /** ANI of the parent interaction */\n parent_ANI?: string;\n /** DNIS of the parent interaction */\n parent_DNIS?: string;\n /** Indicates if the consulted destination agent has joined */\n consultDestinationAgentJoined?: boolean | string;\n /** Name of the destination agent for consultation */\n consultDestinationAgentName?: string;\n /** DN of the parent interaction's agent */\n parent_Agent_DN?: string;\n /** Name of the parent interaction's agent */\n parent_Agent_Name?: string;\n /** Team name of the parent interaction's agent */\n parent_Agent_TeamName?: string;\n /** Indicates if the interaction is in conference mode */\n isConferencing?: string;\n /** Type of monitoring being performed */\n monitorType?: string;\n /** Name of the workflow being executed */\n workflowName?: string;\n /** Identifier of the workflow */\n workflowId?: string;\n /** Indicates if monitoring is in invisible mode */\n monitoringInvisibleMode?: string;\n /** Identifier for the monitoring request */\n monitoringRequestId?: string;\n /** Timeout for participant invitation */\n participantInviteTimeout?: string;\n /** Filename for music on hold */\n mohFileName?: string;\n /** Flag for continuing recording during transfer */\n CONTINUE_RECORDING_ON_TRANSFER?: string;\n /** Entry point identifier */\n EP_ID?: string;\n /** Type of routing being used */\n ROUTING_TYPE?: string;\n /** Events registered with Flow Control Engine */\n fceRegisteredEvents?: string;\n /** Indicates if the interaction is parked */\n isParked?: string;\n /** Priority level of the interaction */\n priority?: string;\n /** Identifier for the routing strategy */\n routingStrategyId?: string;\n /** Current state of monitoring */\n monitoringState?: string;\n /** Indicates if blind transfer is in progress */\n BLIND_TRANSFER_IN_PROGRESS?: boolean;\n /** Desktop view configuration for Flow Control */\n fcDesktopView?: string;\n };\n /** Main interaction identifier for related interactions */\n mainInteractionId?: string;\n /** Media-specific information for the interaction */\n media: Record<\n string,\n {\n /** Unique identifier for the media resource */\n mediaResourceId: string;\n /** Type of media channel */\n mediaType: MEDIA_CHANNEL;\n /** Media manager handling this media */\n mediaMgr: string;\n /** List of participant identifiers */\n participants: string[];\n /** Type of media */\n mType: string;\n /** Indicates if media is on hold */\n isHold: boolean;\n /** Timestamp when media was put on hold */\n holdTimestamp: number | null;\n }\n >;\n /** Owner of the interaction */\n owner: string;\n /** Primary media channel for the interaction */\n mediaChannel: MEDIA_CHANNEL;\n /** Direction information for the contact */\n contactDirection: {type: string};\n /** Type of outbound interaction */\n outboundType?: string;\n /** Parameters passed through the call flow */\n callFlowParams: Record<\n string,\n {\n /** Name of the parameter */\n name: string;\n /** Qualifier for the parameter */\n qualifier: string;\n /** Description of the parameter */\n description: string;\n /** Data type of the parameter value */\n valueDataType: string;\n /** Value of the parameter */\n value: string;\n }\n >;\n};\n\n/**\n * Task payload containing detailed information about a contact center task\n * This structure encapsulates all relevant data for task management\n * @public\n */\nexport type TaskData = {\n /** Unique identifier for the media resource handling this task */\n mediaResourceId: string;\n /** Type of event that triggered this task data */\n eventType: string;\n /** Timestamp when the event occurred */\n eventTime?: number;\n /** Identifier of the agent handling the task */\n agentId: string;\n /** Identifier of the destination agent for transfers/consults */\n destAgentId: string;\n /** Unique tracking identifier for the task */\n trackingId: string;\n /** Media resource identifier for consultation operations */\n consultMediaResourceId: string;\n /** Detailed interaction information */\n interaction: Interaction;\n /** Unique identifier for the participant */\n participantId?: string;\n /** Indicates if the task is from the owner */\n fromOwner?: boolean;\n /** Indicates if the task is to the owner */\n toOwner?: boolean;\n /** Identifier for child interaction in consult/transfer scenarios */\n childInteractionId?: string;\n /** Unique identifier for the interaction */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Current owner of the task */\n owner: string;\n /** Queue manager handling the task */\n queueMgr: string;\n /** Name of the queue where task is queued */\n queueName?: string;\n /** Type of the task */\n type: string;\n /** Timeout value for RONA (Redirection on No Answer) in seconds */\n ronaTimeout?: number;\n /** Indicates if the task is in consultation state */\n isConsulted?: boolean;\n /** Indicates if the task is in conference state */\n isConferencing: boolean;\n /** Identifier of agent who last updated the task */\n updatedBy?: string;\n /** Type of destination for transfer/consult */\n destinationType?: string;\n /** Indicates if the task was automatically resumed */\n autoResumed?: boolean;\n /** Code indicating the reason for an action */\n reasonCode?: string | number;\n /** Description of the reason for an action */\n reason?: string;\n /** Identifier of the consulting agent */\n consultingAgentId?: string;\n /** Unique identifier for the task */\n taskId?: string;\n /** Task details including state and media information */\n task?: Interaction;\n /** Unique identifier for monitoring offered events */\n id?: string;\n /** Indicates if the web call is muted */\n isWebCallMute?: boolean;\n /** Identifier for reservation interaction */\n reservationInteractionId?: string;\n /** Indicates if wrap-up is required for this task */\n wrapUpRequired?: boolean;\n};\n\n/**\n * Type representing an agent contact message within the contact center system\n * Contains comprehensive interaction and task related details for agent operations\n * @public\n */\nexport type AgentContact = Msg<{\n /** Unique identifier for the media resource */\n mediaResourceId: string;\n /** Type of the event (e.g., 'AgentDesktopMessage') */\n eventType: string;\n /** Timestamp when the event occurred */\n eventTime?: number;\n /** Unique identifier of the agent handling the contact */\n agentId: string;\n /** Identifier of the destination agent for transfers/consults */\n destAgentId: string;\n /** Unique tracking identifier for the contact */\n trackingId: string;\n /** Media resource identifier for consult operations */\n consultMediaResourceId: string;\n /** Detailed interaction information including media and participant data */\n interaction: Interaction;\n /** Unique identifier for the participant */\n participantId?: string;\n /** Indicates if the message is from the owner of the interaction */\n fromOwner?: boolean;\n /** Indicates if the message is to the owner of the interaction */\n toOwner?: boolean;\n /** Identifier for child interaction in case of consult/transfer */\n childInteractionId?: string;\n /** Unique identifier for the interaction */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Current owner of the interaction */\n owner: string;\n /** Queue manager handling the interaction */\n queueMgr: string;\n /** Name of the queue where interaction is queued */\n queueName?: string;\n /** Type of the contact/interaction */\n type: string;\n /** Timeout value for RONA (Redirection on No Answer) in seconds */\n ronaTimeout?: number;\n /** Indicates if the interaction is in consult state */\n isConsulted?: boolean;\n /** Indicates if the interaction is in conference state */\n isConferencing: boolean;\n /** Identifier of the agent who last updated the interaction */\n updatedBy?: string;\n /** Type of destination for transfer/consult */\n destinationType?: string;\n /** Indicates if the interaction was automatically resumed */\n autoResumed?: boolean;\n /** Code indicating the reason for an action */\n reasonCode?: string | number;\n /** Description of the reason for an action */\n reason?: string;\n /** Identifier of the consulting agent */\n consultingAgentId?: string;\n /** Unique identifier for the task */\n taskId?: string;\n /** Task details including media and state information */\n task?: Interaction;\n /** Identifier of the supervisor monitoring the interaction */\n supervisorId?: string;\n /** Type of monitoring (e.g., 'SILENT', 'BARGE_IN') */\n monitorType?: string;\n /** Dial number of the supervisor */\n supervisorDN?: string;\n /** Unique identifier for monitoring offered events */\n id?: string;\n /** Indicates if the web call is muted */\n isWebCallMute?: boolean;\n /** Identifier for reservation interaction */\n reservationInteractionId?: string;\n /** Identifier for the reserved agent channel */\n reservedAgentChannelId?: string;\n /** Current monitoring state information */\n monitoringState?: {\n /** Type of monitoring state */\n type: string;\n };\n /** Name of the supervisor monitoring the interaction */\n supervisorName?: string;\n}>;\n\n/**\n * Information about a virtual team in the contact center\n * @ignore\n */\nexport type VTeam = {\n /** Profile ID of the agent in the virtual team */\n agentProfileId: string;\n /** Session ID of the agent in the virtual team */\n agentSessionId: string;\n /** Type of channel handled by the virtual team */\n channelType: string;\n /** Type of the virtual team */\n type: string;\n /** Optional tracking identifier */\n trackingId?: string;\n};\n\n/**\n * Detailed information about a virtual team configuration\n * @ignore\n */\nexport type VteamDetails = {\n /** Name of the virtual team */\n name: string;\n /** Type of channel handled by the virtual team */\n channelType: string;\n /** Unique identifier for the virtual team */\n id: string;\n /** Type of the virtual team */\n type: string;\n /** ID of the analyzer associated with the team */\n analyzerId: string;\n};\n\n/**\n * Response type for successful virtual team operations\n * Contains details about virtual teams and their capabilities\n * @ignore\n */\nexport type VTeamSuccess = Msg<{\n /** Response data containing team information */\n data: {\n /** List of virtual team details */\n vteamList: Array<VteamDetails>;\n /** Whether queue consultation is allowed */\n allowConsultToQueue: boolean;\n };\n /** Method name from JavaScript */\n jsMethod: string;\n /** Data related to the call */\n callData: string;\n /** Session ID of the agent */\n agentSessionId: string;\n}>;\n\n/**\n * Parameters for putting a task on hold or resuming from hold\n * @public\n */\nexport type HoldResumePayload = {\n /** Unique identifier for the media resource to hold/resume */\n mediaResourceId: string;\n};\n\n/**\n * Parameters for resuming a task's recording\n * @public\n */\nexport type ResumeRecordingPayload = {\n /** Indicates if the recording was automatically resumed */\n autoResumed: boolean;\n};\n\n/**\n * Parameters for transferring a task to another destination\n * @public\n */\nexport type TransferPayLoad = {\n /** Destination identifier where the task will be transferred to */\n to: string;\n /** Type of the destination (queue, agent, etc.) */\n destinationType: DestinationType;\n};\n\n/**\n * Parameters for initiating a consultative transfer\n * @public\n */\nexport type ConsultTransferPayLoad = {\n /** Destination identifier for the consultation transfer */\n to: string;\n /** Type of the consultation transfer destination */\n destinationType: ConsultTransferDestinationType;\n};\n\n/**\n * Parameters for initiating a consultation with another agent or queue\n * @public\n */\nexport type ConsultPayload = {\n /** Destination identifier for the consultation */\n to: string | undefined;\n /** Type of the consultation destination (agent, queue, etc.) */\n destinationType: DestinationType;\n /** Whether to hold other participants during consultation (always true) */\n holdParticipants?: boolean;\n};\n\n/**\n * Parameters for ending a consultation task\n * @public\n */\nexport type ConsultEndPayload = {\n /** Indicates if this is a consultation operation */\n isConsult: boolean;\n /** Indicates if this involves a secondary entry point or DN agent */\n isSecondaryEpDnAgent?: boolean;\n /** Optional queue identifier for the consultation */\n queueId?: string;\n /** Identifier of the task being consulted */\n taskId: string;\n};\n\n/**\n * Parameters for transferring a task to another destination\n * @public\n */\nexport type TransferPayload = {\n /** Destination identifier where the task will be transferred */\n to: string | undefined;\n /** Type of the transfer destination */\n destinationType: DestinationType;\n};\n\n/**\n * API payload for ending a consultation\n * This is the actual payload that is sent to the developer API\n * @public\n */\nexport type ConsultEndAPIPayload = {\n /** Optional identifier of the queue involved in the consultation */\n queueId?: string;\n};\n\n/**\n * Data required for consulting and conferencing operations\n * @public\n */\nexport type ConsultConferenceData = {\n /** Identifier of the agent initiating consult/conference */\n agentId?: string;\n /** Target destination for the consult/conference */\n to: string | undefined;\n /** Type of destination (e.g., 'agent', 'queue') */\n destinationType: string;\n};\n\n/**\n * Parameters required for cancelling a consult to queue operation\n * @public\n */\nexport type cancelCtq = {\n /** Identifier of the agent cancelling the CTQ */\n agentId: string;\n /** Identifier of the queue where consult was initiated */\n queueId: string;\n};\n\n/**\n * Parameters required for declining a task\n * @public\n */\nexport type declinePayload = {\n /** Identifier of the media resource to decline */\n mediaResourceId: string;\n};\n\n/**\n * Parameters for wrapping up a task with relevant completion details\n * @public\n */\nexport type WrapupPayLoad = {\n /** The reason provided for wrapping up the task */\n wrapUpReason: string;\n /** Auxiliary code identifier associated with the wrap-up state */\n auxCodeId: string;\n};\n\n/**\n * Configuration parameters for initiating outbound dialer tasks\n * @public\n */\nexport type DialerPayload = {\n /** An entryPointId for respective task */\n entryPointId: string;\n /** A valid customer DN, on which the response is expected, maximum length 36 characters */\n destination: string;\n /** The direction of the call */\n direction: 'OUTBOUND';\n /** Schema-free data tuples to pass specific data based on outboundType (max 30 tuples) */\n attributes: {[key: string]: string};\n /** The media type for the request */\n mediaType: 'telephony' | 'chat' | 'social' | 'email';\n /** The outbound type for the task */\n outboundType: 'OUTDIAL' | 'CALLBACK' | 'EXECUTE_FLOW';\n};\n\n/**\n * Data structure for cleaning up contact resources\n * @public\n */\nexport type ContactCleanupData = {\n /** Type of cleanup operation being performed */\n type: string;\n /** Organization identifier where cleanup is occurring */\n orgId: string;\n /** Identifier of the agent associated with the contacts */\n agentId: string;\n /** Detailed data about the cleanup operation */\n data: {\n /** Type of event that triggered the cleanup */\n eventType: string;\n /** Identifier of the interaction being cleaned up */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Media manager handling the cleanup */\n mediaMgr: string;\n /** Tracking identifier for the cleanup operation */\n trackingId: string;\n /** Type of media being cleaned up */\n mediaType: string;\n /** Optional destination information */\n destination?: string;\n /** Whether this is a broadcast cleanup */\n broadcast: boolean;\n /** Type of cleanup being performed */\n type: string;\n };\n};\n\n/**\n * Response type for task public methods\n * Can be an {@link AgentContact} object containing updated task state,\n * an Error in case of failure, or void for operations that don't return data\n * @public\n */\nexport type TaskResponse = AgentContact | Error | void;\n\n/**\n * Interface for managing task-related operations in the contact center\n * Extends EventEmitter to support event-driven task updates\n */\nexport interface ITask extends EventEmitter {\n /**\n * Event data received in the Contact Center events.\n * Contains detailed task information including interaction details, media resources,\n * and participant data as defined in {@link TaskData}\n */\n data: TaskData;\n\n /**\n * Map associating tasks with their corresponding call identifiers.\n */\n webCallMap: Record<TaskId, CallId>;\n\n /**\n * Auto-wrapup timer for the task\n * This is used to automatically wrap up tasks after a specified duration\n * as defined in {@link AutoWrapup}\n */\n autoWrapup?: AutoWrapup;\n\n /**\n * cancels the auto-wrapup timer for the task\n * This method stops the auto-wrapup process if it is currently active\n * Note: This is supported only in single session mode. Not supported in multi-session mode.\n * @returns void\n */\n cancelAutoWrapupTimer(): void;\n\n /**\n * Deregisters all web call event listeners\n * Used when cleaning up task resources\n * @ignore\n */\n unregisterWebCallListeners(): void;\n\n /**\n * Updates the task data with new information\n * @param newData - Updated task data to apply, must conform to {@link TaskData} structure\n * @returns Updated task instance\n * @ignore\n */\n updateTaskData(newData: TaskData): ITask;\n\n /**\n * Answers or accepts an incoming task.\n * Once accepted, the task will be assigned to the agent and trigger a {@link TASK_EVENTS.TASK_ASSIGNED} event.\n * The response will contain updated agent contact information as defined in {@link AgentContact}.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.accept();\n * ```\n */\n accept(): Promise<TaskResponse>;\n\n /**\n * Declines an incoming task for Browser Login\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.decline();\n * ```\n */\n decline(): Promise<TaskResponse>;\n\n /**\n * Places the current task on hold\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.hold();\n * ```\n */\n hold(): Promise<TaskResponse>;\n\n /**\n * Resumes a task that was previously on hold\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.resume();\n * ```\n */\n resume(): Promise<TaskResponse>;\n\n /**\n * Ends/terminates the current task\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.end();\n * ```\n */\n end(): Promise<TaskResponse>;\n\n /**\n * Initiates wrap-up process for the task with specified details\n * @param wrapupPayload - Wrap-up details including reason and auxiliary code\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.wrapup({\n * wrapUpReason: \"Customer issue resolved\",\n * auxCodeId: \"RESOLVED\"\n * });\n * ```\n */\n wrapup(wrapupPayload: WrapupPayLoad): Promise<TaskResponse>;\n\n /**\n * Pauses the recording for current task\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.pauseRecording();\n * ```\n */\n pauseRecording(): Promise<TaskResponse>;\n\n /**\n * Resumes a previously paused recording\n * @param resumeRecordingPayload - Parameters for resuming the recording\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * task.resumeRecording({\n * autoResumed: false\n * });\n * ```\n */\n resumeRecording(resumeRecordingPayload: ResumeRecordingPayload): Promise<TaskResponse>;\n}\n"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC9B;EACAE,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE,YAAY;EACxB;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMC,iCAAiC,GAAAL,OAAA,CAAAK,iCAAA,GAAG;EAC/C;EACAF,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE,YAAY;EACxB;EACAF,UAAU,EAAE,YAAY;EACxB;EACAD,KAAK,EAAE;AACT,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMK,aAAa,GAAAN,OAAA,CAAAM,aAAA,GAAG;EAC3B;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,IAAI,EAAE,MAAM;EACZ;EACAC,SAAS,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;EAAA,OAAXA,WAAW;AAAA;AAqRvB;AACA;AACA;AACA;AACA;AA6LA;AACA;AACA;AACA;AACA;AAsEA;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;AAgBA;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/**\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"}
|
package/dist/types/cc.d.ts
CHANGED
|
@@ -9,8 +9,10 @@ import { WebexPlugin } from '@webex/webex-core';
|
|
|
9
9
|
import { SetStateResponse, IContactCenter, AgentLogin, AgentProfileUpdate, StationLoginResponse, StationLogoutResponse, BuddyAgentsResponse, BuddyAgents, UploadLogsResponse, UpdateDeviceTypeResponse } from './types';
|
|
10
10
|
import LoggerProxy from './logger-proxy';
|
|
11
11
|
import { StateChange, Logout } from './services/agent/types';
|
|
12
|
-
import { Profile,
|
|
12
|
+
import { Profile, OutdialAniEntriesResponse, OutdialAniParams } from './services/config/types';
|
|
13
13
|
import { TaskResponse } from './services/task/types';
|
|
14
|
+
import AddressBook from './services/AddressBook';
|
|
15
|
+
import type { EntryPointListResponse, EntryPointSearchParams, ContactServiceQueuesResponse, ContactServiceQueueSearchParams } from './types';
|
|
14
16
|
/**
|
|
15
17
|
* The main Contact Center plugin class that enables integration with Webex Contact Center.
|
|
16
18
|
*
|
|
@@ -185,6 +187,68 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
185
187
|
* @private
|
|
186
188
|
*/
|
|
187
189
|
private metricsManager;
|
|
190
|
+
/**
|
|
191
|
+
* API instance for managing Webex Contact Center entry points
|
|
192
|
+
* Provides functionality to fetch entry points with caching support
|
|
193
|
+
* @type {EntryPoint}
|
|
194
|
+
* @public
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* const cc = webex.cc;
|
|
198
|
+
* await cc.register();
|
|
199
|
+
* await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
|
|
200
|
+
*
|
|
201
|
+
* // Access EntryPointRecord
|
|
202
|
+
* const response = await cc.entryPoint.getEntryPoints({
|
|
203
|
+
* page: 0,
|
|
204
|
+
* pageSize: 50
|
|
205
|
+
* });
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
private entryPoint;
|
|
209
|
+
/**
|
|
210
|
+
* API instance for managing Webex Contact Center address book contacts
|
|
211
|
+
* Provides functionality to fetch address book entries with caching support
|
|
212
|
+
* @type {AddressBook}
|
|
213
|
+
* @public
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* const cc = webex.cc;
|
|
217
|
+
* await cc.register();
|
|
218
|
+
* await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
|
|
219
|
+
*
|
|
220
|
+
* // Access AddressBook API
|
|
221
|
+
* const response = await cc.addressBook.getEntries({
|
|
222
|
+
* page: 0,
|
|
223
|
+
* pageSize: 25
|
|
224
|
+
* });
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
addressBook: AddressBook;
|
|
228
|
+
/**
|
|
229
|
+
* API instance for managing Webex Contact Center queues
|
|
230
|
+
* Provides functionality to fetch queues with caching support
|
|
231
|
+
* @type {Queue}
|
|
232
|
+
* @public
|
|
233
|
+
* @example
|
|
234
|
+
* ```typescript
|
|
235
|
+
* const cc = webex.cc;
|
|
236
|
+
* await cc.register();
|
|
237
|
+
* await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
|
|
238
|
+
*
|
|
239
|
+
* // Access Queue API
|
|
240
|
+
* const response = await cc.queue.getQueues({
|
|
241
|
+
* page: 0,
|
|
242
|
+
* pageSize: 50
|
|
243
|
+
* });
|
|
244
|
+
*
|
|
245
|
+
* // Filter queues by specific criteria
|
|
246
|
+
* const filteredQueues = await cc.queue.getQueues({
|
|
247
|
+
* filter: 'id=="queue-id-123"'
|
|
248
|
+
* });
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
private queue;
|
|
188
252
|
/**
|
|
189
253
|
* Logger utility for Contact Center plugin
|
|
190
254
|
* Provides consistent logging across the plugin
|
|
@@ -476,6 +540,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
476
540
|
* Makes an outbound call to a specified phone number.
|
|
477
541
|
*
|
|
478
542
|
* @param {string} destination - The phone number to dial (e.g., '+1234567890').
|
|
543
|
+
* @param {string} origin - The contact center number that will be used while making a call to the customer.
|
|
479
544
|
* Should include country code and be in E.164 format.
|
|
480
545
|
* @returns {Promise<TaskResponse>} Resolves with the task response containing:
|
|
481
546
|
* - interactionId: Unique identifier for the outbound call
|
|
@@ -511,7 +576,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
511
576
|
*
|
|
512
577
|
* // Start the outbound call
|
|
513
578
|
* const destination = '+1234567890';
|
|
514
|
-
* const task = await cc.startOutdial(destination);
|
|
579
|
+
* const task = await cc.startOutdial(destination, origin);
|
|
515
580
|
*
|
|
516
581
|
* // Listen for all relevant task events
|
|
517
582
|
* task.on('task:ringing', () => {
|
|
@@ -579,49 +644,52 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
579
644
|
* }
|
|
580
645
|
* ```
|
|
581
646
|
*/
|
|
582
|
-
startOutdial(destination: string): Promise<TaskResponse>;
|
|
647
|
+
startOutdial(destination: string, origin: string): Promise<TaskResponse>;
|
|
583
648
|
/**
|
|
584
|
-
*
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
* @
|
|
649
|
+
* Fetches outdial ANI (Automatic Number Identification) entries for an outdial ANI ID.
|
|
650
|
+
*
|
|
651
|
+
* This method retrieves the list of phone numbers that can be used as caller ID when making
|
|
652
|
+
* outbound calls. The ANI data is associated with an outdial ANI ID and can be filtered
|
|
653
|
+
* and paginated as needed.
|
|
654
|
+
*
|
|
655
|
+
* @param {string} outdialANI - The outdial ANI ID to fetch ANI data for
|
|
656
|
+
* @param {number} [page] - Optional page number for pagination (0-based)
|
|
657
|
+
* @param {number} [pageSize] - Optional number of items per page
|
|
658
|
+
* @param {string} [search] - Optional search term to filter results by name or number
|
|
659
|
+
* @param {string} [filter] - Optional filter string
|
|
660
|
+
* @param {string} [attributes] - Optional attributes to include in response
|
|
661
|
+
* @returns {Promise<OutdialAniEntriesResponse>} Promise resolving to outdial ANI response containing:
|
|
662
|
+
* - data: Array of ANI entries with number and name
|
|
663
|
+
* - meta: Pagination metadata
|
|
664
|
+
* @throws {Error} If the operation fails or agent is not registered
|
|
591
665
|
* @public
|
|
592
666
|
* @example
|
|
593
667
|
* ```typescript
|
|
594
668
|
* const cc = webex.cc;
|
|
595
669
|
* await cc.register();
|
|
596
|
-
* await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
|
|
597
670
|
*
|
|
598
|
-
* //
|
|
599
|
-
* const
|
|
600
|
-
*
|
|
601
|
-
*
|
|
602
|
-
*
|
|
603
|
-
*
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
* 0,
|
|
609
|
-
*
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
* name: queue.queueName,
|
|
617
|
-
* channelType: queue.channelType,
|
|
618
|
-
* isActive: queue.isActive,
|
|
619
|
-
* description: queue.description
|
|
620
|
-
* });
|
|
671
|
+
* // Get agent profile to obtain outdial ANI ID
|
|
672
|
+
* const agentProfile = cc.agentConfig;
|
|
673
|
+
* const outdialANI = agentProfile.outdialANIId;
|
|
674
|
+
*
|
|
675
|
+
* // Basic usage - get all ANI data for an outdial ANI ID
|
|
676
|
+
* const aniData = await cc.getOutdialAniEntries({ outdialANI });
|
|
677
|
+
*
|
|
678
|
+
* // With pagination and search
|
|
679
|
+
* const paginatedAni = await cc.getOutdialAniEntries({
|
|
680
|
+
* outdialANI,
|
|
681
|
+
* page: 0,
|
|
682
|
+
* pageSize: 50,
|
|
683
|
+
* search: '555' // search for numbers containing '555'
|
|
684
|
+
* });
|
|
685
|
+
*
|
|
686
|
+
* // Process the results
|
|
687
|
+
* paginatedAni.forEach(ani => {
|
|
688
|
+
* console.log(`ANI: ${ani.number} - ${ani.name}`);
|
|
621
689
|
* });
|
|
622
690
|
* ```
|
|
623
691
|
*/
|
|
624
|
-
|
|
692
|
+
getOutdialAniEntries(params: OutdialAniParams): Promise<OutdialAniEntriesResponse>;
|
|
625
693
|
/**
|
|
626
694
|
* Uploads logs to help troubleshoot SDK issues.
|
|
627
695
|
*
|
|
@@ -673,4 +741,16 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
673
741
|
* @public
|
|
674
742
|
*/
|
|
675
743
|
updateAgentProfile(data: AgentProfileUpdate): Promise<UpdateDeviceTypeResponse>;
|
|
744
|
+
/**
|
|
745
|
+
* Returns paginated entry points for the organization.
|
|
746
|
+
* Thin wrapper around internal EntryPoint instance.
|
|
747
|
+
* @public
|
|
748
|
+
*/
|
|
749
|
+
getEntryPoints(params?: EntryPointSearchParams): Promise<EntryPointListResponse>;
|
|
750
|
+
/**
|
|
751
|
+
* Returns paginated contact service queues for the organization.
|
|
752
|
+
* Thin wrapper around internal Queue instance.
|
|
753
|
+
* @public
|
|
754
|
+
*/
|
|
755
|
+
getQueues(params?: ContactServiceQueueSearchParams): Promise<ContactServiceQueuesResponse>;
|
|
676
756
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -19,6 +19,9 @@ export { default as Task } from './services/task';
|
|
|
19
19
|
* @category Services
|
|
20
20
|
*/
|
|
21
21
|
export { default as routingAgent } from './services/agent';
|
|
22
|
+
export { default as AddressBook } from './services/AddressBook';
|
|
23
|
+
/** EntryPoint API types */
|
|
24
|
+
export type { EntryPointRecord, EntryPointListResponse, EntryPointSearchParams, AddressBookEntry, AddressBookEntriesResponse, AddressBookEntrySearchParams, ContactServiceQueuesResponse, ContactServiceQueueSearchParams, ContactServiceQueue, } from './types';
|
|
22
25
|
/**
|
|
23
26
|
* Task Events for Contact Center operations
|
|
24
27
|
* @enum {string}
|
|
@@ -126,8 +129,6 @@ BuddyAgentsSuccess, } from './services/agent/types';
|
|
|
126
129
|
export type {
|
|
127
130
|
/** Profile interface */
|
|
128
131
|
Profile,
|
|
129
|
-
/** Contact service queue interface */
|
|
130
|
-
ContactServiceQueue,
|
|
131
132
|
/** Response type from getUserUsingCI method */
|
|
132
133
|
AgentResponse,
|
|
133
134
|
/** Response from getDesktopProfileById */
|
|
@@ -36,7 +36,6 @@ type Enum<T extends Record<string, unknown>> = T[keyof T];
|
|
|
36
36
|
* @property {string} TASK_HOLD_FAILED - Event name for failed task hold.
|
|
37
37
|
* @property {string} TASK_RESUME_SUCCESS - Event name for successful task resume.
|
|
38
38
|
* @property {string} TASK_RESUME_FAILED - Event name for failed task resume.
|
|
39
|
-
*
|
|
40
39
|
* @property {string} TASK_CONSULT_START_SUCCESS - Event name for successful consult start.
|
|
41
40
|
* @property {string} TASK_CONSULT_START_FAILED - Event name for failed consult start.
|
|
42
41
|
* @property {string} TASK_CONSULT_END_SUCCESS - Event name for successful consult end.
|
|
@@ -50,6 +49,13 @@ type Enum<T extends Record<string, unknown>> = T[keyof T];
|
|
|
50
49
|
* @property {string} TASK_ACCEPT_CONSULT_SUCCESS - Event name for successful consult acceptance.
|
|
51
50
|
* @property {string} TASK_ACCEPT_CONSULT_FAILED - Event name for failed consult acceptance.
|
|
52
51
|
*
|
|
52
|
+
* @property {string} TASK_CONFERENCE_START_SUCCESS - Event name for successful conference start.
|
|
53
|
+
* @property {string} TASK_CONFERENCE_START_FAILED - Event name for failed conference start.
|
|
54
|
+
* @property {string} TASK_CONFERENCE_END_SUCCESS - Event name for successful conference end.
|
|
55
|
+
* @property {string} TASK_CONFERENCE_END_FAILED - Event name for failed conference end.
|
|
56
|
+
* @property {string} TASK_CONFERENCE_TRANSFER_SUCCESS - Event name for successful conference transfer.
|
|
57
|
+
* @property {string} TASK_CONFERENCE_TRANSFER_FAILED - Event name for failed conference transfer.
|
|
58
|
+
*
|
|
53
59
|
* @property {string} TASK_OUTDIAL_SUCCESS - Event name for successful outdial task.
|
|
54
60
|
* @property {string} TASK_OUTDIAL_FAILED - Event name for failed outdial task.
|
|
55
61
|
*
|
|
@@ -61,6 +67,9 @@ type Enum<T extends Record<string, unknown>> = T[keyof T];
|
|
|
61
67
|
* @property {string} AGENT_DEVICE_TYPE_UPDATE_SUCCESS - Event name for successful agent device type update.
|
|
62
68
|
* @property {string} AGENT_DEVICE_TYPE_UPDATE_FAILED - Event name for failed agent device type update.
|
|
63
69
|
*
|
|
70
|
+
* @property {string} OUTDIAL_ANI_EP_FETCH_SUCCESS - Event name for successful outdial ANI entries fetch.
|
|
71
|
+
* @property {string} OUTDIAL_ANI_EP_FETCH_FAILED - Event name for failed outdial ANI entries fetch.
|
|
72
|
+
*
|
|
64
73
|
* @readonly
|
|
65
74
|
*/
|
|
66
75
|
export declare const METRIC_EVENT_NAMES: {
|
|
@@ -103,14 +112,29 @@ export declare const METRIC_EVENT_NAMES: {
|
|
|
103
112
|
readonly TASK_PAUSE_RECORDING_FAILED: "Task Pause Recording Failed";
|
|
104
113
|
readonly TASK_ACCEPT_CONSULT_SUCCESS: "Task Accept Consult Success";
|
|
105
114
|
readonly TASK_ACCEPT_CONSULT_FAILED: "Task Accept Consult Failed";
|
|
115
|
+
readonly TASK_CONFERENCE_START_SUCCESS: "Task Conference Start Success";
|
|
116
|
+
readonly TASK_CONFERENCE_START_FAILED: "Task Conference Start Failed";
|
|
117
|
+
readonly TASK_CONFERENCE_END_SUCCESS: "Task Conference End Success";
|
|
118
|
+
readonly TASK_CONFERENCE_END_FAILED: "Task Conference End Failed";
|
|
119
|
+
readonly TASK_CONFERENCE_TRANSFER_SUCCESS: "Task Conference Transfer Success";
|
|
120
|
+
readonly TASK_CONFERENCE_TRANSFER_FAILED: "Task Conference Transfer Failed";
|
|
106
121
|
readonly TASK_OUTDIAL_SUCCESS: "Task Outdial Success";
|
|
107
122
|
readonly TASK_OUTDIAL_FAILED: "Task Outdial Failed";
|
|
108
123
|
readonly UPLOAD_LOGS_SUCCESS: "Upload Logs Success";
|
|
109
124
|
readonly UPLOAD_LOGS_FAILED: "Upload Logs Failed";
|
|
110
125
|
readonly WEBSOCKET_DEREGISTER_SUCCESS: "Websocket Deregister Success";
|
|
111
126
|
readonly WEBSOCKET_DEREGISTER_FAIL: "Websocket Deregister Failed";
|
|
127
|
+
readonly WEBSOCKET_EVENT_RECEIVED: "Websocket Event Received";
|
|
112
128
|
readonly AGENT_DEVICE_TYPE_UPDATE_SUCCESS: "Agent Device Type Update Success";
|
|
113
129
|
readonly AGENT_DEVICE_TYPE_UPDATE_FAILED: "Agent Device Type Update Failed";
|
|
130
|
+
readonly ENTRYPOINT_FETCH_SUCCESS: "Entrypoint Fetch Success";
|
|
131
|
+
readonly ENTRYPOINT_FETCH_FAILED: "Entrypoint Fetch Failed";
|
|
132
|
+
readonly ADDRESSBOOK_FETCH_SUCCESS: "AddressBook Fetch Success";
|
|
133
|
+
readonly ADDRESSBOOK_FETCH_FAILED: "AddressBook Fetch Failed";
|
|
134
|
+
readonly QUEUE_FETCH_SUCCESS: "Queue Fetch Success";
|
|
135
|
+
readonly QUEUE_FETCH_FAILED: "Queue Fetch Failed";
|
|
136
|
+
readonly OUTDIAL_ANI_EP_FETCH_SUCCESS: "Outdial ANI Entries Fetch Success";
|
|
137
|
+
readonly OUTDIAL_ANI_EP_FETCH_FAILED: "Outdial ANI Entries Fetch Failed";
|
|
114
138
|
};
|
|
115
139
|
/**
|
|
116
140
|
* Represents the possible metric event names used within the metrics system.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { WebexSDK } from '../types';
|
|
2
|
+
import type { AddressBookEntriesResponse, AddressBookEntrySearchParams } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* AddressBook API class for managing Webex Contact Center address book entries.
|
|
5
|
+
* Provides functionality to fetch address book entries using the entry API.
|
|
6
|
+
*
|
|
7
|
+
* @class AddressBook
|
|
8
|
+
* @public
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import Webex from 'webex';
|
|
12
|
+
*
|
|
13
|
+
* const webex = new Webex({ credentials: 'YOUR_ACCESS_TOKEN' });
|
|
14
|
+
* const cc = webex.cc;
|
|
15
|
+
*
|
|
16
|
+
* // Register and login first
|
|
17
|
+
* await cc.register();
|
|
18
|
+
* await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
|
|
19
|
+
*
|
|
20
|
+
* // Get AddressBook API instance from ContactCenter
|
|
21
|
+
* const addressBookAPI = cc.addressBook;
|
|
22
|
+
*
|
|
23
|
+
* // Get entries from agent's default address book
|
|
24
|
+
* const entries = await addressBookAPI.getEntries();
|
|
25
|
+
*
|
|
26
|
+
* // Get entries from a specific address book with pagination
|
|
27
|
+
* const entries = await addressBookAPI.getEntries({
|
|
28
|
+
* addressBookId: 'addressBookId123',
|
|
29
|
+
* page: 0,
|
|
30
|
+
* pageSize: 50
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // Search for specific entries
|
|
34
|
+
* const searchResults = await addressBook.getEntries({
|
|
35
|
+
* search: 'john',
|
|
36
|
+
* filter: 'name=="John Doe"'
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare class AddressBook {
|
|
41
|
+
private webexRequest;
|
|
42
|
+
private webex;
|
|
43
|
+
private getAddressBookId;
|
|
44
|
+
private metricsManager;
|
|
45
|
+
private pageCache;
|
|
46
|
+
/**
|
|
47
|
+
* Creates an instance of AddressBook
|
|
48
|
+
* @param {WebexSDK} webex - The Webex SDK instance
|
|
49
|
+
* @param {() => string} getAddressBookId - Function to get the addressBookId from agent profile
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
constructor(webex: WebexSDK, getAddressBookId: () => string);
|
|
53
|
+
/**
|
|
54
|
+
* Fetches address book entries for a specific address book using the entry API
|
|
55
|
+
* @param {AddressBookEntrySearchParams} [params] - Search and pagination parameters including addressBookId
|
|
56
|
+
* @returns {Promise<AddressBookEntriesResponse>} Promise resolving to address book entries
|
|
57
|
+
* @throws {Error} If the API call fails
|
|
58
|
+
* @public
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* // Get entries from agent's default address book
|
|
62
|
+
* const response = await addressBookAPI.getEntries();
|
|
63
|
+
*
|
|
64
|
+
* // Get entries from a specific address book with pagination
|
|
65
|
+
* const response = await addressBookAPI.getEntries({
|
|
66
|
+
* addressBookId: 'addressBookId123',
|
|
67
|
+
* page: 0,
|
|
68
|
+
* pageSize: 25
|
|
69
|
+
* });
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
getEntries(params?: AddressBookEntrySearchParams): Promise<AddressBookEntriesResponse>;
|
|
73
|
+
}
|
|
74
|
+
export default AddressBook;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { WebexSDK } from '../types';
|
|
2
|
+
import type { EntryPointListResponse, EntryPointSearchParams } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* EntryPoint class for managing Webex Contact Center entry points.
|
|
5
|
+
* Provides functionality to fetch, search, and paginate through entry points.
|
|
6
|
+
*
|
|
7
|
+
* @class EntryPoint
|
|
8
|
+
* @public
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import Webex from 'webex';
|
|
12
|
+
*
|
|
13
|
+
* const webex = new Webex({ credentials: 'YOUR_ACCESS_TOKEN' });
|
|
14
|
+
* const cc = webex.cc;
|
|
15
|
+
*
|
|
16
|
+
* // Register and login first
|
|
17
|
+
* await cc.register();
|
|
18
|
+
* await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
|
|
19
|
+
*
|
|
20
|
+
* // Get EntryPoint API instance from ContactCenter
|
|
21
|
+
* const entryPointAPI = cc.entryPoint;
|
|
22
|
+
*
|
|
23
|
+
* // Get all entry points with pagination
|
|
24
|
+
* const response = await entryPointAPI.getEntryPoints({
|
|
25
|
+
* page: 0,
|
|
26
|
+
* pageSize: 50
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* // Search for specific entry points
|
|
30
|
+
* const searchResults = await entryPointAPI.searchEntryPoints({
|
|
31
|
+
* search: 'support',
|
|
32
|
+
* filter: 'type=="voice"'
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare class EntryPoint {
|
|
37
|
+
private webexRequest;
|
|
38
|
+
private webex;
|
|
39
|
+
private metricsManager;
|
|
40
|
+
private pageCache;
|
|
41
|
+
/**
|
|
42
|
+
* Creates an instance of EntryPoint
|
|
43
|
+
* @param {WebexSDK} webex - The Webex SDK instance
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
constructor(webex: WebexSDK);
|
|
47
|
+
/**
|
|
48
|
+
* Fetches entry points for the organization with pagination support
|
|
49
|
+
* @param {EntryPointSearchParams} [params] - Search and pagination parameters
|
|
50
|
+
* @returns {Promise<EntryPointListResponse>} Promise resolving to paginated entry points
|
|
51
|
+
* @throws {Error} If the API call fails
|
|
52
|
+
* @public
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* // Get first page of entry points
|
|
56
|
+
* const response = await entryPointAPI.getEntryPoints();
|
|
57
|
+
*
|
|
58
|
+
* // Get specific page with custom page size
|
|
59
|
+
* const response = await entryPointAPI.getEntryPoints({
|
|
60
|
+
* page: 2,
|
|
61
|
+
* pageSize: 25
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
getEntryPoints(params?: EntryPointSearchParams): Promise<EntryPointListResponse>;
|
|
66
|
+
}
|
|
67
|
+
export default EntryPoint;
|