import type { ContentState, Entry, JsonSchema, SchemaManifest } from "@aotter/mantle-spec"; /** * `EntryRow` — semantic stored-record shape. SQLite/D1 projects it onto one * native table per Schema; non-SQL adapters preserve the same contract. * `version` is OCC and bumps on every persisted update. */ export interface EntryRow { readonly id: string; readonly collection: string; /** Lifted from `data.locale` at read time (ADR-0010). `undefined` * when the Schema is not localized or the entry doesn't carry a * locale. */ readonly locale?: string; readonly status: ContentState; readonly version: number; readonly data: Record; readonly authorId: string | null; readonly createdAt: number; readonly updatedAt: number; } /** * Lift `data.locale` to the top-level `locale?` field. Centralised so * every repository impl (DatabaseDriver-backed, in-memory test fake, * future adapters) derives the convenience field the same way — * adding a per-impl hydration helper would let them drift. */ export declare function liftLocale(data: Record): string | undefined; /** Native SQL represents an omitted nullable field as NULL. Apply the same * projection in semantic adapters so preview and deployed reads agree. */ export declare function materializeNullableFields(schema: SchemaManifest, data: Record): Record; /** `nullable: true` and `type`/`oneOf` that include `null` are the same persistence spelling. */ export declare function isNullableJsonSchema(property: JsonSchema): boolean; /** Explicit public projection. Keep this field-by-field so adding another * persistence-only property to `EntryRow` cannot silently expose it. */ export declare function projectPublicEntry(row: EntryRow): Entry; export declare class EntryVersionConflict extends Error { readonly id: string; readonly expected: number; readonly actual: number; constructor(id: string, expected: number, actual: number); } /** * Thrown by `transitionStatus({ expectedStatus })` when the row's * current status doesn't match. Distinct from version conflict * because it carries `ContentState` instead of numeric version, so * the orchestration layer can emit a tailored CONFLICT diagnostic * (e.g. "expected 'draft', found 'published'"). */ export declare class EntryStatusConflict extends Error { readonly id: string; readonly expected: ContentState; readonly actual: ContentState; constructor(id: string, expected: ContentState, actual: ContentState); } /** * Thrown by repository implementations when an insert or update violates * a Schema unique index constraint. */ export declare class EntryUniqueConflict extends Error { readonly collection: string; readonly fields: Record | readonly string[]; constructor(collection: string, fields: Record | readonly string[], message?: string); } //# sourceMappingURL=EntryRow.d.ts.map