/** * Utility for sanitizing sensitive information from logs * Helps prevent exposure of Bot IDs, User IDs, tokens, and other sensitive data */ export interface SanitizationOptions { /** Whether to mask bot IDs (default: true) */ maskBotIds?: boolean; /** Whether to mask user IDs (default: true) */ maskUserIds?: boolean; /** Whether to redact tokens completely (default: true) */ redactTokens?: boolean; /** Custom patterns to sanitize */ customPatterns?: Array<{ pattern: RegExp; replacement: string; }>; } /** * Masks a Slack Bot ID (B12345678 → B123****) */ export declare function maskBotId(botId: string): string; /** * Masks a Slack User ID (U12345678 → U123****) */ export declare function maskUserId(userId: string): string; /** * Redacts tokens (xoxb-*, xapp-*, xoxp-*) */ export declare function redactToken(token: string): string; /** * Sanitizes a single string value */ export declare function sanitizeString(value: string, options?: SanitizationOptions): string; /** * Recursively sanitizes an object, preserving structure but sanitizing string values */ export declare function sanitizeObject(obj: unknown, options?: SanitizationOptions, seen?: WeakSet): unknown; /** * Main sanitization function for logging * Accepts any type and returns a sanitized version safe for logging */ export declare function sanitizeForLogging(data: unknown, options?: SanitizationOptions): unknown; /** * Safe console.log that automatically sanitizes all arguments */ export declare function safeLog(message: string, ...args: unknown[]): void; /** * Safe console.error that automatically sanitizes all arguments */ export declare function safeError(message: string, ...args: unknown[]): void; /** * Safe console.warn that automatically sanitizes all arguments */ export declare function safeWarn(message: string, ...args: unknown[]): void; /** * Log levels enum */ export declare enum LogLevel { DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3, NONE = 4 } /** * Get log level from environment variable */ export declare function getLogLevelFromEnv(): LogLevel; /** * Create a logger that automatically sanitizes all outputs with log level support */ export declare function createSafeLogger(prefix?: string): { debug: (message: string, ...args: unknown[]) => void; log: (message: string, ...args: unknown[]) => void; info: (message: string, ...args: unknown[]) => void; warn: (message: string, ...args: unknown[]) => void; error: (message: string, ...args: unknown[]) => void; }; //# sourceMappingURL=log-sanitizer.d.ts.map