@hotmeshio/hotmesh 0.3.8 → 0.3.10
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 +7 -13
- package/build/index.d.ts +5 -2
- package/build/index.js +8 -3
- package/build/modules/key.js +1 -1
- package/build/modules/utils.d.ts +12 -4
- package/build/modules/utils.js +1 -1
- package/build/package.json +15 -8
- package/build/services/activities/activity.d.ts +9 -9
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.d.ts +2 -2
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.d.ts +2 -2
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.d.ts +2 -2
- 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.d.ts +3 -3
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.d.ts +2 -2
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.d.ts +9 -9
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.d.ts +4 -4
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.d.ts +4 -4
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.d.ts +3 -3
- package/build/services/compiler/validator.js +1 -1
- package/build/services/connector/factory.d.ts +7 -0
- package/build/services/connector/factory.js +65 -0
- package/build/services/connector/index.d.ts +13 -4
- package/build/services/connector/index.js +30 -23
- package/build/services/connector/providers/ioredis.d.ts +9 -0
- package/build/services/connector/providers/ioredis.js +26 -0
- package/build/services/connector/providers/nats.d.ts +9 -0
- package/build/services/connector/providers/nats.js +26 -0
- package/build/services/connector/providers/postgres.d.ts +9 -0
- package/build/services/connector/providers/postgres.js +44 -0
- package/build/services/connector/providers/redis.d.ts +9 -0
- package/build/services/connector/providers/redis.js +38 -0
- package/build/services/engine/index.d.ts +12 -12
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.d.ts +3 -3
- package/build/services/exporter/index.js +1 -1
- package/build/services/hotmesh/index.js +4 -4
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshcall/index.d.ts +5 -4
- package/build/services/meshcall/index.js +31 -14
- package/build/services/meshdata/index.d.ts +6 -6
- package/build/services/meshdata/index.js +7 -15
- package/build/services/meshflow/connection.d.ts +3 -2
- package/build/services/meshflow/exporter.d.ts +3 -3
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/search.js +12 -4
- package/build/services/meshflow/worker.js +7 -7
- package/build/services/meshos/index.d.ts +1 -4
- package/build/services/meshos/index.js +11 -44
- 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.d.ts +2 -0
- 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.d.ts +5 -5
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.d.ts +2 -2
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.d.ts +8 -13
- package/build/services/router/index.js +1 -1
- package/build/services/search/factory.d.ts +2 -2
- package/build/services/search/factory.js +1 -1
- package/build/services/search/index.d.ts +5 -4
- 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/factory.d.ts +3 -3
- package/build/services/store/factory.js +1 -1
- package/build/services/store/index.d.ts +18 -17
- package/build/services/store/providers/redis/_base.d.ts +13 -15
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.d.ts +2 -2
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.d.ts +2 -2
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/factory.d.ts +3 -3
- package/build/services/stream/factory.js +16 -4
- package/build/services/stream/index.d.ts +57 -18
- package/build/services/stream/index.js +2 -1
- package/build/services/stream/providers/nats/nats.d.ts +59 -0
- package/build/services/stream/providers/nats/nats.js +1 -0
- package/build/services/stream/providers/postgres/postgres.d.ts +68 -0
- package/build/services/stream/providers/postgres/postgres.js +1 -0
- package/build/services/stream/providers/redis/ioredis.d.ts +53 -14
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.d.ts +54 -15
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.d.ts +1 -2
- 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 +1 -1
- package/build/services/sub/index.d.ts +6 -5
- package/build/services/sub/providers/redis/ioredis.d.ts +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.d.ts +4 -4
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.d.ts +5 -5
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.d.ts +9 -9
- package/build/services/worker/index.js +1 -1
- package/build/types/hotmesh.d.ts +26 -14
- package/build/types/index.d.ts +8 -5
- package/build/types/manifest.d.ts +1 -9
- package/build/types/meshcall.d.ts +12 -7
- package/build/types/meshflow.d.ts +3 -7
- package/build/types/nats.d.ts +150 -0
- package/build/types/nats.js +2 -0
- package/build/types/postgres.d.ts +70 -0
- package/build/types/postgres.js +2 -0
- package/build/types/provider.d.ts +26 -0
- package/build/types/provider.js +2 -0
- package/build/types/redis.d.ts +33 -15
- package/build/types/stream.d.ts +65 -1
- package/index.ts +10 -5
- package/package.json +15 -8
- package/typedoc.json +6 -0
- package/types/hotmesh.ts +139 -22
- package/types/index.ts +80 -17
- package/types/manifest.ts +1 -10
- package/types/meshcall.ts +38 -13
- package/types/meshflow.ts +2 -7
- package/types/nats.ts +236 -0
- package/types/postgres.ts +85 -0
- package/types/provider.ts +71 -0
- package/types/redis.ts +63 -18
- package/types/stream.ts +85 -1
- package/build/services/connector/clients/ioredis.d.ts +0 -13
- package/build/services/connector/clients/ioredis.js +0 -48
- package/build/services/connector/clients/redis.d.ts +0 -13
- package/build/services/connector/clients/redis.js +0 -60
- package/build/services/stream/providers/postgres/_deploy.d.ts +0 -4
- package/build/services/stream/providers/postgres/_deploy.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x27b497,_0x99ebd4){const _0x3beb85=_0x1612,_0x4cc7dc=_0x27b497();while(!![]){try{const _0x5c5c6b=parseInt(_0x3beb85(0xe1))/0x1+parseInt(_0x3beb85(0xe2))/0x2*(parseInt(_0x3beb85(0xe8))/0x3)+parseInt(_0x3beb85(0xea))/0x4*(parseInt(_0x3beb85(0xe9))/0x5)+parseInt(_0x3beb85(0xe3))/0x6*(-parseInt(_0x3beb85(0xe7))/0x7)+-parseInt(_0x3beb85(0xe5))/0x8+parseInt(_0x3beb85(0xe6))/0x9+-parseInt(_0x3beb85(0xe4))/0xa;if(_0x5c5c6b===_0x99ebd4)break;else _0x4cc7dc['push'](_0x4cc7dc['shift']());}catch(_0x161e4a){_0x4cc7dc['push'](_0x4cc7dc['shift']());}}}(_0x1ac2,0x84b5c));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Hook']=void 0x0;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(_0x671df5,_0xac8599,_0x3fe6f5,_0x52db75,_0x36207f,_0x3a52be){super(_0x671df5,_0xac8599,_0x3fe6f5,_0x52db75,_0x36207f,_0x3a52be);}async['process'](){this['logger']['debug']('hook-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x592904;try{return await this['verifyEntry'](),_0x592904=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x592904['startActivitySpan'](this['leg']),this['doesHook']()?await this['doHook'](_0x592904):await this['doPassThrough'](_0x592904),this['context']['metadata']['aid'];}catch(_0xfc9b6c){if(_0xfc9b6c instanceof errors_1['InactiveJobError']){this['logger']['error']('hook-inactive-job-error',{..._0xfc9b6c});return;}else{if(_0xfc9b6c instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0xfc9b6c});return;}else{if(_0xfc9b6c instanceof errors_1['GetStateError']){this['logger']['error']('hook-get-state-error',{..._0xfc9b6c});return;}else{if(_0xfc9b6c instanceof errors_1['CollationError']){if(_0xfc9b6c['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',{..._0xfc9b6c});}else this['logger']['error']('hook-process-error',{..._0xfc9b6c});}}}_0x592904?.['setActivityError'](_0xfc9b6c['message']);throw _0xfc9b6c;}finally{_0x592904?.['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 _0x3b07f5=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return!isNaN(_0x3b07f5)&&Number(_0x3b07f5)>0x0;}return!!this['config']['hook']?.['topic'];}async['doHook'](_0xe66b14){const _0x51d6d5=this['store']['transact']();await this['registerHook'](enums_1['HMSH_IS_CLUSTER']?undefined:_0x51d6d5),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x51d6d5),await collator_1['CollatorService']['authorizeReentry'](this,_0x51d6d5),await this['setStatus'](0x0,_0x51d6d5),await _0x51d6d5['exec'](),_0xe66b14['mapActivityAttributes']();}async['doPassThrough'](_0x375865){const _0x158935=this['store']['transact']();let _0x2006d4;this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x158935),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x158935),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x158935),_0x2006d4=await _0x158935['exec'](),_0x375865['mapActivityAttributes']();const _0xf9294c=this['resolveStatus'](_0x2006d4),_0x48595a={'app.job.jss':_0xf9294c},_0x38999e=await this['transition'](this['adjacencyList'],_0xf9294c);_0x38999e['length']&&(_0x48595a['app.activity.mids']=_0x38999e['join'](',')),_0x375865['setActivityAttributes'](_0x48595a);}async['getHookRule'](_0x37921b){const _0x4c04ef=await this['store']['getHookRules']();return _0x4c04ef?.[_0x37921b]?.[0x0];}async['registerHook'](_0x3cb16e){if(this['config']['hook']?.['topic'])return await this['engine']['taskService']['registerWebHook'](this['config']['hook']['topic'],this['context'],this['resolveDad'](),this['context']['metadata']['expire'],_0x3cb16e);else{if(this['config']['sleep']){const _0x4c20b3=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',_0x4c20b3,this['metadata']['dad']||''),this['context']['metadata']['jid'];}}}async['processWebHookEvent'](_0x69c60f=stream_1['StreamStatus']['SUCCESS'],_0x22d943=0xc8){this['logger']['debug']('hook-process-web-hook-event',{'topic':this['config']['hook']['topic'],'aid':this['metadata']['aid'],'status':_0x69c60f,'code':_0x22d943});const _0x1a214a=new task_1['TaskService'](this['store'],this['logger']),_0x4bf067={...this['data']},_0x5d165f=await _0x1a214a['processWebHookSignal'](this['config']['hook']['topic'],_0x4bf067);if(_0x5d165f){const [_0x5ad1eb,_0x48ffb2,_0x358503,_0x1e9223]=_0x5d165f;this['context']['metadata']['jid']=_0x5ad1eb,this['context']['metadata']['gid']=_0x1e9223,this['context']['metadata']['dad']=_0x358503,await this['processEvent'](_0x69c60f,_0x22d943,'hook'),_0x22d943===0xc8&&await _0x1a214a['deleteWebHookSignal'](this['config']['hook']['topic'],_0x4bf067);}}async['processTimeHookEvent'](_0xf7d220){this['logger']['debug']('hook-process-time-hook-event',{'jid':_0xf7d220,'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']}),await this['processEvent'](stream_1['StreamStatus']['SUCCESS'],0xc8,'hook');}}function _0x1612(_0x14fdc3,_0x44c566){const _0x1ac24c=_0x1ac2();return _0x1612=function(_0x1612b1,_0x118632){_0x1612b1=_0x1612b1-0xe1;let _0x37a396=_0x1ac24c[_0x1612b1];return _0x37a396;},_0x1612(_0x14fdc3,_0x44c566);}exports['Hook']=Hook;function _0x1ac2(){const _0x49e21a=['14fJfWCQ','84LQKUJE','8861360HMszxM','4456176WWYRlY','4533957bHeHqu','137893BiFGTW','11721txgQQp','155ETAHPp','101468WeqvZU','945025ZzQuER'];_0x1ac2=function(){return _0x49e21a;};return _0x1ac2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0xfe6eef,_0xc5729c){const _0x40f861=_0x49a2,_0x735b27=_0xfe6eef();while(!![]){try{const _0x5d0276=-parseInt(_0x40f861(0x104))/0x1+-parseInt(_0x40f861(0x100))/0x2*(parseInt(_0x40f861(0xff))/0x3)+parseInt(_0x40f861(0x107))/0x4*(-parseInt(_0x40f861(0x103))/0x5)+parseInt(_0x40f861(0x106))/0x6*(-parseInt(_0x40f861(0xfe))/0x7)+parseInt(_0x40f861(0x101))/0x8+parseInt(_0x40f861(0x102))/0x9+parseInt(_0x40f861(0x105))/0xa;if(_0x5d0276===_0xc5729c)break;else _0x735b27['push'](_0x735b27['shift']());}catch(_0x243d80){_0x735b27['push'](_0x735b27['shift']());}}}(_0x297e,0x3d1f5));function _0x49a2(_0x3382af,_0x5becd1){const _0x297e85=_0x297e();return _0x49a2=function(_0x49a268,_0x4f6956){_0x49a268=_0x49a268-0xfe;let _0x4b3ab8=_0x297e85[_0x49a268];return _0x4b3ab8;},_0x49a2(_0x3382af,_0x5becd1);}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');function _0x297e(){const _0x2c7368=['4420830RnnuKF','930192GKPSPE','2848UqYldt','21wzomWU','58227mLSoQK','22mITXMz','3991272qNREwq','4439880alYnJK','1175jwmnud','338040KNTnaJ'];_0x297e=function(){return _0x2c7368;};return _0x297e();}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']};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x3be059,_0x2257c5){const _0x215231=_0x4f24,_0x302bce=_0x3be059();while(!![]){try{const _0x2e1c73=parseInt(_0x215231(0x1dd))/0x1*(-parseInt(_0x215231(0x1e6))/0x2)+-parseInt(_0x215231(0x1e3))/0x3+parseInt(_0x215231(0x1e4))/0x4+-parseInt(_0x215231(0x1e0))/0x5*(-parseInt(_0x215231(0x1df))/0x6)+parseInt(_0x215231(0x1de))/0x7*(-parseInt(_0x215231(0x1e1))/0x8)+parseInt(_0x215231(0x1e5))/0x9+parseInt(_0x215231(0x1e2))/0xa;if(_0x2e1c73===_0x2257c5)break;else _0x302bce['push'](_0x302bce['shift']());}catch(_0x5da3ba){_0x302bce['push'](_0x302bce['shift']());}}}(_0x5503,0x27fe1));function _0x4f24(_0x2b81a4,_0x1bc2ea){const _0x5503fa=_0x5503();return _0x4f24=function(_0x4f2406,_0x4f9b40){_0x4f2406=_0x4f2406-0x1dd;let _0x2c9ec6=_0x5503fa[_0x4f2406];return _0x2c9ec6;},_0x4f24(_0x2b81a4,_0x1bc2ea);}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');class Interrupt extends activity_1['Activity']{constructor(_0x38c453,_0x295a5e,_0x5ca630,_0x4b456c,_0xfc63c2,_0x6224e5){super(_0x38c453,_0x295a5e,_0x5ca630,_0x4b456c,_0xfc63c2,_0x6224e5);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0xa45110;try{await this['verifyEntry'](),_0xa45110=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0xa45110['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0xa45110):await this['interruptAnother'](_0xa45110);}catch(_0x3b921d){if(_0x3b921d instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0x3b921d});return;}else{if(_0x3b921d instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x3b921d});return;}else{if(_0x3b921d instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0x3b921d});return;}else{if(_0x3b921d instanceof errors_1['CollationError']){if(_0x3b921d['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',{..._0x3b921d});}else this['logger']['error']('interrupt-process-error',{..._0x3b921d});}}}_0xa45110?.['setActivityError'](_0x3b921d['message']);throw _0x3b921d;}finally{_0xa45110?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x4aca55){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x10d0ce=await this['interrupt']();_0x4aca55['mapActivityAttributes']();const _0xfad151=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0xfad151),await this['setStatus'](-0x1,_0xfad151);const _0xfd71d9=await _0xfad151['exec'](),_0x2f281a=this['resolveStatus'](_0xfd71d9);return _0x4aca55['setActivityAttributes']({'app.activity.mid':_0x10d0ce,'app.job.jss':_0x2f281a}),this['context']['metadata']['aid'];}async['interruptAnother'](_0x2e5f40){const _0x219099=await this['interrupt'](),_0x1e79eb={'app.activity.mid':_0x219099};_0x2e5f40['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x4f610d=this['store']['transact']();await this['setState'](_0x4f610d);}const _0xd8f87f=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0xd8f87f),await this['setStatus'](this['adjacencyList']['length']-0x1,_0xd8f87f);const _0x2c9044=await _0xd8f87f['exec'](),_0x18a224=this['resolveStatus'](_0x2c9044);_0x1e79eb['app.job.jss']=_0x18a224;const _0x348da5=await this['transition'](this['adjacencyList'],_0x18a224);return _0x348da5['length']&&(_0x1e79eb['app.activity.mids']=_0x348da5['join'](',')),_0x2e5f40['setActivityAttributes'](_0x1e79eb),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0x358f3d=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0x358f3d==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 _0x33e7b0=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'],_0x33e7b0);}}function _0x5503(){const _0x23e4a3=['738858Uusvaz','47600rnMuFP','97668VtVEjv','594AbbyaY','347qPkgBh','2149LcVYAy','306kFlHsM','16085ZLsJpa','1488sdXrfu','3834370IPBpzn'];_0x5503=function(){return _0x23e4a3;};return _0x5503();}exports['Interrupt']=Interrupt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x5df3c1,_0x4010ce){const _0x493462=_0x4eba,_0x2d5a78=_0x5df3c1();while(!![]){try{const _0x1d11d9=parseInt(_0x493462(0xd8))/0x1+-parseInt(_0x493462(0xd4))/0x2*(parseInt(_0x493462(0xd3))/0x3)+-parseInt(_0x493462(0xd7))/0x4+parseInt(_0x493462(0xdc))/0x5*(parseInt(_0x493462(0xdd))/0x6)+parseInt(_0x493462(0xd9))/0x7*(parseInt(_0x493462(0xd6))/0x8)+parseInt(_0x493462(0xdb))/0x9+-parseInt(_0x493462(0xda))/0xa*(parseInt(_0x493462(0xd5))/0xb);if(_0x1d11d9===_0x4010ce)break;else _0x2d5a78['push'](_0x2d5a78['shift']());}catch(_0x5ba8cb){_0x2d5a78['push'](_0x2d5a78['shift']());}}}(_0x40d0,0xab992));function _0x4eba(_0x226372,_0x4d5b28){const _0x40d006=_0x40d0();return _0x4eba=function(_0x4eba2d,_0x460505){_0x4eba2d=_0x4eba2d-0xd3;let _0x52b920=_0x40d006[_0x4eba2d];return _0x52b920;},_0x4eba(_0x226372,_0x4d5b28);}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');function _0x40d0(){const _0x203bcc=['539058nzTUxK','11522GVUaYm','30JzUuBA','701397larQur','85MggTOS','328974wRknsL','1603191yznzlr','2cUFzso','428615UNYLNp','4920hjYlxc','4828864DxGCrL'];_0x40d0=function(){return _0x203bcc;};return _0x40d0();}class Signal extends activity_1['Activity']{constructor(_0x4980b4,_0x4d027a,_0x54fc11,_0x36dca9,_0x3f6fe7,_0x15bae4){super(_0x4980b4,_0x4d027a,_0x54fc11,_0x36dca9,_0x3f6fe7,_0x15bae4);}async['process'](){this['logger']['debug']('signal-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x20643c;try{await this['verifyEntry'](),_0x20643c=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x20643c['startActivitySpan'](this['leg']);const _0x2032ec=this['store']['transact']();this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x2032ec),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x2032ec),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x2032ec);const _0x251289=await _0x2032ec['exec']();this['config']['subtype']==='all'?await this['hookAll']():await this['hookOne']();const _0x3f20af=this['resolveStatus'](_0x251289),_0x1b63c4={'app.job.jss':_0x3f20af},_0x138664=await this['transition'](this['adjacencyList'],_0x3f20af);return _0x138664['length']&&(_0x1b63c4['app.activity.mids']=_0x138664['join'](',')),_0x20643c['mapActivityAttributes'](),_0x20643c['setActivityAttributes'](_0x1b63c4),this['context']['metadata']['aid'];}catch(_0x34efe9){if(_0x34efe9 instanceof errors_1['InactiveJobError']){this['logger']['error']('signal-inactive-job-error',{..._0x34efe9});return;}else{if(_0x34efe9 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x34efe9});return;}else{if(_0x34efe9 instanceof errors_1['GetStateError']){this['logger']['error']('signal-get-state-error',{..._0x34efe9});return;}else{if(_0x34efe9 instanceof errors_1['CollationError']){if(_0x34efe9['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',{..._0x34efe9});}else this['logger']['error']('signal-process-error',{..._0x34efe9});}}}_0x20643c?.['setActivityError'](_0x34efe9['message']);throw _0x34efe9;}finally{_0x20643c?.['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 _0x4494f9=new mapper_1['MapperService'](this['config']['signal']['maps'],this['context']);return _0x4494f9['mapRules']();}}['mapResolverData'](){if(this['config']['resolver']?.['maps']){const _0x8328f=new mapper_1['MapperService'](this['config']['resolver']['maps'],this['context']);return _0x8328f['mapRules']();}}async['hookOne'](){const _0x39b0d6=pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']),_0x3c1e3c=this['mapSignalData'](),_0x4fba78=pipe_1['Pipe']['resolve'](this['config']['status'],this['context']),_0x542d8b=pipe_1['Pipe']['resolve'](this['config']['code'],this['context']);return await this['engine']['hook'](_0x39b0d6,_0x3c1e3c,_0x4fba78,_0x542d8b);}async['hookAll'](){const _0x403f7d=this['mapSignalData'](),_0x1863ec=this['mapResolverData']();this['config']['scrub']&&(_0x1863ec['scrub']=!![]);const _0x29a0f8=pipe_1['Pipe']['resolve'](this['config']['key_name'],this['context']),_0x412d09=pipe_1['Pipe']['resolve'](this['config']['key_value'],this['context']),_0x206cc9=[_0x29a0f8+':'+_0x412d09];return await this['engine']['hookAll'](this['config']['topic'],_0x403f7d,_0x1863ec,_0x206cc9);}}exports['Signal']=Signal;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EngineService } from '../engine';
|
|
2
2
|
import { ActivityData, ActivityMetadata, ActivityType, TriggerActivity } from '../../types/activity';
|
|
3
3
|
import { JobState, ExtensionType, JobStatus } from '../../types/job';
|
|
4
|
-
import {
|
|
4
|
+
import { ProviderTransaction } from '../../types/provider';
|
|
5
5
|
import { StringScalarType } from '../../types/serializer';
|
|
6
6
|
import { Activity } from './activity';
|
|
7
7
|
declare class Trigger extends Activity {
|
|
@@ -10,7 +10,7 @@ declare class Trigger extends Activity {
|
|
|
10
10
|
process(options?: ExtensionType): Promise<string>;
|
|
11
11
|
transitionAndLogAdjacent(options: ExtensionType, jobStatus: JobStatus, attrs: StringScalarType): Promise<void>;
|
|
12
12
|
initStatus(options: ExtensionType, count: number): number;
|
|
13
|
-
setExpired(seconds: number,
|
|
13
|
+
setExpired(seconds: number, transaction: ProviderTransaction): Promise<void>;
|
|
14
14
|
safeKey(key: string): string;
|
|
15
15
|
bindSearchData(options?: ExtensionType): void;
|
|
16
16
|
bindMarkerData(options?: ExtensionType): void;
|
|
@@ -25,6 +25,6 @@ declare class Trigger extends Activity {
|
|
|
25
25
|
resolveJobId(context: Partial<JobState>): string;
|
|
26
26
|
resolveJobKey(context: Partial<JobState>): string;
|
|
27
27
|
setStateNX(status?: number): Promise<void>;
|
|
28
|
-
setStats(
|
|
28
|
+
setStats(transaction?: ProviderTransaction): Promise<void>;
|
|
29
29
|
}
|
|
30
30
|
export { Trigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x34ab9b,_0x362ac9){const _0xfb54c5=_0x4cfe,_0x29ba64=_0x34ab9b();while(!![]){try{const _0x597389=parseInt(_0xfb54c5(0x74))/0x1+-parseInt(_0xfb54c5(0x6e))/0x2+-parseInt(_0xfb54c5(0x6d))/0x3+-parseInt(_0xfb54c5(0x6f))/0x4*(parseInt(_0xfb54c5(0x71))/0x5)+-parseInt(_0xfb54c5(0x73))/0x6+-parseInt(_0xfb54c5(0x70))/0x7+parseInt(_0xfb54c5(0x72))/0x8*(parseInt(_0xfb54c5(0x75))/0x9);if(_0x597389===_0x362ac9)break;else _0x29ba64['push'](_0x29ba64['shift']());}catch(_0x5e56ab){_0x29ba64['push'](_0x29ba64['shift']());}}}(_0xb01e,0x2c966));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Trigger']=void 0x0;function _0xb01e(){const _0x57e3ff=['3616qDZrKz','2171382uSqFwk','245071oXgdzQ','20538oKzybG','802917YrHTzm','221524jVAhzI','549212MmTJSx','553007rwqzXZ','10sxYpUJ'];_0xb01e=function(){return _0x57e3ff;};return _0xb01e();}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');function _0x4cfe(_0x1b8a1c,_0x2cf1e2){const _0xb01e61=_0xb01e();return _0x4cfe=function(_0x4cfe19,_0x45f289){_0x4cfe19=_0x4cfe19-0x6d;let _0xa579d4=_0xb01e61[_0x4cfe19];return _0xa579d4;},_0x4cfe(_0x1b8a1c,_0x2cf1e2);}class Trigger extends activity_1['Activity']{constructor(_0x50b575,_0x419869,_0x1f378d,_0x266c1d,_0x2ea667,_0x4ab37a){super(_0x50b575,_0x419869,_0x1f378d,_0x266c1d,_0x2ea667,_0x4ab37a);}async['process'](_0x392b67){this['logger']['debug']('trigger-process',{'subscribes':this['config']['subscribes']});let _0xf9629;try{this['setLeg'](0x2),await this['getState'](),_0xf9629=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0xf9629['startJobSpan'](),_0xf9629['startActivitySpan'](this['leg']),this['mapJobData'](),this['adjacencyList']=await this['filterAdjacent']();const _0x5129cb=this['initStatus'](_0x392b67,this['adjacencyList']['length']);await this['setStateNX'](_0x5129cb),await this['setStatus'](_0x5129cb),this['bindSearchData'](_0x392b67),this['bindMarkerData'](_0x392b67);const _0xe7f62f=this['store']['transact']();await this['setState'](_0xe7f62f),await this['setStats'](_0xe7f62f);_0x392b67?.['pending']&&await this['setExpired'](_0x392b67?.['pending'],_0xe7f62f);await collator_1['CollatorService']['notarizeInception'](this,this['context']['metadata']['guid'],_0xe7f62f),await _0xe7f62f['exec'](),this['execAdjacentParent'](),_0xf9629['mapActivityAttributes']();const _0x4ba21a=Number(this['context']['metadata']['js']);_0xf9629['setJobAttributes']({'app.job.jss':_0x4ba21a});const _0x1939d5={'app.job.jss':_0x4ba21a};return await this['transitionAndLogAdjacent'](_0x392b67,_0x4ba21a,_0x1939d5),_0xf9629['setActivityAttributes'](_0x1939d5),this['context']['metadata']['jid'];}catch(_0xa04992){_0xf9629?.['setActivityError'](_0xa04992['message']);if(_0xa04992 instanceof errors_1['DuplicateJobError']){await(0x0,utils_1['sleepFor'])(0x3e8);const _0x5758d6=await collator_1['CollatorService']['isInceptionOverage'](this,this['context']['metadata']['guid']);if(_0x5758d6){this['logger']['info']('trigger-collation-overage',{'job_id':_0xa04992['jobId'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('duplicate-job-error',{'job_id':_0xa04992['jobId'],'guid':this['context']['metadata']['guid']});}else this['logger']['error']('trigger-process-error',{..._0xa04992});throw _0xa04992;}finally{_0xf9629?.['endJobSpan'](),_0xf9629?.['endActivitySpan'](),this['logger']['debug']('trigger-process-end',{'subscribes':this['config']['subscribes'],'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid']});}}async['transitionAndLogAdjacent'](_0x187a38={},_0xf6d2a4,_0x2d0e7d){if(isNaN(_0x187a38['pending'])){const _0x3c6ad3=await this['transition'](this['adjacencyList'],_0xf6d2a4);_0x3c6ad3['length']&&(_0x2d0e7d['app.activity.mids']=_0x3c6ad3['join'](','));}}['initStatus'](_0x48ce77={},_0x4dae78){if(_0x48ce77['pending'])return-0x1;return _0x4dae78;}async['setExpired'](_0x35f941,_0x11af41){await this['store']['expireJob'](this['context']['metadata']['jid'],_0x35f941,_0x11af41);}['safeKey'](_0x18929e){return'_'+_0x18929e;}['bindSearchData'](_0x45a457){_0x45a457?.['search']&&Object['keys'](_0x45a457['search'])['forEach'](_0x1b1cb1=>{this['context']['data'][this['safeKey'](_0x1b1cb1)]=_0x45a457['search'][_0x1b1cb1]['toString']();});}['bindMarkerData'](_0x4658ef){_0x4658ef?.['marker']&&Object['keys'](_0x4658ef['marker'])['forEach'](_0x37a497=>{_0x37a497['startsWith']('-')&&(this['context']['data'][_0x37a497]=_0x4658ef['marker'][_0x37a497]['toString']());});}async['setStatus'](_0x12068d){this['context']['metadata']['js']=_0x12068d;}async['execAdjacentParent'](){if(this['context']['metadata']['px']){const _0x5f44ce=(0x0,utils_1['formatISODate'])(new Date()),_0x26692f={'metadata':this['context']['metadata'],'data':{'job_id':this['context']['metadata']['jid'],'jc':_0x5f44ce,'ju':_0x5f44ce}};await this['engine']['execAdjacentParent'](this['context'],_0x26692f);}}['createInputContext'](){const _0x5354f6={[this['metadata']['aid']]:{'input':{'data':this['data']}},'$self':{'input':{'data':this['data']},'output':{'data':this['data']}}};return _0x5354f6;}async['getState'](){const _0x89de77=this['createInputContext'](),_0x5729cf=this['resolveJobId'](_0x89de77),_0x25113e=this['resolveJobKey'](_0x89de77),_0x36edfe=(0x0,utils_1['formatISODate'])(new Date()),{id:_0x5d72e1,version:_0x17ff3a}=await this['engine']['getVID']();this['initDimensionalAddress'](collator_1['CollatorService']['getDimensionalSeed']());const _0x21e745={...this['metadata'],'jid':_0x5729cf,'key':_0x25113e,'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':_0x5d72e1,'vrs':_0x17ff3a,'tpc':this['config']['subscribes'],'trc':this['context']['metadata']['trc'],'spn':this['context']['metadata']['spn'],'guid':this['context']['metadata']['guid'],'jid':_0x5729cf,'dad':collator_1['CollatorService']['getDimensionalSeed'](),'key':_0x25113e,'jc':_0x36edfe,'ju':_0x36edfe,'ts':(0x0,utils_1['getTimeSeries'])(this['resolveGranularity']()),'js':0x0},'data':{},[this['metadata']['aid']]:{'input':{'data':this['data'],'metadata':_0x21e745},'output':{'data':this['data'],'metadata':_0x21e745},'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'](_0x59266a=>'metadata/'+_0x59266a);}['bindActivityMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['ACTIVITY']['KEYS']['map'](_0x792acd=>'output/metadata/'+_0x792acd);}['resolveGranularity'](){return this['config']['stats']?.['granularity']||reporter_1['ReporterService']['DEFAULT_GRANULARITY'];}['getJobStatus'](){return this['context']['metadata']['js'];}['resolveJobId'](_0x7a467e){const _0x209ec0=this['config']['stats']?.['id'];return _0x209ec0?pipe_1['Pipe']['resolve'](_0x209ec0,_0x7a467e):(0x0,utils_1['guid'])();}['resolveJobKey'](_0x257883){const _0x4f9096=this['config']['stats']?.['key'];return _0x4f9096?pipe_1['Pipe']['resolve'](_0x4f9096,_0x257883):'';}async['setStateNX'](_0x233dd1){const _0x26cb60=this['context']['metadata']['jid'];if(!await this['store']['setStateNX'](_0x26cb60,this['engine']['appId'],_0x233dd1))throw new errors_1['DuplicateJobError'](_0x26cb60);}async['setStats'](_0x577317){const _0x509fd4=this['context']['metadata'];if(_0x509fd4['key']&&this['config']['stats']?.['measures']){const _0xb179e0=await this['engine']['getVID'](),_0xef49=new reporter_1['ReporterService'](_0xb179e0,this['store'],this['logger']);await this['store']['setStats'](_0x509fd4['key'],_0x509fd4['jid'],_0x509fd4['ts'],_0xef49['resolveTriggerStatistics'](this['config'],this['context']),_0xb179e0,_0x577317);}}}exports['Trigger']=Trigger;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EngineService } from '../engine';
|
|
2
2
|
import { ActivityData, ActivityMetadata, ActivityType, WorkerActivity } from '../../types/activity';
|
|
3
3
|
import { JobState } from '../../types/job';
|
|
4
|
-
import {
|
|
4
|
+
import { ProviderTransaction } from '../../types/provider';
|
|
5
5
|
import { Activity } from './activity';
|
|
6
6
|
declare class Worker extends Activity {
|
|
7
7
|
config: WorkerActivity;
|
|
8
8
|
constructor(config: ActivityType, data: ActivityData, metadata: ActivityMetadata, hook: ActivityData | null, engine: EngineService, context?: JobState);
|
|
9
9
|
process(): Promise<string>;
|
|
10
|
-
execActivity(
|
|
10
|
+
execActivity(transaction: ProviderTransaction): Promise<string>;
|
|
11
11
|
}
|
|
12
12
|
export { Worker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x1f1033,_0x310a5a){const _0x3d0e1a=_0xa6d1,_0x2ba0cb=_0x1f1033();while(!![]){try{const _0x3e74d6=-parseInt(_0x3d0e1a(0x1db))/0x1+parseInt(_0x3d0e1a(0x1da))/0x2+parseInt(_0x3d0e1a(0x1de))/0x3+parseInt(_0x3d0e1a(0x1d9))/0x4+-parseInt(_0x3d0e1a(0x1dd))/0x5*(parseInt(_0x3d0e1a(0x1d7))/0x6)+-parseInt(_0x3d0e1a(0x1e0))/0x7*(parseInt(_0x3d0e1a(0x1d8))/0x8)+parseInt(_0x3d0e1a(0x1dc))/0x9*(parseInt(_0x3d0e1a(0x1df))/0xa);if(_0x3e74d6===_0x310a5a)break;else _0x2ba0cb['push'](_0x2ba0cb['shift']());}catch(_0x149be4){_0x2ba0cb['push'](_0x2ba0cb['shift']());}}}(_0x860b,0xa3b86));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 _0x860b(){const _0x421c36=['90SMIjlk','313505glqFLh','2300712OFaQEm','1332050kPWvTu','3403862EQGYBd','18gmQJux','8rcGTTl','738316Gksabj','708278kZnmoK','1292705OWmkGx'];_0x860b=function(){return _0x421c36;};return _0x860b();}class Worker extends activity_1['Activity']{constructor(_0x4fa4d4,_0x2c2ce3,_0x3b3e99,_0x493f53,_0x309444,_0x3ca6d9){super(_0x4fa4d4,_0x2c2ce3,_0x3b3e99,_0x493f53,_0x309444,_0x3ca6d9);}async['process'](){this['logger']['debug']('worker-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x46d391;try{await this['verifyEntry'](),_0x46d391=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x46d391['startActivitySpan'](this['leg']),this['mapInputData']();const _0x2d7ca6=this['store']['transact'](),_0x272c11=await this['execActivity'](_0x2d7ca6);await collator_1['CollatorService']['authorizeReentry'](this,_0x2d7ca6),await this['setState'](_0x2d7ca6),await this['setStatus'](0x0,_0x2d7ca6);const _0x2a6085=await _0x2d7ca6['exec']();_0x46d391['mapActivityAttributes']();const _0x39138e=this['resolveStatus'](_0x2a6085);return _0x46d391['setActivityAttributes']({'app.activity.mid':_0x272c11,'app.job.jss':_0x39138e}),this['context']['metadata']['aid'];}catch(_0x430e2b){if(_0x430e2b instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x430e2b});return;}else{if(_0x430e2b instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x430e2b});return;}else{if(_0x430e2b instanceof errors_1['GetStateError']){this['logger']['error']('worker-get-state-error',{..._0x430e2b});return;}else{if(_0x430e2b instanceof errors_1['CollationError']){if(_0x430e2b['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',{..._0x430e2b});}else this['logger']['error']('worker-process-error',{..._0x430e2b});}}}_0x46d391?.['setActivityError'](_0x430e2b['message']);throw _0x430e2b;}finally{_0x46d391?.['endActivitySpan'](),this['logger']['debug']('worker-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x571c25){const _0x51b359=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x8c84fd={'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':_0x51b359,'spn':this['context']['$self']['output']['metadata']['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context']['data']};return this['config']['retry']&&(_0x8c84fd['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](_0x51b359,_0x8c84fd,_0x571c25);}}function _0xa6d1(_0x4ffde2,_0x4f7961){const _0x860b20=_0x860b();return _0xa6d1=function(_0xa6d1cc,_0x166792){_0xa6d1cc=_0xa6d1cc-0x1d7;let _0xf8e675=_0x860b20[_0xa6d1cc];return _0xf8e675;},_0xa6d1(_0x4ffde2,_0x4f7961);}exports['Worker']=Worker;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RedisMulti } from '../../types/redis';
|
|
2
1
|
import { CollationStage } from '../../types/collator';
|
|
3
2
|
import { ActivityDuplex } from '../../types/activity';
|
|
4
3
|
import { HotMeshGraph } from '../../types/hotmesh';
|
|
4
|
+
import { ProviderTransaction } from '../../types/provider';
|
|
5
5
|
import { Activity } from '../activities/activity';
|
|
6
6
|
import { Cycle } from '../activities/cycle';
|
|
7
7
|
declare class CollatorService {
|
|
@@ -9,15 +9,15 @@ declare class CollatorService {
|
|
|
9
9
|
static assertJobActive(status: number, jobId: string, activityId: string, threshold?: number): void;
|
|
10
10
|
static getDimensionalAddress(activity: Activity, isEntry?: boolean): Record<string, string>;
|
|
11
11
|
static resolveReentryDimension(activity: Cycle): string;
|
|
12
|
-
static notarizeEntry(activity: Activity,
|
|
13
|
-
static authorizeReentry(activity: Activity,
|
|
14
|
-
static notarizeEarlyExit(activity: Activity,
|
|
15
|
-
static notarizeEarlyCompletion(activity: Activity,
|
|
16
|
-
static notarizeInception(activity: Activity, guid: string,
|
|
12
|
+
static notarizeEntry(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
13
|
+
static authorizeReentry(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
14
|
+
static notarizeEarlyExit(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
15
|
+
static notarizeEarlyCompletion(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
16
|
+
static notarizeInception(activity: Activity, guid: string, transaction: ProviderTransaction): Promise<void>;
|
|
17
17
|
static isInceptionOverage(activity: Activity, guid: string): Promise<boolean>;
|
|
18
|
-
static notarizeReentry(activity: Activity, guid: string,
|
|
19
|
-
static notarizeContinuation(activity: Activity,
|
|
20
|
-
static notarizeCompletion(activity: Activity,
|
|
18
|
+
static notarizeReentry(activity: Activity, guid: string, transaction?: ProviderTransaction): Promise<number>;
|
|
19
|
+
static notarizeContinuation(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
20
|
+
static notarizeCompletion(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
21
21
|
static getDigitAtIndex(num: number, targetDigitIndex: number): number | null;
|
|
22
22
|
static getDimensionalIndex(num: number): number | null;
|
|
23
23
|
static isDuplicate(num: number, targetDigitIndex: number): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x5122d0,_0x4d0fa6){const _0x1b8e6b=_0xc950,_0x5055cf=_0x5122d0();while(!![]){try{const _0x4617a6=-parseInt(_0x1b8e6b(0x16d))/0x1+-parseInt(_0x1b8e6b(0x164))/0x2*(parseInt(_0x1b8e6b(0x169))/0x3)+-parseInt(_0x1b8e6b(0x163))/0x4*(parseInt(_0x1b8e6b(0x16b))/0x5)+-parseInt(_0x1b8e6b(0x16a))/0x6*(-parseInt(_0x1b8e6b(0x16c))/0x7)+-parseInt(_0x1b8e6b(0x165))/0x8+parseInt(_0x1b8e6b(0x168))/0x9*(parseInt(_0x1b8e6b(0x167))/0xa)+parseInt(_0x1b8e6b(0x166))/0xb;if(_0x4617a6===_0x4d0fa6)break;else _0x5055cf['push'](_0x5055cf['shift']());}catch(_0xf205f){_0x5055cf['push'](_0x5055cf['shift']());}}}(_0x319b,0x52183));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CollatorService']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../../types/collator');class CollatorService{static['assertJobActive'](_0x2fa690,_0x31790b,_0x5e670f,_0x215cc4=0x0){if(_0x2fa690<=_0x215cc4)throw new errors_1['InactiveJobError'](_0x31790b,_0x2fa690,_0x5e670f);}static['getDimensionalAddress'](_0x426620,_0x12c524=![]){let _0x2442a6=_0x426620['context']['metadata']['dad']||_0x426620['metadata']['dad'];return _0x12c524&&_0x2442a6&&_0x426620['leg']===0x2&&(_0x2442a6=_0x2442a6['substring'](0x0,_0x2442a6['lastIndexOf'](','))+',0'),CollatorService['getDimensionsById']([..._0x426620['config']['ancestors'],_0x426620['metadata']['aid']],_0x2442a6);}static['resolveReentryDimension'](_0x300592){const _0x459f0f=_0x300592['config']['ancestor'],_0x235ada=_0x300592['config']['ancestors'],_0x21b3e7=_0x235ada['indexOf'](_0x459f0f),_0x45ec97=_0x300592['metadata']['dad']['split'](',');return _0x45ec97['length']=_0x21b3e7+0x1,_0x45ec97['push']('0'),_0x45ec97['join'](',');}static async['notarizeEntry'](_0x4494b7,_0x44a854){const _0xbc219c=await _0x4494b7['store']['collate'](_0x4494b7['context']['metadata']['jid'],_0x4494b7['metadata']['aid'],-0x5af3107a4000,this['getDimensionalAddress'](_0x4494b7),_0x44a854);return this['verifyInteger'](_0xbc219c,0x1,'enter'),_0xbc219c;}static async['authorizeReentry'](_0x3cf191,_0x33df1a){const _0x4a5744=await _0x3cf191['store']['collate'](_0x3cf191['context']['metadata']['jid'],_0x3cf191['metadata']['aid'],-0x9184e72a000,this['getDimensionalAddress'](_0x3cf191),_0x33df1a);return _0x4a5744;}static async['notarizeEarlyExit'](_0x9f5967,_0x3cbab4){return await _0x9f5967['store']['collate'](_0x9f5967['context']['metadata']['jid'],_0x9f5967['metadata']['aid'],-0xa012317b000,this['getDimensionalAddress'](_0x9f5967),_0x3cbab4);}static async['notarizeEarlyCompletion'](_0x3835aa,_0x5d1be5){const _0x572cd5=_0x3835aa['config']['cycle']?0x9184e72a000:0xa012317b000;return await _0x3835aa['store']['collate'](_0x3835aa['context']['metadata']['jid'],_0x3835aa['metadata']['aid'],0xf4241-_0x572cd5,this['getDimensionalAddress'](_0x3835aa),_0x5d1be5);}static async['notarizeInception'](_0x16875c,_0x16bf06,_0x6f13bb){_0x16bf06&&await _0x16875c['store']['collateSynthetic'](_0x16875c['context']['metadata']['jid'],_0x16bf06,0xf4240,_0x6f13bb);}static async['isInceptionOverage'](_0x5313a9,_0x5b020c){if(_0x5b020c){const _0x50b1f7=await _0x5313a9['store']['collateSynthetic'](_0x5313a9['context']['metadata']['jid'],_0x5b020c,0xf4240);return _0x50b1f7>0xf4240;}return![];}static async['notarizeReentry'](_0xb9e6d,_0xb7694f,_0x4f19ba){const _0x12e556=_0xb9e6d['context']['metadata']['jid'],_0x52d3eb=_0x4f19ba||_0xb9e6d['store']['transact']();await _0xb9e6d['store']['collate'](_0x12e556,_0xb9e6d['metadata']['aid'],0xf4240,this['getDimensionalAddress'](_0xb9e6d,!![]),_0x52d3eb),await _0xb9e6d['store']['collateSynthetic'](_0x12e556,_0xb7694f,0xf4240,_0x52d3eb);const [_0x16adf3,_0x539ab8]=await _0x52d3eb['exec'](),_0xfd5c45=Array['isArray'](_0x16adf3)?_0x16adf3[0x1]:_0x16adf3,_0x40a03d=Array['isArray'](_0x539ab8)?_0x539ab8[0x1]:_0x539ab8;return this['verifyInteger'](_0xfd5c45,0x2,'enter'),this['verifySyntheticInteger'](_0x40a03d),_0xfd5c45;}static async['notarizeContinuation'](_0x8c1c18,_0x5384a3){return await _0x8c1c18['store']['collate'](_0x8c1c18['context']['metadata']['jid'],_0x8c1c18['metadata']['aid'],0x1,this['getDimensionalAddress'](_0x8c1c18),_0x5384a3);}static async['notarizeCompletion'](_0x1396a3,_0x3dd9a4){const _0x79417b=_0x1396a3['config']['cycle']?0x0:0xe8d4a51000;return await _0x1396a3['store']['collate'](_0x1396a3['context']['metadata']['jid'],_0x1396a3['metadata']['aid'],0x1-_0x79417b,this['getDimensionalAddress'](_0x1396a3),_0x3dd9a4);}static['getDigitAtIndex'](_0x15a798,_0x31a0b2){const _0x5867b8=_0x15a798['toString']();if(_0x31a0b2<0x0||_0x31a0b2>=_0x5867b8['length'])return null;const _0xb967af=parseInt(_0x5867b8[_0x31a0b2],0xa);return _0xb967af;}static['getDimensionalIndex'](_0x23ed8e){const _0x1a5016=_0x23ed8e['toString']();if(_0x1a5016['length']<0x9)return null;const _0x14ff5a=_0x1a5016['substring'](0x3,0x9),_0x5d2cf8=parseInt(_0x14ff5a,0xa);return _0x5d2cf8-0x1;}static['isDuplicate'](_0x1d2007,_0xc3de4c){return this['getDigitAtIndex'](_0x1d2007,_0xc3de4c)<0x8;}static['isInactive'](_0x365575){return this['getDigitAtIndex'](_0x365575,0x2)<0x9;}static['isPrimed'](_0x3321b0,_0x28d1b7){return _0x28d1b7==0x1?_0x3321b0!=-0x5af3107a4000:this['getDigitAtIndex'](_0x3321b0,0x0)<0x9&&this['getDigitAtIndex'](_0x3321b0,0x1)<0x9;}static['verifySyntheticInteger'](_0x145a92){const _0x48576b=_0x145a92['toString'](),_0x10cadc=parseInt(_0x48576b[_0x48576b['length']-0x1],0xa);if(_0x10cadc>0x0)throw new errors_1['CollationError'](_0x145a92,0x2,'enter',collator_1['CollationFaultType']['INACTIVE']);else{if(_0x145a92>=0x1e8480)throw new errors_1['CollationError'](_0x145a92,0x2,'enter',collator_1['CollationFaultType']['DUPLICATE']);}}static['verifyInteger'](_0x54645f,_0x381871,_0x308831){let _0x30cb42;if(_0x381871===0x1&&_0x308831==='enter'){if(!this['isPrimed'](_0x54645f,0x1))_0x30cb42=collator_1['CollationFaultType']['MISSING'];else{if(this['isDuplicate'](_0x54645f,0x0))_0x30cb42=collator_1['CollationFaultType']['DUPLICATE'];else _0x54645f!=0x331a2bfa73000&&(_0x30cb42=collator_1['CollationFaultType']['INVALID']);}}else{if(_0x381871===0x1&&_0x308831==='exit'){if(_0x54645f===-0x9184e72a000)_0x30cb42=collator_1['CollationFaultType']['MISSING'];else this['isDuplicate'](_0x54645f,0x1)&&(_0x30cb42=collator_1['CollationFaultType']['DUPLICATE']);}else{if(_0x381871===0x2&&_0x308831==='enter'){if(!this['isPrimed'](_0x54645f,0x2))_0x30cb42=collator_1['CollationFaultType']['FORBIDDEN'];else this['isInactive'](_0x54645f)&&(_0x30cb42=collator_1['CollationFaultType']['INACTIVE']);}}}if(_0x30cb42)throw new errors_1['CollationError'](_0x54645f,_0x381871,_0x308831,_0x30cb42);}static['getDimensionsById'](_0x1f4b1,_0x2259c8){const _0x133e82={'$ADJACENT':_0x2259c8+',0'};let _0xcecccf=_0x2259c8;return _0x1f4b1['reverse']()['forEach'](_0x28ffe5=>{_0x133e82[_0x28ffe5]=_0xcecccf,_0xcecccf=_0xcecccf['substring'](0x0,_0xcecccf['lastIndexOf'](','));}),_0x133e82;}static['getSeed'](){return'999000000000000';}static['getTriggerSeed'](){return'888000001000001';}static['compile'](_0x13531a){CollatorService['bindAncestorArray'](_0x13531a);}static['bindAncestorArray'](_0x270f78){_0x270f78['forEach'](_0x1f7dcd=>{const _0x2ea1b0={},_0x16441f=Object['keys'](_0x1f7dcd['activities'])['find'](_0x35632a=>_0x1f7dcd['activities'][_0x35632a]['type']==='trigger');if(!_0x16441f)throw new Error('collator-trigger-activity-not-found');const _0x245b79=(_0x4f42e8,_0x243780)=>{_0x2ea1b0[_0x4f42e8]=_0x243780,_0x1f7dcd['activities'][_0x4f42e8]['ancestors']=_0x243780;const _0x401f4b=_0x1f7dcd['transitions']?.[_0x4f42e8]||[];_0x401f4b['forEach'](_0x5d4bb3=>{_0x245b79(_0x5d4bb3['to'],[..._0x243780,_0x4f42e8]);});};_0x245b79(_0x16441f,[]);});}static['getDimensionalSeed'](_0x22e83d=0x0){return','+_0x22e83d;}}function _0xc950(_0x3992da,_0x485101){const _0x319b3a=_0x319b();return _0xc950=function(_0xc950a2,_0x3cf688){_0xc950a2=_0xc950a2-0x163;let _0x63d774=_0x319b3a[_0xc950a2];return _0x63d774;},_0xc950(_0x3992da,_0x485101);}function _0x319b(){const _0x1d4bba=['21421169DtZEtk','1376750GaPrsz','9QmjCAO','309ofjOkC','6bwtLNq','95tgNNtT','438179OEIGUi','622423IzBjrU','103692UQGmdq','4010bbZENX','3919336tcJatR'];_0x319b=function(){return _0x1d4bba;};return _0x319b();}exports['CollatorService']=CollatorService,CollatorService['targetLength']=0xf;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { StoreService } from '../store';
|
|
2
2
|
import { HotMeshGraph, HotMeshManifest } from '../../types/hotmesh';
|
|
3
|
-
import {
|
|
3
|
+
import { ProviderClient, ProviderTransaction } from '../../types/provider';
|
|
4
4
|
import { Symbols } from '../../types/serializer';
|
|
5
5
|
import { StreamService } from '../stream';
|
|
6
6
|
declare class Deployer {
|
|
7
7
|
manifest: HotMeshManifest | null;
|
|
8
|
-
store: StoreService<
|
|
9
|
-
stream: StreamService<
|
|
8
|
+
store: StoreService<ProviderClient, ProviderTransaction> | null;
|
|
9
|
+
stream: StreamService<ProviderClient, ProviderTransaction> | null;
|
|
10
10
|
constructor(manifest: HotMeshManifest);
|
|
11
|
-
deploy(store: StoreService<
|
|
11
|
+
deploy(store: StoreService<ProviderClient, ProviderTransaction>, stream: StreamService<ProviderClient, ProviderTransaction>): Promise<void>;
|
|
12
12
|
getVID(): {
|
|
13
13
|
id: string;
|
|
14
14
|
version: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _0x3beb(){const _0xfe4acb=['921325VmmRpj','11392209mjcHpo','12DBvenF','947768HIBigc','33104929FBHGmp','394865Jzvbdt','2569406RLEZqq','3JCMHJj','2846514ESIBnU','35EOeKEt','10sGFSjD'];_0x3beb=function(){return _0xfe4acb;};return _0x3beb();}(function(_0x447d61,_0x3dc167){const _0x132e3b=_0x1384,_0x2459d4=_0x447d61();while(!![]){try{const _0x30a04c=-parseInt(_0x132e3b(0x9d))/0x1+parseInt(_0x132e3b(0x98))/0x2*(-parseInt(_0x132e3b(0x99))/0x3)+parseInt(_0x132e3b(0x9f))/0x4*(-parseInt(_0x132e3b(0xa2))/0x5)+-parseInt(_0x132e3b(0x9a))/0x6+parseInt(_0x132e3b(0x9b))/0x7*(-parseInt(_0x132e3b(0xa0))/0x8)+-parseInt(_0x132e3b(0x9e))/0x9*(-parseInt(_0x132e3b(0x9c))/0xa)+parseInt(_0x132e3b(0xa1))/0xb;if(_0x30a04c===_0x3dc167)break;else _0x2459d4['push'](_0x2459d4['shift']());}catch(_0x4212c1){_0x2459d4['push'](_0x2459d4['shift']());}}}(_0x3beb,0xbaeb3));function _0x1384(_0x4a47ec,_0x611cb1){const _0x3beb3d=_0x3beb();return _0x1384=function(_0x138419,_0x21ceae){_0x138419=_0x138419-0x98;let _0x3432ae=_0x3beb3d[_0x138419];return _0x3432ae;},_0x1384(_0x4a47ec,_0x611cb1);}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(_0x4e5c23){this['manifest']=null,this['manifest']=_0x4e5c23;}async['deploy'](_0xc5ee61,_0x5a1ffb){this['store']=_0xc5ee61,this['stream']=_0x5a1ffb,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 _0x323599 of this['manifest']['app']['graphs']){const [,_0x13256b]=this['findTrigger'](_0x323599),_0x3e1449=_0x13256b['subscribes'],[_0x2cf0cb,_0x576073,_0x508b72]=await this['store']['reserveSymbolRange']('$'+_0x3e1449,DEFAULT_RANGE_SIZE,'JOB'),_0x1ab800='',_0x17407a=this['bindSymbols'](_0x2cf0cb,_0x576073,_0x508b72,_0x1ab800,_0x13256b['PRODUCES']);Object['keys'](_0x17407a)['length']&&await this['store']['addSymbols']('$'+_0x3e1449,_0x17407a);for(const [_0x1ffcda,_0x33e3fa]of Object['entries'](_0x323599['activities'])){const [_0x25bcd9,_0x189e83,_0x16a50c]=await this['store']['reserveSymbolRange'](_0x1ffcda,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x39f9ce=_0x1ffcda+'/';this['bindSelf'](_0x33e3fa['consumes'],_0x33e3fa['produces'],_0x1ffcda);const _0x43dbd5=this['bindSymbols'](_0x25bcd9,_0x189e83,_0x16a50c,_0x39f9ce,_0x33e3fa['produces']);Object['keys'](_0x43dbd5)['length']&&await this['store']['addSymbols'](_0x1ffcda,_0x43dbd5);}}}['bindSelf'](_0x2985e0,_0x278122,_0x4b0eab){for(const _0x68e797 of[_0x4b0eab,'$self']){const _0xad7592=_0x2985e0[_0x68e797];if(_0xad7592)for(const _0x3d9e3f of _0xad7592){!_0x278122['includes'](_0x3d9e3f)&&_0x278122['push'](_0x3d9e3f);}}}['bindSymbols'](_0x51eed4,_0x31d6e7,_0x2deed8,_0x1de279,_0x4d3796){const _0x4743df={},_0x904b98={..._0x2deed8};for(const _0x2bf034 of _0x4d3796){const _0x19d6f3=''+_0x1de279+_0x2bf034;if(!_0x904b98[_0x19d6f3]){if(_0x51eed4>_0x31d6e7)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x5652d3=(0x0,utils_1['getSymKey'])(_0x51eed4);_0x51eed4++,_0x4743df[_0x19d6f3]=_0x5652d3,_0x904b98[_0x19d6f3]=_0x5652d3;}}return _0x4743df;}['copyJobSchemas'](){const _0x2a5dc5=this['manifest']['app']['graphs'];for(const _0x3e2935 of _0x2a5dc5){const _0x2f9669=_0x3e2935['output']?.['schema'],_0x99877f=_0x3e2935['input']?.['schema'];if(!_0x2f9669&&!_0x99877f)continue;const _0x1be577=_0x3e2935['activities'];for(const _0x428114 in _0x1be577){if(_0x1be577[_0x428114]['type']==='trigger'){const _0x46779d=_0x1be577[_0x428114];_0x2f9669&&(!_0x46779d['job']&&(_0x46779d['job']={}),_0x46779d['job']['schema']=_0x2f9669),_0x99877f&&(_0x46779d['output']={'schema':_0x99877f});}}}}['bindBackRefs'](){for(const _0x31d6e8 of this['manifest']['app']['graphs']){const _0x3344d3=_0x31d6e8['activities'],_0x166ae4=this['findTrigger'](_0x31d6e8)[0x0];for(const _0x14086d in _0x3344d3){_0x3344d3[_0x14086d]['trigger']=_0x166ae4,_0x3344d3[_0x14086d]['subscribes']=_0x31d6e8['subscribes'],_0x31d6e8['publishes']&&(_0x3344d3[_0x14086d]['publishes']=_0x31d6e8['publishes']),_0x3344d3[_0x14086d]['expire']=_0x31d6e8['expire']??undefined,_0x3344d3[_0x14086d]['persistent']=_0x31d6e8['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x4695f7 of this['manifest']['app']['graphs']){const _0x272c8f=_0x4695f7['activities'];for(const _0x202ec9 in _0x272c8f){const _0x2461be=_0x272c8f[_0x202ec9];_0x2461be['type']==='cycle'&&(_0x272c8f[_0x2461be['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x58988d of this['manifest']['app']['graphs']){const _0x405d44=_0x58988d['activities'];for(const _0x2c0ed5 in _0x405d44){const _0x33acaa=_0x405d44[_0x2c0ed5];['worker','await']['includes'](_0x33acaa['type'])&&_0x33acaa['topic']&&!_0x33acaa['subtype']&&(_0x33acaa['subtype']=_0x33acaa['topic']);}}}['convertActivitiesToHooks'](){for(const _0xabd160 of this['manifest']['app']['graphs']){const _0x536227=_0xabd160['activities'];for(const _0x35cd88 in _0x536227){const _0x400e84=_0x536227[_0x35cd88];['activity']['includes'](_0x400e84['type'])&&(_0x400e84['type']='hook');}}}async['bindParents'](){const _0x962d48=this['manifest']['app']['graphs'];for(const _0x54d136 of _0x962d48){if(_0x54d136['transitions'])for(const _0x1d0a43 in _0x54d136['transitions']){const _0x5b1cd9=_0x54d136['transitions'][_0x1d0a43];for(const _0x405022 of _0x5b1cd9){const _0x5b1717=_0x405022['to'];_0x54d136['activities'][_0x5b1717]['parent']=_0x1d0a43;}_0x54d136['activities'][_0x1d0a43]['transitions']=_0x5b1cd9;}}}['collectValues'](_0x4fa37c,_0x2166ad){for(const [_0x202f7e,_0x2c72c2]of Object['entries'](_0x4fa37c)){if(_0x202f7e==='enum'||_0x202f7e==='examples'||_0x202f7e==='default'){if(Array['isArray'](_0x2c72c2))for(const _0x12443d of _0x2c72c2){typeof _0x12443d==='string'&&_0x12443d['length']>0x5&&_0x2166ad['add'](_0x12443d);}else typeof _0x2c72c2==='string'&&_0x2c72c2['length']>0x5&&_0x2166ad['add'](_0x2c72c2);}else typeof _0x2c72c2==='object'&&this['collectValues'](_0x2c72c2,_0x2166ad);}}['traverse'](_0x18bee1,_0x496fdf){for(const _0x49ceec of Object['values'](_0x18bee1)){typeof _0x49ceec==='object'&&('schema'in _0x49ceec?this['collectValues'](_0x49ceec['schema'],_0x496fdf):this['traverse'](_0x49ceec,_0x496fdf));}}async['generateSymVals'](){const _0xa5ef56=new Set();for(const _0x7d4cb7 of this['manifest']['app']['graphs']){this['traverse'](_0x7d4cb7,_0xa5ef56);}const _0x49f68a=await this['store']['getSymbolValues'](),_0x9b826e=Object['keys'](_0x49f68a)['length'],_0x3db775=Math['pow'](0x34,0x2)-0x1,_0x6b4834=serializer_1['SerializerService']['filterSymVals'](_0x9b826e,_0x3db775,_0x49f68a,_0xa5ef56);await this['store']['addSymbolValues'](_0x6b4834);}['resolveJobMapsPaths'](){function _0x1ccd0f(_0x55bb32){const _0x5a22bb=[];function _0x55f42c(_0x531f08,_0x4087bf=[]){for(const _0x561d60 in _0x531f08){if(typeof _0x531f08[_0x561d60]==='object'&&_0x531f08[_0x561d60]!==null&&!('@pipe'in _0x531f08[_0x561d60])){const _0x37e082=[..._0x4087bf,_0x561d60];_0x55f42c(_0x531f08[_0x561d60],_0x37e082);}else{const _0x299009=[..._0x4087bf,_0x561d60]['join']('/');if(!_0x299009['includes']('[')){const _0x5a8038='data/'+_0x299009;!_0x5a22bb['includes'](_0x5a8038)&&_0x5a22bb['push'](_0x5a8038);}else{const [_0x575680,_0x2f0ccd]=_0x299009['split']('['),[_0x1fe2f1,_0x166169]=_0x2f0ccd['split'](']');if(!isNaN(parseInt(_0x1fe2f1)))for(let _0x4841a6=0x0;_0x4841a6<parseInt(_0x1fe2f1);_0x4841a6++){const _0x4bec11='data/'+_0x575680+'/'+_0x4841a6;!_0x5a22bb['includes'](_0x4bec11)&&_0x5a22bb['push'](_0x4bec11);}}}}}return _0x55bb32&&_0x55f42c(_0x55bb32),_0x5a22bb;}for(const _0x194ebf of this['manifest']['app']['graphs']){let _0x35b9aa=[];const [,_0x9dccb8]=this['findTrigger'](_0x194ebf);for(const _0x503533 in _0x194ebf['activities']){const _0x22dc08=_0x194ebf['activities'][_0x503533];_0x35b9aa=_0x35b9aa['concat'](_0x1ccd0f(_0x22dc08['job']?.['maps']));}_0x9dccb8['PRODUCES']=_0x35b9aa;}}['resolveMappingDependencies'](){const _0x120e77=[];function _0x29b634(_0x42f8c6,_0x3c4851){for(const _0xda40b2 in _0x42f8c6){if(typeof _0x42f8c6[_0xda40b2]==='string'){const _0x50471e=_0x42f8c6[_0xda40b2],_0x3ba168=_0x50471e['match'](/^\{[^@].*}$/);_0x3ba168&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x50471e)&&(_0x50471e['split']('.')[0x1]!=='input'&&(_0x120e77['push'](_0x50471e),_0x3c4851['push'](_0x50471e)));}else typeof _0x42f8c6[_0xda40b2]==='object'&&_0x42f8c6[_0xda40b2]!==null&&_0x29b634(_0x42f8c6[_0xda40b2],_0x3c4851);}}const _0x3fc407=this['manifest']['app']['graphs'];for(const _0x174076 of _0x3fc407){const _0x5aafe0=_0x174076['activities'];for(const _0x4a0c7a in _0x5aafe0){const _0x1f64b2=_0x5aafe0[_0x4a0c7a];_0x1f64b2['consumes']=[],_0x29b634(_0x1f64b2,_0x1f64b2['consumes']),_0x1f64b2['consumes']=this['groupMappingRules'](_0x1f64b2['consumes']);}}const _0xab847=this['groupMappingRules'](_0x120e77);for(const _0x46502c of _0x3fc407){const _0x227433=_0x46502c['activities'];for(const _0x512571 in _0x227433){const _0x400c9b=_0x227433[_0x512571];_0x400c9b['produces']=_0xab847[''+_0x512571]||[];}}}['groupMappingRules'](_0x32d068){_0x32d068=Array['from'](new Set(_0x32d068))['sort']();const _0x389ed8={};for(const _0x273605 of _0x32d068){const [_0x3349f6,_0x5e0488]=this['resolveMappableValue'](_0x273605);!_0x389ed8[_0x3349f6]&&(_0x389ed8[_0x3349f6]=[]),_0x389ed8[_0x3349f6]['push'](_0x5e0488);}return _0x389ed8;}['resolveMappableValue'](_0xbef3b8){_0xbef3b8=_0xbef3b8['substring'](0x1,_0xbef3b8['length']-0x1);const _0x3f77b5=_0xbef3b8['split']('.');if(_0x3f77b5[0x0]==='$job'){const [_0x18af00,..._0x2ab7c4]=_0x3f77b5;return[_0x18af00,_0x2ab7c4['join']('/')];}else{const [_0x1fa3a5,_0x2a43dc,_0x44c45a,..._0x4719a6]=_0x3f77b5,_0x5ec526={'hook':'hook/data','input':'input/data','output':_0x44c45a==='data'?'output/data':'output/metadata'}[_0x2a43dc];return[_0x1fa3a5,_0x5ec526+'/'+_0x4719a6['join']('/')];}}async['deployActivitySchemas'](){const _0x45e75d=this['manifest']['app']['graphs'],_0x3f289f={};for(const _0x4177c1 of _0x45e75d){const _0x56a263=_0x4177c1['activities'];for(const _0x153598 in _0x56a263){const _0x7e79ad=_0x56a263[_0x153598];delete _0x7e79ad['transitions'],_0x3f289f[_0x153598]=_0x7e79ad;}}await this['store']['setSchemas'](_0x3f289f,this['getVID']());}async['deploySubscriptions'](){const _0x9f9428=this['manifest']['app']['graphs'],_0x3b1f1d={};for(const _0x5f38e9 of _0x9f9428){const _0x80c887=_0x5f38e9['activities'],_0x121314=_0x5f38e9['subscribes'];for(const _0x26ecb9 in _0x80c887){if(_0x80c887[_0x26ecb9]['type']==='trigger'){_0x3b1f1d[_0x121314]=_0x26ecb9;break;}}}await this['store']['setSubscriptions'](_0x3b1f1d,this['getVID']());}['findTrigger'](_0x4032a9){for(const _0x366c5f in _0x4032a9['activities']){const _0x45e181=_0x4032a9['activities'][_0x366c5f];if(_0x45e181['type']==='trigger')return[_0x366c5f,_0x45e181];}return null;}async['deployTransitions'](){const _0x46958a=this['manifest']['app']['graphs'],_0x41e462={};for(const _0x4bec24 of _0x46958a){if(_0x4bec24['subscribes']&&_0x4bec24['subscribes']['startsWith']('.')){const [_0xd390e7]=this['findTrigger'](_0x4bec24);_0xd390e7&&(_0x41e462[_0x4bec24['subscribes']]={[_0xd390e7]:!![]});}if(_0x4bec24['transitions'])for(const _0x5aa9d7 in _0x4bec24['transitions']){const _0x26651c=_0x4bec24['transitions'][_0x5aa9d7],_0x22f12d={};for(const _0x541838 of _0x26651c){const _0x4a3796=_0x541838['to'];_0x541838['conditions']?_0x22f12d[_0x4a3796]=_0x541838['conditions']:_0x22f12d[_0x4a3796]=!![];}Object['keys'](_0x22f12d)['length']>0x0&&(_0x41e462['.'+_0x5aa9d7]=_0x22f12d);}}await this['store']['setTransitions'](_0x41e462,this['getVID']());}async['deployHookPatterns'](){const _0x3e910f=this['manifest']['app']['graphs'],_0x28dfd6={};for(const _0x1a3bc2 of _0x3e910f){if(_0x1a3bc2['hooks'])for(const _0x5a57af in _0x1a3bc2['hooks']){_0x28dfd6[_0x5a57af]=_0x1a3bc2['hooks'][_0x5a57af];const _0x52b885=_0x1a3bc2['hooks'][_0x5a57af][0x0]['to'],_0x20af64=_0x1a3bc2['activities'][_0x52b885];_0x20af64&&(!_0x20af64['hook']&&(_0x20af64['hook']={}),_0x20af64['hook']['topic']=_0x5a57af);}}await this['store']['setHookRules'](_0x28dfd6);}async['deployConsumerGroups'](){const _0x2a5ebd={'appId':this['manifest']['app']['id']},_0xc5e84e=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x2a5ebd);await this['deployConsumerGroup'](_0xc5e84e,'ENGINE');for(const _0x34a895 of this['manifest']['app']['graphs']){const _0x4883d0=_0x34a895['activities'];for(const _0x48a8cf in _0x4883d0){const _0x128652=_0x4883d0[_0x48a8cf];if(_0x128652['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x128652['subtype'],{})===_0x128652['subtype']){_0x2a5ebd['topic']=_0x128652['subtype'];const _0x4f9f13=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x2a5ebd);await this['deployConsumerGroup'](_0x4f9f13,'WORKER');}}}}async['deployConsumerGroup'](_0x20bd7e,_0x5ec12c){try{await this['stream']['createConsumerGroup'](_0x20bd7e,_0x5ec12c);}catch(_0x426c74){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x20bd7e,'group':_0x5ec12c});}}}exports['Deployer']=Deployer;
|
|
1
|
+
'use strict';(function(_0x215f2f,_0x14624b){const _0x4b939c=_0x29e1,_0x29c237=_0x215f2f();while(!![]){try{const _0x58d688=-parseInt(_0x4b939c(0x1f8))/0x1+-parseInt(_0x4b939c(0x1f5))/0x2+-parseInt(_0x4b939c(0x1fa))/0x3*(parseInt(_0x4b939c(0x1f9))/0x4)+parseInt(_0x4b939c(0x1fb))/0x5+-parseInt(_0x4b939c(0x1f7))/0x6+-parseInt(_0x4b939c(0x1f4))/0x7*(parseInt(_0x4b939c(0x1f6))/0x8)+parseInt(_0x4b939c(0x1f3))/0x9;if(_0x58d688===_0x14624b)break;else _0x29c237['push'](_0x29c237['shift']());}catch(_0x5d214a){_0x29c237['push'](_0x29c237['shift']());}}}(_0x3654,0xeeb3f));function _0x3654(){const _0x5d7516=['339486DROfka','5392KqVris','7914240YLnYhg','78417jxamGJ','4944652JYViqh','3UTukBZ','8399025CSbuIE','33803595LtypGW','17185OWKFOh'];_0x3654=function(){return _0x5d7516;};return _0x3654();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Deployer']=void 0x0;function _0x29e1(_0x30c467,_0x34c51d){const _0x36542f=_0x3654();return _0x29e1=function(_0x29e1bc,_0x2b8ad9){_0x29e1bc=_0x29e1bc-0x1f3;let _0x4e405d=_0x36542f[_0x29e1bc];return _0x4e405d;},_0x29e1(_0x30c467,_0x34c51d);}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(_0x38c240){this['manifest']=null,this['manifest']=_0x38c240;}async['deploy'](_0x18aa34,_0x4a8e23){this['store']=_0x18aa34,this['stream']=_0x4a8e23,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 _0x8f386d of this['manifest']['app']['graphs']){const [,_0x30e0f7]=this['findTrigger'](_0x8f386d),_0x5b2534=_0x30e0f7['subscribes'],[_0x19930c,_0x443d3a,_0x1da8c1]=await this['store']['reserveSymbolRange']('$'+_0x5b2534,DEFAULT_RANGE_SIZE,'JOB'),_0x5823a4='',_0x595be2=this['bindSymbols'](_0x19930c,_0x443d3a,_0x1da8c1,_0x5823a4,_0x30e0f7['PRODUCES']);Object['keys'](_0x595be2)['length']&&await this['store']['addSymbols']('$'+_0x5b2534,_0x595be2);for(const [_0x49d5bb,_0x4bf82e]of Object['entries'](_0x8f386d['activities'])){const [_0xcc711,_0x4fe393,_0x543553]=await this['store']['reserveSymbolRange'](_0x49d5bb,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x62e24a=_0x49d5bb+'/';this['bindSelf'](_0x4bf82e['consumes'],_0x4bf82e['produces'],_0x49d5bb);const _0x24a4a5=this['bindSymbols'](_0xcc711,_0x4fe393,_0x543553,_0x62e24a,_0x4bf82e['produces']);Object['keys'](_0x24a4a5)['length']&&await this['store']['addSymbols'](_0x49d5bb,_0x24a4a5);}}}['bindSelf'](_0x4ae299,_0x2a1d55,_0x770209){for(const _0x3b3a4c of[_0x770209,'$self']){const _0x26a4bb=_0x4ae299[_0x3b3a4c];if(_0x26a4bb)for(const _0x2d5c56 of _0x26a4bb){!_0x2a1d55['includes'](_0x2d5c56)&&_0x2a1d55['push'](_0x2d5c56);}}}['bindSymbols'](_0x4649ba,_0x181405,_0x36c375,_0x1b6ada,_0x5d77bd){const _0x577cf9={},_0xac9163={..._0x36c375};for(const _0x313ad9 of _0x5d77bd){const _0x23cf0d=''+_0x1b6ada+_0x313ad9;if(!_0xac9163[_0x23cf0d]){if(_0x4649ba>_0x181405)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x2603b9=(0x0,utils_1['getSymKey'])(_0x4649ba);_0x4649ba++,_0x577cf9[_0x23cf0d]=_0x2603b9,_0xac9163[_0x23cf0d]=_0x2603b9;}}return _0x577cf9;}['copyJobSchemas'](){const _0x13683b=this['manifest']['app']['graphs'];for(const _0xd8c3ad of _0x13683b){const _0x2a9eed=_0xd8c3ad['output']?.['schema'],_0x2020a1=_0xd8c3ad['input']?.['schema'];if(!_0x2a9eed&&!_0x2020a1)continue;const _0x11717c=_0xd8c3ad['activities'];for(const _0x27432b in _0x11717c){if(_0x11717c[_0x27432b]['type']==='trigger'){const _0x435b56=_0x11717c[_0x27432b];_0x2a9eed&&(!_0x435b56['job']&&(_0x435b56['job']={}),_0x435b56['job']['schema']=_0x2a9eed),_0x2020a1&&(_0x435b56['output']={'schema':_0x2020a1});}}}}['bindBackRefs'](){for(const _0xa7e029 of this['manifest']['app']['graphs']){const _0x56ec27=_0xa7e029['activities'],_0xabf391=this['findTrigger'](_0xa7e029)[0x0];for(const _0x5e4afb in _0x56ec27){_0x56ec27[_0x5e4afb]['trigger']=_0xabf391,_0x56ec27[_0x5e4afb]['subscribes']=_0xa7e029['subscribes'],_0xa7e029['publishes']&&(_0x56ec27[_0x5e4afb]['publishes']=_0xa7e029['publishes']),_0x56ec27[_0x5e4afb]['expire']=_0xa7e029['expire']??undefined,_0x56ec27[_0x5e4afb]['persistent']=_0xa7e029['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x58944b of this['manifest']['app']['graphs']){const _0xdea6b4=_0x58944b['activities'];for(const _0x1dac96 in _0xdea6b4){const _0x1c47e7=_0xdea6b4[_0x1dac96];_0x1c47e7['type']==='cycle'&&(_0xdea6b4[_0x1c47e7['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x4f4b59 of this['manifest']['app']['graphs']){const _0x1a8fac=_0x4f4b59['activities'];for(const _0x358605 in _0x1a8fac){const _0x4f62e0=_0x1a8fac[_0x358605];['worker','await']['includes'](_0x4f62e0['type'])&&_0x4f62e0['topic']&&!_0x4f62e0['subtype']&&(_0x4f62e0['subtype']=_0x4f62e0['topic']);}}}['convertActivitiesToHooks'](){for(const _0x200716 of this['manifest']['app']['graphs']){const _0x482938=_0x200716['activities'];for(const _0x328347 in _0x482938){const _0x3e6fb0=_0x482938[_0x328347];['activity']['includes'](_0x3e6fb0['type'])&&(_0x3e6fb0['type']='hook');}}}async['bindParents'](){const _0x1bc862=this['manifest']['app']['graphs'];for(const _0x36ed94 of _0x1bc862){if(_0x36ed94['transitions'])for(const _0x4d27d8 in _0x36ed94['transitions']){const _0xb5c11c=_0x36ed94['transitions'][_0x4d27d8];for(const _0x2816da of _0xb5c11c){const _0x47e95a=_0x2816da['to'];_0x36ed94['activities'][_0x47e95a]['parent']=_0x4d27d8;}_0x36ed94['activities'][_0x4d27d8]['transitions']=_0xb5c11c;}}}['collectValues'](_0x4c1f02,_0x11ccc8){for(const [_0x1dc47b,_0x2df8f6]of Object['entries'](_0x4c1f02)){if(_0x1dc47b==='enum'||_0x1dc47b==='examples'||_0x1dc47b==='default'){if(Array['isArray'](_0x2df8f6))for(const _0x14d503 of _0x2df8f6){typeof _0x14d503==='string'&&_0x14d503['length']>0x5&&_0x11ccc8['add'](_0x14d503);}else typeof _0x2df8f6==='string'&&_0x2df8f6['length']>0x5&&_0x11ccc8['add'](_0x2df8f6);}else typeof _0x2df8f6==='object'&&this['collectValues'](_0x2df8f6,_0x11ccc8);}}['traverse'](_0x450ce2,_0x155840){for(const _0xb864cd of Object['values'](_0x450ce2)){typeof _0xb864cd==='object'&&('schema'in _0xb864cd?this['collectValues'](_0xb864cd['schema'],_0x155840):this['traverse'](_0xb864cd,_0x155840));}}async['generateSymVals'](){const _0x4b650f=new Set();for(const _0x19f749 of this['manifest']['app']['graphs']){this['traverse'](_0x19f749,_0x4b650f);}const _0x193bec=await this['store']['getSymbolValues'](),_0x3be028=Object['keys'](_0x193bec)['length'],_0x14589d=Math['pow'](0x34,0x2)-0x1,_0x54a340=serializer_1['SerializerService']['filterSymVals'](_0x3be028,_0x14589d,_0x193bec,_0x4b650f);await this['store']['addSymbolValues'](_0x54a340);}['resolveJobMapsPaths'](){function _0x48e192(_0x3c09b4){const _0x7cb865=[];function _0x3c372f(_0x2dc65e,_0x226eb6=[]){for(const _0x3725eb in _0x2dc65e){if(typeof _0x2dc65e[_0x3725eb]==='object'&&_0x2dc65e[_0x3725eb]!==null&&!('@pipe'in _0x2dc65e[_0x3725eb])){const _0x20d313=[..._0x226eb6,_0x3725eb];_0x3c372f(_0x2dc65e[_0x3725eb],_0x20d313);}else{const _0x78a48=[..._0x226eb6,_0x3725eb]['join']('/');if(!_0x78a48['includes']('[')){const _0x43304d='data/'+_0x78a48;!_0x7cb865['includes'](_0x43304d)&&_0x7cb865['push'](_0x43304d);}else{const [_0x195bb4,_0x31d62f]=_0x78a48['split']('['),[_0x4dcacd,_0x548553]=_0x31d62f['split'](']');if(!isNaN(parseInt(_0x4dcacd)))for(let _0x54e67f=0x0;_0x54e67f<parseInt(_0x4dcacd);_0x54e67f++){const _0x356617='data/'+_0x195bb4+'/'+_0x54e67f;!_0x7cb865['includes'](_0x356617)&&_0x7cb865['push'](_0x356617);}}}}}return _0x3c09b4&&_0x3c372f(_0x3c09b4),_0x7cb865;}for(const _0x5c33c3 of this['manifest']['app']['graphs']){let _0x327b34=[];const [,_0x53f910]=this['findTrigger'](_0x5c33c3);for(const _0x529b4e in _0x5c33c3['activities']){const _0x4609b3=_0x5c33c3['activities'][_0x529b4e];_0x327b34=_0x327b34['concat'](_0x48e192(_0x4609b3['job']?.['maps']));}_0x53f910['PRODUCES']=_0x327b34;}}['resolveMappingDependencies'](){const _0x4cab3c=[];function _0x5c4665(_0x36e7dc,_0x871ad2){for(const _0x5b2052 in _0x36e7dc){if(typeof _0x36e7dc[_0x5b2052]==='string'){const _0x4c5c38=_0x36e7dc[_0x5b2052],_0x1bf8ae=_0x4c5c38['match'](/^\{[^@].*}$/);_0x1bf8ae&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x4c5c38)&&(_0x4c5c38['split']('.')[0x1]!=='input'&&(_0x4cab3c['push'](_0x4c5c38),_0x871ad2['push'](_0x4c5c38)));}else typeof _0x36e7dc[_0x5b2052]==='object'&&_0x36e7dc[_0x5b2052]!==null&&_0x5c4665(_0x36e7dc[_0x5b2052],_0x871ad2);}}const _0xd5d527=this['manifest']['app']['graphs'];for(const _0x13e09b of _0xd5d527){const _0x1e6062=_0x13e09b['activities'];for(const _0x14c65e in _0x1e6062){const _0x5b30b8=_0x1e6062[_0x14c65e];_0x5b30b8['consumes']=[],_0x5c4665(_0x5b30b8,_0x5b30b8['consumes']),_0x5b30b8['consumes']=this['groupMappingRules'](_0x5b30b8['consumes']);}}const _0x3f42a0=this['groupMappingRules'](_0x4cab3c);for(const _0x5aae04 of _0xd5d527){const _0x3d10ee=_0x5aae04['activities'];for(const _0x42d357 in _0x3d10ee){const _0x1887e3=_0x3d10ee[_0x42d357];_0x1887e3['produces']=_0x3f42a0[''+_0x42d357]||[];}}}['groupMappingRules'](_0xb39849){_0xb39849=Array['from'](new Set(_0xb39849))['sort']();const _0x1ccecc={};for(const _0xffaeeb of _0xb39849){const [_0x3c37e3,_0x494e16]=this['resolveMappableValue'](_0xffaeeb);!_0x1ccecc[_0x3c37e3]&&(_0x1ccecc[_0x3c37e3]=[]),_0x1ccecc[_0x3c37e3]['push'](_0x494e16);}return _0x1ccecc;}['resolveMappableValue'](_0x2e5dcb){_0x2e5dcb=_0x2e5dcb['substring'](0x1,_0x2e5dcb['length']-0x1);const _0x378d61=_0x2e5dcb['split']('.');if(_0x378d61[0x0]==='$job'){const [_0x3e39ee,..._0x2e35be]=_0x378d61;return[_0x3e39ee,_0x2e35be['join']('/')];}else{const [_0x477e37,_0x1e61b2,_0x5005e1,..._0x34d07b]=_0x378d61,_0x5cb566={'hook':'hook/data','input':'input/data','output':_0x5005e1==='data'?'output/data':'output/metadata'}[_0x1e61b2];return[_0x477e37,_0x5cb566+'/'+_0x34d07b['join']('/')];}}async['deployActivitySchemas'](){const _0x12d141=this['manifest']['app']['graphs'],_0x264eb1={};for(const _0x732171 of _0x12d141){const _0x47c134=_0x732171['activities'];for(const _0x340d51 in _0x47c134){const _0x4b072f=_0x47c134[_0x340d51];delete _0x4b072f['transitions'],_0x264eb1[_0x340d51]=_0x4b072f;}}await this['store']['setSchemas'](_0x264eb1,this['getVID']());}async['deploySubscriptions'](){const _0x238a65=this['manifest']['app']['graphs'],_0x313215={};for(const _0x52b4d9 of _0x238a65){const _0x1c7ec9=_0x52b4d9['activities'],_0x593074=_0x52b4d9['subscribes'];for(const _0xd8412 in _0x1c7ec9){if(_0x1c7ec9[_0xd8412]['type']==='trigger'){_0x313215[_0x593074]=_0xd8412;break;}}}await this['store']['setSubscriptions'](_0x313215,this['getVID']());}['findTrigger'](_0x44adf0){for(const _0xcb31d3 in _0x44adf0['activities']){const _0x80dd12=_0x44adf0['activities'][_0xcb31d3];if(_0x80dd12['type']==='trigger')return[_0xcb31d3,_0x80dd12];}return null;}async['deployTransitions'](){const _0x4ed3fd=this['manifest']['app']['graphs'],_0x4272e0={};for(const _0x334f4c of _0x4ed3fd){if(_0x334f4c['subscribes']&&_0x334f4c['subscribes']['startsWith']('.')){const [_0x373da9]=this['findTrigger'](_0x334f4c);_0x373da9&&(_0x4272e0[_0x334f4c['subscribes']]={[_0x373da9]:!![]});}if(_0x334f4c['transitions'])for(const _0x87871b in _0x334f4c['transitions']){const _0x57b9cb=_0x334f4c['transitions'][_0x87871b],_0x5961f6={};for(const _0x16b5fa of _0x57b9cb){const _0x31fd53=_0x16b5fa['to'];_0x16b5fa['conditions']?_0x5961f6[_0x31fd53]=_0x16b5fa['conditions']:_0x5961f6[_0x31fd53]=!![];}Object['keys'](_0x5961f6)['length']>0x0&&(_0x4272e0['.'+_0x87871b]=_0x5961f6);}}await this['store']['setTransitions'](_0x4272e0,this['getVID']());}async['deployHookPatterns'](){const _0x4b2413=this['manifest']['app']['graphs'],_0x5b99d0={};for(const _0x459246 of _0x4b2413){if(_0x459246['hooks'])for(const _0x468baa in _0x459246['hooks']){_0x5b99d0[_0x468baa]=_0x459246['hooks'][_0x468baa];const _0x3aeb72=_0x459246['hooks'][_0x468baa][0x0]['to'],_0xe3b2e2=_0x459246['activities'][_0x3aeb72];_0xe3b2e2&&(!_0xe3b2e2['hook']&&(_0xe3b2e2['hook']={}),_0xe3b2e2['hook']['topic']=_0x468baa);}}await this['store']['setHookRules'](_0x5b99d0);}async['deployConsumerGroups'](){const _0xfa4c70={'appId':this['manifest']['app']['id']},_0x20ec67=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0xfa4c70);await this['deployConsumerGroup'](_0x20ec67,'ENGINE');for(const _0x39f203 of this['manifest']['app']['graphs']){const _0x390177=_0x39f203['activities'];for(const _0x439529 in _0x390177){const _0x2f4ce0=_0x390177[_0x439529];if(_0x2f4ce0['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x2f4ce0['subtype'],{})===_0x2f4ce0['subtype']){_0xfa4c70['topic']=_0x2f4ce0['subtype'];const _0x311719=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0xfa4c70);await this['deployConsumerGroup'](_0x311719,'WORKER');}}}}async['deployConsumerGroup'](_0x5da179,_0x110e4a){try{await this['stream']['createConsumerGroup'](_0x5da179,_0x110e4a);}catch(_0x4f03cd){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x5da179,'group':_0x110e4a});}}}exports['Deployer']=Deployer;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ILogger } from '../logger';
|
|
2
2
|
import { StoreService } from '../store';
|
|
3
3
|
import { HotMeshManifest } from '../../types/hotmesh';
|
|
4
|
-
import {
|
|
4
|
+
import { ProviderClient, ProviderTransaction } from '../../types/provider';
|
|
5
5
|
import { StreamService } from '../stream';
|
|
6
6
|
declare class CompilerService {
|
|
7
|
-
store: StoreService<
|
|
8
|
-
stream: StreamService<
|
|
7
|
+
store: StoreService<ProviderClient, ProviderTransaction> | null;
|
|
8
|
+
stream: StreamService<ProviderClient, ProviderTransaction> | null;
|
|
9
9
|
logger: ILogger;
|
|
10
|
-
constructor(store: StoreService<
|
|
10
|
+
constructor(store: StoreService<ProviderClient, ProviderTransaction>, stream: StreamService<ProviderClient, ProviderTransaction>, logger: ILogger);
|
|
11
11
|
plan(mySchemaOrPath: string): Promise<HotMeshManifest>;
|
|
12
12
|
isPath(input: string): boolean;
|
|
13
13
|
deploy(mySchemaOrPath: string): Promise<HotMeshManifest>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x4fe17f,_0x297aaa){const _0x4e291f=_0x3e72,_0x306fbf=_0x4fe17f();while(!![]){try{const _0x237afc=parseInt(_0x4e291f(0xfe))/0x1+parseInt(_0x4e291f(0xfa))/0x2*(parseInt(_0x4e291f(0xfd))/0x3)+parseInt(_0x4e291f(0xf8))/0x4*(-parseInt(_0x4e291f(0xf9))/0x5)+-parseInt(_0x4e291f(0xfb))/0x6*(parseInt(_0x4e291f(0xfc))/0x7)+-parseInt(_0x4e291f(0xf7))/0x8+-parseInt(_0x4e291f(0x100))/0x9*(-parseInt(_0x4e291f(0xff))/0xa)+-parseInt(_0x4e291f(0x102))/0xb*(-parseInt(_0x4e291f(0x101))/0xc);if(_0x237afc===_0x297aaa)break;else _0x306fbf['push'](_0x306fbf['shift']());}catch(_0x53953c){_0x306fbf['push'](_0x306fbf['shift']());}}}(_0x366f,0x39b35));function _0x3e72(_0x466a8a,_0x3acf0b){const _0x366f47=_0x366f();return _0x3e72=function(_0x3e72e5,_0x46d1af){_0x3e72e5=_0x3e72e5-0xf7;let _0x11b3d4=_0x366f47[_0x3e72e5];return _0x11b3d4;},_0x3e72(_0x466a8a,_0x3acf0b);}var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x3abe40,_0x259f36,_0x30e15e,_0x1a039f){if(_0x1a039f===undefined)_0x1a039f=_0x30e15e;var _0x52e949=Object['getOwnPropertyDescriptor'](_0x259f36,_0x30e15e);(!_0x52e949||('get'in _0x52e949?!_0x259f36['__esModule']:_0x52e949['writable']||_0x52e949['configurable']))&&(_0x52e949={'enumerable':!![],'get':function(){return _0x259f36[_0x30e15e];}}),Object['defineProperty'](_0x3abe40,_0x1a039f,_0x52e949);}:function(_0x3a3739,_0x1505aa,_0x420e9c,_0xa7f79f){if(_0xa7f79f===undefined)_0xa7f79f=_0x420e9c;_0x3a3739[_0xa7f79f]=_0x1505aa[_0x420e9c];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x40d34a,_0x487e9e){Object['defineProperty'](_0x40d34a,'default',{'enumerable':!![],'value':_0x487e9e});}:function(_0x32105d,_0x2c197f){_0x32105d['default']=_0x2c197f;}),__importStar=this&&this['__importStar']||function(_0x2ec57b){if(_0x2ec57b&&_0x2ec57b['__esModule'])return _0x2ec57b;var _0x5625f2={};if(_0x2ec57b!=null){for(var _0x4ac27f in _0x2ec57b)if(_0x4ac27f!=='default'&&Object['prototype']['hasOwnProperty']['call'](_0x2ec57b,_0x4ac27f))__createBinding(_0x5625f2,_0x2ec57b,_0x4ac27f);}return __setModuleDefault(_0x5625f2,_0x2ec57b),_0x5625f2;},__importDefault=this&&this['__importDefault']||function(_0x4fcf3a){return _0x4fcf3a&&_0x4fcf3a['__esModule']?_0x4fcf3a:{'default':_0x4fcf3a};};function _0x366f(){const _0x207eaa=['8QyxgEr','1112830djzcqx','2lSEvnQ','341382rMvbMF','21wrEXGr','675093dUdLyk','400961oVZqQy','3622410EsxJqf','9twIPHq','1152636NdiQJL','11fnmORF','1856976KAmAQI'];_0x366f=function(){return _0x207eaa;};return _0x366f();}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(_0x42861c,_0x5eb144,_0x414de8){this['store']=_0x42861c,this['stream']=_0x5eb144,this['logger']=_0x414de8;}async['plan'](_0x5b8759){try{let _0x14fe22;this['isPath'](_0x5b8759)?_0x14fe22=await json_schema_ref_parser_1['default']['dereference'](_0x5b8759):_0x14fe22=js_yaml_1['default']['load'](_0x5b8759);const _0x1cc391=new validator_1['Validator'](_0x14fe22);return _0x1cc391['validate'](this['store']),_0x14fe22;}catch(_0x3f40a0){this['logger']['error']('compiler-plan-error',_0x3f40a0);}}['isPath'](_0x1f005e){return!_0x1f005e['trim']()['startsWith']('app:');}async['deploy'](_0x368180){try{let _0x3e3784;this['isPath'](_0x368180)?(_0x3e3784=await json_schema_ref_parser_1['default']['dereference'](_0x368180),await this['saveAsJSON'](_0x368180,_0x3e3784)):_0x3e3784=js_yaml_1['default']['load'](_0x368180);const _0x598cd5=new validator_1['Validator'](_0x3e3784);_0x598cd5['validate'](this['store']);const _0x1f6c56=new deployer_1['Deployer'](_0x3e3784);return await _0x1f6c56['deploy'](this['store'],this['stream']),await this['store']['setApp'](_0x3e3784['app']['id'],_0x3e3784['app']['version']),_0x3e3784;}catch(_0xd7e5ae){this['logger']['error']('compiler-deploy-error',_0xd7e5ae);}}async['activate'](_0x3b78dc,_0x48c95d){return await this['store']['activateAppVersion'](_0x3b78dc,_0x48c95d);}async['saveAsJSON'](_0x406c1c,_0x3c3ee0){const _0x419e6b=JSON['stringify'](_0x3c3ee0,null,0x2),_0x413786=path['join'](path['dirname'](_0x406c1c),'.hotmesh.'+_0x3c3ee0['app']['id']+'.'+_0x3c3ee0['app']['version']+'.json');await fs['writeFile'](_0x413786,_0x419e6b,'utf8');}}exports['CompilerService']=CompilerService;
|