import { Dispatch } from "redux"; import { ITask } from "../../models"; import { Conference } from "../Conferences"; import { SupervisorWorkerState } from "../State.definition"; import { AppliedFilter, CallMonitoring, Queue, Teams } from "./SupervisorState.definitions"; import { metricDataType as AgentMetrics } from "../../components/supervisor/TeamFiltersPanel/AgentMetricsTab/AgentMetricsTab.definitions"; /** * State of the supervisor view * @interface SupervisorState * @property {CallMonitoring} callMonitoring state of call monitoring * @property {SupervisorWorkerState} [stickyWorker] currently selected worker state * @property {Array} workers currently showing worker states * @property {boolean} isLoadingWorkers if workers are being loaded * @property {LiveQueryError} errorLoadingWorkers instance of the error when loading workers * @property {Array} appliedFilters array of applied filters * @property {string} extraFilterQuery query for custom filters * @property {string} search search string * @category State */ export interface SupervisorState { readonly callMonitoring: CallMonitoring; readonly stickyWorker?: SupervisorWorkerState; readonly workers: Array; readonly isLoadingWorkers: boolean; readonly errorLoadingWorkers: LiveQueryError; readonly appliedFilters: AppliedFilter[]; readonly extraFilterQuery: string; readonly search: string; readonly teams?: Array | null; readonly isNewTeamsViewEnabled?: boolean; readonly terminatedTasksList: Array; readonly teamsHierarchy?: { [key: string]: string; } | null; readonly selectedTeams: string[]; readonly agentMetricsColumnsPreference: AgentMetrics[]; readonly selectedQueues: Queue[]; readonly queues?: Queue[] | null; readonly isLoadingQueues?: boolean; readonly isQueuesError?: boolean; } export declare enum LiveQueryError { None = 0, Other = 1, LongQuery = 2 } interface SyncError extends Error { code?: SyncErrorCodes | number; } declare enum SyncErrorCodes { TooManyOperators = 54509, TooManyItems = 54510 } export type SupervisorStateAction = { type: typeof UPDATE_STATE; payload: Partial; } | { type: typeof MONITORING_UPDATED; payload: { conference: Conference; }; } | { type: typeof LOAD_WORKERS_START; } | { type: typeof LOAD_WORKERS_FAILED; payload?: Error | SyncError; } | { type: typeof SET_APPLIED_FILTERS; payload: { filters: AppliedFilter[]; extraFilterQuery?: string; }; } | { type: typeof SET_SEARCH; payload: string; } | { type: typeof UPDATE_TEAMS; payload: Teams[]; } | { type: typeof UPDATE_QUEUES; payload: Queue[]; } | { type: typeof UPDATE_QUEUES_LOADING; payload: boolean; } | { type: typeof UPDATE_TEAMS_HIERARCHY; payload: { [key: string]: string; }; } | { type: typeof SELECT_TEAM; payload: Teams; } | { type: typeof UPDATE_TEAMS_VIEW_CONTEXT; payload: boolean; } | { type: typeof UPDATE_TERMINATED_TASKS; payload: string; } | { type: typeof UPDATE_SELECTED_TEAMS; payload: string[]; } | { type: typeof UPDATE_SELECTED_QUEUES; payload: Queue[]; } | { type: typeof UPDATE_QUEUES_ERROR; payload: boolean; } | { type: typeof UPDATE_AGENT_METRICS_COLUMN_PREFERENCE; payload: AgentMetrics[]; }; export declare const UPDATE_STATE = "SUPERVISOR_UPDATE"; export declare const MONITORING_UPDATED = "SUPERVISOR_INCOMING_CALL_UPDATE"; export declare const LOAD_WORKERS_START = "SUPERVISOR_LOAD_WORKERS_START"; export declare const LOAD_WORKERS_FAILED = "SUPERVISOR_LOAD_WORKERS_FAILED"; export declare const SET_APPLIED_FILTERS = "SUPERVISOR_SET_APPLIED_FILTERS"; export declare const SET_SEARCH = "SUPERVISOR_SET_SEARCH"; export declare const UPDATE_TEAMS = "UPDATE_TEAMS"; export declare const UPDATE_QUEUES = "UPDATE_QUEUES"; export declare const UPDATE_TEAMS_HIERARCHY = "UPDATE_TEAMS_HIERARCHY"; export declare const SELECT_TEAM = "SELECT_TEAM"; export declare const UPDATE_TEAMS_VIEW_CONTEXT = "UPDATE_TEAMS_VIEW_CONTEXT"; export declare const UPDATE_TERMINATED_TASKS = "UPDATE_TERMINATED_TASKS"; export declare const UPDATE_SELECTED_TEAMS = "UPDATE_SELECTED_TEAMS"; export declare const UPDATE_SELECTED_QUEUES = "UPDATE_SELECTED_QUEUES"; export declare const UPDATE_AGENT_METRICS_COLUMN_PREFERENCE = "UPDATE_AGENT_METRICS_COLUMN_PREFERENCE"; export declare const UPDATE_QUEUES_LOADING = "UPDATE_QUEUES_LOADING"; export declare const UPDATE_QUEUES_ERROR = "UPDATE_QUEUES_ERROR"; export declare function reduce(state?: SupervisorState, action?: SupervisorStateAction): SupervisorState; export declare class Actions { private static _dispatcher; private static listenedConferences?; private static callMonitoringStart?; private static stateUpdateThrottler?; private static pendingStateUpdate?; static dispatchStateUpdate(payload: Partial, immediately?: boolean): void; static flush(): void; static get dispatcher(): Dispatch; static set dispatcher(dispatcher: Dispatch); static monitorCall(task: ITask): Promise; private static findCurrentWorkerParticipantInstances; private static getMonitoringData; private static isMonitoredWorkerStillInTheCall; private static onConferenceUpdate; private static manageConferenceListening; static updateStateWorkers(workers: Array): void; static startLoadingWorkers(): void; static failLoadingWorkers(e?: Error): void; static updateStateStickyWorker(stickyWorker?: SupervisorWorkerState): void; static setAppliedFilters(filters: AppliedFilter[], extraFilterQuery?: string): void; static setSearch(search: string): void; static updateTeams(teams: Teams[]): void; static updateQueues(queues: Queue[]): void; static updateQueuesLoading(isLoading: boolean): void; static updateQueuesError(isError: boolean): void; static updateTeamsHierarchy(hierarchy: { [key: string]: string; }): void; static updateSelectedTeams(teamSid: string[]): void; static updateSelectedQueues(queues: Queue[]): void; static updateAgentMetricsColumnPreference(colPreference: AgentMetrics[]): void; static updateTeamsContext(isEnabled: boolean): void; static updateTerminatedList(key: string): void; static shutdown(): void; } export {};