@hotmeshio/hotmesh 0.3.29 → 0.3.31

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 (193) hide show
  1. package/build/index.d.ts +8 -2
  2. package/build/index.js +13 -7
  3. package/build/modules/enums.d.ts +65 -1
  4. package/build/modules/enums.js +79 -5
  5. package/build/modules/key.d.ts +52 -0
  6. package/build/modules/key.js +1 -1
  7. package/build/modules/utils.d.ts +73 -0
  8. package/build/modules/utils.js +1 -1
  9. package/build/package.json +6 -4
  10. package/build/services/activities/activity.d.ts +36 -0
  11. package/build/services/activities/activity.js +1 -1
  12. package/build/services/activities/await.js +1 -1
  13. package/build/services/activities/cycle.d.ts +7 -0
  14. package/build/services/activities/cycle.js +1 -1
  15. package/build/services/activities/hook.d.ts +6 -0
  16. package/build/services/activities/hook.js +1 -1
  17. package/build/services/activities/index.js +1 -1
  18. package/build/services/activities/interrupt.js +1 -1
  19. package/build/services/activities/signal.d.ts +6 -0
  20. package/build/services/activities/signal.js +1 -1
  21. package/build/services/activities/trigger.d.ts +7 -0
  22. package/build/services/activities/trigger.js +1 -1
  23. package/build/services/activities/worker.js +1 -1
  24. package/build/services/collator/index.d.ts +76 -0
  25. package/build/services/collator/index.js +1 -1
  26. package/build/services/compiler/deployer.js +1 -1
  27. package/build/services/compiler/index.d.ts +15 -0
  28. package/build/services/compiler/index.js +1 -1
  29. package/build/services/compiler/validator.d.ts +3 -0
  30. package/build/services/compiler/validator.js +1 -1
  31. package/build/services/connector/factory.d.ts +14 -0
  32. package/build/services/connector/factory.js +22 -2
  33. package/build/services/connector/index.d.ts +13 -1
  34. package/build/services/connector/index.js +13 -1
  35. package/build/services/connector/providers/postgres.js +7 -0
  36. package/build/services/engine/index.d.ts +162 -0
  37. package/build/services/engine/index.js +1 -1
  38. package/build/services/exporter/index.d.ts +27 -0
  39. package/build/services/exporter/index.js +1 -1
  40. package/build/services/hotmesh/index.d.ts +280 -0
  41. package/build/services/hotmesh/index.js +286 -0
  42. package/build/services/logger/index.js +1 -0
  43. package/build/services/mapper/index.d.ts +14 -0
  44. package/build/services/mapper/index.js +1 -1
  45. package/build/services/meshcall/index.d.ts +171 -0
  46. package/build/services/meshcall/index.js +190 -0
  47. package/build/services/meshcall/schemas/factory.d.ts +7 -0
  48. package/build/services/meshcall/schemas/factory.js +7 -0
  49. package/build/services/meshdata/index.d.ts +725 -3
  50. package/build/services/meshdata/index.js +689 -3
  51. package/build/services/meshflow/client.d.ts +89 -0
  52. package/build/services/meshflow/client.js +173 -4
  53. package/build/services/meshflow/connection.d.ts +17 -0
  54. package/build/services/meshflow/connection.js +17 -0
  55. package/build/services/meshflow/exporter.d.ts +22 -0
  56. package/build/services/meshflow/exporter.js +1 -1
  57. package/build/services/meshflow/handle.d.ts +68 -0
  58. package/build/services/meshflow/handle.js +75 -0
  59. package/build/services/meshflow/index.d.ts +92 -0
  60. package/build/services/meshflow/index.js +92 -0
  61. package/build/services/meshflow/schemas/factory.d.ts +25 -0
  62. package/build/services/meshflow/schemas/factory.js +26 -1
  63. package/build/services/meshflow/search.d.ts +120 -0
  64. package/build/services/meshflow/search.js +108 -0
  65. package/build/services/meshflow/worker.d.ts +97 -0
  66. package/build/services/meshflow/worker.js +116 -2
  67. package/build/services/meshflow/workflow/all.d.ts +6 -0
  68. package/build/services/meshflow/workflow/all.js +7 -0
  69. package/build/services/meshflow/workflow/context.d.ts +4 -0
  70. package/build/services/meshflow/workflow/context.js +4 -0
  71. package/build/services/meshflow/workflow/didRun.d.ts +6 -0
  72. package/build/services/meshflow/workflow/didRun.js +6 -0
  73. package/build/services/meshflow/workflow/emit.d.ts +7 -0
  74. package/build/services/meshflow/workflow/emit.js +7 -0
  75. package/build/services/meshflow/workflow/enrich.d.ts +7 -0
  76. package/build/services/meshflow/workflow/enrich.js +7 -0
  77. package/build/services/meshflow/workflow/execChild.d.ts +14 -0
  78. package/build/services/meshflow/workflow/execChild.js +18 -0
  79. package/build/services/meshflow/workflow/hook.d.ts +7 -0
  80. package/build/services/meshflow/workflow/hook.js +7 -0
  81. package/build/services/meshflow/workflow/index.d.ts +31 -0
  82. package/build/services/meshflow/workflow/index.js +31 -0
  83. package/build/services/meshflow/workflow/interrupt.d.ts +7 -0
  84. package/build/services/meshflow/workflow/interrupt.js +7 -0
  85. package/build/services/meshflow/workflow/isSideEffectAllowed.d.ts +8 -0
  86. package/build/services/meshflow/workflow/isSideEffectAllowed.js +8 -0
  87. package/build/services/meshflow/workflow/proxyActivities.d.ts +14 -0
  88. package/build/services/meshflow/workflow/proxyActivities.js +18 -3
  89. package/build/services/meshflow/workflow/random.d.ts +5 -0
  90. package/build/services/meshflow/workflow/random.js +5 -0
  91. package/build/services/meshflow/workflow/searchMethods.d.ts +4 -0
  92. package/build/services/meshflow/workflow/searchMethods.js +4 -0
  93. package/build/services/meshflow/workflow/signal.d.ts +6 -0
  94. package/build/services/meshflow/workflow/signal.js +6 -0
  95. package/build/services/meshflow/workflow/sleepFor.d.ts +7 -0
  96. package/build/services/meshflow/workflow/sleepFor.js +7 -0
  97. package/build/services/meshflow/workflow/trace.d.ts +10 -0
  98. package/build/services/meshflow/workflow/trace.js +10 -0
  99. package/build/services/meshflow/workflow/waitFor.d.ts +7 -0
  100. package/build/services/meshflow/workflow/waitFor.js +7 -0
  101. package/build/services/meshos/index.d.ts +213 -2
  102. package/build/services/meshos/index.js +221 -1
  103. package/build/services/pipe/functions/array.js +1 -1
  104. package/build/services/pipe/functions/bitwise.js +1 -1
  105. package/build/services/pipe/functions/conditional.js +1 -1
  106. package/build/services/pipe/functions/cron.d.ts +6 -0
  107. package/build/services/pipe/functions/cron.js +1 -1
  108. package/build/services/pipe/functions/date.d.ts +7 -0
  109. package/build/services/pipe/functions/date.js +1 -1
  110. package/build/services/pipe/functions/index.js +1 -1
  111. package/build/services/pipe/functions/json.js +1 -1
  112. package/build/services/pipe/functions/logical.js +1 -1
  113. package/build/services/pipe/functions/math.js +1 -1
  114. package/build/services/pipe/functions/number.js +1 -1
  115. package/build/services/pipe/functions/object.js +1 -1
  116. package/build/services/pipe/functions/string.js +1 -1
  117. package/build/services/pipe/functions/symbol.js +1 -1
  118. package/build/services/pipe/functions/unary.js +1 -1
  119. package/build/services/pipe/index.d.ts +15 -0
  120. package/build/services/pipe/index.js +1 -1
  121. package/build/services/quorum/index.d.ts +49 -0
  122. package/build/services/quorum/index.js +1 -1
  123. package/build/services/reporter/index.d.ts +5 -0
  124. package/build/services/reporter/index.js +1 -1
  125. package/build/services/router/index.d.ts +10 -0
  126. package/build/services/router/index.js +1 -1
  127. package/build/services/search/providers/postgres/postgres.d.ts +3 -0
  128. package/build/services/search/providers/postgres/postgres.js +1 -1
  129. package/build/services/search/providers/redis/ioredis.js +1 -1
  130. package/build/services/search/providers/redis/redis.js +1 -1
  131. package/build/services/serializer/index.js +1 -1
  132. package/build/services/store/cache.d.ts +19 -0
  133. package/build/services/store/cache.js +19 -0
  134. package/build/services/store/factory.js +1 -1
  135. package/build/services/store/providers/postgres/kvsql.d.ts +7 -0
  136. package/build/services/store/providers/postgres/kvsql.js +1 -1
  137. package/build/services/store/providers/postgres/kvtables.d.ts +4 -0
  138. package/build/services/store/providers/postgres/kvtables.js +1 -1
  139. package/build/services/store/providers/postgres/kvtransaction.js +1 -1
  140. package/build/services/store/providers/postgres/kvtypes/hash.d.ts +4 -0
  141. package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
  142. package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
  143. package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
  144. package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
  145. package/build/services/store/providers/postgres/postgres.d.ts +48 -1
  146. package/build/services/store/providers/postgres/postgres.js +1 -1
  147. package/build/services/store/providers/redis/_base.d.ts +42 -0
  148. package/build/services/store/providers/redis/_base.js +1 -1
  149. package/build/services/store/providers/redis/ioredis.d.ts +8 -0
  150. package/build/services/store/providers/redis/ioredis.js +1 -1
  151. package/build/services/store/providers/redis/redis.d.ts +6 -0
  152. package/build/services/store/providers/redis/redis.js +1 -1
  153. package/build/services/store/providers/store-initializable.js +1 -1
  154. package/build/services/stream/factory.js +2 -1
  155. package/build/services/stream/index.d.ts +4 -0
  156. package/build/services/stream/providers/nats/nats.js +1 -1
  157. package/build/services/stream/providers/postgres/kvtables.js +1 -1
  158. package/build/services/stream/providers/postgres/postgres.d.ts +21 -0
  159. package/build/services/stream/providers/postgres/postgres.js +1 -1
  160. package/build/services/stream/providers/redis/ioredis.js +1 -1
  161. package/build/services/stream/providers/redis/redis.js +1 -1
  162. package/build/services/stream/providers/stream-initializable.js +1 -1
  163. package/build/services/sub/providers/nats/nats.js +1 -1
  164. package/build/services/sub/providers/postgres/postgres.js +1 -1
  165. package/build/services/sub/providers/redis/ioredis.js +1 -1
  166. package/build/services/sub/providers/redis/redis.js +1 -1
  167. package/build/services/task/index.d.ts +9 -0
  168. package/build/services/task/index.js +1 -1
  169. package/build/services/telemetry/index.d.ts +7 -0
  170. package/build/services/telemetry/index.js +1 -1
  171. package/build/services/worker/index.d.ts +37 -0
  172. package/build/services/worker/index.js +1 -1
  173. package/build/types/activity.d.ts +81 -0
  174. package/build/types/exporter.d.ts +13 -0
  175. package/build/types/hotmesh.d.ts +144 -0
  176. package/build/types/hotmesh.js +3 -0
  177. package/build/types/job.d.ts +101 -0
  178. package/build/types/manifest.d.ts +8 -0
  179. package/build/types/meshcall.d.ts +148 -0
  180. package/build/types/meshdata.d.ts +193 -0
  181. package/build/types/meshflow.d.ts +297 -0
  182. package/build/types/nats.d.ts +55 -0
  183. package/build/types/pipe.d.ts +65 -0
  184. package/build/types/provider.d.ts +43 -0
  185. package/build/types/quorum.d.ts +12 -0
  186. package/build/types/redis.d.ts +6 -0
  187. package/build/types/stream.d.ts +65 -0
  188. package/build/types/stream.js +4 -0
  189. package/index.ts +8 -1
  190. package/package.json +6 -4
  191. package/types/manifest.ts +2 -2
  192. package/types/meshcall.ts +1 -2
  193. package/types/meshdata.ts +1 -1
package/build/index.d.ts CHANGED
@@ -2,7 +2,13 @@ import { HotMesh } from './services/hotmesh';
2
2
  import { HotMeshConfig } from './types/hotmesh';
3
3
  import { MeshCall } from './services/meshcall';
4
4
  import { MeshFlow } from './services/meshflow';
5
+ import { ClientService as Client } from './services/meshflow/client';
6
+ import { ConnectionService as Connection } from './services/meshflow/connection';
7
+ import { Search } from './services/meshflow/search';
8
+ import { WorkerService as Worker } from './services/meshflow/worker';
9
+ import { WorkflowService as workflow } from './services/meshflow/workflow';
5
10
  import { WorkflowHandleService as WorkflowHandle } from './services/meshflow/handle';
11
+ import { proxyActivities } from './services/meshflow/workflow/proxyActivities';
6
12
  import { MeshData } from './services/meshdata';
7
13
  import { MeshOS } from './services/meshos';
8
14
  import * as Errors from './modules/errors';
@@ -14,6 +20,6 @@ import { PostgresConnection as ConnectorPostgres } from './services/connector/pr
14
20
  import { RedisConnection as ConnectorIORedis } from './services/connector/providers/ioredis';
15
21
  import { RedisConnection as ConnectorRedis } from './services/connector/providers/redis';
16
22
  import { NatsConnection as ConnectorNATS } from './services/connector/providers/nats';
17
- declare const Client: typeof import("./services/meshflow/client").ClientService, Connection: typeof import("./services/meshflow/connection").ConnectionService, Search: typeof import("./services/meshflow/search").Search, Worker: typeof import("./services/meshflow/worker").WorkerService, workflow: typeof import("./services/meshflow/workflow").WorkflowService;
18
- export { Connector, ConnectorIORedis, ConnectorNATS, ConnectorPostgres, ConnectorRedis, HotMesh, HotMeshConfig, MeshCall, MeshData, MeshFlow, MeshOS, Client, Connection, Search, Worker, workflow, WorkflowHandle, Enums, Errors, Utils, KeyStore, };
23
+ export { Connector, //factory
24
+ ConnectorIORedis, ConnectorNATS, ConnectorPostgres, ConnectorRedis, HotMesh, HotMeshConfig, MeshCall, MeshData, MeshFlow, MeshOS, Client, Connection, proxyActivities, Search, Worker, workflow, WorkflowHandle, Enums, Errors, Utils, KeyStore, };
19
25
  export * as Types from './types';
package/build/index.js CHANGED
@@ -23,15 +23,27 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Types = exports.KeyStore = exports.Utils = exports.Errors = exports.Enums = exports.WorkflowHandle = exports.workflow = exports.Worker = exports.Search = exports.Connection = exports.Client = exports.MeshOS = exports.MeshFlow = exports.MeshData = exports.MeshCall = exports.HotMesh = exports.ConnectorRedis = exports.ConnectorPostgres = exports.ConnectorNATS = exports.ConnectorIORedis = exports.Connector = void 0;
26
+ exports.Types = exports.KeyStore = exports.Utils = exports.Errors = exports.Enums = exports.WorkflowHandle = exports.workflow = exports.Worker = exports.Search = exports.proxyActivities = exports.Connection = exports.Client = exports.MeshOS = exports.MeshFlow = exports.MeshData = exports.MeshCall = exports.HotMesh = exports.ConnectorRedis = exports.ConnectorPostgres = exports.ConnectorNATS = exports.ConnectorIORedis = exports.Connector = void 0;
27
27
  const hotmesh_1 = require("./services/hotmesh");
28
28
  Object.defineProperty(exports, "HotMesh", { enumerable: true, get: function () { return hotmesh_1.HotMesh; } });
29
29
  const meshcall_1 = require("./services/meshcall");
30
30
  Object.defineProperty(exports, "MeshCall", { enumerable: true, get: function () { return meshcall_1.MeshCall; } });
31
31
  const meshflow_1 = require("./services/meshflow");
32
32
  Object.defineProperty(exports, "MeshFlow", { enumerable: true, get: function () { return meshflow_1.MeshFlow; } });
33
+ const client_1 = require("./services/meshflow/client");
34
+ Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return client_1.ClientService; } });
35
+ const connection_1 = require("./services/meshflow/connection");
36
+ Object.defineProperty(exports, "Connection", { enumerable: true, get: function () { return connection_1.ConnectionService; } });
37
+ const search_1 = require("./services/meshflow/search");
38
+ Object.defineProperty(exports, "Search", { enumerable: true, get: function () { return search_1.Search; } });
39
+ const worker_1 = require("./services/meshflow/worker");
40
+ Object.defineProperty(exports, "Worker", { enumerable: true, get: function () { return worker_1.WorkerService; } });
41
+ const workflow_1 = require("./services/meshflow/workflow");
42
+ Object.defineProperty(exports, "workflow", { enumerable: true, get: function () { return workflow_1.WorkflowService; } });
33
43
  const handle_1 = require("./services/meshflow/handle");
34
44
  Object.defineProperty(exports, "WorkflowHandle", { enumerable: true, get: function () { return handle_1.WorkflowHandleService; } });
45
+ const proxyActivities_1 = require("./services/meshflow/workflow/proxyActivities");
46
+ Object.defineProperty(exports, "proxyActivities", { enumerable: true, get: function () { return proxyActivities_1.proxyActivities; } });
35
47
  const meshdata_1 = require("./services/meshdata");
36
48
  Object.defineProperty(exports, "MeshData", { enumerable: true, get: function () { return meshdata_1.MeshData; } });
37
49
  const meshos_1 = require("./services/meshos");
@@ -54,10 +66,4 @@ const redis_1 = require("./services/connector/providers/redis");
54
66
  Object.defineProperty(exports, "ConnectorRedis", { enumerable: true, get: function () { return redis_1.RedisConnection; } });
55
67
  const nats_1 = require("./services/connector/providers/nats");
56
68
  Object.defineProperty(exports, "ConnectorNATS", { enumerable: true, get: function () { return nats_1.NatsConnection; } });
57
- const { Client, Connection, Search, Worker, workflow } = meshflow_1.MeshFlow;
58
- exports.Client = Client;
59
- exports.Connection = Connection;
60
- exports.Search = Search;
61
- exports.Worker = Worker;
62
- exports.workflow = workflow;
63
69
  exports.Types = __importStar(require("./types"));
@@ -1,7 +1,20 @@
1
1
  import { LogLevel } from '../types/logger';
2
+ /**
3
+ * Determines the log level for the application. The default is 'info'.
4
+ */
2
5
  export declare const HMSH_LOGLEVEL: LogLevel;
3
- export declare const HMSH_TELEMETRY: "info" | "debug";
6
+ /**
7
+ * Determines the log level for telemetry. The default is 'info' which emits worker and trigger spans. 'debug' emits all spans.
8
+ */
9
+ export declare const HMSH_TELEMETRY: "debug" | "info";
10
+ /**
11
+ * If Redis, explicitly sets whether the application is running in a cluster. The default is false.
12
+ * @deprecated
13
+ */
4
14
  export declare const HMSH_IS_CLUSTER: boolean;
15
+ /**
16
+ * Default cleanup time for signal in the db when its associated job is completed.
17
+ */
5
18
  export declare const HMSH_SIGNAL_EXPIRE = 3600;
6
19
  export declare const HMSH_CODE_SUCCESS = 200;
7
20
  export declare const HMSH_CODE_PENDING = 202;
@@ -10,29 +23,80 @@ export declare const HMSH_CODE_INTERRUPT = 410;
10
23
  export declare const HMSH_CODE_UNKNOWN = 500;
11
24
  export declare const HMSH_CODE_TIMEOUT = 504;
12
25
  export declare const HMSH_CODE_UNACKED = 999;
26
+ /**
27
+ * This is thrown when a Meshflow has been interrupted by a sleepFor call.
28
+ */
13
29
  export declare const HMSH_CODE_MESHFLOW_SLEEP = 588;
30
+ /**
31
+ * This is thrown when a Meshflow has been interrupted by a Promise.all call.
32
+ */
14
33
  export declare const HMSH_CODE_MESHFLOW_ALL = 589;
34
+ /**
35
+ * This is thrown when a Meshflow has been interrupted by an execChild or startChild call.
36
+ */
15
37
  export declare const HMSH_CODE_MESHFLOW_CHILD = 590;
38
+ /**
39
+ * This is thrown when a Meshflow has been interrupted by a proxyActivity call.
40
+ */
16
41
  export declare const HMSH_CODE_MESHFLOW_PROXY = 591;
42
+ /**
43
+ * This is thrown when a Meshflow has been interrupted by a waitForSignal call.
44
+ */
17
45
  export declare const HMSH_CODE_MESHFLOW_WAIT = 595;
46
+ /**
47
+ * The timeout status code for Meshflow. This status code is thrown when Meshflow has encountered a timeout error and needs to aler the caller why the call failed.
48
+ */
18
49
  export declare const HMSH_CODE_MESHFLOW_TIMEOUT = 596;
50
+ /**
51
+ * The maxed status code for Meshflow. This status code is used to indicate that the Meshflow has reached the maximum
52
+ * number of attempts and should be halted. Thrown from a proxied activity or a flow to halt standard execution
53
+ * and prevent further attempts.
54
+ */
19
55
  export declare const HMSH_CODE_MESHFLOW_MAXED = 597;
56
+ /**
57
+ * The fatal status code for Meshflow. This status code is used to indicate that the Meshflow has encountered a fatal error. Throw from a proxied activity or a flow to halt standard execution.
58
+ */
20
59
  export declare const HMSH_CODE_MESHFLOW_FATAL = 598;
60
+ /**
61
+ * The retryable status code for Meshflow. This status code is used to indicate that the Meshflow has encountered a retryable error (essentially unknown and covered by the standard retry policy).
62
+ */
21
63
  export declare const HMSH_CODE_MESHFLOW_RETRYABLE = 599;
22
64
  export declare const HMSH_STATUS_UNKNOWN = "unknown";
65
+ /**
66
+ * The number of cycles to re/try for a quorum to be established.
67
+ */
23
68
  export declare const HMSH_QUORUM_ROLLCALL_CYCLES = 12;
69
+ /**
70
+ * The delay in milliseconds between quorum rollcall cycles.
71
+ */
24
72
  export declare const HMSH_QUORUM_DELAY_MS = 250;
73
+ /**
74
+ * The number of times the call-response exchange must succeed in succession to establish a quorum.
75
+ */
25
76
  export declare const HMSH_ACTIVATION_MAX_RETRY = 3;
26
77
  export declare const HMSH_DEPLOYMENT_DELAY: number;
27
78
  export declare const HMSH_DEPLOYMENT_PAUSE: number;
28
79
  export declare const HMSH_OTT_WAIT_TIME: number;
29
80
  export declare const HMSH_EXPIRE_JOB_SECONDS: number;
81
+ export declare const MAX_STREAM_BACKOFF: number;
30
82
  export declare const MAX_DELAY = 2147483647;
31
83
  export declare const HMSH_MAX_RETRIES: number;
32
84
  export declare const HMSH_MAX_TIMEOUT_MS: number;
33
85
  export declare const HMSH_GRADUATED_INTERVAL_MS: number;
86
+ /**
87
+ * The maximum number of attempts to retry a MeshFlow job before it is considered failed.
88
+ * @default 3
89
+ */
34
90
  export declare const HMSH_MESHFLOW_MAX_ATTEMPTS = 3;
91
+ /**
92
+ * The maximum interval to wait before retrying a MeshFlow job.
93
+ * @default 120s
94
+ */
35
95
  export declare const HMSH_MESHFLOW_MAX_INTERVAL = "120s";
96
+ /**
97
+ * The exponential backoff factor to apply to the interval between retries.
98
+ * @default 10
99
+ */
36
100
  export declare const HMSH_MESHFLOW_EXP_BACKOFF = 10;
37
101
  export declare const HMSH_BLOCK_TIME_MS: number;
38
102
  export declare const HMSH_XCLAIM_DELAY_MS: number;
@@ -1,10 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HMSH_GUID_SIZE = exports.HMSH_SCOUT_INTERVAL_SECONDS = exports.HMSH_FIDELITY_SECONDS = exports.HMSH_EXPIRE_DURATION = exports.HMSH_XPENDING_COUNT = exports.HMSH_XCLAIM_COUNT = exports.HMSH_XCLAIM_DELAY_MS = exports.HMSH_BLOCK_TIME_MS = exports.HMSH_MESHFLOW_EXP_BACKOFF = exports.HMSH_MESHFLOW_MAX_INTERVAL = exports.HMSH_MESHFLOW_MAX_ATTEMPTS = exports.HMSH_GRADUATED_INTERVAL_MS = exports.HMSH_MAX_TIMEOUT_MS = exports.HMSH_MAX_RETRIES = exports.MAX_DELAY = exports.HMSH_EXPIRE_JOB_SECONDS = exports.HMSH_OTT_WAIT_TIME = exports.HMSH_DEPLOYMENT_PAUSE = exports.HMSH_DEPLOYMENT_DELAY = exports.HMSH_ACTIVATION_MAX_RETRY = exports.HMSH_QUORUM_DELAY_MS = exports.HMSH_QUORUM_ROLLCALL_CYCLES = exports.HMSH_STATUS_UNKNOWN = exports.HMSH_CODE_MESHFLOW_RETRYABLE = exports.HMSH_CODE_MESHFLOW_FATAL = exports.HMSH_CODE_MESHFLOW_MAXED = exports.HMSH_CODE_MESHFLOW_TIMEOUT = exports.HMSH_CODE_MESHFLOW_WAIT = exports.HMSH_CODE_MESHFLOW_PROXY = exports.HMSH_CODE_MESHFLOW_CHILD = exports.HMSH_CODE_MESHFLOW_ALL = exports.HMSH_CODE_MESHFLOW_SLEEP = exports.HMSH_CODE_UNACKED = exports.HMSH_CODE_TIMEOUT = exports.HMSH_CODE_UNKNOWN = exports.HMSH_CODE_INTERRUPT = exports.HMSH_CODE_NOTFOUND = exports.HMSH_CODE_PENDING = exports.HMSH_CODE_SUCCESS = exports.HMSH_SIGNAL_EXPIRE = exports.HMSH_IS_CLUSTER = exports.HMSH_TELEMETRY = exports.HMSH_LOGLEVEL = void 0;
3
+ exports.HMSH_GUID_SIZE = exports.HMSH_SCOUT_INTERVAL_SECONDS = exports.HMSH_FIDELITY_SECONDS = exports.HMSH_EXPIRE_DURATION = exports.HMSH_XPENDING_COUNT = exports.HMSH_XCLAIM_COUNT = exports.HMSH_XCLAIM_DELAY_MS = exports.HMSH_BLOCK_TIME_MS = exports.HMSH_MESHFLOW_EXP_BACKOFF = exports.HMSH_MESHFLOW_MAX_INTERVAL = exports.HMSH_MESHFLOW_MAX_ATTEMPTS = exports.HMSH_GRADUATED_INTERVAL_MS = exports.HMSH_MAX_TIMEOUT_MS = exports.HMSH_MAX_RETRIES = exports.MAX_DELAY = exports.MAX_STREAM_BACKOFF = exports.HMSH_EXPIRE_JOB_SECONDS = exports.HMSH_OTT_WAIT_TIME = exports.HMSH_DEPLOYMENT_PAUSE = exports.HMSH_DEPLOYMENT_DELAY = exports.HMSH_ACTIVATION_MAX_RETRY = exports.HMSH_QUORUM_DELAY_MS = exports.HMSH_QUORUM_ROLLCALL_CYCLES = exports.HMSH_STATUS_UNKNOWN = exports.HMSH_CODE_MESHFLOW_RETRYABLE = exports.HMSH_CODE_MESHFLOW_FATAL = exports.HMSH_CODE_MESHFLOW_MAXED = exports.HMSH_CODE_MESHFLOW_TIMEOUT = exports.HMSH_CODE_MESHFLOW_WAIT = exports.HMSH_CODE_MESHFLOW_PROXY = exports.HMSH_CODE_MESHFLOW_CHILD = exports.HMSH_CODE_MESHFLOW_ALL = exports.HMSH_CODE_MESHFLOW_SLEEP = exports.HMSH_CODE_UNACKED = exports.HMSH_CODE_TIMEOUT = exports.HMSH_CODE_UNKNOWN = exports.HMSH_CODE_INTERRUPT = exports.HMSH_CODE_NOTFOUND = exports.HMSH_CODE_PENDING = exports.HMSH_CODE_SUCCESS = exports.HMSH_SIGNAL_EXPIRE = exports.HMSH_IS_CLUSTER = exports.HMSH_TELEMETRY = exports.HMSH_LOGLEVEL = void 0;
4
+ /**
5
+ * Determines the log level for the application. The default is 'info'.
6
+ */
4
7
  exports.HMSH_LOGLEVEL = process.env.HMSH_LOGLEVEL || 'info';
8
+ /**
9
+ * Determines the log level for telemetry. The default is 'info' which emits worker and trigger spans. 'debug' emits all spans.
10
+ */
5
11
  exports.HMSH_TELEMETRY = process.env.HMSH_TELEMETRY || 'info';
12
+ /**
13
+ * If Redis, explicitly sets whether the application is running in a cluster. The default is false.
14
+ * @deprecated
15
+ */
6
16
  exports.HMSH_IS_CLUSTER = process.env.HMSH_IS_CLUSTER === 'true';
7
- exports.HMSH_SIGNAL_EXPIRE = 3600;
17
+ /**
18
+ * Default cleanup time for signal in the db when its associated job is completed.
19
+ */
20
+ exports.HMSH_SIGNAL_EXPIRE = 3600; //seconds
21
+ // HOTMESH STATUS CODES
8
22
  exports.HMSH_CODE_SUCCESS = 200;
9
23
  exports.HMSH_CODE_PENDING = 202;
10
24
  exports.HMSH_CODE_NOTFOUND = 404;
@@ -12,29 +26,87 @@ exports.HMSH_CODE_INTERRUPT = 410;
12
26
  exports.HMSH_CODE_UNKNOWN = 500;
13
27
  exports.HMSH_CODE_TIMEOUT = 504;
14
28
  exports.HMSH_CODE_UNACKED = 999;
29
+ // MESHFLOW STATUS CODES
30
+ /**
31
+ * This is thrown when a Meshflow has been interrupted by a sleepFor call.
32
+ */
15
33
  exports.HMSH_CODE_MESHFLOW_SLEEP = 588;
34
+ /**
35
+ * This is thrown when a Meshflow has been interrupted by a Promise.all call.
36
+ */
16
37
  exports.HMSH_CODE_MESHFLOW_ALL = 589;
38
+ /**
39
+ * This is thrown when a Meshflow has been interrupted by an execChild or startChild call.
40
+ */
17
41
  exports.HMSH_CODE_MESHFLOW_CHILD = 590;
42
+ /**
43
+ * This is thrown when a Meshflow has been interrupted by a proxyActivity call.
44
+ */
18
45
  exports.HMSH_CODE_MESHFLOW_PROXY = 591;
46
+ /**
47
+ * This is thrown when a Meshflow has been interrupted by a waitForSignal call.
48
+ */
19
49
  exports.HMSH_CODE_MESHFLOW_WAIT = 595;
50
+ /**
51
+ * The timeout status code for Meshflow. This status code is thrown when Meshflow has encountered a timeout error and needs to aler the caller why the call failed.
52
+ */
20
53
  exports.HMSH_CODE_MESHFLOW_TIMEOUT = 596;
54
+ /**
55
+ * The maxed status code for Meshflow. This status code is used to indicate that the Meshflow has reached the maximum
56
+ * number of attempts and should be halted. Thrown from a proxied activity or a flow to halt standard execution
57
+ * and prevent further attempts.
58
+ */
21
59
  exports.HMSH_CODE_MESHFLOW_MAXED = 597;
60
+ /**
61
+ * The fatal status code for Meshflow. This status code is used to indicate that the Meshflow has encountered a fatal error. Throw from a proxied activity or a flow to halt standard execution.
62
+ */
22
63
  exports.HMSH_CODE_MESHFLOW_FATAL = 598;
64
+ /**
65
+ * The retryable status code for Meshflow. This status code is used to indicate that the Meshflow has encountered a retryable error (essentially unknown and covered by the standard retry policy).
66
+ */
23
67
  exports.HMSH_CODE_MESHFLOW_RETRYABLE = 599;
68
+ // HOTMESH MESSAGES
24
69
  exports.HMSH_STATUS_UNKNOWN = 'unknown';
70
+ // QUORUM
71
+ /**
72
+ * The number of cycles to re/try for a quorum to be established.
73
+ */
25
74
  exports.HMSH_QUORUM_ROLLCALL_CYCLES = 12;
75
+ /**
76
+ * The delay in milliseconds between quorum rollcall cycles.
77
+ */
26
78
  exports.HMSH_QUORUM_DELAY_MS = 250;
79
+ /**
80
+ * The number of times the call-response exchange must succeed in succession to establish a quorum.
81
+ */
27
82
  exports.HMSH_ACTIVATION_MAX_RETRY = 3;
28
- exports.HMSH_DEPLOYMENT_DELAY = parseInt(process.env.HMSH_DEPLOYMENT_DELAY, 10) || 10000;
29
- exports.HMSH_DEPLOYMENT_PAUSE = parseInt(process.env.HMSH_DEPLOYMENT_PAUSE, 10) || 250;
83
+ //backend provisioning
84
+ exports.HMSH_DEPLOYMENT_DELAY = parseInt(process.env.HMSH_DEPLOYMENT_DELAY, 10) || 10000; //in ms
85
+ exports.HMSH_DEPLOYMENT_PAUSE = parseInt(process.env.HMSH_DEPLOYMENT_PAUSE, 10) || 250; //in ms
86
+ // ENGINE
30
87
  exports.HMSH_OTT_WAIT_TIME = parseInt(process.env.HMSH_OTT_WAIT_TIME, 10) || 1000;
31
88
  exports.HMSH_EXPIRE_JOB_SECONDS = parseInt(process.env.HMSH_EXPIRE_JOB_SECONDS, 10) || 1;
32
- exports.MAX_DELAY = 2147483647;
89
+ // STREAM ROUTER
90
+ exports.MAX_STREAM_BACKOFF = parseInt(process.env.MAX_STREAM_BACKOFF, 10) || 3000;
91
+ exports.MAX_DELAY = 2147483647; // Maximum allowed delay in milliseconds for setTimeout
33
92
  exports.HMSH_MAX_RETRIES = parseInt(process.env.HMSH_MAX_RETRIES, 10) || 3;
34
93
  exports.HMSH_MAX_TIMEOUT_MS = parseInt(process.env.HMSH_MAX_TIMEOUT_MS, 10) || 60000;
35
94
  exports.HMSH_GRADUATED_INTERVAL_MS = parseInt(process.env.HMSH_GRADUATED_INTERVAL_MS, 10) || 5000;
95
+ // MESHFLOW
96
+ /**
97
+ * The maximum number of attempts to retry a MeshFlow job before it is considered failed.
98
+ * @default 3
99
+ */
36
100
  exports.HMSH_MESHFLOW_MAX_ATTEMPTS = 3;
101
+ /**
102
+ * The maximum interval to wait before retrying a MeshFlow job.
103
+ * @default 120s
104
+ */
37
105
  exports.HMSH_MESHFLOW_MAX_INTERVAL = '120s';
106
+ /**
107
+ * The exponential backoff factor to apply to the interval between retries.
108
+ * @default 10
109
+ */
38
110
  exports.HMSH_MESHFLOW_EXP_BACKOFF = 10;
39
111
  const BASE_BLOCK_DURATION = 10000;
40
112
  const TEST_BLOCK_DURATION = 1000;
@@ -46,6 +118,7 @@ exports.HMSH_BLOCK_TIME_MS = process.env.HMSH_BLOCK_TIME_MS
46
118
  exports.HMSH_XCLAIM_DELAY_MS = parseInt(process.env.HMSH_XCLAIM_DELAY_MS, 10) || 1000 * 60;
47
119
  exports.HMSH_XCLAIM_COUNT = parseInt(process.env.HMSH_XCLAIM_COUNT, 10) || 3;
48
120
  exports.HMSH_XPENDING_COUNT = parseInt(process.env.HMSH_XPENDING_COUNT, 10) || 10;
121
+ // TASK WORKER
49
122
  exports.HMSH_EXPIRE_DURATION = parseInt(process.env.HMSH_EXPIRE_DURATION, 10) || 1;
50
123
  const BASE_FIDELITY_SECONDS = 5;
51
124
  const TEST_FIDELITY_SECONDS = 1;
@@ -55,4 +128,5 @@ exports.HMSH_FIDELITY_SECONDS = process.env.HMSH_FIDELITY_SECONDS
55
128
  ? TEST_FIDELITY_SECONDS
56
129
  : BASE_FIDELITY_SECONDS;
57
130
  exports.HMSH_SCOUT_INTERVAL_SECONDS = parseInt(process.env.HMSH_SCOUT_INTERVAL_SECONDS, 10) || 60;
131
+ // UTILS
58
132
  exports.HMSH_GUID_SIZE = Math.min(parseInt(process.env.HMSH_GUID_SIZE, 10) || 22, 32);
@@ -1,13 +1,65 @@
1
1
  import { KeyStoreParams, KeyType } from '../types/hotmesh';
2
+ /**
3
+ * Keys
4
+ *
5
+ * hmsh -> {hash} hotmesh config {version: "0.0.1", namespace: "hmsh"}
6
+ * hmsh:a:<appid> -> {hash} app profile { "id": "appid", "version": "2", "versions/1": "GMT", "versions/2": "GMT"}
7
+ * hmsh:<appid>:r: -> {hash} throttle rates {':': '23', 'topic.thing': '555'} => {':i': 'all', 'topic.thing': '555seconds'}
8
+ * hmsh:<appid>:w: -> {zset} work items/tasks an engine must do like garbage collect or hook a set of matching records (hookAll)
9
+ * hmsh:<appid>:t: -> {zset} an ordered set of list (work lists) ids
10
+ * hmsh:<appid>:t:<timeValue?> -> {list} a worklist of `jobId+activityId` items that should be awakened
11
+ * hmsh:<appid>:q: -> {hash} quorum-wide messages
12
+ * hmsh:<appid>:q:<ngnid> -> {hash} engine-targeted messages (targeted quorum-oriented message)
13
+ * hmsh:<appid>:j:<jobid> -> {hash} job data
14
+ * hmsh:<appid>:s:<jobkey>:<dateTime> -> {hash} job stats (general)
15
+ * hmsh:<appid>:s:<jobkey>:<dateTime>:mdn:<field/path>:<fieldvalue> -> {zset} job stats (median)
16
+ * hmsh:<appid>:s:<jobkey>:<dateTime>:index:<field/path>:<fieldvalue> -> {list} job stats (index of jobid[])
17
+ * hmsh:<appid>:v:<version>:activities -> {hash} schemas [cache]
18
+ * hmsh:<appid>:v:<version>:transitions -> {hash} transitions [cache]
19
+ * hmsh:<appid>:v:<version>:subscriptions -> {hash} subscriptions [cache]
20
+ * hmsh:<appid>:x: -> {xstream} when an engine is sent or reads a buffered task (engines read from their custom topic)
21
+ * hmsh:<appid>:x:<topic> -> {xstream} when a worker is sent or reads a buffered task (workers read from their custom topic)
22
+ * hmsh:<appid>:hooks -> {hash} hook patterns/rules; set at compile time
23
+ * hmsh:<appid>:signals -> {string} dynamic hook signals (hget/hdel); expirable
24
+ * hmsh:<appid>:sym:keys: -> {hash} list of symbol ranges and :cursor assigned at version deploy time for job keys
25
+ * hmsh:<appid>:sym:keys:<activityid|$subscribes> -> {hash} list of symbols based upon schema enums (initially) and adaptively optimized (later) during runtime; if '$subscribes' is used as the activityid, it is a top-level `job` symbol set (for job keys)
26
+ * hmsh:<appid>:sym:vals: -> {hash} list of symbols for job values across all app versions
27
+ */
2
28
  declare const HMNS = "hmsh";
3
29
  declare const KEYSEP = ":";
4
30
  declare const VALSEP = "::";
5
31
  declare const WEBSEP = "::";
6
32
  declare const TYPSEP = "::";
7
33
  declare class KeyService {
34
+ /**
35
+ * Returns a key that can be used to access a value in the key/value store
36
+ * appropriate for the given key type; the keys have an implicit hierarchy
37
+ * and are used to organize data in the store in a tree-like structure
38
+ * via the use of colons as separators.
39
+ * @param namespace
40
+ * @param keyType
41
+ * @param params
42
+ * @returns {string}
43
+ */
8
44
  static mintKey(namespace: string, keyType: KeyType, params: KeyStoreParams): string;
45
+ /**
46
+ * Extracts the parts of a given key string, safely handling cases where
47
+ * the 'id' portion may contain additional colons.
48
+ * @param key - The key to parse.
49
+ * @returns An object with the parsed key parts.
50
+ */
9
51
  static parseKey(key: string): Record<string, string | undefined>;
52
+ /**
53
+ * Reconstructs a key string from its parts.
54
+ * @param parts - An object with the key parts.
55
+ * @returns The reconstructed key string.
56
+ */
10
57
  static reconstituteKey(parts: Record<string, string | undefined>): string;
58
+ /**
59
+ * Resolves an entity type abbreviation to a table-friendly name.
60
+ * @param abbreviation - The abbreviated entity type.
61
+ * @returns The long-form entity name.
62
+ */
11
63
  static resolveEntityType(abbreviation: string, id?: string): string;
12
64
  static resolveAbbreviation(entity: string): string;
13
65
  }
@@ -1 +1 @@
1
- 'use strict';const j=b;(function(c,d){const i=b,e=c();while(!![]){try{const f=parseInt(i(0x18c))/0x1+parseInt(i(0x161))/0x2+-parseInt(i(0x17f))/0x3*(-parseInt(i(0x162))/0x4)+parseInt(i(0x15b))/0x5+-parseInt(i(0x175))/0x6*(-parseInt(i(0x180))/0x7)+-parseInt(i(0x18a))/0x8+parseInt(i(0x177))/0x9*(-parseInt(i(0x17b))/0xa);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xb8ecf));function a(){const p=['task_lists','HOOKS','WEBSEP','../types/hotmesh','hooks',':subscriptions','facet','versions','KEYSEP','signal_patterns','streams','SYMKEYS','SCHEMAS','SUBSCRIPTION_PATTERNS','timeValue','2014705cqyAVo','APP','__esModule','scoutType','WORK_ITEMS',':w:','2161724hkRvPU','4fAudys','jobs','signals',':sym:vals:',':s:',':d:','events','SYMVALS','roles','TIME_RANGE','VALSEP','signal_registry','jobKey','sym','symbols','split','KeyType',':r:',':schemas','1794654OHUkuy','parseKey','18663471fvJQQS',':q:',':j:','SUBSCRIPTIONS','10BxAPwm','activityId','stats','JOB_STATS_INDEX','3989571dWgnoM','7OgUhlx','dateTime','applications','jobId',':v:','JOB_DEPENDENTS','STREAMS','unknown_entity','TYPSEP','engineId','11361968BkeuRr','JOB_STATS_MEDIAN','1138651CtaGkh',':t:','task_priorities','HMNS',':x:','resolveAbbreviation','join','appId','resolveEntityType','SIGNALS','hmsh',':transitions','reconstituteKey','appVersion','mintKey','throttles','KeyService','task_schedules',':signals','QUORUM','THROTTLE_RATE',':a:'];a=function(){return p;};return a();}Object['defineProperty'](exports,j(0x15d),{'value':!![]}),exports[j(0x16c)]=exports[j(0x14e)]=exports[j(0x188)]=exports[j(0x154)]=exports['HMNS']=exports[j(0x172)]=exports[j(0x146)]=void 0x0;const hotmesh_1=require(j(0x14f));Object['defineProperty'](exports,j(0x172),{'enumerable':!![],'get':function(){const k=j;return hotmesh_1[k(0x172)];}});const HMNS=j(0x140);exports[j(0x139)]=HMNS;function b(c,d){const e=a();return b=function(f,g){f=f-0x138;let h=e[f];return h;},b(c,d);}const KEYSEP=':';exports['KEYSEP']=KEYSEP;const VALSEP='::';exports[j(0x16c)]=VALSEP;const WEBSEP='::';exports['WEBSEP']=WEBSEP;const TYPSEP='::';exports['TYPSEP']=TYPSEP;class KeyService{static[j(0x144)](c,d,e){const l=j;switch(d){case hotmesh_1[l(0x172)]['HOTMESH']:return c;case hotmesh_1[l(0x172)][l(0x14a)]:return c+':'+e[l(0x13d)]+l(0x173);case hotmesh_1[l(0x172)][l(0x15f)]:return c+':'+e[l(0x13d)]+l(0x160)+(e[l(0x15e)]||'');case hotmesh_1['KeyType'][l(0x16b)]:return c+':'+e['appId']+l(0x18d)+(e[l(0x15a)]||'');case hotmesh_1['KeyType'][l(0x15c)]:return c+l(0x14b)+(e[l(0x13d)]||'');case hotmesh_1[l(0x172)][l(0x149)]:return c+':'+e[l(0x13d)]+l(0x178)+(e[l(0x189)]||'');case hotmesh_1[l(0x172)]['JOB_STATE']:return c+':'+e[l(0x13d)]+l(0x179)+e[l(0x183)];case hotmesh_1[l(0x172)][l(0x185)]:return c+':'+e['appId']+l(0x167)+e['jobId'];case hotmesh_1[l(0x172)]['JOB_STATS_GENERAL']:return c+':'+e[l(0x13d)]+l(0x166)+e['jobKey']+':'+e[l(0x181)];case hotmesh_1[l(0x172)][l(0x18b)]:return c+':'+e[l(0x13d)]+l(0x166)+e[l(0x16e)]+':'+e[l(0x181)]+':'+e[l(0x152)];case hotmesh_1[l(0x172)][l(0x17e)]:return c+':'+e[l(0x13d)]+l(0x166)+e[l(0x16e)]+':'+e[l(0x181)]+':'+e[l(0x152)];case hotmesh_1[l(0x172)][l(0x158)]:return c+':'+e[l(0x13d)]+l(0x184)+e[l(0x143)]+l(0x174);case hotmesh_1[l(0x172)][l(0x17a)]:return c+':'+e[l(0x13d)]+l(0x184)+e[l(0x143)]+l(0x151);case hotmesh_1[l(0x172)][l(0x159)]:return c+':'+e[l(0x13d)]+l(0x184)+e[l(0x143)]+l(0x141);case hotmesh_1[l(0x172)][l(0x14d)]:return c+':'+e[l(0x13d)]+':hooks';case hotmesh_1[l(0x172)][l(0x13f)]:return c+':'+e['appId']+l(0x148);case hotmesh_1[l(0x172)][l(0x157)]:return c+':'+e[l(0x13d)]+':sym:keys:'+(e[l(0x17c)]||'');case hotmesh_1[l(0x172)][l(0x169)]:return c+':'+e['appId']+l(0x165);case hotmesh_1[l(0x172)][l(0x186)]:return c+':'+(e['appId']||'')+l(0x13a)+(e['topic']||'');default:throw new Error('Invalid\x20key\x20type.');}}static[j(0x176)](c){const m=j,[d,e,f,...g]=c[m(0x171)](KEYSEP),h=g[m(0x13c)](KEYSEP)||'';return{'namespace':d,'app':f==='a'?e:undefined,'entity':f,'id':h};}static[j(0x142)](c){const {namespace:d,app:e,entity:f,id:g}=c;return''+d+KEYSEP+e+KEYSEP+f+KEYSEP+(g||'');}static[j(0x13e)](c,d=''){const n=j;switch(c){case'a':return'applications';case'r':return n(0x145);case'w':return d===''?n(0x138):n(0x16a);case't':return d===''?'task_schedules':n(0x14c);case'q':return n(0x168);case'j':return n(0x163);case's':return n(0x17d);case'v':return n(0x153);case'x':return d===''?'streams':'stream_topics';case n(0x150):return n(0x155);case n(0x164):return n(0x16d);case n(0x16f):return n(0x170);default:return'unknown_entity';}}static[j(0x13b)](c){const o=j;switch(c){case o(0x182):return'a';case o(0x145):return'r';case'roles':return'w';case o(0x147):return't';case o(0x14c):return't';case o(0x168):return'q';case o(0x163):return'j';case o(0x17d):return's';case o(0x153):return'v';case o(0x156):return'x';case o(0x155):return o(0x150);case o(0x16d):return o(0x164);case o(0x170):return o(0x16f);default:return o(0x187);}}}exports[j(0x146)]=KeyService;
1
+ 'use strict';const j=b;(function(c,d){const i=b,e=c();while(!![]){try{const f=-parseInt(i(0x159))/0x1*(-parseInt(i(0x151))/0x2)+-parseInt(i(0x184))/0x3+-parseInt(i(0x171))/0x4*(parseInt(i(0x158))/0x5)+-parseInt(i(0x197))/0x6*(-parseInt(i(0x186))/0x7)+-parseInt(i(0x17a))/0x8+parseInt(i(0x176))/0x9*(parseInt(i(0x15f))/0xa)+-parseInt(i(0x15d))/0xb*(-parseInt(i(0x15e))/0xc);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x21166));Object['defineProperty'](exports,j(0x155),{'value':!0x0}),exports[j(0x14f)]=exports['WEBSEP']=exports[j(0x174)]=exports[j(0x16e)]=exports['HMNS']=exports[j(0x173)]=exports[j(0x163)]=void 0x0;const hotmesh_1=require(j(0x18f));function a(){const o=['TIME_RANGE','890113EUIYKn',':hooks',':t:','facet','symbols','engineId','task_schedules',':w:','streams','../types/hotmesh',':j:',':q:','JOB_STATS_MEDIAN','QUORUM','stream_topics','hmsh','mintKey','12TsVOTI','reconstituteKey','applications','WEBSEP','appVersion','split','THROTTLE_RATE','jobId','JOB_STATS_GENERAL','VALSEP',':s:','302wYomiA','WORK_ITEMS',':v:','SCHEMAS','__esModule',':schemas','appId','10OkQfOJ','90hVKHMx',':transitions','defineProperty','signal_patterns','2013BvPdvU','3252XfWVIa','940OQQeTb','topic','SIGNALS','sym','KeyService','roles','SUBSCRIPTION_PATTERNS','task_priorities','stats','throttles','hooks','Invalid\x20key\x20type.',':x:','HOTMESH','events','KEYSEP','APP','SUBSCRIPTIONS','46676DBlSeN',':subscriptions','KeyType','TYPSEP','JOB_STATS_INDEX','243QBAihz','signal_registry','resolveAbbreviation','versions','208224leGSmN','JOB_STATE',':sym:keys:','unknown_entity',':sym:vals:','join','signals','task_lists','parseKey','dateTime','405441BPRJdc'];a=function(){return o;};return a();}Object[j(0x15b)](exports,j(0x173),{'enumerable':!0x0,'get':function(){return hotmesh_1['KeyType'];}});function b(c,d){const e=a();return b=function(f,g){f=f-0x14b;let h=e[f];return h;},b(c,d);}const HMNS=j(0x195);exports['HMNS']=HMNS;const KEYSEP=':';exports['KEYSEP']=':';const VALSEP='::';exports['VALSEP']='::';const WEBSEP='::';exports[j(0x19a)]='::';const TYPSEP='::';exports[j(0x174)]='::';class KeyService{static[j(0x196)](c,d,f){const k=j;switch(d){case hotmesh_1[k(0x173)][k(0x16c)]:return c;case hotmesh_1[k(0x173)][k(0x14c)]:return c+':'+f[k(0x157)]+':r:';case hotmesh_1[k(0x173)][k(0x152)]:return c+':'+f[k(0x157)]+k(0x18d)+(f['scoutType']||'');case hotmesh_1[k(0x173)][k(0x185)]:return c+':'+f[k(0x157)]+k(0x188)+(f['timeValue']||'');case hotmesh_1['KeyType'][k(0x16f)]:return c+':a:'+(f[k(0x157)]||'');case hotmesh_1['KeyType'][k(0x193)]:return c+':'+f[k(0x157)]+k(0x191)+(f[k(0x18b)]||'');case hotmesh_1[k(0x173)][k(0x17b)]:return c+':'+f[k(0x157)]+k(0x190)+f[k(0x14d)];case hotmesh_1[k(0x173)]['JOB_DEPENDENTS']:return c+':'+f[k(0x157)]+':d:'+f[k(0x14d)];case hotmesh_1[k(0x173)][k(0x14e)]:return c+':'+f[k(0x157)]+k(0x150)+f['jobKey']+':'+f[k(0x183)];case hotmesh_1[k(0x173)][k(0x192)]:case hotmesh_1[k(0x173)][k(0x175)]:return c+':'+f['appId']+k(0x150)+f['jobKey']+':'+f['dateTime']+':'+f[k(0x189)];case hotmesh_1[k(0x173)][k(0x154)]:return c+':'+f[k(0x157)]+k(0x153)+f[k(0x19b)]+k(0x156);case hotmesh_1[k(0x173)][k(0x170)]:return c+':'+f[k(0x157)]+':v:'+f[k(0x19b)]+k(0x172);case hotmesh_1[k(0x173)][k(0x165)]:return c+':'+f[k(0x157)]+k(0x153)+f['appVersion']+k(0x15a);case hotmesh_1[k(0x173)]['HOOKS']:return c+':'+f[k(0x157)]+k(0x187);case hotmesh_1[k(0x173)][k(0x161)]:return c+':'+f['appId']+':signals';case hotmesh_1[k(0x173)]['SYMKEYS']:return c+':'+f['appId']+k(0x17c)+(f['activityId']||'');case hotmesh_1[k(0x173)]['SYMVALS']:return c+':'+f[k(0x157)]+k(0x17e);case hotmesh_1['KeyType']['STREAMS']:return c+':'+(f[k(0x157)]||'')+k(0x16b)+(f[k(0x160)]||'');default:throw new Error(k(0x16a));}}static[j(0x182)](c){const l=j,[d,f,g,...h]=c[l(0x14b)](':');return{'namespace':d,'app':'a'===g?f:void 0x0,'entity':g,'id':h[l(0x17f)](':')||''};}static[j(0x198)](c){const {namespace:d,app:f,entity:g,id:h}=c;return d+':'+f+':'+g+':'+(h||'');}static['resolveEntityType'](c,d=''){const m=j;switch(c){case'a':return m(0x199);case'r':return m(0x168);case'w':return''===d?m(0x166):m(0x164);case't':return''===d?m(0x18c):m(0x181);case'q':return m(0x16d);case'j':return'jobs';case's':return m(0x167);case'v':return m(0x179);case'x':return''===d?m(0x18e):m(0x194);case m(0x169):return m(0x15c);case m(0x180):return m(0x177);case m(0x162):return m(0x18a);default:return m(0x17d);}}static[j(0x178)](c){const n=j;switch(c){case'applications':return'a';case n(0x168):return'r';case n(0x164):return'w';case n(0x18c):case n(0x181):return't';case n(0x16d):return'q';case'jobs':return'j';case n(0x167):return's';case n(0x179):return'v';case n(0x18e):return'x';case n(0x15c):return n(0x169);case n(0x177):return n(0x180);case n(0x18a):return'sym';default:return n(0x17d);}}}exports[j(0x163)]=KeyService;
@@ -5,6 +5,9 @@ import { ProviderClient, ProviderConfig, ProviderTransaction, Providers, Provide
5
5
  import { StringAnyType } from '../types/serializer';
6
6
  import { StreamCode, StreamData, StreamStatus } from '../types/stream';
7
7
  import { SystemHealth } from '../types/quorum';
8
+ /**
9
+ * @private
10
+ */
8
11
  export declare const hashOptions: (options: any) => string;
9
12
  export declare function getSystemHealth(): Promise<SystemHealth>;
10
13
  export declare function deepCopy<T>(obj: T): T;
@@ -16,31 +19,101 @@ export declare function XSleepFor(ms: number): {
16
19
  promise: Promise<unknown>;
17
20
  timerId: NodeJS.Timeout;
18
21
  };
22
+ /**
23
+ * Identies the provider type based on the provider object. Customers may
24
+ * explicitly set the provider type in the configuration. But this is a
25
+ * convenience method to automatically identify the provider type.
26
+ * @private
27
+ */
19
28
  export declare function identifyProvider(provider: any): Providers | null;
29
+ /**
30
+ * @private
31
+ */
20
32
  export declare const polyfill: {
33
+ /**
34
+ * `redis` is deprecated; `connection` is the generic replacement
35
+ */
21
36
  providerConfig(obj: any): any;
37
+ /**
38
+ * NOTE: `redisClass and redisOptions` input parameters are deprecated; use `connection` for all configuration inputs
39
+ */
22
40
  meshDataConfig(obj: {
23
41
  connection?: Partial<ProviderConfig | ProvidersConfig>;
24
42
  redisClass?: any;
25
43
  redisOptions?: StringAnyType;
26
44
  }): Partial<ProviderConfig> | Partial<ProvidersConfig>;
27
45
  };
46
+ /**
47
+ * @private
48
+ */
28
49
  export declare function matchesStatusCode(code: StreamCode, pattern: string | RegExp): boolean;
50
+ /**
51
+ * @private
52
+ */
29
53
  export declare function matchesStatus(status: StreamStatus, targetStatus: StreamStatus): boolean;
54
+ /**
55
+ * @private
56
+ */
30
57
  export declare function findTopKey(obj: AppTransitions, input: string): string | null;
58
+ /**
59
+ * @private
60
+ */
31
61
  export declare function findSubscriptionForTrigger(obj: AppSubscriptions, value: string): string | null;
62
+ /**
63
+ * Get the subscription topic for the flow to which activityId belongs.
64
+ * @private
65
+ */
32
66
  export declare function getSubscriptionTopic(activityId: string, store: StoreService<ProviderClient, ProviderTransaction>, appVID: AppVID): Promise<string | undefined>;
67
+ /**
68
+ * returns the 12-digit format of the iso timestamp (e.g, 202101010000); returns
69
+ * an empty string if overridden by the user to not segment by time (infinity).
70
+ * @private
71
+ */
33
72
  export declare function getTimeSeries(granularity: string): string;
73
+ /**
74
+ * @private
75
+ */
34
76
  export declare function formatISODate(input: Date | string): string;
77
+ /**
78
+ * @private
79
+ */
35
80
  export declare function getSymKey(number: number): string;
81
+ /**
82
+ * @private
83
+ */
36
84
  export declare function getSymVal(number: number): string;
85
+ /**
86
+ * @private
87
+ */
37
88
  export declare function getIndexedHash<T>(hash: T, target: string): [number, T];
89
+ /**
90
+ * @private
91
+ */
38
92
  export declare function getValueByPath(obj: {
39
93
  [key: string]: any;
40
94
  }, path: string): any;
95
+ /**
96
+ * @private
97
+ */
41
98
  export declare function restoreHierarchy(obj: StringAnyType): StringAnyType;
99
+ /**
100
+ * @private
101
+ */
42
102
  export declare function isValidCron(cronExpression: string): boolean;
103
+ /**
104
+ * Returns the number of seconds for a string using the milliseconds format
105
+ * used by the `ms` npm package as the input.
106
+ */
43
107
  export declare const s: (input: string) => number;
108
+ /**
109
+ * @private
110
+ */
44
111
  export declare const parseStreamMessage: (message: string) => StreamData;
112
+ /**
113
+ * @private
114
+ */
45
115
  export declare const isStreamMessage: (result: any) => boolean;
116
+ /**
117
+ * Transforms an array of arrays to an array of objects.
118
+ */
46
119
  export declare const arrayToHash: (response: [number, ...Array<string | string[]>]) => Record<string, string>[];
@@ -1 +1 @@
1
- 'use strict';const p=b;(function(c,d){const n=b,e=c();while(!![]){try{const f=parseInt(n(0x1fb))/0x1+-parseInt(n(0x1e9))/0x2+-parseInt(n(0x1db))/0x3+parseInt(n(0x1fc))/0x4*(-parseInt(n(0x1e2))/0x5)+-parseInt(n(0x225))/0x6+-parseInt(n(0x1cf))/0x7+-parseInt(n(0x205))/0x8*(-parseInt(n(0x219))/0x9);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xcccaa));var __importDefault=this&&this['__importDefault']||function(c){const o=b;return c&&c[o(0x1f0)]?c:{'default':c};};function a(){const L=['floor','database','nats','hotmesh','2039157ZvxeyA','Number\x20out\x20of\x20range','slice','utils','replace','toFixed','findSubscriptionForTrigger','610khljUd','toString','connection','EventEmitter','sleepImmediate','idleCount','keys','1911478YxQgrD','hex','getTimeSeries','sin','parseStreamMessage','identifyProvider','deepCopy','__esModule','isArray','hset','default','restoreHierarchy','hashOptions','Redis','test','length','arrayToHash','getSymKey','637409ppcOlO','13736ljVMJm','Commander','polyfill','defineProperty','getSubscriptions','string','Pipeline','update','split','552sMlooP','postgres','constructor','sha256','toISOString','getIndexedHash','infinity','createClient','Error\x20parsing\x20Stream\x20message','LoggerService','Query','name','abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','freemem','\x20GB','sleepFor','includes','guid','formatISODate','setUTCMinutes','466551QVUCGS','getPrototypeOf','error','digest','findTopKey','redis','crypto','isValidCron','getMinutes','stringify','multi','Pool','4963860OSMBLN','XSleepFor','hasOwnProperty','isStreamMessage','../services/logger','ioredis','createHash','connections','getSubscriptionTopic','pow','HMSH_GUID_SIZE','3456306wEVkoE','parse','nanoid','getValueByPath','deterministicRandom','matchesStatus','getTransitions','matchesStatusCode'];a=function(){return L;};return a();}Object[p(0x1ff)](exports,'__esModule',{'value':!![]}),exports[p(0x1f9)]=exports[p(0x228)]=exports[p(0x1ed)]=exports['s']=exports[p(0x220)]=exports[p(0x1f4)]=exports[p(0x1d2)]=exports[p(0x20a)]=exports['getSymVal']=exports[p(0x1fa)]=exports[p(0x217)]=exports[p(0x1eb)]=exports[p(0x1cc)]=exports[p(0x1e1)]=exports[p(0x21d)]=exports['matchesStatus']=exports[p(0x1d6)]=exports['polyfill']=exports[p(0x1ee)]=exports['XSleepFor']=exports[p(0x1e6)]=exports['sleepFor']=exports[p(0x216)]=exports[p(0x1d3)]=exports[p(0x1ef)]=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require(p(0x21f)),nanoid_1=require(p(0x1d1)),ms_1=__importDefault(require('ms')),logger_1=require(p(0x229)),enums_1=require('./enums'),logger=new logger_1[(p(0x20e))](p(0x1da),p(0x1de)),hashOptions=c=>{const q=p,d=JSON['stringify'](c);return(0x0,crypto_1[q(0x22b)])(q(0x208))[q(0x203)](d)[q(0x21c)](q(0x1ea));};exports[p(0x1f5)]=hashOptions;async function getSystemHealth(){const r=p,c=os_1[r(0x1f3)]['totalmem'](),d=os_1[r(0x1f3)][r(0x212)](),e=c-d,f={'TotalMemoryGB':(c/0x400/0x400/0x400)[r(0x1e0)](0x2)+r(0x213),'FreeMemoryGB':(d/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(e/0x400/0x400/0x400)[r(0x1e0)](0x2)+r(0x213),'CPULoad':[],'NetworkStats':[]};return f;}exports['getSystemHealth']=getSystemHealth;function deepCopy(c){const t=p;return JSON[t(0x1d0)](JSON[t(0x222)](c));}exports[p(0x1ef)]=deepCopy;function deterministicRandom(c){const u=p,d=Math[u(0x1ec)](c)*0x2710;return d-Math[u(0x1d7)](d);}exports[p(0x1d3)]=deterministicRandom;function guid(c=enums_1[p(0x1ce)]){return'H'+(0x0,nanoid_1['nanoid'])(c);}exports[p(0x216)]=guid;async function sleepFor(c){return new Promise(d=>setTimeout(d,c));}exports[p(0x214)]=sleepFor;function sleepImmediate(){return new Promise(c=>setImmediate(c));}exports[p(0x1e6)]=sleepImmediate;function XSleepFor(c){let d;const e=new Promise(f=>{d=setTimeout(f,c);});return{'promise':e,'timerId':d};}exports[p(0x226)]=XSleepFor;function identifyProvider(c){const v=p,d=Object[v(0x21a)](c);if(c[v(0x20f)]?.['prototype']||Object[v(0x1e8)](c)[v(0x215)](v(0x1d8))||d[v(0x210)]===v(0x224))return v(0x206);else{if(c[v(0x1e3)]()['toLowerCase']()[v(0x215)]('nats'))return v(0x1d9);else{if('defineCommand'in d||Object[v(0x1e8)](d)['includes'](v(0x223)))return'ioredis';else{if(Object[v(0x1e8)](d)[v(0x215)]('Multi'))return v(0x21e);}}}if(c[v(0x207)]){if(c[v(0x207)][v(0x210)]===v(0x1f6)||c[v(0x207)][v(0x210)]===v(0x1e5)){if(v(0x1f2)in c)return v(0x22a);}else{if(c[v(0x207)][v(0x210)]==='ProviderClient'||c[v(0x207)][v(0x210)]===v(0x1fd)){if('HSET'in c)return v(0x21e);}}}let e=null;if(Object[v(0x1e8)](c)['includes'](v(0x1e4))||!isNaN(c['totalCount'])&&!isNaN(c[v(0x1e7)]))e=v(0x206);else{if(Object[v(0x1e8)](c)[v(0x215)](v(0x202)))e=v(0x22a);else{if(Object[v(0x1e8)](c)[v(0x215)](v(0x20c)))e=v(0x21e);else d['constructor'][v(0x1e3)]()[v(0x215)]('NatsConnectionImpl')&&(e=v(0x1d9));}}return e;}exports[p(0x1ee)]=identifyProvider,exports[p(0x1fe)]={'providerConfig'(c){const w=p;return c?.[w(0x1e4)]??c?.[w(0x21e)]??c?.[w(0x22c)];},'meshDataConfig'(c){return{...c['connection']};}};function matchesStatusCode(c,d){const x=p;if(typeof d===x(0x201)){const e='^'+d[x(0x1df)](/\*/g,'\x5cd')+'$';return new RegExp(e)[x(0x1f7)](c['toString']());}return d[x(0x1f7)](c[x(0x1e3)]());}exports[p(0x1d6)]=matchesStatusCode;function matchesStatus(c,d){return c===d;}exports[p(0x1d4)]=matchesStatus;function findTopKey(c,d){const y=p;for(const [e,f]of Object['entries'](c)){if(f[y(0x227)](d)){const g=findTopKey(c,e['replace'](/^\./,''));return(g||e)['replace'](/^\./,'');}}return null;}exports[p(0x21d)]=findTopKey;function findSubscriptionForTrigger(c,d){for(const [e,f]of Object['entries'](c)){if(f===d)return e;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;function b(c,d){const e=a();return b=function(f,g){f=f-0x1cc;let h=e[f];return h;},b(c,d);}async function getSubscriptionTopic(c,d,e){const z=p,f=await d[z(0x1d5)](e),g=await d[z(0x200)](e),h=findTopKey(f,c),i=findSubscriptionForTrigger(g,h);return i;}exports[p(0x1cc)]=getSubscriptionTopic;function getTimeSeries(c){const A=p;if(c[A(0x1e3)]()===A(0x20b))return'0';const d=new Date(),e=c[A(0x1dd)](-0x1),f=parseInt(c['slice'](0x0,-0x1),0xa);if(e==='m'){const g=Math[A(0x1d7)](d[A(0x221)]()/f)*f;d['setUTCMinutes'](g,0x0,0x0);}else e==='h'&&d[A(0x218)](0x0,0x0,0x0);return d[A(0x209)]()[A(0x1df)](/:\d\d\..+|-|T/g,'')[A(0x1df)](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(c){const B=p,d=c instanceof Date?c:new Date(c);return d[B(0x209)]()[B(0x1df)](/[:TZ-]/g,'');}exports[p(0x217)]=formatISODate;function getSymKey(c){const C=p,d=C(0x211),e=d[C(0x1f8)];if(c<0x0||c>=Math[C(0x1cd)](e,0x3))throw new Error(C(0x1dc));const [f,g]=divmod(c,e),[h,i]=divmod(f,e);return d[h]+d[g]+d[i];}exports[p(0x1fa)]=getSymKey;function getSymVal(c){const D=p,d=D(0x211),e=d[D(0x1f8)];if(c<0x0||c>=Math[D(0x1cd)](e,0x2))throw new Error(D(0x1dc));const [f,g]=divmod(c,e);return d[f]+d[g];}exports['getSymVal']=getSymVal;function divmod(c,d){return[Math['floor'](c/d),c%d];}function getIndexedHash(c,d){const e=c[d]||0x0,f={...c};return delete f[d],[e,f];}exports[p(0x20a)]=getIndexedHash;function getValueByPath(c,d){const E=p,e=d[E(0x204)]('/');let f=c;for(const g of e){if(f[g]!==undefined)f=f[g];else return undefined;}return f;}exports[p(0x1d2)]=getValueByPath;function restoreHierarchy(c){const F=p,d={};for(const e in c){if(c[e]===undefined)continue;const f=e[F(0x204)]('/');let g=d;for(let h=0x0;h<f['length'];h++){h===f[F(0x1f8)]-0x1?g[f[h]]=c[e]:(g[f[h]]=g[f[h]]||{},g=g[f[h]]);}}return d;}exports[p(0x1f4)]=restoreHierarchy;function isValidCron(c){const G=p,d=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return d[G(0x1f7)](c);}exports[p(0x220)]=isValidCron;const s=c=>{const H=p;return(0x0,ms_1[H(0x1f3)])(c)/0x3e8;};exports['s']=s;const parseStreamMessage=c=>{const I=p;try{return JSON[I(0x1d0)](c);}catch(d){logger[I(0x21b)](I(0x20d),{'error':d});throw d;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=c=>{const J=p;return Array['isArray'](c)&&Array[J(0x1f1)](c[0x0]);};exports[p(0x228)]=isStreamMessage;const arrayToHash=c=>{const K=p,d=[];let e;for(let f=0x1;f<c[K(0x1f8)];f++){const g=c[f],h={};if(Array['isArray'](g)){for(let k=0x0;k<g[K(0x1f8)];k+=0x2){const l=g[k],m=g[k+0x1];h[l]=m;}e&&(h['$']=e),d['push'](h),e=undefined;}else e=g;}return d;};exports['arrayToHash']=arrayToHash;
1
+ 'use strict';const n=b;function b(c,d){const e=a();return b=function(f,g){f=f-0x6e;let h=e[f];return h;},b(c,d);}(function(c,d){const m=b,e=c();while(!![]){try{const f=-parseInt(m(0xc5))/0x1+parseInt(m(0x93))/0x2+parseInt(m(0x73))/0x3+parseInt(m(0xa1))/0x4+-parseInt(m(0x80))/0x5+-parseInt(m(0x87))/0x6*(-parseInt(m(0xb0))/0x7)+-parseInt(m(0xbf))/0x8*(-parseInt(m(0x74))/0x9);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xc77e3));var __importDefault=this&&this[n(0xba)]||function(c){const o=n;return c&&c[o(0xbc)]?c:{'default':c};};Object[n(0xb4)](exports,n(0xbc),{'value':!0x0}),exports[n(0x97)]=exports[n(0x8d)]=exports[n(0xb1)]=exports['s']=exports[n(0x85)]=exports['restoreHierarchy']=exports[n(0x9d)]=exports['getIndexedHash']=exports[n(0x7a)]=exports[n(0xa9)]=exports[n(0x7c)]=exports['getTimeSeries']=exports[n(0xaa)]=exports[n(0x88)]=exports[n(0x9c)]=exports[n(0xcc)]=exports[n(0x8f)]=exports[n(0x99)]=exports[n(0x90)]=exports[n(0xc1)]=exports['sleepImmediate']=exports[n(0x98)]=exports[n(0x9e)]=exports[n(0xc2)]=exports['deepCopy']=exports[n(0x82)]=exports[n(0x7e)]=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require(n(0x89)),ms_1=__importDefault(require('ms')),logger_1=require(n(0x96)),enums_1=require(n(0xa2)),logger=new logger_1['LoggerService'](n(0xc0),n(0x72)),hashOptions=c=>{const p=n,d=JSON[p(0xc6)](c);return(0x0,crypto_1[p(0xcb)])(p(0x91))[p(0xad)](d)['digest'](p(0xa6));};async function getSystemHealth(){const q=n,c=os_1[q(0x7d)][q(0xb9)](),d=os_1['default']['freemem'](),f=c-d;return{'TotalMemoryGB':(c/0x400/0x400/0x400)['toFixed'](0x2)+q(0xaf),'FreeMemoryGB':(d/0x400/0x400/0x400)[q(0x8a)](0x2)+q(0xaf),'UsedMemoryGB':(f/0x400/0x400/0x400)[q(0x8a)](0x2)+q(0xaf),'CPULoad':[],'NetworkStats':[]};}function deepCopy(c){const r=n;return JSON['parse'](JSON[r(0xc6)](c));}function deterministicRandom(c){const t=n,d=0x2710*Math[t(0x79)](c);return d-Math[t(0x8e)](d);}function guid(c=enums_1[n(0xc9)]){return'H'+(0x0,nanoid_1['nanoid'])(c);}async function sleepFor(c){return new Promise(d=>setTimeout(d,c));}function sleepImmediate(){return new Promise(c=>setImmediate(c));}function XSleepFor(c){let d;return{'promise':new Promise(f=>{d=setTimeout(f,c);}),'timerId':d};}function identifyProvider(c){const u=n,d=Object['getPrototypeOf'](c);if(c['Query']?.[u(0x7f)]||Object[u(0xab)](c)[u(0x77)]('database')||'Pool'===d[u(0x9f)])return u(0x6e);if(c['toString']()[u(0x8c)]()[u(0x77)]('nats'))return u(0xc7);if(u(0xce)in d||Object[u(0xab)](d)[u(0x77)](u(0x94)))return'ioredis';if(Object[u(0xab)](d)[u(0x77)](u(0xb3)))return'redis';if(c[u(0x6f)]){if('Redis'===c[u(0x6f)]['name']||u(0xb7)===c['constructor']['name']){if(u(0x78)in c)return u(0xc8);}else{if((u(0x71)===c['constructor']['name']||u(0xa0)===c[u(0x6f)][u(0x9f)])&&u(0x70)in c)return'redis';}}let f=null;return Object[u(0xab)](c)['includes']('connection')||!isNaN(c[u(0xa3)])&&!isNaN(c[u(0xae)])?f='postgres':Object[u(0xab)](c)[u(0x77)](u(0x9a))?f='ioredis':Object[u(0xab)](c)[u(0x77)](u(0x92))?f=u(0x86):d['constructor'][u(0xa7)]()[u(0x77)]('NatsConnectionImpl')&&(f='nats'),f;}function matchesStatusCode(c,d){const v=n;if(v(0x95)==typeof d){const f='^'+d[v(0xb8)](/\*/g,'\x5cd')+'$';return new RegExp(f)[v(0xcd)](c[v(0xa7)]());}return d['test'](c[v(0xa7)]());}function matchesStatus(c,d){return c===d;}function findTopKey(c,d){const w=n;for(const [f,g]of Object['entries'](c))if(g[w(0xbe)](d))return(findTopKey(c,f[w(0xb8)](/^\./,''))||f)[w(0xb8)](/^\./,'');return null;}function findSubscriptionForTrigger(c,d){const x=n;for(const [f,g]of Object[x(0xca)](c))if(g===d)return f;return null;}async function getSubscriptionTopic(c,d,f){const y=n,g=await d['getTransitions'](f);return findSubscriptionForTrigger(await d[y(0x84)](f),findTopKey(g,c));}function getTimeSeries(c){const z=n;if(z(0xc3)===c[z(0xa7)]())return'0';const d=new Date(),f=c[z(0x8b)](-0x1),g=parseInt(c[z(0x8b)](0x0,-0x1),0xa);if('m'===f){const h=Math[z(0x8e)](d[z(0x75)]()/g)*g;d[z(0xbb)](h,0x0,0x0);}else'h'===f&&d[z(0xbb)](0x0,0x0,0x0);return d['toISOString']()[z(0xb8)](/:\d\d\..+|-|T/g,'')[z(0xb8)](':','');}function formatISODate(c){const A=n;return(c instanceof Date?c:new Date(c))[A(0xc4)]()['replace'](/[:TZ-]/g,'');}function getSymKey(c){const B=n,d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';if(c<0x0||c>=Math[B(0x7b)](0x34,0x3))throw new Error(B(0x76));const [f,g]=divmod(c,0x34),[h,i]=divmod(f,0x34);return d[h]+d[g]+d[i];}function getSymVal(c){const C=n,d=C(0xcf);if(c<0x0||c>=Math['pow'](0x34,0x2))throw new Error(C(0x76));const [f,g]=divmod(c,0x34);return d[f]+d[g];}function divmod(c,d){return[Math['floor'](c/d),c%d];}function getIndexedHash(c,d){const f=c[d]||0x0,g={...c};return delete g[d],[f,g];}function getValueByPath(c,d){const D=n,f=d[D(0xa4)]('/');let g=c;for(const h of f){if(void 0x0===g[h])return;g=g[h];}return g;}function restoreHierarchy(c){const E=n,d={};for(const f in c){if(void 0x0===c[f])continue;const g=f[E(0xa4)]('/');let h=d;for(let i=0x0;i<g['length'];i++)i===g[E(0xa8)]-0x1?h[g[i]]=c[f]:(h[g[i]]=h[g[i]]||{},h=h[g[i]]);}return d;}function isValidCron(c){const F=n;return/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/[F(0xcd)](c);}exports[n(0x7e)]=hashOptions,exports[n(0x82)]=getSystemHealth,exports[n(0x81)]=deepCopy,exports[n(0xc2)]=deterministicRandom,exports[n(0x9e)]=guid,exports['sleepFor']=sleepFor,exports['sleepImmediate']=sleepImmediate,exports[n(0xc1)]=XSleepFor,exports[n(0x90)]=identifyProvider,exports[n(0x99)]={'providerConfig':c=>c?.[n(0xa5)]??c?.[n(0x86)]??c?.[n(0xb2)],'meshDataConfig':c=>({...c[n(0xa5)]})},exports[n(0x8f)]=matchesStatusCode,exports[n(0xcc)]=matchesStatus,exports[n(0x9c)]=findTopKey,exports[n(0x88)]=findSubscriptionForTrigger,exports['getSubscriptionTopic']=getSubscriptionTopic,exports[n(0xac)]=getTimeSeries,exports[n(0x7c)]=formatISODate,exports['getSymKey']=getSymKey,exports[n(0x7a)]=getSymVal,exports[n(0xbd)]=getIndexedHash,exports['getValueByPath']=getValueByPath,exports['restoreHierarchy']=restoreHierarchy,exports[n(0x85)]=isValidCron;const s=c=>(0x0,ms_1[n(0x7d)])(c)/0x3e8;exports['s']=s;const parseStreamMessage=c=>{const G=n;try{return JSON[G(0x9b)](c);}catch(d){throw logger[G(0xb6)](G(0x83),{'error':d}),d;}};exports[n(0xb1)]=parseStreamMessage;const isStreamMessage=c=>Array[n(0xb5)](c)&&Array[n(0xb5)](c[0x0]);exports[n(0x8d)]=isStreamMessage;const arrayToHash=c=>{const H=n,d=[];let f;for(let g=0x1;g<c['length'];g++){const h=c[g],i={};if(Array[H(0xb5)](h)){for(let j=0x0;j<h[H(0xa8)];j+=0x2){const k=h[j],l=h[j+0x1];i[k]=l;}f&&(i['$']=f),d['push'](i),f=void 0x0;}else f=h;}return d;};exports[n(0x97)]=arrayToHash;function a(){const I=['postgres','constructor','HSET','ProviderClient','utils','597801ulDbxw','1701yFiiGw','getMinutes','Number\x20out\x20of\x20range','includes','hset','sin','getSymVal','pow','formatISODate','default','hashOptions','prototype','3606780NTtcVO','deepCopy','getSystemHealth','Error\x20parsing\x20Stream\x20message','getSubscriptions','isValidCron','redis','591630AmZKpt','findSubscriptionForTrigger','nanoid','toFixed','slice','toLowerCase','isStreamMessage','floor','matchesStatusCode','identifyProvider','sha256','createClient','598536EBQlYY','multi','string','../services/logger','arrayToHash','sleepFor','polyfill','Pipeline','parse','findTopKey','getValueByPath','guid','name','Commander','3406948EMGpLs','./enums','totalCount','split','connection','hex','toString','length','getSymKey','getSubscriptionTopic','keys','getTimeSeries','update','idleCount','\x20GB','49LOsIEb','parseStreamMessage','connections','Multi','defineProperty','isArray','error','EventEmitter','replace','totalmem','__importDefault','setUTCMinutes','__esModule','getIndexedHash','hasOwnProperty','32104HZcTld','hotmesh','XSleepFor','deterministicRandom','infinity','toISOString','1260485URCiNO','stringify','nats','ioredis','HMSH_GUID_SIZE','entries','createHash','matchesStatus','test','defineCommand','abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'];a=function(){return I;};return a();}