@eleven-am/pondsocket-express 0.0.29 → 0.0.30
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/index.d.ts +4 -6
- package/index.js +2 -4
- package/package.json +8 -8
package/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Endpoint, PondPath, RequestHandler, ConnectionContext } from '@eleven-am/pondsocket/types';
|
|
2
2
|
import type { Express } from 'express';
|
|
3
|
-
type ExpressUpgradeHandler<Path extends string> = (request: IncomingConnection<Path>, response: ConnectionResponse) => void | Promise<void>;
|
|
4
3
|
declare global {
|
|
5
4
|
namespace Express {
|
|
6
5
|
interface Application {
|
|
7
|
-
|
|
6
|
+
createEndpoint<Path extends string>(path: PondPath<Path>, handler: RequestHandler<ConnectionContext<Path>>): Endpoint;
|
|
8
7
|
}
|
|
9
8
|
}
|
|
10
9
|
}
|
|
@@ -25,13 +24,12 @@ interface PondSocketExpressApp extends Express {
|
|
|
25
24
|
* });
|
|
26
25
|
* })
|
|
27
26
|
*/
|
|
28
|
-
|
|
27
|
+
createEndpoint<Path extends string>(path: PondPath<Path>, handler: RequestHandler<ConnectionContext<Path>>): Endpoint;
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
30
|
* @desc Creates a pond socket server
|
|
32
31
|
* @param app - The Express app to be used by the server
|
|
33
|
-
* @param redisOptions - The options to be used by the redis client
|
|
34
32
|
* @constructor
|
|
35
33
|
*/
|
|
36
|
-
declare const pondSocket: (app: Express
|
|
34
|
+
declare const pondSocket: (app: Express) => PondSocketExpressApp;
|
|
37
35
|
export default pondSocket;
|
package/index.js
CHANGED
|
@@ -8,16 +8,14 @@ const pondsocket_1 = __importDefault(require("@eleven-am/pondsocket"));
|
|
|
8
8
|
/**
|
|
9
9
|
* @desc Creates a pond socket server
|
|
10
10
|
* @param app - The Express app to be used by the server
|
|
11
|
-
* @param redisOptions - The options to be used by the redis client
|
|
12
11
|
* @constructor
|
|
13
12
|
*/
|
|
14
|
-
const pondSocket = (app
|
|
13
|
+
const pondSocket = (app) => {
|
|
15
14
|
const server = (0, http_1.createServer)(app);
|
|
16
15
|
const pondSocket = new pondsocket_1.default({
|
|
17
16
|
server,
|
|
18
|
-
redisOptions,
|
|
19
17
|
});
|
|
20
|
-
app.
|
|
18
|
+
app.createEndpoint = (path, handler) => pondSocket.createEndpoint(path, handler);
|
|
21
19
|
app.listen = (...args) => pondSocket.listen(...args);
|
|
22
20
|
return app;
|
|
23
21
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eleven-am/pondsocket-express",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"description": "PondSocket is a fast simple socket server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"socket",
|
|
@@ -29,23 +29,23 @@
|
|
|
29
29
|
"pipeline": "npm run lint && npm run build && npm run push"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eleven-am/pondsocket": "^0.1.
|
|
32
|
+
"@eleven-am/pondsocket": "^0.1.200"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@eslint/compat": "^1.2.
|
|
35
|
+
"@eslint/compat": "^1.2.9",
|
|
36
36
|
"@eslint/eslintrc": "^3.3.1",
|
|
37
|
-
"@eslint/js": "^9.
|
|
37
|
+
"@eslint/js": "^9.26.0",
|
|
38
38
|
"@stylistic/eslint-plugin-ts": "^4.2.0",
|
|
39
39
|
"@types/express": "^5.0.1",
|
|
40
40
|
"@types/jest": "^29.5.14",
|
|
41
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
42
|
-
"eslint": "^9.
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
42
|
+
"eslint": "^9.26.0",
|
|
43
43
|
"eslint-plugin-file-progress": "^3.0.2",
|
|
44
44
|
"eslint-plugin-import": "^2.31.0",
|
|
45
|
-
"globals": "^16.
|
|
45
|
+
"globals": "^16.1.0",
|
|
46
46
|
"jest": "^29.7.0",
|
|
47
47
|
"prettier": "^3.5.3",
|
|
48
|
-
"ts-jest": "^29.3.
|
|
48
|
+
"ts-jest": "^29.3.3",
|
|
49
49
|
"ts-loader": "^9.5.2",
|
|
50
50
|
"ts-node": "^10.9.2",
|
|
51
51
|
"typescript": "^5.8.3"
|