@hotmeshio/hotmesh 0.3.23 → 0.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/build/modules/key.js +1 -1
- package/build/modules/utils.js +1 -1
- package/build/package.json +3 -3
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.js +1 -1
- package/build/services/activities/index.js +1 -1
- package/build/services/activities/interrupt.js +1 -1
- package/build/services/activities/signal.js +1 -1
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.js +1 -1
- package/build/services/connector/providers/postgres.js +1 -0
- 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/meshcall/index.js +3 -1
- package/build/services/meshdata/index.d.ts +2 -3
- package/build/services/meshdata/index.js +4 -6
- package/build/services/meshflow/client.js +3 -1
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/workflow.d.ts +8 -0
- package/build/services/meshflow/workflow.js +41 -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.d.ts +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/index.d.ts +5 -5
- package/build/services/sub/providers/nats/nats.js +1 -1
- package/build/services/sub/providers/postgres/postgres.d.ts +3 -3
- package/build/services/sub/providers/postgres/postgres.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.d.ts +1 -0
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/build/types/quorum.d.ts +7 -1
- package/package.json +3 -3
- package/types/quorum.ts +9 -1
package/README.md
CHANGED
|
@@ -201,7 +201,7 @@ npm install @hotmeshio/hotmesh
|
|
|
201
201
|
<br/>
|
|
202
202
|
|
|
203
203
|
## MeshFlow
|
|
204
|
-
[MeshFlow](https://hotmeshio.github.io/sdk-typescript/classes/services_meshflow.MeshFlow.html) is a serverless
|
|
204
|
+
[MeshFlow](https://hotmeshio.github.io/sdk-typescript/classes/services_meshflow.MeshFlow.html) is a serverless alternative to *Temporal.io*
|
|
205
205
|
|
|
206
206
|
<details style="padding: .5em">
|
|
207
207
|
<summary style="font-size:1.25em;">Orchestrate unpredictable activities <small>[more]</small></summary>
|
|
@@ -755,7 +755,9 @@ This example demonstrates how to search for those workflows where a given condit
|
|
|
755
755
|
<br/>
|
|
756
756
|
|
|
757
757
|
## Connect
|
|
758
|
-
HotMesh is pluggable and
|
|
758
|
+
HotMesh is pluggable and fully supports **Postgres** and **Redis/ValKey** backends.
|
|
759
|
+
|
|
760
|
+
**NATS** can be added for *pub-sub* support (when extended pattern matching is desired). And *streams* support is currently in alpha (**NATS** + **JetStream** + **Postgres**).
|
|
759
761
|
|
|
760
762
|
<details style="padding: .5em">
|
|
761
763
|
<summary style="font-size:1.25em;">Postgres <small>[more]</small></summary>
|
package/build/modules/key.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';const j=b;function b(c,d){const e=a();return b=function(f,g){f=f-0x11c;let h=e[f];return h;},b(c,d);}(function(c,d){const i=b,e=c();while(!![]){try{const f=-parseInt(i(0x138))/0x1+parseInt(i(0x161))/0x2+-parseInt(i(0x128))/0x3+parseInt(i(0x162))/0x4+-parseInt(i(0x12b))/0x5*(-parseInt(i(0x15f))/0x6)+parseInt(i(0x12f))/0x7+-parseInt(i(0x163))/0x8*(parseInt(i(0x139))/0x9);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x374dd));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[j(0x120)]=exports[j(0x126)]=exports[j(0x13b)]=exports[j(0x127)]=exports[j(0x11f)]=exports['KeyType']=exports[j(0x122)]=void 0x0;const hotmesh_1=require(j(0x155));Object['defineProperty'](exports,j(0x135),{'enumerable':!![],'get':function(){return hotmesh_1['KeyType'];}});const HMNS='hmsh';exports['HMNS']=HMNS;const KEYSEP=':';function a(){const o=['activityId','facet','498XfuipO','sym','772050HFQozY','858336lGewkt','21304bUwGXE','task_lists','topic','THROTTLE_RATE',':sym:keys:','HOTMESH','roles','task_priorities','parseKey','JOB_STATS_INDEX',':signals','HMNS','VALSEP','SUBSCRIPTIONS','KeyService','jobs','stats','symbols','WEBSEP','KEYSEP','991680mOsuwF',':sym:vals:','SYMKEYS','10715eCbWlU','split','events','resolveAbbreviation','2860550cusQEq',':j:','unknown_entity','JOB_STATE','appId',':a:','KeyType','signals',':hooks','134725qJWpiD','1674RfprvA',':s:','TYPSEP','SUBSCRIPTION_PATTERNS','signal_patterns','STREAMS','jobKey',':v:','hooks','versions','stream_topics',':subscriptions','reconstituteKey','SCHEMAS','scoutType','JOB_DEPENDENTS','join','timeValue','streams',':w:','JOB_STATS_MEDIAN','mintKey',':transitions','engineId','appVersion','throttles','task_schedules','TIME_RANGE','../types/hotmesh',':x:','resolveEntityType','dateTime',':schemas',':r:','JOB_STATS_GENERAL','Invalid\x20key\x20type.'];a=function(){return o;};return a();}exports[j(0x127)]=KEYSEP;const VALSEP='::';exports[j(0x120)]=VALSEP;const WEBSEP='::';exports[j(0x126)]=WEBSEP;const TYPSEP='::';exports[j(0x13b)]=TYPSEP;class KeyService{static[j(0x14e)](c,d,e){const k=j;switch(d){case hotmesh_1['KeyType'][k(0x168)]:return c;case hotmesh_1[k(0x135)][k(0x166)]:return c+':'+e[k(0x133)]+k(0x15a);case hotmesh_1[k(0x135)]['WORK_ITEMS']:return c+':'+e[k(0x133)]+k(0x14c)+(e[k(0x147)]||'');case hotmesh_1[k(0x135)][k(0x154)]:return c+':'+e['appId']+':t:'+(e[k(0x14a)]||'');case hotmesh_1[k(0x135)]['APP']:return c+k(0x134)+(e[k(0x133)]||'');case hotmesh_1[k(0x135)]['QUORUM']:return c+':'+e[k(0x133)]+':q:'+(e[k(0x150)]||'');case hotmesh_1[k(0x135)][k(0x132)]:return c+':'+e[k(0x133)]+k(0x130)+e['jobId'];case hotmesh_1[k(0x135)][k(0x148)]:return c+':'+e['appId']+':d:'+e['jobId'];case hotmesh_1['KeyType'][k(0x15b)]:return c+':'+e[k(0x133)]+k(0x13a)+e['jobKey']+':'+e[k(0x158)];case hotmesh_1[k(0x135)][k(0x14d)]:return c+':'+e[k(0x133)]+k(0x13a)+e[k(0x13f)]+':'+e[k(0x158)]+':'+e[k(0x15e)];case hotmesh_1[k(0x135)][k(0x11d)]:return c+':'+e['appId']+k(0x13a)+e[k(0x13f)]+':'+e['dateTime']+':'+e['facet'];case hotmesh_1['KeyType'][k(0x146)]:return c+':'+e['appId']+k(0x140)+e[k(0x151)]+k(0x159);case hotmesh_1[k(0x135)][k(0x121)]:return c+':'+e['appId']+k(0x140)+e['appVersion']+k(0x144);case hotmesh_1[k(0x135)][k(0x13c)]:return c+':'+e[k(0x133)]+':v:'+e[k(0x151)]+k(0x14f);case hotmesh_1[k(0x135)]['HOOKS']:return c+':'+e[k(0x133)]+k(0x137);case hotmesh_1['KeyType']['SIGNALS']:return c+':'+e['appId']+k(0x11e);case hotmesh_1['KeyType'][k(0x12a)]:return c+':'+e[k(0x133)]+k(0x167)+(e[k(0x15d)]||'');case hotmesh_1[k(0x135)]['SYMVALS']:return c+':'+e[k(0x133)]+k(0x129);case hotmesh_1[k(0x135)][k(0x13e)]:return c+':'+(e['appId']||'')+k(0x156)+(e[k(0x165)]||'');default:throw new Error(k(0x15c));}}static[j(0x11c)](c){const l=j,[d,e,f,...g]=c[l(0x12c)](KEYSEP),h=g[l(0x149)](KEYSEP)||'';return{'namespace':d,'app':f==='a'?e:undefined,'entity':f,'id':h};}static[j(0x145)](c){const {namespace:d,app:e,entity:f,id:g}=c;return''+d+KEYSEP+e+KEYSEP+f+KEYSEP+(g||'');}static[j(0x157)](c,d=''){const m=j;switch(c){case'a':return'applications';case'r':return m(0x152);case'w':return d===''?m(0x16a):m(0x169);case't':return d===''?m(0x153):'task_lists';case'q':return m(0x12d);case'j':return m(0x123);case's':return m(0x124);case'v':return m(0x142);case'x':return d===''?m(0x14b):m(0x143);case m(0x141):return m(0x13d);case m(0x136):return'signal_registry';case m(0x160):return m(0x125);default:return m(0x131);}}static[j(0x12e)](c){const n=j;switch(c){case'applications':return'a';case n(0x152):return'r';case n(0x169):return'w';case n(0x153):return't';case n(0x164):return't';case n(0x12d):return'q';case'jobs':return'j';case n(0x124):return's';case n(0x142):return'v';case'streams':return'x';case n(0x13d):return n(0x141);case'signal_registry':return'signals';case n(0x125):return'sym';default:return n(0x131);}}}exports[j(0x122)]=KeyService;
|
package/build/modules/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x506e30,_0x4cb3d8){const _0x448f0c=_0x599a,_0x40836a=_0x506e30();while(!![]){try{const _0x4f1941=-parseInt(_0x448f0c(0x9d))/0x1*(-parseInt(_0x448f0c(0xa2))/0x2)+-parseInt(_0x448f0c(0xa6))/0x3*(-parseInt(_0x448f0c(0xa4))/0x4)+-parseInt(_0x448f0c(0x9c))/0x5*(-parseInt(_0x448f0c(0xa0))/0x6)+-parseInt(_0x448f0c(0x9b))/0x7*(-parseInt(_0x448f0c(0xa3))/0x8)+parseInt(_0x448f0c(0xa5))/0x9+parseInt(_0x448f0c(0xa1))/0xa*(-parseInt(_0x448f0c(0x9e))/0xb)+-parseInt(_0x448f0c(0x9f))/0xc;if(_0x4f1941===_0x4cb3d8)break;else _0x40836a['push'](_0x40836a['shift']());}catch(_0x3349){_0x40836a['push'](_0x40836a['shift']());}}}(_0x2275,0x36452));var __importDefault=this&&this['__importDefault']||function(_0x3a9765){return _0x3a9765&&_0x3a9765['__esModule']?_0x3a9765:{'default':_0x3a9765};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['isStreamMessage']=exports['parseStreamMessage']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['polyfill']=exports['identifyProvider']=exports['XSleepFor']=exports['sleepImmediate']=exports['sleepFor']=exports['guid']=exports['deterministicRandom']=exports['deepCopy']=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),logger_1=require('../services/logger'),enums_1=require('./enums'),logger=new logger_1['LoggerService']('hotmesh','utils'),hashOptions=_0x29a493=>{const _0x3a5e10=JSON['stringify'](_0x29a493);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x3a5e10)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x1c8830=os_1['default']['totalmem'](),_0x4b1eaa=os_1['default']['freemem'](),_0x1637f0=_0x1c8830-_0x4b1eaa,_0x2ea3e7={'TotalMemoryGB':(_0x1c8830/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x4b1eaa/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x1637f0/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x2ea3e7;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x458fa7){return JSON['parse'](JSON['stringify'](_0x458fa7));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x5925b1){const _0x4ea948=Math['sin'](_0x5925b1)*0x2710;return _0x4ea948-Math['floor'](_0x4ea948);}exports['deterministicRandom']=deterministicRandom;function guid(_0x521d10=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x521d10);}exports['guid']=guid;async function sleepFor(_0x447811){return new Promise(_0x29fdc1=>setTimeout(_0x29fdc1,_0x447811));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x181891=>setImmediate(_0x181891));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0x129e25){let _0x54b1b8;const _0xce1e5d=new Promise(_0xd4be33=>{_0x54b1b8=setTimeout(_0xd4be33,_0x129e25);});return{'promise':_0xce1e5d,'timerId':_0x54b1b8};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x376a00){const _0x1ee301=Object['getPrototypeOf'](_0x376a00);if(_0x376a00['Query']?.['prototype']||Object['keys'](_0x376a00)['includes']('database')||_0x1ee301['name']==='Pool')return'postgres';else{if(_0x376a00['toString']()['toLowerCase']()['includes']('nats'))return'nats';else{if('defineCommand'in _0x1ee301||Object['keys'](_0x1ee301)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x1ee301)['includes']('Multi'))return'redis';}}}if(_0x376a00['constructor']){if(_0x376a00['constructor']['name']==='Redis'||_0x376a00['constructor']['name']==='EventEmitter'){if('hset'in _0x376a00)return'ioredis';}else{if(_0x376a00['constructor']['name']==='ProviderClient'||_0x376a00['constructor']['name']==='Commander'){if('HSET'in _0x376a00)return'redis';}}}let _0x1f6b71=null;if(Object['keys'](_0x376a00)['includes']('connection')||!isNaN(_0x376a00['totalCount'])&&!isNaN(_0x376a00['idleCount']))_0x1f6b71='postgres';else{if(Object['keys'](_0x376a00)['includes']('Pipeline'))_0x1f6b71='ioredis';else{if(Object['keys'](_0x376a00)['includes']('createClient'))_0x1f6b71='redis';else _0x1ee301['constructor']['toString']()['includes']('NatsConnectionImpl')&&(_0x1f6b71='nats');}}return _0x1f6b71;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x97aba6){return _0x97aba6==='activity'?'hook':_0x97aba6;},'providerConfig'(_0x4714d8){return _0x4714d8?.['connection']??_0x4714d8?.['redis']??_0x4714d8?.['connections'];},'meshDataConfig'(_0x454927){return{..._0x454927['connection']};}};function matchesStatusCode(_0x2c19a9,_0x7d9939){if(typeof _0x7d9939==='string'){const _0x1f445d='^'+_0x7d9939['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x1f445d)['test'](_0x2c19a9['toString']());}return _0x7d9939['test'](_0x2c19a9['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x4d570c,_0x1d34c4){return _0x4d570c===_0x1d34c4;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x4dfcb4,_0x6906a6){for(const [_0x2fae23,_0x5647f3]of Object['entries'](_0x4dfcb4)){if(_0x5647f3['hasOwnProperty'](_0x6906a6)){const _0x5468d9=findTopKey(_0x4dfcb4,_0x2fae23['replace'](/^\./,''));return(_0x5468d9||_0x2fae23)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x5e06b6,_0x78ef49){for(const [_0x24acd7,_0x49097f]of Object['entries'](_0x5e06b6)){if(_0x49097f===_0x78ef49)return _0x24acd7;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x1d8c6b,_0x5968b9,_0x2d21ce){const _0x5c82c2=await _0x5968b9['getTransitions'](_0x2d21ce),_0x2456b4=await _0x5968b9['getSubscriptions'](_0x2d21ce),_0x142112=findTopKey(_0x5c82c2,_0x1d8c6b),_0x514bc6=findSubscriptionForTrigger(_0x2456b4,_0x142112);return _0x514bc6;}function _0x2275(){const _0x565024=['594378NachDd','861830xvvovb','58Tiufkt','8yAAEvG','4jvhFJw','350460MIECWJ','1266261tHalgM','1302007xieomR','10XHNJGL','57IJaSoQ','22UAiBwL','5425812YgBXVG'];_0x2275=function(){return _0x565024;};return _0x2275();}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x160053){if(_0x160053['toString']()==='infinity')return'0';const _0x3f61c8=new Date(),_0x38b545=_0x160053['slice'](-0x1),_0x5caf48=parseInt(_0x160053['slice'](0x0,-0x1),0xa);if(_0x38b545==='m'){const _0x190cff=Math['floor'](_0x3f61c8['getMinutes']()/_0x5caf48)*_0x5caf48;_0x3f61c8['setUTCMinutes'](_0x190cff,0x0,0x0);}else _0x38b545==='h'&&_0x3f61c8['setUTCMinutes'](0x0,0x0,0x0);return _0x3f61c8['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x1fa524){const _0x8cfa0f=_0x1fa524 instanceof Date?_0x1fa524:new Date(_0x1fa524);return _0x8cfa0f['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x25a2a8){const _0xad3840='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x140d6a=_0xad3840['length'];if(_0x25a2a8<0x0||_0x25a2a8>=Math['pow'](_0x140d6a,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x5c8ad6,_0x5493ae]=divmod(_0x25a2a8,_0x140d6a),[_0x451f59,_0x38a274]=divmod(_0x5c8ad6,_0x140d6a);return _0xad3840[_0x451f59]+_0xad3840[_0x5493ae]+_0xad3840[_0x38a274];}exports['getSymKey']=getSymKey;function getSymVal(_0x416dab){const _0x353d12='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x3cd720=_0x353d12['length'];if(_0x416dab<0x0||_0x416dab>=Math['pow'](_0x3cd720,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x38f522,_0x321fdc]=divmod(_0x416dab,_0x3cd720);return _0x353d12[_0x38f522]+_0x353d12[_0x321fdc];}exports['getSymVal']=getSymVal;function divmod(_0x5654db,_0x2db4a5){return[Math['floor'](_0x5654db/_0x2db4a5),_0x5654db%_0x2db4a5];}function getIndexedHash(_0xe17d52,_0x4cb0cd){const _0x3b2ff6=_0xe17d52[_0x4cb0cd]||0x0,_0x56a40f={..._0xe17d52};return delete _0x56a40f[_0x4cb0cd],[_0x3b2ff6,_0x56a40f];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x53c1a5,_0x2de8b0){const _0x2ebcc6=_0x2de8b0['split']('/');let _0x2e6960=_0x53c1a5;for(const _0x47d89f of _0x2ebcc6){if(_0x2e6960[_0x47d89f]!==undefined)_0x2e6960=_0x2e6960[_0x47d89f];else return undefined;}return _0x2e6960;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x35bd72){const _0x5650ff={};for(const _0x37c0d2 in _0x35bd72){if(_0x35bd72[_0x37c0d2]===undefined)continue;const _0x18052a=_0x37c0d2['split']('/');let _0x48b3a8=_0x5650ff;for(let _0xfc81bb=0x0;_0xfc81bb<_0x18052a['length'];_0xfc81bb++){_0xfc81bb===_0x18052a['length']-0x1?_0x48b3a8[_0x18052a[_0xfc81bb]]=_0x35bd72[_0x37c0d2]:(_0x48b3a8[_0x18052a[_0xfc81bb]]=_0x48b3a8[_0x18052a[_0xfc81bb]]||{},_0x48b3a8=_0x48b3a8[_0x18052a[_0xfc81bb]]);}}return _0x5650ff;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x312908){const _0x1f83d1=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x1f83d1['test'](_0x312908);}exports['isValidCron']=isValidCron;const s=_0x3f4d60=>{return(0x0,ms_1['default'])(_0x3f4d60)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x4cff7d=>{try{return JSON['parse'](_0x4cff7d);}catch(_0x1d43fa){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x1d43fa});throw _0x1d43fa;}};exports['parseStreamMessage']=parseStreamMessage;function _0x599a(_0x45baf1,_0x50309b){const _0x227593=_0x2275();return _0x599a=function(_0x599ace,_0x55aa67){_0x599ace=_0x599ace-0x9b;let _0x298b2e=_0x227593[_0x599ace];return _0x298b2e;},_0x599a(_0x45baf1,_0x50309b);}const isStreamMessage=_0x1ee230=>{return Array['isArray'](_0x1ee230)&&Array['isArray'](_0x1ee230[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x2caf60=>{const _0x4b549c=[];let _0x1ee37b;for(let _0x5cca39=0x1;_0x5cca39<_0x2caf60['length'];_0x5cca39++){const _0x57448e=_0x2caf60[_0x5cca39],_0xa05b32={};if(Array['isArray'](_0x57448e)){for(let _0x50c096=0x0;_0x50c096<_0x57448e['length'];_0x50c096+=0x2){const _0x1a4e5d=_0x57448e[_0x50c096],_0x21531e=_0x57448e[_0x50c096+0x1];_0xa05b32[_0x1a4e5d]=_0x21531e;}_0x1ee37b&&(_0xa05b32['$']=_0x1ee37b),_0x4b549c['push'](_0xa05b32),_0x1ee37b=undefined;}else _0x1ee37b=_0x57448e;}return _0x4b549c;};exports['arrayToHash']=arrayToHash;
|
|
1
|
+
'use strict';const o=b;(function(c,d){const n=b,e=c();while(!![]){try{const f=parseInt(n(0x206))/0x1*(parseInt(n(0x208))/0x2)+parseInt(n(0x1b7))/0x3*(-parseInt(n(0x1c2))/0x4)+parseInt(n(0x1ef))/0x5*(-parseInt(n(0x1f9))/0x6)+-parseInt(n(0x1f2))/0x7*(-parseInt(n(0x1ce))/0x8)+-parseInt(n(0x1eb))/0x9+parseInt(n(0x1ee))/0xa+parseInt(n(0x1ec))/0xb*(parseInt(n(0x1b8))/0xc);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xab1c6));var __importDefault=this&&this[o(0x1cf)]||function(c){const p=o;return c&&c[p(0x1e6)]?c:{'default':c};};Object['defineProperty'](exports,o(0x1e6),{'value':!![]}),exports[o(0x20a)]=exports[o(0x1fd)]=exports[o(0x1bb)]=exports['s']=exports[o(0x1f3)]=exports[o(0x1f1)]=exports['getValueByPath']=exports[o(0x1cd)]=exports[o(0x1a9)]=exports[o(0x1c8)]=exports['formatISODate']=exports[o(0x1dd)]=exports[o(0x1d2)]=exports[o(0x1ad)]=exports[o(0x1e3)]=exports['matchesStatus']=exports[o(0x1dc)]=exports[o(0x1ab)]=exports['identifyProvider']=exports[o(0x1e8)]=exports[o(0x1cc)]=exports[o(0x1ff)]=exports['guid']=exports[o(0x1c6)]=exports[o(0x1fb)]=exports[o(0x1d0)]=exports[o(0x1d5)]=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),logger_1=require(o(0x1ac)),enums_1=require('./enums'),logger=new logger_1['LoggerService']('hotmesh',o(0x204)),hashOptions=c=>{const q=o,d=JSON[q(0x203)](c);return(0x0,crypto_1[q(0x205)])('sha256')[q(0x1d8)](d)['digest']('hex');};exports[o(0x1d5)]=hashOptions;function a(){const M=['idleCount','parseStreamMessage','freemem','pow','Error\x20parsing\x20Stream\x20message','Multi','toISOString','getValueByPath','32XWcCqh','string','redis','guid','deterministicRandom','connections','getSymKey','push','split','toFixed','sleepImmediate','getIndexedHash','48AEzMYl','__importDefault','getSystemHealth','identifyProvider','getSubscriptionTopic','HMSH_GUID_SIZE','Pool','hashOptions','activity','default','update','constructor','Pipeline','replace','matchesStatusCode','getTimeSeries','includes','slice','Query','isArray','prototype','findTopKey','getTransitions','sin','__esModule','NatsConnectionImpl','XSleepFor','ioredis','setUTCMinutes','9293328hMHndz','88DOTkoO','Redis','7561570sRiMVJ','101215cNrAOb','length','restoreHierarchy','188188wadAZD','isValidCron','floor','getMinutes','hook','ProviderClient','parse','174mlUCOv','postgres','deepCopy','defineCommand','isStreamMessage','name','sleepFor','abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','Number\x20out\x20of\x20range','error','stringify','utils','createHash','188688GDIBzJ','hasOwnProperty','2FmKKwc','HSET','arrayToHash','test','getSymVal','createClient','polyfill','../services/logger','findSubscriptionForTrigger','getPrototypeOf','toLowerCase','entries','toString','Commander','connection','\x20GB','keys','hset','393423RBSUAY','3395232Kpcmmg','nats'];a=function(){return M;};return a();}async function getSystemHealth(){const r=o,c=os_1[r(0x1d7)]['totalmem'](),d=os_1[r(0x1d7)][r(0x1bc)](),e=c-d,f={'TotalMemoryGB':(c/0x400/0x400/0x400)[r(0x1cb)](0x2)+'\x20GB','FreeMemoryGB':(d/0x400/0x400/0x400)[r(0x1cb)](0x2)+r(0x1b4),'UsedMemoryGB':(e/0x400/0x400/0x400)['toFixed'](0x2)+r(0x1b4),'CPULoad':[],'NetworkStats':[]};return f;}exports[o(0x1d0)]=getSystemHealth;function deepCopy(c){const t=o;return JSON[t(0x1f8)](JSON['stringify'](c));}exports['deepCopy']=deepCopy;function deterministicRandom(c){const u=o,d=Math[u(0x1e5)](c)*0x2710;return d-Math[u(0x1f4)](d);}exports['deterministicRandom']=deterministicRandom;function guid(c=enums_1[o(0x1d3)]){return'H'+(0x0,nanoid_1['nanoid'])(c);}exports[o(0x1c5)]=guid;async function sleepFor(c){return new Promise(d=>setTimeout(d,c));}exports[o(0x1ff)]=sleepFor;function sleepImmediate(){return new Promise(c=>setImmediate(c));}exports[o(0x1cc)]=sleepImmediate;function XSleepFor(c){let d;const e=new Promise(f=>{d=setTimeout(f,c);});return{'promise':e,'timerId':d};}exports[o(0x1e8)]=XSleepFor;function identifyProvider(c){const v=o,d=Object[v(0x1ae)](c);if(c[v(0x1e0)]?.[v(0x1e2)]||Object['keys'](c)[v(0x1de)]('database')||d[v(0x1fe)]===v(0x1d4))return'postgres';else{if(c[v(0x1b1)]()[v(0x1af)]()['includes']('nats'))return v(0x1b9);else{if(v(0x1fc)in d||Object[v(0x1b5)](d)[v(0x1de)]('multi'))return v(0x1e9);else{if(Object[v(0x1b5)](d)['includes'](v(0x1bf)))return v(0x1c4);}}}if(c[v(0x1d9)]){if(c[v(0x1d9)][v(0x1fe)]===v(0x1ed)||c[v(0x1d9)][v(0x1fe)]==='EventEmitter'){if(v(0x1b6)in c)return v(0x1e9);}else{if(c[v(0x1d9)][v(0x1fe)]===v(0x1f7)||c[v(0x1d9)][v(0x1fe)]===v(0x1b2)){if(v(0x209)in c)return v(0x1c4);}}}let e=null;if(Object[v(0x1b5)](c)['includes']('connection')||!isNaN(c['totalCount'])&&!isNaN(c[v(0x1ba)]))e=v(0x1fa);else{if(Object[v(0x1b5)](c)[v(0x1de)](v(0x1da)))e=v(0x1e9);else{if(Object[v(0x1b5)](c)[v(0x1de)](v(0x1aa)))e=v(0x1c4);else d['constructor'][v(0x1b1)]()[v(0x1de)](v(0x1e7))&&(e=v(0x1b9));}}return e;}exports[o(0x1d1)]=identifyProvider,exports['polyfill']={'resolveActivityType'(c){const w=o;return c===w(0x1d6)?w(0x1f6):c;},'providerConfig'(c){const x=o;return c?.['connection']??c?.[x(0x1c4)]??c?.[x(0x1c7)];},'meshDataConfig'(c){const y=o;return{...c[y(0x1b3)]};}};function matchesStatusCode(c,d){const z=o;if(typeof d===z(0x1c3)){const e='^'+d[z(0x1db)](/\*/g,'\x5cd')+'$';return new RegExp(e)[z(0x1a8)](c[z(0x1b1)]());}return d[z(0x1a8)](c['toString']());}exports[o(0x1dc)]=matchesStatusCode;function matchesStatus(c,d){return c===d;}exports['matchesStatus']=matchesStatus;function findTopKey(c,d){const A=o;for(const [e,f]of Object[A(0x1b0)](c)){if(f[A(0x207)](d)){const g=findTopKey(c,e[A(0x1db)](/^\./,''));return(g||e)[A(0x1db)](/^\./,'');}}return null;}exports[o(0x1e3)]=findTopKey;function findSubscriptionForTrigger(c,d){const B=o;for(const [e,f]of Object[B(0x1b0)](c)){if(f===d)return e;}return null;}exports[o(0x1ad)]=findSubscriptionForTrigger;async function getSubscriptionTopic(c,d,e){const C=o,f=await d[C(0x1e4)](e),g=await d['getSubscriptions'](e),h=findTopKey(f,c),i=findSubscriptionForTrigger(g,h);return i;}exports[o(0x1d2)]=getSubscriptionTopic;function getTimeSeries(c){const D=o;if(c[D(0x1b1)]()==='infinity')return'0';const d=new Date(),e=c[D(0x1df)](-0x1),f=parseInt(c['slice'](0x0,-0x1),0xa);if(e==='m'){const g=Math[D(0x1f4)](d[D(0x1f5)]()/f)*f;d[D(0x1ea)](g,0x0,0x0);}else e==='h'&&d[D(0x1ea)](0x0,0x0,0x0);return d[D(0x1c0)]()[D(0x1db)](/:\d\d\..+|-|T/g,'')[D(0x1db)](':','');}exports[o(0x1dd)]=getTimeSeries;function formatISODate(c){const E=o,d=c instanceof Date?c:new Date(c);return d[E(0x1c0)]()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(c){const F=o,d=F(0x200),e=d[F(0x1f0)];if(c<0x0||c>=Math['pow'](e,0x3))throw new Error('Number\x20out\x20of\x20range');const [f,g]=divmod(c,e),[h,i]=divmod(f,e);return d[h]+d[g]+d[i];}exports['getSymKey']=getSymKey;function getSymVal(c){const G=o,d=G(0x200),e=d[G(0x1f0)];if(c<0x0||c>=Math[G(0x1bd)](e,0x2))throw new Error(G(0x201));const [f,g]=divmod(c,e);return d[f]+d[g];}exports['getSymVal']=getSymVal;function divmod(c,d){const H=o;return[Math[H(0x1f4)](c/d),c%d];}function getIndexedHash(c,d){const e=c[d]||0x0,f={...c};return delete f[d],[e,f];}exports[o(0x1cd)]=getIndexedHash;function getValueByPath(c,d){const I=o,e=d[I(0x1ca)]('/');let f=c;for(const g of e){if(f[g]!==undefined)f=f[g];else return undefined;}return f;}exports[o(0x1c1)]=getValueByPath;function b(c,d){const e=a();return b=function(f,g){f=f-0x1a8;let h=e[f];return h;},b(c,d);}function restoreHierarchy(c){const d={};for(const e in c){if(c[e]===undefined)continue;const f=e['split']('/');let g=d;for(let h=0x0;h<f['length'];h++){h===f['length']-0x1?g[f[h]]=c[e]:(g[f[h]]=g[f[h]]||{},g=g[f[h]]);}}return d;}exports[o(0x1f1)]=restoreHierarchy;function isValidCron(c){const d=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return d['test'](c);}exports[o(0x1f3)]=isValidCron;const s=c=>{return(0x0,ms_1['default'])(c)/0x3e8;};exports['s']=s;const parseStreamMessage=c=>{const J=o;try{return JSON[J(0x1f8)](c);}catch(d){logger[J(0x202)](J(0x1be),{...d});throw d;}};exports[o(0x1bb)]=parseStreamMessage;const isStreamMessage=c=>{const K=o;return Array[K(0x1e1)](c)&&Array[K(0x1e1)](c[0x0]);};exports[o(0x1fd)]=isStreamMessage;const arrayToHash=c=>{const L=o,d=[];let e;for(let f=0x1;f<c['length'];f++){const g=c[f],h={};if(Array['isArray'](g)){for(let k=0x0;k<g['length'];k+=0x2){const l=g[k],m=g[k+0x1];h[l]=m;}e&&(h['$']=e),d[L(0x1c9)](h),e=undefined;}else e=g;}return d;};exports['arrayToHash']=arrayToHash;
|
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/hotmesh",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.25",
|
|
4
4
|
"description": "Serverless Workflow",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"test:meshflow:hello": "HMSH_LOGLEVEL=debug HMSH_IS_CLUSTER=true NODE_ENV=test jest ./tests/meshflow/helloworld/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
35
35
|
"test:meshflow:hook": "NODE_ENV=test jest ./tests/meshflow/hook/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
36
36
|
"test:meshflow:interrupt": "NODE_ENV=test jest ./tests/meshflow/interrupt/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
37
|
-
"test:meshflow:loopactivity": "NODE_ENV=test jest ./tests/meshflow/loopactivity
|
|
37
|
+
"test:meshflow:loopactivity": "NODE_ENV=test jest ./tests/meshflow/loopactivity/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
38
38
|
"test:meshflow:nested": "NODE_ENV=test jest ./tests/meshflow/nested/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
39
39
|
"test:meshflow:retry": "NODE_ENV=test jest ./tests/meshflow/retry/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
40
40
|
"test:meshflow:sleep": "NODE_ENV=test jest ./tests/meshflow/sleep/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"test:sub:nats": "NODE_ENV=test jest ./tests/functional/sub/providers/nats/nats.test.ts --detectOpenHandles --forceExit --verbose",
|
|
72
72
|
"test:trigger": "NODE_ENV=test jest ./tests/unit/services/activities/trigger.test.ts --detectOpenHandles --forceExit --verbose",
|
|
73
73
|
"test:meshdata": "NODE_ENV=test jest ./tests/meshdata/*.test.ts --forceExit --verbose --detectOpenHandles",
|
|
74
|
-
"test:meshos": "NODE_ENV=test HMSH_IS_CLUSTER=true jest ./tests/meshos/*.test.ts --forceExit --verbose --detectOpenHandles",
|
|
74
|
+
"test:meshos": "HMSH_LOGLEVEL=debug NODE_ENV=test HMSH_IS_CLUSTER=true jest ./tests/meshos/*.test.ts --forceExit --verbose --detectOpenHandles",
|
|
75
75
|
"test:meshcall": "NODE_ENV=test jest ./tests/meshcall/*.test.ts --forceExit --verbose --detectOpenHandles",
|
|
76
76
|
"test:unit": "NODE_ENV=test jest ./tests/unit/*/*/index.test.ts --detectOpenHandles --forceExit --verbose"
|
|
77
77
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _0x130c(){const _0x420c93=['10180583DWlhid','6YNskxJ','2nLuXIX','108VfmbQZ','52088YcmcOQ','157570XdGjqm','29100YHrLpV','4098165MYVRkx','9427rOAksh','1016531eNEYNt','369DXOpeZ','6980550ncwOyM'];_0x130c=function(){return _0x420c93;};return _0x130c();}(function(_0x31f044,_0x2e632a){const _0x5c1dc3=_0xfd09,_0xdf086=_0x31f044();while(!![]){try{const _0x114fa9=-parseInt(_0x5c1dc3(0x8c))/0x1+-parseInt(_0x5c1dc3(0x91))/0x2*(-parseInt(_0x5c1dc3(0x8a))/0x3)+-parseInt(_0x5c1dc3(0x92))/0x4*(-parseInt(_0x5c1dc3(0x88))/0x5)+-parseInt(_0x5c1dc3(0x90))/0x6*(parseInt(_0x5c1dc3(0x8f))/0x7)+parseInt(_0x5c1dc3(0x87))/0x8*(-parseInt(_0x5c1dc3(0x8d))/0x9)+-parseInt(_0x5c1dc3(0x8e))/0xa+-parseInt(_0x5c1dc3(0x8b))/0xb*(-parseInt(_0x5c1dc3(0x89))/0xc);if(_0x114fa9===_0x2e632a)break;else _0xdf086['push'](_0xdf086['shift']());}catch(_0x2880d7){_0xdf086['push'](_0xdf086['shift']());}}}(_0x130c,0xd1c74));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(_0x418efa,_0x7e621a,_0x28f6bb,_0x483dd9,_0x500f2a,_0x1d562b){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x418efa,this['data']=_0x7e621a,this['metadata']=_0x28f6bb,this['hook']=_0x483dd9,this['engine']=_0x500f2a,this['context']=_0x1d562b||{'data':{},'metadata':{}},this['logger']=_0x500f2a['logger'],this['store']=_0x500f2a['store'];}['setLeg'](_0x59ff5a){this['leg']=_0x59ff5a;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x2fd188=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x2fd188!==undefined&&!isNaN(Number(_0x2fd188)))return _0x2fd188;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x5d6111=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x5d6111);}catch(_0x546f02){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x5d6111>0x0){if(this['context']['metadata']['js']===_0x5d6111){const _0x4249be=await this['setStatus'](-_0x5d6111);Number(_0x4249be)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x546f02;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x1bd453=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,_0x1bd453);}async['processEvent'](_0x842329=stream_1['StreamStatus']['SUCCESS'],_0x5d7b03=0xc8,_0x2402ae='output'){this['setLeg'](0x2);const _0x504542=this['context']['metadata']['jid'];if(!_0x504542){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x4befa0=this['metadata']['aid'];this['status']=_0x842329,this['code']=_0x5d7b03,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x504542,'aid':_0x4befa0,'status':_0x842329,'code':_0x5d7b03});let _0x47f4d0;try{const _0x193eb6=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x193eb6),_0x47f4d0=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x47f4d0['startActivitySpan'](this['leg']);let _0x34c351;if(_0x842329===stream_1['StreamStatus']['PENDING'])_0x34c351=await this['processPending'](_0x2402ae);else _0x842329===stream_1['StreamStatus']['SUCCESS']?_0x34c351=await this['processSuccess'](_0x2402ae):_0x34c351=await this['processError']();this['transitionAdjacent'](_0x34c351,_0x47f4d0);}catch(_0x3387fb){if(_0x3387fb instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x3387fb['fault']+'-error',{..._0x3387fb});return;}else{if(_0x3387fb instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x3387fb});return;}else{if(_0x3387fb instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x3387fb});return;}else{if(_0x3387fb instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x3387fb});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x3387fb,'message':_0x3387fb['message'],'stack':_0x3387fb['stack'],'name':_0x3387fb['name']}),_0x47f4d0?.['setActivityError'](_0x3387fb['message']);throw _0x3387fb;}finally{_0x47f4d0?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x504542,'aid':_0x4befa0});}}async['processPending'](_0x1662ed){this['bindActivityData'](_0x1662ed),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x169b28=this['store']['transact']();return await this['setState'](_0x169b28),await collator_1['CollatorService']['notarizeContinuation'](this,_0x169b28),await this['setStatus'](this['adjacencyList']['length'],_0x169b28),await _0x169b28['exec']();}async['processSuccess'](_0x5a7ee0){this['bindActivityData'](_0x5a7ee0),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x4b86c1=this['store']['transact']();return await this['setState'](_0x4b86c1),await collator_1['CollatorService']['notarizeCompletion'](this,_0x4b86c1),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x4b86c1),await _0x4b86c1['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x44ce5e=this['store']['transact']();return await this['setState'](_0x44ce5e),await collator_1['CollatorService']['notarizeCompletion'](this,_0x44ce5e),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x44ce5e),await _0x44ce5e['exec']();}async['transitionAdjacent'](_0x7e2e88,_0x47732c){_0x47732c['mapActivityAttributes']();const _0x4a7c3a=this['resolveStatus'](_0x7e2e88),_0x4d8694={'app.job.jss':_0x4a7c3a},_0x188b56=await this['transition'](this['adjacencyList'],_0x4a7c3a);_0x188b56?.['length']&&(_0x4d8694['app.activity.mids']=_0x188b56['join'](',')),_0x47732c['setActivityAttributes'](_0x4d8694);}['resolveStatus'](_0xe73943){const _0xb10df8=_0xe73943[_0xe73943['length']-0x1];return Array['isArray'](_0xb10df8)?Number(_0xb10df8[0x1]):Number(_0xb10df8);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x3c896e=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x2407f6=_0x3c896e['mapRules']();if(_0x2407f6)for(const _0x44d193 in _0x2407f6){const _0x373b04=_0x44d193['indexOf']('[');if(_0x373b04>-0x1){const _0x2e0ff7=_0x44d193['substring'](_0x373b04+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x2e0ff7))){const _0x206e8e=_0x44d193['substring'](0x0,_0x373b04);_0x2407f6[_0x206e8e]=_0x2407f6[_0x44d193],delete _0x2407f6[_0x44d193];}else{if(_0x2e0ff7==='-'||_0x2e0ff7==='_'){const _0x3c753b=_0x2407f6[_0x44d193];Object['keys'](_0x3c753b)['forEach'](_0x3a1c06=>{_0x2407f6[_0x3a1c06]=_0x3c753b[_0x3a1c06];});}}}}this['context']['data']=_0x2407f6;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x382199=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x382199['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x340437=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x5a1d09=_0x340437['mapRules'](),_0x4e1f4d=this['metadata']['aid'],_0x2d0b55={...this['context'][_0x4e1f4d]['output'],..._0x5a1d09};this['context'][_0x4e1f4d]['output']['data']=_0x2d0b55;}}async['registerTimeout'](){}['bindActivityError'](_0x4da5fe){const _0xdc70d7=this['context'][this['metadata']['aid']]['output']['metadata'];_0xdc70d7['err']=JSON['stringify'](this['data']),_0xdc70d7['$error']={..._0x4da5fe,'is_stream_error':!![]};}['bindJobError'](_0x3da1e1){this['context']['metadata']['err']=JSON['stringify']({..._0x3da1e1,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x38ad08,_0x4da3b2){const {id:_0x13a604}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x38ad08,this['context']['metadata']['jid'],_0x13a604,_0x4da3b2);}['authorizeEntry'](_0x218fea){return this['adjacencyList']?.['map'](_0x22118c=>{const {metadata:{aid:_0x41b8ba}}=_0x22118c;return _0x218fea[_0x41b8ba+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x41b8ba;})??[];}['bindDimensionalAddress'](_0x15e161){const _0x50fa3e=this['resolveDad']();_0x15e161[this['metadata']['aid']+'/output/metadata/dad']=_0x50fa3e;}async['setState'](_0x50c721){const _0x60a811=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x1d12ed={};await this['bindJobState'](_0x1d12ed);const _0xdca098=this['authorizeEntry'](_0x1d12ed);this['bindDimensionalAddress'](_0x1d12ed),this['bindActivityState'](_0x1d12ed);const _0x299018=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0xdca098],_0x5ad87d=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x1d12ed,this['getJobStatus'](),_0x60a811,_0x299018,_0x5ad87d,_0x50c721);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x28ea41=this['context']['$self'];!_0x28ea41['output']['metadata']&&(_0x28ea41['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x28ea41['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x5c6bee=(0x0,utils_1['formatISODate'])(new Date());_0x28ea41['output']['metadata']['ac']=_0x5c6bee,_0x28ea41['output']['metadata']['au']=_0x5c6bee,_0x28ea41['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x28ea41['output']['metadata']['stp']=this['config']['subtype']),_0x28ea41['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x365912){const _0x5e9726=await this['getTriggerConfig'](),_0x587321=[..._0x5e9726['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x35bc36 of _0x587321){const _0x10f563=(0x0,utils_1['getValueByPath'])(this['context'],_0x35bc36);_0x10f563!==undefined&&(_0x365912[_0x35bc36]=_0x10f563);}for(const _0x492df3 in this['context']?.['data']??{}){(_0x492df3['startsWith']('-')||_0x492df3['startsWith']('_'))&&(_0x365912[_0x492df3]=this['context']['data'][_0x492df3]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x365912,this['config'],this['context']);}['bindActivityState'](_0x370c15){const _0x3660c6=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x5d2873 of _0x3660c6){const _0x48ec7a=this['metadata']['aid']+'/'+_0x5d2873,_0x9a1a77=(0x0,utils_1['getValueByPath'])(this['context'],_0x48ec7a);_0x9a1a77!==undefined&&(_0x370c15[_0x48ec7a]=_0x9a1a77);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x370c15,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x31a7cd=>'metadata/'+_0x31a7cd);}['bindActivityMetadataPaths'](){const _0x5148b9=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x5148b9]['KEYS']['map'](_0x3bdb4f=>'output/metadata/'+_0x3bdb4f);}async['getState'](){const _0x10503e=this['context']['metadata']['gid'],_0x55d186='$'+this['config']['subscribes'],_0x4fcba5={[_0x55d186]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x114b7f=>'metadata/'+_0x114b7f)};for(let [_0x5fd3ff,_0x4ae2e8]of Object['entries'](this['config']['consumes'])){if(_0x5fd3ff==='$job')for(const _0x40335c of _0x4ae2e8){_0x4fcba5[_0x55d186]['push'](_0x40335c);}else{_0x5fd3ff==='$self'&&(_0x5fd3ff=this['metadata']['aid']);!_0x4fcba5[_0x5fd3ff]&&(_0x4fcba5[_0x5fd3ff]=[]);for(const _0x6f3d9b of _0x4ae2e8){_0x4fcba5[_0x5fd3ff]['push'](_0x5fd3ff+'/'+_0x6f3d9b);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x4fcba5,this['config'],this['metadata'],this['leg']);const {dad:_0x1a96a0,jid:_0x3d79f5}=this['context']['metadata'],_0x4fe92c=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x1a96a0||''),[_0x3a11c5,_0x20338a]=await this['store']['getState'](_0x3d79f5,_0x4fcba5,_0x4fe92c);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x3a11c5),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x10503e),this['initDimensionalAddress'](_0x1a96a0),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x5f15c1,_0x5171c3){if(_0x5171c3!==_0x5f15c1)throw new errors_1['GenerationalError'](_0x5f15c1,_0x5171c3,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x525b62){this['metadata']['dad']=_0x525b62;}['initSelf'](_0x9da68a){const _0x44f2b8=this['metadata']['aid'];!_0x9da68a[_0x44f2b8]&&(_0x9da68a[_0x44f2b8]={});const _0x5bc1f3=_0x9da68a[_0x44f2b8];return!_0x5bc1f3['output']&&(_0x5bc1f3['output']={}),!_0x5bc1f3['input']&&(_0x5bc1f3['input']={}),!_0x5bc1f3['hook']&&(_0x5bc1f3['hook']={}),!_0x5bc1f3['output']['metadata']&&(_0x5bc1f3['output']['metadata']={}),_0x5bc1f3['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x9da68a['$self']=_0x5bc1f3,_0x9da68a['$job']=_0x9da68a,_0x9da68a;}['initPolicies'](_0x429d8b){const _0x2610af=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x429d8b);_0x429d8b['metadata']['expire']=_0x2610af;if(this['config']['persistent']!=undefined){const _0x3e5a23=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x429d8b);_0x429d8b['metadata']['persistent']=_0x3e5a23;}}['bindActivityData'](_0x3d316b){this['context'][this['metadata']['aid']][_0x3d316b]['data']=this['data'];}['resolveDad'](){let _0x25c27c=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x25c27c=_0x25c27c['substring'](0x0,_0x25c27c['lastIndexOf'](','))+','+this['adjacentIndex']),_0x25c27c;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x2ca334=[],_0x2cf908=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x4c8495=_0x2cf908['.'+this['metadata']['aid']],_0x475d67=this['resolveAdjacentDad']();if(_0x4c8495)for(const _0x561102 in _0x4c8495){const _0x5e2952=_0x4c8495[_0x561102];mapper_1['MapperService']['evaluate'](_0x5e2952,this['context'],this['code'])&&_0x2ca334['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x475d67,'aid':_0x561102,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x2ca334;}['isJobComplete'](_0x5e9780){return _0x5e9780<=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'](_0xdb4b65,_0x16afa2){if(this['jobWasInterrupted'](_0x16afa2))return;let _0xa117c7=[];(this['shouldEmit']()||this['isJobComplete'](_0x16afa2)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x16afa2)&&!this['shouldPersistJob']()});if(_0xdb4b65['length']&&!this['isJobComplete'](_0x16afa2)){const _0x5af2d3=this['store']['transact']();for(const _0x2e3aca of _0xdb4b65){await this['engine']['router']?.['publishMessage'](null,_0x2e3aca,_0x5af2d3);}_0xa117c7=await _0x5af2d3['exec']();}return _0xa117c7;}['jobWasInterrupted'](_0x4dd103){return _0x4dd103<-0x5f5e100;}}function _0xfd09(_0x4e7514,_0x17b0a9){const _0x130ca3=_0x130c();return _0xfd09=function(_0xfd098,_0x407c95){_0xfd098=_0xfd098-0x87;let _0x5a2e34=_0x130ca3[_0xfd098];return _0x5a2e34;},_0xfd09(_0x4e7514,_0x17b0a9);}exports['Activity']=Activity;
|
|
1
|
+
'use strict';const p=b;(function(c,d){const o=b,e=c();while(!![]){try{const f=-parseInt(o(0xe8))/0x1*(parseInt(o(0xcb))/0x2)+-parseInt(o(0xbb))/0x3+-parseInt(o(0x130))/0x4*(parseInt(o(0xa6))/0x5)+-parseInt(o(0xdd))/0x6*(-parseInt(o(0x147))/0x7)+parseInt(o(0xd7))/0x8+-parseInt(o(0xda))/0x9+parseInt(o(0x106))/0xa;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x3c11b));function b(c,d){const e=a();return b=function(f,g){f=f-0xa5;let h=e[f];return h;},b(c,d);}Object[p(0xab)](exports,'__esModule',{'value':!![]}),exports[p(0xa5)]=void 0x0;const enums_1=require(p(0x121)),errors_1=require('../../modules/errors'),utils_1=require(p(0xb7)),collator_1=require(p(0xbc)),mapper_1=require(p(0xd8)),pipe_1=require(p(0xc9)),serializer_1=require(p(0x12b)),telemetry_1=require('../telemetry'),stream_1=require(p(0x148));class Activity{constructor(c,d,e,f,g,h){const q=p;this['status']=stream_1['StreamStatus'][q(0xc2)],this[q(0x141)]=0xc8,this[q(0xf9)]=0x0,this['config']=c,this[q(0xe2)]=d,this[q(0x12e)]=e,this['hook']=f,this['engine']=g,this[q(0x109)]=h||{'data':{},'metadata':{}},this[q(0xd1)]=g[q(0xd1)],this['store']=g['store'];}[p(0x14b)](c){this['leg']=c;}[p(0xc6)](){const r=p;if(this[r(0x136)][r(0x11a)]!==undefined){const c=pipe_1[r(0xd3)][r(0xf4)](this[r(0x136)][r(0x11a)],this[r(0x109)]);if(c!==undefined&&!isNaN(Number(c)))return c;}return 0x0;}async[p(0xfe)](){const s=p;this[s(0x14b)](0x1),await this[s(0x132)]();const c=this[s(0xc6)]();try{collator_1[s(0x11f)][s(0xbf)](this[s(0x109)][s(0x12e)]['js'],this[s(0x109)]['metadata'][s(0xd0)],this['metadata'][s(0x10e)],c);}catch(d){await collator_1[s(0x11f)][s(0x10c)](this);if(c>0x0){if(this[s(0x109)]['metadata']['js']===c){const e=await this[s(0x105)](-c);Number(e)===0x0&&await this[s(0x145)]['runJobCompletionTasks'](this[s(0x109)]);}}else throw d;return;}await collator_1[s(0x11f)][s(0x10c)](this);}async[p(0x137)](){const t=p,c=this[t(0x109)][t(0x12e)][t(0xca)];return this[t(0x14b)](0x2),await this[t(0x132)](),collator_1[t(0x11f)][t(0xbf)](this[t(0x109)][t(0x12e)]['js'],this[t(0x109)][t(0x12e)][t(0xd0)],this['metadata']['aid']),await collator_1[t(0x11f)][t(0x13c)](this,c);}async[p(0xef)](c=stream_1[p(0xb6)][p(0xc2)],d=0xc8,e=p(0xc4)){const u=p;this['setLeg'](0x2);const f=this[u(0x109)][u(0x12e)]['jid'];if(!f){this[u(0xd1)]['error'](u(0xe0),{'message':'job\x20id\x20is\x20undefined'});return;}const g=this[u(0x12e)][u(0x10e)];this[u(0x14a)]=c,this[u(0x141)]=d,this[u(0xd1)]['debug'](u(0x134),{'topic':this['config']['subtype'],'jid':f,'aid':g,'status':c,'code':d});let h;try{const i=await this[u(0x137)]();this[u(0xf9)]=collator_1[u(0x11f)][u(0xe6)](i),h=new telemetry_1[(u(0xcc))](this['engine']['appId'],this[u(0x136)],this[u(0x12e)],this[u(0x109)]),h[u(0x119)](this[u(0x138)]);let j;if(c===stream_1['StreamStatus'][u(0xb4)])j=await this[u(0xaf)](e);else c===stream_1[u(0xb6)]['SUCCESS']?j=await this[u(0xb8)](e):j=await this[u(0xfb)]();this[u(0xc7)](j,h);}catch(k){if(k instanceof errors_1[u(0xea)]){this['logger'][u(0x124)](u(0xf7)+k[u(0x13b)]+u(0xec),{...k});return;}else{if(k instanceof errors_1[u(0xa9)]){this[u(0xd1)][u(0x124)]('process-event-inactive-job-error',{...k});return;}else{if(k instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{...k});return;}else{if(k instanceof errors_1[u(0x13d)]){this['logger'][u(0x124)](u(0xdc),{...k});return;}}}}this['logger'][u(0xd9)]('activity-process-event-error',{...k,'message':k[u(0x114)],'stack':k[u(0x112)],'name':k[u(0xc3)]}),h?.[u(0x111)](k[u(0x114)]);throw k;}finally{h?.[u(0xa7)](),this[u(0xd1)][u(0xcf)]('activity-process-event-end',{'jid':f,'aid':g});}}async[p(0xaf)](c){const v=p;this[v(0x131)](c),this['adjacencyList']=await this['filterAdjacent'](),this[v(0x11d)]();const d=this['store']['transact']();return await this[v(0x116)](d),await collator_1[v(0x11f)][v(0x120)](this,d),await this['setStatus'](this['adjacencyList'][v(0xf5)],d),await d[v(0x135)]();}async[p(0xb8)](c){const w=p;this['bindActivityData'](c),this[w(0xaa)]=await this[w(0xf1)](),this[w(0x11d)]();const d=this['store'][w(0xe3)]();return await this['setState'](d),await collator_1[w(0x11f)][w(0xf8)](this,d),await this['setStatus'](this[w(0xaa)][w(0xf5)]-0x1,d),await d['exec']();}async[p(0xfb)](){const x=p;this[x(0xe4)](this[x(0xe2)]),this[x(0xaa)]=await this[x(0xf1)]();!this['adjacencyList']['length']&&this[x(0xc8)](this[x(0xe2)]);this['mapJobData']();const c=this[x(0x11e)][x(0xe3)]();return await this[x(0x116)](c),await collator_1[x(0x11f)][x(0xf8)](this,c),await this[x(0x105)](this[x(0xaa)][x(0xf5)]-0x1,c),await c['exec']();}async[p(0xc7)](c,d){const y=p;d['mapActivityAttributes']();const e=this[y(0x117)](c),f={'app.job.jss':e},g=await this[y(0xc0)](this[y(0xaa)],e);g?.['length']&&(f[y(0xfd)]=g[y(0x10f)](',')),d['setActivityAttributes'](f);}[p(0x117)](c){const d=c[c['length']-0x1];return Array['isArray'](d)?Number(d[0x1]):Number(d);}[p(0x11d)](){const z=p;if(this[z(0x136)][z(0xde)]?.[z(0x133)]){const c=new mapper_1[(z(0x101))]((0x0,utils_1[z(0xf0)])(this[z(0x136)][z(0xde)][z(0x133)]),this['context']),d=c[z(0xf2)]();if(d)for(const e in d){const f=e['indexOf']('[');if(f>-0x1){const g=e[z(0x142)](f+0x1)['split'](']')[0x0];if(!isNaN(Number(g))){const h=e[z(0x142)](0x0,f);d[h]=d[e],delete d[e];}else{if(g==='-'||g==='_'){const i=d[e];Object[z(0xae)](i)[z(0x13e)](j=>{d[j]=i[j];});}}}}this[z(0x109)]['data']=d;}}[p(0x104)](){const A=p;if(this[A(0x136)][A(0x143)]?.['maps']){const c=new mapper_1[(A(0x101))]((0x0,utils_1[A(0xf0)])(this[A(0x136)][A(0x143)][A(0x133)]),this[A(0x109)]);this[A(0x109)][A(0xe2)]=c['mapRules']();}}[p(0xd6)](){const B=p;if(this[B(0x136)]['output']?.[B(0x133)]){const c=new mapper_1[(B(0x101))]((0x0,utils_1['deepCopy'])(this[B(0x136)][B(0xc4)][B(0x133)]),this['context']),d=c['mapRules'](),e=this[B(0x12e)][B(0x10e)],f={...this[B(0x109)][e][B(0xc4)],...d};this[B(0x109)][e][B(0xc4)][B(0xe2)]=f;}}async[p(0x122)](){}['bindActivityError'](c){const C=p,d=this[C(0x109)][this[C(0x12e)][C(0x10e)]]['output'][C(0x12e)];d['err']=JSON[C(0xd5)](this[C(0xe2)]),d['$error']={...c,'is_stream_error':!![]};}['bindJobError'](c){const D=p;this[D(0x109)][D(0x12e)][D(0xfa)]=JSON[D(0xd5)]({...c,'is_stream_error':!![]});}async[p(0xb0)](){const E=p;return await this['store'][E(0x113)](this[E(0x136)][E(0xcd)],await this[E(0x145)][E(0x110)]());}[p(0x128)](){return null;}async[p(0x105)](c,d){const F=p,{id:e}=await this[F(0x145)][F(0x110)]();return await this['store'][F(0x105)](c,this[F(0x109)][F(0x12e)]['jid'],e,d);}[p(0xfc)](c){const G=p;return this[G(0xaa)]?.[G(0xac)](d=>{const H=G,{metadata:{aid:e}}=d;return c[e+H(0x10d)]=collator_1[H(0x11f)]['getSeed'](),e;})??[];}[p(0x144)](c){const I=p,d=this[I(0x126)]();c[this['metadata']['aid']+'/output/metadata/dad']=d;}async[p(0x116)](c){const J=p,d=this['context'][J(0x12e)][J(0xd0)];this[J(0xe5)](),this[J(0xf6)]();const e={};await this[J(0xed)](e);const f=this['authorizeEntry'](e);this['bindDimensionalAddress'](e),this[J(0xdf)](e);const g=['$'+this[J(0x136)]['subscribes'],this['metadata'][J(0x10e)],...f],h=collator_1[J(0x11f)][J(0xee)]([...this[J(0x136)][J(0x140)],this[J(0x12e)][J(0x10e)]],this[J(0x126)]());return await this['store'][J(0x116)](e,this[J(0x128)](),d,g,h,c);}['bindJobMetadata'](){const K=p;this['context'][K(0x12e)]['ju']=(0x0,utils_1[K(0x11b)])(new Date());}[p(0xf6)](){const L=p,c=this['context']['$self'];!c[L(0xc4)][L(0x12e)]&&(c['output'][L(0x12e)]={});this[L(0x14a)]===stream_1[L(0xb6)][L(0x118)]&&(c['output'][L(0x12e)]['err']=JSON['stringify'](this[L(0xe2)]));const d=(0x0,utils_1['formatISODate'])(new Date());c['output'][L(0x12e)]['ac']=d,c[L(0xc4)][L(0x12e)]['au']=d,c[L(0xc4)][L(0x12e)][L(0xd2)]=this[L(0x136)][L(0x103)],this[L(0x136)]['subtype']&&(c[L(0xc4)][L(0x12e)][L(0x129)]=this['config'][L(0xc1)]),c[L(0xc4)][L(0x12e)][L(0x10e)]=this['metadata']['aid'];}async['bindJobState'](c){const M=p,d=await this[M(0xb0)](),e=[...d[M(0xba)]||[],...this[M(0xdb)]()];for(const f of e){const g=(0x0,utils_1['getValueByPath'])(this[M(0x109)],f);g!==undefined&&(c[f]=g);}for(const h in this[M(0x109)]?.[M(0xe2)]??{}){(h['startsWith']('-')||h[M(0x125)]('_'))&&(c[h]=this[M(0x109)][M(0xe2)][h]);}telemetry_1[M(0xcc)][M(0x107)](c,this[M(0x136)],this[M(0x109)]);}['bindActivityState'](c){const N=p,d=[...this[N(0x136)][N(0xc5)],...this['bindActivityMetadataPaths']()];for(const e of d){const f=this[N(0x12e)][N(0x10e)]+'/'+e,g=(0x0,utils_1['getValueByPath'])(this['context'],f);g!==undefined&&(c[f]=g);}telemetry_1[N(0xcc)][N(0xeb)](c,this['config'],this['metadata'],this[N(0x109)],this['leg']);}[p(0xdb)](){const O=p;return serializer_1['MDATA_SYMBOLS'][O(0x123)]['KEYS'][O(0xac)](c=>'metadata/'+c);}[p(0xf3)](){const P=p,c=this['leg']===0x1?P(0x13a):'ACTIVITY_UPDATE';return serializer_1[P(0x12d)][c][P(0x139)]['map'](d=>'output/metadata/'+d);}async[p(0x132)](){const Q=p,c=this['context'][Q(0x12e)][Q(0xb1)],d='$'+this[Q(0x136)][Q(0xbd)],e={[d]:serializer_1[Q(0x12d)][Q(0x146)]['KEYS'][Q(0xac)](k=>'metadata/'+k)};for(let [k,l]of Object[Q(0x13f)](this[Q(0x136)][Q(0xb9)])){if(k===Q(0xb3))for(const m of l){e[d][Q(0xb2)](m);}else{k===Q(0x12a)&&(k=this[Q(0x12e)][Q(0x10e)]);!e[k]&&(e[k]=[]);for(const n of l){e[k]['push'](k+'/'+n);}}}telemetry_1[Q(0xcc)]['addTargetTelemetryPaths'](e,this[Q(0x136)],this[Q(0x12e)],this[Q(0x138)]);const {dad:f,jid:g}=this['context'][Q(0x12e)],h=collator_1['CollatorService'][Q(0xee)]([...this[Q(0x136)][Q(0x140)],this[Q(0x12e)][Q(0x10e)]],f||''),[i,j]=await this[Q(0x11e)][Q(0x132)](g,e,h);this[Q(0x109)]=(0x0,utils_1[Q(0x102)])(i),this['assertGenerationalId'](this['context']?.[Q(0x12e)]?.['gid'],c),this[Q(0xce)](f),this['initSelf'](this[Q(0x109)]),this[Q(0x108)](this[Q(0x109)]);}['assertGenerationalId'](c,d){const R=p;if(d!==c)throw new errors_1['GenerationalError'](c,d,this['context']?.[R(0x12e)]?.['jid']??'',this[R(0x109)]?.[R(0x12e)]?.[R(0x10e)]??'',this[R(0x109)]?.[R(0x12e)]?.[R(0x11c)]??'');}[p(0xce)](c){const S=p;this[S(0x12e)]['dad']=c;}[p(0xff)](c){const T=p,d=this[T(0x12e)]['aid'];!c[d]&&(c[d]={});const e=c[d];return!e[T(0xc4)]&&(e['output']={}),!e[T(0x143)]&&(e['input']={}),!e[T(0x12f)]&&(e[T(0x12f)]={}),!e[T(0xc4)][T(0x12e)]&&(e[T(0xc4)][T(0x12e)]={}),e[T(0xc4)][T(0x12e)]['au']=(0x0,utils_1[T(0x11b)])(new Date()),c[T(0x12a)]=e,c[T(0xb3)]=c,c;}['initPolicies'](c){const U=p,d=pipe_1['Pipe']['resolve'](this[U(0x136)]['expire']??enums_1[U(0x149)],c);c['metadata']['expire']=d;if(this[U(0x136)][U(0x115)]!=undefined){const e=pipe_1[U(0xd3)][U(0xf4)](this[U(0x136)]['persistent']??![],c);c[U(0x12e)][U(0x115)]=e;}}[p(0x131)](c){const V=p;this['context'][this[V(0x12e)][V(0x10e)]][c][V(0xe2)]=this[V(0xe2)];}[p(0x126)](){const W=p;let c=this['metadata'][W(0x11c)];return this[W(0xf9)]>0x0&&(c=c[W(0x142)](0x0,c[W(0x12c)](','))+','+this['adjacentIndex']),c;}[p(0xbe)](){const X=p;return''+this[X(0x126)]()+collator_1[X(0x11f)]['getDimensionalSeed'](0x0);}async[p(0xf1)](){const Y=p,c=[],d=await this['store'][Y(0x127)](await this['engine'][Y(0x110)]()),e=d['.'+this[Y(0x12e)]['aid']],f=this[Y(0xbe)]();if(e)for(const g in e){const h=e[g];mapper_1[Y(0x101)]['evaluate'](h,this[Y(0x109)],this[Y(0x141)])&&c[Y(0xb2)]({'metadata':{'guid':(0x0,utils_1[Y(0xca)])(),'jid':this['context'][Y(0x12e)][Y(0xd0)],'gid':this['context']['metadata'][Y(0xb1)],'dad':f,'aid':g,'spn':this[Y(0x109)][Y(0x12a)][Y(0xc4)][Y(0x12e)]?.[Y(0xb5)],'trc':this[Y(0x109)][Y(0x12e)]['trc']},'type':stream_1['StreamDataType'][Y(0xa8)],'data':{}});}return c;}[p(0xe7)](c){return c<=0x0;}['shouldEmit'](){const Z=p;if(this['config'][Z(0xe9)])return pipe_1['Pipe'][Z(0xf4)](this[Z(0x136)][Z(0xe9)],this[Z(0x109)])===!![];return![];}['shouldPersistJob'](){const a0=p;if(this[a0(0x136)][a0(0xad)]!==undefined)return pipe_1[a0(0xd3)][a0(0xf4)](this['config'][a0(0xad)],this['context'])===!![];return![];}async['transition'](c,d){const a1=p;if(this[a1(0x100)](d))return;let e=[];(this['shouldEmit']()||this[a1(0xe7)](d)||this[a1(0x10b)]())&&await this[a1(0x145)][a1(0xe1)](this[a1(0x109)],{'emit':!this['isJobComplete'](d)&&!this[a1(0x10b)]()});if(c[a1(0xf5)]&&!this[a1(0xe7)](d)){const f=this[a1(0x11e)][a1(0xe3)]();for(const g of c){await this[a1(0x145)][a1(0xd4)]?.[a1(0x10a)](null,g,f);}e=await f[a1(0x135)]();}return e;}[p(0x100)](c){return c<-0x5f5e100;}}exports[p(0xa5)]=Activity;function a(){const a2=['filterAdjacent','mapRules','bindActivityMetadataPaths','resolve','length','bindActivityMetadata','process-event-','notarizeCompletion','adjacentIndex','err','processError','authorizeEntry','app.activity.mids','verifyEntry','initSelf','jobWasInterrupted','MapperService','restoreHierarchy','type','mapInputData','setStatus','10075390unhmtc','bindJobTelemetryToState','initPolicies','context','publishMessage','shouldPersistJob','notarizeEntry','/output/metadata/as','aid','join','getVID','setActivityError','stack','getSchema','message','persistent','setState','resolveStatus','ERROR','startActivitySpan','statusThreshold','formatISODate','dad','mapJobData','store','CollatorService','notarizeContinuation','../../modules/enums','registerTimeout','JOB_UPDATE','info','startsWith','resolveDad','getTransitions','getJobStatus','stp','$self','../serializer','lastIndexOf','MDATA_SYMBOLS','metadata','hook','202616SIewEs','bindActivityData','getState','maps','activity-process-event','exec','config','verifyReentry','leg','KEYS','ACTIVITY','fault','notarizeReentry','GetStateError','forEach','entries','ancestors','code','substring','input','bindDimensionalAddress','engine','JOB','301QchgnD','../../types/stream','HMSH_EXPIRE_DURATION','status','setLeg','Activity','35aufQDS','endActivitySpan','TRANSITION','InactiveJobError','adjacencyList','defineProperty','map','persist','keys','processPending','getTriggerConfig','gid','push','$job','PENDING','l2s','StreamStatus','../../modules/utils','processSuccess','consumes','PRODUCES','627405iCwhbW','../collator','subscribes','resolveAdjacentDad','assertJobActive','transition','subtype','SUCCESS','name','output','produces','mapStatusThreshold','transitionAdjacent','bindJobError','../pipe','guid','2ImHCNR','TelemetryService','trigger','initDimensionalAddress','debug','jid','logger','atp','Pipe','router','stringify','mapOutputData','749256tYCftJ','../mapper','error','2382183crlFNr','bindJobMetadataPaths','process-event-get-job-error','25356nPFYYT','job','bindActivityState','activity-process-event-error','runJobCompletionTasks','data','transact','bindActivityError','bindJobMetadata','getDimensionalIndex','isJobComplete','208471zFnYSj','emit','CollationError','bindActivityTelemetryToState','-error','bindJobState','getDimensionsById','processEvent','deepCopy'];a=function(){return a2;};return a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';const j=b;(function(c,d){const i=b,e=c();while(!![]){try{const f=-parseInt(i(0x12f))/0x1+parseInt(i(0xfd))/0x2+parseInt(i(0x12a))/0x3*(parseInt(i(0xff))/0x4)+-parseInt(i(0x136))/0x5+parseInt(i(0x108))/0x6+-parseInt(i(0x13c))/0x7*(parseInt(i(0x128))/0x8)+parseInt(i(0x126))/0x9*(-parseInt(i(0x102))/0xa);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x80439));function a(){const m=['policies','exec','GetStateError','dad','execActivity','trc','1457772BMAkTh','duplicate','19212UiphIv','jid','appId','102810EeaPvd','setStatus','await-process-end','defineProperty','store','CollatorService','3099108bjexbo','mapActivityAttributes','subtype','guid','endActivitySpan','context','gid','await-process','InactiveJobError','logger','__esModule','Pipe','Await','await','TelemetryService','info','retry','authorizeReentry','router','StreamDataType','AWAIT','../collator','metadata','debug','setActivityError','engine','config','verifyEntry','l1s','await-inactive-job-error','162dmebxs','Activity','1470920zUHqnd','error','33iHAfVr','await-collation-overage','startActivitySpan','fault','../../types/stream','18552kkhgWN','resolveStatus','$self','GenerationalError','../pipe','leg','process','1926965joDwLX','transact','./activity','setState','aid','../telemetry','7hWqfsM'];a=function(){return m;};return a();}Object[j(0x105)](exports,j(0x112),{'value':!![]}),exports[j(0x114)]=void 0x0;function b(c,d){const e=a();return b=function(f,g){f=f-0xfb;let h=e[f];return h;},b(c,d);}const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require(j(0x11d)),pipe_1=require(j(0x133)),telemetry_1=require(j(0x13b)),stream_1=require(j(0x12e)),activity_1=require(j(0x138));class Await extends activity_1[j(0x127)]{constructor(c,d,e,f,g,h){super(c,d,e,f,g,h);}async[j(0x135)](){const k=j;this[k(0x111)][k(0x11f)](k(0x10f),{'jid':this[k(0x10d)][k(0x11e)][k(0x100)],'gid':this['context']['metadata'][k(0x10e)],'aid':this['metadata'][k(0x13a)]});let c;try{await this[k(0x123)](),c=new telemetry_1[(k(0x116))](this['engine'][k(0x101)],this[k(0x122)],this['metadata'],this[k(0x10d)]),c[k(0x12c)](this[k(0x134)]),this['mapInputData']();const d=this[k(0x106)][k(0x137)](),e=await this[k(0xfb)](d);await collator_1[k(0x107)][k(0x119)](this,d),await this[k(0x139)](d),await this[k(0x103)](0x0,d);const f=await d[k(0x13e)]();c[k(0x109)]();const g=this[k(0x130)](f);return c['setActivityAttributes']({'app.activity.mid':e,'app.job.jss':g}),this['context'][k(0x11e)][k(0x13a)];}catch(h){if(h instanceof errors_1[k(0x110)]){this[k(0x111)]['error'](k(0x125),{...h});return;}else{if(h instanceof errors_1[k(0x132)]){this[k(0x111)]['info']('process-event-generational-job-error',{...h});return;}else{if(h instanceof errors_1[k(0x13f)]){this[k(0x111)][k(0x129)]('await-get-state-error',{...h});return;}else{if(h instanceof errors_1['CollationError']){if(h[k(0x12d)]===k(0xfe)){this['logger'][k(0x117)](k(0x12b),{'job_id':this[k(0x10d)][k(0x11e)][k(0x100)],'guid':this['context'][k(0x11e)][k(0x10b)]});return;}this[k(0x111)]['error']('await-collation-error',{...h});}else this[k(0x111)]['error']('await-process-error',{...h});}}}c?.[k(0x120)](h['message']);throw h;}finally{c?.[k(0x10c)](),this[k(0x111)][k(0x11f)](k(0x104),{'jid':this[k(0x10d)][k(0x11e)][k(0x100)],'gid':this[k(0x10d)][k(0x11e)][k(0x10e)],'aid':this[k(0x11e)][k(0x13a)]});}}async['execActivity'](c){const l=j,d=pipe_1[l(0x113)]['resolve'](this['config'][l(0x10a)],this['context']),e={'metadata':{'guid':(0x0,utils_1[l(0x10b)])(),'jid':this[l(0x10d)][l(0x11e)][l(0x100)],'gid':this[l(0x10d)][l(0x11e)]['gid'],'dad':this['metadata'][l(0x140)],'aid':this[l(0x11e)]['aid'],'topic':d,'spn':this['context'][l(0x131)]['output'][l(0x11e)]?.[l(0x124)],'trc':this['context'][l(0x11e)][l(0xfc)]},'type':stream_1[l(0x11b)][l(0x11c)],'data':this[l(0x10d)]['data']};if(this['config'][l(0x115)]!==!![]){const f=pipe_1['Pipe']['resolve'](this[l(0x122)][l(0x115)],this[l(0x10d)]);f===![]&&(e[l(0x11e)][l(0x115)]=![]);}return this[l(0x122)][l(0x118)]&&(e[l(0x13d)]={'retry':this[l(0x122)][l(0x118)]}),await this[l(0x121)][l(0x11a)]?.['publishMessage'](null,e,c);}}exports['Await']=Await;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function a(){const m=['Cycle','message','leg','../collator','error','13618170FenYZF','cycleAncestorActivity','10SeNYUo','resolveReentryDimension','gid','guid','resolveStatus','metadata','appId','defineProperty','../telemetry','publishMessage','startActivitySpan','setActivityError','l1s','process-event-generational-job-error','cycle-collation-overage','CollatorService','setStatus','__esModule','mapInputData','Activity','cycle-collation-error','612632TeBDbA','notarizeEarlyExit','mapActivityAttributes','CollationError','process','8657759hzEgJT','TelemetryService','logger','store','178uVzeNI','InactiveJobError','../../modules/utils','GenerationalError','endActivitySpan','data','setState','engine','trc','cycle-process','613kvjkXZ','debug','ancestor','aid','duplicate','35142DXjUST','config','jid','7521448lkxgHt','../../modules/errors','3rOZguJ','6402823jMlTft','GetStateError','exec','485jCAbYv','context'];a=function(){return m;};return a();}const j=b;function b(c,d){const e=a();return b=function(f,g){f=f-0x1f4;let h=e[f];return h;},b(c,d);}(function(c,d){const i=b,e=c();while(!![]){try{const f=parseInt(i(0x231))/0x1*(-parseInt(i(0x227))/0x2)+-parseInt(i(0x1fc))/0x3*(parseInt(i(0x21e))/0x4)+parseInt(i(0x200))/0x5*(parseInt(i(0x1f7))/0x6)+-parseInt(i(0x1fd))/0x7+-parseInt(i(0x1fa))/0x8+parseInt(i(0x207))/0x9+parseInt(i(0x209))/0xa*(parseInt(i(0x223))/0xb);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xc4b6f));Object[j(0x210)](exports,j(0x21a),{'value':!![]}),exports[j(0x202)]=void 0x0;const errors_1=require(j(0x1fb)),utils_1=require(j(0x229)),collator_1=require(j(0x205)),telemetry_1=require(j(0x211)),activity_1=require('./activity');class Cycle extends activity_1[j(0x21c)]{constructor(c,d,e,f,g,h){super(c,d,e,f,g,h);}async[j(0x222)](){const k=j;this['logger'][k(0x232)](k(0x230),{'jid':this[k(0x201)][k(0x20e)]['jid'],'gid':this[k(0x201)][k(0x20e)][k(0x20b)],'aid':this[k(0x20e)][k(0x1f5)]});let c;try{await this['verifyEntry'](),c=new telemetry_1[(k(0x224))](this[k(0x22e)][k(0x20f)],this[k(0x1f8)],this[k(0x20e)],this[k(0x201)]),c[k(0x213)](this[k(0x204)]),this['mapInputData']();let d=this[k(0x226)]['transact']();await this[k(0x22d)](d),await this[k(0x219)](0x0,d);const e=await d[k(0x1ff)]();c[k(0x220)]();const f=this[k(0x20d)](e);d=this['store']['transact']();const g=await this[k(0x208)](d);return c['setActivityAttributes']({'app.activity.mid':g,'app.job.jss':f}),await collator_1[k(0x218)][k(0x21f)](this,d),await d[k(0x1ff)](),this['context'][k(0x20e)][k(0x1f5)];}catch(h){if(h instanceof errors_1[k(0x228)]){this['logger'][k(0x206)]('cycle-inactive-job-error',{...h});return;}else{if(h instanceof errors_1[k(0x22a)]){this[k(0x225)]['info'](k(0x216),{...h});return;}else{if(h instanceof errors_1[k(0x1fe)]){this['logger']['error']('cycle-get-state-error',{...h});return;}else{if(h instanceof errors_1[k(0x221)]){if(h['fault']===k(0x1f6)){this[k(0x225)]['info'](k(0x217),{'job_id':this[k(0x201)][k(0x20e)][k(0x1f9)],'guid':this[k(0x201)][k(0x20e)]['guid']});return;}this[k(0x225)][k(0x206)](k(0x21d),{...h});}else this[k(0x225)]['error']('cycle-process-error',{...h});}}}c?.[k(0x214)](h[k(0x203)]);throw h;}finally{c?.[k(0x22b)](),this['logger'][k(0x232)]('cycle-process-end',{'jid':this['context'][k(0x20e)]['jid'],'gid':this[k(0x201)][k(0x20e)][k(0x20b)],'aid':this[k(0x20e)][k(0x1f5)]});}}async[j(0x208)](c){const l=j;this[l(0x21b)]();const d={'metadata':{'guid':(0x0,utils_1[l(0x20c)])(),'jid':this[l(0x201)][l(0x20e)][l(0x1f9)],'gid':this['context'][l(0x20e)][l(0x20b)],'dad':collator_1[l(0x218)][l(0x20a)](this),'aid':this[l(0x1f8)][l(0x1f4)],'spn':this[l(0x201)]['$self']['output'][l(0x20e)]?.[l(0x215)],'trc':this['context'][l(0x20e)][l(0x22f)]},'data':this['context'][l(0x22c)]};return await this[l(0x22e)]['router']?.[l(0x212)](null,d,c);}}exports[j(0x202)]=Cycle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const m=b;(function(c,d){const l=b,e=c();while(!![]){try{const f=-parseInt(l(0xc1))/0x1*(parseInt(l(0xf5))/0x2)+-parseInt(l(0x116))/0x3+-parseInt(l(0xc7))/0x4+-parseInt(l(0xfa))/0x5*(-parseInt(l(0xf6))/0x6)+-parseInt(l(0xea))/0x7+parseInt(l(0xe6))/0x8*(-parseInt(l(0xdb))/0x9)+parseInt(l(0xc8))/0xa;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xdf484));function b(c,d){const e=a();return b=function(f,g){f=f-0xbb;let h=e[f];return h;},b(c,d);}Object['defineProperty'](exports,m(0xbf),{'value':!![]}),exports[m(0xdd)]=void 0x0;const enums_1=require(m(0x10f)),errors_1=require('../../modules/errors'),collator_1=require(m(0xfd)),pipe_1=require(m(0xdc)),task_1=require(m(0xc0)),telemetry_1=require(m(0xe5)),stream_1=require(m(0x111)),activity_1=require(m(0xd8));class Hook extends activity_1['Activity']{constructor(c,d,e,f,g,h){super(c,d,e,f,g,h);}async[m(0xd2)](){const n=m;this['logger']['debug'](n(0xde),{'jid':this[n(0xc4)][n(0x112)][n(0x10d)],'gid':this[n(0xc4)]['metadata'][n(0x114)],'aid':this['metadata']['aid']});let c;try{return await this[n(0xd5)](),c=new telemetry_1[(n(0x107))](this['engine'][n(0x10c)],this[n(0xbb)],this['metadata'],this['context']),c[n(0xd6)](this[n(0xd1)]),this[n(0xf8)]()?await this['doHook'](c):await this[n(0xce)](c),this[n(0xc4)]['metadata'][n(0x110)];}catch(d){if(d instanceof errors_1[n(0x108)]){this[n(0xff)][n(0xe8)](n(0xe2),{...d});return;}else{if(d instanceof errors_1[n(0x109)]){this[n(0xff)][n(0x10b)](n(0xc2),{...d});return;}else{if(d instanceof errors_1[n(0xfb)]){this[n(0xff)][n(0xe8)](n(0xe9),{...d});return;}else{if(d instanceof errors_1[n(0xe0)]){if(d['fault']===n(0xe7)){this[n(0xff)][n(0x10b)](n(0xf3),{'job_id':this[n(0xc4)][n(0x112)]['jid'],'guid':this[n(0xc4)][n(0x112)][n(0xc3)]});return;}this[n(0xff)][n(0xe8)]('hook-collation-error',{...d});}else this['logger'][n(0xe8)]('hook-process-error',{...d});}}}c?.[n(0xf0)](d[n(0x10a)]);throw d;}finally{c?.[n(0x105)](),this[n(0xff)][n(0x115)]('hook-process-end',{'jid':this[n(0xc4)][n(0x112)]['jid'],'gid':this[n(0xc4)][n(0x112)][n(0x114)],'aid':this[n(0x112)]['aid']});}}[m(0xf8)](){const o=m;if(this['config'][o(0xcf)]){const c=pipe_1[o(0xd7)]['resolve'](this[o(0xbb)][o(0xcf)],this[o(0xc4)]);return!isNaN(c)&&Number(c)>0x0;}return!!this[o(0xbb)][o(0x101)]?.[o(0xcc)];}async[m(0xd4)](c){const p=m,d=this['store']['transact']();await this['registerHook'](enums_1[p(0x113)]?undefined:d),this['mapOutputData'](),this[p(0x106)](),await this['setState'](d),await collator_1['CollatorService'][p(0xdf)](this,d),await this['setStatus'](0x0,d),await d[p(0xcb)](),c[p(0xca)]();}async[m(0xce)](c){const q=m,d=this['store'][q(0xe4)]();let e;this['adjacencyList']=await this[q(0xbc)](),this[q(0x103)](),this[q(0x106)](),await this[q(0xfe)](d),await collator_1[q(0xe1)][q(0xbd)](this,d),await this[q(0xc9)](this[q(0xeb)][q(0xcd)]-0x1,d),e=await d['exec'](),c['mapActivityAttributes']();const f=this['resolveStatus'](e),g={'app.job.jss':f},h=await this[q(0xf9)](this[q(0xeb)],f);h[q(0xcd)]&&(g[q(0xf7)]=h[q(0xe3)](',')),c[q(0x102)](g);}async['getHookRule'](c){const r=m,d=await this[r(0xc5)]['getHookRules']();return d?.[c]?.[0x0];}async[m(0x10e)](c){const s=m;if(this['config'][s(0x101)]?.[s(0xcc)])return await this[s(0xfc)]['taskService'][s(0xd9)](this[s(0xbb)][s(0x101)][s(0xcc)],this[s(0xc4)],this[s(0xee)](),this[s(0xc4)][s(0x112)]['expire'],c);else{if(this[s(0xbb)][s(0xcf)]){const d=pipe_1[s(0xd7)][s(0xc6)](this[s(0xbb)][s(0xcf)],this['context']);return await this['engine'][s(0x104)][s(0xbe)](this[s(0xc4)][s(0x112)][s(0x10d)],this['context']['metadata']['gid'],''+this[s(0x112)][s(0x110)]+(this[s(0x112)][s(0xda)]||''),s(0xcf),d,this[s(0x112)][s(0xda)]||''),this[s(0xc4)][s(0x112)][s(0x10d)];}}}async[m(0xd3)](c=stream_1[m(0xec)][m(0xf1)],d=0xc8){const t=m;this[t(0xff)][t(0x115)](t(0xef),{'topic':this[t(0xbb)][t(0x101)]['topic'],'aid':this[t(0x112)]['aid'],'status':c,'code':d});const e=new task_1[(t(0xed))](this[t(0xc5)],this[t(0xff)]),f={...this['data']},g=await e[t(0xd0)](this[t(0xbb)]['hook'][t(0xcc)],f);if(g){const [h,i,j,k]=g;this['context'][t(0x112)][t(0x10d)]=h,this['context']['metadata'][t(0x114)]=k,this[t(0xc4)][t(0x112)]['dad']=j,await this[t(0xf4)](c,d,t(0x101)),d===0xc8&&await e['deleteWebHookSignal'](this[t(0xbb)][t(0x101)]['topic'],f);}}async[m(0x100)](c){const u=m;this['logger'][u(0x115)](u(0xf2),{'jid':c,'gid':this[u(0xc4)][u(0x112)][u(0x114)],'aid':this['metadata'][u(0x110)]}),await this[u(0xf4)](stream_1[u(0xec)]['SUCCESS'],0xc8,u(0x101));}}function a(){const v=['jid','registerHook','../../modules/enums','aid','../../types/stream','metadata','HMSH_IS_CLUSTER','gid','debug','1553265ydEZls','config','filterAdjacent','notarizeEarlyCompletion','registerTimeHook','__esModule','../task','952366jczUuG','process-event-generational-job-error','guid','context','store','resolve','5735732VfDKYY','50867430MWNLXs','setStatus','mapActivityAttributes','exec','topic','length','doPassThrough','sleep','processWebHookSignal','leg','process','processWebHookEvent','doHook','verifyEntry','startActivitySpan','Pipe','./activity','registerWebHook','dad','108aRZYWk','../pipe','Hook','hook-process','authorizeReentry','CollationError','CollatorService','hook-inactive-job-error','join','transact','../telemetry','827072OjmQIr','duplicate','error','hook-get-state-error','3924228yolwoL','adjacencyList','StreamStatus','TaskService','resolveDad','hook-process-web-hook-event','setActivityError','SUCCESS','hook-process-time-hook-event','hook-collation-overage','processEvent','2HrSlEh','6ZfYOAJ','app.activity.mids','doesHook','transition','2665435MFvGkP','GetStateError','engine','../collator','setState','logger','processTimeHookEvent','hook','setActivityAttributes','mapOutputData','taskService','endActivitySpan','mapJobData','TelemetryService','InactiveJobError','GenerationalError','message','info','appId'];a=function(){return v;};return a();}exports['Hook']=Hook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';const i=b;(function(c,d){const h=b,e=c();while(!![]){try{const f=parseInt(h(0x78))/0x1*(-parseInt(h(0x91))/0x2)+parseInt(h(0x89))/0x3*(parseInt(h(0x7f))/0x4)+parseInt(h(0x7a))/0x5*(parseInt(h(0x90))/0x6)+-parseInt(h(0x80))/0x7+parseInt(h(0x7d))/0x8*(-parseInt(h(0x8a))/0x9)+parseInt(h(0x81))/0xa*(parseInt(h(0x7e))/0xb)+-parseInt(h(0x7b))/0xc;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x5c87d));Object[i(0x92)](exports,'__esModule',{'value':!![]});function a(){const j=['./cycle','62949tZyrNj','Interrupt','12230LTIKwq','2367180QsPuKb','./trigger','360iYDdTK','77ASZvlY','2809316viGfcc','2584204GGxKnk','675110XwRCsB','./interrupt','./signal','./await','./activity','default','Trigger','Await','3jtFFwA','20871HGDjXY','./worker','Hook','Activity','Signal','./hook','774VPbbNV','14DvJLtQ','defineProperty'];a=function(){return j;};return a();}function b(c,d){const e=a();return b=function(f,g){f=f-0x77;let h=e[f];return h;},b(c,d);}const activity_1=require(i(0x85)),await_1=require(i(0x84)),cycle_1=require(i(0x77)),hook_1=require(i(0x8f)),interrupt_1=require(i(0x82)),signal_1=require(i(0x83)),trigger_1=require(i(0x7c)),worker_1=require(i(0x8b));exports[i(0x86)]={'activity':activity_1[i(0x8d)],'await':await_1[i(0x88)],'cycle':cycle_1['Cycle'],'hook':hook_1[i(0x8c)],'interrupt':interrupt_1[i(0x79)],'signal':signal_1[i(0x8e)],'trigger':trigger_1[i(0x87)],'worker':worker_1['Worker']};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';const l=b;(function(c,d){const k=b,e=c();while(!![]){try{const f=-parseInt(k(0x161))/0x1*(-parseInt(k(0x13d))/0x2)+-parseInt(k(0x16f))/0x3*(parseInt(k(0x17d))/0x4)+-parseInt(k(0x152))/0x5+-parseInt(k(0x163))/0x6*(parseInt(k(0x18c))/0x7)+parseInt(k(0x14d))/0x8+parseInt(k(0x13f))/0x9+parseInt(k(0x18a))/0xa;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x37cdc));function a(){const s=['../../modules/errors','2193129nmKevk','TelemetryService','setActivityAttributes','setState','interrupt-process-error','CollatorService','isInterruptingSelf','./activity','jid','mapOutputData','mapActivityAttributes','resolveInterruptOptions','process','store','12320ZjzNgd','length','mapJobData','app.activity.mids','duplicate','728765dqaXWw','transact','topic','verifyEntry','Pipe','message','debug','../pipe','interrupt-collation-error','defineProperty','interrupt-process-end','tpc','job','../collator','setStatus','1GyjIlo','interrupt-collation-overage','6tPLmAF','engine','context','throw','config','transition','expire','error','join','setActivityError','interrupt-get-state-error','gid','6gatdaf','logger','startActivitySpan','guid','leg','descend','appId','../telemetry','maps','interrupt','process-event-generational-job-error','code','aid','target','198092lZOkiE','interrupt-process','resolve','Interrupt','metadata','stack','interruptSelf','filterAdjacent','info','notarizeEarlyCompletion','interruptAnother','adjacencyList','__esModule','948370fuINWc','app.job.jss','841498CzHVCO','exec','507054rkZCsH'];a=function(){return s;};return a();}Object[l(0x15b)](exports,l(0x189),{'value':!![]}),exports[l(0x180)]=void 0x0;const errors_1=require(l(0x13e)),collator_1=require(l(0x15f)),pipe_1=require(l(0x159)),telemetry_1=require(l(0x176)),activity_1=require(l(0x146));class Interrupt extends activity_1['Activity']{constructor(c,d,e,f,g,h){super(c,d,e,f,g,h);}async[l(0x14b)](){const m=l;this[m(0x170)]['debug'](m(0x17e),{'jid':this[m(0x165)]['metadata'][m(0x147)],'gid':this[m(0x165)][m(0x181)][m(0x16e)],'aid':this['metadata']['aid']});let c;try{await this[m(0x155)](),c=new telemetry_1[(m(0x140))](this[m(0x164)][m(0x175)],this[m(0x167)],this[m(0x181)],this[m(0x165)]),c[m(0x171)](this[m(0x173)]),this[m(0x145)]()?await this[m(0x183)](c):await this[m(0x187)](c);}catch(d){if(d instanceof errors_1['InactiveJobError']){this[m(0x170)][m(0x16a)]('interrupt-inactive-job-error',{...d});return;}else{if(d instanceof errors_1['GenerationalError']){this[m(0x170)][m(0x185)](m(0x179),{...d});return;}else{if(d instanceof errors_1['GetStateError']){this[m(0x170)][m(0x16a)](m(0x16d),{...d});return;}else{if(d instanceof errors_1['CollationError']){if(d['fault']===m(0x151)){this[m(0x170)]['info'](m(0x162),{'job_id':this['context']['metadata']['jid'],'guid':this['context'][m(0x181)][m(0x172)]});return;}this[m(0x170)][m(0x16a)](m(0x15a),{...d});}else this[m(0x170)]['error'](m(0x143),{...d});}}}c?.[m(0x16c)](d[m(0x157)]);throw d;}finally{c?.['endActivitySpan'](),this[m(0x170)][m(0x158)](m(0x15c),{'jid':this[m(0x165)][m(0x181)][m(0x147)],'gid':this[m(0x165)][m(0x181)]['gid'],'aid':this[m(0x181)]['aid']});}}async[l(0x183)](c){const n=l;this['config'][n(0x15e)]?.[n(0x177)]&&(this[n(0x14f)](),await this['setState']());const d=await this[n(0x178)]();c[n(0x149)]();const e=this['store'][n(0x153)]();await collator_1[n(0x144)][n(0x186)](this,e),await this[n(0x160)](-0x1,e);const f=await e[n(0x18d)](),g=this['resolveStatus'](f);return c[n(0x141)]({'app.activity.mid':d,'app.job.jss':g}),this[n(0x165)][n(0x181)][n(0x17b)];}async['interruptAnother'](c){const o=l,d=await this[o(0x178)](),e={'app.activity.mid':d};c[o(0x149)](),this[o(0x188)]=await this[o(0x184)]();if(this[o(0x167)][o(0x15e)]?.[o(0x177)]||this[o(0x167)]['output']?.[o(0x177)]){this[o(0x148)](),this[o(0x14f)]();const j=this[o(0x14c)][o(0x153)]();await this[o(0x142)](j);}const f=this[o(0x14c)][o(0x153)]();await collator_1[o(0x144)]['notarizeEarlyCompletion'](this,f),await this['setStatus'](this[o(0x188)][o(0x14e)]-0x1,f);const g=await f[o(0x18d)](),h=this['resolveStatus'](g);e[o(0x18b)]=h;const i=await this[o(0x168)](this[o(0x188)],h);return i[o(0x14e)]&&(e[o(0x150)]=i[o(0x16b)](',')),c['setActivityAttributes'](e),this[o(0x165)][o(0x181)]['aid'];}['isInterruptingSelf'](){const p=l;if(!this[p(0x167)]['target'])return!![];const c=pipe_1[p(0x156)][p(0x17f)](this[p(0x167)][p(0x17c)],this['context']);return c==this[p(0x165)][p(0x181)][p(0x147)];}[l(0x14a)](){const q=l;return{'reason':this[q(0x167)]['reason']!==undefined?pipe_1['Pipe']['resolve'](this[q(0x167)]['reason'],this[q(0x165)]):undefined,'throw':this[q(0x167)][q(0x166)]!==undefined?pipe_1[q(0x156)][q(0x17f)](this[q(0x167)][q(0x166)],this[q(0x165)]):undefined,'descend':this[q(0x167)][q(0x174)]!==undefined?pipe_1['Pipe']['resolve'](this[q(0x167)][q(0x174)],this[q(0x165)]):undefined,'code':this[q(0x167)][q(0x17a)]!==undefined?pipe_1['Pipe'][q(0x17f)](this['config']['code'],this['context']):undefined,'expire':this[q(0x167)][q(0x169)]!==undefined?pipe_1[q(0x156)][q(0x17f)](this[q(0x167)][q(0x169)],this[q(0x165)]):undefined,'stack':this[q(0x167)]['stack']!==undefined?pipe_1[q(0x156)][q(0x17f)](this[q(0x167)][q(0x182)],this[q(0x165)]):undefined};}async[l(0x178)](){const r=l,c=this[r(0x14a)]();return await this['engine']['interrupt'](this[r(0x167)][r(0x154)]!==undefined?pipe_1[r(0x156)]['resolve'](this['config'][r(0x154)],this[r(0x165)]):this[r(0x165)][r(0x181)][r(0x15d)],this[r(0x167)][r(0x17c)]!==undefined?pipe_1['Pipe']['resolve'](this['config'][r(0x17c)],this[r(0x165)]):this[r(0x165)][r(0x181)][r(0x147)],c);}}function b(c,d){const e=a();return b=function(f,g){f=f-0x13d;let h=e[f];return h;},b(c,d);}exports[l(0x180)]=Interrupt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';const k=b;function a(){const q=['defineProperty','transition','25501qdAejt','metadata','message','signal-process-error','key_name','info','resolver','3340626Rwcrxm','signal-inactive-job-error','../telemetry','duplicate','InactiveJobError','signal-collation-overage','4268664SjWvta','logger','../pipe','2HvegGD','context','error','store','code','Pipe','debug','process-event-generational-job-error','endActivitySpan','mapSignalData','mapRules','verifyEntry','guid','../../modules/errors','resolveStatus','adjacencyList','./activity','__esModule','643990gMpPCX','hookAll','maps','appId','subtype','MapperService','startActivitySpan','leg','join','fault','1547916ufAKgt','30529OymHIe','setStatus','aid','notarizeEarlyCompletion','Activity','app.activity.mids','mapOutputData','resolve','signal-process-end','jid','TelemetryService','CollationError','1096qPqIkN','../collator','filterAdjacent','1537408yjRNCj','mapResolverData','hookOne','scrub','engine','gid','signal','config','setActivityError'];a=function(){return q;};return a();}(function(c,d){const j=b,e=c();while(!![]){try{const f=parseInt(j(0x1eb))/0x1+-parseInt(j(0x215))/0x2*(parseInt(j(0x1ea))/0x3)+parseInt(j(0x1fa))/0x4+-parseInt(j(0x1e0))/0x5+parseInt(j(0x20c))/0x6+parseInt(j(0x205))/0x7*(-parseInt(j(0x1f7))/0x8)+parseInt(j(0x212))/0x9;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x49c07));Object[k(0x203)](exports,k(0x1df),{'value':!![]}),exports['Signal']=void 0x0;function b(c,d){const e=a();return b=function(f,g){f=f-0x1df;let h=e[f];return h;},b(c,d);}const errors_1=require(k(0x222)),collator_1=require(k(0x1f8)),mapper_1=require('../mapper'),pipe_1=require(k(0x214)),telemetry_1=require(k(0x20e)),activity_1=require(k(0x225));class Signal extends activity_1[k(0x1ef)]{constructor(c,d,e,f,g,h){super(c,d,e,f,g,h);}async['process'](){const l=k;this[l(0x213)]['debug']('signal-process',{'jid':this[l(0x216)]['metadata'][l(0x1f4)],'gid':this[l(0x216)][l(0x206)]['gid'],'aid':this[l(0x206)][l(0x1ed)]});let c;try{await this[l(0x220)](),c=new telemetry_1[(l(0x1f5))](this['engine'][l(0x1e3)],this[l(0x201)],this[l(0x206)],this[l(0x216)]),c[l(0x1e6)](this[l(0x1e7)]);const d=this[l(0x218)]['transact']();this[l(0x224)]=await this[l(0x1f9)](),this[l(0x1f1)](),this['mapJobData'](),await this['setState'](d),await collator_1['CollatorService'][l(0x1ee)](this,d),await this[l(0x1ec)](this['adjacencyList']['length']-0x1,d);const e=await d['exec']();this[l(0x201)][l(0x1e4)]==='all'?await this['hookAll']():await this[l(0x1fc)]();const f=this[l(0x223)](e),g={'app.job.jss':f},h=await this[l(0x204)](this[l(0x224)],f);return h['length']&&(g[l(0x1f0)]=h[l(0x1e8)](',')),c['mapActivityAttributes'](),c['setActivityAttributes'](g),this[l(0x216)][l(0x206)][l(0x1ed)];}catch(i){if(i instanceof errors_1[l(0x210)]){this[l(0x213)]['error'](l(0x20d),{...i});return;}else{if(i instanceof errors_1['GenerationalError']){this[l(0x213)][l(0x20a)](l(0x21c),{...i});return;}else{if(i instanceof errors_1['GetStateError']){this['logger'][l(0x217)]('signal-get-state-error',{...i});return;}else{if(i instanceof errors_1[l(0x1f6)]){if(i[l(0x1e9)]===l(0x20f)){this[l(0x213)]['info'](l(0x211),{'job_id':this['context'][l(0x206)][l(0x1f4)],'guid':this[l(0x216)][l(0x206)][l(0x221)]});return;}this['logger'][l(0x217)]('signal-collation-error',{...i});}else this[l(0x213)]['error'](l(0x208),{...i});}}}c?.[l(0x202)](i[l(0x207)]);throw i;}finally{c?.[l(0x21d)](),this[l(0x213)][l(0x21b)](l(0x1f3),{'jid':this[l(0x216)]['metadata']['jid'],'gid':this[l(0x216)][l(0x206)][l(0x1ff)],'aid':this[l(0x206)][l(0x1ed)]});}}[k(0x21e)](){const m=k;if(this[m(0x201)][m(0x200)]?.[m(0x1e2)]){const c=new mapper_1[(m(0x1e5))](this[m(0x201)]['signal'][m(0x1e2)],this[m(0x216)]);return c[m(0x21f)]();}}[k(0x1fb)](){const n=k;if(this[n(0x201)]['resolver']?.['maps']){const c=new mapper_1[(n(0x1e5))](this['config'][n(0x20b)]['maps'],this['context']);return c[n(0x21f)]();}}async[k(0x1fc)](){const o=k,c=pipe_1[o(0x21a)][o(0x1f2)](this['config']['topic'],this[o(0x216)]),d=this['mapSignalData'](),e=pipe_1[o(0x21a)][o(0x1f2)](this[o(0x201)]['status'],this[o(0x216)]),f=pipe_1[o(0x21a)][o(0x1f2)](this[o(0x201)][o(0x219)],this[o(0x216)]);return await this[o(0x1fe)]['hook'](c,d,e,f);}async['hookAll'](){const p=k,c=this['mapSignalData'](),d=this[p(0x1fb)]();this[p(0x201)][p(0x1fd)]&&(d[p(0x1fd)]=!![]);const e=pipe_1[p(0x21a)][p(0x1f2)](this[p(0x201)][p(0x209)],this[p(0x216)]),f=pipe_1[p(0x21a)]['resolve'](this[p(0x201)]['key_value'],this[p(0x216)]),g=[e+':'+f];return await this['engine'][p(0x1e1)](this[p(0x201)]['topic'],c,d,g);}}exports['Signal']=Signal;
|