import { AddVoiceParticipantMediaProperties } from "@twiliointernal/cbm-sdk"; import { IWorker, TaskReservationStatus, TaskTaskStatus, WorkerAttributes, WorkerSkillsType } from "../internal-flex-commons/src"; import { CallOptions, DequeueOptions, RedirectOptions, ReservationParticipantOptions, Task, TaskParticipantOptions } from "twilio-taskrouter"; import { Conference } from "../state/Conferences/Conference"; import { Participant } from "../state/Participants/participants.types"; export type { IWorker, TaskReservationStatus, TaskTaskStatus, WorkerAttributes, WorkerSkillsType }; export type IParticipant = Participant; /** * @typedef TaskTransfer * @property {"COLD" | "WARM"} mode transfer mode * @property {string} sid - The sid of this Transfer * @property {"INITIATED" | "FAILED" | "COMPLETE" | "CANCELED"} status transfer status * @property {string} to - The sid of the Worker or TaskQueue this Transfer is intended for * @property {"QUEUE" | "WORKER"} type - The transfer type * @property {string} workerSid - The sid of the initiating Worker * @property {IWorker} [worker] - The instance of the initiating Worker * @property {IQueue} [queue] - Target queue instance * @memberof ITask */ export declare class TaskTransfer { mode: string; type: string; workerSid: string; to: string; sid: string; source: any; constructor(source: any); get worker(): IWorker; get status(): string; get queue(): import("internal-flex-commons").IQueue; /** * To deprecate * @private */ cancel(): any; } /** * Task interface for actionable Reservations from TaskRouter SDK * @interface ITask * @property {Task} source source object backing the task * @property {object} sourceObject source object backing the instance (any) * @property {object} addOns - the addons attached to the Task * @property {number} age - the age of the Task in seconds * @property {object} attributes - the attributes of the Task * @property {Date} dateCreated - the date the Task was created * @property {Date} dateUpdated - the date the Task was last updated * @property {number} priority - the priority of the Task * @property {string} queueName - the friendly name of the TaskQueue the Task is currently in * @property {string} queueSid - the sid of the TaskQueue the Task is currently in * @property {string} reason - the reason the Task was completed or canceled, if applicable * @property {string} sid - the sid of the Reservation * @property {ITask.TaskReservationStatus} status - the status of the Reservation * @property {string} taskSid - the sid of the Task * @property {ITask.TaskTaskStatus} taskStatus - the status of the Task * @property {string} taskChannelSid - the sid of the Task Channel associated to the Task in MultiTask mode * @property {string} taskChannelUniqueName - the unique name of the Task Channel associated to the Task in MultiTask mode * @property {number} timeout - the number of seconds the Task is allowed to live * @property {string} workflowName - the name of the Workflow responsible for routing the Task * @property {string} workflowSid - the sid of the Workflow responsible for routing the Task * @property {string} workerSid - the sid of the worker the task is assigned to * @property {ITask.TaskTransfer} [incomingTransferObject] - transfer object if Task was transferred to the current user * @property {ITask.TaskTransfer} [outgoingTransferObject] - transfer object if is being transferred to another user by current user * @property {string} routingTarget - the final target for task assignemnt * @property {string} channelType - channel type - either `channelType` property defined in the attributes of Task or `taskChannelUniqueName` property * @property {string} defaultFrom - default initiator of a Task. Either `name` or `from` property defined in the attributes. If not specified then 'Anonymous' is returned * @property {object} formattedAttributes - formatted task attributes used by flex ui * @property {string} [formattedAttributes.from] - formatted `from` phone number with country code * @property {string} [formattedAttributes.outbound_to] - formatted `outbound_to` phone number with country code * @property {Conference} [conference] - the conference related to this task * @category Framework * @subcategory Public Interfaces */ export interface ITask> { source: Task; sourceObject: any; addOns: object; age: number; attributes: CustomAttributesType; dateCreated: Date; dateUpdated: Date; priority: number; queueName: string; queueSid: string; reason: string; sid: string; status: TaskReservationStatus; taskSid: string; taskStatus: TaskTaskStatus; taskChannelSid: string; taskChannelUniqueName: string; timeout: number; workflowName: string; workflowSid: string; workerSid: string; incomingTransferObject?: TaskTransfer; outgoingTransferObject?: TaskTransfer; routingTarget: string; defaultFrom: string; formattedAttributes: { from?: string; outbound_to?: string; }; channelType: string; conference?: Conference; endConference: () => Promise; addVoiceParticipant: (to: string, from: string, type: string) => Promise; joinCall: (props?: { mediaProperties?: AddVoiceParticipantMediaProperties; }) => Promise; getChannels: () => Promise; getParticipants: (channelSid: string, options?: object) => Promise; setEndConferenceOnExit: (participantSid: string, endConferenceOnExit: boolean) => Promise; complete: () => Promise; transfer: (to: string, options: any) => Promise; hold: (holdMusicUrl?: string, holdMusicMethod?: string) => Promise; unhold: () => Promise; holdParticipant: (targetSid: string, holdMusicUrl?: string, holdMusicMethod?: string) => Promise; unholdParticipant: (targetSid: string) => Promise; cancelTransfer: () => Promise; kick: (targetSid: string) => Promise; setAttributes: (attributes: object) => Promise; wrapUp: () => Promise; dequeue: (options?: DequeueOptions) => Promise; redirectCall: (callSid: string, url: string, options?: RedirectOptions) => Promise; issueCallToWorker: (from: string, url: string, options?: CallOptions) => Promise; updateWorkerParticipant: (options?: ReservationParticipantOptions) => Promise; updateCustomerParticipant: (options?: TaskParticipantOptions) => Promise; } /** * Queue * @interface IQueue * @property {object} source source object backing the queue * @property {Date} dateUpdated date when queue was updated * @property {string} sid SID of queue * @property {string} name name of the queue * @property {string} workspaceSid workspace SID of the queue * @category Framework * @subcategory Public Interfaces */ export type { IQueue } from "../internal-flex-commons/src"; /** * @since 2.9.0 * @enum {"inbound" | "outbound"} Direction * @property {"inbound"} INBOUND - Inbound task type * @property {"outbound"} OUTBOUND - Outbound task type */ export declare enum Direction { INBOUND = "inbound", OUTBOUND = "outbound" }