import type { ImportDeps } from '../deps.js'; import type { WriteOutcome } from '../write/categoryWriter.js'; import { Session } from './session.js'; import type { RunOptions, RunResult } from './session.js'; /** J5: the text of the job when the event queue did not drain in time. */ export declare function notDrainingMessage(config: ImportDeps['config']): string; /** * Imports the file of a `queued` job (§ 4.5, point 4; § 8.4). * * A job that has not written anything (`started_at` is empty) is checked again * first, from row 1 and without fetching images (D-33): what changed in the store * since the check shows up now and not as failed rows. With errors the job goes * back to `validated`, nothing is written, and the slot for "one import at a * time" is free again. * * Then the units are written in plan order. A failed row does not stop the run; * the tenth does (D-14, `stopped`). A job that has written something is a resumed * one: it does not check again, it writes again the rows that failed or were * skipped, and then the units after the last one it saved. * * Before each row it asks the event queue whether it may go on (§ 8.5): writing * a row writes events, and a long queue delays every other event of the store. * A queue that does not drain within the time allowed ends the run `interrupted` * (J5), and the job can be resumed. */ export declare function runImport(jobId: number, deps: ImportDeps, options?: RunOptions): Promise; export declare function recordOutcome(session: Session, outcome: WriteOutcome): void;