sfcoe-ailabs
Version:
AI-powered code review tool with static analysis integration for comprehensive code quality assessment.
51 lines (50 loc) • 1.6 kB
TypeScript
import { PullRequestComment } from './index.js';
/**
* Abstract class representing a Git provider
*/
export default abstract class GitProvider {
private token;
private owner;
private repo;
/**
* Creates a new Git provider instance
*
* @param token - The authentication token for the Git provider
* @param owner - The repository owner/organization name
* @param repo - The repository name
*/
constructor(token: string, owner: string, repo: string);
/**
* Gets the repository owner
*
* @returns The repository owner name
*/
protected getOwner(): string;
/**
* Gets the repository name
*
* @returns The repository name
*/
protected getRepo(): string;
/**
* Gets the authentication token
*
* @returns The authentication token
*/
protected getToken(): string;
/**
* Upserts a comment to a pull request (creates new or updates existing)
*
* @param prCommentRequest - The pull request comment data
* @returns Promise that resolves when the comment is upserted
*/
abstract upsertPRComment(prCommentRequest: PullRequestComment): Promise<void>;
/**
* Delete an existing bot comment from a pull request
*
* @param prNumber - Pull request number
* @param isGeneralComment - Whether to look for general or line-specific comments
* @returns Promise that resolves to true if comment was deleted, false otherwise
*/
abstract deleteBotComment(prNumber: string, isGeneralComment?: boolean): Promise<void>;
}