@hotmeshio/hotmesh 0.3.16 → 0.3.17
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 +9 -4
- package/build/modules/key.js +1 -1
- package/build/modules/utils.js +1 -1
- package/build/package.json +3 -2
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.js +1 -1
- package/build/services/activities/index.js +1 -1
- package/build/services/activities/interrupt.js +1 -1
- package/build/services/activities/signal.js +1 -1
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.js +1 -1
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.js +1 -1
- package/build/services/mapper/index.js +1 -1
- package/build/services/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.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.js +1 -1
- package/build/services/store/providers/postgres/kvtransaction.js +1 -1
- 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.js +1 -1
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# HotMesh
|
|
2
2
|

|
|
3
3
|
|
|
4
|
-
**HotMesh** offers the power of Temporal.io in a fully serverless architecture.
|
|
4
|
+
**HotMesh** offers the power of [Temporal.io](https://temporal.io) in a fully serverless architecture.
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
<br/>
|
|
@@ -9,10 +9,9 @@
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
11
|
- **Serverless Orchestration**: Orchestrate your microservices without adding infrastructure.
|
|
12
|
-
- **
|
|
13
|
-
- **Decentralized Execution**: Centralized persistence with decentralized execution.
|
|
12
|
+
- **No Vendor Lock-in**: Use your preferred database: *Postgres*, *Redis*, ...
|
|
14
13
|
- **Linear Scalability**: Scale your database to scale your application.
|
|
15
|
-
- **Process Analytics**: Gain process insights with
|
|
14
|
+
- **Process Analytics**: Gain process insights with optional analytics.
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
<br/>
|
|
@@ -725,3 +724,9 @@ Refer to the [hotmeshio/temporal-patterns-typescript](https://github.com/hotmesh
|
|
|
725
724
|
|
|
726
725
|
## Advanced
|
|
727
726
|
The theory that underlies the architecture is applicable to any number of data storage and streaming backends: [A Message-Oriented Approach to Decentralized Process Orchestration](https://zenodo.org/records/12168558).
|
|
727
|
+
|
|
728
|
+
<br/>
|
|
729
|
+
|
|
730
|
+
## Disclaimer
|
|
731
|
+
|
|
732
|
+
This project is not affiliated with, endorsed by, or sponsored by Temporal Technologies, Inc. Temporal is a trademark of Temporal Technologies, Inc., and all references to Temporal and related technologies are for educational and demonstration purposes only.
|
package/build/modules/key.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x217fb8,_0x4697cd){const _0x61fecb=_0x5d64,_0x4e02ca=_0x217fb8();while(!![]){try{const _0x223be5=-parseInt(_0x61fecb(0xba))/0x1*(-parseInt(_0x61fecb(0xc1))/0x2)+parseInt(_0x61fecb(0xbc))/0x3+-parseInt(_0x61fecb(0xbe))/0x4+-parseInt(_0x61fecb(0xc2))/0x5+parseInt(_0x61fecb(0xbf))/0x6*(-parseInt(_0x61fecb(0xbd))/0x7)+parseInt(_0x61fecb(0xc0))/0x8+parseInt(_0x61fecb(0xbb))/0x9;if(_0x223be5===_0x4697cd)break;else _0x4e02ca['push'](_0x4e02ca['shift']());}catch(_0x126415){_0x4e02ca['push'](_0x4e02ca['shift']());}}}(_0x294e,0xd3f92));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['VALSEP']=exports['WEBSEP']=exports['TYPSEP']=exports['KEYSEP']=exports['HMNS']=exports['KeyType']=exports['KeyService']=void 0x0;const hotmesh_1=require('../types/hotmesh');Object['defineProperty'](exports,'KeyType',{'enumerable':!![],'get':function(){return hotmesh_1['KeyType'];}});function _0x294e(){const _0x2e8a7a=['226635OQZRJC','287kKHKfG','763268isTUIn','192576kNCbQF','3007816kLlnqf','2QbMZJm','2145925tGRmUH','606493aMLVmV','15715485cpUprW'];_0x294e=function(){return _0x2e8a7a;};return _0x294e();}function _0x5d64(_0x3c16a2,_0x118b0a){const _0x294ec0=_0x294e();return _0x5d64=function(_0x5d6409,_0x5be7eb){_0x5d6409=_0x5d6409-0xba;let _0xfff89d=_0x294ec0[_0x5d6409];return _0xfff89d;},_0x5d64(_0x3c16a2,_0x118b0a);}const HMNS='hmsh';exports['HMNS']=HMNS;const KEYSEP=':';exports['KEYSEP']=KEYSEP;const VALSEP='::';exports['VALSEP']=VALSEP;const WEBSEP='::';exports['WEBSEP']=WEBSEP;const TYPSEP='::';exports['TYPSEP']=TYPSEP;class KeyService{static['mintKey'](_0x367ba0,_0x4a058d,_0x57077e){switch(_0x4a058d){case hotmesh_1['KeyType']['HOTMESH']:return _0x367ba0;case hotmesh_1['KeyType']['THROTTLE_RATE']:return _0x367ba0+':'+_0x57077e['appId']+':r:';case hotmesh_1['KeyType']['WORK_ITEMS']:return _0x367ba0+':'+_0x57077e['appId']+':w:'+(_0x57077e['scoutType']||'');case hotmesh_1['KeyType']['TIME_RANGE']:return _0x367ba0+':'+_0x57077e['appId']+':t:'+(_0x57077e['timeValue']||'');case hotmesh_1['KeyType']['APP']:return _0x367ba0+':a:'+(_0x57077e['appId']||'');case hotmesh_1['KeyType']['QUORUM']:return _0x367ba0+':'+_0x57077e['appId']+':q:'+(_0x57077e['engineId']||'');case hotmesh_1['KeyType']['JOB_STATE']:return _0x367ba0+':'+_0x57077e['appId']+':j:'+_0x57077e['jobId'];case hotmesh_1['KeyType']['JOB_DEPENDENTS']:return _0x367ba0+':'+_0x57077e['appId']+':d:'+_0x57077e['jobId'];case hotmesh_1['KeyType']['JOB_STATS_GENERAL']:return _0x367ba0+':'+_0x57077e['appId']+':s:'+_0x57077e['jobKey']+':'+_0x57077e['dateTime'];case hotmesh_1['KeyType']['JOB_STATS_MEDIAN']:return _0x367ba0+':'+_0x57077e['appId']+':s:'+_0x57077e['jobKey']+':'+_0x57077e['dateTime']+':'+_0x57077e['facet'];case hotmesh_1['KeyType']['JOB_STATS_INDEX']:return _0x367ba0+':'+_0x57077e['appId']+':s:'+_0x57077e['jobKey']+':'+_0x57077e['dateTime']+':'+_0x57077e['facet'];case hotmesh_1['KeyType']['SCHEMAS']:return _0x367ba0+':'+_0x57077e['appId']+':v:'+_0x57077e['appVersion']+':schemas';case hotmesh_1['KeyType']['SUBSCRIPTIONS']:return _0x367ba0+':'+_0x57077e['appId']+':v:'+_0x57077e['appVersion']+':subscriptions';case hotmesh_1['KeyType']['SUBSCRIPTION_PATTERNS']:return _0x367ba0+':'+_0x57077e['appId']+':v:'+_0x57077e['appVersion']+':transitions';case hotmesh_1['KeyType']['HOOKS']:return _0x367ba0+':'+_0x57077e['appId']+':hooks';case hotmesh_1['KeyType']['SIGNALS']:return _0x367ba0+':'+_0x57077e['appId']+':signals';case hotmesh_1['KeyType']['SYMKEYS']:return _0x367ba0+':'+_0x57077e['appId']+':sym:keys:'+(_0x57077e['activityId']||'');case hotmesh_1['KeyType']['SYMVALS']:return _0x367ba0+':'+_0x57077e['appId']+':sym:vals:';case hotmesh_1['KeyType']['STREAMS']:return _0x367ba0+':'+(_0x57077e['appId']||'')+':x:'+(_0x57077e['topic']||'');default:throw new Error('Invalid\x20key\x20type.');}}static['parseKey'](_0x7c6d8a){const [_0x590fa7,_0x330bb9,_0x3efee2,..._0xaf31dd]=_0x7c6d8a['split'](KEYSEP),_0x2171db=_0xaf31dd['join'](KEYSEP)||'';return{'namespace':_0x590fa7,'app':_0x3efee2==='a'?_0x330bb9:undefined,'entity':_0x3efee2,'id':_0x2171db};}static['reconstituteKey'](_0x4f6509){const {namespace:_0x2c3209,app:_0x449667,entity:_0xabb5a1,id:_0x15bc46}=_0x4f6509;return''+_0x2c3209+KEYSEP+_0x449667+KEYSEP+_0xabb5a1+KEYSEP+(_0x15bc46||'');}static['resolveEntityType'](_0x3d1b66,_0x486ca4=''){switch(_0x3d1b66){case'a':return'applications';case'r':return'throttles';case'w':return _0x486ca4===''?'task_priorities':'roles';case't':return _0x486ca4===''?'task_schedules':'task_lists';case'q':return'events';case'j':return'jobs';case's':return'stats';case'v':return'versions';case'x':return _0x486ca4===''?'streams':'stream_topics';case'hooks':return'signal_patterns';case'signals':return'signal_registry';case'sym':return'symbols';default:return'unknown_entity';}}static['resolveAbbreviation'](_0x33b75a){switch(_0x33b75a){case'applications':return'a';case'throttles':return'r';case'roles':return'w';case'task_schedules':return't';case'task_lists':return't';case'events':return'q';case'jobs':return'j';case'stats':return's';case'versions':return'v';case'streams':return'x';case'signal_patterns':return'hooks';case'signal_registry':return'signals';case'symbols':return'sym';default:return'unknown_entity';}}}exports['KeyService']=KeyService;
|
package/build/modules/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x1f8b74,_0x4ed473){const _0x5c6dcf=_0x10cf,_0x421192=_0x1f8b74();while(!![]){try{const _0x49033b=parseInt(_0x5c6dcf(0x6b))/0x1+parseInt(_0x5c6dcf(0x6a))/0x2+-parseInt(_0x5c6dcf(0x6f))/0x3*(parseInt(_0x5c6dcf(0x6e))/0x4)+parseInt(_0x5c6dcf(0x6d))/0x5+parseInt(_0x5c6dcf(0x68))/0x6+parseInt(_0x5c6dcf(0x67))/0x7+-parseInt(_0x5c6dcf(0x6c))/0x8*(parseInt(_0x5c6dcf(0x69))/0x9);if(_0x49033b===_0x4ed473)break;else _0x421192['push'](_0x421192['shift']());}catch(_0x30dd14){_0x421192['push'](_0x421192['shift']());}}}(_0x2940,0xedcc2));var __importDefault=this&&this['__importDefault']||function(_0x1e1ca5){return _0x1e1ca5&&_0x1e1ca5['__esModule']?_0x1e1ca5:{'default':_0x1e1ca5};};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=_0x35069e=>{const _0x32b1a6=JSON['stringify'](_0x35069e);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x32b1a6)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0xe21a68=os_1['default']['totalmem'](),_0x256ef0=os_1['default']['freemem'](),_0x2a0fe6=_0xe21a68-_0x256ef0,_0x50adb3={'TotalMemoryGB':(_0xe21a68/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x256ef0/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x2a0fe6/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x50adb3;}function _0x10cf(_0x2c41b4,_0x11f0e0){const _0x2940e7=_0x2940();return _0x10cf=function(_0x10cfda,_0x5db4ce){_0x10cfda=_0x10cfda-0x67;let _0xe8bd99=_0x2940e7[_0x10cfda];return _0xe8bd99;},_0x10cf(_0x2c41b4,_0x11f0e0);}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x2ef356){return JSON['parse'](JSON['stringify'](_0x2ef356));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x4a2b91){const _0x3a9569=Math['sin'](_0x4a2b91)*0x2710;return _0x3a9569-Math['floor'](_0x3a9569);}exports['deterministicRandom']=deterministicRandom;function guid(_0x41589d=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x41589d);}exports['guid']=guid;async function sleepFor(_0x959cd3){return new Promise(_0x59511d=>setTimeout(_0x59511d,_0x959cd3));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x1cdc0c=>setImmediate(_0x1cdc0c));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0x354dad){let _0x1259fd;const _0x4a8f3d=new Promise(_0x23887f=>{_0x1259fd=setTimeout(_0x23887f,_0x354dad);});return{'promise':_0x4a8f3d,'timerId':_0x1259fd};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x4b6795){const _0x57a301=Object['getPrototypeOf'](_0x4b6795);if(_0x4b6795['Query']?.['prototype']||Object['keys'](_0x4b6795)['includes']('database'))return'postgres';else{if(_0x4b6795['constructor']&&_0x4b6795['constructor']['name']==='Client')return'nats';else{if('defineCommand'in _0x57a301||Object['keys'](_0x57a301)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x57a301)['includes']('Multi'))return'redis';}}}if(_0x4b6795['constructor']){if(_0x4b6795['constructor']['name']==='Redis'||_0x4b6795['constructor']['name']==='EventEmitter'){if('hset'in _0x4b6795)return'ioredis';}else{if(_0x4b6795['constructor']['name']==='ProviderClient'||_0x4b6795['constructor']['name']==='Commander'){if('HSET'in _0x4b6795)return'redis';}}}let _0x1f9580=null;if(Object['keys'](_0x4b6795)['includes']('connection'))_0x1f9580='postgres';else{if(Object['keys'](_0x4b6795)['includes']('Pipeline'))_0x1f9580='ioredis';else{if(Object['keys'](_0x4b6795)['includes']('createClient'))_0x1f9580='redis';else Object['keys'](_0x4b6795)['includes']('jetstream')&&(_0x1f9580='nats');}}return _0x1f9580;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x38afda){return _0x38afda==='activity'?'hook':_0x38afda;},'providerConfig'(_0x460c56){return _0x460c56?.['connection']??_0x460c56?.['redis']??_0x460c56?.['connections'];},'meshDataConfig'(_0x242657){if(_0x242657?.['connections'])return _0x242657['connections'];return _0x242657?.['connection']??{'class':_0x242657?.['redisClass'],'options':_0x242657?.['redisOptions']};}};function identifyRedisTypeFromClass(_0x5dc712){if(_0x5dc712&&_0x5dc712['name']==='Redis'||_0x5dc712['name']==='EventEmitter')return'ioredis';else{if(_0x5dc712&&'createClient'in _0x5dc712)return'redis';}return null;}exports['identifyRedisTypeFromClass']=identifyRedisTypeFromClass;function matchesStatusCode(_0x403263,_0x155d04){if(typeof _0x155d04==='string'){const _0x3d337f='^'+_0x155d04['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x3d337f)['test'](_0x403263['toString']());}return _0x155d04['test'](_0x403263['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x4a36c2,_0x1406d6){return _0x4a36c2===_0x1406d6;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x21e7fe,_0x1c4389){for(const [_0x101850,_0x6c30cf]of Object['entries'](_0x21e7fe)){if(_0x6c30cf['hasOwnProperty'](_0x1c4389)){const _0x5a4fbc=findTopKey(_0x21e7fe,_0x101850['replace'](/^\./,''));return(_0x5a4fbc||_0x101850)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x34b3db,_0x150f7){for(const [_0x23b76e,_0x2fb8ff]of Object['entries'](_0x34b3db)){if(_0x2fb8ff===_0x150f7)return _0x23b76e;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x1ba39a,_0x1f2fb8,_0x2187b2){const _0x2e359a=await _0x1f2fb8['getTransitions'](_0x2187b2),_0x2a0ec7=await _0x1f2fb8['getSubscriptions'](_0x2187b2),_0x491ca3=findTopKey(_0x2e359a,_0x1ba39a),_0x207555=findSubscriptionForTrigger(_0x2a0ec7,_0x491ca3);return _0x207555;}exports['getSubscriptionTopic']=getSubscriptionTopic;function _0x2940(){const _0x26f952=['4683903hSTJpi','5892798mSXIZV','2924838wqbvhu','571326orCBoQ','1054245jnhCqx','48wLwmxA','6230325XZfrau','60bDNqWr','262665KTLYEb'];_0x2940=function(){return _0x26f952;};return _0x2940();}function getTimeSeries(_0x2ac3d7){if(_0x2ac3d7['toString']()==='infinity')return'0';const _0x2c3e76=new Date(),_0x1e46c1=_0x2ac3d7['slice'](-0x1),_0x11e778=parseInt(_0x2ac3d7['slice'](0x0,-0x1),0xa);if(_0x1e46c1==='m'){const _0x563f74=Math['floor'](_0x2c3e76['getMinutes']()/_0x11e778)*_0x11e778;_0x2c3e76['setUTCMinutes'](_0x563f74,0x0,0x0);}else _0x1e46c1==='h'&&_0x2c3e76['setUTCMinutes'](0x0,0x0,0x0);return _0x2c3e76['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x45c550){const _0x4eb390=_0x45c550 instanceof Date?_0x45c550:new Date(_0x45c550);return _0x4eb390['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x160b58){const _0x559366='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x16e9fc=_0x559366['length'];if(_0x160b58<0x0||_0x160b58>=Math['pow'](_0x16e9fc,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x5d6647,_0x33629c]=divmod(_0x160b58,_0x16e9fc),[_0x112fed,_0x36f767]=divmod(_0x5d6647,_0x16e9fc);return _0x559366[_0x112fed]+_0x559366[_0x33629c]+_0x559366[_0x36f767];}exports['getSymKey']=getSymKey;function getSymVal(_0x8ebcd){const _0x548d93='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x1b5395=_0x548d93['length'];if(_0x8ebcd<0x0||_0x8ebcd>=Math['pow'](_0x1b5395,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x54af93,_0x5439ad]=divmod(_0x8ebcd,_0x1b5395);return _0x548d93[_0x54af93]+_0x548d93[_0x5439ad];}exports['getSymVal']=getSymVal;function divmod(_0xeacae,_0x1b627e){return[Math['floor'](_0xeacae/_0x1b627e),_0xeacae%_0x1b627e];}function getIndexedHash(_0x108e34,_0x1cd8eb){const _0x552c04=_0x108e34[_0x1cd8eb]||0x0,_0x8cfdf5={..._0x108e34};return delete _0x8cfdf5[_0x1cd8eb],[_0x552c04,_0x8cfdf5];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x538bb7,_0x43c508){const _0x38bd62=_0x43c508['split']('/');let _0x71c1dd=_0x538bb7;for(const _0x40adc5 of _0x38bd62){if(_0x71c1dd[_0x40adc5]!==undefined)_0x71c1dd=_0x71c1dd[_0x40adc5];else return undefined;}return _0x71c1dd;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x4a6f29){const _0x172556={};for(const _0x51531a in _0x4a6f29){if(_0x4a6f29[_0x51531a]===undefined)continue;const _0x41b182=_0x51531a['split']('/');let _0x549449=_0x172556;for(let _0x3fd7cb=0x0;_0x3fd7cb<_0x41b182['length'];_0x3fd7cb++){_0x3fd7cb===_0x41b182['length']-0x1?_0x549449[_0x41b182[_0x3fd7cb]]=_0x4a6f29[_0x51531a]:(_0x549449[_0x41b182[_0x3fd7cb]]=_0x549449[_0x41b182[_0x3fd7cb]]||{},_0x549449=_0x549449[_0x41b182[_0x3fd7cb]]);}}return _0x172556;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x3551bf){const _0x1de96c=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x1de96c['test'](_0x3551bf);}exports['isValidCron']=isValidCron;const s=_0xe18acf=>{return(0x0,ms_1['default'])(_0xe18acf)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x4d8b82=>{try{return JSON['parse'](_0x4d8b82);}catch(_0x3c6ce1){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x3c6ce1});throw _0x3c6ce1;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0x2b8013=>{return Array['isArray'](_0x2b8013)&&Array['isArray'](_0x2b8013[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x3cad2c=>{const _0x2d7c51=[];let _0x10b407;for(let _0x4d0ba5=0x1;_0x4d0ba5<_0x3cad2c['length'];_0x4d0ba5++){const _0x199c20=_0x3cad2c[_0x4d0ba5],_0xa9afd6={};if(Array['isArray'](_0x199c20)){for(let _0x59c246=0x0;_0x59c246<_0x199c20['length'];_0x59c246+=0x2){const _0x4b010e=_0x199c20[_0x59c246],_0x77ac96=_0x199c20[_0x59c246+0x1];_0xa9afd6[_0x4b010e]=_0x77ac96;}_0x10b407&&(_0xa9afd6['$']=_0x10b407),_0x2d7c51['push'](_0xa9afd6),_0x10b407=undefined;}else _0x10b407=_0x199c20;}return _0x2d7c51;};exports['arrayToHash']=arrayToHash;
|
|
1
|
+
'use strict';(function(_0x39a741,_0x4f06aa){const _0x2f4c6b=_0x3b19,_0x32d838=_0x39a741();while(!![]){try{const _0x216418=parseInt(_0x2f4c6b(0x1c2))/0x1*(parseInt(_0x2f4c6b(0x1c9))/0x2)+-parseInt(_0x2f4c6b(0x1c7))/0x3*(parseInt(_0x2f4c6b(0x1be))/0x4)+parseInt(_0x2f4c6b(0x1c6))/0x5*(-parseInt(_0x2f4c6b(0x1c0))/0x6)+parseInt(_0x2f4c6b(0x1c4))/0x7*(-parseInt(_0x2f4c6b(0x1bd))/0x8)+-parseInt(_0x2f4c6b(0x1c5))/0x9+-parseInt(_0x2f4c6b(0x1c1))/0xa*(parseInt(_0x2f4c6b(0x1c8))/0xb)+parseInt(_0x2f4c6b(0x1bf))/0xc*(parseInt(_0x2f4c6b(0x1c3))/0xd);if(_0x216418===_0x4f06aa)break;else _0x32d838['push'](_0x32d838['shift']());}catch(_0x1bb3d4){_0x32d838['push'](_0x32d838['shift']());}}}(_0x5e93,0x5f617));var __importDefault=this&&this['__importDefault']||function(_0x45c4e6){return _0x45c4e6&&_0x45c4e6['__esModule']?_0x45c4e6:{'default':_0x45c4e6};};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=_0x3d74b5=>{const _0x57d5f4=JSON['stringify'](_0x3d74b5);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x57d5f4)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x46870c=os_1['default']['totalmem'](),_0xecf354=os_1['default']['freemem'](),_0x23fddb=_0x46870c-_0xecf354,_0x33f834={'TotalMemoryGB':(_0x46870c/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0xecf354/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x23fddb/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x33f834;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x291d68){return JSON['parse'](JSON['stringify'](_0x291d68));}exports['deepCopy']=deepCopy;function deterministicRandom(_0xd5cb12){const _0x446ca9=Math['sin'](_0xd5cb12)*0x2710;return _0x446ca9-Math['floor'](_0x446ca9);}exports['deterministicRandom']=deterministicRandom;function guid(_0x3a6c8f=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x3a6c8f);}exports['guid']=guid;async function sleepFor(_0x182d8a){return new Promise(_0x41e55d=>setTimeout(_0x41e55d,_0x182d8a));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x56a76f=>setImmediate(_0x56a76f));}exports['sleepImmediate']=sleepImmediate;function _0x5e93(){const _0x433b8d=['15942Bgyvxj','231JchcFS','8eQHGLD','349208ZiiuIe','284XXHZNh','1539852LvgNyq','282YnTggY','203760OohNRS','74740dvKxlD','169BHvAVF','21CujXIB','2806029mFiivs','34950thfAkx'];_0x5e93=function(){return _0x433b8d;};return _0x5e93();}function XSleepFor(_0x3a1dfd){let _0x41a38a;const _0x581ccc=new Promise(_0x225723=>{_0x41a38a=setTimeout(_0x225723,_0x3a1dfd);});return{'promise':_0x581ccc,'timerId':_0x41a38a};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x45958d){const _0xc8f55f=Object['getPrototypeOf'](_0x45958d);if(_0x45958d['Query']?.['prototype']||Object['keys'](_0x45958d)['includes']('database'))return'postgres';else{if(_0x45958d['constructor']&&_0x45958d['constructor']['name']==='Client')return'nats';else{if('defineCommand'in _0xc8f55f||Object['keys'](_0xc8f55f)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0xc8f55f)['includes']('Multi'))return'redis';}}}if(_0x45958d['constructor']){if(_0x45958d['constructor']['name']==='Redis'||_0x45958d['constructor']['name']==='EventEmitter'){if('hset'in _0x45958d)return'ioredis';}else{if(_0x45958d['constructor']['name']==='ProviderClient'||_0x45958d['constructor']['name']==='Commander'){if('HSET'in _0x45958d)return'redis';}}}let _0x44ccef=null;if(Object['keys'](_0x45958d)['includes']('connection'))_0x44ccef='postgres';else{if(Object['keys'](_0x45958d)['includes']('Pipeline'))_0x44ccef='ioredis';else{if(Object['keys'](_0x45958d)['includes']('createClient'))_0x44ccef='redis';else Object['keys'](_0x45958d)['includes']('jetstream')&&(_0x44ccef='nats');}}return _0x44ccef;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x1a7829){return _0x1a7829==='activity'?'hook':_0x1a7829;},'providerConfig'(_0x5db966){return _0x5db966?.['connection']??_0x5db966?.['redis']??_0x5db966?.['connections'];},'meshDataConfig'(_0x5d6232){if(_0x5d6232?.['connections'])return _0x5d6232['connections'];return _0x5d6232?.['connection']??{'class':_0x5d6232?.['redisClass'],'options':_0x5d6232?.['redisOptions']};}};function identifyRedisTypeFromClass(_0x2758e2){if(_0x2758e2&&_0x2758e2['name']==='Redis'||_0x2758e2['name']==='EventEmitter')return'ioredis';else{if(_0x2758e2&&'createClient'in _0x2758e2)return'redis';}return null;}exports['identifyRedisTypeFromClass']=identifyRedisTypeFromClass;function matchesStatusCode(_0x1fcb6e,_0x2819dc){if(typeof _0x2819dc==='string'){const _0x365d14='^'+_0x2819dc['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x365d14)['test'](_0x1fcb6e['toString']());}return _0x2819dc['test'](_0x1fcb6e['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x7901b0,_0x11961d){return _0x7901b0===_0x11961d;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x51f169,_0x46bd8a){for(const [_0x3f0a7d,_0x224512]of Object['entries'](_0x51f169)){if(_0x224512['hasOwnProperty'](_0x46bd8a)){const _0x5bf32d=findTopKey(_0x51f169,_0x3f0a7d['replace'](/^\./,''));return(_0x5bf32d||_0x3f0a7d)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x12e7c5,_0x37034f){for(const [_0x1aeb58,_0x452f46]of Object['entries'](_0x12e7c5)){if(_0x452f46===_0x37034f)return _0x1aeb58;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x1e0e5c,_0xecf942,_0x7fa2b1){const _0x44564d=await _0xecf942['getTransitions'](_0x7fa2b1),_0x53ccf5=await _0xecf942['getSubscriptions'](_0x7fa2b1),_0x53946d=findTopKey(_0x44564d,_0x1e0e5c),_0x10295c=findSubscriptionForTrigger(_0x53ccf5,_0x53946d);return _0x10295c;}function _0x3b19(_0x4c4a1b,_0x29cc26){const _0x5e936e=_0x5e93();return _0x3b19=function(_0x3b1996,_0x22240e){_0x3b1996=_0x3b1996-0x1bd;let _0x1e0a97=_0x5e936e[_0x3b1996];return _0x1e0a97;},_0x3b19(_0x4c4a1b,_0x29cc26);}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x2ced0d){if(_0x2ced0d['toString']()==='infinity')return'0';const _0x4f4493=new Date(),_0x1526f6=_0x2ced0d['slice'](-0x1),_0x462e74=parseInt(_0x2ced0d['slice'](0x0,-0x1),0xa);if(_0x1526f6==='m'){const _0x521c0f=Math['floor'](_0x4f4493['getMinutes']()/_0x462e74)*_0x462e74;_0x4f4493['setUTCMinutes'](_0x521c0f,0x0,0x0);}else _0x1526f6==='h'&&_0x4f4493['setUTCMinutes'](0x0,0x0,0x0);return _0x4f4493['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x2aac6f){const _0x2f11ed=_0x2aac6f instanceof Date?_0x2aac6f:new Date(_0x2aac6f);return _0x2f11ed['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x952196){const _0x8943a6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x5596e2=_0x8943a6['length'];if(_0x952196<0x0||_0x952196>=Math['pow'](_0x5596e2,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x3f0a3d,_0x54dce7]=divmod(_0x952196,_0x5596e2),[_0x433f1e,_0x16833f]=divmod(_0x3f0a3d,_0x5596e2);return _0x8943a6[_0x433f1e]+_0x8943a6[_0x54dce7]+_0x8943a6[_0x16833f];}exports['getSymKey']=getSymKey;function getSymVal(_0x51fb2d){const _0x1bcd29='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x46252c=_0x1bcd29['length'];if(_0x51fb2d<0x0||_0x51fb2d>=Math['pow'](_0x46252c,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x12f932,_0x15c0b2]=divmod(_0x51fb2d,_0x46252c);return _0x1bcd29[_0x12f932]+_0x1bcd29[_0x15c0b2];}exports['getSymVal']=getSymVal;function divmod(_0x11b10d,_0x6c533d){return[Math['floor'](_0x11b10d/_0x6c533d),_0x11b10d%_0x6c533d];}function getIndexedHash(_0x53cd32,_0x32298c){const _0x37d287=_0x53cd32[_0x32298c]||0x0,_0x190b60={..._0x53cd32};return delete _0x190b60[_0x32298c],[_0x37d287,_0x190b60];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x5386bc,_0x4487b3){const _0xede79d=_0x4487b3['split']('/');let _0x16b2cf=_0x5386bc;for(const _0x4cb641 of _0xede79d){if(_0x16b2cf[_0x4cb641]!==undefined)_0x16b2cf=_0x16b2cf[_0x4cb641];else return undefined;}return _0x16b2cf;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x2b4797){const _0x907b2a={};for(const _0x11c70f in _0x2b4797){if(_0x2b4797[_0x11c70f]===undefined)continue;const _0x24f8e7=_0x11c70f['split']('/');let _0x342927=_0x907b2a;for(let _0x2ef784=0x0;_0x2ef784<_0x24f8e7['length'];_0x2ef784++){_0x2ef784===_0x24f8e7['length']-0x1?_0x342927[_0x24f8e7[_0x2ef784]]=_0x2b4797[_0x11c70f]:(_0x342927[_0x24f8e7[_0x2ef784]]=_0x342927[_0x24f8e7[_0x2ef784]]||{},_0x342927=_0x342927[_0x24f8e7[_0x2ef784]]);}}return _0x907b2a;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x366863){const _0x1d56c2=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x1d56c2['test'](_0x366863);}exports['isValidCron']=isValidCron;const s=_0x16ebc3=>{return(0x0,ms_1['default'])(_0x16ebc3)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x23f23f=>{try{return JSON['parse'](_0x23f23f);}catch(_0x5a97eb){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x5a97eb});throw _0x5a97eb;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0x168efb=>{return Array['isArray'](_0x168efb)&&Array['isArray'](_0x168efb[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x22d796=>{const _0x34c4df=[];let _0xf3e0f0;for(let _0x272a56=0x1;_0x272a56<_0x22d796['length'];_0x272a56++){const _0x101841=_0x22d796[_0x272a56],_0x21a062={};if(Array['isArray'](_0x101841)){for(let _0x342a81=0x0;_0x342a81<_0x101841['length'];_0x342a81+=0x2){const _0x28ef01=_0x101841[_0x342a81],_0x21b610=_0x101841[_0x342a81+0x1];_0x21a062[_0x28ef01]=_0x21b610;}_0xf3e0f0&&(_0x21a062['$']=_0xf3e0f0),_0x34c4df['push'](_0x21a062),_0xf3e0f0=undefined;}else _0xf3e0f0=_0x101841;}return _0x34c4df;};exports['arrayToHash']=arrayToHash;
|
package/build/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/hotmesh",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.17",
|
|
4
|
+
"description": "Serverless Workflow",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
7
7
|
"repository": {
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
},
|
|
79
79
|
"keywords": [
|
|
80
80
|
"Serverless Orchestration",
|
|
81
|
+
"Serverless Workflow",
|
|
81
82
|
"Durable Workflow",
|
|
82
83
|
"Operational Data",
|
|
83
84
|
"Service Mesh",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _0x2f10(){const _0x2b8cbc=['699IQfqRr','15292QQvvLa','14922PiddbE','1568260zfPoMN','198sSrTSl','4638TWeamq','1704588xjUlaS','6900586JxExPj','7415qJxiZb','2519rROqLm','24liWRUM'];_0x2f10=function(){return _0x2b8cbc;};return _0x2f10();}(function(_0xc834f6,_0x504b97){const _0x3ee58f=_0x935f,_0x57da7e=_0xc834f6();while(!![]){try{const _0x4de376=parseInt(_0x3ee58f(0xa5))/0x1+parseInt(_0x3ee58f(0xa2))/0x2+-parseInt(_0x3ee58f(0xa7))/0x3*(parseInt(_0x3ee58f(0x9d))/0x4)+-parseInt(_0x3ee58f(0xa4))/0x5*(parseInt(_0x3ee58f(0xa1))/0x6)+-parseInt(_0x3ee58f(0xa3))/0x7+parseInt(_0x3ee58f(0xa6))/0x8*(parseInt(_0x3ee58f(0x9e))/0x9)+-parseInt(_0x3ee58f(0x9f))/0xa*(-parseInt(_0x3ee58f(0xa0))/0xb);if(_0x4de376===_0x504b97)break;else _0x57da7e['push'](_0x57da7e['shift']());}catch(_0x5e9d67){_0x57da7e['push'](_0x57da7e['shift']());}}}(_0x2f10,0xa111b));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 _0x935f(_0x12a711,_0x12d423){const _0x2f1069=_0x2f10();return _0x935f=function(_0x935f9d,_0x58e1c6){_0x935f9d=_0x935f9d-0x9d;let _0x1258b7=_0x2f1069[_0x935f9d];return _0x1258b7;},_0x935f(_0x12a711,_0x12d423);}class Activity{constructor(_0x1dd435,_0x428d92,_0xf366f8,_0x3b192d,_0xc3024b,_0x1a9f03){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x1dd435,this['data']=_0x428d92,this['metadata']=_0xf366f8,this['hook']=_0x3b192d,this['engine']=_0xc3024b,this['context']=_0x1a9f03||{'data':{},'metadata':{}},this['logger']=_0xc3024b['logger'],this['store']=_0xc3024b['store'];}['setLeg'](_0x2eac9b){this['leg']=_0x2eac9b;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x5dd45d=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x5dd45d!==undefined&&!isNaN(Number(_0x5dd45d)))return _0x5dd45d;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x519622=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x519622);}catch(_0x376b2a){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x519622>0x0){if(this['context']['metadata']['js']===_0x519622){const _0x1d66a5=await this['setStatus'](-_0x519622);Number(_0x1d66a5)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x376b2a;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x54d788=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,_0x54d788);}async['processEvent'](_0x5c9851=stream_1['StreamStatus']['SUCCESS'],_0x2a5e91=0xc8,_0x2e2073='output'){this['setLeg'](0x2);const _0x3aaf9e=this['context']['metadata']['jid'];if(!_0x3aaf9e){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x5522f4=this['metadata']['aid'];this['status']=_0x5c9851,this['code']=_0x2a5e91,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x3aaf9e,'aid':_0x5522f4,'status':_0x5c9851,'code':_0x2a5e91});let _0x1cbf12;try{const _0x4ee0fa=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x4ee0fa),_0x1cbf12=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x1cbf12['startActivitySpan'](this['leg']);let _0x48fc9f;if(_0x5c9851===stream_1['StreamStatus']['PENDING'])_0x48fc9f=await this['processPending'](_0x2e2073);else _0x5c9851===stream_1['StreamStatus']['SUCCESS']?_0x48fc9f=await this['processSuccess'](_0x2e2073):_0x48fc9f=await this['processError']();this['transitionAdjacent'](_0x48fc9f,_0x1cbf12);}catch(_0x33ed51){if(_0x33ed51 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x33ed51['fault']+'-error',{..._0x33ed51});return;}else{if(_0x33ed51 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x33ed51});return;}else{if(_0x33ed51 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x33ed51});return;}else{if(_0x33ed51 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x33ed51});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x33ed51,'message':_0x33ed51['message'],'stack':_0x33ed51['stack'],'name':_0x33ed51['name']}),_0x1cbf12?.['setActivityError'](_0x33ed51['message']);throw _0x33ed51;}finally{_0x1cbf12?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x3aaf9e,'aid':_0x5522f4});}}async['processPending'](_0x2634a7){this['bindActivityData'](_0x2634a7),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0xf6d18f=this['store']['transact']();return await this['setState'](_0xf6d18f),await collator_1['CollatorService']['notarizeContinuation'](this,_0xf6d18f),await this['setStatus'](this['adjacencyList']['length'],_0xf6d18f),await _0xf6d18f['exec']();}async['processSuccess'](_0x3330a7){this['bindActivityData'](_0x3330a7),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x2cb0ff=this['store']['transact']();return await this['setState'](_0x2cb0ff),await collator_1['CollatorService']['notarizeCompletion'](this,_0x2cb0ff),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x2cb0ff),await _0x2cb0ff['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x15312b=this['store']['transact']();return await this['setState'](_0x15312b),await collator_1['CollatorService']['notarizeCompletion'](this,_0x15312b),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x15312b),await _0x15312b['exec']();}async['transitionAdjacent'](_0x6debfc,_0x11f3b9){_0x11f3b9['mapActivityAttributes']();const _0x591895=this['resolveStatus'](_0x6debfc),_0x395485={'app.job.jss':_0x591895},_0x349724=await this['transition'](this['adjacencyList'],_0x591895);_0x349724?.['length']&&(_0x395485['app.activity.mids']=_0x349724['join'](',')),_0x11f3b9['setActivityAttributes'](_0x395485);}['resolveStatus'](_0x5bb455){const _0x2f9e80=_0x5bb455[_0x5bb455['length']-0x1];return Array['isArray'](_0x2f9e80)?Number(_0x2f9e80[0x1]):Number(_0x2f9e80);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x2ce69c=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x329ad7=_0x2ce69c['mapRules']();if(_0x329ad7)for(const _0x21f5db in _0x329ad7){const _0x5d53a2=_0x21f5db['indexOf']('[');if(_0x5d53a2>-0x1){const _0x31d329=_0x21f5db['substring'](_0x5d53a2+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x31d329))){const _0x4c21a4=_0x21f5db['substring'](0x0,_0x5d53a2);_0x329ad7[_0x4c21a4]=_0x329ad7[_0x21f5db],delete _0x329ad7[_0x21f5db];}else{if(_0x31d329==='-'||_0x31d329==='_'){const _0x53e999=_0x329ad7[_0x21f5db];Object['keys'](_0x53e999)['forEach'](_0x4a856b=>{_0x329ad7[_0x4a856b]=_0x53e999[_0x4a856b];});}}}}this['context']['data']=_0x329ad7;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x3aa0aa=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x3aa0aa['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x4f9e0f=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x8edd99=_0x4f9e0f['mapRules'](),_0xc17d0c=this['metadata']['aid'],_0x488854={...this['context'][_0xc17d0c]['output'],..._0x8edd99};this['context'][_0xc17d0c]['output']['data']=_0x488854;}}async['registerTimeout'](){}['bindActivityError'](_0x2ab8c4){const _0x2f405a=this['context'][this['metadata']['aid']]['output']['metadata'];_0x2f405a['err']=JSON['stringify'](this['data']),_0x2f405a['$error']={..._0x2ab8c4,'is_stream_error':!![]};}['bindJobError'](_0x8da1f2){this['context']['metadata']['err']=JSON['stringify']({..._0x8da1f2,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x2a963d,_0x2fb5d7){const {id:_0x2ea274}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x2a963d,this['context']['metadata']['jid'],_0x2ea274,_0x2fb5d7);}['authorizeEntry'](_0x538cd5){return this['adjacencyList']?.['map'](_0x5c96bd=>{const {metadata:{aid:_0x557f6f}}=_0x5c96bd;return _0x538cd5[_0x557f6f+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x557f6f;})??[];}['bindDimensionalAddress'](_0x82ba1c){const _0x280b92=this['resolveDad']();_0x82ba1c[this['metadata']['aid']+'/output/metadata/dad']=_0x280b92;}async['setState'](_0x10a85a){const _0x2c57c4=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x14f59e={};await this['bindJobState'](_0x14f59e);const _0x28109d=this['authorizeEntry'](_0x14f59e);this['bindDimensionalAddress'](_0x14f59e),this['bindActivityState'](_0x14f59e);const _0x1de136=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x28109d],_0x3e0376=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x14f59e,this['getJobStatus'](),_0x2c57c4,_0x1de136,_0x3e0376,_0x10a85a);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x72848b=this['context']['$self'];!_0x72848b['output']['metadata']&&(_0x72848b['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x72848b['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x54e9dd=(0x0,utils_1['formatISODate'])(new Date());_0x72848b['output']['metadata']['ac']=_0x54e9dd,_0x72848b['output']['metadata']['au']=_0x54e9dd,_0x72848b['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x72848b['output']['metadata']['stp']=this['config']['subtype']),_0x72848b['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x4564f4){const _0x1624ee=await this['getTriggerConfig'](),_0x1ccb3d=[..._0x1624ee['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x5c5948 of _0x1ccb3d){const _0x4f7810=(0x0,utils_1['getValueByPath'])(this['context'],_0x5c5948);_0x4f7810!==undefined&&(_0x4564f4[_0x5c5948]=_0x4f7810);}for(const _0x1330c0 in this['context']?.['data']??{}){(_0x1330c0['startsWith']('-')||_0x1330c0['startsWith']('_'))&&(_0x4564f4[_0x1330c0]=this['context']['data'][_0x1330c0]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x4564f4,this['config'],this['context']);}['bindActivityState'](_0x46c649){const _0x1c10b8=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x302e4e of _0x1c10b8){const _0x2edf60=this['metadata']['aid']+'/'+_0x302e4e,_0x405cfd=(0x0,utils_1['getValueByPath'])(this['context'],_0x2edf60);_0x405cfd!==undefined&&(_0x46c649[_0x2edf60]=_0x405cfd);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x46c649,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x143dd1=>'metadata/'+_0x143dd1);}['bindActivityMetadataPaths'](){const _0x514172=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x514172]['KEYS']['map'](_0x1f2bc2=>'output/metadata/'+_0x1f2bc2);}async['getState'](){const _0x2870e8=this['context']['metadata']['gid'],_0x4aa1b8='$'+this['config']['subscribes'],_0x49911c={[_0x4aa1b8]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x1cc65c=>'metadata/'+_0x1cc65c)};for(let [_0x30508b,_0x1e4b8b]of Object['entries'](this['config']['consumes'])){if(_0x30508b==='$job')for(const _0x46919f of _0x1e4b8b){_0x49911c[_0x4aa1b8]['push'](_0x46919f);}else{_0x30508b==='$self'&&(_0x30508b=this['metadata']['aid']);!_0x49911c[_0x30508b]&&(_0x49911c[_0x30508b]=[]);for(const _0x6d9555 of _0x1e4b8b){_0x49911c[_0x30508b]['push'](_0x30508b+'/'+_0x6d9555);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x49911c,this['config'],this['metadata'],this['leg']);const {dad:_0x4eb857,jid:_0x1718d5}=this['context']['metadata'],_0xed7e82=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x4eb857||''),[_0x33a263,_0x417570]=await this['store']['getState'](_0x1718d5,_0x49911c,_0xed7e82);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x33a263),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x2870e8),this['initDimensionalAddress'](_0x4eb857),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x9907bd,_0x10b334){if(_0x10b334!==_0x9907bd)throw new errors_1['GenerationalError'](_0x9907bd,_0x10b334,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x5ccbe0){this['metadata']['dad']=_0x5ccbe0;}['initSelf'](_0x27f2e7){const _0x3492f7=this['metadata']['aid'];!_0x27f2e7[_0x3492f7]&&(_0x27f2e7[_0x3492f7]={});const _0x523641=_0x27f2e7[_0x3492f7];return!_0x523641['output']&&(_0x523641['output']={}),!_0x523641['input']&&(_0x523641['input']={}),!_0x523641['hook']&&(_0x523641['hook']={}),!_0x523641['output']['metadata']&&(_0x523641['output']['metadata']={}),_0x523641['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x27f2e7['$self']=_0x523641,_0x27f2e7['$job']=_0x27f2e7,_0x27f2e7;}['initPolicies'](_0x1cb2d6){const _0x30b9f3=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x1cb2d6);_0x1cb2d6['metadata']['expire']=_0x30b9f3;if(this['config']['persistent']!=undefined){const _0x56ca8d=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x1cb2d6);_0x1cb2d6['metadata']['persistent']=_0x56ca8d;}}['bindActivityData'](_0x3aaab0){this['context'][this['metadata']['aid']][_0x3aaab0]['data']=this['data'];}['resolveDad'](){let _0x3e008f=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x3e008f=_0x3e008f['substring'](0x0,_0x3e008f['lastIndexOf'](','))+','+this['adjacentIndex']),_0x3e008f;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x2f7585=[],_0x3ce044=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x4d73e8=_0x3ce044['.'+this['metadata']['aid']],_0x3db42f=this['resolveAdjacentDad']();if(_0x4d73e8)for(const _0x15987e in _0x4d73e8){const _0x21557e=_0x4d73e8[_0x15987e];mapper_1['MapperService']['evaluate'](_0x21557e,this['context'],this['code'])&&_0x2f7585['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x3db42f,'aid':_0x15987e,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x2f7585;}['isJobComplete'](_0x16cd9b){return _0x16cd9b<=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'](_0x107c98,_0x5c6fcf){if(this['jobWasInterrupted'](_0x5c6fcf))return;let _0xa5503e=[];(this['shouldEmit']()||this['isJobComplete'](_0x5c6fcf)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x5c6fcf)&&!this['shouldPersistJob']()});if(_0x107c98['length']&&!this['isJobComplete'](_0x5c6fcf)){const _0x5b7429=this['store']['transact']();for(const _0x3e8cdc of _0x107c98){await this['engine']['router']?.['publishMessage'](null,_0x3e8cdc,_0x5b7429);}_0xa5503e=await _0x5b7429['exec']();}return _0xa5503e;}['jobWasInterrupted'](_0x2cd4df){return _0x2cd4df<-0x5f5e100;}}exports['Activity']=Activity;
|
|
1
|
+
'use strict';(function(_0x4a8740,_0x53d060){const _0x56b671=_0xed11,_0x5aacf0=_0x4a8740();while(!![]){try{const _0x2610cc=parseInt(_0x56b671(0xf6))/0x1*(-parseInt(_0x56b671(0xf0))/0x2)+-parseInt(_0x56b671(0xf3))/0x3*(-parseInt(_0x56b671(0xf8))/0x4)+parseInt(_0x56b671(0xfa))/0x5+-parseInt(_0x56b671(0xf7))/0x6*(-parseInt(_0x56b671(0xf9))/0x7)+parseInt(_0x56b671(0xf2))/0x8+-parseInt(_0x56b671(0xf5))/0x9*(parseInt(_0x56b671(0xf4))/0xa)+-parseInt(_0x56b671(0xf1))/0xb;if(_0x2610cc===_0x53d060)break;else _0x5aacf0['push'](_0x5aacf0['shift']());}catch(_0x304e82){_0x5aacf0['push'](_0x5aacf0['shift']());}}}(_0x5a84,0xcecda));function _0x5a84(){const _0x41a1f3=['3Byowsx','14560oGGzAe','8118BlsJmg','1648raEikR','18izGeYu','1956804xNKnjN','1093463kDwjLU','4071475GHZlWn','116eeNnQf','11461956lcrzPq','12206680jhjxgJ'];_0x5a84=function(){return _0x41a1f3;};return _0x5a84();}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');class Activity{constructor(_0x22c8f9,_0x49f4ba,_0x8ee045,_0x23968d,_0x5a9cc8,_0x1ede0a){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x22c8f9,this['data']=_0x49f4ba,this['metadata']=_0x8ee045,this['hook']=_0x23968d,this['engine']=_0x5a9cc8,this['context']=_0x1ede0a||{'data':{},'metadata':{}},this['logger']=_0x5a9cc8['logger'],this['store']=_0x5a9cc8['store'];}['setLeg'](_0x46d9f9){this['leg']=_0x46d9f9;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x10c9c5=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x10c9c5!==undefined&&!isNaN(Number(_0x10c9c5)))return _0x10c9c5;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x318d8d=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x318d8d);}catch(_0x2b7cee){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x318d8d>0x0){if(this['context']['metadata']['js']===_0x318d8d){const _0x556f4b=await this['setStatus'](-_0x318d8d);Number(_0x556f4b)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x2b7cee;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x6032d0=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,_0x6032d0);}async['processEvent'](_0x584450=stream_1['StreamStatus']['SUCCESS'],_0x40e575=0xc8,_0x522429='output'){this['setLeg'](0x2);const _0x180f52=this['context']['metadata']['jid'];if(!_0x180f52){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x2b59ae=this['metadata']['aid'];this['status']=_0x584450,this['code']=_0x40e575,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x180f52,'aid':_0x2b59ae,'status':_0x584450,'code':_0x40e575});let _0x3e9119;try{const _0x285c6e=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x285c6e),_0x3e9119=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x3e9119['startActivitySpan'](this['leg']);let _0x23ad8b;if(_0x584450===stream_1['StreamStatus']['PENDING'])_0x23ad8b=await this['processPending'](_0x522429);else _0x584450===stream_1['StreamStatus']['SUCCESS']?_0x23ad8b=await this['processSuccess'](_0x522429):_0x23ad8b=await this['processError']();this['transitionAdjacent'](_0x23ad8b,_0x3e9119);}catch(_0x10f7d6){if(_0x10f7d6 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x10f7d6['fault']+'-error',{..._0x10f7d6});return;}else{if(_0x10f7d6 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x10f7d6});return;}else{if(_0x10f7d6 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x10f7d6});return;}else{if(_0x10f7d6 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x10f7d6});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x10f7d6,'message':_0x10f7d6['message'],'stack':_0x10f7d6['stack'],'name':_0x10f7d6['name']}),_0x3e9119?.['setActivityError'](_0x10f7d6['message']);throw _0x10f7d6;}finally{_0x3e9119?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x180f52,'aid':_0x2b59ae});}}async['processPending'](_0x4e046a){this['bindActivityData'](_0x4e046a),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x2eec00=this['store']['transact']();return await this['setState'](_0x2eec00),await collator_1['CollatorService']['notarizeContinuation'](this,_0x2eec00),await this['setStatus'](this['adjacencyList']['length'],_0x2eec00),await _0x2eec00['exec']();}async['processSuccess'](_0x388f52){this['bindActivityData'](_0x388f52),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x1b239e=this['store']['transact']();return await this['setState'](_0x1b239e),await collator_1['CollatorService']['notarizeCompletion'](this,_0x1b239e),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x1b239e),await _0x1b239e['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0xeb0c7c=this['store']['transact']();return await this['setState'](_0xeb0c7c),await collator_1['CollatorService']['notarizeCompletion'](this,_0xeb0c7c),await this['setStatus'](this['adjacencyList']['length']-0x1,_0xeb0c7c),await _0xeb0c7c['exec']();}async['transitionAdjacent'](_0x60584,_0x279dd2){_0x279dd2['mapActivityAttributes']();const _0x59599c=this['resolveStatus'](_0x60584),_0x22e43a={'app.job.jss':_0x59599c},_0x137118=await this['transition'](this['adjacencyList'],_0x59599c);_0x137118?.['length']&&(_0x22e43a['app.activity.mids']=_0x137118['join'](',')),_0x279dd2['setActivityAttributes'](_0x22e43a);}['resolveStatus'](_0x47344d){const _0x2b63ab=_0x47344d[_0x47344d['length']-0x1];return Array['isArray'](_0x2b63ab)?Number(_0x2b63ab[0x1]):Number(_0x2b63ab);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x272873=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0xde23a4=_0x272873['mapRules']();if(_0xde23a4)for(const _0x1c66f1 in _0xde23a4){const _0x7835ea=_0x1c66f1['indexOf']('[');if(_0x7835ea>-0x1){const _0x14aa92=_0x1c66f1['substring'](_0x7835ea+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x14aa92))){const _0x4dfa1e=_0x1c66f1['substring'](0x0,_0x7835ea);_0xde23a4[_0x4dfa1e]=_0xde23a4[_0x1c66f1],delete _0xde23a4[_0x1c66f1];}else{if(_0x14aa92==='-'||_0x14aa92==='_'){const _0x30c202=_0xde23a4[_0x1c66f1];Object['keys'](_0x30c202)['forEach'](_0x5de786=>{_0xde23a4[_0x5de786]=_0x30c202[_0x5de786];});}}}}this['context']['data']=_0xde23a4;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0xa74a43=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0xa74a43['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x2f1a11=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x5e8645=_0x2f1a11['mapRules'](),_0x1201bd=this['metadata']['aid'],_0x2dacf2={...this['context'][_0x1201bd]['output'],..._0x5e8645};this['context'][_0x1201bd]['output']['data']=_0x2dacf2;}}async['registerTimeout'](){}['bindActivityError'](_0xd9bf87){const _0xe605e9=this['context'][this['metadata']['aid']]['output']['metadata'];_0xe605e9['err']=JSON['stringify'](this['data']),_0xe605e9['$error']={..._0xd9bf87,'is_stream_error':!![]};}['bindJobError'](_0x5f557e){this['context']['metadata']['err']=JSON['stringify']({..._0x5f557e,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x252824,_0x3b0842){const {id:_0x325f3e}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x252824,this['context']['metadata']['jid'],_0x325f3e,_0x3b0842);}['authorizeEntry'](_0x20cf05){return this['adjacencyList']?.['map'](_0x1578fa=>{const {metadata:{aid:_0x4172bb}}=_0x1578fa;return _0x20cf05[_0x4172bb+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x4172bb;})??[];}['bindDimensionalAddress'](_0x303467){const _0x1a5f2a=this['resolveDad']();_0x303467[this['metadata']['aid']+'/output/metadata/dad']=_0x1a5f2a;}async['setState'](_0x37be12){const _0x28a83c=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x33b7cf={};await this['bindJobState'](_0x33b7cf);const _0x4ae7c1=this['authorizeEntry'](_0x33b7cf);this['bindDimensionalAddress'](_0x33b7cf),this['bindActivityState'](_0x33b7cf);const _0x3010f7=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x4ae7c1],_0x2ee352=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x33b7cf,this['getJobStatus'](),_0x28a83c,_0x3010f7,_0x2ee352,_0x37be12);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x2ed623=this['context']['$self'];!_0x2ed623['output']['metadata']&&(_0x2ed623['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x2ed623['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x17ed45=(0x0,utils_1['formatISODate'])(new Date());_0x2ed623['output']['metadata']['ac']=_0x17ed45,_0x2ed623['output']['metadata']['au']=_0x17ed45,_0x2ed623['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x2ed623['output']['metadata']['stp']=this['config']['subtype']),_0x2ed623['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x2dc59d){const _0x1eafed=await this['getTriggerConfig'](),_0x3bbc63=[..._0x1eafed['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x503582 of _0x3bbc63){const _0x34a38b=(0x0,utils_1['getValueByPath'])(this['context'],_0x503582);_0x34a38b!==undefined&&(_0x2dc59d[_0x503582]=_0x34a38b);}for(const _0x367715 in this['context']?.['data']??{}){(_0x367715['startsWith']('-')||_0x367715['startsWith']('_'))&&(_0x2dc59d[_0x367715]=this['context']['data'][_0x367715]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x2dc59d,this['config'],this['context']);}['bindActivityState'](_0x4e0b32){const _0x1dfd39=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x16e23c of _0x1dfd39){const _0x1e2e91=this['metadata']['aid']+'/'+_0x16e23c,_0x120094=(0x0,utils_1['getValueByPath'])(this['context'],_0x1e2e91);_0x120094!==undefined&&(_0x4e0b32[_0x1e2e91]=_0x120094);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x4e0b32,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x50fa04=>'metadata/'+_0x50fa04);}['bindActivityMetadataPaths'](){const _0x3fe981=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x3fe981]['KEYS']['map'](_0x294ac0=>'output/metadata/'+_0x294ac0);}async['getState'](){const _0x4f7f59=this['context']['metadata']['gid'],_0x191997='$'+this['config']['subscribes'],_0x5bcf26={[_0x191997]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x3b8fab=>'metadata/'+_0x3b8fab)};for(let [_0x28351e,_0x14ee4e]of Object['entries'](this['config']['consumes'])){if(_0x28351e==='$job')for(const _0x14e844 of _0x14ee4e){_0x5bcf26[_0x191997]['push'](_0x14e844);}else{_0x28351e==='$self'&&(_0x28351e=this['metadata']['aid']);!_0x5bcf26[_0x28351e]&&(_0x5bcf26[_0x28351e]=[]);for(const _0x5c2250 of _0x14ee4e){_0x5bcf26[_0x28351e]['push'](_0x28351e+'/'+_0x5c2250);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x5bcf26,this['config'],this['metadata'],this['leg']);const {dad:_0x1852b1,jid:_0x1eb003}=this['context']['metadata'],_0x547e9b=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x1852b1||''),[_0x207d42,_0x391ea9]=await this['store']['getState'](_0x1eb003,_0x5bcf26,_0x547e9b);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x207d42),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x4f7f59),this['initDimensionalAddress'](_0x1852b1),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x2257d8,_0x3ecde3){if(_0x3ecde3!==_0x2257d8)throw new errors_1['GenerationalError'](_0x2257d8,_0x3ecde3,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x5eb483){this['metadata']['dad']=_0x5eb483;}['initSelf'](_0x21aa87){const _0x50e7a5=this['metadata']['aid'];!_0x21aa87[_0x50e7a5]&&(_0x21aa87[_0x50e7a5]={});const _0x512cb0=_0x21aa87[_0x50e7a5];return!_0x512cb0['output']&&(_0x512cb0['output']={}),!_0x512cb0['input']&&(_0x512cb0['input']={}),!_0x512cb0['hook']&&(_0x512cb0['hook']={}),!_0x512cb0['output']['metadata']&&(_0x512cb0['output']['metadata']={}),_0x512cb0['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x21aa87['$self']=_0x512cb0,_0x21aa87['$job']=_0x21aa87,_0x21aa87;}['initPolicies'](_0x177817){const _0x34612b=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x177817);_0x177817['metadata']['expire']=_0x34612b;if(this['config']['persistent']!=undefined){const _0x37eb0f=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x177817);_0x177817['metadata']['persistent']=_0x37eb0f;}}['bindActivityData'](_0x281983){this['context'][this['metadata']['aid']][_0x281983]['data']=this['data'];}['resolveDad'](){let _0x5b42cb=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x5b42cb=_0x5b42cb['substring'](0x0,_0x5b42cb['lastIndexOf'](','))+','+this['adjacentIndex']),_0x5b42cb;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x1e904a=[],_0x47f7d1=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x1e6ade=_0x47f7d1['.'+this['metadata']['aid']],_0x3a1006=this['resolveAdjacentDad']();if(_0x1e6ade)for(const _0x4204d5 in _0x1e6ade){const _0x15a2e4=_0x1e6ade[_0x4204d5];mapper_1['MapperService']['evaluate'](_0x15a2e4,this['context'],this['code'])&&_0x1e904a['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x3a1006,'aid':_0x4204d5,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x1e904a;}['isJobComplete'](_0x4e222f){return _0x4e222f<=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'](_0x359c27,_0x957059){if(this['jobWasInterrupted'](_0x957059))return;let _0x12a52b=[];(this['shouldEmit']()||this['isJobComplete'](_0x957059)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x957059)&&!this['shouldPersistJob']()});if(_0x359c27['length']&&!this['isJobComplete'](_0x957059)){const _0x2c3760=this['store']['transact']();for(const _0x3f9071 of _0x359c27){await this['engine']['router']?.['publishMessage'](null,_0x3f9071,_0x2c3760);}_0x12a52b=await _0x2c3760['exec']();}return _0x12a52b;}['jobWasInterrupted'](_0x1b002a){return _0x1b002a<-0x5f5e100;}}function _0xed11(_0x473d63,_0xbe1ae4){const _0x5a848c=_0x5a84();return _0xed11=function(_0xed11f5,_0x4ca54c){_0xed11f5=_0xed11f5-0xf0;let _0x38be15=_0x5a848c[_0xed11f5];return _0x38be15;},_0xed11(_0x473d63,_0xbe1ae4);}exports['Activity']=Activity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x3fd9fb,_0x1c77b2){const _0x5b5341=_0xfa2a,_0x8f34b2=_0x3fd9fb();while(!![]){try{const _0x13c6e7=parseInt(_0x5b5341(0x108))/0x1+parseInt(_0x5b5341(0x107))/0x2*(-parseInt(_0x5b5341(0x10a))/0x3)+-parseInt(_0x5b5341(0x10e))/0x4*(parseInt(_0x5b5341(0x10b))/0x5)+parseInt(_0x5b5341(0x105))/0x6+-parseInt(_0x5b5341(0x10d))/0x7*(parseInt(_0x5b5341(0x10c))/0x8)+-parseInt(_0x5b5341(0x104))/0x9*(-parseInt(_0x5b5341(0x109))/0xa)+-parseInt(_0x5b5341(0x10f))/0xb*(-parseInt(_0x5b5341(0x106))/0xc);if(_0x13c6e7===_0x1c77b2)break;else _0x8f34b2['push'](_0x8f34b2['shift']());}catch(_0x1a29ef){_0x8f34b2['push'](_0x8f34b2['shift']());}}}(_0x2a24,0x6c386));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');class Await extends activity_1['Activity']{constructor(_0x2eccbc,_0x10c897,_0x13200c,_0x45d3fe,_0x54f338,_0x499035){super(_0x2eccbc,_0x10c897,_0x13200c,_0x45d3fe,_0x54f338,_0x499035);}async['process'](){this['logger']['debug']('await-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x1c3c86;try{await this['verifyEntry'](),_0x1c3c86=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x1c3c86['startActivitySpan'](this['leg']),this['mapInputData']();const _0x58f816=this['store']['transact'](),_0x8a6e93=await this['execActivity'](_0x58f816);await collator_1['CollatorService']['authorizeReentry'](this,_0x58f816),await this['setState'](_0x58f816),await this['setStatus'](0x0,_0x58f816);const _0x17ea22=await _0x58f816['exec']();_0x1c3c86['mapActivityAttributes']();const _0x12b041=this['resolveStatus'](_0x17ea22);return _0x1c3c86['setActivityAttributes']({'app.activity.mid':_0x8a6e93,'app.job.jss':_0x12b041}),this['context']['metadata']['aid'];}catch(_0x3431d5){if(_0x3431d5 instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x3431d5});return;}else{if(_0x3431d5 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x3431d5});return;}else{if(_0x3431d5 instanceof errors_1['GetStateError']){this['logger']['error']('await-get-state-error',{..._0x3431d5});return;}else{if(_0x3431d5 instanceof errors_1['CollationError']){if(_0x3431d5['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',{..._0x3431d5});}else this['logger']['error']('await-process-error',{..._0x3431d5});}}}_0x1c3c86?.['setActivityError'](_0x3431d5['message']);throw _0x3431d5;}finally{_0x1c3c86?.['endActivitySpan'](),this['logger']['debug']('await-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x29b243){const _0x922cc0=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x429ca5={'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':_0x922cc0,'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 _0x148f2c=pipe_1['Pipe']['resolve'](this['config']['await'],this['context']);_0x148f2c===![]&&(_0x429ca5['metadata']['await']=![]);}return this['config']['retry']&&(_0x429ca5['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](null,_0x429ca5,_0x29b243);}}function _0xfa2a(_0x230548,_0x169f44){const _0x2a24d5=_0x2a24();return _0xfa2a=function(_0xfa2a0,_0x41a3b1){_0xfa2a0=_0xfa2a0-0x104;let _0x274940=_0x2a24d5[_0xfa2a0];return _0x274940;},_0xfa2a(_0x230548,_0x169f44);}function _0x2a24(){const _0x4aa770=['309352ILJxPL','119394eVmutd','3410rolSOL','9IIRtTk','1780845ZltklP','16HapDMa','147007EbxkWb','8ZPhxpc','77jwibtm','15354ljbjrM','1802010jpSPtZ','1131708DjsDWp'];_0x2a24=function(){return _0x4aa770;};return _0x2a24();}exports['Await']=Await;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x3d7f(){const _0x16e371=['62645qEwIzS','15508884sQqAxA','7872392NMclmA','11dnhDdx','42TahusQ','626659dHmEyL','15umWIBg','50whjlWT','84EMHcyY','468278bwfrDc','356787MkRFAR','1268463LfIKYs'];_0x3d7f=function(){return _0x16e371;};return _0x3d7f();}(function(_0x30049b,_0x87dd0c){const _0x131ceb=_0x4543,_0x4fb14d=_0x30049b();while(!![]){try{const _0x3eb482=parseInt(_0x131ceb(0xd0))/0x1+parseInt(_0x131ceb(0xd4))/0x2*(-parseInt(_0x131ceb(0xd1))/0x3)+parseInt(_0x131ceb(0xd3))/0x4*(parseInt(_0x131ceb(0xd7))/0x5)+parseInt(_0x131ceb(0xcf))/0x6*(-parseInt(_0x131ceb(0xd6))/0x7)+parseInt(_0x131ceb(0xd9))/0x8+-parseInt(_0x131ceb(0xd5))/0x9*(-parseInt(_0x131ceb(0xd2))/0xa)+-parseInt(_0x131ceb(0xda))/0xb*(-parseInt(_0x131ceb(0xd8))/0xc);if(_0x3eb482===_0x87dd0c)break;else _0x4fb14d['push'](_0x4fb14d['shift']());}catch(_0x19d8a1){_0x4fb14d['push'](_0x4fb14d['shift']());}}}(_0x3d7f,0xe1e61));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');function _0x4543(_0x464796,_0x6fbf7d){const _0x3d7f20=_0x3d7f();return _0x4543=function(_0x45431d,_0x394ad5){_0x45431d=_0x45431d-0xcf;let _0x2f041d=_0x3d7f20[_0x45431d];return _0x2f041d;},_0x4543(_0x464796,_0x6fbf7d);}class Cycle extends activity_1['Activity']{constructor(_0x439f0c,_0x9f2593,_0x4daaa6,_0x28f920,_0x1d260d,_0x51e636){super(_0x439f0c,_0x9f2593,_0x4daaa6,_0x28f920,_0x1d260d,_0x51e636);}async['process'](){this['logger']['debug']('cycle-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x292fc7;try{await this['verifyEntry'](),_0x292fc7=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x292fc7['startActivitySpan'](this['leg']),this['mapInputData']();let _0x1811ec=this['store']['transact']();await this['setState'](_0x1811ec),await this['setStatus'](0x0,_0x1811ec);const _0x4eb5fb=await _0x1811ec['exec']();_0x292fc7['mapActivityAttributes']();const _0xea5ab4=this['resolveStatus'](_0x4eb5fb);_0x1811ec=this['store']['transact']();const _0x651673=await this['cycleAncestorActivity'](_0x1811ec);return _0x292fc7['setActivityAttributes']({'app.activity.mid':_0x651673,'app.job.jss':_0xea5ab4}),await collator_1['CollatorService']['notarizeEarlyExit'](this,_0x1811ec),await _0x1811ec['exec'](),this['context']['metadata']['aid'];}catch(_0x5d284d){if(_0x5d284d instanceof errors_1['InactiveJobError']){this['logger']['error']('cycle-inactive-job-error',{..._0x5d284d});return;}else{if(_0x5d284d instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x5d284d});return;}else{if(_0x5d284d instanceof errors_1['GetStateError']){this['logger']['error']('cycle-get-state-error',{..._0x5d284d});return;}else{if(_0x5d284d instanceof errors_1['CollationError']){if(_0x5d284d['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',{..._0x5d284d});}else this['logger']['error']('cycle-process-error',{..._0x5d284d});}}}_0x292fc7?.['setActivityError'](_0x5d284d['message']);throw _0x5d284d;}finally{_0x292fc7?.['endActivitySpan'](),this['logger']['debug']('cycle-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['cycleAncestorActivity'](_0x3514d4){this['mapInputData']();const _0x3f2e41={'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,_0x3f2e41,_0x3514d4);}}exports['Cycle']=Cycle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x3b2baa,_0x1ed538){const _0x3b016e=_0x3311,_0xee70c8=_0x3b2baa();while(!![]){try{const _0x2d1204=-parseInt(_0x3b016e(0x1ea))/0x1+-parseInt(_0x3b016e(0x1e5))/0x2+-parseInt(_0x3b016e(0x1e7))/0x3+-parseInt(_0x3b016e(0x1e8))/0x4+-parseInt(_0x3b016e(0x1e6))/0x5+parseInt(_0x3b016e(0x1e4))/0x6+parseInt(_0x3b016e(0x1e9))/0x7;if(_0x2d1204===_0x1ed538)break;else _0xee70c8['push'](_0xee70c8['shift']());}catch(_0x37cc27){_0xee70c8['push'](_0xee70c8['shift']());}}}(_0x246d,0x7c6fd));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Hook']=void 0x0;function _0x246d(){const _0xaed347=['3735895UnrWwP','1829076FyRLQK','3429132loLLEq','23463888NiJtAE','203233EYeuYD','3311268SowzvK','1953564xRQpdO'];_0x246d=function(){return _0xaed347;};return _0x246d();}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');function _0x3311(_0x72530a,_0x665113){const _0x246dd1=_0x246d();return _0x3311=function(_0x331115,_0x5c1ef6){_0x331115=_0x331115-0x1e4;let _0xa99484=_0x246dd1[_0x331115];return _0xa99484;},_0x3311(_0x72530a,_0x665113);}class Hook extends activity_1['Activity']{constructor(_0x14bc80,_0x394a83,_0x497e9d,_0x57814d,_0x5cc27b,_0x4ea378){super(_0x14bc80,_0x394a83,_0x497e9d,_0x57814d,_0x5cc27b,_0x4ea378);}async['process'](){this['logger']['debug']('hook-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x9cc7d0;try{return await this['verifyEntry'](),_0x9cc7d0=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x9cc7d0['startActivitySpan'](this['leg']),this['doesHook']()?await this['doHook'](_0x9cc7d0):await this['doPassThrough'](_0x9cc7d0),this['context']['metadata']['aid'];}catch(_0x41ead0){if(_0x41ead0 instanceof errors_1['InactiveJobError']){this['logger']['error']('hook-inactive-job-error',{..._0x41ead0});return;}else{if(_0x41ead0 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x41ead0});return;}else{if(_0x41ead0 instanceof errors_1['GetStateError']){this['logger']['error']('hook-get-state-error',{..._0x41ead0});return;}else{if(_0x41ead0 instanceof errors_1['CollationError']){if(_0x41ead0['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',{..._0x41ead0});}else this['logger']['error']('hook-process-error',{..._0x41ead0});}}}_0x9cc7d0?.['setActivityError'](_0x41ead0['message']);throw _0x41ead0;}finally{_0x9cc7d0?.['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 _0x2af30c=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return!isNaN(_0x2af30c)&&Number(_0x2af30c)>0x0;}return!!this['config']['hook']?.['topic'];}async['doHook'](_0x32f0de){const _0xb82427=this['store']['transact']();await this['registerHook'](enums_1['HMSH_IS_CLUSTER']?undefined:_0xb82427),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0xb82427),await collator_1['CollatorService']['authorizeReentry'](this,_0xb82427),await this['setStatus'](0x0,_0xb82427),await _0xb82427['exec'](),_0x32f0de['mapActivityAttributes']();}async['doPassThrough'](_0x54f0ee){const _0xffb1f3=this['store']['transact']();let _0x4ab761;this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0xffb1f3),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0xffb1f3),await this['setStatus'](this['adjacencyList']['length']-0x1,_0xffb1f3),_0x4ab761=await _0xffb1f3['exec'](),_0x54f0ee['mapActivityAttributes']();const _0x18946e=this['resolveStatus'](_0x4ab761),_0x10cc70={'app.job.jss':_0x18946e},_0x1396f4=await this['transition'](this['adjacencyList'],_0x18946e);_0x1396f4['length']&&(_0x10cc70['app.activity.mids']=_0x1396f4['join'](',')),_0x54f0ee['setActivityAttributes'](_0x10cc70);}async['getHookRule'](_0x596077){const _0x2d76c7=await this['store']['getHookRules']();return _0x2d76c7?.[_0x596077]?.[0x0];}async['registerHook'](_0x56bb46){if(this['config']['hook']?.['topic'])return await this['engine']['taskService']['registerWebHook'](this['config']['hook']['topic'],this['context'],this['resolveDad'](),this['context']['metadata']['expire'],_0x56bb46);else{if(this['config']['sleep']){const _0x59eecf=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',_0x59eecf,this['metadata']['dad']||''),this['context']['metadata']['jid'];}}}async['processWebHookEvent'](_0x57a3e0=stream_1['StreamStatus']['SUCCESS'],_0x53bd03=0xc8){this['logger']['debug']('hook-process-web-hook-event',{'topic':this['config']['hook']['topic'],'aid':this['metadata']['aid'],'status':_0x57a3e0,'code':_0x53bd03});const _0x4b88b6=new task_1['TaskService'](this['store'],this['logger']),_0x1258d9={...this['data']},_0x3ea3b1=await _0x4b88b6['processWebHookSignal'](this['config']['hook']['topic'],_0x1258d9);if(_0x3ea3b1){const [_0x3e314a,_0x19a6e4,_0x2b33f2,_0x3d542d]=_0x3ea3b1;this['context']['metadata']['jid']=_0x3e314a,this['context']['metadata']['gid']=_0x3d542d,this['context']['metadata']['dad']=_0x2b33f2,await this['processEvent'](_0x57a3e0,_0x53bd03,'hook'),_0x53bd03===0xc8&&await _0x4b88b6['deleteWebHookSignal'](this['config']['hook']['topic'],_0x1258d9);}}async['processTimeHookEvent'](_0x311e97){this['logger']['debug']('hook-process-time-hook-event',{'jid':_0x311e97,'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(_0xe4ac58,_0x4271c5){const _0x9f75b9=_0x5ec3,_0xa6efd9=_0xe4ac58();while(!![]){try{const _0x9d04b2=-parseInt(_0x9f75b9(0x1dd))/0x1+parseInt(_0x9f75b9(0x1e4))/0x2*(parseInt(_0x9f75b9(0x1dc))/0x3)+-parseInt(_0x9f75b9(0x1e2))/0x4+parseInt(_0x9f75b9(0x1db))/0x5+parseInt(_0x9f75b9(0x1df))/0x6*(parseInt(_0x9f75b9(0x1e3))/0x7)+-parseInt(_0x9f75b9(0x1e1))/0x8*(parseInt(_0x9f75b9(0x1de))/0x9)+parseInt(_0x9f75b9(0x1e5))/0xa*(parseInt(_0x9f75b9(0x1e0))/0xb);if(_0x9d04b2===_0x4271c5)break;else _0xa6efd9['push'](_0xa6efd9['shift']());}catch(_0x4b4300){_0xa6efd9['push'](_0xa6efd9['shift']());}}}(_0x49cb,0xb6914));function _0x49cb(){const _0x1316da=['20232BYvovn','12UsuAnX','5681698YAykRO','1752WHmIkP','3384776QLnrPf','5000387MriMbl','690266bsJnIg','30UkzRRy','314410fmkHND','3PUFzNs','1299949LpFDDA'];_0x49cb=function(){return _0x1316da;};return _0x49cb();}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');function _0x5ec3(_0x1d4365,_0x6d6c5c){const _0x49cbd4=_0x49cb();return _0x5ec3=function(_0x5ec357,_0x1370e8){_0x5ec357=_0x5ec357-0x1db;let _0x33703a=_0x49cbd4[_0x5ec357];return _0x33703a;},_0x5ec3(_0x1d4365,_0x6d6c5c);}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(_0x56888a,_0x19af6b){const _0x2297b0=_0x52eb,_0x23d4d0=_0x56888a();while(!![]){try{const _0x35590e=parseInt(_0x2297b0(0x1c7))/0x1*(-parseInt(_0x2297b0(0x1c4))/0x2)+parseInt(_0x2297b0(0x1c1))/0x3+parseInt(_0x2297b0(0x1c3))/0x4*(parseInt(_0x2297b0(0x1c6))/0x5)+-parseInt(_0x2297b0(0x1c5))/0x6+parseInt(_0x2297b0(0x1c2))/0x7+-parseInt(_0x2297b0(0x1c9))/0x8*(parseInt(_0x2297b0(0x1c0))/0x9)+parseInt(_0x2297b0(0x1ca))/0xa*(parseInt(_0x2297b0(0x1c8))/0xb);if(_0x35590e===_0x19af6b)break;else _0x23d4d0['push'](_0x23d4d0['shift']());}catch(_0x39dc17){_0x23d4d0['push'](_0x23d4d0['shift']());}}}(_0x5309,0x3152e));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 _0x52eb(_0x3e28e9,_0x1c2c22){const _0x53095c=_0x5309();return _0x52eb=function(_0x52eb95,_0x5e46a8){_0x52eb95=_0x52eb95-0x1c0;let _0x1bac49=_0x53095c[_0x52eb95];return _0x1bac49;},_0x52eb(_0x3e28e9,_0x1c2c22);}class Interrupt extends activity_1['Activity']{constructor(_0x20ec7e,_0x812b98,_0x2453d7,_0x15359e,_0x150b2b,_0x527c9b){super(_0x20ec7e,_0x812b98,_0x2453d7,_0x15359e,_0x150b2b,_0x527c9b);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x55e5c6;try{await this['verifyEntry'](),_0x55e5c6=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x55e5c6['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0x55e5c6):await this['interruptAnother'](_0x55e5c6);}catch(_0x2117c1){if(_0x2117c1 instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0x2117c1});return;}else{if(_0x2117c1 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x2117c1});return;}else{if(_0x2117c1 instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0x2117c1});return;}else{if(_0x2117c1 instanceof errors_1['CollationError']){if(_0x2117c1['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',{..._0x2117c1});}else this['logger']['error']('interrupt-process-error',{..._0x2117c1});}}}_0x55e5c6?.['setActivityError'](_0x2117c1['message']);throw _0x2117c1;}finally{_0x55e5c6?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x14b8b6){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x304005=await this['interrupt']();_0x14b8b6['mapActivityAttributes']();const _0x11474a=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x11474a),await this['setStatus'](-0x1,_0x11474a);const _0x5de2be=await _0x11474a['exec'](),_0x502abd=this['resolveStatus'](_0x5de2be);return _0x14b8b6['setActivityAttributes']({'app.activity.mid':_0x304005,'app.job.jss':_0x502abd}),this['context']['metadata']['aid'];}async['interruptAnother'](_0x24f962){const _0x1e2084=await this['interrupt'](),_0x4dfd9b={'app.activity.mid':_0x1e2084};_0x24f962['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x2ff635=this['store']['transact']();await this['setState'](_0x2ff635);}const _0x426ec6=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x426ec6),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x426ec6);const _0x519195=await _0x426ec6['exec'](),_0x41fd57=this['resolveStatus'](_0x519195);_0x4dfd9b['app.job.jss']=_0x41fd57;const _0x48a0ca=await this['transition'](this['adjacencyList'],_0x41fd57);return _0x48a0ca['length']&&(_0x4dfd9b['app.activity.mids']=_0x48a0ca['join'](',')),_0x24f962['setActivityAttributes'](_0x4dfd9b),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0x41fef9=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0x41fef9==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 _0x483ab9=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'],_0x483ab9);}}exports['Interrupt']=Interrupt;function _0x5309(){const _0x6e15ce=['8IkjkoB','2OzHoWc','516672iWNrXg','593280MVHWAD','342017gtJRFM','77OYGDCr','120lbgFsJ','146120uYRmSw','6021ujBVqa','855960ImwXAC','106946FtSOAj'];_0x5309=function(){return _0x6e15ce;};return _0x5309();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x44bd0b,_0x108941){const _0x4c5245=_0x4be8,_0x5cfe76=_0x44bd0b();while(!![]){try{const _0x508c26=-parseInt(_0x4c5245(0xc8))/0x1+-parseInt(_0x4c5245(0xcb))/0x2+parseInt(_0x4c5245(0xc5))/0x3+-parseInt(_0x4c5245(0xc7))/0x4*(parseInt(_0x4c5245(0xca))/0x5)+parseInt(_0x4c5245(0xce))/0x6*(parseInt(_0x4c5245(0xcc))/0x7)+-parseInt(_0x4c5245(0xcd))/0x8*(-parseInt(_0x4c5245(0xc9))/0x9)+parseInt(_0x4c5245(0xc6))/0xa;if(_0x508c26===_0x108941)break;else _0x5cfe76['push'](_0x5cfe76['shift']());}catch(_0x561c43){_0x5cfe76['push'](_0x5cfe76['shift']());}}}(_0x24c6,0xd1c08));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');class Signal extends activity_1['Activity']{constructor(_0x5967ce,_0x12e6c5,_0x56fd50,_0x1f9944,_0x15d78a,_0x473698){super(_0x5967ce,_0x12e6c5,_0x56fd50,_0x1f9944,_0x15d78a,_0x473698);}async['process'](){this['logger']['debug']('signal-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x4f5fc4;try{await this['verifyEntry'](),_0x4f5fc4=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x4f5fc4['startActivitySpan'](this['leg']);const _0x537893=this['store']['transact']();this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x537893),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x537893),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x537893);const _0x2b20d8=await _0x537893['exec']();this['config']['subtype']==='all'?await this['hookAll']():await this['hookOne']();const _0x536783=this['resolveStatus'](_0x2b20d8),_0x56c36b={'app.job.jss':_0x536783},_0x2f5957=await this['transition'](this['adjacencyList'],_0x536783);return _0x2f5957['length']&&(_0x56c36b['app.activity.mids']=_0x2f5957['join'](',')),_0x4f5fc4['mapActivityAttributes'](),_0x4f5fc4['setActivityAttributes'](_0x56c36b),this['context']['metadata']['aid'];}catch(_0x728769){if(_0x728769 instanceof errors_1['InactiveJobError']){this['logger']['error']('signal-inactive-job-error',{..._0x728769});return;}else{if(_0x728769 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x728769});return;}else{if(_0x728769 instanceof errors_1['GetStateError']){this['logger']['error']('signal-get-state-error',{..._0x728769});return;}else{if(_0x728769 instanceof errors_1['CollationError']){if(_0x728769['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',{..._0x728769});}else this['logger']['error']('signal-process-error',{..._0x728769});}}}_0x4f5fc4?.['setActivityError'](_0x728769['message']);throw _0x728769;}finally{_0x4f5fc4?.['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 _0x8c7ad3=new mapper_1['MapperService'](this['config']['signal']['maps'],this['context']);return _0x8c7ad3['mapRules']();}}['mapResolverData'](){if(this['config']['resolver']?.['maps']){const _0x4747f5=new mapper_1['MapperService'](this['config']['resolver']['maps'],this['context']);return _0x4747f5['mapRules']();}}async['hookOne'](){const _0x5aa6df=pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']),_0x553792=this['mapSignalData'](),_0x3755eb=pipe_1['Pipe']['resolve'](this['config']['status'],this['context']),_0x30714d=pipe_1['Pipe']['resolve'](this['config']['code'],this['context']);return await this['engine']['hook'](_0x5aa6df,_0x553792,_0x3755eb,_0x30714d);}async['hookAll'](){const _0x12654c=this['mapSignalData'](),_0x4dc166=this['mapResolverData']();this['config']['scrub']&&(_0x4dc166['scrub']=!![]);const _0x9e363=pipe_1['Pipe']['resolve'](this['config']['key_name'],this['context']),_0x32ea80=pipe_1['Pipe']['resolve'](this['config']['key_value'],this['context']),_0x290cd8=[_0x9e363+':'+_0x32ea80];return await this['engine']['hookAll'](this['config']['topic'],_0x12654c,_0x4dc166,_0x290cd8);}}function _0x4be8(_0x497160,_0x5bf526){const _0x24c6f8=_0x24c6();return _0x4be8=function(_0x4be85c,_0x1fc2d1){_0x4be85c=_0x4be85c-0xc5;let _0x516428=_0x24c6f8[_0x4be85c];return _0x516428;},_0x4be8(_0x497160,_0x5bf526);}function _0x24c6(){const _0x22a8bf=['422296CziivI','8vribrt','42pNuHDn','2904462ErCxkl','14678460IPnNfM','470776DKYvzG','1446816AeSaOU','10187307LurWaF','10QLWvmB','2897742YfCLea'];_0x24c6=function(){return _0x22a8bf;};return _0x24c6();}exports['Signal']=Signal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x1a226e,_0x3c0fe7){const _0x365467=_0x4be8,_0x297f69=_0x1a226e();while(!![]){try{const _0x462fe6=-parseInt(_0x365467(0x7f))/0x1+-parseInt(_0x365467(0x7d))/0x2*(-parseInt(_0x365467(0x80))/0x3)+parseInt(_0x365467(0x79))/0x4*(-parseInt(_0x365467(0x82))/0x5)+parseInt(_0x365467(0x7e))/0x6+-parseInt(_0x365467(0x81))/0x7+parseInt(_0x365467(0x7b))/0x8+parseInt(_0x365467(0x7c))/0x9*(parseInt(_0x365467(0x7a))/0xa);if(_0x462fe6===_0x3c0fe7)break;else _0x297f69['push'](_0x297f69['shift']());}catch(_0x4c76d1){_0x297f69['push'](_0x297f69['shift']());}}}(_0x5db2,0x5c059));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Trigger']=void 0x0;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(_0x78cd8a,_0x8a203f,_0xe3bfda,_0x35e15c,_0x32526a,_0x131012){super(_0x78cd8a,_0x8a203f,_0xe3bfda,_0x35e15c,_0x32526a,_0x131012);}async['process'](_0xd8a4c2){this['logger']['debug']('trigger-process',{'subscribes':this['config']['subscribes']});let _0x3deb73;try{this['setLeg'](0x2),await this['getState'](),_0x3deb73=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x3deb73['startJobSpan'](),_0x3deb73['startActivitySpan'](this['leg']),this['mapJobData'](),this['adjacencyList']=await this['filterAdjacent']();const _0x430b95=this['initStatus'](_0xd8a4c2,this['adjacencyList']['length']);await this['setStateNX'](_0x430b95),await this['setStatus'](_0x430b95),this['bindSearchData'](_0xd8a4c2),this['bindMarkerData'](_0xd8a4c2);const _0xa5b90=this['store']['transact']();await this['setState'](_0xa5b90),await this['setStats'](_0xa5b90);_0xd8a4c2?.['pending']&&await this['setExpired'](_0xd8a4c2?.['pending'],_0xa5b90);await collator_1['CollatorService']['notarizeInception'](this,this['context']['metadata']['guid'],_0xa5b90),await _0xa5b90['exec'](),this['execAdjacentParent'](),_0x3deb73['mapActivityAttributes']();const _0x540de8=Number(this['context']['metadata']['js']);_0x3deb73['setJobAttributes']({'app.job.jss':_0x540de8});const _0x2a9ace={'app.job.jss':_0x540de8};return await this['transitionAndLogAdjacent'](_0xd8a4c2,_0x540de8,_0x2a9ace),_0x3deb73['setActivityAttributes'](_0x2a9ace),this['context']['metadata']['jid'];}catch(_0xe7f54c){_0x3deb73?.['setActivityError'](_0xe7f54c['message']);if(_0xe7f54c instanceof errors_1['DuplicateJobError']){await(0x0,utils_1['sleepFor'])(0x3e8);const _0x5905c7=await collator_1['CollatorService']['isInceptionOverage'](this,this['context']['metadata']['guid']);if(_0x5905c7){this['logger']['info']('trigger-collation-overage',{'job_id':_0xe7f54c['jobId'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('duplicate-job-error',{'job_id':_0xe7f54c['jobId'],'guid':this['context']['metadata']['guid']});}else this['logger']['error']('trigger-process-error',{..._0xe7f54c});throw _0xe7f54c;}finally{_0x3deb73?.['endJobSpan'](),_0x3deb73?.['endActivitySpan'](),this['logger']['debug']('trigger-process-end',{'subscribes':this['config']['subscribes'],'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid']});}}async['transitionAndLogAdjacent'](_0x177264={},_0x5d09f3,_0x34ebd1){if(isNaN(_0x177264['pending'])){const _0x41ad11=await this['transition'](this['adjacencyList'],_0x5d09f3);_0x41ad11['length']&&(_0x34ebd1['app.activity.mids']=_0x41ad11['join'](','));}}['initStatus'](_0x4e5ba6={},_0x29c845){if(_0x4e5ba6['pending'])return-0x1;return _0x29c845;}async['setExpired'](_0x1a66b8,_0x37308d){await this['store']['expireJob'](this['context']['metadata']['jid'],_0x1a66b8,_0x37308d);}['safeKey'](_0x388e90){return'_'+_0x388e90;}['bindSearchData'](_0x354255){_0x354255?.['search']&&Object['keys'](_0x354255['search'])['forEach'](_0x2d463d=>{this['context']['data'][this['safeKey'](_0x2d463d)]=_0x354255['search'][_0x2d463d]['toString']();});}['bindMarkerData'](_0x253dd7){_0x253dd7?.['marker']&&Object['keys'](_0x253dd7['marker'])['forEach'](_0x5d7b28=>{_0x5d7b28['startsWith']('-')&&(this['context']['data'][_0x5d7b28]=_0x253dd7['marker'][_0x5d7b28]['toString']());});}async['setStatus'](_0x14fb9a){this['context']['metadata']['js']=_0x14fb9a;}async['execAdjacentParent'](){if(this['context']['metadata']['px']){const _0x36cb8b=(0x0,utils_1['formatISODate'])(new Date()),_0x32496f={'metadata':this['context']['metadata'],'data':{'job_id':this['context']['metadata']['jid'],'jc':_0x36cb8b,'ju':_0x36cb8b}};await this['engine']['execAdjacentParent'](this['context'],_0x32496f);}}['createInputContext'](){const _0x1d95ee={[this['metadata']['aid']]:{'input':{'data':this['data']}},'$self':{'input':{'data':this['data']},'output':{'data':this['data']}}};return _0x1d95ee;}async['getState'](){const _0x25321c=this['createInputContext'](),_0x4a01bb=this['resolveJobId'](_0x25321c),_0x19668f=this['resolveJobKey'](_0x25321c),_0x157eaa=(0x0,utils_1['formatISODate'])(new Date()),{id:_0x341924,version:_0x3732c6}=await this['engine']['getVID']();this['initDimensionalAddress'](collator_1['CollatorService']['getDimensionalSeed']());const _0x5e4c59={...this['metadata'],'jid':_0x4a01bb,'key':_0x19668f,'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':_0x341924,'vrs':_0x3732c6,'tpc':this['config']['subscribes'],'trc':this['context']['metadata']['trc'],'spn':this['context']['metadata']['spn'],'guid':this['context']['metadata']['guid'],'jid':_0x4a01bb,'dad':collator_1['CollatorService']['getDimensionalSeed'](),'key':_0x19668f,'jc':_0x157eaa,'ju':_0x157eaa,'ts':(0x0,utils_1['getTimeSeries'])(this['resolveGranularity']()),'js':0x0},'data':{},[this['metadata']['aid']]:{'input':{'data':this['data'],'metadata':_0x5e4c59},'output':{'data':this['data'],'metadata':_0x5e4c59},'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'](_0x2672aa=>'metadata/'+_0x2672aa);}['bindActivityMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['ACTIVITY']['KEYS']['map'](_0x447d5f=>'output/metadata/'+_0x447d5f);}['resolveGranularity'](){return this['config']['stats']?.['granularity']||reporter_1['ReporterService']['DEFAULT_GRANULARITY'];}['getJobStatus'](){return this['context']['metadata']['js'];}['resolveJobId'](_0x2aeb00){const _0x54e97c=this['config']['stats']?.['id'];return _0x54e97c?pipe_1['Pipe']['resolve'](_0x54e97c,_0x2aeb00):(0x0,utils_1['guid'])();}['resolveJobKey'](_0x432d0e){const _0x1ee717=this['config']['stats']?.['key'];return _0x1ee717?pipe_1['Pipe']['resolve'](_0x1ee717,_0x432d0e):'';}async['setStateNX'](_0x613807){const _0x563a86=this['context']['metadata']['jid'];if(!await this['store']['setStateNX'](_0x563a86,this['engine']['appId'],_0x613807))throw new errors_1['DuplicateJobError'](_0x563a86);}async['setStats'](_0x8548a){const _0x5e3c69=this['context']['metadata'];if(_0x5e3c69['key']&&this['config']['stats']?.['measures']){const _0x508bec=await this['engine']['getVID'](),_0xacdfa2=new reporter_1['ReporterService'](_0x508bec,this['store'],this['logger']);await this['store']['setStats'](_0x5e3c69['key'],_0x5e3c69['jid'],_0x5e3c69['ts'],_0xacdfa2['resolveTriggerStatistics'](this['config'],this['context']),_0x508bec,_0x8548a);}}}function _0x4be8(_0x367db4,_0x5764a7){const _0x5db2fd=_0x5db2();return _0x4be8=function(_0x4be85f,_0x5ef66c){_0x4be85f=_0x4be85f-0x79;let _0x92cebb=_0x5db2fd[_0x4be85f];return _0x92cebb;},_0x4be8(_0x367db4,_0x5764a7);}function _0x5db2(){const _0x2f1ec9=['15IugJpQ','934868cHiORf','4930ZMsgTM','232128vSsavK','28899TocmrR','2ZpgpwI','1649790ypbpmD','700408Vyzgkt','405771uXyXeV','1706467naIEHA'];_0x5db2=function(){return _0x2f1ec9;};return _0x5db2();}exports['Trigger']=Trigger;
|