@nestjs/websockets 10.2.5 → 10.2.7
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/Readme.md
CHANGED
|
@@ -89,7 +89,9 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
89
89
|
|
|
90
90
|
<table style="text-align:center;"><tr>
|
|
91
91
|
<td><a href="https://n.inc" target="_blank"><img src="https://nestjs.com/img/n-inc-logo.svg" width="120" valign="middle" /></td>
|
|
92
|
-
<td><a href="https://twistag.com/" target="_blank"><img src="https://nestjs.com/img/twistag-logo.png" width="120" valign="middle" /></td
|
|
92
|
+
<td><a href="https://twistag.com/" target="_blank"><img src="https://nestjs.com/img/twistag-logo.png" width="120" valign="middle" /></td>
|
|
93
|
+
<td><a href="https://immediateedgeapp.org/" target="_blank"><img src="https://nestjs.com/img/immediate-edge-logo.png" width="120" valign="middle" /></td>
|
|
94
|
+
</tr>
|
|
93
95
|
</table>
|
|
94
96
|
|
|
95
97
|
#### Sponsors
|
|
@@ -116,6 +118,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
116
118
|
<td align="center" valign="middle"><a href="https://www.hingehealth.com/" target="_blank"><img src="https://nestjs.com/img/hinge-health-logo.svg" width="100" valign="middle" /></a></td>
|
|
117
119
|
<td align="center" valign="middle"><a href="https://julienferand.dev/" target="_blank"><img src="https://nestjs.com/img/julienferand-logo.jpeg" width="65" valign="middle" /></a></td>
|
|
118
120
|
<td align="center" valign="middle"><a href="https://www.tripoffice.com/" target="_blank"><img src="https://nestjs.com/img/tripoffice-logo.png" width="140" valign="middle" /></a></td>
|
|
121
|
+
<td align="center" valign="middle"><a href="https://solcellsforetag.se/" target="_blank"><img src="https://nestjs.com/img/solcellsforetag-logo.svg" width="140" valign="middle" /></a></td>
|
|
119
122
|
</tr></table>
|
|
120
123
|
|
|
121
124
|
## Backers
|
|
@@ -124,9 +127,9 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
124
127
|
|
|
125
128
|
## Stay in touch
|
|
126
129
|
|
|
127
|
-
- Author - [Kamil Myśliwiec](https://
|
|
130
|
+
- Author - [Kamil Myśliwiec](https://x.com/kammysliwiec)
|
|
128
131
|
- Website - [https://nestjs.com](https://nestjs.com/)
|
|
129
|
-
-
|
|
132
|
+
- X - [@nestframework](https://x.com/nestframework)
|
|
130
133
|
|
|
131
134
|
## License
|
|
132
135
|
|
|
@@ -44,12 +44,13 @@ class WsContextCreator {
|
|
|
44
44
|
}
|
|
45
45
|
return callback.apply(instance, args);
|
|
46
46
|
};
|
|
47
|
+
const targetPattern = this.reflectCallbackPattern(callback);
|
|
47
48
|
return this.wsProxy.create(async (...args) => {
|
|
48
|
-
args.push(
|
|
49
|
+
args.push(targetPattern);
|
|
49
50
|
const initialArgs = this.contextUtils.createNullArray(argsLength);
|
|
50
51
|
fnCanActivate && (await fnCanActivate(args));
|
|
51
52
|
return this.interceptorsConsumer.intercept(interceptors, args, instance, callback, handler(initialArgs, args), contextType);
|
|
52
|
-
}, exceptionHandler);
|
|
53
|
+
}, exceptionHandler, targetPattern);
|
|
53
54
|
}
|
|
54
55
|
reflectCallbackParamtypes(instance, callback) {
|
|
55
56
|
return Reflect.getMetadata(constants_1.PARAMTYPES_METADATA, instance, callback.name);
|
package/context/ws-proxy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WsExceptionsHandler } from '../exceptions/ws-exceptions-handler';
|
|
2
2
|
export declare class WsProxy {
|
|
3
|
-
create(targetCallback: (...args: unknown[]) => Promise<any>, exceptionsHandler: WsExceptionsHandler): (...args: unknown[]) => Promise<any>;
|
|
3
|
+
create(targetCallback: (...args: unknown[]) => Promise<any>, exceptionsHandler: WsExceptionsHandler, targetPattern?: string): (...args: unknown[]) => Promise<any>;
|
|
4
4
|
handleError<T>(exceptionsHandler: WsExceptionsHandler, args: unknown[], error: T): void;
|
|
5
5
|
}
|
package/context/ws-proxy.js
CHANGED
|
@@ -5,8 +5,9 @@ const execution_context_host_1 = require("@nestjs/core/helpers/execution-context
|
|
|
5
5
|
const rxjs_1 = require("rxjs");
|
|
6
6
|
const operators_1 = require("rxjs/operators");
|
|
7
7
|
class WsProxy {
|
|
8
|
-
create(targetCallback, exceptionsHandler) {
|
|
8
|
+
create(targetCallback, exceptionsHandler, targetPattern) {
|
|
9
9
|
return async (...args) => {
|
|
10
|
+
args = [...args, targetPattern ?? 'unknown'];
|
|
10
11
|
try {
|
|
11
12
|
const result = await targetCallback(...args);
|
|
12
13
|
return !(0, rxjs_1.isObservable)(result)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/websockets",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.7",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@websockets)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"tslib": "2.6.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@nestjs/common": "10.2.
|
|
22
|
-
"@nestjs/core": "10.2.
|
|
21
|
+
"@nestjs/common": "10.2.7",
|
|
22
|
+
"@nestjs/core": "10.2.7"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@nestjs/common": "^10.0.0",
|