@hotmeshio/hotmesh 0.3.20 → 0.3.21
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 +3 -5
- package/build/services/meshdata/index.d.ts +3 -4
- package/build/services/meshdata/index.js +4 -9
- package/build/services/meshflow/client.js +1 -2
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/worker.js +5 -8
- 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(_0x5de672,_0x4076e2){const _0x445b9f=_0x5a6d,_0x42aeeb=_0x5de672();while(!![]){try{const _0x37a554=-parseInt(_0x445b9f(0x1c7))/0x1+-parseInt(_0x445b9f(0x1c8))/0x2*(parseInt(_0x445b9f(0x1ca))/0x3)+parseInt(_0x445b9f(0x1cc))/0x4+-parseInt(_0x445b9f(0x1cd))/0x5*(parseInt(_0x445b9f(0x1c9))/0x6)+-parseInt(_0x445b9f(0x1cb))/0x7*(parseInt(_0x445b9f(0x1d0))/0x8)+parseInt(_0x445b9f(0x1ce))/0x9+-parseInt(_0x445b9f(0x1d1))/0xa*(-parseInt(_0x445b9f(0x1cf))/0xb);if(_0x37a554===_0x4076e2)break;else _0x42aeeb['push'](_0x42aeeb['shift']());}catch(_0x258c05){_0x42aeeb['push'](_0x42aeeb['shift']());}}}(_0x41e0,0xeea5c));function _0x41e0(){const _0x49b5c3=['21732jtokyl','1731wtSrLU','905366oPIGPD','1817468JgEzyq','910ezDmCV','13365540UwjDUO','17299491fKFcHu','32ZUTLDz','10KAcILJ','463125nwjCVM','3102RJXYOM'];_0x41e0=function(){return _0x49b5c3;};return _0x41e0();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['VALSEP']=exports['WEBSEP']=exports['TYPSEP']=exports['KEYSEP']=exports['HMNS']=exports['KeyType']=exports['KeyService']=void 0x0;const hotmesh_1=require('../types/hotmesh');Object['defineProperty'](exports,'KeyType',{'enumerable':!![],'get':function(){return hotmesh_1['KeyType'];}});const HMNS='hmsh';exports['HMNS']=HMNS;const KEYSEP=':';exports['KEYSEP']=KEYSEP;const VALSEP='::';exports['VALSEP']=VALSEP;const WEBSEP='::';exports['WEBSEP']=WEBSEP;const TYPSEP='::';exports['TYPSEP']=TYPSEP;function _0x5a6d(_0xd319f6,_0x5dbacf){const _0x41e0ad=_0x41e0();return _0x5a6d=function(_0x5a6da9,_0x371871){_0x5a6da9=_0x5a6da9-0x1c7;let _0xc2e3c7=_0x41e0ad[_0x5a6da9];return _0xc2e3c7;},_0x5a6d(_0xd319f6,_0x5dbacf);}class KeyService{static['mintKey'](_0x39fe19,_0x5738e9,_0x3eb716){switch(_0x5738e9){case hotmesh_1['KeyType']['HOTMESH']:return _0x39fe19;case hotmesh_1['KeyType']['THROTTLE_RATE']:return _0x39fe19+':'+_0x3eb716['appId']+':r:';case hotmesh_1['KeyType']['WORK_ITEMS']:return _0x39fe19+':'+_0x3eb716['appId']+':w:'+(_0x3eb716['scoutType']||'');case hotmesh_1['KeyType']['TIME_RANGE']:return _0x39fe19+':'+_0x3eb716['appId']+':t:'+(_0x3eb716['timeValue']||'');case hotmesh_1['KeyType']['APP']:return _0x39fe19+':a:'+(_0x3eb716['appId']||'');case hotmesh_1['KeyType']['QUORUM']:return _0x39fe19+':'+_0x3eb716['appId']+':q:'+(_0x3eb716['engineId']||'');case hotmesh_1['KeyType']['JOB_STATE']:return _0x39fe19+':'+_0x3eb716['appId']+':j:'+_0x3eb716['jobId'];case hotmesh_1['KeyType']['JOB_DEPENDENTS']:return _0x39fe19+':'+_0x3eb716['appId']+':d:'+_0x3eb716['jobId'];case hotmesh_1['KeyType']['JOB_STATS_GENERAL']:return _0x39fe19+':'+_0x3eb716['appId']+':s:'+_0x3eb716['jobKey']+':'+_0x3eb716['dateTime'];case hotmesh_1['KeyType']['JOB_STATS_MEDIAN']:return _0x39fe19+':'+_0x3eb716['appId']+':s:'+_0x3eb716['jobKey']+':'+_0x3eb716['dateTime']+':'+_0x3eb716['facet'];case hotmesh_1['KeyType']['JOB_STATS_INDEX']:return _0x39fe19+':'+_0x3eb716['appId']+':s:'+_0x3eb716['jobKey']+':'+_0x3eb716['dateTime']+':'+_0x3eb716['facet'];case hotmesh_1['KeyType']['SCHEMAS']:return _0x39fe19+':'+_0x3eb716['appId']+':v:'+_0x3eb716['appVersion']+':schemas';case hotmesh_1['KeyType']['SUBSCRIPTIONS']:return _0x39fe19+':'+_0x3eb716['appId']+':v:'+_0x3eb716['appVersion']+':subscriptions';case hotmesh_1['KeyType']['SUBSCRIPTION_PATTERNS']:return _0x39fe19+':'+_0x3eb716['appId']+':v:'+_0x3eb716['appVersion']+':transitions';case hotmesh_1['KeyType']['HOOKS']:return _0x39fe19+':'+_0x3eb716['appId']+':hooks';case hotmesh_1['KeyType']['SIGNALS']:return _0x39fe19+':'+_0x3eb716['appId']+':signals';case hotmesh_1['KeyType']['SYMKEYS']:return _0x39fe19+':'+_0x3eb716['appId']+':sym:keys:'+(_0x3eb716['activityId']||'');case hotmesh_1['KeyType']['SYMVALS']:return _0x39fe19+':'+_0x3eb716['appId']+':sym:vals:';case hotmesh_1['KeyType']['STREAMS']:return _0x39fe19+':'+(_0x3eb716['appId']||'')+':x:'+(_0x3eb716['topic']||'');default:throw new Error('Invalid\x20key\x20type.');}}static['parseKey'](_0x1c6f7d){const [_0x4d1c9b,_0x5f3d5d,_0x123d25,..._0x4eb36e]=_0x1c6f7d['split'](KEYSEP),_0x11620e=_0x4eb36e['join'](KEYSEP)||'';return{'namespace':_0x4d1c9b,'app':_0x123d25==='a'?_0x5f3d5d:undefined,'entity':_0x123d25,'id':_0x11620e};}static['reconstituteKey'](_0x18e46b){const {namespace:_0x303759,app:_0x5c4783,entity:_0x5eadcb,id:_0x43d11d}=_0x18e46b;return''+_0x303759+KEYSEP+_0x5c4783+KEYSEP+_0x5eadcb+KEYSEP+(_0x43d11d||'');}static['resolveEntityType'](_0x7d22c8,_0x51945f=''){switch(_0x7d22c8){case'a':return'applications';case'r':return'throttles';case'w':return _0x51945f===''?'task_priorities':'roles';case't':return _0x51945f===''?'task_schedules':'task_lists';case'q':return'events';case'j':return'jobs';case's':return'stats';case'v':return'versions';case'x':return _0x51945f===''?'streams':'stream_topics';case'hooks':return'signal_patterns';case'signals':return'signal_registry';case'sym':return'symbols';default:return'unknown_entity';}}static['resolveAbbreviation'](_0x3ec8de){switch(_0x3ec8de){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(_0x4f4094,_0x1268a3){const _0x12d838=_0x23e3,_0x29a595=_0x4f4094();while(!![]){try{const _0x3a17a9=-parseInt(_0x12d838(0xe5))/0x1*(-parseInt(_0x12d838(0xee))/0x2)+parseInt(_0x12d838(0xec))/0x3*(parseInt(_0x12d838(0xe6))/0x4)+parseInt(_0x12d838(0xe4))/0x5+-parseInt(_0x12d838(0xeb))/0x6+-parseInt(_0x12d838(0xe9))/0x7*(parseInt(_0x12d838(0xea))/0x8)+parseInt(_0x12d838(0xe7))/0x9*(parseInt(_0x12d838(0xe8))/0xa)+parseInt(_0x12d838(0xed))/0xb;if(_0x3a17a9===_0x1268a3)break;else _0x29a595['push'](_0x29a595['shift']());}catch(_0x26be96){_0x29a595['push'](_0x29a595['shift']());}}}(_0x2a33,0xb4422));var __importDefault=this&&this['__importDefault']||function(_0x5932c9){return _0x5932c9&&_0x5932c9['__esModule']?_0x5932c9:{'default':_0x5932c9};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['isStreamMessage']=exports['parseStreamMessage']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['polyfill']=exports['identifyProvider']=exports['XSleepFor']=exports['sleepImmediate']=exports['sleepFor']=exports['guid']=exports['deterministicRandom']=exports['deepCopy']=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),logger_1=require('../services/logger'),enums_1=require('./enums'),logger=new logger_1['LoggerService']('hotmesh','utils'),hashOptions=_0xfa883b=>{const _0x298cc7=JSON['stringify'](_0xfa883b);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x298cc7)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0xfde52=os_1['default']['totalmem'](),_0xf545fc=os_1['default']['freemem'](),_0x4f1eb8=_0xfde52-_0xf545fc,_0x4b4226={'TotalMemoryGB':(_0xfde52/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0xf545fc/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x4f1eb8/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x4b4226;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x513957){return JSON['parse'](JSON['stringify'](_0x513957));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x2096f0){const _0x3147fa=Math['sin'](_0x2096f0)*0x2710;return _0x3147fa-Math['floor'](_0x3147fa);}exports['deterministicRandom']=deterministicRandom;function guid(_0x3b5a22=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x3b5a22);}exports['guid']=guid;function _0x23e3(_0x404109,_0x39e479){const _0x2a330a=_0x2a33();return _0x23e3=function(_0x23e39e,_0x4fdc2c){_0x23e39e=_0x23e39e-0xe4;let _0xfc91b3=_0x2a330a[_0x23e39e];return _0xfc91b3;},_0x23e3(_0x404109,_0x39e479);}async function sleepFor(_0x28e09a){return new Promise(_0x4b2673=>setTimeout(_0x4b2673,_0x28e09a));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x306390=>setImmediate(_0x306390));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0x54bbd5){let _0x434833;const _0xc65ffa=new Promise(_0x47585a=>{_0x434833=setTimeout(_0x47585a,_0x54bbd5);});return{'promise':_0xc65ffa,'timerId':_0x434833};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x5e7d37){const _0x154123=Object['getPrototypeOf'](_0x5e7d37);if(_0x5e7d37['Query']?.['prototype']||Object['keys'](_0x5e7d37)['includes']('database')||_0x154123['name']==='Pool')return'postgres';else{if(_0x5e7d37['toString']()['toLowerCase']()['includes']('nats'))return'nats';else{if('defineCommand'in _0x154123||Object['keys'](_0x154123)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x154123)['includes']('Multi'))return'redis';}}}if(_0x5e7d37['constructor']){if(_0x5e7d37['constructor']['name']==='Redis'||_0x5e7d37['constructor']['name']==='EventEmitter'){if('hset'in _0x5e7d37)return'ioredis';}else{if(_0x5e7d37['constructor']['name']==='ProviderClient'||_0x5e7d37['constructor']['name']==='Commander'){if('HSET'in _0x5e7d37)return'redis';}}}let _0x1d3030=null;if(Object['keys'](_0x5e7d37)['includes']('connection')||!isNaN(_0x5e7d37['totalCount'])&&!isNaN(_0x5e7d37['idleCount']))_0x1d3030='postgres';else{if(Object['keys'](_0x5e7d37)['includes']('Pipeline'))_0x1d3030='ioredis';else{if(Object['keys'](_0x5e7d37)['includes']('createClient'))_0x1d3030='redis';else _0x154123['constructor']['toString']()['includes']('NatsConnectionImpl')&&(_0x1d3030='nats');}}return _0x1d3030;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x5000bf){return _0x5000bf==='activity'?'hook':_0x5000bf;},'providerConfig'(_0x37d3dc){return _0x37d3dc?.['connection']??_0x37d3dc?.['redis']??_0x37d3dc?.['connections'];},'meshDataConfig'(_0x215a51){return{..._0x215a51['connection']};}};function matchesStatusCode(_0x1c2a12,_0x28017b){if(typeof _0x28017b==='string'){const _0x2db424='^'+_0x28017b['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x2db424)['test'](_0x1c2a12['toString']());}return _0x28017b['test'](_0x1c2a12['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x1eeb17,_0x2daaef){return _0x1eeb17===_0x2daaef;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x1c1286,_0x27b0b4){for(const [_0x48e854,_0x2db75c]of Object['entries'](_0x1c1286)){if(_0x2db75c['hasOwnProperty'](_0x27b0b4)){const _0xe0a66c=findTopKey(_0x1c1286,_0x48e854['replace'](/^\./,''));return(_0xe0a66c||_0x48e854)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x4e2208,_0x3c77af){for(const [_0x7f30b2,_0x2c5b42]of Object['entries'](_0x4e2208)){if(_0x2c5b42===_0x3c77af)return _0x7f30b2;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0xf9c115,_0x2e0f34,_0x435418){const _0x214cee=await _0x2e0f34['getTransitions'](_0x435418),_0x5cc93f=await _0x2e0f34['getSubscriptions'](_0x435418),_0x3d4e56=findTopKey(_0x214cee,_0xf9c115),_0x179088=findSubscriptionForTrigger(_0x5cc93f,_0x3d4e56);return _0x179088;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x5dd000){if(_0x5dd000['toString']()==='infinity')return'0';const _0x9cbbea=new Date(),_0x2e6241=_0x5dd000['slice'](-0x1),_0x153620=parseInt(_0x5dd000['slice'](0x0,-0x1),0xa);if(_0x2e6241==='m'){const _0x2317e8=Math['floor'](_0x9cbbea['getMinutes']()/_0x153620)*_0x153620;_0x9cbbea['setUTCMinutes'](_0x2317e8,0x0,0x0);}else _0x2e6241==='h'&&_0x9cbbea['setUTCMinutes'](0x0,0x0,0x0);return _0x9cbbea['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x20a282){const _0x27498a=_0x20a282 instanceof Date?_0x20a282:new Date(_0x20a282);return _0x27498a['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0xb56d2f){const _0x24bd3b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x268729=_0x24bd3b['length'];if(_0xb56d2f<0x0||_0xb56d2f>=Math['pow'](_0x268729,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x5eae73,_0x2d80a3]=divmod(_0xb56d2f,_0x268729),[_0x5d93af,_0x59d7e1]=divmod(_0x5eae73,_0x268729);return _0x24bd3b[_0x5d93af]+_0x24bd3b[_0x2d80a3]+_0x24bd3b[_0x59d7e1];}exports['getSymKey']=getSymKey;function getSymVal(_0x165c47){const _0x59fbfe='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x570ab8=_0x59fbfe['length'];if(_0x165c47<0x0||_0x165c47>=Math['pow'](_0x570ab8,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x40eb29,_0x32f259]=divmod(_0x165c47,_0x570ab8);return _0x59fbfe[_0x40eb29]+_0x59fbfe[_0x32f259];}exports['getSymVal']=getSymVal;function divmod(_0x473e06,_0x5a2fc4){return[Math['floor'](_0x473e06/_0x5a2fc4),_0x473e06%_0x5a2fc4];}function _0x2a33(){const _0x5e3d23=['21eUKyta','2952792CAyqsO','7268148iqNBMF','69603ykYyDq','1923064lHkKEY','1110Inehtl','4203855gHvvni','1307PLhijM','136JEPVDf','4744611ZzyTdi','10zQxXoR'];_0x2a33=function(){return _0x5e3d23;};return _0x2a33();}function getIndexedHash(_0x302685,_0x5e7290){const _0x1ea2af=_0x302685[_0x5e7290]||0x0,_0x1d5119={..._0x302685};return delete _0x1d5119[_0x5e7290],[_0x1ea2af,_0x1d5119];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0xd08797,_0x384985){const _0x1f040d=_0x384985['split']('/');let _0x38dad0=_0xd08797;for(const _0x3ddd3b of _0x1f040d){if(_0x38dad0[_0x3ddd3b]!==undefined)_0x38dad0=_0x38dad0[_0x3ddd3b];else return undefined;}return _0x38dad0;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x1b3349){const _0x4102fe={};for(const _0x48cb78 in _0x1b3349){if(_0x1b3349[_0x48cb78]===undefined)continue;const _0x473a31=_0x48cb78['split']('/');let _0x42a948=_0x4102fe;for(let _0x475371=0x0;_0x475371<_0x473a31['length'];_0x475371++){_0x475371===_0x473a31['length']-0x1?_0x42a948[_0x473a31[_0x475371]]=_0x1b3349[_0x48cb78]:(_0x42a948[_0x473a31[_0x475371]]=_0x42a948[_0x473a31[_0x475371]]||{},_0x42a948=_0x42a948[_0x473a31[_0x475371]]);}}return _0x4102fe;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x56b8cc){const _0x4d57b2=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x4d57b2['test'](_0x56b8cc);}exports['isValidCron']=isValidCron;const s=_0x220334=>{return(0x0,ms_1['default'])(_0x220334)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x3ab92d=>{try{return JSON['parse'](_0x3ab92d);}catch(_0x2671a7){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x2671a7});throw _0x2671a7;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0x183851=>{return Array['isArray'](_0x183851)&&Array['isArray'](_0x183851[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x51f227=>{const _0x1d1c52=[];let _0x42af49;for(let _0x59966e=0x1;_0x59966e<_0x51f227['length'];_0x59966e++){const _0x5b4d6d=_0x51f227[_0x59966e],_0x9e1bf5={};if(Array['isArray'](_0x5b4d6d)){for(let _0x3e5625=0x0;_0x3e5625<_0x5b4d6d['length'];_0x3e5625+=0x2){const _0x10f177=_0x5b4d6d[_0x3e5625],_0x3c6179=_0x5b4d6d[_0x3e5625+0x1];_0x9e1bf5[_0x10f177]=_0x3c6179;}_0x42af49&&(_0x9e1bf5['$']=_0x42af49),_0x1d1c52['push'](_0x9e1bf5),_0x42af49=undefined;}else _0x42af49=_0x5b4d6d;}return _0x1d1c52;};exports['arrayToHash']=arrayToHash;
|
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(_0x7239e3,_0x211c3f){const _0x13831b=_0x2cf1,_0x5c3d3e=_0x7239e3();while(!![]){try{const _0x1f72c4=parseInt(_0x13831b(0x15d))/0x1+-parseInt(_0x13831b(0x15e))/0x2*(parseInt(_0x13831b(0x15f))/0x3)+parseInt(_0x13831b(0x160))/0x4+parseInt(_0x13831b(0x161))/0x5+-parseInt(_0x13831b(0x163))/0x6+parseInt(_0x13831b(0x162))/0x7+-parseInt(_0x13831b(0x164))/0x8;if(_0x1f72c4===_0x211c3f)break;else _0x5c3d3e['push'](_0x5c3d3e['shift']());}catch(_0x33b59d){_0x5c3d3e['push'](_0x5c3d3e['shift']());}}}(_0x1fe2,0x44669));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Activity']=void 0x0;const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream');function _0x2cf1(_0x5dcbdd,_0x2ad6e0){const _0x1fe2d8=_0x1fe2();return _0x2cf1=function(_0x2cf1e7,_0xfd33ee){_0x2cf1e7=_0x2cf1e7-0x15d;let _0x5bea8e=_0x1fe2d8[_0x2cf1e7];return _0x5bea8e;},_0x2cf1(_0x5dcbdd,_0x2ad6e0);}class Activity{constructor(_0x55a9ce,_0x1fa7ef,_0x407e26,_0x41f0d0,_0x37a2bc,_0xdbea53){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x55a9ce,this['data']=_0x1fa7ef,this['metadata']=_0x407e26,this['hook']=_0x41f0d0,this['engine']=_0x37a2bc,this['context']=_0xdbea53||{'data':{},'metadata':{}},this['logger']=_0x37a2bc['logger'],this['store']=_0x37a2bc['store'];}['setLeg'](_0x46be97){this['leg']=_0x46be97;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0xadfad6=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0xadfad6!==undefined&&!isNaN(Number(_0xadfad6)))return _0xadfad6;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x392696=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x392696);}catch(_0x1c2ed5){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x392696>0x0){if(this['context']['metadata']['js']===_0x392696){const _0x5b4c9c=await this['setStatus'](-_0x392696);Number(_0x5b4c9c)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x1c2ed5;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0xde12fb=this['context']['metadata']['guid'];return this['setLeg'](0x2),await this['getState'](),collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid']),await collator_1['CollatorService']['notarizeReentry'](this,_0xde12fb);}async['processEvent'](_0x5916bd=stream_1['StreamStatus']['SUCCESS'],_0x2a2d33=0xc8,_0x1e8a93='output'){this['setLeg'](0x2);const _0x2a02b9=this['context']['metadata']['jid'];if(!_0x2a02b9){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x407eeb=this['metadata']['aid'];this['status']=_0x5916bd,this['code']=_0x2a2d33,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x2a02b9,'aid':_0x407eeb,'status':_0x5916bd,'code':_0x2a2d33});let _0x3057f9;try{const _0x56fe50=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x56fe50),_0x3057f9=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x3057f9['startActivitySpan'](this['leg']);let _0x59dcfc;if(_0x5916bd===stream_1['StreamStatus']['PENDING'])_0x59dcfc=await this['processPending'](_0x1e8a93);else _0x5916bd===stream_1['StreamStatus']['SUCCESS']?_0x59dcfc=await this['processSuccess'](_0x1e8a93):_0x59dcfc=await this['processError']();this['transitionAdjacent'](_0x59dcfc,_0x3057f9);}catch(_0x3a5901){if(_0x3a5901 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x3a5901['fault']+'-error',{..._0x3a5901});return;}else{if(_0x3a5901 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x3a5901});return;}else{if(_0x3a5901 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x3a5901});return;}else{if(_0x3a5901 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x3a5901});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x3a5901,'message':_0x3a5901['message'],'stack':_0x3a5901['stack'],'name':_0x3a5901['name']}),_0x3057f9?.['setActivityError'](_0x3a5901['message']);throw _0x3a5901;}finally{_0x3057f9?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x2a02b9,'aid':_0x407eeb});}}async['processPending'](_0x2a6270){this['bindActivityData'](_0x2a6270),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0xa3e4c1=this['store']['transact']();return await this['setState'](_0xa3e4c1),await collator_1['CollatorService']['notarizeContinuation'](this,_0xa3e4c1),await this['setStatus'](this['adjacencyList']['length'],_0xa3e4c1),await _0xa3e4c1['exec']();}async['processSuccess'](_0x253cbd){this['bindActivityData'](_0x253cbd),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x459ca8=this['store']['transact']();return await this['setState'](_0x459ca8),await collator_1['CollatorService']['notarizeCompletion'](this,_0x459ca8),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x459ca8),await _0x459ca8['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x20ea1b=this['store']['transact']();return await this['setState'](_0x20ea1b),await collator_1['CollatorService']['notarizeCompletion'](this,_0x20ea1b),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x20ea1b),await _0x20ea1b['exec']();}async['transitionAdjacent'](_0x54e023,_0x412b16){_0x412b16['mapActivityAttributes']();const _0x2a02e5=this['resolveStatus'](_0x54e023),_0x73ee30={'app.job.jss':_0x2a02e5},_0x208d5d=await this['transition'](this['adjacencyList'],_0x2a02e5);_0x208d5d?.['length']&&(_0x73ee30['app.activity.mids']=_0x208d5d['join'](',')),_0x412b16['setActivityAttributes'](_0x73ee30);}['resolveStatus'](_0x15cfc0){const _0x116d1f=_0x15cfc0[_0x15cfc0['length']-0x1];return Array['isArray'](_0x116d1f)?Number(_0x116d1f[0x1]):Number(_0x116d1f);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x247c49=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x32df9b=_0x247c49['mapRules']();if(_0x32df9b)for(const _0x1c478c in _0x32df9b){const _0x13f701=_0x1c478c['indexOf']('[');if(_0x13f701>-0x1){const _0x144b4b=_0x1c478c['substring'](_0x13f701+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x144b4b))){const _0x12cbc1=_0x1c478c['substring'](0x0,_0x13f701);_0x32df9b[_0x12cbc1]=_0x32df9b[_0x1c478c],delete _0x32df9b[_0x1c478c];}else{if(_0x144b4b==='-'||_0x144b4b==='_'){const _0x500e7f=_0x32df9b[_0x1c478c];Object['keys'](_0x500e7f)['forEach'](_0x4a526e=>{_0x32df9b[_0x4a526e]=_0x500e7f[_0x4a526e];});}}}}this['context']['data']=_0x32df9b;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x27e256=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x27e256['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x557300=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x4e2321=_0x557300['mapRules'](),_0x3c34ee=this['metadata']['aid'],_0xc440d0={...this['context'][_0x3c34ee]['output'],..._0x4e2321};this['context'][_0x3c34ee]['output']['data']=_0xc440d0;}}async['registerTimeout'](){}['bindActivityError'](_0xccf76d){const _0x12bf37=this['context'][this['metadata']['aid']]['output']['metadata'];_0x12bf37['err']=JSON['stringify'](this['data']),_0x12bf37['$error']={..._0xccf76d,'is_stream_error':!![]};}['bindJobError'](_0x39566b){this['context']['metadata']['err']=JSON['stringify']({..._0x39566b,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x4a94b0,_0x245bf9){const {id:_0x37cab8}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x4a94b0,this['context']['metadata']['jid'],_0x37cab8,_0x245bf9);}['authorizeEntry'](_0x376c43){return this['adjacencyList']?.['map'](_0x246a94=>{const {metadata:{aid:_0x43a665}}=_0x246a94;return _0x376c43[_0x43a665+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x43a665;})??[];}['bindDimensionalAddress'](_0x44b3fe){const _0x1be944=this['resolveDad']();_0x44b3fe[this['metadata']['aid']+'/output/metadata/dad']=_0x1be944;}async['setState'](_0x1e38e4){const _0x4765b3=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x200454={};await this['bindJobState'](_0x200454);const _0x415abc=this['authorizeEntry'](_0x200454);this['bindDimensionalAddress'](_0x200454),this['bindActivityState'](_0x200454);const _0x301be0=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x415abc],_0x24bd65=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x200454,this['getJobStatus'](),_0x4765b3,_0x301be0,_0x24bd65,_0x1e38e4);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x24b394=this['context']['$self'];!_0x24b394['output']['metadata']&&(_0x24b394['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x24b394['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x545af5=(0x0,utils_1['formatISODate'])(new Date());_0x24b394['output']['metadata']['ac']=_0x545af5,_0x24b394['output']['metadata']['au']=_0x545af5,_0x24b394['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x24b394['output']['metadata']['stp']=this['config']['subtype']),_0x24b394['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x1ca533){const _0x2c4057=await this['getTriggerConfig'](),_0x73605a=[..._0x2c4057['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x511349 of _0x73605a){const _0x36996a=(0x0,utils_1['getValueByPath'])(this['context'],_0x511349);_0x36996a!==undefined&&(_0x1ca533[_0x511349]=_0x36996a);}for(const _0x3d0e83 in this['context']?.['data']??{}){(_0x3d0e83['startsWith']('-')||_0x3d0e83['startsWith']('_'))&&(_0x1ca533[_0x3d0e83]=this['context']['data'][_0x3d0e83]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x1ca533,this['config'],this['context']);}['bindActivityState'](_0x499c09){const _0x590fd6=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x52bd4e of _0x590fd6){const _0x1aff3c=this['metadata']['aid']+'/'+_0x52bd4e,_0x469cc9=(0x0,utils_1['getValueByPath'])(this['context'],_0x1aff3c);_0x469cc9!==undefined&&(_0x499c09[_0x1aff3c]=_0x469cc9);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x499c09,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x102f2f=>'metadata/'+_0x102f2f);}['bindActivityMetadataPaths'](){const _0x249022=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x249022]['KEYS']['map'](_0xb0f9bf=>'output/metadata/'+_0xb0f9bf);}async['getState'](){const _0x52834a=this['context']['metadata']['gid'],_0x30482e='$'+this['config']['subscribes'],_0x2b0084={[_0x30482e]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x2b736f=>'metadata/'+_0x2b736f)};for(let [_0x2e9702,_0x1e8b2b]of Object['entries'](this['config']['consumes'])){if(_0x2e9702==='$job')for(const _0x2f5bc1 of _0x1e8b2b){_0x2b0084[_0x30482e]['push'](_0x2f5bc1);}else{_0x2e9702==='$self'&&(_0x2e9702=this['metadata']['aid']);!_0x2b0084[_0x2e9702]&&(_0x2b0084[_0x2e9702]=[]);for(const _0x26c1d0 of _0x1e8b2b){_0x2b0084[_0x2e9702]['push'](_0x2e9702+'/'+_0x26c1d0);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x2b0084,this['config'],this['metadata'],this['leg']);const {dad:_0x57b330,jid:_0x5be784}=this['context']['metadata'],_0x3de790=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x57b330||''),[_0x460152,_0x14fa86]=await this['store']['getState'](_0x5be784,_0x2b0084,_0x3de790);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x460152),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x52834a),this['initDimensionalAddress'](_0x57b330),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x1f6e80,_0x4171b0){if(_0x4171b0!==_0x1f6e80)throw new errors_1['GenerationalError'](_0x1f6e80,_0x4171b0,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x41bbea){this['metadata']['dad']=_0x41bbea;}['initSelf'](_0x53f038){const _0x34555b=this['metadata']['aid'];!_0x53f038[_0x34555b]&&(_0x53f038[_0x34555b]={});const _0x5e7298=_0x53f038[_0x34555b];return!_0x5e7298['output']&&(_0x5e7298['output']={}),!_0x5e7298['input']&&(_0x5e7298['input']={}),!_0x5e7298['hook']&&(_0x5e7298['hook']={}),!_0x5e7298['output']['metadata']&&(_0x5e7298['output']['metadata']={}),_0x5e7298['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x53f038['$self']=_0x5e7298,_0x53f038['$job']=_0x53f038,_0x53f038;}['initPolicies'](_0x5f387){const _0x219603=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x5f387);_0x5f387['metadata']['expire']=_0x219603;if(this['config']['persistent']!=undefined){const _0x9629fb=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x5f387);_0x5f387['metadata']['persistent']=_0x9629fb;}}['bindActivityData'](_0x4499ff){this['context'][this['metadata']['aid']][_0x4499ff]['data']=this['data'];}['resolveDad'](){let _0x40e148=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x40e148=_0x40e148['substring'](0x0,_0x40e148['lastIndexOf'](','))+','+this['adjacentIndex']),_0x40e148;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x375176=[],_0x5262b0=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x4fdbf3=_0x5262b0['.'+this['metadata']['aid']],_0xdc158f=this['resolveAdjacentDad']();if(_0x4fdbf3)for(const _0x3fe1d4 in _0x4fdbf3){const _0x177cc7=_0x4fdbf3[_0x3fe1d4];mapper_1['MapperService']['evaluate'](_0x177cc7,this['context'],this['code'])&&_0x375176['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0xdc158f,'aid':_0x3fe1d4,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x375176;}['isJobComplete'](_0x29c380){return _0x29c380<=0x0;}['shouldEmit'](){if(this['config']['emit'])return pipe_1['Pipe']['resolve'](this['config']['emit'],this['context'])===!![];return![];}['shouldPersistJob'](){if(this['config']['persist']!==undefined)return pipe_1['Pipe']['resolve'](this['config']['persist'],this['context'])===!![];return![];}async['transition'](_0x4ba0ef,_0x5d804a){if(this['jobWasInterrupted'](_0x5d804a))return;let _0x19f1ee=[];(this['shouldEmit']()||this['isJobComplete'](_0x5d804a)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x5d804a)&&!this['shouldPersistJob']()});if(_0x4ba0ef['length']&&!this['isJobComplete'](_0x5d804a)){const _0x46edf1=this['store']['transact']();for(const _0x38b12f of _0x4ba0ef){await this['engine']['router']?.['publishMessage'](null,_0x38b12f,_0x46edf1);}_0x19f1ee=await _0x46edf1['exec']();}return _0x19f1ee;}['jobWasInterrupted'](_0x17a152){return _0x17a152<-0x5f5e100;}}exports['Activity']=Activity;function _0x1fe2(){const _0x29c550=['5418904hYCziN','408110NpcxnZ','175004OEEodb','9bInBsi','1863468BegikN','1256255yLZNSD','1390158MFuVaW','622704DRUFCw'];_0x1fe2=function(){return _0x29c550;};return _0x1fe2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function _0x3861(){const _0x12665d=['215MqMCRw','33oDrRwt','659071UwMmut','219915iMIHMp','1638204mSsrqu','54sPIzWh','1409464RtmkSR','310OeFzzs','7522blypaj','119648zudDWu','114tBEJoC','72740aUkMpQ'];_0x3861=function(){return _0x12665d;};return _0x3861();}(function(_0x2bd614,_0x36372a){const _0xad1a51=_0x1e13,_0x21fa97=_0x2bd614();while(!![]){try{const _0x57fee4=-parseInt(_0xad1a51(0x173))/0x1*(-parseInt(_0xad1a51(0x16f))/0x2)+parseInt(_0xad1a51(0x16c))/0x3*(-parseInt(_0xad1a51(0x170))/0x4)+parseInt(_0xad1a51(0x172))/0x5*(-parseInt(_0xad1a51(0x171))/0x6)+parseInt(_0xad1a51(0x169))/0x7+parseInt(_0xad1a51(0x16d))/0x8+parseInt(_0xad1a51(0x16a))/0x9*(parseInt(_0xad1a51(0x16e))/0xa)+-parseInt(_0xad1a51(0x174))/0xb*(parseInt(_0xad1a51(0x16b))/0xc);if(_0x57fee4===_0x36372a)break;else _0x21fa97['push'](_0x21fa97['shift']());}catch(_0x3a91ff){_0x21fa97['push'](_0x21fa97['shift']());}}}(_0x3861,0x956d9));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Await']=void 0x0;function _0x1e13(_0x2cad04,_0x125010){const _0x386195=_0x3861();return _0x1e13=function(_0x1e1368,_0x13f7c8){_0x1e1368=_0x1e1368-0x169;let _0x32c44c=_0x386195[_0x1e1368];return _0x32c44c;},_0x1e13(_0x2cad04,_0x125010);}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(_0x52ccc4,_0x42e584,_0x304dac,_0x10ecbc,_0x5134ce,_0x10a7fa){super(_0x52ccc4,_0x42e584,_0x304dac,_0x10ecbc,_0x5134ce,_0x10a7fa);}async['process'](){this['logger']['debug']('await-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x5b3c86;try{await this['verifyEntry'](),_0x5b3c86=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x5b3c86['startActivitySpan'](this['leg']),this['mapInputData']();const _0x37f20=this['store']['transact'](),_0x5f54fe=await this['execActivity'](_0x37f20);await collator_1['CollatorService']['authorizeReentry'](this,_0x37f20),await this['setState'](_0x37f20),await this['setStatus'](0x0,_0x37f20);const _0x1cee65=await _0x37f20['exec']();_0x5b3c86['mapActivityAttributes']();const _0x3e2901=this['resolveStatus'](_0x1cee65);return _0x5b3c86['setActivityAttributes']({'app.activity.mid':_0x5f54fe,'app.job.jss':_0x3e2901}),this['context']['metadata']['aid'];}catch(_0x31ae97){if(_0x31ae97 instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x31ae97});return;}else{if(_0x31ae97 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x31ae97});return;}else{if(_0x31ae97 instanceof errors_1['GetStateError']){this['logger']['error']('await-get-state-error',{..._0x31ae97});return;}else{if(_0x31ae97 instanceof errors_1['CollationError']){if(_0x31ae97['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',{..._0x31ae97});}else this['logger']['error']('await-process-error',{..._0x31ae97});}}}_0x5b3c86?.['setActivityError'](_0x31ae97['message']);throw _0x31ae97;}finally{_0x5b3c86?.['endActivitySpan'](),this['logger']['debug']('await-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x45d766){const _0x5d25ff=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x466d67={'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':_0x5d25ff,'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 _0x4c3ea7=pipe_1['Pipe']['resolve'](this['config']['await'],this['context']);_0x4c3ea7===![]&&(_0x466d67['metadata']['await']=![]);}return this['config']['retry']&&(_0x466d67['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](null,_0x466d67,_0x45d766);}}exports['Await']=Await;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x300dd5,_0x4a2908){const _0x40b652=_0x4fa0,_0x2d4618=_0x300dd5();while(!![]){try{const _0x196829=parseInt(_0x40b652(0x109))/0x1*(-parseInt(_0x40b652(0x10b))/0x2)+parseInt(_0x40b652(0x110))/0x3+-parseInt(_0x40b652(0x10d))/0x4*(parseInt(_0x40b652(0x10f))/0x5)+parseInt(_0x40b652(0x10c))/0x6*(parseInt(_0x40b652(0x108))/0x7)+parseInt(_0x40b652(0x10a))/0x8+-parseInt(_0x40b652(0x105))/0x9*(-parseInt(_0x40b652(0x10e))/0xa)+-parseInt(_0x40b652(0x107))/0xb*(-parseInt(_0x40b652(0x106))/0xc);if(_0x196829===_0x4a2908)break;else _0x2d4618['push'](_0x2d4618['shift']());}catch(_0x4e0825){_0x2d4618['push'](_0x2d4618['shift']());}}}(_0x3d22,0xf33ba));function _0x4fa0(_0x3360b1,_0x2111d1){const _0x3d225f=_0x3d22();return _0x4fa0=function(_0x4fa06b,_0x2d4d8c){_0x4fa06b=_0x4fa06b-0x105;let _0x39e805=_0x3d225f[_0x4fa06b];return _0x39e805;},_0x4fa0(_0x3360b1,_0x2111d1);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Cycle']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Cycle extends activity_1['Activity']{constructor(_0xb443b2,_0xe6e7ea,_0x54a512,_0xb8a949,_0x2c3d45,_0x4bc775){super(_0xb443b2,_0xe6e7ea,_0x54a512,_0xb8a949,_0x2c3d45,_0x4bc775);}async['process'](){this['logger']['debug']('cycle-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x3ff71a;try{await this['verifyEntry'](),_0x3ff71a=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x3ff71a['startActivitySpan'](this['leg']),this['mapInputData']();let _0x6ebd2b=this['store']['transact']();await this['setState'](_0x6ebd2b),await this['setStatus'](0x0,_0x6ebd2b);const _0x19047f=await _0x6ebd2b['exec']();_0x3ff71a['mapActivityAttributes']();const _0x45cc31=this['resolveStatus'](_0x19047f);_0x6ebd2b=this['store']['transact']();const _0x3db290=await this['cycleAncestorActivity'](_0x6ebd2b);return _0x3ff71a['setActivityAttributes']({'app.activity.mid':_0x3db290,'app.job.jss':_0x45cc31}),await collator_1['CollatorService']['notarizeEarlyExit'](this,_0x6ebd2b),await _0x6ebd2b['exec'](),this['context']['metadata']['aid'];}catch(_0x406623){if(_0x406623 instanceof errors_1['InactiveJobError']){this['logger']['error']('cycle-inactive-job-error',{..._0x406623});return;}else{if(_0x406623 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x406623});return;}else{if(_0x406623 instanceof errors_1['GetStateError']){this['logger']['error']('cycle-get-state-error',{..._0x406623});return;}else{if(_0x406623 instanceof errors_1['CollationError']){if(_0x406623['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',{..._0x406623});}else this['logger']['error']('cycle-process-error',{..._0x406623});}}}_0x3ff71a?.['setActivityError'](_0x406623['message']);throw _0x406623;}finally{_0x3ff71a?.['endActivitySpan'](),this['logger']['debug']('cycle-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['cycleAncestorActivity'](_0x5a9194){this['mapInputData']();const _0x441848={'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,_0x441848,_0x5a9194);}}function _0x3d22(){const _0x543ad5=['11kuuhyI','538456CaCfBQ','353806qhPcAx','2620740RvqFBQ','807204UbKxav','719410LqccEt','40sZqMJL','4849599clOMrB','117fXEJiy','60TouYVc','3301672LDHepZ','7EFGjhS'];_0x3d22=function(){return _0x543ad5;};return _0x3d22();}exports['Cycle']=Cycle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x4c9e(){const _0x44516f=['16630QEKvnl','391621JAWnll','78759ZshnyU','3184762QyUnon','974022yeIvrE','672opPAkk','800HQKxkb','3156736SWizCc','1317627LKqeRR'];_0x4c9e=function(){return _0x44516f;};return _0x4c9e();}(function(_0x11eacf,_0x3a5109){const _0x27fea7=_0x1d48,_0x4aadc9=_0x11eacf();while(!![]){try{const _0x5f3442=parseInt(_0x27fea7(0xb7))/0x1+parseInt(_0x27fea7(0xba))/0x2+parseInt(_0x27fea7(0xbe))/0x3+-parseInt(_0x27fea7(0xbd))/0x4+-parseInt(_0x27fea7(0xbf))/0x5*(-parseInt(_0x27fea7(0xbb))/0x6)+parseInt(_0x27fea7(0xb9))/0x7+-parseInt(_0x27fea7(0xbc))/0x8*(parseInt(_0x27fea7(0xb8))/0x9);if(_0x5f3442===_0x3a5109)break;else _0x4aadc9['push'](_0x4aadc9['shift']());}catch(_0x242f9a){_0x4aadc9['push'](_0x4aadc9['shift']());}}}(_0x4c9e,0x7570b));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Hook']=void 0x0;function _0x1d48(_0x3a5d16,_0x1a2206){const _0x4c9ed9=_0x4c9e();return _0x1d48=function(_0x1d48dc,_0x561c53){_0x1d48dc=_0x1d48dc-0xb7;let _0xf4caa0=_0x4c9ed9[_0x1d48dc];return _0xf4caa0;},_0x1d48(_0x3a5d16,_0x1a2206);}const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),collator_1=require('../collator'),pipe_1=require('../pipe'),task_1=require('../task'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream'),activity_1=require('./activity');class Hook extends activity_1['Activity']{constructor(_0x11d971,_0x15fd47,_0x909b36,_0xc9dafc,_0x16a169,_0x6364ee){super(_0x11d971,_0x15fd47,_0x909b36,_0xc9dafc,_0x16a169,_0x6364ee);}async['process'](){this['logger']['debug']('hook-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x3f8e30;try{return await this['verifyEntry'](),_0x3f8e30=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x3f8e30['startActivitySpan'](this['leg']),this['doesHook']()?await this['doHook'](_0x3f8e30):await this['doPassThrough'](_0x3f8e30),this['context']['metadata']['aid'];}catch(_0x4dee6a){if(_0x4dee6a instanceof errors_1['InactiveJobError']){this['logger']['error']('hook-inactive-job-error',{..._0x4dee6a});return;}else{if(_0x4dee6a instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x4dee6a});return;}else{if(_0x4dee6a instanceof errors_1['GetStateError']){this['logger']['error']('hook-get-state-error',{..._0x4dee6a});return;}else{if(_0x4dee6a instanceof errors_1['CollationError']){if(_0x4dee6a['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',{..._0x4dee6a});}else this['logger']['error']('hook-process-error',{..._0x4dee6a});}}}_0x3f8e30?.['setActivityError'](_0x4dee6a['message']);throw _0x4dee6a;}finally{_0x3f8e30?.['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 _0x5a89da=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return!isNaN(_0x5a89da)&&Number(_0x5a89da)>0x0;}return!!this['config']['hook']?.['topic'];}async['doHook'](_0x31fe85){const _0x4572a9=this['store']['transact']();await this['registerHook'](enums_1['HMSH_IS_CLUSTER']?undefined:_0x4572a9),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x4572a9),await collator_1['CollatorService']['authorizeReentry'](this,_0x4572a9),await this['setStatus'](0x0,_0x4572a9),await _0x4572a9['exec'](),_0x31fe85['mapActivityAttributes']();}async['doPassThrough'](_0x4d47d5){const _0x3b502e=this['store']['transact']();let _0x48780d;this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x3b502e),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x3b502e),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x3b502e),_0x48780d=await _0x3b502e['exec'](),_0x4d47d5['mapActivityAttributes']();const _0x488e34=this['resolveStatus'](_0x48780d),_0x513470={'app.job.jss':_0x488e34},_0x47f854=await this['transition'](this['adjacencyList'],_0x488e34);_0x47f854['length']&&(_0x513470['app.activity.mids']=_0x47f854['join'](',')),_0x4d47d5['setActivityAttributes'](_0x513470);}async['getHookRule'](_0x3ac9ff){const _0x4a3260=await this['store']['getHookRules']();return _0x4a3260?.[_0x3ac9ff]?.[0x0];}async['registerHook'](_0x5b4adb){if(this['config']['hook']?.['topic'])return await this['engine']['taskService']['registerWebHook'](this['config']['hook']['topic'],this['context'],this['resolveDad'](),this['context']['metadata']['expire'],_0x5b4adb);else{if(this['config']['sleep']){const _0xfa1b53=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',_0xfa1b53,this['metadata']['dad']||''),this['context']['metadata']['jid'];}}}async['processWebHookEvent'](_0x4ecf31=stream_1['StreamStatus']['SUCCESS'],_0x361384=0xc8){this['logger']['debug']('hook-process-web-hook-event',{'topic':this['config']['hook']['topic'],'aid':this['metadata']['aid'],'status':_0x4ecf31,'code':_0x361384});const _0x356b08=new task_1['TaskService'](this['store'],this['logger']),_0x30e8e0={...this['data']},_0x302319=await _0x356b08['processWebHookSignal'](this['config']['hook']['topic'],_0x30e8e0);if(_0x302319){const [_0x54d52e,_0x9c1ab3,_0x53488e,_0x5660bc]=_0x302319;this['context']['metadata']['jid']=_0x54d52e,this['context']['metadata']['gid']=_0x5660bc,this['context']['metadata']['dad']=_0x53488e,await this['processEvent'](_0x4ecf31,_0x361384,'hook'),_0x361384===0xc8&&await _0x356b08['deleteWebHookSignal'](this['config']['hook']['topic'],_0x30e8e0);}}async['processTimeHookEvent'](_0x366cf5){this['logger']['debug']('hook-process-time-hook-event',{'jid':_0x366cf5,'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(_0x3a4a5d,_0x24bd9f){const _0x15b3b8=_0x424f,_0x3a6b29=_0x3a4a5d();while(!![]){try{const _0x2f40e7=parseInt(_0x15b3b8(0x159))/0x1*(-parseInt(_0x15b3b8(0x157))/0x2)+-parseInt(_0x15b3b8(0x153))/0x3*(-parseInt(_0x15b3b8(0x14f))/0x4)+parseInt(_0x15b3b8(0x151))/0x5+parseInt(_0x15b3b8(0x158))/0x6*(-parseInt(_0x15b3b8(0x156))/0x7)+parseInt(_0x15b3b8(0x150))/0x8+parseInt(_0x15b3b8(0x152))/0x9*(-parseInt(_0x15b3b8(0x154))/0xa)+parseInt(_0x15b3b8(0x14e))/0xb*(parseInt(_0x15b3b8(0x155))/0xc);if(_0x2f40e7===_0x24bd9f)break;else _0x3a6b29['push'](_0x3a6b29['shift']());}catch(_0x358ab5){_0x3a6b29['push'](_0x3a6b29['shift']());}}}(_0x45a8,0x85bee));function _0x424f(_0x1a0cdc,_0x5c5101){const _0x45a854=_0x45a8();return _0x424f=function(_0x424f21,_0x4341b4){_0x424f21=_0x424f21-0x14e;let _0x52fd40=_0x45a854[_0x424f21];return _0x52fd40;},_0x424f(_0x1a0cdc,_0x5c5101);}Object['defineProperty'](exports,'__esModule',{'value':!![]});const activity_1=require('./activity'),await_1=require('./await'),cycle_1=require('./cycle'),hook_1=require('./hook'),interrupt_1=require('./interrupt'),signal_1=require('./signal'),trigger_1=require('./trigger'),worker_1=require('./worker');exports['default']={'activity':activity_1['Activity'],'await':await_1['Await'],'cycle':cycle_1['Cycle'],'hook':hook_1['Hook'],'interrupt':interrupt_1['Interrupt'],'signal':signal_1['Signal'],'trigger':trigger_1['Trigger'],'worker':worker_1['Worker']};function _0x45a8(){const _0x1afd00=['180HdfzoG','9305292NVfxnb','637TlnEJH','2QtlGvm','55194RvkJKS','596402NqRepW','33srNmyt','292GLXgra','1068024LLAeKr','1648630JGhhgn','544671iGuxtI','11553xqpQIv'];_0x45a8=function(){return _0x1afd00;};return _0x45a8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x25289b,_0x498717){const _0xef3e69=_0x18f6,_0x59b016=_0x25289b();while(!![]){try{const _0xc0e726=-parseInt(_0xef3e69(0x80))/0x1*(-parseInt(_0xef3e69(0x7f))/0x2)+parseInt(_0xef3e69(0x7d))/0x3*(-parseInt(_0xef3e69(0x86))/0x4)+-parseInt(_0xef3e69(0x83))/0x5*(-parseInt(_0xef3e69(0x87))/0x6)+parseInt(_0xef3e69(0x82))/0x7+parseInt(_0xef3e69(0x81))/0x8+parseInt(_0xef3e69(0x7e))/0x9*(-parseInt(_0xef3e69(0x84))/0xa)+parseInt(_0xef3e69(0x85))/0xb;if(_0xc0e726===_0x498717)break;else _0x59b016['push'](_0x59b016['shift']());}catch(_0x35bdc0){_0x59b016['push'](_0x59b016['shift']());}}}(_0x2b64,0x61143));function _0x18f6(_0x7df3d9,_0x38eb51){const _0x2b642b=_0x2b64();return _0x18f6=function(_0x18f627,_0x4d1ee6){_0x18f627=_0x18f627-0x7d;let _0x4f3256=_0x2b642b[_0x18f627];return _0x4f3256;},_0x18f6(_0x7df3d9,_0x38eb51);}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');function _0x2b64(){const _0xbd66c7=['62628CBiqMF','13htlcaF','5206776IBXiqB','443331oORzKd','29165mBguQU','179650NGqrUE','1638263VQyRSx','68XNoilK','96VEyqVF','129237WeaePV','117GHtqzl'];_0x2b64=function(){return _0xbd66c7;};return _0x2b64();}class Interrupt extends activity_1['Activity']{constructor(_0x475f4a,_0x1c335a,_0x3c48ed,_0x34c3de,_0x3f1e9c,_0xa0bdb0){super(_0x475f4a,_0x1c335a,_0x3c48ed,_0x34c3de,_0x3f1e9c,_0xa0bdb0);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x5a4d29;try{await this['verifyEntry'](),_0x5a4d29=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x5a4d29['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0x5a4d29):await this['interruptAnother'](_0x5a4d29);}catch(_0xd0afe6){if(_0xd0afe6 instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0xd0afe6});return;}else{if(_0xd0afe6 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0xd0afe6});return;}else{if(_0xd0afe6 instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0xd0afe6});return;}else{if(_0xd0afe6 instanceof errors_1['CollationError']){if(_0xd0afe6['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',{..._0xd0afe6});}else this['logger']['error']('interrupt-process-error',{..._0xd0afe6});}}}_0x5a4d29?.['setActivityError'](_0xd0afe6['message']);throw _0xd0afe6;}finally{_0x5a4d29?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x37fc26){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x4c3227=await this['interrupt']();_0x37fc26['mapActivityAttributes']();const _0x198533=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x198533),await this['setStatus'](-0x1,_0x198533);const _0x29efd5=await _0x198533['exec'](),_0x2f9252=this['resolveStatus'](_0x29efd5);return _0x37fc26['setActivityAttributes']({'app.activity.mid':_0x4c3227,'app.job.jss':_0x2f9252}),this['context']['metadata']['aid'];}async['interruptAnother'](_0xe845c2){const _0x3d7cd1=await this['interrupt'](),_0x46d4ef={'app.activity.mid':_0x3d7cd1};_0xe845c2['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x5d0344=this['store']['transact']();await this['setState'](_0x5d0344);}const _0x29fab5=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x29fab5),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x29fab5);const _0x4b30b6=await _0x29fab5['exec'](),_0x5da38d=this['resolveStatus'](_0x4b30b6);_0x46d4ef['app.job.jss']=_0x5da38d;const _0x135092=await this['transition'](this['adjacencyList'],_0x5da38d);return _0x135092['length']&&(_0x46d4ef['app.activity.mids']=_0x135092['join'](',')),_0xe845c2['setActivityAttributes'](_0x46d4ef),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0x433c49=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0x433c49==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 _0x2d39ac=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'],_0x2d39ac);}}exports['Interrupt']=Interrupt;
|