import { DatabaseConfig } from '@n8n/config'; import { OperationContext, TransactionRunner } from '@n8n/db'; import { DataSource } from '@n8n/typeorm'; import { TrustedSourceEntity } from '../entities/trusted-source.entity'; export type NewTrustedSourceRow = Pick; export type TrustedSourceRowChanges = Partial>; export type DiscoveryRowChanges = Pick; export type DueQuery = { errorRetrySeconds: number; healthyRefreshSeconds: number; limit: number; }; export declare class TrustedSourceRepository { private readonly table; private readonly isPostgres; constructor(dataSource: DataSource, transactionRunner: TransactionRunner, config: DatabaseConfig); findById(id: string, ctx: OperationContext): Promise; findByIssuer(issuer: string, ctx: OperationContext): Promise; findAll(ctx: OperationContext): Promise; findWithConfigVersionBelow(version: number, ctx: OperationContext): Promise; upgradeConfig(id: string, fromVersion: number, changes: Required>, ctx: OperationContext): Promise; markFirstAuthenticated(id: string, ctx: OperationContext): Promise; findDue({ errorRetrySeconds, healthyRefreshSeconds, limit }: DueQuery, ctx: OperationContext): Promise; insertRow(row: NewTrustedSourceRow, ctx: OperationContext): Promise; insertIfAbsent(row: NewTrustedSourceRow & Pick, ctx: OperationContext): Promise; updateById(id: string, changes: TrustedSourceRowChanges, ctx: OperationContext): Promise; deleteById(id: string, ctx: OperationContext): Promise; claimForDiscovery(id: string, token: string, leaseSeconds: number, ctx: OperationContext): Promise; recordDiscovery(id: string, token: string, changes: DiscoveryRowChanges, ctx: OperationContext): Promise; }