/** * Import/export conversion job types shared between api and web (ADR 0009, * issue #62). A conversion runs asynchronously against the pandoc sidecar; * the client enqueues it and polls `GET /jobs/:id` for this view. */ export type ConversionJobStatus = 'pending' | 'running' | 'succeeded' | 'failed'; export interface ConversionJobView { id: string; status: ConversionJobStatus; kind: string; sourceFormat: string; targetFormat: string; /** Set only when `status` is `failed` — a code from the errors namespace * (`converter_unavailable` | `converter_timeout` | `conversion_failed` | * `quota_exceeded`). */ errorCode: string | null; /** Set once an import job (#63) succeeds: the id of the page it created, so * the client can navigate to it. `null` for a pending/failed import and for * plain byte→byte conversions (export). */ resultPageId: string | null; createdAt: string; updatedAt: string; } /** Extensions the import endpoint accepts (ADR 0009, issues #63/#64). `.docx` * and `.odt` convert via the sidecar (a job to poll); `.md`/`.markdown` import * in-process and come back already `succeeded`. */ export const IMPORT_EXTENSIONS = ['docx', 'odt', 'md', 'markdown'] as const; export type ImportExtension = (typeof IMPORT_EXTENSIONS)[number];