Member Junction
    Preparing search index...

    Read API for the progress artifacts. Frontend / health-check / resumption code uses this to inspect ongoing or completed runs without touching the emitter.

    Implementation is purely file-system reads; no shared state with the emitter (an emitter in another process can write while this reader tails).

    Read cost is part of the contract. A run's journal reaches 12–13 k events with multi-KB payloads, and on App Service's SMB filesystem IntegrationListRuns with limit:1 once took 73 seconds and then timed out (MJ-RUN-5/21) — because it hydrated EVERY run before applying the limit, and each hydration read the whole journal four times. So:

    • every filter ListRuns supports is answered from manifest.json/result.json, and the limit is applied BEFORE anything opens a journal;
    • a run that finished carries its own numbers in result.json, and they are taken from there rather than re-derived;
    • when a journal must be read, it is read ONCE and every value comes out of that pass.
    Index

    Constructors

    Accessors

    Methods

    • Per-entity outcome counts for a sync run, recovered from its event stream.

      The run ROW records only TotalRecords, so history could never show created vs updated vs skipped per table — the field existed on the API type and was never populated, which is what thing.txt saw as an empty breakdown. The engine already emits every number needed on sync.entity-map.complete; this reads them back.

      Honest ceiling: artifacts are pruned by the retention cap and are node-local, so a run old enough to have been pruned yields nothing. The caller must render that as "not recorded" rather than as zeros.

      Parameters

      • runID: string

      Returns Promise<
          {
              EntityName: string;
              ErrorCount: number;
              InsertCount: number;
              SkipCount: number;
              UpdateCount: number;
          }[],
      >

    • List runs, newest-STARTED first.

      Ordering is by the manifest's startedAt, not by directory mtime. A stranded run stops being written to, so its mtime freezes at the moment it stranded and mtime ordering sank it below every later run — hiding, behind the limit, exactly the run an operator is looking for. A start time never moves. (The same reasoning governs retention; see IntegrationProgressEmitter.pruneOldRuns.)

      offset exists because the caller authorization-filters AFTER this returns, so a short page does not mean the source is exhausted — it may just mean the caller could not read some of what came back. Without an offset there is no way to ask for the next slice, and both UI surfaces faked paging by re-requesting with a doubled limit.

      Filters and the limit are applied on the run HEADS — manifest.json plus the presence of result.json — so only the runs actually being returned are hydrated.

      Parameters

      Returns Promise<IntegrationRunSnapshot[]>

    • The complete set of connections a run touched, normalised across the two manifest shapes.

      Single-connection runs (every sync, every discovery) carry only companyIntegrationID; runs that can span a batch (RSU) carry the full set in companyIntegrationIDs and set the singular field only when the set has exactly one member. Callers that make a per-connection decision — listing, and above all AUTHORIZATION — must read the set, not the singular field, or a batch run silently looks connection-less.

      Returns an empty array for a run with no connection identity at all.

      Parameters

      Returns string[]