API Reference Enact v#0.1.0

Copy Markdown View Source

Modules

A thin, behaviour-based action layer for application write operations.

The behaviour every action module implements.

Answers anonymous?/1 for any actor term.

The per-invocation context threaded through every pipeline step.

Opt-in helper that generates context one-liners for Enact.run/3, Enact.dry_run/3, Enact.subject/3, and Enact.authorized/3.

The closed error taxonomy for action results.

Mechanical enforcement of input-schema invariants — every "just don't do X" rule that is detectable gets detected and raised, upgrading conventions to invariants.

The contract for top-level input-schema modules — plain Ecto embedded schemas that adopt this behaviour via use Enact.InputSchema, which sets @behaviour and imports cast_input/4 and nothing more. use Ecto.Schema, import Ecto.Changeset, and @primary_key false stay explicit in the module. Plain @behaviour + import remains equivalent.

The result of Enact.dry_run/3 — a distinct struct so callers are structurally unable to confuse "validated" with "executed".

Reference resolution — the pipeline step that turns payload references (public-facing IDs like usr_XXXX) into loaded records.

Shared test helpers for host-app action tests (and Enact's own suite).

Changeset-pipeline combinators for action validate/2 callbacks.