@hotmeshio/hotmesh 0.3.7 → 0.3.9
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 +15 -18
- package/build/index.d.ts +4 -1
- package/build/index.js +7 -1
- 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 +14 -7
- 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 +6 -0
- package/build/services/connector/factory.js +56 -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 +39 -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/index.d.ts +2 -0
- package/build/services/meshflow/index.js +2 -0
- 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/_deploy.d.ts +2 -1
- package/build/services/stream/providers/postgres/_deploy.js +1 -1
- package/build/services/stream/providers/postgres/postgres.d.ts +0 -0
- package/build/services/stream/providers/postgres/postgres.js +0 -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 +6 -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 +48 -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 -4
- package/package.json +14 -7
- package/typedoc.json +2 -1
- package/types/hotmesh.ts +139 -22
- package/types/index.ts +26 -17
- package/types/manifest.ts +1 -10
- package/types/meshcall.ts +38 -13
- package/types/meshflow.ts +2 -7
- package/types/nats.ts +231 -0
- package/types/postgres.ts +54 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x590457,_0x5dac72){const _0xabda80=_0x471e,_0x4bc816=_0x590457();while(!![]){try{const _0x17a806=-parseInt(_0xabda80(0x6a))/0x1*(parseInt(_0xabda80(0x6e))/0x2)+parseInt(_0xabda80(0x72))/0x3+parseInt(_0xabda80(0x68))/0x4*(parseInt(_0xabda80(0x69))/0x5)+parseInt(_0xabda80(0x70))/0x6*(parseInt(_0xabda80(0x6b))/0x7)+-parseInt(_0xabda80(0x71))/0x8+parseInt(_0xabda80(0x6c))/0x9+parseInt(_0xabda80(0x6d))/0xa*(-parseInt(_0xabda80(0x6f))/0xb);if(_0x17a806===_0x5dac72)break;else _0x4bc816['push'](_0x4bc816['shift']());}catch(_0x3ef958){_0x4bc816['push'](_0x4bc816['shift']());}}}(_0x5d3b,0xd79bd));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Hook']=void 0x0;function _0x5d3b(){const _0x2e9adf=['5280087WDaRVL','2804grokbG','7375BgekjU','463ZUhKLP','131299peAtJO','6939882ZFzinb','20968990mnLqRh','5594kzoSIx','11tmBtrV','342ndnabA','2873664PPlpTl'];_0x5d3b=function(){return _0x2e9adf;};return _0x5d3b();}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');function _0x471e(_0x3fc3a5,_0x495ac9){const _0x5d3b5c=_0x5d3b();return _0x471e=function(_0x471e9c,_0x1ec7b2){_0x471e9c=_0x471e9c-0x68;let _0xa61a73=_0x5d3b5c[_0x471e9c];return _0xa61a73;},_0x471e(_0x3fc3a5,_0x495ac9);}class Hook extends activity_1['Activity']{constructor(_0x38be93,_0x2e6d3,_0x53ae7f,_0x3a0d56,_0x578838,_0x274510){super(_0x38be93,_0x2e6d3,_0x53ae7f,_0x3a0d56,_0x578838,_0x274510);}async['process'](){this['logger']['debug']('hook-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x7a0d71;try{return await this['verifyEntry'](),_0x7a0d71=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x7a0d71['startActivitySpan'](this['leg']),this['doesHook']()?await this['doHook'](_0x7a0d71):await this['doPassThrough'](_0x7a0d71),this['context']['metadata']['aid'];}catch(_0x535885){if(_0x535885 instanceof errors_1['InactiveJobError']){this['logger']['error']('hook-inactive-job-error',{..._0x535885});return;}else{if(_0x535885 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x535885});return;}else{if(_0x535885 instanceof errors_1['GetStateError']){this['logger']['error']('hook-get-state-error',{..._0x535885});return;}else{if(_0x535885 instanceof errors_1['CollationError']){if(_0x535885['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',{..._0x535885});}else this['logger']['error']('hook-process-error',{..._0x535885});}}}_0x7a0d71?.['setActivityError'](_0x535885['message']);throw _0x535885;}finally{_0x7a0d71?.['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 _0x51c63c=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return!isNaN(_0x51c63c)&&Number(_0x51c63c)>0x0;}return!!this['config']['hook']?.['topic'];}async['doHook'](_0x5bb61f){const _0x2065b5=this['store']['transact']();await this['registerHook'](enums_1['HMSH_IS_CLUSTER']?undefined:_0x2065b5),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x2065b5),await collator_1['CollatorService']['authorizeReentry'](this,_0x2065b5),await this['setStatus'](0x0,_0x2065b5),await _0x2065b5['exec'](),_0x5bb61f['mapActivityAttributes']();}async['doPassThrough'](_0x4472fa){const _0x71e043=this['store']['transact']();let _0x438888;this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x71e043),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x71e043),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x71e043),_0x438888=await _0x71e043['exec'](),_0x4472fa['mapActivityAttributes']();const _0xdc16fb=this['resolveStatus'](_0x438888),_0xf052bf={'app.job.jss':_0xdc16fb},_0x465a1e=await this['transition'](this['adjacencyList'],_0xdc16fb);_0x465a1e['length']&&(_0xf052bf['app.activity.mids']=_0x465a1e['join'](',')),_0x4472fa['setActivityAttributes'](_0xf052bf);}async['getHookRule'](_0x462f28){const _0x2d4a1c=await this['store']['getHookRules']();return _0x2d4a1c?.[_0x462f28]?.[0x0];}async['registerHook'](_0x3bd0da){if(this['config']['hook']?.['topic'])return await this['engine']['taskService']['registerWebHook'](this['config']['hook']['topic'],this['context'],this['resolveDad'](),this['context']['metadata']['expire'],_0x3bd0da);else{if(this['config']['sleep']){const _0x34b190=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',_0x34b190,this['metadata']['dad']||''),this['context']['metadata']['jid'];}}}async['processWebHookEvent'](_0x538f8e=stream_1['StreamStatus']['SUCCESS'],_0x4c6866=0xc8){this['logger']['debug']('hook-process-web-hook-event',{'topic':this['config']['hook']['topic'],'aid':this['metadata']['aid'],'status':_0x538f8e,'code':_0x4c6866});const _0x3c834f=new task_1['TaskService'](this['store'],this['logger']),_0x1ac949={...this['data']},_0x395665=await _0x3c834f['processWebHookSignal'](this['config']['hook']['topic'],_0x1ac949);if(_0x395665){const [_0x96c72f,_0xab57c6,_0x22ded8,_0x292294]=_0x395665;this['context']['metadata']['jid']=_0x96c72f,this['context']['metadata']['gid']=_0x292294,this['context']['metadata']['dad']=_0x22ded8,await this['processEvent'](_0x538f8e,_0x4c6866,'hook'),_0x4c6866===0xc8&&await _0x3c834f['deleteWebHookSignal'](this['config']['hook']['topic'],_0x1ac949);}}async['processTimeHookEvent'](_0x3f656f){this['logger']['debug']('hook-process-time-hook-event',{'jid':_0x3f656f,'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(_0x198a16,_0x3b947b){const _0x5987bc=_0xc5d9,_0x39f513=_0x198a16();while(!![]){try{const _0x3c308c=parseInt(_0x5987bc(0x12b))/0x1+parseInt(_0x5987bc(0x12d))/0x2+-parseInt(_0x5987bc(0x130))/0x3+-parseInt(_0x5987bc(0x129))/0x4+parseInt(_0x5987bc(0x12c))/0x5+parseInt(_0x5987bc(0x12a))/0x6*(parseInt(_0x5987bc(0x12f))/0x7)+parseInt(_0x5987bc(0x12e))/0x8*(parseInt(_0x5987bc(0x131))/0x9);if(_0x3c308c===_0x3b947b)break;else _0x39f513['push'](_0x39f513['shift']());}catch(_0x222698){_0x39f513['push'](_0x39f513['shift']());}}}(_0x4c74,0x21da9));function _0xc5d9(_0x5a844a,_0x179627){const _0x4c74ce=_0x4c74();return _0xc5d9=function(_0xc5d9c9,_0x2665ec){_0xc5d9c9=_0xc5d9c9-0x129;let _0x559daf=_0x4c74ce[_0xc5d9c9];return _0x559daf;},_0xc5d9(_0x5a844a,_0x179627);}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 _0x4c74(){const _0x55a611=['45855JkFbFm','237776FWpgcA','32ujqgmF','26726FxFvaB','78009VeXLuf','272160FTHsex','720988dqbYKi','18pUTcPF','84442pQFqYC'];_0x4c74=function(){return _0x55a611;};return _0x4c74();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x4cf4d7,_0x5813f5){const _0x2d06c1=_0x39bd,_0x210c96=_0x4cf4d7();while(!![]){try{const _0x25defa=-parseInt(_0x2d06c1(0x1fc))/0x1*(-parseInt(_0x2d06c1(0x1f3))/0x2)+-parseInt(_0x2d06c1(0x1f2))/0x3*(parseInt(_0x2d06c1(0x1f9))/0x4)+-parseInt(_0x2d06c1(0x1f8))/0x5*(-parseInt(_0x2d06c1(0x1f5))/0x6)+-parseInt(_0x2d06c1(0x1f6))/0x7*(-parseInt(_0x2d06c1(0x1fb))/0x8)+-parseInt(_0x2d06c1(0x1f7))/0x9+parseInt(_0x2d06c1(0x1fa))/0xa+-parseInt(_0x2d06c1(0x1f4))/0xb;if(_0x25defa===_0x5813f5)break;else _0x210c96['push'](_0x210c96['shift']());}catch(_0xc8d618){_0x210c96['push'](_0x210c96['shift']());}}}(_0xc780,0xd4a86));function _0x39bd(_0x22cb0a,_0x60bceb){const _0xc78098=_0xc780();return _0x39bd=function(_0x39bdb8,_0x25b361){_0x39bdb8=_0x39bdb8-0x1f2;let _0x3df0cd=_0xc78098[_0x39bdb8];return _0x3df0cd;},_0x39bd(_0x22cb0a,_0x60bceb);}function _0xc780(){const _0x57385b=['3eKWloq','1540gIZmUk','13875323lIlAoD','2507634XKRMuJ','10527755JYvRZS','7883739pygeoa','10WEWEYa','6591668bWubBt','13208740odYPXb','8MbMFEt','1293jscmRc'];_0xc780=function(){return _0x57385b;};return _0xc780();}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(_0x1444b1,_0x3d663a,_0x1b8bf4,_0x3d1004,_0x4da772,_0x54a214){super(_0x1444b1,_0x3d663a,_0x1b8bf4,_0x3d1004,_0x4da772,_0x54a214);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x2850a4;try{await this['verifyEntry'](),_0x2850a4=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x2850a4['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0x2850a4):await this['interruptAnother'](_0x2850a4);}catch(_0x20b8dd){if(_0x20b8dd instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0x20b8dd});return;}else{if(_0x20b8dd instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x20b8dd});return;}else{if(_0x20b8dd instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0x20b8dd});return;}else{if(_0x20b8dd instanceof errors_1['CollationError']){if(_0x20b8dd['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',{..._0x20b8dd});}else this['logger']['error']('interrupt-process-error',{..._0x20b8dd});}}}_0x2850a4?.['setActivityError'](_0x20b8dd['message']);throw _0x20b8dd;}finally{_0x2850a4?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x3be9c8){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0xfbe5d1=await this['interrupt']();_0x3be9c8['mapActivityAttributes']();const _0x1b5671=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x1b5671),await this['setStatus'](-0x1,_0x1b5671);const _0x5c2fae=await _0x1b5671['exec'](),_0x23d518=this['resolveStatus'](_0x5c2fae);return _0x3be9c8['setActivityAttributes']({'app.activity.mid':_0xfbe5d1,'app.job.jss':_0x23d518}),this['context']['metadata']['aid'];}async['interruptAnother'](_0x2b0425){const _0x3eaa21=await this['interrupt'](),_0xcc62b9={'app.activity.mid':_0x3eaa21};_0x2b0425['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x55ec73=this['store']['transact']();await this['setState'](_0x55ec73);}const _0x56c86b=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x56c86b),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x56c86b);const _0xb832e4=await _0x56c86b['exec'](),_0x13c786=this['resolveStatus'](_0xb832e4);_0xcc62b9['app.job.jss']=_0x13c786;const _0x2a4b30=await this['transition'](this['adjacencyList'],_0x13c786);return _0x2a4b30['length']&&(_0xcc62b9['app.activity.mids']=_0x2a4b30['join'](',')),_0x2b0425['setActivityAttributes'](_0xcc62b9),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0x2987b4=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0x2987b4==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 _0x25135a=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'],_0x25135a);}}exports['Interrupt']=Interrupt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x1333(_0x101f65,_0x3c1d8a){const _0x416aec=_0x416a();return _0x1333=function(_0x13337a,_0x20ed6a){_0x13337a=_0x13337a-0x1ac;let _0x2e8d37=_0x416aec[_0x13337a];return _0x2e8d37;},_0x1333(_0x101f65,_0x3c1d8a);}function _0x416a(){const _0x237a95=['38549yxyqlt','6IeDYsT','9189896bpjYdS','6022215fAFaUN','810PPaAma','3167320cFFUzd','1249640qlFClA','589449PBjrGK','452915rTsVwt'];_0x416a=function(){return _0x237a95;};return _0x416a();}(function(_0x534f72,_0x2e91b8){const _0x42f92b=_0x1333,_0x1e95e7=_0x534f72();while(!![]){try{const _0x2ed4f2=parseInt(_0x42f92b(0x1ac))/0x1+-parseInt(_0x42f92b(0x1ae))/0x2*(parseInt(_0x42f92b(0x1b4))/0x3)+parseInt(_0x42f92b(0x1b3))/0x4+-parseInt(_0x42f92b(0x1b2))/0x5+parseInt(_0x42f92b(0x1b1))/0x6*(parseInt(_0x42f92b(0x1ad))/0x7)+parseInt(_0x42f92b(0x1af))/0x8+-parseInt(_0x42f92b(0x1b0))/0x9;if(_0x2ed4f2===_0x2e91b8)break;else _0x1e95e7['push'](_0x1e95e7['shift']());}catch(_0x586de6){_0x1e95e7['push'](_0x1e95e7['shift']());}}}(_0x416a,0xbae13));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(_0x243e75,_0x4f6223,_0x27720e,_0x39a631,_0x537e62,_0x495545){super(_0x243e75,_0x4f6223,_0x27720e,_0x39a631,_0x537e62,_0x495545);}async['process'](){this['logger']['debug']('signal-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0xe007be;try{await this['verifyEntry'](),_0xe007be=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0xe007be['startActivitySpan'](this['leg']);const _0x4ba255=this['store']['transact']();this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x4ba255),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x4ba255),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x4ba255);const _0x56caf5=await _0x4ba255['exec']();this['config']['subtype']==='all'?await this['hookAll']():await this['hookOne']();const _0x233598=this['resolveStatus'](_0x56caf5),_0x4c45ad={'app.job.jss':_0x233598},_0x51123e=await this['transition'](this['adjacencyList'],_0x233598);return _0x51123e['length']&&(_0x4c45ad['app.activity.mids']=_0x51123e['join'](',')),_0xe007be['mapActivityAttributes'](),_0xe007be['setActivityAttributes'](_0x4c45ad),this['context']['metadata']['aid'];}catch(_0x52fdb9){if(_0x52fdb9 instanceof errors_1['InactiveJobError']){this['logger']['error']('signal-inactive-job-error',{..._0x52fdb9});return;}else{if(_0x52fdb9 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x52fdb9});return;}else{if(_0x52fdb9 instanceof errors_1['GetStateError']){this['logger']['error']('signal-get-state-error',{..._0x52fdb9});return;}else{if(_0x52fdb9 instanceof errors_1['CollationError']){if(_0x52fdb9['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',{..._0x52fdb9});}else this['logger']['error']('signal-process-error',{..._0x52fdb9});}}}_0xe007be?.['setActivityError'](_0x52fdb9['message']);throw _0x52fdb9;}finally{_0xe007be?.['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 _0x3aaa5c=new mapper_1['MapperService'](this['config']['signal']['maps'],this['context']);return _0x3aaa5c['mapRules']();}}['mapResolverData'](){if(this['config']['resolver']?.['maps']){const _0x2879fe=new mapper_1['MapperService'](this['config']['resolver']['maps'],this['context']);return _0x2879fe['mapRules']();}}async['hookOne'](){const _0x59f99d=pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']),_0x2451ea=this['mapSignalData'](),_0x56cd97=pipe_1['Pipe']['resolve'](this['config']['status'],this['context']),_0x31ff13=pipe_1['Pipe']['resolve'](this['config']['code'],this['context']);return await this['engine']['hook'](_0x59f99d,_0x2451ea,_0x56cd97,_0x31ff13);}async['hookAll'](){const _0x2f7cdf=this['mapSignalData'](),_0x3c5339=this['mapResolverData']();this['config']['scrub']&&(_0x3c5339['scrub']=!![]);const _0x4361f5=pipe_1['Pipe']['resolve'](this['config']['key_name'],this['context']),_0x466a6d=pipe_1['Pipe']['resolve'](this['config']['key_value'],this['context']),_0x2328c1=[_0x4361f5+':'+_0x466a6d];return await this['engine']['hookAll'](this['config']['topic'],_0x2f7cdf,_0x3c5339,_0x2328c1);}}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(_0x883a66,_0x33a9f0){const _0x3f0d87=_0x5f1e,_0x4dddce=_0x883a66();while(!![]){try{const _0x3dc47f=parseInt(_0x3f0d87(0x1ef))/0x1*(parseInt(_0x3f0d87(0x1eb))/0x2)+parseInt(_0x3f0d87(0x1e6))/0x3*(-parseInt(_0x3f0d87(0x1e8))/0x4)+parseInt(_0x3f0d87(0x1e9))/0x5+parseInt(_0x3f0d87(0x1ec))/0x6+parseInt(_0x3f0d87(0x1e7))/0x7*(parseInt(_0x3f0d87(0x1ee))/0x8)+-parseInt(_0x3f0d87(0x1ea))/0x9*(parseInt(_0x3f0d87(0x1ed))/0xa)+-parseInt(_0x3f0d87(0x1e5))/0xb;if(_0x3dc47f===_0x33a9f0)break;else _0x4dddce['push'](_0x4dddce['shift']());}catch(_0x4fc7de){_0x4dddce['push'](_0x4dddce['shift']());}}}(_0x224c,0xbcd8b));function _0x224c(){const _0x5050f4=['21FyRYJD','175WnbTXQ','527564ogcvYu','470690JyxTTj','648549zWcQJH','34132MeQfOJ','5906520NADoDE','90pimgwe','328408mMyWmS','35osvSou','3925262MfOxFT'];_0x224c=function(){return _0x5050f4;};return _0x224c();}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');function _0x5f1e(_0x30b437,_0x2bb07e){const _0x224c8f=_0x224c();return _0x5f1e=function(_0x5f1ed2,_0x201e2b){_0x5f1ed2=_0x5f1ed2-0x1e5;let _0x36f2a1=_0x224c8f[_0x5f1ed2];return _0x36f2a1;},_0x5f1e(_0x30b437,_0x2bb07e);}class Trigger extends activity_1['Activity']{constructor(_0x2a9d30,_0xa78fd1,_0x1a171b,_0x189222,_0x2c0f39,_0x5b1b10){super(_0x2a9d30,_0xa78fd1,_0x1a171b,_0x189222,_0x2c0f39,_0x5b1b10);}async['process'](_0x8c7e74){this['logger']['debug']('trigger-process',{'subscribes':this['config']['subscribes']});let _0x4a5571;try{this['setLeg'](0x2),await this['getState'](),_0x4a5571=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x4a5571['startJobSpan'](),_0x4a5571['startActivitySpan'](this['leg']),this['mapJobData'](),this['adjacencyList']=await this['filterAdjacent']();const _0x43bd96=this['initStatus'](_0x8c7e74,this['adjacencyList']['length']);await this['setStateNX'](_0x43bd96),await this['setStatus'](_0x43bd96),this['bindSearchData'](_0x8c7e74),this['bindMarkerData'](_0x8c7e74);const _0x57a85a=this['store']['transact']();await this['setState'](_0x57a85a),await this['setStats'](_0x57a85a);_0x8c7e74?.['pending']&&await this['setExpired'](_0x8c7e74?.['pending'],_0x57a85a);await collator_1['CollatorService']['notarizeInception'](this,this['context']['metadata']['guid'],_0x57a85a),await _0x57a85a['exec'](),this['execAdjacentParent'](),_0x4a5571['mapActivityAttributes']();const _0x4b6380=Number(this['context']['metadata']['js']);_0x4a5571['setJobAttributes']({'app.job.jss':_0x4b6380});const _0x4f3a29={'app.job.jss':_0x4b6380};return await this['transitionAndLogAdjacent'](_0x8c7e74,_0x4b6380,_0x4f3a29),_0x4a5571['setActivityAttributes'](_0x4f3a29),this['context']['metadata']['jid'];}catch(_0x2a6c0c){_0x4a5571?.['setActivityError'](_0x2a6c0c['message']);if(_0x2a6c0c instanceof errors_1['DuplicateJobError']){await(0x0,utils_1['sleepFor'])(0x3e8);const _0x3be99e=await collator_1['CollatorService']['isInceptionOverage'](this,this['context']['metadata']['guid']);if(_0x3be99e){this['logger']['info']('trigger-collation-overage',{'job_id':_0x2a6c0c['jobId'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('duplicate-job-error',{'job_id':_0x2a6c0c['jobId'],'guid':this['context']['metadata']['guid']});}else this['logger']['error']('trigger-process-error',{..._0x2a6c0c});throw _0x2a6c0c;}finally{_0x4a5571?.['endJobSpan'](),_0x4a5571?.['endActivitySpan'](),this['logger']['debug']('trigger-process-end',{'subscribes':this['config']['subscribes'],'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid']});}}async['transitionAndLogAdjacent'](_0x1b7966={},_0x1d016d,_0x1f195b){if(isNaN(_0x1b7966['pending'])){const _0x593044=await this['transition'](this['adjacencyList'],_0x1d016d);_0x593044['length']&&(_0x1f195b['app.activity.mids']=_0x593044['join'](','));}}['initStatus'](_0x31eb9b={},_0x591200){if(_0x31eb9b['pending'])return-0x1;return _0x591200;}async['setExpired'](_0x3c594d,_0x4e4647){await this['store']['expireJob'](this['context']['metadata']['jid'],_0x3c594d,_0x4e4647);}['safeKey'](_0x5d4508){return'_'+_0x5d4508;}['bindSearchData'](_0x3df2ca){_0x3df2ca?.['search']&&Object['keys'](_0x3df2ca['search'])['forEach'](_0x2b101c=>{this['context']['data'][this['safeKey'](_0x2b101c)]=_0x3df2ca['search'][_0x2b101c]['toString']();});}['bindMarkerData'](_0x348fd4){_0x348fd4?.['marker']&&Object['keys'](_0x348fd4['marker'])['forEach'](_0xaeedbe=>{_0xaeedbe['startsWith']('-')&&(this['context']['data'][_0xaeedbe]=_0x348fd4['marker'][_0xaeedbe]['toString']());});}async['setStatus'](_0x11b523){this['context']['metadata']['js']=_0x11b523;}async['execAdjacentParent'](){if(this['context']['metadata']['px']){const _0x545921=(0x0,utils_1['formatISODate'])(new Date()),_0xc936ac={'metadata':this['context']['metadata'],'data':{'job_id':this['context']['metadata']['jid'],'jc':_0x545921,'ju':_0x545921}};await this['engine']['execAdjacentParent'](this['context'],_0xc936ac);}}['createInputContext'](){const _0x33606e={[this['metadata']['aid']]:{'input':{'data':this['data']}},'$self':{'input':{'data':this['data']},'output':{'data':this['data']}}};return _0x33606e;}async['getState'](){const _0x458fdc=this['createInputContext'](),_0x46e082=this['resolveJobId'](_0x458fdc),_0x357325=this['resolveJobKey'](_0x458fdc),_0x4ec1e9=(0x0,utils_1['formatISODate'])(new Date()),{id:_0x3485d8,version:_0x1f09c9}=await this['engine']['getVID']();this['initDimensionalAddress'](collator_1['CollatorService']['getDimensionalSeed']());const _0x145726={...this['metadata'],'jid':_0x46e082,'key':_0x357325,'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':_0x3485d8,'vrs':_0x1f09c9,'tpc':this['config']['subscribes'],'trc':this['context']['metadata']['trc'],'spn':this['context']['metadata']['spn'],'guid':this['context']['metadata']['guid'],'jid':_0x46e082,'dad':collator_1['CollatorService']['getDimensionalSeed'](),'key':_0x357325,'jc':_0x4ec1e9,'ju':_0x4ec1e9,'ts':(0x0,utils_1['getTimeSeries'])(this['resolveGranularity']()),'js':0x0},'data':{},[this['metadata']['aid']]:{'input':{'data':this['data'],'metadata':_0x145726},'output':{'data':this['data'],'metadata':_0x145726},'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'](_0xf2caa8=>'metadata/'+_0xf2caa8);}['bindActivityMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['ACTIVITY']['KEYS']['map'](_0x400fc7=>'output/metadata/'+_0x400fc7);}['resolveGranularity'](){return this['config']['stats']?.['granularity']||reporter_1['ReporterService']['DEFAULT_GRANULARITY'];}['getJobStatus'](){return this['context']['metadata']['js'];}['resolveJobId'](_0x3bb1dc){const _0x4af1b4=this['config']['stats']?.['id'];return _0x4af1b4?pipe_1['Pipe']['resolve'](_0x4af1b4,_0x3bb1dc):(0x0,utils_1['guid'])();}['resolveJobKey'](_0x26f03a){const _0xa0f4bb=this['config']['stats']?.['key'];return _0xa0f4bb?pipe_1['Pipe']['resolve'](_0xa0f4bb,_0x26f03a):'';}async['setStateNX'](_0xe12bef){const _0x1c5bc9=this['context']['metadata']['jid'];if(!await this['store']['setStateNX'](_0x1c5bc9,this['engine']['appId'],_0xe12bef))throw new errors_1['DuplicateJobError'](_0x1c5bc9);}async['setStats'](_0x38840f){const _0x567595=this['context']['metadata'];if(_0x567595['key']&&this['config']['stats']?.['measures']){const _0x35f2e9=await this['engine']['getVID'](),_0x574017=new reporter_1['ReporterService'](_0x35f2e9,this['store'],this['logger']);await this['store']['setStats'](_0x567595['key'],_0x567595['jid'],_0x567595['ts'],_0x574017['resolveTriggerStatistics'](this['config'],this['context']),_0x35f2e9,_0x38840f);}}}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(_0x2f59c4,_0x1bad56){const _0x5419c3=_0x1c4b,_0x334b7c=_0x2f59c4();while(!![]){try{const _0x2847b1=parseInt(_0x5419c3(0x124))/0x1+parseInt(_0x5419c3(0x12c))/0x2+-parseInt(_0x5419c3(0x129))/0x3*(parseInt(_0x5419c3(0x126))/0x4)+-parseInt(_0x5419c3(0x12b))/0x5*(parseInt(_0x5419c3(0x12a))/0x6)+-parseInt(_0x5419c3(0x12d))/0x7+parseInt(_0x5419c3(0x125))/0x8+-parseInt(_0x5419c3(0x128))/0x9*(-parseInt(_0x5419c3(0x127))/0xa);if(_0x2847b1===_0x1bad56)break;else _0x334b7c['push'](_0x334b7c['shift']());}catch(_0x5a6488){_0x334b7c['push'](_0x334b7c['shift']());}}}(_0x14b7,0xab6fd));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Worker']=void 0x0;function _0x14b7(){const _0x2b29fe=['491285JOjqaE','3982176RvtmEP','1718844wsSwUn','190Iayksj','212346MUnWAG','3MoCxTy','158070FwWklY','85YXNIgB','946580sIdjVv','2315964EiHOZI'];_0x14b7=function(){return _0x2b29fe;};return _0x14b7();}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 _0x1c4b(_0x3fae78,_0x5d0717){const _0x14b753=_0x14b7();return _0x1c4b=function(_0x1c4b65,_0x3ad335){_0x1c4b65=_0x1c4b65-0x124;let _0x50733a=_0x14b753[_0x1c4b65];return _0x50733a;},_0x1c4b(_0x3fae78,_0x5d0717);}class Worker extends activity_1['Activity']{constructor(_0x576ca4,_0x29e8d7,_0x59e3c8,_0x2f9a4f,_0x3fc2f4,_0x3c2aee){super(_0x576ca4,_0x29e8d7,_0x59e3c8,_0x2f9a4f,_0x3fc2f4,_0x3c2aee);}async['process'](){this['logger']['debug']('worker-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x47bf28;try{await this['verifyEntry'](),_0x47bf28=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x47bf28['startActivitySpan'](this['leg']),this['mapInputData']();const _0x53704c=this['store']['transact'](),_0x15a580=await this['execActivity'](_0x53704c);await collator_1['CollatorService']['authorizeReentry'](this,_0x53704c),await this['setState'](_0x53704c),await this['setStatus'](0x0,_0x53704c);const _0x49142d=await _0x53704c['exec']();_0x47bf28['mapActivityAttributes']();const _0x1a80c1=this['resolveStatus'](_0x49142d);return _0x47bf28['setActivityAttributes']({'app.activity.mid':_0x15a580,'app.job.jss':_0x1a80c1}),this['context']['metadata']['aid'];}catch(_0x4f6dcf){if(_0x4f6dcf instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x4f6dcf});return;}else{if(_0x4f6dcf instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x4f6dcf});return;}else{if(_0x4f6dcf instanceof errors_1['GetStateError']){this['logger']['error']('worker-get-state-error',{..._0x4f6dcf});return;}else{if(_0x4f6dcf instanceof errors_1['CollationError']){if(_0x4f6dcf['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',{..._0x4f6dcf});}else this['logger']['error']('worker-process-error',{..._0x4f6dcf});}}}_0x47bf28?.['setActivityError'](_0x4f6dcf['message']);throw _0x4f6dcf;}finally{_0x47bf28?.['endActivitySpan'](),this['logger']['debug']('worker-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x43f744){const _0x103be8=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x50ee19={'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':_0x103be8,'spn':this['context']['$self']['output']['metadata']['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context']['data']};return this['config']['retry']&&(_0x50ee19['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](_0x103be8,_0x50ee19,_0x43f744);}}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';(function(
|
|
1
|
+
'use strict';(function(_0x302c87,_0x1e5642){const _0x251a3d=_0x4305,_0x5cca71=_0x302c87();while(!![]){try{const _0x1f2f0c=-parseInt(_0x251a3d(0x1f2))/0x1+-parseInt(_0x251a3d(0x1f3))/0x2*(-parseInt(_0x251a3d(0x1f1))/0x3)+-parseInt(_0x251a3d(0x1f5))/0x4+parseInt(_0x251a3d(0x1ef))/0x5+parseInt(_0x251a3d(0x1f0))/0x6+parseInt(_0x251a3d(0x1ed))/0x7+-parseInt(_0x251a3d(0x1f4))/0x8*(parseInt(_0x251a3d(0x1ee))/0x9);if(_0x1f2f0c===_0x1e5642)break;else _0x5cca71['push'](_0x5cca71['shift']());}catch(_0x3c066c){_0x5cca71['push'](_0x5cca71['shift']());}}}(_0x38e8,0xb2d06));function _0x38e8(){const _0x9350fe=['1283535PIfNVv','4625290qPvvtg','3766488xLOToC','51ikhJuT','297441dpaDnv','5084rqlyPX','8GWTwUK','2561588TvnpXA','1517985gvYLxD'];_0x38e8=function(){return _0x9350fe;};return _0x38e8();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CollatorService']=void 0x0;function _0x4305(_0x10189f,_0x2f15fd){const _0x38e836=_0x38e8();return _0x4305=function(_0x4305a6,_0x359d3d){_0x4305a6=_0x4305a6-0x1ed;let _0x28458f=_0x38e836[_0x4305a6];return _0x28458f;},_0x4305(_0x10189f,_0x2f15fd);}const errors_1=require('../../modules/errors'),collator_1=require('../../types/collator');class CollatorService{static['assertJobActive'](_0x468702,_0x5cc03a,_0x545f27,_0x1c7d62=0x0){if(_0x468702<=_0x1c7d62)throw new errors_1['InactiveJobError'](_0x5cc03a,_0x468702,_0x545f27);}static['getDimensionalAddress'](_0x45191c,_0x5aae67=![]){let _0x16f25b=_0x45191c['context']['metadata']['dad']||_0x45191c['metadata']['dad'];return _0x5aae67&&_0x16f25b&&_0x45191c['leg']===0x2&&(_0x16f25b=_0x16f25b['substring'](0x0,_0x16f25b['lastIndexOf'](','))+',0'),CollatorService['getDimensionsById']([..._0x45191c['config']['ancestors'],_0x45191c['metadata']['aid']],_0x16f25b);}static['resolveReentryDimension'](_0x1e4c7f){const _0xdd35de=_0x1e4c7f['config']['ancestor'],_0x46b509=_0x1e4c7f['config']['ancestors'],_0x4b0e96=_0x46b509['indexOf'](_0xdd35de),_0x5b28b0=_0x1e4c7f['metadata']['dad']['split'](',');return _0x5b28b0['length']=_0x4b0e96+0x1,_0x5b28b0['push']('0'),_0x5b28b0['join'](',');}static async['notarizeEntry'](_0x55915d,_0x4b6395){const _0x58b6a3=await _0x55915d['store']['collate'](_0x55915d['context']['metadata']['jid'],_0x55915d['metadata']['aid'],-0x5af3107a4000,this['getDimensionalAddress'](_0x55915d),_0x4b6395);return this['verifyInteger'](_0x58b6a3,0x1,'enter'),_0x58b6a3;}static async['authorizeReentry'](_0x340c47,_0x4eabcb){const _0xd8fe91=await _0x340c47['store']['collate'](_0x340c47['context']['metadata']['jid'],_0x340c47['metadata']['aid'],-0x9184e72a000,this['getDimensionalAddress'](_0x340c47),_0x4eabcb);return _0xd8fe91;}static async['notarizeEarlyExit'](_0x5091ad,_0x589967){return await _0x5091ad['store']['collate'](_0x5091ad['context']['metadata']['jid'],_0x5091ad['metadata']['aid'],-0xa012317b000,this['getDimensionalAddress'](_0x5091ad),_0x589967);}static async['notarizeEarlyCompletion'](_0x486f5d,_0x19bcf0){const _0x1b437a=_0x486f5d['config']['cycle']?0x9184e72a000:0xa012317b000;return await _0x486f5d['store']['collate'](_0x486f5d['context']['metadata']['jid'],_0x486f5d['metadata']['aid'],0xf4241-_0x1b437a,this['getDimensionalAddress'](_0x486f5d),_0x19bcf0);}static async['notarizeInception'](_0x3a4a44,_0x9b329c,_0x4abdb6){_0x9b329c&&await _0x3a4a44['store']['collateSynthetic'](_0x3a4a44['context']['metadata']['jid'],_0x9b329c,0xf4240,_0x4abdb6);}static async['isInceptionOverage'](_0x48ffae,_0x424c1e){if(_0x424c1e){const _0x1f7743=await _0x48ffae['store']['collateSynthetic'](_0x48ffae['context']['metadata']['jid'],_0x424c1e,0xf4240);return _0x1f7743>0xf4240;}return![];}static async['notarizeReentry'](_0x366737,_0xb5f1e7,_0x1f58e2){const _0x382935=_0x366737['context']['metadata']['jid'],_0x309964=_0x1f58e2||_0x366737['store']['transact']();await _0x366737['store']['collate'](_0x382935,_0x366737['metadata']['aid'],0xf4240,this['getDimensionalAddress'](_0x366737,!![]),_0x309964),await _0x366737['store']['collateSynthetic'](_0x382935,_0xb5f1e7,0xf4240,_0x309964);const [_0x19de21,_0x2afeab]=await _0x309964['exec'](),_0x565cd0=Array['isArray'](_0x19de21)?_0x19de21[0x1]:_0x19de21,_0x3c437e=Array['isArray'](_0x2afeab)?_0x2afeab[0x1]:_0x2afeab;return this['verifyInteger'](_0x565cd0,0x2,'enter'),this['verifySyntheticInteger'](_0x3c437e),_0x565cd0;}static async['notarizeContinuation'](_0x3e911e,_0x3a8cc3){return await _0x3e911e['store']['collate'](_0x3e911e['context']['metadata']['jid'],_0x3e911e['metadata']['aid'],0x1,this['getDimensionalAddress'](_0x3e911e),_0x3a8cc3);}static async['notarizeCompletion'](_0x518a6f,_0x42037a){const _0xe7e242=_0x518a6f['config']['cycle']?0x0:0xe8d4a51000;return await _0x518a6f['store']['collate'](_0x518a6f['context']['metadata']['jid'],_0x518a6f['metadata']['aid'],0x1-_0xe7e242,this['getDimensionalAddress'](_0x518a6f),_0x42037a);}static['getDigitAtIndex'](_0x15aad7,_0x4a13b7){const _0x37f66e=_0x15aad7['toString']();if(_0x4a13b7<0x0||_0x4a13b7>=_0x37f66e['length'])return null;const _0x4e81e7=parseInt(_0x37f66e[_0x4a13b7],0xa);return _0x4e81e7;}static['getDimensionalIndex'](_0x5344d7){const _0x448cf2=_0x5344d7['toString']();if(_0x448cf2['length']<0x9)return null;const _0x50dba8=_0x448cf2['substring'](0x3,0x9),_0xd5d527=parseInt(_0x50dba8,0xa);return _0xd5d527-0x1;}static['isDuplicate'](_0x56e908,_0x358978){return this['getDigitAtIndex'](_0x56e908,_0x358978)<0x8;}static['isInactive'](_0x5e2b0){return this['getDigitAtIndex'](_0x5e2b0,0x2)<0x9;}static['isPrimed'](_0x14d19c,_0x14ca5f){return _0x14ca5f==0x1?_0x14d19c!=-0x5af3107a4000:this['getDigitAtIndex'](_0x14d19c,0x0)<0x9&&this['getDigitAtIndex'](_0x14d19c,0x1)<0x9;}static['verifySyntheticInteger'](_0xa60bb){const _0x5accbc=_0xa60bb['toString'](),_0x559253=parseInt(_0x5accbc[_0x5accbc['length']-0x1],0xa);if(_0x559253>0x0)throw new errors_1['CollationError'](_0xa60bb,0x2,'enter',collator_1['CollationFaultType']['INACTIVE']);else{if(_0xa60bb>=0x1e8480)throw new errors_1['CollationError'](_0xa60bb,0x2,'enter',collator_1['CollationFaultType']['DUPLICATE']);}}static['verifyInteger'](_0x1539db,_0x10a64d,_0x3160f3){let _0x41bf15;if(_0x10a64d===0x1&&_0x3160f3==='enter'){if(!this['isPrimed'](_0x1539db,0x1))_0x41bf15=collator_1['CollationFaultType']['MISSING'];else{if(this['isDuplicate'](_0x1539db,0x0))_0x41bf15=collator_1['CollationFaultType']['DUPLICATE'];else _0x1539db!=0x331a2bfa73000&&(_0x41bf15=collator_1['CollationFaultType']['INVALID']);}}else{if(_0x10a64d===0x1&&_0x3160f3==='exit'){if(_0x1539db===-0x9184e72a000)_0x41bf15=collator_1['CollationFaultType']['MISSING'];else this['isDuplicate'](_0x1539db,0x1)&&(_0x41bf15=collator_1['CollationFaultType']['DUPLICATE']);}else{if(_0x10a64d===0x2&&_0x3160f3==='enter'){if(!this['isPrimed'](_0x1539db,0x2))_0x41bf15=collator_1['CollationFaultType']['FORBIDDEN'];else this['isInactive'](_0x1539db)&&(_0x41bf15=collator_1['CollationFaultType']['INACTIVE']);}}}if(_0x41bf15)throw new errors_1['CollationError'](_0x1539db,_0x10a64d,_0x3160f3,_0x41bf15);}static['getDimensionsById'](_0x3fcc11,_0x4b11b6){const _0x17e7cc={'$ADJACENT':_0x4b11b6+',0'};let _0x4b96ba=_0x4b11b6;return _0x3fcc11['reverse']()['forEach'](_0x547464=>{_0x17e7cc[_0x547464]=_0x4b96ba,_0x4b96ba=_0x4b96ba['substring'](0x0,_0x4b96ba['lastIndexOf'](','));}),_0x17e7cc;}static['getSeed'](){return'999000000000000';}static['getTriggerSeed'](){return'888000001000001';}static['compile'](_0x48b80b){CollatorService['bindAncestorArray'](_0x48b80b);}static['bindAncestorArray'](_0x4c0922){_0x4c0922['forEach'](_0x20f8cf=>{const _0x9f1af2={},_0x33f88f=Object['keys'](_0x20f8cf['activities'])['find'](_0x4aba3a=>_0x20f8cf['activities'][_0x4aba3a]['type']==='trigger');if(!_0x33f88f)throw new Error('collator-trigger-activity-not-found');const _0x107674=(_0x4d4343,_0x3999af)=>{_0x9f1af2[_0x4d4343]=_0x3999af,_0x20f8cf['activities'][_0x4d4343]['ancestors']=_0x3999af;const _0x4f8857=_0x20f8cf['transitions']?.[_0x4d4343]||[];_0x4f8857['forEach'](_0x13ca05=>{_0x107674(_0x13ca05['to'],[..._0x3999af,_0x4d4343]);});};_0x107674(_0x33f88f,[]);});}static['getDimensionalSeed'](_0x348062=0x0){return','+_0x348062;}}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(_0x3cb55f,_0x1628e){const _0x3477a3=_0x1c02,_0x263714=_0x3cb55f();while(!![]){try{const _0x1688a6=parseInt(_0x3477a3(0x16b))/0x1+parseInt(_0x3477a3(0x164))/0x2+parseInt(_0x3477a3(0x168))/0x3*(-parseInt(_0x3477a3(0x162))/0x4)+-parseInt(_0x3477a3(0x163))/0x5*(parseInt(_0x3477a3(0x161))/0x6)+parseInt(_0x3477a3(0x167))/0x7*(-parseInt(_0x3477a3(0x16a))/0x8)+-parseInt(_0x3477a3(0x169))/0x9*(parseInt(_0x3477a3(0x165))/0xa)+-parseInt(_0x3477a3(0x166))/0xb*(-parseInt(_0x3477a3(0x160))/0xc);if(_0x1688a6===_0x1628e)break;else _0x263714['push'](_0x263714['shift']());}catch(_0x48b75e){_0x263714['push'](_0x263714['shift']());}}}(_0x45fa,0x34605));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Deployer']=void 0x0;const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),serializer_1=require('../serializer'),pipe_1=require('../pipe'),validator_1=require('./validator'),DEFAULT_METADATA_RANGE_SIZE=0x1a,DEFAULT_DATA_RANGE_SIZE=0x104,DEFAULT_RANGE_SIZE=DEFAULT_METADATA_RANGE_SIZE+DEFAULT_DATA_RANGE_SIZE;function _0x45fa(){const _0x53de22=['41462NSZiyB','210iIlKYF','494285ctIqlJ','14WMxENG','363MkgfzY','148518FtjWrD','162296UqMHTP','333513DhNAzq','288vxSRCy','2427786ijgWxF','14096RsQiLN','5zHawCI'];_0x45fa=function(){return _0x53de22;};return _0x45fa();}class Deployer{constructor(_0x36b6c0){this['manifest']=null,this['manifest']=_0x36b6c0;}async['deploy'](_0x4e90a7,_0x5bbafb){this['store']=_0x4e90a7,this['stream']=_0x5bbafb,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 _0x5d3b6f of this['manifest']['app']['graphs']){const [,_0x5de840]=this['findTrigger'](_0x5d3b6f),_0x3c6b72=_0x5de840['subscribes'],[_0x2cd7dc,_0x19ec46,_0x4076c1]=await this['store']['reserveSymbolRange']('$'+_0x3c6b72,DEFAULT_RANGE_SIZE,'JOB'),_0x3dac4e='',_0x1acfdb=this['bindSymbols'](_0x2cd7dc,_0x19ec46,_0x4076c1,_0x3dac4e,_0x5de840['PRODUCES']);Object['keys'](_0x1acfdb)['length']&&await this['store']['addSymbols']('$'+_0x3c6b72,_0x1acfdb);for(const [_0x58f4e8,_0x2ec42e]of Object['entries'](_0x5d3b6f['activities'])){const [_0x7c1f2c,_0x276cfb,_0x157625]=await this['store']['reserveSymbolRange'](_0x58f4e8,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x288970=_0x58f4e8+'/';this['bindSelf'](_0x2ec42e['consumes'],_0x2ec42e['produces'],_0x58f4e8);const _0x44575f=this['bindSymbols'](_0x7c1f2c,_0x276cfb,_0x157625,_0x288970,_0x2ec42e['produces']);Object['keys'](_0x44575f)['length']&&await this['store']['addSymbols'](_0x58f4e8,_0x44575f);}}}['bindSelf'](_0x523348,_0xa16667,_0x61f113){for(const _0x307a83 of[_0x61f113,'$self']){const _0x8bab42=_0x523348[_0x307a83];if(_0x8bab42)for(const _0x2f4918 of _0x8bab42){!_0xa16667['includes'](_0x2f4918)&&_0xa16667['push'](_0x2f4918);}}}['bindSymbols'](_0x2f72d9,_0x31b9b6,_0x1e1125,_0x51a792,_0x467ba3){const _0x5d23d0={},_0x24421c={..._0x1e1125};for(const _0x147e8d of _0x467ba3){const _0x292a56=''+_0x51a792+_0x147e8d;if(!_0x24421c[_0x292a56]){if(_0x2f72d9>_0x31b9b6)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x8ddbf0=(0x0,utils_1['getSymKey'])(_0x2f72d9);_0x2f72d9++,_0x5d23d0[_0x292a56]=_0x8ddbf0,_0x24421c[_0x292a56]=_0x8ddbf0;}}return _0x5d23d0;}['copyJobSchemas'](){const _0x5b6c32=this['manifest']['app']['graphs'];for(const _0xb59bd7 of _0x5b6c32){const _0x4eec89=_0xb59bd7['output']?.['schema'],_0x15b479=_0xb59bd7['input']?.['schema'];if(!_0x4eec89&&!_0x15b479)continue;const _0x180cb1=_0xb59bd7['activities'];for(const _0x17630d in _0x180cb1){if(_0x180cb1[_0x17630d]['type']==='trigger'){const _0x80488d=_0x180cb1[_0x17630d];_0x4eec89&&(!_0x80488d['job']&&(_0x80488d['job']={}),_0x80488d['job']['schema']=_0x4eec89),_0x15b479&&(_0x80488d['output']={'schema':_0x15b479});}}}}['bindBackRefs'](){for(const _0x183f93 of this['manifest']['app']['graphs']){const _0x4811bd=_0x183f93['activities'],_0x986774=this['findTrigger'](_0x183f93)[0x0];for(const _0x2d6547 in _0x4811bd){_0x4811bd[_0x2d6547]['trigger']=_0x986774,_0x4811bd[_0x2d6547]['subscribes']=_0x183f93['subscribes'],_0x183f93['publishes']&&(_0x4811bd[_0x2d6547]['publishes']=_0x183f93['publishes']),_0x4811bd[_0x2d6547]['expire']=_0x183f93['expire']??undefined,_0x4811bd[_0x2d6547]['persistent']=_0x183f93['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x3ee136 of this['manifest']['app']['graphs']){const _0x31ba7e=_0x3ee136['activities'];for(const _0x3d6ed5 in _0x31ba7e){const _0x22f4e5=_0x31ba7e[_0x3d6ed5];_0x22f4e5['type']==='cycle'&&(_0x31ba7e[_0x22f4e5['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x4b821a of this['manifest']['app']['graphs']){const _0xf8d041=_0x4b821a['activities'];for(const _0x8c5102 in _0xf8d041){const _0x52c36b=_0xf8d041[_0x8c5102];['worker','await']['includes'](_0x52c36b['type'])&&_0x52c36b['topic']&&!_0x52c36b['subtype']&&(_0x52c36b['subtype']=_0x52c36b['topic']);}}}['convertActivitiesToHooks'](){for(const _0x45e489 of this['manifest']['app']['graphs']){const _0x4742df=_0x45e489['activities'];for(const _0x28c6f2 in _0x4742df){const _0x1d9387=_0x4742df[_0x28c6f2];['activity']['includes'](_0x1d9387['type'])&&(_0x1d9387['type']='hook');}}}async['bindParents'](){const _0x4d62ee=this['manifest']['app']['graphs'];for(const _0x35f252 of _0x4d62ee){if(_0x35f252['transitions'])for(const _0x3b428d in _0x35f252['transitions']){const _0x5cf94c=_0x35f252['transitions'][_0x3b428d];for(const _0x3247bc of _0x5cf94c){const _0x4cc601=_0x3247bc['to'];_0x35f252['activities'][_0x4cc601]['parent']=_0x3b428d;}_0x35f252['activities'][_0x3b428d]['transitions']=_0x5cf94c;}}}['collectValues'](_0xb614df,_0x3bbab1){for(const [_0x597a3e,_0x59b41a]of Object['entries'](_0xb614df)){if(_0x597a3e==='enum'||_0x597a3e==='examples'||_0x597a3e==='default'){if(Array['isArray'](_0x59b41a))for(const _0x57afb8 of _0x59b41a){typeof _0x57afb8==='string'&&_0x57afb8['length']>0x5&&_0x3bbab1['add'](_0x57afb8);}else typeof _0x59b41a==='string'&&_0x59b41a['length']>0x5&&_0x3bbab1['add'](_0x59b41a);}else typeof _0x59b41a==='object'&&this['collectValues'](_0x59b41a,_0x3bbab1);}}['traverse'](_0x356724,_0x36245b){for(const _0x499708 of Object['values'](_0x356724)){typeof _0x499708==='object'&&('schema'in _0x499708?this['collectValues'](_0x499708['schema'],_0x36245b):this['traverse'](_0x499708,_0x36245b));}}async['generateSymVals'](){const _0x248518=new Set();for(const _0x45b304 of this['manifest']['app']['graphs']){this['traverse'](_0x45b304,_0x248518);}const _0x3fe54a=await this['store']['getSymbolValues'](),_0x11396c=Object['keys'](_0x3fe54a)['length'],_0x25a01c=Math['pow'](0x34,0x2)-0x1,_0x53ae08=serializer_1['SerializerService']['filterSymVals'](_0x11396c,_0x25a01c,_0x3fe54a,_0x248518);await this['store']['addSymbolValues'](_0x53ae08);}['resolveJobMapsPaths'](){function _0x2fa649(_0x533435){const _0x5cfeca=[];function _0xf5e1b(_0x958658,_0x3e84c2=[]){for(const _0x40a4b3 in _0x958658){if(typeof _0x958658[_0x40a4b3]==='object'&&_0x958658[_0x40a4b3]!==null&&!('@pipe'in _0x958658[_0x40a4b3])){const _0x100f2f=[..._0x3e84c2,_0x40a4b3];_0xf5e1b(_0x958658[_0x40a4b3],_0x100f2f);}else{const _0x9abf33=[..._0x3e84c2,_0x40a4b3]['join']('/');if(!_0x9abf33['includes']('[')){const _0x4d7001='data/'+_0x9abf33;!_0x5cfeca['includes'](_0x4d7001)&&_0x5cfeca['push'](_0x4d7001);}else{const [_0x1c9428,_0x270197]=_0x9abf33['split']('['),[_0x5adc04,_0x2b6af2]=_0x270197['split'](']');if(!isNaN(parseInt(_0x5adc04)))for(let _0x52c9b4=0x0;_0x52c9b4<parseInt(_0x5adc04);_0x52c9b4++){const _0x27aac2='data/'+_0x1c9428+'/'+_0x52c9b4;!_0x5cfeca['includes'](_0x27aac2)&&_0x5cfeca['push'](_0x27aac2);}}}}}return _0x533435&&_0xf5e1b(_0x533435),_0x5cfeca;}for(const _0xafd750 of this['manifest']['app']['graphs']){let _0x5681c5=[];const [,_0x481777]=this['findTrigger'](_0xafd750);for(const _0x1a43ef in _0xafd750['activities']){const _0x1dde8a=_0xafd750['activities'][_0x1a43ef];_0x5681c5=_0x5681c5['concat'](_0x2fa649(_0x1dde8a['job']?.['maps']));}_0x481777['PRODUCES']=_0x5681c5;}}['resolveMappingDependencies'](){const _0x1d78c8=[];function _0x30931d(_0x5441f7,_0x1cfe08){for(const _0x1b6552 in _0x5441f7){if(typeof _0x5441f7[_0x1b6552]==='string'){const _0x4cdaa9=_0x5441f7[_0x1b6552],_0x1c96ca=_0x4cdaa9['match'](/^\{[^@].*}$/);_0x1c96ca&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x4cdaa9)&&(_0x4cdaa9['split']('.')[0x1]!=='input'&&(_0x1d78c8['push'](_0x4cdaa9),_0x1cfe08['push'](_0x4cdaa9)));}else typeof _0x5441f7[_0x1b6552]==='object'&&_0x5441f7[_0x1b6552]!==null&&_0x30931d(_0x5441f7[_0x1b6552],_0x1cfe08);}}const _0x246dee=this['manifest']['app']['graphs'];for(const _0x483977 of _0x246dee){const _0xf692e2=_0x483977['activities'];for(const _0x187831 in _0xf692e2){const _0x369866=_0xf692e2[_0x187831];_0x369866['consumes']=[],_0x30931d(_0x369866,_0x369866['consumes']),_0x369866['consumes']=this['groupMappingRules'](_0x369866['consumes']);}}const _0x2ec2c7=this['groupMappingRules'](_0x1d78c8);for(const _0x194b5e of _0x246dee){const _0x2b8160=_0x194b5e['activities'];for(const _0x4e2ebb in _0x2b8160){const _0x5d056b=_0x2b8160[_0x4e2ebb];_0x5d056b['produces']=_0x2ec2c7[''+_0x4e2ebb]||[];}}}['groupMappingRules'](_0x5d9471){_0x5d9471=Array['from'](new Set(_0x5d9471))['sort']();const _0x395ff0={};for(const _0x2be76e of _0x5d9471){const [_0x5b6d48,_0x50b088]=this['resolveMappableValue'](_0x2be76e);!_0x395ff0[_0x5b6d48]&&(_0x395ff0[_0x5b6d48]=[]),_0x395ff0[_0x5b6d48]['push'](_0x50b088);}return _0x395ff0;}['resolveMappableValue'](_0x528b48){_0x528b48=_0x528b48['substring'](0x1,_0x528b48['length']-0x1);const _0x5ac302=_0x528b48['split']('.');if(_0x5ac302[0x0]==='$job'){const [_0xb279d,..._0x3c4038]=_0x5ac302;return[_0xb279d,_0x3c4038['join']('/')];}else{const [_0x596b14,_0x5c1250,_0x4fee57,..._0x1572b3]=_0x5ac302,_0x225df5={'hook':'hook/data','input':'input/data','output':_0x4fee57==='data'?'output/data':'output/metadata'}[_0x5c1250];return[_0x596b14,_0x225df5+'/'+_0x1572b3['join']('/')];}}async['deployActivitySchemas'](){const _0x35ed8a=this['manifest']['app']['graphs'],_0x42652b={};for(const _0x13221c of _0x35ed8a){const _0x5bf15e=_0x13221c['activities'];for(const _0x43996e in _0x5bf15e){const _0x1962f3=_0x5bf15e[_0x43996e];delete _0x1962f3['transitions'],_0x42652b[_0x43996e]=_0x1962f3;}}await this['store']['setSchemas'](_0x42652b,this['getVID']());}async['deploySubscriptions'](){const _0x452b0a=this['manifest']['app']['graphs'],_0x4cfeed={};for(const _0x161dea of _0x452b0a){const _0x290abd=_0x161dea['activities'],_0xcc9b78=_0x161dea['subscribes'];for(const _0x12ca8c in _0x290abd){if(_0x290abd[_0x12ca8c]['type']==='trigger'){_0x4cfeed[_0xcc9b78]=_0x12ca8c;break;}}}await this['store']['setSubscriptions'](_0x4cfeed,this['getVID']());}['findTrigger'](_0x5479ad){for(const _0x53eb8b in _0x5479ad['activities']){const _0x57b78a=_0x5479ad['activities'][_0x53eb8b];if(_0x57b78a['type']==='trigger')return[_0x53eb8b,_0x57b78a];}return null;}async['deployTransitions'](){const _0x5e7d5c=this['manifest']['app']['graphs'],_0x4b96b4={};for(const _0x47b403 of _0x5e7d5c){if(_0x47b403['subscribes']&&_0x47b403['subscribes']['startsWith']('.')){const [_0x21365f]=this['findTrigger'](_0x47b403);_0x21365f&&(_0x4b96b4[_0x47b403['subscribes']]={[_0x21365f]:!![]});}if(_0x47b403['transitions'])for(const _0x60a097 in _0x47b403['transitions']){const _0x2e1f54=_0x47b403['transitions'][_0x60a097],_0x30af88={};for(const _0x10f096 of _0x2e1f54){const _0xab9958=_0x10f096['to'];_0x10f096['conditions']?_0x30af88[_0xab9958]=_0x10f096['conditions']:_0x30af88[_0xab9958]=!![];}Object['keys'](_0x30af88)['length']>0x0&&(_0x4b96b4['.'+_0x60a097]=_0x30af88);}}await this['store']['setTransitions'](_0x4b96b4,this['getVID']());}async['deployHookPatterns'](){const _0x33589a=this['manifest']['app']['graphs'],_0x558f5c={};for(const _0x4c692f of _0x33589a){if(_0x4c692f['hooks'])for(const _0x1554db in _0x4c692f['hooks']){_0x558f5c[_0x1554db]=_0x4c692f['hooks'][_0x1554db];const _0x2671dc=_0x4c692f['hooks'][_0x1554db][0x0]['to'],_0x559371=_0x4c692f['activities'][_0x2671dc];_0x559371&&(!_0x559371['hook']&&(_0x559371['hook']={}),_0x559371['hook']['topic']=_0x1554db);}}await this['store']['setHookRules'](_0x558f5c);}async['deployConsumerGroups'](){const _0xbda29d={'appId':this['manifest']['app']['id']},_0x1b87a8=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0xbda29d);await this['deployConsumerGroup'](_0x1b87a8,'ENGINE');for(const _0x3bd108 of this['manifest']['app']['graphs']){const _0x53f907=_0x3bd108['activities'];for(const _0x49f792 in _0x53f907){const _0x2b03b3=_0x53f907[_0x49f792];if(_0x2b03b3['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x2b03b3['subtype'],{})===_0x2b03b3['subtype']){_0xbda29d['topic']=_0x2b03b3['subtype'];const _0x591597=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0xbda29d);await this['deployConsumerGroup'](_0x591597,'WORKER');}}}}async['deployConsumerGroup'](_0x10cdca,_0x5b3af3){try{await this['stream']['createConsumerGroup'](_0x10cdca,_0x5b3af3);}catch(_0x217eac){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x10cdca,'group':_0x5b3af3});}}}function _0x1c02(_0x479911,_0x5e283c){const _0x45fa8d=_0x45fa();return _0x1c02=function(_0x1c02d2,_0x45720f){_0x1c02d2=_0x1c02d2-0x160;let _0x6d3b74=_0x45fa8d[_0x1c02d2];return _0x6d3b74;},_0x1c02(_0x479911,_0x5e283c);}exports['Deployer']=Deployer;
|
|
1
|
+
'use strict';function _0x747b(_0x31416c,_0x40325a){const _0x50949d=_0x5094();return _0x747b=function(_0x747ba6,_0x4155e9){_0x747ba6=_0x747ba6-0x15e;let _0x5612ec=_0x50949d[_0x747ba6];return _0x5612ec;},_0x747b(_0x31416c,_0x40325a);}(function(_0x21ab5a,_0x46173c){const _0x1f24f7=_0x747b,_0x57cff2=_0x21ab5a();while(!![]){try{const _0x3043ca=-parseInt(_0x1f24f7(0x161))/0x1+-parseInt(_0x1f24f7(0x163))/0x2+-parseInt(_0x1f24f7(0x160))/0x3+parseInt(_0x1f24f7(0x15e))/0x4+parseInt(_0x1f24f7(0x164))/0x5+-parseInt(_0x1f24f7(0x15f))/0x6+parseInt(_0x1f24f7(0x162))/0x7;if(_0x3043ca===_0x46173c)break;else _0x57cff2['push'](_0x57cff2['shift']());}catch(_0x74f12d){_0x57cff2['push'](_0x57cff2['shift']());}}}(_0x5094,0x9754f));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Deployer']=void 0x0;function _0x5094(){const _0x983a39=['4389560CbRXln','5355972tyLlNU','2033751Uxdgtb','634345ctvZqc','3647420SfiGVs','14376NXNKCs','6067585oObxdr'];_0x5094=function(){return _0x983a39;};return _0x5094();}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(_0x389df1){this['manifest']=null,this['manifest']=_0x389df1;}async['deploy'](_0x31242c,_0x43990a){this['store']=_0x31242c,this['stream']=_0x43990a,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 _0x4d22e4 of this['manifest']['app']['graphs']){const [,_0x139367]=this['findTrigger'](_0x4d22e4),_0xf29d64=_0x139367['subscribes'],[_0x490468,_0x58eb5e,_0xccfe79]=await this['store']['reserveSymbolRange']('$'+_0xf29d64,DEFAULT_RANGE_SIZE,'JOB'),_0xa1766c='',_0x36ace3=this['bindSymbols'](_0x490468,_0x58eb5e,_0xccfe79,_0xa1766c,_0x139367['PRODUCES']);Object['keys'](_0x36ace3)['length']&&await this['store']['addSymbols']('$'+_0xf29d64,_0x36ace3);for(const [_0x4daf8a,_0x24c677]of Object['entries'](_0x4d22e4['activities'])){const [_0x4d9872,_0x2485d8,_0x444f48]=await this['store']['reserveSymbolRange'](_0x4daf8a,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x4541fb=_0x4daf8a+'/';this['bindSelf'](_0x24c677['consumes'],_0x24c677['produces'],_0x4daf8a);const _0x4a3e15=this['bindSymbols'](_0x4d9872,_0x2485d8,_0x444f48,_0x4541fb,_0x24c677['produces']);Object['keys'](_0x4a3e15)['length']&&await this['store']['addSymbols'](_0x4daf8a,_0x4a3e15);}}}['bindSelf'](_0x4c25cf,_0xbb54f0,_0x3ebbd3){for(const _0xde0aea of[_0x3ebbd3,'$self']){const _0x243067=_0x4c25cf[_0xde0aea];if(_0x243067)for(const _0x490ec4 of _0x243067){!_0xbb54f0['includes'](_0x490ec4)&&_0xbb54f0['push'](_0x490ec4);}}}['bindSymbols'](_0x5da448,_0x5773b9,_0xc6bf47,_0x362b64,_0x30b482){const _0x423554={},_0x462950={..._0xc6bf47};for(const _0x2e5ee9 of _0x30b482){const _0x508ac6=''+_0x362b64+_0x2e5ee9;if(!_0x462950[_0x508ac6]){if(_0x5da448>_0x5773b9)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x3a3652=(0x0,utils_1['getSymKey'])(_0x5da448);_0x5da448++,_0x423554[_0x508ac6]=_0x3a3652,_0x462950[_0x508ac6]=_0x3a3652;}}return _0x423554;}['copyJobSchemas'](){const _0x53b9f6=this['manifest']['app']['graphs'];for(const _0x2cf0ed of _0x53b9f6){const _0x35a290=_0x2cf0ed['output']?.['schema'],_0x2bc874=_0x2cf0ed['input']?.['schema'];if(!_0x35a290&&!_0x2bc874)continue;const _0x18f4b1=_0x2cf0ed['activities'];for(const _0x162812 in _0x18f4b1){if(_0x18f4b1[_0x162812]['type']==='trigger'){const _0x1d1b28=_0x18f4b1[_0x162812];_0x35a290&&(!_0x1d1b28['job']&&(_0x1d1b28['job']={}),_0x1d1b28['job']['schema']=_0x35a290),_0x2bc874&&(_0x1d1b28['output']={'schema':_0x2bc874});}}}}['bindBackRefs'](){for(const _0x4c116b of this['manifest']['app']['graphs']){const _0x5967bc=_0x4c116b['activities'],_0x2a729f=this['findTrigger'](_0x4c116b)[0x0];for(const _0x4bbd8d in _0x5967bc){_0x5967bc[_0x4bbd8d]['trigger']=_0x2a729f,_0x5967bc[_0x4bbd8d]['subscribes']=_0x4c116b['subscribes'],_0x4c116b['publishes']&&(_0x5967bc[_0x4bbd8d]['publishes']=_0x4c116b['publishes']),_0x5967bc[_0x4bbd8d]['expire']=_0x4c116b['expire']??undefined,_0x5967bc[_0x4bbd8d]['persistent']=_0x4c116b['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x747ad9 of this['manifest']['app']['graphs']){const _0xa0067d=_0x747ad9['activities'];for(const _0x498e0c in _0xa0067d){const _0x6a54e1=_0xa0067d[_0x498e0c];_0x6a54e1['type']==='cycle'&&(_0xa0067d[_0x6a54e1['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0xf9f610 of this['manifest']['app']['graphs']){const _0x47ce9e=_0xf9f610['activities'];for(const _0x6deffe in _0x47ce9e){const _0x255669=_0x47ce9e[_0x6deffe];['worker','await']['includes'](_0x255669['type'])&&_0x255669['topic']&&!_0x255669['subtype']&&(_0x255669['subtype']=_0x255669['topic']);}}}['convertActivitiesToHooks'](){for(const _0x48f7d5 of this['manifest']['app']['graphs']){const _0x3c6033=_0x48f7d5['activities'];for(const _0x398ec9 in _0x3c6033){const _0x1c6cf6=_0x3c6033[_0x398ec9];['activity']['includes'](_0x1c6cf6['type'])&&(_0x1c6cf6['type']='hook');}}}async['bindParents'](){const _0x1caf18=this['manifest']['app']['graphs'];for(const _0x532350 of _0x1caf18){if(_0x532350['transitions'])for(const _0x1fab3e in _0x532350['transitions']){const _0x3b3efb=_0x532350['transitions'][_0x1fab3e];for(const _0x1c5171 of _0x3b3efb){const _0x177717=_0x1c5171['to'];_0x532350['activities'][_0x177717]['parent']=_0x1fab3e;}_0x532350['activities'][_0x1fab3e]['transitions']=_0x3b3efb;}}}['collectValues'](_0x1ca384,_0x504688){for(const [_0x1c37b6,_0x32ed33]of Object['entries'](_0x1ca384)){if(_0x1c37b6==='enum'||_0x1c37b6==='examples'||_0x1c37b6==='default'){if(Array['isArray'](_0x32ed33))for(const _0x2c6b51 of _0x32ed33){typeof _0x2c6b51==='string'&&_0x2c6b51['length']>0x5&&_0x504688['add'](_0x2c6b51);}else typeof _0x32ed33==='string'&&_0x32ed33['length']>0x5&&_0x504688['add'](_0x32ed33);}else typeof _0x32ed33==='object'&&this['collectValues'](_0x32ed33,_0x504688);}}['traverse'](_0xf7e8a9,_0x3bf59f){for(const _0x389f7d of Object['values'](_0xf7e8a9)){typeof _0x389f7d==='object'&&('schema'in _0x389f7d?this['collectValues'](_0x389f7d['schema'],_0x3bf59f):this['traverse'](_0x389f7d,_0x3bf59f));}}async['generateSymVals'](){const _0x4ad45d=new Set();for(const _0x39e62d of this['manifest']['app']['graphs']){this['traverse'](_0x39e62d,_0x4ad45d);}const _0x378fa0=await this['store']['getSymbolValues'](),_0x1ab8a9=Object['keys'](_0x378fa0)['length'],_0x11b445=Math['pow'](0x34,0x2)-0x1,_0x1aba1d=serializer_1['SerializerService']['filterSymVals'](_0x1ab8a9,_0x11b445,_0x378fa0,_0x4ad45d);await this['store']['addSymbolValues'](_0x1aba1d);}['resolveJobMapsPaths'](){function _0x159b38(_0x100121){const _0x5030c2=[];function _0x4f9c73(_0x118137,_0x29af85=[]){for(const _0x61d80a in _0x118137){if(typeof _0x118137[_0x61d80a]==='object'&&_0x118137[_0x61d80a]!==null&&!('@pipe'in _0x118137[_0x61d80a])){const _0x5127f1=[..._0x29af85,_0x61d80a];_0x4f9c73(_0x118137[_0x61d80a],_0x5127f1);}else{const _0x574677=[..._0x29af85,_0x61d80a]['join']('/');if(!_0x574677['includes']('[')){const _0x379288='data/'+_0x574677;!_0x5030c2['includes'](_0x379288)&&_0x5030c2['push'](_0x379288);}else{const [_0x318eaf,_0x247340]=_0x574677['split']('['),[_0x5ed879,_0x5e06ed]=_0x247340['split'](']');if(!isNaN(parseInt(_0x5ed879)))for(let _0x10ec07=0x0;_0x10ec07<parseInt(_0x5ed879);_0x10ec07++){const _0x3e0561='data/'+_0x318eaf+'/'+_0x10ec07;!_0x5030c2['includes'](_0x3e0561)&&_0x5030c2['push'](_0x3e0561);}}}}}return _0x100121&&_0x4f9c73(_0x100121),_0x5030c2;}for(const _0x13c812 of this['manifest']['app']['graphs']){let _0x4f659b=[];const [,_0x32a700]=this['findTrigger'](_0x13c812);for(const _0x10e6c9 in _0x13c812['activities']){const _0x43e066=_0x13c812['activities'][_0x10e6c9];_0x4f659b=_0x4f659b['concat'](_0x159b38(_0x43e066['job']?.['maps']));}_0x32a700['PRODUCES']=_0x4f659b;}}['resolveMappingDependencies'](){const _0x29cd43=[];function _0x4e98b1(_0x3755ee,_0x45dc99){for(const _0xd892db in _0x3755ee){if(typeof _0x3755ee[_0xd892db]==='string'){const _0x24b471=_0x3755ee[_0xd892db],_0x3c3e0a=_0x24b471['match'](/^\{[^@].*}$/);_0x3c3e0a&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x24b471)&&(_0x24b471['split']('.')[0x1]!=='input'&&(_0x29cd43['push'](_0x24b471),_0x45dc99['push'](_0x24b471)));}else typeof _0x3755ee[_0xd892db]==='object'&&_0x3755ee[_0xd892db]!==null&&_0x4e98b1(_0x3755ee[_0xd892db],_0x45dc99);}}const _0x315af5=this['manifest']['app']['graphs'];for(const _0x35f675 of _0x315af5){const _0x5110c7=_0x35f675['activities'];for(const _0x14d31e in _0x5110c7){const _0x4ee619=_0x5110c7[_0x14d31e];_0x4ee619['consumes']=[],_0x4e98b1(_0x4ee619,_0x4ee619['consumes']),_0x4ee619['consumes']=this['groupMappingRules'](_0x4ee619['consumes']);}}const _0x22ba03=this['groupMappingRules'](_0x29cd43);for(const _0x4e0dbf of _0x315af5){const _0x7f4f65=_0x4e0dbf['activities'];for(const _0x363972 in _0x7f4f65){const _0x6cd34=_0x7f4f65[_0x363972];_0x6cd34['produces']=_0x22ba03[''+_0x363972]||[];}}}['groupMappingRules'](_0xec74ca){_0xec74ca=Array['from'](new Set(_0xec74ca))['sort']();const _0x800d1c={};for(const _0x1a6b5d of _0xec74ca){const [_0x4eba66,_0x324283]=this['resolveMappableValue'](_0x1a6b5d);!_0x800d1c[_0x4eba66]&&(_0x800d1c[_0x4eba66]=[]),_0x800d1c[_0x4eba66]['push'](_0x324283);}return _0x800d1c;}['resolveMappableValue'](_0x5b627a){_0x5b627a=_0x5b627a['substring'](0x1,_0x5b627a['length']-0x1);const _0x2fc355=_0x5b627a['split']('.');if(_0x2fc355[0x0]==='$job'){const [_0x272f9e,..._0x4df865]=_0x2fc355;return[_0x272f9e,_0x4df865['join']('/')];}else{const [_0x4e614c,_0x364b42,_0x356787,..._0x2c2d30]=_0x2fc355,_0x15853a={'hook':'hook/data','input':'input/data','output':_0x356787==='data'?'output/data':'output/metadata'}[_0x364b42];return[_0x4e614c,_0x15853a+'/'+_0x2c2d30['join']('/')];}}async['deployActivitySchemas'](){const _0x1f03cc=this['manifest']['app']['graphs'],_0x2a9473={};for(const _0x4f8b45 of _0x1f03cc){const _0x13f26f=_0x4f8b45['activities'];for(const _0x5728ad in _0x13f26f){const _0x784669=_0x13f26f[_0x5728ad];delete _0x784669['transitions'],_0x2a9473[_0x5728ad]=_0x784669;}}await this['store']['setSchemas'](_0x2a9473,this['getVID']());}async['deploySubscriptions'](){const _0xa93512=this['manifest']['app']['graphs'],_0x5cbbbc={};for(const _0x2a3527 of _0xa93512){const _0x292a1a=_0x2a3527['activities'],_0x20928c=_0x2a3527['subscribes'];for(const _0x57ccb6 in _0x292a1a){if(_0x292a1a[_0x57ccb6]['type']==='trigger'){_0x5cbbbc[_0x20928c]=_0x57ccb6;break;}}}await this['store']['setSubscriptions'](_0x5cbbbc,this['getVID']());}['findTrigger'](_0x588069){for(const _0x29f222 in _0x588069['activities']){const _0x3d7e7f=_0x588069['activities'][_0x29f222];if(_0x3d7e7f['type']==='trigger')return[_0x29f222,_0x3d7e7f];}return null;}async['deployTransitions'](){const _0x44b023=this['manifest']['app']['graphs'],_0x3d24fd={};for(const _0xf6e1a1 of _0x44b023){if(_0xf6e1a1['subscribes']&&_0xf6e1a1['subscribes']['startsWith']('.')){const [_0x106d20]=this['findTrigger'](_0xf6e1a1);_0x106d20&&(_0x3d24fd[_0xf6e1a1['subscribes']]={[_0x106d20]:!![]});}if(_0xf6e1a1['transitions'])for(const _0x1a04a4 in _0xf6e1a1['transitions']){const _0x424fcc=_0xf6e1a1['transitions'][_0x1a04a4],_0x5ef595={};for(const _0x27b7df of _0x424fcc){const _0x16eb27=_0x27b7df['to'];_0x27b7df['conditions']?_0x5ef595[_0x16eb27]=_0x27b7df['conditions']:_0x5ef595[_0x16eb27]=!![];}Object['keys'](_0x5ef595)['length']>0x0&&(_0x3d24fd['.'+_0x1a04a4]=_0x5ef595);}}await this['store']['setTransitions'](_0x3d24fd,this['getVID']());}async['deployHookPatterns'](){const _0x456556=this['manifest']['app']['graphs'],_0x5bf22f={};for(const _0x956df3 of _0x456556){if(_0x956df3['hooks'])for(const _0x4de3fe in _0x956df3['hooks']){_0x5bf22f[_0x4de3fe]=_0x956df3['hooks'][_0x4de3fe];const _0x2f1cef=_0x956df3['hooks'][_0x4de3fe][0x0]['to'],_0x43598e=_0x956df3['activities'][_0x2f1cef];_0x43598e&&(!_0x43598e['hook']&&(_0x43598e['hook']={}),_0x43598e['hook']['topic']=_0x4de3fe);}}await this['store']['setHookRules'](_0x5bf22f);}async['deployConsumerGroups'](){const _0x53c8f8={'appId':this['manifest']['app']['id']},_0x443a85=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x53c8f8);await this['deployConsumerGroup'](_0x443a85,'ENGINE');for(const _0x16f2c4 of this['manifest']['app']['graphs']){const _0x66df5f=_0x16f2c4['activities'];for(const _0x5b5ad0 in _0x66df5f){const _0x3b829a=_0x66df5f[_0x5b5ad0];if(_0x3b829a['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x3b829a['subtype'],{})===_0x3b829a['subtype']){_0x53c8f8['topic']=_0x3b829a['subtype'];const _0x2bd3bd=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x53c8f8);await this['deployConsumerGroup'](_0x2bd3bd,'WORKER');}}}}async['deployConsumerGroup'](_0x445edc,_0x48d265){try{await this['stream']['createConsumerGroup'](_0x445edc,_0x48d265);}catch(_0x4254e1){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x445edc,'group':_0x48d265});}}}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(_0x20a2bf,_0x208e1c){const _0x242f7e=_0x3be4,_0x3287a3=_0x20a2bf();while(!![]){try{const _0x16ad49=parseInt(_0x242f7e(0x125))/0x1*(parseInt(_0x242f7e(0x128))/0x2)+-parseInt(_0x242f7e(0x126))/0x3+parseInt(_0x242f7e(0x12c))/0x4+-parseInt(_0x242f7e(0x12a))/0x5*(parseInt(_0x242f7e(0x129))/0x6)+-parseInt(_0x242f7e(0x123))/0x7*(-parseInt(_0x242f7e(0x124))/0x8)+-parseInt(_0x242f7e(0x127))/0x9+parseInt(_0x242f7e(0x12b))/0xa;if(_0x16ad49===_0x208e1c)break;else _0x3287a3['push'](_0x3287a3['shift']());}catch(_0x569eea){_0x3287a3['push'](_0x3287a3['shift']());}}}(_0x3b5f,0x4d1e4));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x14c9f7,_0x811f53,_0x2ce7d4,_0x140498){if(_0x140498===undefined)_0x140498=_0x2ce7d4;var _0xd708ba=Object['getOwnPropertyDescriptor'](_0x811f53,_0x2ce7d4);(!_0xd708ba||('get'in _0xd708ba?!_0x811f53['__esModule']:_0xd708ba['writable']||_0xd708ba['configurable']))&&(_0xd708ba={'enumerable':!![],'get':function(){return _0x811f53[_0x2ce7d4];}}),Object['defineProperty'](_0x14c9f7,_0x140498,_0xd708ba);}:function(_0x5b3be7,_0x2daf33,_0x5f2d16,_0x2e1108){if(_0x2e1108===undefined)_0x2e1108=_0x5f2d16;_0x5b3be7[_0x2e1108]=_0x2daf33[_0x5f2d16];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x291993,_0x15e999){Object['defineProperty'](_0x291993,'default',{'enumerable':!![],'value':_0x15e999});}:function(_0x11d08b,_0x432374){_0x11d08b['default']=_0x432374;}),__importStar=this&&this['__importStar']||function(_0x1b5ab4){if(_0x1b5ab4&&_0x1b5ab4['__esModule'])return _0x1b5ab4;var _0x59f9a5={};if(_0x1b5ab4!=null){for(var _0x315b9c in _0x1b5ab4)if(_0x315b9c!=='default'&&Object['prototype']['hasOwnProperty']['call'](_0x1b5ab4,_0x315b9c))__createBinding(_0x59f9a5,_0x1b5ab4,_0x315b9c);}return __setModuleDefault(_0x59f9a5,_0x1b5ab4),_0x59f9a5;},__importDefault=this&&this['__importDefault']||function(_0x4b198c){return _0x4b198c&&_0x4b198c['__esModule']?_0x4b198c:{'default':_0x4b198c};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CompilerService']=void 0x0;const fs=__importStar(require('fs/promises')),path=__importStar(require('path')),json_schema_ref_parser_1=__importDefault(require('@apidevtools/json-schema-ref-parser')),js_yaml_1=__importDefault(require('js-yaml')),deployer_1=require('./deployer'),validator_1=require('./validator');function _0x3b5f(){const _0x2f7f0f=['6311yWhdKq','642756SgkHwI','540216qlhaDZ','172xhFcjZ','30bhQFgt','541110ojTaXp','170540wGvXRb','1543304NyHgSx','14JOGClb','742544odPMNk'];_0x3b5f=function(){return _0x2f7f0f;};return _0x3b5f();}function _0x3be4(_0x238924,_0xee953c){const _0x3b5ff6=_0x3b5f();return _0x3be4=function(_0x3be4af,_0x2a2138){_0x3be4af=_0x3be4af-0x123;let _0x2fb22e=_0x3b5ff6[_0x3be4af];return _0x2fb22e;},_0x3be4(_0x238924,_0xee953c);}class CompilerService{constructor(_0x4db1b0,_0x389184,_0x5045b3){this['store']=_0x4db1b0,this['stream']=_0x389184,this['logger']=_0x5045b3;}async['plan'](_0x49f479){try{let _0x41a0e2;this['isPath'](_0x49f479)?_0x41a0e2=await json_schema_ref_parser_1['default']['dereference'](_0x49f479):_0x41a0e2=js_yaml_1['default']['load'](_0x49f479);const _0x5c9e34=new validator_1['Validator'](_0x41a0e2);return _0x5c9e34['validate'](this['store']),_0x41a0e2;}catch(_0x347d17){this['logger']['error']('compiler-plan-error',_0x347d17);}}['isPath'](_0x2cd26a){return!_0x2cd26a['trim']()['startsWith']('app:');}async['deploy'](_0x2c86ea){try{let _0x33814b;this['isPath'](_0x2c86ea)?(_0x33814b=await json_schema_ref_parser_1['default']['dereference'](_0x2c86ea),await this['saveAsJSON'](_0x2c86ea,_0x33814b)):_0x33814b=js_yaml_1['default']['load'](_0x2c86ea);const _0x582d0d=new validator_1['Validator'](_0x33814b);_0x582d0d['validate'](this['store']);const _0xf2bd59=new deployer_1['Deployer'](_0x33814b);return await _0xf2bd59['deploy'](this['store'],this['stream']),await this['store']['setApp'](_0x33814b['app']['id'],_0x33814b['app']['version']),_0x33814b;}catch(_0x3bc84b){this['logger']['error']('compiler-deploy-error',_0x3bc84b);}}async['activate'](_0x55d478,_0x48e596){return await this['store']['activateAppVersion'](_0x55d478,_0x48e596);}async['saveAsJSON'](_0x215365,_0x217c9b){const _0x3b4db6=JSON['stringify'](_0x217c9b,null,0x2),_0x33a2d5=path['join'](path['dirname'](_0x215365),'.hotmesh.'+_0x217c9b['app']['id']+'.'+_0x217c9b['app']['version']+'.json');await fs['writeFile'](_0x33a2d5,_0x3b4db6,'utf8');}}exports['CompilerService']=CompilerService;
|