/** * S3 Batch Store - Durable storage for sync batches. * * Uploads sync batches to S3 after each debounced sync operation, * providing durability and enabling disaster recovery. */ import { type S3Client } from '@aws-sdk/client-s3'; import { type S3StorageConfig, type StoragePathResolver } from './s3-config.js'; /** * A sync batch to be stored in S3. */ export interface SyncBatch { /** Unique batch identifier */ batchId: string; /** Database ID this batch belongs to */ databaseId: string; /** Timestamp when batch was created */ timestamp: string; /** Client ID that originated the changes */ clientId: string; /** The sync changes in this batch */ changes: unknown[]; /** Optional metadata */ metadata?: Record; } /** * S3 Batch Store for durable sync batch storage. */ export declare class S3BatchStore { private readonly client; private readonly config; private readonly resolveStoragePath; constructor(client: S3Client, config: S3StorageConfig, resolveStoragePath?: StoragePathResolver); /** * Store a sync batch in S3. * * @param databaseId - Database identifier * @param clientId - Client that originated the changes * @param changes - The sync changes to store * @param metadata - Optional metadata to include * @returns The stored batch with its ID and timestamp */ storeBatch(databaseId: string, clientId: string, changes: unknown[], metadata?: Record): Promise; /** * Store multiple batches in parallel. */ storeBatches(batches: Array<{ databaseId: string; clientId: string; changes: unknown[]; metadata?: Record; }>): Promise; /** * List batch keys stored after a given timestamp. * Returns S3 keys in chronological order. */ listBatchesSince(databaseId: string, sinceTimestamp: string): Promise; /** * Download and parse a batch by its S3 key. */ downloadBatch(key: string): Promise; } /** * Create an S3 batch store from configuration. */ export declare function createS3BatchStore(client: S3Client, config: S3StorageConfig, resolveStoragePath?: StoragePathResolver): S3BatchStore; //# sourceMappingURL=s3-batch-store.d.ts.map