import { Subject, Subscription } from "rxjs"; import { ContactService } from '../../services/core/contact.service'; import { Contact } from '../../models/contact.model'; import { Service } from '../../services/service'; import { CallRB } from '../../models/call.model'; import { ConversationRB } from '../../models/conversation.model'; export declare const SUPERVISION_SVC = "SupervisionService"; export interface SupervisionGroupMember { userId: string; roles: string[]; inOutPermission: string; status: string; isDelegationEnabled: boolean; } export interface SupervisionGroup { id: string; name: string; type: string; isEmptyAllowed: boolean; members: SupervisionGroupMember[]; supervisorUsers: string[]; supervisedUsers: string[]; supervisorUserContacts: Contact[]; supervisedUserContacts: Contact[]; isMyRoleSupervisor: boolean; isMyRoleSupervisorAdmin: boolean; isMyRoleSupervised: boolean; avatar: string; nbIncomingRingingCalls: number; } export interface CallInfo { callId: string; callState: string; callerNumber: string; callerName: string; callType?: string; callerJid?: string; resource?: string; media?: string; type?: string; notified?: boolean; sid?: string; } export interface RingingSupervisedCall { callInfo: CallInfo; supervisedContact: Contact; groupsAvatars: string[]; groupsNames: string[]; groupsIds: string[]; } export interface SupervisionSettings { disableSupervisionCallNotificationsOnMobiles: boolean; } export declare class SupervisionService extends Service { /** * @public * @event ON_SUPERVISOR_ROLE_UPDATED * @description This RB event is sent when the user supervisor role has changed. */ static ON_SUPERVISOR_ROLE_UPDATED: string; /** * @public * @event ON_SUPERVISION_CONVERSATIONS_UPDATED * @param {string} state the global state for the supervision * @param {CallInfo[]} callInfos [optional] the information for all calls currently in supervision (could be empty) * @description This RB event is sent when there's update on the supervision conversation (for call shift) */ static ON_SUPERVISION_CONVERSATIONS_UPDATED: string; /** * @public * @event ON_SUPERVISION_RINGING_CONTACTS_UPDATED * @param {RingingSupervisedCall[]} ringingSupervisedCallList array of ringing calls on supervised contacts * @description This RB event is sent when there's update on the ringing calls on supervised contact's array */ static ON_SUPERVISION_RINGING_CONTACTS_UPDATED: string; /** * @public * @event ON_SUPERVISION_RINGING_SUPERVISED_CALL_CREATED * @param {RingingSupervisedCall} ringingSupervisedCall new ringing call on a supervised contact * @description This RB event is sent when there's a new ringing call on a supervised contact */ static ON_SUPERVISION_RINGING_SUPERVISED_CALL_CREATED: string; /** * @public * @event ON_SUPERVISION_RINGING_SUPERVISED_CALL_REMOVED * @param {RingingSupervisedCall} ringingSupervisedCall removed ringing call on supervised contact * @description This RB event is sent when a ringing call stops ringing on a supervised contact */ static ON_SUPERVISION_RINGING_SUPERVISED_CALL_REMOVED: string; started: boolean; private mainService; private xmppService; private logger; private authService; private errorHelperService; private telephonyService; private webrtcGatewayService; private personalRoutinesService; private userInfoService; private profileService; private webrtcService; private conversationService; private settingsService; private webConferenceService; private portalURL; private xmppHandlers; private selectedGroupId; private _consoleViewFilter; private subscriptions; private seqNum; supervisionSubject: Subject; mySupervisedCalls: {}; private supervisionSettings; private supervisionGroups; private ringingSupervisedCallList; private isMyRoleManager; private isMyRoleAssistant; private lastPickupDate; private transferRemotePartyNumbers; private hybridCallShiftAllowed; private lastMySupervisionMessageSent; private mySupervisionTimer; static getInstance(): SupervisionService; static build(): SupervisionService; protected contactService: ContactService; private constructor(); start(): void; stop(): void; reconnect(): any; private attachListeners; subscribe(handler: any, eventNames?: string | string[]): Subscription; sendEvent(eventName: string, detail?: any): void; get consoleViewFilter(): string; set consoleViewFilter(filter: string); private handleNewCallConversation; sendSupervisionUpdateMessage(fullJid?: string): void; private calculateSupervisionState; private sendSnapshotToOtherResources; private sendSnapshotToResource; private onSupervisionSnapshotMessage; makeCallShift(conversation: ConversationRB): Promise; private initSupervisionData; private computeMyManagerAssistantRole; private buildInitials; getSupervisionGroups(init?: boolean): Promise; getSupervisionGroupsMutualAid(): Promise; getSupervisionGroup(groupId: string): Promise; private getSupervisedUsers; private getSupervisedUsersPaginated; pickupCall(contact: Contact, callId?: string): Promise; private delay; private waitActiveCall; private storePendingPickup; private removePendingPickup; setSelectedGroupId(id: string): void; getSelectedGroupId(): string; initializeSupervisionSettings(): Promise; updateSupervisionSettings(disableSupervisionCallNotificationsOnMobiles: boolean): Promise; getSupervisionSettings(): SupervisionSettings; private addOrUpdateSupervisionGroup; private removeSupervisionGroup; private removeMySelfFromMembers; private updateSupervisionGroupName; private updateSupervisionEmptyGroupAllowed; private removeUserFromGroup; private updateGroupMember; private onSupervisionManagement; private cleanSupervisedCallsForSupervisorGroup; private cleanSupervisedCallsForSupervisedUser; private resetSupervisionDataForSupervisedUserIfNecessary; private removeGroupItemsForCalls; private removeSupervisedCallsHavingNoGroupIds; /** * Method onSupervisionMessage * @private * @memberof SupervisionService * Handler of supervision messages * @param {any} stanza the xmpp event stanza * @returns {boolean} true when event handling completed */ private onSupervisionMessage; private handleSupervisionElement; notifySupervisionState(userFullJidTel: string, state: string, device: string, callInfos: CallInfo[]): void; notifySupervisionCallUpdate(userFullJidTel: string, callInfos: CallInfo[]): void; notifySupervisionVoiceForwardImm(userFullJidTel: string, activate: boolean, destinationType: string, destinationName: string): void; notifySupervisionHybridForward(userFullJidTel: string, forwardType: string, pbxForwardType: string, forwardTo: string): void; notifySupervisionRoutineActive(userFullJidTel: string, routineId: string): void; notifySupervisionRoutineListModified(userFullJidTel: string): Promise; getRingingSupervisedCallList(): RingingSupervisedCall[]; private onMyUserSupervisionCallsUpdated; setGroupLoginStatus(groupId: string, userId: string, logged: boolean): Promise; existManagerAssistantGroup(): boolean; isMyselfManagerOrAssistant(): boolean; isMyselfManager(): boolean; isMyselfAssistant(): boolean; isUserMyManager(userId: string): boolean; setGroupManagerCallDelegation(groupId: string, managerId: string, activated: boolean): Promise; assistantJoinAllManagerAssistantGroups(): Promise; assistantLeaveAllManagerAssistantGroups(): Promise; isManagerCallDelegationEnabled(): boolean; existIncomingCallToSupervisedManager(): boolean; isCallFromAssistant(call: CallRB): boolean; isCallTransferredByAssistant(call: CallRB): boolean; storeTransferRemotePartyNumber(phoneNumber: string): void; private removeRemotePartyTransfer; isRemotePartyTransferred(phoneNumber: string): boolean; } //# sourceMappingURL=supervision.service.d.ts.map