Events Core Events Core protocol schemas
Source: packages/spec/src/kernel/events/core.zod.ts
import { EventSchema, EventMetadataSchema, EventPriority, EventTypeDefinitionSchema } from '@objectstack/spec/kernel' ;
import type { Event, EventPriority, EventTypeDefinition } from '@objectstack/spec/kernel' ;
// Validate data
const result = EventSchema. parse (data);
Property Type Required Description id stringoptional Unique event identifier name string✅ Event name (dot notation by convention, e.g. user.created, order.paid; the platform-checked event vocabulary is the closed DataEventType / BulkDataEventType enums) payload any✅ Event payload schema metadata { source: string; timestamp: string; userId?: string; tenantId?: string; … }✅ Event metadata
Property Type Required Description source string✅ Event source (e.g., plugin name, system component) timestamp string✅ ISO 8601 datetime when event was created userId stringoptional User who triggered the event tenantId stringoptional Tenant identifier for multi-tenant systems correlationId stringoptional Correlation ID for event tracing causationId stringoptional ID of the event that caused this event priority Enum<'critical' | 'high' | 'normal' | 'low' | 'background'>optional (default: "normal") Event priority cluster { scope: Enum<'local' | 'cluster' | 'tenant'>; deliverySemantics?: Enum<'best-effort' | 'at-least-once' | 'exactly-once'>; partitionKey?: string }optional Per-emit cluster routing & delivery options. See /docs/kernel/cluster §4.
Property Type Required Description source string✅ Event source (e.g., plugin name, system component) timestamp string✅ ISO 8601 datetime when event was created userId stringoptional User who triggered the event tenantId stringoptional Tenant identifier for multi-tenant systems correlationId stringoptional Correlation ID for event tracing causationId stringoptional ID of the event that caused this event priority Enum<'critical' | 'high' | 'normal' | 'low' | 'background'>optional (default: "normal") Event priority cluster { scope: Enum<'local' | 'cluster' | 'tenant'>; deliverySemantics?: Enum<'best-effort' | 'at-least-once' | 'exactly-once'>; partitionKey?: string }optional Per-emit cluster routing & delivery options. See /docs/kernel/cluster §4.
Property Type Required Description scope Enum<'local' | 'cluster' | 'tenant'>optional (default: "local") Delivery scope. Default local for backward compatibility. deliverySemantics Enum<'best-effort' | 'at-least-once' | 'exactly-once'>optional Delivery guarantee. Default depends on scope. partitionKey stringoptional Stable key that guarantees emit-order delivery for same-key events.
critical
high
normal
low
background
Property Type Required Description name string✅ Event type name (dot notation by convention, e.g. order.created; the platform-checked event vocabulary is the closed DataEventType / BulkDataEventType enums) version stringoptional (default: "1.0.0") Event schema version schema anyoptional JSON Schema for event payload validation description stringoptional Event type description deprecated booleanoptional (default: false) Whether this event type is deprecated tags string[]optional Event type tags