UNPKG

devopness-sdk-js

Version:

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

29 lines (28 loc) 1.1 kB
import { AxiosError, AxiosResponse } from "axios"; export interface ConfigurationOptions { apiKey?: string; baseUrl?: string; } export declare class Configuration implements ConfigurationOptions { apiKey?: string; baseUrl: string; constructor(options: ConfigurationOptions); } export declare class ApiBaseService { private api; private static _accessToken; static configuration: Configuration; private defaultAxiosSettings; constructor(); private setupAxiosInterceptors; private setupAxiosRequestInterceptors; private setupAxiosResponseInterceptors; static get accessToken(): string; static set accessToken(value: string); protected post<T, B, R = AxiosResponse<T>>(endpoint: string, data?: B): Promise<R>; protected put<T, B, 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>; success<T>(response: AxiosResponse<T>): T; error(error: AxiosError<Error>): void; }