@hotmeshio/hotmesh 0.3.24 → 0.3.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +1 -1
  2. package/build/modules/key.js +1 -1
  3. package/build/modules/utils.js +1 -1
  4. package/build/package.json +1 -1
  5. package/build/services/activities/activity.js +1 -1
  6. package/build/services/activities/await.js +1 -1
  7. package/build/services/activities/cycle.js +1 -1
  8. package/build/services/activities/hook.js +1 -1
  9. package/build/services/activities/index.js +1 -1
  10. package/build/services/activities/interrupt.js +1 -1
  11. package/build/services/activities/signal.js +1 -1
  12. package/build/services/activities/trigger.js +1 -1
  13. package/build/services/activities/worker.js +1 -1
  14. package/build/services/collator/index.js +1 -1
  15. package/build/services/compiler/deployer.js +1 -1
  16. package/build/services/compiler/index.js +1 -1
  17. package/build/services/compiler/validator.js +1 -1
  18. package/build/services/engine/index.js +1 -1
  19. package/build/services/exporter/index.js +1 -1
  20. package/build/services/mapper/index.js +1 -1
  21. package/build/services/meshflow/exporter.js +1 -1
  22. package/build/services/pipe/functions/array.js +1 -1
  23. package/build/services/pipe/functions/bitwise.js +1 -1
  24. package/build/services/pipe/functions/conditional.js +1 -1
  25. package/build/services/pipe/functions/cron.js +1 -1
  26. package/build/services/pipe/functions/date.js +1 -1
  27. package/build/services/pipe/functions/index.js +1 -1
  28. package/build/services/pipe/functions/json.js +1 -1
  29. package/build/services/pipe/functions/logical.js +1 -1
  30. package/build/services/pipe/functions/math.js +1 -1
  31. package/build/services/pipe/functions/number.js +1 -1
  32. package/build/services/pipe/functions/object.js +1 -1
  33. package/build/services/pipe/functions/string.js +1 -1
  34. package/build/services/pipe/functions/symbol.js +1 -1
  35. package/build/services/pipe/functions/unary.js +1 -1
  36. package/build/services/pipe/index.js +1 -1
  37. package/build/services/quorum/index.js +1 -1
  38. package/build/services/reporter/index.js +1 -1
  39. package/build/services/router/index.js +1 -1
  40. package/build/services/search/providers/postgres/postgres.js +1 -1
  41. package/build/services/search/providers/redis/ioredis.js +1 -1
  42. package/build/services/search/providers/redis/redis.js +1 -1
  43. package/build/services/serializer/index.js +1 -1
  44. package/build/services/store/providers/postgres/kvsql.js +1 -1
  45. package/build/services/store/providers/postgres/kvtables.js +1 -1
  46. package/build/services/store/providers/postgres/kvtransaction.js +1 -1
  47. package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
  48. package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
  49. package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
  50. package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
  51. package/build/services/store/providers/postgres/postgres.js +1 -1
  52. package/build/services/store/providers/redis/_base.js +1 -1
  53. package/build/services/store/providers/redis/ioredis.js +1 -1
  54. package/build/services/store/providers/redis/redis.js +1 -1
  55. package/build/services/store/providers/store-initializable.js +1 -1
  56. package/build/services/stream/providers/nats/nats.js +1 -1
  57. package/build/services/stream/providers/postgres/postgres.js +1 -1
  58. package/build/services/stream/providers/redis/ioredis.js +1 -1
  59. package/build/services/stream/providers/redis/redis.js +1 -1
  60. package/build/services/stream/providers/stream-initializable.js +1 -1
  61. package/build/services/sub/providers/nats/nats.js +1 -1
  62. package/build/services/sub/providers/postgres/postgres.js +1 -1
  63. package/build/services/sub/providers/redis/ioredis.js +1 -1
  64. package/build/services/sub/providers/redis/redis.js +1 -1
  65. package/build/services/task/index.js +1 -1
  66. package/build/services/telemetry/index.js +1 -1
  67. package/build/services/worker/index.js +1 -1
  68. package/package.json +1 -1
@@ -1 +1 @@
1
- 'use strict';(function(_0x235510,_0x43f54a){const _0x434d72=_0x3649,_0x1bc2f2=_0x235510();while(!![]){try{const _0x4ac603=parseInt(_0x434d72(0x114))/0x1+-parseInt(_0x434d72(0x118))/0x2+parseInt(_0x434d72(0x11a))/0x3*(-parseInt(_0x434d72(0x113))/0x4)+-parseInt(_0x434d72(0x116))/0x5+parseInt(_0x434d72(0x117))/0x6*(-parseInt(_0x434d72(0x119))/0x7)+-parseInt(_0x434d72(0x11b))/0x8+-parseInt(_0x434d72(0x11c))/0x9*(-parseInt(_0x434d72(0x115))/0xa);if(_0x4ac603===_0x43f54a)break;else _0x1bc2f2['push'](_0x1bc2f2['shift']());}catch(_0x244f32){_0x1bc2f2['push'](_0x1bc2f2['shift']());}}}(_0x5240,0x62f7c));function _0x5240(){const _0x42f3d9=['9WpMBcv','4cNzNex','506160ftbwPd','20026550ZYvuot','3441670NmGtfN','98322skYAlS','1385522luvClU','7atztRH','1053537PBfUuu','2838256yYhvNV'];_0x5240=function(){return _0x42f3d9;};return _0x5240();}function _0x3649(_0x5e7fd3,_0x292ad8){const _0x5240fd=_0x5240();return _0x3649=function(_0x36499e,_0x5e2998){_0x36499e=_0x36499e-0x113;let _0x2a9bb2=_0x5240fd[_0x36499e];return _0x2a9bb2;},_0x3649(_0x5e7fd3,_0x292ad8);}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'](_0x205587,_0x1f9fec,_0x5a319b,_0x263118,_0x3cbb21){const _0x20c3c8=[];if(Array['isArray'](_0x263118['workers']))for(const _0x15a6cf of _0x263118['workers']){await factory_1['ConnectorService']['initClients'](_0x15a6cf);const _0x3068b7=new WorkerService();_0x3068b7['verifyWorkerFields'](_0x15a6cf),_0x3068b7['namespace']=_0x205587,_0x3068b7['appId']=_0x1f9fec,_0x3068b7['guid']=_0x5a319b,_0x3068b7['callback']=_0x15a6cf['callback'],_0x3068b7['topic']=_0x15a6cf['topic'],_0x3068b7['config']=_0x263118,_0x3068b7['logger']=_0x3cbb21,await _0x3068b7['initStoreChannel'](_0x3068b7,_0x15a6cf['store']),await _0x3068b7['initSubChannel'](_0x3068b7,_0x15a6cf['sub'],_0x15a6cf['pub']??_0x15a6cf['store']),await _0x3068b7['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x3068b7['subscriptionHandler'](),_0x1f9fec),await _0x3068b7['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x3068b7['subscriptionHandler'](),_0x1f9fec,_0x3068b7['topic']),await _0x3068b7['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x3068b7['subscriptionHandler'](),_0x1f9fec,_0x3068b7['guid']),await _0x3068b7['initStreamChannel'](_0x3068b7,_0x15a6cf['stream'],_0x15a6cf['store']),_0x3068b7['router']=await _0x3068b7['initRouter'](_0x15a6cf,_0x3cbb21);const _0x3b6063=_0x3068b7['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x3068b7['appId'],'topic':_0x15a6cf['topic']});await _0x3068b7['router']['consumeMessages'](_0x3b6063,'WORKER',_0x3068b7['guid'],_0x15a6cf['callback']),_0x3068b7['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x20c3c8['push'](_0x3068b7);}return _0x20c3c8;}['verifyWorkerFields'](_0x2690e5){if(!(0x0,utils_1['identifyProvider'])(_0x2690e5['store'])||!(0x0,utils_1['identifyProvider'])(_0x2690e5['stream'])||!(0x0,utils_1['identifyProvider'])(_0x2690e5['sub'])||!(_0x2690e5['topic']&&_0x2690e5['callback']))throw new Error('worker\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields\x20along\x20with\x20a\x20callback\x20function\x20and\x20topic.');}async['initStoreChannel'](_0xe46c22,_0x47f186){_0xe46c22['store']=await factory_4['StoreServiceFactory']['init'](_0x47f186,_0xe46c22['namespace'],_0xe46c22['appId'],_0xe46c22['logger']);}async['initSubChannel'](_0x51a5e8,_0x44dd82,_0x4a48bc){_0x51a5e8['subscribe']=await factory_3['SubServiceFactory']['init'](_0x44dd82,_0x4a48bc,_0x51a5e8['namespace'],_0x51a5e8['appId'],_0x51a5e8['guid'],_0x51a5e8['logger']);}async['initStreamChannel'](_0x62106e,_0x54a8a8,_0x2b0b2d){_0x62106e['stream']=await factory_2['StreamServiceFactory']['init'](_0x54a8a8,_0x2b0b2d,_0x62106e['namespace'],_0x62106e['appId'],_0x62106e['logger']);}async['initRouter'](_0x5c19e1,_0x47e8ec){const _0x230c1f=await this['store']['getThrottleRate'](_0x5c19e1['topic']);return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['WORKER'],'topic':_0x5c19e1['topic'],'reclaimDelay':_0x5c19e1['reclaimDelay'],'reclaimCount':_0x5c19e1['reclaimCount'],'throttle':_0x230c1f},this['stream'],_0x47e8ec);}['subscriptionHandler'](){const _0x2765e4=this;return async(_0xaf659,_0x550066)=>{_0x2765e4['logger']['debug']('worker-event-received',{'topic':_0xaf659,'type':_0x550066['type']});if(_0x550066['type']==='throttle')_0x550066['topic']!==null&&_0x2765e4['throttle'](_0x550066['throttle']);else{if(_0x550066['type']==='ping')_0x2765e4['sayPong'](_0x2765e4['appId'],_0x2765e4['guid'],_0x550066['originator'],_0x550066['details']);else _0x550066['type']==='rollcall'&&(_0x550066['topic']!==null&&_0x2765e4['doRollCall'](_0x550066));}};}async['doRollCall'](_0x374ba7){let _0x4ff9f8=0x0;const _0x2de9a2=!isNaN(_0x374ba7['max'])?_0x374ba7['max']:enums_1['HMSH_QUORUM_ROLLCALL_CYCLES'];if(this['rollCallInterval'])clearTimeout(this['rollCallInterval']);const _0x3404b7=_0x374ba7['interval']/0x2,_0x46efc4=_0x3404b7+Math['ceil'](Math['random']()*_0x3404b7);do{await(0x0,utils_1['sleepFor'])(Math['ceil'](Math['random']()*0x3e8)),await this['sayPong'](this['appId'],this['guid'],null,!![],_0x374ba7['signature']);if(!_0x374ba7['interval'])return;const {promise:_0x1b3ca8,timerId:_0x20631b}=(0x0,utils_1['XSleepFor'])(_0x46efc4*0x3e8);this['rollCallInterval']=_0x20631b,await _0x1b3ca8;}while(this['rollCallInterval']&&_0x4ff9f8++<_0x2de9a2-0x1);}['cancelRollCall'](){this['rollCallInterval']&&(clearTimeout(this['rollCallInterval']),delete this['rollCallInterval']);}['stop'](){this['cancelRollCall']();}async['sayPong'](_0xb14379,_0x27056b,_0x3949e9,_0x2173e9=![],_0x6e9835=![]){let _0xcf649;if(_0x2173e9){const _0x4b7b80={'appId':this['appId'],'topic':this['topic']};_0xcf649={'engine_id':this['guid'],'namespace':this['namespace'],'app_id':this['appId'],'worker_topic':this['topic'],'stream':this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x4b7b80),'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':_0x6e9835?this['callback']['toString']():undefined};}this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'pong','guid':_0x27056b,'originator':_0x3949e9,'profile':_0xcf649},_0xb14379);}async['throttle'](_0x5ad086){this['router']?.['setThrottle'](_0x5ad086);}}exports['WorkerService']=WorkerService;
1
+ 'use strict';function b(c,d){const e=a();return b=function(f,g){f=f-0x1e8;let h=e[f];return h;},b(c,d);}const m=b;function a(){const z=['../../modules/utils','max','SubServiceFactory','92652DaAceO','subscriptionHandler','logger','rollcall','consumeMessages','push','stream','../../types/stream','../../modules/key','cancelRollCall','throttle','STREAMS','1064380ntsOId','worker-event-received','45vBPfpN','KeyType','inited','StoreServiceFactory','isArray','appId','8KNeAAK','WorkerService','pub','25168ArLuDK','router','guid','debug','21DUPPkB','subscribe','topic','rollCallInterval','initSubChannel','QUORUM','684MavciC','setThrottle','HMSH_QUORUM_ROLLCALL_CYCLES','ceil','interval','verifyWorkerFields','ConnectorService','204074YTkttU','stop','pong','formatISODate','__esModule','toString','18eBLhkI','defineProperty','worker\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields\x20along\x20with\x20a\x20callback\x20function\x20and\x20topic.','callback','2672PcyFfT','StreamServiceFactory','XSleepFor','reclaimCount','ping','110670kaOqGN','321671rBnWXJ','type','reclaimDelay','sub','../store/factory','signature','doRollCall','workers','identifyProvider','Router','initStoreChannel','initStreamChannel','store','counts','mintKey','namespace','../../modules/enums','../connector/factory','random','sayPong','init','details','getThrottleRate','../router','publish'];a=function(){return z;};return a();}(function(c,d){const l=b,e=c();while(!![]){try{const f=parseInt(l(0x20b))/0x1+-parseInt(l(0x21a))/0x2+parseInt(l(0x1fe))/0x3*(-parseInt(l(0x215))/0x4)+-parseInt(l(0x1f1))/0x5*(parseInt(l(0x237))/0x6)+-parseInt(l(0x21b))/0x7*(-parseInt(l(0x1f7))/0x8)+parseInt(l(0x211))/0x9*(parseInt(l(0x1ef))/0xa)+-parseInt(l(0x1fa))/0xb*(parseInt(l(0x204))/0xc);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x2097a));Object[m(0x212)](exports,m(0x20f),{'value':!![]}),exports['WorkerService']=void 0x0;const key_1=require(m(0x1eb)),utils_1=require(m(0x234)),factory_1=require(m(0x22c)),router_1=require(m(0x232)),stream_1=require(m(0x1ea)),enums_1=require(m(0x22b)),factory_2=require('../stream/factory'),factory_3=require('../sub/factory'),factory_4=require(m(0x21f));class WorkerService{constructor(){this['reporting']=![];}static async[m(0x22f)](c,d,e,f,g){const n=m,h=[];if(Array[n(0x1f5)](f['workers']))for(const i of f[n(0x222)]){await factory_1[n(0x20a)]['initClients'](i);const j=new WorkerService();j[n(0x209)](i),j[n(0x22a)]=c,j[n(0x1f6)]=d,j['guid']=e,j['callback']=i['callback'],j[n(0x200)]=i[n(0x200)],j['config']=f,j[n(0x239)]=g,await j[n(0x225)](j,i['store']),await j[n(0x202)](j,i[n(0x21e)],i[n(0x1f9)]??i[n(0x227)]),await j['subscribe']['subscribe'](key_1['KeyType'][n(0x203)],j[n(0x238)](),d),await j['subscribe'][n(0x1ff)](key_1[n(0x1f2)][n(0x203)],j[n(0x238)](),d,j[n(0x200)]),await j[n(0x1ff)]['subscribe'](key_1[n(0x1f2)][n(0x203)],j['subscriptionHandler'](),d,j[n(0x1fc)]),await j['initStreamChannel'](j,i[n(0x1e9)],i[n(0x227)]),j[n(0x1fb)]=await j['initRouter'](i,g);const k=j['store']['mintKey'](key_1[n(0x1f2)]['STREAMS'],{'appId':j['appId'],'topic':i['topic']});await j[n(0x1fb)][n(0x23b)](k,'WORKER',j[n(0x1fc)],i[n(0x214)]),j[n(0x1f3)]=(0x0,utils_1[n(0x20e)])(new Date()),h[n(0x1e8)](j);}return h;}['verifyWorkerFields'](c){const o=m;if(!(0x0,utils_1[o(0x223)])(c[o(0x227)])||!(0x0,utils_1[o(0x223)])(c[o(0x1e9)])||!(0x0,utils_1[o(0x223)])(c[o(0x21e)])||!(c['topic']&&c['callback']))throw new Error(o(0x213));}async['initStoreChannel'](c,d){const p=m;c[p(0x227)]=await factory_4[p(0x1f4)]['init'](d,c['namespace'],c[p(0x1f6)],c[p(0x239)]);}async[m(0x202)](c,d,e){const q=m;c[q(0x1ff)]=await factory_3[q(0x236)]['init'](d,e,c[q(0x22a)],c[q(0x1f6)],c[q(0x1fc)],c['logger']);}async[m(0x226)](c,d,e){const r=m;c[r(0x1e9)]=await factory_2[r(0x216)][r(0x22f)](d,e,c[r(0x22a)],c[r(0x1f6)],c[r(0x239)]);}async['initRouter'](c,d){const s=m,e=await this[s(0x227)][s(0x231)](c['topic']);return new router_1[(s(0x224))]({'namespace':this[s(0x22a)],'appId':this['appId'],'guid':this[s(0x1fc)],'role':stream_1['StreamRole']['WORKER'],'topic':c[s(0x200)],'reclaimDelay':c[s(0x21d)],'reclaimCount':c[s(0x218)],'throttle':e},this['stream'],d);}[m(0x238)](){const c=this;return async(d,e)=>{const t=b;c['logger'][t(0x1fd)](t(0x1f0),{'topic':d,'type':e[t(0x21c)]});if(e['type']==='throttle')e[t(0x200)]!==null&&c[t(0x1ed)](e[t(0x1ed)]);else{if(e[t(0x21c)]===t(0x219))c['sayPong'](c[t(0x1f6)],c[t(0x1fc)],e['originator'],e[t(0x230)]);else e[t(0x21c)]===t(0x23a)&&(e[t(0x200)]!==null&&c['doRollCall'](e));}};}async[m(0x221)](c){const u=m;let d=0x0;const e=!isNaN(c[u(0x235)])?c[u(0x235)]:enums_1[u(0x206)];if(this['rollCallInterval'])clearTimeout(this[u(0x201)]);const f=c['interval']/0x2,g=f+Math[u(0x207)](Math[u(0x22d)]()*f);do{await(0x0,utils_1['sleepFor'])(Math[u(0x207)](Math[u(0x22d)]()*0x3e8)),await this['sayPong'](this['appId'],this['guid'],null,!![],c[u(0x220)]);if(!c[u(0x208)])return;const {promise:h,timerId:i}=(0x0,utils_1[u(0x217)])(g*0x3e8);this[u(0x201)]=i,await h;}while(this[u(0x201)]&&d++<e-0x1);}[m(0x1ec)](){const v=m;this[v(0x201)]&&(clearTimeout(this['rollCallInterval']),delete this[v(0x201)]);}[m(0x20c)](){const w=m;this[w(0x1ec)]();}async[m(0x22e)](c,d,e,f=![],g=![]){const x=m;let h;if(f){const i={'appId':this[x(0x1f6)],'topic':this[x(0x200)]};h={'engine_id':this[x(0x1fc)],'namespace':this[x(0x22a)],'app_id':this['appId'],'worker_topic':this[x(0x200)],'stream':this['store'][x(0x229)](key_1[x(0x1f2)][x(0x1ee)],i),'counts':this[x(0x1fb)]?.[x(0x228)],'timestamp':(0x0,utils_1[x(0x20e)])(new Date()),'inited':this[x(0x1f3)],'throttle':this[x(0x1fb)]?.[x(0x1ed)],'reclaimDelay':this[x(0x1fb)]?.[x(0x21d)],'reclaimCount':this[x(0x1fb)]?.[x(0x218)],'system':await(0x0,utils_1['getSystemHealth'])(),'signature':g?this[x(0x214)][x(0x210)]():undefined};}this[x(0x1ff)][x(0x233)](key_1[x(0x1f2)]['QUORUM'],{'type':x(0x20d),'guid':d,'originator':e,'profile':h},c);}async['throttle'](c){const y=m;this[y(0x1fb)]?.[y(0x205)](c);}}exports[m(0x1f8)]=WorkerService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.3.24",
3
+ "version": "0.3.25",
4
4
  "description": "Serverless Workflow",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",