# Class MemoryAuditSink

In-memory audit sink.

Buffers entries in a private array and supports querying and per-user erasure (GDPR Article 17 — Right to Erasure).

#### Since

0.9.0

#### Implements

- AuditSink

- Defined in utils/auditSink.ts:206

##### Index

### Constructors

constructor

### Properties

entries

### Methods

clear
eraseByUser
matchesFilter
query
write

## Constructors

### constructor

- new MemoryAuditSink(): MemoryAuditSink

  #### Returns MemoryAuditSink

## Properties

### `Private` entries

entries: AuditLogEntry[] = []

- Defined in utils/auditSink.ts:207

## Methods

### clear

- clear(_authorization?: string): void

  Clears the internal buffer. The `authorization` param is accepted but unused — access control is enforced by `AuditLogger`.

  #### Parameters

  - `Optional`_authorization: string

  #### Returns void

  Implementation of AuditSink.clear

  - Defined in utils/auditSink.ts:224

### eraseByUser

- eraseByUser(userId: string): void

  Removes all entries associated with `userId`.

  GDPR Article 17 — Right to Erasure.

  #### Parameters

  - userId: string

  #### Returns void

  - Defined in utils/auditSink.ts:233

### `Private` matchesFilter

- matchesFilter(entry: AuditLogEntry, filter: AuditFilter): boolean

  #### Parameters

  - entry: AuditLogEntry
  - filter: AuditFilter

  #### Returns boolean

  - Defined in utils/auditSink.ts:237

### query

- query(filter: AuditFilter): AuditLogEntry[]

  Returns entries matching the supplied filter.

  #### Parameters

  - filter: AuditFilter

  #### Returns AuditLogEntry[]

  Implementation of AuditSink.query

  - Defined in utils/auditSink.ts:215

### write

- write(entry: AuditLogEntry): void

  Appends the entry to the internal buffer.

  #### Parameters

  - entry: AuditLogEntry

  #### Returns void

  Implementation of AuditSink.write

  - Defined in utils/auditSink.ts:210