import { authFirst, requireAccount } from "./util";
export const db = {
userQuery: authFirst,
touch: authFirst,
getLegacyTimeTravelInfo: authFirst,
getLegacyTimeTravelPatches: authFirst,
fileUseTimes: authFirst,
removeBlobTtls: requireAccount,
};
export interface DB {
userQuery: (opts: {
project_id?: string;
account_id?: string;
query: any;
options?: any[];
}) => Promise<any>;
touch: (opts: {
account_id?: string;
project_id?: string;
path?: string;
action?: string;
}) => Promise<void>;
getLegacyTimeTravelInfo: (opts: {
account_id?: string;
project_id: string;
path: string;
}) => Promise<{ uuid: string; users?: string[] }>;
getLegacyTimeTravelPatches: (opts: {
account_id?: string;
uuid: string;
timeout?: number;
}) => Promise<string>;
fileUseTimes: (opts: FileUseTimesOptions) => Promise<FileUseTimesResponse>;
removeBlobTtls: (opts: { uuids: string[] }) => Promise<void>;
}
export interface FileUseTimesOptions {
account_id?: string;
project_id: string;
path: string;
target_account_id: string;
limit?: number;
access_times?: boolean;
edit_times?: boolean;
timeout?: number;
}
export interface FileUseTimesResponse {
target_account_id: string;
access_times?: number[];
edit_times?: (number | undefined)[];
}