@hotmeshio/hotmesh 0.3.18 → 0.3.20
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 +194 -68
- package/build/index.d.ts +5 -1
- package/build/index.js +9 -1
- package/build/modules/key.js +1 -1
- package/build/modules/utils.d.ts +0 -1
- package/build/modules/utils.js +1 -1
- package/build/package.json +10 -7
- 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/connector/factory.d.ts +1 -0
- package/build/services/connector/factory.js +22 -21
- package/build/services/connector/index.d.ts +4 -2
- package/build/services/connector/index.js +10 -5
- package/build/services/connector/providers/postgres.d.ts +13 -2
- package/build/services/connector/providers/postgres.js +54 -9
- 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/hotmesh/index.js +1 -6
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshflow/connection.js +1 -0
- 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 +3 -2
- 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 +3 -3
- package/build/services/sub/factory.js +14 -5
- package/build/services/sub/index.d.ts +3 -2
- package/build/services/sub/providers/nats/nats.d.ts +19 -0
- package/build/services/sub/providers/nats/nats.js +1 -0
- package/build/services/sub/providers/postgres/postgres.d.ts +19 -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/nats.d.ts +8 -0
- package/build/types/postgres.d.ts +10 -1
- package/build/types/provider.d.ts +1 -0
- package/build/types/redis.d.ts +8 -8
- package/index.ts +20 -5
- package/package.json +10 -7
- package/types/nats.ts +34 -0
- package/types/postgres.ts +13 -2
- package/types/provider.ts +4 -0
- package/types/redis.ts +8 -8
package/build/modules/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x16a751,_0x2a3159){const _0x5155e1=_0x5584,_0x516818=_0x16a751();while(!![]){try{const _0x415dbc=-parseInt(_0x5155e1(0x15d))/0x1*(parseInt(_0x5155e1(0x15f))/0x2)+parseInt(_0x5155e1(0x164))/0x3+-parseInt(_0x5155e1(0x160))/0x4+parseInt(_0x5155e1(0x163))/0x5*(parseInt(_0x5155e1(0x15c))/0x6)+parseInt(_0x5155e1(0x162))/0x7+-parseInt(_0x5155e1(0x15e))/0x8+parseInt(_0x5155e1(0x161))/0x9;if(_0x415dbc===_0x2a3159)break;else _0x516818['push'](_0x516818['shift']());}catch(_0x22aba9){_0x516818['push'](_0x516818['shift']());}}}(_0xd3fe,0x6d447));var __importDefault=this&&this['__importDefault']||function(_0x171ed6){return _0x171ed6&&_0x171ed6['__esModule']?_0x171ed6:{'default':_0x171ed6};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['isStreamMessage']=exports['parseStreamMessage']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['identifyRedisTypeFromClass']=exports['polyfill']=exports['identifyProvider']=exports['XSleepFor']=exports['sleepImmediate']=exports['sleepFor']=exports['guid']=exports['deterministicRandom']=exports['deepCopy']=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),logger_1=require('../services/logger'),enums_1=require('./enums'),logger=new logger_1['LoggerService']('hotmesh','utils'),hashOptions=_0x24105d=>{const _0x58a096=JSON['stringify'](_0x24105d);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x58a096)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x56105d=os_1['default']['totalmem'](),_0x3b4f91=os_1['default']['freemem'](),_0x599035=_0x56105d-_0x3b4f91,_0x2dc39e={'TotalMemoryGB':(_0x56105d/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x3b4f91/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x599035/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x2dc39e;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0xf3c9e4){return JSON['parse'](JSON['stringify'](_0xf3c9e4));}function _0x5584(_0x6c3732,_0x1cb7c7){const _0xd3fe24=_0xd3fe();return _0x5584=function(_0x558475,_0x2c0d6f){_0x558475=_0x558475-0x15c;let _0x17a202=_0xd3fe24[_0x558475];return _0x17a202;},_0x5584(_0x6c3732,_0x1cb7c7);}exports['deepCopy']=deepCopy;function deterministicRandom(_0x238dbb){const _0x4699a0=Math['sin'](_0x238dbb)*0x2710;return _0x4699a0-Math['floor'](_0x4699a0);}exports['deterministicRandom']=deterministicRandom;function guid(_0x2ebdca=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x2ebdca);}exports['guid']=guid;async function sleepFor(_0x49ba7c){return new Promise(_0x4b0040=>setTimeout(_0x4b0040,_0x49ba7c));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x2d9037=>setImmediate(_0x2d9037));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0xeff5cd){let _0x226f17;const _0x2bfc13=new Promise(_0x5c8cb5=>{_0x226f17=setTimeout(_0x5c8cb5,_0xeff5cd);});return{'promise':_0x2bfc13,'timerId':_0x226f17};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x5c2f11){const _0x2676f2=Object['getPrototypeOf'](_0x5c2f11);if(_0x5c2f11['Query']?.['prototype']||Object['keys'](_0x5c2f11)['includes']('database'))return'postgres';else{if(_0x5c2f11['constructor']&&_0x5c2f11['constructor']['name']==='Client')return'nats';else{if('defineCommand'in _0x2676f2||Object['keys'](_0x2676f2)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x2676f2)['includes']('Multi'))return'redis';}}}if(_0x5c2f11['constructor']){if(_0x5c2f11['constructor']['name']==='Redis'||_0x5c2f11['constructor']['name']==='EventEmitter'){if('hset'in _0x5c2f11)return'ioredis';}else{if(_0x5c2f11['constructor']['name']==='ProviderClient'||_0x5c2f11['constructor']['name']==='Commander'){if('HSET'in _0x5c2f11)return'redis';}}}let _0x3841af=null;if(Object['keys'](_0x5c2f11)['includes']('connection'))_0x3841af='postgres';else{if(Object['keys'](_0x5c2f11)['includes']('Pipeline'))_0x3841af='ioredis';else{if(Object['keys'](_0x5c2f11)['includes']('createClient'))_0x3841af='redis';else Object['keys'](_0x5c2f11)['includes']('jetstream')&&(_0x3841af='nats');}}return _0x3841af;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x5672ef){return _0x5672ef==='activity'?'hook':_0x5672ef;},'providerConfig'(_0x4d0049){return _0x4d0049?.['connection']??_0x4d0049?.['redis']??_0x4d0049?.['connections'];},'meshDataConfig'(_0x298b4a){if(_0x298b4a?.['connections'])return _0x298b4a['connections'];return _0x298b4a?.['connection']??{'class':_0x298b4a?.['redisClass'],'options':_0x298b4a?.['redisOptions']};}};function identifyRedisTypeFromClass(_0xc11cc1){if(_0xc11cc1&&_0xc11cc1['name']==='Redis'||_0xc11cc1['name']==='EventEmitter')return'ioredis';else{if(_0xc11cc1&&'createClient'in _0xc11cc1)return'redis';}return null;}exports['identifyRedisTypeFromClass']=identifyRedisTypeFromClass;function matchesStatusCode(_0x3e23f0,_0xeb21b0){if(typeof _0xeb21b0==='string'){const _0x1ee860='^'+_0xeb21b0['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x1ee860)['test'](_0x3e23f0['toString']());}return _0xeb21b0['test'](_0x3e23f0['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x56b11f,_0x55935b){return _0x56b11f===_0x55935b;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x3de7a3,_0x52ff6f){for(const [_0x336564,_0x138abe]of Object['entries'](_0x3de7a3)){if(_0x138abe['hasOwnProperty'](_0x52ff6f)){const _0x6b3c17=findTopKey(_0x3de7a3,_0x336564['replace'](/^\./,''));return(_0x6b3c17||_0x336564)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x52884d,_0x2a41d3){for(const [_0x13da14,_0x70c63f]of Object['entries'](_0x52884d)){if(_0x70c63f===_0x2a41d3)return _0x13da14;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x1b4e7f,_0x3bd00c,_0x359189){const _0x2de5b0=await _0x3bd00c['getTransitions'](_0x359189),_0x2fd7d3=await _0x3bd00c['getSubscriptions'](_0x359189),_0x296bbc=findTopKey(_0x2de5b0,_0x1b4e7f),_0x54954a=findSubscriptionForTrigger(_0x2fd7d3,_0x296bbc);return _0x54954a;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x1ec5e7){if(_0x1ec5e7['toString']()==='infinity')return'0';const _0xb79395=new Date(),_0x4d40bc=_0x1ec5e7['slice'](-0x1),_0x2dcf72=parseInt(_0x1ec5e7['slice'](0x0,-0x1),0xa);if(_0x4d40bc==='m'){const _0x316ddd=Math['floor'](_0xb79395['getMinutes']()/_0x2dcf72)*_0x2dcf72;_0xb79395['setUTCMinutes'](_0x316ddd,0x0,0x0);}else _0x4d40bc==='h'&&_0xb79395['setUTCMinutes'](0x0,0x0,0x0);return _0xb79395['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}function _0xd3fe(){const _0x1badf6=['401989NfHLCQ','5ZPnRhl','1419861nBcBWH','43158wojIFj','5541fvvSqY','3371336gHxfLm','198oPeQGK','1206428abxWDo','10631115DQUiFI'];_0xd3fe=function(){return _0x1badf6;};return _0xd3fe();}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x50f7ea){const _0x58e10d=_0x50f7ea instanceof Date?_0x50f7ea:new Date(_0x50f7ea);return _0x58e10d['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x57f555){const _0x51ca56='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x424a49=_0x51ca56['length'];if(_0x57f555<0x0||_0x57f555>=Math['pow'](_0x424a49,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x47ab7e,_0x49411c]=divmod(_0x57f555,_0x424a49),[_0x9e4a85,_0x1f0876]=divmod(_0x47ab7e,_0x424a49);return _0x51ca56[_0x9e4a85]+_0x51ca56[_0x49411c]+_0x51ca56[_0x1f0876];}exports['getSymKey']=getSymKey;function getSymVal(_0x5c389e){const _0xc1d45f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x59e80f=_0xc1d45f['length'];if(_0x5c389e<0x0||_0x5c389e>=Math['pow'](_0x59e80f,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x360aa0,_0x4ff49a]=divmod(_0x5c389e,_0x59e80f);return _0xc1d45f[_0x360aa0]+_0xc1d45f[_0x4ff49a];}exports['getSymVal']=getSymVal;function divmod(_0x5628c8,_0x5001d6){return[Math['floor'](_0x5628c8/_0x5001d6),_0x5628c8%_0x5001d6];}function getIndexedHash(_0x5a7a83,_0x5249bc){const _0x255cae=_0x5a7a83[_0x5249bc]||0x0,_0x50a278={..._0x5a7a83};return delete _0x50a278[_0x5249bc],[_0x255cae,_0x50a278];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x49b02c,_0x1b3f84){const _0x3d3200=_0x1b3f84['split']('/');let _0x2989f2=_0x49b02c;for(const _0x297c10 of _0x3d3200){if(_0x2989f2[_0x297c10]!==undefined)_0x2989f2=_0x2989f2[_0x297c10];else return undefined;}return _0x2989f2;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x58756d){const _0x2b1860={};for(const _0x53211e in _0x58756d){if(_0x58756d[_0x53211e]===undefined)continue;const _0x4c5124=_0x53211e['split']('/');let _0xf28b95=_0x2b1860;for(let _0x1c896b=0x0;_0x1c896b<_0x4c5124['length'];_0x1c896b++){_0x1c896b===_0x4c5124['length']-0x1?_0xf28b95[_0x4c5124[_0x1c896b]]=_0x58756d[_0x53211e]:(_0xf28b95[_0x4c5124[_0x1c896b]]=_0xf28b95[_0x4c5124[_0x1c896b]]||{},_0xf28b95=_0xf28b95[_0x4c5124[_0x1c896b]]);}}return _0x2b1860;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x368cad){const _0x23898f=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x23898f['test'](_0x368cad);}exports['isValidCron']=isValidCron;const s=_0x2c5346=>{return(0x0,ms_1['default'])(_0x2c5346)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x557cec=>{try{return JSON['parse'](_0x557cec);}catch(_0x3074f8){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x3074f8});throw _0x3074f8;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0x1f21dd=>{return Array['isArray'](_0x1f21dd)&&Array['isArray'](_0x1f21dd[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x1d67f5=>{const _0x39c14c=[];let _0x2d1a32;for(let _0x14b9ba=0x1;_0x14b9ba<_0x1d67f5['length'];_0x14b9ba++){const _0x11f31b=_0x1d67f5[_0x14b9ba],_0x3861b8={};if(Array['isArray'](_0x11f31b)){for(let _0x20c8c1=0x0;_0x20c8c1<_0x11f31b['length'];_0x20c8c1+=0x2){const _0xbb9c2e=_0x11f31b[_0x20c8c1],_0x5c33b0=_0x11f31b[_0x20c8c1+0x1];_0x3861b8[_0xbb9c2e]=_0x5c33b0;}_0x2d1a32&&(_0x3861b8['$']=_0x2d1a32),_0x39c14c['push'](_0x3861b8),_0x2d1a32=undefined;}else _0x2d1a32=_0x11f31b;}return _0x39c14c;};exports['arrayToHash']=arrayToHash;
|
|
1
|
+
'use strict';(function(_0x140685,_0x10ddda){const _0x59b95=_0x486b,_0x51a428=_0x140685();while(!![]){try{const _0x4201b2=parseInt(_0x59b95(0x92))/0x1+-parseInt(_0x59b95(0x91))/0x2+-parseInt(_0x59b95(0x8d))/0x3*(-parseInt(_0x59b95(0x93))/0x4)+parseInt(_0x59b95(0x8b))/0x5*(parseInt(_0x59b95(0x94))/0x6)+parseInt(_0x59b95(0x8e))/0x7+parseInt(_0x59b95(0x8f))/0x8*(parseInt(_0x59b95(0x90))/0x9)+-parseInt(_0x59b95(0x8c))/0xa;if(_0x4201b2===_0x10ddda)break;else _0x51a428['push'](_0x51a428['shift']());}catch(_0x321da6){_0x51a428['push'](_0x51a428['shift']());}}}(_0x2a84,0x49fa4));var __importDefault=this&&this['__importDefault']||function(_0x8a8b2e){return _0x8a8b2e&&_0x8a8b2e['__esModule']?_0x8a8b2e:{'default':_0x8a8b2e};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['isStreamMessage']=exports['parseStreamMessage']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['polyfill']=exports['identifyProvider']=exports['XSleepFor']=exports['sleepImmediate']=exports['sleepFor']=exports['guid']=exports['deterministicRandom']=exports['deepCopy']=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),logger_1=require('../services/logger'),enums_1=require('./enums'),logger=new logger_1['LoggerService']('hotmesh','utils'),hashOptions=_0x4f4961=>{const _0x22773b=JSON['stringify'](_0x4f4961);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x22773b)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x4b5632=os_1['default']['totalmem'](),_0x12f520=os_1['default']['freemem'](),_0x297612=_0x4b5632-_0x12f520,_0xb7897b={'TotalMemoryGB':(_0x4b5632/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x12f520/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x297612/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0xb7897b;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x3a6e9a){return JSON['parse'](JSON['stringify'](_0x3a6e9a));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x173bdc){const _0xd7b96b=Math['sin'](_0x173bdc)*0x2710;return _0xd7b96b-Math['floor'](_0xd7b96b);}exports['deterministicRandom']=deterministicRandom;function guid(_0x38e5a2=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x38e5a2);}exports['guid']=guid;async function sleepFor(_0x2c75eb){return new Promise(_0x4e4668=>setTimeout(_0x4e4668,_0x2c75eb));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x9b9f11=>setImmediate(_0x9b9f11));}exports['sleepImmediate']=sleepImmediate;function _0x486b(_0x23a3ec,_0x1dcec0){const _0x2a84f0=_0x2a84();return _0x486b=function(_0x486b25,_0x31abff){_0x486b25=_0x486b25-0x8b;let _0x32b5aa=_0x2a84f0[_0x486b25];return _0x32b5aa;},_0x486b(_0x23a3ec,_0x1dcec0);}function XSleepFor(_0x10aca9){let _0x2e66df;const _0x118d6f=new Promise(_0x21c5ba=>{_0x2e66df=setTimeout(_0x21c5ba,_0x10aca9);});return{'promise':_0x118d6f,'timerId':_0x2e66df};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x4897b8){const _0x46ee32=Object['getPrototypeOf'](_0x4897b8);if(_0x4897b8['Query']?.['prototype']||Object['keys'](_0x4897b8)['includes']('database')||_0x46ee32['name']==='Pool')return'postgres';else{if(_0x4897b8['toString']()['toLowerCase']()['includes']('nats'))return'nats';else{if('defineCommand'in _0x46ee32||Object['keys'](_0x46ee32)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x46ee32)['includes']('Multi'))return'redis';}}}if(_0x4897b8['constructor']){if(_0x4897b8['constructor']['name']==='Redis'||_0x4897b8['constructor']['name']==='EventEmitter'){if('hset'in _0x4897b8)return'ioredis';}else{if(_0x4897b8['constructor']['name']==='ProviderClient'||_0x4897b8['constructor']['name']==='Commander'){if('HSET'in _0x4897b8)return'redis';}}}let _0x1482e3=null;if(Object['keys'](_0x4897b8)['includes']('connection')||!isNaN(_0x4897b8['totalCount'])&&!isNaN(_0x4897b8['idleCount']))_0x1482e3='postgres';else{if(Object['keys'](_0x4897b8)['includes']('Pipeline'))_0x1482e3='ioredis';else{if(Object['keys'](_0x4897b8)['includes']('createClient'))_0x1482e3='redis';else _0x46ee32['constructor']['toString']()['includes']('NatsConnectionImpl')&&(_0x1482e3='nats');}}return _0x1482e3;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x387e1b){return _0x387e1b==='activity'?'hook':_0x387e1b;},'providerConfig'(_0x19f955){return _0x19f955?.['connection']??_0x19f955?.['redis']??_0x19f955?.['connections'];},'meshDataConfig'(_0x444d92){if(_0x444d92?.['connections'])return _0x444d92['connections'];return _0x444d92?.['connection']??{'class':_0x444d92?.['redisClass'],'options':_0x444d92?.['redisOptions']};}};function matchesStatusCode(_0xff4784,_0x479819){if(typeof _0x479819==='string'){const _0x49a7a2='^'+_0x479819['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x49a7a2)['test'](_0xff4784['toString']());}return _0x479819['test'](_0xff4784['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x4717ac,_0x74018a){return _0x4717ac===_0x74018a;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x512301,_0x2a0921){for(const [_0x17fe13,_0x2177ae]of Object['entries'](_0x512301)){if(_0x2177ae['hasOwnProperty'](_0x2a0921)){const _0x2ba351=findTopKey(_0x512301,_0x17fe13['replace'](/^\./,''));return(_0x2ba351||_0x17fe13)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function _0x2a84(){const _0x1ec9dd=['113644lMGzaZ','167256wsYtaz','80jZSFkJ','7102790Vqyrps','21dcfeRn','791259CPFzsK','376bRJgxk','77157fbyKJK','1023290LeozwZ','364075Workjl'];_0x2a84=function(){return _0x1ec9dd;};return _0x2a84();}function findSubscriptionForTrigger(_0x58652b,_0xa0c512){for(const [_0x56c7b1,_0x965c6]of Object['entries'](_0x58652b)){if(_0x965c6===_0xa0c512)return _0x56c7b1;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x29846f,_0x279dfb,_0x4b6a21){const _0x2754bf=await _0x279dfb['getTransitions'](_0x4b6a21),_0x372467=await _0x279dfb['getSubscriptions'](_0x4b6a21),_0x38dea4=findTopKey(_0x2754bf,_0x29846f),_0x12cab3=findSubscriptionForTrigger(_0x372467,_0x38dea4);return _0x12cab3;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x4a41d8){if(_0x4a41d8['toString']()==='infinity')return'0';const _0x134ef1=new Date(),_0x380670=_0x4a41d8['slice'](-0x1),_0x354556=parseInt(_0x4a41d8['slice'](0x0,-0x1),0xa);if(_0x380670==='m'){const _0x72d8=Math['floor'](_0x134ef1['getMinutes']()/_0x354556)*_0x354556;_0x134ef1['setUTCMinutes'](_0x72d8,0x0,0x0);}else _0x380670==='h'&&_0x134ef1['setUTCMinutes'](0x0,0x0,0x0);return _0x134ef1['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x4531ee){const _0x33d7ae=_0x4531ee instanceof Date?_0x4531ee:new Date(_0x4531ee);return _0x33d7ae['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x31f7c8){const _0x55aaab='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x33127b=_0x55aaab['length'];if(_0x31f7c8<0x0||_0x31f7c8>=Math['pow'](_0x33127b,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x435e31,_0xdbc3bc]=divmod(_0x31f7c8,_0x33127b),[_0x4a9ff8,_0x73bd47]=divmod(_0x435e31,_0x33127b);return _0x55aaab[_0x4a9ff8]+_0x55aaab[_0xdbc3bc]+_0x55aaab[_0x73bd47];}exports['getSymKey']=getSymKey;function getSymVal(_0x4d632c){const _0x38dec4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x57737e=_0x38dec4['length'];if(_0x4d632c<0x0||_0x4d632c>=Math['pow'](_0x57737e,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x5c14c6,_0x27defb]=divmod(_0x4d632c,_0x57737e);return _0x38dec4[_0x5c14c6]+_0x38dec4[_0x27defb];}exports['getSymVal']=getSymVal;function divmod(_0x21df2b,_0x5896ba){return[Math['floor'](_0x21df2b/_0x5896ba),_0x21df2b%_0x5896ba];}function getIndexedHash(_0x1fbbe6,_0x345056){const _0xca8217=_0x1fbbe6[_0x345056]||0x0,_0x446fd1={..._0x1fbbe6};return delete _0x446fd1[_0x345056],[_0xca8217,_0x446fd1];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x1aadec,_0x1e40a1){const _0x5c4a63=_0x1e40a1['split']('/');let _0x5a403f=_0x1aadec;for(const _0x4635b0 of _0x5c4a63){if(_0x5a403f[_0x4635b0]!==undefined)_0x5a403f=_0x5a403f[_0x4635b0];else return undefined;}return _0x5a403f;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x16ca76){const _0x403a61={};for(const _0x4518b7 in _0x16ca76){if(_0x16ca76[_0x4518b7]===undefined)continue;const _0x2f995a=_0x4518b7['split']('/');let _0x5e6648=_0x403a61;for(let _0x14b969=0x0;_0x14b969<_0x2f995a['length'];_0x14b969++){_0x14b969===_0x2f995a['length']-0x1?_0x5e6648[_0x2f995a[_0x14b969]]=_0x16ca76[_0x4518b7]:(_0x5e6648[_0x2f995a[_0x14b969]]=_0x5e6648[_0x2f995a[_0x14b969]]||{},_0x5e6648=_0x5e6648[_0x2f995a[_0x14b969]]);}}return _0x403a61;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x37b98b){const _0x1974f9=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x1974f9['test'](_0x37b98b);}exports['isValidCron']=isValidCron;const s=_0x36c6e3=>{return(0x0,ms_1['default'])(_0x36c6e3)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x32238e=>{try{return JSON['parse'](_0x32238e);}catch(_0x388223){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x388223});throw _0x388223;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0xa6d8a7=>{return Array['isArray'](_0xa6d8a7)&&Array['isArray'](_0xa6d8a7[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x3cd3c6=>{const _0x242d59=[];let _0x4af877;for(let _0xdcfec4=0x1;_0xdcfec4<_0x3cd3c6['length'];_0xdcfec4++){const _0x4e4c44=_0x3cd3c6[_0xdcfec4],_0x54865f={};if(Array['isArray'](_0x4e4c44)){for(let _0x59dca0=0x0;_0x59dca0<_0x4e4c44['length'];_0x59dca0+=0x2){const _0x313aed=_0x4e4c44[_0x59dca0],_0x2d1e2c=_0x4e4c44[_0x59dca0+0x1];_0x54865f[_0x313aed]=_0x2d1e2c;}_0x4af877&&(_0x54865f['$']=_0x4af877),_0x242d59['push'](_0x54865f),_0x4af877=undefined;}else _0x4af877=_0x4e4c44;}return _0x242d59;};exports['arrayToHash']=arrayToHash;
|
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/hotmesh",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
4
4
|
"description": "Serverless Workflow",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"test:connect:nats": "NODE_ENV=test jest ./tests/unit/services/connector/providers/nats.test.ts --detectOpenHandles --forceExit --verbose",
|
|
28
28
|
"test:cycle": "NODE_ENV=test jest ./tests/functional/cycle/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
29
29
|
"test:meshflow": "NODE_ENV=test jest ./tests/meshflow/*/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
30
|
-
"test:meshflow:basic": "NODE_ENV=test jest ./tests/meshflow/basic/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
30
|
+
"test:meshflow:basic": "HMSH_LOGLEVEL=info NODE_ENV=test jest ./tests/meshflow/basic/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
31
31
|
"test:meshflow:collision": "NODE_ENV=test jest ./tests/meshflow/collision/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
32
32
|
"test:meshflow:fatal": "NODE_ENV=test jest ./tests/meshflow/fatal/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
33
33
|
"test:meshflow:goodbye": "NODE_ENV=test jest ./tests/meshflow/goodbye/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
34
34
|
"test:meshflow:hello": "HMSH_LOGLEVEL=debug HMSH_IS_CLUSTER=true NODE_ENV=test jest ./tests/meshflow/helloworld/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
35
35
|
"test:meshflow:hook": "NODE_ENV=test jest ./tests/meshflow/hook/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
36
36
|
"test:meshflow:interrupt": "NODE_ENV=test jest ./tests/meshflow/interrupt/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
37
|
-
"test:meshflow:loopactivity": "NODE_ENV=test jest ./tests/meshflow/loopactivity
|
|
37
|
+
"test:meshflow:loopactivity": "NODE_ENV=test jest ./tests/meshflow/loopactivity/I.test.ts --detectOpenHandles --forceExit --verbose",
|
|
38
38
|
"test:meshflow:nested": "NODE_ENV=test jest ./tests/meshflow/nested/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
39
39
|
"test:meshflow:retry": "NODE_ENV=test jest ./tests/meshflow/retry/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
40
40
|
"test:meshflow:sleep": "NODE_ENV=test jest ./tests/meshflow/sleep/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
41
41
|
"test:meshflow:signal": "NODE_ENV=test jest ./tests/meshflow/signal/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
42
42
|
"test:meshflow:unknown": "NODE_ENV=test jest ./tests/meshflow/unknown/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
43
|
-
"test:emit": "NODE_ENV=test jest ./tests/functional/emit
|
|
43
|
+
"test:emit": "NODE_ENV=test jest ./tests/functional/emit/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
44
44
|
"test:pending": "NODE_ENV=test jest ./tests/functional/pending/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
45
45
|
"test:functional": "NODE_ENV=test jest ./tests/functional/* --detectOpenHandles --forceExit --verbose",
|
|
46
46
|
"test:hmsh": "NODE_ENV=test jest ./tests/functional/*.test.ts --detectOpenHandles --verbose --forceExit",
|
|
@@ -52,11 +52,12 @@
|
|
|
52
52
|
"test:reclaim": "NODE_ENV=test jest ./tests/functional/reclaim/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
53
53
|
"test:redeploy": "NODE_ENV=test jest ./tests/functional/redeploy/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
54
54
|
"test:reporter": "NODE_ENV=test jest ./tests/unit/services/reporter/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
55
|
-
"test:reentrant": "NODE_ENV=test jest ./tests/functional/reentrant
|
|
55
|
+
"test:reentrant": "NODE_ENV=test jest ./tests/functional/reentrant/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
56
56
|
"test:retry": "NODE_ENV=test jest ./tests/functional/retry/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
57
57
|
"test:sequence": "NODE_ENV=test HMSH_LOGLEVEL=debug jest ./tests/functional/sequence/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
58
|
-
"test:signal": "NODE_ENV=test jest ./tests/functional/signal
|
|
58
|
+
"test:signal": "NODE_ENV=test jest ./tests/functional/signal/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
59
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",
|
|
60
61
|
"test:store:ioredis": "NODE_ENV=test jest ./tests/functional/store/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
61
62
|
"test:store:redis": "NODE_ENV=test jest ./tests/functional/store/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
62
63
|
"test:store:postgres": "NODE_ENV=test jest ./tests/functional/store/providers/postgres/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
@@ -66,8 +67,10 @@
|
|
|
66
67
|
"test:stream:nats": "NODE_ENV=test jest ./tests/functional/stream/providers/nats/nats.test.ts --detectOpenHandles --forceExit --verbose",
|
|
67
68
|
"test:sub:ioredis": "NODE_ENV=test jest ./tests/functional/sub/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
68
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",
|
|
71
|
+
"test:sub:nats": "NODE_ENV=test jest ./tests/functional/sub/providers/nats/nats.test.ts --detectOpenHandles --forceExit --verbose",
|
|
69
72
|
"test:trigger": "NODE_ENV=test jest ./tests/unit/services/activities/trigger.test.ts --detectOpenHandles --forceExit --verbose",
|
|
70
|
-
"test:meshdata": "NODE_ENV=test jest ./tests/meshdata
|
|
73
|
+
"test:meshdata": "NODE_ENV=test jest ./tests/meshdata/*.test.ts --forceExit --verbose --detectOpenHandles",
|
|
71
74
|
"test:meshos": "NODE_ENV=test HMSH_IS_CLUSTER=true jest ./tests/meshos/*.test.ts --forceExit --verbose --detectOpenHandles",
|
|
72
75
|
"test:meshcall": "NODE_ENV=test jest ./tests/meshcall/*.test.ts --forceExit --verbose --detectOpenHandles",
|
|
73
76
|
"test:unit": "NODE_ENV=test jest ./tests/unit/*/*/index.test.ts --detectOpenHandles --forceExit --verbose"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x48b863,_0x4b0cc9){const _0x1b1569=_0x59b2,_0x10e5cc=_0x48b863();while(!![]){try{const _0x3592f9=-parseInt(_0x1b1569(0xcd))/0x1+parseInt(_0x1b1569(0xce))/0x2+parseInt(_0x1b1569(0xd0))/0x3+-parseInt(_0x1b1569(0xd2))/0x4+-parseInt(_0x1b1569(0xcf))/0x5+-parseInt(_0x1b1569(0xd3))/0x6+-parseInt(_0x1b1569(0xcc))/0x7*(-parseInt(_0x1b1569(0xd1))/0x8);if(_0x3592f9===_0x4b0cc9)break;else _0x10e5cc['push'](_0x10e5cc['shift']());}catch(_0x1607cd){_0x10e5cc['push'](_0x10e5cc['shift']());}}}(_0x20d0,0x33fd5));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Activity']=void 0x0;function _0x59b2(_0x217ff5,_0x2c9b84){const _0x20d095=_0x20d0();return _0x59b2=function(_0x59b2a4,_0x2c6129){_0x59b2a4=_0x59b2a4-0xcc;let _0x3e7a57=_0x20d095[_0x59b2a4];return _0x3e7a57;},_0x59b2(_0x217ff5,_0x2c9b84);}const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream');class Activity{constructor(_0x4057e9,_0x3b63eb,_0x3a92da,_0x5d3ff0,_0x3bf558,_0x25e7a5){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x4057e9,this['data']=_0x3b63eb,this['metadata']=_0x3a92da,this['hook']=_0x5d3ff0,this['engine']=_0x3bf558,this['context']=_0x25e7a5||{'data':{},'metadata':{}},this['logger']=_0x3bf558['logger'],this['store']=_0x3bf558['store'];}['setLeg'](_0x31399c){this['leg']=_0x31399c;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x273ef0=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x273ef0!==undefined&&!isNaN(Number(_0x273ef0)))return _0x273ef0;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x3333c6=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x3333c6);}catch(_0x203d0b){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x3333c6>0x0){if(this['context']['metadata']['js']===_0x3333c6){const _0x3fa0fc=await this['setStatus'](-_0x3333c6);Number(_0x3fa0fc)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x203d0b;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x3ec99f=this['context']['metadata']['guid'];return this['setLeg'](0x2),await this['getState'](),collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid']),await collator_1['CollatorService']['notarizeReentry'](this,_0x3ec99f);}async['processEvent'](_0x4a969f=stream_1['StreamStatus']['SUCCESS'],_0x51e0dc=0xc8,_0x261f4d='output'){this['setLeg'](0x2);const _0xcdbe03=this['context']['metadata']['jid'];if(!_0xcdbe03){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x306256=this['metadata']['aid'];this['status']=_0x4a969f,this['code']=_0x51e0dc,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0xcdbe03,'aid':_0x306256,'status':_0x4a969f,'code':_0x51e0dc});let _0x1a6618;try{const _0xf1a665=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0xf1a665),_0x1a6618=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x1a6618['startActivitySpan'](this['leg']);let _0x40c540;if(_0x4a969f===stream_1['StreamStatus']['PENDING'])_0x40c540=await this['processPending'](_0x261f4d);else _0x4a969f===stream_1['StreamStatus']['SUCCESS']?_0x40c540=await this['processSuccess'](_0x261f4d):_0x40c540=await this['processError']();this['transitionAdjacent'](_0x40c540,_0x1a6618);}catch(_0x3278f3){if(_0x3278f3 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x3278f3['fault']+'-error',{..._0x3278f3});return;}else{if(_0x3278f3 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x3278f3});return;}else{if(_0x3278f3 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x3278f3});return;}else{if(_0x3278f3 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x3278f3});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x3278f3,'message':_0x3278f3['message'],'stack':_0x3278f3['stack'],'name':_0x3278f3['name']}),_0x1a6618?.['setActivityError'](_0x3278f3['message']);throw _0x3278f3;}finally{_0x1a6618?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0xcdbe03,'aid':_0x306256});}}async['processPending'](_0x43e38b){this['bindActivityData'](_0x43e38b),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0xe21c61=this['store']['transact']();return await this['setState'](_0xe21c61),await collator_1['CollatorService']['notarizeContinuation'](this,_0xe21c61),await this['setStatus'](this['adjacencyList']['length'],_0xe21c61),await _0xe21c61['exec']();}async['processSuccess'](_0x517c92){this['bindActivityData'](_0x517c92),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x52ef17=this['store']['transact']();return await this['setState'](_0x52ef17),await collator_1['CollatorService']['notarizeCompletion'](this,_0x52ef17),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x52ef17),await _0x52ef17['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x25ce48=this['store']['transact']();return await this['setState'](_0x25ce48),await collator_1['CollatorService']['notarizeCompletion'](this,_0x25ce48),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x25ce48),await _0x25ce48['exec']();}async['transitionAdjacent'](_0x3c833f,_0x17c7c){_0x17c7c['mapActivityAttributes']();const _0x5b2dd8=this['resolveStatus'](_0x3c833f),_0x35f665={'app.job.jss':_0x5b2dd8},_0x11a491=await this['transition'](this['adjacencyList'],_0x5b2dd8);_0x11a491?.['length']&&(_0x35f665['app.activity.mids']=_0x11a491['join'](',')),_0x17c7c['setActivityAttributes'](_0x35f665);}['resolveStatus'](_0x59e20c){const _0x127288=_0x59e20c[_0x59e20c['length']-0x1];return Array['isArray'](_0x127288)?Number(_0x127288[0x1]):Number(_0x127288);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x201f6d=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x23def6=_0x201f6d['mapRules']();if(_0x23def6)for(const _0x3d681d in _0x23def6){const _0x3ae779=_0x3d681d['indexOf']('[');if(_0x3ae779>-0x1){const _0xdd8b7f=_0x3d681d['substring'](_0x3ae779+0x1)['split'](']')[0x0];if(!isNaN(Number(_0xdd8b7f))){const _0xf92657=_0x3d681d['substring'](0x0,_0x3ae779);_0x23def6[_0xf92657]=_0x23def6[_0x3d681d],delete _0x23def6[_0x3d681d];}else{if(_0xdd8b7f==='-'||_0xdd8b7f==='_'){const _0x3d30ea=_0x23def6[_0x3d681d];Object['keys'](_0x3d30ea)['forEach'](_0xd5d2b0=>{_0x23def6[_0xd5d2b0]=_0x3d30ea[_0xd5d2b0];});}}}}this['context']['data']=_0x23def6;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x4cd575=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x4cd575['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x34a26f=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0xa1b112=_0x34a26f['mapRules'](),_0x2f895e=this['metadata']['aid'],_0x2e7fec={...this['context'][_0x2f895e]['output'],..._0xa1b112};this['context'][_0x2f895e]['output']['data']=_0x2e7fec;}}async['registerTimeout'](){}['bindActivityError'](_0x2a215d){const _0x30a141=this['context'][this['metadata']['aid']]['output']['metadata'];_0x30a141['err']=JSON['stringify'](this['data']),_0x30a141['$error']={..._0x2a215d,'is_stream_error':!![]};}['bindJobError'](_0x153a5c){this['context']['metadata']['err']=JSON['stringify']({..._0x153a5c,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x733909,_0x387ab1){const {id:_0x117dff}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x733909,this['context']['metadata']['jid'],_0x117dff,_0x387ab1);}['authorizeEntry'](_0x3fc57e){return this['adjacencyList']?.['map'](_0x513868=>{const {metadata:{aid:_0x5ec849}}=_0x513868;return _0x3fc57e[_0x5ec849+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x5ec849;})??[];}['bindDimensionalAddress'](_0x5e520c){const _0x18ce3c=this['resolveDad']();_0x5e520c[this['metadata']['aid']+'/output/metadata/dad']=_0x18ce3c;}async['setState'](_0x4bdfd9){const _0x1b4fbb=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x332dba={};await this['bindJobState'](_0x332dba);const _0x59066c=this['authorizeEntry'](_0x332dba);this['bindDimensionalAddress'](_0x332dba),this['bindActivityState'](_0x332dba);const _0x7bf667=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x59066c],_0x14aba7=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x332dba,this['getJobStatus'](),_0x1b4fbb,_0x7bf667,_0x14aba7,_0x4bdfd9);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x3e1cf4=this['context']['$self'];!_0x3e1cf4['output']['metadata']&&(_0x3e1cf4['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x3e1cf4['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x21cd15=(0x0,utils_1['formatISODate'])(new Date());_0x3e1cf4['output']['metadata']['ac']=_0x21cd15,_0x3e1cf4['output']['metadata']['au']=_0x21cd15,_0x3e1cf4['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x3e1cf4['output']['metadata']['stp']=this['config']['subtype']),_0x3e1cf4['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x47d4a3){const _0x271732=await this['getTriggerConfig'](),_0xd831c7=[..._0x271732['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0xc49ae0 of _0xd831c7){const _0x4a71d7=(0x0,utils_1['getValueByPath'])(this['context'],_0xc49ae0);_0x4a71d7!==undefined&&(_0x47d4a3[_0xc49ae0]=_0x4a71d7);}for(const _0x5099c0 in this['context']?.['data']??{}){(_0x5099c0['startsWith']('-')||_0x5099c0['startsWith']('_'))&&(_0x47d4a3[_0x5099c0]=this['context']['data'][_0x5099c0]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x47d4a3,this['config'],this['context']);}['bindActivityState'](_0x31dbca){const _0x371194=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x1021a2 of _0x371194){const _0x3a0233=this['metadata']['aid']+'/'+_0x1021a2,_0x228e6a=(0x0,utils_1['getValueByPath'])(this['context'],_0x3a0233);_0x228e6a!==undefined&&(_0x31dbca[_0x3a0233]=_0x228e6a);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x31dbca,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x5f5717=>'metadata/'+_0x5f5717);}['bindActivityMetadataPaths'](){const _0x15f42d=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x15f42d]['KEYS']['map'](_0x5617b3=>'output/metadata/'+_0x5617b3);}async['getState'](){const _0x21bebc=this['context']['metadata']['gid'],_0x4d56c4='$'+this['config']['subscribes'],_0x2634a5={[_0x4d56c4]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x475627=>'metadata/'+_0x475627)};for(let [_0x5ba4cd,_0x26171a]of Object['entries'](this['config']['consumes'])){if(_0x5ba4cd==='$job')for(const _0xabab87 of _0x26171a){_0x2634a5[_0x4d56c4]['push'](_0xabab87);}else{_0x5ba4cd==='$self'&&(_0x5ba4cd=this['metadata']['aid']);!_0x2634a5[_0x5ba4cd]&&(_0x2634a5[_0x5ba4cd]=[]);for(const _0xd36a1b of _0x26171a){_0x2634a5[_0x5ba4cd]['push'](_0x5ba4cd+'/'+_0xd36a1b);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x2634a5,this['config'],this['metadata'],this['leg']);const {dad:_0x42ad77,jid:_0x25fcd1}=this['context']['metadata'],_0x5f3514=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x42ad77||''),[_0x49f552,_0x4bc809]=await this['store']['getState'](_0x25fcd1,_0x2634a5,_0x5f3514);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x49f552),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x21bebc),this['initDimensionalAddress'](_0x42ad77),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x319ddb,_0x4aac68){if(_0x4aac68!==_0x319ddb)throw new errors_1['GenerationalError'](_0x319ddb,_0x4aac68,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x2f6162){this['metadata']['dad']=_0x2f6162;}['initSelf'](_0x2a4f83){const _0x27454b=this['metadata']['aid'];!_0x2a4f83[_0x27454b]&&(_0x2a4f83[_0x27454b]={});const _0x3e640d=_0x2a4f83[_0x27454b];return!_0x3e640d['output']&&(_0x3e640d['output']={}),!_0x3e640d['input']&&(_0x3e640d['input']={}),!_0x3e640d['hook']&&(_0x3e640d['hook']={}),!_0x3e640d['output']['metadata']&&(_0x3e640d['output']['metadata']={}),_0x3e640d['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x2a4f83['$self']=_0x3e640d,_0x2a4f83['$job']=_0x2a4f83,_0x2a4f83;}['initPolicies'](_0x46782d){const _0x5440f0=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x46782d);_0x46782d['metadata']['expire']=_0x5440f0;if(this['config']['persistent']!=undefined){const _0x197876=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x46782d);_0x46782d['metadata']['persistent']=_0x197876;}}['bindActivityData'](_0x5576d5){this['context'][this['metadata']['aid']][_0x5576d5]['data']=this['data'];}['resolveDad'](){let _0x4c7f5c=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x4c7f5c=_0x4c7f5c['substring'](0x0,_0x4c7f5c['lastIndexOf'](','))+','+this['adjacentIndex']),_0x4c7f5c;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x5e262b=[],_0x5ab1f8=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x2292b6=_0x5ab1f8['.'+this['metadata']['aid']],_0x3199af=this['resolveAdjacentDad']();if(_0x2292b6)for(const _0x212214 in _0x2292b6){const _0x436305=_0x2292b6[_0x212214];mapper_1['MapperService']['evaluate'](_0x436305,this['context'],this['code'])&&_0x5e262b['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x3199af,'aid':_0x212214,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x5e262b;}['isJobComplete'](_0x300d37){return _0x300d37<=0x0;}['shouldEmit'](){if(this['config']['emit'])return pipe_1['Pipe']['resolve'](this['config']['emit'],this['context'])===!![];return![];}['shouldPersistJob'](){if(this['config']['persist']!==undefined)return pipe_1['Pipe']['resolve'](this['config']['persist'],this['context'])===!![];return![];}async['transition'](_0x548911,_0x3c3bcd){if(this['jobWasInterrupted'](_0x3c3bcd))return;let _0x26b0ff=[];(this['shouldEmit']()||this['isJobComplete'](_0x3c3bcd)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x3c3bcd)&&!this['shouldPersistJob']()});if(_0x548911['length']&&!this['isJobComplete'](_0x3c3bcd)){const _0x38dd76=this['store']['transact']();for(const _0x47530c of _0x548911){await this['engine']['router']?.['publishMessage'](null,_0x47530c,_0x38dd76);}_0x26b0ff=await _0x38dd76['exec']();}return _0x26b0ff;}['jobWasInterrupted'](_0x5c1b38){return _0x5c1b38<-0x5f5e100;}}function _0x20d0(){const _0x543fa2=['1303572dbjZCu','304059cwMZol','330124jvSfbr','612260MIFLIV','325145LFHTxV','670293vnIxLO','112qWMHtr','1249260pSFsCA'];_0x20d0=function(){return _0x543fa2;};return _0x20d0();}exports['Activity']=Activity;
|
|
1
|
+
'use strict';(function(_0x26369d,_0x4e7c0c){const _0xfbd5c6=_0x5491,_0x4e50d1=_0x26369d();while(!![]){try{const _0x3203eb=-parseInt(_0xfbd5c6(0x9d))/0x1*(-parseInt(_0xfbd5c6(0x94))/0x2)+-parseInt(_0xfbd5c6(0x99))/0x3*(parseInt(_0xfbd5c6(0x95))/0x4)+-parseInt(_0xfbd5c6(0x93))/0x5*(parseInt(_0xfbd5c6(0x9c))/0x6)+parseInt(_0xfbd5c6(0x98))/0x7+-parseInt(_0xfbd5c6(0x9a))/0x8*(-parseInt(_0xfbd5c6(0x9b))/0x9)+parseInt(_0xfbd5c6(0x96))/0xa*(parseInt(_0xfbd5c6(0x9e))/0xb)+-parseInt(_0xfbd5c6(0x97))/0xc;if(_0x3203eb===_0x4e7c0c)break;else _0x4e50d1['push'](_0x4e50d1['shift']());}catch(_0xde85d0){_0x4e50d1['push'](_0x4e50d1['shift']());}}}(_0x234f,0x1c286));function _0x5491(_0x29fe15,_0x2e90dc){const _0x234f3b=_0x234f();return _0x5491=function(_0x5491be,_0x55978f){_0x5491be=_0x5491be-0x93;let _0x27bbf4=_0x234f3b[_0x5491be];return _0x27bbf4;},_0x5491(_0x29fe15,_0x2e90dc);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Activity']=void 0x0;const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream');function _0x234f(){const _0x25324b=['554148dmDopD','48JTVeeV','442568CrBNij','36ZYtKUz','27474jJpyaf','2pWnxXW','22RsjAee','60mhrOwQ','167374LgivAn','15472lKRdvm','1046620EoBpEv','5339712XOqSGk'];_0x234f=function(){return _0x25324b;};return _0x234f();}class Activity{constructor(_0x20d81f,_0x3fd45b,_0x2953af,_0x4430a6,_0x32d468,_0x2be8bf){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x20d81f,this['data']=_0x3fd45b,this['metadata']=_0x2953af,this['hook']=_0x4430a6,this['engine']=_0x32d468,this['context']=_0x2be8bf||{'data':{},'metadata':{}},this['logger']=_0x32d468['logger'],this['store']=_0x32d468['store'];}['setLeg'](_0x4f0e5c){this['leg']=_0x4f0e5c;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x2d17b5=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x2d17b5!==undefined&&!isNaN(Number(_0x2d17b5)))return _0x2d17b5;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x17c1f7=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x17c1f7);}catch(_0x2113ec){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x17c1f7>0x0){if(this['context']['metadata']['js']===_0x17c1f7){const _0x5235fa=await this['setStatus'](-_0x17c1f7);Number(_0x5235fa)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x2113ec;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x1aa905=this['context']['metadata']['guid'];return this['setLeg'](0x2),await this['getState'](),collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid']),await collator_1['CollatorService']['notarizeReentry'](this,_0x1aa905);}async['processEvent'](_0x1bc726=stream_1['StreamStatus']['SUCCESS'],_0x344d66=0xc8,_0x429936='output'){this['setLeg'](0x2);const _0x850d22=this['context']['metadata']['jid'];if(!_0x850d22){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x5ac4fc=this['metadata']['aid'];this['status']=_0x1bc726,this['code']=_0x344d66,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x850d22,'aid':_0x5ac4fc,'status':_0x1bc726,'code':_0x344d66});let _0x5782db;try{const _0x4dc09c=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x4dc09c),_0x5782db=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x5782db['startActivitySpan'](this['leg']);let _0xa2c867;if(_0x1bc726===stream_1['StreamStatus']['PENDING'])_0xa2c867=await this['processPending'](_0x429936);else _0x1bc726===stream_1['StreamStatus']['SUCCESS']?_0xa2c867=await this['processSuccess'](_0x429936):_0xa2c867=await this['processError']();this['transitionAdjacent'](_0xa2c867,_0x5782db);}catch(_0x4fcc1e){if(_0x4fcc1e instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x4fcc1e['fault']+'-error',{..._0x4fcc1e});return;}else{if(_0x4fcc1e instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x4fcc1e});return;}else{if(_0x4fcc1e instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x4fcc1e});return;}else{if(_0x4fcc1e instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x4fcc1e});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x4fcc1e,'message':_0x4fcc1e['message'],'stack':_0x4fcc1e['stack'],'name':_0x4fcc1e['name']}),_0x5782db?.['setActivityError'](_0x4fcc1e['message']);throw _0x4fcc1e;}finally{_0x5782db?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x850d22,'aid':_0x5ac4fc});}}async['processPending'](_0xdf5d78){this['bindActivityData'](_0xdf5d78),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x240639=this['store']['transact']();return await this['setState'](_0x240639),await collator_1['CollatorService']['notarizeContinuation'](this,_0x240639),await this['setStatus'](this['adjacencyList']['length'],_0x240639),await _0x240639['exec']();}async['processSuccess'](_0x4577fa){this['bindActivityData'](_0x4577fa),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x1314b6=this['store']['transact']();return await this['setState'](_0x1314b6),await collator_1['CollatorService']['notarizeCompletion'](this,_0x1314b6),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x1314b6),await _0x1314b6['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x34561b=this['store']['transact']();return await this['setState'](_0x34561b),await collator_1['CollatorService']['notarizeCompletion'](this,_0x34561b),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x34561b),await _0x34561b['exec']();}async['transitionAdjacent'](_0x343e56,_0x5793b9){_0x5793b9['mapActivityAttributes']();const _0xc642fb=this['resolveStatus'](_0x343e56),_0x47ef49={'app.job.jss':_0xc642fb},_0xbbbd94=await this['transition'](this['adjacencyList'],_0xc642fb);_0xbbbd94?.['length']&&(_0x47ef49['app.activity.mids']=_0xbbbd94['join'](',')),_0x5793b9['setActivityAttributes'](_0x47ef49);}['resolveStatus'](_0x59d7c0){const _0x36e449=_0x59d7c0[_0x59d7c0['length']-0x1];return Array['isArray'](_0x36e449)?Number(_0x36e449[0x1]):Number(_0x36e449);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x1b4732=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x59996e=_0x1b4732['mapRules']();if(_0x59996e)for(const _0x48f314 in _0x59996e){const _0x1a966c=_0x48f314['indexOf']('[');if(_0x1a966c>-0x1){const _0x727533=_0x48f314['substring'](_0x1a966c+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x727533))){const _0x3e46bc=_0x48f314['substring'](0x0,_0x1a966c);_0x59996e[_0x3e46bc]=_0x59996e[_0x48f314],delete _0x59996e[_0x48f314];}else{if(_0x727533==='-'||_0x727533==='_'){const _0x4a4a66=_0x59996e[_0x48f314];Object['keys'](_0x4a4a66)['forEach'](_0x317fb3=>{_0x59996e[_0x317fb3]=_0x4a4a66[_0x317fb3];});}}}}this['context']['data']=_0x59996e;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x505636=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x505636['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0xb2cd6b=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x1b4330=_0xb2cd6b['mapRules'](),_0x362c4a=this['metadata']['aid'],_0x1664c7={...this['context'][_0x362c4a]['output'],..._0x1b4330};this['context'][_0x362c4a]['output']['data']=_0x1664c7;}}async['registerTimeout'](){}['bindActivityError'](_0x4049ce){const _0x5b3469=this['context'][this['metadata']['aid']]['output']['metadata'];_0x5b3469['err']=JSON['stringify'](this['data']),_0x5b3469['$error']={..._0x4049ce,'is_stream_error':!![]};}['bindJobError'](_0x262191){this['context']['metadata']['err']=JSON['stringify']({..._0x262191,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x241119,_0x445a78){const {id:_0x14866c}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x241119,this['context']['metadata']['jid'],_0x14866c,_0x445a78);}['authorizeEntry'](_0x1ff7b6){return this['adjacencyList']?.['map'](_0x3ce33c=>{const {metadata:{aid:_0x1b7b94}}=_0x3ce33c;return _0x1ff7b6[_0x1b7b94+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x1b7b94;})??[];}['bindDimensionalAddress'](_0x4aac43){const _0x24ed62=this['resolveDad']();_0x4aac43[this['metadata']['aid']+'/output/metadata/dad']=_0x24ed62;}async['setState'](_0x561702){const _0x2df7f8=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0xc80f76={};await this['bindJobState'](_0xc80f76);const _0x3af0dd=this['authorizeEntry'](_0xc80f76);this['bindDimensionalAddress'](_0xc80f76),this['bindActivityState'](_0xc80f76);const _0x376719=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x3af0dd],_0x478f5a=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0xc80f76,this['getJobStatus'](),_0x2df7f8,_0x376719,_0x478f5a,_0x561702);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x369c85=this['context']['$self'];!_0x369c85['output']['metadata']&&(_0x369c85['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x369c85['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x1ffcf3=(0x0,utils_1['formatISODate'])(new Date());_0x369c85['output']['metadata']['ac']=_0x1ffcf3,_0x369c85['output']['metadata']['au']=_0x1ffcf3,_0x369c85['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x369c85['output']['metadata']['stp']=this['config']['subtype']),_0x369c85['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x1695e4){const _0x2e04ef=await this['getTriggerConfig'](),_0x15eed6=[..._0x2e04ef['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x5d003c of _0x15eed6){const _0x3d8f68=(0x0,utils_1['getValueByPath'])(this['context'],_0x5d003c);_0x3d8f68!==undefined&&(_0x1695e4[_0x5d003c]=_0x3d8f68);}for(const _0x4f3e96 in this['context']?.['data']??{}){(_0x4f3e96['startsWith']('-')||_0x4f3e96['startsWith']('_'))&&(_0x1695e4[_0x4f3e96]=this['context']['data'][_0x4f3e96]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x1695e4,this['config'],this['context']);}['bindActivityState'](_0x12dfc7){const _0x358e3c=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x471b0f of _0x358e3c){const _0x18c139=this['metadata']['aid']+'/'+_0x471b0f,_0xed47e=(0x0,utils_1['getValueByPath'])(this['context'],_0x18c139);_0xed47e!==undefined&&(_0x12dfc7[_0x18c139]=_0xed47e);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x12dfc7,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x4f18fd=>'metadata/'+_0x4f18fd);}['bindActivityMetadataPaths'](){const _0x340d2a=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x340d2a]['KEYS']['map'](_0x2aa617=>'output/metadata/'+_0x2aa617);}async['getState'](){const _0x49838c=this['context']['metadata']['gid'],_0x322358='$'+this['config']['subscribes'],_0x2ef493={[_0x322358]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0xc54638=>'metadata/'+_0xc54638)};for(let [_0x4f1633,_0x3c9492]of Object['entries'](this['config']['consumes'])){if(_0x4f1633==='$job')for(const _0x4e3465 of _0x3c9492){_0x2ef493[_0x322358]['push'](_0x4e3465);}else{_0x4f1633==='$self'&&(_0x4f1633=this['metadata']['aid']);!_0x2ef493[_0x4f1633]&&(_0x2ef493[_0x4f1633]=[]);for(const _0x3c6eaf of _0x3c9492){_0x2ef493[_0x4f1633]['push'](_0x4f1633+'/'+_0x3c6eaf);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x2ef493,this['config'],this['metadata'],this['leg']);const {dad:_0x1245a7,jid:_0x4eef66}=this['context']['metadata'],_0x5561d0=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x1245a7||''),[_0x41944d,_0x445023]=await this['store']['getState'](_0x4eef66,_0x2ef493,_0x5561d0);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x41944d),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x49838c),this['initDimensionalAddress'](_0x1245a7),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x23ac9c,_0x2fefbf){if(_0x2fefbf!==_0x23ac9c)throw new errors_1['GenerationalError'](_0x23ac9c,_0x2fefbf,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x4a7835){this['metadata']['dad']=_0x4a7835;}['initSelf'](_0x37a5c8){const _0x10b0c2=this['metadata']['aid'];!_0x37a5c8[_0x10b0c2]&&(_0x37a5c8[_0x10b0c2]={});const _0x20c2fc=_0x37a5c8[_0x10b0c2];return!_0x20c2fc['output']&&(_0x20c2fc['output']={}),!_0x20c2fc['input']&&(_0x20c2fc['input']={}),!_0x20c2fc['hook']&&(_0x20c2fc['hook']={}),!_0x20c2fc['output']['metadata']&&(_0x20c2fc['output']['metadata']={}),_0x20c2fc['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x37a5c8['$self']=_0x20c2fc,_0x37a5c8['$job']=_0x37a5c8,_0x37a5c8;}['initPolicies'](_0x8e7332){const _0x5798b8=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x8e7332);_0x8e7332['metadata']['expire']=_0x5798b8;if(this['config']['persistent']!=undefined){const _0x3793af=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x8e7332);_0x8e7332['metadata']['persistent']=_0x3793af;}}['bindActivityData'](_0x278c64){this['context'][this['metadata']['aid']][_0x278c64]['data']=this['data'];}['resolveDad'](){let _0x599cf6=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x599cf6=_0x599cf6['substring'](0x0,_0x599cf6['lastIndexOf'](','))+','+this['adjacentIndex']),_0x599cf6;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x587dd7=[],_0x5ea651=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x4c0ddf=_0x5ea651['.'+this['metadata']['aid']],_0x1ebf08=this['resolveAdjacentDad']();if(_0x4c0ddf)for(const _0x2ba2c7 in _0x4c0ddf){const _0xdc21e0=_0x4c0ddf[_0x2ba2c7];mapper_1['MapperService']['evaluate'](_0xdc21e0,this['context'],this['code'])&&_0x587dd7['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x1ebf08,'aid':_0x2ba2c7,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x587dd7;}['isJobComplete'](_0x586ad8){return _0x586ad8<=0x0;}['shouldEmit'](){if(this['config']['emit'])return pipe_1['Pipe']['resolve'](this['config']['emit'],this['context'])===!![];return![];}['shouldPersistJob'](){if(this['config']['persist']!==undefined)return pipe_1['Pipe']['resolve'](this['config']['persist'],this['context'])===!![];return![];}async['transition'](_0x17af04,_0x45ce87){if(this['jobWasInterrupted'](_0x45ce87))return;let _0x4646bd=[];(this['shouldEmit']()||this['isJobComplete'](_0x45ce87)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x45ce87)&&!this['shouldPersistJob']()});if(_0x17af04['length']&&!this['isJobComplete'](_0x45ce87)){const _0x4cf750=this['store']['transact']();for(const _0x4eac14 of _0x17af04){await this['engine']['router']?.['publishMessage'](null,_0x4eac14,_0x4cf750);}_0x4646bd=await _0x4cf750['exec']();}return _0x4646bd;}['jobWasInterrupted'](_0x1e43ec){return _0x1e43ec<-0x5f5e100;}}exports['Activity']=Activity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x2ab3(_0x59bde6,_0x181f22){const _0x411f57=_0x411f();return _0x2ab3=function(_0x2ab3c9,_0x70865){_0x2ab3c9=_0x2ab3c9-0xe6;let _0x26759b=_0x411f57[_0x2ab3c9];return _0x26759b;},_0x2ab3(_0x59bde6,_0x181f22);}(function(_0x2d9d56,_0x4fe0a7){const _0x536bde=_0x2ab3,_0xde6135=_0x2d9d56();while(!![]){try{const _0x1f2c63=parseInt(_0x536bde(0xef))/0x1*(-parseInt(_0x536bde(0xe6))/0x2)+-parseInt(_0x536bde(0xe7))/0x3*(parseInt(_0x536bde(0xf1))/0x4)+parseInt(_0x536bde(0xed))/0x5+-parseInt(_0x536bde(0xeb))/0x6*(parseInt(_0x536bde(0xe9))/0x7)+-parseInt(_0x536bde(0xe8))/0x8*(parseInt(_0x536bde(0xf0))/0x9)+parseInt(_0x536bde(0xea))/0xa*(-parseInt(_0x536bde(0xee))/0xb)+parseInt(_0x536bde(0xec))/0xc;if(_0x1f2c63===_0x4fe0a7)break;else _0xde6135['push'](_0xde6135['shift']());}catch(_0x596917){_0xde6135['push'](_0xde6135['shift']());}}}(_0x411f,0xcd551));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Await']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream'),activity_1=require('./activity');function _0x411f(){const _0x2d75a4=['552HldLao','60134652CBTXWp','1145570aTBcBh','3509517uVxSJi','33OrVMQu','59868KmwYge','272txHTAL','53758wwlrax','33621ouHFMS','1648vLGlqJ','80717lnEGlo','10KUECtX'];_0x411f=function(){return _0x2d75a4;};return _0x411f();}class Await extends activity_1['Activity']{constructor(_0x4bbfbe,_0x30472b,_0x4d61aa,_0x2178ac,_0x1cbbdf,_0x5b6e24){super(_0x4bbfbe,_0x30472b,_0x4d61aa,_0x2178ac,_0x1cbbdf,_0x5b6e24);}async['process'](){this['logger']['debug']('await-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x481a65;try{await this['verifyEntry'](),_0x481a65=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x481a65['startActivitySpan'](this['leg']),this['mapInputData']();const _0x1e3533=this['store']['transact'](),_0x3884d9=await this['execActivity'](_0x1e3533);await collator_1['CollatorService']['authorizeReentry'](this,_0x1e3533),await this['setState'](_0x1e3533),await this['setStatus'](0x0,_0x1e3533);const _0x637d52=await _0x1e3533['exec']();_0x481a65['mapActivityAttributes']();const _0x45430d=this['resolveStatus'](_0x637d52);return _0x481a65['setActivityAttributes']({'app.activity.mid':_0x3884d9,'app.job.jss':_0x45430d}),this['context']['metadata']['aid'];}catch(_0x41ecfb){if(_0x41ecfb instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x41ecfb});return;}else{if(_0x41ecfb instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x41ecfb});return;}else{if(_0x41ecfb instanceof errors_1['GetStateError']){this['logger']['error']('await-get-state-error',{..._0x41ecfb});return;}else{if(_0x41ecfb instanceof errors_1['CollationError']){if(_0x41ecfb['fault']==='duplicate'){this['logger']['info']('await-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('await-collation-error',{..._0x41ecfb});}else this['logger']['error']('await-process-error',{..._0x41ecfb});}}}_0x481a65?.['setActivityError'](_0x41ecfb['message']);throw _0x41ecfb;}finally{_0x481a65?.['endActivitySpan'](),this['logger']['debug']('await-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x19fff6){const _0x1de0e0=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x176cec={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':this['metadata']['dad'],'aid':this['metadata']['aid'],'topic':_0x1de0e0,'spn':this['context']['$self']['output']['metadata']?.['l1s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['AWAIT'],'data':this['context']['data']};if(this['config']['await']!==!![]){const _0x138661=pipe_1['Pipe']['resolve'](this['config']['await'],this['context']);_0x138661===![]&&(_0x176cec['metadata']['await']=![]);}return this['config']['retry']&&(_0x176cec['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](null,_0x176cec,_0x19fff6);}}exports['Await']=Await;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function _0x4a54(_0x4f0337,_0x520963){const _0x45495f=_0x4549();return _0x4a54=function(_0x4a5496,_0x1a8678){_0x4a5496=_0x4a5496-0x125;let _0x1365a3=_0x45495f[_0x4a5496];return _0x1365a3;},_0x4a54(_0x4f0337,_0x520963);}(function(_0x53c7a4,_0x5a9ed3){const _0x5433dc=_0x4a54,_0x368d13=_0x53c7a4();while(!![]){try{const _0x5062e3=parseInt(_0x5433dc(0x128))/0x1+-parseInt(_0x5433dc(0x12d))/0x2+-parseInt(_0x5433dc(0x12c))/0x3*(-parseInt(_0x5433dc(0x125))/0x4)+-parseInt(_0x5433dc(0x127))/0x5+parseInt(_0x5433dc(0x12b))/0x6+-parseInt(_0x5433dc(0x129))/0x7+-parseInt(_0x5433dc(0x126))/0x8*(parseInt(_0x5433dc(0x12a))/0x9);if(_0x5062e3===_0x5a9ed3)break;else _0x368d13['push'](_0x368d13['shift']());}catch(_0x30ebdc){_0x368d13['push'](_0x368d13['shift']());}}}(_0x4549,0x33bce));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Cycle']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Cycle extends activity_1['Activity']{constructor(_0x28d9f8,_0x59b8f3,_0x141d80,_0x3c8101,_0x11aebb,_0x4c00f9){super(_0x28d9f8,_0x59b8f3,_0x141d80,_0x3c8101,_0x11aebb,_0x4c00f9);}async['process'](){this['logger']['debug']('cycle-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x2a7e2b;try{await this['verifyEntry'](),_0x2a7e2b=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x2a7e2b['startActivitySpan'](this['leg']),this['mapInputData']();let _0x24ad9d=this['store']['transact']();await this['setState'](_0x24ad9d),await this['setStatus'](0x0,_0x24ad9d);const _0x375ce1=await _0x24ad9d['exec']();_0x2a7e2b['mapActivityAttributes']();const _0x1d0170=this['resolveStatus'](_0x375ce1);_0x24ad9d=this['store']['transact']();const _0x2eedef=await this['cycleAncestorActivity'](_0x24ad9d);return _0x2a7e2b['setActivityAttributes']({'app.activity.mid':_0x2eedef,'app.job.jss':_0x1d0170}),await collator_1['CollatorService']['notarizeEarlyExit'](this,_0x24ad9d),await _0x24ad9d['exec'](),this['context']['metadata']['aid'];}catch(_0x29c155){if(_0x29c155 instanceof errors_1['InactiveJobError']){this['logger']['error']('cycle-inactive-job-error',{..._0x29c155});return;}else{if(_0x29c155 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x29c155});return;}else{if(_0x29c155 instanceof errors_1['GetStateError']){this['logger']['error']('cycle-get-state-error',{..._0x29c155});return;}else{if(_0x29c155 instanceof errors_1['CollationError']){if(_0x29c155['fault']==='duplicate'){this['logger']['info']('cycle-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('cycle-collation-error',{..._0x29c155});}else this['logger']['error']('cycle-process-error',{..._0x29c155});}}}_0x2a7e2b?.['setActivityError'](_0x29c155['message']);throw _0x29c155;}finally{_0x2a7e2b?.['endActivitySpan'](),this['logger']['debug']('cycle-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['cycleAncestorActivity'](_0x21ed6f){this['mapInputData']();const _0x3bda9a={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':collator_1['CollatorService']['resolveReentryDimension'](this),'aid':this['config']['ancestor'],'spn':this['context']['$self']['output']['metadata']?.['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context']['data']};return await this['engine']['router']?.['publishMessage'](null,_0x3bda9a,_0x21ed6f);}}exports['Cycle']=Cycle;function _0x4549(){const _0x23064e=['24NeXaSk','776895EwLeKB','156136FWCRPp','2768318EnBJnm','326691byijNI','1916166JaDXsT','30fJvoSi','13378weOvyw','161144MjdcmZ'];_0x4549=function(){return _0x23064e;};return _0x4549();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x3c66ea,_0x143de2){const _0x4c3816=_0x2efe,_0x125e95=_0x3c66ea();while(!![]){try{const _0x381a16=parseInt(_0x4c3816(0xce))/0x1*(parseInt(_0x4c3816(0xd0))/0x2)+-parseInt(_0x4c3816(0xd6))/0x3*(parseInt(_0x4c3816(0xd2))/0x4)+parseInt(_0x4c3816(0xd8))/0x5*(-parseInt(_0x4c3816(0xd4))/0x6)+parseInt(_0x4c3816(0xd7))/0x7*(parseInt(_0x4c3816(0xd3))/0x8)+-parseInt(_0x4c3816(0xd9))/0x9*(parseInt(_0x4c3816(0xd5))/0xa)+parseInt(_0x4c3816(0xcf))/0xb+parseInt(_0x4c3816(0xd1))/0xc;if(_0x381a16===_0x143de2)break;else _0x125e95['push'](_0x125e95['shift']());}catch(_0x44548b){_0x125e95['push'](_0x125e95['shift']());}}}(_0x4beb,0x96f40));function _0x4beb(){const _0x5c882f=['5726979SKdXLO','801CaQPwZ','3222285Iubdji','614wCUxQt','23579220Dgfyyw','220AzlPWy','125280XcBPZS','27228RMIPMI','10tYWcUv','61446IqDKhC','217jSfVQY','670WEzPdl'];_0x4beb=function(){return _0x5c882f;};return _0x4beb();}function _0x2efe(_0x308deb,_0x17d2f6){const _0x4beb7c=_0x4beb();return _0x2efe=function(_0x2efea2,_0x21d4b2){_0x2efea2=_0x2efea2-0xce;let _0x361cbd=_0x4beb7c[_0x2efea2];return _0x361cbd;},_0x2efe(_0x308deb,_0x17d2f6);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Hook']=void 0x0;const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),collator_1=require('../collator'),pipe_1=require('../pipe'),task_1=require('../task'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream'),activity_1=require('./activity');class Hook extends activity_1['Activity']{constructor(_0x45e312,_0x3140a4,_0x17714e,_0x472930,_0x292cf5,_0x2f13f7){super(_0x45e312,_0x3140a4,_0x17714e,_0x472930,_0x292cf5,_0x2f13f7);}async['process'](){this['logger']['debug']('hook-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x4e10c5;try{return await this['verifyEntry'](),_0x4e10c5=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x4e10c5['startActivitySpan'](this['leg']),this['doesHook']()?await this['doHook'](_0x4e10c5):await this['doPassThrough'](_0x4e10c5),this['context']['metadata']['aid'];}catch(_0x1cc155){if(_0x1cc155 instanceof errors_1['InactiveJobError']){this['logger']['error']('hook-inactive-job-error',{..._0x1cc155});return;}else{if(_0x1cc155 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x1cc155});return;}else{if(_0x1cc155 instanceof errors_1['GetStateError']){this['logger']['error']('hook-get-state-error',{..._0x1cc155});return;}else{if(_0x1cc155 instanceof errors_1['CollationError']){if(_0x1cc155['fault']==='duplicate'){this['logger']['info']('hook-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('hook-collation-error',{..._0x1cc155});}else this['logger']['error']('hook-process-error',{..._0x1cc155});}}}_0x4e10c5?.['setActivityError'](_0x1cc155['message']);throw _0x1cc155;}finally{_0x4e10c5?.['endActivitySpan'](),this['logger']['debug']('hook-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}['doesHook'](){if(this['config']['sleep']){const _0x59ffbe=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return!isNaN(_0x59ffbe)&&Number(_0x59ffbe)>0x0;}return!!this['config']['hook']?.['topic'];}async['doHook'](_0x1769cb){const _0x122a0f=this['store']['transact']();await this['registerHook'](enums_1['HMSH_IS_CLUSTER']?undefined:_0x122a0f),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x122a0f),await collator_1['CollatorService']['authorizeReentry'](this,_0x122a0f),await this['setStatus'](0x0,_0x122a0f),await _0x122a0f['exec'](),_0x1769cb['mapActivityAttributes']();}async['doPassThrough'](_0x172014){const _0x1fbbd5=this['store']['transact']();let _0x55925e;this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x1fbbd5),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x1fbbd5),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x1fbbd5),_0x55925e=await _0x1fbbd5['exec'](),_0x172014['mapActivityAttributes']();const _0x3b7c68=this['resolveStatus'](_0x55925e),_0x2ed1b9={'app.job.jss':_0x3b7c68},_0x53b7e1=await this['transition'](this['adjacencyList'],_0x3b7c68);_0x53b7e1['length']&&(_0x2ed1b9['app.activity.mids']=_0x53b7e1['join'](',')),_0x172014['setActivityAttributes'](_0x2ed1b9);}async['getHookRule'](_0x80c3e){const _0x36a77a=await this['store']['getHookRules']();return _0x36a77a?.[_0x80c3e]?.[0x0];}async['registerHook'](_0x5b1827){if(this['config']['hook']?.['topic'])return await this['engine']['taskService']['registerWebHook'](this['config']['hook']['topic'],this['context'],this['resolveDad'](),this['context']['metadata']['expire'],_0x5b1827);else{if(this['config']['sleep']){const _0x5aeed4=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return await this['engine']['taskService']['registerTimeHook'](this['context']['metadata']['jid'],this['context']['metadata']['gid'],''+this['metadata']['aid']+(this['metadata']['dad']||''),'sleep',_0x5aeed4,this['metadata']['dad']||''),this['context']['metadata']['jid'];}}}async['processWebHookEvent'](_0xda90e1=stream_1['StreamStatus']['SUCCESS'],_0x45e8ab=0xc8){this['logger']['debug']('hook-process-web-hook-event',{'topic':this['config']['hook']['topic'],'aid':this['metadata']['aid'],'status':_0xda90e1,'code':_0x45e8ab});const _0x5c7b55=new task_1['TaskService'](this['store'],this['logger']),_0x56c31={...this['data']},_0x1cde7e=await _0x5c7b55['processWebHookSignal'](this['config']['hook']['topic'],_0x56c31);if(_0x1cde7e){const [_0x19e6aa,_0x252960,_0x149d37,_0x1cb98b]=_0x1cde7e;this['context']['metadata']['jid']=_0x19e6aa,this['context']['metadata']['gid']=_0x1cb98b,this['context']['metadata']['dad']=_0x149d37,await this['processEvent'](_0xda90e1,_0x45e8ab,'hook'),_0x45e8ab===0xc8&&await _0x5c7b55['deleteWebHookSignal'](this['config']['hook']['topic'],_0x56c31);}}async['processTimeHookEvent'](_0x34ba3c){this['logger']['debug']('hook-process-time-hook-event',{'jid':_0x34ba3c,'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']}),await this['processEvent'](stream_1['StreamStatus']['SUCCESS'],0xc8,'hook');}}exports['Hook']=Hook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function _0x29f3(_0x53268d,_0x137fb6){const _0x4c76ca=_0x4c76();return _0x29f3=function(_0x29f3f1,_0x3538d9){_0x29f3f1=_0x29f3f1-0x166;let _0x4ffde5=_0x4c76ca[_0x29f3f1];return _0x4ffde5;},_0x29f3(_0x53268d,_0x137fb6);}(function(_0x9dce46,_0x3ef7ee){const _0x15077c=_0x29f3,_0x269de1=_0x9dce46();while(!![]){try{const _0x43593a=parseInt(_0x15077c(0x16a))/0x1+-parseInt(_0x15077c(0x16c))/0x2+parseInt(_0x15077c(0x16b))/0x3*(-parseInt(_0x15077c(0x16d))/0x4)+-parseInt(_0x15077c(0x168))/0x5*(-parseInt(_0x15077c(0x166))/0x6)+-parseInt(_0x15077c(0x167))/0x7+parseInt(_0x15077c(0x16e))/0x8+parseInt(_0x15077c(0x169))/0x9;if(_0x43593a===_0x3ef7ee)break;else _0x269de1['push'](_0x269de1['shift']());}catch(_0x3897e6){_0x269de1['push'](_0x269de1['shift']());}}}(_0x4c76,0x7c8f7));function _0x4c76(){const _0x12f8a3=['6dFuyhw','1360710BEyNWD','839244ZJJeOr','6466048pnIxog','54ivCDuR','1288063DWUtQT','133685bpIrgU','2707812hHtcXM','444428cvihbR'];_0x4c76=function(){return _0x12f8a3;};return _0x4c76();}Object['defineProperty'](exports,'__esModule',{'value':!![]});const activity_1=require('./activity'),await_1=require('./await'),cycle_1=require('./cycle'),hook_1=require('./hook'),interrupt_1=require('./interrupt'),signal_1=require('./signal'),trigger_1=require('./trigger'),worker_1=require('./worker');exports['default']={'activity':activity_1['Activity'],'await':await_1['Await'],'cycle':cycle_1['Cycle'],'hook':hook_1['Hook'],'interrupt':interrupt_1['Interrupt'],'signal':signal_1['Signal'],'trigger':trigger_1['Trigger'],'worker':worker_1['Worker']};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x18431f,_0x5d725d){const _0x1fd913=_0x5b97,_0x44ee78=_0x18431f();while(!![]){try{const _0x1451a8=parseInt(_0x1fd913(0x14c))/0x1+parseInt(_0x1fd913(0x14a))/0x2*(parseInt(_0x1fd913(0x151))/0x3)+parseInt(_0x1fd913(0x14b))/0x4+parseInt(_0x1fd913(0x153))/0x5*(parseInt(_0x1fd913(0x14e))/0x6)+-parseInt(_0x1fd913(0x150))/0x7*(-parseInt(_0x1fd913(0x14f))/0x8)+parseInt(_0x1fd913(0x14d))/0x9+-parseInt(_0x1fd913(0x152))/0xa;if(_0x1451a8===_0x5d725d)break;else _0x44ee78['push'](_0x44ee78['shift']());}catch(_0x372862){_0x44ee78['push'](_0x44ee78['shift']());}}}(_0x19f0,0x9125b));function _0x19f0(){const _0x5a245a=['2966112KbpNpi','46156FmfUgc','5668488mHZQkY','6eLkLOj','1432TFTjxy','22960GGAkxZ','713598zSYAMd','26858630KOMBFd','5189420iJxIzG','2FIYUJa'];_0x19f0=function(){return _0x5a245a;};return _0x19f0();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Interrupt']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');function _0x5b97(_0x3d412c,_0x24910f){const _0x19f09f=_0x19f0();return _0x5b97=function(_0x5b973e,_0x13d41e){_0x5b973e=_0x5b973e-0x14a;let _0x33abb8=_0x19f09f[_0x5b973e];return _0x33abb8;},_0x5b97(_0x3d412c,_0x24910f);}class Interrupt extends activity_1['Activity']{constructor(_0x44a653,_0x5ed2e6,_0x2dd922,_0x17ee47,_0x40b2c3,_0x2906ec){super(_0x44a653,_0x5ed2e6,_0x2dd922,_0x17ee47,_0x40b2c3,_0x2906ec);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x5f356d;try{await this['verifyEntry'](),_0x5f356d=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x5f356d['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0x5f356d):await this['interruptAnother'](_0x5f356d);}catch(_0x98f106){if(_0x98f106 instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0x98f106});return;}else{if(_0x98f106 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x98f106});return;}else{if(_0x98f106 instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0x98f106});return;}else{if(_0x98f106 instanceof errors_1['CollationError']){if(_0x98f106['fault']==='duplicate'){this['logger']['info']('interrupt-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('interrupt-collation-error',{..._0x98f106});}else this['logger']['error']('interrupt-process-error',{..._0x98f106});}}}_0x5f356d?.['setActivityError'](_0x98f106['message']);throw _0x98f106;}finally{_0x5f356d?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x2e8ff7){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x29f3b3=await this['interrupt']();_0x2e8ff7['mapActivityAttributes']();const _0x566af1=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x566af1),await this['setStatus'](-0x1,_0x566af1);const _0x4dccbc=await _0x566af1['exec'](),_0x2d7c9f=this['resolveStatus'](_0x4dccbc);return _0x2e8ff7['setActivityAttributes']({'app.activity.mid':_0x29f3b3,'app.job.jss':_0x2d7c9f}),this['context']['metadata']['aid'];}async['interruptAnother'](_0xb8316a){const _0x1648ae=await this['interrupt'](),_0xbb7019={'app.activity.mid':_0x1648ae};_0xb8316a['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x3e0577=this['store']['transact']();await this['setState'](_0x3e0577);}const _0x34cd2e=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x34cd2e),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x34cd2e);const _0x4c8bb7=await _0x34cd2e['exec'](),_0xc4230f=this['resolveStatus'](_0x4c8bb7);_0xbb7019['app.job.jss']=_0xc4230f;const _0x553466=await this['transition'](this['adjacencyList'],_0xc4230f);return _0x553466['length']&&(_0xbb7019['app.activity.mids']=_0x553466['join'](',')),_0xb8316a['setActivityAttributes'](_0xbb7019),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0xd15168=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0xd15168==this['context']['metadata']['jid'];}['resolveInterruptOptions'](){return{'reason':this['config']['reason']!==undefined?pipe_1['Pipe']['resolve'](this['config']['reason'],this['context']):undefined,'throw':this['config']['throw']!==undefined?pipe_1['Pipe']['resolve'](this['config']['throw'],this['context']):undefined,'descend':this['config']['descend']!==undefined?pipe_1['Pipe']['resolve'](this['config']['descend'],this['context']):undefined,'code':this['config']['code']!==undefined?pipe_1['Pipe']['resolve'](this['config']['code'],this['context']):undefined,'expire':this['config']['expire']!==undefined?pipe_1['Pipe']['resolve'](this['config']['expire'],this['context']):undefined,'stack':this['config']['stack']!==undefined?pipe_1['Pipe']['resolve'](this['config']['stack'],this['context']):undefined};}async['interrupt'](){const _0x5c8ffb=this['resolveInterruptOptions']();return await this['engine']['interrupt'](this['config']['topic']!==undefined?pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']):this['context']['metadata']['tpc'],this['config']['target']!==undefined?pipe_1['Pipe']['resolve'](this['config']['target'],this['context']):this['context']['metadata']['jid'],_0x5c8ffb);}}exports['Interrupt']=Interrupt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x14ef2f,_0xf117ca){const _0x199384=_0x248f,_0x1e3b48=_0x14ef2f();while(!![]){try{const _0x4c6353=-parseInt(_0x199384(0xc1))/0x1+parseInt(_0x199384(0xc4))/0x2+-parseInt(_0x199384(0xc3))/0x3+-parseInt(_0x199384(0xc7))/0x4*(-parseInt(_0x199384(0xc8))/0x5)+parseInt(_0x199384(0xc6))/0x6+parseInt(_0x199384(0xc0))/0x7+-parseInt(_0x199384(0xc2))/0x8*(parseInt(_0x199384(0xc5))/0x9);if(_0x4c6353===_0xf117ca)break;else _0x1e3b48['push'](_0x1e3b48['shift']());}catch(_0xa79529){_0x1e3b48['push'](_0x1e3b48['shift']());}}}(_0x49a6,0x782d7));function _0x49a6(){const _0x50fe88=['789044zMwvHC','8kxRLYZ','768372rCtPSw','1395874OxBahv','7762581RJXXCT','2005836hRouSK','279644LAInin','55eymnbk','4190620KRTwUa'];_0x49a6=function(){return _0x50fe88;};return _0x49a6();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Signal']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');function _0x248f(_0x2973b6,_0x55a09e){const _0x49a6cb=_0x49a6();return _0x248f=function(_0x248f0c,_0x48aa59){_0x248f0c=_0x248f0c-0xc0;let _0x1e2193=_0x49a6cb[_0x248f0c];return _0x1e2193;},_0x248f(_0x2973b6,_0x55a09e);}class Signal extends activity_1['Activity']{constructor(_0x5e81cb,_0x56d3c1,_0x47d13e,_0xbc58b,_0x470555,_0x4a430a){super(_0x5e81cb,_0x56d3c1,_0x47d13e,_0xbc58b,_0x470555,_0x4a430a);}async['process'](){this['logger']['debug']('signal-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x559f72;try{await this['verifyEntry'](),_0x559f72=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x559f72['startActivitySpan'](this['leg']);const _0x3d017c=this['store']['transact']();this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x3d017c),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x3d017c),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x3d017c);const _0x532987=await _0x3d017c['exec']();this['config']['subtype']==='all'?await this['hookAll']():await this['hookOne']();const _0x38f489=this['resolveStatus'](_0x532987),_0x503536={'app.job.jss':_0x38f489},_0x377966=await this['transition'](this['adjacencyList'],_0x38f489);return _0x377966['length']&&(_0x503536['app.activity.mids']=_0x377966['join'](',')),_0x559f72['mapActivityAttributes'](),_0x559f72['setActivityAttributes'](_0x503536),this['context']['metadata']['aid'];}catch(_0x16954c){if(_0x16954c instanceof errors_1['InactiveJobError']){this['logger']['error']('signal-inactive-job-error',{..._0x16954c});return;}else{if(_0x16954c instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x16954c});return;}else{if(_0x16954c instanceof errors_1['GetStateError']){this['logger']['error']('signal-get-state-error',{..._0x16954c});return;}else{if(_0x16954c instanceof errors_1['CollationError']){if(_0x16954c['fault']==='duplicate'){this['logger']['info']('signal-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('signal-collation-error',{..._0x16954c});}else this['logger']['error']('signal-process-error',{..._0x16954c});}}}_0x559f72?.['setActivityError'](_0x16954c['message']);throw _0x16954c;}finally{_0x559f72?.['endActivitySpan'](),this['logger']['debug']('signal-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}['mapSignalData'](){if(this['config']['signal']?.['maps']){const _0x5c58a1=new mapper_1['MapperService'](this['config']['signal']['maps'],this['context']);return _0x5c58a1['mapRules']();}}['mapResolverData'](){if(this['config']['resolver']?.['maps']){const _0x3918f2=new mapper_1['MapperService'](this['config']['resolver']['maps'],this['context']);return _0x3918f2['mapRules']();}}async['hookOne'](){const _0x82015a=pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']),_0x2b9d17=this['mapSignalData'](),_0x2f9827=pipe_1['Pipe']['resolve'](this['config']['status'],this['context']),_0x555e4c=pipe_1['Pipe']['resolve'](this['config']['code'],this['context']);return await this['engine']['hook'](_0x82015a,_0x2b9d17,_0x2f9827,_0x555e4c);}async['hookAll'](){const _0x1123cd=this['mapSignalData'](),_0x8ba19a=this['mapResolverData']();this['config']['scrub']&&(_0x8ba19a['scrub']=!![]);const _0x4a6112=pipe_1['Pipe']['resolve'](this['config']['key_name'],this['context']),_0x3551eb=pipe_1['Pipe']['resolve'](this['config']['key_value'],this['context']),_0x451794=[_0x4a6112+':'+_0x3551eb];return await this['engine']['hookAll'](this['config']['topic'],_0x1123cd,_0x8ba19a,_0x451794);}}exports['Signal']=Signal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x587770,_0x48917d){const _0x24accc=_0x354c,_0x12cdb1=_0x587770();while(!![]){try{const _0x51df2a=parseInt(_0x24accc(0x1a3))/0x1+-parseInt(_0x24accc(0x1ac))/0x2*(-parseInt(_0x24accc(0x1aa))/0x3)+parseInt(_0x24accc(0x1a4))/0x4*(-parseInt(_0x24accc(0x1a8))/0x5)+-parseInt(_0x24accc(0x1a5))/0x6*(parseInt(_0x24accc(0x1ae))/0x7)+-parseInt(_0x24accc(0x1a7))/0x8*(-parseInt(_0x24accc(0x1ab))/0x9)+parseInt(_0x24accc(0x1ad))/0xa+parseInt(_0x24accc(0x1a6))/0xb*(parseInt(_0x24accc(0x1a9))/0xc);if(_0x51df2a===_0x48917d)break;else _0x12cdb1['push'](_0x12cdb1['shift']());}catch(_0x20ee66){_0x12cdb1['push'](_0x12cdb1['shift']());}}}(_0xeb40,0x454ab));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Trigger']=void 0x0;function _0xeb40(){const _0x19b86b=['3OAxUyB','153APYCeA','736282eTELYH','770990EwxCBV','48111Tdaeti','205269hbNiQC','1183928oZOpti','474KPsUFK','72952jiYSDv','38104luAikv','5RxWaRo','708dKhrPI'];_0xeb40=function(){return _0x19b86b;};return _0xeb40();}const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),pipe_1=require('../pipe'),reporter_1=require('../reporter'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Trigger extends activity_1['Activity']{constructor(_0x360b26,_0x25b693,_0x49d262,_0x120129,_0x3b70e2,_0x5ca404){super(_0x360b26,_0x25b693,_0x49d262,_0x120129,_0x3b70e2,_0x5ca404);}async['process'](_0x35e519){this['logger']['debug']('trigger-process',{'subscribes':this['config']['subscribes']});let _0x9fdd53;try{this['setLeg'](0x2),await this['getState'](),_0x9fdd53=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x9fdd53['startJobSpan'](),_0x9fdd53['startActivitySpan'](this['leg']),this['mapJobData'](),this['adjacencyList']=await this['filterAdjacent']();const _0x3b7a3c=this['initStatus'](_0x35e519,this['adjacencyList']['length']);await this['setStateNX'](_0x3b7a3c),await this['setStatus'](_0x3b7a3c),this['bindSearchData'](_0x35e519),this['bindMarkerData'](_0x35e519);const _0x48356b=this['store']['transact']();await this['setState'](_0x48356b),await this['setStats'](_0x48356b);_0x35e519?.['pending']&&await this['setExpired'](_0x35e519?.['pending'],_0x48356b);await collator_1['CollatorService']['notarizeInception'](this,this['context']['metadata']['guid'],_0x48356b),await _0x48356b['exec'](),this['execAdjacentParent'](),_0x9fdd53['mapActivityAttributes']();const _0x31c243=Number(this['context']['metadata']['js']);_0x9fdd53['setJobAttributes']({'app.job.jss':_0x31c243});const _0x50b49a={'app.job.jss':_0x31c243};return await this['transitionAndLogAdjacent'](_0x35e519,_0x31c243,_0x50b49a),_0x9fdd53['setActivityAttributes'](_0x50b49a),this['context']['metadata']['jid'];}catch(_0x217829){_0x9fdd53?.['setActivityError'](_0x217829['message']);if(_0x217829 instanceof errors_1['DuplicateJobError']){await(0x0,utils_1['sleepFor'])(0x3e8);const _0x3e6d5c=await collator_1['CollatorService']['isInceptionOverage'](this,this['context']['metadata']['guid']);if(_0x3e6d5c){this['logger']['info']('trigger-collation-overage',{'job_id':_0x217829['jobId'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('duplicate-job-error',{'job_id':_0x217829['jobId'],'guid':this['context']['metadata']['guid']});}else this['logger']['error']('trigger-process-error',{..._0x217829});throw _0x217829;}finally{_0x9fdd53?.['endJobSpan'](),_0x9fdd53?.['endActivitySpan'](),this['logger']['debug']('trigger-process-end',{'subscribes':this['config']['subscribes'],'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid']});}}async['transitionAndLogAdjacent'](_0x5d76fd={},_0x1e1266,_0x367e6e){if(isNaN(_0x5d76fd['pending'])){const _0x4ee9ba=await this['transition'](this['adjacencyList'],_0x1e1266);_0x4ee9ba['length']&&(_0x367e6e['app.activity.mids']=_0x4ee9ba['join'](','));}}['initStatus'](_0x2bcc63={},_0x1c6c88){if(_0x2bcc63['pending'])return-0x1;return _0x1c6c88;}async['setExpired'](_0x1d50ba,_0x58e5db){await this['store']['expireJob'](this['context']['metadata']['jid'],_0x1d50ba,_0x58e5db);}['safeKey'](_0x5f56b7){return'_'+_0x5f56b7;}['bindSearchData'](_0x54806a){_0x54806a?.['search']&&Object['keys'](_0x54806a['search'])['forEach'](_0x5334cd=>{this['context']['data'][this['safeKey'](_0x5334cd)]=_0x54806a['search'][_0x5334cd]['toString']();});}['bindMarkerData'](_0x1adcc3){_0x1adcc3?.['marker']&&Object['keys'](_0x1adcc3['marker'])['forEach'](_0x13678f=>{_0x13678f['startsWith']('-')&&(this['context']['data'][_0x13678f]=_0x1adcc3['marker'][_0x13678f]['toString']());});}async['setStatus'](_0x44b679){this['context']['metadata']['js']=_0x44b679;}async['execAdjacentParent'](){if(this['context']['metadata']['px']){const _0x23cebc=(0x0,utils_1['formatISODate'])(new Date()),_0x1e26dc={'metadata':this['context']['metadata'],'data':{'job_id':this['context']['metadata']['jid'],'jc':_0x23cebc,'ju':_0x23cebc}};await this['engine']['execAdjacentParent'](this['context'],_0x1e26dc);}}['createInputContext'](){const _0x369e17={[this['metadata']['aid']]:{'input':{'data':this['data']}},'$self':{'input':{'data':this['data']},'output':{'data':this['data']}}};return _0x369e17;}async['getState'](){const _0x48f4f8=this['createInputContext'](),_0x245ae2=this['resolveJobId'](_0x48f4f8),_0x5d7cd2=this['resolveJobKey'](_0x48f4f8),_0x7d7d28=(0x0,utils_1['formatISODate'])(new Date()),{id:_0x2f2114,version:_0x1170f9}=await this['engine']['getVID']();this['initDimensionalAddress'](collator_1['CollatorService']['getDimensionalSeed']());const _0x29ae11={...this['metadata'],'jid':_0x245ae2,'key':_0x5d7cd2,'as':collator_1['CollatorService']['getTriggerSeed']()};this['context']={'metadata':{...this['metadata'],'gid':(0x0,utils_1['guid'])(),'ngn':this['context']['metadata']['ngn'],'pj':this['context']['metadata']['pj'],'pg':this['context']['metadata']['pg'],'pd':this['context']['metadata']['pd'],'pa':this['context']['metadata']['pa'],'px':this['context']['metadata']['px'],'app':_0x2f2114,'vrs':_0x1170f9,'tpc':this['config']['subscribes'],'trc':this['context']['metadata']['trc'],'spn':this['context']['metadata']['spn'],'guid':this['context']['metadata']['guid'],'jid':_0x245ae2,'dad':collator_1['CollatorService']['getDimensionalSeed'](),'key':_0x5d7cd2,'jc':_0x7d7d28,'ju':_0x7d7d28,'ts':(0x0,utils_1['getTimeSeries'])(this['resolveGranularity']()),'js':0x0},'data':{},[this['metadata']['aid']]:{'input':{'data':this['data'],'metadata':_0x29ae11},'output':{'data':this['data'],'metadata':_0x29ae11},'settings':{'data':{}},'errors':{'data':{}}}},this['context']['$self']=this['context'][this['metadata']['aid']],this['context']['$job']=this['context'];}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0xa7b9d1=>'metadata/'+_0xa7b9d1);}['bindActivityMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['ACTIVITY']['KEYS']['map'](_0x50b8e9=>'output/metadata/'+_0x50b8e9);}['resolveGranularity'](){return this['config']['stats']?.['granularity']||reporter_1['ReporterService']['DEFAULT_GRANULARITY'];}['getJobStatus'](){return this['context']['metadata']['js'];}['resolveJobId'](_0xe9a37f){const _0x3b32a5=this['config']['stats']?.['id'];return _0x3b32a5?pipe_1['Pipe']['resolve'](_0x3b32a5,_0xe9a37f):(0x0,utils_1['guid'])();}['resolveJobKey'](_0x1edd9f){const _0x1e9638=this['config']['stats']?.['key'];return _0x1e9638?pipe_1['Pipe']['resolve'](_0x1e9638,_0x1edd9f):'';}async['setStateNX'](_0x14765d){const _0x2c657b=this['context']['metadata']['jid'];if(!await this['store']['setStateNX'](_0x2c657b,this['engine']['appId'],_0x14765d))throw new errors_1['DuplicateJobError'](_0x2c657b);}async['setStats'](_0x5e3fac){const _0x139c5b=this['context']['metadata'];if(_0x139c5b['key']&&this['config']['stats']?.['measures']){const _0x20d500=await this['engine']['getVID'](),_0x1d64da=new reporter_1['ReporterService'](_0x20d500,this['store'],this['logger']);await this['store']['setStats'](_0x139c5b['key'],_0x139c5b['jid'],_0x139c5b['ts'],_0x1d64da['resolveTriggerStatistics'](this['config'],this['context']),_0x20d500,_0x5e3fac);}}}function _0x354c(_0x43dec1,_0x22410a){const _0xeb405d=_0xeb40();return _0x354c=function(_0x354c66,_0x3cc157){_0x354c66=_0x354c66-0x1a3;let _0x1bd291=_0xeb405d[_0x354c66];return _0x1bd291;},_0x354c(_0x43dec1,_0x22410a);}exports['Trigger']=Trigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function _0x749d(){const _0x4b9804=['3274894qKSiWZ','550748KFElxW','2825226vrbaoc','4077000wbWqUn','709644LMqKSr','3XRkCSF','843046wkqNdd','1607600wKuBVc'];_0x749d=function(){return _0x4b9804;};return _0x749d();}(function(_0x1bb906,_0x2b20f5){const _0x51a133=_0x3d47,_0x1ebe95=_0x1bb906();while(!![]){try{const _0x1e5466=parseInt(_0x51a133(0x1e4))/0x1+parseInt(_0x51a133(0x1e2))/0x2+parseInt(_0x51a133(0x1e3))/0x3*(-parseInt(_0x51a133(0x1df))/0x4)+-parseInt(_0x51a133(0x1e1))/0x5+-parseInt(_0x51a133(0x1e0))/0x6+parseInt(_0x51a133(0x1de))/0x7+parseInt(_0x51a133(0x1dd))/0x8;if(_0x1e5466===_0x2b20f5)break;else _0x1ebe95['push'](_0x1ebe95['shift']());}catch(_0x18dc7f){_0x1ebe95['push'](_0x1ebe95['shift']());}}}(_0x749d,0x6c14e));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Worker']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');function _0x3d47(_0x204128,_0x5562c3){const _0x749d2c=_0x749d();return _0x3d47=function(_0x3d47db,_0x207de9){_0x3d47db=_0x3d47db-0x1dd;let _0x864a7=_0x749d2c[_0x3d47db];return _0x864a7;},_0x3d47(_0x204128,_0x5562c3);}class Worker extends activity_1['Activity']{constructor(_0x5b7ffc,_0xbb4b19,_0x63f0f0,_0x80b13,_0x2e0f95,_0x35f05c){super(_0x5b7ffc,_0xbb4b19,_0x63f0f0,_0x80b13,_0x2e0f95,_0x35f05c);}async['process'](){this['logger']['debug']('worker-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x24e95c;try{await this['verifyEntry'](),_0x24e95c=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x24e95c['startActivitySpan'](this['leg']),this['mapInputData']();const _0x3461a2=this['store']['transact'](),_0x3f6b2b=await this['execActivity'](_0x3461a2);await collator_1['CollatorService']['authorizeReentry'](this,_0x3461a2),await this['setState'](_0x3461a2),await this['setStatus'](0x0,_0x3461a2);const _0x5b4621=await _0x3461a2['exec']();_0x24e95c['mapActivityAttributes']();const _0x216d5c=this['resolveStatus'](_0x5b4621);return _0x24e95c['setActivityAttributes']({'app.activity.mid':_0x3f6b2b,'app.job.jss':_0x216d5c}),this['context']['metadata']['aid'];}catch(_0xa35d63){if(_0xa35d63 instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0xa35d63});return;}else{if(_0xa35d63 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0xa35d63});return;}else{if(_0xa35d63 instanceof errors_1['GetStateError']){this['logger']['error']('worker-get-state-error',{..._0xa35d63});return;}else{if(_0xa35d63 instanceof errors_1['CollationError']){if(_0xa35d63['fault']==='duplicate'){this['logger']['info']('worker-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('worker-collation-error',{..._0xa35d63});}else this['logger']['error']('worker-process-error',{..._0xa35d63});}}}_0x24e95c?.['setActivityError'](_0xa35d63['message']);throw _0xa35d63;}finally{_0x24e95c?.['endActivitySpan'](),this['logger']['debug']('worker-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x2a9226){const _0x4d5b12=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x104fc1={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':this['metadata']['dad'],'aid':this['metadata']['aid'],'topic':_0x4d5b12,'spn':this['context']['$self']['output']['metadata']['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context']['data']};return this['config']['retry']&&(_0x104fc1['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](_0x4d5b12,_0x104fc1,_0x2a9226);}}exports['Worker']=Worker;
|