@mono-labs/dev 0.1.251 → 0.1.255
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/cache-relay.d.ts +162 -0
- package/dist/cache-relay.d.ts.map +1 -0
- package/dist/cache-relay.js +300 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/local-server/index.d.ts.map +1 -1
- package/dist/local-server/index.js +7 -1
- package/dist/local-server/types.d.ts +2 -0
- package/dist/local-server/types.d.ts.map +1 -1
- package/dist/websocket/channel-store.d.ts +28 -0
- package/dist/websocket/channel-store.d.ts.map +1 -0
- package/dist/websocket/channel-store.js +91 -0
- package/dist/websocket/index.d.ts +8 -1
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js +27 -1
- package/dist/websocket/socket-emitter.d.ts +25 -0
- package/dist/websocket/socket-emitter.d.ts.map +1 -0
- package/dist/websocket/socket-emitter.js +49 -0
- package/dist/websocket/types.d.ts +9 -0
- package/dist/websocket/types.d.ts.map +1 -1
- package/package.json +9 -1
- package/src/cache-relay.ts +487 -0
- package/src/index.ts +24 -0
- package/src/local-server/index.ts +7 -1
- package/src/local-server/types.ts +2 -0
- package/src/websocket/channel-store.ts +116 -0
- package/src/websocket/index.ts +27 -1
- package/src/websocket/socket-emitter.ts +64 -0
- package/src/websocket/types.ts +10 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisChannelStore = exports.InMemoryChannelStore = void 0;
|
|
4
|
+
// ---- InMemoryChannelStore --------------------------------------------------
|
|
5
|
+
class InMemoryChannelStore {
|
|
6
|
+
channelToConnections = new Map();
|
|
7
|
+
connectionToChannels = new Map();
|
|
8
|
+
async subscribe(connectionId, channel) {
|
|
9
|
+
let conns = this.channelToConnections.get(channel);
|
|
10
|
+
if (!conns) {
|
|
11
|
+
conns = new Set();
|
|
12
|
+
this.channelToConnections.set(channel, conns);
|
|
13
|
+
}
|
|
14
|
+
conns.add(connectionId);
|
|
15
|
+
let channels = this.connectionToChannels.get(connectionId);
|
|
16
|
+
if (!channels) {
|
|
17
|
+
channels = new Set();
|
|
18
|
+
this.connectionToChannels.set(connectionId, channels);
|
|
19
|
+
}
|
|
20
|
+
channels.add(channel);
|
|
21
|
+
}
|
|
22
|
+
async unsubscribe(connectionId, channel) {
|
|
23
|
+
const conns = this.channelToConnections.get(channel);
|
|
24
|
+
if (conns) {
|
|
25
|
+
conns.delete(connectionId);
|
|
26
|
+
if (conns.size === 0)
|
|
27
|
+
this.channelToConnections.delete(channel);
|
|
28
|
+
}
|
|
29
|
+
const channels = this.connectionToChannels.get(connectionId);
|
|
30
|
+
if (channels) {
|
|
31
|
+
channels.delete(channel);
|
|
32
|
+
if (channels.size === 0)
|
|
33
|
+
this.connectionToChannels.delete(connectionId);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async getSubscribers(channel) {
|
|
37
|
+
const conns = this.channelToConnections.get(channel);
|
|
38
|
+
return conns ? Array.from(conns) : [];
|
|
39
|
+
}
|
|
40
|
+
async removeAll(connectionId) {
|
|
41
|
+
const channels = this.connectionToChannels.get(connectionId);
|
|
42
|
+
if (!channels)
|
|
43
|
+
return;
|
|
44
|
+
for (const channel of channels) {
|
|
45
|
+
const conns = this.channelToConnections.get(channel);
|
|
46
|
+
if (conns) {
|
|
47
|
+
conns.delete(connectionId);
|
|
48
|
+
if (conns.size === 0)
|
|
49
|
+
this.channelToConnections.delete(channel);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
this.connectionToChannels.delete(connectionId);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.InMemoryChannelStore = InMemoryChannelStore;
|
|
56
|
+
// ---- RedisChannelStore -----------------------------------------------------
|
|
57
|
+
class RedisChannelStore {
|
|
58
|
+
channelKeyPrefix;
|
|
59
|
+
connChannelsPrefix;
|
|
60
|
+
constructor(options) {
|
|
61
|
+
const prefix = options?.keyPrefix ?? 'ws:';
|
|
62
|
+
this.channelKeyPrefix = `${prefix}channel:`;
|
|
63
|
+
this.connChannelsPrefix = `${prefix}conn-channels:`;
|
|
64
|
+
}
|
|
65
|
+
getRelay() {
|
|
66
|
+
// Lazy import to avoid circular dependency and to defer until Redis is initialized
|
|
67
|
+
const { getCacheRelay } = require('../cache-relay');
|
|
68
|
+
return getCacheRelay();
|
|
69
|
+
}
|
|
70
|
+
async subscribe(connectionId, channel) {
|
|
71
|
+
const relay = this.getRelay();
|
|
72
|
+
await relay.raw.sadd(`${this.channelKeyPrefix}${channel}`, connectionId);
|
|
73
|
+
await relay.raw.sadd(`${this.connChannelsPrefix}${connectionId}`, channel);
|
|
74
|
+
}
|
|
75
|
+
async unsubscribe(connectionId, channel) {
|
|
76
|
+
const relay = this.getRelay();
|
|
77
|
+
await relay.raw.srem(`${this.channelKeyPrefix}${channel}`, connectionId);
|
|
78
|
+
await relay.raw.srem(`${this.connChannelsPrefix}${connectionId}`, channel);
|
|
79
|
+
}
|
|
80
|
+
async getSubscribers(channel) {
|
|
81
|
+
const relay = this.getRelay();
|
|
82
|
+
return relay.raw.smembers(`${this.channelKeyPrefix}${channel}`);
|
|
83
|
+
}
|
|
84
|
+
async removeAll(connectionId) {
|
|
85
|
+
const relay = this.getRelay();
|
|
86
|
+
const channels = await relay.raw.smembers(`${this.connChannelsPrefix}${connectionId}`);
|
|
87
|
+
await Promise.allSettled(channels.map((channel) => relay.raw.srem(`${this.channelKeyPrefix}${channel}`, connectionId)));
|
|
88
|
+
await relay.raw.del(`${this.connChannelsPrefix}${connectionId}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.RedisChannelStore = RedisChannelStore;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { WebSocket, WebSocketServer } from 'ws';
|
|
2
2
|
import { ActionRouter } from './action-router';
|
|
3
3
|
import { ConnectionRegistry } from './connection-registry';
|
|
4
|
+
import { SocketEmitter } from './socket-emitter';
|
|
4
5
|
import type { SocketAdapterConfig } from './types';
|
|
5
|
-
export type { ConnectionId, PostToConnectionFn, SocketAdapterConfig } from './types';
|
|
6
|
+
export type { ConnectionId, PostToConnectionFn, SocketAdapterConfig, RedisConfig } from './types';
|
|
6
7
|
export { ConnectionRegistry } from './connection-registry';
|
|
7
8
|
export { LocalGatewayClient } from './local-gateway-client';
|
|
8
9
|
export { ActionRouter } from './action-router';
|
|
10
|
+
export { InMemoryChannelStore, RedisChannelStore } from './channel-store';
|
|
11
|
+
export type { ChannelStore } from './channel-store';
|
|
12
|
+
export { SocketEmitter } from './socket-emitter';
|
|
13
|
+
export type { EmitTarget } from './socket-emitter';
|
|
9
14
|
/**
|
|
10
15
|
* Attaches a full socket adapter to a WebSocketServer instance.
|
|
11
16
|
* Maps 1:1 to each API Gateway WebSocket event so local dev
|
|
@@ -15,6 +20,8 @@ export declare function attachSocketAdapter(wss: WebSocketServer, config?: Socke
|
|
|
15
20
|
postToConnection: import("./types").PostToConnectionFn;
|
|
16
21
|
connectionRegistry: ConnectionRegistry;
|
|
17
22
|
actionRouter: ActionRouter;
|
|
23
|
+
channelStore: import("./channel-store").ChannelStore;
|
|
24
|
+
socketEmitter: SocketEmitter;
|
|
18
25
|
getConnectionId: (ws: WebSocket) => string | undefined;
|
|
19
26
|
};
|
|
20
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/websocket/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,IAAI,CAAA;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/websocket/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,IAAI,CAAA;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAI1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,OAAO,KAAK,EAAgB,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAEhE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACjG,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACzE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,mBAAmB;;;;;;0BAgJ9D,SAAS;EAEhC"}
|
package/dist/websocket/index.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionRouter = exports.LocalGatewayClient = exports.ConnectionRegistry = void 0;
|
|
3
|
+
exports.SocketEmitter = exports.RedisChannelStore = exports.InMemoryChannelStore = exports.ActionRouter = exports.LocalGatewayClient = exports.ConnectionRegistry = void 0;
|
|
4
4
|
exports.attachSocketAdapter = attachSocketAdapter;
|
|
5
5
|
const action_router_1 = require("./action-router");
|
|
6
6
|
const connection_registry_1 = require("./connection-registry");
|
|
7
7
|
const event_synthesizer_1 = require("./event-synthesizer");
|
|
8
8
|
const local_gateway_client_1 = require("./local-gateway-client");
|
|
9
|
+
const channel_store_1 = require("./channel-store");
|
|
10
|
+
const socket_emitter_1 = require("./socket-emitter");
|
|
11
|
+
const cache_relay_1 = require("../cache-relay");
|
|
9
12
|
var connection_registry_2 = require("./connection-registry");
|
|
10
13
|
Object.defineProperty(exports, "ConnectionRegistry", { enumerable: true, get: function () { return connection_registry_2.ConnectionRegistry; } });
|
|
11
14
|
var local_gateway_client_2 = require("./local-gateway-client");
|
|
12
15
|
Object.defineProperty(exports, "LocalGatewayClient", { enumerable: true, get: function () { return local_gateway_client_2.LocalGatewayClient; } });
|
|
13
16
|
var action_router_2 = require("./action-router");
|
|
14
17
|
Object.defineProperty(exports, "ActionRouter", { enumerable: true, get: function () { return action_router_2.ActionRouter; } });
|
|
18
|
+
var channel_store_2 = require("./channel-store");
|
|
19
|
+
Object.defineProperty(exports, "InMemoryChannelStore", { enumerable: true, get: function () { return channel_store_2.InMemoryChannelStore; } });
|
|
20
|
+
Object.defineProperty(exports, "RedisChannelStore", { enumerable: true, get: function () { return channel_store_2.RedisChannelStore; } });
|
|
21
|
+
var socket_emitter_2 = require("./socket-emitter");
|
|
22
|
+
Object.defineProperty(exports, "SocketEmitter", { enumerable: true, get: function () { return socket_emitter_2.SocketEmitter; } });
|
|
15
23
|
/**
|
|
16
24
|
* Attaches a full socket adapter to a WebSocketServer instance.
|
|
17
25
|
* Maps 1:1 to each API Gateway WebSocket event so local dev
|
|
@@ -25,6 +33,21 @@ function attachSocketAdapter(wss, config) {
|
|
|
25
33
|
const gatewayClient = new local_gateway_client_1.LocalGatewayClient(connectionRegistry);
|
|
26
34
|
const postToConnection = gatewayClient.asFunction();
|
|
27
35
|
const actionRouter = new action_router_1.ActionRouter();
|
|
36
|
+
// Create channel store
|
|
37
|
+
let channelStore = config?.channelStore;
|
|
38
|
+
if (!channelStore) {
|
|
39
|
+
if (config?.useRedis) {
|
|
40
|
+
const host = config.redis?.host ?? 'localhost';
|
|
41
|
+
const port = config.redis?.port ?? 6379;
|
|
42
|
+
(0, cache_relay_1.initCacheRelay)(`${host}:${port}`);
|
|
43
|
+
channelStore = new channel_store_1.RedisChannelStore({ keyPrefix: config.redis?.keyPrefix });
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
channelStore = new channel_store_1.InMemoryChannelStore();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Create socket emitter
|
|
50
|
+
const socketEmitter = new socket_emitter_1.SocketEmitter({ postToConnection, connectionRegistry, channelStore });
|
|
28
51
|
// Register consumer-provided routes
|
|
29
52
|
if (config?.routes) {
|
|
30
53
|
for (const [action, handler] of Object.entries(config.routes)) {
|
|
@@ -118,6 +141,7 @@ function attachSocketAdapter(wss, config) {
|
|
|
118
141
|
if (debug) {
|
|
119
142
|
console.log(`[socket-adapter] $disconnect connectionId=${connectionId} code=${code} reason=${reason.toString()}`);
|
|
120
143
|
}
|
|
144
|
+
await channelStore.removeAll(connectionId);
|
|
121
145
|
await disconnectHandler(connectionId);
|
|
122
146
|
connectionRegistry.unregister(connectionId);
|
|
123
147
|
wsToConnectionId.delete(ws);
|
|
@@ -127,6 +151,8 @@ function attachSocketAdapter(wss, config) {
|
|
|
127
151
|
postToConnection,
|
|
128
152
|
connectionRegistry,
|
|
129
153
|
actionRouter,
|
|
154
|
+
channelStore,
|
|
155
|
+
socketEmitter,
|
|
130
156
|
getConnectionId: (ws) => wsToConnectionId.get(ws),
|
|
131
157
|
};
|
|
132
158
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ConnectionRegistry } from './connection-registry';
|
|
2
|
+
import type { ChannelStore } from './channel-store';
|
|
3
|
+
import type { PostToConnectionFn } from './types';
|
|
4
|
+
export type EmitTarget = {
|
|
5
|
+
userId: string;
|
|
6
|
+
} | {
|
|
7
|
+
orgId: string;
|
|
8
|
+
} | {
|
|
9
|
+
connectionId: string;
|
|
10
|
+
} | {
|
|
11
|
+
channel: string;
|
|
12
|
+
} | 'broadcast';
|
|
13
|
+
export declare class SocketEmitter {
|
|
14
|
+
private postToConnection;
|
|
15
|
+
private connectionRegistry;
|
|
16
|
+
private channelStore;
|
|
17
|
+
constructor(deps: {
|
|
18
|
+
postToConnection: PostToConnectionFn;
|
|
19
|
+
connectionRegistry: ConnectionRegistry;
|
|
20
|
+
channelStore: ChannelStore;
|
|
21
|
+
});
|
|
22
|
+
emit(target: EmitTarget, data: unknown): Promise<void>;
|
|
23
|
+
private resolveConnectionIds;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=socket-emitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socket-emitter.d.ts","sourceRoot":"","sources":["../../src/websocket/socket-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAgB,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE/D,MAAM,MAAM,UAAU,GACnB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,GACxB;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GACnB,WAAW,CAAA;AAEd,qBAAa,aAAa;IACzB,OAAO,CAAC,gBAAgB,CAAoB;IAC5C,OAAO,CAAC,kBAAkB,CAAoB;IAC9C,OAAO,CAAC,YAAY,CAAc;gBAEtB,IAAI,EAAE;QACjB,gBAAgB,EAAE,kBAAkB,CAAA;QACpC,kBAAkB,EAAE,kBAAkB,CAAA;QACtC,YAAY,EAAE,YAAY,CAAA;KAC1B;IAMK,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;YAmB9C,oBAAoB;CAkBlC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SocketEmitter = void 0;
|
|
4
|
+
class SocketEmitter {
|
|
5
|
+
postToConnection;
|
|
6
|
+
connectionRegistry;
|
|
7
|
+
channelStore;
|
|
8
|
+
constructor(deps) {
|
|
9
|
+
this.postToConnection = deps.postToConnection;
|
|
10
|
+
this.connectionRegistry = deps.connectionRegistry;
|
|
11
|
+
this.channelStore = deps.channelStore;
|
|
12
|
+
}
|
|
13
|
+
async emit(target, data) {
|
|
14
|
+
const connectionIds = await this.resolveConnectionIds(target);
|
|
15
|
+
if (connectionIds.length === 0)
|
|
16
|
+
return;
|
|
17
|
+
const payload = typeof data === 'string' ? data : JSON.stringify(data);
|
|
18
|
+
await Promise.allSettled(connectionIds.map(async (connId) => {
|
|
19
|
+
try {
|
|
20
|
+
await this.postToConnection(connId, payload);
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
const e = err;
|
|
24
|
+
if (e?.statusCode === 410 || e?.name === 'GoneException')
|
|
25
|
+
return;
|
|
26
|
+
console.error(`[SocketEmitter] failed to send to ${connId}:`, err);
|
|
27
|
+
}
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
async resolveConnectionIds(target) {
|
|
31
|
+
if (target === 'broadcast') {
|
|
32
|
+
return this.connectionRegistry.getAll();
|
|
33
|
+
}
|
|
34
|
+
if ('connectionId' in target) {
|
|
35
|
+
return [target.connectionId];
|
|
36
|
+
}
|
|
37
|
+
if ('userId' in target) {
|
|
38
|
+
return this.connectionRegistry.getConnectionsByUserId(target.userId);
|
|
39
|
+
}
|
|
40
|
+
if ('orgId' in target) {
|
|
41
|
+
return this.connectionRegistry.getConnectionsByOrgId(target.orgId);
|
|
42
|
+
}
|
|
43
|
+
if ('channel' in target) {
|
|
44
|
+
return this.channelStore.getSubscribers(target.channel);
|
|
45
|
+
}
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.SocketEmitter = SocketEmitter;
|
|
@@ -42,6 +42,12 @@ export type ConnectHandlerFn = (connectionId: ConnectionId, params: {
|
|
|
42
42
|
}>;
|
|
43
43
|
/** Handler called on $disconnect */
|
|
44
44
|
export type DisconnectHandlerFn = (connectionId: ConnectionId) => Promise<void>;
|
|
45
|
+
/** Redis connection configuration */
|
|
46
|
+
export interface RedisConfig {
|
|
47
|
+
host?: string;
|
|
48
|
+
port?: number;
|
|
49
|
+
keyPrefix?: string;
|
|
50
|
+
}
|
|
45
51
|
/** Configuration for the socket adapter */
|
|
46
52
|
export interface SocketAdapterConfig {
|
|
47
53
|
domainName?: string;
|
|
@@ -51,5 +57,8 @@ export interface SocketAdapterConfig {
|
|
|
51
57
|
disconnectHandler?: DisconnectHandlerFn;
|
|
52
58
|
routes?: Record<string, ActionHandler>;
|
|
53
59
|
defaultHandler?: ActionHandler;
|
|
60
|
+
channelStore?: import('./channel-store').ChannelStore;
|
|
61
|
+
useRedis?: boolean;
|
|
62
|
+
redis?: RedisConfig;
|
|
54
63
|
}
|
|
55
64
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/websocket/types.ts"],"names":[],"mappings":"AAEA,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACtB;AAED,sFAAsF;AACtF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAA;AAEjC,6FAA6F;AAC7F,MAAM,MAAM,kBAAkB,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,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
|
|
5
5
|
"description": "Local development server and WebSocket adapter for mono-labs",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,6 +26,14 @@
|
|
|
26
26
|
"express": "^4.21.0",
|
|
27
27
|
"ws": "^8.18.0"
|
|
28
28
|
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"ioredis": ">=5.0.0"
|
|
31
|
+
},
|
|
32
|
+
"peerDependenciesMeta": {
|
|
33
|
+
"ioredis": {
|
|
34
|
+
"optional": true
|
|
35
|
+
}
|
|
36
|
+
},
|
|
29
37
|
"devDependencies": {
|
|
30
38
|
"@types/cors": "^2.8.17",
|
|
31
39
|
"@types/express": "^5.0.0",
|