dsql-admin/dsql-app/.local_dist/server/chunks/5674.js
Benjamin Toby 8b7ea057d0 Updates
2024-12-06 14:24:26 +01:00

16 lines
6.1 KiB
JavaScript

"use strict";exports.id=5674,exports.ids=[5674],exports.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,s){return s in t?t[s]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,s)):"function"==typeof t&&"default"===s?t:void 0}}})},91479:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(8732);function n({pages:e}){if(!e||!e[0])return null;let t=e?.filter(e=>1==e.level);return(0,r.jsxs)("aside",{className:"w-full lg:w-80 p-10 bg-slate-100 dark:bg-slate-800 sticky top-0 overflow-y-auto max-h-max lg:max-h-screen transition-all",children:[(0,r.jsx)("span",{className:"text-2xl m-0 mb-4 text-left font-semibold",children:"Docs"}),(0,r.jsx)("ul",{className:"pl-4 gap-4 flex flex-col items-start",children:function t(s,n){return s.map((s,l)=>{let a=`${n}/${s.slug}`,o=e.filter(e=>2==e.level&&e.parent_id==s.id);return(0,r.jsxs)("li",{children:[(0,r.jsx)("a",{href:a,className:s?.level==1?"font-semibold":"text-slate-600",children:s.title}),o&&o[0]&&(0,r.jsx)("ul",{className:"pl-4 gap-2 flex flex-col items-start text-sm mt-2",children:t(o,a)})]},l)})}(t,"/docs")})]})}s(82015)},84895:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(8732);function n({title:e,description:t}){return(0,r.jsxs)("section",{className:"py-14",children:[(0,r.jsx)("div",{className:"w-full gap-10 justify-between items-start flex-col lg:flex-row relative z-10",children:(0,r.jsxs)("div",{className:"flex-col items-start max-w-[740px] text-left",style:{minWidth:"45%"},children:[(0,r.jsx)("h1",{className:"m-0 leading-tight",children:e}),(0,r.jsx)("span",{className:"font-normal text-xl -my-4",dangerouslySetInnerHTML:{__html:t}})]})}),(0,r.jsx)("img",{src:"/images/grid.webp",alt:"Dotted image background",className:"absolute top-0 left-0 w-full h-full object-cover opacity-5 z-0"})]})}s(82015)},6845:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(63715);function n({setUser:e}){let t=localStorage.getItem("user");if(t)try{e(JSON.parse(t));return}catch(t){e({});return}(0,r.A)("/api/clientSideAuth",{method:"post",body:{}},!0).then(t=>{let s=t.user?t.user:{};e(s),localStorage.setItem("user",JSON.stringify(s))}).catch(e=>{console.log(e)})}},69436:(e,t,s)=>{let r=s(29021),n=s(22373),l=s(9973),a=s(31976),o=l({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:process.env.DSQL_DB_NAME,charset:"utf8mb4",ssl:a()}});e.exports=async function(...e){let t;"production".match(/dev/)&&r.appendFileSync("./.tmp/sqlQuery.sql",e[0]+"\n"+Date()+"\n\n\n","utf8");try{t=await new Promise((t,s)=>{o.query(...e,(e,s,r)=>{e?t({error:e.message}):t(s)})}),await o.end()}catch(e){r.appendFileSync("./.tmp/dbErrorLogs.txt",JSON.stringify(e,null,4)+"\n"+Date()+"\n\n\n","utf8"),t=null,n({component:"dbHandler",message:e.message})}return t?JSON.parse(JSON.stringify(t)):null}},22373:(e,t,s)=>{let r=s(29021),{IncomingMessage:n}=s(81630);e.exports=async function({user:e,message:t,component:s,noMail:n,req:l}){let a=new Date,o=(()=>{if(!l)return null;try{let e=l.headers["x-forwarded-for"],t=l.headers["x-real-ip"],s=l.headers["cf-connecting-ip"],r=Array.isArray(e)?e[0]:e?.split(",")[0],n=s||r||t||l.socket.remoteAddress;if(!n)return null;return String(n)}catch(e){return null}})();try{let n=`🚀 SERVER ERROR ===========================
Error Message: ${t}
Component: ${s}`;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}`),l?.url&&(n+=`
URL: ${l.url}`),l?.body&&(n+=`
Request Body: ${JSON.stringify(l.body,null,4)}`),o&&(n+=`
IP: ${o}`),n+=`
Date: ${a.toDateString()}
========================================`,r.existsSync("./.tmp/error.log")||r.writeFileSync("./.tmp/error.log","","utf-8");let i=r.readFileSync("./.tmp/error.log","utf-8");r.writeFileSync("./.tmp/error.log",n),r.appendFileSync("./.tmp/error.log",`
${i}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},31976:(e,t,s)=>{let r=s(29021);e.exports=function(){let e=process.env.DSQL_SSL_DIR;if(!e?.match(/./))return;let t=`${e}/ca-cert.pem`;if(!r.existsSync(t)){console.log(`${t} does not exist`);return}return{ca:r.readFileSync(`${e}/ca-cert.pem`)}}},49407:(e,t,s)=>{s.r(t),s.d(t,{default:()=>l});var r=s(8732);s(82015);var n=s(20883);function l(e){return(0,r.jsxs)(n.Html,{lang:"en",children:[(0,r.jsxs)(n.Head,{children:[(0,r.jsx)("meta",{name:"author",content:"Datasquirel"}),(0,r.jsx)("meta",{name:"Copyright",content:`Copyright (c) ${new Date().getFullYear()} Datasquirel`}),"dev_dev".match(/dev/)&&(0,r.jsx)("meta",{name:"robots",content:"noindex,nofollow"}),(0,r.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com/",crossOrigin:"anonymous"}),(0,r.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,r.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Poppins"}),(0,r.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Inter"}),(0,r.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=IBM+Plex+Mono"}),(0,r.jsx)("script",{src:"/scripts/themeSelector.js"}),(0,r.jsx)("meta",{httpEquiv:"Content-Type",content:"text/html; charset=UTF-8"}),(0,r.jsx)("meta",{property:"og:site_name",content:"DATASQUIREL"}),(0,r.jsx)("meta",{property:"og:type",content:"website"}),(0,r.jsx)("meta",{name:"twitter:card",content:"summary"}),(0,r.jsx)("meta",{property:"og:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,r.jsx)("meta",{itemProp:"image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,r.jsx)("meta",{name:"twitter:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,r.jsx)("link",{rel:"stylesheet",href:"/styles/prism.css"}),(0,r.jsx)("script",{src:"/scripts/prism.js",async:!0}),(0,r.jsx)("script",{dangerouslySetInnerHTML:{__html:"var DSQL = {}"}})]}),(0,r.jsxs)("body",{children:[(0,r.jsx)(n.Main,{}),(0,r.jsx)(n.NextScript,{})]})]})}},9455:(e,t)=>{var s;Object.defineProperty(t,"A",{enumerable:!0,get:function(){return s}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE"}(s||(s={}))}};