import type { PageClassification } from './pages'; /** * The full pond archive (issue #305): the last download offered before a pond * is trashed, and before a Site Admin purges one for good. * * A PRESERVATION format, not a backup — there is no importer, on purpose. * What that buys is a documented, versioned description of everything the * Markdown alone cannot carry, so an importer can be written later without * guesswork. The format is documented in * `docs/architecture/pond-archive-format.md`. */ /** Bumped whenever the manifest's shape changes in a way a reader must know * about. A reader that does not recognise the version should refuse rather * than guess. */ export const POND_ARCHIVE_FORMAT_VERSION = 1; export interface PondArchiveLabel { id: string; name: string; color: string; parentId: string | null; } export interface PondArchivePage { id: string; slug: string; title: string; /** The hierarchy Markdown cannot express — null for a top-level page. */ parentId: string | null; /** Sibling order, as stored (ADR 0012's fractional key). */ sortKey: string; classification: PageClassification; labelIds: string[]; createdAt: string; updatedAt: string; /** Path of the page's Markdown inside the archive. */ file: string; } export interface PondArchiveComment { id: string; pageId: string; parentId: string | null; body: string; /** Display name at export time; the account may be gone by the time anyone * reads this, and the archive should stay readable. */ author: string | null; createdAt: string; editedAt: string | null; resolvedAt: string | null; } export interface PondArchiveAttachment { id: string; /** Null for an attachment that belongs to the pond rather than a page. */ pageId: string | null; fileName: string; mimeType: string; sizeBytes: number; /** SHA-256 of the stored bytes (issue #199), so a reader can verify them. */ sha256: string | null; createdAt: string; file: string; } export interface PondArchiveManifest { kind: 'dorfteich-pond-archive'; formatVersion: number; exportedAt: string; /** False when the exporter could not read every page — see `omittedPages`. * Stated in the archive itself so a later reader is never misled about * what they are holding. */ complete: boolean; omittedPages: number; /** Highest classification contained (ADR 0022), stated once. */ classification: PageClassification; pond: { name: string; slug: string; type: string; createdAt: string; settings: Record; }; labels: PondArchiveLabel[]; pages: PondArchivePage[]; comments: PondArchiveComment[]; attachments: PondArchiveAttachment[]; /** Every file in the archive with its level — the #210 manifest property, * kept so the bulk-egress channel stays machine-checkable after unpacking. */ files: { path: string; classification: PageClassification }[]; } /** What the UI asks for before offering the download, so it can say how much * of the pond the requester would actually get. */ export interface PondArchivePreview { totalPages: number; includedPages: number; omittedPages: number; complete: boolean; }