From ba1e378aab59ec1a6d7f78546b49aa0524f651c1 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Fri, 16 Jan 2026 14:12:27 +0000 Subject: [PATCH] Add seed data schemas folder with common seed types - Create /schemas/seed/ folder structure for seed data schemas - Add page-config schema for PageConfig seed data - Add component-config schema for ComponentConfig seed data - Add workflow schema for Workflow seed data - Add permission schema for permission seed data - Update ui_home to reference schema location --- packages/ui_home/seed/page-config.json | 1 + schemas/seed/component-config/schema.json | 20 ++++++++++++++++ schemas/seed/page-config/schema.json | 28 +++++++++++++++++++++++ schemas/seed/permission/schema.json | 20 ++++++++++++++++ schemas/seed/workflow/schema.json | 21 +++++++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 schemas/seed/component-config/schema.json create mode 100644 schemas/seed/page-config/schema.json create mode 100644 schemas/seed/permission/schema.json create mode 100644 schemas/seed/workflow/schema.json diff --git a/packages/ui_home/seed/page-config.json b/packages/ui_home/seed/page-config.json index f1287ca1c..e1dc3d01d 100644 --- a/packages/ui_home/seed/page-config.json +++ b/packages/ui_home/seed/page-config.json @@ -1,5 +1,6 @@ [ { + "$schema": "https://metabuilder.dev/schemas/seed/page-config/schema.json", "id": "page_ui_home_root", "path": "/", "title": "MetaBuilder", diff --git a/schemas/seed/component-config/schema.json b/schemas/seed/component-config/schema.json new file mode 100644 index 000000000..7759984f9 --- /dev/null +++ b/schemas/seed/component-config/schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://metabuilder.dev/schemas/seed/component-config.json", + "title": "Component Config Seed Data", + "description": "Seed data for ComponentConfig database entries", + "type": "array", + "items": { + "type": "object", + "required": ["id", "name"], + "properties": { + "id": { "type": "string", "description": "Component ID" }, + "name": { "type": "string", "description": "Component name" }, + "packageId": { "type": "string", "description": "Package ID" }, + "description": { "type": "string", "description": "Component description" }, + "category": { "type": "string", "description": "Component category" }, + "props": { "type": "string", "description": "JSON string of default props" }, + "metadata": { "type": "string", "description": "JSON string of metadata" } + } + } +} diff --git a/schemas/seed/page-config/schema.json b/schemas/seed/page-config/schema.json new file mode 100644 index 000000000..b73be5131 --- /dev/null +++ b/schemas/seed/page-config/schema.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://metabuilder.dev/schemas/seed/page-config.json", + "title": "Page Config Seed Data", + "description": "Seed data for PageConfig database entries", + "type": "array", + "items": { + "type": "object", + "required": ["path", "title", "component"], + "properties": { + "id": { "type": "string", "description": "Page ID" }, + "path": { "type": "string", "description": "URL path" }, + "title": { "type": "string", "description": "Page title" }, + "description": { "type": "string", "description": "Page description" }, + "packageId": { "type": "string", "description": "Package ID" }, + "component": { "type": "string", "description": "Component to render" }, + "icon": { "type": "string", "description": "Icon for navigation" }, + "level": { "type": "integer", "minimum": 0, "maximum": 5, "default": 0, "description": "Access level" }, + "requiresAuth": { "type": "boolean", "default": false }, + "isPublished": { "type": "boolean", "default": true }, + "sortOrder": { "type": "integer", "default": 0 }, + "parentPath": { "type": "string", "description": "Parent page path" }, + "requiredRole": { "type": "string" }, + "params": { "type": "string", "description": "JSON string of parameters" }, + "meta": { "type": "string", "description": "JSON string of metadata" } + } + } +} diff --git a/schemas/seed/permission/schema.json b/schemas/seed/permission/schema.json new file mode 100644 index 000000000..f38460928 --- /dev/null +++ b/schemas/seed/permission/schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://metabuilder.dev/schemas/seed/permission.json", + "title": "Permission Seed Data", + "description": "Seed data for permission entries", + "type": "array", + "items": { + "type": "object", + "required": ["resource", "action"], + "properties": { + "id": { "type": "string", "description": "Permission ID" }, + "resource": { "type": "string", "description": "Resource type" }, + "action": { "type": "string", "description": "Action (read, write, delete, etc)" }, + "role": { "type": "string", "description": "Required role" }, + "level": { "type": "integer", "minimum": 0, "maximum": 5, "description": "Required level" }, + "description": { "type": "string" }, + "conditions": { "type": "string", "description": "JSON string of conditions" } + } + } +} diff --git a/schemas/seed/workflow/schema.json b/schemas/seed/workflow/schema.json new file mode 100644 index 000000000..01a648933 --- /dev/null +++ b/schemas/seed/workflow/schema.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://metabuilder.dev/schemas/seed/workflow.json", + "title": "Workflow Seed Data", + "description": "Seed data for Workflow database entries", + "type": "array", + "items": { + "type": "object", + "required": ["id", "name"], + "properties": { + "id": { "type": "string", "description": "Workflow ID" }, + "name": { "type": "string", "description": "Workflow name" }, + "packageId": { "type": "string", "description": "Package ID" }, + "description": { "type": "string", "description": "Workflow description" }, + "enabled": { "type": "boolean", "default": true }, + "definition": { "type": "string", "description": "JSON string of workflow definition" }, + "trigger": { "type": "string", "description": "Trigger type (event, schedule, manual)" }, + "metadata": { "type": "string", "description": "JSON string of metadata" } + } + } +}