@hotmeshio/hotmesh 0.3.8 → 0.3.9
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 +2 -17
- package/build/index.d.ts +4 -2
- package/build/index.js +6 -3
- package/build/modules/key.js +1 -1
- package/build/modules/utils.d.ts +12 -4
- package/build/modules/utils.js +1 -1
- package/build/package.json +14 -7
- package/build/services/activities/activity.d.ts +9 -9
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.d.ts +2 -2
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.d.ts +2 -2
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.d.ts +2 -2
- 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.d.ts +3 -3
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.d.ts +2 -2
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.d.ts +9 -9
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.d.ts +4 -4
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.d.ts +4 -4
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.d.ts +3 -3
- package/build/services/compiler/validator.js +1 -1
- package/build/services/connector/factory.d.ts +6 -0
- package/build/services/connector/factory.js +56 -0
- package/build/services/connector/index.d.ts +13 -4
- package/build/services/connector/index.js +30 -23
- package/build/services/connector/providers/ioredis.d.ts +9 -0
- package/build/services/connector/providers/ioredis.js +26 -0
- package/build/services/connector/providers/nats.d.ts +9 -0
- package/build/services/connector/providers/nats.js +26 -0
- package/build/services/connector/providers/postgres.d.ts +9 -0
- package/build/services/connector/providers/postgres.js +39 -0
- package/build/services/connector/providers/redis.d.ts +9 -0
- package/build/services/connector/providers/redis.js +38 -0
- package/build/services/engine/index.d.ts +12 -12
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.d.ts +3 -3
- package/build/services/exporter/index.js +1 -1
- package/build/services/hotmesh/index.js +4 -4
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshcall/index.d.ts +5 -4
- package/build/services/meshcall/index.js +31 -14
- package/build/services/meshdata/index.d.ts +6 -6
- package/build/services/meshdata/index.js +7 -15
- package/build/services/meshflow/connection.d.ts +3 -2
- package/build/services/meshflow/exporter.d.ts +3 -3
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/search.js +12 -4
- package/build/services/meshflow/worker.js +7 -7
- package/build/services/meshos/index.d.ts +1 -4
- package/build/services/meshos/index.js +11 -44
- 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.d.ts +2 -0
- 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.d.ts +5 -5
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.d.ts +2 -2
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.d.ts +8 -13
- package/build/services/router/index.js +1 -1
- package/build/services/search/factory.d.ts +2 -2
- package/build/services/search/factory.js +1 -1
- package/build/services/search/index.d.ts +5 -4
- package/build/services/search/providers/redis/ioredis.js +1 -1
- package/build/services/search/providers/redis/redis.js +1 -1
- package/build/services/serializer/index.js +1 -1
- package/build/services/store/factory.d.ts +3 -3
- package/build/services/store/factory.js +1 -1
- package/build/services/store/index.d.ts +18 -17
- package/build/services/store/providers/redis/_base.d.ts +13 -15
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.d.ts +2 -2
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.d.ts +2 -2
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/factory.d.ts +3 -3
- package/build/services/stream/factory.js +16 -4
- package/build/services/stream/index.d.ts +57 -18
- package/build/services/stream/index.js +2 -1
- package/build/services/stream/providers/nats/nats.d.ts +59 -0
- package/build/services/stream/providers/nats/nats.js +1 -0
- package/build/services/stream/providers/postgres/_deploy.d.ts +2 -1
- package/build/services/stream/providers/postgres/_deploy.js +1 -1
- package/build/services/stream/providers/postgres/postgres.d.ts +0 -0
- package/build/services/stream/providers/postgres/postgres.js +0 -0
- package/build/services/stream/providers/redis/ioredis.d.ts +53 -14
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.d.ts +54 -15
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.d.ts +1 -2
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/factory.d.ts +2 -2
- package/build/services/sub/factory.js +1 -1
- package/build/services/sub/index.d.ts +6 -5
- package/build/services/sub/providers/redis/ioredis.d.ts +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.d.ts +4 -4
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.d.ts +5 -5
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.d.ts +9 -9
- package/build/services/worker/index.js +1 -1
- package/build/types/hotmesh.d.ts +26 -14
- package/build/types/index.d.ts +6 -5
- package/build/types/manifest.d.ts +1 -9
- package/build/types/meshcall.d.ts +12 -7
- package/build/types/meshflow.d.ts +3 -7
- package/build/types/nats.d.ts +150 -0
- package/build/types/nats.js +2 -0
- package/build/types/postgres.d.ts +48 -0
- package/build/types/postgres.js +2 -0
- package/build/types/provider.d.ts +26 -0
- package/build/types/provider.js +2 -0
- package/build/types/redis.d.ts +33 -15
- package/build/types/stream.d.ts +65 -1
- package/index.ts +8 -5
- package/package.json +14 -7
- package/types/hotmesh.ts +139 -22
- package/types/index.ts +26 -17
- package/types/manifest.ts +1 -10
- package/types/meshcall.ts +38 -13
- package/types/meshflow.ts +2 -7
- package/types/nats.ts +231 -0
- package/types/postgres.ts +54 -0
- package/types/provider.ts +71 -0
- package/types/redis.ts +63 -18
- package/types/stream.ts +85 -1
- package/build/services/connector/clients/ioredis.d.ts +0 -13
- package/build/services/connector/clients/ioredis.js +0 -48
- package/build/services/connector/clients/redis.d.ts +0 -13
- package/build/services/connector/clients/redis.js +0 -60
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { StoreService } from '../store';
|
|
2
2
|
import { MappingStatements } from '../../types/map';
|
|
3
3
|
import { HotMeshManifest } from '../../types/hotmesh';
|
|
4
|
-
import {
|
|
4
|
+
import { ProviderClient, ProviderTransaction } from '../../types/provider';
|
|
5
5
|
declare class Validator {
|
|
6
6
|
manifest: HotMeshManifest | null;
|
|
7
7
|
activityIds: string[];
|
|
8
8
|
mappingStatements: MappingStatements;
|
|
9
|
-
store: StoreService<
|
|
9
|
+
store: StoreService<ProviderClient, ProviderTransaction> | null;
|
|
10
10
|
static SYS_VARS: string[];
|
|
11
11
|
static CONTEXT_VARS: string[];
|
|
12
12
|
constructor(manifest: HotMeshManifest);
|
|
13
|
-
validate(store: StoreService<
|
|
13
|
+
validate(store: StoreService<ProviderClient, ProviderTransaction>): Promise<void>;
|
|
14
14
|
validateActivityIds(): void;
|
|
15
15
|
isMappingStatement(value: string): boolean;
|
|
16
16
|
extractMappingStatements(obj: any, result: MappingStatements, currentActivityId: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x40f83b,_0x67fe93){const _0x14844f=_0xa903,_0x48d227=_0x40f83b();while(!![]){try{const _0x3741fe=-parseInt(_0x14844f(0x151))/0x1+parseInt(_0x14844f(0x153))/0x2*(parseInt(_0x14844f(0x152))/0x3)+-parseInt(_0x14844f(0x157))/0x4*(parseInt(_0x14844f(0x154))/0x5)+parseInt(_0x14844f(0x155))/0x6*(parseInt(_0x14844f(0x15a))/0x7)+parseInt(_0x14844f(0x15b))/0x8+parseInt(_0x14844f(0x156))/0x9+-parseInt(_0x14844f(0x158))/0xa*(parseInt(_0x14844f(0x159))/0xb);if(_0x3741fe===_0x67fe93)break;else _0x48d227['push'](_0x48d227['shift']());}catch(_0x29497f){_0x48d227['push'](_0x48d227['shift']());}}}(_0x36a2,0x4d55c));function _0x36a2(){const _0x33b040=['1230278MaiYUx','1769456myeUvk','248956gvlGIZ','1131dxkOEO','2318PNTziL','310465SJPvnS','6pFEjtO','4690899hpOMwe','8VQvkLB','6560UVIsGB','11154QelevR'];_0x36a2=function(){return _0x33b040;};return _0x36a2();}function _0xa903(_0x293941,_0x286eb3){const _0x36a292=_0x36a2();return _0xa903=function(_0xa9030c,_0x1a0433){_0xa9030c=_0xa9030c-0x151;let _0x1b0424=_0x36a292[_0xa9030c];return _0x1b0424;},_0xa903(_0x293941,_0x286eb3);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Validator']=void 0x0;const pipe_1=require('../pipe');class Validator{constructor(_0x6ea3a1){this['manifest']=null,this['activityIds']=[],this['mappingStatements']={},this['store']=null,this['manifest']=_0x6ea3a1;}async['validate'](_0xbbdb0d){this['store']=_0xbbdb0d,this['getMappingStatements'](),this['validateActivityIds'](),this['validateReferencedActivityIds'](),this['validateMappingStatements'](),this['validateTransitions'](),this['validateTransitionConditions'](),this['validateStats'](),this['validateSchemas'](),this['validateUniqueHandledTopics'](),this['validateGraphPublishSubscribe'](),this['validateHooks'](),this['validateConditionalStatements']();}['validateActivityIds'](){const _0xb0e8da=new Set();this['manifest']['app']['graphs']['forEach'](_0x1b5dbd=>{const _0x97a396=Object['keys'](_0x1b5dbd['activities']);_0x97a396['forEach'](_0x45476d=>{if(_0xb0e8da['has'](_0x45476d))throw new Error('Duplicate\x20activity\x20id\x20found:\x20'+_0x45476d);else _0xb0e8da['add'](_0x45476d);});}),this['activityIds']=Array['from'](_0xb0e8da);}['isMappingStatement'](_0xf8b8d7){return typeof _0xf8b8d7==='string'&&_0xf8b8d7['startsWith']('{')&&_0xf8b8d7['endsWith']('}');}['extractMappingStatements'](_0x2ffda3,_0x5b6942,_0x5eaaf2){for(const _0x325064 in _0x2ffda3){if(typeof _0x2ffda3[_0x325064]==='object'&&_0x2ffda3[_0x325064]!==null)this['extractMappingStatements'](_0x2ffda3[_0x325064],_0x5b6942,_0x5eaaf2);else this['isMappingStatement'](_0x2ffda3[_0x325064])&&(!_0x5b6942[_0x5eaaf2]&&(_0x5b6942[_0x5eaaf2]=[]),_0x5b6942[_0x5eaaf2]['push'](_0x2ffda3[_0x325064]));}}['getMappingStatements'](){const _0x59fe36={};this['manifest']['app']['graphs']['forEach'](_0x3e89b6=>{const _0x4cea9a=_0x3e89b6['activities'];for(const _0x1ff8ac in _0x4cea9a){const _0x5f1480=_0x4cea9a[_0x1ff8ac];this['extractMappingStatements'](_0x5f1480,_0x59fe36,_0x1ff8ac);}}),this['mappingStatements']=_0x59fe36;}['validateReferencedActivityIds'](){const _0x247766=this['mappingStatements'],_0x3cf461=this['activityIds'];for(const _0x5e6fa6 in _0x247766){const _0x7e410c=_0x247766[_0x5e6fa6];_0x7e410c['forEach'](_0x19f886=>{if(_0x19f886['startsWith']('{')&&_0x19f886['endsWith']('}')){const _0x5c9d72=_0x19f886['slice'](0x1,-0x1)['split']('.'),_0x498a78=_0x5c9d72[0x0];if(!(Validator['SYS_VARS']['includes'](_0x498a78)||_0x3cf461['includes'](_0x498a78)||this['isFunction'](_0x19f886)||this['isContextVariable'](_0x19f886)))throw new Error('Mapping\x20statement\x20references\x20non-existent\x20activity:\x20'+_0x19f886);}});}}['isFunction'](_0x3240f7){return _0x3240f7['startsWith']('{@')&&pipe_1['Pipe']['resolveFunction'](_0x3240f7);}['isContextVariable'](_0x437e1c){return['{$input}','{$output}','{$item}','{$key}','{$index}']['includes'](_0x437e1c);}['validateMappingStatements'](){}['validateTransitions'](){}['validateTransitionConditions'](){}['validateStats'](){}['validateSchemas'](){}['validateUniqueHandledTopics'](){}['validateGraphPublishSubscribe'](){}['validateHooks'](){}['validateConditionalStatements'](){}}exports['Validator']=Validator,Validator['SYS_VARS']=['$app','$self','$graph','$job'],Validator['CONTEXT_VARS']=['{$input}','{$output}','{$item}','{$key}','{$index}'];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HotMeshEngine, HotMeshWorker } from '../../types/hotmesh';
|
|
2
|
+
import { ProviderConfig } from '../../types/provider';
|
|
3
|
+
export declare class ConnectorService {
|
|
4
|
+
static initClients(target: HotMeshEngine | HotMeshWorker): Promise<void>;
|
|
5
|
+
static initClient(ProviderConfig: ProviderConfig, target: HotMeshEngine | HotMeshWorker, field: string): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectorService = void 0;
|
|
4
|
+
const utils_1 = require("../../modules/utils");
|
|
5
|
+
const ioredis_1 = require("./providers/ioredis");
|
|
6
|
+
const redis_1 = require("./providers/redis");
|
|
7
|
+
const nats_1 = require("./providers/nats");
|
|
8
|
+
class ConnectorService {
|
|
9
|
+
static async initClients(target) {
|
|
10
|
+
const connections = target.connections;
|
|
11
|
+
if (connections) {
|
|
12
|
+
if (connections.store) {
|
|
13
|
+
await ConnectorService.initClient(connections.store, target, 'store');
|
|
14
|
+
}
|
|
15
|
+
if (connections.stream) {
|
|
16
|
+
await ConnectorService.initClient(connections.stream, target, 'stream');
|
|
17
|
+
}
|
|
18
|
+
if (connections.sub) {
|
|
19
|
+
await ConnectorService.initClient(connections.sub, target, 'sub');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const ProviderConfig = utils_1.polyfill.providerConfig(target);
|
|
24
|
+
if (ProviderConfig) {
|
|
25
|
+
await ConnectorService.initClient(ProviderConfig, target, 'store');
|
|
26
|
+
await ConnectorService.initClient(ProviderConfig, target, 'stream');
|
|
27
|
+
await ConnectorService.initClient(ProviderConfig, target, 'sub');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
static async initClient(ProviderConfig, target, field) {
|
|
32
|
+
if (target[field]) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const providerClass = ProviderConfig.class;
|
|
36
|
+
const options = ProviderConfig.options;
|
|
37
|
+
const providerName = (0, utils_1.identifyProvider)(providerClass);
|
|
38
|
+
let clientInstance;
|
|
39
|
+
const id = (0, utils_1.guid)();
|
|
40
|
+
switch (providerName) {
|
|
41
|
+
case 'redis':
|
|
42
|
+
clientInstance = await redis_1.RedisConnection.connect(id, providerClass, options);
|
|
43
|
+
break;
|
|
44
|
+
case 'ioredis':
|
|
45
|
+
clientInstance = await ioredis_1.RedisConnection.connect(id, providerClass, options);
|
|
46
|
+
break;
|
|
47
|
+
case 'nats':
|
|
48
|
+
clientInstance = await nats_1.NatsConnection.connect(id, providerClass, options);
|
|
49
|
+
break;
|
|
50
|
+
default:
|
|
51
|
+
throw new Error(`Unknown provider class: ${providerName}`);
|
|
52
|
+
}
|
|
53
|
+
target[field] = clientInstance.getClient();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.ConnectorService = ConnectorService;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
static
|
|
1
|
+
import { ProviderClass, ProviderNativeClient, ProviderOptions } from '../../types/provider';
|
|
2
|
+
declare abstract class AbstractConnection<PClass, POptions> {
|
|
3
|
+
protected connection: any | null;
|
|
4
|
+
protected static instances: Map<string, AbstractConnection<ProviderClass, ProviderOptions>>;
|
|
5
|
+
protected id: string | null;
|
|
6
|
+
protected abstract defaultOptions: any;
|
|
7
|
+
protected abstract createConnection(client: PClass, options: POptions): Promise<any>;
|
|
8
|
+
abstract getClient(): ProviderNativeClient;
|
|
9
|
+
disconnect(): Promise<void>;
|
|
10
|
+
protected abstract closeConnection(connection: any): Promise<void>;
|
|
11
|
+
static connect<T extends AbstractConnection<ProviderClass, ProviderOptions>>(this: new () => T, id: string, client: ProviderClass, options?: ProviderOptions): Promise<T>;
|
|
12
|
+
static disconnectAll(): Promise<void>;
|
|
5
13
|
}
|
|
14
|
+
export { AbstractConnection };
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
else {
|
|
17
|
-
for (let i = 1; i <= 3; i++) {
|
|
18
|
-
instances.push(ioredis_1.RedisConnection.connect((0, utils_1.guid)(), Redis, options));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const [store, stream, sub] = await Promise.all(instances);
|
|
22
|
-
target.store = target.store || store.getClient();
|
|
23
|
-
target.stream = target.stream || stream.getClient();
|
|
24
|
-
target.sub = target.sub || sub.getClient();
|
|
3
|
+
exports.AbstractConnection = void 0;
|
|
4
|
+
class AbstractConnection {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.connection = null;
|
|
7
|
+
this.id = null;
|
|
8
|
+
}
|
|
9
|
+
async disconnect() {
|
|
10
|
+
if (this.connection) {
|
|
11
|
+
await this.closeConnection(this.connection);
|
|
12
|
+
this.connection = null;
|
|
13
|
+
}
|
|
14
|
+
if (this.id) {
|
|
15
|
+
AbstractConnection.instances.delete(this.id);
|
|
25
16
|
}
|
|
26
17
|
}
|
|
18
|
+
static async connect(id, client, options) {
|
|
19
|
+
if (AbstractConnection.instances.has(id)) {
|
|
20
|
+
return AbstractConnection.instances.get(id);
|
|
21
|
+
}
|
|
22
|
+
const instance = new this();
|
|
23
|
+
const opts = options ? { ...options } : { ...instance.defaultOptions };
|
|
24
|
+
instance.connection = await instance.createConnection(client, opts);
|
|
25
|
+
instance.id = id;
|
|
26
|
+
AbstractConnection.instances.set(id, instance);
|
|
27
|
+
return instance;
|
|
28
|
+
}
|
|
29
|
+
static async disconnectAll() {
|
|
30
|
+
await Promise.all(Array.from(this.instances.values()).map((instance) => instance.disconnect()));
|
|
31
|
+
this.instances.clear();
|
|
32
|
+
}
|
|
27
33
|
}
|
|
28
|
-
exports.
|
|
34
|
+
exports.AbstractConnection = AbstractConnection;
|
|
35
|
+
AbstractConnection.instances = new Map();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractConnection } from '..';
|
|
2
|
+
import { IORedisClientOptions as RedisClientOptions, IORedisClassType as RedisClassType, IORedisClientType as RedisClientType } from '../../../types/redis';
|
|
3
|
+
declare class RedisConnection extends AbstractConnection<RedisClassType, RedisClientOptions> {
|
|
4
|
+
defaultOptions: RedisClientOptions;
|
|
5
|
+
createConnection(Redis: RedisClassType, options: RedisClientOptions): Promise<RedisClientType>;
|
|
6
|
+
getClient(): RedisClientType;
|
|
7
|
+
closeConnection(connection: RedisClientType): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export { RedisConnection };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisConnection = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
class RedisConnection extends __1.AbstractConnection {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.defaultOptions = {
|
|
9
|
+
host: 'localhost',
|
|
10
|
+
port: 6379,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
async createConnection(Redis, options) {
|
|
14
|
+
return new Redis(options);
|
|
15
|
+
}
|
|
16
|
+
getClient() {
|
|
17
|
+
if (!this.connection) {
|
|
18
|
+
throw new Error('Redis client is not connected');
|
|
19
|
+
}
|
|
20
|
+
return this.connection;
|
|
21
|
+
}
|
|
22
|
+
async closeConnection(connection) {
|
|
23
|
+
await connection.quit();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.RedisConnection = RedisConnection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractConnection } from '..';
|
|
2
|
+
import { NatsClientOptions, NatsClientType, NatsClassType } from '../../../types/nats';
|
|
3
|
+
declare class NatsConnection extends AbstractConnection<NatsClassType, NatsClientOptions> {
|
|
4
|
+
defaultOptions: NatsClientOptions;
|
|
5
|
+
createConnection(Connect: NatsClassType, options: NatsClientOptions): Promise<NatsClientType>;
|
|
6
|
+
getClient(): NatsClientType;
|
|
7
|
+
closeConnection(connection: NatsClientType): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export { NatsConnection, NatsClientOptions };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NatsConnection = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
class NatsConnection extends __1.AbstractConnection {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.defaultOptions = {
|
|
9
|
+
servers: ['nats:4222'],
|
|
10
|
+
timeout: 5000,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
async createConnection(Connect, options) {
|
|
14
|
+
return (await Connect(options));
|
|
15
|
+
}
|
|
16
|
+
getClient() {
|
|
17
|
+
if (!this.connection) {
|
|
18
|
+
throw new Error('NATS client is not connected');
|
|
19
|
+
}
|
|
20
|
+
return this.connection;
|
|
21
|
+
}
|
|
22
|
+
async closeConnection(connection) {
|
|
23
|
+
await connection.close();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.NatsConnection = NatsConnection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractConnection } from '..';
|
|
2
|
+
import { PostgresClientOptions, PostgresClientType, PostgresClassType } from '../../../types/postgres';
|
|
3
|
+
declare class PostgresConnection extends AbstractConnection<PostgresClassType, PostgresClientOptions> {
|
|
4
|
+
defaultOptions: PostgresClientOptions;
|
|
5
|
+
createConnection(Pool: PostgresClassType, options: PostgresClientOptions): Promise<PostgresClientType>;
|
|
6
|
+
getClient(): PostgresClientType;
|
|
7
|
+
closeConnection(connection: PostgresClientType): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export { PostgresConnection };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostgresConnection = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
class PostgresConnection extends __1.AbstractConnection {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.defaultOptions = {
|
|
9
|
+
host: 'localhost',
|
|
10
|
+
port: 5432,
|
|
11
|
+
user: 'postgres',
|
|
12
|
+
password: 'hotmesh',
|
|
13
|
+
database: 'postgres',
|
|
14
|
+
max: 20,
|
|
15
|
+
idleTimeoutMillis: 30000,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
async createConnection(Pool, options) {
|
|
19
|
+
const connection = new Pool(options);
|
|
20
|
+
try {
|
|
21
|
+
await connection.query('SELECT 1');
|
|
22
|
+
return connection;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.error(`Failed to connect to PostgreSQL: ${error.message}`);
|
|
26
|
+
throw new Error(`Failed to connect to PostgreSQL: ${error.message}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
getClient() {
|
|
30
|
+
if (!this.connection) {
|
|
31
|
+
throw new Error('Postgres client is not connected');
|
|
32
|
+
}
|
|
33
|
+
return this.connection;
|
|
34
|
+
}
|
|
35
|
+
closeConnection(connection) {
|
|
36
|
+
return connection.end();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.PostgresConnection = PostgresConnection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractConnection } from '..';
|
|
2
|
+
import { RedisRedisClassType as RedisClassType, RedisRedisClientType as RedisClientType, RedisRedisClientOptions as RedisClientOptions } from '../../../types/redis';
|
|
3
|
+
declare class RedisConnection extends AbstractConnection<RedisClassType, RedisClientOptions> {
|
|
4
|
+
defaultOptions: RedisClientOptions;
|
|
5
|
+
createConnection(Redis: Partial<RedisClassType>, options: RedisClientOptions): Promise<Partial<RedisClientType>>;
|
|
6
|
+
getClient(): RedisClientType;
|
|
7
|
+
closeConnection(connection: any): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export { RedisConnection, RedisClientType };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisConnection = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
class RedisConnection extends __1.AbstractConnection {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.defaultOptions = {
|
|
9
|
+
socket: {
|
|
10
|
+
host: 'localhost',
|
|
11
|
+
port: 6379,
|
|
12
|
+
tls: false,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
async createConnection(Redis, options) {
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
const client = Redis.createClient(options);
|
|
19
|
+
client.on('error', (error) => {
|
|
20
|
+
reject(error);
|
|
21
|
+
});
|
|
22
|
+
client.on('ready', () => {
|
|
23
|
+
resolve(client);
|
|
24
|
+
});
|
|
25
|
+
client.connect();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
getClient() {
|
|
29
|
+
if (!this.connection) {
|
|
30
|
+
throw new Error('Redis client is not connected');
|
|
31
|
+
}
|
|
32
|
+
return this.connection;
|
|
33
|
+
}
|
|
34
|
+
async closeConnection(connection) {
|
|
35
|
+
await connection.quit();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.RedisConnection = RedisConnection;
|
|
@@ -8,6 +8,7 @@ import { Trigger } from '../activities/trigger';
|
|
|
8
8
|
import { ExporterService } from '../exporter';
|
|
9
9
|
import { ILogger } from '../logger';
|
|
10
10
|
import { Router } from '../router';
|
|
11
|
+
import { SearchService } from '../search';
|
|
11
12
|
import { StoreService } from '../store';
|
|
12
13
|
import { StreamService } from '../stream';
|
|
13
14
|
import { SubService } from '../sub';
|
|
@@ -18,24 +19,23 @@ import { CacheMode } from '../../types/cache';
|
|
|
18
19
|
import { JobExport } from '../../types/exporter';
|
|
19
20
|
import { JobState, JobData, JobMetadata, JobOutput, JobStatus, JobInterruptOptions, JobCompletionOptions, ExtensionType } from '../../types/job';
|
|
20
21
|
import { HotMeshApps, HotMeshConfig, HotMeshManifest, HotMeshSettings } from '../../types/hotmesh';
|
|
22
|
+
import { ProviderClient, ProviderTransaction } from '../../types/provider';
|
|
21
23
|
import { JobMessageCallback } from '../../types/quorum';
|
|
22
|
-
import { RedisClient, RedisMulti } from '../../types/redis';
|
|
23
24
|
import { StringAnyType, StringStringType } from '../../types/serializer';
|
|
24
25
|
import { GetStatsOptions, IdsResponse, JobStatsInput, StatsResponse } from '../../types/stats';
|
|
25
26
|
import { StreamCode, StreamData, StreamDataResponse, StreamError, StreamStatus } from '../../types/stream';
|
|
26
27
|
import { WorkListTaskType } from '../../types/task';
|
|
27
|
-
import { SearchService } from '../search';
|
|
28
28
|
declare class EngineService {
|
|
29
29
|
namespace: string;
|
|
30
30
|
apps: HotMeshApps | null;
|
|
31
31
|
appId: string;
|
|
32
32
|
guid: string;
|
|
33
33
|
exporter: ExporterService | null;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
search: SearchService<ProviderClient> | null;
|
|
35
|
+
store: StoreService<ProviderClient, ProviderTransaction> | null;
|
|
36
|
+
stream: StreamService<ProviderClient, ProviderTransaction> | null;
|
|
37
|
+
subscribe: SubService<ProviderClient, ProviderTransaction> | null;
|
|
38
|
+
router: Router<typeof this.stream> | null;
|
|
39
39
|
taskService: TaskService | null;
|
|
40
40
|
logger: ILogger;
|
|
41
41
|
cacheMode: CacheMode;
|
|
@@ -47,11 +47,11 @@ declare class EngineService {
|
|
|
47
47
|
constructor();
|
|
48
48
|
static init(namespace: string, appId: string, guid: string, config: HotMeshConfig, logger: ILogger): Promise<EngineService>;
|
|
49
49
|
verifyEngineFields(config: HotMeshConfig): void;
|
|
50
|
-
initSearchChannel(search:
|
|
51
|
-
initStoreChannel(store:
|
|
52
|
-
initSubChannel(sub:
|
|
53
|
-
initStreamChannel(stream:
|
|
54
|
-
initRouter(config: HotMeshConfig): Promise<Router
|
|
50
|
+
initSearchChannel(search: ProviderClient, store?: ProviderClient): Promise<void>;
|
|
51
|
+
initStoreChannel(store: ProviderClient): Promise<void>;
|
|
52
|
+
initSubChannel(sub: ProviderClient, store: ProviderClient): Promise<void>;
|
|
53
|
+
initStreamChannel(stream: ProviderClient, store: ProviderClient): Promise<void>;
|
|
54
|
+
initRouter(config: HotMeshConfig): Promise<Router<StreamService<ProviderClient, ProviderTransaction>>>;
|
|
55
55
|
fetchAndVerifyVID(vid: AppVID, count?: number): Promise<AppVID>;
|
|
56
56
|
getVID(vid?: AppVID): Promise<AppVID>;
|
|
57
57
|
setCacheMode(cacheMode: CacheMode, untilVersion: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x11b0f6,_0x2b685d){const _0x2bbb11=_0xd44c,_0x867552=_0x11b0f6();while(!![]){try{const _0x2016d6=parseInt(_0x2bbb11(0x128))/0x1*(parseInt(_0x2bbb11(0x12e))/0x2)+parseInt(_0x2bbb11(0x126))/0x3*(parseInt(_0x2bbb11(0x130))/0x4)+-parseInt(_0x2bbb11(0x129))/0x5*(parseInt(_0x2bbb11(0x12c))/0x6)+-parseInt(_0x2bbb11(0x12d))/0x7+parseInt(_0x2bbb11(0x12a))/0x8*(parseInt(_0x2bbb11(0x127))/0x9)+parseInt(_0x2bbb11(0x125))/0xa*(-parseInt(_0x2bbb11(0x12b))/0xb)+parseInt(_0x2bbb11(0x12f))/0xc;if(_0x2016d6===_0x2b685d)break;else _0x867552['push'](_0x867552['shift']());}catch(_0x4b1e27){_0x867552['push'](_0x867552['shift']());}}}(_0xc6db,0x3de1b));var __importDefault=this&&this['__importDefault']||function(_0x52128f){return _0x52128f&&_0x52128f['__esModule']?_0x52128f:{'default':_0x52128f};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['EngineService']=void 0x0;const key_1=require('../../modules/key'),enums_1=require('../../modules/enums'),utils_1=require('../../modules/utils'),activities_1=__importDefault(require('../activities')),compiler_1=require('../compiler'),exporter_1=require('../exporter'),reporter_1=require('../reporter'),router_1=require('../router'),serializer_1=require('../serializer'),task_1=require('../task'),stream_1=require('../../types/stream'),factory_1=require('../stream/factory'),factory_2=require('../sub/factory'),factory_3=require('../store/factory'),factory_4=require('../search/factory');class EngineService{constructor(){this['cacheMode']='cache',this['untilVersion']=null,this['jobCallbacks']={},this['reporting']=![],this['jobId']=0x1;}static async['init'](_0x40b9ab,_0x4b4d82,_0x5d318a,_0x5bef8c,_0x377de9){if(_0x5bef8c['engine']){const _0x18e4a0=new EngineService();_0x18e4a0['verifyEngineFields'](_0x5bef8c),_0x18e4a0['namespace']=_0x40b9ab,_0x18e4a0['appId']=_0x4b4d82,_0x18e4a0['guid']=_0x5d318a,_0x18e4a0['logger']=_0x377de9,await _0x18e4a0['initSearchChannel'](_0x5bef8c['engine']['store']),await _0x18e4a0['initStoreChannel'](_0x5bef8c['engine']['store']),await _0x18e4a0['initSubChannel'](_0x5bef8c['engine']['sub'],_0x5bef8c['engine']['store']),await _0x18e4a0['initStreamChannel'](_0x5bef8c['engine']['stream'],_0x5bef8c['engine']['store']),_0x18e4a0['router']=await _0x18e4a0['initRouter'](_0x5bef8c);const _0x428b46=_0x18e4a0['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x18e4a0['appId']});return _0x18e4a0['router']['consumeMessages'](_0x428b46,'ENGINE',_0x18e4a0['guid'],_0x18e4a0['processStreamMessage']['bind'](_0x18e4a0)),_0x18e4a0['taskService']=new task_1['TaskService'](_0x18e4a0['store'],_0x377de9),_0x18e4a0['exporter']=new exporter_1['ExporterService'](_0x18e4a0['appId'],_0x18e4a0['store'],_0x377de9),_0x18e4a0['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x18e4a0;}}['verifyEngineFields'](_0x55c70d){if(!(0x0,utils_1['identifyRedisType'])(_0x55c70d['engine']['store'])||!(0x0,utils_1['identifyRedisType'])(_0x55c70d['engine']['stream'])||!(0x0,utils_1['identifyRedisType'])(_0x55c70d['engine']['sub']))throw new Error('engine\x20config\x20must\x20reference\x203\x20redis\x20client\x20instances');}async['initSearchChannel'](_0x41929a,_0xc3e149){this['search']=await factory_4['SearchServiceFactory']['init'](_0x41929a,_0xc3e149,this['namespace'],this['appId'],this['logger']);}async['initStoreChannel'](_0x5c4a67){this['store']=await factory_3['StoreServiceFactory']['init'](_0x5c4a67,this['namespace'],this['appId'],this['logger']);}async['initSubChannel'](_0x5f427b,_0x39ddfc){this['subscribe']=await factory_2['SubServiceFactory']['init'](_0x5f427b,_0x39ddfc,this['namespace'],this['appId'],this['guid'],this['logger']);}async['initStreamChannel'](_0x1744e4,_0x2c99c6){this['stream']=await factory_1['StreamServiceFactory']['init'](_0x1744e4,_0x2c99c6,this['namespace'],this['appId'],this['logger']);}async['initRouter'](_0x233a1a){const _0xd386ad=await this['store']['getThrottleRate'](':');return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['ENGINE'],'reclaimDelay':_0x233a1a['engine']['reclaimDelay'],'reclaimCount':_0x233a1a['engine']['reclaimCount'],'throttle':_0xd386ad,'readonly':_0x233a1a['engine']['readonly']},this['stream'],this['store'],this['logger']);}async['fetchAndVerifyVID'](_0x5b342f,_0x3fe3e8=0x0){if(isNaN(Number(_0x5b342f['version']))){const _0x62f25b=await this['store']['getApp'](_0x5b342f['id'],!![]);if(!isNaN(Number(_0x62f25b['version']))){if(!this['apps'])this['apps']={};return this['apps'][_0x5b342f['id']]=_0x62f25b,{'id':_0x5b342f['id'],'version':_0x62f25b['version']};}else{if(_0x3fe3e8<0xa)return await(0x0,utils_1['sleepFor'])(enums_1['HMSH_QUORUM_DELAY_MS']*0x2),await this['fetchAndVerifyVID'](_0x5b342f,_0x3fe3e8+0x1);else this['logger']['error']('engine-vid-resolution-error',{'id':_0x5b342f['id'],'guid':this['guid']});}}return _0x5b342f;}async['getVID'](_0x4feced){if(this['cacheMode']==='nocache'){const _0x273d5e=await this['store']['getApp'](this['appId'],!![]);if(_0x273d5e['version']['toString']()===this['untilVersion']['toString']()){if(!this['apps'])this['apps']={};this['apps'][this['appId']]=_0x273d5e,this['setCacheMode']('cache',_0x273d5e['version']['toString']());}return{'id':this['appId'],'version':_0x273d5e['version']};}else return!this['apps']&&_0x4feced?(this['apps']={},this['apps'][this['appId']]=_0x4feced,_0x4feced):await this['fetchAndVerifyVID']({'id':this['appId'],'version':this['apps']?.[this['appId']]['version']});}['setCacheMode'](_0x1492fe,_0x12e4a7){this['logger']['info']('engine-executable-cache',{'mode':_0x1492fe,[_0x1492fe==='cache'?'target':'until']:_0x12e4a7}),this['cacheMode']=_0x1492fe,this['untilVersion']=_0x12e4a7;}async['routeToSubscribers'](_0x27350e,_0x2a9d41){const _0x1db86a=this['jobCallbacks'][_0x2a9d41['metadata']['jid']];_0x1db86a&&(this['delistJobCallback'](_0x2a9d41['metadata']['jid']),_0x1db86a(_0x27350e,_0x2a9d41));}async['processWebHooks'](){this['taskService']['processWebHooks'](this['hook']['bind'](this));}async['processTimeHooks'](){this['taskService']['processTimeHooks'](this['hookTime']['bind'](this));}async['throttle'](_0x642c7d){try{this['router']['setThrottle'](_0x642c7d);}catch(_0x485436){this['logger']['error']('engine-throttle-error',{'error':_0x485436});}}async['initActivity'](_0x371138,_0x254115={},_0x4e28c8){const [_0x43d13b,_0x374af4]=await this['getSchema'](_0x371138),_0x3b7d23=activities_1['default'][utils_1['polyfill']['resolveActivityType'](_0x374af4['type'])];if(_0x3b7d23){const _0x3b0e6e=(0x0,utils_1['formatISODate'])(new Date()),_0x98f6f8={'aid':_0x43d13b,'atp':_0x374af4['type'],'stp':_0x374af4['subtype'],'ac':_0x3b0e6e,'au':_0x3b0e6e},_0x25f904=null;return new _0x3b7d23(_0x374af4,_0x254115,_0x98f6f8,_0x25f904,this,_0x4e28c8);}else throw new Error('activity\x20type\x20'+_0x374af4['type']+'\x20not\x20found');}async['getSchema'](_0x3a07d3){const _0x49bd3b=await this['store']['getApp'](this['appId']);if(!_0x49bd3b)throw new Error('no\x20app\x20found\x20for\x20id\x20'+this['appId']);if(this['isPrivate'](_0x3a07d3)){const _0x54e34d=_0x3a07d3['substring'](0x1),_0x5eaf98=await this['store']['getSchema'](_0x54e34d,await this['getVID'](_0x49bd3b));return[_0x54e34d,_0x5eaf98];}else{const _0x52e96c=await this['store']['getSubscription'](_0x3a07d3,await this['getVID'](_0x49bd3b));if(_0x52e96c){const _0x224283=await this['store']['getSchema'](_0x52e96c,await this['getVID'](_0x49bd3b));return[_0x52e96c,_0x224283];}}throw new Error('no\x20subscription\x20found\x20for\x20topic\x20'+_0x3a07d3+'\x20in\x20app\x20'+this['appId']+'\x20for\x20app\x20version\x20'+_0x49bd3b['version']);}async['getSettings'](){return await this['store']['getSettings']();}['isPrivate'](_0x10dd02){return _0x10dd02['startsWith']('.');}async['plan'](_0x5077c6){const _0x88ba49=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x88ba49['plan'](_0x5077c6);}async['deploy'](_0x2de35a){const _0x55a139=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x55a139['deploy'](_0x2de35a);}async['getStats'](_0x4b7480,_0x439ea3){const {id:_0x18d658,version:_0x339090}=await this['getVID'](),_0x1bc1e1=new reporter_1['ReporterService']({'id':_0x18d658,'version':_0x339090},this['store'],this['logger']),_0x1e3fb1=await this['resolveQuery'](_0x4b7480,_0x439ea3);return await _0x1bc1e1['getStats'](_0x1e3fb1);}async['getIds'](_0x650207,_0x342817,_0x57914a=[]){const {id:_0x44e2d2,version:_0x1b2877}=await this['getVID'](),_0x4b2991=new reporter_1['ReporterService']({'id':_0x44e2d2,'version':_0x1b2877},this['store'],this['logger']),_0x336650=await this['resolveQuery'](_0x650207,_0x342817);return await _0x4b2991['getIds'](_0x336650,_0x57914a);}async['resolveQuery'](_0x248943,_0x231fdd){const _0x5d5f0d=await this['initActivity'](_0x248943,_0x231fdd['data']);return await _0x5d5f0d['getState'](),{'end':_0x231fdd['end'],'start':_0x231fdd['start'],'range':_0x231fdd['range'],'granularity':_0x5d5f0d['resolveGranularity'](),'key':_0x5d5f0d['resolveJobKey'](_0x5d5f0d['createInputContext']()),'sparse':_0x231fdd['sparse']};}async['processStreamMessage'](_0x57979a){this['logger']['debug']('engine-process',{'jid':_0x57979a['metadata']['jid'],'gid':_0x57979a['metadata']['gid'],'dad':_0x57979a['metadata']['dad'],'aid':_0x57979a['metadata']['aid'],'status':_0x57979a['status']||stream_1['StreamStatus']['SUCCESS'],'code':_0x57979a['code']||0xc8,'type':_0x57979a['type']});const _0x292732={'metadata':{'guid':_0x57979a['metadata']['guid'],'jid':_0x57979a['metadata']['jid'],'gid':_0x57979a['metadata']['gid'],'dad':_0x57979a['metadata']['dad'],'aid':_0x57979a['metadata']['aid']},'data':_0x57979a['data']};if(_0x57979a['type']===stream_1['StreamDataType']['TIMEHOOK']){const _0x10c158=await this['initActivity']('.'+_0x57979a['metadata']['aid'],_0x292732['data'],_0x292732);await _0x10c158['processTimeHookEvent'](_0x57979a['metadata']['jid']);}else{if(_0x57979a['type']===stream_1['StreamDataType']['WEBHOOK']){const _0x2d4255=await this['initActivity']('.'+_0x57979a['metadata']['aid'],_0x292732['data'],_0x292732);await _0x2d4255['processWebHookEvent'](_0x57979a['status'],_0x57979a['code']);}else{if(_0x57979a['type']===stream_1['StreamDataType']['TRANSITION']){const _0x4cd2f9=await this['initActivity']('.'+_0x57979a['metadata']['aid'],_0x292732['data'],_0x292732);await _0x4cd2f9['process']();}else{if(_0x57979a['type']===stream_1['StreamDataType']['AWAIT']){_0x292732['metadata']={..._0x292732['metadata'],'pj':_0x57979a['metadata']['jid'],'pg':_0x57979a['metadata']['gid'],'pd':_0x57979a['metadata']['dad'],'pa':_0x57979a['metadata']['aid'],'px':_0x57979a['metadata']['await']===![],'trc':_0x57979a['metadata']['trc'],'spn':_0x57979a['metadata']['spn']};const _0x38faee=await this['initActivity'](_0x57979a['metadata']['topic'],_0x57979a['data'],_0x292732);await _0x38faee['process']();}else{if(_0x57979a['type']===stream_1['StreamDataType']['RESULT']){const _0x51642a=await this['initActivity']('.'+_0x292732['metadata']['aid'],_0x57979a['data'],_0x292732);await _0x51642a['processEvent'](_0x57979a['status'],_0x57979a['code']);}else{const _0x57a5dc=await this['initActivity']('.'+_0x57979a['metadata']['aid'],_0x57979a['data'],_0x292732);await _0x57a5dc['processEvent'](_0x57979a['status'],_0x57979a['code'],'output');}}}}}this['logger']['debug']('engine-process-end',{'jid':_0x57979a['metadata']['jid'],'gid':_0x57979a['metadata']['gid'],'aid':_0x57979a['metadata']['aid']});}async['execAdjacentParent'](_0x14a3b0,_0x211d51,_0x463eb0=![]){if(this['hasParentJob'](_0x14a3b0)){const _0x153beb=this['resolveError'](_0x211d51['metadata']),_0x2608db=_0x14a3b0['$self']?.['output']?.['metadata']?.['l2s']||_0x14a3b0['$self']?.['output']?.['metadata']?.['l1s'],_0x46f682={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x14a3b0['metadata']['pj'],'gid':_0x14a3b0['metadata']['pg'],'dad':_0x14a3b0['metadata']['pd'],'aid':_0x14a3b0['metadata']['pa'],'trc':_0x14a3b0['metadata']['trc'],'spn':_0x2608db},'type':stream_1['StreamDataType']['RESULT'],'data':_0x211d51['data']};if(_0x153beb&&_0x153beb['code'])_0x46f682['status']=stream_1['StreamStatus']['ERROR'],_0x46f682['data']=_0x153beb,_0x46f682['code']=_0x153beb['code'],_0x46f682['stack']=_0x153beb['stack'];else _0x463eb0?(_0x46f682['status']=stream_1['StreamStatus']['PENDING'],_0x46f682['code']=enums_1['HMSH_CODE_PENDING']):(_0x46f682['status']=stream_1['StreamStatus']['SUCCESS'],_0x46f682['code']=enums_1['HMSH_CODE_SUCCESS']);return await this['router']?.['publishMessage'](null,_0x46f682);}}['hasParentJob'](_0x893832,_0xcdcefa=![]){if(_0xcdcefa)return Boolean(_0x893832['metadata']['pj']&&_0x893832['metadata']['pa']&&!_0x893832['metadata']['px']);return Boolean(_0x893832['metadata']['pj']&&_0x893832['metadata']['pa']);}['resolveError'](_0xf81660){if(_0xf81660&&_0xf81660['err'])return JSON['parse'](_0xf81660['err']);}async['interrupt'](_0x25e41f,_0x34a592,_0x45d270={}){await this['store']['interrupt'](_0x25e41f,_0x34a592,_0x45d270);const _0x6655f6=await this['getState'](_0x25e41f,_0x34a592),_0x2df8c9={'interrupt':_0x45d270['descend'],'expire':_0x45d270['expire']};return await this['runJobCompletionTasks'](_0x6655f6,_0x2df8c9);}async['scrub'](_0x17b96b){await this['store']['scrub'](_0x17b96b);}async['hook'](_0x2a0c96,_0x54aedc,_0x2168f3=stream_1['StreamStatus']['SUCCESS'],_0x4bb68e=0xc8){const _0x1d0d7a=await this['taskService']['getHookRule'](_0x2a0c96),[_0x23dd57]=await this['getSchema']('.'+_0x1d0d7a['to']),_0x27799d={'type':stream_1['StreamDataType']['WEBHOOK'],'status':_0x2168f3,'code':_0x4bb68e,'metadata':{'guid':(0x0,utils_1['guid'])(),'aid':_0x23dd57,'topic':_0x2a0c96},'data':_0x54aedc};return await this['router']['publishMessage'](null,_0x27799d);}async['hookTime'](_0x4d87d7,_0x5a9d66,_0x1fd8d9,_0x3b9e55){if(_0x3b9e55==='interrupt'||_0x3b9e55==='expire')return await this['interrupt'](_0x1fd8d9,_0x4d87d7,{'suppress':!![],'expire':0x1});const [_0x741ffe,..._0x1c7a91]=_0x1fd8d9['split'](','),_0x144590=','+_0x1c7a91['join'](','),_0x1e18ac={'type':stream_1['StreamDataType']['TIMEHOOK'],'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x4d87d7,'gid':_0x5a9d66,'dad':_0x144590,'aid':_0x741ffe},'data':{'timestamp':Date['now']()}};await this['router']['publishMessage'](null,_0x1e18ac);}async['hookAll'](_0x53fc6c,_0x2c193d,_0x208cdd,_0x347c0e=[]){const _0x39fd33=await this['getVID'](),_0x4b3125=await this['taskService']['getHookRule'](_0x53fc6c);if(_0x4b3125){const _0x300e17=await(0x0,utils_1['getSubscriptionTopic'])(_0x4b3125['to'],this['store'],_0x39fd33),_0x1654b3=await this['resolveQuery'](_0x300e17,_0x208cdd),_0x407c9f=new reporter_1['ReporterService'](_0x39fd33,this['store'],this['logger']),_0x254019=await _0x407c9f['getWorkItems'](_0x1654b3,_0x347c0e);if(_0x254019['length']){const _0x33e425=new task_1['TaskService'](this['store'],this['logger']);await _0x33e425['enqueueWorkItems'](_0x254019['map'](_0xada6e=>[_0x53fc6c,_0xada6e,_0x208cdd['scrub']||![],JSON['stringify'](_0x2c193d)]['join'](key_1['VALSEP']))),this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'work','originator':this['guid']},this['appId']);}return _0x254019;}else throw new Error('unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20'+_0x53fc6c);}async['pub'](_0x30b64a,_0x53ec0d,_0x572566,_0x319560){const _0x20cdc4=await this['initActivity'](_0x30b64a,_0x53ec0d,_0x572566);if(_0x20cdc4)return await _0x20cdc4['process'](_0x319560);else throw new Error('unable\x20to\x20process\x20activity\x20for\x20topic\x20'+_0x30b64a);}async['sub'](_0x35d78f,_0x269eca){const _0x73cd85=async(_0x75fbf1,_0x356bcc)=>{_0x269eca(_0x356bcc['topic'],_0x356bcc['job']);};return await this['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x73cd85,this['appId'],_0x35d78f);}async['unsub'](_0x224d9b){return await this['subscribe']['unsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x224d9b);}async['psub'](_0x9f0dfb,_0x329931){const _0x3a4572=async(_0x24f53f,_0x6ea174)=>{_0x329931(_0x6ea174['topic'],_0x6ea174['job']);};return await this['subscribe']['psubscribe'](key_1['KeyType']['QUORUM'],_0x3a4572,this['appId'],_0x9f0dfb);}async['punsub'](_0x261a88){return await this['subscribe']['punsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x261a88);}async['pubsub'](_0x30437c,_0x3dc08f,_0x431bf1,_0x1cb9cc=enums_1['HMSH_OTT_WAIT_TIME']){_0x431bf1={'metadata':{'ngn':this['guid'],'trc':_0x431bf1?.['metadata']?.['trc'],'spn':_0x431bf1?.['metadata']?.['spn']}};const _0x295b7c=await this['pub'](_0x30437c,_0x3dc08f,_0x431bf1);return new Promise((_0x4f8c33,_0x39297b)=>{this['registerJobCallback'](_0x295b7c,(_0x24d836,_0x5c0867)=>{if(_0x5c0867['metadata']['err']){const _0x24affa=JSON['parse'](_0x5c0867['metadata']['err']);_0x39297b({..._0x24affa,'job_id':_0x5c0867['metadata']['jid']});}else _0x4f8c33(_0x5c0867);}),setTimeout(()=>{this['delistJobCallback'](_0x295b7c),_0x39297b({'code':enums_1['HMSH_CODE_TIMEOUT'],'message':'timeout','job_id':_0x295b7c});},_0x1cb9cc);});}async['pubOneTimeSubs'](_0xa49e2a,_0x47bacb,_0x119619=![]){if(this['hasOneTimeSubscription'](_0xa49e2a)){const _0x3b68a9={'type':'job','topic':_0xa49e2a['metadata']['jid'],'job':(0x0,utils_1['restoreHierarchy'])(_0x47bacb)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x3b68a9,this['appId'],_0xa49e2a['metadata']['ngn']);}}async['getPublishesTopic'](_0x3dba85){const _0x57b348=await this['getVID'](),_0x3780b7=_0x3dba85['metadata']['aid']||_0x3dba85['$self']?.['output']?.['metadata']?.['aid'],_0x2aaa70=await this['store']['getSchema'](_0x3780b7,_0x57b348);return _0x2aaa70['publishes'];}async['pubPermSubs'](_0x1ede49,_0x4ced98,_0x2d78d8=![]){const _0x29a9f6=await this['getPublishesTopic'](_0x1ede49);if(_0x29a9f6){const _0x1d329b={'type':'job','topic':_0x29a9f6,'job':(0x0,utils_1['restoreHierarchy'])(_0x4ced98)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x1d329b,this['appId'],_0x29a9f6+'.'+_0x1ede49['metadata']['jid']);}}async['add'](_0x19d8fa){return await this['router']['publishMessage'](null,_0x19d8fa);}['registerJobCallback'](_0x4ce850,_0x3945ac){this['jobCallbacks'][_0x4ce850]=_0x3945ac;}['delistJobCallback'](_0x45bfe6){delete this['jobCallbacks'][_0x45bfe6];}['hasOneTimeSubscription'](_0x4b82bb){return Boolean(_0x4b82bb['metadata']['ngn']);}async['runJobCompletionTasks'](_0x580998,_0x520d3f={}){const _0x150b30=this['hasParentJob'](_0x580998,!![]),_0x21d696=this['hasOneTimeSubscription'](_0x580998),_0x1ebbe3=await this['getPublishesTopic'](_0x580998);let _0x5a5b06;if(_0x150b30||_0x21d696||_0x1ebbe3){const _0x259066=await this['getState'](_0x580998['metadata']['tpc'],_0x580998['metadata']['jid']);_0x5a5b06=await this['execAdjacentParent'](_0x580998,_0x259066,_0x520d3f['emit']),this['pubOneTimeSubs'](_0x580998,_0x259066,_0x520d3f['emit']),this['pubPermSubs'](_0x580998,_0x259066,_0x520d3f['emit']);}return!_0x520d3f['emit']&&this['taskService']['registerJobForCleanup'](_0x580998['metadata']['jid'],this['resolveExpires'](_0x580998,_0x520d3f),_0x520d3f),_0x5a5b06;}['resolveExpires'](_0x37373f,_0x423cf3){return _0x423cf3['expire']??_0x37373f['metadata']['expire']??enums_1['HMSH_EXPIRE_JOB_SECONDS'];}async['export'](_0x50ad38){return await this['exporter']['export'](_0x50ad38);}async['getRaw'](_0x339077){return await this['store']['getRaw'](_0x339077);}async['getStatus'](_0x35b35e){const {id:_0x22cbf0}=await this['getVID']();return await this['store']['getStatus'](_0x35b35e,_0x22cbf0);}async['getState'](_0x37e1b2,_0x17de57){const _0x4615a7=await this['store']['getSymbols']('$'+_0x37e1b2),_0x48cbde={['$'+_0x37e1b2]:Object['keys'](_0x4615a7)},_0x2c2882={},_0x458284=await this['store']['getState'](_0x17de57,_0x48cbde,_0x2c2882);if(!_0x458284)throw new Error('not\x20found\x20'+_0x17de57);const [_0x489b4f,_0x17facc]=_0x458284,_0x28ef55=(0x0,utils_1['restoreHierarchy'])(_0x489b4f);return _0x17facc&&_0x28ef55['metadata']&&(_0x28ef55['metadata']['js']=_0x17facc),_0x28ef55;}async['getQueryState'](_0x20423d,_0x1fb6e1){return await this['store']['getQueryState'](_0x20423d,_0x1fb6e1);}async['compress'](_0x1e8119){const _0x1ddd4c=await this['store']['getSymbolValues'](),_0x1dfbfd=Object['keys'](_0x1ddd4c)['length'],_0x4603eb=Math['pow'](0x34,0x2)-0x1,_0x1e5622=serializer_1['SerializerService']['filterSymVals'](_0x1dfbfd,_0x4603eb,_0x1ddd4c,new Set(_0x1e8119));return await this['store']['addSymbolValues'](_0x1e5622);}}function _0xd44c(_0x592ee5,_0x583bfa){const _0xc6db74=_0xc6db();return _0xd44c=function(_0xd44cb9,_0x119313){_0xd44cb9=_0xd44cb9-0x125;let _0x124b55=_0xc6db74[_0xd44cb9];return _0x124b55;},_0xd44c(_0x592ee5,_0x583bfa);}function _0xc6db(){const _0x4b2afa=['77432TSmxxA','10jsxwNB','51suQnED','9EeaLtS','192JAYWma','5sbeWvS','531224gViMjI','2868437vtUAQR','1871166ZNLENV','3187674CaFwPf','5126lVAzCY','4726704DaqFjD'];_0xc6db=function(){return _0x4b2afa;};return _0xc6db();}exports['EngineService']=EngineService;
|
|
1
|
+
'use strict';(function(_0x49964f,_0x175656){const _0x5adb82=_0x1f0c,_0x45bda3=_0x49964f();while(!![]){try{const _0x5b6ab7=-parseInt(_0x5adb82(0xcc))/0x1*(-parseInt(_0x5adb82(0xca))/0x2)+-parseInt(_0x5adb82(0xc9))/0x3*(parseInt(_0x5adb82(0xd2))/0x4)+-parseInt(_0x5adb82(0xcf))/0x5+-parseInt(_0x5adb82(0xce))/0x6*(parseInt(_0x5adb82(0xcd))/0x7)+-parseInt(_0x5adb82(0xc8))/0x8*(parseInt(_0x5adb82(0xd0))/0x9)+parseInt(_0x5adb82(0xcb))/0xa+parseInt(_0x5adb82(0xd1))/0xb;if(_0x5b6ab7===_0x175656)break;else _0x45bda3['push'](_0x45bda3['shift']());}catch(_0x3fcdd8){_0x45bda3['push'](_0x45bda3['shift']());}}}(_0x475c,0xc12bf));var __importDefault=this&&this['__importDefault']||function(_0x13d561){return _0x13d561&&_0x13d561['__esModule']?_0x13d561:{'default':_0x13d561};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['EngineService']=void 0x0;function _0x1f0c(_0x46a4f4,_0x3784a7){const _0x475c31=_0x475c();return _0x1f0c=function(_0x1f0cc4,_0x38adc0){_0x1f0cc4=_0x1f0cc4-0xc8;let _0x264e1e=_0x475c31[_0x1f0cc4];return _0x264e1e;},_0x1f0c(_0x46a4f4,_0x3784a7);}function _0x475c(){const _0x17f7b4=['29976AQWahI','136ariMCB','423fvwqLj','24ixYQcZ','7321540QpBAqv','61960NOWsVp','7AZxfpj','1837806bftsqh','5238990yDEgIP','798912sadtXm','35589026cqfsFZ'];_0x475c=function(){return _0x17f7b4;};return _0x475c();}const key_1=require('../../modules/key'),enums_1=require('../../modules/enums'),utils_1=require('../../modules/utils'),activities_1=__importDefault(require('../activities')),compiler_1=require('../compiler'),exporter_1=require('../exporter'),reporter_1=require('../reporter'),router_1=require('../router'),serializer_1=require('../serializer'),factory_1=require('../search/factory'),factory_2=require('../store/factory'),factory_3=require('../stream/factory'),factory_4=require('../sub/factory'),task_1=require('../task'),stream_1=require('../../types/stream');class EngineService{constructor(){this['cacheMode']='cache',this['untilVersion']=null,this['jobCallbacks']={},this['reporting']=![],this['jobId']=0x1;}static async['init'](_0x30e026,_0x583396,_0x3b9f21,_0x10da47,_0x358e69){if(_0x10da47['engine']){const _0x4130a8=new EngineService();_0x4130a8['verifyEngineFields'](_0x10da47),_0x4130a8['namespace']=_0x30e026,_0x4130a8['appId']=_0x583396,_0x4130a8['guid']=_0x3b9f21,_0x4130a8['logger']=_0x358e69,await _0x4130a8['initSearchChannel'](_0x10da47['engine']['store']),await _0x4130a8['initStoreChannel'](_0x10da47['engine']['store']),await _0x4130a8['initSubChannel'](_0x10da47['engine']['sub'],_0x10da47['engine']['store']),await _0x4130a8['initStreamChannel'](_0x10da47['engine']['stream'],_0x10da47['engine']['store']),_0x4130a8['router']=await _0x4130a8['initRouter'](_0x10da47);const _0x32b8d7=_0x4130a8['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x4130a8['appId']});return _0x4130a8['router']['consumeMessages'](_0x32b8d7,'ENGINE',_0x4130a8['guid'],_0x4130a8['processStreamMessage']['bind'](_0x4130a8)),_0x4130a8['taskService']=new task_1['TaskService'](_0x4130a8['store'],_0x358e69),_0x4130a8['exporter']=new exporter_1['ExporterService'](_0x4130a8['appId'],_0x4130a8['store'],_0x358e69),_0x4130a8['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x4130a8;}}['verifyEngineFields'](_0x5554a2){if(!(0x0,utils_1['identifyProvider'])(_0x5554a2['engine']['store'])||!(0x0,utils_1['identifyProvider'])(_0x5554a2['engine']['stream'])||!(0x0,utils_1['identifyProvider'])(_0x5554a2['engine']['sub']))throw new Error('engine\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields.');}async['initSearchChannel'](_0x4ea82d,_0xd83e4b){this['search']=await factory_1['SearchServiceFactory']['init'](_0x4ea82d,_0xd83e4b,this['namespace'],this['appId'],this['logger']);}async['initStoreChannel'](_0x45f61e){this['store']=await factory_2['StoreServiceFactory']['init'](_0x45f61e,this['namespace'],this['appId'],this['logger']);}async['initSubChannel'](_0x3c72c5,_0x410945){this['subscribe']=await factory_4['SubServiceFactory']['init'](_0x3c72c5,_0x410945,this['namespace'],this['appId'],this['guid'],this['logger']);}async['initStreamChannel'](_0x49b76b,_0x26673b){this['stream']=await factory_3['StreamServiceFactory']['init'](_0x49b76b,_0x26673b,this['namespace'],this['appId'],this['logger']);}async['initRouter'](_0x3e450f){const _0x525146=await this['store']['getThrottleRate'](':');return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['ENGINE'],'reclaimDelay':_0x3e450f['engine']['reclaimDelay'],'reclaimCount':_0x3e450f['engine']['reclaimCount'],'throttle':_0x525146,'readonly':_0x3e450f['engine']['readonly']},this['stream'],this['logger']);}async['fetchAndVerifyVID'](_0x11a175,_0x4045bf=0x0){if(isNaN(Number(_0x11a175['version']))){const _0xcf2bb4=await this['store']['getApp'](_0x11a175['id'],!![]);if(!isNaN(Number(_0xcf2bb4['version']))){if(!this['apps'])this['apps']={};return this['apps'][_0x11a175['id']]=_0xcf2bb4,{'id':_0x11a175['id'],'version':_0xcf2bb4['version']};}else{if(_0x4045bf<0xa)return await(0x0,utils_1['sleepFor'])(enums_1['HMSH_QUORUM_DELAY_MS']*0x2),await this['fetchAndVerifyVID'](_0x11a175,_0x4045bf+0x1);else this['logger']['error']('engine-vid-resolution-error',{'id':_0x11a175['id'],'guid':this['guid']});}}return _0x11a175;}async['getVID'](_0xcec7e){if(this['cacheMode']==='nocache'){const _0x2440d2=await this['store']['getApp'](this['appId'],!![]);if(_0x2440d2['version']['toString']()===this['untilVersion']['toString']()){if(!this['apps'])this['apps']={};this['apps'][this['appId']]=_0x2440d2,this['setCacheMode']('cache',_0x2440d2['version']['toString']());}return{'id':this['appId'],'version':_0x2440d2['version']};}else return!this['apps']&&_0xcec7e?(this['apps']={},this['apps'][this['appId']]=_0xcec7e,_0xcec7e):await this['fetchAndVerifyVID']({'id':this['appId'],'version':this['apps']?.[this['appId']]['version']});}['setCacheMode'](_0xd0268f,_0x4ce013){this['logger']['info']('engine-executable-cache',{'mode':_0xd0268f,[_0xd0268f==='cache'?'target':'until']:_0x4ce013}),this['cacheMode']=_0xd0268f,this['untilVersion']=_0x4ce013;}async['routeToSubscribers'](_0x516207,_0x52b5f5){const _0x59a2f5=this['jobCallbacks'][_0x52b5f5['metadata']['jid']];_0x59a2f5&&(this['delistJobCallback'](_0x52b5f5['metadata']['jid']),_0x59a2f5(_0x516207,_0x52b5f5));}async['processWebHooks'](){this['taskService']['processWebHooks'](this['hook']['bind'](this));}async['processTimeHooks'](){this['taskService']['processTimeHooks'](this['hookTime']['bind'](this));}async['throttle'](_0x398023){try{this['router']?.['setThrottle'](_0x398023);}catch(_0x38e8b6){this['logger']['error']('engine-throttle-error',{'error':_0x38e8b6});}}async['initActivity'](_0xcaa441,_0x9ddf7c={},_0x4c3679){const [_0x47efec,_0x37652c]=await this['getSchema'](_0xcaa441),_0x2df885=activities_1['default'][utils_1['polyfill']['resolveActivityType'](_0x37652c['type'])];if(_0x2df885){const _0xaf6c6f=(0x0,utils_1['formatISODate'])(new Date()),_0x34cd7f={'aid':_0x47efec,'atp':_0x37652c['type'],'stp':_0x37652c['subtype'],'ac':_0xaf6c6f,'au':_0xaf6c6f},_0x5b2fe1=null;return new _0x2df885(_0x37652c,_0x9ddf7c,_0x34cd7f,_0x5b2fe1,this,_0x4c3679);}else throw new Error('activity\x20type\x20'+_0x37652c['type']+'\x20not\x20found');}async['getSchema'](_0x17a306){const _0x1dcb0b=await this['store']['getApp'](this['appId']);if(!_0x1dcb0b)throw new Error('no\x20app\x20found\x20for\x20id\x20'+this['appId']);if(this['isPrivate'](_0x17a306)){const _0x21879d=_0x17a306['substring'](0x1),_0x4cb0f5=await this['store']['getSchema'](_0x21879d,await this['getVID'](_0x1dcb0b));return[_0x21879d,_0x4cb0f5];}else{const _0x3164f5=await this['store']['getSubscription'](_0x17a306,await this['getVID'](_0x1dcb0b));if(_0x3164f5){const _0x2a15de=await this['store']['getSchema'](_0x3164f5,await this['getVID'](_0x1dcb0b));return[_0x3164f5,_0x2a15de];}}throw new Error('no\x20subscription\x20found\x20for\x20topic\x20'+_0x17a306+'\x20in\x20app\x20'+this['appId']+'\x20for\x20app\x20version\x20'+_0x1dcb0b['version']);}async['getSettings'](){return await this['store']['getSettings']();}['isPrivate'](_0x5e9bfb){return _0x5e9bfb['startsWith']('.');}async['plan'](_0x3ff1de){const _0x483c41=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x483c41['plan'](_0x3ff1de);}async['deploy'](_0x15ef9a){const _0x11c1f4=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x11c1f4['deploy'](_0x15ef9a);}async['getStats'](_0x2b39dc,_0x2b4cec){const {id:_0x4b56f6,version:_0x4a3718}=await this['getVID'](),_0x190beb=new reporter_1['ReporterService']({'id':_0x4b56f6,'version':_0x4a3718},this['store'],this['logger']),_0x554ad0=await this['resolveQuery'](_0x2b39dc,_0x2b4cec);return await _0x190beb['getStats'](_0x554ad0);}async['getIds'](_0x25a954,_0xa431ad,_0x255a68=[]){const {id:_0x1d4c10,version:_0x2dbd91}=await this['getVID'](),_0x49613b=new reporter_1['ReporterService']({'id':_0x1d4c10,'version':_0x2dbd91},this['store'],this['logger']),_0x18ba60=await this['resolveQuery'](_0x25a954,_0xa431ad);return await _0x49613b['getIds'](_0x18ba60,_0x255a68);}async['resolveQuery'](_0x302e31,_0x2b3b41){const _0x37a166=await this['initActivity'](_0x302e31,_0x2b3b41['data']);return await _0x37a166['getState'](),{'end':_0x2b3b41['end'],'start':_0x2b3b41['start'],'range':_0x2b3b41['range'],'granularity':_0x37a166['resolveGranularity'](),'key':_0x37a166['resolveJobKey'](_0x37a166['createInputContext']()),'sparse':_0x2b3b41['sparse']};}async['processStreamMessage'](_0x2fadb5){this['logger']['debug']('engine-process',{'jid':_0x2fadb5['metadata']['jid'],'gid':_0x2fadb5['metadata']['gid'],'dad':_0x2fadb5['metadata']['dad'],'aid':_0x2fadb5['metadata']['aid'],'status':_0x2fadb5['status']||stream_1['StreamStatus']['SUCCESS'],'code':_0x2fadb5['code']||0xc8,'type':_0x2fadb5['type']});const _0x48e89a={'metadata':{'guid':_0x2fadb5['metadata']['guid'],'jid':_0x2fadb5['metadata']['jid'],'gid':_0x2fadb5['metadata']['gid'],'dad':_0x2fadb5['metadata']['dad'],'aid':_0x2fadb5['metadata']['aid']},'data':_0x2fadb5['data']};if(_0x2fadb5['type']===stream_1['StreamDataType']['TIMEHOOK']){const _0x2668cc=await this['initActivity']('.'+_0x2fadb5['metadata']['aid'],_0x48e89a['data'],_0x48e89a);await _0x2668cc['processTimeHookEvent'](_0x2fadb5['metadata']['jid']);}else{if(_0x2fadb5['type']===stream_1['StreamDataType']['WEBHOOK']){const _0x542002=await this['initActivity']('.'+_0x2fadb5['metadata']['aid'],_0x48e89a['data'],_0x48e89a);await _0x542002['processWebHookEvent'](_0x2fadb5['status'],_0x2fadb5['code']);}else{if(_0x2fadb5['type']===stream_1['StreamDataType']['TRANSITION']){const _0x258bab=await this['initActivity']('.'+_0x2fadb5['metadata']['aid'],_0x48e89a['data'],_0x48e89a);await _0x258bab['process']();}else{if(_0x2fadb5['type']===stream_1['StreamDataType']['AWAIT']){_0x48e89a['metadata']={..._0x48e89a['metadata'],'pj':_0x2fadb5['metadata']['jid'],'pg':_0x2fadb5['metadata']['gid'],'pd':_0x2fadb5['metadata']['dad'],'pa':_0x2fadb5['metadata']['aid'],'px':_0x2fadb5['metadata']['await']===![],'trc':_0x2fadb5['metadata']['trc'],'spn':_0x2fadb5['metadata']['spn']};const _0x2e0e29=await this['initActivity'](_0x2fadb5['metadata']['topic'],_0x2fadb5['data'],_0x48e89a);await _0x2e0e29['process']();}else{if(_0x2fadb5['type']===stream_1['StreamDataType']['RESULT']){const _0x3ab06a=await this['initActivity']('.'+_0x48e89a['metadata']['aid'],_0x2fadb5['data'],_0x48e89a);await _0x3ab06a['processEvent'](_0x2fadb5['status'],_0x2fadb5['code']);}else{const _0x4d4ffa=await this['initActivity']('.'+_0x2fadb5['metadata']['aid'],_0x2fadb5['data'],_0x48e89a);await _0x4d4ffa['processEvent'](_0x2fadb5['status'],_0x2fadb5['code'],'output');}}}}}this['logger']['debug']('engine-process-end',{'jid':_0x2fadb5['metadata']['jid'],'gid':_0x2fadb5['metadata']['gid'],'aid':_0x2fadb5['metadata']['aid']});}async['execAdjacentParent'](_0x4cbb8e,_0x82d9da,_0x1a2a51=![]){if(this['hasParentJob'](_0x4cbb8e)){const _0x1980ca=this['resolveError'](_0x82d9da['metadata']),_0x1c9468=_0x4cbb8e['$self']?.['output']?.['metadata']?.['l2s']||_0x4cbb8e['$self']?.['output']?.['metadata']?.['l1s'],_0x43e015={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x4cbb8e['metadata']['pj'],'gid':_0x4cbb8e['metadata']['pg'],'dad':_0x4cbb8e['metadata']['pd'],'aid':_0x4cbb8e['metadata']['pa'],'trc':_0x4cbb8e['metadata']['trc'],'spn':_0x1c9468},'type':stream_1['StreamDataType']['RESULT'],'data':_0x82d9da['data']};if(_0x1980ca&&_0x1980ca['code'])_0x43e015['status']=stream_1['StreamStatus']['ERROR'],_0x43e015['data']=_0x1980ca,_0x43e015['code']=_0x1980ca['code'],_0x43e015['stack']=_0x1980ca['stack'];else _0x1a2a51?(_0x43e015['status']=stream_1['StreamStatus']['PENDING'],_0x43e015['code']=enums_1['HMSH_CODE_PENDING']):(_0x43e015['status']=stream_1['StreamStatus']['SUCCESS'],_0x43e015['code']=enums_1['HMSH_CODE_SUCCESS']);return await this['router']?.['publishMessage'](null,_0x43e015);}}['hasParentJob'](_0xe107e5,_0x5f4afb=![]){if(_0x5f4afb)return Boolean(_0xe107e5['metadata']['pj']&&_0xe107e5['metadata']['pa']&&!_0xe107e5['metadata']['px']);return Boolean(_0xe107e5['metadata']['pj']&&_0xe107e5['metadata']['pa']);}['resolveError'](_0x42b474){if(_0x42b474&&_0x42b474['err'])return JSON['parse'](_0x42b474['err']);}async['interrupt'](_0x19c549,_0x21ca34,_0x2a4ab7={}){await this['store']['interrupt'](_0x19c549,_0x21ca34,_0x2a4ab7);const _0x4c7dbb=await this['getState'](_0x19c549,_0x21ca34),_0x2174ef={'interrupt':_0x2a4ab7['descend'],'expire':_0x2a4ab7['expire']};return await this['runJobCompletionTasks'](_0x4c7dbb,_0x2174ef);}async['scrub'](_0x267945){await this['store']['scrub'](_0x267945);}async['hook'](_0x5024a4,_0x556bfe,_0x18956b=stream_1['StreamStatus']['SUCCESS'],_0x33c785=0xc8){const _0x226510=await this['taskService']['getHookRule'](_0x5024a4),[_0x58f4db]=await this['getSchema']('.'+_0x226510['to']),_0x1d44e1={'type':stream_1['StreamDataType']['WEBHOOK'],'status':_0x18956b,'code':_0x33c785,'metadata':{'guid':(0x0,utils_1['guid'])(),'aid':_0x58f4db,'topic':_0x5024a4},'data':_0x556bfe};return await this['router']?.['publishMessage'](null,_0x1d44e1);}async['hookTime'](_0x133ba9,_0x42fa75,_0x24b70e,_0x200bd6){if(_0x200bd6==='interrupt'||_0x200bd6==='expire')return await this['interrupt'](_0x24b70e,_0x133ba9,{'suppress':!![],'expire':0x1});const [_0x2df945,..._0x89941e]=_0x24b70e['split'](','),_0x7d972d=','+_0x89941e['join'](','),_0xdd43fb={'type':stream_1['StreamDataType']['TIMEHOOK'],'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x133ba9,'gid':_0x42fa75,'dad':_0x7d972d,'aid':_0x2df945},'data':{'timestamp':Date['now']()}};await this['router']?.['publishMessage'](null,_0xdd43fb);}async['hookAll'](_0x28ba6f,_0x194f91,_0x38a4ed,_0x1ad830=[]){const _0x5f2eb0=await this['getVID'](),_0x12b8ea=await this['taskService']['getHookRule'](_0x28ba6f);if(_0x12b8ea){const _0x4bf1f7=await(0x0,utils_1['getSubscriptionTopic'])(_0x12b8ea['to'],this['store'],_0x5f2eb0),_0x34d214=await this['resolveQuery'](_0x4bf1f7,_0x38a4ed),_0x10db83=new reporter_1['ReporterService'](_0x5f2eb0,this['store'],this['logger']),_0x3b0e51=await _0x10db83['getWorkItems'](_0x34d214,_0x1ad830);if(_0x3b0e51['length']){const _0x356b88=new task_1['TaskService'](this['store'],this['logger']);await _0x356b88['enqueueWorkItems'](_0x3b0e51['map'](_0x271273=>[_0x28ba6f,_0x271273,_0x38a4ed['scrub']||![],JSON['stringify'](_0x194f91)]['join'](key_1['VALSEP']))),this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'work','originator':this['guid']},this['appId']);}return _0x3b0e51;}else throw new Error('unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20'+_0x28ba6f);}async['pub'](_0x3f79d5,_0x460d3a,_0x43c503,_0x262a9f){const _0xaca186=await this['initActivity'](_0x3f79d5,_0x460d3a,_0x43c503);if(_0xaca186)return await _0xaca186['process'](_0x262a9f);else throw new Error('unable\x20to\x20process\x20activity\x20for\x20topic\x20'+_0x3f79d5);}async['sub'](_0x5b19b8,_0x199199){const _0xa16505=async(_0x37f1d8,_0x270494)=>{_0x199199(_0x270494['topic'],_0x270494['job']);};return await this['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0xa16505,this['appId'],_0x5b19b8);}async['unsub'](_0x5aacd7){return await this['subscribe']['unsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x5aacd7);}async['psub'](_0x6a0ba4,_0x49baf1){const _0x2991c3=async(_0x501b9a,_0x20dcff)=>{_0x49baf1(_0x20dcff['topic'],_0x20dcff['job']);};return await this['subscribe']['psubscribe'](key_1['KeyType']['QUORUM'],_0x2991c3,this['appId'],_0x6a0ba4);}async['punsub'](_0x170d39){return await this['subscribe']['punsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x170d39);}async['pubsub'](_0x424999,_0x537a57,_0x1db9ff,_0x40fb16=enums_1['HMSH_OTT_WAIT_TIME']){_0x1db9ff={'metadata':{'ngn':this['guid'],'trc':_0x1db9ff?.['metadata']?.['trc'],'spn':_0x1db9ff?.['metadata']?.['spn']}};const _0x7cd201=await this['pub'](_0x424999,_0x537a57,_0x1db9ff);return new Promise((_0x5b895f,_0x5bf89f)=>{this['registerJobCallback'](_0x7cd201,(_0x44118c,_0x295f27)=>{if(_0x295f27['metadata']['err']){const _0x466ec4=JSON['parse'](_0x295f27['metadata']['err']);_0x5bf89f({..._0x466ec4,'job_id':_0x295f27['metadata']['jid']});}else _0x5b895f(_0x295f27);}),setTimeout(()=>{this['delistJobCallback'](_0x7cd201),_0x5bf89f({'code':enums_1['HMSH_CODE_TIMEOUT'],'message':'timeout','job_id':_0x7cd201});},_0x40fb16);});}async['pubOneTimeSubs'](_0xea5110,_0x28748e,_0x3591bb=![]){if(this['hasOneTimeSubscription'](_0xea5110)){const _0x242694={'type':'job','topic':_0xea5110['metadata']['jid'],'job':(0x0,utils_1['restoreHierarchy'])(_0x28748e)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x242694,this['appId'],_0xea5110['metadata']['ngn']);}}async['getPublishesTopic'](_0x106272){const _0x5ea4f6=await this['getVID'](),_0x76cebd=_0x106272['metadata']['aid']||_0x106272['$self']?.['output']?.['metadata']?.['aid'],_0x306093=await this['store']['getSchema'](_0x76cebd,_0x5ea4f6);return _0x306093['publishes'];}async['pubPermSubs'](_0x4899be,_0x1d411d,_0x51e254=![]){const _0x4e47d6=await this['getPublishesTopic'](_0x4899be);if(_0x4e47d6){const _0x23b8a1={'type':'job','topic':_0x4e47d6,'job':(0x0,utils_1['restoreHierarchy'])(_0x1d411d)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x23b8a1,this['appId'],_0x4e47d6+'.'+_0x4899be['metadata']['jid']);}}async['add'](_0x3c4f9d){return await this['router']?.['publishMessage'](null,_0x3c4f9d);}['registerJobCallback'](_0x3394ce,_0x41996d){this['jobCallbacks'][_0x3394ce]=_0x41996d;}['delistJobCallback'](_0x5147cc){delete this['jobCallbacks'][_0x5147cc];}['hasOneTimeSubscription'](_0x3c9e9e){return Boolean(_0x3c9e9e['metadata']['ngn']);}async['runJobCompletionTasks'](_0x2e63c4,_0x31c19d={}){const _0xd2efb1=this['hasParentJob'](_0x2e63c4,!![]),_0x5593d3=this['hasOneTimeSubscription'](_0x2e63c4),_0x521a2b=await this['getPublishesTopic'](_0x2e63c4);let _0x6a59d0;if(_0xd2efb1||_0x5593d3||_0x521a2b){const _0x519346=await this['getState'](_0x2e63c4['metadata']['tpc'],_0x2e63c4['metadata']['jid']);_0x6a59d0=await this['execAdjacentParent'](_0x2e63c4,_0x519346,_0x31c19d['emit']),this['pubOneTimeSubs'](_0x2e63c4,_0x519346,_0x31c19d['emit']),this['pubPermSubs'](_0x2e63c4,_0x519346,_0x31c19d['emit']);}return!_0x31c19d['emit']&&this['taskService']['registerJobForCleanup'](_0x2e63c4['metadata']['jid'],this['resolveExpires'](_0x2e63c4,_0x31c19d),_0x31c19d),_0x6a59d0;}['resolveExpires'](_0x391eae,_0x4c7e93){return _0x4c7e93['expire']??_0x391eae['metadata']['expire']??enums_1['HMSH_EXPIRE_JOB_SECONDS'];}async['export'](_0x4ee3b2){return await this['exporter']['export'](_0x4ee3b2);}async['getRaw'](_0x5dcd05){return await this['store']['getRaw'](_0x5dcd05);}async['getStatus'](_0x35271f){const {id:_0x59737a}=await this['getVID']();return await this['store']['getStatus'](_0x35271f,_0x59737a);}async['getState'](_0x42769d,_0x29b34a){const _0x3cf21a=await this['store']['getSymbols']('$'+_0x42769d),_0x26fba1={['$'+_0x42769d]:Object['keys'](_0x3cf21a)},_0x300982={},_0x464d08=await this['store']['getState'](_0x29b34a,_0x26fba1,_0x300982);if(!_0x464d08)throw new Error('not\x20found\x20'+_0x29b34a);const [_0x1b4d4f,_0x56a91e]=_0x464d08,_0x4be09c=(0x0,utils_1['restoreHierarchy'])(_0x1b4d4f);return _0x56a91e&&_0x4be09c['metadata']&&(_0x4be09c['metadata']['js']=_0x56a91e),_0x4be09c;}async['getQueryState'](_0x1386b4,_0x1a5090){return await this['store']['getQueryState'](_0x1386b4,_0x1a5090);}async['compress'](_0x44b242){const _0x8bb76=await this['store']['getSymbolValues'](),_0x1fc933=Object['keys'](_0x8bb76)['length'],_0x527966=Math['pow'](0x34,0x2)-0x1,_0x48d2f6=serializer_1['SerializerService']['filterSymVals'](_0x1fc933,_0x527966,_0x8bb76,new Set(_0x44b242));return await this['store']['addSymbolValues'](_0x48d2f6);}}exports['EngineService']=EngineService;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ILogger } from '../logger';
|
|
2
2
|
import { StoreService } from '../store';
|
|
3
3
|
import { DependencyExport, ExportOptions, JobActionExport, JobExport } from '../../types/exporter';
|
|
4
|
-
import {
|
|
4
|
+
import { ProviderClient, ProviderTransaction } from '../../types/provider';
|
|
5
5
|
import { StringStringType, Symbols } from '../../types/serializer';
|
|
6
6
|
declare class ExporterService {
|
|
7
7
|
appId: string;
|
|
8
8
|
logger: ILogger;
|
|
9
|
-
store: StoreService<
|
|
9
|
+
store: StoreService<ProviderClient, ProviderTransaction>;
|
|
10
10
|
symbols: Promise<Symbols> | Symbols;
|
|
11
|
-
constructor(appId: string, store: StoreService<
|
|
11
|
+
constructor(appId: string, store: StoreService<ProviderClient, ProviderTransaction>, logger: ILogger);
|
|
12
12
|
export(jobId: string, options?: ExportOptions): Promise<JobExport>;
|
|
13
13
|
inflateKey(key: string): string;
|
|
14
14
|
inflate(jobHash: StringStringType, dependencyList: string[]): JobExport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x3b9505,_0x38515f){const _0x3337e2=_0x1d51,_0x35440d=_0x3b9505();while(!![]){try{const _0x13ff8b=-parseInt(_0x3337e2(0x76))/0x1+-parseInt(_0x3337e2(0x7f))/0x2*(parseInt(_0x3337e2(0x79))/0x3)+-parseInt(_0x3337e2(0x7b))/0x4+-parseInt(_0x3337e2(0x7a))/0x5*(-parseInt(_0x3337e2(0x77))/0x6)+-parseInt(_0x3337e2(0x7d))/0x7+-parseInt(_0x3337e2(0x7c))/0x8*(parseInt(_0x3337e2(0x7e))/0x9)+-parseInt(_0x3337e2(0x80))/0xa*(-parseInt(_0x3337e2(0x78))/0xb);if(_0x13ff8b===_0x38515f)break;else _0x35440d['push'](_0x35440d['shift']());}catch(_0x2abd5b){_0x35440d['push'](_0x35440d['shift']());}}}(_0x7d27,0x6dd55));function _0x7d27(){const _0x53439d=['16jvcbGg','2661470GlKLPo','2976003CCtOjb','6CCzykn','10FnhUqT','394353fTvgFe','1976460ELsdoV','23175339kfwKjU','530466QbDdtK','10WxuNLx','1397716dEMtJq'];_0x7d27=function(){return _0x53439d;};return _0x7d27();}function _0x1d51(_0x29c57c,_0x2c3dd9){const _0x7d276d=_0x7d27();return _0x1d51=function(_0x1d5199,_0x30575a){_0x1d5199=_0x1d5199-0x76;let _0x2f7170=_0x7d276d[_0x1d5199];return _0x2f7170;},_0x1d51(_0x29c57c,_0x2c3dd9);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['ExporterService']=void 0x0;const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),serializer_1=require('../serializer');class ExporterService{constructor(_0x49376f,_0x40f33f,_0x12b662){this['appId']=_0x49376f,this['logger']=_0x12b662,this['store']=_0x40f33f;}async['export'](_0x505529,_0x14084e={}){!this['symbols']&&(this['symbols']=this['store']['getAllSymbols'](),this['symbols']=await this['symbols']);const _0x2848a9=[],_0x168d99=await this['store']['getRaw'](_0x505529),_0x284dea=this['inflate'](_0x168d99,_0x2848a9);return _0x284dea;}['inflateKey'](_0x18ce6d){return _0x18ce6d in this['symbols']?this['symbols'][_0x18ce6d]:_0x18ce6d;}['inflate'](_0x35de08,_0x4bf5d5){const _0x5bdc04={'hooks':{},'main':{'cursor':-0x1,'items':[]}},_0x1ae805={},_0x2d2722=this['inflateDependencyData'](_0x4bf5d5,_0x5bdc04),_0x34b465=/^([a-zA-Z]{3}),(\d+(?:,\d+)*)/;return Object['entries'](_0x35de08)['forEach'](([_0x1d9b9b,_0x4c2d14])=>{const _0x37d937=_0x1d9b9b['match'](_0x34b465);if(_0x37d937){const [_0x65cf91,_0x55f9a0,_0xaacb58]=_0x37d937,_0x28145b=this['inflateKey'](_0x55f9a0),_0xc96e92=''+_0xaacb58['replace'](/,/g,'/'),_0x30766f=serializer_1['SerializerService']['fromString'](_0x4c2d14);_0x1ae805[_0xc96e92+'/'+_0x28145b]=_0x30766f;}else _0x1d9b9b['length']===0x3&&(_0x1ae805[this['inflateKey'](_0x1d9b9b)]=serializer_1['SerializerService']['fromString'](_0x4c2d14));}),{'dependencies':_0x2d2722,'process':(0x0,utils_1['restoreHierarchy'])(_0x1ae805),'status':_0x35de08[':']};}['inflateDependencyData'](_0x334543,_0x3ba284){const _0x9ec328=/([0-9,]+)-(\d+)$/,_0x1d0383=/-(\d+)$/;return _0x334543['map']((_0x3fe299,_0x292e4f)=>{const [_0x309c62,_0xa420b0,_0x3f57a3,_0x301612,..._0x395faf]=_0x3fe299['split'](key_1['VALSEP']),_0x52e922=_0x395faf['join'](key_1['VALSEP']),_0x3b40c8=_0x52e922['match'](_0x9ec328);let _0x4715b9,_0x1d2ac0,_0x5d1879='';if(_0x3b40c8){const [_0x157723,_0xae3356,_0x4f7a52]=_0x3b40c8;_0x5d1879=_0xae3356['split'](',')['join']('/'),_0x4715b9=_0x5d1879+'['+_0x4f7a52+']',_0x1d2ac0='hook';}else{const _0x419b93=_0x52e922['match'](_0x1d0383);if(_0x419b93){const [_0x3ede06,_0x4b3a49]=_0x419b93;_0x4715b9='['+_0x4b3a49+']',_0x1d2ac0='flow';}else _0x4715b9='/',_0x1d2ac0='other';}return{'type':_0x309c62,'topic':_0xa420b0,'gid':_0x3f57a3,'jid':_0x52e922};});}}exports['ExporterService']=ExporterService;
|