@pristine-ts/validation 0.0.201 → 0.0.204
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-validation.decorator.js.map +1 -1
- package/dist/lib/cjs/decorators/decorators.js +5 -1
- package/dist/lib/cjs/decorators/decorators.js.map +1 -1
- package/dist/lib/cjs/interceptors/body-validation.request-interceptor.js +6 -6
- package/dist/lib/cjs/interceptors/body-validation.request-interceptor.js.map +1 -1
- package/dist/lib/cjs/interceptors/interceptors.js +5 -1
- package/dist/lib/cjs/interceptors/interceptors.js.map +1 -1
- package/dist/lib/cjs/validation.module.js +5 -1
- package/dist/lib/cjs/validation.module.js.map +1 -1
- package/dist/lib/esm/decorators/body-validation.decorator.js.map +1 -1
- package/dist/types/decorators/body-validation.decorator.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body-validation.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/body-validation.decorator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,MAAM,cAAc,GAAG,CAAC,SAAmB,EAAE,EAAE;IAClD,OAAO;IACH;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"body-validation.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/body-validation.decorator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,MAAM,cAAc,GAAG,CAAC,SAAmB,EAAE,EAAE;IAClD,OAAO;IACH;;OAEG;IACH,MAAW;IAEX;;OAEG;IACH,WAA4B;IAE5B;;OAEG;IACH,UAA8B,EAChC,EAAE;QAEA,gFAAgF;QAChF,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,kBAAkB,CAAC,KAAK,KAAK,EAAE;YAClH,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAA;SAChG;QAED,4CAA4C;QAC5C,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,kBAAkB,CAAC,CAAC,eAAe,CAAC,GAAG;YACxG,SAAS;SACZ,CAAC;IACN,CAAC,CAAA;AACL,CAAC,CAAA;AAxCY,QAAA,cAAc,kBAwC1B"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../../src/decorators/decorators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../../src/decorators/decorators.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C"}
|
|
@@ -60,9 +60,9 @@ let BodyValidationRequestInterceptor = class BodyValidationRequestInterceptor {
|
|
|
60
60
|
routeContext: methodNode.route.context,
|
|
61
61
|
}, validation_module_keyname_1.ValidationModuleKeyname);
|
|
62
62
|
// Validates that the body can be mapped to the expected type
|
|
63
|
-
const mappedBody = class_transformer_1.plainToClass(methodNode.route.context.bodyValidator.classType, request.body);
|
|
63
|
+
const mappedBody = (0, class_transformer_1.plainToClass)(methodNode.route.context.bodyValidator.classType, request.body);
|
|
64
64
|
// Validates if all the conditions are respected in the expected type.
|
|
65
|
-
const errors = yield class_validator_1.validate(mappedBody);
|
|
65
|
+
const errors = yield (0, class_validator_1.validate)(mappedBody);
|
|
66
66
|
if (errors.length == 0) {
|
|
67
67
|
return request;
|
|
68
68
|
}
|
|
@@ -72,10 +72,10 @@ let BodyValidationRequestInterceptor = class BodyValidationRequestInterceptor {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
BodyValidationRequestInterceptor = __decorate([
|
|
75
|
-
common_1.moduleScoped(validation_module_keyname_1.ValidationModuleKeyname),
|
|
76
|
-
common_1.tag(common_1.ServiceDefinitionTagEnum.RequestInterceptor),
|
|
77
|
-
tsyringe_1.injectable(),
|
|
78
|
-
__param(0, tsyringe_1.inject("LogHandlerInterface")),
|
|
75
|
+
(0, common_1.moduleScoped)(validation_module_keyname_1.ValidationModuleKeyname),
|
|
76
|
+
(0, common_1.tag)(common_1.ServiceDefinitionTagEnum.RequestInterceptor),
|
|
77
|
+
(0, tsyringe_1.injectable)(),
|
|
78
|
+
__param(0, (0, tsyringe_1.inject)("LogHandlerInterface")),
|
|
79
79
|
__metadata("design:paramtypes", [Object])
|
|
80
80
|
], BodyValidationRequestInterceptor);
|
|
81
81
|
exports.BodyValidationRequestInterceptor = BodyValidationRequestInterceptor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body-validation.request-interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/body-validation.request-interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,qDAAyC;AACzC,wDAA4D;AAC5D,gDAAyF;AACzF,4EAAqE;AACrE,uCAA4C;AAC5C,yDAAiD;AAGjD;;;;GAIG;AAIH,IAAa,gCAAgC,GAA7C,MAAa,gCAAgC;IAEzC;;;;;OAKG;IACH,YAA4D,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAC3F,CAAC;IAED;;;;;OAKG;IACG,gBAAgB,CAAC,OAAgB,EAAE,UAA4B;;YACjE,IAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,KAAK,SAAS,IAAI,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,KAAK,SAAS,EAAE;gBACvH,OAAO,OAAO,CAAC;aAClB;YAED,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,+BAA+B,EAAE;gBACnD,OAAO;gBACP,UAAU;gBACV,YAAY,EAAE,UAAU,CAAC,KAAK,CAAC,OAAO;aACzC,EAAE,mDAAuB,CAAC,CAAA;YAE3B,6DAA6D;YAC7D,MAAM,UAAU,GAAG,gCAAY,
|
|
1
|
+
{"version":3,"file":"body-validation.request-interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/body-validation.request-interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,qDAAyC;AACzC,wDAA4D;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AzCY,4EAAgC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptors.js","sourceRoot":"","sources":["../../../../src/interceptors/interceptors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interceptors.js","sourceRoot":"","sources":["../../../../src/interceptors/interceptors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wEAAsD"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.module.js","sourceRoot":"","sources":["../../../src/validation.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation.module.js","sourceRoot":"","sources":["../../../src/validation.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,2EAAoE;AACpE,wDAAyD;AACzD,4CAA6C;AAE7C,0DAAwC;AACxC,8DAA4C;AAE5C,8DAA4C;AAE/B,QAAA,gBAAgB,GAAoB;IAC7C,OAAO,EAAE,mDAAuB;IAChC,aAAa,EAAE;QACX,iBAAU;QACV,6BAAgB;KACnB;IACD,qBAAqB,EAAE,EACtB;CACJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body-validation.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/body-validation.decorator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAmB,EAAE,EAAE;IAClD,OAAO;IACH;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"body-validation.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/body-validation.decorator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAmB,EAAE,EAAE;IAClD,OAAO;IACH;;OAEG;IACH,MAAW;IAEX;;OAEG;IACH,WAA4B;IAE5B;;OAEG;IACH,UAA8B,EAChC,EAAE;QAEA,gFAAgF;QAChF,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,kBAAkB,CAAC,KAAK,KAAK,EAAE;YAClH,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAA;SAChG;QAED,4CAA4C;QAC5C,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,kBAAkB,CAAC,CAAC,eAAe,CAAC,GAAG;YACxG,SAAS;SACZ,CAAC;IACN,CAAC,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* The bodyValidation decorator can be used to validate the body of a request.
|
|
3
3
|
* @param classType The class that the request body is expected to fit.
|
|
4
4
|
*/
|
|
5
|
-
export declare const bodyValidation: (classType: Function) => (target:
|
|
5
|
+
export declare const bodyValidation: (classType: Function) => (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pristine-ts/validation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.204",
|
|
4
4
|
"description": "",
|
|
5
5
|
"module": "dist/lib/esm/validation.module.js",
|
|
6
6
|
"main": "dist/lib/cjs/validation.module.js",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"test:cov": "jest --coverage"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@pristine-ts/common": "^0.0.
|
|
16
|
-
"@pristine-ts/core": "^0.0.
|
|
17
|
-
"@pristine-ts/networking": "^0.0.
|
|
15
|
+
"@pristine-ts/common": "^0.0.204",
|
|
16
|
+
"@pristine-ts/core": "^0.0.204",
|
|
17
|
+
"@pristine-ts/networking": "^0.0.204",
|
|
18
18
|
"class-transformer": "^0.4.0",
|
|
19
19
|
"class-validator": "^0.13.1"
|
|
20
20
|
},
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"src/*.{js,ts}"
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "cebe54fce89123a4b1d7ab5c43853af957f46f83"
|
|
64
64
|
}
|