Event types
An event type is the registry’s entry for one type of event, such as request.assigned: a description, an optional JSON Schema for its data, and the data paths that hold references. Registering a type is optional; it lets EventWolf reject broken events before anyone reads them.
Schemas and versions
A type’s schema is a JSON Schema for data. When an event of the type is published, its data is checked against the current schema; data that doesn’t match is rejected with invalid_data, and the event’s record keeps the version it was checked against.
Registering a schema different from the current one makes a new version, numbered from 1, which checks events published from then on. Every version is kept, and events already stored are never checked again. Before you register a stricter schema, read the type’s most recent events with List events and send them in items to Check a schema. Send one item per event, with its data if it has any. The check answers with one result per item and writes nothing. The SDK’s checkRecent reads and checks the events in one method call.
Reference paths
refPaths names the data paths whose values are references, and the type of each, such as assignee.id as a user. An event published after you set them gets those references beside the ones its subject, actor, onbehalfof, and refs give, so a read with ref=user:u_ana finds the assignments to Ana. A string or number at the path is one reference, and an array of them is one reference each. Each has the role ref, and its path says where it came from.
Unknown types
Publishes of an unregistered type are accepted when ingest.unknownTypes is accept, which Agentpost sets when a project adopts EventWolf. EventWolf lists the type as observed, with when it was first and last seen. With reject, a publish of an unregistered type answers unknown_type. To change this setting, read your config and replace its settings with the new value. Imports can observe types in either mode.
Deprecating a type
A deprecated type is still accepted and checked; the mark tells producers and readers to move to another type.
Limits
- A type has at most 20 reference paths.
- A schema check takes 1 to 200 items at once.
Where to act on it
- The EventWolf quickstart registers a type and sees an event rejected.
- The SDK event types client lists, gets, registers, checks, and deprecates types through
client.eventTypes. - Register an event type, Check a schema, List event types, and Deprecate an event type.
- The event types reference.