@hotmeshio/hotmesh 0.3.21 → 0.3.23

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 (80) hide show
  1. package/README.md +7 -7
  2. package/build/modules/enums.d.ts +2 -0
  3. package/build/modules/enums.js +3 -1
  4. package/build/modules/key.js +1 -1
  5. package/build/modules/utils.js +1 -1
  6. package/build/package.json +1 -1
  7. package/build/services/activities/activity.js +1 -1
  8. package/build/services/activities/await.js +1 -1
  9. package/build/services/activities/cycle.js +1 -1
  10. package/build/services/activities/hook.js +1 -1
  11. package/build/services/activities/index.js +1 -1
  12. package/build/services/activities/interrupt.js +1 -1
  13. package/build/services/activities/signal.js +1 -1
  14. package/build/services/activities/trigger.js +1 -1
  15. package/build/services/activities/worker.js +1 -1
  16. package/build/services/collator/index.js +1 -1
  17. package/build/services/compiler/deployer.js +1 -1
  18. package/build/services/compiler/index.js +1 -1
  19. package/build/services/compiler/validator.js +1 -1
  20. package/build/services/connector/factory.js +0 -1
  21. package/build/services/connector/providers/postgres.d.ts +1 -1
  22. package/build/services/connector/providers/postgres.js +2 -1
  23. package/build/services/engine/index.js +1 -1
  24. package/build/services/exporter/index.js +1 -1
  25. package/build/services/mapper/index.js +1 -1
  26. package/build/services/meshcall/index.js +2 -2
  27. package/build/services/meshflow/client.js +2 -2
  28. package/build/services/meshflow/exporter.js +1 -1
  29. package/build/services/meshflow/worker.js +2 -2
  30. package/build/services/pipe/functions/array.js +1 -1
  31. package/build/services/pipe/functions/bitwise.js +1 -1
  32. package/build/services/pipe/functions/conditional.js +1 -1
  33. package/build/services/pipe/functions/cron.js +1 -1
  34. package/build/services/pipe/functions/date.js +1 -1
  35. package/build/services/pipe/functions/index.js +1 -1
  36. package/build/services/pipe/functions/json.js +1 -1
  37. package/build/services/pipe/functions/logical.js +1 -1
  38. package/build/services/pipe/functions/math.js +1 -1
  39. package/build/services/pipe/functions/number.js +1 -1
  40. package/build/services/pipe/functions/object.js +1 -1
  41. package/build/services/pipe/functions/string.js +1 -1
  42. package/build/services/pipe/functions/symbol.js +1 -1
  43. package/build/services/pipe/functions/unary.js +1 -1
  44. package/build/services/pipe/index.js +1 -1
  45. package/build/services/quorum/index.js +1 -1
  46. package/build/services/reporter/index.js +1 -1
  47. package/build/services/router/index.js +1 -1
  48. package/build/services/search/providers/postgres/postgres.js +1 -1
  49. package/build/services/search/providers/redis/ioredis.js +1 -1
  50. package/build/services/search/providers/redis/redis.js +1 -1
  51. package/build/services/serializer/index.js +1 -1
  52. package/build/services/store/providers/postgres/kvsql.js +1 -1
  53. package/build/services/store/providers/postgres/kvtables.js +1 -1
  54. package/build/services/store/providers/postgres/kvtransaction.js +1 -1
  55. package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
  56. package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
  57. package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
  58. package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
  59. package/build/services/store/providers/postgres/postgres.js +1 -1
  60. package/build/services/store/providers/redis/_base.js +1 -1
  61. package/build/services/store/providers/redis/ioredis.js +1 -1
  62. package/build/services/store/providers/redis/redis.js +1 -1
  63. package/build/services/store/providers/store-initializable.js +1 -1
  64. package/build/services/stream/providers/nats/nats.js +1 -1
  65. package/build/services/stream/providers/postgres/postgres.js +1 -1
  66. package/build/services/stream/providers/redis/ioredis.js +1 -1
  67. package/build/services/stream/providers/redis/redis.js +1 -1
  68. package/build/services/stream/providers/stream-initializable.js +1 -1
  69. package/build/services/sub/factory.d.ts +1 -1
  70. package/build/services/sub/factory.js +4 -4
  71. package/build/services/sub/providers/nats/nats.js +1 -1
  72. package/build/services/sub/providers/postgres/postgres.js +1 -1
  73. package/build/services/sub/providers/redis/ioredis.js +1 -1
  74. package/build/services/sub/providers/redis/redis.js +1 -1
  75. package/build/services/task/index.js +1 -1
  76. package/build/services/telemetry/index.js +1 -1
  77. package/build/services/worker/index.js +1 -1
  78. package/package.json +1 -1
  79. package/types/postgres.ts +1 -1
  80. package/types/provider.ts +1 -3
@@ -1 +1 @@
1
- 'use strict';(function(_0x3cffd6,_0x339d6b){const _0x5177e0=_0xe003,_0xd54a16=_0x3cffd6();while(!![]){try{const _0x485ab1=parseInt(_0x5177e0(0x1bf))/0x1+parseInt(_0x5177e0(0x1bc))/0x2*(parseInt(_0x5177e0(0x1c2))/0x3)+parseInt(_0x5177e0(0x1c0))/0x4*(-parseInt(_0x5177e0(0x1c3))/0x5)+parseInt(_0x5177e0(0x1c6))/0x6*(parseInt(_0x5177e0(0x1c4))/0x7)+parseInt(_0x5177e0(0x1be))/0x8+parseInt(_0x5177e0(0x1c1))/0x9*(-parseInt(_0x5177e0(0x1c5))/0xa)+-parseInt(_0x5177e0(0x1bd))/0xb;if(_0x485ab1===_0x339d6b)break;else _0xd54a16['push'](_0xd54a16['shift']());}catch(_0x202f69){_0xd54a16['push'](_0xd54a16['shift']());}}}(_0x68c1,0x5d678));function _0xe003(_0x61b8d9,_0x3e229e){const _0x68c13d=_0x68c1();return _0xe003=function(_0xe0030b,_0x398ebc){_0xe0030b=_0xe0030b-0x1bc;let _0x1a5ded=_0x68c13d[_0xe0030b];return _0x1a5ded;},_0xe003(_0x61b8d9,_0x3e229e);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['RedisStreamService']=void 0x0;const index_1=require('../../index'),utils_1=require('../../../../modules/utils'),key_1=require('../../../../modules/key'),enums_1=require('../../../../modules/enums');class RedisStreamService extends index_1['StreamService']{constructor(_0x130eb9,_0x5f3bfd,_0x4b0dc0={}){super(_0x130eb9,_0x5f3bfd,_0x4b0dc0);}async['init'](_0x210265,_0x4fb577,_0x5585ba){this['namespace']=_0x210265,this['logger']=_0x5585ba,this['appId']=_0x4fb577;}['mintKey'](_0x547cf2,_0x593f0d){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x547cf2,{..._0x593f0d,'appId':this['appId']});}['transact'](){return this['streamClient']['multi']();}async['createStream'](_0x4effff){try{const _0x2a3fde=await this['streamClient']['XADD'](_0x4effff,'*',{'field':'value'});return await this['streamClient']['XDEL'](_0x4effff,_0x2a3fde),!![];}catch(_0x32cc89){this['logger']['error']('Error\x20creating\x20stream\x20'+_0x4effff,{'error':_0x32cc89});throw _0x32cc89;}}async['deleteStream'](_0x525424){try{const _0x3c8c35=await this['streamClient']['DEL'](_0x525424);return _0x3c8c35>0x0;}catch(_0x5be761){this['logger']['error']('Error\x20deleting\x20stream\x20'+_0x525424,{'error':_0x5be761});throw _0x5be761;}}async['createConsumerGroup'](_0x43f1a6,_0xa15e5b){try{const _0x10fda0=await this['storeClient']['sendCommand'](['XGROUP','CREATE',_0x43f1a6,_0xa15e5b,'$','MKSTREAM']);return _0x10fda0==='OK';}catch(_0x3be257){const _0x51d6e3='with\x20MKSTREAM';this['logger']['debug']('x-group-error\x20'+_0x51d6e3+'\x20for\x20key:\x20'+_0x43f1a6+'\x20and\x20group:\x20'+_0xa15e5b,{..._0x3be257});throw _0x3be257;}}async['deleteConsumerGroup'](_0x1e6a13,_0xd2d874){try{const _0x707ce4=await this['streamClient']['xGroupDestroy'](_0x1e6a13,_0xd2d874);return _0x707ce4;}catch(_0x23d8d2){this['logger']['error']('Error\x20deleting\x20consumer\x20group\x20'+_0xd2d874+'\x20for\x20stream\x20'+_0x1e6a13,{'error':_0x23d8d2});throw _0x23d8d2;}}async['publishMessages'](_0x20ee89,_0x56ef98,_0x41e841){try{const _0x2c486d=_0x41e841?.['transaction']||_0x56ef98['length']>0x1&&this['storeClient']['multi']();let _0x5c9788;for(const _0x2f9faa of _0x56ef98){_0x5c9788=await(_0x2c486d||this['storeClient'])['XADD'](_0x20ee89,'*',{'message':_0x2f9faa});}return _0x2c486d&&!_0x41e841?.['transaction']?(await _0x2c486d['exec']())['map'](_0x2a620c=>_0x2a620c[0x1]):[_0x5c9788];}catch(_0x934924){this['logger']['error']('ioredis-xadd-error\x20key:\x20'+_0x20ee89,{..._0x934924});throw _0x934924;}}async['consumeMessages'](_0x431619,_0x2c43ea,_0x5916b6,_0xf2d96d){const _0x42848a='GROUP',_0x2bf3d9='BLOCK',_0x2bfc75='STREAMS',_0x36bc5b='>';try{const _0x495027=await this['streamClient']['sendCommand'](['XREADGROUP',_0x42848a,_0x2c43ea,_0x5916b6,_0x2bf3d9,_0xf2d96d?.['blockTimeout']?.['toString']()??enums_1['HMSH_BLOCK_TIME_MS']['toString'](),_0x2bfc75,_0x431619,_0x36bc5b]),_0x5d6a17=[];if((0x0,utils_1['isStreamMessage'])(_0x495027)){const [[,_0x16cdbc]]=_0x495027;for(const [_0x21a33f,_0xcde93e]of _0x16cdbc){_0x5d6a17['push']({'id':_0x21a33f,'data':(0x0,utils_1['parseStreamMessage'])(_0xcde93e[0x1])});}}else return[];return _0x5d6a17;}catch(_0xd63415){this['logger']['error']('Error\x20consuming\x20messages\x20from\x20'+_0x431619,{'error':_0xd63415});throw _0xd63415;}}async['ackAndDelete'](_0x521ebf,_0x1dc1f6,_0x11a6a1){const _0x5eb551=this['storeClient']['multi']();return await this['acknowledgeMessages'](_0x521ebf,_0x1dc1f6,_0x11a6a1,{'multi':_0x5eb551}),await this['deleteMessages'](_0x521ebf,_0x1dc1f6,_0x11a6a1,{'multi':_0x5eb551}),await _0x5eb551['exec'](),_0x11a6a1['length'];}async['acknowledgeMessages'](_0x4754f3,_0xc06d56,_0x36f954,_0x386f09){try{return _0x386f09?.['multi']?(_0x386f09['multi']['XACK'](_0x4754f3,_0xc06d56,_0x36f954),_0x386f09['multi']):await this['streamClient']['XACK'](_0x4754f3,_0xc06d56,..._0x36f954);}catch(_0x35ee87){this['logger']['error']('Error\x20in\x20acknowledging\x20messages\x20in\x20group:\x20'+_0xc06d56+'\x20for\x20key:\x20'+_0x4754f3,{'error':_0x35ee87});throw _0x35ee87;}}async['deleteMessages'](_0x4086a1,_0x30aa5c,_0x1f3eb7,_0x13cfcd){try{return _0x13cfcd?.['multi']?(_0x13cfcd['multi']['xDel'](_0x4086a1,_0x1f3eb7),_0x13cfcd['multi']):await this['streamClient']['XDEL'](_0x4086a1,..._0x1f3eb7);}catch(_0x349be2){this['logger']['error']('Error\x20in\x20deleting\x20messages\x20with\x20ids:\x20'+_0x1f3eb7['join'](',')+'\x20for\x20key:\x20'+_0x4086a1,{'error':_0x349be2});throw _0x349be2;}}async['getPendingMessages'](_0x1dd67c,_0x2ec393,_0x366112,_0xd56717){try{const _0x4dc2e5='-',_0x18d3d4='+',_0xaa8a1c=[_0x1dd67c,_0x2ec393];if(_0x4dc2e5)_0xaa8a1c['push'](_0x4dc2e5);if(_0x18d3d4)_0xaa8a1c['push'](_0x18d3d4);if(_0x366112!==undefined)_0xaa8a1c['push'](_0x366112['toString']());if(_0xd56717)_0xaa8a1c['push'](_0xd56717);try{return await this['streamClient']['sendCommand'](['XPENDING',..._0xaa8a1c]);}catch(_0x360446){this['logger']['error']('error,\x20args',{..._0x360446},_0xaa8a1c);}}catch(_0x3816cd){this['logger']['error']('Error\x20retrieving\x20pending\x20messages\x20for\x20group:\x20'+_0x2ec393+'\x20in\x20key:\x20'+_0x1dd67c,{..._0x3816cd});throw _0x3816cd;}}async['retryMessages'](_0xb99f6c,_0x2609d1,_0x185c3a){let _0x188e1e=[];const _0x3b3b74=await this['getPendingMessages'](_0xb99f6c,_0x2609d1,_0x185c3a?.['limit']);for(const _0x5e1a51 of _0x3b3b74){if(Array['isArray'](_0x5e1a51)){const [_0x52ffc0,,_0x49bac0,_0x1445ac]=_0x5e1a51;if(_0x49bac0>_0x185c3a?.['minIdleTime']){const _0x31be60=await this['claimMessage'](_0xb99f6c,_0x2609d1,_0x185c3a?.['consumerName'],_0x185c3a?.['minIdleTime'],_0x52ffc0);_0x188e1e=_0x188e1e['concat'](_0x31be60);}}}return _0x188e1e;}async['claimMessage'](_0x4325c2,_0x570efa,_0x5ddac7,_0x1590c2,_0x25c643,..._0x5d79ca){try{const _0x5b889e=await this['streamClient']['sendCommand'](['XCLAIM',_0x4325c2,_0x570efa,_0x5ddac7,_0x1590c2['toString'](),_0x25c643,..._0x5d79ca]);return{'id':_0x5b889e[0x0][0x0],'data':(0x0,utils_1['parseStreamMessage'])(_0x5b889e[0x0][0x1][0x1])};}catch(_0x378c91){this['logger']['error']('Error\x20in\x20claiming\x20message\x20with\x20id:\x20'+_0x25c643+'\x20in\x20group:\x20'+_0x570efa+'\x20for\x20key:\x20'+_0x4325c2,{..._0x378c91});throw _0x378c91;}}async['getStreamStats'](_0x1c8afe){return{'messageCount':await this['getStreamDepth'](_0x1c8afe)};}async['getStreamDepth'](_0x545c5f,_0x4e143d){try{if(_0x4e143d?.['multi'])return _0x4e143d['multi']['XLEN'](_0x545c5f),0x0;const _0x2cf4d3=await this['streamClient']['XLEN'](_0x545c5f);return _0x2cf4d3;}catch(_0x48c3a3){this['logger']['error']('Error\x20getting\x20depth\x20for\x20'+_0x545c5f,{'error':_0x48c3a3});throw _0x48c3a3;}}async['getStreamDepths'](_0x432a45){const _0x5cd203=this['storeClient']['multi'](),_0x59589a=new Map();_0x432a45['forEach'](_0x1f1ba1=>{!_0x59589a['has'](_0x1f1ba1['stream'])&&(_0x59589a['set'](_0x1f1ba1['stream'],-0x1),this['getStreamDepth'](_0x1f1ba1['stream'],{'multi':_0x5cd203}));});const _0x55c0ee=await _0x5cd203['exec']();return Array['from'](_0x59589a['keys']())['forEach']((_0x26af04,_0x176d01)=>{_0x59589a['set'](_0x26af04,_0x55c0ee[_0x176d01]);}),_0x432a45['map'](_0x3e069f=>{return{'stream':_0x3e069f['stream'],'depth':_0x59589a['get'](_0x3e069f['stream'])||0x0};});}async['trimStream'](_0x56080a,_0xb11e9e){return 0x0;}['getProviderSpecificFeatures'](){return{'supportsBatching':!![],'supportsDeadLetterQueue':![],'supportsOrdering':!![],'supportsTrimming':!![],'supportsRetry':!![],'maxMessageSize':0x200*0x400*0x400,'maxBatchSize':0x3e8};}}function _0x68c1(){const _0x763aa4=['349780NSTPWK','126OvRZIK','278PjBOmH','4160585NUuheK','2537288BvblxR','313217BtjkAO','56xtVuOU','9RZvnmQ','14799lPOpVx','253865KVVJMc','63518llRDnA'];_0x68c1=function(){return _0x763aa4;};return _0x68c1();}exports['RedisStreamService']=RedisStreamService;
1
+ 'use strict';(function(_0x1104e1,_0x5bd03f){const _0x2b715a=_0x7063,_0x236db0=_0x1104e1();while(!![]){try{const _0x2fcd55=-parseInt(_0x2b715a(0x1b2))/0x1+parseInt(_0x2b715a(0x1af))/0x2*(parseInt(_0x2b715a(0x1ad))/0x3)+-parseInt(_0x2b715a(0x1ac))/0x4+parseInt(_0x2b715a(0x1ae))/0x5+-parseInt(_0x2b715a(0x1ab))/0x6+parseInt(_0x2b715a(0x1b1))/0x7+parseInt(_0x2b715a(0x1b0))/0x8;if(_0x2fcd55===_0x5bd03f)break;else _0x236db0['push'](_0x236db0['shift']());}catch(_0x2e33af){_0x236db0['push'](_0x236db0['shift']());}}}(_0x4dfe,0x80dd1));function _0x4dfe(){const _0x31fec1=['1513632vtEISf','1346056zJxwwi','39oFOGZO','2938690pQPOfl','41332WccbrL','5686320QMgRBh','4086341umdIGq','1034338GQsxSl'];_0x4dfe=function(){return _0x31fec1;};return _0x4dfe();}function _0x7063(_0x32c314,_0x557e05){const _0x4dfe5b=_0x4dfe();return _0x7063=function(_0x7063b8,_0xa922ad){_0x7063b8=_0x7063b8-0x1ab;let _0x4b461c=_0x4dfe5b[_0x7063b8];return _0x4b461c;},_0x7063(_0x32c314,_0x557e05);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['RedisStreamService']=void 0x0;const index_1=require('../../index'),utils_1=require('../../../../modules/utils'),key_1=require('../../../../modules/key'),enums_1=require('../../../../modules/enums');class RedisStreamService extends index_1['StreamService']{constructor(_0x26432a,_0x178a92,_0x152ba3={}){super(_0x26432a,_0x178a92,_0x152ba3);}async['init'](_0x9d3276,_0x356969,_0x42553b){this['namespace']=_0x9d3276,this['logger']=_0x42553b,this['appId']=_0x356969;}['mintKey'](_0xfeae3b,_0xe8f953){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0xfeae3b,{..._0xe8f953,'appId':this['appId']});}['transact'](){return this['streamClient']['multi']();}async['createStream'](_0x140613){try{const _0x109b8f=await this['streamClient']['XADD'](_0x140613,'*',{'field':'value'});return await this['streamClient']['XDEL'](_0x140613,_0x109b8f),!![];}catch(_0x3c91cc){this['logger']['error']('Error\x20creating\x20stream\x20'+_0x140613,{'error':_0x3c91cc});throw _0x3c91cc;}}async['deleteStream'](_0x245266){try{const _0x25183e=await this['streamClient']['DEL'](_0x245266);return _0x25183e>0x0;}catch(_0x1e50be){this['logger']['error']('Error\x20deleting\x20stream\x20'+_0x245266,{'error':_0x1e50be});throw _0x1e50be;}}async['createConsumerGroup'](_0x3f4a2f,_0x170bdc){try{const _0x5c678c=await this['storeClient']['sendCommand'](['XGROUP','CREATE',_0x3f4a2f,_0x170bdc,'$','MKSTREAM']);return _0x5c678c==='OK';}catch(_0x1d7447){const _0x2d8563='with\x20MKSTREAM';this['logger']['debug']('x-group-error\x20'+_0x2d8563+'\x20for\x20key:\x20'+_0x3f4a2f+'\x20and\x20group:\x20'+_0x170bdc,{..._0x1d7447});throw _0x1d7447;}}async['deleteConsumerGroup'](_0x56a95a,_0x3488e1){try{const _0x35de8d=await this['streamClient']['xGroupDestroy'](_0x56a95a,_0x3488e1);return _0x35de8d;}catch(_0x5930ed){this['logger']['error']('Error\x20deleting\x20consumer\x20group\x20'+_0x3488e1+'\x20for\x20stream\x20'+_0x56a95a,{'error':_0x5930ed});throw _0x5930ed;}}async['publishMessages'](_0x3a2d36,_0x26d183,_0x5f37d0){try{const _0x1a0a76=_0x5f37d0?.['transaction']||_0x26d183['length']>0x1&&this['storeClient']['multi']();let _0x3dfd8a;for(const _0x1f0d5d of _0x26d183){_0x3dfd8a=await(_0x1a0a76||this['storeClient'])['XADD'](_0x3a2d36,'*',{'message':_0x1f0d5d});}return _0x1a0a76&&!_0x5f37d0?.['transaction']?(await _0x1a0a76['exec']())['map'](_0x7aebf6=>_0x7aebf6[0x1]):[_0x3dfd8a];}catch(_0x150316){this['logger']['error']('ioredis-xadd-error\x20key:\x20'+_0x3a2d36,{..._0x150316});throw _0x150316;}}async['consumeMessages'](_0x2e29b7,_0x1092c0,_0x317a37,_0xa307c2){const _0x533fc4='GROUP',_0xcf1de5='BLOCK',_0x6c1b53='STREAMS',_0x6e1270='>';try{const _0x12af48=await this['streamClient']['sendCommand'](['XREADGROUP',_0x533fc4,_0x1092c0,_0x317a37,_0xcf1de5,_0xa307c2?.['blockTimeout']?.['toString']()??enums_1['HMSH_BLOCK_TIME_MS']['toString'](),_0x6c1b53,_0x2e29b7,_0x6e1270]),_0x363af0=[];if((0x0,utils_1['isStreamMessage'])(_0x12af48)){const [[,_0x2af09c]]=_0x12af48;for(const [_0x415ac3,_0x36c3c5]of _0x2af09c){_0x363af0['push']({'id':_0x415ac3,'data':(0x0,utils_1['parseStreamMessage'])(_0x36c3c5[0x1])});}}else return[];return _0x363af0;}catch(_0x404e20){this['logger']['error']('Error\x20consuming\x20messages\x20from\x20'+_0x2e29b7,{'error':_0x404e20});throw _0x404e20;}}async['ackAndDelete'](_0x318d22,_0x4f5963,_0x28ae9c){const _0x4bbce3=this['storeClient']['multi']();return await this['acknowledgeMessages'](_0x318d22,_0x4f5963,_0x28ae9c,{'multi':_0x4bbce3}),await this['deleteMessages'](_0x318d22,_0x4f5963,_0x28ae9c,{'multi':_0x4bbce3}),await _0x4bbce3['exec'](),_0x28ae9c['length'];}async['acknowledgeMessages'](_0x16280f,_0x4a4245,_0x568759,_0x33301e){try{return _0x33301e?.['multi']?(_0x33301e['multi']['XACK'](_0x16280f,_0x4a4245,_0x568759),_0x33301e['multi']):await this['streamClient']['XACK'](_0x16280f,_0x4a4245,..._0x568759);}catch(_0x41fdf9){this['logger']['error']('Error\x20in\x20acknowledging\x20messages\x20in\x20group:\x20'+_0x4a4245+'\x20for\x20key:\x20'+_0x16280f,{'error':_0x41fdf9});throw _0x41fdf9;}}async['deleteMessages'](_0x1e5105,_0x4c1b10,_0x11e923,_0xea7e6a){try{return _0xea7e6a?.['multi']?(_0xea7e6a['multi']['xDel'](_0x1e5105,_0x11e923),_0xea7e6a['multi']):await this['streamClient']['XDEL'](_0x1e5105,..._0x11e923);}catch(_0x2277d1){this['logger']['error']('Error\x20in\x20deleting\x20messages\x20with\x20ids:\x20'+_0x11e923['join'](',')+'\x20for\x20key:\x20'+_0x1e5105,{'error':_0x2277d1});throw _0x2277d1;}}async['getPendingMessages'](_0x4c8302,_0x4ff0b0,_0x3216a5,_0x186a63){try{const _0x2f91a1='-',_0x16cbe6='+',_0x450d66=[_0x4c8302,_0x4ff0b0];if(_0x2f91a1)_0x450d66['push'](_0x2f91a1);if(_0x16cbe6)_0x450d66['push'](_0x16cbe6);if(_0x3216a5!==undefined)_0x450d66['push'](_0x3216a5['toString']());if(_0x186a63)_0x450d66['push'](_0x186a63);try{return await this['streamClient']['sendCommand'](['XPENDING',..._0x450d66]);}catch(_0x53c7ff){this['logger']['error']('error,\x20args',{..._0x53c7ff},_0x450d66);}}catch(_0x14dd87){this['logger']['error']('Error\x20retrieving\x20pending\x20messages\x20for\x20group:\x20'+_0x4ff0b0+'\x20in\x20key:\x20'+_0x4c8302,{..._0x14dd87});throw _0x14dd87;}}async['retryMessages'](_0x5b66d1,_0x4d8d5d,_0x55f7a4){let _0x50a5fc=[];const _0x4303a4=await this['getPendingMessages'](_0x5b66d1,_0x4d8d5d,_0x55f7a4?.['limit']);for(const _0x486028 of _0x4303a4){if(Array['isArray'](_0x486028)){const [_0x5a593d,,_0x688764,_0x6950fc]=_0x486028;if(_0x688764>_0x55f7a4?.['minIdleTime']){const _0x2dd54e=await this['claimMessage'](_0x5b66d1,_0x4d8d5d,_0x55f7a4?.['consumerName'],_0x55f7a4?.['minIdleTime'],_0x5a593d);_0x50a5fc=_0x50a5fc['concat'](_0x2dd54e);}}}return _0x50a5fc;}async['claimMessage'](_0x4208f1,_0x2a7a41,_0x33061a,_0x16a63f,_0x375020,..._0x4572b1){try{const _0x26641d=await this['streamClient']['sendCommand'](['XCLAIM',_0x4208f1,_0x2a7a41,_0x33061a,_0x16a63f['toString'](),_0x375020,..._0x4572b1]);return{'id':_0x26641d[0x0][0x0],'data':(0x0,utils_1['parseStreamMessage'])(_0x26641d[0x0][0x1][0x1])};}catch(_0x37d096){this['logger']['error']('Error\x20in\x20claiming\x20message\x20with\x20id:\x20'+_0x375020+'\x20in\x20group:\x20'+_0x2a7a41+'\x20for\x20key:\x20'+_0x4208f1,{..._0x37d096});throw _0x37d096;}}async['getStreamStats'](_0x310ff3){return{'messageCount':await this['getStreamDepth'](_0x310ff3)};}async['getStreamDepth'](_0x563979,_0x58c697){try{if(_0x58c697?.['multi'])return _0x58c697['multi']['XLEN'](_0x563979),0x0;const _0x33b0ea=await this['streamClient']['XLEN'](_0x563979);return _0x33b0ea;}catch(_0x3f341c){this['logger']['error']('Error\x20getting\x20depth\x20for\x20'+_0x563979,{'error':_0x3f341c});throw _0x3f341c;}}async['getStreamDepths'](_0x11070c){const _0x5229be=this['storeClient']['multi'](),_0x49df4d=new Map();_0x11070c['forEach'](_0x181756=>{!_0x49df4d['has'](_0x181756['stream'])&&(_0x49df4d['set'](_0x181756['stream'],-0x1),this['getStreamDepth'](_0x181756['stream'],{'multi':_0x5229be}));});const _0x378065=await _0x5229be['exec']();return Array['from'](_0x49df4d['keys']())['forEach']((_0x1fb2e9,_0x2c6384)=>{_0x49df4d['set'](_0x1fb2e9,_0x378065[_0x2c6384]);}),_0x11070c['map'](_0x1b1abc=>{return{'stream':_0x1b1abc['stream'],'depth':_0x49df4d['get'](_0x1b1abc['stream'])||0x0};});}async['trimStream'](_0x2f55a2,_0x1c5fb0){return 0x0;}['getProviderSpecificFeatures'](){return{'supportsBatching':!![],'supportsDeadLetterQueue':![],'supportsOrdering':!![],'supportsTrimming':!![],'supportsRetry':!![],'maxMessageSize':0x200*0x400*0x400,'maxBatchSize':0x3e8};}}exports['RedisStreamService']=RedisStreamService;
@@ -1 +1 @@
1
- 'use strict';function _0x4201(_0x2b36a8,_0x1c558e){var _0x15d2a1=_0x15d2();return _0x4201=function(_0x420136,_0x3fbad5){_0x420136=_0x420136-0x1c7;var _0x2e93c1=_0x15d2a1[_0x420136];return _0x2e93c1;},_0x4201(_0x2b36a8,_0x1c558e);}(function(_0x590f4a,_0xe00c4b){var _0xc6fceb=_0x4201,_0x202da7=_0x590f4a();while(!![]){try{var _0x2007f1=-parseInt(_0xc6fceb(0x1cd))/0x1+parseInt(_0xc6fceb(0x1c7))/0x2+parseInt(_0xc6fceb(0x1cb))/0x3+parseInt(_0xc6fceb(0x1cf))/0x4*(-parseInt(_0xc6fceb(0x1c8))/0x5)+parseInt(_0xc6fceb(0x1d0))/0x6*(parseInt(_0xc6fceb(0x1ce))/0x7)+-parseInt(_0xc6fceb(0x1cc))/0x8*(-parseInt(_0xc6fceb(0x1ca))/0x9)+parseInt(_0xc6fceb(0x1d1))/0xa*(-parseInt(_0xc6fceb(0x1c9))/0xb);if(_0x2007f1===_0xe00c4b)break;else _0x202da7['push'](_0x202da7['shift']());}catch(_0x30ffe6){_0x202da7['push'](_0x202da7['shift']());}}}(_0x15d2,0x6fece));Object['defineProperty'](exports,'__esModule',{'value':!![]});function _0x15d2(){var _0x5f443d=['10zrKfSr','948686ZBGuus','10880OWMEio','17633726YQAKui','7216983cLgfTj','1127997RIyWuV','8RjSuRV','278497cStNsj','442988HrJxdv','248rDiufn','78PapHcw'];_0x15d2=function(){return _0x5f443d;};return _0x15d2();}
1
+ 'use strict';(function(_0xd6c0a1,_0x5a85b0){var _0x4142a2=_0x23de,_0x244a9b=_0xd6c0a1();while(!![]){try{var _0x3126c6=parseInt(_0x4142a2(0x179))/0x1+parseInt(_0x4142a2(0x182))/0x2*(-parseInt(_0x4142a2(0x178))/0x3)+-parseInt(_0x4142a2(0x17b))/0x4*(parseInt(_0x4142a2(0x17e))/0x5)+-parseInt(_0x4142a2(0x17a))/0x6*(-parseInt(_0x4142a2(0x181))/0x7)+-parseInt(_0x4142a2(0x17d))/0x8*(-parseInt(_0x4142a2(0x17f))/0x9)+parseInt(_0x4142a2(0x17c))/0xa+parseInt(_0x4142a2(0x180))/0xb;if(_0x3126c6===_0x5a85b0)break;else _0x244a9b['push'](_0x244a9b['shift']());}catch(_0x44f1fe){_0x244a9b['push'](_0x244a9b['shift']());}}}(_0x3834,0x208c8));Object['defineProperty'](exports,'__esModule',{'value':!![]});function _0x23de(_0x4bb9d2,_0x502c6a){var _0x383475=_0x3834();return _0x23de=function(_0x23de41,_0x53e6d1){_0x23de41=_0x23de41-0x178;var _0x27769b=_0x383475[_0x23de41];return _0x27769b;},_0x23de(_0x4bb9d2,_0x502c6a);}function _0x3834(){var _0x3929c5=['7UyJfpa','30gbAAoZ','39099FvLffM','3189nTksaY','860250AXYZMs','2316ESBXQe','1010680diRAhT','2336GNUJvt','2020koJUOx','3069ZgpfYr','2370797BjbXhQ'];_0x3834=function(){return _0x3929c5;};return _0x3834();}
@@ -1,6 +1,6 @@
1
- import { SubService } from './index';
2
1
  import { ILogger } from '../logger';
3
2
  import { ProviderClient } from '../../types/provider';
3
+ import { SubService } from './index';
4
4
  declare class SubServiceFactory {
5
5
  static init(providerSubClient: ProviderClient, providerPubClient: ProviderClient, namespace: string, appId: string, engineId: string, logger: ILogger): Promise<SubService<ProviderClient>>;
6
6
  }
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SubServiceFactory = void 0;
4
- const ioredis_1 = require("./providers/redis/ioredis");
5
- const nats_1 = require("./providers/nats/nats");
6
- const postgres_1 = require("./providers/postgres/postgres");
7
- const redis_1 = require("./providers/redis/redis");
8
4
  const utils_1 = require("../../modules/utils");
5
+ const redis_1 = require("./providers/redis/redis");
6
+ const postgres_1 = require("./providers/postgres/postgres");
7
+ const nats_1 = require("./providers/nats/nats");
8
+ const ioredis_1 = require("./providers/redis/ioredis");
9
9
  class SubServiceFactory {
10
10
  static async init(providerSubClient, providerPubClient, namespace, appId, engineId, logger) {
11
11
  let service;
@@ -1 +1 @@
1
- 'use strict';(function(_0x3be30d,_0x4131d2){const _0x3ccdb9=_0x22c8,_0x374c3b=_0x3be30d();while(!![]){try{const _0x34e236=parseInt(_0x3ccdb9(0x109))/0x1*(parseInt(_0x3ccdb9(0x10c))/0x2)+parseInt(_0x3ccdb9(0x10e))/0x3*(-parseInt(_0x3ccdb9(0x108))/0x4)+-parseInt(_0x3ccdb9(0x107))/0x5+-parseInt(_0x3ccdb9(0x110))/0x6*(-parseInt(_0x3ccdb9(0x10b))/0x7)+-parseInt(_0x3ccdb9(0x106))/0x8+parseInt(_0x3ccdb9(0x10f))/0x9+-parseInt(_0x3ccdb9(0x10d))/0xa*(parseInt(_0x3ccdb9(0x10a))/0xb);if(_0x34e236===_0x4131d2)break;else _0x374c3b['push'](_0x374c3b['shift']());}catch(_0x1edaf5){_0x374c3b['push'](_0x374c3b['shift']());}}}(_0xd69f,0x5fc42));function _0xd69f(){const _0x5137ad=['1grsgms','341WNcRsY','7jynulf','1017158yrAgih','35540JTcJSO','1361733lJlwIb','6205860PaxcXB','3688998GDJnUp','4962728FbsVXm','1181340YSLGlc','4XEMPQt'];_0xd69f=function(){return _0x5137ad;};return _0xd69f();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['NatsSubService']=void 0x0;const key_1=require('../../../../modules/key'),index_1=require('../../index');class NatsSubService extends index_1['SubService']{constructor(_0x39e640,_0x56b902){super(_0x39e640,_0x56b902),this['subscriptions']=new Map();}async['init'](_0x20e966=key_1['HMNS'],_0x5a11b8,_0x403b7c,_0x1e0f30){this['namespace']=_0x20e966,this['logger']=_0x1e0f30,this['appId']=_0x5a11b8,this['engineId']=_0x403b7c;}['transact'](){return{};}['mintKey'](_0x149aea,_0x18f92b){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x149aea,_0x18f92b)['replace'](/:/g,'.')['replace'](/\.$/g,'.X');}async['subscribe'](_0x1a59bf,_0x179912,_0x41253e,_0x598512){const _0x812eb0=this['mintKey'](_0x1a59bf,{'appId':_0x41253e,'engineId':_0x598512}),_0x4bb72f=this['eventClient']['subscribe'](_0x812eb0);this['subscriptions']['set'](_0x812eb0,_0x4bb72f),this['logger']['debug']('nats-subscribe\x20'+_0x812eb0),(async()=>{for await(const _0x89096d of _0x4bb72f){try{const _0x4296f2=JSON['parse'](_0x89096d['data']['toString']());_0x179912(_0x812eb0,_0x4296f2);}catch(_0x17cacf){this['logger']['error']('nats-subscribe-message-parse-error:\x20'+_0x89096d['data']['toString'](),_0x17cacf);}}})()['catch'](_0x129635=>{this['logger']['error']('nats-subscribe-error\x20'+_0x812eb0,_0x129635);});}async['unsubscribe'](_0x2ded44,_0x1fe17f,_0x1c938f){const _0x2b1ac3=this['mintKey'](_0x2ded44,{'appId':_0x1fe17f,'engineId':_0x1c938f}),_0x586bfa=this['subscriptions']['get'](_0x2b1ac3);_0x586bfa?(_0x586bfa['unsubscribe'](),this['subscriptions']['delete'](_0x2b1ac3),this['logger']['debug']('nats-unsubscribe\x20'+_0x2b1ac3)):this['logger']['warn']('nats-unsubscribe-error\x20'+_0x2b1ac3);}async['psubscribe'](_0x2ed2f6,_0x5134d2,_0x563ad7,_0x41736){const _0x42dd85=this['mintKey'](_0x2ed2f6,{'appId':_0x563ad7,'engineId':_0x41736}),_0x4c16c6=this['eventClient']['subscribe'](_0x42dd85);this['subscriptions']['set'](_0x42dd85,_0x4c16c6),this['logger']['debug']('nats-psubscribe\x20'+_0x42dd85),(async()=>{for await(const _0x759688 of _0x4c16c6){try{const _0x626100=JSON['parse'](_0x759688['data']['toString']());_0x5134d2(_0x759688['subject'],_0x626100);}catch(_0x1b5c8f){this['logger']['error']('nats-parse-psubscription-message-error\x20'+_0x759688['data']['toString'](),_0x1b5c8f);}}})()['catch'](_0xe317b=>{this['logger']['error']('nats-pattern-psubscription-error\x20'+_0x42dd85,_0xe317b);});}async['punsubscribe'](_0x147faf,_0x3975e1,_0xc031dc){const _0x1e248e=this['mintKey'](_0x147faf,{'appId':_0x3975e1,'engineId':_0xc031dc}),_0x49e837=this['subscriptions']['get'](_0x1e248e);_0x49e837?(_0x49e837['unsubscribe'](),this['subscriptions']['delete'](_0x1e248e),this['logger']['debug']('nats-punsubscribe\x20'+_0x1e248e)):this['logger']['warn']('nats-punsubscribe-error\x20'+_0x1e248e);}async['publish'](_0x107dfe,_0x310efb,_0x4f068c,_0x305ed1){const _0x498962=this['mintKey'](_0x107dfe,{'appId':_0x4f068c,'engineId':_0x305ed1});try{return this['storeClient']['publish'](_0x498962,JSON['stringify'](_0x310efb)),this['logger']['debug']('nats-publish\x20'+_0x498962),!![];}catch(_0x343990){return this['logger']['error']('nats-publish-error\x20'+_0x498962,_0x343990),![];}}}function _0x22c8(_0x2f546f,_0x320b3d){const _0xd69fa0=_0xd69f();return _0x22c8=function(_0x22c84c,_0x14837b){_0x22c84c=_0x22c84c-0x106;let _0x431904=_0xd69fa0[_0x22c84c];return _0x431904;},_0x22c8(_0x2f546f,_0x320b3d);}exports['NatsSubService']=NatsSubService;
1
+ 'use strict';(function(_0x145a93,_0x5a91a5){const _0x16dbb1=_0xb4c2,_0x498ba3=_0x145a93();while(!![]){try{const _0x2012c4=-parseInt(_0x16dbb1(0x1df))/0x1+-parseInt(_0x16dbb1(0x1dc))/0x2*(parseInt(_0x16dbb1(0x1dd))/0x3)+parseInt(_0x16dbb1(0x1de))/0x4+-parseInt(_0x16dbb1(0x1e2))/0x5+-parseInt(_0x16dbb1(0x1e1))/0x6+parseInt(_0x16dbb1(0x1e0))/0x7+parseInt(_0x16dbb1(0x1db))/0x8;if(_0x2012c4===_0x5a91a5)break;else _0x498ba3['push'](_0x498ba3['shift']());}catch(_0x2f7190){_0x498ba3['push'](_0x498ba3['shift']());}}}(_0x49e6,0x3a504));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['NatsSubService']=void 0x0;const key_1=require('../../../../modules/key'),index_1=require('../../index');function _0xb4c2(_0x392d87,_0x2dd023){const _0x49e6a1=_0x49e6();return _0xb4c2=function(_0xb4c2a1,_0x26068a){_0xb4c2a1=_0xb4c2a1-0x1db;let _0x27015a=_0x49e6a1[_0xb4c2a1];return _0x27015a;},_0xb4c2(_0x392d87,_0x2dd023);}function _0x49e6(){const _0x3e688d=['1281308LZkmci','2436534nOLUFP','456640GNkiCg','8681392iJowAR','778426RuHURf','3GNKnhw','41792eCLSaA','153184HGxzkJ'];_0x49e6=function(){return _0x3e688d;};return _0x49e6();}class NatsSubService extends index_1['SubService']{constructor(_0x3886c9,_0x204620){super(_0x3886c9,_0x204620),this['subscriptions']=new Map();}async['init'](_0xd8b52b=key_1['HMNS'],_0x1effc3,_0x2363bc,_0x422a2e){this['namespace']=_0xd8b52b,this['logger']=_0x422a2e,this['appId']=_0x1effc3,this['engineId']=_0x2363bc;}['transact'](){return{};}['mintKey'](_0x2b806d,_0x4ae235){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x2b806d,_0x4ae235)['replace'](/:/g,'.')['replace'](/\.$/g,'.X');}async['subscribe'](_0x3e9e4e,_0x420397,_0x59291e,_0xb0cc50){const _0x4423ae=this['mintKey'](_0x3e9e4e,{'appId':_0x59291e,'engineId':_0xb0cc50}),_0x48e402=this['eventClient']['subscribe'](_0x4423ae);this['subscriptions']['set'](_0x4423ae,_0x48e402),this['logger']['debug']('nats-subscribe\x20'+_0x4423ae),(async()=>{for await(const _0x431fb6 of _0x48e402){try{const _0x7f4cee=JSON['parse'](_0x431fb6['data']['toString']());_0x420397(_0x4423ae,_0x7f4cee);}catch(_0x36a930){this['logger']['error']('nats-subscribe-message-parse-error:\x20'+_0x431fb6['data']['toString'](),_0x36a930);}}})()['catch'](_0x350acf=>{this['logger']['error']('nats-subscribe-error\x20'+_0x4423ae,_0x350acf);});}async['unsubscribe'](_0x4cb684,_0x5f29cf,_0x513694){const _0x5ce469=this['mintKey'](_0x4cb684,{'appId':_0x5f29cf,'engineId':_0x513694}),_0x5c6f46=this['subscriptions']['get'](_0x5ce469);_0x5c6f46?(_0x5c6f46['unsubscribe'](),this['subscriptions']['delete'](_0x5ce469),this['logger']['debug']('nats-unsubscribe\x20'+_0x5ce469)):this['logger']['warn']('nats-unsubscribe-error\x20'+_0x5ce469);}async['psubscribe'](_0xee320d,_0x5f9717,_0x2512f6,_0x257fd4){const _0x3ebb3b=this['mintKey'](_0xee320d,{'appId':_0x2512f6,'engineId':_0x257fd4}),_0x453cfa=this['eventClient']['subscribe'](_0x3ebb3b);this['subscriptions']['set'](_0x3ebb3b,_0x453cfa),this['logger']['debug']('nats-psubscribe\x20'+_0x3ebb3b),(async()=>{for await(const _0x3f8eed of _0x453cfa){try{const _0x36524d=JSON['parse'](_0x3f8eed['data']['toString']());_0x5f9717(_0x3f8eed['subject'],_0x36524d);}catch(_0xd00c13){this['logger']['error']('nats-parse-psubscription-message-error\x20'+_0x3f8eed['data']['toString'](),_0xd00c13);}}})()['catch'](_0x1bac14=>{this['logger']['error']('nats-pattern-psubscription-error\x20'+_0x3ebb3b,_0x1bac14);});}async['punsubscribe'](_0x1ac85a,_0x1c4cd9,_0x207566){const _0x2050a0=this['mintKey'](_0x1ac85a,{'appId':_0x1c4cd9,'engineId':_0x207566}),_0x3f1680=this['subscriptions']['get'](_0x2050a0);_0x3f1680?(_0x3f1680['unsubscribe'](),this['subscriptions']['delete'](_0x2050a0),this['logger']['debug']('nats-punsubscribe\x20'+_0x2050a0)):this['logger']['warn']('nats-punsubscribe-error\x20'+_0x2050a0);}async['publish'](_0x472380,_0x18f0ea,_0x118267,_0x3c9e89){const _0x26bc74=this['mintKey'](_0x472380,{'appId':_0x118267,'engineId':_0x3c9e89});try{return this['storeClient']['publish'](_0x26bc74,JSON['stringify'](_0x18f0ea)),this['logger']['debug']('nats-publish\x20'+_0x26bc74),!![];}catch(_0x479a3e){return this['logger']['error']('nats-publish-error\x20'+_0x26bc74,_0x479a3e),![];}}}exports['NatsSubService']=NatsSubService;
@@ -1 +1 @@
1
- 'use strict';(function(_0x2fa425,_0x1f5247){const _0x4b4def=_0x518a,_0x46cae5=_0x2fa425();while(!![]){try{const _0x5472c6=parseInt(_0x4b4def(0x1d7))/0x1*(-parseInt(_0x4b4def(0x1db))/0x2)+parseInt(_0x4b4def(0x1d9))/0x3*(parseInt(_0x4b4def(0x1d5))/0x4)+-parseInt(_0x4b4def(0x1dd))/0x5*(-parseInt(_0x4b4def(0x1da))/0x6)+-parseInt(_0x4b4def(0x1de))/0x7*(-parseInt(_0x4b4def(0x1d8))/0x8)+parseInt(_0x4b4def(0x1d4))/0x9*(-parseInt(_0x4b4def(0x1dc))/0xa)+-parseInt(_0x4b4def(0x1d6))/0xb+-parseInt(_0x4b4def(0x1df))/0xc;if(_0x5472c6===_0x1f5247)break;else _0x46cae5['push'](_0x46cae5['shift']());}catch(_0x4ff785){_0x46cae5['push'](_0x46cae5['shift']());}}}(_0x5005,0x89416));var __importDefault=this&&this['__importDefault']||function(_0x4aee3d){return _0x4aee3d&&_0x4aee3d['__esModule']?_0x4aee3d:{'default':_0x4aee3d};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['PostgresSubService']=void 0x0;function _0x5005(){const _0x420c24=['50740RZelRh','5199467trXhNI','4061136endUdR','9AWrLVD','2107484NAQOUL','3689554DvYiHw','663074UJrTWX','8oJLtim','6sJolQt','264zuJisP','2OjOzZI','3439210DWcBZS'];_0x5005=function(){return _0x420c24;};return _0x5005();}const crypto_1=__importDefault(require('crypto')),key_1=require('../../../../modules/key'),index_1=require('../../index');function _0x518a(_0x3a5e8d,_0x29cc51){const _0x5005cd=_0x5005();return _0x518a=function(_0x518ad6,_0x27370c){_0x518ad6=_0x518ad6-0x1d4;let _0xdc7a7b=_0x5005cd[_0x518ad6];return _0xdc7a7b;},_0x518a(_0x3a5e8d,_0x29cc51);}class PostgresSubService extends index_1['SubService']{constructor(_0x2b3e22,_0x2a1fef){super(_0x2b3e22,_0x2a1fef);}async['init'](_0x568c5b=key_1['HMNS'],_0x3d57a8,_0x2e7165,_0x206578){this['namespace']=_0x568c5b,this['logger']=_0x206578,this['appId']=_0x3d57a8,this['engineId']=_0x2e7165;}['transact'](){throw new Error('Transactions\x20are\x20not\x20supported\x20in\x20lightweight\x20pub/sub');}['mintKey'](_0xe4142a,_0x2702e9){if(!this['namespace'])throw new Error('Namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0xe4142a,_0x2702e9);}['mintSafeKey'](_0x90de91,_0xb4786f){const _0x1133b3=this['mintKey'](_0x90de91,_0xb4786f);if(_0x1133b3['length']<=0x3f)return[_0x1133b3,_0x1133b3];const {appId:appId='',engineId:engineId=''}=_0xb4786f,_0x419e5d=this['namespace']+':'+appId+':'+_0x90de91,_0x3e8b35=0x3f-_0x419e5d['length']-0x1,_0x41c80b=crypto_1['default']['createHash']('sha256')['update'](engineId)['digest']('hex')['substring'](0x0,_0x3e8b35),_0x5c720a=_0x419e5d+':'+_0x41c80b;return[_0x1133b3,_0x5c720a];}async['subscribe'](_0x41f708,_0x30f8cf,_0x2101c7,_0x5b8d19){const [_0x143a55,_0x2981a8]=this['mintSafeKey'](_0x41f708,{'appId':_0x2101c7,'engineId':_0x5b8d19});await this['eventClient']['query']('LISTEN\x20\x22'+_0x2981a8+'\x22'),this['logger']['debug']('postgres-subscribe',{'originalKey':_0x143a55,'safeKey':_0x2981a8}),this['eventClient']['on']('notification',_0xf2c4c6=>{if(_0xf2c4c6['channel']===_0x2981a8)try{const _0x4e3ff5=JSON['parse'](_0xf2c4c6['payload']||'{}');_0x30f8cf(_0x2981a8,_0x4e3ff5);}catch(_0x47d12d){this['logger']['error']('Error\x20parsing\x20message\x20for\x20topic\x20'+_0x2981a8+':',_0x47d12d);}});}async['unsubscribe'](_0x175f82,_0x2b8acb,_0x557591){const [_0x2ec0c1,_0xc53c15]=this['mintSafeKey'](_0x175f82,{'appId':_0x2b8acb,'engineId':_0x557591});await this['eventClient']['query']('UNLISTEN\x20\x22'+_0xc53c15+'\x22'),this['logger']['debug']('postgres-subscribe',{'originalKey':_0x2ec0c1,'safeKey':_0xc53c15});}async['publish'](_0x5f9d4c,_0x1f6bea,_0x5482b8,_0x203f1c){const [_0x3954fa,_0x45e68f]=this['mintSafeKey'](_0x5f9d4c,{'appId':_0x5482b8,'engineId':_0x203f1c}),_0x394b1c=JSON['stringify'](_0x1f6bea)['replace'](/'/g,'\x27\x27');return await this['storeClient']['query']('NOTIFY\x20\x22'+_0x45e68f+'\x22,\x20\x27'+_0x394b1c+'\x27'),this['logger']['debug']('postgres-publish',{'originalKey':_0x3954fa,'safeKey':_0x45e68f}),!![];}async['psubscribe'](){throw new Error('Pattern\x20subscriptions\x20are\x20not\x20supported\x20in\x20PostgreSQL');}async['punsubscribe'](){throw new Error('Pattern\x20subscriptions\x20are\x20not\x20supported\x20in\x20PostgreSQL');}}exports['PostgresSubService']=PostgresSubService;
1
+ 'use strict';function _0x5ac1(_0x1782b8,_0x2483ae){const _0x891ccf=_0x891c();return _0x5ac1=function(_0x5ac172,_0x5924ed){_0x5ac172=_0x5ac172-0x1d6;let _0x50259f=_0x891ccf[_0x5ac172];return _0x50259f;},_0x5ac1(_0x1782b8,_0x2483ae);}(function(_0x508a9,_0x5dd8cb){const _0x5883fc=_0x5ac1,_0x2e3e48=_0x508a9();while(!![]){try{const _0x4cd83f=-parseInt(_0x5883fc(0x1dd))/0x1*(-parseInt(_0x5883fc(0x1e0))/0x2)+parseInt(_0x5883fc(0x1d6))/0x3+parseInt(_0x5883fc(0x1df))/0x4+-parseInt(_0x5883fc(0x1db))/0x5+parseInt(_0x5883fc(0x1de))/0x6*(parseInt(_0x5883fc(0x1d8))/0x7)+-parseInt(_0x5883fc(0x1d9))/0x8*(-parseInt(_0x5883fc(0x1dc))/0x9)+-parseInt(_0x5883fc(0x1da))/0xa*(parseInt(_0x5883fc(0x1d7))/0xb);if(_0x4cd83f===_0x5dd8cb)break;else _0x2e3e48['push'](_0x2e3e48['shift']());}catch(_0x2b5443){_0x2e3e48['push'](_0x2e3e48['shift']());}}}(_0x891c,0xe94d8));function _0x891c(){const _0x3c0e0b=['2yKtaYe','4053966uzeipI','1620188vpuPDS','1301110LvfeeI','2967570dkbHXU','6515333AdjBII','7BDOYdH','2975304hlKtSY','50iFLDMs','2848120VqtusU','27zzvBoZ'];_0x891c=function(){return _0x3c0e0b;};return _0x891c();}var __importDefault=this&&this['__importDefault']||function(_0xa94b9){return _0xa94b9&&_0xa94b9['__esModule']?_0xa94b9:{'default':_0xa94b9};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['PostgresSubService']=void 0x0;const crypto_1=__importDefault(require('crypto')),key_1=require('../../../../modules/key'),index_1=require('../../index');class PostgresSubService extends index_1['SubService']{constructor(_0x304af0,_0x26c0e1){super(_0x304af0,_0x26c0e1);}async['init'](_0x47b156=key_1['HMNS'],_0x4a668e,_0x423061,_0x2b0c19){this['namespace']=_0x47b156,this['logger']=_0x2b0c19,this['appId']=_0x4a668e,this['engineId']=_0x423061;}['transact'](){throw new Error('Transactions\x20are\x20not\x20supported\x20in\x20lightweight\x20pub/sub');}['mintKey'](_0x668939,_0x1ff612){if(!this['namespace'])throw new Error('Namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x668939,_0x1ff612);}['mintSafeKey'](_0x274723,_0x27e26a){const _0x51a6a1=this['mintKey'](_0x274723,_0x27e26a);if(_0x51a6a1['length']<=0x3f)return[_0x51a6a1,_0x51a6a1];const {appId:appId='',engineId:engineId=''}=_0x27e26a,_0x56bb24=this['namespace']+':'+appId+':'+_0x274723,_0x5ad9c0=0x3f-_0x56bb24['length']-0x1,_0x3243fc=crypto_1['default']['createHash']('sha256')['update'](engineId)['digest']('hex')['substring'](0x0,_0x5ad9c0),_0x468b62=_0x56bb24+':'+_0x3243fc;return[_0x51a6a1,_0x468b62];}async['subscribe'](_0x46ccb2,_0x4f9d30,_0x37ee3c,_0x55807e){const [_0x5d2961,_0xc48529]=this['mintSafeKey'](_0x46ccb2,{'appId':_0x37ee3c,'engineId':_0x55807e});await this['eventClient']['query']('LISTEN\x20\x22'+_0xc48529+'\x22'),this['logger']['debug']('postgres-subscribe',{'originalKey':_0x5d2961,'safeKey':_0xc48529}),this['eventClient']['on']('notification',_0x567d12=>{if(_0x567d12['channel']===_0xc48529)try{const _0x3c6a6f=JSON['parse'](_0x567d12['payload']||'{}');_0x4f9d30(_0xc48529,_0x3c6a6f);}catch(_0xbf7e9e){this['logger']['error']('Error\x20parsing\x20message\x20for\x20topic\x20'+_0xc48529+':',_0xbf7e9e);}});}async['unsubscribe'](_0x37f3af,_0x19c93e,_0x4dbe08){const [_0x2dc05d,_0x327d67]=this['mintSafeKey'](_0x37f3af,{'appId':_0x19c93e,'engineId':_0x4dbe08});await this['eventClient']['query']('UNLISTEN\x20\x22'+_0x327d67+'\x22'),this['logger']['debug']('postgres-subscribe',{'originalKey':_0x2dc05d,'safeKey':_0x327d67});}async['publish'](_0x3f9917,_0x2f12ce,_0x1f9661,_0x22ba4a){const [_0x5f1fae,_0x3a94f9]=this['mintSafeKey'](_0x3f9917,{'appId':_0x1f9661,'engineId':_0x22ba4a}),_0x5d4a78=JSON['stringify'](_0x2f12ce)['replace'](/'/g,'\x27\x27');return await this['storeClient']['query']('NOTIFY\x20\x22'+_0x3a94f9+'\x22,\x20\x27'+_0x5d4a78+'\x27'),this['logger']['debug']('postgres-publish',{'originalKey':_0x5f1fae,'safeKey':_0x3a94f9}),!![];}async['psubscribe'](){throw new Error('Pattern\x20subscriptions\x20are\x20not\x20supported\x20in\x20PostgreSQL');}async['punsubscribe'](){throw new Error('Pattern\x20subscriptions\x20are\x20not\x20supported\x20in\x20PostgreSQL');}}exports['PostgresSubService']=PostgresSubService;
@@ -1 +1 @@
1
- 'use strict';(function(_0xad6e96,_0x22b5ec){const _0x44d47b=_0x37f0,_0x2df614=_0xad6e96();while(!![]){try{const _0x425cdf=parseInt(_0x44d47b(0x1e4))/0x1+parseInt(_0x44d47b(0x1e2))/0x2+parseInt(_0x44d47b(0x1e1))/0x3*(-parseInt(_0x44d47b(0x1e5))/0x4)+parseInt(_0x44d47b(0x1e3))/0x5+parseInt(_0x44d47b(0x1e7))/0x6+-parseInt(_0x44d47b(0x1e6))/0x7+-parseInt(_0x44d47b(0x1e8))/0x8*(parseInt(_0x44d47b(0x1e9))/0x9);if(_0x425cdf===_0x22b5ec)break;else _0x2df614['push'](_0x2df614['shift']());}catch(_0x3d73aa){_0x2df614['push'](_0x2df614['shift']());}}}(_0x3366,0xbe8c9));function _0x37f0(_0x2ebbee,_0x5ed9b4){const _0x336655=_0x3366();return _0x37f0=function(_0x37f066,_0x5d73a7){_0x37f066=_0x37f066-0x1e1;let _0xc8f358=_0x336655[_0x37f066];return _0xc8f358;},_0x37f0(_0x2ebbee,_0x5ed9b4);}function _0x3366(){const _0x22a12f=['1194228pGsezS','6256650ylPnKO','483582IztPrw','603068SnZkZM','1708973aQSBUp','2132118nIkaKw','989976hexOhO','99kecLqf','6otghkI'];_0x3366=function(){return _0x22a12f;};return _0x3366();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['IORedisSubService']=void 0x0;const key_1=require('../../../../modules/key'),index_1=require('../../index');class IORedisSubService extends index_1['SubService']{constructor(_0x5ddae9,_0x4b462d){super(_0x5ddae9,_0x4b462d);}async['init'](_0x41cebb=key_1['HMNS'],_0x32d9aa,_0x3f7db3,_0x4eb42e){this['namespace']=_0x41cebb,this['logger']=_0x4eb42e,this['appId']=_0x32d9aa,this['engineId']=_0x3f7db3;}['transact'](){return this['eventClient']['multi']();}['mintKey'](_0x2fec0e,_0x2fe469){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x2fec0e,_0x2fe469);}async['subscribe'](_0x512ac2,_0x10eca0,_0x1fee22,_0x168c36){const _0x133880=this,_0x413a32=this['mintKey'](_0x512ac2,{'appId':_0x1fee22,'engineId':_0x168c36});await this['eventClient']['subscribe'](_0x413a32,_0x475bea=>{_0x475bea&&_0x133880['logger']['error']('Error\x20subscribing\x20to:\x20'+_0x413a32,_0x475bea);}),this['eventClient']['on']('message',(_0x1ff4ec,_0xf4ed30)=>{if(_0x1ff4ec===_0x413a32)try{const _0x1eb408=JSON['parse'](_0xf4ed30);_0x10eca0(_0x413a32,_0x1eb408);}catch(_0x1743fe){_0x133880['logger']['error']('Error\x20parsing\x20message:\x20'+_0xf4ed30,_0x1743fe);}});}async['unsubscribe'](_0x229da1,_0x32f533,_0x5908ec){const _0x164910=this['mintKey'](_0x229da1,{'appId':_0x32f533,'engineId':_0x5908ec});await this['eventClient']['unsubscribe'](_0x164910);}async['psubscribe'](_0x725276,_0x5ad7e8,_0x31857b,_0x2595f8){const _0x2023e0=this,_0x3483b8=this['mintKey'](_0x725276,{'appId':_0x31857b,'engineId':_0x2595f8});await this['eventClient']['psubscribe'](_0x3483b8,_0x3e5130=>{_0x3e5130&&_0x2023e0['logger']['error']('Error\x20subscribing\x20to:\x20'+_0x3483b8,_0x3e5130);}),this['eventClient']['on']('pmessage',(_0x56e344,_0x522af9,_0x347510)=>{if(_0x56e344===_0x3483b8)try{const _0x4e243b=JSON['parse'](_0x347510);_0x5ad7e8(_0x522af9,_0x4e243b);}catch(_0x4c63db){_0x2023e0['logger']['error']('Error\x20parsing\x20message:\x20'+_0x347510,_0x4c63db);}});}async['punsubscribe'](_0x6b9df5,_0x292d38,_0x5cdc19){const _0x1ee9cf=this['mintKey'](_0x6b9df5,{'appId':_0x292d38,'engineId':_0x5cdc19});await this['eventClient']['punsubscribe'](_0x1ee9cf);}async['publish'](_0x26ea6e,_0xfe0869,_0x206b7b,_0x43bee2){const _0x10223f=this['mintKey'](_0x26ea6e,{'appId':_0x206b7b,'engineId':_0x43bee2}),_0x3dac95=await this['storeClient']['publish'](_0x10223f,JSON['stringify'](_0xfe0869));return _0x3dac95===0x1;}}exports['IORedisSubService']=IORedisSubService;
1
+ 'use strict';(function(_0x41e0f0,_0x268d68){const _0x17fdd1=_0x5c6b,_0x4e8344=_0x41e0f0();while(!![]){try{const _0x41a01b=parseInt(_0x17fdd1(0x104))/0x1+-parseInt(_0x17fdd1(0x101))/0x2+-parseInt(_0x17fdd1(0x108))/0x3+-parseInt(_0x17fdd1(0x107))/0x4+-parseInt(_0x17fdd1(0x106))/0x5+-parseInt(_0x17fdd1(0x105))/0x6*(parseInt(_0x17fdd1(0x103))/0x7)+parseInt(_0x17fdd1(0x102))/0x8;if(_0x41a01b===_0x268d68)break;else _0x4e8344['push'](_0x4e8344['shift']());}catch(_0x59c97c){_0x4e8344['push'](_0x4e8344['shift']());}}}(_0x5454,0xaee64));function _0x5c6b(_0x2cc99e,_0x26d8ce){const _0x545441=_0x5454();return _0x5c6b=function(_0x5c6b4f,_0x2d884e){_0x5c6b4f=_0x5c6b4f-0x101;let _0xfd8e74=_0x545441[_0x5c6b4f];return _0xfd8e74;},_0x5c6b(_0x2cc99e,_0x26d8ce);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['IORedisSubService']=void 0x0;const key_1=require('../../../../modules/key'),index_1=require('../../index');class IORedisSubService extends index_1['SubService']{constructor(_0x3c2038,_0x2bc767){super(_0x3c2038,_0x2bc767);}async['init'](_0x20da8d=key_1['HMNS'],_0x515019,_0x6c125d,_0x179cd6){this['namespace']=_0x20da8d,this['logger']=_0x179cd6,this['appId']=_0x515019,this['engineId']=_0x6c125d;}['transact'](){return this['eventClient']['multi']();}['mintKey'](_0x4e96d8,_0x144f65){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x4e96d8,_0x144f65);}async['subscribe'](_0x216d55,_0x382bd6,_0x21fa37,_0x5c6ae9){const _0x147bca=this,_0x43e5d5=this['mintKey'](_0x216d55,{'appId':_0x21fa37,'engineId':_0x5c6ae9});await this['eventClient']['subscribe'](_0x43e5d5,_0x54140b=>{_0x54140b&&_0x147bca['logger']['error']('Error\x20subscribing\x20to:\x20'+_0x43e5d5,_0x54140b);}),this['eventClient']['on']('message',(_0x35e4a7,_0x421a18)=>{if(_0x35e4a7===_0x43e5d5)try{const _0x5cd60b=JSON['parse'](_0x421a18);_0x382bd6(_0x43e5d5,_0x5cd60b);}catch(_0x194482){_0x147bca['logger']['error']('Error\x20parsing\x20message:\x20'+_0x421a18,_0x194482);}});}async['unsubscribe'](_0x2cebde,_0x54f706,_0x485f5c){const _0x43ec41=this['mintKey'](_0x2cebde,{'appId':_0x54f706,'engineId':_0x485f5c});await this['eventClient']['unsubscribe'](_0x43ec41);}async['psubscribe'](_0x107348,_0xc30858,_0x362a0c,_0x48fa76){const _0x2c3dee=this,_0x5b4900=this['mintKey'](_0x107348,{'appId':_0x362a0c,'engineId':_0x48fa76});await this['eventClient']['psubscribe'](_0x5b4900,_0x36d965=>{_0x36d965&&_0x2c3dee['logger']['error']('Error\x20subscribing\x20to:\x20'+_0x5b4900,_0x36d965);}),this['eventClient']['on']('pmessage',(_0x3f52d4,_0x56c3e7,_0x47b5a5)=>{if(_0x3f52d4===_0x5b4900)try{const _0x256135=JSON['parse'](_0x47b5a5);_0xc30858(_0x56c3e7,_0x256135);}catch(_0x337df9){_0x2c3dee['logger']['error']('Error\x20parsing\x20message:\x20'+_0x47b5a5,_0x337df9);}});}async['punsubscribe'](_0x579312,_0x43e9e1,_0x265503){const _0x415142=this['mintKey'](_0x579312,{'appId':_0x43e9e1,'engineId':_0x265503});await this['eventClient']['punsubscribe'](_0x415142);}async['publish'](_0x3208fc,_0x387dfa,_0x3aa59d,_0x1be95c){const _0xbc8556=this['mintKey'](_0x3208fc,{'appId':_0x3aa59d,'engineId':_0x1be95c}),_0x84fd59=await this['storeClient']['publish'](_0xbc8556,JSON['stringify'](_0x387dfa));return _0x84fd59===0x1;}}exports['IORedisSubService']=IORedisSubService;function _0x5454(){const _0x1eb61f=['564192NFKTFc','3325086vpaEfq','4879030QrTtde','5407684LaQtPL','3688527hRGzzj','2161536NxevVf','47188496kGWeAb','14NisEtC'];_0x5454=function(){return _0x1eb61f;};return _0x5454();}
@@ -1 +1 @@
1
- 'use strict';(function(_0x542ff7,_0x20d953){const _0x430bb5=_0x51a9,_0x308127=_0x542ff7();while(!![]){try{const _0x59d28f=-parseInt(_0x430bb5(0xd3))/0x1*(parseInt(_0x430bb5(0xd2))/0x2)+parseInt(_0x430bb5(0xcf))/0x3*(parseInt(_0x430bb5(0xd0))/0x4)+-parseInt(_0x430bb5(0xd1))/0x5+parseInt(_0x430bb5(0xd5))/0x6+parseInt(_0x430bb5(0xd4))/0x7+-parseInt(_0x430bb5(0xd6))/0x8+parseInt(_0x430bb5(0xd8))/0x9*(parseInt(_0x430bb5(0xd7))/0xa);if(_0x59d28f===_0x20d953)break;else _0x308127['push'](_0x308127['shift']());}catch(_0x229a4d){_0x308127['push'](_0x308127['shift']());}}}(_0x35f9,0x86eb8));function _0x35f9(){const _0x320224=['2624520kiOkRV','5879424rbNUNE','6522430ZZtvPw','9porFHx','3NAMGJT','1883188vOHTdL','1134315FntyHR','794nWGSaI','1709wPQYoK','4427052MNmopi'];_0x35f9=function(){return _0x320224;};return _0x35f9();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['RedisSubService']=void 0x0;const key_1=require('../../../../modules/key'),index_1=require('../../index');function _0x51a9(_0x4029de,_0x3491c4){const _0x35f998=_0x35f9();return _0x51a9=function(_0x51a9c5,_0x138e8e){_0x51a9c5=_0x51a9c5-0xcf;let _0x454cc2=_0x35f998[_0x51a9c5];return _0x454cc2;},_0x51a9(_0x4029de,_0x3491c4);}class RedisSubService extends index_1['SubService']{constructor(_0x2bd542,_0x30c933){super(_0x2bd542,_0x30c933);}async['init'](_0x41ad8b=key_1['HMNS'],_0x19cd75,_0x3c8e3a,_0x356d38){this['namespace']=_0x41ad8b,this['logger']=_0x356d38,this['appId']=_0x19cd75,this['engineId']=_0x3c8e3a;}['transact'](){const _0x291f44=this['eventClient']['multi']();return _0x291f44;}['mintKey'](_0x3b82bd,_0x30cf3f){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x3b82bd,_0x30cf3f);}async['subscribe'](_0x342742,_0xec1845,_0x45d1cd,_0x873b63){if(this['eventClient']){const _0x11d069=this,_0xe26417=this['mintKey'](_0x342742,{'appId':_0x45d1cd,'engineId':_0x873b63});await this['eventClient']['subscribe'](_0xe26417,_0x539eb9=>{try{const _0x4fd5f0=JSON['parse'](_0x539eb9);_0xec1845(_0xe26417,_0x4fd5f0);}catch(_0x4e6b8e){_0x11d069['logger']['error']('Error\x20parsing\x20message:\x20'+_0x539eb9,_0x4e6b8e);}});}}async['unsubscribe'](_0x3f47a1,_0x5c83ec,_0x343420){const _0x3e80f8=this['mintKey'](_0x3f47a1,{'appId':_0x5c83ec,'engineId':_0x343420});await this['eventClient']['unsubscribe'](_0x3e80f8);}async['psubscribe'](_0x2851fe,_0x173f32,_0x2112a4,_0x266928){if(this['eventClient']){const _0x3a7559=this,_0x2a9d35=this['mintKey'](_0x2851fe,{'appId':_0x2112a4,'engineId':_0x266928});await this['eventClient']['pSubscribe'](_0x2a9d35,(_0x9dd6ea,_0x57c281)=>{try{const _0x4a60bd=JSON['parse'](_0x9dd6ea);_0x173f32(_0x57c281,_0x4a60bd);}catch(_0x12be94){_0x3a7559['logger']['error']('Error\x20parsing\x20message:\x20'+_0x9dd6ea,_0x12be94);}});}}async['punsubscribe'](_0x39de67,_0x42f223,_0x58ebdc){const _0x172283=this['mintKey'](_0x39de67,{'appId':_0x42f223,'engineId':_0x58ebdc});await this['eventClient']['pUnsubscribe'](_0x172283);}async['publish'](_0x19cd9f,_0x24a428,_0x1b6ed1,_0x1151c6){const _0x3a309c=this['mintKey'](_0x19cd9f,{'appId':_0x1b6ed1,'engineId':_0x1151c6}),_0x43475a=await this['storeClient']['publish'](_0x3a309c,JSON['stringify'](_0x24a428));return _0x43475a>0x0;}}exports['RedisSubService']=RedisSubService;
1
+ 'use strict';(function(_0xdf617f,_0x4d3ef6){const _0x1c2941=_0x3e41,_0x17669d=_0xdf617f();while(!![]){try{const _0x42889b=-parseInt(_0x1c2941(0x65))/0x1+-parseInt(_0x1c2941(0x6d))/0x2+parseInt(_0x1c2941(0x69))/0x3*(parseInt(_0x1c2941(0x6f))/0x4)+-parseInt(_0x1c2941(0x64))/0x5*(-parseInt(_0x1c2941(0x68))/0x6)+parseInt(_0x1c2941(0x66))/0x7*(-parseInt(_0x1c2941(0x6b))/0x8)+parseInt(_0x1c2941(0x67))/0x9*(-parseInt(_0x1c2941(0x6a))/0xa)+-parseInt(_0x1c2941(0x6c))/0xb*(-parseInt(_0x1c2941(0x6e))/0xc);if(_0x42889b===_0x4d3ef6)break;else _0x17669d['push'](_0x17669d['shift']());}catch(_0x1874cf){_0x17669d['push'](_0x17669d['shift']());}}}(_0x1b78,0xd0e6a));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['RedisSubService']=void 0x0;function _0x3e41(_0x4c9946,_0x5d3446){const _0x1b784a=_0x1b78();return _0x3e41=function(_0x3e4164,_0x2a2a45){_0x3e4164=_0x3e4164-0x64;let _0x15da11=_0x1b784a[_0x3e4164];return _0x15da11;},_0x3e41(_0x4c9946,_0x5d3446);}const key_1=require('../../../../modules/key'),index_1=require('../../index');class RedisSubService extends index_1['SubService']{constructor(_0x2ba69e,_0x5e579b){super(_0x2ba69e,_0x5e579b);}async['init'](_0x715707=key_1['HMNS'],_0x1a4e39,_0x300414,_0x5f426d){this['namespace']=_0x715707,this['logger']=_0x5f426d,this['appId']=_0x1a4e39,this['engineId']=_0x300414;}['transact'](){const _0x48723d=this['eventClient']['multi']();return _0x48723d;}['mintKey'](_0x3279fd,_0x4cbaf8){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x3279fd,_0x4cbaf8);}async['subscribe'](_0x9bf346,_0xae817b,_0x3eb20c,_0x385ca4){if(this['eventClient']){const _0x3cbb3f=this,_0x527890=this['mintKey'](_0x9bf346,{'appId':_0x3eb20c,'engineId':_0x385ca4});await this['eventClient']['subscribe'](_0x527890,_0x4dd402=>{try{const _0x5d49e6=JSON['parse'](_0x4dd402);_0xae817b(_0x527890,_0x5d49e6);}catch(_0x7197ba){_0x3cbb3f['logger']['error']('Error\x20parsing\x20message:\x20'+_0x4dd402,_0x7197ba);}});}}async['unsubscribe'](_0x37e576,_0x913529,_0x2d41dd){const _0x26c2d7=this['mintKey'](_0x37e576,{'appId':_0x913529,'engineId':_0x2d41dd});await this['eventClient']['unsubscribe'](_0x26c2d7);}async['psubscribe'](_0x3fa5a2,_0xfccc31,_0x3ad74e,_0x3680c7){if(this['eventClient']){const _0x476ea6=this,_0x42ca5a=this['mintKey'](_0x3fa5a2,{'appId':_0x3ad74e,'engineId':_0x3680c7});await this['eventClient']['pSubscribe'](_0x42ca5a,(_0xd78541,_0x1385e1)=>{try{const _0x4bc63a=JSON['parse'](_0xd78541);_0xfccc31(_0x1385e1,_0x4bc63a);}catch(_0x109a0b){_0x476ea6['logger']['error']('Error\x20parsing\x20message:\x20'+_0xd78541,_0x109a0b);}});}}async['punsubscribe'](_0x533360,_0x166db8,_0x22d822){const _0x825b29=this['mintKey'](_0x533360,{'appId':_0x166db8,'engineId':_0x22d822});await this['eventClient']['pUnsubscribe'](_0x825b29);}async['publish'](_0x4bbecb,_0x5ef889,_0xd7ae69,_0x2eb73b){const _0x15a324=this['mintKey'](_0x4bbecb,{'appId':_0xd7ae69,'engineId':_0x2eb73b}),_0xed1bd2=await this['storeClient']['publish'](_0x15a324,JSON['stringify'](_0x5ef889));return _0xed1bd2>0x0;}}exports['RedisSubService']=RedisSubService;function _0x1b78(){const _0x290b6b=['887568dzesLS','23645568lhHYnu','36hefKTS','5mOFdHO','456533ckwZno','49LDBUds','27BCNWZN','893544PTVXqZ','330969QvjmUu','1164940Zcvqzr','1150672vXRWoa','11EhVNHt'];_0x1b78=function(){return _0x290b6b;};return _0x1b78();}
@@ -1 +1 @@
1
- 'use strict';(function(_0x3c7663,_0x182217){const _0x46290e=_0x3522,_0x49e3a1=_0x3c7663();while(!![]){try{const _0x431b7c=-parseInt(_0x46290e(0x19d))/0x1+parseInt(_0x46290e(0x19c))/0x2+-parseInt(_0x46290e(0x1a3))/0x3*(-parseInt(_0x46290e(0x1a1))/0x4)+-parseInt(_0x46290e(0x1a2))/0x5*(parseInt(_0x46290e(0x19e))/0x6)+parseInt(_0x46290e(0x19b))/0x7+-parseInt(_0x46290e(0x1a0))/0x8+parseInt(_0x46290e(0x19f))/0x9;if(_0x431b7c===_0x182217)break;else _0x49e3a1['push'](_0x49e3a1['shift']());}catch(_0x31cb62){_0x49e3a1['push'](_0x49e3a1['shift']());}}}(_0x3834,0xee221));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['TaskService']=void 0x0;function _0x3834(){const _0x427f2f=['6445120GiqZzD','421572SxoQNE','4199210ClqNcD','6xiwWel','3788701xcAyxT','1947148hamGYM','256301TTfmBj','6BgdBeJ','10364157JztIwe'];_0x3834=function(){return _0x427f2f;};return _0x3834();}function _0x3522(_0x15b4aa,_0x4d5a35){const _0x383400=_0x3834();return _0x3522=function(_0x35224a,_0x3559c8){_0x35224a=_0x35224a-0x19b;let _0x320e29=_0x383400[_0x35224a];return _0x320e29;},_0x3522(_0x15b4aa,_0x4d5a35);}const enums_1=require('../../modules/enums'),utils_1=require('../../modules/utils'),pipe_1=require('../pipe'),hotmesh_1=require('../../types/hotmesh'),key_1=require('../../modules/key');class TaskService{constructor(_0x1481fa,_0x592970){this['cleanupTimeout']=null,this['isScout']=![],this['errorCount']=0x0,this['logger']=_0x592970,this['store']=_0x1481fa;}async['processWebHooks'](_0xb33f59){const _0x35794e=await this['store']['getActiveTaskQueue']();if(_0x35794e){const [_0x137b2c,_0x4b5f93,_0x18a1f9,..._0x4d889b]=_0x35794e['split'](key_1['WEBSEP']),_0x1d52ea=JSON['parse'](_0x4d889b['join'](key_1['WEBSEP'])),_0x3dd9b0=_0x4b5f93+':processed',_0x21a9c8=await this['store']['processTaskQueue'](_0x4b5f93,_0x3dd9b0);_0x21a9c8?await _0xb33f59(_0x137b2c,{..._0x1d52ea,'id':_0x21a9c8}):await this['store']['deleteProcessedTaskQueue'](_0x35794e,_0x4b5f93,_0x3dd9b0,_0x18a1f9==='true'),setImmediate(()=>this['processWebHooks'](_0xb33f59));}}async['enqueueWorkItems'](_0x3f8c98){await this['store']['addTaskQueues'](_0x3f8c98);}async['registerJobForCleanup'](_0x592d65,_0x32fd98=enums_1['HMSH_EXPIRE_DURATION'],_0x26e471){_0x32fd98>0x0&&await this['store']['expireJob'](_0x592d65,_0x32fd98);}async['registerTimeHook'](_0x3570f4,_0x4c7587,_0x17103e,_0x214af6,_0x80c086=enums_1['HMSH_FIDELITY_SECONDS'],_0x237593,_0x20ecae){const _0x2e5c48=Date['now']()+_0x80c086*0x3e8,_0x230c4f=enums_1['HMSH_FIDELITY_SECONDS']*0x3e8,_0x3a6934=Math['floor'](_0x2e5c48/_0x230c4f)*_0x230c4f;await this['store']['registerTimeHook'](_0x3570f4,_0x4c7587,_0x17103e,_0x214af6,_0x3a6934,_0x237593,_0x20ecae);}async['shouldScout'](){const _0x661a60=this['isScout'],_0x1ca77b=_0x661a60||(this['isScout']=await this['store']['reserveScoutRole']('time'));if(_0x1ca77b)return!_0x661a60&&setTimeout(()=>{this['isScout']=![];},enums_1['HMSH_SCOUT_INTERVAL_SECONDS']*0x3e8),!![];return![];}async['processTimeHooks'](_0x3bcc36,_0x15cd42){if(await this['shouldScout']())try{const _0x308510=await this['store']['getNextTask'](_0x15cd42);if(Array['isArray'](_0x308510)){const [_0x2a1708,_0x3f00b4,_0x12689c,_0xd28596,_0x5cedf3]=_0x308510;if(_0x5cedf3==='child'){}else{if(_0x5cedf3==='delist'){const _0x30bab3=this['store']['mintKey'](hotmesh_1['KeyType']['SIGNALS'],{'appId':this['store']['appId']});await this['store']['delistSignalKey'](_0x30bab3,_0x3f00b4);}else await _0x3bcc36(_0x3f00b4,_0x12689c,_0xd28596,_0x5cedf3);}await(0x0,utils_1['sleepFor'])(0x0),this['errorCount']=0x0,this['processTimeHooks'](_0x3bcc36,_0x2a1708);}else{if(_0x308510)await(0x0,utils_1['sleepFor'])(0x0),this['errorCount']=0x0,this['processTimeHooks'](_0x3bcc36);else{const _0x5a0c79=(0x0,utils_1['XSleepFor'])(enums_1['HMSH_FIDELITY_SECONDS']*0x3e8);this['cleanupTimeout']=_0x5a0c79['timerId'],await _0x5a0c79['promise'],this['errorCount']=0x0,this['processTimeHooks'](_0x3bcc36);}}}catch(_0x2d06e7){this['logger']['warn']('task-process-timehooks-error',_0x2d06e7),await(0x0,utils_1['sleepFor'])(0x3e8*this['errorCount']++),this['errorCount']<0x5&&this['processTimeHooks'](_0x3bcc36);}else{const _0x4edc23=(0x0,utils_1['XSleepFor'])(enums_1['HMSH_SCOUT_INTERVAL_SECONDS']*0x3e8*0x2*Math['random']());this['cleanupTimeout']=_0x4edc23['timerId'],await _0x4edc23['promise'],this['processTimeHooks'](_0x3bcc36);}}['cancelCleanup'](){this['cleanupTimeout']!==undefined&&(clearTimeout(this['cleanupTimeout']),this['cleanupTimeout']=undefined);}async['getHookRule'](_0x4f9d8a){const _0x5d280f=await this['store']['getHookRules']();return _0x5d280f?.[_0x4f9d8a]?.[0x0];}async['registerWebHook'](_0x48e5f5,_0x26d26f,_0x167542,_0x5e32c1,_0x321430){const _0x472acc=await this['getHookRule'](_0x48e5f5);if(_0x472acc){const _0x162b60=_0x472acc['conditions']['match'][0x0]['expected'],_0x230771=pipe_1['Pipe']['resolve'](_0x162b60,_0x26d26f),_0x3c2988=_0x26d26f['metadata']['jid'],_0x368dbf=_0x26d26f['metadata']['gid'],_0x3d8e84=_0x472acc['to'],_0x43c148=[_0x3d8e84,_0x167542,_0x368dbf,_0x3c2988]['join'](key_1['WEBSEP']),_0x4a3179={'topic':_0x48e5f5,'resolved':_0x230771,'jobId':_0x43c148,'expire':_0x5e32c1};return await this['store']['setHookSignal'](_0x4a3179,_0x321430),_0x3c2988;}else throw new Error('signaler.registerWebHook:error:\x20hook\x20rule\x20not\x20found');}async['processWebHookSignal'](_0x399746,_0x4df58){const _0x10ff67=await this['getHookRule'](_0x399746);if(_0x10ff67){const _0x1c7e68={'$self':{'hook':{'data':_0x4df58}},'$hook':{'data':_0x4df58}},_0x2a3f55=_0x10ff67['conditions']['match'][0x0]['actual'],_0x16c474=pipe_1['Pipe']['resolve'](_0x2a3f55,_0x1c7e68),_0x3c3f48=await this['store']['getHookSignal'](_0x399746,_0x16c474);if(!_0x3c3f48)return undefined;const [_0x1654e6,_0x2ccd72,_0x39dac2,..._0x4dc0ce]=_0x3c3f48['split'](key_1['WEBSEP']);return[_0x4dc0ce['join'](key_1['WEBSEP']),_0x10ff67['to'],_0x2ccd72,_0x39dac2];}else throw new Error('signal-not-found');}async['deleteWebHookSignal'](_0xd631e6,_0x4e5570){const _0x23879a=await this['getHookRule'](_0xd631e6);if(_0x23879a){const _0xe9d6a6={'$self':{'hook':{'data':_0x4e5570}},'$hook':{'data':_0x4e5570}},_0x9b9d49=_0x23879a['conditions']['match'][0x0]['actual'],_0x1e543f=pipe_1['Pipe']['resolve'](_0x9b9d49,_0xe9d6a6);return await this['store']['deleteHookSignal'](_0xd631e6,_0x1e543f);}else throw new Error('signaler.process:error:\x20hook\x20rule\x20not\x20found');}}exports['TaskService']=TaskService;
1
+ 'use strict';(function(_0x123ccd,_0x49e5fc){const _0x28fef8=_0x1853,_0x1349ac=_0x123ccd();while(!![]){try{const _0x2b80b3=-parseInt(_0x28fef8(0x8f))/0x1*(parseInt(_0x28fef8(0x8d))/0x2)+-parseInt(_0x28fef8(0x90))/0x3+-parseInt(_0x28fef8(0x93))/0x4*(parseInt(_0x28fef8(0x8a))/0x5)+-parseInt(_0x28fef8(0x8c))/0x6*(parseInt(_0x28fef8(0x8b))/0x7)+-parseInt(_0x28fef8(0x91))/0x8+-parseInt(_0x28fef8(0x92))/0x9+parseInt(_0x28fef8(0x8e))/0xa;if(_0x2b80b3===_0x49e5fc)break;else _0x1349ac['push'](_0x1349ac['shift']());}catch(_0x11ecd7){_0x1349ac['push'](_0x1349ac['shift']());}}}(_0x464e,0x98c8d));function _0x1853(_0x4231af,_0x1368d1){const _0x464e81=_0x464e();return _0x1853=function(_0x18531c,_0x3c86f0){_0x18531c=_0x18531c-0x8a;let _0x5861bc=_0x464e81[_0x18531c];return _0x5861bc;},_0x1853(_0x4231af,_0x1368d1);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['TaskService']=void 0x0;function _0x464e(){const _0x24cbee=['949615JNjfKq','13188BQtxTG','3378hCVCOY','6gaWjZn','53866290TXrWjp','361901qRNvRU','2518599uXGmGO','6155104QYyzbD','503037LNjTmF','20eUGxzt'];_0x464e=function(){return _0x24cbee;};return _0x464e();}const enums_1=require('../../modules/enums'),utils_1=require('../../modules/utils'),pipe_1=require('../pipe'),hotmesh_1=require('../../types/hotmesh'),key_1=require('../../modules/key');class TaskService{constructor(_0x5d17bd,_0x381dec){this['cleanupTimeout']=null,this['isScout']=![],this['errorCount']=0x0,this['logger']=_0x381dec,this['store']=_0x5d17bd;}async['processWebHooks'](_0x1a5d70){const _0x554d12=await this['store']['getActiveTaskQueue']();if(_0x554d12){const [_0x49e2f8,_0x17aee9,_0x29827a,..._0x1b62ad]=_0x554d12['split'](key_1['WEBSEP']),_0xe3bed8=JSON['parse'](_0x1b62ad['join'](key_1['WEBSEP'])),_0x35da07=_0x17aee9+':processed',_0x230ad9=await this['store']['processTaskQueue'](_0x17aee9,_0x35da07);_0x230ad9?await _0x1a5d70(_0x49e2f8,{..._0xe3bed8,'id':_0x230ad9}):await this['store']['deleteProcessedTaskQueue'](_0x554d12,_0x17aee9,_0x35da07,_0x29827a==='true'),setImmediate(()=>this['processWebHooks'](_0x1a5d70));}}async['enqueueWorkItems'](_0x2fb068){await this['store']['addTaskQueues'](_0x2fb068);}async['registerJobForCleanup'](_0x503057,_0x30e739=enums_1['HMSH_EXPIRE_DURATION'],_0x42c6c3){_0x30e739>0x0&&await this['store']['expireJob'](_0x503057,_0x30e739);}async['registerTimeHook'](_0x1cf95b,_0x5ace21,_0x214de3,_0x126948,_0x5674a0=enums_1['HMSH_FIDELITY_SECONDS'],_0x297c31,_0x2ecd1a){const _0x5fb108=Date['now']()+_0x5674a0*0x3e8,_0x181d5d=enums_1['HMSH_FIDELITY_SECONDS']*0x3e8,_0xb925e9=Math['floor'](_0x5fb108/_0x181d5d)*_0x181d5d;await this['store']['registerTimeHook'](_0x1cf95b,_0x5ace21,_0x214de3,_0x126948,_0xb925e9,_0x297c31,_0x2ecd1a);}async['shouldScout'](){const _0x2a6a81=this['isScout'],_0x5568dd=_0x2a6a81||(this['isScout']=await this['store']['reserveScoutRole']('time'));if(_0x5568dd)return!_0x2a6a81&&setTimeout(()=>{this['isScout']=![];},enums_1['HMSH_SCOUT_INTERVAL_SECONDS']*0x3e8),!![];return![];}async['processTimeHooks'](_0x263c53,_0x4127c5){if(await this['shouldScout']())try{const _0x6068db=await this['store']['getNextTask'](_0x4127c5);if(Array['isArray'](_0x6068db)){const [_0x16f652,_0x2a8704,_0x244d3f,_0x5e23d,_0x314606]=_0x6068db;if(_0x314606==='child'){}else{if(_0x314606==='delist'){const _0x14a7bb=this['store']['mintKey'](hotmesh_1['KeyType']['SIGNALS'],{'appId':this['store']['appId']});await this['store']['delistSignalKey'](_0x14a7bb,_0x2a8704);}else await _0x263c53(_0x2a8704,_0x244d3f,_0x5e23d,_0x314606);}await(0x0,utils_1['sleepFor'])(0x0),this['errorCount']=0x0,this['processTimeHooks'](_0x263c53,_0x16f652);}else{if(_0x6068db)await(0x0,utils_1['sleepFor'])(0x0),this['errorCount']=0x0,this['processTimeHooks'](_0x263c53);else{const _0x54da34=(0x0,utils_1['XSleepFor'])(enums_1['HMSH_FIDELITY_SECONDS']*0x3e8);this['cleanupTimeout']=_0x54da34['timerId'],await _0x54da34['promise'],this['errorCount']=0x0,this['processTimeHooks'](_0x263c53);}}}catch(_0x1b026e){this['logger']['warn']('task-process-timehooks-error',_0x1b026e),await(0x0,utils_1['sleepFor'])(0x3e8*this['errorCount']++),this['errorCount']<0x5&&this['processTimeHooks'](_0x263c53);}else{const _0x2bda12=(0x0,utils_1['XSleepFor'])(enums_1['HMSH_SCOUT_INTERVAL_SECONDS']*0x3e8*0x2*Math['random']());this['cleanupTimeout']=_0x2bda12['timerId'],await _0x2bda12['promise'],this['processTimeHooks'](_0x263c53);}}['cancelCleanup'](){this['cleanupTimeout']!==undefined&&(clearTimeout(this['cleanupTimeout']),this['cleanupTimeout']=undefined);}async['getHookRule'](_0x3ef0cf){const _0x3b2691=await this['store']['getHookRules']();return _0x3b2691?.[_0x3ef0cf]?.[0x0];}async['registerWebHook'](_0x476ea6,_0x1c431f,_0x1312ed,_0x366fb7,_0x346a1d){const _0x4fb903=await this['getHookRule'](_0x476ea6);if(_0x4fb903){const _0x443913=_0x4fb903['conditions']['match'][0x0]['expected'],_0x2efa30=pipe_1['Pipe']['resolve'](_0x443913,_0x1c431f),_0x2880f4=_0x1c431f['metadata']['jid'],_0x5709e6=_0x1c431f['metadata']['gid'],_0x11ea74=_0x4fb903['to'],_0xcaba73=[_0x11ea74,_0x1312ed,_0x5709e6,_0x2880f4]['join'](key_1['WEBSEP']),_0xcf30cd={'topic':_0x476ea6,'resolved':_0x2efa30,'jobId':_0xcaba73,'expire':_0x366fb7};return await this['store']['setHookSignal'](_0xcf30cd,_0x346a1d),_0x2880f4;}else throw new Error('signaler.registerWebHook:error:\x20hook\x20rule\x20not\x20found');}async['processWebHookSignal'](_0x388809,_0x3c67e3){const _0x50a9bc=await this['getHookRule'](_0x388809);if(_0x50a9bc){const _0x1f9857={'$self':{'hook':{'data':_0x3c67e3}},'$hook':{'data':_0x3c67e3}},_0x5efa0f=_0x50a9bc['conditions']['match'][0x0]['actual'],_0x5e7ee2=pipe_1['Pipe']['resolve'](_0x5efa0f,_0x1f9857),_0x49efed=await this['store']['getHookSignal'](_0x388809,_0x5e7ee2);if(!_0x49efed)return undefined;const [_0xd7253c,_0x370939,_0x18475b,..._0x1d950e]=_0x49efed['split'](key_1['WEBSEP']);return[_0x1d950e['join'](key_1['WEBSEP']),_0x50a9bc['to'],_0x370939,_0x18475b];}else throw new Error('signal-not-found');}async['deleteWebHookSignal'](_0x7c5b3b,_0x57f4f8){const _0x48318b=await this['getHookRule'](_0x7c5b3b);if(_0x48318b){const _0x1b29ca={'$self':{'hook':{'data':_0x57f4f8}},'$hook':{'data':_0x57f4f8}},_0x40095e=_0x48318b['conditions']['match'][0x0]['actual'],_0x549495=pipe_1['Pipe']['resolve'](_0x40095e,_0x1b29ca);return await this['store']['deleteHookSignal'](_0x7c5b3b,_0x549495);}else throw new Error('signaler.process:error:\x20hook\x20rule\x20not\x20found');}}exports['TaskService']=TaskService;
@@ -1 +1 @@
1
- 'use strict';(function(_0x1fcfc6,_0x490116){const _0x3dd3e6=_0x1221,_0x39933c=_0x1fcfc6();while(!![]){try{const _0x59c3b0=parseInt(_0x3dd3e6(0x7a))/0x1*(parseInt(_0x3dd3e6(0x79))/0x2)+-parseInt(_0x3dd3e6(0x72))/0x3+-parseInt(_0x3dd3e6(0x74))/0x4*(-parseInt(_0x3dd3e6(0x73))/0x5)+parseInt(_0x3dd3e6(0x76))/0x6*(parseInt(_0x3dd3e6(0x78))/0x7)+-parseInt(_0x3dd3e6(0x7c))/0x8+-parseInt(_0x3dd3e6(0x75))/0x9+parseInt(_0x3dd3e6(0x77))/0xa*(-parseInt(_0x3dd3e6(0x7b))/0xb);if(_0x59c3b0===_0x490116)break;else _0x39933c['push'](_0x39933c['shift']());}catch(_0x36a39a){_0x39933c['push'](_0x39933c['shift']());}}}(_0x34bd,0xb31a4));function _0x1221(_0x4e52bb,_0x298fd6){const _0x34bdc6=_0x34bd();return _0x1221=function(_0x122131,_0x3c56b4){_0x122131=_0x122131-0x72;let _0x27c2b0=_0x34bdc6[_0x122131];return _0x27c2b0;},_0x1221(_0x4e52bb,_0x298fd6);}function _0x34bd(){const _0xd68f7e=['21EODGDQ','2azZdnB','260213yLEABm','135421IiLbky','1596480SFqTSu','1562826NpeXXm','125xGIoXi','156924cQXJnV','2901141gokysV','1440264aLnNBp','150FoOBkq'];_0x34bd=function(){return _0xd68f7e;};return _0x34bd();}var __importDefault=this&&this['__importDefault']||function(_0x33f008){return _0x33f008&&_0x33f008['__esModule']?_0x33f008:{'default':_0x33f008};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['TelemetryService']=void 0x0;const package_json_1=__importDefault(require('../../package.json')),mapper_1=require('../mapper'),stream_1=require('../../types/stream'),telemetry_1=require('../../types/telemetry'),utils_1=require('../../modules/utils');class TelemetryService{constructor(_0x168e21,_0x19dbab,_0x310361,_0x9b418e){this['leg']=0x1,this['appId']=_0x168e21,this['config']=_0x19dbab,this['metadata']=_0x310361,this['context']=_0x9b418e;}['getJobParentSpanId'](){return this['context']['metadata']['spn'];}['getActivityParentSpanId'](_0x10f635){return _0x10f635===0x1?this['context'][this['config']['parent']]['output']?.['metadata']?.['l2s']:this['context']['$self']['output']?.['metadata']?.['l1s'];}['getTraceId'](){return this['context']['metadata']['trc'];}['startJobSpan'](){const _0x2fbb22='JOB/'+this['appId']+'/'+this['config']['subscribes']+'/1',_0x4df786=this['getTraceId'](),_0x4b9c13=this['getJobParentSpanId'](),_0x502601=this['getSpanAttrs'](0x1),_0x3978d5=this['startSpan'](_0x4df786,_0x4b9c13,_0x2fbb22,_0x502601);return this['jobSpan']=_0x3978d5,this['setTelemetryContext'](_0x3978d5,0x1),this;}['startActivitySpan'](_0x5dd44d=this['leg']){const _0x5c510a=this['config']['type']['toUpperCase']()+'/'+this['appId']+'/'+this['metadata']['aid']+'/'+_0x5dd44d,_0x2c0fe9=this['getTraceId'](),_0x2c5451=this['getActivityParentSpanId'](_0x5dd44d),_0x132efb=this['getSpanAttrs'](_0x5dd44d),_0x262682=this['startSpan'](_0x2c0fe9,_0x2c5451,_0x5c510a,_0x132efb);return this['setTelemetryContext'](_0x262682,_0x5dd44d),this['span']=_0x262682,this;}['startStreamSpan'](_0x27d4bb,_0x1c256f){let _0xe1c51e;if(_0x1c256f===stream_1['StreamRole']['SYSTEM'])_0xe1c51e='SYSTEM';else{if(_0x1c256f===stream_1['StreamRole']['WORKER'])_0xe1c51e='EXECUTE';else _0x27d4bb['type']===stream_1['StreamDataType']['RESULT']||_0x27d4bb['type']===stream_1['StreamDataType']['RESPONSE']?_0xe1c51e='FANIN':_0xe1c51e='FANOUT';}const _0x4c4fd0=_0x27d4bb['metadata']['topic']?'/'+_0x27d4bb['metadata']['topic']:'',_0x1207eb=_0xe1c51e+'/'+this['appId']+'/'+_0x27d4bb['metadata']['aid']+_0x4c4fd0,_0x7f6e36=this['getStreamSpanAttrs'](_0x27d4bb),_0x31996d=this['startSpan'](_0x27d4bb['metadata']['trc'],_0x27d4bb['metadata']['spn'],_0x1207eb,_0x7f6e36);return this['span']=_0x31996d,this;}['startSpan'](_0x1c9e7b,_0x305e4e,_0x3b5c70,_0x1bfcf4){this['traceId']=_0x1c9e7b,this['spanId']=_0x305e4e;const _0x39258f=telemetry_1['trace']['getTracer'](package_json_1['default']['name'],package_json_1['default']['version']),_0x4426c7=this['getParentSpanContext'](),_0x397af4=_0x39258f['startSpan'](_0x3b5c70,{'kind':telemetry_1['SpanKind']['CLIENT'],'attributes':_0x1bfcf4,'root':!_0x4426c7},_0x4426c7);return _0x397af4;}['mapActivityAttributes'](){if(this['config']['telemetry']){const _0x2dc49b=new mapper_1['MapperService'](this['config']['telemetry'],this['context'])['mapRules'](),_0x55ce36={...Object['keys'](_0x2dc49b)['reduce']((_0x33b7dc,_0x57482f)=>{return['string','boolean','number']['includes'](typeof _0x2dc49b[_0x57482f])&&(_0x33b7dc['app.activity.data.'+_0x57482f]=_0x2dc49b[_0x57482f]),_0x33b7dc;},{})};this['span']?.['setAttributes'](_0x55ce36);}}['setActivityAttributes'](_0x10ef09){this['span']?.['setAttributes'](_0x10ef09);}['setStreamAttributes'](_0x2e982f){this['span']?.['setAttributes'](_0x2e982f);}['setJobAttributes'](_0x595dac){this['jobSpan']?.['setAttributes'](_0x595dac);}['endJobSpan'](){this['endSpan'](this['jobSpan']);}['endActivitySpan'](){this['endSpan'](this['span']);}['endStreamSpan'](){this['endSpan'](this['span']);}['endSpan'](_0x3a458c){_0x3a458c&&_0x3a458c['end']();}['getParentSpanContext'](){if(this['traceId']&&this['spanId']){const _0x1dfafe={'traceId':this['traceId'],'spanId':this['spanId'],'isRemote':!![],'traceFlags':0x1},_0x54dd7b=telemetry_1['trace']['setSpanContext'](telemetry_1['context']['active'](),_0x1dfafe);return _0x54dd7b;}}['getSpanAttrs'](_0x27cb69){return{...Object['keys'](this['context']['metadata'])['reduce']((_0x2bd9cf,_0x3f52f0)=>{return _0x3f52f0!=='trc'&&(_0x2bd9cf['app.job.'+_0x3f52f0]=this['context']['metadata'][_0x3f52f0]),_0x2bd9cf;},{}),...Object['keys'](this['metadata'])['reduce']((_0x40cb85,_0xe55ae9)=>{return _0x40cb85['app.activity.'+_0xe55ae9]=this['metadata'][_0xe55ae9],_0x40cb85;},{}),'app.activity.leg':_0x27cb69};}['getStreamSpanAttrs'](_0xf3ec57){return{...Object['keys'](_0xf3ec57['metadata'])['reduce']((_0x25f803,_0x1574ef)=>{return _0x1574ef!=='trc'&&_0x1574ef!=='spn'&&(_0x25f803['app.stream.'+_0x1574ef]=_0xf3ec57['metadata'][_0x1574ef]),_0x25f803;},{})};}['setTelemetryContext'](_0x44e56c,_0x5838a6){!this['context']['metadata']['trc']&&(this['context']['metadata']['trc']=_0x44e56c['spanContext']()['traceId']),_0x5838a6===0x1?(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l1s']=_0x44e56c['spanContext']()['spanId']):(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l2s']=_0x44e56c['spanContext']()['spanId']);}['setActivityError'](_0xca79ed){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0xca79ed});}['setStreamError'](_0x1659ff){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0x1659ff});}static['addTargetTelemetryPaths'](_0xc497bc,_0x51fb42,_0x33ffd6,_0x4eaa2b){_0x4eaa2b===0x1?(!(_0x51fb42['parent']in _0xc497bc)&&(_0xc497bc[_0x51fb42['parent']]=[]),_0xc497bc[_0x51fb42['parent']]['push'](_0x51fb42['parent']+'/output/metadata/l2s')):(!(_0x33ffd6['aid']in _0xc497bc)&&(_0xc497bc[_0x33ffd6['aid']]=[]),_0xc497bc[_0x33ffd6['aid']]['push'](_0x33ffd6['aid']+'/output/metadata/l1s'));}static['bindJobTelemetryToState'](_0xf04904,_0x72cfd5,_0x386a84){_0x72cfd5['type']==='trigger'&&(_0xf04904['metadata/trc']=_0x386a84['metadata']['trc']);}static['bindActivityTelemetryToState'](_0x3e5c6c,_0x310511,_0x97cada,_0x290f87,_0x3c44c6){if(_0x310511['type']==='trigger')_0x3e5c6c[_0x97cada['aid']+'/output/metadata/l1s']=_0x290f87['$self']['output']['metadata']['l1s'],_0x3e5c6c[_0x97cada['aid']+'/output/metadata/l2s']=_0x290f87['$self']['output']['metadata']['l2s'];else{if(utils_1['polyfill']['resolveActivityType'](_0x310511['type'])==='hook'&&_0x3c44c6===0x1)_0x3e5c6c[_0x97cada['aid']+'/output/metadata/l1s']=_0x290f87['$self']['output']['metadata']['l1s'],_0x3e5c6c[_0x97cada['aid']+'/output/metadata/l2s']=_0x290f87['$self']['output']['metadata']['l1s'];else{if(_0x310511['type']==='signal'&&_0x3c44c6===0x1)_0x3e5c6c[_0x97cada['aid']+'/output/metadata/l1s']=_0x290f87['$self']['output']['metadata']['l1s'],_0x3e5c6c[_0x97cada['aid']+'/output/metadata/l2s']=_0x290f87['$self']['output']['metadata']['l1s'];else{const _0x447ad4='l'+_0x3c44c6+'s';_0x3e5c6c[_0x97cada['aid']+'/output/metadata/'+_0x447ad4]=_0x290f87['$self']['output']['metadata'][_0x447ad4];}}}}}exports['TelemetryService']=TelemetryService;
1
+ 'use strict';(function(_0x419b26,_0x11a254){const _0x442b00=_0x23e3,_0x39073b=_0x419b26();while(!![]){try{const _0x4691c5=parseInt(_0x442b00(0x104))/0x1+parseInt(_0x442b00(0x103))/0x2*(parseInt(_0x442b00(0xfe))/0x3)+-parseInt(_0x442b00(0x102))/0x4+-parseInt(_0x442b00(0x100))/0x5+parseInt(_0x442b00(0xfd))/0x6+-parseInt(_0x442b00(0xff))/0x7*(-parseInt(_0x442b00(0x105))/0x8)+-parseInt(_0x442b00(0x101))/0x9;if(_0x4691c5===_0x11a254)break;else _0x39073b['push'](_0x39073b['shift']());}catch(_0x4e9322){_0x39073b['push'](_0x39073b['shift']());}}}(_0x426b,0xae252));function _0x426b(){const _0x2b669f=['24PhbxiO','1012368rlnFgs','54WinGGC','2947553Wtlxjc','1911065IbyQyn','10928106JbJLDQ','166036CIbeVN','92186DkSorW','89615Wubjdl'];_0x426b=function(){return _0x2b669f;};return _0x426b();}var __importDefault=this&&this['__importDefault']||function(_0x14624c){return _0x14624c&&_0x14624c['__esModule']?_0x14624c:{'default':_0x14624c};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['TelemetryService']=void 0x0;function _0x23e3(_0x416c18,_0x3ce63d){const _0x426b4e=_0x426b();return _0x23e3=function(_0x23e357,_0x18b174){_0x23e357=_0x23e357-0xfd;let _0x1b8f8e=_0x426b4e[_0x23e357];return _0x1b8f8e;},_0x23e3(_0x416c18,_0x3ce63d);}const package_json_1=__importDefault(require('../../package.json')),mapper_1=require('../mapper'),stream_1=require('../../types/stream'),telemetry_1=require('../../types/telemetry'),utils_1=require('../../modules/utils');class TelemetryService{constructor(_0x546c6a,_0x14073c,_0x2e9c51,_0x51e047){this['leg']=0x1,this['appId']=_0x546c6a,this['config']=_0x14073c,this['metadata']=_0x2e9c51,this['context']=_0x51e047;}['getJobParentSpanId'](){return this['context']['metadata']['spn'];}['getActivityParentSpanId'](_0x42b09a){return _0x42b09a===0x1?this['context'][this['config']['parent']]['output']?.['metadata']?.['l2s']:this['context']['$self']['output']?.['metadata']?.['l1s'];}['getTraceId'](){return this['context']['metadata']['trc'];}['startJobSpan'](){const _0x509bdf='JOB/'+this['appId']+'/'+this['config']['subscribes']+'/1',_0x27a9b4=this['getTraceId'](),_0x14b11e=this['getJobParentSpanId'](),_0x385249=this['getSpanAttrs'](0x1),_0x137603=this['startSpan'](_0x27a9b4,_0x14b11e,_0x509bdf,_0x385249);return this['jobSpan']=_0x137603,this['setTelemetryContext'](_0x137603,0x1),this;}['startActivitySpan'](_0xe3960f=this['leg']){const _0x573f3d=this['config']['type']['toUpperCase']()+'/'+this['appId']+'/'+this['metadata']['aid']+'/'+_0xe3960f,_0x36df4d=this['getTraceId'](),_0x5723c3=this['getActivityParentSpanId'](_0xe3960f),_0x22ee01=this['getSpanAttrs'](_0xe3960f),_0x59291b=this['startSpan'](_0x36df4d,_0x5723c3,_0x573f3d,_0x22ee01);return this['setTelemetryContext'](_0x59291b,_0xe3960f),this['span']=_0x59291b,this;}['startStreamSpan'](_0x39b659,_0x49a843){let _0x505ebc;if(_0x49a843===stream_1['StreamRole']['SYSTEM'])_0x505ebc='SYSTEM';else{if(_0x49a843===stream_1['StreamRole']['WORKER'])_0x505ebc='EXECUTE';else _0x39b659['type']===stream_1['StreamDataType']['RESULT']||_0x39b659['type']===stream_1['StreamDataType']['RESPONSE']?_0x505ebc='FANIN':_0x505ebc='FANOUT';}const _0x3b1929=_0x39b659['metadata']['topic']?'/'+_0x39b659['metadata']['topic']:'',_0x5021c8=_0x505ebc+'/'+this['appId']+'/'+_0x39b659['metadata']['aid']+_0x3b1929,_0x4c7c40=this['getStreamSpanAttrs'](_0x39b659),_0x504df6=this['startSpan'](_0x39b659['metadata']['trc'],_0x39b659['metadata']['spn'],_0x5021c8,_0x4c7c40);return this['span']=_0x504df6,this;}['startSpan'](_0x33b3a4,_0x311cab,_0x38b6d1,_0x557df1){this['traceId']=_0x33b3a4,this['spanId']=_0x311cab;const _0x1d5b31=telemetry_1['trace']['getTracer'](package_json_1['default']['name'],package_json_1['default']['version']),_0x448b6b=this['getParentSpanContext'](),_0x57026a=_0x1d5b31['startSpan'](_0x38b6d1,{'kind':telemetry_1['SpanKind']['CLIENT'],'attributes':_0x557df1,'root':!_0x448b6b},_0x448b6b);return _0x57026a;}['mapActivityAttributes'](){if(this['config']['telemetry']){const _0x4d1cb1=new mapper_1['MapperService'](this['config']['telemetry'],this['context'])['mapRules'](),_0x10f2e6={...Object['keys'](_0x4d1cb1)['reduce']((_0x1fefa4,_0x489ec1)=>{return['string','boolean','number']['includes'](typeof _0x4d1cb1[_0x489ec1])&&(_0x1fefa4['app.activity.data.'+_0x489ec1]=_0x4d1cb1[_0x489ec1]),_0x1fefa4;},{})};this['span']?.['setAttributes'](_0x10f2e6);}}['setActivityAttributes'](_0x41576f){this['span']?.['setAttributes'](_0x41576f);}['setStreamAttributes'](_0x466056){this['span']?.['setAttributes'](_0x466056);}['setJobAttributes'](_0x170273){this['jobSpan']?.['setAttributes'](_0x170273);}['endJobSpan'](){this['endSpan'](this['jobSpan']);}['endActivitySpan'](){this['endSpan'](this['span']);}['endStreamSpan'](){this['endSpan'](this['span']);}['endSpan'](_0x17297e){_0x17297e&&_0x17297e['end']();}['getParentSpanContext'](){if(this['traceId']&&this['spanId']){const _0x572ae1={'traceId':this['traceId'],'spanId':this['spanId'],'isRemote':!![],'traceFlags':0x1},_0xd1c707=telemetry_1['trace']['setSpanContext'](telemetry_1['context']['active'](),_0x572ae1);return _0xd1c707;}}['getSpanAttrs'](_0x50572b){return{...Object['keys'](this['context']['metadata'])['reduce']((_0x13d841,_0x47961d)=>{return _0x47961d!=='trc'&&(_0x13d841['app.job.'+_0x47961d]=this['context']['metadata'][_0x47961d]),_0x13d841;},{}),...Object['keys'](this['metadata'])['reduce']((_0x59a203,_0x14495c)=>{return _0x59a203['app.activity.'+_0x14495c]=this['metadata'][_0x14495c],_0x59a203;},{}),'app.activity.leg':_0x50572b};}['getStreamSpanAttrs'](_0x317146){return{...Object['keys'](_0x317146['metadata'])['reduce']((_0x51aeb9,_0xbadd96)=>{return _0xbadd96!=='trc'&&_0xbadd96!=='spn'&&(_0x51aeb9['app.stream.'+_0xbadd96]=_0x317146['metadata'][_0xbadd96]),_0x51aeb9;},{})};}['setTelemetryContext'](_0x508c10,_0x116c19){!this['context']['metadata']['trc']&&(this['context']['metadata']['trc']=_0x508c10['spanContext']()['traceId']),_0x116c19===0x1?(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l1s']=_0x508c10['spanContext']()['spanId']):(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l2s']=_0x508c10['spanContext']()['spanId']);}['setActivityError'](_0x998985){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0x998985});}['setStreamError'](_0x3073c5){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0x3073c5});}static['addTargetTelemetryPaths'](_0x5cbc5c,_0xae9246,_0x4339ca,_0x2d8358){_0x2d8358===0x1?(!(_0xae9246['parent']in _0x5cbc5c)&&(_0x5cbc5c[_0xae9246['parent']]=[]),_0x5cbc5c[_0xae9246['parent']]['push'](_0xae9246['parent']+'/output/metadata/l2s')):(!(_0x4339ca['aid']in _0x5cbc5c)&&(_0x5cbc5c[_0x4339ca['aid']]=[]),_0x5cbc5c[_0x4339ca['aid']]['push'](_0x4339ca['aid']+'/output/metadata/l1s'));}static['bindJobTelemetryToState'](_0x36d639,_0x50147a,_0x5c56ce){_0x50147a['type']==='trigger'&&(_0x36d639['metadata/trc']=_0x5c56ce['metadata']['trc']);}static['bindActivityTelemetryToState'](_0x3f7abf,_0x26b753,_0x3e5d29,_0x118bc8,_0x3d257a){if(_0x26b753['type']==='trigger')_0x3f7abf[_0x3e5d29['aid']+'/output/metadata/l1s']=_0x118bc8['$self']['output']['metadata']['l1s'],_0x3f7abf[_0x3e5d29['aid']+'/output/metadata/l2s']=_0x118bc8['$self']['output']['metadata']['l2s'];else{if(utils_1['polyfill']['resolveActivityType'](_0x26b753['type'])==='hook'&&_0x3d257a===0x1)_0x3f7abf[_0x3e5d29['aid']+'/output/metadata/l1s']=_0x118bc8['$self']['output']['metadata']['l1s'],_0x3f7abf[_0x3e5d29['aid']+'/output/metadata/l2s']=_0x118bc8['$self']['output']['metadata']['l1s'];else{if(_0x26b753['type']==='signal'&&_0x3d257a===0x1)_0x3f7abf[_0x3e5d29['aid']+'/output/metadata/l1s']=_0x118bc8['$self']['output']['metadata']['l1s'],_0x3f7abf[_0x3e5d29['aid']+'/output/metadata/l2s']=_0x118bc8['$self']['output']['metadata']['l1s'];else{const _0xb026a='l'+_0x3d257a+'s';_0x3f7abf[_0x3e5d29['aid']+'/output/metadata/'+_0xb026a]=_0x118bc8['$self']['output']['metadata'][_0xb026a];}}}}}exports['TelemetryService']=TelemetryService;
@@ -1 +1 @@
1
- 'use strict';(function(_0x35759a,_0x35b906){const _0x4d678a=_0x42cc,_0x18c1db=_0x35759a();while(!![]){try{const _0x4f8036=parseInt(_0x4d678a(0x18d))/0x1+-parseInt(_0x4d678a(0x192))/0x2*(parseInt(_0x4d678a(0x193))/0x3)+-parseInt(_0x4d678a(0x18c))/0x4+-parseInt(_0x4d678a(0x195))/0x5+-parseInt(_0x4d678a(0x191))/0x6*(-parseInt(_0x4d678a(0x190))/0x7)+parseInt(_0x4d678a(0x194))/0x8*(parseInt(_0x4d678a(0x18e))/0x9)+parseInt(_0x4d678a(0x18f))/0xa;if(_0x4f8036===_0x35b906)break;else _0x18c1db['push'](_0x18c1db['shift']());}catch(_0x50080a){_0x18c1db['push'](_0x18c1db['shift']());}}}(_0x1672,0xda838));function _0x42cc(_0x329fa5,_0x5cb34b){const _0x167285=_0x1672();return _0x42cc=function(_0x42cc99,_0x56063b){_0x42cc99=_0x42cc99-0x18c;let _0x4d9bc2=_0x167285[_0x42cc99];return _0x4d9bc2;},_0x42cc(_0x329fa5,_0x5cb34b);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['WorkerService']=void 0x0;function _0x1672(){const _0x5e74bc=['11327589lFvhsy','10844130Izmbby','7lbxQRi','6516546YAOtgv','124476QwqafJ','30XUxjRp','8Xxspep','7615090BJvhfX','2608048xRiifc','263317OBljJC'];_0x1672=function(){return _0x5e74bc;};return _0x1672();}const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),factory_1=require('../connector/factory'),router_1=require('../router'),stream_1=require('../../types/stream'),enums_1=require('../../modules/enums'),factory_2=require('../stream/factory'),factory_3=require('../sub/factory'),factory_4=require('../store/factory');class WorkerService{constructor(){this['reporting']=![];}static async['init'](_0x207e12,_0x11f358,_0x1abdb6,_0x47ae9a,_0x1ad3e7){const _0x20c773=[];if(Array['isArray'](_0x47ae9a['workers']))for(const _0x4bf65e of _0x47ae9a['workers']){await factory_1['ConnectorService']['initClients'](_0x4bf65e);const _0x18b6c8=new WorkerService();_0x18b6c8['verifyWorkerFields'](_0x4bf65e),_0x18b6c8['namespace']=_0x207e12,_0x18b6c8['appId']=_0x11f358,_0x18b6c8['guid']=_0x1abdb6,_0x18b6c8['callback']=_0x4bf65e['callback'],_0x18b6c8['topic']=_0x4bf65e['topic'],_0x18b6c8['config']=_0x47ae9a,_0x18b6c8['logger']=_0x1ad3e7,await _0x18b6c8['initStoreChannel'](_0x18b6c8,_0x4bf65e['store']),await _0x18b6c8['initSubChannel'](_0x18b6c8,_0x4bf65e['sub'],_0x4bf65e['pub']??_0x4bf65e['store']),await _0x18b6c8['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x18b6c8['subscriptionHandler'](),_0x11f358),await _0x18b6c8['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x18b6c8['subscriptionHandler'](),_0x11f358,_0x18b6c8['topic']),await _0x18b6c8['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x18b6c8['subscriptionHandler'](),_0x11f358,_0x18b6c8['guid']),await _0x18b6c8['initStreamChannel'](_0x18b6c8,_0x4bf65e['stream'],_0x4bf65e['store']),_0x18b6c8['router']=await _0x18b6c8['initRouter'](_0x4bf65e,_0x1ad3e7);const _0x2782ee=_0x18b6c8['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x18b6c8['appId'],'topic':_0x4bf65e['topic']});await _0x18b6c8['router']['consumeMessages'](_0x2782ee,'WORKER',_0x18b6c8['guid'],_0x4bf65e['callback']),_0x18b6c8['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x20c773['push'](_0x18b6c8);}return _0x20c773;}['verifyWorkerFields'](_0x2667dc){if(!(0x0,utils_1['identifyProvider'])(_0x2667dc['store'])||!(0x0,utils_1['identifyProvider'])(_0x2667dc['stream'])||!(0x0,utils_1['identifyProvider'])(_0x2667dc['sub'])||!(_0x2667dc['topic']&&_0x2667dc['callback']))throw new Error('worker\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields\x20along\x20with\x20a\x20callback\x20function\x20and\x20topic.');}async['initStoreChannel'](_0x1cb472,_0x379565){_0x1cb472['store']=await factory_4['StoreServiceFactory']['init'](_0x379565,_0x1cb472['namespace'],_0x1cb472['appId'],_0x1cb472['logger']);}async['initSubChannel'](_0x308a0c,_0x3133a3,_0x44474e){_0x308a0c['subscribe']=await factory_3['SubServiceFactory']['init'](_0x3133a3,_0x44474e,_0x308a0c['namespace'],_0x308a0c['appId'],_0x308a0c['guid'],_0x308a0c['logger']);}async['initStreamChannel'](_0x3cda58,_0x445cd6,_0x4ede8f){_0x3cda58['stream']=await factory_2['StreamServiceFactory']['init'](_0x445cd6,_0x4ede8f,_0x3cda58['namespace'],_0x3cda58['appId'],_0x3cda58['logger']);}async['initRouter'](_0x1b6c7a,_0x320555){const _0x3c0cba=await this['store']['getThrottleRate'](_0x1b6c7a['topic']);return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['WORKER'],'topic':_0x1b6c7a['topic'],'reclaimDelay':_0x1b6c7a['reclaimDelay'],'reclaimCount':_0x1b6c7a['reclaimCount'],'throttle':_0x3c0cba},this['stream'],_0x320555);}['subscriptionHandler'](){const _0x8cc430=this;return async(_0x104302,_0x25167c)=>{_0x8cc430['logger']['debug']('worker-event-received',{'topic':_0x104302,'type':_0x25167c['type']});if(_0x25167c['type']==='throttle')_0x25167c['topic']!==null&&_0x8cc430['throttle'](_0x25167c['throttle']);else{if(_0x25167c['type']==='ping')_0x8cc430['sayPong'](_0x8cc430['appId'],_0x8cc430['guid'],_0x25167c['originator'],_0x25167c['details']);else _0x25167c['type']==='rollcall'&&(_0x25167c['topic']!==null&&_0x8cc430['doRollCall'](_0x25167c));}};}async['doRollCall'](_0x64e8b){let _0x450803=0x0;const _0x6ca4a7=!isNaN(_0x64e8b['max'])?_0x64e8b['max']:enums_1['HMSH_QUORUM_ROLLCALL_CYCLES'];if(this['rollCallInterval'])clearTimeout(this['rollCallInterval']);const _0x8d43d9=_0x64e8b['interval']/0x2,_0x475f50=_0x8d43d9+Math['ceil'](Math['random']()*_0x8d43d9);do{await(0x0,utils_1['sleepFor'])(Math['ceil'](Math['random']()*0x3e8)),await this['sayPong'](this['appId'],this['guid'],null,!![],_0x64e8b['signature']);if(!_0x64e8b['interval'])return;const {promise:_0x478f43,timerId:_0x5f5d6c}=(0x0,utils_1['XSleepFor'])(_0x475f50*0x3e8);this['rollCallInterval']=_0x5f5d6c,await _0x478f43;}while(this['rollCallInterval']&&_0x450803++<_0x6ca4a7-0x1);}['cancelRollCall'](){this['rollCallInterval']&&(clearTimeout(this['rollCallInterval']),delete this['rollCallInterval']);}['stop'](){this['cancelRollCall']();}async['sayPong'](_0x67f339,_0x4b2b7a,_0xfde1a1,_0x4a2d54=![],_0x369c75=![]){let _0x23d184;if(_0x4a2d54){const _0x925f4={'appId':this['appId'],'topic':this['topic']};_0x23d184={'engine_id':this['guid'],'namespace':this['namespace'],'app_id':this['appId'],'worker_topic':this['topic'],'stream':this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x925f4),'counts':this['router']?.['counts'],'timestamp':(0x0,utils_1['formatISODate'])(new Date()),'inited':this['inited'],'throttle':this['router']?.['throttle'],'reclaimDelay':this['router']?.['reclaimDelay'],'reclaimCount':this['router']?.['reclaimCount'],'system':await(0x0,utils_1['getSystemHealth'])(),'signature':_0x369c75?this['callback']['toString']():undefined};}this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'pong','guid':_0x4b2b7a,'originator':_0xfde1a1,'profile':_0x23d184},_0x67f339);}async['throttle'](_0x2d7411){this['router']?.['setThrottle'](_0x2d7411);}}exports['WorkerService']=WorkerService;
1
+ 'use strict';(function(_0x2cf299,_0x181d30){const _0x516cb3=_0x372e,_0x4699cf=_0x2cf299();while(!![]){try{const _0x3e237e=-parseInt(_0x516cb3(0x154))/0x1*(parseInt(_0x516cb3(0x152))/0x2)+parseInt(_0x516cb3(0x151))/0x3+parseInt(_0x516cb3(0x14f))/0x4*(-parseInt(_0x516cb3(0x14e))/0x5)+parseInt(_0x516cb3(0x156))/0x6+-parseInt(_0x516cb3(0x14d))/0x7*(-parseInt(_0x516cb3(0x14c))/0x8)+-parseInt(_0x516cb3(0x150))/0x9*(-parseInt(_0x516cb3(0x153))/0xa)+parseInt(_0x516cb3(0x155))/0xb;if(_0x3e237e===_0x181d30)break;else _0x4699cf['push'](_0x4699cf['shift']());}catch(_0x1a5079){_0x4699cf['push'](_0x4699cf['shift']());}}}(_0x12c2,0x7ee2c));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['WorkerService']=void 0x0;const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),factory_1=require('../connector/factory'),router_1=require('../router'),stream_1=require('../../types/stream'),enums_1=require('../../modules/enums'),factory_2=require('../stream/factory'),factory_3=require('../sub/factory'),factory_4=require('../store/factory');class WorkerService{constructor(){this['reporting']=![];}static async['init'](_0x1a9ee1,_0x56ff88,_0x3b5359,_0x4d5e19,_0x45fbb8){const _0x55e97c=[];if(Array['isArray'](_0x4d5e19['workers']))for(const _0x706db1 of _0x4d5e19['workers']){await factory_1['ConnectorService']['initClients'](_0x706db1);const _0x41dfb3=new WorkerService();_0x41dfb3['verifyWorkerFields'](_0x706db1),_0x41dfb3['namespace']=_0x1a9ee1,_0x41dfb3['appId']=_0x56ff88,_0x41dfb3['guid']=_0x3b5359,_0x41dfb3['callback']=_0x706db1['callback'],_0x41dfb3['topic']=_0x706db1['topic'],_0x41dfb3['config']=_0x4d5e19,_0x41dfb3['logger']=_0x45fbb8,await _0x41dfb3['initStoreChannel'](_0x41dfb3,_0x706db1['store']),await _0x41dfb3['initSubChannel'](_0x41dfb3,_0x706db1['sub'],_0x706db1['pub']??_0x706db1['store']),await _0x41dfb3['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x41dfb3['subscriptionHandler'](),_0x56ff88),await _0x41dfb3['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x41dfb3['subscriptionHandler'](),_0x56ff88,_0x41dfb3['topic']),await _0x41dfb3['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x41dfb3['subscriptionHandler'](),_0x56ff88,_0x41dfb3['guid']),await _0x41dfb3['initStreamChannel'](_0x41dfb3,_0x706db1['stream'],_0x706db1['store']),_0x41dfb3['router']=await _0x41dfb3['initRouter'](_0x706db1,_0x45fbb8);const _0x11160e=_0x41dfb3['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x41dfb3['appId'],'topic':_0x706db1['topic']});await _0x41dfb3['router']['consumeMessages'](_0x11160e,'WORKER',_0x41dfb3['guid'],_0x706db1['callback']),_0x41dfb3['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x55e97c['push'](_0x41dfb3);}return _0x55e97c;}['verifyWorkerFields'](_0x946b5d){if(!(0x0,utils_1['identifyProvider'])(_0x946b5d['store'])||!(0x0,utils_1['identifyProvider'])(_0x946b5d['stream'])||!(0x0,utils_1['identifyProvider'])(_0x946b5d['sub'])||!(_0x946b5d['topic']&&_0x946b5d['callback']))throw new Error('worker\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields\x20along\x20with\x20a\x20callback\x20function\x20and\x20topic.');}async['initStoreChannel'](_0xc118f5,_0x2d2d6b){_0xc118f5['store']=await factory_4['StoreServiceFactory']['init'](_0x2d2d6b,_0xc118f5['namespace'],_0xc118f5['appId'],_0xc118f5['logger']);}async['initSubChannel'](_0x1a0ada,_0x2851d7,_0x127809){_0x1a0ada['subscribe']=await factory_3['SubServiceFactory']['init'](_0x2851d7,_0x127809,_0x1a0ada['namespace'],_0x1a0ada['appId'],_0x1a0ada['guid'],_0x1a0ada['logger']);}async['initStreamChannel'](_0x361d4e,_0x42f736,_0xb294f7){_0x361d4e['stream']=await factory_2['StreamServiceFactory']['init'](_0x42f736,_0xb294f7,_0x361d4e['namespace'],_0x361d4e['appId'],_0x361d4e['logger']);}async['initRouter'](_0x515c38,_0x480330){const _0x240d75=await this['store']['getThrottleRate'](_0x515c38['topic']);return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['WORKER'],'topic':_0x515c38['topic'],'reclaimDelay':_0x515c38['reclaimDelay'],'reclaimCount':_0x515c38['reclaimCount'],'throttle':_0x240d75},this['stream'],_0x480330);}['subscriptionHandler'](){const _0x3fb406=this;return async(_0x2f398d,_0x2316cb)=>{_0x3fb406['logger']['debug']('worker-event-received',{'topic':_0x2f398d,'type':_0x2316cb['type']});if(_0x2316cb['type']==='throttle')_0x2316cb['topic']!==null&&_0x3fb406['throttle'](_0x2316cb['throttle']);else{if(_0x2316cb['type']==='ping')_0x3fb406['sayPong'](_0x3fb406['appId'],_0x3fb406['guid'],_0x2316cb['originator'],_0x2316cb['details']);else _0x2316cb['type']==='rollcall'&&(_0x2316cb['topic']!==null&&_0x3fb406['doRollCall'](_0x2316cb));}};}async['doRollCall'](_0x2f160c){let _0x32466a=0x0;const _0x54003c=!isNaN(_0x2f160c['max'])?_0x2f160c['max']:enums_1['HMSH_QUORUM_ROLLCALL_CYCLES'];if(this['rollCallInterval'])clearTimeout(this['rollCallInterval']);const _0x41be1b=_0x2f160c['interval']/0x2,_0x2e68d0=_0x41be1b+Math['ceil'](Math['random']()*_0x41be1b);do{await(0x0,utils_1['sleepFor'])(Math['ceil'](Math['random']()*0x3e8)),await this['sayPong'](this['appId'],this['guid'],null,!![],_0x2f160c['signature']);if(!_0x2f160c['interval'])return;const {promise:_0x4de3d7,timerId:_0x568213}=(0x0,utils_1['XSleepFor'])(_0x2e68d0*0x3e8);this['rollCallInterval']=_0x568213,await _0x4de3d7;}while(this['rollCallInterval']&&_0x32466a++<_0x54003c-0x1);}['cancelRollCall'](){this['rollCallInterval']&&(clearTimeout(this['rollCallInterval']),delete this['rollCallInterval']);}['stop'](){this['cancelRollCall']();}async['sayPong'](_0x4153c2,_0x5dea5c,_0x11de28,_0x2f3c4c=![],_0x3ac7d7=![]){let _0x483172;if(_0x2f3c4c){const _0x40a976={'appId':this['appId'],'topic':this['topic']};_0x483172={'engine_id':this['guid'],'namespace':this['namespace'],'app_id':this['appId'],'worker_topic':this['topic'],'stream':this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x40a976),'counts':this['router']?.['counts'],'timestamp':(0x0,utils_1['formatISODate'])(new Date()),'inited':this['inited'],'throttle':this['router']?.['throttle'],'reclaimDelay':this['router']?.['reclaimDelay'],'reclaimCount':this['router']?.['reclaimCount'],'system':await(0x0,utils_1['getSystemHealth'])(),'signature':_0x3ac7d7?this['callback']['toString']():undefined};}this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'pong','guid':_0x5dea5c,'originator':_0x11de28,'profile':_0x483172},_0x4153c2);}async['throttle'](_0x55e44e){this['router']?.['setThrottle'](_0x55e44e);}}exports['WorkerService']=WorkerService;function _0x372e(_0x2ab29f,_0x9f7b46){const _0x12c2d2=_0x12c2();return _0x372e=function(_0x372eae,_0x3b2e45){_0x372eae=_0x372eae-0x14c;let _0x52bea6=_0x12c2d2[_0x372eae];return _0x52bea6;},_0x372e(_0x2ab29f,_0x9f7b46);}function _0x12c2(){const _0x17de20=['1943874FkexfT','16104MPDwWf','2828VMtdqE','1216195wyAbsX','16AwgqBz','747sXeVLg','577407QXkTKC','686618TwzuDX','70850NWRytb','2LUXaFx','2876973MoSgVR'];_0x12c2=function(){return _0x17de20;};return _0x12c2();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.3.21",
3
+ "version": "0.3.23",
4
4
  "description": "Serverless Workflow",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
package/types/postgres.ts CHANGED
@@ -29,7 +29,7 @@ export type PostgresPoolType = {
29
29
  //NOTE: query is a shorthand and includes implicit `connect/release` handled by pool
30
30
  query: (text: string, values?: any[]) => Promise<PostgresQueryResultType>;
31
31
  };
32
-
32
+
33
33
  export interface PostgresClientType {
34
34
  connect: () => Promise<PostgresClientType>;
35
35
  query: (text: string, values?: any[]) => Promise<PostgresQueryResultType>;
package/types/provider.ts CHANGED
@@ -68,11 +68,9 @@ export type ProviderConfig = {
68
68
  class: any;
69
69
  options: StringAnyType;
70
70
  /* 'redis' (Class) | 'ioredis' (Class) | 'postgres' (Client module) | 'postgres.pool' | 'postgres.poolclient', 'nats' */
71
- provider?: string;
71
+ provider?: string;
72
72
  };
73
73
 
74
-
75
-
76
74
  export type ProvidersConfig = {
77
75
  sub: ProviderConfig;
78
76
  store: ProviderConfig;