mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-15 17:16:25 +00:00
25 lines
643 B
TypeScript
25 lines
643 B
TypeScript
import { URL } from 'url';
|
|
import { PLATFORM_TYPE_BITBUCKET } from '../../constants/platforms';
|
|
import { Http, HttpOptions, HttpResponse, InternalHttpOptions } from '.';
|
|
|
|
let baseUrl = 'https://api.bitbucket.org/';
|
|
export const setBaseUrl = (url: string): void => {
|
|
baseUrl = url;
|
|
};
|
|
|
|
export class BitbucketHttp extends Http {
|
|
constructor(options?: HttpOptions) {
|
|
super(PLATFORM_TYPE_BITBUCKET, options);
|
|
}
|
|
|
|
protected request<T>(
|
|
url: string | URL,
|
|
options?: InternalHttpOptions
|
|
): Promise<HttpResponse<T> | null> {
|
|
const opts = {
|
|
baseUrl,
|
|
...options,
|
|
};
|
|
return super.request<T>(url, opts);
|
|
}
|
|
}
|