UNPKG

lambdaorm

Version:
1 lines 7.35 kB
'use strict';const a92P=a92y;(function(s,y){const i=a92y,g=s();while(!![]){try{const x=parseInt(i(0x1f2))/0x1+-parseInt(i(0x230))/0x2+parseInt(i(0x242))/0x3*(-parseInt(i(0x23e))/0x4)+parseInt(i(0x201))/0x5*(parseInt(i(0x1f8))/0x6)+parseInt(i(0x204))/0x7*(parseInt(i(0x209))/0x8)+-parseInt(i(0x23a))/0x9+parseInt(i(0x214))/0xa*(-parseInt(i(0x228))/0xb);if(x===y)break;else g['push'](g['shift']());}catch(m){g['push'](g['shift']());}}}(a92s,0x9118e));function a92s(){const sy=['transaction','../../connection/infrastructure','connection','SchemaFacadeBuilder','parameters','SchemaStateBuilder','infrastructure','source','end','exp','condition','1045IrbjIQ','./ormLibrary','OperandFacadeBuilder','value','Orm','h3lp','schema','query\x20is\x20empty','325826JbSbsK','apply','defaultStage','done','sentence','SentenceFacadeBuilder','evalAsync','init','filter','domain','7000992brpRmU','logger','subscribe','dialect','156LnDkAh','_logger','next','application','58731cWZhDS','push','StageFacadeBuilder','../../shared/infrastructure','executor','ExpressionFacadeBuilder','parse','../../sentence/infrastructure','ConnectionFacadeBuilder','language','426696zNhVpi','unsubscribe','helper','enums','defineProperty','load','5211786xhjpId','plan','build','execute','val','name','__esModule','model','LoggerBuilder','5EEJzXL','expression','constraints','175WOULwy','metadata','throw','eval','toExpression','350816LDhFGZ','function','ExecutionActionObserver','operand','orm','OrmExpressionsBuilder','state','./expressionsBuilder','sources','ExecutorBuilder','OrmH3lp','9790XkiafR','normalize','OrmLibrary','../../execution/application','then','isNotEmpty','convert','start','addEnum'];a92s=function(){return sy;};return a92s();}function a92y(s,y){const O=a92s();return a92y=function(D,g){D=D-0x1f1;let M=O[D];return M;},a92y(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 q=a92y;function t(c){const o=a92y;try{a(g[o(0x240)](c));}catch(k){w(k);}}function v(c){const p=a92y;try{a(g[p(0x206)](c));}catch(k){w(k);}}function a(c){const f=a92y;c[f(0x233)]?m(c[f(0x22b)]):x(c[f(0x22b)])[f(0x218)](t,v);}a((g=g[q(0x231)](s,y||[]))[q(0x240)]());});};Object[a92P(0x1f6)](exports,a92P(0x1fe),{'value':!![]}),exports[a92P(0x20d)]=exports[a92P(0x22c)]=void 0x0;const infrastructure_1=require(a92P(0x245)),h3lp_1=require(a92P(0x22d)),lambdaorm_base_1=require('lambdaorm-base'),infrastructure_2=require(a92P(0x21e)),expressionsBuilder_1=require(a92P(0x210)),infrastructure_3=require('../../operand/infrastructure'),facadeBuilder_1=require('../../sentence/infrastructure/facadeBuilder'),infrastructure_4=require('../../expressions/infrastructure'),infrastructure_ts_1=require('../../execution/infrastructure.ts'),infrastructure_5=require('../../stage/infrastructure'),infrastructure_6=require(a92P(0x249)),application_1=require(a92P(0x217)),ormLibrary_1=require(a92P(0x229));class Orm{constructor(s){const j=a92P;this['_logger']=s,this['_logger']=s||new lambdaorm_base_1[(j(0x200))]()[j(0x1fa)](),this['helper']=new infrastructure_1[(j(0x213))](h3lp_1[j(0x22d)],this[j(0x23f)]),this['exp']=new expressionsBuilder_1[(j(0x20e))](this[j(0x1f4)])[j(0x1fa)](),new ormLibrary_1[(j(0x216))](this)['load'](),this[j(0x1f1)]=new infrastructure_6['SentenceLanguageServiceBuilder'](this[j(0x1f4)])[j(0x1fa)](),this[j(0x21f)]=new infrastructure_2[(j(0x24a))](this[j(0x1f4)])['build'](),this[j(0x22e)]=new lambdaorm_base_1[(j(0x220))](this[j(0x226)],this[j(0x1f4)])[j(0x1fa)](),this['state']=new lambdaorm_base_1[(j(0x222))](this[j(0x226)],this[j(0x22e)],this[j(0x1f4)])[j(0x1fa)](),this[j(0x246)]=new infrastructure_ts_1[(j(0x212))](this[j(0x21f)],this['language'],this[j(0x226)],this[j(0x1f4)])[j(0x1fa)](this[j(0x20f)]),this[j(0x20c)]=new infrastructure_3[(j(0x22a))](this[j(0x226)],this['helper'])['build'](this[j(0x20f)]),this['sentence']=new facadeBuilder_1[(j(0x235))](this['exp'],this['helper'])[j(0x1fa)](this['state'],this['operand']),this[j(0x202)]=new infrastructure_4[(j(0x247))](this['language'],this[j(0x246)],this[j(0x226)],this['helper'])[j(0x1fa)](this[j(0x234)],this['state']),this['stage']=new infrastructure_5[(j(0x244))](this[j(0x1f1)],this['executor'],this['helper'])[j(0x1fa)](this[j(0x20f)],this[j(0x202)]);}get['logger'](){const b=a92P;return this[b(0x23f)];}set[a92P(0x23b)](s){const l=a92P;this[l(0x23f)]=s;}get[a92P(0x232)](){const u=a92P;return this[u(0x20f)]['stage']['get']();}[a92P(0x237)](s){return __awaiter(this,arguments,void 0x0,function*(y,g=!![]){const e=a92y;var x,m,w;const t=yield this['state']['load'](y||process['cwd']());if(g&&((x=t[e(0x223)])===null||x===void 0x0?void 0x0:x[e(0x211)]))for(const v of t[e(0x223)][e(0x211)][e(0x238)](a=>this[e(0x1f4)][e(0x1fc)][e(0x219)](a['connection']))){this[e(0x21f)][e(0x1f7)](v);}if(t['domain']['enums'])for(const a of t[e(0x239)][e(0x1f5)]){const c=[];if(a['values'])for(const k of a['values']){c[e(0x243)]([k[e(0x1fd)],k[e(0x22b)]]);}this[e(0x226)][e(0x21c)](a[e(0x1fd)],c);}if((m=t[e(0x241)])===null||m===void 0x0?void 0x0:m[e(0x21b)])for(const r of t['application'][e(0x21b)]){(r[e(0x227)]===undefined||this[e(0x226)][e(0x207)](r[e(0x227)]))&&(yield this[e(0x226)][e(0x236)](r[e(0x202)]));}if((w=t['application'])===null||w===void 0x0?void 0x0:w['listeners'])for(const z of t['application']['listeners']){const d=new application_1[(e(0x20b))](z,this['exp']);this[e(0x23c)](d);}return t;});}[a92P(0x225)](){return __awaiter(this,void 0x0,void 0x0,function*(){const n=a92y;var s;const y=this[n(0x20f)][n(0x22e)];if((s=y['application'])===null||s===void 0x0?void 0x0:s[n(0x225)])for(const g of y[n(0x241)][n(0x225)]){(g[n(0x227)]===undefined||this[n(0x226)][n(0x207)](g[n(0x227)]))&&(yield this[n(0x226)][n(0x236)](g[n(0x202)]));}yield this[n(0x21f)][n(0x225)]();});}[a92P(0x23d)](s){const h=a92P;return this[h(0x20f)][h(0x224)]['get'](s)['dialect'];}['normalize'](s){const s0=a92P,y=this[s0(0x208)](s);return this[s0(0x20c)][s0(0x215)](y);}[a92P(0x1ff)](s){const s1=a92P,y=this[s1(0x208)](s);return this[s1(0x234)]['model'](y);}[a92P(0x221)](s){const s2=a92P,y=this[s2(0x208)](s);return this[s2(0x234)]['parameters'](y);}[a92P(0x203)](s){const s3=a92P,y=this['toExpression'](s);return this[s3(0x234)][s3(0x203)](y);}['metadata'](s){const s4=a92P,y=this[s4(0x208)](s);return this[s4(0x234)][s4(0x205)](y);}[a92P(0x1f9)](s,y){const s5=a92P,g=this[s5(0x208)](s),x=y!==undefined&&typeof y==='string'?JSON[s5(0x248)](y):y||{};return this['expression'][s5(0x1f9)](g,x);}['execute'](s){return __awaiter(this,arguments,void 0x0,function*(y,g={},x){const s6=a92y;if(y===undefined||y===null)throw new Error(s6(0x22f));const m=this[s6(0x208)](y);if(m==='')throw new Error('query\x20is\x20empty');const w=g!==undefined&&typeof g==='string'?JSON[s6(0x248)](g):g||{},t=x!==undefined&&typeof x==='string'?JSON[s6(0x248)](x):x||{};return this[s6(0x202)][s6(0x1fb)](m,w,t);});}['transaction'](s,y){return __awaiter(this,void 0x0,void 0x0,function*(){const s7=a92y;return this[s7(0x202)][s7(0x21d)](s,y);});}['toExpression'](s){const s8=a92P;return typeof s!=='string'?this[s8(0x226)][s8(0x21a)](s,s8(0x20a))[0x0]:s;}[a92P(0x23c)](s){const s9=a92P;this[s9(0x246)][s9(0x23c)](s);}['unsubscribe'](s){const ss=a92P;this[ss(0x246)][ss(0x1f3)](s);}}exports[a92P(0x22c)]=Orm,exports[a92P(0x20d)]=new Orm();