import { AxiosInstance } from 'axios'; import { ApiContext } from './api/context'; import { RecursivePartial } from './utils/types'; interface ILoggerConfig { /** * Sets the log level configured for the Permit SDK Logger. */ level: string; /** * Sets the label configured for logs emitted by the Permit SDK Logger. */ label: string; /** * Sets whether the SDK log output should be in JSON format. */ json: boolean; } interface IMultiTenancyConfig { /** * the key of the default tenant to be used if {@link useDefaultTenantIfEmpty} is set. */ defaultTenant: string; /** * whether or not the SDK should automatically associate a resource with the {@link defaultTenant} * if the resource provided in permit.check() was not associated with a tenant (i.e: undefined tenant). */ useDefaultTenantIfEmpty: boolean; } export interface IPermitConfig { /** * The token (API Key) used for authorization against the PDP and the Permit REST API. */ token: string; /** * Configures the Policy Decision Point (PDP) address. */ pdp: string; /** * Configures the URL of the Permit REST API. */ apiUrl: string; /** * the logger configuration used by the SDK, @see {@link ILoggerConfig} */ log: ILoggerConfig; /** * @see: {@link IMultiTenancyConfig} */ multiTenancy: IMultiTenancyConfig; /** * specifies the number of milliseconds before a permit.check() request times out. * If the request takes longer than `timeout`, the request will be aborted. */ timeout: number | undefined; /** * whether or not permit.check() will throw on error, or return a default denied decision. */ throwOnError: boolean | undefined; /** * represents the current API key authorization level. * @see {@link ApiContext} */ apiContext: ApiContext; /** * an optional custom axios instance, to control the behavior of the HTTP client * used to connect to the Permit REST API. * * @see https://axios-http.com/docs/instance * @see https://axios-http.com/docs/req_config */ axiosInstance: AxiosInstance; } /** * A factory class for the Permit SDK configuration */ export declare class ConfigFactory { /** * @returns the default SDK configuration */ static defaults(): IPermitConfig; /** * Builds the Permit SDK configuration from the values provided by the SDK user * and from the default SDK configuration when no specific values are set. * * @param options - a partial configuration * @returns the SDK configuration (for unset values returns the default config) */ static build(options: RecursivePartial): IPermitConfig; } export {};