This commit is contained in:
Benjamin Toby
2025-02-19 20:38:56 +01:00
parent 50468e24c0
commit b9f012cb9b
236 changed files with 564 additions and 482 deletions
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
"use strict";(()=>{var e={};e.id=4785,e.ids=[4785],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},91963:(e,r,n)=>{n.r(r),n.d(r,{config:()=>d,default:()=>_,routeModule:()=>p});var o={};n.r(o),n.d(o,{default:()=>l});var t=n(89947),s=n(2706),u=n(96762),i=n(29021),c=n.n(i),a=n(87369);async function l(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Wrong Method"});let n=await (0,a.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});c().writeFileSync("./.tmp/error.log","","utf-8"),r.json({success:!0})}let _=(0,u.M)(o,"default"),d=(0,u.M)(o,"config"),p=new t.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/admin/clearErrorLogs",pathname:"/api/admin/clearErrorLogs",bundlePath:"",filename:""},userland:o})},87369:(e,r,n)=>{n.d(r,{A:()=>s});var o=n(95969),t=n(89159);async function s(e){let{keyCookieName:r,csrfCookieName:n}=(0,t.A)(),s=`${r}_su`;if(!e.cookies?.[s])return console.log("No auth key cookie found"),null;let u=(0,o.A)({encryptedString:e.cookies[s]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>o});function o(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",o=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",t=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),s&&(u+=`${s}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),s&&(i+=`${s}_`),i+=o;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),s&&(c+=`${s}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:c+=t}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var o=n(55511),t=n(79428),s=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:c,algorithm:a,bufferAllocSize:l}=(0,s.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,o.scryptSync)(u,i,c),d=t.Buffer.alloc(l,0),p=(0,o.createDecipheriv)(a,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>t});var o=n(82535);function t(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,o.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>o});function o(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=91963);module.exports=n})();
"use strict";(()=>{var e={};e.id=4785,e.ids=[4785],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},91963:(e,r,n)=>{n.r(r),n.d(r,{config:()=>d,default:()=>_,routeModule:()=>p});var o={};n.r(o),n.d(o,{default:()=>l});var t=n(89947),s=n(2706),u=n(96762),i=n(29021),c=n.n(i),a=n(87369);async function l(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Wrong Method"});let n=await (0,a.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});c().writeFileSync("./.tmp/error.log","","utf-8"),r.json({success:!0})}let _=(0,u.M)(o,"default"),d=(0,u.M)(o,"config"),p=new t.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/admin/clearErrorLogs",pathname:"/api/admin/clearErrorLogs",bundlePath:"",filename:""},userland:o})},87369:(e,r,n)=>{n.d(r,{A:()=>s});var o=n(95969),t=n(89159);async function s(e){let{keyCookieName:r,csrfCookieName:n}=(0,t.A)(),s=`${r}_su`;if(!e.cookies?.[s])return console.log("No auth key cookie found"),null;let u=(0,o.A)({encryptedString:e.cookies[s]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>o});function o(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",o=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",t=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),s&&(u+=`${s}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),s&&(i+=`${s}_`),i+=o;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),s&&(c+=`${s}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:c+=t}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var o=n(55511),t=n(79428),s=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:c,algorithm:a,bufferAllocSize:l}=(0,s.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,o.scryptSync)(u,i,c),d=t.Buffer.alloc(l,0),p=(0,o.createDecipheriv)(a,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),global.ERROR_CALLBACK?.("Error Decrypting data",r),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>t});var o=n(82535);function t(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,o.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>o});function o(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=91963);module.exports=n})();
@@ -1,4 +1,4 @@
"use strict";(()=>{var e={};e.id=9885,e.ids=[9885],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},79646:e=>{e.exports=require("child_process")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},21820:e=>{e.exports=require("os")},33873:e=>{e.exports=require("path")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},57856:(e,r,n)=>{n.r(r),n.d(r,{config:()=>E,default:()=>f,routeModule:()=>y});var o={};n.r(o),n.d(o,{default:()=>m});var t=n(89947),s=n(2706),i=n(96762),a=n(29021),c=n.n(a),l=n(21820),u=n.n(l),d=n(79646),p=n(67619),_=n(87369),S=n(6346);async function m(e,r){if("GET"!==e.method)return r.json({success:!1,msg:"Failed"});let n=await (0,_.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});let o="./.tmp/backups";c().existsSync(o)||c().mkdirSync("./.tmp/backups");let t=Date.now().toString();c().mkdirSync(`${o}/${t}`);let s=u().platform().match(/win/i)?"'C:\\Program Files\\MySQL\\MySQL Server 8.0\\bin\\mysqldump.exe'":"mysqldump";try{let e={cwd:process.cwd()},n=`${o}/${t}/datasquirel.sql`;u().platform().match(/win/i)&&(e.shell="bash.exe");let i=`${s} -u ${process.env.DSQL_DB_USERNAME} -h ${process.env.DSQL_DB_HOST} -p${process.env.DSQL_DB_PASSWORD} datasquirel > ${n}`;console.log(`createNewBackup.ts exe => ${i}`),(0,d.execSync)(i,e);let{mainShemaJSONFilePath:a}=(0,S.A)();c().copyFileSync(a,`${o}/${t}/datasquirelSchema.json`),function({rootFolderPath:e,destinationFolderPath:r}){try{c().mkdirSync(r),function e(r,n){let o=c().readdirSync(r);for(let t=0;t<o.length;t++){let s=o[t];s?.match(/\..{2,5}$/)?c().copyFileSync(`${r}/${s}`,`${n}/${s}`):(c().mkdirSync(`${n}/${s}`,{recursive:!0}),e(`${r}/${s}`,`${n}/${s}`))}}(e,r)}catch(e){return console.log(e.message),!1}}({rootFolderPath:`${process.env.DSQL_USER_DB_SCHEMA_PATH}`,destinationFolderPath:`${o}/${t}/userSchemas`}),r.json({success:!0})}catch(e){r.json({success:!1}),(0,p.A)({component:"/api/admin/createNewBackup/lines-73-90",message:e.message})}}let f=(0,i.M)(o,"default"),E=(0,i.M)(o,"config"),y=new t.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/admin/createNewBackup",pathname:"/api/admin/createNewBackup",bundlePath:"",filename:""},userland:o})},87369:(e,r,n)=>{n.d(r,{A:()=>s});var o=n(95969),t=n(89159);async function s(e){let{keyCookieName:r,csrfCookieName:n}=(0,t.A)(),s=`${r}_su`;if(!e.cookies?.[s])return console.log("No auth key cookie found"),null;let i=(0,o.A)({encryptedString:e.cookies[s]});if(!i)return console.log("No user payload found"),null;let a=JSON.parse(i);return a.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):a.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):a}},89159:(e,r,n)=>{n.d(r,{A:()=>o});function o(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",o=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",t=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),i=r;e?.userId&&(i+=`user_${e.userId}_`),s&&(i+=`${s}_`),i+=n;let a=r;e?.userId&&(a+=`user_${e.userId}_`),s&&(a+=`${s}_`),a+=o;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),s&&(c+=`${s}_`),{keyCookieName:i,csrfCookieName:a,oneTimeCodeName:c+=t}}},67619:(e,r,n)=>{n.d(r,{A:()=>s});var o=n(29021),t=n.n(o);async function s({user:e,message:r,component:n,noMail:o,req:s}){let i=new Date,a=(()=>{if(!s)return null;try{let e=s.headers["x-forwarded-for"],r=s.headers["x-real-ip"],n=s.headers["cf-connecting-ip"],o=Array.isArray(e)?e[0]:e?.split(",")[0],t=n||o||r||s.socket.remoteAddress;if(!t)return null;return String(t)}catch(e){return null}})();try{let o=`🚀 SERVER ERROR ===========================
"use strict";(()=>{var e={};e.id=9885,e.ids=[9885],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},79646:e=>{e.exports=require("child_process")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},21820:e=>{e.exports=require("os")},33873:e=>{e.exports=require("path")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},57856:(e,r,n)=>{n.r(r),n.d(r,{config:()=>E,default:()=>f,routeModule:()=>y});var o={};n.r(o),n.d(o,{default:()=>m});var t=n(89947),s=n(2706),i=n(96762),a=n(29021),l=n.n(a),c=n(21820),u=n.n(c),d=n(79646),p=n(67619),_=n(87369),S=n(6346);async function m(e,r){if("GET"!==e.method)return r.json({success:!1,msg:"Failed"});let n=await (0,_.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});let o="./.tmp/backups";l().existsSync(o)||l().mkdirSync("./.tmp/backups");let t=Date.now().toString();l().mkdirSync(`${o}/${t}`);let s=u().platform().match(/win/i)?"'C:\\Program Files\\MySQL\\MySQL Server 8.0\\bin\\mysqldump.exe'":"mysqldump";try{let e={cwd:process.cwd()},n=`${o}/${t}/datasquirel.sql`;u().platform().match(/win/i)&&(e.shell="bash.exe");let i=`${s} -u ${process.env.DSQL_DB_USERNAME} -h ${process.env.DSQL_DB_HOST} -p${process.env.DSQL_DB_PASSWORD} datasquirel > ${n}`;console.log(`createNewBackup.ts exe => ${i}`),(0,d.execSync)(i,e);let{mainShemaJSONFilePath:a}=(0,S.A)();l().copyFileSync(a,`${o}/${t}/datasquirelSchema.json`),function({rootFolderPath:e,destinationFolderPath:r}){try{l().mkdirSync(r),function e(r,n){let o=l().readdirSync(r);for(let t=0;t<o.length;t++){let s=o[t];s?.match(/\..{2,5}$/)?l().copyFileSync(`${r}/${s}`,`${n}/${s}`):(l().mkdirSync(`${n}/${s}`,{recursive:!0}),e(`${r}/${s}`,`${n}/${s}`))}}(e,r)}catch(e){return console.log(e.message),!1}}({rootFolderPath:`${process.env.DSQL_USER_DB_SCHEMA_PATH}`,destinationFolderPath:`${o}/${t}/userSchemas`}),r.json({success:!0})}catch(e){r.json({success:!1}),(0,p.A)({component:"/api/admin/createNewBackup/lines-73-90",message:e.message})}}let f=(0,i.M)(o,"default"),E=(0,i.M)(o,"config"),y=new t.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/admin/createNewBackup",pathname:"/api/admin/createNewBackup",bundlePath:"",filename:""},userland:o})},87369:(e,r,n)=>{n.d(r,{A:()=>s});var o=n(95969),t=n(89159);async function s(e){let{keyCookieName:r,csrfCookieName:n}=(0,t.A)(),s=`${r}_su`;if(!e.cookies?.[s])return console.log("No auth key cookie found"),null;let i=(0,o.A)({encryptedString:e.cookies[s]});if(!i)return console.log("No user payload found"),null;let a=JSON.parse(i);return a.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):a.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):a}},89159:(e,r,n)=>{n.d(r,{A:()=>o});function o(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",o=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",t=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),i=r;e?.userId&&(i+=`user_${e.userId}_`),s&&(i+=`${s}_`),i+=n;let a=r;e?.userId&&(a+=`user_${e.userId}_`),s&&(a+=`${s}_`),a+=o;let l=r;return e?.userId&&(l+=`user_${e.userId}_`),s&&(l+=`${s}_`),{keyCookieName:i,csrfCookieName:a,oneTimeCodeName:l+=t}}},67619:(e,r,n)=>{n.d(r,{A:()=>s});var o=n(29021),t=n.n(o);async function s({user:e,message:r,component:n,noMail:o,req:s}){let i=new Date,a=(()=>{if(!s)return null;try{let e=s.headers["x-forwarded-for"],r=s.headers["x-real-ip"],n=s.headers["cf-connecting-ip"],o=Array.isArray(e)?e[0]:e?.split(",")[0],t=n||o||r||s.socket.remoteAddress;if(!t)return null;return String(t)}catch(e){return null}})();try{let o=`🚀 SERVER ERROR ===========================
Error Message: ${r}
Component: ${n}`;e?.id&&e?.first_name&&e?.last_name&&e?.email&&(o+=`
User Id: ${e?.id}
@@ -8,9 +8,9 @@ URL: ${s.url}`),s?.body&&(o+=`
Request Body: ${JSON.stringify(s.body,null,4)}`),a&&(o+=`
IP: ${a}`),o+=`
Date: ${i.toDateString()}
========================================`,t().existsSync("./.tmp/error.log")||t().writeFileSync("./.tmp/error.log","","utf-8");let c=t().readFileSync("./.tmp/error.log","utf-8");t().writeFileSync("./.tmp/error.log",o),t().appendFileSync("./.tmp/error.log",`
========================================`,t().existsSync("./.tmp/error.log")||t().writeFileSync("./.tmp/error.log","","utf-8");let l=t().readFileSync("./.tmp/error.log","utf-8");t().writeFileSync("./.tmp/error.log",o),t().appendFileSync("./.tmp/error.log",`
${c}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},95969:(e,r,n)=>{n.d(r,{A:()=>i});var o=n(55511),t=n(79428),s=n(31542);function i({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:i,salt:a,keyLen:c,algorithm:l,bufferAllocSize:u}=(0,s.A)({encryptionKey:r});if(!i?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!a?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let d=(0,o.scryptSync)(i,a,c),p=t.Buffer.alloc(u,0),_=(0,o.createDecipheriv)(l,d,p);try{let r=_.update(e,"hex","utf8");return r+=_.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),e}}},6346:(e,r,n)=>{n.d(r,{A:()=>s});var o=n(33873),t=n.n(o);function s(e){let r=process.env.DSQL_APP_DIR,n=process.env.DSQL_DB_SCHEMA_DIR,o=".tmp";if(!r)throw Error("Please provide the `DSQL_APP_DIR` env variable.");if(!n)throw Error("Please provide the `DSQL_DB_SCHEMA_DIR` env variable.");let s=t().join(r,"package-shared"),i=t().join(s,"types/dsql.ts"),a=t().join(n,"main.json"),c=t().join(s,"data/defaultFields.json"),l=t().join(n,"users"),u=e?.user?.id?t().join(l,`user-${e.user.id}`):e?.userId?t().join(l,`user-${e.userId}`):void 0,d=u?t().join(u,"main.json"):void 0,p=u?t().join(u,"media"):void 0,_=u?t().join(u,"export"):void 0,S=_?t().join(_,"sql"):void 0,m=S?t().join(S,o):void 0,f=m?t().join(m,"schema.json"):void 0,E="db-export.zip",y=S?t().join(S,E):void 0,v="db-export.zip",A=S?t().join(S,v):void 0;return{schemasDir:n,userDirPath:u,mainShemaJSONFilePath:a,mainDbTypeDefFile:i,tempDirName:o,defaultTableFieldsJSONFilePath:c,usersSchemaDir:l,userSchemaMainJSONFilePath:d,userPrivateMediaDir:p,userPrivateExportsDir:_,userPrivateSQLExportsDir:S,userPrivateTempSQLExportsDir:m,userPrivateTempJSONSchemaFilePath:f,userPrivateDbExportZipFileName:E,userPrivateDbExportZipFilePath:y,userPrivateDbImportZipFileName:v,userPrivateDbImportZipFilePath:A,dbNginxLoadBalancerConfigFile:t().join(r,"docker/mariadb/load-balancer/config/template/nginx.conf")}}},31542:(e,r,n)=>{n.d(r,{A:()=>t});var o=n(82535);function t(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,o.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>o});function o(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=57856);module.exports=n})();
${l}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},95969:(e,r,n)=>{n.d(r,{A:()=>i});var o=n(55511),t=n(79428),s=n(31542);function i({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:i,salt:a,keyLen:l,algorithm:c,bufferAllocSize:u}=(0,s.A)({encryptionKey:r});if(!i?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!a?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let d=(0,o.scryptSync)(i,a,l),p=t.Buffer.alloc(u,0),_=(0,o.createDecipheriv)(c,d,p);try{let r=_.update(e,"hex","utf8");return r+=_.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),global.ERROR_CALLBACK?.("Error Decrypting data",r),e}}},6346:(e,r,n)=>{n.d(r,{A:()=>s});var o=n(33873),t=n.n(o);function s(e){let r=process.env.DSQL_APP_DIR,n=process.env.DSQL_DB_SCHEMA_DIR,o=".tmp";if(!r)throw Error("Please provide the `DSQL_APP_DIR` env variable.");if(!n)throw Error("Please provide the `DSQL_DB_SCHEMA_DIR` env variable.");let s=t().join(r,"package-shared"),i=t().join(s,"types/dsql.ts"),a=t().join(n,"main.json"),l=t().join(s,"data/defaultFields.json"),c=t().join(n,"users"),u=e?.user?.id?t().join(c,`user-${e.user.id}`):e?.userId?t().join(c,`user-${e.userId}`):void 0,d=u?t().join(u,"main.json"):void 0,p=u?t().join(u,"media"):void 0,_=u?t().join(u,"export"):void 0,S=_?t().join(_,"sql"):void 0,m=S?t().join(S,o):void 0,f=m?t().join(m,"schema.json"):void 0,E="db-export.zip",y=S?t().join(S,E):void 0,A="db-export.zip",v=S?t().join(S,A):void 0;return{schemasDir:n,userDirPath:u,mainShemaJSONFilePath:a,mainDbTypeDefFile:i,tempDirName:o,defaultTableFieldsJSONFilePath:l,usersSchemaDir:c,userSchemaMainJSONFilePath:d,userPrivateMediaDir:p,userPrivateExportsDir:_,userPrivateSQLExportsDir:S,userPrivateTempSQLExportsDir:m,userPrivateTempJSONSchemaFilePath:f,userPrivateDbExportZipFileName:E,userPrivateDbExportZipFilePath:y,userPrivateDbImportZipFileName:A,userPrivateDbImportZipFilePath:v,dbNginxLoadBalancerConfigFile:t().join(r,"docker/mariadb/load-balancer/config/template/nginx.conf")}}},31542:(e,r,n)=>{n.d(r,{A:()=>t});var o=n(82535);function t(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,o.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>o});function o(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=57856);module.exports=n})();
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -13,4 +13,4 @@ Date: ${a.toDateString()}
${c}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},30944:(e,r,t)=>{t.d(r,{A:()=>l});var s=t(43775),n=t(67619),o=t(7447),a=t(64292);async function l({queryString:e,queryValuesArray:r,database:t,tableSchema:l,debug:c}){let u=(0,o.A)({fa:!0});global.DSQL_USE_LOCAL&&(u=(0,o.A)({local:!0})),t?.match(/^datasquirel$/)&&(u=(0,o.A)()),c&&(console.log("varDatabaseDbHandler:query:",e),console.log("varDatabaseDbHandler:values:",r),console.log("varDatabaseDbHandler:CONNECTION:",u.getConfig()));let i=await (0,a.A)(u,e,r);if(c&&console.log("varDatabaseDbHandler:results:",i),i&&l)try{return await (0,s.A)({unparsedResults:i,tableSchema:l})}catch(e){return console.log("\x1b[31mvarDatabaseDbHandler ERROR\x1b[0m =>",t,e),(0,n.A)({component:"varDatabaseDbHandler/lines-52-53",message:e.message}),null}else if(i)return i;else return null}},95969:(e,r,t)=>{t.d(r,{A:()=>a});var s=t(55511),n=t(79428),o=t(31542);function a({encryptedString:e,encryptionKey:r,encryptionSalt:t}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:a,salt:l,keyLen:c,algorithm:u,bufferAllocSize:i}=(0,o.A)({encryptionKey:r});if(!a?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!l?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,s.scryptSync)(a,l,c),d=n.Buffer.alloc(i,0),p=(0,s.createDecipheriv)(u,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),e}}},64292:(e,r,t)=>{async function s(e,r,t){try{if(!e)throw Error("No Connection Found!");if(!r)throw Error("Query String Required!");if("string"==typeof r){let s=await e.query(n(r),t);return JSON.parse(JSON.stringify(s))}if("object"!=typeof r)return null;{let t=[];for(let s=0;s<r.length;s++)try{let o=r[s],a=await e.query(n(o.query),o.values);t.push(JSON.parse(JSON.stringify(a)))}catch(e){console.log(`connDbHandler Query Error: ${e.message}`),t.push(null)}return t}}catch(r){return console.log(`connDbHandler Error: ${r.message}`),console.log(e?.config()),null}finally{e?.end()}}function n(e){return e.replace(/\n/gm,"").replace(/ {2,}/g,"").trim()}t.d(r,{A:()=>s})},7447:(e,r,t)=>{t.d(r,{A:()=>o});var s=t(9973),n=t.n(s);function o(e){return global.DSQL_USE_LOCAL||e?.local?global.DSQL_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.ro?global.DSQL_READ_ONLY_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_READ_ONLY_USERNAME,password:process.env.DSQL_DB_READ_ONLY_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.fa?global.DSQL_FULL_ACCESS_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_FULL_ACCESS_USERNAME,password:process.env.DSQL_DB_FULL_ACCESS_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):global.DSQL_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}})}},31542:(e,r,t)=>{t.d(r,{A:()=>n});var s=t(82535);function n(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,s.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,t)=>{t.d(r,{A:()=>s});function s(e,r){try{let t=Number(e);if("number"!=typeof t||isNaN(t))return 0;if(r)return Number(t.toFixed(r));return Math.round(t)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},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=10291);module.exports=t})();
${c}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},30944:(e,r,t)=>{t.d(r,{A:()=>l});var s=t(43775),n=t(67619),o=t(7447),a=t(64292);async function l({queryString:e,queryValuesArray:r,database:t,tableSchema:l,debug:c}){let u=(0,o.A)({fa:!0});global.DSQL_USE_LOCAL&&(u=(0,o.A)({local:!0})),t?.match(/^datasquirel$/)&&(u=(0,o.A)()),c&&(console.log("varDatabaseDbHandler:query:",e),console.log("varDatabaseDbHandler:values:",r),console.log("varDatabaseDbHandler:CONNECTION:",u.getConfig()));let i=await (0,a.A)(u,e,r);if(c&&console.log("varDatabaseDbHandler:results:",i),i&&l)try{return await (0,s.A)({unparsedResults:i,tableSchema:l})}catch(e){return console.log("\x1b[31mvarDatabaseDbHandler ERROR\x1b[0m =>",t,e),global.ERROR_CALLBACK?.("VarDb Handler Error",e),(0,n.A)({component:"varDatabaseDbHandler/lines-52-53",message:e.message}),null}else if(i)return i;else return null}},95969:(e,r,t)=>{t.d(r,{A:()=>a});var s=t(55511),n=t(79428),o=t(31542);function a({encryptedString:e,encryptionKey:r,encryptionSalt:t}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:a,salt:l,keyLen:c,algorithm:u,bufferAllocSize:i}=(0,o.A)({encryptionKey:r});if(!a?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!l?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,s.scryptSync)(a,l,c),d=n.Buffer.alloc(i,0),p=(0,s.createDecipheriv)(u,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),global.ERROR_CALLBACK?.("Error Decrypting data",r),e}}},64292:(e,r,t)=>{async function s(e,r,t){try{if(!e)throw Error("No Connection Found!");if(!r)throw Error("Query String Required!");if("string"==typeof r){let s=await e.query(n(r),t);return JSON.parse(JSON.stringify(s))}if("object"!=typeof r)return null;{let t=[];for(let s=0;s<r.length;s++)try{let o=r[s],a=await e.query(n(o.query),o.values);t.push(JSON.parse(JSON.stringify(a)))}catch(e){global.ERROR_CALLBACK?.("Connection DB Handler Query Error",e),t.push(null)}return t}}catch(e){return global.ERROR_CALLBACK?.("Connection DB Handler Error",e),null}finally{e?.end()}}function n(e){return e.replace(/\n/gm,"").replace(/ {2,}/g,"").trim()}t.d(r,{A:()=>s})},7447:(e,r,t)=>{t.d(r,{A:()=>o});var s=t(9973),n=t.n(s);function o(e){return global.DSQL_USE_LOCAL||e?.local?global.DSQL_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.ro?global.DSQL_READ_ONLY_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_READ_ONLY_USERNAME,password:process.env.DSQL_DB_READ_ONLY_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.fa?global.DSQL_FULL_ACCESS_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_FULL_ACCESS_USERNAME,password:process.env.DSQL_DB_FULL_ACCESS_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):global.DSQL_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}})}},31542:(e,r,t)=>{t.d(r,{A:()=>n});var s=t(82535);function n(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,s.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,t)=>{t.d(r,{A:()=>s});function s(e,r){try{let t=Number(e);if("number"!=typeof t||isNaN(t))return 0;if(r)return Number(t.toFixed(r));return Math.round(t)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},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=10291);module.exports=t})();
@@ -1 +1 @@
"use strict";(()=>{var e={};e.id=525,e.ids=[525],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},52159:(e,r,n)=>{n.r(r),n.d(r,{config:()=>d,default:()=>_,routeModule:()=>p});var s={};n.r(s),n.d(s,{default:()=>l});var t=n(89947),o=n(2706),u=n(96762),i=n(87369),c=n(29021),a=n.n(c);async function l(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Wrong Method"});let n=await (0,i.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});let s=e.body.user.id.toString().replace(/[^0-9]/g,"").replace(/\//g,""),t=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${s}/backups`;a().existsSync(t)||a().mkdirSync(t);let o=a().readdirSync(t);r.json({success:!0,backups:o})}let _=(0,u.M)(s,"default"),d=(0,u.M)(s,"config"),p=new t.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/admin/getUserBackups",pathname:"/api/admin/getUserBackups",bundlePath:"",filename:""},userland:s})},87369:(e,r,n)=>{n.d(r,{A:()=>o});var s=n(95969),t=n(89159);async function o(e){let{keyCookieName:r,csrfCookieName:n}=(0,t.A)(),o=`${r}_su`;if(!e.cookies?.[o])return console.log("No auth key cookie found"),null;let u=(0,s.A)({encryptedString:e.cookies[o]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>s});function s(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",s=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",t=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),o&&(u+=`${o}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),o&&(i+=`${o}_`),i+=s;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),o&&(c+=`${o}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:c+=t}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var s=n(55511),t=n(79428),o=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:c,algorithm:a,bufferAllocSize:l}=(0,o.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,s.scryptSync)(u,i,c),d=t.Buffer.alloc(l,0),p=(0,s.createDecipheriv)(a,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>t});var s=n(82535);function t(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,s.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>s});function s(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=52159);module.exports=n})();
"use strict";(()=>{var e={};e.id=525,e.ids=[525],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},52159:(e,r,n)=>{n.r(r),n.d(r,{config:()=>d,default:()=>_,routeModule:()=>p});var t={};n.r(t),n.d(t,{default:()=>l});var s=n(89947),o=n(2706),u=n(96762),i=n(87369),c=n(29021),a=n.n(c);async function l(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Wrong Method"});let n=await (0,i.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});let t=e.body.user.id.toString().replace(/[^0-9]/g,"").replace(/\//g,""),s=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${t}/backups`;a().existsSync(s)||a().mkdirSync(s);let o=a().readdirSync(s);r.json({success:!0,backups:o})}let _=(0,u.M)(t,"default"),d=(0,u.M)(t,"config"),p=new s.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/admin/getUserBackups",pathname:"/api/admin/getUserBackups",bundlePath:"",filename:""},userland:t})},87369:(e,r,n)=>{n.d(r,{A:()=>o});var t=n(95969),s=n(89159);async function o(e){let{keyCookieName:r,csrfCookieName:n}=(0,s.A)(),o=`${r}_su`;if(!e.cookies?.[o])return console.log("No auth key cookie found"),null;let u=(0,t.A)({encryptedString:e.cookies[o]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>t});function t(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",t=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",s=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),o&&(u+=`${o}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),o&&(i+=`${o}_`),i+=t;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),o&&(c+=`${o}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:c+=s}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var t=n(55511),s=n(79428),o=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:c,algorithm:a,bufferAllocSize:l}=(0,o.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,t.scryptSync)(u,i,c),d=s.Buffer.alloc(l,0),p=(0,t.createDecipheriv)(a,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),global.ERROR_CALLBACK?.("Error Decrypting data",r),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>s});var t=n(82535);function s(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,t.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>t});function t(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=52159);module.exports=n})();
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
"use strict";(()=>{var e={};e.id=2266,e.ids=[2266],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},90137:(e,r,n)=>{n.r(r),n.d(r,{config:()=>d,default:()=>_,routeModule:()=>p});var t={};n.r(t),n.d(t,{default:()=>l});var s=n(89947),o=n(2706),u=n(96762),i=n(87369),c=n(29021),a=n.n(c);async function l(e,r){if("GET"!==e.method)return r.json({success:!1,msg:"Failed"});let n=await (0,i.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});let t="./.tmp/backups";a().existsSync(t)||a().mkdirSync(t);let s=a().readdirSync(t);r.json({success:!0,backups:s})}let _=(0,u.M)(t,"default"),d=(0,u.M)(t,"config"),p=new s.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/admin/grabBackups",pathname:"/api/admin/grabBackups",bundlePath:"",filename:""},userland:t})},87369:(e,r,n)=>{n.d(r,{A:()=>o});var t=n(95969),s=n(89159);async function o(e){let{keyCookieName:r,csrfCookieName:n}=(0,s.A)(),o=`${r}_su`;if(!e.cookies?.[o])return console.log("No auth key cookie found"),null;let u=(0,t.A)({encryptedString:e.cookies[o]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>t});function t(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",t=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",s=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),o&&(u+=`${o}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),o&&(i+=`${o}_`),i+=t;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),o&&(c+=`${o}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:c+=s}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var t=n(55511),s=n(79428),o=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:c,algorithm:a,bufferAllocSize:l}=(0,o.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,t.scryptSync)(u,i,c),d=s.Buffer.alloc(l,0),p=(0,t.createDecipheriv)(a,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>s});var t=n(82535);function s(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,t.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>t});function t(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=90137);module.exports=n})();
"use strict";(()=>{var e={};e.id=2266,e.ids=[2266],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},90137:(e,r,n)=>{n.r(r),n.d(r,{config:()=>d,default:()=>_,routeModule:()=>p});var t={};n.r(t),n.d(t,{default:()=>l});var s=n(89947),o=n(2706),u=n(96762),i=n(87369),a=n(29021),c=n.n(a);async function l(e,r){if("GET"!==e.method)return r.json({success:!1,msg:"Failed"});let n=await (0,i.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});let t="./.tmp/backups";c().existsSync(t)||c().mkdirSync(t);let s=c().readdirSync(t);r.json({success:!0,backups:s})}let _=(0,u.M)(t,"default"),d=(0,u.M)(t,"config"),p=new s.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/admin/grabBackups",pathname:"/api/admin/grabBackups",bundlePath:"",filename:""},userland:t})},87369:(e,r,n)=>{n.d(r,{A:()=>o});var t=n(95969),s=n(89159);async function o(e){let{keyCookieName:r,csrfCookieName:n}=(0,s.A)(),o=`${r}_su`;if(!e.cookies?.[o])return console.log("No auth key cookie found"),null;let u=(0,t.A)({encryptedString:e.cookies[o]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>t});function t(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",t=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",s=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),o&&(u+=`${o}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),o&&(i+=`${o}_`),i+=t;let a=r;return e?.userId&&(a+=`user_${e.userId}_`),o&&(a+=`${o}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:a+=s}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var t=n(55511),s=n(79428),o=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:a,algorithm:c,bufferAllocSize:l}=(0,o.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,t.scryptSync)(u,i,a),d=s.Buffer.alloc(l,0),p=(0,t.createDecipheriv)(c,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),global.ERROR_CALLBACK?.("Error Decrypting data",r),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>s});var t=n(82535);function s(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,t.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>t});function t(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=90137);module.exports=n})();
@@ -1 +1 @@
"use strict";(()=>{var e={};e.id=5120,e.ids=[5120],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},66604:(e,r,n)=>{n.r(r),n.d(r,{config:()=>d,default:()=>_,routeModule:()=>p});var o={};n.r(o),n.d(o,{default:()=>a});var t=n(89947),s=n(2706),u=n(96762),i=n(87369),c=n(29021),l=n.n(c);async function a(e,r){if("GET"!==e.method)return r.json({success:!1,msg:"Failed"});let n=await (0,i.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});if(!l().existsSync("./.tmp/error.log"))return r.json({success:!0,log:"No Logs Yet."});let o=l().readFileSync("./.tmp/error.log","utf-8");r.json({success:!0,log:o})}let _=(0,u.M)(o,"default"),d=(0,u.M)(o,"config"),p=new t.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/admin/grabErrorLogs",pathname:"/api/admin/grabErrorLogs",bundlePath:"",filename:""},userland:o})},87369:(e,r,n)=>{n.d(r,{A:()=>s});var o=n(95969),t=n(89159);async function s(e){let{keyCookieName:r,csrfCookieName:n}=(0,t.A)(),s=`${r}_su`;if(!e.cookies?.[s])return console.log("No auth key cookie found"),null;let u=(0,o.A)({encryptedString:e.cookies[s]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>o});function o(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",o=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",t=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),s&&(u+=`${s}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),s&&(i+=`${s}_`),i+=o;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),s&&(c+=`${s}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:c+=t}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var o=n(55511),t=n(79428),s=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:c,algorithm:l,bufferAllocSize:a}=(0,s.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,o.scryptSync)(u,i,c),d=t.Buffer.alloc(a,0),p=(0,o.createDecipheriv)(l,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>t});var o=n(82535);function t(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,o.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>o});function o(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=66604);module.exports=n})();
"use strict";(()=>{var e={};e.id=5120,e.ids=[5120],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},66604:(e,r,n)=>{n.r(r),n.d(r,{config:()=>d,default:()=>_,routeModule:()=>p});var o={};n.r(o),n.d(o,{default:()=>l});var t=n(89947),s=n(2706),u=n(96762),i=n(87369),c=n(29021),a=n.n(c);async function l(e,r){if("GET"!==e.method)return r.json({success:!1,msg:"Failed"});let n=await (0,i.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});if(!a().existsSync("./.tmp/error.log"))return r.json({success:!0,log:"No Logs Yet."});let o=a().readFileSync("./.tmp/error.log","utf-8");r.json({success:!0,log:o})}let _=(0,u.M)(o,"default"),d=(0,u.M)(o,"config"),p=new t.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/admin/grabErrorLogs",pathname:"/api/admin/grabErrorLogs",bundlePath:"",filename:""},userland:o})},87369:(e,r,n)=>{n.d(r,{A:()=>s});var o=n(95969),t=n(89159);async function s(e){let{keyCookieName:r,csrfCookieName:n}=(0,t.A)(),s=`${r}_su`;if(!e.cookies?.[s])return console.log("No auth key cookie found"),null;let u=(0,o.A)({encryptedString:e.cookies[s]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>o});function o(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",o=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",t=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),s&&(u+=`${s}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),s&&(i+=`${s}_`),i+=o;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),s&&(c+=`${s}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:c+=t}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var o=n(55511),t=n(79428),s=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:c,algorithm:a,bufferAllocSize:l}=(0,s.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,o.scryptSync)(u,i,c),d=t.Buffer.alloc(l,0),p=(0,o.createDecipheriv)(a,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),global.ERROR_CALLBACK?.("Error Decrypting data",r),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>t});var o=n(82535);function t(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,o.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>o});function o(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=66604);module.exports=n})();
@@ -1 +1 @@
"use strict";(()=>{var e={};e.id=7375,e.ids=[7375],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},53865:(e,r,n)=>{n.r(r),n.d(r,{config:()=>_,default:()=>d,routeModule:()=>p});var t={};n.r(t),n.d(t,{default:()=>l});var s=n(89947),o=n(2706),u=n(96762),i=n(87369),a=n(29021),c=n.n(a);async function l(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Wrong Method"});let n=await (0,i.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});let{type:t,path:s}=e.body;if(e.body.user,!s?.match(/^\.\/jsonData\/dbSchemas\/users/))return r.json({success:!1,msg:"Invalid Path"});let o=s.replace(/\//g,"\\\\"),u=c().readFileSync(o,"utf-8");r.json({success:!0,data:u})}let d=(0,u.M)(t,"default"),_=(0,u.M)(t,"config"),p=new s.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/admin/grabFile",pathname:"/api/admin/grabFile",bundlePath:"",filename:""},userland:t})},87369:(e,r,n)=>{n.d(r,{A:()=>o});var t=n(95969),s=n(89159);async function o(e){let{keyCookieName:r,csrfCookieName:n}=(0,s.A)(),o=`${r}_su`;if(!e.cookies?.[o])return console.log("No auth key cookie found"),null;let u=(0,t.A)({encryptedString:e.cookies[o]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>t});function t(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",t=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",s=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),o&&(u+=`${o}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),o&&(i+=`${o}_`),i+=t;let a=r;return e?.userId&&(a+=`user_${e.userId}_`),o&&(a+=`${o}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:a+=s}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var t=n(55511),s=n(79428),o=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:a,algorithm:c,bufferAllocSize:l}=(0,o.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let d=(0,t.scryptSync)(u,i,a),_=s.Buffer.alloc(l,0),p=(0,t.createDecipheriv)(c,d,_);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>s});var t=n(82535);function s(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,t.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>t});function t(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=53865);module.exports=n})();
"use strict";(()=>{var e={};e.id=7375,e.ids=[7375],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},53865:(e,r,n)=>{n.r(r),n.d(r,{config:()=>_,default:()=>d,routeModule:()=>p});var t={};n.r(t),n.d(t,{default:()=>l});var o=n(89947),s=n(2706),u=n(96762),i=n(87369),a=n(29021),c=n.n(a);async function l(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Wrong Method"});let n=await (0,i.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});let{type:t,path:o}=e.body;if(e.body.user,!o?.match(/^\.\/jsonData\/dbSchemas\/users/))return r.json({success:!1,msg:"Invalid Path"});let s=o.replace(/\//g,"\\\\"),u=c().readFileSync(s,"utf-8");r.json({success:!0,data:u})}let d=(0,u.M)(t,"default"),_=(0,u.M)(t,"config"),p=new o.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/admin/grabFile",pathname:"/api/admin/grabFile",bundlePath:"",filename:""},userland:t})},87369:(e,r,n)=>{n.d(r,{A:()=>s});var t=n(95969),o=n(89159);async function s(e){let{keyCookieName:r,csrfCookieName:n}=(0,o.A)(),s=`${r}_su`;if(!e.cookies?.[s])return console.log("No auth key cookie found"),null;let u=(0,t.A)({encryptedString:e.cookies[s]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>t});function t(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",t=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",o=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),s&&(u+=`${s}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),s&&(i+=`${s}_`),i+=t;let a=r;return e?.userId&&(a+=`user_${e.userId}_`),s&&(a+=`${s}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:a+=o}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var t=n(55511),o=n(79428),s=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:a,algorithm:c,bufferAllocSize:l}=(0,s.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let d=(0,t.scryptSync)(u,i,a),_=o.Buffer.alloc(l,0),p=(0,t.createDecipheriv)(c,d,_);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),global.ERROR_CALLBACK?.("Error Decrypting data",r),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>o});var t=n(82535);function o(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,t.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>t});function t(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=53865);module.exports=n})();
@@ -1 +1 @@
"use strict";(()=>{var e={};e.id=5467,e.ids=[5467],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},29756:(e,r,n)=>{n.r(r),n.d(r,{config:()=>l,default:()=>_,routeModule:()=>d});var t={};n.r(t),n.d(t,{default:()=>c});var s=n(89947),o=n(2706),i=n(96762),u=n(89159),a=n(68829);async function c(e,r){if("POST"!==e.method)return r.json({user:null,msg:"Failed"});let{email:n,password:t,authKey:s}=e.body;if(t!==process.env.DSQL_USER_KEY||s!==process.env.DSQL_SPECIAL_KEY)return r.json({success:!1});let o=(0,a.A)({data:JSON.stringify({email:n,password:process.env.DSQL_USER_KEY,authKey:process.env.DSQL_SPECIAL_KEY,logged_in_status:!0,date:Date.now()})}),{keyCookieName:i,csrfCookieName:c}=(0,u.A)();r.setHeader("Set-Cookie",[`${i}_su=${o};samesite=strict;path=/;HttpOnly=true;Secure=true`]),r.json({success:!0})}let _=(0,i.M)(t,"default"),l=(0,i.M)(t,"config"),d=new s.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/admin/loginSuUser",pathname:"/api/admin/loginSuUser",bundlePath:"",filename:""},userland:t})},89159:(e,r,n)=>{n.d(r,{A:()=>t});function t(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",t=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",s=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),i=r;e?.userId&&(i+=`user_${e.userId}_`),o&&(i+=`${o}_`),i+=n;let u=r;e?.userId&&(u+=`user_${e.userId}_`),o&&(u+=`${o}_`),u+=t;let a=r;return e?.userId&&(a+=`user_${e.userId}_`),o&&(a+=`${o}_`),{keyCookieName:i,csrfCookieName:u,oneTimeCodeName:a+=s}}},68829:(e,r,n)=>{n.d(r,{A:()=>i});var t=n(55511),s=n(79428),o=n(31542);function i({data:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encryption string is invalid"),e;let{key:i,salt:u,keyLen:a,algorithm:c,bufferAllocSize:_}=(0,o.A)({encryptionKey:r});if(!i?.match(/.{8,}/))return console.log("Encryption key is invalid"),e;if(!u?.match(/.{8,}/))return console.log("Encryption salt is invalid"),e;let l=(0,t.scryptSync)(i,u,a),d=s.Buffer.alloc(_,0),p=(0,t.createCipheriv)(c,l,d);try{let r=p.update(e,"utf8","hex");return r+=p.final("hex")}catch(r){return console.log("Error in encrypting =>",r.message),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>s});var t=n(82535);function s(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,t.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>t});function t(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=29756);module.exports=n})();
"use strict";(()=>{var e={};e.id=5467,e.ids=[5467],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},29756:(e,r,n)=>{n.r(r),n.d(r,{config:()=>l,default:()=>_,routeModule:()=>d});var t={};n.r(t),n.d(t,{default:()=>c});var s=n(89947),o=n(2706),i=n(96762),u=n(89159),a=n(68829);async function c(e,r){if("POST"!==e.method)return r.json({user:null,msg:"Failed"});let{email:n,password:t,authKey:s}=e.body;if(t!==process.env.DSQL_USER_KEY||s!==process.env.DSQL_SPECIAL_KEY)return r.json({success:!1});let o=(0,a.A)({data:JSON.stringify({email:n,password:process.env.DSQL_USER_KEY,authKey:process.env.DSQL_SPECIAL_KEY,logged_in_status:!0,date:Date.now()})}),{keyCookieName:i,csrfCookieName:c}=(0,u.A)();r.setHeader("Set-Cookie",[`${i}_su=${o};samesite=strict;path=/;HttpOnly=true;Secure=true`]),r.json({success:!0})}let _=(0,i.M)(t,"default"),l=(0,i.M)(t,"config"),d=new s.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/admin/loginSuUser",pathname:"/api/admin/loginSuUser",bundlePath:"",filename:""},userland:t})},89159:(e,r,n)=>{n.d(r,{A:()=>t});function t(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",t=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",s=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),i=r;e?.userId&&(i+=`user_${e.userId}_`),o&&(i+=`${o}_`),i+=n;let u=r;e?.userId&&(u+=`user_${e.userId}_`),o&&(u+=`${o}_`),u+=t;let a=r;return e?.userId&&(a+=`user_${e.userId}_`),o&&(a+=`${o}_`),{keyCookieName:i,csrfCookieName:u,oneTimeCodeName:a+=s}}},68829:(e,r,n)=>{n.d(r,{A:()=>i});var t=n(55511),s=n(79428),o=n(31542);function i({data:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encryption string is invalid"),e;let{key:i,salt:u,keyLen:a,algorithm:c,bufferAllocSize:_}=(0,o.A)({encryptionKey:r});if(!i?.match(/.{8,}/))return console.log("Encryption key is invalid"),e;if(!u?.match(/.{8,}/))return console.log("Encryption salt is invalid"),e;let l=(0,t.scryptSync)(i,u,a),d=s.Buffer.alloc(_,0),E=(0,t.createCipheriv)(c,l,d);try{let r=E.update(e,"utf8","hex");return r+=E.final("hex")}catch(r){return console.log("Error in encrypting =>",r.message),global.ERROR_CALLBACK?.("Error Encrypting Data",r),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>s});var t=n(82535);function s(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,t.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>t});function t(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=29756);module.exports=n})();
@@ -1,16 +1,16 @@
"use strict";(()=>{var e={};e.id=6799,e.ids=[6799],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,s){return s in r?r[s]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,s)):"function"==typeof r&&"default"===s?r:void 0}}})},74336:(e,r,s)=>{s.r(r),s.d(r,{config:()=>d,default:()=>_,routeModule:()=>p});var t={};s.r(t),s.d(t,{default:()=>i});var n=s(89947),o=s(2706),a=s(96762),l=s(30944),c=s(67619),u=s(87369);async function i(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Wrong Method"});let s=await (0,u.A)(e);if(!s?.logged_in_status)return r.json({success:!1,log:"No Logs"});let{database:t,query:n}=e.body;e.body.user;try{let e=await (0,l.A)({database:t,queryString:n});if(!e)return r.json({success:!1,msg:"Query Failed!"});r.json({success:!0,result:e})}catch(e){console.log(e.message),(0,c.A)({component:"/api/runUserDbQuery/main-catch-error",message:e.message}),r.json({success:!1})}}let _=(0,a.M)(t,"default"),d=(0,a.M)(t,"config"),p=new n.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/admin/runUserDbQuery",pathname:"/api/admin/runUserDbQuery",bundlePath:"",filename:""},userland:t})},87369:(e,r,s)=>{s.d(r,{A:()=>o});var t=s(95969),n=s(89159);async function o(e){let{keyCookieName:r,csrfCookieName:s}=(0,n.A)(),o=`${r}_su`;if(!e.cookies?.[o])return console.log("No auth key cookie found"),null;let a=(0,t.A)({encryptedString:e.cookies[o]});if(!a)return console.log("No user payload found"),null;let l=JSON.parse(a);return l.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):l.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):l}},89159:(e,r,s)=>{s.d(r,{A:()=>t});function t(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",s=process.env.DSQL_COOKIES_KEY_NAME||"key",t=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",n=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),a=r;e?.userId&&(a+=`user_${e.userId}_`),o&&(a+=`${o}_`),a+=s;let l=r;e?.userId&&(l+=`user_${e.userId}_`),o&&(l+=`${o}_`),l+=t;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),o&&(c+=`${o}_`),{keyCookieName:a,csrfCookieName:l,oneTimeCodeName:c+=n}}},43775:(e,r,s)=>{s.d(r,{A:()=>o});var t=s(95969);let n=/^id$|^uuid$|^date_created$|^date_created_code$|^date_created_timestamp$|^date_updated$|^date_updated_code$|^date_updated_timestamp$/;async function o({unparsedResults:e,tableSchema:r}){let s=[];try{for(let o=0;o<e.length;o++){let a=e[o],l=Object.keys(a);for(let e=0;e<l.length;e++){let s=l[e],o=r?.fields[e];if(s?.match(n))continue;let c=a[s];("number"==typeof c||c)&&o?.encrypted&&c?.match(/./)&&(a[s]=(0,t.A)({encryptedString:c}))}s.push(a)}return s}catch(r){return console.log("ERROR in parseDbResults Function =>",r.message),e}}},67619:(e,r,s)=>{s.d(r,{A:()=>o});var t=s(29021),n=s.n(t);async function o({user:e,message:r,component:s,noMail:t,req:o}){let a=new Date,l=(()=>{if(!o)return null;try{let e=o.headers["x-forwarded-for"],r=o.headers["x-real-ip"],s=o.headers["cf-connecting-ip"],t=Array.isArray(e)?e[0]:e?.split(",")[0],n=s||t||r||o.socket.remoteAddress;if(!n)return null;return String(n)}catch(e){return null}})();try{let t=`🚀 SERVER ERROR ===========================
"use strict";(()=>{var e={};e.id=6799,e.ids=[6799],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},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}}})},74336:(e,r,t)=>{t.r(r),t.d(r,{config:()=>d,default:()=>_,routeModule:()=>p});var n={};t.r(n),t.d(n,{default:()=>i});var s=t(89947),o=t(2706),a=t(96762),l=t(30944),c=t(67619),u=t(87369);async function i(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Wrong Method"});let t=await (0,u.A)(e);if(!t?.logged_in_status)return r.json({success:!1,log:"No Logs"});let{database:n,query:s}=e.body;e.body.user;try{let e=await (0,l.A)({database:n,queryString:s});if(!e)return r.json({success:!1,msg:"Query Failed!"});r.json({success:!0,result:e})}catch(e){console.log(e.message),(0,c.A)({component:"/api/runUserDbQuery/main-catch-error",message:e.message}),r.json({success:!1})}}let _=(0,a.M)(n,"default"),d=(0,a.M)(n,"config"),p=new s.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/admin/runUserDbQuery",pathname:"/api/admin/runUserDbQuery",bundlePath:"",filename:""},userland:n})},87369:(e,r,t)=>{t.d(r,{A:()=>o});var n=t(95969),s=t(89159);async function o(e){let{keyCookieName:r,csrfCookieName:t}=(0,s.A)(),o=`${r}_su`;if(!e.cookies?.[o])return console.log("No auth key cookie found"),null;let a=(0,n.A)({encryptedString:e.cookies[o]});if(!a)return console.log("No user payload found"),null;let l=JSON.parse(a);return l.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):l.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):l}},89159:(e,r,t)=>{t.d(r,{A:()=>n});function n(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",t=process.env.DSQL_COOKIES_KEY_NAME||"key",n=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",s=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),a=r;e?.userId&&(a+=`user_${e.userId}_`),o&&(a+=`${o}_`),a+=t;let l=r;e?.userId&&(l+=`user_${e.userId}_`),o&&(l+=`${o}_`),l+=n;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),o&&(c+=`${o}_`),{keyCookieName:a,csrfCookieName:l,oneTimeCodeName:c+=s}}},43775:(e,r,t)=>{t.d(r,{A:()=>o});var n=t(95969);let s=/^id$|^uuid$|^date_created$|^date_created_code$|^date_created_timestamp$|^date_updated$|^date_updated_code$|^date_updated_timestamp$/;async function o({unparsedResults:e,tableSchema:r}){let t=[];try{for(let o=0;o<e.length;o++){let a=e[o],l=Object.keys(a);for(let e=0;e<l.length;e++){let t=l[e],o=r?.fields[e];if(t?.match(s))continue;let c=a[t];("number"==typeof c||c)&&o?.encrypted&&c?.match(/./)&&(a[t]=(0,n.A)({encryptedString:c}))}t.push(a)}return t}catch(r){return console.log("ERROR in parseDbResults Function =>",r.message),e}}},67619:(e,r,t)=>{t.d(r,{A:()=>o});var n=t(29021),s=t.n(n);async function o({user:e,message:r,component:t,noMail:n,req:o}){let a=new Date,l=(()=>{if(!o)return null;try{let e=o.headers["x-forwarded-for"],r=o.headers["x-real-ip"],t=o.headers["cf-connecting-ip"],n=Array.isArray(e)?e[0]:e?.split(",")[0],s=t||n||r||o.socket.remoteAddress;if(!s)return null;return String(s)}catch(e){return null}})();try{let n=`🚀 SERVER ERROR ===========================
Error Message: ${r}
Component: ${s}`;e?.id&&e?.first_name&&e?.last_name&&e?.email&&(t+=`
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}`),o?.url&&(t+=`
URL: ${o.url}`),o?.body&&(t+=`
Request Body: ${JSON.stringify(o.body,null,4)}`),l&&(t+=`
IP: ${l}`),t+=`
User Email: ${e?.email}`),o?.url&&(n+=`
URL: ${o.url}`),o?.body&&(n+=`
Request Body: ${JSON.stringify(o.body,null,4)}`),l&&(n+=`
IP: ${l}`),n+=`
Date: ${a.toDateString()}
========================================`,n().existsSync("./.tmp/error.log")||n().writeFileSync("./.tmp/error.log","","utf-8");let c=n().readFileSync("./.tmp/error.log","utf-8");n().writeFileSync("./.tmp/error.log",t),n().appendFileSync("./.tmp/error.log",`
========================================`,s().existsSync("./.tmp/error.log")||s().writeFileSync("./.tmp/error.log","","utf-8");let c=s().readFileSync("./.tmp/error.log","utf-8");s().writeFileSync("./.tmp/error.log",n),s().appendFileSync("./.tmp/error.log",`
${c}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},30944:(e,r,s)=>{s.d(r,{A:()=>l});var t=s(43775),n=s(67619),o=s(7447),a=s(64292);async function l({queryString:e,queryValuesArray:r,database:s,tableSchema:l,debug:c}){let u=(0,o.A)({fa:!0});global.DSQL_USE_LOCAL&&(u=(0,o.A)({local:!0})),s?.match(/^datasquirel$/)&&(u=(0,o.A)()),c&&(console.log("varDatabaseDbHandler:query:",e),console.log("varDatabaseDbHandler:values:",r),console.log("varDatabaseDbHandler:CONNECTION:",u.getConfig()));let i=await (0,a.A)(u,e,r);if(c&&console.log("varDatabaseDbHandler:results:",i),i&&l)try{return await (0,t.A)({unparsedResults:i,tableSchema:l})}catch(e){return console.log("\x1b[31mvarDatabaseDbHandler ERROR\x1b[0m =>",s,e),(0,n.A)({component:"varDatabaseDbHandler/lines-52-53",message:e.message}),null}else if(i)return i;else return null}},95969:(e,r,s)=>{s.d(r,{A:()=>a});var t=s(55511),n=s(79428),o=s(31542);function a({encryptedString:e,encryptionKey:r,encryptionSalt:s}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:a,salt:l,keyLen:c,algorithm:u,bufferAllocSize:i}=(0,o.A)({encryptionKey:r});if(!a?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!l?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,t.scryptSync)(a,l,c),d=n.Buffer.alloc(i,0),p=(0,t.createDecipheriv)(u,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),e}}},64292:(e,r,s)=>{async function t(e,r,s){try{if(!e)throw Error("No Connection Found!");if(!r)throw Error("Query String Required!");if("string"==typeof r){let t=await e.query(n(r),s);return JSON.parse(JSON.stringify(t))}if("object"!=typeof r)return null;{let s=[];for(let t=0;t<r.length;t++)try{let o=r[t],a=await e.query(n(o.query),o.values);s.push(JSON.parse(JSON.stringify(a)))}catch(e){console.log(`connDbHandler Query Error: ${e.message}`),s.push(null)}return s}}catch(r){return console.log(`connDbHandler Error: ${r.message}`),console.log(e?.config()),null}finally{e?.end()}}function n(e){return e.replace(/\n/gm,"").replace(/ {2,}/g,"").trim()}s.d(r,{A:()=>t})},7447:(e,r,s)=>{s.d(r,{A:()=>o});var t=s(9973),n=s.n(t);function o(e){return global.DSQL_USE_LOCAL||e?.local?global.DSQL_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.ro?global.DSQL_READ_ONLY_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_READ_ONLY_USERNAME,password:process.env.DSQL_DB_READ_ONLY_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.fa?global.DSQL_FULL_ACCESS_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_FULL_ACCESS_USERNAME,password:process.env.DSQL_DB_FULL_ACCESS_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):global.DSQL_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}})}},31542:(e,r,s)=>{s.d(r,{A:()=>n});var t=s(82535);function n(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,t.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,s)=>{s.d(r,{A:()=>t});function t(e,r){try{let s=Number(e);if("number"!=typeof s||isNaN(s))return 0;if(r)return Number(s.toFixed(r));return Math.round(s)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return s}});var s=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,s)=>{e.exports=s(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var s=r(r.s=74336);module.exports=s})();
${c}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},30944:(e,r,t)=>{t.d(r,{A:()=>l});var n=t(43775),s=t(67619),o=t(7447),a=t(64292);async function l({queryString:e,queryValuesArray:r,database:t,tableSchema:l,debug:c}){let u=(0,o.A)({fa:!0});global.DSQL_USE_LOCAL&&(u=(0,o.A)({local:!0})),t?.match(/^datasquirel$/)&&(u=(0,o.A)()),c&&(console.log("varDatabaseDbHandler:query:",e),console.log("varDatabaseDbHandler:values:",r),console.log("varDatabaseDbHandler:CONNECTION:",u.getConfig()));let i=await (0,a.A)(u,e,r);if(c&&console.log("varDatabaseDbHandler:results:",i),i&&l)try{return await (0,n.A)({unparsedResults:i,tableSchema:l})}catch(e){return console.log("\x1b[31mvarDatabaseDbHandler ERROR\x1b[0m =>",t,e),global.ERROR_CALLBACK?.("VarDb Handler Error",e),(0,s.A)({component:"varDatabaseDbHandler/lines-52-53",message:e.message}),null}else if(i)return i;else return null}},95969:(e,r,t)=>{t.d(r,{A:()=>a});var n=t(55511),s=t(79428),o=t(31542);function a({encryptedString:e,encryptionKey:r,encryptionSalt:t}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:a,salt:l,keyLen:c,algorithm:u,bufferAllocSize:i}=(0,o.A)({encryptionKey:r});if(!a?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!l?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let _=(0,n.scryptSync)(a,l,c),d=s.Buffer.alloc(i,0),p=(0,n.createDecipheriv)(u,_,d);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),global.ERROR_CALLBACK?.("Error Decrypting data",r),e}}},64292:(e,r,t)=>{async function n(e,r,t){try{if(!e)throw Error("No Connection Found!");if(!r)throw Error("Query String Required!");if("string"==typeof r){let n=await e.query(s(r),t);return JSON.parse(JSON.stringify(n))}if("object"!=typeof r)return null;{let t=[];for(let n=0;n<r.length;n++)try{let o=r[n],a=await e.query(s(o.query),o.values);t.push(JSON.parse(JSON.stringify(a)))}catch(e){global.ERROR_CALLBACK?.("Connection DB Handler Query Error",e),t.push(null)}return t}}catch(e){return global.ERROR_CALLBACK?.("Connection DB Handler Error",e),null}finally{e?.end()}}function s(e){return e.replace(/\n/gm,"").replace(/ {2,}/g,"").trim()}t.d(r,{A:()=>n})},7447:(e,r,t)=>{t.d(r,{A:()=>o});var n=t(9973),s=t.n(n);function o(e){return global.DSQL_USE_LOCAL||e?.local?global.DSQL_DB_CONN||s()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.ro?global.DSQL_READ_ONLY_DB_CONN||s()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_READ_ONLY_USERNAME,password:process.env.DSQL_DB_READ_ONLY_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.fa?global.DSQL_FULL_ACCESS_DB_CONN||s()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_FULL_ACCESS_USERNAME,password:process.env.DSQL_DB_FULL_ACCESS_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):global.DSQL_DB_CONN||s()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}})}},31542:(e,r,t)=>{t.d(r,{A:()=>s});var n=t(82535);function s(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,n.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,t)=>{t.d(r,{A:()=>n});function n(e,r){try{let t=Number(e);if("number"!=typeof t||isNaN(t))return 0;if(r)return Number(t.toFixed(r));return Math.round(t)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},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=74336);module.exports=t})();
@@ -1 +1 @@
"use strict";(()=>{var e={};e.id=5989,e.ids=[5989],e.modules={27825:e=>{e.exports=require("lodash")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},33873:e=>{e.exports=require("path")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},86181:(e,r,n)=>{n.r(r),n.d(r,{config:()=>A,default:()=>E,routeModule:()=>S});var t={};n.r(t),n.d(t,{default:()=>f});var o=n(89947),s=n(2706),u=n(96762),i=n(29021),c=n.n(i),a=n(33873),l=n.n(a),d=n(87369),_=n(27825),p=n.n(_);async function f(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Wrong Method"});let n=await (0,d.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});try{let n=l().join(process.cwd(),".env"),t=c().readFileSync(n,"utf-8"),o=RegExp(`${p().escapeRegExp(e.body.key)}=.*`);t.match(o);let s=t.replace(o,`${e.body.key}=${e.body.value}`);c().writeFileSync(n,s,"utf-8"),r.json({success:!0})}catch(e){console.log("updating Env error =>",e.message),r.json({success:!1,error:e.message})}}let E=(0,u.M)(t,"default"),A=(0,u.M)(t,"config"),S=new o.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/admin/updateEnv",pathname:"/api/admin/updateEnv",bundlePath:"",filename:""},userland:t})},87369:(e,r,n)=>{n.d(r,{A:()=>s});var t=n(95969),o=n(89159);async function s(e){let{keyCookieName:r,csrfCookieName:n}=(0,o.A)(),s=`${r}_su`;if(!e.cookies?.[s])return console.log("No auth key cookie found"),null;let u=(0,t.A)({encryptedString:e.cookies[s]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>t});function t(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",t=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",o=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),s&&(u+=`${s}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),s&&(i+=`${s}_`),i+=t;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),s&&(c+=`${s}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:c+=o}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var t=n(55511),o=n(79428),s=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:c,algorithm:a,bufferAllocSize:l}=(0,s.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let d=(0,t.scryptSync)(u,i,c),_=o.Buffer.alloc(l,0),p=(0,t.createDecipheriv)(a,d,_);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>o});var t=n(82535);function o(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,t.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>t});function t(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=86181);module.exports=n})();
"use strict";(()=>{var e={};e.id=5989,e.ids=[5989],e.modules={27825:e=>{e.exports=require("lodash")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},33873:e=>{e.exports=require("path")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},86181:(e,r,n)=>{n.r(r),n.d(r,{config:()=>A,default:()=>f,routeModule:()=>S});var t={};n.r(t),n.d(t,{default:()=>E});var o=n(89947),s=n(2706),u=n(96762),i=n(29021),a=n.n(i),c=n(33873),l=n.n(c),d=n(87369),_=n(27825),p=n.n(_);async function E(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Wrong Method"});let n=await (0,d.A)(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});try{let n=l().join(process.cwd(),".env"),t=a().readFileSync(n,"utf-8"),o=RegExp(`${p().escapeRegExp(e.body.key)}=.*`);t.match(o);let s=t.replace(o,`${e.body.key}=${e.body.value}`);a().writeFileSync(n,s,"utf-8"),r.json({success:!0})}catch(e){console.log("updating Env error =>",e.message),r.json({success:!1,error:e.message})}}let f=(0,u.M)(t,"default"),A=(0,u.M)(t,"config"),S=new o.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/admin/updateEnv",pathname:"/api/admin/updateEnv",bundlePath:"",filename:""},userland:t})},87369:(e,r,n)=>{n.d(r,{A:()=>s});var t=n(95969),o=n(89159);async function s(e){let{keyCookieName:r,csrfCookieName:n}=(0,o.A)(),s=`${r}_su`;if(!e.cookies?.[s])return console.log("No auth key cookie found"),null;let u=(0,t.A)({encryptedString:e.cookies[s]});if(!u)return console.log("No user payload found"),null;let i=JSON.parse(u);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,n)=>{n.d(r,{A:()=>t});function t(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",n=process.env.DSQL_COOKIES_KEY_NAME||"key",t=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",o=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),u=r;e?.userId&&(u+=`user_${e.userId}_`),s&&(u+=`${s}_`),u+=n;let i=r;e?.userId&&(i+=`user_${e.userId}_`),s&&(i+=`${s}_`),i+=t;let a=r;return e?.userId&&(a+=`user_${e.userId}_`),s&&(a+=`${s}_`),{keyCookieName:u,csrfCookieName:i,oneTimeCodeName:a+=o}}},95969:(e,r,n)=>{n.d(r,{A:()=>u});var t=n(55511),o=n(79428),s=n(31542);function u({encryptedString:e,encryptionKey:r,encryptionSalt:n}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:u,salt:i,keyLen:a,algorithm:c,bufferAllocSize:l}=(0,s.A)({encryptionKey:r});if(!u?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let d=(0,t.scryptSync)(u,i,a),_=o.Buffer.alloc(l,0),p=(0,t.createDecipheriv)(c,d,_);try{let r=p.update(e,"hex","utf8");return r+=p.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),global.ERROR_CALLBACK?.("Error Decrypting data",r),e}}},31542:(e,r,n)=>{n.d(r,{A:()=>o});var t=n(82535);function o(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?(0,t.A)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},82535:(e,r,n)=>{n.d(r,{A:()=>t});function t(e,r){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(r)return Number(n.toFixed(r));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=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,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=86181);module.exports=n})();