@hotmeshio/hotmesh 0.3.12 → 0.3.14
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 +1 -1
- package/build/modules/key.js +1 -1
- package/build/modules/utils.d.ts +3 -2
- package/build/modules/utils.js +1 -1
- package/build/package.json +2 -2
- 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/engine/index.js +1 -1
- package/build/services/exporter/index.js +1 -1
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshdata/index.js +2 -1
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshos/index.js +5 -5
- 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/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/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.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x24d7f4,_0x372871){const _0x467f77=_0x47ee,_0x28fb35=_0x24d7f4();while(!![]){try{const _0x6eb702=parseInt(_0x467f77(0x7f))/0x1+-parseInt(_0x467f77(0x83))/0x2+parseInt(_0x467f77(0x82))/0x3*(parseInt(_0x467f77(0x80))/0x4)+parseInt(_0x467f77(0x81))/0x5+parseInt(_0x467f77(0x84))/0x6*(-parseInt(_0x467f77(0x87))/0x7)+parseInt(_0x467f77(0x85))/0x8+-parseInt(_0x467f77(0x86))/0x9;if(_0x6eb702===_0x372871)break;else _0x28fb35['push'](_0x28fb35['shift']());}catch(_0x4c4176){_0x28fb35['push'](_0x28fb35['shift']());}}}(_0x2188,0x3104a));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Worker']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');function _0x2188(){const _0x56531e=['2202039HiVwHI','1372lsbWgs','194149xbNxMP','687812eoDsVV','1175485iSBCPT','6zGkmfX','734962ORJkfL','2292bkgQEY','917200ZSYeWQ'];_0x2188=function(){return _0x56531e;};return _0x2188();}class Worker extends activity_1['Activity']{constructor(_0xfa4f2e,_0x3b3daf,_0x3f2c35,_0x34e5c0,_0x24f459,_0x4f33f5){super(_0xfa4f2e,_0x3b3daf,_0x3f2c35,_0x34e5c0,_0x24f459,_0x4f33f5);}async['process'](){this['logger']['debug']('worker-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x4e0830;try{await this['verifyEntry'](),_0x4e0830=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x4e0830['startActivitySpan'](this['leg']),this['mapInputData']();const _0x36baab=this['store']['transact'](),_0x4a960d=await this['execActivity'](_0x36baab);await collator_1['CollatorService']['authorizeReentry'](this,_0x36baab),await this['setState'](_0x36baab),await this['setStatus'](0x0,_0x36baab);const _0x43b078=await _0x36baab['exec']();_0x4e0830['mapActivityAttributes']();const _0x1051da=this['resolveStatus'](_0x43b078);return _0x4e0830['setActivityAttributes']({'app.activity.mid':_0x4a960d,'app.job.jss':_0x1051da}),this['context']['metadata']['aid'];}catch(_0x345127){if(_0x345127 instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x345127});return;}else{if(_0x345127 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x345127});return;}else{if(_0x345127 instanceof errors_1['GetStateError']){this['logger']['error']('worker-get-state-error',{..._0x345127});return;}else{if(_0x345127 instanceof errors_1['CollationError']){if(_0x345127['fault']==='duplicate'){this['logger']['info']('worker-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('worker-collation-error',{..._0x345127});}else this['logger']['error']('worker-process-error',{..._0x345127});}}}_0x4e0830?.['setActivityError'](_0x345127['message']);throw _0x345127;}finally{_0x4e0830?.['endActivitySpan'](),this['logger']['debug']('worker-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x5d3330){const _0x56ce0f=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x16b323={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':this['metadata']['dad'],'aid':this['metadata']['aid'],'topic':_0x56ce0f,'spn':this['context']['$self']['output']['metadata']['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context']['data']};return this['config']['retry']&&(_0x16b323['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](_0x56ce0f,_0x16b323,_0x5d3330);}}function _0x47ee(_0x52efce,_0x52c006){const _0x2188b2=_0x2188();return _0x47ee=function(_0x47ee99,_0x5c50f5){_0x47ee99=_0x47ee99-0x7f;let _0x47291d=_0x2188b2[_0x47ee99];return _0x47291d;},_0x47ee(_0x52efce,_0x52c006);}exports['Worker']=Worker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x3b9a30,_0x106d50){const _0x2d29d0=_0x39a8,_0xa84758=_0x3b9a30();while(!![]){try{const _0x59c827=-parseInt(_0x2d29d0(0x173))/0x1*(parseInt(_0x2d29d0(0x170))/0x2)+parseInt(_0x2d29d0(0x172))/0x3+-parseInt(_0x2d29d0(0x171))/0x4+parseInt(_0x2d29d0(0x16d))/0x5*(parseInt(_0x2d29d0(0x174))/0x6)+parseInt(_0x2d29d0(0x16c))/0x7*(-parseInt(_0x2d29d0(0x175))/0x8)+parseInt(_0x2d29d0(0x16f))/0x9+parseInt(_0x2d29d0(0x16e))/0xa;if(_0x59c827===_0x106d50)break;else _0xa84758['push'](_0xa84758['shift']());}catch(_0x25fcc1){_0xa84758['push'](_0xa84758['shift']());}}}(_0x57be,0xaa58b));function _0x39a8(_0x132131,_0x476833){const _0x57be24=_0x57be();return _0x39a8=function(_0x39a8e9,_0x27bd99){_0x39a8e9=_0x39a8e9-0x16c;let _0x4c27b2=_0x57be24[_0x39a8e9];return _0x4c27b2;},_0x39a8(_0x132131,_0x476833);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CollatorService']=void 0x0;function _0x57be(){const _0x36ad9a=['36554WtWdbv','2113928nrxiTk','1552944lKmKoL','43cMwMSk','17262OrgVBZ','808VDixYG','22617DwDeeA','1510zKfwDo','952080hqKaKM','7710777hoStkP'];_0x57be=function(){return _0x36ad9a;};return _0x57be();}const errors_1=require('../../modules/errors'),collator_1=require('../../types/collator');class CollatorService{static['assertJobActive'](_0xe8fefd,_0xfb891a,_0x41ce3b,_0x102aaf=0x0){if(_0xe8fefd<=_0x102aaf)throw new errors_1['InactiveJobError'](_0xfb891a,_0xe8fefd,_0x41ce3b);}static['getDimensionalAddress'](_0x21666e,_0x1bcdba=![]){let _0xaaf9a9=_0x21666e['context']['metadata']['dad']||_0x21666e['metadata']['dad'];return _0x1bcdba&&_0xaaf9a9&&_0x21666e['leg']===0x2&&(_0xaaf9a9=_0xaaf9a9['substring'](0x0,_0xaaf9a9['lastIndexOf'](','))+',0'),CollatorService['getDimensionsById']([..._0x21666e['config']['ancestors'],_0x21666e['metadata']['aid']],_0xaaf9a9);}static['resolveReentryDimension'](_0xfe82d4){const _0x2b3cae=_0xfe82d4['config']['ancestor'],_0x3343eb=_0xfe82d4['config']['ancestors'],_0x1b64b5=_0x3343eb['indexOf'](_0x2b3cae),_0x2eca8a=_0xfe82d4['metadata']['dad']['split'](',');return _0x2eca8a['length']=_0x1b64b5+0x1,_0x2eca8a['push']('0'),_0x2eca8a['join'](',');}static async['notarizeEntry'](_0x54e7d7,_0x1c8a07){const _0x4079ed=await _0x54e7d7['store']['collate'](_0x54e7d7['context']['metadata']['jid'],_0x54e7d7['metadata']['aid'],-0x5af3107a4000,this['getDimensionalAddress'](_0x54e7d7),_0x1c8a07);return this['verifyInteger'](_0x4079ed,0x1,'enter'),_0x4079ed;}static async['authorizeReentry'](_0x35a272,_0x2deea6){const _0x3c0996=await _0x35a272['store']['collate'](_0x35a272['context']['metadata']['jid'],_0x35a272['metadata']['aid'],-0x9184e72a000,this['getDimensionalAddress'](_0x35a272),_0x2deea6);return _0x3c0996;}static async['notarizeEarlyExit'](_0x17966c,_0x342ad7){return await _0x17966c['store']['collate'](_0x17966c['context']['metadata']['jid'],_0x17966c['metadata']['aid'],-0xa012317b000,this['getDimensionalAddress'](_0x17966c),_0x342ad7);}static async['notarizeEarlyCompletion'](_0x25383c,_0x4953c4){const _0xd9528e=_0x25383c['config']['cycle']?0x9184e72a000:0xa012317b000;return await _0x25383c['store']['collate'](_0x25383c['context']['metadata']['jid'],_0x25383c['metadata']['aid'],0xf4241-_0xd9528e,this['getDimensionalAddress'](_0x25383c),_0x4953c4);}static async['notarizeInception'](_0x3f6120,_0x5da9ec,_0x188881){_0x5da9ec&&await _0x3f6120['store']['collateSynthetic'](_0x3f6120['context']['metadata']['jid'],_0x5da9ec,0xf4240,_0x188881);}static async['isInceptionOverage'](_0x5d0dd7,_0x181b88){if(_0x181b88){const _0x1273b6=await _0x5d0dd7['store']['collateSynthetic'](_0x5d0dd7['context']['metadata']['jid'],_0x181b88,0xf4240);return _0x1273b6>0xf4240;}return![];}static async['notarizeReentry'](_0x34cfb2,_0x12fffb,_0x499c52){const _0x149fdb=_0x34cfb2['context']['metadata']['jid'],_0x907cbb=_0x499c52||_0x34cfb2['store']['transact']();await _0x34cfb2['store']['collate'](_0x149fdb,_0x34cfb2['metadata']['aid'],0xf4240,this['getDimensionalAddress'](_0x34cfb2,!![]),_0x907cbb),await _0x34cfb2['store']['collateSynthetic'](_0x149fdb,_0x12fffb,0xf4240,_0x907cbb);const [_0x4f737b,_0x4203f8]=await _0x907cbb['exec'](),_0xd8833a=Array['isArray'](_0x4f737b)?_0x4f737b[0x1]:_0x4f737b,_0x3b1379=Array['isArray'](_0x4203f8)?_0x4203f8[0x1]:_0x4203f8;return this['verifyInteger'](_0xd8833a,0x2,'enter'),this['verifySyntheticInteger'](_0x3b1379),_0xd8833a;}static async['notarizeContinuation'](_0x514e1a,_0x4df5fb){return await _0x514e1a['store']['collate'](_0x514e1a['context']['metadata']['jid'],_0x514e1a['metadata']['aid'],0x1,this['getDimensionalAddress'](_0x514e1a),_0x4df5fb);}static async['notarizeCompletion'](_0x528a06,_0x1ab472){const _0x4fd2b5=_0x528a06['config']['cycle']?0x0:0xe8d4a51000;return await _0x528a06['store']['collate'](_0x528a06['context']['metadata']['jid'],_0x528a06['metadata']['aid'],0x1-_0x4fd2b5,this['getDimensionalAddress'](_0x528a06),_0x1ab472);}static['getDigitAtIndex'](_0x285f61,_0x21766d){const _0x589eee=_0x285f61['toString']();if(_0x21766d<0x0||_0x21766d>=_0x589eee['length'])return null;const _0x58044c=parseInt(_0x589eee[_0x21766d],0xa);return _0x58044c;}static['getDimensionalIndex'](_0x391940){const _0x17df57=_0x391940['toString']();if(_0x17df57['length']<0x9)return null;const _0x532e8a=_0x17df57['substring'](0x3,0x9),_0x46eba6=parseInt(_0x532e8a,0xa);return _0x46eba6-0x1;}static['isDuplicate'](_0x37bfe4,_0x2eff87){return this['getDigitAtIndex'](_0x37bfe4,_0x2eff87)<0x8;}static['isInactive'](_0x5726ca){return this['getDigitAtIndex'](_0x5726ca,0x2)<0x9;}static['isPrimed'](_0x36b4f4,_0x28d9e9){return _0x28d9e9==0x1?_0x36b4f4!=-0x5af3107a4000:this['getDigitAtIndex'](_0x36b4f4,0x0)<0x9&&this['getDigitAtIndex'](_0x36b4f4,0x1)<0x9;}static['verifySyntheticInteger'](_0x2e07f8){const _0x2e0806=_0x2e07f8['toString'](),_0x1ef865=parseInt(_0x2e0806[_0x2e0806['length']-0x1],0xa);if(_0x1ef865>0x0)throw new errors_1['CollationError'](_0x2e07f8,0x2,'enter',collator_1['CollationFaultType']['INACTIVE']);else{if(_0x2e07f8>=0x1e8480)throw new errors_1['CollationError'](_0x2e07f8,0x2,'enter',collator_1['CollationFaultType']['DUPLICATE']);}}static['verifyInteger'](_0x3a98fd,_0x50f511,_0x384b57){let _0x3b9a71;if(_0x50f511===0x1&&_0x384b57==='enter'){if(!this['isPrimed'](_0x3a98fd,0x1))_0x3b9a71=collator_1['CollationFaultType']['MISSING'];else{if(this['isDuplicate'](_0x3a98fd,0x0))_0x3b9a71=collator_1['CollationFaultType']['DUPLICATE'];else _0x3a98fd!=0x331a2bfa73000&&(_0x3b9a71=collator_1['CollationFaultType']['INVALID']);}}else{if(_0x50f511===0x1&&_0x384b57==='exit'){if(_0x3a98fd===-0x9184e72a000)_0x3b9a71=collator_1['CollationFaultType']['MISSING'];else this['isDuplicate'](_0x3a98fd,0x1)&&(_0x3b9a71=collator_1['CollationFaultType']['DUPLICATE']);}else{if(_0x50f511===0x2&&_0x384b57==='enter'){if(!this['isPrimed'](_0x3a98fd,0x2))_0x3b9a71=collator_1['CollationFaultType']['FORBIDDEN'];else this['isInactive'](_0x3a98fd)&&(_0x3b9a71=collator_1['CollationFaultType']['INACTIVE']);}}}if(_0x3b9a71)throw new errors_1['CollationError'](_0x3a98fd,_0x50f511,_0x384b57,_0x3b9a71);}static['getDimensionsById'](_0x5874c1,_0x339882){const _0x342a4e={'$ADJACENT':_0x339882+',0'};let _0x55d0d8=_0x339882;return _0x5874c1['reverse']()['forEach'](_0x121563=>{_0x342a4e[_0x121563]=_0x55d0d8,_0x55d0d8=_0x55d0d8['substring'](0x0,_0x55d0d8['lastIndexOf'](','));}),_0x342a4e;}static['getSeed'](){return'999000000000000';}static['getTriggerSeed'](){return'888000001000001';}static['compile'](_0x333de9){CollatorService['bindAncestorArray'](_0x333de9);}static['bindAncestorArray'](_0x17a397){_0x17a397['forEach'](_0x21b906=>{const _0x1eb04c={},_0x211137=Object['keys'](_0x21b906['activities'])['find'](_0x1e418b=>_0x21b906['activities'][_0x1e418b]['type']==='trigger');if(!_0x211137)throw new Error('collator-trigger-activity-not-found');const _0x184e49=(_0x2a02f8,_0x45b73c)=>{_0x1eb04c[_0x2a02f8]=_0x45b73c,_0x21b906['activities'][_0x2a02f8]['ancestors']=_0x45b73c;const _0x3b105d=_0x21b906['transitions']?.[_0x2a02f8]||[];_0x3b105d['forEach'](_0xff45c3=>{_0x184e49(_0xff45c3['to'],[..._0x45b73c,_0x2a02f8]);});};_0x184e49(_0x211137,[]);});}static['getDimensionalSeed'](_0x5e9277=0x0){return','+_0x5e9277;}}exports['CollatorService']=CollatorService,CollatorService['targetLength']=0xf;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _0x42db(_0x2b3b01,_0x13863b){const _0x46f305=_0x46f3();return _0x42db=function(_0x42dbf4,_0x1da59d){_0x42dbf4=_0x42dbf4-0x176;let _0x16c1a1=_0x46f305[_0x42dbf4];return _0x16c1a1;},_0x42db(_0x2b3b01,_0x13863b);}(function(_0x14d24a,_0x146ade){const _0x21c918=_0x42db,_0x18ddc9=_0x14d24a();while(!![]){try{const _0x3e6da4=-parseInt(_0x21c918(0x17e))/0x1+-parseInt(_0x21c918(0x182))/0x2*(parseInt(_0x21c918(0x180))/0x3)+parseInt(_0x21c918(0x176))/0x4*(parseInt(_0x21c918(0x181))/0x5)+parseInt(_0x21c918(0x17b))/0x6*(parseInt(_0x21c918(0x177))/0x7)+parseInt(_0x21c918(0x17d))/0x8*(parseInt(_0x21c918(0x17a))/0x9)+parseInt(_0x21c918(0x179))/0xa*(parseInt(_0x21c918(0x17f))/0xb)+parseInt(_0x21c918(0x17c))/0xc*(-parseInt(_0x21c918(0x178))/0xd);if(_0x3e6da4===_0x146ade)break;else _0x18ddc9['push'](_0x18ddc9['shift']());}catch(_0xb346b0){_0x18ddc9['push'](_0x18ddc9['shift']());}}}(_0x46f3,0xe239f));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 _0x46f3(){const _0x30f196=['48amncCP','3557995uOXTbT','115212gvkpxo','8ImVGac','7tHorvy','10145902QsjVxj','19560OOqIqd','425781wzHxGO','3165858UftCOJ','36bWqrej','296QjgEuf','119909iDIjQh','3421Vykvkf'];_0x46f3=function(){return _0x30f196;};return _0x46f3();}class Deployer{constructor(_0x3217f3){this['manifest']=null,this['manifest']=_0x3217f3;}async['deploy'](_0x3adc88,_0x66f501){this['store']=_0x3adc88,this['stream']=_0x66f501,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 _0x1ddde8 of this['manifest']['app']['graphs']){const [,_0x273a24]=this['findTrigger'](_0x1ddde8),_0x1c9f4b=_0x273a24['subscribes'],[_0x2f4d1f,_0xc304e6,_0xa54247]=await this['store']['reserveSymbolRange']('$'+_0x1c9f4b,DEFAULT_RANGE_SIZE,'JOB'),_0x217582='',_0x547847=this['bindSymbols'](_0x2f4d1f,_0xc304e6,_0xa54247,_0x217582,_0x273a24['PRODUCES']);Object['keys'](_0x547847)['length']&&await this['store']['addSymbols']('$'+_0x1c9f4b,_0x547847);for(const [_0x2c331f,_0x36177a]of Object['entries'](_0x1ddde8['activities'])){const [_0x54be4a,_0x1940c3,_0x52300c]=await this['store']['reserveSymbolRange'](_0x2c331f,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x16e5bc=_0x2c331f+'/';this['bindSelf'](_0x36177a['consumes'],_0x36177a['produces'],_0x2c331f);const _0x2712d8=this['bindSymbols'](_0x54be4a,_0x1940c3,_0x52300c,_0x16e5bc,_0x36177a['produces']);Object['keys'](_0x2712d8)['length']&&await this['store']['addSymbols'](_0x2c331f,_0x2712d8);}}}['bindSelf'](_0x4d378f,_0xa2b8bd,_0x63d6d7){for(const _0x57146a of[_0x63d6d7,'$self']){const _0x578fdf=_0x4d378f[_0x57146a];if(_0x578fdf)for(const _0x49e2a2 of _0x578fdf){!_0xa2b8bd['includes'](_0x49e2a2)&&_0xa2b8bd['push'](_0x49e2a2);}}}['bindSymbols'](_0x38f07,_0xb0d627,_0x43c1ad,_0x1260ef,_0x44bf41){const _0x172d2c={},_0x18b86d={..._0x43c1ad};for(const _0x4b7282 of _0x44bf41){const _0x58473e=''+_0x1260ef+_0x4b7282;if(!_0x18b86d[_0x58473e]){if(_0x38f07>_0xb0d627)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x458f65=(0x0,utils_1['getSymKey'])(_0x38f07);_0x38f07++,_0x172d2c[_0x58473e]=_0x458f65,_0x18b86d[_0x58473e]=_0x458f65;}}return _0x172d2c;}['copyJobSchemas'](){const _0x5098a7=this['manifest']['app']['graphs'];for(const _0x39ed7d of _0x5098a7){const _0x32e882=_0x39ed7d['output']?.['schema'],_0x3bc5de=_0x39ed7d['input']?.['schema'];if(!_0x32e882&&!_0x3bc5de)continue;const _0x1fabb5=_0x39ed7d['activities'];for(const _0x3c7780 in _0x1fabb5){if(_0x1fabb5[_0x3c7780]['type']==='trigger'){const _0x16fd1d=_0x1fabb5[_0x3c7780];_0x32e882&&(!_0x16fd1d['job']&&(_0x16fd1d['job']={}),_0x16fd1d['job']['schema']=_0x32e882),_0x3bc5de&&(_0x16fd1d['output']={'schema':_0x3bc5de});}}}}['bindBackRefs'](){for(const _0x1c7916 of this['manifest']['app']['graphs']){const _0x361e36=_0x1c7916['activities'],_0xfc01a3=this['findTrigger'](_0x1c7916)[0x0];for(const _0x1804b0 in _0x361e36){_0x361e36[_0x1804b0]['trigger']=_0xfc01a3,_0x361e36[_0x1804b0]['subscribes']=_0x1c7916['subscribes'],_0x1c7916['publishes']&&(_0x361e36[_0x1804b0]['publishes']=_0x1c7916['publishes']),_0x361e36[_0x1804b0]['expire']=_0x1c7916['expire']??undefined,_0x361e36[_0x1804b0]['persistent']=_0x1c7916['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x4cf263 of this['manifest']['app']['graphs']){const _0x49ee87=_0x4cf263['activities'];for(const _0x303160 in _0x49ee87){const _0x19c352=_0x49ee87[_0x303160];_0x19c352['type']==='cycle'&&(_0x49ee87[_0x19c352['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x17fce7 of this['manifest']['app']['graphs']){const _0x156d8d=_0x17fce7['activities'];for(const _0x5410b5 in _0x156d8d){const _0x13021c=_0x156d8d[_0x5410b5];['worker','await']['includes'](_0x13021c['type'])&&_0x13021c['topic']&&!_0x13021c['subtype']&&(_0x13021c['subtype']=_0x13021c['topic']);}}}['convertActivitiesToHooks'](){for(const _0x3e7a39 of this['manifest']['app']['graphs']){const _0x4f5b5b=_0x3e7a39['activities'];for(const _0x380428 in _0x4f5b5b){const _0x5389d9=_0x4f5b5b[_0x380428];['activity']['includes'](_0x5389d9['type'])&&(_0x5389d9['type']='hook');}}}async['bindParents'](){const _0x11d41f=this['manifest']['app']['graphs'];for(const _0xc01a7b of _0x11d41f){if(_0xc01a7b['transitions'])for(const _0x746d57 in _0xc01a7b['transitions']){const _0x4c3e57=_0xc01a7b['transitions'][_0x746d57];for(const _0x415e60 of _0x4c3e57){const _0x21730c=_0x415e60['to'];_0xc01a7b['activities'][_0x21730c]['parent']=_0x746d57;}_0xc01a7b['activities'][_0x746d57]['transitions']=_0x4c3e57;}}}['collectValues'](_0x4384ad,_0x17b451){for(const [_0x346d81,_0x5d276c]of Object['entries'](_0x4384ad)){if(_0x346d81==='enum'||_0x346d81==='examples'||_0x346d81==='default'){if(Array['isArray'](_0x5d276c))for(const _0x5c4ee6 of _0x5d276c){typeof _0x5c4ee6==='string'&&_0x5c4ee6['length']>0x5&&_0x17b451['add'](_0x5c4ee6);}else typeof _0x5d276c==='string'&&_0x5d276c['length']>0x5&&_0x17b451['add'](_0x5d276c);}else typeof _0x5d276c==='object'&&this['collectValues'](_0x5d276c,_0x17b451);}}['traverse'](_0x7acb7d,_0x2b2ffd){for(const _0xec8af9 of Object['values'](_0x7acb7d)){typeof _0xec8af9==='object'&&('schema'in _0xec8af9?this['collectValues'](_0xec8af9['schema'],_0x2b2ffd):this['traverse'](_0xec8af9,_0x2b2ffd));}}async['generateSymVals'](){const _0x38e485=new Set();for(const _0x589c88 of this['manifest']['app']['graphs']){this['traverse'](_0x589c88,_0x38e485);}const _0x26c74a=await this['store']['getSymbolValues'](),_0x44cf83=Object['keys'](_0x26c74a)['length'],_0x578dd1=Math['pow'](0x34,0x2)-0x1,_0x2c3cbe=serializer_1['SerializerService']['filterSymVals'](_0x44cf83,_0x578dd1,_0x26c74a,_0x38e485);await this['store']['addSymbolValues'](_0x2c3cbe);}['resolveJobMapsPaths'](){function _0x3f9d26(_0x490ab3){const _0x416c8a=[];function _0x2a9861(_0x260b27,_0x5b3824=[]){for(const _0x22958d in _0x260b27){if(typeof _0x260b27[_0x22958d]==='object'&&_0x260b27[_0x22958d]!==null&&!('@pipe'in _0x260b27[_0x22958d])){const _0x231036=[..._0x5b3824,_0x22958d];_0x2a9861(_0x260b27[_0x22958d],_0x231036);}else{const _0xb1b5c7=[..._0x5b3824,_0x22958d]['join']('/');if(!_0xb1b5c7['includes']('[')){const _0x52b7f6='data/'+_0xb1b5c7;!_0x416c8a['includes'](_0x52b7f6)&&_0x416c8a['push'](_0x52b7f6);}else{const [_0x46ed03,_0x3c7160]=_0xb1b5c7['split']('['),[_0x5b4749,_0xa00c9a]=_0x3c7160['split'](']');if(!isNaN(parseInt(_0x5b4749)))for(let _0x592581=0x0;_0x592581<parseInt(_0x5b4749);_0x592581++){const _0x58d7e9='data/'+_0x46ed03+'/'+_0x592581;!_0x416c8a['includes'](_0x58d7e9)&&_0x416c8a['push'](_0x58d7e9);}}}}}return _0x490ab3&&_0x2a9861(_0x490ab3),_0x416c8a;}for(const _0x3afced of this['manifest']['app']['graphs']){let _0x3592c3=[];const [,_0x4259c0]=this['findTrigger'](_0x3afced);for(const _0xde4536 in _0x3afced['activities']){const _0x515aaf=_0x3afced['activities'][_0xde4536];_0x3592c3=_0x3592c3['concat'](_0x3f9d26(_0x515aaf['job']?.['maps']));}_0x4259c0['PRODUCES']=_0x3592c3;}}['resolveMappingDependencies'](){const _0x311885=[];function _0x51f124(_0x502278,_0x2a37f7){for(const _0x27e1ab in _0x502278){if(typeof _0x502278[_0x27e1ab]==='string'){const _0x130cf5=_0x502278[_0x27e1ab],_0x4e8fdd=_0x130cf5['match'](/^\{[^@].*}$/);_0x4e8fdd&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x130cf5)&&(_0x130cf5['split']('.')[0x1]!=='input'&&(_0x311885['push'](_0x130cf5),_0x2a37f7['push'](_0x130cf5)));}else typeof _0x502278[_0x27e1ab]==='object'&&_0x502278[_0x27e1ab]!==null&&_0x51f124(_0x502278[_0x27e1ab],_0x2a37f7);}}const _0xd45e53=this['manifest']['app']['graphs'];for(const _0x1b2e3e of _0xd45e53){const _0x38d9c2=_0x1b2e3e['activities'];for(const _0x1c7fbc in _0x38d9c2){const _0xe74b58=_0x38d9c2[_0x1c7fbc];_0xe74b58['consumes']=[],_0x51f124(_0xe74b58,_0xe74b58['consumes']),_0xe74b58['consumes']=this['groupMappingRules'](_0xe74b58['consumes']);}}const _0x51a2d6=this['groupMappingRules'](_0x311885);for(const _0x16d351 of _0xd45e53){const _0x5eb3d9=_0x16d351['activities'];for(const _0x2b9ffd in _0x5eb3d9){const _0x2bc67c=_0x5eb3d9[_0x2b9ffd];_0x2bc67c['produces']=_0x51a2d6[''+_0x2b9ffd]||[];}}}['groupMappingRules'](_0x5c148f){_0x5c148f=Array['from'](new Set(_0x5c148f))['sort']();const _0x3ddc79={};for(const _0xc74544 of _0x5c148f){const [_0x3fbc23,_0x3322fa]=this['resolveMappableValue'](_0xc74544);!_0x3ddc79[_0x3fbc23]&&(_0x3ddc79[_0x3fbc23]=[]),_0x3ddc79[_0x3fbc23]['push'](_0x3322fa);}return _0x3ddc79;}['resolveMappableValue'](_0x9bc1a1){_0x9bc1a1=_0x9bc1a1['substring'](0x1,_0x9bc1a1['length']-0x1);const _0x4d9858=_0x9bc1a1['split']('.');if(_0x4d9858[0x0]==='$job'){const [_0x145ef1,..._0x29b205]=_0x4d9858;return[_0x145ef1,_0x29b205['join']('/')];}else{const [_0x5163a7,_0x59a7df,_0x329274,..._0x118f82]=_0x4d9858,_0x147585={'hook':'hook/data','input':'input/data','output':_0x329274==='data'?'output/data':'output/metadata'}[_0x59a7df];return[_0x5163a7,_0x147585+'/'+_0x118f82['join']('/')];}}async['deployActivitySchemas'](){const _0x34b46d=this['manifest']['app']['graphs'],_0x379b6c={};for(const _0x17829e of _0x34b46d){const _0x40de7f=_0x17829e['activities'];for(const _0x36c7f4 in _0x40de7f){const _0x7279ac=_0x40de7f[_0x36c7f4];delete _0x7279ac['transitions'],_0x379b6c[_0x36c7f4]=_0x7279ac;}}await this['store']['setSchemas'](_0x379b6c,this['getVID']());}async['deploySubscriptions'](){const _0x2d8868=this['manifest']['app']['graphs'],_0xa72a5f={};for(const _0x45e55c of _0x2d8868){const _0x208499=_0x45e55c['activities'],_0x5815e5=_0x45e55c['subscribes'];for(const _0x5b4439 in _0x208499){if(_0x208499[_0x5b4439]['type']==='trigger'){_0xa72a5f[_0x5815e5]=_0x5b4439;break;}}}await this['store']['setSubscriptions'](_0xa72a5f,this['getVID']());}['findTrigger'](_0x4aacd4){for(const _0x2ad1ec in _0x4aacd4['activities']){const _0x46efcf=_0x4aacd4['activities'][_0x2ad1ec];if(_0x46efcf['type']==='trigger')return[_0x2ad1ec,_0x46efcf];}return null;}async['deployTransitions'](){const _0x4f1b83=this['manifest']['app']['graphs'],_0x22aba7={};for(const _0x18624c of _0x4f1b83){if(_0x18624c['subscribes']&&_0x18624c['subscribes']['startsWith']('.')){const [_0x5852f4]=this['findTrigger'](_0x18624c);_0x5852f4&&(_0x22aba7[_0x18624c['subscribes']]={[_0x5852f4]:!![]});}if(_0x18624c['transitions'])for(const _0x1ed970 in _0x18624c['transitions']){const _0x1f8f1c=_0x18624c['transitions'][_0x1ed970],_0x10726a={};for(const _0x2c0b82 of _0x1f8f1c){const _0x21af04=_0x2c0b82['to'];_0x2c0b82['conditions']?_0x10726a[_0x21af04]=_0x2c0b82['conditions']:_0x10726a[_0x21af04]=!![];}Object['keys'](_0x10726a)['length']>0x0&&(_0x22aba7['.'+_0x1ed970]=_0x10726a);}}await this['store']['setTransitions'](_0x22aba7,this['getVID']());}async['deployHookPatterns'](){const _0x2871ee=this['manifest']['app']['graphs'],_0x5bbc9f={};for(const _0x57c7c5 of _0x2871ee){if(_0x57c7c5['hooks'])for(const _0x4d5bf4 in _0x57c7c5['hooks']){_0x5bbc9f[_0x4d5bf4]=_0x57c7c5['hooks'][_0x4d5bf4];const _0x51d8b7=_0x57c7c5['hooks'][_0x4d5bf4][0x0]['to'],_0xc8a185=_0x57c7c5['activities'][_0x51d8b7];_0xc8a185&&(!_0xc8a185['hook']&&(_0xc8a185['hook']={}),_0xc8a185['hook']['topic']=_0x4d5bf4);}}await this['store']['setHookRules'](_0x5bbc9f);}async['deployConsumerGroups'](){const _0x2696a={'appId':this['manifest']['app']['id']},_0x473884=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x2696a);await this['deployConsumerGroup'](_0x473884,'ENGINE');for(const _0x5f2aaf of this['manifest']['app']['graphs']){const _0x53a935=_0x5f2aaf['activities'];for(const _0xd15c75 in _0x53a935){const _0x3a4f06=_0x53a935[_0xd15c75];if(_0x3a4f06['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x3a4f06['subtype'],{})===_0x3a4f06['subtype']){_0x2696a['topic']=_0x3a4f06['subtype'];const _0x734831=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x2696a);await this['deployConsumerGroup'](_0x734831,'WORKER');}}}}async['deployConsumerGroup'](_0x26b907,_0x52799d){try{await this['stream']['createConsumerGroup'](_0x26b907,_0x52799d);}catch(_0x3ef1ee){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x26b907,'group':_0x52799d});}}}exports['Deployer']=Deployer;
|
|
1
|
+
'use strict';(function(_0x11503a,_0x106ce4){const _0x441f39=_0x5f4a,_0x5b5a7a=_0x11503a();while(!![]){try{const _0x40aea1=parseInt(_0x441f39(0x19d))/0x1*(parseInt(_0x441f39(0x1a3))/0x2)+-parseInt(_0x441f39(0x1a4))/0x3*(parseInt(_0x441f39(0x1a6))/0x4)+-parseInt(_0x441f39(0x19f))/0x5*(parseInt(_0x441f39(0x1a0))/0x6)+-parseInt(_0x441f39(0x1a5))/0x7*(-parseInt(_0x441f39(0x1a2))/0x8)+-parseInt(_0x441f39(0x19b))/0x9+-parseInt(_0x441f39(0x19e))/0xa*(parseInt(_0x441f39(0x19c))/0xb)+parseInt(_0x441f39(0x1a1))/0xc;if(_0x40aea1===_0x106ce4)break;else _0x5b5a7a['push'](_0x5b5a7a['shift']());}catch(_0x531ff5){_0x5b5a7a['push'](_0x5b5a7a['shift']());}}}(_0x510d,0x41d8c));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;class Deployer{constructor(_0x1dc194){this['manifest']=null,this['manifest']=_0x1dc194;}async['deploy'](_0x3eefbb,_0x31457b){this['store']=_0x3eefbb,this['stream']=_0x31457b,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 _0x107f74 of this['manifest']['app']['graphs']){const [,_0x3886a2]=this['findTrigger'](_0x107f74),_0x284295=_0x3886a2['subscribes'],[_0x27a88d,_0x302594,_0x2f1da0]=await this['store']['reserveSymbolRange']('$'+_0x284295,DEFAULT_RANGE_SIZE,'JOB'),_0x3779cc='',_0x5d9f4f=this['bindSymbols'](_0x27a88d,_0x302594,_0x2f1da0,_0x3779cc,_0x3886a2['PRODUCES']);Object['keys'](_0x5d9f4f)['length']&&await this['store']['addSymbols']('$'+_0x284295,_0x5d9f4f);for(const [_0x15849c,_0x27dc5d]of Object['entries'](_0x107f74['activities'])){const [_0x1a0612,_0x268134,_0x42e5a1]=await this['store']['reserveSymbolRange'](_0x15849c,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x1d9e8d=_0x15849c+'/';this['bindSelf'](_0x27dc5d['consumes'],_0x27dc5d['produces'],_0x15849c);const _0x58d622=this['bindSymbols'](_0x1a0612,_0x268134,_0x42e5a1,_0x1d9e8d,_0x27dc5d['produces']);Object['keys'](_0x58d622)['length']&&await this['store']['addSymbols'](_0x15849c,_0x58d622);}}}['bindSelf'](_0x55e2d0,_0x5c47b0,_0x27df8c){for(const _0x5257ca of[_0x27df8c,'$self']){const _0x280705=_0x55e2d0[_0x5257ca];if(_0x280705)for(const _0x4b8410 of _0x280705){!_0x5c47b0['includes'](_0x4b8410)&&_0x5c47b0['push'](_0x4b8410);}}}['bindSymbols'](_0x26de8f,_0x33beee,_0x1d48c8,_0x18706d,_0x25d905){const _0x5cc597={},_0x320ae8={..._0x1d48c8};for(const _0xa7b497 of _0x25d905){const _0x3d8e9e=''+_0x18706d+_0xa7b497;if(!_0x320ae8[_0x3d8e9e]){if(_0x26de8f>_0x33beee)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x382912=(0x0,utils_1['getSymKey'])(_0x26de8f);_0x26de8f++,_0x5cc597[_0x3d8e9e]=_0x382912,_0x320ae8[_0x3d8e9e]=_0x382912;}}return _0x5cc597;}['copyJobSchemas'](){const _0x59c8af=this['manifest']['app']['graphs'];for(const _0x908675 of _0x59c8af){const _0x16435f=_0x908675['output']?.['schema'],_0x573a41=_0x908675['input']?.['schema'];if(!_0x16435f&&!_0x573a41)continue;const _0x42f088=_0x908675['activities'];for(const _0x15550f in _0x42f088){if(_0x42f088[_0x15550f]['type']==='trigger'){const _0x25554c=_0x42f088[_0x15550f];_0x16435f&&(!_0x25554c['job']&&(_0x25554c['job']={}),_0x25554c['job']['schema']=_0x16435f),_0x573a41&&(_0x25554c['output']={'schema':_0x573a41});}}}}['bindBackRefs'](){for(const _0x450a6f of this['manifest']['app']['graphs']){const _0x43e084=_0x450a6f['activities'],_0x1cec48=this['findTrigger'](_0x450a6f)[0x0];for(const _0x5647ea in _0x43e084){_0x43e084[_0x5647ea]['trigger']=_0x1cec48,_0x43e084[_0x5647ea]['subscribes']=_0x450a6f['subscribes'],_0x450a6f['publishes']&&(_0x43e084[_0x5647ea]['publishes']=_0x450a6f['publishes']),_0x43e084[_0x5647ea]['expire']=_0x450a6f['expire']??undefined,_0x43e084[_0x5647ea]['persistent']=_0x450a6f['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x3c10ad of this['manifest']['app']['graphs']){const _0x15f995=_0x3c10ad['activities'];for(const _0x592e63 in _0x15f995){const _0x338a22=_0x15f995[_0x592e63];_0x338a22['type']==='cycle'&&(_0x15f995[_0x338a22['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x459170 of this['manifest']['app']['graphs']){const _0x3e917d=_0x459170['activities'];for(const _0x49e8c0 in _0x3e917d){const _0xe769f6=_0x3e917d[_0x49e8c0];['worker','await']['includes'](_0xe769f6['type'])&&_0xe769f6['topic']&&!_0xe769f6['subtype']&&(_0xe769f6['subtype']=_0xe769f6['topic']);}}}['convertActivitiesToHooks'](){for(const _0x19b507 of this['manifest']['app']['graphs']){const _0x57fae8=_0x19b507['activities'];for(const _0x9caab5 in _0x57fae8){const _0xd1face=_0x57fae8[_0x9caab5];['activity']['includes'](_0xd1face['type'])&&(_0xd1face['type']='hook');}}}async['bindParents'](){const _0x47649b=this['manifest']['app']['graphs'];for(const _0x10cc2a of _0x47649b){if(_0x10cc2a['transitions'])for(const _0x478e25 in _0x10cc2a['transitions']){const _0x3a081f=_0x10cc2a['transitions'][_0x478e25];for(const _0x210ed5 of _0x3a081f){const _0x776938=_0x210ed5['to'];_0x10cc2a['activities'][_0x776938]['parent']=_0x478e25;}_0x10cc2a['activities'][_0x478e25]['transitions']=_0x3a081f;}}}['collectValues'](_0x3ea753,_0xc62f99){for(const [_0x4c0474,_0x30f2ba]of Object['entries'](_0x3ea753)){if(_0x4c0474==='enum'||_0x4c0474==='examples'||_0x4c0474==='default'){if(Array['isArray'](_0x30f2ba))for(const _0x2a9ba8 of _0x30f2ba){typeof _0x2a9ba8==='string'&&_0x2a9ba8['length']>0x5&&_0xc62f99['add'](_0x2a9ba8);}else typeof _0x30f2ba==='string'&&_0x30f2ba['length']>0x5&&_0xc62f99['add'](_0x30f2ba);}else typeof _0x30f2ba==='object'&&this['collectValues'](_0x30f2ba,_0xc62f99);}}['traverse'](_0x56164c,_0x303208){for(const _0x43e708 of Object['values'](_0x56164c)){typeof _0x43e708==='object'&&('schema'in _0x43e708?this['collectValues'](_0x43e708['schema'],_0x303208):this['traverse'](_0x43e708,_0x303208));}}async['generateSymVals'](){const _0x2bd1a4=new Set();for(const _0x460d68 of this['manifest']['app']['graphs']){this['traverse'](_0x460d68,_0x2bd1a4);}const _0x5f4e4d=await this['store']['getSymbolValues'](),_0x58359=Object['keys'](_0x5f4e4d)['length'],_0x40a258=Math['pow'](0x34,0x2)-0x1,_0x6b6da0=serializer_1['SerializerService']['filterSymVals'](_0x58359,_0x40a258,_0x5f4e4d,_0x2bd1a4);await this['store']['addSymbolValues'](_0x6b6da0);}['resolveJobMapsPaths'](){function _0x3ff1a3(_0x1db938){const _0x25bd31=[];function _0x1ef1c4(_0x2a13a6,_0x260dd9=[]){for(const _0x54cd2d in _0x2a13a6){if(typeof _0x2a13a6[_0x54cd2d]==='object'&&_0x2a13a6[_0x54cd2d]!==null&&!('@pipe'in _0x2a13a6[_0x54cd2d])){const _0x2c4ec1=[..._0x260dd9,_0x54cd2d];_0x1ef1c4(_0x2a13a6[_0x54cd2d],_0x2c4ec1);}else{const _0x233b18=[..._0x260dd9,_0x54cd2d]['join']('/');if(!_0x233b18['includes']('[')){const _0x5ac6ee='data/'+_0x233b18;!_0x25bd31['includes'](_0x5ac6ee)&&_0x25bd31['push'](_0x5ac6ee);}else{const [_0x3565c4,_0x3e395b]=_0x233b18['split']('['),[_0x11bbc8,_0x5789ff]=_0x3e395b['split'](']');if(!isNaN(parseInt(_0x11bbc8)))for(let _0x25040f=0x0;_0x25040f<parseInt(_0x11bbc8);_0x25040f++){const _0xfe600='data/'+_0x3565c4+'/'+_0x25040f;!_0x25bd31['includes'](_0xfe600)&&_0x25bd31['push'](_0xfe600);}}}}}return _0x1db938&&_0x1ef1c4(_0x1db938),_0x25bd31;}for(const _0x1147ad of this['manifest']['app']['graphs']){let _0x145e17=[];const [,_0x2fe58f]=this['findTrigger'](_0x1147ad);for(const _0x26d708 in _0x1147ad['activities']){const _0x2658d3=_0x1147ad['activities'][_0x26d708];_0x145e17=_0x145e17['concat'](_0x3ff1a3(_0x2658d3['job']?.['maps']));}_0x2fe58f['PRODUCES']=_0x145e17;}}['resolveMappingDependencies'](){const _0x3c2e65=[];function _0x3b00ae(_0x924904,_0x2e9c51){for(const _0x55d091 in _0x924904){if(typeof _0x924904[_0x55d091]==='string'){const _0x5cb330=_0x924904[_0x55d091],_0x938286=_0x5cb330['match'](/^\{[^@].*}$/);_0x938286&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x5cb330)&&(_0x5cb330['split']('.')[0x1]!=='input'&&(_0x3c2e65['push'](_0x5cb330),_0x2e9c51['push'](_0x5cb330)));}else typeof _0x924904[_0x55d091]==='object'&&_0x924904[_0x55d091]!==null&&_0x3b00ae(_0x924904[_0x55d091],_0x2e9c51);}}const _0x9865e5=this['manifest']['app']['graphs'];for(const _0x2358c8 of _0x9865e5){const _0x26a47d=_0x2358c8['activities'];for(const _0x5b9d2d in _0x26a47d){const _0x110773=_0x26a47d[_0x5b9d2d];_0x110773['consumes']=[],_0x3b00ae(_0x110773,_0x110773['consumes']),_0x110773['consumes']=this['groupMappingRules'](_0x110773['consumes']);}}const _0x2a9137=this['groupMappingRules'](_0x3c2e65);for(const _0x5e8691 of _0x9865e5){const _0xf51e2e=_0x5e8691['activities'];for(const _0x33cc16 in _0xf51e2e){const _0x3c08df=_0xf51e2e[_0x33cc16];_0x3c08df['produces']=_0x2a9137[''+_0x33cc16]||[];}}}['groupMappingRules'](_0x45dc35){_0x45dc35=Array['from'](new Set(_0x45dc35))['sort']();const _0x93dc48={};for(const _0x4d9be9 of _0x45dc35){const [_0x5d88bf,_0x2af601]=this['resolveMappableValue'](_0x4d9be9);!_0x93dc48[_0x5d88bf]&&(_0x93dc48[_0x5d88bf]=[]),_0x93dc48[_0x5d88bf]['push'](_0x2af601);}return _0x93dc48;}['resolveMappableValue'](_0x443c7a){_0x443c7a=_0x443c7a['substring'](0x1,_0x443c7a['length']-0x1);const _0x36f60c=_0x443c7a['split']('.');if(_0x36f60c[0x0]==='$job'){const [_0x2beed5,..._0x2abd89]=_0x36f60c;return[_0x2beed5,_0x2abd89['join']('/')];}else{const [_0x3c60ab,_0x47929e,_0x1c3b55,..._0x2e15dc]=_0x36f60c,_0x5c153d={'hook':'hook/data','input':'input/data','output':_0x1c3b55==='data'?'output/data':'output/metadata'}[_0x47929e];return[_0x3c60ab,_0x5c153d+'/'+_0x2e15dc['join']('/')];}}async['deployActivitySchemas'](){const _0x10d643=this['manifest']['app']['graphs'],_0x5d0b8c={};for(const _0x505d97 of _0x10d643){const _0x1564b1=_0x505d97['activities'];for(const _0x3a31cf in _0x1564b1){const _0x4bac44=_0x1564b1[_0x3a31cf];delete _0x4bac44['transitions'],_0x5d0b8c[_0x3a31cf]=_0x4bac44;}}await this['store']['setSchemas'](_0x5d0b8c,this['getVID']());}async['deploySubscriptions'](){const _0x536aa3=this['manifest']['app']['graphs'],_0x5cf432={};for(const _0x445fcd of _0x536aa3){const _0x4d8474=_0x445fcd['activities'],_0x4cad5f=_0x445fcd['subscribes'];for(const _0x5aa2c4 in _0x4d8474){if(_0x4d8474[_0x5aa2c4]['type']==='trigger'){_0x5cf432[_0x4cad5f]=_0x5aa2c4;break;}}}await this['store']['setSubscriptions'](_0x5cf432,this['getVID']());}['findTrigger'](_0x6bcbc7){for(const _0x533022 in _0x6bcbc7['activities']){const _0x4c27bf=_0x6bcbc7['activities'][_0x533022];if(_0x4c27bf['type']==='trigger')return[_0x533022,_0x4c27bf];}return null;}async['deployTransitions'](){const _0x264011=this['manifest']['app']['graphs'],_0x4fbf39={};for(const _0x20140c of _0x264011){if(_0x20140c['subscribes']&&_0x20140c['subscribes']['startsWith']('.')){const [_0xa3bf39]=this['findTrigger'](_0x20140c);_0xa3bf39&&(_0x4fbf39[_0x20140c['subscribes']]={[_0xa3bf39]:!![]});}if(_0x20140c['transitions'])for(const _0x2b9c21 in _0x20140c['transitions']){const _0x269c84=_0x20140c['transitions'][_0x2b9c21],_0x2535ea={};for(const _0x2cf811 of _0x269c84){const _0xe33ee9=_0x2cf811['to'];_0x2cf811['conditions']?_0x2535ea[_0xe33ee9]=_0x2cf811['conditions']:_0x2535ea[_0xe33ee9]=!![];}Object['keys'](_0x2535ea)['length']>0x0&&(_0x4fbf39['.'+_0x2b9c21]=_0x2535ea);}}await this['store']['setTransitions'](_0x4fbf39,this['getVID']());}async['deployHookPatterns'](){const _0x5559af=this['manifest']['app']['graphs'],_0x51be3a={};for(const _0x118b3d of _0x5559af){if(_0x118b3d['hooks'])for(const _0x384854 in _0x118b3d['hooks']){_0x51be3a[_0x384854]=_0x118b3d['hooks'][_0x384854];const _0x16df38=_0x118b3d['hooks'][_0x384854][0x0]['to'],_0x1a1c14=_0x118b3d['activities'][_0x16df38];_0x1a1c14&&(!_0x1a1c14['hook']&&(_0x1a1c14['hook']={}),_0x1a1c14['hook']['topic']=_0x384854);}}await this['store']['setHookRules'](_0x51be3a);}async['deployConsumerGroups'](){const _0x92f43d={'appId':this['manifest']['app']['id']},_0x23f319=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x92f43d);await this['deployConsumerGroup'](_0x23f319,'ENGINE');for(const _0x59f419 of this['manifest']['app']['graphs']){const _0x52e262=_0x59f419['activities'];for(const _0x3da307 in _0x52e262){const _0x523966=_0x52e262[_0x3da307];if(_0x523966['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x523966['subtype'],{})===_0x523966['subtype']){_0x92f43d['topic']=_0x523966['subtype'];const _0x4c1ea8=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x92f43d);await this['deployConsumerGroup'](_0x4c1ea8,'WORKER');}}}}async['deployConsumerGroup'](_0x1ae8d7,_0xa97ee1){try{await this['stream']['createConsumerGroup'](_0x1ae8d7,_0xa97ee1);}catch(_0x2668cc){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x1ae8d7,'group':_0xa97ee1});}}}function _0x510d(){const _0x43dd74=['5728bWHlwf','3938391arlLiM','1958hotvXQ','187MSWOWx','13320iawqwL','466180hQWqPy','18MpqWdI','13061412DrAnGN','40RrXOhn','2482fRzQeH','678AJIgAM','318115xTXTjw'];_0x510d=function(){return _0x43dd74;};return _0x510d();}function _0x5f4a(_0x5e84e1,_0x3b284b){const _0x510dba=_0x510d();return _0x5f4a=function(_0x5f4afa,_0x7f4ac6){_0x5f4afa=_0x5f4afa-0x19b;let _0x1dcc49=_0x510dba[_0x5f4afa];return _0x1dcc49;},_0x5f4a(_0x5e84e1,_0x3b284b);}exports['Deployer']=Deployer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x2e1c88,_0x47238d){const _0x36c113=_0x58df,_0x4d095c=_0x2e1c88();while(!![]){try{const _0x98a0d3=parseInt(_0x36c113(0x1b8))/0x1+parseInt(_0x36c113(0x1b0))/0x2*(parseInt(_0x36c113(0x1b4))/0x3)+-parseInt(_0x36c113(0x1b2))/0x4+parseInt(_0x36c113(0x1ba))/0x5*(-parseInt(_0x36c113(0x1b3))/0x6)+parseInt(_0x36c113(0x1b7))/0x7*(-parseInt(_0x36c113(0x1b9))/0x8)+-parseInt(_0x36c113(0x1b1))/0x9*(-parseInt(_0x36c113(0x1b6))/0xa)+parseInt(_0x36c113(0x1b5))/0xb;if(_0x98a0d3===_0x47238d)break;else _0x4d095c['push'](_0x4d095c['shift']());}catch(_0x961efb){_0x4d095c['push'](_0x4d095c['shift']());}}}(_0x4fa8,0x44fa9));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x27066b,_0x2435aa,_0x180203,_0x1e4e6f){if(_0x1e4e6f===undefined)_0x1e4e6f=_0x180203;var _0x468702=Object['getOwnPropertyDescriptor'](_0x2435aa,_0x180203);(!_0x468702||('get'in _0x468702?!_0x2435aa['__esModule']:_0x468702['writable']||_0x468702['configurable']))&&(_0x468702={'enumerable':!![],'get':function(){return _0x2435aa[_0x180203];}}),Object['defineProperty'](_0x27066b,_0x1e4e6f,_0x468702);}:function(_0x361efa,_0x48aa32,_0x399193,_0x594d48){if(_0x594d48===undefined)_0x594d48=_0x399193;_0x361efa[_0x594d48]=_0x48aa32[_0x399193];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x264c89,_0x1cad0b){Object['defineProperty'](_0x264c89,'default',{'enumerable':!![],'value':_0x1cad0b});}:function(_0x250bd0,_0x8373db){_0x250bd0['default']=_0x8373db;}),__importStar=this&&this['__importStar']||function(_0x7c4ab0){if(_0x7c4ab0&&_0x7c4ab0['__esModule'])return _0x7c4ab0;var _0xddff96={};if(_0x7c4ab0!=null){for(var _0x10fde0 in _0x7c4ab0)if(_0x10fde0!=='default'&&Object['prototype']['hasOwnProperty']['call'](_0x7c4ab0,_0x10fde0))__createBinding(_0xddff96,_0x7c4ab0,_0x10fde0);}return __setModuleDefault(_0xddff96,_0x7c4ab0),_0xddff96;},__importDefault=this&&this['__importDefault']||function(_0x185aac){return _0x185aac&&_0x185aac['__esModule']?_0x185aac:{'default':_0x185aac};};function _0x4fa8(){const _0x10ccb8=['2612643EgzAgM','2634830JTaxYq','19383JaACds','263529ZmQsxH','872hKdFtO','870495vTJOPC','1008606TaPiuT','9NmBffT','2041484fxVwEd','6UJFdrU','3QCffuF'];_0x4fa8=function(){return _0x10ccb8;};return _0x4fa8();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CompilerService']=void 0x0;function _0x58df(_0x5bc879,_0x1935ad){const _0x4fa898=_0x4fa8();return _0x58df=function(_0x58df00,_0x40c98f){_0x58df00=_0x58df00-0x1b0;let _0xd1e2d4=_0x4fa898[_0x58df00];return _0xd1e2d4;},_0x58df(_0x5bc879,_0x1935ad);}const fs=__importStar(require('fs/promises')),path=__importStar(require('path')),json_schema_ref_parser_1=__importDefault(require('@apidevtools/json-schema-ref-parser')),js_yaml_1=__importDefault(require('js-yaml')),deployer_1=require('./deployer'),validator_1=require('./validator');class CompilerService{constructor(_0x2df73d,_0x20cc5b,_0x270754){this['store']=_0x2df73d,this['stream']=_0x20cc5b,this['logger']=_0x270754;}async['plan'](_0x54d037){try{let _0x3dd682;this['isPath'](_0x54d037)?_0x3dd682=await json_schema_ref_parser_1['default']['dereference'](_0x54d037):_0x3dd682=js_yaml_1['default']['load'](_0x54d037);const _0x3813c6=new validator_1['Validator'](_0x3dd682);return _0x3813c6['validate'](this['store']),_0x3dd682;}catch(_0x43be54){this['logger']['error']('compiler-plan-error',_0x43be54);}}['isPath'](_0x5a0346){return!_0x5a0346['trim']()['startsWith']('app:');}async['deploy'](_0x59020d){try{let _0x30ea11;this['isPath'](_0x59020d)?(_0x30ea11=await json_schema_ref_parser_1['default']['dereference'](_0x59020d),await this['saveAsJSON'](_0x59020d,_0x30ea11)):_0x30ea11=js_yaml_1['default']['load'](_0x59020d);const _0x1e1df2=new validator_1['Validator'](_0x30ea11);_0x1e1df2['validate'](this['store']);const _0x7361f1=new deployer_1['Deployer'](_0x30ea11);return await _0x7361f1['deploy'](this['store'],this['stream']),await this['store']['setApp'](_0x30ea11['app']['id'],_0x30ea11['app']['version']),_0x30ea11;}catch(_0xcc92b0){this['logger']['error']('compiler-deploy-error',_0xcc92b0);}}async['activate'](_0x44a04b,_0x2b2f02){return await this['store']['activateAppVersion'](_0x44a04b,_0x2b2f02);}async['saveAsJSON'](_0x8715c6,_0x9e5f1b){const _0x179187=JSON['stringify'](_0x9e5f1b,null,0x2),_0x420eb2=path['join'](path['dirname'](_0x8715c6),'.hotmesh.'+_0x9e5f1b['app']['id']+'.'+_0x9e5f1b['app']['version']+'.json');await fs['writeFile'](_0x420eb2,_0x179187,'utf8');}}exports['CompilerService']=CompilerService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x222b97,_0x51c1ef){const _0x129f4c=_0x5d24,_0xc3a342=_0x222b97();while(!![]){try{const _0x506f31=-parseInt(_0x129f4c(0x115))/0x1+parseInt(_0x129f4c(0x119))/0x2*(parseInt(_0x129f4c(0x118))/0x3)+-parseInt(_0x129f4c(0x112))/0x4+parseInt(_0x129f4c(0x113))/0x5+parseInt(_0x129f4c(0x116))/0x6*(parseInt(_0x129f4c(0x117))/0x7)+-parseInt(_0x129f4c(0x114))/0x8+parseInt(_0x129f4c(0x11a))/0x9;if(_0x506f31===_0x51c1ef)break;else _0xc3a342['push'](_0xc3a342['shift']());}catch(_0x343042){_0xc3a342['push'](_0xc3a342['shift']());}}}(_0x5d5d,0xec194));function _0x5d24(_0x7f7cd9,_0x302488){const _0x5d5d3a=_0x5d5d();return _0x5d24=function(_0x5d24ed,_0x48d396){_0x5d24ed=_0x5d24ed-0x112;let _0x31664e=_0x5d5d3a[_0x5d24ed];return _0x31664e;},_0x5d24(_0x7f7cd9,_0x302488);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Validator']=void 0x0;const pipe_1=require('../pipe');class Validator{constructor(_0x1ede52){this['manifest']=null,this['activityIds']=[],this['mappingStatements']={},this['store']=null,this['manifest']=_0x1ede52;}async['validate'](_0x4947bd){this['store']=_0x4947bd,this['getMappingStatements'](),this['validateActivityIds'](),this['validateReferencedActivityIds'](),this['validateMappingStatements'](),this['validateTransitions'](),this['validateTransitionConditions'](),this['validateStats'](),this['validateSchemas'](),this['validateUniqueHandledTopics'](),this['validateGraphPublishSubscribe'](),this['validateHooks'](),this['validateConditionalStatements']();}['validateActivityIds'](){const _0x27f20e=new Set();this['manifest']['app']['graphs']['forEach'](_0x27d198=>{const _0x376a9a=Object['keys'](_0x27d198['activities']);_0x376a9a['forEach'](_0x15893e=>{if(_0x27f20e['has'](_0x15893e))throw new Error('Duplicate\x20activity\x20id\x20found:\x20'+_0x15893e);else _0x27f20e['add'](_0x15893e);});}),this['activityIds']=Array['from'](_0x27f20e);}['isMappingStatement'](_0x2bf6e4){return typeof _0x2bf6e4==='string'&&_0x2bf6e4['startsWith']('{')&&_0x2bf6e4['endsWith']('}');}['extractMappingStatements'](_0x550cbc,_0x3d7bf2,_0x58ca1a){for(const _0x121210 in _0x550cbc){if(typeof _0x550cbc[_0x121210]==='object'&&_0x550cbc[_0x121210]!==null)this['extractMappingStatements'](_0x550cbc[_0x121210],_0x3d7bf2,_0x58ca1a);else this['isMappingStatement'](_0x550cbc[_0x121210])&&(!_0x3d7bf2[_0x58ca1a]&&(_0x3d7bf2[_0x58ca1a]=[]),_0x3d7bf2[_0x58ca1a]['push'](_0x550cbc[_0x121210]));}}['getMappingStatements'](){const _0x4bbc7e={};this['manifest']['app']['graphs']['forEach'](_0x49e6bd=>{const _0xb755f8=_0x49e6bd['activities'];for(const _0x5cdf2c in _0xb755f8){const _0x435135=_0xb755f8[_0x5cdf2c];this['extractMappingStatements'](_0x435135,_0x4bbc7e,_0x5cdf2c);}}),this['mappingStatements']=_0x4bbc7e;}['validateReferencedActivityIds'](){const _0x1d01cd=this['mappingStatements'],_0xb824ae=this['activityIds'];for(const _0x3fea0a in _0x1d01cd){const _0x57d2ea=_0x1d01cd[_0x3fea0a];_0x57d2ea['forEach'](_0x16d679=>{if(_0x16d679['startsWith']('{')&&_0x16d679['endsWith']('}')){const _0x1742d2=_0x16d679['slice'](0x1,-0x1)['split']('.'),_0x398fc8=_0x1742d2[0x0];if(!(Validator['SYS_VARS']['includes'](_0x398fc8)||_0xb824ae['includes'](_0x398fc8)||this['isFunction'](_0x16d679)||this['isContextVariable'](_0x16d679)))throw new Error('Mapping\x20statement\x20references\x20non-existent\x20activity:\x20'+_0x16d679);}});}}['isFunction'](_0x47423b){return _0x47423b['startsWith']('{@')&&pipe_1['Pipe']['resolveFunction'](_0x47423b);}['isContextVariable'](_0x5d188d){return['{$input}','{$output}','{$item}','{$key}','{$index}']['includes'](_0x5d188d);}['validateMappingStatements'](){}['validateTransitions'](){}['validateTransitionConditions'](){}['validateStats'](){}['validateSchemas'](){}['validateUniqueHandledTopics'](){}['validateGraphPublishSubscribe'](){}['validateHooks'](){}['validateConditionalStatements'](){}}function _0x5d5d(){const _0x3953f2=['7166130LaMOJW','14728600FJIfOF','801015GkdRAF','648402UxIcty','91EZdyyX','299247mwHKDf','2mWcZyA','11377773LtbufZ','2371572OuvGdr'];_0x5d5d=function(){return _0x3953f2;};return _0x5d5d();}exports['Validator']=Validator,Validator['SYS_VARS']=['$app','$self','$graph','$job'],Validator['CONTEXT_VARS']=['{$input}','{$output}','{$item}','{$key}','{$index}'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0xc306b2,_0xc01fed){const _0x3b7bf8=_0x26e6,_0x427002=_0xc306b2();while(!![]){try{const _0x4db61e=parseInt(_0x3b7bf8(0x1a4))/0x1+-parseInt(_0x3b7bf8(0x1ac))/0x2+-parseInt(_0x3b7bf8(0x1a5))/0x3*(-parseInt(_0x3b7bf8(0x1ae))/0x4)+-parseInt(_0x3b7bf8(0x1ad))/0x5+-parseInt(_0x3b7bf8(0x1ab))/0x6*(-parseInt(_0x3b7bf8(0x1a6))/0x7)+parseInt(_0x3b7bf8(0x1aa))/0x8*(-parseInt(_0x3b7bf8(0x1a9))/0x9)+parseInt(_0x3b7bf8(0x1a8))/0xa*(parseInt(_0x3b7bf8(0x1a7))/0xb);if(_0x4db61e===_0xc01fed)break;else _0x427002['push'](_0x427002['shift']());}catch(_0x4b5319){_0x427002['push'](_0x427002['shift']());}}}(_0x39bf,0x338fa));var __importDefault=this&&this['__importDefault']||function(_0x35fd62){return _0x35fd62&&_0x35fd62['__esModule']?_0x35fd62:{'default':_0x35fd62};};function _0x39bf(){const _0x8f1e9e=['6mEbbtr','33936Hagiah','418660uTPqEQ','156rArDiJ','103883BfTtin','1488YhddvA','2898931kcmDWS','44143tceIbw','460JPnqsv','922644NETtgQ','32hsrLdj'];_0x39bf=function(){return _0x8f1e9e;};return _0x39bf();}function _0x26e6(_0x2ae416,_0x2bebe9){const _0x39bfdb=_0x39bf();return _0x26e6=function(_0x26e603,_0x2ce163){_0x26e603=_0x26e603-0x1a4;let _0x4e68ec=_0x39bfdb[_0x26e603];return _0x4e68ec;},_0x26e6(_0x2ae416,_0x2bebe9);}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'](_0x4ffcc7,_0x46401c,_0x1b1612,_0x906b9b,_0x10468f){if(_0x906b9b['engine']){const _0x53984e=new EngineService();_0x53984e['verifyEngineFields'](_0x906b9b),_0x53984e['namespace']=_0x4ffcc7,_0x53984e['appId']=_0x46401c,_0x53984e['guid']=_0x1b1612,_0x53984e['logger']=_0x10468f,await _0x53984e['initSearchChannel'](_0x906b9b['engine']['store']),await _0x53984e['initStoreChannel'](_0x906b9b['engine']['store']),await _0x53984e['initSubChannel'](_0x906b9b['engine']['sub'],_0x906b9b['engine']['pub']),await _0x53984e['initStreamChannel'](_0x906b9b['engine']['stream'],_0x906b9b['engine']['store']),_0x53984e['router']=await _0x53984e['initRouter'](_0x906b9b);const _0x33b766=_0x53984e['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x53984e['appId']});return _0x53984e['router']['consumeMessages'](_0x33b766,'ENGINE',_0x53984e['guid'],_0x53984e['processStreamMessage']['bind'](_0x53984e)),_0x53984e['taskService']=new task_1['TaskService'](_0x53984e['store'],_0x10468f),_0x53984e['exporter']=new exporter_1['ExporterService'](_0x53984e['appId'],_0x53984e['store'],_0x10468f),_0x53984e['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x53984e;}}['verifyEngineFields'](_0x392216){if(!(0x0,utils_1['identifyProvider'])(_0x392216['engine']['store'])||!(0x0,utils_1['identifyProvider'])(_0x392216['engine']['stream'])||!(0x0,utils_1['identifyProvider'])(_0x392216['engine']['sub']))throw new Error('engine\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields.');}async['initSearchChannel'](_0x49fef0,_0x4e54ce){this['search']=await factory_1['SearchServiceFactory']['init'](_0x49fef0,_0x4e54ce,this['namespace'],this['appId'],this['logger']);}async['initStoreChannel'](_0x566fb7){this['store']=await factory_2['StoreServiceFactory']['init'](_0x566fb7,this['namespace'],this['appId'],this['logger']);}async['initSubChannel'](_0x44697e,_0xad1780){this['subscribe']=await factory_4['SubServiceFactory']['init'](_0x44697e,_0xad1780,this['namespace'],this['appId'],this['guid'],this['logger']);}async['initStreamChannel'](_0x1ab167,_0x28598e){this['stream']=await factory_3['StreamServiceFactory']['init'](_0x1ab167,_0x28598e,this['namespace'],this['appId'],this['logger']);}async['initRouter'](_0x48d37f){const _0x111524=await this['store']['getThrottleRate'](':');return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['ENGINE'],'reclaimDelay':_0x48d37f['engine']['reclaimDelay'],'reclaimCount':_0x48d37f['engine']['reclaimCount'],'throttle':_0x111524,'readonly':_0x48d37f['engine']['readonly']},this['stream'],this['logger']);}async['fetchAndVerifyVID'](_0x43378f,_0x17a595=0x0){if(isNaN(Number(_0x43378f['version']))){const _0x19a91b=await this['store']['getApp'](_0x43378f['id'],!![]);if(!isNaN(Number(_0x19a91b['version']))){if(!this['apps'])this['apps']={};return this['apps'][_0x43378f['id']]=_0x19a91b,{'id':_0x43378f['id'],'version':_0x19a91b['version']};}else{if(_0x17a595<0xa)return await(0x0,utils_1['sleepFor'])(enums_1['HMSH_QUORUM_DELAY_MS']*0x2),await this['fetchAndVerifyVID'](_0x43378f,_0x17a595+0x1);else this['logger']['error']('engine-vid-resolution-error',{'id':_0x43378f['id'],'guid':this['guid']});}}return _0x43378f;}async['getVID'](_0x2f5039){if(this['cacheMode']==='nocache'){const _0xafe9de=await this['store']['getApp'](this['appId'],!![]);if(_0xafe9de['version']['toString']()===this['untilVersion']['toString']()){if(!this['apps'])this['apps']={};this['apps'][this['appId']]=_0xafe9de,this['setCacheMode']('cache',_0xafe9de['version']['toString']());}return{'id':this['appId'],'version':_0xafe9de['version']};}else return!this['apps']&&_0x2f5039?(this['apps']={},this['apps'][this['appId']]=_0x2f5039,_0x2f5039):await this['fetchAndVerifyVID']({'id':this['appId'],'version':this['apps']?.[this['appId']]['version']});}['setCacheMode'](_0x12523a,_0x116f28){this['logger']['info']('engine-executable-cache',{'mode':_0x12523a,[_0x12523a==='cache'?'target':'until']:_0x116f28}),this['cacheMode']=_0x12523a,this['untilVersion']=_0x116f28;}async['routeToSubscribers'](_0x57e4b7,_0x5250a8){const _0x56b3b2=this['jobCallbacks'][_0x5250a8['metadata']['jid']];_0x56b3b2&&(this['delistJobCallback'](_0x5250a8['metadata']['jid']),_0x56b3b2(_0x57e4b7,_0x5250a8));}async['processWebHooks'](){this['taskService']['processWebHooks'](this['hook']['bind'](this));}async['processTimeHooks'](){this['taskService']['processTimeHooks'](this['hookTime']['bind'](this));}async['throttle'](_0x6e3936){try{this['router']?.['setThrottle'](_0x6e3936);}catch(_0x297726){this['logger']['error']('engine-throttle-error',{'error':_0x297726});}}async['initActivity'](_0x3a26af,_0x585389={},_0x1153a1){const [_0x2aa374,_0x166887]=await this['getSchema'](_0x3a26af),_0x54247d=activities_1['default'][utils_1['polyfill']['resolveActivityType'](_0x166887['type'])];if(_0x54247d){const _0x2602bf=(0x0,utils_1['formatISODate'])(new Date()),_0xaeee44={'aid':_0x2aa374,'atp':_0x166887['type'],'stp':_0x166887['subtype'],'ac':_0x2602bf,'au':_0x2602bf},_0x9f2e1e=null;return new _0x54247d(_0x166887,_0x585389,_0xaeee44,_0x9f2e1e,this,_0x1153a1);}else throw new Error('activity\x20type\x20'+_0x166887['type']+'\x20not\x20found');}async['getSchema'](_0x19f038){const _0x279ef3=await this['store']['getApp'](this['appId']);if(!_0x279ef3)throw new Error('no\x20app\x20found\x20for\x20id\x20'+this['appId']);if(this['isPrivate'](_0x19f038)){const _0x1ced92=_0x19f038['substring'](0x1),_0x3e9ecc=await this['store']['getSchema'](_0x1ced92,await this['getVID'](_0x279ef3));return[_0x1ced92,_0x3e9ecc];}else{const _0x30921e=await this['store']['getSubscription'](_0x19f038,await this['getVID'](_0x279ef3));if(_0x30921e){const _0x5a3488=await this['store']['getSchema'](_0x30921e,await this['getVID'](_0x279ef3));return[_0x30921e,_0x5a3488];}}throw new Error('no\x20subscription\x20found\x20for\x20topic\x20'+_0x19f038+'\x20in\x20app\x20'+this['appId']+'\x20for\x20app\x20version\x20'+_0x279ef3['version']);}async['getSettings'](){return await this['store']['getSettings']();}['isPrivate'](_0x4da3a2){return _0x4da3a2['startsWith']('.');}async['plan'](_0x598003){const _0x28582a=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x28582a['plan'](_0x598003);}async['deploy'](_0x28cf3d){const _0x2f5140=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x2f5140['deploy'](_0x28cf3d);}async['getStats'](_0x25aa4a,_0x3ca3f9){const {id:_0x1aa88d,version:_0xe4dc38}=await this['getVID'](),_0x19ed3a=new reporter_1['ReporterService']({'id':_0x1aa88d,'version':_0xe4dc38},this['store'],this['logger']),_0x4662a7=await this['resolveQuery'](_0x25aa4a,_0x3ca3f9);return await _0x19ed3a['getStats'](_0x4662a7);}async['getIds'](_0x13e212,_0x5af70c,_0x26c9d8=[]){const {id:_0x24410c,version:_0x5814f6}=await this['getVID'](),_0x364cdd=new reporter_1['ReporterService']({'id':_0x24410c,'version':_0x5814f6},this['store'],this['logger']),_0x276324=await this['resolveQuery'](_0x13e212,_0x5af70c);return await _0x364cdd['getIds'](_0x276324,_0x26c9d8);}async['resolveQuery'](_0x12d703,_0x33e0f1){const _0x4cd421=await this['initActivity'](_0x12d703,_0x33e0f1['data']);return await _0x4cd421['getState'](),{'end':_0x33e0f1['end'],'start':_0x33e0f1['start'],'range':_0x33e0f1['range'],'granularity':_0x4cd421['resolveGranularity'](),'key':_0x4cd421['resolveJobKey'](_0x4cd421['createInputContext']()),'sparse':_0x33e0f1['sparse']};}async['processStreamMessage'](_0x371b15){this['logger']['debug']('engine-process',{'jid':_0x371b15['metadata']['jid'],'gid':_0x371b15['metadata']['gid'],'dad':_0x371b15['metadata']['dad'],'aid':_0x371b15['metadata']['aid'],'status':_0x371b15['status']||stream_1['StreamStatus']['SUCCESS'],'code':_0x371b15['code']||0xc8,'type':_0x371b15['type']});const _0x25281a={'metadata':{'guid':_0x371b15['metadata']['guid'],'jid':_0x371b15['metadata']['jid'],'gid':_0x371b15['metadata']['gid'],'dad':_0x371b15['metadata']['dad'],'aid':_0x371b15['metadata']['aid']},'data':_0x371b15['data']};if(_0x371b15['type']===stream_1['StreamDataType']['TIMEHOOK']){const _0x35ad53=await this['initActivity']('.'+_0x371b15['metadata']['aid'],_0x25281a['data'],_0x25281a);await _0x35ad53['processTimeHookEvent'](_0x371b15['metadata']['jid']);}else{if(_0x371b15['type']===stream_1['StreamDataType']['WEBHOOK']){const _0x420d18=await this['initActivity']('.'+_0x371b15['metadata']['aid'],_0x25281a['data'],_0x25281a);await _0x420d18['processWebHookEvent'](_0x371b15['status'],_0x371b15['code']);}else{if(_0x371b15['type']===stream_1['StreamDataType']['TRANSITION']){const _0x5d6430=await this['initActivity']('.'+_0x371b15['metadata']['aid'],_0x25281a['data'],_0x25281a);await _0x5d6430['process']();}else{if(_0x371b15['type']===stream_1['StreamDataType']['AWAIT']){_0x25281a['metadata']={..._0x25281a['metadata'],'pj':_0x371b15['metadata']['jid'],'pg':_0x371b15['metadata']['gid'],'pd':_0x371b15['metadata']['dad'],'pa':_0x371b15['metadata']['aid'],'px':_0x371b15['metadata']['await']===![],'trc':_0x371b15['metadata']['trc'],'spn':_0x371b15['metadata']['spn']};const _0x244f1c=await this['initActivity'](_0x371b15['metadata']['topic'],_0x371b15['data'],_0x25281a);await _0x244f1c['process']();}else{if(_0x371b15['type']===stream_1['StreamDataType']['RESULT']){const _0x4a43bc=await this['initActivity']('.'+_0x25281a['metadata']['aid'],_0x371b15['data'],_0x25281a);await _0x4a43bc['processEvent'](_0x371b15['status'],_0x371b15['code']);}else{const _0x2dee7b=await this['initActivity']('.'+_0x371b15['metadata']['aid'],_0x371b15['data'],_0x25281a);await _0x2dee7b['processEvent'](_0x371b15['status'],_0x371b15['code'],'output');}}}}}this['logger']['debug']('engine-process-end',{'jid':_0x371b15['metadata']['jid'],'gid':_0x371b15['metadata']['gid'],'aid':_0x371b15['metadata']['aid']});}async['execAdjacentParent'](_0x5bcd75,_0x352ff6,_0x18ca27=![]){if(this['hasParentJob'](_0x5bcd75)){const _0x469186=this['resolveError'](_0x352ff6['metadata']),_0x1eb7d9=_0x5bcd75['$self']?.['output']?.['metadata']?.['l2s']||_0x5bcd75['$self']?.['output']?.['metadata']?.['l1s'],_0x50ad18={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x5bcd75['metadata']['pj'],'gid':_0x5bcd75['metadata']['pg'],'dad':_0x5bcd75['metadata']['pd'],'aid':_0x5bcd75['metadata']['pa'],'trc':_0x5bcd75['metadata']['trc'],'spn':_0x1eb7d9},'type':stream_1['StreamDataType']['RESULT'],'data':_0x352ff6['data']};if(_0x469186&&_0x469186['code'])_0x50ad18['status']=stream_1['StreamStatus']['ERROR'],_0x50ad18['data']=_0x469186,_0x50ad18['code']=_0x469186['code'],_0x50ad18['stack']=_0x469186['stack'];else _0x18ca27?(_0x50ad18['status']=stream_1['StreamStatus']['PENDING'],_0x50ad18['code']=enums_1['HMSH_CODE_PENDING']):(_0x50ad18['status']=stream_1['StreamStatus']['SUCCESS'],_0x50ad18['code']=enums_1['HMSH_CODE_SUCCESS']);return await this['router']?.['publishMessage'](null,_0x50ad18);}}['hasParentJob'](_0x2e110e,_0x509fda=![]){if(_0x509fda)return Boolean(_0x2e110e['metadata']['pj']&&_0x2e110e['metadata']['pa']&&!_0x2e110e['metadata']['px']);return Boolean(_0x2e110e['metadata']['pj']&&_0x2e110e['metadata']['pa']);}['resolveError'](_0x212288){if(_0x212288&&_0x212288['err'])return JSON['parse'](_0x212288['err']);}async['interrupt'](_0x398f3b,_0x28fec1,_0x1ce185={}){await this['store']['interrupt'](_0x398f3b,_0x28fec1,_0x1ce185);const _0x254b8d=await this['getState'](_0x398f3b,_0x28fec1),_0x1a7cde={'interrupt':_0x1ce185['descend'],'expire':_0x1ce185['expire']};return await this['runJobCompletionTasks'](_0x254b8d,_0x1a7cde);}async['scrub'](_0xd48d85){await this['store']['scrub'](_0xd48d85);}async['hook'](_0x1a6a8a,_0x333497,_0x5ccc20=stream_1['StreamStatus']['SUCCESS'],_0x3e3a65=0xc8){const _0x176c22=await this['taskService']['getHookRule'](_0x1a6a8a),[_0x2dede2]=await this['getSchema']('.'+_0x176c22['to']),_0x968e66={'type':stream_1['StreamDataType']['WEBHOOK'],'status':_0x5ccc20,'code':_0x3e3a65,'metadata':{'guid':(0x0,utils_1['guid'])(),'aid':_0x2dede2,'topic':_0x1a6a8a},'data':_0x333497};return await this['router']?.['publishMessage'](null,_0x968e66);}async['hookTime'](_0x352e10,_0x26e872,_0x203276,_0x215a6e){if(_0x215a6e==='interrupt'||_0x215a6e==='expire')return await this['interrupt'](_0x203276,_0x352e10,{'suppress':!![],'expire':0x1});const [_0x2fb840,..._0x644c32]=_0x203276['split'](','),_0x4d6f6e=','+_0x644c32['join'](','),_0xe14dc6={'type':stream_1['StreamDataType']['TIMEHOOK'],'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x352e10,'gid':_0x26e872,'dad':_0x4d6f6e,'aid':_0x2fb840},'data':{'timestamp':Date['now']()}};await this['router']?.['publishMessage'](null,_0xe14dc6);}async['hookAll'](_0x78136c,_0x380231,_0x4422ce,_0x2a937b=[]){const _0x91b25c=await this['getVID'](),_0x4bea2f=await this['taskService']['getHookRule'](_0x78136c);if(_0x4bea2f){const _0x543769=await(0x0,utils_1['getSubscriptionTopic'])(_0x4bea2f['to'],this['store'],_0x91b25c),_0x5a65c1=await this['resolveQuery'](_0x543769,_0x4422ce),_0x3ac9cf=new reporter_1['ReporterService'](_0x91b25c,this['store'],this['logger']),_0x19bfcf=await _0x3ac9cf['getWorkItems'](_0x5a65c1,_0x2a937b);if(_0x19bfcf['length']){const _0x5e43a3=new task_1['TaskService'](this['store'],this['logger']);await _0x5e43a3['enqueueWorkItems'](_0x19bfcf['map'](_0x9a513=>[_0x78136c,_0x9a513,_0x4422ce['scrub']||![],JSON['stringify'](_0x380231)]['join'](key_1['VALSEP']))),this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'work','originator':this['guid']},this['appId']);}return _0x19bfcf;}else throw new Error('unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20'+_0x78136c);}async['pub'](_0x1fdd40,_0xbb5ee6,_0xd1f1c0,_0x424fc6){const _0x26e929=await this['initActivity'](_0x1fdd40,_0xbb5ee6,_0xd1f1c0);if(_0x26e929)return await _0x26e929['process'](_0x424fc6);else throw new Error('unable\x20to\x20process\x20activity\x20for\x20topic\x20'+_0x1fdd40);}async['sub'](_0x3616f2,_0x1ea009){const _0x8bb984=async(_0x21d1b7,_0x1865f5)=>{_0x1ea009(_0x1865f5['topic'],_0x1865f5['job']);};return await this['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x8bb984,this['appId'],_0x3616f2);}async['unsub'](_0xe0dee6){return await this['subscribe']['unsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0xe0dee6);}async['psub'](_0x49a451,_0x2801c7){const _0x40e0e5=async(_0x39ecbf,_0x35249f)=>{_0x2801c7(_0x35249f['topic'],_0x35249f['job']);};return await this['subscribe']['psubscribe'](key_1['KeyType']['QUORUM'],_0x40e0e5,this['appId'],_0x49a451);}async['punsub'](_0x2d291f){return await this['subscribe']['punsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x2d291f);}async['pubsub'](_0x19f0da,_0x3c03e5,_0xe2327e,_0x2ef3be=enums_1['HMSH_OTT_WAIT_TIME']){_0xe2327e={'metadata':{'ngn':this['guid'],'trc':_0xe2327e?.['metadata']?.['trc'],'spn':_0xe2327e?.['metadata']?.['spn']}};const _0x35362c=await this['pub'](_0x19f0da,_0x3c03e5,_0xe2327e);return new Promise((_0x4879d3,_0x4dec13)=>{this['registerJobCallback'](_0x35362c,(_0x489b22,_0x5431a4)=>{if(_0x5431a4['metadata']['err']){const _0x271171=JSON['parse'](_0x5431a4['metadata']['err']);_0x4dec13({..._0x271171,'job_id':_0x5431a4['metadata']['jid']});}else _0x4879d3(_0x5431a4);}),setTimeout(()=>{this['delistJobCallback'](_0x35362c),_0x4dec13({'code':enums_1['HMSH_CODE_TIMEOUT'],'message':'timeout','job_id':_0x35362c});},_0x2ef3be);});}async['pubOneTimeSubs'](_0xafa197,_0x581d56,_0xcfbd06=![]){if(this['hasOneTimeSubscription'](_0xafa197)){const _0x37b4d8={'type':'job','topic':_0xafa197['metadata']['jid'],'job':(0x0,utils_1['restoreHierarchy'])(_0x581d56)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x37b4d8,this['appId'],_0xafa197['metadata']['ngn']);}}async['getPublishesTopic'](_0x1e68d3){const _0x2036e8=await this['getVID'](),_0x165f06=_0x1e68d3['metadata']['aid']||_0x1e68d3['$self']?.['output']?.['metadata']?.['aid'],_0xbd4e8d=await this['store']['getSchema'](_0x165f06,_0x2036e8);return _0xbd4e8d['publishes'];}async['pubPermSubs'](_0x4b71f9,_0x38fc8f,_0x169ad5=![]){const _0x17208e=await this['getPublishesTopic'](_0x4b71f9);if(_0x17208e){const _0x11bed7={'type':'job','topic':_0x17208e,'job':(0x0,utils_1['restoreHierarchy'])(_0x38fc8f)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x11bed7,this['appId'],_0x17208e+'.'+_0x4b71f9['metadata']['jid']);}}async['add'](_0x3ddaa5){return await this['router']?.['publishMessage'](null,_0x3ddaa5);}['registerJobCallback'](_0x5dc6d1,_0xf07d50){this['jobCallbacks'][_0x5dc6d1]=_0xf07d50;}['delistJobCallback'](_0x3969b3){delete this['jobCallbacks'][_0x3969b3];}['hasOneTimeSubscription'](_0x5b0c5e){return Boolean(_0x5b0c5e['metadata']['ngn']);}async['runJobCompletionTasks'](_0x574ee4,_0x9fc0d7={}){const _0x584215=this['hasParentJob'](_0x574ee4,!![]),_0x2fe48e=this['hasOneTimeSubscription'](_0x574ee4),_0x141c1f=await this['getPublishesTopic'](_0x574ee4);let _0x1997b0;if(_0x584215||_0x2fe48e||_0x141c1f){const _0x2942b8=await this['getState'](_0x574ee4['metadata']['tpc'],_0x574ee4['metadata']['jid']);_0x1997b0=await this['execAdjacentParent'](_0x574ee4,_0x2942b8,_0x9fc0d7['emit']),this['pubOneTimeSubs'](_0x574ee4,_0x2942b8,_0x9fc0d7['emit']),this['pubPermSubs'](_0x574ee4,_0x2942b8,_0x9fc0d7['emit']);}return!_0x9fc0d7['emit']&&this['taskService']['registerJobForCleanup'](_0x574ee4['metadata']['jid'],this['resolveExpires'](_0x574ee4,_0x9fc0d7),_0x9fc0d7),_0x1997b0;}['resolveExpires'](_0x27f594,_0x1365b7){return _0x1365b7['expire']??_0x27f594['metadata']['expire']??enums_1['HMSH_EXPIRE_JOB_SECONDS'];}async['export'](_0x5169fc){return await this['exporter']['export'](_0x5169fc);}async['getRaw'](_0x56a8ad){return await this['store']['getRaw'](_0x56a8ad);}async['getStatus'](_0x3b873c){const {id:_0xc232c}=await this['getVID']();return await this['store']['getStatus'](_0x3b873c,_0xc232c);}async['getState'](_0x26a63e,_0x4cb928){const _0x3dc893=await this['store']['getSymbols']('$'+_0x26a63e),_0x3e08e0={['$'+_0x26a63e]:Object['keys'](_0x3dc893)},_0x1becdd={},_0x3a9002=await this['store']['getState'](_0x4cb928,_0x3e08e0,_0x1becdd);if(!_0x3a9002)throw new Error('not\x20found\x20'+_0x4cb928);const [_0x1c54e9,_0x1a4eaf]=_0x3a9002,_0xc32f71=(0x0,utils_1['restoreHierarchy'])(_0x1c54e9);return _0x1a4eaf&&_0xc32f71['metadata']&&(_0xc32f71['metadata']['js']=_0x1a4eaf),_0xc32f71;}async['getQueryState'](_0x2bfbbb,_0x198cee){return await this['store']['getQueryState'](_0x2bfbbb,_0x198cee);}async['compress'](_0x12f379){const _0x736c36=await this['store']['getSymbolValues'](),_0xc7747d=Object['keys'](_0x736c36)['length'],_0x261abb=Math['pow'](0x34,0x2)-0x1,_0x3a5984=serializer_1['SerializerService']['filterSymVals'](_0xc7747d,_0x261abb,_0x736c36,new Set(_0x12f379));return await this['store']['addSymbolValues'](_0x3a5984);}}exports['EngineService']=EngineService;
|
|
1
|
+
'use strict';(function(_0x9f30c3,_0xe2ff30){const _0x34169e=_0xd2fb,_0x4b6820=_0x9f30c3();while(!![]){try{const _0x35a5bf=parseInt(_0x34169e(0x16a))/0x1+-parseInt(_0x34169e(0x16b))/0x2+parseInt(_0x34169e(0x16c))/0x3*(parseInt(_0x34169e(0x166))/0x4)+-parseInt(_0x34169e(0x169))/0x5+parseInt(_0x34169e(0x168))/0x6*(parseInt(_0x34169e(0x16e))/0x7)+-parseInt(_0x34169e(0x165))/0x8*(-parseInt(_0x34169e(0x16d))/0x9)+parseInt(_0x34169e(0x16f))/0xa*(-parseInt(_0x34169e(0x167))/0xb);if(_0x35a5bf===_0xe2ff30)break;else _0x4b6820['push'](_0x4b6820['shift']());}catch(_0x246ecd){_0x4b6820['push'](_0x4b6820['shift']());}}}(_0x149c,0x43ed2));function _0xd2fb(_0x18ac19,_0x3a55b7){const _0x149c93=_0x149c();return _0xd2fb=function(_0xd2fb4,_0x12bb72){_0xd2fb4=_0xd2fb4-0x165;let _0x114bf5=_0x149c93[_0xd2fb4];return _0x114bf5;},_0xd2fb(_0x18ac19,_0x3a55b7);}function _0x149c(){const _0x14a8ec=['1792053QXYLUw','248563nbfPti','92490qxtuas','8fgNNPc','923384LRczRg','22VctSub','30bdUoTX','1073980IXMrGu','153366bIoQKQ','960400lsBnJK','6yIJDkI'];_0x149c=function(){return _0x14a8ec;};return _0x149c();}var __importDefault=this&&this['__importDefault']||function(_0xd59d7e){return _0xd59d7e&&_0xd59d7e['__esModule']?_0xd59d7e:{'default':_0xd59d7e};};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'](_0x193ffe,_0x5d6a5c,_0x25096a,_0x543965,_0x3d1a93){if(_0x543965['engine']){const _0x185b89=new EngineService();_0x185b89['verifyEngineFields'](_0x543965),_0x185b89['namespace']=_0x193ffe,_0x185b89['appId']=_0x5d6a5c,_0x185b89['guid']=_0x25096a,_0x185b89['logger']=_0x3d1a93,await _0x185b89['initSearchChannel'](_0x543965['engine']['store']),await _0x185b89['initStoreChannel'](_0x543965['engine']['store']),await _0x185b89['initSubChannel'](_0x543965['engine']['sub'],_0x543965['engine']['pub']),await _0x185b89['initStreamChannel'](_0x543965['engine']['stream'],_0x543965['engine']['store']),_0x185b89['router']=await _0x185b89['initRouter'](_0x543965);const _0x535f8e=_0x185b89['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x185b89['appId']});return _0x185b89['router']['consumeMessages'](_0x535f8e,'ENGINE',_0x185b89['guid'],_0x185b89['processStreamMessage']['bind'](_0x185b89)),_0x185b89['taskService']=new task_1['TaskService'](_0x185b89['store'],_0x3d1a93),_0x185b89['exporter']=new exporter_1['ExporterService'](_0x185b89['appId'],_0x185b89['store'],_0x3d1a93),_0x185b89['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x185b89;}}['verifyEngineFields'](_0x32000d){if(!(0x0,utils_1['identifyProvider'])(_0x32000d['engine']['store'])||!(0x0,utils_1['identifyProvider'])(_0x32000d['engine']['stream'])||!(0x0,utils_1['identifyProvider'])(_0x32000d['engine']['sub']))throw new Error('engine\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields.');}async['initSearchChannel'](_0xce00da,_0x222fdb){this['search']=await factory_1['SearchServiceFactory']['init'](_0xce00da,_0x222fdb,this['namespace'],this['appId'],this['logger']);}async['initStoreChannel'](_0x3a05bc){this['store']=await factory_2['StoreServiceFactory']['init'](_0x3a05bc,this['namespace'],this['appId'],this['logger']);}async['initSubChannel'](_0x451d68,_0x21fbc1){this['subscribe']=await factory_4['SubServiceFactory']['init'](_0x451d68,_0x21fbc1,this['namespace'],this['appId'],this['guid'],this['logger']);}async['initStreamChannel'](_0x363606,_0x40e875){this['stream']=await factory_3['StreamServiceFactory']['init'](_0x363606,_0x40e875,this['namespace'],this['appId'],this['logger']);}async['initRouter'](_0x2b9b30){const _0x131755=await this['store']['getThrottleRate'](':');return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['ENGINE'],'reclaimDelay':_0x2b9b30['engine']['reclaimDelay'],'reclaimCount':_0x2b9b30['engine']['reclaimCount'],'throttle':_0x131755,'readonly':_0x2b9b30['engine']['readonly']},this['stream'],this['logger']);}async['fetchAndVerifyVID'](_0xe2b4e0,_0x1fb71e=0x0){if(isNaN(Number(_0xe2b4e0['version']))){const _0xba507a=await this['store']['getApp'](_0xe2b4e0['id'],!![]);if(!isNaN(Number(_0xba507a['version']))){if(!this['apps'])this['apps']={};return this['apps'][_0xe2b4e0['id']]=_0xba507a,{'id':_0xe2b4e0['id'],'version':_0xba507a['version']};}else{if(_0x1fb71e<0xa)return await(0x0,utils_1['sleepFor'])(enums_1['HMSH_QUORUM_DELAY_MS']*0x2),await this['fetchAndVerifyVID'](_0xe2b4e0,_0x1fb71e+0x1);else this['logger']['error']('engine-vid-resolution-error',{'id':_0xe2b4e0['id'],'guid':this['guid']});}}return _0xe2b4e0;}async['getVID'](_0x45e0ea){if(this['cacheMode']==='nocache'){const _0x109571=await this['store']['getApp'](this['appId'],!![]);if(_0x109571['version']['toString']()===this['untilVersion']['toString']()){if(!this['apps'])this['apps']={};this['apps'][this['appId']]=_0x109571,this['setCacheMode']('cache',_0x109571['version']['toString']());}return{'id':this['appId'],'version':_0x109571['version']};}else return!this['apps']&&_0x45e0ea?(this['apps']={},this['apps'][this['appId']]=_0x45e0ea,_0x45e0ea):await this['fetchAndVerifyVID']({'id':this['appId'],'version':this['apps']?.[this['appId']]['version']});}['setCacheMode'](_0x634579,_0xb5dea0){this['logger']['info']('engine-executable-cache',{'mode':_0x634579,[_0x634579==='cache'?'target':'until']:_0xb5dea0}),this['cacheMode']=_0x634579,this['untilVersion']=_0xb5dea0;}async['routeToSubscribers'](_0x2548ec,_0x5c1cec){const _0x39bd8c=this['jobCallbacks'][_0x5c1cec['metadata']['jid']];_0x39bd8c&&(this['delistJobCallback'](_0x5c1cec['metadata']['jid']),_0x39bd8c(_0x2548ec,_0x5c1cec));}async['processWebHooks'](){this['taskService']['processWebHooks'](this['hook']['bind'](this));}async['processTimeHooks'](){this['taskService']['processTimeHooks'](this['hookTime']['bind'](this));}async['throttle'](_0x5c4906){try{this['router']?.['setThrottle'](_0x5c4906);}catch(_0x480b57){this['logger']['error']('engine-throttle-error',{'error':_0x480b57});}}async['initActivity'](_0x5eb721,_0x1731cc={},_0x4b905f){const [_0x22b1de,_0x1cdc92]=await this['getSchema'](_0x5eb721),_0x4a4c9d=activities_1['default'][utils_1['polyfill']['resolveActivityType'](_0x1cdc92['type'])];if(_0x4a4c9d){const _0x1bb23b=(0x0,utils_1['formatISODate'])(new Date()),_0x4ed45c={'aid':_0x22b1de,'atp':_0x1cdc92['type'],'stp':_0x1cdc92['subtype'],'ac':_0x1bb23b,'au':_0x1bb23b},_0x294d1a=null;return new _0x4a4c9d(_0x1cdc92,_0x1731cc,_0x4ed45c,_0x294d1a,this,_0x4b905f);}else throw new Error('activity\x20type\x20'+_0x1cdc92['type']+'\x20not\x20found');}async['getSchema'](_0x48f29c){const _0x5cab26=await this['store']['getApp'](this['appId']);if(!_0x5cab26)throw new Error('no\x20app\x20found\x20for\x20id\x20'+this['appId']);if(this['isPrivate'](_0x48f29c)){const _0x26c245=_0x48f29c['substring'](0x1),_0x5ea095=await this['store']['getSchema'](_0x26c245,await this['getVID'](_0x5cab26));return[_0x26c245,_0x5ea095];}else{const _0x500ed3=await this['store']['getSubscription'](_0x48f29c,await this['getVID'](_0x5cab26));if(_0x500ed3){const _0x201638=await this['store']['getSchema'](_0x500ed3,await this['getVID'](_0x5cab26));return[_0x500ed3,_0x201638];}}throw new Error('no\x20subscription\x20found\x20for\x20topic\x20'+_0x48f29c+'\x20in\x20app\x20'+this['appId']+'\x20for\x20app\x20version\x20'+_0x5cab26['version']);}async['getSettings'](){return await this['store']['getSettings']();}['isPrivate'](_0xc9f6a9){return _0xc9f6a9['startsWith']('.');}async['plan'](_0x46a1be){const _0x3c92c1=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x3c92c1['plan'](_0x46a1be);}async['deploy'](_0x36d22d){const _0x5d4233=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x5d4233['deploy'](_0x36d22d);}async['getStats'](_0x2ec0d5,_0x9af69){const {id:_0x24a536,version:_0x2f1a90}=await this['getVID'](),_0x1fa64c=new reporter_1['ReporterService']({'id':_0x24a536,'version':_0x2f1a90},this['store'],this['logger']),_0x210b4d=await this['resolveQuery'](_0x2ec0d5,_0x9af69);return await _0x1fa64c['getStats'](_0x210b4d);}async['getIds'](_0x33a4e7,_0x454810,_0x35d6af=[]){const {id:_0x512e2f,version:_0xa3d2aa}=await this['getVID'](),_0x3a74d9=new reporter_1['ReporterService']({'id':_0x512e2f,'version':_0xa3d2aa},this['store'],this['logger']),_0x31818a=await this['resolveQuery'](_0x33a4e7,_0x454810);return await _0x3a74d9['getIds'](_0x31818a,_0x35d6af);}async['resolveQuery'](_0x44fe16,_0x3bc1ca){const _0x5aa760=await this['initActivity'](_0x44fe16,_0x3bc1ca['data']);return await _0x5aa760['getState'](),{'end':_0x3bc1ca['end'],'start':_0x3bc1ca['start'],'range':_0x3bc1ca['range'],'granularity':_0x5aa760['resolveGranularity'](),'key':_0x5aa760['resolveJobKey'](_0x5aa760['createInputContext']()),'sparse':_0x3bc1ca['sparse']};}async['processStreamMessage'](_0x1b9e1b){this['logger']['debug']('engine-process',{'jid':_0x1b9e1b['metadata']['jid'],'gid':_0x1b9e1b['metadata']['gid'],'dad':_0x1b9e1b['metadata']['dad'],'aid':_0x1b9e1b['metadata']['aid'],'status':_0x1b9e1b['status']||stream_1['StreamStatus']['SUCCESS'],'code':_0x1b9e1b['code']||0xc8,'type':_0x1b9e1b['type']});const _0x306368={'metadata':{'guid':_0x1b9e1b['metadata']['guid'],'jid':_0x1b9e1b['metadata']['jid'],'gid':_0x1b9e1b['metadata']['gid'],'dad':_0x1b9e1b['metadata']['dad'],'aid':_0x1b9e1b['metadata']['aid']},'data':_0x1b9e1b['data']};if(_0x1b9e1b['type']===stream_1['StreamDataType']['TIMEHOOK']){const _0x1e64b3=await this['initActivity']('.'+_0x1b9e1b['metadata']['aid'],_0x306368['data'],_0x306368);await _0x1e64b3['processTimeHookEvent'](_0x1b9e1b['metadata']['jid']);}else{if(_0x1b9e1b['type']===stream_1['StreamDataType']['WEBHOOK']){const _0x3dceae=await this['initActivity']('.'+_0x1b9e1b['metadata']['aid'],_0x306368['data'],_0x306368);await _0x3dceae['processWebHookEvent'](_0x1b9e1b['status'],_0x1b9e1b['code']);}else{if(_0x1b9e1b['type']===stream_1['StreamDataType']['TRANSITION']){const _0x2572ef=await this['initActivity']('.'+_0x1b9e1b['metadata']['aid'],_0x306368['data'],_0x306368);await _0x2572ef['process']();}else{if(_0x1b9e1b['type']===stream_1['StreamDataType']['AWAIT']){_0x306368['metadata']={..._0x306368['metadata'],'pj':_0x1b9e1b['metadata']['jid'],'pg':_0x1b9e1b['metadata']['gid'],'pd':_0x1b9e1b['metadata']['dad'],'pa':_0x1b9e1b['metadata']['aid'],'px':_0x1b9e1b['metadata']['await']===![],'trc':_0x1b9e1b['metadata']['trc'],'spn':_0x1b9e1b['metadata']['spn']};const _0x48a76a=await this['initActivity'](_0x1b9e1b['metadata']['topic'],_0x1b9e1b['data'],_0x306368);await _0x48a76a['process']();}else{if(_0x1b9e1b['type']===stream_1['StreamDataType']['RESULT']){const _0x5bb35c=await this['initActivity']('.'+_0x306368['metadata']['aid'],_0x1b9e1b['data'],_0x306368);await _0x5bb35c['processEvent'](_0x1b9e1b['status'],_0x1b9e1b['code']);}else{const _0x1a93e1=await this['initActivity']('.'+_0x1b9e1b['metadata']['aid'],_0x1b9e1b['data'],_0x306368);await _0x1a93e1['processEvent'](_0x1b9e1b['status'],_0x1b9e1b['code'],'output');}}}}}this['logger']['debug']('engine-process-end',{'jid':_0x1b9e1b['metadata']['jid'],'gid':_0x1b9e1b['metadata']['gid'],'aid':_0x1b9e1b['metadata']['aid']});}async['execAdjacentParent'](_0x1e6f00,_0x5e9a69,_0x5dded8=![]){if(this['hasParentJob'](_0x1e6f00)){const _0x1d2730=this['resolveError'](_0x5e9a69['metadata']),_0x350310=_0x1e6f00['$self']?.['output']?.['metadata']?.['l2s']||_0x1e6f00['$self']?.['output']?.['metadata']?.['l1s'],_0x589a68={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x1e6f00['metadata']['pj'],'gid':_0x1e6f00['metadata']['pg'],'dad':_0x1e6f00['metadata']['pd'],'aid':_0x1e6f00['metadata']['pa'],'trc':_0x1e6f00['metadata']['trc'],'spn':_0x350310},'type':stream_1['StreamDataType']['RESULT'],'data':_0x5e9a69['data']};if(_0x1d2730&&_0x1d2730['code'])_0x589a68['status']=stream_1['StreamStatus']['ERROR'],_0x589a68['data']=_0x1d2730,_0x589a68['code']=_0x1d2730['code'],_0x589a68['stack']=_0x1d2730['stack'];else _0x5dded8?(_0x589a68['status']=stream_1['StreamStatus']['PENDING'],_0x589a68['code']=enums_1['HMSH_CODE_PENDING']):(_0x589a68['status']=stream_1['StreamStatus']['SUCCESS'],_0x589a68['code']=enums_1['HMSH_CODE_SUCCESS']);return await this['router']?.['publishMessage'](null,_0x589a68);}}['hasParentJob'](_0x4994d6,_0x328e13=![]){if(_0x328e13)return Boolean(_0x4994d6['metadata']['pj']&&_0x4994d6['metadata']['pa']&&!_0x4994d6['metadata']['px']);return Boolean(_0x4994d6['metadata']['pj']&&_0x4994d6['metadata']['pa']);}['resolveError'](_0x3b4917){if(_0x3b4917&&_0x3b4917['err'])return JSON['parse'](_0x3b4917['err']);}async['interrupt'](_0x36a2f4,_0x376dff,_0xb3da80={}){await this['store']['interrupt'](_0x36a2f4,_0x376dff,_0xb3da80);const _0x623141=await this['getState'](_0x36a2f4,_0x376dff),_0x24a22b={'interrupt':_0xb3da80['descend'],'expire':_0xb3da80['expire']};return await this['runJobCompletionTasks'](_0x623141,_0x24a22b);}async['scrub'](_0x45b7b5){await this['store']['scrub'](_0x45b7b5);}async['hook'](_0x19d020,_0x506f6c,_0x3961eb=stream_1['StreamStatus']['SUCCESS'],_0x553170=0xc8){const _0x3fd8aa=await this['taskService']['getHookRule'](_0x19d020),[_0x4dfd25]=await this['getSchema']('.'+_0x3fd8aa['to']),_0x616c69={'type':stream_1['StreamDataType']['WEBHOOK'],'status':_0x3961eb,'code':_0x553170,'metadata':{'guid':(0x0,utils_1['guid'])(),'aid':_0x4dfd25,'topic':_0x19d020},'data':_0x506f6c};return await this['router']?.['publishMessage'](null,_0x616c69);}async['hookTime'](_0x57f3f0,_0x8355a7,_0x468be4,_0x4f6996){if(_0x4f6996==='interrupt'||_0x4f6996==='expire')return await this['interrupt'](_0x468be4,_0x57f3f0,{'suppress':!![],'expire':0x1});const [_0x61a909,..._0x1eac6c]=_0x468be4['split'](','),_0x418495=','+_0x1eac6c['join'](','),_0x16b38e={'type':stream_1['StreamDataType']['TIMEHOOK'],'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x57f3f0,'gid':_0x8355a7,'dad':_0x418495,'aid':_0x61a909},'data':{'timestamp':Date['now']()}};await this['router']?.['publishMessage'](null,_0x16b38e);}async['hookAll'](_0xcfbd2a,_0x7c4d5e,_0xe695af,_0x355692=[]){const _0x999b81=await this['getVID'](),_0x1f4a2a=await this['taskService']['getHookRule'](_0xcfbd2a);if(_0x1f4a2a){const _0x525d74=await(0x0,utils_1['getSubscriptionTopic'])(_0x1f4a2a['to'],this['store'],_0x999b81),_0xcecaad=await this['resolveQuery'](_0x525d74,_0xe695af),_0x530a84=new reporter_1['ReporterService'](_0x999b81,this['store'],this['logger']),_0x5a79bb=await _0x530a84['getWorkItems'](_0xcecaad,_0x355692);if(_0x5a79bb['length']){const _0xc3d17c=new task_1['TaskService'](this['store'],this['logger']);await _0xc3d17c['enqueueWorkItems'](_0x5a79bb['map'](_0x443ecd=>[_0xcfbd2a,_0x443ecd,_0xe695af['scrub']||![],JSON['stringify'](_0x7c4d5e)]['join'](key_1['VALSEP']))),this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'work','originator':this['guid']},this['appId']);}return _0x5a79bb;}else throw new Error('unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20'+_0xcfbd2a);}async['pub'](_0x1773ec,_0x3c3788,_0x159547,_0x17c3da){const _0xf40d31=await this['initActivity'](_0x1773ec,_0x3c3788,_0x159547);if(_0xf40d31)return await _0xf40d31['process'](_0x17c3da);else throw new Error('unable\x20to\x20process\x20activity\x20for\x20topic\x20'+_0x1773ec);}async['sub'](_0x1e540e,_0x2db2e4){const _0x445b6c=async(_0x959300,_0x564891)=>{_0x2db2e4(_0x564891['topic'],_0x564891['job']);};return await this['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x445b6c,this['appId'],_0x1e540e);}async['unsub'](_0xa81253){return await this['subscribe']['unsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0xa81253);}async['psub'](_0x2c7a5a,_0x1c814f){const _0xd843d=async(_0x1ed00b,_0x2bdc15)=>{_0x1c814f(_0x2bdc15['topic'],_0x2bdc15['job']);};return await this['subscribe']['psubscribe'](key_1['KeyType']['QUORUM'],_0xd843d,this['appId'],_0x2c7a5a);}async['punsub'](_0x1545d8){return await this['subscribe']['punsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x1545d8);}async['pubsub'](_0x28594c,_0x286fb2,_0x41bff1,_0x2c5689=enums_1['HMSH_OTT_WAIT_TIME']){_0x41bff1={'metadata':{'ngn':this['guid'],'trc':_0x41bff1?.['metadata']?.['trc'],'spn':_0x41bff1?.['metadata']?.['spn']}};const _0x322864=await this['pub'](_0x28594c,_0x286fb2,_0x41bff1);return new Promise((_0x18188e,_0x28ef8f)=>{this['registerJobCallback'](_0x322864,(_0x15423b,_0x42cd02)=>{if(_0x42cd02['metadata']['err']){const _0x146caa=JSON['parse'](_0x42cd02['metadata']['err']);_0x28ef8f({..._0x146caa,'job_id':_0x42cd02['metadata']['jid']});}else _0x18188e(_0x42cd02);}),setTimeout(()=>{this['delistJobCallback'](_0x322864),_0x28ef8f({'code':enums_1['HMSH_CODE_TIMEOUT'],'message':'timeout','job_id':_0x322864});},_0x2c5689);});}async['pubOneTimeSubs'](_0x3bf864,_0x190638,_0x49b949=![]){if(this['hasOneTimeSubscription'](_0x3bf864)){const _0x3aa395={'type':'job','topic':_0x3bf864['metadata']['jid'],'job':(0x0,utils_1['restoreHierarchy'])(_0x190638)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x3aa395,this['appId'],_0x3bf864['metadata']['ngn']);}}async['getPublishesTopic'](_0x1a399a){const _0x492a3f=await this['getVID'](),_0x2c9c22=_0x1a399a['metadata']['aid']||_0x1a399a['$self']?.['output']?.['metadata']?.['aid'],_0x49a715=await this['store']['getSchema'](_0x2c9c22,_0x492a3f);return _0x49a715['publishes'];}async['pubPermSubs'](_0x834961,_0x516899,_0x37c2fd=![]){const _0x702fbb=await this['getPublishesTopic'](_0x834961);if(_0x702fbb){const _0x152bda={'type':'job','topic':_0x702fbb,'job':(0x0,utils_1['restoreHierarchy'])(_0x516899)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x152bda,this['appId'],_0x702fbb+'.'+_0x834961['metadata']['jid']);}}async['add'](_0x315aa8){return await this['router']?.['publishMessage'](null,_0x315aa8);}['registerJobCallback'](_0x5e058f,_0x469c8e){this['jobCallbacks'][_0x5e058f]=_0x469c8e;}['delistJobCallback'](_0x5caaf6){delete this['jobCallbacks'][_0x5caaf6];}['hasOneTimeSubscription'](_0x4c0761){return Boolean(_0x4c0761['metadata']['ngn']);}async['runJobCompletionTasks'](_0x6b72e1,_0x3ef0cf={}){const _0xc7e455=this['hasParentJob'](_0x6b72e1,!![]),_0x4409f8=this['hasOneTimeSubscription'](_0x6b72e1),_0x1fb859=await this['getPublishesTopic'](_0x6b72e1);let _0x5d1eda;if(_0xc7e455||_0x4409f8||_0x1fb859){const _0x2f4e1b=await this['getState'](_0x6b72e1['metadata']['tpc'],_0x6b72e1['metadata']['jid']);_0x5d1eda=await this['execAdjacentParent'](_0x6b72e1,_0x2f4e1b,_0x3ef0cf['emit']),this['pubOneTimeSubs'](_0x6b72e1,_0x2f4e1b,_0x3ef0cf['emit']),this['pubPermSubs'](_0x6b72e1,_0x2f4e1b,_0x3ef0cf['emit']);}return!_0x3ef0cf['emit']&&this['taskService']['registerJobForCleanup'](_0x6b72e1['metadata']['jid'],this['resolveExpires'](_0x6b72e1,_0x3ef0cf),_0x3ef0cf),_0x5d1eda;}['resolveExpires'](_0x407caf,_0x1b61ee){return _0x1b61ee['expire']??_0x407caf['metadata']['expire']??enums_1['HMSH_EXPIRE_JOB_SECONDS'];}async['export'](_0x59012e){return await this['exporter']['export'](_0x59012e);}async['getRaw'](_0x20cef3){return await this['store']['getRaw'](_0x20cef3);}async['getStatus'](_0x2fb52a){const {id:_0x1d4649}=await this['getVID']();return await this['store']['getStatus'](_0x2fb52a,_0x1d4649);}async['getState'](_0x7da0ce,_0x1f7708){const _0xeb841f=await this['store']['getSymbols']('$'+_0x7da0ce),_0x30edc7={['$'+_0x7da0ce]:Object['keys'](_0xeb841f)},_0x334d8f={},_0x7622e1=await this['store']['getState'](_0x1f7708,_0x30edc7,_0x334d8f);if(!_0x7622e1)throw new Error('not\x20found\x20'+_0x1f7708);const [_0x3e2738,_0x39f799]=_0x7622e1,_0x5bcb4d=(0x0,utils_1['restoreHierarchy'])(_0x3e2738);return _0x39f799&&_0x5bcb4d['metadata']&&(_0x5bcb4d['metadata']['js']=_0x39f799),_0x5bcb4d;}async['getQueryState'](_0xb33193,_0x2a679a){return await this['store']['getQueryState'](_0xb33193,_0x2a679a);}async['compress'](_0x596d5e){const _0x463955=await this['store']['getSymbolValues'](),_0x466ecf=Object['keys'](_0x463955)['length'],_0x3c2389=Math['pow'](0x34,0x2)-0x1,_0x4351ab=serializer_1['SerializerService']['filterSymVals'](_0x466ecf,_0x3c2389,_0x463955,new Set(_0x596d5e));return await this['store']['addSymbolValues'](_0x4351ab);}}exports['EngineService']=EngineService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x25c135,_0xe07945){const _0x3733a1=_0x4347,_0x5becee=_0x25c135();while(!![]){try{const _0x58dede=parseInt(_0x3733a1(0x193))/0x1*(parseInt(_0x3733a1(0x196))/0x2)+-parseInt(_0x3733a1(0x19a))/0x3+-parseInt(_0x3733a1(0x192))/0x4*(parseInt(_0x3733a1(0x199))/0x5)+-parseInt(_0x3733a1(0x198))/0x6*(-parseInt(_0x3733a1(0x194))/0x7)+parseInt(_0x3733a1(0x19c))/0x8+parseInt(_0x3733a1(0x197))/0x9*(-parseInt(_0x3733a1(0x19d))/0xa)+-parseInt(_0x3733a1(0x19b))/0xb*(-parseInt(_0x3733a1(0x195))/0xc);if(_0x58dede===_0xe07945)break;else _0x5becee['push'](_0x5becee['shift']());}catch(_0x1e517e){_0x5becee['push'](_0x5becee['shift']());}}}(_0x5d92,0x991d0));function _0x4347(_0x471681,_0x40185f){const _0x5d9298=_0x5d92();return _0x4347=function(_0x43473b,_0x2b0aac){_0x43473b=_0x43473b-0x192;let _0xf652d9=_0x5d9298[_0x43473b];return _0xf652d9;},_0x4347(_0x471681,_0x40185f);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['ExporterService']=void 0x0;const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),serializer_1=require('../serializer');class ExporterService{constructor(_0x15ca38,_0x1abc11,_0x78b3f3){this['appId']=_0x15ca38,this['logger']=_0x78b3f3,this['store']=_0x1abc11;}async['export'](_0x32d4bf,_0x4d0121={}){!this['symbols']&&(this['symbols']=this['store']['getAllSymbols'](),this['symbols']=await this['symbols']);const _0x256c07=[],_0x56f301=await this['store']['getRaw'](_0x32d4bf),_0x1475a1=this['inflate'](_0x56f301,_0x256c07);return _0x1475a1;}['inflateKey'](_0x29963b){return _0x29963b in this['symbols']?this['symbols'][_0x29963b]:_0x29963b;}['inflate'](_0x34db92,_0x309376){const _0x2bcda5={'hooks':{},'main':{'cursor':-0x1,'items':[]}},_0x12f3b7={},_0xd9db9d=this['inflateDependencyData'](_0x309376,_0x2bcda5),_0x4858bb=/^([a-zA-Z]{3}),(\d+(?:,\d+)*)/;return Object['entries'](_0x34db92)['forEach'](([_0xd69998,_0x2723ff])=>{const _0x18014c=_0xd69998['match'](_0x4858bb);if(_0x18014c){const [_0x453172,_0x39f024,_0x333832]=_0x18014c,_0x1f067a=this['inflateKey'](_0x39f024),_0x4ffa39=''+_0x333832['replace'](/,/g,'/'),_0x139469=serializer_1['SerializerService']['fromString'](_0x2723ff);_0x12f3b7[_0x4ffa39+'/'+_0x1f067a]=_0x139469;}else _0xd69998['length']===0x3&&(_0x12f3b7[this['inflateKey'](_0xd69998)]=serializer_1['SerializerService']['fromString'](_0x2723ff));}),{'dependencies':_0xd9db9d,'process':(0x0,utils_1['restoreHierarchy'])(_0x12f3b7),'status':_0x34db92[':']};}['inflateDependencyData'](_0x530f7c,_0x5eb140){const _0x5b2f4a=/([0-9,]+)-(\d+)$/,_0x245dfe=/-(\d+)$/;return _0x530f7c['map']((_0x4ecd02,_0x3e9cdc)=>{const [_0x56d065,_0x5d14ff,_0x39329b,_0x3d0e78,..._0x1a2893]=_0x4ecd02['split'](key_1['VALSEP']),_0x5e416f=_0x1a2893['join'](key_1['VALSEP']),_0xb71fdf=_0x5e416f['match'](_0x5b2f4a);let _0xf537c,_0x5b0190,_0x5bf7b0='';if(_0xb71fdf){const [_0x5af233,_0x59f7ca,_0x2ef889]=_0xb71fdf;_0x5bf7b0=_0x59f7ca['split'](',')['join']('/'),_0xf537c=_0x5bf7b0+'['+_0x2ef889+']',_0x5b0190='hook';}else{const _0x4b0d4e=_0x5e416f['match'](_0x245dfe);if(_0x4b0d4e){const [_0x2fbede,_0x2d4768]=_0x4b0d4e;_0xf537c='['+_0x2d4768+']',_0x5b0190='flow';}else _0xf537c='/',_0x5b0190='other';}return{'type':_0x56d065,'topic':_0x5d14ff,'gid':_0x39329b,'jid':_0x5e416f};});}}function _0x5d92(){const _0x45ca7e=['3462627dsSADU','77DafXxD','2105528tVdUmU','50ngtgRl','1409520CPOPUV','1GZmNYh','210077jWbWXz','1957356mHaAch','1877218ecIeyi','189558SGhZLs','120GOkhhD','15zVIQSF'];_0x5d92=function(){return _0x45ca7e;};return _0x5d92();}exports['ExporterService']=ExporterService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x2a8458,_0xbec74d){const _0xba2c80=_0x26f3,_0x5b7a5f=_0x2a8458();while(!![]){try{const _0x1e6767=-parseInt(_0xba2c80(0xaa))/0x1*(-parseInt(_0xba2c80(0xa8))/0x2)+parseInt(_0xba2c80(0xa9))/0x3+-parseInt(_0xba2c80(0xa7))/0x4*(-parseInt(_0xba2c80(0xac))/0x5)+parseInt(_0xba2c80(0xae))/0x6+-parseInt(_0xba2c80(0xab))/0x7+-parseInt(_0xba2c80(0xb0))/0x8+parseInt(_0xba2c80(0xaf))/0x9*(-parseInt(_0xba2c80(0xad))/0xa);if(_0x1e6767===_0xbec74d)break;else _0x5b7a5f['push'](_0x5b7a5f['shift']());}catch(_0x44c6cb){_0x5b7a5f['push'](_0x5b7a5f['shift']());}}}(_0xb1c1,0xbe2f9));function _0xb1c1(){const _0x493f8d=['788463dxMrdx','8798384PCeAIA','2516TVyTrh','740iVYrWS','1175712IKNOjd','2899MndVSh','3649632ahcrgO','7795TmCOWh','130UEgNQz','6563526aBzFov'];_0xb1c1=function(){return _0x493f8d;};return _0xb1c1();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['MapperService']=void 0x0;const pipe_1=require('../pipe');function _0x26f3(_0x442042,_0x5261b1){const _0xb1c1d9=_0xb1c1();return _0x26f3=function(_0x26f373,_0x117ceb){_0x26f373=_0x26f373-0xa7;let _0x54c576=_0xb1c1d9[_0x26f373];return _0x54c576;},_0x26f3(_0x442042,_0x5261b1);}class MapperService{constructor(_0x444778,_0x506ba2){this['rules']=_0x444778,this['data']=_0x506ba2;}['mapRules'](){return this['traverseRules'](this['rules']);}['traverseRules'](_0x358d2e){if(typeof _0x358d2e==='object'&&'@pipe'in _0x358d2e)return this['pipe'](_0x358d2e['@pipe']);if(typeof _0x358d2e==='object'&&_0x358d2e!==null){const _0x2b4204={};for(const _0x7c02ed in _0x358d2e){Object['prototype']['hasOwnProperty']['call'](_0x358d2e,_0x7c02ed)&&(_0x2b4204[_0x7c02ed]=this['traverseRules'](_0x358d2e[_0x7c02ed]));}return _0x2b4204;}else return this['resolve'](_0x358d2e);}['pipe'](_0x1280c0){const _0x56028d=new pipe_1['Pipe'](_0x1280c0,this['data']);return _0x56028d['process']();}['resolve'](_0x5935f3){const _0x871ed=new pipe_1['Pipe']([[_0x5935f3]],this['data']);return _0x871ed['process']();}static['evaluate'](_0x399523,_0x349190,_0x5c2418){if(typeof _0x399523==='boolean')return _0x399523;if(Array['isArray'](_0x399523['code'])&&_0x399523['code']['includes'](_0x5c2418||0xc8)||_0x5c2418['toString']()===(_0x399523['code']||0xc8)['toString']()){if(!_0x399523['match'])return!![];const _0x5ce50d=_0x399523['gate']==='or';let _0x8358d9=!![],_0x1cb5d2=![];return _0x399523['match']['forEach'](({expected:_0x1eefc7,actual:_0x9898ee})=>{if(_0x5ce50d&&!_0x1cb5d2||!_0x5ce50d&&_0x8358d9){const _0x3adecc=pipe_1['Pipe']['resolve'](_0x9898ee,_0x349190)===_0x1eefc7;if(_0x5ce50d&&_0x3adecc)_0x1cb5d2=!![];else!_0x5ce50d&&!_0x3adecc&&(_0x8358d9=![]);}}),_0x5ce50d?_0x1cb5d2:_0x8358d9;}return![];}}exports['MapperService']=MapperService;
|
|
@@ -131,10 +131,11 @@ class MeshData {
|
|
|
131
131
|
async getHotMesh(namespace = 'meshflow') {
|
|
132
132
|
let hotMesh = await this.instances.get(namespace);
|
|
133
133
|
if (!hotMesh) {
|
|
134
|
+
const connectionType = this.connections ? 'connections' : 'connection';
|
|
134
135
|
hotMesh = hotmesh_1.HotMesh.init({
|
|
135
136
|
appId: namespace,
|
|
136
137
|
engine: {
|
|
137
|
-
|
|
138
|
+
[connectionType]: utils_1.polyfill.meshDataConfig(this),
|
|
138
139
|
},
|
|
139
140
|
});
|
|
140
141
|
this.instances.set(namespace, hotMesh);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0xb89750,_0x53ed0e){const _0x15ba6e=_0x1616,_0x4cb861=_0xb89750();while(!![]){try{const _0x2cf240=-parseInt(_0x15ba6e(0x17e))/0x1+-parseInt(_0x15ba6e(0x187))/0x2*(-parseInt(_0x15ba6e(0x181))/0x3)+parseInt(_0x15ba6e(0x182))/0x4+-parseInt(_0x15ba6e(0x185))/0x5+parseInt(_0x15ba6e(0x183))/0x6*(-parseInt(_0x15ba6e(0x184))/0x7)+parseInt(_0x15ba6e(0x17f))/0x8+parseInt(_0x15ba6e(0x180))/0x9*(parseInt(_0x15ba6e(0x186))/0xa);if(_0x2cf240===_0x53ed0e)break;else _0x4cb861['push'](_0x4cb861['shift']());}catch(_0x561003){_0x4cb861['push'](_0x4cb861['shift']());}}}(_0x867e,0x549af));function _0x1616(_0x4fec88,_0xab75e7){const _0x867e3b=_0x867e();return _0x1616=function(_0x161626,_0x26a8bc){_0x161626=_0x161626-0x17e;let _0x628e02=_0x867e3b[_0x161626];return _0x628e02;},_0x1616(_0x4fec88,_0xab75e7);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['ExporterService']=void 0x0;const utils_1=require('../../modules/utils'),serializer_1=require('../serializer');class ExporterService{constructor(_0x155b42,_0x306711,_0x4074f4){this['appId']=_0x155b42,this['logger']=_0x4074f4,this['store']=_0x306711;}async['export'](_0x16d826,_0x191f09={}){if(!ExporterService['symbols']['has'](this['appId'])){const _0x3bfcfd=this['store']['getAllSymbols']();ExporterService['symbols']['set'](this['appId'],await _0x3bfcfd);}const _0x22b7ef=await this['store']['getRaw'](_0x16d826),_0x10396c=this['inflate'](_0x22b7ef,_0x191f09);return _0x10396c;}['inflate'](_0x1e02cf,_0x2e1916){const _0x36b96e=[],_0xca7867={},_0x6994f2={},_0x3b3869={},_0x3b5e5a=/^([a-zA-Z]{3}),(\d+(?:,\d+)*)/;return Object['entries'](_0x1e02cf)['forEach'](([_0x2487e9,_0x1fc73b])=>{const _0x107b92=_0x2487e9['match'](_0x3b5e5a);if(_0x107b92)this['inflateTransition'](_0x107b92,_0x1fc73b,_0x3b3869);else{if(_0x2487e9['startsWith']('_'))_0x6994f2[_0x2487e9['substring'](0x1)]=_0x1fc73b;else{if(_0x2487e9['startsWith']('-')){const _0x31d28e=this['keyToObject'](_0x2487e9);_0x36b96e['push']({..._0x31d28e,'key':_0x2487e9,'value':this['resolveValue'](_0x1fc73b,_0x2e1916['values'])});}else _0x2487e9['length']===0x3&&(_0xca7867[this['inflateKey'](_0x2487e9)]=serializer_1['SerializerService']['fromString'](_0x1fc73b));}}}),this['filterFields']({'data':(0x0,utils_1['restoreHierarchy'])(_0x6994f2),'state':Object['entries']((0x0,utils_1['restoreHierarchy'])(_0xca7867))[0x0][0x1],'status':parseInt(_0x1e02cf[':'],0xa),'timeline':this['sortParts'](_0x36b96e),'transitions':this['sortEntriesByCreated'](_0x3b3869)},_0x2e1916['block'],_0x2e1916['allow']);}['resolveValue'](_0x2db5ea,_0x22eba7){const _0x2298c6=serializer_1['SerializerService']['fromString'](_0x2db5ea);if(_0x22eba7!==![])return _0x2298c6;return _0x2298c6&&typeof _0x2298c6==='object'&&('data'in _0x2298c6&&(_0x2298c6['data']={}),'$error'in _0x2298c6&&(_0x2298c6['$error']={})),_0x2298c6;}['inflateKey'](_0x2e2bd3){const _0x15cb31=ExporterService['symbols']['get'](this['appId']);if(_0x2e2bd3 in _0x15cb31){const _0x429502=_0x15cb31[_0x2e2bd3],_0x3a72c3=_0x429502['split']('/');return _0x3a72c3['join']('/');}return _0x2e2bd3;}['filterFields'](_0x30e780,_0x17000f=[],_0x344ea6=[]){let _0x28545b={};return _0x344ea6&&_0x344ea6['length']>0x0?_0x344ea6['forEach'](_0xd22c1f=>{_0xd22c1f in _0x30e780&&(_0x28545b[_0xd22c1f]=_0x30e780[_0xd22c1f]);}):_0x28545b={..._0x30e780},_0x17000f&&_0x17000f['length']>0x0&&_0x17000f['forEach'](_0x4ba68f=>{_0x4ba68f in _0x28545b&&delete _0x28545b[_0x4ba68f];}),_0x28545b;}['inflateTransition'](_0x45405f,_0x55c178,_0xd89109){const [_0x4d9b11,_0x5c4a18,_0x74a924]=_0x45405f,_0x442d75=this['inflateKey'](_0x5c4a18),_0x3e1bfc=_0x442d75['split']('/'),_0x3b4d20=_0x3e1bfc[0x0],_0x4dd94f=_0x442d75['endsWith']('/output/metadata/ac'),_0x2f7100=_0x442d75['endsWith']('/output/metadata/au');if(_0x4dd94f||_0x2f7100){const _0x1a0d70=_0x3b4d20+','+_0x74a924,_0x17e475=_0xd89109[_0x1a0d70];!_0x17e475?_0xd89109[_0x1a0d70]={'activity':_0x3b4d20,'dimensions':_0x74a924,'created':_0x4dd94f?_0x55c178:null,'updated':_0x2f7100?_0x55c178:null}:_0x17e475[_0x4dd94f?'created':'updated']=_0x55c178;}}['sortEntriesByCreated'](_0x34ee30){const _0x4bf41a=Object['values'](_0x34ee30);return _0x4bf41a['sort']((_0x1a5d10,_0x2450da)=>{return(_0x1a5d10['created']||_0x1a5d10['updated'])['localeCompare'](_0x2450da['created']||_0x2450da['updated']);}),_0x4bf41a;}['keyToObject'](_0x21a3a4){function _0x3522d2(_0x178620){const _0x1d5591=_0x178620['split'](',');if(_0x1d5591['length']>0x1)return _0x1d5591['shift'](),_0x1d5591['join'](',');}const _0x452da7=_0x21a3a4['split']('-');return _0x452da7['length']===0x4?{'index':parseInt(_0x452da7[0x2],0xa),'dimension':_0x3522d2(_0x452da7[0x1])}:{'index':parseInt(_0x452da7[0x2],0xa),'secondary':parseInt(_0x452da7[0x3],0xa),'dimension':_0x3522d2(_0x452da7[0x1])};}['sortParts'](_0x6d0a7f){return _0x6d0a7f['sort']((_0x1af201,_0x22c873)=>{const {dimension:_0x42419a,index:_0x4dd8b1,secondary:_0xfdd25e}=_0x1af201,{dimension:_0x310db5,index:_0x46ae51,secondary:_0x5df79d}=_0x22c873;if(_0x42419a===undefined&&_0x310db5!==undefined)return-0x1;if(_0x42419a!==undefined&&_0x310db5===undefined)return 0x1;if(_0x42419a!==undefined&&_0x310db5!==undefined){if(_0x42419a<_0x310db5)return-0x1;if(_0x42419a>_0x310db5)return 0x1;}if(_0x4dd8b1<_0x46ae51)return-0x1;if(_0x4dd8b1>_0x46ae51)return 0x1;if(_0xfdd25e===undefined&&_0x5df79d!==undefined)return-0x1;if(_0xfdd25e!==undefined&&_0x5df79d===undefined)return 0x1;if(_0xfdd25e!==undefined&&_0x5df79d!==undefined){if(_0xfdd25e<_0x5df79d)return-0x1;if(_0xfdd25e>_0x5df79d)return 0x1;}return 0x0;});}}function _0x867e(){const _0x3eba22=['1091104XNGesN','2804615jACcLp','10WlOtUJ','78DYXCHX','412604WWFAPF','4516088DrFobK','7324371QEGsQQ','1533SthUvj','2181196uCbwns','24IyYAEg'];_0x867e=function(){return _0x3eba22;};return _0x867e();}exports['ExporterService']=ExporterService,ExporterService['symbols']=new Map();
|
|
@@ -195,7 +195,7 @@ class MeshOS {
|
|
|
195
195
|
static async init(p = MeshOS.profiles) {
|
|
196
196
|
for (const key in p) {
|
|
197
197
|
const profile = p[key];
|
|
198
|
-
if (profile.db?.connection?.
|
|
198
|
+
if (profile.db?.connection || profile.db?.connections) {
|
|
199
199
|
this.logger.info(`meshos-initializing`, {
|
|
200
200
|
db: profile.db.name,
|
|
201
201
|
key,
|
|
@@ -217,7 +217,7 @@ class MeshOS {
|
|
|
217
217
|
entity: entity.name,
|
|
218
218
|
label: entity.label,
|
|
219
219
|
});
|
|
220
|
-
const instance = pinstances[entity.name] = new entity.class(profile.db.connection
|
|
220
|
+
const instance = pinstances[entity.name] = new entity.class(profile.db.connection?.class, ns, namespace.type, profile.db.connection?.options, profile.db.connections);
|
|
221
221
|
await instance.init(profile.db.search);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
@@ -226,7 +226,7 @@ class MeshOS {
|
|
|
226
226
|
}
|
|
227
227
|
static findEntity(database, namespace, entity) {
|
|
228
228
|
if (!database || !MeshOS.profiles[database]) {
|
|
229
|
-
const activeProfiles = Object.keys(MeshOS.profiles).filter((key) => MeshOS.profiles[key]?.db
|
|
229
|
+
const activeProfiles = Object.keys(MeshOS.profiles).filter((key) => MeshOS.profiles[key]?.db);
|
|
230
230
|
throw new Error(`The database query parameter [${database}] was not found. Use one of: ${activeProfiles.join(', ')}`);
|
|
231
231
|
}
|
|
232
232
|
if (!namespace || !MeshOS.profiles[database]?.instances?.[namespace]) {
|
|
@@ -254,7 +254,7 @@ class MeshOS {
|
|
|
254
254
|
}
|
|
255
255
|
static findSchemas(database, ns) {
|
|
256
256
|
if (!database || !MeshOS.profiles[database]) {
|
|
257
|
-
const activeProfiles = Object.keys(MeshOS.profiles).filter((key) => MeshOS.profiles[key]?.db
|
|
257
|
+
const activeProfiles = Object.keys(MeshOS.profiles).filter((key) => MeshOS.profiles[key]?.db);
|
|
258
258
|
throw new Error(`The database query parameter [${database}] was not found. Use one of: ${activeProfiles.join(', ')}`);
|
|
259
259
|
}
|
|
260
260
|
const profile = MeshOS.profiles[database];
|
|
@@ -271,7 +271,7 @@ class MeshOS {
|
|
|
271
271
|
const result = {};
|
|
272
272
|
for (const key in p) {
|
|
273
273
|
const profile = p[key];
|
|
274
|
-
if (!profile.db
|
|
274
|
+
if (!profile.db) {
|
|
275
275
|
continue;
|
|
276
276
|
}
|
|
277
277
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x45d383,_0xba721b){var _0x2bfe57=_0x3c22,_0x228b09=_0x45d383();while(!![]){try{var _0x176610=parseInt(_0x2bfe57(0x1c3))/0x1+-parseInt(_0x2bfe57(0x1c5))/0x2+-parseInt(_0x2bfe57(0x1c4))/0x3+-parseInt(_0x2bfe57(0x1c6))/0x4*(-parseInt(_0x2bfe57(0x1c2))/0x5)+parseInt(_0x2bfe57(0x1c1))/0x6+parseInt(_0x2bfe57(0x1c0))/0x7+parseInt(_0x2bfe57(0x1bf))/0x8;if(_0x176610===_0xba721b)break;else _0x228b09['push'](_0x228b09['shift']());}catch(_0x3c5a04){_0x228b09['push'](_0x228b09['shift']());}}}(_0x3d5b,0xad182));function _0x3c22(_0x4930ec,_0x178e42){var _0x3d5bab=_0x3d5b();return _0x3c22=function(_0x3c2270,_0x3af684){_0x3c2270=_0x3c2270-0x1bf;var _0x526e0d=_0x3d5bab[_0x3c2270];return _0x526e0d;},_0x3c22(_0x4930ec,_0x178e42);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['ArrayHandler']=void 0x0;class ArrayHandler{['get'](_0x21f16a,_0x2642d0){return _0x21f16a?.[_0x2642d0||0x0];}['length'](_0x5400cf){return _0x5400cf?.['length'];}['concat'](_0xc2f669,_0x4beb87){return _0xc2f669['concat'](_0x4beb87);}['indexOf'](_0x73fb8e,_0x152c35,_0xb3d8a){return _0x73fb8e['indexOf'](_0x152c35,_0xb3d8a);}['join'](_0x406f97,_0x12491a){return _0x406f97['join'](_0x12491a);}['lastIndexOf'](_0x132c2d,_0x589543,_0x5b7613){return _0x132c2d['lastIndexOf'](_0x589543,_0x5b7613);}['pop'](_0x34af82){return _0x34af82['pop']();}['push'](_0x44ff74,..._0x2b6234){return _0x44ff74['push'](..._0x2b6234),_0x44ff74;}['reverse'](_0xcbf511){return _0xcbf511['reverse']();}['shift'](_0x1c54ac){return _0x1c54ac['shift']();}['slice'](_0x220d64,_0x1d56cc,_0x43ac00){return _0x220d64['slice'](_0x1d56cc,_0x43ac00);}['sort'](_0x28cb10,_0x534e4c='ASCENDING'){return _0x28cb10['sort']((_0x5bd447,_0x57b67c)=>{if(_0x534e4c==='ASCENDING'){if(_0x5bd447===_0x57b67c)return 0x0;if(_0x5bd447===null||_0x5bd447===undefined)return-0x1;if(_0x57b67c===null||_0x57b67c===undefined)return 0x1;if(typeof _0x5bd447==='string'&&typeof _0x57b67c==='string')return _0x5bd447['localeCompare'](_0x57b67c);return _0x5bd447<_0x57b67c?-0x1:0x1;}else{if(_0x5bd447===_0x57b67c)return 0x0;if(_0x5bd447===null||_0x5bd447===undefined)return 0x1;if(_0x57b67c===null||_0x57b67c===undefined)return-0x1;if(typeof _0x5bd447==='string'&&typeof _0x57b67c==='string')return _0x57b67c['localeCompare'](_0x5bd447);return _0x5bd447>_0x57b67c?-0x1:0x1;}});}['splice'](_0x24dcd3,_0x3c06f0,_0x225c25,..._0x467d4b){return _0x24dcd3['splice'](_0x3c06f0,_0x225c25,..._0x467d4b);}['unshift'](_0x5b1a9b,..._0x14184f){return _0x5b1a9b['unshift'](..._0x14184f);}}function _0x3d5b(){var _0x52e094=['10EoxImV','889421zOwTFC','3664737uLTFfV','1973410LbYfCR','1675004DGxHNt','1371904ptCXBl','5958302wSHCGC','1006086QzcVFA'];_0x3d5b=function(){return _0x52e094;};return _0x3d5b();}exports['ArrayHandler']=ArrayHandler;
|