@hotmeshio/hotmesh 0.3.22 → 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 (77) 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/meshflow/exporter.js +1 -1
  27. package/build/services/pipe/functions/array.js +1 -1
  28. package/build/services/pipe/functions/bitwise.js +1 -1
  29. package/build/services/pipe/functions/conditional.js +1 -1
  30. package/build/services/pipe/functions/cron.js +1 -1
  31. package/build/services/pipe/functions/date.js +1 -1
  32. package/build/services/pipe/functions/index.js +1 -1
  33. package/build/services/pipe/functions/json.js +1 -1
  34. package/build/services/pipe/functions/logical.js +1 -1
  35. package/build/services/pipe/functions/math.js +1 -1
  36. package/build/services/pipe/functions/number.js +1 -1
  37. package/build/services/pipe/functions/object.js +1 -1
  38. package/build/services/pipe/functions/string.js +1 -1
  39. package/build/services/pipe/functions/symbol.js +1 -1
  40. package/build/services/pipe/functions/unary.js +1 -1
  41. package/build/services/pipe/index.js +1 -1
  42. package/build/services/quorum/index.js +1 -1
  43. package/build/services/reporter/index.js +1 -1
  44. package/build/services/router/index.js +1 -1
  45. package/build/services/search/providers/postgres/postgres.js +1 -1
  46. package/build/services/search/providers/redis/ioredis.js +1 -1
  47. package/build/services/search/providers/redis/redis.js +1 -1
  48. package/build/services/serializer/index.js +1 -1
  49. package/build/services/store/providers/postgres/kvsql.js +1 -1
  50. package/build/services/store/providers/postgres/kvtables.js +1 -1
  51. package/build/services/store/providers/postgres/kvtransaction.js +1 -1
  52. package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
  53. package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
  54. package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
  55. package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
  56. package/build/services/store/providers/postgres/postgres.js +1 -1
  57. package/build/services/store/providers/redis/_base.js +1 -1
  58. package/build/services/store/providers/redis/ioredis.js +1 -1
  59. package/build/services/store/providers/redis/redis.js +1 -1
  60. package/build/services/store/providers/store-initializable.js +1 -1
  61. package/build/services/stream/providers/nats/nats.js +1 -1
  62. package/build/services/stream/providers/postgres/postgres.js +1 -1
  63. package/build/services/stream/providers/redis/ioredis.js +1 -1
  64. package/build/services/stream/providers/redis/redis.js +1 -1
  65. package/build/services/stream/providers/stream-initializable.js +1 -1
  66. package/build/services/sub/factory.d.ts +1 -1
  67. package/build/services/sub/factory.js +4 -4
  68. package/build/services/sub/providers/nats/nats.js +1 -1
  69. package/build/services/sub/providers/postgres/postgres.js +1 -1
  70. package/build/services/sub/providers/redis/ioredis.js +1 -1
  71. package/build/services/sub/providers/redis/redis.js +1 -1
  72. package/build/services/task/index.js +1 -1
  73. package/build/services/telemetry/index.js +1 -1
  74. package/build/services/worker/index.js +1 -1
  75. package/package.json +1 -1
  76. package/types/postgres.ts +1 -1
  77. package/types/provider.ts +1 -3
@@ -1 +1 @@
1
- 'use strict';(function(_0x39fecd,_0x5c74be){const _0x287437=_0x38b2,_0x2401f9=_0x39fecd();while(!![]){try{const _0x580df5=-parseInt(_0x287437(0x144))/0x1+parseInt(_0x287437(0x147))/0x2+parseInt(_0x287437(0x142))/0x3+-parseInt(_0x287437(0x146))/0x4*(parseInt(_0x287437(0x143))/0x5)+-parseInt(_0x287437(0x13f))/0x6*(parseInt(_0x287437(0x140))/0x7)+-parseInt(_0x287437(0x141))/0x8+parseInt(_0x287437(0x145))/0x9;if(_0x580df5===_0x5c74be)break;else _0x2401f9['push'](_0x2401f9['shift']());}catch(_0x8fb4c6){_0x2401f9['push'](_0x2401f9['shift']());}}}(_0x45fb,0x95ee4));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['RedisStreamService']=void 0x0;function _0x45fb(){const _0x48c317=['7679nfPnLB','3434464eXOHhW','1275258QjvAWR','74950eMnArC','471773ofTOZE','19614915vovsLO','180azIUuX','1079232QYnvJU','5220VxOkwN'];_0x45fb=function(){return _0x48c317;};return _0x45fb();}const index_1=require('../../index'),utils_1=require('../../../../modules/utils'),key_1=require('../../../../modules/key'),enums_1=require('../../../../modules/enums');function _0x38b2(_0x1a943b,_0x34a735){const _0x45fb2a=_0x45fb();return _0x38b2=function(_0x38b277,_0x5577b4){_0x38b277=_0x38b277-0x13f;let _0xad5644=_0x45fb2a[_0x38b277];return _0xad5644;},_0x38b2(_0x1a943b,_0x34a735);}class RedisStreamService extends index_1['StreamService']{constructor(_0x13bff1,_0x4d3377,_0x4d7ca5={}){super(_0x13bff1,_0x4d3377,_0x4d7ca5);}async['init'](_0x3c39e9,_0x1091be,_0x307414){this['namespace']=_0x3c39e9,this['logger']=_0x307414,this['appId']=_0x1091be;}['mintKey'](_0x2ec13a,_0x9bb2d5){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x2ec13a,{..._0x9bb2d5,'appId':this['appId']});}['transact'](){return this['streamClient']['multi']();}async['createStream'](_0x5245be){try{const _0x3ff547=await this['streamClient']['XADD'](_0x5245be,'*',{'field':'value'});return await this['streamClient']['XDEL'](_0x5245be,_0x3ff547),!![];}catch(_0x23eb2c){this['logger']['error']('Error\x20creating\x20stream\x20'+_0x5245be,{'error':_0x23eb2c});throw _0x23eb2c;}}async['deleteStream'](_0x45ed2e){try{const _0x2f8e82=await this['streamClient']['DEL'](_0x45ed2e);return _0x2f8e82>0x0;}catch(_0x35c5b9){this['logger']['error']('Error\x20deleting\x20stream\x20'+_0x45ed2e,{'error':_0x35c5b9});throw _0x35c5b9;}}async['createConsumerGroup'](_0x44efb0,_0x35ae41){try{const _0x4ca9a0=await this['storeClient']['sendCommand'](['XGROUP','CREATE',_0x44efb0,_0x35ae41,'$','MKSTREAM']);return _0x4ca9a0==='OK';}catch(_0x2563dd){const _0x311d18='with\x20MKSTREAM';this['logger']['debug']('x-group-error\x20'+_0x311d18+'\x20for\x20key:\x20'+_0x44efb0+'\x20and\x20group:\x20'+_0x35ae41,{..._0x2563dd});throw _0x2563dd;}}async['deleteConsumerGroup'](_0x141f5c,_0x436cfa){try{const _0x180efa=await this['streamClient']['xGroupDestroy'](_0x141f5c,_0x436cfa);return _0x180efa;}catch(_0x5f4a2a){this['logger']['error']('Error\x20deleting\x20consumer\x20group\x20'+_0x436cfa+'\x20for\x20stream\x20'+_0x141f5c,{'error':_0x5f4a2a});throw _0x5f4a2a;}}async['publishMessages'](_0xfeeaf,_0x33442f,_0x4cdca9){try{const _0x42752f=_0x4cdca9?.['transaction']||_0x33442f['length']>0x1&&this['storeClient']['multi']();let _0x363b7a;for(const _0x18e2ac of _0x33442f){_0x363b7a=await(_0x42752f||this['storeClient'])['XADD'](_0xfeeaf,'*',{'message':_0x18e2ac});}return _0x42752f&&!_0x4cdca9?.['transaction']?(await _0x42752f['exec']())['map'](_0x1489f8=>_0x1489f8[0x1]):[_0x363b7a];}catch(_0x573d60){this['logger']['error']('ioredis-xadd-error\x20key:\x20'+_0xfeeaf,{..._0x573d60});throw _0x573d60;}}async['consumeMessages'](_0x3c6286,_0x2824e5,_0x3084f8,_0x434606){const _0x13644d='GROUP',_0x4b0dbf='BLOCK',_0x5ec90d='STREAMS',_0x1a2a4f='>';try{const _0x4784c9=await this['streamClient']['sendCommand'](['XREADGROUP',_0x13644d,_0x2824e5,_0x3084f8,_0x4b0dbf,_0x434606?.['blockTimeout']?.['toString']()??enums_1['HMSH_BLOCK_TIME_MS']['toString'](),_0x5ec90d,_0x3c6286,_0x1a2a4f]),_0x3633d2=[];if((0x0,utils_1['isStreamMessage'])(_0x4784c9)){const [[,_0x4db37a]]=_0x4784c9;for(const [_0x52c541,_0x2890fe]of _0x4db37a){_0x3633d2['push']({'id':_0x52c541,'data':(0x0,utils_1['parseStreamMessage'])(_0x2890fe[0x1])});}}else return[];return _0x3633d2;}catch(_0x241199){this['logger']['error']('Error\x20consuming\x20messages\x20from\x20'+_0x3c6286,{'error':_0x241199});throw _0x241199;}}async['ackAndDelete'](_0xc5f50e,_0x146fd4,_0x590b41){const _0x54bd27=this['storeClient']['multi']();return await this['acknowledgeMessages'](_0xc5f50e,_0x146fd4,_0x590b41,{'multi':_0x54bd27}),await this['deleteMessages'](_0xc5f50e,_0x146fd4,_0x590b41,{'multi':_0x54bd27}),await _0x54bd27['exec'](),_0x590b41['length'];}async['acknowledgeMessages'](_0x5a7e91,_0x3111f9,_0x37f3ef,_0x355e3e){try{return _0x355e3e?.['multi']?(_0x355e3e['multi']['XACK'](_0x5a7e91,_0x3111f9,_0x37f3ef),_0x355e3e['multi']):await this['streamClient']['XACK'](_0x5a7e91,_0x3111f9,..._0x37f3ef);}catch(_0x20e690){this['logger']['error']('Error\x20in\x20acknowledging\x20messages\x20in\x20group:\x20'+_0x3111f9+'\x20for\x20key:\x20'+_0x5a7e91,{'error':_0x20e690});throw _0x20e690;}}async['deleteMessages'](_0xf65d67,_0x4d73ed,_0x359fee,_0x20477f){try{return _0x20477f?.['multi']?(_0x20477f['multi']['xDel'](_0xf65d67,_0x359fee),_0x20477f['multi']):await this['streamClient']['XDEL'](_0xf65d67,..._0x359fee);}catch(_0x5db8d3){this['logger']['error']('Error\x20in\x20deleting\x20messages\x20with\x20ids:\x20'+_0x359fee['join'](',')+'\x20for\x20key:\x20'+_0xf65d67,{'error':_0x5db8d3});throw _0x5db8d3;}}async['getPendingMessages'](_0x3b54d4,_0x98d42c,_0x39e03b,_0xec77b5){try{const _0x271e59='-',_0x4003b9='+',_0x4fa887=[_0x3b54d4,_0x98d42c];if(_0x271e59)_0x4fa887['push'](_0x271e59);if(_0x4003b9)_0x4fa887['push'](_0x4003b9);if(_0x39e03b!==undefined)_0x4fa887['push'](_0x39e03b['toString']());if(_0xec77b5)_0x4fa887['push'](_0xec77b5);try{return await this['streamClient']['sendCommand'](['XPENDING',..._0x4fa887]);}catch(_0x5b010e){this['logger']['error']('error,\x20args',{..._0x5b010e},_0x4fa887);}}catch(_0xbacb9d){this['logger']['error']('Error\x20retrieving\x20pending\x20messages\x20for\x20group:\x20'+_0x98d42c+'\x20in\x20key:\x20'+_0x3b54d4,{..._0xbacb9d});throw _0xbacb9d;}}async['retryMessages'](_0x2eb084,_0x4a7c00,_0x5b95bd){let _0x346f1c=[];const _0x380802=await this['getPendingMessages'](_0x2eb084,_0x4a7c00,_0x5b95bd?.['limit']);for(const _0x8d42a1 of _0x380802){if(Array['isArray'](_0x8d42a1)){const [_0x28cfcf,,_0x38c155,_0x5a4ff0]=_0x8d42a1;if(_0x38c155>_0x5b95bd?.['minIdleTime']){const _0x5b36c6=await this['claimMessage'](_0x2eb084,_0x4a7c00,_0x5b95bd?.['consumerName'],_0x5b95bd?.['minIdleTime'],_0x28cfcf);_0x346f1c=_0x346f1c['concat'](_0x5b36c6);}}}return _0x346f1c;}async['claimMessage'](_0x345cf9,_0xa5afc7,_0x30e2d0,_0x475a9f,_0x37caab,..._0x39d2ca){try{const _0x45c336=await this['streamClient']['sendCommand'](['XCLAIM',_0x345cf9,_0xa5afc7,_0x30e2d0,_0x475a9f['toString'](),_0x37caab,..._0x39d2ca]);return{'id':_0x45c336[0x0][0x0],'data':(0x0,utils_1['parseStreamMessage'])(_0x45c336[0x0][0x1][0x1])};}catch(_0x1e3fbb){this['logger']['error']('Error\x20in\x20claiming\x20message\x20with\x20id:\x20'+_0x37caab+'\x20in\x20group:\x20'+_0xa5afc7+'\x20for\x20key:\x20'+_0x345cf9,{..._0x1e3fbb});throw _0x1e3fbb;}}async['getStreamStats'](_0x46ddac){return{'messageCount':await this['getStreamDepth'](_0x46ddac)};}async['getStreamDepth'](_0x47d750,_0xc54f0f){try{if(_0xc54f0f?.['multi'])return _0xc54f0f['multi']['XLEN'](_0x47d750),0x0;const _0x53a0f2=await this['streamClient']['XLEN'](_0x47d750);return _0x53a0f2;}catch(_0x4316f2){this['logger']['error']('Error\x20getting\x20depth\x20for\x20'+_0x47d750,{'error':_0x4316f2});throw _0x4316f2;}}async['getStreamDepths'](_0x5b9cd9){const _0xc149c5=this['storeClient']['multi'](),_0x125d08=new Map();_0x5b9cd9['forEach'](_0x405ff6=>{!_0x125d08['has'](_0x405ff6['stream'])&&(_0x125d08['set'](_0x405ff6['stream'],-0x1),this['getStreamDepth'](_0x405ff6['stream'],{'multi':_0xc149c5}));});const _0x4e94dc=await _0xc149c5['exec']();return Array['from'](_0x125d08['keys']())['forEach']((_0x1b0526,_0x159070)=>{_0x125d08['set'](_0x1b0526,_0x4e94dc[_0x159070]);}),_0x5b9cd9['map'](_0x77235a=>{return{'stream':_0x77235a['stream'],'depth':_0x125d08['get'](_0x77235a['stream'])||0x0};});}async['trimStream'](_0x32dcd2,_0x26e5c8){return 0x0;}['getProviderSpecificFeatures'](){return{'supportsBatching':!![],'supportsDeadLetterQueue':![],'supportsOrdering':!![],'supportsTrimming':!![],'supportsRetry':!![],'maxMessageSize':0x200*0x400*0x400,'maxBatchSize':0x3e8};}}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(_0x3ad540,_0x13c504){var _0x5825d7=_0x1025,_0x4bc8ed=_0x3ad540();while(!![]){try{var _0x1ad990=-parseInt(_0x5825d7(0x8f))/0x1+parseInt(_0x5825d7(0x92))/0x2*(-parseInt(_0x5825d7(0x8d))/0x3)+parseInt(_0x5825d7(0x90))/0x4+parseInt(_0x5825d7(0x91))/0x5+-parseInt(_0x5825d7(0x95))/0x6*(-parseInt(_0x5825d7(0x8e))/0x7)+parseInt(_0x5825d7(0x93))/0x8+-parseInt(_0x5825d7(0x96))/0x9*(parseInt(_0x5825d7(0x94))/0xa);if(_0x1ad990===_0x13c504)break;else _0x4bc8ed['push'](_0x4bc8ed['shift']());}catch(_0xaddff2){_0x4bc8ed['push'](_0x4bc8ed['shift']());}}}(_0x1610,0x4b72a));Object['defineProperty'](exports,'__esModule',{'value':!![]});function _0x1025(_0x134c82,_0x2ac3b8){var _0x1610be=_0x1610();return _0x1025=function(_0x1025c0,_0x2b9e78){_0x1025c0=_0x1025c0-0x8d;var _0x3f0fdd=_0x1610be[_0x1025c0];return _0x3f0fdd;},_0x1025(_0x134c82,_0x2ac3b8);}function _0x1610(){var _0x458558=['24tXyMGH','7bhMsfA','497523ngXSWe','1698756gbAQYG','2192775EIueOg','59746KuleRC','82712UDOLKi','70uPkYMr','1162662OGGoba','28053xpsDGi'];_0x1610=function(){return _0x458558;};return _0x1610();}
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(_0x3d7e7b,_0x1dca13){const _0x5bafa9=_0x30f4,_0x2a17d8=_0x3d7e7b();while(!![]){try{const _0x10809a=-parseInt(_0x5bafa9(0x159))/0x1+-parseInt(_0x5bafa9(0x156))/0x2*(-parseInt(_0x5bafa9(0x154))/0x3)+parseInt(_0x5bafa9(0x152))/0x4+-parseInt(_0x5bafa9(0x153))/0x5+parseInt(_0x5bafa9(0x151))/0x6*(-parseInt(_0x5bafa9(0x157))/0x7)+-parseInt(_0x5bafa9(0x158))/0x8+parseInt(_0x5bafa9(0x155))/0x9;if(_0x10809a===_0x1dca13)break;else _0x2a17d8['push'](_0x2a17d8['shift']());}catch(_0x5794b9){_0x2a17d8['push'](_0x2a17d8['shift']());}}}(_0x1dc5,0x6f7fc));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['NatsSubService']=void 0x0;const key_1=require('../../../../modules/key'),index_1=require('../../index');function _0x30f4(_0x15ee5b,_0x4ebb8c){const _0x1dc571=_0x1dc5();return _0x30f4=function(_0x30f401,_0x2f2bdc){_0x30f401=_0x30f401-0x151;let _0x6dad84=_0x1dc571[_0x30f401];return _0x6dad84;},_0x30f4(_0x15ee5b,_0x4ebb8c);}function _0x1dc5(){const _0x434f0f=['249324SpuGqB','3864565dQEnUP','179139WDkUqZ','16783938yOZpSP','12zzeEPl','21OOAhDU','6151496BRAKnS','81822NvOjLY','410238xwJIuh'];_0x1dc5=function(){return _0x434f0f;};return _0x1dc5();}class NatsSubService extends index_1['SubService']{constructor(_0x343611,_0x2330fd){super(_0x343611,_0x2330fd),this['subscriptions']=new Map();}async['init'](_0x216eba=key_1['HMNS'],_0x43f0cb,_0x5c9b01,_0x5c6419){this['namespace']=_0x216eba,this['logger']=_0x5c6419,this['appId']=_0x43f0cb,this['engineId']=_0x5c9b01;}['transact'](){return{};}['mintKey'](_0xc5b42c,_0x315567){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0xc5b42c,_0x315567)['replace'](/:/g,'.')['replace'](/\.$/g,'.X');}async['subscribe'](_0x1d9464,_0x1756b5,_0x50b439,_0x3b2232){const _0x1179d0=this['mintKey'](_0x1d9464,{'appId':_0x50b439,'engineId':_0x3b2232}),_0x59a226=this['eventClient']['subscribe'](_0x1179d0);this['subscriptions']['set'](_0x1179d0,_0x59a226),this['logger']['debug']('nats-subscribe\x20'+_0x1179d0),(async()=>{for await(const _0x546a83 of _0x59a226){try{const _0x21a7ab=JSON['parse'](_0x546a83['data']['toString']());_0x1756b5(_0x1179d0,_0x21a7ab);}catch(_0x1f017e){this['logger']['error']('nats-subscribe-message-parse-error:\x20'+_0x546a83['data']['toString'](),_0x1f017e);}}})()['catch'](_0x3b2b33=>{this['logger']['error']('nats-subscribe-error\x20'+_0x1179d0,_0x3b2b33);});}async['unsubscribe'](_0x426ffb,_0x230260,_0xe6bab6){const _0x185c09=this['mintKey'](_0x426ffb,{'appId':_0x230260,'engineId':_0xe6bab6}),_0x287a31=this['subscriptions']['get'](_0x185c09);_0x287a31?(_0x287a31['unsubscribe'](),this['subscriptions']['delete'](_0x185c09),this['logger']['debug']('nats-unsubscribe\x20'+_0x185c09)):this['logger']['warn']('nats-unsubscribe-error\x20'+_0x185c09);}async['psubscribe'](_0x1c5d5d,_0xfc840e,_0x336023,_0x3dc501){const _0x4b67f7=this['mintKey'](_0x1c5d5d,{'appId':_0x336023,'engineId':_0x3dc501}),_0x229bf1=this['eventClient']['subscribe'](_0x4b67f7);this['subscriptions']['set'](_0x4b67f7,_0x229bf1),this['logger']['debug']('nats-psubscribe\x20'+_0x4b67f7),(async()=>{for await(const _0x53e1cc of _0x229bf1){try{const _0x50cd5a=JSON['parse'](_0x53e1cc['data']['toString']());_0xfc840e(_0x53e1cc['subject'],_0x50cd5a);}catch(_0x1c6246){this['logger']['error']('nats-parse-psubscription-message-error\x20'+_0x53e1cc['data']['toString'](),_0x1c6246);}}})()['catch'](_0x23e6c0=>{this['logger']['error']('nats-pattern-psubscription-error\x20'+_0x4b67f7,_0x23e6c0);});}async['punsubscribe'](_0x5e9835,_0x5c8fe5,_0x57e8dd){const _0x3578c5=this['mintKey'](_0x5e9835,{'appId':_0x5c8fe5,'engineId':_0x57e8dd}),_0x5ead23=this['subscriptions']['get'](_0x3578c5);_0x5ead23?(_0x5ead23['unsubscribe'](),this['subscriptions']['delete'](_0x3578c5),this['logger']['debug']('nats-punsubscribe\x20'+_0x3578c5)):this['logger']['warn']('nats-punsubscribe-error\x20'+_0x3578c5);}async['publish'](_0x14271a,_0x23bd86,_0x1cd105,_0x2359ed){const _0x99178a=this['mintKey'](_0x14271a,{'appId':_0x1cd105,'engineId':_0x2359ed});try{return this['storeClient']['publish'](_0x99178a,JSON['stringify'](_0x23bd86)),this['logger']['debug']('nats-publish\x20'+_0x99178a),!![];}catch(_0x10ea45){return this['logger']['error']('nats-publish-error\x20'+_0x99178a,_0x10ea45),![];}}}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(_0x37d941,_0x4251af){const _0x3647dc=_0xf6d2,_0x3db432=_0x37d941();while(!![]){try{const _0x2f033a=parseInt(_0x3647dc(0xe9))/0x1*(parseInt(_0x3647dc(0xef))/0x2)+parseInt(_0x3647dc(0xed))/0x3+-parseInt(_0x3647dc(0xf0))/0x4+-parseInt(_0x3647dc(0xf1))/0x5*(-parseInt(_0x3647dc(0xeb))/0x6)+-parseInt(_0x3647dc(0xee))/0x7*(parseInt(_0x3647dc(0xea))/0x8)+parseInt(_0x3647dc(0xec))/0x9+-parseInt(_0x3647dc(0xf2))/0xa;if(_0x2f033a===_0x4251af)break;else _0x3db432['push'](_0x3db432['shift']());}catch(_0x39ab86){_0x3db432['push'](_0x3db432['shift']());}}}(_0x46f6,0x5fe2b));var __importDefault=this&&this['__importDefault']||function(_0x576225){return _0x576225&&_0x576225['__esModule']?_0x576225:{'default':_0x576225};};function _0xf6d2(_0x59f2dc,_0x5ddb06){const _0x46f67c=_0x46f6();return _0xf6d2=function(_0xf6d27d,_0x3f3b01){_0xf6d27d=_0xf6d27d-0xe9;let _0x4edbaf=_0x46f67c[_0xf6d27d];return _0x4edbaf;},_0xf6d2(_0x59f2dc,_0x5ddb06);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['PostgresSubService']=void 0x0;const crypto_1=__importDefault(require('crypto')),key_1=require('../../../../modules/key'),index_1=require('../../index');function _0x46f6(){const _0x65c552=['612516DRpbAQ','56pugsxy','183018yVvgXf','1017824GKWUzf','3318565ChTIQV','4454220WOKNiJ','5dMZqhw','323056CuzmaR','6OIpoDx','812259DCQSNE'];_0x46f6=function(){return _0x65c552;};return _0x46f6();}class PostgresSubService extends index_1['SubService']{constructor(_0x4508db,_0x1146b6){super(_0x4508db,_0x1146b6);}async['init'](_0x44dd9d=key_1['HMNS'],_0x199b1d,_0x4d516e,_0x295523){this['namespace']=_0x44dd9d,this['logger']=_0x295523,this['appId']=_0x199b1d,this['engineId']=_0x4d516e;}['transact'](){throw new Error('Transactions\x20are\x20not\x20supported\x20in\x20lightweight\x20pub/sub');}['mintKey'](_0x2d4603,_0x3f8a57){if(!this['namespace'])throw new Error('Namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x2d4603,_0x3f8a57);}['mintSafeKey'](_0x10e38a,_0x5735ae){const _0x473623=this['mintKey'](_0x10e38a,_0x5735ae);if(_0x473623['length']<=0x3f)return[_0x473623,_0x473623];const {appId:appId='',engineId:engineId=''}=_0x5735ae,_0x45b504=this['namespace']+':'+appId+':'+_0x10e38a,_0x167a50=0x3f-_0x45b504['length']-0x1,_0x412e14=crypto_1['default']['createHash']('sha256')['update'](engineId)['digest']('hex')['substring'](0x0,_0x167a50),_0x3096db=_0x45b504+':'+_0x412e14;return[_0x473623,_0x3096db];}async['subscribe'](_0xbec77d,_0x188717,_0x463c49,_0x22447c){const [_0x418922,_0x7e9971]=this['mintSafeKey'](_0xbec77d,{'appId':_0x463c49,'engineId':_0x22447c});await this['eventClient']['query']('LISTEN\x20\x22'+_0x7e9971+'\x22'),this['logger']['debug']('postgres-subscribe',{'originalKey':_0x418922,'safeKey':_0x7e9971}),this['eventClient']['on']('notification',_0xa31bf=>{if(_0xa31bf['channel']===_0x7e9971)try{const _0x31bf00=JSON['parse'](_0xa31bf['payload']||'{}');_0x188717(_0x7e9971,_0x31bf00);}catch(_0x9b9793){this['logger']['error']('Error\x20parsing\x20message\x20for\x20topic\x20'+_0x7e9971+':',_0x9b9793);}});}async['unsubscribe'](_0x535adb,_0x478f7a,_0x52cc73){const [_0x1b8d2d,_0x5b06a4]=this['mintSafeKey'](_0x535adb,{'appId':_0x478f7a,'engineId':_0x52cc73});await this['eventClient']['query']('UNLISTEN\x20\x22'+_0x5b06a4+'\x22'),this['logger']['debug']('postgres-subscribe',{'originalKey':_0x1b8d2d,'safeKey':_0x5b06a4});}async['publish'](_0x44a8c7,_0x36a61f,_0x1633f4,_0x3ca614){const [_0x570e0a,_0x2d218e]=this['mintSafeKey'](_0x44a8c7,{'appId':_0x1633f4,'engineId':_0x3ca614}),_0x40f5ec=JSON['stringify'](_0x36a61f)['replace'](/'/g,'\x27\x27');return await this['storeClient']['query']('NOTIFY\x20\x22'+_0x2d218e+'\x22,\x20\x27'+_0x40f5ec+'\x27'),this['logger']['debug']('postgres-publish',{'originalKey':_0x570e0a,'safeKey':_0x2d218e}),!![];}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(_0x14502f,_0xd1d131){const _0x5d940d=_0x298e,_0x19e689=_0x14502f();while(!![]){try{const _0x16eeef=parseInt(_0x5d940d(0x1bf))/0x1+-parseInt(_0x5d940d(0x1c5))/0x2*(-parseInt(_0x5d940d(0x1be))/0x3)+-parseInt(_0x5d940d(0x1c4))/0x4+-parseInt(_0x5d940d(0x1bd))/0x5*(-parseInt(_0x5d940d(0x1c2))/0x6)+parseInt(_0x5d940d(0x1c1))/0x7+-parseInt(_0x5d940d(0x1c3))/0x8+-parseInt(_0x5d940d(0x1c0))/0x9;if(_0x16eeef===_0xd1d131)break;else _0x19e689['push'](_0x19e689['shift']());}catch(_0x9f78e){_0x19e689['push'](_0x19e689['shift']());}}}(_0x3ecf,0xbc9ca));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['IORedisSubService']=void 0x0;const key_1=require('../../../../modules/key'),index_1=require('../../index');function _0x298e(_0x1e37b4,_0x1d97f8){const _0x3ecf2d=_0x3ecf();return _0x298e=function(_0x298e24,_0x24ff26){_0x298e24=_0x298e24-0x1bd;let _0x712612=_0x3ecf2d[_0x298e24];return _0x712612;},_0x298e(_0x1e37b4,_0x1d97f8);}class IORedisSubService extends index_1['SubService']{constructor(_0x234bae,_0x210083){super(_0x234bae,_0x210083);}async['init'](_0x162968=key_1['HMNS'],_0x24bab8,_0x9058d6,_0x173120){this['namespace']=_0x162968,this['logger']=_0x173120,this['appId']=_0x24bab8,this['engineId']=_0x9058d6;}['transact'](){return this['eventClient']['multi']();}['mintKey'](_0x449bc2,_0x3fd6f8){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x449bc2,_0x3fd6f8);}async['subscribe'](_0x4ecac8,_0x532845,_0x484b3f,_0x1ac9f7){const _0x167faf=this,_0x561cd3=this['mintKey'](_0x4ecac8,{'appId':_0x484b3f,'engineId':_0x1ac9f7});await this['eventClient']['subscribe'](_0x561cd3,_0x55b343=>{_0x55b343&&_0x167faf['logger']['error']('Error\x20subscribing\x20to:\x20'+_0x561cd3,_0x55b343);}),this['eventClient']['on']('message',(_0x2bc6f8,_0x2c6f8c)=>{if(_0x2bc6f8===_0x561cd3)try{const _0x38103f=JSON['parse'](_0x2c6f8c);_0x532845(_0x561cd3,_0x38103f);}catch(_0x28cb91){_0x167faf['logger']['error']('Error\x20parsing\x20message:\x20'+_0x2c6f8c,_0x28cb91);}});}async['unsubscribe'](_0x5386fa,_0x402d53,_0x56d100){const _0x21a890=this['mintKey'](_0x5386fa,{'appId':_0x402d53,'engineId':_0x56d100});await this['eventClient']['unsubscribe'](_0x21a890);}async['psubscribe'](_0x227a3e,_0x3a1b5f,_0x2383ce,_0x1d373f){const _0x128660=this,_0x1bcb99=this['mintKey'](_0x227a3e,{'appId':_0x2383ce,'engineId':_0x1d373f});await this['eventClient']['psubscribe'](_0x1bcb99,_0x3fcc6f=>{_0x3fcc6f&&_0x128660['logger']['error']('Error\x20subscribing\x20to:\x20'+_0x1bcb99,_0x3fcc6f);}),this['eventClient']['on']('pmessage',(_0x33ab38,_0x4ff18b,_0x2e722a)=>{if(_0x33ab38===_0x1bcb99)try{const _0x584116=JSON['parse'](_0x2e722a);_0x3a1b5f(_0x4ff18b,_0x584116);}catch(_0x3fe3dc){_0x128660['logger']['error']('Error\x20parsing\x20message:\x20'+_0x2e722a,_0x3fe3dc);}});}async['punsubscribe'](_0x1ca0d5,_0x62c14d,_0x855e5f){const _0x3a51cd=this['mintKey'](_0x1ca0d5,{'appId':_0x62c14d,'engineId':_0x855e5f});await this['eventClient']['punsubscribe'](_0x3a51cd);}async['publish'](_0x5f0945,_0x1bd4bd,_0x2bdcdf,_0x25a05c){const _0x218c9b=this['mintKey'](_0x5f0945,{'appId':_0x2bdcdf,'engineId':_0x25a05c}),_0x346c5d=await this['storeClient']['publish'](_0x218c9b,JSON['stringify'](_0x1bd4bd));return _0x346c5d===0x1;}}exports['IORedisSubService']=IORedisSubService;function _0x3ecf(){const _0x26dce4=['1518545SyIPYQ','11380140MpXUhR','1241597vSgldW','5007066MOcmkt','6109128UyTCaQ','1115272dpDpIC','549046Buvxye','5uaTumk','6yaLANL'];_0x3ecf=function(){return _0x26dce4;};return _0x3ecf();}
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(_0x514485,_0x36fae0){const _0x992010=_0x5d3c,_0x3ec0b7=_0x514485();while(!![]){try{const _0x1e564d=-parseInt(_0x992010(0x176))/0x1*(parseInt(_0x992010(0x16d))/0x2)+-parseInt(_0x992010(0x16c))/0x3+parseInt(_0x992010(0x174))/0x4+-parseInt(_0x992010(0x16f))/0x5*(-parseInt(_0x992010(0x172))/0x6)+-parseInt(_0x992010(0x170))/0x7+parseInt(_0x992010(0x16e))/0x8*(parseInt(_0x992010(0x173))/0x9)+parseInt(_0x992010(0x171))/0xa*(-parseInt(_0x992010(0x175))/0xb);if(_0x1e564d===_0x36fae0)break;else _0x3ec0b7['push'](_0x3ec0b7['shift']());}catch(_0xcbd6c4){_0x3ec0b7['push'](_0x3ec0b7['shift']());}}}(_0x590d,0x5e165));function _0x5d3c(_0x53b9ce,_0x49a852){const _0x590d61=_0x590d();return _0x5d3c=function(_0x5d3c45,_0x9d5a67){_0x5d3c45=_0x5d3c45-0x16c;let _0x55cd17=_0x590d61[_0x5d3c45];return _0x55cd17;},_0x5d3c(_0x53b9ce,_0x49a852);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['RedisSubService']=void 0x0;const key_1=require('../../../../modules/key'),index_1=require('../../index');class RedisSubService extends index_1['SubService']{constructor(_0x4edf67,_0x5eb909){super(_0x4edf67,_0x5eb909);}async['init'](_0xb849a9=key_1['HMNS'],_0x4be805,_0x3ed942,_0x44e7d8){this['namespace']=_0xb849a9,this['logger']=_0x44e7d8,this['appId']=_0x4be805,this['engineId']=_0x3ed942;}['transact'](){const _0xb29869=this['eventClient']['multi']();return _0xb29869;}['mintKey'](_0x41c0e4,_0x580d23){if(!this['namespace'])throw new Error('namespace\x20not\x20set');return key_1['KeyService']['mintKey'](this['namespace'],_0x41c0e4,_0x580d23);}async['subscribe'](_0x3af6b4,_0x4e380c,_0x1b2577,_0x20f345){if(this['eventClient']){const _0x1bb1d3=this,_0x2872e8=this['mintKey'](_0x3af6b4,{'appId':_0x1b2577,'engineId':_0x20f345});await this['eventClient']['subscribe'](_0x2872e8,_0xd45966=>{try{const _0x59f7b9=JSON['parse'](_0xd45966);_0x4e380c(_0x2872e8,_0x59f7b9);}catch(_0x42066c){_0x1bb1d3['logger']['error']('Error\x20parsing\x20message:\x20'+_0xd45966,_0x42066c);}});}}async['unsubscribe'](_0x3be037,_0x3c173a,_0x801471){const _0xebfa83=this['mintKey'](_0x3be037,{'appId':_0x3c173a,'engineId':_0x801471});await this['eventClient']['unsubscribe'](_0xebfa83);}async['psubscribe'](_0x4250bb,_0x5de350,_0x4b6218,_0x48aef5){if(this['eventClient']){const _0x22cbc9=this,_0x1bb06e=this['mintKey'](_0x4250bb,{'appId':_0x4b6218,'engineId':_0x48aef5});await this['eventClient']['pSubscribe'](_0x1bb06e,(_0x406f90,_0x33b642)=>{try{const _0x4888ae=JSON['parse'](_0x406f90);_0x5de350(_0x33b642,_0x4888ae);}catch(_0x14c325){_0x22cbc9['logger']['error']('Error\x20parsing\x20message:\x20'+_0x406f90,_0x14c325);}});}}async['punsubscribe'](_0x287f13,_0x1568c3,_0x5ef5d2){const _0x1992c9=this['mintKey'](_0x287f13,{'appId':_0x1568c3,'engineId':_0x5ef5d2});await this['eventClient']['pUnsubscribe'](_0x1992c9);}async['publish'](_0x210be5,_0x468801,_0x50491b,_0x53b149){const _0x426643=this['mintKey'](_0x210be5,{'appId':_0x50491b,'engineId':_0x53b149}),_0x1f1bad=await this['storeClient']['publish'](_0x426643,JSON['stringify'](_0x468801));return _0x1f1bad>0x0;}}function _0x590d(){const _0x529336=['901992vPlOxY','3356dYlzWX','4648216uahGET','20hZLEiR','1682226VkUEsk','70AJQUOs','754050FMlSvh','9jdQgdN','2035468dkithC','704143bKtOMC','130SbgJZC'];_0x590d=function(){return _0x529336;};return _0x590d();}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(_0x20787d,_0x29f36e){const _0x163bdc=_0x1549,_0x4c98b8=_0x20787d();while(!![]){try{const _0x459e54=-parseInt(_0x163bdc(0x1e1))/0x1*(parseInt(_0x163bdc(0x1eb))/0x2)+-parseInt(_0x163bdc(0x1e5))/0x3*(parseInt(_0x163bdc(0x1e6))/0x4)+-parseInt(_0x163bdc(0x1ea))/0x5+parseInt(_0x163bdc(0x1e0))/0x6*(parseInt(_0x163bdc(0x1e4))/0x7)+-parseInt(_0x163bdc(0x1e3))/0x8*(-parseInt(_0x163bdc(0x1e2))/0x9)+parseInt(_0x163bdc(0x1e9))/0xa+-parseInt(_0x163bdc(0x1e8))/0xb*(-parseInt(_0x163bdc(0x1e7))/0xc);if(_0x459e54===_0x29f36e)break;else _0x4c98b8['push'](_0x4c98b8['shift']());}catch(_0x21d58c){_0x4c98b8['push'](_0x4c98b8['shift']());}}}(_0xba9a,0x98ba7));function _0xba9a(){const _0xcc4b8f=['15324IsvhPB','27038OoRLTc','1040690xIjiay','5313255vQcxHX','4rLaLAU','6tJtpkd','428819GYqwqI','20529QnKGKy','1120wATjaA','289779KLXLLR','93336vEVrTy','136EEiGpo'];_0xba9a=function(){return _0xcc4b8f;};return _0xba9a();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['TaskService']=void 0x0;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(_0x6ff503,_0x4d59fe){this['cleanupTimeout']=null,this['isScout']=![],this['errorCount']=0x0,this['logger']=_0x4d59fe,this['store']=_0x6ff503;}async['processWebHooks'](_0x4a9c6b){const _0x240049=await this['store']['getActiveTaskQueue']();if(_0x240049){const [_0x10c8d8,_0xe260ea,_0x135ace,..._0x1494be]=_0x240049['split'](key_1['WEBSEP']),_0x11c3a4=JSON['parse'](_0x1494be['join'](key_1['WEBSEP'])),_0x2055ff=_0xe260ea+':processed',_0x2ea0d0=await this['store']['processTaskQueue'](_0xe260ea,_0x2055ff);_0x2ea0d0?await _0x4a9c6b(_0x10c8d8,{..._0x11c3a4,'id':_0x2ea0d0}):await this['store']['deleteProcessedTaskQueue'](_0x240049,_0xe260ea,_0x2055ff,_0x135ace==='true'),setImmediate(()=>this['processWebHooks'](_0x4a9c6b));}}async['enqueueWorkItems'](_0x386da3){await this['store']['addTaskQueues'](_0x386da3);}async['registerJobForCleanup'](_0x55c255,_0x34594d=enums_1['HMSH_EXPIRE_DURATION'],_0x40469b){_0x34594d>0x0&&await this['store']['expireJob'](_0x55c255,_0x34594d);}async['registerTimeHook'](_0x3dfcc8,_0x4e2b82,_0xc0c758,_0x390b85,_0x4ea856=enums_1['HMSH_FIDELITY_SECONDS'],_0x260810,_0xf666){const _0x2148f9=Date['now']()+_0x4ea856*0x3e8,_0x45d53f=enums_1['HMSH_FIDELITY_SECONDS']*0x3e8,_0x5005de=Math['floor'](_0x2148f9/_0x45d53f)*_0x45d53f;await this['store']['registerTimeHook'](_0x3dfcc8,_0x4e2b82,_0xc0c758,_0x390b85,_0x5005de,_0x260810,_0xf666);}async['shouldScout'](){const _0x21dce7=this['isScout'],_0x23e648=_0x21dce7||(this['isScout']=await this['store']['reserveScoutRole']('time'));if(_0x23e648)return!_0x21dce7&&setTimeout(()=>{this['isScout']=![];},enums_1['HMSH_SCOUT_INTERVAL_SECONDS']*0x3e8),!![];return![];}async['processTimeHooks'](_0x41459e,_0x38f750){if(await this['shouldScout']())try{const _0x41e377=await this['store']['getNextTask'](_0x38f750);if(Array['isArray'](_0x41e377)){const [_0x489f52,_0x27c632,_0x45ab81,_0xe80378,_0x86c4d2]=_0x41e377;if(_0x86c4d2==='child'){}else{if(_0x86c4d2==='delist'){const _0x2861d8=this['store']['mintKey'](hotmesh_1['KeyType']['SIGNALS'],{'appId':this['store']['appId']});await this['store']['delistSignalKey'](_0x2861d8,_0x27c632);}else await _0x41459e(_0x27c632,_0x45ab81,_0xe80378,_0x86c4d2);}await(0x0,utils_1['sleepFor'])(0x0),this['errorCount']=0x0,this['processTimeHooks'](_0x41459e,_0x489f52);}else{if(_0x41e377)await(0x0,utils_1['sleepFor'])(0x0),this['errorCount']=0x0,this['processTimeHooks'](_0x41459e);else{const _0x21384b=(0x0,utils_1['XSleepFor'])(enums_1['HMSH_FIDELITY_SECONDS']*0x3e8);this['cleanupTimeout']=_0x21384b['timerId'],await _0x21384b['promise'],this['errorCount']=0x0,this['processTimeHooks'](_0x41459e);}}}catch(_0x51e144){this['logger']['warn']('task-process-timehooks-error',_0x51e144),await(0x0,utils_1['sleepFor'])(0x3e8*this['errorCount']++),this['errorCount']<0x5&&this['processTimeHooks'](_0x41459e);}else{const _0x5f5b3f=(0x0,utils_1['XSleepFor'])(enums_1['HMSH_SCOUT_INTERVAL_SECONDS']*0x3e8*0x2*Math['random']());this['cleanupTimeout']=_0x5f5b3f['timerId'],await _0x5f5b3f['promise'],this['processTimeHooks'](_0x41459e);}}['cancelCleanup'](){this['cleanupTimeout']!==undefined&&(clearTimeout(this['cleanupTimeout']),this['cleanupTimeout']=undefined);}async['getHookRule'](_0xb36843){const _0x31ba7b=await this['store']['getHookRules']();return _0x31ba7b?.[_0xb36843]?.[0x0];}async['registerWebHook'](_0x1e9772,_0x378d1a,_0x309678,_0x5417ef,_0x3f95f3){const _0xf21c4=await this['getHookRule'](_0x1e9772);if(_0xf21c4){const _0x5c5869=_0xf21c4['conditions']['match'][0x0]['expected'],_0x30ed24=pipe_1['Pipe']['resolve'](_0x5c5869,_0x378d1a),_0x451678=_0x378d1a['metadata']['jid'],_0x50cd10=_0x378d1a['metadata']['gid'],_0x5ed268=_0xf21c4['to'],_0x204c12=[_0x5ed268,_0x309678,_0x50cd10,_0x451678]['join'](key_1['WEBSEP']),_0x1841d0={'topic':_0x1e9772,'resolved':_0x30ed24,'jobId':_0x204c12,'expire':_0x5417ef};return await this['store']['setHookSignal'](_0x1841d0,_0x3f95f3),_0x451678;}else throw new Error('signaler.registerWebHook:error:\x20hook\x20rule\x20not\x20found');}async['processWebHookSignal'](_0x50ab2e,_0x5a6605){const _0x41e4b0=await this['getHookRule'](_0x50ab2e);if(_0x41e4b0){const _0x584e7b={'$self':{'hook':{'data':_0x5a6605}},'$hook':{'data':_0x5a6605}},_0x487c1e=_0x41e4b0['conditions']['match'][0x0]['actual'],_0x301334=pipe_1['Pipe']['resolve'](_0x487c1e,_0x584e7b),_0x5c3547=await this['store']['getHookSignal'](_0x50ab2e,_0x301334);if(!_0x5c3547)return undefined;const [_0x380cce,_0x11baab,_0x325798,..._0x2416b6]=_0x5c3547['split'](key_1['WEBSEP']);return[_0x2416b6['join'](key_1['WEBSEP']),_0x41e4b0['to'],_0x11baab,_0x325798];}else throw new Error('signal-not-found');}async['deleteWebHookSignal'](_0x2a9d76,_0x231f3f){const _0x537659=await this['getHookRule'](_0x2a9d76);if(_0x537659){const _0x367f9d={'$self':{'hook':{'data':_0x231f3f}},'$hook':{'data':_0x231f3f}},_0x1284e6=_0x537659['conditions']['match'][0x0]['actual'],_0xbe0368=pipe_1['Pipe']['resolve'](_0x1284e6,_0x367f9d);return await this['store']['deleteHookSignal'](_0x2a9d76,_0xbe0368);}else throw new Error('signaler.process:error:\x20hook\x20rule\x20not\x20found');}}function _0x1549(_0x1bc5d1,_0x498fb7){const _0xba9acc=_0xba9a();return _0x1549=function(_0x15496d,_0x17f8f3){_0x15496d=_0x15496d-0x1e0;let _0x49dd6b=_0xba9acc[_0x15496d];return _0x49dd6b;},_0x1549(_0x1bc5d1,_0x498fb7);}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 _0x2c07(){const _0x4e098b=['3387800uMbqcZ','609686xQXmin','7350942RFOsbZ','5530085qHnCIN','496241wMFWUS','72TSuVOa','2117211YLXkJT','1326762YbNJwK','2hKcIEv'];_0x2c07=function(){return _0x4e098b;};return _0x2c07();}(function(_0x246176,_0x4f8a14){const _0x1637da=_0xe8db,_0x43301e=_0x246176();while(!![]){try{const _0x3cbbec=parseInt(_0x1637da(0x106))/0x1+-parseInt(_0x1637da(0x10a))/0x2*(-parseInt(_0x1637da(0x108))/0x3)+parseInt(_0x1637da(0x10b))/0x4+parseInt(_0x1637da(0x105))/0x5+-parseInt(_0x1637da(0x10d))/0x6+parseInt(_0x1637da(0x10c))/0x7+parseInt(_0x1637da(0x107))/0x8*(-parseInt(_0x1637da(0x109))/0x9);if(_0x3cbbec===_0x4f8a14)break;else _0x43301e['push'](_0x43301e['shift']());}catch(_0x18a5f3){_0x43301e['push'](_0x43301e['shift']());}}}(_0x2c07,0xa87cc));var __importDefault=this&&this['__importDefault']||function(_0x51b619){return _0x51b619&&_0x51b619['__esModule']?_0x51b619:{'default':_0x51b619};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['TelemetryService']=void 0x0;function _0xe8db(_0x463d45,_0x1ef581){const _0x2c07d1=_0x2c07();return _0xe8db=function(_0xe8dbd8,_0x3be3f3){_0xe8dbd8=_0xe8dbd8-0x105;let _0x1f7ed9=_0x2c07d1[_0xe8dbd8];return _0x1f7ed9;},_0xe8db(_0x463d45,_0x1ef581);}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(_0x36cb2b,_0x5c0111,_0x3c59cc,_0xc8a199){this['leg']=0x1,this['appId']=_0x36cb2b,this['config']=_0x5c0111,this['metadata']=_0x3c59cc,this['context']=_0xc8a199;}['getJobParentSpanId'](){return this['context']['metadata']['spn'];}['getActivityParentSpanId'](_0x49f2de){return _0x49f2de===0x1?this['context'][this['config']['parent']]['output']?.['metadata']?.['l2s']:this['context']['$self']['output']?.['metadata']?.['l1s'];}['getTraceId'](){return this['context']['metadata']['trc'];}['startJobSpan'](){const _0x483a5f='JOB/'+this['appId']+'/'+this['config']['subscribes']+'/1',_0x94dcb2=this['getTraceId'](),_0x10df6b=this['getJobParentSpanId'](),_0x20382c=this['getSpanAttrs'](0x1),_0x5c211c=this['startSpan'](_0x94dcb2,_0x10df6b,_0x483a5f,_0x20382c);return this['jobSpan']=_0x5c211c,this['setTelemetryContext'](_0x5c211c,0x1),this;}['startActivitySpan'](_0x42f876=this['leg']){const _0x96e78f=this['config']['type']['toUpperCase']()+'/'+this['appId']+'/'+this['metadata']['aid']+'/'+_0x42f876,_0x7cb001=this['getTraceId'](),_0x4a419f=this['getActivityParentSpanId'](_0x42f876),_0x333df7=this['getSpanAttrs'](_0x42f876),_0x26a27d=this['startSpan'](_0x7cb001,_0x4a419f,_0x96e78f,_0x333df7);return this['setTelemetryContext'](_0x26a27d,_0x42f876),this['span']=_0x26a27d,this;}['startStreamSpan'](_0x1cc907,_0x585c5d){let _0x212417;if(_0x585c5d===stream_1['StreamRole']['SYSTEM'])_0x212417='SYSTEM';else{if(_0x585c5d===stream_1['StreamRole']['WORKER'])_0x212417='EXECUTE';else _0x1cc907['type']===stream_1['StreamDataType']['RESULT']||_0x1cc907['type']===stream_1['StreamDataType']['RESPONSE']?_0x212417='FANIN':_0x212417='FANOUT';}const _0x95b01f=_0x1cc907['metadata']['topic']?'/'+_0x1cc907['metadata']['topic']:'',_0x294ce3=_0x212417+'/'+this['appId']+'/'+_0x1cc907['metadata']['aid']+_0x95b01f,_0x25c8b7=this['getStreamSpanAttrs'](_0x1cc907),_0x3d7527=this['startSpan'](_0x1cc907['metadata']['trc'],_0x1cc907['metadata']['spn'],_0x294ce3,_0x25c8b7);return this['span']=_0x3d7527,this;}['startSpan'](_0x12f109,_0x2706ae,_0xb777ed,_0x4e882d){this['traceId']=_0x12f109,this['spanId']=_0x2706ae;const _0x12754d=telemetry_1['trace']['getTracer'](package_json_1['default']['name'],package_json_1['default']['version']),_0x512387=this['getParentSpanContext'](),_0x3ac829=_0x12754d['startSpan'](_0xb777ed,{'kind':telemetry_1['SpanKind']['CLIENT'],'attributes':_0x4e882d,'root':!_0x512387},_0x512387);return _0x3ac829;}['mapActivityAttributes'](){if(this['config']['telemetry']){const _0x23d3af=new mapper_1['MapperService'](this['config']['telemetry'],this['context'])['mapRules'](),_0x3c6524={...Object['keys'](_0x23d3af)['reduce']((_0x544389,_0x133c58)=>{return['string','boolean','number']['includes'](typeof _0x23d3af[_0x133c58])&&(_0x544389['app.activity.data.'+_0x133c58]=_0x23d3af[_0x133c58]),_0x544389;},{})};this['span']?.['setAttributes'](_0x3c6524);}}['setActivityAttributes'](_0x4648cd){this['span']?.['setAttributes'](_0x4648cd);}['setStreamAttributes'](_0x508033){this['span']?.['setAttributes'](_0x508033);}['setJobAttributes'](_0x340d9b){this['jobSpan']?.['setAttributes'](_0x340d9b);}['endJobSpan'](){this['endSpan'](this['jobSpan']);}['endActivitySpan'](){this['endSpan'](this['span']);}['endStreamSpan'](){this['endSpan'](this['span']);}['endSpan'](_0x451bdb){_0x451bdb&&_0x451bdb['end']();}['getParentSpanContext'](){if(this['traceId']&&this['spanId']){const _0x2a8f64={'traceId':this['traceId'],'spanId':this['spanId'],'isRemote':!![],'traceFlags':0x1},_0x2f92c3=telemetry_1['trace']['setSpanContext'](telemetry_1['context']['active'](),_0x2a8f64);return _0x2f92c3;}}['getSpanAttrs'](_0x2380a2){return{...Object['keys'](this['context']['metadata'])['reduce']((_0x2e9880,_0x1dcec5)=>{return _0x1dcec5!=='trc'&&(_0x2e9880['app.job.'+_0x1dcec5]=this['context']['metadata'][_0x1dcec5]),_0x2e9880;},{}),...Object['keys'](this['metadata'])['reduce']((_0x2f09e6,_0xf29a90)=>{return _0x2f09e6['app.activity.'+_0xf29a90]=this['metadata'][_0xf29a90],_0x2f09e6;},{}),'app.activity.leg':_0x2380a2};}['getStreamSpanAttrs'](_0x2ff7d6){return{...Object['keys'](_0x2ff7d6['metadata'])['reduce']((_0x3d5cb2,_0x143ff7)=>{return _0x143ff7!=='trc'&&_0x143ff7!=='spn'&&(_0x3d5cb2['app.stream.'+_0x143ff7]=_0x2ff7d6['metadata'][_0x143ff7]),_0x3d5cb2;},{})};}['setTelemetryContext'](_0x3a04ae,_0x7ed65){!this['context']['metadata']['trc']&&(this['context']['metadata']['trc']=_0x3a04ae['spanContext']()['traceId']),_0x7ed65===0x1?(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l1s']=_0x3a04ae['spanContext']()['spanId']):(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l2s']=_0x3a04ae['spanContext']()['spanId']);}['setActivityError'](_0x47ec3f){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0x47ec3f});}['setStreamError'](_0x1f6b06){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0x1f6b06});}static['addTargetTelemetryPaths'](_0x1dbcf0,_0x2ee589,_0x143d31,_0x4d2d83){_0x4d2d83===0x1?(!(_0x2ee589['parent']in _0x1dbcf0)&&(_0x1dbcf0[_0x2ee589['parent']]=[]),_0x1dbcf0[_0x2ee589['parent']]['push'](_0x2ee589['parent']+'/output/metadata/l2s')):(!(_0x143d31['aid']in _0x1dbcf0)&&(_0x1dbcf0[_0x143d31['aid']]=[]),_0x1dbcf0[_0x143d31['aid']]['push'](_0x143d31['aid']+'/output/metadata/l1s'));}static['bindJobTelemetryToState'](_0x267aeb,_0x1647ea,_0x202b7f){_0x1647ea['type']==='trigger'&&(_0x267aeb['metadata/trc']=_0x202b7f['metadata']['trc']);}static['bindActivityTelemetryToState'](_0x4ab4ac,_0x16f4ea,_0x2dfbd5,_0x1e35bc,_0x5114ec){if(_0x16f4ea['type']==='trigger')_0x4ab4ac[_0x2dfbd5['aid']+'/output/metadata/l1s']=_0x1e35bc['$self']['output']['metadata']['l1s'],_0x4ab4ac[_0x2dfbd5['aid']+'/output/metadata/l2s']=_0x1e35bc['$self']['output']['metadata']['l2s'];else{if(utils_1['polyfill']['resolveActivityType'](_0x16f4ea['type'])==='hook'&&_0x5114ec===0x1)_0x4ab4ac[_0x2dfbd5['aid']+'/output/metadata/l1s']=_0x1e35bc['$self']['output']['metadata']['l1s'],_0x4ab4ac[_0x2dfbd5['aid']+'/output/metadata/l2s']=_0x1e35bc['$self']['output']['metadata']['l1s'];else{if(_0x16f4ea['type']==='signal'&&_0x5114ec===0x1)_0x4ab4ac[_0x2dfbd5['aid']+'/output/metadata/l1s']=_0x1e35bc['$self']['output']['metadata']['l1s'],_0x4ab4ac[_0x2dfbd5['aid']+'/output/metadata/l2s']=_0x1e35bc['$self']['output']['metadata']['l1s'];else{const _0x396839='l'+_0x5114ec+'s';_0x4ab4ac[_0x2dfbd5['aid']+'/output/metadata/'+_0x396839]=_0x1e35bc['$self']['output']['metadata'][_0x396839];}}}}}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(_0x552efa,_0x1a1d77){const _0x393326=_0x4b27,_0x421475=_0x552efa();while(!![]){try{const _0x428bf7=-parseInt(_0x393326(0x1dd))/0x1*(parseInt(_0x393326(0x1dc))/0x2)+parseInt(_0x393326(0x1da))/0x3+-parseInt(_0x393326(0x1d9))/0x4*(parseInt(_0x393326(0x1de))/0x5)+-parseInt(_0x393326(0x1db))/0x6+-parseInt(_0x393326(0x1d6))/0x7*(-parseInt(_0x393326(0x1d8))/0x8)+parseInt(_0x393326(0x1d7))/0x9+-parseInt(_0x393326(0x1df))/0xa;if(_0x428bf7===_0x1a1d77)break;else _0x421475['push'](_0x421475['shift']());}catch(_0x581e4d){_0x421475['push'](_0x421475['shift']());}}}(_0x1f74,0xe3e53));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');function _0x4b27(_0x59e399,_0x38d520){const _0x1f74d1=_0x1f74();return _0x4b27=function(_0x4b27f9,_0x447f58){_0x4b27f9=_0x4b27f9-0x1d6;let _0x3526de=_0x1f74d1[_0x4b27f9];return _0x3526de;},_0x4b27(_0x59e399,_0x38d520);}function _0x1f74(){const _0x384072=['11775688GdRvHj','140GSbhNL','5557191TjPVXN','1293576vXxLWh','30634pbzlUB','34gghOsq','166525EHypUJ','5226230JKqOHl','7KStqdH','303957LjNaTs'];_0x1f74=function(){return _0x384072;};return _0x1f74();}class WorkerService{constructor(){this['reporting']=![];}static async['init'](_0x4f538d,_0x218acd,_0x4c05d8,_0x1b4f87,_0xfbeb1c){const _0x2a91b3=[];if(Array['isArray'](_0x1b4f87['workers']))for(const _0x7b73cf of _0x1b4f87['workers']){await factory_1['ConnectorService']['initClients'](_0x7b73cf);const _0x558bf9=new WorkerService();_0x558bf9['verifyWorkerFields'](_0x7b73cf),_0x558bf9['namespace']=_0x4f538d,_0x558bf9['appId']=_0x218acd,_0x558bf9['guid']=_0x4c05d8,_0x558bf9['callback']=_0x7b73cf['callback'],_0x558bf9['topic']=_0x7b73cf['topic'],_0x558bf9['config']=_0x1b4f87,_0x558bf9['logger']=_0xfbeb1c,await _0x558bf9['initStoreChannel'](_0x558bf9,_0x7b73cf['store']),await _0x558bf9['initSubChannel'](_0x558bf9,_0x7b73cf['sub'],_0x7b73cf['pub']??_0x7b73cf['store']),await _0x558bf9['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x558bf9['subscriptionHandler'](),_0x218acd),await _0x558bf9['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x558bf9['subscriptionHandler'](),_0x218acd,_0x558bf9['topic']),await _0x558bf9['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x558bf9['subscriptionHandler'](),_0x218acd,_0x558bf9['guid']),await _0x558bf9['initStreamChannel'](_0x558bf9,_0x7b73cf['stream'],_0x7b73cf['store']),_0x558bf9['router']=await _0x558bf9['initRouter'](_0x7b73cf,_0xfbeb1c);const _0x112a27=_0x558bf9['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x558bf9['appId'],'topic':_0x7b73cf['topic']});await _0x558bf9['router']['consumeMessages'](_0x112a27,'WORKER',_0x558bf9['guid'],_0x7b73cf['callback']),_0x558bf9['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x2a91b3['push'](_0x558bf9);}return _0x2a91b3;}['verifyWorkerFields'](_0x193a2f){if(!(0x0,utils_1['identifyProvider'])(_0x193a2f['store'])||!(0x0,utils_1['identifyProvider'])(_0x193a2f['stream'])||!(0x0,utils_1['identifyProvider'])(_0x193a2f['sub'])||!(_0x193a2f['topic']&&_0x193a2f['callback']))throw new Error('worker\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields\x20along\x20with\x20a\x20callback\x20function\x20and\x20topic.');}async['initStoreChannel'](_0x5e3324,_0x17dba4){_0x5e3324['store']=await factory_4['StoreServiceFactory']['init'](_0x17dba4,_0x5e3324['namespace'],_0x5e3324['appId'],_0x5e3324['logger']);}async['initSubChannel'](_0x354e8f,_0x22f15f,_0x446a39){_0x354e8f['subscribe']=await factory_3['SubServiceFactory']['init'](_0x22f15f,_0x446a39,_0x354e8f['namespace'],_0x354e8f['appId'],_0x354e8f['guid'],_0x354e8f['logger']);}async['initStreamChannel'](_0x5e8dc8,_0x373e9d,_0x5b147c){_0x5e8dc8['stream']=await factory_2['StreamServiceFactory']['init'](_0x373e9d,_0x5b147c,_0x5e8dc8['namespace'],_0x5e8dc8['appId'],_0x5e8dc8['logger']);}async['initRouter'](_0x1283f4,_0x17d21c){const _0x20730d=await this['store']['getThrottleRate'](_0x1283f4['topic']);return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['WORKER'],'topic':_0x1283f4['topic'],'reclaimDelay':_0x1283f4['reclaimDelay'],'reclaimCount':_0x1283f4['reclaimCount'],'throttle':_0x20730d},this['stream'],_0x17d21c);}['subscriptionHandler'](){const _0x18e10c=this;return async(_0x5079b2,_0x1f72e3)=>{_0x18e10c['logger']['debug']('worker-event-received',{'topic':_0x5079b2,'type':_0x1f72e3['type']});if(_0x1f72e3['type']==='throttle')_0x1f72e3['topic']!==null&&_0x18e10c['throttle'](_0x1f72e3['throttle']);else{if(_0x1f72e3['type']==='ping')_0x18e10c['sayPong'](_0x18e10c['appId'],_0x18e10c['guid'],_0x1f72e3['originator'],_0x1f72e3['details']);else _0x1f72e3['type']==='rollcall'&&(_0x1f72e3['topic']!==null&&_0x18e10c['doRollCall'](_0x1f72e3));}};}async['doRollCall'](_0x23fb2d){let _0x236b3c=0x0;const _0xceebe=!isNaN(_0x23fb2d['max'])?_0x23fb2d['max']:enums_1['HMSH_QUORUM_ROLLCALL_CYCLES'];if(this['rollCallInterval'])clearTimeout(this['rollCallInterval']);const _0x15c6b4=_0x23fb2d['interval']/0x2,_0x467162=_0x15c6b4+Math['ceil'](Math['random']()*_0x15c6b4);do{await(0x0,utils_1['sleepFor'])(Math['ceil'](Math['random']()*0x3e8)),await this['sayPong'](this['appId'],this['guid'],null,!![],_0x23fb2d['signature']);if(!_0x23fb2d['interval'])return;const {promise:_0x281167,timerId:_0x31f0fc}=(0x0,utils_1['XSleepFor'])(_0x467162*0x3e8);this['rollCallInterval']=_0x31f0fc,await _0x281167;}while(this['rollCallInterval']&&_0x236b3c++<_0xceebe-0x1);}['cancelRollCall'](){this['rollCallInterval']&&(clearTimeout(this['rollCallInterval']),delete this['rollCallInterval']);}['stop'](){this['cancelRollCall']();}async['sayPong'](_0x5597de,_0x4a4b01,_0x1483d2,_0x392369=![],_0x35dfaa=![]){let _0x72a782;if(_0x392369){const _0x36bbfe={'appId':this['appId'],'topic':this['topic']};_0x72a782={'engine_id':this['guid'],'namespace':this['namespace'],'app_id':this['appId'],'worker_topic':this['topic'],'stream':this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x36bbfe),'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':_0x35dfaa?this['callback']['toString']():undefined};}this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'pong','guid':_0x4a4b01,'originator':_0x1483d2,'profile':_0x72a782},_0x5597de);}async['throttle'](_0x46176f){this['router']?.['setThrottle'](_0x46176f);}}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.22",
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;