@hotmeshio/hotmesh 0.3.19 → 0.3.20

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.
Files changed (91) hide show
  1. package/README.md +43 -14
  2. package/build/index.d.ts +5 -1
  3. package/build/index.js +9 -1
  4. package/build/modules/key.js +1 -1
  5. package/build/modules/utils.d.ts +0 -1
  6. package/build/modules/utils.js +1 -1
  7. package/build/package.json +5 -4
  8. package/build/services/activities/activity.js +1 -1
  9. package/build/services/activities/await.js +1 -1
  10. package/build/services/activities/cycle.js +1 -1
  11. package/build/services/activities/hook.js +1 -1
  12. package/build/services/activities/index.js +1 -1
  13. package/build/services/activities/interrupt.js +1 -1
  14. package/build/services/activities/signal.js +1 -1
  15. package/build/services/activities/trigger.js +1 -1
  16. package/build/services/activities/worker.js +1 -1
  17. package/build/services/collator/index.js +1 -1
  18. package/build/services/compiler/deployer.js +1 -1
  19. package/build/services/compiler/index.js +1 -1
  20. package/build/services/compiler/validator.js +1 -1
  21. package/build/services/connector/factory.d.ts +1 -0
  22. package/build/services/connector/factory.js +22 -21
  23. package/build/services/connector/index.d.ts +4 -2
  24. package/build/services/connector/index.js +10 -5
  25. package/build/services/connector/providers/postgres.d.ts +13 -2
  26. package/build/services/connector/providers/postgres.js +54 -9
  27. package/build/services/engine/index.js +1 -1
  28. package/build/services/exporter/index.js +1 -1
  29. package/build/services/hotmesh/index.js +1 -6
  30. package/build/services/mapper/index.js +1 -1
  31. package/build/services/meshflow/connection.js +1 -0
  32. package/build/services/meshflow/exporter.js +1 -1
  33. package/build/services/pipe/functions/array.js +1 -1
  34. package/build/services/pipe/functions/bitwise.js +1 -1
  35. package/build/services/pipe/functions/conditional.js +1 -1
  36. package/build/services/pipe/functions/cron.js +1 -1
  37. package/build/services/pipe/functions/date.js +1 -1
  38. package/build/services/pipe/functions/index.js +1 -1
  39. package/build/services/pipe/functions/json.js +1 -1
  40. package/build/services/pipe/functions/logical.js +1 -1
  41. package/build/services/pipe/functions/math.js +1 -1
  42. package/build/services/pipe/functions/number.js +1 -1
  43. package/build/services/pipe/functions/object.js +1 -1
  44. package/build/services/pipe/functions/string.js +1 -1
  45. package/build/services/pipe/functions/symbol.js +1 -1
  46. package/build/services/pipe/functions/unary.js +1 -1
  47. package/build/services/pipe/index.js +1 -1
  48. package/build/services/quorum/index.js +1 -1
  49. package/build/services/reporter/index.js +1 -1
  50. package/build/services/router/index.js +1 -1
  51. package/build/services/search/providers/postgres/postgres.js +1 -1
  52. package/build/services/search/providers/redis/ioredis.js +1 -1
  53. package/build/services/search/providers/redis/redis.js +1 -1
  54. package/build/services/serializer/index.js +1 -1
  55. package/build/services/store/providers/postgres/kvsql.js +1 -1
  56. package/build/services/store/providers/postgres/kvtables.d.ts +2 -2
  57. package/build/services/store/providers/postgres/kvtables.js +1 -1
  58. package/build/services/store/providers/postgres/kvtransaction.js +1 -1
  59. package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
  60. package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
  61. package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
  62. package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
  63. package/build/services/store/providers/postgres/postgres.js +1 -1
  64. package/build/services/store/providers/redis/_base.js +1 -1
  65. package/build/services/store/providers/redis/ioredis.js +1 -1
  66. package/build/services/store/providers/redis/redis.js +1 -1
  67. package/build/services/store/providers/store-initializable.js +1 -1
  68. package/build/services/stream/providers/nats/nats.js +1 -1
  69. package/build/services/stream/providers/postgres/postgres.js +1 -1
  70. package/build/services/stream/providers/redis/ioredis.js +1 -1
  71. package/build/services/stream/providers/redis/redis.js +1 -1
  72. package/build/services/stream/providers/stream-initializable.js +1 -1
  73. package/build/services/sub/factory.d.ts +2 -2
  74. package/build/services/sub/factory.js +13 -8
  75. package/build/services/sub/providers/nats/nats.d.ts +19 -0
  76. package/build/services/sub/providers/nats/nats.js +1 -0
  77. package/build/services/sub/providers/postgres/postgres.d.ts +1 -0
  78. package/build/services/sub/providers/postgres/postgres.js +1 -1
  79. package/build/services/sub/providers/redis/ioredis.js +1 -1
  80. package/build/services/sub/providers/redis/redis.js +1 -1
  81. package/build/services/task/index.js +1 -1
  82. package/build/services/telemetry/index.js +1 -1
  83. package/build/services/worker/index.js +1 -1
  84. package/build/types/nats.d.ts +8 -0
  85. package/build/types/postgres.d.ts +10 -1
  86. package/build/types/provider.d.ts +1 -0
  87. package/index.ts +20 -5
  88. package/package.json +5 -4
  89. package/types/nats.ts +34 -0
  90. package/types/postgres.ts +13 -2
  91. package/types/provider.ts +4 -0
@@ -1 +1 @@
1
- 'use strict';(function(_0xb438e1,_0x18cad8){const _0x2eef09=_0x4a32,_0x503346=_0xb438e1();while(!![]){try{const _0x48a627=parseInt(_0x2eef09(0x147))/0x1+parseInt(_0x2eef09(0x143))/0x2+-parseInt(_0x2eef09(0x144))/0x3+-parseInt(_0x2eef09(0x148))/0x4+parseInt(_0x2eef09(0x14b))/0x5*(parseInt(_0x2eef09(0x145))/0x6)+-parseInt(_0x2eef09(0x146))/0x7*(parseInt(_0x2eef09(0x149))/0x8)+parseInt(_0x2eef09(0x14a))/0x9;if(_0x48a627===_0x18cad8)break;else _0x503346['push'](_0x503346['shift']());}catch(_0x3f5c70){_0x503346['push'](_0x503346['shift']());}}}(_0x9ec7,0x642a0));function _0x4a32(_0x3865d6,_0x5f059b){const _0x9ec75e=_0x9ec7();return _0x4a32=function(_0x4a3261,_0x22c157){_0x4a3261=_0x4a3261-0x143;let _0x475837=_0x9ec75e[_0x4a3261];return _0x475837;},_0x4a32(_0x3865d6,_0x5f059b);}function _0x9ec7(){const _0x2a66c6=['5vrpAjp','731996OwGvTM','1026207TMeZcI','218490TaidJN','7SmrzFZ','184919wdrIIY','570836jOblvV','3836488Tniuuj','7085511LgLNFw'];_0x9ec7=function(){return _0x2a66c6;};return _0x9ec7();}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(_0x4ee637,_0x20efae,_0x422a22,_0x12d8d1,_0x441523,_0x15d4ce){super(_0x4ee637,_0x20efae,_0x422a22,_0x12d8d1,_0x441523,_0x15d4ce);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x2c3ddf;try{await this['verifyEntry'](),_0x2c3ddf=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x2c3ddf['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0x2c3ddf):await this['interruptAnother'](_0x2c3ddf);}catch(_0x30800a){if(_0x30800a instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0x30800a});return;}else{if(_0x30800a instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x30800a});return;}else{if(_0x30800a instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0x30800a});return;}else{if(_0x30800a instanceof errors_1['CollationError']){if(_0x30800a['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',{..._0x30800a});}else this['logger']['error']('interrupt-process-error',{..._0x30800a});}}}_0x2c3ddf?.['setActivityError'](_0x30800a['message']);throw _0x30800a;}finally{_0x2c3ddf?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x5d9de7){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x34bd2d=await this['interrupt']();_0x5d9de7['mapActivityAttributes']();const _0x44b37b=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x44b37b),await this['setStatus'](-0x1,_0x44b37b);const _0x40cecb=await _0x44b37b['exec'](),_0x13ffa9=this['resolveStatus'](_0x40cecb);return _0x5d9de7['setActivityAttributes']({'app.activity.mid':_0x34bd2d,'app.job.jss':_0x13ffa9}),this['context']['metadata']['aid'];}async['interruptAnother'](_0xe49fbe){const _0xb91115=await this['interrupt'](),_0x33e9b3={'app.activity.mid':_0xb91115};_0xe49fbe['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x6da264=this['store']['transact']();await this['setState'](_0x6da264);}const _0x3a584b=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x3a584b),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x3a584b);const _0x171fce=await _0x3a584b['exec'](),_0x9d4ac5=this['resolveStatus'](_0x171fce);_0x33e9b3['app.job.jss']=_0x9d4ac5;const _0xb48546=await this['transition'](this['adjacencyList'],_0x9d4ac5);return _0xb48546['length']&&(_0x33e9b3['app.activity.mids']=_0xb48546['join'](',')),_0xe49fbe['setActivityAttributes'](_0x33e9b3),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0x1e8e8a=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0x1e8e8a==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 _0x28b759=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'],_0x28b759);}}exports['Interrupt']=Interrupt;
1
+ 'use strict';(function(_0x18431f,_0x5d725d){const _0x1fd913=_0x5b97,_0x44ee78=_0x18431f();while(!![]){try{const _0x1451a8=parseInt(_0x1fd913(0x14c))/0x1+parseInt(_0x1fd913(0x14a))/0x2*(parseInt(_0x1fd913(0x151))/0x3)+parseInt(_0x1fd913(0x14b))/0x4+parseInt(_0x1fd913(0x153))/0x5*(parseInt(_0x1fd913(0x14e))/0x6)+-parseInt(_0x1fd913(0x150))/0x7*(-parseInt(_0x1fd913(0x14f))/0x8)+parseInt(_0x1fd913(0x14d))/0x9+-parseInt(_0x1fd913(0x152))/0xa;if(_0x1451a8===_0x5d725d)break;else _0x44ee78['push'](_0x44ee78['shift']());}catch(_0x372862){_0x44ee78['push'](_0x44ee78['shift']());}}}(_0x19f0,0x9125b));function _0x19f0(){const _0x5a245a=['2966112KbpNpi','46156FmfUgc','5668488mHZQkY','6eLkLOj','1432TFTjxy','22960GGAkxZ','713598zSYAMd','26858630KOMBFd','5189420iJxIzG','2FIYUJa'];_0x19f0=function(){return _0x5a245a;};return _0x19f0();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Interrupt']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');function _0x5b97(_0x3d412c,_0x24910f){const _0x19f09f=_0x19f0();return _0x5b97=function(_0x5b973e,_0x13d41e){_0x5b973e=_0x5b973e-0x14a;let _0x33abb8=_0x19f09f[_0x5b973e];return _0x33abb8;},_0x5b97(_0x3d412c,_0x24910f);}class Interrupt extends activity_1['Activity']{constructor(_0x44a653,_0x5ed2e6,_0x2dd922,_0x17ee47,_0x40b2c3,_0x2906ec){super(_0x44a653,_0x5ed2e6,_0x2dd922,_0x17ee47,_0x40b2c3,_0x2906ec);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x5f356d;try{await this['verifyEntry'](),_0x5f356d=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x5f356d['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0x5f356d):await this['interruptAnother'](_0x5f356d);}catch(_0x98f106){if(_0x98f106 instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0x98f106});return;}else{if(_0x98f106 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x98f106});return;}else{if(_0x98f106 instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0x98f106});return;}else{if(_0x98f106 instanceof errors_1['CollationError']){if(_0x98f106['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',{..._0x98f106});}else this['logger']['error']('interrupt-process-error',{..._0x98f106});}}}_0x5f356d?.['setActivityError'](_0x98f106['message']);throw _0x98f106;}finally{_0x5f356d?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x2e8ff7){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x29f3b3=await this['interrupt']();_0x2e8ff7['mapActivityAttributes']();const _0x566af1=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x566af1),await this['setStatus'](-0x1,_0x566af1);const _0x4dccbc=await _0x566af1['exec'](),_0x2d7c9f=this['resolveStatus'](_0x4dccbc);return _0x2e8ff7['setActivityAttributes']({'app.activity.mid':_0x29f3b3,'app.job.jss':_0x2d7c9f}),this['context']['metadata']['aid'];}async['interruptAnother'](_0xb8316a){const _0x1648ae=await this['interrupt'](),_0xbb7019={'app.activity.mid':_0x1648ae};_0xb8316a['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x3e0577=this['store']['transact']();await this['setState'](_0x3e0577);}const _0x34cd2e=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x34cd2e),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x34cd2e);const _0x4c8bb7=await _0x34cd2e['exec'](),_0xc4230f=this['resolveStatus'](_0x4c8bb7);_0xbb7019['app.job.jss']=_0xc4230f;const _0x553466=await this['transition'](this['adjacencyList'],_0xc4230f);return _0x553466['length']&&(_0xbb7019['app.activity.mids']=_0x553466['join'](',')),_0xb8316a['setActivityAttributes'](_0xbb7019),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0xd15168=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0xd15168==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 _0x5c8ffb=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'],_0x5c8ffb);}}exports['Interrupt']=Interrupt;
@@ -1 +1 @@
1
- 'use strict';(function(_0x2ad3e1,_0x11ca21){const _0x559a2c=_0x14bf,_0x47a60e=_0x2ad3e1();while(!![]){try{const _0x14864b=parseInt(_0x559a2c(0x1b2))/0x1+-parseInt(_0x559a2c(0x1ae))/0x2*(parseInt(_0x559a2c(0x1b5))/0x3)+parseInt(_0x559a2c(0x1ad))/0x4+parseInt(_0x559a2c(0x1b4))/0x5+parseInt(_0x559a2c(0x1b3))/0x6*(parseInt(_0x559a2c(0x1b0))/0x7)+-parseInt(_0x559a2c(0x1af))/0x8+-parseInt(_0x559a2c(0x1b1))/0x9;if(_0x14864b===_0x11ca21)break;else _0x47a60e['push'](_0x47a60e['shift']());}catch(_0xf6f797){_0x47a60e['push'](_0x47a60e['shift']());}}}(_0x41b6,0x51f54));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(_0x3ccc7f,_0x113f8b,_0x19f5a3,_0x4f5e02,_0x4808c7,_0xebcfa4){super(_0x3ccc7f,_0x113f8b,_0x19f5a3,_0x4f5e02,_0x4808c7,_0xebcfa4);}async['process'](){this['logger']['debug']('signal-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x119241;try{await this['verifyEntry'](),_0x119241=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x119241['startActivitySpan'](this['leg']);const _0x2b8fcb=this['store']['transact']();this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x2b8fcb),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x2b8fcb),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x2b8fcb);const _0x9df118=await _0x2b8fcb['exec']();this['config']['subtype']==='all'?await this['hookAll']():await this['hookOne']();const _0x78630b=this['resolveStatus'](_0x9df118),_0x25fdd7={'app.job.jss':_0x78630b},_0x223d53=await this['transition'](this['adjacencyList'],_0x78630b);return _0x223d53['length']&&(_0x25fdd7['app.activity.mids']=_0x223d53['join'](',')),_0x119241['mapActivityAttributes'](),_0x119241['setActivityAttributes'](_0x25fdd7),this['context']['metadata']['aid'];}catch(_0x10d994){if(_0x10d994 instanceof errors_1['InactiveJobError']){this['logger']['error']('signal-inactive-job-error',{..._0x10d994});return;}else{if(_0x10d994 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x10d994});return;}else{if(_0x10d994 instanceof errors_1['GetStateError']){this['logger']['error']('signal-get-state-error',{..._0x10d994});return;}else{if(_0x10d994 instanceof errors_1['CollationError']){if(_0x10d994['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',{..._0x10d994});}else this['logger']['error']('signal-process-error',{..._0x10d994});}}}_0x119241?.['setActivityError'](_0x10d994['message']);throw _0x10d994;}finally{_0x119241?.['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 _0x3e5629=new mapper_1['MapperService'](this['config']['signal']['maps'],this['context']);return _0x3e5629['mapRules']();}}['mapResolverData'](){if(this['config']['resolver']?.['maps']){const _0x2c75b1=new mapper_1['MapperService'](this['config']['resolver']['maps'],this['context']);return _0x2c75b1['mapRules']();}}async['hookOne'](){const _0x1dc8ac=pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']),_0x1f0807=this['mapSignalData'](),_0x26fea4=pipe_1['Pipe']['resolve'](this['config']['status'],this['context']),_0x38f7e8=pipe_1['Pipe']['resolve'](this['config']['code'],this['context']);return await this['engine']['hook'](_0x1dc8ac,_0x1f0807,_0x26fea4,_0x38f7e8);}async['hookAll'](){const _0x379e5d=this['mapSignalData'](),_0x43a61d=this['mapResolverData']();this['config']['scrub']&&(_0x43a61d['scrub']=!![]);const _0xb26c1=pipe_1['Pipe']['resolve'](this['config']['key_name'],this['context']),_0xd53eb=pipe_1['Pipe']['resolve'](this['config']['key_value'],this['context']),_0x1d6b1a=[_0xb26c1+':'+_0xd53eb];return await this['engine']['hookAll'](this['config']['topic'],_0x379e5d,_0x43a61d,_0x1d6b1a);}}function _0x14bf(_0x387049,_0x397783){const _0x41b6e4=_0x41b6();return _0x14bf=function(_0x14bfd6,_0x2370d8){_0x14bfd6=_0x14bfd6-0x1ad;let _0x5d79c5=_0x41b6e4[_0x14bfd6];return _0x5d79c5;},_0x14bf(_0x387049,_0x397783);}exports['Signal']=Signal;function _0x41b6(){const _0x37d430=['509424sAatRH','3872757NMxwgt','7222644putSnB','260444DcEnbI','6kJTKRD','1357670DYVspu','835656dkNoNt','1580868wPALrk','2rJRWKj'];_0x41b6=function(){return _0x37d430;};return _0x41b6();}
1
+ 'use strict';(function(_0x14ef2f,_0xf117ca){const _0x199384=_0x248f,_0x1e3b48=_0x14ef2f();while(!![]){try{const _0x4c6353=-parseInt(_0x199384(0xc1))/0x1+parseInt(_0x199384(0xc4))/0x2+-parseInt(_0x199384(0xc3))/0x3+-parseInt(_0x199384(0xc7))/0x4*(-parseInt(_0x199384(0xc8))/0x5)+parseInt(_0x199384(0xc6))/0x6+parseInt(_0x199384(0xc0))/0x7+-parseInt(_0x199384(0xc2))/0x8*(parseInt(_0x199384(0xc5))/0x9);if(_0x4c6353===_0xf117ca)break;else _0x1e3b48['push'](_0x1e3b48['shift']());}catch(_0xa79529){_0x1e3b48['push'](_0x1e3b48['shift']());}}}(_0x49a6,0x782d7));function _0x49a6(){const _0x50fe88=['789044zMwvHC','8kxRLYZ','768372rCtPSw','1395874OxBahv','7762581RJXXCT','2005836hRouSK','279644LAInin','55eymnbk','4190620KRTwUa'];_0x49a6=function(){return _0x50fe88;};return _0x49a6();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Signal']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');function _0x248f(_0x2973b6,_0x55a09e){const _0x49a6cb=_0x49a6();return _0x248f=function(_0x248f0c,_0x48aa59){_0x248f0c=_0x248f0c-0xc0;let _0x1e2193=_0x49a6cb[_0x248f0c];return _0x1e2193;},_0x248f(_0x2973b6,_0x55a09e);}class Signal extends activity_1['Activity']{constructor(_0x5e81cb,_0x56d3c1,_0x47d13e,_0xbc58b,_0x470555,_0x4a430a){super(_0x5e81cb,_0x56d3c1,_0x47d13e,_0xbc58b,_0x470555,_0x4a430a);}async['process'](){this['logger']['debug']('signal-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x559f72;try{await this['verifyEntry'](),_0x559f72=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x559f72['startActivitySpan'](this['leg']);const _0x3d017c=this['store']['transact']();this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x3d017c),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x3d017c),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x3d017c);const _0x532987=await _0x3d017c['exec']();this['config']['subtype']==='all'?await this['hookAll']():await this['hookOne']();const _0x38f489=this['resolveStatus'](_0x532987),_0x503536={'app.job.jss':_0x38f489},_0x377966=await this['transition'](this['adjacencyList'],_0x38f489);return _0x377966['length']&&(_0x503536['app.activity.mids']=_0x377966['join'](',')),_0x559f72['mapActivityAttributes'](),_0x559f72['setActivityAttributes'](_0x503536),this['context']['metadata']['aid'];}catch(_0x16954c){if(_0x16954c instanceof errors_1['InactiveJobError']){this['logger']['error']('signal-inactive-job-error',{..._0x16954c});return;}else{if(_0x16954c instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x16954c});return;}else{if(_0x16954c instanceof errors_1['GetStateError']){this['logger']['error']('signal-get-state-error',{..._0x16954c});return;}else{if(_0x16954c instanceof errors_1['CollationError']){if(_0x16954c['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',{..._0x16954c});}else this['logger']['error']('signal-process-error',{..._0x16954c});}}}_0x559f72?.['setActivityError'](_0x16954c['message']);throw _0x16954c;}finally{_0x559f72?.['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 _0x5c58a1=new mapper_1['MapperService'](this['config']['signal']['maps'],this['context']);return _0x5c58a1['mapRules']();}}['mapResolverData'](){if(this['config']['resolver']?.['maps']){const _0x3918f2=new mapper_1['MapperService'](this['config']['resolver']['maps'],this['context']);return _0x3918f2['mapRules']();}}async['hookOne'](){const _0x82015a=pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']),_0x2b9d17=this['mapSignalData'](),_0x2f9827=pipe_1['Pipe']['resolve'](this['config']['status'],this['context']),_0x555e4c=pipe_1['Pipe']['resolve'](this['config']['code'],this['context']);return await this['engine']['hook'](_0x82015a,_0x2b9d17,_0x2f9827,_0x555e4c);}async['hookAll'](){const _0x1123cd=this['mapSignalData'](),_0x8ba19a=this['mapResolverData']();this['config']['scrub']&&(_0x8ba19a['scrub']=!![]);const _0x4a6112=pipe_1['Pipe']['resolve'](this['config']['key_name'],this['context']),_0x3551eb=pipe_1['Pipe']['resolve'](this['config']['key_value'],this['context']),_0x451794=[_0x4a6112+':'+_0x3551eb];return await this['engine']['hookAll'](this['config']['topic'],_0x1123cd,_0x8ba19a,_0x451794);}}exports['Signal']=Signal;
@@ -1 +1 @@
1
- 'use strict';(function(_0x139e42,_0x4326a2){const _0x12292e=_0x14e7,_0x5cf956=_0x139e42();while(!![]){try{const _0x2bccf1=parseInt(_0x12292e(0x79))/0x1*(-parseInt(_0x12292e(0x71))/0x2)+parseInt(_0x12292e(0x75))/0x3+parseInt(_0x12292e(0x76))/0x4*(-parseInt(_0x12292e(0x77))/0x5)+-parseInt(_0x12292e(0x74))/0x6+parseInt(_0x12292e(0x78))/0x7*(-parseInt(_0x12292e(0x7a))/0x8)+parseInt(_0x12292e(0x73))/0x9+parseInt(_0x12292e(0x72))/0xa;if(_0x2bccf1===_0x4326a2)break;else _0x5cf956['push'](_0x5cf956['shift']());}catch(_0x1dd5aa){_0x5cf956['push'](_0x5cf956['shift']());}}}(_0x5c92,0xe8b52));function _0x14e7(_0x1c98f1,_0xe6c837){const _0x5c92a9=_0x5c92();return _0x14e7=function(_0x14e77e,_0x3f0aca){_0x14e77e=_0x14e77e-0x71;let _0x1da300=_0x5c92a9[_0x14e77e];return _0x1da300;},_0x14e7(_0x1c98f1,_0xe6c837);}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(_0x9f81ab,_0x35db49,_0x12cdcc,_0x5e82ba,_0x45747f,_0x4c02ed){super(_0x9f81ab,_0x35db49,_0x12cdcc,_0x5e82ba,_0x45747f,_0x4c02ed);}async['process'](_0x4c1604){this['logger']['debug']('trigger-process',{'subscribes':this['config']['subscribes']});let _0x307cbf;try{this['setLeg'](0x2),await this['getState'](),_0x307cbf=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x307cbf['startJobSpan'](),_0x307cbf['startActivitySpan'](this['leg']),this['mapJobData'](),this['adjacencyList']=await this['filterAdjacent']();const _0xbe9b26=this['initStatus'](_0x4c1604,this['adjacencyList']['length']);await this['setStateNX'](_0xbe9b26),await this['setStatus'](_0xbe9b26),this['bindSearchData'](_0x4c1604),this['bindMarkerData'](_0x4c1604);const _0x178353=this['store']['transact']();await this['setState'](_0x178353),await this['setStats'](_0x178353);_0x4c1604?.['pending']&&await this['setExpired'](_0x4c1604?.['pending'],_0x178353);await collator_1['CollatorService']['notarizeInception'](this,this['context']['metadata']['guid'],_0x178353),await _0x178353['exec'](),this['execAdjacentParent'](),_0x307cbf['mapActivityAttributes']();const _0x417ccb=Number(this['context']['metadata']['js']);_0x307cbf['setJobAttributes']({'app.job.jss':_0x417ccb});const _0x1ebe85={'app.job.jss':_0x417ccb};return await this['transitionAndLogAdjacent'](_0x4c1604,_0x417ccb,_0x1ebe85),_0x307cbf['setActivityAttributes'](_0x1ebe85),this['context']['metadata']['jid'];}catch(_0x31d467){_0x307cbf?.['setActivityError'](_0x31d467['message']);if(_0x31d467 instanceof errors_1['DuplicateJobError']){await(0x0,utils_1['sleepFor'])(0x3e8);const _0x151806=await collator_1['CollatorService']['isInceptionOverage'](this,this['context']['metadata']['guid']);if(_0x151806){this['logger']['info']('trigger-collation-overage',{'job_id':_0x31d467['jobId'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('duplicate-job-error',{'job_id':_0x31d467['jobId'],'guid':this['context']['metadata']['guid']});}else this['logger']['error']('trigger-process-error',{..._0x31d467});throw _0x31d467;}finally{_0x307cbf?.['endJobSpan'](),_0x307cbf?.['endActivitySpan'](),this['logger']['debug']('trigger-process-end',{'subscribes':this['config']['subscribes'],'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid']});}}async['transitionAndLogAdjacent'](_0x1fd3e1={},_0x51f95b,_0x519a87){if(isNaN(_0x1fd3e1['pending'])){const _0x28ad5d=await this['transition'](this['adjacencyList'],_0x51f95b);_0x28ad5d['length']&&(_0x519a87['app.activity.mids']=_0x28ad5d['join'](','));}}['initStatus'](_0x126394={},_0x1bdfb9){if(_0x126394['pending'])return-0x1;return _0x1bdfb9;}async['setExpired'](_0xd85a65,_0x3d5003){await this['store']['expireJob'](this['context']['metadata']['jid'],_0xd85a65,_0x3d5003);}['safeKey'](_0xde152e){return'_'+_0xde152e;}['bindSearchData'](_0x30e40b){_0x30e40b?.['search']&&Object['keys'](_0x30e40b['search'])['forEach'](_0x5cd385=>{this['context']['data'][this['safeKey'](_0x5cd385)]=_0x30e40b['search'][_0x5cd385]['toString']();});}['bindMarkerData'](_0x251da0){_0x251da0?.['marker']&&Object['keys'](_0x251da0['marker'])['forEach'](_0x1b72b7=>{_0x1b72b7['startsWith']('-')&&(this['context']['data'][_0x1b72b7]=_0x251da0['marker'][_0x1b72b7]['toString']());});}async['setStatus'](_0x10cf24){this['context']['metadata']['js']=_0x10cf24;}async['execAdjacentParent'](){if(this['context']['metadata']['px']){const _0x3a7aaa=(0x0,utils_1['formatISODate'])(new Date()),_0x18dfab={'metadata':this['context']['metadata'],'data':{'job_id':this['context']['metadata']['jid'],'jc':_0x3a7aaa,'ju':_0x3a7aaa}};await this['engine']['execAdjacentParent'](this['context'],_0x18dfab);}}['createInputContext'](){const _0x1f420c={[this['metadata']['aid']]:{'input':{'data':this['data']}},'$self':{'input':{'data':this['data']},'output':{'data':this['data']}}};return _0x1f420c;}async['getState'](){const _0xdab977=this['createInputContext'](),_0xd25e30=this['resolveJobId'](_0xdab977),_0x2d5246=this['resolveJobKey'](_0xdab977),_0x241ae7=(0x0,utils_1['formatISODate'])(new Date()),{id:_0x5f479d,version:_0x577ab4}=await this['engine']['getVID']();this['initDimensionalAddress'](collator_1['CollatorService']['getDimensionalSeed']());const _0x156853={...this['metadata'],'jid':_0xd25e30,'key':_0x2d5246,'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':_0x5f479d,'vrs':_0x577ab4,'tpc':this['config']['subscribes'],'trc':this['context']['metadata']['trc'],'spn':this['context']['metadata']['spn'],'guid':this['context']['metadata']['guid'],'jid':_0xd25e30,'dad':collator_1['CollatorService']['getDimensionalSeed'](),'key':_0x2d5246,'jc':_0x241ae7,'ju':_0x241ae7,'ts':(0x0,utils_1['getTimeSeries'])(this['resolveGranularity']()),'js':0x0},'data':{},[this['metadata']['aid']]:{'input':{'data':this['data'],'metadata':_0x156853},'output':{'data':this['data'],'metadata':_0x156853},'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'](_0xc4626a=>'metadata/'+_0xc4626a);}['bindActivityMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['ACTIVITY']['KEYS']['map'](_0x2ce363=>'output/metadata/'+_0x2ce363);}['resolveGranularity'](){return this['config']['stats']?.['granularity']||reporter_1['ReporterService']['DEFAULT_GRANULARITY'];}['getJobStatus'](){return this['context']['metadata']['js'];}['resolveJobId'](_0x47b8b9){const _0x542fc9=this['config']['stats']?.['id'];return _0x542fc9?pipe_1['Pipe']['resolve'](_0x542fc9,_0x47b8b9):(0x0,utils_1['guid'])();}['resolveJobKey'](_0x36ec3a){const _0x14a7e7=this['config']['stats']?.['key'];return _0x14a7e7?pipe_1['Pipe']['resolve'](_0x14a7e7,_0x36ec3a):'';}async['setStateNX'](_0x42091e){const _0x2da680=this['context']['metadata']['jid'];if(!await this['store']['setStateNX'](_0x2da680,this['engine']['appId'],_0x42091e))throw new errors_1['DuplicateJobError'](_0x2da680);}async['setStats'](_0x241ffc){const _0x117329=this['context']['metadata'];if(_0x117329['key']&&this['config']['stats']?.['measures']){const _0x37db6b=await this['engine']['getVID'](),_0x1f21b3=new reporter_1['ReporterService'](_0x37db6b,this['store'],this['logger']);await this['store']['setStats'](_0x117329['key'],_0x117329['jid'],_0x117329['ts'],_0x1f21b3['resolveTriggerStatistics'](this['config'],this['context']),_0x37db6b,_0x241ffc);}}}function _0x5c92(){const _0x242852=['7385658fPDlcR','3680193qEGBNJ','28VUYwED','489125fTIECr','217014QqWyAn','97506dwGRRP','328NbttCU','12AswdOq','16190230IYnala','16913268MEUzxC'];_0x5c92=function(){return _0x242852;};return _0x5c92();}exports['Trigger']=Trigger;
1
+ 'use strict';(function(_0x587770,_0x48917d){const _0x24accc=_0x354c,_0x12cdb1=_0x587770();while(!![]){try{const _0x51df2a=parseInt(_0x24accc(0x1a3))/0x1+-parseInt(_0x24accc(0x1ac))/0x2*(-parseInt(_0x24accc(0x1aa))/0x3)+parseInt(_0x24accc(0x1a4))/0x4*(-parseInt(_0x24accc(0x1a8))/0x5)+-parseInt(_0x24accc(0x1a5))/0x6*(parseInt(_0x24accc(0x1ae))/0x7)+-parseInt(_0x24accc(0x1a7))/0x8*(-parseInt(_0x24accc(0x1ab))/0x9)+parseInt(_0x24accc(0x1ad))/0xa+parseInt(_0x24accc(0x1a6))/0xb*(parseInt(_0x24accc(0x1a9))/0xc);if(_0x51df2a===_0x48917d)break;else _0x12cdb1['push'](_0x12cdb1['shift']());}catch(_0x20ee66){_0x12cdb1['push'](_0x12cdb1['shift']());}}}(_0xeb40,0x454ab));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Trigger']=void 0x0;function _0xeb40(){const _0x19b86b=['3OAxUyB','153APYCeA','736282eTELYH','770990EwxCBV','48111Tdaeti','205269hbNiQC','1183928oZOpti','474KPsUFK','72952jiYSDv','38104luAikv','5RxWaRo','708dKhrPI'];_0xeb40=function(){return _0x19b86b;};return _0xeb40();}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(_0x360b26,_0x25b693,_0x49d262,_0x120129,_0x3b70e2,_0x5ca404){super(_0x360b26,_0x25b693,_0x49d262,_0x120129,_0x3b70e2,_0x5ca404);}async['process'](_0x35e519){this['logger']['debug']('trigger-process',{'subscribes':this['config']['subscribes']});let _0x9fdd53;try{this['setLeg'](0x2),await this['getState'](),_0x9fdd53=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x9fdd53['startJobSpan'](),_0x9fdd53['startActivitySpan'](this['leg']),this['mapJobData'](),this['adjacencyList']=await this['filterAdjacent']();const _0x3b7a3c=this['initStatus'](_0x35e519,this['adjacencyList']['length']);await this['setStateNX'](_0x3b7a3c),await this['setStatus'](_0x3b7a3c),this['bindSearchData'](_0x35e519),this['bindMarkerData'](_0x35e519);const _0x48356b=this['store']['transact']();await this['setState'](_0x48356b),await this['setStats'](_0x48356b);_0x35e519?.['pending']&&await this['setExpired'](_0x35e519?.['pending'],_0x48356b);await collator_1['CollatorService']['notarizeInception'](this,this['context']['metadata']['guid'],_0x48356b),await _0x48356b['exec'](),this['execAdjacentParent'](),_0x9fdd53['mapActivityAttributes']();const _0x31c243=Number(this['context']['metadata']['js']);_0x9fdd53['setJobAttributes']({'app.job.jss':_0x31c243});const _0x50b49a={'app.job.jss':_0x31c243};return await this['transitionAndLogAdjacent'](_0x35e519,_0x31c243,_0x50b49a),_0x9fdd53['setActivityAttributes'](_0x50b49a),this['context']['metadata']['jid'];}catch(_0x217829){_0x9fdd53?.['setActivityError'](_0x217829['message']);if(_0x217829 instanceof errors_1['DuplicateJobError']){await(0x0,utils_1['sleepFor'])(0x3e8);const _0x3e6d5c=await collator_1['CollatorService']['isInceptionOverage'](this,this['context']['metadata']['guid']);if(_0x3e6d5c){this['logger']['info']('trigger-collation-overage',{'job_id':_0x217829['jobId'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('duplicate-job-error',{'job_id':_0x217829['jobId'],'guid':this['context']['metadata']['guid']});}else this['logger']['error']('trigger-process-error',{..._0x217829});throw _0x217829;}finally{_0x9fdd53?.['endJobSpan'](),_0x9fdd53?.['endActivitySpan'](),this['logger']['debug']('trigger-process-end',{'subscribes':this['config']['subscribes'],'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid']});}}async['transitionAndLogAdjacent'](_0x5d76fd={},_0x1e1266,_0x367e6e){if(isNaN(_0x5d76fd['pending'])){const _0x4ee9ba=await this['transition'](this['adjacencyList'],_0x1e1266);_0x4ee9ba['length']&&(_0x367e6e['app.activity.mids']=_0x4ee9ba['join'](','));}}['initStatus'](_0x2bcc63={},_0x1c6c88){if(_0x2bcc63['pending'])return-0x1;return _0x1c6c88;}async['setExpired'](_0x1d50ba,_0x58e5db){await this['store']['expireJob'](this['context']['metadata']['jid'],_0x1d50ba,_0x58e5db);}['safeKey'](_0x5f56b7){return'_'+_0x5f56b7;}['bindSearchData'](_0x54806a){_0x54806a?.['search']&&Object['keys'](_0x54806a['search'])['forEach'](_0x5334cd=>{this['context']['data'][this['safeKey'](_0x5334cd)]=_0x54806a['search'][_0x5334cd]['toString']();});}['bindMarkerData'](_0x1adcc3){_0x1adcc3?.['marker']&&Object['keys'](_0x1adcc3['marker'])['forEach'](_0x13678f=>{_0x13678f['startsWith']('-')&&(this['context']['data'][_0x13678f]=_0x1adcc3['marker'][_0x13678f]['toString']());});}async['setStatus'](_0x44b679){this['context']['metadata']['js']=_0x44b679;}async['execAdjacentParent'](){if(this['context']['metadata']['px']){const _0x23cebc=(0x0,utils_1['formatISODate'])(new Date()),_0x1e26dc={'metadata':this['context']['metadata'],'data':{'job_id':this['context']['metadata']['jid'],'jc':_0x23cebc,'ju':_0x23cebc}};await this['engine']['execAdjacentParent'](this['context'],_0x1e26dc);}}['createInputContext'](){const _0x369e17={[this['metadata']['aid']]:{'input':{'data':this['data']}},'$self':{'input':{'data':this['data']},'output':{'data':this['data']}}};return _0x369e17;}async['getState'](){const _0x48f4f8=this['createInputContext'](),_0x245ae2=this['resolveJobId'](_0x48f4f8),_0x5d7cd2=this['resolveJobKey'](_0x48f4f8),_0x7d7d28=(0x0,utils_1['formatISODate'])(new Date()),{id:_0x2f2114,version:_0x1170f9}=await this['engine']['getVID']();this['initDimensionalAddress'](collator_1['CollatorService']['getDimensionalSeed']());const _0x29ae11={...this['metadata'],'jid':_0x245ae2,'key':_0x5d7cd2,'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':_0x2f2114,'vrs':_0x1170f9,'tpc':this['config']['subscribes'],'trc':this['context']['metadata']['trc'],'spn':this['context']['metadata']['spn'],'guid':this['context']['metadata']['guid'],'jid':_0x245ae2,'dad':collator_1['CollatorService']['getDimensionalSeed'](),'key':_0x5d7cd2,'jc':_0x7d7d28,'ju':_0x7d7d28,'ts':(0x0,utils_1['getTimeSeries'])(this['resolveGranularity']()),'js':0x0},'data':{},[this['metadata']['aid']]:{'input':{'data':this['data'],'metadata':_0x29ae11},'output':{'data':this['data'],'metadata':_0x29ae11},'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'](_0xa7b9d1=>'metadata/'+_0xa7b9d1);}['bindActivityMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['ACTIVITY']['KEYS']['map'](_0x50b8e9=>'output/metadata/'+_0x50b8e9);}['resolveGranularity'](){return this['config']['stats']?.['granularity']||reporter_1['ReporterService']['DEFAULT_GRANULARITY'];}['getJobStatus'](){return this['context']['metadata']['js'];}['resolveJobId'](_0xe9a37f){const _0x3b32a5=this['config']['stats']?.['id'];return _0x3b32a5?pipe_1['Pipe']['resolve'](_0x3b32a5,_0xe9a37f):(0x0,utils_1['guid'])();}['resolveJobKey'](_0x1edd9f){const _0x1e9638=this['config']['stats']?.['key'];return _0x1e9638?pipe_1['Pipe']['resolve'](_0x1e9638,_0x1edd9f):'';}async['setStateNX'](_0x14765d){const _0x2c657b=this['context']['metadata']['jid'];if(!await this['store']['setStateNX'](_0x2c657b,this['engine']['appId'],_0x14765d))throw new errors_1['DuplicateJobError'](_0x2c657b);}async['setStats'](_0x5e3fac){const _0x139c5b=this['context']['metadata'];if(_0x139c5b['key']&&this['config']['stats']?.['measures']){const _0x20d500=await this['engine']['getVID'](),_0x1d64da=new reporter_1['ReporterService'](_0x20d500,this['store'],this['logger']);await this['store']['setStats'](_0x139c5b['key'],_0x139c5b['jid'],_0x139c5b['ts'],_0x1d64da['resolveTriggerStatistics'](this['config'],this['context']),_0x20d500,_0x5e3fac);}}}function _0x354c(_0x43dec1,_0x22410a){const _0xeb405d=_0xeb40();return _0x354c=function(_0x354c66,_0x3cc157){_0x354c66=_0x354c66-0x1a3;let _0x1bd291=_0xeb405d[_0x354c66];return _0x1bd291;},_0x354c(_0x43dec1,_0x22410a);}exports['Trigger']=Trigger;
@@ -1 +1 @@
1
- 'use strict';function _0x55dc(){const _0x3c3d02=['5817664pEuTEN','3429EjeJWI','9yugCoj','14012750xIlrAh','5zEHNle','6525192xAytiY','7024XLLERx','1242126hRlvEg','421422pMHURQ','8999081snounN'];_0x55dc=function(){return _0x3c3d02;};return _0x55dc();}(function(_0x7f505c,_0x74f23e){const _0x854c0=_0x5bd7,_0x3caf1f=_0x7f505c();while(!![]){try{const _0x4b15cf=-parseInt(_0x854c0(0x11c))/0x1+-parseInt(_0x854c0(0x11d))/0x2*(parseInt(_0x854c0(0x117))/0x3)+parseInt(_0x854c0(0x115))/0x4+parseInt(_0x854c0(0x119))/0x5*(-parseInt(_0x854c0(0x11a))/0x6)+parseInt(_0x854c0(0x114))/0x7+-parseInt(_0x854c0(0x11b))/0x8*(parseInt(_0x854c0(0x116))/0x9)+parseInt(_0x854c0(0x118))/0xa;if(_0x4b15cf===_0x74f23e)break;else _0x3caf1f['push'](_0x3caf1f['shift']());}catch(_0x3dbe3f){_0x3caf1f['push'](_0x3caf1f['shift']());}}}(_0x55dc,0xce4a5));function _0x5bd7(_0x154944,_0x2027db){const _0x55dc92=_0x55dc();return _0x5bd7=function(_0x5bd738,_0x11b0a5){_0x5bd738=_0x5bd738-0x114;let _0x568780=_0x55dc92[_0x5bd738];return _0x568780;},_0x5bd7(_0x154944,_0x2027db);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Worker']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Worker extends activity_1['Activity']{constructor(_0x54fb86,_0x3a59e1,_0xeac259,_0x4e94fa,_0x4880e1,_0x8dd9ba){super(_0x54fb86,_0x3a59e1,_0xeac259,_0x4e94fa,_0x4880e1,_0x8dd9ba);}async['process'](){this['logger']['debug']('worker-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x41db9d;try{await this['verifyEntry'](),_0x41db9d=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x41db9d['startActivitySpan'](this['leg']),this['mapInputData']();const _0x125391=this['store']['transact'](),_0x923fe0=await this['execActivity'](_0x125391);await collator_1['CollatorService']['authorizeReentry'](this,_0x125391),await this['setState'](_0x125391),await this['setStatus'](0x0,_0x125391);const _0x25e8f3=await _0x125391['exec']();_0x41db9d['mapActivityAttributes']();const _0x5dfd5d=this['resolveStatus'](_0x25e8f3);return _0x41db9d['setActivityAttributes']({'app.activity.mid':_0x923fe0,'app.job.jss':_0x5dfd5d}),this['context']['metadata']['aid'];}catch(_0x5cb4c8){if(_0x5cb4c8 instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x5cb4c8});return;}else{if(_0x5cb4c8 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x5cb4c8});return;}else{if(_0x5cb4c8 instanceof errors_1['GetStateError']){this['logger']['error']('worker-get-state-error',{..._0x5cb4c8});return;}else{if(_0x5cb4c8 instanceof errors_1['CollationError']){if(_0x5cb4c8['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',{..._0x5cb4c8});}else this['logger']['error']('worker-process-error',{..._0x5cb4c8});}}}_0x41db9d?.['setActivityError'](_0x5cb4c8['message']);throw _0x5cb4c8;}finally{_0x41db9d?.['endActivitySpan'](),this['logger']['debug']('worker-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0xd67b12){const _0x495a4c=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x5428bd={'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':_0x495a4c,'spn':this['context']['$self']['output']['metadata']['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context']['data']};return this['config']['retry']&&(_0x5428bd['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](_0x495a4c,_0x5428bd,_0xd67b12);}}exports['Worker']=Worker;
1
+ 'use strict';function _0x749d(){const _0x4b9804=['3274894qKSiWZ','550748KFElxW','2825226vrbaoc','4077000wbWqUn','709644LMqKSr','3XRkCSF','843046wkqNdd','1607600wKuBVc'];_0x749d=function(){return _0x4b9804;};return _0x749d();}(function(_0x1bb906,_0x2b20f5){const _0x51a133=_0x3d47,_0x1ebe95=_0x1bb906();while(!![]){try{const _0x1e5466=parseInt(_0x51a133(0x1e4))/0x1+parseInt(_0x51a133(0x1e2))/0x2+parseInt(_0x51a133(0x1e3))/0x3*(-parseInt(_0x51a133(0x1df))/0x4)+-parseInt(_0x51a133(0x1e1))/0x5+-parseInt(_0x51a133(0x1e0))/0x6+parseInt(_0x51a133(0x1de))/0x7+parseInt(_0x51a133(0x1dd))/0x8;if(_0x1e5466===_0x2b20f5)break;else _0x1ebe95['push'](_0x1ebe95['shift']());}catch(_0x18dc7f){_0x1ebe95['push'](_0x1ebe95['shift']());}}}(_0x749d,0x6c14e));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 _0x3d47(_0x204128,_0x5562c3){const _0x749d2c=_0x749d();return _0x3d47=function(_0x3d47db,_0x207de9){_0x3d47db=_0x3d47db-0x1dd;let _0x864a7=_0x749d2c[_0x3d47db];return _0x864a7;},_0x3d47(_0x204128,_0x5562c3);}class Worker extends activity_1['Activity']{constructor(_0x5b7ffc,_0xbb4b19,_0x63f0f0,_0x80b13,_0x2e0f95,_0x35f05c){super(_0x5b7ffc,_0xbb4b19,_0x63f0f0,_0x80b13,_0x2e0f95,_0x35f05c);}async['process'](){this['logger']['debug']('worker-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x24e95c;try{await this['verifyEntry'](),_0x24e95c=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x24e95c['startActivitySpan'](this['leg']),this['mapInputData']();const _0x3461a2=this['store']['transact'](),_0x3f6b2b=await this['execActivity'](_0x3461a2);await collator_1['CollatorService']['authorizeReentry'](this,_0x3461a2),await this['setState'](_0x3461a2),await this['setStatus'](0x0,_0x3461a2);const _0x5b4621=await _0x3461a2['exec']();_0x24e95c['mapActivityAttributes']();const _0x216d5c=this['resolveStatus'](_0x5b4621);return _0x24e95c['setActivityAttributes']({'app.activity.mid':_0x3f6b2b,'app.job.jss':_0x216d5c}),this['context']['metadata']['aid'];}catch(_0xa35d63){if(_0xa35d63 instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0xa35d63});return;}else{if(_0xa35d63 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0xa35d63});return;}else{if(_0xa35d63 instanceof errors_1['GetStateError']){this['logger']['error']('worker-get-state-error',{..._0xa35d63});return;}else{if(_0xa35d63 instanceof errors_1['CollationError']){if(_0xa35d63['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',{..._0xa35d63});}else this['logger']['error']('worker-process-error',{..._0xa35d63});}}}_0x24e95c?.['setActivityError'](_0xa35d63['message']);throw _0xa35d63;}finally{_0x24e95c?.['endActivitySpan'](),this['logger']['debug']('worker-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x2a9226){const _0x4d5b12=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x104fc1={'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':_0x4d5b12,'spn':this['context']['$self']['output']['metadata']['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context']['data']};return this['config']['retry']&&(_0x104fc1['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](_0x4d5b12,_0x104fc1,_0x2a9226);}}exports['Worker']=Worker;
@@ -1 +1 @@
1
- 'use strict';(function(_0x5e553c,_0xfe434a){const _0x101698=_0x2a7e,_0x2b5742=_0x5e553c();while(!![]){try{const _0x5341ba=-parseInt(_0x101698(0x183))/0x1+-parseInt(_0x101698(0x17c))/0x2+-parseInt(_0x101698(0x17d))/0x3+parseInt(_0x101698(0x17e))/0x4*(parseInt(_0x101698(0x181))/0x5)+parseInt(_0x101698(0x182))/0x6*(parseInt(_0x101698(0x17f))/0x7)+parseInt(_0x101698(0x184))/0x8*(-parseInt(_0x101698(0x180))/0x9)+parseInt(_0x101698(0x17b))/0xa*(parseInt(_0x101698(0x17a))/0xb);if(_0x5341ba===_0xfe434a)break;else _0x2b5742['push'](_0x2b5742['shift']());}catch(_0x44ecb6){_0x2b5742['push'](_0x2b5742['shift']());}}}(_0x4406,0xd687d));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CollatorService']=void 0x0;function _0x4406(){const _0x33e48d=['1190529LWLdNj','5InXUkd','7367592pbNWUV','1166979ELqZGm','56DOdEJf','616BvwuUM','342520vvWvtF','2209778aThvTk','1050417owBnXV','5122588pdCAhe','7xvOpMJ'];_0x4406=function(){return _0x33e48d;};return _0x4406();}function _0x2a7e(_0x2e0b1d,_0x349a1a){const _0x4406fb=_0x4406();return _0x2a7e=function(_0x2a7ebe,_0x38e85a){_0x2a7ebe=_0x2a7ebe-0x17a;let _0xab1bea=_0x4406fb[_0x2a7ebe];return _0xab1bea;},_0x2a7e(_0x2e0b1d,_0x349a1a);}const errors_1=require('../../modules/errors'),collator_1=require('../../types/collator');class CollatorService{static['assertJobActive'](_0x5eb383,_0x3db52a,_0x5a1b61,_0x861191=0x0){if(_0x5eb383<=_0x861191)throw new errors_1['InactiveJobError'](_0x3db52a,_0x5eb383,_0x5a1b61);}static['getDimensionalAddress'](_0x1c7324,_0x30b624=![]){let _0x3e3b36=_0x1c7324['context']['metadata']['dad']||_0x1c7324['metadata']['dad'];return _0x30b624&&_0x3e3b36&&_0x1c7324['leg']===0x2&&(_0x3e3b36=_0x3e3b36['substring'](0x0,_0x3e3b36['lastIndexOf'](','))+',0'),CollatorService['getDimensionsById']([..._0x1c7324['config']['ancestors'],_0x1c7324['metadata']['aid']],_0x3e3b36);}static['resolveReentryDimension'](_0x210ab7){const _0x379737=_0x210ab7['config']['ancestor'],_0x53cde9=_0x210ab7['config']['ancestors'],_0x4b15fc=_0x53cde9['indexOf'](_0x379737),_0x3bedce=_0x210ab7['metadata']['dad']['split'](',');return _0x3bedce['length']=_0x4b15fc+0x1,_0x3bedce['push']('0'),_0x3bedce['join'](',');}static async['notarizeEntry'](_0x12562a,_0x57c4bd){const _0x2d24d5=await _0x12562a['store']['collate'](_0x12562a['context']['metadata']['jid'],_0x12562a['metadata']['aid'],-0x5af3107a4000,this['getDimensionalAddress'](_0x12562a),_0x57c4bd);return this['verifyInteger'](_0x2d24d5,0x1,'enter'),_0x2d24d5;}static async['authorizeReentry'](_0x536588,_0x5a6db9){const _0x19471c=await _0x536588['store']['collate'](_0x536588['context']['metadata']['jid'],_0x536588['metadata']['aid'],-0x9184e72a000,this['getDimensionalAddress'](_0x536588),_0x5a6db9);return _0x19471c;}static async['notarizeEarlyExit'](_0x458bb0,_0x454456){return await _0x458bb0['store']['collate'](_0x458bb0['context']['metadata']['jid'],_0x458bb0['metadata']['aid'],-0xa012317b000,this['getDimensionalAddress'](_0x458bb0),_0x454456);}static async['notarizeEarlyCompletion'](_0x6b620b,_0x48bc50){const _0x1d7c7d=_0x6b620b['config']['cycle']?0x9184e72a000:0xa012317b000;return await _0x6b620b['store']['collate'](_0x6b620b['context']['metadata']['jid'],_0x6b620b['metadata']['aid'],0xf4241-_0x1d7c7d,this['getDimensionalAddress'](_0x6b620b),_0x48bc50);}static async['notarizeInception'](_0x22e794,_0x17ec6b,_0xe6b9c9){_0x17ec6b&&await _0x22e794['store']['collateSynthetic'](_0x22e794['context']['metadata']['jid'],_0x17ec6b,0xf4240,_0xe6b9c9);}static async['isInceptionOverage'](_0x441156,_0x25323c){if(_0x25323c){const _0x360c28=await _0x441156['store']['collateSynthetic'](_0x441156['context']['metadata']['jid'],_0x25323c,0xf4240);return _0x360c28>0xf4240;}return![];}static async['notarizeReentry'](_0x2f6f80,_0x30781f,_0x3b8899){const _0x18697f=_0x2f6f80['context']['metadata']['jid'],_0x429227=_0x3b8899||_0x2f6f80['store']['transact']();await _0x2f6f80['store']['collate'](_0x18697f,_0x2f6f80['metadata']['aid'],0xf4240,this['getDimensionalAddress'](_0x2f6f80,!![]),_0x429227),await _0x2f6f80['store']['collateSynthetic'](_0x18697f,_0x30781f,0xf4240,_0x429227);const [_0x17d263,_0xfcec20]=await _0x429227['exec'](),_0x4ce8c2=Array['isArray'](_0x17d263)?_0x17d263[0x1]:_0x17d263,_0xe9fb88=Array['isArray'](_0xfcec20)?_0xfcec20[0x1]:_0xfcec20;return this['verifyInteger'](_0x4ce8c2,0x2,'enter'),this['verifySyntheticInteger'](_0xe9fb88),_0x4ce8c2;}static async['notarizeContinuation'](_0x4b5cbe,_0x395e34){return await _0x4b5cbe['store']['collate'](_0x4b5cbe['context']['metadata']['jid'],_0x4b5cbe['metadata']['aid'],0x1,this['getDimensionalAddress'](_0x4b5cbe),_0x395e34);}static async['notarizeCompletion'](_0x2b3f29,_0x20b0d6){const _0xe815a3=_0x2b3f29['config']['cycle']?0x0:0xe8d4a51000;return await _0x2b3f29['store']['collate'](_0x2b3f29['context']['metadata']['jid'],_0x2b3f29['metadata']['aid'],0x1-_0xe815a3,this['getDimensionalAddress'](_0x2b3f29),_0x20b0d6);}static['getDigitAtIndex'](_0x49c3fd,_0x22eb29){const _0x399f91=_0x49c3fd['toString']();if(_0x22eb29<0x0||_0x22eb29>=_0x399f91['length'])return null;const _0x466ead=parseInt(_0x399f91[_0x22eb29],0xa);return _0x466ead;}static['getDimensionalIndex'](_0x1aa0b7){const _0x437ade=_0x1aa0b7['toString']();if(_0x437ade['length']<0x9)return null;const _0x1b9a35=_0x437ade['substring'](0x3,0x9),_0x48c804=parseInt(_0x1b9a35,0xa);return _0x48c804-0x1;}static['isDuplicate'](_0x55a8e4,_0x48600e){return this['getDigitAtIndex'](_0x55a8e4,_0x48600e)<0x8;}static['isInactive'](_0x429838){return this['getDigitAtIndex'](_0x429838,0x2)<0x9;}static['isPrimed'](_0x52b5bc,_0x227baa){return _0x227baa==0x1?_0x52b5bc!=-0x5af3107a4000:this['getDigitAtIndex'](_0x52b5bc,0x0)<0x9&&this['getDigitAtIndex'](_0x52b5bc,0x1)<0x9;}static['verifySyntheticInteger'](_0x25aa56){const _0x269afd=_0x25aa56['toString'](),_0x22fbe2=parseInt(_0x269afd[_0x269afd['length']-0x1],0xa);if(_0x22fbe2>0x0)throw new errors_1['CollationError'](_0x25aa56,0x2,'enter',collator_1['CollationFaultType']['INACTIVE']);else{if(_0x25aa56>=0x1e8480)throw new errors_1['CollationError'](_0x25aa56,0x2,'enter',collator_1['CollationFaultType']['DUPLICATE']);}}static['verifyInteger'](_0x1000a7,_0x90d999,_0x85a319){let _0x18d6ca;if(_0x90d999===0x1&&_0x85a319==='enter'){if(!this['isPrimed'](_0x1000a7,0x1))_0x18d6ca=collator_1['CollationFaultType']['MISSING'];else{if(this['isDuplicate'](_0x1000a7,0x0))_0x18d6ca=collator_1['CollationFaultType']['DUPLICATE'];else _0x1000a7!=0x331a2bfa73000&&(_0x18d6ca=collator_1['CollationFaultType']['INVALID']);}}else{if(_0x90d999===0x1&&_0x85a319==='exit'){if(_0x1000a7===-0x9184e72a000)_0x18d6ca=collator_1['CollationFaultType']['MISSING'];else this['isDuplicate'](_0x1000a7,0x1)&&(_0x18d6ca=collator_1['CollationFaultType']['DUPLICATE']);}else{if(_0x90d999===0x2&&_0x85a319==='enter'){if(!this['isPrimed'](_0x1000a7,0x2))_0x18d6ca=collator_1['CollationFaultType']['FORBIDDEN'];else this['isInactive'](_0x1000a7)&&(_0x18d6ca=collator_1['CollationFaultType']['INACTIVE']);}}}if(_0x18d6ca)throw new errors_1['CollationError'](_0x1000a7,_0x90d999,_0x85a319,_0x18d6ca);}static['getDimensionsById'](_0x18ecfc,_0x4d408c){const _0x1d78b4={'$ADJACENT':_0x4d408c+',0'};let _0x125486=_0x4d408c;return _0x18ecfc['reverse']()['forEach'](_0x593c0d=>{_0x1d78b4[_0x593c0d]=_0x125486,_0x125486=_0x125486['substring'](0x0,_0x125486['lastIndexOf'](','));}),_0x1d78b4;}static['getSeed'](){return'999000000000000';}static['getTriggerSeed'](){return'888000001000001';}static['compile'](_0x412c8e){CollatorService['bindAncestorArray'](_0x412c8e);}static['bindAncestorArray'](_0x43eb5c){_0x43eb5c['forEach'](_0xbd04be=>{const _0x5cdd1a={},_0x2e3fc0=Object['keys'](_0xbd04be['activities'])['find'](_0x287954=>_0xbd04be['activities'][_0x287954]['type']==='trigger');if(!_0x2e3fc0)throw new Error('collator-trigger-activity-not-found');const _0x506c7f=(_0x340b56,_0x5d98fb)=>{_0x5cdd1a[_0x340b56]=_0x5d98fb,_0xbd04be['activities'][_0x340b56]['ancestors']=_0x5d98fb;const _0x100090=_0xbd04be['transitions']?.[_0x340b56]||[];_0x100090['forEach'](_0x1dcae9=>{_0x506c7f(_0x1dcae9['to'],[..._0x5d98fb,_0x340b56]);});};_0x506c7f(_0x2e3fc0,[]);});}static['getDimensionalSeed'](_0x5c4a5d=0x0){return','+_0x5c4a5d;}}exports['CollatorService']=CollatorService,CollatorService['targetLength']=0xf;
1
+ 'use strict';(function(_0x4954a3,_0x2b6920){const _0x2c3dc8=_0x59cd,_0x4afdea=_0x4954a3();while(!![]){try{const _0x28b6b7=-parseInt(_0x2c3dc8(0xe0))/0x1*(parseInt(_0x2c3dc8(0xe9))/0x2)+-parseInt(_0x2c3dc8(0xde))/0x3*(-parseInt(_0x2c3dc8(0xe8))/0x4)+parseInt(_0x2c3dc8(0xe3))/0x5*(parseInt(_0x2c3dc8(0xe6))/0x6)+parseInt(_0x2c3dc8(0xdf))/0x7*(parseInt(_0x2c3dc8(0xe7))/0x8)+parseInt(_0x2c3dc8(0xe4))/0x9*(parseInt(_0x2c3dc8(0xe1))/0xa)+parseInt(_0x2c3dc8(0xe2))/0xb+parseInt(_0x2c3dc8(0xea))/0xc*(-parseInt(_0x2c3dc8(0xe5))/0xd);if(_0x28b6b7===_0x2b6920)break;else _0x4afdea['push'](_0x4afdea['shift']());}catch(_0x4ca71a){_0x4afdea['push'](_0x4afdea['shift']());}}}(_0x2daa,0x73234));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CollatorService']=void 0x0;function _0x59cd(_0x1d0bda,_0xf182c9){const _0x2daa73=_0x2daa();return _0x59cd=function(_0x59cd4f,_0x58ad19){_0x59cd4f=_0x59cd4f-0xde;let _0x33977e=_0x2daa73[_0x59cd4f];return _0x33977e;},_0x59cd(_0x1d0bda,_0xf182c9);}const errors_1=require('../../modules/errors'),collator_1=require('../../types/collator');class CollatorService{static['assertJobActive'](_0x4d7fb3,_0x24beac,_0x3ec26e,_0x5c1632=0x0){if(_0x4d7fb3<=_0x5c1632)throw new errors_1['InactiveJobError'](_0x24beac,_0x4d7fb3,_0x3ec26e);}static['getDimensionalAddress'](_0x5bba4a,_0x46c9df=![]){let _0x5345bd=_0x5bba4a['context']['metadata']['dad']||_0x5bba4a['metadata']['dad'];return _0x46c9df&&_0x5345bd&&_0x5bba4a['leg']===0x2&&(_0x5345bd=_0x5345bd['substring'](0x0,_0x5345bd['lastIndexOf'](','))+',0'),CollatorService['getDimensionsById']([..._0x5bba4a['config']['ancestors'],_0x5bba4a['metadata']['aid']],_0x5345bd);}static['resolveReentryDimension'](_0x5a73f5){const _0x1d73d2=_0x5a73f5['config']['ancestor'],_0x488ccc=_0x5a73f5['config']['ancestors'],_0x203374=_0x488ccc['indexOf'](_0x1d73d2),_0x831e79=_0x5a73f5['metadata']['dad']['split'](',');return _0x831e79['length']=_0x203374+0x1,_0x831e79['push']('0'),_0x831e79['join'](',');}static async['notarizeEntry'](_0x29fd77,_0x578104){const _0x216dc8=await _0x29fd77['store']['collate'](_0x29fd77['context']['metadata']['jid'],_0x29fd77['metadata']['aid'],-0x5af3107a4000,this['getDimensionalAddress'](_0x29fd77),_0x578104);return this['verifyInteger'](_0x216dc8,0x1,'enter'),_0x216dc8;}static async['authorizeReentry'](_0x2e69b1,_0x20a2b7){const _0x7f3cb=await _0x2e69b1['store']['collate'](_0x2e69b1['context']['metadata']['jid'],_0x2e69b1['metadata']['aid'],-0x9184e72a000,this['getDimensionalAddress'](_0x2e69b1),_0x20a2b7);return _0x7f3cb;}static async['notarizeEarlyExit'](_0x51f7cc,_0xe9194e){return await _0x51f7cc['store']['collate'](_0x51f7cc['context']['metadata']['jid'],_0x51f7cc['metadata']['aid'],-0xa012317b000,this['getDimensionalAddress'](_0x51f7cc),_0xe9194e);}static async['notarizeEarlyCompletion'](_0x2d7812,_0x4caf52){const _0x2142eb=_0x2d7812['config']['cycle']?0x9184e72a000:0xa012317b000;return await _0x2d7812['store']['collate'](_0x2d7812['context']['metadata']['jid'],_0x2d7812['metadata']['aid'],0xf4241-_0x2142eb,this['getDimensionalAddress'](_0x2d7812),_0x4caf52);}static async['notarizeInception'](_0x3c5801,_0x507ca9,_0x200614){_0x507ca9&&await _0x3c5801['store']['collateSynthetic'](_0x3c5801['context']['metadata']['jid'],_0x507ca9,0xf4240,_0x200614);}static async['isInceptionOverage'](_0x3db2be,_0x4d5152){if(_0x4d5152){const _0x2eceed=await _0x3db2be['store']['collateSynthetic'](_0x3db2be['context']['metadata']['jid'],_0x4d5152,0xf4240);return _0x2eceed>0xf4240;}return![];}static async['notarizeReentry'](_0x27e0c3,_0x1c4909,_0x38255d){const _0x4bcab8=_0x27e0c3['context']['metadata']['jid'],_0x19ce10=_0x38255d||_0x27e0c3['store']['transact']();await _0x27e0c3['store']['collate'](_0x4bcab8,_0x27e0c3['metadata']['aid'],0xf4240,this['getDimensionalAddress'](_0x27e0c3,!![]),_0x19ce10),await _0x27e0c3['store']['collateSynthetic'](_0x4bcab8,_0x1c4909,0xf4240,_0x19ce10);const [_0x5e6d08,_0x3a06a3]=await _0x19ce10['exec'](),_0x50afd0=Array['isArray'](_0x5e6d08)?_0x5e6d08[0x1]:_0x5e6d08,_0x4bd2ce=Array['isArray'](_0x3a06a3)?_0x3a06a3[0x1]:_0x3a06a3;return this['verifyInteger'](_0x50afd0,0x2,'enter'),this['verifySyntheticInteger'](_0x4bd2ce),_0x50afd0;}static async['notarizeContinuation'](_0x34f8bd,_0x36598a){return await _0x34f8bd['store']['collate'](_0x34f8bd['context']['metadata']['jid'],_0x34f8bd['metadata']['aid'],0x1,this['getDimensionalAddress'](_0x34f8bd),_0x36598a);}static async['notarizeCompletion'](_0x1252f8,_0x36470e){const _0x1105b7=_0x1252f8['config']['cycle']?0x0:0xe8d4a51000;return await _0x1252f8['store']['collate'](_0x1252f8['context']['metadata']['jid'],_0x1252f8['metadata']['aid'],0x1-_0x1105b7,this['getDimensionalAddress'](_0x1252f8),_0x36470e);}static['getDigitAtIndex'](_0x11199b,_0x3bd273){const _0x3eb6f7=_0x11199b['toString']();if(_0x3bd273<0x0||_0x3bd273>=_0x3eb6f7['length'])return null;const _0x44da46=parseInt(_0x3eb6f7[_0x3bd273],0xa);return _0x44da46;}static['getDimensionalIndex'](_0x29de59){const _0x1edf8f=_0x29de59['toString']();if(_0x1edf8f['length']<0x9)return null;const _0x4cfab2=_0x1edf8f['substring'](0x3,0x9),_0x139f76=parseInt(_0x4cfab2,0xa);return _0x139f76-0x1;}static['isDuplicate'](_0x456a50,_0x9e10f0){return this['getDigitAtIndex'](_0x456a50,_0x9e10f0)<0x8;}static['isInactive'](_0xe96029){return this['getDigitAtIndex'](_0xe96029,0x2)<0x9;}static['isPrimed'](_0xc7c4a,_0x34731f){return _0x34731f==0x1?_0xc7c4a!=-0x5af3107a4000:this['getDigitAtIndex'](_0xc7c4a,0x0)<0x9&&this['getDigitAtIndex'](_0xc7c4a,0x1)<0x9;}static['verifySyntheticInteger'](_0x41f363){const _0x52d427=_0x41f363['toString'](),_0x4389e4=parseInt(_0x52d427[_0x52d427['length']-0x1],0xa);if(_0x4389e4>0x0)throw new errors_1['CollationError'](_0x41f363,0x2,'enter',collator_1['CollationFaultType']['INACTIVE']);else{if(_0x41f363>=0x1e8480)throw new errors_1['CollationError'](_0x41f363,0x2,'enter',collator_1['CollationFaultType']['DUPLICATE']);}}static['verifyInteger'](_0x41a5e5,_0x442eda,_0x34781a){let _0x35da99;if(_0x442eda===0x1&&_0x34781a==='enter'){if(!this['isPrimed'](_0x41a5e5,0x1))_0x35da99=collator_1['CollationFaultType']['MISSING'];else{if(this['isDuplicate'](_0x41a5e5,0x0))_0x35da99=collator_1['CollationFaultType']['DUPLICATE'];else _0x41a5e5!=0x331a2bfa73000&&(_0x35da99=collator_1['CollationFaultType']['INVALID']);}}else{if(_0x442eda===0x1&&_0x34781a==='exit'){if(_0x41a5e5===-0x9184e72a000)_0x35da99=collator_1['CollationFaultType']['MISSING'];else this['isDuplicate'](_0x41a5e5,0x1)&&(_0x35da99=collator_1['CollationFaultType']['DUPLICATE']);}else{if(_0x442eda===0x2&&_0x34781a==='enter'){if(!this['isPrimed'](_0x41a5e5,0x2))_0x35da99=collator_1['CollationFaultType']['FORBIDDEN'];else this['isInactive'](_0x41a5e5)&&(_0x35da99=collator_1['CollationFaultType']['INACTIVE']);}}}if(_0x35da99)throw new errors_1['CollationError'](_0x41a5e5,_0x442eda,_0x34781a,_0x35da99);}static['getDimensionsById'](_0x179252,_0x1e8fe7){const _0x3edd66={'$ADJACENT':_0x1e8fe7+',0'};let _0x464851=_0x1e8fe7;return _0x179252['reverse']()['forEach'](_0x3b2079=>{_0x3edd66[_0x3b2079]=_0x464851,_0x464851=_0x464851['substring'](0x0,_0x464851['lastIndexOf'](','));}),_0x3edd66;}static['getSeed'](){return'999000000000000';}static['getTriggerSeed'](){return'888000001000001';}static['compile'](_0x380b82){CollatorService['bindAncestorArray'](_0x380b82);}static['bindAncestorArray'](_0x2ac5eb){_0x2ac5eb['forEach'](_0x3a062f=>{const _0x16edca={},_0x2661aa=Object['keys'](_0x3a062f['activities'])['find'](_0x395999=>_0x3a062f['activities'][_0x395999]['type']==='trigger');if(!_0x2661aa)throw new Error('collator-trigger-activity-not-found');const _0x301d9d=(_0x4a6768,_0x55f7ed)=>{_0x16edca[_0x4a6768]=_0x55f7ed,_0x3a062f['activities'][_0x4a6768]['ancestors']=_0x55f7ed;const _0xa30725=_0x3a062f['transitions']?.[_0x4a6768]||[];_0xa30725['forEach'](_0x4d4316=>{_0x301d9d(_0x4d4316['to'],[..._0x55f7ed,_0x4a6768]);});};_0x301d9d(_0x2661aa,[]);});}static['getDimensionalSeed'](_0x42d694=0x0){return','+_0x42d694;}}exports['CollatorService']=CollatorService,CollatorService['targetLength']=0xf;function _0x2daa(){const _0x1d3cf5=['3975862fFDzps','2176935vrXMET','41841pJteYX','23110802vHgYQP','6soiZFB','73952QEXwQo','4JPmYWy','59108bsEtfx','12RkCFgy','1834320jitdNd','308ocOTUA','10odJuTl','1570qnSoGs'];_0x2daa=function(){return _0x1d3cf5;};return _0x2daa();}
@@ -1 +1 @@
1
- 'use strict';function _0x985f(_0x8174c7,_0x5643ed){const _0x53752b=_0x5375();return _0x985f=function(_0x985f37,_0x22479e){_0x985f37=_0x985f37-0xb5;let _0x1fe427=_0x53752b[_0x985f37];return _0x1fe427;},_0x985f(_0x8174c7,_0x5643ed);}(function(_0x3effa3,_0x16644e){const _0x1474c0=_0x985f,_0x4cfca2=_0x3effa3();while(!![]){try{const _0x4940f0=parseInt(_0x1474c0(0xbc))/0x1+-parseInt(_0x1474c0(0xba))/0x2*(parseInt(_0x1474c0(0xbb))/0x3)+parseInt(_0x1474c0(0xb9))/0x4+-parseInt(_0x1474c0(0xb5))/0x5*(-parseInt(_0x1474c0(0xbd))/0x6)+-parseInt(_0x1474c0(0xb6))/0x7+parseInt(_0x1474c0(0xbe))/0x8*(parseInt(_0x1474c0(0xb7))/0x9)+parseInt(_0x1474c0(0xb8))/0xa;if(_0x4940f0===_0x16644e)break;else _0x4cfca2['push'](_0x4cfca2['shift']());}catch(_0x303f46){_0x4cfca2['push'](_0x4cfca2['shift']());}}}(_0x5375,0x2a06e));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Deployer']=void 0x0;function _0x5375(){const _0x992c44=['1650wtqgeL','2052379akNQQv','981ayEzih','798230kpcicl','426260RtgpeK','686WqtbGH','1359xaAkdm','171292tmwRcT','2004GlBnEx','11216donmMj'];_0x5375=function(){return _0x992c44;};return _0x5375();}const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),serializer_1=require('../serializer'),pipe_1=require('../pipe'),validator_1=require('./validator'),DEFAULT_METADATA_RANGE_SIZE=0x1a,DEFAULT_DATA_RANGE_SIZE=0x104,DEFAULT_RANGE_SIZE=DEFAULT_METADATA_RANGE_SIZE+DEFAULT_DATA_RANGE_SIZE;class Deployer{constructor(_0x37c90a){this['manifest']=null,this['manifest']=_0x37c90a;}async['deploy'](_0x5e69a3,_0x58ce00){this['store']=_0x5e69a3,this['stream']=_0x58ce00,collator_1['CollatorService']['compile'](this['manifest']['app']['graphs']),this['convertActivitiesToHooks'](),this['convertTopicsToTypes'](),this['copyJobSchemas'](),this['bindBackRefs'](),this['bindParents'](),this['bindCycleTarget'](),this['resolveMappingDependencies'](),this['resolveJobMapsPaths'](),await this['generateSymKeys'](),await this['generateSymVals'](),await this['deployHookPatterns'](),await this['deployActivitySchemas'](),await this['deploySubscriptions'](),await this['deployTransitions'](),await this['deployConsumerGroups']();}['getVID'](){return{'id':this['manifest']['app']['id'],'version':this['manifest']['app']['version']};}async['generateSymKeys'](){for(const _0x1499b7 of this['manifest']['app']['graphs']){const [,_0x2a1298]=this['findTrigger'](_0x1499b7),_0x2439f2=_0x2a1298['subscribes'],[_0x38491e,_0x12aade,_0x1bc6e8]=await this['store']['reserveSymbolRange']('$'+_0x2439f2,DEFAULT_RANGE_SIZE,'JOB'),_0x3dd5fc='',_0x2daab7=this['bindSymbols'](_0x38491e,_0x12aade,_0x1bc6e8,_0x3dd5fc,_0x2a1298['PRODUCES']);Object['keys'](_0x2daab7)['length']&&await this['store']['addSymbols']('$'+_0x2439f2,_0x2daab7);for(const [_0x2215f3,_0x944460]of Object['entries'](_0x1499b7['activities'])){const [_0xf13885,_0x521ed7,_0x267a89]=await this['store']['reserveSymbolRange'](_0x2215f3,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x2caea4=_0x2215f3+'/';this['bindSelf'](_0x944460['consumes'],_0x944460['produces'],_0x2215f3);const _0x3a8be2=this['bindSymbols'](_0xf13885,_0x521ed7,_0x267a89,_0x2caea4,_0x944460['produces']);Object['keys'](_0x3a8be2)['length']&&await this['store']['addSymbols'](_0x2215f3,_0x3a8be2);}}}['bindSelf'](_0x580b06,_0x79c9e8,_0x6c1d09){for(const _0x2ef4b7 of[_0x6c1d09,'$self']){const _0x9bd03e=_0x580b06[_0x2ef4b7];if(_0x9bd03e)for(const _0x2d4b50 of _0x9bd03e){!_0x79c9e8['includes'](_0x2d4b50)&&_0x79c9e8['push'](_0x2d4b50);}}}['bindSymbols'](_0x2d2bd0,_0x12da8f,_0x3c08ae,_0x1fcf5d,_0x1e34d8){const _0x5557b7={},_0xd7f795={..._0x3c08ae};for(const _0x2ac15f of _0x1e34d8){const _0x5f4479=''+_0x1fcf5d+_0x2ac15f;if(!_0xd7f795[_0x5f4479]){if(_0x2d2bd0>_0x12da8f)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x1dd961=(0x0,utils_1['getSymKey'])(_0x2d2bd0);_0x2d2bd0++,_0x5557b7[_0x5f4479]=_0x1dd961,_0xd7f795[_0x5f4479]=_0x1dd961;}}return _0x5557b7;}['copyJobSchemas'](){const _0x17d3e6=this['manifest']['app']['graphs'];for(const _0x4d687f of _0x17d3e6){const _0x5a47e8=_0x4d687f['output']?.['schema'],_0x30555a=_0x4d687f['input']?.['schema'];if(!_0x5a47e8&&!_0x30555a)continue;const _0x2562b1=_0x4d687f['activities'];for(const _0x42e032 in _0x2562b1){if(_0x2562b1[_0x42e032]['type']==='trigger'){const _0x4d768b=_0x2562b1[_0x42e032];_0x5a47e8&&(!_0x4d768b['job']&&(_0x4d768b['job']={}),_0x4d768b['job']['schema']=_0x5a47e8),_0x30555a&&(_0x4d768b['output']={'schema':_0x30555a});}}}}['bindBackRefs'](){for(const _0x40aac4 of this['manifest']['app']['graphs']){const _0xe14cab=_0x40aac4['activities'],_0x5503cb=this['findTrigger'](_0x40aac4)[0x0];for(const _0x3d02e9 in _0xe14cab){_0xe14cab[_0x3d02e9]['trigger']=_0x5503cb,_0xe14cab[_0x3d02e9]['subscribes']=_0x40aac4['subscribes'],_0x40aac4['publishes']&&(_0xe14cab[_0x3d02e9]['publishes']=_0x40aac4['publishes']),_0xe14cab[_0x3d02e9]['expire']=_0x40aac4['expire']??undefined,_0xe14cab[_0x3d02e9]['persistent']=_0x40aac4['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x462af5 of this['manifest']['app']['graphs']){const _0x5bc296=_0x462af5['activities'];for(const _0x3a2fc2 in _0x5bc296){const _0x5241c0=_0x5bc296[_0x3a2fc2];_0x5241c0['type']==='cycle'&&(_0x5bc296[_0x5241c0['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0x513027 of this['manifest']['app']['graphs']){const _0xb3f81=_0x513027['activities'];for(const _0x2b6447 in _0xb3f81){const _0x1bfd12=_0xb3f81[_0x2b6447];['worker','await']['includes'](_0x1bfd12['type'])&&_0x1bfd12['topic']&&!_0x1bfd12['subtype']&&(_0x1bfd12['subtype']=_0x1bfd12['topic']);}}}['convertActivitiesToHooks'](){for(const _0x38a049 of this['manifest']['app']['graphs']){const _0x418655=_0x38a049['activities'];for(const _0x1057a2 in _0x418655){const _0x545757=_0x418655[_0x1057a2];['activity']['includes'](_0x545757['type'])&&(_0x545757['type']='hook');}}}async['bindParents'](){const _0x24b517=this['manifest']['app']['graphs'];for(const _0x4d0985 of _0x24b517){if(_0x4d0985['transitions'])for(const _0x25d72e in _0x4d0985['transitions']){const _0x41b9de=_0x4d0985['transitions'][_0x25d72e];for(const _0x4212a7 of _0x41b9de){const _0x121e94=_0x4212a7['to'];_0x4d0985['activities'][_0x121e94]['parent']=_0x25d72e;}_0x4d0985['activities'][_0x25d72e]['transitions']=_0x41b9de;}}}['collectValues'](_0x2fe1e7,_0x22ca63){for(const [_0x317d83,_0x45a559]of Object['entries'](_0x2fe1e7)){if(_0x317d83==='enum'||_0x317d83==='examples'||_0x317d83==='default'){if(Array['isArray'](_0x45a559))for(const _0xd647a9 of _0x45a559){typeof _0xd647a9==='string'&&_0xd647a9['length']>0x5&&_0x22ca63['add'](_0xd647a9);}else typeof _0x45a559==='string'&&_0x45a559['length']>0x5&&_0x22ca63['add'](_0x45a559);}else typeof _0x45a559==='object'&&this['collectValues'](_0x45a559,_0x22ca63);}}['traverse'](_0x4b3cb0,_0x3924b3){for(const _0x1a2d0a of Object['values'](_0x4b3cb0)){typeof _0x1a2d0a==='object'&&('schema'in _0x1a2d0a?this['collectValues'](_0x1a2d0a['schema'],_0x3924b3):this['traverse'](_0x1a2d0a,_0x3924b3));}}async['generateSymVals'](){const _0x51d6ff=new Set();for(const _0x1b449b of this['manifest']['app']['graphs']){this['traverse'](_0x1b449b,_0x51d6ff);}const _0x42d14c=await this['store']['getSymbolValues'](),_0x1bef61=Object['keys'](_0x42d14c)['length'],_0x4546b6=Math['pow'](0x34,0x2)-0x1,_0x4cc04b=serializer_1['SerializerService']['filterSymVals'](_0x1bef61,_0x4546b6,_0x42d14c,_0x51d6ff);await this['store']['addSymbolValues'](_0x4cc04b);}['resolveJobMapsPaths'](){function _0x56eeeb(_0x196e7e){const _0x20b696=[];function _0x4a9bdd(_0x44af89,_0x281ab1=[]){for(const _0x835c50 in _0x44af89){if(typeof _0x44af89[_0x835c50]==='object'&&_0x44af89[_0x835c50]!==null&&!('@pipe'in _0x44af89[_0x835c50])){const _0x36c009=[..._0x281ab1,_0x835c50];_0x4a9bdd(_0x44af89[_0x835c50],_0x36c009);}else{const _0x32a279=[..._0x281ab1,_0x835c50]['join']('/');if(!_0x32a279['includes']('[')){const _0x4b94e0='data/'+_0x32a279;!_0x20b696['includes'](_0x4b94e0)&&_0x20b696['push'](_0x4b94e0);}else{const [_0x332423,_0x1f73dd]=_0x32a279['split']('['),[_0x26d930,_0x5a45d3]=_0x1f73dd['split'](']');if(!isNaN(parseInt(_0x26d930)))for(let _0x7c1d6a=0x0;_0x7c1d6a<parseInt(_0x26d930);_0x7c1d6a++){const _0xc1dbcd='data/'+_0x332423+'/'+_0x7c1d6a;!_0x20b696['includes'](_0xc1dbcd)&&_0x20b696['push'](_0xc1dbcd);}}}}}return _0x196e7e&&_0x4a9bdd(_0x196e7e),_0x20b696;}for(const _0x445114 of this['manifest']['app']['graphs']){let _0x469b88=[];const [,_0x508c65]=this['findTrigger'](_0x445114);for(const _0x3a3984 in _0x445114['activities']){const _0x213644=_0x445114['activities'][_0x3a3984];_0x469b88=_0x469b88['concat'](_0x56eeeb(_0x213644['job']?.['maps']));}_0x508c65['PRODUCES']=_0x469b88;}}['resolveMappingDependencies'](){const _0x26f2d4=[];function _0x37572f(_0x33092f,_0x372526){for(const _0x310df1 in _0x33092f){if(typeof _0x33092f[_0x310df1]==='string'){const _0x43e363=_0x33092f[_0x310df1],_0x1dc732=_0x43e363['match'](/^\{[^@].*}$/);_0x1dc732&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x43e363)&&(_0x43e363['split']('.')[0x1]!=='input'&&(_0x26f2d4['push'](_0x43e363),_0x372526['push'](_0x43e363)));}else typeof _0x33092f[_0x310df1]==='object'&&_0x33092f[_0x310df1]!==null&&_0x37572f(_0x33092f[_0x310df1],_0x372526);}}const _0x1c7153=this['manifest']['app']['graphs'];for(const _0x498b11 of _0x1c7153){const _0x42c73e=_0x498b11['activities'];for(const _0x84ea41 in _0x42c73e){const _0x2ee87d=_0x42c73e[_0x84ea41];_0x2ee87d['consumes']=[],_0x37572f(_0x2ee87d,_0x2ee87d['consumes']),_0x2ee87d['consumes']=this['groupMappingRules'](_0x2ee87d['consumes']);}}const _0x370275=this['groupMappingRules'](_0x26f2d4);for(const _0x304488 of _0x1c7153){const _0x1b44b6=_0x304488['activities'];for(const _0xb3e246 in _0x1b44b6){const _0x1f27da=_0x1b44b6[_0xb3e246];_0x1f27da['produces']=_0x370275[''+_0xb3e246]||[];}}}['groupMappingRules'](_0x324c2f){_0x324c2f=Array['from'](new Set(_0x324c2f))['sort']();const _0xdced6a={};for(const _0x5454cd of _0x324c2f){const [_0x581cd7,_0x253f6a]=this['resolveMappableValue'](_0x5454cd);!_0xdced6a[_0x581cd7]&&(_0xdced6a[_0x581cd7]=[]),_0xdced6a[_0x581cd7]['push'](_0x253f6a);}return _0xdced6a;}['resolveMappableValue'](_0x4dcda8){_0x4dcda8=_0x4dcda8['substring'](0x1,_0x4dcda8['length']-0x1);const _0x12d3c1=_0x4dcda8['split']('.');if(_0x12d3c1[0x0]==='$job'){const [_0x51b4ad,..._0x599595]=_0x12d3c1;return[_0x51b4ad,_0x599595['join']('/')];}else{const [_0x589435,_0xdd6821,_0x16e9bf,..._0x3d181c]=_0x12d3c1,_0x2f8251={'hook':'hook/data','input':'input/data','output':_0x16e9bf==='data'?'output/data':'output/metadata'}[_0xdd6821];return[_0x589435,_0x2f8251+'/'+_0x3d181c['join']('/')];}}async['deployActivitySchemas'](){const _0x580a92=this['manifest']['app']['graphs'],_0x335f0d={};for(const _0x5ee4b6 of _0x580a92){const _0x7f6888=_0x5ee4b6['activities'];for(const _0x915db6 in _0x7f6888){const _0xd4b03c=_0x7f6888[_0x915db6];delete _0xd4b03c['transitions'],_0x335f0d[_0x915db6]=_0xd4b03c;}}await this['store']['setSchemas'](_0x335f0d,this['getVID']());}async['deploySubscriptions'](){const _0x27aac4=this['manifest']['app']['graphs'],_0xd5cd88={};for(const _0x14632b of _0x27aac4){const _0x5b6612=_0x14632b['activities'],_0xc9a187=_0x14632b['subscribes'];for(const _0xe674af in _0x5b6612){if(_0x5b6612[_0xe674af]['type']==='trigger'){_0xd5cd88[_0xc9a187]=_0xe674af;break;}}}await this['store']['setSubscriptions'](_0xd5cd88,this['getVID']());}['findTrigger'](_0x2cd583){for(const _0x1a56d5 in _0x2cd583['activities']){const _0x48d7c4=_0x2cd583['activities'][_0x1a56d5];if(_0x48d7c4['type']==='trigger')return[_0x1a56d5,_0x48d7c4];}return null;}async['deployTransitions'](){const _0x1cc7a6=this['manifest']['app']['graphs'],_0xaf3695={};for(const _0x418ad0 of _0x1cc7a6){if(_0x418ad0['subscribes']&&_0x418ad0['subscribes']['startsWith']('.')){const [_0x367716]=this['findTrigger'](_0x418ad0);_0x367716&&(_0xaf3695[_0x418ad0['subscribes']]={[_0x367716]:!![]});}if(_0x418ad0['transitions'])for(const _0x3c2d54 in _0x418ad0['transitions']){const _0x48c50f=_0x418ad0['transitions'][_0x3c2d54],_0x2a4d7a={};for(const _0x2380bd of _0x48c50f){const _0xe6965c=_0x2380bd['to'];_0x2380bd['conditions']?_0x2a4d7a[_0xe6965c]=_0x2380bd['conditions']:_0x2a4d7a[_0xe6965c]=!![];}Object['keys'](_0x2a4d7a)['length']>0x0&&(_0xaf3695['.'+_0x3c2d54]=_0x2a4d7a);}}await this['store']['setTransitions'](_0xaf3695,this['getVID']());}async['deployHookPatterns'](){const _0xdc8333=this['manifest']['app']['graphs'],_0x30880a={};for(const _0x49a7fa of _0xdc8333){if(_0x49a7fa['hooks'])for(const _0x55660f in _0x49a7fa['hooks']){_0x30880a[_0x55660f]=_0x49a7fa['hooks'][_0x55660f];const _0x2a6202=_0x49a7fa['hooks'][_0x55660f][0x0]['to'],_0x21f103=_0x49a7fa['activities'][_0x2a6202];_0x21f103&&(!_0x21f103['hook']&&(_0x21f103['hook']={}),_0x21f103['hook']['topic']=_0x55660f);}}await this['store']['setHookRules'](_0x30880a);}async['deployConsumerGroups'](){const _0x2ad971={'appId':this['manifest']['app']['id']},_0x56f18b=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x2ad971);await this['deployConsumerGroup'](_0x56f18b,'ENGINE');for(const _0xdb99bb of this['manifest']['app']['graphs']){const _0x25b1ce=_0xdb99bb['activities'];for(const _0x45e408 in _0x25b1ce){const _0x1d46ac=_0x25b1ce[_0x45e408];if(_0x1d46ac['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x1d46ac['subtype'],{})===_0x1d46ac['subtype']){_0x2ad971['topic']=_0x1d46ac['subtype'];const _0x2d2190=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x2ad971);await this['deployConsumerGroup'](_0x2d2190,'WORKER');}}}}async['deployConsumerGroup'](_0x5e869e,_0xbb3440){try{await this['stream']['createConsumerGroup'](_0x5e869e,_0xbb3440);}catch(_0x19d429){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x5e869e,'group':_0xbb3440});}}}exports['Deployer']=Deployer;
1
+ 'use strict';(function(_0x5ecb5c,_0x2bdd7c){const _0x34b0cf=_0x5b5b,_0x124fe1=_0x5ecb5c();while(!![]){try{const _0x43eda6=-parseInt(_0x34b0cf(0x1b6))/0x1+parseInt(_0x34b0cf(0x1bc))/0x2+-parseInt(_0x34b0cf(0x1bd))/0x3+-parseInt(_0x34b0cf(0x1b8))/0x4+parseInt(_0x34b0cf(0x1bb))/0x5*(parseInt(_0x34b0cf(0x1b7))/0x6)+-parseInt(_0x34b0cf(0x1ba))/0x7+parseInt(_0x34b0cf(0x1b9))/0x8;if(_0x43eda6===_0x2bdd7c)break;else _0x124fe1['push'](_0x124fe1['shift']());}catch(_0x4f57a7){_0x124fe1['push'](_0x124fe1['shift']());}}}(_0x445b,0xed9bc));function _0x445b(){const _0x50a13a=['5YfIBaK','222606AsIXxV','3755517ZQrZWo','1587412QhYMhw','11627718TgVVxE','2399884hIuOvA','22252880ALwCiz','2928800dwcpLZ'];_0x445b=function(){return _0x50a13a;};return _0x445b();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Deployer']=void 0x0;const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),serializer_1=require('../serializer'),pipe_1=require('../pipe'),validator_1=require('./validator'),DEFAULT_METADATA_RANGE_SIZE=0x1a,DEFAULT_DATA_RANGE_SIZE=0x104,DEFAULT_RANGE_SIZE=DEFAULT_METADATA_RANGE_SIZE+DEFAULT_DATA_RANGE_SIZE;class Deployer{constructor(_0x415613){this['manifest']=null,this['manifest']=_0x415613;}async['deploy'](_0x39e7aa,_0x140594){this['store']=_0x39e7aa,this['stream']=_0x140594,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 _0x50f3b7 of this['manifest']['app']['graphs']){const [,_0x1458e3]=this['findTrigger'](_0x50f3b7),_0x3d465d=_0x1458e3['subscribes'],[_0x4dbae4,_0x171937,_0x1c0030]=await this['store']['reserveSymbolRange']('$'+_0x3d465d,DEFAULT_RANGE_SIZE,'JOB'),_0x289786='',_0x891080=this['bindSymbols'](_0x4dbae4,_0x171937,_0x1c0030,_0x289786,_0x1458e3['PRODUCES']);Object['keys'](_0x891080)['length']&&await this['store']['addSymbols']('$'+_0x3d465d,_0x891080);for(const [_0x4f41de,_0x10a2f3]of Object['entries'](_0x50f3b7['activities'])){const [_0x14fbe0,_0x52aa90,_0x627e9a]=await this['store']['reserveSymbolRange'](_0x4f41de,DEFAULT_RANGE_SIZE,'ACTIVITY'),_0x5ac360=_0x4f41de+'/';this['bindSelf'](_0x10a2f3['consumes'],_0x10a2f3['produces'],_0x4f41de);const _0x4f212a=this['bindSymbols'](_0x14fbe0,_0x52aa90,_0x627e9a,_0x5ac360,_0x10a2f3['produces']);Object['keys'](_0x4f212a)['length']&&await this['store']['addSymbols'](_0x4f41de,_0x4f212a);}}}['bindSelf'](_0xee7469,_0x27f0d0,_0x1c52c0){for(const _0x1f9033 of[_0x1c52c0,'$self']){const _0x229d5a=_0xee7469[_0x1f9033];if(_0x229d5a)for(const _0x2f3a83 of _0x229d5a){!_0x27f0d0['includes'](_0x2f3a83)&&_0x27f0d0['push'](_0x2f3a83);}}}['bindSymbols'](_0x521674,_0x3bb6dd,_0x517b17,_0x20c63e,_0x851138){const _0x45d648={},_0x301b16={..._0x517b17};for(const _0x1cfa8f of _0x851138){const _0x483d98=''+_0x20c63e+_0x1cfa8f;if(!_0x301b16[_0x483d98]){if(_0x521674>_0x3bb6dd)throw new Error('Symbol\x20index\x20out\x20of\x20bounds');const _0x166568=(0x0,utils_1['getSymKey'])(_0x521674);_0x521674++,_0x45d648[_0x483d98]=_0x166568,_0x301b16[_0x483d98]=_0x166568;}}return _0x45d648;}['copyJobSchemas'](){const _0x9cc71a=this['manifest']['app']['graphs'];for(const _0x53f45e of _0x9cc71a){const _0x440252=_0x53f45e['output']?.['schema'],_0xfaca63=_0x53f45e['input']?.['schema'];if(!_0x440252&&!_0xfaca63)continue;const _0x14dc1b=_0x53f45e['activities'];for(const _0x229fb3 in _0x14dc1b){if(_0x14dc1b[_0x229fb3]['type']==='trigger'){const _0x479413=_0x14dc1b[_0x229fb3];_0x440252&&(!_0x479413['job']&&(_0x479413['job']={}),_0x479413['job']['schema']=_0x440252),_0xfaca63&&(_0x479413['output']={'schema':_0xfaca63});}}}}['bindBackRefs'](){for(const _0x2d0a73 of this['manifest']['app']['graphs']){const _0x4bde1f=_0x2d0a73['activities'],_0x564a76=this['findTrigger'](_0x2d0a73)[0x0];for(const _0x373173 in _0x4bde1f){_0x4bde1f[_0x373173]['trigger']=_0x564a76,_0x4bde1f[_0x373173]['subscribes']=_0x2d0a73['subscribes'],_0x2d0a73['publishes']&&(_0x4bde1f[_0x373173]['publishes']=_0x2d0a73['publishes']),_0x4bde1f[_0x373173]['expire']=_0x2d0a73['expire']??undefined,_0x4bde1f[_0x373173]['persistent']=_0x2d0a73['persistent']??undefined;}}}['bindCycleTarget'](){for(const _0x43dbc1 of this['manifest']['app']['graphs']){const _0x18245e=_0x43dbc1['activities'];for(const _0x44a80c in _0x18245e){const _0x348765=_0x18245e[_0x44a80c];_0x348765['type']==='cycle'&&(_0x18245e[_0x348765['ancestor']]['cycle']=!![]);}}}['convertTopicsToTypes'](){for(const _0xc71e8 of this['manifest']['app']['graphs']){const _0x49a774=_0xc71e8['activities'];for(const _0x1ce498 in _0x49a774){const _0x48a6b0=_0x49a774[_0x1ce498];['worker','await']['includes'](_0x48a6b0['type'])&&_0x48a6b0['topic']&&!_0x48a6b0['subtype']&&(_0x48a6b0['subtype']=_0x48a6b0['topic']);}}}['convertActivitiesToHooks'](){for(const _0x4c2587 of this['manifest']['app']['graphs']){const _0x503dbe=_0x4c2587['activities'];for(const _0x553284 in _0x503dbe){const _0xe0f248=_0x503dbe[_0x553284];['activity']['includes'](_0xe0f248['type'])&&(_0xe0f248['type']='hook');}}}async['bindParents'](){const _0x4b1599=this['manifest']['app']['graphs'];for(const _0x5b1a70 of _0x4b1599){if(_0x5b1a70['transitions'])for(const _0x3d083f in _0x5b1a70['transitions']){const _0x1ae1f1=_0x5b1a70['transitions'][_0x3d083f];for(const _0x34e40f of _0x1ae1f1){const _0x3d1f51=_0x34e40f['to'];_0x5b1a70['activities'][_0x3d1f51]['parent']=_0x3d083f;}_0x5b1a70['activities'][_0x3d083f]['transitions']=_0x1ae1f1;}}}['collectValues'](_0x4c9a4b,_0x411f6d){for(const [_0x1914c7,_0x145517]of Object['entries'](_0x4c9a4b)){if(_0x1914c7==='enum'||_0x1914c7==='examples'||_0x1914c7==='default'){if(Array['isArray'](_0x145517))for(const _0x37778a of _0x145517){typeof _0x37778a==='string'&&_0x37778a['length']>0x5&&_0x411f6d['add'](_0x37778a);}else typeof _0x145517==='string'&&_0x145517['length']>0x5&&_0x411f6d['add'](_0x145517);}else typeof _0x145517==='object'&&this['collectValues'](_0x145517,_0x411f6d);}}['traverse'](_0x552855,_0x35e3a5){for(const _0x47fbe9 of Object['values'](_0x552855)){typeof _0x47fbe9==='object'&&('schema'in _0x47fbe9?this['collectValues'](_0x47fbe9['schema'],_0x35e3a5):this['traverse'](_0x47fbe9,_0x35e3a5));}}async['generateSymVals'](){const _0x5439eb=new Set();for(const _0x3ff91c of this['manifest']['app']['graphs']){this['traverse'](_0x3ff91c,_0x5439eb);}const _0xf948cf=await this['store']['getSymbolValues'](),_0x2cc417=Object['keys'](_0xf948cf)['length'],_0x23fa14=Math['pow'](0x34,0x2)-0x1,_0x3e32db=serializer_1['SerializerService']['filterSymVals'](_0x2cc417,_0x23fa14,_0xf948cf,_0x5439eb);await this['store']['addSymbolValues'](_0x3e32db);}['resolveJobMapsPaths'](){function _0x53cf3d(_0x490d40){const _0x252eae=[];function _0x4cd3a4(_0x5ddbaa,_0x3daa53=[]){for(const _0x17a6fd in _0x5ddbaa){if(typeof _0x5ddbaa[_0x17a6fd]==='object'&&_0x5ddbaa[_0x17a6fd]!==null&&!('@pipe'in _0x5ddbaa[_0x17a6fd])){const _0xde2eec=[..._0x3daa53,_0x17a6fd];_0x4cd3a4(_0x5ddbaa[_0x17a6fd],_0xde2eec);}else{const _0x38c39e=[..._0x3daa53,_0x17a6fd]['join']('/');if(!_0x38c39e['includes']('[')){const _0x17cd5d='data/'+_0x38c39e;!_0x252eae['includes'](_0x17cd5d)&&_0x252eae['push'](_0x17cd5d);}else{const [_0x2d63b2,_0xdc9a3b]=_0x38c39e['split']('['),[_0x156441,_0x403fe4]=_0xdc9a3b['split'](']');if(!isNaN(parseInt(_0x156441)))for(let _0x34de51=0x0;_0x34de51<parseInt(_0x156441);_0x34de51++){const _0x26c4d5='data/'+_0x2d63b2+'/'+_0x34de51;!_0x252eae['includes'](_0x26c4d5)&&_0x252eae['push'](_0x26c4d5);}}}}}return _0x490d40&&_0x4cd3a4(_0x490d40),_0x252eae;}for(const _0x22d723 of this['manifest']['app']['graphs']){let _0x1d3d47=[];const [,_0x1b4b19]=this['findTrigger'](_0x22d723);for(const _0x458c7c in _0x22d723['activities']){const _0xdcd0aa=_0x22d723['activities'][_0x458c7c];_0x1d3d47=_0x1d3d47['concat'](_0x53cf3d(_0xdcd0aa['job']?.['maps']));}_0x1b4b19['PRODUCES']=_0x1d3d47;}}['resolveMappingDependencies'](){const _0x1ee3db=[];function _0x30be9d(_0x1b0d5c,_0x1e9b77){for(const _0x560590 in _0x1b0d5c){if(typeof _0x1b0d5c[_0x560590]==='string'){const _0x125447=_0x1b0d5c[_0x560590],_0x6520b0=_0x125447['match'](/^\{[^@].*}$/);_0x6520b0&&!validator_1['Validator']['CONTEXT_VARS']['includes'](_0x125447)&&(_0x125447['split']('.')[0x1]!=='input'&&(_0x1ee3db['push'](_0x125447),_0x1e9b77['push'](_0x125447)));}else typeof _0x1b0d5c[_0x560590]==='object'&&_0x1b0d5c[_0x560590]!==null&&_0x30be9d(_0x1b0d5c[_0x560590],_0x1e9b77);}}const _0xe52bbb=this['manifest']['app']['graphs'];for(const _0xf2933f of _0xe52bbb){const _0x22829b=_0xf2933f['activities'];for(const _0xdc40fe in _0x22829b){const _0x21c234=_0x22829b[_0xdc40fe];_0x21c234['consumes']=[],_0x30be9d(_0x21c234,_0x21c234['consumes']),_0x21c234['consumes']=this['groupMappingRules'](_0x21c234['consumes']);}}const _0x16a6af=this['groupMappingRules'](_0x1ee3db);for(const _0x702ae2 of _0xe52bbb){const _0x1eaee8=_0x702ae2['activities'];for(const _0x3f3ff4 in _0x1eaee8){const _0x26b3de=_0x1eaee8[_0x3f3ff4];_0x26b3de['produces']=_0x16a6af[''+_0x3f3ff4]||[];}}}['groupMappingRules'](_0x104cb4){_0x104cb4=Array['from'](new Set(_0x104cb4))['sort']();const _0xe2494f={};for(const _0x104637 of _0x104cb4){const [_0x36ac31,_0x2a15e5]=this['resolveMappableValue'](_0x104637);!_0xe2494f[_0x36ac31]&&(_0xe2494f[_0x36ac31]=[]),_0xe2494f[_0x36ac31]['push'](_0x2a15e5);}return _0xe2494f;}['resolveMappableValue'](_0x56ab22){_0x56ab22=_0x56ab22['substring'](0x1,_0x56ab22['length']-0x1);const _0x335707=_0x56ab22['split']('.');if(_0x335707[0x0]==='$job'){const [_0x4dc206,..._0x9d6234]=_0x335707;return[_0x4dc206,_0x9d6234['join']('/')];}else{const [_0x40c585,_0x20047c,_0x2260c6,..._0x145ea3]=_0x335707,_0x2f2a25={'hook':'hook/data','input':'input/data','output':_0x2260c6==='data'?'output/data':'output/metadata'}[_0x20047c];return[_0x40c585,_0x2f2a25+'/'+_0x145ea3['join']('/')];}}async['deployActivitySchemas'](){const _0x3936f9=this['manifest']['app']['graphs'],_0x4ecfef={};for(const _0x2acde7 of _0x3936f9){const _0xea8f63=_0x2acde7['activities'];for(const _0x2048ff in _0xea8f63){const _0x29c346=_0xea8f63[_0x2048ff];delete _0x29c346['transitions'],_0x4ecfef[_0x2048ff]=_0x29c346;}}await this['store']['setSchemas'](_0x4ecfef,this['getVID']());}async['deploySubscriptions'](){const _0x4a9b9c=this['manifest']['app']['graphs'],_0x4e6b97={};for(const _0x275e4e of _0x4a9b9c){const _0xc36a61=_0x275e4e['activities'],_0x40b306=_0x275e4e['subscribes'];for(const _0x55f66a in _0xc36a61){if(_0xc36a61[_0x55f66a]['type']==='trigger'){_0x4e6b97[_0x40b306]=_0x55f66a;break;}}}await this['store']['setSubscriptions'](_0x4e6b97,this['getVID']());}['findTrigger'](_0x15a832){for(const _0x57d292 in _0x15a832['activities']){const _0x269d99=_0x15a832['activities'][_0x57d292];if(_0x269d99['type']==='trigger')return[_0x57d292,_0x269d99];}return null;}async['deployTransitions'](){const _0x2fe11b=this['manifest']['app']['graphs'],_0x34518a={};for(const _0x5aacf6 of _0x2fe11b){if(_0x5aacf6['subscribes']&&_0x5aacf6['subscribes']['startsWith']('.')){const [_0x49dd50]=this['findTrigger'](_0x5aacf6);_0x49dd50&&(_0x34518a[_0x5aacf6['subscribes']]={[_0x49dd50]:!![]});}if(_0x5aacf6['transitions'])for(const _0x89b9c5 in _0x5aacf6['transitions']){const _0x543a67=_0x5aacf6['transitions'][_0x89b9c5],_0x2bb293={};for(const _0x42402c of _0x543a67){const _0x51cd96=_0x42402c['to'];_0x42402c['conditions']?_0x2bb293[_0x51cd96]=_0x42402c['conditions']:_0x2bb293[_0x51cd96]=!![];}Object['keys'](_0x2bb293)['length']>0x0&&(_0x34518a['.'+_0x89b9c5]=_0x2bb293);}}await this['store']['setTransitions'](_0x34518a,this['getVID']());}async['deployHookPatterns'](){const _0x11ca6d=this['manifest']['app']['graphs'],_0x1ac376={};for(const _0x451e61 of _0x11ca6d){if(_0x451e61['hooks'])for(const _0x899861 in _0x451e61['hooks']){_0x1ac376[_0x899861]=_0x451e61['hooks'][_0x899861];const _0x2edf9d=_0x451e61['hooks'][_0x899861][0x0]['to'],_0x5152f6=_0x451e61['activities'][_0x2edf9d];_0x5152f6&&(!_0x5152f6['hook']&&(_0x5152f6['hook']={}),_0x5152f6['hook']['topic']=_0x899861);}}await this['store']['setHookRules'](_0x1ac376);}async['deployConsumerGroups'](){const _0x10550d={'appId':this['manifest']['app']['id']},_0x11ee4d=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x10550d);await this['deployConsumerGroup'](_0x11ee4d,'ENGINE');for(const _0x23b773 of this['manifest']['app']['graphs']){const _0x32710c=_0x23b773['activities'];for(const _0x28954d in _0x32710c){const _0x2b22f3=_0x32710c[_0x28954d];if(_0x2b22f3['type']==='worker'&&pipe_1['Pipe']['resolve'](_0x2b22f3['subtype'],{})===_0x2b22f3['subtype']){_0x10550d['topic']=_0x2b22f3['subtype'];const _0x4f44c6=this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x10550d);await this['deployConsumerGroup'](_0x4f44c6,'WORKER');}}}}async['deployConsumerGroup'](_0x24a074,_0x213a32){try{await this['stream']['createConsumerGroup'](_0x24a074,_0x213a32);}catch(_0x3681f1){this['store']['logger']['info']('router-stream-group-exists',{'stream':_0x24a074,'group':_0x213a32});}}}function _0x5b5b(_0xb600f6,_0x21ce69){const _0x445bbd=_0x445b();return _0x5b5b=function(_0x5b5bd1,_0x45d748){_0x5b5bd1=_0x5b5bd1-0x1b6;let _0x10ea24=_0x445bbd[_0x5b5bd1];return _0x10ea24;},_0x5b5b(_0xb600f6,_0x21ce69);}exports['Deployer']=Deployer;
@@ -1 +1 @@
1
- 'use strict';(function(_0x285387,_0x1f01de){const _0x19af5f=_0x3e4b,_0x2c868e=_0x285387();while(!![]){try{const _0x25fc2c=parseInt(_0x19af5f(0x18f))/0x1*(parseInt(_0x19af5f(0x18c))/0x2)+parseInt(_0x19af5f(0x18e))/0x3+-parseInt(_0x19af5f(0x18d))/0x4+-parseInt(_0x19af5f(0x18b))/0x5+parseInt(_0x19af5f(0x191))/0x6+-parseInt(_0x19af5f(0x18a))/0x7+parseInt(_0x19af5f(0x190))/0x8;if(_0x25fc2c===_0x1f01de)break;else _0x2c868e['push'](_0x2c868e['shift']());}catch(_0x2fa5f8){_0x2c868e['push'](_0x2c868e['shift']());}}}(_0x212c,0x958ce));function _0x3e4b(_0x492793,_0x895063){const _0x212cc9=_0x212c();return _0x3e4b=function(_0x3e4b78,_0x77f002){_0x3e4b78=_0x3e4b78-0x18a;let _0x3911ae=_0x212cc9[_0x3e4b78];return _0x3911ae;},_0x3e4b(_0x492793,_0x895063);}var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x2db876,_0x6c3396,_0x54d715,_0x5a0908){if(_0x5a0908===undefined)_0x5a0908=_0x54d715;var _0x338037=Object['getOwnPropertyDescriptor'](_0x6c3396,_0x54d715);(!_0x338037||('get'in _0x338037?!_0x6c3396['__esModule']:_0x338037['writable']||_0x338037['configurable']))&&(_0x338037={'enumerable':!![],'get':function(){return _0x6c3396[_0x54d715];}}),Object['defineProperty'](_0x2db876,_0x5a0908,_0x338037);}:function(_0x373482,_0x2f3051,_0x1e2f7c,_0x1d245c){if(_0x1d245c===undefined)_0x1d245c=_0x1e2f7c;_0x373482[_0x1d245c]=_0x2f3051[_0x1e2f7c];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x164268,_0x167e04){Object['defineProperty'](_0x164268,'default',{'enumerable':!![],'value':_0x167e04});}:function(_0x1988b2,_0x56bb6a){_0x1988b2['default']=_0x56bb6a;}),__importStar=this&&this['__importStar']||function(_0x23d902){if(_0x23d902&&_0x23d902['__esModule'])return _0x23d902;var _0x192f76={};if(_0x23d902!=null){for(var _0x50ed35 in _0x23d902)if(_0x50ed35!=='default'&&Object['prototype']['hasOwnProperty']['call'](_0x23d902,_0x50ed35))__createBinding(_0x192f76,_0x23d902,_0x50ed35);}return __setModuleDefault(_0x192f76,_0x23d902),_0x192f76;},__importDefault=this&&this['__importDefault']||function(_0x5c54bf){return _0x5c54bf&&_0x5c54bf['__esModule']?_0x5c54bf:{'default':_0x5c54bf};};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(_0x151bfb,_0x5a67f6,_0x3b0121){this['store']=_0x151bfb,this['stream']=_0x5a67f6,this['logger']=_0x3b0121;}async['plan'](_0xd2d962){try{let _0x25c3ce;this['isPath'](_0xd2d962)?_0x25c3ce=await json_schema_ref_parser_1['default']['dereference'](_0xd2d962):_0x25c3ce=js_yaml_1['default']['load'](_0xd2d962);const _0x4c7c39=new validator_1['Validator'](_0x25c3ce);return _0x4c7c39['validate'](this['store']),_0x25c3ce;}catch(_0x54c6d9){this['logger']['error']('compiler-plan-error',_0x54c6d9);}}['isPath'](_0x2f1da3){return!_0x2f1da3['trim']()['startsWith']('app:');}async['deploy'](_0x15ef3d){try{let _0x280e3e;this['isPath'](_0x15ef3d)?(_0x280e3e=await json_schema_ref_parser_1['default']['dereference'](_0x15ef3d),await this['saveAsJSON'](_0x15ef3d,_0x280e3e)):_0x280e3e=js_yaml_1['default']['load'](_0x15ef3d);const _0x1b12d2=new validator_1['Validator'](_0x280e3e);_0x1b12d2['validate'](this['store']);const _0xfb01d3=new deployer_1['Deployer'](_0x280e3e);return await _0xfb01d3['deploy'](this['store'],this['stream']),await this['store']['setApp'](_0x280e3e['app']['id'],_0x280e3e['app']['version']),_0x280e3e;}catch(_0x55f117){this['logger']['error']('compiler-deploy-error',_0x55f117);}}async['activate'](_0x50accf,_0x26ea7f){return await this['store']['activateAppVersion'](_0x50accf,_0x26ea7f);}async['saveAsJSON'](_0x334bfe,_0x3a6c4a){const _0x16c78c=JSON['stringify'](_0x3a6c4a,null,0x2),_0x43d555=path['join'](path['dirname'](_0x334bfe),'.hotmesh.'+_0x3a6c4a['app']['id']+'.'+_0x3a6c4a['app']['version']+'.json');await fs['writeFile'](_0x43d555,_0x16c78c,'utf8');}}exports['CompilerService']=CompilerService;function _0x212c(){const _0x3f269a=['2903872zcAHHc','5290428sTGURG','7895440UouHaC','4397185NhRnWD','1202rSLixu','1053076fzDSKs','1637532MIovFP','1818aEJAuF'];_0x212c=function(){return _0x3f269a;};return _0x212c();}
1
+ 'use strict';(function(_0x1952fe,_0x369d02){const _0x131048=_0x3d65,_0x1a3d84=_0x1952fe();while(!![]){try{const _0x11fc66=parseInt(_0x131048(0xa8))/0x1*(-parseInt(_0x131048(0xaa))/0x2)+-parseInt(_0x131048(0xa3))/0x3*(parseInt(_0x131048(0xa5))/0x4)+-parseInt(_0x131048(0xa2))/0x5*(-parseInt(_0x131048(0xac))/0x6)+parseInt(_0x131048(0xa4))/0x7*(-parseInt(_0x131048(0xa6))/0x8)+parseInt(_0x131048(0xa7))/0x9+parseInt(_0x131048(0xab))/0xa+-parseInt(_0x131048(0xa9))/0xb;if(_0x11fc66===_0x369d02)break;else _0x1a3d84['push'](_0x1a3d84['shift']());}catch(_0x353d11){_0x1a3d84['push'](_0x1a3d84['shift']());}}}(_0x555e,0xa3973));function _0x3d65(_0x5c7b67,_0x1fa3c5){const _0x555e84=_0x555e();return _0x3d65=function(_0x3d6517,_0x2fd6a2){_0x3d6517=_0x3d6517-0xa2;let _0xa2535f=_0x555e84[_0x3d6517];return _0xa2535f;},_0x3d65(_0x5c7b67,_0x1fa3c5);}var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x361e29,_0x1d5b08,_0x40f37f,_0x5aef31){if(_0x5aef31===undefined)_0x5aef31=_0x40f37f;var _0x1fe717=Object['getOwnPropertyDescriptor'](_0x1d5b08,_0x40f37f);(!_0x1fe717||('get'in _0x1fe717?!_0x1d5b08['__esModule']:_0x1fe717['writable']||_0x1fe717['configurable']))&&(_0x1fe717={'enumerable':!![],'get':function(){return _0x1d5b08[_0x40f37f];}}),Object['defineProperty'](_0x361e29,_0x5aef31,_0x1fe717);}:function(_0x2f664c,_0x33ea38,_0x2ac054,_0x107a6a){if(_0x107a6a===undefined)_0x107a6a=_0x2ac054;_0x2f664c[_0x107a6a]=_0x33ea38[_0x2ac054];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x3f8008,_0x4bccb3){Object['defineProperty'](_0x3f8008,'default',{'enumerable':!![],'value':_0x4bccb3});}:function(_0x4cf934,_0x742770){_0x4cf934['default']=_0x742770;}),__importStar=this&&this['__importStar']||function(_0x27461b){if(_0x27461b&&_0x27461b['__esModule'])return _0x27461b;var _0x1f39d6={};if(_0x27461b!=null){for(var _0x5e66a6 in _0x27461b)if(_0x5e66a6!=='default'&&Object['prototype']['hasOwnProperty']['call'](_0x27461b,_0x5e66a6))__createBinding(_0x1f39d6,_0x27461b,_0x5e66a6);}return __setModuleDefault(_0x1f39d6,_0x27461b),_0x1f39d6;},__importDefault=this&&this['__importDefault']||function(_0x278f57){return _0x278f57&&_0x278f57['__esModule']?_0x278f57:{'default':_0x278f57};};function _0x555e(){const _0x625948=['18857476OeJKyD','15102iEOBbZ','12442800YOSvcc','3516RHGaLo','9710lvcpZG','13128FQLCEv','50218pyVXLY','680mhewOY','376QVexzW','11787471Taneop','30VtIDqG'];_0x555e=function(){return _0x625948;};return _0x555e();}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(_0x495f79,_0x4e9fdb,_0x3a111f){this['store']=_0x495f79,this['stream']=_0x4e9fdb,this['logger']=_0x3a111f;}async['plan'](_0x463114){try{let _0x59318c;this['isPath'](_0x463114)?_0x59318c=await json_schema_ref_parser_1['default']['dereference'](_0x463114):_0x59318c=js_yaml_1['default']['load'](_0x463114);const _0x245ef3=new validator_1['Validator'](_0x59318c);return _0x245ef3['validate'](this['store']),_0x59318c;}catch(_0x24d11c){this['logger']['error']('compiler-plan-error',_0x24d11c);}}['isPath'](_0x2ddf92){return!_0x2ddf92['trim']()['startsWith']('app:');}async['deploy'](_0x1b7f66){try{let _0x54ed68;this['isPath'](_0x1b7f66)?(_0x54ed68=await json_schema_ref_parser_1['default']['dereference'](_0x1b7f66),await this['saveAsJSON'](_0x1b7f66,_0x54ed68)):_0x54ed68=js_yaml_1['default']['load'](_0x1b7f66);const _0x5cf06b=new validator_1['Validator'](_0x54ed68);_0x5cf06b['validate'](this['store']);const _0x1bf334=new deployer_1['Deployer'](_0x54ed68);return await _0x1bf334['deploy'](this['store'],this['stream']),await this['store']['setApp'](_0x54ed68['app']['id'],_0x54ed68['app']['version']),_0x54ed68;}catch(_0x30c8f3){this['logger']['error']('compiler-deploy-error',_0x30c8f3);}}async['activate'](_0x508fe2,_0x206661){return await this['store']['activateAppVersion'](_0x508fe2,_0x206661);}async['saveAsJSON'](_0x5ed9bf,_0x27192d){const _0x4d4241=JSON['stringify'](_0x27192d,null,0x2),_0x2852cf=path['join'](path['dirname'](_0x5ed9bf),'.hotmesh.'+_0x27192d['app']['id']+'.'+_0x27192d['app']['version']+'.json');await fs['writeFile'](_0x2852cf,_0x4d4241,'utf8');}}exports['CompilerService']=CompilerService;
@@ -1 +1 @@
1
- 'use strict';(function(_0x52b7e6,_0xa42856){const _0x119edd=_0x5664,_0x299583=_0x52b7e6();while(!![]){try{const _0x11f0f7=-parseInt(_0x119edd(0x10f))/0x1*(-parseInt(_0x119edd(0x10a))/0x2)+parseInt(_0x119edd(0x105))/0x3*(-parseInt(_0x119edd(0x10b))/0x4)+-parseInt(_0x119edd(0x106))/0x5+parseInt(_0x119edd(0x10c))/0x6*(parseInt(_0x119edd(0x10e))/0x7)+-parseInt(_0x119edd(0x109))/0x8*(parseInt(_0x119edd(0x10d))/0x9)+-parseInt(_0x119edd(0x108))/0xa*(-parseInt(_0x119edd(0x107))/0xb)+parseInt(_0x119edd(0x111))/0xc*(parseInt(_0x119edd(0x110))/0xd);if(_0x11f0f7===_0xa42856)break;else _0x299583['push'](_0x299583['shift']());}catch(_0x310ce9){_0x299583['push'](_0x299583['shift']());}}}(_0x516d,0xe91fd));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Validator']=void 0x0;const pipe_1=require('../pipe');function _0x516d(){const _0x2631a1=['1316otvbqp','1HznsOR','11833562URvZHS','12KOxAQW','3vmcpqA','5811170qegTGC','77QsElfZ','1384060rrPgcY','8XSKJsI','1989674BStBoB','4013468uBZrqA','27228hXIumQ','5459571dDKUBW'];_0x516d=function(){return _0x2631a1;};return _0x516d();}class Validator{constructor(_0x2617dc){this['manifest']=null,this['activityIds']=[],this['mappingStatements']={},this['store']=null,this['manifest']=_0x2617dc;}async['validate'](_0x31e804){this['store']=_0x31e804,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 _0x4bc6bd=new Set();this['manifest']['app']['graphs']['forEach'](_0x2aad22=>{const _0x13a2e9=Object['keys'](_0x2aad22['activities']);_0x13a2e9['forEach'](_0x141a43=>{if(_0x4bc6bd['has'](_0x141a43))throw new Error('Duplicate\x20activity\x20id\x20found:\x20'+_0x141a43);else _0x4bc6bd['add'](_0x141a43);});}),this['activityIds']=Array['from'](_0x4bc6bd);}['isMappingStatement'](_0x514098){return typeof _0x514098==='string'&&_0x514098['startsWith']('{')&&_0x514098['endsWith']('}');}['extractMappingStatements'](_0x260cd6,_0x5be90a,_0x4d2faa){for(const _0x2ff55e in _0x260cd6){if(typeof _0x260cd6[_0x2ff55e]==='object'&&_0x260cd6[_0x2ff55e]!==null)this['extractMappingStatements'](_0x260cd6[_0x2ff55e],_0x5be90a,_0x4d2faa);else this['isMappingStatement'](_0x260cd6[_0x2ff55e])&&(!_0x5be90a[_0x4d2faa]&&(_0x5be90a[_0x4d2faa]=[]),_0x5be90a[_0x4d2faa]['push'](_0x260cd6[_0x2ff55e]));}}['getMappingStatements'](){const _0x3e8429={};this['manifest']['app']['graphs']['forEach'](_0x4b7b60=>{const _0x530867=_0x4b7b60['activities'];for(const _0x230b03 in _0x530867){const _0x512560=_0x530867[_0x230b03];this['extractMappingStatements'](_0x512560,_0x3e8429,_0x230b03);}}),this['mappingStatements']=_0x3e8429;}['validateReferencedActivityIds'](){const _0x5c5ecd=this['mappingStatements'],_0x427ccf=this['activityIds'];for(const _0x239c02 in _0x5c5ecd){const _0x19e989=_0x5c5ecd[_0x239c02];_0x19e989['forEach'](_0x163f3f=>{if(_0x163f3f['startsWith']('{')&&_0x163f3f['endsWith']('}')){const _0x3ef896=_0x163f3f['slice'](0x1,-0x1)['split']('.'),_0x40c992=_0x3ef896[0x0];if(!(Validator['SYS_VARS']['includes'](_0x40c992)||_0x427ccf['includes'](_0x40c992)||this['isFunction'](_0x163f3f)||this['isContextVariable'](_0x163f3f)))throw new Error('Mapping\x20statement\x20references\x20non-existent\x20activity:\x20'+_0x163f3f);}});}}['isFunction'](_0x300afa){return _0x300afa['startsWith']('{@')&&pipe_1['Pipe']['resolveFunction'](_0x300afa);}['isContextVariable'](_0x26f32d){return['{$input}','{$output}','{$item}','{$key}','{$index}']['includes'](_0x26f32d);}['validateMappingStatements'](){}['validateTransitions'](){}['validateTransitionConditions'](){}['validateStats'](){}['validateSchemas'](){}['validateUniqueHandledTopics'](){}['validateGraphPublishSubscribe'](){}['validateHooks'](){}['validateConditionalStatements'](){}}function _0x5664(_0x5bc2de,_0x575c4f){const _0x516dd2=_0x516d();return _0x5664=function(_0x566435,_0x1ff7c2){_0x566435=_0x566435-0x105;let _0x4e1dc4=_0x516dd2[_0x566435];return _0x4e1dc4;},_0x5664(_0x5bc2de,_0x575c4f);}exports['Validator']=Validator,Validator['SYS_VARS']=['$app','$self','$graph','$job'],Validator['CONTEXT_VARS']=['{$input}','{$output}','{$item}','{$key}','{$index}'];
1
+ 'use strict';(function(_0x5e236a,_0x1185f3){const _0x51374d=_0x3ff5,_0xcb520f=_0x5e236a();while(!![]){try{const _0x1009bf=-parseInt(_0x51374d(0x9a))/0x1*(parseInt(_0x51374d(0x92))/0x2)+-parseInt(_0x51374d(0x96))/0x3*(-parseInt(_0x51374d(0x97))/0x4)+-parseInt(_0x51374d(0x98))/0x5+parseInt(_0x51374d(0x93))/0x6+parseInt(_0x51374d(0x99))/0x7+parseInt(_0x51374d(0x95))/0x8*(-parseInt(_0x51374d(0x94))/0x9)+-parseInt(_0x51374d(0x91))/0xa;if(_0x1009bf===_0x1185f3)break;else _0xcb520f['push'](_0xcb520f['shift']());}catch(_0x5b5f39){_0xcb520f['push'](_0xcb520f['shift']());}}}(_0x1315,0xe5f50));function _0x3ff5(_0x97cbdf,_0x59969f){const _0x13152d=_0x1315();return _0x3ff5=function(_0x3ff5d8,_0x380e19){_0x3ff5d8=_0x3ff5d8-0x91;let _0x3b38aa=_0x13152d[_0x3ff5d8];return _0x3b38aa;},_0x3ff5(_0x97cbdf,_0x59969f);}function _0x1315(){const _0x808293=['573623pYRqeN','1558260MzuFmw','6sthnun','5261268GvBAAV','7524513FIDQwX','8lzzmSR','320442xlSfHf','56BKYMfu','1275830ZtCraM','10762836tCsHZJ'];_0x1315=function(){return _0x808293;};return _0x1315();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Validator']=void 0x0;const pipe_1=require('../pipe');class Validator{constructor(_0x4ad6d3){this['manifest']=null,this['activityIds']=[],this['mappingStatements']={},this['store']=null,this['manifest']=_0x4ad6d3;}async['validate'](_0x34339a){this['store']=_0x34339a,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 _0x49615f=new Set();this['manifest']['app']['graphs']['forEach'](_0x53f9d9=>{const _0x5d1559=Object['keys'](_0x53f9d9['activities']);_0x5d1559['forEach'](_0x1b08e6=>{if(_0x49615f['has'](_0x1b08e6))throw new Error('Duplicate\x20activity\x20id\x20found:\x20'+_0x1b08e6);else _0x49615f['add'](_0x1b08e6);});}),this['activityIds']=Array['from'](_0x49615f);}['isMappingStatement'](_0x409abd){return typeof _0x409abd==='string'&&_0x409abd['startsWith']('{')&&_0x409abd['endsWith']('}');}['extractMappingStatements'](_0x5dd0c9,_0x4cfad5,_0x2a1de8){for(const _0x1fb87c in _0x5dd0c9){if(typeof _0x5dd0c9[_0x1fb87c]==='object'&&_0x5dd0c9[_0x1fb87c]!==null)this['extractMappingStatements'](_0x5dd0c9[_0x1fb87c],_0x4cfad5,_0x2a1de8);else this['isMappingStatement'](_0x5dd0c9[_0x1fb87c])&&(!_0x4cfad5[_0x2a1de8]&&(_0x4cfad5[_0x2a1de8]=[]),_0x4cfad5[_0x2a1de8]['push'](_0x5dd0c9[_0x1fb87c]));}}['getMappingStatements'](){const _0x3f2ef8={};this['manifest']['app']['graphs']['forEach'](_0x4c0291=>{const _0x13bb71=_0x4c0291['activities'];for(const _0xa58f39 in _0x13bb71){const _0x365190=_0x13bb71[_0xa58f39];this['extractMappingStatements'](_0x365190,_0x3f2ef8,_0xa58f39);}}),this['mappingStatements']=_0x3f2ef8;}['validateReferencedActivityIds'](){const _0x34bff7=this['mappingStatements'],_0x21d24e=this['activityIds'];for(const _0x4fd030 in _0x34bff7){const _0x3d815f=_0x34bff7[_0x4fd030];_0x3d815f['forEach'](_0x350fd9=>{if(_0x350fd9['startsWith']('{')&&_0x350fd9['endsWith']('}')){const _0x4fc1e1=_0x350fd9['slice'](0x1,-0x1)['split']('.'),_0xc59c1e=_0x4fc1e1[0x0];if(!(Validator['SYS_VARS']['includes'](_0xc59c1e)||_0x21d24e['includes'](_0xc59c1e)||this['isFunction'](_0x350fd9)||this['isContextVariable'](_0x350fd9)))throw new Error('Mapping\x20statement\x20references\x20non-existent\x20activity:\x20'+_0x350fd9);}});}}['isFunction'](_0x12a810){return _0x12a810['startsWith']('{@')&&pipe_1['Pipe']['resolveFunction'](_0x12a810);}['isContextVariable'](_0x413410){return['{$input}','{$output}','{$item}','{$key}','{$index}']['includes'](_0x413410);}['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
2
  import { ProviderConfig, ProviderNativeClient } from '../../types/provider';
3
3
  export declare class ConnectorService {
4
+ static disconnectAll(): Promise<void>;
4
5
  static connectClient(ProviderConfig: ProviderConfig): Promise<ProviderNativeClient>;
5
6
  static initClients(target: HotMeshEngine | HotMeshWorker): Promise<void>;
6
7
  static initClient(ProviderConfig: ProviderConfig, target: HotMeshEngine | HotMeshWorker, field: string): Promise<void>;
@@ -7,6 +7,13 @@ const nats_1 = require("./providers/nats");
7
7
  const postgres_1 = require("./providers/postgres");
8
8
  const redis_1 = require("./providers/redis");
9
9
  class ConnectorService {
10
+ static async disconnectAll() {
11
+ await redis_1.RedisConnection.disconnectAll();
12
+ await ioredis_1.RedisConnection.disconnectAll();
13
+ await postgres_1.PostgresConnection.disconnectAll();
14
+ await nats_1.NatsConnection.disconnectAll();
15
+ }
16
+ ;
10
17
  static async connectClient(ProviderConfig) {
11
18
  const target = {};
12
19
  await ConnectorService.initClient(ProviderConfig, target, 'client');
@@ -30,20 +37,12 @@ class ConnectorService {
30
37
  }
31
38
  if (connections.sub) {
32
39
  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');
46
- }
40
+ connections.pub = {
41
+ class: connections.sub.class,
42
+ options: { ...connections.sub.options },
43
+ provider: connections.sub.provider,
44
+ };
45
+ await ConnectorService.initClient(connections.pub, target, 'pub');
47
46
  }
48
47
  }
49
48
  static async initClient(ProviderConfig, target, field) {
@@ -52,24 +51,26 @@ class ConnectorService {
52
51
  }
53
52
  const providerClass = ProviderConfig.class;
54
53
  const options = ProviderConfig.options;
55
- const providerName = (0, utils_1.identifyProvider)(providerClass);
54
+ const providerName = ProviderConfig.provider || (0, utils_1.identifyProvider)(providerClass);
55
+ const providerType = providerName.split('.')[0];
56
56
  let clientInstance;
57
57
  const id = (0, utils_1.guid)();
58
- switch (providerName) {
58
+ switch (providerType) {
59
59
  case 'redis':
60
- clientInstance = await redis_1.RedisConnection.connect(id, providerClass, options);
60
+ clientInstance = await redis_1.RedisConnection.connect(id, providerClass, options, { provider: providerName });
61
61
  break;
62
62
  case 'ioredis':
63
- clientInstance = await ioredis_1.RedisConnection.connect(id, providerClass, options);
63
+ clientInstance = await ioredis_1.RedisConnection.connect(id, providerClass, options, { provider: providerName });
64
64
  break;
65
65
  case 'nats':
66
- clientInstance = await nats_1.NatsConnection.connect(id, providerClass, options);
66
+ clientInstance = await nats_1.NatsConnection.connect(id, providerClass, options, { provider: providerName });
67
67
  break;
68
68
  case 'postgres':
69
- clientInstance = await postgres_1.PostgresConnection.connect(id, providerClass, options);
69
+ const bAutoConnect = field === 'sub';
70
+ clientInstance = await postgres_1.PostgresConnection.connect(id, providerClass, options, { connect: bAutoConnect, provider: providerName });
70
71
  break;
71
72
  default:
72
- throw new Error(`Unknown provider class: ${providerName}`);
73
+ throw new Error(`Unknown provider type: ${providerType}`);
73
74
  }
74
75
  target[field] = clientInstance.getClient();
75
76
  }
@@ -1,16 +1,18 @@
1
+ import { StringAnyType } from '../../types';
1
2
  import { ProviderClass, ProviderNativeClient, ProviderOptions } from '../../types/provider';
2
3
  import { ILogger } from '../logger';
3
4
  declare abstract class AbstractConnection<PClass, POptions> {
4
5
  static logger: ILogger;
6
+ static disconnecting: boolean;
5
7
  protected connection: any | null;
6
8
  protected static instances: Map<string, AbstractConnection<ProviderClass, ProviderOptions>>;
7
9
  protected id: string | null;
8
10
  protected abstract defaultOptions: any;
9
- protected abstract createConnection(client: PClass, options: POptions): Promise<any>;
11
+ protected abstract createConnection(client: PClass, options: POptions, config?: StringAnyType): Promise<any>;
10
12
  abstract getClient(): ProviderNativeClient;
11
13
  disconnect(): Promise<void>;
12
14
  protected abstract closeConnection(connection: any): Promise<void>;
13
- static connect<T extends AbstractConnection<ProviderClass, ProviderOptions>>(this: new () => T, id: string, client: ProviderClass, options?: ProviderOptions): Promise<T>;
15
+ static connect<T extends AbstractConnection<ProviderClass, ProviderOptions>>(this: new () => T, id: string, client: ProviderClass, options?: ProviderOptions, config?: StringAnyType): Promise<T>;
14
16
  static disconnectAll(): Promise<void>;
15
17
  }
16
18
  export { AbstractConnection };
@@ -16,22 +16,27 @@ class AbstractConnection {
16
16
  AbstractConnection.instances.delete(this.id);
17
17
  }
18
18
  }
19
- static async connect(id, client, options) {
19
+ static async connect(id, client, options, config) {
20
20
  if (AbstractConnection.instances.has(id)) {
21
21
  return AbstractConnection.instances.get(id);
22
22
  }
23
23
  const instance = new this();
24
24
  const opts = options ? { ...options } : { ...instance.defaultOptions };
25
- instance.connection = await instance.createConnection(client, opts);
25
+ instance.connection = await instance.createConnection(client, opts, config);
26
26
  instance.id = id;
27
27
  AbstractConnection.instances.set(id, instance);
28
28
  return instance;
29
29
  }
30
30
  static async disconnectAll() {
31
- await Promise.all(Array.from(this.instances.values()).map((instance) => instance.disconnect()));
32
- this.instances.clear();
31
+ if (!this.disconnecting) {
32
+ this.disconnecting = true;
33
+ await Promise.all(Array.from(this.instances.values()).map((instance) => instance.disconnect()));
34
+ this.instances.clear();
35
+ this.disconnecting = false;
36
+ }
33
37
  }
34
38
  }
35
39
  exports.AbstractConnection = AbstractConnection;
36
- AbstractConnection.logger = new logger_1.LoggerService('hotmesh', 'meshos');
40
+ AbstractConnection.logger = new logger_1.LoggerService('hotmesh', 'system');
41
+ AbstractConnection.disconnecting = false;
37
42
  AbstractConnection.instances = new Map();
@@ -1,9 +1,20 @@
1
1
  import { AbstractConnection } from '..';
2
- import { PostgresClientOptions, PostgresClientType, PostgresClassType } from '../../../types/postgres';
2
+ import { PostgresClientOptions, PostgresClientType, PostgresClassType, PostgresPoolClientType } from '../../../types/postgres';
3
3
  declare class PostgresConnection extends AbstractConnection<PostgresClassType, PostgresClientOptions> {
4
4
  defaultOptions: PostgresClientOptions;
5
- createConnection(clientConstructor: any, options: PostgresClientOptions): Promise<PostgresClientType>;
5
+ protected static poolClientInstances: Set<PostgresPoolClientType>;
6
+ protected static connectionInstances: Set<PostgresClientType>;
7
+ poolClientInstance: PostgresPoolClientType;
8
+ createConnection(clientConstructor: any, options: PostgresClientOptions, config?: {
9
+ connect?: boolean;
10
+ provider?: string;
11
+ }): Promise<PostgresClientType>;
6
12
  getClient(): PostgresClientType;
13
+ static disconnectAll(): Promise<void>;
14
+ static disconnectPoolClients(): Promise<void>;
15
+ static disconnectConnections(): Promise<void>;
7
16
  closeConnection(connection: PostgresClientType): Promise<void>;
17
+ static isPoolClient(client: any): client is PostgresPoolClientType;
18
+ static getTransactionClient(transactionClient: any): Promise<[('client' | 'poolclient'), PostgresClientType]>;
8
19
  }
9
20
  export { PostgresConnection };