import { S3Client, type GetObjectCommandOutput } from "@aws-sdk/client-s3"; import type { SupabaseStorageConfig } from "./config.js"; import type { StorageFile } from "./manifest.js"; /** * 从 GetObject 响应提取文件的可恢复元数据。Supabase 的 S3 handler 把这些头直接 * 从 storage.objects.metadata / user_metadata 取出(content-type、cache-control、 * x-amz-meta-*,源码实证 2026-07-24)——所以这份元数据与刚流过的字节**原子一致**, * 不存在"拷完再查 DB"的并发漂移窗口,也不依赖 DB 上 storage schema 的读权限。 * 缺席的头不落字段(= 源端未设置/未提供),不猜测。 */ export declare function fileMetadataFromS3(got: GetObjectCommandOutput): { contentType?: string; cacheControl?: string; contentEncoding?: string; metadata?: Record; lastModified?: string; }; /** * 仅列举、不下载 —— 用于接入时的容量/egress 估算,几乎不产生 egress。 */ export declare function measureStorage(cfg: SupabaseStorageConfig): Promise<{ fileCount: number; totalBytes: number; buckets: string[]; }>; /** * 把 Supabase Storage 的每个文件流式拷贝到目标桶,边拷边算 sha256。 * 目标键:/storage//<原始 key>。 */ export declare function syncStorage(cfg: SupabaseStorageConfig, target: { client: S3Client; bucket: string; base: string; }): Promise<{ fileCount: number; totalBytes: number; files: StorageFile[]; buckets: string[]; }>;