import type { PromotionProviderAuthType, PromotionSshKeyType } from '@n8n/api-types'; import { Logger } from '@n8n/backend-common'; import type { PromotionGitCredentials } from './promotions.types'; type PromotionGitPaths = { rootFolder: string; repositoryFolder: string; nextRepositoryFolder: string; sshDir: string; }; type GitOperation = { remoteUrl: string; credentials: PromotionGitCredentials; paths: PromotionGitPaths; branchName: string; environmentId: string; }; type TreeReadLimits = { maxEntries: number; maxEntryBytes: number; maxUncompressedBytes: number; maxPathLength: number; }; export declare class PromotionsGitService { private readonly logger; private readonly checkoutLocks; constructor(logger: Logger); private lockCheckout; validateRemoteUrl(remoteUrl: string, authType: PromotionProviderAuthType): void; private validateHttpRemoteUrl; private validateSshRemoteUrl; validateBranchName(branchName: string): Promise; generateSshKeyPair(keyType: PromotionSshKeyType): Promise<{ publicKey: string; privateKey: string; }>; clone({ remoteUrl, credentials, paths, branchName, environmentId }: GitOperation): Promise; hasCheckout(repositoryFolder: string): Promise; commitAndPush({ remoteUrl, credentials, paths, branchName, targetBranchName, environmentId, author, commitMessage, force, stagePathspec, onCheckoutRestored, rollbackOnFailure, }: GitOperation & { targetBranchName?: string; author: { name: string; email: string; }; commitMessage: string; force: boolean; stagePathspec: string; onCheckoutRestored: () => Promise; rollbackOnFailure?: boolean; }): Promise<{ commitSha: string; }>; hasRemoteBranch(operation: GitOperation): Promise; prepareCheckoutForPromotion(operation: GitOperation): Promise<{ commitSha: string; }>; private commitAndPushToTargetBranch; private restorePromotionBase; private fetchBranch; refreshCheckout(operation: GitOperation): Promise<{ commitSha: string; }>; listBranchTree({ pathspecs, ...operation }: GitOperation & { pathspecs: string[]; }): Promise<{ commitSha: string | null; lsTreeOutput: string; }>; hasCommittedPath({ paths, branchName, environmentId, pathspec, }: Pick & { pathspec: string; }): Promise; findPathsAtCommit({ paths, branchName, environmentId, commitSha, filePaths, }: Pick & { commitSha: string; filePaths: readonly string[]; }): Promise>; readFilesAtCommit({ paths, branchName, environmentId, commitSha, filePaths, }: Pick & { commitSha: string; filePaths: readonly string[]; }): Promise>; listFilesAtCommit({ paths, branchName, environmentId, commitSha, directory, }: Pick & { commitSha: string; directory: string; }): Promise>; fetchReviewCommits({ headRef, headCommitSha, baseline, ...operation }: GitOperation & { headRef: string; headCommitSha: string; baseline: { targetBranchName: string; } | { commitSha: string; targetBranchName?: string; }; }): Promise<{ baselineCommitSha: string; }>; readTreeAtCommit({ commitSha, directory, limits, ...operation }: GitOperation & { commitSha: string; directory: string; limits: TreeReadLimits; }): Promise>; private withGit; private mapGitError; } export {};