@hotmeshio/hotmesh 0.3.6 → 0.3.7
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 +2 -1
- package/build/index.js +7 -1
- package/build/modules/key.js +1 -62
- package/build/modules/utils.js +1 -267
- package/build/package.json +12 -8
- package/build/services/activities/activity.js +1 -495
- package/build/services/activities/await.js +1 -109
- package/build/services/activities/cycle.js +1 -96
- package/build/services/activities/hook.js +1 -154
- package/build/services/activities/index.js +1 -20
- package/build/services/activities/interrupt.js +1 -149
- package/build/services/activities/signal.js +1 -118
- package/build/services/activities/trigger.js +1 -237
- package/build/services/activities/worker.js +1 -101
- package/build/services/collator/index.js +1 -197
- package/build/services/compiler/deployer.d.ts +3 -1
- package/build/services/compiler/deployer.js +1 -455
- package/build/services/compiler/index.d.ts +3 -1
- package/build/services/compiler/index.js +1 -91
- package/build/services/compiler/validator.js +1 -122
- package/build/services/engine/index.d.ts +5 -2
- package/build/services/engine/index.js +1 -562
- package/build/services/exporter/index.js +1 -93
- package/build/services/mapper/index.js +1 -67
- package/build/services/meshdata/index.d.ts +0 -1
- package/build/services/meshdata/index.js +16 -24
- package/build/services/meshflow/client.js +4 -8
- package/build/services/meshflow/exporter.js +1 -186
- package/build/services/meshflow/search.d.ts +4 -5
- package/build/services/meshflow/search.js +45 -35
- package/build/services/meshflow/workflow.d.ts +1 -1
- package/build/services/meshflow/workflow.js +3 -28
- package/build/services/pipe/functions/array.js +1 -74
- package/build/services/pipe/functions/bitwise.js +1 -24
- package/build/services/pipe/functions/conditional.js +1 -36
- package/build/services/pipe/functions/cron.js +1 -32
- package/build/services/pipe/functions/date.js +1 -164
- package/build/services/pipe/functions/index.js +1 -30
- package/build/services/pipe/functions/json.js +1 -12
- package/build/services/pipe/functions/logical.js +1 -12
- package/build/services/pipe/functions/math.js +1 -182
- package/build/services/pipe/functions/number.js +1 -60
- package/build/services/pipe/functions/object.js +1 -81
- package/build/services/pipe/functions/string.js +1 -69
- package/build/services/pipe/functions/symbol.js +1 -33
- package/build/services/pipe/functions/unary.js +1 -18
- package/build/services/pipe/index.js +1 -221
- package/build/services/quorum/index.d.ts +1 -1
- package/build/services/quorum/index.js +1 -219
- package/build/services/reporter/index.js +1 -331
- package/build/services/router/index.js +1 -420
- package/build/services/search/factory.d.ts +7 -0
- package/build/services/search/factory.js +20 -0
- package/build/services/search/index.d.ts +21 -0
- package/build/services/search/index.js +10 -0
- package/build/services/search/providers/redis/ioredis.d.ts +18 -0
- package/build/services/search/providers/redis/ioredis.js +1 -0
- package/build/services/search/providers/redis/redis.d.ts +18 -0
- package/build/services/search/providers/redis/redis.js +1 -0
- package/build/services/serializer/index.js +1 -265
- package/build/services/store/factory.d.ts +2 -1
- package/build/services/store/factory.js +2 -2
- package/build/services/store/index.d.ts +71 -97
- package/build/services/store/index.js +2 -939
- package/build/services/store/providers/postgres/postgres.d.ts +0 -0
- package/build/services/store/providers/postgres/postgres.js +0 -0
- package/build/services/store/providers/postgres/types/hash.d.ts +0 -0
- package/build/services/store/providers/postgres/types/hash.js +0 -0
- package/build/services/store/providers/postgres/types/list.d.ts +0 -0
- package/build/services/store/providers/postgres/types/list.js +0 -0
- package/build/services/store/providers/postgres/types/string.d.ts +0 -0
- package/build/services/store/providers/postgres/types/string.js +0 -0
- package/build/services/store/providers/postgres/types/zset.d.ts +0 -0
- package/build/services/store/providers/postgres/types/zset.js +0 -0
- package/build/services/store/providers/redis/_base.d.ts +98 -0
- package/build/services/store/providers/redis/_base.js +1 -0
- package/build/services/store/providers/redis/ioredis.d.ts +12 -0
- package/build/services/store/providers/redis/ioredis.js +1 -0
- package/build/services/store/providers/redis/redis.d.ts +13 -0
- package/build/services/store/providers/redis/redis.js +1 -0
- package/build/services/store/providers/store-initializable.d.ts +5 -0
- package/build/services/store/providers/store-initializable.js +1 -0
- package/build/services/stream/factory.d.ts +2 -1
- package/build/services/stream/factory.js +5 -5
- package/build/services/stream/index.d.ts +13 -14
- package/build/services/stream/index.js +3 -2
- package/build/services/stream/providers/postgres/_deploy.d.ts +4 -0
- package/build/services/stream/providers/postgres/_deploy.js +1 -0
- package/build/services/stream/providers/redis/ioredis.d.ts +21 -0
- package/build/services/stream/providers/redis/ioredis.js +1 -0
- package/build/services/stream/providers/redis/redis.d.ts +21 -0
- package/build/services/stream/providers/redis/redis.js +1 -0
- package/build/services/stream/providers/stream-initializable.d.ts +5 -0
- package/build/services/stream/providers/stream-initializable.js +1 -0
- package/build/services/sub/factory.d.ts +1 -1
- package/build/services/sub/factory.js +5 -5
- package/build/services/sub/index.d.ts +9 -7
- package/build/services/sub/index.js +3 -2
- package/build/services/sub/{clients → providers/redis}/ioredis.d.ts +7 -10
- package/build/services/sub/providers/redis/ioredis.js +1 -0
- package/build/services/sub/{clients → providers/redis}/redis.d.ts +7 -10
- package/build/services/sub/providers/redis/redis.js +1 -0
- package/build/services/task/index.js +1 -171
- package/build/services/telemetry/index.js +1 -225
- package/build/services/worker/index.d.ts +2 -2
- package/build/services/worker/index.js +1 -158
- package/build/types/redis.d.ts +5 -5
- package/index.ts +15 -1
- package/package.json +12 -8
- package/types/redis.ts +5 -5
- package/build/services/store/clients/ioredis.d.ts +0 -30
- package/build/services/store/clients/ioredis.js +0 -220
- package/build/services/store/clients/redis.d.ts +0 -32
- package/build/services/store/clients/redis.js +0 -319
- package/build/services/stream/clients/ioredis.d.ts +0 -24
- package/build/services/stream/clients/ioredis.js +0 -121
- package/build/services/stream/clients/redis.d.ts +0 -24
- package/build/services/stream/clients/redis.js +0 -161
- package/build/services/sub/clients/ioredis.js +0 -72
- package/build/services/sub/clients/redis.js +0 -63
package/build/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ import { MeshCall } from './services/meshcall';
|
|
|
4
4
|
import { MeshFlow } from './services/meshflow';
|
|
5
5
|
import { MeshData } from './services/meshdata';
|
|
6
6
|
import { MeshOS } from './services/meshos';
|
|
7
|
-
|
|
7
|
+
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;
|
|
8
|
+
export { HotMesh, HotMeshConfig, MeshCall, MeshData, MeshOS, MeshFlow, Client, Connection, Search, Worker, workflow, };
|
|
8
9
|
export * as Types from './types';
|
package/build/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Types = exports.
|
|
26
|
+
exports.Types = exports.workflow = exports.Worker = exports.Search = exports.Connection = exports.Client = exports.MeshFlow = exports.MeshOS = exports.MeshData = exports.MeshCall = exports.HotMesh = 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");
|
|
@@ -34,4 +34,10 @@ const meshdata_1 = require("./services/meshdata");
|
|
|
34
34
|
Object.defineProperty(exports, "MeshData", { enumerable: true, get: function () { return meshdata_1.MeshData; } });
|
|
35
35
|
const meshos_1 = require("./services/meshos");
|
|
36
36
|
Object.defineProperty(exports, "MeshOS", { enumerable: true, get: function () { return meshos_1.MeshOS; } });
|
|
37
|
+
const { Client, Connection, Search, Worker, workflow } = meshflow_1.MeshFlow;
|
|
38
|
+
exports.Client = Client;
|
|
39
|
+
exports.Connection = Connection;
|
|
40
|
+
exports.Search = Search;
|
|
41
|
+
exports.Worker = Worker;
|
|
42
|
+
exports.workflow = workflow;
|
|
37
43
|
exports.Types = __importStar(require("./types"));
|
package/build/modules/key.js
CHANGED
|
@@ -1,62 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VALSEP = exports.WEBSEP = exports.TYPSEP = exports.KEYSEP = exports.HMNS = exports.KeyType = exports.KeyService = void 0;
|
|
4
|
-
const hotmesh_1 = require("../types/hotmesh");
|
|
5
|
-
Object.defineProperty(exports, "KeyType", { enumerable: true, get: function () { return hotmesh_1.KeyType; } });
|
|
6
|
-
const HMNS = 'hmsh';
|
|
7
|
-
exports.HMNS = HMNS;
|
|
8
|
-
const KEYSEP = ':';
|
|
9
|
-
exports.KEYSEP = KEYSEP;
|
|
10
|
-
const VALSEP = '::';
|
|
11
|
-
exports.VALSEP = VALSEP;
|
|
12
|
-
const WEBSEP = '::';
|
|
13
|
-
exports.WEBSEP = WEBSEP;
|
|
14
|
-
const TYPSEP = '::';
|
|
15
|
-
exports.TYPSEP = TYPSEP;
|
|
16
|
-
class KeyService {
|
|
17
|
-
static mintKey(namespace, keyType, params) {
|
|
18
|
-
switch (keyType) {
|
|
19
|
-
case hotmesh_1.KeyType.HOTMESH:
|
|
20
|
-
return namespace;
|
|
21
|
-
case hotmesh_1.KeyType.THROTTLE_RATE:
|
|
22
|
-
return `${namespace}:${params.appId}:r:`;
|
|
23
|
-
case hotmesh_1.KeyType.WORK_ITEMS:
|
|
24
|
-
return `${namespace}:${params.appId}:w:${params.scoutType || ''}`;
|
|
25
|
-
case hotmesh_1.KeyType.TIME_RANGE:
|
|
26
|
-
return `${namespace}:${params.appId}:t:${params.timeValue || ''}`;
|
|
27
|
-
case hotmesh_1.KeyType.APP:
|
|
28
|
-
return `${namespace}:a:${params.appId || ''}`;
|
|
29
|
-
case hotmesh_1.KeyType.QUORUM:
|
|
30
|
-
return `${namespace}:${params.appId}:q:${params.engineId || ''}`;
|
|
31
|
-
case hotmesh_1.KeyType.JOB_STATE:
|
|
32
|
-
return `${namespace}:${params.appId}:j:${params.jobId}`;
|
|
33
|
-
case hotmesh_1.KeyType.JOB_DEPENDENTS:
|
|
34
|
-
return `${namespace}:${params.appId}:d:${params.jobId}`;
|
|
35
|
-
case hotmesh_1.KeyType.JOB_STATS_GENERAL:
|
|
36
|
-
return `${namespace}:${params.appId}:s:${params.jobKey}:${params.dateTime}`;
|
|
37
|
-
case hotmesh_1.KeyType.JOB_STATS_MEDIAN:
|
|
38
|
-
return `${namespace}:${params.appId}:s:${params.jobKey}:${params.dateTime}:${params.facet}`;
|
|
39
|
-
case hotmesh_1.KeyType.JOB_STATS_INDEX:
|
|
40
|
-
return `${namespace}:${params.appId}:s:${params.jobKey}:${params.dateTime}:${params.facet}`;
|
|
41
|
-
case hotmesh_1.KeyType.SCHEMAS:
|
|
42
|
-
return `${namespace}:${params.appId}:v:${params.appVersion}:schemas`;
|
|
43
|
-
case hotmesh_1.KeyType.SUBSCRIPTIONS:
|
|
44
|
-
return `${namespace}:${params.appId}:v:${params.appVersion}:subscriptions`;
|
|
45
|
-
case hotmesh_1.KeyType.SUBSCRIPTION_PATTERNS:
|
|
46
|
-
return `${namespace}:${params.appId}:v:${params.appVersion}:transitions`;
|
|
47
|
-
case hotmesh_1.KeyType.HOOKS:
|
|
48
|
-
return `${namespace}:${params.appId}:hooks`;
|
|
49
|
-
case hotmesh_1.KeyType.SIGNALS:
|
|
50
|
-
return `${namespace}:${params.appId}:signals`;
|
|
51
|
-
case hotmesh_1.KeyType.SYMKEYS:
|
|
52
|
-
return `${namespace}:${params.appId}:sym:keys:${params.activityId || ''}`;
|
|
53
|
-
case hotmesh_1.KeyType.SYMVALS:
|
|
54
|
-
return `${namespace}:${params.appId}:sym:vals:`;
|
|
55
|
-
case hotmesh_1.KeyType.STREAMS:
|
|
56
|
-
return `${namespace}:${params.appId || ''}:x:${params.topic || ''}`;
|
|
57
|
-
default:
|
|
58
|
-
throw new Error('Invalid key type.');
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.KeyService = KeyService;
|
|
1
|
+
'use strict';(function(_0x1b5b15,_0x3166a7){const _0x4c34ca=_0x25b0,_0x425a1e=_0x1b5b15();while(!![]){try{const _0x14c6a7=-parseInt(_0x4c34ca(0x197))/0x1+parseInt(_0x4c34ca(0x18f))/0x2*(-parseInt(_0x4c34ca(0x195))/0x3)+parseInt(_0x4c34ca(0x194))/0x4*(parseInt(_0x4c34ca(0x191))/0x5)+-parseInt(_0x4c34ca(0x190))/0x6+-parseInt(_0x4c34ca(0x192))/0x7+parseInt(_0x4c34ca(0x193))/0x8+parseInt(_0x4c34ca(0x196))/0x9;if(_0x14c6a7===_0x3166a7)break;else _0x425a1e['push'](_0x425a1e['shift']());}catch(_0x5f1395){_0x425a1e['push'](_0x425a1e['shift']());}}}(_0x1843,0x602bd));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['VALSEP']=exports['WEBSEP']=exports['TYPSEP']=exports['KEYSEP']=exports['HMNS']=exports['KeyType']=exports['KeyService']=void 0x0;const hotmesh_1=require('../types/hotmesh');Object['defineProperty'](exports,'KeyType',{'enumerable':!![],'get':function(){return hotmesh_1['KeyType'];}});const HMNS='hmsh';exports['HMNS']=HMNS;const KEYSEP=':';exports['KEYSEP']=KEYSEP;const VALSEP='::';exports['VALSEP']=VALSEP;const WEBSEP='::';exports['WEBSEP']=WEBSEP;const TYPSEP='::';exports['TYPSEP']=TYPSEP;function _0x1843(){const _0x1c0135=['1115947ryXEvH','458456WaAiXf','4cWINTF','1136283iXkjUQ','20633220AyHgyh','740210tmqDZw','2upACKK','4242372nzJRHT','147420jETNoD'];_0x1843=function(){return _0x1c0135;};return _0x1843();}function _0x25b0(_0x3a066d,_0x304d03){const _0x1843db=_0x1843();return _0x25b0=function(_0x25b0ce,_0x349d14){_0x25b0ce=_0x25b0ce-0x18f;let _0x1b9307=_0x1843db[_0x25b0ce];return _0x1b9307;},_0x25b0(_0x3a066d,_0x304d03);}class KeyService{static['mintKey'](_0x216e4d,_0x53d1a9,_0x5a65de){switch(_0x53d1a9){case hotmesh_1['KeyType']['HOTMESH']:return _0x216e4d;case hotmesh_1['KeyType']['THROTTLE_RATE']:return _0x216e4d+':'+_0x5a65de['appId']+':r:';case hotmesh_1['KeyType']['WORK_ITEMS']:return _0x216e4d+':'+_0x5a65de['appId']+':w:'+(_0x5a65de['scoutType']||'');case hotmesh_1['KeyType']['TIME_RANGE']:return _0x216e4d+':'+_0x5a65de['appId']+':t:'+(_0x5a65de['timeValue']||'');case hotmesh_1['KeyType']['APP']:return _0x216e4d+':a:'+(_0x5a65de['appId']||'');case hotmesh_1['KeyType']['QUORUM']:return _0x216e4d+':'+_0x5a65de['appId']+':q:'+(_0x5a65de['engineId']||'');case hotmesh_1['KeyType']['JOB_STATE']:return _0x216e4d+':'+_0x5a65de['appId']+':j:'+_0x5a65de['jobId'];case hotmesh_1['KeyType']['JOB_DEPENDENTS']:return _0x216e4d+':'+_0x5a65de['appId']+':d:'+_0x5a65de['jobId'];case hotmesh_1['KeyType']['JOB_STATS_GENERAL']:return _0x216e4d+':'+_0x5a65de['appId']+':s:'+_0x5a65de['jobKey']+':'+_0x5a65de['dateTime'];case hotmesh_1['KeyType']['JOB_STATS_MEDIAN']:return _0x216e4d+':'+_0x5a65de['appId']+':s:'+_0x5a65de['jobKey']+':'+_0x5a65de['dateTime']+':'+_0x5a65de['facet'];case hotmesh_1['KeyType']['JOB_STATS_INDEX']:return _0x216e4d+':'+_0x5a65de['appId']+':s:'+_0x5a65de['jobKey']+':'+_0x5a65de['dateTime']+':'+_0x5a65de['facet'];case hotmesh_1['KeyType']['SCHEMAS']:return _0x216e4d+':'+_0x5a65de['appId']+':v:'+_0x5a65de['appVersion']+':schemas';case hotmesh_1['KeyType']['SUBSCRIPTIONS']:return _0x216e4d+':'+_0x5a65de['appId']+':v:'+_0x5a65de['appVersion']+':subscriptions';case hotmesh_1['KeyType']['SUBSCRIPTION_PATTERNS']:return _0x216e4d+':'+_0x5a65de['appId']+':v:'+_0x5a65de['appVersion']+':transitions';case hotmesh_1['KeyType']['HOOKS']:return _0x216e4d+':'+_0x5a65de['appId']+':hooks';case hotmesh_1['KeyType']['SIGNALS']:return _0x216e4d+':'+_0x5a65de['appId']+':signals';case hotmesh_1['KeyType']['SYMKEYS']:return _0x216e4d+':'+_0x5a65de['appId']+':sym:keys:'+(_0x5a65de['activityId']||'');case hotmesh_1['KeyType']['SYMVALS']:return _0x216e4d+':'+_0x5a65de['appId']+':sym:vals:';case hotmesh_1['KeyType']['STREAMS']:return _0x216e4d+':'+(_0x5a65de['appId']||'')+':x:'+(_0x5a65de['topic']||'');default:throw new Error('Invalid\x20key\x20type.');}}}exports['KeyService']=KeyService;
|
package/build/modules/utils.js
CHANGED
|
@@ -1,267 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.arrayToHash = exports.s = exports.isValidCron = exports.restoreHierarchy = exports.getValueByPath = exports.getIndexedHash = exports.getSymVal = exports.getSymKey = exports.formatISODate = exports.getTimeSeries = exports.getSubscriptionTopic = exports.findSubscriptionForTrigger = exports.findTopKey = exports.matchesStatus = exports.matchesStatusCode = exports.identifyRedisTypeFromClass = exports.polyfill = exports.identifyRedisType = exports.XSleepFor = exports.sleepImmediate = exports.sleepFor = exports.guid = exports.deterministicRandom = exports.deepCopy = exports.getSystemHealth = exports.hashOptions = void 0;
|
|
7
|
-
const os_1 = __importDefault(require("os"));
|
|
8
|
-
const crypto_1 = require("crypto");
|
|
9
|
-
const nanoid_1 = require("nanoid");
|
|
10
|
-
const ms_1 = __importDefault(require("ms"));
|
|
11
|
-
const enums_1 = require("./enums");
|
|
12
|
-
const hashOptions = (options) => {
|
|
13
|
-
const str = JSON.stringify(options);
|
|
14
|
-
return (0, crypto_1.createHash)('sha256').update(str).digest('hex');
|
|
15
|
-
};
|
|
16
|
-
exports.hashOptions = hashOptions;
|
|
17
|
-
async function getSystemHealth() {
|
|
18
|
-
const totalMemory = os_1.default.totalmem();
|
|
19
|
-
const freeMemory = os_1.default.freemem();
|
|
20
|
-
const usedMemory = totalMemory - freeMemory;
|
|
21
|
-
const systemHealth = {
|
|
22
|
-
TotalMemoryGB: `${(totalMemory / 1024 / 1024 / 1024).toFixed(2)} GB`,
|
|
23
|
-
FreeMemoryGB: `${(freeMemory / 1024 / 1024 / 1024).toFixed(2)} GB`,
|
|
24
|
-
UsedMemoryGB: `${(usedMemory / 1024 / 1024 / 1024).toFixed(2)} GB`,
|
|
25
|
-
CPULoad: [],
|
|
26
|
-
NetworkStats: [],
|
|
27
|
-
};
|
|
28
|
-
return systemHealth;
|
|
29
|
-
}
|
|
30
|
-
exports.getSystemHealth = getSystemHealth;
|
|
31
|
-
function deepCopy(obj) {
|
|
32
|
-
return JSON.parse(JSON.stringify(obj));
|
|
33
|
-
}
|
|
34
|
-
exports.deepCopy = deepCopy;
|
|
35
|
-
function deterministicRandom(seed) {
|
|
36
|
-
const x = Math.sin(seed) * 10000;
|
|
37
|
-
return x - Math.floor(x);
|
|
38
|
-
}
|
|
39
|
-
exports.deterministicRandom = deterministicRandom;
|
|
40
|
-
function guid(size = enums_1.HMSH_GUID_SIZE) {
|
|
41
|
-
return `H` + (0, nanoid_1.nanoid)(size);
|
|
42
|
-
}
|
|
43
|
-
exports.guid = guid;
|
|
44
|
-
async function sleepFor(ms) {
|
|
45
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
46
|
-
}
|
|
47
|
-
exports.sleepFor = sleepFor;
|
|
48
|
-
function sleepImmediate() {
|
|
49
|
-
return new Promise((resolve) => setImmediate(resolve));
|
|
50
|
-
}
|
|
51
|
-
exports.sleepImmediate = sleepImmediate;
|
|
52
|
-
function XSleepFor(ms) {
|
|
53
|
-
let timerId;
|
|
54
|
-
const promise = new Promise((resolve) => {
|
|
55
|
-
timerId = setTimeout(resolve, ms);
|
|
56
|
-
});
|
|
57
|
-
return { promise, timerId };
|
|
58
|
-
}
|
|
59
|
-
exports.XSleepFor = XSleepFor;
|
|
60
|
-
function identifyRedisType(redisInstance) {
|
|
61
|
-
const prototype = Object.getPrototypeOf(redisInstance);
|
|
62
|
-
if ('defineCommand' in prototype ||
|
|
63
|
-
Object.keys(prototype).includes('multi')) {
|
|
64
|
-
return 'ioredis';
|
|
65
|
-
}
|
|
66
|
-
else if (Object.keys(prototype).includes('Multi')) {
|
|
67
|
-
return 'redis';
|
|
68
|
-
}
|
|
69
|
-
if (redisInstance.constructor) {
|
|
70
|
-
if (redisInstance.constructor.name === 'Redis' ||
|
|
71
|
-
redisInstance.constructor.name === 'EventEmitter') {
|
|
72
|
-
if ('hset' in redisInstance) {
|
|
73
|
-
return 'ioredis';
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
else if (redisInstance.constructor.name === 'RedisClient' ||
|
|
77
|
-
redisInstance.constructor.name === 'Commander') {
|
|
78
|
-
if ('HSET' in redisInstance) {
|
|
79
|
-
return 'redis';
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
exports.identifyRedisType = identifyRedisType;
|
|
86
|
-
exports.polyfill = {
|
|
87
|
-
resolveActivityType(activityType) {
|
|
88
|
-
if (activityType === 'activity') {
|
|
89
|
-
return 'hook';
|
|
90
|
-
}
|
|
91
|
-
return activityType;
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
function identifyRedisTypeFromClass(redisClass) {
|
|
95
|
-
if (redisClass && redisClass.name === 'Redis' ||
|
|
96
|
-
redisClass.name === 'EventEmitter') {
|
|
97
|
-
return 'ioredis';
|
|
98
|
-
}
|
|
99
|
-
else if (redisClass && 'createClient' in redisClass) {
|
|
100
|
-
return 'redis';
|
|
101
|
-
}
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
exports.identifyRedisTypeFromClass = identifyRedisTypeFromClass;
|
|
105
|
-
function matchesStatusCode(code, pattern) {
|
|
106
|
-
if (typeof pattern === 'string') {
|
|
107
|
-
const regexPattern = `^${pattern.replace(/\*/g, '\\d')}$`;
|
|
108
|
-
return new RegExp(regexPattern).test(code.toString());
|
|
109
|
-
}
|
|
110
|
-
return pattern.test(code.toString());
|
|
111
|
-
}
|
|
112
|
-
exports.matchesStatusCode = matchesStatusCode;
|
|
113
|
-
function matchesStatus(status, targetStatus) {
|
|
114
|
-
return status === targetStatus;
|
|
115
|
-
}
|
|
116
|
-
exports.matchesStatus = matchesStatus;
|
|
117
|
-
function findTopKey(obj, input) {
|
|
118
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
119
|
-
if (value.hasOwnProperty(input)) {
|
|
120
|
-
const parentKey = findTopKey(obj, key.replace(/^\./, ''));
|
|
121
|
-
return (parentKey || key).replace(/^\./, '');
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
exports.findTopKey = findTopKey;
|
|
127
|
-
function findSubscriptionForTrigger(obj, value) {
|
|
128
|
-
for (const [key, itemValue] of Object.entries(obj)) {
|
|
129
|
-
if (itemValue === value) {
|
|
130
|
-
return key;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
exports.findSubscriptionForTrigger = findSubscriptionForTrigger;
|
|
136
|
-
async function getSubscriptionTopic(activityId, store, appVID) {
|
|
137
|
-
const appTransitions = await store.getTransitions(appVID);
|
|
138
|
-
const appSubscriptions = await store.getSubscriptions(appVID);
|
|
139
|
-
const triggerId = findTopKey(appTransitions, activityId);
|
|
140
|
-
const topic = findSubscriptionForTrigger(appSubscriptions, triggerId);
|
|
141
|
-
return topic;
|
|
142
|
-
}
|
|
143
|
-
exports.getSubscriptionTopic = getSubscriptionTopic;
|
|
144
|
-
function getTimeSeries(granularity) {
|
|
145
|
-
if (granularity.toString() === 'infinity') {
|
|
146
|
-
return '0';
|
|
147
|
-
}
|
|
148
|
-
const now = new Date();
|
|
149
|
-
const granularityUnit = granularity.slice(-1);
|
|
150
|
-
const granularityValue = parseInt(granularity.slice(0, -1), 10);
|
|
151
|
-
if (granularityUnit === 'm') {
|
|
152
|
-
const minute = Math.floor(now.getMinutes() / granularityValue) * granularityValue;
|
|
153
|
-
now.setUTCMinutes(minute, 0, 0);
|
|
154
|
-
}
|
|
155
|
-
else if (granularityUnit === 'h') {
|
|
156
|
-
now.setUTCMinutes(0, 0, 0);
|
|
157
|
-
}
|
|
158
|
-
return now
|
|
159
|
-
.toISOString()
|
|
160
|
-
.replace(/:\d\d\..+|-|T/g, '')
|
|
161
|
-
.replace(':', '');
|
|
162
|
-
}
|
|
163
|
-
exports.getTimeSeries = getTimeSeries;
|
|
164
|
-
function formatISODate(input) {
|
|
165
|
-
const date = input instanceof Date ? input : new Date(input);
|
|
166
|
-
return date.toISOString().replace(/[:TZ-]/g, '');
|
|
167
|
-
}
|
|
168
|
-
exports.formatISODate = formatISODate;
|
|
169
|
-
function getSymKey(number) {
|
|
170
|
-
const alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
171
|
-
const base = alphabet.length;
|
|
172
|
-
if (number < 0 || number >= Math.pow(base, 3)) {
|
|
173
|
-
throw new Error('Number out of range');
|
|
174
|
-
}
|
|
175
|
-
const [q1, r1] = divmod(number, base);
|
|
176
|
-
const [q2, r2] = divmod(q1, base);
|
|
177
|
-
return alphabet[q2] + alphabet[r1] + alphabet[r2];
|
|
178
|
-
}
|
|
179
|
-
exports.getSymKey = getSymKey;
|
|
180
|
-
function getSymVal(number) {
|
|
181
|
-
const alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
182
|
-
const base = alphabet.length;
|
|
183
|
-
if (number < 0 || number >= Math.pow(base, 2)) {
|
|
184
|
-
throw new Error('Number out of range');
|
|
185
|
-
}
|
|
186
|
-
const [q, r] = divmod(number, base);
|
|
187
|
-
return alphabet[q] + alphabet[r];
|
|
188
|
-
}
|
|
189
|
-
exports.getSymVal = getSymVal;
|
|
190
|
-
function divmod(m, n) {
|
|
191
|
-
return [Math.floor(m / n), m % n];
|
|
192
|
-
}
|
|
193
|
-
function getIndexedHash(hash, target) {
|
|
194
|
-
const index = hash[target] || 0;
|
|
195
|
-
const newHash = { ...hash };
|
|
196
|
-
delete newHash[target];
|
|
197
|
-
return [index, newHash];
|
|
198
|
-
}
|
|
199
|
-
exports.getIndexedHash = getIndexedHash;
|
|
200
|
-
function getValueByPath(obj, path) {
|
|
201
|
-
const pathParts = path.split('/');
|
|
202
|
-
let currentValue = obj;
|
|
203
|
-
for (const part of pathParts) {
|
|
204
|
-
if (currentValue[part] !== undefined) {
|
|
205
|
-
currentValue = currentValue[part];
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
return undefined;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return currentValue;
|
|
212
|
-
}
|
|
213
|
-
exports.getValueByPath = getValueByPath;
|
|
214
|
-
function restoreHierarchy(obj) {
|
|
215
|
-
const result = {};
|
|
216
|
-
for (const key in obj) {
|
|
217
|
-
if (obj[key] === undefined)
|
|
218
|
-
continue;
|
|
219
|
-
const keys = key.split('/');
|
|
220
|
-
let current = result;
|
|
221
|
-
for (let i = 0; i < keys.length; i++) {
|
|
222
|
-
if (i === keys.length - 1) {
|
|
223
|
-
current[keys[i]] = obj[key];
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
current[keys[i]] = current[keys[i]] || {};
|
|
227
|
-
current = current[keys[i]];
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return result;
|
|
232
|
-
}
|
|
233
|
-
exports.restoreHierarchy = restoreHierarchy;
|
|
234
|
-
function isValidCron(cronExpression) {
|
|
235
|
-
const cronRegex = /^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;
|
|
236
|
-
return cronRegex.test(cronExpression);
|
|
237
|
-
}
|
|
238
|
-
exports.isValidCron = isValidCron;
|
|
239
|
-
const s = (input) => {
|
|
240
|
-
return (0, ms_1.default)(input) / 1000;
|
|
241
|
-
};
|
|
242
|
-
exports.s = s;
|
|
243
|
-
const arrayToHash = (response) => {
|
|
244
|
-
const results = [];
|
|
245
|
-
let key;
|
|
246
|
-
for (let i = 1; i < response.length; i++) {
|
|
247
|
-
const row = response[i];
|
|
248
|
-
const result = {};
|
|
249
|
-
if (Array.isArray(row)) {
|
|
250
|
-
for (let j = 0; j < row.length; j += 2) {
|
|
251
|
-
const key = row[j];
|
|
252
|
-
const value = row[j + 1];
|
|
253
|
-
result[key] = value;
|
|
254
|
-
}
|
|
255
|
-
if (key) {
|
|
256
|
-
result.$ = key;
|
|
257
|
-
}
|
|
258
|
-
results.push(result);
|
|
259
|
-
key = undefined;
|
|
260
|
-
}
|
|
261
|
-
else {
|
|
262
|
-
key = row;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
return results;
|
|
266
|
-
};
|
|
267
|
-
exports.arrayToHash = arrayToHash;
|
|
1
|
+
'use strict';(function(_0xcf1d61,_0x403e0f){const _0x368667=_0x14b1,_0x4cd304=_0xcf1d61();while(!![]){try{const _0x341c64=parseInt(_0x368667(0x1bc))/0x1*(parseInt(_0x368667(0x1b8))/0x2)+parseInt(_0x368667(0x1bd))/0x3+parseInt(_0x368667(0x1be))/0x4+-parseInt(_0x368667(0x1ba))/0x5+-parseInt(_0x368667(0x1bb))/0x6*(parseInt(_0x368667(0x1bf))/0x7)+parseInt(_0x368667(0x1b9))/0x8+-parseInt(_0x368667(0x1b7))/0x9;if(_0x341c64===_0x403e0f)break;else _0x4cd304['push'](_0x4cd304['shift']());}catch(_0x163920){_0x4cd304['push'](_0x4cd304['shift']());}}}(_0x4d64,0x87b94));var __importDefault=this&&this['__importDefault']||function(_0x187eb5){return _0x187eb5&&_0x187eb5['__esModule']?_0x187eb5:{'default':_0x187eb5};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['identifyRedisTypeFromClass']=exports['polyfill']=exports['identifyRedisType']=exports['XSleepFor']=exports['sleepImmediate']=exports['sleepFor']=exports['guid']=exports['deterministicRandom']=exports['deepCopy']=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),enums_1=require('./enums'),hashOptions=_0x2a7856=>{const _0x4ffd3b=JSON['stringify'](_0x2a7856);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x4ffd3b)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x11d6f2=os_1['default']['totalmem'](),_0x4931ef=os_1['default']['freemem'](),_0x42bbe4=_0x11d6f2-_0x4931ef,_0x58282f={'TotalMemoryGB':(_0x11d6f2/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x4931ef/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x42bbe4/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x58282f;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x1df9f7){return JSON['parse'](JSON['stringify'](_0x1df9f7));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x4ba35b){const _0x16b8a9=Math['sin'](_0x4ba35b)*0x2710;return _0x16b8a9-Math['floor'](_0x16b8a9);}exports['deterministicRandom']=deterministicRandom;function guid(_0x6c4a80=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x6c4a80);}exports['guid']=guid;async function sleepFor(_0x87f190){return new Promise(_0x4af30d=>setTimeout(_0x4af30d,_0x87f190));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x1a817d=>setImmediate(_0x1a817d));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0x1c570f){let _0x4c308c;const _0x9a090b=new Promise(_0xfc61d1=>{_0x4c308c=setTimeout(_0xfc61d1,_0x1c570f);});return{'promise':_0x9a090b,'timerId':_0x4c308c};}exports['XSleepFor']=XSleepFor;function identifyRedisType(_0x4541d6){const _0x41038f=Object['getPrototypeOf'](_0x4541d6);if('defineCommand'in _0x41038f||Object['keys'](_0x41038f)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x41038f)['includes']('Multi'))return'redis';}if(_0x4541d6['constructor']){if(_0x4541d6['constructor']['name']==='Redis'||_0x4541d6['constructor']['name']==='EventEmitter'){if('hset'in _0x4541d6)return'ioredis';}else{if(_0x4541d6['constructor']['name']==='RedisClient'||_0x4541d6['constructor']['name']==='Commander'){if('HSET'in _0x4541d6)return'redis';}}}return null;}exports['identifyRedisType']=identifyRedisType,exports['polyfill']={'resolveActivityType'(_0x18e9da){if(_0x18e9da==='activity')return'hook';return _0x18e9da;}};function identifyRedisTypeFromClass(_0x363144){if(_0x363144&&_0x363144['name']==='Redis'||_0x363144['name']==='EventEmitter')return'ioredis';else{if(_0x363144&&'createClient'in _0x363144)return'redis';}return null;}exports['identifyRedisTypeFromClass']=identifyRedisTypeFromClass;function matchesStatusCode(_0x32f8c5,_0x54d6d2){if(typeof _0x54d6d2==='string'){const _0x70c9aa='^'+_0x54d6d2['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x70c9aa)['test'](_0x32f8c5['toString']());}return _0x54d6d2['test'](_0x32f8c5['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0xa4de7b,_0x2425e4){return _0xa4de7b===_0x2425e4;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x316eee,_0x2cfd16){for(const [_0x4f98e9,_0x2f4288]of Object['entries'](_0x316eee)){if(_0x2f4288['hasOwnProperty'](_0x2cfd16)){const _0x670e7f=findTopKey(_0x316eee,_0x4f98e9['replace'](/^\./,''));return(_0x670e7f||_0x4f98e9)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x5e13f4,_0x589d01){for(const [_0x2ba480,_0x9ff78b]of Object['entries'](_0x5e13f4)){if(_0x9ff78b===_0x589d01)return _0x2ba480;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x5348e4,_0x11709a,_0x2ac586){const _0x536710=await _0x11709a['getTransitions'](_0x2ac586),_0x4c2f10=await _0x11709a['getSubscriptions'](_0x2ac586),_0x25f945=findTopKey(_0x536710,_0x5348e4),_0xe869fc=findSubscriptionForTrigger(_0x4c2f10,_0x25f945);return _0xe869fc;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x4d134){if(_0x4d134['toString']()==='infinity')return'0';const _0x4180d5=new Date(),_0x47b5e3=_0x4d134['slice'](-0x1),_0x96db13=parseInt(_0x4d134['slice'](0x0,-0x1),0xa);if(_0x47b5e3==='m'){const _0x5803b3=Math['floor'](_0x4180d5['getMinutes']()/_0x96db13)*_0x96db13;_0x4180d5['setUTCMinutes'](_0x5803b3,0x0,0x0);}else _0x47b5e3==='h'&&_0x4180d5['setUTCMinutes'](0x0,0x0,0x0);return _0x4180d5['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x49e66b){const _0x257888=_0x49e66b instanceof Date?_0x49e66b:new Date(_0x49e66b);return _0x257888['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function _0x14b1(_0x3b7fdc,_0x1abcf2){const _0x4d64f7=_0x4d64();return _0x14b1=function(_0x14b11b,_0x412b00){_0x14b11b=_0x14b11b-0x1b7;let _0x5308c7=_0x4d64f7[_0x14b11b];return _0x5308c7;},_0x14b1(_0x3b7fdc,_0x1abcf2);}function getSymKey(_0x109c27){const _0x41ac34='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x365519=_0x41ac34['length'];if(_0x109c27<0x0||_0x109c27>=Math['pow'](_0x365519,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x3d239c,_0x475f55]=divmod(_0x109c27,_0x365519),[_0x19ab2f,_0x4faae0]=divmod(_0x3d239c,_0x365519);return _0x41ac34[_0x19ab2f]+_0x41ac34[_0x475f55]+_0x41ac34[_0x4faae0];}exports['getSymKey']=getSymKey;function getSymVal(_0x4383df){const _0x1ac339='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x2c34d4=_0x1ac339['length'];if(_0x4383df<0x0||_0x4383df>=Math['pow'](_0x2c34d4,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x283926,_0x428269]=divmod(_0x4383df,_0x2c34d4);return _0x1ac339[_0x283926]+_0x1ac339[_0x428269];}function _0x4d64(){const _0x122fe0=['1494951MHtFOy','2136044MPfwTW','22309TLqeEv','9187029hoTdJi','165772YGWEhR','3243904rDoSAr','2142945IxTxeE','180PGKhgy','8OOjxTg'];_0x4d64=function(){return _0x122fe0;};return _0x4d64();}exports['getSymVal']=getSymVal;function divmod(_0x147a16,_0x16face){return[Math['floor'](_0x147a16/_0x16face),_0x147a16%_0x16face];}function getIndexedHash(_0x1aecdc,_0x4b82d0){const _0x14d81b=_0x1aecdc[_0x4b82d0]||0x0,_0x9990e2={..._0x1aecdc};return delete _0x9990e2[_0x4b82d0],[_0x14d81b,_0x9990e2];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x38973d,_0x5af5f1){const _0x23fb7f=_0x5af5f1['split']('/');let _0x71a731=_0x38973d;for(const _0x5e5c9a of _0x23fb7f){if(_0x71a731[_0x5e5c9a]!==undefined)_0x71a731=_0x71a731[_0x5e5c9a];else return undefined;}return _0x71a731;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x88e71c){const _0x3e231a={};for(const _0x1f43d5 in _0x88e71c){if(_0x88e71c[_0x1f43d5]===undefined)continue;const _0x8fe31c=_0x1f43d5['split']('/');let _0x548208=_0x3e231a;for(let _0x352b39=0x0;_0x352b39<_0x8fe31c['length'];_0x352b39++){_0x352b39===_0x8fe31c['length']-0x1?_0x548208[_0x8fe31c[_0x352b39]]=_0x88e71c[_0x1f43d5]:(_0x548208[_0x8fe31c[_0x352b39]]=_0x548208[_0x8fe31c[_0x352b39]]||{},_0x548208=_0x548208[_0x8fe31c[_0x352b39]]);}}return _0x3e231a;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x428fab){const _0x2e65ae=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x2e65ae['test'](_0x428fab);}exports['isValidCron']=isValidCron;const s=_0x5d29c1=>{return(0x0,ms_1['default'])(_0x5d29c1)/0x3e8;};exports['s']=s;const arrayToHash=_0x24a9bd=>{const _0x3d7d78=[];let _0x51e1f0;for(let _0x48e712=0x1;_0x48e712<_0x24a9bd['length'];_0x48e712++){const _0x54d6f7=_0x24a9bd[_0x48e712],_0x42806c={};if(Array['isArray'](_0x54d6f7)){for(let _0x30856a=0x0;_0x30856a<_0x54d6f7['length'];_0x30856a+=0x2){const _0x5715d2=_0x54d6f7[_0x30856a],_0xc0a040=_0x54d6f7[_0x30856a+0x1];_0x42806c[_0x5715d2]=_0xc0a040;}_0x51e1f0&&(_0x42806c['$']=_0x51e1f0),_0x3d7d78['push'](_0x42806c),_0x51e1f0=undefined;}else _0x51e1f0=_0x54d6f7;}return _0x3d7d78;};exports['arrayToHash']=arrayToHash;
|
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/hotmesh",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Unbreakable Workflows",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "tsc --build tsconfig.json",
|
|
17
16
|
"clean": "rimraf ./build",
|
|
17
|
+
"build": "tsc --build tsconfig.json",
|
|
18
|
+
"obfuscate": "ts-node scripts/obfuscate.ts",
|
|
18
19
|
"clean-build": "npm run clean && npm run build",
|
|
20
|
+
"clean-build-obfuscate": "npm run clean-build && npm run obfuscate",
|
|
19
21
|
"lint": "eslint . --ext .ts",
|
|
20
22
|
"lint:fix": "eslint . --fix --ext .ts",
|
|
21
23
|
"start": "ts-node src/index.ts",
|
|
@@ -51,17 +53,18 @@
|
|
|
51
53
|
"test:quorum": "HMSH_IS_CLUSTER=true NODE_ENV=test jest ./tests/functional/quorum/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
52
54
|
"test:reclaim": "NODE_ENV=test jest ./tests/functional/reclaim/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
53
55
|
"test:redeploy": "NODE_ENV=test jest ./tests/functional/redeploy/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
56
|
+
"test:reporter": "NODE_ENV=test jest ./tests/unit/services/reporter/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
54
57
|
"test:reentrant": "NODE_ENV=test jest ./tests/functional/reentrant/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
55
58
|
"test:retry": "NODE_ENV=test jest ./tests/functional/retry/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
56
59
|
"test:sequence": "NODE_ENV=test jest ./tests/functional/sequence/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
57
60
|
"test:signal": "NODE_ENV=test jest ./tests/functional/signal/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
58
61
|
"test:status": "NODE_ENV=test jest ./tests/functional/status/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
59
|
-
"test:store:ioredis": "NODE_ENV=test jest ./tests/functional/store/
|
|
60
|
-
"test:store:redis": "NODE_ENV=test jest ./tests/functional/store/
|
|
61
|
-
"test:stream:ioredis": "NODE_ENV=test jest ./tests/functional/stream/
|
|
62
|
-
"test:stream:redis": "NODE_ENV=test jest ./tests/functional/stream/
|
|
63
|
-
"test:sub:ioredis": "NODE_ENV=test jest ./tests/functional/sub/
|
|
64
|
-
"test:sub:redis": "NODE_ENV=test jest ./tests/functional/sub/
|
|
62
|
+
"test:store:ioredis": "NODE_ENV=test jest ./tests/functional/store/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
63
|
+
"test:store:redis": "NODE_ENV=test jest ./tests/functional/store/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
64
|
+
"test:stream:ioredis": "NODE_ENV=test jest ./tests/functional/stream/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
65
|
+
"test:stream:redis": "NODE_ENV=test jest ./tests/functional/stream/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
66
|
+
"test:sub:ioredis": "NODE_ENV=test jest ./tests/functional/sub/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
67
|
+
"test:sub:redis": "NODE_ENV=test jest ./tests/functional/sub/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
65
68
|
"test:trigger": "NODE_ENV=test jest ./tests/unit/services/activities/trigger.test.ts --detectOpenHandles --forceExit --verbose",
|
|
66
69
|
"test:meshdata": "NODE_ENV=test HMSH_IS_CLUSTER=true jest ./tests/meshdata/index.test.ts --forceExit --verbose --detectOpenHandles",
|
|
67
70
|
"test:meshos": "NODE_ENV=test HMSH_IS_CLUSTER=true jest ./tests/meshos/index.test.ts --forceExit --verbose --detectOpenHandles",
|
|
@@ -100,6 +103,7 @@
|
|
|
100
103
|
"eslint-plugin-import": "^2.29.1",
|
|
101
104
|
"eslint-plugin-prettier": "^5.1.3",
|
|
102
105
|
"ioredis": "^5.3.2",
|
|
106
|
+
"javascript-obfuscator": "^4.1.1",
|
|
103
107
|
"jest": "^29.5.0",
|
|
104
108
|
"redis": "^4.6.13",
|
|
105
109
|
"rimraf": "^4.4.1",
|