@metreeca/blue - v0.10.0
    Preparing search index...

    Interface ReferenceShape

    Shape definition for resource references.

    Inheritance

    When a ResourceShape extends a parent via extends, reference-valued entries are merged according to the following rules. The child is the extending shape; the parent is the inherited shape.

    Field Override Rule
    kind Cannot be overridden
    model Must be strictly equal — mismatch signals incompatible shapes
    foreign Cannot be overridden
    captive Cannot be overridden
    shape Cannot be overridden
    interface ReferenceShape {
        kind: "reference";
        model: string;
        shape: Lazy<ResourceShape>;
        foreign?: boolean;
        captive?: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    kind: "reference"

    Discriminator identifying this as a reference shape.

    Inheritance — cannot be overridden.

    model: string

    Placeholder prototype identifier.

    A retrieval placeholder matched by JSON type alone: its value is immaterial and need not be a legal identifier for the target, so the reference factory always stores the generic default base IRI (app:/) without resolving the target.

    Inheritance — must be strictly equal between parent and child.

    "app:/"

    Target resource shape for the referenced resource.

    Accepts a lazy value to support circular and self-referential definitions.

    Inheritance — cannot be overridden.

    foreign?: boolean

    Marks the reference as managed by the target resource.

    Foreign references are read-only from the source resource perspective: included in retrieval templates but rejected during resource validation. The link is owned by the target resource, not by the source resource declaring the foreign reference.

    During resource validation, entries backed by a foreign reference shape are rejected if present in the input. During template validation, foreign entries are accepted normally, since templates describe data retrieval rather than state updates.

    Important

    Foreign references are independent from reverse mappings. A reverse mapping on a property writes an actual inverse property mapping; a foreign reference is a read-only view over mappings owned by another property and does not write any mappings on insert.

    Inheritance — cannot be overridden.

    undefined (false)

    captive?: boolean

    Marks the referenced resource as unable to outlive the source resource.

    Captive resources have independent identity and lifecycle: they can be created, updated, and deleted independently of the referencing resource. However, they are existentially dependent on the source resource: they cannot outlive it and are automatically cascade-removed when it is deleted.

    Important

    Captive resources are independent from embedded resources. Embedded resources have no independent identity or lifecycle (id rejected during state validation) and are always managed as part of their parent; captive resources have both and can be managed independently, but are cascade-deleted with the source resource.

    Inheritance — cannot be overridden.

    undefined (false)