From 149d6cf297b3edb80fe42fe4a87b0309ac66fb54 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Thu, 19 Mar 2026 08:43:52 +0000 Subject: [PATCH] fix(dbal): add missing codeforge entity schemas (Settings, Theme, Lambda, ComponentNode) The DBAL sync client referenced these 4 entities but no JSON schema files existed, causing 422 Unprocessable Entity on CodeForge page load. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../entities/codeforge/componentNode.json | 57 +++++++++++++++ .../api/schema/entities/codeforge/lambda.json | 57 +++++++++++++++ .../schema/entities/codeforge/settings.json | 69 +++++++++++++++++++ .../api/schema/entities/codeforge/theme.json | 52 ++++++++++++++ 4 files changed, 235 insertions(+) create mode 100644 dbal/shared/api/schema/entities/codeforge/componentNode.json create mode 100644 dbal/shared/api/schema/entities/codeforge/lambda.json create mode 100644 dbal/shared/api/schema/entities/codeforge/settings.json create mode 100644 dbal/shared/api/schema/entities/codeforge/theme.json diff --git a/dbal/shared/api/schema/entities/codeforge/componentNode.json b/dbal/shared/api/schema/entities/codeforge/componentNode.json new file mode 100644 index 000000000..1b4195f5a --- /dev/null +++ b/dbal/shared/api/schema/entities/codeforge/componentNode.json @@ -0,0 +1,57 @@ +{ + "entity": "ComponentNode", + "version": "1.0", + "description": "Visual component definition with props and child hierarchy", + "tenantId": true, + "fields": { + "id": { + "type": "uuid", + "primary": true, + "generated": true, + "description": "Unique component node identifier" + }, + "name": { + "type": "string", + "required": true, + "max_length": 255, + "description": "Component display name" + }, + "type": { + "type": "enum", + "required": true, + "values": ["atom", "molecule", "organism"], + "description": "Component classification tier" + }, + "code": { + "type": "text", + "required": true, + "description": "Component source code" + }, + "props": { + "type": "json", + "description": "Array of prop definitions [{name, type, required, defaultValue, description}]" + }, + "metadata": { + "type": "json", + "description": "Additional component metadata" + }, + "updatedAt": { + "type": "bigint", + "generated": true + } + }, + "indexes": [ + { + "fields": ["tenantId"] + }, + { + "fields": ["type"] + } + ], + "acl": { + "create": { "user": true }, + "read": { "self": true, "admin": true }, + "update": { "self": true }, + "delete": { "self": true } + } +} diff --git a/dbal/shared/api/schema/entities/codeforge/lambda.json b/dbal/shared/api/schema/entities/codeforge/lambda.json new file mode 100644 index 000000000..a6378206a --- /dev/null +++ b/dbal/shared/api/schema/entities/codeforge/lambda.json @@ -0,0 +1,57 @@ +{ + "entity": "Lambda", + "version": "1.0", + "description": "Serverless function definition in CodeForge", + "tenantId": true, + "fields": { + "id": { + "type": "uuid", + "primary": true, + "generated": true, + "description": "Unique lambda identifier" + }, + "name": { + "type": "string", + "required": true, + "max_length": 255, + "description": "Lambda function name" + }, + "description": { + "type": "string", + "max_length": 1024, + "description": "Lambda description" + }, + "code": { + "type": "text", + "required": true, + "description": "Function source code" + }, + "runtime": { + "type": "string", + "required": true, + "max_length": 50, + "description": "Runtime environment (e.g. nodejs20, python3.11)" + }, + "handler": { + "type": "string", + "required": true, + "max_length": 255, + "description": "Entry point handler (e.g. index.handler)" + }, + "updatedAt": { + "type": "bigint", + "generated": true + } + }, + "indexes": [ + { + "fields": ["tenantId"] + } + ], + "acl": { + "create": { "user": true }, + "read": { "self": true, "admin": true }, + "update": { "self": true }, + "delete": { "self": true } + } +} diff --git a/dbal/shared/api/schema/entities/codeforge/settings.json b/dbal/shared/api/schema/entities/codeforge/settings.json new file mode 100644 index 000000000..29789f652 --- /dev/null +++ b/dbal/shared/api/schema/entities/codeforge/settings.json @@ -0,0 +1,69 @@ +{ + "entity": "Settings", + "version": "1.0", + "description": "Application settings for a CodeForge user session", + "tenantId": true, + "fields": { + "id": { + "type": "string", + "primary": true, + "description": "Settings key (e.g. 'app')" + }, + "autoSave": { + "type": "boolean", + "default": true, + "description": "Enable automatic file saving" + }, + "autoSync": { + "type": "boolean", + "default": true, + "description": "Enable automatic DBAL synchronization" + }, + "syncInterval": { + "type": "integer", + "default": 30000, + "description": "Sync interval in milliseconds" + }, + "dbalApiUrl": { + "type": "string", + "default": "http://localhost:8080", + "description": "DBAL daemon API URL" + }, + "useIndexedDB": { + "type": "boolean", + "default": true, + "description": "Enable IndexedDB client-side persistence" + }, + "theme": { + "type": "enum", + "values": ["light", "dark", "system"], + "default": "light", + "description": "UI theme preference" + }, + "locale": { + "type": "string", + "default": "en", + "max_length": 10, + "description": "UI locale (e.g. en, es)" + }, + "createdAt": { + "type": "bigint", + "generated": true + }, + "updatedAt": { + "type": "bigint", + "generated": true + } + }, + "indexes": [ + { + "fields": ["tenantId"] + } + ], + "acl": { + "create": { "user": true }, + "read": { "self": true, "admin": true }, + "update": { "self": true }, + "delete": { "self": true } + } +} diff --git a/dbal/shared/api/schema/entities/codeforge/theme.json b/dbal/shared/api/schema/entities/codeforge/theme.json new file mode 100644 index 000000000..c59cf9d02 --- /dev/null +++ b/dbal/shared/api/schema/entities/codeforge/theme.json @@ -0,0 +1,52 @@ +{ + "entity": "Theme", + "version": "1.0", + "description": "Custom UI theme definition for CodeForge", + "tenantId": true, + "fields": { + "id": { + "type": "uuid", + "primary": true, + "generated": true, + "description": "Unique theme identifier" + }, + "name": { + "type": "string", + "required": true, + "max_length": 100, + "description": "Theme display name" + }, + "colors": { + "type": "json", + "required": true, + "description": "Color tokens (primary, secondary, accent, background, foreground, muted, destructive, border)" + }, + "typography": { + "type": "json", + "description": "Typography tokens (fontFamily, headingFamily, fontSize, fontWeight)" + }, + "spacing": { + "type": "json", + "description": "Spacing tokens (unit, scale)" + }, + "updatedAt": { + "type": "bigint", + "generated": true + } + }, + "indexes": [ + { + "fields": ["tenantId"] + }, + { + "fields": ["name", "tenantId"], + "unique": true + } + ], + "acl": { + "create": { "user": true }, + "read": { "self": true, "admin": true }, + "update": { "self": true }, + "delete": { "self": true } + } +}