import { AxiosRequestConfig } from "axios"; import { ILogger } from "js-logger/src/types"; import { AicsSuccessResponse } from "../types"; interface HeaderMap { [key: string]: string; } export declare abstract class ConnectionBase { protected abstract get extraAxiosConfig(): AxiosRequestConfig; host: string; port: string; user: string; protected readonly logger: ILogger; private readonly servicePath; private static ensureUser; /** * Construct Connection instance * @param host Host that LIMS is running on (does not include protocol) * @param port Port that LIMS is running on * @param user User to run requests as * @param servicePath resource path to service */ protected constructor(host: string, port: string | undefined, user: string, servicePath: string); /** * Send GET request * @param path Relative path of endpoint (should not start with leading slash) * @param headers Extra headers to pass in. X-User-Id header is automatically provided given user from constructor * @param timeout Milliseconds before timing out the request */ protected get(path: string, headers?: HeaderMap, timeout?: number): Promise>; /** * Send POST request * @param path Relative path of endpoint (should not start with leading slash) * @param body Request body * @param headers Extra headers to pass in. X-User-Id header is automatically provided given user from constructor * @param timeout Milliseconds before timing out the request */ protected post(path: string, body?: any, headers?: HeaderMap, timeout?: number): Promise>; protected getAxiosConfig(headers: HeaderMap | undefined, timeout: number): AxiosRequestConfig; private getHeaders; private get axiosClient(); private get baseUrl(); } export {};