import type { AxiosError, AxiosResponse } from 'axios'; import type { HTTP_METHOD, ServiceResponse } from '../models/Generic.js'; import type { ApplicationConstructedProxyConfiguration, UserProvidedProxyConfiguration, InternalProxyConfiguration } from '../models/Proxy.js'; import type { MessageRowInsert } from '@nangohq/types'; interface Logs { logs: MessageRowInsert[]; } interface RouteResponse { response: AxiosResponse | AxiosError | Error; } interface RetryHandlerResponse { shouldRetry: boolean; } declare class ProxyService { route(externalConfig: ApplicationConstructedProxyConfiguration | UserProvidedProxyConfiguration, internalConfig: InternalProxyConfiguration): Promise; configure(externalConfig: ApplicationConstructedProxyConfiguration | UserProvidedProxyConfiguration, internalConfig: InternalProxyConfiguration): ServiceResponse & Logs; retryHandler: (error: AxiosError, type: "at" | "after", retryHeader: string) => Promise; /** * Retry * @desc if retries are set the retry function to determine if retries are * actually kicked off or not * @param {AxiosError} error * @param {attemptNumber} number */ retry: (config: ApplicationConstructedProxyConfiguration, logs: MessageRowInsert[], error: AxiosError, attemptNumber: number) => Promise; private isProviderSpecificErrorCode; /** * Send to http method * @desc route the call to a HTTP request based on HTTP method passed in * @param {ApplicationConstructedProxyConfiguration} configBody */ private sendToHttpMethod; private request; /** * Construct URL * @param {ApplicationConstructedProxyConfiguration} config * */ constructUrl(config: ApplicationConstructedProxyConfiguration): string; /** * Construct Headers */ constructHeaders(config: ApplicationConstructedProxyConfiguration, method: HTTP_METHOD, url: string): Record; private handleResponse; private handleErrorResponse; } declare const _default: ProxyService; export default _default;