/** * Personal data and secrets must not leave the application inside error or * trace reports (Sentry and alike). This module is dependency free and safe in * the browser: it is exported as `@groundbrick/logger/privacy`, apart from the * logger itself, so client bundles do not pull the Node-only outputs. */ /** * Masks e-mail addresses, phone numbers, bot tokens and URL query strings in * free text (error messages, log lines, URLs). */ export declare function redactPersonalData(text: string): string; /** * Copy of a value with sensitive keys replaced and personal data masked in * every string, at any depth. */ export declare function redactValue(value: unknown, depth?: number): unknown; /** Minimal shape of an error/transaction event (Sentry's `@sentry/core` Event). */ export interface TelemetryEvent { message?: string; transaction?: string; request?: { url?: string; data?: unknown; cookies?: unknown; query_string?: unknown; headers?: Record; }; exception?: { values?: Array<{ value?: string; }>; }; extra?: Record; contexts?: Record; breadcrumbs?: TelemetryBreadcrumb[]; spans?: Array<{ description?: string; data?: Record; }>; } export interface TelemetryBreadcrumb { category?: string; message?: string; data?: Record; } /** * Removes request bodies, cookies and query strings, masks auth headers and * personal data. Mutates and returns the event (Sentry `beforeSend` style). */ export declare function scrubTelemetryEvent(event: T): T; /** * Console breadcrumbs are raw log lines (subjects, codes, recipients): they are * dropped (null) instead of partially masked. Others are masked. */ export declare function scrubTelemetryBreadcrumb(crumb: T): T | null; /** Structured log record (Sentry `beforeSendLog`). */ export declare function scrubTelemetryLog; }>(log: T): T; //# sourceMappingURL=privacy.d.ts.map