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.
@@ -0,0 +1,13 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(git merge:*)",
5
+ "Bash(npm version:*)",
6
+ "Bash(git status:*)",
7
+ "Bash(git push:*)",
8
+ "Bash(git pull:*)",
9
+ "Bash(npm publish:*)",
10
+ "Bash(git tag:*)"
11
+ ]
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="AskMigrationStateService">
4
+ <option name="migrationStatus" value="COMPLETED" />
5
+ </component>
6
+ </project>
@@ -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;
@@ -52,18 +52,47 @@ class DocumentBuilder {
52
52
  }
53
53
  return this;
54
54
  }
55
- addServer(url, description, pathPrefix, variables) {
56
- this.document.servers.push({ url, description, variables, pathPrefix });
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
- this.document.servers.push({
76
+ addServerWithName(name, url, description, pathPrefix, variables, serverExtraProperties) {
77
+ const serverObjDef = {
61
78
  name,
62
79
  url,
63
80
  description,
64
- variables,
65
- pathPrefix
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?: string;
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?: string;
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?: string;
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?: string;
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?: string;
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?: string;
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?: string;
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?: string;
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?: string;
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.5",
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.21",
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.3.1",
39
- "@commitlint/config-angular": "20.3.1",
40
- "@eslint/eslintrc": "3.3.3",
41
- "@eslint/js": "9.39.2",
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.12",
44
- "@nestjs/core": "11.1.12",
45
- "@nestjs/platform-express": "11.1.12",
46
- "@nestjs/platform-fastify": "11.1.12",
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.23",
50
- "@types/node": "24.10.9",
49
+ "@types/lodash": "4.17.24",
50
+ "@types/node": "24.10.13",
51
51
  "class-transformer": "0.5.1",
52
- "class-validator": "0.14.3",
53
- "eslint": "9.39.2",
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.1",
58
- "globals": "17.0.0",
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.0",
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.3",
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.53.1"
72
+ "typescript-eslint": "8.56.1"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "@fastify/static": "^8.0.0 || ^9.0.0",