@hotmeshio/hotmesh 0.3.23 → 0.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/build/modules/key.js +1 -1
- package/build/modules/utils.js +1 -1
- package/build/package.json +3 -3
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.js +1 -1
- package/build/services/activities/index.js +1 -1
- package/build/services/activities/interrupt.js +1 -1
- package/build/services/activities/signal.js +1 -1
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.js +1 -1
- package/build/services/connector/providers/postgres.js +1 -0
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.js +1 -1
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshcall/index.js +3 -1
- package/build/services/meshdata/index.d.ts +2 -3
- package/build/services/meshdata/index.js +4 -6
- package/build/services/meshflow/client.js +3 -1
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/workflow.d.ts +8 -0
- package/build/services/meshflow/workflow.js +41 -1
- package/build/services/pipe/functions/array.js +1 -1
- package/build/services/pipe/functions/bitwise.js +1 -1
- package/build/services/pipe/functions/conditional.js +1 -1
- package/build/services/pipe/functions/cron.js +1 -1
- package/build/services/pipe/functions/date.js +1 -1
- package/build/services/pipe/functions/index.js +1 -1
- package/build/services/pipe/functions/json.js +1 -1
- package/build/services/pipe/functions/logical.js +1 -1
- package/build/services/pipe/functions/math.js +1 -1
- package/build/services/pipe/functions/number.js +1 -1
- package/build/services/pipe/functions/object.js +1 -1
- package/build/services/pipe/functions/string.js +1 -1
- package/build/services/pipe/functions/symbol.js +1 -1
- package/build/services/pipe/functions/unary.js +1 -1
- package/build/services/pipe/index.js +1 -1
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.js +1 -1
- package/build/services/search/providers/postgres/postgres.js +1 -1
- package/build/services/search/providers/redis/ioredis.js +1 -1
- package/build/services/search/providers/redis/redis.js +1 -1
- package/build/services/serializer/index.js +1 -1
- package/build/services/store/providers/postgres/kvsql.js +1 -1
- package/build/services/store/providers/postgres/kvtables.d.ts +1 -1
- package/build/services/store/providers/postgres/kvtables.js +1 -1
- package/build/services/store/providers/postgres/kvtransaction.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
- package/build/services/store/providers/postgres/postgres.js +1 -1
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/providers/nats/nats.js +1 -1
- package/build/services/stream/providers/postgres/postgres.js +1 -1
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/index.d.ts +5 -5
- package/build/services/sub/providers/nats/nats.js +1 -1
- package/build/services/sub/providers/postgres/postgres.d.ts +3 -3
- package/build/services/sub/providers/postgres/postgres.js +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.d.ts +1 -0
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/build/types/quorum.d.ts +7 -1
- package/package.json +3 -3
- package/types/quorum.ts +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';const l=b;function a(){const G=['5424EEoIrl','jid','bindJobMetadataPaths','setState','5273506BifdDt','map','length','getTriggerSeed','MDATA_SYMBOLS','startsWith','spn','bindSearchData','transitionAndLogAdjacent','setStatus','execAdjacentParent','13769730kJjwCN','keys','filterAdjacent','data','bindMarkerData','resolveJobId','guid','../serializer','resolve','../../modules/utils','trigger-process-end','toString','getDimensionalSeed','ReporterService','key','CollatorService','setExpired','setActivityError','error','setJobAttributes','46PfrjIm','KEYS','DuplicateJobError','metadata','882924tshRhg','appId','2862oPiDJB','6051330pdlNhr','trigger-collation-overage','adjacencyList','defineProperty','trigger-process-error','$self','granularity','logger','config','marker','1163060MGjgZF','Trigger','getState','store','endActivitySpan','formatISODate','forEach','pending','./activity','info','40466ujbvGy','setStats','$job','ngn','DEFAULT_GRANULARITY','initStatus','debug','createInputContext','safeKey','duplicate-job-error','sleepFor','ACTIVITY','15ihdahz','message','jobId','../../modules/errors','setStateNX','search','initDimensionalAddress','stats','engine','join','resolveGranularity','getJobStatus','notarizeInception','trc','setActivityAttributes','mapJobData','trigger-process','metadata/','expireJob','startJobSpan','aid','startActivitySpan','subscribes','app.activity.mids','__esModule','../pipe','resolveJobKey','resolveTriggerStatistics','setLeg','getVID','mapActivityAttributes','output/metadata/','TelemetryService','context'];a=function(){return G;};return a();}(function(c,d){const k=b,e=c();while(!![]){try{const f=-parseInt(k(0x15a))/0x1*(-parseInt(k(0x175))/0x2)+-parseInt(k(0x15e))/0x3+parseInt(k(0x16b))/0x4*(parseInt(k(0x181))/0x5)+parseInt(k(0x161))/0x6+-parseInt(k(0x13b))/0x7+-parseInt(k(0x1a3))/0x8*(-parseInt(k(0x160))/0x9)+-parseInt(k(0x146))/0xa;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x931a5));Object[l(0x164)](exports,l(0x199),{'value':!![]}),exports['Trigger']=void 0x0;const errors_1=require(l(0x184)),utils_1=require(l(0x14f)),collator_1=require('../collator'),pipe_1=require(l(0x19a)),reporter_1=require('../reporter'),serializer_1=require(l(0x14d)),telemetry_1=require('../telemetry'),activity_1=require(l(0x173));class Trigger extends activity_1['Activity']{constructor(c,d,e,f,g,h){super(c,d,e,f,g,h);}async['process'](c){const m=l;this[m(0x168)]['debug'](m(0x191),{'subscribes':this[m(0x169)]['subscribes']});let d;try{this[m(0x19d)](0x2),await this[m(0x16d)](),d=new telemetry_1[(m(0x1a1))](this[m(0x189)]['appId'],this[m(0x169)],this[m(0x15d)],this[m(0x1a2)]),d[m(0x194)](),d[m(0x196)](this['leg']),this[m(0x190)](),this[m(0x163)]=await this[m(0x148)]();const e=this[m(0x17a)](c,this[m(0x163)]['length']);await this['setStateNX'](e),await this[m(0x144)](e),this[m(0x142)](c),this['bindMarkerData'](c);const f=this['store']['transact']();await this[m(0x13a)](f),await this[m(0x176)](f);c?.[m(0x172)]&&await this['setExpired'](c?.[m(0x172)],f);await collator_1[m(0x155)][m(0x18d)](this,this[m(0x1a2)]['metadata']['guid'],f),await f['exec'](),this['execAdjacentParent'](),d[m(0x19f)]();const g=Number(this[m(0x1a2)][m(0x15d)]['js']);d[m(0x159)]({'app.job.jss':g});const h={'app.job.jss':g};return await this['transitionAndLogAdjacent'](c,g,h),d[m(0x18f)](h),this[m(0x1a2)][m(0x15d)]['jid'];}catch(i){d?.[m(0x157)](i[m(0x182)]);if(i instanceof errors_1[m(0x15c)]){await(0x0,utils_1[m(0x17f)])(0x3e8);const j=await collator_1[m(0x155)]['isInceptionOverage'](this,this[m(0x1a2)][m(0x15d)]['guid']);if(j){this[m(0x168)][m(0x174)](m(0x162),{'job_id':i[m(0x183)],'guid':this['context'][m(0x15d)][m(0x14c)]});return;}this['logger']['error'](m(0x17e),{'job_id':i[m(0x183)],'guid':this[m(0x1a2)][m(0x15d)][m(0x14c)]});}else this[m(0x168)][m(0x158)](m(0x165),{...i});throw i;}finally{d?.['endJobSpan'](),d?.[m(0x16f)](),this['logger'][m(0x17b)](m(0x150),{'subscribes':this[m(0x169)]['subscribes'],'jid':this[m(0x1a2)][m(0x15d)][m(0x1a4)],'gid':this[m(0x1a2)][m(0x15d)]['gid']});}}async[l(0x143)](c={},d,e){const n=l;if(isNaN(c[n(0x172)])){const f=await this['transition'](this[n(0x163)],d);f[n(0x13d)]&&(e[n(0x198)]=f[n(0x18a)](','));}}[l(0x17a)](c={},d){const o=l;if(c[o(0x172)])return-0x1;return d;}async[l(0x156)](c,d){const p=l;await this[p(0x16e)][p(0x193)](this['context']['metadata'][p(0x1a4)],c,d);}['safeKey'](c){return'_'+c;}[l(0x142)](c){const q=l;c?.[q(0x186)]&&Object[q(0x147)](c[q(0x186)])[q(0x171)](d=>{const r=q;this['context']['data'][this[r(0x17d)](d)]=c[r(0x186)][d][r(0x151)]();});}[l(0x14a)](c){const s=l;c?.[s(0x16a)]&&Object[s(0x147)](c[s(0x16a)])['forEach'](d=>{const t=s;d[t(0x140)]('-')&&(this[t(0x1a2)][t(0x149)][d]=c[t(0x16a)][d][t(0x151)]());});}async[l(0x144)](c){const u=l;this[u(0x1a2)][u(0x15d)]['js']=c;}async[l(0x145)](){const v=l;if(this[v(0x1a2)][v(0x15d)]['px']){const c=(0x0,utils_1['formatISODate'])(new Date()),d={'metadata':this['context'][v(0x15d)],'data':{'job_id':this[v(0x1a2)][v(0x15d)][v(0x1a4)],'jc':c,'ju':c}};await this['engine'][v(0x145)](this['context'],d);}}[l(0x17c)](){const w=l,c={[this['metadata'][w(0x195)]]:{'input':{'data':this['data']}},'$self':{'input':{'data':this[w(0x149)]},'output':{'data':this[w(0x149)]}}};return c;}async[l(0x16d)](){const x=l,c=this[x(0x17c)](),d=this[x(0x14b)](c),e=this[x(0x19b)](c),f=(0x0,utils_1[x(0x170)])(new Date()),{id:g,version:h}=await this['engine'][x(0x19e)]();this[x(0x187)](collator_1[x(0x155)]['getDimensionalSeed']());const i={...this[x(0x15d)],'jid':d,'key':e,'as':collator_1[x(0x155)][x(0x13e)]()};this['context']={'metadata':{...this[x(0x15d)],'gid':(0x0,utils_1[x(0x14c)])(),'ngn':this[x(0x1a2)][x(0x15d)][x(0x178)],'pj':this[x(0x1a2)][x(0x15d)]['pj'],'pg':this[x(0x1a2)][x(0x15d)]['pg'],'pd':this['context'][x(0x15d)]['pd'],'pa':this[x(0x1a2)]['metadata']['pa'],'px':this['context'][x(0x15d)]['px'],'app':g,'vrs':h,'tpc':this[x(0x169)][x(0x197)],'trc':this[x(0x1a2)][x(0x15d)][x(0x18e)],'spn':this[x(0x1a2)]['metadata'][x(0x141)],'guid':this[x(0x1a2)][x(0x15d)]['guid'],'jid':d,'dad':collator_1[x(0x155)][x(0x152)](),'key':e,'jc':f,'ju':f,'ts':(0x0,utils_1['getTimeSeries'])(this[x(0x18b)]()),'js':0x0},'data':{},[this[x(0x15d)][x(0x195)]]:{'input':{'data':this[x(0x149)],'metadata':i},'output':{'data':this['data'],'metadata':i},'settings':{'data':{}},'errors':{'data':{}}}},this[x(0x1a2)][x(0x166)]=this[x(0x1a2)][this[x(0x15d)][x(0x195)]],this[x(0x1a2)][x(0x177)]=this[x(0x1a2)];}[l(0x139)](){const y=l;return serializer_1[y(0x13f)]['JOB'][y(0x15b)][y(0x13c)](c=>y(0x192)+c);}['bindActivityMetadataPaths'](){const z=l;return serializer_1[z(0x13f)][z(0x180)]['KEYS']['map'](c=>z(0x1a0)+c);}[l(0x18b)](){const A=l;return this['config'][A(0x188)]?.[A(0x167)]||reporter_1['ReporterService'][A(0x179)];}[l(0x18c)](){const B=l;return this[B(0x1a2)][B(0x15d)]['js'];}[l(0x14b)](c){const C=l,d=this[C(0x169)][C(0x188)]?.['id'];return d?pipe_1['Pipe'][C(0x14e)](d,c):(0x0,utils_1[C(0x14c)])();}[l(0x19b)](c){const D=l,d=this[D(0x169)][D(0x188)]?.[D(0x154)];return d?pipe_1['Pipe'][D(0x14e)](d,c):'';}async[l(0x185)](c){const E=l,d=this['context'][E(0x15d)]['jid'];if(!await this[E(0x16e)][E(0x185)](d,this['engine'][E(0x15f)],c))throw new errors_1[(E(0x15c))](d);}async['setStats'](c){const F=l,d=this['context'][F(0x15d)];if(d['key']&&this[F(0x169)][F(0x188)]?.['measures']){const e=await this[F(0x189)]['getVID'](),f=new reporter_1[(F(0x153))](e,this[F(0x16e)],this[F(0x168)]);await this[F(0x16e)]['setStats'](d[F(0x154)],d[F(0x1a4)],d['ts'],f[F(0x19c)](this[F(0x169)],this['context']),e,c);}}}function b(c,d){const e=a();return b=function(f,g){f=f-0x139;let h=e[f];return h;},b(c,d);}exports[l(0x16c)]=Trigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function b(c,d){const e=a();return b=function(f,g){f=f-0x18f;let h=e[f];return h;},b(c,d);}const j=b;(function(c,d){const i=b,e=c();while(!![]){try{const f=-parseInt(i(0x18f))/0x1*(-parseInt(i(0x195))/0x2)+-parseInt(i(0x1bb))/0x3*(parseInt(i(0x1cf))/0x4)+-parseInt(i(0x1b3))/0x5*(-parseInt(i(0x191))/0x6)+-parseInt(i(0x1bd))/0x7+parseInt(i(0x1b7))/0x8*(-parseInt(i(0x1ab))/0x9)+parseInt(i(0x1ad))/0xa+-parseInt(i(0x19b))/0xb*(-parseInt(i(0x1c2))/0xc);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x3babe));Object[j(0x1be)](exports,j(0x1ac),{'value':!![]}),exports[j(0x1b8)]=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require(j(0x1c3)),collator_1=require('../collator'),pipe_1=require(j(0x1a9)),telemetry_1=require(j(0x19a)),activity_1=require(j(0x1a2));function a(){const m=['36TbvUfQ','../../modules/utils','logger','leg','subtype','metadata','debug','startActivitySpan','InactiveJobError','guid','duplicate','process-event-generational-job-error','gid','128dREPot','store','2rTaHHm','authorizeReentry','1863462aSWdYF','await-inactive-job-error','jid','context','308160kafxQZ','Activity','data','$self','worker-process','../telemetry','1802911GXNPBx','worker-collation-overage','GetStateError','endActivitySpan','output','setActivityError','l1s','./activity','worker-get-state-error','retry','GenerationalError','router','config','error','../pipe','dad','4860xzvzKF','__esModule','533590AiQpLE','CollationError','Pipe','publishMessage','exec','verifyEntry','5smGiQf','resolve','engine','setState','6608dwKYJZ','Worker','aid','execActivity','30255elhpMg','transact','1054375zEJjpA','defineProperty','setStatus','TelemetryService','mapInputData'];a=function(){return m;};return a();}class Worker extends activity_1[j(0x196)]{constructor(c,d,e,f,g,h){super(c,d,e,f,g,h);}async['process'](){const k=j;this['logger']['debug'](k(0x199),{'jid':this['context'][k(0x1c7)][k(0x193)],'gid':this[k(0x194)][k(0x1c7)]['gid'],'aid':this[k(0x1c7)][k(0x1b9)]});let c;try{await this[k(0x1b2)](),c=new telemetry_1[(k(0x1c0))](this[k(0x1b5)]['appId'],this[k(0x1a7)],this[k(0x1c7)],this[k(0x194)]),c[k(0x1c9)](this[k(0x1c5)]),this[k(0x1c1)]();const d=this[k(0x1d0)][k(0x1bc)](),e=await this[k(0x1ba)](d);await collator_1['CollatorService'][k(0x190)](this,d),await this[k(0x1b6)](d),await this[k(0x1bf)](0x0,d);const f=await d[k(0x1b1)]();c['mapActivityAttributes']();const g=this['resolveStatus'](f);return c['setActivityAttributes']({'app.activity.mid':e,'app.job.jss':g}),this[k(0x194)]['metadata'][k(0x1b9)];}catch(h){if(h instanceof errors_1[k(0x1ca)]){this[k(0x1c4)][k(0x1a8)](k(0x192),{...h});return;}else{if(h instanceof errors_1[k(0x1a5)]){this[k(0x1c4)]['info'](k(0x1cd),{...h});return;}else{if(h instanceof errors_1[k(0x19d)]){this[k(0x1c4)]['error'](k(0x1a3),{...h});return;}else{if(h instanceof errors_1[k(0x1ae)]){if(h['fault']===k(0x1cc)){this['logger']['info'](k(0x19c),{'job_id':this['context'][k(0x1c7)][k(0x193)],'guid':this['context']['metadata'][k(0x1cb)]});return;}this[k(0x1c4)]['error']('worker-collation-error',{...h});}else this[k(0x1c4)]['error']('worker-process-error',{...h});}}}c?.[k(0x1a0)](h['message']);throw h;}finally{c?.[k(0x19e)](),this[k(0x1c4)][k(0x1c8)]('worker-process-end',{'jid':this[k(0x194)]['metadata'][k(0x193)],'gid':this['context'][k(0x1c7)][k(0x1ce)],'aid':this['metadata'][k(0x1b9)]});}}async[j(0x1ba)](c){const l=j,d=pipe_1[l(0x1af)][l(0x1b4)](this[l(0x1a7)][l(0x1c6)],this[l(0x194)]),e={'metadata':{'guid':(0x0,utils_1[l(0x1cb)])(),'jid':this[l(0x194)][l(0x1c7)][l(0x193)],'gid':this['context'][l(0x1c7)]['gid'],'dad':this[l(0x1c7)][l(0x1aa)],'aid':this[l(0x1c7)]['aid'],'topic':d,'spn':this[l(0x194)][l(0x198)][l(0x19f)][l(0x1c7)][l(0x1a1)],'trc':this['context'][l(0x1c7)]['trc']},'data':this[l(0x194)][l(0x197)]};return this[l(0x1a7)][l(0x1a4)]&&(e['policies']={'retry':this[l(0x1a7)][l(0x1a4)]}),await this['engine'][l(0x1a6)]?.[l(0x1b0)](d,e,c);}}exports[j(0x1b8)]=Worker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';const m=b;(function(c,d){const l=b,e=c();while(!![]){try{const f=parseInt(l(0xa0))/0x1*(-parseInt(l(0xab))/0x2)+parseInt(l(0xc3))/0x3+-parseInt(l(0xad))/0x4+-parseInt(l(0x9a))/0x5+parseInt(l(0x93))/0x6*(parseInt(l(0xc5))/0x7)+parseInt(l(0xc4))/0x8+-parseInt(l(0xb1))/0x9*(-parseInt(l(0xa3))/0xa);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x51ac6));Object[m(0x95)](exports,'__esModule',{'value':!![]}),exports['CollatorService']=void 0x0;function b(c,d){const e=a();return b=function(f,g){f=f-0x85;let h=e[f];return h;},b(c,d);}const errors_1=require(m(0xaa)),collator_1=require(m(0xba));function a(){const M=['ancestors','getSeed','2982385WDHrFf','forEach','type','authorizeReentry','compile','ancestor','1trPpBT','isArray','getDimensionsById','360qZEvtK','isDuplicate','notarizeEarlyExit','CollatorService','FORBIDDEN','indexOf','activities','../../modules/errors','1324450jRcmOF','getDimensionalAddress','1228308uxoZIQ','config','CollationFaultType','reverse','255888WUxdEO','cycle','notarizeEntry','verifySyntheticInteger','length','999000000000000','substring','getDimensionalIndex','verifyInteger','../../types/collator','collator-trigger-activity-not-found','exit','collate','notarizeInception','dad','collateSynthetic','context','trigger','1771656xkoTNx','882968sYpAhf','615433lsrHku','push','leg','lastIndexOf','getDimensionalSeed','MISSING','INVALID','jid','toString','getDigitAtIndex','bindAncestorArray','InactiveJobError','join','store','notarizeEarlyCompletion','aid','notarizeCompletion','isPrimed','keys','transact','888000001000001','CollationError','DUPLICATE','12ooEFMs','enter','defineProperty','getTriggerSeed','metadata'];a=function(){return M;};return a();}class CollatorService{static['assertJobActive'](c,d,e,f=0x0){const n=m;if(c<=f)throw new errors_1[(n(0x87))](d,c,e);}static['getDimensionalAddress'](c,d=![]){const o=m;let e=c[o(0xc1)][o(0x97)]['dad']||c[o(0x97)]['dad'];return d&&e&&c[o(0xc7)]===0x2&&(e=e[o(0xb7)](0x0,e[o(0xc8)](','))+',0'),CollatorService[o(0xa2)]([...c[o(0xae)][o(0x98)],c['metadata'][o(0x8b)]],e);}static['resolveReentryDimension'](c){const p=m,d=c['config'][p(0x9f)],e=c[p(0xae)][p(0x98)],f=e[p(0xa8)](d),g=c['metadata'][p(0xbf)]['split'](',');return g[p(0xb5)]=f+0x1,g[p(0xc6)]('0'),g[p(0x88)](',');}static async[m(0xb3)](c,d){const q=m,e=await c[q(0x89)][q(0xbd)](c[q(0xc1)]['metadata']['jid'],c[q(0x97)][q(0x8b)],-0x5af3107a4000,this[q(0xac)](c),d);return this[q(0xb9)](e,0x1,q(0x94)),e;}static async[m(0x9d)](c,d){const r=m,e=await c[r(0x89)]['collate'](c[r(0xc1)]['metadata'][r(0xcc)],c[r(0x97)][r(0x8b)],-0x9184e72a000,this[r(0xac)](c),d);return e;}static async[m(0xa5)](c,d){const s=m;return await c[s(0x89)][s(0xbd)](c[s(0xc1)][s(0x97)][s(0xcc)],c[s(0x97)]['aid'],-0xa012317b000,this[s(0xac)](c),d);}static async[m(0x8a)](c,d){const t=m,e=c[t(0xae)][t(0xb2)]?0x9184e72a000:0xa012317b000;return await c['store']['collate'](c[t(0xc1)][t(0x97)][t(0xcc)],c[t(0x97)][t(0x8b)],0xf4241-e,this[t(0xac)](c),d);}static async[m(0xbe)](c,d,e){const u=m;d&&await c['store'][u(0xc0)](c[u(0xc1)][u(0x97)][u(0xcc)],d,0xf4240,e);}static async['isInceptionOverage'](c,d){const v=m;if(d){const e=await c[v(0x89)][v(0xc0)](c[v(0xc1)][v(0x97)]['jid'],d,0xf4240);return e>0xf4240;}return![];}static async['notarizeReentry'](c,d,e){const w=m,f=c[w(0xc1)]['metadata']['jid'],g=e||c['store'][w(0x8f)]();await c['store'][w(0xbd)](f,c[w(0x97)][w(0x8b)],0xf4240,this[w(0xac)](c,!![]),g),await c['store'][w(0xc0)](f,d,0xf4240,g);const [h,i]=await g['exec'](),j=Array[w(0xa1)](h)?h[0x1]:h,k=Array[w(0xa1)](i)?i[0x1]:i;return this['verifyInteger'](j,0x2,'enter'),this[w(0xb4)](k),j;}static async['notarizeContinuation'](c,d){const x=m;return await c['store']['collate'](c['context'][x(0x97)]['jid'],c[x(0x97)][x(0x8b)],0x1,this['getDimensionalAddress'](c),d);}static async[m(0x8c)](c,d){const y=m,e=c[y(0xae)]['cycle']?0x0:0xe8d4a51000;return await c[y(0x89)]['collate'](c['context'][y(0x97)][y(0xcc)],c['metadata'][y(0x8b)],0x1-e,this[y(0xac)](c),d);}static[m(0x85)](c,d){const e=c['toString']();if(d<0x0||d>=e['length'])return null;const f=parseInt(e[d],0xa);return f;}static[m(0xb8)](c){const z=m,d=c['toString']();if(d[z(0xb5)]<0x9)return null;const e=d['substring'](0x3,0x9),f=parseInt(e,0xa);return f-0x1;}static[m(0xa4)](c,d){return this['getDigitAtIndex'](c,d)<0x8;}static['isInactive'](c){const A=m;return this[A(0x85)](c,0x2)<0x9;}static['isPrimed'](c,d){const B=m;return d==0x1?c!=-0x5af3107a4000:this[B(0x85)](c,0x0)<0x9&&this[B(0x85)](c,0x1)<0x9;}static['verifySyntheticInteger'](c){const C=m,d=c[C(0xcd)](),e=parseInt(d[d['length']-0x1],0xa);if(e>0x0)throw new errors_1[(C(0x91))](c,0x2,'enter',collator_1['CollationFaultType']['INACTIVE']);else{if(c>=0x1e8480)throw new errors_1[(C(0x91))](c,0x2,C(0x94),collator_1[C(0xaf)][C(0x92)]);}}static[m(0xb9)](c,d,e){const D=m;let f;if(d===0x1&&e===D(0x94)){if(!this[D(0x8d)](c,0x1))f=collator_1[D(0xaf)][D(0xca)];else{if(this['isDuplicate'](c,0x0))f=collator_1[D(0xaf)][D(0x92)];else c!=0x331a2bfa73000&&(f=collator_1[D(0xaf)][D(0xcb)]);}}else{if(d===0x1&&e===D(0xbc)){if(c===-0x9184e72a000)f=collator_1['CollationFaultType'][D(0xca)];else this[D(0xa4)](c,0x1)&&(f=collator_1[D(0xaf)][D(0x92)]);}else{if(d===0x2&&e===D(0x94)){if(!this[D(0x8d)](c,0x2))f=collator_1[D(0xaf)][D(0xa7)];else this['isInactive'](c)&&(f=collator_1[D(0xaf)]['INACTIVE']);}}}if(f)throw new errors_1[(D(0x91))](c,d,e,f);}static[m(0xa2)](c,d){const E=m,e={'$ADJACENT':d+',0'};let f=d;return c[E(0xb0)]()[E(0x9b)](g=>{const F=E;e[g]=f,f=f['substring'](0x0,f[F(0xc8)](','));}),e;}static[m(0x99)](){const G=m;return G(0xb6);}static[m(0x96)](){const H=m;return H(0x90);}static[m(0x9e)](c){const I=m;CollatorService[I(0x86)](c);}static[m(0x86)](c){const J=m;c[J(0x9b)](d=>{const K=J,e={},f=Object[K(0x8e)](d[K(0xa9)])['find'](h=>d[K(0xa9)][h][K(0x9c)]===K(0xc2));if(!f)throw new Error(K(0xbb));const g=(h,i)=>{const L=K;e[h]=i,d[L(0xa9)][h][L(0x98)]=i;const j=d['transitions']?.[h]||[];j['forEach'](k=>{g(k['to'],[...i,h]);});};g(f,[]);});}static[m(0xc9)](c=0x0){return','+c;}}exports[m(0xa6)]=CollatorService,CollatorService['targetLength']=0xf;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x4cf08a,_0x1ce4f0){const _0xaeb56c=_0x8c52,_0x306f02=_0x4cf08a();while(!![]){try{const _0x246d6b=parseInt(_0xaeb56c(0x90))/0x1+-parseInt(_0xaeb56c(0x92))/0x2*(parseInt(_0xaeb56c(0x8c))/0x3)+-parseInt(_0xaeb56c(0x93))/0x4*(-parseInt(_0xaeb56c(0x8f))/0x5)+-parseInt(_0xaeb56c(0x8d))/0x6+parseInt(_0xaeb56c(0x96))/0x7*(parseInt(_0xaeb56c(0x8e))/0x8)+parseInt(_0xaeb56c(0x94))/0x9*(parseInt(_0xaeb56c(0x95))/0xa)+-parseInt(_0xaeb56c(0x91))/0xb;if(_0x246d6b===_0x1ce4f0)break;else _0x306f02['push'](_0x306f02['shift']());}catch(_0x37e2b2){_0x306f02['push'](_0x306f02['shift']());}}}(_0x4529,0x3c664));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Deployer']=void 0x0;const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),serializer_1=require('../serializer'),pipe_1=require('../pipe'),validator_1=require('./validator'),DEFAULT_METADATA_RANGE_SIZE=0x1a,DEFAULT_DATA_RANGE_SIZE=0x104,DEFAULT_RANGE_SIZE=DEFAULT_METADATA_RANGE_SIZE+DEFAULT_DATA_RANGE_SIZE;function _0x8c52(_0x4d2679,_0x156a0f){const _0x45296d=_0x4529();return _0x8c52=function(_0x8c5280,_0x45455d){_0x8c5280=_0x8c5280-0x8c;let _0x2982c7=_0x45296d[_0x8c5280];return _0x2982c7;},_0x8c52(_0x4d2679,_0x156a0f);}function _0x4529(){const _0x5a9135=['11416bRjKYP','15LJUalw','126984VTtCJN','3317809GFzedH','2WZRGxY','36824EECKJw','9udVEmZ','4866670HvBJVe','245jmakRE','129477tMonpK','594240ysUoWZ'];_0x4529=function(){return _0x5a9135;};return _0x4529();}class Deployer{constructor(_0x424c89){this['manifest']=null,this['manifest']=_0x424c89;}async['deploy'](_0x578622,_0x238ec2){this['store']=_0x578622,this['stream']=_0x238ec2,collator_1['CollatorService']['compile'](this['manifest']['app']['graphs']),this['convertActivitiesToHooks'](),this['convertTopicsToTypes'](),this['copyJobSchemas'](),this['bindBackRefs'](),this['bindParents'](),this['bindCycleTarget'](),this['resolveMappingDependencies'](),this['resolveJobMapsPaths'](),await this['generateSymKeys'](),await this['generateSymVals'](),await this['deployHookPatterns'](),await this['deployActivitySchemas'](),await this['deploySubscriptions'](),await this['deployTransitions'](),await this['deployConsumerGroups']();}['getVID'](){return{'id':this['manifest']['app']['id'],'version':this['manifest']['app']['version']};}async['generateSymKeys'](){for(const _0x2cb7fa of this['manifest']['app']['graphs']){const [,_0x19abaf]=this['findTrigger'](_0x2cb7fa),_0x30fe77=_0x19abaf['subscribes'],[_0x484e06,_0x3cfa6d,_0x2b2d0a]=await this['store']['reserveSymbolRange']('$'+_0x30fe77,DEFAULT_RANGE_SIZE,'JOB'),_0x1826b4='',_0x513bc5=this['bindSymbols'](_0x484e06,_0x3cfa6d,_0x2b2d0a,_0x1826b4,_0x19abaf['PRODUCES']);Object['keys'](_0x513bc5)['length']&&await this['store']['addSymbols']('$'+_0x30fe77,_0x513bc5);for(const [_0x26d886,_0x916d00]of Object['entries'](_0x2cb7fa['activities'])){const [_0x2afcfb,_0x5071a0,_0x5199fe]=await this['store']['reserveSymbolRange'](_0x26d886,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x1b4f3b=_0x26d886+'/';this['bindSelf'](_0x916d00['consumes'],_0x916d00['produces'],_0x26d886);const _0x1062f5=this['bindSymbols'](_0x2afcfb,_0x5071a0,_0x5199fe,_0x1b4f3b,_0x916d00['produces']);Object['keys'](_0x1062f5)['length']&&await this['store']['addSymbols'](_0x26d886,_0x1062f5);}}}['bindSelf'](_0x4942a1,_0x2d5364,_0x501e58){for(const _0x2e292e of[_0x501e58,'$self']){const _0x302b6d=_0x4942a1[_0x2e292e];if(_0x302b6d)for(const _0x4a5440 of _0x302b6d){!_0x2d5364['includes'](_0x4a5440)&&_0x2d5364['push'](_0x4a5440);}}}['bindSymbols'](_0x4b5c0c,_0x57ce6c,_0x3d2c70,_0x5afb1c,_0x1461cb){const _0x5e2c62={},_0x2a34d7={..._0x3d2c70};for(const _0x49d477 of _0x1461cb){const _0x140c0d=''+_0x5afb1c+_0x49d477;if(!_0x2a34d7[_0x140c0d]){if(_0x4b5c0c>_0x57ce6c)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x1dcfd0=(0x0,utils_1['getSymKey'])(_0x4b5c0c);_0x4b5c0c++,_0x5e2c62[_0x140c0d]=_0x1dcfd0,_0x2a34d7[_0x140c0d]=_0x1dcfd0;}}return _0x5e2c62;}['copyJobSchemas'](){const _0x314527=this['manifest']['app']['graphs'];for(const _0x679fe6 of _0x314527){const _0x3fb117=_0x679fe6['output']?.['schema'],_0x4f9510=_0x679fe6['input']?.['schema'];if(!_0x3fb117&&!_0x4f9510)continue;const _0x4a41f2=_0x679fe6['activities'];for(const _0x4fd251 in _0x4a41f2){if(_0x4a41f2[_0x4fd251]['type']==='trigger'){const _0x19749a=_0x4a41f2[_0x4fd251];_0x3fb117&&(!_0x19749a['job']&&(_0x19749a['job']={}),_0x19749a['job']['schema']=_0x3fb117),_0x4f9510&&(_0x19749a['output']={'schema':_0x4f9510});}}}}['bindBackRefs'](){for(const _0x28769e of this['manifest']['app']['graphs']){const _0x359f06=_0x28769e['activities'],_0x295cfc=this['findTrigger'](_0x28769e)[0x0];for(const _0x53dab3 in _0x359f06){_0x359f06[_0x53dab3]['trigger']=_0x295cfc,_0x359f06[_0x53dab3]['subscribes']=_0x28769e['subscribes'],_0x28769e['publishes']&&(_0x359f06[_0x53dab3]['publishes']=_0x28769e['publishes']),_0x359f06[_0x53dab3]['expire']=_0x28769e['expire']??undefined,_0x359f06[_0x53dab3]['persistent']=_0x28769e['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x415eff of this['manifest']['app']['graphs']){const _0x375097=_0x415eff['activities'];for(const _0x482d63 in _0x375097){const _0x1f632f=_0x375097[_0x482d63];_0x1f632f['type']==='cycle'&&(_0x375097[_0x1f632f['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x4ee87f of this['manifest']['app']['graphs']){const _0x383555=_0x4ee87f['activities'];for(const _0x114096 in _0x383555){const _0xce28d=_0x383555[_0x114096];['worker','await']['includes'](_0xce28d['type'])&&_0xce28d['topic']&&!_0xce28d['subtype']&&(_0xce28d['subtype']=_0xce28d['topic']);}}}['convertActivitiesToHooks'](){for(const _0x4ff8e0 of this['manifest']['app']['graphs']){const _0x2f831c=_0x4ff8e0['activities'];for(const _0x5b774a in _0x2f831c){const _0x2d459f=_0x2f831c[_0x5b774a];['activity']['includes'](_0x2d459f['type'])&&(_0x2d459f['type']='hook');}}}async['bindParents'](){const _0x2b445c=this['manifest']['app']['graphs'];for(const _0x39901b of _0x2b445c){if(_0x39901b['transitions'])for(const _0x5e504b in _0x39901b['transitions']){const _0x2494d3=_0x39901b['transitions'][_0x5e504b];for(const _0x3fda9c of _0x2494d3){const _0x2bb326=_0x3fda9c['to'];_0x39901b['activities'][_0x2bb326]['parent']=_0x5e504b;}_0x39901b['activities'][_0x5e504b]['transitions']=_0x2494d3;}}}['collectValues'](_0x5aa893,_0x1b831d){for(const [_0x410065,_0x17a40e]of Object['entries'](_0x5aa893)){if(_0x410065==='enum'||_0x410065==='examples'||_0x410065==='default'){if(Array['isArray'](_0x17a40e))for(const _0x1ceb24 of _0x17a40e){typeof _0x1ceb24==='string'&&_0x1ceb24['length']>0x5&&_0x1b831d['add'](_0x1ceb24);}else typeof _0x17a40e==='string'&&_0x17a40e['length']>0x5&&_0x1b831d['add'](_0x17a40e);}else typeof _0x17a40e==='object'&&this['collectValues'](_0x17a40e,_0x1b831d);}}['traverse'](_0x120b15,_0x53f3d5){for(const _0x3297f9 of Object['values'](_0x120b15)){typeof _0x3297f9==='object'&&('schema'in _0x3297f9?this['collectValues'](_0x3297f9['schema'],_0x53f3d5):this['traverse'](_0x3297f9,_0x53f3d5));}}async['generateSymVals'](){const _0x585cec=new Set();for(const _0x1f4361 of this['manifest']['app']['graphs']){this['traverse'](_0x1f4361,_0x585cec);}const _0x1608c5=await this['store']['getSymbolValues'](),_0x43d0c0=Object['keys'](_0x1608c5)['length'],_0x24c908=Math['pow'](0x34,0x2)-0x1,_0x16128b=serializer_1['SerializerService']['filterSymVals'](_0x43d0c0,_0x24c908,_0x1608c5,_0x585cec);await this['store']['addSymbolValues'](_0x16128b);}['resolveJobMapsPaths'](){function _0x27b4b9(_0x50cc1e){const _0x7be913=[];function _0x2f9450(_0x56d67e,_0x26b19e=[]){for(const _0x1fea54 in _0x56d67e){if(typeof _0x56d67e[_0x1fea54]==='object'&&_0x56d67e[_0x1fea54]!==null&&!('@pipe'in _0x56d67e[_0x1fea54])){const _0x433e49=[..._0x26b19e,_0x1fea54];_0x2f9450(_0x56d67e[_0x1fea54],_0x433e49);}else{const _0x16bac3=[..._0x26b19e,_0x1fea54]['join']('/');if(!_0x16bac3['includes']('[')){const _0x1448fa='data/'+_0x16bac3;!_0x7be913['includes'](_0x1448fa)&&_0x7be913['push'](_0x1448fa);}else{const [_0x5eafe2,_0x46be17]=_0x16bac3['split']('['),[_0x2d53d4,_0x8125ac]=_0x46be17['split'](']');if(!isNaN(parseInt(_0x2d53d4)))for(let _0x3da0a7=0x0;_0x3da0a7<parseInt(_0x2d53d4);_0x3da0a7++){const _0x24e4f1='data/'+_0x5eafe2+'/'+_0x3da0a7;!_0x7be913['includes'](_0x24e4f1)&&_0x7be913['push'](_0x24e4f1);}}}}}return _0x50cc1e&&_0x2f9450(_0x50cc1e),_0x7be913;}for(const _0x210506 of this['manifest']['app']['graphs']){let _0x25862b=[];const [,_0x13fd9f]=this['findTrigger'](_0x210506);for(const _0x27616b in _0x210506['activities']){const _0x23ec53=_0x210506['activities'][_0x27616b];_0x25862b=_0x25862b['concat'](_0x27b4b9(_0x23ec53['job']?.['maps']));}_0x13fd9f['PRODUCES']=_0x25862b;}}['resolveMappingDependencies'](){const _0x1ac809=[];function _0x9ff71c(_0x252ebc,_0x3bc179){for(const _0x1d317b in _0x252ebc){if(typeof _0x252ebc[_0x1d317b]==='string'){const _0xd90173=_0x252ebc[_0x1d317b],_0x5c4b61=_0xd90173['match'](/^\{[^@].*}$/);_0x5c4b61&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0xd90173)&&(_0xd90173['split']('.')[0x1]!=='input'&&(_0x1ac809['push'](_0xd90173),_0x3bc179['push'](_0xd90173)));}else typeof _0x252ebc[_0x1d317b]==='object'&&_0x252ebc[_0x1d317b]!==null&&_0x9ff71c(_0x252ebc[_0x1d317b],_0x3bc179);}}const _0x511e65=this['manifest']['app']['graphs'];for(const _0x2687a8 of _0x511e65){const _0x5b53fa=_0x2687a8['activities'];for(const _0xd04a60 in _0x5b53fa){const _0x342958=_0x5b53fa[_0xd04a60];_0x342958['consumes']=[],_0x9ff71c(_0x342958,_0x342958['consumes']),_0x342958['consumes']=this['groupMappingRules'](_0x342958['consumes']);}}const _0x5d7e2d=this['groupMappingRules'](_0x1ac809);for(const _0x1d270e of _0x511e65){const _0x344dda=_0x1d270e['activities'];for(const _0x146e5a in _0x344dda){const _0x1653fc=_0x344dda[_0x146e5a];_0x1653fc['produces']=_0x5d7e2d[''+_0x146e5a]||[];}}}['groupMappingRules'](_0x2ecd36){_0x2ecd36=Array['from'](new Set(_0x2ecd36))['sort']();const _0x1a6d04={};for(const _0x55f196 of _0x2ecd36){const [_0x147ff9,_0x29958c]=this['resolveMappableValue'](_0x55f196);!_0x1a6d04[_0x147ff9]&&(_0x1a6d04[_0x147ff9]=[]),_0x1a6d04[_0x147ff9]['push'](_0x29958c);}return _0x1a6d04;}['resolveMappableValue'](_0x1058e1){_0x1058e1=_0x1058e1['substring'](0x1,_0x1058e1['length']-0x1);const _0x183aca=_0x1058e1['split']('.');if(_0x183aca[0x0]==='$job'){const [_0x3734af,..._0x4cb831]=_0x183aca;return[_0x3734af,_0x4cb831['join']('/')];}else{const [_0x2006bd,_0x5c6bae,_0x469c9d,..._0x5d87f6]=_0x183aca,_0x103c3b={'hook':'hook/data','input':'input/data','output':_0x469c9d==='data'?'output/data':'output/metadata'}[_0x5c6bae];return[_0x2006bd,_0x103c3b+'/'+_0x5d87f6['join']('/')];}}async['deployActivitySchemas'](){const _0x5e6819=this['manifest']['app']['graphs'],_0x5340e7={};for(const _0x4d0955 of _0x5e6819){const _0x22e989=_0x4d0955['activities'];for(const _0xfafd22 in _0x22e989){const _0x4aed7e=_0x22e989[_0xfafd22];delete _0x4aed7e['transitions'],_0x5340e7[_0xfafd22]=_0x4aed7e;}}await this['store']['setSchemas'](_0x5340e7,this['getVID']());}async['deploySubscriptions'](){const _0x41777d=this['manifest']['app']['graphs'],_0x3c4dc8={};for(const _0x3f307f of _0x41777d){const _0x1c64d3=_0x3f307f['activities'],_0x3e1197=_0x3f307f['subscribes'];for(const _0x4feb10 in _0x1c64d3){if(_0x1c64d3[_0x4feb10]['type']==='trigger'){_0x3c4dc8[_0x3e1197]=_0x4feb10;break;}}}await this['store']['setSubscriptions'](_0x3c4dc8,this['getVID']());}['findTrigger'](_0x5389f1){for(const _0x557266 in _0x5389f1['activities']){const _0x1aa320=_0x5389f1['activities'][_0x557266];if(_0x1aa320['type']==='trigger')return[_0x557266,_0x1aa320];}return null;}async['deployTransitions'](){const _0x557cab=this['manifest']['app']['graphs'],_0x2d183d={};for(const _0x1dc64b of _0x557cab){if(_0x1dc64b['subscribes']&&_0x1dc64b['subscribes']['startsWith']('.')){const [_0x28f602]=this['findTrigger'](_0x1dc64b);_0x28f602&&(_0x2d183d[_0x1dc64b['subscribes']]={[_0x28f602]:!![]});}if(_0x1dc64b['transitions'])for(const _0x32fa5b in _0x1dc64b['transitions']){const _0x16a568=_0x1dc64b['transitions'][_0x32fa5b],_0x1b8fe1={};for(const _0x6b2c1 of _0x16a568){const _0x54b556=_0x6b2c1['to'];_0x6b2c1['conditions']?_0x1b8fe1[_0x54b556]=_0x6b2c1['conditions']:_0x1b8fe1[_0x54b556]=!![];}Object['keys'](_0x1b8fe1)['length']>0x0&&(_0x2d183d['.'+_0x32fa5b]=_0x1b8fe1);}}await this['store']['setTransitions'](_0x2d183d,this['getVID']());}async['deployHookPatterns'](){const _0x329d7a=this['manifest']['app']['graphs'],_0x352c3d={};for(const _0xa0ebd5 of _0x329d7a){if(_0xa0ebd5['hooks'])for(const _0x8f6519 in _0xa0ebd5['hooks']){_0x352c3d[_0x8f6519]=_0xa0ebd5['hooks'][_0x8f6519];const _0x2796a1=_0xa0ebd5['hooks'][_0x8f6519][0x0]['to'],_0x4f9d22=_0xa0ebd5['activities'][_0x2796a1];_0x4f9d22&&(!_0x4f9d22['hook']&&(_0x4f9d22['hook']={}),_0x4f9d22['hook']['topic']=_0x8f6519);}}await this['store']['setHookRules'](_0x352c3d);}async['deployConsumerGroups'](){const _0x3390d3={'appId':this['manifest']['app']['id']},_0x3b2913=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x3390d3);await this['deployConsumerGroup'](_0x3b2913,'ENGINE');for(const _0x59fd61 of this['manifest']['app']['graphs']){const _0x2d7703=_0x59fd61['activities'];for(const _0x45863f in _0x2d7703){const _0x2e8ddf=_0x2d7703[_0x45863f];if(_0x2e8ddf['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x2e8ddf['subtype'],{})===_0x2e8ddf['subtype']){_0x3390d3['topic']=_0x2e8ddf['subtype'];const _0x16a4ef=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x3390d3);await this['deployConsumerGroup'](_0x16a4ef,'WORKER');}}}}async['deployConsumerGroup'](_0x35d510,_0x3374a5){try{await this['stream']['createConsumerGroup'](_0x35d510,_0x3374a5);}catch(_0x38244d){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x35d510,'group':_0x3374a5});}}}exports['Deployer']=Deployer;
|
|
1
|
+
'use strict';function b(c,d){const e=a();return b=function(f,g){f=f-0x8e;let h=e[f];return h;},b(c,d);}const u=b;function a(){const X=['consumes','addSymbols','ACTIVITY','$job','JOB','Pipe','10orzSer','145mJofEU','trigger','154cGvlUm','substring','hook/data','convertTopicsToTypes','data','bindSelf','deployTransitions','enum','resolveMappableValue','graphs','../../modules/key','1037238UuZJaj','9062703jgQiih','type','deploy','examples','pow','deployConsumerGroups','collectValues','4616064vcxAQy','copyJobSchemas','input/data','STREAMS','output/data','KeyType','await','85836lKIEzn','parent','deployHookPatterns','concat','string','entries','8664bBrtwI','resolveJobMapsPaths','groupMappingRules','$self','bindBackRefs','setHookRules','activities','version','4TuVedR','setSchemas','deployConsumerGroup','push','bindParents','length','join','input','stream','547626ELOgvL','job','736pVabjU','hook','data/','__esModule','generateSymVals','manifest','expire','../pipe','startsWith','9667oczXbi','reserveSymbolRange','getSymbolValues','subscribes','sort','PRODUCES','../../modules/utils','SerializerService','split','keys','createConsumerGroup','transitions','getVID','./validator','publishes','getSymKey','mintKey','store','object','Validator','resolve','generateSymKeys','traverse','produces','info','schema','../collator','CONTEXT_VARS','add','includes','activity','findTrigger','hooks','bindSymbols','filterSymVals','compile','1RbZvPH','app','deployActivitySchemas','../serializer','logger','cycle','topic','bindCycleTarget','subtype','worker','output/metadata','resolveMappingDependencies','convertActivitiesToHooks','output'];a=function(){return X;};return a();}(function(c,d){const t=b,e=c();while(!![]){try{const f=parseInt(t(0xac))/0x1*(-parseInt(t(0xce))/0x2)+-parseInt(t(0xf4))/0x3*(-parseInt(t(0xeb))/0x4)+-parseInt(t(0xc1))/0x5*(parseInt(t(0xdd))/0x6)+parseInt(t(0xff))/0x7*(-parseInt(t(0xf6))/0x8)+parseInt(t(0xd6))/0x9*(parseInt(t(0xc0))/0xa)+-parseInt(t(0xc3))/0xb*(parseInt(t(0xe3))/0xc)+parseInt(t(0xcf))/0xd;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x4e97c));Object['defineProperty'](exports,u(0xf9),{'value':!![]}),exports['Deployer']=void 0x0;const key_1=require(u(0xcd)),utils_1=require(u(0x8e)),collator_1=require(u(0xa2)),serializer_1=require(u(0xaf)),pipe_1=require(u(0xfd)),validator_1=require(u(0x95)),DEFAULT_METADATA_RANGE_SIZE=0x1a,DEFAULT_DATA_RANGE_SIZE=0x104,DEFAULT_RANGE_SIZE=DEFAULT_METADATA_RANGE_SIZE+DEFAULT_DATA_RANGE_SIZE;class Deployer{constructor(c){const v=u;this[v(0xfb)]=null,this[v(0xfb)]=c;}async[u(0xd1)](c,d){const w=u;this['store']=c,this[w(0xf3)]=d,collator_1['CollatorService'][w(0xab)](this[w(0xfb)][w(0xad)][w(0xcc)]),this[w(0xb8)](),this[w(0xc6)](),this[w(0xd7)](),this[w(0xe7)](),this[w(0xef)](),this[w(0xb3)](),this[w(0xb7)](),this['resolveJobMapsPaths'](),await this[w(0x9d)](),await this['generateSymVals'](),await this[w(0xdf)](),await this[w(0xae)](),await this['deploySubscriptions'](),await this[w(0xc9)](),await this[w(0xd4)]();}[u(0x94)](){const x=u;return{'id':this[x(0xfb)][x(0xad)]['id'],'version':this['manifest'][x(0xad)][x(0xea)]};}async[u(0x9d)](){const y=u;for(const c of this[y(0xfb)][y(0xad)][y(0xcc)]){const [,d]=this[y(0xa7)](c),e=d[y(0x102)],[f,g,h]=await this[y(0x99)]['reserveSymbolRange']('$'+e,DEFAULT_RANGE_SIZE,y(0xbe)),i='',j=this[y(0xa9)](f,g,h,i,d[y(0x104)]);Object[y(0x91)](j)[y(0xf0)]&&await this['store']['addSymbols']('$'+e,j);for(const [k,l]of Object[y(0xe2)](c['activities'])){const [m,n,o]=await this[y(0x99)][y(0x100)](k,DEFAULT_RANGE_SIZE,y(0xbc)),p=k+'/';this['bindSelf'](l[y(0xba)],l[y(0x9f)],k);const q=this[y(0xa9)](m,n,o,p,l[y(0x9f)]);Object[y(0x91)](q)[y(0xf0)]&&await this[y(0x99)][y(0xbb)](k,q);}}}[u(0xc8)](c,d,e){const z=u;for(const f of[e,z(0xe6)]){const g=c[f];if(g)for(const h of g){!d[z(0xa5)](h)&&d[z(0xee)](h);}}}['bindSymbols'](c,d,e,f,g){const A=u,h={},i={...e};for(const j of g){const k=''+f+j;if(!i[k]){if(c>d)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const l=(0x0,utils_1[A(0x97)])(c);c++,h[k]=l,i[k]=l;}}return h;}['copyJobSchemas'](){const B=u,c=this[B(0xfb)][B(0xad)][B(0xcc)];for(const d of c){const e=d[B(0xb9)]?.[B(0xa1)],f=d[B(0xf2)]?.[B(0xa1)];if(!e&&!f)continue;const g=d[B(0xe9)];for(const h in g){if(g[h][B(0xd0)]==='trigger'){const i=g[h];e&&(!i[B(0xf5)]&&(i[B(0xf5)]={}),i[B(0xf5)][B(0xa1)]=e),f&&(i[B(0xb9)]={'schema':f});}}}}[u(0xe7)](){const C=u;for(const c of this[C(0xfb)][C(0xad)][C(0xcc)]){const d=c[C(0xe9)],e=this['findTrigger'](c)[0x0];for(const f in d){d[f][C(0xc2)]=e,d[f]['subscribes']=c['subscribes'],c[C(0x96)]&&(d[f][C(0x96)]=c[C(0x96)]),d[f][C(0xfc)]=c[C(0xfc)]??undefined,d[f]['persistent']=c['persistent']??undefined;}}}[u(0xb3)](){const D=u;for(const c of this['manifest'][D(0xad)][D(0xcc)]){const d=c[D(0xe9)];for(const e in d){const f=d[e];f[D(0xd0)]==='cycle'&&(d[f['ancestor']][D(0xb1)]=!![]);}}}[u(0xc6)](){const E=u;for(const c of this[E(0xfb)]['app']['graphs']){const d=c['activities'];for(const e in d){const f=d[e];[E(0xb5),E(0xdc)][E(0xa5)](f['type'])&&f['topic']&&!f[E(0xb4)]&&(f[E(0xb4)]=f[E(0xb2)]);}}}[u(0xb8)](){const F=u;for(const c of this[F(0xfb)][F(0xad)][F(0xcc)]){const d=c[F(0xe9)];for(const e in d){const f=d[e];[F(0xa6)][F(0xa5)](f['type'])&&(f['type']=F(0xf7));}}}async[u(0xef)](){const G=u,c=this[G(0xfb)][G(0xad)][G(0xcc)];for(const d of c){if(d[G(0x93)])for(const e in d[G(0x93)]){const f=d[G(0x93)][e];for(const g of f){const h=g['to'];d['activities'][h][G(0xde)]=e;}d[G(0xe9)][e]['transitions']=f;}}}['collectValues'](c,d){const H=u;for(const [e,f]of Object[H(0xe2)](c)){if(e===H(0xca)||e===H(0xd2)||e==='default'){if(Array['isArray'](f))for(const g of f){typeof g===H(0xe1)&&g['length']>0x5&&d[H(0xa4)](g);}else typeof f===H(0xe1)&&f['length']>0x5&&d[H(0xa4)](f);}else typeof f===H(0x9a)&&this[H(0xd5)](f,d);}}[u(0x9e)](c,d){const I=u;for(const e of Object['values'](c)){typeof e===I(0x9a)&&(I(0xa1)in e?this[I(0xd5)](e[I(0xa1)],d):this[I(0x9e)](e,d));}}async[u(0xfa)](){const J=u,c=new Set();for(const h of this[J(0xfb)][J(0xad)]['graphs']){this['traverse'](h,c);}const d=await this[J(0x99)][J(0x101)](),e=Object[J(0x91)](d)['length'],f=Math[J(0xd3)](0x34,0x2)-0x1,g=serializer_1[J(0x8f)][J(0xaa)](e,f,d,c);await this[J(0x99)]['addSymbolValues'](g);}[u(0xe4)](){const L=u;function c(d){const e=[];function f(g,h=[]){const K=b;for(const j in g){if(typeof g[j]===K(0x9a)&&g[j]!==null&&!('@pipe'in g[j])){const k=[...h,j];f(g[j],k);}else{const l=[...h,j]['join']('/');if(!l[K(0xa5)]('[')){const m='data/'+l;!e[K(0xa5)](m)&&e[K(0xee)](m);}else{const [n,o]=l[K(0x90)]('['),[p,q]=o[K(0x90)](']');if(!isNaN(parseInt(p)))for(let r=0x0;r<parseInt(p);r++){const s=K(0xf8)+n+'/'+r;!e[K(0xa5)](s)&&e[K(0xee)](s);}}}}}return d&&f(d),e;}for(const d of this['manifest'][L(0xad)][L(0xcc)]){let e=[];const [,f]=this[L(0xa7)](d);for(const g in d[L(0xe9)]){const h=d[L(0xe9)][g];e=e[L(0xe0)](c(h['job']?.['maps']));}f[L(0x104)]=e;}}[u(0xb7)](){const N=u,c=[];function d(g,h){const M=b;for(const i in g){if(typeof g[i]===M(0xe1)){const j=g[i],k=j['match'](/^\{[^@].*}$/);k&&!validator_1[M(0x9b)][M(0xa3)][M(0xa5)](j)&&(j[M(0x90)]('.')[0x1]!==M(0xf2)&&(c[M(0xee)](j),h['push'](j)));}else typeof g[i]===M(0x9a)&&g[i]!==null&&d(g[i],h);}}const e=this[N(0xfb)][N(0xad)][N(0xcc)];for(const g of e){const h=g[N(0xe9)];for(const i in h){const j=h[i];j['consumes']=[],d(j,j[N(0xba)]),j['consumes']=this[N(0xe5)](j[N(0xba)]);}}const f=this[N(0xe5)](c);for(const k of e){const l=k[N(0xe9)];for(const m in l){const n=l[m];n['produces']=f[''+m]||[];}}}[u(0xe5)](c){const O=u;c=Array['from'](new Set(c))[O(0x103)]();const d={};for(const e of c){const [f,g]=this[O(0xcb)](e);!d[f]&&(d[f]=[]),d[f][O(0xee)](g);}return d;}[u(0xcb)](c){const P=u;c=c[P(0xc4)](0x1,c[P(0xf0)]-0x1);const d=c[P(0x90)]('.');if(d[0x0]===P(0xbd)){const [e,...f]=d;return[e,f['join']('/')];}else{const [g,h,i,...j]=d,k={'hook':P(0xc5),'input':P(0xd8),'output':i===P(0xc7)?P(0xda):P(0xb6)}[h];return[g,k+'/'+j[P(0xf1)]('/')];}}async['deployActivitySchemas'](){const Q=u,c=this['manifest']['app'][Q(0xcc)],d={};for(const e of c){const f=e[Q(0xe9)];for(const g in f){const h=f[g];delete h[Q(0x93)],d[g]=h;}}await this[Q(0x99)][Q(0xec)](d,this[Q(0x94)]());}async['deploySubscriptions'](){const R=u,c=this[R(0xfb)]['app'][R(0xcc)],d={};for(const e of c){const f=e[R(0xe9)],g=e['subscribes'];for(const h in f){if(f[h]['type']==='trigger'){d[g]=h;break;}}}await this['store']['setSubscriptions'](d,this[R(0x94)]());}[u(0xa7)](c){const S=u;for(const d in c['activities']){const e=c[S(0xe9)][d];if(e[S(0xd0)]===S(0xc2))return[d,e];}return null;}async[u(0xc9)](){const T=u,c=this[T(0xfb)]['app'][T(0xcc)],d={};for(const e of c){if(e['subscribes']&&e['subscribes'][T(0xfe)]('.')){const [f]=this['findTrigger'](e);f&&(d[e[T(0x102)]]={[f]:!![]});}if(e[T(0x93)])for(const g in e[T(0x93)]){const h=e[T(0x93)][g],i={};for(const j of h){const k=j['to'];j['conditions']?i[k]=j['conditions']:i[k]=!![];}Object[T(0x91)](i)[T(0xf0)]>0x0&&(d['.'+g]=i);}}await this[T(0x99)]['setTransitions'](d,this[T(0x94)]());}async[u(0xdf)](){const U=u,c=this[U(0xfb)][U(0xad)]['graphs'],d={};for(const e of c){if(e[U(0xa8)])for(const f in e[U(0xa8)]){d[f]=e[U(0xa8)][f];const g=e['hooks'][f][0x0]['to'],h=e['activities'][g];h&&(!h[U(0xf7)]&&(h['hook']={}),h[U(0xf7)][U(0xb2)]=f);}}await this['store'][U(0xe8)](d);}async['deployConsumerGroups'](){const V=u,c={'appId':this[V(0xfb)][V(0xad)]['id']},d=this[V(0x99)][V(0x98)](key_1[V(0xdb)]['STREAMS'],c);await this[V(0xed)](d,'ENGINE');for(const e of this['manifest'][V(0xad)][V(0xcc)]){const f=e[V(0xe9)];for(const g in f){const h=f[g];if(h[V(0xd0)]===V(0xb5)&&pipe_1[V(0xbf)][V(0x9c)](h['subtype'],{})===h[V(0xb4)]){c[V(0xb2)]=h[V(0xb4)];const i=this[V(0x99)][V(0x98)](key_1['KeyType'][V(0xd9)],c);await this['deployConsumerGroup'](i,'WORKER');}}}}async[u(0xed)](c,d){const W=u;try{await this['stream'][W(0x92)](c,d);}catch(e){this[W(0x99)][W(0xb0)][W(0xa0)]('router-stream-group-exists',{'stream':c,'group':d});}}}exports['Deployer']=Deployer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const i=b;(function(c,d){const h=b,e=c();while(!![]){try{const f=parseInt(h(0x1ec))/0x1+parseInt(h(0x1e4))/0x2+-parseInt(h(0x1d0))/0x3+parseInt(h(0x1c2))/0x4*(-parseInt(h(0x1d4))/0x5)+parseInt(h(0x1c6))/0x6*(parseInt(h(0x1c3))/0x7)+-parseInt(h(0x1cc))/0x8+-parseInt(h(0x1e2))/0x9*(-parseInt(h(0x1c9))/0xa);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xadd43));function a(){const s=['writable','Validator','plan','14404VjUzyw','109767UgoCno','hasOwnProperty','deploy','456qeBeHM','fs/promises','__esModule','70cBgSGS','prototype','store','8380752AjIQNb','CompilerService','app','trim','2568300MlUvuY','call','dereference','__importStar','1525TWaNbd','default','@apidevtools/json-schema-ref-parser','create','js-yaml','saveAsJSON','dirname','activate','load','stream','./deployer','stringify','getOwnPropertyDescriptor','logger','2573865ZEIYGB','.hotmesh.','407590MllkcH','./validator','error','defineProperty','__importDefault','utf8','validate','isPath','316556llqAPX','.json','setApp'];a=function(){return s;};return a();}function b(c,d){const e=a();return b=function(f,g){f=f-0x1bd;let h=e[f];return h;},b(c,d);}var __createBinding=this&&this['__createBinding']||(Object[i(0x1d7)]?function(c,d,e,f){const j=i;if(f===undefined)f=e;var g=Object[j(0x1e0)](d,e);(!g||('get'in g?!d[j(0x1c8)]:g[j(0x1bf)]||g['configurable']))&&(g={'enumerable':!![],'get':function(){return d[e];}}),Object['defineProperty'](c,f,g);}:function(c,d,e,f){if(f===undefined)f=e;c[f]=d[e];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[i(0x1d7)]?function(c,d){Object['defineProperty'](c,'default',{'enumerable':!![],'value':d});}:function(c,d){const k=i;c[k(0x1d5)]=d;}),__importStar=this&&this[i(0x1d3)]||function(c){const l=i;if(c&&c[l(0x1c8)])return c;var d={};if(c!=null){for(var e in c)if(e!==l(0x1d5)&&Object[l(0x1ca)][l(0x1c4)][l(0x1d1)](c,e))__createBinding(d,c,e);}return __setModuleDefault(d,c),d;},__importDefault=this&&this[i(0x1e8)]||function(c){return c&&c['__esModule']?c:{'default':c};};Object[i(0x1e7)](exports,'__esModule',{'value':!![]}),exports[i(0x1cd)]=void 0x0;const fs=__importStar(require(i(0x1c7))),path=__importStar(require('path')),json_schema_ref_parser_1=__importDefault(require(i(0x1d6))),js_yaml_1=__importDefault(require(i(0x1d8))),deployer_1=require(i(0x1de)),validator_1=require(i(0x1e5));class CompilerService{constructor(c,d,e){const m=i;this['store']=c,this['stream']=d,this[m(0x1e1)]=e;}async[i(0x1c1)](c){const n=i;try{let d;this['isPath'](c)?d=await json_schema_ref_parser_1[n(0x1d5)][n(0x1d2)](c):d=js_yaml_1['default'][n(0x1dc)](c);const e=new validator_1[(n(0x1c0))](d);return e[n(0x1ea)](this[n(0x1cb)]),d;}catch(f){this[n(0x1e1)]['error']('compiler-plan-error',f);}}[i(0x1eb)](c){const o=i;return!c[o(0x1cf)]()['startsWith']('app:');}async[i(0x1c5)](c){const p=i;try{let d;this['isPath'](c)?(d=await json_schema_ref_parser_1[p(0x1d5)][p(0x1d2)](c),await this[p(0x1d9)](c,d)):d=js_yaml_1[p(0x1d5)][p(0x1dc)](c);const e=new validator_1[(p(0x1c0))](d);e[p(0x1ea)](this[p(0x1cb)]);const f=new deployer_1['Deployer'](d);return await f[p(0x1c5)](this[p(0x1cb)],this[p(0x1dd)]),await this['store'][p(0x1be)](d[p(0x1ce)]['id'],d[p(0x1ce)]['version']),d;}catch(g){this[p(0x1e1)][p(0x1e6)]('compiler-deploy-error',g);}}async[i(0x1db)](c,d){const q=i;return await this[q(0x1cb)]['activateAppVersion'](c,d);}async[i(0x1d9)](c,d){const r=i,e=JSON[r(0x1df)](d,null,0x2),f=path['join'](path[r(0x1da)](c),r(0x1e3)+d[r(0x1ce)]['id']+'.'+d['app']['version']+r(0x1bd));await fs['writeFile'](f,e,r(0x1e9));}}exports[i(0x1cd)]=CompilerService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function a(){const y=['includes','slice','store','getMappingStatements','validateHooks','$app','validateTransitionConditions','1251816lHSeIf','../pipe','Mapping\x20statement\x20references\x20non-existent\x20activity:\x20','42IpmkBL','validateTransitions','graphs','push','2rYbszk','from','manifest','4784211Kqrebd','validateConditionalStatements','has','split','extractMappingStatements','object','{$item}','$graph','activityIds','mappingStatements','string','1607528dSbKvK','Duplicate\x20activity\x20id\x20found:\x20','isFunction','validateMappingStatements','defineProperty','resolveFunction','Validator','keys','{$input}','11303020JalXNK','app','validateReferencedActivityIds','335DYWRXO','validateStats','{$index}','validateGraphPublishSubscribe','validateUniqueHandledTopics','{$key}','Pipe','516338cFRfVH','startsWith','SYS_VARS','activities','isMappingStatement','{$output}','validateActivityIds','forEach','validateSchemas','8202YqwSZL','isContextVariable','421896kPxWGS'];a=function(){return y;};return a();}const k=b;(function(c,d){const j=b,e=c();while(!![]){try{const f=-parseInt(j(0x14a))/0x1*(-parseInt(j(0x164))/0x2)+parseInt(j(0x15d))/0x3+-parseInt(j(0x172))/0x4+-parseInt(j(0x143))/0x5*(-parseInt(j(0x153))/0x6)+-parseInt(j(0x160))/0x7*(-parseInt(j(0x155))/0x8)+parseInt(j(0x167))/0x9+-parseInt(j(0x140))/0xa;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x53418));Object[k(0x13b)](exports,'__esModule',{'value':!![]}),exports[k(0x13d)]=void 0x0;const pipe_1=require(k(0x15e));function b(c,d){const e=a();return b=function(f,g){f=f-0x13a;let h=e[f];return h;},b(c,d);}class Validator{constructor(c){const l=k;this[l(0x166)]=null,this[l(0x16f)]=[],this[l(0x170)]={},this['store']=null,this[l(0x166)]=c;}async['validate'](c){const m=k;this[m(0x158)]=c,this[m(0x159)](),this[m(0x150)](),this[m(0x142)](),this[m(0x13a)](),this[m(0x161)](),this[m(0x15c)](),this[m(0x144)](),this[m(0x152)](),this[m(0x147)](),this['validateGraphPublishSubscribe'](),this[m(0x15a)](),this[m(0x168)]();}[k(0x150)](){const n=k,c=new Set();this[n(0x166)]['app'][n(0x162)][n(0x151)](d=>{const o=n,e=Object[o(0x13e)](d[o(0x14d)]);e[o(0x151)](f=>{const p=o;if(c[p(0x169)](f))throw new Error(p(0x173)+f);else c['add'](f);});}),this['activityIds']=Array[n(0x165)](c);}[k(0x14e)](c){const q=k;return typeof c===q(0x171)&&c['startsWith']('{')&&c['endsWith']('}');}[k(0x16b)](c,d,e){const r=k;for(const f in c){if(typeof c[f]===r(0x16c)&&c[f]!==null)this['extractMappingStatements'](c[f],d,e);else this[r(0x14e)](c[f])&&(!d[e]&&(d[e]=[]),d[e][r(0x163)](c[f]));}}['getMappingStatements'](){const s=k,c={};this[s(0x166)][s(0x141)]['graphs'][s(0x151)](d=>{const t=s,e=d[t(0x14d)];for(const f in e){const g=e[f];this[t(0x16b)](g,c,f);}}),this[s(0x170)]=c;}[k(0x142)](){const u=k,c=this[u(0x170)],d=this[u(0x16f)];for(const e in c){const f=c[e];f[u(0x151)](g=>{const v=u;if(g['startsWith']('{')&&g['endsWith']('}')){const h=g[v(0x157)](0x1,-0x1)[v(0x16a)]('.'),i=h[0x0];if(!(Validator[v(0x14c)][v(0x156)](i)||d['includes'](i)||this['isFunction'](g)||this[v(0x154)](g)))throw new Error(v(0x15f)+g);}});}}[k(0x174)](c){const w=k;return c[w(0x14b)]('{@')&&pipe_1[w(0x149)][w(0x13c)](c);}['isContextVariable'](c){const x=k;return[x(0x13f),'{$output}',x(0x16d),x(0x148),x(0x145)][x(0x156)](c);}['validateMappingStatements'](){}[k(0x161)](){}[k(0x15c)](){}[k(0x144)](){}['validateSchemas'](){}[k(0x147)](){}[k(0x146)](){}[k(0x15a)](){}[k(0x168)](){}}exports[k(0x13d)]=Validator,Validator[k(0x14c)]=[k(0x15b),'$self',k(0x16e),'$job'],Validator['CONTEXT_VARS']=[k(0x13f),k(0x14f),k(0x16d),k(0x148),k(0x145)];
|
|
@@ -40,6 +40,7 @@ class PostgresConnection extends __1.AbstractConnection {
|
|
|
40
40
|
host: options.host ?? 'unknown',
|
|
41
41
|
database: options.database ?? 'unknown',
|
|
42
42
|
port: options.port ?? 'unknown',
|
|
43
|
+
...error,
|
|
43
44
|
});
|
|
44
45
|
throw new Error(`postgres-provider-connection-failed: ${error.message}`);
|
|
45
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x8b9a3d,_0x12955b){const _0x6d68aa=_0x7f5c,_0xf3d39=_0x8b9a3d();while(!![]){try{const _0x5c713d=parseInt(_0x6d68aa(0x1e9))/0x1*(parseInt(_0x6d68aa(0x1e8))/0x2)+parseInt(_0x6d68aa(0x1e4))/0x3*(parseInt(_0x6d68aa(0x1e5))/0x4)+parseInt(_0x6d68aa(0x1ec))/0x5+parseInt(_0x6d68aa(0x1ed))/0x6+parseInt(_0x6d68aa(0x1e6))/0x7*(parseInt(_0x6d68aa(0x1ee))/0x8)+-parseInt(_0x6d68aa(0x1e7))/0x9*(-parseInt(_0x6d68aa(0x1ea))/0xa)+-parseInt(_0x6d68aa(0x1eb))/0xb;if(_0x5c713d===_0x12955b)break;else _0xf3d39['push'](_0xf3d39['shift']());}catch(_0x3500b9){_0xf3d39['push'](_0xf3d39['shift']());}}}(_0x19c1,0x7843c));var __importDefault=this&&this['__importDefault']||function(_0x164204){return _0x164204&&_0x164204['__esModule']?_0x164204:{'default':_0x164204};};function _0x19c1(){const _0x3621ae=['1771525ZzQclc','5067918rYObSj','49960nuKXQC','63GxmHWf','12364EZLpLm','763MLMZtK','691965GwYTLL','254VzvdJd','6953bqTlJq','40saHSSD','29067951WHmmdD'];_0x19c1=function(){return _0x3621ae;};return _0x19c1();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['EngineService']=void 0x0;const key_1=require('../../modules/key'),enums_1=require('../../modules/enums'),utils_1=require('../../modules/utils'),activities_1=__importDefault(require('../activities')),compiler_1=require('../compiler'),exporter_1=require('../exporter'),reporter_1=require('../reporter'),router_1=require('../router'),serializer_1=require('../serializer'),factory_1=require('../search/factory'),factory_2=require('../store/factory'),factory_3=require('../stream/factory'),factory_4=require('../sub/factory'),task_1=require('../task'),stream_1=require('../../types/stream');class EngineService{constructor(){this['cacheMode']='cache',this['untilVersion']=null,this['jobCallbacks']={},this['reporting']=![],this['jobId']=0x1;}static async['init'](_0x22273c,_0x395b48,_0xeed56b,_0x237687,_0xb4ac77){if(_0x237687['engine']){const _0x15661b=new EngineService();_0x15661b['verifyEngineFields'](_0x237687),_0x15661b['namespace']=_0x22273c,_0x15661b['appId']=_0x395b48,_0x15661b['guid']=_0xeed56b,_0x15661b['logger']=_0xb4ac77,await _0x15661b['initSearchChannel'](_0x237687['engine']['store']),await _0x15661b['initStoreChannel'](_0x237687['engine']['store']),await _0x15661b['initSubChannel'](_0x237687['engine']['sub'],_0x237687['engine']['pub']??_0x237687['engine']['store']),await _0x15661b['initStreamChannel'](_0x237687['engine']['stream'],_0x237687['engine']['store']),_0x15661b['router']=await _0x15661b['initRouter'](_0x237687);const _0x1b0d4e=_0x15661b['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x15661b['appId']});return _0x15661b['router']['consumeMessages'](_0x1b0d4e,'ENGINE',_0x15661b['guid'],_0x15661b['processStreamMessage']['bind'](_0x15661b)),_0x15661b['taskService']=new task_1['TaskService'](_0x15661b['store'],_0xb4ac77),_0x15661b['exporter']=new exporter_1['ExporterService'](_0x15661b['appId'],_0x15661b['store'],_0xb4ac77),_0x15661b['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x15661b;}}['verifyEngineFields'](_0x57a9a6){if(!(0x0,utils_1['identifyProvider'])(_0x57a9a6['engine']['store'])||!(0x0,utils_1['identifyProvider'])(_0x57a9a6['engine']['stream'])||!(0x0,utils_1['identifyProvider'])(_0x57a9a6['engine']['sub']))throw new Error('engine\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields.');}async['initSearchChannel'](_0x33622b,_0xf67d57){this['search']=await factory_1['SearchServiceFactory']['init'](_0x33622b,_0xf67d57,this['namespace'],this['appId'],this['logger']);}async['initStoreChannel'](_0x43e58c){this['store']=await factory_2['StoreServiceFactory']['init'](_0x43e58c,this['namespace'],this['appId'],this['logger']);}async['initSubChannel'](_0x199903,_0x3e5647){this['subscribe']=await factory_4['SubServiceFactory']['init'](_0x199903,_0x3e5647,this['namespace'],this['appId'],this['guid'],this['logger']);}async['initStreamChannel'](_0x2e1779,_0x47db7e){this['stream']=await factory_3['StreamServiceFactory']['init'](_0x2e1779,_0x47db7e,this['namespace'],this['appId'],this['logger']);}async['initRouter'](_0x358f5f){const _0x31e0d5=await this['store']['getThrottleRate'](':');return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['ENGINE'],'reclaimDelay':_0x358f5f['engine']['reclaimDelay'],'reclaimCount':_0x358f5f['engine']['reclaimCount'],'throttle':_0x31e0d5,'readonly':_0x358f5f['engine']['readonly']},this['stream'],this['logger']);}async['fetchAndVerifyVID'](_0x3b145a,_0x2934fc=0x0){if(isNaN(Number(_0x3b145a['version']))){const _0x5827c9=await this['store']['getApp'](_0x3b145a['id'],!![]);if(!isNaN(Number(_0x5827c9['version']))){if(!this['apps'])this['apps']={};return this['apps'][_0x3b145a['id']]=_0x5827c9,{'id':_0x3b145a['id'],'version':_0x5827c9['version']};}else{if(_0x2934fc<0xa)return await(0x0,utils_1['sleepFor'])(enums_1['HMSH_QUORUM_DELAY_MS']*0x2),await this['fetchAndVerifyVID'](_0x3b145a,_0x2934fc+0x1);else this['logger']['error']('engine-vid-resolution-error',{'id':_0x3b145a['id'],'guid':this['guid']});}}return _0x3b145a;}async['getVID'](_0x35d931){if(this['cacheMode']==='nocache'){const _0x57e105=await this['store']['getApp'](this['appId'],!![]);if(_0x57e105['version']['toString']()===this['untilVersion']['toString']()){if(!this['apps'])this['apps']={};this['apps'][this['appId']]=_0x57e105,this['setCacheMode']('cache',_0x57e105['version']['toString']());}return{'id':this['appId'],'version':_0x57e105['version']};}else return!this['apps']&&_0x35d931?(this['apps']={},this['apps'][this['appId']]=_0x35d931,_0x35d931):await this['fetchAndVerifyVID']({'id':this['appId'],'version':this['apps']?.[this['appId']]['version']});}['setCacheMode'](_0x12c96e,_0x4f16a6){this['logger']['info']('engine-executable-cache',{'mode':_0x12c96e,[_0x12c96e==='cache'?'target':'until']:_0x4f16a6}),this['cacheMode']=_0x12c96e,this['untilVersion']=_0x4f16a6;}async['routeToSubscribers'](_0x85c182,_0xcfc228){const _0x4b0892=this['jobCallbacks'][_0xcfc228['metadata']['jid']];_0x4b0892&&(this['delistJobCallback'](_0xcfc228['metadata']['jid']),_0x4b0892(_0x85c182,_0xcfc228));}async['processWebHooks'](){this['taskService']['processWebHooks'](this['hook']['bind'](this));}async['processTimeHooks'](){this['taskService']['processTimeHooks'](this['hookTime']['bind'](this));}async['throttle'](_0x17d0a3){try{this['router']?.['setThrottle'](_0x17d0a3);}catch(_0x4d73b1){this['logger']['error']('engine-throttle-error',{'error':_0x4d73b1});}}async['initActivity'](_0x500b94,_0x14960c={},_0x352183){const [_0x56809b,_0x26ff9e]=await this['getSchema'](_0x500b94),_0xafb780=activities_1['default'][utils_1['polyfill']['resolveActivityType'](_0x26ff9e['type'])];if(_0xafb780){const _0x4fb5da=(0x0,utils_1['formatISODate'])(new Date()),_0x1c9d38={'aid':_0x56809b,'atp':_0x26ff9e['type'],'stp':_0x26ff9e['subtype'],'ac':_0x4fb5da,'au':_0x4fb5da},_0x2442b2=null;return new _0xafb780(_0x26ff9e,_0x14960c,_0x1c9d38,_0x2442b2,this,_0x352183);}else throw new Error('activity\x20type\x20'+_0x26ff9e['type']+'\x20not\x20found');}async['getSchema'](_0x4a9cfc){const _0x3175d5=await this['store']['getApp'](this['appId']);if(!_0x3175d5)throw new Error('no\x20app\x20found\x20for\x20id\x20'+this['appId']);if(this['isPrivate'](_0x4a9cfc)){const _0x4d3f95=_0x4a9cfc['substring'](0x1),_0x4f6aa8=await this['store']['getSchema'](_0x4d3f95,await this['getVID'](_0x3175d5));return[_0x4d3f95,_0x4f6aa8];}else{const _0x1f9278=await this['store']['getSubscription'](_0x4a9cfc,await this['getVID'](_0x3175d5));if(_0x1f9278){const _0x579a51=await this['store']['getSchema'](_0x1f9278,await this['getVID'](_0x3175d5));return[_0x1f9278,_0x579a51];}}throw new Error('no\x20subscription\x20found\x20for\x20topic\x20'+_0x4a9cfc+'\x20in\x20app\x20'+this['appId']+'\x20for\x20app\x20version\x20'+_0x3175d5['version']);}async['getSettings'](){return await this['store']['getSettings']();}['isPrivate'](_0x3f2ffd){return _0x3f2ffd['startsWith']('.');}async['plan'](_0x34b43a){const _0x3053fe=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x3053fe['plan'](_0x34b43a);}async['deploy'](_0x2dfe78){const _0x2ddb83=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x2ddb83['deploy'](_0x2dfe78);}async['getStats'](_0x27f886,_0x24703f){const {id:_0x2b934f,version:_0x40aed7}=await this['getVID'](),_0x3d4a1e=new reporter_1['ReporterService']({'id':_0x2b934f,'version':_0x40aed7},this['store'],this['logger']),_0x45f1bd=await this['resolveQuery'](_0x27f886,_0x24703f);return await _0x3d4a1e['getStats'](_0x45f1bd);}async['getIds'](_0xdd925a,_0x54c70d,_0xd7a8ee=[]){const {id:_0x44a778,version:_0x8d667}=await this['getVID'](),_0x3ddc6a=new reporter_1['ReporterService']({'id':_0x44a778,'version':_0x8d667},this['store'],this['logger']),_0x34d8e4=await this['resolveQuery'](_0xdd925a,_0x54c70d);return await _0x3ddc6a['getIds'](_0x34d8e4,_0xd7a8ee);}async['resolveQuery'](_0x597934,_0x81f316){const _0x711e0c=await this['initActivity'](_0x597934,_0x81f316['data']);return await _0x711e0c['getState'](),{'end':_0x81f316['end'],'start':_0x81f316['start'],'range':_0x81f316['range'],'granularity':_0x711e0c['resolveGranularity'](),'key':_0x711e0c['resolveJobKey'](_0x711e0c['createInputContext']()),'sparse':_0x81f316['sparse']};}async['processStreamMessage'](_0x245500){this['logger']['debug']('engine-process',{'jid':_0x245500['metadata']['jid'],'gid':_0x245500['metadata']['gid'],'dad':_0x245500['metadata']['dad'],'aid':_0x245500['metadata']['aid'],'status':_0x245500['status']||stream_1['StreamStatus']['SUCCESS'],'code':_0x245500['code']||0xc8,'type':_0x245500['type']});const _0x176a77={'metadata':{'guid':_0x245500['metadata']['guid'],'jid':_0x245500['metadata']['jid'],'gid':_0x245500['metadata']['gid'],'dad':_0x245500['metadata']['dad'],'aid':_0x245500['metadata']['aid']},'data':_0x245500['data']};if(_0x245500['type']===stream_1['StreamDataType']['TIMEHOOK']){const _0x3525b6=await this['initActivity']('.'+_0x245500['metadata']['aid'],_0x176a77['data'],_0x176a77);await _0x3525b6['processTimeHookEvent'](_0x245500['metadata']['jid']);}else{if(_0x245500['type']===stream_1['StreamDataType']['WEBHOOK']){const _0x1f46e5=await this['initActivity']('.'+_0x245500['metadata']['aid'],_0x176a77['data'],_0x176a77);await _0x1f46e5['processWebHookEvent'](_0x245500['status'],_0x245500['code']);}else{if(_0x245500['type']===stream_1['StreamDataType']['TRANSITION']){const _0x43ecec=await this['initActivity']('.'+_0x245500['metadata']['aid'],_0x176a77['data'],_0x176a77);await _0x43ecec['process']();}else{if(_0x245500['type']===stream_1['StreamDataType']['AWAIT']){_0x176a77['metadata']={..._0x176a77['metadata'],'pj':_0x245500['metadata']['jid'],'pg':_0x245500['metadata']['gid'],'pd':_0x245500['metadata']['dad'],'pa':_0x245500['metadata']['aid'],'px':_0x245500['metadata']['await']===![],'trc':_0x245500['metadata']['trc'],'spn':_0x245500['metadata']['spn']};const _0x16f08f=await this['initActivity'](_0x245500['metadata']['topic'],_0x245500['data'],_0x176a77);await _0x16f08f['process']();}else{if(_0x245500['type']===stream_1['StreamDataType']['RESULT']){const _0x34ca8c=await this['initActivity']('.'+_0x176a77['metadata']['aid'],_0x245500['data'],_0x176a77);await _0x34ca8c['processEvent'](_0x245500['status'],_0x245500['code']);}else{const _0x13bca6=await this['initActivity']('.'+_0x245500['metadata']['aid'],_0x245500['data'],_0x176a77);await _0x13bca6['processEvent'](_0x245500['status'],_0x245500['code'],'output');}}}}}this['logger']['debug']('engine-process-end',{'jid':_0x245500['metadata']['jid'],'gid':_0x245500['metadata']['gid'],'aid':_0x245500['metadata']['aid']});}async['execAdjacentParent'](_0x24b6cb,_0x42f368,_0x353584=![]){if(this['hasParentJob'](_0x24b6cb)){const _0x7e1a7c=this['resolveError'](_0x42f368['metadata']),_0x31ac56=_0x24b6cb['$self']?.['output']?.['metadata']?.['l2s']||_0x24b6cb['$self']?.['output']?.['metadata']?.['l1s'],_0x376e3a={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x24b6cb['metadata']['pj'],'gid':_0x24b6cb['metadata']['pg'],'dad':_0x24b6cb['metadata']['pd'],'aid':_0x24b6cb['metadata']['pa'],'trc':_0x24b6cb['metadata']['trc'],'spn':_0x31ac56},'type':stream_1['StreamDataType']['RESULT'],'data':_0x42f368['data']};if(_0x7e1a7c&&_0x7e1a7c['code'])_0x376e3a['status']=stream_1['StreamStatus']['ERROR'],_0x376e3a['data']=_0x7e1a7c,_0x376e3a['code']=_0x7e1a7c['code'],_0x376e3a['stack']=_0x7e1a7c['stack'];else _0x353584?(_0x376e3a['status']=stream_1['StreamStatus']['PENDING'],_0x376e3a['code']=enums_1['HMSH_CODE_PENDING']):(_0x376e3a['status']=stream_1['StreamStatus']['SUCCESS'],_0x376e3a['code']=enums_1['HMSH_CODE_SUCCESS']);return await this['router']?.['publishMessage'](null,_0x376e3a);}}['hasParentJob'](_0x244289,_0x1ce488=![]){if(_0x1ce488)return Boolean(_0x244289['metadata']['pj']&&_0x244289['metadata']['pa']&&!_0x244289['metadata']['px']);return Boolean(_0x244289['metadata']['pj']&&_0x244289['metadata']['pa']);}['resolveError'](_0x496d9a){if(_0x496d9a&&_0x496d9a['err'])return JSON['parse'](_0x496d9a['err']);}async['interrupt'](_0xab6d7b,_0x682741,_0x4338cb={}){await this['store']['interrupt'](_0xab6d7b,_0x682741,_0x4338cb);const _0x32aeae=await this['getState'](_0xab6d7b,_0x682741),_0x3cfe9b={'interrupt':_0x4338cb['descend'],'expire':_0x4338cb['expire']};return await this['runJobCompletionTasks'](_0x32aeae,_0x3cfe9b);}async['scrub'](_0x11294c){await this['store']['scrub'](_0x11294c);}async['hook'](_0x58b5b2,_0x393a1b,_0x2f5726=stream_1['StreamStatus']['SUCCESS'],_0x54eb1b=0xc8){const _0x3b1395=await this['taskService']['getHookRule'](_0x58b5b2),[_0x100877]=await this['getSchema']('.'+_0x3b1395['to']),_0x5aa356={'type':stream_1['StreamDataType']['WEBHOOK'],'status':_0x2f5726,'code':_0x54eb1b,'metadata':{'guid':(0x0,utils_1['guid'])(),'aid':_0x100877,'topic':_0x58b5b2},'data':_0x393a1b};return await this['router']?.['publishMessage'](null,_0x5aa356);}async['hookTime'](_0x5d5bf,_0x20c14c,_0x1ef3d4,_0x5e98f8){if(_0x5e98f8==='interrupt'||_0x5e98f8==='expire')return await this['interrupt'](_0x1ef3d4,_0x5d5bf,{'suppress':!![],'expire':0x1});const [_0x3f03e5,..._0x13e8b8]=_0x1ef3d4['split'](','),_0x4e0214=','+_0x13e8b8['join'](','),_0x30191d={'type':stream_1['StreamDataType']['TIMEHOOK'],'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x5d5bf,'gid':_0x20c14c,'dad':_0x4e0214,'aid':_0x3f03e5},'data':{'timestamp':Date['now']()}};await this['router']?.['publishMessage'](null,_0x30191d);}async['hookAll'](_0x5d573e,_0x4aa5b2,_0x490998,_0x2c65c6=[]){const _0xb1bab6=await this['getVID'](),_0x584056=await this['taskService']['getHookRule'](_0x5d573e);if(_0x584056){const _0x2af7c2=await(0x0,utils_1['getSubscriptionTopic'])(_0x584056['to'],this['store'],_0xb1bab6),_0x4a388f=await this['resolveQuery'](_0x2af7c2,_0x490998),_0x50a8f1=new reporter_1['ReporterService'](_0xb1bab6,this['store'],this['logger']),_0x327070=await _0x50a8f1['getWorkItems'](_0x4a388f,_0x2c65c6);if(_0x327070['length']){const _0x54777d=new task_1['TaskService'](this['store'],this['logger']);await _0x54777d['enqueueWorkItems'](_0x327070['map'](_0x38766c=>[_0x5d573e,_0x38766c,_0x490998['scrub']||![],JSON['stringify'](_0x4aa5b2)]['join'](key_1['VALSEP']))),this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'work','originator':this['guid']},this['appId']);}return _0x327070;}else throw new Error('unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20'+_0x5d573e);}async['pub'](_0x216ffa,_0xa6e809,_0x3954b2,_0x9e0b63){const _0x32d5cd=await this['initActivity'](_0x216ffa,_0xa6e809,_0x3954b2);if(_0x32d5cd)return await _0x32d5cd['process'](_0x9e0b63);else throw new Error('unable\x20to\x20process\x20activity\x20for\x20topic\x20'+_0x216ffa);}async['sub'](_0x34bd61,_0xe36191){const _0x5c7103=async(_0xa1950d,_0x2c67f5)=>{_0xe36191(_0x2c67f5['topic'],_0x2c67f5['job']);};return await this['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x5c7103,this['appId'],_0x34bd61);}async['unsub'](_0x491a05){return await this['subscribe']['unsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x491a05);}async['psub'](_0x102eb9,_0x17b40f){const _0x51f620=async(_0x55cd68,_0x192d9b)=>{_0x17b40f(_0x192d9b['topic'],_0x192d9b['job']);};return await this['subscribe']['psubscribe'](key_1['KeyType']['QUORUM'],_0x51f620,this['appId'],_0x102eb9);}async['punsub'](_0x332fb4){return await this['subscribe']['punsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x332fb4);}async['pubsub'](_0x40e5b9,_0x4d16a2,_0x1c2352,_0x5d09ca=enums_1['HMSH_OTT_WAIT_TIME']){_0x1c2352={'metadata':{'ngn':this['guid'],'trc':_0x1c2352?.['metadata']?.['trc'],'spn':_0x1c2352?.['metadata']?.['spn']}};const _0x1f06b1=await this['pub'](_0x40e5b9,_0x4d16a2,_0x1c2352);return new Promise((_0x4ef182,_0x3599c5)=>{this['registerJobCallback'](_0x1f06b1,(_0x3f1289,_0x2bf7f0)=>{if(_0x2bf7f0['metadata']['err']){const _0x206e18=JSON['parse'](_0x2bf7f0['metadata']['err']);_0x3599c5({..._0x206e18,'job_id':_0x2bf7f0['metadata']['jid']});}else _0x4ef182(_0x2bf7f0);}),setTimeout(()=>{this['delistJobCallback'](_0x1f06b1),_0x3599c5({'code':enums_1['HMSH_CODE_TIMEOUT'],'message':'timeout','job_id':_0x1f06b1});},_0x5d09ca);});}async['pubOneTimeSubs'](_0x43d69e,_0x58e188,_0x4a235b=![]){if(this['hasOneTimeSubscription'](_0x43d69e)){const _0x2aeaf9={'type':'job','topic':_0x43d69e['metadata']['jid'],'job':(0x0,utils_1['restoreHierarchy'])(_0x58e188)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x2aeaf9,this['appId'],_0x43d69e['metadata']['ngn']);}}async['getPublishesTopic'](_0x5e9afe){const _0x32e951=await this['getVID'](),_0x2b3740=_0x5e9afe['metadata']['aid']||_0x5e9afe['$self']?.['output']?.['metadata']?.['aid'],_0x158a76=await this['store']['getSchema'](_0x2b3740,_0x32e951);return _0x158a76['publishes'];}async['pubPermSubs'](_0x49b63c,_0x46c8d2,_0x539644=![]){const _0x4d369e=await this['getPublishesTopic'](_0x49b63c);if(_0x4d369e){const _0x342f2c={'type':'job','topic':_0x4d369e,'job':(0x0,utils_1['restoreHierarchy'])(_0x46c8d2)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x342f2c,this['appId'],_0x4d369e+'.'+_0x49b63c['metadata']['jid']);}}async['add'](_0x319c45){return await this['router']?.['publishMessage'](null,_0x319c45);}['registerJobCallback'](_0x34faf6,_0x2c26e1){this['jobCallbacks'][_0x34faf6]=_0x2c26e1;}['delistJobCallback'](_0x2cb74d){delete this['jobCallbacks'][_0x2cb74d];}['hasOneTimeSubscription'](_0x51d56d){return Boolean(_0x51d56d['metadata']['ngn']);}async['runJobCompletionTasks'](_0x477b42,_0x9102b7={}){const _0x2a88ab=this['hasParentJob'](_0x477b42,!![]),_0x490e43=this['hasOneTimeSubscription'](_0x477b42),_0x305a52=await this['getPublishesTopic'](_0x477b42);let _0x4946f8;if(_0x2a88ab||_0x490e43||_0x305a52){const _0x3093c5=await this['getState'](_0x477b42['metadata']['tpc'],_0x477b42['metadata']['jid']);_0x4946f8=await this['execAdjacentParent'](_0x477b42,_0x3093c5,_0x9102b7['emit']),this['pubOneTimeSubs'](_0x477b42,_0x3093c5,_0x9102b7['emit']),this['pubPermSubs'](_0x477b42,_0x3093c5,_0x9102b7['emit']);}return!_0x9102b7['emit']&&this['taskService']['registerJobForCleanup'](_0x477b42['metadata']['jid'],this['resolveExpires'](_0x477b42,_0x9102b7),_0x9102b7),_0x4946f8;}['resolveExpires'](_0x855962,_0x4536d8){return _0x4536d8['expire']??_0x855962['metadata']['expire']??enums_1['HMSH_EXPIRE_JOB_SECONDS'];}async['export'](_0x45ee04){return await this['exporter']['export'](_0x45ee04);}async['getRaw'](_0x2443ab){return await this['store']['getRaw'](_0x2443ab);}async['getStatus'](_0x505687){const {id:_0x4640e3}=await this['getVID']();return await this['store']['getStatus'](_0x505687,_0x4640e3);}async['getState'](_0x2ee04a,_0x31b47a){const _0x41693a=await this['store']['getSymbols']('$'+_0x2ee04a),_0x4a9813={['$'+_0x2ee04a]:Object['keys'](_0x41693a)},_0x44647e={},_0x417a7d=await this['store']['getState'](_0x31b47a,_0x4a9813,_0x44647e);if(!_0x417a7d)throw new Error('not\x20found\x20'+_0x31b47a);const [_0x5157a9,_0x3f585f]=_0x417a7d,_0x576f59=(0x0,utils_1['restoreHierarchy'])(_0x5157a9);return _0x3f585f&&_0x576f59['metadata']&&(_0x576f59['metadata']['js']=_0x3f585f),_0x576f59;}async['getQueryState'](_0x3ab0c2,_0x27081e){return await this['store']['getQueryState'](_0x3ab0c2,_0x27081e);}async['compress'](_0x573f0d){const _0x3a0030=await this['store']['getSymbolValues'](),_0x23ebbb=Object['keys'](_0x3a0030)['length'],_0x1e8cd5=Math['pow'](0x34,0x2)-0x1,_0x32777e=serializer_1['SerializerService']['filterSymVals'](_0x23ebbb,_0x1e8cd5,_0x3a0030,new Set(_0x573f0d));return await this['store']['addSymbolValues'](_0x32777e);}}function _0x7f5c(_0x2e0719,_0x539aca){const _0x19c1cf=_0x19c1();return _0x7f5c=function(_0x7f5cc1,_0x22d82f){_0x7f5cc1=_0x7f5cc1-0x1e4;let _0x162411=_0x19c1cf[_0x7f5cc1];return _0x162411;},_0x7f5c(_0x2e0719,_0x539aca);}exports['EngineService']=EngineService;
|
|
1
|
+
'use strict';function b(c,d){const e=a();return b=function(f,g){f=f-0x11a;let h=e[f];return h;},b(c,d);}const p=b;function a(){const an=['engine-throttle-error','../../modules/enums','HMSH_CODE_TIMEOUT','ENGINE','interrupt','10PrCOoe','2025567HrpZis','engine-process-end','pubPermSubs','\x20for\x20app\x20version\x20','HMSH_CODE_SUCCESS','error','filterSymVals','default','getQueryState','getSubscription','getSettings','expire','../compiler','SerializerService','initSearchChannel','info','code','psub','unsubscribe','../task','output','polyfill','cache','addSymbolValues','routeToSubscribers','processTimeHookEvent','pub','job','registerJobForCleanup','tpc','ERROR','resolveExpires','HMSH_EXPIRE_JOB_SECONDS','topic','taskService','1092047FdbOyQ','../activities','RESULT','toString','engine-executable-cache','HMSH_CODE_PENDING','../../modules/key','activity\x20type\x20','processWebHookEvent','type','jobId','getSymbols','pow','KeyType','identifyProvider','defineProperty','initStoreChannel','punsubscribe','aid','keys','../serializer','getWorkItems','subtype','descend','../store/factory','scrub','execAdjacentParent','pubsub','6GrTGFT','unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20','metadata','processStreamMessage','appId','fetchAndVerifyVID','../router','sparse','HMSH_QUORUM_DELAY_MS','resolveQuery','getRaw','start','25200dHTKcE','hook','publishMessage','\x20not\x20found','target','WEBHOOK','1704988bAfGem','router','data','l2s','search','StreamRole','resolveGranularity','registerJobCallback','640LFulZb','engine-vid-resolution-error','setCacheMode','initActivity','readonly','$self','engine\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields.','engine','../search/factory','processWebHooks','map','inited','jobCallbacks','debug','bind','isPrivate','SearchServiceFactory','now','err','getVID','psubscribe','hasOneTimeSubscription','getApp','logger','ExporterService','initRouter','hookAll','guid','l1s','process','ReporterService','export','../reporter','init','unsub','no\x20subscription\x20found\x20for\x20topic\x20','publish','dad','SubServiceFactory','emit','SUCCESS','cacheMode','reclaimDelay','store','getPublishesTopic','__importDefault','namespace','length','../../types/stream','version','spn','formatISODate','CompilerService','sub','join','__esModule','StreamStatus','gid','getHookRule','verifyEngineFields','StreamServiceFactory','getThrottleRate','nocache','10332146QqlJbk','56gyOyBW','jid','getStatus','initStreamChannel','TIMEHOOK','reporting','getStats','resolveError','ngn','TRANSITION','VALSEP','421548fjJWvA','QUORUM','await','untilVersion','processEvent','subscribe','exporter','47800GodbIO','startsWith','range','StoreServiceFactory','unable\x20to\x20process\x20activity\x20for\x20topic\x20','HMSH_OTT_WAIT_TIME','createInputContext','hasParentJob','pubOneTimeSubs','apps','hookTime','StreamDataType','1144kJPBNL','parse','processTimeHooks','EngineService','deploy','getState','TaskService','split','getSchema','sleepFor','PENDING','setThrottle','trc','1638UMnQcK','plan','restoreHierarchy','status','\x20in\x20app\x20','resolveActivityType','throttle','until','consumeMessages','stream'];a=function(){return an;};return a();}(function(c,d){const o=b,e=c();while(!![]){try{const f=parseInt(o(0x153))/0x1+-parseInt(o(0x181))/0x2*(-parseInt(o(0x16f))/0x3)+-parseInt(o(0x189))/0x4*(-parseInt(o(0x1db))/0x5)+parseInt(o(0x17b))/0x6*(-parseInt(o(0x120))/0x7)+parseInt(o(0x1c9))/0x8*(parseInt(o(0x130))/0x9)+parseInt(o(0x12f))/0xa*(-parseInt(o(0x1c8))/0xb)+parseInt(o(0x1d4))/0xc*(-parseInt(o(0x1e7))/0xd);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xd8f3e));var __importDefault=this&&this[p(0x1b6)]||function(c){const q=p;return c&&c[q(0x1c0)]?c:{'default':c};};Object[p(0x162)](exports,'__esModule',{'value':!![]}),exports[p(0x1ea)]=void 0x0;const key_1=require(p(0x159)),enums_1=require(p(0x12b)),utils_1=require('../../modules/utils'),activities_1=__importDefault(require(p(0x154))),compiler_1=require(p(0x13c)),exporter_1=require('../exporter'),reporter_1=require(p(0x1a9)),router_1=require(p(0x175)),serializer_1=require(p(0x167)),factory_1=require(p(0x191)),factory_2=require(p(0x16b)),factory_3=require('../stream/factory'),factory_4=require('../sub/factory'),task_1=require(p(0x143)),stream_1=require(p(0x1b9));class EngineService{constructor(){const r=p;this['cacheMode']=r(0x146),this[r(0x1d7)]=null,this[r(0x195)]={},this[r(0x1ce)]=![],this[r(0x15d)]=0x1;}static async['init'](c,d,e,f,g){const s=p;if(f['engine']){const h=new EngineService();h[s(0x1c4)](f),h[s(0x1b7)]=c,h['appId']=d,h[s(0x1a4)]=e,h['logger']=g,await h[s(0x13e)](f[s(0x190)][s(0x1b4)]),await h['initStoreChannel'](f[s(0x190)][s(0x1b4)]),await h['initSubChannel'](f['engine'][s(0x1be)],f[s(0x190)]['pub']??f[s(0x190)][s(0x1b4)]),await h[s(0x1cc)](f[s(0x190)]['stream'],f[s(0x190)][s(0x1b4)]),h[s(0x182)]=await h[s(0x1a2)](f);const i=h[s(0x1b4)]['mintKey'](key_1['KeyType']['STREAMS'],{'appId':h['appId']});return h['router'][s(0x128)](i,s(0x12d),h['guid'],h[s(0x172)][s(0x197)](h)),h['taskService']=new task_1['TaskService'](h['store'],g),h[s(0x1da)]=new exporter_1[(s(0x1a1))](h['appId'],h[s(0x1b4)],g),h[s(0x194)]=(0x0,utils_1[s(0x1bc)])(new Date()),h;}}[p(0x1c4)](c){const t=p;if(!(0x0,utils_1[t(0x161)])(c[t(0x190)][t(0x1b4)])||!(0x0,utils_1['identifyProvider'])(c['engine'][t(0x129)])||!(0x0,utils_1[t(0x161)])(c[t(0x190)][t(0x1be)]))throw new Error(t(0x18f));}async[p(0x13e)](c,d){const u=p;this[u(0x185)]=await factory_1[u(0x199)][u(0x1aa)](c,d,this[u(0x1b7)],this[u(0x173)],this[u(0x1a0)]);}async[p(0x163)](c){const v=p;this['store']=await factory_2[v(0x1de)][v(0x1aa)](c,this[v(0x1b7)],this[v(0x173)],this[v(0x1a0)]);}async['initSubChannel'](c,d){const w=p;this[w(0x1d9)]=await factory_4[w(0x1af)][w(0x1aa)](c,d,this['namespace'],this[w(0x173)],this[w(0x1a4)],this[w(0x1a0)]);}async[p(0x1cc)](c,d){const x=p;this[x(0x129)]=await factory_3[x(0x1c5)][x(0x1aa)](c,d,this[x(0x1b7)],this[x(0x173)],this['logger']);}async['initRouter'](c){const y=p,d=await this[y(0x1b4)][y(0x1c6)](':');return new router_1['Router']({'namespace':this[y(0x1b7)],'appId':this[y(0x173)],'guid':this[y(0x1a4)],'role':stream_1[y(0x186)][y(0x12d)],'reclaimDelay':c[y(0x190)][y(0x1b3)],'reclaimCount':c[y(0x190)]['reclaimCount'],'throttle':d,'readonly':c[y(0x190)][y(0x18d)]},this['stream'],this[y(0x1a0)]);}async[p(0x174)](c,d=0x0){const z=p;if(isNaN(Number(c[z(0x1ba)]))){const e=await this[z(0x1b4)][z(0x19f)](c['id'],!![]);if(!isNaN(Number(e[z(0x1ba)]))){if(!this[z(0x1e4)])this[z(0x1e4)]={};return this[z(0x1e4)][c['id']]=e,{'id':c['id'],'version':e[z(0x1ba)]};}else{if(d<0xa)return await(0x0,utils_1[z(0x11c)])(enums_1[z(0x177)]*0x2),await this[z(0x174)](c,d+0x1);else this[z(0x1a0)][z(0x135)](z(0x18a),{'id':c['id'],'guid':this[z(0x1a4)]});}}return c;}async[p(0x19c)](c){const A=p;if(this[A(0x1b2)]===A(0x1c7)){const d=await this[A(0x1b4)][A(0x19f)](this['appId'],!![]);if(d[A(0x1ba)][A(0x156)]()===this['untilVersion'][A(0x156)]()){if(!this[A(0x1e4)])this['apps']={};this['apps'][this[A(0x173)]]=d,this['setCacheMode']('cache',d[A(0x1ba)][A(0x156)]());}return{'id':this[A(0x173)],'version':d[A(0x1ba)]};}else return!this['apps']&&c?(this[A(0x1e4)]={},this[A(0x1e4)][this[A(0x173)]]=c,c):await this[A(0x174)]({'id':this[A(0x173)],'version':this[A(0x1e4)]?.[this['appId']][A(0x1ba)]});}[p(0x18b)](c,d){const B=p;this[B(0x1a0)][B(0x13f)](B(0x157),{'mode':c,[c===B(0x146)?B(0x17f):B(0x127)]:d}),this[B(0x1b2)]=c,this[B(0x1d7)]=d;}async[p(0x148)](c,d){const C=p,e=this[C(0x195)][d[C(0x171)][C(0x1ca)]];e&&(this['delistJobCallback'](d['metadata'][C(0x1ca)]),e(c,d));}async['processWebHooks'](){const D=p;this['taskService'][D(0x192)](this[D(0x17c)]['bind'](this));}async[p(0x1e9)](){const E=p;this[E(0x152)]['processTimeHooks'](this[E(0x1e5)]['bind'](this));}async[p(0x126)](c){const F=p;try{this[F(0x182)]?.[F(0x11e)](c);}catch(d){this['logger'][F(0x135)](F(0x12a),{'error':d});}}async[p(0x18c)](c,d={},e){const G=p,[f,g]=await this[G(0x11b)](c),h=activities_1[G(0x137)][utils_1[G(0x145)][G(0x125)](g[G(0x15c)])];if(h){const i=(0x0,utils_1[G(0x1bc)])(new Date()),j={'aid':f,'atp':g[G(0x15c)],'stp':g[G(0x169)],'ac':i,'au':i},k=null;return new h(g,d,j,k,this,e);}else throw new Error(G(0x15a)+g[G(0x15c)]+G(0x17e));}async[p(0x11b)](c){const H=p,d=await this[H(0x1b4)][H(0x19f)](this[H(0x173)]);if(!d)throw new Error('no\x20app\x20found\x20for\x20id\x20'+this[H(0x173)]);if(this[H(0x198)](c)){const e=c['substring'](0x1),f=await this[H(0x1b4)][H(0x11b)](e,await this['getVID'](d));return[e,f];}else{const g=await this[H(0x1b4)][H(0x139)](c,await this[H(0x19c)](d));if(g){const h=await this['store'][H(0x11b)](g,await this[H(0x19c)](d));return[g,h];}}throw new Error(H(0x1ac)+c+H(0x124)+this[H(0x173)]+H(0x133)+d[H(0x1ba)]);}async[p(0x13a)](){const I=p;return await this[I(0x1b4)][I(0x13a)]();}[p(0x198)](c){const J=p;return c[J(0x1dc)]('.');}async['plan'](c){const K=p,d=new compiler_1[(K(0x1bd))](this[K(0x1b4)],this['stream'],this[K(0x1a0)]);return await d[K(0x121)](c);}async[p(0x1eb)](c){const L=p,d=new compiler_1[(L(0x1bd))](this[L(0x1b4)],this[L(0x129)],this['logger']);return await d[L(0x1eb)](c);}async[p(0x1cf)](c,d){const M=p,{id:e,version:f}=await this['getVID'](),g=new reporter_1[(M(0x1a7))]({'id':e,'version':f},this[M(0x1b4)],this[M(0x1a0)]),h=await this[M(0x178)](c,d);return await g[M(0x1cf)](h);}async['getIds'](c,d,e=[]){const N=p,{id:f,version:g}=await this[N(0x19c)](),h=new reporter_1[(N(0x1a7))]({'id':f,'version':g},this[N(0x1b4)],this[N(0x1a0)]),i=await this['resolveQuery'](c,d);return await h['getIds'](i,e);}async[p(0x178)](c,d){const O=p,e=await this[O(0x18c)](c,d[O(0x183)]);return await e['getState'](),{'end':d['end'],'start':d[O(0x17a)],'range':d[O(0x1dd)],'granularity':e[O(0x187)](),'key':e['resolveJobKey'](e[O(0x1e1)]()),'sparse':d[O(0x176)]};}async[p(0x172)](c){const P=p;this[P(0x1a0)][P(0x196)]('engine-process',{'jid':c['metadata'][P(0x1ca)],'gid':c[P(0x171)][P(0x1c2)],'dad':c[P(0x171)][P(0x1ae)],'aid':c['metadata'][P(0x165)],'status':c[P(0x123)]||stream_1[P(0x1c1)]['SUCCESS'],'code':c['code']||0xc8,'type':c[P(0x15c)]});const d={'metadata':{'guid':c[P(0x171)][P(0x1a4)],'jid':c['metadata'][P(0x1ca)],'gid':c[P(0x171)][P(0x1c2)],'dad':c['metadata'][P(0x1ae)],'aid':c['metadata']['aid']},'data':c[P(0x183)]};if(c['type']===stream_1[P(0x1e6)][P(0x1cd)]){const e=await this['initActivity']('.'+c['metadata'][P(0x165)],d[P(0x183)],d);await e[P(0x149)](c[P(0x171)]['jid']);}else{if(c[P(0x15c)]===stream_1[P(0x1e6)][P(0x180)]){const f=await this[P(0x18c)]('.'+c['metadata'][P(0x165)],d['data'],d);await f[P(0x15b)](c[P(0x123)],c[P(0x140)]);}else{if(c[P(0x15c)]===stream_1[P(0x1e6)][P(0x1d2)]){const g=await this['initActivity']('.'+c[P(0x171)][P(0x165)],d['data'],d);await g[P(0x1a6)]();}else{if(c['type']===stream_1['StreamDataType']['AWAIT']){d[P(0x171)]={...d[P(0x171)],'pj':c[P(0x171)][P(0x1ca)],'pg':c[P(0x171)][P(0x1c2)],'pd':c[P(0x171)]['dad'],'pa':c['metadata']['aid'],'px':c[P(0x171)][P(0x1d6)]===![],'trc':c[P(0x171)]['trc'],'spn':c[P(0x171)][P(0x1bb)]};const h=await this['initActivity'](c[P(0x171)][P(0x151)],c[P(0x183)],d);await h['process']();}else{if(c[P(0x15c)]===stream_1['StreamDataType'][P(0x155)]){const i=await this[P(0x18c)]('.'+d[P(0x171)][P(0x165)],c[P(0x183)],d);await i[P(0x1d8)](c[P(0x123)],c[P(0x140)]);}else{const j=await this[P(0x18c)]('.'+c[P(0x171)][P(0x165)],c[P(0x183)],d);await j[P(0x1d8)](c[P(0x123)],c[P(0x140)],P(0x144));}}}}}this['logger'][P(0x196)](P(0x131),{'jid':c[P(0x171)][P(0x1ca)],'gid':c[P(0x171)][P(0x1c2)],'aid':c[P(0x171)]['aid']});}async[p(0x16d)](c,d,e=![]){const Q=p;if(this[Q(0x1e2)](c)){const f=this[Q(0x1d0)](d['metadata']),g=c['$self']?.[Q(0x144)]?.[Q(0x171)]?.[Q(0x184)]||c[Q(0x18e)]?.[Q(0x144)]?.[Q(0x171)]?.[Q(0x1a5)],h={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':c[Q(0x171)]['pj'],'gid':c[Q(0x171)]['pg'],'dad':c[Q(0x171)]['pd'],'aid':c[Q(0x171)]['pa'],'trc':c['metadata'][Q(0x11f)],'spn':g},'type':stream_1[Q(0x1e6)][Q(0x155)],'data':d[Q(0x183)]};if(f&&f[Q(0x140)])h['status']=stream_1[Q(0x1c1)][Q(0x14e)],h[Q(0x183)]=f,h['code']=f[Q(0x140)],h['stack']=f['stack'];else e?(h[Q(0x123)]=stream_1[Q(0x1c1)][Q(0x11d)],h[Q(0x140)]=enums_1[Q(0x158)]):(h[Q(0x123)]=stream_1['StreamStatus']['SUCCESS'],h[Q(0x140)]=enums_1[Q(0x134)]);return await this[Q(0x182)]?.[Q(0x17d)](null,h);}}[p(0x1e2)](c,d=![]){const R=p;if(d)return Boolean(c[R(0x171)]['pj']&&c[R(0x171)]['pa']&&!c[R(0x171)]['px']);return Boolean(c[R(0x171)]['pj']&&c[R(0x171)]['pa']);}[p(0x1d0)](c){const S=p;if(c&&c[S(0x19b)])return JSON[S(0x1e8)](c[S(0x19b)]);}async[p(0x12e)](c,d,e={}){const T=p;await this[T(0x1b4)]['interrupt'](c,d,e);const f=await this['getState'](c,d),g={'interrupt':e[T(0x16a)],'expire':e[T(0x13b)]};return await this['runJobCompletionTasks'](f,g);}async['scrub'](c){const U=p;await this[U(0x1b4)]['scrub'](c);}async[p(0x17c)](c,d,e=stream_1['StreamStatus'][p(0x1b1)],f=0xc8){const V=p,g=await this[V(0x152)]['getHookRule'](c),[h]=await this['getSchema']('.'+g['to']),i={'type':stream_1['StreamDataType'][V(0x180)],'status':e,'code':f,'metadata':{'guid':(0x0,utils_1[V(0x1a4)])(),'aid':h,'topic':c},'data':d};return await this[V(0x182)]?.['publishMessage'](null,i);}async['hookTime'](c,d,e,f){const W=p;if(f===W(0x12e)||f===W(0x13b))return await this[W(0x12e)](e,c,{'suppress':!![],'expire':0x1});const [g,...h]=e[W(0x11a)](','),i=','+h['join'](','),j={'type':stream_1[W(0x1e6)][W(0x1cd)],'metadata':{'guid':(0x0,utils_1[W(0x1a4)])(),'jid':c,'gid':d,'dad':i,'aid':g},'data':{'timestamp':Date[W(0x19a)]()}};await this[W(0x182)]?.[W(0x17d)](null,j);}async[p(0x1a3)](c,d,e,f=[]){const X=p,g=await this['getVID'](),h=await this[X(0x152)][X(0x1c3)](c);if(h){const i=await(0x0,utils_1['getSubscriptionTopic'])(h['to'],this['store'],g),j=await this['resolveQuery'](i,e),k=new reporter_1[(X(0x1a7))](g,this[X(0x1b4)],this[X(0x1a0)]),l=await k[X(0x168)](j,f);if(l[X(0x1b8)]){const m=new task_1[(X(0x1ed))](this[X(0x1b4)],this['logger']);await m['enqueueWorkItems'](l[X(0x193)](n=>[c,n,e[X(0x16c)]||![],JSON['stringify'](d)][X(0x1bf)](key_1[X(0x1d3)]))),this[X(0x1d9)]['publish'](key_1[X(0x160)][X(0x1d5)],{'type':'work','originator':this[X(0x1a4)]},this[X(0x173)]);}return l;}else throw new Error(X(0x170)+c);}async[p(0x14a)](c,d,e,f){const Y=p,g=await this[Y(0x18c)](c,d,e);if(g)return await g[Y(0x1a6)](f);else throw new Error(Y(0x1df)+c);}async[p(0x1be)](c,d){const a0=p,e=async(f,g)=>{const Z=b;d(g[Z(0x151)],g[Z(0x14b)]);};return await this['subscribe']['subscribe'](key_1[a0(0x160)]['QUORUM'],e,this['appId'],c);}async[p(0x1ab)](c){const a1=p;return await this[a1(0x1d9)][a1(0x142)](key_1[a1(0x160)][a1(0x1d5)],this[a1(0x173)],c);}async[p(0x141)](c,d){const a3=p,e=async(f,g)=>{const a2=b;d(g[a2(0x151)],g[a2(0x14b)]);};return await this[a3(0x1d9)][a3(0x19d)](key_1[a3(0x160)]['QUORUM'],e,this['appId'],c);}async['punsub'](c){const a4=p;return await this[a4(0x1d9)][a4(0x164)](key_1['KeyType'][a4(0x1d5)],this[a4(0x173)],c);}async[p(0x16e)](c,d,e,f=enums_1[p(0x1e0)]){const a5=p;e={'metadata':{'ngn':this[a5(0x1a4)],'trc':e?.[a5(0x171)]?.[a5(0x11f)],'spn':e?.[a5(0x171)]?.[a5(0x1bb)]}};const g=await this[a5(0x14a)](c,d,e);return new Promise((h,i)=>{const a6=a5;this[a6(0x188)](g,(j,k)=>{const a7=a6;if(k[a7(0x171)]['err']){const l=JSON['parse'](k[a7(0x171)][a7(0x19b)]);i({...l,'job_id':k[a7(0x171)][a7(0x1ca)]});}else h(k);}),setTimeout(()=>{const a8=a6;this['delistJobCallback'](g),i({'code':enums_1[a8(0x12c)],'message':'timeout','job_id':g});},f);});}async[p(0x1e3)](c,d,e=![]){const a9=p;if(this[a9(0x19e)](c)){const f={'type':'job','topic':c[a9(0x171)][a9(0x1ca)],'job':(0x0,utils_1[a9(0x122)])(d)};this[a9(0x1d9)][a9(0x1ad)](key_1[a9(0x160)]['QUORUM'],f,this[a9(0x173)],c[a9(0x171)][a9(0x1d1)]);}}async[p(0x1b5)](c){const aa=p,d=await this[aa(0x19c)](),e=c[aa(0x171)][aa(0x165)]||c[aa(0x18e)]?.[aa(0x144)]?.[aa(0x171)]?.['aid'],f=await this['store'][aa(0x11b)](e,d);return f['publishes'];}async[p(0x132)](c,d,e=![]){const ab=p,f=await this[ab(0x1b5)](c);if(f){const g={'type':ab(0x14b),'topic':f,'job':(0x0,utils_1[ab(0x122)])(d)};this[ab(0x1d9)][ab(0x1ad)](key_1[ab(0x160)][ab(0x1d5)],g,this[ab(0x173)],f+'.'+c[ab(0x171)][ab(0x1ca)]);}}async['add'](c){const ac=p;return await this[ac(0x182)]?.['publishMessage'](null,c);}[p(0x188)](c,d){const ad=p;this[ad(0x195)][c]=d;}['delistJobCallback'](c){delete this['jobCallbacks'][c];}[p(0x19e)](c){const ae=p;return Boolean(c[ae(0x171)][ae(0x1d1)]);}async['runJobCompletionTasks'](c,d={}){const af=p,e=this[af(0x1e2)](c,!![]),f=this['hasOneTimeSubscription'](c),g=await this[af(0x1b5)](c);let h;if(e||f||g){const i=await this['getState'](c[af(0x171)][af(0x14d)],c[af(0x171)]['jid']);h=await this[af(0x16d)](c,i,d['emit']),this[af(0x1e3)](c,i,d['emit']),this['pubPermSubs'](c,i,d[af(0x1b0)]);}return!d[af(0x1b0)]&&this['taskService'][af(0x14c)](c['metadata'][af(0x1ca)],this[af(0x14f)](c,d),d),h;}[p(0x14f)](c,d){const ag=p;return d['expire']??c[ag(0x171)][ag(0x13b)]??enums_1[ag(0x150)];}async[p(0x1a8)](c){const ah=p;return await this['exporter'][ah(0x1a8)](c);}async[p(0x179)](c){const ai=p;return await this['store'][ai(0x179)](c);}async[p(0x1cb)](c){const aj=p,{id:d}=await this[aj(0x19c)]();return await this[aj(0x1b4)][aj(0x1cb)](c,d);}async['getState'](c,d){const ak=p,e=await this[ak(0x1b4)][ak(0x15e)]('$'+c),f={['$'+c]:Object['keys'](e)},g={},h=await this[ak(0x1b4)][ak(0x1ec)](d,f,g);if(!h)throw new Error('not\x20found\x20'+d);const [i,j]=h,k=(0x0,utils_1['restoreHierarchy'])(i);return j&&k[ak(0x171)]&&(k['metadata']['js']=j),k;}async['getQueryState'](c,d){const al=p;return await this[al(0x1b4)][al(0x138)](c,d);}async['compress'](c){const am=p,d=await this[am(0x1b4)]['getSymbolValues'](),e=Object[am(0x166)](d)[am(0x1b8)],f=Math[am(0x15f)](0x34,0x2)-0x1,g=serializer_1[am(0x13d)][am(0x136)](e,f,d,new Set(c));return await this[am(0x1b4)][am(0x147)](g);}}exports['EngineService']=EngineService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function a(){const G=['1142220MSIpna','other','172YYAbAb','inflate','export','entries','34jDMFkP','1901960NbiErT','6222DaMRql','match','defineProperty','160808ojmNFQ','replace','35qKTDFS','__esModule','hook','2650842EUQukk','807273cZMEoD','getAllSymbols','logger','fromString','length','../../modules/utils','inflateKey','inflateDependencyData','getRaw','forEach','SerializerService','store','ExporterService','VALSEP','split','symbols','1548AzwDzc','join'];a=function(){return G;};return a();}const z=b;(function(c,d){const y=b,e=c();while(!![]){try{const f=-parseInt(y(0x154))/0x1*(parseInt(y(0x156))/0x2)+-parseInt(y(0x14c))/0x3*(parseInt(y(0x150))/0x4)+-parseInt(y(0x14e))/0x5+parseInt(y(0x15e))/0x6+parseInt(y(0x15b))/0x7*(-parseInt(y(0x159))/0x8)+parseInt(y(0x15f))/0x9+parseInt(y(0x155))/0xa;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x40a55));Object[z(0x158)](exports,z(0x15c),{'value':!![]}),exports[z(0x148)]=void 0x0;const key_1=require('../../modules/key'),utils_1=require(z(0x141)),serializer_1=require('../serializer');function b(c,d){const e=a();return b=function(f,g){f=f-0x140;let h=e[f];return h;},b(c,d);}class ExporterService{constructor(c,d,e){const A=z;this['appId']=c,this[A(0x161)]=e,this[A(0x147)]=d;}async[z(0x152)](c,d={}){const B=z;!this['symbols']&&(this[B(0x14b)]=this[B(0x147)][B(0x160)](),this[B(0x14b)]=await this[B(0x14b)]);const e=[],f=await this['store'][B(0x144)](c),g=this['inflate'](f,e);return g;}['inflateKey'](c){const C=z;return c in this[C(0x14b)]?this['symbols'][c]:c;}[z(0x151)](c,d){const D=z,e={'hooks':{},'main':{'cursor':-0x1,'items':[]}},f={},g=this[D(0x143)](d,e),h=/^([a-zA-Z]{3}),(\d+(?:,\d+)*)/;return Object[D(0x153)](c)[D(0x145)](([i,j])=>{const E=D,k=i['match'](h);if(k){const [l,m,n]=k,o=this[E(0x142)](m),p=''+n[E(0x15a)](/,/g,'/'),q=serializer_1[E(0x146)][E(0x162)](j);f[p+'/'+o]=q;}else i[E(0x140)]===0x3&&(f[this[E(0x142)](i)]=serializer_1[E(0x146)]['fromString'](j));}),{'dependencies':g,'process':(0x0,utils_1['restoreHierarchy'])(f),'status':c[':']};}[z(0x143)](c,d){const e=/([0-9,]+)-(\d+)$/,f=/-(\d+)$/;return c['map']((g,h)=>{const F=b,[i,j,k,l,...m]=g[F(0x14a)](key_1[F(0x149)]),n=m[F(0x14d)](key_1[F(0x149)]),o=n[F(0x157)](e);let p,q,r='';if(o){const [s,t,u]=o;r=t[F(0x14a)](',')[F(0x14d)]('/'),p=r+'['+u+']',q=F(0x15d);}else{const v=n['match'](f);if(v){const [w,x]=v;p='['+x+']',q='flow';}else p='/',q=F(0x14f);}return{'type':i,'topic':j,'gid':k,'jid':n};});}}exports['ExporterService']=ExporterService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function b(c,d){const e=a();return b=function(f,g){f=f-0x76;let h=e[f];return h;},b(c,d);}const m=b;(function(c,d){const l=b,e=c();while(!![]){try{const f=-parseInt(l(0x88))/0x1*(parseInt(l(0x9b))/0x2)+parseInt(l(0x80))/0x3*(parseInt(l(0x99))/0x4)+parseInt(l(0x85))/0x5*(parseInt(l(0x92))/0x6)+-parseInt(l(0x7f))/0x7*(-parseInt(l(0x7d))/0x8)+-parseInt(l(0x8d))/0x9*(-parseInt(l(0x8a))/0xa)+parseInt(l(0x8b))/0xb*(parseInt(l(0x7b))/0xc)+parseInt(l(0x7c))/0xd*(-parseInt(l(0x94))/0xe);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xca06c));function a(){const u=['resolve','rules','forEach','15syFzfS','includes','process','1434159DMCcLx','data','20SMZBRW','693gwfmsV','call','3494871FhXKtt','gate','defineProperty','../pipe','pipe','457602hakZYA','boolean','714wQhHTx','toString','code','match','Pipe','1698268sxOJuJ','evaluate','2jSrttQ','object','__esModule','traverseRules','@pipe','prototype','MapperService','44316xhVkjH','189501eDuhsu','10739368Zsrqfc','isArray','7TTeYNO','3IDXhsn','mapRules'];a=function(){return u;};return a();}Object[m(0x8f)](exports,m(0x76),{'value':!![]}),exports[m(0x7a)]=void 0x0;const pipe_1=require(m(0x90));class MapperService{constructor(c,d){const n=m;this[n(0x83)]=c,this[n(0x89)]=d;}[m(0x81)](){const o=m;return this[o(0x77)](this[o(0x83)]);}[m(0x77)](c){const p=m;if(typeof c===p(0x9c)&&p(0x78)in c)return this[p(0x91)](c['@pipe']);if(typeof c==='object'&&c!==null){const d={};for(const e in c){Object[p(0x79)]['hasOwnProperty'][p(0x8c)](c,e)&&(d[e]=this['traverseRules'](c[e]));}return d;}else return this[p(0x82)](c);}[m(0x91)](c){const q=m,d=new pipe_1[(q(0x98))](c,this[q(0x89)]);return d[q(0x87)]();}[m(0x82)](c){const r=m,d=new pipe_1[(r(0x98))]([[c]],this['data']);return d[r(0x87)]();}static[m(0x9a)](c,d,e){const s=m;if(typeof c===s(0x93))return c;if(Array[s(0x7e)](c['code'])&&c[s(0x96)][s(0x86)](e||0xc8)||e[s(0x95)]()===(c['code']||0xc8)[s(0x95)]()){if(!c[s(0x97)])return!![];const f=c[s(0x8e)]==='or';let g=!![],h=![];return c[s(0x97)][s(0x84)](({expected:i,actual:j})=>{const t=s;if(f&&!h||!f&&g){const k=pipe_1[t(0x98)]['resolve'](j,d)===i;if(f&&k)h=!![];else!f&&!k&&(g=![]);}}),f?h:g;}return![];}}exports[m(0x7a)]=MapperService;
|
|
@@ -43,7 +43,9 @@ class MeshCall {
|
|
|
43
43
|
await hotMesh.activate(version);
|
|
44
44
|
}
|
|
45
45
|
catch (error) {
|
|
46
|
-
hotMesh.engine.logger.error('meshcall-client-activate-err', {
|
|
46
|
+
hotMesh.engine.logger.error('meshcall-client-activate-err', {
|
|
47
|
+
...error,
|
|
48
|
+
});
|
|
47
49
|
throw error;
|
|
48
50
|
}
|
|
49
51
|
}
|
|
@@ -5,8 +5,7 @@ import { StringAnyType, StringStringType } from '../../types/serializer';
|
|
|
5
5
|
import { JobInterruptOptions, JobOutput } from '../../types/job';
|
|
6
6
|
import { QuorumMessage, QuorumMessageCallback, QuorumProfile, RollCallOptions, SubscriptionOptions, ThrottleOptions } from '../../types/quorum';
|
|
7
7
|
import { MeshFlowJobExport, ExportOptions } from '../../types/exporter';
|
|
8
|
-
import { ProviderConfig } from '../../types';
|
|
9
|
-
import { ProviderClass, ProvidersConfig } from '../../types/provider';
|
|
8
|
+
import { ProviderConfig, ProvidersConfig } from '../../types/provider';
|
|
10
9
|
declare class MeshData {
|
|
11
10
|
connectionSignatures: StringStringType;
|
|
12
11
|
connection: ProviderConfig | ProvidersConfig;
|
|
@@ -28,7 +27,7 @@ declare class MeshData {
|
|
|
28
27
|
executeChild: <T_1>(options?: Partial<WorkflowOptions>) => Promise<T_1>;
|
|
29
28
|
startChild: (options?: Partial<WorkflowOptions>) => Promise<string>;
|
|
30
29
|
};
|
|
31
|
-
constructor(
|
|
30
|
+
constructor(connection: ProviderConfig | ProvidersConfig, search?: WorkflowSearchOptions);
|
|
32
31
|
validate(entity: string): void;
|
|
33
32
|
getConnection(): Promise<ProviderConfig | ProvidersConfig>;
|
|
34
33
|
getClient(): import("../meshflow/client").ClientService;
|