import { SessionUser, SessionContext } from '../SessionContext'; import { SearchQueryDTO } from '../../../common/entities/SearchQueryDTO'; import { SharingEntity } from './enitites/SharingEntity'; export declare class SessionManager { static readonly NO_PROJECTION_KEY: string; private stamps; private stampGeneration; private static andQueries; /** * Creates the user that is used during a sharing session. * It inherits the restrictions of the sharing creator. */ createSharingUser(sharing: SharingEntity): SessionUser; /** * Signature of the DB row a session is based on: the user, or the sharing (with its creator). * Sessions are stored in the cookie, a session is only valid while its stamp is unchanged, * so deleting or changing the user or sharing ends it. Null if the row does not exist or the sharing expired. */ getSessionStamp(user: SessionUser): Promise; /** * Needs to be called after every user or sharing change. */ invalidateSessionCache(): void; private loadSessionRow; /** * Returns with the final projection query (media and directory allow/block lists) of a sharing. */ buildAllowListForSharing(sharing: SharingEntity): SearchQueryDTO | null; createProjectionKey(q: SearchQueryDTO): string; buildContext(user: SessionUser): Promise; getAvailableUserSessions(): Promise; private buildDirectoryFilter; /** * Returns the media and the directory allow/block lists combined. * Media that is in a not available directory is also not available. */ private getQueryForUser; private getMediaQueryForUser; /** * Returns the user's own lists if they are overridden, otherwise the global ones from the config. */ private getDirectoryListsForUser; /** * A directory is available if it matches every allow list and none of the block list entries. * The directory query of a sharing works as an extra allow list (on top of the creator's lists). */ private getDirectoryAccessForUser; }