autopv-cli
Version:
AutoPrivacy DSAR evidence-pack generator - Automated GDPR compliance for SaaS companies
47 lines (46 loc) • 1.3 kB
TypeScript
/**
* PII Scrubbing Utility
* Removes or masks personally identifiable information from data before LLM processing
*/
export interface ScrubConfig {
maskEmails?: boolean;
maskPhones?: boolean;
maskSSNs?: boolean;
maskCreditCards?: boolean;
maskIPAddresses?: boolean;
maskCustomPatterns?: RegExp[];
placeholder?: string;
}
export declare class PIIScrubber {
private config;
private static readonly PATTERNS;
constructor(config?: ScrubConfig);
/**
* Scrub PII from a string
*/
scrubString(text: string): string;
/**
* Recursively scrub PII from any object/array structure
*/
scrubObject(obj: any): any;
/**
* Get statistics about what was scrubbed
*/
getScrubStats(original: string, scrubbed: string): {
emailsFound: number;
phonesFound: number;
ssnsFound: number;
creditCardsFound: number;
ipAddressesFound: number;
apiKeysFound: number;
totalReductions: number;
};
}
/**
* Convenience function to scrub data with default settings
*/
export declare function scrubPII(data: any, config?: ScrubConfig): any;
/**
* Convenience function to scrub just strings
*/
export declare function scrubString(text: string, config?: ScrubConfig): string;