import type { AuditExportResource, AuditExporterDef } from '@moxxy/sdk'; /** * How far this destination has been caught up to. * * Per destination, not per machine: two collectors are allowed to be at * different points, and one being down must not stall the other. */ export interface ExportCheckpoint { /** Last fully or partially exported day, `YYYY-MM-DD`. */ readonly day: string; /** Highest `seq` within that day known to be durably accepted. */ readonly seq: number; } export interface ExportResult { readonly sent: number; readonly batches: number; readonly checkpoint: ExportCheckpoint | null; /** Set when the run stopped early. The checkpoint still reflects what landed. */ readonly stoppedBecause?: string; } export interface ExportOptions { readonly endpoint: string; readonly resource: AuditExportResource; readonly settings?: Readonly>; readonly batchSize?: number; readonly checkpointDir?: string; readonly signal?: AbortSignal; } export declare function readCheckpoint(exporter: string, endpoint: string, dir?: string): Promise; /** * Ship everything recorded since the last checkpoint. * * Ordering is the whole design. The checkpoint is written only AFTER `send` * resolves, so a crash or a failed export re-offers the batch rather than * skipping it. Duplicates are possible and deliberate: every record carries a * chain hash a collector can deduplicate on, so at-least-once with a stable id * is the right trade against at-most-once with silent gaps. * * Stops at the first failing batch instead of skipping ahead. Continuing past a * failure would advance the checkpoint over records that never landed, which is * exactly the invisible hole this exists to avoid. */ export declare function exportAuditTrail(exporter: AuditExporterDef, opts: ExportOptions): Promise; /** * Records a run would ship right now, without shipping them. For `--dry-run` * and for the doctor row. * * `excludeSessionId` exists for the diagnostic case: booting a session to ask * the question writes a record of its own, so a check that counted it could * never report "up to date", and a check that always warns teaches people to * ignore it. */ export declare function pendingExportCount(exporter: string, endpoint: string, dir?: string, excludeSessionId?: string): Promise; //# sourceMappingURL=export.d.ts.map