import { AxiosInstance } from "axios"; import { HcloudLogger, Options } from "./Base"; import { RefreshToken } from "./interfaces/axios"; import AgentService from "./service/agent"; import AuditorService from "./service/auditor"; import BouncerService from "./service/bouncer"; import CosmoService from "./service/cosmo"; import DaliService from "./service/dali"; import High5Service from "./service/high5"; import IdpService from "./service/idp"; import MailerService from "./service/mailer"; import MothershipService from "./service/mothership"; import NatsService from "./service/nats"; import PanelService from "./service/panel"; import ShortsService from "./service/shorts"; export declare class HCloud { get Agent(): AgentService; private _Agent?; get Auditor(): AuditorService; private _Auditor?; get Bouncer(): BouncerService; private _Bouncer?; get Cosmo(): CosmoService; private _Cosmo?; get High5(): High5Service; private _High5?; get Idp(): IdpService; private _Idp?; get Dali(): DaliService; private _Dali?; get Mailer(): MailerService; private _Mailer?; get Panels(): PanelService; private _Panels?; get Mothership(): MothershipService; private _Mothership?; get Shorts(): ShortsService; private _Shorts?; get Nats(): NatsService; private _Nats?; private options; private axios; private refreshToken; private refreshPromise; constructor(options: Options); /** * Sets the server url that the SDK shall do a request to. */ setServer(server: string): HCloud; /** * Returns the currently set server url that the SDK will make requests to. */ getServer(): string; /** * Authenticate against hcloud with username and password, as an alternative to using a bearer auth token. */ setBasicAuth(username: string, password: string): HCloud; /** * Sets the auth token used for authentication against hcloud. The provided token must be a bearer token. */ setAuthToken(token: string): HCloud; /** * Returns the currently set auth token. */ getAuthToken(): string | undefined; /** * Sets the refresh token and enables auto-fresh */ setRefreshToken(refreshToken: RefreshToken): HCloud; /** * Returns the currently set refresh token. */ getRefreshToken(): RefreshToken | null; /** * Sets the correlationID which will be sent to hcloud with each request and appears in all * logs that are made on behalf of this request, making it easier to debug the application. */ setCorrelationId(correlationId: string): HCloud; /** * Returns the currently set correlationID. */ getCorrelationId(): string | undefined; /** * Returns the currently set logger. */ getLogger(): HcloudLogger | undefined; /** * Sets a logger used to receive logs from hcloud. */ setLogger(logger: HcloudLogger): this; /** * Send various no-cache headers globally with every request */ disableCachingGlobally(): HCloud; /** * getAxios returns the active axios instance * Use it to add additional request/response interceptors * @returns {AxiosInstance} AxiosInstance */ getAxios(): AxiosInstance; /** * setAxios overwrites the existing axios instance * Use it to add a caching layer to axios * @returns {AxiosInstance} The new AxiosInstance */ setAxios(axios: AxiosInstance): AxiosInstance; /** * refreshAccessToken will refresh the access_token using a given refresh_token and set the new access_token and refresh_token in the SDK. * If multiple requests trigger a token refresh at the same time, only one request will actually call the token endpoint, while the others will wait for the result of that request and use the same new token. * * This method will trigger a callback? to enable the returned values to be persisted */ private refreshAccessToken; }