import type { ContentState } from "@aotter/mantle-spec"; import type { EntrySort } from "../../../domain/port/EntryRepository.js"; import type { HandlerContext } from "../../../domain/model/HandlerContext.js"; /** * Content-op request DTOs. Each verb takes its own request type; * response is `EntryRow` (or `{ removed: boolean }` for delete) which * lives in `domain/model/`. Per the clean-arch DTO rule, no loose * primitives — every input field is named on the DTO. * * Mutating verbs carry an optional `ctx: HandlerContext` so the * `LifecycleHookingEntryRepository` decorator can fire hooks with the * caller's auth + env when invoked from a real dispatcher (HTTP * Trigger, MCP, admin endpoint). Test paths and internal writes leave * it unset and the decorator falls back to an anonymous ctx. */ export interface ContentMutationFields { readonly ctx?: HandlerContext; /** Pre-projection input forwarded only to synchronous `before_*` * hooks. Deferred `after_*` delivery uses persisted row data and * never retains side-channel fields such as CAPTCHA tokens. */ readonly originalInput?: unknown; } export interface CreateDraftRequest extends ContentMutationFields { readonly collection: string; readonly data: Record; readonly authorId: string | null; } export interface UpdateDraftRequest extends ContentMutationFields { readonly id: string; readonly collection: string; readonly expectedVersion: number; /** Partial data — merged onto the existing row's `data` blob. */ readonly data: Record; } export interface GetEntryRequest { readonly id: string; readonly collection: string; } export interface ListEntriesRequest { readonly collection: string; readonly status?: ContentState; readonly limit?: number; /** Opaque cursor from a prior `ListEntriesResult.nextCursor`. */ readonly cursor?: string; readonly cursorDirection?: "forward" | "backward"; /** Free-text filter matched against id and Schema.searchableFields. */ readonly search?: string; /** One exact, indexed enum filter exposed by the Schema. */ readonly filter?: EntryFilter; /** Admin parent/child list scope: exact match on a required x-mantle-ref field. */ readonly scope?: EntryFilter; readonly sort?: EntrySort; } export interface EntryFilter { readonly field: string; readonly value: string; } export interface RequestPublishRequest extends ContentMutationFields { readonly id: string; readonly collection: string; } export interface UnpublishRequest extends ContentMutationFields { readonly id: string; readonly collection: string; } export interface ArchiveRequest extends ContentMutationFields { readonly id: string; readonly collection: string; } export interface DeleteEntryRequest extends ContentMutationFields { readonly id: string; readonly collection: string; } export interface DeleteEntryResponse { readonly removed: boolean; } //# sourceMappingURL=index.d.ts.map