ObjectStackObjectStack

Events Core

Events Core protocol schemas

Event Priority Enum

Priority levels for event processing

Lower numbers = higher priority

Source: packages/spec/src/kernel/events/core.zod.ts

TypeScript Usage

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);

Event

Properties

PropertyTypeRequiredDescription
idstringoptionalUnique event identifier
namestringEvent name (lowercase with dots, e.g., user.created, order.paid)
payloadanyEvent payload schema
metadata{ source: string; timestamp: string; userId?: string; tenantId?: string; … }Event metadata

EventMetadata

Properties

PropertyTypeRequiredDescription
sourcestringEvent source (e.g., plugin name, system component)
timestampstringISO 8601 datetime when event was created
userIdstringoptionalUser who triggered the event
tenantIdstringoptionalTenant identifier for multi-tenant systems
correlationIdstringoptionalCorrelation ID for event tracing
causationIdstringoptionalID of the event that caused this event
priorityEnum<'critical' | 'high' | 'normal' | 'low' | 'background'>Event priority
cluster{ scope: Enum<'local' | 'cluster' | 'tenant'>; deliverySemantics?: Enum<'best-effort' | 'at-least-once' | 'exactly-once'>; partitionKey?: string }optionalPer-emit cluster routing & delivery options. See cluster-semantics.mdx §4.

EventPriority

Allowed Values

  • critical
  • high
  • normal
  • low
  • background

EventTypeDefinition

Properties

PropertyTypeRequiredDescription
namestringEvent type name (lowercase with dots)
versionstringEvent schema version
schemaanyoptionalJSON Schema for event payload validation
descriptionstringoptionalEvent type description
deprecatedbooleanWhether this event type is deprecated
tagsstring[]optionalEvent type tags

On this page