AuditAction variable

The three kinds of write recorded in the audit trail.

Signature:

AuditAction: {
    readonly INSERT: 'INSERT';
    readonly UPDATE: 'UPDATE';
    readonly DELETE: 'DELETE';
}

export type AuditAction = (typeof AuditAction)[keyof typeof AuditAction];

Remarks

These are the literal strings written to the audit table's action column, so they are part of the stored data, not just an internal enum — a reader querying the trail matches on 'INSERT', 'UPDATE' or 'DELETE'.

The mapping from Prisma operations is not one-to-one: create records INSERT, update and updateMany record UPDATE, delete and deleteMany record DELETE. A soft delete is recorded as DELETE, since it is the caller's delete that is seen — but only when audit() is added before softDelete(), because the reroute goes to the unextended client and otherwise never reaches the audit extension at all.

The value and the type share a name and a page, as the const-plus-derived-union idiom requires.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.