@hotmeshio/hotmesh 0.3.16 → 0.3.18

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 (66) hide show
  1. package/README.md +10 -5
  2. package/build/modules/key.js +1 -1
  3. package/build/modules/utils.js +1 -1
  4. package/build/package.json +3 -6
  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/redis/ioredis.js +1 -1
  62. package/build/services/sub/providers/redis/redis.js +1 -1
  63. package/build/services/task/index.js +1 -1
  64. package/build/services/telemetry/index.js +1 -1
  65. package/build/services/worker/index.js +1 -1
  66. package/package.json +3 -6
@@ -1 +1 @@
1
- 'use strict';(function(_0x4649d2,_0xc7a49){const _0x38d85d=_0x26e0,_0x3e3924=_0x4649d2();while(!![]){try{const _0x42ac5b=-parseInt(_0x38d85d(0x6f))/0x1+-parseInt(_0x38d85d(0x74))/0x2+-parseInt(_0x38d85d(0x76))/0x3+-parseInt(_0x38d85d(0x72))/0x4*(-parseInt(_0x38d85d(0x77))/0x5)+parseInt(_0x38d85d(0x6e))/0x6+parseInt(_0x38d85d(0x73))/0x7*(parseInt(_0x38d85d(0x71))/0x8)+parseInt(_0x38d85d(0x75))/0x9*(parseInt(_0x38d85d(0x70))/0xa);if(_0x42ac5b===_0xc7a49)break;else _0x3e3924['push'](_0x3e3924['shift']());}catch(_0x1a1992){_0x3e3924['push'](_0x3e3924['shift']());}}}(_0x587c,0x1f79d));var __importDefault=this&&this['__importDefault']||function(_0x3cf0de){return _0x3cf0de&&_0x3cf0de['__esModule']?_0x3cf0de:{'default':_0x3cf0de};};function _0x587c(){const _0x5402d7=['6452mnPJLr','70PkdIbY','418972BczWRr','9tdcLrD','253290eNIwMu','580kfjvCp','947376AwinHy','196126heBlRk','1798330UIcgBv','75304zHpYFx'];_0x587c=function(){return _0x5402d7;};return _0x587c();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['TelemetryService']=void 0x0;function _0x26e0(_0x1beaf3,_0x113b46){const _0x587cb3=_0x587c();return _0x26e0=function(_0x26e05d,_0x3562d6){_0x26e05d=_0x26e05d-0x6e;let _0x288c3e=_0x587cb3[_0x26e05d];return _0x288c3e;},_0x26e0(_0x1beaf3,_0x113b46);}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(_0x1e5ef4,_0xcb1ff5,_0x126780,_0x8d3ca6){this['leg']=0x1,this['appId']=_0x1e5ef4,this['config']=_0xcb1ff5,this['metadata']=_0x126780,this['context']=_0x8d3ca6;}['getJobParentSpanId'](){return this['context']['metadata']['spn'];}['getActivityParentSpanId'](_0x28a303){return _0x28a303===0x1?this['context'][this['config']['parent']]['output']?.['metadata']?.['l2s']:this['context']['$self']['output']?.['metadata']?.['l1s'];}['getTraceId'](){return this['context']['metadata']['trc'];}['startJobSpan'](){const _0x4f684e='JOB/'+this['appId']+'/'+this['config']['subscribes']+'/1',_0x18ba06=this['getTraceId'](),_0x1d8743=this['getJobParentSpanId'](),_0x5b95c8=this['getSpanAttrs'](0x1),_0x1c8f2d=this['startSpan'](_0x18ba06,_0x1d8743,_0x4f684e,_0x5b95c8);return this['jobSpan']=_0x1c8f2d,this['setTelemetryContext'](_0x1c8f2d,0x1),this;}['startActivitySpan'](_0x1eea89=this['leg']){const _0x5db793=this['config']['type']['toUpperCase']()+'/'+this['appId']+'/'+this['metadata']['aid']+'/'+_0x1eea89,_0x5dddf0=this['getTraceId'](),_0x5639d9=this['getActivityParentSpanId'](_0x1eea89),_0x3dc80a=this['getSpanAttrs'](_0x1eea89),_0x4ea305=this['startSpan'](_0x5dddf0,_0x5639d9,_0x5db793,_0x3dc80a);return this['setTelemetryContext'](_0x4ea305,_0x1eea89),this['span']=_0x4ea305,this;}['startStreamSpan'](_0x382eca,_0x184801){let _0xcf868a;if(_0x184801===stream_1['StreamRole']['SYSTEM'])_0xcf868a='SYSTEM';else{if(_0x184801===stream_1['StreamRole']['WORKER'])_0xcf868a='EXECUTE';else _0x382eca['type']===stream_1['StreamDataType']['RESULT']||_0x382eca['type']===stream_1['StreamDataType']['RESPONSE']?_0xcf868a='FANIN':_0xcf868a='FANOUT';}const _0x1b468b=_0x382eca['metadata']['topic']?'/'+_0x382eca['metadata']['topic']:'',_0x386822=_0xcf868a+'/'+this['appId']+'/'+_0x382eca['metadata']['aid']+_0x1b468b,_0x20369e=this['getStreamSpanAttrs'](_0x382eca),_0x1d3319=this['startSpan'](_0x382eca['metadata']['trc'],_0x382eca['metadata']['spn'],_0x386822,_0x20369e);return this['span']=_0x1d3319,this;}['startSpan'](_0x43d82e,_0x371744,_0x744532,_0x58a5e6){this['traceId']=_0x43d82e,this['spanId']=_0x371744;const _0x5519d9=telemetry_1['trace']['getTracer'](package_json_1['default']['name'],package_json_1['default']['version']),_0x5e1f25=this['getParentSpanContext'](),_0x425a59=_0x5519d9['startSpan'](_0x744532,{'kind':telemetry_1['SpanKind']['CLIENT'],'attributes':_0x58a5e6,'root':!_0x5e1f25},_0x5e1f25);return _0x425a59;}['mapActivityAttributes'](){if(this['config']['telemetry']){const _0x223f2f=new mapper_1['MapperService'](this['config']['telemetry'],this['context'])['mapRules'](),_0x48f21f={...Object['keys'](_0x223f2f)['reduce']((_0x1f71f7,_0x414073)=>{return['string','boolean','number']['includes'](typeof _0x223f2f[_0x414073])&&(_0x1f71f7['app.activity.data.'+_0x414073]=_0x223f2f[_0x414073]),_0x1f71f7;},{})};this['span']?.['setAttributes'](_0x48f21f);}}['setActivityAttributes'](_0x4ca5b7){this['span']?.['setAttributes'](_0x4ca5b7);}['setStreamAttributes'](_0x27e4ef){this['span']?.['setAttributes'](_0x27e4ef);}['setJobAttributes'](_0x5006b2){this['jobSpan']?.['setAttributes'](_0x5006b2);}['endJobSpan'](){this['endSpan'](this['jobSpan']);}['endActivitySpan'](){this['endSpan'](this['span']);}['endStreamSpan'](){this['endSpan'](this['span']);}['endSpan'](_0xfb861d){_0xfb861d&&_0xfb861d['end']();}['getParentSpanContext'](){if(this['traceId']&&this['spanId']){const _0x9471ac={'traceId':this['traceId'],'spanId':this['spanId'],'isRemote':!![],'traceFlags':0x1},_0xfca809=telemetry_1['trace']['setSpanContext'](telemetry_1['context']['active'](),_0x9471ac);return _0xfca809;}}['getSpanAttrs'](_0x2bc4e9){return{...Object['keys'](this['context']['metadata'])['reduce']((_0x35ee19,_0x156372)=>{return _0x156372!=='trc'&&(_0x35ee19['app.job.'+_0x156372]=this['context']['metadata'][_0x156372]),_0x35ee19;},{}),...Object['keys'](this['metadata'])['reduce']((_0x2da0f5,_0x225222)=>{return _0x2da0f5['app.activity.'+_0x225222]=this['metadata'][_0x225222],_0x2da0f5;},{}),'app.activity.leg':_0x2bc4e9};}['getStreamSpanAttrs'](_0x550a71){return{...Object['keys'](_0x550a71['metadata'])['reduce']((_0x394306,_0xb72119)=>{return _0xb72119!=='trc'&&_0xb72119!=='spn'&&(_0x394306['app.stream.'+_0xb72119]=_0x550a71['metadata'][_0xb72119]),_0x394306;},{})};}['setTelemetryContext'](_0x8a83,_0x3d3e94){!this['context']['metadata']['trc']&&(this['context']['metadata']['trc']=_0x8a83['spanContext']()['traceId']),_0x3d3e94===0x1?(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l1s']=_0x8a83['spanContext']()['spanId']):(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l2s']=_0x8a83['spanContext']()['spanId']);}['setActivityError'](_0x4006bb){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0x4006bb});}['setStreamError'](_0x4a0066){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0x4a0066});}static['addTargetTelemetryPaths'](_0x31db82,_0x62b377,_0x518217,_0x9af2ce){_0x9af2ce===0x1?(!(_0x62b377['parent']in _0x31db82)&&(_0x31db82[_0x62b377['parent']]=[]),_0x31db82[_0x62b377['parent']]['push'](_0x62b377['parent']+'/output/metadata/l2s')):(!(_0x518217['aid']in _0x31db82)&&(_0x31db82[_0x518217['aid']]=[]),_0x31db82[_0x518217['aid']]['push'](_0x518217['aid']+'/output/metadata/l1s'));}static['bindJobTelemetryToState'](_0x49c6df,_0x848d9a,_0xd3c94b){_0x848d9a['type']==='trigger'&&(_0x49c6df['metadata/trc']=_0xd3c94b['metadata']['trc']);}static['bindActivityTelemetryToState'](_0x3fecde,_0x44158a,_0x45fbb8,_0x33dccb,_0x3c6b9f){if(_0x44158a['type']==='trigger')_0x3fecde[_0x45fbb8['aid']+'/output/metadata/l1s']=_0x33dccb['$self']['output']['metadata']['l1s'],_0x3fecde[_0x45fbb8['aid']+'/output/metadata/l2s']=_0x33dccb['$self']['output']['metadata']['l2s'];else{if(utils_1['polyfill']['resolveActivityType'](_0x44158a['type'])==='hook'&&_0x3c6b9f===0x1)_0x3fecde[_0x45fbb8['aid']+'/output/metadata/l1s']=_0x33dccb['$self']['output']['metadata']['l1s'],_0x3fecde[_0x45fbb8['aid']+'/output/metadata/l2s']=_0x33dccb['$self']['output']['metadata']['l1s'];else{if(_0x44158a['type']==='signal'&&_0x3c6b9f===0x1)_0x3fecde[_0x45fbb8['aid']+'/output/metadata/l1s']=_0x33dccb['$self']['output']['metadata']['l1s'],_0x3fecde[_0x45fbb8['aid']+'/output/metadata/l2s']=_0x33dccb['$self']['output']['metadata']['l1s'];else{const _0x46e68d='l'+_0x3c6b9f+'s';_0x3fecde[_0x45fbb8['aid']+'/output/metadata/'+_0x46e68d]=_0x33dccb['$self']['output']['metadata'][_0x46e68d];}}}}}exports['TelemetryService']=TelemetryService;
1
+ 'use strict';(function(_0x1f08d2,_0x2ec348){const _0x5e2fdf=_0x19ce,_0x73c9f7=_0x1f08d2();while(!![]){try{const _0x40d4d6=parseInt(_0x5e2fdf(0x125))/0x1+-parseInt(_0x5e2fdf(0x127))/0x2*(-parseInt(_0x5e2fdf(0x11e))/0x3)+-parseInt(_0x5e2fdf(0x128))/0x4+-parseInt(_0x5e2fdf(0x124))/0x5+-parseInt(_0x5e2fdf(0x123))/0x6*(-parseInt(_0x5e2fdf(0x120))/0x7)+parseInt(_0x5e2fdf(0x121))/0x8*(-parseInt(_0x5e2fdf(0x122))/0x9)+-parseInt(_0x5e2fdf(0x11f))/0xa*(-parseInt(_0x5e2fdf(0x126))/0xb);if(_0x40d4d6===_0x2ec348)break;else _0x73c9f7['push'](_0x73c9f7['shift']());}catch(_0x2d064b){_0x73c9f7['push'](_0x73c9f7['shift']());}}}(_0x4266,0x5dab6));var __importDefault=this&&this['__importDefault']||function(_0x3341a2){return _0x3341a2&&_0x3341a2['__esModule']?_0x3341a2:{'default':_0x3341a2};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['TelemetryService']=void 0x0;function _0x19ce(_0x2003ae,_0x13c2d6){const _0x4266b1=_0x4266();return _0x19ce=function(_0x19ce80,_0x1f308e){_0x19ce80=_0x19ce80-0x11e;let _0x387b36=_0x4266b1[_0x19ce80];return _0x387b36;},_0x19ce(_0x2003ae,_0x13c2d6);}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(_0x3fcaf9,_0x369ffa,_0x3ff5ac,_0x29ad31){this['leg']=0x1,this['appId']=_0x3fcaf9,this['config']=_0x369ffa,this['metadata']=_0x3ff5ac,this['context']=_0x29ad31;}['getJobParentSpanId'](){return this['context']['metadata']['spn'];}['getActivityParentSpanId'](_0x30f589){return _0x30f589===0x1?this['context'][this['config']['parent']]['output']?.['metadata']?.['l2s']:this['context']['$self']['output']?.['metadata']?.['l1s'];}['getTraceId'](){return this['context']['metadata']['trc'];}['startJobSpan'](){const _0x16c091='JOB/'+this['appId']+'/'+this['config']['subscribes']+'/1',_0x3ecdeb=this['getTraceId'](),_0x25f110=this['getJobParentSpanId'](),_0x597109=this['getSpanAttrs'](0x1),_0x17177b=this['startSpan'](_0x3ecdeb,_0x25f110,_0x16c091,_0x597109);return this['jobSpan']=_0x17177b,this['setTelemetryContext'](_0x17177b,0x1),this;}['startActivitySpan'](_0x56a31f=this['leg']){const _0x251e78=this['config']['type']['toUpperCase']()+'/'+this['appId']+'/'+this['metadata']['aid']+'/'+_0x56a31f,_0x1305c0=this['getTraceId'](),_0x3af3f6=this['getActivityParentSpanId'](_0x56a31f),_0x1b9baf=this['getSpanAttrs'](_0x56a31f),_0x1057a5=this['startSpan'](_0x1305c0,_0x3af3f6,_0x251e78,_0x1b9baf);return this['setTelemetryContext'](_0x1057a5,_0x56a31f),this['span']=_0x1057a5,this;}['startStreamSpan'](_0x4ae8d0,_0x1d8d7a){let _0x34bfa1;if(_0x1d8d7a===stream_1['StreamRole']['SYSTEM'])_0x34bfa1='SYSTEM';else{if(_0x1d8d7a===stream_1['StreamRole']['WORKER'])_0x34bfa1='EXECUTE';else _0x4ae8d0['type']===stream_1['StreamDataType']['RESULT']||_0x4ae8d0['type']===stream_1['StreamDataType']['RESPONSE']?_0x34bfa1='FANIN':_0x34bfa1='FANOUT';}const _0x533aca=_0x4ae8d0['metadata']['topic']?'/'+_0x4ae8d0['metadata']['topic']:'',_0x386306=_0x34bfa1+'/'+this['appId']+'/'+_0x4ae8d0['metadata']['aid']+_0x533aca,_0x2f3f02=this['getStreamSpanAttrs'](_0x4ae8d0),_0x3ba382=this['startSpan'](_0x4ae8d0['metadata']['trc'],_0x4ae8d0['metadata']['spn'],_0x386306,_0x2f3f02);return this['span']=_0x3ba382,this;}['startSpan'](_0x23ae74,_0x404e53,_0x1037e6,_0x56c40b){this['traceId']=_0x23ae74,this['spanId']=_0x404e53;const _0x53bc12=telemetry_1['trace']['getTracer'](package_json_1['default']['name'],package_json_1['default']['version']),_0x253578=this['getParentSpanContext'](),_0x826fe=_0x53bc12['startSpan'](_0x1037e6,{'kind':telemetry_1['SpanKind']['CLIENT'],'attributes':_0x56c40b,'root':!_0x253578},_0x253578);return _0x826fe;}['mapActivityAttributes'](){if(this['config']['telemetry']){const _0x5f33e0=new mapper_1['MapperService'](this['config']['telemetry'],this['context'])['mapRules'](),_0xba4b06={...Object['keys'](_0x5f33e0)['reduce']((_0x5079b5,_0x119d08)=>{return['string','boolean','number']['includes'](typeof _0x5f33e0[_0x119d08])&&(_0x5079b5['app.activity.data.'+_0x119d08]=_0x5f33e0[_0x119d08]),_0x5079b5;},{})};this['span']?.['setAttributes'](_0xba4b06);}}['setActivityAttributes'](_0x4f1190){this['span']?.['setAttributes'](_0x4f1190);}['setStreamAttributes'](_0x343801){this['span']?.['setAttributes'](_0x343801);}['setJobAttributes'](_0x4e278e){this['jobSpan']?.['setAttributes'](_0x4e278e);}['endJobSpan'](){this['endSpan'](this['jobSpan']);}['endActivitySpan'](){this['endSpan'](this['span']);}['endStreamSpan'](){this['endSpan'](this['span']);}['endSpan'](_0x5f4eab){_0x5f4eab&&_0x5f4eab['end']();}['getParentSpanContext'](){if(this['traceId']&&this['spanId']){const _0x4232dc={'traceId':this['traceId'],'spanId':this['spanId'],'isRemote':!![],'traceFlags':0x1},_0x514117=telemetry_1['trace']['setSpanContext'](telemetry_1['context']['active'](),_0x4232dc);return _0x514117;}}['getSpanAttrs'](_0x51cab6){return{...Object['keys'](this['context']['metadata'])['reduce']((_0x26aa63,_0x5019a2)=>{return _0x5019a2!=='trc'&&(_0x26aa63['app.job.'+_0x5019a2]=this['context']['metadata'][_0x5019a2]),_0x26aa63;},{}),...Object['keys'](this['metadata'])['reduce']((_0x1c3b0f,_0x5e44c7)=>{return _0x1c3b0f['app.activity.'+_0x5e44c7]=this['metadata'][_0x5e44c7],_0x1c3b0f;},{}),'app.activity.leg':_0x51cab6};}['getStreamSpanAttrs'](_0xa820d3){return{...Object['keys'](_0xa820d3['metadata'])['reduce']((_0x1e951b,_0x2780e4)=>{return _0x2780e4!=='trc'&&_0x2780e4!=='spn'&&(_0x1e951b['app.stream.'+_0x2780e4]=_0xa820d3['metadata'][_0x2780e4]),_0x1e951b;},{})};}['setTelemetryContext'](_0x3f9b9f,_0x3c1d69){!this['context']['metadata']['trc']&&(this['context']['metadata']['trc']=_0x3f9b9f['spanContext']()['traceId']),_0x3c1d69===0x1?(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l1s']=_0x3f9b9f['spanContext']()['spanId']):(!this['context']['$self']['output']['metadata']&&(this['context']['$self']['output']['metadata']={}),this['context']['$self']['output']['metadata']['l2s']=_0x3f9b9f['spanContext']()['spanId']);}['setActivityError'](_0x386894){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0x386894});}['setStreamError'](_0x35ec1f){this['span']?.['setStatus']({'code':telemetry_1['SpanStatusCode']['ERROR'],'message':_0x35ec1f});}static['addTargetTelemetryPaths'](_0x19c45f,_0x529d31,_0x23e993,_0x5917b7){_0x5917b7===0x1?(!(_0x529d31['parent']in _0x19c45f)&&(_0x19c45f[_0x529d31['parent']]=[]),_0x19c45f[_0x529d31['parent']]['push'](_0x529d31['parent']+'/output/metadata/l2s')):(!(_0x23e993['aid']in _0x19c45f)&&(_0x19c45f[_0x23e993['aid']]=[]),_0x19c45f[_0x23e993['aid']]['push'](_0x23e993['aid']+'/output/metadata/l1s'));}static['bindJobTelemetryToState'](_0x4cab62,_0x3c89aa,_0xc987bc){_0x3c89aa['type']==='trigger'&&(_0x4cab62['metadata/trc']=_0xc987bc['metadata']['trc']);}static['bindActivityTelemetryToState'](_0x1442d0,_0x365533,_0x5eef81,_0x409952,_0x5ef448){if(_0x365533['type']==='trigger')_0x1442d0[_0x5eef81['aid']+'/output/metadata/l1s']=_0x409952['$self']['output']['metadata']['l1s'],_0x1442d0[_0x5eef81['aid']+'/output/metadata/l2s']=_0x409952['$self']['output']['metadata']['l2s'];else{if(utils_1['polyfill']['resolveActivityType'](_0x365533['type'])==='hook'&&_0x5ef448===0x1)_0x1442d0[_0x5eef81['aid']+'/output/metadata/l1s']=_0x409952['$self']['output']['metadata']['l1s'],_0x1442d0[_0x5eef81['aid']+'/output/metadata/l2s']=_0x409952['$self']['output']['metadata']['l1s'];else{if(_0x365533['type']==='signal'&&_0x5ef448===0x1)_0x1442d0[_0x5eef81['aid']+'/output/metadata/l1s']=_0x409952['$self']['output']['metadata']['l1s'],_0x1442d0[_0x5eef81['aid']+'/output/metadata/l2s']=_0x409952['$self']['output']['metadata']['l1s'];else{const _0x509a83='l'+_0x5ef448+'s';_0x1442d0[_0x5eef81['aid']+'/output/metadata/'+_0x509a83]=_0x409952['$self']['output']['metadata'][_0x509a83];}}}}}exports['TelemetryService']=TelemetryService;function _0x4266(){const _0x56050e=['8JVqhTk','930483TdXWIB','44148xsOLYh','1260140kaqpgC','125209kdmXYE','4741ItvGRk','182jCNGTn','2631696iYjFRy','13119NJrWOL','16690ynMbdU','147QNynoX'];_0x4266=function(){return _0x56050e;};return _0x4266();}
@@ -1 +1 @@
1
- 'use strict';(function(_0x28b1e6,_0x2c02d1){const _0x3dbe41=_0x2acd,_0x214d91=_0x28b1e6();while(!![]){try{const _0x42a5ea=-parseInt(_0x3dbe41(0x174))/0x1*(parseInt(_0x3dbe41(0x173))/0x2)+parseInt(_0x3dbe41(0x17a))/0x3*(-parseInt(_0x3dbe41(0x176))/0x4)+parseInt(_0x3dbe41(0x172))/0x5+-parseInt(_0x3dbe41(0x178))/0x6+parseInt(_0x3dbe41(0x175))/0x7+parseInt(_0x3dbe41(0x177))/0x8*(-parseInt(_0x3dbe41(0x179))/0x9)+parseInt(_0x3dbe41(0x17b))/0xa;if(_0x42a5ea===_0x2c02d1)break;else _0x214d91['push'](_0x214d91['shift']());}catch(_0x5133a8){_0x214d91['push'](_0x214d91['shift']());}}}(_0x2068,0x727c3));function _0x2acd(_0x3ee7b4,_0x3652f){const _0x20683d=_0x2068();return _0x2acd=function(_0x2acdcb,_0x2c9930){_0x2acdcb=_0x2acdcb-0x172;let _0x4eac86=_0x20683d[_0x2acdcb];return _0x4eac86;},_0x2acd(_0x3ee7b4,_0x3652f);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['WorkerService']=void 0x0;const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),factory_1=require('../connector/factory'),router_1=require('../router'),stream_1=require('../../types/stream'),enums_1=require('../../modules/enums'),factory_2=require('../stream/factory'),factory_3=require('../sub/factory'),factory_4=require('../store/factory');function _0x2068(){const _0x3d635e=['2045586tOWYeY','18412400pdtKiu','83425fmDAed','220ntYnIi','5918sjCfMs','5003411OjMZqJ','4BqrbsD','3036568WYGWPi','2348124ySKjtu','9GpGsKL'];_0x2068=function(){return _0x3d635e;};return _0x2068();}class WorkerService{constructor(){this['reporting']=![];}static async['init'](_0x5278e9,_0x14b7bb,_0x3fb3ab,_0x3c4e4f,_0x5e1efb){const _0x397da8=[];if(Array['isArray'](_0x3c4e4f['workers']))for(const _0x4c88a4 of _0x3c4e4f['workers']){await factory_1['ConnectorService']['initClients'](_0x4c88a4);const _0x4966e3=new WorkerService();_0x4966e3['verifyWorkerFields'](_0x4c88a4),_0x4966e3['namespace']=_0x5278e9,_0x4966e3['appId']=_0x14b7bb,_0x4966e3['guid']=_0x3fb3ab,_0x4966e3['callback']=_0x4c88a4['callback'],_0x4966e3['topic']=_0x4c88a4['topic'],_0x4966e3['config']=_0x3c4e4f,_0x4966e3['logger']=_0x5e1efb,await _0x4966e3['initStoreChannel'](_0x4966e3,_0x4c88a4['store']),await _0x4966e3['initSubChannel'](_0x4966e3,_0x4c88a4['sub'],_0x4c88a4['pub']),await _0x4966e3['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x4966e3['subscriptionHandler'](),_0x14b7bb),await _0x4966e3['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x4966e3['subscriptionHandler'](),_0x14b7bb,_0x4966e3['topic']),await _0x4966e3['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x4966e3['subscriptionHandler'](),_0x14b7bb,_0x4966e3['guid']),await _0x4966e3['initStreamChannel'](_0x4966e3,_0x4c88a4['stream'],_0x4c88a4['store']),_0x4966e3['router']=await _0x4966e3['initRouter'](_0x4c88a4,_0x5e1efb);const _0x5bcc7e=_0x4966e3['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x4966e3['appId'],'topic':_0x4c88a4['topic']});await _0x4966e3['router']['consumeMessages'](_0x5bcc7e,'WORKER',_0x4966e3['guid'],_0x4c88a4['callback']),_0x4966e3['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x397da8['push'](_0x4966e3);}return _0x397da8;}['verifyWorkerFields'](_0x2ea73c){if(!(0x0,utils_1['identifyProvider'])(_0x2ea73c['store'])||!(0x0,utils_1['identifyProvider'])(_0x2ea73c['stream'])||!(0x0,utils_1['identifyProvider'])(_0x2ea73c['sub'])||!(_0x2ea73c['topic']&&_0x2ea73c['callback']))throw new Error('worker\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields\x20along\x20with\x20a\x20callback\x20function\x20and\x20topic.');}async['initStoreChannel'](_0x50810a,_0x23809b){_0x50810a['store']=await factory_4['StoreServiceFactory']['init'](_0x23809b,_0x50810a['namespace'],_0x50810a['appId'],_0x50810a['logger']);}async['initSubChannel'](_0xa5930,_0x3b768f,_0x591fac){_0xa5930['subscribe']=await factory_3['SubServiceFactory']['init'](_0x3b768f,_0x591fac,_0xa5930['namespace'],_0xa5930['appId'],_0xa5930['guid'],_0xa5930['logger']);}async['initStreamChannel'](_0x1d4661,_0x334441,_0x1c421b){_0x1d4661['stream']=await factory_2['StreamServiceFactory']['init'](_0x334441,_0x1c421b,_0x1d4661['namespace'],_0x1d4661['appId'],_0x1d4661['logger']);}async['initRouter'](_0x40f822,_0x5ebb61){const _0x3499dd=await this['store']['getThrottleRate'](_0x40f822['topic']);return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['WORKER'],'topic':_0x40f822['topic'],'reclaimDelay':_0x40f822['reclaimDelay'],'reclaimCount':_0x40f822['reclaimCount'],'throttle':_0x3499dd},this['stream'],_0x5ebb61);}['subscriptionHandler'](){const _0x3dc13c=this;return async(_0x25e4ee,_0x4d8b21)=>{_0x3dc13c['logger']['debug']('worker-event-received',{'topic':_0x25e4ee,'type':_0x4d8b21['type']});if(_0x4d8b21['type']==='throttle')_0x4d8b21['topic']!==null&&_0x3dc13c['throttle'](_0x4d8b21['throttle']);else{if(_0x4d8b21['type']==='ping')_0x3dc13c['sayPong'](_0x3dc13c['appId'],_0x3dc13c['guid'],_0x4d8b21['originator'],_0x4d8b21['details']);else _0x4d8b21['type']==='rollcall'&&(_0x4d8b21['topic']!==null&&_0x3dc13c['doRollCall'](_0x4d8b21));}};}async['doRollCall'](_0x4ddb30){let _0xbe1421=0x0;const _0x22a966=!isNaN(_0x4ddb30['max'])?_0x4ddb30['max']:enums_1['HMSH_QUORUM_ROLLCALL_CYCLES'];if(this['rollCallInterval'])clearTimeout(this['rollCallInterval']);const _0x5e7b85=_0x4ddb30['interval']/0x2,_0x538bfe=_0x5e7b85+Math['ceil'](Math['random']()*_0x5e7b85);do{await(0x0,utils_1['sleepFor'])(Math['ceil'](Math['random']()*0x3e8)),await this['sayPong'](this['appId'],this['guid'],null,!![],_0x4ddb30['signature']);if(!_0x4ddb30['interval'])return;const {promise:_0x576adb,timerId:_0x5ca756}=(0x0,utils_1['XSleepFor'])(_0x538bfe*0x3e8);this['rollCallInterval']=_0x5ca756,await _0x576adb;}while(this['rollCallInterval']&&_0xbe1421++<_0x22a966-0x1);}['cancelRollCall'](){this['rollCallInterval']&&(clearTimeout(this['rollCallInterval']),delete this['rollCallInterval']);}['stop'](){this['cancelRollCall']();}async['sayPong'](_0x5349e3,_0x56b17b,_0x328af4,_0x306753=![],_0x35aa37=![]){let _0xe541b5;if(_0x306753){const _0x292104={'appId':this['appId'],'topic':this['topic']};_0xe541b5={'engine_id':this['guid'],'namespace':this['namespace'],'app_id':this['appId'],'worker_topic':this['topic'],'stream':this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x292104),'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':_0x35aa37?this['callback']['toString']():undefined};}this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'pong','guid':_0x56b17b,'originator':_0x328af4,'profile':_0xe541b5},_0x5349e3);}async['throttle'](_0x405219){this['router']?.['setThrottle'](_0x405219);}}exports['WorkerService']=WorkerService;
1
+ 'use strict';function _0x5a14(){const _0x336a98=['1103430TpgsEJ','12752946GALWrN','4CHZdSx','600320auUQje','4228128kjqTqg','4360370houwGz','2724996LGsONi','4OalZmc','5816562vgoUHg'];_0x5a14=function(){return _0x336a98;};return _0x5a14();}function _0x8c25(_0x30c82e,_0xfb0ace){const _0x5a147b=_0x5a14();return _0x8c25=function(_0x8c2578,_0x2d79bb){_0x8c2578=_0x8c2578-0x1ba;let _0x4dc3bf=_0x5a147b[_0x8c2578];return _0x4dc3bf;},_0x8c25(_0x30c82e,_0xfb0ace);}(function(_0x39af62,_0x1167e8){const _0xee6693=_0x8c25,_0x34d955=_0x39af62();while(!![]){try{const _0x4052a0=parseInt(_0xee6693(0x1be))/0x1*(parseInt(_0xee6693(0x1ba))/0x2)+-parseInt(_0xee6693(0x1bd))/0x3+-parseInt(_0xee6693(0x1c2))/0x4*(parseInt(_0xee6693(0x1c0))/0x5)+-parseInt(_0xee6693(0x1bf))/0x6+parseInt(_0xee6693(0x1bc))/0x7+-parseInt(_0xee6693(0x1bb))/0x8+parseInt(_0xee6693(0x1c1))/0x9;if(_0x4052a0===_0x1167e8)break;else _0x34d955['push'](_0x34d955['shift']());}catch(_0x2e51b2){_0x34d955['push'](_0x34d955['shift']());}}}(_0x5a14,0x95ccf));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'](_0xa5be15,_0xfda74f,_0x4663b5,_0x146d38,_0x2c7971){const _0x138a32=[];if(Array['isArray'](_0x146d38['workers']))for(const _0x44660c of _0x146d38['workers']){await factory_1['ConnectorService']['initClients'](_0x44660c);const _0x20a6c5=new WorkerService();_0x20a6c5['verifyWorkerFields'](_0x44660c),_0x20a6c5['namespace']=_0xa5be15,_0x20a6c5['appId']=_0xfda74f,_0x20a6c5['guid']=_0x4663b5,_0x20a6c5['callback']=_0x44660c['callback'],_0x20a6c5['topic']=_0x44660c['topic'],_0x20a6c5['config']=_0x146d38,_0x20a6c5['logger']=_0x2c7971,await _0x20a6c5['initStoreChannel'](_0x20a6c5,_0x44660c['store']),await _0x20a6c5['initSubChannel'](_0x20a6c5,_0x44660c['sub'],_0x44660c['pub']),await _0x20a6c5['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x20a6c5['subscriptionHandler'](),_0xfda74f),await _0x20a6c5['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x20a6c5['subscriptionHandler'](),_0xfda74f,_0x20a6c5['topic']),await _0x20a6c5['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x20a6c5['subscriptionHandler'](),_0xfda74f,_0x20a6c5['guid']),await _0x20a6c5['initStreamChannel'](_0x20a6c5,_0x44660c['stream'],_0x44660c['store']),_0x20a6c5['router']=await _0x20a6c5['initRouter'](_0x44660c,_0x2c7971);const _0x44c1bc=_0x20a6c5['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x20a6c5['appId'],'topic':_0x44660c['topic']});await _0x20a6c5['router']['consumeMessages'](_0x44c1bc,'WORKER',_0x20a6c5['guid'],_0x44660c['callback']),_0x20a6c5['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x138a32['push'](_0x20a6c5);}return _0x138a32;}['verifyWorkerFields'](_0xad6639){if(!(0x0,utils_1['identifyProvider'])(_0xad6639['store'])||!(0x0,utils_1['identifyProvider'])(_0xad6639['stream'])||!(0x0,utils_1['identifyProvider'])(_0xad6639['sub'])||!(_0xad6639['topic']&&_0xad6639['callback']))throw new Error('worker\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields\x20along\x20with\x20a\x20callback\x20function\x20and\x20topic.');}async['initStoreChannel'](_0x511361,_0x48be44){_0x511361['store']=await factory_4['StoreServiceFactory']['init'](_0x48be44,_0x511361['namespace'],_0x511361['appId'],_0x511361['logger']);}async['initSubChannel'](_0x21b83d,_0x5585a3,_0x26c294){_0x21b83d['subscribe']=await factory_3['SubServiceFactory']['init'](_0x5585a3,_0x26c294,_0x21b83d['namespace'],_0x21b83d['appId'],_0x21b83d['guid'],_0x21b83d['logger']);}async['initStreamChannel'](_0x32f1b8,_0x2b14d3,_0x4b66ca){_0x32f1b8['stream']=await factory_2['StreamServiceFactory']['init'](_0x2b14d3,_0x4b66ca,_0x32f1b8['namespace'],_0x32f1b8['appId'],_0x32f1b8['logger']);}async['initRouter'](_0x1ce5d1,_0x1f5954){const _0x1ca37e=await this['store']['getThrottleRate'](_0x1ce5d1['topic']);return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['WORKER'],'topic':_0x1ce5d1['topic'],'reclaimDelay':_0x1ce5d1['reclaimDelay'],'reclaimCount':_0x1ce5d1['reclaimCount'],'throttle':_0x1ca37e},this['stream'],_0x1f5954);}['subscriptionHandler'](){const _0x26a05a=this;return async(_0x56c89b,_0x47117c)=>{_0x26a05a['logger']['debug']('worker-event-received',{'topic':_0x56c89b,'type':_0x47117c['type']});if(_0x47117c['type']==='throttle')_0x47117c['topic']!==null&&_0x26a05a['throttle'](_0x47117c['throttle']);else{if(_0x47117c['type']==='ping')_0x26a05a['sayPong'](_0x26a05a['appId'],_0x26a05a['guid'],_0x47117c['originator'],_0x47117c['details']);else _0x47117c['type']==='rollcall'&&(_0x47117c['topic']!==null&&_0x26a05a['doRollCall'](_0x47117c));}};}async['doRollCall'](_0x58806e){let _0x5d4e24=0x0;const _0x47f947=!isNaN(_0x58806e['max'])?_0x58806e['max']:enums_1['HMSH_QUORUM_ROLLCALL_CYCLES'];if(this['rollCallInterval'])clearTimeout(this['rollCallInterval']);const _0x3f57de=_0x58806e['interval']/0x2,_0x38a536=_0x3f57de+Math['ceil'](Math['random']()*_0x3f57de);do{await(0x0,utils_1['sleepFor'])(Math['ceil'](Math['random']()*0x3e8)),await this['sayPong'](this['appId'],this['guid'],null,!![],_0x58806e['signature']);if(!_0x58806e['interval'])return;const {promise:_0x2dcaa9,timerId:_0x56212e}=(0x0,utils_1['XSleepFor'])(_0x38a536*0x3e8);this['rollCallInterval']=_0x56212e,await _0x2dcaa9;}while(this['rollCallInterval']&&_0x5d4e24++<_0x47f947-0x1);}['cancelRollCall'](){this['rollCallInterval']&&(clearTimeout(this['rollCallInterval']),delete this['rollCallInterval']);}['stop'](){this['cancelRollCall']();}async['sayPong'](_0x3ce58d,_0x4f1ee1,_0x52cbaf,_0xacebe1=![],_0x264186=![]){let _0x49afec;if(_0xacebe1){const _0x2646e3={'appId':this['appId'],'topic':this['topic']};_0x49afec={'engine_id':this['guid'],'namespace':this['namespace'],'app_id':this['appId'],'worker_topic':this['topic'],'stream':this['store']['mintKey'](key_1['KeyType']['STREAMS'],_0x2646e3),'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':_0x264186?this['callback']['toString']():undefined};}this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'pong','guid':_0x4f1ee1,'originator':_0x52cbaf,'profile':_0x49afec},_0x3ce58d);}async['throttle'](_0x4199ad){this['router']?.['setThrottle'](_0x4199ad);}}exports['WorkerService']=WorkerService;
package/package.json CHANGED
@@ -1,13 +1,9 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.3.16",
4
- "description": "Unbreakable Workflows",
3
+ "version": "0.3.18",
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"
@@ -78,6 +74,7 @@
78
74
  },
79
75
  "keywords": [
80
76
  "Serverless Orchestration",
77
+ "Serverless Workflow",
81
78
  "Durable Workflow",
82
79
  "Operational Data",
83
80
  "Service Mesh",