import type { EntityManager } from '@n8n/typeorm'; import { DataSource, Repository } from '@n8n/typeorm'; import { type IDataObject } from 'n8n-workflow'; import { TestRun } from '../entities'; import type { TestRunStatus } from '../entities/test-run.ee'; import { TestRunErrorCode } from '../entities/types-db'; import type { AggregatedTestRunMetrics, TestRunFinalResult } from '../entities/types-db'; export type TestRunSummary = TestRun & { finalResult: TestRunFinalResult | null; }; export declare class TestRunRepository extends Repository { constructor(dataSource: DataSource); createTestRun(workflowId: string, attrs?: { collectionId?: string | null; workflowVersionId?: string | null; evaluationConfigId?: string | null; evaluationConfigSnapshot?: IDataObject | null; }): Promise; markAsRunning(id: string, instanceId?: string): Promise; markAsCompleted(id: string, metrics: AggregatedTestRunMetrics): Promise; markAsCancelled(id: string, trx?: EntityManager): Promise; markAsError(id: string, errorCode: TestRunErrorCode, errorDetails?: IDataObject): Promise; markAllIncompleteAsFailed(): Promise; requestCancellation(id: string): Promise; isCancellationRequested(id: string): Promise; clearInstanceTracking(id: string): Promise; findByConfigAndVersions(evaluationConfigId: string, workflowVersionIds: string[]): Promise; getMany(workflowId: string, { offset, limit }?: { offset?: number; limit?: number; }, status?: TestRunStatus): Promise<{ id: string; updatedAt: Date; createdAt: Date; status: TestRunStatus; runAt: Date | null; completedAt: Date | null; metrics: AggregatedTestRunMetrics; errorCode: TestRunErrorCode | null; errorDetails: IDataObject | null; workflow: import("../entities").WorkflowEntity; workflowId: string; runningInstanceId: string | null; cancelRequested: boolean; workflowVersionId: string | null; evaluationConfigId: string | null; evaluationConfigSnapshot: IDataObject | null; collectionId: string | null; finalResult: TestRunFinalResult | null; testCaseCount: number; }[]>; countByWorkflowId(workflowId: string, status?: TestRunStatus): Promise; existsInWorkflow(testRunId: string, workflowId: string): Promise; findOneByIdAndWorkflowId(testRunId: string, workflowId: string): Promise; getTestRunSummaryById(testRunId: string): Promise; getTestRunSummaryByWorkflowId(testRunId: string, workflowId: string): Promise; private findTestRunSummary; }