remcode
Version:
Turn your AI assistant into a codebase expert. Intelligent code analysis, semantic search, and software engineering guidance through MCP integration.
67 lines (66 loc) • 2.24 kB
TypeScript
import { AxiosRequestConfig } from 'axios';
declare module 'axios' {
interface InternalAxiosRequestConfig {
requestId?: string;
}
}
export interface GitHubClientOptions {
token: string;
baseUrl?: string;
maxRetries?: number;
retryDelay?: number;
timeout?: number;
}
export declare class GitHubClient {
private token;
private baseUrl;
private axios;
private maxRetries;
private retryDelay;
constructor(options: GitHubClientOptions);
/**
* Make a request to the GitHub API with automatic retries
* @param endpoint API endpoint (starting with /)
* @param method HTTP method
* @param data Request data (for POST, PUT, PATCH)
* @param config Additional axios config
* @returns Promise with the response data
*/
makeRequest(endpoint: string, method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH', data?: any, config?: AxiosRequestConfig): Promise<any>;
/**
* Internal method to handle retries
*/
private makeRequestWithRetry;
/**
* Get information about a repository
*/
getRepository(owner: string, repo: string): Promise<any>;
/**
* Set a repository secret
*/
setRepositorySecret(owner: string, repo: string, secretName: string, secretValue: string): Promise<void>;
/**
* Trigger a workflow dispatch event
*/
createWorkflowDispatch(owner: string, repo: string, workflowId: string, ref?: string, inputs?: Record<string, any>): Promise<void>;
/**
* Get information about a workflow run
*/
getWorkflowRun(owner: string, repo: string, runId: number): Promise<any>;
/**
* List workflow runs for a repository or workflow
*/
listWorkflowRuns(owner: string, repo: string, workflowId?: string): Promise<any>;
/**
* Create or update file contents
*/
createOrUpdateFile(owner: string, repo: string, path: string, message: string, content: string, sha?: string, branch?: string): Promise<any>;
/**
* Create a new repository
*/
createRepository(name: string, options?: any): Promise<any>;
/**
* Fork a repository
*/
forkRepository(owner: string, repo: string, options?: any): Promise<any>;
}