@hotmeshio/hotmesh 0.3.11 → 0.3.13
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 +6 -8
- package/build/modules/key.js +1 -1
- package/build/modules/utils.d.ts +3 -2
- package/build/modules/utils.js +1 -1
- package/build/package.json +5 -5
- 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.js +1 -1
- package/build/services/exporter/index.js +1 -1
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshdata/index.d.ts +4 -3
- package/build/services/meshdata/index.js +5 -3
- package/build/services/meshflow/client.d.ts +1 -0
- package/build/services/meshflow/client.js +18 -6
- package/build/services/meshflow/connection.d.ts +2 -2
- package/build/services/meshflow/connection.js +1 -1
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/worker.d.ts +2 -1
- package/build/services/meshflow/worker.js +27 -16
- package/build/services/meshos/index.d.ts +2 -1
- package/build/services/meshos/index.js +8 -5
- package/build/services/pipe/functions/array.js +1 -1
- package/build/services/pipe/functions/bitwise.js +1 -1
- package/build/services/pipe/functions/conditional.js +1 -1
- package/build/services/pipe/functions/cron.js +1 -1
- package/build/services/pipe/functions/date.js +1 -1
- package/build/services/pipe/functions/index.js +1 -1
- package/build/services/pipe/functions/json.js +1 -1
- package/build/services/pipe/functions/logical.js +1 -1
- package/build/services/pipe/functions/math.js +1 -1
- package/build/services/pipe/functions/number.js +1 -1
- package/build/services/pipe/functions/object.js +1 -1
- package/build/services/pipe/functions/string.js +1 -1
- package/build/services/pipe/functions/symbol.js +1 -1
- package/build/services/pipe/functions/unary.js +1 -1
- package/build/services/pipe/index.js +1 -1
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.js +1 -1
- package/build/services/search/factory.d.ts +2 -2
- package/build/services/search/factory.js +8 -4
- package/build/services/search/providers/postgres/postgres.d.ts +21 -0
- package/build/services/search/providers/postgres/postgres.js +1 -0
- 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.d.ts +2 -1
- package/build/services/store/providers/postgres/kvsql.js +1 -1
- package/build/services/store/providers/postgres/postgres.d.ts +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.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/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/build/types/manifest.d.ts +12 -3
- package/build/types/meshflow.d.ts +2 -2
- package/build/types/postgres.d.ts +1 -0
- package/build/types/provider.d.ts +7 -0
- package/package.json +5 -5
- package/types/manifest.ts +12 -3
- package/types/meshflow.ts +2 -2
- package/types/postgres.ts +2 -0
- package/types/provider.ts +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x1bc7f4,_0x4c8007){var _0x5848e8=_0x2222,_0x5aa804=_0x1bc7f4();while(!![]){try{var _0x224307=parseInt(_0x5848e8(0x11a))/0x1+-parseInt(_0x5848e8(0x11c))/0x2+parseInt(_0x5848e8(0x117))/0x3+-parseInt(_0x5848e8(0x11b))/0x4+-parseInt(_0x5848e8(0x119))/0x5+-parseInt(_0x5848e8(0x116))/0x6+parseInt(_0x5848e8(0x118))/0x7;if(_0x224307===_0x4c8007)break;else _0x5aa804['push'](_0x5aa804['shift']());}catch(_0x4ce888){_0x5aa804['push'](_0x5aa804['shift']());}}}(_0x544b,0x50012));function _0x544b(){var _0x1a4310=['164917xYxypL','1624224tkxnrQ','1245154uTHUQL','3833370RxvknO','1125738VTIOFZ','13945708xNQVbh','2685905ZTULhp'];_0x544b=function(){return _0x1a4310;};return _0x544b();}function _0x2222(_0x10a3fc,_0x13eba2){var _0x544b91=_0x544b();return _0x2222=function(_0x2222aa,_0xa8874a){_0x2222aa=_0x2222aa-0x116;var _0x24a11f=_0x544b91[_0x2222aa];return _0x24a11f;},_0x2222(_0x10a3fc,_0x13eba2);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['SymbolHandler']=void 0x0;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(_0x4f9427,_0x4ee056){var _0xde7092=_0x5289,_0x7f38b7=_0x4f9427();while(!![]){try{var _0x3e3c79=-parseInt(_0xde7092(0x10e))/0x1*(parseInt(_0xde7092(0x10f))/0x2)+-parseInt(_0xde7092(0x113))/0x3*(parseInt(_0xde7092(0x10a))/0x4)+-parseInt(_0xde7092(0x111))/0x5*(parseInt(_0xde7092(0x10b))/0x6)+parseInt(_0xde7092(0x109))/0x7+parseInt(_0xde7092(0x10d))/0x8*(parseInt(_0xde7092(0x10c))/0x9)+-parseInt(_0xde7092(0x110))/0xa+parseInt(_0xde7092(0x108))/0xb*(parseInt(_0xde7092(0x112))/0xc);if(_0x3e3c79===_0x4ee056)break;else _0x7f38b7['push'](_0x7f38b7['shift']());}catch(_0x7fac4e){_0x7f38b7['push'](_0x7f38b7['shift']());}}}(_0x8a87,0x765ee));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['UnaryHandler']=void 0x0;class UnaryHandler{['not'](_0x35f6c0){return!_0x35f6c0;}['positive'](_0x3e35b0){return+_0x3e35b0;}['negative'](_0x364706){return-_0x364706;}['bitwise_not'](_0x5f4a54){return~_0x5f4a54;}}function _0x5289(_0x3cd4b8,_0x40b8c4){var _0x8a875=_0x8a87();return _0x5289=function(_0x528908,_0x474bbb){_0x528908=_0x528908-0x108;var _0x1d3f90=_0x8a875[_0x528908];return _0x1d3f90;},_0x5289(_0x3cd4b8,_0x40b8c4);}exports['UnaryHandler']=UnaryHandler;function _0x8a87(){var _0x4b8a53=['31315SSAqQc','3804PVloPp','6GorpNy','1485BizVcZ','6279406ngtNKx','1192196YBxVWO','42qKYFsa','639WnrQUr','90680tnqCQv','140092WKljIF','2RbxUSJ','4797610mGldAE'];_0x8a87=function(){return _0x4b8a53;};return _0x8a87();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x2f97d1,_0x3cc3ee){const _0x4029d3=_0x23a3,_0x521018=_0x2f97d1();while(!![]){try{const _0x17a3bf=-parseInt(_0x4029d3(0x16a))/0x1+parseInt(_0x4029d3(0x169))/0x2*(parseInt(_0x4029d3(0x168))/0x3)+parseInt(_0x4029d3(0x163))/0x4+parseInt(_0x4029d3(0x166))/0x5+-parseInt(_0x4029d3(0x167))/0x6+-parseInt(_0x4029d3(0x165))/0x7*(parseInt(_0x4029d3(0x16b))/0x8)+parseInt(_0x4029d3(0x164))/0x9;if(_0x17a3bf===_0x3cc3ee)break;else _0x521018['push'](_0x521018['shift']());}catch(_0xa14412){_0x521018['push'](_0x521018['shift']());}}}(_0x260f,0xe3de7));var __importDefault=this&&this['__importDefault']||function(_0xfa476d){return _0xfa476d&&_0xfa476d['__esModule']?_0xfa476d:{'default':_0xfa476d};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Pipe']=void 0x0;function _0x23a3(_0x32292d,_0x4b3267){const _0x260f54=_0x260f();return _0x23a3=function(_0x23a3dc,_0x27dbf5){_0x23a3dc=_0x23a3dc-0x163;let _0x5db08b=_0x260f54[_0x23a3dc];return _0x5db08b;},_0x23a3(_0x32292d,_0x4b3267);}const functions_1=__importDefault(require('./functions'));class Pipe{constructor(_0x4c85f9,_0x233d7e,_0x2d1ea2){this['rules']=_0x4c85f9,this['jobData']=_0x233d7e,this['context']=_0x2d1ea2;}['isPipeType'](_0x5ec6c1){return!Array['isArray'](_0x5ec6c1)&&'@pipe'in _0x5ec6c1;}['isreduceType'](_0x5212ef){return!Array['isArray'](_0x5212ef)&&'@reduce'in _0x5212ef;}static['isPipeObject'](_0x31365c){return typeof _0x31365c==='object'&&_0x31365c!==null&&!Array['isArray'](_0x31365c)&&'@pipe'in _0x31365c;}static['resolve'](_0xd0c64c,_0x4fca83){let _0x499186;return Pipe['isPipeObject'](_0xd0c64c)?_0x499186=new Pipe(_0xd0c64c['@pipe'],_0x4fca83):_0x499186=new Pipe([[_0xd0c64c]],_0x4fca83),_0x499186['process']();}['process'](_0x408a2c=null){let _0x2705b3=0x0;!(_0x408a2c||this['isPipeType'](this['rules'][0x0])||this['isreduceType'](this['rules'][0x0]))&&(_0x408a2c=this['processCells'](this['rules'][0x0]),_0x2705b3=0x1);const _0x5a8652=this['rules']['length'],_0x1d4c7e=[];for(let _0x2fcb84=_0x2705b3;_0x2fcb84<_0x5a8652;_0x2fcb84++){_0x408a2c=this['processRow'](this['rules'][_0x2fcb84],_0x408a2c,_0x1d4c7e);}return _0x408a2c[0x0];}['cloneUnknown'](_0x457405){if(_0x457405===null||typeof _0x457405!=='object')return _0x457405;if(_0x457405 instanceof Date)return new Date(_0x457405['getTime']());if(_0x457405 instanceof RegExp)return new RegExp(_0x457405);if(Array['isArray'](_0x457405))return _0x457405['map'](_0x8d7ae4=>this['cloneUnknown'](_0x8d7ae4));const _0x227416={};for(const _0x39a7ea in _0x457405){Object['prototype']['hasOwnProperty']['call'](_0x457405,_0x39a7ea)&&(_0x227416[_0x39a7ea]=this['cloneUnknown'](_0x457405[_0x39a7ea]));}return _0x227416;}['reduce'](_0x19d99c){let _0x49d228=this['cloneUnknown'](_0x19d99c[0x1]??null);if(Array['isArray'](_0x19d99c[0x0]))for(let _0x5f6e43=0x0;_0x5f6e43<_0x19d99c[0x0]['length'];_0x5f6e43++){this['context']={'$input':_0x19d99c[0x0],'$output':_0x49d228,'$item':_0x19d99c[0x0][_0x5f6e43],'$key':_0x5f6e43['toString'](),'$index':_0x5f6e43},_0x49d228=this['process']([_0x49d228]);}else{let _0x1981a3=-0x1;for(const _0x1792d0 in _0x19d99c[0x0]){_0x1981a3++,this['context']={'$input':_0x19d99c[0x0],'$output':_0x49d228,'$item':_0x19d99c[0x0][_0x1792d0],'$key':_0x1792d0,'$index':_0x1981a3},_0x49d228=this['process']([_0x49d228]);}}return[_0x49d228];}['processRow'](_0x4b5b3b,_0x16cbb4,_0x2e3e1c){if(_0x16cbb4&&this['isreduceType'](_0x4b5b3b)){const _0x5b0e69=new Pipe(_0x4b5b3b['@reduce'],this['jobData']),_0x1f117d=_0x5b0e69['reduce'](_0x16cbb4);return _0x1f117d;}else{if(this['isPipeType'](_0x4b5b3b)){const _0x47b6cb=new Pipe(_0x4b5b3b['@pipe'],this['jobData'],this['context']);return _0x2e3e1c['push'](_0x47b6cb['process']()),_0x16cbb4;}else{_0x2e3e1c['length']>0x0&&(_0x16cbb4=[..._0x2e3e1c],_0x2e3e1c['length']=0x0);if(!_0x16cbb4)return[]['concat'](this['processCells'](Array['isArray'](_0x4b5b3b)?[..._0x4b5b3b]:[]));else{const [_0x14484a,..._0x369a71]=_0x4b5b3b;let _0xf3fa40;return this['isContextVariable'](_0x14484a)?_0xf3fa40=this['resolveContextValue'](_0x14484a):_0xf3fa40=Pipe['resolveFunction'](_0x14484a)(..._0x16cbb4),[_0xf3fa40]['concat'](this['processCells']([..._0x369a71]));}}}}static['resolveFunction'](_0x4dab7d){let [_0x2d9cd6,_0x27289b]=_0x4dab7d['split']('.');_0x2d9cd6=_0x2d9cd6['substring'](0x2),_0x27289b=_0x27289b['substring'](0x0,_0x27289b['length']-0x1);const _0x398e41=functions_1['default'][_0x2d9cd6];if(!_0x398e41)throw new Error('Unknown\x20domain\x20name\x20['+_0x4dab7d+']:\x20'+_0x2d9cd6);if(!_0x398e41[_0x27289b])throw new Error('Unknown\x20domain\x20function\x20['+_0x4dab7d+']:\x20'+_0x2d9cd6+'.'+_0x27289b);return _0x398e41[_0x27289b];}['processCells'](_0x38a20b){const _0x4dde5b=[];if(Array['isArray'](_0x38a20b))for(const _0x254850 of _0x38a20b){_0x4dde5b['push'](this['resolveCellValue'](_0x254850));}return _0x4dde5b;}['isFunction'](_0x308dda){return typeof _0x308dda==='string'&&_0x308dda['startsWith']('{@')&&_0x308dda['endsWith']('}');}['isContextVariable'](_0x20cd48){if(typeof _0x20cd48==='string'&&_0x20cd48['endsWith']('}'))return _0x20cd48['startsWith']('{$item')||_0x20cd48['startsWith']('{$key')||_0x20cd48['startsWith']('{$index')||_0x20cd48['startsWith']('{$input')||_0x20cd48['startsWith']('{$output');}['isMappable'](_0x10dcef){return typeof _0x10dcef==='string'&&_0x10dcef['startsWith']('{')&&_0x10dcef['endsWith']('}');}['resolveCellValue'](_0x206ff0){if(this['isFunction'](_0x206ff0)){const _0x488b11=Pipe['resolveFunction'](_0x206ff0);return _0x488b11['call']();}else{if(this['isContextVariable'](_0x206ff0))return this['resolveContextValue'](_0x206ff0);else return this['isMappable'](_0x206ff0)?this['resolveMappableValue'](_0x206ff0):_0x206ff0;}}['getNestedProperty'](_0x4e8c53,_0x59bfaa){const _0x33c7ba=_0x59bfaa['split']('.');let _0x2cb079=_0x4e8c53;for(const _0x1fb031 of _0x33c7ba){if(_0x2cb079===null||typeof _0x2cb079!=='object'||!_0x2cb079['hasOwnProperty'](_0x1fb031))return undefined;_0x2cb079=_0x2cb079[_0x1fb031];}return _0x2cb079;}['resolveMappableValue'](_0x43d503){const _0x577c4c=this['resolveMapTerm'](_0x43d503);return this['getNestedProperty'](this['jobData'],_0x577c4c);}['resolveContextValue'](_0x2c0a8f){const _0x57bb2e=this['resolveContextTerm'](_0x2c0a8f);return this['getNestedProperty'](this['context'],_0x57bb2e);}['resolveContextTerm'](_0x4b2175){return _0x4b2175['substring'](0x1,_0x4b2175['length']-0x1);}['resolveFunctionTerm'](_0x4edd4d){return _0x4edd4d['substring'](0x2,_0x4edd4d['length']-0x1);}['resolveMapTerm'](_0x3ea9dc){return _0x3ea9dc['substring'](0x1,_0x3ea9dc['length']-0x1);}}function _0x260f(){const _0x3740bc=['4421455suXjgK','8003754OQsTKW','15FJUJJJ','338066HrAhmB','272417ENXRRZ','488AaMMlk','1029604PliEgT','7259121pOXCkT','29113CdCRlK'];_0x260f=function(){return _0x3740bc;};return _0x260f();}exports['Pipe']=Pipe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x426f02,_0xa0b9b7){const _0x2c553f=_0x5349,_0x25ea73=_0x426f02();while(!![]){try{const _0x185b4e=parseInt(_0x2c553f(0x1f5))/0x1*(parseInt(_0x2c553f(0x1f6))/0x2)+-parseInt(_0x2c553f(0x1f3))/0x3+-parseInt(_0x2c553f(0x1f8))/0x4+parseInt(_0x2c553f(0x1f2))/0x5+-parseInt(_0x2c553f(0x1fa))/0x6+parseInt(_0x2c553f(0x1f4))/0x7*(-parseInt(_0x2c553f(0x1f7))/0x8)+parseInt(_0x2c553f(0x1f9))/0x9;if(_0x185b4e===_0xa0b9b7)break;else _0x25ea73['push'](_0x25ea73['shift']());}catch(_0x1fe63e){_0x25ea73['push'](_0x25ea73['shift']());}}}(_0x5568,0xe9e06));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['QuorumService']=void 0x0;function _0x5349(_0x2da6b8,_0x5cb4de){const _0x556802=_0x5568();return _0x5349=function(_0x53496a,_0x151bc3){_0x53496a=_0x53496a-0x1f2;let _0x31fa77=_0x556802[_0x53496a];return _0x31fa77;},_0x5349(_0x2da6b8,_0x5cb4de);}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'](_0x4140db,_0x360df1,_0x534b06,_0xfce65c,_0x17f6f6,_0x11bac4){if(_0xfce65c['engine']){const _0x5d233d=new QuorumService();return _0x5d233d['verifyQuorumFields'](_0xfce65c),_0x5d233d['namespace']=_0x4140db,_0x5d233d['appId']=_0x360df1,_0x5d233d['guid']=_0x534b06,_0x5d233d['logger']=_0x11bac4,_0x5d233d['engine']=_0x17f6f6,await _0x5d233d['initStoreChannel'](_0xfce65c['engine']['store']),await _0x5d233d['initSubChannel'](_0xfce65c['engine']['sub'],_0xfce65c['engine']['pub']),await _0x5d233d['subscribe']['subscribe'](hotmesh_1['KeyType']['QUORUM'],_0x5d233d['subscriptionHandler'](),_0x360df1),await _0x5d233d['subscribe']['subscribe'](hotmesh_1['KeyType']['QUORUM'],_0x5d233d['subscriptionHandler'](),_0x360df1,_0x5d233d['guid']),_0x5d233d['engine']['processWebHooks'](),_0x5d233d['engine']['processTimeHooks'](),_0x5d233d;}}['verifyQuorumFields'](_0x27aa8d){if(!(0x0,utils_1['identifyProvider'])(_0x27aa8d['engine']['store'])||!(0x0,utils_1['identifyProvider'])(_0x27aa8d['engine']['sub']))throw new Error('quorum\x20config\x20must\x20include\x20`store`\x20and\x20`sub`\x20fields.');}async['initStoreChannel'](_0x274efc){this['store']=await factory_2['StoreServiceFactory']['init'](_0x274efc,this['namespace'],this['appId'],this['logger']);}async['initSubChannel'](_0xf02c14,_0x53ccbe){this['subscribe']=await factory_1['SubServiceFactory']['init'](_0xf02c14,_0x53ccbe,this['namespace'],this['appId'],this['guid'],this['logger']);}['subscriptionHandler'](){const _0x42adb6=this;return async(_0x14959c,_0x39aa59)=>{_0x42adb6['logger']['debug']('quorum-event-received',{'topic':_0x14959c,'type':_0x39aa59['type']});if(_0x39aa59['type']==='activate')_0x42adb6['engine']['setCacheMode'](_0x39aa59['cache_mode'],_0x39aa59['until_version']);else{if(_0x39aa59['type']==='ping')_0x42adb6['sayPong'](_0x42adb6['appId'],_0x42adb6['guid'],_0x39aa59['originator'],_0x39aa59['details']);else{if(_0x39aa59['type']==='pong'&&_0x42adb6['guid']===_0x39aa59['originator'])_0x42adb6['quorum']=_0x42adb6['quorum']+0x1,_0x39aa59['profile']&&_0x42adb6['profiles']['push'](_0x39aa59['profile']);else{if(_0x39aa59['type']==='throttle')_0x42adb6['engine']['throttle'](_0x39aa59['throttle']);else{if(_0x39aa59['type']==='work')_0x42adb6['engine']['processWebHooks']();else{if(_0x39aa59['type']==='job')_0x42adb6['engine']['routeToSubscribers'](_0x39aa59['topic'],_0x39aa59['job']);else{if(_0x39aa59['type']==='cron')_0x42adb6['engine']['processTimeHooks']();else _0x39aa59['type']==='rollcall'&&_0x42adb6['doRollCall'](_0x39aa59);}}}}}}_0x42adb6['callbacks']['length']>0x0&&_0x42adb6['callbacks']['forEach'](_0x48e547=>_0x48e547(_0x14959c,_0x39aa59));};}async['sayPong'](_0x350c09,_0x18d5c6,_0x392334,_0x53939a=![]){let _0x2e6400;if(_0x53939a){const _0x396d51=this['engine']['store']['mintKey'](hotmesh_1['KeyType']['STREAMS'],{'appId':this['appId']});_0x2e6400={'engine_id':this['guid'],'namespace':this['namespace'],'app_id':this['appId'],'stream':_0x396d51,'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':_0x18d5c6,'originator':_0x392334,'profile':_0x2e6400},_0x350c09);}async['requestQuorum'](_0x17eeeb=enums_1['HMSH_QUORUM_DELAY_MS'],_0x2e7f45=![]){const _0x553450=this['quorum'];return this['quorum']=0x0,this['profiles']['length']=0x0,await this['subscribe']['publish'](hotmesh_1['KeyType']['QUORUM'],{'type':'ping','originator':this['guid'],'details':_0x2e7f45},this['appId']),await(0x0,utils_1['sleepFor'])(_0x17eeeb),_0x553450;}async['doRollCall'](_0x278c7f){let _0x37e553=0x0;const _0x2a802b=!isNaN(_0x278c7f['max'])?_0x278c7f['max']:enums_1['HMSH_QUORUM_ROLLCALL_CYCLES'];if(this['rollCallInterval'])clearTimeout(this['rollCallInterval']);const _0x47ac5a=_0x278c7f['interval']/0x2,_0x28015f=_0x47ac5a+Math['ceil'](Math['random']()*_0x47ac5a);do{await(0x0,utils_1['sleepFor'])(Math['ceil'](Math['random']()*0x3e8)),await this['sayPong'](this['appId'],this['guid'],null,!![]);if(!_0x278c7f['interval'])return;const {promise:_0x3068fb,timerId:_0x117163}=(0x0,utils_1['XSleepFor'])(_0x28015f*0x3e8);this['rollCallInterval']=_0x117163,await _0x3068fb;}while(this['rollCallInterval']&&_0x37e553++<_0x2a802b-0x1);}['cancelRollCall'](){this['rollCallInterval']&&(clearTimeout(this['rollCallInterval']),delete this['rollCallInterval']);}['stop'](){this['cancelRollCall']();}async['pub'](_0x3f6aeb){return await this['subscribe']['publish'](hotmesh_1['KeyType']['QUORUM'],_0x3f6aeb,this['appId'],_0x3f6aeb['topic']||_0x3f6aeb['guid']);}async['sub'](_0x590a5b){this['callbacks']['push'](_0x590a5b);}async['unsub'](_0x4dc84b){this['callbacks']=this['callbacks']['filter'](_0x3b44dd=>_0x3b44dd!==_0x4dc84b);}async['rollCall'](_0x3a71a2=enums_1['HMSH_QUORUM_DELAY_MS']){await this['requestQuorum'](_0x3a71a2,!![]);const _0x3c601f=await this['engine']['stream']['getStreamDepths'](this['profiles']);return this['profiles']['forEach'](async(_0x5e2116,_0x2e706e)=>{_0x5e2116['stream_depth']=_0x3c601f?.[_0x2e706e]?.['depth']??0x0;}),this['profiles'];}async['activate'](_0x5203e0,_0x2e6553=enums_1['HMSH_QUORUM_DELAY_MS'],_0x106ab4=0x0){_0x5203e0=_0x5203e0['toString']();const _0x2e2d7b=await this['store']['reserveScoutRole']('activate',Math['ceil'](_0x2e6553*0x6/0x3e8)+0x1);if(!_0x2e2d7b){this['logger']['debug']('quorum-activation-awaiting',{'version':_0x5203e0}),await(0x0,utils_1['sleepFor'])(_0x2e6553*0x6);const _0x538bf9=await this['store']['getApp'](this['appId'],!![]);return _0x538bf9?.['active']==!![]&&_0x538bf9?.['version']===_0x5203e0;}const _0x2a4b54=await this['engine']['getVID']();await this['requestQuorum'](_0x2e6553);const _0x354c49=await this['requestQuorum'](_0x2e6553),_0x1269e9=await this['requestQuorum'](_0x2e6553),_0x1943ce=await this['requestQuorum'](_0x2e6553);if(_0x354c49&&_0x354c49===_0x1269e9&&_0x1269e9===_0x1943ce){this['logger']['info']('quorum-rollcall-succeeded',{'q1':_0x354c49,'q2':_0x1269e9,'q3':_0x1943ce}),this['subscribe']['publish'](hotmesh_1['KeyType']['QUORUM'],{'type':'activate','cache_mode':'nocache','until_version':_0x5203e0},this['appId']),await new Promise(_0x3596e1=>setTimeout(_0x3596e1,_0x2e6553)),await this['store']['releaseScoutRole']('activate');if(this['engine']['untilVersion']===_0x5203e0){this['logger']['info']('quorum-activation-succeeded',{'version':_0x5203e0});const {id:_0x1fca3e}=_0x2a4b54,_0x249fad=new compiler_1['CompilerService'](this['store'],this['engine']['stream'],this['logger']);return await _0x249fad['activate'](_0x1fca3e,_0x5203e0);}else{this['logger']['error']('quorum-activation-error',{'version':_0x5203e0});throw new Error('UntilVersion\x20Not\x20Received.\x20Version\x20'+_0x5203e0+'\x20not\x20activated');}}else{this['logger']['warn']('quorum-rollcall-error',{'q1':_0x354c49,'q2':_0x1269e9,'q3':_0x1943ce,'count':_0x106ab4}),this['store']['releaseScoutRole']('activate');if(_0x106ab4<enums_1['HMSH_ACTIVATION_MAX_RETRY'])return await this['activate'](_0x5203e0,_0x2e6553*0x2,_0x106ab4+0x1);throw new Error('Quorum\x20not\x20reached.\x20Version\x20'+_0x5203e0+'\x20not\x20activated.');}}}exports['QuorumService']=QuorumService;function _0x5568(){const _0x2186c0=['9631986ReAmen','7705180sJcmYl','4446534xVCmWR','13143571Jnbodz','498gCDySn','2704tgpoiX','8pPjbaZ','770468foAhxO','35112645zohIlh'];_0x5568=function(){return _0x2186c0;};return _0x5568();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0xb5baf6,_0x403e41){const _0x28ca65=_0x5c53,_0x57af59=_0xb5baf6();while(!![]){try{const _0x216f71=parseInt(_0x28ca65(0xef))/0x1*(-parseInt(_0x28ca65(0xeb))/0x2)+-parseInt(_0x28ca65(0xee))/0x3+parseInt(_0x28ca65(0xf1))/0x4+parseInt(_0x28ca65(0xed))/0x5+-parseInt(_0x28ca65(0xf3))/0x6+-parseInt(_0x28ca65(0xf0))/0x7+parseInt(_0x28ca65(0xec))/0x8*(parseInt(_0x28ca65(0xf2))/0x9);if(_0x216f71===_0x403e41)break;else _0x57af59['push'](_0x57af59['shift']());}catch(_0x46d0cd){_0x57af59['push'](_0x57af59['shift']());}}}(_0x3c05,0x9ea43));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['ReporterService']=void 0x0;const pipe_1=require('../pipe');class ReporterService{constructor(_0xbd15ea,_0x16538a,_0x413358){this['appVersion']=_0xbd15ea,this['logger']=_0x413358,this['store']=_0x16538a;}async['getStats'](_0x19d67f){this['logger']['debug']('reporter-getstats-started',_0x19d67f);const {key:_0x130380,granularity:_0x12f0c6,range:_0x2dcfd6,end:_0x598940,start:_0x39db72}=_0x19d67f;this['validateOptions'](_0x19d67f);const _0x595a76=this['generateDateTimeSets'](_0x12f0c6,_0x2dcfd6,_0x598940,_0x39db72),_0x1fd0c7=_0x595a76['map'](_0x245c1b=>this['buildRedisKey'](_0x130380,_0x245c1b)),_0x47dd47=await this['store']['getJobStats'](_0x1fd0c7),[_0x5ab1fd,_0x36fec5]=this['aggregateData'](_0x47dd47),_0x11badb=this['buildStatsResponse'](_0x47dd47,_0x1fd0c7,_0x36fec5,_0x5ab1fd,_0x19d67f);return _0x11badb;}['validateOptions'](_0x21cd5f){const {start:_0xd938a0,end:_0x306d53,range:_0x45b4ab,granularity:_0x41ef11}=_0x21cd5f;if(_0x41ef11!=='infinity'&&(_0xd938a0&&_0x306d53&&_0x45b4ab||!_0xd938a0&&!_0x306d53&&!_0x45b4ab))throw new Error('Invalid\x20combination\x20of\x20start,\x20end,\x20and\x20range\x20values.\x20Provide\x20either\x20start+end,\x20end+range,\x20or\x20start+range.');}['generateDateTimeSets'](_0x1f71a1,_0x27a719,_0x3f21a7,_0x51e991){if(_0x1f71a1==='infinity')return['0'];!_0x27a719&&(_0x27a719='0m');const _0x22e3d2={'5m':0x5,'10m':0xa,'15m':0xf,'30m':0x1e,'1h':0x3c},_0x29e33a=_0x22e3d2[_0x1f71a1];if(!_0x29e33a)throw new Error('Invalid\x20granularity\x20value.');const _0xcef360=this['convertRangeToMinutes'](_0x27a719);if(_0xcef360===null)throw new Error('Invalid\x20range\x20value.');let _0x2e2a59,_0x204dfb;_0x51e991?(_0x2e2a59=new Date(_0x51e991),_0x204dfb=new Date(_0x2e2a59['getTime']()+_0xcef360*0x3c*0x3e8)):(_0x204dfb=_0x3f21a7==='NOW'?new Date():new Date(_0x3f21a7),_0x2e2a59=new Date(_0x204dfb['getTime']()-_0xcef360*0x3c*0x3e8));_0x2e2a59['setUTCMinutes'](Math['floor'](_0x2e2a59['getUTCMinutes']()/_0x29e33a)*_0x29e33a);const _0x53c85b=[];for(let _0x2c2d7d=_0x2e2a59;_0x2c2d7d<=_0x204dfb;_0x2c2d7d['setUTCMinutes'](_0x2c2d7d['getUTCMinutes']()+_0x29e33a)){const _0x2c4211=[_0x2c2d7d['getUTCFullYear'](),String(_0x2c2d7d['getUTCMonth']()+0x1)['padStart'](0x2,'0'),String(_0x2c2d7d['getUTCDate']())['padStart'](0x2,'0'),String(_0x2c2d7d['getUTCHours']())['padStart'](0x2,'0'),String(_0x2c2d7d['getUTCMinutes']())['padStart'](0x2,'0')]['join']('');_0x53c85b['push'](_0x2c4211);}return _0x53c85b;}['convertRangeToMinutes'](_0x24dfb0){const _0x4771b6=_0x24dfb0['slice'](-0x1),_0x36901d=parseInt(_0x24dfb0['slice'](0x0,-0x1),0xa);if(isNaN(_0x36901d))return null;switch(_0x4771b6){case'm':return _0x36901d;case'h':return _0x36901d*0x3c;case'd':return _0x36901d*0x3c*0x18;default:return null;}}['buildRedisKey'](_0x475260,_0x369215,_0x34c1c7=''){return'hmsh:'+this['appVersion']['id']+':s:'+_0x475260+':'+_0x369215+(_0x34c1c7?':'+_0x34c1c7:'');}['aggregateData'](_0xb9b8e5){const _0x3b8a5b={};let _0x36115f=0x0;return Object['entries'](_0xb9b8e5)['forEach'](([_0xa3e861,_0x46e504])=>{for(const _0x354b42 in _0x46e504){if(_0x354b42['startsWith']('count:')){const _0x2ac1f9=_0x354b42['slice']('count:'['length']);!_0x3b8a5b[_0x2ac1f9]&&(_0x3b8a5b[_0x2ac1f9]=0x0),_0x3b8a5b[_0x2ac1f9]+=_0x46e504[_0x354b42];}else _0x354b42==='count'&&(_0x36115f+=_0x46e504[_0x354b42]);}}),[_0x36115f,_0x3b8a5b];}['buildStatsResponse'](_0x5b318c,_0x3affb5,_0x573b03,_0x520a47,_0x3f2620){const _0x991483=[],_0x5d079c=Object['keys'](_0x573b03)['filter'](_0x560d81=>_0x560d81!=='count');let _0x58a94=undefined;_0x3f2620['sparse']!==!![]&&(_0x58a94=this['handleSegments'](_0x5b318c,_0x3affb5));_0x5d079c['forEach'](_0x5ec956=>{const _0x56069c={'target':_0x5ec956,'type':'count','value':_0x573b03[_0x5ec956]};_0x991483['push'](_0x56069c);});const _0x3595cf={'key':_0x3f2620['key'],'granularity':_0x3f2620['granularity'],'range':_0x3f2620['range'],'end':_0x3f2620['end'],'count':_0x520a47,'measures':_0x991483};return _0x58a94&&(_0x3595cf['segments']=_0x58a94),_0x3595cf;}['handleSegments'](_0x1b6bd,_0x637754){const _0x5bf114=[];return _0x637754['forEach']((_0x296564,_0x48113f)=>{const _0x40471b=[];_0x1b6bd[_0x296564]&&Object['entries'](_0x1b6bd[_0x296564])['forEach'](([_0xd85b5,_0x47c185])=>{if(_0xd85b5['startsWith']('count:')){const _0x98df0e=_0xd85b5['slice']('count:'['length']);_0x40471b['push']({'target':_0x98df0e,'type':'count','value':_0x47c185});}});const _0x23aa15=this['isoTimestampFromKeyTimestamp'](_0x296564),_0x335d96=_0x1b6bd[_0x296564]?_0x1b6bd[_0x296564]['count']:0x0;_0x5bf114['push']({'count':_0x335d96,'time':_0x23aa15,'measures':_0x40471b});}),_0x5bf114;}['isoTimestampFromKeyTimestamp'](_0x4ab92d){if(_0x4ab92d['endsWith'](':'))return'0';const _0x451323=_0x4ab92d['slice'](-0xc),_0x133e4b=_0x451323['slice'](0x0,0x4),_0xe17ad5=_0x451323['slice'](0x4,0x6),_0x5eeaf3=_0x451323['slice'](0x6,0x8),_0x53c946=_0x451323['slice'](0x8,0xa),_0xed34ba=_0x451323['slice'](0xa,0xc);return _0x133e4b+'-'+_0xe17ad5+'-'+_0x5eeaf3+'T'+_0x53c946+':'+_0xed34ba+'Z';}async['getIds'](_0x2b36b9,_0x3dc099,_0x324147=[0x0,-0x1]){if(!_0x3dc099['length']){const _0x273627=await this['getStats'](_0x2b36b9);_0x3dc099=this['getUniqueFacets'](_0x273627);}const {key:_0x182920,granularity:_0x53d31f,range:_0x329a5c,end:_0x8f23e7,start:_0x2153a7}=_0x2b36b9;this['validateOptions'](_0x2b36b9);let _0xfcfa86=[];_0x3dc099['forEach'](_0x588f76=>{const _0xc541e=this['generateDateTimeSets'](_0x53d31f,_0x329a5c,_0x8f23e7,_0x2153a7);_0xfcfa86=_0xfcfa86['concat'](_0xc541e['map'](_0x3172d2=>this['buildRedisKey'](_0x182920,_0x3172d2,'index:'+_0x588f76)));});const _0x32fd0c=await this['store']['getJobIds'](_0xfcfa86,_0x324147),_0x665d1=this['buildIdsResponse'](_0x32fd0c,_0x2b36b9,_0x3dc099);return _0x665d1;}['buildIdsResponse'](_0x7cadd8,_0x2348e3,_0x52f397){const _0x146321={},_0x313768=Object['keys'](_0x7cadd8);_0x313768['forEach'](_0x1c6bf5=>{const _0x3596f5=this['getTargetForKey'](_0x1c6bf5),_0x54563d=_0x7cadd8[_0x1c6bf5]['length'];_0x146321[_0x3596f5]?_0x146321[_0x3596f5]+=_0x54563d:_0x146321[_0x3596f5]=_0x54563d;});const _0x2d0be5=Object['entries'](_0x146321)['map'](([_0x3719b6,_0x1f07c6])=>({'facet':_0x3719b6,'count':_0x1f07c6})),_0x4591d3={'key':_0x2348e3['key'],'facets':_0x52f397,'granularity':_0x2348e3['granularity'],'range':_0x2348e3['range'],'start':_0x2348e3['start'],'counts':_0x2d0be5,'segments':this['buildTimeSegments'](_0x7cadd8)};return _0x4591d3;}['buildTimeSegments'](_0x34b76a){const _0x416539=Object['keys'](_0x34b76a),_0x23845c={};_0x416539['forEach'](_0x123a99=>{const _0x25d8a5={'type':'ids','target':this['getTargetForKey'](_0x123a99),'time':this['isoTimestampFromKeyTimestamp'](this['getTargetForTime'](_0x123a99)),'count':_0x34b76a[_0x123a99]['length'],'ids':_0x34b76a[_0x123a99]};_0x23845c[_0x25d8a5['time']]?_0x23845c[_0x25d8a5['time']]['push'](_0x25d8a5):_0x23845c[_0x25d8a5['time']]=[_0x25d8a5];});const _0x543bc9=Object['entries'](_0x23845c)['map'](([_0x349781,_0x31fb69])=>({'time':_0x349781,'measures':_0x31fb69}));return _0x543bc9;}['getUniqueFacets'](_0x190ba6){const _0x358072=_0x190ba6['measures']['map'](_0xae1d8d=>_0xae1d8d['target']);return Array['from'](new Set(_0x358072));}['getTargetForKey'](_0x36f44f){return _0x36f44f['split'](':index:')[0x1];}['getTargetForTime'](_0x2da131){return _0x2da131['split'](':index:')[0x0];}async['getWorkItems'](_0x54fa8d,_0x131244){if(!_0x131244['length']){const _0x39ae95=await this['getStats'](_0x54fa8d);_0x131244=this['getUniqueFacets'](_0x39ae95);}const {key:_0x1e70f4,granularity:_0x3352b8,range:_0x26ff29,end:_0x3c2736,start:_0x40bfbf}=_0x54fa8d;this['validateOptions'](_0x54fa8d);let _0x59c1a1=[];_0x131244['forEach'](_0x13b3b4=>{const _0xd3270d=this['generateDateTimeSets'](_0x3352b8,_0x26ff29,_0x3c2736,_0x40bfbf);_0x59c1a1=_0x59c1a1['concat'](_0xd3270d['map'](_0x1dcf9d=>this['buildRedisKey'](_0x1e70f4,_0x1dcf9d,'index:'+_0x13b3b4)));});const _0x4134a2=await this['store']['getJobIds'](_0x59c1a1,[0x0,0x1]),_0x4a9316=this['buildWorkerLists'](_0x4134a2);return _0x4a9316;}['buildWorkerLists'](_0x45074e){const _0x3fe751=[];for(const _0xff759b in _0x45074e){_0x45074e[_0xff759b]['length']&&_0x3fe751['push'](_0xff759b);}return _0x3fe751;}['resolveTriggerStatistics']({stats:_0x5f386e},_0x201962){const _0x5df507={'general':[],'index':[],'median':[]};_0x5df507['general']['push']({'metric':'count','target':'count','value':0x1});for(const _0x8ca0e6 of _0x5f386e['measures']){const _0x313e70=this['resolveMetric']({'metric':_0x8ca0e6['measure'],'target':_0x8ca0e6['target']},_0x201962);if(this['isGeneralMetric'](_0x8ca0e6['measure']))_0x5df507['general']['push'](_0x313e70);else{if(this['isMedianMetric'](_0x8ca0e6['measure']))_0x5df507['median']['push'](_0x313e70);else this['isIndexMetric'](_0x8ca0e6['measure'])&&_0x5df507['index']['push'](_0x313e70);}}return _0x5df507;}['isGeneralMetric'](_0x54a812){return ReporterService['isGeneralMetric'](_0x54a812);}['isMedianMetric'](_0x1cc21f){return ReporterService['isMedianMetric'](_0x1cc21f);}['isIndexMetric'](_0x1cbf51){return ReporterService['isIndexMetric'](_0x1cbf51);}static['isGeneralMetric'](_0x485071){return _0x485071==='sum'||_0x485071==='avg'||_0x485071==='count';}static['isMedianMetric'](_0x402d9a){return _0x402d9a==='mdn';}static['isIndexMetric'](_0x358f30){return _0x358f30==='index';}['resolveMetric']({metric:_0x415c9f,target:_0x89367e},_0x21788b){const _0x5e2a24=new pipe_1['Pipe']([[_0x89367e]],_0x21788b),_0x517744=_0x5e2a24['process']()['toString'](),_0x4ceb41=this['resolveTarget'](_0x415c9f,_0x89367e,_0x517744);if(_0x415c9f==='index')return{'metric':_0x415c9f,'target':_0x4ceb41,'value':_0x21788b['metadata']['jid']};else{if(_0x415c9f==='count')return{'metric':_0x415c9f,'target':_0x4ceb41,'value':0x1};}return{'metric':_0x415c9f,'target':_0x4ceb41,'value':_0x517744};}['isCardinalMetric'](_0x2ad0b6){return _0x2ad0b6==='index'||_0x2ad0b6==='count';}['resolveTarget'](_0x266516,_0x3ba516,_0x246e85){const _0x3d9e68=_0x3ba516['substring'](0x1,_0x3ba516['length']-0x1),_0x4db67e=_0x3d9e68['split']('.')['slice'](0x3)['join']('/');let _0x14c5ef;return this['isCardinalMetric'](_0x266516)?_0x14c5ef=_0x266516+':'+_0x4db67e+':'+_0x246e85:_0x14c5ef=_0x266516+':'+_0x4db67e,_0x14c5ef;}}function _0x5c53(_0x45bbf0,_0x478fb9){const _0x3c0520=_0x3c05();return _0x5c53=function(_0x5c5396,_0x5da703){_0x5c5396=_0x5c5396-0xeb;let _0x260fd4=_0x3c0520[_0x5c5396];return _0x260fd4;},_0x5c53(_0x45bbf0,_0x478fb9);}function _0x3c05(){const _0x3af143=['8WfTpLB','3491475tswBku','2726757iipUaq','799341hGgacn','3027612neVRcM','605100XVUzLc','27459639wQQwDm','6660420BFxpta','2rqVsVV'];_0x3c05=function(){return _0x3af143;};return _0x3c05();}exports['ReporterService']=ReporterService,ReporterService['DEFAULT_GRANULARITY']='5m';
|
|
1
|
+
'use strict';(function(_0x3330da,_0x45dbae){const _0x21c3f8=_0x3797,_0x221c1d=_0x3330da();while(!![]){try{const _0x4aa577=-parseInt(_0x21c3f8(0xf4))/0x1*(parseInt(_0x21c3f8(0xf7))/0x2)+-parseInt(_0x21c3f8(0xf0))/0x3*(-parseInt(_0x21c3f8(0xf1))/0x4)+parseInt(_0x21c3f8(0xf8))/0x5+parseInt(_0x21c3f8(0xee))/0x6*(parseInt(_0x21c3f8(0xf6))/0x7)+-parseInt(_0x21c3f8(0xef))/0x8*(parseInt(_0x21c3f8(0xf3))/0x9)+parseInt(_0x21c3f8(0xf5))/0xa*(parseInt(_0x21c3f8(0xf2))/0xb)+-parseInt(_0x21c3f8(0xf9))/0xc*(parseInt(_0x21c3f8(0xed))/0xd);if(_0x4aa577===_0x45dbae)break;else _0x221c1d['push'](_0x221c1d['shift']());}catch(_0x578af8){_0x221c1d['push'](_0x221c1d['shift']());}}}(_0x2bb5,0x1f1e0));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['ReporterService']=void 0x0;function _0x3797(_0x599292,_0x5a295f){const _0x2bb5f7=_0x2bb5();return _0x3797=function(_0x379701,_0x1c7c6f){_0x379701=_0x379701-0xed;let _0x1f22aa=_0x2bb5f7[_0x379701];return _0x1f22aa;},_0x3797(_0x599292,_0x5a295f);}const pipe_1=require('../pipe');class ReporterService{constructor(_0xf40b2d,_0x67a9db,_0x22c209){this['appVersion']=_0xf40b2d,this['logger']=_0x22c209,this['store']=_0x67a9db;}async['getStats'](_0x47d716){this['logger']['debug']('reporter-getstats-started',_0x47d716);const {key:_0x222f60,granularity:_0x34ae10,range:_0x21e290,end:_0x116edd,start:_0x16f938}=_0x47d716;this['validateOptions'](_0x47d716);const _0x495225=this['generateDateTimeSets'](_0x34ae10,_0x21e290,_0x116edd,_0x16f938),_0x1cd29a=_0x495225['map'](_0x4c4fae=>this['buildRedisKey'](_0x222f60,_0x4c4fae)),_0x418727=await this['store']['getJobStats'](_0x1cd29a),[_0x2b9182,_0x87a211]=this['aggregateData'](_0x418727),_0x4b256b=this['buildStatsResponse'](_0x418727,_0x1cd29a,_0x87a211,_0x2b9182,_0x47d716);return _0x4b256b;}['validateOptions'](_0xcfe246){const {start:_0x57ebba,end:_0x324793,range:_0x3a378e,granularity:_0x3a9a53}=_0xcfe246;if(_0x3a9a53!=='infinity'&&(_0x57ebba&&_0x324793&&_0x3a378e||!_0x57ebba&&!_0x324793&&!_0x3a378e))throw new Error('Invalid\x20combination\x20of\x20start,\x20end,\x20and\x20range\x20values.\x20Provide\x20either\x20start+end,\x20end+range,\x20or\x20start+range.');}['generateDateTimeSets'](_0x178bec,_0x5c21f3,_0x34501b,_0x3619d8){if(_0x178bec==='infinity')return['0'];!_0x5c21f3&&(_0x5c21f3='0m');const _0x3f4471={'5m':0x5,'10m':0xa,'15m':0xf,'30m':0x1e,'1h':0x3c},_0x144372=_0x3f4471[_0x178bec];if(!_0x144372)throw new Error('Invalid\x20granularity\x20value.');const _0x20fa5c=this['convertRangeToMinutes'](_0x5c21f3);if(_0x20fa5c===null)throw new Error('Invalid\x20range\x20value.');let _0x14d344,_0x3dac15;_0x3619d8?(_0x14d344=new Date(_0x3619d8),_0x3dac15=new Date(_0x14d344['getTime']()+_0x20fa5c*0x3c*0x3e8)):(_0x3dac15=_0x34501b==='NOW'?new Date():new Date(_0x34501b),_0x14d344=new Date(_0x3dac15['getTime']()-_0x20fa5c*0x3c*0x3e8));_0x14d344['setUTCMinutes'](Math['floor'](_0x14d344['getUTCMinutes']()/_0x144372)*_0x144372);const _0x44c972=[];for(let _0x9e5879=_0x14d344;_0x9e5879<=_0x3dac15;_0x9e5879['setUTCMinutes'](_0x9e5879['getUTCMinutes']()+_0x144372)){const _0x5838ac=[_0x9e5879['getUTCFullYear'](),String(_0x9e5879['getUTCMonth']()+0x1)['padStart'](0x2,'0'),String(_0x9e5879['getUTCDate']())['padStart'](0x2,'0'),String(_0x9e5879['getUTCHours']())['padStart'](0x2,'0'),String(_0x9e5879['getUTCMinutes']())['padStart'](0x2,'0')]['join']('');_0x44c972['push'](_0x5838ac);}return _0x44c972;}['convertRangeToMinutes'](_0x4b1dd0){const _0x544258=_0x4b1dd0['slice'](-0x1),_0x25500d=parseInt(_0x4b1dd0['slice'](0x0,-0x1),0xa);if(isNaN(_0x25500d))return null;switch(_0x544258){case'm':return _0x25500d;case'h':return _0x25500d*0x3c;case'd':return _0x25500d*0x3c*0x18;default:return null;}}['buildRedisKey'](_0x3245f7,_0xd09a32,_0x163858=''){return'hmsh:'+this['appVersion']['id']+':s:'+_0x3245f7+':'+_0xd09a32+(_0x163858?':'+_0x163858:'');}['aggregateData'](_0x3ff22c){const _0x5a1995={};let _0x128043=0x0;return Object['entries'](_0x3ff22c)['forEach'](([_0x3254c5,_0x501f98])=>{for(const _0x4b2bb5 in _0x501f98){if(_0x4b2bb5['startsWith']('count:')){const _0x13e641=_0x4b2bb5['slice']('count:'['length']);!_0x5a1995[_0x13e641]&&(_0x5a1995[_0x13e641]=0x0),_0x5a1995[_0x13e641]+=_0x501f98[_0x4b2bb5];}else _0x4b2bb5==='count'&&(_0x128043+=_0x501f98[_0x4b2bb5]);}}),[_0x128043,_0x5a1995];}['buildStatsResponse'](_0x42ef59,_0x548a98,_0x5de638,_0x520e47,_0x97b996){const _0xa59070=[],_0x218bd1=Object['keys'](_0x5de638)['filter'](_0xc8b15a=>_0xc8b15a!=='count');let _0x2ffbc0=undefined;_0x97b996['sparse']!==!![]&&(_0x2ffbc0=this['handleSegments'](_0x42ef59,_0x548a98));_0x218bd1['forEach'](_0x5cd6b6=>{const _0x29e7d8={'target':_0x5cd6b6,'type':'count','value':_0x5de638[_0x5cd6b6]};_0xa59070['push'](_0x29e7d8);});const _0x4c3ebd={'key':_0x97b996['key'],'granularity':_0x97b996['granularity'],'range':_0x97b996['range'],'end':_0x97b996['end'],'count':_0x520e47,'measures':_0xa59070};return _0x2ffbc0&&(_0x4c3ebd['segments']=_0x2ffbc0),_0x4c3ebd;}['handleSegments'](_0x24e0d9,_0x5aebce){const _0xd212ae=[];return _0x5aebce['forEach']((_0x4ddd34,_0x346d1b)=>{const _0x58e545=[];_0x24e0d9[_0x4ddd34]&&Object['entries'](_0x24e0d9[_0x4ddd34])['forEach'](([_0x37d9e2,_0x98b5bc])=>{if(_0x37d9e2['startsWith']('count:')){const _0x327fc3=_0x37d9e2['slice']('count:'['length']);_0x58e545['push']({'target':_0x327fc3,'type':'count','value':_0x98b5bc});}});const _0x1862ed=this['isoTimestampFromKeyTimestamp'](_0x4ddd34),_0x27f25e=_0x24e0d9[_0x4ddd34]?_0x24e0d9[_0x4ddd34]['count']:0x0;_0xd212ae['push']({'count':_0x27f25e,'time':_0x1862ed,'measures':_0x58e545});}),_0xd212ae;}['isoTimestampFromKeyTimestamp'](_0x4ff0c5){if(_0x4ff0c5['endsWith'](':'))return'0';const _0x26a430=_0x4ff0c5['slice'](-0xc),_0x2a4207=_0x26a430['slice'](0x0,0x4),_0x2f771e=_0x26a430['slice'](0x4,0x6),_0x12a0d8=_0x26a430['slice'](0x6,0x8),_0xb82dd0=_0x26a430['slice'](0x8,0xa),_0x19952c=_0x26a430['slice'](0xa,0xc);return _0x2a4207+'-'+_0x2f771e+'-'+_0x12a0d8+'T'+_0xb82dd0+':'+_0x19952c+'Z';}async['getIds'](_0x7e6cfc,_0x13f850,_0x4a3ccb=[0x0,-0x1]){if(!_0x13f850['length']){const _0x53817d=await this['getStats'](_0x7e6cfc);_0x13f850=this['getUniqueFacets'](_0x53817d);}const {key:_0x1936e8,granularity:_0x16ad5a,range:_0x374e4d,end:_0x469378,start:_0x370d60}=_0x7e6cfc;this['validateOptions'](_0x7e6cfc);let _0x12c93b=[];_0x13f850['forEach'](_0x5d1cda=>{const _0x265337=this['generateDateTimeSets'](_0x16ad5a,_0x374e4d,_0x469378,_0x370d60);_0x12c93b=_0x12c93b['concat'](_0x265337['map'](_0x1578b6=>this['buildRedisKey'](_0x1936e8,_0x1578b6,'index:'+_0x5d1cda)));});const _0x5ea993=await this['store']['getJobIds'](_0x12c93b,_0x4a3ccb),_0x3ca3fb=this['buildIdsResponse'](_0x5ea993,_0x7e6cfc,_0x13f850);return _0x3ca3fb;}['buildIdsResponse'](_0x936d7f,_0x27dbcd,_0x50b0f0){const _0x58bdb3={},_0x1c88bf=Object['keys'](_0x936d7f);_0x1c88bf['forEach'](_0x1f5c30=>{const _0x165ada=this['getTargetForKey'](_0x1f5c30),_0x394d4c=_0x936d7f[_0x1f5c30]['length'];_0x58bdb3[_0x165ada]?_0x58bdb3[_0x165ada]+=_0x394d4c:_0x58bdb3[_0x165ada]=_0x394d4c;});const _0x340547=Object['entries'](_0x58bdb3)['map'](([_0x991e37,_0x2701ba])=>({'facet':_0x991e37,'count':_0x2701ba})),_0x1f5468={'key':_0x27dbcd['key'],'facets':_0x50b0f0,'granularity':_0x27dbcd['granularity'],'range':_0x27dbcd['range'],'start':_0x27dbcd['start'],'counts':_0x340547,'segments':this['buildTimeSegments'](_0x936d7f)};return _0x1f5468;}['buildTimeSegments'](_0x4a3155){const _0x478158=Object['keys'](_0x4a3155),_0x180224={};_0x478158['forEach'](_0x165d96=>{const _0x149b1c={'type':'ids','target':this['getTargetForKey'](_0x165d96),'time':this['isoTimestampFromKeyTimestamp'](this['getTargetForTime'](_0x165d96)),'count':_0x4a3155[_0x165d96]['length'],'ids':_0x4a3155[_0x165d96]};_0x180224[_0x149b1c['time']]?_0x180224[_0x149b1c['time']]['push'](_0x149b1c):_0x180224[_0x149b1c['time']]=[_0x149b1c];});const _0x5c07e8=Object['entries'](_0x180224)['map'](([_0x516fcb,_0x8b467])=>({'time':_0x516fcb,'measures':_0x8b467}));return _0x5c07e8;}['getUniqueFacets'](_0x2c541f){const _0x4f5f14=_0x2c541f['measures']['map'](_0x2bc321=>_0x2bc321['target']);return Array['from'](new Set(_0x4f5f14));}['getTargetForKey'](_0x20f49d){return _0x20f49d['split'](':index:')[0x1];}['getTargetForTime'](_0x5e7e00){return _0x5e7e00['split'](':index:')[0x0];}async['getWorkItems'](_0x465126,_0x4e5c22){if(!_0x4e5c22['length']){const _0x3a3fce=await this['getStats'](_0x465126);_0x4e5c22=this['getUniqueFacets'](_0x3a3fce);}const {key:_0x4f2823,granularity:_0x3d5229,range:_0x57f303,end:_0x51012b,start:_0x1cea2f}=_0x465126;this['validateOptions'](_0x465126);let _0x41be47=[];_0x4e5c22['forEach'](_0x2a8da0=>{const _0x427e61=this['generateDateTimeSets'](_0x3d5229,_0x57f303,_0x51012b,_0x1cea2f);_0x41be47=_0x41be47['concat'](_0x427e61['map'](_0x2c858b=>this['buildRedisKey'](_0x4f2823,_0x2c858b,'index:'+_0x2a8da0)));});const _0x4c9827=await this['store']['getJobIds'](_0x41be47,[0x0,0x1]),_0x470766=this['buildWorkerLists'](_0x4c9827);return _0x470766;}['buildWorkerLists'](_0x30f5ff){const _0x1dd0ec=[];for(const _0x2bf919 in _0x30f5ff){_0x30f5ff[_0x2bf919]['length']&&_0x1dd0ec['push'](_0x2bf919);}return _0x1dd0ec;}['resolveTriggerStatistics']({stats:_0x26244d},_0x2f87c2){const _0x1863eb={'general':[],'index':[],'median':[]};_0x1863eb['general']['push']({'metric':'count','target':'count','value':0x1});for(const _0x30fe23 of _0x26244d['measures']){const _0x43540a=this['resolveMetric']({'metric':_0x30fe23['measure'],'target':_0x30fe23['target']},_0x2f87c2);if(this['isGeneralMetric'](_0x30fe23['measure']))_0x1863eb['general']['push'](_0x43540a);else{if(this['isMedianMetric'](_0x30fe23['measure']))_0x1863eb['median']['push'](_0x43540a);else this['isIndexMetric'](_0x30fe23['measure'])&&_0x1863eb['index']['push'](_0x43540a);}}return _0x1863eb;}['isGeneralMetric'](_0x11d9c2){return ReporterService['isGeneralMetric'](_0x11d9c2);}['isMedianMetric'](_0x56a5ce){return ReporterService['isMedianMetric'](_0x56a5ce);}['isIndexMetric'](_0x81a85d){return ReporterService['isIndexMetric'](_0x81a85d);}static['isGeneralMetric'](_0x3e40c9){return _0x3e40c9==='sum'||_0x3e40c9==='avg'||_0x3e40c9==='count';}static['isMedianMetric'](_0x2cd0a3){return _0x2cd0a3==='mdn';}static['isIndexMetric'](_0x3d85c5){return _0x3d85c5==='index';}['resolveMetric']({metric:_0x2ddba3,target:_0x4b937d},_0x2d4758){const _0x1622f2=new pipe_1['Pipe']([[_0x4b937d]],_0x2d4758),_0x2212d4=_0x1622f2['process']()['toString'](),_0x2cba1f=this['resolveTarget'](_0x2ddba3,_0x4b937d,_0x2212d4);if(_0x2ddba3==='index')return{'metric':_0x2ddba3,'target':_0x2cba1f,'value':_0x2d4758['metadata']['jid']};else{if(_0x2ddba3==='count')return{'metric':_0x2ddba3,'target':_0x2cba1f,'value':0x1};}return{'metric':_0x2ddba3,'target':_0x2cba1f,'value':_0x2212d4};}['isCardinalMetric'](_0x3573d2){return _0x3573d2==='index'||_0x3573d2==='count';}['resolveTarget'](_0x20955f,_0x3c3b03,_0x13b56a){const _0x537b4c=_0x3c3b03['substring'](0x1,_0x3c3b03['length']-0x1),_0x307976=_0x537b4c['split']('.')['slice'](0x3)['join']('/');let _0x4fb4d1;return this['isCardinalMetric'](_0x20955f)?_0x4fb4d1=_0x20955f+':'+_0x307976+':'+_0x13b56a:_0x4fb4d1=_0x20955f+':'+_0x307976,_0x4fb4d1;}}exports['ReporterService']=ReporterService,ReporterService['DEFAULT_GRANULARITY']='5m';function _0x2bb5(){const _0x39f5bc=['1107915OhKaGC','96JcTBKF','205322KNcIry','48084dOtjKK','24kBkAGj','6AEjuAo','75568Aclqae','11wQGyfW','181827qrsHKc','111yMQQay','569650ScNDjS','203JNTdzY','4222sUvaob'];_0x2bb5=function(){return _0x39f5bc;};return _0x2bb5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _0x1852(){const _0x4fe15f=['42078wkFJBH','11CJbcuj','676036JXEAfb','3xHNHgM','1653390ZdkjjH','7926qPgVlB','5962376jdmSKs','610gmMgiI','15509770GwNHYd','8WSLpex','2394888oEtLWQ'];_0x1852=function(){return _0x4fe15f;};return _0x1852();}(function(_0x12e34f,_0x5da07a){const _0x4f30d6=_0x4746,_0x4e4132=_0x12e34f();while(!![]){try{const _0x40c8d7=-parseInt(_0x4f30d6(0x10c))/0x1*(-parseInt(_0x4f30d6(0x109))/0x2)+-parseInt(_0x4f30d6(0x108))/0x3+parseInt(_0x4f30d6(0x10b))/0x4+-parseInt(_0x4f30d6(0x105))/0x5*(-parseInt(_0x4f30d6(0x103))/0x6)+-parseInt(_0x4f30d6(0x104))/0x7+-parseInt(_0x4f30d6(0x107))/0x8*(-parseInt(_0x4f30d6(0x10d))/0x9)+parseInt(_0x4f30d6(0x106))/0xa*(parseInt(_0x4f30d6(0x10a))/0xb);if(_0x40c8d7===_0x5da07a)break;else _0x4e4132['push'](_0x4e4132['shift']());}catch(_0x3264e8){_0x4e4132['push'](_0x4e4132['shift']());}}}(_0x1852,0x74ad7));function _0x4746(_0x3d4c5c,_0x22c1eb){const _0x1852d2=_0x1852();return _0x4746=function(_0x4746bd,_0x32482a){_0x4746bd=_0x4746bd-0x103;let _0x551fb9=_0x1852d2[_0x4746bd];return _0x551fb9;},_0x4746(_0x3d4c5c,_0x22c1eb);}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');class Router{constructor(_0x38b9b3,_0x96c59a,_0x532cd0){this['throttle']=0x0,this['errorCount']=0x0,this['counts']={},this['currentTimerId']=null,this['sleepPromiseResolve']=null,this['innerPromiseResolve']=null,this['isSleeping']=![],this['sleepTimout']=null,this['appId']=_0x38b9b3['appId'],this['guid']=_0x38b9b3['guid'],this['role']=_0x38b9b3['role'],this['topic']=_0x38b9b3['topic'],this['stream']=_0x96c59a,this['throttle']=_0x38b9b3['throttle'],this['reclaimDelay']=_0x38b9b3['reclaimDelay']||enums_1['HMSH_XCLAIM_DELAY_MS'],this['reclaimCount']=_0x38b9b3['reclaimCount']||enums_1['HMSH_XCLAIM_COUNT'],this['logger']=_0x532cd0,this['readonly']=_0x38b9b3['readonly']||![],this['resetThrottleState']();}['resetThrottleState'](){this['sleepPromiseResolve']=null,this['innerPromiseResolve']=null,this['isSleeping']=![],this['sleepTimout']=null;}async['createGroup'](_0x329139,_0x123cf7){try{await this['stream']['createConsumerGroup'](_0x329139,_0x123cf7);}catch(_0x3ffc39){this['logger']['debug']('router-stream-group-exists',{'stream':_0x329139,'group':_0x123cf7});}}async['publishMessage'](_0x57b278,_0x2531d4,_0x36d44b){const _0x136e1a=_0x2531d4?.['code']||'200';this['counts'][_0x136e1a]=(this['counts'][_0x136e1a]||0x0)+0x1;const _0xd42481=this['stream']['mintKey'](key_1['KeyType']['STREAMS'],{'topic':_0x57b278}),_0x449f1b=await this['stream']['publishMessages'](_0xd42481,[JSON['stringify'](_0x2531d4)],{'transaction':_0x36d44b});return _0x449f1b[0x0];}async['customSleep'](){if(this['throttle']===0x0)return;if(this['isSleeping'])return;this['isSleeping']=!![];const _0x546ac5=Date['now']();await new Promise(async _0x591a34=>{this['sleepPromiseResolve']=_0x591a34;let _0x2b0db6=Date['now']()-_0x546ac5;while(_0x2b0db6<this['throttle']){await new Promise(_0x2ae184=>{this['innerPromiseResolve']=_0x2ae184,this['sleepTimout']=setTimeout(_0x2ae184,this['throttle']-_0x2b0db6);}),_0x2b0db6=Date['now']()-_0x546ac5;}this['resetThrottleState'](),_0x591a34();});}async['consumeMessages'](_0x5dfe47,_0x9a2bbb,_0x472cd5,_0x2e3481){if(this['readonly']){this['logger']['info']('router-stream-readonly',{'group':_0x9a2bbb,'consumer':_0x472cd5,'stream':_0x5dfe47});return;}this['logger']['info']('router-stream-starting',{'group':_0x9a2bbb,'consumer':_0x472cd5,'stream':_0x5dfe47}),Router['instances']['add'](this),this['shouldConsume']=!![],await this['createGroup'](_0x5dfe47,_0x9a2bbb);let _0x417ee3=Date['now']();async function _0x2a4e32(){await this['customSleep']();if(this['isStopped'](_0x9a2bbb,_0x472cd5,_0x5dfe47))return;else{if(this['isPaused']()){setImmediate(_0x2a4e32['bind'](this));return;}}const _0x54429e=enums_1['HMSH_BLOCK_TIME_MS']+Math['round'](enums_1['HMSH_BLOCK_TIME_MS']*Math['random']());try{const _0xcec342=await this['stream']['consumeMessages'](_0x5dfe47,_0x9a2bbb,_0x472cd5,{'blockTimeout':_0x54429e});if(this['isStopped'](_0x9a2bbb,_0x472cd5,_0x5dfe47))return;else{if(this['isPaused']()){setImmediate(_0x2a4e32['bind'](this));return;}}for(let _0x4a9092=0x0;_0x4a9092<_0xcec342['length'];_0x4a9092++){const _0x401a69=_0xcec342[_0x4a9092];await this['consumeOne'](_0x5dfe47,_0x9a2bbb,_0x401a69['id'],_0x401a69['data'],_0x2e3481);}const _0x10ad26=Date['now']();if(this['stream']['getProviderSpecificFeatures']()['supportsRetry']&&_0x10ad26-_0x417ee3>this['reclaimDelay']){_0x417ee3=_0x10ad26;const _0x6cc215=await this['stream']['retryMessages'](_0x5dfe47,_0x9a2bbb,{'consumerName':_0x472cd5,'minIdleTime':this['reclaimDelay'],'limit':enums_1['HMSH_XPENDING_COUNT']});for(let _0x1a4267=0x0;_0x1a4267<_0x6cc215['length'];_0x1a4267++){const _0x55eddc=_0x6cc215[_0x1a4267];await this['consumeOne'](_0x5dfe47,_0x9a2bbb,_0x55eddc['id'],_0x55eddc['data'],_0x2e3481);}}setImmediate(_0x2a4e32['bind'](this));}catch(_0x2070fc){if(this['shouldConsume']&&process['env']['NODE_ENV']!=='test'){this['logger']['error']('router-stream-error',{'err':_0x2070fc,'stream':_0x5dfe47,'group':_0x9a2bbb,'consumer':_0x472cd5}),this['errorCount']++;const _0x3c743a=Math['min'](enums_1['HMSH_GRADUATED_INTERVAL_MS']*0x2**this['errorCount'],enums_1['HMSH_MAX_TIMEOUT_MS']);setTimeout(_0x2a4e32['bind'](this),_0x3c743a);}}}_0x2a4e32['call'](this);}['isStreamMessage'](_0x52aab8){return Array['isArray'](_0x52aab8)&&Array['isArray'](_0x52aab8[0x0]);}['isPaused'](){return this['throttle']===enums_1['MAX_DELAY'];}['isStopped'](_0x561d19,_0x42c36d,_0x19480e){return!this['shouldConsume']&&this['logger']['info']('router-stream-stopped',{'group':_0x561d19,'consumer':_0x42c36d,'stream':_0x19480e}),!this['shouldConsume'];}async['consumeOne'](_0xd91aa3,_0x367ad3,_0x472462,_0x269bec,_0x1245bc){this['logger']['debug']('stream-read-one',{'group':_0x367ad3,'stream':_0xd91aa3,'id':_0x472462});let _0x412bc7,_0x30c863;try{_0x30c863=new telemetry_1['TelemetryService'](this['appId']),_0x30c863['startStreamSpan'](_0x269bec,this['role']),_0x412bc7=await this['execStreamLeg'](_0x269bec,_0xd91aa3,_0x472462,_0x1245bc['bind'](this)),_0x412bc7?.['status']===stream_1['StreamStatus']['ERROR']&&_0x30c863['setStreamError']('Function\x20Status\x20Code\x20'+(_0x412bc7['code']||enums_1['HMSH_CODE_UNKNOWN'])),this['errorCount']=0x0;}catch(_0x4f52ec){this['logger']['error']('stream-read-one-error',{'group':_0x367ad3,'stream':_0xd91aa3,'id':_0x472462,'err':_0x4f52ec}),_0x30c863['setStreamError'](_0x4f52ec['message']);}const _0x1fd13c=await this['publishResponse'](_0x269bec,_0x412bc7);_0x30c863['setStreamAttributes']({'app.worker.mid':_0x1fd13c}),await this['ackAndDelete'](_0xd91aa3,_0x367ad3,_0x472462),_0x30c863['endStreamSpan'](),this['logger']['debug']('stream-read-one-end',{'group':_0x367ad3,'stream':_0xd91aa3,'id':_0x472462});}async['execStreamLeg'](_0x4a3dd4,_0x31fbf3,_0x9fa5ca,_0x36a72c){let _0x4ede35;try{_0x4ede35=await _0x36a72c(_0x4a3dd4);}catch(_0x230609){this['logger']['error']('stream-call-function-error',{..._0x230609,'input':_0x4a3dd4,'stack':_0x230609['stack'],'message':_0x230609['message'],'name':_0x230609['name'],'stream':_0x31fbf3,'id':_0x9fa5ca}),_0x4ede35=this['structureUnhandledError'](_0x4a3dd4,_0x230609);}return _0x4ede35;}async['ackAndDelete'](_0x47d293,_0x141ba3,_0x290ae8){await this['stream']['ackAndDelete'](_0x47d293,_0x141ba3,[_0x290ae8]);}async['publishResponse'](_0x131b61,_0x6e7007){if(_0x6e7007&&typeof _0x6e7007==='object'){if(_0x6e7007['status']==='error'){const [_0x1dabcd,_0x35699c]=this['shouldRetry'](_0x131b61,_0x6e7007);if(_0x1dabcd)return await(0x0,utils_1['sleepFor'])(_0x35699c),await this['publishMessage'](_0x131b61['metadata']['topic'],{'data':_0x131b61['data'],'metadata':{..._0x131b61['metadata'],'try':(_0x131b61['metadata']['try']||0x0)+0x1},'policies':_0x131b61['policies']});else _0x6e7007=this['structureError'](_0x131b61,_0x6e7007);}else typeof _0x6e7007['metadata']!=='object'?_0x6e7007['metadata']={..._0x131b61['metadata'],'guid':(0x0,utils_1['guid'])()}:_0x6e7007['metadata']['guid']=(0x0,utils_1['guid'])();return _0x6e7007['type']=stream_1['StreamDataType']['RESPONSE'],await this['publishMessage'](null,_0x6e7007);}}['shouldRetry'](_0x5bd8c4,_0x23c347){const _0x37f55d=_0x5bd8c4['policies']?.['retry'],_0x1f431d=_0x23c347['code']['toString'](),_0x56e3f3=_0x37f55d?.[_0x1f431d],_0x49317b=_0x56e3f3?.[0x0],_0x230e55=Math['min'](_0x5bd8c4['metadata']['try']||0x0,enums_1['HMSH_MAX_RETRIES']);if(_0x49317b>_0x230e55)return[!![],Math['pow'](0xa,_0x230e55+0x1)];return[![],0x0];}['structureUnhandledError'](_0x53d29a,_0x8e5fb4){const _0x1ec40e={};return typeof _0x8e5fb4['message']==='string'?_0x1ec40e['message']=_0x8e5fb4['message']:_0x1ec40e['message']=enums_1['HMSH_STATUS_UNKNOWN'],typeof _0x8e5fb4['stack']==='string'&&(_0x1ec40e['stack']=_0x8e5fb4['stack']),typeof _0x8e5fb4['name']==='string'&&(_0x1ec40e['name']=_0x8e5fb4['name']),{'status':'error','code':enums_1['HMSH_CODE_UNKNOWN'],'metadata':{..._0x53d29a['metadata'],'guid':(0x0,utils_1['guid'])()},'data':_0x1ec40e};}['structureUnacknowledgedError'](_0x43a941){const _0x47205e='stream\x20message\x20max\x20delivery\x20count\x20exceeded',_0x47111e=enums_1['HMSH_CODE_UNACKED'],_0x4e6aa0={'message':_0x47205e,'code':_0x47111e},_0x3c93ad={'metadata':{..._0x43a941['metadata'],'guid':(0x0,utils_1['guid'])()},'status':stream_1['StreamStatus']['ERROR'],'code':_0x47111e,'data':_0x4e6aa0};return delete _0x3c93ad['metadata']['topic'],_0x3c93ad;}['structureError'](_0x5112be,_0x2bc8e6){const _0x73717e=_0x2bc8e6['data']?.['message']?_0x2bc8e6['data']?.['message']['toString']():enums_1['HMSH_STATUS_UNKNOWN'],_0x11c218=_0x2bc8e6['code']||_0x2bc8e6['data']?.['code'],_0x343712=isNaN(_0x11c218)?enums_1['HMSH_CODE_UNKNOWN']:parseInt(_0x11c218['toString']()),_0x1672df=_0x2bc8e6['data']?.['stack']?_0x2bc8e6['data']?.['stack']['toString']():undefined,_0x4e23c1={'message':_0x73717e,'code':_0x343712,'stack':_0x1672df};return typeof _0x2bc8e6['data']?.['error']==='object'&&(_0x4e23c1['error']={..._0x2bc8e6['data']['error']}),{'status':stream_1['StreamStatus']['ERROR'],'code':_0x343712,'stack':_0x1672df,'metadata':{..._0x5112be['metadata'],'guid':(0x0,utils_1['guid'])()},'data':_0x4e23c1};}static async['stopConsuming'](){for(const _0x6b97df of[...Router['instances']]){_0x6b97df['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'](_0x8a6172){if(!Number['isInteger'](_0x8a6172)||_0x8a6172<0x0||_0x8a6172>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 _0x4ae9d1=_0x8a6172<this['throttle'];this['throttle']=_0x8a6172,_0x4ae9d1&&(this['sleepTimout']&&clearTimeout(this['sleepTimout']),this['innerPromiseResolve']&&this['innerPromiseResolve']());}}exports['Router']=Router,Router['instances']=new Set();
|
|
1
|
+
'use strict';(function(_0x1af5f2,_0xf492a7){const _0x4ab88a=_0x539e,_0x3ef0ba=_0x1af5f2();while(!![]){try{const _0x1ad598=-parseInt(_0x4ab88a(0xe1))/0x1+-parseInt(_0x4ab88a(0xdd))/0x2*(-parseInt(_0x4ab88a(0xdf))/0x3)+parseInt(_0x4ab88a(0xda))/0x4*(-parseInt(_0x4ab88a(0xdb))/0x5)+parseInt(_0x4ab88a(0xe3))/0x6+parseInt(_0x4ab88a(0xe4))/0x7*(parseInt(_0x4ab88a(0xe0))/0x8)+parseInt(_0x4ab88a(0xdc))/0x9*(parseInt(_0x4ab88a(0xe2))/0xa)+parseInt(_0x4ab88a(0xde))/0xb;if(_0x1ad598===_0xf492a7)break;else _0x3ef0ba['push'](_0x3ef0ba['shift']());}catch(_0x1b9798){_0x3ef0ba['push'](_0x3ef0ba['shift']());}}}(_0x2466,0x864a6));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 _0x539e(_0x20c91e,_0x165886){const _0x24666d=_0x2466();return _0x539e=function(_0x539e9f,_0x3bc91f){_0x539e9f=_0x539e9f-0xda;let _0x27f0e1=_0x24666d[_0x539e9f];return _0x27f0e1;},_0x539e(_0x20c91e,_0x165886);}class Router{constructor(_0x43a539,_0x2fef02,_0x1b0a56){this['throttle']=0x0,this['errorCount']=0x0,this['counts']={},this['currentTimerId']=null,this['sleepPromiseResolve']=null,this['innerPromiseResolve']=null,this['isSleeping']=![],this['sleepTimout']=null,this['appId']=_0x43a539['appId'],this['guid']=_0x43a539['guid'],this['role']=_0x43a539['role'],this['topic']=_0x43a539['topic'],this['stream']=_0x2fef02,this['throttle']=_0x43a539['throttle'],this['reclaimDelay']=_0x43a539['reclaimDelay']||enums_1['HMSH_XCLAIM_DELAY_MS'],this['reclaimCount']=_0x43a539['reclaimCount']||enums_1['HMSH_XCLAIM_COUNT'],this['logger']=_0x1b0a56,this['readonly']=_0x43a539['readonly']||![],this['resetThrottleState']();}['resetThrottleState'](){this['sleepPromiseResolve']=null,this['innerPromiseResolve']=null,this['isSleeping']=![],this['sleepTimout']=null;}async['createGroup'](_0x197aa2,_0xa7f9b4){try{await this['stream']['createConsumerGroup'](_0x197aa2,_0xa7f9b4);}catch(_0xd3de61){this['logger']['debug']('router-stream-group-exists',{'stream':_0x197aa2,'group':_0xa7f9b4});}}async['publishMessage'](_0x1cdc46,_0x55fcb8,_0x12056e){const _0x110707=_0x55fcb8?.['code']||'200';this['counts'][_0x110707]=(this['counts'][_0x110707]||0x0)+0x1;const _0x3cf3b8=this['stream']['mintKey'](key_1['KeyType']['STREAMS'],{'topic':_0x1cdc46}),_0x3382a6=await this['stream']['publishMessages'](_0x3cf3b8,[JSON['stringify'](_0x55fcb8)],{'transaction':_0x12056e});return _0x3382a6[0x0];}async['customSleep'](){if(this['throttle']===0x0)return;if(this['isSleeping'])return;this['isSleeping']=!![];const _0x2c1218=Date['now']();await new Promise(async _0x3a877e=>{this['sleepPromiseResolve']=_0x3a877e;let _0x539a6a=Date['now']()-_0x2c1218;while(_0x539a6a<this['throttle']){await new Promise(_0x82b54a=>{this['innerPromiseResolve']=_0x82b54a,this['sleepTimout']=setTimeout(_0x82b54a,this['throttle']-_0x539a6a);}),_0x539a6a=Date['now']()-_0x2c1218;}this['resetThrottleState'](),_0x3a877e();});}async['consumeMessages'](_0x4bfd12,_0xf654a,_0x3be255,_0x22a410){if(this['readonly']){this['logger']['info']('router-stream-readonly',{'group':_0xf654a,'consumer':_0x3be255,'stream':_0x4bfd12});return;}this['logger']['info']('router-stream-starting',{'group':_0xf654a,'consumer':_0x3be255,'stream':_0x4bfd12}),Router['instances']['add'](this),this['shouldConsume']=!![],await this['createGroup'](_0x4bfd12,_0xf654a);let _0x19de63=Date['now']();async function _0x497d2e(){await this['customSleep']();if(this['isStopped'](_0xf654a,_0x3be255,_0x4bfd12))return;else{if(this['isPaused']()){setImmediate(_0x497d2e['bind'](this));return;}}const _0x2d9299=enums_1['HMSH_BLOCK_TIME_MS']+Math['round'](enums_1['HMSH_BLOCK_TIME_MS']*Math['random']());try{const _0x5675fd=await this['stream']['consumeMessages'](_0x4bfd12,_0xf654a,_0x3be255,{'blockTimeout':_0x2d9299});if(this['isStopped'](_0xf654a,_0x3be255,_0x4bfd12))return;else{if(this['isPaused']()){setImmediate(_0x497d2e['bind'](this));return;}}for(let _0x12fa8e=0x0;_0x12fa8e<_0x5675fd['length'];_0x12fa8e++){const _0x58bfa6=_0x5675fd[_0x12fa8e];await this['consumeOne'](_0x4bfd12,_0xf654a,_0x58bfa6['id'],_0x58bfa6['data'],_0x22a410);}const _0x5c5c5c=Date['now']();if(this['stream']['getProviderSpecificFeatures']()['supportsRetry']&&_0x5c5c5c-_0x19de63>this['reclaimDelay']){_0x19de63=_0x5c5c5c;const _0xdeb06e=await this['stream']['retryMessages'](_0x4bfd12,_0xf654a,{'consumerName':_0x3be255,'minIdleTime':this['reclaimDelay'],'limit':enums_1['HMSH_XPENDING_COUNT']});for(let _0x55e121=0x0;_0x55e121<_0xdeb06e['length'];_0x55e121++){const _0x45cace=_0xdeb06e[_0x55e121];await this['consumeOne'](_0x4bfd12,_0xf654a,_0x45cace['id'],_0x45cace['data'],_0x22a410);}}setImmediate(_0x497d2e['bind'](this));}catch(_0x521899){if(this['shouldConsume']&&process['env']['NODE_ENV']!=='test'){this['logger']['error']('router-stream-error',{'err':_0x521899,'stream':_0x4bfd12,'group':_0xf654a,'consumer':_0x3be255}),this['errorCount']++;const _0x20bf96=Math['min'](enums_1['HMSH_GRADUATED_INTERVAL_MS']*0x2**this['errorCount'],enums_1['HMSH_MAX_TIMEOUT_MS']);setTimeout(_0x497d2e['bind'](this),_0x20bf96);}}}_0x497d2e['call'](this);}['isStreamMessage'](_0x12ecc6){return Array['isArray'](_0x12ecc6)&&Array['isArray'](_0x12ecc6[0x0]);}['isPaused'](){return this['throttle']===enums_1['MAX_DELAY'];}['isStopped'](_0x511956,_0x2a8a78,_0x55f107){return!this['shouldConsume']&&this['logger']['info']('router-stream-stopped',{'group':_0x511956,'consumer':_0x2a8a78,'stream':_0x55f107}),!this['shouldConsume'];}async['consumeOne'](_0xf6bc1c,_0x19068a,_0xd4b8ab,_0x32d698,_0x5a250a){this['logger']['debug']('stream-read-one',{'group':_0x19068a,'stream':_0xf6bc1c,'id':_0xd4b8ab});let _0xbc1273,_0xd2fbf3;try{_0xd2fbf3=new telemetry_1['TelemetryService'](this['appId']),_0xd2fbf3['startStreamSpan'](_0x32d698,this['role']),_0xbc1273=await this['execStreamLeg'](_0x32d698,_0xf6bc1c,_0xd4b8ab,_0x5a250a['bind'](this)),_0xbc1273?.['status']===stream_1['StreamStatus']['ERROR']&&_0xd2fbf3['setStreamError']('Function\x20Status\x20Code\x20'+(_0xbc1273['code']||enums_1['HMSH_CODE_UNKNOWN'])),this['errorCount']=0x0;}catch(_0x5770f2){this['logger']['error']('stream-read-one-error',{'group':_0x19068a,'stream':_0xf6bc1c,'id':_0xd4b8ab,'err':_0x5770f2}),_0xd2fbf3['setStreamError'](_0x5770f2['message']);}const _0x7dcf05=await this['publishResponse'](_0x32d698,_0xbc1273);_0xd2fbf3['setStreamAttributes']({'app.worker.mid':_0x7dcf05}),await this['ackAndDelete'](_0xf6bc1c,_0x19068a,_0xd4b8ab),_0xd2fbf3['endStreamSpan'](),this['logger']['debug']('stream-read-one-end',{'group':_0x19068a,'stream':_0xf6bc1c,'id':_0xd4b8ab});}async['execStreamLeg'](_0x1e1b35,_0x6a4d48,_0x4805b1,_0x42e339){let _0x26e385;try{_0x26e385=await _0x42e339(_0x1e1b35);}catch(_0x5e67fc){this['logger']['error']('stream-call-function-error',{..._0x5e67fc,'input':_0x1e1b35,'stack':_0x5e67fc['stack'],'message':_0x5e67fc['message'],'name':_0x5e67fc['name'],'stream':_0x6a4d48,'id':_0x4805b1}),_0x26e385=this['structureUnhandledError'](_0x1e1b35,_0x5e67fc);}return _0x26e385;}async['ackAndDelete'](_0x46016c,_0x38e901,_0x2b7ef5){await this['stream']['ackAndDelete'](_0x46016c,_0x38e901,[_0x2b7ef5]);}async['publishResponse'](_0x22fdfd,_0x20d8d8){if(_0x20d8d8&&typeof _0x20d8d8==='object'){if(_0x20d8d8['status']==='error'){const [_0x19a3a2,_0x5f32e9]=this['shouldRetry'](_0x22fdfd,_0x20d8d8);if(_0x19a3a2)return await(0x0,utils_1['sleepFor'])(_0x5f32e9),await this['publishMessage'](_0x22fdfd['metadata']['topic'],{'data':_0x22fdfd['data'],'metadata':{..._0x22fdfd['metadata'],'try':(_0x22fdfd['metadata']['try']||0x0)+0x1},'policies':_0x22fdfd['policies']});else _0x20d8d8=this['structureError'](_0x22fdfd,_0x20d8d8);}else typeof _0x20d8d8['metadata']!=='object'?_0x20d8d8['metadata']={..._0x22fdfd['metadata'],'guid':(0x0,utils_1['guid'])()}:_0x20d8d8['metadata']['guid']=(0x0,utils_1['guid'])();return _0x20d8d8['type']=stream_1['StreamDataType']['RESPONSE'],await this['publishMessage'](null,_0x20d8d8);}}['shouldRetry'](_0x5e79f3,_0x5a1b20){const _0x342f76=_0x5e79f3['policies']?.['retry'],_0x75082=_0x5a1b20['code']['toString'](),_0x464320=_0x342f76?.[_0x75082],_0x42a878=_0x464320?.[0x0],_0x4318f9=Math['min'](_0x5e79f3['metadata']['try']||0x0,enums_1['HMSH_MAX_RETRIES']);if(_0x42a878>_0x4318f9)return[!![],Math['pow'](0xa,_0x4318f9+0x1)];return[![],0x0];}['structureUnhandledError'](_0x348c77,_0x380a5e){const _0x41eaa1={};return typeof _0x380a5e['message']==='string'?_0x41eaa1['message']=_0x380a5e['message']:_0x41eaa1['message']=enums_1['HMSH_STATUS_UNKNOWN'],typeof _0x380a5e['stack']==='string'&&(_0x41eaa1['stack']=_0x380a5e['stack']),typeof _0x380a5e['name']==='string'&&(_0x41eaa1['name']=_0x380a5e['name']),{'status':'error','code':enums_1['HMSH_CODE_UNKNOWN'],'metadata':{..._0x348c77['metadata'],'guid':(0x0,utils_1['guid'])()},'data':_0x41eaa1};}['structureUnacknowledgedError'](_0x5294a9){const _0xb06314='stream\x20message\x20max\x20delivery\x20count\x20exceeded',_0x51973e=enums_1['HMSH_CODE_UNACKED'],_0x2a5649={'message':_0xb06314,'code':_0x51973e},_0x5ea6bb={'metadata':{..._0x5294a9['metadata'],'guid':(0x0,utils_1['guid'])()},'status':stream_1['StreamStatus']['ERROR'],'code':_0x51973e,'data':_0x2a5649};return delete _0x5ea6bb['metadata']['topic'],_0x5ea6bb;}['structureError'](_0x353234,_0x301a2d){const _0x2aea86=_0x301a2d['data']?.['message']?_0x301a2d['data']?.['message']['toString']():enums_1['HMSH_STATUS_UNKNOWN'],_0x87cf88=_0x301a2d['code']||_0x301a2d['data']?.['code'],_0x1d8bd1=isNaN(_0x87cf88)?enums_1['HMSH_CODE_UNKNOWN']:parseInt(_0x87cf88['toString']()),_0xd32d4d=_0x301a2d['data']?.['stack']?_0x301a2d['data']?.['stack']['toString']():undefined,_0x520efb={'message':_0x2aea86,'code':_0x1d8bd1,'stack':_0xd32d4d};return typeof _0x301a2d['data']?.['error']==='object'&&(_0x520efb['error']={..._0x301a2d['data']['error']}),{'status':stream_1['StreamStatus']['ERROR'],'code':_0x1d8bd1,'stack':_0xd32d4d,'metadata':{..._0x353234['metadata'],'guid':(0x0,utils_1['guid'])()},'data':_0x520efb};}static async['stopConsuming'](){for(const _0x222bdd of[...Router['instances']]){_0x222bdd['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'](_0x4de1c8){if(!Number['isInteger'](_0x4de1c8)||_0x4de1c8<0x0||_0x4de1c8>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 _0x50aca4=_0x4de1c8<this['throttle'];this['throttle']=_0x4de1c8,_0x50aca4&&(this['sleepTimout']&&clearTimeout(this['sleepTimout']),this['innerPromiseResolve']&&this['innerPromiseResolve']());}}function _0x2466(){const _0x55e546=['48rcVXfd','651346nXOtUk','20DuxObW','4640616nmnDmZ','38283DVDSDX','3664vfhAQO','4880upSJwV','546597wdTUAa','2itZazx','6930517tdmiYC','1612959tmHqOw'];_0x2466=function(){return _0x55e546;};return _0x2466();}exports['Router']=Router,Router['instances']=new Set();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ILogger } from '../logger';
|
|
2
|
-
import { ProviderClient } from '../../types/provider';
|
|
3
2
|
import { SearchService } from './index';
|
|
3
|
+
import { ProviderClient } from '../../types/provider';
|
|
4
4
|
declare class SearchServiceFactory {
|
|
5
|
-
static init(
|
|
5
|
+
static init(providerClient: ProviderClient, storeProviderClient: ProviderClient | undefined, namespace: string, appId: string, logger: ILogger): Promise<SearchService<ProviderClient>>;
|
|
6
6
|
}
|
|
7
7
|
export { SearchServiceFactory };
|
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SearchServiceFactory = void 0;
|
|
4
4
|
const utils_1 = require("../../modules/utils");
|
|
5
|
+
const postgres_1 = require("./providers/postgres/postgres");
|
|
5
6
|
const ioredis_1 = require("./providers/redis/ioredis");
|
|
6
7
|
const redis_1 = require("./providers/redis/redis");
|
|
7
8
|
class SearchServiceFactory {
|
|
8
|
-
static async init(
|
|
9
|
+
static async init(providerClient, storeProviderClient, namespace, appId, logger) {
|
|
9
10
|
let service;
|
|
10
|
-
if ((0, utils_1.identifyProvider)(
|
|
11
|
-
service = new
|
|
11
|
+
if ((0, utils_1.identifyProvider)(providerClient) === 'postgres') {
|
|
12
|
+
service = new postgres_1.PostgresSearchService(providerClient, storeProviderClient);
|
|
13
|
+
}
|
|
14
|
+
else if ((0, utils_1.identifyProvider)(providerClient) === 'redis') {
|
|
15
|
+
service = new redis_1.RedisSearchService(providerClient, storeProviderClient);
|
|
12
16
|
}
|
|
13
17
|
else {
|
|
14
|
-
service = new ioredis_1.IORedisSearchService(
|
|
18
|
+
service = new ioredis_1.IORedisSearchService(providerClient, storeProviderClient);
|
|
15
19
|
}
|
|
16
20
|
await service.init(namespace, appId, logger);
|
|
17
21
|
return service;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SearchService } from '../../index';
|
|
2
|
+
import { ILogger } from '../../../logger';
|
|
3
|
+
import { PostgresClientType } from '../../../../types/postgres';
|
|
4
|
+
import { ProviderClient, ProviderTransaction } from '../../../../types/provider';
|
|
5
|
+
declare class PostgresSearchService extends SearchService<PostgresClientType & ProviderClient> {
|
|
6
|
+
pgClient: PostgresClientType;
|
|
7
|
+
transact(): ProviderTransaction;
|
|
8
|
+
constructor(searchClient: PostgresClientType & ProviderClient, storeClient?: PostgresClientType & ProviderClient);
|
|
9
|
+
init(namespace: string, appId: string, logger: ILogger): Promise<void>;
|
|
10
|
+
createSearchIndex(indexName: string, prefixes: string[], schema: string[]): Promise<void>;
|
|
11
|
+
listSearchIndexes(): Promise<string[]>;
|
|
12
|
+
setFields(key: string, fields: Record<string, string>): Promise<number>;
|
|
13
|
+
getField(key: string, field: string): Promise<string>;
|
|
14
|
+
getFields(key: string, fields: string[]): Promise<string[]>;
|
|
15
|
+
getAllFields(key: string): Promise<Record<string, string>>;
|
|
16
|
+
deleteFields(key: string, fields: string[]): Promise<number>;
|
|
17
|
+
incrementFieldByFloat(key: string, field: string, increment: number): Promise<number>;
|
|
18
|
+
sendQuery(query: string): Promise<any>;
|
|
19
|
+
sendIndexedQuery(type: string, queryParams?: any[]): Promise<string[]>;
|
|
20
|
+
}
|
|
21
|
+
export { PostgresSearchService };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';(function(_0x16954f,_0x2c02e0){const _0x3eeea7=_0x3220,_0x2248d8=_0x16954f();while(!![]){try{const _0x573986=-parseInt(_0x3eeea7(0xc8))/0x1+parseInt(_0x3eeea7(0xd0))/0x2+parseInt(_0x3eeea7(0xc7))/0x3*(parseInt(_0x3eeea7(0xcf))/0x4)+-parseInt(_0x3eeea7(0xc9))/0x5*(parseInt(_0x3eeea7(0xcb))/0x6)+-parseInt(_0x3eeea7(0xcd))/0x7+parseInt(_0x3eeea7(0xcc))/0x8*(parseInt(_0x3eeea7(0xca))/0x9)+parseInt(_0x3eeea7(0xce))/0xa;if(_0x573986===_0x2c02e0)break;else _0x2248d8['push'](_0x2248d8['shift']());}catch(_0x537555){_0x2248d8['push'](_0x2248d8['shift']());}}}(_0x80b7,0x65919));function _0x3220(_0x40a68b,_0x132a61){const _0x80b7e1=_0x80b7();return _0x3220=function(_0x32204c,_0x22e11a){_0x32204c=_0x32204c-0xc7;let _0x3aa93f=_0x80b7e1[_0x32204c];return _0x3aa93f;},_0x3220(_0x40a68b,_0x132a61);}function _0x80b7(){const _0x3e8173=['6AiVYIL','5272bvrbPz','4571441KGnlaU','2190010YjruCJ','8ycoxQJ','1307296hzWAMq','1100607UHrvHO','315611fPVVyA','1289665JTQsGF','495SujTpX'];_0x80b7=function(){return _0x3e8173;};return _0x80b7();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['PostgresSearchService']=void 0x0;const index_1=require('../../index'),kvsql_1=require('../../../store/providers/postgres/kvsql');class PostgresSearchService extends index_1['SearchService']{['transact'](){return this['storeClient']['transact']();}constructor(_0x20b902,_0x16e96a){super(_0x20b902,_0x16e96a),this['pgClient']=_0x20b902,this['searchClient']=new kvsql_1['KVSQL'](_0x20b902,this['namespace'],this['appId']);}async['init'](_0x4836c4,_0x36bd8c,_0x187f7c){this['searchClient']['namespace']=this['namespace']=_0x4836c4,this['searchClient']['appId']=this['appId']=_0x36bd8c,this['namespace']=_0x4836c4,this['appId']=_0x36bd8c,this['logger']=_0x187f7c;}async['createSearchIndex'](_0x197a48,_0xf8ae45,_0x348bc5){}async['listSearchIndexes'](){return[];}async['setFields'](_0x38661a,_0x31fab9){try{const _0x2e8a63=await this['searchClient']['hset'](_0x38661a,_0x31fab9);return Number(_0x2e8a63);}catch(_0x29b092){this['logger']['error']('postgres-search-set-fields-error',{'key':_0x38661a,..._0x29b092});throw _0x29b092;}}async['getField'](_0x5eb150,_0x35974b){try{return await this['searchClient']['hget'](_0x5eb150,_0x35974b);}catch(_0xa24b93){this['logger']['error']('postgres-search-get-field-error',{'key':_0x5eb150,'field':_0x35974b,..._0xa24b93});throw _0xa24b93;}}async['getFields'](_0x212368,_0x16fdac){try{return await this['searchClient']['hmget'](_0x212368,[..._0x16fdac]);}catch(_0x5580a3){this['logger']['error']('postgres-search-get-fields-error',{'key':_0x212368,'fields':_0x16fdac,..._0x5580a3});throw _0x5580a3;}}async['getAllFields'](_0x21ca31){try{return await this['searchClient']['hgetall'](_0x21ca31);}catch(_0x15941f){this['logger']['error']('postgres-search-get-all-fields-error',{'key':_0x21ca31,..._0x15941f});throw _0x15941f;}}async['deleteFields'](_0x5da8bd,_0x5df03d){try{const _0x391fb3=await this['searchClient']['hdel'](_0x5da8bd,..._0x5df03d);return Number(_0x391fb3);}catch(_0x54184f){this['logger']['error']('postgres-delete-fields-error',{'key':_0x5da8bd,'fields':_0x5df03d,..._0x54184f});throw _0x54184f;}}async['incrementFieldByFloat'](_0x50ff3a,_0x11197a,_0x35ee5d){try{const _0x3bb0fd=await this['searchClient']['hincrbyfloat'](_0x50ff3a,_0x11197a,_0x35ee5d);return Number(_0x3bb0fd);}catch(_0x510417){this['logger']['error']('postgres-increment-field-error',{'key':_0x50ff3a,'field':_0x11197a,..._0x510417});throw _0x510417;}}async['sendQuery'](_0x5cdb9c){try{return await this['pgClient']['query'](_0x5cdb9c);}catch(_0xcc9df){this['logger']['error']('postgres-send-query-error',{'query':_0x5cdb9c,..._0xcc9df});throw _0xcc9df;}}async['sendIndexedQuery'](_0x12518f,_0x12e94d=[]){const [_0x56c970,..._0x1f9f54]=_0x12e94d;try{const _0x2bb616=await this['pgClient']['query'](_0x56c970,_0x1f9f54['length']?_0x1f9f54:undefined);return _0x2bb616['rows'];}catch(_0x174efc){console['error']('error',_0x174efc),this['logger']['error']('postgres-send-indexed-query-error',{'query':_0x56c970,..._0x174efc});throw _0x174efc;}}}exports['PostgresSearchService']=PostgresSearchService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x5b05db,_0x4563ee){const _0x3a48ea=_0x1061,_0x628cca=_0x5b05db();while(!![]){try{const _0x25c756=-parseInt(_0x3a48ea(0x138))/0x1*(-parseInt(_0x3a48ea(0x13c))/0x2)+parseInt(_0x3a48ea(0x13e))/0x3+parseInt(_0x3a48ea(0x137))/0x4*(parseInt(_0x3a48ea(0x13a))/0x5)+parseInt(_0x3a48ea(0x140))/0x6*(parseInt(_0x3a48ea(0x139))/0x7)+-parseInt(_0x3a48ea(0x13d))/0x8*(-parseInt(_0x3a48ea(0x141))/0x9)+parseInt(_0x3a48ea(0x13b))/0xa*(parseInt(_0x3a48ea(0x136))/0xb)+-parseInt(_0x3a48ea(0x13f))/0xc;if(_0x25c756===_0x4563ee)break;else _0x628cca['push'](_0x628cca['shift']());}catch(_0x406bd3){_0x628cca['push'](_0x628cca['shift']());}}}(_0x44e6,0xdf197));function _0x1061(_0x311a69,_0x4b2b95){const _0x44e65f=_0x44e6();return _0x1061=function(_0x10614f,_0x3e5653){_0x10614f=_0x10614f-0x136;let _0x4da0ea=_0x44e65f[_0x10614f];return _0x4da0ea;},_0x1061(_0x311a69,_0x4b2b95);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['IORedisSearchService']=void 0x0;function _0x44e6(){const _0x2306c1=['69185pVNetP','1705330jIgCJd','178lOQjMP','1384gXfjMc','2269875XvaXaM','59676324wXyasf','561366IrneQj','90711ukKpyX','99VfUCdw','4tXqarR','17497kLTqfK','21TavmIe'];_0x44e6=function(){return _0x2306c1;};return _0x44e6();}const index_1=require('../../index');class IORedisSearchService extends index_1['SearchService']{constructor(_0x11d897,_0x540ab7){super(_0x11d897,_0x540ab7);}async['init'](_0x3e80d0,_0x503ef0,_0x2e68eb){this['namespace']=_0x3e80d0,this['appId']=_0x503ef0,this['logger']=_0x2e68eb;}async['createSearchIndex'](_0x11babb,_0x11170d,_0x541f74){try{await this['searchClient']['call']('FT.CREATE',_0x11babb,'ON','HASH','PREFIX',_0x11170d['length']['toString'](),..._0x11170d,'SCHEMA',..._0x541f74);}catch(_0x3ff9dc){this['logger']['info']('Error\x20creating\x20search\x20index',{'error':_0x3ff9dc});throw _0x3ff9dc;}}async['listSearchIndexes'](){try{const _0x3af5cc=await this['searchClient']['call']('FT._LIST');return _0x3af5cc;}catch(_0x575245){this['logger']['info']('Error\x20listing\x20search\x20indexes',{'error':_0x575245});throw _0x575245;}}async['setFields'](_0x14a85c,_0x37d55d){try{const _0x55de45=await this['searchClient']['hset'](_0x14a85c,_0x37d55d);return Number(_0x55de45);}catch(_0x41b2c7){this['logger']['error']('Error\x20setting\x20fields\x20for\x20key:\x20'+_0x14a85c,{'error':_0x41b2c7});throw _0x41b2c7;}}async['getField'](_0x203fc7,_0x3f0d8a){try{return await this['searchClient']['hget'](_0x203fc7,_0x3f0d8a);}catch(_0xb06865){this['logger']['error']('Error\x20getting\x20field\x20'+_0x3f0d8a+'\x20for\x20key:\x20'+_0x203fc7,{'error':_0xb06865});throw _0xb06865;}}async['getFields'](_0x4da995,_0x62c0b3){try{return await this['searchClient']['hmget'](_0x4da995,[..._0x62c0b3]);}catch(_0x1f806b){this['logger']['error']('Error\x20getting\x20fields\x20for\x20key:\x20'+_0x4da995,{'error':_0x1f806b});throw _0x1f806b;}}async['getAllFields'](_0x543333){try{return await this['searchClient']['hgetall'](_0x543333);}catch(_0x5e877e){this['logger']['error']('Error\x20getting\x20fields\x20for\x20key:\x20'+_0x543333,{'error':_0x5e877e});throw _0x5e877e;}}async['deleteFields'](_0x42f84f,_0x3ff0a3){try{const _0x97f2d3=await this['searchClient']['hdel'](_0x42f84f,..._0x3ff0a3);return Number(_0x97f2d3);}catch(_0x474360){this['logger']['error']('Error\x20deleting\x20fields\x20for\x20key:\x20'+_0x42f84f,{'error':_0x474360});throw _0x474360;}}async['incrementFieldByFloat'](_0x5c9637,_0x15272c,_0x194251){try{const _0x413f1a=await this['searchClient']['hincrbyfloat'](_0x5c9637,_0x15272c,_0x194251);return Number(_0x413f1a);}catch(_0x1760a0){this['logger']['error']('Error\x20incrementing\x20field\x20'+_0x15272c+'\x20for\x20key:\x20'+_0x5c9637,{'error':_0x1760a0});throw _0x1760a0;}}async['sendQuery'](..._0x2811ff){try{return await this['searchClient']['call'](..._0x2811ff);}catch(_0x2155c2){this['logger']['error']('Error\x20executing\x20query',{'error':_0x2155c2});throw _0x2155c2;}}async['sendIndexedQuery'](_0x374652,_0x325a31){try{if(_0x325a31[0x0]?.['startsWith']('FT.')){const [_0xd7b7a4,..._0x1946b6]=_0x325a31;return await this['searchClient']['call'](_0xd7b7a4,..._0x1946b6);}return await this['searchClient']['call']('FT.SEARCH',_0x374652,..._0x325a31);}catch(_0x4f8544){this['logger']['error']('Error\x20executing\x20query',{'error':_0x4f8544});throw _0x4f8544;}}}exports['IORedisSearchService']=IORedisSearchService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x453e7d,_0x4a5c21){const _0x385fc0=_0x94e5,_0x224aef=_0x453e7d();while(!![]){try{const _0x19ccf0=-parseInt(_0x385fc0(0x71))/0x1*(-parseInt(_0x385fc0(0x70))/0x2)+parseInt(_0x385fc0(0x72))/0x3+parseInt(_0x385fc0(0x78))/0x4+-parseInt(_0x385fc0(0x73))/0x5+parseInt(_0x385fc0(0x76))/0x6+parseInt(_0x385fc0(0x74))/0x7*(-parseInt(_0x385fc0(0x77))/0x8)+-parseInt(_0x385fc0(0x75))/0x9;if(_0x19ccf0===_0x4a5c21)break;else _0x224aef['push'](_0x224aef['shift']());}catch(_0x428830){_0x224aef['push'](_0x224aef['shift']());}}}(_0x2bf7,0x44263));function _0x2bf7(){const _0x20ad77=['8541630lcmPLD','2931204jRajae','8760svftLJ','1891848iTNToT','64LutAlJ','5612eOQZIl','914307JspdRb','568075VycBBE','665uIZXbE'];_0x2bf7=function(){return _0x20ad77;};return _0x2bf7();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['RedisSearchService']=void 0x0;const index_1=require('../../index');function _0x94e5(_0x40ce68,_0x52fd16){const _0x2bf7a7=_0x2bf7();return _0x94e5=function(_0x94e5d6,_0x4f7585){_0x94e5d6=_0x94e5d6-0x70;let _0x16d911=_0x2bf7a7[_0x94e5d6];return _0x16d911;},_0x94e5(_0x40ce68,_0x52fd16);}class RedisSearchService extends index_1['SearchService']{constructor(_0x401e97,_0x3459b4){super(_0x401e97,_0x3459b4);}async['init'](_0x164ba1,_0x129f87,_0x275416){this['namespace']=_0x164ba1,this['appId']=_0x129f87,this['logger']=_0x275416;}async['createSearchIndex'](_0x5083e2,_0x1a4739,_0xbc856){try{await this['searchClient']['sendCommand'](['FT.CREATE',_0x5083e2,'ON','HASH','PREFIX',_0x1a4739['length']['toString'](),..._0x1a4739,'SCHEMA',..._0xbc856]);}catch(_0x108951){this['logger']['info']('Error\x20creating\x20search\x20index',{'error':_0x108951});throw _0x108951;}}async['listSearchIndexes'](){try{const _0x256fd9=await this['searchClient']['sendCommand'](['FT._LIST']);return _0x256fd9;}catch(_0x4bea04){this['logger']['info']('Error\x20listing\x20search\x20indexes',{'error':_0x4bea04});throw _0x4bea04;}}async['setFields'](_0x38c052,_0x31c64d){try{const _0x274ad2=await this['searchClient']['HSET'](_0x38c052,_0x31c64d);return Number(_0x274ad2);}catch(_0x232458){this['logger']['error']('Error\x20setting\x20fields\x20for\x20key:\x20'+_0x38c052,{'error':_0x232458});throw _0x232458;}}async['getField'](_0x4b4875,_0x5a38f6){try{return await this['searchClient']['HGET'](_0x4b4875,_0x5a38f6);}catch(_0x553eb9){this['logger']['error']('Error\x20getting\x20field\x20'+_0x5a38f6+'\x20for\x20key:\x20'+_0x4b4875,{'error':_0x553eb9});throw _0x553eb9;}}async['getFields'](_0x543f5b,_0x56f07f){try{return await this['searchClient']['HMGET'](_0x543f5b,[..._0x56f07f]);}catch(_0x32683){this['logger']['error']('Error\x20getting\x20fields\x20for\x20key:\x20'+_0x543f5b,{'error':_0x32683});throw _0x32683;}}async['getAllFields'](_0x3bc634){try{return await this['searchClient']['HGETALL'](_0x3bc634);}catch(_0x2fccb3){this['logger']['error']('Error\x20getting\x20fields\x20for\x20key:\x20'+_0x3bc634,{'error':_0x2fccb3});throw _0x2fccb3;}}async['deleteFields'](_0x497b2c,_0x5c4240){try{const _0x5a126=await this['searchClient']['HDEL'](_0x497b2c,_0x5c4240);return Number(_0x5a126);}catch(_0x14835e){this['logger']['error']('Error\x20deleting\x20fields\x20for\x20key:\x20'+_0x497b2c,{'error':_0x14835e});throw _0x14835e;}}async['incrementFieldByFloat'](_0x5b2572,_0x5e8e8d,_0x1f1012){try{const _0xf70490=await this['searchClient']['HINCRBYFLOAT'](_0x5b2572,_0x5e8e8d,_0x1f1012);return Number(_0xf70490);}catch(_0x217df0){this['logger']['error']('Error\x20incrementing\x20field\x20'+_0x5e8e8d+'\x20for\x20key:\x20'+_0x5b2572,{'error':_0x217df0});throw _0x217df0;}}async['sendQuery'](..._0x515625){try{return await this['searchClient']['sendCommand'](_0x515625);}catch(_0xc6ea4f){this['logger']['error']('Error\x20executing\x20query',{'error':_0xc6ea4f});throw _0xc6ea4f;}}async['sendIndexedQuery'](_0x57e44a,_0x5bcf17){try{if(_0x5bcf17[0x0]?.['startsWith']('FT.'))return await this['searchClient']['sendCommand'](_0x5bcf17);return await this['searchClient']['sendCommand'](['FT.SEARCH',_0x57e44a,..._0x5bcf17]);}catch(_0x2340a4){this['logger']['error']('Error\x20executing\x20query',{'error':_0x2340a4});throw _0x2340a4;}}}exports['RedisSearchService']=RedisSearchService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x4dab3a,_0x184cc1){const _0x180b2c=_0x44bd,_0x220a1c=_0x4dab3a();while(!![]){try{const _0x423d5c=parseInt(_0x180b2c(0x162))/0x1*(-parseInt(_0x180b2c(0x161))/0x2)+parseInt(_0x180b2c(0x15c))/0x3+-parseInt(_0x180b2c(0x164))/0x4*(-parseInt(_0x180b2c(0x15f))/0x5)+parseInt(_0x180b2c(0x163))/0x6+parseInt(_0x180b2c(0x160))/0x7+parseInt(_0x180b2c(0x165))/0x8+-parseInt(_0x180b2c(0x15d))/0x9*(parseInt(_0x180b2c(0x15e))/0xa);if(_0x423d5c===_0x184cc1)break;else _0x220a1c['push'](_0x220a1c['shift']());}catch(_0x36f369){_0x220a1c['push'](_0x220a1c['shift']());}}}(_0x4641,0x554bd));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['SerializerService']=exports['MDATA_SYMBOLS']=void 0x0;const utils_1=require('../../modules/utils'),dateReg=/^"\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z)?"$/;exports['MDATA_SYMBOLS']={'SLOTS':0x1a,'ACTIVITY':{'KEYS':['aid','dad','as','atp','stp','ac','au','err','l1s','l2s']},'ACTIVITY_UPDATE':{'KEYS':['au','err','l2s']},'JOB':{'KEYS':['ngn','tpc','pj','pg','pd','px','pa','key','app','vrs','jid','gid','aid','ts','jc','ju','js','err','trc']},'JOB_UPDATE':{'KEYS':['ju','err']}};class SerializerService{constructor(){this['resetSymbols']({},{},{});}['abbreviate'](_0x2003b6,_0x10bc3d,_0x297c9a=[]){for(const _0x5ae29a of _0x10bc3d){const _0x352510=this['symKeys']['get'](_0x5ae29a),_0x10eb24=_0x2003b6[_0x5ae29a];for(const _0x530edd of _0x10eb24){const _0x3c8c4f=_0x352510['get'](_0x530edd);if(_0x3c8c4f){const _0x12f53e=this['resolveDimensionalIndex'](_0x530edd);_0x297c9a['push'](''+_0x3c8c4f+_0x12f53e);}else _0x297c9a['push'](_0x530edd);}}return _0x297c9a;}['resolveDimensionalIndex'](_0x5f4b0a){if(this['isJobPath'](_0x5f4b0a))return'';else{const [_0x3d7fc3]=_0x5f4b0a['split']('/');if(_0x3d7fc3 in this['dIds'])return this['dIds'][_0x3d7fc3];else{if('$ADJACENT'in this['dIds'])return this['dIds']['$ADJACENT'];}return',0';}}['isJobPath'](_0xe85ac7){return _0xe85ac7['startsWith']('data/')||_0xe85ac7['startsWith']('metadata/');}['resetSymbols'](_0x594ef6,_0x9a1ade,_0x26c0bd){this['symKeys']=new Map(),this['symReverseKeys']=new Map();for(const _0x806d01 in _0x594ef6){this['symKeys']['set'](_0x806d01,new Map(Object['entries'](_0x594ef6[_0x806d01])));}this['symValMaps']=new Map(Object['entries'](_0x9a1ade)),this['symValReverseMaps']=this['getReverseValueMap'](this['symValMaps']),this['dIds']=_0x26c0bd;}['getReverseKeyMap'](_0x5b0e72,_0x231d29){let _0x1138d5=this['symReverseKeys']['get'](_0x231d29);if(!_0x1138d5){_0x1138d5=new Map();for(const [_0x735383,_0x4cf048]of _0x5b0e72['entries']()){_0x1138d5['set'](_0x4cf048,_0x735383);}this['symReverseKeys']['set'](_0x231d29,_0x1138d5);}return _0x1138d5;}['getReverseValueMap'](_0x537a34){const _0x315057=new Map();for(const [_0x92f814,_0x10d3f7]of _0x537a34['entries']()){_0x315057['set'](_0x10d3f7,_0x92f814);}return _0x315057;}static['filterSymVals'](_0xa8ad45,_0x96990f,_0x35d1ed,_0x155736){const _0x293662={},_0x351a28={..._0x35d1ed},_0x4f7c39=new Set(Object['values'](_0x351a28));for(const _0x4aa5f2 of _0x155736){if(!_0x4f7c39['has'](_0x4aa5f2)){if(_0xa8ad45>_0x96990f)return _0x293662;const _0x510ce3=(0x0,utils_1['getSymVal'])(_0xa8ad45);_0xa8ad45++,_0x293662[_0x510ce3]=_0x4aa5f2,_0x4f7c39['add'](_0x4aa5f2);}}return _0x293662;}['compress'](_0x4722f0,_0x4a263c){if(this['symKeys']['size']===0x0)return _0x4722f0;const _0x59bddc={..._0x4722f0},_0x13ddc7={},_0x3c6894=(_0x1c78c8,_0xcb72de)=>{for(const _0x1251c2 in _0x59bddc){if(_0x1251c2['startsWith'](_0xcb72de+'/')||_0xcb72de['startsWith']('$')&&['data','metadata']['includes'](_0x1251c2['split']('/')[0x0])){const _0x1597ab=this['resolveDimensionalIndex'](_0x1251c2),_0x3519a1=_0x1c78c8['get'](_0x1251c2)||_0x1251c2,_0x465fa7=''+_0x3519a1+_0x1597ab;_0x13ddc7[_0x465fa7]=_0x59bddc[_0x1251c2];}else!(_0x1251c2 in _0x13ddc7)&&this['isLiteralKeyType'](_0x1251c2)&&(_0x13ddc7[_0x1251c2]=_0x59bddc[_0x1251c2]);}};for(const _0x3caba5 of _0x4a263c){const _0x2f04b4=this['symKeys']['get'](_0x3caba5);_0x2f04b4&&_0x3c6894(_0x2f04b4,_0x3caba5);}return _0x13ddc7;}['isLiteralKeyType'](_0x889762){return _0x889762['startsWith']('-')||_0x889762['startsWith']('_');}['decompress'](_0x3728e7,_0x3ba53e){if(this['symKeys']['size']===0x0)return _0x3728e7;const _0x33b776={..._0x3728e7},_0x63f577=(_0x2b692a,_0xcd4be9)=>{const _0x1b3bb0=this['getReverseKeyMap'](_0x2b692a,_0xcd4be9);for(const _0x1b772f in _0x33b776){const _0x4c288a=_0x1b772f['split'](',')[0x0],_0x2d7542=_0x1b3bb0['get'](_0x4c288a);_0x2d7542&&(_0x33b776[_0x2d7542]=_0x33b776[_0x1b772f],delete _0x33b776[_0x1b772f]);}};for(const _0x293dda of _0x3ba53e){const _0x575cea=this['symKeys']['get'](_0x293dda);_0x575cea&&_0x63f577(_0x575cea,_0x293dda);}return _0x33b776;}['stringify'](_0x59faff){const _0x420cec={};for(const _0x2f0c98 in _0x59faff){const _0x537467=SerializerService['toString'](_0x59faff[_0x2f0c98]);_0x537467&&(_0x420cec[_0x2f0c98]=_0x537467);}return _0x420cec;}['parse'](_0x3e0d05){const _0x20cde4={};for(const [_0x3cfd47,_0x3c574c]of Object['entries'](_0x3e0d05)){if(_0x3c574c===undefined||_0x3c574c===null)continue;_0x20cde4[_0x3cfd47]=SerializerService['fromString'](_0x3c574c);}return _0x20cde4;}static['toString'](_0x7f3eab){switch(typeof _0x7f3eab){case'string':break;case'boolean':_0x7f3eab=_0x7f3eab?'/t':'/f';break;case'number':_0x7f3eab='/d'+_0x7f3eab['toString']();break;case'undefined':return undefined;case'object':_0x7f3eab===null?_0x7f3eab='/n':_0x7f3eab='/s'+JSON['stringify'](_0x7f3eab);break;}return _0x7f3eab;}static['fromString'](_0x1c590a){if(typeof _0x1c590a!=='string')return undefined;const _0x5aba0b=_0x1c590a['slice'](0x0,0x2),_0x2af9ec=_0x1c590a['slice'](0x2);switch(_0x5aba0b){case'/t':return!![];case'/f':return![];case'/d':return Number(_0x2af9ec);case'/n':return null;case'/s':if(dateReg['exec'](_0x2af9ec))return new Date(JSON['parse'](_0x2af9ec));return JSON['parse'](_0x2af9ec);default:return _0x1c590a;}}['package'](_0x1f397e,_0x4c5a58){const _0x1a91c1=this['stringify'](_0x1f397e);return this['compress'](_0x1a91c1,_0x4c5a58);}['unpackage'](_0x51439e,_0xdbdda2){const _0x5ba936=this['decompress'](_0x51439e,_0xdbdda2);return this['parse'](_0x5ba936);}['export'](){const _0x5c527a={};for(const [_0x41f3ff,_0x50c5b0]of this['symKeys']['entries']()){_0x5c527a[_0x41f3ff]={};for(const [_0x1c578f,_0x2f7cec]of _0x50c5b0['entries']()){_0x5c527a[_0x41f3ff][_0x1c578f]=_0x2f7cec;}}return _0x5c527a;}}function _0x4641(){const _0xbfa3e=['1731411BeVeSH','447030OOHCbN','170wjIYRR','14035mULpjy','2181221APkWMk','4RDumvl','15461teRizY','1221396FEVswr','76sAfSuz','632368JcYiwc'];_0x4641=function(){return _0xbfa3e;};return _0x4641();}function _0x44bd(_0x2197b0,_0x4b54b0){const _0x46414e=_0x4641();return _0x44bd=function(_0x44bd31,_0x5e6a79){_0x44bd31=_0x44bd31-0x15c;let _0x340309=_0x46414e[_0x44bd31];return _0x340309;},_0x44bd(_0x2197b0,_0x4b54b0);}exports['SerializerService']=SerializerService;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KeyStoreParams } from '../../../../types/hotmesh';
|
|
2
|
-
import { PostgresClientType } from '../../../../types/postgres';
|
|
2
|
+
import { PostgresClientType, PostgresJobEnumType } from '../../../../types/postgres';
|
|
3
3
|
import { HScanResult, HSetOptions, ProviderTransaction, SetOptions, ZAddOptions } from '../../../../types/provider';
|
|
4
4
|
export declare class KVSQL {
|
|
5
5
|
pgClient: PostgresClientType;
|
|
@@ -37,6 +37,7 @@ export declare class KVSQL {
|
|
|
37
37
|
};
|
|
38
38
|
hsetnx(key: string, field: string, value: string, multi?: ProviderTransaction): Promise<number>;
|
|
39
39
|
hset(key: string, fields: Record<string, string>, options?: HSetOptions, multi?: ProviderTransaction): Promise<number>;
|
|
40
|
+
deriveType(fieldName: string): PostgresJobEnumType;
|
|
40
41
|
_hset(key: string, fields: Record<string, string>, options?: HSetOptions): {
|
|
41
42
|
sql: string;
|
|
42
43
|
params: any[];
|