@hotmeshio/hotmesh 0.3.19 → 0.3.21
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 +72 -36
- package/build/index.d.ts +7 -1
- package/build/index.js +13 -1
- package/build/modules/key.js +1 -1
- package/build/modules/utils.d.ts +1 -3
- package/build/modules/utils.js +1 -1
- package/build/package.json +5 -4
- 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/factory.d.ts +1 -0
- package/build/services/connector/factory.js +35 -32
- package/build/services/connector/index.d.ts +4 -2
- package/build/services/connector/index.js +10 -5
- package/build/services/connector/providers/postgres.d.ts +13 -2
- package/build/services/connector/providers/postgres.js +54 -9
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.js +1 -1
- package/build/services/hotmesh/index.js +1 -6
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshcall/index.js +3 -5
- package/build/services/meshdata/index.d.ts +3 -4
- package/build/services/meshdata/index.js +4 -9
- package/build/services/meshflow/client.js +1 -2
- package/build/services/meshflow/connection.js +1 -0
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/worker.js +5 -8
- package/build/services/meshos/index.d.ts +2 -2
- package/build/services/meshos/index.js +6 -9
- 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 +2 -2
- 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/factory.d.ts +2 -2
- package/build/services/sub/factory.js +13 -8
- package/build/services/sub/providers/nats/nats.d.ts +19 -0
- package/build/services/sub/providers/nats/nats.js +1 -0
- package/build/services/sub/providers/postgres/postgres.d.ts +1 -0
- 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.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/build/types/hotmesh.d.ts +3 -17
- package/build/types/manifest.d.ts +2 -10
- package/build/types/nats.d.ts +8 -0
- package/build/types/postgres.d.ts +10 -1
- package/build/types/provider.d.ts +1 -0
- package/index.ts +24 -5
- package/package.json +5 -4
- package/types/hotmesh.ts +17 -17
- package/types/manifest.ts +2 -10
- package/types/nats.ts +34 -0
- package/types/postgres.ts +13 -2
- package/types/provider.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x4c9e(){const _0x44516f=['16630QEKvnl','391621JAWnll','78759ZshnyU','3184762QyUnon','974022yeIvrE','672opPAkk','800HQKxkb','3156736SWizCc','1317627LKqeRR'];_0x4c9e=function(){return _0x44516f;};return _0x4c9e();}(function(_0x11eacf,_0x3a5109){const _0x27fea7=_0x1d48,_0x4aadc9=_0x11eacf();while(!![]){try{const _0x5f3442=parseInt(_0x27fea7(0xb7))/0x1+parseInt(_0x27fea7(0xba))/0x2+parseInt(_0x27fea7(0xbe))/0x3+-parseInt(_0x27fea7(0xbd))/0x4+-parseInt(_0x27fea7(0xbf))/0x5*(-parseInt(_0x27fea7(0xbb))/0x6)+parseInt(_0x27fea7(0xb9))/0x7+-parseInt(_0x27fea7(0xbc))/0x8*(parseInt(_0x27fea7(0xb8))/0x9);if(_0x5f3442===_0x3a5109)break;else _0x4aadc9['push'](_0x4aadc9['shift']());}catch(_0x242f9a){_0x4aadc9['push'](_0x4aadc9['shift']());}}}(_0x4c9e,0x7570b));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Hook']=void 0x0;function _0x1d48(_0x3a5d16,_0x1a2206){const _0x4c9ed9=_0x4c9e();return _0x1d48=function(_0x1d48dc,_0x561c53){_0x1d48dc=_0x1d48dc-0xb7;let _0xf4caa0=_0x4c9ed9[_0x1d48dc];return _0xf4caa0;},_0x1d48(_0x3a5d16,_0x1a2206);}const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),collator_1=require('../collator'),pipe_1=require('../pipe'),task_1=require('../task'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream'),activity_1=require('./activity');class Hook extends activity_1['Activity']{constructor(_0x11d971,_0x15fd47,_0x909b36,_0xc9dafc,_0x16a169,_0x6364ee){super(_0x11d971,_0x15fd47,_0x909b36,_0xc9dafc,_0x16a169,_0x6364ee);}async['process'](){this['logger']['debug']('hook-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x3f8e30;try{return await this['verifyEntry'](),_0x3f8e30=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x3f8e30['startActivitySpan'](this['leg']),this['doesHook']()?await this['doHook'](_0x3f8e30):await this['doPassThrough'](_0x3f8e30),this['context']['metadata']['aid'];}catch(_0x4dee6a){if(_0x4dee6a instanceof errors_1['InactiveJobError']){this['logger']['error']('hook-inactive-job-error',{..._0x4dee6a});return;}else{if(_0x4dee6a instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x4dee6a});return;}else{if(_0x4dee6a instanceof errors_1['GetStateError']){this['logger']['error']('hook-get-state-error',{..._0x4dee6a});return;}else{if(_0x4dee6a instanceof errors_1['CollationError']){if(_0x4dee6a['fault']==='duplicate'){this['logger']['info']('hook-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('hook-collation-error',{..._0x4dee6a});}else this['logger']['error']('hook-process-error',{..._0x4dee6a});}}}_0x3f8e30?.['setActivityError'](_0x4dee6a['message']);throw _0x4dee6a;}finally{_0x3f8e30?.['endActivitySpan'](),this['logger']['debug']('hook-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}['doesHook'](){if(this['config']['sleep']){const _0x5a89da=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return!isNaN(_0x5a89da)&&Number(_0x5a89da)>0x0;}return!!this['config']['hook']?.['topic'];}async['doHook'](_0x31fe85){const _0x4572a9=this['store']['transact']();await this['registerHook'](enums_1['HMSH_IS_CLUSTER']?undefined:_0x4572a9),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x4572a9),await collator_1['CollatorService']['authorizeReentry'](this,_0x4572a9),await this['setStatus'](0x0,_0x4572a9),await _0x4572a9['exec'](),_0x31fe85['mapActivityAttributes']();}async['doPassThrough'](_0x4d47d5){const _0x3b502e=this['store']['transact']();let _0x48780d;this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x3b502e),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x3b502e),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x3b502e),_0x48780d=await _0x3b502e['exec'](),_0x4d47d5['mapActivityAttributes']();const _0x488e34=this['resolveStatus'](_0x48780d),_0x513470={'app.job.jss':_0x488e34},_0x47f854=await this['transition'](this['adjacencyList'],_0x488e34);_0x47f854['length']&&(_0x513470['app.activity.mids']=_0x47f854['join'](',')),_0x4d47d5['setActivityAttributes'](_0x513470);}async['getHookRule'](_0x3ac9ff){const _0x4a3260=await this['store']['getHookRules']();return _0x4a3260?.[_0x3ac9ff]?.[0x0];}async['registerHook'](_0x5b4adb){if(this['config']['hook']?.['topic'])return await this['engine']['taskService']['registerWebHook'](this['config']['hook']['topic'],this['context'],this['resolveDad'](),this['context']['metadata']['expire'],_0x5b4adb);else{if(this['config']['sleep']){const _0xfa1b53=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return await this['engine']['taskService']['registerTimeHook'](this['context']['metadata']['jid'],this['context']['metadata']['gid'],''+this['metadata']['aid']+(this['metadata']['dad']||''),'sleep',_0xfa1b53,this['metadata']['dad']||''),this['context']['metadata']['jid'];}}}async['processWebHookEvent'](_0x4ecf31=stream_1['StreamStatus']['SUCCESS'],_0x361384=0xc8){this['logger']['debug']('hook-process-web-hook-event',{'topic':this['config']['hook']['topic'],'aid':this['metadata']['aid'],'status':_0x4ecf31,'code':_0x361384});const _0x356b08=new task_1['TaskService'](this['store'],this['logger']),_0x30e8e0={...this['data']},_0x302319=await _0x356b08['processWebHookSignal'](this['config']['hook']['topic'],_0x30e8e0);if(_0x302319){const [_0x54d52e,_0x9c1ab3,_0x53488e,_0x5660bc]=_0x302319;this['context']['metadata']['jid']=_0x54d52e,this['context']['metadata']['gid']=_0x5660bc,this['context']['metadata']['dad']=_0x53488e,await this['processEvent'](_0x4ecf31,_0x361384,'hook'),_0x361384===0xc8&&await _0x356b08['deleteWebHookSignal'](this['config']['hook']['topic'],_0x30e8e0);}}async['processTimeHookEvent'](_0x366cf5){this['logger']['debug']('hook-process-time-hook-event',{'jid':_0x366cf5,'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']}),await this['processEvent'](stream_1['StreamStatus']['SUCCESS'],0xc8,'hook');}}exports['Hook']=Hook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x3a4a5d,_0x24bd9f){const _0x15b3b8=_0x424f,_0x3a6b29=_0x3a4a5d();while(!![]){try{const _0x2f40e7=parseInt(_0x15b3b8(0x159))/0x1*(-parseInt(_0x15b3b8(0x157))/0x2)+-parseInt(_0x15b3b8(0x153))/0x3*(-parseInt(_0x15b3b8(0x14f))/0x4)+parseInt(_0x15b3b8(0x151))/0x5+parseInt(_0x15b3b8(0x158))/0x6*(-parseInt(_0x15b3b8(0x156))/0x7)+parseInt(_0x15b3b8(0x150))/0x8+parseInt(_0x15b3b8(0x152))/0x9*(-parseInt(_0x15b3b8(0x154))/0xa)+parseInt(_0x15b3b8(0x14e))/0xb*(parseInt(_0x15b3b8(0x155))/0xc);if(_0x2f40e7===_0x24bd9f)break;else _0x3a6b29['push'](_0x3a6b29['shift']());}catch(_0x358ab5){_0x3a6b29['push'](_0x3a6b29['shift']());}}}(_0x45a8,0x85bee));function _0x424f(_0x1a0cdc,_0x5c5101){const _0x45a854=_0x45a8();return _0x424f=function(_0x424f21,_0x4341b4){_0x424f21=_0x424f21-0x14e;let _0x52fd40=_0x45a854[_0x424f21];return _0x52fd40;},_0x424f(_0x1a0cdc,_0x5c5101);}Object['defineProperty'](exports,'__esModule',{'value':!![]});const activity_1=require('./activity'),await_1=require('./await'),cycle_1=require('./cycle'),hook_1=require('./hook'),interrupt_1=require('./interrupt'),signal_1=require('./signal'),trigger_1=require('./trigger'),worker_1=require('./worker');exports['default']={'activity':activity_1['Activity'],'await':await_1['Await'],'cycle':cycle_1['Cycle'],'hook':hook_1['Hook'],'interrupt':interrupt_1['Interrupt'],'signal':signal_1['Signal'],'trigger':trigger_1['Trigger'],'worker':worker_1['Worker']};function _0x45a8(){const _0x1afd00=['180HdfzoG','9305292NVfxnb','637TlnEJH','2QtlGvm','55194RvkJKS','596402NqRepW','33srNmyt','292GLXgra','1068024LLAeKr','1648630JGhhgn','544671iGuxtI','11553xqpQIv'];_0x45a8=function(){return _0x1afd00;};return _0x45a8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x25289b,_0x498717){const _0xef3e69=_0x18f6,_0x59b016=_0x25289b();while(!![]){try{const _0xc0e726=-parseInt(_0xef3e69(0x80))/0x1*(-parseInt(_0xef3e69(0x7f))/0x2)+parseInt(_0xef3e69(0x7d))/0x3*(-parseInt(_0xef3e69(0x86))/0x4)+-parseInt(_0xef3e69(0x83))/0x5*(-parseInt(_0xef3e69(0x87))/0x6)+parseInt(_0xef3e69(0x82))/0x7+parseInt(_0xef3e69(0x81))/0x8+parseInt(_0xef3e69(0x7e))/0x9*(-parseInt(_0xef3e69(0x84))/0xa)+parseInt(_0xef3e69(0x85))/0xb;if(_0xc0e726===_0x498717)break;else _0x59b016['push'](_0x59b016['shift']());}catch(_0x35bdc0){_0x59b016['push'](_0x59b016['shift']());}}}(_0x2b64,0x61143));function _0x18f6(_0x7df3d9,_0x38eb51){const _0x2b642b=_0x2b64();return _0x18f6=function(_0x18f627,_0x4d1ee6){_0x18f627=_0x18f627-0x7d;let _0x4f3256=_0x2b642b[_0x18f627];return _0x4f3256;},_0x18f6(_0x7df3d9,_0x38eb51);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Interrupt']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');function _0x2b64(){const _0xbd66c7=['62628CBiqMF','13htlcaF','5206776IBXiqB','443331oORzKd','29165mBguQU','179650NGqrUE','1638263VQyRSx','68XNoilK','96VEyqVF','129237WeaePV','117GHtqzl'];_0x2b64=function(){return _0xbd66c7;};return _0x2b64();}class Interrupt extends activity_1['Activity']{constructor(_0x475f4a,_0x1c335a,_0x3c48ed,_0x34c3de,_0x3f1e9c,_0xa0bdb0){super(_0x475f4a,_0x1c335a,_0x3c48ed,_0x34c3de,_0x3f1e9c,_0xa0bdb0);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x5a4d29;try{await this['verifyEntry'](),_0x5a4d29=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x5a4d29['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0x5a4d29):await this['interruptAnother'](_0x5a4d29);}catch(_0xd0afe6){if(_0xd0afe6 instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0xd0afe6});return;}else{if(_0xd0afe6 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0xd0afe6});return;}else{if(_0xd0afe6 instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0xd0afe6});return;}else{if(_0xd0afe6 instanceof errors_1['CollationError']){if(_0xd0afe6['fault']==='duplicate'){this['logger']['info']('interrupt-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('interrupt-collation-error',{..._0xd0afe6});}else this['logger']['error']('interrupt-process-error',{..._0xd0afe6});}}}_0x5a4d29?.['setActivityError'](_0xd0afe6['message']);throw _0xd0afe6;}finally{_0x5a4d29?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x37fc26){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x4c3227=await this['interrupt']();_0x37fc26['mapActivityAttributes']();const _0x198533=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x198533),await this['setStatus'](-0x1,_0x198533);const _0x29efd5=await _0x198533['exec'](),_0x2f9252=this['resolveStatus'](_0x29efd5);return _0x37fc26['setActivityAttributes']({'app.activity.mid':_0x4c3227,'app.job.jss':_0x2f9252}),this['context']['metadata']['aid'];}async['interruptAnother'](_0xe845c2){const _0x3d7cd1=await this['interrupt'](),_0x46d4ef={'app.activity.mid':_0x3d7cd1};_0xe845c2['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x5d0344=this['store']['transact']();await this['setState'](_0x5d0344);}const _0x29fab5=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x29fab5),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x29fab5);const _0x4b30b6=await _0x29fab5['exec'](),_0x5da38d=this['resolveStatus'](_0x4b30b6);_0x46d4ef['app.job.jss']=_0x5da38d;const _0x135092=await this['transition'](this['adjacencyList'],_0x5da38d);return _0x135092['length']&&(_0x46d4ef['app.activity.mids']=_0x135092['join'](',')),_0xe845c2['setActivityAttributes'](_0x46d4ef),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0x433c49=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0x433c49==this['context']['metadata']['jid'];}['resolveInterruptOptions'](){return{'reason':this['config']['reason']!==undefined?pipe_1['Pipe']['resolve'](this['config']['reason'],this['context']):undefined,'throw':this['config']['throw']!==undefined?pipe_1['Pipe']['resolve'](this['config']['throw'],this['context']):undefined,'descend':this['config']['descend']!==undefined?pipe_1['Pipe']['resolve'](this['config']['descend'],this['context']):undefined,'code':this['config']['code']!==undefined?pipe_1['Pipe']['resolve'](this['config']['code'],this['context']):undefined,'expire':this['config']['expire']!==undefined?pipe_1['Pipe']['resolve'](this['config']['expire'],this['context']):undefined,'stack':this['config']['stack']!==undefined?pipe_1['Pipe']['resolve'](this['config']['stack'],this['context']):undefined};}async['interrupt'](){const _0x2d39ac=this['resolveInterruptOptions']();return await this['engine']['interrupt'](this['config']['topic']!==undefined?pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']):this['context']['metadata']['tpc'],this['config']['target']!==undefined?pipe_1['Pipe']['resolve'](this['config']['target'],this['context']):this['context']['metadata']['jid'],_0x2d39ac);}}exports['Interrupt']=Interrupt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x4988dc,_0x571043){const _0x3e1079=_0x1397,_0x5cb3ea=_0x4988dc();while(!![]){try{const _0x5927f4=-parseInt(_0x3e1079(0x107))/0x1*(-parseInt(_0x3e1079(0x108))/0x2)+parseInt(_0x3e1079(0x101))/0x3*(parseInt(_0x3e1079(0x102))/0x4)+parseInt(_0x3e1079(0x104))/0x5*(parseInt(_0x3e1079(0x109))/0x6)+-parseInt(_0x3e1079(0x106))/0x7+parseInt(_0x3e1079(0x10a))/0x8*(parseInt(_0x3e1079(0x100))/0x9)+parseInt(_0x3e1079(0x105))/0xa+-parseInt(_0x3e1079(0x103))/0xb;if(_0x5927f4===_0x571043)break;else _0x5cb3ea['push'](_0x5cb3ea['shift']());}catch(_0x5f0517){_0x5cb3ea['push'](_0x5cb3ea['shift']());}}}(_0x2b61,0xcc4ac));function _0x2b61(){const _0x2c8858=['2DoqOvC','798890YZBZDf','6QKTYsp','296pZMJqg','339111QVsAZh','5883IlxjmI','24TZNEwp','32478864duKaZl','7301130lkJTJL','1570770fLYrXb','228746MDBmCW'];_0x2b61=function(){return _0x2c8858;};return _0x2b61();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Signal']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Signal extends activity_1['Activity']{constructor(_0x44ec9e,_0x203931,_0x191c15,_0x3d16bf,_0xd05bdb,_0x5e2361){super(_0x44ec9e,_0x203931,_0x191c15,_0x3d16bf,_0xd05bdb,_0x5e2361);}async['process'](){this['logger']['debug']('signal-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x50976b;try{await this['verifyEntry'](),_0x50976b=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x50976b['startActivitySpan'](this['leg']);const _0x43a126=this['store']['transact']();this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x43a126),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x43a126),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x43a126);const _0x22df37=await _0x43a126['exec']();this['config']['subtype']==='all'?await this['hookAll']():await this['hookOne']();const _0x2fbe64=this['resolveStatus'](_0x22df37),_0x2590aa={'app.job.jss':_0x2fbe64},_0x35bca0=await this['transition'](this['adjacencyList'],_0x2fbe64);return _0x35bca0['length']&&(_0x2590aa['app.activity.mids']=_0x35bca0['join'](',')),_0x50976b['mapActivityAttributes'](),_0x50976b['setActivityAttributes'](_0x2590aa),this['context']['metadata']['aid'];}catch(_0x3d90e1){if(_0x3d90e1 instanceof errors_1['InactiveJobError']){this['logger']['error']('signal-inactive-job-error',{..._0x3d90e1});return;}else{if(_0x3d90e1 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x3d90e1});return;}else{if(_0x3d90e1 instanceof errors_1['GetStateError']){this['logger']['error']('signal-get-state-error',{..._0x3d90e1});return;}else{if(_0x3d90e1 instanceof errors_1['CollationError']){if(_0x3d90e1['fault']==='duplicate'){this['logger']['info']('signal-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('signal-collation-error',{..._0x3d90e1});}else this['logger']['error']('signal-process-error',{..._0x3d90e1});}}}_0x50976b?.['setActivityError'](_0x3d90e1['message']);throw _0x3d90e1;}finally{_0x50976b?.['endActivitySpan'](),this['logger']['debug']('signal-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}['mapSignalData'](){if(this['config']['signal']?.['maps']){const _0xed4262=new mapper_1['MapperService'](this['config']['signal']['maps'],this['context']);return _0xed4262['mapRules']();}}['mapResolverData'](){if(this['config']['resolver']?.['maps']){const _0x394ff6=new mapper_1['MapperService'](this['config']['resolver']['maps'],this['context']);return _0x394ff6['mapRules']();}}async['hookOne'](){const _0xd40d92=pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']),_0x75c92c=this['mapSignalData'](),_0x20f273=pipe_1['Pipe']['resolve'](this['config']['status'],this['context']),_0x5b4538=pipe_1['Pipe']['resolve'](this['config']['code'],this['context']);return await this['engine']['hook'](_0xd40d92,_0x75c92c,_0x20f273,_0x5b4538);}async['hookAll'](){const _0x32580d=this['mapSignalData'](),_0xea5e2a=this['mapResolverData']();this['config']['scrub']&&(_0xea5e2a['scrub']=!![]);const _0x32b1f1=pipe_1['Pipe']['resolve'](this['config']['key_name'],this['context']),_0x4a007e=pipe_1['Pipe']['resolve'](this['config']['key_value'],this['context']),_0x5a18b0=[_0x32b1f1+':'+_0x4a007e];return await this['engine']['hookAll'](this['config']['topic'],_0x32580d,_0xea5e2a,_0x5a18b0);}}function _0x1397(_0x2daa76,_0x44813d){const _0x2b61c4=_0x2b61();return _0x1397=function(_0x1397e6,_0x324d95){_0x1397e6=_0x1397e6-0x100;let _0x381535=_0x2b61c4[_0x1397e6];return _0x381535;},_0x1397(_0x2daa76,_0x44813d);}exports['Signal']=Signal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x2a92(){const _0x22d754=['22LwtlKL','36oDbdCu','4015975VmQhET','335841aSLjos','28RSptny','5732490lLevVI','690403HKgKvH','44296GncYAF','7404430SyWXYw','35870CcmrRI','783MXaCHL'];_0x2a92=function(){return _0x22d754;};return _0x2a92();}(function(_0x326c6e,_0x4bd50b){const _0x42721b=_0xe2a7,_0x34b8da=_0x326c6e();while(!![]){try{const _0x3e65f5=parseInt(_0x42721b(0x132))/0x1*(parseInt(_0x42721b(0x129))/0x2)+-parseInt(_0x42721b(0x12c))/0x3*(parseInt(_0x42721b(0x12d))/0x4)+parseInt(_0x42721b(0x12b))/0x5+-parseInt(_0x42721b(0x12a))/0x6*(-parseInt(_0x42721b(0x12f))/0x7)+-parseInt(_0x42721b(0x130))/0x8*(parseInt(_0x42721b(0x133))/0x9)+parseInt(_0x42721b(0x12e))/0xa+-parseInt(_0x42721b(0x131))/0xb;if(_0x3e65f5===_0x4bd50b)break;else _0x34b8da['push'](_0x34b8da['shift']());}catch(_0x2b3f12){_0x34b8da['push'](_0x34b8da['shift']());}}}(_0x2a92,0x67976));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Trigger']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),pipe_1=require('../pipe'),reporter_1=require('../reporter'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Trigger extends activity_1['Activity']{constructor(_0x233d45,_0x373a2a,_0x1e1cfd,_0x186a12,_0x1e2458,_0x5bb07e){super(_0x233d45,_0x373a2a,_0x1e1cfd,_0x186a12,_0x1e2458,_0x5bb07e);}async['process'](_0x50f1e5){this['logger']['debug']('trigger-process',{'subscribes':this['config']['subscribes']});let _0x55adee;try{this['setLeg'](0x2),await this['getState'](),_0x55adee=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x55adee['startJobSpan'](),_0x55adee['startActivitySpan'](this['leg']),this['mapJobData'](),this['adjacencyList']=await this['filterAdjacent']();const _0x3ed448=this['initStatus'](_0x50f1e5,this['adjacencyList']['length']);await this['setStateNX'](_0x3ed448),await this['setStatus'](_0x3ed448),this['bindSearchData'](_0x50f1e5),this['bindMarkerData'](_0x50f1e5);const _0x18062d=this['store']['transact']();await this['setState'](_0x18062d),await this['setStats'](_0x18062d);_0x50f1e5?.['pending']&&await this['setExpired'](_0x50f1e5?.['pending'],_0x18062d);await collator_1['CollatorService']['notarizeInception'](this,this['context']['metadata']['guid'],_0x18062d),await _0x18062d['exec'](),this['execAdjacentParent'](),_0x55adee['mapActivityAttributes']();const _0xcc4393=Number(this['context']['metadata']['js']);_0x55adee['setJobAttributes']({'app.job.jss':_0xcc4393});const _0x5bf17a={'app.job.jss':_0xcc4393};return await this['transitionAndLogAdjacent'](_0x50f1e5,_0xcc4393,_0x5bf17a),_0x55adee['setActivityAttributes'](_0x5bf17a),this['context']['metadata']['jid'];}catch(_0x4243c4){_0x55adee?.['setActivityError'](_0x4243c4['message']);if(_0x4243c4 instanceof errors_1['DuplicateJobError']){await(0x0,utils_1['sleepFor'])(0x3e8);const _0x4ea19d=await collator_1['CollatorService']['isInceptionOverage'](this,this['context']['metadata']['guid']);if(_0x4ea19d){this['logger']['info']('trigger-collation-overage',{'job_id':_0x4243c4['jobId'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('duplicate-job-error',{'job_id':_0x4243c4['jobId'],'guid':this['context']['metadata']['guid']});}else this['logger']['error']('trigger-process-error',{..._0x4243c4});throw _0x4243c4;}finally{_0x55adee?.['endJobSpan'](),_0x55adee?.['endActivitySpan'](),this['logger']['debug']('trigger-process-end',{'subscribes':this['config']['subscribes'],'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid']});}}async['transitionAndLogAdjacent'](_0x445d97={},_0x3f8b93,_0xd61cd7){if(isNaN(_0x445d97['pending'])){const _0x1f948d=await this['transition'](this['adjacencyList'],_0x3f8b93);_0x1f948d['length']&&(_0xd61cd7['app.activity.mids']=_0x1f948d['join'](','));}}['initStatus'](_0x2b9a7={},_0x2eee6f){if(_0x2b9a7['pending'])return-0x1;return _0x2eee6f;}async['setExpired'](_0x4ce2c2,_0x434405){await this['store']['expireJob'](this['context']['metadata']['jid'],_0x4ce2c2,_0x434405);}['safeKey'](_0xbf12b){return'_'+_0xbf12b;}['bindSearchData'](_0x527957){_0x527957?.['search']&&Object['keys'](_0x527957['search'])['forEach'](_0x584985=>{this['context']['data'][this['safeKey'](_0x584985)]=_0x527957['search'][_0x584985]['toString']();});}['bindMarkerData'](_0x2d02ff){_0x2d02ff?.['marker']&&Object['keys'](_0x2d02ff['marker'])['forEach'](_0xf395b3=>{_0xf395b3['startsWith']('-')&&(this['context']['data'][_0xf395b3]=_0x2d02ff['marker'][_0xf395b3]['toString']());});}async['setStatus'](_0x5f1e5e){this['context']['metadata']['js']=_0x5f1e5e;}async['execAdjacentParent'](){if(this['context']['metadata']['px']){const _0x3acdf5=(0x0,utils_1['formatISODate'])(new Date()),_0x41da02={'metadata':this['context']['metadata'],'data':{'job_id':this['context']['metadata']['jid'],'jc':_0x3acdf5,'ju':_0x3acdf5}};await this['engine']['execAdjacentParent'](this['context'],_0x41da02);}}['createInputContext'](){const _0x426028={[this['metadata']['aid']]:{'input':{'data':this['data']}},'$self':{'input':{'data':this['data']},'output':{'data':this['data']}}};return _0x426028;}async['getState'](){const _0x3ad596=this['createInputContext'](),_0x77fc12=this['resolveJobId'](_0x3ad596),_0x14dcd4=this['resolveJobKey'](_0x3ad596),_0x1afb06=(0x0,utils_1['formatISODate'])(new Date()),{id:_0xd0652e,version:_0x4cea27}=await this['engine']['getVID']();this['initDimensionalAddress'](collator_1['CollatorService']['getDimensionalSeed']());const _0x53ce09={...this['metadata'],'jid':_0x77fc12,'key':_0x14dcd4,'as':collator_1['CollatorService']['getTriggerSeed']()};this['context']={'metadata':{...this['metadata'],'gid':(0x0,utils_1['guid'])(),'ngn':this['context']['metadata']['ngn'],'pj':this['context']['metadata']['pj'],'pg':this['context']['metadata']['pg'],'pd':this['context']['metadata']['pd'],'pa':this['context']['metadata']['pa'],'px':this['context']['metadata']['px'],'app':_0xd0652e,'vrs':_0x4cea27,'tpc':this['config']['subscribes'],'trc':this['context']['metadata']['trc'],'spn':this['context']['metadata']['spn'],'guid':this['context']['metadata']['guid'],'jid':_0x77fc12,'dad':collator_1['CollatorService']['getDimensionalSeed'](),'key':_0x14dcd4,'jc':_0x1afb06,'ju':_0x1afb06,'ts':(0x0,utils_1['getTimeSeries'])(this['resolveGranularity']()),'js':0x0},'data':{},[this['metadata']['aid']]:{'input':{'data':this['data'],'metadata':_0x53ce09},'output':{'data':this['data'],'metadata':_0x53ce09},'settings':{'data':{}},'errors':{'data':{}}}},this['context']['$self']=this['context'][this['metadata']['aid']],this['context']['$job']=this['context'];}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x14f04d=>'metadata/'+_0x14f04d);}['bindActivityMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['ACTIVITY']['KEYS']['map'](_0xc6ef26=>'output/metadata/'+_0xc6ef26);}['resolveGranularity'](){return this['config']['stats']?.['granularity']||reporter_1['ReporterService']['DEFAULT_GRANULARITY'];}['getJobStatus'](){return this['context']['metadata']['js'];}['resolveJobId'](_0x541afb){const _0x16908d=this['config']['stats']?.['id'];return _0x16908d?pipe_1['Pipe']['resolve'](_0x16908d,_0x541afb):(0x0,utils_1['guid'])();}['resolveJobKey'](_0x151f29){const _0x106217=this['config']['stats']?.['key'];return _0x106217?pipe_1['Pipe']['resolve'](_0x106217,_0x151f29):'';}async['setStateNX'](_0x10fa4c){const _0x7f7082=this['context']['metadata']['jid'];if(!await this['store']['setStateNX'](_0x7f7082,this['engine']['appId'],_0x10fa4c))throw new errors_1['DuplicateJobError'](_0x7f7082);}async['setStats'](_0x4c3738){const _0x2e5023=this['context']['metadata'];if(_0x2e5023['key']&&this['config']['stats']?.['measures']){const _0x47f437=await this['engine']['getVID'](),_0x53072e=new reporter_1['ReporterService'](_0x47f437,this['store'],this['logger']);await this['store']['setStats'](_0x2e5023['key'],_0x2e5023['jid'],_0x2e5023['ts'],_0x53072e['resolveTriggerStatistics'](this['config'],this['context']),_0x47f437,_0x4c3738);}}}function _0xe2a7(_0x64ec34,_0x3621b7){const _0x2a926f=_0x2a92();return _0xe2a7=function(_0xe2a7c4,_0x30685){_0xe2a7c4=_0xe2a7c4-0x129;let _0x3aff15=_0x2a926f[_0xe2a7c4];return _0x3aff15;},_0xe2a7(_0x64ec34,_0x3621b7);}exports['Trigger']=Trigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function _0x4122(){const _0x52b839=['90420Seyuvl','471866bECRIp','216179ThQINc','40ghYHfM','456400MzaeQB','210uwTBYv','182fSkqio','285462jgprPD','314952SVWIdz'];_0x4122=function(){return _0x52b839;};return _0x4122();}(function(_0x1cd437,_0x16cd8c){const _0x391883=_0x1bea,_0x3886fe=_0x1cd437();while(!![]){try{const _0x164ca4=-parseInt(_0x391883(0x1bf))/0x1+parseInt(_0x391883(0x1be))/0x2+parseInt(_0x391883(0x1c5))/0x3+-parseInt(_0x391883(0x1c6))/0x4+-parseInt(_0x391883(0x1c1))/0x5+parseInt(_0x391883(0x1c2))/0x6*(parseInt(_0x391883(0x1c3))/0x7)+parseInt(_0x391883(0x1c0))/0x8*(parseInt(_0x391883(0x1c4))/0x9);if(_0x164ca4===_0x16cd8c)break;else _0x3886fe['push'](_0x3886fe['shift']());}catch(_0x89dad6){_0x3886fe['push'](_0x3886fe['shift']());}}}(_0x4122,0x29971));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');class Worker extends activity_1['Activity']{constructor(_0x563049,_0x7d9a4,_0x5ef7b7,_0x13c51d,_0x4c8892,_0x24f05c){super(_0x563049,_0x7d9a4,_0x5ef7b7,_0x13c51d,_0x4c8892,_0x24f05c);}async['process'](){this['logger']['debug']('worker-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x3303f2;try{await this['verifyEntry'](),_0x3303f2=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x3303f2['startActivitySpan'](this['leg']),this['mapInputData']();const _0x50a521=this['store']['transact'](),_0x4c804a=await this['execActivity'](_0x50a521);await collator_1['CollatorService']['authorizeReentry'](this,_0x50a521),await this['setState'](_0x50a521),await this['setStatus'](0x0,_0x50a521);const _0x3da954=await _0x50a521['exec']();_0x3303f2['mapActivityAttributes']();const _0x4ad494=this['resolveStatus'](_0x3da954);return _0x3303f2['setActivityAttributes']({'app.activity.mid':_0x4c804a,'app.job.jss':_0x4ad494}),this['context']['metadata']['aid'];}catch(_0x548893){if(_0x548893 instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x548893});return;}else{if(_0x548893 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x548893});return;}else{if(_0x548893 instanceof errors_1['GetStateError']){this['logger']['error']('worker-get-state-error',{..._0x548893});return;}else{if(_0x548893 instanceof errors_1['CollationError']){if(_0x548893['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',{..._0x548893});}else this['logger']['error']('worker-process-error',{..._0x548893});}}}_0x3303f2?.['setActivityError'](_0x548893['message']);throw _0x548893;}finally{_0x3303f2?.['endActivitySpan'](),this['logger']['debug']('worker-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x47c04a){const _0x1d6b79=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x3377aa={'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':_0x1d6b79,'spn':this['context']['$self']['output']['metadata']['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context']['data']};return this['config']['retry']&&(_0x3377aa['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](_0x1d6b79,_0x3377aa,_0x47c04a);}}function _0x1bea(_0x14c129,_0x2b36c3){const _0x41224c=_0x4122();return _0x1bea=function(_0x1bea12,_0x3f9d2a){_0x1bea12=_0x1bea12-0x1be;let _0x563700=_0x41224c[_0x1bea12];return _0x563700;},_0x1bea(_0x14c129,_0x2b36c3);}exports['Worker']=Worker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x56ae2f,_0x1cf01d){const _0xff740a=_0x444c,_0x58617b=_0x56ae2f();while(!![]){try{const _0x2606ea=-parseInt(_0xff740a(0x6e))/0x1*(parseInt(_0xff740a(0x78))/0x2)+parseInt(_0xff740a(0x6d))/0x3+-parseInt(_0xff740a(0x73))/0x4*(parseInt(_0xff740a(0x71))/0x5)+parseInt(_0xff740a(0x75))/0x6*(-parseInt(_0xff740a(0x6f))/0x7)+parseInt(_0xff740a(0x70))/0x8*(parseInt(_0xff740a(0x77))/0x9)+parseInt(_0xff740a(0x76))/0xa+parseInt(_0xff740a(0x74))/0xb*(-parseInt(_0xff740a(0x72))/0xc);if(_0x2606ea===_0x1cf01d)break;else _0x58617b['push'](_0x58617b['shift']());}catch(_0x4f9b5f){_0x58617b['push'](_0x58617b['shift']());}}}(_0x4cb9,0xdb049));function _0x444c(_0x4a9c0f,_0x1ac86f){const _0x4cb9ef=_0x4cb9();return _0x444c=function(_0x444cc6,_0x2ff8a1){_0x444cc6=_0x444cc6-0x6d;let _0x3a698e=_0x4cb9ef[_0x444cc6];return _0x3a698e;},_0x444c(_0x4a9c0f,_0x1ac86f);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CollatorService']=void 0x0;function _0x4cb9(){const _0x55b743=['6654445GpHxLM','9726280iepSLp','10CZDbyL','771564qqLJKy','1986408stnHTJ','77oCxfoA','6FiLIKB','11069820uZCnKp','9kffuWG','2VwyGPH','5026491MDmApT','707249nOPUlq'];_0x4cb9=function(){return _0x55b743;};return _0x4cb9();}const errors_1=require('../../modules/errors'),collator_1=require('../../types/collator');class CollatorService{static['assertJobActive'](_0x21530d,_0x1a7e8c,_0x2ad423,_0x3b6ec2=0x0){if(_0x21530d<=_0x3b6ec2)throw new errors_1['InactiveJobError'](_0x1a7e8c,_0x21530d,_0x2ad423);}static['getDimensionalAddress'](_0x12ace7,_0x323f5c=![]){let _0x4e4f83=_0x12ace7['context']['metadata']['dad']||_0x12ace7['metadata']['dad'];return _0x323f5c&&_0x4e4f83&&_0x12ace7['leg']===0x2&&(_0x4e4f83=_0x4e4f83['substring'](0x0,_0x4e4f83['lastIndexOf'](','))+',0'),CollatorService['getDimensionsById']([..._0x12ace7['config']['ancestors'],_0x12ace7['metadata']['aid']],_0x4e4f83);}static['resolveReentryDimension'](_0x3c7f2c){const _0x2d5f64=_0x3c7f2c['config']['ancestor'],_0x232586=_0x3c7f2c['config']['ancestors'],_0x3e2cf6=_0x232586['indexOf'](_0x2d5f64),_0x1f0a3c=_0x3c7f2c['metadata']['dad']['split'](',');return _0x1f0a3c['length']=_0x3e2cf6+0x1,_0x1f0a3c['push']('0'),_0x1f0a3c['join'](',');}static async['notarizeEntry'](_0x3d09a1,_0x1c0616){const _0x310eec=await _0x3d09a1['store']['collate'](_0x3d09a1['context']['metadata']['jid'],_0x3d09a1['metadata']['aid'],-0x5af3107a4000,this['getDimensionalAddress'](_0x3d09a1),_0x1c0616);return this['verifyInteger'](_0x310eec,0x1,'enter'),_0x310eec;}static async['authorizeReentry'](_0x52c015,_0x10e87c){const _0x36ccdb=await _0x52c015['store']['collate'](_0x52c015['context']['metadata']['jid'],_0x52c015['metadata']['aid'],-0x9184e72a000,this['getDimensionalAddress'](_0x52c015),_0x10e87c);return _0x36ccdb;}static async['notarizeEarlyExit'](_0x5d3405,_0x6e4352){return await _0x5d3405['store']['collate'](_0x5d3405['context']['metadata']['jid'],_0x5d3405['metadata']['aid'],-0xa012317b000,this['getDimensionalAddress'](_0x5d3405),_0x6e4352);}static async['notarizeEarlyCompletion'](_0x7f4aa7,_0x338e63){const _0x4c9d1a=_0x7f4aa7['config']['cycle']?0x9184e72a000:0xa012317b000;return await _0x7f4aa7['store']['collate'](_0x7f4aa7['context']['metadata']['jid'],_0x7f4aa7['metadata']['aid'],0xf4241-_0x4c9d1a,this['getDimensionalAddress'](_0x7f4aa7),_0x338e63);}static async['notarizeInception'](_0x683c3,_0xbb5304,_0x375674){_0xbb5304&&await _0x683c3['store']['collateSynthetic'](_0x683c3['context']['metadata']['jid'],_0xbb5304,0xf4240,_0x375674);}static async['isInceptionOverage'](_0x52089f,_0x256421){if(_0x256421){const _0x455c25=await _0x52089f['store']['collateSynthetic'](_0x52089f['context']['metadata']['jid'],_0x256421,0xf4240);return _0x455c25>0xf4240;}return![];}static async['notarizeReentry'](_0x5d1976,_0xd329c6,_0x52c901){const _0x5841bf=_0x5d1976['context']['metadata']['jid'],_0x4aa0eb=_0x52c901||_0x5d1976['store']['transact']();await _0x5d1976['store']['collate'](_0x5841bf,_0x5d1976['metadata']['aid'],0xf4240,this['getDimensionalAddress'](_0x5d1976,!![]),_0x4aa0eb),await _0x5d1976['store']['collateSynthetic'](_0x5841bf,_0xd329c6,0xf4240,_0x4aa0eb);const [_0x5af822,_0x3dd4a3]=await _0x4aa0eb['exec'](),_0x50a796=Array['isArray'](_0x5af822)?_0x5af822[0x1]:_0x5af822,_0x3817a9=Array['isArray'](_0x3dd4a3)?_0x3dd4a3[0x1]:_0x3dd4a3;return this['verifyInteger'](_0x50a796,0x2,'enter'),this['verifySyntheticInteger'](_0x3817a9),_0x50a796;}static async['notarizeContinuation'](_0x145b5d,_0x363be2){return await _0x145b5d['store']['collate'](_0x145b5d['context']['metadata']['jid'],_0x145b5d['metadata']['aid'],0x1,this['getDimensionalAddress'](_0x145b5d),_0x363be2);}static async['notarizeCompletion'](_0x50b256,_0x355880){const _0x3ed59b=_0x50b256['config']['cycle']?0x0:0xe8d4a51000;return await _0x50b256['store']['collate'](_0x50b256['context']['metadata']['jid'],_0x50b256['metadata']['aid'],0x1-_0x3ed59b,this['getDimensionalAddress'](_0x50b256),_0x355880);}static['getDigitAtIndex'](_0x5edf41,_0x272935){const _0x5884ef=_0x5edf41['toString']();if(_0x272935<0x0||_0x272935>=_0x5884ef['length'])return null;const _0x38c5b4=parseInt(_0x5884ef[_0x272935],0xa);return _0x38c5b4;}static['getDimensionalIndex'](_0x1dccf9){const _0x211949=_0x1dccf9['toString']();if(_0x211949['length']<0x9)return null;const _0x3b51e3=_0x211949['substring'](0x3,0x9),_0x8d9219=parseInt(_0x3b51e3,0xa);return _0x8d9219-0x1;}static['isDuplicate'](_0x434726,_0x48cac8){return this['getDigitAtIndex'](_0x434726,_0x48cac8)<0x8;}static['isInactive'](_0x1ba3f1){return this['getDigitAtIndex'](_0x1ba3f1,0x2)<0x9;}static['isPrimed'](_0xf9ad8e,_0x4d4eaa){return _0x4d4eaa==0x1?_0xf9ad8e!=-0x5af3107a4000:this['getDigitAtIndex'](_0xf9ad8e,0x0)<0x9&&this['getDigitAtIndex'](_0xf9ad8e,0x1)<0x9;}static['verifySyntheticInteger'](_0xf0c419){const _0x5d08cf=_0xf0c419['toString'](),_0xcfa065=parseInt(_0x5d08cf[_0x5d08cf['length']-0x1],0xa);if(_0xcfa065>0x0)throw new errors_1['CollationError'](_0xf0c419,0x2,'enter',collator_1['CollationFaultType']['INACTIVE']);else{if(_0xf0c419>=0x1e8480)throw new errors_1['CollationError'](_0xf0c419,0x2,'enter',collator_1['CollationFaultType']['DUPLICATE']);}}static['verifyInteger'](_0x2742d1,_0x2e9b95,_0x23eb38){let _0x6e0fbb;if(_0x2e9b95===0x1&&_0x23eb38==='enter'){if(!this['isPrimed'](_0x2742d1,0x1))_0x6e0fbb=collator_1['CollationFaultType']['MISSING'];else{if(this['isDuplicate'](_0x2742d1,0x0))_0x6e0fbb=collator_1['CollationFaultType']['DUPLICATE'];else _0x2742d1!=0x331a2bfa73000&&(_0x6e0fbb=collator_1['CollationFaultType']['INVALID']);}}else{if(_0x2e9b95===0x1&&_0x23eb38==='exit'){if(_0x2742d1===-0x9184e72a000)_0x6e0fbb=collator_1['CollationFaultType']['MISSING'];else this['isDuplicate'](_0x2742d1,0x1)&&(_0x6e0fbb=collator_1['CollationFaultType']['DUPLICATE']);}else{if(_0x2e9b95===0x2&&_0x23eb38==='enter'){if(!this['isPrimed'](_0x2742d1,0x2))_0x6e0fbb=collator_1['CollationFaultType']['FORBIDDEN'];else this['isInactive'](_0x2742d1)&&(_0x6e0fbb=collator_1['CollationFaultType']['INACTIVE']);}}}if(_0x6e0fbb)throw new errors_1['CollationError'](_0x2742d1,_0x2e9b95,_0x23eb38,_0x6e0fbb);}static['getDimensionsById'](_0x2faf73,_0x27eebc){const _0x1939ed={'$ADJACENT':_0x27eebc+',0'};let _0x15c66b=_0x27eebc;return _0x2faf73['reverse']()['forEach'](_0x26eb0f=>{_0x1939ed[_0x26eb0f]=_0x15c66b,_0x15c66b=_0x15c66b['substring'](0x0,_0x15c66b['lastIndexOf'](','));}),_0x1939ed;}static['getSeed'](){return'999000000000000';}static['getTriggerSeed'](){return'888000001000001';}static['compile'](_0x1bba1b){CollatorService['bindAncestorArray'](_0x1bba1b);}static['bindAncestorArray'](_0x3898b0){_0x3898b0['forEach'](_0x31e797=>{const _0x2eaa4e={},_0x379cf3=Object['keys'](_0x31e797['activities'])['find'](_0x28e4f4=>_0x31e797['activities'][_0x28e4f4]['type']==='trigger');if(!_0x379cf3)throw new Error('collator-trigger-activity-not-found');const _0x349ad3=(_0x9b6497,_0x50adca)=>{_0x2eaa4e[_0x9b6497]=_0x50adca,_0x31e797['activities'][_0x9b6497]['ancestors']=_0x50adca;const _0x36e8c5=_0x31e797['transitions']?.[_0x9b6497]||[];_0x36e8c5['forEach'](_0x2baad4=>{_0x349ad3(_0x2baad4['to'],[..._0x50adca,_0x9b6497]);});};_0x349ad3(_0x379cf3,[]);});}static['getDimensionalSeed'](_0x3e62f3=0x0){return','+_0x3e62f3;}}exports['CollatorService']=CollatorService,CollatorService['targetLength']=0xf;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _0x985f(_0x8174c7,_0x5643ed){const _0x53752b=_0x5375();return _0x985f=function(_0x985f37,_0x22479e){_0x985f37=_0x985f37-0xb5;let _0x1fe427=_0x53752b[_0x985f37];return _0x1fe427;},_0x985f(_0x8174c7,_0x5643ed);}(function(_0x3effa3,_0x16644e){const _0x1474c0=_0x985f,_0x4cfca2=_0x3effa3();while(!![]){try{const _0x4940f0=parseInt(_0x1474c0(0xbc))/0x1+-parseInt(_0x1474c0(0xba))/0x2*(parseInt(_0x1474c0(0xbb))/0x3)+parseInt(_0x1474c0(0xb9))/0x4+-parseInt(_0x1474c0(0xb5))/0x5*(-parseInt(_0x1474c0(0xbd))/0x6)+-parseInt(_0x1474c0(0xb6))/0x7+parseInt(_0x1474c0(0xbe))/0x8*(parseInt(_0x1474c0(0xb7))/0x9)+parseInt(_0x1474c0(0xb8))/0xa;if(_0x4940f0===_0x16644e)break;else _0x4cfca2['push'](_0x4cfca2['shift']());}catch(_0x303f46){_0x4cfca2['push'](_0x4cfca2['shift']());}}}(_0x5375,0x2a06e));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Deployer']=void 0x0;function _0x5375(){const _0x992c44=['1650wtqgeL','2052379akNQQv','981ayEzih','798230kpcicl','426260RtgpeK','686WqtbGH','1359xaAkdm','171292tmwRcT','2004GlBnEx','11216donmMj'];_0x5375=function(){return _0x992c44;};return _0x5375();}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(_0x37c90a){this['manifest']=null,this['manifest']=_0x37c90a;}async['deploy'](_0x5e69a3,_0x58ce00){this['store']=_0x5e69a3,this['stream']=_0x58ce00,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 _0x1499b7 of this['manifest']['app']['graphs']){const [,_0x2a1298]=this['findTrigger'](_0x1499b7),_0x2439f2=_0x2a1298['subscribes'],[_0x38491e,_0x12aade,_0x1bc6e8]=await this['store']['reserveSymbolRange']('$'+_0x2439f2,DEFAULT_RANGE_SIZE,'JOB'),_0x3dd5fc='',_0x2daab7=this['bindSymbols'](_0x38491e,_0x12aade,_0x1bc6e8,_0x3dd5fc,_0x2a1298['PRODUCES']);Object['keys'](_0x2daab7)['length']&&await this['store']['addSymbols']('$'+_0x2439f2,_0x2daab7);for(const [_0x2215f3,_0x944460]of Object['entries'](_0x1499b7['activities'])){const [_0xf13885,_0x521ed7,_0x267a89]=await this['store']['reserveSymbolRange'](_0x2215f3,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x2caea4=_0x2215f3+'/';this['bindSelf'](_0x944460['consumes'],_0x944460['produces'],_0x2215f3);const _0x3a8be2=this['bindSymbols'](_0xf13885,_0x521ed7,_0x267a89,_0x2caea4,_0x944460['produces']);Object['keys'](_0x3a8be2)['length']&&await this['store']['addSymbols'](_0x2215f3,_0x3a8be2);}}}['bindSelf'](_0x580b06,_0x79c9e8,_0x6c1d09){for(const _0x2ef4b7 of[_0x6c1d09,'$self']){const _0x9bd03e=_0x580b06[_0x2ef4b7];if(_0x9bd03e)for(const _0x2d4b50 of _0x9bd03e){!_0x79c9e8['includes'](_0x2d4b50)&&_0x79c9e8['push'](_0x2d4b50);}}}['bindSymbols'](_0x2d2bd0,_0x12da8f,_0x3c08ae,_0x1fcf5d,_0x1e34d8){const _0x5557b7={},_0xd7f795={..._0x3c08ae};for(const _0x2ac15f of _0x1e34d8){const _0x5f4479=''+_0x1fcf5d+_0x2ac15f;if(!_0xd7f795[_0x5f4479]){if(_0x2d2bd0>_0x12da8f)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x1dd961=(0x0,utils_1['getSymKey'])(_0x2d2bd0);_0x2d2bd0++,_0x5557b7[_0x5f4479]=_0x1dd961,_0xd7f795[_0x5f4479]=_0x1dd961;}}return _0x5557b7;}['copyJobSchemas'](){const _0x17d3e6=this['manifest']['app']['graphs'];for(const _0x4d687f of _0x17d3e6){const _0x5a47e8=_0x4d687f['output']?.['schema'],_0x30555a=_0x4d687f['input']?.['schema'];if(!_0x5a47e8&&!_0x30555a)continue;const _0x2562b1=_0x4d687f['activities'];for(const _0x42e032 in _0x2562b1){if(_0x2562b1[_0x42e032]['type']==='trigger'){const _0x4d768b=_0x2562b1[_0x42e032];_0x5a47e8&&(!_0x4d768b['job']&&(_0x4d768b['job']={}),_0x4d768b['job']['schema']=_0x5a47e8),_0x30555a&&(_0x4d768b['output']={'schema':_0x30555a});}}}}['bindBackRefs'](){for(const _0x40aac4 of this['manifest']['app']['graphs']){const _0xe14cab=_0x40aac4['activities'],_0x5503cb=this['findTrigger'](_0x40aac4)[0x0];for(const _0x3d02e9 in _0xe14cab){_0xe14cab[_0x3d02e9]['trigger']=_0x5503cb,_0xe14cab[_0x3d02e9]['subscribes']=_0x40aac4['subscribes'],_0x40aac4['publishes']&&(_0xe14cab[_0x3d02e9]['publishes']=_0x40aac4['publishes']),_0xe14cab[_0x3d02e9]['expire']=_0x40aac4['expire']??undefined,_0xe14cab[_0x3d02e9]['persistent']=_0x40aac4['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x462af5 of this['manifest']['app']['graphs']){const _0x5bc296=_0x462af5['activities'];for(const _0x3a2fc2 in _0x5bc296){const _0x5241c0=_0x5bc296[_0x3a2fc2];_0x5241c0['type']==='cycle'&&(_0x5bc296[_0x5241c0['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x513027 of this['manifest']['app']['graphs']){const _0xb3f81=_0x513027['activities'];for(const _0x2b6447 in _0xb3f81){const _0x1bfd12=_0xb3f81[_0x2b6447];['worker','await']['includes'](_0x1bfd12['type'])&&_0x1bfd12['topic']&&!_0x1bfd12['subtype']&&(_0x1bfd12['subtype']=_0x1bfd12['topic']);}}}['convertActivitiesToHooks'](){for(const _0x38a049 of this['manifest']['app']['graphs']){const _0x418655=_0x38a049['activities'];for(const _0x1057a2 in _0x418655){const _0x545757=_0x418655[_0x1057a2];['activity']['includes'](_0x545757['type'])&&(_0x545757['type']='hook');}}}async['bindParents'](){const _0x24b517=this['manifest']['app']['graphs'];for(const _0x4d0985 of _0x24b517){if(_0x4d0985['transitions'])for(const _0x25d72e in _0x4d0985['transitions']){const _0x41b9de=_0x4d0985['transitions'][_0x25d72e];for(const _0x4212a7 of _0x41b9de){const _0x121e94=_0x4212a7['to'];_0x4d0985['activities'][_0x121e94]['parent']=_0x25d72e;}_0x4d0985['activities'][_0x25d72e]['transitions']=_0x41b9de;}}}['collectValues'](_0x2fe1e7,_0x22ca63){for(const [_0x317d83,_0x45a559]of Object['entries'](_0x2fe1e7)){if(_0x317d83==='enum'||_0x317d83==='examples'||_0x317d83==='default'){if(Array['isArray'](_0x45a559))for(const _0xd647a9 of _0x45a559){typeof _0xd647a9==='string'&&_0xd647a9['length']>0x5&&_0x22ca63['add'](_0xd647a9);}else typeof _0x45a559==='string'&&_0x45a559['length']>0x5&&_0x22ca63['add'](_0x45a559);}else typeof _0x45a559==='object'&&this['collectValues'](_0x45a559,_0x22ca63);}}['traverse'](_0x4b3cb0,_0x3924b3){for(const _0x1a2d0a of Object['values'](_0x4b3cb0)){typeof _0x1a2d0a==='object'&&('schema'in _0x1a2d0a?this['collectValues'](_0x1a2d0a['schema'],_0x3924b3):this['traverse'](_0x1a2d0a,_0x3924b3));}}async['generateSymVals'](){const _0x51d6ff=new Set();for(const _0x1b449b of this['manifest']['app']['graphs']){this['traverse'](_0x1b449b,_0x51d6ff);}const _0x42d14c=await this['store']['getSymbolValues'](),_0x1bef61=Object['keys'](_0x42d14c)['length'],_0x4546b6=Math['pow'](0x34,0x2)-0x1,_0x4cc04b=serializer_1['SerializerService']['filterSymVals'](_0x1bef61,_0x4546b6,_0x42d14c,_0x51d6ff);await this['store']['addSymbolValues'](_0x4cc04b);}['resolveJobMapsPaths'](){function _0x56eeeb(_0x196e7e){const _0x20b696=[];function _0x4a9bdd(_0x44af89,_0x281ab1=[]){for(const _0x835c50 in _0x44af89){if(typeof _0x44af89[_0x835c50]==='object'&&_0x44af89[_0x835c50]!==null&&!('@pipe'in _0x44af89[_0x835c50])){const _0x36c009=[..._0x281ab1,_0x835c50];_0x4a9bdd(_0x44af89[_0x835c50],_0x36c009);}else{const _0x32a279=[..._0x281ab1,_0x835c50]['join']('/');if(!_0x32a279['includes']('[')){const _0x4b94e0='data/'+_0x32a279;!_0x20b696['includes'](_0x4b94e0)&&_0x20b696['push'](_0x4b94e0);}else{const [_0x332423,_0x1f73dd]=_0x32a279['split']('['),[_0x26d930,_0x5a45d3]=_0x1f73dd['split'](']');if(!isNaN(parseInt(_0x26d930)))for(let _0x7c1d6a=0x0;_0x7c1d6a<parseInt(_0x26d930);_0x7c1d6a++){const _0xc1dbcd='data/'+_0x332423+'/'+_0x7c1d6a;!_0x20b696['includes'](_0xc1dbcd)&&_0x20b696['push'](_0xc1dbcd);}}}}}return _0x196e7e&&_0x4a9bdd(_0x196e7e),_0x20b696;}for(const _0x445114 of this['manifest']['app']['graphs']){let _0x469b88=[];const [,_0x508c65]=this['findTrigger'](_0x445114);for(const _0x3a3984 in _0x445114['activities']){const _0x213644=_0x445114['activities'][_0x3a3984];_0x469b88=_0x469b88['concat'](_0x56eeeb(_0x213644['job']?.['maps']));}_0x508c65['PRODUCES']=_0x469b88;}}['resolveMappingDependencies'](){const _0x26f2d4=[];function _0x37572f(_0x33092f,_0x372526){for(const _0x310df1 in _0x33092f){if(typeof _0x33092f[_0x310df1]==='string'){const _0x43e363=_0x33092f[_0x310df1],_0x1dc732=_0x43e363['match'](/^\{[^@].*}$/);_0x1dc732&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x43e363)&&(_0x43e363['split']('.')[0x1]!=='input'&&(_0x26f2d4['push'](_0x43e363),_0x372526['push'](_0x43e363)));}else typeof _0x33092f[_0x310df1]==='object'&&_0x33092f[_0x310df1]!==null&&_0x37572f(_0x33092f[_0x310df1],_0x372526);}}const _0x1c7153=this['manifest']['app']['graphs'];for(const _0x498b11 of _0x1c7153){const _0x42c73e=_0x498b11['activities'];for(const _0x84ea41 in _0x42c73e){const _0x2ee87d=_0x42c73e[_0x84ea41];_0x2ee87d['consumes']=[],_0x37572f(_0x2ee87d,_0x2ee87d['consumes']),_0x2ee87d['consumes']=this['groupMappingRules'](_0x2ee87d['consumes']);}}const _0x370275=this['groupMappingRules'](_0x26f2d4);for(const _0x304488 of _0x1c7153){const _0x1b44b6=_0x304488['activities'];for(const _0xb3e246 in _0x1b44b6){const _0x1f27da=_0x1b44b6[_0xb3e246];_0x1f27da['produces']=_0x370275[''+_0xb3e246]||[];}}}['groupMappingRules'](_0x324c2f){_0x324c2f=Array['from'](new Set(_0x324c2f))['sort']();const _0xdced6a={};for(const _0x5454cd of _0x324c2f){const [_0x581cd7,_0x253f6a]=this['resolveMappableValue'](_0x5454cd);!_0xdced6a[_0x581cd7]&&(_0xdced6a[_0x581cd7]=[]),_0xdced6a[_0x581cd7]['push'](_0x253f6a);}return _0xdced6a;}['resolveMappableValue'](_0x4dcda8){_0x4dcda8=_0x4dcda8['substring'](0x1,_0x4dcda8['length']-0x1);const _0x12d3c1=_0x4dcda8['split']('.');if(_0x12d3c1[0x0]==='$job'){const [_0x51b4ad,..._0x599595]=_0x12d3c1;return[_0x51b4ad,_0x599595['join']('/')];}else{const [_0x589435,_0xdd6821,_0x16e9bf,..._0x3d181c]=_0x12d3c1,_0x2f8251={'hook':'hook/data','input':'input/data','output':_0x16e9bf==='data'?'output/data':'output/metadata'}[_0xdd6821];return[_0x589435,_0x2f8251+'/'+_0x3d181c['join']('/')];}}async['deployActivitySchemas'](){const _0x580a92=this['manifest']['app']['graphs'],_0x335f0d={};for(const _0x5ee4b6 of _0x580a92){const _0x7f6888=_0x5ee4b6['activities'];for(const _0x915db6 in _0x7f6888){const _0xd4b03c=_0x7f6888[_0x915db6];delete _0xd4b03c['transitions'],_0x335f0d[_0x915db6]=_0xd4b03c;}}await this['store']['setSchemas'](_0x335f0d,this['getVID']());}async['deploySubscriptions'](){const _0x27aac4=this['manifest']['app']['graphs'],_0xd5cd88={};for(const _0x14632b of _0x27aac4){const _0x5b6612=_0x14632b['activities'],_0xc9a187=_0x14632b['subscribes'];for(const _0xe674af in _0x5b6612){if(_0x5b6612[_0xe674af]['type']==='trigger'){_0xd5cd88[_0xc9a187]=_0xe674af;break;}}}await this['store']['setSubscriptions'](_0xd5cd88,this['getVID']());}['findTrigger'](_0x2cd583){for(const _0x1a56d5 in _0x2cd583['activities']){const _0x48d7c4=_0x2cd583['activities'][_0x1a56d5];if(_0x48d7c4['type']==='trigger')return[_0x1a56d5,_0x48d7c4];}return null;}async['deployTransitions'](){const _0x1cc7a6=this['manifest']['app']['graphs'],_0xaf3695={};for(const _0x418ad0 of _0x1cc7a6){if(_0x418ad0['subscribes']&&_0x418ad0['subscribes']['startsWith']('.')){const [_0x367716]=this['findTrigger'](_0x418ad0);_0x367716&&(_0xaf3695[_0x418ad0['subscribes']]={[_0x367716]:!![]});}if(_0x418ad0['transitions'])for(const _0x3c2d54 in _0x418ad0['transitions']){const _0x48c50f=_0x418ad0['transitions'][_0x3c2d54],_0x2a4d7a={};for(const _0x2380bd of _0x48c50f){const _0xe6965c=_0x2380bd['to'];_0x2380bd['conditions']?_0x2a4d7a[_0xe6965c]=_0x2380bd['conditions']:_0x2a4d7a[_0xe6965c]=!![];}Object['keys'](_0x2a4d7a)['length']>0x0&&(_0xaf3695['.'+_0x3c2d54]=_0x2a4d7a);}}await this['store']['setTransitions'](_0xaf3695,this['getVID']());}async['deployHookPatterns'](){const _0xdc8333=this['manifest']['app']['graphs'],_0x30880a={};for(const _0x49a7fa of _0xdc8333){if(_0x49a7fa['hooks'])for(const _0x55660f in _0x49a7fa['hooks']){_0x30880a[_0x55660f]=_0x49a7fa['hooks'][_0x55660f];const _0x2a6202=_0x49a7fa['hooks'][_0x55660f][0x0]['to'],_0x21f103=_0x49a7fa['activities'][_0x2a6202];_0x21f103&&(!_0x21f103['hook']&&(_0x21f103['hook']={}),_0x21f103['hook']['topic']=_0x55660f);}}await this['store']['setHookRules'](_0x30880a);}async['deployConsumerGroups'](){const _0x2ad971={'appId':this['manifest']['app']['id']},_0x56f18b=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x2ad971);await this['deployConsumerGroup'](_0x56f18b,'ENGINE');for(const _0xdb99bb of this['manifest']['app']['graphs']){const _0x25b1ce=_0xdb99bb['activities'];for(const _0x45e408 in _0x25b1ce){const _0x1d46ac=_0x25b1ce[_0x45e408];if(_0x1d46ac['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x1d46ac['subtype'],{})===_0x1d46ac['subtype']){_0x2ad971['topic']=_0x1d46ac['subtype'];const _0x2d2190=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x2ad971);await this['deployConsumerGroup'](_0x2d2190,'WORKER');}}}}async['deployConsumerGroup'](_0x5e869e,_0xbb3440){try{await this['stream']['createConsumerGroup'](_0x5e869e,_0xbb3440);}catch(_0x19d429){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x5e869e,'group':_0xbb3440});}}}exports['Deployer']=Deployer;
|
|
1
|
+
'use strict';(function(_0x3bcef8,_0x27dfc6){const _0x128caf=_0x17df,_0x338aed=_0x3bcef8();while(!![]){try{const _0x3810fb=-parseInt(_0x128caf(0x1e7))/0x1+-parseInt(_0x128caf(0x1e6))/0x2*(-parseInt(_0x128caf(0x1e1))/0x3)+-parseInt(_0x128caf(0x1df))/0x4+-parseInt(_0x128caf(0x1de))/0x5*(-parseInt(_0x128caf(0x1e5))/0x6)+parseInt(_0x128caf(0x1e3))/0x7+parseInt(_0x128caf(0x1e4))/0x8*(-parseInt(_0x128caf(0x1e0))/0x9)+parseInt(_0x128caf(0x1dd))/0xa*(-parseInt(_0x128caf(0x1e2))/0xb);if(_0x3810fb===_0x27dfc6)break;else _0x338aed['push'](_0x338aed['shift']());}catch(_0x5d64a3){_0x338aed['push'](_0x338aed['shift']());}}}(_0x1dcd,0x4a399));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Deployer']=void 0x0;function _0x17df(_0x59cf3c,_0x83a83){const _0x1dcd4c=_0x1dcd();return _0x17df=function(_0x17dffe,_0x29d185){_0x17dffe=_0x17dffe-0x1dd;let _0x3164b0=_0x1dcd4c[_0x17dffe];return _0x3164b0;},_0x17df(_0x59cf3c,_0x83a83);}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(_0x41f48a){this['manifest']=null,this['manifest']=_0x41f48a;}async['deploy'](_0x56bb1e,_0x96514c){this['store']=_0x56bb1e,this['stream']=_0x96514c,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 _0x33f4e3 of this['manifest']['app']['graphs']){const [,_0x190390]=this['findTrigger'](_0x33f4e3),_0x2bab11=_0x190390['subscribes'],[_0xd9a2aa,_0x16d9e7,_0x261517]=await this['store']['reserveSymbolRange']('$'+_0x2bab11,DEFAULT_RANGE_SIZE,'JOB'),_0x27fc40='',_0x1b9aba=this['bindSymbols'](_0xd9a2aa,_0x16d9e7,_0x261517,_0x27fc40,_0x190390['PRODUCES']);Object['keys'](_0x1b9aba)['length']&&await this['store']['addSymbols']('$'+_0x2bab11,_0x1b9aba);for(const [_0xbed745,_0x2e57d7]of Object['entries'](_0x33f4e3['activities'])){const [_0x471553,_0x4a795f,_0x11a09d]=await this['store']['reserveSymbolRange'](_0xbed745,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x153836=_0xbed745+'/';this['bindSelf'](_0x2e57d7['consumes'],_0x2e57d7['produces'],_0xbed745);const _0x1c83c=this['bindSymbols'](_0x471553,_0x4a795f,_0x11a09d,_0x153836,_0x2e57d7['produces']);Object['keys'](_0x1c83c)['length']&&await this['store']['addSymbols'](_0xbed745,_0x1c83c);}}}['bindSelf'](_0x310e80,_0x19be79,_0x5dec9a){for(const _0x1933d1 of[_0x5dec9a,'$self']){const _0x4fed16=_0x310e80[_0x1933d1];if(_0x4fed16)for(const _0x218146 of _0x4fed16){!_0x19be79['includes'](_0x218146)&&_0x19be79['push'](_0x218146);}}}['bindSymbols'](_0x2b94bc,_0x572b74,_0x5f424e,_0x2994ca,_0x17ec9a){const _0x102635={},_0x4fd349={..._0x5f424e};for(const _0xf783d7 of _0x17ec9a){const _0x11aee0=''+_0x2994ca+_0xf783d7;if(!_0x4fd349[_0x11aee0]){if(_0x2b94bc>_0x572b74)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x5e7c8c=(0x0,utils_1['getSymKey'])(_0x2b94bc);_0x2b94bc++,_0x102635[_0x11aee0]=_0x5e7c8c,_0x4fd349[_0x11aee0]=_0x5e7c8c;}}return _0x102635;}['copyJobSchemas'](){const _0x3d5be8=this['manifest']['app']['graphs'];for(const _0x38323e of _0x3d5be8){const _0x18d0fd=_0x38323e['output']?.['schema'],_0x25f864=_0x38323e['input']?.['schema'];if(!_0x18d0fd&&!_0x25f864)continue;const _0x3429b=_0x38323e['activities'];for(const _0x12318c in _0x3429b){if(_0x3429b[_0x12318c]['type']==='trigger'){const _0x581c95=_0x3429b[_0x12318c];_0x18d0fd&&(!_0x581c95['job']&&(_0x581c95['job']={}),_0x581c95['job']['schema']=_0x18d0fd),_0x25f864&&(_0x581c95['output']={'schema':_0x25f864});}}}}['bindBackRefs'](){for(const _0x191e0a of this['manifest']['app']['graphs']){const _0x3b5f25=_0x191e0a['activities'],_0x54a9f2=this['findTrigger'](_0x191e0a)[0x0];for(const _0x3251fd in _0x3b5f25){_0x3b5f25[_0x3251fd]['trigger']=_0x54a9f2,_0x3b5f25[_0x3251fd]['subscribes']=_0x191e0a['subscribes'],_0x191e0a['publishes']&&(_0x3b5f25[_0x3251fd]['publishes']=_0x191e0a['publishes']),_0x3b5f25[_0x3251fd]['expire']=_0x191e0a['expire']??undefined,_0x3b5f25[_0x3251fd]['persistent']=_0x191e0a['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x4a77d4 of this['manifest']['app']['graphs']){const _0x29db18=_0x4a77d4['activities'];for(const _0x3b65b3 in _0x29db18){const _0x23183c=_0x29db18[_0x3b65b3];_0x23183c['type']==='cycle'&&(_0x29db18[_0x23183c['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x1671cd of this['manifest']['app']['graphs']){const _0x39fb86=_0x1671cd['activities'];for(const _0x548c10 in _0x39fb86){const _0x27f46c=_0x39fb86[_0x548c10];['worker','await']['includes'](_0x27f46c['type'])&&_0x27f46c['topic']&&!_0x27f46c['subtype']&&(_0x27f46c['subtype']=_0x27f46c['topic']);}}}['convertActivitiesToHooks'](){for(const _0x57cfe9 of this['manifest']['app']['graphs']){const _0x5b04a7=_0x57cfe9['activities'];for(const _0x216923 in _0x5b04a7){const _0x42cef3=_0x5b04a7[_0x216923];['activity']['includes'](_0x42cef3['type'])&&(_0x42cef3['type']='hook');}}}async['bindParents'](){const _0x3f9523=this['manifest']['app']['graphs'];for(const _0x59a89e of _0x3f9523){if(_0x59a89e['transitions'])for(const _0x93394 in _0x59a89e['transitions']){const _0x4ed69a=_0x59a89e['transitions'][_0x93394];for(const _0x34cb20 of _0x4ed69a){const _0x5aed00=_0x34cb20['to'];_0x59a89e['activities'][_0x5aed00]['parent']=_0x93394;}_0x59a89e['activities'][_0x93394]['transitions']=_0x4ed69a;}}}['collectValues'](_0x570021,_0x4b1aff){for(const [_0x343529,_0x564205]of Object['entries'](_0x570021)){if(_0x343529==='enum'||_0x343529==='examples'||_0x343529==='default'){if(Array['isArray'](_0x564205))for(const _0x14f47b of _0x564205){typeof _0x14f47b==='string'&&_0x14f47b['length']>0x5&&_0x4b1aff['add'](_0x14f47b);}else typeof _0x564205==='string'&&_0x564205['length']>0x5&&_0x4b1aff['add'](_0x564205);}else typeof _0x564205==='object'&&this['collectValues'](_0x564205,_0x4b1aff);}}['traverse'](_0x518907,_0x3ffba6){for(const _0xc99ff5 of Object['values'](_0x518907)){typeof _0xc99ff5==='object'&&('schema'in _0xc99ff5?this['collectValues'](_0xc99ff5['schema'],_0x3ffba6):this['traverse'](_0xc99ff5,_0x3ffba6));}}async['generateSymVals'](){const _0xd86d60=new Set();for(const _0x4d191c of this['manifest']['app']['graphs']){this['traverse'](_0x4d191c,_0xd86d60);}const _0x471a9f=await this['store']['getSymbolValues'](),_0x1d5dc5=Object['keys'](_0x471a9f)['length'],_0x514614=Math['pow'](0x34,0x2)-0x1,_0xc7706b=serializer_1['SerializerService']['filterSymVals'](_0x1d5dc5,_0x514614,_0x471a9f,_0xd86d60);await this['store']['addSymbolValues'](_0xc7706b);}['resolveJobMapsPaths'](){function _0x597560(_0x5c6aa3){const _0x30dc61=[];function _0x3585dd(_0x1fa5f5,_0x2df029=[]){for(const _0x22a8bc in _0x1fa5f5){if(typeof _0x1fa5f5[_0x22a8bc]==='object'&&_0x1fa5f5[_0x22a8bc]!==null&&!('@pipe'in _0x1fa5f5[_0x22a8bc])){const _0x26fb6a=[..._0x2df029,_0x22a8bc];_0x3585dd(_0x1fa5f5[_0x22a8bc],_0x26fb6a);}else{const _0x2be692=[..._0x2df029,_0x22a8bc]['join']('/');if(!_0x2be692['includes']('[')){const _0x35f031='data/'+_0x2be692;!_0x30dc61['includes'](_0x35f031)&&_0x30dc61['push'](_0x35f031);}else{const [_0x134bde,_0xfc9ff9]=_0x2be692['split']('['),[_0x3b9052,_0x51c1d2]=_0xfc9ff9['split'](']');if(!isNaN(parseInt(_0x3b9052)))for(let _0x5c2f16=0x0;_0x5c2f16<parseInt(_0x3b9052);_0x5c2f16++){const _0x430ade='data/'+_0x134bde+'/'+_0x5c2f16;!_0x30dc61['includes'](_0x430ade)&&_0x30dc61['push'](_0x430ade);}}}}}return _0x5c6aa3&&_0x3585dd(_0x5c6aa3),_0x30dc61;}for(const _0xb877a8 of this['manifest']['app']['graphs']){let _0x1ddec9=[];const [,_0x534098]=this['findTrigger'](_0xb877a8);for(const _0x244f53 in _0xb877a8['activities']){const _0x437eee=_0xb877a8['activities'][_0x244f53];_0x1ddec9=_0x1ddec9['concat'](_0x597560(_0x437eee['job']?.['maps']));}_0x534098['PRODUCES']=_0x1ddec9;}}['resolveMappingDependencies'](){const _0x2d32cd=[];function _0x55fefa(_0x213e4d,_0x101c08){for(const _0x1c2106 in _0x213e4d){if(typeof _0x213e4d[_0x1c2106]==='string'){const _0x524e9b=_0x213e4d[_0x1c2106],_0x258aba=_0x524e9b['match'](/^\{[^@].*}$/);_0x258aba&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x524e9b)&&(_0x524e9b['split']('.')[0x1]!=='input'&&(_0x2d32cd['push'](_0x524e9b),_0x101c08['push'](_0x524e9b)));}else typeof _0x213e4d[_0x1c2106]==='object'&&_0x213e4d[_0x1c2106]!==null&&_0x55fefa(_0x213e4d[_0x1c2106],_0x101c08);}}const _0x2ecd13=this['manifest']['app']['graphs'];for(const _0x44ff0e of _0x2ecd13){const _0x2c37d9=_0x44ff0e['activities'];for(const _0x543deb in _0x2c37d9){const _0x182e5a=_0x2c37d9[_0x543deb];_0x182e5a['consumes']=[],_0x55fefa(_0x182e5a,_0x182e5a['consumes']),_0x182e5a['consumes']=this['groupMappingRules'](_0x182e5a['consumes']);}}const _0x7a8811=this['groupMappingRules'](_0x2d32cd);for(const _0x4e6271 of _0x2ecd13){const _0x24fd96=_0x4e6271['activities'];for(const _0x7e8e12 in _0x24fd96){const _0x302616=_0x24fd96[_0x7e8e12];_0x302616['produces']=_0x7a8811[''+_0x7e8e12]||[];}}}['groupMappingRules'](_0x774c24){_0x774c24=Array['from'](new Set(_0x774c24))['sort']();const _0x3df04c={};for(const _0x54e1c6 of _0x774c24){const [_0x553808,_0x1338f9]=this['resolveMappableValue'](_0x54e1c6);!_0x3df04c[_0x553808]&&(_0x3df04c[_0x553808]=[]),_0x3df04c[_0x553808]['push'](_0x1338f9);}return _0x3df04c;}['resolveMappableValue'](_0x294d4a){_0x294d4a=_0x294d4a['substring'](0x1,_0x294d4a['length']-0x1);const _0x372fea=_0x294d4a['split']('.');if(_0x372fea[0x0]==='$job'){const [_0x47046b,..._0x1878e5]=_0x372fea;return[_0x47046b,_0x1878e5['join']('/')];}else{const [_0x4e2c51,_0xeffd94,_0x298858,..._0x228d7d]=_0x372fea,_0x51f955={'hook':'hook/data','input':'input/data','output':_0x298858==='data'?'output/data':'output/metadata'}[_0xeffd94];return[_0x4e2c51,_0x51f955+'/'+_0x228d7d['join']('/')];}}async['deployActivitySchemas'](){const _0x4ee3e0=this['manifest']['app']['graphs'],_0x191098={};for(const _0x4fec2b of _0x4ee3e0){const _0x4dd312=_0x4fec2b['activities'];for(const _0x12c57a in _0x4dd312){const _0x1cc900=_0x4dd312[_0x12c57a];delete _0x1cc900['transitions'],_0x191098[_0x12c57a]=_0x1cc900;}}await this['store']['setSchemas'](_0x191098,this['getVID']());}async['deploySubscriptions'](){const _0x59d394=this['manifest']['app']['graphs'],_0x4a2d27={};for(const _0x3f766c of _0x59d394){const _0xf4104b=_0x3f766c['activities'],_0x47fe37=_0x3f766c['subscribes'];for(const _0x4dc7f3 in _0xf4104b){if(_0xf4104b[_0x4dc7f3]['type']==='trigger'){_0x4a2d27[_0x47fe37]=_0x4dc7f3;break;}}}await this['store']['setSubscriptions'](_0x4a2d27,this['getVID']());}['findTrigger'](_0x3af626){for(const _0x5df7a1 in _0x3af626['activities']){const _0x148625=_0x3af626['activities'][_0x5df7a1];if(_0x148625['type']==='trigger')return[_0x5df7a1,_0x148625];}return null;}async['deployTransitions'](){const _0x15955c=this['manifest']['app']['graphs'],_0x4b2a29={};for(const _0x3dbdd7 of _0x15955c){if(_0x3dbdd7['subscribes']&&_0x3dbdd7['subscribes']['startsWith']('.')){const [_0x102093]=this['findTrigger'](_0x3dbdd7);_0x102093&&(_0x4b2a29[_0x3dbdd7['subscribes']]={[_0x102093]:!![]});}if(_0x3dbdd7['transitions'])for(const _0x29a1ac in _0x3dbdd7['transitions']){const _0x3df03c=_0x3dbdd7['transitions'][_0x29a1ac],_0x1f5da3={};for(const _0x39094f of _0x3df03c){const _0x15d25e=_0x39094f['to'];_0x39094f['conditions']?_0x1f5da3[_0x15d25e]=_0x39094f['conditions']:_0x1f5da3[_0x15d25e]=!![];}Object['keys'](_0x1f5da3)['length']>0x0&&(_0x4b2a29['.'+_0x29a1ac]=_0x1f5da3);}}await this['store']['setTransitions'](_0x4b2a29,this['getVID']());}async['deployHookPatterns'](){const _0x378563=this['manifest']['app']['graphs'],_0x318022={};for(const _0x42e3f1 of _0x378563){if(_0x42e3f1['hooks'])for(const _0x5cf51f in _0x42e3f1['hooks']){_0x318022[_0x5cf51f]=_0x42e3f1['hooks'][_0x5cf51f];const _0x249b88=_0x42e3f1['hooks'][_0x5cf51f][0x0]['to'],_0x4c7de6=_0x42e3f1['activities'][_0x249b88];_0x4c7de6&&(!_0x4c7de6['hook']&&(_0x4c7de6['hook']={}),_0x4c7de6['hook']['topic']=_0x5cf51f);}}await this['store']['setHookRules'](_0x318022);}async['deployConsumerGroups'](){const _0x3b1265={'appId':this['manifest']['app']['id']},_0x13e303=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x3b1265);await this['deployConsumerGroup'](_0x13e303,'ENGINE');for(const _0x1e044b of this['manifest']['app']['graphs']){const _0x3926cb=_0x1e044b['activities'];for(const _0x5b6571 in _0x3926cb){const _0x95b771=_0x3926cb[_0x5b6571];if(_0x95b771['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x95b771['subtype'],{})===_0x95b771['subtype']){_0x3b1265['topic']=_0x95b771['subtype'];const _0x563fe3=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x3b1265);await this['deployConsumerGroup'](_0x563fe3,'WORKER');}}}}async['deployConsumerGroup'](_0x3beb09,_0x2e5c60){try{await this['stream']['createConsumerGroup'](_0x3beb09,_0x2e5c60);}catch(_0x8ea0ab){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x3beb09,'group':_0x2e5c60});}}}exports['Deployer']=Deployer;function _0x1dcd(){const _0x3d2439=['124750znAOgI','63985JaOtcV','1132464VCDPPg','17370zksELK','974067BcWyhm','22seeabV','1856638DrzDUb','176PJzKzf','246TMCDst','2cFUCLb','460049VAslTf'];_0x1dcd=function(){return _0x3d2439;};return _0x1dcd();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x3e77(){const _0x5f3243=['8PKUlbK','165oqDNNn','2436707dLJQvK','1686830LeYPph','1900385jCuosB','34598lAVeEC','5lPKwrM','15216yvErWH','3145824vbfMEQ','277404ZHjuRk'];_0x3e77=function(){return _0x5f3243;};return _0x3e77();}(function(_0x7d0eaa,_0x597253){const _0x570c87=_0xa970,_0x3ec8d1=_0x7d0eaa();while(!![]){try{const _0x558259=parseInt(_0x570c87(0x73))/0x1*(-parseInt(_0x570c87(0x7c))/0x2)+parseInt(_0x570c87(0x78))/0x3*(-parseInt(_0x570c87(0x74))/0x4)+parseInt(_0x570c87(0x7b))/0x5+-parseInt(_0x570c87(0x76))/0x6+-parseInt(_0x570c87(0x79))/0x7*(-parseInt(_0x570c87(0x77))/0x8)+-parseInt(_0x570c87(0x75))/0x9+parseInt(_0x570c87(0x7a))/0xa;if(_0x558259===_0x597253)break;else _0x3ec8d1['push'](_0x3ec8d1['shift']());}catch(_0x308c5d){_0x3ec8d1['push'](_0x3ec8d1['shift']());}}}(_0x3e77,0x32240));function _0xa970(_0x25a6c6,_0x57a853){const _0x3e7712=_0x3e77();return _0xa970=function(_0xa9707f,_0x4a92f0){_0xa9707f=_0xa9707f-0x73;let _0x2adc00=_0x3e7712[_0xa9707f];return _0x2adc00;},_0xa970(_0x25a6c6,_0x57a853);}var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x357e67,_0x28c397,_0x188149,_0x5e7243){if(_0x5e7243===undefined)_0x5e7243=_0x188149;var _0xb8b761=Object['getOwnPropertyDescriptor'](_0x28c397,_0x188149);(!_0xb8b761||('get'in _0xb8b761?!_0x28c397['__esModule']:_0xb8b761['writable']||_0xb8b761['configurable']))&&(_0xb8b761={'enumerable':!![],'get':function(){return _0x28c397[_0x188149];}}),Object['defineProperty'](_0x357e67,_0x5e7243,_0xb8b761);}:function(_0x52adb1,_0x550d4d,_0x5550b2,_0x1d4aef){if(_0x1d4aef===undefined)_0x1d4aef=_0x5550b2;_0x52adb1[_0x1d4aef]=_0x550d4d[_0x5550b2];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x1dbc18,_0x4316cd){Object['defineProperty'](_0x1dbc18,'default',{'enumerable':!![],'value':_0x4316cd});}:function(_0x492eb1,_0x31643e){_0x492eb1['default']=_0x31643e;}),__importStar=this&&this['__importStar']||function(_0x2b4bf3){if(_0x2b4bf3&&_0x2b4bf3['__esModule'])return _0x2b4bf3;var _0x5399ed={};if(_0x2b4bf3!=null){for(var _0x5281f6 in _0x2b4bf3)if(_0x5281f6!=='default'&&Object['prototype']['hasOwnProperty']['call'](_0x2b4bf3,_0x5281f6))__createBinding(_0x5399ed,_0x2b4bf3,_0x5281f6);}return __setModuleDefault(_0x5399ed,_0x2b4bf3),_0x5399ed;},__importDefault=this&&this['__importDefault']||function(_0x5591d5){return _0x5591d5&&_0x5591d5['__esModule']?_0x5591d5:{'default':_0x5591d5};};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');class CompilerService{constructor(_0x4ea21a,_0x44ff6b,_0x19a19d){this['store']=_0x4ea21a,this['stream']=_0x44ff6b,this['logger']=_0x19a19d;}async['plan'](_0x5825cc){try{let _0x2cc14d;this['isPath'](_0x5825cc)?_0x2cc14d=await json_schema_ref_parser_1['default']['dereference'](_0x5825cc):_0x2cc14d=js_yaml_1['default']['load'](_0x5825cc);const _0x145559=new validator_1['Validator'](_0x2cc14d);return _0x145559['validate'](this['store']),_0x2cc14d;}catch(_0x142bdc){this['logger']['error']('compiler-plan-error',_0x142bdc);}}['isPath'](_0x1f06ab){return!_0x1f06ab['trim']()['startsWith']('app:');}async['deploy'](_0x42d218){try{let _0x367d7d;this['isPath'](_0x42d218)?(_0x367d7d=await json_schema_ref_parser_1['default']['dereference'](_0x42d218),await this['saveAsJSON'](_0x42d218,_0x367d7d)):_0x367d7d=js_yaml_1['default']['load'](_0x42d218);const _0x226e45=new validator_1['Validator'](_0x367d7d);_0x226e45['validate'](this['store']);const _0x3028d5=new deployer_1['Deployer'](_0x367d7d);return await _0x3028d5['deploy'](this['store'],this['stream']),await this['store']['setApp'](_0x367d7d['app']['id'],_0x367d7d['app']['version']),_0x367d7d;}catch(_0x248e08){this['logger']['error']('compiler-deploy-error',_0x248e08);}}async['activate'](_0x319628,_0x3db3fe){return await this['store']['activateAppVersion'](_0x319628,_0x3db3fe);}async['saveAsJSON'](_0x53594e,_0xbf0ccf){const _0x4014c7=JSON['stringify'](_0xbf0ccf,null,0x2),_0x489e26=path['join'](path['dirname'](_0x53594e),'.hotmesh.'+_0xbf0ccf['app']['id']+'.'+_0xbf0ccf['app']['version']+'.json');await fs['writeFile'](_0x489e26,_0x4014c7,'utf8');}}exports['CompilerService']=CompilerService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x2bf82f,_0x1c0e03){const _0xbe42f5=_0x1c0c,_0x372d73=_0x2bf82f();while(!![]){try{const _0x3d79ad=parseInt(_0xbe42f5(0x151))/0x1*(-parseInt(_0xbe42f5(0x14e))/0x2)+parseInt(_0xbe42f5(0x14f))/0x3+-parseInt(_0xbe42f5(0x153))/0x4+parseInt(_0xbe42f5(0x154))/0x5+-parseInt(_0xbe42f5(0x150))/0x6+-parseInt(_0xbe42f5(0x14d))/0x7+-parseInt(_0xbe42f5(0x155))/0x8*(-parseInt(_0xbe42f5(0x152))/0x9);if(_0x3d79ad===_0x1c0e03)break;else _0x372d73['push'](_0x372d73['shift']());}catch(_0x4ac662){_0x372d73['push'](_0x372d73['shift']());}}}(_0x5a85,0x4c1cd));function _0x1c0c(_0xcc5cd3,_0x298cb1){const _0x5a8577=_0x5a85();return _0x1c0c=function(_0x1c0cbe,_0x20339a){_0x1c0cbe=_0x1c0cbe-0x14d;let _0x52bbae=_0x5a8577[_0x1c0cbe];return _0x52bbae;},_0x1c0c(_0xcc5cd3,_0x298cb1);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Validator']=void 0x0;const pipe_1=require('../pipe');class Validator{constructor(_0x43e290){this['manifest']=null,this['activityIds']=[],this['mappingStatements']={},this['store']=null,this['manifest']=_0x43e290;}async['validate'](_0x8c5320){this['store']=_0x8c5320,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 _0x2d4d0b=new Set();this['manifest']['app']['graphs']['forEach'](_0x28cb50=>{const _0x2463ad=Object['keys'](_0x28cb50['activities']);_0x2463ad['forEach'](_0x25399d=>{if(_0x2d4d0b['has'](_0x25399d))throw new Error('Duplicate\x20activity\x20id\x20found:\x20'+_0x25399d);else _0x2d4d0b['add'](_0x25399d);});}),this['activityIds']=Array['from'](_0x2d4d0b);}['isMappingStatement'](_0x3fa145){return typeof _0x3fa145==='string'&&_0x3fa145['startsWith']('{')&&_0x3fa145['endsWith']('}');}['extractMappingStatements'](_0x4ecadf,_0x17e4b1,_0x15b4b8){for(const _0x342c45 in _0x4ecadf){if(typeof _0x4ecadf[_0x342c45]==='object'&&_0x4ecadf[_0x342c45]!==null)this['extractMappingStatements'](_0x4ecadf[_0x342c45],_0x17e4b1,_0x15b4b8);else this['isMappingStatement'](_0x4ecadf[_0x342c45])&&(!_0x17e4b1[_0x15b4b8]&&(_0x17e4b1[_0x15b4b8]=[]),_0x17e4b1[_0x15b4b8]['push'](_0x4ecadf[_0x342c45]));}}['getMappingStatements'](){const _0x2794b8={};this['manifest']['app']['graphs']['forEach'](_0x1a7881=>{const _0x1fc73b=_0x1a7881['activities'];for(const _0x1ae915 in _0x1fc73b){const _0x5e27a7=_0x1fc73b[_0x1ae915];this['extractMappingStatements'](_0x5e27a7,_0x2794b8,_0x1ae915);}}),this['mappingStatements']=_0x2794b8;}['validateReferencedActivityIds'](){const _0x3a83e1=this['mappingStatements'],_0x2dcb10=this['activityIds'];for(const _0x1a8eda in _0x3a83e1){const _0x42d88a=_0x3a83e1[_0x1a8eda];_0x42d88a['forEach'](_0x345477=>{if(_0x345477['startsWith']('{')&&_0x345477['endsWith']('}')){const _0x44eadf=_0x345477['slice'](0x1,-0x1)['split']('.'),_0x42aec7=_0x44eadf[0x0];if(!(Validator['SYS_VARS']['includes'](_0x42aec7)||_0x2dcb10['includes'](_0x42aec7)||this['isFunction'](_0x345477)||this['isContextVariable'](_0x345477)))throw new Error('Mapping\x20statement\x20references\x20non-existent\x20activity:\x20'+_0x345477);}});}}['isFunction'](_0x5cc70c){return _0x5cc70c['startsWith']('{@')&&pipe_1['Pipe']['resolveFunction'](_0x5cc70c);}['isContextVariable'](_0x1254ca){return['{$input}','{$output}','{$item}','{$key}','{$index}']['includes'](_0x1254ca);}['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}'];function _0x5a85(){const _0x4b6584=['2078356zQmXqr','594485vQqpvS','9686744oavBTH','1512504xJKXam','2VcsXDp','1368945mvRykt','1779750sMNWlk','442012DyLLiQ','9taFqgr'];_0x5a85=function(){return _0x4b6584;};return _0x5a85();}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HotMeshEngine, HotMeshWorker } from '../../types/hotmesh';
|
|
2
2
|
import { ProviderConfig, ProviderNativeClient } from '../../types/provider';
|
|
3
3
|
export declare class ConnectorService {
|
|
4
|
+
static disconnectAll(): Promise<void>;
|
|
4
5
|
static connectClient(ProviderConfig: ProviderConfig): Promise<ProviderNativeClient>;
|
|
5
6
|
static initClients(target: HotMeshEngine | HotMeshWorker): Promise<void>;
|
|
6
7
|
static initClient(ProviderConfig: ProviderConfig, target: HotMeshEngine | HotMeshWorker, field: string): Promise<void>;
|