Commit Graph

523 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
eb0289d593 Address code review feedback: fix workflow step ID, improve YAML regex, remove error suppression
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 17:40:13 +00:00
copilot-swe-agent[bot]
2e2a0f8218 Fix DBAL codegen to handle multi-document YAML and include sensitive fields with warnings
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 17:34:09 +00:00
copilot-swe-agent[bot]
5b49332c2f Fix all remaining TypeScript type errors - typecheck now passes
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 16:42:01 +00:00
copilot-swe-agent[bot]
1a3ee146c1 Fix Promise await issues and add sx prop to fakemui components
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 16:21:35 +00:00
copilot-swe-agent[bot]
a4169bd56e Add YAML-based type generator for DBAL and generate types.generated.ts
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 16:16:46 +00:00
copilot-swe-agent[bot]
a144295709 Remove hardcoded absolute paths, use relative paths for database fallback
Fixed issue where absolute bot paths were hardcoded in Prisma configuration:
- Changed fallback from 'file:/home/runner/work/metabuilder/metabuilder/prisma/prisma/dev.db'
  to 'file:../../prisma/prisma/dev.db' in both files
- This makes the code portable and works regardless of deployment location
- Verified dev server starts correctly and database operations work with relative path

Files modified:
- frontends/nextjs/src/lib/config/prisma.ts
- dbal/development/src/adapters/prisma/context.ts

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 13:22:49 +00:00
copilot-swe-agent[bot]
96ee74e6ef MAJOR FIX: Correct Prisma 7 adapter usage - use factory pattern with URL config
The root cause was incorrect adapter usage:
- PrismaBetterSqlite3 is a FACTORY that expects {url: string} config
- We were incorrectly passing a Database instance directly
- This caused "Cannot read properties of undefined (reading 'replace')" error

Changes:
1. Fixed Next.js prisma.ts to pass {url} config to adapter factory
2. Fixed DBAL context.ts to use adapter factory with URL
3. Removed direct Database instantiation - let adapter handle it
4. Created absolute-path .env file with DATABASE_URL
5. Cleaned and reinstalled all dependencies to ensure version alignment
6. Added missing database columns (tenantId, config to InstalledPackage)

Result: Database operations now work! Application serves pages successfully.

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 05:01:39 +00:00
copilot-swe-agent[bot]
d919572357 Add debug logging to Prisma adapters and fix database schema issues
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 04:36:04 +00:00
copilot-swe-agent[bot]
7a1b44ba3f Fix DBAL Prisma adapter to handle undefined dialect and use SQLite adapter as fallback
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 04:12:55 +00:00
copilot-swe-agent[bot]
f19d04410d Fix Prisma 7 adapter requirement - use SQLite adapter for both Next.js and DBAL
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 03:59:26 +00:00
copilot-swe-agent[bot]
942b8792d8 fix: Resolve remaining TypeScript errors and build issues
- Added index signatures to all generated types and Create/Update input types
- Fixed Workflow description field type (null vs undefined)
- Fixed lint errors in API route (proper type checking for user object)
- Added server-only directive to compiler module
- Temporarily disabled PackageStyleLoader (needs API route instead of client-side fs access)
- Simplified main.scss to avoid SCSS @use import order issues
- TypeScript errors reduced from 39 to ~19 (mostly missing Prisma models)
- Build process now gets further (past SCSS compilation)

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 01:35:21 +00:00
copilot-swe-agent[bot]
af2a59ee6a fix: Resolve TypeScript errors and dependency issues
- Fixed Storybook dependency version mismatch (downgraded to 8.6.15)
- Added @types/better-sqlite3 for better-sqlite3 type definitions
- Fixed Prisma adapter import (PrismaBetterSqlite3 vs PrismaBetterSQLite3)
- Removed datasource URL from Prisma schema (Prisma 7 requirement)
- Generated DBAL types.generated.ts from Prisma schema
- Added index signatures to Update*Input types for Record<string, unknown> compatibility
- Fixed ErrorBoundary override modifiers
- Fixed Zod record schema (requires both key and value types)
- Fixed orderBy syntax in get-error-logs (array format)
- Fixed type safety in API routes (user type assertions)
- Fixed hook imports and exports
- Fixed conditional expression type guards
- Added .npmrc for legacy peer deps support

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-08 01:26:50 +00:00
42446ef255 feat: Update package schemas and scripts to support JSON-based lifecycle hooks
- Added `jsonScript` property to metadata schema for JSON script entry points.
- Refactored `generate-package.ts` to replace Lua scripts with JSON scripts for lifecycle hooks.
- Updated test generation to use JSON format for metadata validation.
- Modified documentation and comments to reflect the transition from Lua to JSON scripting.
- Adjusted Storybook configuration and mock data to align with new JSON script structure.
- Renamed relevant files and references from Lua to JSON for consistency across the project.
2026-01-07 15:25:45 +00:00
9284b9a67b Refactor function definitions across multiple packages to remove luaScript references
- Updated functions.json files in theme_editor, ui_auth, ui_footer, ui_header, ui_home, ui_intro, ui_level2, ui_level3, ui_level4, ui_level5, ui_level6, ui_login, ui_pages, ui_permissions, user_manager, and workflow_editor packages.
- Removed luaScript entries from function definitions, retaining only category and other relevant metadata.
- Adjusted documentation in prisma/README.md to remove LuaScript entity reference.
2026-01-07 14:54:33 +00:00
3bb754dd72 refactor: update JSON usage to use scoped Json namespace 2026-01-07 14:36:31 +00:00
016cd662bf refactor: remove LuaScript entity and related operations 2026-01-07 14:36:19 +00:00
7eee87ec90 refactor: remove LuaScript entity and related operations
- Deleted all LuaScript CRUD operations from Client and entities.
- Removed LuaScript validation functions and related files.
- Updated InMemoryStore to remove LuaScript storage.
- Cleaned up tests by removing LuaScript related test cases.
- Adjusted documentation and quick start guide to reflect the removal of LuaScript functionality.
2026-01-07 14:25:01 +00:00
6d8b23e7a6 Refactor code structure for improved readability and maintainability 2026-01-07 14:18:49 +00:00
445f4f4028 Refactor workflow management and validation
- Updated `list_workflows.hpp` to replace `is_active` with `enabled` filter and added `tenant_id` filter.
- Modified sorting logic for workflows based on `created_at` to handle optional values.
- Enhanced `update_workflow.hpp` to include new fields: `nodes`, `edges`, `enabled`, `version`, and `created_at`.
- Removed obsolete `isValidWorkflowTrigger` validation function from `workflow_validation.hpp`.
- Adjusted unit tests in `client_test.cpp` to reflect changes in workflow and page management, including renaming fields and updating assertions.
- Updated Prisma schema in `schema.prisma` to align with new workflow and component models, including changes to data types and attributes.
- Introduced a new script `gen_prisma_schema.js` for generating Prisma schema from DBAL API schemas to maintain synchronization.
2026-01-07 13:43:37 +00:00
8e5930cd44 feat: update get package functions to use InstalledPackage entity and clarify documentation 2026-01-07 13:31:53 +00:00
693989bba8 feat: refactor create package function to use InstalledPackage entity and improve validation 2026-01-07 13:31:35 +00:00
92c280b0e6 feat: Add PageConfig and ComponentNode entities with CRUD operations
- Introduced `PageConfig` entity for page configuration and layout definition.
- Introduced `ComponentNode` entity for managing component hierarchy within pages.
- Implemented operations for creating, reading, updating, and deleting both entities.
- Updated Prisma schema to reflect new entities and relationships.
- Enhanced ACL rules for new entities to manage access control.
- Added conformance cases to test page and component hierarchy management.
- Created a script to check synchronization between DBAL and Prisma schemas.
2026-01-07 13:31:26 +00:00
6c8e7002cd feat(validation): enhance entity validation with new fields and improved checks
- Updated page validation to include new properties such as path, componentTree, requiresAuth, and more.
- Enhanced session validation to check for bigint timestamps and added checks for ipAddress and userAgent.
- Improved user validation by adding checks for profilePicture, bio, createdAt, and tenantId.
- Refactored workflow validation to ensure nodes and edges are valid JSON strings and added checks for createdAt and updatedAt.
- Introduced isValidJsonString utility for validating JSON strings.
- Added seedUsers function to populate default users in the database.
- Removed unused generateComponentTree stub and replaced it with a full implementation for rendering Lua UI components.
- Updated useLevelRouting and useResolvedUser hooks to support new permission levels and user state management.
- Enhanced useRestApi hook to support request cancellation with AbortSignal.
2026-01-07 12:50:58 +00:00
4caf9e2ae9 feat: enhance type definitions, improve error handling, and validate package routes 2026-01-07 12:21:47 +00:00
25908192ef feat(schema-registry): enhance schema management with migration support and improved loading mechanisms
- Added migrationQueue to SchemaRegistry for tracking pending migrations.
- Implemented clear method to reset the registry state.
- Enhanced schema registration and retrieval methods to support entity normalization.
- Updated loadSchemaRegistry to handle entities and migrationQueue from JSON.
- Introduced saveSchemaRegistry to persist entities and migrationQueue.
- Added functions for approving and rejecting migrations.

feat(schema-scanner): implement package scanning for schema registration

- Created scanAllPackages function to scan directories for package metadata.
- Extracted and validated schema entities from package metadata.
- Registered schemas in the SchemaRegistry based on scanned packages.

fix(load-page-from-db): improve tenantId handling and null checks

- Updated tenantId handling to use nullish coalescing for better clarity.
- Refined null checks for page retrieval.

feat(validation): add Zod validation utilities for standardized data validation

- Introduced validation utilities for API requests and package data validation.
- Created common reusable schemas for various data types.
- Implemented package-specific validator factory for enhanced error reporting.

test(package-integration): fix potential null checks in package dependency resolution

- Updated package dependency resolution logic to handle undefined cases.

chore(package.json): add jsdom as a dev dependency for testing

- Included jsdom in devDependencies for improved testing capabilities.

fix(metadata): update package metadata for consistency and clarity

- Standardized packageId and name fields in metadata.json files across multiple packages.
2026-01-07 12:08:24 +00:00
copilot-swe-agent[bot]
297f1cacad fix: resolve all TypeScript errors across codebase
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-06 15:05:13 +00:00
copilot-swe-agent[bot]
7c5f3bbe06 Implement stub hooks, auth logout, and update configurations
- Enable strict TypeScript mode in tsconfig.json
- Update ESLint rules to be stricter (error instead of warn)
- Implement useDBAL hook with fetch-based DBAL API
- Implement useKV hook with key-value store operations
- Implement use-mobile hook with media query detection
- Implement logout function with session clearing
- Add permission check comments in app/page.tsx
- Replace throwing stub in user$file with placeholder returns
- Complete entity-specific fields in generate-package.ts
- Add database operation templates in generate-package.ts

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-06 14:12:49 +00:00
copilot-swe-agent[bot]
3d824dec79 Fix remaining TypeScript errors - all 96 errors resolved
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-06 12:29:14 +00:00
copilot-swe-agent[bot]
fdaeda09c8 Fix TypeScript errors in DBAL and fakemui components
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-06 12:27:34 +00:00
copilot-swe-agent[bot]
8ec41f87bd Add missing properties to entity types and create validation stubs
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-06 02:06:10 +00:00
copilot-swe-agent[bot]
5de31cd740 Fix remaining DBAL imports and add AWS SDK stub types
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-06 02:01:55 +00:00
copilot-swe-agent[bot]
1a421ea2da Fix DBAL import paths and add missing type definitions
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-06 01:56:27 +00:00
copilot-swe-agent[bot]
b4650d1e91 Fix fakemui interface conflicts and DBAL type definitions
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-06 01:50:31 +00:00
copilot-swe-agent[bot]
a4766dd2a3 Fix DBAL and fakemui import paths and missing exports
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-05 22:12:10 +00:00
copilot-swe-agent[bot]
0ab852d227 Initial plan: Fix README styles documentation
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2026-01-03 20:17:49 +00:00
Richard Ward
f2ebee76cf docs: package,production,dbal (20 files) 2025-12-30 23:47:16 +00:00
Richard Ward
434aa49e54 docs: production,dbal,hpp (5 files) 2025-12-30 23:41:52 +00:00
Richard Ward
46f0603854 docs: production,dbal,package (3 files) 2025-12-30 23:35:40 +00:00
Richard Ward
b6b379efdc docs: production,dbal,writer (4 files) 2025-12-30 23:35:13 +00:00
Richard Ward
afbeab8feb code: production,dbal,hpp (3 files) 2025-12-30 23:33:28 +00:00
Richard Ward
06f73d3996 docs: txt,storybook,src (2 files) 2025-12-30 23:33:00 +00:00
Richard Ward
e1595b0936 docs: production,dbal,txt (2 files) 2025-12-30 22:34:54 +00:00
Richard Ward
f8a92529b3 code: server,routes,production (1 files) 2025-12-30 22:34:28 +00:00
Richard Ward
c6a6cce84d code: rpc,restful,production (1 files) 2025-12-30 22:34:00 +00:00
Richard Ward
d43761e11a code: rpc,restful,production (1 files) 2025-12-30 22:33:33 +00:00
Richard Ward
ce650fe83e docs: production,dbal,txt (2 files) 2025-12-30 22:32:00 +00:00
Richard Ward
6d47884ba4 code: production,dbal,cpp (2 files) 2025-12-30 22:31:32 +00:00
Richard Ward
66b5e9430f code: schema,rpc,production (1 files) 2025-12-30 22:30:43 +00:00
Richard Ward
78b9ff896f config: yaml,shared,dbal (2 files) 2025-12-30 21:27:49 +00:00
Richard Ward
3e1e351d56 config: yaml,shared,dbal (4 files) 2025-12-30 21:27:22 +00:00