/** * Retention Policy Engine * * Enforces data retention policies automatically. * Supports GDPR storage limitation and CSSF 7-year retention requirements. * * Added by Pantheon Security for enterprise compliance support. */ import { type RetentionPolicy } from "./types.js"; /** * Retention execution result */ interface RetentionResult { policy_id: string; policy_name: string; executed_at: string; data_type: string; action: "delete" | "archive" | "anonymize"; items_processed: number; bytes_freed: number; success: boolean; error?: string; } /** * Retention Engine class */ export declare class RetentionEngine { private static instance; private policiesFile; private policies; private loaded; private archiveDir; private lastRunFile; private constructor(); /** * Get singleton instance */ static getInstance(): RetentionEngine; /** * Load policies from storage */ private load; /** * Save policies to storage */ private save; /** * Add a custom retention policy */ addPolicy(policy: Omit): Promise; /** * Update an existing policy */ updatePolicy(policyId: string, updates: Partial>): Promise; /** * Remove a policy */ removePolicy(policyId: string): Promise; /** * Get all policies */ getPolicies(): Promise; /** * Get policy by ID */ getPolicy(policyId: string): Promise; /** * Check if retention should run based on schedule */ private shouldRun; /** * Record policy execution time */ private recordRun; /** * Execute a single retention policy */ private executePolicy; /** * Get the storage location for a data type */ private getDataLocation; /** * Get files that have exceeded retention period */ private getExpiredFiles; /** * Archive a file */ private archiveFile; /** * Run all due retention policies */ runDuePolicies(): Promise; /** * Force run a specific policy (ignoring schedule) */ forceRunPolicy(policyId: string): Promise; /** * Get retention status summary */ getStatus(): Promise<{ total_policies: number; active_policies: number; last_runs: Record; next_due: { policy_id: string; policy_name: string; due_in_days: number; }[]; }>; } /** * Get the retention engine instance */ export declare function getRetentionEngine(): RetentionEngine; /** * Run all due retention policies */ export declare function runRetentionPolicies(): Promise; /** * Get all retention policies */ export declare function getRetentionPolicies(): Promise; /** * Get retention status */ export declare function getRetentionStatus(): Promise>; export {};