@shepai/cli 1.122.0 → 1.122.1-pr373.cb974c2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/presentation/web/app/actions/execute-query.d.ts +7 -0
- package/dist/src/presentation/web/app/actions/execute-query.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/execute-query.js +55 -0
- package/dist/src/presentation/web/app/actions/get-table-rows.d.ts +10 -0
- package/dist/src/presentation/web/app/actions/get-table-rows.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/get-table-rows.js +55 -0
- package/dist/src/presentation/web/app/actions/get-table-schema.d.ts +13 -0
- package/dist/src/presentation/web/app/actions/get-table-schema.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/get-table-schema.js +27 -0
- package/dist/src/presentation/web/app/actions/list-tables.d.ts +10 -0
- package/dist/src/presentation/web/app/actions/list-tables.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/list-tables.js +19 -0
- package/dist/src/presentation/web/app/database/page.d.ts +4 -0
- package/dist/src/presentation/web/app/database/page.d.ts.map +1 -0
- package/dist/src/presentation/web/app/database/page.js +15 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +4 -0
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js +6 -2
- package/dist/src/presentation/web/components/features/database/cell-value-dialog.d.ts +8 -0
- package/dist/src/presentation/web/components/features/database/cell-value-dialog.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/cell-value-dialog.js +7 -0
- package/dist/src/presentation/web/components/features/database/cell-value-dialog.stories.d.ts +10 -0
- package/dist/src/presentation/web/components/features/database/cell-value-dialog.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/cell-value-dialog.stories.js +48 -0
- package/dist/src/presentation/web/components/features/database/database-page-client.d.ts +13 -0
- package/dist/src/presentation/web/components/features/database/database-page-client.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/database-page-client.js +74 -0
- package/dist/src/presentation/web/components/features/database/database-page-client.stories.d.ts +9 -0
- package/dist/src/presentation/web/components/features/database/database-page-client.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/database-page-client.stories.js +78 -0
- package/dist/src/presentation/web/components/features/database/query-runner.d.ts +9 -0
- package/dist/src/presentation/web/components/features/database/query-runner.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/query-runner.js +53 -0
- package/dist/src/presentation/web/components/features/database/query-runner.stories.d.ts +9 -0
- package/dist/src/presentation/web/components/features/database/query-runner.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/query-runner.stories.js +55 -0
- package/dist/src/presentation/web/components/features/database/row-browser.d.ts +11 -0
- package/dist/src/presentation/web/components/features/database/row-browser.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/row-browser.js +42 -0
- package/dist/src/presentation/web/components/features/database/row-browser.stories.d.ts +14 -0
- package/dist/src/presentation/web/components/features/database/row-browser.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/row-browser.stories.js +120 -0
- package/dist/src/presentation/web/components/features/database/schema-viewer.d.ts +7 -0
- package/dist/src/presentation/web/components/features/database/schema-viewer.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/schema-viewer.js +14 -0
- package/dist/src/presentation/web/components/features/database/schema-viewer.stories.d.ts +11 -0
- package/dist/src/presentation/web/components/features/database/schema-viewer.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/schema-viewer.stories.js +67 -0
- package/dist/src/presentation/web/components/features/database/table-list.d.ts +8 -0
- package/dist/src/presentation/web/components/features/database/table-list.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/table-list.js +19 -0
- package/dist/src/presentation/web/components/features/database/table-list.stories.d.ts +10 -0
- package/dist/src/presentation/web/components/features/database/table-list.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/database/table-list.stories.js +66 -0
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.d.ts.map +1 -1
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.js +2 -2
- package/dist/src/presentation/web/components/ui/table.d.ts +11 -0
- package/dist/src/presentation/web/components/ui/table.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/table.js +28 -0
- package/dist/src/presentation/web/lib/server-container.d.ts +1 -2
- package/dist/src/presentation/web/lib/server-container.d.ts.map +1 -1
- package/dist/src/presentation/web/lib/server-db.d.ts +16 -0
- package/dist/src/presentation/web/lib/server-db.d.ts.map +1 -0
- package/dist/src/presentation/web/lib/server-db.js +10 -0
- package/dist/src/presentation/web/lib/sql-validation.d.ts +7 -0
- package/dist/src/presentation/web/lib/sql-validation.d.ts.map +1 -0
- package/dist/src/presentation/web/lib/sql-validation.js +17 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/app-path-routes-manifest.json +1 -0
- package/web/.next/build-manifest.json +6 -6
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +3 -3
- package/web/.next/required-server-files.json +3 -3
- package/web/.next/routes-manifest.json +6 -0
- package/web/.next/server/app/(dashboard)/@drawer/create/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +22 -22
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +22 -22
- package/web/.next/server/app/(dashboard)/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/page.js +1 -1
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error/page/build-manifest.json +4 -4
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/build-manifest.json +4 -4
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page.js +1 -1
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
- package/web/.next/server/app/database/page/app-paths-manifest.json +3 -0
- package/web/.next/server/app/database/page/build-manifest.json +18 -0
- package/web/.next/server/app/database/page/next-font-manifest.json +6 -0
- package/web/.next/server/app/database/page/react-loadable-manifest.json +1 -0
- package/web/.next/server/app/database/page/server-reference-manifest.json +80 -0
- package/web/.next/server/app/database/page.js +16 -0
- package/web/.next/server/app/database/page.js.map +5 -0
- package/web/.next/server/app/database/page.js.nft.json +1 -0
- package/web/.next/server/app/database/page_client-reference-manifest.js +2 -0
- package/web/.next/server/app/settings/page/build-manifest.json +4 -4
- package/web/.next/server/app/settings/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/settings/page.js +1 -1
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/build-manifest.json +4 -4
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page.js +1 -1
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/build-manifest.json +4 -4
- package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/tools/page.js +1 -1
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/build-manifest.json +4 -4
- package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/version/page.js +2 -2
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app-paths-manifest.json +1 -0
- package/web/.next/server/chunks/[root-of-the-server]__0866d2b5._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__42b7ab55._.js.map +1 -1
- package/web/.next/server/chunks/{[root-of-the-server]__53013576._.js → [root-of-the-server]__7d63f9a4._.js} +2 -2
- package/web/.next/server/chunks/[root-of-the-server]__9191749c._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__9a136c79._.js.map +1 -1
- package/web/.next/server/chunks/{[root-of-the-server]__92078db6._.js → [root-of-the-server]__a1c7c02a._.js} +2 -2
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a5879003._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__b2f9a412._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__b4102cc7._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__d2c18946._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__d8037e14._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__d9d410a8._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__e247a485._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__06fef644._.js → [root-of-the-server]__07a39ff2._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__07a39ff2._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +4 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__6b17a22d._.js.map → [root-of-the-server]__11033878._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1a0bbce4._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1a0bbce4._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2698e9f4._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2698e9f4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__33cee851._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__33cee851._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4bb4b155._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4bb4b155._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__590dfc34._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__590dfc34._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__743e777a._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__743e777a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7a939e4e._.js +4 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__a022445f._.js.map → [root-of-the-server]__7a939e4e._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8e3bf5d7._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8e3bf5d7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__930c8634._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__930c8634._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b724df9e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c07f9f79._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c07f9f79._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c605a375._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c605a375._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +4 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__804c006d._.js.map → [root-of-the-server]__fdc75809._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_05ca281a._.js +3 -0
- package/web/.next/server/chunks/ssr/_05ca281a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_061c1da2._.js +3 -0
- package/web/.next/server/chunks/ssr/_061c1da2._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0e6034fc._.js +3 -0
- package/web/.next/server/chunks/ssr/_0e6034fc._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_150e66ba._.js +3 -0
- package/web/.next/server/chunks/ssr/_150e66ba._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js +1 -1
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_34ba40e0._.js +3 -0
- package/web/.next/server/chunks/ssr/_34ba40e0._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_5b809cd2._.js +4 -0
- package/web/.next/server/chunks/ssr/_5b809cd2._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_9f1ab4ee._.js → _5d618f84._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_9f1ab4ee._.js.map → _5d618f84._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_6552e0aa._.js +3 -0
- package/web/.next/server/chunks/ssr/_6552e0aa._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_81f88d15._.js +7 -0
- package/web/.next/server/chunks/ssr/_81f88d15._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_93d2a00c._.js +3 -0
- package/web/.next/server/chunks/ssr/_93d2a00c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_a37f5f18._.js +1 -1
- package/web/.next/server/chunks/ssr/_ad5819d0._.js +3 -0
- package/web/.next/server/chunks/ssr/_ad5819d0._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_f1a649e3._.js → _d506bca5._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_f1a649e3._.js.map → _d506bca5._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_e1854141._.js +3 -0
- package/web/.next/server/chunks/ssr/_e1854141._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_f9959908._.js +3 -0
- package/web/.next/server/chunks/ssr/_f9959908._.js.map +1 -0
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_database_database-page-client_tsx_b853607a._.js +3 -0
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_database_database-page-client_tsx_b853607a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_026172d1._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_026172d1._.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_8b0ea744._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_8b0ea744._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_scroll-area_tsx_53ae5be7._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_scroll-area_tsx_53ae5be7._.js.map +1 -0
- package/web/.next/server/middleware-build-manifest.js +4 -4
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +101 -34
- package/web/.next/static/chunks/0b8f2e223e1b82f4.js +1 -0
- package/web/.next/static/chunks/0e57fc72bf0bc5ba.js +1 -0
- package/web/.next/static/chunks/22a1d0eb174f3da9.js +1 -0
- package/web/.next/static/chunks/401118947e7159e0.js +1 -0
- package/web/.next/static/chunks/40b6bcf1a2de4a0f.js +1 -0
- package/web/.next/static/chunks/471c323a18da4918.js +1 -0
- package/web/.next/static/chunks/495b4bee62b00caa.js +1 -0
- package/web/.next/static/chunks/5aab343372a98721.js +1 -0
- package/web/.next/static/chunks/70e04b1108d151c3.js +11 -0
- package/web/.next/static/chunks/{9c2f294bf748b4ba.js → 899529af3e08bf94.js} +2 -2
- package/web/.next/static/chunks/{9076710a2df38d14.js → 96fc208419afac9e.js} +1 -1
- package/web/.next/static/chunks/b3914c0aae76742b.css +1 -0
- package/web/.next/static/chunks/b4160eaf4deda4e7.js +1 -0
- package/web/.next/static/chunks/b65702b701417ae2.js +1 -0
- package/web/.next/static/chunks/c2c0d4e71c36199f.js +1 -0
- package/web/.next/static/chunks/c7e793951b20a67f.js +1 -0
- package/web/.next/static/chunks/cb440c7f33e135f4.js +1 -0
- package/web/.next/static/chunks/{0dfc3b1cff4bdcc2.js → cb46d75dfac954a5.js} +2 -2
- package/web/.next/static/chunks/dd702ceaee4a5c0d.js +1 -0
- package/web/.next/static/chunks/e6b8baa05827f641.js +1 -0
- package/web/.next/static/chunks/{turbopack-426d9bc2450816ba.js → turbopack-b1685b5f87ad1d60.js} +1 -1
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_d0119342._.js +0 -3
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_d0119342._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__06fef644._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8c553503._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8c553503._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9f155c0e._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9f155c0e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a022445f._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0dc2cfd3._.js +0 -3
- package/web/.next/server/chunks/ssr/_0dc2cfd3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0e506641._.js +0 -7
- package/web/.next/server/chunks/ssr/_0e506641._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js +0 -3
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_1bb131c4._.js +0 -3
- package/web/.next/server/chunks/ssr/_1bb131c4._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_6d26a08f._.js +0 -3
- package/web/.next/server/chunks/ssr/_6d26a08f._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_6e403a1e._.js +0 -3
- package/web/.next/server/chunks/ssr/_6e403a1e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_75f4ccb3._.js +0 -3
- package/web/.next/server/chunks/ssr/_75f4ccb3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_b5fc318a._.js +0 -3
- package/web/.next/server/chunks/ssr/_b5fc318a._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js +0 -3
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_fffd4212._.js +0 -3
- package/web/.next/server/chunks/ssr/_fffd4212._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js.map +0 -1
- package/web/.next/static/chunks/0d2af96e64960ef5.css +0 -1
- package/web/.next/static/chunks/1c206da59596f056.js +0 -1
- package/web/.next/static/chunks/2429cf8757ddad34.js +0 -1
- package/web/.next/static/chunks/303a1217006489b9.js +0 -1
- package/web/.next/static/chunks/39dc15636654a1e3.js +0 -1
- package/web/.next/static/chunks/3e9320301a0cac8b.js +0 -1
- package/web/.next/static/chunks/447e720f6cf54767.js +0 -1
- package/web/.next/static/chunks/4562ee849ea13c3a.js +0 -1
- package/web/.next/static/chunks/53e9eda219a7f61c.js +0 -1
- package/web/.next/static/chunks/7bc5806d9f82cc79.js +0 -11
- package/web/.next/static/chunks/845d8e58a91014e6.js +0 -1
- package/web/.next/static/chunks/84a181ff3270fd9f.js +0 -1
- package/web/.next/static/chunks/96eeeb28e06de78c.js +0 -1
- package/web/.next/static/chunks/e2ef95d904c360f3.js +0 -1
- package/web/.next/static/chunks/ed3a602003bcb31b.js +0 -1
- /package/web/.next/server/chunks/{[root-of-the-server]__53013576._.js.map → [root-of-the-server]__7d63f9a4._.js.map} +0 -0
- /package/web/.next/server/chunks/{[root-of-the-server]__92078db6._.js.map → [root-of-the-server]__a1c7c02a._.js.map} +0 -0
- /package/web/.next/static/{t8J3jMT2l7HfCuusAPC-b → 4xrMEp5YYiIKE3f9RD6L-}/_buildManifest.js +0 -0
- /package/web/.next/static/{t8J3jMT2l7HfCuusAPC-b → 4xrMEp5YYiIKE3f9RD6L-}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{t8J3jMT2l7HfCuusAPC-b → 4xrMEp5YYiIKE3f9RD6L-}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-query.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/execute-query.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiCD,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAgC3E"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
import { getDb } from '../../lib/server-db.js';
|
|
3
|
+
/**
|
|
4
|
+
* Regex pattern to detect write/destructive SQL statements.
|
|
5
|
+
* Strips SQL comments and checks for disallowed keywords.
|
|
6
|
+
*/
|
|
7
|
+
const WRITE_KEYWORDS_PATTERN = /^\s*(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|ATTACH|DETACH|REINDEX|VACUUM)\b/i;
|
|
8
|
+
/**
|
|
9
|
+
* Catches CTEs that lead to write operations: WITH ... INSERT/UPDATE/DELETE
|
|
10
|
+
*/
|
|
11
|
+
const CTE_WRITE_PATTERN = /^\s*WITH\b[\s\S]*?\b(INSERT|UPDATE|DELETE)\b/i;
|
|
12
|
+
function stripSqlComments(sql) {
|
|
13
|
+
return sql
|
|
14
|
+
.replace(/--[^\n]*/g, '') // single-line comments
|
|
15
|
+
.replace(/\/\*[\s\S]*?\*\//g, '') // multi-line comments
|
|
16
|
+
.trim();
|
|
17
|
+
}
|
|
18
|
+
function isWriteQuery(sql) {
|
|
19
|
+
const normalized = stripSqlComments(sql);
|
|
20
|
+
return WRITE_KEYWORDS_PATTERN.test(normalized) || CTE_WRITE_PATTERN.test(normalized);
|
|
21
|
+
}
|
|
22
|
+
function formatCellValue(value) {
|
|
23
|
+
if (value instanceof Uint8Array) {
|
|
24
|
+
return `(${value.length} bytes)`;
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
export async function executeQuery(sql) {
|
|
29
|
+
const trimmed = sql.trim();
|
|
30
|
+
if (!trimmed) {
|
|
31
|
+
return { error: 'Query cannot be empty' };
|
|
32
|
+
}
|
|
33
|
+
if (isWriteQuery(trimmed)) {
|
|
34
|
+
return {
|
|
35
|
+
error: 'Write operations are not allowed. Only SELECT and PRAGMA queries are permitted.',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const db = getDb();
|
|
40
|
+
const rows = db.prepare(trimmed).all();
|
|
41
|
+
const columns = rows.length > 0 ? Object.keys(rows[0]) : [];
|
|
42
|
+
const formattedRows = rows.map((row) => {
|
|
43
|
+
const formatted = {};
|
|
44
|
+
for (const [key, value] of Object.entries(row)) {
|
|
45
|
+
formatted[key] = formatCellValue(value);
|
|
46
|
+
}
|
|
47
|
+
return formatted;
|
|
48
|
+
});
|
|
49
|
+
return { columns, rows: formattedRows };
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
const message = error instanceof Error ? error.message : 'Query execution failed';
|
|
53
|
+
return { error: message };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface GetTableRowsResult {
|
|
2
|
+
columns?: string[];
|
|
3
|
+
rows?: Record<string, unknown>[];
|
|
4
|
+
totalRows?: number;
|
|
5
|
+
page?: number;
|
|
6
|
+
pageSize?: number;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function getTableRows(tableName: string, page?: number): Promise<GetTableRowsResult>;
|
|
10
|
+
//# sourceMappingURL=get-table-rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-table-rows.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/get-table-rows.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AASD,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAsD3F"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
import { getDb } from '../../lib/server-db.js';
|
|
3
|
+
const PAGE_SIZE = 50;
|
|
4
|
+
function formatCellValue(value) {
|
|
5
|
+
if (value instanceof Uint8Array) {
|
|
6
|
+
return `(${value.length} bytes)`;
|
|
7
|
+
}
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
export async function getTableRows(tableName, page = 0) {
|
|
11
|
+
try {
|
|
12
|
+
const db = getDb();
|
|
13
|
+
// Validate table name against sqlite_master (prevents SQL injection)
|
|
14
|
+
const tableExists = db
|
|
15
|
+
.prepare(`SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?`)
|
|
16
|
+
.get(tableName);
|
|
17
|
+
if (!tableExists) {
|
|
18
|
+
return { error: `Table "${tableName}" not found` };
|
|
19
|
+
}
|
|
20
|
+
const countRow = db.prepare(`SELECT COUNT(*) as count FROM "${tableName}"`).get();
|
|
21
|
+
const totalRows = countRow.count;
|
|
22
|
+
const offset = page * PAGE_SIZE;
|
|
23
|
+
const rows = db
|
|
24
|
+
.prepare(`SELECT * FROM "${tableName}" LIMIT ? OFFSET ?`)
|
|
25
|
+
.all(PAGE_SIZE, offset);
|
|
26
|
+
// Get column names from first row or from pragma if empty
|
|
27
|
+
let columns;
|
|
28
|
+
if (rows.length > 0) {
|
|
29
|
+
columns = Object.keys(rows[0]);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const pragmaResult = db.prepare(`PRAGMA table_info("${tableName}")`).all();
|
|
33
|
+
columns = pragmaResult.map((c) => c.name);
|
|
34
|
+
}
|
|
35
|
+
// Format BLOB values
|
|
36
|
+
const formattedRows = rows.map((row) => {
|
|
37
|
+
const formatted = {};
|
|
38
|
+
for (const [key, value] of Object.entries(row)) {
|
|
39
|
+
formatted[key] = formatCellValue(value);
|
|
40
|
+
}
|
|
41
|
+
return formatted;
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
columns,
|
|
45
|
+
rows: formattedRows,
|
|
46
|
+
totalRows,
|
|
47
|
+
page,
|
|
48
|
+
pageSize: PAGE_SIZE,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
const message = error instanceof Error ? error.message : 'Failed to fetch table rows';
|
|
53
|
+
return { error: message };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ColumnInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
notnull: boolean;
|
|
5
|
+
defaultValue: string | null;
|
|
6
|
+
primaryKey: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface GetTableSchemaResult {
|
|
9
|
+
columns?: ColumnInfo[];
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function getTableSchema(tableName: string): Promise<GetTableSchemaResult>;
|
|
13
|
+
//# sourceMappingURL=get-table-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-table-schema.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/get-table-schema.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAmCrF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
import { getDb } from '../../lib/server-db.js';
|
|
3
|
+
export async function getTableSchema(tableName) {
|
|
4
|
+
try {
|
|
5
|
+
const db = getDb();
|
|
6
|
+
// Validate table name against sqlite_master
|
|
7
|
+
const tableExists = db
|
|
8
|
+
.prepare(`SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?`)
|
|
9
|
+
.get(tableName);
|
|
10
|
+
if (!tableExists) {
|
|
11
|
+
return { error: `Table "${tableName}" not found` };
|
|
12
|
+
}
|
|
13
|
+
const pragmaResult = db.prepare(`PRAGMA table_info("${tableName}")`).all();
|
|
14
|
+
const columns = pragmaResult.map((col) => ({
|
|
15
|
+
name: col.name,
|
|
16
|
+
type: col.type || 'TEXT',
|
|
17
|
+
notnull: col.notnull === 1,
|
|
18
|
+
defaultValue: col.dflt_value,
|
|
19
|
+
primaryKey: col.pk > 0,
|
|
20
|
+
}));
|
|
21
|
+
return { columns };
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
const message = error instanceof Error ? error.message : 'Failed to fetch table schema';
|
|
25
|
+
return { error: message };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface TableInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
rowCount: number;
|
|
4
|
+
}
|
|
5
|
+
export interface ListTablesResult {
|
|
6
|
+
tables?: TableInfo[];
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function listTables(): Promise<ListTablesResult>;
|
|
10
|
+
//# sourceMappingURL=list-tables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-tables.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/list-tables.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAsB5D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
import { getDb } from '../../lib/server-db.js';
|
|
3
|
+
export async function listTables() {
|
|
4
|
+
try {
|
|
5
|
+
const db = getDb();
|
|
6
|
+
const tables = db
|
|
7
|
+
.prepare(`SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%' ORDER BY name`)
|
|
8
|
+
.all();
|
|
9
|
+
const result = tables.map((t) => {
|
|
10
|
+
const row = db.prepare(`SELECT COUNT(*) as count FROM "${t.name}"`).get();
|
|
11
|
+
return { name: t.name, rowCount: row.count };
|
|
12
|
+
});
|
|
13
|
+
return { tables: result };
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
const message = error instanceof Error ? error.message : 'Failed to list tables';
|
|
17
|
+
return { error: message };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/database/page.tsx"],"names":[],"mappings":"AAMA,2EAA2E;AAC3E,eAAO,MAAM,OAAO,kBAAkB,CAAC;AAEvC,wBAA8B,YAAY,qDAsBzC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { listTables } from '../actions/list-tables.js';
|
|
3
|
+
import { getTableRows } from '../actions/get-table-rows.js';
|
|
4
|
+
import { getTableSchema } from '../actions/get-table-schema.js';
|
|
5
|
+
import { executeQuery } from '../actions/execute-query.js';
|
|
6
|
+
import { DatabasePageClient } from '../../components/features/database/database-page-client.js';
|
|
7
|
+
/** Skip static pre-rendering since we need runtime database connection. */
|
|
8
|
+
export const dynamic = 'force-dynamic';
|
|
9
|
+
export default async function DatabasePage() {
|
|
10
|
+
const { tables, error } = await listTables();
|
|
11
|
+
if (error || !tables) {
|
|
12
|
+
return (_jsx("div", { className: "flex h-full flex-col p-6", children: _jsxs("p", { className: "text-destructive text-sm", children: ["Failed to load database: ", error] }) }));
|
|
13
|
+
}
|
|
14
|
+
return (_jsx("div", { className: "flex h-full flex-col overflow-hidden px-6 pb-6", children: _jsx(DatabasePageClient, { initialTables: tables, fetchRows: getTableRows, fetchSchema: getTableSchema, runQuery: executeQuery, className: "min-h-0 flex-1" }) }));
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI/D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,UAAU,CAAC;IACjB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"feature-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI/D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,UAAU,CAAC;IACjB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,wBAAwB,2CAqkB1F"}
|
package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js
CHANGED
|
@@ -194,6 +194,10 @@ export function FeatureDrawerClient({ view: initialView, urlTab }) {
|
|
|
194
194
|
if (result.iterationWarning) {
|
|
195
195
|
toast.warning(`Iteration ${result.iteration} — consider approving or adjusting feedback to avoid excessive iterations`);
|
|
196
196
|
}
|
|
197
|
+
// Optimistically update canvas node before SSE arrives (~500ms delay)
|
|
198
|
+
window.dispatchEvent(new CustomEvent('shep:feature-approved', {
|
|
199
|
+
detail: { featureId: featureNode.featureId },
|
|
200
|
+
}));
|
|
197
201
|
onClose();
|
|
198
202
|
onDone?.();
|
|
199
203
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-control-center-state.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/features/control-center/use-control-center-state.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAgBjC,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAM7E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,aAAa,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/D,aAAa,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/E,YAAY,EAAE,CAAC,SAAS,EAAE,eAAe,KAAK,IAAI,CAAC;IACnD,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7F,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,sBAAsB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,iBAAiB,EAAE,CACjB,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,YAAY,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,EACvC,QAAQ,CAAC,EAAE,MAAM,KACd,MAAM,CAAC;IACZ,wDAAwD;IACxD,wBAAwB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACxE,gDAAgD;IAChD,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IACtE,0EAA0E;IAC1E,YAAY,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,CAAC;CACnD;AAQD,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,cAAc,EAAE,EAC9B,YAAY,EAAE,IAAI,EAAE,GACnB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"use-control-center-state.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/features/control-center/use-control-center-state.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAgBjC,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAM7E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,aAAa,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/D,aAAa,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/E,YAAY,EAAE,CAAC,SAAS,EAAE,eAAe,KAAK,IAAI,CAAC;IACnD,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7F,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,sBAAsB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,iBAAiB,EAAE,CACjB,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,YAAY,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,EACvC,QAAQ,CAAC,EAAE,MAAM,KACd,MAAM,CAAC;IACZ,wDAAwD;IACxD,wBAAwB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACxE,gDAAgD;IAChD,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IACtE,0EAA0E;IAC1E,YAAY,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,CAAC;CACnD;AAQD,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,cAAc,EAAE,EAC9B,YAAY,EAAE,IAAI,EAAE,GACnB,kBAAkB,CA6gBpB"}
|
package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js
CHANGED
|
@@ -115,15 +115,19 @@ export function useControlCenterState(initialNodes, initialEdges) {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}, [events, updateFeature]);
|
|
118
|
-
// Listen for optimistic approval events from the drawer (fires before SSE arrives)
|
|
118
|
+
// Listen for optimistic approval/rejection events from the drawer (fires before SSE arrives).
|
|
119
|
+
// Uses beginMutation + endMutation to prevent stale poll/reconcile data from overwriting
|
|
120
|
+
// the optimistic 'running' state during the transition window (avoids brief "Something went wrong" flash).
|
|
119
121
|
useEffect(() => {
|
|
120
122
|
const handler = (e) => {
|
|
121
123
|
const { featureId } = e.detail;
|
|
124
|
+
beginMutation();
|
|
122
125
|
updateFeature(`feat-${featureId}`, { state: 'running' });
|
|
126
|
+
endMutation();
|
|
123
127
|
};
|
|
124
128
|
window.addEventListener('shep:feature-approved', handler);
|
|
125
129
|
return () => window.removeEventListener('shep:feature-approved', handler);
|
|
126
|
-
}, [updateFeature]);
|
|
130
|
+
}, [updateFeature, beginMutation, endMutation]);
|
|
127
131
|
// Separate effect: fetch metadata (name + description) when SSE reports it changed
|
|
128
132
|
const metadataFetchedRef = useRef(new Set());
|
|
129
133
|
const processedMetadataCountRef = useRef(0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface CellValueDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange: (open: boolean) => void;
|
|
4
|
+
columnName: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function CellValueDialog({ open, onOpenChange, columnName, value }: CellValueDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=cell-value-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-value-dialog.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/features/database/cell-value-dialog.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,oBAAoB,2CAe9F"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../../ui/dialog.js';
|
|
4
|
+
import { ScrollArea } from '../../ui/scroll-area.js';
|
|
5
|
+
export function CellValueDialog({ open, onOpenChange, columnName, value }) {
|
|
6
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "max-w-2xl", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: columnName }) }), _jsx(ScrollArea, { className: "max-h-[60vh]", children: _jsx("pre", { className: "text-sm break-all whitespace-pre-wrap", "data-testid": "cell-value-content", children: value }) })] }) }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { CellValueDialog } from './cell-value-dialog.js';
|
|
3
|
+
declare const meta: Meta<typeof CellValueDialog>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const ShortText: Story;
|
|
7
|
+
export declare const LongText: Story;
|
|
8
|
+
export declare const BlobValue: Story;
|
|
9
|
+
export declare const JsonValue: Story;
|
|
10
|
+
//# sourceMappingURL=cell-value-dialog.stories.d.ts.map
|
package/dist/src/presentation/web/components/features/database/cell-value-dialog.stories.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-value-dialog.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/features/database/cell-value-dialog.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAYtC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAMnC,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAKvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAevB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { fn } from '@storybook/test';
|
|
2
|
+
import { CellValueDialog } from './cell-value-dialog.js';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Features/Database/CellValueDialog',
|
|
5
|
+
component: CellValueDialog,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
args: {
|
|
11
|
+
open: true,
|
|
12
|
+
onOpenChange: fn(),
|
|
13
|
+
columnName: 'description',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
/* ---------------------------------------------------------------------------
|
|
18
|
+
* Stories
|
|
19
|
+
* ------------------------------------------------------------------------- */
|
|
20
|
+
export const ShortText = {
|
|
21
|
+
args: {
|
|
22
|
+
value: 'A simple short text value.',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export const LongText = {
|
|
26
|
+
args: {
|
|
27
|
+
columnName: 'content',
|
|
28
|
+
value: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris.',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export const BlobValue = {
|
|
32
|
+
args: {
|
|
33
|
+
columnName: 'data',
|
|
34
|
+
value: '(2048 bytes)',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export const JsonValue = {
|
|
38
|
+
args: {
|
|
39
|
+
columnName: 'metadata',
|
|
40
|
+
value: JSON.stringify({
|
|
41
|
+
id: 'feat-12345',
|
|
42
|
+
name: 'database-management-ui',
|
|
43
|
+
status: 'in_progress',
|
|
44
|
+
config: { maxRetries: 3, timeout: 30000 },
|
|
45
|
+
tags: ['web', 'database', 'ui'],
|
|
46
|
+
}, null, 2),
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TableInfo } from '../../../app/actions/list-tables.js';
|
|
2
|
+
import type { GetTableSchemaResult } from '../../../app/actions/get-table-schema.js';
|
|
3
|
+
import type { GetTableRowsResult } from '../../../app/actions/get-table-rows.js';
|
|
4
|
+
import type { ExecuteQueryResult } from '../../../app/actions/execute-query.js';
|
|
5
|
+
export interface DatabasePageClientProps {
|
|
6
|
+
initialTables: TableInfo[];
|
|
7
|
+
fetchRows: (tableName: string, page: number) => Promise<GetTableRowsResult>;
|
|
8
|
+
fetchSchema: (tableName: string) => Promise<GetTableSchemaResult>;
|
|
9
|
+
runQuery: (sql: string) => Promise<ExecuteQueryResult>;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function DatabasePageClient({ initialTables, fetchRows: fetchRowsAction, fetchSchema: fetchSchemaAction, runQuery, className, }: DatabasePageClientProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=database-page-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database-page-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/features/database/database-page-client.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAc,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAItE,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC5E,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAClE,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,aAAa,EACb,SAAS,EAAE,eAAe,EAC1B,WAAW,EAAE,iBAAiB,EAC9B,QAAQ,EACR,SAAS,GACV,EAAE,uBAAuB,2CA6LzB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useCallback } from 'react';
|
|
4
|
+
import { Database, Table2, Code2, Columns3 } from 'lucide-react';
|
|
5
|
+
import { Tabs, TabsList, TabsTrigger } from '../../ui/tabs.js';
|
|
6
|
+
import { TableList } from './table-list.js';
|
|
7
|
+
import { RowBrowser } from './row-browser.js';
|
|
8
|
+
import { SchemaViewer } from './schema-viewer.js';
|
|
9
|
+
import { QueryRunner } from './query-runner.js';
|
|
10
|
+
export function DatabasePageClient({ initialTables, fetchRows: fetchRowsAction, fetchSchema: fetchSchemaAction, runQuery, className, }) {
|
|
11
|
+
const [selectedTable, setSelectedTable] = useState(null);
|
|
12
|
+
const [activeTab, setActiveTab] = useState('data');
|
|
13
|
+
// Row browser state
|
|
14
|
+
const [columns, setColumns] = useState([]);
|
|
15
|
+
const [rows, setRows] = useState([]);
|
|
16
|
+
const [totalRows, setTotalRows] = useState(0);
|
|
17
|
+
const [page, setPage] = useState(0);
|
|
18
|
+
const [pageSize, setPageSize] = useState(50);
|
|
19
|
+
const [rowsLoading, setRowsLoading] = useState(false);
|
|
20
|
+
// Schema state
|
|
21
|
+
const [schemaColumns, setSchemaColumns] = useState([]);
|
|
22
|
+
const [schemaLoading, setSchemaLoading] = useState(false);
|
|
23
|
+
const fetchRows = useCallback(async (tableName, pageNum) => {
|
|
24
|
+
setRowsLoading(true);
|
|
25
|
+
try {
|
|
26
|
+
const result = await fetchRowsAction(tableName, pageNum);
|
|
27
|
+
if (result.error) {
|
|
28
|
+
setColumns([]);
|
|
29
|
+
setRows([]);
|
|
30
|
+
setTotalRows(0);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
setColumns(result.columns ?? []);
|
|
34
|
+
setRows(result.rows ?? []);
|
|
35
|
+
setTotalRows(result.totalRows ?? 0);
|
|
36
|
+
setPage(result.page ?? 0);
|
|
37
|
+
setPageSize(result.pageSize ?? 50);
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
setRowsLoading(false);
|
|
41
|
+
}
|
|
42
|
+
}, [fetchRowsAction]);
|
|
43
|
+
const fetchSchema = useCallback(async (tableName) => {
|
|
44
|
+
setSchemaLoading(true);
|
|
45
|
+
try {
|
|
46
|
+
const result = await fetchSchemaAction(tableName);
|
|
47
|
+
if (result.error) {
|
|
48
|
+
setSchemaColumns([]);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
setSchemaColumns(result.columns ?? []);
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
setSchemaLoading(false);
|
|
55
|
+
}
|
|
56
|
+
}, [fetchSchemaAction]);
|
|
57
|
+
const handleSelectTable = useCallback((tableName) => {
|
|
58
|
+
setSelectedTable(tableName);
|
|
59
|
+
setPage(0);
|
|
60
|
+
setActiveTab('data');
|
|
61
|
+
fetchRows(tableName, 0);
|
|
62
|
+
fetchSchema(tableName);
|
|
63
|
+
}, [fetchRows, fetchSchema]);
|
|
64
|
+
const handlePageChange = useCallback((newPage) => {
|
|
65
|
+
if (selectedTable) {
|
|
66
|
+
setPage(newPage);
|
|
67
|
+
fetchRows(selectedTable, newPage);
|
|
68
|
+
}
|
|
69
|
+
}, [selectedTable, fetchRows]);
|
|
70
|
+
const handleExecuteQuery = useCallback(async (sql) => {
|
|
71
|
+
return runQuery(sql);
|
|
72
|
+
}, [runQuery]);
|
|
73
|
+
return (_jsxs("div", { "data-testid": "database-page-client", className: `flex flex-col ${className ?? ''}`, children: [_jsxs("div", { className: "mb-3 flex items-center gap-2.5 pt-1", children: [_jsx("div", { className: "bg-primary/10 flex h-7 w-7 items-center justify-center rounded-md", children: _jsx(Database, { className: "text-primary h-4 w-4" }) }), _jsxs("div", { children: [_jsx("h1", { className: "text-sm font-semibold tracking-tight", children: "Database Browser" }), _jsxs("p", { className: "text-muted-foreground text-xs", children: [initialTables.length, " table", initialTables.length !== 1 ? 's' : ''] })] })] }), _jsxs("div", { className: "flex min-h-0 flex-1 gap-3", children: [_jsxs("div", { className: "border-border bg-card flex w-56 flex-col rounded-lg border", children: [_jsx("div", { className: "border-border border-b px-3 py-2", children: _jsx("span", { className: "text-muted-foreground text-xs font-medium tracking-wider uppercase", children: "Tables" }) }), _jsx("div", { className: "min-h-0 flex-1", children: _jsx(TableList, { tables: initialTables, selectedTable: selectedTable, onSelectTable: handleSelectTable }) })] }), _jsx("div", { className: "flex min-w-0 flex-1 flex-col", children: selectedTable ? (_jsxs("div", { className: "border-border bg-card flex min-h-0 flex-1 flex-col rounded-lg border", children: [_jsxs("div", { className: "border-border flex items-center justify-between border-b px-4 py-2", children: [_jsx("span", { className: "font-mono text-sm font-medium", children: selectedTable }), _jsx(Tabs, { value: activeTab, onValueChange: (v) => setActiveTab(v), "data-testid": "database-tabs", children: _jsxs(TabsList, { className: "h-7", children: [_jsxs(TabsTrigger, { value: "data", className: "gap-1.5 px-2.5 text-xs", "data-testid": "tab-data", children: [_jsx(Table2, { className: "h-3 w-3" }), "Data"] }), _jsxs(TabsTrigger, { value: "schema", className: "gap-1.5 px-2.5 text-xs", "data-testid": "tab-schema", children: [_jsx(Columns3, { className: "h-3 w-3" }), "Schema"] }), _jsxs(TabsTrigger, { value: "query", className: "gap-1.5 px-2.5 text-xs", "data-testid": "tab-query", children: [_jsx(Code2, { className: "h-3 w-3" }), "Query"] })] }) })] }), _jsxs("div", { className: "min-h-0 flex-1 overflow-auto p-4", children: [activeTab === 'data' && (_jsx(RowBrowser, { columns: columns, rows: rows, totalRows: totalRows, page: page, pageSize: pageSize, onPageChange: handlePageChange, loading: rowsLoading })), activeTab === 'schema' && (_jsx(SchemaViewer, { columns: schemaColumns, loading: schemaLoading })), activeTab === 'query' && _jsx(QueryRunner, { onExecute: handleExecuteQuery })] })] })) : (_jsxs("div", { className: "border-border bg-card flex flex-1 flex-col items-center justify-center rounded-lg border", children: [_jsx("div", { className: "bg-muted/50 mb-3 flex h-12 w-12 items-center justify-center rounded-full", children: _jsx(Database, { className: "text-muted-foreground h-6 w-6" }) }), _jsx("p", { className: "text-muted-foreground text-sm", children: "Select a table to browse its data" })] })) })] })] }));
|
|
74
|
+
}
|
package/dist/src/presentation/web/components/features/database/database-page-client.stories.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DatabasePageClient } from './database-page-client.js';
|
|
3
|
+
declare const meta: Meta<typeof DatabasePageClient>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const EmptyDatabase: Story;
|
|
8
|
+
export declare const SingleTable: Story;
|
|
9
|
+
//# sourceMappingURL=database-page-client.stories.d.ts.map
|
package/dist/src/presentation/web/components/features/database/database-page-client.stories.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database-page-client.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/features/database/database-page-client.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AA8C5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAmBzC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAUnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAI3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC"}
|
package/dist/src/presentation/web/components/features/database/database-page-client.stories.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DatabasePageClient } from './database-page-client.js';
|
|
3
|
+
const mockFetchRows = async (_tableName, page) => ({
|
|
4
|
+
columns: ['id', 'name', 'status', 'created_at'],
|
|
5
|
+
rows: [
|
|
6
|
+
{ id: 1, name: 'auth-module', status: 'done', created_at: '2026-01-15' },
|
|
7
|
+
{ id: 2, name: 'payment-flow', status: 'in-progress', created_at: '2026-02-01' },
|
|
8
|
+
{ id: 3, name: 'dashboard', status: 'pending', created_at: '2026-02-10' },
|
|
9
|
+
],
|
|
10
|
+
totalRows: 42,
|
|
11
|
+
page,
|
|
12
|
+
pageSize: 50,
|
|
13
|
+
});
|
|
14
|
+
const mockFetchSchema = async (_tableName) => ({
|
|
15
|
+
columns: [
|
|
16
|
+
{ name: 'id', type: 'INTEGER', notnull: true, defaultValue: null, primaryKey: true },
|
|
17
|
+
{ name: 'name', type: 'TEXT', notnull: true, defaultValue: null, primaryKey: false },
|
|
18
|
+
{ name: 'status', type: 'TEXT', notnull: false, defaultValue: "'pending'", primaryKey: false },
|
|
19
|
+
{
|
|
20
|
+
name: 'created_at',
|
|
21
|
+
type: 'TEXT',
|
|
22
|
+
notnull: true,
|
|
23
|
+
defaultValue: 'CURRENT_TIMESTAMP',
|
|
24
|
+
primaryKey: false,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
});
|
|
28
|
+
const mockRunQuery = async (sql) => {
|
|
29
|
+
if (sql.toLowerCase().includes('error')) {
|
|
30
|
+
return { error: 'near "error": syntax error' };
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
columns: ['id', 'name'],
|
|
34
|
+
rows: [
|
|
35
|
+
{ id: 1, name: 'result-1' },
|
|
36
|
+
{ id: 2, name: 'result-2' },
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const meta = {
|
|
41
|
+
title: 'Features/Database/DatabasePageClient',
|
|
42
|
+
component: DatabasePageClient,
|
|
43
|
+
tags: ['autodocs'],
|
|
44
|
+
parameters: {
|
|
45
|
+
layout: 'fullscreen',
|
|
46
|
+
},
|
|
47
|
+
decorators: [
|
|
48
|
+
(Story) => (_jsx("div", { style: { height: '100vh', padding: '24px', display: 'flex', flexDirection: 'column' }, children: _jsx(Story, {}) })),
|
|
49
|
+
],
|
|
50
|
+
args: {
|
|
51
|
+
fetchRows: mockFetchRows,
|
|
52
|
+
fetchSchema: mockFetchSchema,
|
|
53
|
+
runQuery: mockRunQuery,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
export default meta;
|
|
57
|
+
const mockTables = [
|
|
58
|
+
{ name: 'features', rowCount: 42 },
|
|
59
|
+
{ name: 'repositories', rowCount: 5 },
|
|
60
|
+
{ name: 'settings', rowCount: 12 },
|
|
61
|
+
{ name: 'migrations', rowCount: 8 },
|
|
62
|
+
{ name: 'agent_events', rowCount: 1024 },
|
|
63
|
+
];
|
|
64
|
+
export const Default = {
|
|
65
|
+
args: {
|
|
66
|
+
initialTables: mockTables,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
export const EmptyDatabase = {
|
|
70
|
+
args: {
|
|
71
|
+
initialTables: [],
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
export const SingleTable = {
|
|
75
|
+
args: {
|
|
76
|
+
initialTables: [{ name: 'features', rowCount: 3 }],
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface QueryRunnerProps {
|
|
2
|
+
onExecute: (sql: string) => Promise<{
|
|
3
|
+
columns?: string[];
|
|
4
|
+
rows?: Record<string, unknown>[];
|
|
5
|
+
error?: string;
|
|
6
|
+
}>;
|
|
7
|
+
}
|
|
8
|
+
export declare function QueryRunner({ onExecute }: QueryRunnerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=query-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-runner.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/features/database/query-runner.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;QAClC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QACjC,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACJ;AASD,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,gBAAgB,2CAwJ1D"}
|