Events Integrations
Events Integrations protocol schemas
Source: packages/spec/src/kernel/events/integrations.zod.ts
import { EventMessageQueueConfigSchema, EventWebhookConfigSchema, RealTimeNotificationConfigSchema } from '@objectstack/spec/kernel';
import type { EventMessageQueueConfig, EventWebhookConfig, RealTimeNotificationConfig } from '@objectstack/spec/kernel';
// Validate data
const result = EventMessageQueueConfigSchema.parse(data);
| Property | Type | Required | Description |
|---|
| provider | Enum<'kafka' | 'rabbitmq' | 'aws-sqs' | 'redis-pubsub' | 'google-pubsub' | 'azure-service-bus'> | ✅ | Message queue provider |
| topic | string | ✅ | Topic or queue name |
| eventPattern | string | optional (default: "*") | Event name pattern to publish (supports wildcards) |
| partitionKey | string | optional | JSON path for partition key (e.g., "metadata.tenantId") |
| format | Enum<'json' | 'avro' | 'protobuf'> | optional (default: "json") | Message serialization format |
| includeMetadata | boolean | optional (default: true) | Include event metadata in message |
| compression | Enum<'none' | 'gzip' | 'snappy' | 'lz4'> | optional (default: "none") | Message compression |
| batchSize | integer | optional (default: 1) | Batch size for publishing |
| flushIntervalMs | integer | optional (default: 1000) | Flush interval for batching |
| Property | Type | Required | Description |
|---|
| id | string | optional | Unique webhook identifier |
| eventPattern | string | ✅ | Event name pattern (supports wildcards) |
| url | string | ✅ | Webhook endpoint URL |
| method | Enum<'GET' | 'POST' | 'PUT' | 'PATCH'> | optional (default: "POST") | HTTP method |
| headers | Record<string, string> | optional | HTTP headers |
| authentication | { type: Enum<'none' | 'bearer' | 'basic' | 'api-key'>; credentials?: Record<string, string> } | optional | Authentication configuration |
| retryPolicy | { maxRetries: integer; backoffStrategy: Enum<'fixed' | 'linear' | 'exponential'>; initialDelayMs: integer; maxDelayMs: integer } | optional | Retry policy |
| timeoutMs | integer | optional (default: 30000) | Request timeout in milliseconds |
| transform | any | optional | Transform event before sending |
| enabled | boolean | optional (default: true) | Whether webhook is enabled |
| Property | Type | Required | Description |
|---|
| type | Enum<'none' | 'bearer' | 'basic' | 'api-key'> | ✅ | Auth type |
| credentials | Record<string, string> | optional | Auth credentials |
| Property | Type | Required | Description |
|---|
| maxRetries | integer | optional (default: 3) | Max retry attempts |
| backoffStrategy | Enum<'fixed' | 'linear' | 'exponential'> | optional (default: "exponential") | |
| initialDelayMs | integer | optional (default: 1000) | Initial retry delay |
| maxDelayMs | integer | optional (default: 60000) | Max retry delay |
| Property | Type | Required | Description |
|---|
| enabled | boolean | optional (default: true) | Enable real-time notifications |
| protocol | Enum<'websocket' | 'sse' | 'long-polling'> | optional (default: "websocket") | Real-time protocol |
| eventPattern | string | optional (default: "*") | Event pattern to broadcast |
| userFilter | boolean | optional (default: true) | Filter events by user |
| tenantFilter | boolean | optional (default: true) | Filter events by tenant |
| channels | { name: string; eventPattern: string; filter?: any }[] | optional | Named channels for event broadcasting |
| rateLimit | { maxEventsPerSecond: integer; windowMs: integer } | optional | Rate limiting configuration |
| Property | Type | Required | Description |
|---|
| name | string | ✅ | Channel name |
| eventPattern | string | ✅ | Event pattern for channel |
| filter | any | optional | Additional filter function |
| Property | Type | Required | Description |
|---|
| maxEventsPerSecond | integer | ✅ | Max events per second per client |
| windowMs | integer | optional (default: 1000) | Rate limit window |