import { TransactionRunner, type OperationContext } from '@n8n/db'; import { DataSource } from '@n8n/typeorm'; import { SkillSourceConnection, type OpaqueSourceValue, type SkillSourceType } from '../entities/skill-source-connection.entity'; import { SkillSourceLink, type SkillSourceLinkState } from '../entities/skill-source-link.entity'; export type SameSource = Pick; export type SyncedFromRow = Pick & { sourceId: string; remoteRef: Record; }; export type PendingUpdate = { content: Record | null; contentHash: string; scan: Record; revision: string; state: Extract; }; export declare class DuplicateSkillSourceError extends Error { } export declare class SkillSourceRepository { private readonly sources; private readonly links; constructor(dataSource: DataSource, transactionRunner: TransactionRunner); findSameSources(identityKey: string, ctx?: OperationContext): Promise; insertConnected(source: { id: string; type: SkillSourceType; locator: OpaqueSourceValue; identityKey: string; projectId: string | null; credentialId: string | null; createdById: string; probeCursor: string | null; }, ctx?: OperationContext): Promise; insertImported(link: { skillId: string; sourceId: string; remoteRef: Record; baseRevision: string; baseContentHash: string; skippedFiles: string[]; }, ctx?: OperationContext): Promise; findById(id: string, ctx?: OperationContext): Promise; findSyncedFrom(skillId: string, ctx?: OperationContext): Promise; isLinked(skillId: string, ctx?: OperationContext): Promise; findLinkBySkillId(skillId: string, ctx?: OperationContext): Promise; deleteLink(skillId: string, ctx?: OperationContext): Promise; findAllSources(): Promise; findLinksBySource(sourceId: string): Promise; findSyncStates(skillIds: string[]): Promise>; countPendingUpdates(sourceId: string): Promise; claimCheckNow(sourceId: string, now: Date, intervalMs: number): Promise; recordDelayed(sourceId: string): Promise; recordCheck(sourceId: string, result: { checkedAt: Date; errorReason: string | null; probeCursor?: { from: string | null; to: string | null; }; }): Promise; moveBase(skillId: string, revision: string, readPendingHash: string | null): Promise; storePending(skillId: string, pending: PendingUpdate, readPendingHash: string | null): Promise; }