damex 2.0.1 → 2.0.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/README.md +14 -15
- package/classes/AppRouter.d.ts +4 -0
- package/classes/AppRouter.js +12 -0
- package/classes/AppRouter.js.map +1 -0
- package/classes/Injector.d.ts +3 -0
- package/classes/Injector.js +24 -0
- package/classes/Injector.js.map +1 -0
- package/classes/Server.d.ts +8 -0
- package/classes/Server.js +32 -0
- package/classes/Server.js.map +1 -0
- package/classes/index.d.ts +3 -0
- package/classes/index.js +20 -0
- package/classes/index.js.map +1 -0
- package/decorators/controller.decorator.d.ts +1 -0
- package/decorators/controller.decorator.js +30 -0
- package/decorators/controller.decorator.js.map +1 -0
- package/decorators/global-middleware.decorator.d.ts +2 -0
- package/decorators/global-middleware.decorator.js +10 -0
- package/decorators/global-middleware.decorator.js.map +1 -0
- package/decorators/http-methods.decorator.d.ts +5 -0
- package/decorators/http-methods.decorator.js +18 -0
- package/decorators/http-methods.decorator.js.map +1 -0
- package/decorators/index.d.ts +5 -0
- package/decorators/index.js +22 -0
- package/decorators/index.js.map +1 -0
- package/decorators/inject.decorator.d.ts +1 -0
- package/decorators/inject.decorator.js +7 -0
- package/decorators/inject.decorator.js.map +1 -0
- package/decorators/middleware.decorator.d.ts +2 -0
- package/decorators/middleware.decorator.js +10 -0
- package/decorators/middleware.decorator.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.js +21 -373
- package/index.js.map +1 -0
- package/package.json +4 -4
- package/types/enums/ControllerMethodsParams.d.ts +6 -0
- package/types/enums/ControllerMethodsParams.js +11 -0
- package/types/enums/ControllerMethodsParams.js.map +1 -0
- package/types/enums/Design.d.ts +3 -0
- package/types/enums/Design.js +8 -0
- package/types/enums/Design.js.map +1 -0
- package/types/enums/HttpMethods.d.ts +7 -0
- package/types/enums/HttpMethods.js +12 -0
- package/types/enums/HttpMethods.js.map +1 -0
- package/types/enums/ServerConfigsParams.d.ts +5 -0
- package/types/enums/ServerConfigsParams.js +10 -0
- package/types/enums/ServerConfigsParams.js.map +1 -0
- package/types/enums/index.d.ts +3 -0
- package/types/enums/index.js +20 -0
- package/types/enums/index.js.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.js +18 -0
- package/types/index.js.map +1 -0
package/README.md
CHANGED
@@ -14,6 +14,12 @@ Receives a string indicating the route of the controller.
|
|
14
14
|
|
15
15
|
Receives an array with all the middleware methods that will be applied to all the methods of the controller.
|
16
16
|
|
17
|
+
|
18
|
+
```typescript
|
19
|
+
@Inject
|
20
|
+
```
|
21
|
+
Used on classes that required DI. If the class Already has a decorator (as @Controller), the @Inject is not required.
|
22
|
+
|
17
23
|
### Used in Methods
|
18
24
|
|
19
25
|
```typescript
|
@@ -31,29 +37,22 @@ Receives an array with all the middleware methods that will be applied to all th
|
|
31
37
|
@Controller('/users')
|
32
38
|
@GlobalMiddleware([auth])
|
33
39
|
export class UsersController {
|
34
|
-
constructor() {}
|
40
|
+
constructor(private userService: UserService) {}
|
35
41
|
|
36
42
|
@Get()
|
37
43
|
@Middleware([logger])
|
38
|
-
getAll(req: Request, res: Response) {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
]);
|
44
|
+
async getAll(req: Request, res: Response) {
|
45
|
+
const users = await this.userService.all()
|
46
|
+
|
47
|
+
res.status(200).send(users);
|
43
48
|
}
|
44
49
|
|
45
50
|
@Get('/:id')
|
46
51
|
@Middleware([anotherLogger])
|
47
|
-
getById(req: Request, res: Response) {
|
48
|
-
|
52
|
+
async getById(req: Request, res: Response) {
|
53
|
+
const users = await this.userService.findById(req.params.id!)
|
49
54
|
|
50
|
-
res.status(200).send(
|
51
|
-
{ id: 1, user: 'admin' },
|
52
|
-
{ id: 2, user: 'default' },
|
53
|
-
]);
|
55
|
+
res.status(200).send(users);
|
54
56
|
}
|
55
57
|
}
|
56
58
|
```
|
57
|
-
|
58
|
-
# Warning!
|
59
|
-
This package doesn't work with dependency injection for now. Because of this, and due to the way the routes are implemented, all services used inside controllers or other services must implement as static methods.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AppRouter = void 0;
|
4
|
+
const express_1 = require("express");
|
5
|
+
class AppRouter {
|
6
|
+
static get router() {
|
7
|
+
return AppRouter.instance;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
exports.AppRouter = AppRouter;
|
11
|
+
AppRouter.instance = (0, express_1.Router)();
|
12
|
+
//# sourceMappingURL=AppRouter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AppRouter.js","sourceRoot":"","sources":["../../src/classes/AppRouter.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AAEjC,MAAa,SAAS;IAGlB,MAAM,KAAK,MAAM;QACb,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC9B,CAAC;;AALL,8BAMC;AALkB,kBAAQ,GAAG,IAAA,gBAAM,GAAE,CAAC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Injector = void 0;
|
4
|
+
const Design_1 = require("../types/enums/Design");
|
5
|
+
class Injector {
|
6
|
+
static inject(target) {
|
7
|
+
const params = Reflect.getMetadata(Design_1.Design.ParamTypes, target);
|
8
|
+
if (!params) {
|
9
|
+
return new target();
|
10
|
+
}
|
11
|
+
const paramsInstances = [];
|
12
|
+
for (let i = 0; params.length > i; i++) {
|
13
|
+
const hasParams = !!Reflect.getMetadata(Design_1.Design.ParamTypes, params[i]);
|
14
|
+
if (!hasParams) {
|
15
|
+
paramsInstances.push(new params[i]());
|
16
|
+
continue;
|
17
|
+
}
|
18
|
+
paramsInstances.push(Injector.inject(params[i]));
|
19
|
+
}
|
20
|
+
return new target(...paramsInstances);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
exports.Injector = Injector;
|
24
|
+
//# sourceMappingURL=Injector.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Injector.js","sourceRoot":"","sources":["../../src/classes/Injector.ts"],"names":[],"mappings":";;;AAAA,kDAA+C;AAE/C,MAAa,QAAQ;IACjB,MAAM,CAAC,MAAM,CAAC,MAAW;QACrB,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,eAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAE9D,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,OAAO,IAAI,MAAM,EAAE,CAAC;QACxB,CAAC;QAED,MAAM,eAAe,GAAe,EAAE,CAAC;QAEvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,MAAM,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC,WAAW,CACnC,eAAM,CAAC,UAAU,EACjB,MAAM,CAAC,CAAC,CAAC,CACZ,CAAC;YAEF,IAAI,CAAC,SAAS,EAAE,CAAC;gBACb,eAAe,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBACtC,SAAS;YACb,CAAC;YAED,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,IAAI,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC;IAC1C,CAAC;CACJ;AA1BD,4BA0BC"}
|
@@ -0,0 +1,32 @@
|
|
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
|
+
exports.Server = void 0;
|
7
|
+
const enums_1 = require("../types/enums");
|
8
|
+
const express_1 = __importDefault(require("express"));
|
9
|
+
class Server {
|
10
|
+
constructor() {
|
11
|
+
this.app = (0, express_1.default)();
|
12
|
+
this.setupControllers();
|
13
|
+
}
|
14
|
+
start(port = 3000) {
|
15
|
+
this.app.listen(port, () => {
|
16
|
+
console.log(`Application running on port ${port} 🟢`);
|
17
|
+
});
|
18
|
+
}
|
19
|
+
use(...handlers) {
|
20
|
+
this.app.use(handlers);
|
21
|
+
}
|
22
|
+
setupControllers() {
|
23
|
+
const controllers = Reflect.getMetadata(enums_1.ServerConfigsParams.Controllers, Server);
|
24
|
+
this.use(express_1.default.json());
|
25
|
+
controllers.forEach((controller) => {
|
26
|
+
const router = Reflect.getMetadata(enums_1.ServerConfigsParams.Router, controller);
|
27
|
+
this.use(router);
|
28
|
+
});
|
29
|
+
}
|
30
|
+
}
|
31
|
+
exports.Server = Server;
|
32
|
+
//# sourceMappingURL=Server.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Server.js","sourceRoot":"","sources":["../../src/classes/Server.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAqD;AACrD,sDAAyE;AAEzE,MAAa,MAAM;IAGf;QAFiB,QAAG,GAAgB,IAAA,iBAAO,GAAE,CAAC;QAG1C,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,OAAe,IAAI;QACrB,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;YACvB,OAAO,CAAC,GAAG,CAAC,+BAA+B,IAAI,KAAK,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACP,CAAC;IAED,GAAG,CAAC,GAAG,QAA0B;QAC7B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAEO,gBAAgB;QACpB,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CACnC,2BAAmB,CAAC,WAAW,EAC/B,MAAM,CACT,CAAC;QAEF,IAAI,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAEzB,WAAW,CAAC,OAAO,CAAC,CAAC,UAAe,EAAE,EAAE;YACpC,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAC9B,2BAAmB,CAAC,MAAM,EAC1B,UAAU,CACb,CAAC;YACF,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAjCD,wBAiCC"}
|
package/classes/index.js
ADDED
@@ -0,0 +1,20 @@
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./AppRouter"), exports);
|
18
|
+
__exportStar(require("./Server"), exports);
|
19
|
+
__exportStar(require("./Injector"), exports);
|
20
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/classes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB;AACzB,6CAA2B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function Controller(path: string): (target: any) => void;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Controller = Controller;
|
4
|
+
const classes_1 = require("../classes");
|
5
|
+
const AppRouter_1 = require("../classes/AppRouter");
|
6
|
+
const enums_1 = require("../types/enums");
|
7
|
+
const ServerConfigsParams_1 = require("../types/enums/ServerConfigsParams");
|
8
|
+
function Controller(path) {
|
9
|
+
const router = AppRouter_1.AppRouter.router;
|
10
|
+
return function (target) {
|
11
|
+
const instance = classes_1.Injector.inject(target);
|
12
|
+
const prototype = Object.getPrototypeOf(instance);
|
13
|
+
const [, ..._actionsNames] = Object.getOwnPropertyNames(prototype);
|
14
|
+
_actionsNames.forEach((_actionName) => {
|
15
|
+
var _a, _b, _c;
|
16
|
+
const _method = (_a = Reflect.getOwnMetadata(_actionName, prototype, enums_1.ControllerMethodsParams.Method)) !== null && _a !== void 0 ? _a : '';
|
17
|
+
const controllerGlobalMiddleware = Reflect.getMetadata(ServerConfigsParams_1.ServerConfigsParams.GlobalMiddleware, target);
|
18
|
+
const _middlewares = (_b = Reflect.getOwnMetadata(_actionName, prototype, enums_1.ControllerMethodsParams.Middleware)) !== null && _b !== void 0 ? _b : [];
|
19
|
+
const _path = (_c = Reflect.getOwnMetadata(_actionName, prototype, enums_1.ControllerMethodsParams.Path)) !== null && _c !== void 0 ? _c : '';
|
20
|
+
router[_method](`${path}${_path}`, controllerGlobalMiddleware, _middlewares, instance[_actionName]);
|
21
|
+
});
|
22
|
+
Reflect.defineMetadata(ServerConfigsParams_1.ServerConfigsParams.Router, router, target);
|
23
|
+
appendController(target);
|
24
|
+
};
|
25
|
+
}
|
26
|
+
function appendController(controller) {
|
27
|
+
const prevControllers = Reflect.getMetadata(ServerConfigsParams_1.ServerConfigsParams.Controllers, classes_1.Server) || [];
|
28
|
+
Reflect.defineMetadata(ServerConfigsParams_1.ServerConfigsParams.Controllers, [...prevControllers, controller], classes_1.Server);
|
29
|
+
}
|
30
|
+
//# sourceMappingURL=controller.decorator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"controller.decorator.js","sourceRoot":"","sources":["../../src/decorators/controller.decorator.ts"],"names":[],"mappings":";;AAKA,gCA8CC;AAnDD,wCAA8C;AAC9C,oDAAiD;AACjD,0CAAyD;AACzD,4EAAyE;AAEzE,SAAgB,UAAU,CAAC,IAAY;IACnC,MAAM,MAAM,GAAQ,qBAAS,CAAC,MAAM,CAAC;IAErC,OAAO,UAAU,MAAW;QACxB,MAAM,QAAQ,GAAG,kBAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAClD,MAAM,CAAC,EAAE,GAAG,aAAa,CAAC,GAAG,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAEnE,aAAa,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;;YAClC,MAAM,OAAO,GACT,MAAA,OAAO,CAAC,cAAc,CAClB,WAAW,EACX,SAAS,EACT,+BAAuB,CAAC,MAAM,CACjC,mCAAI,EAAE,CAAC;YAEZ,MAAM,0BAA0B,GAAG,OAAO,CAAC,WAAW,CAClD,yCAAmB,CAAC,gBAAgB,EACpC,MAAM,CACT,CAAC;YAEF,MAAM,YAAY,GACd,MAAA,OAAO,CAAC,cAAc,CAClB,WAAW,EACX,SAAS,EACT,+BAAuB,CAAC,UAAU,CACrC,mCAAI,EAAE,CAAC;YAEZ,MAAM,KAAK,GACP,MAAA,OAAO,CAAC,cAAc,CAClB,WAAW,EACX,SAAS,EACT,+BAAuB,CAAC,IAAI,CAC/B,mCAAI,EAAE,CAAC;YAEZ,MAAM,CAAC,OAAO,CAAC,CACX,GAAG,IAAI,GAAG,KAAK,EAAE,EACjB,0BAA0B,EAC1B,YAAY,EACZ,QAAQ,CAAC,WAAW,CAAC,CACxB,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,cAAc,CAAC,yCAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACnE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC;AACN,CAAC;AAED,SAAS,gBAAgB,CAAC,UAAe;IACrC,MAAM,eAAe,GACjB,OAAO,CAAC,WAAW,CAAC,yCAAmB,CAAC,WAAW,EAAE,gBAAM,CAAC,IAAI,EAAE,CAAC;IAEvE,OAAO,CAAC,cAAc,CAClB,yCAAmB,CAAC,WAAW,EAC/B,CAAC,GAAG,eAAe,EAAE,UAAU,CAAC,EAChC,gBAAM,CACT,CAAC;AACN,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GlobalMiddleware = GlobalMiddleware;
|
4
|
+
const ServerConfigsParams_1 = require("../types/enums/ServerConfigsParams");
|
5
|
+
function GlobalMiddleware(handlers) {
|
6
|
+
return function (target) {
|
7
|
+
Reflect.defineMetadata(ServerConfigsParams_1.ServerConfigsParams.GlobalMiddleware, handlers, target);
|
8
|
+
};
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=global-middleware.decorator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"global-middleware.decorator.js","sourceRoot":"","sources":["../../src/decorators/global-middleware.decorator.ts"],"names":[],"mappings":";;AAGA,4CAQC;AAXD,4EAAyE;AAGzE,SAAgB,gBAAgB,CAAC,QAA0B;IACvD,OAAO,UAAU,MAAW;QACxB,OAAO,CAAC,cAAc,CAClB,yCAAmB,CAAC,gBAAgB,EACpC,QAAQ,EACR,MAAM,CACT,CAAC;IACN,CAAC,CAAC;AACN,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export declare const Get: (path?: string) => (target: any, propertyKey: string) => void;
|
2
|
+
export declare const Post: (path?: string) => (target: any, propertyKey: string) => void;
|
3
|
+
export declare const Put: (path?: string) => (target: any, propertyKey: string) => void;
|
4
|
+
export declare const Patch: (path?: string) => (target: any, propertyKey: string) => void;
|
5
|
+
export declare const Delete: (path?: string) => (target: any, propertyKey: string) => void;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Delete = exports.Patch = exports.Put = exports.Post = exports.Get = void 0;
|
4
|
+
const enums_1 = require("../types/enums");
|
5
|
+
function createHttpMethod(method) {
|
6
|
+
return function (path) {
|
7
|
+
return function (target, propertyKey) {
|
8
|
+
Reflect.defineMetadata(propertyKey, method, target, enums_1.ControllerMethodsParams.Method);
|
9
|
+
Reflect.defineMetadata(propertyKey, path, target, enums_1.ControllerMethodsParams.Path);
|
10
|
+
};
|
11
|
+
};
|
12
|
+
}
|
13
|
+
exports.Get = createHttpMethod(enums_1.HttpMethods.Get);
|
14
|
+
exports.Post = createHttpMethod(enums_1.HttpMethods.Post);
|
15
|
+
exports.Put = createHttpMethod(enums_1.HttpMethods.Put);
|
16
|
+
exports.Patch = createHttpMethod(enums_1.HttpMethods.Patch);
|
17
|
+
exports.Delete = createHttpMethod(enums_1.HttpMethods.Delete);
|
18
|
+
//# sourceMappingURL=http-methods.decorator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"http-methods.decorator.js","sourceRoot":"","sources":["../../src/decorators/http-methods.decorator.ts"],"names":[],"mappings":";;;AAAA,0CAAsE;AAEtE,SAAS,gBAAgB,CAAC,MAAmB;IACzC,OAAO,UAAU,IAAa;QAC1B,OAAO,UAAU,MAAW,EAAE,WAAmB;YAC7C,OAAO,CAAC,cAAc,CAClB,WAAW,EACX,MAAM,EACN,MAAM,EACN,+BAAuB,CAAC,MAAM,CACjC,CAAC;YACF,OAAO,CAAC,cAAc,CAClB,WAAW,EACX,IAAI,EACJ,MAAM,EACN,+BAAuB,CAAC,IAAI,CAC/B,CAAC;QACN,CAAC,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAEY,QAAA,GAAG,GAAG,gBAAgB,CAAC,mBAAW,CAAC,GAAG,CAAC,CAAC;AACxC,QAAA,IAAI,GAAG,gBAAgB,CAAC,mBAAW,CAAC,IAAI,CAAC,CAAC;AAC1C,QAAA,GAAG,GAAG,gBAAgB,CAAC,mBAAW,CAAC,GAAG,CAAC,CAAC;AACxC,QAAA,KAAK,GAAG,gBAAgB,CAAC,mBAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,QAAA,MAAM,GAAG,gBAAgB,CAAC,mBAAW,CAAC,MAAM,CAAC,CAAC"}
|
@@ -0,0 +1,22 @@
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./http-methods.decorator"), exports);
|
18
|
+
__exportStar(require("./controller.decorator"), exports);
|
19
|
+
__exportStar(require("./middleware.decorator"), exports);
|
20
|
+
__exportStar(require("./global-middleware.decorator"), exports);
|
21
|
+
__exportStar(require("./inject.decorator"), exports);
|
22
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,yDAAuC;AACvC,yDAAuC;AACvC,gEAA8C;AAC9C,qDAAmC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function Inject(): (_target: any) => void;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"inject.decorator.js","sourceRoot":"","sources":["../../src/decorators/inject.decorator.ts"],"names":[],"mappings":";;AAAA,wBAEC;AAFD,SAAgB,MAAM;IAClB,OAAO,UAAU,OAAY,IAAG,CAAC,CAAC;AACtC,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Middleware = Middleware;
|
4
|
+
const enums_1 = require("../types/enums");
|
5
|
+
function Middleware(handlers) {
|
6
|
+
return function (target, propertyKey) {
|
7
|
+
Reflect.defineMetadata(propertyKey, handlers, target, enums_1.ControllerMethodsParams.Middleware);
|
8
|
+
};
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=middleware.decorator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"middleware.decorator.js","sourceRoot":"","sources":["../../src/decorators/middleware.decorator.ts"],"names":[],"mappings":";;AAGA,gCASC;AAZD,0CAAyD;AAGzD,SAAgB,UAAU,CAAC,QAA0B;IACjD,OAAO,UAAU,MAAW,EAAE,WAAmB;QAC7C,OAAO,CAAC,cAAc,CAClB,WAAW,EACX,QAAQ,EACR,MAAM,EACN,+BAAuB,CAAC,UAAU,CACrC,CAAC;IACN,CAAC,CAAC;AACN,CAAC"}
|
package/index.d.ts
ADDED