Member Junction
    Preparing search index...
    Index

    Constructors

    Properties

    commandFailures: { context: string; message: string }[] = []

    Every step failure captured during a pipeline run: BEFORE/AFTER commands, SQL scripts, metadata management, the SQL pass, validators, file generation and integrity checks. The pipeline runs every step to the end, then fails (success=false, non-zero exit) with this full list, instead of stopping at the first failure or logging and reporting success.

    Methods

    • Resolve dirty-schema emit options for one generator call. --skipdb (files only) and fileEmit.dirtySchemaOnly === false rebuild every schema; write-if-changed still keeps mtimes stable. A full run with no new/modified entities yields an empty Set — the generator then only writes schema files that are missing.

      Parameters

      Returns SchemaEmitOptions

    • Core CodeGen pipeline logic shared by Run() and RunInProcess(). Accepts an existing data source — does NOT create connections or call process.exit().

      Parameters

      • dataSource: DataSourceResult
      • skipDatabaseGeneration: boolean = false
      • skipFileGeneration: boolean = false

      Returns Promise<boolean>

    • Record any failed entries from a BEFORE/AFTER command batch, paired by index.

      Returns just this batch's failures. Callers log what they get back rather than walking commandFailures, which accumulates across phases — iterating the whole array in the AFTER handler re-logged every BEFORE failure a second time.

      Parameters

      • phase: string
      • cmds: {
            args: string[];
            command: string;
            isDaemon?: boolean | null;
            timeout?: number | null;
            when: string;
            workingDirectory: string;
        }[]
        • args: string[]

          Command line arguments

        • command: string

          The command to execute

        • OptionalisDaemon?: boolean | null

          Marks a long-running service that never exits on its own (e.g. npm start).

          For these, reaching timeout without having crashed IS the pass — the command is a boot check and the timeout is the observation window. Exiting before the timeout is still a failure, because a service that comes down on its own crashed. Requires a positive timeout; without one the process would never be killed and CodeGen would wait forever.

        • Optionaltimeout?: number | null

          Optional timeout in milliseconds

        • when: string

          When to run the command (e.g., 'before', 'after')

        • workingDirectory: string

          Working directory to run the command from

      • results: CommandExecutionResult[]

      Returns { context: string; message: string }[]

    • Records a step failure for the end-of-run list, and logs it now.

      Parameters

      • context: string
      • message: string

      Returns void

    • Parameters

      • skipDatabaseGeneration: boolean = false
      • skipFileGeneration: boolean = false

      Returns Promise<void>

    • Runs the file-generation phase of CodeGen: GraphQL resolvers, entity subclasses (core + non-core), Angular components, DB schema JSON, and action subclasses. Extracted so the caller can skip this phase entirely via --skipfiles / skip_file_generation = true without re-indenting the existing generator logic.

      Parameters

      Returns Promise<boolean>

      true on success, false if any generator reported a fatal error.

    • Run CodeGen in-process with an existing data source. Does NOT create a new DB connection or call process.exit(). Designed for use by RuntimeSchemaManager inside a running MJAPI process.

      Parameters

      • dataSource: DataSourceResult
      • skipDatabaseGeneration: boolean = false
      • OptionalworkingDirectory: string
      • skipFileGeneration: boolean = false

      Returns Promise<boolean>

    • Run CodeGen and return a structured MJCLIResult instead of calling process.exit(). Used by the pluggable mj codegen plugin so the runtime host can render the result per --format before the CLI exits.

      Parameters

      • skipDatabaseGeneration: boolean = false
      • skipFileGeneration: boolean = false

      Returns Promise<MJCLIResult>

    • Acquire the per-platform data source for a CodeGen run.

      Dispatches via MJGlobal.Instance.ClassFactory.CreateInstance(CodeGenDatabaseProvider, platform) — the same factory pattern used elsewhere in CodeGen (see e.g. manage-metadata.ts's get dbProvider()). The actual pool / provider / user-loading lives on the resolved subclass's SetupDataSource() method, so adding a new platform means registering a new provider, not touching the orchestrator.

      Throws when no provider is registered for configInfo.dbPlatform — ClassFactory.CreateInstance returns the abstract base on a missed lookup, so we disambiguate by constructor identity.

      Returns Promise<DataSourceResult>

    • The entities the post-run CRUD validator expects routines for: IncludeInAPI and in scope. An out-of-scope schema's routines belong to another run (#3384).

      Type Parameters

      • T extends { IncludeInAPI: boolean; SchemaName: string }

      Parameters

      • entities: T[]
      • excludeSchemas: string[] | undefined

      Returns T[]

    • Formats the end-of-run failure list. Returns an empty string when there are none.

      Parameters

      • failures: readonly { context: string; message: string }[]

      Returns string

    • True when a CORE file-generation pass has no in-scope entities, so it must not run (#3384). Those passes rewrite whole files from the entity list, so running one on an empty list (the core schema left out of includeSchemas, or excluded) would empty its output. The skip is logged as a warning.

      Parameters

      • passLabel: string

        name of the pass, for the log

      • entities: readonly EntityInfo[]

        the pass's scope-narrowed entity list

      Returns boolean