@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.
| interface | adds |
|---|---|
FougereFieldAxes | boundary |
FougereFieldAxes | lifecycle |
FougereFieldAxes | role |
Entries: @fougere/schema
What you import
| name | |
|---|---|
entity | Declares 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 | |
applyCreate | Fills what the declaration leaves to the storage, such as an id or a date. |
applyUpdate | Fills the update: 'now' fields of a patch. |
InputRefusal | |
SchemaError | |
dotted | |
Card | One portable schema description and every decision made about that description. |
Bundle | A portable schema map and the decisions that only a map can make. |
Visibility | |
Cases | The validation cases an entity's fields imply, from a valid row of the complete entity. |
StringFormats | |
Generators | |
UUID_GENERATORS | |
NamedTerm | A name a field gives for a registry to answer. Ex: format: 'slug', generate: 'ulid'. |
Boundaries | |
InputValidator | |
FieldValueValidator | |
JsonSchemaValidator | The one door onto the JSON Schema engine. |
Axes | |
Format | A 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 | |
Entity | An entity class, whichever its fields — what a relation, a prefab or json() is handed. |
SchemaView | |
Fields | |
Shape | |
ShapeType | A shape's type, with date and choice told apart from string. |
OnDelete | What becomes of the rows that name a deleted one. |
ValidationError | |
Verdict | A value admitted, or a refusal saying where inside the value. |
ValidationResult | |
ValidationCase | One input, and the field the validator must refuse. |
FieldDescriptor | |
SchemaBundle | |
SchemaDescriptor | |
Change | |
Diff | |
SetDiff | |
SetDiffOptions | |
FougereEntityAdapters | |
FougereFieldAxes | |
JsonSchema | |
Accepted | The values a format lets in, as a type — Accepted<typeof Lifecycle.format>. |
Axis |