Value supervisor implements schema-based supervision of a specific value.

Supervision functions include:

  • Access controls

  • Datatype validation

  • Managed instance generation

Supervision is implemented via schema-driven runtime compilation. We perform as much logic as possible at startup to minimize overhead during server operation.

This means we typically ingest schema, create a compact form of denormalized metadata, and/or generate functions to perform required operations.

interface ValueSupervisor {
    access: AccessControl;
    cast: Cast;
    manage: Manage;
    owner: RootSupervisor;
    patch: Patch;
    schema: Schema;
    validate: undefined | Validate;
    Session: any;
    Cast: ((value: Val) => Val);
    Manage: ((reference: Val.Reference, session: Session) => Val);
    Patch: ((changes: Val.Collection, target: Val.Collection, path: DataModelPath) => Val);
    Validate: ((value: Val, session: Session, location: ValidationLocation) => void);
}

Implemented by

Properties

Consolidated access control information for the schema.

cast: Cast

Convert a JS value to the appropriate JS type for the schema.

manage: Manage

Create a managed instance of a value.

The schema manager that owns this ValueSupervisor.

patch: Patch

Apply changes. Does not validate perform validation.

schema: Schema

The logical schema that controls the value's behavior.

validate: undefined | Validate

Perform validation.