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) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 08:43:52 +00:00
parent dbb6b1a9ea
commit 149d6cf297
4 changed files with 235 additions and 0 deletions

View File

@@ -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 }
}
}

View File

@@ -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 }
}
}

View File

@@ -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 }
}
}

View File

@@ -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 }
}
}