dsql-admin/dsql-app/.local_dist/server/pages/admin/[user_id]/schema.js
Benjamin Toby 86f931fb82 Updates
2024-12-08 09:57:48 +01:00

1 line
13 KiB
JavaScript

"use strict";(()=>{var e={};e.id=8591,e.ids=[636,8591],e.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,r){return r in t?t[r]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,r)):"function"==typeof t&&"default"===r?t:void 0}}})},23133:(e,t,r)=>{r.a(e,async(e,s)=>{try{r.r(t),r.d(t,{config:()=>x,default:()=>p,getServerSideProps:()=>h,getStaticPaths:()=>m,getStaticProps:()=>d,reportWebVitals:()=>y,routeModule:()=>M,unstable_getServerProps:()=>q,unstable_getServerSideProps:()=>g,unstable_getStaticParams:()=>f,unstable_getStaticPaths:()=>A,unstable_getStaticProps:()=>v});var a=r(63865),i=r(9455),l=r(30671),u=r(49407),n=r(68268),c=r(74094),o=e([c]);c=(o.then?(await o)():o)[0];let p=(0,l.M)(c,"default"),d=(0,l.M)(c,"getStaticProps"),m=(0,l.M)(c,"getStaticPaths"),h=(0,l.M)(c,"getServerSideProps"),x=(0,l.M)(c,"config"),y=(0,l.M)(c,"reportWebVitals"),v=(0,l.M)(c,"unstable_getStaticProps"),A=(0,l.M)(c,"unstable_getStaticPaths"),f=(0,l.M)(c,"unstable_getStaticParams"),q=(0,l.M)(c,"unstable_getServerProps"),g=(0,l.M)(c,"unstable_getServerSideProps"),M=new a.PagesRouteModule({definition:{kind:i.A.PAGES,page:"/admin/[user_id]/schema",pathname:"/admin/[user_id]/schema",bundlePath:"",filename:""},components:{App:n.default,Document:u.default},userland:c});s()}catch(e){s(e)}})},74223:(e,t,r)=>{r.a(e,async(e,s)=>{try{r.d(t,{A:()=>x});var a=r(8732),i=r(82015),l=r.n(i),u=r(58548),n=r(51548),c=r(74094),o=r(40942);r(63715),r(34844);var p=r(89788),d=r(56248),m=r.n(d),h=e([c,o,p]);function x(e){let{dbSchemaData:t,user:r}=l().useContext(c.UserSchemaContext),[s,i]=l().useState(t),[o,d]=l().useState(null),[h,x]=l().useState(null),[y,v]=l().useState(null);return(0,a.jsxs)(l().Fragment,{children:[(0,a.jsxs)("div",{className:"flex-col items-start gap-0 w-full",children:[(0,a.jsx)("div",{className:"",children:(0,a.jsx)("h1",{className:"text-3xl m-0",children:"User Schema"})}),(0,a.jsx)(u.A,{user:r})]}),(0,a.jsx)("section",{className:"paper",children:(0,a.jsxs)("div",{className:"flex-col items-start w-full",children:[(0,a.jsxs)("div",{className:"w-full justify-between",children:[(0,a.jsx)("h2",{className:"text-xl m-0",children:"Database SCHEMA JSON"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(n.A,{required:!0,selectOptions:[{title:"All Databases",payload:"none"},...t.map((e,t)=>({title:e.dbName,payload:e.dbFullName,name:e.dbFullName}))],name:"databases",onChangeHandler:e=>{e.target.value?.match(/^none$/)?d(null):d(e.target.value)}}),h&&h[0]&&(0,a.jsx)(n.A,{required:!0,selectOptions:[{title:"All Tables",payload:"none"},...h.map((e,t)=>({title:e.tableFullName,payload:e.tableName,name:e.tableName}))],name:"database_tables",onChangeHandler:e=>{e.target.value?.match(/^none$/)?v(null):v(e.target.value)}})]})]}),(0,a.jsx)(p.A,{content:m().stringify(s,null,4),readOnly:!0,options:{wrap:!0},wrapperProps:{className:"h-[60vh]"}})]})})]})}[c,o,p]=h.then?(await h)():h,s()}catch(e){s(e)}})},40942:(e,t,r)=>{r.a(e,async(e,t)=>{try{r(8732),r(82015);var s=r(74094),a=e([s]);s=(a.then?(await a)():a)[0],t()}catch(e){t(e)}})},24671:(e,t,r)=>{r.d(t,{A:()=>a});var s=r(8732);function a(e){return(0,s.jsxs)("a",{href:"/email-verification",className:"card w-full items-center justify-center py-4 gap-2",children:[(0,s.jsx)("img",{src:"/images/warning.png",alt:"Down Arrow",width:25,className:""}),(0,s.jsx)("span",{children:"Your Account is not verified. Please verify your account."})]})}r(82015)},42178:(e,t,r)=>{var s=r(24994);t.A=void 0;var a=s(r(30887)),i=r(8732);t.A=(0,a.default)((0,i.jsx)("path",{d:"M16.62 2.99c-.49-.49-1.28-.49-1.77 0L6.54 11.3c-.39.39-.39 1.02 0 1.41l8.31 8.31c.49.49 1.28.49 1.77 0s.49-1.28 0-1.77L9.38 12l7.25-7.25c.48-.48.48-1.28-.01-1.76"}),"ArrowBackIosRounded")},26406:(e,t,r)=>{var s=r(24994);t.A=void 0;var a=s(r(30887)),i=r(8732);t.A=(0,a.default)([(0,i.jsx)("path",{d:"M22 15c0-1.66-1.34-3-3-3h-1.5v-.5C17.5 8.46 15.04 6 12 6c-.77 0-1.49.17-2.16.46L20.79 17.4c.73-.55 1.21-1.41 1.21-2.4M2 14c0 2.21 1.79 4 4 4h9.73l-8-8H6c-2.21 0-4 1.79-4 4",opacity:".3"},"0"),(0,i.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4c-1.33 0-2.57.36-3.65.97l1.49 1.49C10.51 6.17 11.23 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3 0 .99-.48 1.85-1.21 2.4l1.41 1.41c1.09-.92 1.8-2.27 1.8-3.81 0-2.64-2.05-4.78-4.65-4.96M3 5.27l2.77 2.77h-.42C2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h11.73l2 2 1.41-1.41L4.41 3.86zM7.73 10l8 8H6c-2.21 0-4-1.79-4-4s1.79-4 4-4z"},"1")],"CloudOffTwoTone")},48987:(e,t,r)=>{var s=r(24994);t.A=void 0;var a=s(r(30887)),i=r(8732);t.A=(0,a.default)([(0,i.jsx)("path",{d:"M7 3h10v1H7zm0 17h10v1H7z",opacity:".3"},"0"),(0,i.jsx)("path",{d:"m22 12-4-4v3h-5v2h5v3zm-5 6H7V6h10v1h2V3c0-1.1-.9-2-2-2L7 1.01C5.9 1.01 5 1.9 5 3v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-4h-2zM7 3h10v1H7zm10 18H7v-1h10z"},"1")],"SendToMobileTwoTone")},42125:(e,t,r)=>{var s=r(24994);t.A=void 0;var a=s(r(30887)),i=r(8732);t.A=(0,a.default)([(0,i.jsx)("path",{d:"M14 5H5v14h14v-9h-5zM8 17c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m0-4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m0-4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1",opacity:".3"},"0"),(0,i.jsx)("circle",{cx:"8",cy:"8",r:"1"},"1"),(0,i.jsx)("path",{d:"M15 3H5c-1.1 0-1.99.9-1.99 2L3 19c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V9zm4 16H5V5h9v5h5z"},"2"),(0,i.jsx)("circle",{cx:"8",cy:"12",r:"1"},"3"),(0,i.jsx)("circle",{cx:"8",cy:"16",r:"1"},"4")],"SummarizeTwoTone")},50993:(e,t,r)=>{var s=r(24994);t.A=void 0;var a=s(r(30887)),i=r(8732);t.A=(0,a.default)([(0,i.jsx)("path",{d:"M14.5 9.5C14.5 6.47 12.03 4 9 4S3.5 6.47 3.5 9.5c0 2.47 1.49 3.89 2.35 4.5h6.3c.86-.61 2.35-2.03 2.35-4.5",opacity:".3"},"0"),(0,i.jsx)("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2m-2-1h8v-2H5zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5m-2 0C14.5 6.47 12.03 4 9 4S3.5 6.47 3.5 9.5c0 2.47 1.49 3.89 2.35 4.5h6.3c.86-.61 2.35-2.03 2.35-4.5m6.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94z"},"1")],"TipsAndUpdatesTwoTone")},92441:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("BookText",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["path",{d:"M8 7h6",key:"1f0q6e"}],["path",{d:"M8 11h8",key:"vwpz6n"}]])},96089:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},34637:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},29743:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("FileKey2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v6",key:"rc0qvx"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"4",cy:"16",r:"2",key:"1ehqvc"}],["path",{d:"m10 10-4.5 4.5",key:"7fwrp6"}],["path",{d:"m9 11 1 1",key:"wa6s5q"}]])},10643:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},66916:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]])},83158:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]])},66918:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},10321:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("ShieldEllipsis",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M8 12h.01",key:"czm47f"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 12h.01",key:"1l6xoz"}]])},98136:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]])},25294:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(82544).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},74094:(e,t,r)=>{r.a(e,async(e,s)=>{try{r.r(t),r.d(t,{UserSchemaContext:()=>A,default:()=>x,getServerSideProps:()=>y});var a=r(8732),i=r(82015),l=r.n(i),u=r(95222),n=r(20048),c=r.n(n),o=r(64098),p=r(74223),d=r(24671);r(46437);var m=r(58548),h=e([o,p]);[o,p]=h.then?(await h)():h;let v=r(29021),A=l().createContext({});function x({user:e,query:t,dbSchemaData:r}){let s=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("title",{children:"Add Database | Datasquirel"}),(0,a.jsx)("meta",{name:"description",content:"Add a database"})]});return(0,a.jsx)(u.A,{head:s,user:e,aceEditor:!0,children:(0,a.jsx)(A.Provider,{value:{user:e,dbSchemaData:r},children:e?.verification_status?.toString().match(/1/)?(0,a.jsx)(l().Fragment,{children:(0,a.jsx)(p.A,{})}):(0,a.jsxs)(l().Fragment,{children:[(0,a.jsxs)("div",{className:"flex-col items-start gap-0 w-full",children:[(0,a.jsx)("div",{className:"",children:(0,a.jsx)("h1",{className:"text-3xl m-0",children:"User Schema"})}),(0,a.jsx)(m.A,{user:e})]}),(0,a.jsx)(d.A,{})]})})})}async function y({req:e,res:t,query:r}){let s=await c()(e,t);if(!s?.logged_in_status)return{redirect:{destination:"/login",permanent:!1}};let a=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${s.id}/main.json`;if(!v.existsSync(a))return{redirect:{destination:"/admin",permanent:!1}};let i=JSON.parse(v.readFileSync(a,"utf-8"));return{props:{user:s,query:r,dbSchemaData:i||[]}}}s()}catch(e){s(e)}})},9455:(e,t)=>{var r;Object.defineProperty(t,"A",{enumerable:!0,get:function(){return r}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE"}(r||(r={}))},66099:e=>{e.exports=require("@mui/system")},37616:e=>{e.exports=require("@mui/system/DefaultPropsProvider")},24509:e=>{e.exports=require("@mui/system/InitColorSchemeScript")},84781:e=>{e.exports=require("@mui/system/colorManipulator")},18215:e=>{e.exports=require("@mui/system/createStyled")},59989:e=>{e.exports=require("@mui/system/createTheme")},16670:e=>{e.exports=require("@mui/system/styleFunctionSx")},88698:e=>{e.exports=require("@mui/system/useThemeProps")},76831:e=>{e.exports=require("@mui/utils")},28578:e=>{e.exports=require("@mui/utils/capitalize")},54341:e=>{e.exports=require("@mui/utils/chainPropTypes")},14036:e=>{e.exports=require("@mui/utils/composeClasses")},31112:e=>{e.exports=require("@mui/utils/createChainedFunction")},21763:e=>{e.exports=require("@mui/utils/debounce")},7546:e=>{e.exports=require("@mui/utils/deepmerge")},5928:e=>{e.exports=require("@mui/utils/deprecatedPropType")},30729:e=>{e.exports=require("@mui/utils/elementAcceptingRef")},47822:e=>{e.exports=require("@mui/utils/extractEventHandlers")},20985:e=>{e.exports=require("@mui/utils/formatMuiErrorMessage")},61119:e=>{e.exports=require("@mui/utils/generateUtilityClass")},81699:e=>{e.exports=require("@mui/utils/generateUtilityClasses")},16362:e=>{e.exports=require("@mui/utils/getReactElementRef")},71291:e=>{e.exports=require("@mui/utils/integerPropType")},29823:e=>{e.exports=require("@mui/utils/isMuiElement")},55402:e=>{e.exports=require("@mui/utils/ownerDocument")},46875:e=>{e.exports=require("@mui/utils/ownerWindow")},48080:e=>{e.exports=require("@mui/utils/requirePropFactory")},39597:e=>{e.exports=require("@mui/utils/setRef")},88190:e=>{e.exports=require("@mui/utils/unsupportedProp")},83889:e=>{e.exports=require("@mui/utils/useControlled")},21956:e=>{e.exports=require("@mui/utils/useEnhancedEffect")},4926:e=>{e.exports=require("@mui/utils/useEventCallback")},7376:e=>{e.exports=require("@mui/utils/useForkRef")},63310:e=>{e.exports=require("@mui/utils/useId")},10977:e=>{e.exports=require("@mui/utils/useIsFocusVisible")},10179:e=>{e.exports=require("@mui/utils/useSlotProps")},710:e=>{e.exports=require("@mui/utils/useTimeout")},74956:e=>{e.exports=require("clsx")},40361:e=>{e.exports=require("next/dist/compiled/next-server/pages.runtime.prod.js")},27912:e=>{e.exports=require("next/head")},29825:e=>{e.exports=require("prop-types")},82015:e=>{e.exports=require("react")},22326:e=>{e.exports=require("react-dom")},37727:e=>{e.exports=require("react-transition-group")},8732:e=>{e.exports=require("react/jsx-runtime")},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")},81630:e=>{e.exports=require("http")},33873:e=>{e.exports=require("path")},75979:e=>{e.exports=import("tailwind-merge")}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[9764,883,1790,8268,7070,5134,7847],()=>r(23133));module.exports=s})();