@zyno-io/ts-server-foundation 26.712.36 → 26.712.725
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/dist/src/app/config.d.ts +1 -0
- package/dist/src/app/config.d.ts.map +1 -1
- package/dist/src/app/config.js +3 -1
- package/dist/src/app/config.js.map +1 -1
- package/dist/src/cli/tsf-install.d.ts.map +1 -1
- package/dist/src/cli/tsf-install.js +15 -15
- package/dist/src/cli/tsf-install.js.map +1 -1
- package/dist/src/database/database.js +1 -1
- package/dist/src/database/index.js +1 -1
- package/dist/src/database/metadata.js +1 -1
- package/dist/src/di/container.js +1 -1
- package/dist/src/helpers/availability.d.ts +17 -0
- package/dist/src/helpers/availability.d.ts.map +1 -0
- package/dist/src/helpers/availability.js +82 -0
- package/dist/src/helpers/availability.js.map +1 -0
- package/dist/src/helpers/index.d.ts +2 -0
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/index.js +3 -1
- package/dist/src/helpers/index.js.map +1 -1
- package/dist/src/helpers/redis/availability.d.ts +12 -0
- package/dist/src/helpers/redis/availability.d.ts.map +1 -0
- package/dist/src/helpers/redis/availability.js +27 -0
- package/dist/src/helpers/redis/availability.js.map +1 -0
- package/dist/src/helpers/redis/redis.d.ts.map +1 -1
- package/dist/src/helpers/redis/redis.js +4 -1
- package/dist/src/helpers/redis/redis.js.map +1 -1
- package/dist/src/http/index.js +1 -1
- package/dist/src/http/router.js +2 -2
- package/dist/src/http/workflow.js +1 -1
- package/dist/src/index.js +5 -5
- package/dist/src/openapi/schema.js +1 -1
- package/dist/src/openapi/serializer.js +1 -1
- package/dist/src/reflection/annotations.js +1 -1
- package/dist/src/reflection/deserializer.js +1 -1
- package/dist/src/reflection/index.js +1 -1
- package/dist/src/reflection/model.js +1 -1
- package/dist/src/reflection/reflection-class.js +3 -3
- package/dist/src/services/index.js +1 -1
- package/dist/src/services/worker/index.js +1 -1
- package/dist/src/services/worker/runner.d.ts +2 -0
- package/dist/src/services/worker/runner.d.ts.map +1 -1
- package/dist/src/services/worker/runner.js +53 -1
- package/dist/src/services/worker/runner.js.map +1 -1
- package/docs/content/configuration.md +19 -18
- package/docs/content/helpers.md +21 -1
- package/docs/content/public-api.md +1 -1
- package/docs/content/redis.md +21 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './availability';
|
|
1
2
|
export * from './async/context';
|
|
2
3
|
export * from './async/process';
|
|
3
4
|
export * from './async/promise';
|
|
@@ -7,6 +8,7 @@ export * from './data/serialization';
|
|
|
7
8
|
export * from './data/transformer';
|
|
8
9
|
export * from './io/package';
|
|
9
10
|
export * from './io/stream';
|
|
11
|
+
export * from './redis/availability';
|
|
10
12
|
export * from './redis/cache';
|
|
11
13
|
export * from './redis/broadcast';
|
|
12
14
|
export { flattenMutexKey, MutexAcquisitionError, registerMutexObserver, resetMutexRedisConnection, withMutex, withMutexes, type MutexContext, type MutexFn, type MutexKey as HelperMutexKey, type MutexObservation, type MutexObserver, type MutexOptions, type RedisMutexClient, type RedisMutexProvider } from './redis/mutex';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACH,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,SAAS,EACT,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,QAAQ,IAAI,cAAc,EAC/B,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAC1B,MAAM,eAAe,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACH,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,SAAS,EACT,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,QAAQ,IAAI,cAAc,EAC/B,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAC1B,MAAM,eAAe,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.__tsfTypeAliases = exports.withMutexes = exports.withMutex = exports.resetMutexRedisConnection = exports.registerMutexObserver = exports.MutexAcquisitionError = exports.flattenMutexKey = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./availability"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./async/context"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./async/process"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./async/promise"), exports);
|
|
@@ -11,6 +12,7 @@ tslib_1.__exportStar(require("./data/serialization"), exports);
|
|
|
11
12
|
tslib_1.__exportStar(require("./data/transformer"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./io/package"), exports);
|
|
13
14
|
tslib_1.__exportStar(require("./io/stream"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./redis/availability"), exports);
|
|
14
16
|
tslib_1.__exportStar(require("./redis/cache"), exports);
|
|
15
17
|
tslib_1.__exportStar(require("./redis/broadcast"), exports);
|
|
16
18
|
var mutex_1 = require("./redis/mutex");
|
|
@@ -26,5 +28,5 @@ tslib_1.__exportStar(require("./security/validation"), exports);
|
|
|
26
28
|
tslib_1.__exportStar(require("./utils/date"), exports);
|
|
27
29
|
tslib_1.__exportStar(require("./utils/error"), exports);
|
|
28
30
|
tslib_1.__exportStar(require("./utils/uuid"), exports);
|
|
29
|
-
exports.__tsfTypeAliases = ({ "BroadcastLogger": { kind: 18, typeName: "BroadcastLogger", types: [] }, "CacheRedisClient": { kind: 18, typeName: "CacheRedisClient", types: [] }, "CacheRedisProvider": { kind: 2, typeName: "() => RedisConnection<CacheRedisClient>", typeName: "CacheRedisProvider" }, "CryptoOptions": { kind: 18, typeName: "CryptoOptions", types: [{ kind: 20, name: "secret", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "ivLength", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }] }, "DecoratedError": { kind: 18, typeName: "DecoratedError", types: [{ kind: 20, name: "cause", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "context", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2 }], index: { kind: 2 }, types: [] }, { kind: 4 }] }, optional: true }], implements: [{ kind: 16, typeName: "Error", classType: () => (typeof Error !== "undefined" ? Error : (typeof exports !== "undefined" ? exports.Error : undefined)) }] }, "ExecProcessOptions": { kind: 18, typeName: "ExecProcessOptions", types: [{ kind: 20, name: "cwd", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "errorOnNonZero", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "stdio", type: { kind: 12, types: [{ kind: 2, typeName: "SpawnOptions['stdio']" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "onSpawn", type: { kind: 12, types: [{ kind: 2, typeName: "(proc: ChildProcess) => void" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "shell", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "env", type: { kind: 12, types: [{ kind: 16, typeName: "NodeJS.ProcessEnv", classType: () => NodeJS.ProcessEnv }, { kind: 4 }] }, optional: true }] }, "ExecProcessResult": { kind: 18, typeName: "ExecProcessResult", types: [{ kind: 20, name: "code", type: { kind: 12, types: [{ kind: 7 }, { kind: 5 }] }, optional: false }, { kind: 20, name: "stdout", type: { kind: 16, typeName: "Buffer", classType: () => (typeof Buffer !== "undefined" ? Buffer : (typeof exports !== "undefined" ? exports.Buffer : undefined)) }, optional: false }, { kind: 20, name: "stderr", type: { kind: 16, typeName: "Buffer", classType: () => (typeof Buffer !== "undefined" ? Buffer : (typeof exports !== "undefined" ? exports.Buffer : undefined)) }, optional: false }] }, "HelperMutexKey": { kind: 1, typeName: "HelperMutexKey" }, "IDistributedMethodOptions": { kind: 18, typeName: "IDistributedMethodOptions", types: [{ kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "logger", type: { kind: 12, types: [{ kind: 2, typeName: "() => BroadcastLogger" }, { kind: 4 }] }, optional: true }] }, "IErrorContext": { kind: 18, typeName: "IErrorContext", types: [{ kind: 20, name: "scope", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "scopeData", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2 }], index: { kind: 2 }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "loggerContext", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2 }], index: { kind: 2 }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "data", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2 }], index: { kind: 2 }, types: [] }, { kind: 4 }] }, optional: true }], index: { kind: 2 } }, "MutexContext": { kind: 18, typeName: "MutexContext", types: [{ kind: 20, name: "key", type: { kind: 6 }, optional: false }, { kind: 20, name: "lockId", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "signal", type: { kind: 16, typeName: "AbortSignal", classType: () => (typeof AbortSignal !== "undefined" ? AbortSignal : (typeof exports !== "undefined" ? exports.AbortSignal : undefined)) }, optional: false }] }, "MutexObservation": { kind: 18, typeName: "MutexObservation", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "key", type: { kind: 6 }, optional: false }, { kind: 20, name: "mode", type: { kind: 12, types: [{ kind: 10, literal: "local" }, { kind: 10, literal: "redis" }] }, optional: false }, { kind: 20, name: "type", type: { kind: 12, types: [{ kind: 10, literal: "pending" }, { kind: 10, literal: "acquired" }, { kind: 10, literal: "released" }, { kind: 10, literal: "error" }, { kind: 10, literal: "failed" }] }, optional: false }, { kind: 20, name: "startedAt", type: { kind: 7 }, optional: false }, { kind: 20, name: "at", type: { kind: 7 }, optional: false }, { kind: 20, name: "waited", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "error", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] }, "MutexObserver": { kind: 2, typeName: "(entry: MutexObservation) => void", typeName: "MutexObserver" }, "MutexOptions": { kind: 18, typeName: "MutexOptions", types: [{ kind: 20, name: "key", type: { kind: 12, types: [{ kind: 1, typeName: "MutexKey" }, { kind: 14, type: { kind: 1, typeName: "MutexKey" } }] }, optional: false }, { kind: 20, name: "fn", type: { kind: 2, typeName: "MutexFn", typeArguments: [{ kind: 2, typeName: "T" }] }, optional: false }, { kind: 20, name: "retryCount", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "retryDelay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "renewInterval", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "mode", type: { kind: 12, types: [{ kind: 12, types: [{ kind: 10, literal: "local" }, { kind: 10, literal: "redis" }] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "redis", type: { kind: 12, types: [{ kind: 2, typeName: "() => RedisConnection<RedisMutexClient>", typeName: "RedisMutexProvider" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "signal", type: { kind: 12, types: [{ kind: 16, typeName: "AbortSignal", classType: () => (typeof AbortSignal !== "undefined" ? AbortSignal : (typeof exports !== "undefined" ? exports.AbortSignal : undefined)) }, { kind: 4 }] }, optional: true }] }, "PackageJson": { kind: 18, typeName: "PackageJson", types: [{ kind: 20, name: "name", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "version", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }], index: { kind: 2 } }, "RedisConnection": { kind: 18, typeName: "RedisConnection", types: [{ kind: 20, name: "client", type: { kind: 16, typeName: "TClient", classType: () => (typeof TClient !== "undefined" ? TClient : (typeof exports !== "undefined" ? exports.TClient : undefined)) }, optional: false }, { kind: 20, name: "prefix", type: { kind: 6 }, optional: false }] }, "RedisMutexClient": { kind: 18, typeName: "RedisMutexClient", types: [] }, "RedisMutexProvider": { kind: 2, typeName: "() => RedisConnection<RedisMutexClient>", typeName: "RedisMutexProvider" }, "Semaphore": { kind: 18, typeName: "Semaphore", types: [{ kind: 20, name: "promise", type: { kind: 22, type: { kind: 3 } }, optional: false }] }, "SentryTagValue": { kind: 12, types: [{ kind: 6 }, { kind: 7 }, { kind: 8 }, { kind: 9 }, { kind: 2, typeName: "symbol" }, { kind: 5 }, { kind: 4 }], typeName: "SentryTagValue" }, "SimpleStore": { kind: 18, index: { kind: 1 }, types: [], typeName: "SimpleStore" } });
|
|
31
|
+
exports.__tsfTypeAliases = ({ "AvailabilityLogger": { kind: 18, typeName: "AvailabilityLogger", types: [] }, "AvailabilityMonitor": { kind: 18, typeName: "AvailabilityMonitor", types: [] }, "AvailabilityMonitorOptions": { kind: 18, typeName: "AvailabilityMonitorOptions", types: [{ kind: 20, name: "alertAfterMs", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "name", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, "BroadcastLogger": { kind: 18, typeName: "BroadcastLogger", types: [] }, "CacheRedisClient": { kind: 18, typeName: "CacheRedisClient", types: [] }, "CacheRedisProvider": { kind: 2, typeName: "() => RedisConnection<CacheRedisClient>", typeName: "CacheRedisProvider" }, "CryptoOptions": { kind: 18, typeName: "CryptoOptions", types: [{ kind: 20, name: "secret", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "ivLength", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }] }, "DecoratedError": { kind: 18, typeName: "DecoratedError", types: [{ kind: 20, name: "cause", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "context", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2 }], index: { kind: 2 }, types: [] }, { kind: 4 }] }, optional: true }], implements: [{ kind: 16, typeName: "Error", classType: () => (typeof Error !== "undefined" ? Error : (typeof exports !== "undefined" ? exports.Error : undefined)) }] }, "ExecProcessOptions": { kind: 18, typeName: "ExecProcessOptions", types: [{ kind: 20, name: "cwd", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "errorOnNonZero", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "stdio", type: { kind: 12, types: [{ kind: 2, typeName: "SpawnOptions['stdio']" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "onSpawn", type: { kind: 12, types: [{ kind: 2, typeName: "(proc: ChildProcess) => void" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "shell", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "env", type: { kind: 12, types: [{ kind: 16, typeName: "NodeJS.ProcessEnv", classType: () => NodeJS.ProcessEnv }, { kind: 4 }] }, optional: true }] }, "ExecProcessResult": { kind: 18, typeName: "ExecProcessResult", types: [{ kind: 20, name: "code", type: { kind: 12, types: [{ kind: 7 }, { kind: 5 }] }, optional: false }, { kind: 20, name: "stdout", type: { kind: 16, typeName: "Buffer", classType: () => (typeof Buffer !== "undefined" ? Buffer : (typeof exports !== "undefined" ? exports.Buffer : undefined)) }, optional: false }, { kind: 20, name: "stderr", type: { kind: 16, typeName: "Buffer", classType: () => (typeof Buffer !== "undefined" ? Buffer : (typeof exports !== "undefined" ? exports.Buffer : undefined)) }, optional: false }] }, "HelperMutexKey": { kind: 1, typeName: "HelperMutexKey" }, "IDistributedMethodOptions": { kind: 18, typeName: "IDistributedMethodOptions", types: [{ kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "logger", type: { kind: 12, types: [{ kind: 2, typeName: "() => BroadcastLogger" }, { kind: 4 }] }, optional: true }] }, "IErrorContext": { kind: 18, typeName: "IErrorContext", types: [{ kind: 20, name: "scope", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "scopeData", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2 }], index: { kind: 2 }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "loggerContext", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2 }], index: { kind: 2 }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "data", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2 }], index: { kind: 2 }, types: [] }, { kind: 4 }] }, optional: true }], index: { kind: 2 } }, "MutexContext": { kind: 18, typeName: "MutexContext", types: [{ kind: 20, name: "key", type: { kind: 6 }, optional: false }, { kind: 20, name: "lockId", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "signal", type: { kind: 16, typeName: "AbortSignal", classType: () => (typeof AbortSignal !== "undefined" ? AbortSignal : (typeof exports !== "undefined" ? exports.AbortSignal : undefined)) }, optional: false }] }, "MutexObservation": { kind: 18, typeName: "MutexObservation", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "key", type: { kind: 6 }, optional: false }, { kind: 20, name: "mode", type: { kind: 12, types: [{ kind: 10, literal: "local" }, { kind: 10, literal: "redis" }] }, optional: false }, { kind: 20, name: "type", type: { kind: 12, types: [{ kind: 10, literal: "pending" }, { kind: 10, literal: "acquired" }, { kind: 10, literal: "released" }, { kind: 10, literal: "error" }, { kind: 10, literal: "failed" }] }, optional: false }, { kind: 20, name: "startedAt", type: { kind: 7 }, optional: false }, { kind: 20, name: "at", type: { kind: 7 }, optional: false }, { kind: 20, name: "waited", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "error", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] }, "MutexObserver": { kind: 2, typeName: "(entry: MutexObservation) => void", typeName: "MutexObserver" }, "MutexOptions": { kind: 18, typeName: "MutexOptions", types: [{ kind: 20, name: "key", type: { kind: 12, types: [{ kind: 1, typeName: "MutexKey" }, { kind: 14, type: { kind: 1, typeName: "MutexKey" } }] }, optional: false }, { kind: 20, name: "fn", type: { kind: 2, typeName: "MutexFn", typeArguments: [{ kind: 2, typeName: "T" }] }, optional: false }, { kind: 20, name: "retryCount", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "retryDelay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "renewInterval", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "mode", type: { kind: 12, types: [{ kind: 12, types: [{ kind: 10, literal: "local" }, { kind: 10, literal: "redis" }] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "redis", type: { kind: 12, types: [{ kind: 2, typeName: "() => RedisConnection<RedisMutexClient>", typeName: "RedisMutexProvider" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "signal", type: { kind: 12, types: [{ kind: 16, typeName: "AbortSignal", classType: () => (typeof AbortSignal !== "undefined" ? AbortSignal : (typeof exports !== "undefined" ? exports.AbortSignal : undefined)) }, { kind: 4 }] }, optional: true }] }, "PackageJson": { kind: 18, typeName: "PackageJson", types: [{ kind: 20, name: "name", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "version", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }], index: { kind: 2 } }, "RedisAvailabilityClient": { kind: 18, typeName: "RedisAvailabilityClient", types: [] }, "RedisAvailabilityMonitor": { kind: 18, typeName: "AvailabilityMonitor", types: [], typeName: "RedisAvailabilityMonitor" }, "RedisAvailabilityMonitorOptions": { kind: 18, typeName: "AvailabilityMonitorOptions", types: [{ kind: 20, name: "alertAfterMs", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "name", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }], typeName: "RedisAvailabilityMonitorOptions" }, "RedisConnection": { kind: 18, typeName: "RedisConnection", types: [{ kind: 20, name: "client", type: { kind: 16, typeName: "TClient", classType: () => (typeof TClient !== "undefined" ? TClient : (typeof exports !== "undefined" ? exports.TClient : undefined)) }, optional: false }, { kind: 20, name: "prefix", type: { kind: 6 }, optional: false }] }, "RedisMutexClient": { kind: 18, typeName: "RedisMutexClient", types: [] }, "RedisMutexProvider": { kind: 2, typeName: "() => RedisConnection<RedisMutexClient>", typeName: "RedisMutexProvider" }, "Semaphore": { kind: 18, typeName: "Semaphore", types: [{ kind: 20, name: "promise", type: { kind: 22, type: { kind: 3 } }, optional: false }] }, "SentryTagValue": { kind: 12, types: [{ kind: 6 }, { kind: 7 }, { kind: 8 }, { kind: 9 }, { kind: 2, typeName: "symbol" }, { kind: 5 }, { kind: 4 }], typeName: "SentryTagValue" }, "SimpleStore": { kind: 18, index: { kind: 1 }, types: [], typeName: "SimpleStore" } });
|
|
30
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":";;;;AAAA,0DAAgC;AAChC,0DAAgC;AAChC,0DAAgC;AAChC,uDAA6B;AAC7B,yDAA+B;AAC/B,+DAAqC;AACrC,6DAAmC;AACnC,uDAA6B;AAC7B,sDAA4B;AAC5B,wDAA8B;AAC9B,4DAAkC;AAClC,uCAeuB;AAdnB,wGAAA,eAAe,OAAA;AACf,8GAAA,qBAAqB,OAAA;AACrB,8GAAA,qBAAqB,OAAA;AACrB,kHAAA,yBAAyB,OAAA;AACzB,kGAAA,SAAS,OAAA;AACT,oGAAA,WAAW,OAAA;AAUf,wDAA8B;AAC9B,4DAAkC;AAClC,gEAAsC;AACtC,uDAA6B;AAC7B,wDAA8B;AAC9B,uDAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":";;;;AAAA,yDAA+B;AAC/B,0DAAgC;AAChC,0DAAgC;AAChC,0DAAgC;AAChC,uDAA6B;AAC7B,yDAA+B;AAC/B,+DAAqC;AACrC,6DAAmC;AACnC,uDAA6B;AAC7B,sDAA4B;AAC5B,+DAAqC;AACrC,wDAA8B;AAC9B,4DAAkC;AAClC,uCAeuB;AAdnB,wGAAA,eAAe,OAAA;AACf,8GAAA,qBAAqB,OAAA;AACrB,8GAAA,qBAAqB,OAAA;AACrB,kHAAA,yBAAyB,OAAA;AACzB,kGAAA,SAAS,OAAA;AACT,oGAAA,WAAW,OAAA;AAUf,wDAA8B;AAC9B,4DAAkC;AAClC,gEAAsC;AACtC,uDAA6B;AAC7B,wDAA8B;AAC9B,uDAA6B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type AvailabilityLogger, type AvailabilityMonitor, type AvailabilityMonitorOptions } from '../availability';
|
|
2
|
+
export declare const DEFAULT_REDIS_UNAVAILABLE_ALERT_AFTER_MS = 60000;
|
|
3
|
+
export type RedisAvailabilityMonitor = AvailabilityMonitor;
|
|
4
|
+
export type RedisAvailabilityMonitorOptions = AvailabilityMonitorOptions;
|
|
5
|
+
export interface RedisAvailabilityClient {
|
|
6
|
+
on(event: 'error', listener: (error: unknown) => void): unknown;
|
|
7
|
+
on(event: 'ready' | 'reconnecting', listener: () => void): unknown;
|
|
8
|
+
removeListener(event: 'error', listener: (error: unknown) => void): unknown;
|
|
9
|
+
removeListener(event: 'ready' | 'reconnecting', listener: () => void): unknown;
|
|
10
|
+
}
|
|
11
|
+
export declare function monitorRedisAvailability(client: RedisAvailabilityClient, logger: AvailabilityLogger, options?: RedisAvailabilityMonitorOptions): RedisAvailabilityMonitor;
|
|
12
|
+
//# sourceMappingURL=availability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availability.d.ts","sourceRoot":"","sources":["../../../../src/helpers/redis/availability.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAClC,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,wCAAwC,QAAsC,CAAC;AAC5F,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAC3D,MAAM,MAAM,+BAA+B,GAAG,0BAA0B,CAAC;AAEzE,MAAM,WAAW,uBAAuB;IACpC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC;IAChE,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;IACnE,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC;IAC5E,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;CAClF;AAED,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,kBAAkB,EAC1B,OAAO,GAAE,+BAAoC,GAC9C,wBAAwB,CAoB1B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.__tsfTypeAliases = exports.DEFAULT_REDIS_UNAVAILABLE_ALERT_AFTER_MS = void 0;
|
|
4
|
+
exports.monitorRedisAvailability = monitorRedisAvailability;
|
|
5
|
+
const availability_1 = require("../availability");
|
|
6
|
+
exports.DEFAULT_REDIS_UNAVAILABLE_ALERT_AFTER_MS = availability_1.DEFAULT_AVAILABILITY_ALERT_AFTER_MS;
|
|
7
|
+
function monitorRedisAvailability(client, logger, options = {}) {
|
|
8
|
+
const monitor = (0, availability_1.createAvailabilityMonitor)(logger, { ...options, name: options.name ?? 'Redis' });
|
|
9
|
+
const onError = (error) => monitor.unavailable(error);
|
|
10
|
+
const onReconnecting = () => monitor.unavailable();
|
|
11
|
+
const onReady = () => monitor.available();
|
|
12
|
+
client.on('error', onError);
|
|
13
|
+
client.on('reconnecting', onReconnecting);
|
|
14
|
+
client.on('ready', onReady);
|
|
15
|
+
return {
|
|
16
|
+
unavailable: monitor.unavailable,
|
|
17
|
+
available: monitor.available,
|
|
18
|
+
stop() {
|
|
19
|
+
client.removeListener('error', onError);
|
|
20
|
+
client.removeListener('reconnecting', onReconnecting);
|
|
21
|
+
client.removeListener('ready', onReady);
|
|
22
|
+
monitor.stop();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.__tsfTypeAliases = ({ "RedisAvailabilityClient": { kind: 18, typeName: "RedisAvailabilityClient", types: [] }, "RedisAvailabilityMonitor": { kind: 18, typeName: "AvailabilityMonitor", types: [], typeName: "RedisAvailabilityMonitor" }, "RedisAvailabilityMonitorOptions": { kind: 18, typeName: "AvailabilityMonitorOptions", types: [{ kind: 20, name: "alertAfterMs", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "name", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }], typeName: "RedisAvailabilityMonitorOptions" } });
|
|
27
|
+
//# sourceMappingURL=availability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availability.js","sourceRoot":"","sources":["../../../../src/helpers/redis/availability.ts"],"names":[],"mappings":";;;;AAAA,kDAMyB;AAEZ,QA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AK;IAC5C,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,kBAAkB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG;IACvD,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAClB,
|
|
1
|
+
{"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../../../src/helpers/redis/redis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAKnD,MAAM,WAAW,eAAe,CAAC,OAAO,GAAG,KAAK;IAC5C,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,kBAAkB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG;IACvD,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAClB,CA2CA;AAID,wBAAgB,WAAW,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,eAAe,CAMlE;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAIxD"}
|
|
@@ -30,7 +30,10 @@ function createRedisOptions(configPrefix) {
|
|
|
30
30
|
port: Number(config.REDIS_SENTINEL_PORT ?? 26379)
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
|
-
name: config.REDIS_SENTINEL_NAME ? String(config.REDIS_SENTINEL_NAME) : undefined
|
|
33
|
+
name: config.REDIS_SENTINEL_NAME ? String(config.REDIS_SENTINEL_NAME) : undefined,
|
|
34
|
+
failoverDetector: true,
|
|
35
|
+
sentinelMaxConnections: 1,
|
|
36
|
+
reconnectOnError: error => (error.message.startsWith('READONLY') ? 2 : false)
|
|
34
37
|
}
|
|
35
38
|
};
|
|
36
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.js","sourceRoot":"","sources":["../../../../src/helpers/redis/redis.ts"],"names":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