"use strict";exports.id=2282,exports.ids=[2282],exports.modules={67619:(e,a,t)=>{t.d(a,{A:()=>i});varl=t(29021),r=t.n(l);asyncfunctioni({user:e,message:a,component:t,noMail:l,req:i}){letn=newDate,d=(()=>{if(!i)returnnull;try{lete=i.headers["x-forwarded-for"],a=i.headers["x-real-ip"],t=i.headers["cf-connecting-ip"],l=Array.isArray(e)?e[0]:e?.split(",")[0],r=t||l||a||i.socket.remoteAddress;if(!r)returnnull;returnString(r)}catch(e){returnnull}})();try{letl=`🚀 SERVER ERROR ===========================
)AStableExists`,queryValuesArray:[r,t.tableName]});if(c&&c[0]?.tableExists>0){if(await N({dbFullName:r,tableName:d,tableNameFull:t.tableFullName,tableInfoArray:u,userId:e,dbSchema:i,tableIndexes:o,tableIndex:a,childDb:l.childDatabase||void 0,recordedDbEntry:b,tableSchema:t}),t.childrenTables&&t.childrenTables[0])for(let a=0;a<t.childrenTables.length;a++){let r=t.childrenTables[a];await N({dbFullName:r.dbNameFull,tableName:r.tableName,tableNameFull:r.tableNameFull,tableInfoArray:u,userId:e,dbSchema:i,tableIndexes:o,clone:!0,childDb:l.childDatabase||void 0,recordedDbEntry:b,tableSchema:t})}}else if(await E({tableName:d,tableInfoArray:u,dbFullName:r,tableSchema:t,recordedDbEntry:b}),o&&o[0]&&o&&o[0])for(let e=0;e<o.length;e++){let{indexType:a,indexName:t,indexTableFields:l,alias:i}=o[e];if(i?.match(/./))try{if(!(await s({queryString:`SHOWINDEXESFROM\`${r}\`.\`${d}\``})).filter(e=>e.Key_name===i)[0])throwError("This Index Does not Exist")}catch(e){awaits({queryString:`CREATE${a?.match(/fullText/i)?" FULLTEXT":""} INDEX \`${i}\` ON \`${r}\`.\`${d}\`(${l?.map(e=>e.value).map(e=>`\`${e}\``).join(",")}) COMMENT 'schema_index'`})}}}if(f?.[0])for(leta=0;a<f.length;a++){let{dbFullName:t}=f[a];awaitT({userId:e,targetDatabase:t})}}}},41864:(e,a,t)=>{t.d(a,{A:()=>d});varl=t(29021),r=t.n(l),i=t(33873),n=t.n(i);asyncfunctiond({query:e,values:a}){lett,l=global.DSQL_DB_CONN;try{t=e&&a?awaitl.query(e,a):awaitl.query(e)}catch(e){if(process.env.FIRST_RUN)returnnull;console.log("ERROR in dbHandler =>",e.message),console.log(e),console.log(l.config()),r().appendFileSync(n().resolve(__dirname,"../.tmp/dbErrorLogs.txt"),JSON.stringify(e,null,4)+"\n"+Date()+"\n\n\n","utf8"),t=null}finally{awaitl?.end()}returnt?JSON.parse(JSON.stringify(t)):null}},66866:(e,a,t)=>{t.d(a,{A:()=>r});varl=t(41864);asyncfunctionr(e){leta;try{a=await(0,l.A)({query:e})}catch(e){console.log("ERROR in noDatabaseDbHandler =>",e.message)}returna||null}},59338:(e,a,t)=>{t.d(a,{A:()=>l});letl={parse:function(e,a){if(e){if("object"==typeofe)returne;if("string"==typeofe)try{returnJSON.parse(e,a)}catch(e){return}}},stringify:function(e,a,t){try{returnJSON.stringify(e,a||void0,t)}catch(e){return}}}},95610:e=>{e.exports=JSON.parse('[{"fieldName":"id","dataType":"BIGINT","notNullValue":true,"primaryKey":true,"autoIncrement":true},{"fieldName":"uuid","dataType":"UUID","defaultValueLiteral":"UUID()"},{"fieldName":"date_created","dataType":"VARCHAR(250)","nullValue":true},{"fieldName":"date_created_code","dataType":"BIGINT","nullValue":true},{"fieldName":"date_created_timestamp","dataType":"TIMESTAMP","defaultValueLiteral":"CURRENT_TIMESTAMP"},{"fieldName":"date_updated","dataType":"VARCHAR(250)","nullValue":true},{"fieldName":"date_updated_code","dataType":"BIGINT","nullValue":true},{"fieldName":"date_updated_timestamp","dataType":"TIMESTAMP","defaultValueLiteral":"CURRENT_TIMESTAMP","onUpdateLiteral":"CURRENT_TIMESTAMP"}]')}};