@zyno-io/ts-server-foundation 26.921.127 → 26.923.1957
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/base.js
CHANGED
|
@@ -541,7 +541,7 @@ Examples:
|
|
|
541
541
|
}
|
|
542
542
|
this.signalHandlers = undefined;
|
|
543
543
|
}
|
|
544
|
-
static __tsfType = _AppMetadata_1 = _a.decodeCompactMetadataV2("[2,{\"kind\":16,\"name\":\"App\",\"typeName\":\"App\",\"classType\":{\"$tsf\":0},\"properties\":[{\"name\":\"container\",\"type\":{\"$tsfNode\":0},\"optional\":false},{\"name\":\"events\",\"type\":{\"kind\":16,\"typeName\":\"EventBus\",\"classType\":{\"$tsfImport\":[1,\"../events/index\",\"EventBus\"]}},\"optional\":false},{\"name\":\"config\",\"type\":{\"$tsfType\":0},\"optional\":false},{\"name\":\"router\",\"type\":{\"kind\":16,\"typeName\":\"HttpRouter\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpRouter\"]}},\"optional\":false},{\"name\":\"http\",\"type\":{\"kind\":16,\"typeName\":\"HttpServerRuntime\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpServerRuntime\"]},\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}]},\"optional\":false}],\"methods\":[{\"name\":\"get\",\"parameters\":[{\"name\":\"token\",\"type\":{\"$tsfType\":1},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":2}},{\"name\":\"getInjectorContext\",\"parameters\":[],\"returnType\":{\"$tsfNode\":0}},{\"name\":\"on\",\"parameters\":[{\"name\":\"token\",\"type\":{\"kind\":16,\"typeName\":\"EventToken\",\"classType\":{\"$tsfImport\":[1,\"../events/index\",\"EventToken\"]},\"typeArguments\":[{\"kind\":16,\"typeName\":\"TEvent\",\"classType\":{\"$tsf\":2}}]},\"optional\":false,\"default\":false},{\"name\":\"handler\",\"type\":{\"$tsfType\":3},\"optional\":false,\"default\":false},{\"name\":\"order\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":true}],\"returnType\":{\"$tsfType\":5}},{\"name\":\"registerCleanup\",\"parameters\":[{\"name\":\"cleanup\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":5},\"description\":\"Register cleanup for a resource acquired by this application.\"},{\"name\":\"start\",\"parameters\":[],\"returnType\":{\"$tsfType\":7}},{\"name\":\"stop\",\"parameters\":[],\"returnType\":{\"$tsfType\":7}},{\"name\":\"run\",\"parameters\":[{\"name\":\"port\",\"type\":{\"$tsfType\":8},\"optional\":true,\"default\":false},{\"name\":\"host\",\"type\":{\"$tsfType\":9},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":7}},{\"name\":\"configureForCliService\",\"parameters\":[],\"returnType\":{\"$tsfType\":10}},{\"name\":\"configureForRepl\",\"parameters\":[],\"returnType\":{\"$tsfType\":10}},{\"name\":\"request\",\"parameters\":[{\"name\":\"request\",\"type\":{\"kind\":16,\"typeName\":\"HttpRequest\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpRequest\"]}},\"optional\":false,\"default\":false},{\"name\":\"response\",\"type\":{\"$tsfNode\":1},\"optional\":true,\"default\":true}],\"returnType\":{\"kind\":22,\"type\":{\"$tsfNode\":1}}}],\"hasConstructor\":true,\"constructorParameters\":[{\"name\":\"options\",\"type\":{\"kind\":18,\"typeName\":\"CreateAppOptions\",\"types\":[{\"$tsfNode\":2},{\"$tsfNode\":3},{\"kind\":20,\"name\":\"imports\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":12,\"types\":[{\"
|
|
544
|
+
static __tsfType = _AppMetadata_1 = _a.decodeCompactMetadataV2("[2,{\"kind\":16,\"name\":\"App\",\"typeName\":\"App\",\"classType\":{\"$tsf\":0},\"properties\":[{\"name\":\"container\",\"type\":{\"$tsfNode\":0},\"optional\":false},{\"name\":\"events\",\"type\":{\"kind\":16,\"typeName\":\"EventBus\",\"classType\":{\"$tsfImport\":[1,\"../events/index\",\"EventBus\"]}},\"optional\":false},{\"name\":\"config\",\"type\":{\"$tsfType\":0},\"optional\":false},{\"name\":\"router\",\"type\":{\"kind\":16,\"typeName\":\"HttpRouter\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpRouter\"]}},\"optional\":false},{\"name\":\"http\",\"type\":{\"kind\":16,\"typeName\":\"HttpServerRuntime\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpServerRuntime\"]},\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}]},\"optional\":false}],\"methods\":[{\"name\":\"get\",\"parameters\":[{\"name\":\"token\",\"type\":{\"$tsfType\":1},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":2}},{\"name\":\"getInjectorContext\",\"parameters\":[],\"returnType\":{\"$tsfNode\":0}},{\"name\":\"on\",\"parameters\":[{\"name\":\"token\",\"type\":{\"kind\":16,\"typeName\":\"EventToken\",\"classType\":{\"$tsfImport\":[1,\"../events/index\",\"EventToken\"]},\"typeArguments\":[{\"kind\":16,\"typeName\":\"TEvent\",\"classType\":{\"$tsf\":2}}]},\"optional\":false,\"default\":false},{\"name\":\"handler\",\"type\":{\"$tsfType\":3},\"optional\":false,\"default\":false},{\"name\":\"order\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":true}],\"returnType\":{\"$tsfType\":5}},{\"name\":\"registerCleanup\",\"parameters\":[{\"name\":\"cleanup\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":5},\"description\":\"Register cleanup for a resource acquired by this application.\"},{\"name\":\"start\",\"parameters\":[],\"returnType\":{\"$tsfType\":7}},{\"name\":\"stop\",\"parameters\":[],\"returnType\":{\"$tsfType\":7}},{\"name\":\"run\",\"parameters\":[{\"name\":\"port\",\"type\":{\"$tsfType\":8},\"optional\":true,\"default\":false},{\"name\":\"host\",\"type\":{\"$tsfType\":9},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":7}},{\"name\":\"configureForCliService\",\"parameters\":[],\"returnType\":{\"$tsfType\":10}},{\"name\":\"configureForRepl\",\"parameters\":[],\"returnType\":{\"$tsfType\":10}},{\"name\":\"request\",\"parameters\":[{\"name\":\"request\",\"type\":{\"kind\":16,\"typeName\":\"HttpRequest\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpRequest\"]}},\"optional\":false,\"default\":false},{\"name\":\"response\",\"type\":{\"$tsfNode\":1},\"optional\":true,\"default\":true}],\"returnType\":{\"kind\":22,\"type\":{\"$tsfNode\":1}}}],\"hasConstructor\":true,\"constructorParameters\":[{\"name\":\"options\",\"type\":{\"kind\":18,\"typeName\":\"CreateAppOptions\",\"types\":[{\"$tsfNode\":2},{\"$tsfNode\":3},{\"kind\":20,\"name\":\"imports\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":12,\"types\":[{\"$tsfNode\":4},{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":18,\"typeName\":\"ModuleInstance\",\"types\":[{\"kind\":20,\"name\":\"definition\",\"type\":{\"$tsfNode\":4},\"optional\":false}]}],\"typeName\":\"ModuleLike\"}},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":5},{\"$tsfNode\":6},{\"$tsfNode\":7},{\"$tsfNode\":8},{\"$tsfNode\":9},{\"$tsfNode\":2},{\"$tsfNode\":3},{\"kind\":20,\"name\":\"envPassthrough\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"$tsfNode\":10}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"db\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"frameworkConfig\",\"type\":{\"$tsfNode\":11},\"optional\":true},{\"kind\":20,\"name\":\"serverConfig\",\"type\":{\"$tsfNode\":11},\"optional\":true},{\"kind\":20,\"name\":\"cors\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"HttpCorsConfig\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"staticFiles\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":18,\"typeName\":\"StaticFilesOptions\",\"types\":[{\"kind\":20,\"name\":\"directory\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"index\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"spaFallback\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":10,\"literal\":false}]},{\"kind\":4}]},\"optional\":true}]}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"requestLogging\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"HttpRequestLoggingOptions\",\"types\":[{\"kind\":20,\"name\":\"excludePaths\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"$tsfNode\":10}]}},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"httpResolvers\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"kind\":2,\"typeName\":\"RouteParameterResolverInput\"}],\"index\":{\"kind\":2,\"typeName\":\"RouteParameterResolverInput\"},\"types\":[],\"typeName\":\"RouteParameterResolverRegistry\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"fallbackController\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"ClassType\",\"typeArguments\":[{\"kind\":18,\"typeName\":\"HttpFallbackController\",\"types\":[]}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"enableHealthcheck\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"enableWorker\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"enableDkRpc\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]},\"optional\":false,\"default\":false}]},[{\"kind\":16,\"typeName\":\"Container\",\"classType\":{\"$tsfImport\":[1,\"../di/index\",\"Container\"]}},{\"kind\":16,\"typeName\":\"HttpResponse\",\"classType\":{\"$tsfImport\":[1,\"../http/index\",\"HttpResponse\"]}},{\"kind\":20,\"name\":\"config\",\"type\":{\"$tsfNode\":12},\"optional\":true},{\"kind\":20,\"name\":\"defaultConfig\",\"type\":{\"$tsfNode\":13},\"optional\":true},{\"kind\":18,\"typeName\":\"ModuleDefinition\",\"types\":{\"$tsfNode\":14},\"typeParameters\":[\"C\"]},{\"kind\":20,\"name\":\"exports\",\"type\":{\"$tsfNode\":15},\"optional\":true},{\"kind\":20,\"name\":\"providers\",\"type\":{\"$tsfNode\":16},\"optional\":true},{\"kind\":20,\"name\":\"controllers\",\"type\":{\"$tsfNode\":17},\"optional\":true},{\"kind\":20,\"name\":\"listeners\",\"type\":{\"$tsfNode\":17},\"optional\":true},{\"kind\":20,\"name\":\"commands\",\"type\":{\"$tsfNode\":17},\"optional\":true},{\"kind\":16,\"typeName\":\"RegExp\",\"classType\":{\"$tsf\":3}},{\"kind\":12,\"types\":{\"$tsfNode\":18}},{\"kind\":12,\"types\":{\"$tsfNode\":19}},{\"kind\":12,\"types\":{\"$tsfNode\":20}},[{\"$tsfNode\":2},{\"$tsfNode\":3},{\"$tsfNode\":21},{\"$tsfNode\":5},{\"$tsfNode\":6},{\"$tsfNode\":7},{\"$tsfNode\":8},{\"$tsfNode\":9}],{\"kind\":12,\"types\":{\"$tsfNode\":22}},{\"kind\":12,\"types\":{\"$tsfNode\":23}},{\"kind\":12,\"types\":{\"$tsfNode\":24}},[{\"$tsfNode\":25},{\"kind\":4}],[{\"$tsfNode\":26},{\"kind\":4}],[{\"$tsfNode\":27},{\"kind\":4}],{\"kind\":20,\"name\":\"imports\",\"type\":{\"$tsfNode\":28},\"optional\":true},[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Token\"}},{\"kind\":4}],[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Provider\"}},{\"kind\":4}],[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"ClassType\"}},{\"kind\":4}],{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"kind\":2}],\"index\":{\"kind\":2},\"types\":[]},{\"kind\":2,\"typeName\":\"ClassType\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}]},{\"kind\":18,\"typeName\":\"Partial\",\"utilityType\":\"Partial\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}],\"utilityKeys\":[],\"types\":[]},{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"ModuleLike[]\"},{\"kind\":4}]}]]", [() => App, require, () => (typeof TEvent !== "undefined" ? TEvent : (typeof exports !== "undefined" ? exports.TEvent : undefined)), () => (typeof RegExp !== "undefined" ? RegExp : (typeof exports !== "undefined" ? exports.RegExp : undefined))], __tsf_metadata_type);
|
|
545
545
|
}
|
|
546
546
|
exports.App = App;
|
|
547
547
|
_AppMetadata_1.classType = App;
|
package/dist/src/di/container.js
CHANGED
|
@@ -9,7 +9,7 @@ const types_1 = require("../types");
|
|
|
9
9
|
const errors_1 = require("./errors");
|
|
10
10
|
const provider_1 = require("./provider");
|
|
11
11
|
const module_1 = require("./module");
|
|
12
|
-
const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":2,\"typeName\":\"Token\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"T\"}]},{\"kind\":2,\"typeName\":\"T\"},{\"kind\":2,\"typeName\":\"Token\"},{\"kind\":7},{\"kind\":8},{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Token\"}},{\"kind\":2},{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":14,\"type\":{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"token\",\"type\":{\"kind\":2,\"typeName\":\"Token\"},\"optional\":false},{\"kind\":20,\"name\":\"provider\",\"type\":{\"kind\":2,\"typeName\":\"Provider\"},\"optional\":false},{\"kind\":20,\"name\":\"moduleId\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"exported\",\"type\":{\"kind\":8},\"optional\":false}]}},{\"kind\":18,\"typeName\":\"ModuleDefinition\",\"types\":[{\"kind\":20,\"name\":\"
|
|
12
|
+
const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":2,\"typeName\":\"Token\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"T\"}]},{\"kind\":2,\"typeName\":\"T\"},{\"kind\":2,\"typeName\":\"Token\"},{\"kind\":7},{\"kind\":8},{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Token\"}},{\"kind\":2},{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":14,\"type\":{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"token\",\"type\":{\"kind\":2,\"typeName\":\"Token\"},\"optional\":false},{\"kind\":20,\"name\":\"provider\",\"type\":{\"kind\":2,\"typeName\":\"Provider\"},\"optional\":false},{\"kind\":20,\"name\":\"moduleId\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"exported\",\"type\":{\"kind\":8},\"optional\":false}]}},{\"kind\":18,\"typeName\":\"ModuleDefinition\",\"types\":[{\"$tsfNode\":0},{\"$tsfNode\":1},{\"kind\":20,\"name\":\"imports\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"ModuleDefinition\",\"types\":[{\"$tsfNode\":0},{\"$tsfNode\":1},{\"kind\":20,\"name\":\"imports\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"ModuleDefinition\"},{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":18,\"typeName\":\"ModuleInstance\",\"types\":[{\"kind\":20,\"name\":\"definition\",\"type\":{\"kind\":2,\"typeName\":\"ModuleDefinition\"},\"optional\":false}]}],\"typeName\":\"ModuleLike\"}},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":2},{\"$tsfNode\":3},{\"$tsfNode\":4},{\"$tsfNode\":5},{\"$tsfNode\":6}],\"typeParameters\":[\"C\"]},{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":18,\"typeName\":\"ModuleInstance\",\"types\":[{\"kind\":20,\"name\":\"definition\",\"type\":{\"kind\":18,\"typeName\":\"ModuleDefinition\",\"types\":[{\"$tsfNode\":0},{\"$tsfNode\":1},{\"kind\":20,\"name\":\"imports\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"ModuleDefinition\"},{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":2,\"typeName\":\"ModuleInstance\"}],\"typeName\":\"ModuleLike\"}},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":2},{\"$tsfNode\":3},{\"$tsfNode\":4},{\"$tsfNode\":5},{\"$tsfNode\":6}],\"typeParameters\":[\"C\"]},\"optional\":false}]}],\"typeName\":\"ModuleLike\"}},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":2},{\"$tsfNode\":3},{\"$tsfNode\":4},{\"$tsfNode\":5},{\"$tsfNode\":6}],\"typeParameters\":[\"C\"]}],[{\"kind\":20,\"name\":\"config\",\"type\":{\"$tsfNode\":7},\"optional\":true},{\"kind\":20,\"name\":\"defaultConfig\",\"type\":{\"$tsfNode\":8},\"optional\":true},{\"kind\":20,\"name\":\"exports\",\"type\":{\"$tsfNode\":9},\"optional\":true},{\"kind\":20,\"name\":\"providers\",\"type\":{\"$tsfNode\":10},\"optional\":true},{\"kind\":20,\"name\":\"controllers\",\"type\":{\"$tsfNode\":11},\"optional\":true},{\"kind\":20,\"name\":\"listeners\",\"type\":{\"$tsfNode\":11},\"optional\":true},{\"kind\":20,\"name\":\"commands\",\"type\":{\"$tsfNode\":11},\"optional\":true},{\"kind\":12,\"types\":{\"$tsfNode\":12}},{\"kind\":12,\"types\":{\"$tsfNode\":13}},{\"kind\":12,\"types\":{\"$tsfNode\":14}},{\"kind\":12,\"types\":{\"$tsfNode\":15}},{\"kind\":12,\"types\":{\"$tsfNode\":16}},[{\"$tsfNode\":17},{\"kind\":4}],[{\"$tsfNode\":18},{\"kind\":4}],[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Token\"}},{\"kind\":4}],[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Provider\"}},{\"kind\":4}],[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"ClassType\"}},{\"kind\":4}],{\"kind\":2,\"typeName\":\"ClassType\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}]},{\"kind\":18,\"typeName\":\"Partial\",\"utilityType\":\"Partial\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}],\"utilityKeys\":[],\"types\":[]}]]", []);
|
|
13
13
|
let _ContainerMetadata_1;
|
|
14
14
|
class Container {
|
|
15
15
|
modules = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broadcast.d.ts","sourceRoot":"","sources":["../../../../src/helpers/redis/broadcast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQpD,UAAU,eAAe;IACrB,KAAK,CAAC,GAAG,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CACvC;
|
|
1
|
+
{"version":3,"file":"broadcast.d.ts","sourceRoot":"","sources":["../../../../src/helpers/redis/broadcast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQpD,UAAU,eAAe;IACrB,KAAK,CAAC,GAAG,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CACvC;AAqHD,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;IAI3E,SAAS,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI;IAQjC,OAAO,SAAS,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC;EAExC;AAED,UAAU,yBAAyB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,eAAe,CAAC;CAClC;AACD,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,UAkB5G,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC,CAKxC"}
|
|
@@ -7,6 +7,7 @@ const resolver_1 = require("../../app/resolver");
|
|
|
7
7
|
const logger_1 = require("../../services/logger");
|
|
8
8
|
const lifecycle_1 = require("./lifecycle");
|
|
9
9
|
const redis_1 = require("./redis");
|
|
10
|
+
const RECONNECT_DELAY_MS = 1_000;
|
|
10
11
|
let sharedBroadcastChannel;
|
|
11
12
|
function getSharedBroadcastChannel() {
|
|
12
13
|
sharedBroadcastChannel ??= createSharedBroadcastChannel();
|
|
@@ -14,19 +15,14 @@ function getSharedBroadcastChannel() {
|
|
|
14
15
|
}
|
|
15
16
|
function createSharedBroadcastChannel() {
|
|
16
17
|
const logger = (0, resolver_1.r)(logger_1.Logger).scoped('Broadcast');
|
|
17
|
-
const { prefix, client: publishClient } = (0, redis_1.createRedis)('BROADCAST');
|
|
18
|
-
const { client: subscribeClient } = (0, redis_1.createRedis)('BROADCAST');
|
|
19
|
-
const channel = `${prefix}:broadcast`;
|
|
20
18
|
const localInstanceKey = `${(0, node_os_1.hostname)()}/${process.pid}`;
|
|
21
19
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
20
|
const listeners = new Map();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
subscribeClient.on('message', (_, message) => {
|
|
21
|
+
let activeRuntime;
|
|
22
|
+
let reconnectTimer;
|
|
23
|
+
let disposed = false;
|
|
24
|
+
let unregisterDispose = () => { };
|
|
25
|
+
const onMessage = (_channel, message) => {
|
|
30
26
|
try {
|
|
31
27
|
const { instanceKey, eventName, data } = JSON.parse(message);
|
|
32
28
|
if (instanceKey === localInstanceKey)
|
|
@@ -46,8 +42,69 @@ function createSharedBroadcastChannel() {
|
|
|
46
42
|
catch (err) {
|
|
47
43
|
logger.error('Failed to parse broadcast message', err, message);
|
|
48
44
|
}
|
|
49
|
-
}
|
|
50
|
-
const
|
|
45
|
+
};
|
|
46
|
+
const scheduleReconnect = () => {
|
|
47
|
+
if (disposed || reconnectTimer)
|
|
48
|
+
return;
|
|
49
|
+
reconnectTimer = setTimeout(() => {
|
|
50
|
+
reconnectTimer = undefined;
|
|
51
|
+
if (disposed || activeRuntime)
|
|
52
|
+
return;
|
|
53
|
+
try {
|
|
54
|
+
connect();
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
logger.error('Failed to reconnect broadcast channel', err);
|
|
58
|
+
scheduleReconnect();
|
|
59
|
+
}
|
|
60
|
+
}, RECONNECT_DELAY_MS);
|
|
61
|
+
reconnectTimer.unref();
|
|
62
|
+
};
|
|
63
|
+
const connect = () => {
|
|
64
|
+
if (disposed)
|
|
65
|
+
throw new Error('Broadcast channel is closed');
|
|
66
|
+
if (activeRuntime)
|
|
67
|
+
return activeRuntime;
|
|
68
|
+
if (reconnectTimer) {
|
|
69
|
+
clearTimeout(reconnectTimer);
|
|
70
|
+
reconnectTimer = undefined;
|
|
71
|
+
}
|
|
72
|
+
const { prefix, client: publishClient } = (0, redis_1.createRedis)('BROADCAST');
|
|
73
|
+
const { client: subscribeClient } = (0, redis_1.createRedis)('BROADCAST');
|
|
74
|
+
const channel = `${prefix}:broadcast`;
|
|
75
|
+
const runtime = { publishClient, subscribeClient, channel };
|
|
76
|
+
activeRuntime = runtime;
|
|
77
|
+
void subscribeClient.subscribe(channel).catch(err => {
|
|
78
|
+
if (subscribeClient.status !== 'end')
|
|
79
|
+
logger.error('Failed to subscribe to broadcast channel', err, { channel });
|
|
80
|
+
});
|
|
81
|
+
subscribeClient.on('message', onMessage);
|
|
82
|
+
(0, lifecycle_1.registerRedisStateReset)([publishClient, subscribeClient], () => {
|
|
83
|
+
if (activeRuntime !== runtime)
|
|
84
|
+
return;
|
|
85
|
+
activeRuntime = undefined;
|
|
86
|
+
subscribeClient.off('message', onMessage);
|
|
87
|
+
if (publishClient.status !== 'end')
|
|
88
|
+
publishClient.disconnect();
|
|
89
|
+
if (subscribeClient.status !== 'end')
|
|
90
|
+
subscribeClient.disconnect();
|
|
91
|
+
scheduleReconnect();
|
|
92
|
+
});
|
|
93
|
+
// Register after the clients so this runs before their cleanup on app shutdown.
|
|
94
|
+
unregisterDispose();
|
|
95
|
+
unregisterDispose = (0, resolver_1.registerAppCleanup)(() => {
|
|
96
|
+
disposed = true;
|
|
97
|
+
if (reconnectTimer)
|
|
98
|
+
clearTimeout(reconnectTimer);
|
|
99
|
+
reconnectTimer = undefined;
|
|
100
|
+
activeRuntime = undefined;
|
|
101
|
+
listeners.clear();
|
|
102
|
+
if (sharedBroadcastChannel === state)
|
|
103
|
+
sharedBroadcastChannel = undefined;
|
|
104
|
+
});
|
|
105
|
+
return runtime;
|
|
106
|
+
};
|
|
107
|
+
const state = {
|
|
51
108
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
109
|
subscribe: (eventName, fn) => {
|
|
53
110
|
const listenersForEvent = listeners.get(eventName) ?? new Set();
|
|
@@ -56,14 +113,12 @@ function createSharedBroadcastChannel() {
|
|
|
56
113
|
},
|
|
57
114
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
58
115
|
publish: async (eventName, data) => {
|
|
116
|
+
const { publishClient, channel } = connect();
|
|
59
117
|
await publishClient.publish(channel, JSON.stringify({ instanceKey: localInstanceKey, eventName, data }));
|
|
60
118
|
}
|
|
61
119
|
};
|
|
62
|
-
(
|
|
63
|
-
|
|
64
|
-
sharedBroadcastChannel = undefined;
|
|
65
|
-
});
|
|
66
|
-
return runtime;
|
|
120
|
+
connect();
|
|
121
|
+
return state;
|
|
67
122
|
}
|
|
68
123
|
function createBroadcastChannel(eventName, _type) {
|
|
69
124
|
const channel = getSharedBroadcastChannel();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broadcast.js","sourceRoot":"","sources":["../../../../src/helpers/redis/broadcast.ts"],"names":[],"mappings":";;;;AACA,qCAAmC;AAEnC,
|
|
1
|
+
{"version":3,"file":"broadcast.js","sourceRoot":"","sources":["../../../../src/helpers/redis/broadcast.ts"],"names":[],"mappings":";;;;AACA,qCAAmC;AAEnC,iDAA2D;AAC3D,kDAA+C;AAC/C,2CAAsD;AACtD,mCAAsC;AAMtC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC,IAAI,sBAAmF,CAAC;AAExF,SAAS,yBAAyB;IAC9B,sBAAsB,KAAK,4BAA4B,EAAE,CAAC;IAC1D,OAAO,sBAAsB,CAAC;AAClC,CAAC;AAED,SAAS,4BAA4B;IACjC,MAAM,MAAM,GAAG,IAAA,YAAC,EAAC,eAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC7C,MAAM,gBAAgB,GAAG,GAAG,IAAA,kBAAQ,GAAE,IAAI,OAAO,CAAC,GAAG,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7B,0EAA0E;IAC1E,oEAAoE;IACpE,4DAA4D;IAC5D,OAAO,KAAK,EAAE,IAAO,EAAiB,EAAE;QACpC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjG,IAAI,WAAW,CAAC,MAAM,KAAK,UAAU;YAAE,MAAM,WAAW,CAAC,MAAM,CAAC;QAChE,IAAI,aAAa,CAAC,MAAM,KAAK,UAAU;YAAE,MAAM,aAAa,CAAC,MAAM,CAAC;IACxE,CAAC,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyno-io/ts-server-foundation",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.923.1957",
|
|
4
4
|
"description": "TypeScript server foundation with reflected type metadata",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@ttsc/graph": "^0.30.1",
|
|
93
93
|
"@types/ws": "^8.18.1",
|
|
94
94
|
"@zyno-io/config": "^1.14.0",
|
|
95
|
-
"@zyno-io/ts-reflection": "26.
|
|
95
|
+
"@zyno-io/ts-reflection": "26.923.1957",
|
|
96
96
|
"bcrypt": "^6.0.0",
|
|
97
97
|
"bullmq": "^6.3.4",
|
|
98
98
|
"busboy": "^1.6.0",
|