"use strict";(()=>{vare={};e.id=7317,e.ids=[7317],e.modules={39908:e=>{e.exports=require("@moduletrace/datasquirel/dist/users/user-auth")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},29021:e=>{e.exports=require("fs")},33873:e=>{e.exports=require("path")},96762:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){returnfunctione(t,r){returnrint?t[r]:"then"int&&"function"==typeoft.then?t.then(t=>e(t,r)):"function"==typeoft&&"default"===r?t:void0}}})},86254:(e,t,r)=>{r.r(t),r.d(t,{config:()=>P,default:()=>p,routeModule:()=>A});varn={};r.r(n),r.d(n,{default:()=>f});vara=r(89947),o=r(2706),i=r(96762),u=r(29021),s=r.n(u),d=r(33873),l=r.n(d),c=r(69842);asyncfunctionf(e,t){if("GET"!==e.method)returnt.json({msg:"Failed!"});letr=await(0,c.A)(e,t,!0);if(!r)returnt.json({success:!1,msg:"Unauthorized"});let{dbName:n}=e.query;try{lete=l().resolve(String(process.env.DSQL_USER_DB_SCHEMA_PATH),`user-${r.id}/main.json`);if(!s().existsSync(e))returnt.end();leta=JSON.parse(s().readFileSync(e,"utf-8")).find(e=>e.dbFullName==n);if(!a)throwError("Database not found!");leto=l().resolve(process.cwd(),"./.tmp/_tmp.json");s().writeFileSync(o,JSON.stringify(a),"utf-8");leti=s().createReadStream(o);i.pipe(t),i.on("close",()=>{s().unlinkSync(o)})}catch(e){returnconsole.log(e),t.end()}}letp=(0,i.M)(n,"default"),P=(0,i.M)(n,"config"),A=newa.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/downloadDatabaseSchema",pathname:"/api/downloadDatabaseSchema",bundlePath:"",filename:""},userland:n})},69842:(e,t,r)=>{r.d(t,{A:()=>o});varn=r(39908),a=r.n(n);asyncfunctiono(e,t,r){letn=a()({req:e,level:r?"deep":void0});returnconsole.log(n),n.payload}},2706:(e,t)=>{Object.defineProperty(t,"A",{enumerable:!0,get:function(){returnr}});varr=function(e){returne.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,t,r)=>{e.exports=r(75600)}};vart=require("../../webpack-api-runtime.js");t.C(e);varr=t(t.s=86254);module.exports=r})();