@hotmeshio/hotmesh 0.3.20 → 0.3.22
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 +30 -23
- package/build/index.d.ts +3 -1
- package/build/index.js +5 -1
- package/build/modules/key.js +1 -1
- package/build/modules/utils.d.ts +1 -2
- package/build/modules/utils.js +1 -1
- package/build/package.json +1 -1
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.js +1 -1
- package/build/services/activities/index.js +1 -1
- package/build/services/activities/interrupt.js +1 -1
- package/build/services/activities/signal.js +1 -1
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.js +1 -1
- package/build/services/connector/factory.js +21 -19
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.js +1 -1
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshcall/index.js +5 -7
- package/build/services/meshdata/index.d.ts +3 -4
- package/build/services/meshdata/index.js +4 -9
- package/build/services/meshflow/client.js +3 -4
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/worker.js +7 -10
- package/build/services/meshos/index.d.ts +2 -2
- package/build/services/meshos/index.js +6 -9
- package/build/services/pipe/functions/array.js +1 -1
- package/build/services/pipe/functions/bitwise.js +1 -1
- package/build/services/pipe/functions/conditional.js +1 -1
- package/build/services/pipe/functions/cron.js +1 -1
- package/build/services/pipe/functions/date.js +1 -1
- package/build/services/pipe/functions/index.js +1 -1
- package/build/services/pipe/functions/json.js +1 -1
- package/build/services/pipe/functions/logical.js +1 -1
- package/build/services/pipe/functions/math.js +1 -1
- package/build/services/pipe/functions/number.js +1 -1
- package/build/services/pipe/functions/object.js +1 -1
- package/build/services/pipe/functions/string.js +1 -1
- package/build/services/pipe/functions/symbol.js +1 -1
- package/build/services/pipe/functions/unary.js +1 -1
- package/build/services/pipe/index.js +1 -1
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.js +1 -1
- package/build/services/search/providers/postgres/postgres.js +1 -1
- package/build/services/search/providers/redis/ioredis.js +1 -1
- package/build/services/search/providers/redis/redis.js +1 -1
- package/build/services/serializer/index.js +1 -1
- package/build/services/store/providers/postgres/kvsql.js +1 -1
- package/build/services/store/providers/postgres/kvtables.js +1 -1
- package/build/services/store/providers/postgres/kvtransaction.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
- package/build/services/store/providers/postgres/postgres.js +1 -1
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/providers/nats/nats.js +1 -1
- package/build/services/stream/providers/postgres/postgres.js +1 -1
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/providers/nats/nats.js +1 -1
- package/build/services/sub/providers/postgres/postgres.js +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/build/types/hotmesh.d.ts +3 -17
- package/build/types/manifest.d.ts +2 -10
- package/index.ts +4 -0
- package/package.json +1 -1
- package/types/hotmesh.ts +17 -17
- package/types/manifest.ts +2 -10
package/README.md
CHANGED
|
@@ -22,13 +22,15 @@
|
|
|
22
22
|
npm install @hotmeshio/hotmesh
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
<br/>
|
|
26
|
+
|
|
25
27
|
## Learn
|
|
26
28
|
[🏠 Home](https://hotmesh.io/) | [📄 SDK Docs](https://hotmeshio.github.io/sdk-typescript/) | [💼 General Examples](https://github.com/hotmeshio/samples-typescript) | [💼 Temporal Examples](https://github.com/hotmeshio/temporal-patterns-typescript)
|
|
27
29
|
|
|
28
30
|
<br/>
|
|
29
31
|
|
|
30
|
-
## MeshCall |
|
|
31
|
-
[MeshCall](https://hotmeshio.github.io/sdk-typescript/classes/services_meshcall.MeshCall.html) connects
|
|
32
|
+
## MeshCall | Service-to-Service Function Calls
|
|
33
|
+
[MeshCall](https://hotmeshio.github.io/sdk-typescript/classes/services_meshcall.MeshCall.html) connects your functions to the mesh.
|
|
32
34
|
|
|
33
35
|
<details style="padding: .5em">
|
|
34
36
|
<summary style="font-size:1.25em;">Run an idempotent cron job <small>[more]</small></summary>
|
|
@@ -453,7 +455,7 @@ Use a standard `Promise` to collate and cache multiple signals. HotMesh will onl
|
|
|
453
455
|
### Cyclical Workflow
|
|
454
456
|
This example calls an activity and then sleeps for a week. It runs indefinitely until it's manually stopped. It takes advantage of durable execution and can safely sleep for months or years.
|
|
455
457
|
|
|
456
|
-
>Container restarts have no impact on actively executing workflows as all state is retained in
|
|
458
|
+
>Container restarts have no impact on actively executing workflows as all state is retained in the backend.
|
|
457
459
|
|
|
458
460
|
1. Define the **workflow** logic. This one calls a legacy `statusDiagnostic` function once a week.
|
|
459
461
|
|
|
@@ -587,10 +589,11 @@ This example demonstrates how to define a schema and deploy an index for a 'user
|
|
|
587
589
|
import { Client as Postgres } from 'pg';
|
|
588
590
|
import { schema } from './schema';
|
|
589
591
|
|
|
590
|
-
const meshData = new MeshData(
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
592
|
+
const meshData = new MeshData({
|
|
593
|
+
class: Postgres,
|
|
594
|
+
options: {
|
|
595
|
+
connectionString: 'postgresql://usr:pwd@localhost:5432/db'
|
|
596
|
+
}
|
|
594
597
|
},
|
|
595
598
|
schema,
|
|
596
599
|
);
|
|
@@ -613,10 +616,11 @@ This example demonstrates how to create a 'user' workflow backed by the searchab
|
|
|
613
616
|
import { schema } from './schema';
|
|
614
617
|
|
|
615
618
|
export const connectUserWorker = async (): Promise<void> => {
|
|
616
|
-
const meshData = new MeshData(
|
|
617
|
-
Postgres,
|
|
619
|
+
const meshData = new MeshData({
|
|
620
|
+
class: Postgres,
|
|
618
621
|
options: {
|
|
619
|
-
|
|
622
|
+
connectionString: 'postgresql:// usr:pwd@localhost:5432/db'
|
|
623
|
+
}
|
|
620
624
|
},
|
|
621
625
|
schema,
|
|
622
626
|
);
|
|
@@ -649,10 +653,11 @@ This example demonstrates how to create a 'user' workflow backed by the searchab
|
|
|
649
653
|
import { MeshData } from '@hotmeshio/hotmesh';
|
|
650
654
|
import { Client as Postgres } from 'pg';
|
|
651
655
|
|
|
652
|
-
const meshData = new MeshData(
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
+
const meshData = new MeshData({
|
|
657
|
+
class: Postgres,
|
|
658
|
+
options: {
|
|
659
|
+
connectionString: 'postgresql://usr:pwd@localhost:5432/db'
|
|
660
|
+
}
|
|
656
661
|
},
|
|
657
662
|
schema,
|
|
658
663
|
);
|
|
@@ -696,10 +701,11 @@ This example demonstrates how to read data fields directly from a workflow.
|
|
|
696
701
|
import { Client as Postgres } from 'pg';
|
|
697
702
|
import { schema } from './schema';
|
|
698
703
|
|
|
699
|
-
const meshData = new MeshData(
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
704
|
+
const meshData = new MeshData({
|
|
705
|
+
class: Postgres,
|
|
706
|
+
options: {
|
|
707
|
+
connectionString: 'postgresql://usr:pwd@localhost:5432/db'
|
|
708
|
+
}
|
|
703
709
|
},
|
|
704
710
|
schema,
|
|
705
711
|
);
|
|
@@ -719,7 +725,7 @@ This example demonstrates how to read data fields directly from a workflow.
|
|
|
719
725
|
<summary style="font-size:1.25em;">Search record data <small>[more]</small></summary>
|
|
720
726
|
|
|
721
727
|
### Query Record Data
|
|
722
|
-
This example demonstrates how to search for those workflows where a given condition exists in the data. This one searches for active users. *NOTE: The native Redis FT.SEARCH syntax
|
|
728
|
+
This example demonstrates how to search for those workflows where a given condition exists in the data. This one searches for active users. *NOTE: The native Redis FT.SEARCH syntax and SQL are currently supported. The JSON abstraction shown here is a convenience method for straight-forward, one-dimensional queries.*
|
|
723
729
|
|
|
724
730
|
1. Search for active users (where the value of the `active` field is `yes`).
|
|
725
731
|
|
|
@@ -729,10 +735,11 @@ This example demonstrates how to search for those workflows where a given condit
|
|
|
729
735
|
import { Client as Postgres } from 'pg';
|
|
730
736
|
import { schema } from './schema';
|
|
731
737
|
|
|
732
|
-
const meshData = new MeshData(
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
738
|
+
const meshData = new MeshData({
|
|
739
|
+
class: Postgres,
|
|
740
|
+
options: {
|
|
741
|
+
connectionString: 'postgresql://usr:pwd@localhost:5432/db'
|
|
742
|
+
}
|
|
736
743
|
},
|
|
737
744
|
schema,
|
|
738
745
|
);
|
package/build/index.d.ts
CHANGED
|
@@ -7,11 +7,13 @@ 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 * as Enums from './modules/enums';
|
|
11
|
+
import * as KeyStore from './modules/key';
|
|
10
12
|
import { ConnectorService as Connector } from './services/connector/factory';
|
|
11
13
|
import { PostgresConnection as ConnectorPostgres } from './services/connector/providers/postgres';
|
|
12
14
|
import { RedisConnection as ConnectorIORedis } from './services/connector/providers/ioredis';
|
|
13
15
|
import { RedisConnection as ConnectorRedis } from './services/connector/providers/redis';
|
|
14
16
|
import { NatsConnection as ConnectorNATS } from './services/connector/providers/nats';
|
|
15
17
|
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;
|
|
16
|
-
export { Connector, ConnectorIORedis, ConnectorNATS, ConnectorPostgres, ConnectorRedis, HotMesh, HotMeshConfig, MeshCall, MeshData, MeshFlow, MeshOS, Client, Connection, Search, Worker, workflow, WorkflowHandle, Errors, Utils, };
|
|
18
|
+
export { Connector, ConnectorIORedis, ConnectorNATS, ConnectorPostgres, ConnectorRedis, HotMesh, HotMeshConfig, MeshCall, MeshData, MeshFlow, MeshOS, Client, Connection, Search, Worker, workflow, WorkflowHandle, Enums, Errors, Utils, KeyStore, };
|
|
17
19
|
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.Utils = exports.Errors = exports.WorkflowHandle = exports.workflow = exports.Worker = exports.Search = exports.Connection = exports.Client = exports.MeshOS = exports.MeshFlow = exports.MeshData = exports.MeshCall = exports.HotMesh = exports.ConnectorRedis = exports.ConnectorPostgres = exports.ConnectorNATS = exports.ConnectorIORedis = exports.Connector = void 0;
|
|
26
|
+
exports.Types = exports.KeyStore = exports.Utils = exports.Errors = exports.Enums = exports.WorkflowHandle = exports.workflow = exports.Worker = exports.Search = exports.Connection = exports.Client = exports.MeshOS = exports.MeshFlow = exports.MeshData = exports.MeshCall = exports.HotMesh = exports.ConnectorRedis = exports.ConnectorPostgres = exports.ConnectorNATS = exports.ConnectorIORedis = exports.Connector = 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,10 @@ 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 Enums = __importStar(require("./modules/enums"));
|
|
44
|
+
exports.Enums = Enums;
|
|
45
|
+
const KeyStore = __importStar(require("./modules/key"));
|
|
46
|
+
exports.KeyStore = KeyStore;
|
|
43
47
|
const factory_1 = require("./services/connector/factory");
|
|
44
48
|
Object.defineProperty(exports, "Connector", { enumerable: true, get: function () { return factory_1.ConnectorService; } });
|
|
45
49
|
const postgres_1 = require("./services/connector/providers/postgres");
|
package/build/modules/key.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x2c605a,_0x449864){const _0x1eaec2=_0x5dc7,_0x3283f0=_0x2c605a();while(!![]){try{const _0x1f9bfb=-parseInt(_0x1eaec2(0x1c6))/0x1*(parseInt(_0x1eaec2(0x1cb))/0x2)+parseInt(_0x1eaec2(0x1ca))/0x3+parseInt(_0x1eaec2(0x1c3))/0x4+-parseInt(_0x1eaec2(0x1c5))/0x5*(parseInt(_0x1eaec2(0x1c7))/0x6)+-parseInt(_0x1eaec2(0x1c9))/0x7+-parseInt(_0x1eaec2(0x1c8))/0x8+parseInt(_0x1eaec2(0x1c4))/0x9;if(_0x1f9bfb===_0x449864)break;else _0x3283f0['push'](_0x3283f0['shift']());}catch(_0x353087){_0x3283f0['push'](_0x3283f0['shift']());}}}(_0x5eaf,0x40181));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');function _0x5eaf(){const _0x2f086b=['1112PGYdwo','235372lJrcRB','9703143wldcup','40335wlEuxw','757uMjqoj','96hmthqN','2096984japTWz','602133QLlJri','70995yJthhH'];_0x5eaf=function(){return _0x2f086b;};return _0x5eaf();}Object['defineProperty'](exports,'KeyType',{'enumerable':!![],'get':function(){return hotmesh_1['KeyType'];}});const HMNS='hmsh';exports['HMNS']=HMNS;const KEYSEP=':';exports['KEYSEP']=KEYSEP;const VALSEP='::';function _0x5dc7(_0x45efb1,_0x1df641){const _0x5eaf12=_0x5eaf();return _0x5dc7=function(_0x5dc7a3,_0x253dee){_0x5dc7a3=_0x5dc7a3-0x1c3;let _0x5870ac=_0x5eaf12[_0x5dc7a3];return _0x5870ac;},_0x5dc7(_0x45efb1,_0x1df641);}exports['VALSEP']=VALSEP;const WEBSEP='::';exports['WEBSEP']=WEBSEP;const TYPSEP='::';exports['TYPSEP']=TYPSEP;class KeyService{static['mintKey'](_0x3faddb,_0x3cfdd1,_0x35df41){switch(_0x3cfdd1){case hotmesh_1['KeyType']['HOTMESH']:return _0x3faddb;case hotmesh_1['KeyType']['THROTTLE_RATE']:return _0x3faddb+':'+_0x35df41['appId']+':r:';case hotmesh_1['KeyType']['WORK_ITEMS']:return _0x3faddb+':'+_0x35df41['appId']+':w:'+(_0x35df41['scoutType']||'');case hotmesh_1['KeyType']['TIME_RANGE']:return _0x3faddb+':'+_0x35df41['appId']+':t:'+(_0x35df41['timeValue']||'');case hotmesh_1['KeyType']['APP']:return _0x3faddb+':a:'+(_0x35df41['appId']||'');case hotmesh_1['KeyType']['QUORUM']:return _0x3faddb+':'+_0x35df41['appId']+':q:'+(_0x35df41['engineId']||'');case hotmesh_1['KeyType']['JOB_STATE']:return _0x3faddb+':'+_0x35df41['appId']+':j:'+_0x35df41['jobId'];case hotmesh_1['KeyType']['JOB_DEPENDENTS']:return _0x3faddb+':'+_0x35df41['appId']+':d:'+_0x35df41['jobId'];case hotmesh_1['KeyType']['JOB_STATS_GENERAL']:return _0x3faddb+':'+_0x35df41['appId']+':s:'+_0x35df41['jobKey']+':'+_0x35df41['dateTime'];case hotmesh_1['KeyType']['JOB_STATS_MEDIAN']:return _0x3faddb+':'+_0x35df41['appId']+':s:'+_0x35df41['jobKey']+':'+_0x35df41['dateTime']+':'+_0x35df41['facet'];case hotmesh_1['KeyType']['JOB_STATS_INDEX']:return _0x3faddb+':'+_0x35df41['appId']+':s:'+_0x35df41['jobKey']+':'+_0x35df41['dateTime']+':'+_0x35df41['facet'];case hotmesh_1['KeyType']['SCHEMAS']:return _0x3faddb+':'+_0x35df41['appId']+':v:'+_0x35df41['appVersion']+':schemas';case hotmesh_1['KeyType']['SUBSCRIPTIONS']:return _0x3faddb+':'+_0x35df41['appId']+':v:'+_0x35df41['appVersion']+':subscriptions';case hotmesh_1['KeyType']['SUBSCRIPTION_PATTERNS']:return _0x3faddb+':'+_0x35df41['appId']+':v:'+_0x35df41['appVersion']+':transitions';case hotmesh_1['KeyType']['HOOKS']:return _0x3faddb+':'+_0x35df41['appId']+':hooks';case hotmesh_1['KeyType']['SIGNALS']:return _0x3faddb+':'+_0x35df41['appId']+':signals';case hotmesh_1['KeyType']['SYMKEYS']:return _0x3faddb+':'+_0x35df41['appId']+':sym:keys:'+(_0x35df41['activityId']||'');case hotmesh_1['KeyType']['SYMVALS']:return _0x3faddb+':'+_0x35df41['appId']+':sym:vals:';case hotmesh_1['KeyType']['STREAMS']:return _0x3faddb+':'+(_0x35df41['appId']||'')+':x:'+(_0x35df41['topic']||'');default:throw new Error('Invalid\x20key\x20type.');}}static['parseKey'](_0x13e003){const [_0x53e22e,_0x572f79,_0x1c524d,..._0x1a4fc3]=_0x13e003['split'](KEYSEP),_0x1b20bf=_0x1a4fc3['join'](KEYSEP)||'';return{'namespace':_0x53e22e,'app':_0x1c524d==='a'?_0x572f79:undefined,'entity':_0x1c524d,'id':_0x1b20bf};}static['reconstituteKey'](_0x32a952){const {namespace:_0x163760,app:_0x3a115b,entity:_0x3decef,id:_0x31d6b7}=_0x32a952;return''+_0x163760+KEYSEP+_0x3a115b+KEYSEP+_0x3decef+KEYSEP+(_0x31d6b7||'');}static['resolveEntityType'](_0x1c6079,_0x1180b6=''){switch(_0x1c6079){case'a':return'applications';case'r':return'throttles';case'w':return _0x1180b6===''?'task_priorities':'roles';case't':return _0x1180b6===''?'task_schedules':'task_lists';case'q':return'events';case'j':return'jobs';case's':return'stats';case'v':return'versions';case'x':return _0x1180b6===''?'streams':'stream_topics';case'hooks':return'signal_patterns';case'signals':return'signal_registry';case'sym':return'symbols';default:return'unknown_entity';}}static['resolveAbbreviation'](_0x525d03){switch(_0x525d03){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.d.ts
CHANGED
|
@@ -21,8 +21,7 @@ export declare const polyfill: {
|
|
|
21
21
|
resolveActivityType(activityType: string): string;
|
|
22
22
|
providerConfig(obj: any): any;
|
|
23
23
|
meshDataConfig(obj: {
|
|
24
|
-
connection?: Partial<ProviderConfig>;
|
|
25
|
-
connections?: Partial<ProvidersConfig>;
|
|
24
|
+
connection?: Partial<ProviderConfig | ProvidersConfig>;
|
|
26
25
|
redisClass?: any;
|
|
27
26
|
redisOptions?: StringAnyType;
|
|
28
27
|
}): Partial<ProviderConfig> | Partial<ProvidersConfig>;
|
package/build/modules/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x140685,_0x10ddda){const _0x59b95=_0x486b,_0x51a428=_0x140685();while(!![]){try{const _0x4201b2=parseInt(_0x59b95(0x92))/0x1+-parseInt(_0x59b95(0x91))/0x2+-parseInt(_0x59b95(0x8d))/0x3*(-parseInt(_0x59b95(0x93))/0x4)+parseInt(_0x59b95(0x8b))/0x5*(parseInt(_0x59b95(0x94))/0x6)+parseInt(_0x59b95(0x8e))/0x7+parseInt(_0x59b95(0x8f))/0x8*(parseInt(_0x59b95(0x90))/0x9)+-parseInt(_0x59b95(0x8c))/0xa;if(_0x4201b2===_0x10ddda)break;else _0x51a428['push'](_0x51a428['shift']());}catch(_0x321da6){_0x51a428['push'](_0x51a428['shift']());}}}(_0x2a84,0x49fa4));var __importDefault=this&&this['__importDefault']||function(_0x8a8b2e){return _0x8a8b2e&&_0x8a8b2e['__esModule']?_0x8a8b2e:{'default':_0x8a8b2e};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['isStreamMessage']=exports['parseStreamMessage']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['polyfill']=exports['identifyProvider']=exports['XSleepFor']=exports['sleepImmediate']=exports['sleepFor']=exports['guid']=exports['deterministicRandom']=exports['deepCopy']=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),logger_1=require('../services/logger'),enums_1=require('./enums'),logger=new logger_1['LoggerService']('hotmesh','utils'),hashOptions=_0x4f4961=>{const _0x22773b=JSON['stringify'](_0x4f4961);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x22773b)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x4b5632=os_1['default']['totalmem'](),_0x12f520=os_1['default']['freemem'](),_0x297612=_0x4b5632-_0x12f520,_0xb7897b={'TotalMemoryGB':(_0x4b5632/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x12f520/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x297612/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0xb7897b;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x3a6e9a){return JSON['parse'](JSON['stringify'](_0x3a6e9a));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x173bdc){const _0xd7b96b=Math['sin'](_0x173bdc)*0x2710;return _0xd7b96b-Math['floor'](_0xd7b96b);}exports['deterministicRandom']=deterministicRandom;function guid(_0x38e5a2=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x38e5a2);}exports['guid']=guid;async function sleepFor(_0x2c75eb){return new Promise(_0x4e4668=>setTimeout(_0x4e4668,_0x2c75eb));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x9b9f11=>setImmediate(_0x9b9f11));}exports['sleepImmediate']=sleepImmediate;function _0x486b(_0x23a3ec,_0x1dcec0){const _0x2a84f0=_0x2a84();return _0x486b=function(_0x486b25,_0x31abff){_0x486b25=_0x486b25-0x8b;let _0x32b5aa=_0x2a84f0[_0x486b25];return _0x32b5aa;},_0x486b(_0x23a3ec,_0x1dcec0);}function XSleepFor(_0x10aca9){let _0x2e66df;const _0x118d6f=new Promise(_0x21c5ba=>{_0x2e66df=setTimeout(_0x21c5ba,_0x10aca9);});return{'promise':_0x118d6f,'timerId':_0x2e66df};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x4897b8){const _0x46ee32=Object['getPrototypeOf'](_0x4897b8);if(_0x4897b8['Query']?.['prototype']||Object['keys'](_0x4897b8)['includes']('database')||_0x46ee32['name']==='Pool')return'postgres';else{if(_0x4897b8['toString']()['toLowerCase']()['includes']('nats'))return'nats';else{if('defineCommand'in _0x46ee32||Object['keys'](_0x46ee32)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x46ee32)['includes']('Multi'))return'redis';}}}if(_0x4897b8['constructor']){if(_0x4897b8['constructor']['name']==='Redis'||_0x4897b8['constructor']['name']==='EventEmitter'){if('hset'in _0x4897b8)return'ioredis';}else{if(_0x4897b8['constructor']['name']==='ProviderClient'||_0x4897b8['constructor']['name']==='Commander'){if('HSET'in _0x4897b8)return'redis';}}}let _0x1482e3=null;if(Object['keys'](_0x4897b8)['includes']('connection')||!isNaN(_0x4897b8['totalCount'])&&!isNaN(_0x4897b8['idleCount']))_0x1482e3='postgres';else{if(Object['keys'](_0x4897b8)['includes']('Pipeline'))_0x1482e3='ioredis';else{if(Object['keys'](_0x4897b8)['includes']('createClient'))_0x1482e3='redis';else _0x46ee32['constructor']['toString']()['includes']('NatsConnectionImpl')&&(_0x1482e3='nats');}}return _0x1482e3;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x387e1b){return _0x387e1b==='activity'?'hook':_0x387e1b;},'providerConfig'(_0x19f955){return _0x19f955?.['connection']??_0x19f955?.['redis']??_0x19f955?.['connections'];},'meshDataConfig'(_0x444d92){if(_0x444d92?.['connections'])return _0x444d92['connections'];return _0x444d92?.['connection']??{'class':_0x444d92?.['redisClass'],'options':_0x444d92?.['redisOptions']};}};function matchesStatusCode(_0xff4784,_0x479819){if(typeof _0x479819==='string'){const _0x49a7a2='^'+_0x479819['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x49a7a2)['test'](_0xff4784['toString']());}return _0x479819['test'](_0xff4784['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x4717ac,_0x74018a){return _0x4717ac===_0x74018a;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x512301,_0x2a0921){for(const [_0x17fe13,_0x2177ae]of Object['entries'](_0x512301)){if(_0x2177ae['hasOwnProperty'](_0x2a0921)){const _0x2ba351=findTopKey(_0x512301,_0x17fe13['replace'](/^\./,''));return(_0x2ba351||_0x17fe13)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function _0x2a84(){const _0x1ec9dd=['113644lMGzaZ','167256wsYtaz','80jZSFkJ','7102790Vqyrps','21dcfeRn','791259CPFzsK','376bRJgxk','77157fbyKJK','1023290LeozwZ','364075Workjl'];_0x2a84=function(){return _0x1ec9dd;};return _0x2a84();}function findSubscriptionForTrigger(_0x58652b,_0xa0c512){for(const [_0x56c7b1,_0x965c6]of Object['entries'](_0x58652b)){if(_0x965c6===_0xa0c512)return _0x56c7b1;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x29846f,_0x279dfb,_0x4b6a21){const _0x2754bf=await _0x279dfb['getTransitions'](_0x4b6a21),_0x372467=await _0x279dfb['getSubscriptions'](_0x4b6a21),_0x38dea4=findTopKey(_0x2754bf,_0x29846f),_0x12cab3=findSubscriptionForTrigger(_0x372467,_0x38dea4);return _0x12cab3;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x4a41d8){if(_0x4a41d8['toString']()==='infinity')return'0';const _0x134ef1=new Date(),_0x380670=_0x4a41d8['slice'](-0x1),_0x354556=parseInt(_0x4a41d8['slice'](0x0,-0x1),0xa);if(_0x380670==='m'){const _0x72d8=Math['floor'](_0x134ef1['getMinutes']()/_0x354556)*_0x354556;_0x134ef1['setUTCMinutes'](_0x72d8,0x0,0x0);}else _0x380670==='h'&&_0x134ef1['setUTCMinutes'](0x0,0x0,0x0);return _0x134ef1['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x4531ee){const _0x33d7ae=_0x4531ee instanceof Date?_0x4531ee:new Date(_0x4531ee);return _0x33d7ae['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x31f7c8){const _0x55aaab='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x33127b=_0x55aaab['length'];if(_0x31f7c8<0x0||_0x31f7c8>=Math['pow'](_0x33127b,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x435e31,_0xdbc3bc]=divmod(_0x31f7c8,_0x33127b),[_0x4a9ff8,_0x73bd47]=divmod(_0x435e31,_0x33127b);return _0x55aaab[_0x4a9ff8]+_0x55aaab[_0xdbc3bc]+_0x55aaab[_0x73bd47];}exports['getSymKey']=getSymKey;function getSymVal(_0x4d632c){const _0x38dec4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x57737e=_0x38dec4['length'];if(_0x4d632c<0x0||_0x4d632c>=Math['pow'](_0x57737e,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x5c14c6,_0x27defb]=divmod(_0x4d632c,_0x57737e);return _0x38dec4[_0x5c14c6]+_0x38dec4[_0x27defb];}exports['getSymVal']=getSymVal;function divmod(_0x21df2b,_0x5896ba){return[Math['floor'](_0x21df2b/_0x5896ba),_0x21df2b%_0x5896ba];}function getIndexedHash(_0x1fbbe6,_0x345056){const _0xca8217=_0x1fbbe6[_0x345056]||0x0,_0x446fd1={..._0x1fbbe6};return delete _0x446fd1[_0x345056],[_0xca8217,_0x446fd1];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x1aadec,_0x1e40a1){const _0x5c4a63=_0x1e40a1['split']('/');let _0x5a403f=_0x1aadec;for(const _0x4635b0 of _0x5c4a63){if(_0x5a403f[_0x4635b0]!==undefined)_0x5a403f=_0x5a403f[_0x4635b0];else return undefined;}return _0x5a403f;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x16ca76){const _0x403a61={};for(const _0x4518b7 in _0x16ca76){if(_0x16ca76[_0x4518b7]===undefined)continue;const _0x2f995a=_0x4518b7['split']('/');let _0x5e6648=_0x403a61;for(let _0x14b969=0x0;_0x14b969<_0x2f995a['length'];_0x14b969++){_0x14b969===_0x2f995a['length']-0x1?_0x5e6648[_0x2f995a[_0x14b969]]=_0x16ca76[_0x4518b7]:(_0x5e6648[_0x2f995a[_0x14b969]]=_0x5e6648[_0x2f995a[_0x14b969]]||{},_0x5e6648=_0x5e6648[_0x2f995a[_0x14b969]]);}}return _0x403a61;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x37b98b){const _0x1974f9=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x1974f9['test'](_0x37b98b);}exports['isValidCron']=isValidCron;const s=_0x36c6e3=>{return(0x0,ms_1['default'])(_0x36c6e3)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x32238e=>{try{return JSON['parse'](_0x32238e);}catch(_0x388223){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x388223});throw _0x388223;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0xa6d8a7=>{return Array['isArray'](_0xa6d8a7)&&Array['isArray'](_0xa6d8a7[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x3cd3c6=>{const _0x242d59=[];let _0x4af877;for(let _0xdcfec4=0x1;_0xdcfec4<_0x3cd3c6['length'];_0xdcfec4++){const _0x4e4c44=_0x3cd3c6[_0xdcfec4],_0x54865f={};if(Array['isArray'](_0x4e4c44)){for(let _0x59dca0=0x0;_0x59dca0<_0x4e4c44['length'];_0x59dca0+=0x2){const _0x313aed=_0x4e4c44[_0x59dca0],_0x2d1e2c=_0x4e4c44[_0x59dca0+0x1];_0x54865f[_0x313aed]=_0x2d1e2c;}_0x4af877&&(_0x54865f['$']=_0x4af877),_0x242d59['push'](_0x54865f),_0x4af877=undefined;}else _0x4af877=_0x4e4c44;}return _0x242d59;};exports['arrayToHash']=arrayToHash;
|
|
1
|
+
'use strict';(function(_0x1439a2,_0x33944d){const _0x28d9a8=_0x4df4,_0x506dbd=_0x1439a2();while(!![]){try{const _0x507893=-parseInt(_0x28d9a8(0xed))/0x1*(-parseInt(_0x28d9a8(0xee))/0x2)+-parseInt(_0x28d9a8(0xef))/0x3*(parseInt(_0x28d9a8(0xf6))/0x4)+-parseInt(_0x28d9a8(0xf5))/0x5*(parseInt(_0x28d9a8(0xec))/0x6)+parseInt(_0x28d9a8(0xf1))/0x7+-parseInt(_0x28d9a8(0xea))/0x8*(parseInt(_0x28d9a8(0xf0))/0x9)+-parseInt(_0x28d9a8(0xeb))/0xa*(-parseInt(_0x28d9a8(0xf3))/0xb)+parseInt(_0x28d9a8(0xf2))/0xc*(parseInt(_0x28d9a8(0xf4))/0xd);if(_0x507893===_0x33944d)break;else _0x506dbd['push'](_0x506dbd['shift']());}catch(_0x22a5a3){_0x506dbd['push'](_0x506dbd['shift']());}}}(_0x3e73,0xab7ce));function _0x4df4(_0x52d05d,_0x3b2a82){const _0x3e73b3=_0x3e73();return _0x4df4=function(_0x4df4e0,_0x5670fc){_0x4df4e0=_0x4df4e0-0xea;let _0x1b9e27=_0x3e73b3[_0x4df4e0];return _0x1b9e27;},_0x4df4(_0x52d05d,_0x3b2a82);}var __importDefault=this&&this['__importDefault']||function(_0xe2f9){return _0xe2f9&&_0xe2f9['__esModule']?_0xe2f9:{'default':_0xe2f9};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['isStreamMessage']=exports['parseStreamMessage']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['polyfill']=exports['identifyProvider']=exports['XSleepFor']=exports['sleepImmediate']=exports['sleepFor']=exports['guid']=exports['deterministicRandom']=exports['deepCopy']=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),logger_1=require('../services/logger'),enums_1=require('./enums'),logger=new logger_1['LoggerService']('hotmesh','utils'),hashOptions=_0x32c824=>{const _0x1a3e18=JSON['stringify'](_0x32c824);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x1a3e18)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x5479d5=os_1['default']['totalmem'](),_0x176016=os_1['default']['freemem'](),_0x3b213c=_0x5479d5-_0x176016,_0x2a76cb={'TotalMemoryGB':(_0x5479d5/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x176016/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x3b213c/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x2a76cb;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x43845d){return JSON['parse'](JSON['stringify'](_0x43845d));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x278075){const _0x2df795=Math['sin'](_0x278075)*0x2710;return _0x2df795-Math['floor'](_0x2df795);}exports['deterministicRandom']=deterministicRandom;function guid(_0x4e247f=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x4e247f);}exports['guid']=guid;async function sleepFor(_0xaaedbf){return new Promise(_0x1b5efa=>setTimeout(_0x1b5efa,_0xaaedbf));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x49cc6c=>setImmediate(_0x49cc6c));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0x5e7537){let _0x686e87;const _0x48397f=new Promise(_0x50089e=>{_0x686e87=setTimeout(_0x50089e,_0x5e7537);});return{'promise':_0x48397f,'timerId':_0x686e87};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x447419){const _0x2d07bb=Object['getPrototypeOf'](_0x447419);if(_0x447419['Query']?.['prototype']||Object['keys'](_0x447419)['includes']('database')||_0x2d07bb['name']==='Pool')return'postgres';else{if(_0x447419['toString']()['toLowerCase']()['includes']('nats'))return'nats';else{if('defineCommand'in _0x2d07bb||Object['keys'](_0x2d07bb)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x2d07bb)['includes']('Multi'))return'redis';}}}if(_0x447419['constructor']){if(_0x447419['constructor']['name']==='Redis'||_0x447419['constructor']['name']==='EventEmitter'){if('hset'in _0x447419)return'ioredis';}else{if(_0x447419['constructor']['name']==='ProviderClient'||_0x447419['constructor']['name']==='Commander'){if('HSET'in _0x447419)return'redis';}}}let _0x656119=null;if(Object['keys'](_0x447419)['includes']('connection')||!isNaN(_0x447419['totalCount'])&&!isNaN(_0x447419['idleCount']))_0x656119='postgres';else{if(Object['keys'](_0x447419)['includes']('Pipeline'))_0x656119='ioredis';else{if(Object['keys'](_0x447419)['includes']('createClient'))_0x656119='redis';else _0x2d07bb['constructor']['toString']()['includes']('NatsConnectionImpl')&&(_0x656119='nats');}}return _0x656119;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x4337e7){return _0x4337e7==='activity'?'hook':_0x4337e7;},'providerConfig'(_0x13dfc9){return _0x13dfc9?.['connection']??_0x13dfc9?.['redis']??_0x13dfc9?.['connections'];},'meshDataConfig'(_0x1bb5b4){return{..._0x1bb5b4['connection']};}};function matchesStatusCode(_0xa1ff74,_0x561a33){if(typeof _0x561a33==='string'){const _0x282c8a='^'+_0x561a33['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x282c8a)['test'](_0xa1ff74['toString']());}return _0x561a33['test'](_0xa1ff74['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x1a60e2,_0x50666b){return _0x1a60e2===_0x50666b;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x3f242f,_0x2a6c74){for(const [_0x1c55ca,_0x19cc4e]of Object['entries'](_0x3f242f)){if(_0x19cc4e['hasOwnProperty'](_0x2a6c74)){const _0x590259=findTopKey(_0x3f242f,_0x1c55ca['replace'](/^\./,''));return(_0x590259||_0x1c55ca)['replace'](/^\./,'');}}return null;}function _0x3e73(){const _0x16f794=['165DHBNcc','614445FpXZQL','1765255xRYFfG','3908668BMwHuM','2920672iChPlY','918870cWvwBZ','6heMNPa','72bdJrBa','20406nmIzqA','3uAARNL','27AcmKTb','5781321Tpfsej','48IrrfLo'];_0x3e73=function(){return _0x16f794;};return _0x3e73();}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x2b8789,_0x28fb14){for(const [_0x5ea96a,_0x33d06d]of Object['entries'](_0x2b8789)){if(_0x33d06d===_0x28fb14)return _0x5ea96a;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x4bf181,_0x2aaf9e,_0x16d40b){const _0x49aa91=await _0x2aaf9e['getTransitions'](_0x16d40b),_0x5c0309=await _0x2aaf9e['getSubscriptions'](_0x16d40b),_0x506a33=findTopKey(_0x49aa91,_0x4bf181),_0x12aba4=findSubscriptionForTrigger(_0x5c0309,_0x506a33);return _0x12aba4;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x67cd0e){if(_0x67cd0e['toString']()==='infinity')return'0';const _0x1d276c=new Date(),_0x8fe524=_0x67cd0e['slice'](-0x1),_0x2c07ad=parseInt(_0x67cd0e['slice'](0x0,-0x1),0xa);if(_0x8fe524==='m'){const _0x1ff279=Math['floor'](_0x1d276c['getMinutes']()/_0x2c07ad)*_0x2c07ad;_0x1d276c['setUTCMinutes'](_0x1ff279,0x0,0x0);}else _0x8fe524==='h'&&_0x1d276c['setUTCMinutes'](0x0,0x0,0x0);return _0x1d276c['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x36041f){const _0x1a8797=_0x36041f instanceof Date?_0x36041f:new Date(_0x36041f);return _0x1a8797['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x4cf3a5){const _0x80032b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x5b3078=_0x80032b['length'];if(_0x4cf3a5<0x0||_0x4cf3a5>=Math['pow'](_0x5b3078,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x4f6a88,_0x4f2387]=divmod(_0x4cf3a5,_0x5b3078),[_0xd97a1c,_0x35c7e8]=divmod(_0x4f6a88,_0x5b3078);return _0x80032b[_0xd97a1c]+_0x80032b[_0x4f2387]+_0x80032b[_0x35c7e8];}exports['getSymKey']=getSymKey;function getSymVal(_0x5b85df){const _0x116b37='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x32c6cd=_0x116b37['length'];if(_0x5b85df<0x0||_0x5b85df>=Math['pow'](_0x32c6cd,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x4cd809,_0xa6318c]=divmod(_0x5b85df,_0x32c6cd);return _0x116b37[_0x4cd809]+_0x116b37[_0xa6318c];}exports['getSymVal']=getSymVal;function divmod(_0x3b6811,_0x57606c){return[Math['floor'](_0x3b6811/_0x57606c),_0x3b6811%_0x57606c];}function getIndexedHash(_0x2ce3ea,_0x3b0b6a){const _0xc891da=_0x2ce3ea[_0x3b0b6a]||0x0,_0x3d3c9d={..._0x2ce3ea};return delete _0x3d3c9d[_0x3b0b6a],[_0xc891da,_0x3d3c9d];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x233352,_0x41a3ae){const _0x369fb1=_0x41a3ae['split']('/');let _0x49ef5c=_0x233352;for(const _0x1d08ae of _0x369fb1){if(_0x49ef5c[_0x1d08ae]!==undefined)_0x49ef5c=_0x49ef5c[_0x1d08ae];else return undefined;}return _0x49ef5c;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x2748ac){const _0x2b12a6={};for(const _0x39f37c in _0x2748ac){if(_0x2748ac[_0x39f37c]===undefined)continue;const _0xc11640=_0x39f37c['split']('/');let _0x5f5152=_0x2b12a6;for(let _0x163146=0x0;_0x163146<_0xc11640['length'];_0x163146++){_0x163146===_0xc11640['length']-0x1?_0x5f5152[_0xc11640[_0x163146]]=_0x2748ac[_0x39f37c]:(_0x5f5152[_0xc11640[_0x163146]]=_0x5f5152[_0xc11640[_0x163146]]||{},_0x5f5152=_0x5f5152[_0xc11640[_0x163146]]);}}return _0x2b12a6;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x248135){const _0x28492e=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x28492e['test'](_0x248135);}exports['isValidCron']=isValidCron;const s=_0x562cb7=>{return(0x0,ms_1['default'])(_0x562cb7)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x21f062=>{try{return JSON['parse'](_0x21f062);}catch(_0x8a9a){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x8a9a});throw _0x8a9a;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0x455d67=>{return Array['isArray'](_0x455d67)&&Array['isArray'](_0x455d67[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x206a60=>{const _0x2385c1=[];let _0x1b2ac5;for(let _0x5090b3=0x1;_0x5090b3<_0x206a60['length'];_0x5090b3++){const _0x41756e=_0x206a60[_0x5090b3],_0x5e012e={};if(Array['isArray'](_0x41756e)){for(let _0x9e918c=0x0;_0x9e918c<_0x41756e['length'];_0x9e918c+=0x2){const _0x2f3655=_0x41756e[_0x9e918c],_0x5ee314=_0x41756e[_0x9e918c+0x1];_0x5e012e[_0x2f3655]=_0x5ee314;}_0x1b2ac5&&(_0x5e012e['$']=_0x1b2ac5),_0x2385c1['push'](_0x5e012e),_0x1b2ac5=undefined;}else _0x1b2ac5=_0x41756e;}return _0x2385c1;};exports['arrayToHash']=arrayToHash;
|
package/build/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x26369d,_0x4e7c0c){const _0xfbd5c6=_0x5491,_0x4e50d1=_0x26369d();while(!![]){try{const _0x3203eb=-parseInt(_0xfbd5c6(0x9d))/0x1*(-parseInt(_0xfbd5c6(0x94))/0x2)+-parseInt(_0xfbd5c6(0x99))/0x3*(parseInt(_0xfbd5c6(0x95))/0x4)+-parseInt(_0xfbd5c6(0x93))/0x5*(parseInt(_0xfbd5c6(0x9c))/0x6)+parseInt(_0xfbd5c6(0x98))/0x7+-parseInt(_0xfbd5c6(0x9a))/0x8*(-parseInt(_0xfbd5c6(0x9b))/0x9)+parseInt(_0xfbd5c6(0x96))/0xa*(parseInt(_0xfbd5c6(0x9e))/0xb)+-parseInt(_0xfbd5c6(0x97))/0xc;if(_0x3203eb===_0x4e7c0c)break;else _0x4e50d1['push'](_0x4e50d1['shift']());}catch(_0xde85d0){_0x4e50d1['push'](_0x4e50d1['shift']());}}}(_0x234f,0x1c286));function _0x5491(_0x29fe15,_0x2e90dc){const _0x234f3b=_0x234f();return _0x5491=function(_0x5491be,_0x55978f){_0x5491be=_0x5491be-0x93;let _0x27bbf4=_0x234f3b[_0x5491be];return _0x27bbf4;},_0x5491(_0x29fe15,_0x2e90dc);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Activity']=void 0x0;const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream');function _0x234f(){const _0x25324b=['554148dmDopD','48JTVeeV','442568CrBNij','36ZYtKUz','27474jJpyaf','2pWnxXW','22RsjAee','60mhrOwQ','167374LgivAn','15472lKRdvm','1046620EoBpEv','5339712XOqSGk'];_0x234f=function(){return _0x25324b;};return _0x234f();}class Activity{constructor(_0x20d81f,_0x3fd45b,_0x2953af,_0x4430a6,_0x32d468,_0x2be8bf){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x20d81f,this['data']=_0x3fd45b,this['metadata']=_0x2953af,this['hook']=_0x4430a6,this['engine']=_0x32d468,this['context']=_0x2be8bf||{'data':{},'metadata':{}},this['logger']=_0x32d468['logger'],this['store']=_0x32d468['store'];}['setLeg'](_0x4f0e5c){this['leg']=_0x4f0e5c;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x2d17b5=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x2d17b5!==undefined&&!isNaN(Number(_0x2d17b5)))return _0x2d17b5;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x17c1f7=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x17c1f7);}catch(_0x2113ec){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x17c1f7>0x0){if(this['context']['metadata']['js']===_0x17c1f7){const _0x5235fa=await this['setStatus'](-_0x17c1f7);Number(_0x5235fa)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x2113ec;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x1aa905=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,_0x1aa905);}async['processEvent'](_0x1bc726=stream_1['StreamStatus']['SUCCESS'],_0x344d66=0xc8,_0x429936='output'){this['setLeg'](0x2);const _0x850d22=this['context']['metadata']['jid'];if(!_0x850d22){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x5ac4fc=this['metadata']['aid'];this['status']=_0x1bc726,this['code']=_0x344d66,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x850d22,'aid':_0x5ac4fc,'status':_0x1bc726,'code':_0x344d66});let _0x5782db;try{const _0x4dc09c=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x4dc09c),_0x5782db=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x5782db['startActivitySpan'](this['leg']);let _0xa2c867;if(_0x1bc726===stream_1['StreamStatus']['PENDING'])_0xa2c867=await this['processPending'](_0x429936);else _0x1bc726===stream_1['StreamStatus']['SUCCESS']?_0xa2c867=await this['processSuccess'](_0x429936):_0xa2c867=await this['processError']();this['transitionAdjacent'](_0xa2c867,_0x5782db);}catch(_0x4fcc1e){if(_0x4fcc1e instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x4fcc1e['fault']+'-error',{..._0x4fcc1e});return;}else{if(_0x4fcc1e instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x4fcc1e});return;}else{if(_0x4fcc1e instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x4fcc1e});return;}else{if(_0x4fcc1e instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x4fcc1e});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x4fcc1e,'message':_0x4fcc1e['message'],'stack':_0x4fcc1e['stack'],'name':_0x4fcc1e['name']}),_0x5782db?.['setActivityError'](_0x4fcc1e['message']);throw _0x4fcc1e;}finally{_0x5782db?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x850d22,'aid':_0x5ac4fc});}}async['processPending'](_0xdf5d78){this['bindActivityData'](_0xdf5d78),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x240639=this['store']['transact']();return await this['setState'](_0x240639),await collator_1['CollatorService']['notarizeContinuation'](this,_0x240639),await this['setStatus'](this['adjacencyList']['length'],_0x240639),await _0x240639['exec']();}async['processSuccess'](_0x4577fa){this['bindActivityData'](_0x4577fa),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x1314b6=this['store']['transact']();return await this['setState'](_0x1314b6),await collator_1['CollatorService']['notarizeCompletion'](this,_0x1314b6),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x1314b6),await _0x1314b6['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x34561b=this['store']['transact']();return await this['setState'](_0x34561b),await collator_1['CollatorService']['notarizeCompletion'](this,_0x34561b),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x34561b),await _0x34561b['exec']();}async['transitionAdjacent'](_0x343e56,_0x5793b9){_0x5793b9['mapActivityAttributes']();const _0xc642fb=this['resolveStatus'](_0x343e56),_0x47ef49={'app.job.jss':_0xc642fb},_0xbbbd94=await this['transition'](this['adjacencyList'],_0xc642fb);_0xbbbd94?.['length']&&(_0x47ef49['app.activity.mids']=_0xbbbd94['join'](',')),_0x5793b9['setActivityAttributes'](_0x47ef49);}['resolveStatus'](_0x59d7c0){const _0x36e449=_0x59d7c0[_0x59d7c0['length']-0x1];return Array['isArray'](_0x36e449)?Number(_0x36e449[0x1]):Number(_0x36e449);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x1b4732=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x59996e=_0x1b4732['mapRules']();if(_0x59996e)for(const _0x48f314 in _0x59996e){const _0x1a966c=_0x48f314['indexOf']('[');if(_0x1a966c>-0x1){const _0x727533=_0x48f314['substring'](_0x1a966c+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x727533))){const _0x3e46bc=_0x48f314['substring'](0x0,_0x1a966c);_0x59996e[_0x3e46bc]=_0x59996e[_0x48f314],delete _0x59996e[_0x48f314];}else{if(_0x727533==='-'||_0x727533==='_'){const _0x4a4a66=_0x59996e[_0x48f314];Object['keys'](_0x4a4a66)['forEach'](_0x317fb3=>{_0x59996e[_0x317fb3]=_0x4a4a66[_0x317fb3];});}}}}this['context']['data']=_0x59996e;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x505636=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x505636['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0xb2cd6b=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x1b4330=_0xb2cd6b['mapRules'](),_0x362c4a=this['metadata']['aid'],_0x1664c7={...this['context'][_0x362c4a]['output'],..._0x1b4330};this['context'][_0x362c4a]['output']['data']=_0x1664c7;}}async['registerTimeout'](){}['bindActivityError'](_0x4049ce){const _0x5b3469=this['context'][this['metadata']['aid']]['output']['metadata'];_0x5b3469['err']=JSON['stringify'](this['data']),_0x5b3469['$error']={..._0x4049ce,'is_stream_error':!![]};}['bindJobError'](_0x262191){this['context']['metadata']['err']=JSON['stringify']({..._0x262191,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x241119,_0x445a78){const {id:_0x14866c}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x241119,this['context']['metadata']['jid'],_0x14866c,_0x445a78);}['authorizeEntry'](_0x1ff7b6){return this['adjacencyList']?.['map'](_0x3ce33c=>{const {metadata:{aid:_0x1b7b94}}=_0x3ce33c;return _0x1ff7b6[_0x1b7b94+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x1b7b94;})??[];}['bindDimensionalAddress'](_0x4aac43){const _0x24ed62=this['resolveDad']();_0x4aac43[this['metadata']['aid']+'/output/metadata/dad']=_0x24ed62;}async['setState'](_0x561702){const _0x2df7f8=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0xc80f76={};await this['bindJobState'](_0xc80f76);const _0x3af0dd=this['authorizeEntry'](_0xc80f76);this['bindDimensionalAddress'](_0xc80f76),this['bindActivityState'](_0xc80f76);const _0x376719=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x3af0dd],_0x478f5a=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0xc80f76,this['getJobStatus'](),_0x2df7f8,_0x376719,_0x478f5a,_0x561702);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x369c85=this['context']['$self'];!_0x369c85['output']['metadata']&&(_0x369c85['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x369c85['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x1ffcf3=(0x0,utils_1['formatISODate'])(new Date());_0x369c85['output']['metadata']['ac']=_0x1ffcf3,_0x369c85['output']['metadata']['au']=_0x1ffcf3,_0x369c85['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x369c85['output']['metadata']['stp']=this['config']['subtype']),_0x369c85['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x1695e4){const _0x2e04ef=await this['getTriggerConfig'](),_0x15eed6=[..._0x2e04ef['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x5d003c of _0x15eed6){const _0x3d8f68=(0x0,utils_1['getValueByPath'])(this['context'],_0x5d003c);_0x3d8f68!==undefined&&(_0x1695e4[_0x5d003c]=_0x3d8f68);}for(const _0x4f3e96 in this['context']?.['data']??{}){(_0x4f3e96['startsWith']('-')||_0x4f3e96['startsWith']('_'))&&(_0x1695e4[_0x4f3e96]=this['context']['data'][_0x4f3e96]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x1695e4,this['config'],this['context']);}['bindActivityState'](_0x12dfc7){const _0x358e3c=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x471b0f of _0x358e3c){const _0x18c139=this['metadata']['aid']+'/'+_0x471b0f,_0xed47e=(0x0,utils_1['getValueByPath'])(this['context'],_0x18c139);_0xed47e!==undefined&&(_0x12dfc7[_0x18c139]=_0xed47e);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x12dfc7,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x4f18fd=>'metadata/'+_0x4f18fd);}['bindActivityMetadataPaths'](){const _0x340d2a=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x340d2a]['KEYS']['map'](_0x2aa617=>'output/metadata/'+_0x2aa617);}async['getState'](){const _0x49838c=this['context']['metadata']['gid'],_0x322358='$'+this['config']['subscribes'],_0x2ef493={[_0x322358]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0xc54638=>'metadata/'+_0xc54638)};for(let [_0x4f1633,_0x3c9492]of Object['entries'](this['config']['consumes'])){if(_0x4f1633==='$job')for(const _0x4e3465 of _0x3c9492){_0x2ef493[_0x322358]['push'](_0x4e3465);}else{_0x4f1633==='$self'&&(_0x4f1633=this['metadata']['aid']);!_0x2ef493[_0x4f1633]&&(_0x2ef493[_0x4f1633]=[]);for(const _0x3c6eaf of _0x3c9492){_0x2ef493[_0x4f1633]['push'](_0x4f1633+'/'+_0x3c6eaf);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x2ef493,this['config'],this['metadata'],this['leg']);const {dad:_0x1245a7,jid:_0x4eef66}=this['context']['metadata'],_0x5561d0=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x1245a7||''),[_0x41944d,_0x445023]=await this['store']['getState'](_0x4eef66,_0x2ef493,_0x5561d0);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x41944d),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x49838c),this['initDimensionalAddress'](_0x1245a7),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x23ac9c,_0x2fefbf){if(_0x2fefbf!==_0x23ac9c)throw new errors_1['GenerationalError'](_0x23ac9c,_0x2fefbf,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x4a7835){this['metadata']['dad']=_0x4a7835;}['initSelf'](_0x37a5c8){const _0x10b0c2=this['metadata']['aid'];!_0x37a5c8[_0x10b0c2]&&(_0x37a5c8[_0x10b0c2]={});const _0x20c2fc=_0x37a5c8[_0x10b0c2];return!_0x20c2fc['output']&&(_0x20c2fc['output']={}),!_0x20c2fc['input']&&(_0x20c2fc['input']={}),!_0x20c2fc['hook']&&(_0x20c2fc['hook']={}),!_0x20c2fc['output']['metadata']&&(_0x20c2fc['output']['metadata']={}),_0x20c2fc['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x37a5c8['$self']=_0x20c2fc,_0x37a5c8['$job']=_0x37a5c8,_0x37a5c8;}['initPolicies'](_0x8e7332){const _0x5798b8=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x8e7332);_0x8e7332['metadata']['expire']=_0x5798b8;if(this['config']['persistent']!=undefined){const _0x3793af=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x8e7332);_0x8e7332['metadata']['persistent']=_0x3793af;}}['bindActivityData'](_0x278c64){this['context'][this['metadata']['aid']][_0x278c64]['data']=this['data'];}['resolveDad'](){let _0x599cf6=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x599cf6=_0x599cf6['substring'](0x0,_0x599cf6['lastIndexOf'](','))+','+this['adjacentIndex']),_0x599cf6;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x587dd7=[],_0x5ea651=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x4c0ddf=_0x5ea651['.'+this['metadata']['aid']],_0x1ebf08=this['resolveAdjacentDad']();if(_0x4c0ddf)for(const _0x2ba2c7 in _0x4c0ddf){const _0xdc21e0=_0x4c0ddf[_0x2ba2c7];mapper_1['MapperService']['evaluate'](_0xdc21e0,this['context'],this['code'])&&_0x587dd7['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x1ebf08,'aid':_0x2ba2c7,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x587dd7;}['isJobComplete'](_0x586ad8){return _0x586ad8<=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'](_0x17af04,_0x45ce87){if(this['jobWasInterrupted'](_0x45ce87))return;let _0x4646bd=[];(this['shouldEmit']()||this['isJobComplete'](_0x45ce87)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x45ce87)&&!this['shouldPersistJob']()});if(_0x17af04['length']&&!this['isJobComplete'](_0x45ce87)){const _0x4cf750=this['store']['transact']();for(const _0x4eac14 of _0x17af04){await this['engine']['router']?.['publishMessage'](null,_0x4eac14,_0x4cf750);}_0x4646bd=await _0x4cf750['exec']();}return _0x4646bd;}['jobWasInterrupted'](_0x1e43ec){return _0x1e43ec<-0x5f5e100;}}exports['Activity']=Activity;
|
|
1
|
+
'use strict';(function(_0x12a339,_0x1353ef){const _0x5836b8=_0x1c4b,_0x28c1c9=_0x12a339();while(!![]){try{const _0x188332=parseInt(_0x5836b8(0x15b))/0x1*(parseInt(_0x5836b8(0x15a))/0x2)+parseInt(_0x5836b8(0x155))/0x3*(parseInt(_0x5836b8(0x154))/0x4)+parseInt(_0x5836b8(0x158))/0x5+parseInt(_0x5836b8(0x159))/0x6+parseInt(_0x5836b8(0x15e))/0x7*(-parseInt(_0x5836b8(0x153))/0x8)+-parseInt(_0x5836b8(0x157))/0x9*(-parseInt(_0x5836b8(0x15d))/0xa)+parseInt(_0x5836b8(0x156))/0xb*(-parseInt(_0x5836b8(0x15c))/0xc);if(_0x188332===_0x1353ef)break;else _0x28c1c9['push'](_0x28c1c9['shift']());}catch(_0x477300){_0x28c1c9['push'](_0x28c1c9['shift']());}}}(_0x14d3,0x9f426));function _0x1c4b(_0x29794a,_0x5c3976){const _0x14d320=_0x14d3();return _0x1c4b=function(_0x1c4bd6,_0x2761dd){_0x1c4bd6=_0x1c4bd6-0x153;let _0x3d1e04=_0x14d320[_0x1c4bd6];return _0x3d1e04;},_0x1c4b(_0x29794a,_0x5c3976);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Activity']=void 0x0;function _0x14d3(){const _0x544eb2=['104dtXVgl','236FXPkHj','23067ZNIiCs','68233BAEcAb','18GemtGr','466725MpRWur','3994254biaBIj','2jbSIEP','481543cynISr','2292JyUqjY','5607910TzUAbJ','527009poESpC'];_0x14d3=function(){return _0x544eb2;};return _0x14d3();}const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream');class Activity{constructor(_0x3aed1b,_0x2baf3e,_0x17ffcc,_0x477991,_0x54fb56,_0x3fdffd){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x3aed1b,this['data']=_0x2baf3e,this['metadata']=_0x17ffcc,this['hook']=_0x477991,this['engine']=_0x54fb56,this['context']=_0x3fdffd||{'data':{},'metadata':{}},this['logger']=_0x54fb56['logger'],this['store']=_0x54fb56['store'];}['setLeg'](_0x3128c1){this['leg']=_0x3128c1;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x2f8d41=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x2f8d41!==undefined&&!isNaN(Number(_0x2f8d41)))return _0x2f8d41;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x19b21f=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x19b21f);}catch(_0x460874){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x19b21f>0x0){if(this['context']['metadata']['js']===_0x19b21f){const _0x1d85c6=await this['setStatus'](-_0x19b21f);Number(_0x1d85c6)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x460874;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x13b0f8=this['context']['metadata']['guid'];return this['setLeg'](0x2),await this['getState'](),collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid']),await collator_1['CollatorService']['notarizeReentry'](this,_0x13b0f8);}async['processEvent'](_0x42a37b=stream_1['StreamStatus']['SUCCESS'],_0x139637=0xc8,_0x5807ca='output'){this['setLeg'](0x2);const _0x2700d1=this['context']['metadata']['jid'];if(!_0x2700d1){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0xa20b0d=this['metadata']['aid'];this['status']=_0x42a37b,this['code']=_0x139637,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x2700d1,'aid':_0xa20b0d,'status':_0x42a37b,'code':_0x139637});let _0x433ba;try{const _0x626453=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x626453),_0x433ba=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x433ba['startActivitySpan'](this['leg']);let _0x494131;if(_0x42a37b===stream_1['StreamStatus']['PENDING'])_0x494131=await this['processPending'](_0x5807ca);else _0x42a37b===stream_1['StreamStatus']['SUCCESS']?_0x494131=await this['processSuccess'](_0x5807ca):_0x494131=await this['processError']();this['transitionAdjacent'](_0x494131,_0x433ba);}catch(_0x3a9d96){if(_0x3a9d96 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x3a9d96['fault']+'-error',{..._0x3a9d96});return;}else{if(_0x3a9d96 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x3a9d96});return;}else{if(_0x3a9d96 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x3a9d96});return;}else{if(_0x3a9d96 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x3a9d96});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x3a9d96,'message':_0x3a9d96['message'],'stack':_0x3a9d96['stack'],'name':_0x3a9d96['name']}),_0x433ba?.['setActivityError'](_0x3a9d96['message']);throw _0x3a9d96;}finally{_0x433ba?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x2700d1,'aid':_0xa20b0d});}}async['processPending'](_0x4ca24b){this['bindActivityData'](_0x4ca24b),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x4b644b=this['store']['transact']();return await this['setState'](_0x4b644b),await collator_1['CollatorService']['notarizeContinuation'](this,_0x4b644b),await this['setStatus'](this['adjacencyList']['length'],_0x4b644b),await _0x4b644b['exec']();}async['processSuccess'](_0x9d8f68){this['bindActivityData'](_0x9d8f68),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x10457a=this['store']['transact']();return await this['setState'](_0x10457a),await collator_1['CollatorService']['notarizeCompletion'](this,_0x10457a),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x10457a),await _0x10457a['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x44f04c=this['store']['transact']();return await this['setState'](_0x44f04c),await collator_1['CollatorService']['notarizeCompletion'](this,_0x44f04c),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x44f04c),await _0x44f04c['exec']();}async['transitionAdjacent'](_0x202f44,_0x5c604e){_0x5c604e['mapActivityAttributes']();const _0x454889=this['resolveStatus'](_0x202f44),_0x425b6d={'app.job.jss':_0x454889},_0x5f0d69=await this['transition'](this['adjacencyList'],_0x454889);_0x5f0d69?.['length']&&(_0x425b6d['app.activity.mids']=_0x5f0d69['join'](',')),_0x5c604e['setActivityAttributes'](_0x425b6d);}['resolveStatus'](_0x5f2b24){const _0x2e6b63=_0x5f2b24[_0x5f2b24['length']-0x1];return Array['isArray'](_0x2e6b63)?Number(_0x2e6b63[0x1]):Number(_0x2e6b63);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x397382=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x98dd1c=_0x397382['mapRules']();if(_0x98dd1c)for(const _0x5e7317 in _0x98dd1c){const _0x49125d=_0x5e7317['indexOf']('[');if(_0x49125d>-0x1){const _0x3297b2=_0x5e7317['substring'](_0x49125d+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x3297b2))){const _0x41c066=_0x5e7317['substring'](0x0,_0x49125d);_0x98dd1c[_0x41c066]=_0x98dd1c[_0x5e7317],delete _0x98dd1c[_0x5e7317];}else{if(_0x3297b2==='-'||_0x3297b2==='_'){const _0x26d514=_0x98dd1c[_0x5e7317];Object['keys'](_0x26d514)['forEach'](_0x5e162c=>{_0x98dd1c[_0x5e162c]=_0x26d514[_0x5e162c];});}}}}this['context']['data']=_0x98dd1c;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x5bce5f=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x5bce5f['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x74b1b3=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x23791b=_0x74b1b3['mapRules'](),_0x3fd8c8=this['metadata']['aid'],_0x26eb8c={...this['context'][_0x3fd8c8]['output'],..._0x23791b};this['context'][_0x3fd8c8]['output']['data']=_0x26eb8c;}}async['registerTimeout'](){}['bindActivityError'](_0x4161d0){const _0x45aca6=this['context'][this['metadata']['aid']]['output']['metadata'];_0x45aca6['err']=JSON['stringify'](this['data']),_0x45aca6['$error']={..._0x4161d0,'is_stream_error':!![]};}['bindJobError'](_0x4e6600){this['context']['metadata']['err']=JSON['stringify']({..._0x4e6600,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x570a2e,_0x32aa24){const {id:_0x3eb3d6}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x570a2e,this['context']['metadata']['jid'],_0x3eb3d6,_0x32aa24);}['authorizeEntry'](_0x44d90e){return this['adjacencyList']?.['map'](_0xbff8fe=>{const {metadata:{aid:_0x2902eb}}=_0xbff8fe;return _0x44d90e[_0x2902eb+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x2902eb;})??[];}['bindDimensionalAddress'](_0x1d1e9b){const _0x495a4f=this['resolveDad']();_0x1d1e9b[this['metadata']['aid']+'/output/metadata/dad']=_0x495a4f;}async['setState'](_0x37ea50){const _0x479098=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x3cab1b={};await this['bindJobState'](_0x3cab1b);const _0x540021=this['authorizeEntry'](_0x3cab1b);this['bindDimensionalAddress'](_0x3cab1b),this['bindActivityState'](_0x3cab1b);const _0x24f55f=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x540021],_0xeb6e0d=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x3cab1b,this['getJobStatus'](),_0x479098,_0x24f55f,_0xeb6e0d,_0x37ea50);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x37918e=this['context']['$self'];!_0x37918e['output']['metadata']&&(_0x37918e['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x37918e['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x4ea1d5=(0x0,utils_1['formatISODate'])(new Date());_0x37918e['output']['metadata']['ac']=_0x4ea1d5,_0x37918e['output']['metadata']['au']=_0x4ea1d5,_0x37918e['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x37918e['output']['metadata']['stp']=this['config']['subtype']),_0x37918e['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x2b0678){const _0x41b7fa=await this['getTriggerConfig'](),_0x5cf153=[..._0x41b7fa['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x297577 of _0x5cf153){const _0x11fc0d=(0x0,utils_1['getValueByPath'])(this['context'],_0x297577);_0x11fc0d!==undefined&&(_0x2b0678[_0x297577]=_0x11fc0d);}for(const _0x275a7a in this['context']?.['data']??{}){(_0x275a7a['startsWith']('-')||_0x275a7a['startsWith']('_'))&&(_0x2b0678[_0x275a7a]=this['context']['data'][_0x275a7a]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x2b0678,this['config'],this['context']);}['bindActivityState'](_0x1ce3cb){const _0x136ae7=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x1911d3 of _0x136ae7){const _0x2fc2e7=this['metadata']['aid']+'/'+_0x1911d3,_0x273c17=(0x0,utils_1['getValueByPath'])(this['context'],_0x2fc2e7);_0x273c17!==undefined&&(_0x1ce3cb[_0x2fc2e7]=_0x273c17);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x1ce3cb,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x1482f8=>'metadata/'+_0x1482f8);}['bindActivityMetadataPaths'](){const _0x2a1d7e=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x2a1d7e]['KEYS']['map'](_0x2d3fee=>'output/metadata/'+_0x2d3fee);}async['getState'](){const _0x356e77=this['context']['metadata']['gid'],_0x5eb7c7='$'+this['config']['subscribes'],_0x48ab06={[_0x5eb7c7]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x392be7=>'metadata/'+_0x392be7)};for(let [_0x12dae9,_0x67bda3]of Object['entries'](this['config']['consumes'])){if(_0x12dae9==='$job')for(const _0x54a5f6 of _0x67bda3){_0x48ab06[_0x5eb7c7]['push'](_0x54a5f6);}else{_0x12dae9==='$self'&&(_0x12dae9=this['metadata']['aid']);!_0x48ab06[_0x12dae9]&&(_0x48ab06[_0x12dae9]=[]);for(const _0x536384 of _0x67bda3){_0x48ab06[_0x12dae9]['push'](_0x12dae9+'/'+_0x536384);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x48ab06,this['config'],this['metadata'],this['leg']);const {dad:_0x17d833,jid:_0x1743ef}=this['context']['metadata'],_0x1ad9e9=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x17d833||''),[_0x167aa1,_0x518cba]=await this['store']['getState'](_0x1743ef,_0x48ab06,_0x1ad9e9);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x167aa1),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x356e77),this['initDimensionalAddress'](_0x17d833),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x10c2a9,_0xe29c4f){if(_0xe29c4f!==_0x10c2a9)throw new errors_1['GenerationalError'](_0x10c2a9,_0xe29c4f,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0xa47918){this['metadata']['dad']=_0xa47918;}['initSelf'](_0x361a7c){const _0x251f80=this['metadata']['aid'];!_0x361a7c[_0x251f80]&&(_0x361a7c[_0x251f80]={});const _0x4c91d3=_0x361a7c[_0x251f80];return!_0x4c91d3['output']&&(_0x4c91d3['output']={}),!_0x4c91d3['input']&&(_0x4c91d3['input']={}),!_0x4c91d3['hook']&&(_0x4c91d3['hook']={}),!_0x4c91d3['output']['metadata']&&(_0x4c91d3['output']['metadata']={}),_0x4c91d3['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x361a7c['$self']=_0x4c91d3,_0x361a7c['$job']=_0x361a7c,_0x361a7c;}['initPolicies'](_0x4870d5){const _0x2b9ac9=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x4870d5);_0x4870d5['metadata']['expire']=_0x2b9ac9;if(this['config']['persistent']!=undefined){const _0x17f130=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x4870d5);_0x4870d5['metadata']['persistent']=_0x17f130;}}['bindActivityData'](_0x31b384){this['context'][this['metadata']['aid']][_0x31b384]['data']=this['data'];}['resolveDad'](){let _0x2ad174=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x2ad174=_0x2ad174['substring'](0x0,_0x2ad174['lastIndexOf'](','))+','+this['adjacentIndex']),_0x2ad174;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x2d33e4=[],_0x48873b=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x5a00ab=_0x48873b['.'+this['metadata']['aid']],_0x290136=this['resolveAdjacentDad']();if(_0x5a00ab)for(const _0x5bd137 in _0x5a00ab){const _0xfa9d9e=_0x5a00ab[_0x5bd137];mapper_1['MapperService']['evaluate'](_0xfa9d9e,this['context'],this['code'])&&_0x2d33e4['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x290136,'aid':_0x5bd137,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x2d33e4;}['isJobComplete'](_0x562e9f){return _0x562e9f<=0x0;}['shouldEmit'](){if(this['config']['emit'])return pipe_1['Pipe']['resolve'](this['config']['emit'],this['context'])===!![];return![];}['shouldPersistJob'](){if(this['config']['persist']!==undefined)return pipe_1['Pipe']['resolve'](this['config']['persist'],this['context'])===!![];return![];}async['transition'](_0x25451f,_0x2ef796){if(this['jobWasInterrupted'](_0x2ef796))return;let _0x36f25c=[];(this['shouldEmit']()||this['isJobComplete'](_0x2ef796)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x2ef796)&&!this['shouldPersistJob']()});if(_0x25451f['length']&&!this['isJobComplete'](_0x2ef796)){const _0x2ab0d6=this['store']['transact']();for(const _0x3686f3 of _0x25451f){await this['engine']['router']?.['publishMessage'](null,_0x3686f3,_0x2ab0d6);}_0x36f25c=await _0x2ab0d6['exec']();}return _0x36f25c;}['jobWasInterrupted'](_0x51cd09){return _0x51cd09<-0x5f5e100;}}exports['Activity']=Activity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x43dea2,_0x46cc78){const _0x49e86f=_0x1cf4,_0x34c476=_0x43dea2();while(!![]){try{const _0x226380=-parseInt(_0x49e86f(0x1b7))/0x1+-parseInt(_0x49e86f(0x1b4))/0x2*(-parseInt(_0x49e86f(0x1b3))/0x3)+parseInt(_0x49e86f(0x1b0))/0x4+parseInt(_0x49e86f(0x1b5))/0x5+parseInt(_0x49e86f(0x1b6))/0x6+-parseInt(_0x49e86f(0x1b1))/0x7+parseInt(_0x49e86f(0x1b2))/0x8;if(_0x226380===_0x46cc78)break;else _0x34c476['push'](_0x34c476['shift']());}catch(_0x99632f){_0x34c476['push'](_0x34c476['shift']());}}}(_0x3dae,0xe2715));function _0x1cf4(_0x2d27a9,_0x48c685){const _0x3dae6f=_0x3dae();return _0x1cf4=function(_0x1cf4d9,_0x31d127){_0x1cf4d9=_0x1cf4d9-0x1b0;let _0x28b2da=_0x3dae6f[_0x1cf4d9];return _0x28b2da;},_0x1cf4(_0x2d27a9,_0x48c685);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Await']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream'),activity_1=require('./activity');class Await extends activity_1['Activity']{constructor(_0x4e651d,_0x15c6d9,_0xeda5b7,_0x4d5f06,_0x2f6cb0,_0xae3c3e){super(_0x4e651d,_0x15c6d9,_0xeda5b7,_0x4d5f06,_0x2f6cb0,_0xae3c3e);}async['process'](){this['logger']['debug']('await-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x511178;try{await this['verifyEntry'](),_0x511178=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x511178['startActivitySpan'](this['leg']),this['mapInputData']();const _0x4e4e9c=this['store']['transact'](),_0x32b7ca=await this['execActivity'](_0x4e4e9c);await collator_1['CollatorService']['authorizeReentry'](this,_0x4e4e9c),await this['setState'](_0x4e4e9c),await this['setStatus'](0x0,_0x4e4e9c);const _0x4d8ae9=await _0x4e4e9c['exec']();_0x511178['mapActivityAttributes']();const _0x48d423=this['resolveStatus'](_0x4d8ae9);return _0x511178['setActivityAttributes']({'app.activity.mid':_0x32b7ca,'app.job.jss':_0x48d423}),this['context']['metadata']['aid'];}catch(_0x298b4b){if(_0x298b4b instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x298b4b});return;}else{if(_0x298b4b instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x298b4b});return;}else{if(_0x298b4b instanceof errors_1['GetStateError']){this['logger']['error']('await-get-state-error',{..._0x298b4b});return;}else{if(_0x298b4b instanceof errors_1['CollationError']){if(_0x298b4b['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',{..._0x298b4b});}else this['logger']['error']('await-process-error',{..._0x298b4b});}}}_0x511178?.['setActivityError'](_0x298b4b['message']);throw _0x298b4b;}finally{_0x511178?.['endActivitySpan'](),this['logger']['debug']('await-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x13173f){const _0x236209=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x5e0b53={'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':_0x236209,'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 _0x2cbde1=pipe_1['Pipe']['resolve'](this['config']['await'],this['context']);_0x2cbde1===![]&&(_0x5e0b53['metadata']['await']=![]);}return this['config']['retry']&&(_0x5e0b53['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](null,_0x5e0b53,_0x13173f);}}exports['Await']=Await;function _0x3dae(){const _0x40da46=['1390320HDEWbv','933pvBGpH','1808aFZinH','4702240zGmKGE','7848546JOaGKq','1431983Tfoqao','4063228ujnlyu','9518516bkOPse'];_0x3dae=function(){return _0x40da46;};return _0x3dae();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x379f8a,_0x3a0116){const _0x9fa755=_0x1817,_0x16326e=_0x379f8a();while(!![]){try{const _0x5d585e=parseInt(_0x9fa755(0xb7))/0x1+parseInt(_0x9fa755(0xb8))/0x2*(-parseInt(_0x9fa755(0xbe))/0x3)+parseInt(_0x9fa755(0xbc))/0x4*(-parseInt(_0x9fa755(0xbb))/0x5)+-parseInt(_0x9fa755(0xc1))/0x6+parseInt(_0x9fa755(0xc2))/0x7*(-parseInt(_0x9fa755(0xba))/0x8)+-parseInt(_0x9fa755(0xbf))/0x9*(parseInt(_0x9fa755(0xb9))/0xa)+-parseInt(_0x9fa755(0xc0))/0xb*(-parseInt(_0x9fa755(0xbd))/0xc);if(_0x5d585e===_0x3a0116)break;else _0x16326e['push'](_0x16326e['shift']());}catch(_0x424df1){_0x16326e['push'](_0x16326e['shift']());}}}(_0x41a8,0xc7465));function _0x1817(_0x2eb338,_0x2de141){const _0x41a8d9=_0x41a8();return _0x1817=function(_0x1817f9,_0x17132d){_0x1817f9=_0x1817f9-0xb7;let _0x502001=_0x41a8d9[_0x1817f9];return _0x502001;},_0x1817(_0x2eb338,_0x2de141);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Cycle']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),telemetry_1=require('../telemetry'),activity_1=require('./activity');function _0x41a8(){const _0x14324e=['6979221pMVAhf','30346712kCidNP','991014BJadHr','20118igKBQm','330925CQFEzi','5292EBRwzB','10RvXFnc','1240rzAGQN','103655KTgTVX','88nYMKES','12qdXwtD','489OeDXbN'];_0x41a8=function(){return _0x14324e;};return _0x41a8();}class Cycle extends activity_1['Activity']{constructor(_0x44219e,_0x539055,_0x485bf9,_0x5e384b,_0x2ee232,_0x3c9ab6){super(_0x44219e,_0x539055,_0x485bf9,_0x5e384b,_0x2ee232,_0x3c9ab6);}async['process'](){this['logger']['debug']('cycle-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x1bd80a;try{await this['verifyEntry'](),_0x1bd80a=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x1bd80a['startActivitySpan'](this['leg']),this['mapInputData']();let _0x1b1d3c=this['store']['transact']();await this['setState'](_0x1b1d3c),await this['setStatus'](0x0,_0x1b1d3c);const _0x45bcf8=await _0x1b1d3c['exec']();_0x1bd80a['mapActivityAttributes']();const _0x2315f4=this['resolveStatus'](_0x45bcf8);_0x1b1d3c=this['store']['transact']();const _0x5be523=await this['cycleAncestorActivity'](_0x1b1d3c);return _0x1bd80a['setActivityAttributes']({'app.activity.mid':_0x5be523,'app.job.jss':_0x2315f4}),await collator_1['CollatorService']['notarizeEarlyExit'](this,_0x1b1d3c),await _0x1b1d3c['exec'](),this['context']['metadata']['aid'];}catch(_0x2e5cee){if(_0x2e5cee instanceof errors_1['InactiveJobError']){this['logger']['error']('cycle-inactive-job-error',{..._0x2e5cee});return;}else{if(_0x2e5cee instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x2e5cee});return;}else{if(_0x2e5cee instanceof errors_1['GetStateError']){this['logger']['error']('cycle-get-state-error',{..._0x2e5cee});return;}else{if(_0x2e5cee instanceof errors_1['CollationError']){if(_0x2e5cee['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',{..._0x2e5cee});}else this['logger']['error']('cycle-process-error',{..._0x2e5cee});}}}_0x1bd80a?.['setActivityError'](_0x2e5cee['message']);throw _0x2e5cee;}finally{_0x1bd80a?.['endActivitySpan'](),this['logger']['debug']('cycle-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['cycleAncestorActivity'](_0x2ca104){this['mapInputData']();const _0x432de2={'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,_0x432de2,_0x2ca104);}}exports['Cycle']=Cycle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0xe0d0e,_0x3e0717){const _0x29d077=_0x36bd,_0x357aeb=_0xe0d0e();while(!![]){try{const _0x22619a=-parseInt(_0x29d077(0x11a))/0x1*(-parseInt(_0x29d077(0x118))/0x2)+-parseInt(_0x29d077(0x11f))/0x3*(parseInt(_0x29d077(0x119))/0x4)+-parseInt(_0x29d077(0x11d))/0x5*(-parseInt(_0x29d077(0x11c))/0x6)+-parseInt(_0x29d077(0x117))/0x7+parseInt(_0x29d077(0x116))/0x8*(parseInt(_0x29d077(0x115))/0x9)+parseInt(_0x29d077(0x11e))/0xa+-parseInt(_0x29d077(0x120))/0xb*(parseInt(_0x29d077(0x11b))/0xc);if(_0x22619a===_0x3e0717)break;else _0x357aeb['push'](_0x357aeb['shift']());}catch(_0x2a0161){_0x357aeb['push'](_0x357aeb['shift']());}}}(_0x4127,0x2beb1));function _0x4127(){const _0x3f3015=['3446850zxWZiQ','501aHTKhw','4609tFBrmt','14139tieJnW','360DrmPwI','543732IBBqMX','641524HCqhUd','7908TZWmXQ','1WYClpt','12792EdTmLE','61704HtWokt','145YxAfXG'];_0x4127=function(){return _0x3f3015;};return _0x4127();}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');function _0x36bd(_0x323920,_0x57e4a6){const _0x4127d1=_0x4127();return _0x36bd=function(_0x36bd21,_0x3caf20){_0x36bd21=_0x36bd21-0x115;let _0x24f081=_0x4127d1[_0x36bd21];return _0x24f081;},_0x36bd(_0x323920,_0x57e4a6);}class Hook extends activity_1['Activity']{constructor(_0x26540d,_0x57ef5d,_0x1010c0,_0x4f52bf,_0x2ff8cc,_0x30fdc5){super(_0x26540d,_0x57ef5d,_0x1010c0,_0x4f52bf,_0x2ff8cc,_0x30fdc5);}async['process'](){this['logger']['debug']('hook-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x35480c;try{return await this['verifyEntry'](),_0x35480c=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x35480c['startActivitySpan'](this['leg']),this['doesHook']()?await this['doHook'](_0x35480c):await this['doPassThrough'](_0x35480c),this['context']['metadata']['aid'];}catch(_0x5ee42f){if(_0x5ee42f instanceof errors_1['InactiveJobError']){this['logger']['error']('hook-inactive-job-error',{..._0x5ee42f});return;}else{if(_0x5ee42f instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x5ee42f});return;}else{if(_0x5ee42f instanceof errors_1['GetStateError']){this['logger']['error']('hook-get-state-error',{..._0x5ee42f});return;}else{if(_0x5ee42f instanceof errors_1['CollationError']){if(_0x5ee42f['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',{..._0x5ee42f});}else this['logger']['error']('hook-process-error',{..._0x5ee42f});}}}_0x35480c?.['setActivityError'](_0x5ee42f['message']);throw _0x5ee42f;}finally{_0x35480c?.['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 _0x552d45=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return!isNaN(_0x552d45)&&Number(_0x552d45)>0x0;}return!!this['config']['hook']?.['topic'];}async['doHook'](_0x964834){const _0x53ee71=this['store']['transact']();await this['registerHook'](enums_1['HMSH_IS_CLUSTER']?undefined:_0x53ee71),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x53ee71),await collator_1['CollatorService']['authorizeReentry'](this,_0x53ee71),await this['setStatus'](0x0,_0x53ee71),await _0x53ee71['exec'](),_0x964834['mapActivityAttributes']();}async['doPassThrough'](_0x1b5b61){const _0x377310=this['store']['transact']();let _0x46efaf;this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x377310),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x377310),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x377310),_0x46efaf=await _0x377310['exec'](),_0x1b5b61['mapActivityAttributes']();const _0x16459c=this['resolveStatus'](_0x46efaf),_0x3dcf3d={'app.job.jss':_0x16459c},_0x292e47=await this['transition'](this['adjacencyList'],_0x16459c);_0x292e47['length']&&(_0x3dcf3d['app.activity.mids']=_0x292e47['join'](',')),_0x1b5b61['setActivityAttributes'](_0x3dcf3d);}async['getHookRule'](_0x224db3){const _0x38dc48=await this['store']['getHookRules']();return _0x38dc48?.[_0x224db3]?.[0x0];}async['registerHook'](_0x5c02ee){if(this['config']['hook']?.['topic'])return await this['engine']['taskService']['registerWebHook'](this['config']['hook']['topic'],this['context'],this['resolveDad'](),this['context']['metadata']['expire'],_0x5c02ee);else{if(this['config']['sleep']){const _0x3a3b66=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',_0x3a3b66,this['metadata']['dad']||''),this['context']['metadata']['jid'];}}}async['processWebHookEvent'](_0x22c134=stream_1['StreamStatus']['SUCCESS'],_0x9e1c64=0xc8){this['logger']['debug']('hook-process-web-hook-event',{'topic':this['config']['hook']['topic'],'aid':this['metadata']['aid'],'status':_0x22c134,'code':_0x9e1c64});const _0x29c66c=new task_1['TaskService'](this['store'],this['logger']),_0x4061e8={...this['data']},_0x183ccd=await _0x29c66c['processWebHookSignal'](this['config']['hook']['topic'],_0x4061e8);if(_0x183ccd){const [_0x373306,_0x5e691a,_0x42a9fc,_0x3ce81]=_0x183ccd;this['context']['metadata']['jid']=_0x373306,this['context']['metadata']['gid']=_0x3ce81,this['context']['metadata']['dad']=_0x42a9fc,await this['processEvent'](_0x22c134,_0x9e1c64,'hook'),_0x9e1c64===0xc8&&await _0x29c66c['deleteWebHookSignal'](this['config']['hook']['topic'],_0x4061e8);}}async['processTimeHookEvent'](_0x3def65){this['logger']['debug']('hook-process-time-hook-event',{'jid':_0x3def65,'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']}),await this['processEvent'](stream_1['StreamStatus']['SUCCESS'],0xc8,'hook');}}exports['Hook']=Hook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x5e1b8e,_0x28bc95){const _0xe9971=_0x1b52,_0x159620=_0x5e1b8e();while(!![]){try{const _0x20d259=-parseInt(_0xe9971(0xb6))/0x1*(parseInt(_0xe9971(0xb2))/0x2)+parseInt(_0xe9971(0xaf))/0x3+parseInt(_0xe9971(0xb0))/0x4*(-parseInt(_0xe9971(0xb8))/0x5)+-parseInt(_0xe9971(0xb7))/0x6*(-parseInt(_0xe9971(0xb9))/0x7)+parseInt(_0xe9971(0xb3))/0x8*(-parseInt(_0xe9971(0xb5))/0x9)+parseInt(_0xe9971(0xb1))/0xa+parseInt(_0xe9971(0xb4))/0xb;if(_0x20d259===_0x28bc95)break;else _0x159620['push'](_0x159620['shift']());}catch(_0x53a9ff){_0x159620['push'](_0x159620['shift']());}}}(_0x5940,0x521fa));Object['defineProperty'](exports,'__esModule',{'value':!![]});function _0x1b52(_0x32a6ff,_0x502e12){const _0x59403c=_0x5940();return _0x1b52=function(_0x1b5285,_0x162e02){_0x1b5285=_0x1b5285-0xaf;let _0x340fea=_0x59403c[_0x1b5285];return _0x340fea;},_0x1b52(_0x32a6ff,_0x502e12);}function _0x5940(){const _0x489421=['1176714NjZBuA','18099GBfTaR','1jQLiAI','4722iLopMR','10HFETZV','1568miwzdy','1358493zudAji','627904EybYLg','209830QspPXs','161206jgAXkk','104Frxkty'];_0x5940=function(){return _0x489421;};return _0x5940();}const activity_1=require('./activity'),await_1=require('./await'),cycle_1=require('./cycle'),hook_1=require('./hook'),interrupt_1=require('./interrupt'),signal_1=require('./signal'),trigger_1=require('./trigger'),worker_1=require('./worker');exports['default']={'activity':activity_1['Activity'],'await':await_1['Await'],'cycle':cycle_1['Cycle'],'hook':hook_1['Hook'],'interrupt':interrupt_1['Interrupt'],'signal':signal_1['Signal'],'trigger':trigger_1['Trigger'],'worker':worker_1['Worker']};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x38276b,_0x294ee7){const _0x2f0a25=_0x4d58,_0x50675e=_0x38276b();while(!![]){try{const _0x3ef77d=-parseInt(_0x2f0a25(0xee))/0x1*(parseInt(_0x2f0a25(0xf2))/0x2)+-parseInt(_0x2f0a25(0xe9))/0x3*(parseInt(_0x2f0a25(0xe8))/0x4)+-parseInt(_0x2f0a25(0xf0))/0x5*(-parseInt(_0x2f0a25(0xef))/0x6)+parseInt(_0x2f0a25(0xeb))/0x7+parseInt(_0x2f0a25(0xe7))/0x8+-parseInt(_0x2f0a25(0xed))/0x9*(-parseInt(_0x2f0a25(0xf1))/0xa)+parseInt(_0x2f0a25(0xea))/0xb*(-parseInt(_0x2f0a25(0xec))/0xc);if(_0x3ef77d===_0x294ee7)break;else _0x50675e['push'](_0x50675e['shift']());}catch(_0x3b5d70){_0x50675e['push'](_0x50675e['shift']());}}}(_0xfb67,0xa46fb));function _0x4d58(_0x4fd63a,_0x523334){const _0xfb67ff=_0xfb67();return _0x4d58=function(_0x4d586f,_0x1b4c83){_0x4d586f=_0x4d586f-0xe7;let _0x1a665b=_0xfb67ff[_0x4d586f];return _0x1a665b;},_0x4d58(_0x4fd63a,_0x523334);}function _0xfb67(){const _0x103e79=['4129065CFQKjU','5310yHtRRZ','4fAsyqE','10576536wSHxxO','1040oboxgV','9807XRttRU','76439uazelq','138117MeHssK','204kbmtTS','8973KqMYjn','527707qlwZfS','6SivfuB'];_0xfb67=function(){return _0x103e79;};return _0xfb67();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Interrupt']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Interrupt extends activity_1['Activity']{constructor(_0x224759,_0x18cdcd,_0x23ad1e,_0x360c45,_0x474633,_0x1ad51a){super(_0x224759,_0x18cdcd,_0x23ad1e,_0x360c45,_0x474633,_0x1ad51a);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x5dea67;try{await this['verifyEntry'](),_0x5dea67=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x5dea67['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0x5dea67):await this['interruptAnother'](_0x5dea67);}catch(_0x12ef4e){if(_0x12ef4e instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0x12ef4e});return;}else{if(_0x12ef4e instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x12ef4e});return;}else{if(_0x12ef4e instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0x12ef4e});return;}else{if(_0x12ef4e instanceof errors_1['CollationError']){if(_0x12ef4e['fault']==='duplicate'){this['logger']['info']('interrupt-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('interrupt-collation-error',{..._0x12ef4e});}else this['logger']['error']('interrupt-process-error',{..._0x12ef4e});}}}_0x5dea67?.['setActivityError'](_0x12ef4e['message']);throw _0x12ef4e;}finally{_0x5dea67?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x1d9ecb){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x5997b4=await this['interrupt']();_0x1d9ecb['mapActivityAttributes']();const _0xff5b0a=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0xff5b0a),await this['setStatus'](-0x1,_0xff5b0a);const _0x495b21=await _0xff5b0a['exec'](),_0xe6b839=this['resolveStatus'](_0x495b21);return _0x1d9ecb['setActivityAttributes']({'app.activity.mid':_0x5997b4,'app.job.jss':_0xe6b839}),this['context']['metadata']['aid'];}async['interruptAnother'](_0x4d9417){const _0x31f677=await this['interrupt'](),_0x1440ec={'app.activity.mid':_0x31f677};_0x4d9417['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x1073e3=this['store']['transact']();await this['setState'](_0x1073e3);}const _0x4a0499=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x4a0499),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x4a0499);const _0x5c69b0=await _0x4a0499['exec'](),_0x3d9df9=this['resolveStatus'](_0x5c69b0);_0x1440ec['app.job.jss']=_0x3d9df9;const _0x5bc97c=await this['transition'](this['adjacencyList'],_0x3d9df9);return _0x5bc97c['length']&&(_0x1440ec['app.activity.mids']=_0x5bc97c['join'](',')),_0x4d9417['setActivityAttributes'](_0x1440ec),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0x1b314d=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0x1b314d==this['context']['metadata']['jid'];}['resolveInterruptOptions'](){return{'reason':this['config']['reason']!==undefined?pipe_1['Pipe']['resolve'](this['config']['reason'],this['context']):undefined,'throw':this['config']['throw']!==undefined?pipe_1['Pipe']['resolve'](this['config']['throw'],this['context']):undefined,'descend':this['config']['descend']!==undefined?pipe_1['Pipe']['resolve'](this['config']['descend'],this['context']):undefined,'code':this['config']['code']!==undefined?pipe_1['Pipe']['resolve'](this['config']['code'],this['context']):undefined,'expire':this['config']['expire']!==undefined?pipe_1['Pipe']['resolve'](this['config']['expire'],this['context']):undefined,'stack':this['config']['stack']!==undefined?pipe_1['Pipe']['resolve'](this['config']['stack'],this['context']):undefined};}async['interrupt'](){const _0x5a8f71=this['resolveInterruptOptions']();return await this['engine']['interrupt'](this['config']['topic']!==undefined?pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']):this['context']['metadata']['tpc'],this['config']['target']!==undefined?pipe_1['Pipe']['resolve'](this['config']['target'],this['context']):this['context']['metadata']['jid'],_0x5a8f71);}}exports['Interrupt']=Interrupt;
|