@depup/nestjs__common 11.1.29-depup.0 → 11.2.0-depup.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.
package/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/nestjs__common
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [@nestjs/common](https://www.npmjs.com/package/@nestjs/common) @ 11.1.29 |
17
- | Processed | 2026-08-10 |
16
+ | Original | [@nestjs/common](https://www.npmjs.com/package/@nestjs/common) @ 11.2.0 |
17
+ | Processed | 2026-08-14 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 1 |
20
20
 
package/changes.json CHANGED
@@ -5,6 +5,6 @@
5
5
  "to": "^22.0.1"
6
6
  }
7
7
  },
8
- "timestamp": "2026-08-10T16:18:25.781Z",
8
+ "timestamp": "2026-08-14T16:18:22.898Z",
9
9
  "totalUpdated": 1
10
10
  }
@@ -6,3 +6,4 @@ export * from './render.decorator';
6
6
  export * from './header.decorator';
7
7
  export * from './redirect.decorator';
8
8
  export * from './sse.decorator';
9
+ export * from './sse-signal.decorator';
@@ -9,3 +9,4 @@ tslib_1.__exportStar(require("./render.decorator"), exports);
9
9
  tslib_1.__exportStar(require("./header.decorator"), exports);
10
10
  tslib_1.__exportStar(require("./redirect.decorator"), exports);
11
11
  tslib_1.__exportStar(require("./sse.decorator"), exports);
12
+ tslib_1.__exportStar(require("./sse-signal.decorator"), exports);
@@ -76,6 +76,17 @@ export declare const All: (path?: string | string[]) => MethodDecorator;
76
76
  * @publicApi
77
77
  */
78
78
  export declare const Search: (path?: string | string[]) => MethodDecorator;
79
+ /**
80
+ * Route handler (method) Decorator. Routes HTTP QUERY requests to the specified path.
81
+ *
82
+ * **Note**: this is named `QueryMethod` (rather than `Query`) to avoid a name clash
83
+ * with the `@Query()` parameter decorator used to extract query-string params.
84
+ *
85
+ * @see [Routing](https://docs.nestjs.com/controllers#routing)
86
+ *
87
+ * @publicApi
88
+ */
89
+ export declare const QueryMethod: (path?: string | string[]) => MethodDecorator;
79
90
  /**
80
91
  * Route handler (method) Decorator. Routes Webdav PROPFIND requests to the specified path.
81
92
  *
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Unlock = exports.Lock = exports.Move = exports.Copy = exports.Mkcol = exports.Proppatch = exports.Propfind = exports.Search = exports.All = exports.Head = exports.Options = exports.Patch = exports.Put = exports.Delete = exports.Get = exports.Post = exports.RequestMapping = void 0;
3
+ exports.Unlock = exports.Lock = exports.Move = exports.Copy = exports.Mkcol = exports.Proppatch = exports.Propfind = exports.QueryMethod = exports.Search = exports.All = exports.Head = exports.Options = exports.Patch = exports.Put = exports.Delete = exports.Get = exports.Post = exports.RequestMapping = void 0;
4
4
  const constants_1 = require("../../constants");
5
5
  const request_method_enum_1 = require("../../enums/request-method.enum");
6
6
  const defaultMetadata = {
@@ -96,6 +96,17 @@ exports.All = createMappingDecorator(request_method_enum_1.RequestMethod.ALL);
96
96
  * @publicApi
97
97
  */
98
98
  exports.Search = createMappingDecorator(request_method_enum_1.RequestMethod.SEARCH);
99
+ /**
100
+ * Route handler (method) Decorator. Routes HTTP QUERY requests to the specified path.
101
+ *
102
+ * **Note**: this is named `QueryMethod` (rather than `Query`) to avoid a name clash
103
+ * with the `@Query()` parameter decorator used to extract query-string params.
104
+ *
105
+ * @see [Routing](https://docs.nestjs.com/controllers#routing)
106
+ *
107
+ * @publicApi
108
+ */
109
+ exports.QueryMethod = createMappingDecorator(request_method_enum_1.RequestMethod.QUERY);
99
110
  /**
100
111
  * Route handler (method) Decorator. Routes Webdav PROPFIND requests to the specified path.
101
112
  *
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Symbol used to carry the per-request SSE `AbortController` on the request object.
3
+ *
4
+ * The controller is attached by the framework before the route handler runs and is
5
+ * aborted when the client disconnects. Its signal is exposed to route handlers
6
+ * through the `@SseSignal()` parameter decorator.
7
+ *
8
+ * @publicApi
9
+ */
10
+ export declare const SSE_ABORT_CONTROLLER: unique symbol;
11
+ /**
12
+ * Route handler parameter decorator that injects the `AbortSignal` associated
13
+ * with a Server-Sent-Events (SSE) request.
14
+ *
15
+ * The signal represents the lifetime of the SSE response: it is aborted once the
16
+ * stream terminates, whether because the client disconnected, the `Observable`
17
+ * completed, or it errored. Tying setup-phase resources to the signal therefore
18
+ * releases them exactly once on every exit path, including resources allocated
19
+ * before the returned `Observable` exists — which would otherwise leak, since the
20
+ * producer is never subscribed once the client has disconnected.
21
+ *
22
+ * Because the signal also aborts on normal completion, `signal.aborted` is only
23
+ * meaningful as a "did the client go away?" check *during setup*, before the
24
+ * `Observable` is returned; at that point the stream cannot have completed yet.
25
+ * Cleanup wired to the `abort` event should be idempotent, as it may run
26
+ * alongside the `Observable`'s own teardown.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * @Sse('stream')
31
+ * async stream(@SseSignal() signal: AbortSignal): Promise<Observable<MessageEvent>> {
32
+ * const session = await createSession();
33
+ * if (signal.aborted) {
34
+ * await session.close();
35
+ * return EMPTY;
36
+ * }
37
+ * return new Observable(subscriber => {
38
+ * const stream = startGeneration(session);
39
+ * signal.addEventListener('abort', () => stream.stop(), { once: true });
40
+ * return () => stream.stop();
41
+ * });
42
+ * }
43
+ * ```
44
+ *
45
+ * @publicApi
46
+ */
47
+ export declare const SseSignal: () => ParameterDecorator;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SseSignal = exports.SSE_ABORT_CONTROLLER = void 0;
4
+ const create_route_param_metadata_decorator_1 = require("./create-route-param-metadata.decorator");
5
+ /**
6
+ * Symbol used to carry the per-request SSE `AbortController` on the request object.
7
+ *
8
+ * The controller is attached by the framework before the route handler runs and is
9
+ * aborted when the client disconnects. Its signal is exposed to route handlers
10
+ * through the `@SseSignal()` parameter decorator.
11
+ *
12
+ * @publicApi
13
+ */
14
+ exports.SSE_ABORT_CONTROLLER = Symbol('SSE_ABORT_CONTROLLER');
15
+ /**
16
+ * Route handler parameter decorator that injects the `AbortSignal` associated
17
+ * with a Server-Sent-Events (SSE) request.
18
+ *
19
+ * The signal represents the lifetime of the SSE response: it is aborted once the
20
+ * stream terminates, whether because the client disconnected, the `Observable`
21
+ * completed, or it errored. Tying setup-phase resources to the signal therefore
22
+ * releases them exactly once on every exit path, including resources allocated
23
+ * before the returned `Observable` exists — which would otherwise leak, since the
24
+ * producer is never subscribed once the client has disconnected.
25
+ *
26
+ * Because the signal also aborts on normal completion, `signal.aborted` is only
27
+ * meaningful as a "did the client go away?" check *during setup*, before the
28
+ * `Observable` is returned; at that point the stream cannot have completed yet.
29
+ * Cleanup wired to the `abort` event should be idempotent, as it may run
30
+ * alongside the `Observable`'s own teardown.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * @Sse('stream')
35
+ * async stream(@SseSignal() signal: AbortSignal): Promise<Observable<MessageEvent>> {
36
+ * const session = await createSession();
37
+ * if (signal.aborted) {
38
+ * await session.close();
39
+ * return EMPTY;
40
+ * }
41
+ * return new Observable(subscriber => {
42
+ * const stream = startGeneration(session);
43
+ * signal.addEventListener('abort', () => stream.stop(), { once: true });
44
+ * return () => stream.stop();
45
+ * });
46
+ * }
47
+ * ```
48
+ *
49
+ * @publicApi
50
+ */
51
+ exports.SseSignal = (0, create_route_param_metadata_decorator_1.createParamDecorator)((_data, ctx) => {
52
+ const request = ctx.switchToHttp().getRequest();
53
+ const controller = request?.[exports.SSE_ABORT_CONTROLLER];
54
+ return controller?.signal;
55
+ });
@@ -14,5 +14,6 @@ export declare enum RequestMethod {
14
14
  COPY = 12,
15
15
  MOVE = 13,
16
16
  LOCK = 14,
17
- UNLOCK = 15
17
+ UNLOCK = 15,
18
+ QUERY = 16
18
19
  }
@@ -19,4 +19,5 @@ var RequestMethod;
19
19
  RequestMethod[RequestMethod["MOVE"] = 13] = "MOVE";
20
20
  RequestMethod[RequestMethod["LOCK"] = 14] = "LOCK";
21
21
  RequestMethod[RequestMethod["UNLOCK"] = 15] = "UNLOCK";
22
+ RequestMethod[RequestMethod["QUERY"] = 16] = "QUERY";
22
23
  })(RequestMethod || (exports.RequestMethod = RequestMethod = {}));
@@ -39,6 +39,8 @@ export interface HttpServer<TRequest = any, TResponse = any, ServerInstance = an
39
39
  options(path: string, handler: RequestHandler<TRequest, TResponse>): any;
40
40
  search?(handler: RequestHandler<TRequest, TResponse>): any;
41
41
  search?(path: string, handler: RequestHandler<TRequest, TResponse>): any;
42
+ query?(handler: RequestHandler<TRequest, TResponse>): any;
43
+ query?(path: string, handler: RequestHandler<TRequest, TResponse>): any;
42
44
  listen(port: number | string, callback?: () => void): any;
43
45
  listen(port: number | string, hostname: string, callback?: () => void): any;
44
46
  reply(response: any, body: any, statusCode?: number): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/nestjs__common",
3
- "version": "11.1.29-depup.0",
3
+ "version": "11.2.0-depup.0",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@common) (with updated dependencies)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://nestjs.com",
@@ -35,7 +35,7 @@
35
35
  "optional": true
36
36
  }
37
37
  },
38
- "gitHead": "03587a112ebbbb53a6bc3875afb5a9205aa5a5f1",
38
+ "gitHead": "f2a7e4b1f57193cbbfe34e988276fc0eaf0b6eb5",
39
39
  "keywords": [
40
40
  "@nestjs/common",
41
41
  "depup",
@@ -53,8 +53,8 @@
53
53
  },
54
54
  "depsUpdated": 1,
55
55
  "originalPackage": "@nestjs/common",
56
- "originalVersion": "11.1.29",
57
- "processedAt": "2026-08-10T16:18:30.286Z",
56
+ "originalVersion": "11.2.0",
57
+ "processedAt": "2026-08-14T16:18:27.909Z",
58
58
  "smokeTest": "passed"
59
59
  }
60
60
  }
@@ -65,5 +65,6 @@ export type FileTypeValidatorOptions = {
65
65
  export declare class FileTypeValidator extends FileValidator<FileTypeValidatorOptions, IFile> {
66
66
  buildErrorMessage(file?: IFile): string;
67
67
  isValid(file?: IFile): Promise<boolean>;
68
+ private matchesFileType;
68
69
  }
69
70
  export {};
@@ -58,13 +58,13 @@ class FileTypeValidator extends file_validator_interface_1.FileValidator {
58
58
  const isFileValid = !!file && 'mimetype' in file;
59
59
  // Skip magic number validation if set
60
60
  if (this.validationOptions.skipMagicNumbersValidation) {
61
- return (isFileValid && !!file.mimetype.match(this.validationOptions.fileType));
61
+ return isFileValid && this.matchesFileType(file.mimetype);
62
62
  }
63
63
  if (!isFileValid)
64
64
  return false;
65
65
  if (!file.buffer) {
66
66
  if (this.validationOptions.fallbackToMimetype) {
67
- return !!file.mimetype.match(this.validationOptions.fileType);
67
+ return this.matchesFileType(file.mimetype);
68
68
  }
69
69
  return false;
70
70
  }
@@ -84,7 +84,7 @@ class FileTypeValidator extends file_validator_interface_1.FileValidator {
84
84
  file.mimetype = fileType.mime;
85
85
  }
86
86
  // Match detected mime type against allowed type
87
- return !!fileType.mime.match(this.validationOptions.fileType);
87
+ return this.matchesFileType(fileType.mime);
88
88
  }
89
89
  /**
90
90
  * Fallback logic: If file-type cannot detect magic number (e.g. file too small),
@@ -92,7 +92,7 @@ class FileTypeValidator extends file_validator_interface_1.FileValidator {
92
92
  * This is useful for plain text, CSVs, or files without recognizable signatures.
93
93
  */
94
94
  if (this.validationOptions.fallbackToMimetype) {
95
- return !!file.mimetype.match(this.validationOptions.fileType);
95
+ return this.matchesFileType(file.mimetype);
96
96
  }
97
97
  return false;
98
98
  }
@@ -108,10 +108,19 @@ class FileTypeValidator extends file_validator_interface_1.FileValidator {
108
108
  }
109
109
  // Fallback to mimetype if enabled
110
110
  if (this.validationOptions.fallbackToMimetype) {
111
- return !!file.mimetype.match(this.validationOptions.fileType);
111
+ return this.matchesFileType(file.mimetype);
112
112
  }
113
113
  return false;
114
114
  }
115
115
  }
116
+ matchesFileType(mimetype) {
117
+ const { fileType } = this.validationOptions;
118
+ // A string is coerced into a RegExp by `String#match`, so MIME types holding
119
+ // regex metacharacters (the `+` in `image/svg+xml`) never match themselves.
120
+ if (typeof fileType === 'string' && mimetype === fileType) {
121
+ return true;
122
+ }
123
+ return !!mimetype.match(fileType);
124
+ }
116
125
  }
117
126
  exports.FileTypeValidator = FileTypeValidator;
@@ -43,7 +43,13 @@ let ParseEnumPipe = class ParseEnumPipe {
43
43
  return value;
44
44
  }
45
45
  isEnum(value) {
46
- const enumValues = Object.keys(this.enumType).map(item => this.enumType[item]);
46
+ const enumValues = Object.keys(this.enumType)
47
+ .filter(key => {
48
+ const enumValue = this.enumType[key];
49
+ return !(typeof enumValue === 'string' &&
50
+ typeof this.enumType[enumValue] === 'number');
51
+ })
52
+ .map(key => this.enumType[key]);
47
53
  return enumValues.includes(value);
48
54
  }
49
55
  };