${o}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},6420:(e,t,r)=>{r(81630);let s=r(51348),a=r(72907),n=r(29021);async function l(e,t,r,l){if(!e.cookies?.datasquirelAuthKey?.match(/./))return null;let i=a(e.cookies.datasquirelAuthKey);if(!i)return null;let o=JSON.parse(i);if(!o.csrf_k||r&&!e.headers["x-csrf-auth"]?.match(RegExp(`${o.csrf_k}`)))return null;let c=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!c)return console.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(r&&!n.existsSync(`${c}/${o.csrf_k}`))return null;if(0==o.verification_status&&!r){let e=await s(`SELECTverification_statusFROMusersWHEREid='${o.id}'`);e&&e[0]&&1==e[0].verification_status&&t.setHeader("Set-Cookie",["user_refresh=1"])}return o?.date&&Date.now()-o.date>6048e5?null:o}e.exports=l},33364:(e,t,r)=>{let s=r(82703),a=r(72583),n=r(16570),l=r(51348),i=r(21339);async function o({dbContext:e,paradigm:t,dbFullName:r,tableName:o,data:c,tableSchema:u,identifierColumnName:p,identifierValue:d,encryptionKey:m,encryptionSalt:S}){if(!c||!Object.keys(c).length)return null;let f=!e?.match(/dsql.user/i)&&(!r||!!r.match(/^datasquirel$/)),_=f?l:i,D=Object.keys(c),g=[],h=[];for(let e=0;e<D.length;e++)try{let t=D[e],r=c[t],l=u?u?.fields?.filter(e=>e.fieldName===t):null,i=l&&l[0]?l[0]:null;if(null==r||void 0==r)continue;i?.richText&&(r=a(r,n)),i?.encrypted&&(r=s(r,m,S)),"object"==typeof r&&(r=JSON.stringify(r)),i?.pattern&&!new RegExp(i.pattern,i.patternFlags||"").test(r)&&(console.log("DSQL: Pattern not matched =>",r),r=""),"string"==typeof r&&r.match(/^null$/i)&&(r={toSqlString:function(){return"NULL"}}),"string"!=typeof r||r.match(/./i)||(r={toSqlString:function(){return"NULL"}}),g.push(`\`${t}\`=?`),"number"==typeofr?h.push(String(r)):h.push(r)}catch(e){console.log("DSQL: Error in parsing data keys in update function =>",e.message);continue}g.push(`date_updated='${Date()}'`),g.push(`date_updated_code='${Date.now()}'`);lety=`UPDATE ${o} SET ${g.join(",")} WHERE \`${p}\`=?`;returnh.push(d),f?await_(y,h):await_({paradigm:t,database:r,queryString:y,queryValues:h})}e.exports=o},72907:(e,t,r)=>{let{scryptSync:s,createDecipheriv:a}=r(55511),{Buffer:n}=r(79428);e.exports=e=>{lett=a("aes-192-cbc",s(process.env.DSQL_ENCRYPTION_PASSWORD||"",process.env.DSQL_ENCRYPTION_SALT||"",24),n.alloc(16,0));try{letr=t.update(e,"hex","utf8");returnr+=t.final("utf8")}catch(e){returnnull}}},30003:e=>{e.exports=/^id$|^uuid$|^date_created$|^date_created_code$|^date_created_timestamp$|^date_updated$|^date_updated_code$|^date_updated_timestamp$/},82703:(e,t,r)=>{let{scryptSync:s,createCipheriv:a}=r(55511),{Buffer:n}=r(79428),l=r(48225);e.exports=(e,t,r)=>{leti=a("aes-192-cbc",s(t||process.env.DSQL_ENCRYPTION_PASSWORD||"",r||process.env.DSQL_ENCRYPTION_SALT||"",24),n.alloc(16,0));try{lett=i.update(e,"utf8","hex");returnt+=i.final("hex")}catch(e){returnl({component:"encrypt",message:e.message}),null}}},16570:e=>{e.exports={allowedTags:["b","i","em","strong","a","p","span","ul","ol","li","h1","h2","h3","h4","h5","h6","img","div","button","pre","code","br"],allowedAttributes:{a:["href"],img:["src","alt","width","height","class","style"],"*":["style","class"]}}},6061:(e,t,r)=>{lets=r(72907),a=r(30003);e.exports=asyncfunction({unparsedResults:e,tableSchema:t}){letr=[];try{for(letn=0;n<e.length;n++){letl=e[n],i=Object.keys(l);for(lete=0;e<i.length;e++){letr=i[e],n=t?.fields[e];if(r?.match(a))continue;leto=l[r];("number"==typeofo||o)&&n?.encrypted&&o?.match(/./)&&(l[r]=s(o))}r.push(l)}returnr}catch(t){returnconsole.log("ERROR in parseDbResults Function =>",t.message),e}}},48225:(e,t,r)=>{lets=r(29021);e.exports=asyncfunction({user:e,message:t,component:r,noMail:a}){letn=`🚀 SERVER ERROR ===========================