@nestia/core 1.3.6 → 1.3.8
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/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 +7 -7
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
-
if (!m) return o;
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.ExceptionManager = void 0;
|
|
20
|
-
var fetcher_1 = require("@nestia/fetcher");
|
|
21
|
-
var common_1 = require("@nestjs/common");
|
|
22
|
-
var typia_1 = require("typia");
|
|
23
|
-
/**
|
|
24
|
-
* Exception manager for HTTP server.
|
|
25
|
-
*
|
|
26
|
-
* `ExceptionManager` is an utility class who can insert or erase custom error class with
|
|
27
|
-
* its convertion method to a regular {@link nest.HttpException} instance.
|
|
28
|
-
*
|
|
29
|
-
* If you define an API function through {@link TypedRoute} or {@link EncryptedRoute}
|
|
30
|
-
* instead of the basic router decorator functions like {@link nest.Get} or
|
|
31
|
-
* {@link nest.Post} and the API function throws a custom error whose class has been
|
|
32
|
-
* {@link ExceptionManager.insert inserted} in this `EntityManager`, the error would be
|
|
33
|
-
* automatically converted to the regular {@link nest.HttpException} instance by the
|
|
34
|
-
* {@link ExceptionManager.Closure} function.
|
|
35
|
-
*
|
|
36
|
-
* Therefore, with this `ExceptionManager` and {@link TypedRoute} or {@link EncryptedRoute},
|
|
37
|
-
* you can manage your custom error classes much systemtically. You can avoid 500 internal
|
|
38
|
-
* server error or hard coding implementation about the custom error classes.
|
|
39
|
-
*
|
|
40
|
-
* Below error classes are defaultly configured in this `ExceptionManager`
|
|
41
|
-
*
|
|
42
|
-
* - `typia.TypeGuardError`
|
|
43
|
-
* - `@nestia/fetcher.HttpError`
|
|
44
|
-
*
|
|
45
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
46
|
-
*/
|
|
47
|
-
var ExceptionManager;
|
|
48
|
-
(function (ExceptionManager) {
|
|
49
|
-
/**
|
|
50
|
-
* Insert an error class with converter.
|
|
51
|
-
*
|
|
52
|
-
* If you've inserted an duplicated error class, the closure would be overwritten.
|
|
53
|
-
*
|
|
54
|
-
* @param creator Target error class
|
|
55
|
-
* @param closure A closure function converting to the `HttpException` class
|
|
56
|
-
*/
|
|
57
|
-
function insert(creator, closure) {
|
|
58
|
-
var index = ExceptionManager.tuples.findIndex(function (tuple) { return tuple[0] === creator; });
|
|
59
|
-
if (index !== -1)
|
|
60
|
-
ExceptionManager.tuples.splice(index, 1);
|
|
61
|
-
ExceptionManager.tuples.push([creator, closure]);
|
|
62
|
-
ExceptionManager.tuples.sort(function (_a, _b) {
|
|
63
|
-
var _c = __read(_a, 1), x = _c[0];
|
|
64
|
-
var _d = __read(_b, 1), y = _d[0];
|
|
65
|
-
return (x.prototype instanceof y ? -1 : 1);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
ExceptionManager.insert = insert;
|
|
69
|
-
/**
|
|
70
|
-
* Erase an error class.
|
|
71
|
-
*
|
|
72
|
-
* @param creator Target error class
|
|
73
|
-
* @returns Whether be erased or not
|
|
74
|
-
*/
|
|
75
|
-
function erase(creator) {
|
|
76
|
-
var index = ExceptionManager.tuples.findIndex(function (tuple) { return tuple[0] === creator; });
|
|
77
|
-
if (index === -1)
|
|
78
|
-
return false;
|
|
79
|
-
ExceptionManager.tuples.splice(index, 1);
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
ExceptionManager.erase = erase;
|
|
83
|
-
function on(closure) {
|
|
84
|
-
ExceptionManager.listeners.add(closure);
|
|
85
|
-
}
|
|
86
|
-
ExceptionManager.on = on;
|
|
87
|
-
function off(closure) {
|
|
88
|
-
ExceptionManager.listeners.delete(closure);
|
|
89
|
-
}
|
|
90
|
-
ExceptionManager.off = off;
|
|
91
|
-
/**
|
|
92
|
-
* @internal
|
|
93
|
-
*/
|
|
94
|
-
ExceptionManager.tuples = [];
|
|
95
|
-
/**
|
|
96
|
-
* @internal
|
|
97
|
-
*/
|
|
98
|
-
ExceptionManager.listeners = new Set();
|
|
99
|
-
})(ExceptionManager
|
|
100
|
-
ExceptionManager.insert(typia_1.TypeGuardError, function (error) {
|
|
101
|
-
return new common_1.HttpException({
|
|
102
|
-
path: error.path,
|
|
103
|
-
reason: error.message,
|
|
104
|
-
message: "Request message is not following the promised type.",
|
|
105
|
-
}, 400);
|
|
106
|
-
});
|
|
107
|
-
ExceptionManager.insert(fetcher_1.HttpError, function (error) {
|
|
108
|
-
return new common_1.HttpException({
|
|
109
|
-
path: error.path,
|
|
110
|
-
message: error.message,
|
|
111
|
-
}, error.status);
|
|
112
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.ExceptionManager = void 0;
|
|
20
|
+
var fetcher_1 = require("@nestia/fetcher");
|
|
21
|
+
var common_1 = require("@nestjs/common");
|
|
22
|
+
var typia_1 = require("typia");
|
|
23
|
+
/**
|
|
24
|
+
* Exception manager for HTTP server.
|
|
25
|
+
*
|
|
26
|
+
* `ExceptionManager` is an utility class who can insert or erase custom error class with
|
|
27
|
+
* its convertion method to a regular {@link nest.HttpException} instance.
|
|
28
|
+
*
|
|
29
|
+
* If you define an API function through {@link TypedRoute} or {@link EncryptedRoute}
|
|
30
|
+
* instead of the basic router decorator functions like {@link nest.Get} or
|
|
31
|
+
* {@link nest.Post} and the API function throws a custom error whose class has been
|
|
32
|
+
* {@link ExceptionManager.insert inserted} in this `EntityManager`, the error would be
|
|
33
|
+
* automatically converted to the regular {@link nest.HttpException} instance by the
|
|
34
|
+
* {@link ExceptionManager.Closure} function.
|
|
35
|
+
*
|
|
36
|
+
* Therefore, with this `ExceptionManager` and {@link TypedRoute} or {@link EncryptedRoute},
|
|
37
|
+
* you can manage your custom error classes much systemtically. You can avoid 500 internal
|
|
38
|
+
* server error or hard coding implementation about the custom error classes.
|
|
39
|
+
*
|
|
40
|
+
* Below error classes are defaultly configured in this `ExceptionManager`
|
|
41
|
+
*
|
|
42
|
+
* - `typia.TypeGuardError`
|
|
43
|
+
* - `@nestia/fetcher.HttpError`
|
|
44
|
+
*
|
|
45
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
46
|
+
*/
|
|
47
|
+
var ExceptionManager;
|
|
48
|
+
(function (ExceptionManager) {
|
|
49
|
+
/**
|
|
50
|
+
* Insert an error class with converter.
|
|
51
|
+
*
|
|
52
|
+
* If you've inserted an duplicated error class, the closure would be overwritten.
|
|
53
|
+
*
|
|
54
|
+
* @param creator Target error class
|
|
55
|
+
* @param closure A closure function converting to the `HttpException` class
|
|
56
|
+
*/
|
|
57
|
+
function insert(creator, closure) {
|
|
58
|
+
var index = ExceptionManager.tuples.findIndex(function (tuple) { return tuple[0] === creator; });
|
|
59
|
+
if (index !== -1)
|
|
60
|
+
ExceptionManager.tuples.splice(index, 1);
|
|
61
|
+
ExceptionManager.tuples.push([creator, closure]);
|
|
62
|
+
ExceptionManager.tuples.sort(function (_a, _b) {
|
|
63
|
+
var _c = __read(_a, 1), x = _c[0];
|
|
64
|
+
var _d = __read(_b, 1), y = _d[0];
|
|
65
|
+
return (x.prototype instanceof y ? -1 : 1);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
ExceptionManager.insert = insert;
|
|
69
|
+
/**
|
|
70
|
+
* Erase an error class.
|
|
71
|
+
*
|
|
72
|
+
* @param creator Target error class
|
|
73
|
+
* @returns Whether be erased or not
|
|
74
|
+
*/
|
|
75
|
+
function erase(creator) {
|
|
76
|
+
var index = ExceptionManager.tuples.findIndex(function (tuple) { return tuple[0] === creator; });
|
|
77
|
+
if (index === -1)
|
|
78
|
+
return false;
|
|
79
|
+
ExceptionManager.tuples.splice(index, 1);
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
ExceptionManager.erase = erase;
|
|
83
|
+
function on(closure) {
|
|
84
|
+
ExceptionManager.listeners.add(closure);
|
|
85
|
+
}
|
|
86
|
+
ExceptionManager.on = on;
|
|
87
|
+
function off(closure) {
|
|
88
|
+
ExceptionManager.listeners.delete(closure);
|
|
89
|
+
}
|
|
90
|
+
ExceptionManager.off = off;
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
ExceptionManager.tuples = [];
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
ExceptionManager.listeners = new Set();
|
|
99
|
+
})(ExceptionManager || (exports.ExceptionManager = ExceptionManager = {}));
|
|
100
|
+
ExceptionManager.insert(typia_1.TypeGuardError, function (error) {
|
|
101
|
+
return new common_1.HttpException({
|
|
102
|
+
path: error.path,
|
|
103
|
+
reason: error.message,
|
|
104
|
+
message: "Request message is not following the promised type.",
|
|
105
|
+
}, 400);
|
|
106
|
+
});
|
|
107
|
+
ExceptionManager.insert(fetcher_1.HttpError, function (error) {
|
|
108
|
+
return new common_1.HttpException({
|
|
109
|
+
path: error.path,
|
|
110
|
+
message: error.message,
|
|
111
|
+
}, error.status);
|
|
112
|
+
});
|
|
113
113
|
//# sourceMappingURL=ExceptionManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExceptionManager.js","sourceRoot":"","sources":["../../src/utils/ExceptionManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yCAA+C;AAC/C,+BAAuC;AAIvC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,IAAiB,gBAAgB,CAsEhC;AAtED,WAAiB,gBAAgB;IAC7B;;;;;;;OAOG;IACH,SAAgB,MAAM,CAClB,OAAmB,EACnB,OAAmB;QAEnB,IAAM,KAAK,GAAW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-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Singleton = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
var Singleton = /** @class */ (function () {
|
|
8
|
-
function Singleton(closure_) {
|
|
9
|
-
this.closure_ = closure_;
|
|
10
|
-
this.value_ = NOT_MOUNTED_YET;
|
|
11
|
-
}
|
|
12
|
-
Singleton.prototype.get = function () {
|
|
13
|
-
if (this.value_ === NOT_MOUNTED_YET)
|
|
14
|
-
this.value_ = this.closure_();
|
|
15
|
-
return this.value_;
|
|
16
|
-
};
|
|
17
|
-
return Singleton;
|
|
18
|
-
}());
|
|
19
|
-
exports.Singleton = Singleton;
|
|
20
|
-
/**
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
var NOT_MOUNTED_YET = {};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Singleton = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
var Singleton = /** @class */ (function () {
|
|
8
|
+
function Singleton(closure_) {
|
|
9
|
+
this.closure_ = closure_;
|
|
10
|
+
this.value_ = NOT_MOUNTED_YET;
|
|
11
|
+
}
|
|
12
|
+
Singleton.prototype.get = function () {
|
|
13
|
+
if (this.value_ === NOT_MOUNTED_YET)
|
|
14
|
+
this.value_ = this.closure_();
|
|
15
|
+
return this.value_;
|
|
16
|
+
};
|
|
17
|
+
return Singleton;
|
|
18
|
+
}());
|
|
19
|
+
exports.Singleton = Singleton;
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
var NOT_MOUNTED_YET = {};
|
|
24
24
|
//# sourceMappingURL=Singleton.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare namespace SourceFinder {
|
|
2
|
-
const find: (props: IProps) => Promise<string[]>;
|
|
3
|
-
}
|
|
4
|
-
interface IProps {
|
|
5
|
-
exclude?: string[];
|
|
6
|
-
include: string[];
|
|
7
|
-
filter: (location: string) => boolean;
|
|
8
|
-
}
|
|
9
|
-
export {};
|
|
1
|
+
export declare namespace SourceFinder {
|
|
2
|
+
const find: (props: IProps) => Promise<string[]>;
|
|
3
|
+
}
|
|
4
|
+
interface IProps {
|
|
5
|
+
exclude?: string[];
|
|
6
|
+
include: string[];
|
|
7
|
+
filter: (location: string) => boolean;
|
|
8
|
+
}
|
|
9
|
+
export {};
|