import type { AxiosResponse, InternalAxiosRequestConfig, Method } from 'axios'; import type * as http from 'http'; import type * as https from 'https'; import type { OrderDirection } from './constants'; export type BaseRequestInterceptor = (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig; export type BaseResponseInterceptor = (response: AxiosResponse) => AxiosResponse; export type BaseInterceptors = { request?: BaseRequestInterceptor | Array; response?: BaseResponseInterceptor | Array; }; export interface BaseConfig { /** * token or token getter */ token: Token; /** * Url of OneReach service discovery api */ discoveryUrl?: string; /** * Service key */ serviceKey: string; /** * Can be used to access to api deployed on feature sub domain */ feature?: string; /** * Account ID for cross-account requests (super admin only) */ accountId?: string; /** * Direct service url, can be used to avoid discovery api call */ serviceUrl?: string; /** * Use built-in axios serializer */ useDefaultSerializer?: boolean; /** * @deprecated used for migration stage only */ requestAccountId?: boolean; /** * @deprecated used for migration stage only */ requestProvidersAccountId?: boolean; /** * Custom axios serializer */ paramSerializer?: (params: unknown) => string; httpAgents?: RequestAgents; /** * Request/response Axios interceptors to be used with every request/response */ interceptors?: BaseInterceptors; } export type Token = string | (() => string); export interface Headers { Authorization: string; 'Content-Type': string; } export interface CustomHeaders { [key: string]: string; } export interface CalApiParams { route: string; method?: Method; params?: any; data?: unknown; signal?: AbortSignal; url?: string; customHeaders?: CustomHeaders; withCredentials?: boolean; timeout?: number; } export type PaginationOptions = { from: number; size: number; }; export type OrderOptions = { orderProperty: string; orderDirection: OrderDirection; }; export interface List { total: number; items: T[]; } export interface ServiceDiscoveryResponse { url: string; version?: string; } export interface MakeApiUrlData { url: string; version?: string; accountId?: string; } export interface RequestAgents { httpAgent?: HttpAgentType; httpsAgent?: HttpsAgentType; } export interface ApiErrorOptions extends ErrorOptions { readonly statusCode?: number; } export type RequestOptions = { /** Signal from AbortController to abort active request */ signal?: AbortSignal; }; //# sourceMappingURL=types.d.ts.map