@tsed/swagger 7.0.0-beta.3 → 7.0.0-beta.4

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.
Files changed (63) hide show
  1. package/jest.config.js +14 -0
  2. package/lib/cjs/SwaggerModule.js +18 -17
  3. package/lib/cjs/SwaggerModule.js.map +1 -1
  4. package/lib/cjs/index.js +15 -5
  5. package/lib/cjs/index.js.map +1 -1
  6. package/lib/cjs/interfaces/SwaggerSettings.js.map +1 -1
  7. package/lib/cjs/interfaces/interfaces.js +3 -0
  8. package/lib/cjs/interfaces/interfaces.js.map +1 -0
  9. package/lib/cjs/middlewares/cssMiddleware.js +1 -1
  10. package/lib/cjs/middlewares/cssMiddleware.js.map +1 -1
  11. package/lib/cjs/middlewares/jsMiddleware.js +1 -1
  12. package/lib/cjs/middlewares/jsMiddleware.js.map +1 -1
  13. package/lib/cjs/package.json +3 -0
  14. package/lib/cjs/services/SwaggerService.js +19 -80
  15. package/lib/cjs/services/SwaggerService.js.map +1 -1
  16. package/lib/cjs/utils/includeRoute.js +2 -2
  17. package/lib/cjs/utils/includeRoute.js.map +1 -1
  18. package/lib/cjs/utils/matchPath.js +1 -1
  19. package/lib/cjs/utils/matchPath.js.map +1 -1
  20. package/lib/esm/SwaggerModule.js +11 -10
  21. package/lib/esm/SwaggerModule.js.map +1 -1
  22. package/lib/esm/index.js +15 -5
  23. package/lib/esm/index.js.map +1 -1
  24. package/lib/esm/interfaces/SwaggerSettings.js.map +1 -1
  25. package/lib/esm/interfaces/interfaces.js +2 -0
  26. package/lib/esm/interfaces/interfaces.js.map +1 -0
  27. package/lib/esm/package.json +3 -0
  28. package/lib/esm/services/SwaggerService.js +16 -77
  29. package/lib/esm/services/SwaggerService.js.map +1 -1
  30. package/lib/esm/utils/includeRoute.js +1 -1
  31. package/lib/esm/utils/includeRoute.js.map +1 -1
  32. package/lib/types/SwaggerModule.d.ts +2 -1
  33. package/lib/types/index.d.ts +12 -2
  34. package/lib/types/interfaces/SwaggerSettings.d.ts +9 -2
  35. package/lib/types/interfaces/{index.d.ts → interfaces.d.ts} +0 -1
  36. package/lib/types/services/SwaggerService.d.ts +6 -16
  37. package/lib/types/utils/includeRoute.d.ts +1 -1
  38. package/package.json +26 -20
  39. package/readme.md +71 -85
  40. package/lib/cjs/interfaces/index.js +0 -5
  41. package/lib/cjs/interfaces/index.js.map +0 -1
  42. package/lib/cjs/utils/index.js +0 -9
  43. package/lib/cjs/utils/index.js.map +0 -1
  44. package/lib/cjs/utils/mapOpenSpec.js +0 -29
  45. package/lib/cjs/utils/mapOpenSpec.js.map +0 -1
  46. package/lib/cjs/utils/mapOpenSpec3.js +0 -26
  47. package/lib/cjs/utils/mapOpenSpec3.js.map +0 -1
  48. package/lib/cjs/utils/mapOpenSpecInfo.js +0 -21
  49. package/lib/cjs/utils/mapOpenSpecInfo.js.map +0 -1
  50. package/lib/esm/interfaces/index.js +0 -2
  51. package/lib/esm/interfaces/index.js.map +0 -1
  52. package/lib/esm/utils/index.js +0 -6
  53. package/lib/esm/utils/index.js.map +0 -1
  54. package/lib/esm/utils/mapOpenSpec.js +0 -25
  55. package/lib/esm/utils/mapOpenSpec.js.map +0 -1
  56. package/lib/esm/utils/mapOpenSpec3.js +0 -22
  57. package/lib/esm/utils/mapOpenSpec3.js.map +0 -1
  58. package/lib/esm/utils/mapOpenSpecInfo.js +0 -17
  59. package/lib/esm/utils/mapOpenSpecInfo.js.map +0 -1
  60. package/lib/types/utils/index.d.ts +0 -5
  61. package/lib/types/utils/mapOpenSpec.d.ts +0 -10
  62. package/lib/types/utils/mapOpenSpec3.d.ts +0 -8
  63. package/lib/types/utils/mapOpenSpecInfo.d.ts +0 -6
@@ -1,11 +1,8 @@
1
1
  var _SwaggerService_specs;
2
2
  import { __classPrivateFieldGet, __decorate, __metadata, __param } from "tslib";
3
3
  import { Configuration, Injectable, InjectorService, Platform } from "@tsed/common";
4
- import { getValue } from "@tsed/core";
5
- import { getSpec, mergeSpec, SpecTypes } from "@tsed/schema";
6
- import Fs from "fs";
7
- import { includeRoute } from "../utils/includeRoute";
8
- import { mapOpenSpec } from "../utils/mapOpenSpec";
4
+ import { generateSpec } from "@tsed/schema";
5
+ import { includeRoute } from "../utils/includeRoute.js";
9
6
  let SwaggerService = class SwaggerService {
10
7
  constructor(injectorService, platform, configuration) {
11
8
  this.injectorService = injectorService;
@@ -13,83 +10,25 @@ let SwaggerService = class SwaggerService {
13
10
  this.configuration = configuration;
14
11
  _SwaggerService_specs.set(this, new Map());
15
12
  }
16
- /**
17
- * Generate Spec for the given configuration
18
- * @returns {Spec}
19
- */
20
- getOpenAPISpec(conf) {
13
+ async getOpenAPISpec(conf) {
21
14
  if (!__classPrivateFieldGet(this, _SwaggerService_specs, "f").has(conf.path)) {
22
- const defaultSpec = this.getDefaultSpec(conf);
23
- let finalSpec = {};
24
- const options = {
25
- paths: {},
26
- tags: [],
27
- schemas: {},
28
- specType: SpecTypes.OPENAPI,
29
- operationIdFormatter: conf.operationIdFormatter,
30
- operationIdPattern: conf.operationIdPattern,
31
- append(spec) {
32
- finalSpec = mergeSpec(finalSpec, spec);
33
- }
34
- };
35
- this.platform.getMountedControllers().forEach(({ route, provider }) => {
36
- if (includeRoute(route, provider, conf)) {
37
- const spec = this.buildRoutes(provider, {
38
- ...options,
39
- rootPath: route.replace(provider.path, "")
40
- });
41
- options.append(spec);
42
- }
15
+ const { version = "1.0.0", acceptMimes } = this.configuration;
16
+ const specPath = conf.specPath ? this.configuration.resolve(conf.specPath) : conf.specPath;
17
+ const tokens = this.platform
18
+ .getMountedControllers()
19
+ .filter(({ route, provider }) => includeRoute(route, provider, conf))
20
+ .map(({ route, provider }) => ({ token: provider.token, rootPath: route.replace(provider.path, "") }));
21
+ const spec = await generateSpec({
22
+ tokens,
23
+ ...conf,
24
+ specPath,
25
+ version,
26
+ acceptMimes
43
27
  });
44
- __classPrivateFieldGet(this, _SwaggerService_specs, "f").set(conf.path, mergeSpec(defaultSpec, finalSpec));
28
+ __classPrivateFieldGet(this, _SwaggerService_specs, "f").set(conf.path, spec);
45
29
  }
46
30
  return __classPrivateFieldGet(this, _SwaggerService_specs, "f").get(conf.path);
47
31
  }
48
- /**
49
- * Return the global api information.
50
- */
51
- getDefaultSpec(conf) {
52
- const { version = "1.0.0", acceptMimes } = this.configuration;
53
- const { specPath, specVersion } = conf;
54
- const fileSpec = specPath ? this.readSpecPath(specPath) : {};
55
- return mapOpenSpec(getValue(conf, "spec", {}), {
56
- fileSpec,
57
- version,
58
- specVersion,
59
- acceptMimes
60
- });
61
- }
62
- readSpecPath(path) {
63
- path = this.configuration.resolve(path);
64
- if (Fs.existsSync(path)) {
65
- const json = Fs.readFileSync(path, { encoding: "utf8" });
66
- /* istanbul ignore else */
67
- if (json !== "") {
68
- return JSON.parse(json);
69
- }
70
- }
71
- return {};
72
- }
73
- /**
74
- *
75
- * @param ctrl
76
- * @param options
77
- */
78
- buildRoutes(ctrl, options) {
79
- const rootPath = options.rootPath + ctrl.path;
80
- ctrl.children
81
- .map((ctrl) => this.injectorService.getProvider(ctrl))
82
- .forEach((provider) => {
83
- if (!provider.store.get("hidden")) {
84
- const spec = this.buildRoutes(provider, {
85
- ...options,
86
- rootPath
87
- });
88
- options.append(spec);
89
- }
90
- });
91
- return getSpec(ctrl.token, options);
92
- }
93
32
  };
94
33
  _SwaggerService_specs = new WeakMap();
95
34
  SwaggerService = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"SwaggerService.js","sourceRoot":"","sources":["../../../src/services/SwaggerService.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,aAAa,EAAsB,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtG,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAC,OAAO,EAAE,SAAS,EAAyB,SAAS,EAAC,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAC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AM,QAAQ,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;QAE9C,IAAI,CAAC,QAAQ;aACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;aACrD,OAAO,CAAC,CAAC,QAA4B,EAAE,EAAE;YACxC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;gBACjC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;oBACtC,GAAG,OAAO;oBACV,QAAQ;iBACT,CAAC,CAAC;gBAEH,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aACtB;QACH,CAAC,CAAC,CAAC;QAEL,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACF,CAAA;;AAnGY,cAAc;IAD1B,UAAU,EAAE;IAOR,WAAA,aAAa,EAAE,CAAA;qCAFS,eAAe;QACtB,QAAQ;GALjB,cAAc,CAmG1B;SAnGY,cAAc","sourcesContent":["import {Configuration, ControllerProvider, Injectable, InjectorService, Platform} from \"@tsed/common\";\nimport {getValue} from \"@tsed/core\";\nimport {OpenSpec3} from \"@tsed/openspec\";\nimport {getSpec, mergeSpec, SpecSerializerOptions, SpecTypes} from \"@tsed/schema\";\nimport Fs from \"fs\";\nimport {SwaggerSettings} from \"../interfaces/SwaggerSettings\";\nimport {includeRoute} from \"../utils/includeRoute\";\nimport {mapOpenSpec} from \"../utils/mapOpenSpec\";\n\n@Injectable()\nexport class SwaggerService {\n #specs: Map<string, OpenSpec3> = 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 getOpenAPISpec(conf: SwaggerSettings) {\n if (!this.#specs.has(conf.path)) {\n const defaultSpec: any = this.getDefaultSpec(conf);\n let finalSpec: any = {};\n\n const options: SpecSerializerOptions = {\n paths: {},\n tags: [],\n schemas: {},\n specType: SpecTypes.OPENAPI,\n operationIdFormatter: conf.operationIdFormatter,\n operationIdPattern: conf.operationIdPattern,\n append(spec: any) {\n finalSpec = mergeSpec(finalSpec, spec);\n }\n };\n\n this.platform.getMountedControllers().forEach(({route, provider}) => {\n if (includeRoute(route, provider, conf)) {\n const spec = this.buildRoutes(provider, {\n ...options,\n rootPath: route.replace(provider.path, \"\")\n });\n\n options.append(spec);\n }\n });\n\n this.#specs.set(conf.path, mergeSpec(defaultSpec, finalSpec) as any);\n }\n\n return this.#specs.get(conf.path);\n }\n\n /**\n * Return the global api information.\n */\n protected getDefaultSpec(conf: Partial<SwaggerSettings>): Partial<OpenSpec3> {\n const {version = \"1.0.0\", acceptMimes} = this.configuration;\n const {specPath, specVersion} = conf;\n const fileSpec: Partial<OpenSpec3> = specPath ? this.readSpecPath(specPath) : {};\n\n return mapOpenSpec(getValue(conf, \"spec\", {}), {\n fileSpec,\n version,\n specVersion,\n acceptMimes\n });\n }\n\n protected readSpecPath(path: string) {\n path = this.configuration.resolve(path);\n if (Fs.existsSync(path)) {\n const json = Fs.readFileSync(path, {encoding: \"utf8\"});\n /* istanbul ignore else */\n if (json !== \"\") {\n return JSON.parse(json);\n }\n }\n\n return {};\n }\n\n /**\n *\n * @param ctrl\n * @param options\n */\n protected buildRoutes(ctrl: ControllerProvider, options: SpecSerializerOptions) {\n const rootPath = options.rootPath + ctrl.path;\n\n ctrl.children\n .map((ctrl) => this.injectorService.getProvider(ctrl))\n .forEach((provider: ControllerProvider) => {\n if (!provider.store.get(\"hidden\")) {\n const spec = this.buildRoutes(provider, {\n ...options,\n rootPath\n });\n\n options.append(spec);\n }\n });\n\n return getSpec(ctrl.token, options);\n }\n}\n"]}
1
+ {"version":3,"file":"SwaggerService.js","sourceRoot":"","sources":["../../../src/services/SwaggerService.ts"],"names":[],"mappings":";;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AAG,MAAM,YAAY,CAAC;gBAC9B,MAAM;gBACN,GAAG,IAAI;gBACP,QAAQ;gBACR,OAAO;gBACP,WAAW;aACZ,CAAC,CAAC;YAEH,uBAAA,IAAI,6BAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAClC;QAED,OAAO,uBAAA,IAAI,6BAAO,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(({route, provider}) => includeRoute(route, provider, conf))\n .map(({route, provider}) => ({token: provider.token, rootPath: route.replace(provider.path, \"\")}));\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,4 +1,4 @@
1
- import { matchPath } from ".";
1
+ import { matchPath } from "./matchPath.js";
2
2
  export function includeRoute(route, provider, conf) {
3
3
  const hidden = provider.store.get("hidden");
4
4
  const docs = provider.store.get("docs") || [];
@@ -1 +1 @@
1
- {"version":3,"file":"includeRoute.js","sourceRoot":"","sources":["../../../src/utils/includeRoute.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,GAAG,CAAC;AAG5B,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,QAA4B,EAAE,IAAqB;IAC7F,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9C,MAAM,EAAC,GAAG,EAAE,YAAY,EAAC,GAAG,IAAI,CAAC;IACjC,MAAM,KAAK,GAAG,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,MAAM,gBAAgB,GAAG,YAAY,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAExE,IAAI,MAAM,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,gBAAgB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import {ControllerProvider} from \"@tsed/common\";\nimport {matchPath} from \".\";\nimport {SwaggerSettings} from \"..\";\n\nexport function includeRoute(route: string, provider: ControllerProvider, conf: SwaggerSettings): boolean {\n const hidden = provider.store.get(\"hidden\");\n const docs = provider.store.get(\"docs\") || [];\n const {doc, pathPatterns} = conf;\n const inDoc = doc && docs.indexOf(doc) > -1;\n const pathPatternMatch = pathPatterns && matchPath(route, pathPatterns);\n\n if (hidden) {\n return false;\n }\n\n if (!doc && !pathPatterns) {\n return true;\n }\n\n return !!(inDoc || pathPatternMatch);\n}\n"]}
1
+ {"version":3,"file":"includeRoute.js","sourceRoot":"","sources":["../../../src/utils/includeRoute.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAGtC,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,QAA4B,EAAE,IAAqB;IAC7F,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9C,MAAM,EAAC,GAAG,EAAE,YAAY,EAAC,GAAG,IAAI,CAAC;IACjC,MAAM,KAAK,GAAG,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,MAAM,gBAAgB,GAAG,YAAY,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAExE,IAAI,MAAM,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,gBAAgB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import {ControllerProvider} from \"@tsed/common\";\nimport {matchPath} from \"./matchPath\";\nimport {SwaggerSettings} from \"../interfaces/SwaggerSettings\";\n\nexport function includeRoute(route: string, provider: ControllerProvider, conf: SwaggerSettings): boolean {\n const hidden = provider.store.get(\"hidden\");\n const docs = provider.store.get(\"docs\") || [];\n const {doc, pathPatterns} = conf;\n const inDoc = doc && docs.indexOf(doc) > -1;\n const pathPatternMatch = pathPatterns && matchPath(route, pathPatterns);\n\n if (hidden) {\n return false;\n }\n\n if (!doc && !pathPatterns) {\n return true;\n }\n\n return !!(inDoc || pathPatternMatch);\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { OnRoutesInit, Configuration, InjectorService, OnReady, PlatformApplication } from "@tsed/common";
2
+ import { SwaggerSettings } from "./interfaces/SwaggerSettings";
2
3
  import { SwaggerService } from "./services/SwaggerService";
3
4
  import { Env } from "@tsed/core";
4
5
  /**
@@ -11,7 +12,7 @@ export declare class SwaggerModule implements OnRoutesInit, OnReady {
11
12
  swaggerService: SwaggerService;
12
13
  env: Env;
13
14
  private loaded;
14
- get settings(): import("./interfaces").SwaggerOS3Settings[];
15
+ get settings(): SwaggerSettings[];
15
16
  /**
16
17
  *
17
18
  */
@@ -1,5 +1,15 @@
1
- export * from "./services/SwaggerService";
1
+ /**
2
+ * @file Automatically generated by barrelsby.
3
+ */
2
4
  export * from "./SwaggerModule";
3
- export * from "./interfaces";
4
5
  export * from "./decorators/docs";
5
6
  export * from "./decorators/hidden";
7
+ export * from "./interfaces/SwaggerSettings";
8
+ export * from "./interfaces/interfaces";
9
+ export * from "./middlewares/cssMiddleware";
10
+ export * from "./middlewares/indexMiddleware";
11
+ export * from "./middlewares/jsMiddleware";
12
+ export * from "./middlewares/redirectMiddleware";
13
+ export * from "./services/SwaggerService";
14
+ export * from "./utils/includeRoute";
15
+ export * from "./utils/matchPath";
@@ -1,4 +1,4 @@
1
- import { OpenSpec3, OpenSpecVersions, OS3Versions } from "@tsed/openspec";
1
+ import { OpenSpec2, OpenSpec3, OpenSpecVersions, OS2Versions, OS3Versions } from "@tsed/openspec";
2
2
  export interface SwaggerUIOptions {
3
3
  configUrl?: string;
4
4
  url?: string;
@@ -79,6 +79,13 @@ export interface SwaggerSettingsBase {
79
79
  */
80
80
  pathPatterns?: string[];
81
81
  }
82
+ export interface SwaggerOS2Settings extends SwaggerSettingsBase {
83
+ specVersion?: OS2Versions;
84
+ /**
85
+ * OpenSpec 2
86
+ */
87
+ spec?: Partial<OpenSpec2>;
88
+ }
82
89
  export interface SwaggerOS3Settings extends SwaggerSettingsBase {
83
90
  specVersion?: OS3Versions;
84
91
  /**
@@ -86,4 +93,4 @@ export interface SwaggerOS3Settings extends SwaggerSettingsBase {
86
93
  */
87
94
  spec?: Partial<OpenSpec3>;
88
95
  }
89
- export declare type SwaggerSettings = SwaggerOS3Settings;
96
+ export declare type SwaggerSettings = SwaggerOS2Settings | SwaggerOS3Settings;
@@ -6,4 +6,3 @@ declare global {
6
6
  }
7
7
  }
8
8
  }
9
- export * from "./SwaggerSettings";
@@ -1,7 +1,6 @@
1
- import { Configuration, ControllerProvider, InjectorService, Platform } from "@tsed/common";
2
- import { OpenSpec3 } from "@tsed/openspec";
3
- import { SpecSerializerOptions } from "@tsed/schema";
4
- import { SwaggerSettings } from "../interfaces/SwaggerSettings";
1
+ import { Configuration, InjectorService, Platform } from "@tsed/common";
2
+ import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
3
+ import { SwaggerOS2Settings, SwaggerOS3Settings, SwaggerSettings } from "../interfaces/SwaggerSettings";
5
4
  export declare class SwaggerService {
6
5
  #private;
7
6
  private injectorService;
@@ -12,16 +11,7 @@ export declare class SwaggerService {
12
11
  * Generate Spec for the given configuration
13
12
  * @returns {Spec}
14
13
  */
15
- getOpenAPISpec(conf: SwaggerSettings): OpenSpec3<import("@tsed/openspec").OS3Schema> | undefined;
16
- /**
17
- * Return the global api information.
18
- */
19
- protected getDefaultSpec(conf: Partial<SwaggerSettings>): Partial<OpenSpec3>;
20
- protected readSpecPath(path: string): any;
21
- /**
22
- *
23
- * @param ctrl
24
- * @param options
25
- */
26
- protected buildRoutes(ctrl: ControllerProvider, options: SpecSerializerOptions): Partial<OpenSpec3<import("@tsed/openspec").OS3Schema>>;
14
+ getOpenAPISpec(conf: SwaggerOS3Settings): Promise<OpenSpec3>;
15
+ getOpenAPISpec(conf: SwaggerOS2Settings): Promise<OpenSpec2>;
16
+ getOpenAPISpec(conf: SwaggerSettings): Promise<OpenSpec2>;
27
17
  }
@@ -1,3 +1,3 @@
1
1
  import { ControllerProvider } from "@tsed/common";
2
- import { SwaggerSettings } from "..";
2
+ import { SwaggerSettings } from "../interfaces/SwaggerSettings";
3
3
  export declare function includeRoute(route: string, provider: ControllerProvider, conf: SwaggerSettings): boolean;
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@tsed/swagger",
3
- "version": "7.0.0-beta.3",
3
+ "version": "7.0.0-beta.4",
4
4
  "description": "Swagger package for Ts.ED framework",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
7
7
  "main": "./lib/cjs/index.js",
8
+ "module": "./lib/esm/index.js",
8
9
  "typings": "./lib/types/index.d.ts",
9
10
  "exports": {
10
11
  "types": "./lib/types/index.d.ts",
@@ -13,38 +14,43 @@
13
14
  "default": "./lib/esm/index.js"
14
15
  },
15
16
  "scripts": {
16
- "build": "yarn run build:esm && yarn run build:cjs && cp -r ./views ./lib/views",
17
+ "clean": "rm -rf lib",
18
+ "build": "yarn clean && yarn barrels && yarn run build:esm && yarn run build:cjs && cp -r ./views ./lib/views",
17
19
  "build:cjs": "tsc --build tsconfig.compile.json",
18
20
  "build:esm": "tsc --build tsconfig.compile.esm.json",
19
- "start": "ts-node -r tsconfig-paths/register test/app/index.ts"
21
+ "barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
22
+ "start": "ts-node -r tsconfig-paths/register test/app/index.ts",
23
+ "test": "cross-env NODE_ENV=test yarn jest --max-workers=2"
20
24
  },
21
25
  "dependencies": {
22
- "fs-extra": "9.0.1",
23
- "micromatch": "^4.0.2",
24
- "swagger-ui-dist": "^3.46.0",
25
- "tslib": "2.2.0"
26
+ "@tsed/openspec": "7.0.0-beta.4",
27
+ "fs-extra": "10.0.1",
28
+ "micromatch": "4.0.5",
29
+ "swagger-ui-dist": "^4.5.2",
30
+ "tslib": "2.3.1"
26
31
  },
27
32
  "devDependencies": {
28
- "@tsed/common": "7.0.0-beta.3",
29
- "@tsed/core": "7.0.0-beta.3",
30
- "@tsed/di": "7.0.0-beta.3",
31
- "@tsed/json-mapper": "7.0.0-beta.3",
32
- "@tsed/openspec": "7.0.0-beta.3",
33
- "@tsed/schema": "7.0.0-beta.3"
33
+ "@tsed/common": "7.0.0-beta.4",
34
+ "@tsed/core": "7.0.0-beta.4",
35
+ "@tsed/di": "7.0.0-beta.4",
36
+ "@tsed/json-mapper": "7.0.0-beta.4",
37
+ "@tsed/openspec": "7.0.0-beta.4",
38
+ "@tsed/schema": "7.0.0-beta.4",
39
+ "@types/swagger-ui-dist": ">=3.30.1"
34
40
  },
35
41
  "peerDependencies": {
36
- "@tsed/common": "^7.0.0-beta.3",
37
- "@tsed/core": "^7.0.0-beta.3",
38
- "@tsed/di": "^7.0.0-beta.3",
39
- "@tsed/json-mapper": "^7.0.0-beta.3",
40
- "@tsed/openspec": "^7.0.0-beta.3",
41
- "@tsed/schema": "^7.0.0-beta.3"
42
+ "@tsed/common": "^7.0.0-beta.4"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "@tsed/common": {
46
+ "optional": false
47
+ }
42
48
  },
43
49
  "repository": "https://github.com/tsedio/tsed",
44
50
  "bugs": {
45
51
  "url": "https://github.com/tsedio/tsed/issues"
46
52
  },
47
- "homepage": "https://github.com/tsedio/tsed/tree/beta/packages/specs/swagger",
53
+ "homepage": "https://github.com/tsedio/tsed/tree/production/packages/specs/swagger",
48
54
  "author": "Romain Lenzotti",
49
55
  "license": "MIT"
50
56
  }
package/readme.md CHANGED
@@ -43,25 +43,22 @@ Then add the following configuration in your Server:
43
43
  import {Configuration} from "@tsed/common";
44
44
  import "@tsed/swagger"; // import swagger Ts.ED module
45
45
  import {resolve} from "path";
46
- const rootDir = resolve(__dirname)
47
46
 
48
47
  @Configuration({
49
- rootDir,
50
48
  swagger: [
51
49
  {
52
- path: "/v2/docs",
53
- specVersion: "2.0"
50
+ path: "/v2/docs",
51
+ specVersion: "2.0"
54
52
  },
55
53
  {
56
- path: "/v3/docs",
57
- specVersion: "3.0.1"
54
+ path: "/v3/docs",
55
+ specVersion: "3.0.1"
58
56
  }
59
57
  ]
60
58
  })
61
- export class Server {
62
-
63
- }
59
+ export class Server {}
64
60
  ```
61
+
65
62
  > The path option for swagger will be used to expose the documentation (ex: http://localhost:8000/api-docs).
66
63
 
67
64
  Normally, Swagger-ui is ready. You can start your server and check if it work fine.
@@ -72,21 +69,21 @@ Normally, Swagger-ui is ready. You can start your server and check if it work fi
72
69
 
73
70
  Some options is available to configure Swagger-ui, Ts.ED and the default spec information.
74
71
 
75
- Key | Example | Description
76
- ---|---|---
77
- path | `/api-doc` | The url subpath to access to the documentation.
78
- specVersion | `2.0`, `3.0.1` | The spec version.
79
- doc | `hidden-doc` | The documentation key used by `@Docs` decorator to create several swagger documentations.
80
- cssPath | `${rootDir}/spec/style.css` | The path to the CSS file.
81
- jsPath | `${rootDir}/spec/main.js` | The path to the JS file.
82
- showExplorer | `true` | Display the search field in the navbar.
83
- spec | `{swagger: "2.0"}` | The default information spec.
84
- specPath | `${rootDir}/spec/swagger.base.json` | Load the base spec documentation from the specified path.
85
- outFile | `${rootDir}/spec/swagger.json` | Write the `swagger.json` spec documentation on the specified path.
86
- hidden | `true` | Hide the documentation in the dropdown explorer list.
87
- options | Swagger-UI options | SwaggerUI options. See (https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/usage/configuration.md)
88
- operationIdFormatter | `(name: string, propertyKey: string, path: string) => string` | A function to generate the operationId.
89
- operationIdPattern | `%c_%m` | A pattern to generate the operationId. Format of operationId field (%c: class name, %m: method name).
72
+ | Key | Example | Description |
73
+ | -------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
74
+ | path | `/api-doc` | The url subpath to access to the documentation. |
75
+ | specVersion | `2.0`, `3.0.1` | The spec version. |
76
+ | doc | `hidden-doc` | The documentation key used by `@Docs` decorator to create several swagger documentations. |
77
+ | cssPath | `${rootDir}/spec/style.css` | The path to the CSS file. |
78
+ | jsPath | `${rootDir}/spec/main.js` | The path to the JS file. |
79
+ | showExplorer | `true` | Display the search field in the navbar. |
80
+ | spec | `{swagger: "2.0"}` | The default information spec. |
81
+ | specPath | `${rootDir}/spec/swagger.base.json` | Load the base spec documentation from the specified path. |
82
+ | outFile | `${rootDir}/spec/swagger.json` | Write the `swagger.json` spec documentation on the specified path. |
83
+ | hidden | `true` | Hide the documentation in the dropdown explorer list. |
84
+ | options | Swagger-UI options | SwaggerUI options. See (https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/usage/configuration.md) |
85
+ | operationIdFormatter | `(name: string, propertyKey: string, path: string) => string` | A function to generate the operationId. |
86
+ | operationIdPattern | `%c_%m` | A pattern to generate the operationId. Format of operationId field (%c: class name, %m: method name). |
90
87
 
91
88
  ### Multi documentations
92
89
 
@@ -97,21 +94,18 @@ import {Configuration} from "@tsed/common";
97
94
  import "@tsed/swagger"; // import swagger Ts.ED module
98
95
 
99
96
  @Configuration({
100
- rootDir: __dirname,
101
97
  swagger: [
102
98
  {
103
99
  path: "/api-docs-v1",
104
- doc: 'api-v1'
100
+ doc: "api-v1"
105
101
  },
106
102
  {
107
103
  path: "/api-docs-v2",
108
- doc: 'api-v2'
104
+ doc: "api-v2"
109
105
  }
110
106
  ]
111
107
  })
112
- export class Server {
113
-
114
- }
108
+ export class Server {}
115
109
  ```
116
110
 
117
111
  Then use `@Docs` decorators on your controllers to specify where the controllers should be displayed.
@@ -120,19 +114,17 @@ Then use `@Docs` decorators on your controllers to specify where the controllers
120
114
  import {Controller} from "@tsed/common";
121
115
  import {Docs} from "@tsed/swagger";
122
116
 
123
- @Controller('/calendars')
124
- @Docs('api-v2') // display this controllers only for api-docs-v2
125
- export class CalendarCtrlV2 {
126
- }
127
- // OR
128
- @Controller('/calendars')
129
- @Docs('api-v2', 'api-v1') // display this controllers for api-docs-v2 and api-docs-v1
130
- export class CalendarCtrl {
131
-
132
- }
133
- ```
117
+ @Controller("/calendars")
118
+ @Docs("api-v2") // display this controllers only for api-docs-v2
119
+ export class CalendarCtrlV2 {}
120
+ // OR
121
+ @Controller("/calendars")
122
+ @Docs("api-v2", "api-v1") // display this controllers for api-docs-v2 and api-docs-v1
123
+ export class CalendarCtrl {}
124
+ ```
134
125
 
135
126
  ## Examples
127
+
136
128
  #### Model documentation
137
129
 
138
130
  One of the feature of Ts.ED is the model definition to serialize or deserialize a
@@ -162,57 +154,55 @@ import {BodyParams, Controller, Get, Post, QueryParams, Returns, ReturnsArray, D
162
154
  import {Summary, Deprecated, Security} from "@tsed/swagger";
163
155
  import {CalendarModel} from "../models/CalendarModel";
164
156
 
165
- @Controller('/calendars')
157
+ @Controller("/calendars")
166
158
  export class Calendar {
167
- @Get('/:id')
168
- @Summary("Summary of this route")
169
- @Description("Description of this route")
170
- @Returns(CalendarModel)
171
- @Returns(404, {description: "Not found"})
172
- async getCalendar(@QueryParams('id') id: string): Promise<CalendarModel> {
173
- //...
174
- }
175
-
176
- @Get('/v0/:id')
177
- @Deprecated()
178
- @Description("Deprecated route, use /rest/calendars/:id instead of.")
179
- @Returns(CalendarModel)
180
- @Returns(404, {description: "Not found"})
181
- getCalendarDeprecated(@QueryParams('id') id: string): Promise<CalendarModel> {
182
- //...
183
- }
184
-
185
- @Get('/')
186
- @Description("Description of this route")
187
- @ReturnsArray(CalendarModel)
188
- getCalendars(): Promise<CalendarModel[]> {
189
- // ...
190
- }
191
-
192
- @Post('/')
193
- @Security("calendar_auth", "write:calendar", "read:calendar")
194
- @Returns(CalendarModel)
195
- async createCalendar(@BodyParams() body: any): Promise<CalendarModel> {
196
- //...
197
- }
159
+ @Get("/:id")
160
+ @Summary("Summary of this route")
161
+ @Description("Description of this route")
162
+ @Returns(CalendarModel)
163
+ @Returns(404, {description: "Not found"})
164
+ async getCalendar(@QueryParams("id") id: string): Promise<CalendarModel> {
165
+ //...
166
+ }
167
+
168
+ @Get("/v0/:id")
169
+ @Deprecated()
170
+ @Description("Deprecated route, use /rest/calendars/:id instead of.")
171
+ @Returns(CalendarModel)
172
+ @Returns(404, {description: "Not found"})
173
+ getCalendarDeprecated(@QueryParams("id") id: string): Promise<CalendarModel> {
174
+ //...
175
+ }
176
+
177
+ @Get("/")
178
+ @Description("Description of this route")
179
+ @ReturnsArray(CalendarModel)
180
+ getCalendars(): Promise<CalendarModel[]> {
181
+ // ...
182
+ }
183
+
184
+ @Post("/")
185
+ @Security("calendar_auth", "write:calendar", "read:calendar")
186
+ @Returns(CalendarModel)
187
+ async createCalendar(@BodyParams() body: any): Promise<CalendarModel> {
188
+ //...
189
+ }
198
190
  }
199
191
  ```
192
+
200
193
  ::: warninig
201
194
  To update the swagger.json you need to reload the server before.
202
195
  :::
203
196
 
204
-
205
197
  ## Import Javascript
206
198
 
207
- It possible to import a Javascript in the Swagger-ui documentation. This script let you customize the swagger-ui instance.
208
-
199
+ It possible to import a Javascript in the Swagger-ui documentation. This script let you customize the swagger-ui instance.
209
200
 
210
201
  ```typescript
211
202
  import {Configuration} from "@tsed/common";
212
203
  import "@tsed/swagger"; // import swagger Ts.ED module
213
204
 
214
205
  @Configuration({
215
- rootDir: __dirname,
216
206
  swagger: [
217
207
  {
218
208
  path: "/api-docs",
@@ -220,9 +210,7 @@ import "@tsed/swagger"; // import swagger Ts.ED module
220
210
  }
221
211
  ]
222
212
  })
223
- export class Server {
224
-
225
- }
213
+ export class Server {}
226
214
  ```
227
215
 
228
216
  In your JavaScript file, you can handle Swagger-ui configuration and the instance:
@@ -230,8 +218,8 @@ In your JavaScript file, you can handle Swagger-ui configuration and the instanc
230
218
  ```javascript
231
219
  console.log(SwaggerUIBuilder.config); //Swagger-ui config
232
220
 
233
- document.addEventListener('swagger.init', (evt) => {
234
- console.log(SwaggerUIBuilder.ui); //Swagger-ui instance
221
+ document.addEventListener("swagger.init", (evt) => {
222
+ console.log(SwaggerUIBuilder.ui); //Swagger-ui instance
235
223
  });
236
224
  ```
237
225
 
@@ -239,20 +227,18 @@ document.addEventListener('swagger.init', (evt) => {
239
227
 
240
228
  See our documentation https://tsed.io/#/api/index
241
229
 
242
-
243
230
  ## Contributors
231
+
244
232
  Please read [contributing guidelines here](https://tsed.io/CONTRIBUTING.html).
245
233
 
246
234
  <a href="https://github.com/tsedio/ts-express-decorators/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>
247
235
 
248
-
249
236
  ## Backers
250
237
 
251
238
  Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)]
252
239
 
253
240
  <a href="https://opencollective.com/tsed#backers" target="_blank"><img src="https://opencollective.com/tsed/tiers/backer.svg?width=890"></a>
254
241
 
255
-
256
242
  ## Sponsors
257
243
 
258
244
  Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./SwaggerSettings"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAUA,iEAAkC","sourcesContent":["import {SwaggerSettings} from \"./SwaggerSettings\";\n\ndeclare global {\n namespace TsED {\n interface Configuration {\n swagger: SwaggerSettings[];\n }\n }\n}\n\nexport * from \"./SwaggerSettings\";\n"]}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./mapOpenSpec"), exports);
5
- (0, tslib_1.__exportStar)(require("./mapOpenSpec3"), exports);
6
- (0, tslib_1.__exportStar)(require("./mapOpenSpecInfo"), exports);
7
- (0, tslib_1.__exportStar)(require("./mapOpenSpecInfo"), exports);
8
- (0, tslib_1.__exportStar)(require("./matchPath"), exports);
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAC9B,8DAA+B;AAC/B,iEAAkC;AAClC,iEAAkC;AAClC,2DAA4B","sourcesContent":["export * from \"./mapOpenSpec\";\nexport * from \"./mapOpenSpec3\";\nexport * from \"./mapOpenSpecInfo\";\nexport * from \"./mapOpenSpecInfo\";\nexport * from \"./matchPath\";\n"]}