import type { ImportJob } from '../services/job/types.js'; import type { CancelResult, IssuePage, IssueQuery, JobAdmin, NewUpload, ResumeResult, Simple, StartResult, UploadedFile, UploadResult } from '../services/ports/jobAdmin.js'; import type { CleanupResult, JobMaintenance, RecoveredJob } from '../services/ports/jobMaintenance.js'; import type { ImportEntity } from '../services/types.js'; import { MemoryJobRepository } from './MemoryJobRepository.js'; /** * TEST-ONLY. The jobs as the API sees them, on top of the worker's side * (`MemoryJobRepository`), with the two unique indexes of the table: at most one * open job per entity, and at most one import queued or running. The same * contract suite runs against `PgJobAdmin`. It is also the `JobMaintenance` of * the cron jobs, whose contract suite runs against `PgJobMaintenance`. */ export declare class MemoryJobStore extends MemoryJobRepository implements JobAdmin, JobMaintenance { /** The chunks of each job's file, by `seq`. */ protected readonly chunks: Map[]>; /** The chunks stored for a job. */ chunksOf(jobId: number): Buffer[]; /** Puts chunks of a file on a job, as an upload that finished long ago did. */ seedChunks(jobId: number, chunks: Buffer[]): void; /** The job is deleted while something runs; its chunks go with it. */ delete(jobId: number): void; getByUuid(uuid: string): Promise; entityBusy(entity: ImportEntity): Promise; beginUpload(upload: NewUpload): Promise; addChunk(jobId: number, seq: number, data: Uint8Array): Promise; completeUpload(jobId: number, file: UploadedFile): Promise; abortUpload(jobId: number): Promise; /** The job that has a slot of the "one import at a time" index, if any. */ private runningSlot; start(jobId: number): Promise; cancel(jobId: number): Promise; resume(jobId: number): Promise; recheck(jobId: number): Promise; remove(jobId: number): Promise; listOpen(): Promise; issuePage(jobId: number, query: IssueQuery): Promise; recoverDead(deadAfterMs: number, message: string): Promise; waitingForWorker(quietMs: number): Promise; cleanUp(uploadIdleMs: number): Promise; }