import { EntryDataValidator, type SchemaManifest } from "@aotter/mantle-spec"; import type { Clock } from "../../domain/port/Clock.js"; import type { EntryRepository } from "../../domain/port/EntryRepository.js"; import type { IdGenerator } from "../../domain/port/IdGenerator.js"; import type { LocalePolicyReader } from "../../domain/port/SiteConfigRepository.js"; import type { InvokeBuiltinRequest } from "../dto/procedure/index.js"; /** * `InvokeBuiltinUseCase` — executes the `handler.kind: builtin` op * (POC ADR-0014). The four ops map 1:1 to the entry-writer chokepoint: * * - `create` → `entries.create` with a generated id. Content starts * as a draft; `lifecycle: operational` records start live. * Input is projected through * `domain/service/BuiltinProjector.projectAndStamp` so only * Schema-declared keys land in `data` and `x-mantle-bind` fields are * server-stamped from `ctx`. * - `update` → `entries.update`. Caller supplies `id` + * `expectedVersion` (observed native `entry.version` at read time, * not version+1); OCC enforced at the chokepoint. A successful write * still bumps storage to expectedVersion+1. * - `upsert` → create when no row matches and the caller omitted * `expectedVersion`; update when a row matches, using the **caller** * token (never `preloaded.version`). A versioned write for a missing * row is NOT_FOUND (do not recreate). Create-intent against an * existing row is INPUT_VALIDATION_FAILED (do not overwrite). * - `delete` → guarded `entries.delete(...)` over the loaded row snapshot. * * Pre-projection original input is forwarded to the chokepoint via * `originalInput`, so synchronous `before_*` hooks can read side-channel * fields (CAPTCHA tokens, etc.) declared on the Procedure input but not * on the Schema. * * Auth + input/output validation happen upstream in * `InvokeProcedureUseCase`. This use case trusts its `validatedInput`. */ export declare class InvokeBuiltinUseCase { private readonly entries; private readonly schemasByName; private readonly clock; private readonly idgen; private readonly siteConfig?; private readonly validator; constructor(entries: EntryRepository, schemasByName: ReadonlyMap, clock: Clock, idgen: IdGenerator, siteConfig?: LocalePolicyReader | undefined, validator?: EntryDataValidator); run(request: InvokeBuiltinRequest): Promise; private opCreate; private opUpdate; private opUpsert; private opDelete; private opArchive; } //# sourceMappingURL=InvokeBuiltinUseCase.d.ts.map