prorm API Reference
    Preparing search index...

    Interface AuditOptions

    @Audit class decorator — automatically record model lifecycle events to an in-memory audit log.

    When applied to a model class the decorator registers beforeCreate, beforeUpdate, and beforeDestroy hooks (via ModelClass.addHook) that append structured entries to a per-class log.

    Example:

      @Audit({ tableName: 'audit_log', trackFields: ['name', 'email'] })
    class User extends Model { ... }

    // After create/update/destroy hooks fire:
    const log = getAuditLog(User);
    clearAuditLog(User);
    interface AuditOptions {
        tableName?: string;
        trackFields?: string[];
        userField?: string;
    }
    Index
    tableName?: string

    Name of the conceptual audit table (used as label in entries). Default: 'audit_log'.

    trackFields?: string[]

    If provided, only these fields are captured in newValues/oldValues.

    userField?: string

    Field name on the model that holds the current user identifier.