///
import { BaseService } from '.';
import { CommitAction } from '../services/Commits';
export interface RequestParametersInput {
url?: string;
headers: import('./BaseService').default['headers'];
json?: boolean;
body?: Object;
qs?: Object;
qsStringifyOptions?: Object;
formData?: temporaryAny;
resolveWithFullResponse?: boolean;
rejectUnauthorized?: boolean;
}
export declare function wait(ms: number): Promise<{}>;
declare type RequestType = 'post' | 'get' | 'put' | 'delete';
export interface RequestOptions {
targetIssueId?: string;
targetProjectId?: string;
content?: string;
id?: string;
sourceBranch?: string;
targetBranch?: string;
/** The duration in human format. e.g: 3h30m */
duration?: string;
domain?: string;
cron?: temporaryAny;
description?: string;
file?: {
value: Buffer;
options: {
filename: string;
contentType: 'application/octet-stream';
};
};
path?: string;
namespace?: string;
visibility?: string;
code?: string;
fileName?: string;
from?: string;
to?: string;
sha?: string;
runnerId?: string;
ref?: string;
scope?: string;
url?: string;
scopes?: temporaryAny;
expiresAt?: string;
note?: string;
actions?: CommitAction[];
commitMessage?: string;
branch?: string;
body?: string | temporaryAny;
title?: string;
name?: string;
labelId?: temporaryAny;
accessLevel?: number;
userId?: UserId;
position?: temporaryAny;
value?: string;
linkUrl?: string;
imageUrl?: string;
key?: string;
action?: string;
targetType?: string;
email?: string;
password?: string;
search?: string;
public?: boolean;
text?: string;
}
declare class RequestHelper {
static request(type: RequestType, service: BaseService, endpoint: string, options?: RequestOptions, form?: boolean, stream?: boolean): Promise;
static handleRequestError(err: temporaryAny): Promise<{}>;
static get(service: BaseService, endpoint: string, options?: RequestOptions, { stream }?: {
stream?: boolean;
}): Promise;
static post(service: BaseService, endpoint: string, options?: RequestOptions, form?: boolean): Promise;
static put(service: BaseService, endpoint: string, options?: RequestOptions): Promise;
static delete(service: BaseService, endpoint: string, options?: RequestOptions): Promise;
}
export default RequestHelper;