lambdaorm
Version:
1 lines • 4.54 kB
JavaScript
'use strict';const a126o=a126y;(function(s,y){const r=a126y,g=s();while(!![]){try{const x=-parseInt(r(0x1ee))/0x1+parseInt(r(0x1ff))/0x2*(parseInt(r(0x1d6))/0x3)+parseInt(r(0x202))/0x4+parseInt(r(0x1f9))/0x5+parseInt(r(0x1e0))/0x6*(-parseInt(r(0x205))/0x7)+parseInt(r(0x200))/0x8*(parseInt(r(0x1de))/0x9)+-parseInt(r(0x1d5))/0xa*(-parseInt(r(0x1d7))/0xb);if(x===y)break;else g['push'](g['shift']());}catch(m){g['push'](g['shift']());}}}(a126s,0x460ae));function a126y(s,y){const O=a126s();return a126y=function(D,g){D=D-0x1d4;let M=O[D];return M;},a126y(s,y);}var __awaiter=this&&this['__awaiter']||function(s,y,P,g){function x(m){return m instanceof P?m:new P(function(w){w(m);});}return new(P||(P=Promise))(function(m,w){const i=a126y;function t(c){try{a(g['next'](c));}catch(k){w(k);}}function v(c){const z=a126y;try{a(g[z(0x1e8)](c));}catch(k){w(k);}}function a(c){const d=a126y;c['done']?m(c['value']):x(c['value'])[d(0x206)](t,v);}a((g=g['apply'](s,y||[]))[i(0x208)]());});};Object[a126o(0x201)](exports,a126o(0x1ec),{'value':!![]}),exports['StageModelService']=exports[a126o(0x1f4)]=void 0x0;const lambdaorm_base_1=require(a126o(0x1d4));class StageStateService{constructor(s,y){const p=a126o;this['schemaState']=s,this[p(0x203)]=y;}get[a126o(0x1da)](){const f=a126o;return this[f(0x1ef)][f(0x1fb)]?this['helper']['fs'][f(0x1eb)](this['schemaState']['schemaPath']):process[f(0x1dd)]();}[a126o(0x20e)](s){return __awaiter(this,void 0x0,void 0x0,function*(){const q=a126y,y=this['getFile'](s),g=yield this[q(0x203)]['fs']['exists'](y);if(g){const x=yield this[q(0x203)]['fs']['read'](y);if(x)return JSON['parse'](x);}return this['empty']();});}['update'](s,y){return __awaiter(this,void 0x0,void 0x0,function*(){const j=a126y,g=this[j(0x1f1)](s);yield this['helper']['fs'][j(0x1e6)](g,JSON[j(0x20c)](y));});}[a126o(0x1e1)](s){return __awaiter(this,void 0x0,void 0x0,function*(){const b=a126y,y=this[b(0x1f1)](s);yield this[b(0x203)]['fs'][b(0x1e1)](y);});}}class StageMappingService extends StageStateService{[a126o(0x1fa)](){return{'mapping':[],'pending':[],'inconsistency':[]};}[a126o(0x1f1)](s){const l=a126o;var y,g;return this[l(0x203)]['fs']['join'](this[l(0x1da)],((g=(y=this[l(0x1ef)][l(0x1e7)]['infrastructure'])===null||y===void 0x0?void 0x0:y[l(0x204)])===null||g===void 0x0?void 0x0:g[l(0x1fe)])||l(0x1dc),s+l(0x20b));}}exports[a126o(0x1f4)]=StageMappingService;class StageModelService extends StageStateService{['empty'](){return{'mappings':[]};}[a126o(0x1f1)](s){const u=a126o;var y,g;return this['helper']['fs'][u(0x1f3)](this[u(0x1da)],((g=(y=this[u(0x1ef)][u(0x1e7)][u(0x1fd)])===null||y===void 0x0?void 0x0:y[u(0x204)])===null||g===void 0x0?void 0x0:g[u(0x1fe)])||'orm_state',s+u(0x20a));}['ddl'](s,y){return __awaiter(this,void 0x0,void 0x0,function*(){const e=a126y,g=[];for(const x in y){const m=y[x],w=g['find'](t=>t[e(0x207)]===m[e(0x1e9)]);w===undefined?g[e(0x1f7)]({'name':m[e(0x1e9)],'dialect':m[e(0x1db)],'queries':[m]}):w[e(0x1f0)]['push'](m);}for(const t in g){const v=g[t],a=this['ddlFile'](s,v),c=v[e(0x1f0)][e(0x1e4)](k=>k[e(0x1ea)])[e(0x1f3)](';\x0a')+';';yield this[e(0x203)]['fs'][e(0x1e6)](a,c);}});}[a126o(0x209)](s,y){const n=a126o;var g,x;const m=[lambdaorm_base_1[n(0x1e2)][n(0x1f8)]][n(0x1f5)](y[n(0x1db)])?n(0x1d9):n(0x1f2),w=this[n(0x1f6)]();return this[n(0x203)]['fs'][n(0x1f3)](this[n(0x1da)],((x=(g=this[n(0x1ef)][n(0x1e7)][n(0x1fd)])===null||g===void 0x0?void 0x0:g[n(0x204)])===null||x===void 0x0?void 0x0:x[n(0x1fe)])||n(0x1dc),y[n(0x207)],'V'+w+'__'+s+'.'+m);}[a126o(0x1f6)](){const h=a126o,s=new Date(),y=a=>String(a)[h(0x1ed)](0x2,'0'),g=String(s['getFullYear']())[h(0x1fc)](-0x2),x=y(s['getMonth']()+0x1),m=y(s[h(0x1df)]()),w=y(s[h(0x1e5)]()),t=y(s[h(0x1d8)]()),v=y(s[h(0x20d)]());return''+g+x+m+w+t+v;}}exports[a126o(0x1e3)]=StageModelService;function a126s(){const s0=['cwd','22896hMlSNz','getDate','54nOSUgX','remove','Dialect','StageModelService','map','getHours','write','schema','throw','source','sentence','dirname','__esModule','padStart','31456thAPMM','schemaState','queries','getFile','sql','join','StageMappingService','includes','getSequential','push','MongoDB','217315RkYThs','empty','schemaPath','slice','infrastructure','state','70jDVHgr','1368bEiDoL','defineProperty','146704oBTCwt','helper','paths','244237Ltofyc','then','name','next','ddlFile','-model.json','-data.json','stringify','getSeconds','get','lambdaorm-base','30ILCfbG','6753NKQczi','140877WtRKVb','getMinutes','json','schemaDirPath','dialect','orm_state'];a126s=function(){return s0;};return a126s();}