renovate/lib/platform/common.ts
Michael Kriese 1fb79af2f1 feat: check for disabled renovate.json (#4114)
Extends option `optimizeForDisabled` to azure and bitbucket too
2019-07-22 07:16:16 +02:00

56 lines
1.3 KiB
TypeScript

import got from 'got';
export interface GotApiOptions {
useCache?: boolean;
hostType?: string;
body?: any;
}
export type GotResponse<T extends object = any> = got.Response<T>;
export interface GotApi<TOptions extends object = any> {
get<T extends object = any>(
url: string,
options?: GotApiOptions & TOptions
): Promise<GotResponse<T>>;
post<T extends object = any>(
url: string,
options?: GotApiOptions & TOptions
): Promise<GotResponse<T>>;
put<T extends object = any>(
url: string,
options?: GotApiOptions & TOptions
): Promise<GotResponse<T>>;
patch<T extends object = any>(
url: string,
options?: GotApiOptions & TOptions
): Promise<GotResponse<T>>;
head<T extends object = any>(
url: string,
options?: GotApiOptions & TOptions
): Promise<GotResponse<T>>;
delete<T extends object = any>(
url: string,
options?: GotApiOptions & TOptions
): Promise<GotResponse<T>>;
reset(): void;
setBaseUrl(endpoint: string): void;
}
export interface PlatformConfig {
isFork: boolean;
privateRepo: boolean;
// do we need this?
repoFullName?: string;
}
export interface RepoConfig {
azureWorkItemId?: number;
bbUseDefaultReviewers?: boolean;
gitPrivateKey?: string;
localDir: string;
optimizeForDisabled?: boolean;
repository: string;
}