@depup/nestjs__common 11.2.0-depup.0 → 11.2.1-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 +2 -2
- package/changes.json +1 -1
- package/interfaces/microservices/transport-server.interface.d.ts +18 -0
- package/interfaces/microservices/transport-server.interface.js +1 -0
- package/internal.d.ts +1 -0
- package/internal.js +1 -0
- package/package.json +4 -4
- package/pipes/standard-schema-validation.pipe.d.ts +5 -0
- package/pipes/standard-schema-validation.pipe.js +13 -1
- package/serializer/standard-schema-serializer.interceptor.js +2 -2
- package/utils/parameter-decorator-options.util.d.ts +13 -0
- package/utils/parameter-decorator-options.util.js +22 -0
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.2.
|
|
17
|
-
| Processed | 2026-08-
|
|
16
|
+
| Original | [@nestjs/common](https://www.npmjs.com/package/@nestjs/common) @ 11.2.1 |
|
|
17
|
+
| Processed | 2026-08-15 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 1 |
|
|
20
20
|
|
package/changes.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface describing the shape of a transport server.
|
|
3
|
+
* Used as the return type of `getTransportServer()` to provide
|
|
4
|
+
* autocomplete without creating circular dependencies.
|
|
5
|
+
*
|
|
6
|
+
* @publicApi
|
|
7
|
+
*/
|
|
8
|
+
export interface ITransportServer {
|
|
9
|
+
/**
|
|
10
|
+
* Starts the transport server.
|
|
11
|
+
* @param callback Function to be called upon initialization
|
|
12
|
+
*/
|
|
13
|
+
listen(callback: (...optionalParams: unknown[]) => any): any;
|
|
14
|
+
/**
|
|
15
|
+
* Closes the transport server (stops listening on port/connection).
|
|
16
|
+
*/
|
|
17
|
+
close(): any;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/internal.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export * from './constants.js';
|
|
9
9
|
export { RouteParamtypes } from './enums/route-paramtypes.enum.js';
|
|
10
10
|
export * from './utils/shared.utils.js';
|
|
11
|
+
export * from './utils/parameter-decorator-options.util.js';
|
|
11
12
|
export * from './utils/load-package.util.js';
|
|
12
13
|
export * from './utils/cli-colors.util.js';
|
|
13
14
|
export * from './utils/random-string-generator.util.js';
|
package/internal.js
CHANGED
|
@@ -11,6 +11,7 @@ export * from './constants.js';
|
|
|
11
11
|
export { RouteParamtypes } from './enums/route-paramtypes.enum.js';
|
|
12
12
|
// Utils
|
|
13
13
|
export * from './utils/shared.utils.js';
|
|
14
|
+
export * from './utils/parameter-decorator-options.util.js';
|
|
14
15
|
export * from './utils/load-package.util.js';
|
|
15
16
|
export * from './utils/cli-colors.util.js';
|
|
16
17
|
export * from './utils/random-string-generator.util.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/nestjs__common",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.1-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": "
|
|
38
|
+
"gitHead": "4535f43b4890c9c69c57c5a5a8b49f62c83d1ed6",
|
|
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.2.
|
|
57
|
-
"processedAt": "2026-08-
|
|
56
|
+
"originalVersion": "11.2.1",
|
|
57
|
+
"processedAt": "2026-08-15T00:16:32.505Z",
|
|
58
58
|
"smokeTest": "passed"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -53,6 +53,11 @@ export declare class StandardSchemaValidationPipe implements PipeTransform {
|
|
|
53
53
|
protected validateOptions: Record<string, unknown> | undefined;
|
|
54
54
|
protected exceptionFactory: (issues: readonly StandardSchemaV1.Issue[]) => any;
|
|
55
55
|
constructor(options?: StandardSchemaValidationPipeOptions | undefined);
|
|
56
|
+
/**
|
|
57
|
+
* Formats Standard Schema validation issues into a flat list of error messages.
|
|
58
|
+
* When an issue includes a path, the path is prefixed to the message.
|
|
59
|
+
*/
|
|
60
|
+
protected formatIssueMessages(issues: readonly StandardSchemaV1.Issue[]): string[];
|
|
56
61
|
/**
|
|
57
62
|
* Method that validates the incoming value against the standard schema
|
|
58
63
|
* provided in the parameter metadata.
|
|
@@ -34,10 +34,22 @@ let StandardSchemaValidationPipe = class StandardSchemaValidationPipe {
|
|
|
34
34
|
this.exceptionFactory =
|
|
35
35
|
exceptionFactory ||
|
|
36
36
|
(issues => {
|
|
37
|
-
const messages =
|
|
37
|
+
const messages = this.formatIssueMessages(issues);
|
|
38
38
|
return new HttpErrorByCode[errorHttpStatusCode](messages);
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Formats Standard Schema validation issues into a flat list of error messages.
|
|
43
|
+
* When an issue includes a path, the path is prefixed to the message.
|
|
44
|
+
*/
|
|
45
|
+
formatIssueMessages(issues) {
|
|
46
|
+
return issues.map(issue => {
|
|
47
|
+
if (issue.path?.length) {
|
|
48
|
+
return `${issue.path.map(String).join('.')}: ${issue.message}`;
|
|
49
|
+
}
|
|
50
|
+
return issue.message;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
41
53
|
/**
|
|
42
54
|
* Method that validates the incoming value against the standard schema
|
|
43
55
|
* provided in the parameter metadata.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { concatMap } from 'rxjs/operators';
|
|
3
3
|
import { Inject, Injectable, Optional } from '../decorators/core/index.js';
|
|
4
4
|
import { StreamableFile } from '../file-stream/index.js';
|
|
5
5
|
import { isObject } from '../utils/shared.utils.js';
|
|
@@ -36,7 +36,7 @@ let StandardSchemaSerializerInterceptor = class StandardSchemaSerializerIntercep
|
|
|
36
36
|
const validateOptions = contextOptions?.validateOptions ?? this.defaultOptions.validateOptions;
|
|
37
37
|
return next
|
|
38
38
|
.handle()
|
|
39
|
-
.pipe(
|
|
39
|
+
.pipe(concatMap(async (res) => this.serialize(res, schema, validateOptions)));
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Serializes responses that are non-null objects nor streamable files.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ParameterDecoratorOptions } from '../decorators/http/route-params.decorator.js';
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether a parameter-decorator argument is a
|
|
4
|
+
* `ParameterDecoratorOptions` object rather than a pipe (instance or class).
|
|
5
|
+
*
|
|
6
|
+
* Kept in one place so every decorator (`@Query`, `@Body`, `@Param`,
|
|
7
|
+
* `@RawBody`, `@Payload`, `@MessageBody`, custom decorators, ...) classifies
|
|
8
|
+
* arguments identically: a pipe instance that happens to expose a `schema` or
|
|
9
|
+
* `pipes` property must never be mistaken for an options object.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function isParameterDecoratorOptions(value: unknown): value is ParameterDecoratorOptions;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isFunction } from './shared.utils.js';
|
|
2
|
+
const isPipeLike = (value) => isFunction(value?.transform) ||
|
|
3
|
+
(isFunction(value) &&
|
|
4
|
+
value.prototype &&
|
|
5
|
+
isFunction(value.prototype.transform));
|
|
6
|
+
/**
|
|
7
|
+
* Determines whether a parameter-decorator argument is a
|
|
8
|
+
* `ParameterDecoratorOptions` object rather than a pipe (instance or class).
|
|
9
|
+
*
|
|
10
|
+
* Kept in one place so every decorator (`@Query`, `@Body`, `@Param`,
|
|
11
|
+
* `@RawBody`, `@Payload`, `@MessageBody`, custom decorators, ...) classifies
|
|
12
|
+
* arguments identically: a pipe instance that happens to expose a `schema` or
|
|
13
|
+
* `pipes` property must never be mistaken for an options object.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export function isParameterDecoratorOptions(value) {
|
|
18
|
+
return (!!value &&
|
|
19
|
+
typeof value === 'object' &&
|
|
20
|
+
!isPipeLike(value) &&
|
|
21
|
+
('schema' in value || 'pipes' in value));
|
|
22
|
+
}
|