@hotmeshio/hotmesh 0.3.17 → 0.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +161 -64
- package/build/modules/key.js +1 -1
- package/build/modules/utils.js +1 -1
- package/build/package.json +6 -8
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.js +1 -1
- package/build/services/activities/index.js +1 -1
- package/build/services/activities/interrupt.js +1 -1
- package/build/services/activities/signal.js +1 -1
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.js +1 -1
- package/build/services/engine/index.d.ts +1 -1
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.js +1 -1
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/pipe/functions/array.js +1 -1
- package/build/services/pipe/functions/bitwise.js +1 -1
- package/build/services/pipe/functions/conditional.js +1 -1
- package/build/services/pipe/functions/cron.js +1 -1
- package/build/services/pipe/functions/date.js +1 -1
- package/build/services/pipe/functions/index.js +1 -1
- package/build/services/pipe/functions/json.js +1 -1
- package/build/services/pipe/functions/logical.js +1 -1
- package/build/services/pipe/functions/math.js +1 -1
- package/build/services/pipe/functions/number.js +1 -1
- package/build/services/pipe/functions/object.js +1 -1
- package/build/services/pipe/functions/string.js +1 -1
- package/build/services/pipe/functions/symbol.js +1 -1
- package/build/services/pipe/functions/unary.js +1 -1
- package/build/services/pipe/index.js +1 -1
- package/build/services/quorum/index.d.ts +1 -1
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.js +1 -1
- package/build/services/search/providers/postgres/postgres.js +1 -1
- package/build/services/search/providers/redis/ioredis.js +1 -1
- package/build/services/search/providers/redis/redis.js +1 -1
- package/build/services/serializer/index.js +1 -1
- package/build/services/store/providers/postgres/kvsql.js +1 -1
- package/build/services/store/providers/postgres/kvtables.d.ts +1 -0
- package/build/services/store/providers/postgres/kvtables.js +1 -1
- package/build/services/store/providers/postgres/kvtransaction.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/hash.d.ts +1 -0
- package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
- package/build/services/store/providers/postgres/postgres.js +1 -1
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/providers/nats/nats.js +1 -1
- package/build/services/stream/providers/postgres/postgres.d.ts +1 -0
- package/build/services/stream/providers/postgres/postgres.js +1 -1
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/factory.d.ts +2 -2
- package/build/services/sub/factory.js +8 -4
- package/build/services/sub/index.d.ts +3 -2
- package/build/services/sub/providers/postgres/postgres.d.ts +18 -0
- package/build/services/sub/providers/postgres/postgres.js +1 -0
- package/build/services/sub/providers/redis/ioredis.d.ts +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.d.ts +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.d.ts +1 -1
- package/build/services/worker/index.js +1 -1
- package/build/types/redis.d.ts +8 -8
- package/package.json +6 -8
- package/types/redis.ts +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x15f5f2,_0x23e015){const _0x1c4a37=_0x588a,_0x4f25ed=_0x15f5f2();while(!![]){try{const _0x3693f0=-parseInt(_0x1c4a37(0x1b1))/0x1+-parseInt(_0x1c4a37(0x1b4))/0x2*(-parseInt(_0x1c4a37(0x1b3))/0x3)+-parseInt(_0x1c4a37(0x1b6))/0x4*(parseInt(_0x1c4a37(0x1af))/0x5)+-parseInt(_0x1c4a37(0x1b0))/0x6+parseInt(_0x1c4a37(0x1b2))/0x7*(-parseInt(_0x1c4a37(0x1b5))/0x8)+-parseInt(_0x1c4a37(0x1b7))/0x9*(parseInt(_0x1c4a37(0x1b8))/0xa)+parseInt(_0x1c4a37(0x1ba))/0xb*(parseInt(_0x1c4a37(0x1b9))/0xc);if(_0x3693f0===_0x23e015)break;else _0x4f25ed['push'](_0x4f25ed['shift']());}catch(_0x3da5d9){_0x4f25ed['push'](_0x4f25ed['shift']());}}}(_0x3218,0xb93b9));function _0x588a(_0x4993f3,_0x21ee56){const _0x3218db=_0x3218();return _0x588a=function(_0x588ab7,_0x161ea6){_0x588ab7=_0x588ab7-0x1af;let _0x14591c=_0x3218db[_0x588ab7];return _0x14591c;},_0x588a(_0x4993f3,_0x21ee56);}var __importDefault=this&&this['__importDefault']||function(_0x21c505){return _0x21c505&&_0x21c505['__esModule']?_0x21c505:{'default':_0x21c505};};function _0x3218(){const _0xaf2874=['187SVlfuq','305mIvezb','8030616punlYS','720441HfFteF','194719kZnZGe','2886795TmLiCG','2YBCrep','152vwpfxV','12332UQTBhe','97839cMushB','640Ftmrwm','2306580eTGnlY'];_0x3218=function(){return _0xaf2874;};return _0x3218();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['TelemetryService']=void 0x0;const package_json_1=__importDefault(require('../../package.json')),mapper_1=require('../mapper'),stream_1=require('../../types/stream'),telemetry_1=require('../../types/telemetry'),utils_1=require('../../modules/utils');class TelemetryService{constructor(_0x47082d,_0x2c1802,_0x1df85f,_0x201302){this['leg']=0x1,this['appId']=_0x47082d,this['config']=_0x2c1802,this['metadata']=_0x1df85f,this['context']=_0x201302;}['getJobParentSpanId'](){return this['context']['metadata']['spn'];}['getActivityParentSpanId'](_0x4601af){return _0x4601af===0x1?this['context'][this['config']['parent']]['output']?.['metadata']?.['l2s']:this['context']['$self']['output']?.['metadata']?.['l1s'];}['getTraceId'](){return this['context']['metadata']['trc'];}['startJobSpan'](){const _0x139092='JOB/'+this['appId']+'/'+this['config']['subscribes']+'/1',_0x48ca77=this['getTraceId'](),_0x2a8e0f=this['getJobParentSpanId'](),_0x2244a1=this['getSpanAttrs'](0x1),_0x1170e8=this['startSpan'](_0x48ca77,_0x2a8e0f,_0x139092,_0x2244a1);return this['jobSpan']=_0x1170e8,this['setTelemetryContext'](_0x1170e8,0x1),this;}['startActivitySpan'](_0x1c8c96=this['leg']){const _0x12c550=this['config']['type']['toUpperCase']()+'/'+this['appId']+'/'+this['metadata']['aid']+'/'+_0x1c8c96,_0x25fb5a=this['getTraceId'](),_0x1c940e=this['getActivityParentSpanId'](_0x1c8c96),_0x18113b=this['getSpanAttrs'](_0x1c8c96),_0x102001=this['startSpan'](_0x25fb5a,_0x1c940e,_0x12c550,_0x18113b);return this['setTelemetryContext'](_0x102001,_0x1c8c96),this['span']=_0x102001,this;}['startStreamSpan'](_0x203eb2,_0x2716c0){let _0xc462a6;if(_0x2716c0===stream_1['StreamRole']['SYSTEM'])_0xc462a6='SYSTEM';else{if(_0x2716c0===stream_1['StreamRole']['WORKER'])_0xc462a6='EXECUTE';else _0x203eb2['type']===stream_1['StreamDataType']['RESULT']||_0x203eb2['type']===stream_1['StreamDataType']['RESPONSE']?_0xc462a6='FANIN':_0xc462a6='FANOUT';}const _0x5c9053=_0x203eb2['metadata']['topic']?'/'+_0x203eb2['metadata']['topic']:'',_0x105ce8=_0xc462a6+'/'+this['appId']+'/'+_0x203eb2['metadata']['aid']+_0x5c9053,_0x11358b=this['getStreamSpanAttrs'](_0x203eb2),_0x5fe49f=this['startSpan'](_0x203eb2['metadata']['trc'],_0x203eb2['metadata']['spn'],_0x105ce8,_0x11358b);return this['span']=_0x5fe49f,this;}['startSpan'](_0x27d34f,_0x1d9de8,_0x3e2d52,_0x54ed71){this['traceId']=_0x27d34f,this['spanId']=_0x1d9de8;const _0x8cfdd7=telemetry_1['trace']['getTracer'](package_json_1['default']['name'],package_json_1['default']['version']),_0x3cd7a3=this['getParentSpanContext'](),_0x242a6e=_0x8cfdd7['startSpan'](_0x3e2d52,{'kind':telemetry_1['SpanKind']['CLIENT'],'attributes':_0x54ed71,'root':!_0x3cd7a3},_0x3cd7a3);return _0x242a6e;}['mapActivityAttributes'](){if(this['config']['telemetry']){const _0x18ff5c=new mapper_1['MapperService'](this['config']['telemetry'],this['context'])['mapRules'](),_0x3b62a2={...Object['keys'](_0x18ff5c)['reduce']((_0x2dcebc,_0x392ce3)=>{return['string','boolean','number']['includes'](typeof _0x18ff5c[_0x392ce3])&&(_0x2dcebc['app.activity.data.'+_0x392ce3]=_0x18ff5c[_0x392ce3]),_0x2dcebc;},{})};this['span']?.['setAttributes'](_0x3b62a2);}}['setActivityAttributes'](_0x10e0ec){this['span']?.['setAttributes'](_0x10e0ec);}['setStreamAttributes'](_0xe79c2b){this['span']?.['setAttributes'](_0xe79c2b);}['setJobAttributes'](_0x3131bf){this['jobSpan']?.['setAttributes'](_0x3131bf);}['endJobSpan'](){this['endSpan'](this['jobSpan']);}['endActivitySpan'](){this['endSpan'](this['span']);}['endStreamSpan'](){this['endSpan'](this['span']);}['endSpan'](_0x119675){_0x119675&&_0x119675['end']();}['getParentSpanContext'](){if(this['traceId']&&this['spanId']){const _0x2c2ea5={'traceId':this['traceId'],'spanId':this['spanId'],'isRemote':!![],'traceFlags':0x1},_0x5cc24a=telemetry_1['trace']['setSpanContext'](telemetry_1['context']['active'](),_0x2c2ea5);return _0x5cc24a;}}['getSpanAttrs'](_0x23fe25){return{...Object['keys'](this['context']['metadata'])['reduce']((_0x5479bd,_0x14922a)=>{return _0x14922a!=='trc'&&(_0x5479bd['app.job.'+_0x14922a]=this['context']['metadata'][_0x14922a]),_0x5479bd;},{}),...Object['keys'](this['metadata'])['reduce']((_0x5718ba,_0x47abd4)=>{return _0x5718ba['app.activity.'+_0x47abd4]=this['metadata'][_0x47abd4],_0x5718ba;},{}),'app.activity.leg':_0x23fe25};}['getStreamSpanAttrs'](_0x39547b){return{...Object['keys'](_0x39547b['metadata'])['reduce']((_0x5c510c,_0x2615a5)=>{return _0x2615a5!=='trc'&&_0x2615a5!=='spn'&&(_0x5c510c['app.stream.'+_0x2615a5]=_0x39547b['metadata'][_0x2615a5]),_0x5c510c;},{})};}['setTelemetryContext'](_0x3d1fc9,_0x6c24da){!this['context']['metadata']['trc']&&(this['context']['metadata']['trc']=_0x3d1fc9['spanContext']()['traceId']),_0x6c24da===0x1?(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l1s']=_0x3d1fc9['spanContext']()['spanId']):(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l2s']=_0x3d1fc9['spanContext']()['spanId']);}['setActivityError'](_0x349be3){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0x349be3});}['setStreamError'](_0x559939){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0x559939});}static['addTargetTelemetryPaths'](_0x49a236,_0x4c86ab,_0x5b0ee3,_0x39bbb3){_0x39bbb3===0x1?(!(_0x4c86ab['parent']in _0x49a236)&&(_0x49a236[_0x4c86ab['parent']]=[]),_0x49a236[_0x4c86ab['parent']]['push'](_0x4c86ab['parent']+'/output/metadata/l2s')):(!(_0x5b0ee3['aid']in _0x49a236)&&(_0x49a236[_0x5b0ee3['aid']]=[]),_0x49a236[_0x5b0ee3['aid']]['push'](_0x5b0ee3['aid']+'/output/metadata/l1s'));}static['bindJobTelemetryToState'](_0x1b862c,_0x56294e,_0x6b0409){_0x56294e['type']==='trigger'&&(_0x1b862c['metadata/trc']=_0x6b0409['metadata']['trc']);}static['bindActivityTelemetryToState'](_0x166c8,_0x346ffb,_0x2beaa0,_0x487862,_0x534a67){if(_0x346ffb['type']==='trigger')_0x166c8[_0x2beaa0['aid']+'/output/metadata/l1s']=_0x487862['$self']['output']['metadata']['l1s'],_0x166c8[_0x2beaa0['aid']+'/output/metadata/l2s']=_0x487862['$self']['output']['metadata']['l2s'];else{if(utils_1['polyfill']['resolveActivityType'](_0x346ffb['type'])==='hook'&&_0x534a67===0x1)_0x166c8[_0x2beaa0['aid']+'/output/metadata/l1s']=_0x487862['$self']['output']['metadata']['l1s'],_0x166c8[_0x2beaa0['aid']+'/output/metadata/l2s']=_0x487862['$self']['output']['metadata']['l1s'];else{if(_0x346ffb['type']==='signal'&&_0x534a67===0x1)_0x166c8[_0x2beaa0['aid']+'/output/metadata/l1s']=_0x487862['$self']['output']['metadata']['l1s'],_0x166c8[_0x2beaa0['aid']+'/output/metadata/l2s']=_0x487862['$self']['output']['metadata']['l1s'];else{const _0x2c857b='l'+_0x534a67+'s';_0x166c8[_0x2beaa0['aid']+'/output/metadata/'+_0x2c857b]=_0x487862['$self']['output']['metadata'][_0x2c857b];}}}}}exports['TelemetryService']=TelemetryService;
|
|
@@ -17,7 +17,7 @@ declare class WorkerService {
|
|
|
17
17
|
callback: (streamData: StreamData) => Promise<StreamDataResponse | void>;
|
|
18
18
|
store: StoreService<ProviderClient, ProviderTransaction> | null;
|
|
19
19
|
stream: StreamService<ProviderClient, ProviderTransaction> | null;
|
|
20
|
-
subscribe: SubService<ProviderClient
|
|
20
|
+
subscribe: SubService<ProviderClient> | null;
|
|
21
21
|
router: Router<typeof this.stream> | null;
|
|
22
22
|
logger: ILogger;
|
|
23
23
|
reporting: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x3df943,_0x2dd111){const _0x21bcb0=_0x2207,_0x1d5043=_0x3df943();while(!![]){try{const _0x2b4bb7=parseInt(_0x21bcb0(0x186))/0x1*(-parseInt(_0x21bcb0(0x183))/0x2)+parseInt(_0x21bcb0(0x189))/0x3*(parseInt(_0x21bcb0(0x180))/0x4)+parseInt(_0x21bcb0(0x185))/0x5*(parseInt(_0x21bcb0(0x18a))/0x6)+parseInt(_0x21bcb0(0x188))/0x7*(-parseInt(_0x21bcb0(0x18b))/0x8)+parseInt(_0x21bcb0(0x187))/0x9+-parseInt(_0x21bcb0(0x182))/0xa+parseInt(_0x21bcb0(0x184))/0xb*(parseInt(_0x21bcb0(0x181))/0xc);if(_0x2b4bb7===_0x2dd111)break;else _0x1d5043['push'](_0x1d5043['shift']());}catch(_0x35590a){_0x1d5043['push'](_0x1d5043['shift']());}}}(_0x2057,0x4633e));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['WorkerService']=void 0x0;const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),factory_1=require('../connector/factory'),router_1=require('../router'),stream_1=require('../../types/stream'),enums_1=require('../../modules/enums'),factory_2=require('../stream/factory'),factory_3=require('../sub/factory'),factory_4=require('../store/factory');class WorkerService{constructor(){this['reporting']=![];}static async['init'](_0x345fdf,_0x32bd74,_0x3fe81c,_0x533a53,_0x3ef399){const _0x8f6977=[];if(Array['isArray'](_0x533a53['workers']))for(const _0x54239d of _0x533a53['workers']){await factory_1['ConnectorService']['initClients'](_0x54239d);const _0x259cb6=new WorkerService();_0x259cb6['verifyWorkerFields'](_0x54239d),_0x259cb6['namespace']=_0x345fdf,_0x259cb6['appId']=_0x32bd74,_0x259cb6['guid']=_0x3fe81c,_0x259cb6['callback']=_0x54239d['callback'],_0x259cb6['topic']=_0x54239d['topic'],_0x259cb6['config']=_0x533a53,_0x259cb6['logger']=_0x3ef399,await _0x259cb6['initStoreChannel'](_0x259cb6,_0x54239d['store']),await _0x259cb6['initSubChannel'](_0x259cb6,_0x54239d['sub'],_0x54239d['pub']),await _0x259cb6['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x259cb6['subscriptionHandler'](),_0x32bd74),await _0x259cb6['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x259cb6['subscriptionHandler'](),_0x32bd74,_0x259cb6['topic']),await _0x259cb6['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x259cb6['subscriptionHandler'](),_0x32bd74,_0x259cb6['guid']),await _0x259cb6['initStreamChannel'](_0x259cb6,_0x54239d['stream'],_0x54239d['store']),_0x259cb6['router']=await _0x259cb6['initRouter'](_0x54239d,_0x3ef399);const _0x3501d7=_0x259cb6['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x259cb6['appId'],'topic':_0x54239d['topic']});await _0x259cb6['router']['consumeMessages'](_0x3501d7,'WORKER',_0x259cb6['guid'],_0x54239d['callback']),_0x259cb6['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x8f6977['push'](_0x259cb6);}return _0x8f6977;}['verifyWorkerFields'](_0x4c78b4){if(!(0x0,utils_1['identifyProvider'])(_0x4c78b4['store'])||!(0x0,utils_1['identifyProvider'])(_0x4c78b4['stream'])||!(0x0,utils_1['identifyProvider'])(_0x4c78b4['sub'])||!(_0x4c78b4['topic']&&_0x4c78b4['callback']))throw new Error('worker\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields\x20along\x20with\x20a\x20callback\x20function\x20and\x20topic.');}async['initStoreChannel'](_0x56051f,_0x46b189){_0x56051f['store']=await factory_4['StoreServiceFactory']['init'](_0x46b189,_0x56051f['namespace'],_0x56051f['appId'],_0x56051f['logger']);}async['initSubChannel'](_0x229302,_0x35505e,_0x18f105){_0x229302['subscribe']=await factory_3['SubServiceFactory']['init'](_0x35505e,_0x18f105,_0x229302['namespace'],_0x229302['appId'],_0x229302['guid'],_0x229302['logger']);}async['initStreamChannel'](_0x56b31d,_0x4608fe,_0x13096b){_0x56b31d['stream']=await factory_2['StreamServiceFactory']['init'](_0x4608fe,_0x13096b,_0x56b31d['namespace'],_0x56b31d['appId'],_0x56b31d['logger']);}async['initRouter'](_0x4892f9,_0x55b423){const _0x1d6b9b=await this['store']['getThrottleRate'](_0x4892f9['topic']);return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['WORKER'],'topic':_0x4892f9['topic'],'reclaimDelay':_0x4892f9['reclaimDelay'],'reclaimCount':_0x4892f9['reclaimCount'],'throttle':_0x1d6b9b},this['stream'],_0x55b423);}['subscriptionHandler'](){const _0x3176fb=this;return async(_0x45a6c4,_0x4a02a7)=>{_0x3176fb['logger']['debug']('worker-event-received',{'topic':_0x45a6c4,'type':_0x4a02a7['type']});if(_0x4a02a7['type']==='throttle')_0x4a02a7['topic']!==null&&_0x3176fb['throttle'](_0x4a02a7['throttle']);else{if(_0x4a02a7['type']==='ping')_0x3176fb['sayPong'](_0x3176fb['appId'],_0x3176fb['guid'],_0x4a02a7['originator'],_0x4a02a7['details']);else _0x4a02a7['type']==='rollcall'&&(_0x4a02a7['topic']!==null&&_0x3176fb['doRollCall'](_0x4a02a7));}};}async['doRollCall'](_0x2b331b){let _0x1baf49=0x0;const _0xa69b76=!isNaN(_0x2b331b['max'])?_0x2b331b['max']:enums_1['HMSH_QUORUM_ROLLCALL_CYCLES'];if(this['rollCallInterval'])clearTimeout(this['rollCallInterval']);const _0x541a38=_0x2b331b['interval']/0x2,_0x404f2f=_0x541a38+Math['ceil'](Math['random']()*_0x541a38);do{await(0x0,utils_1['sleepFor'])(Math['ceil'](Math['random']()*0x3e8)),await this['sayPong'](this['appId'],this['guid'],null,!![],_0x2b331b['signature']);if(!_0x2b331b['interval'])return;const {promise:_0x59a546,timerId:_0x2f6241}=(0x0,utils_1['XSleepFor'])(_0x404f2f*0x3e8);this['rollCallInterval']=_0x2f6241,await _0x59a546;}while(this['rollCallInterval']&&_0x1baf49++<_0xa69b76-0x1);}['cancelRollCall'](){this['rollCallInterval']&&(clearTimeout(this['rollCallInterval']),delete this['rollCallInterval']);}['stop'](){this['cancelRollCall']();}async['sayPong'](_0x583c69,_0x3b01d3,_0x5a6433,_0xd4f6a0=![],_0x19e39a=![]){let _0xb2df0;if(_0xd4f6a0){const _0x5b6dd6={'appId':this['appId'],'topic':this['topic']};_0xb2df0={'engine_id':this['guid'],'namespace':this['namespace'],'app_id':this['appId'],'worker_topic':this['topic'],'stream':this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x5b6dd6),'counts':this['router']?.['counts'],'timestamp':(0x0,utils_1['formatISODate'])(new Date()),'inited':this['inited'],'throttle':this['router']?.['throttle'],'reclaimDelay':this['router']?.['reclaimDelay'],'reclaimCount':this['router']?.['reclaimCount'],'system':await(0x0,utils_1['getSystemHealth'])(),'signature':_0x19e39a?this['callback']['toString']():undefined};}this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'pong','guid':_0x3b01d3,'originator':_0x5a6433,'profile':_0xb2df0},_0x583c69);}async['throttle'](_0x562e44){this['router']?.['setThrottle'](_0x562e44);}}function _0x2207(_0x4da059,_0x56c7a4){const _0x205753=_0x2057();return _0x2207=function(_0x2207a2,_0x49dd29){_0x2207a2=_0x2207a2-0x180;let _0x485e0b=_0x205753[_0x2207a2];return _0x485e0b;},_0x2207(_0x4da059,_0x56c7a4);}function _0x2057(){const _0x5bacc5=['4638456hEYXgu','120253MpPXII','1187148uhoMKo','2159898DGOOZb','40ojCcRH','4ODlYAu','132CbaRWo','5655480slbqFm','22dQORXO','197263oCtZWH','5nMjtIe','48123xbbBqz'];_0x2057=function(){return _0x5bacc5;};return _0x2057();}exports['WorkerService']=WorkerService;
|
package/build/types/redis.d.ts
CHANGED
|
@@ -104,10 +104,10 @@ interface RedisRedisClientType extends ProviderClient {
|
|
|
104
104
|
duplicate(): RedisRedisClientType;
|
|
105
105
|
on(event: string, callback: (...args: any[]) => void): void;
|
|
106
106
|
publish(channel: string, message: string): Promise<number>;
|
|
107
|
-
pSubscribe(pattern: string, callback: (channel: string, message: string) => void): void
|
|
108
|
-
pUnsubscribe(pattern: string): void
|
|
109
|
-
subscribe(channel: string, callback: (channel: string, message: string) => void): void
|
|
110
|
-
unsubscribe(channel: string): void
|
|
107
|
+
pSubscribe(pattern: string, callback: (channel: string, message: string) => void): Promise<void>;
|
|
108
|
+
pUnsubscribe(pattern: string): Promise<void>;
|
|
109
|
+
subscribe(channel: string, callback: (channel: string, message: string) => void): Promise<void>;
|
|
110
|
+
unsubscribe(channel: string): Promise<void>;
|
|
111
111
|
punsubscribe(channel: string): void;
|
|
112
112
|
get(key: string): Promise<string | null>;
|
|
113
113
|
set(key: string, value: string): Promise<string>;
|
|
@@ -179,10 +179,10 @@ interface IORedisClient extends ProviderClient {
|
|
|
179
179
|
flushdb(): Promise<string>;
|
|
180
180
|
publish(channel: string, message: string): Promise<number>;
|
|
181
181
|
psubscribe(pattern: string, callback: (channel: string, message: string) => void): Promise<void>;
|
|
182
|
-
punsubscribe(pattern: string):
|
|
183
|
-
subscribe(channel: string, callback: (channel: string, message: string) => void): void
|
|
184
|
-
unsubscribe(channel: string):
|
|
185
|
-
punsubscribe(channel: string):
|
|
182
|
+
punsubscribe(pattern: string): Promise<number>;
|
|
183
|
+
subscribe(channel: string, callback: (channel: string, message: string) => void): Promise<void>;
|
|
184
|
+
unsubscribe(channel: string): Promise<number>;
|
|
185
|
+
punsubscribe(channel: string): Promise<number>;
|
|
186
186
|
xadd(key: string, id: string, fields: any, message?: string): Promise<string>;
|
|
187
187
|
xack(key: string, group: string, id: string): Promise<number>;
|
|
188
188
|
xack(key: string, group: string, ...ids: string[]): Promise<number>;
|
package/package.json
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/hotmesh",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.19",
|
|
4
4
|
"description": "Serverless Workflow",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/hotmeshio/sdk-typescript.git"
|
|
10
|
-
},
|
|
11
7
|
"homepage": "https://hotmesh.io/",
|
|
12
8
|
"publishConfig": {
|
|
13
9
|
"access": "public"
|
|
@@ -44,7 +40,7 @@
|
|
|
44
40
|
"test:meshflow:sleep": "NODE_ENV=test jest ./tests/meshflow/sleep/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
45
41
|
"test:meshflow:signal": "NODE_ENV=test jest ./tests/meshflow/signal/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
46
42
|
"test:meshflow:unknown": "NODE_ENV=test jest ./tests/meshflow/unknown/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
47
|
-
"test:emit": "NODE_ENV=test jest ./tests/functional/emit
|
|
43
|
+
"test:emit": "NODE_ENV=test jest ./tests/functional/emit/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
48
44
|
"test:pending": "NODE_ENV=test jest ./tests/functional/pending/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
49
45
|
"test:functional": "NODE_ENV=test jest ./tests/functional/* --detectOpenHandles --forceExit --verbose",
|
|
50
46
|
"test:hmsh": "NODE_ENV=test jest ./tests/functional/*.test.ts --detectOpenHandles --verbose --forceExit",
|
|
@@ -56,11 +52,12 @@
|
|
|
56
52
|
"test:reclaim": "NODE_ENV=test jest ./tests/functional/reclaim/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
57
53
|
"test:redeploy": "NODE_ENV=test jest ./tests/functional/redeploy/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
58
54
|
"test:reporter": "NODE_ENV=test jest ./tests/unit/services/reporter/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
59
|
-
"test:reentrant": "NODE_ENV=test jest ./tests/functional/reentrant
|
|
55
|
+
"test:reentrant": "NODE_ENV=test jest ./tests/functional/reentrant/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
60
56
|
"test:retry": "NODE_ENV=test jest ./tests/functional/retry/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
61
57
|
"test:sequence": "NODE_ENV=test HMSH_LOGLEVEL=debug jest ./tests/functional/sequence/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
62
|
-
"test:signal": "NODE_ENV=test jest ./tests/functional/signal
|
|
58
|
+
"test:signal": "NODE_ENV=test jest ./tests/functional/signal/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
63
59
|
"test:status": "NODE_ENV=test jest ./tests/functional/status/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
60
|
+
"test:providers": "NODE_ENV=test jest ./tests/functional/*/providers/*/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
64
61
|
"test:store:ioredis": "NODE_ENV=test jest ./tests/functional/store/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
65
62
|
"test:store:redis": "NODE_ENV=test jest ./tests/functional/store/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
66
63
|
"test:store:postgres": "NODE_ENV=test jest ./tests/functional/store/providers/postgres/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
@@ -70,6 +67,7 @@
|
|
|
70
67
|
"test:stream:nats": "NODE_ENV=test jest ./tests/functional/stream/providers/nats/nats.test.ts --detectOpenHandles --forceExit --verbose",
|
|
71
68
|
"test:sub:ioredis": "NODE_ENV=test jest ./tests/functional/sub/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
72
69
|
"test:sub:redis": "NODE_ENV=test jest ./tests/functional/sub/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
70
|
+
"test:sub:postgres": "NODE_ENV=test jest ./tests/functional/sub/providers/postgres/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
73
71
|
"test:trigger": "NODE_ENV=test jest ./tests/unit/services/activities/trigger.test.ts --detectOpenHandles --forceExit --verbose",
|
|
74
72
|
"test:meshdata": "NODE_ENV=test jest ./tests/meshdata/postgres.test.ts --forceExit --verbose --detectOpenHandles",
|
|
75
73
|
"test:meshos": "NODE_ENV=test HMSH_IS_CLUSTER=true jest ./tests/meshos/*.test.ts --forceExit --verbose --detectOpenHandles",
|
package/types/redis.ts
CHANGED
|
@@ -139,13 +139,13 @@ interface RedisRedisClientType extends ProviderClient {
|
|
|
139
139
|
pSubscribe(
|
|
140
140
|
pattern: string,
|
|
141
141
|
callback: (channel: string, message: string) => void,
|
|
142
|
-
): void
|
|
143
|
-
pUnsubscribe(pattern: string): void
|
|
142
|
+
): Promise<void>;
|
|
143
|
+
pUnsubscribe(pattern: string): Promise<void>;
|
|
144
144
|
subscribe(
|
|
145
145
|
channel: string,
|
|
146
146
|
callback: (channel: string, message: string) => void,
|
|
147
|
-
): void
|
|
148
|
-
unsubscribe(channel: string): void
|
|
147
|
+
): Promise<void>;
|
|
148
|
+
unsubscribe(channel: string): Promise<void>;
|
|
149
149
|
punsubscribe(channel: string): void;
|
|
150
150
|
get(key: string): Promise<string | null>;
|
|
151
151
|
set(key: string, value: string): Promise<string>;
|
|
@@ -239,13 +239,13 @@ interface IORedisClient extends ProviderClient {
|
|
|
239
239
|
pattern: string,
|
|
240
240
|
callback: (channel: string, message: string) => void,
|
|
241
241
|
): Promise<void>;
|
|
242
|
-
punsubscribe(pattern: string):
|
|
242
|
+
punsubscribe(pattern: string): Promise<number>;
|
|
243
243
|
subscribe(
|
|
244
244
|
channel: string,
|
|
245
245
|
callback: (channel: string, message: string) => void,
|
|
246
|
-
): void
|
|
247
|
-
unsubscribe(channel: string):
|
|
248
|
-
punsubscribe(channel: string):
|
|
246
|
+
): Promise<void>;
|
|
247
|
+
unsubscribe(channel: string): Promise<number>;
|
|
248
|
+
punsubscribe(channel: string): Promise<number>;
|
|
249
249
|
|
|
250
250
|
xadd(key: string, id: string, fields: any, message?: string): Promise<string>;
|
|
251
251
|
xack(key: string, group: string, id: string): Promise<number>;
|