diff --git a/CHANGELOG.md b/CHANGELOG.md index c2c25f81a..a2a578fab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Security +## [0.3.3] - 2026-01-24 + +### Added +- Comprehensive ObjectAI implementation documentation +- AI agent and RAG pipeline implementation guides +- AI protocol specifications and standards + +### Changed +- Enhanced project documentation with AI-related guides and specifications + ## [0.3.2] - 2026-01-24 ### Changed diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 2cec23cb2..badb6a0d2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,46 @@ # Release Notes +## v0.3.3 - ObjectAI Documentation Release (2026-01-24) + +### 📦 Released Packages + +All packages have been updated to version **0.3.3**: + +- **@objectstack/spec@0.3.3** - Core protocol definitions and TypeScript types +- **@objectstack/types@0.3.3** - Shared TypeScript type definitions +- **@objectstack/objectql@0.3.3** - ObjectQL query language and runtime +- **@objectstack/runtime@0.3.3** - Runtime execution environment +- **@objectstack/client@0.3.3** - Client library for ObjectStack +- **@objectstack/driver-memory@0.3.3** - In-memory data storage driver +- **@objectstack/plugin-hono-server@0.3.3** - Hono server plugin for REST API +- **@objectstack/plugin-msw@0.3.3** - MSW (Mock Service Worker) plugin + +### 📝 Changes + +This is a patch release focusing on: +- **New Documentation**: Added comprehensive ObjectAI implementation documentation +- **AI Protocol Specifications**: Defined standards for AI agents and RAG pipelines +- **Enhanced Guides**: Added AI-related implementation guides and best practices +- Improved project documentation structure + +### 🤖 ObjectAI Features + +This release includes detailed documentation for: +- AI Agent implementation patterns +- RAG (Retrieval-Augmented Generation) pipeline architecture +- AI protocol specifications and standards +- Integration guides for AI capabilities + +### 🚀 Publishing + +This release is ready for publishing to npm. When this PR is merged to `main`: +1. The GitHub Actions release workflow will automatically detect the version bump +2. Build all packages +3. Publish to npm registry using NPM_TOKEN secret +4. Create GitHub release with appropriate tags + +--- + ## v0.3.2 - Maintenance Release (2026-01-24) ### 📦 Released Packages diff --git a/content/docs/references/ai/workflow-automation/AIWorkflowAutomation.mdx b/content/docs/references/ai/AIWorkflowAutomation.mdx similarity index 100% rename from content/docs/references/ai/workflow-automation/AIWorkflowAutomation.mdx rename to content/docs/references/ai/AIWorkflowAutomation.mdx diff --git a/content/docs/references/ai/workflow-automation/AIWorkflowExecutionResult.mdx b/content/docs/references/ai/AIWorkflowExecutionResult.mdx similarity index 100% rename from content/docs/references/ai/workflow-automation/AIWorkflowExecutionResult.mdx rename to content/docs/references/ai/AIWorkflowExecutionResult.mdx diff --git a/content/docs/references/ai/workflow-automation/AIWorkflowTrigger.mdx b/content/docs/references/ai/AIWorkflowTrigger.mdx similarity index 100% rename from content/docs/references/ai/workflow-automation/AIWorkflowTrigger.mdx rename to content/docs/references/ai/AIWorkflowTrigger.mdx diff --git a/content/docs/references/ai/workflow-automation/BatchAIWorkflowExecution.mdx b/content/docs/references/ai/BatchAIWorkflowExecution.mdx similarity index 100% rename from content/docs/references/ai/workflow-automation/BatchAIWorkflowExecution.mdx rename to content/docs/references/ai/BatchAIWorkflowExecution.mdx diff --git a/content/docs/references/ai/meta.json b/content/docs/references/ai/meta.json index 1fe1b44d2..460ee83f8 100644 --- a/content/docs/references/ai/meta.json +++ b/content/docs/references/ai/meta.json @@ -7,8 +7,8 @@ "cost", "model-registry", "nlq", + "orchestration", "predictive", - "rag-pipeline", - "workflow-automation" + "rag-pipeline" ] } \ No newline at end of file diff --git a/content/docs/references/ai/orchestration/AIOrchestration.mdx b/content/docs/references/ai/orchestration/AIOrchestration.mdx new file mode 100644 index 000000000..75233ab94 --- /dev/null +++ b/content/docs/references/ai/orchestration/AIOrchestration.mdx @@ -0,0 +1,34 @@ +--- +title: AIOrchestration +description: AIOrchestration Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | ✅ | Orchestration unique identifier (snake_case) | +| **label** | `string` | ✅ | Display name | +| **description** | `string` | optional | | +| **objectName** | `string` | ✅ | Target object for this orchestration | +| **trigger** | `Enum<'record_created' \| 'record_updated' \| 'field_changed' \| 'scheduled' \| 'manual' \| 'webhook' \| 'batch'>` | ✅ | | +| **fieldConditions** | `object[]` | optional | Fields to monitor (for field_changed trigger) | +| **schedule** | `object` | optional | Schedule configuration (for scheduled trigger) | +| **webhookConfig** | `object` | optional | Webhook configuration (for webhook trigger) | +| **entryCriteria** | `string` | optional | Formula condition - workflow only runs if TRUE | +| **aiTasks** | `object[]` | ✅ | AI tasks to execute in sequence | +| **postActions** | `object[]` | optional | Actions after AI tasks complete | +| **executionMode** | `Enum<'sequential' \| 'parallel'>` | optional | How to execute multiple AI tasks | +| **stopOnError** | `boolean` | optional | Stop workflow if any task fails | +| **timeout** | `number` | optional | Maximum execution time in seconds | +| **priority** | `Enum<'low' \| 'normal' \| 'high' \| 'critical'>` | optional | | +| **enableLogging** | `boolean` | optional | | +| **enableMetrics** | `boolean` | optional | | +| **notifyOnFailure** | `string[]` | optional | User IDs to notify on failure | +| **active** | `boolean` | optional | | +| **version** | `string` | optional | | +| **tags** | `string[]` | optional | | +| **category** | `string` | optional | Workflow category (e.g., "support", "sales", "hr") | +| **owner** | `string` | optional | User ID of workflow owner | +| **createdAt** | `string` | optional | ISO timestamp | +| **updatedAt** | `string` | optional | ISO timestamp | diff --git a/content/docs/references/ai/orchestration/AIOrchestrationExecutionResult.mdx b/content/docs/references/ai/orchestration/AIOrchestrationExecutionResult.mdx new file mode 100644 index 000000000..865b13f36 --- /dev/null +++ b/content/docs/references/ai/orchestration/AIOrchestrationExecutionResult.mdx @@ -0,0 +1,20 @@ +--- +title: AIOrchestrationExecutionResult +description: AIOrchestrationExecutionResult Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **workflowName** | `string` | ✅ | | +| **recordId** | `string` | ✅ | | +| **status** | `Enum<'success' \| 'partial_success' \| 'failed' \| 'skipped'>` | ✅ | | +| **executionTime** | `number` | ✅ | Execution time in milliseconds | +| **tasksExecuted** | `integer` | ✅ | Number of tasks executed | +| **tasksSucceeded** | `integer` | ✅ | Number of tasks succeeded | +| **tasksFailed** | `integer` | ✅ | Number of tasks failed | +| **taskResults** | `object[]` | optional | | +| **error** | `string` | optional | | +| **startedAt** | `string` | ✅ | ISO timestamp | +| **completedAt** | `string` | optional | ISO timestamp | diff --git a/content/docs/references/ai/orchestration/AIOrchestrationTrigger.mdx b/content/docs/references/ai/orchestration/AIOrchestrationTrigger.mdx new file mode 100644 index 000000000..3ff9d846e --- /dev/null +++ b/content/docs/references/ai/orchestration/AIOrchestrationTrigger.mdx @@ -0,0 +1,14 @@ +--- +title: AIOrchestrationTrigger +description: AIOrchestrationTrigger Schema Reference +--- + +## Allowed Values + +* `record_created` +* `record_updated` +* `field_changed` +* `scheduled` +* `manual` +* `webhook` +* `batch` \ No newline at end of file diff --git a/content/docs/references/ai/workflow-automation/AITask.mdx b/content/docs/references/ai/orchestration/AITask.mdx similarity index 100% rename from content/docs/references/ai/workflow-automation/AITask.mdx rename to content/docs/references/ai/orchestration/AITask.mdx diff --git a/content/docs/references/ai/workflow-automation/AITaskType.mdx b/content/docs/references/ai/orchestration/AITaskType.mdx similarity index 100% rename from content/docs/references/ai/workflow-automation/AITaskType.mdx rename to content/docs/references/ai/orchestration/AITaskType.mdx diff --git a/content/docs/references/ai/orchestration/BatchAIOrchestrationExecution.mdx b/content/docs/references/ai/orchestration/BatchAIOrchestrationExecution.mdx new file mode 100644 index 000000000..bae06a30f --- /dev/null +++ b/content/docs/references/ai/orchestration/BatchAIOrchestrationExecution.mdx @@ -0,0 +1,14 @@ +--- +title: BatchAIOrchestrationExecution +description: BatchAIOrchestrationExecution Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **workflowName** | `string` | ✅ | Orchestration to execute | +| **recordIds** | `string[]` | ✅ | Records to process | +| **batchSize** | `integer` | optional | | +| **parallelism** | `integer` | optional | | +| **priority** | `Enum<'low' \| 'normal' \| 'high'>` | optional | | diff --git a/content/docs/references/ai/workflow-automation/PostProcessingAction.mdx b/content/docs/references/ai/orchestration/PostProcessingAction.mdx similarity index 100% rename from content/docs/references/ai/workflow-automation/PostProcessingAction.mdx rename to content/docs/references/ai/orchestration/PostProcessingAction.mdx diff --git a/content/docs/references/ai/workflow-automation/WorkflowFieldCondition.mdx b/content/docs/references/ai/orchestration/WorkflowFieldCondition.mdx similarity index 100% rename from content/docs/references/ai/workflow-automation/WorkflowFieldCondition.mdx rename to content/docs/references/ai/orchestration/WorkflowFieldCondition.mdx diff --git a/content/docs/references/ai/workflow-automation/WorkflowSchedule.mdx b/content/docs/references/ai/orchestration/WorkflowSchedule.mdx similarity index 100% rename from content/docs/references/ai/workflow-automation/WorkflowSchedule.mdx rename to content/docs/references/ai/orchestration/WorkflowSchedule.mdx diff --git a/content/docs/references/ai/orchestration/meta.json b/content/docs/references/ai/orchestration/meta.json new file mode 100644 index 000000000..76144ea5b --- /dev/null +++ b/content/docs/references/ai/orchestration/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Orchestration" +} \ No newline at end of file diff --git a/content/docs/references/ai/workflow-automation/meta.json b/content/docs/references/ai/workflow-automation/meta.json deleted file mode 100644 index cb3f85a97..000000000 --- a/content/docs/references/ai/workflow-automation/meta.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "title": "Workflow Automation" -} \ No newline at end of file diff --git a/content/docs/references/api/contract/ExportRequest.mdx b/content/docs/references/api/contract/ExportRequest.mdx index 707d85ecc..f559d1d4a 100644 --- a/content/docs/references/api/contract/ExportRequest.mdx +++ b/content/docs/references/api/contract/ExportRequest.mdx @@ -9,14 +9,15 @@ description: ExportRequest Schema Reference | :--- | :--- | :--- | :--- | | **object** | `string` | ✅ | Object name (e.g. account) | | **fields** | `string \| object[]` | optional | Fields to retrieve | -| **aggregations** | `object[]` | optional | Aggregation functions (GROUP BY) | -| **windowFunctions** | `object[]` | optional | Window functions with OVER clause | -| **filters** | `any[] \| string \| any[]` | optional | Filtering criteria | -| **joins** | `object[]` | optional | Table joins | +| **where** | `any` | optional | Filtering criteria (WHERE) | +| **orderBy** | `object[]` | optional | Sorting instructions (ORDER BY) | +| **limit** | `number` | optional | Max records to return (LIMIT) | +| **offset** | `number` | optional | Records to skip (OFFSET) | +| **cursor** | `Record` | optional | Cursor for keyset pagination | +| **joins** | `object[]` | optional | Explicit Table Joins | +| **aggregations** | `object[]` | optional | Aggregation functions | | **groupBy** | `string[]` | optional | GROUP BY fields | -| **having** | `any[] \| string \| any[]` | optional | HAVING clause for aggregation filtering | -| **sort** | `object[]` | optional | Sorting instructions | -| **top** | `number` | optional | Limit results | -| **skip** | `number` | optional | Offset results | +| **having** | `any` | optional | HAVING clause for aggregation filtering | +| **windowFunctions** | `object[]` | optional | Window functions with OVER clause | | **distinct** | `boolean` | optional | SELECT DISTINCT flag | | **format** | `Enum<'csv' \| 'json' \| 'xlsx'>` | optional | | diff --git a/content/docs/references/api/discovery/ApiCapabilities.mdx b/content/docs/references/api/discovery/ApiCapabilities.mdx new file mode 100644 index 000000000..ba39b55e8 --- /dev/null +++ b/content/docs/references/api/discovery/ApiCapabilities.mdx @@ -0,0 +1,13 @@ +--- +title: ApiCapabilities +description: ApiCapabilities Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **graphql** | `boolean` | optional | | +| **search** | `boolean` | optional | | +| **websockets** | `boolean` | optional | | +| **files** | `boolean` | optional | | diff --git a/content/docs/references/api/discovery/ApiRoutes.mdx b/content/docs/references/api/discovery/ApiRoutes.mdx new file mode 100644 index 000000000..4eb788035 --- /dev/null +++ b/content/docs/references/api/discovery/ApiRoutes.mdx @@ -0,0 +1,15 @@ +--- +title: ApiRoutes +description: ApiRoutes Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **data** | `string` | ✅ | e.g. /api/v1/data | +| **metadata** | `string` | ✅ | e.g. /api/v1/meta | +| **auth** | `string` | ✅ | e.g. /api/v1/auth | +| **actions** | `string` | optional | e.g. /api/v1/p | +| **storage** | `string` | optional | e.g. /api/v1/storage | +| **graphql** | `string` | optional | e.g. /api/v1/graphql | diff --git a/content/docs/references/api/discovery/Discovery.mdx b/content/docs/references/api/discovery/Discovery.mdx new file mode 100644 index 000000000..3dbf27d14 --- /dev/null +++ b/content/docs/references/api/discovery/Discovery.mdx @@ -0,0 +1,15 @@ +--- +title: Discovery +description: Discovery Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | ✅ | | +| **version** | `string` | ✅ | | +| **environment** | `Enum<'production' \| 'sandbox' \| 'development'>` | ✅ | | +| **routes** | `object` | ✅ | | +| **features** | `object` | ✅ | | +| **locale** | `object` | ✅ | | diff --git a/content/docs/references/system/discovery/meta.json b/content/docs/references/api/discovery/meta.json similarity index 100% rename from content/docs/references/system/discovery/meta.json rename to content/docs/references/api/discovery/meta.json diff --git a/content/docs/references/system/api/ApiEndpoint.mdx b/content/docs/references/api/endpoint/ApiEndpoint.mdx similarity index 100% rename from content/docs/references/system/api/ApiEndpoint.mdx rename to content/docs/references/api/endpoint/ApiEndpoint.mdx diff --git a/content/docs/references/system/api/ApiMapping.mdx b/content/docs/references/api/endpoint/ApiMapping.mdx similarity index 100% rename from content/docs/references/system/api/ApiMapping.mdx rename to content/docs/references/api/endpoint/ApiMapping.mdx diff --git a/content/docs/references/system/api/RateLimit.mdx b/content/docs/references/api/endpoint/RateLimit.mdx similarity index 100% rename from content/docs/references/system/api/RateLimit.mdx rename to content/docs/references/api/endpoint/RateLimit.mdx diff --git a/content/docs/references/api/endpoint/meta.json b/content/docs/references/api/endpoint/meta.json new file mode 100644 index 000000000..1a36a9f9c --- /dev/null +++ b/content/docs/references/api/endpoint/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Endpoint" +} \ No newline at end of file diff --git a/content/docs/references/api/meta.json b/content/docs/references/api/meta.json index f4e081087..b8d564322 100644 --- a/content/docs/references/api/meta.json +++ b/content/docs/references/api/meta.json @@ -2,6 +2,9 @@ "title": "API Protocol", "root": true, "pages": [ - "contract" + "contract", + "discovery", + "endpoint", + "realtime" ] } \ No newline at end of file diff --git a/content/docs/references/api/realtime/Presence.mdx b/content/docs/references/api/realtime/Presence.mdx new file mode 100644 index 000000000..014e96053 --- /dev/null +++ b/content/docs/references/api/realtime/Presence.mdx @@ -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` | optional | Custom presence data (e.g., current page, custom status) | diff --git a/content/docs/references/api/realtime/PresenceStatus.mdx b/content/docs/references/api/realtime/PresenceStatus.mdx new file mode 100644 index 000000000..f884a53c3 --- /dev/null +++ b/content/docs/references/api/realtime/PresenceStatus.mdx @@ -0,0 +1,10 @@ +--- +title: PresenceStatus +description: PresenceStatus Schema Reference +--- + +## Allowed Values + +* `online` +* `away` +* `offline` \ No newline at end of file diff --git a/content/docs/references/api/realtime/RealtimeAction.mdx b/content/docs/references/api/realtime/RealtimeAction.mdx new file mode 100644 index 000000000..2f1af2e3c --- /dev/null +++ b/content/docs/references/api/realtime/RealtimeAction.mdx @@ -0,0 +1,10 @@ +--- +title: RealtimeAction +description: RealtimeAction Schema Reference +--- + +## Allowed Values + +* `created` +* `updated` +* `deleted` \ No newline at end of file diff --git a/content/docs/references/api/realtime/RealtimeEvent.mdx b/content/docs/references/api/realtime/RealtimeEvent.mdx new file mode 100644 index 000000000..46a1b1b22 --- /dev/null +++ b/content/docs/references/api/realtime/RealtimeEvent.mdx @@ -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 | diff --git a/content/docs/references/api/realtime/RealtimeEventType.mdx b/content/docs/references/api/realtime/RealtimeEventType.mdx new file mode 100644 index 000000000..56c877e5c --- /dev/null +++ b/content/docs/references/api/realtime/RealtimeEventType.mdx @@ -0,0 +1,11 @@ +--- +title: RealtimeEventType +description: RealtimeEventType Schema Reference +--- + +## Allowed Values + +* `record.created` +* `record.updated` +* `record.deleted` +* `field.changed` \ No newline at end of file diff --git a/content/docs/references/api/realtime/Subscription.mdx b/content/docs/references/api/realtime/Subscription.mdx new file mode 100644 index 000000000..31ad739bb --- /dev/null +++ b/content/docs/references/api/realtime/Subscription.mdx @@ -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 | diff --git a/content/docs/references/api/realtime/SubscriptionEvent.mdx b/content/docs/references/api/realtime/SubscriptionEvent.mdx new file mode 100644 index 000000000..ff9133f31 --- /dev/null +++ b/content/docs/references/api/realtime/SubscriptionEvent.mdx @@ -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 | diff --git a/content/docs/references/api/realtime/TransportProtocol.mdx b/content/docs/references/api/realtime/TransportProtocol.mdx new file mode 100644 index 000000000..a24a12829 --- /dev/null +++ b/content/docs/references/api/realtime/TransportProtocol.mdx @@ -0,0 +1,10 @@ +--- +title: TransportProtocol +description: TransportProtocol Schema Reference +--- + +## Allowed Values + +* `websocket` +* `sse` +* `polling` \ No newline at end of file diff --git a/content/docs/references/system/realtime/meta.json b/content/docs/references/api/realtime/meta.json similarity index 100% rename from content/docs/references/system/realtime/meta.json rename to content/docs/references/api/realtime/meta.json diff --git a/content/docs/references/system/api/HttpMethod.mdx b/content/docs/references/api/view/HttpMethod.mdx similarity index 100% rename from content/docs/references/system/api/HttpMethod.mdx rename to content/docs/references/api/view/HttpMethod.mdx diff --git a/content/docs/references/data/query/FilterNode.mdx b/content/docs/references/data/FilterNode.mdx similarity index 100% rename from content/docs/references/data/query/FilterNode.mdx rename to content/docs/references/data/FilterNode.mdx diff --git a/content/docs/references/data/query/FilterOperator.mdx b/content/docs/references/data/FilterOperator.mdx similarity index 100% rename from content/docs/references/data/query/FilterOperator.mdx rename to content/docs/references/data/FilterOperator.mdx diff --git a/content/docs/references/data/query/LogicOperator.mdx b/content/docs/references/data/LogicOperator.mdx similarity index 100% rename from content/docs/references/data/query/LogicOperator.mdx rename to content/docs/references/data/LogicOperator.mdx diff --git a/content/docs/references/data/datasource/Datasource.mdx b/content/docs/references/data/datasource/Datasource.mdx new file mode 100644 index 000000000..2d406896b --- /dev/null +++ b/content/docs/references/data/datasource/Datasource.mdx @@ -0,0 +1,18 @@ +--- +title: Datasource +description: Datasource Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | ✅ | Unique datasource identifier | +| **label** | `string` | optional | Display label | +| **driver** | `string` | ✅ | Underlying driver type | +| **config** | `Record` | ✅ | Driver specific configuration | +| **pool** | `object` | optional | Connection pool settings | +| **readReplicas** | `Record[]` | optional | Read-only replica configurations | +| **capabilities** | `object` | optional | Capability overrides | +| **description** | `string` | optional | Internal description | +| **active** | `boolean` | optional | Is datasource enabled | diff --git a/content/docs/references/data/datasource/DatasourceCapabilities.mdx b/content/docs/references/data/datasource/DatasourceCapabilities.mdx new file mode 100644 index 000000000..c1e512544 --- /dev/null +++ b/content/docs/references/data/datasource/DatasourceCapabilities.mdx @@ -0,0 +1,20 @@ +--- +title: DatasourceCapabilities +description: DatasourceCapabilities Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **transactions** | `boolean` | optional | | +| **queryFilters** | `boolean` | optional | | +| **queryAggregations** | `boolean` | optional | | +| **querySorting** | `boolean` | optional | | +| **queryPagination** | `boolean` | optional | | +| **queryWindowFunctions** | `boolean` | optional | | +| **querySubqueries** | `boolean` | optional | | +| **joins** | `boolean` | optional | | +| **fullTextSearch** | `boolean` | optional | | +| **readOnly** | `boolean` | optional | | +| **dynamicSchema** | `boolean` | optional | | diff --git a/content/docs/references/data/datasource/DriverDefinition.mdx b/content/docs/references/data/datasource/DriverDefinition.mdx new file mode 100644 index 000000000..b680f3085 --- /dev/null +++ b/content/docs/references/data/datasource/DriverDefinition.mdx @@ -0,0 +1,15 @@ +--- +title: DriverDefinition +description: DriverDefinition Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **id** | `string` | ✅ | Unique driver identifier (e.g. "postgres") | +| **label** | `string` | ✅ | Display label (e.g. "PostgreSQL") | +| **description** | `string` | optional | | +| **icon** | `string` | optional | | +| **configSchema** | `Record` | ✅ | JSON Schema for connection configuration | +| **capabilities** | `object` | optional | | diff --git a/content/docs/references/data/datasource/DriverType.mdx b/content/docs/references/data/datasource/DriverType.mdx new file mode 100644 index 000000000..e896a3850 --- /dev/null +++ b/content/docs/references/data/datasource/DriverType.mdx @@ -0,0 +1,7 @@ +--- +title: DriverType +description: Underlying driver identifier +--- + +Underlying driver identifier + diff --git a/content/docs/references/system/datasource/meta.json b/content/docs/references/data/datasource/meta.json similarity index 100% rename from content/docs/references/system/datasource/meta.json rename to content/docs/references/data/datasource/meta.json diff --git a/content/docs/references/data/driver/DriverCapabilities.mdx b/content/docs/references/data/driver/DriverCapabilities.mdx new file mode 100644 index 000000000..f1a95721d --- /dev/null +++ b/content/docs/references/data/driver/DriverCapabilities.mdx @@ -0,0 +1,22 @@ +--- +title: DriverCapabilities +description: DriverCapabilities Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **transactions** | `boolean` | ✅ | Supports transactions | +| **queryFilters** | `boolean` | ✅ | Supports WHERE clause filtering | +| **queryAggregations** | `boolean` | ✅ | Supports GROUP BY and aggregation functions | +| **querySorting** | `boolean` | ✅ | Supports ORDER BY sorting | +| **queryPagination** | `boolean` | ✅ | Supports LIMIT/OFFSET pagination | +| **queryWindowFunctions** | `boolean` | ✅ | Supports window functions with OVER clause | +| **querySubqueries** | `boolean` | ✅ | Supports subqueries | +| **joins** | `boolean` | ✅ | Supports SQL joins | +| **fullTextSearch** | `boolean` | ✅ | Supports full-text search | +| **jsonFields** | `boolean` | ✅ | Supports JSON field types | +| **arrayFields** | `boolean` | ✅ | Supports array field types | +| **vectorSearch** | `boolean` | optional | Supports vector embeddings and similarity search | +| **geoSpatial** | `boolean` | optional | Supports geospatial queries | diff --git a/content/docs/references/data/driver/DriverInterface.mdx b/content/docs/references/data/driver/DriverInterface.mdx new file mode 100644 index 000000000..b31b9a93c --- /dev/null +++ b/content/docs/references/data/driver/DriverInterface.mdx @@ -0,0 +1,12 @@ +--- +title: DriverInterface +description: DriverInterface Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | ✅ | Driver unique name | +| **version** | `string` | ✅ | Driver version | +| **supports** | `object` | ✅ | | diff --git a/content/docs/references/data/driver/DriverOptions.mdx b/content/docs/references/data/driver/DriverOptions.mdx new file mode 100644 index 000000000..0f5926019 --- /dev/null +++ b/content/docs/references/data/driver/DriverOptions.mdx @@ -0,0 +1,14 @@ +--- +title: DriverOptions +description: DriverOptions Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **transaction** | `any` | optional | Transaction handle | +| **timeout** | `number` | optional | Timeout in ms | +| **skipCache** | `boolean` | optional | Bypass cache | +| **traceContext** | `Record` | optional | OpenTelemetry context or request ID | +| **tenantId** | `string` | optional | Tenant Isolation identifier | diff --git a/content/docs/references/system/driver/meta.json b/content/docs/references/data/driver/meta.json similarity index 100% rename from content/docs/references/system/driver/meta.json rename to content/docs/references/data/driver/meta.json diff --git a/content/docs/references/data/flow/Flow.mdx b/content/docs/references/data/flow/Flow.mdx index 2c9408bef..188f7ebe6 100644 --- a/content/docs/references/data/flow/Flow.mdx +++ b/content/docs/references/data/flow/Flow.mdx @@ -10,9 +10,12 @@ description: Flow Schema Reference | **name** | `string` | ✅ | Machine name | | **label** | `string` | ✅ | Flow label | | **description** | `string` | optional | | +| **version** | `integer` | optional | Version number | +| **status** | `Enum<'draft' \| 'active' \| 'obsolete' \| 'invalid'>` | optional | Deployment status | +| **template** | `boolean` | optional | Is logic template (Subflow) | | **type** | `Enum<'autolaunched' \| 'record_change' \| 'schedule' \| 'screen' \| 'api'>` | ✅ | Flow type | | **variables** | `object[]` | optional | Flow variables | | **nodes** | `object[]` | ✅ | Flow nodes | | **edges** | `object[]` | ✅ | Flow connections | -| **active** | `boolean` | optional | Is active | +| **active** | `boolean` | optional | Is active (Deprecated: use status) | | **runAs** | `Enum<'system' \| 'user'>` | optional | Execution context | diff --git a/content/docs/references/data/flow/FlowEdge.mdx b/content/docs/references/data/flow/FlowEdge.mdx index da89fa976..5a3fe6e0c 100644 --- a/content/docs/references/data/flow/FlowEdge.mdx +++ b/content/docs/references/data/flow/FlowEdge.mdx @@ -11,4 +11,5 @@ description: FlowEdge Schema Reference | **source** | `string` | ✅ | Source Node ID | | **target** | `string` | ✅ | Target Node ID | | **condition** | `string` | optional | Expression returning boolean used for branching | +| **type** | `Enum<'default' \| 'fault'>` | optional | Connection type: Standard (Success) or Fault (Error) path | | **label** | `string` | optional | Label on the connector | diff --git a/content/docs/references/data/meta.json b/content/docs/references/data/meta.json index a29ba933c..6ea6daa10 100644 --- a/content/docs/references/data/meta.json +++ b/content/docs/references/data/meta.json @@ -3,6 +3,8 @@ "root": true, "pages": [ "dataset", + "datasource", + "driver", "field", "filter", "flow", diff --git a/content/docs/references/data/object/Index.mdx b/content/docs/references/data/object/Index.mdx index 43b421f27..e8059bb62 100644 --- a/content/docs/references/data/object/Index.mdx +++ b/content/docs/references/data/object/Index.mdx @@ -10,3 +10,4 @@ description: Index Schema Reference | **name** | `string` | optional | Index name | | **fields** | `string[]` | ✅ | Fields included in the index | | **unique** | `boolean` | optional | Whether the index is unique | +| **type** | `Enum<'btree' \| 'hash' \| 'gin' \| 'gist'>` | optional | Index type (default: btree) | diff --git a/content/docs/references/data/object/Object.mdx b/content/docs/references/data/object/Object.mdx index 0720887ee..d9aca8c56 100644 --- a/content/docs/references/data/object/Object.mdx +++ b/content/docs/references/data/object/Object.mdx @@ -7,15 +7,21 @@ description: Object Schema Reference | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **name** | `string` | ✅ | Machine name (snake_case) | -| **label** | `string` | optional | Singular Label (e.g. "Account") | -| **pluralLabel** | `string` | optional | Plural Label (e.g. "Accounts") | -| **description** | `string` | optional | Internal description | -| **icon** | `string` | optional | Lucide icon name | -| **datasource** | `string` | optional | Target Datasource ID (e.g. "postgres", "salesforce"). references sys_datasource. | +| **name** | `string` | ✅ | Machine unique key (snake_case). Immutable. | +| **label** | `string` | optional | Human readable singular label (e.g. "Account") | +| **pluralLabel** | `string` | optional | Human readable plural label (e.g. "Accounts") | +| **description** | `string` | optional | Developer documentation / description | +| **icon** | `string` | optional | Icon name (Lucide/Material) for UI representation | +| **tags** | `string[]` | optional | Categorization tags (e.g. "sales", "system", "reference") | +| **active** | `boolean` | optional | Is the object active and usable | +| **isSystem** | `boolean` | optional | Is system object (protected from deletion) | +| **abstract** | `boolean` | optional | Is abstract base object (cannot be instantiated) | +| **datasource** | `string` | optional | Target Datasource ID. "default" is the primary DB. | | **tableName** | `string` | optional | Physical table/collection name in the target datasource | -| **isSystem** | `boolean` | optional | Is system object (protected) | -| **fields** | `Record` | ✅ | Map of field definitions | -| **indexes** | `object[]` | optional | Database indexes definition | -| **nameField** | `string` | optional | Which field represents the record name/title (usually "name") | -| **enable** | `object` | optional | Enabled system capabilities | +| **fields** | `Record` | ✅ | Field definitions map | +| **indexes** | `object[]` | optional | Database performance indexes | +| **validations** | `object \| object \| object \| object \| object \| object \| object \| object \| object[]` | optional | Object-level validation rules | +| **titleFormat** | `string` | optional | Title expression (e.g. "`{name}` - `{code}`"). Overrides nameField. | +| **compactLayout** | `string[]` | optional | Primary fields for hover/cards/lookups | +| **search** | `object` | optional | Search engine configuration | +| **enable** | `object` | optional | Enabled system features modules | diff --git a/content/docs/references/data/object/ObjectCapabilities.mdx b/content/docs/references/data/object/ObjectCapabilities.mdx index ca4075218..14d269fdc 100644 --- a/content/docs/references/data/object/ObjectCapabilities.mdx +++ b/content/docs/references/data/object/ObjectCapabilities.mdx @@ -7,10 +7,13 @@ description: ObjectCapabilities Schema Reference | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **trackHistory** | `boolean` | optional | | -| **searchable** | `boolean` | optional | | -| **apiEnabled** | `boolean` | optional | | -| **apiMethods** | `Enum<'get' \| 'list' \| 'create' \| 'update' \| 'delete' \| 'upsert' \| 'bulkCreate' \| 'bulkUpdate' \| 'bulkDelete' \| 'bulkUpsert' \| 'aggregate' \| 'history' \| 'search' \| 'restore' \| 'purge' \| 'import' \| 'export'>[]` | optional | Allowed API operations | -| **files** | `boolean` | optional | | -| **feedEnabled** | `boolean` | optional | | -| **trash** | `boolean` | optional | | +| **trackHistory** | `boolean` | optional | Enable field history tracking for audit compliance | +| **searchable** | `boolean` | optional | Index records for global search | +| **apiEnabled** | `boolean` | optional | Expose object via automatic APIs | +| **apiMethods** | `Enum<'get' \| 'list' \| 'create' \| 'update' \| 'delete' \| 'upsert' \| 'bulk' \| 'aggregate' \| 'history' \| 'search' \| 'restore' \| 'purge' \| 'import' \| 'export'>[]` | optional | Whitelist of allowed API operations | +| **files** | `boolean` | optional | Enable file attachments and document management | +| **feeds** | `boolean` | optional | Enable social feed, comments, and mentions (Chatter-like) | +| **activities** | `boolean` | optional | Enable standard tasks and events tracking | +| **trash** | `boolean` | optional | Enable soft-delete with restore capability | +| **mru** | `boolean` | optional | Track Most Recently Used (MRU) list for users | +| **clone** | `boolean` | optional | Allow record deep cloning | diff --git a/content/docs/references/data/object/SearchConfig.mdx b/content/docs/references/data/object/SearchConfig.mdx new file mode 100644 index 000000000..fa44545ea --- /dev/null +++ b/content/docs/references/data/object/SearchConfig.mdx @@ -0,0 +1,12 @@ +--- +title: SearchConfig +description: SearchConfig Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **fields** | `string[]` | ✅ | Fields to index for full-text search weighting | +| **displayFields** | `string[]` | optional | Fields to display in search result cards | +| **filters** | `string[]` | optional | Default filters for search results | diff --git a/content/docs/references/data/permission/ObjectPermission.mdx b/content/docs/references/data/permission/ObjectPermission.mdx index 63a0de210..67c734862 100644 --- a/content/docs/references/data/permission/ObjectPermission.mdx +++ b/content/docs/references/data/permission/ObjectPermission.mdx @@ -11,5 +11,8 @@ description: ObjectPermission Schema Reference | **allowRead** | `boolean` | optional | Read permission | | **allowEdit** | `boolean` | optional | Edit permission | | **allowDelete** | `boolean` | optional | Delete permission | +| **allowTransfer** | `boolean` | optional | Change record ownership | +| **allowRestore** | `boolean` | optional | Restore from trash (Undelete) | +| **allowPurge** | `boolean` | optional | Permanently delete (Hard Delete/GDPR) | | **viewAllRecords** | `boolean` | optional | View All Data (Bypass Sharing) | | **modifyAllRecords** | `boolean` | optional | Modify All Data (Bypass Sharing) | diff --git a/content/docs/references/data/query/JoinNode.mdx b/content/docs/references/data/query/JoinNode.mdx index 1ee6c2d84..f3fa60f56 100644 --- a/content/docs/references/data/query/JoinNode.mdx +++ b/content/docs/references/data/query/JoinNode.mdx @@ -10,5 +10,5 @@ description: JoinNode Schema Reference | **type** | `Enum<'inner' \| 'left' \| 'right' \| 'full'>` | ✅ | Join type | | **object** | `string` | ✅ | Object/table to join | | **alias** | `string` | optional | Table alias | -| **on** | `any[] \| string \| any[] \| string \| any[][]` | ✅ | Join condition | +| **on** | `any` | ✅ | Join condition | | **subquery** | `object` | optional | Subquery instead of object | diff --git a/content/docs/references/data/query/Query.mdx b/content/docs/references/data/query/Query.mdx index 30a8eb3f7..1d809d213 100644 --- a/content/docs/references/data/query/Query.mdx +++ b/content/docs/references/data/query/Query.mdx @@ -9,13 +9,14 @@ description: Query Schema Reference | :--- | :--- | :--- | :--- | | **object** | `string` | ✅ | Object name (e.g. account) | | **fields** | `string \| object[]` | optional | Fields to retrieve | -| **aggregations** | `object[]` | optional | Aggregation functions (GROUP BY) | -| **windowFunctions** | `object[]` | optional | Window functions with OVER clause | -| **filters** | `any[] \| string \| any[]` | optional | Filtering criteria | -| **joins** | `object[]` | optional | Table joins | +| **where** | `any` | optional | Filtering criteria (WHERE) | +| **orderBy** | `object[]` | optional | Sorting instructions (ORDER BY) | +| **limit** | `number` | optional | Max records to return (LIMIT) | +| **offset** | `number` | optional | Records to skip (OFFSET) | +| **cursor** | `Record` | optional | Cursor for keyset pagination | +| **joins** | `object[]` | optional | Explicit Table Joins | +| **aggregations** | `object[]` | optional | Aggregation functions | | **groupBy** | `string[]` | optional | GROUP BY fields | -| **having** | `any[] \| string \| any[]` | optional | HAVING clause for aggregation filtering | -| **sort** | `object[]` | optional | Sorting instructions | -| **top** | `number` | optional | Limit results | -| **skip** | `number` | optional | Offset results | +| **having** | `any` | optional | HAVING clause for aggregation filtering | +| **windowFunctions** | `object[]` | optional | Window functions with OVER clause | | **distinct** | `boolean` | optional | SELECT DISTINCT flag | diff --git a/content/docs/references/data/sharing/CriteriaSharingRule.mdx b/content/docs/references/data/sharing/CriteriaSharingRule.mdx new file mode 100644 index 000000000..a4374d8e9 --- /dev/null +++ b/content/docs/references/data/sharing/CriteriaSharingRule.mdx @@ -0,0 +1,18 @@ +--- +title: CriteriaSharingRule +description: CriteriaSharingRule Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | ✅ | Unique rule name (snake_case) | +| **label** | `string` | optional | Human-readable label | +| **description** | `string` | optional | Administrative notes | +| **object** | `string` | ✅ | Target Object Name | +| **active** | `boolean` | optional | | +| **accessLevel** | `Enum<'read' \| 'edit' \| 'full'>` | optional | | +| **sharedWith** | `object` | ✅ | The recipient of the shared access | +| **type** | `string` | ✅ | | +| **condition** | `string` | ✅ | Formula condition (e.g. "department = 'Sales'") | diff --git a/content/docs/references/data/sharing/OWDModel.mdx b/content/docs/references/data/sharing/OWDModel.mdx index 8db1306f6..a6b676c1c 100644 --- a/content/docs/references/data/sharing/OWDModel.mdx +++ b/content/docs/references/data/sharing/OWDModel.mdx @@ -7,4 +7,5 @@ description: OWDModel Schema Reference * `private` * `public_read` -* `public_read_write` \ No newline at end of file +* `public_read_write` +* `controlled_by_parent` \ No newline at end of file diff --git a/content/docs/references/data/sharing/OwnerSharingRule.mdx b/content/docs/references/data/sharing/OwnerSharingRule.mdx new file mode 100644 index 000000000..dd3b69b98 --- /dev/null +++ b/content/docs/references/data/sharing/OwnerSharingRule.mdx @@ -0,0 +1,18 @@ +--- +title: OwnerSharingRule +description: OwnerSharingRule Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | ✅ | Unique rule name (snake_case) | +| **label** | `string` | optional | Human-readable label | +| **description** | `string` | optional | Administrative notes | +| **object** | `string` | ✅ | Target Object Name | +| **active** | `boolean` | optional | | +| **accessLevel** | `Enum<'read' \| 'edit' \| 'full'>` | optional | | +| **sharedWith** | `object` | ✅ | The recipient of the shared access | +| **type** | `string` | ✅ | | +| **ownedBy** | `object` | ✅ | Source group/role whose records are being shared | diff --git a/content/docs/references/data/sharing/ShareRecipientType.mdx b/content/docs/references/data/sharing/ShareRecipientType.mdx new file mode 100644 index 000000000..3790701ce --- /dev/null +++ b/content/docs/references/data/sharing/ShareRecipientType.mdx @@ -0,0 +1,12 @@ +--- +title: ShareRecipientType +description: ShareRecipientType Schema Reference +--- + +## Allowed Values + +* `user` +* `group` +* `role` +* `role_and_subordinates` +* `guest` \ No newline at end of file diff --git a/content/docs/references/data/sharing/SharingLevel.mdx b/content/docs/references/data/sharing/SharingLevel.mdx index 7acb9c893..1b013707b 100644 --- a/content/docs/references/data/sharing/SharingLevel.mdx +++ b/content/docs/references/data/sharing/SharingLevel.mdx @@ -6,4 +6,5 @@ description: SharingLevel Schema Reference ## Allowed Values * `read` -* `edit` \ No newline at end of file +* `edit` +* `full` \ No newline at end of file diff --git a/content/docs/references/data/sharing/SharingRule.mdx b/content/docs/references/data/sharing/SharingRule.mdx index f39e4d9b9..f0223b515 100644 --- a/content/docs/references/data/sharing/SharingRule.mdx +++ b/content/docs/references/data/sharing/SharingRule.mdx @@ -3,15 +3,3 @@ title: SharingRule description: SharingRule Schema Reference --- -## Properties - -| Property | Type | Required | Description | -| :--- | :--- | :--- | :--- | -| **name** | `string` | ✅ | Unique rule name | -| **label** | `string` | optional | | -| **active** | `boolean` | optional | | -| **object** | `string` | ✅ | Object to share | -| **type** | `Enum<'owner' \| 'criteria' \| 'manual' \| 'guest'>` | optional | | -| **criteria** | `string` | optional | | -| **accessLevel** | `Enum<'read' \| 'edit'>` | optional | | -| **sharedWith** | `string` | ✅ | Group/Role ID to share records with | diff --git a/content/docs/references/data/sharing/SharingRuleType.mdx b/content/docs/references/data/sharing/SharingRuleType.mdx index 1c8fa210e..df297b610 100644 --- a/content/docs/references/data/sharing/SharingRuleType.mdx +++ b/content/docs/references/data/sharing/SharingRuleType.mdx @@ -6,6 +6,4 @@ description: SharingRuleType Schema Reference ## Allowed Values * `owner` -* `criteria` -* `manual` -* `guest` \ No newline at end of file +* `criteria` \ No newline at end of file diff --git a/content/docs/references/data/validation/AsyncValidation.mdx b/content/docs/references/data/validation/AsyncValidation.mdx index 7d2c35c66..4073d952b 100644 --- a/content/docs/references/data/validation/AsyncValidation.mdx +++ b/content/docs/references/data/validation/AsyncValidation.mdx @@ -7,13 +7,19 @@ description: AsyncValidation Schema Reference | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **name** | `string` | ✅ | Unique rule name | +| **name** | `string` | ✅ | Unique rule name (snake_case) | +| **label** | `string` | optional | Human-readable label for the rule listing | +| **description** | `string` | optional | Administrative notes explaining the business reason | | **active** | `boolean` | optional | | +| **events** | `Enum<'insert' \| 'update' \| 'delete'>[]` | optional | Trigger contexts | +| **tags** | `string[]` | optional | Categorization tags (e.g., "compliance", "billing") | | **severity** | `Enum<'error' \| 'warning' \| 'info'>` | optional | | -| **message** | `string` | ✅ | Error message to display | +| **message** | `string` | ✅ | Error message to display to the user | | **type** | `string` | ✅ | | | **field** | `string` | ✅ | Field to validate | | **validatorUrl** | `string` | optional | External API endpoint for validation | +| **method** | `Enum<'GET' \| 'POST'>` | optional | HTTP method for external call | +| **headers** | `Record` | optional | Custom headers for the request | | **validatorFunction** | `string` | optional | Reference to custom validator function | | **timeout** | `number` | optional | Timeout in milliseconds | | **debounce** | `number` | optional | Debounce delay in milliseconds | diff --git a/content/docs/references/data/validation/ConditionalValidation.mdx b/content/docs/references/data/validation/ConditionalValidation.mdx index 5fd1f3e45..7e20a8be5 100644 --- a/content/docs/references/data/validation/ConditionalValidation.mdx +++ b/content/docs/references/data/validation/ConditionalValidation.mdx @@ -7,11 +7,15 @@ description: ConditionalValidation Schema Reference | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **name** | `string` | ✅ | Unique rule name | +| **name** | `string` | ✅ | Unique rule name (snake_case) | +| **label** | `string` | optional | Human-readable label for the rule listing | +| **description** | `string` | optional | Administrative notes explaining the business reason | | **active** | `boolean` | optional | | +| **events** | `Enum<'insert' \| 'update' \| 'delete'>[]` | optional | Trigger contexts | +| **tags** | `string[]` | optional | Categorization tags (e.g., "compliance", "billing") | | **severity** | `Enum<'error' \| 'warning' \| 'info'>` | optional | | -| **message** | `string` | ✅ | Error message to display | +| **message** | `string` | ✅ | Error message to display to the user | | **type** | `string` | ✅ | | | **when** | `string` | ✅ | Condition formula (e.g. "type = 'enterprise'") | -| **then** | `object \| object \| object \| object \| object \| object \| object \| any` | ✅ | Validation rule to apply when condition is true | -| **otherwise** | `object \| object \| object \| object \| object \| object \| object \| any` | optional | Validation rule to apply when condition is false | +| **then** | `object \| object \| object \| object \| object \| object \| object \| object \| any` | ✅ | Validation rule to apply when condition is true | +| **otherwise** | `object \| object \| object \| object \| object \| object \| object \| object \| any` | optional | Validation rule to apply when condition is false | diff --git a/content/docs/references/data/validation/CrossFieldValidation.mdx b/content/docs/references/data/validation/CrossFieldValidation.mdx index 93c626a52..d7559dc88 100644 --- a/content/docs/references/data/validation/CrossFieldValidation.mdx +++ b/content/docs/references/data/validation/CrossFieldValidation.mdx @@ -7,10 +7,14 @@ description: CrossFieldValidation Schema Reference | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **name** | `string` | ✅ | Unique rule name | +| **name** | `string` | ✅ | Unique rule name (snake_case) | +| **label** | `string` | optional | Human-readable label for the rule listing | +| **description** | `string` | optional | Administrative notes explaining the business reason | | **active** | `boolean` | optional | | +| **events** | `Enum<'insert' \| 'update' \| 'delete'>[]` | optional | Trigger contexts | +| **tags** | `string[]` | optional | Categorization tags (e.g., "compliance", "billing") | | **severity** | `Enum<'error' \| 'warning' \| 'info'>` | optional | | -| **message** | `string` | ✅ | Error message to display | +| **message** | `string` | ✅ | Error message to display to the user | | **type** | `string` | ✅ | | | **condition** | `string` | ✅ | Formula expression comparing fields (e.g. "end_date > start_date") | | **fields** | `string[]` | ✅ | Fields involved in the validation | diff --git a/content/docs/references/data/validation/CustomValidator.mdx b/content/docs/references/data/validation/CustomValidator.mdx index fea294cff..f8fbafc86 100644 --- a/content/docs/references/data/validation/CustomValidator.mdx +++ b/content/docs/references/data/validation/CustomValidator.mdx @@ -7,11 +7,15 @@ description: CustomValidator Schema Reference | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **name** | `string` | ✅ | Unique rule name | +| **name** | `string` | ✅ | Unique rule name (snake_case) | +| **label** | `string` | optional | Human-readable label for the rule listing | +| **description** | `string` | optional | Administrative notes explaining the business reason | | **active** | `boolean` | optional | | +| **events** | `Enum<'insert' \| 'update' \| 'delete'>[]` | optional | Trigger contexts | +| **tags** | `string[]` | optional | Categorization tags (e.g., "compliance", "billing") | | **severity** | `Enum<'error' \| 'warning' \| 'info'>` | optional | | -| **message** | `string` | ✅ | Error message to display | +| **message** | `string` | ✅ | Error message to display to the user | | **type** | `string` | ✅ | | -| **field** | `string` | optional | Field to validate (optional for record-level validation) | -| **validatorFunction** | `string` | ✅ | Function name or reference to custom validator | -| **params** | `Record` | optional | Additional parameters for the validator | +| **field** | `string` | ✅ | Field to validate | +| **validatorFunction** | `string` | ✅ | Reference to custom validator function | +| **params** | `Record` | optional | Additional parameters to pass to validator | diff --git a/content/docs/references/data/validation/FormatValidation.mdx b/content/docs/references/data/validation/FormatValidation.mdx index 77e57c49c..f2a070028 100644 --- a/content/docs/references/data/validation/FormatValidation.mdx +++ b/content/docs/references/data/validation/FormatValidation.mdx @@ -7,10 +7,14 @@ description: FormatValidation Schema Reference | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **name** | `string` | ✅ | Unique rule name | +| **name** | `string` | ✅ | Unique rule name (snake_case) | +| **label** | `string` | optional | Human-readable label for the rule listing | +| **description** | `string` | optional | Administrative notes explaining the business reason | | **active** | `boolean` | optional | | +| **events** | `Enum<'insert' \| 'update' \| 'delete'>[]` | optional | Trigger contexts | +| **tags** | `string[]` | optional | Categorization tags (e.g., "compliance", "billing") | | **severity** | `Enum<'error' \| 'warning' \| 'info'>` | optional | | -| **message** | `string` | ✅ | Error message to display | +| **message** | `string` | ✅ | Error message to display to the user | | **type** | `string` | ✅ | | | **field** | `string` | ✅ | | | **regex** | `string` | optional | | diff --git a/content/docs/references/data/validation/JSONValidation.mdx b/content/docs/references/data/validation/JSONValidation.mdx new file mode 100644 index 000000000..c68543962 --- /dev/null +++ b/content/docs/references/data/validation/JSONValidation.mdx @@ -0,0 +1,20 @@ +--- +title: JSONValidation +description: JSONValidation Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | ✅ | Unique rule name (snake_case) | +| **label** | `string` | optional | Human-readable label for the rule listing | +| **description** | `string` | optional | Administrative notes explaining the business reason | +| **active** | `boolean` | optional | | +| **events** | `Enum<'insert' \| 'update' \| 'delete'>[]` | optional | Trigger contexts | +| **tags** | `string[]` | optional | Categorization tags (e.g., "compliance", "billing") | +| **severity** | `Enum<'error' \| 'warning' \| 'info'>` | optional | | +| **message** | `string` | ✅ | Error message to display to the user | +| **type** | `string` | ✅ | | +| **field** | `string` | ✅ | JSON field to validate | +| **schema** | `Record` | ✅ | JSON Schema object definition | diff --git a/content/docs/references/data/validation/ScriptValidation.mdx b/content/docs/references/data/validation/ScriptValidation.mdx index f9ecdeff2..b5ecc62c5 100644 --- a/content/docs/references/data/validation/ScriptValidation.mdx +++ b/content/docs/references/data/validation/ScriptValidation.mdx @@ -7,9 +7,13 @@ description: ScriptValidation Schema Reference | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **name** | `string` | ✅ | Unique rule name | +| **name** | `string` | ✅ | Unique rule name (snake_case) | +| **label** | `string` | optional | Human-readable label for the rule listing | +| **description** | `string` | optional | Administrative notes explaining the business reason | | **active** | `boolean` | optional | | +| **events** | `Enum<'insert' \| 'update' \| 'delete'>[]` | optional | Trigger contexts | +| **tags** | `string[]` | optional | Categorization tags (e.g., "compliance", "billing") | | **severity** | `Enum<'error' \| 'warning' \| 'info'>` | optional | | -| **message** | `string` | ✅ | Error message to display | +| **message** | `string` | ✅ | Error message to display to the user | | **type** | `string` | ✅ | | | **condition** | `string` | ✅ | Formula expression. If TRUE, validation fails. (e.g. amount < 0) | diff --git a/content/docs/references/data/validation/StateMachineValidation.mdx b/content/docs/references/data/validation/StateMachineValidation.mdx index d8f640ce6..b3ad80bd3 100644 --- a/content/docs/references/data/validation/StateMachineValidation.mdx +++ b/content/docs/references/data/validation/StateMachineValidation.mdx @@ -7,10 +7,14 @@ description: StateMachineValidation Schema Reference | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **name** | `string` | ✅ | Unique rule name | +| **name** | `string` | ✅ | Unique rule name (snake_case) | +| **label** | `string` | optional | Human-readable label for the rule listing | +| **description** | `string` | optional | Administrative notes explaining the business reason | | **active** | `boolean` | optional | | +| **events** | `Enum<'insert' \| 'update' \| 'delete'>[]` | optional | Trigger contexts | +| **tags** | `string[]` | optional | Categorization tags (e.g., "compliance", "billing") | | **severity** | `Enum<'error' \| 'warning' \| 'info'>` | optional | | -| **message** | `string` | ✅ | Error message to display | +| **message** | `string` | ✅ | Error message to display to the user | | **type** | `string` | ✅ | | | **field** | `string` | ✅ | State field (e.g. status) | | **transitions** | `Record` | ✅ | Map of `{ OldState: [AllowedNewStates] }` | diff --git a/content/docs/references/data/validation/UniquenessValidation.mdx b/content/docs/references/data/validation/UniquenessValidation.mdx index 965f7de8e..67a01898b 100644 --- a/content/docs/references/data/validation/UniquenessValidation.mdx +++ b/content/docs/references/data/validation/UniquenessValidation.mdx @@ -7,10 +7,14 @@ description: UniquenessValidation Schema Reference | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **name** | `string` | ✅ | Unique rule name | +| **name** | `string` | ✅ | Unique rule name (snake_case) | +| **label** | `string` | optional | Human-readable label for the rule listing | +| **description** | `string` | optional | Administrative notes explaining the business reason | | **active** | `boolean` | optional | | +| **events** | `Enum<'insert' \| 'update' \| 'delete'>[]` | optional | Trigger contexts | +| **tags** | `string[]` | optional | Categorization tags (e.g., "compliance", "billing") | | **severity** | `Enum<'error' \| 'warning' \| 'info'>` | optional | | -| **message** | `string` | ✅ | Error message to display | +| **message** | `string` | ✅ | Error message to display to the user | | **type** | `string` | ✅ | | | **fields** | `string[]` | ✅ | Fields that must be combined unique | | **scope** | `string` | optional | Formula condition for scope (e.g. active = true) | diff --git a/content/docs/references/data/workflow/TimeTrigger.mdx b/content/docs/references/data/workflow/TimeTrigger.mdx new file mode 100644 index 000000000..c7f4677aa --- /dev/null +++ b/content/docs/references/data/workflow/TimeTrigger.mdx @@ -0,0 +1,16 @@ +--- +title: TimeTrigger +description: TimeTrigger Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **id** | `string` | optional | Unique identifier | +| **timeLength** | `integer` | ✅ | Duration amount (e.g. 1, 30) | +| **timeUnit** | `Enum<'minutes' \| 'hours' \| 'days'>` | ✅ | Unit of time | +| **offsetDirection** | `Enum<'before' \| 'after'>` | ✅ | Before or After the reference date | +| **offsetFrom** | `Enum<'trigger_date' \| 'date_field'>` | ✅ | Basis for calculation | +| **dateField** | `string` | optional | Date field to calculate from (required if offsetFrom is date_field) | +| **actions** | `object \| object \| object \| object \| object \| object \| object \| object \| object \| object[]` | ✅ | Actions to execute at the scheduled time | diff --git a/content/docs/references/data/workflow/WorkflowRule.mdx b/content/docs/references/data/workflow/WorkflowRule.mdx index ed68b9892..ad3e32e1b 100644 --- a/content/docs/references/data/workflow/WorkflowRule.mdx +++ b/content/docs/references/data/workflow/WorkflowRule.mdx @@ -12,4 +12,6 @@ description: WorkflowRule Schema Reference | **triggerType** | `Enum<'on_create' \| 'on_update' \| 'on_create_or_update' \| 'on_delete' \| 'schedule'>` | ✅ | When to evaluate | | **criteria** | `string` | optional | Formula condition. If TRUE, actions execute. | | **actions** | `object \| object \| object \| object \| object \| object \| object \| object \| object \| object[]` | optional | Immediate actions | +| **timeTriggers** | `object[]` | optional | Scheduled actions relative to trigger or date field | | **active** | `boolean` | optional | Whether this workflow is active | +| **reevaluateOnChange** | `boolean` | optional | Re-evaluate rule if field updates change the record validity | diff --git a/content/docs/references/system/api/meta.json b/content/docs/references/system/api/meta.json deleted file mode 100644 index 01cf23093..000000000 --- a/content/docs/references/system/api/meta.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "title": "Api" -} \ No newline at end of file diff --git a/content/docs/references/system/endpoint/ApiEndpoint.mdx b/content/docs/references/system/endpoint/ApiEndpoint.mdx new file mode 100644 index 000000000..20a584608 --- /dev/null +++ b/content/docs/references/system/endpoint/ApiEndpoint.mdx @@ -0,0 +1,22 @@ +--- +title: ApiEndpoint +description: ApiEndpoint Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | ✅ | Unique endpoint ID | +| **path** | `string` | ✅ | URL Path (e.g. /api/v1/customers) | +| **method** | `Enum<'GET' \| 'POST' \| 'PUT' \| 'DELETE' \| 'PATCH'>` | ✅ | HTTP Method | +| **summary** | `string` | optional | | +| **description** | `string` | optional | | +| **type** | `Enum<'flow' \| 'script' \| 'object_operation' \| 'proxy'>` | ✅ | Implementation type | +| **target** | `string` | ✅ | Target Flow ID, Script Name, or Proxy URL | +| **objectParams** | `object` | optional | For object_operation type | +| **inputMapping** | `object[]` | optional | Map Request Body to Internal Params | +| **outputMapping** | `object[]` | optional | Map Internal Result to Response Body | +| **authRequired** | `boolean` | optional | Require authentication | +| **rateLimit** | `object` | optional | Rate limiting policy | +| **cacheTtl** | `number` | optional | Response cache TTL in seconds | diff --git a/content/docs/references/system/endpoint/ApiMapping.mdx b/content/docs/references/system/endpoint/ApiMapping.mdx new file mode 100644 index 000000000..d3ebafe16 --- /dev/null +++ b/content/docs/references/system/endpoint/ApiMapping.mdx @@ -0,0 +1,12 @@ +--- +title: ApiMapping +description: ApiMapping Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **source** | `string` | ✅ | Source field/path | +| **target** | `string` | ✅ | Target field/path | +| **transform** | `string` | optional | Transformation function name | diff --git a/content/docs/references/system/endpoint/RateLimit.mdx b/content/docs/references/system/endpoint/RateLimit.mdx new file mode 100644 index 000000000..84ebaf8fd --- /dev/null +++ b/content/docs/references/system/endpoint/RateLimit.mdx @@ -0,0 +1,12 @@ +--- +title: RateLimit +description: RateLimit Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **enabled** | `boolean` | optional | | +| **windowMs** | `number` | optional | Time window in milliseconds | +| **maxRequests** | `number` | optional | Max requests per window | diff --git a/content/docs/references/system/meta.json b/content/docs/references/system/meta.json index 660a69097..9fbcb1e62 100644 --- a/content/docs/references/system/meta.json +++ b/content/docs/references/system/meta.json @@ -2,12 +2,8 @@ "title": "System Protocol", "root": true, "pages": [ - "api", "audit", "auth", - "datasource", - "discovery", - "driver", "events", "identity", "job", @@ -16,7 +12,6 @@ "organization", "plugin", "policy", - "realtime", "role", "tenant", "territory", diff --git a/content/docs/references/system/view/HttpMethod.mdx b/content/docs/references/system/view/HttpMethod.mdx new file mode 100644 index 000000000..71103ce5a --- /dev/null +++ b/content/docs/references/system/view/HttpMethod.mdx @@ -0,0 +1,12 @@ +--- +title: HttpMethod +description: HttpMethod Schema Reference +--- + +## Allowed Values + +* `GET` +* `POST` +* `PUT` +* `DELETE` +* `PATCH` \ No newline at end of file diff --git a/content/docs/references/ui/api/HttpMethod.mdx b/content/docs/references/ui/view/HttpMethod.mdx similarity index 100% rename from content/docs/references/ui/api/HttpMethod.mdx rename to content/docs/references/ui/view/HttpMethod.mdx diff --git a/examples/ai-analyst/CHANGELOG.md b/examples/ai-analyst/CHANGELOG.md index 1049e03ca..e2546d774 100644 --- a/examples/ai-analyst/CHANGELOG.md +++ b/examples/ai-analyst/CHANGELOG.md @@ -1,5 +1,12 @@ # @objectstack/example-ai-analyst +## 1.0.5 + +### Patch Changes + +- Updated dependencies + - @objectstack/spec@0.3.3 + ## 1.0.4 ### Patch Changes diff --git a/examples/ai-analyst/package.json b/examples/ai-analyst/package.json index 994e463cd..5a3c0ed8e 100644 --- a/examples/ai-analyst/package.json +++ b/examples/ai-analyst/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/example-ai-analyst", - "version": "1.0.4", + "version": "1.0.5", "description": "AI-powered data analyst with natural language query capabilities", "private": true, "main": "objectstack.config.ts", diff --git a/examples/ai-codegen/CHANGELOG.md b/examples/ai-codegen/CHANGELOG.md index b138a651b..02efbdef7 100644 --- a/examples/ai-codegen/CHANGELOG.md +++ b/examples/ai-codegen/CHANGELOG.md @@ -1,5 +1,12 @@ # @objectstack/example-ai-codegen +## 1.0.5 + +### Patch Changes + +- Updated dependencies + - @objectstack/spec@0.3.3 + ## 1.0.4 ### Patch Changes diff --git a/examples/ai-codegen/package.json b/examples/ai-codegen/package.json index 8469816dd..03a986605 100644 --- a/examples/ai-codegen/package.json +++ b/examples/ai-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/example-ai-codegen", - "version": "1.0.4", + "version": "1.0.5", "description": "AI code generator - Generate ObjectStack apps from natural language", "private": true, "main": "objectstack.config.ts", diff --git a/examples/ai-sales/CHANGELOG.md b/examples/ai-sales/CHANGELOG.md index d8aa7d261..e158b0ed9 100644 --- a/examples/ai-sales/CHANGELOG.md +++ b/examples/ai-sales/CHANGELOG.md @@ -1,5 +1,12 @@ # @objectstack/example-ai-sales +## 1.0.5 + +### Patch Changes + +- Updated dependencies + - @objectstack/spec@0.3.3 + ## 1.0.4 ### Patch Changes diff --git a/examples/ai-sales/package.json b/examples/ai-sales/package.json index 992b3b044..22b21960e 100644 --- a/examples/ai-sales/package.json +++ b/examples/ai-sales/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/example-ai-sales", - "version": "1.0.4", + "version": "1.0.5", "description": "AI-powered sales assistant with intelligent automation", "private": true, "main": "objectstack.config.ts", diff --git a/examples/ai-support/CHANGELOG.md b/examples/ai-support/CHANGELOG.md index ea7a9f193..e0ec887b9 100644 --- a/examples/ai-support/CHANGELOG.md +++ b/examples/ai-support/CHANGELOG.md @@ -1,5 +1,12 @@ # @objectstack/example-ai-support +## 1.0.5 + +### Patch Changes + +- Updated dependencies + - @objectstack/spec@0.3.3 + ## 1.0.4 ### Patch Changes diff --git a/examples/ai-support/package.json b/examples/ai-support/package.json index f0abeefc5..a56a86161 100644 --- a/examples/ai-support/package.json +++ b/examples/ai-support/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/example-ai-support", - "version": "1.0.4", + "version": "1.0.5", "description": "AI-powered customer support system with RAG knowledge base", "private": true, "main": "objectstack.config.ts", diff --git a/examples/crm/CHANGELOG.md b/examples/crm/CHANGELOG.md index db4ce0500..5ae620a87 100644 --- a/examples/crm/CHANGELOG.md +++ b/examples/crm/CHANGELOG.md @@ -1,5 +1,12 @@ # @objectstack/example-crm +## 1.0.7 + +### Patch Changes + +- Updated dependencies + - @objectstack/spec@0.3.3 + ## 1.0.6 ### Patch Changes diff --git a/examples/crm/package.json b/examples/crm/package.json index 428fa3e73..81dac6576 100644 --- a/examples/crm/package.json +++ b/examples/crm/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/example-crm", - "version": "1.0.6", + "version": "1.0.7", "description": "Example CRM implementation using ObjectStack Protocol", "private": true, "scripts": { diff --git a/examples/crm/src/server/apis.ts b/examples/crm/src/server/apis.ts index 2b8df33ec..745a1b1d2 100644 --- a/examples/crm/src/server/apis.ts +++ b/examples/crm/src/server/apis.ts @@ -1,4 +1,4 @@ -import { ApiEndpoint } from '@objectstack/spec/system'; +import { ApiEndpoint } from '@objectstack/spec/api'; /** * Custom API: Close Won Opportunities diff --git a/examples/host/CHANGELOG.md b/examples/host/CHANGELOG.md index c1f7ae8cf..286ebe071 100644 --- a/examples/host/CHANGELOG.md +++ b/examples/host/CHANGELOG.md @@ -1,5 +1,18 @@ # @objectstack/example-host +## 0.1.7 + +### Patch Changes + +- Updated dependencies + - @objectstack/objectql@0.3.3 + - @objectstack/runtime@0.3.3 + - @objectstack/driver-memory@0.3.3 + - @objectstack/plugin-hono-server@0.3.3 + - @objectstack/example-crm@1.0.7 + - @objectstack/plugin-bi@1.0.7 + - @objectstack/example-todo@1.0.7 + ## 0.1.6 ### Patch Changes diff --git a/examples/host/package.json b/examples/host/package.json index 509a4d98d..af9e0e996 100644 --- a/examples/host/package.json +++ b/examples/host/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/example-host", - "version": "0.1.6", + "version": "0.1.7", "private": true, "scripts": { "dev": "ts-node src/index.ts", diff --git a/examples/msw-demo/CHANGELOG.md b/examples/msw-demo/CHANGELOG.md index 1b118acec..ff7addfc7 100644 --- a/examples/msw-demo/CHANGELOG.md +++ b/examples/msw-demo/CHANGELOG.md @@ -1,5 +1,16 @@ # @objectstack/example-msw-demo +## 0.1.2 + +### Patch Changes + +- Updated dependencies + - @objectstack/objectql@0.3.3 + - @objectstack/runtime@0.3.3 + - @objectstack/driver-memory@0.3.3 + - @objectstack/plugin-msw@0.3.3 + - @objectstack/example-crm@1.0.7 + ## 0.1.1 ### Patch Changes diff --git a/examples/msw-demo/package.json b/examples/msw-demo/package.json index 6c3659da8..c7b7e2327 100644 --- a/examples/msw-demo/package.json +++ b/examples/msw-demo/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/example-msw-demo", - "version": "0.1.1", + "version": "0.1.2", "private": true, "description": "Example demonstrating MSW plugin usage with ObjectStack", "scripts": { diff --git a/examples/plugin-bi/CHANGELOG.md b/examples/plugin-bi/CHANGELOG.md index ab2f1f551..6b01662df 100644 --- a/examples/plugin-bi/CHANGELOG.md +++ b/examples/plugin-bi/CHANGELOG.md @@ -1,5 +1,12 @@ # @objectstack/plugin-bi +## 1.0.7 + +### Patch Changes + +- Updated dependencies + - @objectstack/spec@0.3.3 + ## 1.0.6 ### Patch Changes diff --git a/examples/plugin-bi/package.json b/examples/plugin-bi/package.json index 85dcb2f77..1727a3aff 100644 --- a/examples/plugin-bi/package.json +++ b/examples/plugin-bi/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/plugin-bi", - "version": "1.0.6", + "version": "1.0.7", "main": "src/index.ts", "license": "MIT", "private": true, diff --git a/examples/todo/CHANGELOG.md b/examples/todo/CHANGELOG.md index 00721116d..b6fb8375b 100644 --- a/examples/todo/CHANGELOG.md +++ b/examples/todo/CHANGELOG.md @@ -1,5 +1,13 @@ # @objectstack/example-todo +## 1.0.7 + +### Patch Changes + +- Updated dependencies + - @objectstack/spec@0.3.3 + - @objectstack/client@0.3.3 + ## 1.0.6 ### Patch Changes diff --git a/examples/todo/package.json b/examples/todo/package.json index a7bbd24b3..94634ec03 100644 --- a/examples/todo/package.json +++ b/examples/todo/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/example-todo", - "version": "1.0.6", + "version": "1.0.7", "description": "Example Todo App using ObjectStack Protocol", "private": true, "scripts": { diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index e4a37fcb1..9e7985119 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -1,5 +1,18 @@ # @objectstack/client +## 0.3.3 + +### Patch Changes + +- feat: Add ObjectAI implementation documentation + + - Added comprehensive AI agent and RAG pipeline implementation documentation + - Defined AI protocol specifications and standards + - Enhanced project documentation with AI-related guides + +- Updated dependencies + - @objectstack/spec@0.3.3 + ## 0.3.2 ### Patch Changes diff --git a/packages/client/package.json b/packages/client/package.json index 6052bc48e..116b72345 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/client", - "version": "0.3.2", + "version": "0.3.3", "description": "Official Client SDK for ObjectStack Protocol", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index 3c9bc170b..dc94df2d8 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -1,4 +1,4 @@ -import { QueryAST, FilterNode, SortNode, AggregationNode, WindowFunctionNode } from '@objectstack/spec/data'; +import { QueryAST, SortNode, AggregationNode, WindowFunctionNode } from '@objectstack/spec/data'; export interface ClientConfig { baseUrl: string; @@ -22,7 +22,7 @@ export interface DiscoveryResult { export interface QueryOptions { select?: string[]; // Simplified Selection - filters?: Record | FilterNode; // Map or AST + filters?: Record; // Filter map (will be converted to QueryAST filters) sort?: string | string[] | SortNode[]; // 'name' or ['-created_at'] or AST top?: number; skip?: number; diff --git a/packages/driver-memory/CHANGELOG.md b/packages/driver-memory/CHANGELOG.md index 100954620..f47ed237a 100644 --- a/packages/driver-memory/CHANGELOG.md +++ b/packages/driver-memory/CHANGELOG.md @@ -1,5 +1,18 @@ # @objectstack/driver-memory +## 0.3.3 + +### Patch Changes + +- feat: Add ObjectAI implementation documentation + + - Added comprehensive AI agent and RAG pipeline implementation documentation + - Defined AI protocol specifications and standards + - Enhanced project documentation with AI-related guides + +- Updated dependencies + - @objectstack/spec@0.3.3 + ## 0.3.2 ### Patch Changes diff --git a/packages/driver-memory/package.json b/packages/driver-memory/package.json index da3d41740..88dcc09d9 100644 --- a/packages/driver-memory/package.json +++ b/packages/driver-memory/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/driver-memory", - "version": "0.3.2", + "version": "0.3.3", "description": "In-Memory Driver for ObjectStack (Reference Implementation)", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", diff --git a/packages/driver-memory/src/memory-driver.ts b/packages/driver-memory/src/memory-driver.ts index 43fcedcd6..07f311c63 100644 --- a/packages/driver-memory/src/memory-driver.ts +++ b/packages/driver-memory/src/memory-driver.ts @@ -1,13 +1,15 @@ -import { QueryAST, QueryInput } from '@objectstack/spec/data'; -import { DriverInterface, DriverOptions } from '@objectstack/spec/system'; +import { QueryAST, QueryInput, DriverOptions } from '@objectstack/spec/data'; /** * Example: In-Memory Driver * * A minimal reference implementation of the ObjectStack Driver Protocol. * This driver stores data in a simple JavaScript object (Heap). + * + * Note: This implementation follows the DriverInterface structure but doesn't + * explicitly implement it due to Zod function type inference limitations. */ -export class InMemoryDriver implements DriverInterface { +export class InMemoryDriver { name = 'in-memory-driver'; version = '0.0.1'; @@ -26,7 +28,7 @@ export class InMemoryDriver implements DriverInterface { queryFilters: false, // TODO: Not implemented - basic find() doesn't handle filters queryAggregations: false, // TODO: Not implemented - count() only returns total querySorting: false, // TODO: Not implemented - find() doesn't handle sorting - queryPagination: true, // Basic pagination via 'top' is implemented + queryPagination: true, // Basic pagination via 'limit' is implemented queryWindowFunctions: false, // TODO: Not implemented querySubqueries: false, // TODO: Not implemented joins: false, // TODO: Not implemented @@ -35,6 +37,8 @@ export class InMemoryDriver implements DriverInterface { fullTextSearch: false, // TODO: Not implemented jsonFields: true, // Native JS object support arrayFields: true, // Native JS array support + vectorSearch: false, // TODO: Not implemented + geoSpatial: false, // TODO: Not implemented }; /** @@ -79,15 +83,15 @@ export class InMemoryDriver implements DriverInterface { let results = [...table]; // Simple limiting for demonstration - if (query.top) { - results = results.slice(0, query.top); + if (query.limit) { + results = results.slice(0, query.limit); } return results; } async findOne(object: string, query: QueryInput, options?: DriverOptions) { - const results = await this.find(object, { ...query, top: 1 }, options); + const results = await this.find(object, { ...query, limit: 1 }, options); return results[0] || null; } diff --git a/packages/objectql/CHANGELOG.md b/packages/objectql/CHANGELOG.md index 0986456f3..b113e1bfd 100644 --- a/packages/objectql/CHANGELOG.md +++ b/packages/objectql/CHANGELOG.md @@ -1,5 +1,18 @@ # @objectstack/objectql +## 0.3.3 + +### Patch Changes + +- feat: Add ObjectAI implementation documentation + + - Added comprehensive AI agent and RAG pipeline implementation documentation + - Defined AI protocol specifications and standards + - Enhanced project documentation with AI-related guides + +- Updated dependencies + - @objectstack/spec@0.3.3 + ## 0.3.2 ### Patch Changes diff --git a/packages/objectql/package.json b/packages/objectql/package.json index b2a146f9d..cb7a3dd87 100644 --- a/packages/objectql/package.json +++ b/packages/objectql/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/objectql", - "version": "0.3.2", + "version": "0.3.3", "description": "Isomorphic ObjectQL Engine for ObjectStack", "main": "src/index.ts", "types": "src/index.ts", diff --git a/packages/objectql/src/index.ts b/packages/objectql/src/index.ts index cc47fedb6..e3123fa92 100644 --- a/packages/objectql/src/index.ts +++ b/packages/objectql/src/index.ts @@ -1,5 +1,5 @@ -import { QueryAST } from '@objectstack/spec/data'; -import { DriverInterface, DriverOptions, ObjectStackManifest } from '@objectstack/spec/system'; +import { QueryAST, DriverOptions } from '@objectstack/spec/data'; +import { ObjectStackManifest } from '@objectstack/spec/system'; import { SchemaRegistry } from './registry'; // Export Registry for consumers @@ -19,7 +19,7 @@ export interface PluginContext { * ObjectQL Engine */ export class ObjectQL { - private drivers = new Map(); + private drivers = new Map(); private defaultDriver: string | null = null; // Host provided context additions (e.g. Server router) @@ -83,7 +83,7 @@ export class ObjectQL { logger: console, // Expose the driver registry helper explicitly if needed drivers: { - register: (driver: DriverInterface) => this.registerDriver(driver) + register: (driver: any) => this.registerDriver(driver) }, ...this.hostContext }; @@ -96,7 +96,7 @@ export class ObjectQL { /** * Register a new storage driver */ - registerDriver(driver: DriverInterface, isDefault: boolean = false) { + registerDriver(driver: any, isDefault: boolean = false) { if (this.drivers.has(driver.name)) { console.warn(`[ObjectQL] Driver ${driver.name} is already registered. Skipping.`); return; @@ -113,7 +113,7 @@ export class ObjectQL { /** * Helper to get the target driver */ - private getDriver(_object: string): DriverInterface { + private getDriver(_object: string): any { // TODO: Look up Object definition to see if it specifies a specific datasource/driver // For now, always return default if (!this.defaultDriver) { @@ -158,9 +158,9 @@ export class ObjectQL { object, // Add missing required field // Pass through if it looks like AST, otherwise empty // In this demo, we assume the caller passes a simplified object or raw AST - filters: filters.filters || undefined, - top: filters.top || 100, - sort: filters.sort || [] + where: filters.where || undefined, + limit: filters.limit || 100, + orderBy: filters.orderBy || [] }; return driver.find(object, ast, options); diff --git a/packages/plugin-hono-server/CHANGELOG.md b/packages/plugin-hono-server/CHANGELOG.md index 7d9944634..aaf3fb9a5 100644 --- a/packages/plugin-hono-server/CHANGELOG.md +++ b/packages/plugin-hono-server/CHANGELOG.md @@ -1,5 +1,20 @@ # @objectstack/plugin-hono-server +## 0.3.3 + +### Patch Changes + +- feat: Add ObjectAI implementation documentation + + - Added comprehensive AI agent and RAG pipeline implementation documentation + - Defined AI protocol specifications and standards + - Enhanced project documentation with AI-related guides + +- Updated dependencies + - @objectstack/spec@0.3.3 + - @objectstack/types@0.3.3 + - @objectstack/runtime@0.3.3 + ## 0.3.2 ### Patch Changes diff --git a/packages/plugin-hono-server/package.json b/packages/plugin-hono-server/package.json index 9bae63434..8be8198e5 100644 --- a/packages/plugin-hono-server/package.json +++ b/packages/plugin-hono-server/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/plugin-hono-server", - "version": "0.3.2", + "version": "0.3.3", "description": "Standard Hono Server Adapter for ObjectStack Runtime", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -19,6 +19,6 @@ "typescript": "^5.0.0" }, "peerDependencies": { - "@objectstack/runtime": "^0.3.2" + "@objectstack/runtime": "^0.3.3" } } diff --git a/packages/plugin-msw/CHANGELOG.md b/packages/plugin-msw/CHANGELOG.md index 924a4abc5..efb453061 100644 --- a/packages/plugin-msw/CHANGELOG.md +++ b/packages/plugin-msw/CHANGELOG.md @@ -1,5 +1,20 @@ # @objectstack/plugin-msw +## 0.3.3 + +### Patch Changes + +- feat: Add ObjectAI implementation documentation + + - Added comprehensive AI agent and RAG pipeline implementation documentation + - Defined AI protocol specifications and standards + - Enhanced project documentation with AI-related guides + +- Updated dependencies + - @objectstack/spec@0.3.3 + - @objectstack/types@0.3.3 + - @objectstack/runtime@0.3.3 + ## 0.3.2 ### Patch Changes diff --git a/packages/plugin-msw/package.json b/packages/plugin-msw/package.json index 047b060f6..d8b886fc3 100644 --- a/packages/plugin-msw/package.json +++ b/packages/plugin-msw/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/plugin-msw", - "version": "0.3.2", + "version": "0.3.3", "description": "MSW (Mock Service Worker) Plugin for ObjectStack Runtime", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -18,6 +18,6 @@ "typescript": "^5.0.0" }, "peerDependencies": { - "@objectstack/runtime": "^0.3.2" + "@objectstack/runtime": "^0.3.3" } } diff --git a/packages/runtime/CHANGELOG.md b/packages/runtime/CHANGELOG.md index d12c2b204..7ec88ae3f 100644 --- a/packages/runtime/CHANGELOG.md +++ b/packages/runtime/CHANGELOG.md @@ -1,5 +1,20 @@ # @objectstack/runtime +## 0.3.3 + +### Patch Changes + +- feat: Add ObjectAI implementation documentation + + - Added comprehensive AI agent and RAG pipeline implementation documentation + - Defined AI protocol specifications and standards + - Enhanced project documentation with AI-related guides + +- Updated dependencies + - @objectstack/spec@0.3.3 + - @objectstack/types@0.3.3 + - @objectstack/objectql@0.3.3 + ## 0.3.2 ### Patch Changes diff --git a/packages/runtime/package.json b/packages/runtime/package.json index 5dbfdf4ce..79a6ea8d7 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/runtime", - "version": "0.3.2", + "version": "0.3.3", "description": "ObjectStack Core Runtime & Query Engine", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/spec/CHANGELOG.md b/packages/spec/CHANGELOG.md index bdc76dcb2..d711d43b2 100644 --- a/packages/spec/CHANGELOG.md +++ b/packages/spec/CHANGELOG.md @@ -1,5 +1,15 @@ # @objectstack/spec +## 0.3.3 + +### Patch Changes + +- feat: Add ObjectAI implementation documentation + + - Added comprehensive AI agent and RAG pipeline implementation documentation + - Defined AI protocol specifications and standards + - Enhanced project documentation with AI-related guides + ## 0.3.2 ### Patch Changes diff --git a/packages/spec/json-schema/ai/AIOrchestration.json b/packages/spec/json-schema/ai/AIOrchestration.json new file mode 100644 index 000000000..d80bdd7dd --- /dev/null +++ b/packages/spec/json-schema/ai/AIOrchestration.json @@ -0,0 +1,379 @@ +{ + "$ref": "#/definitions/AIOrchestration", + "definitions": { + "AIOrchestration": { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Orchestration unique identifier (snake_case)" + }, + "label": { + "type": "string", + "description": "Display name" + }, + "description": { + "type": "string" + }, + "objectName": { + "type": "string", + "description": "Target object for this orchestration" + }, + "trigger": { + "type": "string", + "enum": [ + "record_created", + "record_updated", + "field_changed", + "scheduled", + "manual", + "webhook", + "batch" + ] + }, + "fieldConditions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "type": "string", + "description": "Field name to monitor" + }, + "operator": { + "type": "string", + "enum": [ + "changed", + "changed_to", + "changed_from", + "is", + "is_not" + ], + "default": "changed" + }, + "value": { + "description": "Value to compare against (for changed_to/changed_from/is/is_not)" + } + }, + "required": [ + "field" + ], + "additionalProperties": false + }, + "description": "Fields to monitor (for field_changed trigger)" + }, + "schedule": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "cron", + "interval", + "daily", + "weekly", + "monthly" + ], + "default": "cron" + }, + "cron": { + "type": "string", + "description": "Cron expression (required if type is \"cron\")" + }, + "interval": { + "type": "number", + "description": "Interval in minutes (required if type is \"interval\")" + }, + "time": { + "type": "string", + "description": "Time of day for daily schedules (HH:MM format)" + }, + "dayOfWeek": { + "type": "integer", + "minimum": 0, + "maximum": 6, + "description": "Day of week for weekly (0=Sunday)" + }, + "dayOfMonth": { + "type": "integer", + "minimum": 1, + "maximum": 31, + "description": "Day of month for monthly" + }, + "timezone": { + "type": "string", + "default": "UTC" + } + }, + "additionalProperties": false, + "description": "Schedule configuration (for scheduled trigger)" + }, + "webhookConfig": { + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Webhook verification secret" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Expected headers" + } + }, + "additionalProperties": false, + "description": "Webhook configuration (for webhook trigger)" + }, + "entryCriteria": { + "type": "string", + "description": "Formula condition - workflow only runs if TRUE" + }, + "aiTasks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Optional task ID for referencing" + }, + "name": { + "type": "string", + "description": "Human-readable task name" + }, + "type": { + "type": "string", + "enum": [ + "classify", + "extract", + "summarize", + "generate", + "predict", + "translate", + "sentiment", + "entity_recognition", + "anomaly_detection", + "recommendation" + ] + }, + "model": { + "type": "string", + "description": "Model ID from registry (uses default if not specified)" + }, + "promptTemplate": { + "type": "string", + "description": "Prompt template ID for this task" + }, + "inputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Source fields to process (e.g., [\"description\", \"comments\"])" + }, + "inputContext": { + "type": "object", + "additionalProperties": {}, + "description": "Additional context for the AI model" + }, + "outputField": { + "type": "string", + "description": "Target field to store the result" + }, + "outputFormat": { + "type": "string", + "enum": [ + "text", + "json", + "number", + "boolean", + "array" + ], + "default": "text" + }, + "classes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Valid classes for classification tasks" + }, + "multiClass": { + "type": "boolean", + "default": false, + "description": "Allow multiple classes to be selected" + }, + "extractionSchema": { + "type": "object", + "additionalProperties": {}, + "description": "JSON schema for structured extraction" + }, + "maxLength": { + "type": "number", + "description": "Maximum length for generated content" + }, + "temperature": { + "type": "number", + "minimum": 0, + "maximum": 2, + "description": "Model temperature override" + }, + "fallbackValue": { + "description": "Fallback value if AI task fails" + }, + "retryAttempts": { + "type": "integer", + "minimum": 0, + "maximum": 5, + "default": 1 + }, + "condition": { + "type": "string", + "description": "Formula condition - task only runs if TRUE" + }, + "description": { + "type": "string" + }, + "active": { + "type": "boolean", + "default": true + } + }, + "required": [ + "name", + "type", + "inputFields", + "outputField" + ], + "additionalProperties": false + }, + "description": "AI tasks to execute in sequence" + }, + "postActions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "field_update", + "send_email", + "create_record", + "update_related", + "trigger_flow", + "webhook" + ] + }, + "name": { + "type": "string", + "description": "Action name" + }, + "config": { + "type": "object", + "additionalProperties": {}, + "description": "Action-specific configuration" + }, + "condition": { + "type": "string", + "description": "Execute only if condition is TRUE" + } + }, + "required": [ + "type", + "name", + "config" + ], + "additionalProperties": false + }, + "description": "Actions after AI tasks complete" + }, + "executionMode": { + "type": "string", + "enum": [ + "sequential", + "parallel" + ], + "default": "sequential", + "description": "How to execute multiple AI tasks" + }, + "stopOnError": { + "type": "boolean", + "default": false, + "description": "Stop workflow if any task fails" + }, + "timeout": { + "type": "number", + "description": "Maximum execution time in seconds" + }, + "priority": { + "type": "string", + "enum": [ + "low", + "normal", + "high", + "critical" + ], + "default": "normal" + }, + "enableLogging": { + "type": "boolean", + "default": true + }, + "enableMetrics": { + "type": "boolean", + "default": true + }, + "notifyOnFailure": { + "type": "array", + "items": { + "type": "string" + }, + "description": "User IDs to notify on failure" + }, + "active": { + "type": "boolean", + "default": true + }, + "version": { + "type": "string", + "default": "1.0.0" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "category": { + "type": "string", + "description": "Workflow category (e.g., \"support\", \"sales\", \"hr\")" + }, + "owner": { + "type": "string", + "description": "User ID of workflow owner" + }, + "createdAt": { + "type": "string", + "description": "ISO timestamp" + }, + "updatedAt": { + "type": "string", + "description": "ISO timestamp" + } + }, + "required": [ + "name", + "label", + "objectName", + "trigger", + "aiTasks" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/ai/AIOrchestrationExecutionResult.json b/packages/spec/json-schema/ai/AIOrchestrationExecutionResult.json new file mode 100644 index 000000000..18b3d268a --- /dev/null +++ b/packages/spec/json-schema/ai/AIOrchestrationExecutionResult.json @@ -0,0 +1,105 @@ +{ + "$ref": "#/definitions/AIOrchestrationExecutionResult", + "definitions": { + "AIOrchestrationExecutionResult": { + "type": "object", + "properties": { + "workflowName": { + "type": "string" + }, + "recordId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success", + "partial_success", + "failed", + "skipped" + ] + }, + "executionTime": { + "type": "number", + "description": "Execution time in milliseconds" + }, + "tasksExecuted": { + "type": "integer", + "description": "Number of tasks executed" + }, + "tasksSucceeded": { + "type": "integer", + "description": "Number of tasks succeeded" + }, + "tasksFailed": { + "type": "integer", + "description": "Number of tasks failed" + }, + "taskResults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "taskId": { + "type": "string" + }, + "taskName": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success", + "failed", + "skipped" + ] + }, + "output": {}, + "error": { + "type": "string" + }, + "executionTime": { + "type": "number", + "description": "Task execution time in milliseconds" + }, + "modelUsed": { + "type": "string" + }, + "tokensUsed": { + "type": "number" + } + }, + "required": [ + "taskName", + "status" + ], + "additionalProperties": false + } + }, + "error": { + "type": "string" + }, + "startedAt": { + "type": "string", + "description": "ISO timestamp" + }, + "completedAt": { + "type": "string", + "description": "ISO timestamp" + } + }, + "required": [ + "workflowName", + "recordId", + "status", + "executionTime", + "tasksExecuted", + "tasksSucceeded", + "tasksFailed", + "startedAt" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/ai/AIOrchestrationTrigger.json b/packages/spec/json-schema/ai/AIOrchestrationTrigger.json new file mode 100644 index 000000000..20633c89e --- /dev/null +++ b/packages/spec/json-schema/ai/AIOrchestrationTrigger.json @@ -0,0 +1,18 @@ +{ + "$ref": "#/definitions/AIOrchestrationTrigger", + "definitions": { + "AIOrchestrationTrigger": { + "type": "string", + "enum": [ + "record_created", + "record_updated", + "field_changed", + "scheduled", + "manual", + "webhook", + "batch" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/ai/BatchAIOrchestrationExecution.json b/packages/spec/json-schema/ai/BatchAIOrchestrationExecution.json new file mode 100644 index 000000000..1224750b3 --- /dev/null +++ b/packages/spec/json-schema/ai/BatchAIOrchestrationExecution.json @@ -0,0 +1,48 @@ +{ + "$ref": "#/definitions/BatchAIOrchestrationExecution", + "definitions": { + "BatchAIOrchestrationExecution": { + "type": "object", + "properties": { + "workflowName": { + "type": "string", + "description": "Orchestration to execute" + }, + "recordIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Records to process" + }, + "batchSize": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "default": 10 + }, + "parallelism": { + "type": "integer", + "minimum": 1, + "maximum": 10, + "default": 3 + }, + "priority": { + "type": "string", + "enum": [ + "low", + "normal", + "high" + ], + "default": "normal" + } + }, + "required": [ + "workflowName", + "recordIds" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/ApiCapabilities.json b/packages/spec/json-schema/api/ApiCapabilities.json new file mode 100644 index 000000000..1aecc8acc --- /dev/null +++ b/packages/spec/json-schema/api/ApiCapabilities.json @@ -0,0 +1,28 @@ +{ + "$ref": "#/definitions/ApiCapabilities", + "definitions": { + "ApiCapabilities": { + "type": "object", + "properties": { + "graphql": { + "type": "boolean", + "default": false + }, + "search": { + "type": "boolean", + "default": false + }, + "websockets": { + "type": "boolean", + "default": false + }, + "files": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/ApiEndpoint.json b/packages/spec/json-schema/api/ApiEndpoint.json new file mode 100644 index 000000000..6c397676e --- /dev/null +++ b/packages/spec/json-schema/api/ApiEndpoint.json @@ -0,0 +1,162 @@ +{ + "$ref": "#/definitions/ApiEndpoint", + "definitions": { + "ApiEndpoint": { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique endpoint ID" + }, + "path": { + "type": "string", + "pattern": "^\\/", + "description": "URL Path (e.g. /api/v1/customers)" + }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST", + "PUT", + "DELETE", + "PATCH" + ], + "description": "HTTP Method" + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "flow", + "script", + "object_operation", + "proxy" + ], + "description": "Implementation type" + }, + "target": { + "type": "string", + "description": "Target Flow ID, Script Name, or Proxy URL" + }, + "objectParams": { + "type": "object", + "properties": { + "object": { + "type": "string" + }, + "operation": { + "type": "string", + "enum": [ + "find", + "get", + "create", + "update", + "delete" + ] + } + }, + "additionalProperties": false, + "description": "For object_operation type" + }, + "inputMapping": { + "type": "array", + "items": { + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "Source field/path" + }, + "target": { + "type": "string", + "description": "Target field/path" + }, + "transform": { + "type": "string", + "description": "Transformation function name" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + }, + "description": "Map Request Body to Internal Params" + }, + "outputMapping": { + "type": "array", + "items": { + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "Source field/path" + }, + "target": { + "type": "string", + "description": "Target field/path" + }, + "transform": { + "type": "string", + "description": "Transformation function name" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + }, + "description": "Map Internal Result to Response Body" + }, + "authRequired": { + "type": "boolean", + "default": true, + "description": "Require authentication" + }, + "rateLimit": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": false + }, + "windowMs": { + "type": "number", + "default": 60000, + "description": "Time window in milliseconds" + }, + "maxRequests": { + "type": "number", + "default": 100, + "description": "Max requests per window" + } + }, + "additionalProperties": false, + "description": "Rate limiting policy" + }, + "cacheTtl": { + "type": "number", + "description": "Response cache TTL in seconds" + } + }, + "required": [ + "name", + "path", + "method", + "type", + "target" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/ApiMapping.json b/packages/spec/json-schema/api/ApiMapping.json new file mode 100644 index 000000000..5ac98316a --- /dev/null +++ b/packages/spec/json-schema/api/ApiMapping.json @@ -0,0 +1,28 @@ +{ + "$ref": "#/definitions/ApiMapping", + "definitions": { + "ApiMapping": { + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "Source field/path" + }, + "target": { + "type": "string", + "description": "Target field/path" + }, + "transform": { + "type": "string", + "description": "Transformation function name" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/ApiRoutes.json b/packages/spec/json-schema/api/ApiRoutes.json new file mode 100644 index 000000000..992f9a41e --- /dev/null +++ b/packages/spec/json-schema/api/ApiRoutes.json @@ -0,0 +1,41 @@ +{ + "$ref": "#/definitions/ApiRoutes", + "definitions": { + "ApiRoutes": { + "type": "object", + "properties": { + "data": { + "type": "string", + "description": "e.g. /api/v1/data" + }, + "metadata": { + "type": "string", + "description": "e.g. /api/v1/meta" + }, + "auth": { + "type": "string", + "description": "e.g. /api/v1/auth" + }, + "actions": { + "type": "string", + "description": "e.g. /api/v1/p" + }, + "storage": { + "type": "string", + "description": "e.g. /api/v1/storage" + }, + "graphql": { + "type": "string", + "description": "e.g. /api/v1/graphql" + } + }, + "required": [ + "data", + "metadata", + "auth" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/Discovery.json b/packages/spec/json-schema/api/Discovery.json new file mode 100644 index 000000000..bfe1b1870 --- /dev/null +++ b/packages/spec/json-schema/api/Discovery.json @@ -0,0 +1,114 @@ +{ + "$ref": "#/definitions/Discovery", + "definitions": { + "Discovery": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "environment": { + "type": "string", + "enum": [ + "production", + "sandbox", + "development" + ] + }, + "routes": { + "type": "object", + "properties": { + "data": { + "type": "string", + "description": "e.g. /api/v1/data" + }, + "metadata": { + "type": "string", + "description": "e.g. /api/v1/meta" + }, + "auth": { + "type": "string", + "description": "e.g. /api/v1/auth" + }, + "actions": { + "type": "string", + "description": "e.g. /api/v1/p" + }, + "storage": { + "type": "string", + "description": "e.g. /api/v1/storage" + }, + "graphql": { + "type": "string", + "description": "e.g. /api/v1/graphql" + } + }, + "required": [ + "data", + "metadata", + "auth" + ], + "additionalProperties": false + }, + "features": { + "type": "object", + "properties": { + "graphql": { + "type": "boolean", + "default": false + }, + "search": { + "type": "boolean", + "default": false + }, + "websockets": { + "type": "boolean", + "default": false + }, + "files": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "locale": { + "type": "object", + "properties": { + "default": { + "type": "string" + }, + "supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "timezone": { + "type": "string" + } + }, + "required": [ + "default", + "supported", + "timezone" + ], + "additionalProperties": false + } + }, + "required": [ + "name", + "version", + "environment", + "routes", + "features", + "locale" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/ExportRequest.json b/packages/spec/json-schema/api/ExportRequest.json index 4ad7adce1..2db7a4d77 100644 --- a/packages/spec/json-schema/api/ExportRequest.json +++ b/packages/spec/json-schema/api/ExportRequest.json @@ -38,194 +38,65 @@ }, "description": "Fields to retrieve" }, - "aggregations": { - "type": "array", - "items": { - "type": "object", - "properties": { - "function": { - "type": "string", - "enum": [ - "count", - "sum", - "avg", - "min", - "max", - "count_distinct", - "array_agg", - "string_agg" - ], - "description": "Aggregation function" - }, - "field": { - "type": "string", - "description": "Field to aggregate (optional for COUNT(*))" - }, - "alias": { - "type": "string", - "description": "Result column alias" - }, - "distinct": { - "type": "boolean", - "description": "Apply DISTINCT before aggregation" - } + "where": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} }, - "required": [ - "function", - "alias" - ], - "additionalProperties": false - }, - "description": "Aggregation functions (GROUP BY)" + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ], + "description": "Filtering criteria (WHERE)" }, - "windowFunctions": { + "orderBy": { "type": "array", "items": { "type": "object", "properties": { - "function": { - "type": "string", - "enum": [ - "row_number", - "rank", - "dense_rank", - "percent_rank", - "lag", - "lead", - "first_value", - "last_value", - "sum", - "avg", - "count", - "min", - "max" - ], - "description": "Window function name" - }, "field": { - "type": "string", - "description": "Field to operate on (for aggregate window functions)" + "type": "string" }, - "alias": { + "order": { "type": "string", - "description": "Result column alias" - }, - "over": { - "type": "object", - "properties": { - "partitionBy": { - "type": "array", - "items": { - "type": "string" - }, - "description": "PARTITION BY fields" - }, - "orderBy": { - "type": "array", - "items": { - "type": "object", - "properties": { - "field": { - "type": "string" - }, - "order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - } - }, - "required": [ - "field" - ], - "additionalProperties": false - }, - "description": "ORDER BY specification" - }, - "frame": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "rows", - "range" - ] - }, - "start": { - "type": "string", - "description": "Frame start (e.g., \"UNBOUNDED PRECEDING\", \"1 PRECEDING\")" - }, - "end": { - "type": "string", - "description": "Frame end (e.g., \"CURRENT ROW\", \"1 FOLLOWING\")" - } - }, - "additionalProperties": false, - "description": "Window frame specification" - } - }, - "additionalProperties": false, - "description": "Window specification (OVER clause)" + "enum": [ + "asc", + "desc" + ], + "default": "asc" } }, "required": [ - "function", - "alias", - "over" + "field" ], "additionalProperties": false }, - "description": "Window functions with OVER clause" + "description": "Sorting instructions (ORDER BY)" }, - "filters": { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - } - } - ], - "description": "Filtering criteria" + "limit": { + "type": "number", + "description": "Max records to return (LIMIT)" + }, + "offset": { + "type": "number", + "description": "Records to skip (OFFSET)" + }, + "cursor": { + "type": "object", + "additionalProperties": {}, + "description": "Cursor for keyset pagination" }, "joins": { "type": "array", @@ -251,92 +122,86 @@ "description": "Table alias" }, "on": { - "anyOf": [ + "allOf": [ { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] + "type": "object", + "additionalProperties": {} }, { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "anyOf": [ + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": { + "allOf": [ { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] + "$or": { + "type": "array", + "items": {} }, - {} - ] + "$not": {} + } + } + ] + } + }, + "$or": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} }, { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} } } ] } - ] + }, + "$not": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ] + } } } ], @@ -379,6 +244,67 @@ }, "description": "Fields to retrieve" }, + "where": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ], + "description": "Filtering criteria (WHERE)" + }, + "orderBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, + "required": [ + "field" + ], + "additionalProperties": false + }, + "description": "Sorting instructions (ORDER BY)" + }, + "limit": { + "type": "number", + "description": "Max records to return (LIMIT)" + }, + "offset": { + "type": "number", + "description": "Records to skip (OFFSET)" + }, + "cursor": { + "type": "object", + "additionalProperties": {}, + "description": "Cursor for keyset pagination" + }, + "joins": {}, "aggregations": { "type": "array", "items": { @@ -417,7 +343,37 @@ ], "additionalProperties": false }, - "description": "Aggregation functions (GROUP BY)" + "description": "Aggregation functions" + }, + "groupBy": { + "type": "array", + "items": { + "type": "string" + }, + "description": "GROUP BY fields" + }, + "having": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ], + "description": "HAVING clause for aggregation filtering" }, "windowFunctions": { "type": "array", @@ -521,140 +477,6 @@ }, "description": "Window functions with OVER clause" }, - "filters": { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - } - } - ], - "description": "Filtering criteria" - }, - "joins": {}, - "groupBy": { - "type": "array", - "items": { - "type": "string" - }, - "description": "GROUP BY fields" - }, - "having": { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - } - } - ], - "description": "HAVING clause for aggregation filtering" - }, - "sort": { - "type": "array", - "items": { - "type": "object", - "properties": { - "field": { - "type": "string" - }, - "order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - } - }, - "required": [ - "field" - ], - "additionalProperties": false - }, - "description": "Sorting instructions" - }, - "top": { - "type": "number", - "description": "Limit results" - }, - "skip": { - "type": "number", - "description": "Offset results" - }, "distinct": { "type": "boolean", "description": "SELECT DISTINCT flag" @@ -674,7 +496,47 @@ ], "additionalProperties": false }, - "description": "Table joins" + "description": "Explicit Table Joins" + }, + "aggregations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "function": { + "type": "string", + "enum": [ + "count", + "sum", + "avg", + "min", + "max", + "count_distinct", + "array_agg", + "string_agg" + ], + "description": "Aggregation function" + }, + "field": { + "type": "string", + "description": "Field to aggregate (optional for COUNT(*))" + }, + "alias": { + "type": "string", + "description": "Result column alias" + }, + "distinct": { + "type": "boolean", + "description": "Apply DISTINCT before aggregation" + } + }, + "required": [ + "function", + "alias" + ], + "additionalProperties": false + }, + "description": "Aggregation functions" }, "groupBy": { "type": "array", @@ -684,83 +546,129 @@ "description": "GROUP BY fields" }, "having": { - "anyOf": [ + "allOf": [ { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] + "type": "object", + "additionalProperties": {} }, { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} } } ], "description": "HAVING clause for aggregation filtering" }, - "sort": { + "windowFunctions": { "type": "array", "items": { "type": "object", "properties": { - "field": { - "type": "string" - }, - "order": { + "function": { "type": "string", "enum": [ - "asc", - "desc" + "row_number", + "rank", + "dense_rank", + "percent_rank", + "lag", + "lead", + "first_value", + "last_value", + "sum", + "avg", + "count", + "min", + "max" ], - "default": "asc" + "description": "Window function name" + }, + "field": { + "type": "string", + "description": "Field to operate on (for aggregate window functions)" + }, + "alias": { + "type": "string", + "description": "Result column alias" + }, + "over": { + "type": "object", + "properties": { + "partitionBy": { + "type": "array", + "items": { + "type": "string" + }, + "description": "PARTITION BY fields" + }, + "orderBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, + "required": [ + "field" + ], + "additionalProperties": false + }, + "description": "ORDER BY specification" + }, + "frame": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "rows", + "range" + ] + }, + "start": { + "type": "string", + "description": "Frame start (e.g., \"UNBOUNDED PRECEDING\", \"1 PRECEDING\")" + }, + "end": { + "type": "string", + "description": "Frame end (e.g., \"CURRENT ROW\", \"1 FOLLOWING\")" + } + }, + "additionalProperties": false, + "description": "Window frame specification" + } + }, + "additionalProperties": false, + "description": "Window specification (OVER clause)" } }, "required": [ - "field" + "function", + "alias", + "over" ], "additionalProperties": false }, - "description": "Sorting instructions" - }, - "top": { - "type": "number", - "description": "Limit results" - }, - "skip": { - "type": "number", - "description": "Offset results" + "description": "Window functions with OVER clause" }, "distinct": { "type": "boolean", diff --git a/packages/spec/json-schema/api/HttpMethod.json b/packages/spec/json-schema/api/HttpMethod.json new file mode 100644 index 000000000..f700fbb09 --- /dev/null +++ b/packages/spec/json-schema/api/HttpMethod.json @@ -0,0 +1,16 @@ +{ + "$ref": "#/definitions/HttpMethod", + "definitions": { + "HttpMethod": { + "type": "string", + "enum": [ + "GET", + "POST", + "PUT", + "DELETE", + "PATCH" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/Presence.json b/packages/spec/json-schema/api/Presence.json new file mode 100644 index 000000000..92a273202 --- /dev/null +++ b/packages/spec/json-schema/api/Presence.json @@ -0,0 +1,40 @@ +{ + "$ref": "#/definitions/Presence", + "definitions": { + "Presence": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User identifier" + }, + "status": { + "type": "string", + "enum": [ + "online", + "away", + "offline" + ], + "description": "Current presence status" + }, + "lastSeen": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 datetime of last activity" + }, + "metadata": { + "type": "object", + "additionalProperties": {}, + "description": "Custom presence data (e.g., current page, custom status)" + } + }, + "required": [ + "userId", + "status", + "lastSeen" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/PresenceStatus.json b/packages/spec/json-schema/api/PresenceStatus.json new file mode 100644 index 000000000..7248409fe --- /dev/null +++ b/packages/spec/json-schema/api/PresenceStatus.json @@ -0,0 +1,14 @@ +{ + "$ref": "#/definitions/PresenceStatus", + "definitions": { + "PresenceStatus": { + "type": "string", + "enum": [ + "online", + "away", + "offline" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/RateLimit.json b/packages/spec/json-schema/api/RateLimit.json new file mode 100644 index 000000000..8abd9506b --- /dev/null +++ b/packages/spec/json-schema/api/RateLimit.json @@ -0,0 +1,26 @@ +{ + "$ref": "#/definitions/RateLimit", + "definitions": { + "RateLimit": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": false + }, + "windowMs": { + "type": "number", + "default": 60000, + "description": "Time window in milliseconds" + }, + "maxRequests": { + "type": "number", + "default": 100, + "description": "Max requests per window" + } + }, + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/RealtimeAction.json b/packages/spec/json-schema/api/RealtimeAction.json new file mode 100644 index 000000000..91ddffd79 --- /dev/null +++ b/packages/spec/json-schema/api/RealtimeAction.json @@ -0,0 +1,14 @@ +{ + "$ref": "#/definitions/RealtimeAction", + "definitions": { + "RealtimeAction": { + "type": "string", + "enum": [ + "created", + "updated", + "deleted" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/RealtimeEvent.json b/packages/spec/json-schema/api/RealtimeEvent.json new file mode 100644 index 000000000..7650cf162 --- /dev/null +++ b/packages/spec/json-schema/api/RealtimeEvent.json @@ -0,0 +1,51 @@ +{ + "$ref": "#/definitions/RealtimeEvent", + "definitions": { + "RealtimeEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique event identifier" + }, + "type": { + "type": "string", + "description": "Event type (e.g., record.created, record.updated)" + }, + "object": { + "type": "string", + "description": "Object name the event relates to" + }, + "action": { + "type": "string", + "enum": [ + "created", + "updated", + "deleted" + ], + "description": "Action performed" + }, + "payload": { + "description": "Event payload data" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 datetime when event occurred" + }, + "userId": { + "type": "string", + "description": "User who triggered the event" + } + }, + "required": [ + "id", + "type", + "timestamp" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/RealtimeEventType.json b/packages/spec/json-schema/api/RealtimeEventType.json new file mode 100644 index 000000000..e1b8eeb83 --- /dev/null +++ b/packages/spec/json-schema/api/RealtimeEventType.json @@ -0,0 +1,15 @@ +{ + "$ref": "#/definitions/RealtimeEventType", + "definitions": { + "RealtimeEventType": { + "type": "string", + "enum": [ + "record.created", + "record.updated", + "record.deleted", + "field.changed" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/Subscription.json b/packages/spec/json-schema/api/Subscription.json new file mode 100644 index 000000000..f8d9a6a73 --- /dev/null +++ b/packages/spec/json-schema/api/Subscription.json @@ -0,0 +1,65 @@ +{ + "$ref": "#/definitions/Subscription", + "definitions": { + "Subscription": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique subscription identifier" + }, + "events": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "record.created", + "record.updated", + "record.deleted", + "field.changed" + ], + "description": "Type of event to subscribe to" + }, + "object": { + "type": "string", + "description": "Object name to subscribe to" + }, + "filters": { + "description": "Filter conditions" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "description": "Array of events to subscribe to" + }, + "transport": { + "type": "string", + "enum": [ + "websocket", + "sse", + "polling" + ], + "description": "Transport protocol to use" + }, + "channel": { + "type": "string", + "description": "Optional channel name for grouping subscriptions" + } + }, + "required": [ + "id", + "events", + "transport" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/SubscriptionEvent.json b/packages/spec/json-schema/api/SubscriptionEvent.json new file mode 100644 index 000000000..58a0d0303 --- /dev/null +++ b/packages/spec/json-schema/api/SubscriptionEvent.json @@ -0,0 +1,32 @@ +{ + "$ref": "#/definitions/SubscriptionEvent", + "definitions": { + "SubscriptionEvent": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "record.created", + "record.updated", + "record.deleted", + "field.changed" + ], + "description": "Type of event to subscribe to" + }, + "object": { + "type": "string", + "description": "Object name to subscribe to" + }, + "filters": { + "description": "Filter conditions" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/TransportProtocol.json b/packages/spec/json-schema/api/TransportProtocol.json new file mode 100644 index 000000000..83009868f --- /dev/null +++ b/packages/spec/json-schema/api/TransportProtocol.json @@ -0,0 +1,14 @@ +{ + "$ref": "#/definitions/TransportProtocol", + "definitions": { + "TransportProtocol": { + "type": "string", + "enum": [ + "websocket", + "sse", + "polling" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/AsyncValidation.json b/packages/spec/json-schema/data/AsyncValidation.json index 41aaf737a..40e1d4f6f 100644 --- a/packages/spec/json-schema/data/AsyncValidation.json +++ b/packages/spec/json-schema/data/AsyncValidation.json @@ -7,12 +7,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -24,7 +55,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -38,6 +69,22 @@ "type": "string", "description": "External API endpoint for validation" }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "default": "GET", + "description": "HTTP method for external call" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom headers for the request" + }, "validatorFunction": { "type": "string", "description": "Reference to custom validator function" diff --git a/packages/spec/json-schema/data/ConditionalValidation.json b/packages/spec/json-schema/data/ConditionalValidation.json index 2920bed32..586f81897 100644 --- a/packages/spec/json-schema/data/ConditionalValidation.json +++ b/packages/spec/json-schema/data/ConditionalValidation.json @@ -7,12 +7,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -24,7 +55,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -42,12 +73,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -59,7 +121,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -84,12 +146,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -101,7 +194,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -137,12 +230,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -154,7 +278,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -190,12 +314,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -207,7 +362,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -243,12 +398,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -260,7 +446,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -293,12 +479,122 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "json_schema" + }, + "field": { + "type": "string", + "description": "JSON field to validate" + }, + "schema": { + "type": "object", + "additionalProperties": {}, + "description": "JSON Schema object definition" + } + }, + "required": [ + "name", + "message", + "type", + "field", + "schema" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -310,7 +606,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -324,6 +620,22 @@ "type": "string", "description": "External API endpoint for validation" }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "default": "GET", + "description": "HTTP method for external call" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom headers for the request" + }, "validatorFunction": { "type": "string", "description": "Reference to custom validator function" @@ -357,12 +669,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -374,7 +717,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -382,22 +725,23 @@ }, "field": { "type": "string", - "description": "Field to validate (optional for record-level validation)" + "description": "Field to validate" }, "validatorFunction": { "type": "string", - "description": "Function name or reference to custom validator" + "description": "Reference to custom validator function" }, "params": { "type": "object", "additionalProperties": {}, - "description": "Additional parameters for the validator" + "description": "Additional parameters to pass to validator" } }, "required": [ "name", "message", "type", + "field", "validatorFunction" ], "additionalProperties": false @@ -414,12 +758,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -431,7 +806,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -456,12 +831,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -473,7 +879,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -509,12 +915,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -526,7 +963,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -562,12 +999,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -579,7 +1047,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -615,12 +1083,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -632,7 +1131,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -665,12 +1164,122 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "json_schema" + }, + "field": { + "type": "string", + "description": "JSON field to validate" + }, + "schema": { + "type": "object", + "additionalProperties": {}, + "description": "JSON Schema object definition" + } + }, + "required": [ + "name", + "message", + "type", + "field", + "schema" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -682,7 +1291,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -696,6 +1305,22 @@ "type": "string", "description": "External API endpoint for validation" }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "default": "GET", + "description": "HTTP method for external call" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom headers for the request" + }, "validatorFunction": { "type": "string", "description": "Reference to custom validator function" @@ -729,12 +1354,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -746,7 +1402,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -754,22 +1410,23 @@ }, "field": { "type": "string", - "description": "Field to validate (optional for record-level validation)" + "description": "Field to validate" }, "validatorFunction": { "type": "string", - "description": "Function name or reference to custom validator" + "description": "Reference to custom validator function" }, "params": { "type": "object", "additionalProperties": {}, - "description": "Additional parameters for the validator" + "description": "Additional parameters to pass to validator" } }, "required": [ "name", "message", "type", + "field", "validatorFunction" ], "additionalProperties": false diff --git a/packages/spec/json-schema/data/CriteriaSharingRule.json b/packages/spec/json-schema/data/CriteriaSharingRule.json new file mode 100644 index 000000000..9acd77e0a --- /dev/null +++ b/packages/spec/json-schema/data/CriteriaSharingRule.json @@ -0,0 +1,82 @@ +{ + "$ref": "#/definitions/CriteriaSharingRule", + "definitions": { + "CriteriaSharingRule": { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label" + }, + "description": { + "type": "string", + "description": "Administrative notes" + }, + "object": { + "type": "string", + "description": "Target Object Name" + }, + "active": { + "type": "boolean", + "default": true + }, + "accessLevel": { + "type": "string", + "enum": [ + "read", + "edit", + "full" + ], + "default": "read" + }, + "sharedWith": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "group", + "role", + "role_and_subordinates", + "guest" + ] + }, + "value": { + "type": "string", + "description": "ID or Code of the User/Group/Role" + } + }, + "required": [ + "type", + "value" + ], + "additionalProperties": false, + "description": "The recipient of the shared access" + }, + "type": { + "type": "string", + "const": "criteria" + }, + "condition": { + "type": "string", + "description": "Formula condition (e.g. \"department = 'Sales'\")" + } + }, + "required": [ + "name", + "object", + "sharedWith", + "type", + "condition" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/CrossFieldValidation.json b/packages/spec/json-schema/data/CrossFieldValidation.json index cd3044f27..bf8a9ac8e 100644 --- a/packages/spec/json-schema/data/CrossFieldValidation.json +++ b/packages/spec/json-schema/data/CrossFieldValidation.json @@ -7,12 +7,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -24,7 +55,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", diff --git a/packages/spec/json-schema/data/CustomValidator.json b/packages/spec/json-schema/data/CustomValidator.json index cfd9dd225..6f2848948 100644 --- a/packages/spec/json-schema/data/CustomValidator.json +++ b/packages/spec/json-schema/data/CustomValidator.json @@ -7,12 +7,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -24,7 +55,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -32,22 +63,23 @@ }, "field": { "type": "string", - "description": "Field to validate (optional for record-level validation)" + "description": "Field to validate" }, "validatorFunction": { "type": "string", - "description": "Function name or reference to custom validator" + "description": "Reference to custom validator function" }, "params": { "type": "object", "additionalProperties": {}, - "description": "Additional parameters for the validator" + "description": "Additional parameters to pass to validator" } }, "required": [ "name", "message", "type", + "field", "validatorFunction" ], "additionalProperties": false diff --git a/packages/spec/json-schema/data/Datasource.json b/packages/spec/json-schema/data/Datasource.json new file mode 100644 index 000000000..2761a8a44 --- /dev/null +++ b/packages/spec/json-schema/data/Datasource.json @@ -0,0 +1,130 @@ +{ + "$ref": "#/definitions/Datasource", + "definitions": { + "Datasource": { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique datasource identifier" + }, + "label": { + "type": "string", + "description": "Display label" + }, + "driver": { + "type": "string", + "description": "Underlying driver type" + }, + "config": { + "type": "object", + "additionalProperties": {}, + "description": "Driver specific configuration" + }, + "pool": { + "type": "object", + "properties": { + "min": { + "type": "number", + "default": 0, + "description": "Minimum connections" + }, + "max": { + "type": "number", + "default": 10, + "description": "Maximum connections" + }, + "idleTimeoutMillis": { + "type": "number", + "default": 30000, + "description": "Idle timeout" + }, + "connectionTimeoutMillis": { + "type": "number", + "default": 3000, + "description": "Connection establishment timeout" + } + }, + "additionalProperties": false, + "description": "Connection pool settings" + }, + "readReplicas": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} + }, + "description": "Read-only replica configurations" + }, + "capabilities": { + "type": "object", + "properties": { + "transactions": { + "type": "boolean", + "default": false + }, + "queryFilters": { + "type": "boolean", + "default": false + }, + "queryAggregations": { + "type": "boolean", + "default": false + }, + "querySorting": { + "type": "boolean", + "default": false + }, + "queryPagination": { + "type": "boolean", + "default": false + }, + "queryWindowFunctions": { + "type": "boolean", + "default": false + }, + "querySubqueries": { + "type": "boolean", + "default": false + }, + "joins": { + "type": "boolean", + "default": false + }, + "fullTextSearch": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "dynamicSchema": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false, + "description": "Capability overrides" + }, + "description": { + "type": "string", + "description": "Internal description" + }, + "active": { + "type": "boolean", + "default": true, + "description": "Is datasource enabled" + } + }, + "required": [ + "name", + "driver", + "config" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/DatasourceCapabilities.json b/packages/spec/json-schema/data/DatasourceCapabilities.json new file mode 100644 index 000000000..a25ff44a4 --- /dev/null +++ b/packages/spec/json-schema/data/DatasourceCapabilities.json @@ -0,0 +1,56 @@ +{ + "$ref": "#/definitions/DatasourceCapabilities", + "definitions": { + "DatasourceCapabilities": { + "type": "object", + "properties": { + "transactions": { + "type": "boolean", + "default": false + }, + "queryFilters": { + "type": "boolean", + "default": false + }, + "queryAggregations": { + "type": "boolean", + "default": false + }, + "querySorting": { + "type": "boolean", + "default": false + }, + "queryPagination": { + "type": "boolean", + "default": false + }, + "queryWindowFunctions": { + "type": "boolean", + "default": false + }, + "querySubqueries": { + "type": "boolean", + "default": false + }, + "joins": { + "type": "boolean", + "default": false + }, + "fullTextSearch": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "dynamicSchema": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/DriverCapabilities.json b/packages/spec/json-schema/data/DriverCapabilities.json new file mode 100644 index 000000000..45ba7ca27 --- /dev/null +++ b/packages/spec/json-schema/data/DriverCapabilities.json @@ -0,0 +1,79 @@ +{ + "$ref": "#/definitions/DriverCapabilities", + "definitions": { + "DriverCapabilities": { + "type": "object", + "properties": { + "transactions": { + "type": "boolean", + "description": "Supports transactions" + }, + "queryFilters": { + "type": "boolean", + "description": "Supports WHERE clause filtering" + }, + "queryAggregations": { + "type": "boolean", + "description": "Supports GROUP BY and aggregation functions" + }, + "querySorting": { + "type": "boolean", + "description": "Supports ORDER BY sorting" + }, + "queryPagination": { + "type": "boolean", + "description": "Supports LIMIT/OFFSET pagination" + }, + "queryWindowFunctions": { + "type": "boolean", + "description": "Supports window functions with OVER clause" + }, + "querySubqueries": { + "type": "boolean", + "description": "Supports subqueries" + }, + "joins": { + "type": "boolean", + "description": "Supports SQL joins" + }, + "fullTextSearch": { + "type": "boolean", + "description": "Supports full-text search" + }, + "jsonFields": { + "type": "boolean", + "description": "Supports JSON field types" + }, + "arrayFields": { + "type": "boolean", + "description": "Supports array field types" + }, + "vectorSearch": { + "type": "boolean", + "default": false, + "description": "Supports vector embeddings and similarity search" + }, + "geoSpatial": { + "type": "boolean", + "default": false, + "description": "Supports geospatial queries" + } + }, + "required": [ + "transactions", + "queryFilters", + "queryAggregations", + "querySorting", + "queryPagination", + "queryWindowFunctions", + "querySubqueries", + "joins", + "fullTextSearch", + "jsonFields", + "arrayFields" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/DriverDefinition.json b/packages/spec/json-schema/data/DriverDefinition.json new file mode 100644 index 000000000..d88b9c222 --- /dev/null +++ b/packages/spec/json-schema/data/DriverDefinition.json @@ -0,0 +1,86 @@ +{ + "$ref": "#/definitions/DriverDefinition", + "definitions": { + "DriverDefinition": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique driver identifier (e.g. \"postgres\")" + }, + "label": { + "type": "string", + "description": "Display label (e.g. \"PostgreSQL\")" + }, + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "configSchema": { + "type": "object", + "additionalProperties": {}, + "description": "JSON Schema for connection configuration" + }, + "capabilities": { + "type": "object", + "properties": { + "transactions": { + "type": "boolean", + "default": false + }, + "queryFilters": { + "type": "boolean", + "default": false + }, + "queryAggregations": { + "type": "boolean", + "default": false + }, + "querySorting": { + "type": "boolean", + "default": false + }, + "queryPagination": { + "type": "boolean", + "default": false + }, + "queryWindowFunctions": { + "type": "boolean", + "default": false + }, + "querySubqueries": { + "type": "boolean", + "default": false + }, + "joins": { + "type": "boolean", + "default": false + }, + "fullTextSearch": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "dynamicSchema": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + } + }, + "required": [ + "id", + "label", + "configSchema" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/DriverInterface.json b/packages/spec/json-schema/data/DriverInterface.json new file mode 100644 index 000000000..62fad4070 --- /dev/null +++ b/packages/spec/json-schema/data/DriverInterface.json @@ -0,0 +1,98 @@ +{ + "$ref": "#/definitions/DriverInterface", + "definitions": { + "DriverInterface": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Driver unique name" + }, + "version": { + "type": "string", + "description": "Driver version" + }, + "supports": { + "type": "object", + "properties": { + "transactions": { + "type": "boolean", + "description": "Supports transactions" + }, + "queryFilters": { + "type": "boolean", + "description": "Supports WHERE clause filtering" + }, + "queryAggregations": { + "type": "boolean", + "description": "Supports GROUP BY and aggregation functions" + }, + "querySorting": { + "type": "boolean", + "description": "Supports ORDER BY sorting" + }, + "queryPagination": { + "type": "boolean", + "description": "Supports LIMIT/OFFSET pagination" + }, + "queryWindowFunctions": { + "type": "boolean", + "description": "Supports window functions with OVER clause" + }, + "querySubqueries": { + "type": "boolean", + "description": "Supports subqueries" + }, + "joins": { + "type": "boolean", + "description": "Supports SQL joins" + }, + "fullTextSearch": { + "type": "boolean", + "description": "Supports full-text search" + }, + "jsonFields": { + "type": "boolean", + "description": "Supports JSON field types" + }, + "arrayFields": { + "type": "boolean", + "description": "Supports array field types" + }, + "vectorSearch": { + "type": "boolean", + "default": false, + "description": "Supports vector embeddings and similarity search" + }, + "geoSpatial": { + "type": "boolean", + "default": false, + "description": "Supports geospatial queries" + } + }, + "required": [ + "transactions", + "queryFilters", + "queryAggregations", + "querySorting", + "queryPagination", + "queryWindowFunctions", + "querySubqueries", + "joins", + "fullTextSearch", + "jsonFields", + "arrayFields" + ], + "additionalProperties": false + } + }, + "required": [ + "name", + "version", + "supports" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/DriverOptions.json b/packages/spec/json-schema/data/DriverOptions.json new file mode 100644 index 000000000..76fcb56cb --- /dev/null +++ b/packages/spec/json-schema/data/DriverOptions.json @@ -0,0 +1,34 @@ +{ + "$ref": "#/definitions/DriverOptions", + "definitions": { + "DriverOptions": { + "type": "object", + "properties": { + "transaction": { + "description": "Transaction handle" + }, + "timeout": { + "type": "number", + "description": "Timeout in ms" + }, + "skipCache": { + "type": "boolean", + "description": "Bypass cache" + }, + "traceContext": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "OpenTelemetry context or request ID" + }, + "tenantId": { + "type": "string", + "description": "Tenant Isolation identifier" + } + }, + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/DriverType.json b/packages/spec/json-schema/data/DriverType.json new file mode 100644 index 000000000..101a3571b --- /dev/null +++ b/packages/spec/json-schema/data/DriverType.json @@ -0,0 +1,10 @@ +{ + "$ref": "#/definitions/DriverType", + "definitions": { + "DriverType": { + "type": "string", + "description": "Underlying driver identifier" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/Flow.json b/packages/spec/json-schema/data/Flow.json index cbfd40ae8..ff5fd8558 100644 --- a/packages/spec/json-schema/data/Flow.json +++ b/packages/spec/json-schema/data/Flow.json @@ -16,6 +16,27 @@ "description": { "type": "string" }, + "version": { + "type": "integer", + "default": 1, + "description": "Version number" + }, + "status": { + "type": "string", + "enum": [ + "draft", + "active", + "obsolete", + "invalid" + ], + "default": "draft", + "description": "Deployment status" + }, + "template": { + "type": "boolean", + "default": false, + "description": "Is logic template (Subflow)" + }, "type": { "type": "string", "enum": [ @@ -143,6 +164,15 @@ "type": "string", "description": "Expression returning boolean used for branching" }, + "type": { + "type": "string", + "enum": [ + "default", + "fault" + ], + "default": "default", + "description": "Connection type: Standard (Success) or Fault (Error) path" + }, "label": { "type": "string", "description": "Label on the connector" @@ -160,7 +190,7 @@ "active": { "type": "boolean", "default": false, - "description": "Is active" + "description": "Is active (Deprecated: use status)" }, "runAs": { "type": "string", diff --git a/packages/spec/json-schema/data/FlowEdge.json b/packages/spec/json-schema/data/FlowEdge.json index d41f9aac6..a704de22c 100644 --- a/packages/spec/json-schema/data/FlowEdge.json +++ b/packages/spec/json-schema/data/FlowEdge.json @@ -20,6 +20,15 @@ "type": "string", "description": "Expression returning boolean used for branching" }, + "type": { + "type": "string", + "enum": [ + "default", + "fault" + ], + "default": "default", + "description": "Connection type: Standard (Success) or Fault (Error) path" + }, "label": { "type": "string", "description": "Label on the connector" diff --git a/packages/spec/json-schema/data/FormatValidation.json b/packages/spec/json-schema/data/FormatValidation.json index 6b8ff6358..9828e8b10 100644 --- a/packages/spec/json-schema/data/FormatValidation.json +++ b/packages/spec/json-schema/data/FormatValidation.json @@ -7,12 +7,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -24,7 +55,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", diff --git a/packages/spec/json-schema/data/Index.json b/packages/spec/json-schema/data/Index.json index 4c49e694f..ebccfd7fd 100644 --- a/packages/spec/json-schema/data/Index.json +++ b/packages/spec/json-schema/data/Index.json @@ -18,6 +18,16 @@ "unique": { "type": "boolean", "description": "Whether the index is unique" + }, + "type": { + "type": "string", + "enum": [ + "btree", + "hash", + "gin", + "gist" + ], + "description": "Index type (default: btree)" } }, "required": [ diff --git a/packages/spec/json-schema/data/JSONValidation.json b/packages/spec/json-schema/data/JSONValidation.json new file mode 100644 index 000000000..7e01173d6 --- /dev/null +++ b/packages/spec/json-schema/data/JSONValidation.json @@ -0,0 +1,85 @@ +{ + "$ref": "#/definitions/JSONValidation", + "definitions": { + "JSONValidation": { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "json_schema" + }, + "field": { + "type": "string", + "description": "JSON field to validate" + }, + "schema": { + "type": "object", + "additionalProperties": {}, + "description": "JSON Schema object definition" + } + }, + "required": [ + "name", + "message", + "type", + "field", + "schema" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/JoinNode.json b/packages/spec/json-schema/data/JoinNode.json index b3ef86731..6bdcd1be8 100644 --- a/packages/spec/json-schema/data/JoinNode.json +++ b/packages/spec/json-schema/data/JoinNode.json @@ -23,92 +23,86 @@ "description": "Table alias" }, "on": { - "anyOf": [ + "allOf": [ { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] + "type": "object", + "additionalProperties": {} }, { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "anyOf": [ + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": { + "allOf": [ { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] + "$or": { + "type": "array", + "items": {} }, - {} - ] + "$not": {} + } + } + ] + } + }, + "$or": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} }, { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} } } ] } - ] + }, + "$not": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ] + } } } ], @@ -151,6 +145,71 @@ }, "description": "Fields to retrieve" }, + "where": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ], + "description": "Filtering criteria (WHERE)" + }, + "orderBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, + "required": [ + "field" + ], + "additionalProperties": false + }, + "description": "Sorting instructions (ORDER BY)" + }, + "limit": { + "type": "number", + "description": "Max records to return (LIMIT)" + }, + "offset": { + "type": "number", + "description": "Records to skip (OFFSET)" + }, + "cursor": { + "type": "object", + "additionalProperties": {}, + "description": "Cursor for keyset pagination" + }, + "joins": { + "type": "array", + "items": {}, + "description": "Explicit Table Joins" + }, "aggregations": { "type": "array", "items": { @@ -189,7 +248,37 @@ ], "additionalProperties": false }, - "description": "Aggregation functions (GROUP BY)" + "description": "Aggregation functions" + }, + "groupBy": { + "type": "array", + "items": { + "type": "string" + }, + "description": "GROUP BY fields" + }, + "having": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ], + "description": "HAVING clause for aggregation filtering" }, "windowFunctions": { "type": "array", @@ -293,144 +382,6 @@ }, "description": "Window functions with OVER clause" }, - "filters": { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - } - } - ], - "description": "Filtering criteria" - }, - "joins": { - "type": "array", - "items": {}, - "description": "Table joins" - }, - "groupBy": { - "type": "array", - "items": { - "type": "string" - }, - "description": "GROUP BY fields" - }, - "having": { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - } - } - ], - "description": "HAVING clause for aggregation filtering" - }, - "sort": { - "type": "array", - "items": { - "type": "object", - "properties": { - "field": { - "type": "string" - }, - "order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - } - }, - "required": [ - "field" - ], - "additionalProperties": false - }, - "description": "Sorting instructions" - }, - "top": { - "type": "number", - "description": "Limit results" - }, - "skip": { - "type": "number", - "description": "Offset results" - }, "distinct": { "type": "boolean", "description": "SELECT DISTINCT flag" diff --git a/packages/spec/json-schema/data/Mapping.json b/packages/spec/json-schema/data/Mapping.json index 0c96e0dc4..b9e513299 100644 --- a/packages/spec/json-schema/data/Mapping.json +++ b/packages/spec/json-schema/data/Mapping.json @@ -158,6 +158,188 @@ }, "description": "Fields to retrieve" }, + "where": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ], + "description": "Filtering criteria (WHERE)" + }, + "orderBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, + "required": [ + "field" + ], + "additionalProperties": false + }, + "description": "Sorting instructions (ORDER BY)" + }, + "limit": { + "type": "number", + "description": "Max records to return (LIMIT)" + }, + "offset": { + "type": "number", + "description": "Records to skip (OFFSET)" + }, + "cursor": { + "type": "object", + "additionalProperties": {}, + "description": "Cursor for keyset pagination" + }, + "joins": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "inner", + "left", + "right", + "full" + ], + "description": "Join type" + }, + "object": { + "type": "string", + "description": "Object/table to join" + }, + "alias": { + "type": "string", + "description": "Table alias" + }, + "on": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ] + } + }, + "$or": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ] + } + }, + "$not": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ] + } + } + } + ], + "description": "Join condition" + }, + "subquery": { + "description": "Subquery instead of object" + } + }, + "required": [ + "type", + "object", + "on" + ], + "additionalProperties": false + }, + "description": "Explicit Table Joins" + }, "aggregations": { "type": "array", "items": { @@ -196,7 +378,37 @@ ], "additionalProperties": false }, - "description": "Aggregation functions (GROUP BY)" + "description": "Aggregation functions" + }, + "groupBy": { + "type": "array", + "items": { + "type": "string" + }, + "description": "GROUP BY fields" + }, + "having": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ], + "description": "HAVING clause for aggregation filtering" }, "windowFunctions": { "type": "array", @@ -300,267 +512,6 @@ }, "description": "Window functions with OVER clause" }, - "filters": { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - } - } - ], - "description": "Filtering criteria" - }, - "joins": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "inner", - "left", - "right", - "full" - ], - "description": "Join type" - }, - "object": { - "type": "string", - "description": "Object/table to join" - }, - "alias": { - "type": "string", - "description": "Table alias" - }, - "on": { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - } - } - ] - } - ] - } - } - ], - "description": "Join condition" - }, - "subquery": { - "description": "Subquery instead of object" - } - }, - "required": [ - "type", - "object", - "on" - ], - "additionalProperties": false - }, - "description": "Table joins" - }, - "groupBy": { - "type": "array", - "items": { - "type": "string" - }, - "description": "GROUP BY fields" - }, - "having": { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - } - } - ], - "description": "HAVING clause for aggregation filtering" - }, - "sort": { - "type": "array", - "items": { - "type": "object", - "properties": { - "field": { - "type": "string" - }, - "order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - } - }, - "required": [ - "field" - ], - "additionalProperties": false - }, - "description": "Sorting instructions" - }, - "top": { - "type": "number", - "description": "Limit results" - }, - "skip": { - "type": "number", - "description": "Offset results" - }, "distinct": { "type": "boolean", "description": "SELECT DISTINCT flag" diff --git a/packages/spec/json-schema/data/OWDModel.json b/packages/spec/json-schema/data/OWDModel.json index 5f73bc708..c141c7219 100644 --- a/packages/spec/json-schema/data/OWDModel.json +++ b/packages/spec/json-schema/data/OWDModel.json @@ -6,7 +6,8 @@ "enum": [ "private", "public_read", - "public_read_write" + "public_read_write", + "controlled_by_parent" ] } }, diff --git a/packages/spec/json-schema/data/Object.json b/packages/spec/json-schema/data/Object.json index d1efbe6a3..26bebf065 100644 --- a/packages/spec/json-schema/data/Object.json +++ b/packages/spec/json-schema/data/Object.json @@ -7,38 +7,55 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Machine name (snake_case)" + "description": "Machine unique key (snake_case). Immutable." }, "label": { "type": "string", - "description": "Singular Label (e.g. \"Account\")" + "description": "Human readable singular label (e.g. \"Account\")" }, "pluralLabel": { "type": "string", - "description": "Plural Label (e.g. \"Accounts\")" + "description": "Human readable plural label (e.g. \"Accounts\")" }, "description": { "type": "string", - "description": "Internal description" + "description": "Developer documentation / description" }, "icon": { "type": "string", - "description": "Lucide icon name" + "description": "Icon name (Lucide/Material) for UI representation" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g. \"sales\", \"system\", \"reference\")" + }, + "active": { + "type": "boolean", + "default": true, + "description": "Is the object active and usable" + }, + "isSystem": { + "type": "boolean", + "default": false, + "description": "Is system object (protected from deletion)" + }, + "abstract": { + "type": "boolean", + "default": false, + "description": "Is abstract base object (cannot be instantiated)" }, "datasource": { "type": "string", "default": "default", - "description": "Target Datasource ID (e.g. \"postgres\", \"salesforce\"). references sys_datasource." + "description": "Target Datasource ID. \"default\" is the primary DB." }, "tableName": { "type": "string", "description": "Physical table/collection name in the target datasource" }, - "isSystem": { - "type": "boolean", - "default": false, - "description": "Is system object (protected)" - }, "fields": { "type": "object", "additionalProperties": { @@ -404,7 +421,7 @@ ], "additionalProperties": false }, - "description": "Map of field definitions" + "description": "Field definitions map" }, "indexes": { "type": "array", @@ -425,6 +442,16 @@ "unique": { "type": "boolean", "description": "Whether the index is unique" + }, + "type": { + "type": "string", + "enum": [ + "btree", + "hash", + "gin", + "gist" + ], + "description": "Index type (default: btree)" } }, "required": [ @@ -432,26 +459,1516 @@ ], "additionalProperties": false }, - "description": "Database indexes definition" + "description": "Database performance indexes" }, - "nameField": { + "validations": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "script" + }, + "condition": { + "type": "string", + "description": "Formula expression. If TRUE, validation fails. (e.g. amount < 0)" + } + }, + "required": [ + "name", + "message", + "type", + "condition" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "unique" + }, + "fields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fields that must be combined unique" + }, + "scope": { + "type": "string", + "description": "Formula condition for scope (e.g. active = true)" + }, + "caseSensitive": { + "type": "boolean", + "default": true + } + }, + "required": [ + "name", + "message", + "type", + "fields" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "state_machine" + }, + "field": { + "type": "string", + "description": "State field (e.g. status)" + }, + "transitions": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Map of { OldState: [AllowedNewStates] }" + } + }, + "required": [ + "name", + "message", + "type", + "field", + "transitions" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "format" + }, + "field": { + "type": "string" + }, + "regex": { + "type": "string" + }, + "format": { + "type": "string", + "enum": [ + "email", + "url", + "phone", + "json" + ] + } + }, + "required": [ + "name", + "message", + "type", + "field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "cross_field" + }, + "condition": { + "type": "string", + "description": "Formula expression comparing fields (e.g. \"end_date > start_date\")" + }, + "fields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fields involved in the validation" + } + }, + "required": [ + "name", + "message", + "type", + "condition", + "fields" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "json_schema" + }, + "field": { + "type": "string", + "description": "JSON field to validate" + }, + "schema": { + "type": "object", + "additionalProperties": {}, + "description": "JSON Schema object definition" + } + }, + "required": [ + "name", + "message", + "type", + "field", + "schema" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "async" + }, + "field": { + "type": "string", + "description": "Field to validate" + }, + "validatorUrl": { + "type": "string", + "description": "External API endpoint for validation" + }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "default": "GET", + "description": "HTTP method for external call" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom headers for the request" + }, + "validatorFunction": { + "type": "string", + "description": "Reference to custom validator function" + }, + "timeout": { + "type": "number", + "default": 5000, + "description": "Timeout in milliseconds" + }, + "debounce": { + "type": "number", + "description": "Debounce delay in milliseconds" + }, + "params": { + "type": "object", + "additionalProperties": {}, + "description": "Additional parameters to pass to validator" + } + }, + "required": [ + "name", + "message", + "type", + "field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "custom" + }, + "field": { + "type": "string", + "description": "Field to validate" + }, + "validatorFunction": { + "type": "string", + "description": "Reference to custom validator function" + }, + "params": { + "type": "object", + "additionalProperties": {}, + "description": "Additional parameters to pass to validator" + } + }, + "required": [ + "name", + "message", + "type", + "field", + "validatorFunction" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "conditional" + }, + "when": { + "type": "string", + "description": "Condition formula (e.g. \"type = 'enterprise'\")" + }, + "then": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "script" + }, + "condition": { + "type": "string", + "description": "Formula expression. If TRUE, validation fails. (e.g. amount < 0)" + } + }, + "required": [ + "name", + "message", + "type", + "condition" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "unique" + }, + "fields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fields that must be combined unique" + }, + "scope": { + "type": "string", + "description": "Formula condition for scope (e.g. active = true)" + }, + "caseSensitive": { + "type": "boolean", + "default": true + } + }, + "required": [ + "name", + "message", + "type", + "fields" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "state_machine" + }, + "field": { + "type": "string", + "description": "State field (e.g. status)" + }, + "transitions": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Map of { OldState: [AllowedNewStates] }" + } + }, + "required": [ + "name", + "message", + "type", + "field", + "transitions" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "format" + }, + "field": { + "type": "string" + }, + "regex": { + "type": "string" + }, + "format": { + "type": "string", + "enum": [ + "email", + "url", + "phone", + "json" + ] + } + }, + "required": [ + "name", + "message", + "type", + "field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "cross_field" + }, + "condition": { + "type": "string", + "description": "Formula expression comparing fields (e.g. \"end_date > start_date\")" + }, + "fields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fields involved in the validation" + } + }, + "required": [ + "name", + "message", + "type", + "condition", + "fields" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "json_schema" + }, + "field": { + "type": "string", + "description": "JSON field to validate" + }, + "schema": { + "type": "object", + "additionalProperties": {}, + "description": "JSON Schema object definition" + } + }, + "required": [ + "name", + "message", + "type", + "field", + "schema" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "async" + }, + "field": { + "type": "string", + "description": "Field to validate" + }, + "validatorUrl": { + "type": "string", + "description": "External API endpoint for validation" + }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "default": "GET", + "description": "HTTP method for external call" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom headers for the request" + }, + "validatorFunction": { + "type": "string", + "description": "Reference to custom validator function" + }, + "timeout": { + "type": "number", + "default": 5000, + "description": "Timeout in milliseconds" + }, + "debounce": { + "type": "number", + "description": "Debounce delay in milliseconds" + }, + "params": { + "type": "object", + "additionalProperties": {}, + "description": "Additional parameters to pass to validator" + } + }, + "required": [ + "name", + "message", + "type", + "field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "custom" + }, + "field": { + "type": "string", + "description": "Field to validate" + }, + "validatorFunction": { + "type": "string", + "description": "Reference to custom validator function" + }, + "params": { + "type": "object", + "additionalProperties": {}, + "description": "Additional parameters to pass to validator" + } + }, + "required": [ + "name", + "message", + "type", + "field", + "validatorFunction" + ], + "additionalProperties": false + }, + {} + ], + "description": "Validation rule to apply when condition is true" + }, + "otherwise": { + "description": "Validation rule to apply when condition is false" + } + }, + "required": [ + "name", + "message", + "type", + "when", + "then" + ], + "additionalProperties": false + } + ] + }, + "description": "Object-level validation rules" + }, + "titleFormat": { "type": "string", - "description": "Which field represents the record name/title (usually \"name\")" + "description": "Title expression (e.g. \"{name} - {code}\"). Overrides nameField." + }, + "compactLayout": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Primary fields for hover/cards/lookups" + }, + "search": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fields to index for full-text search weighting" + }, + "displayFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fields to display in search result cards" + }, + "filters": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Default filters for search results" + } + }, + "required": [ + "fields" + ], + "additionalProperties": false, + "description": "Search engine configuration" }, "enable": { "type": "object", "properties": { "trackHistory": { "type": "boolean", - "default": false + "default": false, + "description": "Enable field history tracking for audit compliance" }, "searchable": { "type": "boolean", - "default": true + "default": true, + "description": "Index records for global search" }, "apiEnabled": { "type": "boolean", - "default": true + "default": true, + "description": "Expose object via automatic APIs" }, "apiMethods": { "type": "array", @@ -464,10 +1981,7 @@ "update", "delete", "upsert", - "bulkCreate", - "bulkUpdate", - "bulkDelete", - "bulkUpsert", + "bulk", "aggregate", "history", "search", @@ -477,23 +1991,41 @@ "export" ] }, - "description": "Allowed API operations" + "description": "Whitelist of allowed API operations" }, "files": { "type": "boolean", - "default": false + "default": false, + "description": "Enable file attachments and document management" }, - "feedEnabled": { + "feeds": { "type": "boolean", - "default": false + "default": false, + "description": "Enable social feed, comments, and mentions (Chatter-like)" + }, + "activities": { + "type": "boolean", + "default": false, + "description": "Enable standard tasks and events tracking" }, "trash": { "type": "boolean", - "default": true + "default": true, + "description": "Enable soft-delete with restore capability" + }, + "mru": { + "type": "boolean", + "default": true, + "description": "Track Most Recently Used (MRU) list for users" + }, + "clone": { + "type": "boolean", + "default": true, + "description": "Allow record deep cloning" } }, "additionalProperties": false, - "description": "Enabled system capabilities" + "description": "Enabled system features modules" } }, "required": [ diff --git a/packages/spec/json-schema/data/ObjectCapabilities.json b/packages/spec/json-schema/data/ObjectCapabilities.json index 4a08e6d3d..e3d6c73cb 100644 --- a/packages/spec/json-schema/data/ObjectCapabilities.json +++ b/packages/spec/json-schema/data/ObjectCapabilities.json @@ -6,15 +6,18 @@ "properties": { "trackHistory": { "type": "boolean", - "default": false + "default": false, + "description": "Enable field history tracking for audit compliance" }, "searchable": { "type": "boolean", - "default": true + "default": true, + "description": "Index records for global search" }, "apiEnabled": { "type": "boolean", - "default": true + "default": true, + "description": "Expose object via automatic APIs" }, "apiMethods": { "type": "array", @@ -27,10 +30,7 @@ "update", "delete", "upsert", - "bulkCreate", - "bulkUpdate", - "bulkDelete", - "bulkUpsert", + "bulk", "aggregate", "history", "search", @@ -40,19 +40,37 @@ "export" ] }, - "description": "Allowed API operations" + "description": "Whitelist of allowed API operations" }, "files": { "type": "boolean", - "default": false + "default": false, + "description": "Enable file attachments and document management" }, - "feedEnabled": { + "feeds": { "type": "boolean", - "default": false + "default": false, + "description": "Enable social feed, comments, and mentions (Chatter-like)" + }, + "activities": { + "type": "boolean", + "default": false, + "description": "Enable standard tasks and events tracking" }, "trash": { "type": "boolean", - "default": true + "default": true, + "description": "Enable soft-delete with restore capability" + }, + "mru": { + "type": "boolean", + "default": true, + "description": "Track Most Recently Used (MRU) list for users" + }, + "clone": { + "type": "boolean", + "default": true, + "description": "Allow record deep cloning" } }, "additionalProperties": false diff --git a/packages/spec/json-schema/data/ObjectPermission.json b/packages/spec/json-schema/data/ObjectPermission.json index 83a2857d4..3bbe98405 100644 --- a/packages/spec/json-schema/data/ObjectPermission.json +++ b/packages/spec/json-schema/data/ObjectPermission.json @@ -24,6 +24,21 @@ "default": false, "description": "Delete permission" }, + "allowTransfer": { + "type": "boolean", + "default": false, + "description": "Change record ownership" + }, + "allowRestore": { + "type": "boolean", + "default": false, + "description": "Restore from trash (Undelete)" + }, + "allowPurge": { + "type": "boolean", + "default": false, + "description": "Permanently delete (Hard Delete/GDPR)" + }, "viewAllRecords": { "type": "boolean", "default": false, diff --git a/packages/spec/json-schema/data/OwnerSharingRule.json b/packages/spec/json-schema/data/OwnerSharingRule.json new file mode 100644 index 000000000..a97ffa6bf --- /dev/null +++ b/packages/spec/json-schema/data/OwnerSharingRule.json @@ -0,0 +1,102 @@ +{ + "$ref": "#/definitions/OwnerSharingRule", + "definitions": { + "OwnerSharingRule": { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label" + }, + "description": { + "type": "string", + "description": "Administrative notes" + }, + "object": { + "type": "string", + "description": "Target Object Name" + }, + "active": { + "type": "boolean", + "default": true + }, + "accessLevel": { + "type": "string", + "enum": [ + "read", + "edit", + "full" + ], + "default": "read" + }, + "sharedWith": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "group", + "role", + "role_and_subordinates", + "guest" + ] + }, + "value": { + "type": "string", + "description": "ID or Code of the User/Group/Role" + } + }, + "required": [ + "type", + "value" + ], + "additionalProperties": false, + "description": "The recipient of the shared access" + }, + "type": { + "type": "string", + "const": "owner" + }, + "ownedBy": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "group", + "role", + "role_and_subordinates", + "guest" + ] + }, + "value": { + "type": "string" + } + }, + "required": [ + "type", + "value" + ], + "additionalProperties": false, + "description": "Source group/role whose records are being shared" + } + }, + "required": [ + "name", + "object", + "sharedWith", + "type", + "ownedBy" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/PermissionSet.json b/packages/spec/json-schema/data/PermissionSet.json index c4cb4869a..1fbace953 100644 --- a/packages/spec/json-schema/data/PermissionSet.json +++ b/packages/spec/json-schema/data/PermissionSet.json @@ -42,6 +42,21 @@ "default": false, "description": "Delete permission" }, + "allowTransfer": { + "type": "boolean", + "default": false, + "description": "Change record ownership" + }, + "allowRestore": { + "type": "boolean", + "default": false, + "description": "Restore from trash (Undelete)" + }, + "allowPurge": { + "type": "boolean", + "default": false, + "description": "Permanently delete (Hard Delete/GDPR)" + }, "viewAllRecords": { "type": "boolean", "default": false, diff --git a/packages/spec/json-schema/data/Query.json b/packages/spec/json-schema/data/Query.json index e690ae9d1..bbdb5671e 100644 --- a/packages/spec/json-schema/data/Query.json +++ b/packages/spec/json-schema/data/Query.json @@ -38,6 +38,188 @@ }, "description": "Fields to retrieve" }, + "where": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ], + "description": "Filtering criteria (WHERE)" + }, + "orderBy": { + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, + "required": [ + "field" + ], + "additionalProperties": false + }, + "description": "Sorting instructions (ORDER BY)" + }, + "limit": { + "type": "number", + "description": "Max records to return (LIMIT)" + }, + "offset": { + "type": "number", + "description": "Records to skip (OFFSET)" + }, + "cursor": { + "type": "object", + "additionalProperties": {}, + "description": "Cursor for keyset pagination" + }, + "joins": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "inner", + "left", + "right", + "full" + ], + "description": "Join type" + }, + "object": { + "type": "string", + "description": "Object/table to join" + }, + "alias": { + "type": "string", + "description": "Table alias" + }, + "on": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ] + } + }, + "$or": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ] + } + }, + "$not": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ] + } + } + } + ], + "description": "Join condition" + }, + "subquery": { + "description": "Subquery instead of object" + } + }, + "required": [ + "type", + "object", + "on" + ], + "additionalProperties": false + }, + "description": "Explicit Table Joins" + }, "aggregations": { "type": "array", "items": { @@ -76,7 +258,37 @@ ], "additionalProperties": false }, - "description": "Aggregation functions (GROUP BY)" + "description": "Aggregation functions" + }, + "groupBy": { + "type": "array", + "items": { + "type": "string" + }, + "description": "GROUP BY fields" + }, + "having": { + "allOf": [ + { + "type": "object", + "additionalProperties": {} + }, + { + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": {} + }, + "$or": { + "type": "array", + "items": {} + }, + "$not": {} + } + } + ], + "description": "HAVING clause for aggregation filtering" }, "windowFunctions": { "type": "array", @@ -180,267 +392,6 @@ }, "description": "Window functions with OVER clause" }, - "filters": { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - } - } - ], - "description": "Filtering criteria" - }, - "joins": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "inner", - "left", - "right", - "full" - ], - "description": "Join type" - }, - "object": { - "type": "string", - "description": "Object/table to join" - }, - "alias": { - "type": "string", - "description": "Table alias" - }, - "on": { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - } - } - ] - } - ] - } - } - ], - "description": "Join condition" - }, - "subquery": { - "description": "Subquery instead of object" - } - }, - "required": [ - "type", - "object", - "on" - ], - "additionalProperties": false - }, - "description": "Table joins" - }, - "groupBy": { - "type": "array", - "items": { - "type": "string" - }, - "description": "GROUP BY fields" - }, - "having": { - "anyOf": [ - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "=", - "!=", - "<>", - ">", - ">=", - "<", - "<=", - "startswith", - "contains", - "notcontains", - "between", - "in", - "notin", - "is_null", - "is_not_null" - ] - }, - {} - ] - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - } - } - ], - "description": "HAVING clause for aggregation filtering" - }, - "sort": { - "type": "array", - "items": { - "type": "object", - "properties": { - "field": { - "type": "string" - }, - "order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - } - }, - "required": [ - "field" - ], - "additionalProperties": false - }, - "description": "Sorting instructions" - }, - "top": { - "type": "number", - "description": "Limit results" - }, - "skip": { - "type": "number", - "description": "Offset results" - }, "distinct": { "type": "boolean", "description": "SELECT DISTINCT flag" diff --git a/packages/spec/json-schema/data/ScriptValidation.json b/packages/spec/json-schema/data/ScriptValidation.json index 32a1ed7e7..ca487d5a4 100644 --- a/packages/spec/json-schema/data/ScriptValidation.json +++ b/packages/spec/json-schema/data/ScriptValidation.json @@ -7,12 +7,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -24,7 +55,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", diff --git a/packages/spec/json-schema/data/SearchConfig.json b/packages/spec/json-schema/data/SearchConfig.json new file mode 100644 index 000000000..61ba0336d --- /dev/null +++ b/packages/spec/json-schema/data/SearchConfig.json @@ -0,0 +1,36 @@ +{ + "$ref": "#/definitions/SearchConfig", + "definitions": { + "SearchConfig": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fields to index for full-text search weighting" + }, + "displayFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fields to display in search result cards" + }, + "filters": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Default filters for search results" + } + }, + "required": [ + "fields" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/ShareRecipientType.json b/packages/spec/json-schema/data/ShareRecipientType.json new file mode 100644 index 000000000..115442f93 --- /dev/null +++ b/packages/spec/json-schema/data/ShareRecipientType.json @@ -0,0 +1,16 @@ +{ + "$ref": "#/definitions/ShareRecipientType", + "definitions": { + "ShareRecipientType": { + "type": "string", + "enum": [ + "user", + "group", + "role", + "role_and_subordinates", + "guest" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/SharingLevel.json b/packages/spec/json-schema/data/SharingLevel.json index 3826b8e6e..352933e04 100644 --- a/packages/spec/json-schema/data/SharingLevel.json +++ b/packages/spec/json-schema/data/SharingLevel.json @@ -5,7 +5,8 @@ "type": "string", "enum": [ "read", - "edit" + "edit", + "full" ] } }, diff --git a/packages/spec/json-schema/data/SharingRule.json b/packages/spec/json-schema/data/SharingRule.json index 6070e5a71..81885b288 100644 --- a/packages/spec/json-schema/data/SharingRule.json +++ b/packages/spec/json-schema/data/SharingRule.json @@ -2,56 +2,180 @@ "$ref": "#/definitions/SharingRule", "definitions": { "SharingRule": { - "type": "object", - "properties": { - "name": { - "type": "string", - "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" - }, - "label": { - "type": "string" - }, - "active": { - "type": "boolean", - "default": true - }, - "object": { - "type": "string", - "description": "Object to share" - }, - "type": { - "type": "string", - "enum": [ - "owner", - "criteria", - "manual", - "guest" + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label" + }, + "description": { + "type": "string", + "description": "Administrative notes" + }, + "object": { + "type": "string", + "description": "Target Object Name" + }, + "active": { + "type": "boolean", + "default": true + }, + "accessLevel": { + "type": "string", + "enum": [ + "read", + "edit", + "full" + ], + "default": "read" + }, + "sharedWith": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "group", + "role", + "role_and_subordinates", + "guest" + ] + }, + "value": { + "type": "string", + "description": "ID or Code of the User/Group/Role" + } + }, + "required": [ + "type", + "value" + ], + "additionalProperties": false, + "description": "The recipient of the shared access" + }, + "type": { + "type": "string", + "const": "criteria" + }, + "condition": { + "type": "string", + "description": "Formula condition (e.g. \"department = 'Sales'\")" + } + }, + "required": [ + "name", + "object", + "sharedWith", + "type", + "condition" ], - "default": "criteria" - }, - "criteria": { - "type": "string" + "additionalProperties": false }, - "accessLevel": { - "type": "string", - "enum": [ - "read", - "edit" + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label" + }, + "description": { + "type": "string", + "description": "Administrative notes" + }, + "object": { + "type": "string", + "description": "Target Object Name" + }, + "active": { + "type": "boolean", + "default": true + }, + "accessLevel": { + "type": "string", + "enum": [ + "read", + "edit", + "full" + ], + "default": "read" + }, + "sharedWith": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "group", + "role", + "role_and_subordinates", + "guest" + ] + }, + "value": { + "type": "string", + "description": "ID or Code of the User/Group/Role" + } + }, + "required": [ + "type", + "value" + ], + "additionalProperties": false, + "description": "The recipient of the shared access" + }, + "type": { + "type": "string", + "const": "owner" + }, + "ownedBy": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "group", + "role", + "role_and_subordinates", + "guest" + ] + }, + "value": { + "type": "string" + } + }, + "required": [ + "type", + "value" + ], + "additionalProperties": false, + "description": "Source group/role whose records are being shared" + } + }, + "required": [ + "name", + "object", + "sharedWith", + "type", + "ownedBy" ], - "default": "read" - }, - "sharedWith": { - "type": "string", - "description": "Group/Role ID to share records with" + "additionalProperties": false } - }, - "required": [ - "name", - "object", - "sharedWith" - ], - "additionalProperties": false + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" diff --git a/packages/spec/json-schema/data/SharingRuleType.json b/packages/spec/json-schema/data/SharingRuleType.json index b812ba315..4d3df76c8 100644 --- a/packages/spec/json-schema/data/SharingRuleType.json +++ b/packages/spec/json-schema/data/SharingRuleType.json @@ -5,9 +5,7 @@ "type": "string", "enum": [ "owner", - "criteria", - "manual", - "guest" + "criteria" ] } }, diff --git a/packages/spec/json-schema/data/StateMachineValidation.json b/packages/spec/json-schema/data/StateMachineValidation.json index 17c1642b9..d56a858bb 100644 --- a/packages/spec/json-schema/data/StateMachineValidation.json +++ b/packages/spec/json-schema/data/StateMachineValidation.json @@ -7,12 +7,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -24,7 +55,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", diff --git a/packages/spec/json-schema/data/TimeTrigger.json b/packages/spec/json-schema/data/TimeTrigger.json new file mode 100644 index 000000000..5bcbbf1fd --- /dev/null +++ b/packages/spec/json-schema/data/TimeTrigger.json @@ -0,0 +1,519 @@ +{ + "$ref": "#/definitions/TimeTrigger", + "definitions": { + "TimeTrigger": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier" + }, + "timeLength": { + "type": "integer", + "description": "Duration amount (e.g. 1, 30)" + }, + "timeUnit": { + "type": "string", + "enum": [ + "minutes", + "hours", + "days" + ], + "description": "Unit of time" + }, + "offsetDirection": { + "type": "string", + "enum": [ + "before", + "after" + ], + "description": "Before or After the reference date" + }, + "offsetFrom": { + "type": "string", + "enum": [ + "trigger_date", + "date_field" + ], + "description": "Basis for calculation" + }, + "dateField": { + "type": "string", + "description": "Date field to calculate from (required if offsetFrom is date_field)" + }, + "actions": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "field_update" + }, + "field": { + "type": "string", + "description": "Field to update" + }, + "value": { + "description": "Value or Formula to set" + } + }, + "required": [ + "name", + "type", + "field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "email_alert" + }, + "template": { + "type": "string", + "description": "Email template ID/DevName" + }, + "recipients": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of recipient emails or user IDs" + } + }, + "required": [ + "name", + "type", + "template", + "recipients" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "sms_notification" + }, + "provider": { + "type": "string", + "enum": [ + "twilio", + "vonage" + ], + "description": "SMS provider" + }, + "recipients": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of phone numbers or user field references" + }, + "message": { + "type": "string", + "description": "SMS message text or template" + }, + "fromNumber": { + "type": "string", + "description": "Sender phone number (provider-specific)" + } + }, + "required": [ + "name", + "type", + "provider", + "recipients", + "message" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "slack_message" + }, + "channel": { + "type": "string", + "description": "Slack channel ID or name (#channel)" + }, + "message": { + "type": "string", + "description": "Message text with optional markdown" + }, + "mentions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "User IDs or @username to mention" + }, + "threadId": { + "type": "string", + "description": "Thread ID for replies" + } + }, + "required": [ + "name", + "type", + "channel", + "message" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "teams_message" + }, + "channel": { + "type": "string", + "description": "Teams channel ID" + }, + "message": { + "type": "string", + "description": "Message text with optional markdown" + }, + "mentions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "User IDs to mention" + }, + "teamId": { + "type": "string", + "description": "Team ID (if not in default team)" + } + }, + "required": [ + "name", + "type", + "channel", + "message" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "http_call" + }, + "url": { + "type": "string", + "description": "Target URL" + }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE" + ], + "description": "HTTP method" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Request headers" + }, + "body": { + "description": "Request body (object/string)" + }, + "authentication": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "none", + "basic", + "bearer", + "api_key", + "oauth2" + ] + }, + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": false, + "description": "Authentication configuration" + }, + "timeout": { + "type": "number", + "description": "Request timeout in milliseconds" + } + }, + "required": [ + "name", + "type", + "url", + "method" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "webhook_trigger" + }, + "url": { + "type": "string", + "description": "Webhook URL to call" + }, + "method": { + "type": "string", + "enum": [ + "POST", + "PUT" + ], + "default": "POST", + "description": "HTTP method" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom headers" + }, + "payload": { + "description": "Webhook payload (uses record data if not specified)" + }, + "retryOnFailure": { + "type": "boolean", + "default": true, + "description": "Retry if webhook fails" + }, + "maxRetries": { + "type": "number", + "default": 3, + "description": "Maximum retry attempts" + } + }, + "required": [ + "name", + "type", + "url" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "task_creation" + }, + "taskObject": { + "type": "string", + "description": "Task object name (e.g., \"task\", \"project_task\")" + }, + "subject": { + "type": "string", + "description": "Task subject/title" + }, + "description": { + "type": "string", + "description": "Task description" + }, + "assignedTo": { + "type": "string", + "description": "User ID or field reference for assignee" + }, + "dueDate": { + "type": "string", + "description": "Due date (ISO string or formula)" + }, + "priority": { + "type": "string", + "description": "Task priority" + }, + "relatedTo": { + "type": "string", + "description": "Related record ID or field reference" + }, + "additionalFields": { + "type": "object", + "additionalProperties": {}, + "description": "Additional custom fields" + } + }, + "required": [ + "name", + "type", + "taskObject", + "subject" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "push_notification" + }, + "title": { + "type": "string", + "description": "Notification title" + }, + "body": { + "type": "string", + "description": "Notification body text" + }, + "recipients": { + "type": "array", + "items": { + "type": "string" + }, + "description": "User IDs or device tokens" + }, + "data": { + "type": "object", + "additionalProperties": {}, + "description": "Additional data payload" + }, + "badge": { + "type": "number", + "description": "Badge count (iOS)" + }, + "sound": { + "type": "string", + "description": "Notification sound" + }, + "clickAction": { + "type": "string", + "description": "Action/URL when notification is clicked" + } + }, + "required": [ + "name", + "type", + "title", + "body", + "recipients" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "custom_script" + }, + "language": { + "type": "string", + "enum": [ + "javascript", + "typescript", + "python" + ], + "default": "javascript", + "description": "Script language" + }, + "code": { + "type": "string", + "description": "Script code to execute" + }, + "timeout": { + "type": "number", + "default": 30000, + "description": "Execution timeout in milliseconds" + }, + "context": { + "type": "object", + "additionalProperties": {}, + "description": "Additional context variables" + } + }, + "required": [ + "name", + "type", + "code" + ], + "additionalProperties": false + } + ] + }, + "description": "Actions to execute at the scheduled time" + } + }, + "required": [ + "timeLength", + "timeUnit", + "offsetDirection", + "offsetFrom", + "actions" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/data/UniquenessValidation.json b/packages/spec/json-schema/data/UniquenessValidation.json index a58666893..fab66e362 100644 --- a/packages/spec/json-schema/data/UniquenessValidation.json +++ b/packages/spec/json-schema/data/UniquenessValidation.json @@ -7,12 +7,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -24,7 +55,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", diff --git a/packages/spec/json-schema/data/ValidationRule.json b/packages/spec/json-schema/data/ValidationRule.json index 13f76a2e8..0acec3392 100644 --- a/packages/spec/json-schema/data/ValidationRule.json +++ b/packages/spec/json-schema/data/ValidationRule.json @@ -9,12 +9,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -26,7 +57,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -51,12 +82,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -68,7 +130,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -104,12 +166,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -121,7 +214,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -157,12 +250,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -174,7 +298,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -210,12 +334,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -227,7 +382,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -260,12 +415,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -277,7 +463,86 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "json_schema" + }, + "field": { + "type": "string", + "description": "JSON field to validate" + }, + "schema": { + "type": "object", + "additionalProperties": {}, + "description": "JSON Schema object definition" + } + }, + "required": [ + "name", + "message", + "type", + "field", + "schema" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -291,6 +556,22 @@ "type": "string", "description": "External API endpoint for validation" }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "default": "GET", + "description": "HTTP method for external call" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom headers for the request" + }, "validatorFunction": { "type": "string", "description": "Reference to custom validator function" @@ -324,12 +605,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -341,7 +653,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -349,22 +661,23 @@ }, "field": { "type": "string", - "description": "Field to validate (optional for record-level validation)" + "description": "Field to validate" }, "validatorFunction": { "type": "string", - "description": "Function name or reference to custom validator" + "description": "Reference to custom validator function" }, "params": { "type": "object", "additionalProperties": {}, - "description": "Additional parameters for the validator" + "description": "Additional parameters to pass to validator" } }, "required": [ "name", "message", "type", + "field", "validatorFunction" ], "additionalProperties": false @@ -375,12 +688,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -392,7 +736,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -410,12 +754,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -427,7 +802,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -452,12 +827,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -469,7 +875,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -505,12 +911,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -522,7 +959,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -558,12 +995,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -575,7 +1043,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -611,12 +1079,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -628,7 +1127,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -661,12 +1160,122 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, + "severity": { + "type": "string", + "enum": [ + "error", + "warning", + "info" + ], + "default": "error" + }, + "message": { + "type": "string", + "description": "Error message to display to the user" + }, + "type": { + "type": "string", + "const": "json_schema" + }, + "field": { + "type": "string", + "description": "JSON field to validate" + }, + "schema": { + "type": "object", + "additionalProperties": {}, + "description": "JSON Schema object definition" + } + }, + "required": [ + "name", + "message", + "type", + "field", + "schema" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" + }, + "active": { + "type": "boolean", + "default": true + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -678,7 +1287,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -692,6 +1301,22 @@ "type": "string", "description": "External API endpoint for validation" }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "default": "GET", + "description": "HTTP method for external call" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom headers for the request" + }, "validatorFunction": { "type": "string", "description": "Reference to custom validator function" @@ -725,12 +1350,43 @@ "name": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$", - "description": "Unique rule name" + "description": "Unique rule name (snake_case)" + }, + "label": { + "type": "string", + "description": "Human-readable label for the rule listing" + }, + "description": { + "type": "string", + "description": "Administrative notes explaining the business reason" }, "active": { "type": "boolean", "default": true }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "insert", + "update", + "delete" + ] + }, + "default": [ + "insert", + "update" + ], + "description": "Trigger contexts" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Categorization tags (e.g., \"compliance\", \"billing\")" + }, "severity": { "type": "string", "enum": [ @@ -742,7 +1398,7 @@ }, "message": { "type": "string", - "description": "Error message to display" + "description": "Error message to display to the user" }, "type": { "type": "string", @@ -750,22 +1406,23 @@ }, "field": { "type": "string", - "description": "Field to validate (optional for record-level validation)" + "description": "Field to validate" }, "validatorFunction": { "type": "string", - "description": "Function name or reference to custom validator" + "description": "Reference to custom validator function" }, "params": { "type": "object", "additionalProperties": {}, - "description": "Additional parameters for the validator" + "description": "Additional parameters to pass to validator" } }, "required": [ "name", "message", "type", + "field", "validatorFunction" ], "additionalProperties": false diff --git a/packages/spec/json-schema/data/WorkflowRule.json b/packages/spec/json-schema/data/WorkflowRule.json index 64c0f5f64..ead248c62 100644 --- a/packages/spec/json-schema/data/WorkflowRule.json +++ b/packages/spec/json-schema/data/WorkflowRule.json @@ -491,10 +491,532 @@ }, "description": "Immediate actions" }, + "timeTriggers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier" + }, + "timeLength": { + "type": "integer", + "description": "Duration amount (e.g. 1, 30)" + }, + "timeUnit": { + "type": "string", + "enum": [ + "minutes", + "hours", + "days" + ], + "description": "Unit of time" + }, + "offsetDirection": { + "type": "string", + "enum": [ + "before", + "after" + ], + "description": "Before or After the reference date" + }, + "offsetFrom": { + "type": "string", + "enum": [ + "trigger_date", + "date_field" + ], + "description": "Basis for calculation" + }, + "dateField": { + "type": "string", + "description": "Date field to calculate from (required if offsetFrom is date_field)" + }, + "actions": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "field_update" + }, + "field": { + "type": "string", + "description": "Field to update" + }, + "value": { + "description": "Value or Formula to set" + } + }, + "required": [ + "name", + "type", + "field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "email_alert" + }, + "template": { + "type": "string", + "description": "Email template ID/DevName" + }, + "recipients": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of recipient emails or user IDs" + } + }, + "required": [ + "name", + "type", + "template", + "recipients" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "sms_notification" + }, + "provider": { + "type": "string", + "enum": [ + "twilio", + "vonage" + ], + "description": "SMS provider" + }, + "recipients": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of phone numbers or user field references" + }, + "message": { + "type": "string", + "description": "SMS message text or template" + }, + "fromNumber": { + "type": "string", + "description": "Sender phone number (provider-specific)" + } + }, + "required": [ + "name", + "type", + "provider", + "recipients", + "message" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "slack_message" + }, + "channel": { + "type": "string", + "description": "Slack channel ID or name (#channel)" + }, + "message": { + "type": "string", + "description": "Message text with optional markdown" + }, + "mentions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "User IDs or @username to mention" + }, + "threadId": { + "type": "string", + "description": "Thread ID for replies" + } + }, + "required": [ + "name", + "type", + "channel", + "message" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "teams_message" + }, + "channel": { + "type": "string", + "description": "Teams channel ID" + }, + "message": { + "type": "string", + "description": "Message text with optional markdown" + }, + "mentions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "User IDs to mention" + }, + "teamId": { + "type": "string", + "description": "Team ID (if not in default team)" + } + }, + "required": [ + "name", + "type", + "channel", + "message" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "http_call" + }, + "url": { + "type": "string", + "description": "Target URL" + }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE" + ], + "description": "HTTP method" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Request headers" + }, + "body": { + "description": "Request body (object/string)" + }, + "authentication": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "none", + "basic", + "bearer", + "api_key", + "oauth2" + ] + }, + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": false, + "description": "Authentication configuration" + }, + "timeout": { + "type": "number", + "description": "Request timeout in milliseconds" + } + }, + "required": [ + "name", + "type", + "url", + "method" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "webhook_trigger" + }, + "url": { + "type": "string", + "description": "Webhook URL to call" + }, + "method": { + "type": "string", + "enum": [ + "POST", + "PUT" + ], + "default": "POST", + "description": "HTTP method" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom headers" + }, + "payload": { + "description": "Webhook payload (uses record data if not specified)" + }, + "retryOnFailure": { + "type": "boolean", + "default": true, + "description": "Retry if webhook fails" + }, + "maxRetries": { + "type": "number", + "default": 3, + "description": "Maximum retry attempts" + } + }, + "required": [ + "name", + "type", + "url" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "task_creation" + }, + "taskObject": { + "type": "string", + "description": "Task object name (e.g., \"task\", \"project_task\")" + }, + "subject": { + "type": "string", + "description": "Task subject/title" + }, + "description": { + "type": "string", + "description": "Task description" + }, + "assignedTo": { + "type": "string", + "description": "User ID or field reference for assignee" + }, + "dueDate": { + "type": "string", + "description": "Due date (ISO string or formula)" + }, + "priority": { + "type": "string", + "description": "Task priority" + }, + "relatedTo": { + "type": "string", + "description": "Related record ID or field reference" + }, + "additionalFields": { + "type": "object", + "additionalProperties": {}, + "description": "Additional custom fields" + } + }, + "required": [ + "name", + "type", + "taskObject", + "subject" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "push_notification" + }, + "title": { + "type": "string", + "description": "Notification title" + }, + "body": { + "type": "string", + "description": "Notification body text" + }, + "recipients": { + "type": "array", + "items": { + "type": "string" + }, + "description": "User IDs or device tokens" + }, + "data": { + "type": "object", + "additionalProperties": {}, + "description": "Additional data payload" + }, + "badge": { + "type": "number", + "description": "Badge count (iOS)" + }, + "sound": { + "type": "string", + "description": "Notification sound" + }, + "clickAction": { + "type": "string", + "description": "Action/URL when notification is clicked" + } + }, + "required": [ + "name", + "type", + "title", + "body", + "recipients" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name" + }, + "type": { + "type": "string", + "const": "custom_script" + }, + "language": { + "type": "string", + "enum": [ + "javascript", + "typescript", + "python" + ], + "default": "javascript", + "description": "Script language" + }, + "code": { + "type": "string", + "description": "Script code to execute" + }, + "timeout": { + "type": "number", + "default": 30000, + "description": "Execution timeout in milliseconds" + }, + "context": { + "type": "object", + "additionalProperties": {}, + "description": "Additional context variables" + } + }, + "required": [ + "name", + "type", + "code" + ], + "additionalProperties": false + } + ] + }, + "description": "Actions to execute at the scheduled time" + } + }, + "required": [ + "timeLength", + "timeUnit", + "offsetDirection", + "offsetFrom", + "actions" + ], + "additionalProperties": false + }, + "description": "Scheduled actions relative to trigger or date field" + }, "active": { "type": "boolean", "default": true, "description": "Whether this workflow is active" + }, + "reevaluateOnChange": { + "type": "boolean", + "default": false, + "description": "Re-evaluate rule if field updates change the record validity" } }, "required": [ diff --git a/packages/spec/package.json b/packages/spec/package.json index e68763075..223697880 100644 --- a/packages/spec/package.json +++ b/packages/spec/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/spec", - "version": "0.3.2", + "version": "0.3.3", "description": "ObjectStack Protocol & Specification - TypeScript Interfaces, JSON Schemas, and Convention Configurations", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/spec/src/ai/index.ts b/packages/spec/src/ai/index.ts index e7dcd39d8..c1f8dbc9f 100644 --- a/packages/spec/src/ai/index.ts +++ b/packages/spec/src/ai/index.ts @@ -6,7 +6,7 @@ * - Model Registry & Selection * - RAG Pipeline * - Natural Language Query (NLQ) - * - Workflow Automation + * - Orchestration & Workflow Automation * - Predictive Analytics * - Conversation Memory & Token Management * - Cost Tracking & Budget Management @@ -16,7 +16,7 @@ export * from './agent.zod'; export * from './model-registry.zod'; export * from './rag-pipeline.zod'; export * from './nlq.zod'; -export * from './workflow-automation.zod'; +export * from './orchestration.zod'; export * from './predictive.zod'; export * from './conversation.zod'; export * from './cost.zod'; diff --git a/packages/spec/src/data/validation.zod.ts b/packages/spec/src/data/validation.zod.ts index a968a6805..b11b8b347 100644 --- a/packages/spec/src/data/validation.zod.ts +++ b/packages/spec/src/data/validation.zod.ts @@ -309,16 +309,14 @@ export const JSONValidationSchema = BaseValidationSchema.extend({ * checkExpiration: true, * checkUsageLimit: true, * userId: '{{current_user_id}}' - *method: z.enum(['GET', 'POST']).default('GET').describe('HTTP method for external call'), - headers: z.record(z.string()).optional().describe('Custom headers for the request'), - validatorFunction: z.string().optional().describe('Reference to custom validator function'), - timeout: z.number().optional().default(5000).describe('Timeout in milliseconds'), - debounce: z.number().optional().describe('Debounce delay in milliseconds'), - params: z.record(z.any()).optional().describe('Additional parameters to pass to validator'), -}); - -/** - * 8 Implement proper error handling on the server side + * } + * } + * ``` + * + * **Best Practices:** + * - Always set reasonable timeouts + * - Use debounce for real-time validation + * - Implement proper error handling on the server side * - Cache validation results when appropriate * - Consider rate limiting for external API calls */ @@ -326,6 +324,8 @@ export const AsyncValidationSchema = BaseValidationSchema.extend({ type: z.literal('async'), field: z.string().describe('Field to validate'), validatorUrl: z.string().optional().describe('External API endpoint for validation'), + method: z.enum(['GET', 'POST']).optional().default('GET').describe('HTTP method for external call'), + headers: z.record(z.string()).optional().describe('Custom headers for the request'), validatorFunction: z.string().optional().describe('Reference to custom validator function'), timeout: z.number().optional().default(5000).describe('Timeout in milliseconds'), debounce: z.number().optional().describe('Debounce delay in milliseconds'), @@ -333,19 +333,25 @@ export const AsyncValidationSchema = BaseValidationSchema.extend({ }); /** - * 7. Custom Validator Function + * 8. Custom Validator Function * User-defined validation logic with code reference. + * + * ## Overview + * Custom validators allow you to define your own validation logic using JavaScript/TypeScript functions. + * This is useful for complex validation scenarios that don't fit into standard validation types. */ -expoJSONValidationSchema, - AsyncValidationSchema, - CustomValidatorSchema, - ConditionalValidationSchema, - ]) -); +export const CustomValidatorSchema = BaseValidationSchema.extend({ + type: z.literal('custom'), + field: z.string().describe('Field to validate'), + validatorFunction: z.string().describe('Reference to custom validator function'), + params: z.record(z.any()).optional().describe('Additional parameters to pass to validator'), +}); /** - * 9 - * Master Validation Rule Schema (forward declared for circular reference) + * Master Validation Rule Schema + * + * This is a discriminated union of all validation types. + * Uses lazy evaluation to handle circular references (e.g., ConditionalValidationSchema). */ export const ValidationRuleSchema: z.ZodType = z.lazy(() => z.discriminatedUnion('type', [ @@ -354,6 +360,7 @@ export const ValidationRuleSchema: z.ZodType = z.lazy(() => StateMachineValidationSchema, FormatValidationSchema, CrossFieldValidationSchema, + JSONValidationSchema, AsyncValidationSchema, CustomValidatorSchema, ConditionalValidationSchema, @@ -550,6 +557,7 @@ export type UniquenessValidation = z.infer; export type StateMachineValidation = z.infer; export type FormatValidation = z.infer; export type CrossFieldValidation = z.infer; +export type JSONValidation = z.infer; export type AsyncValidation = z.infer; export type CustomValidation = z.infer; export type ConditionalValidation = z.infer; diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 7f25e891c..460a7659c 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,5 +1,18 @@ # @objectstack/types +## 0.3.3 + +### Patch Changes + +- feat: Add ObjectAI implementation documentation + + - Added comprehensive AI agent and RAG pipeline implementation documentation + - Defined AI protocol specifications and standards + - Enhanced project documentation with AI-related guides + +- Updated dependencies + - @objectstack/spec@0.3.3 + ## 0.3.2 ### Patch Changes diff --git a/packages/types/package.json b/packages/types/package.json index 5bb2a9949..d92c565db 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@objectstack/types", - "version": "0.3.2", + "version": "0.3.3", "description": "Shared interfaces describing the ObjectStack Runtime environment", "main": "src/index.ts", "types": "src/index.ts",