import type { AxiosRequestConfig } from 'axios'; import { Axios } from 'axios'; import type { Logger } from '@sap-ux/logger'; import { ODataService } from './odata-service'; import { Cookies } from '../auth'; export type Service = Axios & { log: Logger; }; export interface ProviderConfiguration { /** * Ignore certificate verification errors */ ignoreCertErrors: boolean; /** * Value to be passed into the `Cookie` request header * https://datatracker.ietf.org/doc/html/rfc6265#section-4.2 */ cookies: string; /** * Allow a logger to be set by calls to provider creation */ logger?: Logger; } export interface ServiceProviderExtension { /** * Retrieves the service based on the provided path. * * @param path - The path of the service. * @returns service. */ service(path: string): Service; } /** * Basic service provider class containing generic functionality to create and keep service instances as well as logging */ export declare class ServiceProvider extends Axios implements ServiceProviderExtension { _log: Logger; readonly cookies: Cookies; protected readonly services: { [path: string]: Service; }; /** * * @param providerConfig */ constructor(providerConfig?: AxiosRequestConfig & Partial); /** * Set the logger for the service provider. Loggers may need to be restored after serialization/deserialization since they contain circular references. * Note calling this will overwrite loggers sets via ProviderConfiguration. * * @param logger - Logger instance to be set */ set log(logger: Logger); /** * Get the logger for the service provider. * * @returns Logger instance */ get log(): Logger; /** * Create a service instance or return an existing one for the given path. * * @param path path of the service relative to the service provider * @returns a service instance */ service(path: string): T; /** * Create an axios configuration for a new service instance. * * **IMPORTANT:** * This method intentionally mutates Axios instance defaults. * Changing this behaviour (e.g. making defaults immutable) will break * Axios header merging and interceptor resolution. * * @param path path of the service relative to the service provider * @returns axios config */ protected generateServiceConfig(path: string): AxiosRequestConfig; /** * Create a service instance for the given path, service class and public URL. * * @param path path of the service relative to the service provider * @param ServiceClass class type to be used to create an instance * @returns a service instance */ protected createService(path: string, ServiceClass: any): T; /** * Retrieve the public URL exposing the ABAP UI application. * * @returns string Axios Base URL */ protected get publicUrl(): string; } //# sourceMappingURL=service-provider.d.ts.map