"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.__tsfTypeAliases = exports.withMutexes = exports.withMutex = exports.resetMutexRedisConnection = exports.registerMutexObserver = exports.MutexAcquisitionError = exports.flattenMutexKey = void 0;
const tslib_1 = require("tslib");
const _a = tslib_1.__importStar(require("@zyno-io/ts-server-foundation/type-metadata-runtime"));
tslib_1.__exportStar(require("./availability"), exports);
tslib_1.__exportStar(require("./async/context"), exports);
tslib_1.__exportStar(require("./async/process"), exports);
tslib_1.__exportStar(require("./async/promise"), exports);
tslib_1.__exportStar(require("./data/array"), exports);
tslib_1.__exportStar(require("./data/objects"), exports);
tslib_1.__exportStar(require("./data/serialization"), exports);
tslib_1.__exportStar(require("./data/transformer"), exports);
tslib_1.__exportStar(require("./io/package"), exports);
tslib_1.__exportStar(require("./io/stream"), exports);
tslib_1.__exportStar(require("./redis/availability"), exports);
tslib_1.__exportStar(require("./redis/cache"), exports);
tslib_1.__exportStar(require("./redis/broadcast"), exports);
var mutex_1 = require("./redis/mutex");
Object.defineProperty(exports, "flattenMutexKey", { enumerable: true, get: function () { return mutex_1.flattenMutexKey; } });
Object.defineProperty(exports, "MutexAcquisitionError", { enumerable: true, get: function () { return mutex_1.MutexAcquisitionError; } });
Object.defineProperty(exports, "registerMutexObserver", { enumerable: true, get: function () { return mutex_1.registerMutexObserver; } });
Object.defineProperty(exports, "resetMutexRedisConnection", { enumerable: true, get: function () { return mutex_1.resetMutexRedisConnection; } });
Object.defineProperty(exports, "withMutex", { enumerable: true, get: function () { return mutex_1.withMutex; } });
Object.defineProperty(exports, "withMutexes", { enumerable: true, get: function () { return mutex_1.withMutexes; } });
tslib_1.__exportStar(require("./redis/redis"), exports);
tslib_1.__exportStar(require("./security/crypto"), exports);
tslib_1.__exportStar(require("./security/validation"), exports);
tslib_1.__exportStar(require("./utils/date"), exports);
tslib_1.__exportStar(require("./utils/error"), exports);
tslib_1.__exportStar(require("./utils/timer"), exports);
tslib_1.__exportStar(require("./utils/uuid"), exports);
exports.__tsfTypeAliases = _a.decodeCompactMetadataV1("[1,{\"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},{\"kind\":20,\"name\":\"warningAfterMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},\"CacheRedisClient\":{\"kind\":18,\"typeName\":\"CacheRedisClient\",\"types\":[]},\"CacheRedisProvider\":{\"kind\":2,\"typeName\":\"() =\\u003e RedisConnection\\u003cCacheRedisClient\\u003e\",\"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\":{\"$tsf\":0}}]},\"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) =\\u003e 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\":{\"$tsf\":1}},{\"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\":{\"$tsf\":2}},\"optional\":false},{\"kind\":20,\"name\":\"stderr\",\"type\":{\"kind\":16,\"typeName\":\"Buffer\",\"classType\":{\"$tsf\":2}},\"optional\":false}]},\"HelperMutexKey\":{\"kind\":1,\"typeName\":\"HelperMutexKey\"},\"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\":{\"$tsf\":3}},\"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) =\\u003e 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\":\"() =\\u003e RedisConnection\\u003cRedisMutexClient\\u003e\",\"typeName\":\"RedisMutexProvider\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"signal\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"AbortSignal\",\"classType\":{\"$tsf\":3}},{\"kind\":4}]},\"optional\":true}],\"typeParameters\":[\"T\"]},\"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},{\"kind\":20,\"name\":\"warningAfterMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}],\"typeName\":\"RedisAvailabilityMonitorOptions\"},\"RedisConnection\":{\"kind\":18,\"typeName\":\"RedisConnection\",\"types\":[{\"kind\":20,\"name\":\"client\",\"type\":{\"kind\":2,\"typeName\":\"TClient\"},\"optional\":false},{\"kind\":20,\"name\":\"prefix\",\"type\":{\"kind\":6},\"optional\":false}],\"typeParameters\":[\"TClient\"]},\"RedisMutexClient\":{\"kind\":18,\"typeName\":\"RedisMutexClient\",\"types\":[]},\"RedisMutexProvider\":{\"kind\":2,\"typeName\":\"() =\\u003e RedisConnection\\u003cRedisMutexClient\\u003e\",\"typeName\":\"RedisMutexProvider\"},\"Semaphore\":{\"kind\":18,\"typeName\":\"Semaphore\",\"types\":[{\"kind\":20,\"name\":\"promise\",\"type\":{\"kind\":22,\"type\":{\"kind\":3}},\"optional\":false}]},\"SimpleStore\":{\"kind\":18,\"index\":{\"kind\":1},\"types\":[],\"typeName\":\"SimpleStore\"}}]", [() => (typeof Error !== "undefined" ? Error : (typeof exports !== "undefined" ? exports.Error : undefined)), () => NodeJS.ProcessEnv, () => (typeof Buffer !== "undefined" ? Buffer : (typeof exports !== "undefined" ? exports.Buffer : undefined)), () => (typeof AbortSignal !== "undefined" ? AbortSignal : (typeof exports !== "undefined" ? exports.AbortSignal : undefined))]);
//# sourceMappingURL=index.js.map