pegasys-orchestrate
Version:
The PegaSys Orchestrate library provides convenient access to the Codefi Orchestrate API from applications written in server-side JavaScript
18 lines (17 loc) • 945 B
TypeScript
import { AxiosRequestConfig, AxiosResponse } from 'axios';
import { IHttpClientConfig, IHttpError, IHttpGETRequest, IHttpPOSTRequest, IHttpResponse } from './types/IHttpClient';
/**
* @hidden
* @class HttpClient
*/
export declare class HttpClient {
protected readonly baseURL: string;
constructor(config: IHttpClientConfig);
get(req: IHttpGETRequest, authToken?: string, headers?: object): Promise<IHttpResponse>;
post<T>(path: string, data: any, authToken?: string, headers?: object): Promise<T>;
patch<T>(path: string, data: any, authToken?: string, headers?: object): Promise<T>;
delete<T>(path: string, authToken?: string, headers?: object): Promise<T>;
protected requestConfig(req: IHttpPOSTRequest | IHttpGETRequest, authToken?: string, headers?: object): AxiosRequestConfig;
protected static parseResponse(res: AxiosResponse): IHttpResponse;
protected static parseErrResponse(e: any): IHttpError;
}