@hotmeshio/hotmesh 0.3.9 → 0.3.11
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 +19 -10
- package/build/index.d.ts +2 -1
- package/build/index.js +3 -1
- package/build/modules/key.d.ts +4 -0
- package/build/modules/key.js +1 -1
- package/build/modules/utils.js +1 -1
- package/build/package.json +21 -17
- 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.d.ts +2 -1
- package/build/services/connector/factory.js +39 -18
- package/build/services/connector/index.d.ts +2 -0
- package/build/services/connector/index.js +2 -0
- package/build/services/connector/providers/nats.js +8 -2
- package/build/services/connector/providers/postgres.d.ts +1 -1
- package/build/services/connector/providers/postgres.js +18 -9
- 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/client.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.d.ts +3 -0
- 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/factory.d.ts +1 -1
- package/build/services/store/factory.js +9 -5
- package/build/services/store/index.d.ts +2 -1
- package/build/services/store/providers/postgres/kvsql.d.ts +155 -0
- package/build/services/store/providers/postgres/kvsql.js +1 -0
- package/build/services/store/providers/postgres/postgres.d.ts +107 -0
- package/build/services/store/providers/postgres/postgres.js +1 -0
- package/build/services/store/providers/redis/_base.d.ts +0 -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.d.ts +0 -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/factory.js +5 -1
- package/build/services/stream/providers/nats/nats.js +1 -1
- package/build/services/stream/providers/postgres/postgres.d.ts +72 -0
- package/build/services/stream/providers/postgres/postgres.js +1 -0
- 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/build/types/hotmesh.d.ts +4 -0
- package/build/types/index.d.ts +3 -1
- package/build/types/postgres.d.ts +31 -9
- package/build/types/provider.d.ts +44 -1
- package/index.ts +2 -0
- package/package.json +21 -17
- package/typedoc.json +6 -0
- package/types/hotmesh.ts +15 -0
- package/types/index.ts +54 -0
- package/types/nats.ts +12 -7
- package/types/postgres.ts +41 -10
- package/types/provider.ts +74 -3
- package/build/services/store/providers/postgres/types/hash.d.ts +0 -0
- package/build/services/store/providers/postgres/types/hash.js +0 -0
- package/build/services/store/providers/postgres/types/list.d.ts +0 -0
- package/build/services/store/providers/postgres/types/list.js +0 -0
- package/build/services/store/providers/postgres/types/string.d.ts +0 -0
- package/build/services/store/providers/postgres/types/string.js +0 -0
- package/build/services/store/providers/postgres/types/zset.d.ts +0 -0
- package/build/services/store/providers/postgres/types/zset.js +0 -0
- package/build/services/stream/providers/postgres/_deploy.d.ts +0 -5
- package/build/services/stream/providers/postgres/_deploy.js +0 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# HotMesh
|
|
2
2
|

|
|
3
3
|
|
|
4
|
-
**HotMesh** offers
|
|
4
|
+
**HotMesh** offers 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
5
|
|
|
6
6
|
*Note: This is a beta release and currently focuses on TypeScript/Redis.*
|
|
7
7
|
|
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
npm install @hotmeshio/hotmesh
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
You have a Redis instance? Good. You're ready to go.
|
|
23
|
-
|
|
24
22
|
## Learn
|
|
25
23
|
[📄 Docs](https://hotmeshio.github.io/sdk-typescript/) | [💼 Sample Projects](https://github.com/hotmeshio/samples-typescript) | [🎥 Intro (3m)](https://www.loom.com/share/211bd4b4038d42f0ba34374ef5b6f961?sid=7b889a56-f60f-4ccc-84e7-8c2697e548a9) | [🎥 Transactional Workflow (9m)](https://www.loom.com/share/54ffd5266baf4ac6b287578abfd1d821?sid=0db2cef8-ef0d-4e02-a0b7-a1ee14f476ce)
|
|
26
24
|
|
|
@@ -44,7 +42,7 @@ You have a Redis instance? Good. You're ready to go.
|
|
|
44
42
|
export const runMyCron = async (id: string, interval = '0 0 * * *'): Promise<boolean> => {
|
|
45
43
|
return await MeshCall.cron({
|
|
46
44
|
topic: 'my.cron.function',
|
|
47
|
-
|
|
45
|
+
connection: {
|
|
48
46
|
class: Redis,
|
|
49
47
|
options: { url: 'redis://:key_admin@redis:6379' }
|
|
50
48
|
},
|
|
@@ -78,7 +76,7 @@ You have a Redis instance? Good. You're ready to go.
|
|
|
78
76
|
|
|
79
77
|
MeshCall.interrupt({
|
|
80
78
|
topic: 'my.cron.function',
|
|
81
|
-
|
|
79
|
+
connection: {
|
|
82
80
|
class: Redis,
|
|
83
81
|
options: { url: 'redis://:key_admin@redis:6379' }
|
|
84
82
|
},
|
|
@@ -103,7 +101,7 @@ You have a Redis instance? Good. You're ready to go.
|
|
|
103
101
|
export const connectMyFunction = async () => {
|
|
104
102
|
return await MeshCall.connect({
|
|
105
103
|
topic: 'my.demo.function',
|
|
106
|
-
|
|
104
|
+
connection: {
|
|
107
105
|
class: Redis,
|
|
108
106
|
options: { url: 'redis://:key_admin@redis:6379' }
|
|
109
107
|
},
|
|
@@ -132,7 +130,7 @@ You have a Redis instance? Good. You're ready to go.
|
|
|
132
130
|
const result = await MeshCall.exec({
|
|
133
131
|
topic: 'my.demo.function',
|
|
134
132
|
args: ['something'],
|
|
135
|
-
|
|
133
|
+
connection: {
|
|
136
134
|
class: Redis,
|
|
137
135
|
options: { url: 'redis://:key_admin@redis:6379' }
|
|
138
136
|
},
|
|
@@ -155,7 +153,7 @@ You have a Redis instance? Good. You're ready to go.
|
|
|
155
153
|
const result = await MeshCall.exec({
|
|
156
154
|
topic: 'my.demo.function',
|
|
157
155
|
args: ['anything'],
|
|
158
|
-
|
|
156
|
+
connection: {
|
|
159
157
|
class: Redis,
|
|
160
158
|
options: { url: 'redis://:key_admin@redis:6379' }
|
|
161
159
|
},
|
|
@@ -171,7 +169,7 @@ You have a Redis instance? Good. You're ready to go.
|
|
|
171
169
|
|
|
172
170
|
await MeshCall.flush({
|
|
173
171
|
topic: 'my.demo.function',
|
|
174
|
-
|
|
172
|
+
connection: {
|
|
175
173
|
class: Redis,
|
|
176
174
|
options: { url: 'redis://:key_admin@redis:6379' }
|
|
177
175
|
},
|
|
@@ -701,8 +699,19 @@ This example demonstrates how to search for those workflows where a given condit
|
|
|
701
699
|
```
|
|
702
700
|
</details>
|
|
703
701
|
|
|
702
|
+
## Visualize | OpenTelemetry
|
|
703
|
+
HotMesh's telemetry output provides unmatched insight into long-running, x-service transactions. Add your Honeycomb credentials to any project using HotMesh and HotMesh will emit the full *OpenTelemetry* execution tree organized as a DAG.
|
|
704
|
+
|
|
705
|
+
## Visualize | HotMesh Dashboard
|
|
706
|
+
The HotMesh dashboard provides a detailed overview of all running workflows. An LLM is included to simplify querying and analyzing workflow data for those deployments that include the Redis `FT.SEARCH` module.
|
|
707
|
+
|
|
708
|
+
## Visualize | RedisInsight
|
|
709
|
+
View commands, streams, data, CPU, load, etc using the RedisInsight data browser.
|
|
710
|
+
|
|
704
711
|
## Samples
|
|
705
|
-
Refer to the [hotmeshio/samples-typescript](https://github.com/hotmeshio/samples-typescript) Git repo for *tutorials* and instructions on deploying the *HotMesh Dashboard
|
|
712
|
+
Refer to the [hotmeshio/samples-typescript](https://github.com/hotmeshio/samples-typescript) Git repo for *tutorials* and instructions on deploying the *HotMesh Dashboard* for visualizing workflows and managing network health.
|
|
713
|
+
|
|
714
|
+
Refer to the [hotmeshio/temporal-patterns-typescript](https://github.com/hotmeshio/temporal-patterns-typescript) Git repo for examples of common Temporal.io patterns implemented using HotMesh.
|
|
706
715
|
|
|
707
716
|
## Advanced
|
|
708
717
|
The theory that underlies the architecture is applicable to any number of data storage and streaming backends: [A Message-Oriented Approach to Decentralized Process Orchestration](https://zenodo.org/records/12168558).
|
package/build/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { MeshData } from './services/meshdata';
|
|
|
7
7
|
import { MeshOS } from './services/meshos';
|
|
8
8
|
import * as Errors from './modules/errors';
|
|
9
9
|
import * as Utils from './modules/utils';
|
|
10
|
+
import { ConnectorService as Connector } from './services/connector/factory';
|
|
10
11
|
declare const Client: typeof import("./services/meshflow/client").ClientService, Connection: typeof import("./services/meshflow/connection").ConnectionService, Search: typeof import("./services/meshflow/search").Search, Worker: typeof import("./services/meshflow/worker").WorkerService, workflow: typeof import("./services/meshflow/workflow").WorkflowService;
|
|
11
|
-
export { Client, Connection, Errors, HotMesh, HotMeshConfig, MeshCall, MeshData, MeshFlow, MeshOS, Search, Utils, Worker, workflow, WorkflowHandle, };
|
|
12
|
+
export { Client, Connection, Connector, Errors, HotMesh, HotMeshConfig, MeshCall, MeshData, MeshFlow, MeshOS, Search, Utils, Worker, workflow, WorkflowHandle, };
|
|
12
13
|
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.WorkflowHandle = exports.workflow = exports.Worker = exports.Utils = exports.Search = exports.MeshOS = exports.MeshFlow = exports.MeshData = exports.MeshCall = exports.HotMesh = exports.Errors = exports.Connection = exports.Client = void 0;
|
|
26
|
+
exports.Types = exports.WorkflowHandle = exports.workflow = exports.Worker = exports.Utils = exports.Search = exports.MeshOS = exports.MeshFlow = exports.MeshData = exports.MeshCall = exports.HotMesh = exports.Errors = exports.Connector = exports.Connection = exports.Client = 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");
|
|
@@ -40,6 +40,8 @@ const Errors = __importStar(require("./modules/errors"));
|
|
|
40
40
|
exports.Errors = Errors;
|
|
41
41
|
const Utils = __importStar(require("./modules/utils"));
|
|
42
42
|
exports.Utils = Utils;
|
|
43
|
+
const factory_1 = require("./services/connector/factory");
|
|
44
|
+
Object.defineProperty(exports, "Connector", { enumerable: true, get: function () { return factory_1.ConnectorService; } });
|
|
43
45
|
const { Client, Connection, Search, Worker, workflow } = meshflow_1.MeshFlow;
|
|
44
46
|
exports.Client = Client;
|
|
45
47
|
exports.Connection = Connection;
|
package/build/modules/key.d.ts
CHANGED
|
@@ -6,5 +6,9 @@ declare const WEBSEP = "::";
|
|
|
6
6
|
declare const TYPSEP = "::";
|
|
7
7
|
declare class KeyService {
|
|
8
8
|
static mintKey(namespace: string, keyType: KeyType, params: KeyStoreParams): string;
|
|
9
|
+
static parseKey(key: string): Record<string, string | undefined>;
|
|
10
|
+
static reconstituteKey(parts: Record<string, string | undefined>): string;
|
|
11
|
+
static resolveEntityType(abbreviation: string, id?: string): string;
|
|
12
|
+
static resolveAbbreviation(entity: string): string;
|
|
9
13
|
}
|
|
10
14
|
export { KeyService, KeyType, KeyStoreParams, HMNS, KEYSEP, TYPSEP, WEBSEP, VALSEP, };
|
package/build/modules/key.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x414fec,_0x4b6a92){const _0x1374da=_0x56b1,_0x2ef3c6=_0x414fec();while(!![]){try{const _0x225463=-parseInt(_0x1374da(0x90))/0x1*(parseInt(_0x1374da(0x8d))/0x2)+-parseInt(_0x1374da(0x8f))/0x3*(-parseInt(_0x1374da(0x91))/0x4)+parseInt(_0x1374da(0x8b))/0x5+parseInt(_0x1374da(0x93))/0x6+parseInt(_0x1374da(0x95))/0x7*(parseInt(_0x1374da(0x92))/0x8)+parseInt(_0x1374da(0x8c))/0x9*(-parseInt(_0x1374da(0x94))/0xa)+-parseInt(_0x1374da(0x8e))/0xb;if(_0x225463===_0x4b6a92)break;else _0x2ef3c6['push'](_0x2ef3c6['shift']());}catch(_0x106df1){_0x2ef3c6['push'](_0x2ef3c6['shift']());}}}(_0x2438,0x9f799));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=':';function _0x2438(){const _0x3089cc=['8844649tlayQW','98229ZUDdQR','99039gIZIQC','16MJXlqs','8103688dEXwhD','1773012tKWtZx','584450IxFwPN','7nAJbyC','4838145CJhNEF','9IcmBBi','18oLdUqu'];_0x2438=function(){return _0x3089cc;};return _0x2438();}exports['KEYSEP']=KEYSEP;function _0x56b1(_0x5ec26c,_0x96186c){const _0x243820=_0x2438();return _0x56b1=function(_0x56b1ae,_0xf19c20){_0x56b1ae=_0x56b1ae-0x8b;let _0x5a88cc=_0x243820[_0x56b1ae];return _0x5a88cc;},_0x56b1(_0x5ec26c,_0x96186c);}const VALSEP='::';exports['VALSEP']=VALSEP;const WEBSEP='::';exports['WEBSEP']=WEBSEP;const TYPSEP='::';exports['TYPSEP']=TYPSEP;class KeyService{static['mintKey'](_0x16926a,_0x16323a,_0x2afd29){switch(_0x16323a){case hotmesh_1['KeyType']['HOTMESH']:return _0x16926a;case hotmesh_1['KeyType']['THROTTLE_RATE']:return _0x16926a+':'+_0x2afd29['appId']+':r:';case hotmesh_1['KeyType']['WORK_ITEMS']:return _0x16926a+':'+_0x2afd29['appId']+':w:'+(_0x2afd29['scoutType']||'');case hotmesh_1['KeyType']['TIME_RANGE']:return _0x16926a+':'+_0x2afd29['appId']+':t:'+(_0x2afd29['timeValue']||'');case hotmesh_1['KeyType']['APP']:return _0x16926a+':a:'+(_0x2afd29['appId']||'');case hotmesh_1['KeyType']['QUORUM']:return _0x16926a+':'+_0x2afd29['appId']+':q:'+(_0x2afd29['engineId']||'');case hotmesh_1['KeyType']['JOB_STATE']:return _0x16926a+':'+_0x2afd29['appId']+':j:'+_0x2afd29['jobId'];case hotmesh_1['KeyType']['JOB_DEPENDENTS']:return _0x16926a+':'+_0x2afd29['appId']+':d:'+_0x2afd29['jobId'];case hotmesh_1['KeyType']['JOB_STATS_GENERAL']:return _0x16926a+':'+_0x2afd29['appId']+':s:'+_0x2afd29['jobKey']+':'+_0x2afd29['dateTime'];case hotmesh_1['KeyType']['JOB_STATS_MEDIAN']:return _0x16926a+':'+_0x2afd29['appId']+':s:'+_0x2afd29['jobKey']+':'+_0x2afd29['dateTime']+':'+_0x2afd29['facet'];case hotmesh_1['KeyType']['JOB_STATS_INDEX']:return _0x16926a+':'+_0x2afd29['appId']+':s:'+_0x2afd29['jobKey']+':'+_0x2afd29['dateTime']+':'+_0x2afd29['facet'];case hotmesh_1['KeyType']['SCHEMAS']:return _0x16926a+':'+_0x2afd29['appId']+':v:'+_0x2afd29['appVersion']+':schemas';case hotmesh_1['KeyType']['SUBSCRIPTIONS']:return _0x16926a+':'+_0x2afd29['appId']+':v:'+_0x2afd29['appVersion']+':subscriptions';case hotmesh_1['KeyType']['SUBSCRIPTION_PATTERNS']:return _0x16926a+':'+_0x2afd29['appId']+':v:'+_0x2afd29['appVersion']+':transitions';case hotmesh_1['KeyType']['HOOKS']:return _0x16926a+':'+_0x2afd29['appId']+':hooks';case hotmesh_1['KeyType']['SIGNALS']:return _0x16926a+':'+_0x2afd29['appId']+':signals';case hotmesh_1['KeyType']['SYMKEYS']:return _0x16926a+':'+_0x2afd29['appId']+':sym:keys:'+(_0x2afd29['activityId']||'');case hotmesh_1['KeyType']['SYMVALS']:return _0x16926a+':'+_0x2afd29['appId']+':sym:vals:';case hotmesh_1['KeyType']['STREAMS']:return _0x16926a+':'+(_0x2afd29['appId']||'')+':x:'+(_0x2afd29['topic']||'');default:throw new Error('Invalid\x20key\x20type.');}}static['parseKey'](_0x22b734){const [_0x314354,_0x259e84,_0x2d5380,..._0x143bfc]=_0x22b734['split'](KEYSEP),_0x591ced=_0x143bfc['join'](KEYSEP)||'';return{'namespace':_0x314354,'app':_0x2d5380==='a'?_0x259e84:undefined,'entity':_0x2d5380,'id':_0x591ced};}static['reconstituteKey'](_0x39f139){const {namespace:_0x322ecf,app:_0x17f489,entity:_0x2b984b,id:_0x78c976}=_0x39f139;return''+_0x322ecf+KEYSEP+_0x17f489+KEYSEP+_0x2b984b+KEYSEP+(_0x78c976||'');}static['resolveEntityType'](_0x37b85c,_0x1c4d06=''){switch(_0x37b85c){case'a':return'applications';case'r':return'throttles';case'w':return _0x1c4d06===''?'task_priorities':'roles';case't':return _0x1c4d06===''?'task_schedules':'task_lists';case'q':return'events';case'j':return'jobs';case's':return'stats';case'v':return'versions';case'x':return _0x1c4d06===''?'streams':'stream_topics';case'hooks':return'signal_patterns';case'signals':return'signal_registry';case'sym':return'symbols';default:return'unknown_entity';}}static['resolveAbbreviation'](_0x358e1e){switch(_0x358e1e){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(_0x45bfc0,_0x11e1f3){const _0x2870c8=_0x4a57,_0x23d189=_0x45bfc0();while(!![]){try{const _0x479cab=-parseInt(_0x2870c8(0xce))/0x1+parseInt(_0x2870c8(0xd4))/0x2+-parseInt(_0x2870c8(0xd6))/0x3*(-parseInt(_0x2870c8(0xd8))/0x4)+-parseInt(_0x2870c8(0xd2))/0x5*(parseInt(_0x2870c8(0xcf))/0x6)+-parseInt(_0x2870c8(0xd7))/0x7+parseInt(_0x2870c8(0xd5))/0x8*(-parseInt(_0x2870c8(0xd1))/0x9)+parseInt(_0x2870c8(0xd0))/0xa*(parseInt(_0x2870c8(0xd3))/0xb);if(_0x479cab===_0x11e1f3)break;else _0x23d189['push'](_0x23d189['shift']());}catch(_0x4e2779){_0x23d189['push'](_0x23d189['shift']());}}}(_0x2649,0xc73c8));var __importDefault=this&&this['__importDefault']||function(_0x131a46){return _0x131a46&&_0x131a46['__esModule']?_0x131a46:{'default':_0x131a46};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['isStreamMessage']=exports['parseStreamMessage']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['identifyRedisTypeFromClass']=exports['polyfill']=exports['identifyProvider']=exports['XSleepFor']=exports['sleepImmediate']=exports['sleepFor']=exports['guid']=exports['deterministicRandom']=exports['deepCopy']=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),logger_1=require('../services/logger'),enums_1=require('./enums'),logger=new logger_1['LoggerService']('hotmesh','utils'),hashOptions=_0x40fe61=>{const _0xfd645d=JSON['stringify'](_0x40fe61);return(0x0,crypto_1['createHash'])('sha256')['update'](_0xfd645d)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x415d6f=os_1['default']['totalmem'](),_0x38e520=os_1['default']['freemem'](),_0x2b0d32=_0x415d6f-_0x38e520,_0x4f4ebc={'TotalMemoryGB':(_0x415d6f/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x38e520/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x2b0d32/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x4f4ebc;}function _0x2649(){const _0x462fa3=['17248810lXglYF','7083189xsfQrr','9080ZIAUwm','22UxsUPH','3043634ZAKufq','8RuPlfa','444GBjnnF','9286746QDVSOC','2972pMDMbQ','818828JhUWlK','4404BAfZvt'];_0x2649=function(){return _0x462fa3;};return _0x2649();}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x5b4c4a){return JSON['parse'](JSON['stringify'](_0x5b4c4a));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x10323c){const _0x2fc64e=Math['sin'](_0x10323c)*0x2710;return _0x2fc64e-Math['floor'](_0x2fc64e);}exports['deterministicRandom']=deterministicRandom;function guid(_0x4487c0=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x4487c0);}exports['guid']=guid;async function sleepFor(_0x2f7603){return new Promise(_0x36e02a=>setTimeout(_0x36e02a,_0x2f7603));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x5f505c=>setImmediate(_0x5f505c));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0x563244){let _0x1ac433;const _0x4024f1=new Promise(_0xd16c23=>{_0x1ac433=setTimeout(_0xd16c23,_0x563244);});return{'promise':_0x4024f1,'timerId':_0x1ac433};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x1f81d5){const _0x48da22=Object['getPrototypeOf'](_0x1f81d5);if(_0x1f81d5['constructor']&&_0x1f81d5['constructor']['name']==='Client')return'nats';else{if(_0x1f81d5['constructor']&&_0x1f81d5['constructor']['name']==='Pool')return'postgres';else{if('defineCommand'in _0x48da22||Object['keys'](_0x48da22)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x48da22)['includes']('Multi'))return'redis';}}}if(_0x1f81d5['constructor']){if(_0x1f81d5['constructor']['name']==='Redis'||_0x1f81d5['constructor']['name']==='EventEmitter'){if('hset'in _0x1f81d5)return'ioredis';}else{if(_0x1f81d5['constructor']['name']==='ProviderClient'||_0x1f81d5['constructor']['name']==='Commander'){if('HSET'in _0x1f81d5)return'redis';}}}if(Object['keys'](_0x1f81d5)['includes']('Pipeline'))return'ioredis';else{if(Object['keys'](_0x1f81d5)['includes']('createClient'))return'redis';}return null;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x1550ad){return _0x1550ad==='activity'?'hook':_0x1550ad;},'providerConfig'(_0x4bd74a){return _0x4bd74a?.['connection']??_0x4bd74a?.['redis'];},'meshDataConfig'(_0x461d38){return _0x461d38?.['connection']??{'class':_0x461d38?.['redisClass'],'options':_0x461d38?.['redisOptions']};}};function identifyRedisTypeFromClass(_0x182b48){if(_0x182b48&&_0x182b48['name']==='Redis'||_0x182b48['name']==='EventEmitter')return'ioredis';else{if(_0x182b48&&'createClient'in _0x182b48)return'redis';}return null;}exports['identifyRedisTypeFromClass']=identifyRedisTypeFromClass;function matchesStatusCode(_0x4c10b3,_0xb0589b){if(typeof _0xb0589b==='string'){const _0x5c633='^'+_0xb0589b['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x5c633)['test'](_0x4c10b3['toString']());}return _0xb0589b['test'](_0x4c10b3['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x27dcad,_0x10bbbf){return _0x27dcad===_0x10bbbf;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x19c656,_0x5691c8){for(const [_0x28983b,_0x1791d7]of Object['entries'](_0x19c656)){if(_0x1791d7['hasOwnProperty'](_0x5691c8)){const _0x49ff8c=findTopKey(_0x19c656,_0x28983b['replace'](/^\./,''));return(_0x49ff8c||_0x28983b)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x56dbeb,_0x168467){for(const [_0x107ba8,_0x2c0e0b]of Object['entries'](_0x56dbeb)){if(_0x2c0e0b===_0x168467)return _0x107ba8;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x5a3f6e,_0x1bc1d5,_0x187030){const _0x272199=await _0x1bc1d5['getTransitions'](_0x187030),_0x542169=await _0x1bc1d5['getSubscriptions'](_0x187030),_0x1c5376=findTopKey(_0x272199,_0x5a3f6e),_0x274052=findSubscriptionForTrigger(_0x542169,_0x1c5376);return _0x274052;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x1e7f3f){if(_0x1e7f3f['toString']()==='infinity')return'0';const _0x102844=new Date(),_0x3984f4=_0x1e7f3f['slice'](-0x1),_0x3f85c2=parseInt(_0x1e7f3f['slice'](0x0,-0x1),0xa);if(_0x3984f4==='m'){const _0x169391=Math['floor'](_0x102844['getMinutes']()/_0x3f85c2)*_0x3f85c2;_0x102844['setUTCMinutes'](_0x169391,0x0,0x0);}else _0x3984f4==='h'&&_0x102844['setUTCMinutes'](0x0,0x0,0x0);return _0x102844['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}function _0x4a57(_0x31bce1,_0x156cb0){const _0x264909=_0x2649();return _0x4a57=function(_0x4a577c,_0x23de28){_0x4a577c=_0x4a577c-0xce;let _0x4aa10a=_0x264909[_0x4a577c];return _0x4aa10a;},_0x4a57(_0x31bce1,_0x156cb0);}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x4ff3ae){const _0x3b3278=_0x4ff3ae instanceof Date?_0x4ff3ae:new Date(_0x4ff3ae);return _0x3b3278['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x407141){const _0x4ea70e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x56afe4=_0x4ea70e['length'];if(_0x407141<0x0||_0x407141>=Math['pow'](_0x56afe4,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x221a2e,_0x329d60]=divmod(_0x407141,_0x56afe4),[_0x551bb7,_0x2d6bb5]=divmod(_0x221a2e,_0x56afe4);return _0x4ea70e[_0x551bb7]+_0x4ea70e[_0x329d60]+_0x4ea70e[_0x2d6bb5];}exports['getSymKey']=getSymKey;function getSymVal(_0xe4fce1){const _0x3d90e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x3d6bf5=_0x3d90e['length'];if(_0xe4fce1<0x0||_0xe4fce1>=Math['pow'](_0x3d6bf5,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x556cd6,_0x59445a]=divmod(_0xe4fce1,_0x3d6bf5);return _0x3d90e[_0x556cd6]+_0x3d90e[_0x59445a];}exports['getSymVal']=getSymVal;function divmod(_0xb8b5a0,_0x5b18be){return[Math['floor'](_0xb8b5a0/_0x5b18be),_0xb8b5a0%_0x5b18be];}function getIndexedHash(_0x2c1ef4,_0x36f45a){const _0x494191=_0x2c1ef4[_0x36f45a]||0x0,_0x35dbb7={..._0x2c1ef4};return delete _0x35dbb7[_0x36f45a],[_0x494191,_0x35dbb7];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x43ddc0,_0x18cc4e){const _0x3d63a1=_0x18cc4e['split']('/');let _0x2cc982=_0x43ddc0;for(const _0x281b71 of _0x3d63a1){if(_0x2cc982[_0x281b71]!==undefined)_0x2cc982=_0x2cc982[_0x281b71];else return undefined;}return _0x2cc982;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x2eb9e1){const _0x4381f1={};for(const _0x1e1da0 in _0x2eb9e1){if(_0x2eb9e1[_0x1e1da0]===undefined)continue;const _0x164013=_0x1e1da0['split']('/');let _0x275bb3=_0x4381f1;for(let _0x580344=0x0;_0x580344<_0x164013['length'];_0x580344++){_0x580344===_0x164013['length']-0x1?_0x275bb3[_0x164013[_0x580344]]=_0x2eb9e1[_0x1e1da0]:(_0x275bb3[_0x164013[_0x580344]]=_0x275bb3[_0x164013[_0x580344]]||{},_0x275bb3=_0x275bb3[_0x164013[_0x580344]]);}}return _0x4381f1;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x319f20){const _0x49cb7a=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x49cb7a['test'](_0x319f20);}exports['isValidCron']=isValidCron;const s=_0xa67070=>{return(0x0,ms_1['default'])(_0xa67070)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x4bcb59=>{try{return JSON['parse'](_0x4bcb59);}catch(_0x2a9207){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x2a9207});throw _0x2a9207;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0x5212df=>{return Array['isArray'](_0x5212df)&&Array['isArray'](_0x5212df[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x31e527=>{const _0x3dc165=[];let _0x4c570f;for(let _0x580040=0x1;_0x580040<_0x31e527['length'];_0x580040++){const _0x517883=_0x31e527[_0x580040],_0x26642c={};if(Array['isArray'](_0x517883)){for(let _0x3f89b3=0x0;_0x3f89b3<_0x517883['length'];_0x3f89b3+=0x2){const _0x11e19f=_0x517883[_0x3f89b3],_0x25ae2d=_0x517883[_0x3f89b3+0x1];_0x26642c[_0x11e19f]=_0x25ae2d;}_0x4c570f&&(_0x26642c['$']=_0x4c570f),_0x3dc165['push'](_0x26642c),_0x4c570f=undefined;}else _0x4c570f=_0x517883;}return _0x3dc165;};exports['arrayToHash']=arrayToHash;
|
|
1
|
+
'use strict';(function(_0x3ff2b5,_0xdcbdaf){const _0x5b9d3a=_0x26a8,_0x1f4c40=_0x3ff2b5();while(!![]){try{const _0x554312=parseInt(_0x5b9d3a(0xac))/0x1*(-parseInt(_0x5b9d3a(0xa7))/0x2)+parseInt(_0x5b9d3a(0xae))/0x3*(-parseInt(_0x5b9d3a(0xad))/0x4)+-parseInt(_0x5b9d3a(0xa4))/0x5+-parseInt(_0x5b9d3a(0xab))/0x6*(-parseInt(_0x5b9d3a(0xa8))/0x7)+parseInt(_0x5b9d3a(0xa9))/0x8+-parseInt(_0x5b9d3a(0xa6))/0x9+-parseInt(_0x5b9d3a(0xa5))/0xa*(-parseInt(_0x5b9d3a(0xaa))/0xb);if(_0x554312===_0xdcbdaf)break;else _0x1f4c40['push'](_0x1f4c40['shift']());}catch(_0x4ced60){_0x1f4c40['push'](_0x1f4c40['shift']());}}}(_0x1a9f,0x63351));var __importDefault=this&&this['__importDefault']||function(_0x3fa36e){return _0x3fa36e&&_0x3fa36e['__esModule']?_0x3fa36e:{'default':_0x3fa36e};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['isStreamMessage']=exports['parseStreamMessage']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['identifyRedisTypeFromClass']=exports['polyfill']=exports['identifyProvider']=exports['XSleepFor']=exports['sleepImmediate']=exports['sleepFor']=exports['guid']=exports['deterministicRandom']=exports['deepCopy']=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),logger_1=require('../services/logger'),enums_1=require('./enums'),logger=new logger_1['LoggerService']('hotmesh','utils'),hashOptions=_0x1ff00b=>{const _0x4dbc16=JSON['stringify'](_0x1ff00b);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x4dbc16)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x446aeb=os_1['default']['totalmem'](),_0x11eb65=os_1['default']['freemem'](),_0x500e04=_0x446aeb-_0x11eb65,_0x2df003={'TotalMemoryGB':(_0x446aeb/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x11eb65/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x500e04/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x2df003;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x4a5841){return JSON['parse'](JSON['stringify'](_0x4a5841));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x5ef778){const _0x5d3213=Math['sin'](_0x5ef778)*0x2710;return _0x5d3213-Math['floor'](_0x5d3213);}exports['deterministicRandom']=deterministicRandom;function guid(_0x4164d0=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x4164d0);}exports['guid']=guid;async function sleepFor(_0x3a343c){return new Promise(_0x1dc9b6=>setTimeout(_0x1dc9b6,_0x3a343c));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x397900=>setImmediate(_0x397900));}exports['sleepImmediate']=sleepImmediate;function _0x26a8(_0x495ed4,_0x109f77){const _0x1a9f4f=_0x1a9f();return _0x26a8=function(_0x26a8f4,_0x4967d5){_0x26a8f4=_0x26a8f4-0xa4;let _0x2590af=_0x1a9f4f[_0x26a8f4];return _0x2590af;},_0x26a8(_0x495ed4,_0x109f77);}function XSleepFor(_0x2481d5){let _0x41ba3c;const _0x53d4ed=new Promise(_0x244acd=>{_0x41ba3c=setTimeout(_0x244acd,_0x2481d5);});return{'promise':_0x53d4ed,'timerId':_0x41ba3c};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x19f256){const _0x2a3d9b=Object['getPrototypeOf'](_0x19f256);if(_0x19f256['Query']?.['prototype']||Object['keys'](_0x19f256)['includes']('database'))return'postgres';else{if(_0x19f256['constructor']&&_0x19f256['constructor']['name']==='Client')return'nats';else{if('defineCommand'in _0x2a3d9b||Object['keys'](_0x2a3d9b)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x2a3d9b)['includes']('Multi'))return'redis';}}}if(_0x19f256['constructor']){if(_0x19f256['constructor']['name']==='Redis'||_0x19f256['constructor']['name']==='EventEmitter'){if('hset'in _0x19f256)return'ioredis';}else{if(_0x19f256['constructor']['name']==='ProviderClient'||_0x19f256['constructor']['name']==='Commander'){if('HSET'in _0x19f256)return'redis';}}}let _0x55ab25=null;if(Object['keys'](_0x19f256)['includes']('connection'))_0x55ab25='postgres';else{if(Object['keys'](_0x19f256)['includes']('Pipeline'))_0x55ab25='ioredis';else{if(Object['keys'](_0x19f256)['includes']('createClient'))_0x55ab25='redis';else Object['keys'](_0x19f256)['includes']('jetstream')&&(_0x55ab25='nats');}}return _0x55ab25;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x5e24dd){return _0x5e24dd==='activity'?'hook':_0x5e24dd;},'providerConfig'(_0x4ea563){return _0x4ea563?.['connection']??_0x4ea563?.['redis'];},'meshDataConfig'(_0x5dce2d){return _0x5dce2d?.['connection']??{'class':_0x5dce2d?.['redisClass'],'options':_0x5dce2d?.['redisOptions']};}};function identifyRedisTypeFromClass(_0x3cf34c){if(_0x3cf34c&&_0x3cf34c['name']==='Redis'||_0x3cf34c['name']==='EventEmitter')return'ioredis';else{if(_0x3cf34c&&'createClient'in _0x3cf34c)return'redis';}return null;}exports['identifyRedisTypeFromClass']=identifyRedisTypeFromClass;function matchesStatusCode(_0x5081a5,_0x181ef4){if(typeof _0x181ef4==='string'){const _0x2cab7d='^'+_0x181ef4['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x2cab7d)['test'](_0x5081a5['toString']());}return _0x181ef4['test'](_0x5081a5['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x1e265a,_0x5076ab){return _0x1e265a===_0x5076ab;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x49ae58,_0x7a5b21){for(const [_0x347c7c,_0xd2d815]of Object['entries'](_0x49ae58)){if(_0xd2d815['hasOwnProperty'](_0x7a5b21)){const _0x23425a=findTopKey(_0x49ae58,_0x347c7c['replace'](/^\./,''));return(_0x23425a||_0x347c7c)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x488f21,_0x3ddbec){for(const [_0x1d09cc,_0x1b93e7]of Object['entries'](_0x488f21)){if(_0x1b93e7===_0x3ddbec)return _0x1d09cc;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x4eeca,_0xc33f85,_0x4b1ff4){const _0x3d61f1=await _0xc33f85['getTransitions'](_0x4b1ff4),_0x55fbfa=await _0xc33f85['getSubscriptions'](_0x4b1ff4),_0x59a03e=findTopKey(_0x3d61f1,_0x4eeca),_0x46bd11=findSubscriptionForTrigger(_0x55fbfa,_0x59a03e);return _0x46bd11;}exports['getSubscriptionTopic']=getSubscriptionTopic;function _0x1a9f(){const _0xc8b003=['2202840yaFlfl','8486nonaSE','7LCuKXl','436424OPexRJ','22ocVkVG','2423802bUxgiq','164BmYxxu','358044AnbZbz','21TuheiU','3563140CCIAIN','11138250VfFPRG'];_0x1a9f=function(){return _0xc8b003;};return _0x1a9f();}function getTimeSeries(_0x1ce8ad){if(_0x1ce8ad['toString']()==='infinity')return'0';const _0x33ccb3=new Date(),_0x4d2225=_0x1ce8ad['slice'](-0x1),_0x5db396=parseInt(_0x1ce8ad['slice'](0x0,-0x1),0xa);if(_0x4d2225==='m'){const _0x4ef70b=Math['floor'](_0x33ccb3['getMinutes']()/_0x5db396)*_0x5db396;_0x33ccb3['setUTCMinutes'](_0x4ef70b,0x0,0x0);}else _0x4d2225==='h'&&_0x33ccb3['setUTCMinutes'](0x0,0x0,0x0);return _0x33ccb3['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x43992c){const _0x1346a0=_0x43992c instanceof Date?_0x43992c:new Date(_0x43992c);return _0x1346a0['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x4bdf81){const _0x59ab39='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x359439=_0x59ab39['length'];if(_0x4bdf81<0x0||_0x4bdf81>=Math['pow'](_0x359439,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x521fe1,_0x9fe410]=divmod(_0x4bdf81,_0x359439),[_0x1022b0,_0xcc7d5b]=divmod(_0x521fe1,_0x359439);return _0x59ab39[_0x1022b0]+_0x59ab39[_0x9fe410]+_0x59ab39[_0xcc7d5b];}exports['getSymKey']=getSymKey;function getSymVal(_0x1f7aeb){const _0x34db25='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x483339=_0x34db25['length'];if(_0x1f7aeb<0x0||_0x1f7aeb>=Math['pow'](_0x483339,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x247552,_0x17d6a5]=divmod(_0x1f7aeb,_0x483339);return _0x34db25[_0x247552]+_0x34db25[_0x17d6a5];}exports['getSymVal']=getSymVal;function divmod(_0x26c319,_0x4e7a51){return[Math['floor'](_0x26c319/_0x4e7a51),_0x26c319%_0x4e7a51];}function getIndexedHash(_0x3c2b44,_0x25561f){const _0xaa3552=_0x3c2b44[_0x25561f]||0x0,_0x2cfaf2={..._0x3c2b44};return delete _0x2cfaf2[_0x25561f],[_0xaa3552,_0x2cfaf2];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x5287d3,_0xe2b7c0){const _0xb79ef3=_0xe2b7c0['split']('/');let _0x7cc04d=_0x5287d3;for(const _0x59ef65 of _0xb79ef3){if(_0x7cc04d[_0x59ef65]!==undefined)_0x7cc04d=_0x7cc04d[_0x59ef65];else return undefined;}return _0x7cc04d;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x7a3cc5){const _0x3929ed={};for(const _0x2cb18a in _0x7a3cc5){if(_0x7a3cc5[_0x2cb18a]===undefined)continue;const _0x220d1c=_0x2cb18a['split']('/');let _0x4fbb12=_0x3929ed;for(let _0x2f674b=0x0;_0x2f674b<_0x220d1c['length'];_0x2f674b++){_0x2f674b===_0x220d1c['length']-0x1?_0x4fbb12[_0x220d1c[_0x2f674b]]=_0x7a3cc5[_0x2cb18a]:(_0x4fbb12[_0x220d1c[_0x2f674b]]=_0x4fbb12[_0x220d1c[_0x2f674b]]||{},_0x4fbb12=_0x4fbb12[_0x220d1c[_0x2f674b]]);}}return _0x3929ed;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x21ec65){const _0x3c9262=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x3c9262['test'](_0x21ec65);}exports['isValidCron']=isValidCron;const s=_0x4a1217=>{return(0x0,ms_1['default'])(_0x4a1217)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x42203d=>{try{return JSON['parse'](_0x42203d);}catch(_0x16abb0){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x16abb0});throw _0x16abb0;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0xac6fc5=>{return Array['isArray'](_0xac6fc5)&&Array['isArray'](_0xac6fc5[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x48d338=>{const _0x1b4be5=[];let _0x46bfc2;for(let _0x2560ff=0x1;_0x2560ff<_0x48d338['length'];_0x2560ff++){const _0x35379d=_0x48d338[_0x2560ff],_0x5d925b={};if(Array['isArray'](_0x35379d)){for(let _0x10a71f=0x0;_0x10a71f<_0x35379d['length'];_0x10a71f+=0x2){const _0x5c849b=_0x35379d[_0x10a71f],_0x2c5c3d=_0x35379d[_0x10a71f+0x1];_0x5d925b[_0x5c849b]=_0x2c5c3d;}_0x46bfc2&&(_0x5d925b['$']=_0x46bfc2),_0x1b4be5['push'](_0x5d925b),_0x46bfc2=undefined;}else _0x46bfc2=_0x35379d;}return _0x1b4be5;};exports['arrayToHash']=arrayToHash;
|
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/hotmesh",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "Unbreakable Workflows",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/hotmeshio/sdk-typescript.git"
|
|
10
10
|
},
|
|
11
|
-
"homepage": "https://github.
|
|
11
|
+
"homepage": "https://hotmeshio.github.io/sdk-typescript/",
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
@@ -22,12 +22,14 @@
|
|
|
22
22
|
"lint:fix": "eslint . --fix --ext .ts",
|
|
23
23
|
"start": "ts-node src/index.ts",
|
|
24
24
|
"test": "NODE_ENV=test jest --detectOpenHandles --forceExit --verbose",
|
|
25
|
-
"test:await": "NODE_ENV=test jest ./tests/functional/awaiter
|
|
25
|
+
"test:await": "NODE_ENV=test jest ./tests/functional/awaiter/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
26
26
|
"test:compile": "NODE_ENV=test jest ./tests/functional/compile/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
27
|
-
"test:connect": "NODE_ENV=test jest ./tests/unit/services/connector
|
|
27
|
+
"test:connect": "NODE_ENV=test jest ./tests/unit/services/connector/* --detectOpenHandles --forceExit --verbose",
|
|
28
28
|
"test:connect:ioredis": "NODE_ENV=test jest ./tests/unit/services/connector/providers/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
29
|
+
"test:connect:postgres": "NODE_ENV=test jest ./tests/unit/services/connector/providers/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
29
30
|
"test:connect:redis": "NODE_ENV=test jest ./tests/unit/services/connector/providers/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
30
|
-
"test:
|
|
31
|
+
"test:connect:nats": "NODE_ENV=test jest ./tests/unit/services/connector/providers/nats.test.ts --detectOpenHandles --forceExit --verbose",
|
|
32
|
+
"test:cycle": "NODE_ENV=test jest ./tests/functional/cycle/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
31
33
|
"test:meshflow": "NODE_ENV=test jest ./tests/meshflow/*/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
32
34
|
"test:meshflow:basic": "NODE_ENV=test jest ./tests/meshflow/basic/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
33
35
|
"test:meshflow:collision": "NODE_ENV=test HMSH_LOGLEVEL=debug jest ./tests/meshflow/collision/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
@@ -44,26 +46,27 @@
|
|
|
44
46
|
"test:meshflow:unknown": "NODE_ENV=test jest ./tests/meshflow/unknown/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
45
47
|
"test:emit": "NODE_ENV=test jest ./tests/functional/emit/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
46
48
|
"test:pending": "NODE_ENV=test jest ./tests/functional/pending/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
47
|
-
"test:functional": "NODE_ENV=test jest ./tests/functional
|
|
48
|
-
"test:hmsh": "NODE_ENV=test jest ./tests/functional
|
|
49
|
+
"test:functional": "NODE_ENV=test jest ./tests/functional/* --detectOpenHandles --forceExit --verbose",
|
|
50
|
+
"test:hmsh": "NODE_ENV=test jest ./tests/functional/*.test.ts --detectOpenHandles --verbose --forceExit",
|
|
49
51
|
"test:hook": "NODE_ENV=test jest ./tests/functional/hook/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
50
52
|
"test:interrupt": "NODE_ENV=test jest ./tests/functional/interrupt/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
51
53
|
"test:parallel": "NODE_ENV=test jest ./tests/functional/parallel/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
52
54
|
"test:pipe": "NODE_ENV=test jest ./tests/unit/services/pipe/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
53
|
-
"test:quorum": "HMSH_IS_CLUSTER=true NODE_ENV=test jest ./tests/functional/quorum
|
|
55
|
+
"test:quorum": "HMSH_IS_CLUSTER=true NODE_ENV=test jest ./tests/functional/quorum/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
54
56
|
"test:reclaim": "NODE_ENV=test jest ./tests/functional/reclaim/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
55
|
-
"test:redeploy": "NODE_ENV=test jest ./tests/functional/redeploy
|
|
57
|
+
"test:redeploy": "NODE_ENV=test jest ./tests/functional/redeploy/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
56
58
|
"test:reporter": "NODE_ENV=test jest ./tests/unit/services/reporter/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
57
59
|
"test:reentrant": "NODE_ENV=test jest ./tests/functional/reentrant/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
58
60
|
"test:retry": "NODE_ENV=test jest ./tests/functional/retry/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
59
|
-
"test:sequence": "NODE_ENV=test jest ./tests/functional/sequence
|
|
61
|
+
"test:sequence": "NODE_ENV=test HMSH_LOGLEVEL=debug jest ./tests/functional/sequence/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
60
62
|
"test:signal": "NODE_ENV=test jest ./tests/functional/signal/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
61
63
|
"test:status": "NODE_ENV=test jest ./tests/functional/status/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
62
64
|
"test:store:ioredis": "NODE_ENV=test jest ./tests/functional/store/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
63
65
|
"test:store:redis": "NODE_ENV=test jest ./tests/functional/store/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
66
|
+
"test:store:postgres": "NODE_ENV=test jest ./tests/functional/store/providers/postgres/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
64
67
|
"test:stream:ioredis": "NODE_ENV=test jest ./tests/functional/stream/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
65
68
|
"test:stream:redis": "NODE_ENV=test jest ./tests/functional/stream/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
66
|
-
"test:stream:postgres": "NODE_ENV=test jest ./tests/functional/stream/providers/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
69
|
+
"test:stream:postgres": "NODE_ENV=test jest ./tests/functional/stream/providers/postgres/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
67
70
|
"test:stream:nats": "NODE_ENV=test jest ./tests/functional/stream/providers/nats/nats.test.ts --detectOpenHandles --forceExit --verbose",
|
|
68
71
|
"test:sub:ioredis": "NODE_ENV=test jest ./tests/functional/sub/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
69
72
|
"test:sub:redis": "NODE_ENV=test jest ./tests/functional/sub/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
@@ -93,11 +96,13 @@
|
|
|
93
96
|
"js-yaml": "^4.1.0",
|
|
94
97
|
"ms": "^2.1.3",
|
|
95
98
|
"nanoid": "^3.3.6",
|
|
99
|
+
"pg-format": "^1.0.4",
|
|
96
100
|
"winston": "^3.8.2"
|
|
97
101
|
},
|
|
98
102
|
"devDependencies": {
|
|
99
103
|
"@types/jest": "^29.5.0",
|
|
100
104
|
"@types/node": "^18.15.11",
|
|
105
|
+
"@types/pg": "^8.10.0",
|
|
101
106
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
102
107
|
"@typescript-eslint/parser": "^5.62.0",
|
|
103
108
|
"eslint": "^8.57.0",
|
|
@@ -107,21 +112,20 @@
|
|
|
107
112
|
"ioredis": "^5.3.2",
|
|
108
113
|
"javascript-obfuscator": "^4.1.1",
|
|
109
114
|
"jest": "^29.5.0",
|
|
115
|
+
"nats": "^2.28.0",
|
|
116
|
+
"pg": "^8.10.0",
|
|
110
117
|
"redis": "^4.6.13",
|
|
111
118
|
"rimraf": "^4.4.1",
|
|
112
119
|
"ts-jest": "^29.0.5",
|
|
113
120
|
"ts-node": "^10.9.1",
|
|
114
121
|
"ts-node-dev": "^2.0.0",
|
|
115
122
|
"typedoc": "^0.26.4",
|
|
116
|
-
"typescript": "^5.0.4"
|
|
117
|
-
"@types/pg": "^8.10.0",
|
|
118
|
-
"nats": "^2.28.0",
|
|
119
|
-
"pg": "^8.10.0"
|
|
123
|
+
"typescript": "^5.0.4"
|
|
120
124
|
},
|
|
121
125
|
"peerDependencies": {
|
|
122
126
|
"ioredis": "^4.0.0 || ^5.0.0",
|
|
123
|
-
"redis": "^4.0.0",
|
|
124
127
|
"nats": "^2.0.0",
|
|
125
|
-
"pg": "^8.0.0"
|
|
128
|
+
"pg": "^8.0.0",
|
|
129
|
+
"redis": "^4.0.0"
|
|
126
130
|
}
|
|
127
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x133a55,_0x4b432b){const _0x5b97c5=_0x5550,_0x5d8699=_0x133a55();while(!![]){try{const _0x2a028d=-parseInt(_0x5b97c5(0x17d))/0x1*(parseInt(_0x5b97c5(0x17a))/0x2)+-parseInt(_0x5b97c5(0x182))/0x3*(parseInt(_0x5b97c5(0x183))/0x4)+parseInt(_0x5b97c5(0x17e))/0x5*(parseInt(_0x5b97c5(0x184))/0x6)+-parseInt(_0x5b97c5(0x180))/0x7*(-parseInt(_0x5b97c5(0x17b))/0x8)+parseInt(_0x5b97c5(0x17c))/0x9+parseInt(_0x5b97c5(0x17f))/0xa*(-parseInt(_0x5b97c5(0x181))/0xb)+parseInt(_0x5b97c5(0x185))/0xc;if(_0x2a028d===_0x4b432b)break;else _0x5d8699['push'](_0x5d8699['shift']());}catch(_0x528ea8){_0x5d8699['push'](_0x5d8699['shift']());}}}(_0x100a,0x5e3bd));function _0x5550(_0x4ec0c4,_0x213e0b){const _0x100a77=_0x100a();return _0x5550=function(_0x555092,_0x13d9af){_0x555092=_0x555092-0x17a;let _0x1c042f=_0x100a77[_0x555092];return _0x1c042f;},_0x5550(_0x4ec0c4,_0x213e0b);}function _0x100a(){const _0x1de467=['396218kGtdLy','460rPWWaN','230rbNNUh','5663mRxUoN','296747MmszvV','3BczUJg','2210332LdMVxW','21540cAqWXn','8232288hxGItq','2CyhVaC','3496gwjZgh','5268744IXtxjH'];_0x100a=function(){return _0x1de467;};return _0x100a();}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(_0x52f788,_0x5522ed,_0x2ad1a4,_0x396a4e,_0x1f1fc3,_0x34e213){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x52f788,this['data']=_0x5522ed,this['metadata']=_0x2ad1a4,this['hook']=_0x396a4e,this['engine']=_0x1f1fc3,this['context']=_0x34e213||{'data':{},'metadata':{}},this['logger']=_0x1f1fc3['logger'],this['store']=_0x1f1fc3['store'];}['setLeg'](_0x388c60){this['leg']=_0x388c60;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0xcfd367=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0xcfd367!==undefined&&!isNaN(Number(_0xcfd367)))return _0xcfd367;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x16cca9=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x16cca9);}catch(_0x18f526){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x16cca9>0x0){if(this['context']['metadata']['js']===_0x16cca9){const _0x5112e2=await this['setStatus'](-_0x16cca9);Number(_0x5112e2)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x18f526;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x214d1d=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,_0x214d1d);}async['processEvent'](_0x5c667d=stream_1['StreamStatus']['SUCCESS'],_0x2d07c4=0xc8,_0x2789e1='output'){this['setLeg'](0x2);const _0x9a1b4d=this['context']['metadata']['jid'];if(!_0x9a1b4d){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x2d3c36=this['metadata']['aid'];this['status']=_0x5c667d,this['code']=_0x2d07c4,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x9a1b4d,'aid':_0x2d3c36,'status':_0x5c667d,'code':_0x2d07c4});let _0x5ed797;try{const _0x2d4360=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x2d4360),_0x5ed797=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x5ed797['startActivitySpan'](this['leg']);let _0x524c24;if(_0x5c667d===stream_1['StreamStatus']['PENDING'])_0x524c24=await this['processPending'](_0x2789e1);else _0x5c667d===stream_1['StreamStatus']['SUCCESS']?_0x524c24=await this['processSuccess'](_0x2789e1):_0x524c24=await this['processError']();this['transitionAdjacent'](_0x524c24,_0x5ed797);}catch(_0x12ddb0){if(_0x12ddb0 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x12ddb0['fault']+'-error',{..._0x12ddb0});return;}else{if(_0x12ddb0 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x12ddb0});return;}else{if(_0x12ddb0 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x12ddb0});return;}else{if(_0x12ddb0 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x12ddb0});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x12ddb0,'message':_0x12ddb0['message'],'stack':_0x12ddb0['stack'],'name':_0x12ddb0['name']}),_0x5ed797?.['setActivityError'](_0x12ddb0['message']);throw _0x12ddb0;}finally{_0x5ed797?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x9a1b4d,'aid':_0x2d3c36});}}async['processPending'](_0x10a633){this['bindActivityData'](_0x10a633),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x4263b2=this['store']['transact']();return await this['setState'](_0x4263b2),await collator_1['CollatorService']['notarizeContinuation'](this,_0x4263b2),await this['setStatus'](this['adjacencyList']['length'],_0x4263b2),await _0x4263b2['exec']();}async['processSuccess'](_0x5c3bd8){this['bindActivityData'](_0x5c3bd8),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0xb4b682=this['store']['transact']();return await this['setState'](_0xb4b682),await collator_1['CollatorService']['notarizeCompletion'](this,_0xb4b682),await this['setStatus'](this['adjacencyList']['length']-0x1,_0xb4b682),await _0xb4b682['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0xcfbde2=this['store']['transact']();return await this['setState'](_0xcfbde2),await collator_1['CollatorService']['notarizeCompletion'](this,_0xcfbde2),await this['setStatus'](this['adjacencyList']['length']-0x1,_0xcfbde2),await _0xcfbde2['exec']();}async['transitionAdjacent'](_0x2fdace,_0x45f415){_0x45f415['mapActivityAttributes']();const _0x52cf0a=this['resolveStatus'](_0x2fdace),_0x23926b={'app.job.jss':_0x52cf0a},_0x33a6f4=await this['transition'](this['adjacencyList'],_0x52cf0a);_0x33a6f4?.['length']&&(_0x23926b['app.activity.mids']=_0x33a6f4['join'](',')),_0x45f415['setActivityAttributes'](_0x23926b);}['resolveStatus'](_0x3b2771){const _0x42826c=_0x3b2771[_0x3b2771['length']-0x1];return Array['isArray'](_0x42826c)?Number(_0x42826c[0x1]):Number(_0x42826c);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x140614=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x406ffc=_0x140614['mapRules']();if(_0x406ffc)for(const _0x42f0d1 in _0x406ffc){const _0x23fa81=_0x42f0d1['indexOf']('[');if(_0x23fa81>-0x1){const _0x394d3a=_0x42f0d1['substring'](_0x23fa81+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x394d3a))){const _0x20aebc=_0x42f0d1['substring'](0x0,_0x23fa81);_0x406ffc[_0x20aebc]=_0x406ffc[_0x42f0d1],delete _0x406ffc[_0x42f0d1];}else{if(_0x394d3a==='-'||_0x394d3a==='_'){const _0x465d47=_0x406ffc[_0x42f0d1];Object['keys'](_0x465d47)['forEach'](_0xf6ade2=>{_0x406ffc[_0xf6ade2]=_0x465d47[_0xf6ade2];});}}}}this['context']['data']=_0x406ffc;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x29d616=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x29d616['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x56bd2c=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x64db49=_0x56bd2c['mapRules'](),_0x2a3676=this['metadata']['aid'],_0x1db18d={...this['context'][_0x2a3676]['output'],..._0x64db49};this['context'][_0x2a3676]['output']['data']=_0x1db18d;}}async['registerTimeout'](){}['bindActivityError'](_0x657673){const _0x22369e=this['context'][this['metadata']['aid']]['output']['metadata'];_0x22369e['err']=JSON['stringify'](this['data']),_0x22369e['$error']={..._0x657673,'is_stream_error':!![]};}['bindJobError'](_0x322842){this['context']['metadata']['err']=JSON['stringify']({..._0x322842,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x5e5955,_0x32689b){const {id:_0x19d059}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x5e5955,this['context']['metadata']['jid'],_0x19d059,_0x32689b);}['authorizeEntry'](_0x3de968){return this['adjacencyList']?.['map'](_0x5b0459=>{const {metadata:{aid:_0x8a9bc}}=_0x5b0459;return _0x3de968[_0x8a9bc+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x8a9bc;})??[];}['bindDimensionalAddress'](_0x5a7429){const _0x127f63=this['resolveDad']();_0x5a7429[this['metadata']['aid']+'/output/metadata/dad']=_0x127f63;}async['setState'](_0x40c919){const _0x5c86c0=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x2daa2f={};await this['bindJobState'](_0x2daa2f);const _0x1d7240=this['authorizeEntry'](_0x2daa2f);this['bindDimensionalAddress'](_0x2daa2f),this['bindActivityState'](_0x2daa2f);const _0x1fa803=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x1d7240],_0x316355=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x2daa2f,this['getJobStatus'](),_0x5c86c0,_0x1fa803,_0x316355,_0x40c919);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x13d810=this['context']['$self'];!_0x13d810['output']['metadata']&&(_0x13d810['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x13d810['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x1f6aa8=(0x0,utils_1['formatISODate'])(new Date());_0x13d810['output']['metadata']['ac']=_0x1f6aa8,_0x13d810['output']['metadata']['au']=_0x1f6aa8,_0x13d810['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x13d810['output']['metadata']['stp']=this['config']['subtype']),_0x13d810['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x3c2d3a){const _0x1e98bd=await this['getTriggerConfig'](),_0x51e0f1=[..._0x1e98bd['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x3497d0 of _0x51e0f1){const _0x26358f=(0x0,utils_1['getValueByPath'])(this['context'],_0x3497d0);_0x26358f!==undefined&&(_0x3c2d3a[_0x3497d0]=_0x26358f);}for(const _0x46d6a6 in this['context']?.['data']??{}){(_0x46d6a6['startsWith']('-')||_0x46d6a6['startsWith']('_'))&&(_0x3c2d3a[_0x46d6a6]=this['context']['data'][_0x46d6a6]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x3c2d3a,this['config'],this['context']);}['bindActivityState'](_0x230378){const _0x47eafc=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x358ade of _0x47eafc){const _0x1c3766=this['metadata']['aid']+'/'+_0x358ade,_0x4952b2=(0x0,utils_1['getValueByPath'])(this['context'],_0x1c3766);_0x4952b2!==undefined&&(_0x230378[_0x1c3766]=_0x4952b2);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x230378,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x49c6fa=>'metadata/'+_0x49c6fa);}['bindActivityMetadataPaths'](){const _0x51f006=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x51f006]['KEYS']['map'](_0x469c0d=>'output/metadata/'+_0x469c0d);}async['getState'](){const _0x534fab=this['context']['metadata']['gid'],_0x3dfff2='$'+this['config']['subscribes'],_0x34c2b5={[_0x3dfff2]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x74f755=>'metadata/'+_0x74f755)};for(let [_0x3d6072,_0x2a7d07]of Object['entries'](this['config']['consumes'])){if(_0x3d6072==='$job')for(const _0x193898 of _0x2a7d07){_0x34c2b5[_0x3dfff2]['push'](_0x193898);}else{_0x3d6072==='$self'&&(_0x3d6072=this['metadata']['aid']);!_0x34c2b5[_0x3d6072]&&(_0x34c2b5[_0x3d6072]=[]);for(const _0x1c17a4 of _0x2a7d07){_0x34c2b5[_0x3d6072]['push'](_0x3d6072+'/'+_0x1c17a4);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x34c2b5,this['config'],this['metadata'],this['leg']);const {dad:_0x382c72,jid:_0x223cf3}=this['context']['metadata'],_0x1ba84a=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x382c72||''),[_0x2cfe88,_0x521d1e]=await this['store']['getState'](_0x223cf3,_0x34c2b5,_0x1ba84a);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x2cfe88),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x534fab),this['initDimensionalAddress'](_0x382c72),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x2419a5,_0x1cfd04){if(_0x1cfd04!==_0x2419a5)throw new errors_1['GenerationalError'](_0x2419a5,_0x1cfd04,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x45459e){this['metadata']['dad']=_0x45459e;}['initSelf'](_0x523186){const _0x24f167=this['metadata']['aid'];!_0x523186[_0x24f167]&&(_0x523186[_0x24f167]={});const _0x45d807=_0x523186[_0x24f167];return!_0x45d807['output']&&(_0x45d807['output']={}),!_0x45d807['input']&&(_0x45d807['input']={}),!_0x45d807['hook']&&(_0x45d807['hook']={}),!_0x45d807['output']['metadata']&&(_0x45d807['output']['metadata']={}),_0x45d807['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x523186['$self']=_0x45d807,_0x523186['$job']=_0x523186,_0x523186;}['initPolicies'](_0x1a66b7){const _0x5447f5=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x1a66b7);_0x1a66b7['metadata']['expire']=_0x5447f5;if(this['config']['persistent']!=undefined){const _0x3aeeb1=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x1a66b7);_0x1a66b7['metadata']['persistent']=_0x3aeeb1;}}['bindActivityData'](_0x5bca53){this['context'][this['metadata']['aid']][_0x5bca53]['data']=this['data'];}['resolveDad'](){let _0x513fc5=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x513fc5=_0x513fc5['substring'](0x0,_0x513fc5['lastIndexOf'](','))+','+this['adjacentIndex']),_0x513fc5;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x333646=[],_0x3708e5=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x1d3efe=_0x3708e5['.'+this['metadata']['aid']],_0x569439=this['resolveAdjacentDad']();if(_0x1d3efe)for(const _0x496e69 in _0x1d3efe){const _0x3bd4b0=_0x1d3efe[_0x496e69];mapper_1['MapperService']['evaluate'](_0x3bd4b0,this['context'],this['code'])&&_0x333646['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x569439,'aid':_0x496e69,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x333646;}['isJobComplete'](_0x8c044d){return _0x8c044d<=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'](_0xfd32b0,_0x1a01ff){if(this['jobWasInterrupted'](_0x1a01ff))return;let _0x5eabcd=[];(this['shouldEmit']()||this['isJobComplete'](_0x1a01ff)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x1a01ff)&&!this['shouldPersistJob']()});if(_0xfd32b0['length']&&!this['isJobComplete'](_0x1a01ff)){const _0x32e0c7=this['store']['transact']();for(const _0x5e4109 of _0xfd32b0){await this['engine']['router']?.['publishMessage'](null,_0x5e4109,_0x32e0c7);}_0x5eabcd=await _0x32e0c7['exec']();}return _0x5eabcd;}['jobWasInterrupted'](_0x241480){return _0x241480<-0x5f5e100;}}exports['Activity']=Activity;
|
|
1
|
+
'use strict';(function(_0xd88cda,_0x40cf49){const _0xdc612b=_0x1664,_0x471446=_0xd88cda();while(!![]){try{const _0x39808e=parseInt(_0xdc612b(0x99))/0x1+parseInt(_0xdc612b(0x91))/0x2+-parseInt(_0xdc612b(0x93))/0x3*(-parseInt(_0xdc612b(0x97))/0x4)+parseInt(_0xdc612b(0x96))/0x5*(-parseInt(_0xdc612b(0x8f))/0x6)+parseInt(_0xdc612b(0x92))/0x7*(parseInt(_0xdc612b(0x95))/0x8)+parseInt(_0xdc612b(0x94))/0x9*(-parseInt(_0xdc612b(0x98))/0xa)+parseInt(_0xdc612b(0x90))/0xb;if(_0x39808e===_0x40cf49)break;else _0x471446['push'](_0x471446['shift']());}catch(_0x45649f){_0x471446['push'](_0x471446['shift']());}}}(_0x5e52,0x86c84));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Activity']=void 0x0;function _0x5e52(){const _0x6995c5=['438JpEKDe','4140972UNbkag','956440IDgWZT','4482744nIjVUA','3iaqAtZ','27rPxhaF','8RvVEqh','41315eUQoLC','506732NQekbi','1811570aWyIgK','76991sipzvt'];_0x5e52=function(){return _0x6995c5;};return _0x5e52();}function _0x1664(_0x414ad3,_0x2a2edb){const _0x5e5290=_0x5e52();return _0x1664=function(_0x16645b,_0x15dab1){_0x16645b=_0x16645b-0x8f;let _0x351fcc=_0x5e5290[_0x16645b];return _0x351fcc;},_0x1664(_0x414ad3,_0x2a2edb);}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(_0x33a928,_0x12c7f7,_0x24eaed,_0x1823d0,_0x49a468,_0x4e3ec7){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x33a928,this['data']=_0x12c7f7,this['metadata']=_0x24eaed,this['hook']=_0x1823d0,this['engine']=_0x49a468,this['context']=_0x4e3ec7||{'data':{},'metadata':{}},this['logger']=_0x49a468['logger'],this['store']=_0x49a468['store'];}['setLeg'](_0xbedb42){this['leg']=_0xbedb42;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x46f014=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x46f014!==undefined&&!isNaN(Number(_0x46f014)))return _0x46f014;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x10a886=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x10a886);}catch(_0x581b5a){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x10a886>0x0){if(this['context']['metadata']['js']===_0x10a886){const _0x4b792f=await this['setStatus'](-_0x10a886);Number(_0x4b792f)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x581b5a;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x3f824d=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,_0x3f824d);}async['processEvent'](_0x5dc63b=stream_1['StreamStatus']['SUCCESS'],_0x253f43=0xc8,_0x593123='output'){this['setLeg'](0x2);const _0x3844d2=this['context']['metadata']['jid'];if(!_0x3844d2){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x2e417b=this['metadata']['aid'];this['status']=_0x5dc63b,this['code']=_0x253f43,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x3844d2,'aid':_0x2e417b,'status':_0x5dc63b,'code':_0x253f43});let _0x458dea;try{const _0x4559db=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x4559db),_0x458dea=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x458dea['startActivitySpan'](this['leg']);let _0x54de31;if(_0x5dc63b===stream_1['StreamStatus']['PENDING'])_0x54de31=await this['processPending'](_0x593123);else _0x5dc63b===stream_1['StreamStatus']['SUCCESS']?_0x54de31=await this['processSuccess'](_0x593123):_0x54de31=await this['processError']();this['transitionAdjacent'](_0x54de31,_0x458dea);}catch(_0x44ba62){if(_0x44ba62 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x44ba62['fault']+'-error',{..._0x44ba62});return;}else{if(_0x44ba62 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x44ba62});return;}else{if(_0x44ba62 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x44ba62});return;}else{if(_0x44ba62 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x44ba62});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x44ba62,'message':_0x44ba62['message'],'stack':_0x44ba62['stack'],'name':_0x44ba62['name']}),_0x458dea?.['setActivityError'](_0x44ba62['message']);throw _0x44ba62;}finally{_0x458dea?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x3844d2,'aid':_0x2e417b});}}async['processPending'](_0xa7e2cf){this['bindActivityData'](_0xa7e2cf),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x491797=this['store']['transact']();return await this['setState'](_0x491797),await collator_1['CollatorService']['notarizeContinuation'](this,_0x491797),await this['setStatus'](this['adjacencyList']['length'],_0x491797),await _0x491797['exec']();}async['processSuccess'](_0x45487c){this['bindActivityData'](_0x45487c),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x140b87=this['store']['transact']();return await this['setState'](_0x140b87),await collator_1['CollatorService']['notarizeCompletion'](this,_0x140b87),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x140b87),await _0x140b87['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0xd26ce6=this['store']['transact']();return await this['setState'](_0xd26ce6),await collator_1['CollatorService']['notarizeCompletion'](this,_0xd26ce6),await this['setStatus'](this['adjacencyList']['length']-0x1,_0xd26ce6),await _0xd26ce6['exec']();}async['transitionAdjacent'](_0x47778a,_0x51bc52){_0x51bc52['mapActivityAttributes']();const _0xcf6c3e=this['resolveStatus'](_0x47778a),_0x57730f={'app.job.jss':_0xcf6c3e},_0x30ca42=await this['transition'](this['adjacencyList'],_0xcf6c3e);_0x30ca42?.['length']&&(_0x57730f['app.activity.mids']=_0x30ca42['join'](',')),_0x51bc52['setActivityAttributes'](_0x57730f);}['resolveStatus'](_0x416dc0){const _0x33a458=_0x416dc0[_0x416dc0['length']-0x1];return Array['isArray'](_0x33a458)?Number(_0x33a458[0x1]):Number(_0x33a458);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x22650f=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0xb4a0b4=_0x22650f['mapRules']();if(_0xb4a0b4)for(const _0x104e74 in _0xb4a0b4){const _0x43c78b=_0x104e74['indexOf']('[');if(_0x43c78b>-0x1){const _0x481fc6=_0x104e74['substring'](_0x43c78b+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x481fc6))){const _0x354dc8=_0x104e74['substring'](0x0,_0x43c78b);_0xb4a0b4[_0x354dc8]=_0xb4a0b4[_0x104e74],delete _0xb4a0b4[_0x104e74];}else{if(_0x481fc6==='-'||_0x481fc6==='_'){const _0x1248b4=_0xb4a0b4[_0x104e74];Object['keys'](_0x1248b4)['forEach'](_0x515955=>{_0xb4a0b4[_0x515955]=_0x1248b4[_0x515955];});}}}}this['context']['data']=_0xb4a0b4;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x5886d5=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x5886d5['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x56a8f1=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x4d2689=_0x56a8f1['mapRules'](),_0x2e45b2=this['metadata']['aid'],_0x47a635={...this['context'][_0x2e45b2]['output'],..._0x4d2689};this['context'][_0x2e45b2]['output']['data']=_0x47a635;}}async['registerTimeout'](){}['bindActivityError'](_0x57c85b){const _0x1e5e92=this['context'][this['metadata']['aid']]['output']['metadata'];_0x1e5e92['err']=JSON['stringify'](this['data']),_0x1e5e92['$error']={..._0x57c85b,'is_stream_error':!![]};}['bindJobError'](_0x41e475){this['context']['metadata']['err']=JSON['stringify']({..._0x41e475,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x2f3137,_0x50d349){const {id:_0x440653}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x2f3137,this['context']['metadata']['jid'],_0x440653,_0x50d349);}['authorizeEntry'](_0x4631ad){return this['adjacencyList']?.['map'](_0x5462d5=>{const {metadata:{aid:_0x3d00c4}}=_0x5462d5;return _0x4631ad[_0x3d00c4+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x3d00c4;})??[];}['bindDimensionalAddress'](_0x4a5d83){const _0x57cb91=this['resolveDad']();_0x4a5d83[this['metadata']['aid']+'/output/metadata/dad']=_0x57cb91;}async['setState'](_0x378c69){const _0x206423=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x512c43={};await this['bindJobState'](_0x512c43);const _0x1590a8=this['authorizeEntry'](_0x512c43);this['bindDimensionalAddress'](_0x512c43),this['bindActivityState'](_0x512c43);const _0x105e1f=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x1590a8],_0x231dd3=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x512c43,this['getJobStatus'](),_0x206423,_0x105e1f,_0x231dd3,_0x378c69);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x3adfb7=this['context']['$self'];!_0x3adfb7['output']['metadata']&&(_0x3adfb7['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x3adfb7['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x55a808=(0x0,utils_1['formatISODate'])(new Date());_0x3adfb7['output']['metadata']['ac']=_0x55a808,_0x3adfb7['output']['metadata']['au']=_0x55a808,_0x3adfb7['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x3adfb7['output']['metadata']['stp']=this['config']['subtype']),_0x3adfb7['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x17d07f){const _0x2aba0e=await this['getTriggerConfig'](),_0x53bcb9=[..._0x2aba0e['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x3823ac of _0x53bcb9){const _0x2628a2=(0x0,utils_1['getValueByPath'])(this['context'],_0x3823ac);_0x2628a2!==undefined&&(_0x17d07f[_0x3823ac]=_0x2628a2);}for(const _0x5329f2 in this['context']?.['data']??{}){(_0x5329f2['startsWith']('-')||_0x5329f2['startsWith']('_'))&&(_0x17d07f[_0x5329f2]=this['context']['data'][_0x5329f2]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x17d07f,this['config'],this['context']);}['bindActivityState'](_0x5b0235){const _0x125f6c=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x364536 of _0x125f6c){const _0x3f03d5=this['metadata']['aid']+'/'+_0x364536,_0x2926d3=(0x0,utils_1['getValueByPath'])(this['context'],_0x3f03d5);_0x2926d3!==undefined&&(_0x5b0235[_0x3f03d5]=_0x2926d3);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x5b0235,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x4d0916=>'metadata/'+_0x4d0916);}['bindActivityMetadataPaths'](){const _0x4ccd3d=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x4ccd3d]['KEYS']['map'](_0x3f9e27=>'output/metadata/'+_0x3f9e27);}async['getState'](){const _0x2940cd=this['context']['metadata']['gid'],_0x5244e8='$'+this['config']['subscribes'],_0x5bc01c={[_0x5244e8]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x3f6d58=>'metadata/'+_0x3f6d58)};for(let [_0x3294d4,_0x349185]of Object['entries'](this['config']['consumes'])){if(_0x3294d4==='$job')for(const _0x1a7a13 of _0x349185){_0x5bc01c[_0x5244e8]['push'](_0x1a7a13);}else{_0x3294d4==='$self'&&(_0x3294d4=this['metadata']['aid']);!_0x5bc01c[_0x3294d4]&&(_0x5bc01c[_0x3294d4]=[]);for(const _0x25350d of _0x349185){_0x5bc01c[_0x3294d4]['push'](_0x3294d4+'/'+_0x25350d);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x5bc01c,this['config'],this['metadata'],this['leg']);const {dad:_0x1770db,jid:_0x48c071}=this['context']['metadata'],_0x941e13=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x1770db||''),[_0xd7f701,_0x5be94d]=await this['store']['getState'](_0x48c071,_0x5bc01c,_0x941e13);this['context']=(0x0,utils_1['restoreHierarchy'])(_0xd7f701),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x2940cd),this['initDimensionalAddress'](_0x1770db),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x54c9a1,_0x55211c){if(_0x55211c!==_0x54c9a1)throw new errors_1['GenerationalError'](_0x54c9a1,_0x55211c,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x3419de){this['metadata']['dad']=_0x3419de;}['initSelf'](_0x324311){const _0x4e978b=this['metadata']['aid'];!_0x324311[_0x4e978b]&&(_0x324311[_0x4e978b]={});const _0x502773=_0x324311[_0x4e978b];return!_0x502773['output']&&(_0x502773['output']={}),!_0x502773['input']&&(_0x502773['input']={}),!_0x502773['hook']&&(_0x502773['hook']={}),!_0x502773['output']['metadata']&&(_0x502773['output']['metadata']={}),_0x502773['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x324311['$self']=_0x502773,_0x324311['$job']=_0x324311,_0x324311;}['initPolicies'](_0x411191){const _0x49990a=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x411191);_0x411191['metadata']['expire']=_0x49990a;if(this['config']['persistent']!=undefined){const _0x4c5f2a=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x411191);_0x411191['metadata']['persistent']=_0x4c5f2a;}}['bindActivityData'](_0x2da65b){this['context'][this['metadata']['aid']][_0x2da65b]['data']=this['data'];}['resolveDad'](){let _0x207f5b=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x207f5b=_0x207f5b['substring'](0x0,_0x207f5b['lastIndexOf'](','))+','+this['adjacentIndex']),_0x207f5b;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x1d4998=[],_0x1d5fcf=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x52a8c1=_0x1d5fcf['.'+this['metadata']['aid']],_0x1f25bf=this['resolveAdjacentDad']();if(_0x52a8c1)for(const _0x564cec in _0x52a8c1){const _0x258017=_0x52a8c1[_0x564cec];mapper_1['MapperService']['evaluate'](_0x258017,this['context'],this['code'])&&_0x1d4998['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x1f25bf,'aid':_0x564cec,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x1d4998;}['isJobComplete'](_0x51c6e2){return _0x51c6e2<=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'](_0x2a35e7,_0x1cea2d){if(this['jobWasInterrupted'](_0x1cea2d))return;let _0x9cea6=[];(this['shouldEmit']()||this['isJobComplete'](_0x1cea2d)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x1cea2d)&&!this['shouldPersistJob']()});if(_0x2a35e7['length']&&!this['isJobComplete'](_0x1cea2d)){const _0x3ffe26=this['store']['transact']();for(const _0x166f63 of _0x2a35e7){await this['engine']['router']?.['publishMessage'](null,_0x166f63,_0x3ffe26);}_0x9cea6=await _0x3ffe26['exec']();}return _0x9cea6;}['jobWasInterrupted'](_0x202b45){return _0x202b45<-0x5f5e100;}}exports['Activity']=Activity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x2d5c2a,_0x33cd34){const _0x1820d2=_0x2643,_0x37c391=_0x2d5c2a();while(!![]){try{const _0x5390bc=parseInt(_0x1820d2(0x12c))/0x1*(parseInt(_0x1820d2(0x130))/0x2)+parseInt(_0x1820d2(0x126))/0x3*(-parseInt(_0x1820d2(0x131))/0x4)+parseInt(_0x1820d2(0x12d))/0x5+parseInt(_0x1820d2(0x12e))/0x6*(parseInt(_0x1820d2(0x12a))/0x7)+parseInt(_0x1820d2(0x128))/0x8+-parseInt(_0x1820d2(0x12f))/0x9*(parseInt(_0x1820d2(0x12b))/0xa)+-parseInt(_0x1820d2(0x127))/0xb*(-parseInt(_0x1820d2(0x129))/0xc);if(_0x5390bc===_0x33cd34)break;else _0x37c391['push'](_0x37c391['shift']());}catch(_0x2baa7e){_0x37c391['push'](_0x37c391['shift']());}}}(_0x1339,0x9d11d));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');function _0x1339(){const _0x360355=['6200195eXJFlu','30xwGaXS','4333941laOTkf','122372TWDzKp','4wbuTOX','3083151zGmlzL','4475845zRhBCm','886672sPqxkL','12RRsSEe','124495KiFMAN','10tDCZuA','5BdgErh'];_0x1339=function(){return _0x360355;};return _0x1339();}function _0x2643(_0x471fc4,_0x5ee4e8){const _0x1339b1=_0x1339();return _0x2643=function(_0x26431e,_0x529810){_0x26431e=_0x26431e-0x126;let _0x43ed0d=_0x1339b1[_0x26431e];return _0x43ed0d;},_0x2643(_0x471fc4,_0x5ee4e8);}class Await extends activity_1['Activity']{constructor(_0x20b662,_0x8fd8c0,_0x27f66a,_0x426c5e,_0x47a103,_0x39fc1e){super(_0x20b662,_0x8fd8c0,_0x27f66a,_0x426c5e,_0x47a103,_0x39fc1e);}async['process'](){this['logger']['debug']('await-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x4d3ce1;try{await this['verifyEntry'](),_0x4d3ce1=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x4d3ce1['startActivitySpan'](this['leg']),this['mapInputData']();const _0x5d96c8=this['store']['transact'](),_0x446a8f=await this['execActivity'](_0x5d96c8);await collator_1['CollatorService']['authorizeReentry'](this,_0x5d96c8),await this['setState'](_0x5d96c8),await this['setStatus'](0x0,_0x5d96c8);const _0x30eb70=await _0x5d96c8['exec']();_0x4d3ce1['mapActivityAttributes']();const _0x5f191a=this['resolveStatus'](_0x30eb70);return _0x4d3ce1['setActivityAttributes']({'app.activity.mid':_0x446a8f,'app.job.jss':_0x5f191a}),this['context']['metadata']['aid'];}catch(_0xf45b52){if(_0xf45b52 instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0xf45b52});return;}else{if(_0xf45b52 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0xf45b52});return;}else{if(_0xf45b52 instanceof errors_1['GetStateError']){this['logger']['error']('await-get-state-error',{..._0xf45b52});return;}else{if(_0xf45b52 instanceof errors_1['CollationError']){if(_0xf45b52['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',{..._0xf45b52});}else this['logger']['error']('await-process-error',{..._0xf45b52});}}}_0x4d3ce1?.['setActivityError'](_0xf45b52['message']);throw _0xf45b52;}finally{_0x4d3ce1?.['endActivitySpan'](),this['logger']['debug']('await-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x454b4c){const _0x4b98bc=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x490c29={'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':_0x4b98bc,'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 _0x44f543=pipe_1['Pipe']['resolve'](this['config']['await'],this['context']);_0x44f543===![]&&(_0x490c29['metadata']['await']=![]);}return this['config']['retry']&&(_0x490c29['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](null,_0x490c29,_0x454b4c);}}exports['Await']=Await;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x2e93(_0x5f1b42,_0x42941){const _0x271166=_0x2711();return _0x2e93=function(_0x2e93c1,_0x18f39b){_0x2e93c1=_0x2e93c1-0xd5;let _0x42b3d2=_0x271166[_0x2e93c1];return _0x42b3d2;},_0x2e93(_0x5f1b42,_0x42941);}(function(_0x2ab1a8,_0x5b1c05){const _0x4e981b=_0x2e93,_0x5cb260=_0x2ab1a8();while(!![]){try{const _0x3d1f30=-parseInt(_0x4e981b(0xd8))/0x1+-parseInt(_0x4e981b(0xda))/0x2+-parseInt(_0x4e981b(0xdc))/0x3+-parseInt(_0x4e981b(0xdd))/0x4*(parseInt(_0x4e981b(0xd6))/0x5)+parseInt(_0x4e981b(0xd7))/0x6*(-parseInt(_0x4e981b(0xd5))/0x7)+parseInt(_0x4e981b(0xdb))/0x8*(parseInt(_0x4e981b(0xde))/0x9)+parseInt(_0x4e981b(0xd9))/0xa;if(_0x3d1f30===_0x5b1c05)break;else _0x5cb260['push'](_0x5cb260['shift']());}catch(_0x26184){_0x5cb260['push'](_0x5cb260['shift']());}}}(_0x2711,0xac0c4));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Cycle']=void 0x0;function _0x2711(){const _0x3c68a6=['7xJrZCz','40WWCmiK','1701162Slozyn','645991pkHzwT','31275590uBInRG','1883652FudHfI','6376zQMhWd','3266403iAAdRZ','419164OJZjzb','15534kQbUgv'];_0x2711=function(){return _0x3c68a6;};return _0x2711();}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(_0x14a288,_0x5918ab,_0x5be438,_0x1fc43e,_0x238a22,_0x59570d){super(_0x14a288,_0x5918ab,_0x5be438,_0x1fc43e,_0x238a22,_0x59570d);}async['process'](){this['logger']['debug']('cycle-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x44d86a;try{await this['verifyEntry'](),_0x44d86a=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x44d86a['startActivitySpan'](this['leg']),this['mapInputData']();let _0x232391=this['store']['transact']();await this['setState'](_0x232391),await this['setStatus'](0x0,_0x232391);const _0x2cb149=await _0x232391['exec']();_0x44d86a['mapActivityAttributes']();const _0x1056d4=this['resolveStatus'](_0x2cb149);_0x232391=this['store']['transact']();const _0x56fc27=await this['cycleAncestorActivity'](_0x232391);return _0x44d86a['setActivityAttributes']({'app.activity.mid':_0x56fc27,'app.job.jss':_0x1056d4}),await collator_1['CollatorService']['notarizeEarlyExit'](this,_0x232391),await _0x232391['exec'](),this['context']['metadata']['aid'];}catch(_0x540896){if(_0x540896 instanceof errors_1['InactiveJobError']){this['logger']['error']('cycle-inactive-job-error',{..._0x540896});return;}else{if(_0x540896 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x540896});return;}else{if(_0x540896 instanceof errors_1['GetStateError']){this['logger']['error']('cycle-get-state-error',{..._0x540896});return;}else{if(_0x540896 instanceof errors_1['CollationError']){if(_0x540896['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',{..._0x540896});}else this['logger']['error']('cycle-process-error',{..._0x540896});}}}_0x44d86a?.['setActivityError'](_0x540896['message']);throw _0x540896;}finally{_0x44d86a?.['endActivitySpan'](),this['logger']['debug']('cycle-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['cycleAncestorActivity'](_0x6b6087){this['mapInputData']();const _0x3d7425={'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,_0x3d7425,_0x6b6087);}}exports['Cycle']=Cycle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x2de032,_0x335a54){const _0x3240be=_0x36af,_0x2baaa1=_0x2de032();while(!![]){try{const _0x380067=-parseInt(_0x3240be(0x1bf))/0x1+parseInt(_0x3240be(0x1b9))/0x2+-parseInt(_0x3240be(0x1bb))/0x3+-parseInt(_0x3240be(0x1ba))/0x4*(parseInt(_0x3240be(0x1be))/0x5)+-parseInt(_0x3240be(0x1bc))/0x6+-parseInt(_0x3240be(0x1b8))/0x7+parseInt(_0x3240be(0x1bd))/0x8;if(_0x380067===_0x335a54)break;else _0x2baaa1['push'](_0x2baaa1['shift']());}catch(_0x5253d8){_0x2baaa1['push'](_0x2baaa1['shift']());}}}(_0x39b1,0xec9b4));function _0x39b1(){const _0x5e1d45=['3384963WiEtIg','6425940dLnfqA','49209712lpXWzy','5flaasX','315685FusRRw','10888283ypedkq','432892HvovVI','5312220PFpDzz'];_0x39b1=function(){return _0x5e1d45;};return _0x39b1();}function _0x36af(_0x24b680,_0x1b8ff7){const _0x39b188=_0x39b1();return _0x36af=function(_0x36afb0,_0x2f604e){_0x36afb0=_0x36afb0-0x1b8;let _0x18c402=_0x39b188[_0x36afb0];return _0x18c402;},_0x36af(_0x24b680,_0x1b8ff7);}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(_0x475cc2,_0x1b4623,_0x5ed7f8,_0x2d1d33,_0x207641,_0x564663){super(_0x475cc2,_0x1b4623,_0x5ed7f8,_0x2d1d33,_0x207641,_0x564663);}async['process'](){this['logger']['debug']('hook-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0xb4deb9;try{return await this['verifyEntry'](),_0xb4deb9=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0xb4deb9['startActivitySpan'](this['leg']),this['doesHook']()?await this['doHook'](_0xb4deb9):await this['doPassThrough'](_0xb4deb9),this['context']['metadata']['aid'];}catch(_0x4a2cc8){if(_0x4a2cc8 instanceof errors_1['InactiveJobError']){this['logger']['error']('hook-inactive-job-error',{..._0x4a2cc8});return;}else{if(_0x4a2cc8 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x4a2cc8});return;}else{if(_0x4a2cc8 instanceof errors_1['GetStateError']){this['logger']['error']('hook-get-state-error',{..._0x4a2cc8});return;}else{if(_0x4a2cc8 instanceof errors_1['CollationError']){if(_0x4a2cc8['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',{..._0x4a2cc8});}else this['logger']['error']('hook-process-error',{..._0x4a2cc8});}}}_0xb4deb9?.['setActivityError'](_0x4a2cc8['message']);throw _0x4a2cc8;}finally{_0xb4deb9?.['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 _0x5720c3=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return!isNaN(_0x5720c3)&&Number(_0x5720c3)>0x0;}return!!this['config']['hook']?.['topic'];}async['doHook'](_0x6bb862){const _0x35c264=this['store']['transact']();await this['registerHook'](enums_1['HMSH_IS_CLUSTER']?undefined:_0x35c264),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x35c264),await collator_1['CollatorService']['authorizeReentry'](this,_0x35c264),await this['setStatus'](0x0,_0x35c264),await _0x35c264['exec'](),_0x6bb862['mapActivityAttributes']();}async['doPassThrough'](_0x1ff5d7){const _0x1486ac=this['store']['transact']();let _0x3185a0;this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x1486ac),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x1486ac),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x1486ac),_0x3185a0=await _0x1486ac['exec'](),_0x1ff5d7['mapActivityAttributes']();const _0x29e822=this['resolveStatus'](_0x3185a0),_0x2c35c2={'app.job.jss':_0x29e822},_0x2dcc51=await this['transition'](this['adjacencyList'],_0x29e822);_0x2dcc51['length']&&(_0x2c35c2['app.activity.mids']=_0x2dcc51['join'](',')),_0x1ff5d7['setActivityAttributes'](_0x2c35c2);}async['getHookRule'](_0x57724b){const _0x5e784f=await this['store']['getHookRules']();return _0x5e784f?.[_0x57724b]?.[0x0];}async['registerHook'](_0x5b5e77){if(this['config']['hook']?.['topic'])return await this['engine']['taskService']['registerWebHook'](this['config']['hook']['topic'],this['context'],this['resolveDad'](),this['context']['metadata']['expire'],_0x5b5e77);else{if(this['config']['sleep']){const _0x2b879f=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',_0x2b879f,this['metadata']['dad']||''),this['context']['metadata']['jid'];}}}async['processWebHookEvent'](_0x18f351=stream_1['StreamStatus']['SUCCESS'],_0x45c197=0xc8){this['logger']['debug']('hook-process-web-hook-event',{'topic':this['config']['hook']['topic'],'aid':this['metadata']['aid'],'status':_0x18f351,'code':_0x45c197});const _0x1779c9=new task_1['TaskService'](this['store'],this['logger']),_0x1a72c7={...this['data']},_0x3dc301=await _0x1779c9['processWebHookSignal'](this['config']['hook']['topic'],_0x1a72c7);if(_0x3dc301){const [_0x6a4bb2,_0x16a851,_0x23d189,_0x2056a2]=_0x3dc301;this['context']['metadata']['jid']=_0x6a4bb2,this['context']['metadata']['gid']=_0x2056a2,this['context']['metadata']['dad']=_0x23d189,await this['processEvent'](_0x18f351,_0x45c197,'hook'),_0x45c197===0xc8&&await _0x1779c9['deleteWebHookSignal'](this['config']['hook']['topic'],_0x1a72c7);}}async['processTimeHookEvent'](_0x4ba6e7){this['logger']['debug']('hook-process-time-hook-event',{'jid':_0x4ba6e7,'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']}),await this['processEvent'](stream_1['StreamStatus']['SUCCESS'],0xc8,'hook');}}exports['Hook']=Hook;
|