"use strict";(()=>{var e={};e.id=2221,e.ids=[2221],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(){return function e(r,t){return t in r?r[t]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,t)):"function"==typeof r&&"default"===t?r:void 0}}})},22133:(e,r,t)=>{t.r(r),t.d(r,{config:()=>p,default:()=>m,routeModule:()=>f});var n={};t.r(n),t.d(n,{default:()=>d});var a=t(89947),s=t(2706),o=t(96762),i=t(29021),u=t.n(i),l=t(67619),c=t(69842);async function d(e,r){if("GET"!==e.method)return r.json({msg:"Failed!"});let t=await (0,c.A)(e,r);if(!t)return r.json({success:!1,msg:"Unauthorized"});try{let e=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${t.id}/main.json`,n=JSON.parse(u().readFileSync(e,"utf8"));r.json({success:!0,schemaData:n})}catch(e){(0,l.A)({component:"/api/getUserSchemaData/main-catch-error",message:e.message,user:t}),r.json({success:!1,msg:"Couldn't read schema data"})}}let m=(0,o.M)(n,"default"),p=(0,o.M)(n,"config"),f=new a.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/getUserSchemaData",pathname:"/api/getUserSchemaData",bundlePath:"",filename:""},userland:n})},69842:(e,r,t)=>{t.d(r,{A:()=>s});var n=t(39908),a=t.n(n);async function s(e,r,t){let n=a()({req:e,level:t?"deep":void 0});return console.log(n),n.payload}},67619:(e,r,t)=>{t.d(r,{A:()=>s});var n=t(29021),a=t.n(n);async function s({user:e,message:r,component:t,noMail:n,req:s}){let o=new Date,i=(()=>{if(!s)return null;try{let e=s.headers["x-forwarded-for"],r=s.headers["x-real-ip"],t=s.headers["cf-connecting-ip"],n=Array.isArray(e)?e[0]:e?.split(",")[0],a=t||n||r||s.socket.remoteAddress;if(!a)return null;return String(a)}catch(e){return null}})();try{let n=`🚀 SERVER ERROR =========================== Error Message: ${r} Component: ${t}`;e?.id&&e?.first_name&&e?.last_name&&e?.email&&(n+=` User Id: ${e?.id} User Name: ${e?.first_name} ${e?.last_name} User Email: ${e?.email}`),s?.url&&(n+=` URL: ${s.url}`),s?.body&&(n+=` Request Body: ${JSON.stringify(s.body,null,4)}`),i&&(n+=` IP: ${i}`),n+=` Date: ${o.toDateString()} ========================================`,a().existsSync("./.tmp/error.log")||a().writeFileSync("./.tmp/error.log","","utf-8");let u=a().readFileSync("./.tmp/error.log","utf-8");a().writeFileSync("./.tmp/error.log",n),a().appendFileSync("./.tmp/error.log",` ${u}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return t}});var t=function(e){return e.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)}};var r=require("../../webpack-api-runtime.js");r.C(e);var t=r(r.s=22133);module.exports=t})();