/** * Git Provider Abstraction (v1.1.0) * * Allows PRSense to operate across GitHub, GitLab, and Bitbucket. */ export interface PRMetadata { id: number | string; title: string; description: string; author: string; url: string; baseRepo: string; headRepo: string; status: 'open' | 'closed' | 'merged'; createdAt: string; updatedAt: string; } export interface PRFiles { files: string[]; linesAdded: number; linesRemoved: number; } export interface GitProvider { /** * Extract normalized PR metadata from a webhook event payload. * Returns null if the event is not a PR event or should be ignored. */ parseWebhook(event: any, headers: Record): Promise; /** Verify the webhook signature against the configured secret */ verifySignature(payload: string, signature: string): boolean; /** Fetch the list of files changed in a PR */ fetchFiles(prId: number | string, repo: string): Promise; /** Fetch the raw patch/diff of a PR */ fetchDiff(prId: number | string, repo: string): Promise; /** Post a comment to the PR */ postComment(prId: number | string, repo: string, body: string): Promise; /** Add a label (or tag) to the PR */ addLabel(prId: number | string, repo: string, label: string): Promise; /** Request specific reviewers for the PR */ requestReviewers(prId: number | string, repo: string, reviewers: string[]): Promise; /** Fetch all comments and review discussions from the PR */ fetchComments?(prId: number | string, repo: string): Promise; } export interface ProviderConfig { token: string; webhookSecret: string; apiUrl?: string; } export declare class ProviderError extends Error { readonly status?: number | undefined; constructor(message: string, status?: number | undefined); } import { GitHubProvider } from './github.js'; import { GitLabProvider } from './gitlab.js'; import { BitbucketProvider } from './bitbucket.js'; export type ProviderType = 'github' | 'gitlab' | 'bitbucket'; export declare function createProvider(type: ProviderType, config: ProviderConfig): GitProvider; export { GitHubProvider, GitLabProvider, BitbucketProvider }; //# sourceMappingURL=index.d.ts.map