mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +00:00
WorkflowEditor (325→80): CWorkflowState.qml + WorkflowConnectionState.js DashboardView (121→95): DashboardDBAL.js + config/dashboard-config.json Storybook (114→78): StorybookSidebar + config/storybook-components.json + 7 components compacted to under 100 via formatting (no logic changes) + Multiple view/component splits across all remaining 100+ LOC files Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 lines
1.4 KiB
JSON
7 lines
1.4 KiB
JSON
[
|
|
{ "label": "Select example...", "code": "" },
|
|
{ "label": "DBAL Entity Query", "code": "-- Query entities from DBAL\nlocal dbal = require(\"metabuilder.dbal\")\n\nlocal users = dbal.query(\"core\", \"users\", {\n where = { role = \"admin\", active = true },\n order_by = \"created_at DESC\",\n limit = 50\n})\n\nfor _, user in ipairs(users) do\n print(string.format(\"[%s] %s (%s)\", user.id, user.name, user.role))\nend" },
|
|
{ "label": "Workflow Trigger", "code": "-- Trigger a workflow from Lua\nlocal workflow = require(\"metabuilder.workflow\")\n\nlocal result = workflow.trigger(\"on_user_created\", {\n tenant_id = ctx.tenant_id,\n user_id = new_user.id,\n email = new_user.email,\n source = \"lua_script\"\n})\n\nif result.success then\n log.info(\"Workflow dispatched: \" .. result.execution_id)\nelse\n log.error(\"Workflow failed: \" .. result.error)\nend" },
|
|
{ "label": "JSON Schema Validation", "code": "-- Validate data against a JSON schema\nlocal schema = require(\"metabuilder.schema\")\n\nlocal user_schema = schema.load(\"entities/user\")\n\nlocal data = {\n name = \"demo_user\",\n email = \"demo@example.com\",\n role = \"user\"\n}\n\nlocal valid, errors = schema.validate(data, user_schema)\nif not valid then\n for _, err in ipairs(errors) do\n log.warn(\"Validation error: \" .. err.path .. \" - \" .. err.message)\n end\nend" }
|
|
]
|