UNPKG

@devopness/sdk-js

Version:

Devopness API JS/TS SDK - Painless essential DevOps to everyone

36 lines (35 loc) 1.41 kB
import { AxiosResponse } from "axios"; export interface ConfigurationOptions { apiToken?: string; baseURL?: string; } export declare class Configuration implements ConfigurationOptions { apiToken?: string; baseURL: string; constructor(options: ConfigurationOptions); } export declare class ApiBaseService { private api; private static _accessToken; private static _apiToken; private static _onTokenExpired; static configuration: Configuration; private static SDK_VERSION; private defaultAxiosSettings; constructor(); private setupAxios; private setUserAgent; private setupAxiosRequestInterceptors; private setupAxiosResponseInterceptors; static get apiToken(): string | undefined; static set apiToken(value: string | undefined); static get accessToken(): string; static set accessToken(value: string); static set onTokenExpired(callback: (accessToken: string) => void); protected isTokenExpired(response: AxiosResponse | undefined): boolean; baseURL(): string; protected post<T, B = undefined, R = AxiosResponse<T>>(endpoint: string, data?: B): Promise<R>; protected put<T, B = undefined, R = AxiosResponse<T>>(endpoint: string, data?: B): Promise<R>; protected delete<T, R = AxiosResponse<T>>(endpoint: string): Promise<R>; protected get<T, R = AxiosResponse<T>>(endpoint: string): Promise<R>; }