@nestia/core 2.5.9 → 2.5.10
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/README.md
CHANGED
|
@@ -66,7 +66,7 @@ Check out the document in the [website](https://nestia.io/docs/):
|
|
|
66
66
|
- [TypedException](https://nestia.io/docs/core/TypedException/)
|
|
67
67
|
- Generators
|
|
68
68
|
- [Swagger Documents](https://nestia.io/docs/sdk/swagger/)
|
|
69
|
-
- [
|
|
69
|
+
- [Software Development Kit](https://nestia.io/docs/sdk/sdk/)
|
|
70
70
|
- [E2E Functions](https://nestia.io/docs/sdk/e2e/)
|
|
71
71
|
- [Mockup Simulator](https://nestia.io/docs/sdk/simulator/)
|
|
72
72
|
- [Swagger to NestJS](https://nestia.io/docs/migrate/)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestia/core",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.10",
|
|
4
4
|
"description": "Super-fast validation decorators of NestJS",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://nestia.io",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@nestia/fetcher": "^2.5.
|
|
39
|
+
"@nestia/fetcher": "^2.5.10",
|
|
40
40
|
"@nestjs/common": ">=7.0.1",
|
|
41
41
|
"@nestjs/core": ">=7.0.1",
|
|
42
42
|
"detect-ts-node": "^1.0.5",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"raw-body": "^2.0.0",
|
|
46
46
|
"reflect-metadata": ">=0.1.12",
|
|
47
47
|
"rxjs": ">=6.0.0",
|
|
48
|
-
"typia": "^5.4.
|
|
48
|
+
"typia": "^5.4.12"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@nestia/fetcher": ">=2.5.
|
|
51
|
+
"@nestia/fetcher": ">=2.5.10",
|
|
52
52
|
"@nestjs/common": ">=7.0.1",
|
|
53
53
|
"@nestjs/core": ">=7.0.1",
|
|
54
54
|
"reflect-metadata": ">=0.1.12",
|
|
55
55
|
"rxjs": ">=6.0.0",
|
|
56
|
-
"typia": ">=5.4.
|
|
56
|
+
"typia": ">=5.4.12 <6.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@fastify/multipart": "^8.1.0",
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { IJsonComponents } from "typia";
|
|
2
|
-
|
|
3
|
-
import { ISwaggerSecurityScheme } from "./ISwaggerSecurityScheme";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Reusable components in Swagger.
|
|
7
|
-
*
|
|
8
|
-
* `ISwaggerComponents` is a data structure representing content of `components` object
|
|
9
|
-
* in `swagger.json` file generated by Nestia. Note that, this is not an universal
|
|
10
|
-
* structure, but a dedicated structure only for Nestia.
|
|
11
|
-
*
|
|
12
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
13
|
-
*/
|
|
14
|
-
export interface ISwaggerComponents {
|
|
15
|
-
/**
|
|
16
|
-
* An object to hold reusable DTO schemas.
|
|
17
|
-
*
|
|
18
|
-
* For reference, `nestia` stores every object and alias types as reusable DTO
|
|
19
|
-
* schemas. The alias type means that defined by `type` keyword in TypeScript.
|
|
20
|
-
*/
|
|
21
|
-
schemas?: Record<string, IJsonComponents.IAlias>;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* An object to hold reusable security schemes.
|
|
25
|
-
*
|
|
26
|
-
* This property be configured by user in `nestia.config.ts` file.
|
|
27
|
-
*/
|
|
28
|
-
securitySchemes?: Record<string, ISwaggerSecurityScheme>;
|
|
29
|
-
}
|
|
1
|
+
import { IJsonComponents } from "typia";
|
|
2
|
+
|
|
3
|
+
import { ISwaggerSecurityScheme } from "./ISwaggerSecurityScheme";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Reusable components in Swagger.
|
|
7
|
+
*
|
|
8
|
+
* `ISwaggerComponents` is a data structure representing content of `components` object
|
|
9
|
+
* in `swagger.json` file generated by Nestia. Note that, this is not an universal
|
|
10
|
+
* structure, but a dedicated structure only for Nestia.
|
|
11
|
+
*
|
|
12
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
13
|
+
*/
|
|
14
|
+
export interface ISwaggerComponents {
|
|
15
|
+
/**
|
|
16
|
+
* An object to hold reusable DTO schemas.
|
|
17
|
+
*
|
|
18
|
+
* For reference, `nestia` stores every object and alias types as reusable DTO
|
|
19
|
+
* schemas. The alias type means that defined by `type` keyword in TypeScript.
|
|
20
|
+
*/
|
|
21
|
+
schemas?: Record<string, IJsonComponents.IAlias>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An object to hold reusable security schemes.
|
|
25
|
+
*
|
|
26
|
+
* This property be configured by user in `nestia.config.ts` file.
|
|
27
|
+
*/
|
|
28
|
+
securitySchemes?: Record<string, ISwaggerSecurityScheme>;
|
|
29
|
+
}
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Information about the API.
|
|
3
|
-
*
|
|
4
|
-
* @author Samchon
|
|
5
|
-
*/
|
|
6
|
-
export interface ISwaggerInfo {
|
|
7
|
-
/**
|
|
8
|
-
* The title of the API.
|
|
9
|
-
*/
|
|
10
|
-
title: string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A short description of the API.
|
|
14
|
-
*/
|
|
15
|
-
description?: string;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* A URL to the Terms of Service for the API.
|
|
19
|
-
*
|
|
20
|
-
* @format uri
|
|
21
|
-
*/
|
|
22
|
-
termsOfService?: string;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* The contact information for the exposed API.
|
|
26
|
-
*/
|
|
27
|
-
contact?: ISwaggerInfo.IContact;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The license information for the exposed API.
|
|
31
|
-
*/
|
|
32
|
-
license?: ISwaggerInfo.ILicense;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Version of the API.
|
|
36
|
-
*/
|
|
37
|
-
version: string;
|
|
38
|
-
}
|
|
39
|
-
export namespace ISwaggerInfo {
|
|
40
|
-
/**
|
|
41
|
-
* Contact information for the exposed API.
|
|
42
|
-
*/
|
|
43
|
-
export interface IContact {
|
|
44
|
-
/**
|
|
45
|
-
* The identifying name of the contact person/organization.
|
|
46
|
-
*/
|
|
47
|
-
name?: string;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* The URL pointing to the contact information.
|
|
51
|
-
*
|
|
52
|
-
* @format uri
|
|
53
|
-
*/
|
|
54
|
-
url?: string;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* The email address of the contact person/organization.
|
|
58
|
-
*
|
|
59
|
-
* @format email
|
|
60
|
-
*/
|
|
61
|
-
email?: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* License information for the exposed API.
|
|
66
|
-
*/
|
|
67
|
-
export interface ILicense {
|
|
68
|
-
/**
|
|
69
|
-
* The license name used for the API.
|
|
70
|
-
*/
|
|
71
|
-
name: string;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* A URL to the license used for the API.
|
|
75
|
-
*
|
|
76
|
-
* @format uri
|
|
77
|
-
*/
|
|
78
|
-
url?: string;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Information about the API.
|
|
3
|
+
*
|
|
4
|
+
* @author Samchon
|
|
5
|
+
*/
|
|
6
|
+
export interface ISwaggerInfo {
|
|
7
|
+
/**
|
|
8
|
+
* The title of the API.
|
|
9
|
+
*/
|
|
10
|
+
title: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A short description of the API.
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A URL to the Terms of Service for the API.
|
|
19
|
+
*
|
|
20
|
+
* @format uri
|
|
21
|
+
*/
|
|
22
|
+
termsOfService?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The contact information for the exposed API.
|
|
26
|
+
*/
|
|
27
|
+
contact?: ISwaggerInfo.IContact;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The license information for the exposed API.
|
|
31
|
+
*/
|
|
32
|
+
license?: ISwaggerInfo.ILicense;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Version of the API.
|
|
36
|
+
*/
|
|
37
|
+
version: string;
|
|
38
|
+
}
|
|
39
|
+
export namespace ISwaggerInfo {
|
|
40
|
+
/**
|
|
41
|
+
* Contact information for the exposed API.
|
|
42
|
+
*/
|
|
43
|
+
export interface IContact {
|
|
44
|
+
/**
|
|
45
|
+
* The identifying name of the contact person/organization.
|
|
46
|
+
*/
|
|
47
|
+
name?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The URL pointing to the contact information.
|
|
51
|
+
*
|
|
52
|
+
* @format uri
|
|
53
|
+
*/
|
|
54
|
+
url?: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The email address of the contact person/organization.
|
|
58
|
+
*
|
|
59
|
+
* @format email
|
|
60
|
+
*/
|
|
61
|
+
email?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* License information for the exposed API.
|
|
66
|
+
*/
|
|
67
|
+
export interface ILicense {
|
|
68
|
+
/**
|
|
69
|
+
* The license name used for the API.
|
|
70
|
+
*/
|
|
71
|
+
name: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* A URL to the license used for the API.
|
|
75
|
+
*
|
|
76
|
+
* @format uri
|
|
77
|
+
*/
|
|
78
|
+
url?: string;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Security scheme of Swagger Documents.
|
|
3
|
-
*
|
|
4
|
-
* `ISwaggerSecurityScheme` is a data structure representing content of
|
|
5
|
-
* `securitySchemes` in `swagger.json` file. It is composed with 5 types of security
|
|
6
|
-
* schemes as an union type like below.
|
|
7
|
-
*
|
|
8
|
-
* @reference https://swagger.io/specification/#security-scheme-object
|
|
9
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
10
|
-
*/
|
|
11
|
-
export type ISwaggerSecurityScheme =
|
|
12
|
-
| ISwaggerSecurityScheme.IHttpBasic
|
|
13
|
-
| ISwaggerSecurityScheme.IHttpBearer
|
|
14
|
-
| ISwaggerSecurityScheme.IApiKey
|
|
15
|
-
| ISwaggerSecurityScheme.IOpenId
|
|
16
|
-
| ISwaggerSecurityScheme.IOAuth2;
|
|
17
|
-
export namespace ISwaggerSecurityScheme {
|
|
18
|
-
export interface IHttpBasic {
|
|
19
|
-
type: "http";
|
|
20
|
-
scheme: "basic";
|
|
21
|
-
}
|
|
22
|
-
export interface IHttpBearer {
|
|
23
|
-
type: "http";
|
|
24
|
-
scheme: "bearer";
|
|
25
|
-
bearerFormat?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface IApiKey {
|
|
28
|
-
type: "apiKey";
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @default header
|
|
32
|
-
*/
|
|
33
|
-
in?: "header" | "query" | "cookie";
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @default Authorization
|
|
37
|
-
*/
|
|
38
|
-
name?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface IOpenId {
|
|
42
|
-
type: "openIdConnect";
|
|
43
|
-
openIdConnectUrl: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface IOAuth2 {
|
|
47
|
-
type: "oauth2";
|
|
48
|
-
flows: IOAuth2.IFlowSet;
|
|
49
|
-
description?: string;
|
|
50
|
-
}
|
|
51
|
-
export namespace IOAuth2 {
|
|
52
|
-
export interface IFlowSet {
|
|
53
|
-
authorizationCode?: IFlow;
|
|
54
|
-
implicit?: Omit<IFlow, "tokenUrl">;
|
|
55
|
-
password?: Omit<IFlow, "authorizationUrl">;
|
|
56
|
-
clientCredentials?: Omit<IFlow, "authorizationUrl">;
|
|
57
|
-
}
|
|
58
|
-
export interface IFlow {
|
|
59
|
-
authorizationUrl: string;
|
|
60
|
-
tokenUrl: string;
|
|
61
|
-
refreshUrl: string;
|
|
62
|
-
scopes?: Record<string, string>;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Security scheme of Swagger Documents.
|
|
3
|
+
*
|
|
4
|
+
* `ISwaggerSecurityScheme` is a data structure representing content of
|
|
5
|
+
* `securitySchemes` in `swagger.json` file. It is composed with 5 types of security
|
|
6
|
+
* schemes as an union type like below.
|
|
7
|
+
*
|
|
8
|
+
* @reference https://swagger.io/specification/#security-scheme-object
|
|
9
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
10
|
+
*/
|
|
11
|
+
export type ISwaggerSecurityScheme =
|
|
12
|
+
| ISwaggerSecurityScheme.IHttpBasic
|
|
13
|
+
| ISwaggerSecurityScheme.IHttpBearer
|
|
14
|
+
| ISwaggerSecurityScheme.IApiKey
|
|
15
|
+
| ISwaggerSecurityScheme.IOpenId
|
|
16
|
+
| ISwaggerSecurityScheme.IOAuth2;
|
|
17
|
+
export namespace ISwaggerSecurityScheme {
|
|
18
|
+
export interface IHttpBasic {
|
|
19
|
+
type: "http";
|
|
20
|
+
scheme: "basic";
|
|
21
|
+
}
|
|
22
|
+
export interface IHttpBearer {
|
|
23
|
+
type: "http";
|
|
24
|
+
scheme: "bearer";
|
|
25
|
+
bearerFormat?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface IApiKey {
|
|
28
|
+
type: "apiKey";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @default header
|
|
32
|
+
*/
|
|
33
|
+
in?: "header" | "query" | "cookie";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @default Authorization
|
|
37
|
+
*/
|
|
38
|
+
name?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface IOpenId {
|
|
42
|
+
type: "openIdConnect";
|
|
43
|
+
openIdConnectUrl: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface IOAuth2 {
|
|
47
|
+
type: "oauth2";
|
|
48
|
+
flows: IOAuth2.IFlowSet;
|
|
49
|
+
description?: string;
|
|
50
|
+
}
|
|
51
|
+
export namespace IOAuth2 {
|
|
52
|
+
export interface IFlowSet {
|
|
53
|
+
authorizationCode?: IFlow;
|
|
54
|
+
implicit?: Omit<IFlow, "tokenUrl">;
|
|
55
|
+
password?: Omit<IFlow, "authorizationUrl">;
|
|
56
|
+
clientCredentials?: Omit<IFlow, "authorizationUrl">;
|
|
57
|
+
}
|
|
58
|
+
export interface IFlow {
|
|
59
|
+
authorizationUrl: string;
|
|
60
|
+
tokenUrl: string;
|
|
61
|
+
refreshUrl: string;
|
|
62
|
+
scopes?: Record<string, string>;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|