/** * Error thrown for non-successful GitHub API responses, carrying the HTTP * status code of the response */ export declare class GithubApiError extends Error { readonly status: number; constructor(message: string, status: number); } /** * Minimal GitHub REST v3 client over native fetch, covering the few * endpoints this cli uses (replaces @octokit/rest) */ export declare class Github { private readonly token; constructor(token: string); /** * Performs a GitHub API request and returns the parsed JSON body. * Throws GithubApiError with the response status on non-2xx replies. * * @param {string} method - HTTP method to use * @param {string} path - API path, e.g. '/repos/{owner}/{repo}' * @param {object} [body] - JSON-serializable request payload * @return {Promise} */ request(method: string, path: string, body?: object): Promise; get(path: string): Promise; post(path: string, body: object): Promise; delete(path: string): Promise; } /** * Returns a team data for given organization, using github API * object which is already authenticated under some user * * @param {Github} github * @param {string} owner * @return {Promise} */ export declare function getTeam(github: Github, owner: string): Promise; /** * Returns organization info for a given organization name * using a given github API object already authenticated by some user * * @param {Github} github * @param {string} owner * @return {Promise} */ export declare function getOrg(github: Github, owner: string): Promise; /** * Returns an authenticated instance of github API object * * @param {string} token * @return {Promise} */ export declare function getInstance(token: string): Promise; /** * Creates empty github repository * * @param {string} url * @param {string} token * @param {string} description * @param {boolean} isPrivate * @return {Promise} */ export declare function createRepository(url: string, token: string, description: string, isPrivate?: boolean): Promise;