tickethead-sdk
Version:
SDK for the Tickethead API
35 lines • 1.55 kB
TypeScript
import { AxiosCacheInstance, CacheOptions } from 'axios-cache-interceptor';
import { AxiosInstance } from 'axios';
import { RetryOptions } from '../index';
export declare enum BaseUrl {
ThProd = "https://api.tickethead.io",
ThStaging = "https://api.staging.tickethead.io"
}
export declare function createBaseUrl(baseUrl?: string, tenantName?: string): string;
/**
* Sets the update request strategy for an axios instance
*/
export declare function setAxiosUpdateTokenFunction(instance: AxiosInstance, updateToken: () => Promise<string>): void;
/**
* Does nothing. Will cause 401 requests to fail as usual.
*/
export declare function nopUpdate(): Promise<string>;
export interface IClientBuildOptions {
baseUrl?: string;
tenantName?: string;
retryOptions?: RetryOptions;
cacheOptions?: CacheOptions;
camelCaseResponse?: boolean;
}
/**
* Builds an API client object. By default, creates a production client with cluster-wide access.
* If `tenantName` is specified, the client includes the tenant name in the URL.
*
* @param baseUrl Base URL of the REST API (default: PROD_BASE_URL)
* @param tenantName Tenant name (defaults to undefined)
* @param retryOptions Configuration for the retry policy
* @param cacheOptions Configuration for caching, by default no caching is done
* @returns axios.AxiosInstance
*/
export declare function buildClient({ baseUrl, tenantName, retryOptions, cacheOptions, camelCaseResponse, }: IClientBuildOptions): AxiosInstance | AxiosCacheInstance;
//# sourceMappingURL=index.d.ts.map