import { GlobalConfig } from '@n8n/config'; import { DataSource, type EntityManager, Repository } from '@n8n/typeorm'; import { WorkflowStatistics } from '../entities'; import type { User } from '../entities'; import { StatisticsNames } from '../entities/types-db'; type StatisticsInsertResult = 'insert' | 'failed' | 'alreadyExists'; type StatisticsUpsertResult = StatisticsInsertResult | 'update'; export type FirstOccurrenceRow = { name: StatisticsNames; workflowId: string; workflowName: string | null; firstEventMs: number; }; export declare class WorkflowStatisticsRepository extends Repository { private readonly globalConfig; constructor(dataSource: DataSource, globalConfig: GlobalConfig); findByWorkflowIds(workflowIds: string[]): Promise; insertWorkflowStatistics(eventName: StatisticsNames, workflowId: string, workflowName?: string): Promise; upsertWorkflowStatistics(eventName: StatisticsNames, workflowId: string, isRootExecution: boolean, workflowName?: string): Promise; private deltaTableName; appendIncrement(eventName: StatisticsNames, workflowId: string, isRootExecution: boolean, workflowName?: string): Promise; rollupIncrements(manager: EntityManager, batchSize: number): Promise<{ increments: number; firstOccurrences: FirstOccurrenceRow[]; }>; queryNumWorkflowsUserHasWithFiveOrMoreProdExecs(userId: User['id']): Promise; } export {};