nestjs-openapi-next 1.0.5 → 1.0.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/.claude/settings.local.json +13 -0
- package/.idea/copilot.data.migration.ask.xml +6 -0
- package/dist/decorators/api-query.decorator.d.ts +1 -1
- package/dist/document-builder.d.ts +2 -2
- package/dist/document-builder.js +36 -7
- package/dist/explorers/api-parameters.explorer.d.ts +1 -1
- package/dist/interfaces/open-api-spec.interface.d.ts +2 -1
- package/dist/services/schema-object-factory.d.ts +2 -2
- package/dist/services/swagger-types-mapper.d.ts +5 -5
- package/package.json +19 -19
|
@@ -4,7 +4,7 @@ import { ParameterObject, ReferenceObject, SchemaObject } from '../interfaces/op
|
|
|
4
4
|
import { SwaggerEnumType } from '../types/swagger-enum.type';
|
|
5
5
|
type ParameterOptions = Omit<ParameterObject, 'in' | 'schema' | 'name'>;
|
|
6
6
|
interface ApiQueryCommonMetadata extends ParameterOptions {
|
|
7
|
-
type?: Type<unknown> | Function | [Function] | string;
|
|
7
|
+
type?: Type<unknown> | Function | [Function] | 'string' | 'number' | 'integer' | 'boolean' | (string & {});
|
|
8
8
|
isArray?: boolean;
|
|
9
9
|
enum?: SwaggerEnumType;
|
|
10
10
|
}
|
|
@@ -13,8 +13,8 @@ export declare class DocumentBuilder {
|
|
|
13
13
|
setLicense(name: string, url: string): this;
|
|
14
14
|
setLicenseWithIdentifier(name: string, identifier: string): this;
|
|
15
15
|
setOpenAPIVersion(version: string): this;
|
|
16
|
-
addServer(url: string, description?: string, pathPrefix?: string, variables?: Record<string, ServerVariableObject>): this;
|
|
17
|
-
addServerWithName(name: string, url: string, description?: string, pathPrefix?: string, variables?: Record<string, ServerVariableObject>): this;
|
|
16
|
+
addServer(url: string, description?: string, pathPrefix?: string, variables?: Record<string, ServerVariableObject>, serverExtraProperties?: Record<string, any>): this;
|
|
17
|
+
addServerWithName(name: string, url: string, description?: string, pathPrefix?: string, variables?: Record<string, ServerVariableObject>, serverExtraProperties?: Record<string, any>): this;
|
|
18
18
|
setExternalDoc(description: string, url: string): this;
|
|
19
19
|
setBasePath(path: string): this;
|
|
20
20
|
addTag(name: string, description?: string, externalDocs?: ExternalDocumentationObject, summary?: string): this;
|
package/dist/document-builder.js
CHANGED
|
@@ -52,18 +52,47 @@ class DocumentBuilder {
|
|
|
52
52
|
}
|
|
53
53
|
return this;
|
|
54
54
|
}
|
|
55
|
-
addServer(url, description, pathPrefix, variables) {
|
|
56
|
-
|
|
55
|
+
addServer(url, description, pathPrefix, variables, serverExtraProperties) {
|
|
56
|
+
const serverObjDef = {
|
|
57
|
+
url,
|
|
58
|
+
description,
|
|
59
|
+
variables
|
|
60
|
+
};
|
|
61
|
+
if (!(0, lodash_1.isUndefined)(pathPrefix)) {
|
|
62
|
+
serverObjDef.pathPrefix = pathPrefix;
|
|
63
|
+
}
|
|
64
|
+
if (serverExtraProperties) {
|
|
65
|
+
const alreadyDefinedKeysForServerEntry = Object.keys(serverObjDef);
|
|
66
|
+
for (const key in serverExtraProperties) {
|
|
67
|
+
if (alreadyDefinedKeysForServerEntry.includes(key))
|
|
68
|
+
continue;
|
|
69
|
+
const extraFieldValue = serverExtraProperties[key];
|
|
70
|
+
serverObjDef[key] = extraFieldValue;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
this.document.servers.push(serverObjDef);
|
|
57
74
|
return this;
|
|
58
75
|
}
|
|
59
|
-
addServerWithName(name, url, description, pathPrefix, variables) {
|
|
60
|
-
|
|
76
|
+
addServerWithName(name, url, description, pathPrefix, variables, serverExtraProperties) {
|
|
77
|
+
const serverObjDef = {
|
|
61
78
|
name,
|
|
62
79
|
url,
|
|
63
80
|
description,
|
|
64
|
-
variables
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
variables
|
|
82
|
+
};
|
|
83
|
+
if (!(0, lodash_1.isUndefined)(pathPrefix)) {
|
|
84
|
+
serverObjDef.pathPrefix = pathPrefix;
|
|
85
|
+
}
|
|
86
|
+
if (serverExtraProperties) {
|
|
87
|
+
const alreadyDefinedKeysForServerEntry = Object.keys(serverObjDef);
|
|
88
|
+
for (const key in serverExtraProperties) {
|
|
89
|
+
if (alreadyDefinedKeysForServerEntry.includes(key))
|
|
90
|
+
continue;
|
|
91
|
+
const extraFieldValue = serverExtraProperties[key];
|
|
92
|
+
serverObjDef[key] = extraFieldValue;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
this.document.servers.push(serverObjDef);
|
|
67
96
|
return this;
|
|
68
97
|
}
|
|
69
98
|
setExternalDoc(description, url) {
|
|
@@ -46,7 +46,7 @@ export declare const exploreApiParametersMetadata: (schemas: Record<string, Sche
|
|
|
46
46
|
additionalProperties?: SchemaObject | import("../interfaces/open-api-spec.interface").ReferenceObject | boolean;
|
|
47
47
|
patternProperties?: Record<string, SchemaObject | import("../interfaces/open-api-spec.interface").ReferenceObject> | undefined;
|
|
48
48
|
description?: string;
|
|
49
|
-
format?:
|
|
49
|
+
format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat;
|
|
50
50
|
default?: any;
|
|
51
51
|
title?: string;
|
|
52
52
|
multipleOf?: number;
|
|
@@ -219,7 +219,7 @@ export interface SchemaObject {
|
|
|
219
219
|
additionalProperties?: SchemaObject | ReferenceObject | boolean;
|
|
220
220
|
patternProperties?: Record<string, SchemaObject | ReferenceObject> | undefined;
|
|
221
221
|
description?: string;
|
|
222
|
-
format?:
|
|
222
|
+
format?: OpenAPIFormat;
|
|
223
223
|
default?: any;
|
|
224
224
|
title?: string;
|
|
225
225
|
multipleOf?: number;
|
|
@@ -286,3 +286,4 @@ export interface OAuthDeviceAuthorizationFlowObject {
|
|
|
286
286
|
export type ScopesObject = Record<string, any>;
|
|
287
287
|
export type SecurityRequirementObject = Record<string, string[]>;
|
|
288
288
|
export type ExtensionLocation = 'root' | 'info';
|
|
289
|
+
export type OpenAPIFormat = 'int32' | 'int64' | 'float' | 'double' | 'byte' | 'binary' | 'date' | 'date-time' | 'time' | 'duration' | 'password' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'uri-template' | 'iri' | 'iri-reference' | 'uuid' | 'json-pointer' | 'relative-json-pointer' | 'regex' | (string & {});
|
|
@@ -57,7 +57,7 @@ export declare class SchemaObjectFactory {
|
|
|
57
57
|
additionalProperties?: SchemaObject | ReferenceObject | boolean;
|
|
58
58
|
patternProperties?: Record<string, SchemaObject | ReferenceObject> | undefined;
|
|
59
59
|
description?: string;
|
|
60
|
-
format?:
|
|
60
|
+
format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat;
|
|
61
61
|
default?: any;
|
|
62
62
|
title?: string;
|
|
63
63
|
multipleOf?: number;
|
|
@@ -137,7 +137,7 @@ export declare class SchemaObjectFactory {
|
|
|
137
137
|
additionalProperties?: SchemaObject | ReferenceObject | boolean;
|
|
138
138
|
patternProperties?: Record<string, SchemaObject | ReferenceObject> | undefined;
|
|
139
139
|
description?: string;
|
|
140
|
-
format?:
|
|
140
|
+
format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat;
|
|
141
141
|
default?: any;
|
|
142
142
|
title?: string;
|
|
143
143
|
multipleOf?: number;
|
|
@@ -48,7 +48,7 @@ export declare class SwaggerTypesMapper {
|
|
|
48
48
|
additionalProperties?: SchemaObject | ReferenceObject | boolean;
|
|
49
49
|
patternProperties?: Record<string, SchemaObject | ReferenceObject> | undefined;
|
|
50
50
|
description?: string;
|
|
51
|
-
format?:
|
|
51
|
+
format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat;
|
|
52
52
|
default?: any;
|
|
53
53
|
title?: string;
|
|
54
54
|
multipleOf?: number;
|
|
@@ -138,7 +138,7 @@ export declare class SwaggerTypesMapper {
|
|
|
138
138
|
additionalProperties?: SchemaObject | ReferenceObject | boolean;
|
|
139
139
|
patternProperties?: Record<string, SchemaObject | ReferenceObject> | undefined;
|
|
140
140
|
description?: string;
|
|
141
|
-
format?:
|
|
141
|
+
format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat;
|
|
142
142
|
default?: any;
|
|
143
143
|
title?: string;
|
|
144
144
|
multipleOf?: number;
|
|
@@ -203,7 +203,7 @@ export declare class SwaggerTypesMapper {
|
|
|
203
203
|
additionalProperties?: SchemaObject | ReferenceObject | boolean;
|
|
204
204
|
patternProperties?: Record<string, SchemaObject | ReferenceObject> | undefined;
|
|
205
205
|
description?: string;
|
|
206
|
-
format?:
|
|
206
|
+
format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat;
|
|
207
207
|
default?: any;
|
|
208
208
|
title?: string;
|
|
209
209
|
multipleOf?: number;
|
|
@@ -277,7 +277,7 @@ export declare class SwaggerTypesMapper {
|
|
|
277
277
|
additionalProperties?: SchemaObject | ReferenceObject | boolean;
|
|
278
278
|
patternProperties?: Record<string, SchemaObject | ReferenceObject> | undefined;
|
|
279
279
|
description?: string;
|
|
280
|
-
format?:
|
|
280
|
+
format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat;
|
|
281
281
|
default?: any;
|
|
282
282
|
title?: string;
|
|
283
283
|
multipleOf?: number;
|
|
@@ -347,7 +347,7 @@ export declare class SwaggerTypesMapper {
|
|
|
347
347
|
additionalProperties?: SchemaObject | ReferenceObject | boolean;
|
|
348
348
|
patternProperties?: Record<string, SchemaObject | ReferenceObject> | undefined;
|
|
349
349
|
description?: string;
|
|
350
|
-
format?:
|
|
350
|
+
format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat;
|
|
351
351
|
default?: any;
|
|
352
352
|
title?: string;
|
|
353
353
|
multipleOf?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestjs-openapi-next",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "A fork of @nestjs/swagger support OAS 3.2",
|
|
5
5
|
"author": "undownding",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,46 +30,46 @@
|
|
|
30
30
|
"@microsoft/tsdoc": "0.16.0",
|
|
31
31
|
"@nestjs/mapped-types": "2.1.0",
|
|
32
32
|
"js-yaml": "4.1.1",
|
|
33
|
-
"lodash": "4.17.
|
|
33
|
+
"lodash": "4.17.23",
|
|
34
34
|
"path-to-regexp": "8.3.0",
|
|
35
35
|
"swagger-ui-dist": "5.31.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@commitlint/cli": "20.
|
|
39
|
-
"@commitlint/config-angular": "20.
|
|
40
|
-
"@eslint/eslintrc": "3.3.
|
|
41
|
-
"@eslint/js": "
|
|
38
|
+
"@commitlint/cli": "20.4.2",
|
|
39
|
+
"@commitlint/config-angular": "20.4.2",
|
|
40
|
+
"@eslint/eslintrc": "3.3.4",
|
|
41
|
+
"@eslint/js": "10.0.1",
|
|
42
42
|
"@fastify/static": "9.0.0",
|
|
43
|
-
"@nestjs/common": "11.1.
|
|
44
|
-
"@nestjs/core": "11.1.
|
|
45
|
-
"@nestjs/platform-express": "11.1.
|
|
46
|
-
"@nestjs/platform-fastify": "11.1.
|
|
43
|
+
"@nestjs/common": "11.1.14",
|
|
44
|
+
"@nestjs/core": "11.1.14",
|
|
45
|
+
"@nestjs/platform-express": "11.1.14",
|
|
46
|
+
"@nestjs/platform-fastify": "11.1.14",
|
|
47
47
|
"@types/jest": "30.0.0",
|
|
48
48
|
"@types/js-yaml": "4.0.9",
|
|
49
|
-
"@types/lodash": "4.17.
|
|
50
|
-
"@types/node": "24.10.
|
|
49
|
+
"@types/lodash": "4.17.24",
|
|
50
|
+
"@types/node": "24.10.13",
|
|
51
51
|
"class-transformer": "0.5.1",
|
|
52
|
-
"class-validator": "0.14.
|
|
53
|
-
"eslint": "
|
|
52
|
+
"class-validator": "0.14.4",
|
|
53
|
+
"eslint": "10.0.2",
|
|
54
54
|
"eslint-config-prettier": "10.1.8",
|
|
55
55
|
"eslint-plugin-prettier": "5.5.5",
|
|
56
56
|
"express": "5.2.1",
|
|
57
|
-
"fastify": "5.7.
|
|
58
|
-
"globals": "17.
|
|
57
|
+
"fastify": "5.7.4",
|
|
58
|
+
"globals": "17.3.0",
|
|
59
59
|
"husky": "9.1.7",
|
|
60
60
|
"jest": "30.2.0",
|
|
61
61
|
"lerna-changelog": "2.2.0",
|
|
62
62
|
"lint-staged": "16.2.7",
|
|
63
63
|
"openapi-types": "12.1.3",
|
|
64
|
-
"prettier": "3.8.
|
|
64
|
+
"prettier": "3.8.1",
|
|
65
65
|
"prettier-v2": "npm:prettier@2.8.8",
|
|
66
66
|
"reflect-metadata": "0.2.2",
|
|
67
|
-
"release-it": "19.2.
|
|
67
|
+
"release-it": "19.2.4",
|
|
68
68
|
"supertest": "7.2.2",
|
|
69
69
|
"swagger-parser": "10.0.3",
|
|
70
70
|
"ts-jest": "29.4.6",
|
|
71
71
|
"typescript": "5.9.3",
|
|
72
|
-
"typescript-eslint": "8.
|
|
72
|
+
"typescript-eslint": "8.56.1"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@fastify/static": "^8.0.0 || ^9.0.0",
|