@hotmeshio/hotmesh 0.3.7 → 0.3.8
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 +13 -1
- package/build/index.d.ts +3 -2
- package/build/index.js +5 -2
- 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/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/meshflow/index.d.ts +2 -0
- package/build/services/meshflow/index.js +2 -0
- 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/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/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/postgres/_deploy.js +1 -1
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/index.ts +4 -1
- package/package.json +1 -1
- package/typedoc.json +2 -1
package/README.md
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
# HotMesh
|
|
2
2
|

|
|
3
3
|
|
|
4
|
-
**HotMesh**
|
|
4
|
+
**HotMesh** offers "Temporal Your Way"—providing the power of orchestration platforms like Temporal.io in a flexible, decentralized manner. Replace everything with robust **Queues** and **Routers**...even the app server.
|
|
5
|
+
|
|
6
|
+
*Note: This is a beta release and currently focuses on TypeScript/Redis.*
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- **Temporal Your Way**: Orchestrate your microservices using message queues and routers, without the need for a central server.
|
|
11
|
+
- **Pluggable Middleware**: Mix and match technologies through a standard interface. Currently supporting **Redis/ValKey/Dragonfly/KVRocks**, with **Postgres**, **ElasticSearch**, and **NATS** coming next.
|
|
12
|
+
- **Decentralized Orchestration**: Build a resilient architecture with decentralized queues and routers.
|
|
13
|
+
- **Linear Scalability**: Scale your application by scaling the database.
|
|
14
|
+
- **Real-Time Analytics**: Gain insights into your workflows with real-time analytics.
|
|
5
15
|
|
|
6
16
|
## Install
|
|
17
|
+
|
|
7
18
|
```sh
|
|
8
19
|
npm install @hotmeshio/hotmesh
|
|
9
20
|
```
|
|
21
|
+
|
|
10
22
|
You have a Redis instance? Good. You're ready to go.
|
|
11
23
|
|
|
12
24
|
## Learn
|
package/build/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { MeshCall } from './services/meshcall';
|
|
|
4
4
|
import { MeshFlow } from './services/meshflow';
|
|
5
5
|
import { MeshData } from './services/meshdata';
|
|
6
6
|
import { MeshOS } from './services/meshos';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import * as Utils from './modules/utils';
|
|
8
|
+
declare const Client: typeof import("./services/meshflow/client").ClientService, Connection: typeof import("./services/meshflow/connection").ConnectionService, Handle: typeof import("./services/meshflow/handle").WorkflowHandleService, Search: typeof import("./services/meshflow/search").Search, Worker: typeof import("./services/meshflow/worker").WorkerService, workflow: typeof import("./services/meshflow/workflow").WorkflowService;
|
|
9
|
+
export { HotMesh, HotMeshConfig, MeshCall, MeshData, MeshOS, MeshFlow, Client, Connection, Handle, Search, Utils, Worker, workflow, };
|
|
9
10
|
export * as Types from './types';
|
package/build/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Types = exports.workflow = exports.Worker = exports.Search = exports.Connection = exports.Client = exports.MeshFlow = exports.MeshOS = exports.MeshData = exports.MeshCall = exports.HotMesh = void 0;
|
|
26
|
+
exports.Types = exports.workflow = exports.Worker = exports.Utils = exports.Search = exports.Handle = exports.Connection = exports.Client = exports.MeshFlow = exports.MeshOS = exports.MeshData = exports.MeshCall = exports.HotMesh = void 0;
|
|
27
27
|
const hotmesh_1 = require("./services/hotmesh");
|
|
28
28
|
Object.defineProperty(exports, "HotMesh", { enumerable: true, get: function () { return hotmesh_1.HotMesh; } });
|
|
29
29
|
const meshcall_1 = require("./services/meshcall");
|
|
@@ -34,9 +34,12 @@ const meshdata_1 = require("./services/meshdata");
|
|
|
34
34
|
Object.defineProperty(exports, "MeshData", { enumerable: true, get: function () { return meshdata_1.MeshData; } });
|
|
35
35
|
const meshos_1 = require("./services/meshos");
|
|
36
36
|
Object.defineProperty(exports, "MeshOS", { enumerable: true, get: function () { return meshos_1.MeshOS; } });
|
|
37
|
-
const
|
|
37
|
+
const Utils = __importStar(require("./modules/utils"));
|
|
38
|
+
exports.Utils = Utils;
|
|
39
|
+
const { Client, Connection, Handle, Search, Worker, workflow } = meshflow_1.MeshFlow;
|
|
38
40
|
exports.Client = Client;
|
|
39
41
|
exports.Connection = Connection;
|
|
42
|
+
exports.Handle = Handle;
|
|
40
43
|
exports.Search = Search;
|
|
41
44
|
exports.Worker = Worker;
|
|
42
45
|
exports.workflow = workflow;
|
package/build/modules/key.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x3894d5,_0x493088){const _0x402f98=_0x51d9,_0x2b985c=_0x3894d5();while(!![]){try{const _0x38edcd=-parseInt(_0x402f98(0x93))/0x1+-parseInt(_0x402f98(0x9b))/0x2+-parseInt(_0x402f98(0x96))/0x3+parseInt(_0x402f98(0x9a))/0x4*(parseInt(_0x402f98(0x94))/0x5)+-parseInt(_0x402f98(0x99))/0x6*(parseInt(_0x402f98(0x95))/0x7)+parseInt(_0x402f98(0x97))/0x8+parseInt(_0x402f98(0x98))/0x9;if(_0x38edcd===_0x493088)break;else _0x2b985c['push'](_0x2b985c['shift']());}catch(_0x19e864){_0x2b985c['push'](_0x2b985c['shift']());}}}(_0x3924,0xa9fb1));function _0x3924(){const _0x4438c2=['9234oQOPZx','5008gkezGw','1211732zFbpfe','1749GpIKVr','910wtAAcy','6139lEcSMC','236721CoGPFq','7725752lWNdvL','13849947nIaKzv'];_0x3924=function(){return _0x4438c2;};return _0x3924();}function _0x51d9(_0xe809f4,_0x472583){const _0x3924fc=_0x3924();return _0x51d9=function(_0x51d9f7,_0x336ded){_0x51d9f7=_0x51d9f7-0x93;let _0x5e99e7=_0x3924fc[_0x51d9f7];return _0x5e99e7;},_0x51d9(_0xe809f4,_0x472583);}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;const VALSEP='::';exports['VALSEP']=VALSEP;const WEBSEP='::';exports['WEBSEP']=WEBSEP;const TYPSEP='::';exports['TYPSEP']=TYPSEP;class KeyService{static['mintKey'](_0x5c9c91,_0x32edc1,_0x1ccfa9){switch(_0x32edc1){case hotmesh_1['KeyType']['HOTMESH']:return _0x5c9c91;case hotmesh_1['KeyType']['THROTTLE_RATE']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':r:';case hotmesh_1['KeyType']['WORK_ITEMS']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':w:'+(_0x1ccfa9['scoutType']||'');case hotmesh_1['KeyType']['TIME_RANGE']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':t:'+(_0x1ccfa9['timeValue']||'');case hotmesh_1['KeyType']['APP']:return _0x5c9c91+':a:'+(_0x1ccfa9['appId']||'');case hotmesh_1['KeyType']['QUORUM']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':q:'+(_0x1ccfa9['engineId']||'');case hotmesh_1['KeyType']['JOB_STATE']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':j:'+_0x1ccfa9['jobId'];case hotmesh_1['KeyType']['JOB_DEPENDENTS']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':d:'+_0x1ccfa9['jobId'];case hotmesh_1['KeyType']['JOB_STATS_GENERAL']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':s:'+_0x1ccfa9['jobKey']+':'+_0x1ccfa9['dateTime'];case hotmesh_1['KeyType']['JOB_STATS_MEDIAN']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':s:'+_0x1ccfa9['jobKey']+':'+_0x1ccfa9['dateTime']+':'+_0x1ccfa9['facet'];case hotmesh_1['KeyType']['JOB_STATS_INDEX']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':s:'+_0x1ccfa9['jobKey']+':'+_0x1ccfa9['dateTime']+':'+_0x1ccfa9['facet'];case hotmesh_1['KeyType']['SCHEMAS']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':v:'+_0x1ccfa9['appVersion']+':schemas';case hotmesh_1['KeyType']['SUBSCRIPTIONS']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':v:'+_0x1ccfa9['appVersion']+':subscriptions';case hotmesh_1['KeyType']['SUBSCRIPTION_PATTERNS']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':v:'+_0x1ccfa9['appVersion']+':transitions';case hotmesh_1['KeyType']['HOOKS']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':hooks';case hotmesh_1['KeyType']['SIGNALS']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':signals';case hotmesh_1['KeyType']['SYMKEYS']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':sym:keys:'+(_0x1ccfa9['activityId']||'');case hotmesh_1['KeyType']['SYMVALS']:return _0x5c9c91+':'+_0x1ccfa9['appId']+':sym:vals:';case hotmesh_1['KeyType']['STREAMS']:return _0x5c9c91+':'+(_0x1ccfa9['appId']||'')+':x:'+(_0x1ccfa9['topic']||'');default:throw new Error('Invalid\x20key\x20type.');}}}exports['KeyService']=KeyService;
|
package/build/modules/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x38faf5,_0x49ad06){const _0x43c470=_0x1dfe,_0x5cccc1=_0x38faf5();while(!![]){try{const _0x730069=-parseInt(_0x43c470(0x16f))/0x1+parseInt(_0x43c470(0x172))/0x2+-parseInt(_0x43c470(0x16c))/0x3+-parseInt(_0x43c470(0x173))/0x4+-parseInt(_0x43c470(0x16b))/0x5*(-parseInt(_0x43c470(0x170))/0x6)+parseInt(_0x43c470(0x171))/0x7*(-parseInt(_0x43c470(0x16e))/0x8)+parseInt(_0x43c470(0x16d))/0x9;if(_0x730069===_0x49ad06)break;else _0x5cccc1['push'](_0x5cccc1['shift']());}catch(_0x2f96b0){_0x5cccc1['push'](_0x5cccc1['shift']());}}}(_0x329f,0xb072a));var __importDefault=this&&this['__importDefault']||function(_0x45b55a){return _0x45b55a&&_0x45b55a['__esModule']?_0x45b55a:{'default':_0x45b55a};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['identifyRedisTypeFromClass']=exports['polyfill']=exports['identifyRedisType']=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')),enums_1=require('./enums'),hashOptions=_0x1d3f84=>{const _0x4e9c44=JSON['stringify'](_0x1d3f84);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x4e9c44)['digest']('hex');};function _0x1dfe(_0x3ea9f5,_0x39ebd0){const _0x329f66=_0x329f();return _0x1dfe=function(_0x1dfee8,_0x3472ad){_0x1dfee8=_0x1dfee8-0x16b;let _0x307d84=_0x329f66[_0x1dfee8];return _0x307d84;},_0x1dfe(_0x3ea9f5,_0x39ebd0);}exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x559655=os_1['default']['totalmem'](),_0x5a521e=os_1['default']['freemem'](),_0x2bbe50=_0x559655-_0x5a521e,_0x1e10dc={'TotalMemoryGB':(_0x559655/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x5a521e/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x2bbe50/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x1e10dc;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x128e6b){return JSON['parse'](JSON['stringify'](_0x128e6b));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x7c41e2){const _0x2a21aa=Math['sin'](_0x7c41e2)*0x2710;return _0x2a21aa-Math['floor'](_0x2a21aa);}exports['deterministicRandom']=deterministicRandom;function guid(_0x135887=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x135887);}exports['guid']=guid;async function sleepFor(_0x43a676){return new Promise(_0x895b9f=>setTimeout(_0x895b9f,_0x43a676));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x50f2cf=>setImmediate(_0x50f2cf));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0x44eae6){let _0xbc3784;const _0x10ae38=new Promise(_0x5dc486=>{_0xbc3784=setTimeout(_0x5dc486,_0x44eae6);});return{'promise':_0x10ae38,'timerId':_0xbc3784};}exports['XSleepFor']=XSleepFor;function identifyRedisType(_0xde722c){const _0x4dc780=Object['getPrototypeOf'](_0xde722c);if('defineCommand'in _0x4dc780||Object['keys'](_0x4dc780)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x4dc780)['includes']('Multi'))return'redis';}if(_0xde722c['constructor']){if(_0xde722c['constructor']['name']==='Redis'||_0xde722c['constructor']['name']==='EventEmitter'){if('hset'in _0xde722c)return'ioredis';}else{if(_0xde722c['constructor']['name']==='RedisClient'||_0xde722c['constructor']['name']==='Commander'){if('HSET'in _0xde722c)return'redis';}}}return null;}exports['identifyRedisType']=identifyRedisType,exports['polyfill']={'resolveActivityType'(_0x3065a8){if(_0x3065a8==='activity')return'hook';return _0x3065a8;}};function identifyRedisTypeFromClass(_0x290225){if(_0x290225&&_0x290225['name']==='Redis'||_0x290225['name']==='EventEmitter')return'ioredis';else{if(_0x290225&&'createClient'in _0x290225)return'redis';}return null;}exports['identifyRedisTypeFromClass']=identifyRedisTypeFromClass;function matchesStatusCode(_0x52359a,_0x3a1020){if(typeof _0x3a1020==='string'){const _0xd36abf='^'+_0x3a1020['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0xd36abf)['test'](_0x52359a['toString']());}return _0x3a1020['test'](_0x52359a['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x398c3f,_0x1e8d74){return _0x398c3f===_0x1e8d74;}function _0x329f(){const _0x700043=['2301714JbNSEo','19811088mVyMjA','40qYCMzi','760563GbCRru','7799628LYssfc','1207353GyLwUA','1393112KNOJVy','4339200VAIUTq','5CcOAuh'];_0x329f=function(){return _0x700043;};return _0x329f();}exports['matchesStatus']=matchesStatus;function findTopKey(_0x49749b,_0x322a63){for(const [_0xdfcc06,_0x400c04]of Object['entries'](_0x49749b)){if(_0x400c04['hasOwnProperty'](_0x322a63)){const _0x4c8b23=findTopKey(_0x49749b,_0xdfcc06['replace'](/^\./,''));return(_0x4c8b23||_0xdfcc06)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x4ef3a2,_0x4a0cd8){for(const [_0x2c3118,_0x1c627f]of Object['entries'](_0x4ef3a2)){if(_0x1c627f===_0x4a0cd8)return _0x2c3118;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x2d261c,_0x329c9b,_0x4244f9){const _0x26b2e4=await _0x329c9b['getTransitions'](_0x4244f9),_0x2bddac=await _0x329c9b['getSubscriptions'](_0x4244f9),_0x5fddf1=findTopKey(_0x26b2e4,_0x2d261c),_0x5a3210=findSubscriptionForTrigger(_0x2bddac,_0x5fddf1);return _0x5a3210;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x517faa){if(_0x517faa['toString']()==='infinity')return'0';const _0xff7590=new Date(),_0x2f7226=_0x517faa['slice'](-0x1),_0xfcab4e=parseInt(_0x517faa['slice'](0x0,-0x1),0xa);if(_0x2f7226==='m'){const _0x1ac0f0=Math['floor'](_0xff7590['getMinutes']()/_0xfcab4e)*_0xfcab4e;_0xff7590['setUTCMinutes'](_0x1ac0f0,0x0,0x0);}else _0x2f7226==='h'&&_0xff7590['setUTCMinutes'](0x0,0x0,0x0);return _0xff7590['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x27e51a){const _0x1dee03=_0x27e51a instanceof Date?_0x27e51a:new Date(_0x27e51a);return _0x1dee03['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x4ac427){const _0x579f21='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x4a4eb7=_0x579f21['length'];if(_0x4ac427<0x0||_0x4ac427>=Math['pow'](_0x4a4eb7,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x2849ab,_0x504f12]=divmod(_0x4ac427,_0x4a4eb7),[_0x2a5dc8,_0x3698f3]=divmod(_0x2849ab,_0x4a4eb7);return _0x579f21[_0x2a5dc8]+_0x579f21[_0x504f12]+_0x579f21[_0x3698f3];}exports['getSymKey']=getSymKey;function getSymVal(_0x1970eb){const _0x42af06='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x4b2e89=_0x42af06['length'];if(_0x1970eb<0x0||_0x1970eb>=Math['pow'](_0x4b2e89,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x1386cb,_0x352f61]=divmod(_0x1970eb,_0x4b2e89);return _0x42af06[_0x1386cb]+_0x42af06[_0x352f61];}exports['getSymVal']=getSymVal;function divmod(_0x519020,_0x35107a){return[Math['floor'](_0x519020/_0x35107a),_0x519020%_0x35107a];}function getIndexedHash(_0xff28ed,_0x2013f0){const _0x1ce9c4=_0xff28ed[_0x2013f0]||0x0,_0x57b4aa={..._0xff28ed};return delete _0x57b4aa[_0x2013f0],[_0x1ce9c4,_0x57b4aa];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x6a2786,_0x4bdf2e){const _0xf195fa=_0x4bdf2e['split']('/');let _0x4eff0c=_0x6a2786;for(const _0x327859 of _0xf195fa){if(_0x4eff0c[_0x327859]!==undefined)_0x4eff0c=_0x4eff0c[_0x327859];else return undefined;}return _0x4eff0c;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x348b16){const _0x364216={};for(const _0x2d424a in _0x348b16){if(_0x348b16[_0x2d424a]===undefined)continue;const _0x193f93=_0x2d424a['split']('/');let _0x181c48=_0x364216;for(let _0x5282d2=0x0;_0x5282d2<_0x193f93['length'];_0x5282d2++){_0x5282d2===_0x193f93['length']-0x1?_0x181c48[_0x193f93[_0x5282d2]]=_0x348b16[_0x2d424a]:(_0x181c48[_0x193f93[_0x5282d2]]=_0x181c48[_0x193f93[_0x5282d2]]||{},_0x181c48=_0x181c48[_0x193f93[_0x5282d2]]);}}return _0x364216;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x539c23){const _0x10008f=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x10008f['test'](_0x539c23);}exports['isValidCron']=isValidCron;const s=_0x180d5f=>{return(0x0,ms_1['default'])(_0x180d5f)/0x3e8;};exports['s']=s;const arrayToHash=_0x2c946f=>{const _0x611bfe=[];let _0x471383;for(let _0x469643=0x1;_0x469643<_0x2c946f['length'];_0x469643++){const _0x32b226=_0x2c946f[_0x469643],_0x3ad636={};if(Array['isArray'](_0x32b226)){for(let _0x1ee3f1=0x0;_0x1ee3f1<_0x32b226['length'];_0x1ee3f1+=0x2){const _0x5856df=_0x32b226[_0x1ee3f1],_0x34b941=_0x32b226[_0x1ee3f1+0x1];_0x3ad636[_0x5856df]=_0x34b941;}_0x471383&&(_0x3ad636['$']=_0x471383),_0x611bfe['push'](_0x3ad636),_0x471383=undefined;}else _0x471383=_0x32b226;}return _0x611bfe;};exports['arrayToHash']=arrayToHash;
|
package/build/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x1b9e1b,_0x71cd11){const _0x3f3abe=_0x39eb,_0xa04d1b=_0x1b9e1b();while(!![]){try{const _0xc6d91c=-parseInt(_0x3f3abe(0x158))/0x1+parseInt(_0x3f3abe(0x154))/0x2+parseInt(_0x3f3abe(0x151))/0x3*(-parseInt(_0x3f3abe(0x156))/0x4)+parseInt(_0x3f3abe(0x14f))/0x5*(-parseInt(_0x3f3abe(0x157))/0x6)+parseInt(_0x3f3abe(0x153))/0x7+parseInt(_0x3f3abe(0x150))/0x8*(parseInt(_0x3f3abe(0x155))/0x9)+parseInt(_0x3f3abe(0x152))/0xa;if(_0xc6d91c===_0x71cd11)break;else _0xa04d1b['push'](_0xa04d1b['shift']());}catch(_0x37757f){_0xa04d1b['push'](_0xa04d1b['shift']());}}}(_0xcac2,0x81243));function _0xcac2(){const _0x29a422=['4845282akJmhD','570209pQFXsh','5NHnlIb','521408UxbdYw','193278bbadiz','14604540XxnZos','5030319LZCJzJ','605964CHivrx','54EArHIW','60WnrGtb'];_0xcac2=function(){return _0x29a422;};return _0xcac2();}function _0x39eb(_0x1b2e8c,_0x526ca3){const _0xcac264=_0xcac2();return _0x39eb=function(_0x39ebce,_0x5c1539){_0x39ebce=_0x39ebce-0x14f;let _0x2d206f=_0xcac264[_0x39ebce];return _0x2d206f;},_0x39eb(_0x1b2e8c,_0x526ca3);}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(_0x365dfa,_0x197c95,_0x3c0a67,_0x20ee92,_0x54bf8a,_0x166e10){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x365dfa,this['data']=_0x197c95,this['metadata']=_0x3c0a67,this['hook']=_0x20ee92,this['engine']=_0x54bf8a,this['context']=_0x166e10||{'data':{},'metadata':{}},this['logger']=_0x54bf8a['logger'],this['store']=_0x54bf8a['store'];}['setLeg'](_0x240275){this['leg']=_0x240275;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x218a6b=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x218a6b!==undefined&&!isNaN(Number(_0x218a6b)))return _0x218a6b;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x282a43=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x282a43);}catch(_0x53d073){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x282a43>0x0){if(this['context']['metadata']['js']===_0x282a43){const _0x52cf53=await this['setStatus'](-_0x282a43);Number(_0x52cf53)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x53d073;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x1d44c4=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,_0x1d44c4);}async['processEvent'](_0x4818a0=stream_1['StreamStatus']['SUCCESS'],_0x459aa2=0xc8,_0x508a0d='output'){this['setLeg'](0x2);const _0x3e8911=this['context']['metadata']['jid'];if(!_0x3e8911){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x1b54dc=this['metadata']['aid'];this['status']=_0x4818a0,this['code']=_0x459aa2,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x3e8911,'aid':_0x1b54dc,'status':_0x4818a0,'code':_0x459aa2});let _0x1e595f;try{const _0x3b8168=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x3b8168),_0x1e595f=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x1e595f['startActivitySpan'](this['leg']);let _0x4b13e1;if(_0x4818a0===stream_1['StreamStatus']['PENDING'])_0x4b13e1=await this['processPending'](_0x508a0d);else _0x4818a0===stream_1['StreamStatus']['SUCCESS']?_0x4b13e1=await this['processSuccess'](_0x508a0d):_0x4b13e1=await this['processError']();this['transitionAdjacent'](_0x4b13e1,_0x1e595f);}catch(_0x28d7c0){if(_0x28d7c0 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x28d7c0['fault']+'-error',{..._0x28d7c0});return;}else{if(_0x28d7c0 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x28d7c0});return;}else{if(_0x28d7c0 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x28d7c0});return;}else{if(_0x28d7c0 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x28d7c0});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x28d7c0,'message':_0x28d7c0['message'],'stack':_0x28d7c0['stack'],'name':_0x28d7c0['name']}),_0x1e595f?.['setActivityError'](_0x28d7c0['message']);throw _0x28d7c0;}finally{_0x1e595f?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x3e8911,'aid':_0x1b54dc});}}async['processPending'](_0x3ac167){this['bindActivityData'](_0x3ac167),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x2b8800=this['store']['getMulti']();return await this['setState'](_0x2b8800),await collator_1['CollatorService']['notarizeContinuation'](this,_0x2b8800),await this['setStatus'](this['adjacencyList']['length'],_0x2b8800),await _0x2b8800['exec']();}async['processSuccess'](_0x3ee31d){this['bindActivityData'](_0x3ee31d),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x3860ee=this['store']['getMulti']();return await this['setState'](_0x3860ee),await collator_1['CollatorService']['notarizeCompletion'](this,_0x3860ee),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x3860ee),await _0x3860ee['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x370e2b=this['store']['getMulti']();return await this['setState'](_0x370e2b),await collator_1['CollatorService']['notarizeCompletion'](this,_0x370e2b),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x370e2b),await _0x370e2b['exec']();}async['transitionAdjacent'](_0x20f76b,_0x5dc578){_0x5dc578['mapActivityAttributes']();const _0x85563d=this['resolveStatus'](_0x20f76b),_0x58a19a={'app.job.jss':_0x85563d},_0x4edf25=await this['transition'](this['adjacencyList'],_0x85563d);_0x4edf25?.['length']&&(_0x58a19a['app.activity.mids']=_0x4edf25['join'](',')),_0x5dc578['setActivityAttributes'](_0x58a19a);}['resolveStatus'](_0x6f639f){const _0x3b03b4=_0x6f639f[_0x6f639f['length']-0x1];return Array['isArray'](_0x3b03b4)?Number(_0x3b03b4[0x1]):Number(_0x3b03b4);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0xf29065=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x126d0d=_0xf29065['mapRules']();if(_0x126d0d)for(const _0x2a64f4 in _0x126d0d){const _0x4fb722=_0x2a64f4['indexOf']('[');if(_0x4fb722>-0x1){const _0x139b3c=_0x2a64f4['substring'](_0x4fb722+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x139b3c))){const _0x200857=_0x2a64f4['substring'](0x0,_0x4fb722);_0x126d0d[_0x200857]=_0x126d0d[_0x2a64f4],delete _0x126d0d[_0x2a64f4];}else{if(_0x139b3c==='-'||_0x139b3c==='_'){const _0x5b2099=_0x126d0d[_0x2a64f4];Object['keys'](_0x5b2099)['forEach'](_0x1f2ae0=>{_0x126d0d[_0x1f2ae0]=_0x5b2099[_0x1f2ae0];});}}}}this['context']['data']=_0x126d0d;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x221d79=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x221d79['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x30e8e0=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x728ce3=_0x30e8e0['mapRules'](),_0x547d99=this['metadata']['aid'],_0x1bea8e={...this['context'][_0x547d99]['output'],..._0x728ce3};this['context'][_0x547d99]['output']['data']=_0x1bea8e;}}async['registerTimeout'](){}['bindActivityError'](_0x3460a8){const _0x119186=this['context'][this['metadata']['aid']]['output']['metadata'];_0x119186['err']=JSON['stringify'](this['data']),_0x119186['$error']={..._0x3460a8,'is_stream_error':!![]};}['bindJobError'](_0x37a417){this['context']['metadata']['err']=JSON['stringify']({..._0x37a417,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x37967e,_0x39908e){const {id:_0x281596}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x37967e,this['context']['metadata']['jid'],_0x281596,_0x39908e);}['authorizeEntry'](_0x481404){return this['adjacencyList']?.['map'](_0x55cde8=>{const {metadata:{aid:_0x5dda7b}}=_0x55cde8;return _0x481404[_0x5dda7b+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x5dda7b;})??[];}['bindDimensionalAddress'](_0x16d821){const _0xcd1d53=this['resolveDad']();_0x16d821[this['metadata']['aid']+'/output/metadata/dad']=_0xcd1d53;}async['setState'](_0xca9806){const _0x48bbc1=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x71aaff={};await this['bindJobState'](_0x71aaff);const _0xdfae18=this['authorizeEntry'](_0x71aaff);this['bindDimensionalAddress'](_0x71aaff),this['bindActivityState'](_0x71aaff);const _0xa11722=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0xdfae18],_0x58a4e2=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x71aaff,this['getJobStatus'](),_0x48bbc1,_0xa11722,_0x58a4e2,_0xca9806);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x456e75=this['context']['$self'];!_0x456e75['output']['metadata']&&(_0x456e75['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x456e75['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x338f54=(0x0,utils_1['formatISODate'])(new Date());_0x456e75['output']['metadata']['ac']=_0x338f54,_0x456e75['output']['metadata']['au']=_0x338f54,_0x456e75['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x456e75['output']['metadata']['stp']=this['config']['subtype']),_0x456e75['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x215d2c){const _0x17e0f5=await this['getTriggerConfig'](),_0x429df7=[..._0x17e0f5['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x1fcd7a of _0x429df7){const _0x30dbbc=(0x0,utils_1['getValueByPath'])(this['context'],_0x1fcd7a);_0x30dbbc!==undefined&&(_0x215d2c[_0x1fcd7a]=_0x30dbbc);}for(const _0x575daf in this['context']?.['data']??{}){(_0x575daf['startsWith']('-')||_0x575daf['startsWith']('_'))&&(_0x215d2c[_0x575daf]=this['context']['data'][_0x575daf]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x215d2c,this['config'],this['context']);}['bindActivityState'](_0x1a419f){const _0x11df47=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x5558a1 of _0x11df47){const _0x4edb0d=this['metadata']['aid']+'/'+_0x5558a1,_0x469fbf=(0x0,utils_1['getValueByPath'])(this['context'],_0x4edb0d);_0x469fbf!==undefined&&(_0x1a419f[_0x4edb0d]=_0x469fbf);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x1a419f,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x3d50dc=>'metadata/'+_0x3d50dc);}['bindActivityMetadataPaths'](){const _0x7c4ab0=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x7c4ab0]['KEYS']['map'](_0x318b82=>'output/metadata/'+_0x318b82);}async['getState'](){const _0x6176cc=this['context']['metadata']['gid'],_0x6ee70d='$'+this['config']['subscribes'],_0x27dcdf={[_0x6ee70d]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x29f3f2=>'metadata/'+_0x29f3f2)};for(let [_0x29ce3d,_0x29483b]of Object['entries'](this['config']['consumes'])){if(_0x29ce3d==='$job')for(const _0x53771e of _0x29483b){_0x27dcdf[_0x6ee70d]['push'](_0x53771e);}else{_0x29ce3d==='$self'&&(_0x29ce3d=this['metadata']['aid']);!_0x27dcdf[_0x29ce3d]&&(_0x27dcdf[_0x29ce3d]=[]);for(const _0x3a1452 of _0x29483b){_0x27dcdf[_0x29ce3d]['push'](_0x29ce3d+'/'+_0x3a1452);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x27dcdf,this['config'],this['metadata'],this['leg']);const {dad:_0x8fab60,jid:_0x1bce64}=this['context']['metadata'],_0x5a7e68=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x8fab60||''),[_0x45dee7,_0x52178d]=await this['store']['getState'](_0x1bce64,_0x27dcdf,_0x5a7e68);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x45dee7),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x6176cc),this['initDimensionalAddress'](_0x8fab60),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x29c8e1,_0x353e44){if(_0x353e44!==_0x29c8e1)throw new errors_1['GenerationalError'](_0x29c8e1,_0x353e44,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x19054c){this['metadata']['dad']=_0x19054c;}['initSelf'](_0x3902e9){const _0xc1aa97=this['metadata']['aid'];!_0x3902e9[_0xc1aa97]&&(_0x3902e9[_0xc1aa97]={});const _0x4cc875=_0x3902e9[_0xc1aa97];return!_0x4cc875['output']&&(_0x4cc875['output']={}),!_0x4cc875['input']&&(_0x4cc875['input']={}),!_0x4cc875['hook']&&(_0x4cc875['hook']={}),!_0x4cc875['output']['metadata']&&(_0x4cc875['output']['metadata']={}),_0x4cc875['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x3902e9['$self']=_0x4cc875,_0x3902e9['$job']=_0x3902e9,_0x3902e9;}['initPolicies'](_0x3504c2){const _0x9caf56=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x3504c2);_0x3504c2['metadata']['expire']=_0x9caf56;if(this['config']['persistent']!=undefined){const _0x3b831d=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x3504c2);_0x3504c2['metadata']['persistent']=_0x3b831d;}}['bindActivityData'](_0x50e770){this['context'][this['metadata']['aid']][_0x50e770]['data']=this['data'];}['resolveDad'](){let _0xd2c403=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0xd2c403=_0xd2c403['substring'](0x0,_0xd2c403['lastIndexOf'](','))+','+this['adjacentIndex']),_0xd2c403;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x4cdc7c=[],_0x19e15d=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x3fed6f=_0x19e15d['.'+this['metadata']['aid']],_0x1e5bde=this['resolveAdjacentDad']();if(_0x3fed6f)for(const _0x323433 in _0x3fed6f){const _0x433650=_0x3fed6f[_0x323433];mapper_1['MapperService']['evaluate'](_0x433650,this['context'],this['code'])&&_0x4cdc7c['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x1e5bde,'aid':_0x323433,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x4cdc7c;}['isJobComplete'](_0x3a46b2){return _0x3a46b2<=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'](_0x247202,_0x1e1261){if(this['jobWasInterrupted'](_0x1e1261))return;let _0x34948e=[];(this['shouldEmit']()||this['isJobComplete'](_0x1e1261)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x1e1261)&&!this['shouldPersistJob']()});if(_0x247202['length']&&!this['isJobComplete'](_0x1e1261)){const _0x5533db=this['store']['getMulti']();for(const _0x263d12 of _0x247202){await this['engine']['router']?.['publishMessage'](null,_0x263d12,_0x5533db);}_0x34948e=await _0x5533db['exec']();}return _0x34948e;}['jobWasInterrupted'](_0x474e38){return _0x474e38<-0x5f5e100;}}exports['Activity']=Activity;
|
|
1
|
+
'use strict';(function(_0x4b1300,_0x2869d8){const _0x163eac=_0x117f,_0x4209cd=_0x4b1300();while(!![]){try{const _0x3c16c0=-parseInt(_0x163eac(0x1a8))/0x1*(parseInt(_0x163eac(0x1a7))/0x2)+parseInt(_0x163eac(0x1ac))/0x3+-parseInt(_0x163eac(0x1ae))/0x4+parseInt(_0x163eac(0x1a9))/0x5+parseInt(_0x163eac(0x1aa))/0x6+-parseInt(_0x163eac(0x1ad))/0x7*(-parseInt(_0x163eac(0x1ab))/0x8)+-parseInt(_0x163eac(0x1af))/0x9;if(_0x3c16c0===_0x2869d8)break;else _0x4209cd['push'](_0x4209cd['shift']());}catch(_0x460e41){_0x4209cd['push'](_0x4209cd['shift']());}}}(_0x15f3,0x3e356));function _0x117f(_0x135f60,_0x5e33e7){const _0x15f3f3=_0x15f3();return _0x117f=function(_0x117f21,_0x524ec2){_0x117f21=_0x117f21-0x1a7;let _0x57b674=_0x15f3f3[_0x117f21];return _0x57b674;},_0x117f(_0x135f60,_0x5e33e7);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Activity']=void 0x0;const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream');function _0x15f3(){const _0x3f1e54=['1922205PwpzVf','2618154UvXkkW','8WJRlKO','358041GWrqEN','1889755iBOuhC','292736yqAhNn','4102407PqFeOa','7822cPxlEK','109QbZqTZ'];_0x15f3=function(){return _0x3f1e54;};return _0x15f3();}class Activity{constructor(_0x1e5c0b,_0x112dd3,_0x50dc7c,_0x5ebc84,_0x2fc507,_0x3dc578){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x1e5c0b,this['data']=_0x112dd3,this['metadata']=_0x50dc7c,this['hook']=_0x5ebc84,this['engine']=_0x2fc507,this['context']=_0x3dc578||{'data':{},'metadata':{}},this['logger']=_0x2fc507['logger'],this['store']=_0x2fc507['store'];}['setLeg'](_0x9170b5){this['leg']=_0x9170b5;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x3f8f82=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x3f8f82!==undefined&&!isNaN(Number(_0x3f8f82)))return _0x3f8f82;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x47f5ff=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x47f5ff);}catch(_0x4abeda){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x47f5ff>0x0){if(this['context']['metadata']['js']===_0x47f5ff){const _0x6de70d=await this['setStatus'](-_0x47f5ff);Number(_0x6de70d)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x4abeda;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0xae4d16=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,_0xae4d16);}async['processEvent'](_0x37ef49=stream_1['StreamStatus']['SUCCESS'],_0x4ae41c=0xc8,_0x3afaf1='output'){this['setLeg'](0x2);const _0x13fc13=this['context']['metadata']['jid'];if(!_0x13fc13){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x5f5eda=this['metadata']['aid'];this['status']=_0x37ef49,this['code']=_0x4ae41c,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x13fc13,'aid':_0x5f5eda,'status':_0x37ef49,'code':_0x4ae41c});let _0x235c42;try{const _0x4b2b22=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x4b2b22),_0x235c42=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x235c42['startActivitySpan'](this['leg']);let _0x541c4d;if(_0x37ef49===stream_1['StreamStatus']['PENDING'])_0x541c4d=await this['processPending'](_0x3afaf1);else _0x37ef49===stream_1['StreamStatus']['SUCCESS']?_0x541c4d=await this['processSuccess'](_0x3afaf1):_0x541c4d=await this['processError']();this['transitionAdjacent'](_0x541c4d,_0x235c42);}catch(_0xdf4a88){if(_0xdf4a88 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0xdf4a88['fault']+'-error',{..._0xdf4a88});return;}else{if(_0xdf4a88 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0xdf4a88});return;}else{if(_0xdf4a88 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0xdf4a88});return;}else{if(_0xdf4a88 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0xdf4a88});return;}}}}this['logger']['error']('activity-process-event-error',{..._0xdf4a88,'message':_0xdf4a88['message'],'stack':_0xdf4a88['stack'],'name':_0xdf4a88['name']}),_0x235c42?.['setActivityError'](_0xdf4a88['message']);throw _0xdf4a88;}finally{_0x235c42?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x13fc13,'aid':_0x5f5eda});}}async['processPending'](_0xdca878){this['bindActivityData'](_0xdca878),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x3000ba=this['store']['getMulti']();return await this['setState'](_0x3000ba),await collator_1['CollatorService']['notarizeContinuation'](this,_0x3000ba),await this['setStatus'](this['adjacencyList']['length'],_0x3000ba),await _0x3000ba['exec']();}async['processSuccess'](_0x5029a5){this['bindActivityData'](_0x5029a5),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x2c2a1f=this['store']['getMulti']();return await this['setState'](_0x2c2a1f),await collator_1['CollatorService']['notarizeCompletion'](this,_0x2c2a1f),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x2c2a1f),await _0x2c2a1f['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x2aa981=this['store']['getMulti']();return await this['setState'](_0x2aa981),await collator_1['CollatorService']['notarizeCompletion'](this,_0x2aa981),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x2aa981),await _0x2aa981['exec']();}async['transitionAdjacent'](_0x3f50b2,_0x4ee5f7){_0x4ee5f7['mapActivityAttributes']();const _0x43e444=this['resolveStatus'](_0x3f50b2),_0x2c1cc8={'app.job.jss':_0x43e444},_0x770918=await this['transition'](this['adjacencyList'],_0x43e444);_0x770918?.['length']&&(_0x2c1cc8['app.activity.mids']=_0x770918['join'](',')),_0x4ee5f7['setActivityAttributes'](_0x2c1cc8);}['resolveStatus'](_0x2f10bf){const _0x3a9c78=_0x2f10bf[_0x2f10bf['length']-0x1];return Array['isArray'](_0x3a9c78)?Number(_0x3a9c78[0x1]):Number(_0x3a9c78);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x175757=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x5b1f16=_0x175757['mapRules']();if(_0x5b1f16)for(const _0x6ab1bd in _0x5b1f16){const _0x167f2b=_0x6ab1bd['indexOf']('[');if(_0x167f2b>-0x1){const _0x4b93c3=_0x6ab1bd['substring'](_0x167f2b+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x4b93c3))){const _0x2b98f1=_0x6ab1bd['substring'](0x0,_0x167f2b);_0x5b1f16[_0x2b98f1]=_0x5b1f16[_0x6ab1bd],delete _0x5b1f16[_0x6ab1bd];}else{if(_0x4b93c3==='-'||_0x4b93c3==='_'){const _0x311661=_0x5b1f16[_0x6ab1bd];Object['keys'](_0x311661)['forEach'](_0x46433a=>{_0x5b1f16[_0x46433a]=_0x311661[_0x46433a];});}}}}this['context']['data']=_0x5b1f16;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x46cd12=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x46cd12['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x18ced0=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x5689ce=_0x18ced0['mapRules'](),_0x630ed5=this['metadata']['aid'],_0x1f8b09={...this['context'][_0x630ed5]['output'],..._0x5689ce};this['context'][_0x630ed5]['output']['data']=_0x1f8b09;}}async['registerTimeout'](){}['bindActivityError'](_0x4b2be3){const _0x29bbdc=this['context'][this['metadata']['aid']]['output']['metadata'];_0x29bbdc['err']=JSON['stringify'](this['data']),_0x29bbdc['$error']={..._0x4b2be3,'is_stream_error':!![]};}['bindJobError'](_0x57d614){this['context']['metadata']['err']=JSON['stringify']({..._0x57d614,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x2fd3db,_0x486a74){const {id:_0x273343}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x2fd3db,this['context']['metadata']['jid'],_0x273343,_0x486a74);}['authorizeEntry'](_0x1fa1e1){return this['adjacencyList']?.['map'](_0x1cd2ca=>{const {metadata:{aid:_0x53da39}}=_0x1cd2ca;return _0x1fa1e1[_0x53da39+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x53da39;})??[];}['bindDimensionalAddress'](_0x2a1112){const _0x54912c=this['resolveDad']();_0x2a1112[this['metadata']['aid']+'/output/metadata/dad']=_0x54912c;}async['setState'](_0x570c12){const _0xa976ff=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x2335a7={};await this['bindJobState'](_0x2335a7);const _0x327236=this['authorizeEntry'](_0x2335a7);this['bindDimensionalAddress'](_0x2335a7),this['bindActivityState'](_0x2335a7);const _0x22f236=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x327236],_0x1d3094=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x2335a7,this['getJobStatus'](),_0xa976ff,_0x22f236,_0x1d3094,_0x570c12);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x131004=this['context']['$self'];!_0x131004['output']['metadata']&&(_0x131004['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x131004['output']['metadata']['err']=JSON['stringify'](this['data']));const _0xddd5da=(0x0,utils_1['formatISODate'])(new Date());_0x131004['output']['metadata']['ac']=_0xddd5da,_0x131004['output']['metadata']['au']=_0xddd5da,_0x131004['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x131004['output']['metadata']['stp']=this['config']['subtype']),_0x131004['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x1a71b6){const _0x7ba6ee=await this['getTriggerConfig'](),_0x14340a=[..._0x7ba6ee['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x3bd077 of _0x14340a){const _0x52cc32=(0x0,utils_1['getValueByPath'])(this['context'],_0x3bd077);_0x52cc32!==undefined&&(_0x1a71b6[_0x3bd077]=_0x52cc32);}for(const _0x5209b2 in this['context']?.['data']??{}){(_0x5209b2['startsWith']('-')||_0x5209b2['startsWith']('_'))&&(_0x1a71b6[_0x5209b2]=this['context']['data'][_0x5209b2]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x1a71b6,this['config'],this['context']);}['bindActivityState'](_0x1d9431){const _0x30e5b9=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x539173 of _0x30e5b9){const _0x4b6e5f=this['metadata']['aid']+'/'+_0x539173,_0x5d3296=(0x0,utils_1['getValueByPath'])(this['context'],_0x4b6e5f);_0x5d3296!==undefined&&(_0x1d9431[_0x4b6e5f]=_0x5d3296);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x1d9431,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x5a70dc=>'metadata/'+_0x5a70dc);}['bindActivityMetadataPaths'](){const _0x3d4712=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x3d4712]['KEYS']['map'](_0x496e1b=>'output/metadata/'+_0x496e1b);}async['getState'](){const _0x46e483=this['context']['metadata']['gid'],_0x108e7c='$'+this['config']['subscribes'],_0x1c734e={[_0x108e7c]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x50ccb8=>'metadata/'+_0x50ccb8)};for(let [_0x2db636,_0x4aa80a]of Object['entries'](this['config']['consumes'])){if(_0x2db636==='$job')for(const _0x1faeef of _0x4aa80a){_0x1c734e[_0x108e7c]['push'](_0x1faeef);}else{_0x2db636==='$self'&&(_0x2db636=this['metadata']['aid']);!_0x1c734e[_0x2db636]&&(_0x1c734e[_0x2db636]=[]);for(const _0x265847 of _0x4aa80a){_0x1c734e[_0x2db636]['push'](_0x2db636+'/'+_0x265847);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x1c734e,this['config'],this['metadata'],this['leg']);const {dad:_0x2c13c8,jid:_0xc65cea}=this['context']['metadata'],_0x484d73=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x2c13c8||''),[_0x2b680b,_0x28f006]=await this['store']['getState'](_0xc65cea,_0x1c734e,_0x484d73);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x2b680b),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x46e483),this['initDimensionalAddress'](_0x2c13c8),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0xd821ce,_0x400386){if(_0x400386!==_0xd821ce)throw new errors_1['GenerationalError'](_0xd821ce,_0x400386,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x331c1e){this['metadata']['dad']=_0x331c1e;}['initSelf'](_0x463f04){const _0x27cb86=this['metadata']['aid'];!_0x463f04[_0x27cb86]&&(_0x463f04[_0x27cb86]={});const _0x466590=_0x463f04[_0x27cb86];return!_0x466590['output']&&(_0x466590['output']={}),!_0x466590['input']&&(_0x466590['input']={}),!_0x466590['hook']&&(_0x466590['hook']={}),!_0x466590['output']['metadata']&&(_0x466590['output']['metadata']={}),_0x466590['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x463f04['$self']=_0x466590,_0x463f04['$job']=_0x463f04,_0x463f04;}['initPolicies'](_0xf467ac){const _0x4c47b2=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0xf467ac);_0xf467ac['metadata']['expire']=_0x4c47b2;if(this['config']['persistent']!=undefined){const _0x32f74e=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0xf467ac);_0xf467ac['metadata']['persistent']=_0x32f74e;}}['bindActivityData'](_0x26ff39){this['context'][this['metadata']['aid']][_0x26ff39]['data']=this['data'];}['resolveDad'](){let _0x4670a8=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x4670a8=_0x4670a8['substring'](0x0,_0x4670a8['lastIndexOf'](','))+','+this['adjacentIndex']),_0x4670a8;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x889a38=[],_0x5f1b9a=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x4590d1=_0x5f1b9a['.'+this['metadata']['aid']],_0x28d2e5=this['resolveAdjacentDad']();if(_0x4590d1)for(const _0x2452b1 in _0x4590d1){const _0x29093f=_0x4590d1[_0x2452b1];mapper_1['MapperService']['evaluate'](_0x29093f,this['context'],this['code'])&&_0x889a38['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x28d2e5,'aid':_0x2452b1,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x889a38;}['isJobComplete'](_0x18db98){return _0x18db98<=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'](_0x5462cb,_0x4f28c5){if(this['jobWasInterrupted'](_0x4f28c5))return;let _0x2a8437=[];(this['shouldEmit']()||this['isJobComplete'](_0x4f28c5)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x4f28c5)&&!this['shouldPersistJob']()});if(_0x5462cb['length']&&!this['isJobComplete'](_0x4f28c5)){const _0x4683a4=this['store']['getMulti']();for(const _0x236827 of _0x5462cb){await this['engine']['router']?.['publishMessage'](null,_0x236827,_0x4683a4);}_0x2a8437=await _0x4683a4['exec']();}return _0x2a8437;}['jobWasInterrupted'](_0x4fd1da){return _0x4fd1da<-0x5f5e100;}}exports['Activity']=Activity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x4f7604,_0x26aff9){const _0x4e1448=_0xd5be,_0x40f651=_0x4f7604();while(!![]){try{const _0x4cd016=-parseInt(_0x4e1448(0xfd))/0x1*(-parseInt(_0x4e1448(0xfe))/0x2)+parseInt(_0x4e1448(0x103))/0x3*(parseInt(_0x4e1448(0xfc))/0x4)+-parseInt(_0x4e1448(0x106))/0x5+parseInt(_0x4e1448(0x102))/0x6*(parseInt(_0x4e1448(0x100))/0x7)+parseInt(_0x4e1448(0x101))/0x8+-parseInt(_0x4e1448(0xff))/0x9+-parseInt(_0x4e1448(0x105))/0xa*(parseInt(_0x4e1448(0x104))/0xb);if(_0x4cd016===_0x26aff9)break;else _0x40f651['push'](_0x40f651['shift']());}catch(_0x528b8c){_0x40f651['push'](_0x40f651['shift']());}}}(_0x12bd,0xe5347));function _0x12bd(){const _0x41e2c2=['7760968jeLmXA','5255364rFRFXk','255bLshCk','46123pcSqpd','5020xpOpbo','3960325OPRCPG','44684fgiHNR','1438768FDzHUC','2sxIJUd','3586896kDbEVR','7rWYJHt'];_0x12bd=function(){return _0x41e2c2;};return _0x12bd();}function _0xd5be(_0x3fb791,_0x37f0a8){const _0x12bd99=_0x12bd();return _0xd5be=function(_0xd5beda,_0x4cdee6){_0xd5beda=_0xd5beda-0xfc;let _0x55583d=_0x12bd99[_0xd5beda];return _0x55583d;},_0xd5be(_0x3fb791,_0x37f0a8);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Await']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream'),activity_1=require('./activity');class Await extends activity_1['Activity']{constructor(_0x369ba0,_0x42d250,_0x4b2c3a,_0x4c9b38,_0xb09480,_0x40b7c3){super(_0x369ba0,_0x42d250,_0x4b2c3a,_0x4c9b38,_0xb09480,_0x40b7c3);}async['process'](){this['logger']['debug']('await-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x1efa89;try{await this['verifyEntry'](),_0x1efa89=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x1efa89['startActivitySpan'](this['leg']),this['mapInputData']();const _0x3af7dc=this['store']['getMulti'](),_0x22e848=await this['execActivity'](_0x3af7dc);await collator_1['CollatorService']['authorizeReentry'](this,_0x3af7dc),await this['setState'](_0x3af7dc),await this['setStatus'](0x0,_0x3af7dc);const _0x2e29d9=await _0x3af7dc['exec']();_0x1efa89['mapActivityAttributes']();const _0x1cb660=this['resolveStatus'](_0x2e29d9);return _0x1efa89['setActivityAttributes']({'app.activity.mid':_0x22e848,'app.job.jss':_0x1cb660}),this['context']['metadata']['aid'];}catch(_0x129169){if(_0x129169 instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x129169});return;}else{if(_0x129169 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x129169});return;}else{if(_0x129169 instanceof errors_1['GetStateError']){this['logger']['error']('await-get-state-error',{..._0x129169});return;}else{if(_0x129169 instanceof errors_1['CollationError']){if(_0x129169['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',{..._0x129169});}else this['logger']['error']('await-process-error',{..._0x129169});}}}_0x1efa89?.['setActivityError'](_0x129169['message']);throw _0x129169;}finally{_0x1efa89?.['endActivitySpan'](),this['logger']['debug']('await-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x33d3fa){const _0xb2e6a=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x3d0837={'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':_0xb2e6a,'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 _0x232e98=pipe_1['Pipe']['resolve'](this['config']['await'],this['context']);_0x232e98===![]&&(_0x3d0837['metadata']['await']=![]);}return this['config']['retry']&&(_0x3d0837['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](null,_0x3d0837,_0x33d3fa);}}exports['Await']=Await;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x250934,_0xb6528b){const _0x1fe395=_0x3b39,_0x15a5ac=_0x250934();while(!![]){try{const _0x4ad532=-parseInt(_0x1fe395(0x1df))/0x1+parseInt(_0x1fe395(0x1e5))/0x2*(-parseInt(_0x1fe395(0x1e1))/0x3)+parseInt(_0x1fe395(0x1dd))/0x4*(parseInt(_0x1fe395(0x1de))/0x5)+-parseInt(_0x1fe395(0x1e6))/0x6*(parseInt(_0x1fe395(0x1dc))/0x7)+parseInt(_0x1fe395(0x1e2))/0x8+-parseInt(_0x1fe395(0x1e3))/0x9*(parseInt(_0x1fe395(0x1e7))/0xa)+parseInt(_0x1fe395(0x1e0))/0xb*(parseInt(_0x1fe395(0x1e4))/0xc);if(_0x4ad532===_0xb6528b)break;else _0x15a5ac['push'](_0x15a5ac['shift']());}catch(_0x22b767){_0x15a5ac['push'](_0x15a5ac['shift']());}}}(_0x2469,0x6d773));function _0x3b39(_0x30e217,_0x3d5da6){const _0x246940=_0x2469();return _0x3b39=function(_0x3b3945,_0x479322){_0x3b3945=_0x3b3945-0x1dc;let _0x10e8d9=_0x246940[_0x3b3945];return _0x10e8d9;},_0x3b39(_0x30e217,_0x3d5da6);}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(_0x1fdce8,_0x2a16e2,_0x331b0d,_0x2c0265,_0x5522f4,_0x4cf6d4){super(_0x1fdce8,_0x2a16e2,_0x331b0d,_0x2c0265,_0x5522f4,_0x4cf6d4);}async['process'](){this['logger']['debug']('cycle-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x3fdf32;try{await this['verifyEntry'](),_0x3fdf32=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x3fdf32['startActivitySpan'](this['leg']),this['mapInputData']();let _0x85e044=this['store']['getMulti']();await this['setState'](_0x85e044),await this['setStatus'](0x0,_0x85e044);const _0x4ca556=await _0x85e044['exec']();_0x3fdf32['mapActivityAttributes']();const _0x2557c5=this['resolveStatus'](_0x4ca556);_0x85e044=this['store']['getMulti']();const _0x3276ae=await this['cycleAncestorActivity'](_0x85e044);return _0x3fdf32['setActivityAttributes']({'app.activity.mid':_0x3276ae,'app.job.jss':_0x2557c5}),await collator_1['CollatorService']['notarizeEarlyExit'](this,_0x85e044),await _0x85e044['exec'](),this['context']['metadata']['aid'];}catch(_0x7ebca6){if(_0x7ebca6 instanceof errors_1['InactiveJobError']){this['logger']['error']('cycle-inactive-job-error',{..._0x7ebca6});return;}else{if(_0x7ebca6 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x7ebca6});return;}else{if(_0x7ebca6 instanceof errors_1['GetStateError']){this['logger']['error']('cycle-get-state-error',{..._0x7ebca6});return;}else{if(_0x7ebca6 instanceof errors_1['CollationError']){if(_0x7ebca6['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',{..._0x7ebca6});}else this['logger']['error']('cycle-process-error',{..._0x7ebca6});}}}_0x3fdf32?.['setActivityError'](_0x7ebca6['message']);throw _0x7ebca6;}finally{_0x3fdf32?.['endActivitySpan'](),this['logger']['debug']('cycle-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['cycleAncestorActivity'](_0x5ea1f7){this['mapInputData']();const _0x122475={'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,_0x122475,_0x5ea1f7);}}function _0x2469(){const _0x17cbdf=['142pULyNM','19806cUFoJi','53280WbxePQ','994tRurdi','227132ewNAtI','40logMgf','543706EmaDuZ','5480299uYEXfj','4905uxtxKn','1350768MzZWAs','72bGHAeu','24WWYlOq'];_0x2469=function(){return _0x17cbdf;};return _0x2469();}exports['Cycle']=Cycle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x2dd0d2,_0x3e40a6){const _0x2767e2=_0xc2b4,_0x55db08=_0x2dd0d2();while(!![]){try{const _0x30fe9e=parseInt(_0x2767e2(0xee))/0x1+-parseInt(_0x2767e2(0xf6))/0x2+parseInt(_0x2767e2(0xed))/0x3*(-parseInt(_0x2767e2(0xf4))/0x4)+-parseInt(_0x2767e2(0xf2))/0x5*(-parseInt(_0x2767e2(0xf0))/0x6)+-parseInt(_0x2767e2(0xf5))/0x7+-parseInt(_0x2767e2(0xf1))/0x8*(parseInt(_0x2767e2(0xf3))/0x9)+parseInt(_0x2767e2(0xef))/0xa*(parseInt(_0x2767e2(0xf7))/0xb);if(_0x30fe9e===_0x3e40a6)break;else _0x55db08['push'](_0x55db08['shift']());}catch(_0x50ca3d){_0x55db08['push'](_0x55db08['shift']());}}}(_0x3343,0x6c53a));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Hook']=void 0x0;function _0x3343(){const _0x4d4b38=['36wRCQIq','2526340MVLiPp','4276671JHuWDi','56044YjbrvB','1001bCskts','3FYJSDf','883003kGHpfY','58890kVeMHb','896544NdddtP','604664YMkFZe','20KMbBDY'];_0x3343=function(){return _0x4d4b38;};return _0x3343();}const 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'),enums_1=require('../../modules/enums'),activity_1=require('./activity');function _0xc2b4(_0x90a16e,_0x76d493){const _0x334373=_0x3343();return _0xc2b4=function(_0xc2b4b4,_0xa3b9b5){_0xc2b4b4=_0xc2b4b4-0xed;let _0x1dfc93=_0x334373[_0xc2b4b4];return _0x1dfc93;},_0xc2b4(_0x90a16e,_0x76d493);}class Hook extends activity_1['Activity']{constructor(_0x36d5f7,_0x5cafae,_0x1db6d4,_0x3e3416,_0x5e3898,_0x5e0bd1){super(_0x36d5f7,_0x5cafae,_0x1db6d4,_0x3e3416,_0x5e3898,_0x5e0bd1);}async['process'](){this['logger']['debug']('hook-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x4b816f;try{return await this['verifyEntry'](),_0x4b816f=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x4b816f['startActivitySpan'](this['leg']),this['doesHook']()?await this['doHook'](_0x4b816f):await this['doPassThrough'](_0x4b816f),this['context']['metadata']['aid'];}catch(_0x592f1d){if(_0x592f1d instanceof errors_1['InactiveJobError']){this['logger']['error']('hook-inactive-job-error',{..._0x592f1d});return;}else{if(_0x592f1d instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x592f1d});return;}else{if(_0x592f1d instanceof errors_1['GetStateError']){this['logger']['error']('hook-get-state-error',{..._0x592f1d});return;}else{if(_0x592f1d instanceof errors_1['CollationError']){if(_0x592f1d['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',{..._0x592f1d});}else this['logger']['error']('hook-process-error',{..._0x592f1d});}}}_0x4b816f?.['setActivityError'](_0x592f1d['message']);throw _0x592f1d;}finally{_0x4b816f?.['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 _0x959006=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return!isNaN(_0x959006)&&Number(_0x959006)>0x0;}return!!this['config']['hook']?.['topic'];}async['doHook'](_0x291b80){const _0x583556=this['store']['getMulti']();await this['registerHook'](enums_1['HMSH_IS_CLUSTER']?undefined:_0x583556),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x583556),await collator_1['CollatorService']['authorizeReentry'](this,_0x583556),await this['setStatus'](0x0,_0x583556),await _0x583556['exec'](),_0x291b80['mapActivityAttributes']();}async['doPassThrough'](_0x498b7d){const _0x31142f=this['store']['getMulti']();let _0x1c237d;this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x31142f),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x31142f),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x31142f),_0x1c237d=await _0x31142f['exec'](),_0x498b7d['mapActivityAttributes']();const _0x4371c9=this['resolveStatus'](_0x1c237d),_0x112106={'app.job.jss':_0x4371c9},_0x269371=await this['transition'](this['adjacencyList'],_0x4371c9);_0x269371['length']&&(_0x112106['app.activity.mids']=_0x269371['join'](',')),_0x498b7d['setActivityAttributes'](_0x112106);}async['getHookRule'](_0x15b3c1){const _0x52ec1b=await this['store']['getHookRules']();return _0x52ec1b?.[_0x15b3c1]?.[0x0];}async['registerHook'](_0x1d3f91){if(this['config']['hook']?.['topic'])return await this['engine']['taskService']['registerWebHook'](this['config']['hook']['topic'],this['context'],this['resolveDad'](),this['context']['metadata']['expire'],_0x1d3f91);else{if(this['config']['sleep']){const _0x227b01=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',_0x227b01,this['metadata']['dad']||''),this['context']['metadata']['jid'];}}}async['processWebHookEvent'](_0x19db3a=stream_1['StreamStatus']['SUCCESS'],_0x19be00=0xc8){this['logger']['debug']('hook-process-web-hook-event',{'topic':this['config']['hook']['topic'],'aid':this['metadata']['aid'],'status':_0x19db3a,'code':_0x19be00});const _0x3a41b9=new task_1['TaskService'](this['store'],this['logger']),_0x39021b={...this['data']},_0x76b032=await _0x3a41b9['processWebHookSignal'](this['config']['hook']['topic'],_0x39021b);if(_0x76b032){const [_0x439568,_0x26b3b0,_0x7ae9c9,_0x259f08]=_0x76b032;this['context']['metadata']['jid']=_0x439568,this['context']['metadata']['gid']=_0x259f08,this['context']['metadata']['dad']=_0x7ae9c9,await this['processEvent'](_0x19db3a,_0x19be00,'hook'),_0x19be00===0xc8&&await _0x3a41b9['deleteWebHookSignal'](this['config']['hook']['topic'],_0x39021b);}}async['processTimeHookEvent'](_0x12a4cc){this['logger']['debug']('hook-process-time-hook-event',{'jid':_0x12a4cc,'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']}),await this['processEvent'](stream_1['StreamStatus']['SUCCESS'],0xc8,'hook');}}exports['Hook']=Hook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x5391(){const _0x195724=['25885704rdufMO','608885yqIpmd','801800gxMkwV','1523487SpxrXG','6DMUFsN','3242244kCLxXY','1447314NwBKQt','140356Mtdfjt'];_0x5391=function(){return _0x195724;};return _0x5391();}(function(_0x1fa930,_0x45c3b5){const _0x7bad52=_0x42c8,_0x195965=_0x1fa930();while(!![]){try{const _0x5e8aa6=-parseInt(_0x7bad52(0x1f6))/0x1+-parseInt(_0x7bad52(0x1f5))/0x2+-parseInt(_0x7bad52(0x1f4))/0x3+-parseInt(_0x7bad52(0x1f1))/0x4+-parseInt(_0x7bad52(0x1f0))/0x5+parseInt(_0x7bad52(0x1f3))/0x6*(-parseInt(_0x7bad52(0x1f2))/0x7)+parseInt(_0x7bad52(0x1f7))/0x8;if(_0x5e8aa6===_0x45c3b5)break;else _0x195965['push'](_0x195965['shift']());}catch(_0x424cca){_0x195965['push'](_0x195965['shift']());}}}(_0x5391,0xb75ec));Object['defineProperty'](exports,'__esModule',{'value':!![]});const activity_1=require('./activity'),await_1=require('./await'),cycle_1=require('./cycle'),hook_1=require('./hook'),interrupt_1=require('./interrupt'),signal_1=require('./signal'),trigger_1=require('./trigger'),worker_1=require('./worker');function _0x42c8(_0x2e03ba,_0x247f76){const _0x5391b2=_0x5391();return _0x42c8=function(_0x42c8ef,_0x2e2dbb){_0x42c8ef=_0x42c8ef-0x1f0;let _0x545b4a=_0x5391b2[_0x42c8ef];return _0x545b4a;},_0x42c8(_0x2e03ba,_0x247f76);}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(_0x301704,_0x3997fc){const _0x1cb20c=_0x36f5,_0x3e0a00=_0x301704();while(!![]){try{const _0x3633a0=-parseInt(_0x1cb20c(0x92))/0x1*(parseInt(_0x1cb20c(0x90))/0x2)+-parseInt(_0x1cb20c(0x8f))/0x3+parseInt(_0x1cb20c(0x91))/0x4*(parseInt(_0x1cb20c(0x95))/0x5)+parseInt(_0x1cb20c(0x97))/0x6*(-parseInt(_0x1cb20c(0x93))/0x7)+-parseInt(_0x1cb20c(0x94))/0x8*(-parseInt(_0x1cb20c(0x96))/0x9)+parseInt(_0x1cb20c(0x98))/0xa+parseInt(_0x1cb20c(0x99))/0xb;if(_0x3633a0===_0x3997fc)break;else _0x3e0a00['push'](_0x3e0a00['shift']());}catch(_0x543f47){_0x3e0a00['push'](_0x3e0a00['shift']());}}}(_0x4f1e,0x3797e));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Interrupt']=void 0x0;function _0x36f5(_0x526d81,_0x323ee){const _0x4f1e7c=_0x4f1e();return _0x36f5=function(_0x36f54a,_0x5db277){_0x36f54a=_0x36f54a-0x8f;let _0x29509a=_0x4f1e7c[_0x36f54a];return _0x29509a;},_0x36f5(_0x526d81,_0x323ee);}function _0x4f1e(){const _0x58208c=['135fOiiSD','2852433JVkKcN','15048YmdHLd','1206100hEoJAc','5630427uLQxny','505527rZsRlM','12uRhPRk','6124PHxuyG','35551swKTHE','1064HdLbTn','8yzIuYl'];_0x4f1e=function(){return _0x58208c;};return _0x4f1e();}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(_0x56cfdf,_0x524880,_0x5eba67,_0x2b3d3f,_0x368289,_0x4174b8){super(_0x56cfdf,_0x524880,_0x5eba67,_0x2b3d3f,_0x368289,_0x4174b8);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x29bcea;try{await this['verifyEntry'](),_0x29bcea=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x29bcea['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0x29bcea):await this['interruptAnother'](_0x29bcea);}catch(_0x5561db){if(_0x5561db instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0x5561db});return;}else{if(_0x5561db instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x5561db});return;}else{if(_0x5561db instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0x5561db});return;}else{if(_0x5561db instanceof errors_1['CollationError']){if(_0x5561db['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',{..._0x5561db});}else this['logger']['error']('interrupt-process-error',{..._0x5561db});}}}_0x29bcea?.['setActivityError'](_0x5561db['message']);throw _0x5561db;}finally{_0x29bcea?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x5246b2){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x10b683=await this['interrupt']();_0x5246b2['mapActivityAttributes']();const _0x560d63=this['store']['getMulti']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x560d63),await this['setStatus'](-0x1,_0x560d63);const _0x51a8ee=await _0x560d63['exec'](),_0xf3afc4=this['resolveStatus'](_0x51a8ee);return _0x5246b2['setActivityAttributes']({'app.activity.mid':_0x10b683,'app.job.jss':_0xf3afc4}),this['context']['metadata']['aid'];}async['interruptAnother'](_0x584d6a){const _0x19467f=await this['interrupt'](),_0xeae409={'app.activity.mid':_0x19467f};_0x584d6a['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x1d2943=this['store']['getMulti']();await this['setState'](_0x1d2943);}const _0x116280=this['store']['getMulti']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x116280),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x116280);const _0xc4bd93=await _0x116280['exec'](),_0x500c0c=this['resolveStatus'](_0xc4bd93);_0xeae409['app.job.jss']=_0x500c0c;const _0x1e3bf4=await this['transition'](this['adjacencyList'],_0x500c0c);return _0x1e3bf4['length']&&(_0xeae409['app.activity.mids']=_0x1e3bf4['join'](',')),_0x584d6a['setActivityAttributes'](_0xeae409),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0x1a544f=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0x1a544f==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 _0x43ad5e=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'],_0x43ad5e);}}exports['Interrupt']=Interrupt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0xea8d60,_0x5b8d5f){const _0x1afaa1=_0x55b2,_0x291f08=_0xea8d60();while(!![]){try{const _0x549f52=-parseInt(_0x1afaa1(0x197))/0x1*(parseInt(_0x1afaa1(0x19c))/0x2)+-parseInt(_0x1afaa1(0x192))/0x3+-parseInt(_0x1afaa1(0x19b))/0x4*(parseInt(_0x1afaa1(0x196))/0x5)+parseInt(_0x1afaa1(0x19a))/0x6*(-parseInt(_0x1afaa1(0x19d))/0x7)+parseInt(_0x1afaa1(0x194))/0x8*(parseInt(_0x1afaa1(0x195))/0x9)+-parseInt(_0x1afaa1(0x198))/0xa*(-parseInt(_0x1afaa1(0x199))/0xb)+parseInt(_0x1afaa1(0x193))/0xc;if(_0x549f52===_0x5b8d5f)break;else _0x291f08['push'](_0x291f08['shift']());}catch(_0x3e7969){_0x291f08['push'](_0x291f08['shift']());}}}(_0x5b68,0xcfef2));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Signal']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');function _0x55b2(_0x2850cc,_0x2ab3c2){const _0x5b6896=_0x5b68();return _0x55b2=function(_0x55b2ec,_0x2a6c58){_0x55b2ec=_0x55b2ec-0x192;let _0x151270=_0x5b6896[_0x55b2ec];return _0x151270;},_0x55b2(_0x2850cc,_0x2ab3c2);}class Signal extends activity_1['Activity']{constructor(_0x4cc813,_0x14d508,_0x444681,_0x51cb74,_0x238404,_0x964bdb){super(_0x4cc813,_0x14d508,_0x444681,_0x51cb74,_0x238404,_0x964bdb);}async['process'](){this['logger']['debug']('signal-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x24d3b3;try{await this['verifyEntry'](),_0x24d3b3=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x24d3b3['startActivitySpan'](this['leg']);const _0x1bad07=this['store']['getMulti']();this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x1bad07),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x1bad07),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x1bad07);const _0x44367d=await _0x1bad07['exec']();this['config']['subtype']==='all'?await this['hookAll']():await this['hookOne']();const _0x1ed663=this['resolveStatus'](_0x44367d),_0x31dafa={'app.job.jss':_0x1ed663},_0x1f592f=await this['transition'](this['adjacencyList'],_0x1ed663);return _0x1f592f['length']&&(_0x31dafa['app.activity.mids']=_0x1f592f['join'](',')),_0x24d3b3['mapActivityAttributes'](),_0x24d3b3['setActivityAttributes'](_0x31dafa),this['context']['metadata']['aid'];}catch(_0x158490){if(_0x158490 instanceof errors_1['InactiveJobError']){this['logger']['error']('signal-inactive-job-error',{..._0x158490});return;}else{if(_0x158490 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x158490});return;}else{if(_0x158490 instanceof errors_1['GetStateError']){this['logger']['error']('signal-get-state-error',{..._0x158490});return;}else{if(_0x158490 instanceof errors_1['CollationError']){if(_0x158490['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',{..._0x158490});}else this['logger']['error']('signal-process-error',{..._0x158490});}}}_0x24d3b3?.['setActivityError'](_0x158490['message']);throw _0x158490;}finally{_0x24d3b3?.['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 _0x4e60a6=new mapper_1['MapperService'](this['config']['signal']['maps'],this['context']);return _0x4e60a6['mapRules']();}}['mapResolverData'](){if(this['config']['resolver']?.['maps']){const _0x1707e0=new mapper_1['MapperService'](this['config']['resolver']['maps'],this['context']);return _0x1707e0['mapRules']();}}async['hookOne'](){const _0x2e34a6=pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']),_0x3edf03=this['mapSignalData'](),_0x5aca39=pipe_1['Pipe']['resolve'](this['config']['status'],this['context']),_0x451643=pipe_1['Pipe']['resolve'](this['config']['code'],this['context']);return await this['engine']['hook'](_0x2e34a6,_0x3edf03,_0x5aca39,_0x451643);}async['hookAll'](){const _0x351831=this['mapSignalData'](),_0x1d6e00=this['mapResolverData']();this['config']['scrub']&&(_0x1d6e00['scrub']=!![]);const _0x7c4f1d=pipe_1['Pipe']['resolve'](this['config']['key_name'],this['context']),_0x27b7ad=pipe_1['Pipe']['resolve'](this['config']['key_value'],this['context']),_0x2380eb=[_0x7c4f1d+':'+_0x27b7ad];return await this['engine']['hookAll'](this['config']['topic'],_0x351831,_0x1d6e00,_0x2380eb);}}exports['Signal']=Signal;function _0x5b68(){const _0x56e95e=['20533176hWFtkU','379864xBJLUW','108HiMRAd','330555gFpYrk','119428UzVECy','20ATQMEN','3131711BrmdIU','12378IRhBfn','4EXboDr','12fadjXn','133nIpxxd','3530166IaWfWl'];_0x5b68=function(){return _0x56e95e;};return _0x5b68();}
|