UNPKG

@emartech/escher-request

Version:
30 lines (29 loc) 1.37 kB
import { Agent as HttpAgent } from 'http'; import { Agent as HttpsAgent } from 'https'; import { EscherRequestOption } from './requestOption'; export { EscherRequestOption } from './requestOption'; import { TransformedResponse } from './wrapper'; export { TransformedResponse } from './wrapper'; export { EscherRequestError } from './requestError'; export declare class EscherRequest { private static EscherConstants; private escher; private options; readonly httpAgent?: HttpAgent; readonly httpsAgent?: HttpsAgent; static create(accessKeyId: string, apiSecret: string, requestOptions: EscherRequestOption): EscherRequest; constructor(accessKeyId: string, apiSecret: string, requestOptions: EscherRequestOption); get<T = any>(path: string, data?: any): Promise<TransformedResponse<T>>; patch<T = any>(path: string, data: any): Promise<TransformedResponse<T>>; post<T = any>(path: string, data: any): Promise<TransformedResponse<T>>; put<T = any>(path: string, data: any): Promise<TransformedResponse<T>>; delete<T = any>(path: string): Promise<TransformedResponse<T>>; setOptions(requestOptions: EscherRequestOption): void; getOptions(): EscherRequestOption; private request; private getRequestFor; private getOptionsFor; private signRequest; private getLogParameters; private getPayload; }