@fougere/schema

The entity and its 4 axes — shape, role, lifecycle, boundary. Subject-owned judgments, edge-safe.

What it extends

The interfaces of Fougere this package adds its words to, with declare module — see Interfaces to extend.

interfaceadds
FougereFieldAxesboundary
FougereFieldAxeslifecycle
FougereFieldAxesrole

Entries: @fougere/schema

What you import

name
entityDeclares an entity: its fields, and what it states about them. Ex: class Post extends entity({ id: primary(), title: text() }) {}.
ANONYMOUS_SCHEMA_NAME
Schema
Field
FieldSet
Shapes
Role
ON_DELETE
Lifecycle
Boundary
applyCreateFills what the declaration leaves to the storage, such as an id or a date.
applyUpdateFills the update: 'now' fields of a patch.
InputRefusal
SchemaError
dotted
CardOne portable schema description and every decision made about that description.
BundleA portable schema map and the decisions that only a map can make.
Visibility
CasesThe validation cases an entity's fields imply, from a valid row of the complete entity.
StringFormats
Generators
UUID_GENERATORS
NamedTermA name a field gives for a registry to answer. Ex: format: 'slug', generate: 'ulid'.
Boundaries
InputValidator
FieldValueValidator
JsonSchemaValidatorThe one door onto the JSON Schema engine.
Axes
FormatA format, written as keys; its JSON Schema and its type are produced. Ex: Format.of('axis/tenancy').key('scope', Format.tokens(SCOPES)).closed().

Types

TypeScript types only — they do not run. Import them with import type to type your own code: a variable, a parameter, an option object.

name
SchemaConstructor
EntityAn entity class, whichever its fields — what a relation, a prefab or json() is handed.
SchemaView
Fields
Shape
ShapeTypeA shape's type, with date and choice told apart from string.
OnDeleteWhat becomes of the rows that name a deleted one.
ValidationError
VerdictA value admitted, or a refusal saying where inside the value.
ValidationResult
ValidationCaseOne input, and the field the validator must refuse.
FieldDescriptor
SchemaBundle
SchemaDescriptor
Change
Diff
SetDiff
SetDiffOptions
FougereEntityAdapters
FougereFieldAxes
JsonSchema
AcceptedThe values a format lets in, as a type — Accepted<typeof Lifecycle.format>.
Axis
Built with Fougere and Nuxt, hosted on GitHub Pages.