dsql-admin/dsql-app/.local_dist/server/pages/api/addNewMediaFolder.js
Benjamin Toby 81cf010cb5 Updates
2025-01-14 16:27:08 +01:00

1 line
3.0 KiB
JavaScript

"use strict";(()=>{var e={};e.id=6534,e.ids=[6534],e.modules={39908:e=>{e.exports=require("@moduletrace/datasquirel/dist/users/user-auth")},27825:e=>{e.exports=require("lodash")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},29021:e=>{e.exports=require("fs")},33873:e=>{e.exports=require("path")},96762:(e,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}}})},24709:(e,r,t)=>{t.r(r),t.d(r,{config:()=>E,default:()=>m,routeModule:()=>b});var n={};t.r(n),t.d(n,{default:()=>P});var o=t(89947),i=t(2706),a=t(96762),s=t(29021),u=t.n(s),c=t(33873),l=t.n(c),f=t(69842),d=t(27825),p=t.n(d);function A(e,r,t){if(!e)return"";if("number"==typeof e||"boolean"==typeof e)return e;if("string"==typeof e&&!e?.toString()?.match(/./))return"";if("object"==typeof e&&!Array.isArray(e))return y(e,r);if("object"==typeof e&&Array.isArray(e))return g(e,r);let n=e;return t&&(n=e.toString().replace(t,"")),r||(n=e.toString().replace(/\n|\r|\n\r|\r\n/g,"").replace(/ /g,"")),n=n.replace(/(?<!\\)\'/g,"\\'").replace(/(?<!\\)\`/g,"\\`").replace(/\/\*\*\//g,"").replace(/select |insert |drop |delete |alter |create |exec | union | or | like | concat|LOAD_FILE|ASCII| COLLATE | HAVING | information_schema|DECLARE |\#|WAITFOR |delay |BENCHMARK |\/\*.*\*\//gi,"\\$&")}function y(e,r){let t={...e};return Object.keys(t).forEach(e=>{let n=t[e];if(!n){delete t[e];return}"string"==typeof n||"number"==typeof n?t[e]=A(n,r):"object"!=typeof n||Array.isArray(n)?"object"==typeof n&&Array.isArray(n)&&(t[e]=g(n,r)):t[e]=y(n,r)}),t}function g(e,r){let t=p().cloneDeep(e);return t.forEach((e,n)=>{if(!e){t.splice(n,1);return}"string"==typeof e||"number"==typeof e?t[n]=A(e,r):"object"!=typeof e||Array.isArray(e)?"object"==typeof e&&Array.isArray(e)&&(t[n]=g(e,r)):t[n]=y(e,r)}),t}async function P(e,r){if("POST"!==e.method)return r.json({msg:"Failed!"});let t=await (0,f.A)(e,r,!0);if(!t)return r.json({success:!1,msg:"Unauthorized"});let{name:n}=A(e.body),o=process.env.DSQL_STATIC_SERVER_DIR;if(!o)return console.log("Static File ENV not Found!"),r.json({success:!1,msg:"No Static File Path"});let i=l().join(o,`images/user-images/user-${t.id}/`)+n;if(u().existsSync(i))return r.json({success:!1});u().mkdirSync(i),r.json({success:!0})}let m=(0,a.M)(n,"default"),E=(0,a.M)(n,"config"),b=new o.PagesAPIRouteModule({definition:{kind:i.A.PAGES_API,page:"/api/addNewMediaFolder",pathname:"/api/addNewMediaFolder",bundlePath:"",filename:""},userland:n})},69842:(e,r,t)=>{t.d(r,{A:()=>i});var n=t(39908),o=t.n(n);async function i(e,r,t){let n=o()({req:e,level:t?"deep":void 0});return console.log(n),n.payload}},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=24709);module.exports=t})();