@tsed/swagger 6.95.9 → 6.96.2
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/package.json +13 -13
- package/lib/cjs/SwaggerModule.d.ts +0 -30
- package/lib/cjs/decorators/docs.d.ts +0 -10
- package/lib/cjs/decorators/hidden.d.ts +0 -32
- package/lib/cjs/index.d.ts +0 -5
- package/lib/cjs/interfaces/SwaggerSettings.d.ts +0 -99
- package/lib/cjs/interfaces/index.d.ts +0 -9
- package/lib/cjs/middlewares/cssMiddleware.d.ts +0 -6
- package/lib/cjs/middlewares/indexMiddleware.d.ts +0 -10
- package/lib/cjs/middlewares/jsMiddleware.d.ts +0 -6
- package/lib/cjs/middlewares/redirectMiddleware.d.ts +0 -6
- package/lib/cjs/services/SwaggerService.d.ts +0 -29
- package/lib/cjs/utils/getSpecType.d.ts +0 -12
- package/lib/cjs/utils/includeRoute.d.ts +0 -3
- package/lib/cjs/utils/index.d.ts +0 -7
- package/lib/cjs/utils/mapOpenSpec.d.ts +0 -10
- package/lib/cjs/utils/mapOpenSpec2.d.ts +0 -9
- package/lib/cjs/utils/mapOpenSpec3.d.ts +0 -8
- package/lib/cjs/utils/mapOpenSpecInfo.d.ts +0 -6
- package/lib/cjs/utils/matchPath.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/swagger",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.96.2",
|
|
4
4
|
"description": "Swagger package for Ts.ED framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -25,20 +25,20 @@
|
|
|
25
25
|
"tslib": "2.2.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@tsed/common": "6.
|
|
29
|
-
"@tsed/core": "6.
|
|
30
|
-
"@tsed/di": "6.
|
|
31
|
-
"@tsed/json-mapper": "6.
|
|
32
|
-
"@tsed/openspec": "6.
|
|
33
|
-
"@tsed/schema": "6.
|
|
28
|
+
"@tsed/common": "6.96.2",
|
|
29
|
+
"@tsed/core": "6.96.2",
|
|
30
|
+
"@tsed/di": "6.96.2",
|
|
31
|
+
"@tsed/json-mapper": "6.96.2",
|
|
32
|
+
"@tsed/openspec": "6.96.2",
|
|
33
|
+
"@tsed/schema": "6.96.2"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@tsed/common": "^6.
|
|
37
|
-
"@tsed/core": "^6.
|
|
38
|
-
"@tsed/di": "^6.
|
|
39
|
-
"@tsed/json-mapper": "^6.
|
|
40
|
-
"@tsed/openspec": "^6.
|
|
41
|
-
"@tsed/schema": "^6.
|
|
36
|
+
"@tsed/common": "^6.96.2",
|
|
37
|
+
"@tsed/core": "^6.96.2",
|
|
38
|
+
"@tsed/di": "^6.96.2",
|
|
39
|
+
"@tsed/json-mapper": "^6.96.2",
|
|
40
|
+
"@tsed/openspec": "^6.96.2",
|
|
41
|
+
"@tsed/schema": "^6.96.2"
|
|
42
42
|
},
|
|
43
43
|
"repository": "https://github.com/tsedio/tsed",
|
|
44
44
|
"bugs": {
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { OnRoutesInit, Configuration, InjectorService, OnReady, PlatformApplication } from "@tsed/common";
|
|
2
|
-
import { SwaggerSettings } from "./interfaces";
|
|
3
|
-
import { SwaggerService } from "./services/SwaggerService";
|
|
4
|
-
import { Env } from "@tsed/core";
|
|
5
|
-
/**
|
|
6
|
-
* @ignore
|
|
7
|
-
*/
|
|
8
|
-
export declare class SwaggerModule implements OnRoutesInit, OnReady {
|
|
9
|
-
injector: InjectorService;
|
|
10
|
-
app: PlatformApplication;
|
|
11
|
-
configuration: Configuration;
|
|
12
|
-
swaggerService: SwaggerService;
|
|
13
|
-
env: Env;
|
|
14
|
-
private loaded;
|
|
15
|
-
get settings(): SwaggerSettings[];
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
$onRoutesInit(): void;
|
|
20
|
-
$onReady(): void;
|
|
21
|
-
generateSpecFiles(): Promise<void[]>;
|
|
22
|
-
private getUrls;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* @param conf
|
|
26
|
-
* @param urls
|
|
27
|
-
*/
|
|
28
|
-
private createRouter;
|
|
29
|
-
private middlewareSwaggerJson;
|
|
30
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Disable documentation for the class and his endpoint.
|
|
3
|
-
*
|
|
4
|
-
* ````typescript
|
|
5
|
-
* @Controller('/')
|
|
6
|
-
* export class Ctrl {
|
|
7
|
-
*
|
|
8
|
-
* @Get('/')
|
|
9
|
-
* @Hidden()
|
|
10
|
-
* hiddenRoute(){
|
|
11
|
-
*
|
|
12
|
-
* }
|
|
13
|
-
* }
|
|
14
|
-
*
|
|
15
|
-
* @Controller('/')
|
|
16
|
-
* @Hidden()
|
|
17
|
-
* export class Ctrl {
|
|
18
|
-
* @Get('/')
|
|
19
|
-
* hiddenRoute() {
|
|
20
|
-
*
|
|
21
|
-
* }
|
|
22
|
-
* @Get('/2')
|
|
23
|
-
* hiddenRoute2() {
|
|
24
|
-
*
|
|
25
|
-
* }
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @decorator
|
|
30
|
-
* @swagger
|
|
31
|
-
*/
|
|
32
|
-
export declare function Hidden(): Function;
|
package/lib/cjs/index.d.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { OpenSpec2, OpenSpec3, OpenSpecVersions, OS2Versions, OS3Versions } from "@tsed/openspec";
|
|
2
|
-
export interface SwaggerUIOptions {
|
|
3
|
-
configUrl?: string;
|
|
4
|
-
url?: string;
|
|
5
|
-
urls?: {
|
|
6
|
-
url: string;
|
|
7
|
-
name: string;
|
|
8
|
-
primaryName?: string;
|
|
9
|
-
}[];
|
|
10
|
-
layout?: string;
|
|
11
|
-
validatorUrl?: string;
|
|
12
|
-
oauth?: any;
|
|
13
|
-
authorize?: any;
|
|
14
|
-
[key: string]: any;
|
|
15
|
-
}
|
|
16
|
-
export interface SwaggerSettingsBase {
|
|
17
|
-
/**
|
|
18
|
-
* The url subpath to access to the documentation.
|
|
19
|
-
*/
|
|
20
|
-
path: string;
|
|
21
|
-
/**
|
|
22
|
-
* Specify the spec version you want to generate.
|
|
23
|
-
*/
|
|
24
|
-
specVersion?: OpenSpecVersions;
|
|
25
|
-
/**
|
|
26
|
-
* Swagger file name. By default swagger.json
|
|
27
|
-
*/
|
|
28
|
-
fileName?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Hidden documentation. Use this to hide documentation link in the dropdown.
|
|
31
|
-
*/
|
|
32
|
-
hidden?: string;
|
|
33
|
-
/**
|
|
34
|
-
* The documentation key used by `@Docs` decorator to create several swagger documentations.
|
|
35
|
-
*/
|
|
36
|
-
doc?: string;
|
|
37
|
-
/**
|
|
38
|
-
* The path to the CSS file.
|
|
39
|
-
*/
|
|
40
|
-
cssPath?: string;
|
|
41
|
-
/**
|
|
42
|
-
* The path to the JS file.
|
|
43
|
-
*/
|
|
44
|
-
jsPath?: string;
|
|
45
|
-
/**
|
|
46
|
-
* The path to the ejs file to create html page.
|
|
47
|
-
*/
|
|
48
|
-
viewPath?: string | false;
|
|
49
|
-
/**
|
|
50
|
-
* SwaggerUI options. See (https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/usage/configuration.md)
|
|
51
|
-
*/
|
|
52
|
-
options?: SwaggerUIOptions;
|
|
53
|
-
/**
|
|
54
|
-
* Display the search field in the navbar.
|
|
55
|
-
*/
|
|
56
|
-
showExplorer?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Load the base spec documentation from the specified path.
|
|
59
|
-
*/
|
|
60
|
-
specPath?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Write the `swagger.json` spec documentation on the specified path.
|
|
63
|
-
*/
|
|
64
|
-
outFile?: string;
|
|
65
|
-
/**
|
|
66
|
-
* A function to generate the operationId.
|
|
67
|
-
*/
|
|
68
|
-
operationIdFormatter?: (name: string, propertyKey: string, path: string) => string;
|
|
69
|
-
/**
|
|
70
|
-
* A pattern to generate the operationId. Format of operationId field (%c: class name, %m: method name).
|
|
71
|
-
*/
|
|
72
|
-
operationIdPattern?: string;
|
|
73
|
-
/**
|
|
74
|
-
*
|
|
75
|
-
*/
|
|
76
|
-
disableSpec?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Include only controllers whose paths match the pattern list provided.
|
|
79
|
-
*/
|
|
80
|
-
pathPatterns?: string[];
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* @deprecated Since 2021-09-03. Will be removed in v7.
|
|
84
|
-
*/
|
|
85
|
-
export interface SwaggerOS2Settings extends SwaggerSettingsBase {
|
|
86
|
-
specVersion?: OS2Versions;
|
|
87
|
-
/**
|
|
88
|
-
* OpenSpec 2
|
|
89
|
-
*/
|
|
90
|
-
spec?: Partial<OpenSpec2>;
|
|
91
|
-
}
|
|
92
|
-
export interface SwaggerOS3Settings extends SwaggerSettingsBase {
|
|
93
|
-
specVersion?: OS3Versions;
|
|
94
|
-
/**
|
|
95
|
-
* OpenSpec 3
|
|
96
|
-
*/
|
|
97
|
-
spec?: Partial<OpenSpec3>;
|
|
98
|
-
}
|
|
99
|
-
export declare type SwaggerSettings = SwaggerOS2Settings | SwaggerOS3Settings;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PlatformContext } from "@tsed/common";
|
|
2
|
-
import { SwaggerSettings } from "../interfaces/SwaggerSettings";
|
|
3
|
-
/**
|
|
4
|
-
* @ignore
|
|
5
|
-
* @param viewPath
|
|
6
|
-
* @param conf
|
|
7
|
-
*/
|
|
8
|
-
export declare function indexMiddleware(viewPath: string, conf: SwaggerSettings & {
|
|
9
|
-
urls: string[];
|
|
10
|
-
}): (ctx: PlatformContext) => Promise<void>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Configuration, ControllerProvider, InjectorService, Platform } from "@tsed/common";
|
|
2
|
-
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
3
|
-
import { SpecSerializerOptions } from "@tsed/schema";
|
|
4
|
-
import { SwaggerOS2Settings, SwaggerOS3Settings, SwaggerSettings } from "../interfaces/SwaggerSettings";
|
|
5
|
-
export declare class SwaggerService {
|
|
6
|
-
#private;
|
|
7
|
-
private injectorService;
|
|
8
|
-
private platform;
|
|
9
|
-
private configuration;
|
|
10
|
-
constructor(injectorService: InjectorService, platform: Platform, configuration: Configuration);
|
|
11
|
-
/**
|
|
12
|
-
* Generate Spec for the given configuration
|
|
13
|
-
* @returns {Spec}
|
|
14
|
-
*/
|
|
15
|
-
getOpenAPISpec(conf: SwaggerOS3Settings): OpenSpec3;
|
|
16
|
-
getOpenAPISpec(conf: SwaggerOS2Settings): OpenSpec2;
|
|
17
|
-
getOpenAPISpec(conf: SwaggerSettings): OpenSpec2;
|
|
18
|
-
/**
|
|
19
|
-
* Return the global api information.
|
|
20
|
-
*/
|
|
21
|
-
protected getDefaultSpec(conf: Partial<SwaggerSettings>): Partial<OpenSpec2 | OpenSpec3>;
|
|
22
|
-
protected readSpecPath(path: string): any;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* @param ctrl
|
|
26
|
-
* @param options
|
|
27
|
-
*/
|
|
28
|
-
protected buildRoutes(ctrl: ControllerProvider, options: SpecSerializerOptions): Partial<OpenSpec2>;
|
|
29
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
2
|
-
import { SpecTypes } from "@tsed/schema";
|
|
3
|
-
/**
|
|
4
|
-
* @ignore
|
|
5
|
-
* @param version
|
|
6
|
-
*/
|
|
7
|
-
export declare function getSpecType(version: string): SpecTypes.SWAGGER | SpecTypes.OPENAPI;
|
|
8
|
-
/**
|
|
9
|
-
* @ignore
|
|
10
|
-
* @param spec
|
|
11
|
-
*/
|
|
12
|
-
export declare function getSpecTypeFromSpec(spec: Partial<OpenSpec2 | OpenSpec3>): SpecTypes.SWAGGER | SpecTypes.OPENAPI;
|
package/lib/cjs/utils/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
2
|
-
/**
|
|
3
|
-
* @ignore
|
|
4
|
-
* @param spec
|
|
5
|
-
* @param fileSpec
|
|
6
|
-
* @param version
|
|
7
|
-
* @param acceptMimes
|
|
8
|
-
* @param specVersion
|
|
9
|
-
*/
|
|
10
|
-
export declare function mapOpenSpec(spec: any, { fileSpec, acceptMimes, specVersion, version }: any): Partial<OpenSpec2 | OpenSpec3>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { OpenSpec2 } from "@tsed/openspec";
|
|
2
|
-
/**
|
|
3
|
-
* @ignore
|
|
4
|
-
* @param spec
|
|
5
|
-
* @param version
|
|
6
|
-
* @param specVersion
|
|
7
|
-
* @param acceptMimes
|
|
8
|
-
*/
|
|
9
|
-
export declare function mapOpenSpec2(spec: Partial<OpenSpec2>, { version, specVersion, acceptMimes }: any): Partial<OpenSpec2>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function matchPath(path: string, patterns?: string[]): boolean;
|