@hotmeshio/hotmesh 0.3.21 → 0.3.23
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 +7 -7
- package/build/modules/enums.d.ts +2 -0
- package/build/modules/enums.js +3 -1
- package/build/modules/key.js +1 -1
- package/build/modules/utils.js +1 -1
- package/build/package.json +1 -1
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.js +1 -1
- package/build/services/activities/index.js +1 -1
- package/build/services/activities/interrupt.js +1 -1
- package/build/services/activities/signal.js +1 -1
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.js +1 -1
- package/build/services/connector/factory.js +0 -1
- package/build/services/connector/providers/postgres.d.ts +1 -1
- package/build/services/connector/providers/postgres.js +2 -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/meshcall/index.js +2 -2
- package/build/services/meshflow/client.js +2 -2
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/worker.js +2 -2
- 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/factory.d.ts +1 -1
- package/build/services/sub/factory.js +4 -4
- package/build/services/sub/providers/nats/nats.js +1 -1
- 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.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/package.json +1 -1
- package/types/postgres.ts +1 -1
- package/types/provider.ts +1 -3
package/README.md
CHANGED
|
@@ -29,8 +29,8 @@ npm install @hotmeshio/hotmesh
|
|
|
29
29
|
|
|
30
30
|
<br/>
|
|
31
31
|
|
|
32
|
-
## MeshCall
|
|
33
|
-
[MeshCall](https://hotmeshio.github.io/sdk-typescript/classes/services_meshcall.MeshCall.html) connects
|
|
32
|
+
## MeshCall
|
|
33
|
+
[MeshCall](https://hotmeshio.github.io/sdk-typescript/classes/services_meshcall.MeshCall.html) connects any function to the mesh
|
|
34
34
|
|
|
35
35
|
<details style="padding: .5em">
|
|
36
36
|
<summary style="font-size:1.25em;">Run an idempotent cron job <small>[more]</small></summary>
|
|
@@ -200,8 +200,8 @@ npm install @hotmeshio/hotmesh
|
|
|
200
200
|
|
|
201
201
|
<br/>
|
|
202
202
|
|
|
203
|
-
## MeshFlow
|
|
204
|
-
[MeshFlow](https://hotmeshio.github.io/sdk-typescript/classes/services_meshflow.MeshFlow.html) is a
|
|
203
|
+
## MeshFlow
|
|
204
|
+
[MeshFlow](https://hotmeshio.github.io/sdk-typescript/classes/services_meshflow.MeshFlow.html) is a serverless replacement for *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>
|
|
@@ -555,8 +555,8 @@ This example calls an activity and then sleeps for a week. It runs indefinitely
|
|
|
555
555
|
|
|
556
556
|
<br/>
|
|
557
557
|
|
|
558
|
-
## MeshData
|
|
559
|
-
[MeshData](https://hotmeshio.github.io/sdk-typescript/classes/services_meshdata.MeshData.html) adds analytics to
|
|
558
|
+
## MeshData
|
|
559
|
+
[MeshData](https://hotmeshio.github.io/sdk-typescript/classes/services_meshdata.MeshData.html) adds analytics to running workflows
|
|
560
560
|
|
|
561
561
|
<details style="padding: .5em">
|
|
562
562
|
<summary style="font-size:1.25em;">Create a search index <small>[more]</small></summary>
|
|
@@ -755,7 +755,7 @@ 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 ships with support for Postgres (pg) and Redis (ioredis/redis). NATS is also supported for PubSub for extended patterns.
|
|
758
|
+
HotMesh is pluggable and ships with support for **Postgres** (pg) and **Redis** (ioredis/redis). **NATS** is also supported for PubSub for extended patterns.
|
|
759
759
|
|
|
760
760
|
<details style="padding: .5em">
|
|
761
761
|
<summary style="font-size:1.25em;">Postgres <small>[more]</small></summary>
|
package/build/modules/enums.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export declare const HMSH_STATUS_UNKNOWN = "unknown";
|
|
|
22
22
|
export declare const HMSH_QUORUM_ROLLCALL_CYCLES = 12;
|
|
23
23
|
export declare const HMSH_QUORUM_DELAY_MS = 250;
|
|
24
24
|
export declare const HMSH_ACTIVATION_MAX_RETRY = 3;
|
|
25
|
+
export declare const HMSH_DEPLOYMENT_DELAY: number;
|
|
26
|
+
export declare const HMSH_DEPLOYMENT_PAUSE: number;
|
|
25
27
|
export declare const HMSH_OTT_WAIT_TIME: number;
|
|
26
28
|
export declare const HMSH_EXPIRE_JOB_SECONDS: number;
|
|
27
29
|
export declare const MAX_DELAY = 2147483647;
|
package/build/modules/enums.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HMSH_GUID_SIZE = exports.HMSH_SCOUT_INTERVAL_SECONDS = exports.HMSH_FIDELITY_SECONDS = exports.HMSH_EXPIRE_DURATION = exports.HMSH_XPENDING_COUNT = exports.HMSH_XCLAIM_COUNT = exports.HMSH_XCLAIM_DELAY_MS = exports.HMSH_BLOCK_TIME_MS = exports.HMSH_MESHFLOW_EXP_BACKOFF = exports.HMSH_MESHFLOW_MAX_INTERVAL = exports.HMSH_MESHFLOW_MAX_ATTEMPTS = exports.HMSH_GRADUATED_INTERVAL_MS = exports.HMSH_MAX_TIMEOUT_MS = exports.HMSH_MAX_RETRIES = exports.MAX_DELAY = exports.HMSH_EXPIRE_JOB_SECONDS = exports.HMSH_OTT_WAIT_TIME = exports.HMSH_ACTIVATION_MAX_RETRY = exports.HMSH_QUORUM_DELAY_MS = exports.HMSH_QUORUM_ROLLCALL_CYCLES = exports.HMSH_STATUS_UNKNOWN = exports.HMSH_CODE_MESHFLOW_RETRYABLE = exports.HMSH_CODE_MESHFLOW_FATAL = exports.HMSH_CODE_MESHFLOW_MAXED = exports.HMSH_CODE_MESHFLOW_TIMEOUT = exports.HMSH_CODE_MESHFLOW_WAIT = exports.HMSH_CODE_MESHFLOW_PROXY = exports.HMSH_CODE_MESHFLOW_CHILD = exports.HMSH_CODE_MESHFLOW_ALL = exports.HMSH_CODE_MESHFLOW_SLEEP = exports.HMSH_CODE_UNACKED = exports.HMSH_CODE_TIMEOUT = exports.HMSH_CODE_UNKNOWN = exports.HMSH_CODE_INTERRUPT = exports.HMSH_CODE_NOTFOUND = exports.HMSH_CODE_PENDING = exports.HMSH_CODE_SUCCESS = exports.HMSH_SIGNAL_EXPIRE = exports.HMSH_IS_CLUSTER = exports.HMSH_LOGLEVEL = void 0;
|
|
3
|
+
exports.HMSH_GUID_SIZE = exports.HMSH_SCOUT_INTERVAL_SECONDS = exports.HMSH_FIDELITY_SECONDS = exports.HMSH_EXPIRE_DURATION = exports.HMSH_XPENDING_COUNT = exports.HMSH_XCLAIM_COUNT = exports.HMSH_XCLAIM_DELAY_MS = exports.HMSH_BLOCK_TIME_MS = exports.HMSH_MESHFLOW_EXP_BACKOFF = exports.HMSH_MESHFLOW_MAX_INTERVAL = exports.HMSH_MESHFLOW_MAX_ATTEMPTS = exports.HMSH_GRADUATED_INTERVAL_MS = exports.HMSH_MAX_TIMEOUT_MS = exports.HMSH_MAX_RETRIES = exports.MAX_DELAY = exports.HMSH_EXPIRE_JOB_SECONDS = exports.HMSH_OTT_WAIT_TIME = exports.HMSH_DEPLOYMENT_PAUSE = exports.HMSH_DEPLOYMENT_DELAY = exports.HMSH_ACTIVATION_MAX_RETRY = exports.HMSH_QUORUM_DELAY_MS = exports.HMSH_QUORUM_ROLLCALL_CYCLES = exports.HMSH_STATUS_UNKNOWN = exports.HMSH_CODE_MESHFLOW_RETRYABLE = exports.HMSH_CODE_MESHFLOW_FATAL = exports.HMSH_CODE_MESHFLOW_MAXED = exports.HMSH_CODE_MESHFLOW_TIMEOUT = exports.HMSH_CODE_MESHFLOW_WAIT = exports.HMSH_CODE_MESHFLOW_PROXY = exports.HMSH_CODE_MESHFLOW_CHILD = exports.HMSH_CODE_MESHFLOW_ALL = exports.HMSH_CODE_MESHFLOW_SLEEP = exports.HMSH_CODE_UNACKED = exports.HMSH_CODE_TIMEOUT = exports.HMSH_CODE_UNKNOWN = exports.HMSH_CODE_INTERRUPT = exports.HMSH_CODE_NOTFOUND = exports.HMSH_CODE_PENDING = exports.HMSH_CODE_SUCCESS = exports.HMSH_SIGNAL_EXPIRE = exports.HMSH_IS_CLUSTER = exports.HMSH_LOGLEVEL = void 0;
|
|
4
4
|
exports.HMSH_LOGLEVEL = process.env.HMSH_LOGLEVEL || 'info';
|
|
5
5
|
exports.HMSH_IS_CLUSTER = process.env.HMSH_IS_CLUSTER === 'true';
|
|
6
6
|
exports.HMSH_SIGNAL_EXPIRE = 3600;
|
|
@@ -24,6 +24,8 @@ exports.HMSH_STATUS_UNKNOWN = 'unknown';
|
|
|
24
24
|
exports.HMSH_QUORUM_ROLLCALL_CYCLES = 12;
|
|
25
25
|
exports.HMSH_QUORUM_DELAY_MS = 250;
|
|
26
26
|
exports.HMSH_ACTIVATION_MAX_RETRY = 3;
|
|
27
|
+
exports.HMSH_DEPLOYMENT_DELAY = parseInt(process.env.HMSH_DEPLOYMENT_DELAY, 10) || 10000;
|
|
28
|
+
exports.HMSH_DEPLOYMENT_PAUSE = parseInt(process.env.HMSH_DEPLOYMENT_PAUSE, 10) || 250;
|
|
27
29
|
exports.HMSH_OTT_WAIT_TIME = parseInt(process.env.HMSH_OTT_WAIT_TIME, 10) || 1000;
|
|
28
30
|
exports.HMSH_EXPIRE_JOB_SECONDS = parseInt(process.env.HMSH_EXPIRE_JOB_SECONDS, 10) || 1;
|
|
29
31
|
exports.MAX_DELAY = 2147483647;
|
package/build/modules/key.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x1bd3e1,_0x910d45){const _0x40b184=_0x340e,_0x36cec0=_0x1bd3e1();while(!![]){try{const _0x256f07=-parseInt(_0x40b184(0x89))/0x1+parseInt(_0x40b184(0x88))/0x2*(parseInt(_0x40b184(0x87))/0x3)+-parseInt(_0x40b184(0x83))/0x4+parseInt(_0x40b184(0x84))/0x5+-parseInt(_0x40b184(0x86))/0x6+-parseInt(_0x40b184(0x85))/0x7*(-parseInt(_0x40b184(0x8a))/0x8)+parseInt(_0x40b184(0x82))/0x9;if(_0x256f07===_0x910d45)break;else _0x36cec0['push'](_0x36cec0['shift']());}catch(_0x4c609b){_0x36cec0['push'](_0x36cec0['shift']());}}}(_0x3359,0xa5ddc));function _0x340e(_0x3c42f6,_0x523b27){const _0x335962=_0x3359();return _0x340e=function(_0x340e6d,_0x238dd2){_0x340e6d=_0x340e6d-0x82;let _0x578bdd=_0x335962[_0x340e6d];return _0x578bdd;},_0x340e(_0x3c42f6,_0x523b27);}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'];}});const HMNS='hmsh';exports['HMNS']=HMNS;const KEYSEP=':';exports['KEYSEP']=KEYSEP;function _0x3359(){const _0x189bca=['641786ABiPWY','8YCrIcc','16836975RroWix','2377348BBWVTQ','1974435KRjWSv','394226BTtXhz','5844750KHjZWa','425742zrFEki','8iSjvwa'];_0x3359=function(){return _0x189bca;};return _0x3359();}const VALSEP='::';exports['VALSEP']=VALSEP;const WEBSEP='::';exports['WEBSEP']=WEBSEP;const TYPSEP='::';exports['TYPSEP']=TYPSEP;class KeyService{static['mintKey'](_0x11607c,_0x5c3ce5,_0x59fc2f){switch(_0x5c3ce5){case hotmesh_1['KeyType']['HOTMESH']:return _0x11607c;case hotmesh_1['KeyType']['THROTTLE_RATE']:return _0x11607c+':'+_0x59fc2f['appId']+':r:';case hotmesh_1['KeyType']['WORK_ITEMS']:return _0x11607c+':'+_0x59fc2f['appId']+':w:'+(_0x59fc2f['scoutType']||'');case hotmesh_1['KeyType']['TIME_RANGE']:return _0x11607c+':'+_0x59fc2f['appId']+':t:'+(_0x59fc2f['timeValue']||'');case hotmesh_1['KeyType']['APP']:return _0x11607c+':a:'+(_0x59fc2f['appId']||'');case hotmesh_1['KeyType']['QUORUM']:return _0x11607c+':'+_0x59fc2f['appId']+':q:'+(_0x59fc2f['engineId']||'');case hotmesh_1['KeyType']['JOB_STATE']:return _0x11607c+':'+_0x59fc2f['appId']+':j:'+_0x59fc2f['jobId'];case hotmesh_1['KeyType']['JOB_DEPENDENTS']:return _0x11607c+':'+_0x59fc2f['appId']+':d:'+_0x59fc2f['jobId'];case hotmesh_1['KeyType']['JOB_STATS_GENERAL']:return _0x11607c+':'+_0x59fc2f['appId']+':s:'+_0x59fc2f['jobKey']+':'+_0x59fc2f['dateTime'];case hotmesh_1['KeyType']['JOB_STATS_MEDIAN']:return _0x11607c+':'+_0x59fc2f['appId']+':s:'+_0x59fc2f['jobKey']+':'+_0x59fc2f['dateTime']+':'+_0x59fc2f['facet'];case hotmesh_1['KeyType']['JOB_STATS_INDEX']:return _0x11607c+':'+_0x59fc2f['appId']+':s:'+_0x59fc2f['jobKey']+':'+_0x59fc2f['dateTime']+':'+_0x59fc2f['facet'];case hotmesh_1['KeyType']['SCHEMAS']:return _0x11607c+':'+_0x59fc2f['appId']+':v:'+_0x59fc2f['appVersion']+':schemas';case hotmesh_1['KeyType']['SUBSCRIPTIONS']:return _0x11607c+':'+_0x59fc2f['appId']+':v:'+_0x59fc2f['appVersion']+':subscriptions';case hotmesh_1['KeyType']['SUBSCRIPTION_PATTERNS']:return _0x11607c+':'+_0x59fc2f['appId']+':v:'+_0x59fc2f['appVersion']+':transitions';case hotmesh_1['KeyType']['HOOKS']:return _0x11607c+':'+_0x59fc2f['appId']+':hooks';case hotmesh_1['KeyType']['SIGNALS']:return _0x11607c+':'+_0x59fc2f['appId']+':signals';case hotmesh_1['KeyType']['SYMKEYS']:return _0x11607c+':'+_0x59fc2f['appId']+':sym:keys:'+(_0x59fc2f['activityId']||'');case hotmesh_1['KeyType']['SYMVALS']:return _0x11607c+':'+_0x59fc2f['appId']+':sym:vals:';case hotmesh_1['KeyType']['STREAMS']:return _0x11607c+':'+(_0x59fc2f['appId']||'')+':x:'+(_0x59fc2f['topic']||'');default:throw new Error('Invalid\x20key\x20type.');}}static['parseKey'](_0x3bfc11){const [_0x30085d,_0x3198b4,_0x15998c,..._0x757b32]=_0x3bfc11['split'](KEYSEP),_0x215a7b=_0x757b32['join'](KEYSEP)||'';return{'namespace':_0x30085d,'app':_0x15998c==='a'?_0x3198b4:undefined,'entity':_0x15998c,'id':_0x215a7b};}static['reconstituteKey'](_0x25d349){const {namespace:_0x2ae8ae,app:_0x5b304d,entity:_0x47a98f,id:_0x280663}=_0x25d349;return''+_0x2ae8ae+KEYSEP+_0x5b304d+KEYSEP+_0x47a98f+KEYSEP+(_0x280663||'');}static['resolveEntityType'](_0x5b6223,_0x770b97=''){switch(_0x5b6223){case'a':return'applications';case'r':return'throttles';case'w':return _0x770b97===''?'task_priorities':'roles';case't':return _0x770b97===''?'task_schedules':'task_lists';case'q':return'events';case'j':return'jobs';case's':return'stats';case'v':return'versions';case'x':return _0x770b97===''?'streams':'stream_topics';case'hooks':return'signal_patterns';case'signals':return'signal_registry';case'sym':return'symbols';default:return'unknown_entity';}}static['resolveAbbreviation'](_0x200edb){switch(_0x200edb){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(_0x4f4094,_0x1268a3){const _0x12d838=_0x23e3,_0x29a595=_0x4f4094();while(!![]){try{const _0x3a17a9=-parseInt(_0x12d838(0xe5))/0x1*(-parseInt(_0x12d838(0xee))/0x2)+parseInt(_0x12d838(0xec))/0x3*(parseInt(_0x12d838(0xe6))/0x4)+parseInt(_0x12d838(0xe4))/0x5+-parseInt(_0x12d838(0xeb))/0x6+-parseInt(_0x12d838(0xe9))/0x7*(parseInt(_0x12d838(0xea))/0x8)+parseInt(_0x12d838(0xe7))/0x9*(parseInt(_0x12d838(0xe8))/0xa)+parseInt(_0x12d838(0xed))/0xb;if(_0x3a17a9===_0x1268a3)break;else _0x29a595['push'](_0x29a595['shift']());}catch(_0x26be96){_0x29a595['push'](_0x29a595['shift']());}}}(_0x2a33,0xb4422));var __importDefault=this&&this['__importDefault']||function(_0x5932c9){return _0x5932c9&&_0x5932c9['__esModule']?_0x5932c9:{'default':_0x5932c9};};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=_0xfa883b=>{const _0x298cc7=JSON['stringify'](_0xfa883b);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x298cc7)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0xfde52=os_1['default']['totalmem'](),_0xf545fc=os_1['default']['freemem'](),_0x4f1eb8=_0xfde52-_0xf545fc,_0x4b4226={'TotalMemoryGB':(_0xfde52/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0xf545fc/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x4f1eb8/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x4b4226;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x513957){return JSON['parse'](JSON['stringify'](_0x513957));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x2096f0){const _0x3147fa=Math['sin'](_0x2096f0)*0x2710;return _0x3147fa-Math['floor'](_0x3147fa);}exports['deterministicRandom']=deterministicRandom;function guid(_0x3b5a22=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x3b5a22);}exports['guid']=guid;function _0x23e3(_0x404109,_0x39e479){const _0x2a330a=_0x2a33();return _0x23e3=function(_0x23e39e,_0x4fdc2c){_0x23e39e=_0x23e39e-0xe4;let _0xfc91b3=_0x2a330a[_0x23e39e];return _0xfc91b3;},_0x23e3(_0x404109,_0x39e479);}async function sleepFor(_0x28e09a){return new Promise(_0x4b2673=>setTimeout(_0x4b2673,_0x28e09a));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x306390=>setImmediate(_0x306390));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0x54bbd5){let _0x434833;const _0xc65ffa=new Promise(_0x47585a=>{_0x434833=setTimeout(_0x47585a,_0x54bbd5);});return{'promise':_0xc65ffa,'timerId':_0x434833};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x5e7d37){const _0x154123=Object['getPrototypeOf'](_0x5e7d37);if(_0x5e7d37['Query']?.['prototype']||Object['keys'](_0x5e7d37)['includes']('database')||_0x154123['name']==='Pool')return'postgres';else{if(_0x5e7d37['toString']()['toLowerCase']()['includes']('nats'))return'nats';else{if('defineCommand'in _0x154123||Object['keys'](_0x154123)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x154123)['includes']('Multi'))return'redis';}}}if(_0x5e7d37['constructor']){if(_0x5e7d37['constructor']['name']==='Redis'||_0x5e7d37['constructor']['name']==='EventEmitter'){if('hset'in _0x5e7d37)return'ioredis';}else{if(_0x5e7d37['constructor']['name']==='ProviderClient'||_0x5e7d37['constructor']['name']==='Commander'){if('HSET'in _0x5e7d37)return'redis';}}}let _0x1d3030=null;if(Object['keys'](_0x5e7d37)['includes']('connection')||!isNaN(_0x5e7d37['totalCount'])&&!isNaN(_0x5e7d37['idleCount']))_0x1d3030='postgres';else{if(Object['keys'](_0x5e7d37)['includes']('Pipeline'))_0x1d3030='ioredis';else{if(Object['keys'](_0x5e7d37)['includes']('createClient'))_0x1d3030='redis';else _0x154123['constructor']['toString']()['includes']('NatsConnectionImpl')&&(_0x1d3030='nats');}}return _0x1d3030;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x5000bf){return _0x5000bf==='activity'?'hook':_0x5000bf;},'providerConfig'(_0x37d3dc){return _0x37d3dc?.['connection']??_0x37d3dc?.['redis']??_0x37d3dc?.['connections'];},'meshDataConfig'(_0x215a51){return{..._0x215a51['connection']};}};function matchesStatusCode(_0x1c2a12,_0x28017b){if(typeof _0x28017b==='string'){const _0x2db424='^'+_0x28017b['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x2db424)['test'](_0x1c2a12['toString']());}return _0x28017b['test'](_0x1c2a12['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x1eeb17,_0x2daaef){return _0x1eeb17===_0x2daaef;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x1c1286,_0x27b0b4){for(const [_0x48e854,_0x2db75c]of Object['entries'](_0x1c1286)){if(_0x2db75c['hasOwnProperty'](_0x27b0b4)){const _0xe0a66c=findTopKey(_0x1c1286,_0x48e854['replace'](/^\./,''));return(_0xe0a66c||_0x48e854)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x4e2208,_0x3c77af){for(const [_0x7f30b2,_0x2c5b42]of Object['entries'](_0x4e2208)){if(_0x2c5b42===_0x3c77af)return _0x7f30b2;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0xf9c115,_0x2e0f34,_0x435418){const _0x214cee=await _0x2e0f34['getTransitions'](_0x435418),_0x5cc93f=await _0x2e0f34['getSubscriptions'](_0x435418),_0x3d4e56=findTopKey(_0x214cee,_0xf9c115),_0x179088=findSubscriptionForTrigger(_0x5cc93f,_0x3d4e56);return _0x179088;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x5dd000){if(_0x5dd000['toString']()==='infinity')return'0';const _0x9cbbea=new Date(),_0x2e6241=_0x5dd000['slice'](-0x1),_0x153620=parseInt(_0x5dd000['slice'](0x0,-0x1),0xa);if(_0x2e6241==='m'){const _0x2317e8=Math['floor'](_0x9cbbea['getMinutes']()/_0x153620)*_0x153620;_0x9cbbea['setUTCMinutes'](_0x2317e8,0x0,0x0);}else _0x2e6241==='h'&&_0x9cbbea['setUTCMinutes'](0x0,0x0,0x0);return _0x9cbbea['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x20a282){const _0x27498a=_0x20a282 instanceof Date?_0x20a282:new Date(_0x20a282);return _0x27498a['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0xb56d2f){const _0x24bd3b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x268729=_0x24bd3b['length'];if(_0xb56d2f<0x0||_0xb56d2f>=Math['pow'](_0x268729,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x5eae73,_0x2d80a3]=divmod(_0xb56d2f,_0x268729),[_0x5d93af,_0x59d7e1]=divmod(_0x5eae73,_0x268729);return _0x24bd3b[_0x5d93af]+_0x24bd3b[_0x2d80a3]+_0x24bd3b[_0x59d7e1];}exports['getSymKey']=getSymKey;function getSymVal(_0x165c47){const _0x59fbfe='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x570ab8=_0x59fbfe['length'];if(_0x165c47<0x0||_0x165c47>=Math['pow'](_0x570ab8,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x40eb29,_0x32f259]=divmod(_0x165c47,_0x570ab8);return _0x59fbfe[_0x40eb29]+_0x59fbfe[_0x32f259];}exports['getSymVal']=getSymVal;function divmod(_0x473e06,_0x5a2fc4){return[Math['floor'](_0x473e06/_0x5a2fc4),_0x473e06%_0x5a2fc4];}function _0x2a33(){const _0x5e3d23=['21eUKyta','2952792CAyqsO','7268148iqNBMF','69603ykYyDq','1923064lHkKEY','1110Inehtl','4203855gHvvni','1307PLhijM','136JEPVDf','4744611ZzyTdi','10zQxXoR'];_0x2a33=function(){return _0x5e3d23;};return _0x2a33();}function getIndexedHash(_0x302685,_0x5e7290){const _0x1ea2af=_0x302685[_0x5e7290]||0x0,_0x1d5119={..._0x302685};return delete _0x1d5119[_0x5e7290],[_0x1ea2af,_0x1d5119];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0xd08797,_0x384985){const _0x1f040d=_0x384985['split']('/');let _0x38dad0=_0xd08797;for(const _0x3ddd3b of _0x1f040d){if(_0x38dad0[_0x3ddd3b]!==undefined)_0x38dad0=_0x38dad0[_0x3ddd3b];else return undefined;}return _0x38dad0;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x1b3349){const _0x4102fe={};for(const _0x48cb78 in _0x1b3349){if(_0x1b3349[_0x48cb78]===undefined)continue;const _0x473a31=_0x48cb78['split']('/');let _0x42a948=_0x4102fe;for(let _0x475371=0x0;_0x475371<_0x473a31['length'];_0x475371++){_0x475371===_0x473a31['length']-0x1?_0x42a948[_0x473a31[_0x475371]]=_0x1b3349[_0x48cb78]:(_0x42a948[_0x473a31[_0x475371]]=_0x42a948[_0x473a31[_0x475371]]||{},_0x42a948=_0x42a948[_0x473a31[_0x475371]]);}}return _0x4102fe;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x56b8cc){const _0x4d57b2=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x4d57b2['test'](_0x56b8cc);}exports['isValidCron']=isValidCron;const s=_0x220334=>{return(0x0,ms_1['default'])(_0x220334)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x3ab92d=>{try{return JSON['parse'](_0x3ab92d);}catch(_0x2671a7){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x2671a7});throw _0x2671a7;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0x183851=>{return Array['isArray'](_0x183851)&&Array['isArray'](_0x183851[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x51f227=>{const _0x1d1c52=[];let _0x42af49;for(let _0x59966e=0x1;_0x59966e<_0x51f227['length'];_0x59966e++){const _0x5b4d6d=_0x51f227[_0x59966e],_0x9e1bf5={};if(Array['isArray'](_0x5b4d6d)){for(let _0x3e5625=0x0;_0x3e5625<_0x5b4d6d['length'];_0x3e5625+=0x2){const _0x10f177=_0x5b4d6d[_0x3e5625],_0x3c6179=_0x5b4d6d[_0x3e5625+0x1];_0x9e1bf5[_0x10f177]=_0x3c6179;}_0x42af49&&(_0x9e1bf5['$']=_0x42af49),_0x1d1c52['push'](_0x9e1bf5),_0x42af49=undefined;}else _0x42af49=_0x5b4d6d;}return _0x1d1c52;};exports['arrayToHash']=arrayToHash;
|
|
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;
|
package/build/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x7239e3,_0x211c3f){const _0x13831b=_0x2cf1,_0x5c3d3e=_0x7239e3();while(!![]){try{const _0x1f72c4=parseInt(_0x13831b(0x15d))/0x1+-parseInt(_0x13831b(0x15e))/0x2*(parseInt(_0x13831b(0x15f))/0x3)+parseInt(_0x13831b(0x160))/0x4+parseInt(_0x13831b(0x161))/0x5+-parseInt(_0x13831b(0x163))/0x6+parseInt(_0x13831b(0x162))/0x7+-parseInt(_0x13831b(0x164))/0x8;if(_0x1f72c4===_0x211c3f)break;else _0x5c3d3e['push'](_0x5c3d3e['shift']());}catch(_0x33b59d){_0x5c3d3e['push'](_0x5c3d3e['shift']());}}}(_0x1fe2,0x44669));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 _0x2cf1(_0x5dcbdd,_0x2ad6e0){const _0x1fe2d8=_0x1fe2();return _0x2cf1=function(_0x2cf1e7,_0xfd33ee){_0x2cf1e7=_0x2cf1e7-0x15d;let _0x5bea8e=_0x1fe2d8[_0x2cf1e7];return _0x5bea8e;},_0x2cf1(_0x5dcbdd,_0x2ad6e0);}class Activity{constructor(_0x55a9ce,_0x1fa7ef,_0x407e26,_0x41f0d0,_0x37a2bc,_0xdbea53){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x55a9ce,this['data']=_0x1fa7ef,this['metadata']=_0x407e26,this['hook']=_0x41f0d0,this['engine']=_0x37a2bc,this['context']=_0xdbea53||{'data':{},'metadata':{}},this['logger']=_0x37a2bc['logger'],this['store']=_0x37a2bc['store'];}['setLeg'](_0x46be97){this['leg']=_0x46be97;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0xadfad6=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0xadfad6!==undefined&&!isNaN(Number(_0xadfad6)))return _0xadfad6;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x392696=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x392696);}catch(_0x1c2ed5){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x392696>0x0){if(this['context']['metadata']['js']===_0x392696){const _0x5b4c9c=await this['setStatus'](-_0x392696);Number(_0x5b4c9c)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x1c2ed5;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0xde12fb=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,_0xde12fb);}async['processEvent'](_0x5916bd=stream_1['StreamStatus']['SUCCESS'],_0x2a2d33=0xc8,_0x1e8a93='output'){this['setLeg'](0x2);const _0x2a02b9=this['context']['metadata']['jid'];if(!_0x2a02b9){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x407eeb=this['metadata']['aid'];this['status']=_0x5916bd,this['code']=_0x2a2d33,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x2a02b9,'aid':_0x407eeb,'status':_0x5916bd,'code':_0x2a2d33});let _0x3057f9;try{const _0x56fe50=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x56fe50),_0x3057f9=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x3057f9['startActivitySpan'](this['leg']);let _0x59dcfc;if(_0x5916bd===stream_1['StreamStatus']['PENDING'])_0x59dcfc=await this['processPending'](_0x1e8a93);else _0x5916bd===stream_1['StreamStatus']['SUCCESS']?_0x59dcfc=await this['processSuccess'](_0x1e8a93):_0x59dcfc=await this['processError']();this['transitionAdjacent'](_0x59dcfc,_0x3057f9);}catch(_0x3a5901){if(_0x3a5901 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x3a5901['fault']+'-error',{..._0x3a5901});return;}else{if(_0x3a5901 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x3a5901});return;}else{if(_0x3a5901 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x3a5901});return;}else{if(_0x3a5901 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x3a5901});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x3a5901,'message':_0x3a5901['message'],'stack':_0x3a5901['stack'],'name':_0x3a5901['name']}),_0x3057f9?.['setActivityError'](_0x3a5901['message']);throw _0x3a5901;}finally{_0x3057f9?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x2a02b9,'aid':_0x407eeb});}}async['processPending'](_0x2a6270){this['bindActivityData'](_0x2a6270),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0xa3e4c1=this['store']['transact']();return await this['setState'](_0xa3e4c1),await collator_1['CollatorService']['notarizeContinuation'](this,_0xa3e4c1),await this['setStatus'](this['adjacencyList']['length'],_0xa3e4c1),await _0xa3e4c1['exec']();}async['processSuccess'](_0x253cbd){this['bindActivityData'](_0x253cbd),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x459ca8=this['store']['transact']();return await this['setState'](_0x459ca8),await collator_1['CollatorService']['notarizeCompletion'](this,_0x459ca8),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x459ca8),await _0x459ca8['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x20ea1b=this['store']['transact']();return await this['setState'](_0x20ea1b),await collator_1['CollatorService']['notarizeCompletion'](this,_0x20ea1b),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x20ea1b),await _0x20ea1b['exec']();}async['transitionAdjacent'](_0x54e023,_0x412b16){_0x412b16['mapActivityAttributes']();const _0x2a02e5=this['resolveStatus'](_0x54e023),_0x73ee30={'app.job.jss':_0x2a02e5},_0x208d5d=await this['transition'](this['adjacencyList'],_0x2a02e5);_0x208d5d?.['length']&&(_0x73ee30['app.activity.mids']=_0x208d5d['join'](',')),_0x412b16['setActivityAttributes'](_0x73ee30);}['resolveStatus'](_0x15cfc0){const _0x116d1f=_0x15cfc0[_0x15cfc0['length']-0x1];return Array['isArray'](_0x116d1f)?Number(_0x116d1f[0x1]):Number(_0x116d1f);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x247c49=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x32df9b=_0x247c49['mapRules']();if(_0x32df9b)for(const _0x1c478c in _0x32df9b){const _0x13f701=_0x1c478c['indexOf']('[');if(_0x13f701>-0x1){const _0x144b4b=_0x1c478c['substring'](_0x13f701+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x144b4b))){const _0x12cbc1=_0x1c478c['substring'](0x0,_0x13f701);_0x32df9b[_0x12cbc1]=_0x32df9b[_0x1c478c],delete _0x32df9b[_0x1c478c];}else{if(_0x144b4b==='-'||_0x144b4b==='_'){const _0x500e7f=_0x32df9b[_0x1c478c];Object['keys'](_0x500e7f)['forEach'](_0x4a526e=>{_0x32df9b[_0x4a526e]=_0x500e7f[_0x4a526e];});}}}}this['context']['data']=_0x32df9b;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x27e256=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x27e256['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x557300=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x4e2321=_0x557300['mapRules'](),_0x3c34ee=this['metadata']['aid'],_0xc440d0={...this['context'][_0x3c34ee]['output'],..._0x4e2321};this['context'][_0x3c34ee]['output']['data']=_0xc440d0;}}async['registerTimeout'](){}['bindActivityError'](_0xccf76d){const _0x12bf37=this['context'][this['metadata']['aid']]['output']['metadata'];_0x12bf37['err']=JSON['stringify'](this['data']),_0x12bf37['$error']={..._0xccf76d,'is_stream_error':!![]};}['bindJobError'](_0x39566b){this['context']['metadata']['err']=JSON['stringify']({..._0x39566b,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x4a94b0,_0x245bf9){const {id:_0x37cab8}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x4a94b0,this['context']['metadata']['jid'],_0x37cab8,_0x245bf9);}['authorizeEntry'](_0x376c43){return this['adjacencyList']?.['map'](_0x246a94=>{const {metadata:{aid:_0x43a665}}=_0x246a94;return _0x376c43[_0x43a665+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x43a665;})??[];}['bindDimensionalAddress'](_0x44b3fe){const _0x1be944=this['resolveDad']();_0x44b3fe[this['metadata']['aid']+'/output/metadata/dad']=_0x1be944;}async['setState'](_0x1e38e4){const _0x4765b3=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x200454={};await this['bindJobState'](_0x200454);const _0x415abc=this['authorizeEntry'](_0x200454);this['bindDimensionalAddress'](_0x200454),this['bindActivityState'](_0x200454);const _0x301be0=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x415abc],_0x24bd65=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x200454,this['getJobStatus'](),_0x4765b3,_0x301be0,_0x24bd65,_0x1e38e4);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x24b394=this['context']['$self'];!_0x24b394['output']['metadata']&&(_0x24b394['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x24b394['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x545af5=(0x0,utils_1['formatISODate'])(new Date());_0x24b394['output']['metadata']['ac']=_0x545af5,_0x24b394['output']['metadata']['au']=_0x545af5,_0x24b394['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x24b394['output']['metadata']['stp']=this['config']['subtype']),_0x24b394['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x1ca533){const _0x2c4057=await this['getTriggerConfig'](),_0x73605a=[..._0x2c4057['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x511349 of _0x73605a){const _0x36996a=(0x0,utils_1['getValueByPath'])(this['context'],_0x511349);_0x36996a!==undefined&&(_0x1ca533[_0x511349]=_0x36996a);}for(const _0x3d0e83 in this['context']?.['data']??{}){(_0x3d0e83['startsWith']('-')||_0x3d0e83['startsWith']('_'))&&(_0x1ca533[_0x3d0e83]=this['context']['data'][_0x3d0e83]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x1ca533,this['config'],this['context']);}['bindActivityState'](_0x499c09){const _0x590fd6=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x52bd4e of _0x590fd6){const _0x1aff3c=this['metadata']['aid']+'/'+_0x52bd4e,_0x469cc9=(0x0,utils_1['getValueByPath'])(this['context'],_0x1aff3c);_0x469cc9!==undefined&&(_0x499c09[_0x1aff3c]=_0x469cc9);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x499c09,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x102f2f=>'metadata/'+_0x102f2f);}['bindActivityMetadataPaths'](){const _0x249022=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x249022]['KEYS']['map'](_0xb0f9bf=>'output/metadata/'+_0xb0f9bf);}async['getState'](){const _0x52834a=this['context']['metadata']['gid'],_0x30482e='$'+this['config']['subscribes'],_0x2b0084={[_0x30482e]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x2b736f=>'metadata/'+_0x2b736f)};for(let [_0x2e9702,_0x1e8b2b]of Object['entries'](this['config']['consumes'])){if(_0x2e9702==='$job')for(const _0x2f5bc1 of _0x1e8b2b){_0x2b0084[_0x30482e]['push'](_0x2f5bc1);}else{_0x2e9702==='$self'&&(_0x2e9702=this['metadata']['aid']);!_0x2b0084[_0x2e9702]&&(_0x2b0084[_0x2e9702]=[]);for(const _0x26c1d0 of _0x1e8b2b){_0x2b0084[_0x2e9702]['push'](_0x2e9702+'/'+_0x26c1d0);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x2b0084,this['config'],this['metadata'],this['leg']);const {dad:_0x57b330,jid:_0x5be784}=this['context']['metadata'],_0x3de790=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x57b330||''),[_0x460152,_0x14fa86]=await this['store']['getState'](_0x5be784,_0x2b0084,_0x3de790);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x460152),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x52834a),this['initDimensionalAddress'](_0x57b330),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x1f6e80,_0x4171b0){if(_0x4171b0!==_0x1f6e80)throw new errors_1['GenerationalError'](_0x1f6e80,_0x4171b0,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x41bbea){this['metadata']['dad']=_0x41bbea;}['initSelf'](_0x53f038){const _0x34555b=this['metadata']['aid'];!_0x53f038[_0x34555b]&&(_0x53f038[_0x34555b]={});const _0x5e7298=_0x53f038[_0x34555b];return!_0x5e7298['output']&&(_0x5e7298['output']={}),!_0x5e7298['input']&&(_0x5e7298['input']={}),!_0x5e7298['hook']&&(_0x5e7298['hook']={}),!_0x5e7298['output']['metadata']&&(_0x5e7298['output']['metadata']={}),_0x5e7298['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x53f038['$self']=_0x5e7298,_0x53f038['$job']=_0x53f038,_0x53f038;}['initPolicies'](_0x5f387){const _0x219603=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x5f387);_0x5f387['metadata']['expire']=_0x219603;if(this['config']['persistent']!=undefined){const _0x9629fb=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x5f387);_0x5f387['metadata']['persistent']=_0x9629fb;}}['bindActivityData'](_0x4499ff){this['context'][this['metadata']['aid']][_0x4499ff]['data']=this['data'];}['resolveDad'](){let _0x40e148=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x40e148=_0x40e148['substring'](0x0,_0x40e148['lastIndexOf'](','))+','+this['adjacentIndex']),_0x40e148;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x375176=[],_0x5262b0=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x4fdbf3=_0x5262b0['.'+this['metadata']['aid']],_0xdc158f=this['resolveAdjacentDad']();if(_0x4fdbf3)for(const _0x3fe1d4 in _0x4fdbf3){const _0x177cc7=_0x4fdbf3[_0x3fe1d4];mapper_1['MapperService']['evaluate'](_0x177cc7,this['context'],this['code'])&&_0x375176['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0xdc158f,'aid':_0x3fe1d4,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x375176;}['isJobComplete'](_0x29c380){return _0x29c380<=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'](_0x4ba0ef,_0x5d804a){if(this['jobWasInterrupted'](_0x5d804a))return;let _0x19f1ee=[];(this['shouldEmit']()||this['isJobComplete'](_0x5d804a)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x5d804a)&&!this['shouldPersistJob']()});if(_0x4ba0ef['length']&&!this['isJobComplete'](_0x5d804a)){const _0x46edf1=this['store']['transact']();for(const _0x38b12f of _0x4ba0ef){await this['engine']['router']?.['publishMessage'](null,_0x38b12f,_0x46edf1);}_0x19f1ee=await _0x46edf1['exec']();}return _0x19f1ee;}['jobWasInterrupted'](_0x17a152){return _0x17a152<-0x5f5e100;}}exports['Activity']=Activity;function _0x1fe2(){const _0x29c550=['5418904hYCziN','408110NpcxnZ','175004OEEodb','9bInBsi','1863468BegikN','1256255yLZNSD','1390158MFuVaW','622704DRUFCw'];_0x1fe2=function(){return _0x29c550;};return _0x1fe2();}
|
|
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 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x2b9c5d,_0x4eed98){const _0x4c3778=_0x2e41,_0xf4c2e1=_0x2b9c5d();while(!![]){try{const _0x4189d2=parseInt(_0x4c3778(0xa3))/0x1+-parseInt(_0x4c3778(0xa0))/0x2+-parseInt(_0x4c3778(0xa8))/0x3*(parseInt(_0x4c3778(0xa2))/0x4)+parseInt(_0x4c3778(0xa5))/0x5+parseInt(_0x4c3778(0xa1))/0x6*(-parseInt(_0x4c3778(0xa6))/0x7)+parseInt(_0x4c3778(0xa4))/0x8+parseInt(_0x4c3778(0xa7))/0x9;if(_0x4189d2===_0x4eed98)break;else _0xf4c2e1['push'](_0xf4c2e1['shift']());}catch(_0x26c549){_0xf4c2e1['push'](_0xf4c2e1['shift']());}}}(_0x37ac,0x53a96));function _0x2e41(_0x3e6bc2,_0x5d194c){const _0x37ac77=_0x37ac();return _0x2e41=function(_0x2e41e5,_0x48a2d6){_0x2e41e5=_0x2e41e5-0xa0;let _0x487505=_0x37ac77[_0x2e41e5];return _0x487505;},_0x2e41(_0x3e6bc2,_0x5d194c);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Await']=void 0x0;function _0x37ac(){const _0x1673d7=['874058uyNUgp','52854VfgEqC','960SIJElV','256042MuPnWo','1602200mrVaqY','1993540uBqIOv','455CVycnh','5244363jrQUIE','1068tgPGIT'];_0x37ac=function(){return _0x1673d7;};return _0x37ac();}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(_0x2b9db0,_0x429180,_0x4962e2,_0x3f6049,_0x425305,_0x55230e){super(_0x2b9db0,_0x429180,_0x4962e2,_0x3f6049,_0x425305,_0x55230e);}async['process'](){this['logger']['debug']('await-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x28f8f5;try{await this['verifyEntry'](),_0x28f8f5=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x28f8f5['startActivitySpan'](this['leg']),this['mapInputData']();const _0x5be5ef=this['store']['transact'](),_0x239f7c=await this['execActivity'](_0x5be5ef);await collator_1['CollatorService']['authorizeReentry'](this,_0x5be5ef),await this['setState'](_0x5be5ef),await this['setStatus'](0x0,_0x5be5ef);const _0x1f2dff=await _0x5be5ef['exec']();_0x28f8f5['mapActivityAttributes']();const _0x5a0d08=this['resolveStatus'](_0x1f2dff);return _0x28f8f5['setActivityAttributes']({'app.activity.mid':_0x239f7c,'app.job.jss':_0x5a0d08}),this['context']['metadata']['aid'];}catch(_0x32f63e){if(_0x32f63e instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x32f63e});return;}else{if(_0x32f63e instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x32f63e});return;}else{if(_0x32f63e instanceof errors_1['GetStateError']){this['logger']['error']('await-get-state-error',{..._0x32f63e});return;}else{if(_0x32f63e instanceof errors_1['CollationError']){if(_0x32f63e['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',{..._0x32f63e});}else this['logger']['error']('await-process-error',{..._0x32f63e});}}}_0x28f8f5?.['setActivityError'](_0x32f63e['message']);throw _0x32f63e;}finally{_0x28f8f5?.['endActivitySpan'](),this['logger']['debug']('await-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x2d0ffb){const _0x400a3c=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x320af2={'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':_0x400a3c,'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 _0x1e6d5f=pipe_1['Pipe']['resolve'](this['config']['await'],this['context']);_0x1e6d5f===![]&&(_0x320af2['metadata']['await']=![]);}return this['config']['retry']&&(_0x320af2['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](null,_0x320af2,_0x2d0ffb);}}exports['Await']=Await;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x836e(){const _0x25e2d0=['1496376BbKiix','169718dmumFX','16860xnFkzt','5wDyBDm','777344pGZPjD','5399370hJmWLL','6VTvhlm','93060rsFgvP','424333uUxFKo'];_0x836e=function(){return _0x25e2d0;};return _0x836e();}(function(_0x57ef1c,_0x33a3b5){const _0x4f4eac=_0x4e0b,_0x2707d6=_0x57ef1c();while(!![]){try{const _0x5a97cb=-parseInt(_0x4f4eac(0x6e))/0x1+-parseInt(_0x4f4eac(0x6f))/0x2*(-parseInt(_0x4f4eac(0x6a))/0x3)+-parseInt(_0x4f4eac(0x68))/0x4*(parseInt(_0x4f4eac(0x70))/0x5)+-parseInt(_0x4f4eac(0x6b))/0x6+parseInt(_0x4f4eac(0x6c))/0x7+-parseInt(_0x4f4eac(0x6d))/0x8+parseInt(_0x4f4eac(0x69))/0x9;if(_0x5a97cb===_0x33a3b5)break;else _0x2707d6['push'](_0x2707d6['shift']());}catch(_0x16e771){_0x2707d6['push'](_0x2707d6['shift']());}}}(_0x836e,0x1b0ce));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Cycle']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Cycle extends activity_1['Activity']{constructor(_0x20cd53,_0x176e56,_0x3f0332,_0x3446f9,_0x4a7659,_0x21a0a4){super(_0x20cd53,_0x176e56,_0x3f0332,_0x3446f9,_0x4a7659,_0x21a0a4);}async['process'](){this['logger']['debug']('cycle-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x4604aa;try{await this['verifyEntry'](),_0x4604aa=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x4604aa['startActivitySpan'](this['leg']),this['mapInputData']();let _0x37cdbe=this['store']['transact']();await this['setState'](_0x37cdbe),await this['setStatus'](0x0,_0x37cdbe);const _0x232ae8=await _0x37cdbe['exec']();_0x4604aa['mapActivityAttributes']();const _0x5c9f51=this['resolveStatus'](_0x232ae8);_0x37cdbe=this['store']['transact']();const _0x24f044=await this['cycleAncestorActivity'](_0x37cdbe);return _0x4604aa['setActivityAttributes']({'app.activity.mid':_0x24f044,'app.job.jss':_0x5c9f51}),await collator_1['CollatorService']['notarizeEarlyExit'](this,_0x37cdbe),await _0x37cdbe['exec'](),this['context']['metadata']['aid'];}catch(_0x120c06){if(_0x120c06 instanceof errors_1['InactiveJobError']){this['logger']['error']('cycle-inactive-job-error',{..._0x120c06});return;}else{if(_0x120c06 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x120c06});return;}else{if(_0x120c06 instanceof errors_1['GetStateError']){this['logger']['error']('cycle-get-state-error',{..._0x120c06});return;}else{if(_0x120c06 instanceof errors_1['CollationError']){if(_0x120c06['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',{..._0x120c06});}else this['logger']['error']('cycle-process-error',{..._0x120c06});}}}_0x4604aa?.['setActivityError'](_0x120c06['message']);throw _0x120c06;}finally{_0x4604aa?.['endActivitySpan'](),this['logger']['debug']('cycle-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['cycleAncestorActivity'](_0x4f6ce8){this['mapInputData']();const _0x15474f={'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,_0x15474f,_0x4f6ce8);}}function _0x4e0b(_0x2637d9,_0x58ff22){const _0x836ec9=_0x836e();return _0x4e0b=function(_0x4e0b13,_0x4bc196){_0x4e0b13=_0x4e0b13-0x68;let _0x6b939c=_0x836ec9[_0x4e0b13];return _0x6b939c;},_0x4e0b(_0x2637d9,_0x58ff22);}exports['Cycle']=Cycle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function _0x3c1f(){const _0x15a32b=['21348CAfLDL','338781CycQOP','6201265CVFXGY','11UAqLSJ','1HbkpLt','728VttLww','4176TzGTCz','53556qQSUTZ','13646630uNexCq','8UXqqTR','1732302xaKIOB','25634652YBhzUa'];_0x3c1f=function(){return _0x15a32b;};return _0x3c1f();}(function(_0x10fa83,_0xf65641){const _0x2ed81b=_0x47a9,_0x592e13=_0x10fa83();while(!![]){try{const _0x11a7f4=parseInt(_0x2ed81b(0x6c))/0x1*(parseInt(_0x2ed81b(0x66))/0x2)+-parseInt(_0x2ed81b(0x69))/0x3*(parseInt(_0x2ed81b(0x71))/0x4)+-parseInt(_0x2ed81b(0x6a))/0x5+parseInt(_0x2ed81b(0x6f))/0x6*(-parseInt(_0x2ed81b(0x6d))/0x7)+-parseInt(_0x2ed81b(0x6e))/0x8*(parseInt(_0x2ed81b(0x68))/0x9)+-parseInt(_0x2ed81b(0x70))/0xa*(-parseInt(_0x2ed81b(0x6b))/0xb)+parseInt(_0x2ed81b(0x67))/0xc;if(_0x11a7f4===_0xf65641)break;else _0x592e13['push'](_0x592e13['shift']());}catch(_0x249ee1){_0x592e13['push'](_0x592e13['shift']());}}}(_0x3c1f,0xb34e8));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Hook']=void 0x0;const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),collator_1=require('../collator'),pipe_1=require('../pipe'),task_1=require('../task'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream'),activity_1=require('./activity');class Hook extends activity_1['Activity']{constructor(_0x80dd05,_0x25a5cf,_0x2983d1,_0x201c25,_0x352400,_0x281bb4){super(_0x80dd05,_0x25a5cf,_0x2983d1,_0x201c25,_0x352400,_0x281bb4);}async['process'](){this['logger']['debug']('hook-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x469046;try{return await this['verifyEntry'](),_0x469046=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x469046['startActivitySpan'](this['leg']),this['doesHook']()?await this['doHook'](_0x469046):await this['doPassThrough'](_0x469046),this['context']['metadata']['aid'];}catch(_0x17f821){if(_0x17f821 instanceof errors_1['InactiveJobError']){this['logger']['error']('hook-inactive-job-error',{..._0x17f821});return;}else{if(_0x17f821 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x17f821});return;}else{if(_0x17f821 instanceof errors_1['GetStateError']){this['logger']['error']('hook-get-state-error',{..._0x17f821});return;}else{if(_0x17f821 instanceof errors_1['CollationError']){if(_0x17f821['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',{..._0x17f821});}else this['logger']['error']('hook-process-error',{..._0x17f821});}}}_0x469046?.['setActivityError'](_0x17f821['message']);throw _0x17f821;}finally{_0x469046?.['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 _0x2083bd=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return!isNaN(_0x2083bd)&&Number(_0x2083bd)>0x0;}return!!this['config']['hook']?.['topic'];}async['doHook'](_0x348874){const _0x31865e=this['store']['transact']();await this['registerHook'](enums_1['HMSH_IS_CLUSTER']?undefined:_0x31865e),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x31865e),await collator_1['CollatorService']['authorizeReentry'](this,_0x31865e),await this['setStatus'](0x0,_0x31865e),await _0x31865e['exec'](),_0x348874['mapActivityAttributes']();}async['doPassThrough'](_0x26dcdb){const _0x1ebf77=this['store']['transact']();let _0x3787c9;this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x1ebf77),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x1ebf77),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x1ebf77),_0x3787c9=await _0x1ebf77['exec'](),_0x26dcdb['mapActivityAttributes']();const _0x3eaf6e=this['resolveStatus'](_0x3787c9),_0x3773a8={'app.job.jss':_0x3eaf6e},_0x5ccbd9=await this['transition'](this['adjacencyList'],_0x3eaf6e);_0x5ccbd9['length']&&(_0x3773a8['app.activity.mids']=_0x5ccbd9['join'](',')),_0x26dcdb['setActivityAttributes'](_0x3773a8);}async['getHookRule'](_0x579d32){const _0xd62c35=await this['store']['getHookRules']();return _0xd62c35?.[_0x579d32]?.[0x0];}async['registerHook'](_0x5e037b){if(this['config']['hook']?.['topic'])return await this['engine']['taskService']['registerWebHook'](this['config']['hook']['topic'],this['context'],this['resolveDad'](),this['context']['metadata']['expire'],_0x5e037b);else{if(this['config']['sleep']){const _0x179f22=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',_0x179f22,this['metadata']['dad']||''),this['context']['metadata']['jid'];}}}async['processWebHookEvent'](_0x3d28ad=stream_1['StreamStatus']['SUCCESS'],_0x385d44=0xc8){this['logger']['debug']('hook-process-web-hook-event',{'topic':this['config']['hook']['topic'],'aid':this['metadata']['aid'],'status':_0x3d28ad,'code':_0x385d44});const _0x3906f0=new task_1['TaskService'](this['store'],this['logger']),_0x4a842f={...this['data']},_0x7243f3=await _0x3906f0['processWebHookSignal'](this['config']['hook']['topic'],_0x4a842f);if(_0x7243f3){const [_0x42fb7d,_0x1b5a83,_0x531716,_0x3621f6]=_0x7243f3;this['context']['metadata']['jid']=_0x42fb7d,this['context']['metadata']['gid']=_0x3621f6,this['context']['metadata']['dad']=_0x531716,await this['processEvent'](_0x3d28ad,_0x385d44,'hook'),_0x385d44===0xc8&&await _0x3906f0['deleteWebHookSignal'](this['config']['hook']['topic'],_0x4a842f);}}async['processTimeHookEvent'](_0x46b015){this['logger']['debug']('hook-process-time-hook-event',{'jid':_0x46b015,'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']}),await this['processEvent'](stream_1['StreamStatus']['SUCCESS'],0xc8,'hook');}}function _0x47a9(_0x7252c,_0x2721a9){const _0x3c1f9a=_0x3c1f();return _0x47a9=function(_0x47a9a7,_0x57e8c8){_0x47a9a7=_0x47a9a7-0x66;let _0x34d865=_0x3c1f9a[_0x47a9a7];return _0x34d865;},_0x47a9(_0x7252c,_0x2721a9);}exports['Hook']=Hook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x39ec16,_0x28894f){const _0x414f3d=_0x3ed4,_0x7163ec=_0x39ec16();while(!![]){try{const _0x20d281=-parseInt(_0x414f3d(0x111))/0x1+parseInt(_0x414f3d(0x115))/0x2+-parseInt(_0x414f3d(0x116))/0x3*(-parseInt(_0x414f3d(0x119))/0x4)+parseInt(_0x414f3d(0x117))/0x5+parseInt(_0x414f3d(0x118))/0x6+parseInt(_0x414f3d(0x113))/0x7*(-parseInt(_0x414f3d(0x112))/0x8)+parseInt(_0x414f3d(0x11a))/0x9*(-parseInt(_0x414f3d(0x114))/0xa);if(_0x20d281===_0x28894f)break;else _0x7163ec['push'](_0x7163ec['shift']());}catch(_0x416294){_0x7163ec['push'](_0x7163ec['shift']());}}}(_0x1ab5,0x7750f));function _0x1ab5(){const _0x26f804=['506188PqKkCv','5589rUIkzC','484028SUushS','168edyfwf','254282DSCkCM','9910lJlnPG','1372162bABcLt','6LFGLEC','2198890aXVNMK','5832306uTeHbn'];_0x1ab5=function(){return _0x26f804;};return _0x1ab5();}function _0x3ed4(_0x2a23f7,_0x254395){const _0x1ab5bc=_0x1ab5();return _0x3ed4=function(_0x3ed4b2,_0x12fdf4){_0x3ed4b2=_0x3ed4b2-0x111;let _0x58fc77=_0x1ab5bc[_0x3ed4b2];return _0x58fc77;},_0x3ed4(_0x2a23f7,_0x254395);}Object['defineProperty'](exports,'__esModule',{'value':!![]});const activity_1=require('./activity'),await_1=require('./await'),cycle_1=require('./cycle'),hook_1=require('./hook'),interrupt_1=require('./interrupt'),signal_1=require('./signal'),trigger_1=require('./trigger'),worker_1=require('./worker');exports['default']={'activity':activity_1['Activity'],'await':await_1['Await'],'cycle':cycle_1['Cycle'],'hook':hook_1['Hook'],'interrupt':interrupt_1['Interrupt'],'signal':signal_1['Signal'],'trigger':trigger_1['Trigger'],'worker':worker_1['Worker']};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x388b6f,_0x2d3bb5){const _0x218fba=_0x531c,_0x5ee578=_0x388b6f();while(!![]){try{const _0x14d807=-parseInt(_0x218fba(0x13a))/0x1*(-parseInt(_0x218fba(0x143))/0x2)+-parseInt(_0x218fba(0x142))/0x3+parseInt(_0x218fba(0x13e))/0x4+parseInt(_0x218fba(0x139))/0x5*(parseInt(_0x218fba(0x141))/0x6)+-parseInt(_0x218fba(0x140))/0x7*(-parseInt(_0x218fba(0x13d))/0x8)+parseInt(_0x218fba(0x13b))/0x9*(-parseInt(_0x218fba(0x13f))/0xa)+-parseInt(_0x218fba(0x13c))/0xb;if(_0x14d807===_0x2d3bb5)break;else _0x5ee578['push'](_0x5ee578['shift']());}catch(_0x40be2f){_0x5ee578['push'](_0x5ee578['shift']());}}}(_0x5f2b,0x2e16e));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Interrupt']=void 0x0;function _0x5f2b(){const _0x2baeac=['60803HlijCv','27HRNqiP','1750848bKaxEQ','1818568lCueMk','875944cMRLhZ','1092110CdNjtc','7SYNKId','30NZzneU','355446TjDhSm','2tYmSka','286955MBAiAn'];_0x5f2b=function(){return _0x2baeac;};return _0x5f2b();}const errors_1=require('../../modules/errors'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Interrupt extends activity_1['Activity']{constructor(_0x1b494f,_0x39602d,_0x3b0d96,_0x48ce6f,_0x54c560,_0x58614f){super(_0x1b494f,_0x39602d,_0x3b0d96,_0x48ce6f,_0x54c560,_0x58614f);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x1e931d;try{await this['verifyEntry'](),_0x1e931d=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x1e931d['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0x1e931d):await this['interruptAnother'](_0x1e931d);}catch(_0x1e945b){if(_0x1e945b instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0x1e945b});return;}else{if(_0x1e945b instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x1e945b});return;}else{if(_0x1e945b instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0x1e945b});return;}else{if(_0x1e945b instanceof errors_1['CollationError']){if(_0x1e945b['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',{..._0x1e945b});}else this['logger']['error']('interrupt-process-error',{..._0x1e945b});}}}_0x1e931d?.['setActivityError'](_0x1e945b['message']);throw _0x1e945b;}finally{_0x1e931d?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x22fff9){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x365763=await this['interrupt']();_0x22fff9['mapActivityAttributes']();const _0x8164f4=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x8164f4),await this['setStatus'](-0x1,_0x8164f4);const _0x4fde6a=await _0x8164f4['exec'](),_0x101bed=this['resolveStatus'](_0x4fde6a);return _0x22fff9['setActivityAttributes']({'app.activity.mid':_0x365763,'app.job.jss':_0x101bed}),this['context']['metadata']['aid'];}async['interruptAnother'](_0x82182c){const _0x30581e=await this['interrupt'](),_0x5b16eb={'app.activity.mid':_0x30581e};_0x82182c['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x548911=this['store']['transact']();await this['setState'](_0x548911);}const _0x3e0f8c=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x3e0f8c),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x3e0f8c);const _0x4ebaf9=await _0x3e0f8c['exec'](),_0x32104d=this['resolveStatus'](_0x4ebaf9);_0x5b16eb['app.job.jss']=_0x32104d;const _0x499e10=await this['transition'](this['adjacencyList'],_0x32104d);return _0x499e10['length']&&(_0x5b16eb['app.activity.mids']=_0x499e10['join'](',')),_0x82182c['setActivityAttributes'](_0x5b16eb),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0x1fcd73=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0x1fcd73==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 _0x4c13aa=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'],_0x4c13aa);}}function _0x531c(_0x3be3cb,_0x2f0f35){const _0x5f2be9=_0x5f2b();return _0x531c=function(_0x531cbe,_0x550f01){_0x531cbe=_0x531cbe-0x139;let _0x567b9f=_0x5f2be9[_0x531cbe];return _0x567b9f;},_0x531c(_0x3be3cb,_0x2f0f35);}exports['Interrupt']=Interrupt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x38a4b8,_0x472a4c){const _0x8afea3=_0x54f5,_0x79acc6=_0x38a4b8();while(!![]){try{const _0x4ce81d=-parseInt(_0x8afea3(0x159))/0x1*(parseInt(_0x8afea3(0x15f))/0x2)+-parseInt(_0x8afea3(0x161))/0x3+-parseInt(_0x8afea3(0x15d))/0x4+parseInt(_0x8afea3(0x15e))/0x5+-parseInt(_0x8afea3(0x15b))/0x6*(parseInt(_0x8afea3(0x15a))/0x7)+-parseInt(_0x8afea3(0x15c))/0x8*(-parseInt(_0x8afea3(0x158))/0x9)+parseInt(_0x8afea3(0x160))/0xa;if(_0x4ce81d===_0x472a4c)break;else _0x79acc6['push'](_0x79acc6['shift']());}catch(_0x4e6e36){_0x79acc6['push'](_0x79acc6['shift']());}}}(_0x403b,0xe72bb));function _0x54f5(_0x23389f,_0xc0bd7f){const _0x403b5c=_0x403b();return _0x54f5=function(_0x54f501,_0x528278){_0x54f501=_0x54f501-0x158;let _0x3c0d45=_0x403b5c[_0x54f501];return _0x3c0d45;},_0x54f5(_0x23389f,_0xc0bd7f);}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(_0x80b766,_0x3fc434,_0x249e94,_0x3d0724,_0x260225,_0x3a69ac){super(_0x80b766,_0x3fc434,_0x249e94,_0x3d0724,_0x260225,_0x3a69ac);}async['process'](){this['logger']['debug']('signal-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x330484;try{await this['verifyEntry'](),_0x330484=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x330484['startActivitySpan'](this['leg']);const _0x588ed3=this['store']['transact']();this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x588ed3),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x588ed3),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x588ed3);const _0x39d853=await _0x588ed3['exec']();this['config']['subtype']==='all'?await this['hookAll']():await this['hookOne']();const _0x476585=this['resolveStatus'](_0x39d853),_0x21b7ab={'app.job.jss':_0x476585},_0x1c8194=await this['transition'](this['adjacencyList'],_0x476585);return _0x1c8194['length']&&(_0x21b7ab['app.activity.mids']=_0x1c8194['join'](',')),_0x330484['mapActivityAttributes'](),_0x330484['setActivityAttributes'](_0x21b7ab),this['context']['metadata']['aid'];}catch(_0x59d0e3){if(_0x59d0e3 instanceof errors_1['InactiveJobError']){this['logger']['error']('signal-inactive-job-error',{..._0x59d0e3});return;}else{if(_0x59d0e3 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x59d0e3});return;}else{if(_0x59d0e3 instanceof errors_1['GetStateError']){this['logger']['error']('signal-get-state-error',{..._0x59d0e3});return;}else{if(_0x59d0e3 instanceof errors_1['CollationError']){if(_0x59d0e3['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',{..._0x59d0e3});}else this['logger']['error']('signal-process-error',{..._0x59d0e3});}}}_0x330484?.['setActivityError'](_0x59d0e3['message']);throw _0x59d0e3;}finally{_0x330484?.['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 _0x283843=new mapper_1['MapperService'](this['config']['signal']['maps'],this['context']);return _0x283843['mapRules']();}}['mapResolverData'](){if(this['config']['resolver']?.['maps']){const _0x22c1dd=new mapper_1['MapperService'](this['config']['resolver']['maps'],this['context']);return _0x22c1dd['mapRules']();}}async['hookOne'](){const _0x216fdc=pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']),_0x24d85e=this['mapSignalData'](),_0x2608f9=pipe_1['Pipe']['resolve'](this['config']['status'],this['context']),_0x1631e4=pipe_1['Pipe']['resolve'](this['config']['code'],this['context']);return await this['engine']['hook'](_0x216fdc,_0x24d85e,_0x2608f9,_0x1631e4);}async['hookAll'](){const _0x184486=this['mapSignalData'](),_0x2b911a=this['mapResolverData']();this['config']['scrub']&&(_0x2b911a['scrub']=!![]);const _0x10d806=pipe_1['Pipe']['resolve'](this['config']['key_name'],this['context']),_0x75ae50=pipe_1['Pipe']['resolve'](this['config']['key_value'],this['context']),_0xa5b785=[_0x10d806+':'+_0x75ae50];return await this['engine']['hookAll'](this['config']['topic'],_0x184486,_0x2b911a,_0xa5b785);}}function _0x403b(){const _0x1c8811=['1814ZljhMC','329afggfy','222126CRXKMi','32tRxahI','3514620WNLVnH','2502450PkojTx','1658PZGQtG','47199750mCKntI','3227910gkzQhW','2080863xZyOvD'];_0x403b=function(){return _0x1c8811;};return _0x403b();}exports['Signal']=Signal;
|