@hotmeshio/hotmesh 0.3.17 → 0.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +161 -64
- package/build/modules/key.js +1 -1
- package/build/modules/utils.js +1 -1
- package/build/package.json +6 -8
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.js +1 -1
- package/build/services/activities/index.js +1 -1
- package/build/services/activities/interrupt.js +1 -1
- package/build/services/activities/signal.js +1 -1
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.js +1 -1
- package/build/services/engine/index.d.ts +1 -1
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.js +1 -1
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/pipe/functions/array.js +1 -1
- package/build/services/pipe/functions/bitwise.js +1 -1
- package/build/services/pipe/functions/conditional.js +1 -1
- package/build/services/pipe/functions/cron.js +1 -1
- package/build/services/pipe/functions/date.js +1 -1
- package/build/services/pipe/functions/index.js +1 -1
- package/build/services/pipe/functions/json.js +1 -1
- package/build/services/pipe/functions/logical.js +1 -1
- package/build/services/pipe/functions/math.js +1 -1
- package/build/services/pipe/functions/number.js +1 -1
- package/build/services/pipe/functions/object.js +1 -1
- package/build/services/pipe/functions/string.js +1 -1
- package/build/services/pipe/functions/symbol.js +1 -1
- package/build/services/pipe/functions/unary.js +1 -1
- package/build/services/pipe/index.js +1 -1
- package/build/services/quorum/index.d.ts +1 -1
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.js +1 -1
- package/build/services/search/providers/postgres/postgres.js +1 -1
- package/build/services/search/providers/redis/ioredis.js +1 -1
- package/build/services/search/providers/redis/redis.js +1 -1
- package/build/services/serializer/index.js +1 -1
- package/build/services/store/providers/postgres/kvsql.js +1 -1
- package/build/services/store/providers/postgres/kvtables.d.ts +1 -0
- package/build/services/store/providers/postgres/kvtables.js +1 -1
- package/build/services/store/providers/postgres/kvtransaction.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/hash.d.ts +1 -0
- package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
- package/build/services/store/providers/postgres/postgres.js +1 -1
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/providers/nats/nats.js +1 -1
- package/build/services/stream/providers/postgres/postgres.d.ts +1 -0
- package/build/services/stream/providers/postgres/postgres.js +1 -1
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/factory.d.ts +2 -2
- package/build/services/sub/factory.js +8 -4
- package/build/services/sub/index.d.ts +3 -2
- package/build/services/sub/providers/postgres/postgres.d.ts +18 -0
- package/build/services/sub/providers/postgres/postgres.js +1 -0
- package/build/services/sub/providers/redis/ioredis.d.ts +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.d.ts +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.d.ts +1 -1
- package/build/services/worker/index.js +1 -1
- package/build/types/redis.d.ts +8 -8
- package/package.json +6 -8
- package/types/redis.ts +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x18b530,_0x384b05){var _0x2ca464=_0xf839,_0x396d62=_0x18b530();while(!![]){try{var _0x1274ba=-parseInt(_0x2ca464(0x187))/0x1*(-parseInt(_0x2ca464(0x18e))/0x2)+parseInt(_0x2ca464(0x18d))/0x3*(-parseInt(_0x2ca464(0x188))/0x4)+parseInt(_0x2ca464(0x189))/0x5+parseInt(_0x2ca464(0x186))/0x6+parseInt(_0x2ca464(0x18b))/0x7*(parseInt(_0x2ca464(0x18c))/0x8)+-parseInt(_0x2ca464(0x18a))/0x9+parseInt(_0x2ca464(0x18f))/0xa;if(_0x1274ba===_0x384b05)break;else _0x396d62['push'](_0x396d62['shift']());}catch(_0x271756){_0x396d62['push'](_0x396d62['shift']());}}}(_0x45fa,0xbd0d1));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['LogicalHandler']=void 0x0;class LogicalHandler{['and'](_0x11f52c,_0x2428e9){return _0x11f52c&&_0x2428e9;}['or'](_0x40bb08,_0x521b04){return _0x40bb08||_0x521b04;}}exports['LogicalHandler']=LogicalHandler;function _0xf839(_0x23dde1,_0x4bb8c9){var _0x45fac0=_0x45fa();return _0xf839=function(_0xf83942,_0x46e7ed){_0xf83942=_0xf83942-0x186;var _0x4c0318=_0x45fac0[_0xf83942];return _0x4c0318;},_0xf839(_0x23dde1,_0x4bb8c9);}function _0x45fa(){var _0x295604=['4351362TOdlGD','1syLSNi','33388gPRzId','336470XAWqsr','11302857bnBBtV','244685uuSchd','200iplTrP','18LwbcxW','58778jtWIes','3845230kAdOem'];_0x45fa=function(){return _0x295604;};return _0x45fa();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x144691,_0x1037ef){const _0x4ac20c=_0x5758,_0x23802d=_0x144691();while(!![]){try{const _0x57ff15=parseInt(_0x4ac20c(0x12a))/0x1*(parseInt(_0x4ac20c(0x126))/0x2)+parseInt(_0x4ac20c(0x12d))/0x3*(-parseInt(_0x4ac20c(0x129))/0x4)+parseInt(_0x4ac20c(0x12b))/0x5+-parseInt(_0x4ac20c(0x12e))/0x6*(parseInt(_0x4ac20c(0x128))/0x7)+parseInt(_0x4ac20c(0x127))/0x8*(parseInt(_0x4ac20c(0x12f))/0x9)+-parseInt(_0x4ac20c(0x125))/0xa+parseInt(_0x4ac20c(0x130))/0xb*(-parseInt(_0x4ac20c(0x12c))/0xc);if(_0x57ff15===_0x1037ef)break;else _0x23802d['push'](_0x23802d['shift']());}catch(_0x4b7d2b){_0x23802d['push'](_0x23802d['shift']());}}}(_0x46b6,0xe1e7f));function _0x5758(_0x23ecdd,_0x182494){const _0x46b630=_0x46b6();return _0x5758=function(_0x575896,_0x49c35c){_0x575896=_0x575896-0x125;let _0x289773=_0x46b630[_0x575896];return _0x289773;},_0x5758(_0x23ecdd,_0x182494);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['MathHandler']=void 0x0;class MathHandler{['add'](..._0x50b1b5){return _0x50b1b5['reduce']((_0x14a4f9,_0x13ea28)=>{return Array['isArray'](_0x13ea28)?_0x14a4f9+this['add'](..._0x13ea28):_0x14a4f9+_0x13ea28;},0x0);}['subtract'](..._0x16a7ed){if(_0x16a7ed['length']===0x0)throw new Error('At\x20least\x20one\x20operand\x20is\x20required.');let _0x273ba8=[];_0x16a7ed['forEach'](_0x27a517=>{Array['isArray'](_0x27a517)?_0x273ba8=[..._0x273ba8,..._0x27a517]:_0x273ba8['push'](_0x27a517);});if(_0x273ba8['length']===0x0)throw new Error('At\x20least\x20one\x20operand\x20is\x20required\x20after\x20flattening.');const _0xa511a0=_0x273ba8['reduce']((_0xee3cc3,_0x14623d,_0x392b3c)=>{return _0x392b3c===0x0?_0xee3cc3:_0xee3cc3-_0x14623d;});return _0xa511a0;}['multiply'](..._0x39d4e){if(_0x39d4e['length']===0x0)throw new Error('At\x20least\x20one\x20operand\x20is\x20required.');return _0x39d4e['reduce']((_0x596b61,_0x47b08b)=>{return Array['isArray'](_0x47b08b)?_0x596b61*this['multiply'](..._0x47b08b):_0x596b61*_0x47b08b;},0x1);}['divide'](..._0x4d039e){if(_0x4d039e['length']===0x0)throw new Error('At\x20least\x20one\x20operand\x20is\x20required.');let _0x188f56=[];_0x4d039e['forEach'](_0x57e441=>{Array['isArray'](_0x57e441)?_0x188f56=[..._0x188f56,..._0x57e441]:_0x188f56['push'](_0x57e441);});if(_0x188f56['length']===0x0)throw new Error('At\x20least\x20one\x20operand\x20is\x20required\x20after\x20flattening.');const _0x5a5606=_0x188f56['reduce']((_0x3594d0,_0x497f18,_0x37c33a)=>{if(_0x497f18===0x0)return NaN;return _0x37c33a===0x0?_0x3594d0:_0x3594d0/_0x497f18;});if(isNaN(_0x5a5606))return NaN;return _0x5a5606;}['abs'](_0x5f13b1){return Math['abs'](_0x5f13b1);}['acos'](_0xe9ac23){return Math['acos'](_0xe9ac23);}['acosh'](_0x18e385){return Math['acosh'](_0x18e385);}['asin'](_0xc5d3c0){return Math['asin'](_0xc5d3c0);}['asinh'](_0x3f908a){return Math['asinh'](_0x3f908a);}['atan'](_0x62c086){return Math['atan'](_0x62c086);}['atan2'](_0x22f120,_0x49b072){return Math['atan2'](_0x22f120,_0x49b072);}['atanh'](_0x5a432c){return Math['atanh'](_0x5a432c);}['cbrt'](_0xd47f7b){return Math['cbrt'](_0xd47f7b);}['ceil'](_0x4c8c92){return Math['ceil'](_0x4c8c92);}['clz32'](_0x5b9ca3){return Math['clz32'](_0x5b9ca3);}['cos'](_0x2d9a38){return Math['cos'](_0x2d9a38);}['cosh'](_0x8d6ba0){return Math['cosh'](_0x8d6ba0);}['exp'](_0x595a5f){return Math['exp'](_0x595a5f);}['expm1'](_0x2a9747){return Math['expm1'](_0x2a9747);}['floor'](_0x1dc807){return Math['floor'](_0x1dc807);}['fround'](_0xc38fb1){return Math['fround'](_0xc38fb1);}['hypot'](..._0x2094ca){return Math['hypot'](..._0x2094ca);}['imul'](_0x4fa55c,_0x24433e){return Math['imul'](_0x4fa55c,_0x24433e);}['log'](_0x1fe0e9){return Math['log'](_0x1fe0e9);}['log10'](_0x23712e){return Math['log10'](_0x23712e);}['log1p'](_0x3b9e8b){return Math['log1p'](_0x3b9e8b);}['log2'](_0x3276b0){return Math['log2'](_0x3276b0);}['max'](..._0x2f0170){return Math['max'](..._0x2f0170);}['min'](..._0x159cef){return Math['min'](..._0x159cef);}['pow'](_0x53ecba,_0x27231a){return Math['pow'](_0x53ecba,_0x27231a);}['random'](){return Math['random']();}['round'](_0x46a1e6){return Math['round'](_0x46a1e6);}['sign'](_0x410827){return Math['sign'](_0x410827);}['sin'](_0x410667){return Math['sin'](_0x410667);}['sinh'](_0x2f74d1){return Math['sinh'](_0x2f74d1);}['sqrt'](_0x2dd5dd){return Math['sqrt'](_0x2dd5dd);}['tan'](_0x88c99){return Math['tan'](_0x88c99);}['tanh'](_0x16bb04){return Math['tanh'](_0x16bb04);}['trunc'](_0x39b830){return Math['trunc'](_0x39b830);}}function _0x46b6(){const _0x3ed8bb=['4BcswGA','60312GoPiof','193991mLNubf','221864QQbQsT','150583KgUSXv','8490310YLrUOx','2550876yVGXTW','3oSXjBM','66LkqEix','1611FmUZvz','22jQLsTk','16379430mCUsIR'];_0x46b6=function(){return _0x3ed8bb;};return _0x46b6();}exports['MathHandler']=MathHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x1f04c6,_0x4ec8e3){var _0x2bf7eb=_0x4799,_0x36e741=_0x1f04c6();while(!![]){try{var _0x11743a=-parseInt(_0x2bf7eb(0x1e0))/0x1+-parseInt(_0x2bf7eb(0x1e2))/0x2*(-parseInt(_0x2bf7eb(0x1e3))/0x3)+-parseInt(_0x2bf7eb(0x1dd))/0x4+parseInt(_0x2bf7eb(0x1da))/0x5+-parseInt(_0x2bf7eb(0x1db))/0x6*(-parseInt(_0x2bf7eb(0x1e1))/0x7)+-parseInt(_0x2bf7eb(0x1de))/0x8+-parseInt(_0x2bf7eb(0x1dc))/0x9*(-parseInt(_0x2bf7eb(0x1df))/0xa);if(_0x11743a===_0x4ec8e3)break;else _0x36e741['push'](_0x36e741['shift']());}catch(_0x5f4300){_0x36e741['push'](_0x36e741['shift']());}}}(_0x3c10,0x69fc4));function _0x3c10(){var _0xbf6396=['563037ldSfyp','1885835MScDaK','1214vVisOC','2259QSNtSZ','1166130sOdjpe','18zFhreE','806931qsJMSe','441604fYLMFh','3844936UCgdXs','10DJzCFJ'];_0x3c10=function(){return _0xbf6396;};return _0x3c10();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['NumberHandler']=void 0x0;function _0x4799(_0x207d2f,_0x3fd808){var _0x3c105d=_0x3c10();return _0x4799=function(_0x4799bd,_0xf1698f){_0x4799bd=_0x4799bd-0x1da;var _0x348772=_0x3c105d[_0x4799bd];return _0x348772;},_0x4799(_0x207d2f,_0x3fd808);}class NumberHandler{['isFinite'](_0x3089cb){return Number['isFinite'](_0x3089cb);}['isEven'](_0x43561d){return!isNaN(_0x43561d)&&_0x43561d%0x2===0x0;}['isOdd'](_0x17bb51){return!isNaN(_0x17bb51)&&_0x17bb51%0x2!==0x0;}['isInteger'](_0x6c1b2e){return Number['isInteger'](_0x6c1b2e);}['isNaN'](_0x1d1759){return Number['isNaN'](_0x1d1759);}['parseFloat'](_0x345f38){return parseFloat(_0x345f38);}['parseInt'](_0x240243,_0x5c40a1){return parseInt(_0x240243,_0x5c40a1);}['toFixed'](_0x2a61e8,_0x5a7513){return _0x2a61e8['toFixed'](_0x5a7513);}['toExponential'](_0x398ee6,_0x15be02){return _0x398ee6['toExponential'](_0x15be02);}['toPrecision'](_0x324640,_0x45a250){return _0x324640['toPrecision'](_0x45a250);}['gte'](_0x3f4487,_0x10164b){return _0x3f4487>=_0x10164b;}['lte'](_0x5625c9,_0x570172){return _0x5625c9<=_0x570172;}['gt'](_0x23c75b,_0x4a36cf){return _0x23c75b>_0x4a36cf;}['lt'](_0x1f93c7,_0x158d33){return _0x1f93c7<_0x158d33;}['max'](..._0x4b1ead){return Math['max'](..._0x4b1ead);}['min'](..._0x189a3b){return Math['min'](..._0x189a3b);}['pow'](_0x37551f,_0x362aee){return Math['pow'](_0x37551f,_0x362aee);}['round'](_0x542773){return Math['round'](_0x542773);}}exports['NumberHandler']=NumberHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x4aa922,_0x53c965){const _0xe3464c=_0x5aef,_0x33c996=_0x4aa922();while(!![]){try{const _0x57dc9c=parseInt(_0xe3464c(0xc6))/0x1*(parseInt(_0xe3464c(0xc5))/0x2)+parseInt(_0xe3464c(0xc4))/0x3*(-parseInt(_0xe3464c(0xce))/0x4)+parseInt(_0xe3464c(0xc9))/0x5*(parseInt(_0xe3464c(0xc8))/0x6)+-parseInt(_0xe3464c(0xcf))/0x7+-parseInt(_0xe3464c(0xcc))/0x8*(parseInt(_0xe3464c(0xcd))/0x9)+parseInt(_0xe3464c(0xcb))/0xa*(parseInt(_0xe3464c(0xc7))/0xb)+-parseInt(_0xe3464c(0xca))/0xc;if(_0x57dc9c===_0x53c965)break;else _0x33c996['push'](_0x33c996['shift']());}catch(_0x409dbd){_0x33c996['push'](_0x33c996['shift']());}}}(_0x5793,0xec709));function _0x5aef(_0x7c575f,_0x5a5ba0){const _0x579383=_0x5793();return _0x5aef=function(_0x5aef34,_0x16fa83){_0x5aef34=_0x5aef34-0xc4;let _0x15986f=_0x579383[_0x5aef34];return _0x15986f;},_0x5aef(_0x7c575f,_0x5a5ba0);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['ObjectHandler']=void 0x0;function _0x5793(){const _0x169f2b=['37116gaPkbh','72xCvKBM','36916UFkSUx','6bmWuYa','7089785dFDcHm','15443640mdeRAD','4990VZwIjX','1425688lnwrlZ','27GbdMsq','589480CAVdYV','123529qhXgDF','33rNjTpX'];_0x5793=function(){return _0x169f2b;};return _0x5793();}class ObjectHandler{['get'](_0x47806b,_0x427c58){return _0x47806b?.[_0x427c58];}['set'](_0x56caa8,_0xa8dba,_0x28db05){if(!_0x56caa8)_0x56caa8={};return _0x56caa8[_0xa8dba]=_0x28db05,_0x56caa8;}['create'](..._0xa0254b){const _0x550ae4={};if(_0xa0254b['length']===0x0)return _0x550ae4;for(let _0x567850=0x0;_0x567850<_0xa0254b['length'];_0x567850+=0x2){_0x550ae4[_0xa0254b[_0x567850]]=_0xa0254b[_0x567850+0x1];}return _0x550ae4;}['keys'](_0x54c51e){return _0x54c51e&&Object['keys'](_0x54c51e)||[];}['values'](_0x5ff66a){return _0x5ff66a&&Object['values'](_0x5ff66a)||[];}['entries'](_0x55eccb){return _0x55eccb&&Object['entries'](_0x55eccb)||[];}['fromEntries'](_0x33555e){return Object['fromEntries'](_0x33555e);}['assign'](_0x12bf09,..._0x1ebb87){return Object['assign'](_0x12bf09||{},..._0x1ebb87);}['getOwnPropertyNames'](_0x5b4898){return Object['getOwnPropertyNames'](_0x5b4898||{});}['getOwnPropertySymbols'](_0x4dd2a1){return Object['getOwnPropertySymbols'](_0x4dd2a1||{});}['getOwnPropertyDescriptor'](_0x293aaa,_0x54ca61){return Object['getOwnPropertyDescriptor'](_0x293aaa||{},_0x54ca61);}['defineProperty'](_0x165a71,_0x425a3e,_0x3c9437){return Object['defineProperty'](_0x165a71,_0x425a3e,_0x3c9437);}['defineProperties'](_0x100cf0,_0x3a5826){return Object['defineProperties'](_0x100cf0,_0x3a5826);}['freeze'](_0x3cf426){return Object['freeze'](_0x3cf426);}['isFrozen'](_0x20fe12){return Object['isFrozen'](_0x20fe12);}['seal'](_0x5d39f2){return Object['seal'](_0x5d39f2);}['isSealed'](_0x5d6292){return Object['isSealed'](_0x5d6292);}['preventExtensions'](_0x550800){return Object['preventExtensions'](_0x550800);}['isExtensible'](_0x31988f){return Object['isExtensible'](_0x31988f);}['hasOwnProperty'](_0x4a92f9,_0x1e69c5){return Object['prototype']['hasOwnProperty']['call'](_0x4a92f9,_0x1e69c5);}['isPrototypeOf'](_0x28bba8,_0x3a0bb2){return Object['prototype']['isPrototypeOf']['call'](_0x28bba8,_0x3a0bb2);}['propertyIsEnumerable'](_0xe5a9cb,_0x1894f6){return Object['prototype']['propertyIsEnumerable']['call'](_0xe5a9cb,_0x1894f6);}}exports['ObjectHandler']=ObjectHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x1ba6(_0x15057b,_0x4fb361){var _0x134fe3=_0x134f();return _0x1ba6=function(_0x1ba643,_0x113929){_0x1ba643=_0x1ba643-0xd0;var _0x3a6cce=_0x134fe3[_0x1ba643];return _0x3a6cce;},_0x1ba6(_0x15057b,_0x4fb361);}(function(_0x2707c0,_0xef1941){var _0x2217c6=_0x1ba6,_0x1426ef=_0x2707c0();while(!![]){try{var _0x2698cf=-parseInt(_0x2217c6(0xdb))/0x1*(parseInt(_0x2217c6(0xdc))/0x2)+parseInt(_0x2217c6(0xd6))/0x3*(parseInt(_0x2217c6(0xd0))/0x4)+-parseInt(_0x2217c6(0xda))/0x5*(parseInt(_0x2217c6(0xd2))/0x6)+-parseInt(_0x2217c6(0xd5))/0x7*(parseInt(_0x2217c6(0xd7))/0x8)+parseInt(_0x2217c6(0xd4))/0x9+-parseInt(_0x2217c6(0xd9))/0xa*(parseInt(_0x2217c6(0xd1))/0xb)+-parseInt(_0x2217c6(0xd3))/0xc*(-parseInt(_0x2217c6(0xd8))/0xd);if(_0x2698cf===_0xef1941)break;else _0x1426ef['push'](_0x1426ef['shift']());}catch(_0x15526f){_0x1426ef['push'](_0x1426ef['shift']());}}}(_0x134f,0xc3b18));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['StringHandler']=void 0x0;class StringHandler{['split'](_0x52fe5a,_0x4040c6){return _0x52fe5a['split'](_0x4040c6);}['charAt'](_0x1f6aef,_0x5e71a4){return _0x1f6aef['charAt'](_0x5e71a4);}['concat'](..._0x29f561){return _0x29f561['join']('');}['includes'](_0x38ebee,_0x5590f7,_0x157b18){return _0x38ebee['includes'](_0x5590f7,_0x157b18);}['indexOf'](_0x4dfeb9,_0xbd7724,_0x2d03fd){return _0x4dfeb9['indexOf'](_0xbd7724,_0x2d03fd);}['lastIndexOf'](_0x179afa,_0x477e2d,_0x3cebe2){return _0x179afa['lastIndexOf'](_0x477e2d,_0x3cebe2);}['slice'](_0x44f662,_0x2b8136,_0x3dcbd0){return _0x44f662['slice'](_0x2b8136,_0x3dcbd0);}['toLowerCase'](_0x164340){return _0x164340['toLowerCase']();}['toUpperCase'](_0x2680f0){return _0x2680f0['toUpperCase']();}['trim'](_0x519bc9){return _0x519bc9['trim']();}['trimStart'](_0xd1b3c6){return _0xd1b3c6['trimStart']();}['trimEnd'](_0x1e0432){return _0x1e0432['trimEnd']();}['padStart'](_0x4c3dce,_0x195bec,_0x5dc884){return _0x4c3dce['padStart'](_0x195bec,_0x5dc884);}['padEnd'](_0x405ea6,_0x3867ac,_0x22a3ee){return _0x405ea6['padEnd'](_0x3867ac,_0x22a3ee);}['replace'](_0x3cd4eb,_0x14a12a,_0x13e72){return _0x3cd4eb['replace'](_0x14a12a,_0x13e72);}['search'](_0x504fc6,_0x5ce75e){return _0x504fc6['search'](_0x5ce75e);}['substring'](_0x4c6349,_0x1b7d89,_0x2e3899){return _0x4c6349['substring'](_0x1b7d89,_0x2e3899);}['startsWith'](_0x6a5d0e,_0x307787,_0x559c18){return _0x6a5d0e['startsWith'](_0x307787,_0x559c18);}['endsWith'](_0x15cef6,_0x354c35,_0x215e46){return _0x15cef6['endsWith'](_0x354c35,_0x215e46);}['repeat'](_0x53b4ab,_0x3b8fc6){if(_0x3b8fc6<0x0||_0x3b8fc6===Infinity)throw new RangeError('Invalid\x20repeat\x20count.\x20Must\x20be\x20a\x20positive\x20finite\x20number.');return _0x53b4ab['repeat'](_0x3b8fc6);}}exports['StringHandler']=StringHandler;function _0x134f(){var _0xa48f30=['10oTVBWv','95705wnlprS','1jFfisg','166108MFTnVX','4oSgyiy','13203916HhjHVM','366uDkoJR','108rtusju','7369119ziEwjj','7oSNzeS','3205662gByLjj','2803408WzrUOe','2478164rmLQNN'];_0x134f=function(){return _0xa48f30;};return _0x134f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x22ea(){var _0x461ec2=['55jjfBpi','6736IGLyOr','8mCqjbK','2097578RKuhGU','158150GUejjX','348aRUATv','1110420cChWhV','171moZATy','852372kKykQL','6rRXEjg','1110594cYIEKB','13334PbnUuc'];_0x22ea=function(){return _0x461ec2;};return _0x22ea();}(function(_0x44e855,_0x34943d){var _0x3841cf=_0x4d60,_0x2a422d=_0x44e855();while(!![]){try{var _0x3910ec=-parseInt(_0x3841cf(0x145))/0x1*(parseInt(_0x3841cf(0x147))/0x2)+parseInt(_0x3841cf(0x14d))/0x3*(-parseInt(_0x3841cf(0x149))/0x4)+parseInt(_0x3841cf(0x14e))/0x5+-parseInt(_0x3841cf(0x146))/0x6+parseInt(_0x3841cf(0x14b))/0x7*(parseInt(_0x3841cf(0x14a))/0x8)+-parseInt(_0x3841cf(0x14f))/0x9*(parseInt(_0x3841cf(0x14c))/0xa)+parseInt(_0x3841cf(0x148))/0xb*(parseInt(_0x3841cf(0x150))/0xc);if(_0x3910ec===_0x34943d)break;else _0x2a422d['push'](_0x2a422d['shift']());}catch(_0x478e2c){_0x2a422d['push'](_0x2a422d['shift']());}}}(_0x22ea,0x2613b));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['SymbolHandler']=void 0x0;function _0x4d60(_0x10164e,_0xfdd3ae){var _0x22ea73=_0x22ea();return _0x4d60=function(_0x4d60a3,_0x4803c6){_0x4d60a3=_0x4d60a3-0x145;var _0x25ad97=_0x22ea73[_0x4d60a3];return _0x25ad97;},_0x4d60(_0x10164e,_0xfdd3ae);}class SymbolHandler{['null'](){return null;}['undefined'](){return undefined;}['whitespace'](){return'\x20';}['object'](){return{};}['array'](){return[];}['posInfinity'](){return Infinity;}['negInfinity'](){return-Infinity;}['NaN'](){return NaN;}['date'](){return new Date();}}exports['SymbolHandler']=SymbolHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x3801(_0xad08a,_0x558006){var _0x49bfdd=_0x49bf();return _0x3801=function(_0x3801f3,_0x3b9889){_0x3801f3=_0x3801f3-0x11c;var _0x5d96b9=_0x49bfdd[_0x3801f3];return _0x5d96b9;},_0x3801(_0xad08a,_0x558006);}(function(_0x1011fb,_0x442189){var _0x270680=_0x3801,_0x3732b6=_0x1011fb();while(!![]){try{var _0xb9a275=-parseInt(_0x270680(0x11f))/0x1*(-parseInt(_0x270680(0x123))/0x2)+parseInt(_0x270680(0x11c))/0x3+-parseInt(_0x270680(0x11d))/0x4+parseInt(_0x270680(0x120))/0x5*(parseInt(_0x270680(0x11e))/0x6)+parseInt(_0x270680(0x121))/0x7+-parseInt(_0x270680(0x124))/0x8+-parseInt(_0x270680(0x122))/0x9;if(_0xb9a275===_0x442189)break;else _0x3732b6['push'](_0x3732b6['shift']());}catch(_0xe8ae94){_0x3732b6['push'](_0x3732b6['shift']());}}}(_0x49bf,0xd7114));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['UnaryHandler']=void 0x0;class UnaryHandler{['not'](_0x2539f7){return!_0x2539f7;}['positive'](_0x17a88c){return+_0x17a88c;}['negative'](_0x2cc48b){return-_0x2cc48b;}['bitwise_not'](_0x48e54d){return~_0x48e54d;}}function _0x49bf(){var _0x2db35c=['6795530WKEhCb','13903578naqDDb','1994248eLCMDK','9778864nJNpaG','3721869sdfPZA','3993780EMgxAC','84rlwoyk','1osldhg','513580hCsFds'];_0x49bf=function(){return _0x2db35c;};return _0x49bf();}exports['UnaryHandler']=UnaryHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x21d3c0,_0x296aaf){const _0x173afe=_0x3305,_0x306300=_0x21d3c0();while(!![]){try{const _0x11528e=parseInt(_0x173afe(0x172))/0x1+parseInt(_0x173afe(0x177))/0x2+-parseInt(_0x173afe(0x178))/0x3*(parseInt(_0x173afe(0x16f))/0x4)+parseInt(_0x173afe(0x174))/0x5*(parseInt(_0x173afe(0x171))/0x6)+-parseInt(_0x173afe(0x173))/0x7*(parseInt(_0x173afe(0x176))/0x8)+parseInt(_0x173afe(0x170))/0x9*(-parseInt(_0x173afe(0x175))/0xa)+parseInt(_0x173afe(0x179))/0xb;if(_0x11528e===_0x296aaf)break;else _0x306300['push'](_0x306300['shift']());}catch(_0x523817){_0x306300['push'](_0x306300['shift']());}}}(_0xe8b4,0x408b0));function _0x3305(_0x42395b,_0x3b2be5){const _0xe8b48c=_0xe8b4();return _0x3305=function(_0x33052a,_0x56072f){_0x33052a=_0x33052a-0x16f;let _0xbce93f=_0xe8b48c[_0x33052a];return _0xbce93f;},_0x3305(_0x42395b,_0x3b2be5);}var __importDefault=this&&this['__importDefault']||function(_0x8272cc){return _0x8272cc&&_0x8272cc['__esModule']?_0x8272cc:{'default':_0x8272cc};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Pipe']=void 0x0;const functions_1=__importDefault(require('./functions'));class Pipe{constructor(_0x245888,_0x2e8686,_0x40afd1){this['rules']=_0x245888,this['jobData']=_0x2e8686,this['context']=_0x40afd1;}['isPipeType'](_0x1e96a4){return!Array['isArray'](_0x1e96a4)&&'@pipe'in _0x1e96a4;}['isreduceType'](_0x455124){return!Array['isArray'](_0x455124)&&'@reduce'in _0x455124;}static['isPipeObject'](_0x3fe7d0){return typeof _0x3fe7d0==='object'&&_0x3fe7d0!==null&&!Array['isArray'](_0x3fe7d0)&&'@pipe'in _0x3fe7d0;}static['resolve'](_0x2ee0eb,_0x4f8ca3){let _0x5cc874;return Pipe['isPipeObject'](_0x2ee0eb)?_0x5cc874=new Pipe(_0x2ee0eb['@pipe'],_0x4f8ca3):_0x5cc874=new Pipe([[_0x2ee0eb]],_0x4f8ca3),_0x5cc874['process']();}['process'](_0x12d1eb=null){let _0x9774d=0x0;!(_0x12d1eb||this['isPipeType'](this['rules'][0x0])||this['isreduceType'](this['rules'][0x0]))&&(_0x12d1eb=this['processCells'](this['rules'][0x0]),_0x9774d=0x1);const _0x228b96=this['rules']['length'],_0x440484=[];for(let _0x3c7869=_0x9774d;_0x3c7869<_0x228b96;_0x3c7869++){_0x12d1eb=this['processRow'](this['rules'][_0x3c7869],_0x12d1eb,_0x440484);}return _0x12d1eb[0x0];}['cloneUnknown'](_0x39170f){if(_0x39170f===null||typeof _0x39170f!=='object')return _0x39170f;if(_0x39170f instanceof Date)return new Date(_0x39170f['getTime']());if(_0x39170f instanceof RegExp)return new RegExp(_0x39170f);if(Array['isArray'](_0x39170f))return _0x39170f['map'](_0xc013fc=>this['cloneUnknown'](_0xc013fc));const _0x2ccf98={};for(const _0x538e0d in _0x39170f){Object['prototype']['hasOwnProperty']['call'](_0x39170f,_0x538e0d)&&(_0x2ccf98[_0x538e0d]=this['cloneUnknown'](_0x39170f[_0x538e0d]));}return _0x2ccf98;}['reduce'](_0x3c3e8d){let _0xa11e7e=this['cloneUnknown'](_0x3c3e8d[0x1]??null);if(Array['isArray'](_0x3c3e8d[0x0]))for(let _0x4145bd=0x0;_0x4145bd<_0x3c3e8d[0x0]['length'];_0x4145bd++){this['context']={'$input':_0x3c3e8d[0x0],'$output':_0xa11e7e,'$item':_0x3c3e8d[0x0][_0x4145bd],'$key':_0x4145bd['toString'](),'$index':_0x4145bd},_0xa11e7e=this['process']([_0xa11e7e]);}else{let _0x1572ff=-0x1;for(const _0x38a545 in _0x3c3e8d[0x0]){_0x1572ff++,this['context']={'$input':_0x3c3e8d[0x0],'$output':_0xa11e7e,'$item':_0x3c3e8d[0x0][_0x38a545],'$key':_0x38a545,'$index':_0x1572ff},_0xa11e7e=this['process']([_0xa11e7e]);}}return[_0xa11e7e];}['processRow'](_0x648468,_0x31d0dd,_0x364058){if(_0x31d0dd&&this['isreduceType'](_0x648468)){const _0x34084b=new Pipe(_0x648468['@reduce'],this['jobData']),_0x35c1bf=_0x34084b['reduce'](_0x31d0dd);return _0x35c1bf;}else{if(this['isPipeType'](_0x648468)){const _0x10ac7a=new Pipe(_0x648468['@pipe'],this['jobData'],this['context']);return _0x364058['push'](_0x10ac7a['process']()),_0x31d0dd;}else{_0x364058['length']>0x0&&(_0x31d0dd=[..._0x364058],_0x364058['length']=0x0);if(!_0x31d0dd)return[]['concat'](this['processCells'](Array['isArray'](_0x648468)?[..._0x648468]:[]));else{const [_0x1e0c3a,..._0x1bca6a]=_0x648468;let _0x42a7b9;return this['isContextVariable'](_0x1e0c3a)?_0x42a7b9=this['resolveContextValue'](_0x1e0c3a):_0x42a7b9=Pipe['resolveFunction'](_0x1e0c3a)(..._0x31d0dd),[_0x42a7b9]['concat'](this['processCells']([..._0x1bca6a]));}}}}static['resolveFunction'](_0x513fee){let [_0x196549,_0x969ed]=_0x513fee['split']('.');_0x196549=_0x196549['substring'](0x2),_0x969ed=_0x969ed['substring'](0x0,_0x969ed['length']-0x1);const _0x300097=functions_1['default'][_0x196549];if(!_0x300097)throw new Error('Unknown\x20domain\x20name\x20['+_0x513fee+']:\x20'+_0x196549);if(!_0x300097[_0x969ed])throw new Error('Unknown\x20domain\x20function\x20['+_0x513fee+']:\x20'+_0x196549+'.'+_0x969ed);return _0x300097[_0x969ed];}['processCells'](_0x151142){const _0x2aacac=[];if(Array['isArray'](_0x151142))for(const _0xe21281 of _0x151142){_0x2aacac['push'](this['resolveCellValue'](_0xe21281));}return _0x2aacac;}['isFunction'](_0x28a515){return typeof _0x28a515==='string'&&_0x28a515['startsWith']('{@')&&_0x28a515['endsWith']('}');}['isContextVariable'](_0x19faa9){if(typeof _0x19faa9==='string'&&_0x19faa9['endsWith']('}'))return _0x19faa9['startsWith']('{$item')||_0x19faa9['startsWith']('{$key')||_0x19faa9['startsWith']('{$index')||_0x19faa9['startsWith']('{$input')||_0x19faa9['startsWith']('{$output');}['isMappable'](_0xa72b01){return typeof _0xa72b01==='string'&&_0xa72b01['startsWith']('{')&&_0xa72b01['endsWith']('}');}['resolveCellValue'](_0x16b83b){if(this['isFunction'](_0x16b83b)){const _0x2908d1=Pipe['resolveFunction'](_0x16b83b);return _0x2908d1['call']();}else{if(this['isContextVariable'](_0x16b83b))return this['resolveContextValue'](_0x16b83b);else return this['isMappable'](_0x16b83b)?this['resolveMappableValue'](_0x16b83b):_0x16b83b;}}['getNestedProperty'](_0x20eb95,_0x2f810b){const _0x39e109=_0x2f810b['split']('.');let _0x11facf=_0x20eb95;for(const _0x1121d8 of _0x39e109){if(_0x11facf===null||typeof _0x11facf!=='object'||!_0x11facf['hasOwnProperty'](_0x1121d8))return undefined;_0x11facf=_0x11facf[_0x1121d8];}return _0x11facf;}['resolveMappableValue'](_0x587cd1){const _0x4a2a46=this['resolveMapTerm'](_0x587cd1);return this['getNestedProperty'](this['jobData'],_0x4a2a46);}['resolveContextValue'](_0x5ea018){const _0x49a6db=this['resolveContextTerm'](_0x5ea018);return this['getNestedProperty'](this['context'],_0x49a6db);}['resolveContextTerm'](_0xbe699c){return _0xbe699c['substring'](0x1,_0xbe699c['length']-0x1);}['resolveFunctionTerm'](_0x32fe38){return _0x32fe38['substring'](0x2,_0x32fe38['length']-0x1);}['resolveMapTerm'](_0x6749ff){return _0x6749ff['substring'](0x1,_0x6749ff['length']-0x1);}}exports['Pipe']=Pipe;function _0xe8b4(){const _0x3cd709=['7qzlAWF','612455mSXNWi','30ffSzoX','3388744cTkbTO','222348HaaWAG','921OTPtrM','2907377RPkxYy','1124ZhypPI','331677vJtpXx','6CDiRrm','386815TeXicl'];_0xe8b4=function(){return _0x3cd709;};return _0xe8b4();}
|
|
@@ -14,7 +14,7 @@ declare class QuorumService {
|
|
|
14
14
|
engine: EngineService;
|
|
15
15
|
profiles: QuorumProfile[];
|
|
16
16
|
store: StoreService<ProviderClient, ProviderTransaction> | null;
|
|
17
|
-
subscribe: SubService<ProviderClient
|
|
17
|
+
subscribe: SubService<ProviderClient> | null;
|
|
18
18
|
logger: ILogger;
|
|
19
19
|
cacheMode: CacheMode;
|
|
20
20
|
untilVersion: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x10cff6,_0x14479c){const _0x159890=_0x3199,_0x56262f=_0x10cff6();while(!![]){try{const _0x34d658=parseInt(_0x159890(0xd0))/0x1+-parseInt(_0x159890(0xd7))/0x2*(parseInt(_0x159890(0xce))/0x3)+-parseInt(_0x159890(0xd1))/0x4*(-parseInt(_0x159890(0xd3))/0x5)+-parseInt(_0x159890(0xd5))/0x6*(-parseInt(_0x159890(0xd2))/0x7)+parseInt(_0x159890(0xd6))/0x8+parseInt(_0x159890(0xcf))/0x9+-parseInt(_0x159890(0xd4))/0xa;if(_0x34d658===_0x14479c)break;else _0x56262f['push'](_0x56262f['shift']());}catch(_0x4b74d5){_0x56262f['push'](_0x56262f['shift']());}}}(_0x55fc,0xe7189));function _0x3199(_0x287e4d,_0x28d21c){const _0x55fc1a=_0x55fc();return _0x3199=function(_0x319935,_0x45e710){_0x319935=_0x319935-0xce;let _0x2b4564=_0x55fc1a[_0x319935];return _0x2b4564;},_0x3199(_0x287e4d,_0x28d21c);}function _0x55fc(){const _0x482ba0=['6DZZkOP','15668757xVvdzE','554758RJrRme','6967208tbpryH','3084053kdbfaC','5xhVVhx','28311750rRRIiO','6ePvbth','673520LFwRaX','784558DAsmBR'];_0x55fc=function(){return _0x482ba0;};return _0x55fc();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['QuorumService']=void 0x0;const enums_1=require('../../modules/enums'),utils_1=require('../../modules/utils'),compiler_1=require('../compiler'),hotmesh_1=require('../../types/hotmesh'),factory_1=require('../sub/factory'),factory_2=require('../store/factory');class QuorumService{constructor(){this['profiles']=[],this['cacheMode']='cache',this['untilVersion']=null,this['quorum']=null,this['callbacks']=[];}static async['init'](_0x4c3a6f,_0x57ffcb,_0x10db75,_0x213765,_0x2ca7d1,_0x2a4947){if(_0x213765['engine']){const _0x2f76a5=new QuorumService();return _0x2f76a5['verifyQuorumFields'](_0x213765),_0x2f76a5['namespace']=_0x4c3a6f,_0x2f76a5['appId']=_0x57ffcb,_0x2f76a5['guid']=_0x10db75,_0x2f76a5['logger']=_0x2a4947,_0x2f76a5['engine']=_0x2ca7d1,await _0x2f76a5['initStoreChannel'](_0x213765['engine']['store']),await _0x2f76a5['initSubChannel'](_0x213765['engine']['sub'],_0x213765['engine']['pub']),await _0x2f76a5['subscribe']['subscribe'](hotmesh_1['KeyType']['QUORUM'],_0x2f76a5['subscriptionHandler'](),_0x57ffcb),await _0x2f76a5['subscribe']['subscribe'](hotmesh_1['KeyType']['QUORUM'],_0x2f76a5['subscriptionHandler'](),_0x57ffcb,_0x2f76a5['guid']),_0x2f76a5['engine']['processWebHooks'](),_0x2f76a5['engine']['processTimeHooks'](),_0x2f76a5;}}['verifyQuorumFields'](_0x357b16){if(!(0x0,utils_1['identifyProvider'])(_0x357b16['engine']['store'])||!(0x0,utils_1['identifyProvider'])(_0x357b16['engine']['sub']))throw new Error('quorum\x20config\x20must\x20include\x20`store`\x20and\x20`sub`\x20fields.');}async['initStoreChannel'](_0x4d8165){this['store']=await factory_2['StoreServiceFactory']['init'](_0x4d8165,this['namespace'],this['appId'],this['logger']);}async['initSubChannel'](_0x123229,_0xde60df){this['subscribe']=await factory_1['SubServiceFactory']['init'](_0x123229,_0xde60df,this['namespace'],this['appId'],this['guid'],this['logger']);}['subscriptionHandler'](){const _0x1bdf06=this;return async(_0x4d9f97,_0x25a8a8)=>{_0x1bdf06['logger']['debug']('quorum-event-received',{'topic':_0x4d9f97,'type':_0x25a8a8['type']});if(_0x25a8a8['type']==='activate')_0x1bdf06['engine']['setCacheMode'](_0x25a8a8['cache_mode'],_0x25a8a8['until_version']);else{if(_0x25a8a8['type']==='ping')_0x1bdf06['sayPong'](_0x1bdf06['appId'],_0x1bdf06['guid'],_0x25a8a8['originator'],_0x25a8a8['details']);else{if(_0x25a8a8['type']==='pong'&&_0x1bdf06['guid']===_0x25a8a8['originator'])_0x1bdf06['quorum']=_0x1bdf06['quorum']+0x1,_0x25a8a8['profile']&&_0x1bdf06['profiles']['push'](_0x25a8a8['profile']);else{if(_0x25a8a8['type']==='throttle')_0x1bdf06['engine']['throttle'](_0x25a8a8['throttle']);else{if(_0x25a8a8['type']==='work')_0x1bdf06['engine']['processWebHooks']();else{if(_0x25a8a8['type']==='job')_0x1bdf06['engine']['routeToSubscribers'](_0x25a8a8['topic'],_0x25a8a8['job']);else{if(_0x25a8a8['type']==='cron')_0x1bdf06['engine']['processTimeHooks']();else _0x25a8a8['type']==='rollcall'&&_0x1bdf06['doRollCall'](_0x25a8a8);}}}}}}_0x1bdf06['callbacks']['length']>0x0&&_0x1bdf06['callbacks']['forEach'](_0x497502=>_0x497502(_0x4d9f97,_0x25a8a8));};}async['sayPong'](_0x4953cb,_0x1d9ad0,_0x1be3a6,_0x4d2446=![]){let _0x5d30c2;if(_0x4d2446){const _0x5a4640=this['engine']['store']['mintKey'](hotmesh_1['KeyType']['STREAMS'],{'appId':this['appId']});_0x5d30c2={'engine_id':this['guid'],'namespace':this['namespace'],'app_id':this['appId'],'stream':_0x5a4640,'counts':this['engine']['router']['counts'],'timestamp':(0x0,utils_1['formatISODate'])(new Date()),'inited':this['engine']['inited'],'throttle':this['engine']['router']['throttle'],'reclaimDelay':this['engine']['router']['reclaimDelay'],'reclaimCount':this['engine']['router']['reclaimCount'],'system':await(0x0,utils_1['getSystemHealth'])()};}this['subscribe']['publish'](hotmesh_1['KeyType']['QUORUM'],{'type':'pong','guid':_0x1d9ad0,'originator':_0x1be3a6,'profile':_0x5d30c2},_0x4953cb);}async['requestQuorum'](_0x103cc2=enums_1['HMSH_QUORUM_DELAY_MS'],_0x3c8be9=![]){const _0x2b6543=this['quorum'];return this['quorum']=0x0,this['profiles']['length']=0x0,await this['subscribe']['publish'](hotmesh_1['KeyType']['QUORUM'],{'type':'ping','originator':this['guid'],'details':_0x3c8be9},this['appId']),await(0x0,utils_1['sleepFor'])(_0x103cc2),_0x2b6543;}async['doRollCall'](_0x458b9f){let _0xff3acf=0x0;const _0x352c8d=!isNaN(_0x458b9f['max'])?_0x458b9f['max']:enums_1['HMSH_QUORUM_ROLLCALL_CYCLES'];if(this['rollCallInterval'])clearTimeout(this['rollCallInterval']);const _0x354e05=_0x458b9f['interval']/0x2,_0x20eaed=_0x354e05+Math['ceil'](Math['random']()*_0x354e05);do{await(0x0,utils_1['sleepFor'])(Math['ceil'](Math['random']()*0x3e8)),await this['sayPong'](this['appId'],this['guid'],null,!![]);if(!_0x458b9f['interval'])return;const {promise:_0x1125e6,timerId:_0x125c80}=(0x0,utils_1['XSleepFor'])(_0x20eaed*0x3e8);this['rollCallInterval']=_0x125c80,await _0x1125e6;}while(this['rollCallInterval']&&_0xff3acf++<_0x352c8d-0x1);}['cancelRollCall'](){this['rollCallInterval']&&(clearTimeout(this['rollCallInterval']),delete this['rollCallInterval']);}['stop'](){this['cancelRollCall']();}async['pub'](_0x290cb4){return await this['subscribe']['publish'](hotmesh_1['KeyType']['QUORUM'],_0x290cb4,this['appId'],_0x290cb4['topic']||_0x290cb4['guid']);}async['sub'](_0x55184a){this['callbacks']['push'](_0x55184a);}async['unsub'](_0x111a00){this['callbacks']=this['callbacks']['filter'](_0x297ab4=>_0x297ab4!==_0x111a00);}async['rollCall'](_0x1743a4=enums_1['HMSH_QUORUM_DELAY_MS']){await this['requestQuorum'](_0x1743a4,!![]);const _0x123560=await this['engine']['stream']['getStreamDepths'](this['profiles']);return this['profiles']['forEach'](async(_0x40567a,_0x4b6473)=>{_0x40567a['stream_depth']=_0x123560?.[_0x4b6473]?.['depth']??0x0;}),this['profiles'];}async['activate'](_0x25046e,_0x41c1a0=enums_1['HMSH_QUORUM_DELAY_MS'],_0x4261e3=0x0){_0x25046e=_0x25046e['toString']();const _0x22fd6a=await this['store']['reserveScoutRole']('activate',Math['ceil'](_0x41c1a0*0x6/0x3e8)+0x1);if(!_0x22fd6a){this['logger']['debug']('quorum-activation-awaiting',{'version':_0x25046e}),await(0x0,utils_1['sleepFor'])(_0x41c1a0*0x6);const _0x5c4666=await this['store']['getApp'](this['appId'],!![]);return _0x5c4666?.['active']==!![]&&_0x5c4666?.['version']===_0x25046e;}const _0xa55b4b=await this['engine']['getVID']();await this['requestQuorum'](_0x41c1a0);const _0x433cc8=await this['requestQuorum'](_0x41c1a0),_0x369c74=await this['requestQuorum'](_0x41c1a0),_0x556736=await this['requestQuorum'](_0x41c1a0);if(_0x433cc8&&_0x433cc8===_0x369c74&&_0x369c74===_0x556736){this['logger']['info']('quorum-rollcall-succeeded',{'q1':_0x433cc8,'q2':_0x369c74,'q3':_0x556736}),this['subscribe']['publish'](hotmesh_1['KeyType']['QUORUM'],{'type':'activate','cache_mode':'nocache','until_version':_0x25046e},this['appId']),await new Promise(_0x5051bd=>setTimeout(_0x5051bd,_0x41c1a0)),await this['store']['releaseScoutRole']('activate');if(this['engine']['untilVersion']===_0x25046e){this['logger']['info']('quorum-activation-succeeded',{'version':_0x25046e});const {id:_0x5e885f}=_0xa55b4b,_0x3d9c94=new compiler_1['CompilerService'](this['store'],this['engine']['stream'],this['logger']);return await _0x3d9c94['activate'](_0x5e885f,_0x25046e);}else{this['logger']['error']('quorum-activation-error',{'version':_0x25046e});throw new Error('UntilVersion\x20Not\x20Received.\x20Version\x20'+_0x25046e+'\x20not\x20activated');}}else{this['logger']['warn']('quorum-rollcall-error',{'q1':_0x433cc8,'q2':_0x369c74,'q3':_0x556736,'count':_0x4261e3}),this['store']['releaseScoutRole']('activate');if(_0x4261e3<enums_1['HMSH_ACTIVATION_MAX_RETRY'])return await this['activate'](_0x25046e,_0x41c1a0*0x2,_0x4261e3+0x1);throw new Error('Quorum\x20not\x20reached.\x20Version\x20'+_0x25046e+'\x20not\x20activated.');}}}exports['QuorumService']=QuorumService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x55286e,_0x1ab011){const _0x4143b2=_0x4e26,_0x540a60=_0x55286e();while(!![]){try{const _0x378872=-parseInt(_0x4143b2(0x186))/0x1+parseInt(_0x4143b2(0x181))/0x2*(-parseInt(_0x4143b2(0x185))/0x3)+parseInt(_0x4143b2(0x184))/0x4*(-parseInt(_0x4143b2(0x188))/0x5)+parseInt(_0x4143b2(0x189))/0x6+parseInt(_0x4143b2(0x182))/0x7+-parseInt(_0x4143b2(0x183))/0x8*(parseInt(_0x4143b2(0x18a))/0x9)+parseInt(_0x4143b2(0x187))/0xa;if(_0x378872===_0x1ab011)break;else _0x540a60['push'](_0x540a60['shift']());}catch(_0x4c2b46){_0x540a60['push'](_0x540a60['shift']());}}}(_0x53d8,0x2dbd5));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['ReporterService']=void 0x0;const pipe_1=require('../pipe');class ReporterService{constructor(_0x2ab8c1,_0x4c10f3,_0x58c158){this['appVersion']=_0x2ab8c1,this['logger']=_0x58c158,this['store']=_0x4c10f3;}async['getStats'](_0x19d905){this['logger']['debug']('reporter-getstats-started',_0x19d905);const {key:_0x273bc2,granularity:_0x43337d,range:_0x183e30,end:_0x89861b,start:_0x920ce3}=_0x19d905;this['validateOptions'](_0x19d905);const _0x2f31ad=this['generateDateTimeSets'](_0x43337d,_0x183e30,_0x89861b,_0x920ce3),_0x224a70=_0x2f31ad['map'](_0x1a133a=>this['buildRedisKey'](_0x273bc2,_0x1a133a)),_0x474845=await this['store']['getJobStats'](_0x224a70),[_0x41ed63,_0x517a07]=this['aggregateData'](_0x474845),_0x3096b1=this['buildStatsResponse'](_0x474845,_0x224a70,_0x517a07,_0x41ed63,_0x19d905);return _0x3096b1;}['validateOptions'](_0x262c18){const {start:_0x2c36b4,end:_0x169f11,range:_0x4cd37f,granularity:_0x5f15b3}=_0x262c18;if(_0x5f15b3!=='infinity'&&(_0x2c36b4&&_0x169f11&&_0x4cd37f||!_0x2c36b4&&!_0x169f11&&!_0x4cd37f))throw new Error('Invalid\x20combination\x20of\x20start,\x20end,\x20and\x20range\x20values.\x20Provide\x20either\x20start+end,\x20end+range,\x20or\x20start+range.');}['generateDateTimeSets'](_0x2c66b2,_0x3e6cc3,_0x1848a9,_0x27d651){if(_0x2c66b2==='infinity')return['0'];!_0x3e6cc3&&(_0x3e6cc3='0m');const _0x4ee593={'5m':0x5,'10m':0xa,'15m':0xf,'30m':0x1e,'1h':0x3c},_0x1cf639=_0x4ee593[_0x2c66b2];if(!_0x1cf639)throw new Error('Invalid\x20granularity\x20value.');const _0x1cd06f=this['convertRangeToMinutes'](_0x3e6cc3);if(_0x1cd06f===null)throw new Error('Invalid\x20range\x20value.');let _0x1da4e6,_0x14058d;_0x27d651?(_0x1da4e6=new Date(_0x27d651),_0x14058d=new Date(_0x1da4e6['getTime']()+_0x1cd06f*0x3c*0x3e8)):(_0x14058d=_0x1848a9==='NOW'?new Date():new Date(_0x1848a9),_0x1da4e6=new Date(_0x14058d['getTime']()-_0x1cd06f*0x3c*0x3e8));_0x1da4e6['setUTCMinutes'](Math['floor'](_0x1da4e6['getUTCMinutes']()/_0x1cf639)*_0x1cf639);const _0x237518=[];for(let _0x47d5ee=_0x1da4e6;_0x47d5ee<=_0x14058d;_0x47d5ee['setUTCMinutes'](_0x47d5ee['getUTCMinutes']()+_0x1cf639)){const _0xb79a9a=[_0x47d5ee['getUTCFullYear'](),String(_0x47d5ee['getUTCMonth']()+0x1)['padStart'](0x2,'0'),String(_0x47d5ee['getUTCDate']())['padStart'](0x2,'0'),String(_0x47d5ee['getUTCHours']())['padStart'](0x2,'0'),String(_0x47d5ee['getUTCMinutes']())['padStart'](0x2,'0')]['join']('');_0x237518['push'](_0xb79a9a);}return _0x237518;}['convertRangeToMinutes'](_0x77c769){const _0x4875da=_0x77c769['slice'](-0x1),_0x318937=parseInt(_0x77c769['slice'](0x0,-0x1),0xa);if(isNaN(_0x318937))return null;switch(_0x4875da){case'm':return _0x318937;case'h':return _0x318937*0x3c;case'd':return _0x318937*0x3c*0x18;default:return null;}}['buildRedisKey'](_0x4756aa,_0x559e37,_0x23c30e=''){return'hmsh:'+this['appVersion']['id']+':s:'+_0x4756aa+':'+_0x559e37+(_0x23c30e?':'+_0x23c30e:'');}['aggregateData'](_0x42f28c){const _0x373e07={};let _0x3fd790=0x0;return Object['entries'](_0x42f28c)['forEach'](([_0x395cb5,_0x57b244])=>{for(const _0x152332 in _0x57b244){if(_0x152332['startsWith']('count:')){const _0x1fe1e8=_0x152332['slice']('count:'['length']);!_0x373e07[_0x1fe1e8]&&(_0x373e07[_0x1fe1e8]=0x0),_0x373e07[_0x1fe1e8]+=_0x57b244[_0x152332];}else _0x152332==='count'&&(_0x3fd790+=_0x57b244[_0x152332]);}}),[_0x3fd790,_0x373e07];}['buildStatsResponse'](_0x1e3772,_0x5ce8e6,_0x1580d0,_0x3600dd,_0x395707){const _0x4321ac=[],_0x390b47=Object['keys'](_0x1580d0)['filter'](_0x4d0794=>_0x4d0794!=='count');let _0x4a79d8=undefined;_0x395707['sparse']!==!![]&&(_0x4a79d8=this['handleSegments'](_0x1e3772,_0x5ce8e6));_0x390b47['forEach'](_0x2a2abf=>{const _0x2fb732={'target':_0x2a2abf,'type':'count','value':_0x1580d0[_0x2a2abf]};_0x4321ac['push'](_0x2fb732);});const _0x36f330={'key':_0x395707['key'],'granularity':_0x395707['granularity'],'range':_0x395707['range'],'end':_0x395707['end'],'count':_0x3600dd,'measures':_0x4321ac};return _0x4a79d8&&(_0x36f330['segments']=_0x4a79d8),_0x36f330;}['handleSegments'](_0x29c11d,_0x4f106c){const _0x4e7b66=[];return _0x4f106c['forEach']((_0x2bfe02,_0x303edb)=>{const _0x321879=[];_0x29c11d[_0x2bfe02]&&Object['entries'](_0x29c11d[_0x2bfe02])['forEach'](([_0x1207a0,_0x96a449])=>{if(_0x1207a0['startsWith']('count:')){const _0x4a4d77=_0x1207a0['slice']('count:'['length']);_0x321879['push']({'target':_0x4a4d77,'type':'count','value':_0x96a449});}});const _0x465716=this['isoTimestampFromKeyTimestamp'](_0x2bfe02),_0x1f310c=_0x29c11d[_0x2bfe02]?_0x29c11d[_0x2bfe02]['count']:0x0;_0x4e7b66['push']({'count':_0x1f310c,'time':_0x465716,'measures':_0x321879});}),_0x4e7b66;}['isoTimestampFromKeyTimestamp'](_0x1ed0cf){if(_0x1ed0cf['endsWith'](':'))return'0';const _0x1ebfbc=_0x1ed0cf['slice'](-0xc),_0x462449=_0x1ebfbc['slice'](0x0,0x4),_0x1ba501=_0x1ebfbc['slice'](0x4,0x6),_0x59cea2=_0x1ebfbc['slice'](0x6,0x8),_0x41916a=_0x1ebfbc['slice'](0x8,0xa),_0x181dbe=_0x1ebfbc['slice'](0xa,0xc);return _0x462449+'-'+_0x1ba501+'-'+_0x59cea2+'T'+_0x41916a+':'+_0x181dbe+'Z';}async['getIds'](_0x4f062b,_0x406d7a,_0x38deb3=[0x0,-0x1]){if(!_0x406d7a['length']){const _0x4496b3=await this['getStats'](_0x4f062b);_0x406d7a=this['getUniqueFacets'](_0x4496b3);}const {key:_0x311809,granularity:_0xc666e4,range:_0x23905b,end:_0x188bfe,start:_0x311ab8}=_0x4f062b;this['validateOptions'](_0x4f062b);let _0x156c3b=[];_0x406d7a['forEach'](_0x12007b=>{const _0x4e0ad1=this['generateDateTimeSets'](_0xc666e4,_0x23905b,_0x188bfe,_0x311ab8);_0x156c3b=_0x156c3b['concat'](_0x4e0ad1['map'](_0xe9139b=>this['buildRedisKey'](_0x311809,_0xe9139b,'index:'+_0x12007b)));});const _0x133f3e=await this['store']['getJobIds'](_0x156c3b,_0x38deb3),_0x1fb135=this['buildIdsResponse'](_0x133f3e,_0x4f062b,_0x406d7a);return _0x1fb135;}['buildIdsResponse'](_0x5bb089,_0x5a3f98,_0xc2ce9c){const _0x12be91={},_0x622b98=Object['keys'](_0x5bb089);_0x622b98['forEach'](_0x368936=>{const _0x5a6b2e=this['getTargetForKey'](_0x368936),_0x118432=_0x5bb089[_0x368936]['length'];_0x12be91[_0x5a6b2e]?_0x12be91[_0x5a6b2e]+=_0x118432:_0x12be91[_0x5a6b2e]=_0x118432;});const _0x56c553=Object['entries'](_0x12be91)['map'](([_0x12cbb6,_0x2a2ca2])=>({'facet':_0x12cbb6,'count':_0x2a2ca2})),_0x147a8c={'key':_0x5a3f98['key'],'facets':_0xc2ce9c,'granularity':_0x5a3f98['granularity'],'range':_0x5a3f98['range'],'start':_0x5a3f98['start'],'counts':_0x56c553,'segments':this['buildTimeSegments'](_0x5bb089)};return _0x147a8c;}['buildTimeSegments'](_0x342b95){const _0x2e440b=Object['keys'](_0x342b95),_0x5100a2={};_0x2e440b['forEach'](_0x2a2738=>{const _0x6fdc36={'type':'ids','target':this['getTargetForKey'](_0x2a2738),'time':this['isoTimestampFromKeyTimestamp'](this['getTargetForTime'](_0x2a2738)),'count':_0x342b95[_0x2a2738]['length'],'ids':_0x342b95[_0x2a2738]};_0x5100a2[_0x6fdc36['time']]?_0x5100a2[_0x6fdc36['time']]['push'](_0x6fdc36):_0x5100a2[_0x6fdc36['time']]=[_0x6fdc36];});const _0x1a0afd=Object['entries'](_0x5100a2)['map'](([_0x3be7e9,_0x24180f])=>({'time':_0x3be7e9,'measures':_0x24180f}));return _0x1a0afd;}['getUniqueFacets'](_0x1c5956){const _0x308099=_0x1c5956['measures']['map'](_0x44a54b=>_0x44a54b['target']);return Array['from'](new Set(_0x308099));}['getTargetForKey'](_0x57e9bd){return _0x57e9bd['split'](':index:')[0x1];}['getTargetForTime'](_0x42c7a6){return _0x42c7a6['split'](':index:')[0x0];}async['getWorkItems'](_0x2b21a8,_0xb8e7c2){if(!_0xb8e7c2['length']){const _0x4d1a07=await this['getStats'](_0x2b21a8);_0xb8e7c2=this['getUniqueFacets'](_0x4d1a07);}const {key:_0x1465cb,granularity:_0x5e3f7b,range:_0x154e83,end:_0x353941,start:_0x58cfe0}=_0x2b21a8;this['validateOptions'](_0x2b21a8);let _0x29528d=[];_0xb8e7c2['forEach'](_0xb497f8=>{const _0x4e8446=this['generateDateTimeSets'](_0x5e3f7b,_0x154e83,_0x353941,_0x58cfe0);_0x29528d=_0x29528d['concat'](_0x4e8446['map'](_0x53c856=>this['buildRedisKey'](_0x1465cb,_0x53c856,'index:'+_0xb497f8)));});const _0x5f26ef=await this['store']['getJobIds'](_0x29528d,[0x0,0x1]),_0x424e23=this['buildWorkerLists'](_0x5f26ef);return _0x424e23;}['buildWorkerLists'](_0x196d22){const _0x19aec5=[];for(const _0x305faf in _0x196d22){_0x196d22[_0x305faf]['length']&&_0x19aec5['push'](_0x305faf);}return _0x19aec5;}['resolveTriggerStatistics']({stats:_0x4ca68b},_0x1ca005){const _0x2de260={'general':[],'index':[],'median':[]};_0x2de260['general']['push']({'metric':'count','target':'count','value':0x1});for(const _0x1e1856 of _0x4ca68b['measures']){const _0xd1e8ab=this['resolveMetric']({'metric':_0x1e1856['measure'],'target':_0x1e1856['target']},_0x1ca005);if(this['isGeneralMetric'](_0x1e1856['measure']))_0x2de260['general']['push'](_0xd1e8ab);else{if(this['isMedianMetric'](_0x1e1856['measure']))_0x2de260['median']['push'](_0xd1e8ab);else this['isIndexMetric'](_0x1e1856['measure'])&&_0x2de260['index']['push'](_0xd1e8ab);}}return _0x2de260;}['isGeneralMetric'](_0x21ea4b){return ReporterService['isGeneralMetric'](_0x21ea4b);}['isMedianMetric'](_0x35d28a){return ReporterService['isMedianMetric'](_0x35d28a);}['isIndexMetric'](_0x37710e){return ReporterService['isIndexMetric'](_0x37710e);}static['isGeneralMetric'](_0x45b415){return _0x45b415==='sum'||_0x45b415==='avg'||_0x45b415==='count';}static['isMedianMetric'](_0x4fd16d){return _0x4fd16d==='mdn';}static['isIndexMetric'](_0x1cd21c){return _0x1cd21c==='index';}['resolveMetric']({metric:_0x1321f6,target:_0x32581e},_0x4de36c){const _0x377cb3=new pipe_1['Pipe']([[_0x32581e]],_0x4de36c),_0x11c139=_0x377cb3['process']()['toString'](),_0x3279eb=this['resolveTarget'](_0x1321f6,_0x32581e,_0x11c139);if(_0x1321f6==='index')return{'metric':_0x1321f6,'target':_0x3279eb,'value':_0x4de36c['metadata']['jid']};else{if(_0x1321f6==='count')return{'metric':_0x1321f6,'target':_0x3279eb,'value':0x1};}return{'metric':_0x1321f6,'target':_0x3279eb,'value':_0x11c139};}['isCardinalMetric'](_0x12b23b){return _0x12b23b==='index'||_0x12b23b==='count';}['resolveTarget'](_0x3c5ea9,_0x18b64a,_0x31003d){const _0x166962=_0x18b64a['substring'](0x1,_0x18b64a['length']-0x1),_0x23afc6=_0x166962['split']('.')['slice'](0x3)['join']('/');let _0x22b807;return this['isCardinalMetric'](_0x3c5ea9)?_0x22b807=_0x3c5ea9+':'+_0x23afc6+':'+_0x31003d:_0x22b807=_0x3c5ea9+':'+_0x23afc6,_0x22b807;}}function _0x4e26(_0x40c533,_0x584e3e){const _0x53d8e5=_0x53d8();return _0x4e26=function(_0x4e2620,_0x3a7cd5){_0x4e2620=_0x4e2620-0x181;let _0x232c72=_0x53d8e5[_0x4e2620];return _0x232c72;},_0x4e26(_0x40c533,_0x584e3e);}exports['ReporterService']=ReporterService,ReporterService['DEFAULT_GRANULARITY']='5m';function _0x53d8(){const _0x11df6e=['3712nUCeIq','762056pugjHD','192138AWucXr','286373xsfYnJ','7902540YrFGav','5MqrPqb','159912ECXkbD','5526ukEiIO','4PKEGgF','1822226MFHJax'];_0x53d8=function(){return _0x11df6e;};return _0x53d8();}
|
|
1
|
+
'use strict';(function(_0x1c5db7,_0x3620d1){const _0x22b3e0=_0x306d,_0x170a24=_0x1c5db7();while(!![]){try{const _0x37f09e=parseInt(_0x22b3e0(0xa4))/0x1*(-parseInt(_0x22b3e0(0xa5))/0x2)+-parseInt(_0x22b3e0(0xa9))/0x3*(-parseInt(_0x22b3e0(0xa8))/0x4)+-parseInt(_0x22b3e0(0xa2))/0x5+-parseInt(_0x22b3e0(0xa7))/0x6+parseInt(_0x22b3e0(0xaa))/0x7*(-parseInt(_0x22b3e0(0xa3))/0x8)+-parseInt(_0x22b3e0(0xa1))/0x9*(parseInt(_0x22b3e0(0xa6))/0xa)+parseInt(_0x22b3e0(0xa0))/0xb;if(_0x37f09e===_0x3620d1)break;else _0x170a24['push'](_0x170a24['shift']());}catch(_0x31c3aa){_0x170a24['push'](_0x170a24['shift']());}}}(_0xac0a,0xa1ffa));function _0x306d(_0x1299fe,_0x17b6d8){const _0xac0a72=_0xac0a();return _0x306d=function(_0x306d16,_0x20f8a2){_0x306d16=_0x306d16-0xa0;let _0x166e83=_0xac0a72[_0x306d16];return _0x166e83;},_0x306d(_0x1299fe,_0x17b6d8);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['ReporterService']=void 0x0;const pipe_1=require('../pipe');class ReporterService{constructor(_0x4273dc,_0x314f5f,_0x2d52f1){this['appVersion']=_0x4273dc,this['logger']=_0x2d52f1,this['store']=_0x314f5f;}async['getStats'](_0xb6faf){this['logger']['debug']('reporter-getstats-started',_0xb6faf);const {key:_0x5d42e7,granularity:_0x302b55,range:_0x3dfd2e,end:_0x2f1e55,start:_0x4e71b5}=_0xb6faf;this['validateOptions'](_0xb6faf);const _0x1db53c=this['generateDateTimeSets'](_0x302b55,_0x3dfd2e,_0x2f1e55,_0x4e71b5),_0xeffa66=_0x1db53c['map'](_0x237be6=>this['buildRedisKey'](_0x5d42e7,_0x237be6)),_0x445f51=await this['store']['getJobStats'](_0xeffa66),[_0x5cd6d6,_0x3f6dc5]=this['aggregateData'](_0x445f51),_0x34749c=this['buildStatsResponse'](_0x445f51,_0xeffa66,_0x3f6dc5,_0x5cd6d6,_0xb6faf);return _0x34749c;}['validateOptions'](_0x209ebf){const {start:_0x2b8bf1,end:_0x24b791,range:_0x52dff5,granularity:_0x193a67}=_0x209ebf;if(_0x193a67!=='infinity'&&(_0x2b8bf1&&_0x24b791&&_0x52dff5||!_0x2b8bf1&&!_0x24b791&&!_0x52dff5))throw new Error('Invalid\x20combination\x20of\x20start,\x20end,\x20and\x20range\x20values.\x20Provide\x20either\x20start+end,\x20end+range,\x20or\x20start+range.');}['generateDateTimeSets'](_0x2a0e04,_0x54063e,_0x4bb8ea,_0x31f87d){if(_0x2a0e04==='infinity')return['0'];!_0x54063e&&(_0x54063e='0m');const _0x595f9f={'5m':0x5,'10m':0xa,'15m':0xf,'30m':0x1e,'1h':0x3c},_0x1669c9=_0x595f9f[_0x2a0e04];if(!_0x1669c9)throw new Error('Invalid\x20granularity\x20value.');const _0x79d0b6=this['convertRangeToMinutes'](_0x54063e);if(_0x79d0b6===null)throw new Error('Invalid\x20range\x20value.');let _0x101891,_0x1dcfa5;_0x31f87d?(_0x101891=new Date(_0x31f87d),_0x1dcfa5=new Date(_0x101891['getTime']()+_0x79d0b6*0x3c*0x3e8)):(_0x1dcfa5=_0x4bb8ea==='NOW'?new Date():new Date(_0x4bb8ea),_0x101891=new Date(_0x1dcfa5['getTime']()-_0x79d0b6*0x3c*0x3e8));_0x101891['setUTCMinutes'](Math['floor'](_0x101891['getUTCMinutes']()/_0x1669c9)*_0x1669c9);const _0x129296=[];for(let _0x8909ee=_0x101891;_0x8909ee<=_0x1dcfa5;_0x8909ee['setUTCMinutes'](_0x8909ee['getUTCMinutes']()+_0x1669c9)){const _0x3440b2=[_0x8909ee['getUTCFullYear'](),String(_0x8909ee['getUTCMonth']()+0x1)['padStart'](0x2,'0'),String(_0x8909ee['getUTCDate']())['padStart'](0x2,'0'),String(_0x8909ee['getUTCHours']())['padStart'](0x2,'0'),String(_0x8909ee['getUTCMinutes']())['padStart'](0x2,'0')]['join']('');_0x129296['push'](_0x3440b2);}return _0x129296;}['convertRangeToMinutes'](_0x65c34e){const _0x951d43=_0x65c34e['slice'](-0x1),_0x90323e=parseInt(_0x65c34e['slice'](0x0,-0x1),0xa);if(isNaN(_0x90323e))return null;switch(_0x951d43){case'm':return _0x90323e;case'h':return _0x90323e*0x3c;case'd':return _0x90323e*0x3c*0x18;default:return null;}}['buildRedisKey'](_0x1bae76,_0x134cb3,_0x2915d1=''){return'hmsh:'+this['appVersion']['id']+':s:'+_0x1bae76+':'+_0x134cb3+(_0x2915d1?':'+_0x2915d1:'');}['aggregateData'](_0x35a6a6){const _0x152003={};let _0x561f32=0x0;return Object['entries'](_0x35a6a6)['forEach'](([_0x3749d5,_0x179c08])=>{for(const _0x581ab7 in _0x179c08){if(_0x581ab7['startsWith']('count:')){const _0x2462d3=_0x581ab7['slice']('count:'['length']);!_0x152003[_0x2462d3]&&(_0x152003[_0x2462d3]=0x0),_0x152003[_0x2462d3]+=_0x179c08[_0x581ab7];}else _0x581ab7==='count'&&(_0x561f32+=_0x179c08[_0x581ab7]);}}),[_0x561f32,_0x152003];}['buildStatsResponse'](_0x338441,_0x46e3e8,_0x12e3da,_0x105521,_0x2558fd){const _0x31a300=[],_0x3f7e25=Object['keys'](_0x12e3da)['filter'](_0x305713=>_0x305713!=='count');let _0x4e06e4=undefined;_0x2558fd['sparse']!==!![]&&(_0x4e06e4=this['handleSegments'](_0x338441,_0x46e3e8));_0x3f7e25['forEach'](_0x463e59=>{const _0x518a0f={'target':_0x463e59,'type':'count','value':_0x12e3da[_0x463e59]};_0x31a300['push'](_0x518a0f);});const _0x54c976={'key':_0x2558fd['key'],'granularity':_0x2558fd['granularity'],'range':_0x2558fd['range'],'end':_0x2558fd['end'],'count':_0x105521,'measures':_0x31a300};return _0x4e06e4&&(_0x54c976['segments']=_0x4e06e4),_0x54c976;}['handleSegments'](_0x28d5b9,_0x3c1314){const _0x55cb27=[];return _0x3c1314['forEach']((_0x1fe170,_0x2a7a53)=>{const _0xdfd7b7=[];_0x28d5b9[_0x1fe170]&&Object['entries'](_0x28d5b9[_0x1fe170])['forEach'](([_0xc7d0e4,_0x1a63b3])=>{if(_0xc7d0e4['startsWith']('count:')){const _0x4f9702=_0xc7d0e4['slice']('count:'['length']);_0xdfd7b7['push']({'target':_0x4f9702,'type':'count','value':_0x1a63b3});}});const _0x44f19b=this['isoTimestampFromKeyTimestamp'](_0x1fe170),_0x14a100=_0x28d5b9[_0x1fe170]?_0x28d5b9[_0x1fe170]['count']:0x0;_0x55cb27['push']({'count':_0x14a100,'time':_0x44f19b,'measures':_0xdfd7b7});}),_0x55cb27;}['isoTimestampFromKeyTimestamp'](_0x26d913){if(_0x26d913['endsWith'](':'))return'0';const _0x567c36=_0x26d913['slice'](-0xc),_0x18fbc6=_0x567c36['slice'](0x0,0x4),_0x1e6154=_0x567c36['slice'](0x4,0x6),_0x43b286=_0x567c36['slice'](0x6,0x8),_0x12ec9e=_0x567c36['slice'](0x8,0xa),_0x3ee0c0=_0x567c36['slice'](0xa,0xc);return _0x18fbc6+'-'+_0x1e6154+'-'+_0x43b286+'T'+_0x12ec9e+':'+_0x3ee0c0+'Z';}async['getIds'](_0x267c42,_0x142444,_0x160156=[0x0,-0x1]){if(!_0x142444['length']){const _0x15d72c=await this['getStats'](_0x267c42);_0x142444=this['getUniqueFacets'](_0x15d72c);}const {key:_0x462fd5,granularity:_0x3c42bc,range:_0x33b45a,end:_0x1e399d,start:_0x285cbf}=_0x267c42;this['validateOptions'](_0x267c42);let _0x4cfa32=[];_0x142444['forEach'](_0x1b03e8=>{const _0x1fb051=this['generateDateTimeSets'](_0x3c42bc,_0x33b45a,_0x1e399d,_0x285cbf);_0x4cfa32=_0x4cfa32['concat'](_0x1fb051['map'](_0x40d916=>this['buildRedisKey'](_0x462fd5,_0x40d916,'index:'+_0x1b03e8)));});const _0x4106db=await this['store']['getJobIds'](_0x4cfa32,_0x160156),_0x1c8f20=this['buildIdsResponse'](_0x4106db,_0x267c42,_0x142444);return _0x1c8f20;}['buildIdsResponse'](_0x1d4fb6,_0x192beb,_0x41e1c0){const _0x824328={},_0xdc3986=Object['keys'](_0x1d4fb6);_0xdc3986['forEach'](_0x567fe8=>{const _0x4b57f1=this['getTargetForKey'](_0x567fe8),_0x43f367=_0x1d4fb6[_0x567fe8]['length'];_0x824328[_0x4b57f1]?_0x824328[_0x4b57f1]+=_0x43f367:_0x824328[_0x4b57f1]=_0x43f367;});const _0x344344=Object['entries'](_0x824328)['map'](([_0x3a3a4b,_0x4f69aa])=>({'facet':_0x3a3a4b,'count':_0x4f69aa})),_0x2f4014={'key':_0x192beb['key'],'facets':_0x41e1c0,'granularity':_0x192beb['granularity'],'range':_0x192beb['range'],'start':_0x192beb['start'],'counts':_0x344344,'segments':this['buildTimeSegments'](_0x1d4fb6)};return _0x2f4014;}['buildTimeSegments'](_0x464d7c){const _0x266a37=Object['keys'](_0x464d7c),_0x47bbc8={};_0x266a37['forEach'](_0x5303ab=>{const _0x4c429a={'type':'ids','target':this['getTargetForKey'](_0x5303ab),'time':this['isoTimestampFromKeyTimestamp'](this['getTargetForTime'](_0x5303ab)),'count':_0x464d7c[_0x5303ab]['length'],'ids':_0x464d7c[_0x5303ab]};_0x47bbc8[_0x4c429a['time']]?_0x47bbc8[_0x4c429a['time']]['push'](_0x4c429a):_0x47bbc8[_0x4c429a['time']]=[_0x4c429a];});const _0x537601=Object['entries'](_0x47bbc8)['map'](([_0x924e9a,_0x33289b])=>({'time':_0x924e9a,'measures':_0x33289b}));return _0x537601;}['getUniqueFacets'](_0x2456b2){const _0x23ff92=_0x2456b2['measures']['map'](_0x4de743=>_0x4de743['target']);return Array['from'](new Set(_0x23ff92));}['getTargetForKey'](_0x3f4565){return _0x3f4565['split'](':index:')[0x1];}['getTargetForTime'](_0x2595bc){return _0x2595bc['split'](':index:')[0x0];}async['getWorkItems'](_0x5444c5,_0x1ea397){if(!_0x1ea397['length']){const _0x2838d6=await this['getStats'](_0x5444c5);_0x1ea397=this['getUniqueFacets'](_0x2838d6);}const {key:_0x194d4a,granularity:_0x583f47,range:_0x468395,end:_0xe00e41,start:_0x17dd0b}=_0x5444c5;this['validateOptions'](_0x5444c5);let _0x1b118c=[];_0x1ea397['forEach'](_0x4441af=>{const _0x58dca9=this['generateDateTimeSets'](_0x583f47,_0x468395,_0xe00e41,_0x17dd0b);_0x1b118c=_0x1b118c['concat'](_0x58dca9['map'](_0x282735=>this['buildRedisKey'](_0x194d4a,_0x282735,'index:'+_0x4441af)));});const _0x4843d8=await this['store']['getJobIds'](_0x1b118c,[0x0,0x1]),_0x355099=this['buildWorkerLists'](_0x4843d8);return _0x355099;}['buildWorkerLists'](_0x3ede15){const _0x1b2586=[];for(const _0x36d8d0 in _0x3ede15){_0x3ede15[_0x36d8d0]['length']&&_0x1b2586['push'](_0x36d8d0);}return _0x1b2586;}['resolveTriggerStatistics']({stats:_0x160ff4},_0x4013f9){const _0x136183={'general':[],'index':[],'median':[]};_0x136183['general']['push']({'metric':'count','target':'count','value':0x1});for(const _0x571094 of _0x160ff4['measures']){const _0x24d2a2=this['resolveMetric']({'metric':_0x571094['measure'],'target':_0x571094['target']},_0x4013f9);if(this['isGeneralMetric'](_0x571094['measure']))_0x136183['general']['push'](_0x24d2a2);else{if(this['isMedianMetric'](_0x571094['measure']))_0x136183['median']['push'](_0x24d2a2);else this['isIndexMetric'](_0x571094['measure'])&&_0x136183['index']['push'](_0x24d2a2);}}return _0x136183;}['isGeneralMetric'](_0x52a8a1){return ReporterService['isGeneralMetric'](_0x52a8a1);}['isMedianMetric'](_0xd3b3c5){return ReporterService['isMedianMetric'](_0xd3b3c5);}['isIndexMetric'](_0x2f75f9){return ReporterService['isIndexMetric'](_0x2f75f9);}static['isGeneralMetric'](_0xc15858){return _0xc15858==='sum'||_0xc15858==='avg'||_0xc15858==='count';}static['isMedianMetric'](_0x34fdcb){return _0x34fdcb==='mdn';}static['isIndexMetric'](_0x451fd4){return _0x451fd4==='index';}['resolveMetric']({metric:_0x57a81b,target:_0x15876c},_0x1f7f00){const _0x476c53=new pipe_1['Pipe']([[_0x15876c]],_0x1f7f00),_0x2f80e5=_0x476c53['process']()['toString'](),_0x255e60=this['resolveTarget'](_0x57a81b,_0x15876c,_0x2f80e5);if(_0x57a81b==='index')return{'metric':_0x57a81b,'target':_0x255e60,'value':_0x1f7f00['metadata']['jid']};else{if(_0x57a81b==='count')return{'metric':_0x57a81b,'target':_0x255e60,'value':0x1};}return{'metric':_0x57a81b,'target':_0x255e60,'value':_0x2f80e5};}['isCardinalMetric'](_0x4457b0){return _0x4457b0==='index'||_0x4457b0==='count';}['resolveTarget'](_0x21a3d7,_0x1671af,_0x1570e9){const _0x132f0f=_0x1671af['substring'](0x1,_0x1671af['length']-0x1),_0x1dcd33=_0x132f0f['split']('.')['slice'](0x3)['join']('/');let _0x5a041b;return this['isCardinalMetric'](_0x21a3d7)?_0x5a041b=_0x21a3d7+':'+_0x1dcd33+':'+_0x1570e9:_0x5a041b=_0x21a3d7+':'+_0x1dcd33,_0x5a041b;}}exports['ReporterService']=ReporterService,ReporterService['DEFAULT_GRANULARITY']='5m';function _0xac0a(){const _0x567dd7=['48181408fwPaor','1935OrrCXV','5801075QcnpYX','112YUxLkM','715129TTynvz','2MASynW','61510xJFcMH','3922344qKDjQX','3048996FpTPdq','3JCmABM','313649xbROOb'];_0xac0a=function(){return _0x567dd7;};return _0xac0a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x5bc452,_0x1ba928){const _0x1238ec=_0x5359,_0x1fb604=_0x5bc452();while(!![]){try{const _0x2e0e44=-parseInt(_0x1238ec(0x199))/0x1+parseInt(_0x1238ec(0x19a))/0x2*(parseInt(_0x1238ec(0x196))/0x3)+-parseInt(_0x1238ec(0x194))/0x4+-parseInt(_0x1238ec(0x192))/0x5+parseInt(_0x1238ec(0x198))/0x6*(-parseInt(_0x1238ec(0x195))/0x7)+-parseInt(_0x1238ec(0x197))/0x8+parseInt(_0x1238ec(0x193))/0x9;if(_0x2e0e44===_0x1ba928)break;else _0x1fb604['push'](_0x1fb604['shift']());}catch(_0xa19f57){_0x1fb604['push'](_0x1fb604['shift']());}}}(_0x3fad,0xb80a0));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Router']=void 0x0;function _0x5359(_0x5a63c4,_0x39691a){const _0x3fade2=_0x3fad();return _0x5359=function(_0x535911,_0x7a9405){_0x535911=_0x535911-0x192;let _0xb161a4=_0x3fade2[_0x535911];return _0xb161a4;},_0x5359(_0x5a63c4,_0x39691a);}const enums_1=require('../../modules/enums'),key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream');class Router{constructor(_0x156a0e,_0x1b3c86,_0x41d8b6){this['throttle']=0x0,this['errorCount']=0x0,this['counts']={},this['currentTimerId']=null,this['sleepPromiseResolve']=null,this['innerPromiseResolve']=null,this['isSleeping']=![],this['sleepTimout']=null,this['appId']=_0x156a0e['appId'],this['guid']=_0x156a0e['guid'],this['role']=_0x156a0e['role'],this['topic']=_0x156a0e['topic'],this['stream']=_0x1b3c86,this['throttle']=_0x156a0e['throttle'],this['reclaimDelay']=_0x156a0e['reclaimDelay']||enums_1['HMSH_XCLAIM_DELAY_MS'],this['reclaimCount']=_0x156a0e['reclaimCount']||enums_1['HMSH_XCLAIM_COUNT'],this['logger']=_0x41d8b6,this['readonly']=_0x156a0e['readonly']||![],this['resetThrottleState']();}['resetThrottleState'](){this['sleepPromiseResolve']=null,this['innerPromiseResolve']=null,this['isSleeping']=![],this['sleepTimout']=null;}async['createGroup'](_0x41ef9c,_0x2693e2){try{await this['stream']['createConsumerGroup'](_0x41ef9c,_0x2693e2);}catch(_0x57e176){this['logger']['debug']('router-stream-group-exists',{'stream':_0x41ef9c,'group':_0x2693e2});}}async['publishMessage'](_0x35da43,_0x3cd437,_0x2e6313){const _0x3915f7=_0x3cd437?.['code']||'200';this['counts'][_0x3915f7]=(this['counts'][_0x3915f7]||0x0)+0x1;const _0x10f7be=this['stream']['mintKey'](key_1['KeyType']['STREAMS'],{'topic':_0x35da43}),_0xf301e4=await this['stream']['publishMessages'](_0x10f7be,[JSON['stringify'](_0x3cd437)],{'transaction':_0x2e6313});return _0xf301e4[0x0];}async['customSleep'](){if(this['throttle']===0x0)return;if(this['isSleeping'])return;this['isSleeping']=!![];const _0x5c6363=Date['now']();await new Promise(async _0x2a9552=>{this['sleepPromiseResolve']=_0x2a9552;let _0x330f20=Date['now']()-_0x5c6363;while(_0x330f20<this['throttle']){await new Promise(_0x55b734=>{this['innerPromiseResolve']=_0x55b734,this['sleepTimout']=setTimeout(_0x55b734,this['throttle']-_0x330f20);}),_0x330f20=Date['now']()-_0x5c6363;}this['resetThrottleState'](),_0x2a9552();});}async['consumeMessages'](_0x5e997b,_0x56020a,_0x5b3a90,_0x4d62cd){if(this['readonly']){this['logger']['info']('router-stream-readonly',{'group':_0x56020a,'consumer':_0x5b3a90,'stream':_0x5e997b});return;}this['logger']['info']('router-stream-starting',{'group':_0x56020a,'consumer':_0x5b3a90,'stream':_0x5e997b}),Router['instances']['add'](this),this['shouldConsume']=!![],await this['createGroup'](_0x5e997b,_0x56020a);let _0xc6a3d3=Date['now']();async function _0x8fd7f3(){await this['customSleep']();if(this['isStopped'](_0x56020a,_0x5b3a90,_0x5e997b))return;else{if(this['isPaused']()){setImmediate(_0x8fd7f3['bind'](this));return;}}const _0x16e274=enums_1['HMSH_BLOCK_TIME_MS']+Math['round'](enums_1['HMSH_BLOCK_TIME_MS']*Math['random']());try{const _0x3ad484=await this['stream']['consumeMessages'](_0x5e997b,_0x56020a,_0x5b3a90,{'blockTimeout':_0x16e274});if(this['isStopped'](_0x56020a,_0x5b3a90,_0x5e997b))return;else{if(this['isPaused']()){setImmediate(_0x8fd7f3['bind'](this));return;}}for(let _0x5379e0=0x0;_0x5379e0<_0x3ad484['length'];_0x5379e0++){const _0x320067=_0x3ad484[_0x5379e0];await this['consumeOne'](_0x5e997b,_0x56020a,_0x320067['id'],_0x320067['data'],_0x4d62cd);}const _0x126fd8=Date['now']();if(this['stream']['getProviderSpecificFeatures']()['supportsRetry']&&_0x126fd8-_0xc6a3d3>this['reclaimDelay']){_0xc6a3d3=_0x126fd8;const _0x1ea44a=await this['stream']['retryMessages'](_0x5e997b,_0x56020a,{'consumerName':_0x5b3a90,'minIdleTime':this['reclaimDelay'],'limit':enums_1['HMSH_XPENDING_COUNT']});for(let _0x26ddbe=0x0;_0x26ddbe<_0x1ea44a['length'];_0x26ddbe++){const _0x32a37b=_0x1ea44a[_0x26ddbe];await this['consumeOne'](_0x5e997b,_0x56020a,_0x32a37b['id'],_0x32a37b['data'],_0x4d62cd);}}setImmediate(_0x8fd7f3['bind'](this));}catch(_0x686ea7){if(this['shouldConsume']&&process['env']['NODE_ENV']!=='test'){this['logger']['error']('router-stream-error',{'err':_0x686ea7,'stream':_0x5e997b,'group':_0x56020a,'consumer':_0x5b3a90}),this['errorCount']++;const _0x10bc72=Math['min'](enums_1['HMSH_GRADUATED_INTERVAL_MS']*0x2**this['errorCount'],enums_1['HMSH_MAX_TIMEOUT_MS']);setTimeout(_0x8fd7f3['bind'](this),_0x10bc72);}}}_0x8fd7f3['call'](this);}['isStreamMessage'](_0x4ff639){return Array['isArray'](_0x4ff639)&&Array['isArray'](_0x4ff639[0x0]);}['isPaused'](){return this['throttle']===enums_1['MAX_DELAY'];}['isStopped'](_0x41b6e4,_0x1c415c,_0x2c69be){return!this['shouldConsume']&&this['logger']['info']('router-stream-stopped',{'group':_0x41b6e4,'consumer':_0x1c415c,'stream':_0x2c69be}),!this['shouldConsume'];}async['consumeOne'](_0x2e9cc8,_0x337a62,_0x13fe1d,_0x263ee6,_0x12ff89){this['logger']['debug']('stream-read-one',{'group':_0x337a62,'stream':_0x2e9cc8,'id':_0x13fe1d});let _0x1b7484,_0x11d025;try{_0x11d025=new telemetry_1['TelemetryService'](this['appId']),_0x11d025['startStreamSpan'](_0x263ee6,this['role']),_0x1b7484=await this['execStreamLeg'](_0x263ee6,_0x2e9cc8,_0x13fe1d,_0x12ff89['bind'](this)),_0x1b7484?.['status']===stream_1['StreamStatus']['ERROR']&&_0x11d025['setStreamError']('Function\x20Status\x20Code\x20'+(_0x1b7484['code']||enums_1['HMSH_CODE_UNKNOWN'])),this['errorCount']=0x0;}catch(_0x242bfc){this['logger']['error']('stream-read-one-error',{'group':_0x337a62,'stream':_0x2e9cc8,'id':_0x13fe1d,'err':_0x242bfc}),_0x11d025['setStreamError'](_0x242bfc['message']);}const _0x360dc0=await this['publishResponse'](_0x263ee6,_0x1b7484);_0x11d025['setStreamAttributes']({'app.worker.mid':_0x360dc0}),await this['ackAndDelete'](_0x2e9cc8,_0x337a62,_0x13fe1d),_0x11d025['endStreamSpan'](),this['logger']['debug']('stream-read-one-end',{'group':_0x337a62,'stream':_0x2e9cc8,'id':_0x13fe1d});}async['execStreamLeg'](_0xd3fee5,_0x52e716,_0x1fceac,_0x3676c3){let _0x25c9e7;try{_0x25c9e7=await _0x3676c3(_0xd3fee5);}catch(_0x46dbeb){this['logger']['error']('stream-call-function-error',{..._0x46dbeb,'input':_0xd3fee5,'stack':_0x46dbeb['stack'],'message':_0x46dbeb['message'],'name':_0x46dbeb['name'],'stream':_0x52e716,'id':_0x1fceac}),_0x25c9e7=this['structureUnhandledError'](_0xd3fee5,_0x46dbeb);}return _0x25c9e7;}async['ackAndDelete'](_0x5f2541,_0x17391c,_0x1fbb89){await this['stream']['ackAndDelete'](_0x5f2541,_0x17391c,[_0x1fbb89]);}async['publishResponse'](_0x12e55d,_0x359ab2){if(_0x359ab2&&typeof _0x359ab2==='object'){if(_0x359ab2['status']==='error'){const [_0x32fb77,_0x56a9ea]=this['shouldRetry'](_0x12e55d,_0x359ab2);if(_0x32fb77)return await(0x0,utils_1['sleepFor'])(_0x56a9ea),await this['publishMessage'](_0x12e55d['metadata']['topic'],{'data':_0x12e55d['data'],'metadata':{..._0x12e55d['metadata'],'try':(_0x12e55d['metadata']['try']||0x0)+0x1},'policies':_0x12e55d['policies']});else _0x359ab2=this['structureError'](_0x12e55d,_0x359ab2);}else typeof _0x359ab2['metadata']!=='object'?_0x359ab2['metadata']={..._0x12e55d['metadata'],'guid':(0x0,utils_1['guid'])()}:_0x359ab2['metadata']['guid']=(0x0,utils_1['guid'])();return _0x359ab2['type']=stream_1['StreamDataType']['RESPONSE'],await this['publishMessage'](null,_0x359ab2);}}['shouldRetry'](_0x39b63c,_0x327b0d){const _0x45de63=_0x39b63c['policies']?.['retry'],_0x4ab624=_0x327b0d['code']['toString'](),_0x4ed5b9=_0x45de63?.[_0x4ab624],_0x548f6f=_0x4ed5b9?.[0x0],_0x4d0710=Math['min'](_0x39b63c['metadata']['try']||0x0,enums_1['HMSH_MAX_RETRIES']);if(_0x548f6f>_0x4d0710)return[!![],Math['pow'](0xa,_0x4d0710+0x1)];return[![],0x0];}['structureUnhandledError'](_0x2deaec,_0x79b70f){const _0x4fcd75={};return typeof _0x79b70f['message']==='string'?_0x4fcd75['message']=_0x79b70f['message']:_0x4fcd75['message']=enums_1['HMSH_STATUS_UNKNOWN'],typeof _0x79b70f['stack']==='string'&&(_0x4fcd75['stack']=_0x79b70f['stack']),typeof _0x79b70f['name']==='string'&&(_0x4fcd75['name']=_0x79b70f['name']),{'status':'error','code':enums_1['HMSH_CODE_UNKNOWN'],'metadata':{..._0x2deaec['metadata'],'guid':(0x0,utils_1['guid'])()},'data':_0x4fcd75};}['structureUnacknowledgedError'](_0x392f59){const _0x55a4ef='stream\x20message\x20max\x20delivery\x20count\x20exceeded',_0x4f4695=enums_1['HMSH_CODE_UNACKED'],_0x3aab79={'message':_0x55a4ef,'code':_0x4f4695},_0x2ab7b8={'metadata':{..._0x392f59['metadata'],'guid':(0x0,utils_1['guid'])()},'status':stream_1['StreamStatus']['ERROR'],'code':_0x4f4695,'data':_0x3aab79};return delete _0x2ab7b8['metadata']['topic'],_0x2ab7b8;}['structureError'](_0x373ac3,_0x5b7a19){const _0x35757c=_0x5b7a19['data']?.['message']?_0x5b7a19['data']?.['message']['toString']():enums_1['HMSH_STATUS_UNKNOWN'],_0x419016=_0x5b7a19['code']||_0x5b7a19['data']?.['code'],_0xe29c83=isNaN(_0x419016)?enums_1['HMSH_CODE_UNKNOWN']:parseInt(_0x419016['toString']()),_0x56a73b=_0x5b7a19['data']?.['stack']?_0x5b7a19['data']?.['stack']['toString']():undefined,_0x2dfcbf={'message':_0x35757c,'code':_0xe29c83,'stack':_0x56a73b};return typeof _0x5b7a19['data']?.['error']==='object'&&(_0x2dfcbf['error']={..._0x5b7a19['data']['error']}),{'status':stream_1['StreamStatus']['ERROR'],'code':_0xe29c83,'stack':_0x56a73b,'metadata':{..._0x373ac3['metadata'],'guid':(0x0,utils_1['guid'])()},'data':_0x2dfcbf};}static async['stopConsuming'](){for(const _0xfd9630 of[...Router['instances']]){_0xfd9630['stopConsuming']();}await(0x0,utils_1['sleepFor'])(enums_1['HMSH_BLOCK_TIME_MS']*0x2);}async['stopConsuming'](){this['shouldConsume']=![],this['logger']['info']('router-stream-stopping',this['topic']?{'topic':this['topic']}:undefined),this['cancelThrottle']();}['cancelThrottle'](){this['sleepTimout']&&clearTimeout(this['sleepTimout']),this['resetThrottleState']();}['setThrottle'](_0x18d160){if(!Number['isInteger'](_0x18d160)||_0x18d160<0x0||_0x18d160>enums_1['MAX_DELAY'])throw new Error('Throttle\x20must\x20be\x20a\x20non-negative\x20integer\x20and\x20not\x20exceed\x20'+enums_1['MAX_DELAY']+'\x20ms;\x20send\x20-1\x20to\x20throttle\x20indefinitely');const _0x8da065=_0x18d160<this['throttle'];this['throttle']=_0x18d160,_0x8da065&&(this['sleepTimout']&&clearTimeout(this['sleepTimout']),this['innerPromiseResolve']&&this['innerPromiseResolve']());}}exports['Router']=Router,Router['instances']=new Set();function _0x3fad(){const _0x3b3c42=['42570090NutREX','1907568gToHcF','1269107LGNLPs','36LFaSlV','4871224qMrPvG','48BdVeBJ','1124928GlwPvh','129466zxKGjQ','5459255GqMhAK'];_0x3fad=function(){return _0x3b3c42;};return _0x3fad();}
|
|
1
|
+
'use strict';(function(_0x58037e,_0x66d11b){const _0x2add12=_0x517e,_0x3fbc79=_0x58037e();while(!![]){try{const _0x50372a=parseInt(_0x2add12(0x15d))/0x1+parseInt(_0x2add12(0x15f))/0x2*(-parseInt(_0x2add12(0x15b))/0x3)+parseInt(_0x2add12(0x161))/0x4*(parseInt(_0x2add12(0x15a))/0x5)+parseInt(_0x2add12(0x160))/0x6*(parseInt(_0x2add12(0x15c))/0x7)+-parseInt(_0x2add12(0x163))/0x8*(parseInt(_0x2add12(0x164))/0x9)+-parseInt(_0x2add12(0x15e))/0xa+parseInt(_0x2add12(0x162))/0xb;if(_0x50372a===_0x66d11b)break;else _0x3fbc79['push'](_0x3fbc79['shift']());}catch(_0x4890b2){_0x3fbc79['push'](_0x3fbc79['shift']());}}}(_0x14d1,0xadac6));function _0x517e(_0x38cc30,_0x5ed1ea){const _0x14d1cc=_0x14d1();return _0x517e=function(_0x517e10,_0x1ec087){_0x517e10=_0x517e10-0x15a;let _0x2e7102=_0x14d1cc[_0x517e10];return _0x2e7102;},_0x517e(_0x38cc30,_0x5ed1ea);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Router']=void 0x0;const enums_1=require('../../modules/enums'),key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream');function _0x14d1(){const _0x27e69d=['131218sDapii','1472802OtKAGw','9868vFTMhQ','14684703ceJZPV','8iBZjDU','4871187aDpXSn','1030JeUKak','39yfSphh','7qRkNnE','1216135HlgEvr','11992510hnyuhf'];_0x14d1=function(){return _0x27e69d;};return _0x14d1();}class Router{constructor(_0x14d2f8,_0x378c24,_0x3c275d){this['throttle']=0x0,this['errorCount']=0x0,this['counts']={},this['currentTimerId']=null,this['sleepPromiseResolve']=null,this['innerPromiseResolve']=null,this['isSleeping']=![],this['sleepTimout']=null,this['appId']=_0x14d2f8['appId'],this['guid']=_0x14d2f8['guid'],this['role']=_0x14d2f8['role'],this['topic']=_0x14d2f8['topic'],this['stream']=_0x378c24,this['throttle']=_0x14d2f8['throttle'],this['reclaimDelay']=_0x14d2f8['reclaimDelay']||enums_1['HMSH_XCLAIM_DELAY_MS'],this['reclaimCount']=_0x14d2f8['reclaimCount']||enums_1['HMSH_XCLAIM_COUNT'],this['logger']=_0x3c275d,this['readonly']=_0x14d2f8['readonly']||![],this['resetThrottleState']();}['resetThrottleState'](){this['sleepPromiseResolve']=null,this['innerPromiseResolve']=null,this['isSleeping']=![],this['sleepTimout']=null;}async['createGroup'](_0x33059b,_0x25e22){try{await this['stream']['createConsumerGroup'](_0x33059b,_0x25e22);}catch(_0x1d21b4){this['logger']['debug']('router-stream-group-exists',{'stream':_0x33059b,'group':_0x25e22});}}async['publishMessage'](_0x5f0578,_0x33f4b6,_0x161f9a){const _0x53fed1=_0x33f4b6?.['code']||'200';this['counts'][_0x53fed1]=(this['counts'][_0x53fed1]||0x0)+0x1;const _0x17df8c=this['stream']['mintKey'](key_1['KeyType']['STREAMS'],{'topic':_0x5f0578}),_0x26698b=await this['stream']['publishMessages'](_0x17df8c,[JSON['stringify'](_0x33f4b6)],{'transaction':_0x161f9a});return _0x26698b[0x0];}async['customSleep'](){if(this['throttle']===0x0)return;if(this['isSleeping'])return;this['isSleeping']=!![];const _0x31bc30=Date['now']();await new Promise(async _0x15e919=>{this['sleepPromiseResolve']=_0x15e919;let _0x163948=Date['now']()-_0x31bc30;while(_0x163948<this['throttle']){await new Promise(_0x4b169c=>{this['innerPromiseResolve']=_0x4b169c,this['sleepTimout']=setTimeout(_0x4b169c,this['throttle']-_0x163948);}),_0x163948=Date['now']()-_0x31bc30;}this['resetThrottleState'](),_0x15e919();});}async['consumeMessages'](_0x25f74a,_0x10b84f,_0x230b63,_0x297f28){if(this['readonly']){this['logger']['info']('router-stream-readonly',{'group':_0x10b84f,'consumer':_0x230b63,'stream':_0x25f74a});return;}this['logger']['info']('router-stream-starting',{'group':_0x10b84f,'consumer':_0x230b63,'stream':_0x25f74a}),Router['instances']['add'](this),this['shouldConsume']=!![],await this['createGroup'](_0x25f74a,_0x10b84f);let _0x24748e=Date['now']();async function _0x1b270a(){await this['customSleep']();if(this['isStopped'](_0x10b84f,_0x230b63,_0x25f74a))return;else{if(this['isPaused']()){setImmediate(_0x1b270a['bind'](this));return;}}const _0x415a0e=enums_1['HMSH_BLOCK_TIME_MS']+Math['round'](enums_1['HMSH_BLOCK_TIME_MS']*Math['random']());try{const _0x4c3ae1=await this['stream']['consumeMessages'](_0x25f74a,_0x10b84f,_0x230b63,{'blockTimeout':_0x415a0e});if(this['isStopped'](_0x10b84f,_0x230b63,_0x25f74a))return;else{if(this['isPaused']()){setImmediate(_0x1b270a['bind'](this));return;}}for(let _0x50bf40=0x0;_0x50bf40<_0x4c3ae1['length'];_0x50bf40++){const _0x343505=_0x4c3ae1[_0x50bf40];await this['consumeOne'](_0x25f74a,_0x10b84f,_0x343505['id'],_0x343505['data'],_0x297f28);}const _0x177825=Date['now']();if(this['stream']['getProviderSpecificFeatures']()['supportsRetry']&&_0x177825-_0x24748e>this['reclaimDelay']){_0x24748e=_0x177825;const _0x56497c=await this['stream']['retryMessages'](_0x25f74a,_0x10b84f,{'consumerName':_0x230b63,'minIdleTime':this['reclaimDelay'],'limit':enums_1['HMSH_XPENDING_COUNT']});for(let _0x2d784d=0x0;_0x2d784d<_0x56497c['length'];_0x2d784d++){const _0x36e75a=_0x56497c[_0x2d784d];await this['consumeOne'](_0x25f74a,_0x10b84f,_0x36e75a['id'],_0x36e75a['data'],_0x297f28);}}setImmediate(_0x1b270a['bind'](this));}catch(_0x19c5dd){if(this['shouldConsume']&&process['env']['NODE_ENV']!=='test'){this['logger']['error']('router-stream-error',{'err':_0x19c5dd,'stream':_0x25f74a,'group':_0x10b84f,'consumer':_0x230b63}),this['errorCount']++;const _0x41f6c7=Math['min'](enums_1['HMSH_GRADUATED_INTERVAL_MS']*0x2**this['errorCount'],enums_1['HMSH_MAX_TIMEOUT_MS']);setTimeout(_0x1b270a['bind'](this),_0x41f6c7);}}}_0x1b270a['call'](this);}['isStreamMessage'](_0x82e190){return Array['isArray'](_0x82e190)&&Array['isArray'](_0x82e190[0x0]);}['isPaused'](){return this['throttle']===enums_1['MAX_DELAY'];}['isStopped'](_0x305872,_0x1a37e2,_0x18a2a9){return!this['shouldConsume']&&this['logger']['info']('router-stream-stopped',{'group':_0x305872,'consumer':_0x1a37e2,'stream':_0x18a2a9}),!this['shouldConsume'];}async['consumeOne'](_0x1cf898,_0x92fc6c,_0x43b662,_0x3d57b9,_0x294bac){this['logger']['debug']('stream-read-one',{'group':_0x92fc6c,'stream':_0x1cf898,'id':_0x43b662});let _0x3b1ff9,_0x243160;try{_0x243160=new telemetry_1['TelemetryService'](this['appId']),_0x243160['startStreamSpan'](_0x3d57b9,this['role']),_0x3b1ff9=await this['execStreamLeg'](_0x3d57b9,_0x1cf898,_0x43b662,_0x294bac['bind'](this)),_0x3b1ff9?.['status']===stream_1['StreamStatus']['ERROR']&&_0x243160['setStreamError']('Function\x20Status\x20Code\x20'+(_0x3b1ff9['code']||enums_1['HMSH_CODE_UNKNOWN'])),this['errorCount']=0x0;}catch(_0x360080){this['logger']['error']('stream-read-one-error',{'group':_0x92fc6c,'stream':_0x1cf898,'id':_0x43b662,'err':_0x360080}),_0x243160['setStreamError'](_0x360080['message']);}const _0xdf73d9=await this['publishResponse'](_0x3d57b9,_0x3b1ff9);_0x243160['setStreamAttributes']({'app.worker.mid':_0xdf73d9}),await this['ackAndDelete'](_0x1cf898,_0x92fc6c,_0x43b662),_0x243160['endStreamSpan'](),this['logger']['debug']('stream-read-one-end',{'group':_0x92fc6c,'stream':_0x1cf898,'id':_0x43b662});}async['execStreamLeg'](_0xd78e57,_0xb1b656,_0x1c4960,_0x18a371){let _0x534bcd;try{_0x534bcd=await _0x18a371(_0xd78e57);}catch(_0x2f495c){this['logger']['error']('stream-call-function-error',{..._0x2f495c,'input':_0xd78e57,'stack':_0x2f495c['stack'],'message':_0x2f495c['message'],'name':_0x2f495c['name'],'stream':_0xb1b656,'id':_0x1c4960}),_0x534bcd=this['structureUnhandledError'](_0xd78e57,_0x2f495c);}return _0x534bcd;}async['ackAndDelete'](_0x50ef92,_0x2cea1e,_0x709d14){await this['stream']['ackAndDelete'](_0x50ef92,_0x2cea1e,[_0x709d14]);}async['publishResponse'](_0x4a32c5,_0x10163c){if(_0x10163c&&typeof _0x10163c==='object'){if(_0x10163c['status']==='error'){const [_0x152642,_0x52f739]=this['shouldRetry'](_0x4a32c5,_0x10163c);if(_0x152642)return await(0x0,utils_1['sleepFor'])(_0x52f739),await this['publishMessage'](_0x4a32c5['metadata']['topic'],{'data':_0x4a32c5['data'],'metadata':{..._0x4a32c5['metadata'],'try':(_0x4a32c5['metadata']['try']||0x0)+0x1},'policies':_0x4a32c5['policies']});else _0x10163c=this['structureError'](_0x4a32c5,_0x10163c);}else typeof _0x10163c['metadata']!=='object'?_0x10163c['metadata']={..._0x4a32c5['metadata'],'guid':(0x0,utils_1['guid'])()}:_0x10163c['metadata']['guid']=(0x0,utils_1['guid'])();return _0x10163c['type']=stream_1['StreamDataType']['RESPONSE'],await this['publishMessage'](null,_0x10163c);}}['shouldRetry'](_0xede35,_0x3d1dae){const _0x1dd6a0=_0xede35['policies']?.['retry'],_0x10dafa=_0x3d1dae['code']['toString'](),_0x27e87c=_0x1dd6a0?.[_0x10dafa],_0x57b6a3=_0x27e87c?.[0x0],_0x5a0e41=Math['min'](_0xede35['metadata']['try']||0x0,enums_1['HMSH_MAX_RETRIES']);if(_0x57b6a3>_0x5a0e41)return[!![],Math['pow'](0xa,_0x5a0e41+0x1)];return[![],0x0];}['structureUnhandledError'](_0x3f813f,_0x33a00c){const _0x12a200={};return typeof _0x33a00c['message']==='string'?_0x12a200['message']=_0x33a00c['message']:_0x12a200['message']=enums_1['HMSH_STATUS_UNKNOWN'],typeof _0x33a00c['stack']==='string'&&(_0x12a200['stack']=_0x33a00c['stack']),typeof _0x33a00c['name']==='string'&&(_0x12a200['name']=_0x33a00c['name']),{'status':'error','code':enums_1['HMSH_CODE_UNKNOWN'],'metadata':{..._0x3f813f['metadata'],'guid':(0x0,utils_1['guid'])()},'data':_0x12a200};}['structureUnacknowledgedError'](_0x1da482){const _0x304c81='stream\x20message\x20max\x20delivery\x20count\x20exceeded',_0x262b32=enums_1['HMSH_CODE_UNACKED'],_0x2a9590={'message':_0x304c81,'code':_0x262b32},_0x329761={'metadata':{..._0x1da482['metadata'],'guid':(0x0,utils_1['guid'])()},'status':stream_1['StreamStatus']['ERROR'],'code':_0x262b32,'data':_0x2a9590};return delete _0x329761['metadata']['topic'],_0x329761;}['structureError'](_0x5eb25c,_0x5a9480){const _0xe5ff9d=_0x5a9480['data']?.['message']?_0x5a9480['data']?.['message']['toString']():enums_1['HMSH_STATUS_UNKNOWN'],_0x6e45a2=_0x5a9480['code']||_0x5a9480['data']?.['code'],_0x262a87=isNaN(_0x6e45a2)?enums_1['HMSH_CODE_UNKNOWN']:parseInt(_0x6e45a2['toString']()),_0x473dff=_0x5a9480['data']?.['stack']?_0x5a9480['data']?.['stack']['toString']():undefined,_0xc42208={'message':_0xe5ff9d,'code':_0x262a87,'stack':_0x473dff};return typeof _0x5a9480['data']?.['error']==='object'&&(_0xc42208['error']={..._0x5a9480['data']['error']}),{'status':stream_1['StreamStatus']['ERROR'],'code':_0x262a87,'stack':_0x473dff,'metadata':{..._0x5eb25c['metadata'],'guid':(0x0,utils_1['guid'])()},'data':_0xc42208};}static async['stopConsuming'](){for(const _0x3a2b4f of[...Router['instances']]){_0x3a2b4f['stopConsuming']();}await(0x0,utils_1['sleepFor'])(enums_1['HMSH_BLOCK_TIME_MS']*0x2);}async['stopConsuming'](){this['shouldConsume']=![],this['logger']['info']('router-stream-stopping',this['topic']?{'topic':this['topic']}:undefined),this['cancelThrottle']();}['cancelThrottle'](){this['sleepTimout']&&clearTimeout(this['sleepTimout']),this['resetThrottleState']();}['setThrottle'](_0x336a05){if(!Number['isInteger'](_0x336a05)||_0x336a05<0x0||_0x336a05>enums_1['MAX_DELAY'])throw new Error('Throttle\x20must\x20be\x20a\x20non-negative\x20integer\x20and\x20not\x20exceed\x20'+enums_1['MAX_DELAY']+'\x20ms;\x20send\x20-1\x20to\x20throttle\x20indefinitely');const _0x4d1968=_0x336a05<this['throttle'];this['throttle']=_0x336a05,_0x4d1968&&(this['sleepTimout']&&clearTimeout(this['sleepTimout']),this['innerPromiseResolve']&&this['innerPromiseResolve']());}}exports['Router']=Router,Router['instances']=new Set();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x3509a0,_0x1bd16c){const _0x17299b=_0x4dd0,_0x3c3d85=_0x3509a0();while(!![]){try{const _0x12b40b=parseInt(_0x17299b(0x7b))/0x1+parseInt(_0x17299b(0x80))/0x2*(-parseInt(_0x17299b(0x83))/0x3)+-parseInt(_0x17299b(0x82))/0x4*(-parseInt(_0x17299b(0x7a))/0x5)+parseInt(_0x17299b(0x7c))/0x6+-parseInt(_0x17299b(0x81))/0x7+-parseInt(_0x17299b(0x84))/0x8*(-parseInt(_0x17299b(0x7d))/0x9)+parseInt(_0x17299b(0x7f))/0xa*(-parseInt(_0x17299b(0x7e))/0xb);if(_0x12b40b===_0x1bd16c)break;else _0x3c3d85['push'](_0x3c3d85['shift']());}catch(_0x18d918){_0x3c3d85['push'](_0x3c3d85['shift']());}}}(_0x7d28,0x9faa0));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['PostgresSearchService']=void 0x0;const index_1=require('../../index'),kvsql_1=require('../../../store/providers/postgres/kvsql');function _0x7d28(){const _0x25d6fd=['263961sZTSaP','11rzVCGq','11659090AGanmD','2dcXFck','1494703PYbKlV','72zmVxNE','411951mAfRji','48XoGtlD','246955ZCwsui','314839CiqyNP','4745328xtxaaE'];_0x7d28=function(){return _0x25d6fd;};return _0x7d28();}class PostgresSearchService extends index_1['SearchService']{['transact'](){return this['storeClient']['transact']();}constructor(_0x419dc3,_0x2bb274){super(_0x419dc3,_0x2bb274),this['pgClient']=_0x419dc3,this['searchClient']=new kvsql_1['KVSQL'](_0x419dc3,this['namespace'],this['appId']);}async['init'](_0x513b50,_0x1d0c5b,_0x45a3a9){this['searchClient']['namespace']=this['namespace']=_0x513b50,this['searchClient']['appId']=this['appId']=_0x1d0c5b,this['namespace']=_0x513b50,this['appId']=_0x1d0c5b,this['logger']=_0x45a3a9;}async['createSearchIndex'](_0x2c89f6,_0x1bdb42,_0x12e1a3){}async['listSearchIndexes'](){return[];}async['setFields'](_0x2cf9bc,_0x52269e){try{const _0x6eeb66=await this['searchClient']['hset'](_0x2cf9bc,_0x52269e);return Number(_0x6eeb66);}catch(_0x2e9b57){this['logger']['error']('postgres-search-set-fields-error',{'key':_0x2cf9bc,..._0x2e9b57});throw _0x2e9b57;}}async['getField'](_0x48dce7,_0x85ab8d){try{return await this['searchClient']['hget'](_0x48dce7,_0x85ab8d);}catch(_0x27653c){this['logger']['error']('postgres-search-get-field-error',{'key':_0x48dce7,'field':_0x85ab8d,..._0x27653c});throw _0x27653c;}}async['getFields'](_0x461d15,_0x5ef3b4){try{return await this['searchClient']['hmget'](_0x461d15,[..._0x5ef3b4]);}catch(_0x2d7cb9){this['logger']['error']('postgres-search-get-fields-error',{'key':_0x461d15,'fields':_0x5ef3b4,..._0x2d7cb9});throw _0x2d7cb9;}}async['getAllFields'](_0x1869b4){try{return await this['searchClient']['hgetall'](_0x1869b4);}catch(_0x1c6221){this['logger']['error']('postgres-search-get-all-fields-error',{'key':_0x1869b4,..._0x1c6221});throw _0x1c6221;}}async['deleteFields'](_0x5b8431,_0xc0105a){try{const _0x358e1c=await this['searchClient']['hdel'](_0x5b8431,_0xc0105a);return Number(_0x358e1c);}catch(_0x33f345){this['logger']['error']('postgres-search-delete-fields-error',{'key':_0x5b8431,'fields':_0xc0105a,..._0x33f345});throw _0x33f345;}}async['incrementFieldByFloat'](_0x39b801,_0x5226f5,_0x51d680){try{const _0x21ebe5=await this['searchClient']['hincrbyfloat'](_0x39b801,_0x5226f5,_0x51d680);return Number(_0x21ebe5);}catch(_0xb6eb5f){this['logger']['error']('postgres-increment-field-error',{'key':_0x39b801,'field':_0x5226f5,..._0xb6eb5f});throw _0xb6eb5f;}}async['sendQuery'](_0x3bedd4){try{return await this['pgClient']['query'](_0x3bedd4);}catch(_0x2003b8){this['logger']['error']('postgres-send-query-error',{'query':_0x3bedd4,..._0x2003b8});throw _0x2003b8;}}async['sendIndexedQuery'](_0x42f080,_0x14732c=[]){const [_0x3f997c,..._0x1e81f9]=_0x14732c;try{const _0x19a685=await this['pgClient']['query'](_0x3f997c,_0x1e81f9['length']?_0x1e81f9:undefined);return _0x19a685['rows'];}catch(_0x5c2fe7){this['logger']['error']('postgres-send-indexed-query-error',{'query':_0x3f997c,..._0x5c2fe7});throw _0x5c2fe7;}}}function _0x4dd0(_0x45c027,_0xa70e0){const _0x7d2855=_0x7d28();return _0x4dd0=function(_0x4dd0d9,_0x236158){_0x4dd0d9=_0x4dd0d9-0x7a;let _0x332f00=_0x7d2855[_0x4dd0d9];return _0x332f00;},_0x4dd0(_0x45c027,_0xa70e0);}exports['PostgresSearchService']=PostgresSearchService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x494f20,_0x4a99d3){const _0x213eb6=_0x1d46,_0x2e0741=_0x494f20();while(!![]){try{const _0x37d6f9=parseInt(_0x213eb6(0x148))/0x1*(parseInt(_0x213eb6(0x14a))/0x2)+parseInt(_0x213eb6(0x147))/0x3*(parseInt(_0x213eb6(0x151))/0x4)+parseInt(_0x213eb6(0x152))/0x5*(-parseInt(_0x213eb6(0x14c))/0x6)+parseInt(_0x213eb6(0x14d))/0x7*(-parseInt(_0x213eb6(0x14b))/0x8)+-parseInt(_0x213eb6(0x14e))/0x9+parseInt(_0x213eb6(0x150))/0xa+parseInt(_0x213eb6(0x14f))/0xb*(parseInt(_0x213eb6(0x149))/0xc);if(_0x37d6f9===_0x4a99d3)break;else _0x2e0741['push'](_0x2e0741['shift']());}catch(_0x49b34e){_0x2e0741['push'](_0x2e0741['shift']());}}}(_0x3d18,0xcd701));function _0x1d46(_0x55b8f6,_0x6601ee){const _0x3d181b=_0x3d18();return _0x1d46=function(_0x1d46dd,_0x260a6d){_0x1d46dd=_0x1d46dd-0x147;let _0x39d5f9=_0x3d181b[_0x1d46dd];return _0x39d5f9;},_0x1d46(_0x55b8f6,_0x6601ee);}function _0x3d18(){const _0x4fd2a4=['12nnwQOy','283622LmdUlm','32mlxfPd','6iigSiL','2880808jjUoGB','5859927btevOw','15657037NCAdhX','6914900yhrYNX','4IUoIQI','3201295wegMcf','2014431QJUlvB','7fSmRLP'];_0x3d18=function(){return _0x4fd2a4;};return _0x3d18();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['IORedisSearchService']=void 0x0;const index_1=require('../../index');class IORedisSearchService extends index_1['SearchService']{constructor(_0x1adfd6,_0x16b1fe){super(_0x1adfd6,_0x16b1fe);}async['init'](_0x1d9cac,_0x288a09,_0x2fd836){this['namespace']=_0x1d9cac,this['appId']=_0x288a09,this['logger']=_0x2fd836;}async['createSearchIndex'](_0x368c79,_0xb26d25,_0x58f43f){try{await this['searchClient']['call']('FT.CREATE',_0x368c79,'ON','HASH','PREFIX',_0xb26d25['length']['toString'](),..._0xb26d25,'SCHEMA',..._0x58f43f);}catch(_0x30de80){this['logger']['info']('Error\x20creating\x20search\x20index',{'error':_0x30de80});throw _0x30de80;}}async['listSearchIndexes'](){try{const _0xae971=await this['searchClient']['call']('FT._LIST');return _0xae971;}catch(_0x9f6510){this['logger']['info']('Error\x20listing\x20search\x20indexes',{'error':_0x9f6510});throw _0x9f6510;}}async['setFields'](_0x7593fb,_0x38593e){try{const _0x186d6a=await this['searchClient']['hset'](_0x7593fb,_0x38593e);return Number(_0x186d6a);}catch(_0x253f83){this['logger']['error']('Error\x20setting\x20fields\x20for\x20key:\x20'+_0x7593fb,{'error':_0x253f83});throw _0x253f83;}}async['getField'](_0x4084db,_0x107911){try{return await this['searchClient']['hget'](_0x4084db,_0x107911);}catch(_0x157ff5){this['logger']['error']('Error\x20getting\x20field\x20'+_0x107911+'\x20for\x20key:\x20'+_0x4084db,{'error':_0x157ff5});throw _0x157ff5;}}async['getFields'](_0x397c64,_0x14ba09){try{return await this['searchClient']['hmget'](_0x397c64,[..._0x14ba09]);}catch(_0x21c19a){this['logger']['error']('Error\x20getting\x20fields\x20for\x20key:\x20'+_0x397c64,{'error':_0x21c19a});throw _0x21c19a;}}async['getAllFields'](_0x51e057){try{return await this['searchClient']['hgetall'](_0x51e057);}catch(_0x18ed8d){this['logger']['error']('Error\x20getting\x20fields\x20for\x20key:\x20'+_0x51e057,{'error':_0x18ed8d});throw _0x18ed8d;}}async['deleteFields'](_0x47a781,_0x474b2e){try{const _0xbfa760=await this['searchClient']['hdel'](_0x47a781,..._0x474b2e);return Number(_0xbfa760);}catch(_0x2b493f){this['logger']['error']('Error\x20deleting\x20fields\x20for\x20key:\x20'+_0x47a781,{'error':_0x2b493f});throw _0x2b493f;}}async['incrementFieldByFloat'](_0x13ecf5,_0x53d351,_0x4bcb40){try{const _0x3d1e33=await this['searchClient']['hincrbyfloat'](_0x13ecf5,_0x53d351,_0x4bcb40);return Number(_0x3d1e33);}catch(_0x4551cd){this['logger']['error']('Error\x20incrementing\x20field\x20'+_0x53d351+'\x20for\x20key:\x20'+_0x13ecf5,{'error':_0x4551cd});throw _0x4551cd;}}async['sendQuery'](..._0x23e9b7){try{return await this['searchClient']['call'](..._0x23e9b7);}catch(_0xb90ed6){this['logger']['error']('Error\x20executing\x20query',{'error':_0xb90ed6});throw _0xb90ed6;}}async['sendIndexedQuery'](_0x1ef0b,_0x1025bb){try{if(_0x1025bb[0x0]?.['startsWith']('FT.')){const [_0x545ffb,..._0x2f09e1]=_0x1025bb;return await this['searchClient']['call'](_0x545ffb,..._0x2f09e1);}return await this['searchClient']['call']('FT.SEARCH',_0x1ef0b,..._0x1025bb);}catch(_0xd57ead){this['logger']['error']('Error\x20executing\x20query',{'error':_0xd57ead});throw _0xd57ead;}}}exports['IORedisSearchService']=IORedisSearchService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x559a(_0x186e71,_0x315401){const _0x40fbca=_0x40fb();return _0x559a=function(_0x559a6e,_0x5427f2){_0x559a6e=_0x559a6e-0x74;let _0x9858e0=_0x40fbca[_0x559a6e];return _0x9858e0;},_0x559a(_0x186e71,_0x315401);}(function(_0xf07c60,_0x5935cc){const _0x2c0a21=_0x559a,_0xc179d6=_0xf07c60();while(!![]){try{const _0x55ef7b=-parseInt(_0x2c0a21(0x75))/0x1*(-parseInt(_0x2c0a21(0x7c))/0x2)+parseInt(_0x2c0a21(0x78))/0x3+parseInt(_0x2c0a21(0x7b))/0x4*(-parseInt(_0x2c0a21(0x7d))/0x5)+parseInt(_0x2c0a21(0x7a))/0x6+parseInt(_0x2c0a21(0x77))/0x7*(parseInt(_0x2c0a21(0x76))/0x8)+parseInt(_0x2c0a21(0x79))/0x9*(-parseInt(_0x2c0a21(0x7e))/0xa)+-parseInt(_0x2c0a21(0x74))/0xb;if(_0x55ef7b===_0x5935cc)break;else _0xc179d6['push'](_0xc179d6['shift']());}catch(_0x3f19b8){_0xc179d6['push'](_0xc179d6['shift']());}}}(_0x40fb,0x2e6c2));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['RedisSearchService']=void 0x0;function _0x40fb(){const _0x1629a0=['259BBhSjC','48453HlokiC','647199xuYFjl','1123884CpxZbz','2876skyOWI','26YTyiVj','530CMUWEo','30DssoWg','3430680GfrJPI','19777hSUyKg','72088ykSdwP'];_0x40fb=function(){return _0x1629a0;};return _0x40fb();}const index_1=require('../../index');class RedisSearchService extends index_1['SearchService']{constructor(_0x525b70,_0x2fb06a){super(_0x525b70,_0x2fb06a);}async['init'](_0x30a3e4,_0x32f27f,_0x499c3f){this['namespace']=_0x30a3e4,this['appId']=_0x32f27f,this['logger']=_0x499c3f;}async['createSearchIndex'](_0x104153,_0x5b8984,_0x364b5a){try{await this['searchClient']['sendCommand'](['FT.CREATE',_0x104153,'ON','HASH','PREFIX',_0x5b8984['length']['toString'](),..._0x5b8984,'SCHEMA',..._0x364b5a]);}catch(_0xd80a7d){this['logger']['info']('Error\x20creating\x20search\x20index',{'error':_0xd80a7d});throw _0xd80a7d;}}async['listSearchIndexes'](){try{const _0x34b7d3=await this['searchClient']['sendCommand'](['FT._LIST']);return _0x34b7d3;}catch(_0x5bb93a){this['logger']['info']('Error\x20listing\x20search\x20indexes',{'error':_0x5bb93a});throw _0x5bb93a;}}async['setFields'](_0x16ab35,_0x544c45){try{const _0x17624b=await this['searchClient']['HSET'](_0x16ab35,_0x544c45);return Number(_0x17624b);}catch(_0x11af83){this['logger']['error']('Error\x20setting\x20fields\x20for\x20key:\x20'+_0x16ab35,{'error':_0x11af83});throw _0x11af83;}}async['getField'](_0x2a2d28,_0x3d4179){try{return await this['searchClient']['HGET'](_0x2a2d28,_0x3d4179);}catch(_0x3ee12e){this['logger']['error']('Error\x20getting\x20field\x20'+_0x3d4179+'\x20for\x20key:\x20'+_0x2a2d28,{'error':_0x3ee12e});throw _0x3ee12e;}}async['getFields'](_0x156bdb,_0x41871e){try{return await this['searchClient']['HMGET'](_0x156bdb,[..._0x41871e]);}catch(_0x234087){this['logger']['error']('Error\x20getting\x20fields\x20for\x20key:\x20'+_0x156bdb,{'error':_0x234087});throw _0x234087;}}async['getAllFields'](_0x40aba3){try{return await this['searchClient']['HGETALL'](_0x40aba3);}catch(_0xfa9981){this['logger']['error']('Error\x20getting\x20fields\x20for\x20key:\x20'+_0x40aba3,{'error':_0xfa9981});throw _0xfa9981;}}async['deleteFields'](_0x1018b3,_0x19dec2){try{const _0x1c629d=await this['searchClient']['HDEL'](_0x1018b3,_0x19dec2);return Number(_0x1c629d);}catch(_0x45d0ee){this['logger']['error']('Error\x20deleting\x20fields\x20for\x20key:\x20'+_0x1018b3,{'error':_0x45d0ee});throw _0x45d0ee;}}async['incrementFieldByFloat'](_0x5658a8,_0x3f5bdd,_0x54a1dd){try{const _0x2dbd05=await this['searchClient']['HINCRBYFLOAT'](_0x5658a8,_0x3f5bdd,_0x54a1dd);return Number(_0x2dbd05);}catch(_0xe81b4d){this['logger']['error']('Error\x20incrementing\x20field\x20'+_0x3f5bdd+'\x20for\x20key:\x20'+_0x5658a8,{'error':_0xe81b4d});throw _0xe81b4d;}}async['sendQuery'](..._0x54d593){try{return await this['searchClient']['sendCommand'](_0x54d593);}catch(_0x239fed){this['logger']['error']('Error\x20executing\x20query',{'error':_0x239fed});throw _0x239fed;}}async['sendIndexedQuery'](_0x1c02ca,_0x579f7b){try{if(_0x579f7b[0x0]?.['startsWith']('FT.'))return await this['searchClient']['sendCommand'](_0x579f7b);return await this['searchClient']['sendCommand'](['FT.SEARCH',_0x1c02ca,..._0x579f7b]);}catch(_0x5963ba){this['logger']['error']('Error\x20executing\x20query',{'error':_0x5963ba});throw _0x5963ba;}}}exports['RedisSearchService']=RedisSearchService;
|