web_api_base 3.6.7 → 3.7.0
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/dist/Application.d.ts +24 -24
- package/dist/Application.js +449 -421
- package/dist/Application.js.map +1 -1
- package/dist/ApplicationConfiguration.d.ts +18 -18
- package/dist/ApplicationConfiguration.js +126 -126
- package/dist/bin/CreateApplication.d.ts +1 -1
- package/dist/bin/CreateApplication.js +16 -16
- package/dist/bin/CreateController.d.ts +1 -1
- package/dist/bin/CreateController.js +21 -21
- package/dist/controllers/base/ControllerBase.d.ts +19 -19
- package/dist/controllers/base/ControllerBase.js +46 -46
- package/dist/decorators/controllers/ControllerDecorators.d.ts +50 -46
- package/dist/decorators/controllers/ControllerDecorators.js +172 -166
- package/dist/decorators/controllers/ControllerDecorators.js.map +1 -1
- package/dist/decorators/documentation/DocumentationDecorators.d.ts +17 -17
- package/dist/decorators/documentation/DocumentationDecorators.js +38 -38
- package/dist/decorators/validations/ValidationDecorators.d.ts +53 -53
- package/dist/decorators/validations/ValidationDecorators.js +180 -180
- package/dist/decorators/validations/ValidationDecorators.js.map +1 -1
- package/dist/dependencyInjection/DependecyService.d.ts +28 -28
- package/dist/dependencyInjection/DependecyService.js +135 -135
- package/dist/dependencyInjection/DependecyService.js.map +1 -1
- package/dist/dependencyInjection/IDIContext.d.ts +7 -7
- package/dist/dependencyInjection/IDIContext.js +2 -2
- package/dist/documentation/CSS.d.ts +6 -6
- package/dist/documentation/CSS.js +18 -18
- package/dist/documentation/CSS.js.map +1 -1
- package/dist/documentation/Documentation.d.ts +7 -7
- package/dist/documentation/Documentation.js +80 -80
- package/dist/documentation/Documentation.js.map +1 -1
- package/dist/documentation/HTML.d.ts +4 -4
- package/dist/documentation/HTML.js +13 -13
- package/dist/documentation/HTML.js.map +1 -1
- package/dist/documentation/JS.d.ts +5 -5
- package/dist/documentation/JS.js +69 -35
- package/dist/documentation/JS.js.map +1 -1
- package/dist/enums/httpVerbs/HttpVerbs.d.ts +6 -6
- package/dist/enums/httpVerbs/HttpVerbs.js +10 -10
- package/dist/enums/httpVerbs/HttpVerbs.js.map +1 -1
- package/dist/exceptions/ArgumentNullException.d.ts +3 -3
- package/dist/exceptions/ArgumentNullException.js +9 -9
- package/dist/exceptions/ControllerLoadException.d.ts +3 -3
- package/dist/exceptions/ControllerLoadException.js +9 -9
- package/dist/exceptions/Exception.d.ts +4 -4
- package/dist/exceptions/Exception.js +9 -9
- package/dist/exceptions/FindDependencyException.d.ts +3 -3
- package/dist/exceptions/FindDependencyException.js +9 -9
- package/dist/index.d.ts +47 -45
- package/dist/index.js +155 -147
- package/dist/index.js.map +1 -1
- package/dist/interfaces/IApplication.d.ts +13 -13
- package/dist/interfaces/IApplication.js +2 -2
- package/dist/interfaces/IApplicationConfiguration.d.ts +12 -12
- package/dist/interfaces/IApplicationConfiguration.js +2 -2
- package/dist/interfaces/IController.d.ts +5 -5
- package/dist/interfaces/IController.js +2 -2
- package/dist/metadata/FunctionAnalizer.d.ts +8 -8
- package/dist/metadata/FunctionAnalizer.js +22 -22
- package/dist/metadata/OwnMetaDataContainer.d.ts +12 -12
- package/dist/metadata/OwnMetaDataContainer.js +32 -32
- package/dist/metadata/OwnMetaDataContainer.js.map +1 -1
- package/dist/metadata/Type.d.ts +4 -4
- package/dist/metadata/Type.js +36 -36
- package/dist/midlewares/IMidleware.d.ts +19 -19
- package/dist/midlewares/IMidleware.js +2 -2
- package/package.json +8 -11
package/dist/metadata/Type.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class Type {
|
|
4
|
-
static CreateTemplateFrom(ctor) {
|
|
5
|
-
let base = Reflect.construct(ctor, []);
|
|
6
|
-
for (let map in base) {
|
|
7
|
-
let designType = Reflect.getMetadata("design:type", ctor, map);
|
|
8
|
-
if (designType) {
|
|
9
|
-
if (designType != Array)
|
|
10
|
-
base[map] = Type.FillObject(Reflect.construct(designType, []));
|
|
11
|
-
else
|
|
12
|
-
base[map] = [Type.FillObject(Reflect.construct(designType, []))];
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return Type.FillObject(base);
|
|
16
|
-
}
|
|
17
|
-
static FillObject(obj) {
|
|
18
|
-
for (let c in obj) {
|
|
19
|
-
let d = Reflect.getMetadata("design:type", obj, c);
|
|
20
|
-
if (!d)
|
|
21
|
-
continue;
|
|
22
|
-
if (d.name === "Number")
|
|
23
|
-
obj[c] = -1;
|
|
24
|
-
else if (d.name === "String")
|
|
25
|
-
obj[c] = c;
|
|
26
|
-
else if (d.name === "Boolean")
|
|
27
|
-
obj[c] = false;
|
|
28
|
-
else if (d.name === "Date")
|
|
29
|
-
obj[c] = new Date();
|
|
30
|
-
else if (d.name === "Object")
|
|
31
|
-
obj[c] = {};
|
|
32
|
-
}
|
|
33
|
-
return obj;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.default = Type;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Type {
|
|
4
|
+
static CreateTemplateFrom(ctor) {
|
|
5
|
+
let base = Reflect.construct(ctor, []);
|
|
6
|
+
for (let map in base) {
|
|
7
|
+
let designType = Reflect.getMetadata("design:type", ctor, map);
|
|
8
|
+
if (designType) {
|
|
9
|
+
if (designType != Array)
|
|
10
|
+
base[map] = Type.FillObject(Reflect.construct(designType, []));
|
|
11
|
+
else
|
|
12
|
+
base[map] = [Type.FillObject(Reflect.construct(designType, []))];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return Type.FillObject(base);
|
|
16
|
+
}
|
|
17
|
+
static FillObject(obj) {
|
|
18
|
+
for (let c in obj) {
|
|
19
|
+
let d = Reflect.getMetadata("design:type", obj, c);
|
|
20
|
+
if (!d)
|
|
21
|
+
continue;
|
|
22
|
+
if (d.name === "Number")
|
|
23
|
+
obj[c] = -1;
|
|
24
|
+
else if (d.name === "String")
|
|
25
|
+
obj[c] = c;
|
|
26
|
+
else if (d.name === "Boolean")
|
|
27
|
+
obj[c] = false;
|
|
28
|
+
else if (d.name === "Date")
|
|
29
|
+
obj[c] = new Date();
|
|
30
|
+
else if (d.name === "Object")
|
|
31
|
+
obj[c] = {};
|
|
32
|
+
}
|
|
33
|
+
return obj;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = Type;
|
|
37
37
|
//# sourceMappingURL=Type.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Request, Response } from "express";
|
|
2
|
-
import Exception from "../exceptions/Exception";
|
|
3
|
-
export default interface IMidleware {
|
|
4
|
-
(context: IHTTPRequestContext): void;
|
|
5
|
-
}
|
|
6
|
-
export interface IRequestResultHandler {
|
|
7
|
-
(result: IRequestResult): void;
|
|
8
|
-
}
|
|
9
|
-
export interface IHTTPRequestContext {
|
|
10
|
-
Request: Request;
|
|
11
|
-
Response: Response;
|
|
12
|
-
Next: () => void;
|
|
13
|
-
}
|
|
14
|
-
export interface IRequestResult {
|
|
15
|
-
Exception?: Exception;
|
|
16
|
-
Result?: any;
|
|
17
|
-
Request: Request;
|
|
18
|
-
Response: Response;
|
|
19
|
-
}
|
|
1
|
+
import { Request, Response } from "express";
|
|
2
|
+
import Exception from "../exceptions/Exception";
|
|
3
|
+
export default interface IMidleware {
|
|
4
|
+
(context: IHTTPRequestContext): void;
|
|
5
|
+
}
|
|
6
|
+
export interface IRequestResultHandler {
|
|
7
|
+
(result: IRequestResult): void;
|
|
8
|
+
}
|
|
9
|
+
export interface IHTTPRequestContext {
|
|
10
|
+
Request: Request;
|
|
11
|
+
Response: Response;
|
|
12
|
+
Next: () => void;
|
|
13
|
+
}
|
|
14
|
+
export interface IRequestResult {
|
|
15
|
+
Exception?: Exception;
|
|
16
|
+
Result?: any;
|
|
17
|
+
Request: Request;
|
|
18
|
+
Response: Response;
|
|
19
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=IMidleware.js.map
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web_api_base",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "web api base",
|
|
3
|
+
"version": "3.7.0",
|
|
4
|
+
"description": "web api base",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"/dist"
|
|
9
9
|
],
|
|
10
|
-
"bin":
|
|
11
|
-
|
|
12
|
-
"create-
|
|
13
|
-
"create-application" : "./dist/bin/CreateApplication.js"
|
|
10
|
+
"bin": {
|
|
11
|
+
"create-controller": "./dist/bin/CreateController.js",
|
|
12
|
+
"create-application": "./dist/bin/CreateApplication.js"
|
|
14
13
|
},
|
|
15
14
|
"scripts": {
|
|
16
15
|
"test": "jest",
|
|
@@ -21,12 +20,11 @@
|
|
|
21
20
|
"author": "adriano.marino1992@gmail.com",
|
|
22
21
|
"repository": "https://github.com/adrianomarino1992/web_api_base.git",
|
|
23
22
|
"license": "ISC",
|
|
24
|
-
"dependencies": {
|
|
23
|
+
"dependencies": {
|
|
25
24
|
"cors": "^2.8.5",
|
|
26
|
-
"express": "^4.18.2",
|
|
25
|
+
"express": "^4.18.2",
|
|
27
26
|
"platform-folders": "^0.6.0",
|
|
28
|
-
"reflect-metadata": "^0.1.13"
|
|
29
|
-
|
|
27
|
+
"reflect-metadata": "^0.1.13"
|
|
30
28
|
},
|
|
31
29
|
"devDependencies": {
|
|
32
30
|
"@types/express": "^4.17.15",
|
|
@@ -36,6 +34,5 @@
|
|
|
36
34
|
"jest": "^29.3.1",
|
|
37
35
|
"ts-jest": "^29.0.3",
|
|
38
36
|
"ts-node": "^10.9.1"
|
|
39
|
-
|
|
40
37
|
}
|
|
41
38
|
}
|