@tsed/swagger 7.13.4 → 7.13.5

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.
@@ -21,7 +21,7 @@ let SwaggerService = class SwaggerService {
21
21
  const specPath = conf.specPath ? this.configuration.resolve(conf.specPath) : conf.specPath;
22
22
  const tokens = this.platform
23
23
  .getMountedControllers()
24
- .filter(({ route, provider }) => (0, includeRoute_1.includeRoute)(route, provider, conf))
24
+ .filter(({ routes, provider }) => [...routes.values()].some((route) => (0, includeRoute_1.includeRoute)(route, provider, conf)))
25
25
  .map(({ route, provider }) => ({ token: provider.token, rootPath: route }));
26
26
  const spec = await (0, schema_1.generateSpec)({
27
27
  tokens,
@@ -1 +1 @@
1
- {"version":3,"file":"SwaggerService.js","sourceRoot":"","sources":["../../../src/services/SwaggerService.ts"],"names":[],"mappings":";;;;AAAA,yCAAkF;AAElF,yCAA0C;AAE1C,wDAAmD;AAGnD,IAAa,cAAc,GAA3B,MAAa,cAAc;IAIf;IACA;IACiB;IAL3B,MAAM,GAAuC,IAAI,GAAG,EAAE,CAAC;IAEvD,YACU,eAAgC,EAChC,QAAkB,EACD,aAA4B;QAF7C,oBAAe,GAAf,eAAe,CAAiB;QAChC,aAAQ,GAAR,QAAQ,CAAU;QACD,kBAAa,GAAb,aAAa,CAAe;IACpD,CAAC;IASG,KAAK,CAAC,cAAc,CAAC,IAAqB;QAC/C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC/B,MAAM,EAAC,OAAO,GAAG,OAAO,EAAE,WAAW,EAAC,GAAG,IAAI,CAAC,aAAa,CAAC;YAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;YAE3F,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ;iBACzB,qBAAqB,EAAE;iBACvB,MAAM,CAAC,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAC,EAAE,EAAE,CAAC,IAAA,2BAAY,EAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;iBAClE,GAAG,CAAC,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAC,CAAC;YAE1E,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAY,EAAC;gBAC9B,MAAM;gBACN,GAAG,IAAI;gBACP,QAAQ;gBACR,OAAO;gBACP,WAAW;aACZ,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAClC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AAvCY,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAOR,mBAAA,IAAA,sBAAa,GAAE,CAAA;6CAFS,wBAAe;QACtB,iBAAQ;GALjB,cAAc,CAuC1B;AAvCY,wCAAc","sourcesContent":["import {Configuration, Injectable, InjectorService, Platform} from \"@tsed/common\";\nimport {OpenSpec2, OpenSpec3} from \"@tsed/openspec\";\nimport {generateSpec} from \"@tsed/schema\";\nimport {SwaggerOS2Settings, SwaggerOS3Settings, SwaggerSettings} from \"../interfaces/SwaggerSettings\";\nimport {includeRoute} from \"../utils/includeRoute\";\n\n@Injectable()\nexport class SwaggerService {\n #specs: Map<string, OpenSpec3 | OpenSpec2> = new Map();\n\n constructor(\n private injectorService: InjectorService,\n private platform: Platform,\n @Configuration() private configuration: Configuration\n ) {}\n\n /**\n * Generate Spec for the given configuration\n * @returns {Spec}\n */\n public async getOpenAPISpec(conf: SwaggerOS3Settings): Promise<OpenSpec3>;\n public async getOpenAPISpec(conf: SwaggerOS2Settings): Promise<OpenSpec2>;\n public async getOpenAPISpec(conf: SwaggerSettings): Promise<OpenSpec2>;\n public async getOpenAPISpec(conf: SwaggerSettings) {\n if (!this.#specs.has(conf.path)) {\n const {version = \"1.0.0\", acceptMimes} = this.configuration;\n const specPath = conf.specPath ? this.configuration.resolve(conf.specPath) : conf.specPath;\n\n const tokens = this.platform\n .getMountedControllers()\n .filter(({route, provider}) => includeRoute(route, provider, conf))\n .map(({route, provider}) => ({token: provider.token, rootPath: route}));\n\n const spec = await generateSpec({\n tokens,\n ...conf,\n specPath,\n version,\n acceptMimes\n });\n\n this.#specs.set(conf.path, spec);\n }\n\n return this.#specs.get(conf.path);\n }\n}\n"]}
1
+ {"version":3,"file":"SwaggerService.js","sourceRoot":"","sources":["../../../src/services/SwaggerService.ts"],"names":[],"mappings":";;;;AAAA,yCAAkF;AAElF,yCAA0C;AAE1C,wDAAmD;AAGnD,IAAa,cAAc,GAA3B,MAAa,cAAc;IAIf;IACA;IACiB;IAL3B,MAAM,GAAuC,IAAI,GAAG,EAAE,CAAC;IAEvD,YACU,eAAgC,EAChC,QAAkB,EACD,aAA4B;QAF7C,oBAAe,GAAf,eAAe,CAAiB;QAChC,aAAQ,GAAR,QAAQ,CAAU;QACD,kBAAa,GAAb,aAAa,CAAe;IACpD,CAAC;IASG,KAAK,CAAC,cAAc,CAAC,IAAqB;QAC/C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC/B,MAAM,EAAC,OAAO,GAAG,OAAO,EAAE,WAAW,EAAC,GAAG,IAAI,CAAC,aAAa,CAAC;YAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;YAE3F,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ;iBACzB,qBAAqB,EAAE;iBACvB,MAAM,CAAC,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAC,EAAE,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,2BAAY,EAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;iBACzG,GAAG,CAAC,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAC,CAAC;YAE1E,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAY,EAAC;gBAC9B,MAAM;gBACN,GAAG,IAAI;gBACP,QAAQ;gBACR,OAAO;gBACP,WAAW;aACZ,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAClC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AAvCY,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAOR,mBAAA,IAAA,sBAAa,GAAE,CAAA;6CAFS,wBAAe;QACtB,iBAAQ;GALjB,cAAc,CAuC1B;AAvCY,wCAAc","sourcesContent":["import {Configuration, Injectable, InjectorService, Platform} from \"@tsed/common\";\nimport {OpenSpec2, OpenSpec3} from \"@tsed/openspec\";\nimport {generateSpec} from \"@tsed/schema\";\nimport {SwaggerOS2Settings, SwaggerOS3Settings, SwaggerSettings} from \"../interfaces/SwaggerSettings\";\nimport {includeRoute} from \"../utils/includeRoute\";\n\n@Injectable()\nexport class SwaggerService {\n #specs: Map<string, OpenSpec3 | OpenSpec2> = new Map();\n\n constructor(\n private injectorService: InjectorService,\n private platform: Platform,\n @Configuration() private configuration: Configuration\n ) {}\n\n /**\n * Generate Spec for the given configuration\n * @returns {Spec}\n */\n public async getOpenAPISpec(conf: SwaggerOS3Settings): Promise<OpenSpec3>;\n public async getOpenAPISpec(conf: SwaggerOS2Settings): Promise<OpenSpec2>;\n public async getOpenAPISpec(conf: SwaggerSettings): Promise<OpenSpec2>;\n public async getOpenAPISpec(conf: SwaggerSettings) {\n if (!this.#specs.has(conf.path)) {\n const {version = \"1.0.0\", acceptMimes} = this.configuration;\n const specPath = conf.specPath ? this.configuration.resolve(conf.specPath) : conf.specPath;\n\n const tokens = this.platform\n .getMountedControllers()\n .filter(({routes, provider}) => [...routes.values()].some((route) => includeRoute(route, provider, conf)))\n .map(({route, provider}) => ({token: provider.token, rootPath: route}));\n\n const spec = await generateSpec({\n tokens,\n ...conf,\n specPath,\n version,\n acceptMimes\n });\n\n this.#specs.set(conf.path, spec);\n }\n\n return this.#specs.get(conf.path);\n }\n}\n"]}
@@ -18,7 +18,7 @@ let SwaggerService = class SwaggerService {
18
18
  const specPath = conf.specPath ? this.configuration.resolve(conf.specPath) : conf.specPath;
19
19
  const tokens = this.platform
20
20
  .getMountedControllers()
21
- .filter(({ route, provider }) => includeRoute(route, provider, conf))
21
+ .filter(({ routes, provider }) => [...routes.values()].some((route) => includeRoute(route, provider, conf)))
22
22
  .map(({ route, provider }) => ({ token: provider.token, rootPath: route }));
23
23
  const spec = await generateSpec({
24
24
  tokens,
@@ -1 +1 @@
1
- {"version":3,"file":"SwaggerService.js","sourceRoot":"","sources":["../../../src/services/SwaggerService.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAElF,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAGnD,IAAa,cAAc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AG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AAvCY,cAAc;IAD1B,UAAU,EAAE;IAOR,WAAA,aAAa,EAAE,CAAA;qCAFS,eAAe;QACtB,QAAQ;GALjB,cAAc,CAuC1B;SAvCY,cAAc","sourcesContent":["import {Configuration, Injectable, InjectorService, Platform} from \"@tsed/common\";\nimport {OpenSpec2, OpenSpec3} from \"@tsed/openspec\";\nimport {generateSpec} from \"@tsed/schema\";\nimport {SwaggerOS2Settings, SwaggerOS3Settings, SwaggerSettings} from \"../interfaces/SwaggerSettings\";\nimport {includeRoute} from \"../utils/includeRoute\";\n\n@Injectable()\nexport class SwaggerService {\n #specs: Map<string, OpenSpec3 | OpenSpec2> = new Map();\n\n constructor(\n private injectorService: InjectorService,\n private platform: Platform,\n @Configuration() private configuration: Configuration\n ) {}\n\n /**\n * Generate Spec for the given configuration\n * @returns {Spec}\n */\n public async getOpenAPISpec(conf: SwaggerOS3Settings): Promise<OpenSpec3>;\n public async getOpenAPISpec(conf: SwaggerOS2Settings): Promise<OpenSpec2>;\n public async getOpenAPISpec(conf: SwaggerSettings): Promise<OpenSpec2>;\n public async getOpenAPISpec(conf: SwaggerSettings) {\n if (!this.#specs.has(conf.path)) {\n const {version = \"1.0.0\", acceptMimes} = this.configuration;\n const specPath = conf.specPath ? this.configuration.resolve(conf.specPath) : conf.specPath;\n\n const tokens = this.platform\n .getMountedControllers()\n .filter(({route, provider}) => includeRoute(route, provider, conf))\n .map(({route, provider}) => ({token: provider.token, rootPath: route}));\n\n const spec = await generateSpec({\n tokens,\n ...conf,\n specPath,\n version,\n acceptMimes\n });\n\n this.#specs.set(conf.path, spec);\n }\n\n return this.#specs.get(conf.path);\n }\n}\n"]}
1
+ {"version":3,"file":"SwaggerService.js","sourceRoot":"","sources":["../../../src/services/SwaggerService.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAC,M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AM,YAAY,CAAC;gBAC9B,MAAM;gBACN,GAAG,IAAI;gBACP,QAAQ;gBACR,OAAO;gBACP,WAAW;aACZ,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAClC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AAvCY,cAAc;IAD1B,UAAU,EAAE;IAOR,WAAA,aAAa,EAAE,CAAA;qCAFS,eAAe;QACtB,QAAQ;GALjB,cAAc,CAuC1B;SAvCY,cAAc","sourcesContent":["import {Configuration, Injectable, InjectorService, Platform} from \"@tsed/common\";\nimport {OpenSpec2, OpenSpec3} from \"@tsed/openspec\";\nimport {generateSpec} from \"@tsed/schema\";\nimport {SwaggerOS2Settings, SwaggerOS3Settings, SwaggerSettings} from \"../interfaces/SwaggerSettings\";\nimport {includeRoute} from \"../utils/includeRoute\";\n\n@Injectable()\nexport class SwaggerService {\n #specs: Map<string, OpenSpec3 | OpenSpec2> = new Map();\n\n constructor(\n private injectorService: InjectorService,\n private platform: Platform,\n @Configuration() private configuration: Configuration\n ) {}\n\n /**\n * Generate Spec for the given configuration\n * @returns {Spec}\n */\n public async getOpenAPISpec(conf: SwaggerOS3Settings): Promise<OpenSpec3>;\n public async getOpenAPISpec(conf: SwaggerOS2Settings): Promise<OpenSpec2>;\n public async getOpenAPISpec(conf: SwaggerSettings): Promise<OpenSpec2>;\n public async getOpenAPISpec(conf: SwaggerSettings) {\n if (!this.#specs.has(conf.path)) {\n const {version = \"1.0.0\", acceptMimes} = this.configuration;\n const specPath = conf.specPath ? this.configuration.resolve(conf.specPath) : conf.specPath;\n\n const tokens = this.platform\n .getMountedControllers()\n .filter(({routes, provider}) => [...routes.values()].some((route) => includeRoute(route, provider, conf)))\n .map(({route, provider}) => ({token: provider.token, rootPath: route}));\n\n const spec = await generateSpec({\n tokens,\n ...conf,\n specPath,\n version,\n acceptMimes\n });\n\n this.#specs.set(conf.path, spec);\n }\n\n return this.#specs.get(conf.path);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/swagger",
3
- "version": "7.13.4",
3
+ "version": "7.13.5",
4
4
  "description": "Swagger package for Ts.ED framework",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -23,24 +23,24 @@
23
23
  "test": "cross-env NODE_ENV=test yarn jest --max-workers=2"
24
24
  },
25
25
  "dependencies": {
26
- "@tsed/normalize-path": "7.13.4",
27
- "@tsed/openspec": "7.13.4",
26
+ "@tsed/normalize-path": "7.13.5",
27
+ "@tsed/openspec": "7.13.5",
28
28
  "fs-extra": "10.0.1",
29
29
  "micromatch": "4.0.5",
30
30
  "swagger-ui-dist": "^4.5.2",
31
31
  "tslib": "2.4.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@tsed/common": "7.13.4",
35
- "@tsed/core": "7.13.4",
36
- "@tsed/di": "7.13.4",
37
- "@tsed/json-mapper": "7.13.4",
38
- "@tsed/openspec": "7.13.4",
39
- "@tsed/schema": "7.13.4",
34
+ "@tsed/common": "7.13.5",
35
+ "@tsed/core": "7.13.5",
36
+ "@tsed/di": "7.13.5",
37
+ "@tsed/json-mapper": "7.13.5",
38
+ "@tsed/openspec": "7.13.5",
39
+ "@tsed/schema": "7.13.5",
40
40
  "@types/swagger-ui-dist": ">=3.30.1"
41
41
  },
42
42
  "peerDependencies": {
43
- "@tsed/common": "^7.13.4"
43
+ "@tsed/common": "^7.13.5"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "@tsed/common": {