import { Observable, Subject, BehaviorSubject, ReplaySubject } from 'rxjs'; import { AxiosRequestConfig } from 'axios'; interface ActiveCall { localChannel: string; remoteChannel: string; cli: string; } interface Ping { message: string; } interface Pong { message: string; } interface BreakDetails { inBreak: boolean; breakId: string; breakTypeCode: string; breakName: string; startTime: Date; endTime?: Date; } interface QueueState { queue: string; size: number; maxWaitTimestamp?: Date; callsEntered: number; callsConnected: number; agentsConnected: number; agentsActive: number; } interface TeamMemberState { agentId: string; name: string; connected: boolean; agentStatus: string; agentSubStatus: string; waitingForBreak: boolean; breakTypeCode: number; breakReason: string; inBreak: boolean; breakTimestamp: Date; hasPhone: boolean; phoneId: string; phoneStatus: string; hasTask: boolean; taskId: string; queueName: string; callerId: string; ahtTarget: number; taskTimestamp: Date; currentCallTimestamp: Date; wrapUpTimestamp: Date; } declare enum AgentAudioState { Unknown = 0, NotOnCall = 10, OnCall = 20 } declare enum AgentPrimaryState { Offline = 0, Idle = 10, OnBreak = 20, Preparing = 30, Busy = 40, BusyTalking = 41, Closing = 50 } declare enum AudioChannelType { SipClient = 10 } declare enum BreakIndicator { NotInBreak = 0, WaitingForBreak = 1, InBreak = 2 } declare enum Channel$1 { Unknown = 0, PhoneCall = 10, WebForm = 20, Email = 30, WebChat = 40, SMS = 50, WhatsApp = 60, Facebook = 70, Twitter = 80 } declare enum GuiType { Unknown = 0, Agent = 1, TeamLead = 2, QualityAnalyst = 3, DataAnalyst = 4, OperationsLead = 5, Manager = 6, ProcessOwner = 7, LiveView = 8 } declare enum LogType { Log = 0, Warning = 1, Error = 2 } declare enum WorkItemState { Unknown = 0, InQueue = 10, Active = 20 } declare enum BreakStateCode { NotInBreak = 0, WaitingForBreak = 1, InBreak = 2 } interface Agent { agentId: string; agentInfo: AgentInfo$1; agentStatus: AgentStatus; agentAudioChannel: AudioChannel; agentSession: AgentSession; agentBacklog: WorkItem[]; } interface AgentFeatures { queueMonitor: boolean; teamMonitor: boolean; } interface AgentInfo$1 { agentId: string; displayName: string; userId: string; traineeSkills: string[]; regularSkills: string[]; expertSkills: string[]; } interface AgentSession { agentId: string; sessionId: string; sessionGuiType: GuiType; enabledFeatures: AgentFeatures; } interface AgentStatus { agentId: string; agentPrimaryState: AgentPrimaryState; agentAudioState: AgentAudioState; breakIndicator: BreakIndicator; } interface AudioChannel { audioChannelType: AudioChannelType; phoneNumber: string; } interface WorkItem { workItemId: string; workTitle: string; workItemState: WorkItemState; channel: Channel$1; } interface BreakState { bsCode: BreakStateCode; type: number; reason: string; } declare class Channel { channel: string; cli: string; status: string; } declare class ChatMessage { agent: string; from: string; to: string; message: string; timestamp: string; } declare class Conference { id: string; members: Array; } interface ConnectionState { connected: boolean; state: string; } interface DialerState { id: number; name: string; active: boolean; speed: number; activeQueue: number; connected: number; } interface AgentInfo { userId: string; agentName: string; login: string; firstLogin: string; } interface AgentRoles { manager: boolean; qa: boolean; teamLead: boolean; agent: boolean; } interface BreakType { btCode: number; name: string; description: string; } interface Info { agentInfo: AgentInfo; agentRoles: AgentRoles; breakTypes: BreakType[]; } interface LogEntry { context: string; type: LogType; message: any; } interface MissedCall { phoneId: string; originNumber: string; dialledNumber: string; queueName: string; callId: string; timestamp: Date; } interface PhoneState { device: string; state: string; } interface RxiosConfig extends AxiosRequestConfig { } declare class Rxios { private _httpClient; constructor(options?: RxiosConfig); private _doReq; get(url: string, queryParams?: object): Observable; post(url: string, payload: object): Observable; put(url: string, payload: object): Observable; patch(url: string, payload: object): Observable; delete(url: string): Observable; } interface Credentials { username: string; password: string; } declare class Authenticator { backendUrl: string; remote: Rxios; /** * Create an Authenticator for Generating Bearer tokens */ constructor(url: string); /** * * @param credentials Agent Credentials */ getAuthToken(credentials: Credentials): Observable; } declare class NetworkTester { /** * Test connection to the Xema Platform */ constructor(); ping(url: string): Observable; } declare class DeviceMapParameters { deviceName: string; } declare class EndCall { Channel: string; } declare class QueryParameters { fromDate: Date; originNumber: string; dialledNumber: string; agentId: string; phoneId: string; } declare class ServerConnection { private backendUrl; private token; private guiType; private remote; private connection; private agentPhoneId; private bargePhoneId; private userLoggedout; private userRemoteLoggedout; private connectionAttemptCounter; private connectionCounter; private reconnect; private retryCount; private maxRetryCount; /** * Receive logs from the libary */ logger: Subject; /** * Server connection status * Default: { connected: false, state: 'Unknown' } */ connectionState: BehaviorSubject; /** * Associated Phone status * Default: { device: 'Unknown', state: 'Unknown' } */ phoneState: BehaviorSubject; /** * User Break status */ breakState: BehaviorSubject; /** * User Info */ info: ReplaySubject; messageReceived: Subject; chatMessages: Subject; missedCall: Subject; private ongoingCallsCache; ongoingCalls: ReplaySubject; private parkedChannelsCache; parkedChannels: ReplaySubject; private conferenceCallCache; conferenceCall: ReplaySubject; task: ReplaySubject; private inTask; private firstBridgedCall; private lastBridgedCall; private queueStatesCache; queueStates: BehaviorSubject; private dialerStatesCache; dialerStates: BehaviorSubject; private teamMemberStatesCache; teamMemberStates: BehaviorSubject; teamMemberState: Subject; hangup: Subject; /** * Create a connection to the Xema Platform */ constructor(url: string, token: string, primaryGuiType: GuiType); /** * Report debug information to the application * @param context * @param message */ private log; /** * Connect to server using web sockets */ connect(): void; private retry; disconnect(): void; private setupSignalR; private processCallEvents; private processParkEvents; private processConferenceEvents; private processDialerUpdates; private processQueueUpdates; private processTeamMemberState; private processIdCard; private discoverAgentState; sendChatMessage(message: ChatMessage): void; sendGroupChatMessage(message: ChatMessage): void; askBreak2(btCode: number, reason: string): void; cancelBreak(): void; exitBreak(): void; hold(channel: string): void; resume(channel: string): void; call(trunk: string, cli: string, callid: string): void; hangupCall(channel: string): void; conference(channels: string[]): void; /** * Dispose the task */ dispose(): void; barge(targetdeviceid: string): void; whisper(targetdeviceid: string): void; spy(targetdeviceid: string): void; executeAction(actionId: number, param1?: string, param2?: string): void; private getAgentList; IsAgentAuthenticated(): Observable; IsOnline(): Observable; RemoteLogout(): Observable; ForceRemoteLogout(): Observable; IsPhoneMapped(): Observable; ActivateBargeAudioChannel(phoneId: string): void; ActivateAgentAudioChannel(phoneId: string): Observable; /** * @deprecated Use ActivateAgentAudioChannel() method. */ mapPhone(param: DeviceMapParameters): Observable; /** * @deprecated This functionality is removed */ unassignPhone(): Observable; endcall(param: EndCall): Observable; getAgents(): Observable; getCallHistory(param: QueryParameters): Observable; getAgentMissedCalls(): Observable; } export { type ActiveCall, type Agent, AgentAudioState, type AgentFeatures, type AgentInfo$1 as AgentInfo, AgentPrimaryState, type AgentSession, type AgentStatus, type AudioChannel, AudioChannelType, Authenticator, type BreakDetails, BreakIndicator, type BreakState, BreakStateCode, Channel, ChatMessage, Conference, type ConnectionState, type DialerState, GuiType, type Info, type LogEntry, LogType, type MissedCall, NetworkTester, type PhoneState, type Ping, type Pong, type QueueState, ServerConnection, type TeamMemberState, type WorkItem, WorkItemState };