@nestjs/websockets 10.4.20 → 10.4.21

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.
@@ -0,0 +1,23 @@
1
+ /**
2
+ * WebSockets `ack` parameter decorator.
3
+ * Extracts the `ack` callback function from the arguments of a ws event.
4
+ *
5
+ * This decorator signals to the framework that the `ack` callback will be
6
+ * handled manually within the method, preventing the framework from
7
+ * automatically sending an acknowledgement based on the return value.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * @SubscribeMessage('events')
12
+ * onEvent(
13
+ * @MessageBody() data: string,
14
+ * @Ack() ack: (response: any) => void
15
+ * ) {
16
+ * // Manually call the ack callback
17
+ * ack({ status: 'ok' });
18
+ * }
19
+ * ```
20
+ *
21
+ * @publicApi
22
+ */
23
+ export declare function Ack(): ParameterDecorator;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Ack = Ack;
4
+ const ws_paramtype_enum_1 = require("../enums/ws-paramtype.enum");
5
+ const param_utils_1 = require("../utils/param.utils");
6
+ /**
7
+ * WebSockets `ack` parameter decorator.
8
+ * Extracts the `ack` callback function from the arguments of a ws event.
9
+ *
10
+ * This decorator signals to the framework that the `ack` callback will be
11
+ * handled manually within the method, preventing the framework from
12
+ * automatically sending an acknowledgement based on the return value.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * @SubscribeMessage('events')
17
+ * onEvent(
18
+ * @MessageBody() data: string,
19
+ * @Ack() ack: (response: any) => void
20
+ * ) {
21
+ * // Manually call the ack callback
22
+ * ack({ status: 'ok' });
23
+ * }
24
+ * ```
25
+ *
26
+ * @publicApi
27
+ */
28
+ function Ack() {
29
+ return (0, param_utils_1.createPipesWsParamDecorator)(ws_paramtype_enum_1.WsParamtype.ACK)();
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/websockets",
3
- "version": "10.4.20",
3
+ "version": "10.4.21",
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.8.1"
19
19
  },
20
20
  "devDependencies": {
21
- "@nestjs/common": "10.4.20",
22
- "@nestjs/core": "10.4.20"
21
+ "@nestjs/common": "^10.4.21",
22
+ "@nestjs/core": "^10.4.21"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@nestjs/common": "^10.0.0",
@@ -32,5 +32,6 @@
32
32
  "@nestjs/platform-socket.io": {
33
33
  "optional": true
34
34
  }
35
- }
35
+ },
36
+ "gitHead": "fd11464a6ee9c5c2619ecfa97d984703e8afaa4b"
36
37
  }