web_api_base 3.5.1 → 3.6.3
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 +4 -1
- package/dist/Application.js +30 -8
- package/dist/Application.js.map +1 -1
- package/dist/ApplicationConfiguration.d.ts +3 -2
- package/dist/ApplicationConfiguration.js +13 -18
- package/dist/ApplicationConfiguration.js.map +1 -1
- package/dist/bin/CreateApplication.js +4 -1
- package/dist/bin/CreateApplication.js.map +1 -1
- package/dist/bin/CreateController.js +2 -1
- package/dist/bin/CreateController.js.map +1 -1
- package/dist/decorators/controllers/ControllerDecorators.d.ts +1 -2
- package/dist/decorators/controllers/ControllerDecorators.js +5 -5
- package/dist/decorators/controllers/ControllerDecorators.js.map +1 -1
- package/dist/decorators/documentation/DocumentationDecorators.d.ts +17 -0
- package/dist/decorators/documentation/DocumentationDecorators.js +39 -0
- package/dist/decorators/documentation/DocumentationDecorators.js.map +1 -0
- package/dist/dependencyInjection/DependecyService.js +6 -2
- package/dist/dependencyInjection/DependecyService.js.map +1 -1
- package/dist/documentation/CSS.d.ts +6 -0
- package/dist/documentation/CSS.js +293 -0
- package/dist/documentation/CSS.js.map +1 -0
- package/dist/documentation/Documentation.d.ts +7 -0
- package/dist/documentation/Documentation.js +81 -0
- package/dist/documentation/Documentation.js.map +1 -0
- package/dist/documentation/HTML.d.ts +4 -0
- package/dist/documentation/HTML.js +26 -0
- package/dist/documentation/HTML.js.map +1 -0
- package/dist/documentation/JS.d.ts +5 -0
- package/dist/documentation/JS.js +239 -0
- package/dist/documentation/JS.js.map +1 -0
- package/dist/exceptions/ArgumentNullException.d.ts +3 -0
- package/dist/exceptions/ArgumentNullException.js +10 -0
- package/dist/exceptions/ArgumentNullException.js.map +1 -0
- package/dist/exceptions/FindDependencyException.d.ts +3 -0
- package/dist/exceptions/FindDependencyException.js +10 -0
- package/dist/exceptions/FindDependencyException.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/IApplication.d.ts +1 -0
- package/dist/interfaces/IApplicationConfiguration.d.ts +2 -1
- package/dist/metadata/Type.d.ts +4 -0
- package/dist/metadata/Type.js +37 -0
- package/dist/metadata/Type.js.map +1 -0
- package/package.json +1 -1
- package/readme.md +64 -1
- package/dist/temp/Application.d.ts +0 -5
- package/dist/temp/Application.js +0 -27
- package/dist/temp/Application.js.map +0 -1
- package/dist/temp/Index.d.ts +0 -1
- package/dist/temp/Index.js +0 -19
- package/dist/temp/Index.js.map +0 -1
- package/dist/temp/controllers/StatusController.d.ts +0 -21
- package/dist/temp/controllers/StatusController.js +0 -117
- package/dist/temp/controllers/StatusController.js.map +0 -1
- package/dist/temp/service/SampleService.d.ts +0 -9
- package/dist/temp/service/SampleService.js +0 -19
- package/dist/temp/service/SampleService.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Exception_1 = __importDefault(require("./Exception"));
|
|
7
|
+
class ArgumentNullException extends Exception_1.default {
|
|
8
|
+
}
|
|
9
|
+
exports.default = ArgumentNullException;
|
|
10
|
+
//# sourceMappingURL=ArgumentNullException.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArgumentNullException.js","sourceRoot":"","sources":["../../exceptions/ArgumentNullException.ts"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AAGpC,MAAqB,qBAAsB,SAAQ,mBAAS;CAC3D;AADD,wCACC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Exception_1 = __importDefault(require("./Exception"));
|
|
7
|
+
class FindDependencyException extends Exception_1.default {
|
|
8
|
+
}
|
|
9
|
+
exports.default = FindDependencyException;
|
|
10
|
+
//# sourceMappingURL=FindDependencyException.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FindDependencyException.js","sourceRoot":"","sources":["../../exceptions/FindDependencyException.ts"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AAIpC,MAAqB,uBAAwB,SAAQ,mBAAS;CAC7D;AADD,0CACC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { default as IApplicationConfiguration } from "./interfaces/IApplicationC
|
|
|
10
10
|
export { default as IApplication } from "./interfaces/IApplication";
|
|
11
11
|
export { default as IApplicatiIControllernConfiguration } from "./interfaces/IController";
|
|
12
12
|
export { IHTTPRequestContext, IRequestResult, IRequestResultHandler } from "./midlewares/IMidleware";
|
|
13
|
+
import { DocumentationDecorators } from "./decorators/documentation/DocumentationDecorators";
|
|
13
14
|
import { HTTPVerbs } from "./enums/httpVerbs/HttpVerbs";
|
|
14
15
|
import IMidleware, { IRequestResultHandler } from "./midlewares/IMidleware";
|
|
15
16
|
export declare function UseBefore(midleware: IMidleware): (target: Function) => void;
|
|
@@ -22,6 +23,9 @@ export declare function GET(action?: string): (target: Object, methodName: strin
|
|
|
22
23
|
export declare function POST(action?: string): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
|
|
23
24
|
export declare function PUT(action?: string): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
|
|
24
25
|
export declare function DELETE(action?: string): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
|
|
26
|
+
export declare function Description(description: string): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
|
|
27
|
+
export declare function RequestJson(json: string): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
|
|
28
|
+
export declare function ProducesResponse(response: Parameters<typeof DocumentationDecorators.ProducesResponse>[0]): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
|
|
25
29
|
export declare function Verb(verb: HTTPVerbs): (target: Object, methodName: string, propertyDescriptor: PropertyDescriptor) => void;
|
|
26
30
|
export declare function Inject(): (target: Object, property: string | symbol) => void;
|
|
27
31
|
export declare function InjectAbstract(cTor: Function): (target: Object, property: string | symbol) => void;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FromQuery = exports.FromBody = exports.Rule = exports.Regex = exports.Min = exports.Max = exports.MinLenght = exports.MaxLenght = exports.Required = exports.ValidateObject = exports.Validate = exports.InjectAbstract = exports.Inject = exports.Verb = exports.DELETE = exports.PUT = exports.POST = exports.GET = exports.Route = exports.Action = exports.RunAfter = exports.UseAfter = exports.RunBefore = exports.UseBefore = exports.DependecyService = exports.Exception = exports.HTTPVerbs = exports.ControllerBase = exports.ControllersDecorators = exports.ApplicationConfiguration = exports.Application = void 0;
|
|
6
|
+
exports.FromQuery = exports.FromBody = exports.Rule = exports.Regex = exports.Min = exports.Max = exports.MinLenght = exports.MaxLenght = exports.Required = exports.ValidateObject = exports.Validate = exports.InjectAbstract = exports.Inject = exports.Verb = exports.ProducesResponse = exports.RequestJson = exports.Description = exports.DELETE = exports.PUT = exports.POST = exports.GET = exports.Route = exports.Action = exports.RunAfter = exports.UseAfter = exports.RunBefore = exports.UseBefore = exports.DependecyService = exports.Exception = exports.HTTPVerbs = exports.ControllerBase = exports.ControllersDecorators = exports.ApplicationConfiguration = exports.Application = void 0;
|
|
7
7
|
var Application_1 = require("./Application");
|
|
8
8
|
Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return __importDefault(Application_1).default; } });
|
|
9
9
|
var ApplicationConfiguration_1 = require("./ApplicationConfiguration");
|
|
@@ -19,6 +19,7 @@ Object.defineProperty(exports, "Exception", { enumerable: true, get: function ()
|
|
|
19
19
|
var DependecyService_1 = require("./dependencyInjection/DependecyService");
|
|
20
20
|
Object.defineProperty(exports, "DependecyService", { enumerable: true, get: function () { return __importDefault(DependecyService_1).default; } });
|
|
21
21
|
const ControllerDecorators_2 = __importDefault(require("./decorators/controllers/ControllerDecorators"));
|
|
22
|
+
const DocumentationDecorators_1 = require("./decorators/documentation/DocumentationDecorators");
|
|
22
23
|
const ValidationDecorators_1 = __importDefault(require("./decorators/validations/ValidationDecorators"));
|
|
23
24
|
const DependecyService_2 = __importDefault(require("./dependencyInjection/DependecyService"));
|
|
24
25
|
const HttpVerbs_2 = require("./enums/httpVerbs/HttpVerbs");
|
|
@@ -72,6 +73,21 @@ function DELETE(action) {
|
|
|
72
73
|
}
|
|
73
74
|
exports.DELETE = DELETE;
|
|
74
75
|
;
|
|
76
|
+
function Description(description) {
|
|
77
|
+
return DocumentationDecorators_1.DocumentationDecorators.Description(description);
|
|
78
|
+
}
|
|
79
|
+
exports.Description = Description;
|
|
80
|
+
;
|
|
81
|
+
function RequestJson(json) {
|
|
82
|
+
return DocumentationDecorators_1.DocumentationDecorators.RequestJson(json);
|
|
83
|
+
}
|
|
84
|
+
exports.RequestJson = RequestJson;
|
|
85
|
+
;
|
|
86
|
+
function ProducesResponse(response) {
|
|
87
|
+
return DocumentationDecorators_1.DocumentationDecorators.ProducesResponse(response);
|
|
88
|
+
}
|
|
89
|
+
exports.ProducesResponse = ProducesResponse;
|
|
90
|
+
;
|
|
75
91
|
function Verb(verb) {
|
|
76
92
|
return ControllerDecorators_2.default.Verb(verb);
|
|
77
93
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAsD;AA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,7 @@ export default interface IApplication {
|
|
|
6
6
|
ApplicationThreadExeptionHandler?: ApplicationExceptionHandler;
|
|
7
7
|
StartAsync(): Promise<void>;
|
|
8
8
|
ConfigureAsync(appConfig: IApplicationConfiguration): Promise<void>;
|
|
9
|
+
CreateDocumentation(): void;
|
|
9
10
|
}
|
|
10
11
|
export interface ApplicationExceptionHandler {
|
|
11
12
|
(request: Request, response: Response, exception: Exception): void;
|
|
@@ -2,8 +2,9 @@ export default interface IApplicationConfiguration {
|
|
|
2
2
|
Host: string;
|
|
3
3
|
Port: number;
|
|
4
4
|
RootPath: string;
|
|
5
|
+
DEBUG: boolean;
|
|
5
6
|
EnviromentVariables: {
|
|
6
|
-
[
|
|
7
|
+
[key: string]: any;
|
|
7
8
|
};
|
|
8
9
|
AddScoped(type: Function, ctor?: (new (...args: any[]) => any) | undefined, builder?: (() => any) | undefined): void;
|
|
9
10
|
AddTransient(type: Function, ctor?: (new (...args: any[]) => any) | undefined, builder?: (() => any) | undefined): void;
|
|
@@ -0,0 +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;
|
|
37
|
+
//# sourceMappingURL=Type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Type.js","sourceRoot":"","sources":["../../metadata/Type.ts"],"names":[],"mappings":";;AAEA,MAAqB,IAAI;IAEd,MAAM,CAAC,kBAAkB,CAAmB,IAA+B;QAC9E,IAAI,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAM,CAAC;QAE5C,KAAK,IAAI,GAAG,IAAI,IAAI,EAAE;YAElB,IAAI,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;YAE/D,IAAI,UAAU,EAAE;gBACZ,IAAI,UAAU,IAAI,KAAK;oBAClB,IAAY,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,CAAW,CAAC,CAAC;;oBAGjF,IAAY,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,CAAW,CAAC,CAAC,CAAC;aAC3F;SACJ;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,UAAU,CAAmB,GAAM;QAE7C,KAAK,IAAI,CAAC,IAAI,GAAG,EAAE;YACf,IAAI,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;YAEnD,IAAI,CAAC,CAAC;gBACF,SAAS;YAEb,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;gBAClB,GAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;iBACpB,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;gBACvB,GAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;iBACnB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS;gBACxB,GAAW,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;iBACvB,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM;gBACrB,GAAW,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;iBAC5B,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;gBACvB,GAAW,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;SAC5B;QAED,OAAO,GAAG,CAAC;IACf,CAAC;CAIJ;AA9CD,uBA8CC"}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -64,7 +64,7 @@ export default class App extends Application
|
|
|
64
64
|
this.UseCors();
|
|
65
65
|
|
|
66
66
|
//if the controlles follow the naming rules, the method UseControllers will automatically append them
|
|
67
|
-
this.
|
|
67
|
+
this.UseControllersAsync();
|
|
68
68
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -217,7 +217,44 @@ Send status 500 and a optional body
|
|
|
217
217
|
Send a status code and a optional body
|
|
218
218
|
|
|
219
219
|
|
|
220
|
+
# Filters
|
|
221
|
+
### @UseBefore()
|
|
222
|
+
Append a delegate to execute **before** the controller´s action
|
|
223
|
+
```typescript
|
|
224
|
+
@Route("/status")
|
|
225
|
+
@UseBefore(context =>
|
|
226
|
+
{
|
|
227
|
+
|
|
228
|
+
if(context.Request.headers["token"] != "we have access to request object")
|
|
229
|
+
context.Response.json({Message : "we have access to response object"});
|
|
230
|
+
else
|
|
231
|
+
context.Next(); // call next function in the pipeline
|
|
232
|
+
})
|
|
233
|
+
export default class StatusController extends ControllerBase
|
|
234
|
+
{
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### @UseAfter()
|
|
238
|
+
Append a delegate to execute **after** the controller´s action
|
|
239
|
+
```typescript
|
|
240
|
+
@Route("/status")
|
|
241
|
+
@UseAfter(actionResult =>
|
|
242
|
+
{
|
|
243
|
+
|
|
244
|
+
if(actionResult.Exception) // if a exception was launched
|
|
245
|
+
{
|
|
246
|
+
actionResult.Response.status(500); // we can access the original request
|
|
247
|
+
actionResult.Response.json({Error : actionResult.Exception.Message});
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
220
250
|
|
|
251
|
+
actionResult.Response.status(200); // we can access the original response
|
|
252
|
+
actionResult.Response.json(actionResult.Result); // we can acess the return of controller´s action
|
|
253
|
+
|
|
254
|
+
})
|
|
255
|
+
export default class StatusController extends ControllerBase
|
|
256
|
+
{
|
|
257
|
+
```
|
|
221
258
|
|
|
222
259
|
|
|
223
260
|
# Model Bind decorators
|
|
@@ -419,6 +456,32 @@ export default class ValidatedObject
|
|
|
419
456
|
}
|
|
420
457
|
```
|
|
421
458
|
|
|
459
|
+
# Auto-generated documentation
|
|
460
|
+
|
|
461
|
+
We can create a API playground(host/playground) using the Aplication.CreateDocumentation method inside the Application.ConfigureAsync
|
|
462
|
+
|
|
463
|
+
```typescript
|
|
464
|
+
public override async ConfigureAsync(appConfig: IApplicationConfiguration): Promise<void>
|
|
465
|
+
{
|
|
466
|
+
this.UseCors();
|
|
467
|
+
|
|
468
|
+
await this.UseControllersAsync();
|
|
469
|
+
|
|
470
|
+
appConfig.AddScoped(SampleServiceAbstract, AnotherService);
|
|
471
|
+
|
|
472
|
+
if(Application.DEBUG)
|
|
473
|
+
this.CreateDocumentation();
|
|
474
|
+
|
|
475
|
+
}
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
### To use the default theme, run the API with **--debug** argument
|
|
479
|
+
|
|
480
|
+
[](https://raw.githubusercontent.com/adrianomarino1992/web_api_base/master/light.png)
|
|
481
|
+
|
|
482
|
+
### To use the dark theme, run the API with **--debug --dark** arguments
|
|
483
|
+
[](https://raw.githubusercontent.com/adrianomarino1992/web_api_base/5057c23221750ea4315142e88c7af80c2370682c/dark.png)
|
|
484
|
+
|
|
422
485
|
|
|
423
486
|
## Contributing
|
|
424
487
|
|
package/dist/temp/Application.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const index_1 = require("../index");
|
|
13
|
-
const SampleService_1 = require("./service/SampleService");
|
|
14
|
-
class App extends index_1.Application {
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
}
|
|
18
|
-
ConfigureAsync(appConfig) {
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
this.UseCors();
|
|
21
|
-
appConfig.AddScoped(SampleService_1.SampleServiceAbstract, SampleService_1.AnotherService);
|
|
22
|
-
this.UseControllers();
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.default = App;
|
|
27
|
-
//# sourceMappingURL=Application.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Application.js","sourceRoot":"","sources":["../../temp/Application.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,oCAAkE;AAElE,2DAAgF;AAGhF,MAAqB,GAAI,SAAQ,mBAAW;IAExC;QAEI,KAAK,EAAE,CAAC;IACZ,CAAC;IAEqB,cAAc,CAAC,SAAoC;;YAErE,IAAI,CAAC,OAAO,EAAE,CAAC;YAEf,SAAS,CAAC,SAAS,CAAC,qCAAqB,EAAE,8BAAc,CAAC,CAAC;YAE3D,IAAI,CAAC,cAAc,EAAE,CAAC;QAE1B,CAAC;KAAA;CAGJ;AAlBD,sBAkBC"}
|
package/dist/temp/Index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/temp/Index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const Application_1 = __importDefault(require("./Application"));
|
|
16
|
-
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
yield new Application_1.default().StartAsync();
|
|
18
|
-
}))();
|
|
19
|
-
//# sourceMappingURL=Index.js.map
|
package/dist/temp/Index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../../temp/Index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAwC;AAExC,CAAC,GAAQ,EAAE;IAEP,MAAM,IAAI,qBAAW,EAAE,CAAC,UAAU,EAAE,CAAC;AAEzC,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ControllerBase } from "../../index";
|
|
2
|
-
import { SampleServiceAbstract } from "../service/SampleService";
|
|
3
|
-
export default class StatusController extends ControllerBase {
|
|
4
|
-
SomeService: SampleServiceAbstract;
|
|
5
|
-
TypeInferedInjection?: SampleServiceAbstract;
|
|
6
|
-
constructor(some: SampleServiceAbstract);
|
|
7
|
-
CheckStatus(s: string, some: SampleServiceAbstract): {
|
|
8
|
-
status: string;
|
|
9
|
-
} | undefined;
|
|
10
|
-
TestAction(name: string): void;
|
|
11
|
-
TestActionTwo(name: string, age: number): void;
|
|
12
|
-
PostAction(user: {
|
|
13
|
-
Name: string;
|
|
14
|
-
Age: number;
|
|
15
|
-
}): void;
|
|
16
|
-
PutAction(user: {
|
|
17
|
-
Name: string;
|
|
18
|
-
Age: number;
|
|
19
|
-
}): void;
|
|
20
|
-
DeleteAction(id: number): number;
|
|
21
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const index_1 = require("../../index");
|
|
16
|
-
const SampleService_1 = require("../service/SampleService");
|
|
17
|
-
let StatusController = class StatusController extends index_1.ControllerBase {
|
|
18
|
-
constructor(some) {
|
|
19
|
-
super();
|
|
20
|
-
this.SomeService = some;
|
|
21
|
-
this.TypeInferedInjection = undefined;
|
|
22
|
-
}
|
|
23
|
-
CheckStatus(s, some) {
|
|
24
|
-
this.SomeService.DoSomething();
|
|
25
|
-
return this.OK({ status: "OK" });
|
|
26
|
-
}
|
|
27
|
-
TestAction(name) {
|
|
28
|
-
console.log(name);
|
|
29
|
-
this.OK();
|
|
30
|
-
}
|
|
31
|
-
TestActionTwo(name, age) {
|
|
32
|
-
console.log(name, age);
|
|
33
|
-
this.OK();
|
|
34
|
-
}
|
|
35
|
-
PostAction(user) {
|
|
36
|
-
this.OK(user);
|
|
37
|
-
}
|
|
38
|
-
PutAction(user) {
|
|
39
|
-
this.OK(user);
|
|
40
|
-
}
|
|
41
|
-
DeleteAction(id) {
|
|
42
|
-
return id;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, index_1.InjectAbstract)(SampleService_1.SampleServiceAbstract),
|
|
47
|
-
__metadata("design:type", SampleService_1.SampleServiceAbstract)
|
|
48
|
-
], StatusController.prototype, "SomeService", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, index_1.Inject)(),
|
|
51
|
-
__metadata("design:type", SampleService_1.SampleServiceAbstract)
|
|
52
|
-
], StatusController.prototype, "TypeInferedInjection", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, index_1.Verb)(index_1.HTTPVerbs.GET),
|
|
55
|
-
(0, index_1.Action)("/check"),
|
|
56
|
-
__param(0, (0, index_1.FromBody)()),
|
|
57
|
-
__param(1, (0, index_1.FromBody)()),
|
|
58
|
-
__metadata("design:type", Function),
|
|
59
|
-
__metadata("design:paramtypes", [String, SampleService_1.SampleServiceAbstract]),
|
|
60
|
-
__metadata("design:returntype", void 0)
|
|
61
|
-
], StatusController.prototype, "CheckStatus", null);
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, index_1.GET)(),
|
|
64
|
-
(0, index_1.Action)("Test"),
|
|
65
|
-
__param(0, (0, index_1.FromQuery)()),
|
|
66
|
-
__metadata("design:type", Function),
|
|
67
|
-
__metadata("design:paramtypes", [String]),
|
|
68
|
-
__metadata("design:returntype", void 0)
|
|
69
|
-
], StatusController.prototype, "TestAction", null);
|
|
70
|
-
__decorate([
|
|
71
|
-
(0, index_1.GET)(),
|
|
72
|
-
(0, index_1.Action)(),
|
|
73
|
-
__param(0, (0, index_1.FromQuery)("name")),
|
|
74
|
-
__param(1, (0, index_1.FromQuery)()),
|
|
75
|
-
__metadata("design:type", Function),
|
|
76
|
-
__metadata("design:paramtypes", [String, Number]),
|
|
77
|
-
__metadata("design:returntype", void 0)
|
|
78
|
-
], StatusController.prototype, "TestActionTwo", null);
|
|
79
|
-
__decorate([
|
|
80
|
-
(0, index_1.POST)(),
|
|
81
|
-
__param(0, (0, index_1.FromBody)()),
|
|
82
|
-
__metadata("design:type", Function),
|
|
83
|
-
__metadata("design:paramtypes", [Object]),
|
|
84
|
-
__metadata("design:returntype", void 0)
|
|
85
|
-
], StatusController.prototype, "PostAction", null);
|
|
86
|
-
__decorate([
|
|
87
|
-
(0, index_1.PUT)(),
|
|
88
|
-
__param(0, (0, index_1.FromBody)()),
|
|
89
|
-
__metadata("design:type", Function),
|
|
90
|
-
__metadata("design:paramtypes", [Object]),
|
|
91
|
-
__metadata("design:returntype", void 0)
|
|
92
|
-
], StatusController.prototype, "PutAction", null);
|
|
93
|
-
__decorate([
|
|
94
|
-
(0, index_1.DELETE)(),
|
|
95
|
-
__param(0, (0, index_1.FromQuery)()),
|
|
96
|
-
__metadata("design:type", Function),
|
|
97
|
-
__metadata("design:paramtypes", [Number]),
|
|
98
|
-
__metadata("design:returntype", Number)
|
|
99
|
-
], StatusController.prototype, "DeleteAction", null);
|
|
100
|
-
StatusController = __decorate([
|
|
101
|
-
(0, index_1.Route)("/status"),
|
|
102
|
-
(0, index_1.UseBefore)(context => {
|
|
103
|
-
console.debug("First midleware");
|
|
104
|
-
context.Next();
|
|
105
|
-
}),
|
|
106
|
-
(0, index_1.UseBefore)(context => {
|
|
107
|
-
console.debug("Second midleware");
|
|
108
|
-
context.Next();
|
|
109
|
-
}),
|
|
110
|
-
(0, index_1.UseAfter)(s => {
|
|
111
|
-
console.log(s.Exception);
|
|
112
|
-
console.log(s.Result);
|
|
113
|
-
}),
|
|
114
|
-
__metadata("design:paramtypes", [SampleService_1.SampleServiceAbstract])
|
|
115
|
-
], StatusController);
|
|
116
|
-
exports.default = StatusController;
|
|
117
|
-
//# sourceMappingURL=StatusController.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusController.js","sourceRoot":"","sources":["../../../temp/controllers/StatusController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uCAAkL;AAClL,4DAAiE;AAoBjE,IAAqB,gBAAgB,GAArC,MAAqB,gBAAiB,SAAQ,sBAAc;IASxD,YAAY,IAA4B;QAEpC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;IAC1C,CAAC;IAIM,WAAW,CAAa,CAAU,EAAa,IAA4B;QAE9E,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,EAAE,CAAC,EAAC,MAAM,EAAG,IAA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ACY,WAAA,IAAA,gBAAQ,GAAE,CAAA;;;;iDAG3B;AAGD;IADC,IAAA,cAAM,GAAE;IACY,WAAA,IAAA,iBAAS,GAAE,CAAA;;;;oDAG/B;AAzDgB,gBAAgB;IAlBpC,IAAA,aAAK,EAAC,SAAS,CAAC;IAChB,IAAA,iBAAS,EAAC,OAAO,CAAC,EAAE;QAEjB,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACjC,OAAO,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC,CAAC;IACD,IAAA,iBAAS,EAAC,OAAO,CAAC,EAAE;QAEjB,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC,CAAC;IACD,IAAA,gBAAQ,EAAC,CAAC,CAAC,EAAE;QAGN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAE1B,CAAC,CAAC;qCAUiB,qCAAqB;GATvB,gBAAgB,CA2DpC;kBA3DoB,gBAAgB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare abstract class SampleServiceAbstract {
|
|
2
|
-
abstract DoSomething(): void;
|
|
3
|
-
}
|
|
4
|
-
export declare class SampleService extends SampleServiceAbstract {
|
|
5
|
-
DoSomething(): void;
|
|
6
|
-
}
|
|
7
|
-
export declare class AnotherService extends SampleServiceAbstract {
|
|
8
|
-
DoSomething(): void;
|
|
9
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AnotherService = exports.SampleService = exports.SampleServiceAbstract = void 0;
|
|
4
|
-
class SampleServiceAbstract {
|
|
5
|
-
}
|
|
6
|
-
exports.SampleServiceAbstract = SampleServiceAbstract;
|
|
7
|
-
class SampleService extends SampleServiceAbstract {
|
|
8
|
-
DoSomething() {
|
|
9
|
-
console.log("Doing");
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.SampleService = SampleService;
|
|
13
|
-
class AnotherService extends SampleServiceAbstract {
|
|
14
|
-
DoSomething() {
|
|
15
|
-
console.log("Doing another job");
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.AnotherService = AnotherService;
|
|
19
|
-
//# sourceMappingURL=SampleService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SampleService.js","sourceRoot":"","sources":["../../../temp/service/SampleService.ts"],"names":[],"mappings":";;;AAAA,MAAsB,qBAAqB;CAG1C;AAHD,sDAGC;AAID,MAAa,aAAc,SAAQ,qBAAqB;IAE7C,WAAW;QACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;CACJ;AALD,sCAKC;AAID,MAAa,cAAe,SAAQ,qBAAqB;IAE9C,WAAW;QACd,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACrC,CAAC;CACJ;AALD,wCAKC"}
|