Member Junction
    Preparing search index...

    Metadata-aware application of a FieldRuleSet to MJ entity records. Instantiate once per bulk run and reuse across records so the underlying expression cache is shared. Holds an acting user for the built-in lookup resolver.

    Index

    Constructors

    • Parameters

      • OptionalcontextUser: UserInfo

        The acting user, used by the built-in RunView-backed lookup resolver (required server-side; client-side may omit it).

      • OptionalpromptResolver: PromptResolver

        Optional resolver for prompt rule sources. Core does not depend on the AI stack, so this is injected by a higher layer that has an AIPromptRunner (the bulk-update processor supplies one). Omit it and any prompt rule reports a clear error instead of running.

      • OptionalentityDocumentResolver: EntityDocumentResolver

        Optional resolver for entityDocument rule sources. Core does not depend on the templates/AI stack, so this is injected by a higher layer that can render an Entity Document (the processor supplies one). Omit it and any entityDocument rule reports a clear error.

      Returns EntityFieldRules

    Methods

    • Computes the per-field changes for a loaded entity — WITHOUT mutating it — coercing each new value to the target field's type. This is the dry-run primitive.

      Parameters

      • entity: BaseEntity

        A loaded entity (its current values are the "old" side of the diff).

      • ruleSet: FieldRuleSet

        The rules to evaluate.

      • Optionalcontext: Record<string, unknown>

        Optional extra data the rules may reference (merged over the entity's fields).

      Returns Promise<FieldChange[]>