Skip to main content

Class: Api

Constructors

constructor

new Api(config)

Parameters

NameType
configApiConfig

Defined in

src/common/api.ts:22

Properties

METHOD_GET

Readonly METHOD_GET: "GET"

Defined in

src/common/api.ts:17


METHOD_POST

Readonly METHOD_POST: "POST"

Defined in

src/common/api.ts:18


config

config: ApiConfig

Defined in

src/common/api.ts:20

Methods

applyConfig

applyConfig(config): void

Parameters

NameType
configApiConfig

Returns

void

Defined in

src/common/api.ts:26


get

get<T>(endpoint, config?): Promise<AxiosResponse<T, any>>

Type parameters

NameType
Tany

Parameters

NameType
endpointstring
config?AxiosRequestConfig<any>

Returns

Promise<AxiosResponse<T, any>>

Defined in

src/common/api.ts:48


getConfig

getConfig(): ApiConfig

Returns

ApiConfig

Defined in

src/common/api.ts:30


post

post<T>(endpoint, body, config?): Promise<AxiosResponse<T, any>>

Type parameters

NameType
Tany

Parameters

NameType
endpointstring
bodystring | object | Buffer
config?AxiosRequestConfig<any>

Returns

Promise<AxiosResponse<T, any>>

Defined in

src/common/api.ts:63


request

request(): AxiosInstance

Returns

AxiosInstance

Defined in

src/common/api.ts:79