Skip to main content
Version: latest (master)

Function: encodeAuditEvent()

encodeAuditEvent(event): string

Defined in: src/audit/encode.ts:80

Serialize an AuditEvent to its JSON wire string.

Translates the camelCase interface field names into the gateway's snake_case keys (eventIdevent_id, callStackcall_stack, etc.), recursively encoding the call-stack tree via encodeCallStackNode. Optional fields whose value is undefined, an empty string, or an empty array are omitted so a legacy decoder that has never seen those fields reads the payload unchanged.

Parameters

event

AuditEvent

Returns

string