@hotmeshio/hotmesh 0.3.22 → 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/meshflow/exporter.js +1 -1
- package/build/services/pipe/functions/array.js +1 -1
- package/build/services/pipe/functions/bitwise.js +1 -1
- package/build/services/pipe/functions/conditional.js +1 -1
- package/build/services/pipe/functions/cron.js +1 -1
- package/build/services/pipe/functions/date.js +1 -1
- package/build/services/pipe/functions/index.js +1 -1
- package/build/services/pipe/functions/json.js +1 -1
- package/build/services/pipe/functions/logical.js +1 -1
- package/build/services/pipe/functions/math.js +1 -1
- package/build/services/pipe/functions/number.js +1 -1
- package/build/services/pipe/functions/object.js +1 -1
- package/build/services/pipe/functions/string.js +1 -1
- package/build/services/pipe/functions/symbol.js +1 -1
- package/build/services/pipe/functions/unary.js +1 -1
- package/build/services/pipe/index.js +1 -1
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.js +1 -1
- package/build/services/search/providers/postgres/postgres.js +1 -1
- package/build/services/search/providers/redis/ioredis.js +1 -1
- package/build/services/search/providers/redis/redis.js +1 -1
- package/build/services/serializer/index.js +1 -1
- package/build/services/store/providers/postgres/kvsql.js +1 -1
- package/build/services/store/providers/postgres/kvtables.js +1 -1
- package/build/services/store/providers/postgres/kvtransaction.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
- package/build/services/store/providers/postgres/postgres.js +1 -1
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/providers/nats/nats.js +1 -1
- package/build/services/stream/providers/postgres/postgres.js +1 -1
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/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(_0x1439a2,_0x33944d){const _0x28d9a8=_0x4df4,_0x506dbd=_0x1439a2();while(!![]){try{const _0x507893=-parseInt(_0x28d9a8(0xed))/0x1*(-parseInt(_0x28d9a8(0xee))/0x2)+-parseInt(_0x28d9a8(0xef))/0x3*(parseInt(_0x28d9a8(0xf6))/0x4)+-parseInt(_0x28d9a8(0xf5))/0x5*(parseInt(_0x28d9a8(0xec))/0x6)+parseInt(_0x28d9a8(0xf1))/0x7+-parseInt(_0x28d9a8(0xea))/0x8*(parseInt(_0x28d9a8(0xf0))/0x9)+-parseInt(_0x28d9a8(0xeb))/0xa*(-parseInt(_0x28d9a8(0xf3))/0xb)+parseInt(_0x28d9a8(0xf2))/0xc*(parseInt(_0x28d9a8(0xf4))/0xd);if(_0x507893===_0x33944d)break;else _0x506dbd['push'](_0x506dbd['shift']());}catch(_0x22a5a3){_0x506dbd['push'](_0x506dbd['shift']());}}}(_0x3e73,0xab7ce));function _0x4df4(_0x52d05d,_0x3b2a82){const _0x3e73b3=_0x3e73();return _0x4df4=function(_0x4df4e0,_0x5670fc){_0x4df4e0=_0x4df4e0-0xea;let _0x1b9e27=_0x3e73b3[_0x4df4e0];return _0x1b9e27;},_0x4df4(_0x52d05d,_0x3b2a82);}var __importDefault=this&&this['__importDefault']||function(_0xe2f9){return _0xe2f9&&_0xe2f9['__esModule']?_0xe2f9:{'default':_0xe2f9};};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=_0x32c824=>{const _0x1a3e18=JSON['stringify'](_0x32c824);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x1a3e18)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x5479d5=os_1['default']['totalmem'](),_0x176016=os_1['default']['freemem'](),_0x3b213c=_0x5479d5-_0x176016,_0x2a76cb={'TotalMemoryGB':(_0x5479d5/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x176016/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x3b213c/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x2a76cb;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x43845d){return JSON['parse'](JSON['stringify'](_0x43845d));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x278075){const _0x2df795=Math['sin'](_0x278075)*0x2710;return _0x2df795-Math['floor'](_0x2df795);}exports['deterministicRandom']=deterministicRandom;function guid(_0x4e247f=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x4e247f);}exports['guid']=guid;async function sleepFor(_0xaaedbf){return new Promise(_0x1b5efa=>setTimeout(_0x1b5efa,_0xaaedbf));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x49cc6c=>setImmediate(_0x49cc6c));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0x5e7537){let _0x686e87;const _0x48397f=new Promise(_0x50089e=>{_0x686e87=setTimeout(_0x50089e,_0x5e7537);});return{'promise':_0x48397f,'timerId':_0x686e87};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x447419){const _0x2d07bb=Object['getPrototypeOf'](_0x447419);if(_0x447419['Query']?.['prototype']||Object['keys'](_0x447419)['includes']('database')||_0x2d07bb['name']==='Pool')return'postgres';else{if(_0x447419['toString']()['toLowerCase']()['includes']('nats'))return'nats';else{if('defineCommand'in _0x2d07bb||Object['keys'](_0x2d07bb)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x2d07bb)['includes']('Multi'))return'redis';}}}if(_0x447419['constructor']){if(_0x447419['constructor']['name']==='Redis'||_0x447419['constructor']['name']==='EventEmitter'){if('hset'in _0x447419)return'ioredis';}else{if(_0x447419['constructor']['name']==='ProviderClient'||_0x447419['constructor']['name']==='Commander'){if('HSET'in _0x447419)return'redis';}}}let _0x656119=null;if(Object['keys'](_0x447419)['includes']('connection')||!isNaN(_0x447419['totalCount'])&&!isNaN(_0x447419['idleCount']))_0x656119='postgres';else{if(Object['keys'](_0x447419)['includes']('Pipeline'))_0x656119='ioredis';else{if(Object['keys'](_0x447419)['includes']('createClient'))_0x656119='redis';else _0x2d07bb['constructor']['toString']()['includes']('NatsConnectionImpl')&&(_0x656119='nats');}}return _0x656119;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x4337e7){return _0x4337e7==='activity'?'hook':_0x4337e7;},'providerConfig'(_0x13dfc9){return _0x13dfc9?.['connection']??_0x13dfc9?.['redis']??_0x13dfc9?.['connections'];},'meshDataConfig'(_0x1bb5b4){return{..._0x1bb5b4['connection']};}};function matchesStatusCode(_0xa1ff74,_0x561a33){if(typeof _0x561a33==='string'){const _0x282c8a='^'+_0x561a33['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x282c8a)['test'](_0xa1ff74['toString']());}return _0x561a33['test'](_0xa1ff74['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x1a60e2,_0x50666b){return _0x1a60e2===_0x50666b;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x3f242f,_0x2a6c74){for(const [_0x1c55ca,_0x19cc4e]of Object['entries'](_0x3f242f)){if(_0x19cc4e['hasOwnProperty'](_0x2a6c74)){const _0x590259=findTopKey(_0x3f242f,_0x1c55ca['replace'](/^\./,''));return(_0x590259||_0x1c55ca)['replace'](/^\./,'');}}return null;}function _0x3e73(){const _0x16f794=['165DHBNcc','614445FpXZQL','1765255xRYFfG','3908668BMwHuM','2920672iChPlY','918870cWvwBZ','6heMNPa','72bdJrBa','20406nmIzqA','3uAARNL','27AcmKTb','5781321Tpfsej','48IrrfLo'];_0x3e73=function(){return _0x16f794;};return _0x3e73();}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x2b8789,_0x28fb14){for(const [_0x5ea96a,_0x33d06d]of Object['entries'](_0x2b8789)){if(_0x33d06d===_0x28fb14)return _0x5ea96a;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x4bf181,_0x2aaf9e,_0x16d40b){const _0x49aa91=await _0x2aaf9e['getTransitions'](_0x16d40b),_0x5c0309=await _0x2aaf9e['getSubscriptions'](_0x16d40b),_0x506a33=findTopKey(_0x49aa91,_0x4bf181),_0x12aba4=findSubscriptionForTrigger(_0x5c0309,_0x506a33);return _0x12aba4;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x67cd0e){if(_0x67cd0e['toString']()==='infinity')return'0';const _0x1d276c=new Date(),_0x8fe524=_0x67cd0e['slice'](-0x1),_0x2c07ad=parseInt(_0x67cd0e['slice'](0x0,-0x1),0xa);if(_0x8fe524==='m'){const _0x1ff279=Math['floor'](_0x1d276c['getMinutes']()/_0x2c07ad)*_0x2c07ad;_0x1d276c['setUTCMinutes'](_0x1ff279,0x0,0x0);}else _0x8fe524==='h'&&_0x1d276c['setUTCMinutes'](0x0,0x0,0x0);return _0x1d276c['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x36041f){const _0x1a8797=_0x36041f instanceof Date?_0x36041f:new Date(_0x36041f);return _0x1a8797['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x4cf3a5){const _0x80032b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x5b3078=_0x80032b['length'];if(_0x4cf3a5<0x0||_0x4cf3a5>=Math['pow'](_0x5b3078,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x4f6a88,_0x4f2387]=divmod(_0x4cf3a5,_0x5b3078),[_0xd97a1c,_0x35c7e8]=divmod(_0x4f6a88,_0x5b3078);return _0x80032b[_0xd97a1c]+_0x80032b[_0x4f2387]+_0x80032b[_0x35c7e8];}exports['getSymKey']=getSymKey;function getSymVal(_0x5b85df){const _0x116b37='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x32c6cd=_0x116b37['length'];if(_0x5b85df<0x0||_0x5b85df>=Math['pow'](_0x32c6cd,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x4cd809,_0xa6318c]=divmod(_0x5b85df,_0x32c6cd);return _0x116b37[_0x4cd809]+_0x116b37[_0xa6318c];}exports['getSymVal']=getSymVal;function divmod(_0x3b6811,_0x57606c){return[Math['floor'](_0x3b6811/_0x57606c),_0x3b6811%_0x57606c];}function getIndexedHash(_0x2ce3ea,_0x3b0b6a){const _0xc891da=_0x2ce3ea[_0x3b0b6a]||0x0,_0x3d3c9d={..._0x2ce3ea};return delete _0x3d3c9d[_0x3b0b6a],[_0xc891da,_0x3d3c9d];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x233352,_0x41a3ae){const _0x369fb1=_0x41a3ae['split']('/');let _0x49ef5c=_0x233352;for(const _0x1d08ae of _0x369fb1){if(_0x49ef5c[_0x1d08ae]!==undefined)_0x49ef5c=_0x49ef5c[_0x1d08ae];else return undefined;}return _0x49ef5c;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x2748ac){const _0x2b12a6={};for(const _0x39f37c in _0x2748ac){if(_0x2748ac[_0x39f37c]===undefined)continue;const _0xc11640=_0x39f37c['split']('/');let _0x5f5152=_0x2b12a6;for(let _0x163146=0x0;_0x163146<_0xc11640['length'];_0x163146++){_0x163146===_0xc11640['length']-0x1?_0x5f5152[_0xc11640[_0x163146]]=_0x2748ac[_0x39f37c]:(_0x5f5152[_0xc11640[_0x163146]]=_0x5f5152[_0xc11640[_0x163146]]||{},_0x5f5152=_0x5f5152[_0xc11640[_0x163146]]);}}return _0x2b12a6;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x248135){const _0x28492e=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x28492e['test'](_0x248135);}exports['isValidCron']=isValidCron;const s=_0x562cb7=>{return(0x0,ms_1['default'])(_0x562cb7)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x21f062=>{try{return JSON['parse'](_0x21f062);}catch(_0x8a9a){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x8a9a});throw _0x8a9a;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0x455d67=>{return Array['isArray'](_0x455d67)&&Array['isArray'](_0x455d67[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x206a60=>{const _0x2385c1=[];let _0x1b2ac5;for(let _0x5090b3=0x1;_0x5090b3<_0x206a60['length'];_0x5090b3++){const _0x41756e=_0x206a60[_0x5090b3],_0x5e012e={};if(Array['isArray'](_0x41756e)){for(let _0x9e918c=0x0;_0x9e918c<_0x41756e['length'];_0x9e918c+=0x2){const _0x2f3655=_0x41756e[_0x9e918c],_0x5ee314=_0x41756e[_0x9e918c+0x1];_0x5e012e[_0x2f3655]=_0x5ee314;}_0x1b2ac5&&(_0x5e012e['$']=_0x1b2ac5),_0x2385c1['push'](_0x5e012e),_0x1b2ac5=undefined;}else _0x1b2ac5=_0x41756e;}return _0x2385c1;};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(_0x12a339,_0x1353ef){const _0x5836b8=_0x1c4b,_0x28c1c9=_0x12a339();while(!![]){try{const _0x188332=parseInt(_0x5836b8(0x15b))/0x1*(parseInt(_0x5836b8(0x15a))/0x2)+parseInt(_0x5836b8(0x155))/0x3*(parseInt(_0x5836b8(0x154))/0x4)+parseInt(_0x5836b8(0x158))/0x5+parseInt(_0x5836b8(0x159))/0x6+parseInt(_0x5836b8(0x15e))/0x7*(-parseInt(_0x5836b8(0x153))/0x8)+-parseInt(_0x5836b8(0x157))/0x9*(-parseInt(_0x5836b8(0x15d))/0xa)+parseInt(_0x5836b8(0x156))/0xb*(-parseInt(_0x5836b8(0x15c))/0xc);if(_0x188332===_0x1353ef)break;else _0x28c1c9['push'](_0x28c1c9['shift']());}catch(_0x477300){_0x28c1c9['push'](_0x28c1c9['shift']());}}}(_0x14d3,0x9f426));function _0x1c4b(_0x29794a,_0x5c3976){const _0x14d320=_0x14d3();return _0x1c4b=function(_0x1c4bd6,_0x2761dd){_0x1c4bd6=_0x1c4bd6-0x153;let _0x3d1e04=_0x14d320[_0x1c4bd6];return _0x3d1e04;},_0x1c4b(_0x29794a,_0x5c3976);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Activity']=void 0x0;function _0x14d3(){const _0x544eb2=['104dtXVgl','236FXPkHj','23067ZNIiCs','68233BAEcAb','18GemtGr','466725MpRWur','3994254biaBIj','2jbSIEP','481543cynISr','2292JyUqjY','5607910TzUAbJ','527009poESpC'];_0x14d3=function(){return _0x544eb2;};return _0x14d3();}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(_0x3aed1b,_0x2baf3e,_0x17ffcc,_0x477991,_0x54fb56,_0x3fdffd){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x3aed1b,this['data']=_0x2baf3e,this['metadata']=_0x17ffcc,this['hook']=_0x477991,this['engine']=_0x54fb56,this['context']=_0x3fdffd||{'data':{},'metadata':{}},this['logger']=_0x54fb56['logger'],this['store']=_0x54fb56['store'];}['setLeg'](_0x3128c1){this['leg']=_0x3128c1;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x2f8d41=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x2f8d41!==undefined&&!isNaN(Number(_0x2f8d41)))return _0x2f8d41;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x19b21f=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x19b21f);}catch(_0x460874){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x19b21f>0x0){if(this['context']['metadata']['js']===_0x19b21f){const _0x1d85c6=await this['setStatus'](-_0x19b21f);Number(_0x1d85c6)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x460874;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x13b0f8=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,_0x13b0f8);}async['processEvent'](_0x42a37b=stream_1['StreamStatus']['SUCCESS'],_0x139637=0xc8,_0x5807ca='output'){this['setLeg'](0x2);const _0x2700d1=this['context']['metadata']['jid'];if(!_0x2700d1){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0xa20b0d=this['metadata']['aid'];this['status']=_0x42a37b,this['code']=_0x139637,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x2700d1,'aid':_0xa20b0d,'status':_0x42a37b,'code':_0x139637});let _0x433ba;try{const _0x626453=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x626453),_0x433ba=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x433ba['startActivitySpan'](this['leg']);let _0x494131;if(_0x42a37b===stream_1['StreamStatus']['PENDING'])_0x494131=await this['processPending'](_0x5807ca);else _0x42a37b===stream_1['StreamStatus']['SUCCESS']?_0x494131=await this['processSuccess'](_0x5807ca):_0x494131=await this['processError']();this['transitionAdjacent'](_0x494131,_0x433ba);}catch(_0x3a9d96){if(_0x3a9d96 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x3a9d96['fault']+'-error',{..._0x3a9d96});return;}else{if(_0x3a9d96 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x3a9d96});return;}else{if(_0x3a9d96 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x3a9d96});return;}else{if(_0x3a9d96 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x3a9d96});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x3a9d96,'message':_0x3a9d96['message'],'stack':_0x3a9d96['stack'],'name':_0x3a9d96['name']}),_0x433ba?.['setActivityError'](_0x3a9d96['message']);throw _0x3a9d96;}finally{_0x433ba?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x2700d1,'aid':_0xa20b0d});}}async['processPending'](_0x4ca24b){this['bindActivityData'](_0x4ca24b),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x4b644b=this['store']['transact']();return await this['setState'](_0x4b644b),await collator_1['CollatorService']['notarizeContinuation'](this,_0x4b644b),await this['setStatus'](this['adjacencyList']['length'],_0x4b644b),await _0x4b644b['exec']();}async['processSuccess'](_0x9d8f68){this['bindActivityData'](_0x9d8f68),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x10457a=this['store']['transact']();return await this['setState'](_0x10457a),await collator_1['CollatorService']['notarizeCompletion'](this,_0x10457a),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x10457a),await _0x10457a['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x44f04c=this['store']['transact']();return await this['setState'](_0x44f04c),await collator_1['CollatorService']['notarizeCompletion'](this,_0x44f04c),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x44f04c),await _0x44f04c['exec']();}async['transitionAdjacent'](_0x202f44,_0x5c604e){_0x5c604e['mapActivityAttributes']();const _0x454889=this['resolveStatus'](_0x202f44),_0x425b6d={'app.job.jss':_0x454889},_0x5f0d69=await this['transition'](this['adjacencyList'],_0x454889);_0x5f0d69?.['length']&&(_0x425b6d['app.activity.mids']=_0x5f0d69['join'](',')),_0x5c604e['setActivityAttributes'](_0x425b6d);}['resolveStatus'](_0x5f2b24){const _0x2e6b63=_0x5f2b24[_0x5f2b24['length']-0x1];return Array['isArray'](_0x2e6b63)?Number(_0x2e6b63[0x1]):Number(_0x2e6b63);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x397382=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x98dd1c=_0x397382['mapRules']();if(_0x98dd1c)for(const _0x5e7317 in _0x98dd1c){const _0x49125d=_0x5e7317['indexOf']('[');if(_0x49125d>-0x1){const _0x3297b2=_0x5e7317['substring'](_0x49125d+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x3297b2))){const _0x41c066=_0x5e7317['substring'](0x0,_0x49125d);_0x98dd1c[_0x41c066]=_0x98dd1c[_0x5e7317],delete _0x98dd1c[_0x5e7317];}else{if(_0x3297b2==='-'||_0x3297b2==='_'){const _0x26d514=_0x98dd1c[_0x5e7317];Object['keys'](_0x26d514)['forEach'](_0x5e162c=>{_0x98dd1c[_0x5e162c]=_0x26d514[_0x5e162c];});}}}}this['context']['data']=_0x98dd1c;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x5bce5f=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x5bce5f['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x74b1b3=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x23791b=_0x74b1b3['mapRules'](),_0x3fd8c8=this['metadata']['aid'],_0x26eb8c={...this['context'][_0x3fd8c8]['output'],..._0x23791b};this['context'][_0x3fd8c8]['output']['data']=_0x26eb8c;}}async['registerTimeout'](){}['bindActivityError'](_0x4161d0){const _0x45aca6=this['context'][this['metadata']['aid']]['output']['metadata'];_0x45aca6['err']=JSON['stringify'](this['data']),_0x45aca6['$error']={..._0x4161d0,'is_stream_error':!![]};}['bindJobError'](_0x4e6600){this['context']['metadata']['err']=JSON['stringify']({..._0x4e6600,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x570a2e,_0x32aa24){const {id:_0x3eb3d6}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x570a2e,this['context']['metadata']['jid'],_0x3eb3d6,_0x32aa24);}['authorizeEntry'](_0x44d90e){return this['adjacencyList']?.['map'](_0xbff8fe=>{const {metadata:{aid:_0x2902eb}}=_0xbff8fe;return _0x44d90e[_0x2902eb+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x2902eb;})??[];}['bindDimensionalAddress'](_0x1d1e9b){const _0x495a4f=this['resolveDad']();_0x1d1e9b[this['metadata']['aid']+'/output/metadata/dad']=_0x495a4f;}async['setState'](_0x37ea50){const _0x479098=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x3cab1b={};await this['bindJobState'](_0x3cab1b);const _0x540021=this['authorizeEntry'](_0x3cab1b);this['bindDimensionalAddress'](_0x3cab1b),this['bindActivityState'](_0x3cab1b);const _0x24f55f=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x540021],_0xeb6e0d=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x3cab1b,this['getJobStatus'](),_0x479098,_0x24f55f,_0xeb6e0d,_0x37ea50);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x37918e=this['context']['$self'];!_0x37918e['output']['metadata']&&(_0x37918e['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x37918e['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x4ea1d5=(0x0,utils_1['formatISODate'])(new Date());_0x37918e['output']['metadata']['ac']=_0x4ea1d5,_0x37918e['output']['metadata']['au']=_0x4ea1d5,_0x37918e['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x37918e['output']['metadata']['stp']=this['config']['subtype']),_0x37918e['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x2b0678){const _0x41b7fa=await this['getTriggerConfig'](),_0x5cf153=[..._0x41b7fa['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x297577 of _0x5cf153){const _0x11fc0d=(0x0,utils_1['getValueByPath'])(this['context'],_0x297577);_0x11fc0d!==undefined&&(_0x2b0678[_0x297577]=_0x11fc0d);}for(const _0x275a7a in this['context']?.['data']??{}){(_0x275a7a['startsWith']('-')||_0x275a7a['startsWith']('_'))&&(_0x2b0678[_0x275a7a]=this['context']['data'][_0x275a7a]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x2b0678,this['config'],this['context']);}['bindActivityState'](_0x1ce3cb){const _0x136ae7=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x1911d3 of _0x136ae7){const _0x2fc2e7=this['metadata']['aid']+'/'+_0x1911d3,_0x273c17=(0x0,utils_1['getValueByPath'])(this['context'],_0x2fc2e7);_0x273c17!==undefined&&(_0x1ce3cb[_0x2fc2e7]=_0x273c17);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x1ce3cb,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x1482f8=>'metadata/'+_0x1482f8);}['bindActivityMetadataPaths'](){const _0x2a1d7e=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x2a1d7e]['KEYS']['map'](_0x2d3fee=>'output/metadata/'+_0x2d3fee);}async['getState'](){const _0x356e77=this['context']['metadata']['gid'],_0x5eb7c7='$'+this['config']['subscribes'],_0x48ab06={[_0x5eb7c7]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x392be7=>'metadata/'+_0x392be7)};for(let [_0x12dae9,_0x67bda3]of Object['entries'](this['config']['consumes'])){if(_0x12dae9==='$job')for(const _0x54a5f6 of _0x67bda3){_0x48ab06[_0x5eb7c7]['push'](_0x54a5f6);}else{_0x12dae9==='$self'&&(_0x12dae9=this['metadata']['aid']);!_0x48ab06[_0x12dae9]&&(_0x48ab06[_0x12dae9]=[]);for(const _0x536384 of _0x67bda3){_0x48ab06[_0x12dae9]['push'](_0x12dae9+'/'+_0x536384);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x48ab06,this['config'],this['metadata'],this['leg']);const {dad:_0x17d833,jid:_0x1743ef}=this['context']['metadata'],_0x1ad9e9=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x17d833||''),[_0x167aa1,_0x518cba]=await this['store']['getState'](_0x1743ef,_0x48ab06,_0x1ad9e9);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x167aa1),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x356e77),this['initDimensionalAddress'](_0x17d833),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x10c2a9,_0xe29c4f){if(_0xe29c4f!==_0x10c2a9)throw new errors_1['GenerationalError'](_0x10c2a9,_0xe29c4f,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0xa47918){this['metadata']['dad']=_0xa47918;}['initSelf'](_0x361a7c){const _0x251f80=this['metadata']['aid'];!_0x361a7c[_0x251f80]&&(_0x361a7c[_0x251f80]={});const _0x4c91d3=_0x361a7c[_0x251f80];return!_0x4c91d3['output']&&(_0x4c91d3['output']={}),!_0x4c91d3['input']&&(_0x4c91d3['input']={}),!_0x4c91d3['hook']&&(_0x4c91d3['hook']={}),!_0x4c91d3['output']['metadata']&&(_0x4c91d3['output']['metadata']={}),_0x4c91d3['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x361a7c['$self']=_0x4c91d3,_0x361a7c['$job']=_0x361a7c,_0x361a7c;}['initPolicies'](_0x4870d5){const _0x2b9ac9=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x4870d5);_0x4870d5['metadata']['expire']=_0x2b9ac9;if(this['config']['persistent']!=undefined){const _0x17f130=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x4870d5);_0x4870d5['metadata']['persistent']=_0x17f130;}}['bindActivityData'](_0x31b384){this['context'][this['metadata']['aid']][_0x31b384]['data']=this['data'];}['resolveDad'](){let _0x2ad174=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x2ad174=_0x2ad174['substring'](0x0,_0x2ad174['lastIndexOf'](','))+','+this['adjacentIndex']),_0x2ad174;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x2d33e4=[],_0x48873b=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x5a00ab=_0x48873b['.'+this['metadata']['aid']],_0x290136=this['resolveAdjacentDad']();if(_0x5a00ab)for(const _0x5bd137 in _0x5a00ab){const _0xfa9d9e=_0x5a00ab[_0x5bd137];mapper_1['MapperService']['evaluate'](_0xfa9d9e,this['context'],this['code'])&&_0x2d33e4['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x290136,'aid':_0x5bd137,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x2d33e4;}['isJobComplete'](_0x562e9f){return _0x562e9f<=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'](_0x25451f,_0x2ef796){if(this['jobWasInterrupted'](_0x2ef796))return;let _0x36f25c=[];(this['shouldEmit']()||this['isJobComplete'](_0x2ef796)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x2ef796)&&!this['shouldPersistJob']()});if(_0x25451f['length']&&!this['isJobComplete'](_0x2ef796)){const _0x2ab0d6=this['store']['transact']();for(const _0x3686f3 of _0x25451f){await this['engine']['router']?.['publishMessage'](null,_0x3686f3,_0x2ab0d6);}_0x36f25c=await _0x2ab0d6['exec']();}return _0x36f25c;}['jobWasInterrupted'](_0x51cd09){return _0x51cd09<-0x5f5e100;}}exports['Activity']=Activity;
|
|
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';(function(
|
|
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;
|