Events Integrations
Events Integrations protocol schemas
Event Webhook Configuration Schema
Configuration for sending events to webhooks
@example
{
"eventPattern": "order.*",
"url": "https://api.example.com/webhooks/orders",
"method": "POST",
"headers": { "Authorization": "Bearer token" }
}
Source: packages/spec/src/kernel/events/integrations.zod.ts
TypeScript Usage
import { EventMessageQueueConfigSchema, EventWebhookConfigSchema, RealTimeNotificationConfigSchema } from '@objectstack/spec/kernel';
import type { EventMessageQueueConfig, EventWebhookConfig, RealTimeNotificationConfig } from '@objectstack/spec/kernel';
// Validate data
const result = EventMessageQueueConfigSchema.parse(data);EventMessageQueueConfig
Properties
| 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 | ✅ | Event name pattern to publish (supports wildcards) |
| partitionKey | string | optional | JSON path for partition key (e.g., "metadata.tenantId") |
| format | Enum<'json' | 'avro' | 'protobuf'> | ✅ | Message serialization format |
| includeMetadata | boolean | ✅ | Include event metadata in message |
| compression | Enum<'none' | 'gzip' | 'snappy' | 'lz4'> | ✅ | Message compression |
| batchSize | integer | ✅ | Batch size for publishing |
| flushIntervalMs | integer | ✅ | Flush interval for batching |
EventWebhookConfig
Properties
| 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'> | ✅ | 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 | ✅ | Request timeout in milliseconds |
| transform | any | optional | Transform event before sending |
| enabled | boolean | ✅ | Whether webhook is enabled |
RealTimeNotificationConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| enabled | boolean | ✅ | Enable real-time notifications |
| protocol | Enum<'websocket' | 'sse' | 'long-polling'> | ✅ | Real-time protocol |
| eventPattern | string | ✅ | Event pattern to broadcast |
| userFilter | boolean | ✅ | Filter events by user |
| tenantFilter | boolean | ✅ | 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 |