Setu-TS
    Preparing search index...

    Interface StoredAuditEntry

    A stored audit record extends AuditEntry with an internally assigned id (UUID v4) and timestamp (wall-clock epoch ms).

    To work around exactOptionalPropertyTypes with inherited optional fields from AuditEntry, we redeclare resourceId/userId/before/after/ metadata with | undefined so assigning { resourceId: undefined } compiles cleanly.

    interface StoredAuditEntry {
        action: string;
        after?: Readonly<Record<string, unknown>>;
        before?: Readonly<Record<string, unknown>>;
        id: string;
        metadata?: Readonly<Record<string, unknown>>;
        resource: string;
        resourceId?: string;
        result: "success" | "failure";
        timestamp: number;
        userId?: string;
    }
    Index
    action: string

    The audited action (e.g. 'user.login').

    after?: Readonly<Record<string, unknown>>

    Resource state after the operation, when captured.

    before?: Readonly<Record<string, unknown>>

    Resource state before the operation, when captured.

    id: string

    Internally assigned unique identifier (UUID v4).

    metadata?: Readonly<Record<string, unknown>>

    Free-form structured context attached by the caller.

    resource: string

    The audited resource type (e.g. 'session').

    resourceId?: string

    The affected resource instance identifier, when known.

    result: "success" | "failure"

    Whether the audited operation succeeded or failed.

    timestamp: number

    Wall-clock epoch milliseconds, assigned by the storage at append.

    userId?: string

    The acting principal's identifier, when authenticated.