/** * Represents an obfuscation rule that can be applied to harvested payloads * @typedef {object} ObfuscationRule * @property {string|RegExp} regex The regular expression to match against in the payload * @property {string} [replacement] The string to replace the matched regex with */ /** * Represents an obfuscation rule validation state * @typedef {object} ObfuscationRuleValidation * @property {ObfuscationRule} rule The original rule validated * @property {boolean} isValid Whether the rule is valid * @property {object} errors Validation errors * @property {boolean} errors.regexMissingDetected Whether the regex is missing * @property {boolean} errors.invalidRegexDetected Whether the regex is invalid * @property {boolean} errors.invalidReplacementDetected Whether the replacement is invalid */ export class Obfuscator { constructor(agentRef: any); agentRef: any; warnedRegexMissing: boolean; warnedInvalidRegex: boolean; warnedInvalidReplacement: boolean; get obfuscateConfigRules(): any; /** * Applies all valid obfuscation rules to the provided input string * @param {string} input String to obfuscate * @returns {string} */ obfuscateString(input: string): string; /** * Validates an obfuscation rule and provides errors if any are found. * @param {ObfuscationRule} rule The rule to validate * @returns {ObfuscationRuleValidation} The validation state of the rule */ validateObfuscationRule(rule: ObfuscationRule): ObfuscationRuleValidation; } /** * Represents an obfuscation rule that can be applied to harvested payloads */ export type ObfuscationRule = { /** * The regular expression to match against in the payload */ regex: string | RegExp; /** * The string to replace the matched regex with */ replacement?: string | undefined; }; /** * Represents an obfuscation rule validation state */ export type ObfuscationRuleValidation = { /** * The original rule validated */ rule: ObfuscationRule; /** * Whether the rule is valid */ isValid: boolean; /** * Validation errors */ errors: { regexMissingDetected: boolean; invalidRegexDetected: boolean; invalidReplacementDetected: boolean; }; }; //# sourceMappingURL=obfuscate.d.ts.map