# Class RetentionPolicy

Enforces a configurable data-retention window by filtering out expired entries.

GDPR Article 5(1)(e) — Storage limitation principle.

#### Example

    const policy = new RetentionPolicy(30 * 24 * 60 * 60 * 1000); // 30 days
    const fresh = policy.enforce(auditLogger.getLogs());

#### Since

0.9.0

- Defined in utils/auditSink.ts:179

##### Index

### Constructors

constructor

### Properties

maxAgeMs

### Methods

enforce
isExpired

## Constructors

### constructor

- new RetentionPolicy(maxAgeMs: number): RetentionPolicy

  #### Parameters

  - maxAgeMs: number

  #### Returns RetentionPolicy

  - Defined in utils/auditSink.ts:180

## Properties

### `Private` `Readonly` maxAgeMs

maxAgeMs: number

- Defined in utils/auditSink.ts:180

## Methods

### enforce

- enforce(entries: AuditLogEntry[]): AuditLogEntry[]

  Returns only entries whose timestamp is within the retention window.

  #### Parameters

  - entries: AuditLogEntry[]

  #### Returns AuditLogEntry[]

  - Defined in utils/auditSink.ts:185

### isExpired

- isExpired(entry: AuditLogEntry): boolean

  Returns `true` if the given entry has exceeded the retention period.

  #### Parameters

  - entry: AuditLogEntry

  #### Returns boolean

  - Defined in utils/auditSink.ts:193