import { type Database } from "./database.js"; /** * Read-only chat share links (migration 1092). Every owner read and write runs * in the chat's workspace RLS context; the public read uses the share-link * lane, which names one share id in `opengeni.session_share_id` and sees only * that live row. Callers decide who may share; these functions keep one live * link per chat and person. */ export type SessionShareLinkScope = { accountId: string; workspaceId: string; }; export type SessionShareLinkRecord = { id: string; shareId: string; accountId: string; workspaceId: string; sessionId: string; createdBySubjectId: string; title: string; snapshot: unknown; snapshotThroughSequence: number; createdAt: Date; updatedAt: Date; revokedAt: Date | null; }; /** The share ids this module writes and the lane accepts: base64url, 22-64 characters. */ export declare const SESSION_SHARE_ID_PATTERN: RegExp; /** * Create this person's live link for a chat, or refresh its snapshot and title * when one exists (the link itself stays the same). `shareId` is used only * when a new link is created. */ export declare function saveSessionShareLink(db: Database, scope: SessionShareLinkScope, input: { sessionId: string; createdBySubjectId: string; shareId: string; title: string; snapshot: unknown; snapshotThroughSequence: number; }): Promise<{ link: SessionShareLinkRecord; created: boolean; }>; /** This person's live link for a chat, if any. */ export declare function getLiveSessionShareLink(db: Database, scope: SessionShareLinkScope, input: { sessionId: string; createdBySubjectId: string; }): Promise; /** This person's live links in a workspace, newest first. */ export declare function listLiveSessionShareLinks(db: Database, scope: SessionShareLinkScope, input: { createdBySubjectId: string; limit: number; }): Promise; /** Stop this person's live link for a chat. Returns it, or null when there was none. */ export declare function revokeSessionShareLink(db: Database, scope: SessionShareLinkScope, input: { sessionId: string; createdBySubjectId: string; }): Promise; /** * The live link a share id names, across every workspace (the share-link * lane). Only that row is visible; nothing else about any workspace is. */ export declare function findLiveSessionShareLink(db: Database, shareId: string): Promise;