routup 0.1.4 → 0.3.0-alpha.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/decorators/controller/index.d.ts +2 -0
- package/dist/decorators/controller/index.d.ts.map +1 -0
- package/dist/decorators/controller/index.js +24 -0
- package/dist/decorators/controller/index.js.map +1 -0
- package/dist/decorators/controller/module.d.ts +4 -0
- package/dist/decorators/controller/module.d.ts.map +1 -0
- package/dist/decorators/controller/module.js +29 -0
- package/dist/decorators/controller/module.js.map +1 -0
- package/dist/decorators/index.d.ts +5 -0
- package/dist/decorators/index.d.ts.map +1 -0
- package/dist/decorators/index.js +27 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/method/arguments.d.ts +4 -0
- package/dist/decorators/method/arguments.d.ts.map +1 -0
- package/dist/decorators/method/arguments.js +22 -0
- package/dist/decorators/method/arguments.js.map +1 -0
- package/dist/decorators/method/index.d.ts +4 -0
- package/dist/decorators/method/index.d.ts.map +1 -0
- package/dist/decorators/method/index.js +26 -0
- package/dist/decorators/method/index.js.map +1 -0
- package/dist/decorators/method/module.d.ts +8 -0
- package/dist/decorators/method/module.d.ts.map +1 -0
- package/dist/decorators/method/module.js +46 -0
- package/dist/decorators/method/module.js.map +1 -0
- package/dist/decorators/method/type.d.ts +7 -0
- package/dist/decorators/method/type.d.ts.map +1 -0
- package/dist/decorators/method/type.js +9 -0
- package/dist/decorators/method/type.js.map +1 -0
- package/dist/decorators/parameter/index.d.ts +3 -0
- package/dist/decorators/parameter/index.d.ts.map +1 -0
- package/dist/decorators/parameter/index.js +25 -0
- package/dist/decorators/parameter/index.js.map +1 -0
- package/dist/decorators/parameter/module.d.ts +10 -0
- package/dist/decorators/parameter/module.d.ts.map +1 -0
- package/dist/decorators/parameter/module.js +58 -0
- package/dist/decorators/parameter/module.js.map +1 -0
- package/dist/decorators/parameter/type.d.ts +8 -0
- package/dist/decorators/parameter/type.d.ts.map +1 -0
- package/dist/decorators/parameter/type.js +9 -0
- package/dist/decorators/parameter/type.js.map +1 -0
- package/dist/decorators/type.d.ts +14 -0
- package/dist/decorators/type.d.ts.map +1 -0
- package/dist/decorators/type.js +9 -0
- package/dist/decorators/type.js.map +1 -0
- package/dist/decorators/utils/index.d.ts +2 -0
- package/dist/decorators/utils/index.d.ts.map +1 -0
- package/dist/decorators/utils/index.js +24 -0
- package/dist/decorators/utils/index.js.map +1 -0
- package/dist/decorators/utils/meta.d.ts +3 -0
- package/dist/decorators/utils/meta.d.ts.map +1 -0
- package/dist/decorators/utils/meta.js +24 -0
- package/dist/decorators/utils/meta.js.map +1 -0
- package/dist/handler/index.d.ts +3 -0
- package/dist/handler/index.d.ts.map +1 -0
- package/dist/handler/index.js +25 -0
- package/dist/handler/index.js.map +1 -0
- package/dist/handler/type.d.ts +7 -0
- package/dist/handler/type.d.ts.map +1 -0
- package/dist/handler/type.js +3 -0
- package/dist/handler/type.js.map +1 -0
- package/dist/handler/utils.d.ts +5 -0
- package/dist/handler/utils.d.ts.map +1 -0
- package/dist/handler/utils.js +37 -0
- package/dist/handler/utils.js.map +1 -0
- package/dist/helpers/request/index.d.ts +2 -2
- package/dist/helpers/request/index.d.ts.map +1 -1
- package/dist/helpers/request/index.js +2 -2
- package/dist/helpers/request/index.js.map +1 -1
- package/dist/helpers/request/params.d.ts +5 -4
- package/dist/helpers/request/params.d.ts.map +1 -1
- package/dist/helpers/request/params.js +11 -1
- package/dist/helpers/request/params.js.map +1 -1
- package/dist/helpers/response/index.d.ts +0 -1
- package/dist/helpers/response/index.d.ts.map +1 -1
- package/dist/helpers/response/index.js +0 -1
- package/dist/helpers/response/index.js.map +1 -1
- package/dist/helpers/response/send-format.d.ts +6 -4
- package/dist/helpers/response/send-format.d.ts.map +1 -1
- package/dist/helpers/response/send-format.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/route/module.d.ts +2 -1
- package/dist/route/module.d.ts.map +1 -1
- package/dist/route/module.js.map +1 -1
- package/dist/router/module.d.ts +10 -7
- package/dist/router/module.d.ts.map +1 -1
- package/dist/router/module.js +81 -29
- package/dist/router/module.js.map +1 -1
- package/dist/type.d.ts +3 -6
- package/dist/type.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/helpers/request/body.d.ts +0 -5
- package/dist/helpers/request/body.d.ts.map +0 -1
- package/dist/helpers/request/body.js +0 -19
- package/dist/helpers/request/body.js.map +0 -1
- package/dist/helpers/response/body.d.ts +0 -7
- package/dist/helpers/response/body.d.ts.map +0 -1
- package/dist/helpers/response/body.js +0 -48
- package/dist/helpers/response/body.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/controller/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./module"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/controller/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,2CAAyB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ClassType } from '../../type';
|
|
2
|
+
export declare function createClassDecorator(url: string, middlewares?: ClassType[]): ClassDecorator;
|
|
3
|
+
export declare function DController(url: string, middlewares?: ClassType[]): ClassDecorator;
|
|
4
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/decorators/controller/module.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,wBAAgB,oBAAoB,CAChC,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,SAAS,EAAE,GACzB,cAAc,CAcjB;AAED,wBAAgB,WAAW,CACvB,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,SAAS,EAAE,GACzB,cAAc,CAEjB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022-2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DController = exports.createClassDecorator = void 0;
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
function createClassDecorator(url, middlewares) {
|
|
12
|
+
return (target) => {
|
|
13
|
+
const meta = (0, utils_1.useDecoratorMeta)(target.prototype);
|
|
14
|
+
meta.url = url;
|
|
15
|
+
meta.middlewares = [];
|
|
16
|
+
if (Array.isArray(middlewares)) {
|
|
17
|
+
meta.middlewares = [
|
|
18
|
+
...meta.middlewares,
|
|
19
|
+
...middlewares,
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
exports.createClassDecorator = createClassDecorator;
|
|
25
|
+
function DController(url, middlewares) {
|
|
26
|
+
return createClassDecorator(url, middlewares);
|
|
27
|
+
}
|
|
28
|
+
exports.DController = DController;
|
|
29
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/decorators/controller/module.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,oCAA4C;AAE5C,SAAgB,oBAAoB,CAChC,GAAW,EACX,WAAyB;IAEzB,OAAO,CAAC,MAAW,EAAS,EAAE;QAC1B,MAAM,IAAI,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAEhD,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QAEtB,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;YAC5B,IAAI,CAAC,WAAW,GAAG;gBACf,GAAG,IAAI,CAAC,WAAW;gBACnB,GAAG,WAAW;aACjB,CAAC;SACL;IACL,CAAC,CAAC;AACN,CAAC;AAjBD,oDAiBC;AAED,SAAgB,WAAW,CACvB,GAAW,EACX,WAAyB;IAEzB,OAAO,oBAAoB,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;AAClD,CAAC;AALD,kCAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAOA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022-2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./controller"), exports);
|
|
24
|
+
__exportStar(require("./method"), exports);
|
|
25
|
+
__exportStar(require("./parameter"), exports);
|
|
26
|
+
__exportStar(require("./type"), exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,2CAAyB;AACzB,8CAA4B;AAC5B,yCAAuB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Next, Request, Response } from '../../type';
|
|
2
|
+
import { DecoratorParameterOptions } from '../parameter';
|
|
3
|
+
export declare function buildDecoratorMethodArguments(req: Request, res: Response, next: Next, parameters: DecoratorParameterOptions[]): any[];
|
|
4
|
+
//# sourceMappingURL=arguments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arguments.d.ts","sourceRoot":"","sources":["../../../src/decorators/method/arguments.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,IAAI,EAAE,OAAO,EAAE,QAAQ,EAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzD,wBAAgB,6BAA6B,CACzC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,yBAAyB,EAAE,GACxC,GAAG,EAAE,CAmBP"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildDecoratorMethodArguments = void 0;
|
|
4
|
+
function buildDecoratorMethodArguments(req, res, next, parameters) {
|
|
5
|
+
/* istanbul ignore next */
|
|
6
|
+
if (parameters.length === 0) {
|
|
7
|
+
return [req, res, next];
|
|
8
|
+
}
|
|
9
|
+
const items = [];
|
|
10
|
+
for (let i = 0; i < parameters.length; i++) {
|
|
11
|
+
const parameter = parameters[i];
|
|
12
|
+
if (typeof parameter.property === 'string') {
|
|
13
|
+
items[parameter.index] = parameter.build(req, res, next, parameter.property);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
items[parameter.index] = parameter.build(req, res, next);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return items;
|
|
20
|
+
}
|
|
21
|
+
exports.buildDecoratorMethodArguments = buildDecoratorMethodArguments;
|
|
22
|
+
//# sourceMappingURL=arguments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arguments.js","sourceRoot":"","sources":["../../../src/decorators/method/arguments.ts"],"names":[],"mappings":";;;AAWA,SAAgB,6BAA6B,CACzC,GAAY,EACZ,GAAa,EACb,IAAU,EACV,UAAuC;IAEvC,0BAA0B;IAC1B,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;QACzB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;KAC3B;IAED,MAAM,KAAK,GAAU,EAAE,CAAC;IAExB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAEhC,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,QAAQ,EAAE;YACxC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;SAChF;aAAM;YACH,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;SAC5D;KACJ;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAxBD,sEAwBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/method/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./arguments"), exports);
|
|
24
|
+
__exportStar(require("./module"), exports);
|
|
25
|
+
__exportStar(require("./type"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/method/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,8CAA4B;AAC5B,2CAAyB;AACzB,yCAAuB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ClassType } from '../../type';
|
|
2
|
+
export declare function createMethodDecorator(method: string, url: string, handlers?: ClassType[]): MethodDecorator;
|
|
3
|
+
export declare function DDelete(url: string, handlers?: ClassType[]): MethodDecorator;
|
|
4
|
+
export declare function DGet(url: string, handlers?: ClassType[]): MethodDecorator;
|
|
5
|
+
export declare function DPost(url: string, handlers?: ClassType[]): MethodDecorator;
|
|
6
|
+
export declare function DPut(url: string, handlers?: ClassType[]): MethodDecorator;
|
|
7
|
+
export declare function DPatch(url: string, handlers?: ClassType[]): MethodDecorator;
|
|
8
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/decorators/method/module.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,wBAAgB,qBAAqB,CACjC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,SAAS,EAAE,GACtB,eAAe,CAmBlB;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAI,eAAe,CAE7E;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAI,eAAe,CAE1E;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAI,eAAe,CAE3E;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAI,eAAe,CAE1E;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAI,eAAe,CAE5E"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022-2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DPatch = exports.DPut = exports.DPost = exports.DGet = exports.DDelete = exports.createMethodDecorator = void 0;
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
function createMethodDecorator(method, url, handlers) {
|
|
12
|
+
return (target, propertyKey, descriptor) => {
|
|
13
|
+
/* istanbul ignore next */
|
|
14
|
+
if (typeof propertyKey !== 'string') {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const meta = (0, utils_1.useDecoratorMeta)(target);
|
|
18
|
+
meta.methods[propertyKey] = {
|
|
19
|
+
method,
|
|
20
|
+
url,
|
|
21
|
+
middlewares: handlers || [],
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
exports.createMethodDecorator = createMethodDecorator;
|
|
26
|
+
function DDelete(url, handlers) {
|
|
27
|
+
return createMethodDecorator('delete', url, handlers);
|
|
28
|
+
}
|
|
29
|
+
exports.DDelete = DDelete;
|
|
30
|
+
function DGet(url, handlers) {
|
|
31
|
+
return createMethodDecorator('get', url, handlers);
|
|
32
|
+
}
|
|
33
|
+
exports.DGet = DGet;
|
|
34
|
+
function DPost(url, handlers) {
|
|
35
|
+
return createMethodDecorator('post', url, handlers);
|
|
36
|
+
}
|
|
37
|
+
exports.DPost = DPost;
|
|
38
|
+
function DPut(url, handlers) {
|
|
39
|
+
return createMethodDecorator('put', url, handlers);
|
|
40
|
+
}
|
|
41
|
+
exports.DPut = DPut;
|
|
42
|
+
function DPatch(url, handlers) {
|
|
43
|
+
return createMethodDecorator('patch', url, handlers);
|
|
44
|
+
}
|
|
45
|
+
exports.DPatch = DPatch;
|
|
46
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/decorators/method/module.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,oCAA4C;AAE5C,SAAgB,qBAAqB,CACjC,MAAc,EACd,GAAW,EACX,QAAsB;IAEtB,OAAO,CACH,MAAW,EACX,WAA4B,EAC5B,UAAwC,EACnC,EAAE;QACP,0BAA0B;QAC1B,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACjC,OAAO;SACV;QAED,MAAM,IAAI,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC;QAEtC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG;YACxB,MAAM;YACN,GAAG;YACH,WAAW,EAAE,QAAQ,IAAI,EAAE;SAC9B,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAvBD,sDAuBC;AAED,SAAgB,OAAO,CAAC,GAAW,EAAE,QAAsB;IACvD,OAAO,qBAAqB,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAFD,0BAEC;AAED,SAAgB,IAAI,CAAC,GAAW,EAAE,QAAsB;IACpD,OAAO,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AACvD,CAAC;AAFD,oBAEC;AAED,SAAgB,KAAK,CAAC,GAAW,EAAE,QAAsB;IACrD,OAAO,qBAAqB,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC;AAFD,sBAEC;AAED,SAAgB,IAAI,CAAC,GAAW,EAAE,QAAsB;IACpD,OAAO,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AACvD,CAAC;AAFD,oBAEC;AAED,SAAgB,MAAM,CAAC,GAAW,EAAE,QAAsB;IACtD,OAAO,qBAAqB,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AACzD,CAAC;AAFD,wBAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/decorators/method/type.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,oBAAY,sBAAsB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,SAAS,EAAE,CAAC;CAC5B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/decorators/method/type.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/parameter/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./module"), exports);
|
|
24
|
+
__exportStar(require("./type"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/parameter/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,yCAAuB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DecoratorParameterBuildFn } from './type';
|
|
2
|
+
export declare function createParameterDecorator(build: DecoratorParameterBuildFn): ((property?: string) => ParameterDecorator);
|
|
3
|
+
export declare function DRequest(): ParameterDecorator;
|
|
4
|
+
export declare function DResponse(): ParameterDecorator;
|
|
5
|
+
export declare function DNext(): ParameterDecorator;
|
|
6
|
+
export declare function DParams(): ParameterDecorator;
|
|
7
|
+
export declare function DParam(property: string): ParameterDecorator;
|
|
8
|
+
export declare function DHeaders(): ParameterDecorator;
|
|
9
|
+
export declare function DHeader(property: string): ParameterDecorator;
|
|
10
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/decorators/parameter/module.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,yBAAyB,EAAE,MAAM,QAAQ,CAAC;AAEnD,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,yBAAyB,GAChC,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,kBAAkB,CAAC,CAsB9C;AAED,wBAAgB,QAAQ,IAAK,kBAAkB,CAE9C;AAED,wBAAgB,SAAS,IAAK,kBAAkB,CAE/C;AAED,wBAAgB,KAAK,IAAK,kBAAkB,CAE3C;AAED,wBAAgB,OAAO,IAAK,kBAAkB,CAE7C;AAED,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAI,kBAAkB,CAE5D;AAED,wBAAgB,QAAQ,IAAK,kBAAkB,CAE9C;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAI,kBAAkB,CAE7D"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022-2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DHeader = exports.DHeaders = exports.DParam = exports.DParams = exports.DNext = exports.DResponse = exports.DRequest = exports.createParameterDecorator = void 0;
|
|
10
|
+
const helpers_1 = require("../../helpers");
|
|
11
|
+
const utils_1 = require("../utils");
|
|
12
|
+
function createParameterDecorator(build) {
|
|
13
|
+
return (property) => (target, propertyKey, parameterIndex) => {
|
|
14
|
+
/* istanbul ignore next */
|
|
15
|
+
if (typeof propertyKey !== 'string') {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const meta = (0, utils_1.useDecoratorMeta)(target);
|
|
19
|
+
if (typeof meta.parameters[propertyKey] === 'undefined') {
|
|
20
|
+
meta.parameters[propertyKey] = [];
|
|
21
|
+
}
|
|
22
|
+
meta.parameters[propertyKey].push({
|
|
23
|
+
index: parameterIndex,
|
|
24
|
+
property,
|
|
25
|
+
build,
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
exports.createParameterDecorator = createParameterDecorator;
|
|
30
|
+
function DRequest() {
|
|
31
|
+
return createParameterDecorator((req) => req)();
|
|
32
|
+
}
|
|
33
|
+
exports.DRequest = DRequest;
|
|
34
|
+
function DResponse() {
|
|
35
|
+
return createParameterDecorator((req, res) => res)();
|
|
36
|
+
}
|
|
37
|
+
exports.DResponse = DResponse;
|
|
38
|
+
function DNext() {
|
|
39
|
+
return createParameterDecorator((req, res, next) => next)();
|
|
40
|
+
}
|
|
41
|
+
exports.DNext = DNext;
|
|
42
|
+
function DParams() {
|
|
43
|
+
return createParameterDecorator((req, res, next) => (0, helpers_1.useRequestParams)(req))();
|
|
44
|
+
}
|
|
45
|
+
exports.DParams = DParams;
|
|
46
|
+
function DParam(property) {
|
|
47
|
+
return createParameterDecorator((req, res, next) => (0, helpers_1.useRequestParam)(req, property))(property);
|
|
48
|
+
}
|
|
49
|
+
exports.DParam = DParam;
|
|
50
|
+
function DHeaders() {
|
|
51
|
+
return createParameterDecorator((req, res, next) => req.headers)();
|
|
52
|
+
}
|
|
53
|
+
exports.DHeaders = DHeaders;
|
|
54
|
+
function DHeader(property) {
|
|
55
|
+
return createParameterDecorator((req, res, next) => req.headers[property])(property);
|
|
56
|
+
}
|
|
57
|
+
exports.DHeader = DHeader;
|
|
58
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/decorators/parameter/module.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAAkE;AAClE,oCAA4C;AAG5C,SAAgB,wBAAwB,CACpC,KAAgC;IAEhC,OAAO,CAAC,QAAiB,EAAE,EAAE,CAAC,CAC1B,MAAW,EACX,WAA4B,EAC5B,cAAsB,EACxB,EAAE;QACA,0BAA0B;QAC1B,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACjC,OAAO;SACV;QAED,MAAM,IAAI,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC;QACtC,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,WAAW,EAAE;YACrD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;SACrC;QAED,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;YAC9B,KAAK,EAAE,cAAc;YACrB,QAAQ;YACR,KAAK;SACR,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAxBD,4DAwBC;AAED,SAAgB,QAAQ;IACpB,OAAO,wBAAwB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;AACpD,CAAC;AAFD,4BAEC;AAED,SAAgB,SAAS;IACrB,OAAO,wBAAwB,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;AACzD,CAAC;AAFD,8BAEC;AAED,SAAgB,KAAK;IACjB,OAAO,wBAAwB,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;AAChE,CAAC;AAFD,sBAEC;AAED,SAAgB,OAAO;IACnB,OAAO,wBAAwB,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAgB,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AACjF,CAAC;AAFD,0BAEC;AAED,SAAgB,MAAM,CAAC,QAAgB;IACnC,OAAO,wBAAwB,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,yBAAe,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAClG,CAAC;AAFD,wBAEC;AAED,SAAgB,QAAQ;IACpB,OAAO,wBAAwB,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;AACvE,CAAC;AAFD,4BAEC;AAED,SAAgB,OAAO,CAAC,QAAgB;IACpC,OAAO,wBAAwB,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AACzF,CAAC;AAFD,0BAEC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Next, Request, Response } from '../../type';
|
|
2
|
+
export declare type DecoratorParameterBuildFn = (req: Request, res: Response, next: Next, property?: string) => any;
|
|
3
|
+
export declare type DecoratorParameterOptions = {
|
|
4
|
+
index: number;
|
|
5
|
+
build: DecoratorParameterBuildFn;
|
|
6
|
+
property?: string;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/decorators/parameter/type.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAErD,oBAAY,yBAAyB,GAAG,CACpC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,IAAI,EACV,QAAQ,CAAC,EAAE,MAAM,KAChB,GAAG,CAAC;AAET,oBAAY,yBAAyB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,yBAAyB,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/decorators/parameter/type.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ClassType } from '../type';
|
|
2
|
+
import { DecoratorMethodOptions } from './method';
|
|
3
|
+
import { DecoratorParameterOptions } from './parameter';
|
|
4
|
+
export declare type DecoratorMeta = {
|
|
5
|
+
url: string;
|
|
6
|
+
methods: {
|
|
7
|
+
[key: string]: DecoratorMethodOptions;
|
|
8
|
+
};
|
|
9
|
+
middlewares: ClassType[];
|
|
10
|
+
parameters: {
|
|
11
|
+
[key: string]: DecoratorParameterOptions[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/decorators/type.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExD,oBAAY,aAAa,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IAEZ,OAAO,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,sBAAsB,CAAA;KACxC,CAAC;IAEF,WAAW,EAAE,SAAS,EAAE,CAAC;IAEzB,UAAU,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,yBAAyB,EAAE,CAAA;KAC7C,CAAA;CACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022-2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/decorators/type.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/utils/index.ts"],"names":[],"mappings":"AAOA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./meta"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/utils/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,yCAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/decorators/utils/meta.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAI,aAAa,CAa3E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.useDecoratorMeta = void 0;
|
|
10
|
+
const symbol = Symbol.for('DecoratorMeta');
|
|
11
|
+
function useDecoratorMeta(clazz) {
|
|
12
|
+
if (symbol in clazz) {
|
|
13
|
+
return clazz[symbol];
|
|
14
|
+
}
|
|
15
|
+
clazz[symbol] = {
|
|
16
|
+
url: '',
|
|
17
|
+
middlewares: [],
|
|
18
|
+
methods: {},
|
|
19
|
+
parameters: {},
|
|
20
|
+
};
|
|
21
|
+
return clazz[symbol];
|
|
22
|
+
}
|
|
23
|
+
exports.useDecoratorMeta = useDecoratorMeta;
|
|
24
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/decorators/utils/meta.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAIH,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAE3C,SAAgB,gBAAgB,CAAC,KAA0B;IACvD,IAAI,MAAM,IAAI,KAAK,EAAE;QACjB,OAAQ,KAAa,CAAC,MAAM,CAAC,CAAC;KACjC;IAEA,KAAa,CAAC,MAAM,CAAC,GAAG;QACrB,GAAG,EAAE,EAAE;QACP,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACA,CAAC;IAEnB,OAAQ,KAAa,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAbD,4CAaC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/handler/index.ts"],"names":[],"mappings":"AAOA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./type"), exports);
|
|
24
|
+
__exportStar(require("./utils"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/handler/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,yCAAuB;AACvB,0CAAwB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Next, Request, Response } from '../type';
|
|
2
|
+
export declare type Handler = (req: Request, res: Response, next: Next) => unknown;
|
|
3
|
+
export declare type ErrorHandler = (err: Error, req: Request, res: Response, next: Next) => unknown;
|
|
4
|
+
export interface HandlerInterface {
|
|
5
|
+
run(request: Request, response: Response, next: Next): Promise<void> | void;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/handler/type.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAElD,oBAAY,OAAO,GAAG,CAClB,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,IAAI,KACT,OAAO,CAAC;AAEb,oBAAY,YAAY,GAAG,CACvB,GAAG,EAAE,KAAK,EACV,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,IAAI,KACT,OAAO,CAAC;AAEb,MAAM,WAAW,gBAAgB;IAC7B,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/handler/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Handler, HandlerInterface } from './type';
|
|
2
|
+
import { ClassType } from '../type';
|
|
3
|
+
export declare function isHandlerClassInstance(input: unknown): input is HandlerInterface;
|
|
4
|
+
export declare function createHandlerForClassType(item: ClassType): Handler;
|
|
5
|
+
//# sourceMappingURL=utils.d.ts.map
|