@rvoh/psychic-websockets 3.0.0-alpha.2 → 3.1.0
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.
|
@@ -27,6 +27,7 @@ export default class Cable {
|
|
|
27
27
|
this.httpServer = httpServer ?? this.buildHttpServer();
|
|
28
28
|
const config = PsychicAppWebsockets.getOrFail();
|
|
29
29
|
this.io = new socketio.Server(this.httpServer, {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
30
31
|
cors: config.psychicApp.corsOptions,
|
|
31
32
|
...config.socketioOptions,
|
|
32
33
|
});
|
|
@@ -75,8 +76,8 @@ export default class Cable {
|
|
|
75
76
|
* builds an http server and a socket.io server, binding to redis
|
|
76
77
|
* to enable redis pubsub, then starts the http server.
|
|
77
78
|
*/
|
|
78
|
-
async start(port) {
|
|
79
|
-
this.connect();
|
|
79
|
+
async start(port, httpServer) {
|
|
80
|
+
this.connect(httpServer);
|
|
80
81
|
const config = PsychicAppWebsockets.getOrFail();
|
|
81
82
|
for (const hook of config.hooks.wsStart) {
|
|
82
83
|
await hook(this.io);
|
|
@@ -87,10 +88,7 @@ export default class Cable {
|
|
|
87
88
|
}
|
|
88
89
|
});
|
|
89
90
|
this.bindToRedis();
|
|
90
|
-
|
|
91
|
-
await this.listen({
|
|
92
|
-
port: parseInt((port || psychicAppWebsockets.psychicApp.port).toString()),
|
|
93
|
-
});
|
|
91
|
+
await this.listen({ port });
|
|
94
92
|
}
|
|
95
93
|
/**
|
|
96
94
|
* stops the socket.io server, closing out of all redis connections
|
|
@@ -27,6 +27,7 @@ export default class Cable {
|
|
|
27
27
|
this.httpServer = httpServer ?? this.buildHttpServer();
|
|
28
28
|
const config = PsychicAppWebsockets.getOrFail();
|
|
29
29
|
this.io = new socketio.Server(this.httpServer, {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
30
31
|
cors: config.psychicApp.corsOptions,
|
|
31
32
|
...config.socketioOptions,
|
|
32
33
|
});
|
|
@@ -75,8 +76,8 @@ export default class Cable {
|
|
|
75
76
|
* builds an http server and a socket.io server, binding to redis
|
|
76
77
|
* to enable redis pubsub, then starts the http server.
|
|
77
78
|
*/
|
|
78
|
-
async start(port) {
|
|
79
|
-
this.connect();
|
|
79
|
+
async start(port, httpServer) {
|
|
80
|
+
this.connect(httpServer);
|
|
80
81
|
const config = PsychicAppWebsockets.getOrFail();
|
|
81
82
|
for (const hook of config.hooks.wsStart) {
|
|
82
83
|
await hook(this.io);
|
|
@@ -87,10 +88,7 @@ export default class Cable {
|
|
|
87
88
|
}
|
|
88
89
|
});
|
|
89
90
|
this.bindToRedis();
|
|
90
|
-
|
|
91
|
-
await this.listen({
|
|
92
|
-
port: parseInt((port || psychicAppWebsockets.psychicApp.port).toString()),
|
|
93
|
-
});
|
|
91
|
+
await this.listen({ port });
|
|
94
92
|
}
|
|
95
93
|
/**
|
|
96
94
|
* stops the socket.io server, closing out of all redis connections
|
|
@@ -19,7 +19,7 @@ export default class Cable {
|
|
|
19
19
|
* builds an http server and a socket.io server, binding to redis
|
|
20
20
|
* to enable redis pubsub, then starts the http server.
|
|
21
21
|
*/
|
|
22
|
-
start(port?:
|
|
22
|
+
start(port: number, httpServer?: http.Server | https.Server): Promise<void>;
|
|
23
23
|
/**
|
|
24
24
|
* stops the socket.io server, closing out of all redis connections
|
|
25
25
|
*/
|
|
@@ -30,7 +30,7 @@ export default class Cable {
|
|
|
30
30
|
* stops the socket.io server, closing out of all redis connections
|
|
31
31
|
*/
|
|
32
32
|
listen({ port }: {
|
|
33
|
-
port: number
|
|
33
|
+
port: number;
|
|
34
34
|
}): Promise<unknown>;
|
|
35
35
|
/**
|
|
36
36
|
* @internal
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@rvoh/psychic-websockets",
|
|
4
4
|
"description": "Websocket system for Psychic applications",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.1.0",
|
|
6
6
|
"author": "RVO Health",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"prepack": "pnpm build"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@rvoh/dream": "
|
|
45
|
-
"@rvoh/psychic": "
|
|
44
|
+
"@rvoh/dream": ">=2.0.0",
|
|
45
|
+
"@rvoh/psychic": ">=2.3.8",
|
|
46
46
|
"@socket.io/redis-adapter": "*",
|
|
47
47
|
"@socket.io/redis-emitter": "*",
|
|
48
48
|
"ioredis": "*",
|
|
@@ -51,38 +51,48 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@eslint/js": "^9.0.0",
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@rvoh/
|
|
54
|
+
"@koa/cors": "^5.0.0",
|
|
55
|
+
"@koa/etag": "^5.0.2",
|
|
56
|
+
"@koa/router": "^15.4.0",
|
|
57
|
+
"@rvoh/dream": "^2.5.3",
|
|
58
|
+
"@rvoh/dream-spec-helpers": "^2.1.1",
|
|
59
|
+
"@rvoh/psychic": "^3.0.3",
|
|
60
|
+
"@rvoh/psychic-spec-helpers": "^3.0.0",
|
|
58
61
|
"@socket.io/redis-adapter": "^8.3.0",
|
|
59
62
|
"@socket.io/redis-emitter": "^5.1.0",
|
|
60
|
-
"@types/
|
|
63
|
+
"@types/koa": "^3.0.2",
|
|
64
|
+
"@types/koa-bodyparser": "^4.3.13",
|
|
65
|
+
"@types/koa-conditional-get": "^2.0.4",
|
|
66
|
+
"@types/koa-etag": "^3.0.4",
|
|
67
|
+
"@types/koa__cors": "^5.0.1",
|
|
68
|
+
"@types/koa__router": "^12.0.5",
|
|
61
69
|
"@types/node": "^22.19.1",
|
|
62
70
|
"@types/pg": "^8",
|
|
63
71
|
"@types/supertest": "^6.0.3",
|
|
64
72
|
"@typescript-eslint/parser": "^8.48.1",
|
|
65
73
|
"bullmq": "^5.63.2",
|
|
66
74
|
"eslint": "^9.39.1",
|
|
67
|
-
"express": "^4.22.1",
|
|
68
75
|
"ioredis": "^5.4.1",
|
|
69
|
-
"
|
|
76
|
+
"koa": "^3.1.2",
|
|
77
|
+
"koa-bodyparser": "^4.4.1",
|
|
78
|
+
"koa-conditional-get": "^3.0.0",
|
|
79
|
+
"kysely": "^0.28.13",
|
|
70
80
|
"kysely-codegen": "^0.17.0",
|
|
71
81
|
"luxon-jest-matchers": "^0.1.14",
|
|
72
82
|
"openapi-typescript": "^7.9.1",
|
|
73
83
|
"pg": "^8.13.1",
|
|
74
84
|
"prettier": "^3.3.3",
|
|
75
|
-
"puppeteer": "^24.
|
|
76
|
-
"socket.io": "^4.8.
|
|
85
|
+
"puppeteer": "^24.40.0",
|
|
86
|
+
"socket.io": "^4.8.3",
|
|
77
87
|
"socket.io-adapter": "^2.5.5",
|
|
78
|
-
"socket.io-client": "^4.8.
|
|
88
|
+
"socket.io-client": "^4.8.3",
|
|
79
89
|
"supertest": "^7.1.4",
|
|
80
90
|
"tslib": "^2.7.0",
|
|
81
91
|
"tsx": "^4.19.3",
|
|
82
92
|
"typedoc": "^0.26.11",
|
|
83
93
|
"typescript": "^5.8.2",
|
|
84
94
|
"typescript-eslint": "^8.48.1",
|
|
85
|
-
"vitest": "^
|
|
95
|
+
"vitest": "^4.1.0"
|
|
86
96
|
},
|
|
87
97
|
"dependencies": {
|
|
88
98
|
"commander": "^14.0.2",
|