import { type ZodObject, type ZodRawShape, z } from "zod"; /** * @packageDocumentation * @module act/types * @category Types * Zod schemas and helpers for the Act Framework. */ /** * An empty Zod schema (no properties). */ export declare const ZodEmpty: z.ZodRecord; /** * Sensitive-data foundation re-exports (#855 / epic #566). * * - `REDACTED` / `SHREDDED` — sentinels placed in `event.data[field]` * when the caller isn't authorized to see a sensitive field * (`.discloses(predicate)` returned `false` or none was declared — * recoverable) or the underlying PII was wiped (`Store.forget_pii` — * irrecoverable). * top-level field names marked via {@link sensitive}. A pure, * read-only helper that inspects the out-of-band sensitive registry (a * process-global `WeakMap`) `sensitive()` populates, otherwise * unreachable from outside the package. Surfaced for adapters and * tooling that must reflect input sensitivity on their own wire * surface — e.g. the `@rotorsoft/act-http/openapi` emitter marks these * fields `writeOnly` + `format: password` so generated clients and * Swagger UI don't echo PII freely. Returns `[]` for non-object * schemas or objects with no sensitive fields; top-level shape only. */ export { pii_fields, REDACTED, SHREDDED } from "../internal/sensitive.js"; /** * Mark a Zod schema as sensitive. Returns the same schema instance — the * marker is registered out-of-band so the static type is preserved and the * call site reads as a pure annotation. * * Idempotent: re-wrapping an already-sensitive schema is a no-op. * * The marker is what the orchestrator inspects to split event payloads into * `data` + `pii` on commit, gate reads via `.discloses`, and strip handler * payloads. Part of the sensitive-data foundation (#855 / epic #566). * * @example * ```ts * import { z } from "zod"; * import { state, sensitive } from "@rotorsoft/act"; * * const UserRegistered = z.object({ * email: sensitive(z.string()), * name: sensitive(z.string()), * plan: z.enum(["free", "pro"]), // not sensitive — stays in events.data * }); * ``` * * @param schema - The Zod schema to mark sensitive. * @returns The same schema instance, unmodified at the type level. */ export declare function sensitive(schema: T): T; /** * Zod schema for an actor (user, system, etc.). */ export declare const ActorSchema: z.ZodReadonly>; /** * Zod schema for a target (stream and actor info). */ export declare const TargetSchema: z.ZodReadonly>; expectedVersion: z.ZodOptional; }, z.core.$loose>>; /** * Zod schema for causation event metadata. */ export declare const CausationEventSchema: ZodObject<{ id: z.ZodNumber; name: z.ZodString; stream: z.ZodString; }, z.core.$strip>; /** * Zod schema for event metadata (correlation and causation). */ export declare const EventMetaSchema: z.ZodReadonly>; expectedVersion: z.ZodOptional; }, z.core.$loose>>, ZodObject<{ name: z.ZodString; }, z.core.$strip>>>; event: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>>; /** * Zod schema for committed event metadata (id, stream, version, created, meta). */ export declare const CommittedMetaSchema: z.ZodReadonly>; expectedVersion: z.ZodOptional; }, z.core.$loose>>, ZodObject<{ name: z.ZodString; }, z.core.$strip>>>; event: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>>; }, z.core.$strip>>; /** * Type representing the full state schema for a domain. * @property events - Map of event names to Zod schemas. * @property actions - Map of action names to Zod schemas. * @property state - Zod schema for the state object. */ export type StateSchema = Readonly<{ events: Record | typeof ZodEmpty>; actions: Record | typeof ZodEmpty>; state: ZodObject; }>; /** * Query options for event store queries. */ export declare const QuerySchema: z.ZodReadonly; names: z.ZodOptional>; before: z.ZodOptional; after: z.ZodOptional; limit: z.ZodOptional; created_before: z.ZodOptional; created_after: z.ZodOptional; backward: z.ZodOptional; correlation: z.ZodOptional; with_snaps: z.ZodOptional; stream_exact: z.ZodOptional; }, z.core.$strip>>; //# sourceMappingURL=schemas.d.ts.map