import { type Database } from "./database.js"; export declare function recordAppPackageExport(db: Database, input: { accountId: string; workspaceId: string; objectKey: string; /** Seconds until it is swept; 24 hours by default. */ ttlSeconds?: number; }): Promise<{ id: string; expiresAt: Date; }>; /** * The package an app was installed or last upgraded from (migration 1548), * or null for an app made here. Read without access checks: callers have * already opened the app as the person. */ export declare function getAppPackageId(db: Database, workspaceId: string, appId: string): Promise; /** Record the package an app came from (install, or an applied upgrade). */ export declare function setAppPackageId(db: Database, workspaceId: string, appId: string, packageId: string): Promise; export type DueAppPackageExport = { id: string; accountId: string; workspaceId: string; }; /** Expired exports whose delete is due, across workspaces (ids only). */ export declare function listDueAppPackageExports(db: Database, limit?: number): Promise; /** * Take one due export for deleting: its object key, or null when another * sweeper has it or it is gone. The claim holds it for a few minutes. */ export declare function claimAppPackageExport(db: Database, input: { id: string; workspaceId: string; }): Promise<{ objectKey: string; attempts: number; } | null>; /** * After deleting the object: remove its record (no error), or keep it for a * later retry with exponential backoff and the error. */ export declare function settleAppPackageExport(db: Database, input: { id: string; workspaceId: string; attempts: number; error?: string | null; }): Promise; /** A workspace's stored export keys, read before the workspace is deleted. */ export declare function listAppPackageExportKeys(db: Database, workspaceId: string): Promise;