BeforeEvent
type BeforeEvent = | { actions: string[]; count: number; tenant: string; type: "event.record";} | { actor: HookActor | null; eventId: string; reason?: string; sections: AuditSection[]; tenant: string; type: "event.erase";} | { actor: HookActor | null; format: string; query: AuditQuery; tenant: string; type: "events.export";} | { actor: HookActor | null; tenant: string; throughSeq: number; type: "events.prune";} | { action: ActionDefinition; actor: HookActor | null; type: "action.upsert";} | { actor: HookActor | null; name: string; type: "action.delete";} | { actor: HookActor | null; tenant: string; type: "checkpoint.create";};Defined in: src/hooks/contract.ts:48
Event delivered to AuditHooks.before — the proposed mutation, before it commits. Throw from the handler to deny it.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ actions: string[]; count: number; tenant: string; type: "event.record";}| Name | Type | Description | Defined in |
|---|---|---|---|
actions |
string[] |
- | src/hooks/contract.ts:53 |
count |
number |
- | src/hooks/contract.ts:54 |
tenant |
string |
- | src/hooks/contract.ts:52 |
type |
"event.record" |
The record gate (quota, policy). Runs once per record/recordMany call per tenant. |
src/hooks/contract.ts:51 |
Type Literal
Section titled “Type Literal”{ actor: HookActor | null; eventId: string; reason?: string; sections: AuditSection[]; tenant: string; type: "event.erase";}Type Literal
Section titled “Type Literal”{ actor: HookActor | null; format: string; query: AuditQuery; tenant: string; type: "events.export";}Type Literal
Section titled “Type Literal”{ actor: HookActor | null; tenant: string; throughSeq: number; type: "events.prune";}Type Literal
Section titled “Type Literal”{ action: ActionDefinition; actor: HookActor | null; type: "action.upsert";}Type Literal
Section titled “Type Literal”{ actor: HookActor | null; name: string; type: "action.delete";}Type Literal
Section titled “Type Literal”{ actor: HookActor | null; tenant: string; type: "checkpoint.create";}