@atomist/automation-client
Version:
Atomist API for software low-level client
67 lines • 2.27 kB
TypeScript
import { AxiosPromise } from "axios";
import { GitHubRepoRef } from "../operations/common/GitHubRepoRef";
import { RepoRef } from "../operations/common/RepoId";
import { SourceLocation } from "../operations/common/SourceLocation";
/**
* Return a deep link to the file location
* @param {GitHubRepoRef} grr
* @param {SourceLocation} sourceLocation
* @return {string}
*/
export declare function deepLink(grr: GitHubRepoRef, sourceLocation: SourceLocation): string;
/**
* Check whether the given file, including path, exists
* in the GitHub repo
* @param token GitHub token. Don't try to auth if it's undefined or null
* @param user
* @param repo
* @param path
* @return {Promise<boolean|T>}
*/
export declare function hasFile(token: string, user: string, repo: string, path: string): Promise<boolean>;
/**
* Return file content, or undefined if it's not found
* @param {string} token
* @param {string} user
* @param {string} repo
* @param {string} path
* @return {Promise<string>}
*/
export declare function fileContent(token: string, user: string, repo: string, path: string): Promise<string | undefined>;
export interface Issue {
title: string;
body: string;
state?: "open" | "closed";
assignee?: string;
milestone?: number;
labels?: string[];
assignees?: string[];
}
export declare function raiseIssue(token: string, rr: RepoRef, issue: Issue): AxiosPromise;
export interface GitHubRepoWebhookConfig {
url: string;
content_type: "json" | "form";
secret?: string;
insecure_ssl?: string;
}
export interface GitHubRepoWebhookPayload {
name: "web";
events: string[];
active: boolean;
config: GitHubRepoWebhookConfig;
}
export declare function addRepoWebhook(token: string, rr: GitHubRepoRef, webhookData: GitHubRepoWebhookPayload): AxiosPromise;
/**
* GitHub commit comment structure
*/
export interface Comment {
body: string;
path: string;
/**
* Line number in the diff
*/
position: number;
}
export declare function createCommitComment(token: string, rr: GitHubRepoRef, comment: Comment): AxiosPromise;
export declare function createRepo(token: string, rr: GitHubRepoRef, description: string, priv: boolean): AxiosPromise;
//# sourceMappingURL=gitHub.d.ts.map