///
import { CodeChecksReport } from "./types";
import { Stream } from "stream";
export interface ApiOptions {
token?: string;
host?: string;
}
export declare class Api {
private readonly requestPromise;
private readonly requestRaw;
private readonly sharedCtx;
constructor(options: ApiOptions);
saveFileFromStream(fullKey: string, getContents: () => Stream, projectSlug?: string, contentType?: string): Promise;
getFileAsString(fullKey: string, projectSlug?: string): Promise;
makeCommitCheck(sha: string, baseSha: string | undefined, checks: CodeChecksReport[], projectSlug?: string): Promise;
prInfo(prId: number): Promise;
prInfoPublic(prId: number, projectSlug: string): Promise;
projectInfo(): Promise;
projectInfoPublic(projectSlug: string): Promise;
getValue(name: string, key: string, projectSlug?: string): Promise;
saveValue(name: string, value: any, key: string, projectSlug?: string): Promise;
getFile(fullKey: string, destinationPath: string, projectSlug?: string): Promise;
saveFile(fullKey: string, sourcePath: string, projectSlug?: string): Promise;
getDirectory(name: string, destinationPath: string, key: string, projectSlug?: string): Promise;
private getCollectionList;
saveDirectory(name: string, directoryPath: string, key: string, projectSlug?: string): Promise;
private getFileWithRetry;
private saveFileWithRetry;
}
export declare function getApiOptions(requiresSecret: boolean): ApiOptions;
export interface PrInfo {
id: number;
meta: {
title: string;
body: string;
};
head: {
sha: string;
};
base: {
sha: string;
};
files: FileStatuses;
}
export interface FileStatuses {
changed: string[];
added: string[];
removed: string[];
}
export interface ProjectInfo {
projectSlug: string;
artifactsProxyUrl: string;
artifactsProxySupportsPages: boolean;
isPrivate: boolean;
}