@hotmeshio/hotmesh 0.3.23 → 0.3.24
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 +3 -1
- package/build/modules/key.js +1 -1
- package/build/modules/utils.js +1 -1
- package/build/package.json +3 -3
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.js +1 -1
- package/build/services/activities/index.js +1 -1
- package/build/services/activities/interrupt.js +1 -1
- package/build/services/activities/signal.js +1 -1
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.js +1 -1
- package/build/services/connector/providers/postgres.js +1 -0
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.js +1 -1
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshcall/index.js +3 -1
- package/build/services/meshdata/index.d.ts +2 -3
- package/build/services/meshdata/index.js +4 -6
- package/build/services/meshflow/client.js +3 -1
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/workflow.d.ts +8 -0
- package/build/services/meshflow/workflow.js +41 -1
- package/build/services/pipe/functions/array.js +1 -1
- package/build/services/pipe/functions/bitwise.js +1 -1
- package/build/services/pipe/functions/conditional.js +1 -1
- package/build/services/pipe/functions/cron.js +1 -1
- package/build/services/pipe/functions/date.js +1 -1
- package/build/services/pipe/functions/index.js +1 -1
- package/build/services/pipe/functions/json.js +1 -1
- package/build/services/pipe/functions/logical.js +1 -1
- package/build/services/pipe/functions/math.js +1 -1
- package/build/services/pipe/functions/number.js +1 -1
- package/build/services/pipe/functions/object.js +1 -1
- package/build/services/pipe/functions/string.js +1 -1
- package/build/services/pipe/functions/symbol.js +1 -1
- package/build/services/pipe/functions/unary.js +1 -1
- package/build/services/pipe/index.js +1 -1
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.js +1 -1
- package/build/services/search/providers/postgres/postgres.js +1 -1
- package/build/services/search/providers/redis/ioredis.js +1 -1
- package/build/services/search/providers/redis/redis.js +1 -1
- package/build/services/serializer/index.js +1 -1
- package/build/services/store/providers/postgres/kvsql.js +1 -1
- package/build/services/store/providers/postgres/kvtables.d.ts +1 -1
- package/build/services/store/providers/postgres/kvtables.js +1 -1
- package/build/services/store/providers/postgres/kvtransaction.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
- package/build/services/store/providers/postgres/postgres.js +1 -1
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/providers/nats/nats.js +1 -1
- package/build/services/stream/providers/postgres/postgres.js +1 -1
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/index.d.ts +5 -5
- package/build/services/sub/providers/nats/nats.js +1 -1
- package/build/services/sub/providers/postgres/postgres.d.ts +3 -3
- package/build/services/sub/providers/postgres/postgres.js +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.d.ts +1 -0
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/build/types/quorum.d.ts +7 -1
- package/package.json +3 -3
- package/types/quorum.ts +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x427c(_0x5e0826,_0x4d4113){const _0x4dfb39=_0x4dfb();return _0x427c=function(_0x427c02,_0x115dd9){_0x427c02=_0x427c02-0x148;let _0x3b4220=_0x4dfb39[_0x427c02];return _0x3b4220;},_0x427c(_0x5e0826,_0x4d4113);}(function(_0x38dfdc,_0x26d259){const _0x2a4c97=_0x427c,_0x42b14a=_0x38dfdc();while(!![]){try{const _0x67d184=parseInt(_0x2a4c97(0x14e))/0x1*(parseInt(_0x2a4c97(0x14a))/0x2)+parseInt(_0x2a4c97(0x148))/0x3+-parseInt(_0x2a4c97(0x151))/0x4*(-parseInt(_0x2a4c97(0x14c))/0x5)+parseInt(_0x2a4c97(0x150))/0x6+parseInt(_0x2a4c97(0x149))/0x7*(parseInt(_0x2a4c97(0x14b))/0x8)+parseInt(_0x2a4c97(0x14d))/0x9*(-parseInt(_0x2a4c97(0x152))/0xa)+parseInt(_0x2a4c97(0x14f))/0xb*(-parseInt(_0x2a4c97(0x153))/0xc);if(_0x67d184===_0x26d259)break;else _0x42b14a['push'](_0x42b14a['shift']());}catch(_0x547a27){_0x42b14a['push'](_0x42b14a['shift']());}}}(_0x4dfb,0xdcea0));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 _0x4dfb(){const _0x39c71=['9EdwhGK','41721bENyqy','45302378jKTQYB','9812226JjspTZ','44qHHuVA','7883210XNVEGz','12zZJfaA','1722969sVnZzw','18074fpreuA','22vUfEZY','4240wZmyfz','806590ZaZqce'];_0x4dfb=function(){return _0x39c71;};return _0x4dfb();}class Worker extends activity_1['Activity']{constructor(_0xf84153,_0x28c77f,_0x2958e3,_0x5e8b28,_0x25cf54,_0x3ca62c){super(_0xf84153,_0x28c77f,_0x2958e3,_0x5e8b28,_0x25cf54,_0x3ca62c);}async['process'](){this['logger']['debug']('worker-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x5dc8e3;try{await this['verifyEntry'](),_0x5dc8e3=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x5dc8e3['startActivitySpan'](this['leg']),this['mapInputData']();const _0x47a983=this['store']['transact'](),_0xf13aea=await this['execActivity'](_0x47a983);await collator_1['CollatorService']['authorizeReentry'](this,_0x47a983),await this['setState'](_0x47a983),await this['setStatus'](0x0,_0x47a983);const _0x2e6bd4=await _0x47a983['exec']();_0x5dc8e3['mapActivityAttributes']();const _0x468c1e=this['resolveStatus'](_0x2e6bd4);return _0x5dc8e3['setActivityAttributes']({'app.activity.mid':_0xf13aea,'app.job.jss':_0x468c1e}),this['context']['metadata']['aid'];}catch(_0x35f12f){if(_0x35f12f instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x35f12f});return;}else{if(_0x35f12f instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x35f12f});return;}else{if(_0x35f12f instanceof errors_1['GetStateError']){this['logger']['error']('worker-get-state-error',{..._0x35f12f});return;}else{if(_0x35f12f instanceof errors_1['CollationError']){if(_0x35f12f['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',{..._0x35f12f});}else this['logger']['error']('worker-process-error',{..._0x35f12f});}}}_0x5dc8e3?.['setActivityError'](_0x35f12f['message']);throw _0x35f12f;}finally{_0x5dc8e3?.['endActivitySpan'](),this['logger']['debug']('worker-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x857f8c){const _0x2ae1cc=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x33e0b3={'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':_0x2ae1cc,'spn':this['context']['$self']['output']['metadata']['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context']['data']};return this['config']['retry']&&(_0x33e0b3['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](_0x2ae1cc,_0x33e0b3,_0x857f8c);}}exports['Worker']=Worker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0xbc1ea5,_0x30857e){const _0x4b559a=_0x4d22,_0x23d720=_0xbc1ea5();while(!![]){try{const _0x1beaf4=-parseInt(_0x4b559a(0xd7))/0x1+-parseInt(_0x4b559a(0xd1))/0x2+parseInt(_0x4b559a(0xd3))/0x3+-parseInt(_0x4b559a(0xd5))/0x4*(-parseInt(_0x4b559a(0xd6))/0x5)+parseInt(_0x4b559a(0xd2))/0x6+-parseInt(_0x4b559a(0xd4))/0x7+parseInt(_0x4b559a(0xd0))/0x8*(parseInt(_0x4b559a(0xd8))/0x9);if(_0x1beaf4===_0x30857e)break;else _0x23d720['push'](_0x23d720['shift']());}catch(_0x4e37ed){_0x23d720['push'](_0x23d720['shift']());}}}(_0x51bb,0x7fb46));function _0x4d22(_0x171307,_0x2a4973){const _0x51bb02=_0x51bb();return _0x4d22=function(_0x4d222f,_0x2a4157){_0x4d222f=_0x4d222f-0xd0;let _0x27d8ef=_0x51bb02[_0x4d222f];return _0x27d8ef;},_0x4d22(_0x171307,_0x2a4973);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CollatorService']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../../types/collator');function _0x51bb(){const _0x491834=['3951bwVlDW','12952KmzdlX','911138YyZBCX','1989336NeNMKh','429768oSpKUH','418579ksCdum','330608hYyqEH','5ZMrmvH','229761SYMKLp'];_0x51bb=function(){return _0x491834;};return _0x51bb();}class CollatorService{static['assertJobActive'](_0x37a224,_0x24eb4b,_0x292b57,_0x17a8ef=0x0){if(_0x37a224<=_0x17a8ef)throw new errors_1['InactiveJobError'](_0x24eb4b,_0x37a224,_0x292b57);}static['getDimensionalAddress'](_0x3a9bb4,_0x149a0c=![]){let _0x1ea061=_0x3a9bb4['context']['metadata']['dad']||_0x3a9bb4['metadata']['dad'];return _0x149a0c&&_0x1ea061&&_0x3a9bb4['leg']===0x2&&(_0x1ea061=_0x1ea061['substring'](0x0,_0x1ea061['lastIndexOf'](','))+',0'),CollatorService['getDimensionsById']([..._0x3a9bb4['config']['ancestors'],_0x3a9bb4['metadata']['aid']],_0x1ea061);}static['resolveReentryDimension'](_0x30b50d){const _0x44ec09=_0x30b50d['config']['ancestor'],_0x3ca026=_0x30b50d['config']['ancestors'],_0x333b03=_0x3ca026['indexOf'](_0x44ec09),_0x16a541=_0x30b50d['metadata']['dad']['split'](',');return _0x16a541['length']=_0x333b03+0x1,_0x16a541['push']('0'),_0x16a541['join'](',');}static async['notarizeEntry'](_0x41135e,_0x2af8d8){const _0x11680c=await _0x41135e['store']['collate'](_0x41135e['context']['metadata']['jid'],_0x41135e['metadata']['aid'],-0x5af3107a4000,this['getDimensionalAddress'](_0x41135e),_0x2af8d8);return this['verifyInteger'](_0x11680c,0x1,'enter'),_0x11680c;}static async['authorizeReentry'](_0x122165,_0x27593c){const _0x5c96de=await _0x122165['store']['collate'](_0x122165['context']['metadata']['jid'],_0x122165['metadata']['aid'],-0x9184e72a000,this['getDimensionalAddress'](_0x122165),_0x27593c);return _0x5c96de;}static async['notarizeEarlyExit'](_0x316f11,_0x4381c7){return await _0x316f11['store']['collate'](_0x316f11['context']['metadata']['jid'],_0x316f11['metadata']['aid'],-0xa012317b000,this['getDimensionalAddress'](_0x316f11),_0x4381c7);}static async['notarizeEarlyCompletion'](_0x5d27db,_0x551d13){const _0x1d2d16=_0x5d27db['config']['cycle']?0x9184e72a000:0xa012317b000;return await _0x5d27db['store']['collate'](_0x5d27db['context']['metadata']['jid'],_0x5d27db['metadata']['aid'],0xf4241-_0x1d2d16,this['getDimensionalAddress'](_0x5d27db),_0x551d13);}static async['notarizeInception'](_0x4ea584,_0x241b1f,_0x300671){_0x241b1f&&await _0x4ea584['store']['collateSynthetic'](_0x4ea584['context']['metadata']['jid'],_0x241b1f,0xf4240,_0x300671);}static async['isInceptionOverage'](_0xd2b317,_0x14a6e0){if(_0x14a6e0){const _0x371ed6=await _0xd2b317['store']['collateSynthetic'](_0xd2b317['context']['metadata']['jid'],_0x14a6e0,0xf4240);return _0x371ed6>0xf4240;}return![];}static async['notarizeReentry'](_0x366959,_0x15d6a6,_0x291329){const _0x20bd8e=_0x366959['context']['metadata']['jid'],_0x17fbac=_0x291329||_0x366959['store']['transact']();await _0x366959['store']['collate'](_0x20bd8e,_0x366959['metadata']['aid'],0xf4240,this['getDimensionalAddress'](_0x366959,!![]),_0x17fbac),await _0x366959['store']['collateSynthetic'](_0x20bd8e,_0x15d6a6,0xf4240,_0x17fbac);const [_0x56bbc1,_0x483425]=await _0x17fbac['exec'](),_0xd54a3e=Array['isArray'](_0x56bbc1)?_0x56bbc1[0x1]:_0x56bbc1,_0x32399a=Array['isArray'](_0x483425)?_0x483425[0x1]:_0x483425;return this['verifyInteger'](_0xd54a3e,0x2,'enter'),this['verifySyntheticInteger'](_0x32399a),_0xd54a3e;}static async['notarizeContinuation'](_0x305372,_0x1cb59c){return await _0x305372['store']['collate'](_0x305372['context']['metadata']['jid'],_0x305372['metadata']['aid'],0x1,this['getDimensionalAddress'](_0x305372),_0x1cb59c);}static async['notarizeCompletion'](_0x25aa54,_0x399514){const _0x45c889=_0x25aa54['config']['cycle']?0x0:0xe8d4a51000;return await _0x25aa54['store']['collate'](_0x25aa54['context']['metadata']['jid'],_0x25aa54['metadata']['aid'],0x1-_0x45c889,this['getDimensionalAddress'](_0x25aa54),_0x399514);}static['getDigitAtIndex'](_0x2c98a5,_0x24c0ce){const _0x5ea4e0=_0x2c98a5['toString']();if(_0x24c0ce<0x0||_0x24c0ce>=_0x5ea4e0['length'])return null;const _0x41c573=parseInt(_0x5ea4e0[_0x24c0ce],0xa);return _0x41c573;}static['getDimensionalIndex'](_0x295e90){const _0x14281d=_0x295e90['toString']();if(_0x14281d['length']<0x9)return null;const _0x149e6b=_0x14281d['substring'](0x3,0x9),_0x55f9ca=parseInt(_0x149e6b,0xa);return _0x55f9ca-0x1;}static['isDuplicate'](_0x2d143a,_0xf9af17){return this['getDigitAtIndex'](_0x2d143a,_0xf9af17)<0x8;}static['isInactive'](_0x5b0fce){return this['getDigitAtIndex'](_0x5b0fce,0x2)<0x9;}static['isPrimed'](_0x21f20d,_0x4055e7){return _0x4055e7==0x1?_0x21f20d!=-0x5af3107a4000:this['getDigitAtIndex'](_0x21f20d,0x0)<0x9&&this['getDigitAtIndex'](_0x21f20d,0x1)<0x9;}static['verifySyntheticInteger'](_0x4950bf){const _0x4788ac=_0x4950bf['toString'](),_0x366c7b=parseInt(_0x4788ac[_0x4788ac['length']-0x1],0xa);if(_0x366c7b>0x0)throw new errors_1['CollationError'](_0x4950bf,0x2,'enter',collator_1['CollationFaultType']['INACTIVE']);else{if(_0x4950bf>=0x1e8480)throw new errors_1['CollationError'](_0x4950bf,0x2,'enter',collator_1['CollationFaultType']['DUPLICATE']);}}static['verifyInteger'](_0x48d17c,_0x3ebf03,_0x276a69){let _0x338986;if(_0x3ebf03===0x1&&_0x276a69==='enter'){if(!this['isPrimed'](_0x48d17c,0x1))_0x338986=collator_1['CollationFaultType']['MISSING'];else{if(this['isDuplicate'](_0x48d17c,0x0))_0x338986=collator_1['CollationFaultType']['DUPLICATE'];else _0x48d17c!=0x331a2bfa73000&&(_0x338986=collator_1['CollationFaultType']['INVALID']);}}else{if(_0x3ebf03===0x1&&_0x276a69==='exit'){if(_0x48d17c===-0x9184e72a000)_0x338986=collator_1['CollationFaultType']['MISSING'];else this['isDuplicate'](_0x48d17c,0x1)&&(_0x338986=collator_1['CollationFaultType']['DUPLICATE']);}else{if(_0x3ebf03===0x2&&_0x276a69==='enter'){if(!this['isPrimed'](_0x48d17c,0x2))_0x338986=collator_1['CollationFaultType']['FORBIDDEN'];else this['isInactive'](_0x48d17c)&&(_0x338986=collator_1['CollationFaultType']['INACTIVE']);}}}if(_0x338986)throw new errors_1['CollationError'](_0x48d17c,_0x3ebf03,_0x276a69,_0x338986);}static['getDimensionsById'](_0x210bff,_0xa3b34){const _0x1d519d={'$ADJACENT':_0xa3b34+',0'};let _0x140287=_0xa3b34;return _0x210bff['reverse']()['forEach'](_0x4356a2=>{_0x1d519d[_0x4356a2]=_0x140287,_0x140287=_0x140287['substring'](0x0,_0x140287['lastIndexOf'](','));}),_0x1d519d;}static['getSeed'](){return'999000000000000';}static['getTriggerSeed'](){return'888000001000001';}static['compile'](_0xf97857){CollatorService['bindAncestorArray'](_0xf97857);}static['bindAncestorArray'](_0x212dcf){_0x212dcf['forEach'](_0x1adc78=>{const _0x4552ab={},_0x25fbd2=Object['keys'](_0x1adc78['activities'])['find'](_0x870304=>_0x1adc78['activities'][_0x870304]['type']==='trigger');if(!_0x25fbd2)throw new Error('collator-trigger-activity-not-found');const _0x521b5e=(_0x4b0106,_0x17aaca)=>{_0x4552ab[_0x4b0106]=_0x17aaca,_0x1adc78['activities'][_0x4b0106]['ancestors']=_0x17aaca;const _0x5b27b6=_0x1adc78['transitions']?.[_0x4b0106]||[];_0x5b27b6['forEach'](_0x5cc625=>{_0x521b5e(_0x5cc625['to'],[..._0x17aaca,_0x4b0106]);});};_0x521b5e(_0x25fbd2,[]);});}static['getDimensionalSeed'](_0x5341c7=0x0){return','+_0x5341c7;}}exports['CollatorService']=CollatorService,CollatorService['targetLength']=0xf;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x4cf08a,_0x1ce4f0){const _0xaeb56c=_0x8c52,_0x306f02=_0x4cf08a();while(!![]){try{const _0x246d6b=parseInt(_0xaeb56c(0x90))/0x1+-parseInt(_0xaeb56c(0x92))/0x2*(parseInt(_0xaeb56c(0x8c))/0x3)+-parseInt(_0xaeb56c(0x93))/0x4*(-parseInt(_0xaeb56c(0x8f))/0x5)+-parseInt(_0xaeb56c(0x8d))/0x6+parseInt(_0xaeb56c(0x96))/0x7*(parseInt(_0xaeb56c(0x8e))/0x8)+parseInt(_0xaeb56c(0x94))/0x9*(parseInt(_0xaeb56c(0x95))/0xa)+-parseInt(_0xaeb56c(0x91))/0xb;if(_0x246d6b===_0x1ce4f0)break;else _0x306f02['push'](_0x306f02['shift']());}catch(_0x37e2b2){_0x306f02['push'](_0x306f02['shift']());}}}(_0x4529,0x3c664));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Deployer']=void 0x0;const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),serializer_1=require('../serializer'),pipe_1=require('../pipe'),validator_1=require('./validator'),DEFAULT_METADATA_RANGE_SIZE=0x1a,DEFAULT_DATA_RANGE_SIZE=0x104,DEFAULT_RANGE_SIZE=DEFAULT_METADATA_RANGE_SIZE+DEFAULT_DATA_RANGE_SIZE;function _0x8c52(_0x4d2679,_0x156a0f){const _0x45296d=_0x4529();return _0x8c52=function(_0x8c5280,_0x45455d){_0x8c5280=_0x8c5280-0x8c;let _0x2982c7=_0x45296d[_0x8c5280];return _0x2982c7;},_0x8c52(_0x4d2679,_0x156a0f);}function _0x4529(){const _0x5a9135=['11416bRjKYP','15LJUalw','126984VTtCJN','3317809GFzedH','2WZRGxY','36824EECKJw','9udVEmZ','4866670HvBJVe','245jmakRE','129477tMonpK','594240ysUoWZ'];_0x4529=function(){return _0x5a9135;};return _0x4529();}class Deployer{constructor(_0x424c89){this['manifest']=null,this['manifest']=_0x424c89;}async['deploy'](_0x578622,_0x238ec2){this['store']=_0x578622,this['stream']=_0x238ec2,collator_1['CollatorService']['compile'](this['manifest']['app']['graphs']),this['convertActivitiesToHooks'](),this['convertTopicsToTypes'](),this['copyJobSchemas'](),this['bindBackRefs'](),this['bindParents'](),this['bindCycleTarget'](),this['resolveMappingDependencies'](),this['resolveJobMapsPaths'](),await this['generateSymKeys'](),await this['generateSymVals'](),await this['deployHookPatterns'](),await this['deployActivitySchemas'](),await this['deploySubscriptions'](),await this['deployTransitions'](),await this['deployConsumerGroups']();}['getVID'](){return{'id':this['manifest']['app']['id'],'version':this['manifest']['app']['version']};}async['generateSymKeys'](){for(const _0x2cb7fa of this['manifest']['app']['graphs']){const [,_0x19abaf]=this['findTrigger'](_0x2cb7fa),_0x30fe77=_0x19abaf['subscribes'],[_0x484e06,_0x3cfa6d,_0x2b2d0a]=await this['store']['reserveSymbolRange']('$'+_0x30fe77,DEFAULT_RANGE_SIZE,'JOB'),_0x1826b4='',_0x513bc5=this['bindSymbols'](_0x484e06,_0x3cfa6d,_0x2b2d0a,_0x1826b4,_0x19abaf['PRODUCES']);Object['keys'](_0x513bc5)['length']&&await this['store']['addSymbols']('$'+_0x30fe77,_0x513bc5);for(const [_0x26d886,_0x916d00]of Object['entries'](_0x2cb7fa['activities'])){const [_0x2afcfb,_0x5071a0,_0x5199fe]=await this['store']['reserveSymbolRange'](_0x26d886,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x1b4f3b=_0x26d886+'/';this['bindSelf'](_0x916d00['consumes'],_0x916d00['produces'],_0x26d886);const _0x1062f5=this['bindSymbols'](_0x2afcfb,_0x5071a0,_0x5199fe,_0x1b4f3b,_0x916d00['produces']);Object['keys'](_0x1062f5)['length']&&await this['store']['addSymbols'](_0x26d886,_0x1062f5);}}}['bindSelf'](_0x4942a1,_0x2d5364,_0x501e58){for(const _0x2e292e of[_0x501e58,'$self']){const _0x302b6d=_0x4942a1[_0x2e292e];if(_0x302b6d)for(const _0x4a5440 of _0x302b6d){!_0x2d5364['includes'](_0x4a5440)&&_0x2d5364['push'](_0x4a5440);}}}['bindSymbols'](_0x4b5c0c,_0x57ce6c,_0x3d2c70,_0x5afb1c,_0x1461cb){const _0x5e2c62={},_0x2a34d7={..._0x3d2c70};for(const _0x49d477 of _0x1461cb){const _0x140c0d=''+_0x5afb1c+_0x49d477;if(!_0x2a34d7[_0x140c0d]){if(_0x4b5c0c>_0x57ce6c)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x1dcfd0=(0x0,utils_1['getSymKey'])(_0x4b5c0c);_0x4b5c0c++,_0x5e2c62[_0x140c0d]=_0x1dcfd0,_0x2a34d7[_0x140c0d]=_0x1dcfd0;}}return _0x5e2c62;}['copyJobSchemas'](){const _0x314527=this['manifest']['app']['graphs'];for(const _0x679fe6 of _0x314527){const _0x3fb117=_0x679fe6['output']?.['schema'],_0x4f9510=_0x679fe6['input']?.['schema'];if(!_0x3fb117&&!_0x4f9510)continue;const _0x4a41f2=_0x679fe6['activities'];for(const _0x4fd251 in _0x4a41f2){if(_0x4a41f2[_0x4fd251]['type']==='trigger'){const _0x19749a=_0x4a41f2[_0x4fd251];_0x3fb117&&(!_0x19749a['job']&&(_0x19749a['job']={}),_0x19749a['job']['schema']=_0x3fb117),_0x4f9510&&(_0x19749a['output']={'schema':_0x4f9510});}}}}['bindBackRefs'](){for(const _0x28769e of this['manifest']['app']['graphs']){const _0x359f06=_0x28769e['activities'],_0x295cfc=this['findTrigger'](_0x28769e)[0x0];for(const _0x53dab3 in _0x359f06){_0x359f06[_0x53dab3]['trigger']=_0x295cfc,_0x359f06[_0x53dab3]['subscribes']=_0x28769e['subscribes'],_0x28769e['publishes']&&(_0x359f06[_0x53dab3]['publishes']=_0x28769e['publishes']),_0x359f06[_0x53dab3]['expire']=_0x28769e['expire']??undefined,_0x359f06[_0x53dab3]['persistent']=_0x28769e['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x415eff of this['manifest']['app']['graphs']){const _0x375097=_0x415eff['activities'];for(const _0x482d63 in _0x375097){const _0x1f632f=_0x375097[_0x482d63];_0x1f632f['type']==='cycle'&&(_0x375097[_0x1f632f['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x4ee87f of this['manifest']['app']['graphs']){const _0x383555=_0x4ee87f['activities'];for(const _0x114096 in _0x383555){const _0xce28d=_0x383555[_0x114096];['worker','await']['includes'](_0xce28d['type'])&&_0xce28d['topic']&&!_0xce28d['subtype']&&(_0xce28d['subtype']=_0xce28d['topic']);}}}['convertActivitiesToHooks'](){for(const _0x4ff8e0 of this['manifest']['app']['graphs']){const _0x2f831c=_0x4ff8e0['activities'];for(const _0x5b774a in _0x2f831c){const _0x2d459f=_0x2f831c[_0x5b774a];['activity']['includes'](_0x2d459f['type'])&&(_0x2d459f['type']='hook');}}}async['bindParents'](){const _0x2b445c=this['manifest']['app']['graphs'];for(const _0x39901b of _0x2b445c){if(_0x39901b['transitions'])for(const _0x5e504b in _0x39901b['transitions']){const _0x2494d3=_0x39901b['transitions'][_0x5e504b];for(const _0x3fda9c of _0x2494d3){const _0x2bb326=_0x3fda9c['to'];_0x39901b['activities'][_0x2bb326]['parent']=_0x5e504b;}_0x39901b['activities'][_0x5e504b]['transitions']=_0x2494d3;}}}['collectValues'](_0x5aa893,_0x1b831d){for(const [_0x410065,_0x17a40e]of Object['entries'](_0x5aa893)){if(_0x410065==='enum'||_0x410065==='examples'||_0x410065==='default'){if(Array['isArray'](_0x17a40e))for(const _0x1ceb24 of _0x17a40e){typeof _0x1ceb24==='string'&&_0x1ceb24['length']>0x5&&_0x1b831d['add'](_0x1ceb24);}else typeof _0x17a40e==='string'&&_0x17a40e['length']>0x5&&_0x1b831d['add'](_0x17a40e);}else typeof _0x17a40e==='object'&&this['collectValues'](_0x17a40e,_0x1b831d);}}['traverse'](_0x120b15,_0x53f3d5){for(const _0x3297f9 of Object['values'](_0x120b15)){typeof _0x3297f9==='object'&&('schema'in _0x3297f9?this['collectValues'](_0x3297f9['schema'],_0x53f3d5):this['traverse'](_0x3297f9,_0x53f3d5));}}async['generateSymVals'](){const _0x585cec=new Set();for(const _0x1f4361 of this['manifest']['app']['graphs']){this['traverse'](_0x1f4361,_0x585cec);}const _0x1608c5=await this['store']['getSymbolValues'](),_0x43d0c0=Object['keys'](_0x1608c5)['length'],_0x24c908=Math['pow'](0x34,0x2)-0x1,_0x16128b=serializer_1['SerializerService']['filterSymVals'](_0x43d0c0,_0x24c908,_0x1608c5,_0x585cec);await this['store']['addSymbolValues'](_0x16128b);}['resolveJobMapsPaths'](){function _0x27b4b9(_0x50cc1e){const _0x7be913=[];function _0x2f9450(_0x56d67e,_0x26b19e=[]){for(const _0x1fea54 in _0x56d67e){if(typeof _0x56d67e[_0x1fea54]==='object'&&_0x56d67e[_0x1fea54]!==null&&!('@pipe'in _0x56d67e[_0x1fea54])){const _0x433e49=[..._0x26b19e,_0x1fea54];_0x2f9450(_0x56d67e[_0x1fea54],_0x433e49);}else{const _0x16bac3=[..._0x26b19e,_0x1fea54]['join']('/');if(!_0x16bac3['includes']('[')){const _0x1448fa='data/'+_0x16bac3;!_0x7be913['includes'](_0x1448fa)&&_0x7be913['push'](_0x1448fa);}else{const [_0x5eafe2,_0x46be17]=_0x16bac3['split']('['),[_0x2d53d4,_0x8125ac]=_0x46be17['split'](']');if(!isNaN(parseInt(_0x2d53d4)))for(let _0x3da0a7=0x0;_0x3da0a7<parseInt(_0x2d53d4);_0x3da0a7++){const _0x24e4f1='data/'+_0x5eafe2+'/'+_0x3da0a7;!_0x7be913['includes'](_0x24e4f1)&&_0x7be913['push'](_0x24e4f1);}}}}}return _0x50cc1e&&_0x2f9450(_0x50cc1e),_0x7be913;}for(const _0x210506 of this['manifest']['app']['graphs']){let _0x25862b=[];const [,_0x13fd9f]=this['findTrigger'](_0x210506);for(const _0x27616b in _0x210506['activities']){const _0x23ec53=_0x210506['activities'][_0x27616b];_0x25862b=_0x25862b['concat'](_0x27b4b9(_0x23ec53['job']?.['maps']));}_0x13fd9f['PRODUCES']=_0x25862b;}}['resolveMappingDependencies'](){const _0x1ac809=[];function _0x9ff71c(_0x252ebc,_0x3bc179){for(const _0x1d317b in _0x252ebc){if(typeof _0x252ebc[_0x1d317b]==='string'){const _0xd90173=_0x252ebc[_0x1d317b],_0x5c4b61=_0xd90173['match'](/^\{[^@].*}$/);_0x5c4b61&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0xd90173)&&(_0xd90173['split']('.')[0x1]!=='input'&&(_0x1ac809['push'](_0xd90173),_0x3bc179['push'](_0xd90173)));}else typeof _0x252ebc[_0x1d317b]==='object'&&_0x252ebc[_0x1d317b]!==null&&_0x9ff71c(_0x252ebc[_0x1d317b],_0x3bc179);}}const _0x511e65=this['manifest']['app']['graphs'];for(const _0x2687a8 of _0x511e65){const _0x5b53fa=_0x2687a8['activities'];for(const _0xd04a60 in _0x5b53fa){const _0x342958=_0x5b53fa[_0xd04a60];_0x342958['consumes']=[],_0x9ff71c(_0x342958,_0x342958['consumes']),_0x342958['consumes']=this['groupMappingRules'](_0x342958['consumes']);}}const _0x5d7e2d=this['groupMappingRules'](_0x1ac809);for(const _0x1d270e of _0x511e65){const _0x344dda=_0x1d270e['activities'];for(const _0x146e5a in _0x344dda){const _0x1653fc=_0x344dda[_0x146e5a];_0x1653fc['produces']=_0x5d7e2d[''+_0x146e5a]||[];}}}['groupMappingRules'](_0x2ecd36){_0x2ecd36=Array['from'](new Set(_0x2ecd36))['sort']();const _0x1a6d04={};for(const _0x55f196 of _0x2ecd36){const [_0x147ff9,_0x29958c]=this['resolveMappableValue'](_0x55f196);!_0x1a6d04[_0x147ff9]&&(_0x1a6d04[_0x147ff9]=[]),_0x1a6d04[_0x147ff9]['push'](_0x29958c);}return _0x1a6d04;}['resolveMappableValue'](_0x1058e1){_0x1058e1=_0x1058e1['substring'](0x1,_0x1058e1['length']-0x1);const _0x183aca=_0x1058e1['split']('.');if(_0x183aca[0x0]==='$job'){const [_0x3734af,..._0x4cb831]=_0x183aca;return[_0x3734af,_0x4cb831['join']('/')];}else{const [_0x2006bd,_0x5c6bae,_0x469c9d,..._0x5d87f6]=_0x183aca,_0x103c3b={'hook':'hook/data','input':'input/data','output':_0x469c9d==='data'?'output/data':'output/metadata'}[_0x5c6bae];return[_0x2006bd,_0x103c3b+'/'+_0x5d87f6['join']('/')];}}async['deployActivitySchemas'](){const _0x5e6819=this['manifest']['app']['graphs'],_0x5340e7={};for(const _0x4d0955 of _0x5e6819){const _0x22e989=_0x4d0955['activities'];for(const _0xfafd22 in _0x22e989){const _0x4aed7e=_0x22e989[_0xfafd22];delete _0x4aed7e['transitions'],_0x5340e7[_0xfafd22]=_0x4aed7e;}}await this['store']['setSchemas'](_0x5340e7,this['getVID']());}async['deploySubscriptions'](){const _0x41777d=this['manifest']['app']['graphs'],_0x3c4dc8={};for(const _0x3f307f of _0x41777d){const _0x1c64d3=_0x3f307f['activities'],_0x3e1197=_0x3f307f['subscribes'];for(const _0x4feb10 in _0x1c64d3){if(_0x1c64d3[_0x4feb10]['type']==='trigger'){_0x3c4dc8[_0x3e1197]=_0x4feb10;break;}}}await this['store']['setSubscriptions'](_0x3c4dc8,this['getVID']());}['findTrigger'](_0x5389f1){for(const _0x557266 in _0x5389f1['activities']){const _0x1aa320=_0x5389f1['activities'][_0x557266];if(_0x1aa320['type']==='trigger')return[_0x557266,_0x1aa320];}return null;}async['deployTransitions'](){const _0x557cab=this['manifest']['app']['graphs'],_0x2d183d={};for(const _0x1dc64b of _0x557cab){if(_0x1dc64b['subscribes']&&_0x1dc64b['subscribes']['startsWith']('.')){const [_0x28f602]=this['findTrigger'](_0x1dc64b);_0x28f602&&(_0x2d183d[_0x1dc64b['subscribes']]={[_0x28f602]:!![]});}if(_0x1dc64b['transitions'])for(const _0x32fa5b in _0x1dc64b['transitions']){const _0x16a568=_0x1dc64b['transitions'][_0x32fa5b],_0x1b8fe1={};for(const _0x6b2c1 of _0x16a568){const _0x54b556=_0x6b2c1['to'];_0x6b2c1['conditions']?_0x1b8fe1[_0x54b556]=_0x6b2c1['conditions']:_0x1b8fe1[_0x54b556]=!![];}Object['keys'](_0x1b8fe1)['length']>0x0&&(_0x2d183d['.'+_0x32fa5b]=_0x1b8fe1);}}await this['store']['setTransitions'](_0x2d183d,this['getVID']());}async['deployHookPatterns'](){const _0x329d7a=this['manifest']['app']['graphs'],_0x352c3d={};for(const _0xa0ebd5 of _0x329d7a){if(_0xa0ebd5['hooks'])for(const _0x8f6519 in _0xa0ebd5['hooks']){_0x352c3d[_0x8f6519]=_0xa0ebd5['hooks'][_0x8f6519];const _0x2796a1=_0xa0ebd5['hooks'][_0x8f6519][0x0]['to'],_0x4f9d22=_0xa0ebd5['activities'][_0x2796a1];_0x4f9d22&&(!_0x4f9d22['hook']&&(_0x4f9d22['hook']={}),_0x4f9d22['hook']['topic']=_0x8f6519);}}await this['store']['setHookRules'](_0x352c3d);}async['deployConsumerGroups'](){const _0x3390d3={'appId':this['manifest']['app']['id']},_0x3b2913=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x3390d3);await this['deployConsumerGroup'](_0x3b2913,'ENGINE');for(const _0x59fd61 of this['manifest']['app']['graphs']){const _0x2d7703=_0x59fd61['activities'];for(const _0x45863f in _0x2d7703){const _0x2e8ddf=_0x2d7703[_0x45863f];if(_0x2e8ddf['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x2e8ddf['subtype'],{})===_0x2e8ddf['subtype']){_0x3390d3['topic']=_0x2e8ddf['subtype'];const _0x16a4ef=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x3390d3);await this['deployConsumerGroup'](_0x16a4ef,'WORKER');}}}}async['deployConsumerGroup'](_0x35d510,_0x3374a5){try{await this['stream']['createConsumerGroup'](_0x35d510,_0x3374a5);}catch(_0x38244d){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x35d510,'group':_0x3374a5});}}}exports['Deployer']=Deployer;
|
|
1
|
+
'use strict';(function(_0x28516d,_0x116222){const _0x50bbd8=_0x42b6,_0x468955=_0x28516d();while(!![]){try{const _0xdd4ef9=parseInt(_0x50bbd8(0x171))/0x1*(parseInt(_0x50bbd8(0x16f))/0x2)+-parseInt(_0x50bbd8(0x16b))/0x3*(parseInt(_0x50bbd8(0x16a))/0x4)+-parseInt(_0x50bbd8(0x167))/0x5*(parseInt(_0x50bbd8(0x170))/0x6)+-parseInt(_0x50bbd8(0x169))/0x7+-parseInt(_0x50bbd8(0x16e))/0x8*(-parseInt(_0x50bbd8(0x16d))/0x9)+parseInt(_0x50bbd8(0x16c))/0xa+-parseInt(_0x50bbd8(0x168))/0xb;if(_0xdd4ef9===_0x116222)break;else _0x468955['push'](_0x468955['shift']());}catch(_0x5f12f9){_0x468955['push'](_0x468955['shift']());}}}(_0x19b5,0xd52c0));function _0x42b6(_0x28ef11,_0x53b580){const _0x19b5d3=_0x19b5();return _0x42b6=function(_0x42b65b,_0x4c5f77){_0x42b65b=_0x42b65b-0x167;let _0x3cd8d2=_0x19b5d3[_0x42b65b];return _0x3cd8d2;},_0x42b6(_0x28ef11,_0x53b580);}function _0x19b5(){const _0x124c4c=['5981535cFGuRe','292108wRVtMg','3TbFCnF','11881360UWuXpp','14594940KLvnTU','8mLOzuT','6086vayaPF','502782zQdqAn','101WSDLgb','35rbRIRt','8028636MrOQay'];_0x19b5=function(){return _0x124c4c;};return _0x19b5();}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(_0x2ffd39){this['manifest']=null,this['manifest']=_0x2ffd39;}async['deploy'](_0x80ae61,_0x3f9aef){this['store']=_0x80ae61,this['stream']=_0x3f9aef,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 _0x4a575d of this['manifest']['app']['graphs']){const [,_0x8dd842]=this['findTrigger'](_0x4a575d),_0x25265a=_0x8dd842['subscribes'],[_0x593fce,_0x367c93,_0x2b9ec5]=await this['store']['reserveSymbolRange']('$'+_0x25265a,DEFAULT_RANGE_SIZE,'JOB'),_0x4f3670='',_0x27ff2a=this['bindSymbols'](_0x593fce,_0x367c93,_0x2b9ec5,_0x4f3670,_0x8dd842['PRODUCES']);Object['keys'](_0x27ff2a)['length']&&await this['store']['addSymbols']('$'+_0x25265a,_0x27ff2a);for(const [_0x25bcbe,_0x4341f8]of Object['entries'](_0x4a575d['activities'])){const [_0x129456,_0x28a25b,_0x103f99]=await this['store']['reserveSymbolRange'](_0x25bcbe,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x2dc991=_0x25bcbe+'/';this['bindSelf'](_0x4341f8['consumes'],_0x4341f8['produces'],_0x25bcbe);const _0x181e8c=this['bindSymbols'](_0x129456,_0x28a25b,_0x103f99,_0x2dc991,_0x4341f8['produces']);Object['keys'](_0x181e8c)['length']&&await this['store']['addSymbols'](_0x25bcbe,_0x181e8c);}}}['bindSelf'](_0x2444b7,_0x17f680,_0xc283d9){for(const _0x223464 of[_0xc283d9,'$self']){const _0x57433e=_0x2444b7[_0x223464];if(_0x57433e)for(const _0x142bf3 of _0x57433e){!_0x17f680['includes'](_0x142bf3)&&_0x17f680['push'](_0x142bf3);}}}['bindSymbols'](_0x58efed,_0x5a1ca5,_0x9d5ba0,_0x1f1f33,_0x3497fd){const _0x1c7de0={},_0x27c3bf={..._0x9d5ba0};for(const _0x39246f of _0x3497fd){const _0x163279=''+_0x1f1f33+_0x39246f;if(!_0x27c3bf[_0x163279]){if(_0x58efed>_0x5a1ca5)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x4aa82d=(0x0,utils_1['getSymKey'])(_0x58efed);_0x58efed++,_0x1c7de0[_0x163279]=_0x4aa82d,_0x27c3bf[_0x163279]=_0x4aa82d;}}return _0x1c7de0;}['copyJobSchemas'](){const _0x5ec52e=this['manifest']['app']['graphs'];for(const _0x5d602e of _0x5ec52e){const _0x12422f=_0x5d602e['output']?.['schema'],_0x3d1cf3=_0x5d602e['input']?.['schema'];if(!_0x12422f&&!_0x3d1cf3)continue;const _0x12d408=_0x5d602e['activities'];for(const _0x3847b5 in _0x12d408){if(_0x12d408[_0x3847b5]['type']==='trigger'){const _0x3e81f1=_0x12d408[_0x3847b5];_0x12422f&&(!_0x3e81f1['job']&&(_0x3e81f1['job']={}),_0x3e81f1['job']['schema']=_0x12422f),_0x3d1cf3&&(_0x3e81f1['output']={'schema':_0x3d1cf3});}}}}['bindBackRefs'](){for(const _0x1abade of this['manifest']['app']['graphs']){const _0x2f90d6=_0x1abade['activities'],_0x157ce7=this['findTrigger'](_0x1abade)[0x0];for(const _0x4b383a in _0x2f90d6){_0x2f90d6[_0x4b383a]['trigger']=_0x157ce7,_0x2f90d6[_0x4b383a]['subscribes']=_0x1abade['subscribes'],_0x1abade['publishes']&&(_0x2f90d6[_0x4b383a]['publishes']=_0x1abade['publishes']),_0x2f90d6[_0x4b383a]['expire']=_0x1abade['expire']??undefined,_0x2f90d6[_0x4b383a]['persistent']=_0x1abade['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x56531c of this['manifest']['app']['graphs']){const _0x341d63=_0x56531c['activities'];for(const _0x2a021f in _0x341d63){const _0x356df3=_0x341d63[_0x2a021f];_0x356df3['type']==='cycle'&&(_0x341d63[_0x356df3['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x25b5ac of this['manifest']['app']['graphs']){const _0x2bea65=_0x25b5ac['activities'];for(const _0x4670db in _0x2bea65){const _0x4eb699=_0x2bea65[_0x4670db];['worker','await']['includes'](_0x4eb699['type'])&&_0x4eb699['topic']&&!_0x4eb699['subtype']&&(_0x4eb699['subtype']=_0x4eb699['topic']);}}}['convertActivitiesToHooks'](){for(const _0x5d552 of this['manifest']['app']['graphs']){const _0x26dfbd=_0x5d552['activities'];for(const _0x4cc37e in _0x26dfbd){const _0x4d91fc=_0x26dfbd[_0x4cc37e];['activity']['includes'](_0x4d91fc['type'])&&(_0x4d91fc['type']='hook');}}}async['bindParents'](){const _0x1cc68f=this['manifest']['app']['graphs'];for(const _0x19994e of _0x1cc68f){if(_0x19994e['transitions'])for(const _0x4a279d in _0x19994e['transitions']){const _0x14d624=_0x19994e['transitions'][_0x4a279d];for(const _0x14c52b of _0x14d624){const _0xd00be2=_0x14c52b['to'];_0x19994e['activities'][_0xd00be2]['parent']=_0x4a279d;}_0x19994e['activities'][_0x4a279d]['transitions']=_0x14d624;}}}['collectValues'](_0xff45ea,_0x477436){for(const [_0x41bebc,_0x5d5b18]of Object['entries'](_0xff45ea)){if(_0x41bebc==='enum'||_0x41bebc==='examples'||_0x41bebc==='default'){if(Array['isArray'](_0x5d5b18))for(const _0x3e0baa of _0x5d5b18){typeof _0x3e0baa==='string'&&_0x3e0baa['length']>0x5&&_0x477436['add'](_0x3e0baa);}else typeof _0x5d5b18==='string'&&_0x5d5b18['length']>0x5&&_0x477436['add'](_0x5d5b18);}else typeof _0x5d5b18==='object'&&this['collectValues'](_0x5d5b18,_0x477436);}}['traverse'](_0xe35b8d,_0x55fc1d){for(const _0x440473 of Object['values'](_0xe35b8d)){typeof _0x440473==='object'&&('schema'in _0x440473?this['collectValues'](_0x440473['schema'],_0x55fc1d):this['traverse'](_0x440473,_0x55fc1d));}}async['generateSymVals'](){const _0x51dc1a=new Set();for(const _0x5f03ab of this['manifest']['app']['graphs']){this['traverse'](_0x5f03ab,_0x51dc1a);}const _0x420290=await this['store']['getSymbolValues'](),_0x535eb9=Object['keys'](_0x420290)['length'],_0x296ae1=Math['pow'](0x34,0x2)-0x1,_0x277caf=serializer_1['SerializerService']['filterSymVals'](_0x535eb9,_0x296ae1,_0x420290,_0x51dc1a);await this['store']['addSymbolValues'](_0x277caf);}['resolveJobMapsPaths'](){function _0x4f27fe(_0x4ce59e){const _0x98b04b=[];function _0x170e7b(_0x27cee2,_0x11b203=[]){for(const _0x2a3962 in _0x27cee2){if(typeof _0x27cee2[_0x2a3962]==='object'&&_0x27cee2[_0x2a3962]!==null&&!('@pipe'in _0x27cee2[_0x2a3962])){const _0x568fff=[..._0x11b203,_0x2a3962];_0x170e7b(_0x27cee2[_0x2a3962],_0x568fff);}else{const _0x27034e=[..._0x11b203,_0x2a3962]['join']('/');if(!_0x27034e['includes']('[')){const _0xbe633b='data/'+_0x27034e;!_0x98b04b['includes'](_0xbe633b)&&_0x98b04b['push'](_0xbe633b);}else{const [_0x44bc6d,_0x4ccf40]=_0x27034e['split']('['),[_0x376542,_0x3f40f7]=_0x4ccf40['split'](']');if(!isNaN(parseInt(_0x376542)))for(let _0x30424f=0x0;_0x30424f<parseInt(_0x376542);_0x30424f++){const _0x424120='data/'+_0x44bc6d+'/'+_0x30424f;!_0x98b04b['includes'](_0x424120)&&_0x98b04b['push'](_0x424120);}}}}}return _0x4ce59e&&_0x170e7b(_0x4ce59e),_0x98b04b;}for(const _0x7996a9 of this['manifest']['app']['graphs']){let _0x3099be=[];const [,_0x1b0e86]=this['findTrigger'](_0x7996a9);for(const _0xbe3587 in _0x7996a9['activities']){const _0x1ff10b=_0x7996a9['activities'][_0xbe3587];_0x3099be=_0x3099be['concat'](_0x4f27fe(_0x1ff10b['job']?.['maps']));}_0x1b0e86['PRODUCES']=_0x3099be;}}['resolveMappingDependencies'](){const _0x5416e4=[];function _0x1b6327(_0x4a395,_0x2b75b0){for(const _0x5c10e0 in _0x4a395){if(typeof _0x4a395[_0x5c10e0]==='string'){const _0x1f8fd5=_0x4a395[_0x5c10e0],_0x5270ce=_0x1f8fd5['match'](/^\{[^@].*}$/);_0x5270ce&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x1f8fd5)&&(_0x1f8fd5['split']('.')[0x1]!=='input'&&(_0x5416e4['push'](_0x1f8fd5),_0x2b75b0['push'](_0x1f8fd5)));}else typeof _0x4a395[_0x5c10e0]==='object'&&_0x4a395[_0x5c10e0]!==null&&_0x1b6327(_0x4a395[_0x5c10e0],_0x2b75b0);}}const _0x59c663=this['manifest']['app']['graphs'];for(const _0x345397 of _0x59c663){const _0xfb48f7=_0x345397['activities'];for(const _0x25f545 in _0xfb48f7){const _0x56c7aa=_0xfb48f7[_0x25f545];_0x56c7aa['consumes']=[],_0x1b6327(_0x56c7aa,_0x56c7aa['consumes']),_0x56c7aa['consumes']=this['groupMappingRules'](_0x56c7aa['consumes']);}}const _0x25fb21=this['groupMappingRules'](_0x5416e4);for(const _0xe51a62 of _0x59c663){const _0x2ccac2=_0xe51a62['activities'];for(const _0x2c6acc in _0x2ccac2){const _0x3bf5a0=_0x2ccac2[_0x2c6acc];_0x3bf5a0['produces']=_0x25fb21[''+_0x2c6acc]||[];}}}['groupMappingRules'](_0x3cc42a){_0x3cc42a=Array['from'](new Set(_0x3cc42a))['sort']();const _0x3bfde6={};for(const _0x19be11 of _0x3cc42a){const [_0x40d1cd,_0x35888b]=this['resolveMappableValue'](_0x19be11);!_0x3bfde6[_0x40d1cd]&&(_0x3bfde6[_0x40d1cd]=[]),_0x3bfde6[_0x40d1cd]['push'](_0x35888b);}return _0x3bfde6;}['resolveMappableValue'](_0xbb5ed5){_0xbb5ed5=_0xbb5ed5['substring'](0x1,_0xbb5ed5['length']-0x1);const _0x1fd4dd=_0xbb5ed5['split']('.');if(_0x1fd4dd[0x0]==='$job'){const [_0x26d510,..._0x565fc6]=_0x1fd4dd;return[_0x26d510,_0x565fc6['join']('/')];}else{const [_0xd74cdf,_0x4fec97,_0x1c3677,..._0x42e30b]=_0x1fd4dd,_0x46d506={'hook':'hook/data','input':'input/data','output':_0x1c3677==='data'?'output/data':'output/metadata'}[_0x4fec97];return[_0xd74cdf,_0x46d506+'/'+_0x42e30b['join']('/')];}}async['deployActivitySchemas'](){const _0x2eeb0a=this['manifest']['app']['graphs'],_0x45f70c={};for(const _0x592828 of _0x2eeb0a){const _0x37683b=_0x592828['activities'];for(const _0x5abaeb in _0x37683b){const _0x45843=_0x37683b[_0x5abaeb];delete _0x45843['transitions'],_0x45f70c[_0x5abaeb]=_0x45843;}}await this['store']['setSchemas'](_0x45f70c,this['getVID']());}async['deploySubscriptions'](){const _0x23e872=this['manifest']['app']['graphs'],_0x1269d4={};for(const _0x373bf8 of _0x23e872){const _0x4434ce=_0x373bf8['activities'],_0x751508=_0x373bf8['subscribes'];for(const _0x54ebbb in _0x4434ce){if(_0x4434ce[_0x54ebbb]['type']==='trigger'){_0x1269d4[_0x751508]=_0x54ebbb;break;}}}await this['store']['setSubscriptions'](_0x1269d4,this['getVID']());}['findTrigger'](_0x405b4c){for(const _0x425ebd in _0x405b4c['activities']){const _0x410f58=_0x405b4c['activities'][_0x425ebd];if(_0x410f58['type']==='trigger')return[_0x425ebd,_0x410f58];}return null;}async['deployTransitions'](){const _0x95188c=this['manifest']['app']['graphs'],_0x493423={};for(const _0x5f3d38 of _0x95188c){if(_0x5f3d38['subscribes']&&_0x5f3d38['subscribes']['startsWith']('.')){const [_0x4b610e]=this['findTrigger'](_0x5f3d38);_0x4b610e&&(_0x493423[_0x5f3d38['subscribes']]={[_0x4b610e]:!![]});}if(_0x5f3d38['transitions'])for(const _0x3cb661 in _0x5f3d38['transitions']){const _0x21094c=_0x5f3d38['transitions'][_0x3cb661],_0x4d29ca={};for(const _0x4761d5 of _0x21094c){const _0x5bece4=_0x4761d5['to'];_0x4761d5['conditions']?_0x4d29ca[_0x5bece4]=_0x4761d5['conditions']:_0x4d29ca[_0x5bece4]=!![];}Object['keys'](_0x4d29ca)['length']>0x0&&(_0x493423['.'+_0x3cb661]=_0x4d29ca);}}await this['store']['setTransitions'](_0x493423,this['getVID']());}async['deployHookPatterns'](){const _0x4a08a0=this['manifest']['app']['graphs'],_0x768d7f={};for(const _0x297d9e of _0x4a08a0){if(_0x297d9e['hooks'])for(const _0xd502e7 in _0x297d9e['hooks']){_0x768d7f[_0xd502e7]=_0x297d9e['hooks'][_0xd502e7];const _0x10c0f7=_0x297d9e['hooks'][_0xd502e7][0x0]['to'],_0x358724=_0x297d9e['activities'][_0x10c0f7];_0x358724&&(!_0x358724['hook']&&(_0x358724['hook']={}),_0x358724['hook']['topic']=_0xd502e7);}}await this['store']['setHookRules'](_0x768d7f);}async['deployConsumerGroups'](){const _0x20e7cf={'appId':this['manifest']['app']['id']},_0x17998e=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x20e7cf);await this['deployConsumerGroup'](_0x17998e,'ENGINE');for(const _0x2228f2 of this['manifest']['app']['graphs']){const _0x4e7d0d=_0x2228f2['activities'];for(const _0x383b54 in _0x4e7d0d){const _0x2848a6=_0x4e7d0d[_0x383b54];if(_0x2848a6['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x2848a6['subtype'],{})===_0x2848a6['subtype']){_0x20e7cf['topic']=_0x2848a6['subtype'];const _0x2fa546=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x20e7cf);await this['deployConsumerGroup'](_0x2fa546,'WORKER');}}}}async['deployConsumerGroup'](_0x1892f2,_0x5aa70a){try{await this['stream']['createConsumerGroup'](_0x1892f2,_0x5aa70a);}catch(_0x504d30){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x1892f2,'group':_0x5aa70a});}}}exports['Deployer']=Deployer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x365e86,_0x1b275d){const _0x30c7c0=_0x2b56,_0x335283=_0x365e86();while(!![]){try{const _0x562cba=-parseInt(_0x30c7c0(0x1ed))/0x1*(parseInt(_0x30c7c0(0x1f0))/0x2)+parseInt(_0x30c7c0(0x1f5))/0x3+-parseInt(_0x30c7c0(0x1f1))/0x4*(-parseInt(_0x30c7c0(0x1f2))/0x5)+parseInt(_0x30c7c0(0x1ee))/0x6*(-parseInt(_0x30c7c0(0x1f3))/0x7)+parseInt(_0x30c7c0(0x1f4))/0x8+parseInt(_0x30c7c0(0x1ef))/0x9*(parseInt(_0x30c7c0(0x1eb))/0xa)+-parseInt(_0x30c7c0(0x1ec))/0xb;if(_0x562cba===_0x1b275d)break;else _0x335283['push'](_0x335283['shift']());}catch(_0x2f3b9d){_0x335283['push'](_0x335283['shift']());}}}(_0x2acc,0x4582d));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x366068,_0x3f7efb,_0x1d2f06,_0x54b624){if(_0x54b624===undefined)_0x54b624=_0x1d2f06;var _0x711ced=Object['getOwnPropertyDescriptor'](_0x3f7efb,_0x1d2f06);(!_0x711ced||('get'in _0x711ced?!_0x3f7efb['__esModule']:_0x711ced['writable']||_0x711ced['configurable']))&&(_0x711ced={'enumerable':!![],'get':function(){return _0x3f7efb[_0x1d2f06];}}),Object['defineProperty'](_0x366068,_0x54b624,_0x711ced);}:function(_0x444694,_0x5c3579,_0x421ef9,_0xb780f6){if(_0xb780f6===undefined)_0xb780f6=_0x421ef9;_0x444694[_0xb780f6]=_0x5c3579[_0x421ef9];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x1968bd,_0x2f0031){Object['defineProperty'](_0x1968bd,'default',{'enumerable':!![],'value':_0x2f0031});}:function(_0x570332,_0x4574d3){_0x570332['default']=_0x4574d3;}),__importStar=this&&this['__importStar']||function(_0xa2bd9b){if(_0xa2bd9b&&_0xa2bd9b['__esModule'])return _0xa2bd9b;var _0xf667fa={};if(_0xa2bd9b!=null){for(var _0x623e93 in _0xa2bd9b)if(_0x623e93!=='default'&&Object['prototype']['hasOwnProperty']['call'](_0xa2bd9b,_0x623e93))__createBinding(_0xf667fa,_0xa2bd9b,_0x623e93);}return __setModuleDefault(_0xf667fa,_0xa2bd9b),_0xf667fa;},__importDefault=this&&this['__importDefault']||function(_0x12e8aa){return _0x12e8aa&&_0x12e8aa['__esModule']?_0x12e8aa:{'default':_0x12e8aa};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CompilerService']=void 0x0;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');function _0x2b56(_0x28d1e7,_0x3f2912){const _0x2accb6=_0x2acc();return _0x2b56=function(_0x2b5640,_0x116ece){_0x2b5640=_0x2b5640-0x1eb;let _0x5821ca=_0x2accb6[_0x2b5640];return _0x5821ca;},_0x2b56(_0x28d1e7,_0x3f2912);}class CompilerService{constructor(_0x18ce92,_0x101cd5,_0x41c1a4){this['store']=_0x18ce92,this['stream']=_0x101cd5,this['logger']=_0x41c1a4;}async['plan'](_0x5cf649){try{let _0x4a3dba;this['isPath'](_0x5cf649)?_0x4a3dba=await json_schema_ref_parser_1['default']['dereference'](_0x5cf649):_0x4a3dba=js_yaml_1['default']['load'](_0x5cf649);const _0x50d8e1=new validator_1['Validator'](_0x4a3dba);return _0x50d8e1['validate'](this['store']),_0x4a3dba;}catch(_0x33a695){this['logger']['error']('compiler-plan-error',_0x33a695);}}['isPath'](_0x2e8a9c){return!_0x2e8a9c['trim']()['startsWith']('app:');}async['deploy'](_0x295fc8){try{let _0x39b769;this['isPath'](_0x295fc8)?(_0x39b769=await json_schema_ref_parser_1['default']['dereference'](_0x295fc8),await this['saveAsJSON'](_0x295fc8,_0x39b769)):_0x39b769=js_yaml_1['default']['load'](_0x295fc8);const _0x452110=new validator_1['Validator'](_0x39b769);_0x452110['validate'](this['store']);const _0x316fae=new deployer_1['Deployer'](_0x39b769);return await _0x316fae['deploy'](this['store'],this['stream']),await this['store']['setApp'](_0x39b769['app']['id'],_0x39b769['app']['version']),_0x39b769;}catch(_0x351c36){this['logger']['error']('compiler-deploy-error',_0x351c36);}}async['activate'](_0x157215,_0xd23a7e){return await this['store']['activateAppVersion'](_0x157215,_0xd23a7e);}async['saveAsJSON'](_0x1ff92d,_0x403f78){const _0x5d9570=JSON['stringify'](_0x403f78,null,0x2),_0x416b33=path['join'](path['dirname'](_0x1ff92d),'.hotmesh.'+_0x403f78['app']['id']+'.'+_0x403f78['app']['version']+'.json');await fs['writeFile'](_0x416b33,_0x5d9570,'utf8');}}exports['CompilerService']=CompilerService;function _0x2acc(){const _0x13c587=['1292289VjBfEQ','362090DJcwQW','2638515GsmnHf','3QFxjbR','282612ztGpGO','90OXIRTK','297224YFUGZO','3076CyEZkp','1310tWwgFx','63AGYgQk','3200040oGpEvN'];_0x2acc=function(){return _0x13c587;};return _0x2acc();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x195c97,_0x1e66ad){const _0x75f755=_0x21a3,_0x478215=_0x195c97();while(!![]){try{const _0x4efa0e=-parseInt(_0x75f755(0x1f2))/0x1+-parseInt(_0x75f755(0x1f9))/0x2+-parseInt(_0x75f755(0x1f8))/0x3+parseInt(_0x75f755(0x1f6))/0x4*(-parseInt(_0x75f755(0x1f0))/0x5)+parseInt(_0x75f755(0x1f1))/0x6*(parseInt(_0x75f755(0x1f5))/0x7)+-parseInt(_0x75f755(0x1f4))/0x8+-parseInt(_0x75f755(0x1f3))/0x9*(-parseInt(_0x75f755(0x1f7))/0xa);if(_0x4efa0e===_0x1e66ad)break;else _0x478215['push'](_0x478215['shift']());}catch(_0x2d547f){_0x478215['push'](_0x478215['shift']());}}}(_0x2722,0xdbf3f));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Validator']=void 0x0;const pipe_1=require('../pipe');function _0x2722(){const _0x3e6143=['4592424IOGREj','7NUhqzD','13204GCGqgY','3538840LHxjGN','3326556NZzQxe','3400098FWtzcd','1915kgMlsD','10089546JSJoSD','1087803CsQAoc','126CKytyv'];_0x2722=function(){return _0x3e6143;};return _0x2722();}function _0x21a3(_0x55986f,_0x31a4ce){const _0x2722a1=_0x2722();return _0x21a3=function(_0x21a3d0,_0x1b0a3e){_0x21a3d0=_0x21a3d0-0x1f0;let _0x4a6c54=_0x2722a1[_0x21a3d0];return _0x4a6c54;},_0x21a3(_0x55986f,_0x31a4ce);}class Validator{constructor(_0x55dddf){this['manifest']=null,this['activityIds']=[],this['mappingStatements']={},this['store']=null,this['manifest']=_0x55dddf;}async['validate'](_0x2dbc6f){this['store']=_0x2dbc6f,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 _0x559e55=new Set();this['manifest']['app']['graphs']['forEach'](_0x54dcb0=>{const _0x3b7b3f=Object['keys'](_0x54dcb0['activities']);_0x3b7b3f['forEach'](_0x1f0a12=>{if(_0x559e55['has'](_0x1f0a12))throw new Error('Duplicate\x20activity\x20id\x20found:\x20'+_0x1f0a12);else _0x559e55['add'](_0x1f0a12);});}),this['activityIds']=Array['from'](_0x559e55);}['isMappingStatement'](_0x563dc2){return typeof _0x563dc2==='string'&&_0x563dc2['startsWith']('{')&&_0x563dc2['endsWith']('}');}['extractMappingStatements'](_0x2c43d4,_0x5b2583,_0x15e4bb){for(const _0x435089 in _0x2c43d4){if(typeof _0x2c43d4[_0x435089]==='object'&&_0x2c43d4[_0x435089]!==null)this['extractMappingStatements'](_0x2c43d4[_0x435089],_0x5b2583,_0x15e4bb);else this['isMappingStatement'](_0x2c43d4[_0x435089])&&(!_0x5b2583[_0x15e4bb]&&(_0x5b2583[_0x15e4bb]=[]),_0x5b2583[_0x15e4bb]['push'](_0x2c43d4[_0x435089]));}}['getMappingStatements'](){const _0x36a35b={};this['manifest']['app']['graphs']['forEach'](_0x41a302=>{const _0x7a0529=_0x41a302['activities'];for(const _0x81ef17 in _0x7a0529){const _0x3387fe=_0x7a0529[_0x81ef17];this['extractMappingStatements'](_0x3387fe,_0x36a35b,_0x81ef17);}}),this['mappingStatements']=_0x36a35b;}['validateReferencedActivityIds'](){const _0x519ca4=this['mappingStatements'],_0x2c41f2=this['activityIds'];for(const _0x28907b in _0x519ca4){const _0x1e5f83=_0x519ca4[_0x28907b];_0x1e5f83['forEach'](_0x30209b=>{if(_0x30209b['startsWith']('{')&&_0x30209b['endsWith']('}')){const _0x2815d6=_0x30209b['slice'](0x1,-0x1)['split']('.'),_0x1bedbd=_0x2815d6[0x0];if(!(Validator['SYS_VARS']['includes'](_0x1bedbd)||_0x2c41f2['includes'](_0x1bedbd)||this['isFunction'](_0x30209b)||this['isContextVariable'](_0x30209b)))throw new Error('Mapping\x20statement\x20references\x20non-existent\x20activity:\x20'+_0x30209b);}});}}['isFunction'](_0x158e86){return _0x158e86['startsWith']('{@')&&pipe_1['Pipe']['resolveFunction'](_0x158e86);}['isContextVariable'](_0x17f22a){return['{$input}','{$output}','{$item}','{$key}','{$index}']['includes'](_0x17f22a);}['validateMappingStatements'](){}['validateTransitions'](){}['validateTransitionConditions'](){}['validateStats'](){}['validateSchemas'](){}['validateUniqueHandledTopics'](){}['validateGraphPublishSubscribe'](){}['validateHooks'](){}['validateConditionalStatements'](){}}exports['Validator']=Validator,Validator['SYS_VARS']=['$app','$self','$graph','$job'],Validator['CONTEXT_VARS']=['{$input}','{$output}','{$item}','{$key}','{$index}'];
|
|
@@ -40,6 +40,7 @@ class PostgresConnection extends __1.AbstractConnection {
|
|
|
40
40
|
host: options.host ?? 'unknown',
|
|
41
41
|
database: options.database ?? 'unknown',
|
|
42
42
|
port: options.port ?? 'unknown',
|
|
43
|
+
...error,
|
|
43
44
|
});
|
|
44
45
|
throw new Error(`postgres-provider-connection-failed: ${error.message}`);
|
|
45
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x8b9a3d,_0x12955b){const _0x6d68aa=_0x7f5c,_0xf3d39=_0x8b9a3d();while(!![]){try{const _0x5c713d=parseInt(_0x6d68aa(0x1e9))/0x1*(parseInt(_0x6d68aa(0x1e8))/0x2)+parseInt(_0x6d68aa(0x1e4))/0x3*(parseInt(_0x6d68aa(0x1e5))/0x4)+parseInt(_0x6d68aa(0x1ec))/0x5+parseInt(_0x6d68aa(0x1ed))/0x6+parseInt(_0x6d68aa(0x1e6))/0x7*(parseInt(_0x6d68aa(0x1ee))/0x8)+-parseInt(_0x6d68aa(0x1e7))/0x9*(-parseInt(_0x6d68aa(0x1ea))/0xa)+-parseInt(_0x6d68aa(0x1eb))/0xb;if(_0x5c713d===_0x12955b)break;else _0xf3d39['push'](_0xf3d39['shift']());}catch(_0x3500b9){_0xf3d39['push'](_0xf3d39['shift']());}}}(_0x19c1,0x7843c));var __importDefault=this&&this['__importDefault']||function(_0x164204){return _0x164204&&_0x164204['__esModule']?_0x164204:{'default':_0x164204};};function _0x19c1(){const _0x3621ae=['1771525ZzQclc','5067918rYObSj','49960nuKXQC','63GxmHWf','12364EZLpLm','763MLMZtK','691965GwYTLL','254VzvdJd','6953bqTlJq','40saHSSD','29067951WHmmdD'];_0x19c1=function(){return _0x3621ae;};return _0x19c1();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['EngineService']=void 0x0;const key_1=require('../../modules/key'),enums_1=require('../../modules/enums'),utils_1=require('../../modules/utils'),activities_1=__importDefault(require('../activities')),compiler_1=require('../compiler'),exporter_1=require('../exporter'),reporter_1=require('../reporter'),router_1=require('../router'),serializer_1=require('../serializer'),factory_1=require('../search/factory'),factory_2=require('../store/factory'),factory_3=require('../stream/factory'),factory_4=require('../sub/factory'),task_1=require('../task'),stream_1=require('../../types/stream');class EngineService{constructor(){this['cacheMode']='cache',this['untilVersion']=null,this['jobCallbacks']={},this['reporting']=![],this['jobId']=0x1;}static async['init'](_0x22273c,_0x395b48,_0xeed56b,_0x237687,_0xb4ac77){if(_0x237687['engine']){const _0x15661b=new EngineService();_0x15661b['verifyEngineFields'](_0x237687),_0x15661b['namespace']=_0x22273c,_0x15661b['appId']=_0x395b48,_0x15661b['guid']=_0xeed56b,_0x15661b['logger']=_0xb4ac77,await _0x15661b['initSearchChannel'](_0x237687['engine']['store']),await _0x15661b['initStoreChannel'](_0x237687['engine']['store']),await _0x15661b['initSubChannel'](_0x237687['engine']['sub'],_0x237687['engine']['pub']??_0x237687['engine']['store']),await _0x15661b['initStreamChannel'](_0x237687['engine']['stream'],_0x237687['engine']['store']),_0x15661b['router']=await _0x15661b['initRouter'](_0x237687);const _0x1b0d4e=_0x15661b['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x15661b['appId']});return _0x15661b['router']['consumeMessages'](_0x1b0d4e,'ENGINE',_0x15661b['guid'],_0x15661b['processStreamMessage']['bind'](_0x15661b)),_0x15661b['taskService']=new task_1['TaskService'](_0x15661b['store'],_0xb4ac77),_0x15661b['exporter']=new exporter_1['ExporterService'](_0x15661b['appId'],_0x15661b['store'],_0xb4ac77),_0x15661b['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x15661b;}}['verifyEngineFields'](_0x57a9a6){if(!(0x0,utils_1['identifyProvider'])(_0x57a9a6['engine']['store'])||!(0x0,utils_1['identifyProvider'])(_0x57a9a6['engine']['stream'])||!(0x0,utils_1['identifyProvider'])(_0x57a9a6['engine']['sub']))throw new Error('engine\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields.');}async['initSearchChannel'](_0x33622b,_0xf67d57){this['search']=await factory_1['SearchServiceFactory']['init'](_0x33622b,_0xf67d57,this['namespace'],this['appId'],this['logger']);}async['initStoreChannel'](_0x43e58c){this['store']=await factory_2['StoreServiceFactory']['init'](_0x43e58c,this['namespace'],this['appId'],this['logger']);}async['initSubChannel'](_0x199903,_0x3e5647){this['subscribe']=await factory_4['SubServiceFactory']['init'](_0x199903,_0x3e5647,this['namespace'],this['appId'],this['guid'],this['logger']);}async['initStreamChannel'](_0x2e1779,_0x47db7e){this['stream']=await factory_3['StreamServiceFactory']['init'](_0x2e1779,_0x47db7e,this['namespace'],this['appId'],this['logger']);}async['initRouter'](_0x358f5f){const _0x31e0d5=await this['store']['getThrottleRate'](':');return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['ENGINE'],'reclaimDelay':_0x358f5f['engine']['reclaimDelay'],'reclaimCount':_0x358f5f['engine']['reclaimCount'],'throttle':_0x31e0d5,'readonly':_0x358f5f['engine']['readonly']},this['stream'],this['logger']);}async['fetchAndVerifyVID'](_0x3b145a,_0x2934fc=0x0){if(isNaN(Number(_0x3b145a['version']))){const _0x5827c9=await this['store']['getApp'](_0x3b145a['id'],!![]);if(!isNaN(Number(_0x5827c9['version']))){if(!this['apps'])this['apps']={};return this['apps'][_0x3b145a['id']]=_0x5827c9,{'id':_0x3b145a['id'],'version':_0x5827c9['version']};}else{if(_0x2934fc<0xa)return await(0x0,utils_1['sleepFor'])(enums_1['HMSH_QUORUM_DELAY_MS']*0x2),await this['fetchAndVerifyVID'](_0x3b145a,_0x2934fc+0x1);else this['logger']['error']('engine-vid-resolution-error',{'id':_0x3b145a['id'],'guid':this['guid']});}}return _0x3b145a;}async['getVID'](_0x35d931){if(this['cacheMode']==='nocache'){const _0x57e105=await this['store']['getApp'](this['appId'],!![]);if(_0x57e105['version']['toString']()===this['untilVersion']['toString']()){if(!this['apps'])this['apps']={};this['apps'][this['appId']]=_0x57e105,this['setCacheMode']('cache',_0x57e105['version']['toString']());}return{'id':this['appId'],'version':_0x57e105['version']};}else return!this['apps']&&_0x35d931?(this['apps']={},this['apps'][this['appId']]=_0x35d931,_0x35d931):await this['fetchAndVerifyVID']({'id':this['appId'],'version':this['apps']?.[this['appId']]['version']});}['setCacheMode'](_0x12c96e,_0x4f16a6){this['logger']['info']('engine-executable-cache',{'mode':_0x12c96e,[_0x12c96e==='cache'?'target':'until']:_0x4f16a6}),this['cacheMode']=_0x12c96e,this['untilVersion']=_0x4f16a6;}async['routeToSubscribers'](_0x85c182,_0xcfc228){const _0x4b0892=this['jobCallbacks'][_0xcfc228['metadata']['jid']];_0x4b0892&&(this['delistJobCallback'](_0xcfc228['metadata']['jid']),_0x4b0892(_0x85c182,_0xcfc228));}async['processWebHooks'](){this['taskService']['processWebHooks'](this['hook']['bind'](this));}async['processTimeHooks'](){this['taskService']['processTimeHooks'](this['hookTime']['bind'](this));}async['throttle'](_0x17d0a3){try{this['router']?.['setThrottle'](_0x17d0a3);}catch(_0x4d73b1){this['logger']['error']('engine-throttle-error',{'error':_0x4d73b1});}}async['initActivity'](_0x500b94,_0x14960c={},_0x352183){const [_0x56809b,_0x26ff9e]=await this['getSchema'](_0x500b94),_0xafb780=activities_1['default'][utils_1['polyfill']['resolveActivityType'](_0x26ff9e['type'])];if(_0xafb780){const _0x4fb5da=(0x0,utils_1['formatISODate'])(new Date()),_0x1c9d38={'aid':_0x56809b,'atp':_0x26ff9e['type'],'stp':_0x26ff9e['subtype'],'ac':_0x4fb5da,'au':_0x4fb5da},_0x2442b2=null;return new _0xafb780(_0x26ff9e,_0x14960c,_0x1c9d38,_0x2442b2,this,_0x352183);}else throw new Error('activity\x20type\x20'+_0x26ff9e['type']+'\x20not\x20found');}async['getSchema'](_0x4a9cfc){const _0x3175d5=await this['store']['getApp'](this['appId']);if(!_0x3175d5)throw new Error('no\x20app\x20found\x20for\x20id\x20'+this['appId']);if(this['isPrivate'](_0x4a9cfc)){const _0x4d3f95=_0x4a9cfc['substring'](0x1),_0x4f6aa8=await this['store']['getSchema'](_0x4d3f95,await this['getVID'](_0x3175d5));return[_0x4d3f95,_0x4f6aa8];}else{const _0x1f9278=await this['store']['getSubscription'](_0x4a9cfc,await this['getVID'](_0x3175d5));if(_0x1f9278){const _0x579a51=await this['store']['getSchema'](_0x1f9278,await this['getVID'](_0x3175d5));return[_0x1f9278,_0x579a51];}}throw new Error('no\x20subscription\x20found\x20for\x20topic\x20'+_0x4a9cfc+'\x20in\x20app\x20'+this['appId']+'\x20for\x20app\x20version\x20'+_0x3175d5['version']);}async['getSettings'](){return await this['store']['getSettings']();}['isPrivate'](_0x3f2ffd){return _0x3f2ffd['startsWith']('.');}async['plan'](_0x34b43a){const _0x3053fe=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x3053fe['plan'](_0x34b43a);}async['deploy'](_0x2dfe78){const _0x2ddb83=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x2ddb83['deploy'](_0x2dfe78);}async['getStats'](_0x27f886,_0x24703f){const {id:_0x2b934f,version:_0x40aed7}=await this['getVID'](),_0x3d4a1e=new reporter_1['ReporterService']({'id':_0x2b934f,'version':_0x40aed7},this['store'],this['logger']),_0x45f1bd=await this['resolveQuery'](_0x27f886,_0x24703f);return await _0x3d4a1e['getStats'](_0x45f1bd);}async['getIds'](_0xdd925a,_0x54c70d,_0xd7a8ee=[]){const {id:_0x44a778,version:_0x8d667}=await this['getVID'](),_0x3ddc6a=new reporter_1['ReporterService']({'id':_0x44a778,'version':_0x8d667},this['store'],this['logger']),_0x34d8e4=await this['resolveQuery'](_0xdd925a,_0x54c70d);return await _0x3ddc6a['getIds'](_0x34d8e4,_0xd7a8ee);}async['resolveQuery'](_0x597934,_0x81f316){const _0x711e0c=await this['initActivity'](_0x597934,_0x81f316['data']);return await _0x711e0c['getState'](),{'end':_0x81f316['end'],'start':_0x81f316['start'],'range':_0x81f316['range'],'granularity':_0x711e0c['resolveGranularity'](),'key':_0x711e0c['resolveJobKey'](_0x711e0c['createInputContext']()),'sparse':_0x81f316['sparse']};}async['processStreamMessage'](_0x245500){this['logger']['debug']('engine-process',{'jid':_0x245500['metadata']['jid'],'gid':_0x245500['metadata']['gid'],'dad':_0x245500['metadata']['dad'],'aid':_0x245500['metadata']['aid'],'status':_0x245500['status']||stream_1['StreamStatus']['SUCCESS'],'code':_0x245500['code']||0xc8,'type':_0x245500['type']});const _0x176a77={'metadata':{'guid':_0x245500['metadata']['guid'],'jid':_0x245500['metadata']['jid'],'gid':_0x245500['metadata']['gid'],'dad':_0x245500['metadata']['dad'],'aid':_0x245500['metadata']['aid']},'data':_0x245500['data']};if(_0x245500['type']===stream_1['StreamDataType']['TIMEHOOK']){const _0x3525b6=await this['initActivity']('.'+_0x245500['metadata']['aid'],_0x176a77['data'],_0x176a77);await _0x3525b6['processTimeHookEvent'](_0x245500['metadata']['jid']);}else{if(_0x245500['type']===stream_1['StreamDataType']['WEBHOOK']){const _0x1f46e5=await this['initActivity']('.'+_0x245500['metadata']['aid'],_0x176a77['data'],_0x176a77);await _0x1f46e5['processWebHookEvent'](_0x245500['status'],_0x245500['code']);}else{if(_0x245500['type']===stream_1['StreamDataType']['TRANSITION']){const _0x43ecec=await this['initActivity']('.'+_0x245500['metadata']['aid'],_0x176a77['data'],_0x176a77);await _0x43ecec['process']();}else{if(_0x245500['type']===stream_1['StreamDataType']['AWAIT']){_0x176a77['metadata']={..._0x176a77['metadata'],'pj':_0x245500['metadata']['jid'],'pg':_0x245500['metadata']['gid'],'pd':_0x245500['metadata']['dad'],'pa':_0x245500['metadata']['aid'],'px':_0x245500['metadata']['await']===![],'trc':_0x245500['metadata']['trc'],'spn':_0x245500['metadata']['spn']};const _0x16f08f=await this['initActivity'](_0x245500['metadata']['topic'],_0x245500['data'],_0x176a77);await _0x16f08f['process']();}else{if(_0x245500['type']===stream_1['StreamDataType']['RESULT']){const _0x34ca8c=await this['initActivity']('.'+_0x176a77['metadata']['aid'],_0x245500['data'],_0x176a77);await _0x34ca8c['processEvent'](_0x245500['status'],_0x245500['code']);}else{const _0x13bca6=await this['initActivity']('.'+_0x245500['metadata']['aid'],_0x245500['data'],_0x176a77);await _0x13bca6['processEvent'](_0x245500['status'],_0x245500['code'],'output');}}}}}this['logger']['debug']('engine-process-end',{'jid':_0x245500['metadata']['jid'],'gid':_0x245500['metadata']['gid'],'aid':_0x245500['metadata']['aid']});}async['execAdjacentParent'](_0x24b6cb,_0x42f368,_0x353584=![]){if(this['hasParentJob'](_0x24b6cb)){const _0x7e1a7c=this['resolveError'](_0x42f368['metadata']),_0x31ac56=_0x24b6cb['$self']?.['output']?.['metadata']?.['l2s']||_0x24b6cb['$self']?.['output']?.['metadata']?.['l1s'],_0x376e3a={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x24b6cb['metadata']['pj'],'gid':_0x24b6cb['metadata']['pg'],'dad':_0x24b6cb['metadata']['pd'],'aid':_0x24b6cb['metadata']['pa'],'trc':_0x24b6cb['metadata']['trc'],'spn':_0x31ac56},'type':stream_1['StreamDataType']['RESULT'],'data':_0x42f368['data']};if(_0x7e1a7c&&_0x7e1a7c['code'])_0x376e3a['status']=stream_1['StreamStatus']['ERROR'],_0x376e3a['data']=_0x7e1a7c,_0x376e3a['code']=_0x7e1a7c['code'],_0x376e3a['stack']=_0x7e1a7c['stack'];else _0x353584?(_0x376e3a['status']=stream_1['StreamStatus']['PENDING'],_0x376e3a['code']=enums_1['HMSH_CODE_PENDING']):(_0x376e3a['status']=stream_1['StreamStatus']['SUCCESS'],_0x376e3a['code']=enums_1['HMSH_CODE_SUCCESS']);return await this['router']?.['publishMessage'](null,_0x376e3a);}}['hasParentJob'](_0x244289,_0x1ce488=![]){if(_0x1ce488)return Boolean(_0x244289['metadata']['pj']&&_0x244289['metadata']['pa']&&!_0x244289['metadata']['px']);return Boolean(_0x244289['metadata']['pj']&&_0x244289['metadata']['pa']);}['resolveError'](_0x496d9a){if(_0x496d9a&&_0x496d9a['err'])return JSON['parse'](_0x496d9a['err']);}async['interrupt'](_0xab6d7b,_0x682741,_0x4338cb={}){await this['store']['interrupt'](_0xab6d7b,_0x682741,_0x4338cb);const _0x32aeae=await this['getState'](_0xab6d7b,_0x682741),_0x3cfe9b={'interrupt':_0x4338cb['descend'],'expire':_0x4338cb['expire']};return await this['runJobCompletionTasks'](_0x32aeae,_0x3cfe9b);}async['scrub'](_0x11294c){await this['store']['scrub'](_0x11294c);}async['hook'](_0x58b5b2,_0x393a1b,_0x2f5726=stream_1['StreamStatus']['SUCCESS'],_0x54eb1b=0xc8){const _0x3b1395=await this['taskService']['getHookRule'](_0x58b5b2),[_0x100877]=await this['getSchema']('.'+_0x3b1395['to']),_0x5aa356={'type':stream_1['StreamDataType']['WEBHOOK'],'status':_0x2f5726,'code':_0x54eb1b,'metadata':{'guid':(0x0,utils_1['guid'])(),'aid':_0x100877,'topic':_0x58b5b2},'data':_0x393a1b};return await this['router']?.['publishMessage'](null,_0x5aa356);}async['hookTime'](_0x5d5bf,_0x20c14c,_0x1ef3d4,_0x5e98f8){if(_0x5e98f8==='interrupt'||_0x5e98f8==='expire')return await this['interrupt'](_0x1ef3d4,_0x5d5bf,{'suppress':!![],'expire':0x1});const [_0x3f03e5,..._0x13e8b8]=_0x1ef3d4['split'](','),_0x4e0214=','+_0x13e8b8['join'](','),_0x30191d={'type':stream_1['StreamDataType']['TIMEHOOK'],'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x5d5bf,'gid':_0x20c14c,'dad':_0x4e0214,'aid':_0x3f03e5},'data':{'timestamp':Date['now']()}};await this['router']?.['publishMessage'](null,_0x30191d);}async['hookAll'](_0x5d573e,_0x4aa5b2,_0x490998,_0x2c65c6=[]){const _0xb1bab6=await this['getVID'](),_0x584056=await this['taskService']['getHookRule'](_0x5d573e);if(_0x584056){const _0x2af7c2=await(0x0,utils_1['getSubscriptionTopic'])(_0x584056['to'],this['store'],_0xb1bab6),_0x4a388f=await this['resolveQuery'](_0x2af7c2,_0x490998),_0x50a8f1=new reporter_1['ReporterService'](_0xb1bab6,this['store'],this['logger']),_0x327070=await _0x50a8f1['getWorkItems'](_0x4a388f,_0x2c65c6);if(_0x327070['length']){const _0x54777d=new task_1['TaskService'](this['store'],this['logger']);await _0x54777d['enqueueWorkItems'](_0x327070['map'](_0x38766c=>[_0x5d573e,_0x38766c,_0x490998['scrub']||![],JSON['stringify'](_0x4aa5b2)]['join'](key_1['VALSEP']))),this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'work','originator':this['guid']},this['appId']);}return _0x327070;}else throw new Error('unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20'+_0x5d573e);}async['pub'](_0x216ffa,_0xa6e809,_0x3954b2,_0x9e0b63){const _0x32d5cd=await this['initActivity'](_0x216ffa,_0xa6e809,_0x3954b2);if(_0x32d5cd)return await _0x32d5cd['process'](_0x9e0b63);else throw new Error('unable\x20to\x20process\x20activity\x20for\x20topic\x20'+_0x216ffa);}async['sub'](_0x34bd61,_0xe36191){const _0x5c7103=async(_0xa1950d,_0x2c67f5)=>{_0xe36191(_0x2c67f5['topic'],_0x2c67f5['job']);};return await this['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x5c7103,this['appId'],_0x34bd61);}async['unsub'](_0x491a05){return await this['subscribe']['unsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x491a05);}async['psub'](_0x102eb9,_0x17b40f){const _0x51f620=async(_0x55cd68,_0x192d9b)=>{_0x17b40f(_0x192d9b['topic'],_0x192d9b['job']);};return await this['subscribe']['psubscribe'](key_1['KeyType']['QUORUM'],_0x51f620,this['appId'],_0x102eb9);}async['punsub'](_0x332fb4){return await this['subscribe']['punsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x332fb4);}async['pubsub'](_0x40e5b9,_0x4d16a2,_0x1c2352,_0x5d09ca=enums_1['HMSH_OTT_WAIT_TIME']){_0x1c2352={'metadata':{'ngn':this['guid'],'trc':_0x1c2352?.['metadata']?.['trc'],'spn':_0x1c2352?.['metadata']?.['spn']}};const _0x1f06b1=await this['pub'](_0x40e5b9,_0x4d16a2,_0x1c2352);return new Promise((_0x4ef182,_0x3599c5)=>{this['registerJobCallback'](_0x1f06b1,(_0x3f1289,_0x2bf7f0)=>{if(_0x2bf7f0['metadata']['err']){const _0x206e18=JSON['parse'](_0x2bf7f0['metadata']['err']);_0x3599c5({..._0x206e18,'job_id':_0x2bf7f0['metadata']['jid']});}else _0x4ef182(_0x2bf7f0);}),setTimeout(()=>{this['delistJobCallback'](_0x1f06b1),_0x3599c5({'code':enums_1['HMSH_CODE_TIMEOUT'],'message':'timeout','job_id':_0x1f06b1});},_0x5d09ca);});}async['pubOneTimeSubs'](_0x43d69e,_0x58e188,_0x4a235b=![]){if(this['hasOneTimeSubscription'](_0x43d69e)){const _0x2aeaf9={'type':'job','topic':_0x43d69e['metadata']['jid'],'job':(0x0,utils_1['restoreHierarchy'])(_0x58e188)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x2aeaf9,this['appId'],_0x43d69e['metadata']['ngn']);}}async['getPublishesTopic'](_0x5e9afe){const _0x32e951=await this['getVID'](),_0x2b3740=_0x5e9afe['metadata']['aid']||_0x5e9afe['$self']?.['output']?.['metadata']?.['aid'],_0x158a76=await this['store']['getSchema'](_0x2b3740,_0x32e951);return _0x158a76['publishes'];}async['pubPermSubs'](_0x49b63c,_0x46c8d2,_0x539644=![]){const _0x4d369e=await this['getPublishesTopic'](_0x49b63c);if(_0x4d369e){const _0x342f2c={'type':'job','topic':_0x4d369e,'job':(0x0,utils_1['restoreHierarchy'])(_0x46c8d2)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x342f2c,this['appId'],_0x4d369e+'.'+_0x49b63c['metadata']['jid']);}}async['add'](_0x319c45){return await this['router']?.['publishMessage'](null,_0x319c45);}['registerJobCallback'](_0x34faf6,_0x2c26e1){this['jobCallbacks'][_0x34faf6]=_0x2c26e1;}['delistJobCallback'](_0x2cb74d){delete this['jobCallbacks'][_0x2cb74d];}['hasOneTimeSubscription'](_0x51d56d){return Boolean(_0x51d56d['metadata']['ngn']);}async['runJobCompletionTasks'](_0x477b42,_0x9102b7={}){const _0x2a88ab=this['hasParentJob'](_0x477b42,!![]),_0x490e43=this['hasOneTimeSubscription'](_0x477b42),_0x305a52=await this['getPublishesTopic'](_0x477b42);let _0x4946f8;if(_0x2a88ab||_0x490e43||_0x305a52){const _0x3093c5=await this['getState'](_0x477b42['metadata']['tpc'],_0x477b42['metadata']['jid']);_0x4946f8=await this['execAdjacentParent'](_0x477b42,_0x3093c5,_0x9102b7['emit']),this['pubOneTimeSubs'](_0x477b42,_0x3093c5,_0x9102b7['emit']),this['pubPermSubs'](_0x477b42,_0x3093c5,_0x9102b7['emit']);}return!_0x9102b7['emit']&&this['taskService']['registerJobForCleanup'](_0x477b42['metadata']['jid'],this['resolveExpires'](_0x477b42,_0x9102b7),_0x9102b7),_0x4946f8;}['resolveExpires'](_0x855962,_0x4536d8){return _0x4536d8['expire']??_0x855962['metadata']['expire']??enums_1['HMSH_EXPIRE_JOB_SECONDS'];}async['export'](_0x45ee04){return await this['exporter']['export'](_0x45ee04);}async['getRaw'](_0x2443ab){return await this['store']['getRaw'](_0x2443ab);}async['getStatus'](_0x505687){const {id:_0x4640e3}=await this['getVID']();return await this['store']['getStatus'](_0x505687,_0x4640e3);}async['getState'](_0x2ee04a,_0x31b47a){const _0x41693a=await this['store']['getSymbols']('$'+_0x2ee04a),_0x4a9813={['$'+_0x2ee04a]:Object['keys'](_0x41693a)},_0x44647e={},_0x417a7d=await this['store']['getState'](_0x31b47a,_0x4a9813,_0x44647e);if(!_0x417a7d)throw new Error('not\x20found\x20'+_0x31b47a);const [_0x5157a9,_0x3f585f]=_0x417a7d,_0x576f59=(0x0,utils_1['restoreHierarchy'])(_0x5157a9);return _0x3f585f&&_0x576f59['metadata']&&(_0x576f59['metadata']['js']=_0x3f585f),_0x576f59;}async['getQueryState'](_0x3ab0c2,_0x27081e){return await this['store']['getQueryState'](_0x3ab0c2,_0x27081e);}async['compress'](_0x573f0d){const _0x3a0030=await this['store']['getSymbolValues'](),_0x23ebbb=Object['keys'](_0x3a0030)['length'],_0x1e8cd5=Math['pow'](0x34,0x2)-0x1,_0x32777e=serializer_1['SerializerService']['filterSymVals'](_0x23ebbb,_0x1e8cd5,_0x3a0030,new Set(_0x573f0d));return await this['store']['addSymbolValues'](_0x32777e);}}function _0x7f5c(_0x2e0719,_0x539aca){const _0x19c1cf=_0x19c1();return _0x7f5c=function(_0x7f5cc1,_0x22d82f){_0x7f5cc1=_0x7f5cc1-0x1e4;let _0x162411=_0x19c1cf[_0x7f5cc1];return _0x162411;},_0x7f5c(_0x2e0719,_0x539aca);}exports['EngineService']=EngineService;
|
|
1
|
+
'use strict';function _0x3b8a(){const _0x2b0f33=['3336WNkbWb','20268kSQcFU','1124810NTGfUu','3238900AWjnsJ','610rPBJXi','98uraMbL','126624knVlpP','2059977XIDRRM','369388QzeFFb','4490wVVyXK'];_0x3b8a=function(){return _0x2b0f33;};return _0x3b8a();}(function(_0xa17761,_0x33fa25){const _0x3b854e=_0x3d15,_0xfa75f6=_0xa17761();while(!![]){try{const _0x320f98=-parseInt(_0x3b854e(0x80))/0x1+-parseInt(_0x3b854e(0x84))/0x2+parseInt(_0x3b854e(0x89))/0x3+parseInt(_0x3b854e(0x85))/0x4+-parseInt(_0x3b854e(0x81))/0x5*(parseInt(_0x3b854e(0x82))/0x6)+parseInt(_0x3b854e(0x87))/0x7*(parseInt(_0x3b854e(0x88))/0x8)+parseInt(_0x3b854e(0x83))/0x9*(parseInt(_0x3b854e(0x86))/0xa);if(_0x320f98===_0x33fa25)break;else _0xfa75f6['push'](_0xfa75f6['shift']());}catch(_0x46b4d9){_0xfa75f6['push'](_0xfa75f6['shift']());}}}(_0x3b8a,0x6794b));var __importDefault=this&&this['__importDefault']||function(_0x191b42){return _0x191b42&&_0x191b42['__esModule']?_0x191b42:{'default':_0x191b42};};function _0x3d15(_0x32f4ac,_0x377692){const _0x3b8ab2=_0x3b8a();return _0x3d15=function(_0x3d15bd,_0x348467){_0x3d15bd=_0x3d15bd-0x80;let _0x3d0053=_0x3b8ab2[_0x3d15bd];return _0x3d0053;},_0x3d15(_0x32f4ac,_0x377692);}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'](_0x4a7434,_0x1d7941,_0x4fd78c,_0x3eff05,_0x54a32c){if(_0x3eff05['engine']){const _0x2cfe7d=new EngineService();_0x2cfe7d['verifyEngineFields'](_0x3eff05),_0x2cfe7d['namespace']=_0x4a7434,_0x2cfe7d['appId']=_0x1d7941,_0x2cfe7d['guid']=_0x4fd78c,_0x2cfe7d['logger']=_0x54a32c,await _0x2cfe7d['initSearchChannel'](_0x3eff05['engine']['store']),await _0x2cfe7d['initStoreChannel'](_0x3eff05['engine']['store']),await _0x2cfe7d['initSubChannel'](_0x3eff05['engine']['sub'],_0x3eff05['engine']['pub']??_0x3eff05['engine']['store']),await _0x2cfe7d['initStreamChannel'](_0x3eff05['engine']['stream'],_0x3eff05['engine']['store']),_0x2cfe7d['router']=await _0x2cfe7d['initRouter'](_0x3eff05);const _0x202ac8=_0x2cfe7d['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x2cfe7d['appId']});return _0x2cfe7d['router']['consumeMessages'](_0x202ac8,'ENGINE',_0x2cfe7d['guid'],_0x2cfe7d['processStreamMessage']['bind'](_0x2cfe7d)),_0x2cfe7d['taskService']=new task_1['TaskService'](_0x2cfe7d['store'],_0x54a32c),_0x2cfe7d['exporter']=new exporter_1['ExporterService'](_0x2cfe7d['appId'],_0x2cfe7d['store'],_0x54a32c),_0x2cfe7d['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x2cfe7d;}}['verifyEngineFields'](_0x363955){if(!(0x0,utils_1['identifyProvider'])(_0x363955['engine']['store'])||!(0x0,utils_1['identifyProvider'])(_0x363955['engine']['stream'])||!(0x0,utils_1['identifyProvider'])(_0x363955['engine']['sub']))throw new Error('engine\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields.');}async['initSearchChannel'](_0x29fa37,_0x88aeee){this['search']=await factory_1['SearchServiceFactory']['init'](_0x29fa37,_0x88aeee,this['namespace'],this['appId'],this['logger']);}async['initStoreChannel'](_0x4d24f0){this['store']=await factory_2['StoreServiceFactory']['init'](_0x4d24f0,this['namespace'],this['appId'],this['logger']);}async['initSubChannel'](_0x18e63e,_0xcd197a){this['subscribe']=await factory_4['SubServiceFactory']['init'](_0x18e63e,_0xcd197a,this['namespace'],this['appId'],this['guid'],this['logger']);}async['initStreamChannel'](_0x4f9b9b,_0x9ad424){this['stream']=await factory_3['StreamServiceFactory']['init'](_0x4f9b9b,_0x9ad424,this['namespace'],this['appId'],this['logger']);}async['initRouter'](_0x3d8cb4){const _0x316711=await this['store']['getThrottleRate'](':');return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['ENGINE'],'reclaimDelay':_0x3d8cb4['engine']['reclaimDelay'],'reclaimCount':_0x3d8cb4['engine']['reclaimCount'],'throttle':_0x316711,'readonly':_0x3d8cb4['engine']['readonly']},this['stream'],this['logger']);}async['fetchAndVerifyVID'](_0x56dc70,_0x406676=0x0){if(isNaN(Number(_0x56dc70['version']))){const _0x2e2bbd=await this['store']['getApp'](_0x56dc70['id'],!![]);if(!isNaN(Number(_0x2e2bbd['version']))){if(!this['apps'])this['apps']={};return this['apps'][_0x56dc70['id']]=_0x2e2bbd,{'id':_0x56dc70['id'],'version':_0x2e2bbd['version']};}else{if(_0x406676<0xa)return await(0x0,utils_1['sleepFor'])(enums_1['HMSH_QUORUM_DELAY_MS']*0x2),await this['fetchAndVerifyVID'](_0x56dc70,_0x406676+0x1);else this['logger']['error']('engine-vid-resolution-error',{'id':_0x56dc70['id'],'guid':this['guid']});}}return _0x56dc70;}async['getVID'](_0x27f5ff){if(this['cacheMode']==='nocache'){const _0x52d817=await this['store']['getApp'](this['appId'],!![]);if(_0x52d817['version']['toString']()===this['untilVersion']['toString']()){if(!this['apps'])this['apps']={};this['apps'][this['appId']]=_0x52d817,this['setCacheMode']('cache',_0x52d817['version']['toString']());}return{'id':this['appId'],'version':_0x52d817['version']};}else return!this['apps']&&_0x27f5ff?(this['apps']={},this['apps'][this['appId']]=_0x27f5ff,_0x27f5ff):await this['fetchAndVerifyVID']({'id':this['appId'],'version':this['apps']?.[this['appId']]['version']});}['setCacheMode'](_0x502fc9,_0x2c7303){this['logger']['info']('engine-executable-cache',{'mode':_0x502fc9,[_0x502fc9==='cache'?'target':'until']:_0x2c7303}),this['cacheMode']=_0x502fc9,this['untilVersion']=_0x2c7303;}async['routeToSubscribers'](_0x4adfa8,_0x2c46a1){const _0x203656=this['jobCallbacks'][_0x2c46a1['metadata']['jid']];_0x203656&&(this['delistJobCallback'](_0x2c46a1['metadata']['jid']),_0x203656(_0x4adfa8,_0x2c46a1));}async['processWebHooks'](){this['taskService']['processWebHooks'](this['hook']['bind'](this));}async['processTimeHooks'](){this['taskService']['processTimeHooks'](this['hookTime']['bind'](this));}async['throttle'](_0x1233a6){try{this['router']?.['setThrottle'](_0x1233a6);}catch(_0x2e04f6){this['logger']['error']('engine-throttle-error',{'error':_0x2e04f6});}}async['initActivity'](_0x26e8d5,_0x23c10f={},_0x20028b){const [_0x2d1b68,_0xe9697f]=await this['getSchema'](_0x26e8d5),_0x143029=activities_1['default'][utils_1['polyfill']['resolveActivityType'](_0xe9697f['type'])];if(_0x143029){const _0x14e3ab=(0x0,utils_1['formatISODate'])(new Date()),_0x864352={'aid':_0x2d1b68,'atp':_0xe9697f['type'],'stp':_0xe9697f['subtype'],'ac':_0x14e3ab,'au':_0x14e3ab},_0x4ced9d=null;return new _0x143029(_0xe9697f,_0x23c10f,_0x864352,_0x4ced9d,this,_0x20028b);}else throw new Error('activity\x20type\x20'+_0xe9697f['type']+'\x20not\x20found');}async['getSchema'](_0x996ef7){const _0x4fb477=await this['store']['getApp'](this['appId']);if(!_0x4fb477)throw new Error('no\x20app\x20found\x20for\x20id\x20'+this['appId']);if(this['isPrivate'](_0x996ef7)){const _0xbeecfd=_0x996ef7['substring'](0x1),_0x2f232a=await this['store']['getSchema'](_0xbeecfd,await this['getVID'](_0x4fb477));return[_0xbeecfd,_0x2f232a];}else{const _0x3c1c3e=await this['store']['getSubscription'](_0x996ef7,await this['getVID'](_0x4fb477));if(_0x3c1c3e){const _0x220d65=await this['store']['getSchema'](_0x3c1c3e,await this['getVID'](_0x4fb477));return[_0x3c1c3e,_0x220d65];}}throw new Error('no\x20subscription\x20found\x20for\x20topic\x20'+_0x996ef7+'\x20in\x20app\x20'+this['appId']+'\x20for\x20app\x20version\x20'+_0x4fb477['version']);}async['getSettings'](){return await this['store']['getSettings']();}['isPrivate'](_0x1d8dea){return _0x1d8dea['startsWith']('.');}async['plan'](_0x4a7bca){const _0xaf050a=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0xaf050a['plan'](_0x4a7bca);}async['deploy'](_0x1e2e1d){const _0x1e5134=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x1e5134['deploy'](_0x1e2e1d);}async['getStats'](_0x24f1ad,_0x10b550){const {id:_0x5872bd,version:_0x1bb14b}=await this['getVID'](),_0xaa6a5b=new reporter_1['ReporterService']({'id':_0x5872bd,'version':_0x1bb14b},this['store'],this['logger']),_0xb28da5=await this['resolveQuery'](_0x24f1ad,_0x10b550);return await _0xaa6a5b['getStats'](_0xb28da5);}async['getIds'](_0x3a58e3,_0x11c2cf,_0x1baf61=[]){const {id:_0x10d368,version:_0x2de494}=await this['getVID'](),_0x4a832b=new reporter_1['ReporterService']({'id':_0x10d368,'version':_0x2de494},this['store'],this['logger']),_0x117c4d=await this['resolveQuery'](_0x3a58e3,_0x11c2cf);return await _0x4a832b['getIds'](_0x117c4d,_0x1baf61);}async['resolveQuery'](_0x40a96e,_0x31a7ca){const _0x59cb78=await this['initActivity'](_0x40a96e,_0x31a7ca['data']);return await _0x59cb78['getState'](),{'end':_0x31a7ca['end'],'start':_0x31a7ca['start'],'range':_0x31a7ca['range'],'granularity':_0x59cb78['resolveGranularity'](),'key':_0x59cb78['resolveJobKey'](_0x59cb78['createInputContext']()),'sparse':_0x31a7ca['sparse']};}async['processStreamMessage'](_0x59db6c){this['logger']['debug']('engine-process',{'jid':_0x59db6c['metadata']['jid'],'gid':_0x59db6c['metadata']['gid'],'dad':_0x59db6c['metadata']['dad'],'aid':_0x59db6c['metadata']['aid'],'status':_0x59db6c['status']||stream_1['StreamStatus']['SUCCESS'],'code':_0x59db6c['code']||0xc8,'type':_0x59db6c['type']});const _0x4cd107={'metadata':{'guid':_0x59db6c['metadata']['guid'],'jid':_0x59db6c['metadata']['jid'],'gid':_0x59db6c['metadata']['gid'],'dad':_0x59db6c['metadata']['dad'],'aid':_0x59db6c['metadata']['aid']},'data':_0x59db6c['data']};if(_0x59db6c['type']===stream_1['StreamDataType']['TIMEHOOK']){const _0x57e2d0=await this['initActivity']('.'+_0x59db6c['metadata']['aid'],_0x4cd107['data'],_0x4cd107);await _0x57e2d0['processTimeHookEvent'](_0x59db6c['metadata']['jid']);}else{if(_0x59db6c['type']===stream_1['StreamDataType']['WEBHOOK']){const _0x196668=await this['initActivity']('.'+_0x59db6c['metadata']['aid'],_0x4cd107['data'],_0x4cd107);await _0x196668['processWebHookEvent'](_0x59db6c['status'],_0x59db6c['code']);}else{if(_0x59db6c['type']===stream_1['StreamDataType']['TRANSITION']){const _0x22cfad=await this['initActivity']('.'+_0x59db6c['metadata']['aid'],_0x4cd107['data'],_0x4cd107);await _0x22cfad['process']();}else{if(_0x59db6c['type']===stream_1['StreamDataType']['AWAIT']){_0x4cd107['metadata']={..._0x4cd107['metadata'],'pj':_0x59db6c['metadata']['jid'],'pg':_0x59db6c['metadata']['gid'],'pd':_0x59db6c['metadata']['dad'],'pa':_0x59db6c['metadata']['aid'],'px':_0x59db6c['metadata']['await']===![],'trc':_0x59db6c['metadata']['trc'],'spn':_0x59db6c['metadata']['spn']};const _0x491b34=await this['initActivity'](_0x59db6c['metadata']['topic'],_0x59db6c['data'],_0x4cd107);await _0x491b34['process']();}else{if(_0x59db6c['type']===stream_1['StreamDataType']['RESULT']){const _0x15f3a6=await this['initActivity']('.'+_0x4cd107['metadata']['aid'],_0x59db6c['data'],_0x4cd107);await _0x15f3a6['processEvent'](_0x59db6c['status'],_0x59db6c['code']);}else{const _0x4fc0d9=await this['initActivity']('.'+_0x59db6c['metadata']['aid'],_0x59db6c['data'],_0x4cd107);await _0x4fc0d9['processEvent'](_0x59db6c['status'],_0x59db6c['code'],'output');}}}}}this['logger']['debug']('engine-process-end',{'jid':_0x59db6c['metadata']['jid'],'gid':_0x59db6c['metadata']['gid'],'aid':_0x59db6c['metadata']['aid']});}async['execAdjacentParent'](_0x4784d0,_0x193d6d,_0x48be7f=![]){if(this['hasParentJob'](_0x4784d0)){const _0x5c89ec=this['resolveError'](_0x193d6d['metadata']),_0x598e90=_0x4784d0['$self']?.['output']?.['metadata']?.['l2s']||_0x4784d0['$self']?.['output']?.['metadata']?.['l1s'],_0x115d42={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x4784d0['metadata']['pj'],'gid':_0x4784d0['metadata']['pg'],'dad':_0x4784d0['metadata']['pd'],'aid':_0x4784d0['metadata']['pa'],'trc':_0x4784d0['metadata']['trc'],'spn':_0x598e90},'type':stream_1['StreamDataType']['RESULT'],'data':_0x193d6d['data']};if(_0x5c89ec&&_0x5c89ec['code'])_0x115d42['status']=stream_1['StreamStatus']['ERROR'],_0x115d42['data']=_0x5c89ec,_0x115d42['code']=_0x5c89ec['code'],_0x115d42['stack']=_0x5c89ec['stack'];else _0x48be7f?(_0x115d42['status']=stream_1['StreamStatus']['PENDING'],_0x115d42['code']=enums_1['HMSH_CODE_PENDING']):(_0x115d42['status']=stream_1['StreamStatus']['SUCCESS'],_0x115d42['code']=enums_1['HMSH_CODE_SUCCESS']);return await this['router']?.['publishMessage'](null,_0x115d42);}}['hasParentJob'](_0x40c086,_0xecdaae=![]){if(_0xecdaae)return Boolean(_0x40c086['metadata']['pj']&&_0x40c086['metadata']['pa']&&!_0x40c086['metadata']['px']);return Boolean(_0x40c086['metadata']['pj']&&_0x40c086['metadata']['pa']);}['resolveError'](_0x323351){if(_0x323351&&_0x323351['err'])return JSON['parse'](_0x323351['err']);}async['interrupt'](_0x2a59ca,_0x441c36,_0x52883e={}){await this['store']['interrupt'](_0x2a59ca,_0x441c36,_0x52883e);const _0x310c4c=await this['getState'](_0x2a59ca,_0x441c36),_0x5e38dc={'interrupt':_0x52883e['descend'],'expire':_0x52883e['expire']};return await this['runJobCompletionTasks'](_0x310c4c,_0x5e38dc);}async['scrub'](_0x324066){await this['store']['scrub'](_0x324066);}async['hook'](_0x2c5d5c,_0x2bd1c2,_0x299050=stream_1['StreamStatus']['SUCCESS'],_0x22f80d=0xc8){const _0x19a95b=await this['taskService']['getHookRule'](_0x2c5d5c),[_0xe5aa08]=await this['getSchema']('.'+_0x19a95b['to']),_0x1e1043={'type':stream_1['StreamDataType']['WEBHOOK'],'status':_0x299050,'code':_0x22f80d,'metadata':{'guid':(0x0,utils_1['guid'])(),'aid':_0xe5aa08,'topic':_0x2c5d5c},'data':_0x2bd1c2};return await this['router']?.['publishMessage'](null,_0x1e1043);}async['hookTime'](_0xa4b178,_0x5a27ef,_0x4dfe2b,_0x489515){if(_0x489515==='interrupt'||_0x489515==='expire')return await this['interrupt'](_0x4dfe2b,_0xa4b178,{'suppress':!![],'expire':0x1});const [_0xc834aa,..._0x3a80a0]=_0x4dfe2b['split'](','),_0x52d5e2=','+_0x3a80a0['join'](','),_0x5761c3={'type':stream_1['StreamDataType']['TIMEHOOK'],'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0xa4b178,'gid':_0x5a27ef,'dad':_0x52d5e2,'aid':_0xc834aa},'data':{'timestamp':Date['now']()}};await this['router']?.['publishMessage'](null,_0x5761c3);}async['hookAll'](_0x33158d,_0x765703,_0x4a5290,_0x3f5030=[]){const _0x5dd033=await this['getVID'](),_0x190dde=await this['taskService']['getHookRule'](_0x33158d);if(_0x190dde){const _0xed932c=await(0x0,utils_1['getSubscriptionTopic'])(_0x190dde['to'],this['store'],_0x5dd033),_0x21997d=await this['resolveQuery'](_0xed932c,_0x4a5290),_0x5683ed=new reporter_1['ReporterService'](_0x5dd033,this['store'],this['logger']),_0x1b5c60=await _0x5683ed['getWorkItems'](_0x21997d,_0x3f5030);if(_0x1b5c60['length']){const _0x3edcb9=new task_1['TaskService'](this['store'],this['logger']);await _0x3edcb9['enqueueWorkItems'](_0x1b5c60['map'](_0x3fb538=>[_0x33158d,_0x3fb538,_0x4a5290['scrub']||![],JSON['stringify'](_0x765703)]['join'](key_1['VALSEP']))),this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'work','originator':this['guid']},this['appId']);}return _0x1b5c60;}else throw new Error('unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20'+_0x33158d);}async['pub'](_0x842c46,_0x395bce,_0xf1b8b1,_0x37b534){const _0x363a7a=await this['initActivity'](_0x842c46,_0x395bce,_0xf1b8b1);if(_0x363a7a)return await _0x363a7a['process'](_0x37b534);else throw new Error('unable\x20to\x20process\x20activity\x20for\x20topic\x20'+_0x842c46);}async['sub'](_0x17d0d7,_0x474f68){const _0x1ac986=async(_0x2871f2,_0x365a27)=>{_0x474f68(_0x365a27['topic'],_0x365a27['job']);};return await this['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x1ac986,this['appId'],_0x17d0d7);}async['unsub'](_0x332c50){return await this['subscribe']['unsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x332c50);}async['psub'](_0x3bd7fe,_0x15fa59){const _0x1111ea=async(_0x5d65c4,_0x1c15cf)=>{_0x15fa59(_0x1c15cf['topic'],_0x1c15cf['job']);};return await this['subscribe']['psubscribe'](key_1['KeyType']['QUORUM'],_0x1111ea,this['appId'],_0x3bd7fe);}async['punsub'](_0x1fb209){return await this['subscribe']['punsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x1fb209);}async['pubsub'](_0x4f0669,_0x37129c,_0x4895d7,_0x8a9438=enums_1['HMSH_OTT_WAIT_TIME']){_0x4895d7={'metadata':{'ngn':this['guid'],'trc':_0x4895d7?.['metadata']?.['trc'],'spn':_0x4895d7?.['metadata']?.['spn']}};const _0x1ac0bf=await this['pub'](_0x4f0669,_0x37129c,_0x4895d7);return new Promise((_0xd7afd0,_0x3de4d2)=>{this['registerJobCallback'](_0x1ac0bf,(_0xd64030,_0x15283e)=>{if(_0x15283e['metadata']['err']){const _0x251033=JSON['parse'](_0x15283e['metadata']['err']);_0x3de4d2({..._0x251033,'job_id':_0x15283e['metadata']['jid']});}else _0xd7afd0(_0x15283e);}),setTimeout(()=>{this['delistJobCallback'](_0x1ac0bf),_0x3de4d2({'code':enums_1['HMSH_CODE_TIMEOUT'],'message':'timeout','job_id':_0x1ac0bf});},_0x8a9438);});}async['pubOneTimeSubs'](_0x53e1c1,_0x1a39b5,_0x3f3be0=![]){if(this['hasOneTimeSubscription'](_0x53e1c1)){const _0x1a4263={'type':'job','topic':_0x53e1c1['metadata']['jid'],'job':(0x0,utils_1['restoreHierarchy'])(_0x1a39b5)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x1a4263,this['appId'],_0x53e1c1['metadata']['ngn']);}}async['getPublishesTopic'](_0x47bf2c){const _0x1694c9=await this['getVID'](),_0x1d499d=_0x47bf2c['metadata']['aid']||_0x47bf2c['$self']?.['output']?.['metadata']?.['aid'],_0x153103=await this['store']['getSchema'](_0x1d499d,_0x1694c9);return _0x153103['publishes'];}async['pubPermSubs'](_0x288e22,_0x45fbf4,_0x1d0815=![]){const _0x3bbd1a=await this['getPublishesTopic'](_0x288e22);if(_0x3bbd1a){const _0x4076ea={'type':'job','topic':_0x3bbd1a,'job':(0x0,utils_1['restoreHierarchy'])(_0x45fbf4)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x4076ea,this['appId'],_0x3bbd1a+'.'+_0x288e22['metadata']['jid']);}}async['add'](_0x88267d){return await this['router']?.['publishMessage'](null,_0x88267d);}['registerJobCallback'](_0xfc1989,_0x2b34dd){this['jobCallbacks'][_0xfc1989]=_0x2b34dd;}['delistJobCallback'](_0x3a0b24){delete this['jobCallbacks'][_0x3a0b24];}['hasOneTimeSubscription'](_0x21c66f){return Boolean(_0x21c66f['metadata']['ngn']);}async['runJobCompletionTasks'](_0x635a3c,_0x36adaf={}){const _0x137a65=this['hasParentJob'](_0x635a3c,!![]),_0x1329bb=this['hasOneTimeSubscription'](_0x635a3c),_0x5fc5=await this['getPublishesTopic'](_0x635a3c);let _0x821b07;if(_0x137a65||_0x1329bb||_0x5fc5){const _0x378497=await this['getState'](_0x635a3c['metadata']['tpc'],_0x635a3c['metadata']['jid']);_0x821b07=await this['execAdjacentParent'](_0x635a3c,_0x378497,_0x36adaf['emit']),this['pubOneTimeSubs'](_0x635a3c,_0x378497,_0x36adaf['emit']),this['pubPermSubs'](_0x635a3c,_0x378497,_0x36adaf['emit']);}return!_0x36adaf['emit']&&this['taskService']['registerJobForCleanup'](_0x635a3c['metadata']['jid'],this['resolveExpires'](_0x635a3c,_0x36adaf),_0x36adaf),_0x821b07;}['resolveExpires'](_0x3fec42,_0x1ddece){return _0x1ddece['expire']??_0x3fec42['metadata']['expire']??enums_1['HMSH_EXPIRE_JOB_SECONDS'];}async['export'](_0x34da34){return await this['exporter']['export'](_0x34da34);}async['getRaw'](_0x341f36){return await this['store']['getRaw'](_0x341f36);}async['getStatus'](_0x4be4d2){const {id:_0x2ad1cd}=await this['getVID']();return await this['store']['getStatus'](_0x4be4d2,_0x2ad1cd);}async['getState'](_0x37f9b0,_0x356228){const _0x421543=await this['store']['getSymbols']('$'+_0x37f9b0),_0x57bbfa={['$'+_0x37f9b0]:Object['keys'](_0x421543)},_0x23b0b8={},_0x282690=await this['store']['getState'](_0x356228,_0x57bbfa,_0x23b0b8);if(!_0x282690)throw new Error('not\x20found\x20'+_0x356228);const [_0x2ccbe0,_0x54f934]=_0x282690,_0x45f80c=(0x0,utils_1['restoreHierarchy'])(_0x2ccbe0);return _0x54f934&&_0x45f80c['metadata']&&(_0x45f80c['metadata']['js']=_0x54f934),_0x45f80c;}async['getQueryState'](_0x1aa034,_0x443e88){return await this['store']['getQueryState'](_0x1aa034,_0x443e88);}async['compress'](_0x35b656){const _0x59c351=await this['store']['getSymbolValues'](),_0x1ae11f=Object['keys'](_0x59c351)['length'],_0x5e97dc=Math['pow'](0x34,0x2)-0x1,_0x33649f=serializer_1['SerializerService']['filterSymVals'](_0x1ae11f,_0x5e97dc,_0x59c351,new Set(_0x35b656));return await this['store']['addSymbolValues'](_0x33649f);}}exports['EngineService']=EngineService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x21fa70,_0x1ddf90){const _0x29a5ac=_0x34d9,_0x1617fa=_0x21fa70();while(!![]){try{const _0x3499e4=-parseInt(_0x29a5ac(0x1e8))/0x1*(-parseInt(_0x29a5ac(0x1f0))/0x2)+-parseInt(_0x29a5ac(0x1e6))/0x3+parseInt(_0x29a5ac(0x1e7))/0x4*(-parseInt(_0x29a5ac(0x1ea))/0x5)+-parseInt(_0x29a5ac(0x1e5))/0x6+-parseInt(_0x29a5ac(0x1eb))/0x7*(parseInt(_0x29a5ac(0x1ee))/0x8)+parseInt(_0x29a5ac(0x1e9))/0x9*(-parseInt(_0x29a5ac(0x1ec))/0xa)+parseInt(_0x29a5ac(0x1ed))/0xb*(parseInt(_0x29a5ac(0x1ef))/0xc);if(_0x3499e4===_0x1ddf90)break;else _0x1617fa['push'](_0x1617fa['shift']());}catch(_0x309c41){_0x1617fa['push'](_0x1617fa['shift']());}}}(_0x4586,0x81a78));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(_0x4b22b1,_0x2ea3e4,_0x56ede2){this['appId']=_0x4b22b1,this['logger']=_0x56ede2,this['store']=_0x2ea3e4;}async['export'](_0x424938,_0x13ac86={}){!this['symbols']&&(this['symbols']=this['store']['getAllSymbols'](),this['symbols']=await this['symbols']);const _0xadb316=[],_0x3eb1ad=await this['store']['getRaw'](_0x424938),_0x30ca8c=this['inflate'](_0x3eb1ad,_0xadb316);return _0x30ca8c;}['inflateKey'](_0x33be4f){return _0x33be4f in this['symbols']?this['symbols'][_0x33be4f]:_0x33be4f;}['inflate'](_0x3feecb,_0x213adf){const _0x372711={'hooks':{},'main':{'cursor':-0x1,'items':[]}},_0x771bd1={},_0xbd8333=this['inflateDependencyData'](_0x213adf,_0x372711),_0x515589=/^([a-zA-Z]{3}),(\d+(?:,\d+)*)/;return Object['entries'](_0x3feecb)['forEach'](([_0xf0b1c1,_0x4e3bf0])=>{const _0xaeb75a=_0xf0b1c1['match'](_0x515589);if(_0xaeb75a){const [_0x45d05b,_0x48885f,_0x1d4bae]=_0xaeb75a,_0x112462=this['inflateKey'](_0x48885f),_0x192108=''+_0x1d4bae['replace'](/,/g,'/'),_0x19a081=serializer_1['SerializerService']['fromString'](_0x4e3bf0);_0x771bd1[_0x192108+'/'+_0x112462]=_0x19a081;}else _0xf0b1c1['length']===0x3&&(_0x771bd1[this['inflateKey'](_0xf0b1c1)]=serializer_1['SerializerService']['fromString'](_0x4e3bf0));}),{'dependencies':_0xbd8333,'process':(0x0,utils_1['restoreHierarchy'])(_0x771bd1),'status':_0x3feecb[':']};}['inflateDependencyData'](_0x11ade0,_0x3ca4a2){const _0x4f0c19=/([0-9,]+)-(\d+)$/,_0xe8a300=/-(\d+)$/;return _0x11ade0['map']((_0xe4e268,_0xaf89e7)=>{const [_0xee6915,_0x4d861c,_0x311f94,_0x308e55,..._0x3b184d]=_0xe4e268['split'](key_1['VALSEP']),_0x3b1d65=_0x3b184d['join'](key_1['VALSEP']),_0x1e519b=_0x3b1d65['match'](_0x4f0c19);let _0x2a8a51,_0x21ee6a,_0x2fa7df='';if(_0x1e519b){const [_0x4a1f84,_0x2cc3b4,_0x5bd211]=_0x1e519b;_0x2fa7df=_0x2cc3b4['split'](',')['join']('/'),_0x2a8a51=_0x2fa7df+'['+_0x5bd211+']',_0x21ee6a='hook';}else{const _0x21bc53=_0x3b1d65['match'](_0xe8a300);if(_0x21bc53){const [_0x26ae7e,_0x124526]=_0x21bc53;_0x2a8a51='['+_0x124526+']',_0x21ee6a='flow';}else _0x2a8a51='/',_0x21ee6a='other';}return{'type':_0xee6915,'topic':_0x4d861c,'gid':_0x311f94,'jid':_0x3b1d65};});}}function _0x34d9(_0x1a9f4e,_0x252175){const _0x45867f=_0x4586();return _0x34d9=function(_0x34d97f,_0x54f604){_0x34d97f=_0x34d97f-0x1e5;let _0xf81dad=_0x45867f[_0x34d97f];return _0xf81dad;},_0x34d9(_0x1a9f4e,_0x252175);}exports['ExporterService']=ExporterService;function _0x4586(){const _0x19dfb9=['2356479qJiOxQ','1096gnPZhZ','1zNsczk','4544307UMuRSl','8975CfZLVu','161jIlPhZ','10jXJbKj','5797usgtmO','52784qfRDcA','67908SqFrCr','809638zngeSG','5532288VohOWG'];_0x4586=function(){return _0x19dfb9;};return _0x4586();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x303368,_0x3ac9b7){const _0x3fce10=_0x37f8,_0x2f4f20=_0x303368();while(!![]){try{const _0x8ea602=parseInt(_0x3fce10(0x13f))/0x1*(parseInt(_0x3fce10(0x13d))/0x2)+-parseInt(_0x3fce10(0x142))/0x3*(parseInt(_0x3fce10(0x140))/0x4)+parseInt(_0x3fce10(0x13a))/0x5+-parseInt(_0x3fce10(0x13e))/0x6+-parseInt(_0x3fce10(0x13b))/0x7*(-parseInt(_0x3fce10(0x13c))/0x8)+parseInt(_0x3fce10(0x141))/0x9+-parseInt(_0x3fce10(0x143))/0xa;if(_0x8ea602===_0x3ac9b7)break;else _0x2f4f20['push'](_0x2f4f20['shift']());}catch(_0x18597c){_0x2f4f20['push'](_0x2f4f20['shift']());}}}(_0x22a2,0xdee82));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['MapperService']=void 0x0;function _0x22a2(){const _0x3dd669=['1815883MZRVQJ','148oEuWmR','11129814ZDsJPc','39021Tgamuo','29083610rBvQjl','8201350Ebjeqn','2917516SrZTeq','16VLepjQ','2TImZEZ','7342374dyDKzA'];_0x22a2=function(){return _0x3dd669;};return _0x22a2();}function _0x37f8(_0x519b24,_0x2f4a5a){const _0x22a2d2=_0x22a2();return _0x37f8=function(_0x37f871,_0x5125ec){_0x37f871=_0x37f871-0x13a;let _0x141afe=_0x22a2d2[_0x37f871];return _0x141afe;},_0x37f8(_0x519b24,_0x2f4a5a);}const pipe_1=require('../pipe');class MapperService{constructor(_0x1c14d5,_0xbdc811){this['rules']=_0x1c14d5,this['data']=_0xbdc811;}['mapRules'](){return this['traverseRules'](this['rules']);}['traverseRules'](_0x97032a){if(typeof _0x97032a==='object'&&'@pipe'in _0x97032a)return this['pipe'](_0x97032a['@pipe']);if(typeof _0x97032a==='object'&&_0x97032a!==null){const _0xf7c0d1={};for(const _0x2cc7c3 in _0x97032a){Object['prototype']['hasOwnProperty']['call'](_0x97032a,_0x2cc7c3)&&(_0xf7c0d1[_0x2cc7c3]=this['traverseRules'](_0x97032a[_0x2cc7c3]));}return _0xf7c0d1;}else return this['resolve'](_0x97032a);}['pipe'](_0x839f80){const _0x2e364a=new pipe_1['Pipe'](_0x839f80,this['data']);return _0x2e364a['process']();}['resolve'](_0x30fbff){const _0xf27627=new pipe_1['Pipe']([[_0x30fbff]],this['data']);return _0xf27627['process']();}static['evaluate'](_0x2bd534,_0x5ccb8a,_0xdee2a8){if(typeof _0x2bd534==='boolean')return _0x2bd534;if(Array['isArray'](_0x2bd534['code'])&&_0x2bd534['code']['includes'](_0xdee2a8||0xc8)||_0xdee2a8['toString']()===(_0x2bd534['code']||0xc8)['toString']()){if(!_0x2bd534['match'])return!![];const _0x52c4cb=_0x2bd534['gate']==='or';let _0x26fd71=!![],_0x149157=![];return _0x2bd534['match']['forEach'](({expected:_0x16c1c4,actual:_0xa8719f})=>{if(_0x52c4cb&&!_0x149157||!_0x52c4cb&&_0x26fd71){const _0x1a0ea5=pipe_1['Pipe']['resolve'](_0xa8719f,_0x5ccb8a)===_0x16c1c4;if(_0x52c4cb&&_0x1a0ea5)_0x149157=!![];else!_0x52c4cb&&!_0x1a0ea5&&(_0x26fd71=![]);}}),_0x52c4cb?_0x149157:_0x26fd71;}return![];}}exports['MapperService']=MapperService;
|
|
@@ -43,7 +43,9 @@ class MeshCall {
|
|
|
43
43
|
await hotMesh.activate(version);
|
|
44
44
|
}
|
|
45
45
|
catch (error) {
|
|
46
|
-
hotMesh.engine.logger.error('meshcall-client-activate-err', {
|
|
46
|
+
hotMesh.engine.logger.error('meshcall-client-activate-err', {
|
|
47
|
+
...error,
|
|
48
|
+
});
|
|
47
49
|
throw error;
|
|
48
50
|
}
|
|
49
51
|
}
|
|
@@ -5,8 +5,7 @@ import { StringAnyType, StringStringType } from '../../types/serializer';
|
|
|
5
5
|
import { JobInterruptOptions, JobOutput } from '../../types/job';
|
|
6
6
|
import { QuorumMessage, QuorumMessageCallback, QuorumProfile, RollCallOptions, SubscriptionOptions, ThrottleOptions } from '../../types/quorum';
|
|
7
7
|
import { MeshFlowJobExport, ExportOptions } from '../../types/exporter';
|
|
8
|
-
import { ProviderConfig } from '../../types';
|
|
9
|
-
import { ProviderClass, ProvidersConfig } from '../../types/provider';
|
|
8
|
+
import { ProviderConfig, ProvidersConfig } from '../../types/provider';
|
|
10
9
|
declare class MeshData {
|
|
11
10
|
connectionSignatures: StringStringType;
|
|
12
11
|
connection: ProviderConfig | ProvidersConfig;
|
|
@@ -28,7 +27,7 @@ declare class MeshData {
|
|
|
28
27
|
executeChild: <T_1>(options?: Partial<WorkflowOptions>) => Promise<T_1>;
|
|
29
28
|
startChild: (options?: Partial<WorkflowOptions>) => Promise<string>;
|
|
30
29
|
};
|
|
31
|
-
constructor(
|
|
30
|
+
constructor(connection: ProviderConfig | ProvidersConfig, search?: WorkflowSearchOptions);
|
|
32
31
|
validate(entity: string): void;
|
|
33
32
|
getConnection(): Promise<ProviderConfig | ProvidersConfig>;
|
|
34
33
|
getClient(): import("../meshflow/client").ClientService;
|
|
@@ -8,7 +8,7 @@ const hotmesh_1 = require("../hotmesh");
|
|
|
8
8
|
const hotmesh_2 = require("../../types/hotmesh");
|
|
9
9
|
const enums_1 = require("../../modules/enums");
|
|
10
10
|
class MeshData {
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(connection, search) {
|
|
12
12
|
this.connectionSignatures = {};
|
|
13
13
|
this.instances = new Map();
|
|
14
14
|
this.mesh = {
|
|
@@ -45,7 +45,7 @@ class MeshData {
|
|
|
45
45
|
await hotMesh.quorum?.unsub(callback);
|
|
46
46
|
},
|
|
47
47
|
};
|
|
48
|
-
this.connection =
|
|
48
|
+
this.connection = connection;
|
|
49
49
|
if (search) {
|
|
50
50
|
this.search = search;
|
|
51
51
|
}
|
|
@@ -60,7 +60,7 @@ class MeshData {
|
|
|
60
60
|
}
|
|
61
61
|
getClient() {
|
|
62
62
|
return new meshflow_1.MeshFlow.Client({
|
|
63
|
-
connection:
|
|
63
|
+
connection: this.connection,
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
safeKey(key) {
|
|
@@ -130,9 +130,7 @@ class MeshData {
|
|
|
130
130
|
if (!hotMesh) {
|
|
131
131
|
hotMesh = hotmesh_1.HotMesh.init({
|
|
132
132
|
appId: namespace,
|
|
133
|
-
engine: {
|
|
134
|
-
connection: utils_1.polyfill.meshDataConfig(this),
|
|
135
|
-
},
|
|
133
|
+
engine: { connection: this.connection },
|
|
136
134
|
});
|
|
137
135
|
this.instances.set(namespace, hotMesh);
|
|
138
136
|
hotMesh = await hotMesh;
|
|
@@ -161,7 +161,9 @@ class ClientService {
|
|
|
161
161
|
await hotMesh.activate(version);
|
|
162
162
|
}
|
|
163
163
|
catch (error) {
|
|
164
|
-
hotMesh.engine.logger.error('meshflow-client-activate-err', {
|
|
164
|
+
hotMesh.engine.logger.error('meshflow-client-activate-err', {
|
|
165
|
+
...error,
|
|
166
|
+
});
|
|
165
167
|
throw error;
|
|
166
168
|
}
|
|
167
169
|
}
|