@mcma/client
Version:
Node module with classes and functions used to access services in an MCMA environment
21 lines (20 loc) • 1.36 kB
TypeScript
import { AxiosResponse } from "axios";
import { ResourceEndpointProperties } from "@mcma/core";
import { Http, HttpClientConfig, HttpRequestConfig } from "../http";
import { AuthProvider } from "../auth";
export declare class ResourceEndpointClient implements Http {
private resourceEndpoint;
private authProvider;
private httpClientConfig?;
private serviceAuthType?;
private _httpClient;
constructor(resourceEndpoint: ResourceEndpointProperties, authProvider: AuthProvider, httpClientConfig?: HttpClientConfig, serviceAuthType?: string);
get httpEndpoint(): string;
private get httpClient();
private prepareRequest;
get<TResp = any>(urlOrConfig?: string | HttpRequestConfig, config?: HttpRequestConfig): Promise<AxiosResponse<TResp>>;
post<TResp = any, TReq = any>(body: TReq, urlOrConfig?: string | HttpRequestConfig, config?: HttpRequestConfig): Promise<AxiosResponse<TResp>>;
put<TResp = any, TReq = any>(body: TReq, urlOrConfig?: string | HttpRequestConfig, config?: HttpRequestConfig): Promise<AxiosResponse<TResp>>;
patch<TResp = any, TReq = any>(body: Partial<TReq>, urlOrConfig?: string | HttpRequestConfig, config?: HttpRequestConfig): Promise<AxiosResponse<TResp>>;
delete<TResp = any>(urlOrConfig?: string | HttpRequestConfig, config?: HttpRequestConfig): Promise<AxiosResponse<TResp>>;
}