d1s 0.3.13 → 0.3.14
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/.next/BUILD_ID +1 -1
- package/dist/.next/app-build-manifest.json +43 -43
- package/dist/.next/app-path-routes-manifest.json +11 -11
- package/dist/.next/build-manifest.json +2 -2
- package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found.html +1 -1
- package/dist/.next/server/app/_not-found.rsc +1 -1
- package/dist/.next/server/app/api/cloudflare/route.js +1 -1
- package/dist/.next/server/app/api/cloudflare/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/databases/route.js +1 -1
- package/dist/.next/server/app/api/databases/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/migrations/list/route.js +2 -2
- package/dist/.next/server/app/api/migrations/list/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/migrations/sync/route.js +3 -3
- package/dist/.next/server/app/api/migrations/sync/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/migrations/sync-files/route.js +2 -2
- package/dist/.next/server/app/api/migrations/sync-files/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/pro/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/pull-data/confirm/route.js +1 -1
- package/dist/.next/server/app/api/pull-data/confirm/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/pull-remote/confirm/route.js +2 -2
- package/dist/.next/server/app/api/pull-remote/confirm/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/pull-remote/preview/route.js +2 -2
- package/dist/.next/server/app/api/pull-remote/preview/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/push-remote/confirm/route.js +3 -3
- package/dist/.next/server/app/api/push-remote/confirm/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/push-remote/preview/route.js +3 -3
- package/dist/.next/server/app/api/push-remote/preview/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/query/route.js +3 -3
- package/dist/.next/server/app/api/query/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/schema/route.js +1 -1
- package/dist/.next/server/app/api/schema/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/tables/[name]/import/route.js +1 -1
- package/dist/.next/server/app/api/tables/[name]/import/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/tables/[name]/route.js +2 -2
- package/dist/.next/server/app/api/tables/[name]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/tables/route.js +2 -2
- package/dist/.next/server/app/api/tables/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/time-travel/preview/route.js +1 -1
- package/dist/.next/server/app/api/time-travel/preview/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/time-travel/restore/route.js +1 -1
- package/dist/.next/server/app/api/time-travel/restore/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/update/route.js +1 -1
- package/dist/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/index.html +2 -2
- package/dist/.next/server/app/index.rsc +2 -2
- package/dist/.next/server/app/page.js +1 -1
- package/dist/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app-paths-manifest.json +11 -11
- package/dist/.next/server/chunks/366.js +1 -1
- package/dist/.next/server/chunks/386.js +4 -4
- package/dist/.next/server/chunks/626.js +1 -1
- package/dist/.next/server/pages/404.html +1 -1
- package/dist/.next/server/pages/500.html +1 -1
- package/dist/.next/server/pages-manifest.json +1 -1
- package/dist/.next/static/chunks/app/{page-39d6f7bc281c828c.js → page-5f5e2a64d451ecb1.js} +1 -1
- package/dist/.next/trace +3 -3
- package/dist/app/api/migrations/sync/route.js +1 -3
- package/dist/app/api/pull-data/confirm/route.js +2 -22
- package/dist/app/api/pull-remote/confirm/route.js +0 -15
- package/dist/app/api/push-remote/confirm/route.js +0 -6
- package/dist/app/api/push-remote/preview/route.js +0 -4
- package/dist/app/api/query/route.js +0 -6
- package/dist/app/api/tables/route.js +0 -3
- package/dist/app/api/time-travel/preview/route.js +0 -2
- package/dist/app/api/time-travel/restore/route.js +0 -2
- package/dist/app/api/update/route.js +1 -2
- package/dist/lib/find-wrangler-config.js +0 -3
- package/dist/lib/local-db.js +0 -6
- package/dist/lib/sql-operations.js +1 -15
- package/package.json +1 -1
- /package/dist/.next/static/{ghHdNJKQy3Hmu0UqGdL7v → o_MkOiVF7_eRHovqofgAP}/_buildManifest.js +0 -0
- /package/dist/.next/static/{ghHdNJKQy3Hmu0UqGdL7v → o_MkOiVF7_eRHovqofgAP}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/push-remote/confirm/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"622":{"*":{"id":"82146","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"32122","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"31603","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"60122","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"75170","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"12263","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"78922","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"54160","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"60673","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"68495","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"29234","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"77526","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5706,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":134,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/globals.css":{"id":3673,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx":{"id":7747,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js":{"id":3190,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/page.jsx":{"id":930,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","69","static/chunks/69-00a70b2df83ed9ee.js","823","static/chunks/823-77b9a2d152da81dd.js","974","static/chunks/app/page-
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/push-remote/confirm/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"622":{"*":{"id":"82146","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"32122","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"31603","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"60122","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"75170","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"12263","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"78922","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"54160","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"60673","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"68495","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"29234","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"77526","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5706,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":134,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/globals.css":{"id":3673,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx":{"id":7747,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js":{"id":3190,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/page.jsx":{"id":930,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","69","static/chunks/69-00a70b2df83ed9ee.js","823","static/chunks/823-77b9a2d152da81dd.js","974","static/chunks/app/page-5f5e2a64d451ecb1.js"],"async":false}},"entryCSSFiles":{"/Volumes/ProjectSpace/_wip/d1studio/src/":[],"/Volumes/ProjectSpace/_wip/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/262ae258bbcfd289.css"}],"/Volumes/ProjectSpace/_wip/d1studio/src/app/page":[],"/Volumes/ProjectSpace/_wip/d1studio/src/app/api/push-remote/confirm/route":[]},"rscModuleMapping":{"622":{"*":{"id":"51384","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"1905","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"23597","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"46254","name":"*","chunks":[],"async":false}},"3673":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"89748","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"73041","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"7184","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"81170","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"44158","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"36893","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"69576","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"6060","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=868,a.ids=[868],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1708:a=>{a.exports=require("node:process")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},27252:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>J,patchFetch:()=>I,routeModule:()=>E,serverHooks:()=>H,workAsyncStorage:()=>F,workUnitAsyncStorage:()=>G});var d={};c.r(d),c.d(d,{OPTIONS:()=>D,POST:()=>C});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(79748),w=c(33873),x=c(63491),y=c(89827),z=c(
|
|
1
|
+
"use strict";(()=>{var a={};a.id=868,a.ids=[868],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1708:a=>{a.exports=require("node:process")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},27252:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>J,patchFetch:()=>I,routeModule:()=>E,serverHooks:()=>H,workAsyncStorage:()=>F,workUnitAsyncStorage:()=>G});var d={};c.r(d),c.d(d,{OPTIONS:()=>D,POST:()=>C});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(79748),w=c(33873),x=c(63491),y=c(89827),z=c(62435),A=c(51082);async function B(a,b,c=!0,d){let e=process.env;try{let c=`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS d1_migrations (
|
|
3
3
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
4
4
|
name TEXT NOT NULL UNIQUE,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
name TEXT NOT NULL UNIQUE,
|
|
12
12
|
applied_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
13
13
|
);
|
|
14
|
-
`;await (0,y.KK)(a,b,c),await (0,y.KK)(a,b,f,e,!0);let g=await (0,y.KK)(a,b,"SELECT name FROM d1_migrations ORDER BY applied_at;",e,!0),h=(a=>{try{let b=JSON.parse(a);return b[0]?.results||[]}catch{return[]}})(g)
|
|
14
|
+
`;await (0,y.KK)(a,b,c),await (0,y.KK)(a,b,f,e,!0);let g=await (0,y.KK)(a,b,"SELECT name FROM d1_migrations ORDER BY applied_at;",e,!0),h=(a=>{try{let b=JSON.parse(a);return b[0]?.results||[]}catch{return[]}})(g),i=new Map(h.map(a=>[a.name,a])),j=d||w.join(a,"migrations"),k=(await (0,v.readdir)(j)).filter(a=>a.endsWith(".sql")&&!/seed/i.test(a)).sort(),l={applied:[],skipped:[],preview:[]};for(let a of k){let b=w.join(j,a),c={name:a,action:"",reason:""};try{if(!(await (0,z.JD)(b)).isValid){c.action="failed validation",c.reason="Migration validation failed",l.preview.push(c);continue}if(i.has(a)){c.action="skipped",c.reason="Already applied",l.preview.push(c),l.skipped.push({name:a,reason:c.reason});continue}c.action="will be applied",l.preview.push(c)}catch(b){c.action="failed",c.reason=b.message||"Failed to process migration",l.preview.push(c),l.skipped.push({name:a,reason:c.reason})}}return{success:!0,preview:!0,applied:l.applied.length,skipped:l.skipped.length,details:l}}catch(a){throw{type:y.wU.EXECUTION_ERROR,message:a.message||"Failed to push migrations",details:a.details||{error:a.stderr||a.message}}}}async function C(a){if("true"!==process.env.D1_IS_PRO)return u.NextResponse.json({success:!1,error:{type:"PRO_REQUIRED",message:"Pro license required. Run: d1s --license YOUR-KEY"}},{status:402});try{let b=process.env.D1_PROJECT_DIR;if(!b)return u.NextResponse.json({success:!1,error:{type:y.wU.VALIDATION_ERROR,message:"Project directory not configured"}},{status:500});let c=await (0,x.S)(b);if(!c||!c.config)return u.NextResponse.json({success:!1,error:{type:y.wU.VALIDATION_ERROR,message:"Could not find Wrangler configuration"}},{status:400});let d=c.config;if(!d.d1_databases?.length)return u.NextResponse.json({success:!1,error:{type:y.wU.VALIDATION_ERROR,message:"No D1 databases configured"}},{status:400});let e=await a.json().catch(()=>({})),f=e?.db,g=f?d.d1_databases.find(a=>a.database_name===f):d.d1_databases[0];if(!g)return u.NextResponse.json({success:!1,error:{type:y.wU.VALIDATION_ERROR,message:`Database not found: ${f}`}},{status:400});let h=g.database_name,i=g.migrations_dir?w.join(b,g.migrations_dir):w.join(b,"migrations"),j=await B(b,h,!0,i);return u.NextResponse.json({success:!0,message:"Preview generated for migrations to be pushed to remote",details:j})}catch(a){return A.A.error("Push to remote preview error:",a),u.NextResponse.json({success:!1,error:{type:a.type||y.wU.EXECUTION_ERROR,message:a.message||"Failed to push to remote preview",details:a.details||{error:a.stderr||a.message}}},{status:a.type===y.wU.VALIDATION_ERROR?400:500})}}async function D(){return new u.NextResponse(null,{status:204})}let E=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/push-remote/preview/route",pathname:"/api/push-remote/preview",filename:"route",bundlePath:"app/api/push-remote/preview/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/ProjectSpace/_wip/d1studio/src/app/api/push-remote/preview/route.js",nextConfigOutput:"",userland:d}),{workAsyncStorage:F,workUnitAsyncStorage:G,serverHooks:H}=E;function I(){return(0,g.patchFetch)({workAsyncStorage:F,workUnitAsyncStorage:G})}async function J(a,b,c){var d;let e="/api/push-remote/preview/route";"/index"===e&&(e="/");let g=await E.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:C}=g,D=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[D]||y.routes[C]);if(F&&!x){let a=!!y.routes[C],b=y.dynamicRoutes[D];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||E.isDev||x||(G="/index"===(G=C)?"/":G);let H=!0===E.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>E.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>E.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await E.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await E.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await E.onRequestError(a,b,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},62435:(a,b,c)=>{c.d(b,{A8:()=>u,CM:()=>r,GS:()=>p,Gc:()=>v,JD:()=>o,Sl:()=>t,ai:()=>q,hI:()=>s,k0:()=>m});var d=c(79748),e=c(28354),f=c(79646),g=c(55511),h=c(33873),i=c(89827),j=c(40032),k=c(51082);let l=(0,e.promisify)(f.exec);async function m(a,b,c="local",d=!1){let e="remote"===c?"--remote":"--local",f="remote"===c?`
|
|
15
15
|
CREATE TABLE IF NOT EXISTS d1_migrations (
|
|
16
16
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
17
17
|
name TEXT NOT NULL UNIQUE,
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
`:`
|
|
37
37
|
INSERT OR REPLACE INTO d1_migrations (name, checksum, applied_at)
|
|
38
38
|
VALUES ('${c}', '${d}', CURRENT_TIMESTAMP);
|
|
39
|
-
`;try{await (0,i.KK)(a,b,g,e,f)}catch(a){throw{type:i.wU.EXECUTION_ERROR,message:`Failed to record migration ${c}`,details:{file:c,error:a.message,suggestions:["Check if migration is already recorded"]}}}}async function s(a,b){try{let c=await p(a,b,{}),d=new Map(c.map(a=>[a.name,a]));return{applied:Array.from(d.keys()),count:d.size}}catch(a){throw k.A.error("Failed to compare migrations:",a),a}}function t(a){return(0,g.createHash)("sha256").update(a).digest("hex")}async function u(a,b){try{await l(`wrangler d1 execute ${b} --local --command="SELECT checksum FROM d1_migrations LIMIT 1;"`,{cwd:a})}catch{try{await l(`wrangler d1 execute ${b} --local --command="ALTER TABLE d1_migrations ADD COLUMN checksum TEXT;"`,{cwd:a})}catch{}}}async function v(a,b,c){try{let e=h.join(a,"migrations");await (0,d.mkdir)(e,{recursive:!0});let f=[],g=[],k=[];for(let a of c)a.type===i.Pg.DATA_MODIFICATION?k.push(a):g.push(a);let l=new Map,m="__no_table__";for(let a of g){let b=a.tableName?a.tableName.toLowerCase():m;l.has(b)||l.set(b,[]),l.get(b).push(a)}let o=[...l.keys()].filter(a=>a!==m),p=[];if(o.length>0){let a=o.map(a=>l.get(a)[0]);p=(0,j.IC)(a)}for(let c of p){for(let g of l.get(c)||[])try{if(g.type===i.Pg.DROP_TABLE&&!await (0,i.F9)(a,b,{},g.tableName,!1))throw Error(`no such table: ${g.tableName}`);let c=await (0,i.KK)(a,b,g.sql);if(c&&(c.toLowerCase().includes("syntax error")||c.toLowerCase().includes("sqlite_error")))throw Error(c);let j=n(g),k=h.join(e,j),l=(0,i.tn)(g.sql);await (0,d.writeFile)(k,l,"utf8");let m=t(g.sql);await q(a,b,{name:j,checksum:m},"local"),f.push({type:g.type,table:g.tableName,migration:j,checksum:m})}catch(a){throw a}l.delete(c)}if(l.has(m))for(let c of l.get(m))try{await (0,i.KK)(a,b,c.sql);let g=n(c),j=h.join(e,g),k=(0,i.tn)(c.sql);await (0,d.writeFile)(j,k,"utf8");let l=t(c.sql);await q(a,b,{name:g,checksum:l},"local"),f.push({type:c.type,table:c.tableName||null,migration:g,checksum:l})}catch(a){throw a}for(let c of k)try{await (0,i.KK)(a,b,c.sql),f.push({type:c.type,table:c.tableName||null,executed:!0})}catch(a){throw a}return f}catch(a){throw a}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873,692,347,626],()=>b(b.s=27252));module.exports=c})();
|
|
39
|
+
`;try{await (0,i.KK)(a,b,g,e,f)}catch(a){throw{type:i.wU.EXECUTION_ERROR,message:`Failed to record migration ${c}`,details:{file:c,error:a.message,suggestions:["Check if migration is already recorded"]}}}}async function s(a,b){try{let c=await p(a,b,{}),d=new Map(c.map(a=>[a.name,a]));return{applied:Array.from(d.keys()),count:d.size}}catch(a){throw k.A.error("Failed to compare migrations:",a),a}}function t(a){return(0,g.createHash)("sha256").update(a).digest("hex")}async function u(a,b){try{await l(`wrangler d1 execute ${b} --local --command="SELECT checksum FROM d1_migrations LIMIT 1;"`,{cwd:a})}catch{try{await l(`wrangler d1 execute ${b} --local --command="ALTER TABLE d1_migrations ADD COLUMN checksum TEXT;"`,{cwd:a})}catch{}}}async function v(a,b,c){try{let e=h.join(a,"migrations");await (0,d.mkdir)(e,{recursive:!0});let f=[],g=[],k=[];for(let a of c)a.type===i.Pg.DATA_MODIFICATION?k.push(a):g.push(a);let l=new Map,m="__no_table__";for(let a of g){let b=a.tableName?a.tableName.toLowerCase():m;l.has(b)||l.set(b,[]),l.get(b).push(a)}let o=[...l.keys()].filter(a=>a!==m),p=[];if(o.length>0){let a=o.map(a=>l.get(a)[0]);p=(0,j.IC)(a)}for(let c of p){for(let g of l.get(c)||[])try{if(g.type===i.Pg.DROP_TABLE&&!await (0,i.F9)(a,b,{},g.tableName,!1))throw Error(`no such table: ${g.tableName}`);let c=await (0,i.KK)(a,b,g.sql);if(c&&(c.toLowerCase().includes("syntax error")||c.toLowerCase().includes("sqlite_error")))throw Error(c);let j=n(g),k=h.join(e,j),l=(0,i.tn)(g.sql);await (0,d.writeFile)(k,l,"utf8");let m=t(g.sql);await q(a,b,{name:j,checksum:m},"local"),f.push({type:g.type,table:g.tableName,migration:j,checksum:m})}catch(a){throw a}l.delete(c)}if(l.has(m))for(let c of l.get(m))try{await (0,i.KK)(a,b,c.sql);let g=n(c),j=h.join(e,g),k=(0,i.tn)(c.sql);await (0,d.writeFile)(j,k,"utf8");let l=t(c.sql);await q(a,b,{name:g,checksum:l},"local"),f.push({type:c.type,table:c.tableName||null,migration:g,checksum:l})}catch(a){throw a}for(let c of k)try{await (0,i.KK)(a,b,c.sql),f.push({type:c.type,table:c.tableName||null,executed:!0})}catch(a){throw a}return f}catch(a){throw a}}},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},74075:a=>{a.exports=require("zlib")},76760:a=>{a.exports=require("node:path")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},81630:a=>{a.exports=require("http")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873,692,347,626],()=>b(b.s=27252));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/push-remote/preview/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"622":{"*":{"id":"82146","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"32122","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"31603","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"60122","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"75170","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"12263","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"78922","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"54160","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"60673","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"68495","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"29234","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"77526","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5706,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":134,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/globals.css":{"id":3673,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx":{"id":7747,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js":{"id":3190,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/page.jsx":{"id":930,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","69","static/chunks/69-00a70b2df83ed9ee.js","823","static/chunks/823-77b9a2d152da81dd.js","974","static/chunks/app/page-
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/push-remote/preview/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"622":{"*":{"id":"82146","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"32122","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"31603","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"60122","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"75170","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"12263","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"78922","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"54160","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"60673","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"68495","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"29234","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"77526","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5706,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":134,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/globals.css":{"id":3673,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx":{"id":7747,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js":{"id":3190,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/page.jsx":{"id":930,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","69","static/chunks/69-00a70b2df83ed9ee.js","823","static/chunks/823-77b9a2d152da81dd.js","974","static/chunks/app/page-5f5e2a64d451ecb1.js"],"async":false}},"entryCSSFiles":{"/Volumes/ProjectSpace/_wip/d1studio/src/":[],"/Volumes/ProjectSpace/_wip/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/262ae258bbcfd289.css"}],"/Volumes/ProjectSpace/_wip/d1studio/src/app/page":[],"/Volumes/ProjectSpace/_wip/d1studio/src/app/api/push-remote/preview/route":[]},"rscModuleMapping":{"622":{"*":{"id":"51384","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"1905","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"23597","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"46254","name":"*","chunks":[],"async":false}},"3673":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"89748","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"73041","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"7184","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"81170","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"44158","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"36893","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"69576","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"6060","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=58,a.ids=[58],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1708:a=>{a.exports=require("node:process")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},60293:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{OPTIONS:()=>B,POST:()=>A});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(63491),w=c(89827),x=c(
|
|
1
|
+
"use strict";(()=>{var a={};a.id=58,a.ids=[58],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1708:a=>{a.exports=require("node:process")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},60293:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{OPTIONS:()=>B,POST:()=>A});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(63491),w=c(89827),x=c(62435),y=c(84606),z=c(51082);async function A(a){try{let b,c=process.env.D1_PROJECT_DIR;if(!c)return z.A.error("Project directory not configured"),u.NextResponse.json({error:"Project directory not configured"},{status:500});let{query:d,db:e,target:f}=await a.json(),g="remote"===f?"remote":"local",h="remote"===g;if(!d?.trim())return u.NextResponse.json({success:!1,error:{message:"Query cannot be empty"}},{status:400});let i=await (0,v.S)(c);if(!i||!i.config)return z.A.error("No Wrangler configuration file found"),u.NextResponse.json({success:!1,error:{message:"No Wrangler configuration file found"}},{status:404});let j=i.config;if(!j.d1_databases?.length)return u.NextResponse.json({success:!1,error:{message:"No D1 databases configured"}},{status:404});let k=e?j.d1_databases.find(a=>a.database_name===e):j.d1_databases[0];if(!k)return u.NextResponse.json({success:!1,error:{message:`Database not found: ${e}`}},{status:404});let l=k.database_name,m=(0,w.mA)(d);if(!m.length)return u.NextResponse.json({success:!1,error:{message:"No valid SQL statements found"}},{status:400});let n=(m=m.map(w.Gq)).every(a=>{let b=a.sql.trim().toUpperCase();return b.startsWith("SELECT")||b.startsWith("PRAGMA")||b.startsWith("EXPLAIN")});if(h&&"true"!==process.env.D1_IS_PRO)return u.NextResponse.json({success:!1,error:{type:"PRO_REQUIRED",message:"Pro license required. Run: d1s --license YOUR-KEY"}},{status:402});if(h&&!n)return u.NextResponse.json({success:!1,error:{message:"Remote query mode is read-only for now. Use SELECT, PRAGMA, or EXPLAIN."}},{status:400});if(!h&&!n){let a=`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS d1_migrations (
|
|
3
3
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
4
4
|
name TEXT NOT NULL UNIQUE,
|
|
5
5
|
checksum TEXT NOT NULL,
|
|
6
6
|
applied_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
7
7
|
);
|
|
8
|
-
`;await (0,w.KK)(c,l,a,{},!1,k)}if(m.some(w.QQ)&&!h){let a=await (0,x.Gc)(c,l,m);b={success:!0,migrations:a,results:[{results:[]}],execution:{target:g,readOnly:n}}}else{let a=[];for(let b of m){let d=await (0,w.KK)(c,l,b.sql,{},h,k);try{let b=JSON.parse(d),c=b[0]?.results||[];a.push(...c)}catch(a){continue}}b={success:!0,results:[{results:a}],execution:{target:g,readOnly:n}}}return u.NextResponse.json(b)}catch(c){let a=(0,y.s)(c);z.A.error(`✗ ${a.message}`);let b=c.type===w.wU.VALIDATION_ERROR?400:c.type===w.wU.DEPENDENCY_ERROR?409:500;return u.NextResponse.json({success:!1,error:a},{status:b})}}async function B(){return new u.NextResponse(null,{status:204,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/query/route",pathname:"/api/query",filename:"route",bundlePath:"app/api/query/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/ProjectSpace/_wip/d1studio/src/app/api/query/route.js",nextConfigOutput:"",userland:d}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){var d;let e="/api/query/route";"/index"===e&&(e="/");let g=await C.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||C.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===C.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>C.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>C.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await C.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},
|
|
8
|
+
`;await (0,w.KK)(c,l,a,{},!1,k)}if(m.some(w.QQ)&&!h){let a=await (0,x.Gc)(c,l,m);b={success:!0,migrations:a,results:[{results:[]}],execution:{target:g,readOnly:n}}}else{let a=[];for(let b of m){let d=await (0,w.KK)(c,l,b.sql,{},h,k);try{let b=JSON.parse(d),c=b[0]?.results||[];a.push(...c)}catch(a){continue}}b={success:!0,results:[{results:a}],execution:{target:g,readOnly:n}}}return u.NextResponse.json(b)}catch(c){let a=(0,y.s)(c);z.A.error(`✗ ${a.message}`);let b=c.type===w.wU.VALIDATION_ERROR?400:c.type===w.wU.DEPENDENCY_ERROR?409:500;return u.NextResponse.json({success:!1,error:a},{status:b})}}async function B(){return new u.NextResponse(null,{status:204,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/query/route",pathname:"/api/query",filename:"route",bundlePath:"app/api/query/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/ProjectSpace/_wip/d1studio/src/app/api/query/route.js",nextConfigOutput:"",userland:d}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){var d;let e="/api/query/route";"/index"===e&&(e="/");let g=await C.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||C.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===C.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>C.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>C.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await C.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},62435:(a,b,c)=>{c.d(b,{A8:()=>u,CM:()=>r,GS:()=>p,Gc:()=>v,JD:()=>o,Sl:()=>t,ai:()=>q,hI:()=>s,k0:()=>m});var d=c(79748),e=c(28354),f=c(79646),g=c(55511),h=c(33873),i=c(89827),j=c(40032),k=c(51082);let l=(0,e.promisify)(f.exec);async function m(a,b,c="local",d=!1){let e="remote"===c?"--remote":"--local",f="remote"===c?`
|
|
9
9
|
CREATE TABLE IF NOT EXISTS d1_migrations (
|
|
10
10
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
11
11
|
name TEXT NOT NULL UNIQUE,
|
|
@@ -30,4 +30,4 @@
|
|
|
30
30
|
`:`
|
|
31
31
|
INSERT OR REPLACE INTO d1_migrations (name, checksum, applied_at)
|
|
32
32
|
VALUES ('${c}', '${d}', CURRENT_TIMESTAMP);
|
|
33
|
-
`;try{await (0,i.KK)(a,b,g,e,f)}catch(a){throw{type:i.wU.EXECUTION_ERROR,message:`Failed to record migration ${c}`,details:{file:c,error:a.message,suggestions:["Check if migration is already recorded"]}}}}async function s(a,b){try{let c=await p(a,b,{}),d=new Map(c.map(a=>[a.name,a]));return{applied:Array.from(d.keys()),count:d.size}}catch(a){throw k.A.error("Failed to compare migrations:",a),a}}function t(a){return(0,g.createHash)("sha256").update(a).digest("hex")}async function u(a,b){try{await l(`wrangler d1 execute ${b} --local --command="SELECT checksum FROM d1_migrations LIMIT 1;"`,{cwd:a})}catch{try{await l(`wrangler d1 execute ${b} --local --command="ALTER TABLE d1_migrations ADD COLUMN checksum TEXT;"`,{cwd:a})}catch{}}}async function v(a,b,c){try{let e=h.join(a,"migrations");await (0,d.mkdir)(e,{recursive:!0});let f=[],g=[],k=[];for(let a of c)a.type===i.Pg.DATA_MODIFICATION?k.push(a):g.push(a);let l=new Map,m="__no_table__";for(let a of g){let b=a.tableName?a.tableName.toLowerCase():m;l.has(b)||l.set(b,[]),l.get(b).push(a)}let o=[...l.keys()].filter(a=>a!==m),p=[];if(o.length>0){let a=o.map(a=>l.get(a)[0]);p=(0,j.IC)(a)}for(let c of p){for(let g of l.get(c)||[])try{if(g.type===i.Pg.DROP_TABLE&&!await (0,i.F9)(a,b,{},g.tableName,!1))throw Error(`no such table: ${g.tableName}`);let c=await (0,i.KK)(a,b,g.sql);if(c&&(c.toLowerCase().includes("syntax error")||c.toLowerCase().includes("sqlite_error")))throw Error(c);let j=n(g),k=h.join(e,j),l=(0,i.tn)(g.sql);await (0,d.writeFile)(k,l,"utf8");let m=t(g.sql);await q(a,b,{name:j,checksum:m},"local"),f.push({type:g.type,table:g.tableName,migration:j,checksum:m})}catch(a){throw a}l.delete(c)}if(l.has(m))for(let c of l.get(m))try{await (0,i.KK)(a,b,c.sql);let g=n(c),j=h.join(e,g),k=(0,i.tn)(c.sql);await (0,d.writeFile)(j,k,"utf8");let l=t(c.sql);await q(a,b,{name:g,checksum:l},"local"),f.push({type:c.type,table:c.tableName||null,migration:g,checksum:l})}catch(a){throw a}for(let c of k)try{await (0,i.KK)(a,b,c.sql),f.push({type:c.type,table:c.tableName||null,executed:!0})}catch(a){throw a}return f}catch(a){throw a}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873,692,347,626],()=>b(b.s=60293));module.exports=c})();
|
|
33
|
+
`;try{await (0,i.KK)(a,b,g,e,f)}catch(a){throw{type:i.wU.EXECUTION_ERROR,message:`Failed to record migration ${c}`,details:{file:c,error:a.message,suggestions:["Check if migration is already recorded"]}}}}async function s(a,b){try{let c=await p(a,b,{}),d=new Map(c.map(a=>[a.name,a]));return{applied:Array.from(d.keys()),count:d.size}}catch(a){throw k.A.error("Failed to compare migrations:",a),a}}function t(a){return(0,g.createHash)("sha256").update(a).digest("hex")}async function u(a,b){try{await l(`wrangler d1 execute ${b} --local --command="SELECT checksum FROM d1_migrations LIMIT 1;"`,{cwd:a})}catch{try{await l(`wrangler d1 execute ${b} --local --command="ALTER TABLE d1_migrations ADD COLUMN checksum TEXT;"`,{cwd:a})}catch{}}}async function v(a,b,c){try{let e=h.join(a,"migrations");await (0,d.mkdir)(e,{recursive:!0});let f=[],g=[],k=[];for(let a of c)a.type===i.Pg.DATA_MODIFICATION?k.push(a):g.push(a);let l=new Map,m="__no_table__";for(let a of g){let b=a.tableName?a.tableName.toLowerCase():m;l.has(b)||l.set(b,[]),l.get(b).push(a)}let o=[...l.keys()].filter(a=>a!==m),p=[];if(o.length>0){let a=o.map(a=>l.get(a)[0]);p=(0,j.IC)(a)}for(let c of p){for(let g of l.get(c)||[])try{if(g.type===i.Pg.DROP_TABLE&&!await (0,i.F9)(a,b,{},g.tableName,!1))throw Error(`no such table: ${g.tableName}`);let c=await (0,i.KK)(a,b,g.sql);if(c&&(c.toLowerCase().includes("syntax error")||c.toLowerCase().includes("sqlite_error")))throw Error(c);let j=n(g),k=h.join(e,j),l=(0,i.tn)(g.sql);await (0,d.writeFile)(k,l,"utf8");let m=t(g.sql);await q(a,b,{name:j,checksum:m},"local"),f.push({type:g.type,table:g.tableName,migration:j,checksum:m})}catch(a){throw a}l.delete(c)}if(l.has(m))for(let c of l.get(m))try{await (0,i.KK)(a,b,c.sql);let g=n(c),j=h.join(e,g),k=(0,i.tn)(c.sql);await (0,d.writeFile)(j,k,"utf8");let l=t(c.sql);await q(a,b,{name:g,checksum:l},"local"),f.push({type:c.type,table:c.tableName||null,migration:g,checksum:l})}catch(a){throw a}for(let c of k)try{await (0,i.KK)(a,b,c.sql),f.push({type:c.type,table:c.tableName||null,executed:!0})}catch(a){throw a}return f}catch(a){throw a}}},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},74075:a=>{a.exports=require("zlib")},76760:a=>{a.exports=require("node:path")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},81630:a=>{a.exports=require("http")},84606:(a,b,c)=>{c.d(b,{s:()=>e});let d={SYNTAX_ERROR:"SYNTAX_ERROR",EXECUTION_ERROR:"EXECUTION_ERROR",TABLE_NOT_FOUND:"TABLE_NOT_FOUND",TABLE_EXISTS:"TABLE_EXISTS",FOREIGN_KEY_ERROR:"FOREIGN_KEY_ERROR",UNIQUE_CONSTRAINT_ERROR:"UNIQUE_CONSTRAINT_ERROR",NOT_NULL_CONSTRAINT_ERROR:"NOT_NULL_CONSTRAINT_ERROR",CHECK_CONSTRAINT_ERROR:"CHECK_CONSTRAINT_ERROR",UNKNOWN_ERROR:"UNKNOWN_ERROR"};function e(a){if(!a)return{type:d.UNKNOWN_ERROR,message:"An unknown error occurred",details:{}};let b=null,c=a.cmd||a.details&&a.details.command;if(c){let a=c.match(/--command="(.+?)"\s*--json/s);a&&(b=a[1].replace(/\\n/g,"\n").replace(/\\"/g,'"'))}let e=a.stdout||a.details&&a.details.stdout;if(e)try{let a=JSON.parse(e.trim()),d=a?.error?.text||"";if(d)return f(d,b,c)}catch{}let g=a.stderr||a.details&&a.details.stderr;if(g)return f(g.replace(/\x1B\[[0-9;]*[a-zA-Z]/g,""),b,c);let h=a.message||a.details&&a.details.originalError||"";return h?f(h,b,c):{type:d.UNKNOWN_ERROR,message:a.message||"An unknown error occurred",details:{}}}function f(a,b,c){if(a.includes("env: node: No such file or directory"))return{type:d.EXECUTION_ERROR,message:"Node.js not found — ensure Node.js is installed and in PATH",details:{originalQuery:b}};let e=a.match(/near "([^"]+)": syntax error(?:\s+at offset (\d+))?/);if(e){let[,a,c]=e;return{type:d.SYNTAX_ERROR,message:`Syntax error near "${a}"${c?` at position ${c}`:""}`,details:{originalQuery:b,errorLocation:{near:a,offset:c?parseInt(c):null}}}}if(a.includes("UNIQUE constraint failed")){let[,c]=a.match(/UNIQUE constraint failed: ([\w.]+)/)||[];return{type:d.UNIQUE_CONSTRAINT_ERROR,message:`UNIQUE constraint failed: ${c||"unknown column"}`,details:{originalQuery:b}}}if(a.includes("NOT NULL constraint failed")){let[,c]=a.match(/NOT NULL constraint failed: ([\w.]+)/)||[];return{type:d.NOT_NULL_CONSTRAINT_ERROR,message:`NOT NULL constraint failed: ${c||"unknown column"}`,details:{originalQuery:b}}}if(a.includes("CHECK constraint failed")){let[,c]=a.match(/CHECK constraint failed: (\S+)/)||[];return{type:d.CHECK_CONSTRAINT_ERROR,message:`CHECK constraint failed: ${c||"unknown constraint"}`,details:{originalQuery:b}}}if(a.includes("FOREIGN KEY constraint failed"))return{type:d.FOREIGN_KEY_ERROR,message:"FOREIGN KEY constraint failed",details:{originalQuery:b}};if(a.includes("no such table")){let[,c]=a.match(/no such table: (\S+)/)||[];return{type:d.TABLE_NOT_FOUND,message:`Table not found: ${c||"unknown"}`,details:{originalQuery:b}}}if(a.includes("already exists")){let[,c]=a.match(/table (\w+) already exists/)||[];return{type:d.TABLE_EXISTS,message:`Table already exists: ${c||"unknown"}`,details:{originalQuery:b}}}return{type:d.EXECUTION_ERROR,message:a.replace(/:\s*SQLITE_\w+$/,"").trim()||"Failed to execute SQL command",details:{originalQuery:b}}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873,692,347,626],()=>b(b.s=60293));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/query/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"622":{"*":{"id":"82146","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"32122","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"31603","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"60122","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"75170","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"12263","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"78922","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"54160","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"60673","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"68495","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"29234","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"77526","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5706,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":134,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/globals.css":{"id":3673,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx":{"id":7747,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js":{"id":3190,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/page.jsx":{"id":930,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","69","static/chunks/69-00a70b2df83ed9ee.js","823","static/chunks/823-77b9a2d152da81dd.js","974","static/chunks/app/page-
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/query/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"622":{"*":{"id":"82146","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"32122","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"31603","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"60122","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"75170","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"12263","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"78922","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"54160","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"60673","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"68495","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"29234","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"77526","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5706,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":134,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/globals.css":{"id":3673,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx":{"id":7747,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js":{"id":3190,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/page.jsx":{"id":930,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","69","static/chunks/69-00a70b2df83ed9ee.js","823","static/chunks/823-77b9a2d152da81dd.js","974","static/chunks/app/page-5f5e2a64d451ecb1.js"],"async":false}},"entryCSSFiles":{"/Volumes/ProjectSpace/_wip/d1studio/src/":[],"/Volumes/ProjectSpace/_wip/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/262ae258bbcfd289.css"}],"/Volumes/ProjectSpace/_wip/d1studio/src/app/page":[],"/Volumes/ProjectSpace/_wip/d1studio/src/app/api/query/route":[]},"rscModuleMapping":{"622":{"*":{"id":"51384","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"1905","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"23597","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"46254","name":"*","chunks":[],"async":false}},"3673":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"89748","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"73041","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"7184","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"81170","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"44158","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"36893","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"69576","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"6060","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=47,a.ids=[47],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},41204:a=>{"use strict";a.exports=require("string_decoder")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51082:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(41193);let{combine:e,timestamp:f,printf:g,colorize:h}=d.format,i="true"===process.env.DEBUG,j=g(({level:a,message:b,timestamp:c,...d})=>{let e=`${c} ${a}: ${b}`;return Object.keys(d).length>0&&(e+=` ${JSON.stringify(d)}`),e}),k=d.createLogger({level:i?"debug":"warn",format:e(f({format:"YYYY-MM-DD HH:mm:ss"}),h(),j),transports:[new d.transports.Console({level:i?"debug":"warn",silent:!1})]});k.logRequest=(a,b,c={})=>{k.debug(`Request: ${a} ${b}`,c)},k.logError=(a,b="unknown")=>{k.error(`Error in ${b}: ${a.message}`,{error:a.stack||a.message,source:b})},k.shouldLog=a=>{let b=k.level,c={error:0,warn:1,info:2,debug:3};return c[a]<=c[b]};let l=k},55591:a=>{"use strict";a.exports=require("https")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63491:(a,b,c)=>{"use strict";c.d(b,{S:()=>l});var d=c(79748),e=c(33873),f=c(82707),g=c(54027),h=c(11795),i=c(51082);let j=null,k=null;async function l(a){try{let b;if(!a||"string"!=typeof a)throw Error("Project path is required and must be a string");if(j&&k===a)return j;let c=null,l=null;for(let b of["wrangler.toml","wrangler.json","wrangler.jsonc"])if(c=await (0,f.dJ)(b,{cwd:a})){l=b;break}if(!c)return i.A.warn(`No Wrangler configuration file found in: ${a}`),null;i.A.info(`Found ${l} at: ${c}`);let m=await (0,d.readFile)(c,"utf-8");l.endsWith(".toml")?b=(0,g.parse)(m):(l.endsWith(".jsonc")&&(m=(0,h.A)(m)),b=JSON.parse(m));let n=(0,e.dirname)(c);return j={config:b,projectPath:n,configPath:c,configFile:l},k=a,j}catch(a){throw i.A.error(`Error reading Wrangler configuration: ${a.message}`),a}}},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},74075:a=>{"use strict";a.exports=require("zlib")},76760:a=>{"use strict";a.exports=require("node:path")},78335:()=>{},79428:a=>{"use strict";a.exports=require("buffer")},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},81630:a=>{"use strict";a.exports=require("http")},82996:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{GET:()=>A,OPTIONS:()=>B});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(79646),w=c(28354),x=c(63491);let y=(0,w.promisify)(v.exec);async function z(a,b,c,d="local"){let e="win32"===process.platform?"npx.cmd":"npx",{stdout:f}=await y(`${e} wrangler d1 execute ${a} --${d} --command="${b.replace(/"/g,'\\"')}" --json`,{cwd:c}),g=JSON.parse(f);return g[0]?.results||[]}async function A(a){try{let{searchParams:b}=new URL(a.url),c=b.get("db"),d=b.get("source"),e="remote"===d?"remote":"local",f=process.env.D1_PROJECT_DIR;if(!f)throw Error("Project directory not configured");if("remote"===e&&"true"!==process.env.D1_IS_PRO)return u.NextResponse.json({success:!1,error:"Pro license required. Run: d1s --license YOUR-KEY"},{status:402});let g=await (0,x.S)(f);if(!g?.config)throw Error("No Wrangler configuration found");let h=g.config;if(!h.d1_databases?.length)throw Error("No D1 databases configured");let i=c?h.d1_databases.find(a=>a.database_name===c):h.d1_databases[0];if(!i)throw Error(`Database not found: ${c}`);let j=i.database_name,k=(await z(j,"SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' AND name NOT LIKE '_cf_%' ORDER BY name;",f,e)).map(a=>a.name),l=[];for(let a of k){let b=await z(j,`PRAGMA table_info(${a});`,f,e),c=await z(j,`PRAGMA foreign_key_list(${a});`,f,e);l.push({name:a,columns:b,foreignKeys:c})}return u.NextResponse.json({success:!0,tables:l,source:e})}catch(a){return u.NextResponse.json({success:!1,error:a.message},{status:500})}}async function B(){return new u.NextResponse(null,{status:204})}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/schema/route",pathname:"/api/schema",filename:"route",bundlePath:"app/api/schema/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/ProjectSpace/_wip/d1studio/src/app/api/schema/route.js",nextConfigOutput:"",userland:d}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){var d;let e="/api/schema/route";"/index"===e&&(e="/");let g=await C.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||C.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===C.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>C.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>C.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await C.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873,692,347],()=>b(b.s=82996));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=47,a.ids=[47],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},41204:a=>{"use strict";a.exports=require("string_decoder")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51082:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(41193);let{combine:e,timestamp:f,printf:g,colorize:h}=d.format,i="true"===process.env.DEBUG,j=g(({level:a,message:b,timestamp:c,...d})=>{let e=`${c} ${a}: ${b}`;return Object.keys(d).length>0&&(e+=` ${JSON.stringify(d)}`),e}),k=d.createLogger({level:i?"debug":"warn",format:e(f({format:"YYYY-MM-DD HH:mm:ss"}),h(),j),transports:[new d.transports.Console({level:i?"debug":"warn",silent:!1})]});k.logRequest=(a,b,c={})=>{k.debug(`Request: ${a} ${b}`,c)},k.logError=(a,b="unknown")=>{k.error(`Error in ${b}: ${a.message}`,{error:a.stack||a.message,source:b})},k.shouldLog=a=>{let b=k.level,c={error:0,warn:1,info:2,debug:3};return c[a]<=c[b]};let l=k},55591:a=>{"use strict";a.exports=require("https")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63491:(a,b,c)=>{"use strict";c.d(b,{S:()=>l});var d=c(79748),e=c(33873),f=c(82707),g=c(54027),h=c(11795),i=c(51082);let j=null,k=null;async function l(a){try{let b;if(!a||"string"!=typeof a)throw Error("Project path is required and must be a string");if(j&&k===a)return j;let c=null,i=null;for(let b of["wrangler.toml","wrangler.json","wrangler.jsonc"])if(c=await (0,f.dJ)(b,{cwd:a})){i=b;break}if(!c)return null;let l=await (0,d.readFile)(c,"utf-8");i.endsWith(".toml")?b=(0,g.parse)(l):(i.endsWith(".jsonc")&&(l=(0,h.A)(l)),b=JSON.parse(l));let m=(0,e.dirname)(c);return j={config:b,projectPath:m,configPath:c,configFile:i},k=a,j}catch(a){throw i.A.error(`Error reading Wrangler configuration: ${a.message}`),a}}},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},74075:a=>{"use strict";a.exports=require("zlib")},76760:a=>{"use strict";a.exports=require("node:path")},78335:()=>{},79428:a=>{"use strict";a.exports=require("buffer")},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},81630:a=>{"use strict";a.exports=require("http")},82996:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{GET:()=>A,OPTIONS:()=>B});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(79646),w=c(28354),x=c(63491);let y=(0,w.promisify)(v.exec);async function z(a,b,c,d="local"){let e="win32"===process.platform?"npx.cmd":"npx",{stdout:f}=await y(`${e} wrangler d1 execute ${a} --${d} --command="${b.replace(/"/g,'\\"')}" --json`,{cwd:c}),g=JSON.parse(f);return g[0]?.results||[]}async function A(a){try{let{searchParams:b}=new URL(a.url),c=b.get("db"),d=b.get("source"),e="remote"===d?"remote":"local",f=process.env.D1_PROJECT_DIR;if(!f)throw Error("Project directory not configured");if("remote"===e&&"true"!==process.env.D1_IS_PRO)return u.NextResponse.json({success:!1,error:"Pro license required. Run: d1s --license YOUR-KEY"},{status:402});let g=await (0,x.S)(f);if(!g?.config)throw Error("No Wrangler configuration found");let h=g.config;if(!h.d1_databases?.length)throw Error("No D1 databases configured");let i=c?h.d1_databases.find(a=>a.database_name===c):h.d1_databases[0];if(!i)throw Error(`Database not found: ${c}`);let j=i.database_name,k=(await z(j,"SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' AND name NOT LIKE '_cf_%' ORDER BY name;",f,e)).map(a=>a.name),l=[];for(let a of k){let b=await z(j,`PRAGMA table_info(${a});`,f,e),c=await z(j,`PRAGMA foreign_key_list(${a});`,f,e);l.push({name:a,columns:b,foreignKeys:c})}return u.NextResponse.json({success:!0,tables:l,source:e})}catch(a){return u.NextResponse.json({success:!1,error:a.message},{status:500})}}async function B(){return new u.NextResponse(null,{status:204})}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/schema/route",pathname:"/api/schema",filename:"route",bundlePath:"app/api/schema/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/ProjectSpace/_wip/d1studio/src/app/api/schema/route.js",nextConfigOutput:"",userland:d}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){var d;let e="/api/schema/route";"/index"===e&&(e="/");let g=await C.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||C.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===C.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>C.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>C.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await C.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873,692,347],()=>b(b.s=82996));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/schema/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"622":{"*":{"id":"82146","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"32122","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"31603","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"60122","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"75170","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"12263","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"78922","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"54160","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"60673","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"68495","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"29234","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"77526","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5706,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":134,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/globals.css":{"id":3673,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx":{"id":7747,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js":{"id":3190,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/page.jsx":{"id":930,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","69","static/chunks/69-00a70b2df83ed9ee.js","823","static/chunks/823-77b9a2d152da81dd.js","974","static/chunks/app/page-
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/schema/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"622":{"*":{"id":"82146","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"32122","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"31603","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"60122","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"75170","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"12263","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"78922","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"54160","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"60673","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"68495","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"29234","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"77526","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5706,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":134,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/globals.css":{"id":3673,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx":{"id":7747,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js":{"id":3190,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/page.jsx":{"id":930,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","69","static/chunks/69-00a70b2df83ed9ee.js","823","static/chunks/823-77b9a2d152da81dd.js","974","static/chunks/app/page-5f5e2a64d451ecb1.js"],"async":false}},"entryCSSFiles":{"/Volumes/ProjectSpace/_wip/d1studio/src/":[],"/Volumes/ProjectSpace/_wip/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/262ae258bbcfd289.css"}],"/Volumes/ProjectSpace/_wip/d1studio/src/app/page":[],"/Volumes/ProjectSpace/_wip/d1studio/src/app/api/schema/route":[]},"rscModuleMapping":{"622":{"*":{"id":"51384","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"1905","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"23597","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"46254","name":"*","chunks":[],"async":false}},"3673":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"89748","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"73041","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"7184","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"81170","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"44158","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"36893","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"69576","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"6060","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=861,a.ids=[366,861],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10366:(a,b,c)=>{"use strict";c.d(b,{executeLocalSQL:()=>n,k5:()=>l,n3:()=>o,w1:()=>m});var d=c(55511),e=c(33873),f=c(29021),g=c(87550),h=c(51082);let i=e.join(".wrangler","state","v3","d1","miniflare-D1DatabaseObject"),j=new Map;function k(a,b){let c=e.join(a,i);if(!f.existsSync(c))return null;let{database_id:g,database_name:j,binding:k}=b,l=[g,j,k].filter(Boolean),m=["","miniflare-D1DatabaseObject:","D1DatabaseObject:","d1:"],n=l.flatMap(a=>m.map(b=>{var c;return c=`${b}${a}`,d.createHash("sha256").update(c).digest("hex")})).map(a=>e.join(c,`${a}.sqlite`)).find(a=>f.existsSync(a));if(n)return n;let o=f.readdirSync(c).filter(a=>a.endsWith(".sqlite")).map(a=>({name:a,fullPath:e.join(c,a),mtime:f.statSync(e.join(c,a)).mtimeMs})).sort((a,b)=>b.mtime-a.mtime);return 1===o.length?o[0].fullPath:(o.length>1&&h.A.debug(`[local-db] Multiple SQLite files, no hash matched — falling back to wrangler CLI. dir=${c}, tried ids=${JSON.stringify(l)}`),h.A.debug(`[local-db] No SQLite files found. dir=${c}, tried ids=${JSON.stringify(l)}`),null)}function l(a,b){return null!==k(a,b)}function m(a,b){let c=`${a}:${b.database_name}`,d=k(a,b);if(j.has(c)){let a=j.get(c);if(a.path!==d){try{a.db.close()}catch{}j.delete(c)}else try{return a.db.prepare("SELECT 1").get(),a.db}catch{j.delete(c)}}if(!d)return null;try{let a=new g(d,{fileMustExist:!1});return a.pragma("journal_mode = WAL"),a.pragma("foreign_keys = ON"),j.set(c,{db:a,path:d}),a}catch{return null}}function n(a,b,c){let d=m(a,b);if(!d)return null;let e=c.trim(),f=e.toUpperCase().replace(/\s+/g," "),g=e.split(";").map(a=>a.trim()).filter(Boolean);if(g.length>1){let a=[],b=0,c=0;return d.transaction(()=>{for(let e of g){let f=e.toUpperCase().replace(/\s+/g," ");if(f.startsWith("SELECT")||f.startsWith("PRAGMA")||f.startsWith("EXPLAIN")){let b=d.prepare(e).all();a=a.concat(b)}else{let a=d.prepare(e).run();b+=a.changes,c=a.lastInsertRowid}}})(),JSON.stringify([{results:a,success:!0,meta:{changes:b,last_row_id:c,rows_read:a.length,rows_written:b}}])}if(f.startsWith("SELECT")||f.startsWith("PRAGMA")||f.startsWith("EXPLAIN")){let a=d.prepare(e).all();return JSON.stringify([{results:a,success:!0,meta:{rows_read:a.length,rows_written:0,changed_db:!1}}])}let h=d.prepare(e).run();return JSON.stringify([{results:[],success:!0,meta:{changes:h.changes,last_row_id:h.lastInsertRowid,rows_read:0,rows_written:h.changes,changed_db:h.changes>0}}])}function o(a,b){let c=`${a}:${b}`,d=j.get(c);if(d){try{d.db.close()}catch{}j.delete(c)}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},41204:a=>{"use strict";a.exports=require("string_decoder")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51082:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(41193);let{combine:e,timestamp:f,printf:g,colorize:h}=d.format,i="true"===process.env.DEBUG,j=g(({level:a,message:b,timestamp:c,...d})=>{let e=`${c} ${a}: ${b}`;return Object.keys(d).length>0&&(e+=` ${JSON.stringify(d)}`),e}),k=d.createLogger({level:i?"debug":"warn",format:e(f({format:"YYYY-MM-DD HH:mm:ss"}),h(),j),transports:[new d.transports.Console({level:i?"debug":"warn",silent:!1})]});k.logRequest=(a,b,c={})=>{k.debug(`Request: ${a} ${b}`,c)},k.logError=(a,b="unknown")=>{k.error(`Error in ${b}: ${a.message}`,{error:a.stack||a.message,source:b})},k.shouldLog=a=>{let b=k.level,c={error:0,warn:1,info:2,debug:3};return c[a]<=c[b]};let l=k},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},60420:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>L,patchFetch:()=>K,routeModule:()=>G,serverHooks:()=>J,workAsyncStorage:()=>H,workUnitAsyncStorage:()=>I});var d={};c.r(d),c.d(d,{OPTIONS:()=>F,POST:()=>E});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(63491),w=c(85326),x=c(28354),y=c(79646),z=c(10366),A=c(51082),B=c(60627);let C=(0,x.promisify)(y.exec);async function D(a,b,c){let d=(0,z.executeLocalSQL)(b,c,a);if(null!==d)return JSON.parse(d);let e=c.database_name,{stdout:f}=await C(`wrangler d1 execute ${e} --local --command="${a.replace(/"/g,'\\"')}" --json`,{cwd:b});return JSON.parse(f)}async function E(a,b){try{let{name:c}=await b.params,{rows:d,db:e}=await a.json();if(!Array.isArray(d)||0===d.length)return u.NextResponse.json({success:!1,error:"No rows provided"},{status:400});let f=process.env.D1_PROJECT_DIR;if(!f)throw Error("Project directory not configured");let g=await (0,v.S)(f);if(!g?.config)throw Error("No Wrangler configuration found");let h=g.config;if(!h.d1_databases?.length)throw Error("No D1 databases configured");let i=e?h.d1_databases.find(a=>a.database_name===e):h.d1_databases[0];if(!i)throw Error(`Database not found: ${e}`);i.database_name;let j=(0,w.nZ)(c),k=Object.keys(d[0]).map(w.r0),l=0,m=[];for(let a=0;a<d.length;a+=100){let b=d.slice(a,a+100),c=b.map(a=>{let b=k.map(b=>{let c=a[Object.keys(d[0])[k.indexOf(b)]];return null==c||""===c?"NULL":"number"==typeof c?c:`'${String(c).replace(/'/g,"''")}'`});return`(${b.join(", ")})`}),e=`INSERT INTO ${j} (${k.join(", ")}) VALUES ${c.join(", ")};`;try{await D(e,f,i),l+=b.length}catch(b){A.A.error(`Import batch ${a}-${a+100} failed:`,b),m.push({batch:a,error:b.message})}}return(0,B.s)("import"),u.NextResponse.json({success:!0,imported:l,failed:d.length-l,errors:m})}catch(a){return A.A.error("Import error:",a),u.NextResponse.json({success:!1,error:a.message},{status:500})}}async function F(){return new u.NextResponse(null,{status:204,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let G=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/tables/[name]/import/route",pathname:"/api/tables/[name]/import",filename:"route",bundlePath:"app/api/tables/[name]/import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/ProjectSpace/_wip/d1studio/src/app/api/tables/[name]/import/route.js",nextConfigOutput:"",userland:d}),{workAsyncStorage:H,workUnitAsyncStorage:I,serverHooks:J}=G;function K(){return(0,g.patchFetch)({workAsyncStorage:H,workUnitAsyncStorage:I})}async function L(a,b,c){var d;let e="/api/tables/[name]/import/route";"/index"===e&&(e="/");let g=await G.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:C}=g,D=(0,j.normalizeAppPath)(e),E=!!(y.dynamicRoutes[D]||y.routes[C]);if(E&&!x){let a=!!y.routes[C],b=y.dynamicRoutes[D];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let F=null;!E||G.isDev||x||(F="/index"===(F=C)?"/":F);let H=!0===G.isDev||!E,I=E&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>G.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>G.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!E)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await G.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await G.handleResponse({req:a,nextConfig:w,cacheKey:F,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!E)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&E||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await G.onRequestError(a,b,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),E)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},60627:(a,b,c)=>{"use strict";c.d(b,{s:()=>j});var d=c(55511),e=c(29021),f=c(21820),g=c(33873);let h=(0,g.join)((0,f.homedir)(),".d1-studio"),i=(0,g.join)(h,"config.json");async function j(a,b){if(!process.env.D1_STUDIO_NO_TELEMETRY)try{await fetch("https://d1-studio.com/api/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({installId:function(){if((0,e.existsSync)(h)||(0,e.mkdirSync)(h,{recursive:!0}),(0,e.existsSync)(i))try{let a=JSON.parse((0,e.readFileSync)(i,"utf8"));if(a.installId)return a.installId}catch{}let a=(0,d.randomUUID)();return(0,e.writeFileSync)(i,JSON.stringify({installId:a})),a}(),event:a,version:b,node:process.version,platform:process.platform}),signal:AbortSignal.timeout(3e3)})}catch{}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63491:(a,b,c)=>{"use strict";c.d(b,{S:()=>l});var d=c(79748),e=c(33873),f=c(82707),g=c(54027),h=c(11795),i=c(51082);let j=null,k=null;async function l(a){try{let b;if(!a||"string"!=typeof a)throw Error("Project path is required and must be a string");if(j&&k===a)return j;let c=null,l=null;for(let b of["wrangler.toml","wrangler.json","wrangler.jsonc"])if(c=await (0,f.dJ)(b,{cwd:a})){l=b;break}if(!c)return i.A.warn(`No Wrangler configuration file found in: ${a}`),null;i.A.info(`Found ${l} at: ${c}`);let m=await (0,d.readFile)(c,"utf-8");l.endsWith(".toml")?b=(0,g.parse)(m):(l.endsWith(".jsonc")&&(m=(0,h.A)(m)),b=JSON.parse(m));let n=(0,e.dirname)(c);return j={config:b,projectPath:n,configPath:c,configFile:l},k=a,j}catch(a){throw i.A.error(`Error reading Wrangler configuration: ${a.message}`),a}}},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},74075:a=>{"use strict";a.exports=require("zlib")},76760:a=>{"use strict";a.exports=require("node:path")},78335:()=>{},79428:a=>{"use strict";a.exports=require("buffer")},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},81630:a=>{"use strict";a.exports=require("http")},85326:(a,b,c)=>{"use strict";function d(a){if(!a||"string"!=typeof a)throw Error("Table name must be a non-empty string");if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(a))throw Error(`Invalid table name: ${a}. Must start with letter or underscore and contain only letters, digits, and underscores.`);if(["SELECT","FROM","WHERE","INSERT","UPDATE","DELETE","CREATE","DROP","ALTER","TABLE","INDEX","VIEW","TRIGGER","PRAGMA","VACUUM","REINDEX","EXPLAIN","QUERY","PLAN","TRANSACTION","BEGIN","COMMIT","ROLLBACK"].includes(a.toUpperCase()))throw Error(`Table name cannot be a reserved word: ${a}`);return`"${a}"`}function e(a){if(!a||"string"!=typeof a)throw Error("Column name must be a non-empty string");if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(a))throw Error(`Invalid column name: ${a}. Must start with letter or underscore and contain only letters, digits, and underscores.`);return`"${a}"`}c.d(b,{nZ:()=>d,r0:()=>e})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873,692,347],()=>b(b.s=60420));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=861,a.ids=[366,861],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10366:(a,b,c)=>{"use strict";c.d(b,{executeLocalSQL:()=>m,k5:()=>k,n3:()=>n,w1:()=>l});var d=c(55511),e=c(33873),f=c(29021),g=c(87550);let h=e.join(".wrangler","state","v3","d1","miniflare-D1DatabaseObject"),i=new Map;function j(a,b){let c=e.join(a,h);if(!f.existsSync(c))return null;let{database_id:g,database_name:i,binding:j}=b,k=[g,i,j].filter(Boolean),l=["","miniflare-D1DatabaseObject:","D1DatabaseObject:","d1:"],m=k.flatMap(a=>l.map(b=>{var c;return c=`${b}${a}`,d.createHash("sha256").update(c).digest("hex")})).map(a=>e.join(c,`${a}.sqlite`)).find(a=>f.existsSync(a));if(m)return m;let n=f.readdirSync(c).filter(a=>a.endsWith(".sqlite")).map(a=>({name:a,fullPath:e.join(c,a),mtime:f.statSync(e.join(c,a)).mtimeMs})).sort((a,b)=>b.mtime-a.mtime);return 1===n.length?n[0].fullPath:null}function k(a,b){return null!==j(a,b)}function l(a,b){let c=`${a}:${b.database_name}`,d=j(a,b);if(i.has(c)){let a=i.get(c);if(a.path!==d){try{a.db.close()}catch{}i.delete(c)}else try{return a.db.prepare("SELECT 1").get(),a.db}catch{i.delete(c)}}if(!d)return null;try{let a=new g(d,{fileMustExist:!1});return a.pragma("journal_mode = WAL"),a.pragma("foreign_keys = ON"),i.set(c,{db:a,path:d}),a}catch{return null}}function m(a,b,c){let d=l(a,b);if(!d)return null;let e=c.trim(),f=e.toUpperCase().replace(/\s+/g," "),g=e.split(";").map(a=>a.trim()).filter(Boolean);if(g.length>1){let a=[],b=0,c=0;return d.transaction(()=>{for(let e of g){let f=e.toUpperCase().replace(/\s+/g," ");if(f.startsWith("SELECT")||f.startsWith("PRAGMA")||f.startsWith("EXPLAIN")){let b=d.prepare(e).all();a=a.concat(b)}else{let a=d.prepare(e).run();b+=a.changes,c=a.lastInsertRowid}}})(),JSON.stringify([{results:a,success:!0,meta:{changes:b,last_row_id:c,rows_read:a.length,rows_written:b}}])}if(f.startsWith("SELECT")||f.startsWith("PRAGMA")||f.startsWith("EXPLAIN")){let a=d.prepare(e).all();return JSON.stringify([{results:a,success:!0,meta:{rows_read:a.length,rows_written:0,changed_db:!1}}])}let h=d.prepare(e).run();return JSON.stringify([{results:[],success:!0,meta:{changes:h.changes,last_row_id:h.lastInsertRowid,rows_read:0,rows_written:h.changes,changed_db:h.changes>0}}])}function n(a,b){let c=`${a}:${b}`,d=i.get(c);if(d){try{d.db.close()}catch{}i.delete(c)}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},41204:a=>{"use strict";a.exports=require("string_decoder")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51082:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(41193);let{combine:e,timestamp:f,printf:g,colorize:h}=d.format,i="true"===process.env.DEBUG,j=g(({level:a,message:b,timestamp:c,...d})=>{let e=`${c} ${a}: ${b}`;return Object.keys(d).length>0&&(e+=` ${JSON.stringify(d)}`),e}),k=d.createLogger({level:i?"debug":"warn",format:e(f({format:"YYYY-MM-DD HH:mm:ss"}),h(),j),transports:[new d.transports.Console({level:i?"debug":"warn",silent:!1})]});k.logRequest=(a,b,c={})=>{k.debug(`Request: ${a} ${b}`,c)},k.logError=(a,b="unknown")=>{k.error(`Error in ${b}: ${a.message}`,{error:a.stack||a.message,source:b})},k.shouldLog=a=>{let b=k.level,c={error:0,warn:1,info:2,debug:3};return c[a]<=c[b]};let l=k},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},60420:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>L,patchFetch:()=>K,routeModule:()=>G,serverHooks:()=>J,workAsyncStorage:()=>H,workUnitAsyncStorage:()=>I});var d={};c.r(d),c.d(d,{OPTIONS:()=>F,POST:()=>E});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(63491),w=c(85326),x=c(28354),y=c(79646),z=c(10366),A=c(51082),B=c(60627);let C=(0,x.promisify)(y.exec);async function D(a,b,c){let d=(0,z.executeLocalSQL)(b,c,a);if(null!==d)return JSON.parse(d);let e=c.database_name,{stdout:f}=await C(`wrangler d1 execute ${e} --local --command="${a.replace(/"/g,'\\"')}" --json`,{cwd:b});return JSON.parse(f)}async function E(a,b){try{let{name:c}=await b.params,{rows:d,db:e}=await a.json();if(!Array.isArray(d)||0===d.length)return u.NextResponse.json({success:!1,error:"No rows provided"},{status:400});let f=process.env.D1_PROJECT_DIR;if(!f)throw Error("Project directory not configured");let g=await (0,v.S)(f);if(!g?.config)throw Error("No Wrangler configuration found");let h=g.config;if(!h.d1_databases?.length)throw Error("No D1 databases configured");let i=e?h.d1_databases.find(a=>a.database_name===e):h.d1_databases[0];if(!i)throw Error(`Database not found: ${e}`);i.database_name;let j=(0,w.nZ)(c),k=Object.keys(d[0]).map(w.r0),l=0,m=[];for(let a=0;a<d.length;a+=100){let b=d.slice(a,a+100),c=b.map(a=>{let b=k.map(b=>{let c=a[Object.keys(d[0])[k.indexOf(b)]];return null==c||""===c?"NULL":"number"==typeof c?c:`'${String(c).replace(/'/g,"''")}'`});return`(${b.join(", ")})`}),e=`INSERT INTO ${j} (${k.join(", ")}) VALUES ${c.join(", ")};`;try{await D(e,f,i),l+=b.length}catch(b){A.A.error(`Import batch ${a}-${a+100} failed:`,b),m.push({batch:a,error:b.message})}}return(0,B.s)("import"),u.NextResponse.json({success:!0,imported:l,failed:d.length-l,errors:m})}catch(a){return A.A.error("Import error:",a),u.NextResponse.json({success:!1,error:a.message},{status:500})}}async function F(){return new u.NextResponse(null,{status:204,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}let G=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/tables/[name]/import/route",pathname:"/api/tables/[name]/import",filename:"route",bundlePath:"app/api/tables/[name]/import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/ProjectSpace/_wip/d1studio/src/app/api/tables/[name]/import/route.js",nextConfigOutput:"",userland:d}),{workAsyncStorage:H,workUnitAsyncStorage:I,serverHooks:J}=G;function K(){return(0,g.patchFetch)({workAsyncStorage:H,workUnitAsyncStorage:I})}async function L(a,b,c){var d;let e="/api/tables/[name]/import/route";"/index"===e&&(e="/");let g=await G.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:C}=g,D=(0,j.normalizeAppPath)(e),E=!!(y.dynamicRoutes[D]||y.routes[C]);if(E&&!x){let a=!!y.routes[C],b=y.dynamicRoutes[D];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let F=null;!E||G.isDev||x||(F="/index"===(F=C)?"/":F);let H=!0===G.isDev||!E,I=E&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>G.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>G.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!E)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await G.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await G.handleResponse({req:a,nextConfig:w,cacheKey:F,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!E)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&E||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await G.onRequestError(a,b,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),E)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},60627:(a,b,c)=>{"use strict";c.d(b,{s:()=>j});var d=c(55511),e=c(29021),f=c(21820),g=c(33873);let h=(0,g.join)((0,f.homedir)(),".d1-studio"),i=(0,g.join)(h,"config.json");async function j(a,b){if(!process.env.D1_STUDIO_NO_TELEMETRY)try{await fetch("https://d1-studio.com/api/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({installId:function(){if((0,e.existsSync)(h)||(0,e.mkdirSync)(h,{recursive:!0}),(0,e.existsSync)(i))try{let a=JSON.parse((0,e.readFileSync)(i,"utf8"));if(a.installId)return a.installId}catch{}let a=(0,d.randomUUID)();return(0,e.writeFileSync)(i,JSON.stringify({installId:a})),a}(),event:a,version:b,node:process.version,platform:process.platform}),signal:AbortSignal.timeout(3e3)})}catch{}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63491:(a,b,c)=>{"use strict";c.d(b,{S:()=>l});var d=c(79748),e=c(33873),f=c(82707),g=c(54027),h=c(11795),i=c(51082);let j=null,k=null;async function l(a){try{let b;if(!a||"string"!=typeof a)throw Error("Project path is required and must be a string");if(j&&k===a)return j;let c=null,i=null;for(let b of["wrangler.toml","wrangler.json","wrangler.jsonc"])if(c=await (0,f.dJ)(b,{cwd:a})){i=b;break}if(!c)return null;let l=await (0,d.readFile)(c,"utf-8");i.endsWith(".toml")?b=(0,g.parse)(l):(i.endsWith(".jsonc")&&(l=(0,h.A)(l)),b=JSON.parse(l));let m=(0,e.dirname)(c);return j={config:b,projectPath:m,configPath:c,configFile:i},k=a,j}catch(a){throw i.A.error(`Error reading Wrangler configuration: ${a.message}`),a}}},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},74075:a=>{"use strict";a.exports=require("zlib")},76760:a=>{"use strict";a.exports=require("node:path")},78335:()=>{},79428:a=>{"use strict";a.exports=require("buffer")},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},81630:a=>{"use strict";a.exports=require("http")},85326:(a,b,c)=>{"use strict";function d(a){if(!a||"string"!=typeof a)throw Error("Table name must be a non-empty string");if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(a))throw Error(`Invalid table name: ${a}. Must start with letter or underscore and contain only letters, digits, and underscores.`);if(["SELECT","FROM","WHERE","INSERT","UPDATE","DELETE","CREATE","DROP","ALTER","TABLE","INDEX","VIEW","TRIGGER","PRAGMA","VACUUM","REINDEX","EXPLAIN","QUERY","PLAN","TRANSACTION","BEGIN","COMMIT","ROLLBACK"].includes(a.toUpperCase()))throw Error(`Table name cannot be a reserved word: ${a}`);return`"${a}"`}function e(a){if(!a||"string"!=typeof a)throw Error("Column name must be a non-empty string");if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(a))throw Error(`Invalid column name: ${a}. Must start with letter or underscore and contain only letters, digits, and underscores.`);return`"${a}"`}c.d(b,{nZ:()=>d,r0:()=>e})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873,692,347],()=>b(b.s=60420));module.exports=c})();
|