Member Junction
    Preparing search index...
    RSUObserverEvent:
        | {
            AffectedTables: string[];
            CompanyIntegrationIDs: string[];
            Descriptions: string[];
            ItemCount: number;
            Kind: "run.start";
            StepTotal: number;
        }
        | {
            Kind: "step.start";
            Name: string;
            StepIndex?: number;
            StepTotal?: number;
        }
        | {
            DurationMs: number;
            Kind: "step.end";
            Message: string;
            Name: string;
            Status: RSUPipelineStep["Status"];
            StepIndex?: number;
            StepTotal?: number;
        }
        | {
            CompanyIntegrationIDs: string[];
            Kind: "restart.pending";
            PendingWorkIDs: string[];
            RemainingSteps: string[];
            StepIndex?: number;
            StepTotal?: number;
            SuccessCount: number;
            TotalCount: number;
        }
        | {
            ErrorMessage?: string;
            ErrorStep?: string;
            FailureCount: number;
            Kind: "run.end";
            Success: boolean;
            SuccessCount: number;
            TotalCount: number;
        }

    A lifecycle notification from the RSU pipeline, delivered to an out-of-band RSUPipelineObserver.

    Why an observer instead of emitting progress directly: an RSU run's steps (CodeGen, compile, restart) take minutes, and until now the only live signal was GetStatus() polling — a caller had no durable record of what a run did, and a restart mid-run left nothing to read. The durable artifact stream that solves that lives in @memberjunction/integration-progress-artifacts, which is a LAYER ABOVE this package. So SchemaEngine publishes plain lifecycle events and lets the server wire them to the emitter, keeping the dependency direction intact.

    Type Declaration

    • {
          AffectedTables: string[];
          CompanyIntegrationIDs: string[];
          Descriptions: string[];
          ItemCount: number;
          Kind: "run.start";
          StepTotal: number;
      }
      • AffectedTables: string[]

        Union of every input's AffectedTables, de-duplicated.

      • CompanyIntegrationIDs: string[]

        Every connection this batch touches, de-duplicated, in input order.

        Carries the run's IDENTITY to the observer. Without it a run artifact has no connection on it, the per-connection authorization check has nothing to test, and the run is unreadable over the API — which is what happened to every RSU run before this field existed. May hold more than one id: a batch legitimately spans connections. May be EMPTY, for a caller that supplied neither CompanyIntegrationID nor PendingWork; such a run stays unreadable through the per-connection endpoints, which is the conservative outcome.

      • Descriptions: string[]

        One description per input, in input order.

      • ItemCount: number

        Number of migrations in this batch.

      • Kind: "run.start"
      • StepTotal: number

        Expected total steps for the run — the denominator of a determinate progress bar.

    • { Kind: "step.start"; Name: string; StepIndex?: number; StepTotal?: number }
    • {
          DurationMs: number;
          Kind: "step.end";
          Message: string;
          Name: string;
          Status: RSUPipelineStep["Status"];
          StepIndex?: number;
          StepTotal?: number;
      }
    • {
          CompanyIntegrationIDs: string[];
          Kind: "restart.pending";
          PendingWorkIDs: string[];
          RemainingSteps: string[];
          StepIndex?: number;
          StepTotal?: number;
          SuccessCount: number;
          TotalCount: number;
      }
      • CompanyIntegrationIDs: string[]

        Connections whose post-restart work is queued. Same set as run.start, restated so a post-restart consumer can correlate from the checkpoint alone.

      • Kind: "restart.pending"

        The process is about to be killed by its own pipeline.

        Emitted immediately BEFORE the RestartMJAPI step, because RestartMJAPI never produces a step.end: pm2 kills this process inside it, so runStep's completion path — and the run.end after it — are unreachable. Without this event the stream simply stops at step.start RestartMJAPI and the run is flagged in-flight forever.

        This is the ONE event the pipeline AWAITS (see RSUPipelineObserver), because an observer that writes it asynchronously would be racing the kill signal.

      • PendingWorkIDs: string[]

        Durable pending-work row IDs registered for this run, for the same correlation.

      • RemainingSteps: string[]

        Steps that will run in the NEXT process, in order.

      • OptionalStepIndex?: number

        1-based position of RestartMJAPI in the executed sequence, for the determinate stepper.

      • OptionalStepTotal?: number

        Expected total steps for the run, INCLUDING the post-restart ones.

      • SuccessCount: number

        Migrations that succeeded and therefore have post-restart work queued.

      • TotalCount: number

        Migrations attempted in this batch.

    • {
          ErrorMessage?: string;
          ErrorStep?: string;
          FailureCount: number;
          Kind: "run.end";
          Success: boolean;
          SuccessCount: number;
          TotalCount: number;
      }
      • OptionalErrorMessage?: string

        Present when the run failed — the first failing step's message.

      • OptionalErrorStep?: string

        Present when the run failed — the name of the step that failed.

      • FailureCount: number
      • Kind: "run.end"
      • Success: boolean
      • SuccessCount: number
      • TotalCount: number