Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions content/docs/references/system/CronSchedule.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: CronSchedule
description: CronSchedule Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `string` | ✅ | |
| **expression** | `string` | ✅ | Cron expression (e.g., "0 0 * * *" for daily at midnight) |
| **timezone** | `string` | optional | Timezone for cron execution (e.g., "America/New_York") |
12 changes: 12 additions & 0 deletions content/docs/references/system/Event.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Event
description: Event Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **name** | `string` | ✅ | Event name (snake_case with dots, e.g., user.created) |
| **payload** | `any` | optional | Event payload schema |
| **metadata** | `object` | ✅ | Event metadata |
12 changes: 12 additions & 0 deletions content/docs/references/system/EventHandler.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: EventHandler
description: EventHandler Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **eventName** | `string` | ✅ | Name of event to handle (supports wildcards like user.*) |
| **priority** | `integer` | optional | Execution priority (lower numbers execute first) |
| **async** | `boolean` | optional | Execute in background (true) or block (false) |
13 changes: 13 additions & 0 deletions content/docs/references/system/EventMetadata.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: EventMetadata
description: EventMetadata Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **source** | `string` | ✅ | Event source (e.g., plugin name, system component) |
| **timestamp** | `string` | ✅ | ISO 8601 datetime when event was created |
| **userId** | `string` | optional | User who triggered the event |
| **tenantId** | `string` | optional | Tenant identifier for multi-tenant systems |
11 changes: 11 additions & 0 deletions content/docs/references/system/EventPersistence.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: EventPersistence
description: EventPersistence Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **enabled** | `boolean` | optional | Enable event persistence |
| **retention** | `integer` | ✅ | Days to retain persisted events |
11 changes: 11 additions & 0 deletions content/docs/references/system/EventRoute.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: EventRoute
description: EventRoute Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **from** | `string` | ✅ | Source event pattern (supports wildcards, e.g., user.* or *.created) |
| **to** | `string[]` | ✅ | Target event names to route to |
11 changes: 11 additions & 0 deletions content/docs/references/system/IntervalSchedule.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: IntervalSchedule
description: IntervalSchedule Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `string` | ✅ | |
| **intervalMs** | `integer` | ✅ | Interval in milliseconds |
15 changes: 15 additions & 0 deletions content/docs/references/system/Job.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Job
description: Job Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique job identifier |
| **name** | `string` | ✅ | Job name (snake_case) |
| **schedule** | `object \| object \| object` | ✅ | Job schedule configuration |
| **retryPolicy** | `object` | optional | Retry policy configuration |
| **timeout** | `integer` | optional | Timeout in milliseconds |
| **enabled** | `boolean` | optional | Whether the job is enabled |
15 changes: 15 additions & 0 deletions content/docs/references/system/JobExecution.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: JobExecution
description: JobExecution Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **jobId** | `string` | ✅ | Job identifier |
| **startedAt** | `string` | ✅ | ISO 8601 datetime when execution started |
| **completedAt** | `string` | optional | ISO 8601 datetime when execution completed |
| **status** | `Enum<'running' \| 'success' \| 'failed' \| 'timeout'>` | ✅ | Execution status |
| **error** | `string` | optional | Error message if failed |
| **duration** | `integer` | optional | Execution duration in milliseconds |
11 changes: 11 additions & 0 deletions content/docs/references/system/JobExecutionStatus.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: JobExecutionStatus
description: JobExecutionStatus Schema Reference
---

## Allowed Values

* `running`
* `success`
* `failed`
* `timeout`
11 changes: 11 additions & 0 deletions content/docs/references/system/OnceSchedule.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: OnceSchedule
description: OnceSchedule Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `string` | ✅ | |
| **at** | `string` | ✅ | ISO 8601 datetime when to execute |
13 changes: 13 additions & 0 deletions content/docs/references/system/Presence.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Presence
description: Presence Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **userId** | `string` | ✅ | User identifier |
| **status** | `Enum<'online' \| 'away' \| 'offline'>` | ✅ | Current presence status |
| **lastSeen** | `string` | ✅ | ISO 8601 datetime of last activity |
| **metadata** | `Record<string, any>` | optional | Custom presence data (e.g., current page, custom status) |
10 changes: 10 additions & 0 deletions content/docs/references/system/PresenceStatus.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: PresenceStatus
description: PresenceStatus Schema Reference
---

## Allowed Values

* `online`
* `away`
* `offline`
10 changes: 10 additions & 0 deletions content/docs/references/system/RealtimeAction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: RealtimeAction
description: RealtimeAction Schema Reference
---

## Allowed Values

* `created`
* `updated`
* `deleted`
16 changes: 16 additions & 0 deletions content/docs/references/system/RealtimeEvent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: RealtimeEvent
description: RealtimeEvent Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique event identifier |
| **type** | `string` | ✅ | Event type (e.g., record.created, record.updated) |
| **object** | `string` | optional | Object name the event relates to |
| **action** | `Enum<'created' \| 'updated' \| 'deleted'>` | optional | Action performed |
| **payload** | `any` | optional | Event payload data |
| **timestamp** | `string` | ✅ | ISO 8601 datetime when event occurred |
| **userId** | `string` | optional | User who triggered the event |
11 changes: 11 additions & 0 deletions content/docs/references/system/RealtimeEventType.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: RealtimeEventType
description: RealtimeEventType Schema Reference
---

## Allowed Values

* `record.created`
* `record.updated`
* `record.deleted`
* `field.changed`
12 changes: 12 additions & 0 deletions content/docs/references/system/RetryPolicy.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: RetryPolicy
description: RetryPolicy Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **maxRetries** | `integer` | optional | Maximum number of retry attempts |
| **backoffMs** | `integer` | optional | Initial backoff delay in milliseconds |
| **backoffMultiplier** | `number` | optional | Multiplier for exponential backoff |
5 changes: 5 additions & 0 deletions content/docs/references/system/Schedule.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Schedule
description: Schedule Schema Reference
---

13 changes: 13 additions & 0 deletions content/docs/references/system/Subscription.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Subscription
description: Subscription Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique subscription identifier |
| **events** | `object[]` | ✅ | Array of events to subscribe to |
| **transport** | `Enum<'websocket' \| 'sse' \| 'polling'>` | ✅ | Transport protocol to use |
| **channel** | `string` | optional | Optional channel name for grouping subscriptions |
12 changes: 12 additions & 0 deletions content/docs/references/system/SubscriptionEvent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: SubscriptionEvent
description: SubscriptionEvent Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `Enum<'record.created' \| 'record.updated' \| 'record.deleted' \| 'field.changed'>` | ✅ | Type of event to subscribe to |
| **object** | `string` | optional | Object name to subscribe to |
| **filters** | `any` | optional | Filter conditions |
10 changes: 10 additions & 0 deletions content/docs/references/system/TransportProtocol.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: TransportProtocol
description: TransportProtocol Schema Reference
---

## Allowed Values

* `websocket`
* `sse`
* `polling`
29 changes: 29 additions & 0 deletions packages/spec/json-schema/CronSchedule.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$ref": "#/definitions/CronSchedule",
"definitions": {
"CronSchedule": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "cron"
},
"expression": {
"type": "string",
"description": "Cron expression (e.g., \"0 0 * * *\" for daily at midnight)"
},
"timezone": {
"type": "string",
"default": "UTC",
"description": "Timezone for cron execution (e.g., \"America/New_York\")"
}
},
"required": [
"type",
"expression"
],
"additionalProperties": false
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
52 changes: 52 additions & 0 deletions packages/spec/json-schema/Event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"$ref": "#/definitions/Event",
"definitions": {
"Event": {
"type": "object",
"properties": {
"name": {
"type": "string",
"pattern": "^[a-z_][a-z0-9_.]*$",
"description": "Event name (snake_case with dots, e.g., user.created)"
},
"payload": {
"description": "Event payload schema"
},
"metadata": {
"type": "object",
"properties": {
"source": {
"type": "string",
"description": "Event source (e.g., plugin name, system component)"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 datetime when event was created"
},
"userId": {
"type": "string",
"description": "User who triggered the event"
},
"tenantId": {
"type": "string",
"description": "Tenant identifier for multi-tenant systems"
}
},
"required": [
"source",
"timestamp"
],
"additionalProperties": false,
"description": "Event metadata"
}
},
"required": [
"name",
"metadata"
],
"additionalProperties": false
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
29 changes: 29 additions & 0 deletions packages/spec/json-schema/EventHandler.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$ref": "#/definitions/EventHandler",
"definitions": {
"EventHandler": {
"type": "object",
"properties": {
"eventName": {
"type": "string",
"description": "Name of event to handle (supports wildcards like user.*)"
},
"priority": {
"type": "integer",
"default": 0,
"description": "Execution priority (lower numbers execute first)"
},
"async": {
"type": "boolean",
"default": true,
"description": "Execute in background (true) or block (false)"
}
},
"required": [
"eventName"
],
"additionalProperties": false
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
Loading
Loading