import { ChannelExchange, Server as CoreServer } from 'ziron-worker'; import SocketMapper from '../socket/socketMapper'; import { SocketRemoteTaskTarget, TokenRemoteTaskAction } from '../definitions/remoteTaskDefinitions'; import ConfigProvider from '../config/management/configProvider'; import { ObjectEditOperation } from '../definitions/objectEditOperation'; import { RawSocket } from '../definitions/rawSocket'; export declare const INTERNAL_TASK_CH = "T>"; export default class RemoteTaskEngine { private readonly channelExchange; private readonly socketMapper; private readonly configProvider; private readonly coreServer; private readonly instanceId; constructor(channelExchange: ChannelExchange, socketMapper: SocketMapper, configProvider: ConfigProvider, coreServer: CoreServer); private processRemoteTask; private processSocketRemoteTask; private processTokenRemoteTask; private processMessageRemoteTask; /** * Update all tokens from the sockets in the map. * @param map * @param operations * @param target * @param exceptSocketSids */ private _updateTokens; /** * Filter socket sids from a sid array. * @param sids */ private _filterAndResolveSocketSids; /** * Do action for sockets with sid on the server. * @param ids * @param action */ private _forAllSocketSids; /** * Do action for all sockets on the server. * @param exceptSocketSids * @param action */ private _forAllSockets; /** * Do an action for all sockets in a map. * @param map * @param exceptSocketSids * @param action */ private _forAllSocketsInMap; /** * Do action for all sockets with grouped id in a mapper. * @param mapper * @param keys * @param exceptSocketSids * @param action */ private _forSpecificSocketsInMap; /** * Do an action for all sockets with a specific token ids. * @param tokenIds * @param exceptSocketSids * @param action */ private _forSocketsWithTokenIds; /** * Do an action for all sockets with a specific user ids. * @param userIds * @param exceptSocketSids * @param action */ private _forSocketsWithUserIds; /** * Do an action for all sockets with a specific auth user groups. * @param groups * @param exceptSocketSids * @param action */ private _forSocketsWithAuthUserGroups; /** * Do an action for all sockets with the default user group. * @param exceptSocketSids * @param action */ private _forSocketsWithDefaultUserGroup; publishMessage(payload?: any): void; publishTokenTask(action: TokenRemoteTaskAction, operations: ObjectEditOperation[], target: number | string, exceptSocketSids: string[] | string | undefined): void; publishSocketDisconnectTask(target: SocketRemoteTaskTarget, ids: true | string | number | (string | number)[], exceptSocketSids: string[] | string | undefined, payload: { code?: any; data?: any; }): void; publishSocketDeauthenticateTask(target: SocketRemoteTaskTarget, ids: true | string | number | (string | number)[], exceptSocketSids: string[] | string | undefined): void; }