Skip to content

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.

{
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

{
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";
}