axios-retryer
Version:
axios-retryer is an advanced Axios request manager offering intelligent retry logic with token refresh, concurrency control, priority queuing, and a flexible plugin architecture, all built with TypeScript for robust HTTP client integrations.
65 lines (64 loc) • 2.06 kB
TypeScript
/**
* Default sensitive headers that should be redacted in logs and storage
*/
export declare const DEFAULT_SENSITIVE_HEADERS: string[];
/**
* Default sensitive request/response body fields that should be redacted
*/
export declare const DEFAULT_SENSITIVE_FIELDS: string[];
/**
* Options for sanitizing data
*/
export interface SanitizeOptions {
/**
* Custom list of sensitive headers to redact (case-insensitive)
* Will be merged with DEFAULT_SENSITIVE_HEADERS
*/
sensitiveHeaders?: string[];
/**
* Custom list of sensitive fields to redact in request/response data
* Will be merged with DEFAULT_SENSITIVE_FIELDS
*/
sensitiveFields?: string[];
/**
* Character to use for redaction
* @default '*'
*/
redactionChar?: string;
/**
* Whether to sanitize request bodies
* @default true
*/
sanitizeRequestData?: boolean;
/**
* Whether to sanitize response bodies
* @default true
*/
sanitizeResponseData?: boolean;
/**
* Whether to sanitize URL parameters
* @default true
*/
sanitizeUrlParams?: boolean;
}
/**
* Sanitizes sensitive information from request or response data
* @param data - The data to sanitize
* @param options - Sanitization options
* @returns Sanitized data object
*/
export declare function sanitizeData(data: Record<string, any> | null | undefined, options?: SanitizeOptions): Record<string, any> | null | undefined;
/**
* Sanitizes sensitive headers
* @param headers - The headers to sanitize
* @param options - Sanitization options
* @returns Sanitized headers object
*/
export declare function sanitizeHeaders(headers: Record<string, any> | null | undefined, options?: SanitizeOptions): Record<string, any> | null | undefined;
/**
* Sanitizes sensitive URL parameters
* @param url - The URL to sanitize
* @param options - Sanitization options
* @returns Sanitized URL string
*/
export declare function sanitizeUrl(url: string | undefined, options?: SanitizeOptions): string | undefined;