@pristine-ts/networking 0.0.164 → 0.0.168
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/lib/cjs/decorators/body.decorator.js +20 -1
- package/dist/lib/cjs/decorators/body.decorator.js.map +1 -1
- package/dist/lib/cjs/decorators/controller.decorator.js +13 -1
- package/dist/lib/cjs/decorators/controller.decorator.js.map +1 -1
- package/dist/lib/cjs/decorators/decorators.js +1 -1
- package/dist/lib/cjs/decorators/decorators.js.map +1 -1
- package/dist/lib/cjs/decorators/headers.decorator.js +20 -1
- package/dist/lib/cjs/decorators/headers.decorator.js.map +1 -1
- package/dist/lib/cjs/decorators/identity.decorator.js +20 -1
- package/dist/lib/cjs/decorators/identity.decorator.js.map +1 -1
- package/dist/lib/cjs/decorators/query-parameter.decorator.js +22 -1
- package/dist/lib/cjs/decorators/query-parameter.decorator.js.map +1 -1
- package/dist/lib/cjs/decorators/query-parameters.decorator.js +20 -1
- package/dist/lib/cjs/decorators/query-parameters.decorator.js.map +1 -1
- package/dist/lib/cjs/decorators/request.decorator.js +20 -1
- package/dist/lib/cjs/decorators/request.decorator.js.map +1 -1
- package/dist/lib/cjs/decorators/response-header.decorator.js +24 -2
- package/dist/lib/cjs/decorators/response-header.decorator.js.map +1 -1
- package/dist/lib/cjs/decorators/route-parameter.decorator.js +21 -1
- package/dist/lib/cjs/decorators/route-parameter.decorator.js.map +1 -1
- package/dist/lib/cjs/decorators/route.decorator.js +21 -1
- package/dist/lib/cjs/decorators/route.decorator.js.map +1 -1
- package/dist/lib/cjs/enrichers/router-response.enricher.js +4 -0
- package/dist/lib/cjs/enrichers/router-response.enricher.js.map +1 -1
- package/dist/lib/cjs/errors/errors.js +3 -1
- package/dist/lib/cjs/errors/errors.js.map +1 -1
- package/dist/lib/cjs/errors/http.error.js +1 -1
- package/dist/lib/cjs/errors/http.error.js.map +1 -1
- package/dist/lib/cjs/errors/method-router-adding.error.js +25 -0
- package/dist/lib/cjs/errors/method-router-adding.error.js.map +1 -0
- package/dist/lib/cjs/errors/path-router-adding.error.js +3 -2
- package/dist/lib/cjs/errors/path-router-adding.error.js.map +1 -1
- package/dist/lib/cjs/errors/path-router-instantiation.error.js +3 -2
- package/dist/lib/cjs/errors/path-router-instantiation.error.js.map +1 -1
- package/dist/lib/cjs/interfaces/interfaces.js +2 -2
- package/dist/lib/cjs/interfaces/interfaces.js.map +1 -1
- package/dist/lib/cjs/models/models.js +0 -1
- package/dist/lib/cjs/models/models.js.map +1 -1
- package/dist/lib/cjs/models/request.js +10 -4
- package/dist/lib/cjs/models/request.js.map +1 -1
- package/dist/lib/cjs/models/response.js +6 -0
- package/dist/lib/cjs/models/response.js.map +1 -1
- package/dist/lib/cjs/models/route.js +4 -0
- package/dist/lib/cjs/models/route.js.map +1 -1
- package/dist/lib/cjs/networking.module.js +0 -6
- package/dist/lib/cjs/networking.module.js.map +1 -1
- package/dist/lib/cjs/nodes/method-router.node.js +19 -4
- package/dist/lib/cjs/nodes/method-router.node.js.map +1 -1
- package/dist/lib/cjs/nodes/path-router.node.js +22 -12
- package/dist/lib/cjs/nodes/path-router.node.js.map +1 -1
- package/dist/lib/cjs/resolvers/body-parameter-decorator.resolver.js +18 -0
- package/dist/lib/cjs/resolvers/body-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/cjs/resolvers/controller-method-parameter-decorator.resolver.js +14 -0
- package/dist/lib/cjs/resolvers/controller-method-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/cjs/resolvers/headers-parameter-decorator.resolver.js +18 -0
- package/dist/lib/cjs/resolvers/headers-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/cjs/resolvers/identity-parameter-decorator.resolver.js +18 -0
- package/dist/lib/cjs/resolvers/identity-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/cjs/resolvers/query-parameter-decorator.resolver.js +19 -0
- package/dist/lib/cjs/resolvers/query-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/cjs/resolvers/query-parameters-decorator.resolver.js +18 -0
- package/dist/lib/cjs/resolvers/query-parameters-decorator.resolver.js.map +1 -1
- package/dist/lib/cjs/resolvers/request-parameter-decorator.resolver.js +18 -0
- package/dist/lib/cjs/resolvers/request-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/cjs/resolvers/route-parameter-decorator.resolver.js +18 -0
- package/dist/lib/cjs/resolvers/route-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/cjs/router.js +16 -0
- package/dist/lib/cjs/router.js.map +1 -1
- package/dist/lib/esm/decorators/body.decorator.js +20 -1
- package/dist/lib/esm/decorators/body.decorator.js.map +1 -1
- package/dist/lib/esm/decorators/controller.decorator.js +13 -1
- package/dist/lib/esm/decorators/controller.decorator.js.map +1 -1
- package/dist/lib/esm/decorators/decorators.js +1 -1
- package/dist/lib/esm/decorators/decorators.js.map +1 -1
- package/dist/lib/esm/decorators/headers.decorator.js +20 -1
- package/dist/lib/esm/decorators/headers.decorator.js.map +1 -1
- package/dist/lib/esm/decorators/identity.decorator.js +20 -1
- package/dist/lib/esm/decorators/identity.decorator.js.map +1 -1
- package/dist/lib/esm/decorators/query-parameter.decorator.js +22 -1
- package/dist/lib/esm/decorators/query-parameter.decorator.js.map +1 -1
- package/dist/lib/esm/decorators/query-parameters.decorator.js +20 -1
- package/dist/lib/esm/decorators/query-parameters.decorator.js.map +1 -1
- package/dist/lib/esm/decorators/request.decorator.js +20 -1
- package/dist/lib/esm/decorators/request.decorator.js.map +1 -1
- package/dist/lib/esm/decorators/response-header.decorator.js +24 -2
- package/dist/lib/esm/decorators/response-header.decorator.js.map +1 -1
- package/dist/lib/esm/decorators/route-parameter.decorator.js +21 -1
- package/dist/lib/esm/decorators/route-parameter.decorator.js.map +1 -1
- package/dist/lib/esm/decorators/route.decorator.js +21 -1
- package/dist/lib/esm/decorators/route.decorator.js.map +1 -1
- package/dist/lib/esm/enrichers/router-response.enricher.js +4 -0
- package/dist/lib/esm/enrichers/router-response.enricher.js.map +1 -1
- package/dist/lib/esm/errors/errors.js +3 -1
- package/dist/lib/esm/errors/errors.js.map +1 -1
- package/dist/lib/esm/errors/http.error.js +1 -1
- package/dist/lib/esm/errors/http.error.js.map +1 -1
- package/dist/lib/esm/errors/method-router-adding.error.js +21 -0
- package/dist/lib/esm/errors/method-router-adding.error.js.map +1 -0
- package/dist/lib/esm/errors/path-router-adding.error.js +3 -2
- package/dist/lib/esm/errors/path-router-adding.error.js.map +1 -1
- package/dist/lib/esm/errors/path-router-instantiation.error.js +3 -2
- package/dist/lib/esm/errors/path-router-instantiation.error.js.map +1 -1
- package/dist/lib/esm/interfaces/interfaces.js +2 -2
- package/dist/lib/esm/interfaces/interfaces.js.map +1 -1
- package/dist/lib/esm/models/models.js +0 -1
- package/dist/lib/esm/models/models.js.map +1 -1
- package/dist/lib/esm/models/request.js +10 -4
- package/dist/lib/esm/models/request.js.map +1 -1
- package/dist/lib/esm/models/response.js +6 -0
- package/dist/lib/esm/models/response.js.map +1 -1
- package/dist/lib/esm/models/route.js +4 -0
- package/dist/lib/esm/models/route.js.map +1 -1
- package/dist/lib/esm/networking.module.js +0 -6
- package/dist/lib/esm/networking.module.js.map +1 -1
- package/dist/lib/esm/nodes/method-router.node.js +19 -4
- package/dist/lib/esm/nodes/method-router.node.js.map +1 -1
- package/dist/lib/esm/nodes/path-router.node.js +22 -12
- package/dist/lib/esm/nodes/path-router.node.js.map +1 -1
- package/dist/lib/esm/resolvers/body-parameter-decorator.resolver.js +18 -0
- package/dist/lib/esm/resolvers/body-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/esm/resolvers/controller-method-parameter-decorator.resolver.js +14 -0
- package/dist/lib/esm/resolvers/controller-method-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/esm/resolvers/headers-parameter-decorator.resolver.js +18 -0
- package/dist/lib/esm/resolvers/headers-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/esm/resolvers/identity-parameter-decorator.resolver.js +18 -0
- package/dist/lib/esm/resolvers/identity-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/esm/resolvers/query-parameter-decorator.resolver.js +19 -0
- package/dist/lib/esm/resolvers/query-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/esm/resolvers/query-parameters-decorator.resolver.js +18 -0
- package/dist/lib/esm/resolvers/query-parameters-decorator.resolver.js.map +1 -1
- package/dist/lib/esm/resolvers/request-parameter-decorator.resolver.js +18 -0
- package/dist/lib/esm/resolvers/request-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/esm/resolvers/route-parameter-decorator.resolver.js +18 -0
- package/dist/lib/esm/resolvers/route-parameter-decorator.resolver.js.map +1 -1
- package/dist/lib/esm/router.js +16 -0
- package/dist/lib/esm/router.js.map +1 -1
- package/dist/types/decorators/body.decorator.d.ts +3 -0
- package/dist/types/decorators/controller.decorator.d.ts +4 -0
- package/dist/types/decorators/decorators.d.ts +1 -1
- package/dist/types/decorators/headers.decorator.d.ts +3 -0
- package/dist/types/decorators/identity.decorator.d.ts +3 -0
- package/dist/types/decorators/query-parameter.decorator.d.ts +4 -0
- package/dist/types/decorators/query-parameters.decorator.d.ts +3 -0
- package/dist/types/decorators/request.decorator.d.ts +3 -0
- package/dist/types/decorators/response-header.decorator.d.ts +7 -0
- package/dist/types/decorators/route-parameter.decorator.d.ts +4 -0
- package/dist/types/decorators/route.decorator.d.ts +6 -1
- package/dist/types/enrichers/router-response.enricher.d.ts +4 -0
- package/dist/types/errors/errors.d.ts +3 -1
- package/dist/types/errors/http.error.d.ts +1 -1
- package/dist/types/errors/method-router-adding.error.d.ts +10 -0
- package/dist/types/errors/path-router-adding.error.d.ts +4 -3
- package/dist/types/errors/path-router-instantiation.error.d.ts +4 -3
- package/dist/types/interfaces/controller-method-parameter-decorator-resolver.interface.d.ts +19 -2
- package/dist/types/interfaces/interfaces.d.ts +2 -2
- package/dist/types/interfaces/parameter-decorator.interface.d.ts +4 -0
- package/dist/types/interfaces/query-parameters-decorator.interface.d.ts +4 -0
- package/dist/types/interfaces/route-parameter-decorator.interface.d.ts +1 -1
- package/dist/types/interfaces/router.interface.d.ts +2 -2
- package/dist/types/models/models.d.ts +0 -1
- package/dist/types/models/request.d.ts +16 -4
- package/dist/types/models/response.d.ts +15 -0
- package/dist/types/models/route.d.ts +4 -0
- package/dist/types/nodes/method-router.node.d.ts +17 -4
- package/dist/types/nodes/path-router.node.d.ts +11 -7
- package/dist/types/nodes/router.node.d.ts +3 -3
- package/dist/types/resolvers/body-parameter-decorator.resolver.d.ts +22 -2
- package/dist/types/resolvers/controller-method-parameter-decorator.resolver.d.ts +14 -0
- package/dist/types/resolvers/headers-parameter-decorator.resolver.d.ts +22 -2
- package/dist/types/resolvers/identity-parameter-decorator.resolver.d.ts +22 -2
- package/dist/types/resolvers/query-parameter-decorator.resolver.d.ts +23 -2
- package/dist/types/resolvers/query-parameters-decorator.resolver.d.ts +22 -2
- package/dist/types/resolvers/request-parameter-decorator.resolver.d.ts +22 -2
- package/dist/types/resolvers/route-parameter-decorator.resolver.d.ts +22 -2
- package/dist/types/router.d.ts +12 -0
- package/package.json +5 -5
- package/dist/lib/cjs/enums/enums.js +0 -1
- package/dist/lib/cjs/enums/enums.js.map +0 -1
- package/dist/lib/cjs/models/error-response-body.js +0 -7
- package/dist/lib/cjs/models/error-response-body.js.map +0 -1
- package/dist/lib/esm/enums/enums.js +0 -1
- package/dist/lib/esm/enums/enums.js.map +0 -1
- package/dist/lib/esm/models/error-response-body.js +0 -3
- package/dist/lib/esm/models/error-response-body.js.map +0 -1
- package/dist/types/enums/enums.d.ts +0 -0
- package/dist/types/models/error-response-body.d.ts +0 -4
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.body = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The body decorator can be used to inject the body of a request in a parameter of a method in a controller.
|
|
6
|
+
*/
|
|
4
7
|
const body = () => {
|
|
5
|
-
return (
|
|
8
|
+
return (
|
|
9
|
+
/**
|
|
10
|
+
* The class on which the decorator is used.
|
|
11
|
+
*/
|
|
12
|
+
target,
|
|
13
|
+
/**
|
|
14
|
+
* The method on which the decorator is used.
|
|
15
|
+
*/
|
|
16
|
+
propertyKey,
|
|
17
|
+
/**
|
|
18
|
+
* The index of the parameter for which the decorator is used.
|
|
19
|
+
*/
|
|
20
|
+
parameterIndex) => {
|
|
21
|
+
// Verify that the object target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] exists or we create it.
|
|
22
|
+
// This object is a convention defined by Pristine on where to save controller method parameter decorator information and is used in the router to retrieve that information.
|
|
6
23
|
if (target.constructor.prototype.hasOwnProperty("__metadata__") === false) {
|
|
7
24
|
target.constructor.prototype["__metadata__"] = {};
|
|
8
25
|
}
|
|
@@ -15,9 +32,11 @@ const body = () => {
|
|
|
15
32
|
if (target.constructor.prototype["__metadata__"]["methods"][propertyKey].hasOwnProperty("arguments") === false) {
|
|
16
33
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] = [];
|
|
17
34
|
}
|
|
35
|
+
// Set the type of method parameter. Each parameter decorator has it's own type.
|
|
18
36
|
const methodParameter = {
|
|
19
37
|
type: "body"
|
|
20
38
|
};
|
|
39
|
+
// Save the method parameter with the proper parameter index (index of the parameter in the list of parameters of a method).
|
|
21
40
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"][parameterIndex] = methodParameter;
|
|
22
41
|
};
|
|
23
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/body.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"body.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/body.decorator.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,MAAM,IAAI,GAAG,GAAG,EAAE;IACrB,OAAO;IACH;;OAEG;IACH,MAAc;IAEd;;OAEG;IACH,WAA4B;IAE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QAAA,IAAI,QA2Cf"}
|
|
@@ -2,15 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.controller = exports.controllerRegistry = void 0;
|
|
4
4
|
exports.controllerRegistry = [];
|
|
5
|
+
/**
|
|
6
|
+
* The controller decorator can be used on a class to register this class as a controller in the router.
|
|
7
|
+
* @param basePath The base path for all the routes in the controller.
|
|
8
|
+
*/
|
|
5
9
|
const controller = (basePath) => {
|
|
6
|
-
return (
|
|
10
|
+
return (
|
|
11
|
+
/**
|
|
12
|
+
* The constructor of the class
|
|
13
|
+
*/
|
|
14
|
+
constructor) => {
|
|
15
|
+
// Verify that the object constructor.prototype["__metadata__"]["controller"][basePath] exists or we create it.
|
|
16
|
+
// This object is a convention defined by Pristine on where to save controller decorator information and is used in the router to retrieve that information.
|
|
7
17
|
if (constructor.prototype.hasOwnProperty("__metadata__") === false) {
|
|
8
18
|
constructor.prototype["__metadata__"] = {};
|
|
9
19
|
}
|
|
10
20
|
if (constructor.prototype["__metadata__"].hasOwnProperty("controller") === false) {
|
|
11
21
|
constructor.prototype["__metadata__"]["controller"] = {};
|
|
12
22
|
}
|
|
23
|
+
// Save the base path.
|
|
13
24
|
constructor.prototype["__metadata__"]["controller"]["basePath"] = basePath;
|
|
25
|
+
// Push the class prototype in the controllerRegistry that is used to instantiate all the controllers for the router.
|
|
14
26
|
exports.controllerRegistry.push(constructor.prototype);
|
|
15
27
|
};
|
|
16
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/controller.decorator.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"controller.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/controller.decorator.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAU,EAAE,CAAC;AAE5C;;;GAGG;AACI,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,EAAE;IAC3C,OAAO;IACH;;OAEG;IACH,WAAqB,EACvB,EAAE;QACA,+GAA+G;QAC/G,4JAA4J;QAC5J,IAAG,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,KAAK,KAAK,EAAE;YAC/D,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,CAAA;SAC7C;QAGD,IAAG,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,YAAY,CAAC,KAAK,KAAK,EAAE;YAC7E,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,CAAA;SAC3D;QAED,sBAAsB;QACtB,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;QAE3E,qHAAqH;QACrH,0BAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;IAClD,CAAC,CAAA;AACL,CAAC,CAAA;AAxBY,QAAA,UAAU,cAwBtB"}
|
|
@@ -12,8 +12,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./body.decorator"), exports);
|
|
14
14
|
__exportStar(require("./controller.decorator"), exports);
|
|
15
|
-
__exportStar(require("./identity.decorator"), exports);
|
|
16
15
|
__exportStar(require("./headers.decorator"), exports);
|
|
16
|
+
__exportStar(require("./identity.decorator"), exports);
|
|
17
17
|
__exportStar(require("./query-parameter.decorator"), exports);
|
|
18
18
|
__exportStar(require("./query-parameters.decorator"), exports);
|
|
19
19
|
__exportStar(require("./request.decorator"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../../src/decorators/decorators.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAiC;AACjC,yDAAuC;AACvC,uDAAqC;AACrC,
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../../src/decorators/decorators.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAiC;AACjC,yDAAuC;AACvC,sDAAoC;AACpC,uDAAqC;AACrC,8DAA4C;AAC5C,+DAA6C;AAC7C,sDAAoC;AACpC,8DAA4C;AAC5C,oDAAkC;AAClC,8DAA4C"}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.headers = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The headers decorator can be used to inject the headers of a request in a parameter of a method in a controller.
|
|
6
|
+
*/
|
|
4
7
|
const headers = () => {
|
|
5
|
-
return (
|
|
8
|
+
return (
|
|
9
|
+
/**
|
|
10
|
+
* The class on which the decorator is used.
|
|
11
|
+
*/
|
|
12
|
+
target,
|
|
13
|
+
/**
|
|
14
|
+
* The method on which the decorator is used.
|
|
15
|
+
*/
|
|
16
|
+
propertyKey,
|
|
17
|
+
/**
|
|
18
|
+
* The index of the parameter for which the decorator is used.
|
|
19
|
+
*/
|
|
20
|
+
parameterIndex) => {
|
|
21
|
+
// Verify that the object target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] exists or we create it.
|
|
22
|
+
// This object is a convention defined by Pristine on where to save controller method parameter decorator information and is used in the router to retrieve that information.
|
|
6
23
|
if (target.constructor.prototype.hasOwnProperty("__metadata__") === false) {
|
|
7
24
|
target.constructor.prototype["__metadata__"] = {};
|
|
8
25
|
}
|
|
@@ -15,9 +32,11 @@ const headers = () => {
|
|
|
15
32
|
if (target.constructor.prototype["__metadata__"]["methods"][propertyKey].hasOwnProperty("arguments") === false) {
|
|
16
33
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] = [];
|
|
17
34
|
}
|
|
35
|
+
// Set the type of method parameter. Each parameter decorator has it's own type.
|
|
18
36
|
const methodParameter = {
|
|
19
37
|
type: "headers"
|
|
20
38
|
};
|
|
39
|
+
// Save the method parameter with the proper parameter index (index of the parameter in the list of parameters of a method).
|
|
21
40
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"][parameterIndex] = methodParameter;
|
|
22
41
|
};
|
|
23
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/headers.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"headers.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/headers.decorator.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,MAAM,OAAO,GAAG,GAAG,EAAE;IACxB,OAAO;IACH;;OAEG;IACH,MAAc;IAEd;;OAEG;IACH,WAA4B;IAE5B;;OAEG;IACH,cAAsB,EACxB,EAAE;QACA,mIAAmI;QACnI,6KAA6K;QAC7K,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,KAAK,KAAK,EAAE;YACvE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,CAAA;SACpD;QAED,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,KAAK,EAAE;YAClF,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,CAAA;SAC/D;QAED,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,KAAK,EAAE;YAC/F,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAA;SAC5E;QAED,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,KAAK,EAAE;YAC5G,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;SAC1F;QAED,gFAAgF;QAChF,MAAM,eAAe,GAAuC;YACxD,IAAI,EAAE,SAAS;SAClB,CAAC;QAEF,4HAA4H;QAC5H,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC;IACxH,CAAC,CAAA;AACL,CAAC,CAAC;AA3CW,QAAA,OAAO,WA2ClB"}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.identity = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The identity decorator can be used to inject the identity making the request in a parameter of a method in a controller.
|
|
6
|
+
*/
|
|
4
7
|
const identity = () => {
|
|
5
|
-
return (
|
|
8
|
+
return (
|
|
9
|
+
/**
|
|
10
|
+
* The class on which the decorator is used.
|
|
11
|
+
*/
|
|
12
|
+
target,
|
|
13
|
+
/**
|
|
14
|
+
* The method on which the decorator is used.
|
|
15
|
+
*/
|
|
16
|
+
propertyKey,
|
|
17
|
+
/**
|
|
18
|
+
* The index of the parameter for which the decorator is used.
|
|
19
|
+
*/
|
|
20
|
+
parameterIndex) => {
|
|
21
|
+
// Verify that the object target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] exists or we create it.
|
|
22
|
+
// This object is a convention defined by Pristine on where to save controller method parameter decorator information and is used in the router to retrieve that information.
|
|
6
23
|
if (target.constructor.prototype.hasOwnProperty("__metadata__") === false) {
|
|
7
24
|
target.constructor.prototype["__metadata__"] = {};
|
|
8
25
|
}
|
|
@@ -15,9 +32,11 @@ const identity = () => {
|
|
|
15
32
|
if (target.constructor.prototype["__metadata__"]["methods"][propertyKey].hasOwnProperty("arguments") === false) {
|
|
16
33
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] = [];
|
|
17
34
|
}
|
|
35
|
+
// Set the type of method parameter. Each parameter decorator has it's own type.
|
|
18
36
|
const methodParameter = {
|
|
19
37
|
type: "identity"
|
|
20
38
|
};
|
|
39
|
+
// Save the method parameter with the proper parameter index (index of the parameter in the list of parameters of a method).
|
|
21
40
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"][parameterIndex] = methodParameter;
|
|
22
41
|
};
|
|
23
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/identity.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"identity.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/identity.decorator.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,MAAM,QAAQ,GAAG,GAAG,EAAE;IACzB,OAAO;IACH;;OAEG;IACH,MAAc;IAEd;;OAEG;IACH,WAA4B;IAE5B;;OAEG;IACH,cAAsB,EACxB,EAAE;QACA,mIAAmI;QACnI,6KAA6K;QAC7K,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,KAAK,KAAK,EAAE;YACvE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,CAAA;SACpD;QAED,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,KAAK,EAAE;YAClF,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,CAAA;SAC/D;QAED,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,KAAK,EAAE;YAC/F,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAA;SAC5E;QAED,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,KAAK,EAAE;YAC5G,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;SAC1F;QAED,gFAAgF;QAChF,MAAM,eAAe,GAAwC;YACzD,IAAI,EAAE,UAAU;SACnB,CAAC;QAEF,4HAA4H;QAC5H,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC;IACxH,CAAC,CAAA;AACL,CAAC,CAAC;AA3CW,QAAA,QAAQ,YA2CnB"}
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.queryParameter = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The queryParameter decorator can be used to inject a specific query parameter of a request in a parameter of a method in a controller.
|
|
6
|
+
* @param name The name of the query parameter to inject.
|
|
7
|
+
*/
|
|
4
8
|
const queryParameter = (name) => {
|
|
5
|
-
return (
|
|
9
|
+
return (
|
|
10
|
+
/**
|
|
11
|
+
* The class on which the decorator is used.
|
|
12
|
+
*/
|
|
13
|
+
target,
|
|
14
|
+
/**
|
|
15
|
+
* The method on which the decorator is used.
|
|
16
|
+
*/
|
|
17
|
+
propertyKey,
|
|
18
|
+
/**
|
|
19
|
+
* The index of the parameter for which the decorator is used.
|
|
20
|
+
*/
|
|
21
|
+
parameterIndex) => {
|
|
22
|
+
// Verify that the object target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] exists or we create it.
|
|
23
|
+
// This object is a convention defined by Pristine on where to save controller method parameter decorator information and is used in the router to retrieve that information.
|
|
6
24
|
if (target.constructor.prototype.hasOwnProperty("__metadata__") === false) {
|
|
7
25
|
target.constructor.prototype["__metadata__"] = {};
|
|
8
26
|
}
|
|
@@ -15,10 +33,13 @@ const queryParameter = (name) => {
|
|
|
15
33
|
if (target.constructor.prototype["__metadata__"]["methods"][propertyKey].hasOwnProperty("arguments") === false) {
|
|
16
34
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] = [];
|
|
17
35
|
}
|
|
36
|
+
// Set the type of method parameter. Each parameter decorator has it's own type.
|
|
37
|
+
// Set also the name of the query parameter to resolve.
|
|
18
38
|
const methodParameter = {
|
|
19
39
|
type: "queryParameter",
|
|
20
40
|
queryParameterName: name,
|
|
21
41
|
};
|
|
42
|
+
// Save the method parameter with the proper parameter index (index of the parameter in the list of parameters of a method).
|
|
22
43
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"][parameterIndex] = methodParameter;
|
|
23
44
|
};
|
|
24
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-parameter.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/query-parameter.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"query-parameter.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/query-parameter.decorator.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACI,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,EAAE;IAC3C,OAAO;IACH;;OAEG;IACH,MAAc;IAEd;;OAEG;IACH,WAA4B;IAE5B;;OAEG;IACH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,CAAA;AACL,CAAC,CAAA;AA7CY,QAAA,cAAc,kBA6C1B"}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.queryParameters = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The queryParameters decorator can be used to inject all the query parameters of a request in a parameter of a method in a controller.
|
|
6
|
+
*/
|
|
4
7
|
const queryParameters = () => {
|
|
5
|
-
return (
|
|
8
|
+
return (
|
|
9
|
+
/**
|
|
10
|
+
* The class on which the decorator is used.
|
|
11
|
+
*/
|
|
12
|
+
target,
|
|
13
|
+
/**
|
|
14
|
+
* The method on which the decorator is used.
|
|
15
|
+
*/
|
|
16
|
+
propertyKey,
|
|
17
|
+
/**
|
|
18
|
+
* The index of the parameter for which the decorator is used.
|
|
19
|
+
*/
|
|
20
|
+
parameterIndex) => {
|
|
21
|
+
// Verify that the object target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] exists or we create it.
|
|
22
|
+
// This object is a convention defined by Pristine on where to save controller method parameter decorator information and is used in the router to retrieve that information.
|
|
6
23
|
if (target.constructor.prototype.hasOwnProperty("__metadata__") === false) {
|
|
7
24
|
target.constructor.prototype["__metadata__"] = {};
|
|
8
25
|
}
|
|
@@ -15,9 +32,11 @@ const queryParameters = () => {
|
|
|
15
32
|
if (target.constructor.prototype["__metadata__"]["methods"][propertyKey].hasOwnProperty("arguments") === false) {
|
|
16
33
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] = [];
|
|
17
34
|
}
|
|
35
|
+
// Set the type of method parameter. Each parameter decorator has it's own type.
|
|
18
36
|
const methodParameter = {
|
|
19
37
|
type: "queryParameters",
|
|
20
38
|
};
|
|
39
|
+
// Save the method parameter with the proper parameter index (index of the parameter in the list of parameters of a method).
|
|
21
40
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"][parameterIndex] = methodParameter;
|
|
22
41
|
};
|
|
23
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-parameters.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/query-parameters.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"query-parameters.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/query-parameters.decorator.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,MAAM,eAAe,GAAG,GAAG,EAAE;IAChC,OAAO;IACH;;OAEG;IACH,MAAc;IAEd;;OAEG;IACH,WAA4B;IAE5B;;OAEG;IACH,cAAsB,EACxB,EAAE;QACA,mIAAmI;QACnI,6KAA6K;QAC7K,IAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,KAAK,KAAK,EAAE;YACtE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,CAAA;SACpD;QAED,IAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,KAAK,EAAE;YACjF,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,CAAA;SAC/D;QAED,IAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,KAAK,EAAE;YAC9F,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAA;SAC5E;QAED,IAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,KAAK,EAAE;YAC3G,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;SAC1F;QAED,gFAAgF;QAChF,MAAM,eAAe,GAAsC;YACvD,IAAI,EAAE,iBAAiB;SAC1B,CAAC;QAEF,4HAA4H;QAC5H,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC;IACxH,CAAC,CAAA;AACL,CAAC,CAAA;AA3CY,QAAA,eAAe,mBA2C3B"}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.request = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The request decorator can be used to inject the whole request in a parameter of a method in a controller.
|
|
6
|
+
*/
|
|
4
7
|
const request = () => {
|
|
5
|
-
return (
|
|
8
|
+
return (
|
|
9
|
+
/**
|
|
10
|
+
* The class on which the decorator is used.
|
|
11
|
+
*/
|
|
12
|
+
target,
|
|
13
|
+
/**
|
|
14
|
+
* The method on which the decorator is used.
|
|
15
|
+
*/
|
|
16
|
+
propertyKey,
|
|
17
|
+
/**
|
|
18
|
+
* The index of the parameter for which the decorator is used.
|
|
19
|
+
*/
|
|
20
|
+
parameterIndex) => {
|
|
21
|
+
// Verify that the object target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] exists or we create it.
|
|
22
|
+
// This object is a convention defined by Pristine on where to save controller method parameter decorator information and is used in the router to retrieve that information.
|
|
6
23
|
if (target.constructor.prototype.hasOwnProperty("__metadata__") === false) {
|
|
7
24
|
target.constructor.prototype["__metadata__"] = {};
|
|
8
25
|
}
|
|
@@ -15,9 +32,11 @@ const request = () => {
|
|
|
15
32
|
if (target.constructor.prototype["__metadata__"]["methods"][propertyKey].hasOwnProperty("arguments") === false) {
|
|
16
33
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] = [];
|
|
17
34
|
}
|
|
35
|
+
// Set the type of method parameter. Each parameter decorator has it's own type.
|
|
18
36
|
const methodParameter = {
|
|
19
37
|
type: "request"
|
|
20
38
|
};
|
|
39
|
+
// Save the method parameter with the proper parameter index (index of the parameter in the list of parameters of a method).
|
|
21
40
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"][parameterIndex] = methodParameter;
|
|
22
41
|
};
|
|
23
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/request.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"request.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/request.decorator.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,MAAM,OAAO,GAAG,GAAG,EAAE;IACxB,OAAO;IACH;;OAEG;IACH,MAAc;IAEd;;OAEG;IACH,WAA4B;IAE5B;;OAEG;IACH,cAAsB,EACxB,EAAE;QACA,mIAAmI;QACnI,6KAA6K;QAC7K,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,KAAK,KAAK,EAAE;YACvE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,CAAA;SACpD;QAED,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,KAAK,EAAE;YAClF,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,CAAA;SAC/D;QAED,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,KAAK,EAAE;YAC/F,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAA;SAC5E;QAED,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,KAAK,EAAE;YAC5G,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;SAC1F;QAED,gFAAgF;QAChF,MAAM,eAAe,GAAuC;YACxD,IAAI,EAAE,SAAS;SAClB,CAAC;QAEF,4HAA4H;QAC5H,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC;IACxH,CAAC,CAAA;AACL,CAAC,CAAC;AA3CW,QAAA,OAAO,WA2ClB"}
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.responseHeader = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The responseHeader decorator can be used to specify a header that needs to be added to the response before sending it back.
|
|
6
|
+
* This decorator can be used with either method (route) or a class (controller).
|
|
7
|
+
* If used on the class than it will be applied to every route of the controller.
|
|
8
|
+
* @param key The key of the header
|
|
9
|
+
* @param value The value to set the header to.
|
|
10
|
+
*/
|
|
4
11
|
const responseHeader = (key, value) => {
|
|
5
|
-
return (
|
|
6
|
-
|
|
12
|
+
return (
|
|
13
|
+
/**
|
|
14
|
+
* The class on which the decorator is used.
|
|
15
|
+
*/
|
|
16
|
+
target,
|
|
17
|
+
/**
|
|
18
|
+
* The method on which the decorator is used.
|
|
19
|
+
*/
|
|
20
|
+
propertyKey,
|
|
21
|
+
/**
|
|
22
|
+
* The descriptor of the property
|
|
23
|
+
*/
|
|
24
|
+
descriptor) => {
|
|
25
|
+
// If there's a descriptor and a property key, then it's not a controller decorator, but a method decorator
|
|
7
26
|
if (descriptor && propertyKey) {
|
|
27
|
+
// Verify that the object target.constructor.prototype["__metadata__"]["methods"][propertyKey]["__routeContext__"]["responseHeaders"] exists or we create it.
|
|
28
|
+
// This object is a convention defined by Pristine on where to save controller method parameter decorator information and is used in the router to retrieve that information.
|
|
8
29
|
if (target.constructor.prototype.hasOwnProperty("__metadata__") === false) {
|
|
9
30
|
target.constructor.prototype["__metadata__"] = {};
|
|
10
31
|
}
|
|
@@ -23,6 +44,7 @@ const responseHeader = (key, value) => {
|
|
|
23
44
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["__routeContext__"]["responseHeaders"][key] = value;
|
|
24
45
|
}
|
|
25
46
|
else {
|
|
47
|
+
// It is a controller decorator
|
|
26
48
|
if (target.prototype.hasOwnProperty("__metadata__") === false) {
|
|
27
49
|
target.prototype["__metadata__"] = {};
|
|
28
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-header.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/response-header.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"response-header.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/response-header.decorator.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACI,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,KAAa,EAAE,EAAE;IACzD,OAAO;IACH;;OAEG;IACH,MAAW;IAEX;;OAEG;IACH,WAAoB;IAEpB;;OAEG;IACH,UAA+B,EACjC,EAAE;QAEA,2GAA2G;QAC3G,IAAG,UAAU,IAAI,WAAW,EAAE;YAC1B,6JAA6J;YAC7J,6KAA6K;YAC7K,IAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,KAAK,KAAK,EAAE;gBACtE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,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AAG,KAAK,CAAC;SAC5H;aACI;YACD,+BAA+B;YAC/B,IAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,KAAK,KAAK,EAAE;gBAC1D,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,CAAA;aACxC;YAED,IAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,YAAY,CAAC,KAAK,KAAK,EAAE;gBACxE,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,CAAA;aACtD;YAED,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC,cAAc,CAAC,kBAAkB,CAAC,KAAK,KAAK,EAAE;gBAC7F,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAA;aAC1E;YAED,IAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC,kBAAkB,CAAC,CAAC,cAAc,CAAC,iBAAiB,CAAC,KAAK,KAAK,EAAE;gBAC/G,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC,kBAAkB,CAAC,CAAC,iBAAiB,CAAC,GAAG,EAAE,CAAA;aAC7F;YAED,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC,kBAAkB,CAAC,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SACtG;IACL,CAAC,CAAA;AACL,CAAC,CAAA;AAjEY,QAAA,cAAc,kBAiE1B"}
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.routeParameter = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The routeParameter decorator can be used to inject a specific route parameter of a request in a parameter of a method in a controller.
|
|
6
|
+
* @param name The name of the route(path) parameter to inject.
|
|
7
|
+
*/
|
|
4
8
|
const routeParameter = (name) => {
|
|
5
|
-
return (
|
|
9
|
+
return (
|
|
10
|
+
/**
|
|
11
|
+
* The class on which the decorator is used.
|
|
12
|
+
*/
|
|
13
|
+
target,
|
|
14
|
+
/**
|
|
15
|
+
* The method on which the decorator is used.
|
|
16
|
+
*/
|
|
17
|
+
propertyKey,
|
|
18
|
+
/**
|
|
19
|
+
* The index of the parameter for which the decorator is used.
|
|
20
|
+
*/
|
|
21
|
+
parameterIndex) => {
|
|
22
|
+
// Verify that the object target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] exists or we create it.
|
|
23
|
+
// This object is a convention defined by Pristine on where to save controller method parameter decorator information and is used in the router to retrieve that information.
|
|
6
24
|
if (target.constructor.prototype.hasOwnProperty("__metadata__") === false) {
|
|
7
25
|
target.constructor.prototype["__metadata__"] = {};
|
|
8
26
|
}
|
|
@@ -15,10 +33,12 @@ const routeParameter = (name) => {
|
|
|
15
33
|
if (target.constructor.prototype["__metadata__"]["methods"][propertyKey].hasOwnProperty("arguments") === false) {
|
|
16
34
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"] = [];
|
|
17
35
|
}
|
|
36
|
+
// Set the type of method parameter. Each parameter decorator has it's own type.
|
|
18
37
|
const methodParameter = {
|
|
19
38
|
type: "routeParameter",
|
|
20
39
|
routeParameterName: name,
|
|
21
40
|
};
|
|
41
|
+
// Save the method parameter with the proper parameter index (index of the parameter in the list of parameters of a method).
|
|
22
42
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey]["arguments"][parameterIndex] = methodParameter;
|
|
23
43
|
};
|
|
24
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-parameter.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/route-parameter.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"route-par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,EAAE,IAAI;SAC3B,CAAC;QAEF,4HAA4H;QAC5H,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC;IACxH,CAAC,CAAA;AACL,CAAC,CAAA;AA5CY,QAAA,cAAc,kBA4C1B"}
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.route = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The route decorator can be used on a method to register this method as a route of the controller in the router.
|
|
6
|
+
* @param httpMethod The http method of the route
|
|
7
|
+
* @param path The part of the path following the base path of the controller. For path parameters use the colons. (ie: resources/:id)
|
|
8
|
+
*/
|
|
4
9
|
const route = (httpMethod, path) => {
|
|
5
|
-
return (
|
|
10
|
+
return (
|
|
11
|
+
/**
|
|
12
|
+
* The class on which the decorator is used.
|
|
13
|
+
*/
|
|
14
|
+
target,
|
|
15
|
+
/**
|
|
16
|
+
* The method on which the decorator is used.
|
|
17
|
+
*/
|
|
18
|
+
propertyKey,
|
|
19
|
+
/**
|
|
20
|
+
* The descriptor of the property.
|
|
21
|
+
*/
|
|
22
|
+
descriptor) => {
|
|
23
|
+
// Verify that the object target.constructor.prototype["__metadata__"]["methods"][propertyKey]["route"] exists or we create it.
|
|
24
|
+
// This object is a convention defined by Pristine on where to save the route decorator information and is used in the router to retrieve that information.
|
|
6
25
|
if (target.constructor.prototype.hasOwnProperty("__metadata__") === false) {
|
|
7
26
|
target.constructor.prototype["__metadata__"] = {};
|
|
8
27
|
}
|
|
@@ -12,6 +31,7 @@ const route = (httpMethod, path) => {
|
|
|
12
31
|
if (target.constructor.prototype["__metadata__"]["methods"].hasOwnProperty(propertyKey) === false) {
|
|
13
32
|
target.constructor.prototype["__metadata__"]["methods"][propertyKey] = {};
|
|
14
33
|
}
|
|
34
|
+
// Set the route.
|
|
15
35
|
const route = {
|
|
16
36
|
httpMethod,
|
|
17
37
|
methodKeyname: propertyKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/route.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"route.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/route.decorator.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACI,MAAM,KAAK,GAAG,CAAC,UAA+B,EAAE,IAAY,EAAE,EAAE;IACnE,OAAO;IACH;;OAEG;IACH,MAAc;IAEd;;OAEG;IACH,WAAmB;IAEnB;;OAEG;IACH,UAA8B,EAChC,EAAE;QACA,+HAA+H;QAC/H,2JAA2J;QAC3J,IAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,KAAK,KAAK,EAAE;YACtE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,CAAA;SACpD;QAED,IAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,KAAK,EAAE;YACjF,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,CAAA;SAC/D;QAED,IAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,KAAK,EAAE;YAC9F,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAA;SAC5E;QAED,iBAAiB;QACjB,MAAM,KAAK,GAAyB;YAChC,UAAU;YACV,aAAa,EAAE,WAAW;YAC1B,IAAI;SACP,CAAA;QAED,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;IAC1F,CAAC,CAAC;AACN,CAAC,CAAA;AAxCY,QAAA,KAAK,SAwCjB"}
|
|
@@ -18,6 +18,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.RouterResponseEnricher = void 0;
|
|
19
19
|
const common_1 = require("@pristine-ts/common");
|
|
20
20
|
const networking_module_keyname_1 = require("../networking.module.keyname");
|
|
21
|
+
/**
|
|
22
|
+
* The RouterResponseEnricher enriches the response of the router by adding the response headers specified by the response header decorator.
|
|
23
|
+
* It is tagged as an RouterResponseEnricher so it can be automatically injected with the all the other RouterResponseEnrichers.
|
|
24
|
+
*/
|
|
21
25
|
let RouterResponseEnricher = class RouterResponseEnricher {
|
|
22
26
|
enrichResponse(response, request, methodNode) {
|
|
23
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-response.enricher.js","sourceRoot":"","sources":["../../../../src/enrichers/router-response.enricher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,gDAAgF;AAChF,4EAAqE;
|
|
1
|
+
{"version":3,"file":"router-response.enricher.js","sourceRoot":"","sources":["../../../../src/enrichers/router-response.enricher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,gDAAgF;AAChF,4EAAqE;AAIrE;;;GAGG;AAGH,IAAa,sBAAsB,GAAnC,MAAa,sBAAsB;IACzB,cAAc,CAAC,QAAkB,EAAE,OAAgB,EAAE,UAA4B;;YACnF,IAAG,UAAU,CAAC,KAAK,CAAC,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAC;gBACtF,QAAQ,CAAC,OAAO,mCAAO,QAAQ,CAAC,OAAO,GAAK,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;aACxF;YACD,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CACJ,CAAA;AAPY,sBAAsB;IAFlC,YAAG,CAAC,iCAAwB,CAAC,sBAAsB,CAAC;IACpD,qBAAY,CAAC,mDAAuB,CAAC;GACzB,sBAAsB,CAOlC;AAPY,wDAAsB"}
|
|
@@ -14,6 +14,8 @@ __exportStar(require("./bad-request.http-error"), exports);
|
|
|
14
14
|
__exportStar(require("./forbidden.http-error"), exports);
|
|
15
15
|
__exportStar(require("./http.error"), exports);
|
|
16
16
|
__exportStar(require("./invalid-body.http-error"), exports);
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./method-router-adding.error"), exports);
|
|
18
18
|
__exportStar(require("./not-found.http-error"), exports);
|
|
19
|
+
__exportStar(require("./path-router-adding.error"), exports);
|
|
20
|
+
__exportStar(require("./path-router-instantiation.error"), exports);
|
|
19
21
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/errors/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAyC;AACzC,yDAAuC;AACvC,+CAA6B;AAC7B,4DAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/errors/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAyC;AACzC,yDAAuC;AACvC,+CAA6B;AAC7B,4DAA0C;AAC1C,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,oEAAkD"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HttpError = void 0;
|
|
4
|
+
const common_1 = require("@pristine-ts/common");
|
|
4
5
|
/**
|
|
5
6
|
* This class defines a basic HttpError. In your code, feel free to throw an HttpError to have this error returned via HTTP.
|
|
6
7
|
* If you throw this error when handling an Event, it won't be returned.
|
|
7
8
|
*/
|
|
8
|
-
const common_1 = require("@pristine-ts/common");
|
|
9
9
|
class HttpError extends common_1.LoggableError {
|
|
10
10
|
constructor(httpStatus, message, errors) {
|
|
11
11
|
super(message, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.error.js","sourceRoot":"","sources":["../../../../src/errors/http.error.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"http.error.js","sourceRoot":"","sources":["../../../../src/errors/http.error.ts"],"names":[],"mappings":";;;AAAA,gDAAkD;AAElD;;;GAGG;AACH,MAAa,SAAU,SAAQ,sBAAa;IACxC,YAAmC,UAAkB,EAAW,OAAe,EAAkB,MAAc;QAC3G,KAAK,CAAC,OAAO,EAAE;YACX,UAAU;YACV,MAAM;SACT,CAAC,CAAC;QAJ4B,eAAU,GAAV,UAAU,CAAQ;QAAW,YAAO,GAAP,OAAO,CAAQ;QAAkB,WAAM,GAAN,MAAM,CAAQ;QAM3G,gCAAgC;QAChC,kDAAkD;QAClD,gIAAgI;QAChI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACJ;AAZD,8BAYC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MethodRouterAddingError = void 0;
|
|
4
|
+
const common_1 = require("@pristine-ts/common");
|
|
5
|
+
const method_router_node_1 = require("../nodes/method-router.node");
|
|
6
|
+
/**
|
|
7
|
+
* This Error is thrown when there's an error that happens when the networking is being initialized.
|
|
8
|
+
* It is thrown when trying to add a child node to a MethodRouterNode, since a MethodRouterNode is a leaf it cannot have any children.
|
|
9
|
+
*/
|
|
10
|
+
class MethodRouterAddingError extends common_1.LoggableError {
|
|
11
|
+
constructor(message, splitPaths, method, route, methodRouterNode) {
|
|
12
|
+
super(message, {
|
|
13
|
+
splitPaths,
|
|
14
|
+
method,
|
|
15
|
+
route,
|
|
16
|
+
methodRouterNode,
|
|
17
|
+
});
|
|
18
|
+
// Set the prototype explicitly.
|
|
19
|
+
// As specified in the documentation in TypeScript
|
|
20
|
+
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
21
|
+
Object.setPrototypeOf(this, method_router_node_1.MethodRouterNode.prototype);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.MethodRouterAddingError = MethodRouterAddingError;
|
|
25
|
+
//# sourceMappingURL=method-router-adding.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-router-adding.error.js","sourceRoot":"","sources":["../../../../src/errors/method-router-adding.error.ts"],"names":[],"mappings":";;;AAAA,gDAA8D;AAE9D,oEAA6D;AAE7D;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,sBAAa;IAEtD,YAAmB,OAAe,EAAE,UAAoB,EAAE,MAA2B,EAAE,KAAY,EAAE,gBAAkC;QACnI,KAAK,CAAC,OAAO,EAAE;YACX,UAAU;YACV,MAAM;YACN,KAAK;YACL,gBAAgB;SACnB,CAAC,CAAC;QAEH,gCAAgC;QAChC,kDAAkD;QAClD,gIAAgI;QAChI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,qCAAgB,CAAC,SAAS,CAAC,CAAC;IAAI,CAAC;CACpE;AAdD,0DAcC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PathRouterAddingError = void 0;
|
|
4
|
+
const common_1 = require("@pristine-ts/common");
|
|
4
5
|
/**
|
|
5
|
-
* This Error is thrown when there's an error that happens when the networking is being initialized
|
|
6
|
+
* This Error is thrown when there's an error that happens when the networking is being initialized.
|
|
7
|
+
* It is thrown when an error occurs when trying to add a child node to a PathRouterNode.
|
|
6
8
|
*/
|
|
7
|
-
const common_1 = require("@pristine-ts/common");
|
|
8
9
|
class PathRouterAddingError extends common_1.LoggableError {
|
|
9
10
|
constructor(message, splitPaths, method, route, pathRouterNode) {
|
|
10
11
|
super(message, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-router-adding.error.js","sourceRoot":"","sources":["../../../../src/errors/path-router-adding.error.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"path-router-adding.error.js","sourceRoot":"","sources":["../../../../src/errors/path-router-adding.error.ts"],"names":[],"mappings":";;;AAAA,gDAA8D;AAI9D;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,sBAAa;IAEpD,YAAmB,OAAe,EAAE,UAAoB,EAAE,MAA2B,EAAE,KAAY,EAAE,cAA8B;QAC/H,KAAK,CAAC,OAAO,EAAE;YACX,UAAU;YACV,MAAM;YACN,KAAK;YACL,cAAc;SACjB,CAAC,CAAC;QAEH,gCAAgC;QAChC,kDAAkD;QAClD,gIAAgI;QAChI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAAI,CAAC;CACzE;AAdD,sDAcC"}
|