@tsed/platform-params 7.67.3 → 7.67.5
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/jest.config.js
CHANGED
|
@@ -14,11 +14,18 @@ class ParamValidationError extends exceptions_1.BadRequest {
|
|
|
14
14
|
.toLowerCase()
|
|
15
15
|
.replace(/parse|params|filter/gi, "");
|
|
16
16
|
const expression = metadata.expression;
|
|
17
|
-
const
|
|
17
|
+
const dataPath = `${name}${expression ? "." + expression : ""}`;
|
|
18
|
+
const message = `Bad request on parameter "request.${dataPath}".\n${origin.message}`.trim();
|
|
18
19
|
const error = new ParamValidationError(message);
|
|
19
20
|
error.dataPath = String(metadata.expression) || "";
|
|
20
21
|
error.requestType = (0, core_1.nameOf)(metadata.paramType);
|
|
21
22
|
error.origin = origin.origin || origin;
|
|
23
|
+
if (error.origin?.errors) {
|
|
24
|
+
error.origin?.errors.forEach((error) => {
|
|
25
|
+
error.requestPath = name;
|
|
26
|
+
error.dataPath = error.dataPath || (expression ? `.${expression}` : "");
|
|
27
|
+
});
|
|
28
|
+
}
|
|
22
29
|
return error;
|
|
23
30
|
}
|
|
24
31
|
return origin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParamValidationError.js","sourceRoot":"","sources":["../../../src/errors/ParamValidationError.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAClC,iDAA4C;AAE5C,uDAAkD;AAElD,MAAa,oBAAqB,SAAQ,uBAAU;IAC3C,IAAI,GAAW,wBAAwB,CAAC;IACxC,QAAQ,CAAS;IACjB,WAAW,CAAS;IAE3B,MAAM,CAAC,IAAI,CAAC,QAA4B,EAAE,SAAc,EAAE;QACxD,IAAI,MAAM,YAAY,iCAAe,IAAI,MAAM,YAAY,uBAAU,EAAE;YACrE,MAAM,IAAI,GAAG,IAAA,aAAM,EAAC,QAAQ,CAAC,SAAS,CAAC;iBACpC,WAAW,EAAE;iBACb,OAAO,CAAC,uBAAuB,E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CAAC,OAAO,CAAC,CAAC,KAAU,EAAE,EAAE;oBAC1C,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;oBACzB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC1E,CAAC,CAAC,CAAC;aACJ;YAED,OAAO,KAAK,CAAC;SACd;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA/BD,oDA+BC"}
|
|
@@ -11,11 +11,18 @@ export class ParamValidationError extends BadRequest {
|
|
|
11
11
|
.toLowerCase()
|
|
12
12
|
.replace(/parse|params|filter/gi, "");
|
|
13
13
|
const expression = metadata.expression;
|
|
14
|
-
const
|
|
14
|
+
const dataPath = `${name}${expression ? "." + expression : ""}`;
|
|
15
|
+
const message = `Bad request on parameter "request.${dataPath}".\n${origin.message}`.trim();
|
|
15
16
|
const error = new ParamValidationError(message);
|
|
16
17
|
error.dataPath = String(metadata.expression) || "";
|
|
17
18
|
error.requestType = nameOf(metadata.paramType);
|
|
18
19
|
error.origin = origin.origin || origin;
|
|
20
|
+
if (error.origin?.errors) {
|
|
21
|
+
error.origin?.errors.forEach((error) => {
|
|
22
|
+
error.requestPath = name;
|
|
23
|
+
error.dataPath = error.dataPath || (expression ? `.${expression}` : "");
|
|
24
|
+
});
|
|
25
|
+
}
|
|
19
26
|
return error;
|
|
20
27
|
}
|
|
21
28
|
return origin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParamValidationError.js","sourceRoot":"","sources":["../../../src/errors/ParamValidationError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElD,MAAM,OAAO,oBAAqB,SAAQ,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IAAI,EAAE,CAAC;YAE5F,MAAM,KAAK,GAAG,IAAI,oBAAoB,CAAC,OAAO,CAAC,CAAC;YAChD,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YACnD,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC/C,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC;YAEvC,IAAI,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE;gBACxB,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,KAAU,EAAE,EAAE;oBAC1C,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;oBACzB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC1E,CAAC,CAAC,CAAC;aACJ;YAED,OAAO,KAAK,CAAC;SACd;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-params",
|
|
3
|
-
"version": "7.67.
|
|
3
|
+
"version": "7.67.5",
|
|
4
4
|
"description": "Params module for Ts.ED Framework",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -15,29 +15,29 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "yarn barrels && yarn build:ts",
|
|
17
17
|
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
|
|
18
|
-
"test": "
|
|
18
|
+
"test": "jest --max-workers=2 && jest-coverage-thresholds-bumper",
|
|
19
19
|
"build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"tslib": "2.6.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@tsed/core": "7.67.
|
|
26
|
-
"@tsed/di": "7.67.
|
|
27
|
-
"@tsed/exceptions": "7.67.
|
|
28
|
-
"@tsed/json-mapper": "7.67.
|
|
29
|
-
"@tsed/schema": "7.67.
|
|
30
|
-
"@tsed/typescript": "7.67.
|
|
25
|
+
"@tsed/core": "7.67.5",
|
|
26
|
+
"@tsed/di": "7.67.5",
|
|
27
|
+
"@tsed/exceptions": "7.67.5",
|
|
28
|
+
"@tsed/json-mapper": "7.67.5",
|
|
29
|
+
"@tsed/schema": "7.67.5",
|
|
30
|
+
"@tsed/typescript": "7.67.5",
|
|
31
31
|
"barrelsby": "^2.8.1",
|
|
32
32
|
"eslint": "^8.57.0",
|
|
33
33
|
"jest": "^29.7.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@tsed/core": "7.67.
|
|
37
|
-
"@tsed/di": "7.67.
|
|
38
|
-
"@tsed/exceptions": "7.67.
|
|
39
|
-
"@tsed/json-mapper": "7.67.
|
|
40
|
-
"@tsed/schema": "7.67.
|
|
36
|
+
"@tsed/core": "7.67.5",
|
|
37
|
+
"@tsed/di": "7.67.5",
|
|
38
|
+
"@tsed/exceptions": "7.67.5",
|
|
39
|
+
"@tsed/json-mapper": "7.67.5",
|
|
40
|
+
"@tsed/schema": "7.67.5"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
43
|
"@tsed/core": {
|