Member Junction
    Preparing search index...

    Main facade for the MemberJunction Version History system.

    Provides a unified API for:

    • Creating named version labels (system-wide, entity-scoped, or record-scoped)
    • Capturing record state snapshots linked to labels
    • Comparing state between two labels or between a label and current state
    • Restoring records to a labeled state with dependency ordering
    • Walking entity dependency graphs

    Each method delegates to a specialized sub-engine:

    • LabelManager: label CRUD and lifecycle
    • SnapshotBuilder: captures record state into label items
    • DiffEngine: compares snapshots between labels
    • RestoreEngine: applies labeled state back to records
    • DependencyGraphWalker: traverses entity relationships

    Usage:

    const engine = new VersionHistoryEngine();

    // Create a label capturing a record and its dependencies
    const label = await engine.CreateLabel({
    Name: 'Before Refactor',
    Scope: 'Record',
    EntityName: 'MJ: AI Prompts',
    RecordKey: promptKey,
    IncludeDependencies: true,
    }, contextUser);

    // Later: see what changed since the label
    const diff = await engine.DiffLabelToCurrentState(label.Label.ID, contextUser);

    // Restore if needed
    const result = await engine.RestoreToLabel(label.Label.ID, {}, contextUser);
    Index

    Constructors

    Methods