@nestia/core 1.3.5 → 1.3.7
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 +9 -4
- package/lib/decorators/DynamicModule.d.ts +26 -26
- package/lib/decorators/DynamicModule.js +103 -103
- package/lib/decorators/DynamicModule.js.map +1 -1
- package/lib/decorators/EncryptedBody.d.ts +23 -23
- package/lib/decorators/EncryptedBody.js +128 -128
- package/lib/decorators/EncryptedController.d.ts +26 -26
- package/lib/decorators/EncryptedController.js +36 -36
- package/lib/decorators/EncryptedModule.d.ts +52 -52
- package/lib/decorators/EncryptedModule.js +161 -161
- package/lib/decorators/EncryptedModule.js.map +1 -1
- package/lib/decorators/EncryptedRoute.d.ts +78 -78
- package/lib/decorators/EncryptedRoute.js +209 -209
- package/lib/decorators/EncryptedRoute.js.map +1 -1
- package/lib/decorators/PlainBody.d.ts +22 -22
- package/lib/decorators/PlainBody.js +82 -82
- package/lib/decorators/TypedBody.d.ts +16 -16
- package/lib/decorators/TypedBody.js +45 -45
- package/lib/decorators/TypedParam.d.ts +31 -31
- package/lib/decorators/TypedParam.js +76 -76
- package/lib/decorators/TypedQuery.d.ts +14 -14
- package/lib/decorators/TypedQuery.js +109 -109
- package/lib/decorators/TypedQuery.js.map +1 -1
- package/lib/decorators/TypedRoute.d.ts +72 -72
- package/lib/decorators/TypedRoute.js +185 -185
- package/lib/decorators/TypedRoute.js.map +1 -1
- package/lib/decorators/internal/EncryptedConstant.d.ts +1 -1
- package/lib/decorators/internal/EncryptedConstant.js +7 -7
- package/lib/decorators/internal/TransformError.d.ts +1 -1
- package/lib/decorators/internal/TransformError.js +10 -10
- package/lib/decorators/internal/get_path_and_stringify.d.ts +1 -1
- package/lib/decorators/internal/get_path_and_stringify.js +83 -83
- package/lib/decorators/internal/get_text_body.d.ts +3 -3
- package/lib/decorators/internal/get_text_body.js +62 -62
- package/lib/decorators/internal/headers_to_object.d.ts +3 -3
- package/lib/decorators/internal/headers_to_object.js +49 -49
- package/lib/decorators/internal/load_controller.d.ts +5 -5
- package/lib/decorators/internal/load_controller.js +151 -152
- package/lib/decorators/internal/load_controller.js.map +1 -1
- package/lib/decorators/internal/route_error.d.ts +3 -3
- package/lib/decorators/internal/route_error.js +88 -88
- package/lib/decorators/internal/validate_request_body.d.ts +3 -3
- package/lib/decorators/internal/validate_request_body.js +66 -66
- package/lib/index.d.ts +3 -3
- package/lib/index.js +31 -31
- package/lib/module.d.ts +12 -12
- package/lib/module.js +28 -28
- package/lib/options/INestiaTransformOptions.d.ts +4 -4
- package/lib/options/INestiaTransformOptions.js +2 -2
- package/lib/options/INestiaTransformProject.d.ts +5 -5
- package/lib/options/INestiaTransformProject.js +2 -2
- package/lib/options/IRequestBodyValidator.d.ts +16 -16
- package/lib/options/IRequestBodyValidator.js +2 -2
- package/lib/options/IResponseBodyStringifier.d.ts +20 -20
- package/lib/options/IResponseBodyStringifier.js +2 -2
- package/lib/programmers/TypedBodyProgrammer.d.ts +5 -5
- package/lib/programmers/TypedBodyProgrammer.js +58 -58
- package/lib/programmers/TypedBodyProgrammer.js.map +1 -1
- package/lib/programmers/TypedParamProgrammer.d.ts +5 -5
- package/lib/programmers/TypedParamProgrammer.js +110 -110
- package/lib/programmers/TypedParamProgrammer.js.map +1 -1
- package/lib/programmers/TypedQueryProgrammer.d.ts +5 -5
- package/lib/programmers/TypedQueryProgrammer.js +264 -264
- package/lib/programmers/TypedQueryProgrammer.js.map +1 -1
- package/lib/programmers/TypedRouteProgrammer.d.ts +5 -5
- package/lib/programmers/TypedRouteProgrammer.js +49 -49
- package/lib/programmers/TypedRouteProgrammer.js.map +1 -1
- package/lib/transform.d.ts +4 -4
- package/lib/transform.js +25 -25
- package/lib/transformers/FileTransformer.d.ts +5 -5
- package/lib/transformers/FileTransformer.js +40 -40
- package/lib/transformers/FileTransformer.js.map +1 -1
- package/lib/transformers/MethodDecoratorTransformer.d.ts +5 -5
- package/lib/transformers/MethodDecoratorTransformer.js +92 -92
- package/lib/transformers/MethodDecoratorTransformer.js.map +1 -1
- package/lib/transformers/MethodTransformer.d.ts +5 -5
- package/lib/transformers/MethodTransformer.js +62 -62
- package/lib/transformers/MethodTransformer.js.map +1 -1
- package/lib/transformers/NodeTransformer.d.ts +5 -5
- package/lib/transformers/NodeTransformer.js +21 -21
- package/lib/transformers/NodeTransformer.js.map +1 -1
- package/lib/transformers/ParameterDecoratorTransformer.d.ts +5 -5
- package/lib/transformers/ParameterDecoratorTransformer.js +68 -68
- package/lib/transformers/ParameterDecoratorTransformer.js.map +1 -1
- package/lib/transformers/ParameterTransformer.d.ts +5 -5
- package/lib/transformers/ParameterTransformer.js +34 -34
- package/lib/transformers/ParameterTransformer.js.map +1 -1
- package/lib/typings/Creator.d.ts +3 -3
- package/lib/typings/Creator.js +2 -2
- package/lib/utils/ExceptionManager.d.ts +64 -64
- package/lib/utils/ExceptionManager.js +112 -112
- package/lib/utils/ExceptionManager.js.map +1 -1
- package/lib/utils/Singleton.d.ts +1 -1
- package/lib/utils/Singleton.js +23 -23
- package/lib/utils/SourceFinder.d.ts +9 -9
- package/lib/utils/SourceFinder.js +238 -238
- package/lib/utils/SourceFinder.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.TypedQuery = void 0;
|
|
27
|
-
var common_1 = require("@nestjs/common");
|
|
28
|
-
var typia_1 = __importStar(require("typia"));
|
|
29
|
-
var TransformError_1 = require("./internal/TransformError");
|
|
30
|
-
/**
|
|
31
|
-
* Type safe URL query decorator.
|
|
32
|
-
*
|
|
33
|
-
* `TypedQuery` is a decorator function that can parse URL query string. It is almost
|
|
34
|
-
* same with {@link nest.Query}, but it can automatically cast property type following
|
|
35
|
-
* its DTO definition. Also, `TypedQuery` performs type validation.
|
|
36
|
-
*
|
|
37
|
-
* For referecen, when URL query parameters are different with their promised
|
|
38
|
-
* type `T`, `BadRequestException` error (status code: 400) would be thrown.
|
|
39
|
-
*
|
|
40
|
-
* @returns Parameter decorator
|
|
41
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
42
|
-
*/
|
|
43
|
-
function TypedQuery(decoder) {
|
|
44
|
-
if (decoder === undefined)
|
|
45
|
-
throw (0, TransformError_1.TransformError)("TypedQuery");
|
|
46
|
-
return (0, common_1.createParamDecorator)(function TypedQuery(_unknown, context) {
|
|
47
|
-
var request = context
|
|
48
|
-
.switchToHttp()
|
|
49
|
-
.getRequest();
|
|
50
|
-
var params = new URLSearchParams(tail(request.url));
|
|
51
|
-
try {
|
|
52
|
-
return decoder(params);
|
|
53
|
-
}
|
|
54
|
-
catch (exp) {
|
|
55
|
-
if ((function (input) {
|
|
56
|
-
var $io0 = function (input) { return "string" === typeof input.method && (undefined === input.path || "string" === typeof input.path) && "string" === typeof input.expected && true && "string" === typeof input.name && "string" === typeof input.message && (undefined === input.stack || "string" === typeof input.stack); };
|
|
57
|
-
return "object" === typeof input && null !== input && $io0(input);
|
|
58
|
-
})(exp))
|
|
59
|
-
throw new common_1.BadRequestException({
|
|
60
|
-
path: exp.path,
|
|
61
|
-
reason: exp.message,
|
|
62
|
-
expected: exp.expected,
|
|
63
|
-
value: exp.value,
|
|
64
|
-
message: "Request query parameters are not following the promised type.",
|
|
65
|
-
});
|
|
66
|
-
throw exp;
|
|
67
|
-
}
|
|
68
|
-
})();
|
|
69
|
-
}
|
|
70
|
-
exports.TypedQuery = TypedQuery;
|
|
71
|
-
/**
|
|
72
|
-
* @internal
|
|
73
|
-
*/
|
|
74
|
-
(function (TypedQuery) {
|
|
75
|
-
function boolean(str) {
|
|
76
|
-
if (str === null)
|
|
77
|
-
return undefined;
|
|
78
|
-
else if (str === "null")
|
|
79
|
-
return null;
|
|
80
|
-
else if (str.length === 0)
|
|
81
|
-
return true;
|
|
82
|
-
return str === "true" || str === "1"
|
|
83
|
-
? true
|
|
84
|
-
: str === "false" || str === "0"
|
|
85
|
-
? false
|
|
86
|
-
: str; // wrong type
|
|
87
|
-
}
|
|
88
|
-
TypedQuery.boolean = boolean;
|
|
89
|
-
function number(str) {
|
|
90
|
-
return (str === null || str === void 0 ? void 0 : str.length) ? (str === "null" ? null : Number(str)) : undefined;
|
|
91
|
-
}
|
|
92
|
-
TypedQuery.number = number;
|
|
93
|
-
function bigint(str) {
|
|
94
|
-
return (str === null || str === void 0 ? void 0 : str.length) ? (str === "null" ? null : BigInt(str)) : undefined;
|
|
95
|
-
}
|
|
96
|
-
TypedQuery.bigint = bigint;
|
|
97
|
-
function string(str) {
|
|
98
|
-
return str === null ? undefined : str === "null" ? null : str;
|
|
99
|
-
}
|
|
100
|
-
TypedQuery.string = string;
|
|
101
|
-
})(TypedQuery
|
|
102
|
-
Object.assign(TypedQuery, typia_1.assert);
|
|
103
|
-
/**
|
|
104
|
-
* @internal
|
|
105
|
-
*/
|
|
106
|
-
function tail(url) {
|
|
107
|
-
var index = url.indexOf("?");
|
|
108
|
-
return index === -1 ? "" : url.substring(index + 1);
|
|
109
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.TypedQuery = void 0;
|
|
27
|
+
var common_1 = require("@nestjs/common");
|
|
28
|
+
var typia_1 = __importStar(require("typia"));
|
|
29
|
+
var TransformError_1 = require("./internal/TransformError");
|
|
30
|
+
/**
|
|
31
|
+
* Type safe URL query decorator.
|
|
32
|
+
*
|
|
33
|
+
* `TypedQuery` is a decorator function that can parse URL query string. It is almost
|
|
34
|
+
* same with {@link nest.Query}, but it can automatically cast property type following
|
|
35
|
+
* its DTO definition. Also, `TypedQuery` performs type validation.
|
|
36
|
+
*
|
|
37
|
+
* For referecen, when URL query parameters are different with their promised
|
|
38
|
+
* type `T`, `BadRequestException` error (status code: 400) would be thrown.
|
|
39
|
+
*
|
|
40
|
+
* @returns Parameter decorator
|
|
41
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
42
|
+
*/
|
|
43
|
+
function TypedQuery(decoder) {
|
|
44
|
+
if (decoder === undefined)
|
|
45
|
+
throw (0, TransformError_1.TransformError)("TypedQuery");
|
|
46
|
+
return (0, common_1.createParamDecorator)(function TypedQuery(_unknown, context) {
|
|
47
|
+
var request = context
|
|
48
|
+
.switchToHttp()
|
|
49
|
+
.getRequest();
|
|
50
|
+
var params = new URLSearchParams(tail(request.url));
|
|
51
|
+
try {
|
|
52
|
+
return decoder(params);
|
|
53
|
+
}
|
|
54
|
+
catch (exp) {
|
|
55
|
+
if ((function (input) {
|
|
56
|
+
var $io0 = function (input) { return "string" === typeof input.method && (undefined === input.path || "string" === typeof input.path) && "string" === typeof input.expected && true && "string" === typeof input.name && "string" === typeof input.message && (undefined === input.stack || "string" === typeof input.stack); };
|
|
57
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
58
|
+
})(exp))
|
|
59
|
+
throw new common_1.BadRequestException({
|
|
60
|
+
path: exp.path,
|
|
61
|
+
reason: exp.message,
|
|
62
|
+
expected: exp.expected,
|
|
63
|
+
value: exp.value,
|
|
64
|
+
message: "Request query parameters are not following the promised type.",
|
|
65
|
+
});
|
|
66
|
+
throw exp;
|
|
67
|
+
}
|
|
68
|
+
})();
|
|
69
|
+
}
|
|
70
|
+
exports.TypedQuery = TypedQuery;
|
|
71
|
+
/**
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
(function (TypedQuery) {
|
|
75
|
+
function boolean(str) {
|
|
76
|
+
if (str === null)
|
|
77
|
+
return undefined;
|
|
78
|
+
else if (str === "null")
|
|
79
|
+
return null;
|
|
80
|
+
else if (str.length === 0)
|
|
81
|
+
return true;
|
|
82
|
+
return str === "true" || str === "1"
|
|
83
|
+
? true
|
|
84
|
+
: str === "false" || str === "0"
|
|
85
|
+
? false
|
|
86
|
+
: str; // wrong type
|
|
87
|
+
}
|
|
88
|
+
TypedQuery.boolean = boolean;
|
|
89
|
+
function number(str) {
|
|
90
|
+
return (str === null || str === void 0 ? void 0 : str.length) ? (str === "null" ? null : Number(str)) : undefined;
|
|
91
|
+
}
|
|
92
|
+
TypedQuery.number = number;
|
|
93
|
+
function bigint(str) {
|
|
94
|
+
return (str === null || str === void 0 ? void 0 : str.length) ? (str === "null" ? null : BigInt(str)) : undefined;
|
|
95
|
+
}
|
|
96
|
+
TypedQuery.bigint = bigint;
|
|
97
|
+
function string(str) {
|
|
98
|
+
return str === null ? undefined : str === "null" ? null : str;
|
|
99
|
+
}
|
|
100
|
+
TypedQuery.string = string;
|
|
101
|
+
})(TypedQuery || (exports.TypedQuery = TypedQuery = {}));
|
|
102
|
+
Object.assign(TypedQuery, typia_1.assert);
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
function tail(url) {
|
|
107
|
+
var index = url.indexOf("?");
|
|
108
|
+
return index === -1 ? "" : url.substring(index + 1);
|
|
109
|
+
}
|
|
110
110
|
//# sourceMappingURL=TypedQuery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypedQuery.js","sourceRoot":"","sources":["../../src/decorators/TypedQuery.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAIwB;AAIxB,6CAAsD;AAEtD,4DAA2D;AAE3D;;;;;;;;;;;;GAYG;AACH,SAAgB,UAAU,CACtB,OAAwC;IAExC,IAAI,OAAO,KAAK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,SAAgB,MAAM,CAAC,GAAkB;QACrC,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,EAAC,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,CAAC;IAFe,iBAAM,SAErB,CAAA;IACD,SAAgB,MAAM,CAAC,GAAkB;QACrC,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IAClE,CAAC;IAFe,iBAAM,SAErB,CAAA;AACL,CAAC,EApBgB,UAAU,0BAAV,UAAU,QAoB1B;AACD,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,cAAM,CAAC,CAAC;AAElC;;GAEG;AACH,SAAS,IAAI,CAAC,GAAW;IACrB,IAAM,KAAK,GAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { IResponseBodyStringifier } from "../options/IResponseBodyStringifier";
|
|
2
|
-
/**
|
|
3
|
-
* Type safe router decorator functions.
|
|
4
|
-
*
|
|
5
|
-
* `TypedRoute` is a module containing router decorator functions which can boost up
|
|
6
|
-
* JSON string conversion speed about 50x times faster than `class-transformer`.
|
|
7
|
-
* Furthermore, such JSON string conversion is even type safe through
|
|
8
|
-
* [typia](https://github.com/samchon/typia).
|
|
9
|
-
*
|
|
10
|
-
* For reference, router functions of `TypedRoute` can convert custom error classes to
|
|
11
|
-
* the regular {@link nest.HttpException} class automatically, through
|
|
12
|
-
* {@link ExceptionManager}.
|
|
13
|
-
*
|
|
14
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
15
|
-
*/
|
|
16
|
-
export declare namespace TypedRoute {
|
|
17
|
-
/**
|
|
18
|
-
* Router decorator function for the GET method.
|
|
19
|
-
*
|
|
20
|
-
* @param path Path of the HTTP request
|
|
21
|
-
* @returns Method decorator
|
|
22
|
-
*/
|
|
23
|
-
const Get: {
|
|
24
|
-
(path?: string | string[]): MethodDecorator;
|
|
25
|
-
<T>(stringify?: IResponseBodyStringifier<T> | undefined): MethodDecorator;
|
|
26
|
-
<T_1>(path: string | string[], stringify?: IResponseBodyStringifier<T_1> | undefined): MethodDecorator;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Router decorator function for the POST method.
|
|
30
|
-
*
|
|
31
|
-
* @param path Path of the HTTP request
|
|
32
|
-
* @returns Method decorator
|
|
33
|
-
*/
|
|
34
|
-
const Post: {
|
|
35
|
-
(path?: string | string[]): MethodDecorator;
|
|
36
|
-
<T>(stringify?: IResponseBodyStringifier<T> | undefined): MethodDecorator;
|
|
37
|
-
<T_1>(path: string | string[], stringify?: IResponseBodyStringifier<T_1> | undefined): MethodDecorator;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Router decorator function for the PATH method.
|
|
41
|
-
*
|
|
42
|
-
* @param path Path of the HTTP request
|
|
43
|
-
* @returns Method decorator
|
|
44
|
-
*/
|
|
45
|
-
const Patch: {
|
|
46
|
-
(path?: string | string[]): MethodDecorator;
|
|
47
|
-
<T>(stringify?: IResponseBodyStringifier<T> | undefined): MethodDecorator;
|
|
48
|
-
<T_1>(path: string | string[], stringify?: IResponseBodyStringifier<T_1> | undefined): MethodDecorator;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Router decorator function for the PUT method.
|
|
52
|
-
*
|
|
53
|
-
* @param path Path of the HTTP request
|
|
54
|
-
* @returns Method decorator
|
|
55
|
-
*/
|
|
56
|
-
const Put: {
|
|
57
|
-
(path?: string | string[]): MethodDecorator;
|
|
58
|
-
<T>(stringify?: IResponseBodyStringifier<T> | undefined): MethodDecorator;
|
|
59
|
-
<T_1>(path: string | string[], stringify?: IResponseBodyStringifier<T_1> | undefined): MethodDecorator;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Router decorator function for the DELETE method.
|
|
63
|
-
*
|
|
64
|
-
* @param path Path of the HTTP request
|
|
65
|
-
* @returns Method decorator
|
|
66
|
-
*/
|
|
67
|
-
const Delete: {
|
|
68
|
-
(path?: string | string[]): MethodDecorator;
|
|
69
|
-
<T>(stringify?: IResponseBodyStringifier<T> | undefined): MethodDecorator;
|
|
70
|
-
<T_1>(path: string | string[], stringify?: IResponseBodyStringifier<T_1> | undefined): MethodDecorator;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
1
|
+
import { IResponseBodyStringifier } from "../options/IResponseBodyStringifier";
|
|
2
|
+
/**
|
|
3
|
+
* Type safe router decorator functions.
|
|
4
|
+
*
|
|
5
|
+
* `TypedRoute` is a module containing router decorator functions which can boost up
|
|
6
|
+
* JSON string conversion speed about 50x times faster than `class-transformer`.
|
|
7
|
+
* Furthermore, such JSON string conversion is even type safe through
|
|
8
|
+
* [typia](https://github.com/samchon/typia).
|
|
9
|
+
*
|
|
10
|
+
* For reference, router functions of `TypedRoute` can convert custom error classes to
|
|
11
|
+
* the regular {@link nest.HttpException} class automatically, through
|
|
12
|
+
* {@link ExceptionManager}.
|
|
13
|
+
*
|
|
14
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
15
|
+
*/
|
|
16
|
+
export declare namespace TypedRoute {
|
|
17
|
+
/**
|
|
18
|
+
* Router decorator function for the GET method.
|
|
19
|
+
*
|
|
20
|
+
* @param path Path of the HTTP request
|
|
21
|
+
* @returns Method decorator
|
|
22
|
+
*/
|
|
23
|
+
const Get: {
|
|
24
|
+
(path?: string | string[]): MethodDecorator;
|
|
25
|
+
<T>(stringify?: IResponseBodyStringifier<T> | undefined): MethodDecorator;
|
|
26
|
+
<T_1>(path: string | string[], stringify?: IResponseBodyStringifier<T_1> | undefined): MethodDecorator;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Router decorator function for the POST method.
|
|
30
|
+
*
|
|
31
|
+
* @param path Path of the HTTP request
|
|
32
|
+
* @returns Method decorator
|
|
33
|
+
*/
|
|
34
|
+
const Post: {
|
|
35
|
+
(path?: string | string[]): MethodDecorator;
|
|
36
|
+
<T>(stringify?: IResponseBodyStringifier<T> | undefined): MethodDecorator;
|
|
37
|
+
<T_1>(path: string | string[], stringify?: IResponseBodyStringifier<T_1> | undefined): MethodDecorator;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Router decorator function for the PATH method.
|
|
41
|
+
*
|
|
42
|
+
* @param path Path of the HTTP request
|
|
43
|
+
* @returns Method decorator
|
|
44
|
+
*/
|
|
45
|
+
const Patch: {
|
|
46
|
+
(path?: string | string[]): MethodDecorator;
|
|
47
|
+
<T>(stringify?: IResponseBodyStringifier<T> | undefined): MethodDecorator;
|
|
48
|
+
<T_1>(path: string | string[], stringify?: IResponseBodyStringifier<T_1> | undefined): MethodDecorator;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Router decorator function for the PUT method.
|
|
52
|
+
*
|
|
53
|
+
* @param path Path of the HTTP request
|
|
54
|
+
* @returns Method decorator
|
|
55
|
+
*/
|
|
56
|
+
const Put: {
|
|
57
|
+
(path?: string | string[]): MethodDecorator;
|
|
58
|
+
<T>(stringify?: IResponseBodyStringifier<T> | undefined): MethodDecorator;
|
|
59
|
+
<T_1>(path: string | string[], stringify?: IResponseBodyStringifier<T_1> | undefined): MethodDecorator;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Router decorator function for the DELETE method.
|
|
63
|
+
*
|
|
64
|
+
* @param path Path of the HTTP request
|
|
65
|
+
* @returns Method decorator
|
|
66
|
+
*/
|
|
67
|
+
const Delete: {
|
|
68
|
+
(path?: string | string[]): MethodDecorator;
|
|
69
|
+
<T>(stringify?: IResponseBodyStringifier<T> | undefined): MethodDecorator;
|
|
70
|
+
<T_1>(path: string | string[], stringify?: IResponseBodyStringifier<T_1> | undefined): MethodDecorator;
|
|
71
|
+
};
|
|
72
|
+
}
|