Member Junction
    Preparing search index...

    Analyzes and sorts records based on their dependencies

    Index

    Constructors

    Methods

    • Main entry point: analyzes all records in a file and returns them in dependency order.

      Parameters

      • records: RecordData[]

        The records from a metadata file

      • entityName: string

        The root entity name for these records

      Returns Promise<DependencyAnalysisResult>

      Analysis result with sorted records

      Use flattenFileRecords() + analyzeAllDependencies() for multi-file scenarios to enable cross-file dependency detection. This method only detects dependencies within a single file.

    • Find all transitive dependents of a set of records This is useful for finding all records that must be deleted when deleting a parent

      Parameters

      • recordIds: Set<string>

        Set of record IDs to find dependents for

      • reverseDependencies: Map<string, ReverseDependency[]>

        Reverse dependency map

      Returns Set<string>

      Set of all record IDs that depend on the input records (transitively)

    • Phase 1: Flatten records from a single file without analyzing dependencies.

      This method flattens records including nested relatedEntities and assigns unique IDs, but does NOT analyze dependencies. Use this when collecting records from multiple files before running global dependency analysis.

      After collecting records from all files, call analyzeAllDependencies() to resolve cross-file dependencies.

      Parameters

      • records: RecordData[]

        The records from a metadata file

      • entityName: string

        The root entity name for these records

      Returns FlattenedRecord[]

      Flattened records (dependencies not yet resolved)