@privateaim/server-http-kit 0.8.17 → 0.8.18
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.18](https://github.com/PrivateAIM/hub/compare/v0.8.17...v0.8.18) (2025-09-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* expose validup validator error ([7f81aca](https://github.com/PrivateAIM/hub/commit/7f81aca88b539c6547afa6fb0aaf645d3dbb80dd))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @privateaim/kit bumped from ^0.8.17 to ^0.8.18
|
|
16
|
+
* @privateaim/server-kit bumped from ^0.8.17 to ^0.8.18
|
|
17
|
+
* @privateaim/telemetry-kit bumped from ^0.8.17 to ^0.8.18
|
|
18
|
+
|
|
3
19
|
## [0.8.17](https://github.com/PrivateAIM/hub/compare/v0.8.16...v0.8.17) (2025-09-01)
|
|
4
20
|
|
|
5
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/middlewares/error.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMrC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/middlewares/error.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMrC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,QAoFlD"}
|
|
@@ -54,6 +54,10 @@ function mountErrorMiddleware(router) {
|
|
|
54
54
|
attributes: error.cause.children.map((child) => child.pathAbsolute),
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
if (error.cause instanceof validup_1.ValidupValidatorError) {
|
|
58
|
+
error.expose = true;
|
|
59
|
+
error.statusCode = 400;
|
|
60
|
+
}
|
|
57
61
|
// catch and decorate some db errors :)
|
|
58
62
|
switch (error.code) {
|
|
59
63
|
case 'ER_DUP_ENTRY':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/middlewares/error.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAWH,
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/middlewares/error.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAWH,oDAoFC;AA7FD,2CAAoE;AACpE,yCAA2C;AAC3C,6DAAgE;AAEhE,mCAAsC;AACtC,uDAAmD;AACnD,yDAA8D;AAC9D,qCAAoE;AAEpE,SAAgB,oBAAoB,CAAC,MAAc;IAC/C,MAAM,CAAC,GAAG,CAAC,IAAA,qBAAY,EAAC,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;QACxC,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,IAAI,GAAG;YACzC,KAAK,CAAC,UAAU,GAAG,GAAG,CAAC;QAE3B,IAAI,aAAa,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACpC,IAAI,KAAK,CAAC,KAAK,IAAI,IAAA,cAAQ,EAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;gBACvC,IAAA,sBAAS,GAAE,CAAC,KAAK,CAAC;oBACd,OAAO,EAAE,KAAK,CAAC,KAAc;oBAC7B,CAAC,uBAAO,CAAC,OAAO,CAAC,EAAE,0BAAU,CAAC,IAAI;iBACrC,CAAC,CAAC;YACP,CAAC;iBAAM,CAAC;gBACJ,IAAA,sBAAS,GAAE,CAAC,KAAK,CAAC;oBACd,OAAO,EAAE,KAAK;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K,0BAA0B,CAAC,CAAC,CAAC;gBAC9B,KAAK,CAAC,UAAU,GAAG,GAAG,CAAC;gBACvB,KAAK,CAAC,OAAO,GAAG,qDAAqD,CAAC;gBACtE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;gBACpB,MAAM;YACV,CAAC;YACD,KAAK,cAAc;gBACf,KAAK,CAAC,UAAU,GAAG,GAAG,CAAC;gBACvB,KAAK,CAAC,OAAO,GAAG,kEAAkE,CAAC;gBACnF,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;gBACpB,MAAM;QACd,CAAC;QAED,MAAM,WAAW,GAAG,OAAO,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;YACnD,KAAK,CAAC,MAAM,CAAC,CAAC;YACd,CAAC,aAAa,CAAC;QAEnB,IAAI,CAAC,WAAW,EAAE,CAAC;YACf,KAAK,CAAC,OAAO,GAAG,oCAAoC,CAAC;QACzD,CAAC;QAED,GAAG,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;QAElC,OAAO;YACH,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE;YACrB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,GAAG,CAAC,WAAW,IAAI,IAAA,cAAQ,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7D,CAAC;IACN,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@privateaim/server-http-kit",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.18",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"author": {
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"@authup/server-adapter-kit": "^1.0.0-beta.27",
|
|
20
20
|
"@authup/server-adapter-http": "^1.0.0-beta.27",
|
|
21
21
|
"@ebec/http": "^2.3.0",
|
|
22
|
-
"@privateaim/kit": "^0.8.
|
|
23
|
-
"@privateaim/server-kit": "^0.8.
|
|
24
|
-
"@privateaim/telemetry-kit": "^0.8.
|
|
22
|
+
"@privateaim/kit": "^0.8.18",
|
|
23
|
+
"@privateaim/server-kit": "^0.8.18",
|
|
24
|
+
"@privateaim/telemetry-kit": "^0.8.18",
|
|
25
25
|
"@routup/basic": "^1.4.2",
|
|
26
26
|
"@routup/decorators": "^3.4.2",
|
|
27
27
|
"@routup/prometheus": "^2.4.1",
|
package/src/middlewares/error.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type { Router } from 'routup';
|
|
|
12
12
|
import { errorHandler } from 'routup';
|
|
13
13
|
import { useLogger } from '@privateaim/server-kit';
|
|
14
14
|
import { EntityRelationLookupError } from 'typeorm-extension';
|
|
15
|
-
import { ValidupNestedError } from 'validup';
|
|
15
|
+
import { ValidupNestedError, ValidupValidatorError } from 'validup';
|
|
16
16
|
|
|
17
17
|
export function mountErrorMiddleware(router: Router) {
|
|
18
18
|
router.use(errorHandler((error, req, res) => {
|
|
@@ -60,6 +60,11 @@ export function mountErrorMiddleware(router: Router) {
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
if (error.cause instanceof ValidupValidatorError) {
|
|
64
|
+
error.expose = true;
|
|
65
|
+
error.statusCode = 400;
|
|
66
|
+
}
|
|
67
|
+
|
|
63
68
|
// catch and decorate some db errors :)
|
|
64
69
|
switch (error.code) {
|
|
65
70
|
case 'ER_DUP_ENTRY':
|