"use strict";(()=>{vare={};e.id=2127,e.ids=[2127],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")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){returnfunctione(r,t){returntinr?r[t]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,t)):"function"==typeofr&&"default"===t?r:void0}}})},63311:(e,r,t)=>{t.r(r),t.d(r,{config:()=>p,default:()=>l,routeModule:()=>P});varn={};t.r(n),t.d(n,{default:()=>c});vara=t(89947),i=t(2706),s=t(96762),o=t(29021),u=t.n(o),d=t(69842);asyncfunctionc(e,r){if("POST"!==e.method)returnr.json({success:!1,msg:"Failed!"});lett=await(0,d.A)(e,r,!0);if(!t)returnr.json({success:!1,msg:"Unauthorized"});try{letn=JSON.parse(e.body).path.replace(/ /g,"").replace(/\.\./g,"");if(n?.match(/\.\./))returnr.json({success:!1,msg:"Error!",error:"Invalid url"});leta=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${t.id.toString().replace(/\//g,"")}`,i=n.replace(/\@/,a);u().createReadStream(i).pipe(r)}catch(e){console.log("ERROR in getPrivateMedia api route:",e.message),r.json({success:!1,msg:"Error!",error:e})}}letl=(0,s.M)(n,"default"),p=(0,s.M)(n,"config"),P=newa.PagesAPIRouteModule({definition:{kind:i.A.PAGES_API,page:"/api/media/getPrivateMedia",pathname:"/api/media/getPrivateMedia",bundlePath:"",filename:""},userland:n})},69842:(e,r,t)=>{t.d(r,{A:()=>i});varn=t(39908),a=t.n(n);asyncfunctioni(e,r,t){letn=a()({req:e,level:t?"deep":void0});returnconsole.log(n),n.payload}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){returnt}});vart=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,r,t)=>{e.exports=t(75600)}};varr=require("../../../webpack-api-runtime.js");r.C(e);vart=r(r.s=63311);module.exports=t})();