@tsed/swagger 7.0.0-alpha.2 → 7.0.0-beta.11

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 (85) hide show
  1. package/jest.config.js +14 -0
  2. package/lib/cjs/SwaggerModule.js +130 -0
  3. package/lib/cjs/SwaggerModule.js.map +1 -0
  4. package/lib/cjs/decorators/docs.js +18 -0
  5. package/lib/cjs/decorators/docs.js.map +1 -0
  6. package/lib/cjs/decorators/hidden.js +40 -0
  7. package/lib/cjs/decorators/hidden.js.map +1 -0
  8. package/lib/cjs/index.js +19 -0
  9. package/lib/cjs/index.js.map +1 -0
  10. package/lib/cjs/interfaces/SwaggerSettings.js +3 -0
  11. package/lib/cjs/interfaces/SwaggerSettings.js.map +1 -0
  12. package/lib/cjs/interfaces/interfaces.js +3 -0
  13. package/lib/cjs/interfaces/interfaces.js.map +1 -0
  14. package/lib/cjs/middlewares/cssMiddleware.js +23 -0
  15. package/lib/cjs/middlewares/cssMiddleware.js.map +1 -0
  16. package/lib/cjs/middlewares/indexMiddleware.js +24 -0
  17. package/lib/cjs/middlewares/indexMiddleware.js.map +1 -0
  18. package/lib/cjs/middlewares/jsMiddleware.js +18 -0
  19. package/lib/cjs/middlewares/jsMiddleware.js.map +1 -0
  20. package/lib/cjs/middlewares/redirectMiddleware.js +16 -0
  21. package/lib/cjs/middlewares/redirectMiddleware.js.map +1 -0
  22. package/lib/cjs/package.json +3 -0
  23. package/lib/cjs/services/SwaggerService.js +44 -0
  24. package/lib/cjs/services/SwaggerService.js.map +1 -0
  25. package/lib/cjs/utils/includeRoute.js +20 -0
  26. package/lib/cjs/utils/includeRoute.js.map +1 -0
  27. package/lib/cjs/utils/matchPath.js +10 -0
  28. package/lib/cjs/utils/matchPath.js.map +1 -0
  29. package/lib/esm/SwaggerModule.js +127 -0
  30. package/lib/esm/SwaggerModule.js.map +1 -0
  31. package/lib/esm/decorators/docs.js +14 -0
  32. package/lib/esm/decorators/docs.js.map +1 -0
  33. package/lib/esm/decorators/hidden.js +36 -0
  34. package/lib/esm/decorators/hidden.js.map +1 -0
  35. package/lib/esm/index.js +16 -0
  36. package/lib/esm/index.js.map +1 -0
  37. package/lib/esm/interfaces/SwaggerSettings.js +2 -0
  38. package/lib/esm/interfaces/SwaggerSettings.js.map +1 -0
  39. package/lib/esm/interfaces/interfaces.js +2 -0
  40. package/lib/esm/interfaces/interfaces.js.map +1 -0
  41. package/lib/esm/middlewares/cssMiddleware.js +18 -0
  42. package/lib/esm/middlewares/cssMiddleware.js.map +1 -0
  43. package/lib/esm/middlewares/indexMiddleware.js +20 -0
  44. package/lib/esm/middlewares/indexMiddleware.js.map +1 -0
  45. package/lib/esm/middlewares/jsMiddleware.js +13 -0
  46. package/lib/esm/middlewares/jsMiddleware.js.map +1 -0
  47. package/lib/esm/middlewares/redirectMiddleware.js +12 -0
  48. package/lib/esm/middlewares/redirectMiddleware.js.map +1 -0
  49. package/lib/esm/package.json +3 -0
  50. package/lib/esm/services/SwaggerService.js +41 -0
  51. package/lib/esm/services/SwaggerService.js.map +1 -0
  52. package/lib/esm/utils/includeRoute.js +16 -0
  53. package/lib/esm/utils/includeRoute.js.map +1 -0
  54. package/lib/esm/utils/matchPath.js +5 -0
  55. package/lib/esm/utils/matchPath.js.map +1 -0
  56. package/lib/{SwaggerModule.d.ts → types/SwaggerModule.d.ts} +6 -4
  57. package/lib/{decorators → types/decorators}/docs.d.ts +0 -0
  58. package/lib/{decorators → types/decorators}/hidden.d.ts +0 -0
  59. package/lib/types/index.d.ts +15 -0
  60. package/lib/{interfaces → types/interfaces}/SwaggerSettings.d.ts +0 -3
  61. package/lib/{interfaces/index.d.ts → types/interfaces/interfaces.d.ts} +0 -1
  62. package/lib/{middlewares → types/middlewares}/cssMiddleware.d.ts +0 -0
  63. package/lib/{middlewares → types/middlewares}/indexMiddleware.d.ts +0 -0
  64. package/lib/{middlewares → types/middlewares}/jsMiddleware.d.ts +0 -0
  65. package/lib/{middlewares → types/middlewares}/redirectMiddleware.d.ts +0 -0
  66. package/lib/types/services/SwaggerService.d.ts +17 -0
  67. package/lib/{utils → types/utils}/includeRoute.d.ts +1 -1
  68. package/lib/{utils → types/utils}/matchPath.d.ts +0 -0
  69. package/lib/views/index.ejs +145 -0
  70. package/lib/views/index.html +144 -0
  71. package/package.json +35 -28
  72. package/readme.md +71 -85
  73. package/tsconfig.compile.esm.json +24 -0
  74. package/lib/index.d.ts +0 -5
  75. package/lib/index.js +0 -629
  76. package/lib/index.js.map +0 -1
  77. package/lib/index.modern.js +0 -626
  78. package/lib/index.modern.js.map +0 -1
  79. package/lib/services/SwaggerService.d.ts +0 -29
  80. package/lib/utils/getSpecType.d.ts +0 -12
  81. package/lib/utils/index.d.ts +0 -7
  82. package/lib/utils/mapOpenSpec.d.ts +0 -10
  83. package/lib/utils/mapOpenSpec2.d.ts +0 -9
  84. package/lib/utils/mapOpenSpec3.d.ts +0 -8
  85. package/lib/utils/mapOpenSpecInfo.d.ts +0 -6
@@ -0,0 +1,144 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Swagger UI</title>
6
+ <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Source+Code+Pro:300,600|Titillium+Web:400,600,700"
7
+ rel="stylesheet">
8
+ <link rel="stylesheet" type="text/css" href="./swagger-ui.css">
9
+ <link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32"/>
10
+ <link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16"/>
11
+ <style>
12
+ html {
13
+ box-sizing: border-box;
14
+ overflow: -moz-scrollbars-vertical;
15
+ overflow-y: scroll;
16
+ }
17
+
18
+ *,
19
+ *:before,
20
+ *:after {
21
+ box-sizing: inherit;
22
+ }
23
+
24
+ body {
25
+ margin: 0;
26
+ background: #fafafa;
27
+ }
28
+
29
+
30
+ .swagger-ui .topbar .download-url-wrapper {
31
+ display: none
32
+ }
33
+
34
+
35
+ </style>
36
+
37
+ <link rel="stylesheet" type="text/css" href="./main.css">
38
+
39
+ </head>
40
+
41
+ <body>
42
+ <div id="swagger-ui"></div>
43
+
44
+ <script src="./swagger-ui-bundle.js"></script>
45
+ <script src="./swagger-ui-standalone-preset.js"></script>
46
+ <script>
47
+ if (typeof Object.assign !== 'function') {
48
+ // Must be writable: true, enumerable: false, configurable: true
49
+ Object.defineProperty(Object, "assign", {
50
+ value: function assign(target, varArgs) { // .length of function is 2
51
+ 'use strict';
52
+ if (target == null) { // TypeError if undefined or null
53
+ throw new TypeError('Cannot convert undefined or null to object');
54
+ }
55
+
56
+ var to = Object(target);
57
+
58
+ for (var index = 1; index < arguments.length; index++) {
59
+ var nextSource = arguments[index];
60
+
61
+ if (nextSource != null) { // Skip over if undefined or null
62
+ for (var nextKey in nextSource) {
63
+ // Avoid bugs when hasOwnProperty is shadowed
64
+ if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
65
+ to[nextKey] = nextSource[nextKey];
66
+ }
67
+ }
68
+ }
69
+ }
70
+ return to;
71
+ },
72
+ writable: true,
73
+ configurable: true
74
+ });
75
+ }
76
+ </script>
77
+ <script>
78
+ const origin = window.location.origin;
79
+ const initialOptions = {};
80
+ const currentUrl = origin + "/doc/swagger.json";
81
+ const urls = []
82
+ .map(function (o) {
83
+ if (!o.url.match(/^https?:/)) {
84
+ const url = origin + o.url;
85
+ return {
86
+ name: o.name,
87
+ url: url,
88
+ selected: url === currentUrl
89
+ }
90
+ }
91
+ return o;
92
+ })
93
+ .sort(function (a, b) {
94
+ return a.selected ? -1 : 1
95
+ });
96
+
97
+ const SwaggerUIBuilder = {
98
+ config: Object.assign({
99
+ urls: urls,
100
+ dom_id: '#swagger-ui',
101
+ deepLinking: true,
102
+ presets: [
103
+ SwaggerUIBundle.presets.apis,
104
+ SwaggerUIStandalonePreset
105
+ ],
106
+ plugins: [
107
+ SwaggerUIBundle.plugins.DownloadUrl
108
+ ],
109
+ layout: "StandaloneLayout",
110
+ validatorUrl: origin.match('0.0.0.0') || origin.match('localhost') ? null : undefined
111
+ }, initialOptions),
112
+ /**
113
+ *
114
+ */
115
+ init: function () {
116
+ this.ui = SwaggerUIBundle(this.config);
117
+
118
+ if (this.config.oauth) {
119
+ this.ui.initOAuth(this.config.oauth);
120
+ }
121
+
122
+ if (this.config.authorize) {
123
+ this.ui.authActions.authorize(this.config.authorize);
124
+ }
125
+
126
+ window.ui = this.ui;
127
+
128
+ const event = new Event('swagger.init');
129
+ document.dispatchEvent(event);
130
+ }
131
+ }
132
+
133
+ </script>
134
+
135
+ <script src="./main.js"></script>
136
+
137
+ <script>
138
+ window.onload = function () {
139
+ SwaggerUIBuilder.init();
140
+ }
141
+ </script>
142
+
143
+ </body>
144
+ </html>
package/package.json CHANGED
@@ -1,49 +1,56 @@
1
1
  {
2
2
  "name": "@tsed/swagger",
3
- "version": "7.0.0-alpha.2",
3
+ "version": "7.0.0-beta.11",
4
4
  "description": "Swagger package for Ts.ED framework",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
7
- "main": "./lib/index.js",
8
- "typings": "./lib/index.d.ts",
7
+ "main": "./lib/cjs/index.js",
8
+ "module": "./lib/esm/index.js",
9
+ "typings": "./lib/types/index.d.ts",
9
10
  "exports": {
10
- "require": "./lib/index.js",
11
- "default": "./lib/index.modern.js"
11
+ "types": "./lib/types/index.d.ts",
12
+ "import": "./lib/esm/index.js",
13
+ "require": "./lib/cjs/index.js",
14
+ "default": "./lib/esm/index.js"
12
15
  },
13
16
  "scripts": {
14
- "build": "microbundle --target node --no-compress --format modern,cjs --tsconfig ./tsconfig.compile.json",
15
- "start": "ts-node -r tsconfig-paths/register test/app/index.ts"
17
+ "clean": "rm -rf lib",
18
+ "build": "yarn clean && yarn barrels && yarn run build:esm && yarn run build:cjs && cp -r ./views ./lib/views",
19
+ "build:cjs": "tsc --build tsconfig.compile.json",
20
+ "build:esm": "tsc --build tsconfig.compile.esm.json",
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"
16
24
  },
17
25
  "dependencies": {
18
- "fs-extra": "9.0.1",
19
- "micromatch": "^4.0.2",
20
- "swagger-ui-dist": "^3.46.0",
21
- "tslib": "2.2.0"
26
+ "@tsed/openspec": "7.0.0-beta.11",
27
+ "fs-extra": "10.0.1",
28
+ "micromatch": "4.0.5",
29
+ "swagger-ui-dist": "^4.5.2",
30
+ "tslib": "2.3.1"
22
31
  },
23
32
  "devDependencies": {
24
- "@tsed/common": "7.0.0-alpha.2",
25
- "@tsed/core": "7.0.0-alpha.2",
26
- "@tsed/di": "7.0.0-alpha.2",
27
- "@tsed/json-mapper": "7.0.0-alpha.2",
28
- "@tsed/openspec": "7.0.0-alpha.2",
29
- "@tsed/schema": "7.0.0-alpha.2"
33
+ "@tsed/common": "7.0.0-beta.11",
34
+ "@tsed/core": "7.0.0-beta.11",
35
+ "@tsed/di": "7.0.0-beta.11",
36
+ "@tsed/json-mapper": "7.0.0-beta.11",
37
+ "@tsed/openspec": "7.0.0-beta.11",
38
+ "@tsed/schema": "7.0.0-beta.11",
39
+ "@types/swagger-ui-dist": ">=3.30.1"
30
40
  },
31
41
  "peerDependencies": {
32
- "@tsed/common": "^7.0.0-alpha.2",
33
- "@tsed/core": "^7.0.0-alpha.2",
34
- "@tsed/di": "^7.0.0-alpha.2",
35
- "@tsed/json-mapper": "^7.0.0-alpha.2",
36
- "@tsed/openspec": "^7.0.0-alpha.2",
37
- "@tsed/schema": "^7.0.0-alpha.2"
42
+ "@tsed/common": "^7.0.0-beta.11"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "@tsed/common": {
46
+ "optional": false
47
+ }
38
48
  },
39
49
  "repository": "https://github.com/tsedio/tsed",
40
50
  "bugs": {
41
51
  "url": "https://github.com/tsedio/tsed/issues"
42
52
  },
43
- "homepage": "https://github.com/tsedio/tsed/tree/alpha/packages/specs/swagger",
53
+ "homepage": "https://github.com/tsedio/tsed/tree/beta/packages/specs/swagger",
44
54
  "author": "Romain Lenzotti",
45
- "license": "MIT",
46
- "publishConfig": {
47
- "tag": "alpha"
48
- }
55
+ "license": "MIT"
49
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)]
@@ -0,0 +1,24 @@
1
+ {
2
+ "extends": "./tsconfig.compile.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "module": "ES2020",
6
+ "rootDir": "src",
7
+ "outDir": "./lib/esm",
8
+ "declaration": true,
9
+ "declarationDir": "./lib/types"
10
+ },
11
+ "exclude": [
12
+ "node_modules",
13
+ "test",
14
+ "lib",
15
+ "benchmark",
16
+ "coverage",
17
+ "spec",
18
+ "views",
19
+ "**/*.benchmark.ts",
20
+ "**/*.spec.ts",
21
+ "keys",
22
+ "jest.config.js"
23
+ ]
24
+ }
package/lib/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from "./services/SwaggerService";
2
- export * from "./SwaggerModule";
3
- export * from "./interfaces";
4
- export * from "./decorators/docs";
5
- export * from "./decorators/hidden";