@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.
- package/build/index.d.ts +8 -2
- package/build/index.js +13 -7
- package/build/modules/enums.d.ts +65 -1
- package/build/modules/enums.js +79 -5
- package/build/modules/key.d.ts +52 -0
- package/build/modules/key.js +1 -1
- package/build/modules/utils.d.ts +73 -0
- package/build/modules/utils.js +1 -1
- package/build/package.json +6 -4
- package/build/services/activities/activity.d.ts +36 -0
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.d.ts +7 -0
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.d.ts +6 -0
- package/build/services/activities/hook.js +1 -1
- package/build/services/activities/index.js +1 -1
- package/build/services/activities/interrupt.js +1 -1
- package/build/services/activities/signal.d.ts +6 -0
- package/build/services/activities/signal.js +1 -1
- package/build/services/activities/trigger.d.ts +7 -0
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.d.ts +76 -0
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.d.ts +15 -0
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.d.ts +3 -0
- package/build/services/compiler/validator.js +1 -1
- package/build/services/connector/factory.d.ts +14 -0
- package/build/services/connector/factory.js +22 -2
- package/build/services/connector/index.d.ts +13 -1
- package/build/services/connector/index.js +13 -1
- package/build/services/connector/providers/postgres.js +7 -0
- package/build/services/engine/index.d.ts +162 -0
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.d.ts +27 -0
- package/build/services/exporter/index.js +1 -1
- package/build/services/hotmesh/index.d.ts +280 -0
- package/build/services/hotmesh/index.js +286 -0
- package/build/services/logger/index.js +1 -0
- package/build/services/mapper/index.d.ts +14 -0
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshcall/index.d.ts +171 -0
- package/build/services/meshcall/index.js +190 -0
- package/build/services/meshcall/schemas/factory.d.ts +7 -0
- package/build/services/meshcall/schemas/factory.js +7 -0
- package/build/services/meshdata/index.d.ts +725 -3
- package/build/services/meshdata/index.js +689 -3
- package/build/services/meshflow/client.d.ts +89 -0
- package/build/services/meshflow/client.js +173 -4
- package/build/services/meshflow/connection.d.ts +17 -0
- package/build/services/meshflow/connection.js +17 -0
- package/build/services/meshflow/exporter.d.ts +22 -0
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/handle.d.ts +68 -0
- package/build/services/meshflow/handle.js +75 -0
- package/build/services/meshflow/index.d.ts +92 -0
- package/build/services/meshflow/index.js +92 -0
- package/build/services/meshflow/schemas/factory.d.ts +25 -0
- package/build/services/meshflow/schemas/factory.js +26 -1
- package/build/services/meshflow/search.d.ts +120 -0
- package/build/services/meshflow/search.js +108 -0
- package/build/services/meshflow/worker.d.ts +97 -0
- package/build/services/meshflow/worker.js +116 -2
- package/build/services/meshflow/workflow/all.d.ts +6 -0
- package/build/services/meshflow/workflow/all.js +7 -0
- package/build/services/meshflow/workflow/context.d.ts +4 -0
- package/build/services/meshflow/workflow/context.js +4 -0
- package/build/services/meshflow/workflow/didRun.d.ts +6 -0
- package/build/services/meshflow/workflow/didRun.js +6 -0
- package/build/services/meshflow/workflow/emit.d.ts +7 -0
- package/build/services/meshflow/workflow/emit.js +7 -0
- package/build/services/meshflow/workflow/enrich.d.ts +7 -0
- package/build/services/meshflow/workflow/enrich.js +7 -0
- package/build/services/meshflow/workflow/execChild.d.ts +14 -0
- package/build/services/meshflow/workflow/execChild.js +18 -0
- package/build/services/meshflow/workflow/hook.d.ts +7 -0
- package/build/services/meshflow/workflow/hook.js +7 -0
- package/build/services/meshflow/workflow/index.d.ts +31 -0
- package/build/services/meshflow/workflow/index.js +31 -0
- package/build/services/meshflow/workflow/interrupt.d.ts +7 -0
- package/build/services/meshflow/workflow/interrupt.js +7 -0
- package/build/services/meshflow/workflow/isSideEffectAllowed.d.ts +8 -0
- package/build/services/meshflow/workflow/isSideEffectAllowed.js +8 -0
- package/build/services/meshflow/workflow/proxyActivities.d.ts +14 -0
- package/build/services/meshflow/workflow/proxyActivities.js +18 -3
- package/build/services/meshflow/workflow/random.d.ts +5 -0
- package/build/services/meshflow/workflow/random.js +5 -0
- package/build/services/meshflow/workflow/searchMethods.d.ts +4 -0
- package/build/services/meshflow/workflow/searchMethods.js +4 -0
- package/build/services/meshflow/workflow/signal.d.ts +6 -0
- package/build/services/meshflow/workflow/signal.js +6 -0
- package/build/services/meshflow/workflow/sleepFor.d.ts +7 -0
- package/build/services/meshflow/workflow/sleepFor.js +7 -0
- package/build/services/meshflow/workflow/trace.d.ts +10 -0
- package/build/services/meshflow/workflow/trace.js +10 -0
- package/build/services/meshflow/workflow/waitFor.d.ts +7 -0
- package/build/services/meshflow/workflow/waitFor.js +7 -0
- package/build/services/meshos/index.d.ts +213 -2
- package/build/services/meshos/index.js +221 -1
- package/build/services/pipe/functions/array.js +1 -1
- package/build/services/pipe/functions/bitwise.js +1 -1
- package/build/services/pipe/functions/conditional.js +1 -1
- package/build/services/pipe/functions/cron.d.ts +6 -0
- package/build/services/pipe/functions/cron.js +1 -1
- package/build/services/pipe/functions/date.d.ts +7 -0
- package/build/services/pipe/functions/date.js +1 -1
- package/build/services/pipe/functions/index.js +1 -1
- package/build/services/pipe/functions/json.js +1 -1
- package/build/services/pipe/functions/logical.js +1 -1
- package/build/services/pipe/functions/math.js +1 -1
- package/build/services/pipe/functions/number.js +1 -1
- package/build/services/pipe/functions/object.js +1 -1
- package/build/services/pipe/functions/string.js +1 -1
- package/build/services/pipe/functions/symbol.js +1 -1
- package/build/services/pipe/functions/unary.js +1 -1
- package/build/services/pipe/index.d.ts +15 -0
- package/build/services/pipe/index.js +1 -1
- package/build/services/quorum/index.d.ts +49 -0
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.d.ts +5 -0
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.d.ts +10 -0
- package/build/services/router/index.js +1 -1
- package/build/services/search/providers/postgres/postgres.d.ts +3 -0
- package/build/services/search/providers/postgres/postgres.js +1 -1
- package/build/services/search/providers/redis/ioredis.js +1 -1
- package/build/services/search/providers/redis/redis.js +1 -1
- package/build/services/serializer/index.js +1 -1
- package/build/services/store/cache.d.ts +19 -0
- package/build/services/store/cache.js +19 -0
- package/build/services/store/factory.js +1 -1
- package/build/services/store/providers/postgres/kvsql.d.ts +7 -0
- package/build/services/store/providers/postgres/kvsql.js +1 -1
- package/build/services/store/providers/postgres/kvtables.d.ts +4 -0
- package/build/services/store/providers/postgres/kvtables.js +1 -1
- package/build/services/store/providers/postgres/kvtransaction.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/hash.d.ts +4 -0
- package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
- package/build/services/store/providers/postgres/postgres.d.ts +48 -1
- package/build/services/store/providers/postgres/postgres.js +1 -1
- package/build/services/store/providers/redis/_base.d.ts +42 -0
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.d.ts +8 -0
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.d.ts +6 -0
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/factory.js +2 -1
- package/build/services/stream/index.d.ts +4 -0
- package/build/services/stream/providers/nats/nats.js +1 -1
- package/build/services/stream/providers/postgres/kvtables.js +1 -1
- package/build/services/stream/providers/postgres/postgres.d.ts +21 -0
- package/build/services/stream/providers/postgres/postgres.js +1 -1
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/providers/nats/nats.js +1 -1
- package/build/services/sub/providers/postgres/postgres.js +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.d.ts +9 -0
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.d.ts +7 -0
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.d.ts +37 -0
- package/build/services/worker/index.js +1 -1
- package/build/types/activity.d.ts +81 -0
- package/build/types/exporter.d.ts +13 -0
- package/build/types/hotmesh.d.ts +144 -0
- package/build/types/hotmesh.js +3 -0
- package/build/types/job.d.ts +101 -0
- package/build/types/manifest.d.ts +8 -0
- package/build/types/meshcall.d.ts +148 -0
- package/build/types/meshdata.d.ts +193 -0
- package/build/types/meshflow.d.ts +297 -0
- package/build/types/nats.d.ts +55 -0
- package/build/types/pipe.d.ts +65 -0
- package/build/types/provider.d.ts +43 -0
- package/build/types/quorum.d.ts +12 -0
- package/build/types/redis.d.ts +6 -0
- package/build/types/stream.d.ts +65 -0
- package/build/types/stream.js +4 -0
- package/index.ts +8 -1
- package/package.json +6 -4
- package/types/manifest.ts +2 -2
- package/types/meshcall.ts +1 -2
- 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
|
-
|
|
18
|
-
|
|
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"));
|
package/build/modules/enums.d.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/build/modules/enums.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
29
|
-
exports.
|
|
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
|
-
|
|
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);
|
package/build/modules/key.d.ts
CHANGED
|
@@ -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
|
}
|
package/build/modules/key.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const j=b;(function(c,d){const i=b,e=c();while(!![]){try{const f
|
|
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;
|
package/build/modules/utils.d.ts
CHANGED
|
@@ -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>[];
|
package/build/modules/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
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();}
|