import type { Log } from '@t4h.framework/core'; import { WorkflowRun, type WorkflowRunStatus } from '../models/WorkflowRun.js'; import { DatabaseService } from '../services/Database.service.js'; import type { RejectedReason } from '../tools/to-rejected-reason.js'; export interface PageOptions { limit?: number; offset?: number; } export interface WorkflowRunLogsPage { count: number; logs: Log[]; } export interface WorkflowRunFindOptions { status?: WorkflowRunStatus; workflow?: string; id?: string; parentRun?: string; parentActivity?: string; rootOnly?: boolean; /** ISO 8601 */ createdAfter?: string; /** ISO 8601 */ createdBefore?: string; limit?: number; offset?: number; } export declare class WorkflowRunRepository { private readonly database; constructor(database: DatabaseService); private get db(); create(run: WorkflowRun): Promise; createMany(runs: readonly WorkflowRun[]): Promise; findById(id: string): Promise; findByParentActivityId(parentActivityId: string): Promise; findStartableIdsByParentActivityId(parentActivityId: string): string[]; findBatchSiblings(parentActivityId: string): Promise; countRunningByParentActivityId(parentActivityId: string): number; find({ status, workflow, id, parentRun, parentActivity, rootOnly, createdAfter, createdBefore, limit, offset, }?: WorkflowRunFindOptions): Promise<[WorkflowRun[], number]>; finish(id: string, output: unknown): Promise; reject(id: string, reason: RejectedReason): Promise; createLogs(runId: string, logs: readonly Log[]): Promise; findLogs(runId: string, { limit, offset }?: PageOptions): Promise; findParentActivityIdsWithRuns(parentActivityIds: readonly string[]): Set; private toRow; private toModel; }