@hotmeshio/hotmesh 0.3.19 → 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.
Files changed (102) hide show
  1. package/README.md +72 -36
  2. package/build/index.d.ts +7 -1
  3. package/build/index.js +13 -1
  4. package/build/modules/key.js +1 -1
  5. package/build/modules/utils.d.ts +1 -3
  6. package/build/modules/utils.js +1 -1
  7. package/build/package.json +5 -4
  8. package/build/services/activities/activity.js +1 -1
  9. package/build/services/activities/await.js +1 -1
  10. package/build/services/activities/cycle.js +1 -1
  11. package/build/services/activities/hook.js +1 -1
  12. package/build/services/activities/index.js +1 -1
  13. package/build/services/activities/interrupt.js +1 -1
  14. package/build/services/activities/signal.js +1 -1
  15. package/build/services/activities/trigger.js +1 -1
  16. package/build/services/activities/worker.js +1 -1
  17. package/build/services/collator/index.js +1 -1
  18. package/build/services/compiler/deployer.js +1 -1
  19. package/build/services/compiler/index.js +1 -1
  20. package/build/services/compiler/validator.js +1 -1
  21. package/build/services/connector/factory.d.ts +1 -0
  22. package/build/services/connector/factory.js +35 -32
  23. package/build/services/connector/index.d.ts +4 -2
  24. package/build/services/connector/index.js +10 -5
  25. package/build/services/connector/providers/postgres.d.ts +13 -2
  26. package/build/services/connector/providers/postgres.js +54 -9
  27. package/build/services/engine/index.js +1 -1
  28. package/build/services/exporter/index.js +1 -1
  29. package/build/services/hotmesh/index.js +1 -6
  30. package/build/services/mapper/index.js +1 -1
  31. package/build/services/meshcall/index.js +3 -5
  32. package/build/services/meshdata/index.d.ts +3 -4
  33. package/build/services/meshdata/index.js +4 -9
  34. package/build/services/meshflow/client.js +1 -2
  35. package/build/services/meshflow/connection.js +1 -0
  36. package/build/services/meshflow/exporter.js +1 -1
  37. package/build/services/meshflow/worker.js +5 -8
  38. package/build/services/meshos/index.d.ts +2 -2
  39. package/build/services/meshos/index.js +6 -9
  40. package/build/services/pipe/functions/array.js +1 -1
  41. package/build/services/pipe/functions/bitwise.js +1 -1
  42. package/build/services/pipe/functions/conditional.js +1 -1
  43. package/build/services/pipe/functions/cron.js +1 -1
  44. package/build/services/pipe/functions/date.js +1 -1
  45. package/build/services/pipe/functions/index.js +1 -1
  46. package/build/services/pipe/functions/json.js +1 -1
  47. package/build/services/pipe/functions/logical.js +1 -1
  48. package/build/services/pipe/functions/math.js +1 -1
  49. package/build/services/pipe/functions/number.js +1 -1
  50. package/build/services/pipe/functions/object.js +1 -1
  51. package/build/services/pipe/functions/string.js +1 -1
  52. package/build/services/pipe/functions/symbol.js +1 -1
  53. package/build/services/pipe/functions/unary.js +1 -1
  54. package/build/services/pipe/index.js +1 -1
  55. package/build/services/quorum/index.js +1 -1
  56. package/build/services/reporter/index.js +1 -1
  57. package/build/services/router/index.js +1 -1
  58. package/build/services/search/providers/postgres/postgres.js +1 -1
  59. package/build/services/search/providers/redis/ioredis.js +1 -1
  60. package/build/services/search/providers/redis/redis.js +1 -1
  61. package/build/services/serializer/index.js +1 -1
  62. package/build/services/store/providers/postgres/kvsql.js +1 -1
  63. package/build/services/store/providers/postgres/kvtables.d.ts +2 -2
  64. package/build/services/store/providers/postgres/kvtables.js +1 -1
  65. package/build/services/store/providers/postgres/kvtransaction.js +1 -1
  66. package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
  67. package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
  68. package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
  69. package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
  70. package/build/services/store/providers/postgres/postgres.js +1 -1
  71. package/build/services/store/providers/redis/_base.js +1 -1
  72. package/build/services/store/providers/redis/ioredis.js +1 -1
  73. package/build/services/store/providers/redis/redis.js +1 -1
  74. package/build/services/store/providers/store-initializable.js +1 -1
  75. package/build/services/stream/providers/nats/nats.js +1 -1
  76. package/build/services/stream/providers/postgres/postgres.js +1 -1
  77. package/build/services/stream/providers/redis/ioredis.js +1 -1
  78. package/build/services/stream/providers/redis/redis.js +1 -1
  79. package/build/services/stream/providers/stream-initializable.js +1 -1
  80. package/build/services/sub/factory.d.ts +2 -2
  81. package/build/services/sub/factory.js +13 -8
  82. package/build/services/sub/providers/nats/nats.d.ts +19 -0
  83. package/build/services/sub/providers/nats/nats.js +1 -0
  84. package/build/services/sub/providers/postgres/postgres.d.ts +1 -0
  85. package/build/services/sub/providers/postgres/postgres.js +1 -1
  86. package/build/services/sub/providers/redis/ioredis.js +1 -1
  87. package/build/services/sub/providers/redis/redis.js +1 -1
  88. package/build/services/task/index.js +1 -1
  89. package/build/services/telemetry/index.js +1 -1
  90. package/build/services/worker/index.js +1 -1
  91. package/build/types/hotmesh.d.ts +3 -17
  92. package/build/types/manifest.d.ts +2 -10
  93. package/build/types/nats.d.ts +8 -0
  94. package/build/types/postgres.d.ts +10 -1
  95. package/build/types/provider.d.ts +1 -0
  96. package/index.ts +24 -5
  97. package/package.json +5 -4
  98. package/types/hotmesh.ts +17 -17
  99. package/types/manifest.ts +2 -10
  100. package/types/nats.ts +34 -0
  101. package/types/postgres.ts +13 -2
  102. package/types/provider.ts +4 -0
@@ -7,42 +7,43 @@ const nats_1 = require("./providers/nats");
7
7
  const postgres_1 = require("./providers/postgres");
8
8
  const redis_1 = require("./providers/redis");
9
9
  class ConnectorService {
10
+ static async disconnectAll() {
11
+ await redis_1.RedisConnection.disconnectAll();
12
+ await ioredis_1.RedisConnection.disconnectAll();
13
+ await postgres_1.PostgresConnection.disconnectAll();
14
+ await nats_1.NatsConnection.disconnectAll();
15
+ }
16
+ ;
10
17
  static async connectClient(ProviderConfig) {
11
18
  const target = {};
12
19
  await ConnectorService.initClient(ProviderConfig, target, 'client');
13
20
  return target.client;
14
21
  }
15
22
  static async initClients(target) {
16
- let connections = target.connections;
17
- if (!connections) {
18
- const ProviderConfig = utils_1.polyfill.providerConfig(target);
19
- connections = target.connections = {
20
- store: { ...ProviderConfig },
21
- stream: { ...ProviderConfig },
22
- sub: { ...ProviderConfig },
23
+ let connection = utils_1.polyfill.providerConfig(target);
24
+ if (!('store' in connection)) {
25
+ connection = target.connection = {
26
+ ...connection,
27
+ store: { ...connection },
28
+ stream: { ...connection },
29
+ sub: { ...connection },
23
30
  };
24
31
  }
25
- if (connections.store) {
26
- await ConnectorService.initClient(connections.store, target, 'store');
32
+ if (connection.store) {
33
+ await ConnectorService.initClient(connection.store, target, 'store');
27
34
  }
28
- if (connections.stream) {
29
- await ConnectorService.initClient(connections.stream, target, 'stream');
35
+ if (connection.stream) {
36
+ await ConnectorService.initClient(connection.stream, target, 'stream');
30
37
  }
31
- if (connections.sub) {
32
- await ConnectorService.initClient(connections.sub, target, 'sub');
33
- if (connections.sub.class === connections.store.class) {
34
- connections.pub = {
35
- class: connections.store.class,
36
- options: { ...connections.store.options },
37
- };
38
- target.pub = target.store;
39
- }
40
- else {
41
- connections.pub = {
42
- class: connections.sub.class,
43
- options: { ...connections.sub.options },
38
+ if (connection.sub) {
39
+ await ConnectorService.initClient(connection.sub, target, 'sub');
40
+ if (connection.sub.class !== connection.store.class) {
41
+ connection.pub = {
42
+ class: connection.sub.class,
43
+ options: { ...connection.sub.options },
44
+ provider: connection.sub.provider,
44
45
  };
45
- await ConnectorService.initClient(connections.pub, target, 'pub');
46
+ await ConnectorService.initClient(connection.pub, target, 'pub');
46
47
  }
47
48
  }
48
49
  }
@@ -52,24 +53,26 @@ class ConnectorService {
52
53
  }
53
54
  const providerClass = ProviderConfig.class;
54
55
  const options = ProviderConfig.options;
55
- const providerName = (0, utils_1.identifyProvider)(providerClass);
56
+ const providerName = ProviderConfig.provider || (0, utils_1.identifyProvider)(providerClass);
57
+ const providerType = providerName.split('.')[0];
56
58
  let clientInstance;
57
59
  const id = (0, utils_1.guid)();
58
- switch (providerName) {
60
+ switch (providerType) {
59
61
  case 'redis':
60
- clientInstance = await redis_1.RedisConnection.connect(id, providerClass, options);
62
+ clientInstance = await redis_1.RedisConnection.connect(id, providerClass, options, { provider: providerName });
61
63
  break;
62
64
  case 'ioredis':
63
- clientInstance = await ioredis_1.RedisConnection.connect(id, providerClass, options);
65
+ clientInstance = await ioredis_1.RedisConnection.connect(id, providerClass, options, { provider: providerName });
64
66
  break;
65
67
  case 'nats':
66
- clientInstance = await nats_1.NatsConnection.connect(id, providerClass, options);
68
+ clientInstance = await nats_1.NatsConnection.connect(id, providerClass, options, { provider: providerName });
67
69
  break;
68
70
  case 'postgres':
69
- clientInstance = await postgres_1.PostgresConnection.connect(id, providerClass, options);
71
+ const bAutoConnect = field === 'sub';
72
+ clientInstance = await postgres_1.PostgresConnection.connect(id, providerClass, options, { connect: bAutoConnect, provider: providerName });
70
73
  break;
71
74
  default:
72
- throw new Error(`Unknown provider class: ${providerName}`);
75
+ throw new Error(`Unknown provider type: ${providerType}`);
73
76
  }
74
77
  target[field] = clientInstance.getClient();
75
78
  }
@@ -1,16 +1,18 @@
1
+ import { StringAnyType } from '../../types';
1
2
  import { ProviderClass, ProviderNativeClient, ProviderOptions } from '../../types/provider';
2
3
  import { ILogger } from '../logger';
3
4
  declare abstract class AbstractConnection<PClass, POptions> {
4
5
  static logger: ILogger;
6
+ static disconnecting: boolean;
5
7
  protected connection: any | null;
6
8
  protected static instances: Map<string, AbstractConnection<ProviderClass, ProviderOptions>>;
7
9
  protected id: string | null;
8
10
  protected abstract defaultOptions: any;
9
- protected abstract createConnection(client: PClass, options: POptions): Promise<any>;
11
+ protected abstract createConnection(client: PClass, options: POptions, config?: StringAnyType): Promise<any>;
10
12
  abstract getClient(): ProviderNativeClient;
11
13
  disconnect(): Promise<void>;
12
14
  protected abstract closeConnection(connection: any): Promise<void>;
13
- static connect<T extends AbstractConnection<ProviderClass, ProviderOptions>>(this: new () => T, id: string, client: ProviderClass, options?: ProviderOptions): Promise<T>;
15
+ static connect<T extends AbstractConnection<ProviderClass, ProviderOptions>>(this: new () => T, id: string, client: ProviderClass, options?: ProviderOptions, config?: StringAnyType): Promise<T>;
14
16
  static disconnectAll(): Promise<void>;
15
17
  }
16
18
  export { AbstractConnection };
@@ -16,22 +16,27 @@ class AbstractConnection {
16
16
  AbstractConnection.instances.delete(this.id);
17
17
  }
18
18
  }
19
- static async connect(id, client, options) {
19
+ static async connect(id, client, options, config) {
20
20
  if (AbstractConnection.instances.has(id)) {
21
21
  return AbstractConnection.instances.get(id);
22
22
  }
23
23
  const instance = new this();
24
24
  const opts = options ? { ...options } : { ...instance.defaultOptions };
25
- instance.connection = await instance.createConnection(client, opts);
25
+ instance.connection = await instance.createConnection(client, opts, config);
26
26
  instance.id = id;
27
27
  AbstractConnection.instances.set(id, instance);
28
28
  return instance;
29
29
  }
30
30
  static async disconnectAll() {
31
- await Promise.all(Array.from(this.instances.values()).map((instance) => instance.disconnect()));
32
- this.instances.clear();
31
+ if (!this.disconnecting) {
32
+ this.disconnecting = true;
33
+ await Promise.all(Array.from(this.instances.values()).map((instance) => instance.disconnect()));
34
+ this.instances.clear();
35
+ this.disconnecting = false;
36
+ }
33
37
  }
34
38
  }
35
39
  exports.AbstractConnection = AbstractConnection;
36
- AbstractConnection.logger = new logger_1.LoggerService('hotmesh', 'meshos');
40
+ AbstractConnection.logger = new logger_1.LoggerService('hotmesh', 'system');
41
+ AbstractConnection.disconnecting = false;
37
42
  AbstractConnection.instances = new Map();
@@ -1,9 +1,20 @@
1
1
  import { AbstractConnection } from '..';
2
- import { PostgresClientOptions, PostgresClientType, PostgresClassType } from '../../../types/postgres';
2
+ import { PostgresClientOptions, PostgresClientType, PostgresClassType, PostgresPoolClientType } from '../../../types/postgres';
3
3
  declare class PostgresConnection extends AbstractConnection<PostgresClassType, PostgresClientOptions> {
4
4
  defaultOptions: PostgresClientOptions;
5
- createConnection(clientConstructor: any, options: PostgresClientOptions): Promise<PostgresClientType>;
5
+ protected static poolClientInstances: Set<PostgresPoolClientType>;
6
+ protected static connectionInstances: Set<PostgresClientType>;
7
+ poolClientInstance: PostgresPoolClientType;
8
+ createConnection(clientConstructor: any, options: PostgresClientOptions, config?: {
9
+ connect?: boolean;
10
+ provider?: string;
11
+ }): Promise<PostgresClientType>;
6
12
  getClient(): PostgresClientType;
13
+ static disconnectAll(): Promise<void>;
14
+ static disconnectPoolClients(): Promise<void>;
15
+ static disconnectConnections(): Promise<void>;
7
16
  closeConnection(connection: PostgresClientType): Promise<void>;
17
+ static isPoolClient(client: any): client is PostgresPoolClientType;
18
+ static getTransactionClient(transactionClient: any): Promise<[('client' | 'poolclient'), PostgresClientType]>;
8
19
  }
9
20
  export { PostgresConnection };
@@ -15,11 +15,23 @@ class PostgresConnection extends __1.AbstractConnection {
15
15
  idleTimeoutMillis: 30000,
16
16
  };
17
17
  }
18
- async createConnection(clientConstructor, options) {
19
- const connection = new clientConstructor(options);
18
+ async createConnection(clientConstructor, options, config = {}) {
20
19
  try {
21
- await connection.connect();
22
- await connection.query('SELECT 1');
20
+ let connection;
21
+ if (config.provider === 'postgres.poolclient' || PostgresConnection.isPoolClient(clientConstructor)) {
22
+ connection = clientConstructor;
23
+ if (config.connect) {
24
+ const client = await clientConstructor.connect();
25
+ PostgresConnection.poolClientInstances.add(client);
26
+ this.poolClientInstance = client;
27
+ }
28
+ }
29
+ else {
30
+ connection = new clientConstructor(options);
31
+ await connection.connect();
32
+ await connection.query('SELECT 1');
33
+ }
34
+ PostgresConnection.connectionInstances.add(connection);
23
35
  return connection;
24
36
  }
25
37
  catch (error) {
@@ -35,14 +47,47 @@ class PostgresConnection extends __1.AbstractConnection {
35
47
  if (!this.connection) {
36
48
  throw new Error('Postgres client is not connected');
37
49
  }
38
- return this.connection;
50
+ return this.poolClientInstance || this.connection;
51
+ }
52
+ static async disconnectAll() {
53
+ if (!this.disconnecting) {
54
+ this.disconnecting = true;
55
+ await this.disconnectPoolClients();
56
+ await this.disconnectConnections();
57
+ this.disconnecting = false;
58
+ }
59
+ }
60
+ static async disconnectPoolClients() {
61
+ Array.from(this.poolClientInstances.values()).map((instance) => {
62
+ instance.release();
63
+ });
64
+ this.poolClientInstances.clear();
65
+ }
66
+ static async disconnectConnections() {
67
+ Array.from(this.connectionInstances.values()).map((instance) => {
68
+ instance.end();
69
+ });
70
+ this.connectionInstances.clear();
39
71
  }
40
72
  async closeConnection(connection) {
41
- if (!connection) {
42
- PostgresConnection.logger.warn(`postgres-not-connected-cannot-close`);
43
- return;
73
+ }
74
+ static isPoolClient(client) {
75
+ return !(isNaN(client?.totalCount) && isNaN(client?.idleCount));
76
+ }
77
+ static async getTransactionClient(transactionClient) {
78
+ let client;
79
+ let type;
80
+ if (PostgresConnection.isPoolClient(transactionClient)) {
81
+ type = 'poolclient';
82
+ client = await transactionClient.connect();
83
+ }
84
+ else {
85
+ type = 'client';
86
+ client = transactionClient;
44
87
  }
45
- await connection.end();
88
+ return [type, client];
46
89
  }
47
90
  }
48
91
  exports.PostgresConnection = PostgresConnection;
92
+ PostgresConnection.poolClientInstances = new Set();
93
+ PostgresConnection.connectionInstances = new Set();
@@ -1 +1 @@
1
- 'use strict';(function(_0x423f55,_0x57c4a3){const _0x4e724e=_0x291c,_0x3d7f33=_0x423f55();while(!![]){try{const _0x1487ce=-parseInt(_0x4e724e(0x18b))/0x1*(parseInt(_0x4e724e(0x18a))/0x2)+parseInt(_0x4e724e(0x185))/0x3*(-parseInt(_0x4e724e(0x18c))/0x4)+parseInt(_0x4e724e(0x18d))/0x5*(parseInt(_0x4e724e(0x184))/0x6)+-parseInt(_0x4e724e(0x18e))/0x7*(-parseInt(_0x4e724e(0x187))/0x8)+-parseInt(_0x4e724e(0x186))/0x9+parseInt(_0x4e724e(0x188))/0xa+-parseInt(_0x4e724e(0x189))/0xb*(-parseInt(_0x4e724e(0x183))/0xc);if(_0x1487ce===_0x57c4a3)break;else _0x3d7f33['push'](_0x3d7f33['shift']());}catch(_0x4c7d99){_0x3d7f33['push'](_0x3d7f33['shift']());}}}(_0x1b72,0xa737f));function _0x291c(_0x4c8339,_0x3e4be7){const _0x1b720a=_0x1b72();return _0x291c=function(_0x291c44,_0x3297c0){_0x291c44=_0x291c44-0x183;let _0x477bcd=_0x1b720a[_0x291c44];return _0x477bcd;},_0x291c(_0x4c8339,_0x3e4be7);}function _0x1b72(){const _0x3236eb=['46wCZDHJ','508268BpSKQp','1666185ofFbie','7TVNRNR','12BVPUZI','6OiBNMA','12VwgjIL','4496895gnJQSE','2984104TCldDX','6131750FxaWzN','13927617fsdTcg','38814dGSDhB'];_0x1b72=function(){return _0x3236eb;};return _0x1b72();}var __importDefault=this&&this['__importDefault']||function(_0x2d90a8){return _0x2d90a8&&_0x2d90a8['__esModule']?_0x2d90a8:{'default':_0x2d90a8};};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'),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'](_0x3c9b45,_0x53fc1d,_0x4d66b3,_0x2070e3,_0x1a3198){if(_0x2070e3['engine']){const _0x71a6=new EngineService();_0x71a6['verifyEngineFields'](_0x2070e3),_0x71a6['namespace']=_0x3c9b45,_0x71a6['appId']=_0x53fc1d,_0x71a6['guid']=_0x4d66b3,_0x71a6['logger']=_0x1a3198,await _0x71a6['initSearchChannel'](_0x2070e3['engine']['store']),await _0x71a6['initStoreChannel'](_0x2070e3['engine']['store']),await _0x71a6['initSubChannel'](_0x2070e3['engine']['sub'],_0x2070e3['engine']['pub']),await _0x71a6['initStreamChannel'](_0x2070e3['engine']['stream'],_0x2070e3['engine']['store']),_0x71a6['router']=await _0x71a6['initRouter'](_0x2070e3);const _0x5b60b7=_0x71a6['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x71a6['appId']});return _0x71a6['router']['consumeMessages'](_0x5b60b7,'ENGINE',_0x71a6['guid'],_0x71a6['processStreamMessage']['bind'](_0x71a6)),_0x71a6['taskService']=new task_1['TaskService'](_0x71a6['store'],_0x1a3198),_0x71a6['exporter']=new exporter_1['ExporterService'](_0x71a6['appId'],_0x71a6['store'],_0x1a3198),_0x71a6['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x71a6;}}['verifyEngineFields'](_0x347d95){if(!(0x0,utils_1['identifyProvider'])(_0x347d95['engine']['store'])||!(0x0,utils_1['identifyProvider'])(_0x347d95['engine']['stream'])||!(0x0,utils_1['identifyProvider'])(_0x347d95['engine']['sub']))throw new Error('engine\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields.');}async['initSearchChannel'](_0x475618,_0x392043){this['search']=await factory_1['SearchServiceFactory']['init'](_0x475618,_0x392043,this['namespace'],this['appId'],this['logger']);}async['initStoreChannel'](_0x1397e7){this['store']=await factory_2['StoreServiceFactory']['init'](_0x1397e7,this['namespace'],this['appId'],this['logger']);}async['initSubChannel'](_0x221ffa,_0x21cb2b){this['subscribe']=await factory_4['SubServiceFactory']['init'](_0x221ffa,_0x21cb2b,this['namespace'],this['appId'],this['guid'],this['logger']);}async['initStreamChannel'](_0x6127d5,_0xda146d){this['stream']=await factory_3['StreamServiceFactory']['init'](_0x6127d5,_0xda146d,this['namespace'],this['appId'],this['logger']);}async['initRouter'](_0x3113e4){const _0xd47a9f=await this['store']['getThrottleRate'](':');return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['ENGINE'],'reclaimDelay':_0x3113e4['engine']['reclaimDelay'],'reclaimCount':_0x3113e4['engine']['reclaimCount'],'throttle':_0xd47a9f,'readonly':_0x3113e4['engine']['readonly']},this['stream'],this['logger']);}async['fetchAndVerifyVID'](_0xe087cd,_0x17b151=0x0){if(isNaN(Number(_0xe087cd['version']))){const _0x3f3691=await this['store']['getApp'](_0xe087cd['id'],!![]);if(!isNaN(Number(_0x3f3691['version']))){if(!this['apps'])this['apps']={};return this['apps'][_0xe087cd['id']]=_0x3f3691,{'id':_0xe087cd['id'],'version':_0x3f3691['version']};}else{if(_0x17b151<0xa)return await(0x0,utils_1['sleepFor'])(enums_1['HMSH_QUORUM_DELAY_MS']*0x2),await this['fetchAndVerifyVID'](_0xe087cd,_0x17b151+0x1);else this['logger']['error']('engine-vid-resolution-error',{'id':_0xe087cd['id'],'guid':this['guid']});}}return _0xe087cd;}async['getVID'](_0x190f68){if(this['cacheMode']==='nocache'){const _0x5ed508=await this['store']['getApp'](this['appId'],!![]);if(_0x5ed508['version']['toString']()===this['untilVersion']['toString']()){if(!this['apps'])this['apps']={};this['apps'][this['appId']]=_0x5ed508,this['setCacheMode']('cache',_0x5ed508['version']['toString']());}return{'id':this['appId'],'version':_0x5ed508['version']};}else return!this['apps']&&_0x190f68?(this['apps']={},this['apps'][this['appId']]=_0x190f68,_0x190f68):await this['fetchAndVerifyVID']({'id':this['appId'],'version':this['apps']?.[this['appId']]['version']});}['setCacheMode'](_0x416060,_0x59a8bf){this['logger']['info']('engine-executable-cache',{'mode':_0x416060,[_0x416060==='cache'?'target':'until']:_0x59a8bf}),this['cacheMode']=_0x416060,this['untilVersion']=_0x59a8bf;}async['routeToSubscribers'](_0x3df044,_0x3d3b6b){const _0x309dc0=this['jobCallbacks'][_0x3d3b6b['metadata']['jid']];_0x309dc0&&(this['delistJobCallback'](_0x3d3b6b['metadata']['jid']),_0x309dc0(_0x3df044,_0x3d3b6b));}async['processWebHooks'](){this['taskService']['processWebHooks'](this['hook']['bind'](this));}async['processTimeHooks'](){this['taskService']['processTimeHooks'](this['hookTime']['bind'](this));}async['throttle'](_0x353388){try{this['router']?.['setThrottle'](_0x353388);}catch(_0x372e89){this['logger']['error']('engine-throttle-error',{'error':_0x372e89});}}async['initActivity'](_0x55b315,_0xa0c381={},_0x29ebb4){const [_0x279c7c,_0x67458c]=await this['getSchema'](_0x55b315),_0x2b13b6=activities_1['default'][utils_1['polyfill']['resolveActivityType'](_0x67458c['type'])];if(_0x2b13b6){const _0x14f0f0=(0x0,utils_1['formatISODate'])(new Date()),_0x20f304={'aid':_0x279c7c,'atp':_0x67458c['type'],'stp':_0x67458c['subtype'],'ac':_0x14f0f0,'au':_0x14f0f0},_0x2bfbf5=null;return new _0x2b13b6(_0x67458c,_0xa0c381,_0x20f304,_0x2bfbf5,this,_0x29ebb4);}else throw new Error('activity\x20type\x20'+_0x67458c['type']+'\x20not\x20found');}async['getSchema'](_0x1ddb74){const _0x46d8b6=await this['store']['getApp'](this['appId']);if(!_0x46d8b6)throw new Error('no\x20app\x20found\x20for\x20id\x20'+this['appId']);if(this['isPrivate'](_0x1ddb74)){const _0x11353e=_0x1ddb74['substring'](0x1),_0x5caf0e=await this['store']['getSchema'](_0x11353e,await this['getVID'](_0x46d8b6));return[_0x11353e,_0x5caf0e];}else{const _0x5e415f=await this['store']['getSubscription'](_0x1ddb74,await this['getVID'](_0x46d8b6));if(_0x5e415f){const _0x12752f=await this['store']['getSchema'](_0x5e415f,await this['getVID'](_0x46d8b6));return[_0x5e415f,_0x12752f];}}throw new Error('no\x20subscription\x20found\x20for\x20topic\x20'+_0x1ddb74+'\x20in\x20app\x20'+this['appId']+'\x20for\x20app\x20version\x20'+_0x46d8b6['version']);}async['getSettings'](){return await this['store']['getSettings']();}['isPrivate'](_0x44f986){return _0x44f986['startsWith']('.');}async['plan'](_0x1099b8){const _0x49ffcb=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x49ffcb['plan'](_0x1099b8);}async['deploy'](_0x6bc6a8){const _0x227be3=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x227be3['deploy'](_0x6bc6a8);}async['getStats'](_0x35e80a,_0x1511bb){const {id:_0x35bb58,version:_0x5ad098}=await this['getVID'](),_0x5da5d3=new reporter_1['ReporterService']({'id':_0x35bb58,'version':_0x5ad098},this['store'],this['logger']),_0x36ecf9=await this['resolveQuery'](_0x35e80a,_0x1511bb);return await _0x5da5d3['getStats'](_0x36ecf9);}async['getIds'](_0x1c7c68,_0x35765b,_0x429c9d=[]){const {id:_0x561b1d,version:_0x3848bd}=await this['getVID'](),_0x34b2c3=new reporter_1['ReporterService']({'id':_0x561b1d,'version':_0x3848bd},this['store'],this['logger']),_0x6e915b=await this['resolveQuery'](_0x1c7c68,_0x35765b);return await _0x34b2c3['getIds'](_0x6e915b,_0x429c9d);}async['resolveQuery'](_0x55ffd7,_0x68f2cd){const _0xb4dd6f=await this['initActivity'](_0x55ffd7,_0x68f2cd['data']);return await _0xb4dd6f['getState'](),{'end':_0x68f2cd['end'],'start':_0x68f2cd['start'],'range':_0x68f2cd['range'],'granularity':_0xb4dd6f['resolveGranularity'](),'key':_0xb4dd6f['resolveJobKey'](_0xb4dd6f['createInputContext']()),'sparse':_0x68f2cd['sparse']};}async['processStreamMessage'](_0x3d7fa2){this['logger']['debug']('engine-process',{'jid':_0x3d7fa2['metadata']['jid'],'gid':_0x3d7fa2['metadata']['gid'],'dad':_0x3d7fa2['metadata']['dad'],'aid':_0x3d7fa2['metadata']['aid'],'status':_0x3d7fa2['status']||stream_1['StreamStatus']['SUCCESS'],'code':_0x3d7fa2['code']||0xc8,'type':_0x3d7fa2['type']});const _0x424457={'metadata':{'guid':_0x3d7fa2['metadata']['guid'],'jid':_0x3d7fa2['metadata']['jid'],'gid':_0x3d7fa2['metadata']['gid'],'dad':_0x3d7fa2['metadata']['dad'],'aid':_0x3d7fa2['metadata']['aid']},'data':_0x3d7fa2['data']};if(_0x3d7fa2['type']===stream_1['StreamDataType']['TIMEHOOK']){const _0x29ed60=await this['initActivity']('.'+_0x3d7fa2['metadata']['aid'],_0x424457['data'],_0x424457);await _0x29ed60['processTimeHookEvent'](_0x3d7fa2['metadata']['jid']);}else{if(_0x3d7fa2['type']===stream_1['StreamDataType']['WEBHOOK']){const _0x53da6c=await this['initActivity']('.'+_0x3d7fa2['metadata']['aid'],_0x424457['data'],_0x424457);await _0x53da6c['processWebHookEvent'](_0x3d7fa2['status'],_0x3d7fa2['code']);}else{if(_0x3d7fa2['type']===stream_1['StreamDataType']['TRANSITION']){const _0x3a492c=await this['initActivity']('.'+_0x3d7fa2['metadata']['aid'],_0x424457['data'],_0x424457);await _0x3a492c['process']();}else{if(_0x3d7fa2['type']===stream_1['StreamDataType']['AWAIT']){_0x424457['metadata']={..._0x424457['metadata'],'pj':_0x3d7fa2['metadata']['jid'],'pg':_0x3d7fa2['metadata']['gid'],'pd':_0x3d7fa2['metadata']['dad'],'pa':_0x3d7fa2['metadata']['aid'],'px':_0x3d7fa2['metadata']['await']===![],'trc':_0x3d7fa2['metadata']['trc'],'spn':_0x3d7fa2['metadata']['spn']};const _0x3ba538=await this['initActivity'](_0x3d7fa2['metadata']['topic'],_0x3d7fa2['data'],_0x424457);await _0x3ba538['process']();}else{if(_0x3d7fa2['type']===stream_1['StreamDataType']['RESULT']){const _0xe451ef=await this['initActivity']('.'+_0x424457['metadata']['aid'],_0x3d7fa2['data'],_0x424457);await _0xe451ef['processEvent'](_0x3d7fa2['status'],_0x3d7fa2['code']);}else{const _0x24dd3d=await this['initActivity']('.'+_0x3d7fa2['metadata']['aid'],_0x3d7fa2['data'],_0x424457);await _0x24dd3d['processEvent'](_0x3d7fa2['status'],_0x3d7fa2['code'],'output');}}}}}this['logger']['debug']('engine-process-end',{'jid':_0x3d7fa2['metadata']['jid'],'gid':_0x3d7fa2['metadata']['gid'],'aid':_0x3d7fa2['metadata']['aid']});}async['execAdjacentParent'](_0x53b1d7,_0x1b15f4,_0x32bbd4=![]){if(this['hasParentJob'](_0x53b1d7)){const _0x405443=this['resolveError'](_0x1b15f4['metadata']),_0x2701a2=_0x53b1d7['$self']?.['output']?.['metadata']?.['l2s']||_0x53b1d7['$self']?.['output']?.['metadata']?.['l1s'],_0x1c9350={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x53b1d7['metadata']['pj'],'gid':_0x53b1d7['metadata']['pg'],'dad':_0x53b1d7['metadata']['pd'],'aid':_0x53b1d7['metadata']['pa'],'trc':_0x53b1d7['metadata']['trc'],'spn':_0x2701a2},'type':stream_1['StreamDataType']['RESULT'],'data':_0x1b15f4['data']};if(_0x405443&&_0x405443['code'])_0x1c9350['status']=stream_1['StreamStatus']['ERROR'],_0x1c9350['data']=_0x405443,_0x1c9350['code']=_0x405443['code'],_0x1c9350['stack']=_0x405443['stack'];else _0x32bbd4?(_0x1c9350['status']=stream_1['StreamStatus']['PENDING'],_0x1c9350['code']=enums_1['HMSH_CODE_PENDING']):(_0x1c9350['status']=stream_1['StreamStatus']['SUCCESS'],_0x1c9350['code']=enums_1['HMSH_CODE_SUCCESS']);return await this['router']?.['publishMessage'](null,_0x1c9350);}}['hasParentJob'](_0x97c210,_0x592232=![]){if(_0x592232)return Boolean(_0x97c210['metadata']['pj']&&_0x97c210['metadata']['pa']&&!_0x97c210['metadata']['px']);return Boolean(_0x97c210['metadata']['pj']&&_0x97c210['metadata']['pa']);}['resolveError'](_0x1fd7d0){if(_0x1fd7d0&&_0x1fd7d0['err'])return JSON['parse'](_0x1fd7d0['err']);}async['interrupt'](_0x3b60ab,_0x350bb6,_0x191ce1={}){await this['store']['interrupt'](_0x3b60ab,_0x350bb6,_0x191ce1);const _0x2898e7=await this['getState'](_0x3b60ab,_0x350bb6),_0x46aa5c={'interrupt':_0x191ce1['descend'],'expire':_0x191ce1['expire']};return await this['runJobCompletionTasks'](_0x2898e7,_0x46aa5c);}async['scrub'](_0x446fe0){await this['store']['scrub'](_0x446fe0);}async['hook'](_0xdd8ffe,_0x533a14,_0x8f0547=stream_1['StreamStatus']['SUCCESS'],_0x59bf1f=0xc8){const _0x58b3c8=await this['taskService']['getHookRule'](_0xdd8ffe),[_0x2ae991]=await this['getSchema']('.'+_0x58b3c8['to']),_0x50f575={'type':stream_1['StreamDataType']['WEBHOOK'],'status':_0x8f0547,'code':_0x59bf1f,'metadata':{'guid':(0x0,utils_1['guid'])(),'aid':_0x2ae991,'topic':_0xdd8ffe},'data':_0x533a14};return await this['router']?.['publishMessage'](null,_0x50f575);}async['hookTime'](_0x3c7a8c,_0x19344e,_0x415aff,_0x2d0905){if(_0x2d0905==='interrupt'||_0x2d0905==='expire')return await this['interrupt'](_0x415aff,_0x3c7a8c,{'suppress':!![],'expire':0x1});const [_0x29facb,..._0x409d1c]=_0x415aff['split'](','),_0x2694f5=','+_0x409d1c['join'](','),_0x40dab1={'type':stream_1['StreamDataType']['TIMEHOOK'],'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x3c7a8c,'gid':_0x19344e,'dad':_0x2694f5,'aid':_0x29facb},'data':{'timestamp':Date['now']()}};await this['router']?.['publishMessage'](null,_0x40dab1);}async['hookAll'](_0x28da01,_0x27639e,_0x4056e0,_0x550a7f=[]){const _0xf12b71=await this['getVID'](),_0x56c278=await this['taskService']['getHookRule'](_0x28da01);if(_0x56c278){const _0x3412c1=await(0x0,utils_1['getSubscriptionTopic'])(_0x56c278['to'],this['store'],_0xf12b71),_0x38acfe=await this['resolveQuery'](_0x3412c1,_0x4056e0),_0x1b81d9=new reporter_1['ReporterService'](_0xf12b71,this['store'],this['logger']),_0x1918f1=await _0x1b81d9['getWorkItems'](_0x38acfe,_0x550a7f);if(_0x1918f1['length']){const _0x1dadbf=new task_1['TaskService'](this['store'],this['logger']);await _0x1dadbf['enqueueWorkItems'](_0x1918f1['map'](_0x2d958a=>[_0x28da01,_0x2d958a,_0x4056e0['scrub']||![],JSON['stringify'](_0x27639e)]['join'](key_1['VALSEP']))),this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'work','originator':this['guid']},this['appId']);}return _0x1918f1;}else throw new Error('unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20'+_0x28da01);}async['pub'](_0x1cb80e,_0x4601b9,_0x469074,_0x3816c9){const _0x56fd21=await this['initActivity'](_0x1cb80e,_0x4601b9,_0x469074);if(_0x56fd21)return await _0x56fd21['process'](_0x3816c9);else throw new Error('unable\x20to\x20process\x20activity\x20for\x20topic\x20'+_0x1cb80e);}async['sub'](_0xda75ad,_0x26bffa){const _0x842cb9=async(_0x8c4093,_0x108c37)=>{_0x26bffa(_0x108c37['topic'],_0x108c37['job']);};return await this['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x842cb9,this['appId'],_0xda75ad);}async['unsub'](_0x3e2b6b){return await this['subscribe']['unsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x3e2b6b);}async['psub'](_0x3d425b,_0xf32aa3){const _0x58e003=async(_0x4c422c,_0x482aed)=>{_0xf32aa3(_0x482aed['topic'],_0x482aed['job']);};return await this['subscribe']['psubscribe'](key_1['KeyType']['QUORUM'],_0x58e003,this['appId'],_0x3d425b);}async['punsub'](_0x1080f9){return await this['subscribe']['punsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x1080f9);}async['pubsub'](_0x36768d,_0x26d6ef,_0x225f3d,_0x1790b5=enums_1['HMSH_OTT_WAIT_TIME']){_0x225f3d={'metadata':{'ngn':this['guid'],'trc':_0x225f3d?.['metadata']?.['trc'],'spn':_0x225f3d?.['metadata']?.['spn']}};const _0x4e85ee=await this['pub'](_0x36768d,_0x26d6ef,_0x225f3d);return new Promise((_0x7e811f,_0x35a94a)=>{this['registerJobCallback'](_0x4e85ee,(_0x91f0bc,_0x3107b3)=>{if(_0x3107b3['metadata']['err']){const _0x3c2d95=JSON['parse'](_0x3107b3['metadata']['err']);_0x35a94a({..._0x3c2d95,'job_id':_0x3107b3['metadata']['jid']});}else _0x7e811f(_0x3107b3);}),setTimeout(()=>{this['delistJobCallback'](_0x4e85ee),_0x35a94a({'code':enums_1['HMSH_CODE_TIMEOUT'],'message':'timeout','job_id':_0x4e85ee});},_0x1790b5);});}async['pubOneTimeSubs'](_0x15bae7,_0x184856,_0x5518cb=![]){if(this['hasOneTimeSubscription'](_0x15bae7)){const _0x2ae11e={'type':'job','topic':_0x15bae7['metadata']['jid'],'job':(0x0,utils_1['restoreHierarchy'])(_0x184856)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x2ae11e,this['appId'],_0x15bae7['metadata']['ngn']);}}async['getPublishesTopic'](_0x534d8b){const _0x16fa80=await this['getVID'](),_0x2ac13d=_0x534d8b['metadata']['aid']||_0x534d8b['$self']?.['output']?.['metadata']?.['aid'],_0x2fb362=await this['store']['getSchema'](_0x2ac13d,_0x16fa80);return _0x2fb362['publishes'];}async['pubPermSubs'](_0x1bd25b,_0x13d496,_0x19fe66=![]){const _0x51f41c=await this['getPublishesTopic'](_0x1bd25b);if(_0x51f41c){const _0x123f58={'type':'job','topic':_0x51f41c,'job':(0x0,utils_1['restoreHierarchy'])(_0x13d496)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x123f58,this['appId'],_0x51f41c+'.'+_0x1bd25b['metadata']['jid']);}}async['add'](_0x372d58){return await this['router']?.['publishMessage'](null,_0x372d58);}['registerJobCallback'](_0x7cd90,_0x3d9572){this['jobCallbacks'][_0x7cd90]=_0x3d9572;}['delistJobCallback'](_0x2b5889){delete this['jobCallbacks'][_0x2b5889];}['hasOneTimeSubscription'](_0x35e35d){return Boolean(_0x35e35d['metadata']['ngn']);}async['runJobCompletionTasks'](_0x497457,_0x140918={}){const _0x195394=this['hasParentJob'](_0x497457,!![]),_0x47543c=this['hasOneTimeSubscription'](_0x497457),_0x14d55f=await this['getPublishesTopic'](_0x497457);let _0x5cbed8;if(_0x195394||_0x47543c||_0x14d55f){const _0x1ba714=await this['getState'](_0x497457['metadata']['tpc'],_0x497457['metadata']['jid']);_0x5cbed8=await this['execAdjacentParent'](_0x497457,_0x1ba714,_0x140918['emit']),this['pubOneTimeSubs'](_0x497457,_0x1ba714,_0x140918['emit']),this['pubPermSubs'](_0x497457,_0x1ba714,_0x140918['emit']);}return!_0x140918['emit']&&this['taskService']['registerJobForCleanup'](_0x497457['metadata']['jid'],this['resolveExpires'](_0x497457,_0x140918),_0x140918),_0x5cbed8;}['resolveExpires'](_0x20c077,_0x12d733){return _0x12d733['expire']??_0x20c077['metadata']['expire']??enums_1['HMSH_EXPIRE_JOB_SECONDS'];}async['export'](_0x50d40c){return await this['exporter']['export'](_0x50d40c);}async['getRaw'](_0x5c7542){return await this['store']['getRaw'](_0x5c7542);}async['getStatus'](_0x362585){const {id:_0x519b21}=await this['getVID']();return await this['store']['getStatus'](_0x362585,_0x519b21);}async['getState'](_0x269f4e,_0xbcccec){const _0x283973=await this['store']['getSymbols']('$'+_0x269f4e),_0x2fbf5d={['$'+_0x269f4e]:Object['keys'](_0x283973)},_0x10c2f3={},_0x255ce6=await this['store']['getState'](_0xbcccec,_0x2fbf5d,_0x10c2f3);if(!_0x255ce6)throw new Error('not\x20found\x20'+_0xbcccec);const [_0x560f86,_0x323473]=_0x255ce6,_0x4a7aef=(0x0,utils_1['restoreHierarchy'])(_0x560f86);return _0x323473&&_0x4a7aef['metadata']&&(_0x4a7aef['metadata']['js']=_0x323473),_0x4a7aef;}async['getQueryState'](_0x812c17,_0x329b29){return await this['store']['getQueryState'](_0x812c17,_0x329b29);}async['compress'](_0x45762b){const _0x335425=await this['store']['getSymbolValues'](),_0x219b38=Object['keys'](_0x335425)['length'],_0x392cc7=Math['pow'](0x34,0x2)-0x1,_0x544cda=serializer_1['SerializerService']['filterSymVals'](_0x219b38,_0x392cc7,_0x335425,new Set(_0x45762b));return await this['store']['addSymbolValues'](_0x544cda);}}exports['EngineService']=EngineService;
1
+ 'use strict';(function(_0x3406b5,_0x28638f){const _0x327455=_0x51cb,_0x5b8402=_0x3406b5();while(!![]){try{const _0xdafef4=parseInt(_0x327455(0x1f4))/0x1*(parseInt(_0x327455(0x1f3))/0x2)+parseInt(_0x327455(0x1eb))/0x3*(-parseInt(_0x327455(0x1ed))/0x4)+parseInt(_0x327455(0x1f2))/0x5*(-parseInt(_0x327455(0x1ec))/0x6)+parseInt(_0x327455(0x1f1))/0x7*(parseInt(_0x327455(0x1ef))/0x8)+parseInt(_0x327455(0x1f0))/0x9+-parseInt(_0x327455(0x1ea))/0xa+parseInt(_0x327455(0x1ee))/0xb;if(_0xdafef4===_0x28638f)break;else _0x5b8402['push'](_0x5b8402['shift']());}catch(_0x5e70e0){_0x5b8402['push'](_0x5b8402['shift']());}}}(_0x557b,0xb5113));var __importDefault=this&&this['__importDefault']||function(_0xe7a65f){return _0xe7a65f&&_0xe7a65f['__esModule']?_0xe7a65f:{'default':_0xe7a65f};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['EngineService']=void 0x0;function _0x557b(){const _0x132028=['43488ToJRKG','1113579wLDbDZ','826oeuOTP','75kFcViy','1009474HQdGPA','1VajaSK','9505210BEWqaC','3LkfxCP','118044xdQCwg','2194256HJwuHf','13925230RrqYBh'];_0x557b=function(){return _0x132028;};return _0x557b();}function _0x51cb(_0x3bfa25,_0x35021c){const _0x557b0d=_0x557b();return _0x51cb=function(_0x51cb94,_0x586346){_0x51cb94=_0x51cb94-0x1ea;let _0x14f1ee=_0x557b0d[_0x51cb94];return _0x14f1ee;},_0x51cb(_0x3bfa25,_0x35021c);}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'](_0x2cd643,_0x581e66,_0xc87431,_0x47041e,_0x5f15f4){if(_0x47041e['engine']){const _0x220524=new EngineService();_0x220524['verifyEngineFields'](_0x47041e),_0x220524['namespace']=_0x2cd643,_0x220524['appId']=_0x581e66,_0x220524['guid']=_0xc87431,_0x220524['logger']=_0x5f15f4,await _0x220524['initSearchChannel'](_0x47041e['engine']['store']),await _0x220524['initStoreChannel'](_0x47041e['engine']['store']),await _0x220524['initSubChannel'](_0x47041e['engine']['sub'],_0x47041e['engine']['pub']??_0x47041e['engine']['store']),await _0x220524['initStreamChannel'](_0x47041e['engine']['stream'],_0x47041e['engine']['store']),_0x220524['router']=await _0x220524['initRouter'](_0x47041e);const _0x50057b=_0x220524['store']['mintKey'](key_1['KeyType']['STREAMS'],{'appId':_0x220524['appId']});return _0x220524['router']['consumeMessages'](_0x50057b,'ENGINE',_0x220524['guid'],_0x220524['processStreamMessage']['bind'](_0x220524)),_0x220524['taskService']=new task_1['TaskService'](_0x220524['store'],_0x5f15f4),_0x220524['exporter']=new exporter_1['ExporterService'](_0x220524['appId'],_0x220524['store'],_0x5f15f4),_0x220524['inited']=(0x0,utils_1['formatISODate'])(new Date()),_0x220524;}}['verifyEngineFields'](_0x4f81a1){if(!(0x0,utils_1['identifyProvider'])(_0x4f81a1['engine']['store'])||!(0x0,utils_1['identifyProvider'])(_0x4f81a1['engine']['stream'])||!(0x0,utils_1['identifyProvider'])(_0x4f81a1['engine']['sub']))throw new Error('engine\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields.');}async['initSearchChannel'](_0x2dc93b,_0x40f577){this['search']=await factory_1['SearchServiceFactory']['init'](_0x2dc93b,_0x40f577,this['namespace'],this['appId'],this['logger']);}async['initStoreChannel'](_0x41b9b3){this['store']=await factory_2['StoreServiceFactory']['init'](_0x41b9b3,this['namespace'],this['appId'],this['logger']);}async['initSubChannel'](_0x271045,_0x3dabbe){this['subscribe']=await factory_4['SubServiceFactory']['init'](_0x271045,_0x3dabbe,this['namespace'],this['appId'],this['guid'],this['logger']);}async['initStreamChannel'](_0x157329,_0x45ccfb){this['stream']=await factory_3['StreamServiceFactory']['init'](_0x157329,_0x45ccfb,this['namespace'],this['appId'],this['logger']);}async['initRouter'](_0x1262fb){const _0x12ae2c=await this['store']['getThrottleRate'](':');return new router_1['Router']({'namespace':this['namespace'],'appId':this['appId'],'guid':this['guid'],'role':stream_1['StreamRole']['ENGINE'],'reclaimDelay':_0x1262fb['engine']['reclaimDelay'],'reclaimCount':_0x1262fb['engine']['reclaimCount'],'throttle':_0x12ae2c,'readonly':_0x1262fb['engine']['readonly']},this['stream'],this['logger']);}async['fetchAndVerifyVID'](_0x5dae87,_0x24c78b=0x0){if(isNaN(Number(_0x5dae87['version']))){const _0x471c48=await this['store']['getApp'](_0x5dae87['id'],!![]);if(!isNaN(Number(_0x471c48['version']))){if(!this['apps'])this['apps']={};return this['apps'][_0x5dae87['id']]=_0x471c48,{'id':_0x5dae87['id'],'version':_0x471c48['version']};}else{if(_0x24c78b<0xa)return await(0x0,utils_1['sleepFor'])(enums_1['HMSH_QUORUM_DELAY_MS']*0x2),await this['fetchAndVerifyVID'](_0x5dae87,_0x24c78b+0x1);else this['logger']['error']('engine-vid-resolution-error',{'id':_0x5dae87['id'],'guid':this['guid']});}}return _0x5dae87;}async['getVID'](_0x29a480){if(this['cacheMode']==='nocache'){const _0x11750e=await this['store']['getApp'](this['appId'],!![]);if(_0x11750e['version']['toString']()===this['untilVersion']['toString']()){if(!this['apps'])this['apps']={};this['apps'][this['appId']]=_0x11750e,this['setCacheMode']('cache',_0x11750e['version']['toString']());}return{'id':this['appId'],'version':_0x11750e['version']};}else return!this['apps']&&_0x29a480?(this['apps']={},this['apps'][this['appId']]=_0x29a480,_0x29a480):await this['fetchAndVerifyVID']({'id':this['appId'],'version':this['apps']?.[this['appId']]['version']});}['setCacheMode'](_0xdad5de,_0x48b74c){this['logger']['info']('engine-executable-cache',{'mode':_0xdad5de,[_0xdad5de==='cache'?'target':'until']:_0x48b74c}),this['cacheMode']=_0xdad5de,this['untilVersion']=_0x48b74c;}async['routeToSubscribers'](_0xf51414,_0x4c3f3f){const _0x31b85d=this['jobCallbacks'][_0x4c3f3f['metadata']['jid']];_0x31b85d&&(this['delistJobCallback'](_0x4c3f3f['metadata']['jid']),_0x31b85d(_0xf51414,_0x4c3f3f));}async['processWebHooks'](){this['taskService']['processWebHooks'](this['hook']['bind'](this));}async['processTimeHooks'](){this['taskService']['processTimeHooks'](this['hookTime']['bind'](this));}async['throttle'](_0x33b867){try{this['router']?.['setThrottle'](_0x33b867);}catch(_0x32fa3d){this['logger']['error']('engine-throttle-error',{'error':_0x32fa3d});}}async['initActivity'](_0x1161eb,_0xf405c9={},_0x7b9303){const [_0x7c5036,_0x1a28d7]=await this['getSchema'](_0x1161eb),_0x2983e7=activities_1['default'][utils_1['polyfill']['resolveActivityType'](_0x1a28d7['type'])];if(_0x2983e7){const _0x31cf88=(0x0,utils_1['formatISODate'])(new Date()),_0x62e85f={'aid':_0x7c5036,'atp':_0x1a28d7['type'],'stp':_0x1a28d7['subtype'],'ac':_0x31cf88,'au':_0x31cf88},_0x56bb97=null;return new _0x2983e7(_0x1a28d7,_0xf405c9,_0x62e85f,_0x56bb97,this,_0x7b9303);}else throw new Error('activity\x20type\x20'+_0x1a28d7['type']+'\x20not\x20found');}async['getSchema'](_0x1f1c82){const _0x295d4d=await this['store']['getApp'](this['appId']);if(!_0x295d4d)throw new Error('no\x20app\x20found\x20for\x20id\x20'+this['appId']);if(this['isPrivate'](_0x1f1c82)){const _0x2c8fa8=_0x1f1c82['substring'](0x1),_0x19e1eb=await this['store']['getSchema'](_0x2c8fa8,await this['getVID'](_0x295d4d));return[_0x2c8fa8,_0x19e1eb];}else{const _0x33d8ff=await this['store']['getSubscription'](_0x1f1c82,await this['getVID'](_0x295d4d));if(_0x33d8ff){const _0x3de028=await this['store']['getSchema'](_0x33d8ff,await this['getVID'](_0x295d4d));return[_0x33d8ff,_0x3de028];}}throw new Error('no\x20subscription\x20found\x20for\x20topic\x20'+_0x1f1c82+'\x20in\x20app\x20'+this['appId']+'\x20for\x20app\x20version\x20'+_0x295d4d['version']);}async['getSettings'](){return await this['store']['getSettings']();}['isPrivate'](_0x516a9f){return _0x516a9f['startsWith']('.');}async['plan'](_0x53f98a){const _0x2e0983=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x2e0983['plan'](_0x53f98a);}async['deploy'](_0x2212db){const _0x522f57=new compiler_1['CompilerService'](this['store'],this['stream'],this['logger']);return await _0x522f57['deploy'](_0x2212db);}async['getStats'](_0x5d3821,_0x56003f){const {id:_0x5c2a43,version:_0x608590}=await this['getVID'](),_0x4970c4=new reporter_1['ReporterService']({'id':_0x5c2a43,'version':_0x608590},this['store'],this['logger']),_0x93fa6b=await this['resolveQuery'](_0x5d3821,_0x56003f);return await _0x4970c4['getStats'](_0x93fa6b);}async['getIds'](_0x140181,_0x5670e1,_0x577295=[]){const {id:_0x13384a,version:_0x3a4798}=await this['getVID'](),_0xd27e4c=new reporter_1['ReporterService']({'id':_0x13384a,'version':_0x3a4798},this['store'],this['logger']),_0x1b4fd5=await this['resolveQuery'](_0x140181,_0x5670e1);return await _0xd27e4c['getIds'](_0x1b4fd5,_0x577295);}async['resolveQuery'](_0x32e693,_0x1baa2f){const _0x4f94a4=await this['initActivity'](_0x32e693,_0x1baa2f['data']);return await _0x4f94a4['getState'](),{'end':_0x1baa2f['end'],'start':_0x1baa2f['start'],'range':_0x1baa2f['range'],'granularity':_0x4f94a4['resolveGranularity'](),'key':_0x4f94a4['resolveJobKey'](_0x4f94a4['createInputContext']()),'sparse':_0x1baa2f['sparse']};}async['processStreamMessage'](_0xbb81b6){this['logger']['debug']('engine-process',{'jid':_0xbb81b6['metadata']['jid'],'gid':_0xbb81b6['metadata']['gid'],'dad':_0xbb81b6['metadata']['dad'],'aid':_0xbb81b6['metadata']['aid'],'status':_0xbb81b6['status']||stream_1['StreamStatus']['SUCCESS'],'code':_0xbb81b6['code']||0xc8,'type':_0xbb81b6['type']});const _0x248ec4={'metadata':{'guid':_0xbb81b6['metadata']['guid'],'jid':_0xbb81b6['metadata']['jid'],'gid':_0xbb81b6['metadata']['gid'],'dad':_0xbb81b6['metadata']['dad'],'aid':_0xbb81b6['metadata']['aid']},'data':_0xbb81b6['data']};if(_0xbb81b6['type']===stream_1['StreamDataType']['TIMEHOOK']){const _0x4a3bf9=await this['initActivity']('.'+_0xbb81b6['metadata']['aid'],_0x248ec4['data'],_0x248ec4);await _0x4a3bf9['processTimeHookEvent'](_0xbb81b6['metadata']['jid']);}else{if(_0xbb81b6['type']===stream_1['StreamDataType']['WEBHOOK']){const _0xf3fb9d=await this['initActivity']('.'+_0xbb81b6['metadata']['aid'],_0x248ec4['data'],_0x248ec4);await _0xf3fb9d['processWebHookEvent'](_0xbb81b6['status'],_0xbb81b6['code']);}else{if(_0xbb81b6['type']===stream_1['StreamDataType']['TRANSITION']){const _0xa0503e=await this['initActivity']('.'+_0xbb81b6['metadata']['aid'],_0x248ec4['data'],_0x248ec4);await _0xa0503e['process']();}else{if(_0xbb81b6['type']===stream_1['StreamDataType']['AWAIT']){_0x248ec4['metadata']={..._0x248ec4['metadata'],'pj':_0xbb81b6['metadata']['jid'],'pg':_0xbb81b6['metadata']['gid'],'pd':_0xbb81b6['metadata']['dad'],'pa':_0xbb81b6['metadata']['aid'],'px':_0xbb81b6['metadata']['await']===![],'trc':_0xbb81b6['metadata']['trc'],'spn':_0xbb81b6['metadata']['spn']};const _0x83787d=await this['initActivity'](_0xbb81b6['metadata']['topic'],_0xbb81b6['data'],_0x248ec4);await _0x83787d['process']();}else{if(_0xbb81b6['type']===stream_1['StreamDataType']['RESULT']){const _0x4f63e3=await this['initActivity']('.'+_0x248ec4['metadata']['aid'],_0xbb81b6['data'],_0x248ec4);await _0x4f63e3['processEvent'](_0xbb81b6['status'],_0xbb81b6['code']);}else{const _0x241fff=await this['initActivity']('.'+_0xbb81b6['metadata']['aid'],_0xbb81b6['data'],_0x248ec4);await _0x241fff['processEvent'](_0xbb81b6['status'],_0xbb81b6['code'],'output');}}}}}this['logger']['debug']('engine-process-end',{'jid':_0xbb81b6['metadata']['jid'],'gid':_0xbb81b6['metadata']['gid'],'aid':_0xbb81b6['metadata']['aid']});}async['execAdjacentParent'](_0x4493f7,_0x4b310d,_0x344305=![]){if(this['hasParentJob'](_0x4493f7)){const _0x45b669=this['resolveError'](_0x4b310d['metadata']),_0x2bc1c8=_0x4493f7['$self']?.['output']?.['metadata']?.['l2s']||_0x4493f7['$self']?.['output']?.['metadata']?.['l1s'],_0x3b2daf={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x4493f7['metadata']['pj'],'gid':_0x4493f7['metadata']['pg'],'dad':_0x4493f7['metadata']['pd'],'aid':_0x4493f7['metadata']['pa'],'trc':_0x4493f7['metadata']['trc'],'spn':_0x2bc1c8},'type':stream_1['StreamDataType']['RESULT'],'data':_0x4b310d['data']};if(_0x45b669&&_0x45b669['code'])_0x3b2daf['status']=stream_1['StreamStatus']['ERROR'],_0x3b2daf['data']=_0x45b669,_0x3b2daf['code']=_0x45b669['code'],_0x3b2daf['stack']=_0x45b669['stack'];else _0x344305?(_0x3b2daf['status']=stream_1['StreamStatus']['PENDING'],_0x3b2daf['code']=enums_1['HMSH_CODE_PENDING']):(_0x3b2daf['status']=stream_1['StreamStatus']['SUCCESS'],_0x3b2daf['code']=enums_1['HMSH_CODE_SUCCESS']);return await this['router']?.['publishMessage'](null,_0x3b2daf);}}['hasParentJob'](_0x196fe3,_0x4d716a=![]){if(_0x4d716a)return Boolean(_0x196fe3['metadata']['pj']&&_0x196fe3['metadata']['pa']&&!_0x196fe3['metadata']['px']);return Boolean(_0x196fe3['metadata']['pj']&&_0x196fe3['metadata']['pa']);}['resolveError'](_0x1bf8e7){if(_0x1bf8e7&&_0x1bf8e7['err'])return JSON['parse'](_0x1bf8e7['err']);}async['interrupt'](_0x4b7411,_0x443ea6,_0x2e652d={}){await this['store']['interrupt'](_0x4b7411,_0x443ea6,_0x2e652d);const _0x3ee5f2=await this['getState'](_0x4b7411,_0x443ea6),_0x402b38={'interrupt':_0x2e652d['descend'],'expire':_0x2e652d['expire']};return await this['runJobCompletionTasks'](_0x3ee5f2,_0x402b38);}async['scrub'](_0x59a226){await this['store']['scrub'](_0x59a226);}async['hook'](_0x1194d7,_0x5d985c,_0x5d07c4=stream_1['StreamStatus']['SUCCESS'],_0x49c5bb=0xc8){const _0x5d6710=await this['taskService']['getHookRule'](_0x1194d7),[_0x1eb9a5]=await this['getSchema']('.'+_0x5d6710['to']),_0x2a534c={'type':stream_1['StreamDataType']['WEBHOOK'],'status':_0x5d07c4,'code':_0x49c5bb,'metadata':{'guid':(0x0,utils_1['guid'])(),'aid':_0x1eb9a5,'topic':_0x1194d7},'data':_0x5d985c};return await this['router']?.['publishMessage'](null,_0x2a534c);}async['hookTime'](_0x579831,_0xe6281f,_0x3c502d,_0x28d4bf){if(_0x28d4bf==='interrupt'||_0x28d4bf==='expire')return await this['interrupt'](_0x3c502d,_0x579831,{'suppress':!![],'expire':0x1});const [_0x8dc2e2,..._0x573f93]=_0x3c502d['split'](','),_0x1b8025=','+_0x573f93['join'](','),_0x29dadc={'type':stream_1['StreamDataType']['TIMEHOOK'],'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':_0x579831,'gid':_0xe6281f,'dad':_0x1b8025,'aid':_0x8dc2e2},'data':{'timestamp':Date['now']()}};await this['router']?.['publishMessage'](null,_0x29dadc);}async['hookAll'](_0x4bc38f,_0x3bdafa,_0x119469,_0x82d352=[]){const _0x3c0424=await this['getVID'](),_0x5b72d6=await this['taskService']['getHookRule'](_0x4bc38f);if(_0x5b72d6){const _0x1411e8=await(0x0,utils_1['getSubscriptionTopic'])(_0x5b72d6['to'],this['store'],_0x3c0424),_0xafbc4=await this['resolveQuery'](_0x1411e8,_0x119469),_0x38a7e3=new reporter_1['ReporterService'](_0x3c0424,this['store'],this['logger']),_0x309daa=await _0x38a7e3['getWorkItems'](_0xafbc4,_0x82d352);if(_0x309daa['length']){const _0x17be5a=new task_1['TaskService'](this['store'],this['logger']);await _0x17be5a['enqueueWorkItems'](_0x309daa['map'](_0x4bd132=>[_0x4bc38f,_0x4bd132,_0x119469['scrub']||![],JSON['stringify'](_0x3bdafa)]['join'](key_1['VALSEP']))),this['subscribe']['publish'](key_1['KeyType']['QUORUM'],{'type':'work','originator':this['guid']},this['appId']);}return _0x309daa;}else throw new Error('unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20'+_0x4bc38f);}async['pub'](_0x19b2b1,_0x18bb46,_0x290da3,_0x200f04){const _0xbf9e1c=await this['initActivity'](_0x19b2b1,_0x18bb46,_0x290da3);if(_0xbf9e1c)return await _0xbf9e1c['process'](_0x200f04);else throw new Error('unable\x20to\x20process\x20activity\x20for\x20topic\x20'+_0x19b2b1);}async['sub'](_0x1662a9,_0x1bdcd1){const _0x36c4a9=async(_0x26a3f6,_0x2eb0b4)=>{_0x1bdcd1(_0x2eb0b4['topic'],_0x2eb0b4['job']);};return await this['subscribe']['subscribe'](key_1['KeyType']['QUORUM'],_0x36c4a9,this['appId'],_0x1662a9);}async['unsub'](_0x3cb75d){return await this['subscribe']['unsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x3cb75d);}async['psub'](_0x9a3f20,_0x9232b1){const _0x3a08fe=async(_0x28b49a,_0x21b415)=>{_0x9232b1(_0x21b415['topic'],_0x21b415['job']);};return await this['subscribe']['psubscribe'](key_1['KeyType']['QUORUM'],_0x3a08fe,this['appId'],_0x9a3f20);}async['punsub'](_0x4f6e4d){return await this['subscribe']['punsubscribe'](key_1['KeyType']['QUORUM'],this['appId'],_0x4f6e4d);}async['pubsub'](_0x4de6cd,_0xa0e77d,_0x69309c,_0x4965b6=enums_1['HMSH_OTT_WAIT_TIME']){_0x69309c={'metadata':{'ngn':this['guid'],'trc':_0x69309c?.['metadata']?.['trc'],'spn':_0x69309c?.['metadata']?.['spn']}};const _0x52dde3=await this['pub'](_0x4de6cd,_0xa0e77d,_0x69309c);return new Promise((_0x8b62be,_0x2a614b)=>{this['registerJobCallback'](_0x52dde3,(_0x534b39,_0x41d524)=>{if(_0x41d524['metadata']['err']){const _0x2b29d8=JSON['parse'](_0x41d524['metadata']['err']);_0x2a614b({..._0x2b29d8,'job_id':_0x41d524['metadata']['jid']});}else _0x8b62be(_0x41d524);}),setTimeout(()=>{this['delistJobCallback'](_0x52dde3),_0x2a614b({'code':enums_1['HMSH_CODE_TIMEOUT'],'message':'timeout','job_id':_0x52dde3});},_0x4965b6);});}async['pubOneTimeSubs'](_0x48560d,_0x12424c,_0x995c1a=![]){if(this['hasOneTimeSubscription'](_0x48560d)){const _0x409d9f={'type':'job','topic':_0x48560d['metadata']['jid'],'job':(0x0,utils_1['restoreHierarchy'])(_0x12424c)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x409d9f,this['appId'],_0x48560d['metadata']['ngn']);}}async['getPublishesTopic'](_0x2bbd48){const _0x48ffba=await this['getVID'](),_0x288721=_0x2bbd48['metadata']['aid']||_0x2bbd48['$self']?.['output']?.['metadata']?.['aid'],_0xafaba2=await this['store']['getSchema'](_0x288721,_0x48ffba);return _0xafaba2['publishes'];}async['pubPermSubs'](_0x12499a,_0x4ab8b6,_0x36841b=![]){const _0x8b2162=await this['getPublishesTopic'](_0x12499a);if(_0x8b2162){const _0x5acaee={'type':'job','topic':_0x8b2162,'job':(0x0,utils_1['restoreHierarchy'])(_0x4ab8b6)};this['subscribe']['publish'](key_1['KeyType']['QUORUM'],_0x5acaee,this['appId'],_0x8b2162+'.'+_0x12499a['metadata']['jid']);}}async['add'](_0x2ffde2){return await this['router']?.['publishMessage'](null,_0x2ffde2);}['registerJobCallback'](_0x247570,_0x996be0){this['jobCallbacks'][_0x247570]=_0x996be0;}['delistJobCallback'](_0x27d9ed){delete this['jobCallbacks'][_0x27d9ed];}['hasOneTimeSubscription'](_0x1c724c){return Boolean(_0x1c724c['metadata']['ngn']);}async['runJobCompletionTasks'](_0x1aa0fb,_0x1da541={}){const _0x14a7f7=this['hasParentJob'](_0x1aa0fb,!![]),_0x58aa6b=this['hasOneTimeSubscription'](_0x1aa0fb),_0x46e387=await this['getPublishesTopic'](_0x1aa0fb);let _0x316783;if(_0x14a7f7||_0x58aa6b||_0x46e387){const _0x5ef65f=await this['getState'](_0x1aa0fb['metadata']['tpc'],_0x1aa0fb['metadata']['jid']);_0x316783=await this['execAdjacentParent'](_0x1aa0fb,_0x5ef65f,_0x1da541['emit']),this['pubOneTimeSubs'](_0x1aa0fb,_0x5ef65f,_0x1da541['emit']),this['pubPermSubs'](_0x1aa0fb,_0x5ef65f,_0x1da541['emit']);}return!_0x1da541['emit']&&this['taskService']['registerJobForCleanup'](_0x1aa0fb['metadata']['jid'],this['resolveExpires'](_0x1aa0fb,_0x1da541),_0x1da541),_0x316783;}['resolveExpires'](_0x330a4e,_0x2c9798){return _0x2c9798['expire']??_0x330a4e['metadata']['expire']??enums_1['HMSH_EXPIRE_JOB_SECONDS'];}async['export'](_0x18944c){return await this['exporter']['export'](_0x18944c);}async['getRaw'](_0xeb6b2d){return await this['store']['getRaw'](_0xeb6b2d);}async['getStatus'](_0x5d61b5){const {id:_0x22a606}=await this['getVID']();return await this['store']['getStatus'](_0x5d61b5,_0x22a606);}async['getState'](_0x3171df,_0x534677){const _0x29ee1f=await this['store']['getSymbols']('$'+_0x3171df),_0x58eaf4={['$'+_0x3171df]:Object['keys'](_0x29ee1f)},_0xe1a19={},_0x2f79ba=await this['store']['getState'](_0x534677,_0x58eaf4,_0xe1a19);if(!_0x2f79ba)throw new Error('not\x20found\x20'+_0x534677);const [_0xdcc42d,_0x2d8bf2]=_0x2f79ba,_0x386575=(0x0,utils_1['restoreHierarchy'])(_0xdcc42d);return _0x2d8bf2&&_0x386575['metadata']&&(_0x386575['metadata']['js']=_0x2d8bf2),_0x386575;}async['getQueryState'](_0x208f2a,_0x1dfe56){return await this['store']['getQueryState'](_0x208f2a,_0x1dfe56);}async['compress'](_0x424824){const _0x5a739b=await this['store']['getSymbolValues'](),_0x27b20c=Object['keys'](_0x5a739b)['length'],_0x5c17dc=Math['pow'](0x34,0x2)-0x1,_0x47bcc8=serializer_1['SerializerService']['filterSymVals'](_0x27b20c,_0x5c17dc,_0x5a739b,new Set(_0x424824));return await this['store']['addSymbolValues'](_0x47bcc8);}}exports['EngineService']=EngineService;
@@ -1 +1 @@
1
- 'use strict';(function(_0x3fb6cb,_0x28c2de){const _0x629d3e=_0xb647,_0x23b07b=_0x3fb6cb();while(!![]){try{const _0x2d0a1a=parseInt(_0x629d3e(0xb2))/0x1+-parseInt(_0x629d3e(0xb5))/0x2+-parseInt(_0x629d3e(0xb4))/0x3+-parseInt(_0x629d3e(0xaf))/0x4+-parseInt(_0x629d3e(0xb0))/0x5*(-parseInt(_0x629d3e(0xb6))/0x6)+parseInt(_0x629d3e(0xb7))/0x7*(parseInt(_0x629d3e(0xb3))/0x8)+parseInt(_0x629d3e(0xb1))/0x9;if(_0x2d0a1a===_0x28c2de)break;else _0x23b07b['push'](_0x23b07b['shift']());}catch(_0x10ef8d){_0x23b07b['push'](_0x23b07b['shift']());}}}(_0x5388,0xc4e71));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['ExporterService']=void 0x0;const key_1=require('../../modules/key'),utils_1=require('../../modules/utils'),serializer_1=require('../serializer');function _0x5388(){const _0x219770=['5vTtabx','23207778nQEvij','1588267xYuWWn','1954728JyYsvM','3248952WaNOEw','2505148TLfIEe','1868514SFixni','7InHcZI','6322392gPqIRS'];_0x5388=function(){return _0x219770;};return _0x5388();}function _0xb647(_0x4e0aa7,_0x411e06){const _0x53885f=_0x5388();return _0xb647=function(_0xb6474b,_0x565fcd){_0xb6474b=_0xb6474b-0xaf;let _0x4c475c=_0x53885f[_0xb6474b];return _0x4c475c;},_0xb647(_0x4e0aa7,_0x411e06);}class ExporterService{constructor(_0x5107fe,_0x37092a,_0x1b6e7f){this['appId']=_0x5107fe,this['logger']=_0x1b6e7f,this['store']=_0x37092a;}async['export'](_0x5b6999,_0x16d30e={}){!this['symbols']&&(this['symbols']=this['store']['getAllSymbols'](),this['symbols']=await this['symbols']);const _0x490d1e=[],_0xe5600c=await this['store']['getRaw'](_0x5b6999),_0x33ebbf=this['inflate'](_0xe5600c,_0x490d1e);return _0x33ebbf;}['inflateKey'](_0x28168f){return _0x28168f in this['symbols']?this['symbols'][_0x28168f]:_0x28168f;}['inflate'](_0x2f192f,_0x2cae3d){const _0x2931ff={'hooks':{},'main':{'cursor':-0x1,'items':[]}},_0x567104={},_0x5f0f02=this['inflateDependencyData'](_0x2cae3d,_0x2931ff),_0x388394=/^([a-zA-Z]{3}),(\d+(?:,\d+)*)/;return Object['entries'](_0x2f192f)['forEach'](([_0x2b8b5e,_0x45a366])=>{const _0x4991c3=_0x2b8b5e['match'](_0x388394);if(_0x4991c3){const [_0x4162e0,_0x3e6a8a,_0x336080]=_0x4991c3,_0x4cd5a1=this['inflateKey'](_0x3e6a8a),_0xab76a9=''+_0x336080['replace'](/,/g,'/'),_0x5ce88c=serializer_1['SerializerService']['fromString'](_0x45a366);_0x567104[_0xab76a9+'/'+_0x4cd5a1]=_0x5ce88c;}else _0x2b8b5e['length']===0x3&&(_0x567104[this['inflateKey'](_0x2b8b5e)]=serializer_1['SerializerService']['fromString'](_0x45a366));}),{'dependencies':_0x5f0f02,'process':(0x0,utils_1['restoreHierarchy'])(_0x567104),'status':_0x2f192f[':']};}['inflateDependencyData'](_0x393660,_0xd10ee3){const _0x2910e9=/([0-9,]+)-(\d+)$/,_0x1a69da=/-(\d+)$/;return _0x393660['map']((_0x545c14,_0x48df64)=>{const [_0x5eea85,_0x460426,_0x31046c,_0xc69694,..._0x13d8ec]=_0x545c14['split'](key_1['VALSEP']),_0x401be5=_0x13d8ec['join'](key_1['VALSEP']),_0x166e2d=_0x401be5['match'](_0x2910e9);let _0x48e97b,_0x42893f,_0x418f06='';if(_0x166e2d){const [_0x40c816,_0x1b2ea1,_0x33256c]=_0x166e2d;_0x418f06=_0x1b2ea1['split'](',')['join']('/'),_0x48e97b=_0x418f06+'['+_0x33256c+']',_0x42893f='hook';}else{const _0x10152b=_0x401be5['match'](_0x1a69da);if(_0x10152b){const [_0x24530d,_0x3a90ef]=_0x10152b;_0x48e97b='['+_0x3a90ef+']',_0x42893f='flow';}else _0x48e97b='/',_0x42893f='other';}return{'type':_0x5eea85,'topic':_0x460426,'gid':_0x31046c,'jid':_0x401be5};});}}exports['ExporterService']=ExporterService;
1
+ 'use strict';(function(_0x38868d,_0x5e1604){const _0xe22a78=_0x4c0d,_0x2d4fec=_0x38868d();while(!![]){try{const _0xcbc427=-parseInt(_0xe22a78(0x18d))/0x1*(-parseInt(_0xe22a78(0x190))/0x2)+parseInt(_0xe22a78(0x18b))/0x3+-parseInt(_0xe22a78(0x189))/0x4+-parseInt(_0xe22a78(0x18c))/0x5*(-parseInt(_0xe22a78(0x18a))/0x6)+parseInt(_0xe22a78(0x18f))/0x7+-parseInt(_0xe22a78(0x188))/0x8+-parseInt(_0xe22a78(0x18e))/0x9;if(_0xcbc427===_0x5e1604)break;else _0x2d4fec['push'](_0x2d4fec['shift']());}catch(_0x2681aa){_0x2d4fec['push'](_0x2d4fec['shift']());}}}(_0x3289,0xb939b));function _0x4c0d(_0x1121a0,_0x638d95){const _0x328949=_0x3289();return _0x4c0d=function(_0x4c0d75,_0xe69a65){_0x4c0d75=_0x4c0d75-0x188;let _0x1263ff=_0x328949[_0x4c0d75];return _0x1263ff;},_0x4c0d(_0x1121a0,_0x638d95);}function _0x3289(){const _0x7d8b38=['190764rSuwwE','2088219aJJsZd','95VCmNdp','401NZKCDL','5724882WpGKbj','2810661QlELNS','5640ABqDYc','1831920eFGMaY','4834924jYEDGu'];_0x3289=function(){return _0x7d8b38;};return _0x3289();}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(_0x288c6d,_0x5a2ed1,_0x1ba8d6){this['appId']=_0x288c6d,this['logger']=_0x1ba8d6,this['store']=_0x5a2ed1;}async['export'](_0x19b2ca,_0x3b1a40={}){!this['symbols']&&(this['symbols']=this['store']['getAllSymbols'](),this['symbols']=await this['symbols']);const _0x1b5e6b=[],_0x2f7119=await this['store']['getRaw'](_0x19b2ca),_0x2d72b1=this['inflate'](_0x2f7119,_0x1b5e6b);return _0x2d72b1;}['inflateKey'](_0x40f349){return _0x40f349 in this['symbols']?this['symbols'][_0x40f349]:_0x40f349;}['inflate'](_0x3a64db,_0x45b019){const _0x55de34={'hooks':{},'main':{'cursor':-0x1,'items':[]}},_0x5ce9ba={},_0x4bd94d=this['inflateDependencyData'](_0x45b019,_0x55de34),_0x504da9=/^([a-zA-Z]{3}),(\d+(?:,\d+)*)/;return Object['entries'](_0x3a64db)['forEach'](([_0x50732a,_0x1c9185])=>{const _0x17a5a9=_0x50732a['match'](_0x504da9);if(_0x17a5a9){const [_0x22230e,_0x411be0,_0x10fb2b]=_0x17a5a9,_0x359102=this['inflateKey'](_0x411be0),_0x44b5d0=''+_0x10fb2b['replace'](/,/g,'/'),_0x3ecfae=serializer_1['SerializerService']['fromString'](_0x1c9185);_0x5ce9ba[_0x44b5d0+'/'+_0x359102]=_0x3ecfae;}else _0x50732a['length']===0x3&&(_0x5ce9ba[this['inflateKey'](_0x50732a)]=serializer_1['SerializerService']['fromString'](_0x1c9185));}),{'dependencies':_0x4bd94d,'process':(0x0,utils_1['restoreHierarchy'])(_0x5ce9ba),'status':_0x3a64db[':']};}['inflateDependencyData'](_0x539d17,_0xd7b825){const _0x53ebbb=/([0-9,]+)-(\d+)$/,_0x2573ab=/-(\d+)$/;return _0x539d17['map']((_0x44766a,_0x1ed12d)=>{const [_0x292528,_0x171742,_0x3c7951,_0x4b2719,..._0x350c4a]=_0x44766a['split'](key_1['VALSEP']),_0x50ec6a=_0x350c4a['join'](key_1['VALSEP']),_0x3c3d80=_0x50ec6a['match'](_0x53ebbb);let _0x3f0ca9,_0x553232,_0x1b9258='';if(_0x3c3d80){const [_0x40538a,_0x4ccdfb,_0x3072da]=_0x3c3d80;_0x1b9258=_0x4ccdfb['split'](',')['join']('/'),_0x3f0ca9=_0x1b9258+'['+_0x3072da+']',_0x553232='hook';}else{const _0x8cbbd=_0x50ec6a['match'](_0x2573ab);if(_0x8cbbd){const [_0x5d6d95,_0x1bf8d5]=_0x8cbbd;_0x3f0ca9='['+_0x1bf8d5+']',_0x553232='flow';}else _0x3f0ca9='/',_0x553232='other';}return{'type':_0x292528,'topic':_0x171742,'gid':_0x3c7951,'jid':_0x50ec6a};});}}exports['ExporterService']=ExporterService;
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HotMesh = void 0;
4
4
  const key_1 = require("../../modules/key");
5
5
  const utils_1 = require("../../modules/utils");
6
- const redis_1 = require("../connector/providers/redis");
7
- const ioredis_1 = require("../connector/providers/ioredis");
8
6
  const factory_1 = require("../connector/factory");
9
7
  const engine_1 = require("../engine");
10
8
  const logger_1 = require("../logger");
@@ -12,7 +10,6 @@ const quorum_1 = require("../quorum");
12
10
  const router_1 = require("../router");
13
11
  const worker_1 = require("../worker");
14
12
  const enums_1 = require("../../modules/enums");
15
- const postgres_1 = require("../connector/providers/postgres");
16
13
  class HotMesh {
17
14
  verifyAndSetNamespace(namespace) {
18
15
  if (!namespace) {
@@ -175,9 +172,7 @@ class HotMesh {
175
172
  if (!this.disconnecting) {
176
173
  this.disconnecting = true;
177
174
  await router_1.Router.stopConsuming();
178
- await redis_1.RedisConnection.disconnectAll();
179
- await ioredis_1.RedisConnection.disconnectAll();
180
- await postgres_1.PostgresConnection.disconnectAll();
175
+ await factory_1.ConnectorService.disconnectAll();
181
176
  }
182
177
  }
183
178
  stop() {
@@ -1 +1 @@
1
- 'use strict';(function(_0x5c5b2d,_0x4eaf6e){const _0x5786f6=_0x26a0,_0xa9ac3c=_0x5c5b2d();while(!![]){try{const _0x322dcd=-parseInt(_0x5786f6(0x1de))/0x1+-parseInt(_0x5786f6(0x1e0))/0x2*(parseInt(_0x5786f6(0x1db))/0x3)+-parseInt(_0x5786f6(0x1d8))/0x4+parseInt(_0x5786f6(0x1df))/0x5+parseInt(_0x5786f6(0x1dd))/0x6+parseInt(_0x5786f6(0x1da))/0x7*(parseInt(_0x5786f6(0x1dc))/0x8)+-parseInt(_0x5786f6(0x1d7))/0x9*(-parseInt(_0x5786f6(0x1d9))/0xa);if(_0x322dcd===_0x4eaf6e)break;else _0xa9ac3c['push'](_0xa9ac3c['shift']());}catch(_0x5df43d){_0xa9ac3c['push'](_0xa9ac3c['shift']());}}}(_0x3e83,0x84e21));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['MapperService']=void 0x0;const pipe_1=require('../pipe');function _0x26a0(_0x534a2c,_0x3f9b32){const _0x3e8311=_0x3e83();return _0x26a0=function(_0x26a081,_0x29f837){_0x26a081=_0x26a081-0x1d7;let _0x50f9bb=_0x3e8311[_0x26a081];return _0x50f9bb;},_0x26a0(_0x534a2c,_0x3f9b32);}function _0x3e83(){const _0x1882aa=['30786oGGdJQ','6IFcOtt','424LMpCsl','1782894ciouBP','450336FRPqWv','569415ntjYiK','619404Fsptam','7897842nYKJGG','3140692cGSxSl','20zgllcu'];_0x3e83=function(){return _0x1882aa;};return _0x3e83();}class MapperService{constructor(_0x22ba79,_0x1b3ee4){this['rules']=_0x22ba79,this['data']=_0x1b3ee4;}['mapRules'](){return this['traverseRules'](this['rules']);}['traverseRules'](_0x8c6347){if(typeof _0x8c6347==='object'&&'@pipe'in _0x8c6347)return this['pipe'](_0x8c6347['@pipe']);if(typeof _0x8c6347==='object'&&_0x8c6347!==null){const _0x16146c={};for(const _0x484afc in _0x8c6347){Object['prototype']['hasOwnProperty']['call'](_0x8c6347,_0x484afc)&&(_0x16146c[_0x484afc]=this['traverseRules'](_0x8c6347[_0x484afc]));}return _0x16146c;}else return this['resolve'](_0x8c6347);}['pipe'](_0x5da6c1){const _0x402abc=new pipe_1['Pipe'](_0x5da6c1,this['data']);return _0x402abc['process']();}['resolve'](_0x1ecbd9){const _0x3d6166=new pipe_1['Pipe']([[_0x1ecbd9]],this['data']);return _0x3d6166['process']();}static['evaluate'](_0x534382,_0x107961,_0x4b6b00){if(typeof _0x534382==='boolean')return _0x534382;if(Array['isArray'](_0x534382['code'])&&_0x534382['code']['includes'](_0x4b6b00||0xc8)||_0x4b6b00['toString']()===(_0x534382['code']||0xc8)['toString']()){if(!_0x534382['match'])return!![];const _0x566227=_0x534382['gate']==='or';let _0x30662a=!![],_0x258995=![];return _0x534382['match']['forEach'](({expected:_0x50629c,actual:_0x1c526c})=>{if(_0x566227&&!_0x258995||!_0x566227&&_0x30662a){const _0x32689c=pipe_1['Pipe']['resolve'](_0x1c526c,_0x107961)===_0x50629c;if(_0x566227&&_0x32689c)_0x258995=!![];else!_0x566227&&!_0x32689c&&(_0x30662a=![]);}}),_0x566227?_0x258995:_0x30662a;}return![];}}exports['MapperService']=MapperService;
1
+ 'use strict';(function(_0x1d85e8,_0x420cb1){const _0x42a8db=_0x2ef7,_0x559e2f=_0x1d85e8();while(!![]){try{const _0x45a169=parseInt(_0x42a8db(0xaa))/0x1*(-parseInt(_0x42a8db(0xa9))/0x2)+-parseInt(_0x42a8db(0xa5))/0x3+parseInt(_0x42a8db(0xa8))/0x4+-parseInt(_0x42a8db(0xa7))/0x5*(parseInt(_0x42a8db(0xab))/0x6)+parseInt(_0x42a8db(0xa3))/0x7+-parseInt(_0x42a8db(0xa6))/0x8*(parseInt(_0x42a8db(0xac))/0x9)+parseInt(_0x42a8db(0xa4))/0xa;if(_0x45a169===_0x420cb1)break;else _0x559e2f['push'](_0x559e2f['shift']());}catch(_0x2682e9){_0x559e2f['push'](_0x559e2f['shift']());}}}(_0x57f9,0x49de0));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['MapperService']=void 0x0;function _0x57f9(){const _0x4f585d=['5NNnbXn','1339676hDhxQJ','1306LvXgNz','739bWXXZc','1009842iBIHOZ','12429UVSquO','2031967ODdaMJ','10764150mxZcXY','1130076actZKT','2152BSUJje'];_0x57f9=function(){return _0x4f585d;};return _0x57f9();}function _0x2ef7(_0x41700e,_0x1a063){const _0x57f9c7=_0x57f9();return _0x2ef7=function(_0x2ef77f,_0x60eaef){_0x2ef77f=_0x2ef77f-0xa3;let _0x4b3359=_0x57f9c7[_0x2ef77f];return _0x4b3359;},_0x2ef7(_0x41700e,_0x1a063);}const pipe_1=require('../pipe');class MapperService{constructor(_0x13ffed,_0x56ed7f){this['rules']=_0x13ffed,this['data']=_0x56ed7f;}['mapRules'](){return this['traverseRules'](this['rules']);}['traverseRules'](_0x12fa88){if(typeof _0x12fa88==='object'&&'@pipe'in _0x12fa88)return this['pipe'](_0x12fa88['@pipe']);if(typeof _0x12fa88==='object'&&_0x12fa88!==null){const _0x46e415={};for(const _0x2d1eef in _0x12fa88){Object['prototype']['hasOwnProperty']['call'](_0x12fa88,_0x2d1eef)&&(_0x46e415[_0x2d1eef]=this['traverseRules'](_0x12fa88[_0x2d1eef]));}return _0x46e415;}else return this['resolve'](_0x12fa88);}['pipe'](_0x59b5b7){const _0x4b680b=new pipe_1['Pipe'](_0x59b5b7,this['data']);return _0x4b680b['process']();}['resolve'](_0x2f147c){const _0x2e1a1e=new pipe_1['Pipe']([[_0x2f147c]],this['data']);return _0x2e1a1e['process']();}static['evaluate'](_0x3ffe01,_0x3a1b42,_0x3ca2f2){if(typeof _0x3ffe01==='boolean')return _0x3ffe01;if(Array['isArray'](_0x3ffe01['code'])&&_0x3ffe01['code']['includes'](_0x3ca2f2||0xc8)||_0x3ca2f2['toString']()===(_0x3ffe01['code']||0xc8)['toString']()){if(!_0x3ffe01['match'])return!![];const _0x144249=_0x3ffe01['gate']==='or';let _0x53187b=!![],_0x53f243=![];return _0x3ffe01['match']['forEach'](({expected:_0x5bfc1d,actual:_0x11d861})=>{if(_0x144249&&!_0x53f243||!_0x144249&&_0x53187b){const _0x4844be=pipe_1['Pipe']['resolve'](_0x11d861,_0x3a1b42)===_0x5bfc1d;if(_0x144249&&_0x4844be)_0x53f243=!![];else!_0x144249&&!_0x4844be&&(_0x53187b=![]);}}),_0x144249?_0x53f243:_0x53187b;}return![];}}exports['MapperService']=MapperService;
@@ -92,16 +92,15 @@ class MeshCall {
92
92
  const optionsHash = MeshCall.hashOptions(utils_1.polyfill.providerConfig(params));
93
93
  const targetTopic = `${optionsHash}.${targetNamespace}.${params.topic}`;
94
94
  const connection = utils_1.polyfill.providerConfig(params);
95
- const conType = 'options' in connection ? 'connection' : 'connections';
96
95
  const hotMeshWorker = await hotmesh_1.HotMesh.init({
97
96
  guid: params.guid,
98
97
  logLevel: params.logLevel ?? enums_1.HMSH_LOGLEVEL,
99
98
  appId: params.namespace ?? key_1.HMNS,
100
- engine: { [conType]: connection },
99
+ engine: { connection },
101
100
  workers: [
102
101
  {
103
102
  topic: params.topic,
104
- [conType]: connection,
103
+ connection,
105
104
  callback: async function (input) {
106
105
  const response = await params.callback.apply(this, input.data.args);
107
106
  return {
@@ -237,13 +236,12 @@ MeshCall.getHotMeshClient = async (namespace, connection, options = {}) => {
237
236
  await _a.verifyWorkflowActive(hotMeshClient, targetNS);
238
237
  return hotMeshClient;
239
238
  }
240
- const conType = 'options' in connection ? 'connection' : 'connections';
241
239
  const hotMeshClient = hotmesh_1.HotMesh.init({
242
240
  guid: options.guid,
243
241
  appId: targetNS,
244
242
  logLevel: enums_1.HMSH_LOGLEVEL,
245
243
  engine: {
246
- [conType]: connection,
244
+ connection,
247
245
  readonly: options.readonly,
248
246
  },
249
247
  });
@@ -9,10 +9,9 @@ import { ProviderConfig } from '../../types';
9
9
  import { ProviderClass, ProvidersConfig } from '../../types/provider';
10
10
  declare class MeshData {
11
11
  connectionSignatures: StringStringType;
12
- connection: Partial<ProviderConfig>;
12
+ connection: ProviderConfig | ProvidersConfig;
13
13
  instances: Map<string, Promise<HotMesh> | HotMesh>;
14
14
  search: WorkflowSearchOptions;
15
- connections: ProvidersConfig;
16
15
  static workflow: {
17
16
  sleep: typeof import("../meshflow/workflow").WorkflowService.sleepFor;
18
17
  sleepFor: typeof import("../meshflow/workflow").WorkflowService.sleepFor;
@@ -29,9 +28,9 @@ declare class MeshData {
29
28
  executeChild: <T_1>(options?: Partial<WorkflowOptions>) => Promise<T_1>;
30
29
  startChild: (options?: Partial<WorkflowOptions>) => Promise<string>;
31
30
  };
32
- constructor(providerClass: ProviderClass, providerOptions: StringAnyType, search?: WorkflowSearchOptions, connections?: ProvidersConfig);
31
+ constructor(providerClass: ProviderClass | ProviderConfig | ProvidersConfig, search?: WorkflowSearchOptions);
33
32
  validate(entity: string): void;
34
- getConnection(): Promise<import("../../types/meshflow").Connection>;
33
+ getConnection(): Promise<ProviderConfig | ProvidersConfig>;
35
34
  getClient(): import("../meshflow/client").ClientService;
36
35
  safeKey(key: string): string;
37
36
  arrayToHash(input: [number, ...Array<string | string[]>]): StringStringType[];
@@ -8,9 +8,8 @@ const hotmesh_1 = require("../hotmesh");
8
8
  const hotmesh_2 = require("../../types/hotmesh");
9
9
  const enums_1 = require("../../modules/enums");
10
10
  class MeshData {
11
- constructor(providerClass, providerOptions, search, connections) {
11
+ constructor(providerClass, search) {
12
12
  this.connectionSignatures = {};
13
- this.connection = {};
14
13
  this.instances = new Map();
15
14
  this.mesh = {
16
15
  sub: async (callback, options = {}) => {
@@ -46,9 +45,7 @@ class MeshData {
46
45
  await hotMesh.quorum?.unsub(callback);
47
46
  },
48
47
  };
49
- this.connections = connections;
50
- this.connection.class = providerClass;
51
- this.connection.options = providerOptions;
48
+ this.connection = providerClass;
52
49
  if (search) {
53
50
  this.search = search;
54
51
  }
@@ -59,8 +56,7 @@ class MeshData {
59
56
  }
60
57
  }
61
58
  async getConnection() {
62
- return (this.connections ??
63
- await meshflow_1.MeshFlow.Connection.connect(utils_1.polyfill.meshDataConfig(this)));
59
+ return this.connection;
64
60
  }
65
61
  getClient() {
66
62
  return new meshflow_1.MeshFlow.Client({
@@ -132,11 +128,10 @@ class MeshData {
132
128
  async getHotMesh(namespace = 'meshflow') {
133
129
  let hotMesh = await this.instances.get(namespace);
134
130
  if (!hotMesh) {
135
- const connectionType = this.connections ? 'connections' : 'connection';
136
131
  hotMesh = hotmesh_1.HotMesh.init({
137
132
  appId: namespace,
138
133
  engine: {
139
- [connectionType]: utils_1.polyfill.meshDataConfig(this),
134
+ connection: utils_1.polyfill.meshDataConfig(this),
140
135
  },
141
136
  });
142
137
  this.instances.set(namespace, hotMesh);
@@ -21,12 +21,11 @@ class ClientService {
21
21
  await this.verifyWorkflowActive(hotMeshClient, targetNS);
22
22
  return hotMeshClient;
23
23
  }
24
- const connectionType = 'options' in this.connection ? 'connection' : 'connections';
25
24
  const hotMeshClient = hotmesh_1.HotMesh.init({
26
25
  appId: targetNS,
27
26
  logLevel: enums_1.HMSH_LOGLEVEL,
28
27
  engine: {
29
- [connectionType]: this.connection,
28
+ connection: this.connection,
30
29
  },
31
30
  });
32
31
  ClientService.instances.set(connectionNS, hotMeshClient);
@@ -9,6 +9,7 @@ class ConnectionService {
9
9
  : {
10
10
  class: config.class,
11
11
  options: { ...config.options },
12
+ provider: config.provider,
12
13
  };
13
14
  }
14
15
  }