@hotmeshio/hotmesh 0.3.9 → 0.3.11
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 +19 -10
- package/build/index.d.ts +2 -1
- package/build/index.js +3 -1
- package/build/modules/key.d.ts +4 -0
- package/build/modules/key.js +1 -1
- package/build/modules/utils.js +1 -1
- package/build/package.json +21 -17
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.js +1 -1
- package/build/services/activities/index.js +1 -1
- package/build/services/activities/interrupt.js +1 -1
- package/build/services/activities/signal.js +1 -1
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.js +1 -1
- package/build/services/connector/factory.d.ts +2 -1
- package/build/services/connector/factory.js +39 -18
- package/build/services/connector/index.d.ts +2 -0
- package/build/services/connector/index.js +2 -0
- package/build/services/connector/providers/nats.js +8 -2
- package/build/services/connector/providers/postgres.d.ts +1 -1
- package/build/services/connector/providers/postgres.js +18 -9
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.js +1 -1
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshflow/client.js +1 -1
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/pipe/functions/array.js +1 -1
- package/build/services/pipe/functions/bitwise.js +1 -1
- package/build/services/pipe/functions/conditional.js +1 -1
- package/build/services/pipe/functions/cron.js +1 -1
- package/build/services/pipe/functions/date.js +1 -1
- package/build/services/pipe/functions/index.js +1 -1
- package/build/services/pipe/functions/json.js +1 -1
- package/build/services/pipe/functions/logical.js +1 -1
- package/build/services/pipe/functions/math.js +1 -1
- package/build/services/pipe/functions/number.js +1 -1
- package/build/services/pipe/functions/object.js +1 -1
- package/build/services/pipe/functions/string.js +1 -1
- package/build/services/pipe/functions/symbol.js +1 -1
- package/build/services/pipe/functions/unary.js +1 -1
- package/build/services/pipe/index.js +1 -1
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.d.ts +3 -0
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.js +1 -1
- package/build/services/search/providers/redis/ioredis.js +1 -1
- package/build/services/search/providers/redis/redis.js +1 -1
- package/build/services/serializer/index.js +1 -1
- package/build/services/store/factory.d.ts +1 -1
- package/build/services/store/factory.js +9 -5
- package/build/services/store/index.d.ts +2 -1
- package/build/services/store/providers/postgres/kvsql.d.ts +155 -0
- package/build/services/store/providers/postgres/kvsql.js +1 -0
- package/build/services/store/providers/postgres/postgres.d.ts +107 -0
- package/build/services/store/providers/postgres/postgres.js +1 -0
- package/build/services/store/providers/redis/_base.d.ts +0 -1
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.d.ts +0 -1
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/factory.js +5 -1
- package/build/services/stream/providers/nats/nats.js +1 -1
- package/build/services/stream/providers/postgres/postgres.d.ts +72 -0
- package/build/services/stream/providers/postgres/postgres.js +1 -0
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/build/types/hotmesh.d.ts +4 -0
- package/build/types/index.d.ts +3 -1
- package/build/types/postgres.d.ts +31 -9
- package/build/types/provider.d.ts +44 -1
- package/index.ts +2 -0
- package/package.json +21 -17
- package/typedoc.json +6 -0
- package/types/hotmesh.ts +15 -0
- package/types/index.ts +54 -0
- package/types/nats.ts +12 -7
- package/types/postgres.ts +41 -10
- package/types/provider.ts +74 -3
- package/build/services/store/providers/postgres/types/hash.d.ts +0 -0
- package/build/services/store/providers/postgres/types/hash.js +0 -0
- package/build/services/store/providers/postgres/types/list.d.ts +0 -0
- package/build/services/store/providers/postgres/types/list.js +0 -0
- package/build/services/store/providers/postgres/types/string.d.ts +0 -0
- package/build/services/store/providers/postgres/types/string.js +0 -0
- package/build/services/store/providers/postgres/types/zset.d.ts +0 -0
- package/build/services/store/providers/postgres/types/zset.js +0 -0
- package/build/services/stream/providers/postgres/_deploy.d.ts +0 -5
- package/build/services/stream/providers/postgres/_deploy.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x231a(_0x708b3f,_0x239d6b){const _0x189a74=_0x189a();return _0x231a=function(_0x231a7f,_0x5bda1c){_0x231a7f=_0x231a7f-0xc3;let _0x24f9eb=_0x189a74[_0x231a7f];return _0x24f9eb;},_0x231a(_0x708b3f,_0x239d6b);}(function(_0x440884,_0x3073d5){const _0xcec1e7=_0x231a,_0x4bfe95=_0x440884();while(!![]){try{const _0x33cee0=-parseInt(_0xcec1e7(0xc6))/0x1*(parseInt(_0xcec1e7(0xcb))/0x2)+parseInt(_0xcec1e7(0xc4))/0x3+-parseInt(_0xcec1e7(0xc5))/0x4+-parseInt(_0xcec1e7(0xca))/0x5+parseInt(_0xcec1e7(0xc8))/0x6*(-parseInt(_0xcec1e7(0xcc))/0x7)+parseInt(_0xcec1e7(0xc7))/0x8+-parseInt(_0xcec1e7(0xc3))/0x9*(-parseInt(_0xcec1e7(0xc9))/0xa);if(_0x33cee0===_0x3073d5)break;else _0x4bfe95['push'](_0x4bfe95['shift']());}catch(_0x32f9a8){_0x4bfe95['push'](_0x4bfe95['shift']());}}}(_0x189a,0x8611f));function _0x189a(){const _0x1ae205=['200323KfmKuI','2912432UFVObJ','144MxMFSx','5280hCIVXe','4299560wxnODb','10XKmQrU','14161ztXOBT','37278GmISDb','1096899mENpSX','1829732VUCufB'];_0x189a=function(){return _0x1ae205;};return _0x189a();}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']};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x5b30b2,_0x7d8ab8){const _0x5733b2=_0x5962,_0x1d97f9=_0x5b30b2();while(!![]){try{const _0x19d0a1=-parseInt(_0x5733b2(0xfa))/0x1*(parseInt(_0x5733b2(0xfb))/0x2)+-parseInt(_0x5733b2(0xfc))/0x3+parseInt(_0x5733b2(0xfe))/0x4*(-parseInt(_0x5733b2(0xf6))/0x5)+-parseInt(_0x5733b2(0xfd))/0x6+-parseInt(_0x5733b2(0xf7))/0x7+-parseInt(_0x5733b2(0xf9))/0x8+parseInt(_0x5733b2(0xf8))/0x9;if(_0x19d0a1===_0x7d8ab8)break;else _0x1d97f9['push'](_0x1d97f9['shift']());}catch(_0x19a983){_0x1d97f9['push'](_0x1d97f9['shift']());}}}(_0x34f5,0x9d9ff));function _0x5962(_0x3583b2,_0x3ef5ad){const _0x34f55e=_0x34f5();return _0x5962=function(_0x5962a4,_0x50f66d){_0x5962a4=_0x5962a4-0xf6;let _0x48613c=_0x34f55e[_0x5962a4];return _0x48613c;},_0x5962(_0x3583b2,_0x3ef5ad);}function _0x34f5(){const _0x2a8f97=['2308OILDBU','3600MbmCKl','1923173jpcSgN','28180431PWQaFX','2814112DEdrUF','312701UJgBMr','2pymTFU','1613835mvAZRy','3557634wLGRJC'];_0x34f5=function(){return _0x2a8f97;};return _0x34f5();}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(_0x30b31e,_0x3795c9,_0x23e3f7,_0x507b93,_0x54539c,_0x36506c){super(_0x30b31e,_0x3795c9,_0x23e3f7,_0x507b93,_0x54539c,_0x36506c);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x259c4a;try{await this['verifyEntry'](),_0x259c4a=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x259c4a['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0x259c4a):await this['interruptAnother'](_0x259c4a);}catch(_0x546cb5){if(_0x546cb5 instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0x546cb5});return;}else{if(_0x546cb5 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x546cb5});return;}else{if(_0x546cb5 instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0x546cb5});return;}else{if(_0x546cb5 instanceof errors_1['CollationError']){if(_0x546cb5['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',{..._0x546cb5});}else this['logger']['error']('interrupt-process-error',{..._0x546cb5});}}}_0x259c4a?.['setActivityError'](_0x546cb5['message']);throw _0x546cb5;}finally{_0x259c4a?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x23999e){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x1f08b7=await this['interrupt']();_0x23999e['mapActivityAttributes']();const _0x160605=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x160605),await this['setStatus'](-0x1,_0x160605);const _0x190adb=await _0x160605['exec'](),_0x20f70a=this['resolveStatus'](_0x190adb);return _0x23999e['setActivityAttributes']({'app.activity.mid':_0x1f08b7,'app.job.jss':_0x20f70a}),this['context']['metadata']['aid'];}async['interruptAnother'](_0x4702ac){const _0x530867=await this['interrupt'](),_0x68521a={'app.activity.mid':_0x530867};_0x4702ac['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x28044a=this['store']['transact']();await this['setState'](_0x28044a);}const _0x2d718c=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x2d718c),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x2d718c);const _0x35ded7=await _0x2d718c['exec'](),_0x4de808=this['resolveStatus'](_0x35ded7);_0x68521a['app.job.jss']=_0x4de808;const _0x4e45d0=await this['transition'](this['adjacencyList'],_0x4de808);return _0x4e45d0['length']&&(_0x68521a['app.activity.mids']=_0x4e45d0['join'](',')),_0x4702ac['setActivityAttributes'](_0x68521a),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0x485994=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0x485994==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 _0x451302=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'],_0x451302);}}exports['Interrupt']=Interrupt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function _0x3734(_0x1e9434,_0x5df5c1){const _0x57e2bb=_0x57e2();return _0x3734=function(_0x3734d3,_0x4c1257){_0x3734d3=_0x3734d3-0x161;let _0xcf3acd=_0x57e2bb[_0x3734d3];return _0xcf3acd;},_0x3734(_0x1e9434,_0x5df5c1);}(function(_0x24c7c6,_0x4e2f8f){const _0x12b58b=_0x3734,_0x21bbe2=_0x24c7c6();while(!![]){try{const _0x209080=parseInt(_0x12b58b(0x168))/0x1+parseInt(_0x12b58b(0x163))/0x2+parseInt(_0x12b58b(0x164))/0x3+-parseInt(_0x12b58b(0x165))/0x4+parseInt(_0x12b58b(0x166))/0x5+parseInt(_0x12b58b(0x167))/0x6+-parseInt(_0x12b58b(0x161))/0x7*(parseInt(_0x12b58b(0x162))/0x8);if(_0x209080===_0x4e2f8f)break;else _0x21bbe2['push'](_0x21bbe2['shift']());}catch(_0x1c5cc2){_0x21bbe2['push'](_0x21bbe2['shift']());}}}(_0x57e2,0x759fd));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Signal']=void 0x0;function _0x57e2(){const _0x42c82c=['4519458ZkQfYr','460447Yreghl','14UHafOw','9755840fnjMsB','1842498yLAEKt','2405151WXMhzy','2130044IVyqUY','2583020bkPMLl'];_0x57e2=function(){return _0x42c82c;};return _0x57e2();}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(_0x289a47,_0x6d9f34,_0x38b608,_0xfc712e,_0x377c96,_0x45450d){super(_0x289a47,_0x6d9f34,_0x38b608,_0xfc712e,_0x377c96,_0x45450d);}async['process'](){this['logger']['debug']('signal-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x31e55b;try{await this['verifyEntry'](),_0x31e55b=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x31e55b['startActivitySpan'](this['leg']);const _0x4ffb8e=this['store']['transact']();this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x4ffb8e),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x4ffb8e),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x4ffb8e);const _0x59f879=await _0x4ffb8e['exec']();this['config']['subtype']==='all'?await this['hookAll']():await this['hookOne']();const _0x1fd1e7=this['resolveStatus'](_0x59f879),_0xca3f16={'app.job.jss':_0x1fd1e7},_0x35c61c=await this['transition'](this['adjacencyList'],_0x1fd1e7);return _0x35c61c['length']&&(_0xca3f16['app.activity.mids']=_0x35c61c['join'](',')),_0x31e55b['mapActivityAttributes'](),_0x31e55b['setActivityAttributes'](_0xca3f16),this['context']['metadata']['aid'];}catch(_0x11616b){if(_0x11616b instanceof errors_1['InactiveJobError']){this['logger']['error']('signal-inactive-job-error',{..._0x11616b});return;}else{if(_0x11616b instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x11616b});return;}else{if(_0x11616b instanceof errors_1['GetStateError']){this['logger']['error']('signal-get-state-error',{..._0x11616b});return;}else{if(_0x11616b instanceof errors_1['CollationError']){if(_0x11616b['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',{..._0x11616b});}else this['logger']['error']('signal-process-error',{..._0x11616b});}}}_0x31e55b?.['setActivityError'](_0x11616b['message']);throw _0x11616b;}finally{_0x31e55b?.['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 _0x4c8597=new mapper_1['MapperService'](this['config']['signal']['maps'],this['context']);return _0x4c8597['mapRules']();}}['mapResolverData'](){if(this['config']['resolver']?.['maps']){const _0x12b02b=new mapper_1['MapperService'](this['config']['resolver']['maps'],this['context']);return _0x12b02b['mapRules']();}}async['hookOne'](){const _0x3b9ae7=pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']),_0x40ca7e=this['mapSignalData'](),_0x3fdfd8=pipe_1['Pipe']['resolve'](this['config']['status'],this['context']),_0x55da97=pipe_1['Pipe']['resolve'](this['config']['code'],this['context']);return await this['engine']['hook'](_0x3b9ae7,_0x40ca7e,_0x3fdfd8,_0x55da97);}async['hookAll'](){const _0x333c5e=this['mapSignalData'](),_0xf6f6c5=this['mapResolverData']();this['config']['scrub']&&(_0xf6f6c5['scrub']=!![]);const _0x4ddb15=pipe_1['Pipe']['resolve'](this['config']['key_name'],this['context']),_0x3c744e=pipe_1['Pipe']['resolve'](this['config']['key_value'],this['context']),_0x26b49e=[_0x4ddb15+':'+_0x3c744e];return await this['engine']['hookAll'](this['config']['topic'],_0x333c5e,_0xf6f6c5,_0x26b49e);}}exports['Signal']=Signal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x3ba18e,_0x151cc){const _0x30c0ac=_0x4154,_0x5bdfa6=_0x3ba18e();while(!![]){try{const _0x4b2d24=parseInt(_0x30c0ac(0x149))/0x1+parseInt(_0x30c0ac(0x145))/0x2+-parseInt(_0x30c0ac(0x14a))/0x3*(parseInt(_0x30c0ac(0x144))/0x4)+-parseInt(_0x30c0ac(0x146))/0x5+parseInt(_0x30c0ac(0x147))/0x6*(parseInt(_0x30c0ac(0x142))/0x7)+parseInt(_0x30c0ac(0x148))/0x8*(parseInt(_0x30c0ac(0x143))/0x9)+parseInt(_0x30c0ac(0x141))/0xa;if(_0x4b2d24===_0x151cc)break;else _0x5bdfa6['push'](_0x5bdfa6['shift']());}catch(_0x1f64f7){_0x5bdfa6['push'](_0x5bdfa6['shift']());}}}(_0x14c3,0x6feec));function _0x4154(_0x5383f0,_0x293c80){const _0x14c3ec=_0x14c3();return _0x4154=function(_0x4154d0,_0x3f79c6){_0x4154d0=_0x4154d0-0x141;let _0x32b11b=_0x14c3ec[_0x4154d0];return _0x32b11b;},_0x4154(_0x5383f0,_0x293c80);}function _0x14c3(){const _0x39835e=['30eofFsT','1823520YSYiuP','28wEDyfm','27IBUaRd','116092kRWlhK','1123298lSfaUs','3139180dcdkqG','604122lHaame','357832mjQSCK','95606mEyXfk'];_0x14c3=function(){return _0x39835e;};return _0x14c3();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Trigger']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),pipe_1=require('../pipe'),reporter_1=require('../reporter'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Trigger extends activity_1['Activity']{constructor(_0x55d8b5,_0x1648db,_0x534b20,_0x15e28f,_0xcb2a55,_0x5ac719){super(_0x55d8b5,_0x1648db,_0x534b20,_0x15e28f,_0xcb2a55,_0x5ac719);}async['process'](_0xf2c5b){this['logger']['debug']('trigger-process',{'subscribes':this['config']['subscribes']});let _0x568bee;try{this['setLeg'](0x2),await this['getState'](),_0x568bee=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x568bee['startJobSpan'](),_0x568bee['startActivitySpan'](this['leg']),this['mapJobData'](),this['adjacencyList']=await this['filterAdjacent']();const _0x3a7626=this['initStatus'](_0xf2c5b,this['adjacencyList']['length']);await this['setStateNX'](_0x3a7626),await this['setStatus'](_0x3a7626),this['bindSearchData'](_0xf2c5b),this['bindMarkerData'](_0xf2c5b);const _0x473cb9=this['store']['transact']();await this['setState'](_0x473cb9),await this['setStats'](_0x473cb9);_0xf2c5b?.['pending']&&await this['setExpired'](_0xf2c5b?.['pending'],_0x473cb9);await collator_1['CollatorService']['notarizeInception'](this,this['context']['metadata']['guid'],_0x473cb9),await _0x473cb9['exec'](),this['execAdjacentParent'](),_0x568bee['mapActivityAttributes']();const _0x460778=Number(this['context']['metadata']['js']);_0x568bee['setJobAttributes']({'app.job.jss':_0x460778});const _0x57ad1a={'app.job.jss':_0x460778};return await this['transitionAndLogAdjacent'](_0xf2c5b,_0x460778,_0x57ad1a),_0x568bee['setActivityAttributes'](_0x57ad1a),this['context']['metadata']['jid'];}catch(_0x353b39){_0x568bee?.['setActivityError'](_0x353b39['message']);if(_0x353b39 instanceof errors_1['DuplicateJobError']){await(0x0,utils_1['sleepFor'])(0x3e8);const _0x132bfb=await collator_1['CollatorService']['isInceptionOverage'](this,this['context']['metadata']['guid']);if(_0x132bfb){this['logger']['info']('trigger-collation-overage',{'job_id':_0x353b39['jobId'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('duplicate-job-error',{'job_id':_0x353b39['jobId'],'guid':this['context']['metadata']['guid']});}else this['logger']['error']('trigger-process-error',{..._0x353b39});throw _0x353b39;}finally{_0x568bee?.['endJobSpan'](),_0x568bee?.['endActivitySpan'](),this['logger']['debug']('trigger-process-end',{'subscribes':this['config']['subscribes'],'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid']});}}async['transitionAndLogAdjacent'](_0x120710={},_0x9782d9,_0x85d573){if(isNaN(_0x120710['pending'])){const _0x11f688=await this['transition'](this['adjacencyList'],_0x9782d9);_0x11f688['length']&&(_0x85d573['app.activity.mids']=_0x11f688['join'](','));}}['initStatus'](_0x10efea={},_0x4cae3f){if(_0x10efea['pending'])return-0x1;return _0x4cae3f;}async['setExpired'](_0x14e91a,_0x37fc37){await this['store']['expireJob'](this['context']['metadata']['jid'],_0x14e91a,_0x37fc37);}['safeKey'](_0x290e09){return'_'+_0x290e09;}['bindSearchData'](_0xd951d7){_0xd951d7?.['search']&&Object['keys'](_0xd951d7['search'])['forEach'](_0x377679=>{this['context']['data'][this['safeKey'](_0x377679)]=_0xd951d7['search'][_0x377679]['toString']();});}['bindMarkerData'](_0x8f3bf9){_0x8f3bf9?.['marker']&&Object['keys'](_0x8f3bf9['marker'])['forEach'](_0x33f1f3=>{_0x33f1f3['startsWith']('-')&&(this['context']['data'][_0x33f1f3]=_0x8f3bf9['marker'][_0x33f1f3]['toString']());});}async['setStatus'](_0x881399){this['context']['metadata']['js']=_0x881399;}async['execAdjacentParent'](){if(this['context']['metadata']['px']){const _0x39c4a0=(0x0,utils_1['formatISODate'])(new Date()),_0x9284ed={'metadata':this['context']['metadata'],'data':{'job_id':this['context']['metadata']['jid'],'jc':_0x39c4a0,'ju':_0x39c4a0}};await this['engine']['execAdjacentParent'](this['context'],_0x9284ed);}}['createInputContext'](){const _0xcd112f={[this['metadata']['aid']]:{'input':{'data':this['data']}},'$self':{'input':{'data':this['data']},'output':{'data':this['data']}}};return _0xcd112f;}async['getState'](){const _0x2e5135=this['createInputContext'](),_0x1e5bd1=this['resolveJobId'](_0x2e5135),_0x3fdc02=this['resolveJobKey'](_0x2e5135),_0x4fd071=(0x0,utils_1['formatISODate'])(new Date()),{id:_0x1fbf52,version:_0x1c72f3}=await this['engine']['getVID']();this['initDimensionalAddress'](collator_1['CollatorService']['getDimensionalSeed']());const _0xff9535={...this['metadata'],'jid':_0x1e5bd1,'key':_0x3fdc02,'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':_0x1fbf52,'vrs':_0x1c72f3,'tpc':this['config']['subscribes'],'trc':this['context']['metadata']['trc'],'spn':this['context']['metadata']['spn'],'guid':this['context']['metadata']['guid'],'jid':_0x1e5bd1,'dad':collator_1['CollatorService']['getDimensionalSeed'](),'key':_0x3fdc02,'jc':_0x4fd071,'ju':_0x4fd071,'ts':(0x0,utils_1['getTimeSeries'])(this['resolveGranularity']()),'js':0x0},'data':{},[this['metadata']['aid']]:{'input':{'data':this['data'],'metadata':_0xff9535},'output':{'data':this['data'],'metadata':_0xff9535},'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'](_0x136cdf=>'metadata/'+_0x136cdf);}['bindActivityMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['ACTIVITY']['KEYS']['map'](_0x4db5d3=>'output/metadata/'+_0x4db5d3);}['resolveGranularity'](){return this['config']['stats']?.['granularity']||reporter_1['ReporterService']['DEFAULT_GRANULARITY'];}['getJobStatus'](){return this['context']['metadata']['js'];}['resolveJobId'](_0x2e557d){const _0x1e062a=this['config']['stats']?.['id'];return _0x1e062a?pipe_1['Pipe']['resolve'](_0x1e062a,_0x2e557d):(0x0,utils_1['guid'])();}['resolveJobKey'](_0x295191){const _0x553c12=this['config']['stats']?.['key'];return _0x553c12?pipe_1['Pipe']['resolve'](_0x553c12,_0x295191):'';}async['setStateNX'](_0x5b857f){const _0x14b438=this['context']['metadata']['jid'];if(!await this['store']['setStateNX'](_0x14b438,this['engine']['appId'],_0x5b857f))throw new errors_1['DuplicateJobError'](_0x14b438);}async['setStats'](_0x201efa){const _0x337538=this['context']['metadata'];if(_0x337538['key']&&this['config']['stats']?.['measures']){const _0x4d1b0c=await this['engine']['getVID'](),_0x5b03f7=new reporter_1['ReporterService'](_0x4d1b0c,this['store'],this['logger']);await this['store']['setStats'](_0x337538['key'],_0x337538['jid'],_0x337538['ts'],_0x5b03f7['resolveTriggerStatistics'](this['config'],this['context']),_0x4d1b0c,_0x201efa);}}}exports['Trigger']=Trigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x44568c,_0x41d510){const _0x1d34de=_0x56b2,_0x429bb2=_0x44568c();while(!![]){try{const _0x42647d=parseInt(_0x1d34de(0x92))/0x1*(-parseInt(_0x1d34de(0x98))/0x2)+-parseInt(_0x1d34de(0x94))/0x3*(-parseInt(_0x1d34de(0x9a))/0x4)+-parseInt(_0x1d34de(0x91))/0x5*(-parseInt(_0x1d34de(0x95))/0x6)+-parseInt(_0x1d34de(0x9b))/0x7+-parseInt(_0x1d34de(0x99))/0x8+parseInt(_0x1d34de(0x90))/0x9*(parseInt(_0x1d34de(0x97))/0xa)+-parseInt(_0x1d34de(0x93))/0xb*(-parseInt(_0x1d34de(0x96))/0xc);if(_0x42647d===_0x41d510)break;else _0x429bb2['push'](_0x429bb2['shift']());}catch(_0x5a58ea){_0x429bb2['push'](_0x429bb2['shift']());}}}(_0x37bb,0xd6f4b));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 _0x56b2(_0xae784,_0x501bba){const _0x37bb51=_0x37bb();return _0x56b2=function(_0x56b220,_0x3af743){_0x56b220=_0x56b220-0x90;let _0xa3044e=_0x37bb51[_0x56b220];return _0xa3044e;},_0x56b2(_0xae784,_0x501bba);}function _0x37bb(){const _0x1ef7ff=['312684kZhJWx','36uJJbXI','170GgCxMi','10XOrRKG','3388840IAhclz','2936PAVcGv','9712794mgGpke','14517WXCFSQ','65SFgOLq','154797wFZPwH','5183926aaNEoT','5505UylrMN'];_0x37bb=function(){return _0x1ef7ff;};return _0x37bb();}class Worker extends activity_1['Activity']{constructor(_0x110ce2,_0x3d68c1,_0x48bd1e,_0x4dd790,_0x269ec8,_0x14f6ac){super(_0x110ce2,_0x3d68c1,_0x48bd1e,_0x4dd790,_0x269ec8,_0x14f6ac);}async['process'](){this['logger']['debug']('worker-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0xb37ff4;try{await this['verifyEntry'](),_0xb37ff4=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0xb37ff4['startActivitySpan'](this['leg']),this['mapInputData']();const _0x449b8b=this['store']['transact'](),_0x169f0f=await this['execActivity'](_0x449b8b);await collator_1['CollatorService']['authorizeReentry'](this,_0x449b8b),await this['setState'](_0x449b8b),await this['setStatus'](0x0,_0x449b8b);const _0x287418=await _0x449b8b['exec']();_0xb37ff4['mapActivityAttributes']();const _0x2b721a=this['resolveStatus'](_0x287418);return _0xb37ff4['setActivityAttributes']({'app.activity.mid':_0x169f0f,'app.job.jss':_0x2b721a}),this['context']['metadata']['aid'];}catch(_0x5231fb){if(_0x5231fb instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x5231fb});return;}else{if(_0x5231fb instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x5231fb});return;}else{if(_0x5231fb instanceof errors_1['GetStateError']){this['logger']['error']('worker-get-state-error',{..._0x5231fb});return;}else{if(_0x5231fb instanceof errors_1['CollationError']){if(_0x5231fb['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',{..._0x5231fb});}else this['logger']['error']('worker-process-error',{..._0x5231fb});}}}_0xb37ff4?.['setActivityError'](_0x5231fb['message']);throw _0x5231fb;}finally{_0xb37ff4?.['endActivitySpan'](),this['logger']['debug']('worker-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x3b1351){const _0xc11d6d=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x46b11a={'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':_0xc11d6d,'spn':this['context']['$self']['output']['metadata']['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context']['data']};return this['config']['retry']&&(_0x46b11a['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](_0xc11d6d,_0x46b11a,_0x3b1351);}}exports['Worker']=Worker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x24a3a0,_0x55d8a3){const _0x4fdf2a=_0x5ec2,_0x4be8b1=_0x24a3a0();while(!![]){try{const _0x409c60=-parseInt(_0x4fdf2a(0x139))/0x1+parseInt(_0x4fdf2a(0x138))/0x2*(parseInt(_0x4fdf2a(0x134))/0x3)+-parseInt(_0x4fdf2a(0x136))/0x4*(parseInt(_0x4fdf2a(0x137))/0x5)+parseInt(_0x4fdf2a(0x130))/0x6*(-parseInt(_0x4fdf2a(0x131))/0x7)+-parseInt(_0x4fdf2a(0x12f))/0x8*(-parseInt(_0x4fdf2a(0x133))/0x9)+parseInt(_0x4fdf2a(0x135))/0xa+parseInt(_0x4fdf2a(0x132))/0xb;if(_0x409c60===_0x55d8a3)break;else _0x4be8b1['push'](_0x4be8b1['shift']());}catch(_0x384dc5){_0x4be8b1['push'](_0x4be8b1['shift']());}}}(_0x2f82,0xddc75));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CollatorService']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../../types/collator');function _0x5ec2(_0x302b91,_0x536cdc){const _0x2f8217=_0x2f82();return _0x5ec2=function(_0x5ec2d5,_0x40fc6b){_0x5ec2d5=_0x5ec2d5-0x12f;let _0x53fb95=_0x2f8217[_0x5ec2d5];return _0x53fb95;},_0x5ec2(_0x302b91,_0x536cdc);}class CollatorService{static['assertJobActive'](_0x41eadc,_0x5652f8,_0x2331ee,_0x29b060=0x0){if(_0x41eadc<=_0x29b060)throw new errors_1['InactiveJobError'](_0x5652f8,_0x41eadc,_0x2331ee);}static['getDimensionalAddress'](_0x6b33d7,_0x30a9f8=![]){let _0x4203bd=_0x6b33d7['context']['metadata']['dad']||_0x6b33d7['metadata']['dad'];return _0x30a9f8&&_0x4203bd&&_0x6b33d7['leg']===0x2&&(_0x4203bd=_0x4203bd['substring'](0x0,_0x4203bd['lastIndexOf'](','))+',0'),CollatorService['getDimensionsById']([..._0x6b33d7['config']['ancestors'],_0x6b33d7['metadata']['aid']],_0x4203bd);}static['resolveReentryDimension'](_0x48d616){const _0xa32633=_0x48d616['config']['ancestor'],_0x5a72df=_0x48d616['config']['ancestors'],_0x34664e=_0x5a72df['indexOf'](_0xa32633),_0x25f1fa=_0x48d616['metadata']['dad']['split'](',');return _0x25f1fa['length']=_0x34664e+0x1,_0x25f1fa['push']('0'),_0x25f1fa['join'](',');}static async['notarizeEntry'](_0x434275,_0x84e875){const _0x43c91a=await _0x434275['store']['collate'](_0x434275['context']['metadata']['jid'],_0x434275['metadata']['aid'],-0x5af3107a4000,this['getDimensionalAddress'](_0x434275),_0x84e875);return this['verifyInteger'](_0x43c91a,0x1,'enter'),_0x43c91a;}static async['authorizeReentry'](_0x59b12f,_0x132449){const _0x580c68=await _0x59b12f['store']['collate'](_0x59b12f['context']['metadata']['jid'],_0x59b12f['metadata']['aid'],-0x9184e72a000,this['getDimensionalAddress'](_0x59b12f),_0x132449);return _0x580c68;}static async['notarizeEarlyExit'](_0x4ba0f3,_0xb95761){return await _0x4ba0f3['store']['collate'](_0x4ba0f3['context']['metadata']['jid'],_0x4ba0f3['metadata']['aid'],-0xa012317b000,this['getDimensionalAddress'](_0x4ba0f3),_0xb95761);}static async['notarizeEarlyCompletion'](_0x572f38,_0x516aea){const _0x3f6700=_0x572f38['config']['cycle']?0x9184e72a000:0xa012317b000;return await _0x572f38['store']['collate'](_0x572f38['context']['metadata']['jid'],_0x572f38['metadata']['aid'],0xf4241-_0x3f6700,this['getDimensionalAddress'](_0x572f38),_0x516aea);}static async['notarizeInception'](_0x30d334,_0xd91f90,_0x10e2ee){_0xd91f90&&await _0x30d334['store']['collateSynthetic'](_0x30d334['context']['metadata']['jid'],_0xd91f90,0xf4240,_0x10e2ee);}static async['isInceptionOverage'](_0x2f72e3,_0x5f120d){if(_0x5f120d){const _0x594bb1=await _0x2f72e3['store']['collateSynthetic'](_0x2f72e3['context']['metadata']['jid'],_0x5f120d,0xf4240);return _0x594bb1>0xf4240;}return![];}static async['notarizeReentry'](_0x34aff2,_0x441489,_0x21bf83){const _0x21eecd=_0x34aff2['context']['metadata']['jid'],_0x584d53=_0x21bf83||_0x34aff2['store']['transact']();await _0x34aff2['store']['collate'](_0x21eecd,_0x34aff2['metadata']['aid'],0xf4240,this['getDimensionalAddress'](_0x34aff2,!![]),_0x584d53),await _0x34aff2['store']['collateSynthetic'](_0x21eecd,_0x441489,0xf4240,_0x584d53);const [_0x21ceff,_0x53c1bd]=await _0x584d53['exec'](),_0x5b95a6=Array['isArray'](_0x21ceff)?_0x21ceff[0x1]:_0x21ceff,_0x5311a8=Array['isArray'](_0x53c1bd)?_0x53c1bd[0x1]:_0x53c1bd;return this['verifyInteger'](_0x5b95a6,0x2,'enter'),this['verifySyntheticInteger'](_0x5311a8),_0x5b95a6;}static async['notarizeContinuation'](_0x13502e,_0x396101){return await _0x13502e['store']['collate'](_0x13502e['context']['metadata']['jid'],_0x13502e['metadata']['aid'],0x1,this['getDimensionalAddress'](_0x13502e),_0x396101);}static async['notarizeCompletion'](_0x2ba8f5,_0x225ba9){const _0x18d06c=_0x2ba8f5['config']['cycle']?0x0:0xe8d4a51000;return await _0x2ba8f5['store']['collate'](_0x2ba8f5['context']['metadata']['jid'],_0x2ba8f5['metadata']['aid'],0x1-_0x18d06c,this['getDimensionalAddress'](_0x2ba8f5),_0x225ba9);}static['getDigitAtIndex'](_0x58b6b8,_0x340f1c){const _0x3eb5f0=_0x58b6b8['toString']();if(_0x340f1c<0x0||_0x340f1c>=_0x3eb5f0['length'])return null;const _0x42427c=parseInt(_0x3eb5f0[_0x340f1c],0xa);return _0x42427c;}static['getDimensionalIndex'](_0x561cd4){const _0x3195f1=_0x561cd4['toString']();if(_0x3195f1['length']<0x9)return null;const _0x207a97=_0x3195f1['substring'](0x3,0x9),_0x1bf190=parseInt(_0x207a97,0xa);return _0x1bf190-0x1;}static['isDuplicate'](_0x69dcf4,_0x284a31){return this['getDigitAtIndex'](_0x69dcf4,_0x284a31)<0x8;}static['isInactive'](_0xdffd7d){return this['getDigitAtIndex'](_0xdffd7d,0x2)<0x9;}static['isPrimed'](_0x4cd12d,_0x3d8193){return _0x3d8193==0x1?_0x4cd12d!=-0x5af3107a4000:this['getDigitAtIndex'](_0x4cd12d,0x0)<0x9&&this['getDigitAtIndex'](_0x4cd12d,0x1)<0x9;}static['verifySyntheticInteger'](_0x5a4854){const _0x12569e=_0x5a4854['toString'](),_0x55f6e7=parseInt(_0x12569e[_0x12569e['length']-0x1],0xa);if(_0x55f6e7>0x0)throw new errors_1['CollationError'](_0x5a4854,0x2,'enter',collator_1['CollationFaultType']['INACTIVE']);else{if(_0x5a4854>=0x1e8480)throw new errors_1['CollationError'](_0x5a4854,0x2,'enter',collator_1['CollationFaultType']['DUPLICATE']);}}static['verifyInteger'](_0x5addfb,_0x269ebd,_0x25698f){let _0x4b22d5;if(_0x269ebd===0x1&&_0x25698f==='enter'){if(!this['isPrimed'](_0x5addfb,0x1))_0x4b22d5=collator_1['CollationFaultType']['MISSING'];else{if(this['isDuplicate'](_0x5addfb,0x0))_0x4b22d5=collator_1['CollationFaultType']['DUPLICATE'];else _0x5addfb!=0x331a2bfa73000&&(_0x4b22d5=collator_1['CollationFaultType']['INVALID']);}}else{if(_0x269ebd===0x1&&_0x25698f==='exit'){if(_0x5addfb===-0x9184e72a000)_0x4b22d5=collator_1['CollationFaultType']['MISSING'];else this['isDuplicate'](_0x5addfb,0x1)&&(_0x4b22d5=collator_1['CollationFaultType']['DUPLICATE']);}else{if(_0x269ebd===0x2&&_0x25698f==='enter'){if(!this['isPrimed'](_0x5addfb,0x2))_0x4b22d5=collator_1['CollationFaultType']['FORBIDDEN'];else this['isInactive'](_0x5addfb)&&(_0x4b22d5=collator_1['CollationFaultType']['INACTIVE']);}}}if(_0x4b22d5)throw new errors_1['CollationError'](_0x5addfb,_0x269ebd,_0x25698f,_0x4b22d5);}static['getDimensionsById'](_0xf65ebe,_0x41ac95){const _0x312d70={'$ADJACENT':_0x41ac95+',0'};let _0x4939a3=_0x41ac95;return _0xf65ebe['reverse']()['forEach'](_0x4f5562=>{_0x312d70[_0x4f5562]=_0x4939a3,_0x4939a3=_0x4939a3['substring'](0x0,_0x4939a3['lastIndexOf'](','));}),_0x312d70;}static['getSeed'](){return'999000000000000';}static['getTriggerSeed'](){return'888000001000001';}static['compile'](_0x1226fe){CollatorService['bindAncestorArray'](_0x1226fe);}static['bindAncestorArray'](_0x380121){_0x380121['forEach'](_0x579e2b=>{const _0x3557ba={},_0x3700ac=Object['keys'](_0x579e2b['activities'])['find'](_0x5f03f2=>_0x579e2b['activities'][_0x5f03f2]['type']==='trigger');if(!_0x3700ac)throw new Error('collator-trigger-activity-not-found');const _0x10e5af=(_0x2b8446,_0x25ae97)=>{_0x3557ba[_0x2b8446]=_0x25ae97,_0x579e2b['activities'][_0x2b8446]['ancestors']=_0x25ae97;const _0x426632=_0x579e2b['transitions']?.[_0x2b8446]||[];_0x426632['forEach'](_0x36b030=>{_0x10e5af(_0x36b030['to'],[..._0x25ae97,_0x2b8446]);});};_0x10e5af(_0x3700ac,[]);});}static['getDimensionalSeed'](_0x297d1a=0x0){return','+_0x297d1a;}}exports['CollatorService']=CollatorService,CollatorService['targetLength']=0xf;function _0x2f82(){const _0x1b63f4=['13312618DTexdh','4916223CljZif','3390978LFyzAE','1756480vYAryv','87732JbDHeZ','410XulwkY','2lzBPUW','553512AWqTWD','24MENWJd','2730JnCyMJ','13762gWBapE'];_0x2f82=function(){return _0x1b63f4;};return _0x2f82();}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
'use strict';(function(_0x350443,_0x5f1500){const _0x36cfab=_0x3f3a,_0x4d4d69=_0x350443();while(!![]){try{const _0x142dbd=-parseInt(_0x36cfab(0x72))/0x1*(parseInt(_0x36cfab(0x6b))/0x2)+-parseInt(_0x36cfab(0x70))/0x3*(parseInt(_0x36cfab(0x6e))/0x4)+parseInt(_0x36cfab(0x6a))/0x5*(parseInt(_0x36cfab(0x6c))/0x6)+parseInt(_0x36cfab(0x69))/0x7*(parseInt(_0x36cfab(0x71))/0x8)+-parseInt(_0x36cfab(0x6f))/0x9+parseInt(_0x36cfab(0x6d))/0xa+parseInt(_0x36cfab(0x68))/0xb;if(_0x142dbd===_0x5f1500)break;else _0x4d4d69['push'](_0x4d4d69['shift']());}catch(_0x159542){_0x4d4d69['push'](_0x4d4d69['shift']());}}}(_0x3e06,0xdbf28));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Deployer']=void 0x0;function _0x3f3a(_0x237a4d,_0x501045){const _0x3e068d=_0x3e06();return _0x3f3a=function(_0x3f3a73,_0x2ed25d){_0x3f3a73=_0x3f3a73-0x68;let _0x23e37d=_0x3e068d[_0x3f3a73];return _0x23e37d;},_0x3f3a(_0x237a4d,_0x501045);}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(_0x571511){this['manifest']=null,this['manifest']=_0x571511;}async['deploy'](_0x5ada92,_0x42257c){this['store']=_0x5ada92,this['stream']=_0x42257c,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 _0x335cda of this['manifest']['app']['graphs']){const [,_0x2665c1]=this['findTrigger'](_0x335cda),_0x6343b9=_0x2665c1['subscribes'],[_0xc847d0,_0x5da40d,_0x332191]=await this['store']['reserveSymbolRange']('$'+_0x6343b9,DEFAULT_RANGE_SIZE,'JOB'),_0x2d1a8c='',_0x90ab0d=this['bindSymbols'](_0xc847d0,_0x5da40d,_0x332191,_0x2d1a8c,_0x2665c1['PRODUCES']);Object['keys'](_0x90ab0d)['length']&&await this['store']['addSymbols']('$'+_0x6343b9,_0x90ab0d);for(const [_0x15312a,_0x5b7730]of Object['entries'](_0x335cda['activities'])){const [_0x3705e8,_0x24d395,_0x1c2236]=await this['store']['reserveSymbolRange'](_0x15312a,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x432f9b=_0x15312a+'/';this['bindSelf'](_0x5b7730['consumes'],_0x5b7730['produces'],_0x15312a);const _0x49e353=this['bindSymbols'](_0x3705e8,_0x24d395,_0x1c2236,_0x432f9b,_0x5b7730['produces']);Object['keys'](_0x49e353)['length']&&await this['store']['addSymbols'](_0x15312a,_0x49e353);}}}['bindSelf'](_0x40a046,_0x1ff796,_0x3fe04b){for(const _0x1fb0fe of[_0x3fe04b,'$self']){const _0x5a537b=_0x40a046[_0x1fb0fe];if(_0x5a537b)for(const _0x173b91 of _0x5a537b){!_0x1ff796['includes'](_0x173b91)&&_0x1ff796['push'](_0x173b91);}}}['bindSymbols'](_0x271314,_0xa9bcb6,_0x1fc755,_0x446df3,_0x4e88af){const _0x57966d={},_0x1af68f={..._0x1fc755};for(const _0x596f99 of _0x4e88af){const _0x3ed331=''+_0x446df3+_0x596f99;if(!_0x1af68f[_0x3ed331]){if(_0x271314>_0xa9bcb6)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x5dacb2=(0x0,utils_1['getSymKey'])(_0x271314);_0x271314++,_0x57966d[_0x3ed331]=_0x5dacb2,_0x1af68f[_0x3ed331]=_0x5dacb2;}}return _0x57966d;}['copyJobSchemas'](){const _0x4591c7=this['manifest']['app']['graphs'];for(const _0x516e11 of _0x4591c7){const _0xe9dc14=_0x516e11['output']?.['schema'],_0x4b2926=_0x516e11['input']?.['schema'];if(!_0xe9dc14&&!_0x4b2926)continue;const _0x3a762e=_0x516e11['activities'];for(const _0x4d9bf4 in _0x3a762e){if(_0x3a762e[_0x4d9bf4]['type']==='trigger'){const _0x2dbe44=_0x3a762e[_0x4d9bf4];_0xe9dc14&&(!_0x2dbe44['job']&&(_0x2dbe44['job']={}),_0x2dbe44['job']['schema']=_0xe9dc14),_0x4b2926&&(_0x2dbe44['output']={'schema':_0x4b2926});}}}}['bindBackRefs'](){for(const _0x3166b9 of this['manifest']['app']['graphs']){const _0xa7c45c=_0x3166b9['activities'],_0x3f987c=this['findTrigger'](_0x3166b9)[0x0];for(const _0x523d6a in _0xa7c45c){_0xa7c45c[_0x523d6a]['trigger']=_0x3f987c,_0xa7c45c[_0x523d6a]['subscribes']=_0x3166b9['subscribes'],_0x3166b9['publishes']&&(_0xa7c45c[_0x523d6a]['publishes']=_0x3166b9['publishes']),_0xa7c45c[_0x523d6a]['expire']=_0x3166b9['expire']??undefined,_0xa7c45c[_0x523d6a]['persistent']=_0x3166b9['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x464027 of this['manifest']['app']['graphs']){const _0x7f7bb1=_0x464027['activities'];for(const _0x4fcf7d in _0x7f7bb1){const _0x4da095=_0x7f7bb1[_0x4fcf7d];_0x4da095['type']==='cycle'&&(_0x7f7bb1[_0x4da095['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x4d29e7 of this['manifest']['app']['graphs']){const _0x14ac0e=_0x4d29e7['activities'];for(const _0x58d2e2 in _0x14ac0e){const _0x38da44=_0x14ac0e[_0x58d2e2];['worker','await']['includes'](_0x38da44['type'])&&_0x38da44['topic']&&!_0x38da44['subtype']&&(_0x38da44['subtype']=_0x38da44['topic']);}}}['convertActivitiesToHooks'](){for(const _0x1a9aa6 of this['manifest']['app']['graphs']){const _0x45da41=_0x1a9aa6['activities'];for(const _0x1b6a06 in _0x45da41){const _0x7e7416=_0x45da41[_0x1b6a06];['activity']['includes'](_0x7e7416['type'])&&(_0x7e7416['type']='hook');}}}async['bindParents'](){const _0x255232=this['manifest']['app']['graphs'];for(const _0x56b21d of _0x255232){if(_0x56b21d['transitions'])for(const _0x3c3d7f in _0x56b21d['transitions']){const _0x24db06=_0x56b21d['transitions'][_0x3c3d7f];for(const _0x1f74cc of _0x24db06){const _0x45fde7=_0x1f74cc['to'];_0x56b21d['activities'][_0x45fde7]['parent']=_0x3c3d7f;}_0x56b21d['activities'][_0x3c3d7f]['transitions']=_0x24db06;}}}['collectValues'](_0x38c801,_0x497291){for(const [_0x619ad6,_0x559f24]of Object['entries'](_0x38c801)){if(_0x619ad6==='enum'||_0x619ad6==='examples'||_0x619ad6==='default'){if(Array['isArray'](_0x559f24))for(const _0x4f297f of _0x559f24){typeof _0x4f297f==='string'&&_0x4f297f['length']>0x5&&_0x497291['add'](_0x4f297f);}else typeof _0x559f24==='string'&&_0x559f24['length']>0x5&&_0x497291['add'](_0x559f24);}else typeof _0x559f24==='object'&&this['collectValues'](_0x559f24,_0x497291);}}['traverse'](_0xc979e0,_0x118fbb){for(const _0x62704b of Object['values'](_0xc979e0)){typeof _0x62704b==='object'&&('schema'in _0x62704b?this['collectValues'](_0x62704b['schema'],_0x118fbb):this['traverse'](_0x62704b,_0x118fbb));}}async['generateSymVals'](){const _0x20abe1=new Set();for(const _0xa0b715 of this['manifest']['app']['graphs']){this['traverse'](_0xa0b715,_0x20abe1);}const _0x597287=await this['store']['getSymbolValues'](),_0x559a93=Object['keys'](_0x597287)['length'],_0x4c185b=Math['pow'](0x34,0x2)-0x1,_0x1a98c6=serializer_1['SerializerService']['filterSymVals'](_0x559a93,_0x4c185b,_0x597287,_0x20abe1);await this['store']['addSymbolValues'](_0x1a98c6);}['resolveJobMapsPaths'](){function _0x404b94(_0x44614f){const _0x10c747=[];function _0x52a730(_0x4de549,_0x46ce11=[]){for(const _0x365eff in _0x4de549){if(typeof _0x4de549[_0x365eff]==='object'&&_0x4de549[_0x365eff]!==null&&!('@pipe'in _0x4de549[_0x365eff])){const _0x405988=[..._0x46ce11,_0x365eff];_0x52a730(_0x4de549[_0x365eff],_0x405988);}else{const _0x4285cf=[..._0x46ce11,_0x365eff]['join']('/');if(!_0x4285cf['includes']('[')){const _0x1b71a8='data/'+_0x4285cf;!_0x10c747['includes'](_0x1b71a8)&&_0x10c747['push'](_0x1b71a8);}else{const [_0xf52b76,_0x16c913]=_0x4285cf['split']('['),[_0x3c2139,_0x5220ee]=_0x16c913['split'](']');if(!isNaN(parseInt(_0x3c2139)))for(let _0x603a60=0x0;_0x603a60<parseInt(_0x3c2139);_0x603a60++){const _0x4f28b2='data/'+_0xf52b76+'/'+_0x603a60;!_0x10c747['includes'](_0x4f28b2)&&_0x10c747['push'](_0x4f28b2);}}}}}return _0x44614f&&_0x52a730(_0x44614f),_0x10c747;}for(const _0xe6b78f of this['manifest']['app']['graphs']){let _0x5f13ae=[];const [,_0x33f088]=this['findTrigger'](_0xe6b78f);for(const _0x4f21fd in _0xe6b78f['activities']){const _0x2e3e0a=_0xe6b78f['activities'][_0x4f21fd];_0x5f13ae=_0x5f13ae['concat'](_0x404b94(_0x2e3e0a['job']?.['maps']));}_0x33f088['PRODUCES']=_0x5f13ae;}}['resolveMappingDependencies'](){const _0x124f93=[];function _0x5ce800(_0x9db5c1,_0x56f39f){for(const _0x3b5078 in _0x9db5c1){if(typeof _0x9db5c1[_0x3b5078]==='string'){const _0x46ffdc=_0x9db5c1[_0x3b5078],_0x6cc8c=_0x46ffdc['match'](/^\{[^@].*}$/);_0x6cc8c&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x46ffdc)&&(_0x46ffdc['split']('.')[0x1]!=='input'&&(_0x124f93['push'](_0x46ffdc),_0x56f39f['push'](_0x46ffdc)));}else typeof _0x9db5c1[_0x3b5078]==='object'&&_0x9db5c1[_0x3b5078]!==null&&_0x5ce800(_0x9db5c1[_0x3b5078],_0x56f39f);}}const _0x3c23d7=this['manifest']['app']['graphs'];for(const _0x160796 of _0x3c23d7){const _0x58ae98=_0x160796['activities'];for(const _0x479bda in _0x58ae98){const _0x360e87=_0x58ae98[_0x479bda];_0x360e87['consumes']=[],_0x5ce800(_0x360e87,_0x360e87['consumes']),_0x360e87['consumes']=this['groupMappingRules'](_0x360e87['consumes']);}}const _0x4cdc94=this['groupMappingRules'](_0x124f93);for(const _0x3cb652 of _0x3c23d7){const _0x2fcd5d=_0x3cb652['activities'];for(const _0x91bde0 in _0x2fcd5d){const _0x48f270=_0x2fcd5d[_0x91bde0];_0x48f270['produces']=_0x4cdc94[''+_0x91bde0]||[];}}}['groupMappingRules'](_0x16c79d){_0x16c79d=Array['from'](new Set(_0x16c79d))['sort']();const _0x24b323={};for(const _0x3deb5f of _0x16c79d){const [_0x40b42d,_0x3a9b41]=this['resolveMappableValue'](_0x3deb5f);!_0x24b323[_0x40b42d]&&(_0x24b323[_0x40b42d]=[]),_0x24b323[_0x40b42d]['push'](_0x3a9b41);}return _0x24b323;}['resolveMappableValue'](_0x354492){_0x354492=_0x354492['substring'](0x1,_0x354492['length']-0x1);const _0x16f933=_0x354492['split']('.');if(_0x16f933[0x0]==='$job'){const [_0x3a556d,..._0xa73c82]=_0x16f933;return[_0x3a556d,_0xa73c82['join']('/')];}else{const [_0x42fbd7,_0x1e1364,_0x12fb7f,..._0x222bc1]=_0x16f933,_0x4b85de={'hook':'hook/data','input':'input/data','output':_0x12fb7f==='data'?'output/data':'output/metadata'}[_0x1e1364];return[_0x42fbd7,_0x4b85de+'/'+_0x222bc1['join']('/')];}}async['deployActivitySchemas'](){const _0x41995d=this['manifest']['app']['graphs'],_0x29c4d1={};for(const _0x16ff55 of _0x41995d){const _0x57060b=_0x16ff55['activities'];for(const _0x5bdb2b in _0x57060b){const _0x1fea6f=_0x57060b[_0x5bdb2b];delete _0x1fea6f['transitions'],_0x29c4d1[_0x5bdb2b]=_0x1fea6f;}}await this['store']['setSchemas'](_0x29c4d1,this['getVID']());}async['deploySubscriptions'](){const _0x3cd405=this['manifest']['app']['graphs'],_0x34bb3f={};for(const _0x4bd11c of _0x3cd405){const _0xfb3ba9=_0x4bd11c['activities'],_0x70473a=_0x4bd11c['subscribes'];for(const _0x3d01ec in _0xfb3ba9){if(_0xfb3ba9[_0x3d01ec]['type']==='trigger'){_0x34bb3f[_0x70473a]=_0x3d01ec;break;}}}await this['store']['setSubscriptions'](_0x34bb3f,this['getVID']());}['findTrigger'](_0x1332b0){for(const _0x5e94b3 in _0x1332b0['activities']){const _0x149f04=_0x1332b0['activities'][_0x5e94b3];if(_0x149f04['type']==='trigger')return[_0x5e94b3,_0x149f04];}return null;}async['deployTransitions'](){const _0x470802=this['manifest']['app']['graphs'],_0x14f4c5={};for(const _0x3d9120 of _0x470802){if(_0x3d9120['subscribes']&&_0x3d9120['subscribes']['startsWith']('.')){const [_0x1fdecb]=this['findTrigger'](_0x3d9120);_0x1fdecb&&(_0x14f4c5[_0x3d9120['subscribes']]={[_0x1fdecb]:!![]});}if(_0x3d9120['transitions'])for(const _0x4cf442 in _0x3d9120['transitions']){const _0x3a5755=_0x3d9120['transitions'][_0x4cf442],_0x20b38c={};for(const _0x686979 of _0x3a5755){const _0x19b880=_0x686979['to'];_0x686979['conditions']?_0x20b38c[_0x19b880]=_0x686979['conditions']:_0x20b38c[_0x19b880]=!![];}Object['keys'](_0x20b38c)['length']>0x0&&(_0x14f4c5['.'+_0x4cf442]=_0x20b38c);}}await this['store']['setTransitions'](_0x14f4c5,this['getVID']());}async['deployHookPatterns'](){const _0x2f0939=this['manifest']['app']['graphs'],_0x3a112f={};for(const _0x3c58ba of _0x2f0939){if(_0x3c58ba['hooks'])for(const _0x4fb968 in _0x3c58ba['hooks']){_0x3a112f[_0x4fb968]=_0x3c58ba['hooks'][_0x4fb968];const _0x5139cb=_0x3c58ba['hooks'][_0x4fb968][0x0]['to'],_0x4b2f65=_0x3c58ba['activities'][_0x5139cb];_0x4b2f65&&(!_0x4b2f65['hook']&&(_0x4b2f65['hook']={}),_0x4b2f65['hook']['topic']=_0x4fb968);}}await this['store']['setHookRules'](_0x3a112f);}async['deployConsumerGroups'](){const _0x107665={'appId':this['manifest']['app']['id']},_0xcedad7=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x107665);await this['deployConsumerGroup'](_0xcedad7,'ENGINE');for(const _0x47276f of this['manifest']['app']['graphs']){const _0x5726ba=_0x47276f['activities'];for(const _0xd84af2 in _0x5726ba){const _0x539cb9=_0x5726ba[_0xd84af2];if(_0x539cb9['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x539cb9['subtype'],{})===_0x539cb9['subtype']){_0x107665['topic']=_0x539cb9['subtype'];const _0x3384e6=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x107665);await this['deployConsumerGroup'](_0x3384e6,'WORKER');}}}}async['deployConsumerGroup'](_0x4dd096,_0x39a25f){try{await this['stream']['createConsumerGroup'](_0x4dd096,_0x39a25f);}catch(_0x1db3c7){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x4dd096,'group':_0x39a25f});}}}function _0x3e06(){const _0x4e5bd1=['368CvaWxn','1PtUmMa','22579018vZzsmZ','42063zewriY','80MOLthu','1338428vbJmIe','59292iBXgph','4360630dEcwLU','4COGncL','9146268ePJObF','1010571sytkSf'];_0x3e06=function(){return _0x4e5bd1;};return _0x3e06();}exports['Deployer']=Deployer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x1a16(){const _0x1d91bd=['3589565UcqsbB','144698etHiBF','2595588fkbJRf','18627LTcFxA','11108160CYxrBa','15740559UPYWkW','2328FsfqaP','39uSrqFW','1148195cbXaUE'];_0x1a16=function(){return _0x1d91bd;};return _0x1a16();}function _0x1076(_0x3e0bb2,_0xc3329d){const _0x1a1644=_0x1a16();return _0x1076=function(_0x10764e,_0x38c1af){_0x10764e=_0x10764e-0x13e;let _0x2b82ea=_0x1a1644[_0x10764e];return _0x2b82ea;},_0x1076(_0x3e0bb2,_0xc3329d);}(function(_0x41e28c,_0xa83826){const _0x16e3cf=_0x1076,_0x1cb528=_0x41e28c();while(!![]){try{const _0x4a210b=parseInt(_0x16e3cf(0x144))/0x1+parseInt(_0x16e3cf(0x146))/0x2*(-parseInt(_0x16e3cf(0x143))/0x3)+parseInt(_0x16e3cf(0x13e))/0x4+-parseInt(_0x16e3cf(0x145))/0x5+-parseInt(_0x16e3cf(0x142))/0x6*(-parseInt(_0x16e3cf(0x13f))/0x7)+parseInt(_0x16e3cf(0x140))/0x8+-parseInt(_0x16e3cf(0x141))/0x9;if(_0x4a210b===_0xa83826)break;else _0x1cb528['push'](_0x1cb528['shift']());}catch(_0x3b99e2){_0x1cb528['push'](_0x1cb528['shift']());}}}(_0x1a16,0xc5eb7));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x5200cd,_0x19a820,_0xadcb1f,_0x830b68){if(_0x830b68===undefined)_0x830b68=_0xadcb1f;var _0x385a10=Object['getOwnPropertyDescriptor'](_0x19a820,_0xadcb1f);(!_0x385a10||('get'in _0x385a10?!_0x19a820['__esModule']:_0x385a10['writable']||_0x385a10['configurable']))&&(_0x385a10={'enumerable':!![],'get':function(){return _0x19a820[_0xadcb1f];}}),Object['defineProperty'](_0x5200cd,_0x830b68,_0x385a10);}:function(_0x3a774b,_0x463844,_0x4c3194,_0x212bd0){if(_0x212bd0===undefined)_0x212bd0=_0x4c3194;_0x3a774b[_0x212bd0]=_0x463844[_0x4c3194];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x5041e3,_0x3fad62){Object['defineProperty'](_0x5041e3,'default',{'enumerable':!![],'value':_0x3fad62});}:function(_0x2507de,_0x27ea8d){_0x2507de['default']=_0x27ea8d;}),__importStar=this&&this['__importStar']||function(_0x59aa3b){if(_0x59aa3b&&_0x59aa3b['__esModule'])return _0x59aa3b;var _0x4503c8={};if(_0x59aa3b!=null){for(var _0x3384bc in _0x59aa3b)if(_0x3384bc!=='default'&&Object['prototype']['hasOwnProperty']['call'](_0x59aa3b,_0x3384bc))__createBinding(_0x4503c8,_0x59aa3b,_0x3384bc);}return __setModuleDefault(_0x4503c8,_0x59aa3b),_0x4503c8;},__importDefault=this&&this['__importDefault']||function(_0x428fad){return _0x428fad&&_0x428fad['__esModule']?_0x428fad:{'default':_0x428fad};};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(_0x1583d2,_0x182aa2,_0xe6a7dd){this['store']=_0x1583d2,this['stream']=_0x182aa2,this['logger']=_0xe6a7dd;}async['plan'](_0x3c28c2){try{let _0x49f027;this['isPath'](_0x3c28c2)?_0x49f027=await json_schema_ref_parser_1['default']['dereference'](_0x3c28c2):_0x49f027=js_yaml_1['default']['load'](_0x3c28c2);const _0x346b6a=new validator_1['Validator'](_0x49f027);return _0x346b6a['validate'](this['store']),_0x49f027;}catch(_0x38ad53){this['logger']['error']('compiler-plan-error',_0x38ad53);}}['isPath'](_0x5b5ab3){return!_0x5b5ab3['trim']()['startsWith']('app:');}async['deploy'](_0x107b47){try{let _0x35e6f8;this['isPath'](_0x107b47)?(_0x35e6f8=await json_schema_ref_parser_1['default']['dereference'](_0x107b47),await this['saveAsJSON'](_0x107b47,_0x35e6f8)):_0x35e6f8=js_yaml_1['default']['load'](_0x107b47);const _0x50744a=new validator_1['Validator'](_0x35e6f8);_0x50744a['validate'](this['store']);const _0x4c3c53=new deployer_1['Deployer'](_0x35e6f8);return await _0x4c3c53['deploy'](this['store'],this['stream']),await this['store']['setApp'](_0x35e6f8['app']['id'],_0x35e6f8['app']['version']),_0x35e6f8;}catch(_0x5b5a05){this['logger']['error']('compiler-deploy-error',_0x5b5a05);}}async['activate'](_0x2d37e6,_0x662639){return await this['store']['activateAppVersion'](_0x2d37e6,_0x662639);}async['saveAsJSON'](_0x2b690d,_0x2d2112){const _0xcefc99=JSON['stringify'](_0x2d2112,null,0x2),_0x293c29=path['join'](path['dirname'](_0x2b690d),'.hotmesh.'+_0x2d2112['app']['id']+'.'+_0x2d2112['app']['version']+'.json');await fs['writeFile'](_0x293c29,_0xcefc99,'utf8');}}exports['CompilerService']=CompilerService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0xaee9(_0x55b6d5,_0x5c68fc){const _0x5f4b25=_0x5f4b();return _0xaee9=function(_0xaee972,_0x3bdfca){_0xaee972=_0xaee972-0xe9;let _0x337262=_0x5f4b25[_0xaee972];return _0x337262;},_0xaee9(_0x55b6d5,_0x5c68fc);}(function(_0xf857c7,_0x545fa7){const _0x1400cd=_0xaee9,_0x178b7b=_0xf857c7();while(!![]){try{const _0x4de703=parseInt(_0x1400cd(0xed))/0x1*(-parseInt(_0x1400cd(0xea))/0x2)+-parseInt(_0x1400cd(0xe9))/0x3*(parseInt(_0x1400cd(0xec))/0x4)+parseInt(_0x1400cd(0xf0))/0x5*(parseInt(_0x1400cd(0xf4))/0x6)+parseInt(_0x1400cd(0xee))/0x7+-parseInt(_0x1400cd(0xeb))/0x8*(parseInt(_0x1400cd(0xf3))/0x9)+-parseInt(_0x1400cd(0xef))/0xa*(-parseInt(_0x1400cd(0xf2))/0xb)+parseInt(_0x1400cd(0xf1))/0xc;if(_0x4de703===_0x545fa7)break;else _0x178b7b['push'](_0x178b7b['shift']());}catch(_0x107671){_0x178b7b['push'](_0x178b7b['shift']());}}}(_0x5f4b,0x4c9fb));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Validator']=void 0x0;const pipe_1=require('../pipe');function _0x5f4b(){const _0x41017e=['5VgXXqX','8542188NXcrkD','834196YIWJfh','4449915olOTwX','2866386NUAuvH','254094wHPtXa','8GOoMhi','8xxkUDB','28xhlkZN','39981yLHCAT','2069760YMZZwc','10dnMJwV'];_0x5f4b=function(){return _0x41017e;};return _0x5f4b();}class Validator{constructor(_0x2f1615){this['manifest']=null,this['activityIds']=[],this['mappingStatements']={},this['store']=null,this['manifest']=_0x2f1615;}async['validate'](_0x5ea268){this['store']=_0x5ea268,this['getMappingStatements'](),this['validateActivityIds'](),this['validateReferencedActivityIds'](),this['validateMappingStatements'](),this['validateTransitions'](),this['validateTransitionConditions'](),this['validateStats'](),this['validateSchemas'](),this['validateUniqueHandledTopics'](),this['validateGraphPublishSubscribe'](),this['validateHooks'](),this['validateConditionalStatements']();}['validateActivityIds'](){const _0x38549a=new Set();this['manifest']['app']['graphs']['forEach'](_0x447e5a=>{const _0x2bc54a=Object['keys'](_0x447e5a['activities']);_0x2bc54a['forEach'](_0x477d6d=>{if(_0x38549a['has'](_0x477d6d))throw new Error('Duplicate\x20activity\x20id\x20found:\x20'+_0x477d6d);else _0x38549a['add'](_0x477d6d);});}),this['activityIds']=Array['from'](_0x38549a);}['isMappingStatement'](_0x547998){return typeof _0x547998==='string'&&_0x547998['startsWith']('{')&&_0x547998['endsWith']('}');}['extractMappingStatements'](_0x447f3d,_0x332de3,_0x4e80fc){for(const _0x740965 in _0x447f3d){if(typeof _0x447f3d[_0x740965]==='object'&&_0x447f3d[_0x740965]!==null)this['extractMappingStatements'](_0x447f3d[_0x740965],_0x332de3,_0x4e80fc);else this['isMappingStatement'](_0x447f3d[_0x740965])&&(!_0x332de3[_0x4e80fc]&&(_0x332de3[_0x4e80fc]=[]),_0x332de3[_0x4e80fc]['push'](_0x447f3d[_0x740965]));}}['getMappingStatements'](){const _0x28b7bb={};this['manifest']['app']['graphs']['forEach'](_0x2a2bd2=>{const _0x3085ef=_0x2a2bd2['activities'];for(const _0x41d1bb in _0x3085ef){const _0x5944f9=_0x3085ef[_0x41d1bb];this['extractMappingStatements'](_0x5944f9,_0x28b7bb,_0x41d1bb);}}),this['mappingStatements']=_0x28b7bb;}['validateReferencedActivityIds'](){const _0x43b792=this['mappingStatements'],_0x158a00=this['activityIds'];for(const _0x4ba5da in _0x43b792){const _0x1019d7=_0x43b792[_0x4ba5da];_0x1019d7['forEach'](_0xb63ef2=>{if(_0xb63ef2['startsWith']('{')&&_0xb63ef2['endsWith']('}')){const _0x186913=_0xb63ef2['slice'](0x1,-0x1)['split']('.'),_0x1d4ee4=_0x186913[0x0];if(!(Validator['SYS_VARS']['includes'](_0x1d4ee4)||_0x158a00['includes'](_0x1d4ee4)||this['isFunction'](_0xb63ef2)||this['isContextVariable'](_0xb63ef2)))throw new Error('Mapping\x20statement\x20references\x20non-existent\x20activity:\x20'+_0xb63ef2);}});}}['isFunction'](_0x3cf112){return _0x3cf112['startsWith']('{@')&&pipe_1['Pipe']['resolveFunction'](_0x3cf112);}['isContextVariable'](_0x2ee78c){return['{$input}','{$output}','{$item}','{$key}','{$index}']['includes'](_0x2ee78c);}['validateMappingStatements'](){}['validateTransitions'](){}['validateTransitionConditions'](){}['validateStats'](){}['validateSchemas'](){}['validateUniqueHandledTopics'](){}['validateGraphPublishSubscribe'](){}['validateHooks'](){}['validateConditionalStatements'](){}}exports['Validator']=Validator,Validator['SYS_VARS']=['$app','$self','$graph','$job'],Validator['CONTEXT_VARS']=['{$input}','{$output}','{$item}','{$key}','{$index}'];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HotMeshEngine, HotMeshWorker } from '../../types/hotmesh';
|
|
2
|
-
import { ProviderConfig } from '../../types/provider';
|
|
2
|
+
import { ProviderConfig, ProviderNativeClient } from '../../types/provider';
|
|
3
3
|
export declare class ConnectorService {
|
|
4
|
+
static connectClient(ProviderConfig: ProviderConfig): Promise<ProviderNativeClient>;
|
|
4
5
|
static initClients(target: HotMeshEngine | HotMeshWorker): Promise<void>;
|
|
5
6
|
static initClient(ProviderConfig: ProviderConfig, target: HotMeshEngine | HotMeshWorker, field: string): Promise<void>;
|
|
6
7
|
}
|
|
@@ -3,28 +3,46 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ConnectorService = void 0;
|
|
4
4
|
const utils_1 = require("../../modules/utils");
|
|
5
5
|
const ioredis_1 = require("./providers/ioredis");
|
|
6
|
-
const redis_1 = require("./providers/redis");
|
|
7
6
|
const nats_1 = require("./providers/nats");
|
|
7
|
+
const postgres_1 = require("./providers/postgres");
|
|
8
|
+
const redis_1 = require("./providers/redis");
|
|
8
9
|
class ConnectorService {
|
|
10
|
+
static async connectClient(ProviderConfig) {
|
|
11
|
+
const target = {};
|
|
12
|
+
await ConnectorService.initClient(ProviderConfig, target, 'client');
|
|
13
|
+
return target.client;
|
|
14
|
+
}
|
|
9
15
|
static async initClients(target) {
|
|
10
|
-
|
|
11
|
-
if (connections) {
|
|
12
|
-
if (connections.store) {
|
|
13
|
-
await ConnectorService.initClient(connections.store, target, 'store');
|
|
14
|
-
}
|
|
15
|
-
if (connections.stream) {
|
|
16
|
-
await ConnectorService.initClient(connections.stream, target, 'stream');
|
|
17
|
-
}
|
|
18
|
-
if (connections.sub) {
|
|
19
|
-
await ConnectorService.initClient(connections.sub, target, 'sub');
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
16
|
+
let connections = target.connections;
|
|
17
|
+
if (!connections) {
|
|
23
18
|
const ProviderConfig = utils_1.polyfill.providerConfig(target);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
connections = target.connections = {
|
|
20
|
+
store: { ...ProviderConfig },
|
|
21
|
+
stream: { ...ProviderConfig },
|
|
22
|
+
sub: { ...ProviderConfig },
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (connections.store) {
|
|
26
|
+
await ConnectorService.initClient(connections.store, target, 'store');
|
|
27
|
+
}
|
|
28
|
+
if (connections.stream) {
|
|
29
|
+
await ConnectorService.initClient(connections.stream, target, 'stream');
|
|
30
|
+
}
|
|
31
|
+
if (connections.sub) {
|
|
32
|
+
await ConnectorService.initClient(connections.sub, target, 'sub');
|
|
33
|
+
if (connections.sub.class === connections.store.class) {
|
|
34
|
+
connections.pub = {
|
|
35
|
+
class: connections.store.class,
|
|
36
|
+
options: { ...connections.store.options }
|
|
37
|
+
};
|
|
38
|
+
target.pub = target.store;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
connections.pub = {
|
|
42
|
+
class: connections.sub.class,
|
|
43
|
+
options: { ...connections.sub.options }
|
|
44
|
+
};
|
|
45
|
+
await ConnectorService.initClient(connections.pub, target, 'pub');
|
|
28
46
|
}
|
|
29
47
|
}
|
|
30
48
|
}
|
|
@@ -47,6 +65,9 @@ class ConnectorService {
|
|
|
47
65
|
case 'nats':
|
|
48
66
|
clientInstance = await nats_1.NatsConnection.connect(id, providerClass, options);
|
|
49
67
|
break;
|
|
68
|
+
case 'postgres':
|
|
69
|
+
clientInstance = await postgres_1.PostgresConnection.connect(id, providerClass, options);
|
|
70
|
+
break;
|
|
50
71
|
default:
|
|
51
72
|
throw new Error(`Unknown provider class: ${providerName}`);
|
|
52
73
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ProviderClass, ProviderNativeClient, ProviderOptions } from '../../types/provider';
|
|
2
|
+
import { ILogger } from '../logger';
|
|
2
3
|
declare abstract class AbstractConnection<PClass, POptions> {
|
|
4
|
+
static logger: ILogger;
|
|
3
5
|
protected connection: any | null;
|
|
4
6
|
protected static instances: Map<string, AbstractConnection<ProviderClass, ProviderOptions>>;
|
|
5
7
|
protected id: string | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AbstractConnection = void 0;
|
|
4
|
+
const logger_1 = require("../logger");
|
|
4
5
|
class AbstractConnection {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.connection = null;
|
|
@@ -32,4 +33,5 @@ class AbstractConnection {
|
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
exports.AbstractConnection = AbstractConnection;
|
|
36
|
+
AbstractConnection.logger = new logger_1.LoggerService('hotmesh', 'meshos');
|
|
35
37
|
AbstractConnection.instances = new Map();
|
|
@@ -11,11 +11,17 @@ class NatsConnection extends __1.AbstractConnection {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
async createConnection(Connect, options) {
|
|
14
|
-
|
|
14
|
+
try {
|
|
15
|
+
return (await Connect(options));
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
NatsConnection.logger.error(`nats-provider-connection-failed`, { ...error });
|
|
19
|
+
throw new Error(`nats-provider-connection-failed: ${error.message}`);
|
|
20
|
+
}
|
|
15
21
|
}
|
|
16
22
|
getClient() {
|
|
17
23
|
if (!this.connection) {
|
|
18
|
-
throw new Error('
|
|
24
|
+
throw new Error('nats-provider-connection-failed');
|
|
19
25
|
}
|
|
20
26
|
return this.connection;
|
|
21
27
|
}
|
|
@@ -2,7 +2,7 @@ import { AbstractConnection } from '..';
|
|
|
2
2
|
import { PostgresClientOptions, PostgresClientType, PostgresClassType } from '../../../types/postgres';
|
|
3
3
|
declare class PostgresConnection extends AbstractConnection<PostgresClassType, PostgresClientOptions> {
|
|
4
4
|
defaultOptions: PostgresClientOptions;
|
|
5
|
-
createConnection(
|
|
5
|
+
createConnection(clientConstructor: any, options: PostgresClientOptions): Promise<PostgresClientType>;
|
|
6
6
|
getClient(): PostgresClientType;
|
|
7
7
|
closeConnection(connection: PostgresClientType): Promise<void>;
|
|
8
8
|
}
|