@lenne.tech/nest-server 12.8.4 → 12.8.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/.claude/rules/testing.md +3 -3
- package/FRAMEWORK-API.md +1 -1
- package/dist/core/common/filters/http-exception-log.filter.js +4 -3
- package/dist/core/common/filters/http-exception-log.filter.js.map +1 -1
- package/migration-guides/12.8.4-to-12.8.5.md +39 -0
- package/package.json +1 -1
- package/src/core/common/filters/http-exception-log.filter.ts +7 -3
package/.claude/rules/testing.md
CHANGED
|
@@ -412,7 +412,7 @@ pnpm run check:mutations -- --id=<id> # one mutation
|
|
|
412
412
|
pnpm run check:mutations -- --list # the registry, without running anything
|
|
413
413
|
pnpm run check:mutations -- --allow-dirty # when the fix and its evidence share a working tree
|
|
414
414
|
pnpm run check:mutations -- --jobs=4 # N mutations at a time (default: 2, or 4 on >=12 cores)
|
|
415
|
-
pnpm run check:mutations -- --no-infra # only the
|
|
415
|
+
pnpm run check:mutations -- --no-infra # only the 406 that need no MongoDB
|
|
416
416
|
pnpm run check:mutations -- --since=<ref> # only mutations touching files changed since <ref>
|
|
417
417
|
pnpm run check:mutations -- --shard=2/4 # this job's quarter of the selection (CI splits the full run)
|
|
418
418
|
```
|
|
@@ -432,7 +432,7 @@ when the registry, a vitest config or a setup file changed, since those can move
|
|
|
432
432
|
commit, and in CI alongside the publish without blocking it. The price of caching is a cache that
|
|
433
433
|
has to model each spec's full dependency closure correctly, and getting that wrong produces a stale
|
|
434
434
|
PASS for a test that has since gone vacuous — exactly what the gate is there to prevent. Bad trade
|
|
435
|
-
at
|
|
435
|
+
at 641 mutations.
|
|
436
436
|
|
|
437
437
|
**Decided 2026-10-03 (repo owner): keep the full run.** Measured at 128 mutations, the CI job for
|
|
438
438
|
11.41.6 took **14 minutes**. The trigger to revisit is that wall time, not the mutation count —
|
|
@@ -505,7 +505,7 @@ exactly the environment where the answer matters.
|
|
|
505
505
|
|
|
506
506
|
Worth knowing before optimising the wrong thing: the specs behind all 235 e2e mutations add up to
|
|
507
507
|
**~40 seconds**. The step takes ~740s. The remaining ~700s is paying vitest's startup — process
|
|
508
|
-
spawn, transform, module graph, mongod connect, DB create and drop — once per mutation,
|
|
508
|
+
spawn, transform, module graph, mongod connect, DB create and drop — once per mutation, 641 times.
|
|
509
509
|
That work is largely single-threaded I/O and barely scales with cores: the full registry measures
|
|
510
510
|
**744s on a 12-core laptop and 777s on a 4-vCPU CI runner**.
|
|
511
511
|
|
package/FRAMEWORK-API.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lenne.tech/nest-server — Framework API Reference
|
|
2
2
|
|
|
3
|
-
> Auto-generated from source code as of 2026-11-09 (v12.8.
|
|
3
|
+
> Auto-generated from source code as of 2026-11-09 (v12.8.5)
|
|
4
4
|
> File: `FRAMEWORK-API.md` — compact, machine-readable API surface for Claude Code
|
|
5
5
|
|
|
6
6
|
## CoreModule.forRoot()
|
|
@@ -21,9 +21,10 @@ let HttpExceptionLogFilter = class HttpExceptionLogFilter {
|
|
|
21
21
|
const ctx = host.switchToHttp();
|
|
22
22
|
const res = ctx.getResponse();
|
|
23
23
|
const status = exception.getStatus();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const body = { ...exception };
|
|
25
|
+
delete body.options;
|
|
26
|
+
delete body.cause;
|
|
27
|
+
res.status(status).json(exception instanceof ServiceUnavailableException ? body.response : body);
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
HttpExceptionLogFilter = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-exception-log.filter.js","sourceRoot":"","sources":["../../../../src/core/common/filters/http-exception-log.filter.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAEL,KAAK,EAEL,aAAa,EACb,UAAU,EACV,MAAM,EACN,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AASxB,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAGtD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAIjC,KAAK,CAAC,SAAwB,EAAE,IAAmB;QAGjD,IAAI,SAAS,CAAC,SAAS,EAAE,KAAK,UAAU,CAAC,SAAS,EAAE,CAAC;YACnD,eAAe,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACN,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;QAGD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAkB,CAAC;QAC5C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,SAAS,CAAC;QACnB,CAAC;QAGD,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,EAAY,CAAC;QACxC,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"http-exception-log.filter.js","sourceRoot":"","sources":["../../../../src/core/common/filters/http-exception-log.filter.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAEL,KAAK,EAEL,aAAa,EACb,UAAU,EACV,MAAM,EACN,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AASxB,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAGtD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAIjC,KAAK,CAAC,SAAwB,EAAE,IAAmB;QAGjD,IAAI,SAAS,CAAC,SAAS,EAAE,KAAK,UAAU,CAAC,SAAS,EAAE,CAAC;YACnD,eAAe,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACN,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;QAGD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAkB,CAAC;QAC5C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,SAAS,CAAC;QACnB,CAAC;QAGD,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,EAAY,CAAC;QACxC,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;QAIrC,MAAM,IAAI,GAA4B,EAAE,GAAG,SAAS,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC;QAClB,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,2BAA2B,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACnG,CAAC;CACF,CAAA;AA/BY,sBAAsB;IADlC,KAAK,CAAC,aAAa,CAAC;GACR,sBAAsB,CA+BlC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Migration Guide: 12.8.4 → 12.8.5
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
| Category | Details |
|
|
6
|
+
|---|---|
|
|
7
|
+
| **Breaking Changes** | None |
|
|
8
|
+
| **New Features** | None |
|
|
9
|
+
| **Bugfixes** | Security: error responses of `HttpExceptionLogFilter` no longer contain `options` / `cause` (§1) |
|
|
10
|
+
| **Migration Effort** | None |
|
|
11
|
+
|
|
12
|
+
12.8.5 is a security patch for 12.8.4. The same fix ships in 12.6.8 (`latest-12.6`) and 11.46.1 (`latest-11`).
|
|
13
|
+
|
|
14
|
+
## Quick Migration
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm add @lenne.tech/nest-server@12.8.5
|
|
18
|
+
pnpm run update # nest-server-starter based projects
|
|
19
|
+
pnpm run build
|
|
20
|
+
pnpm test
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Vendor mode**: run `/lt-dev:backend:update-nest-server-core` as usual.
|
|
24
|
+
|
|
25
|
+
## 1. Error responses no longer contain `options` / `cause`
|
|
26
|
+
|
|
27
|
+
`HttpExceptionLogFilter` (registered by nest-server-starter's `main.ts` while `logExceptions` is on, its default)
|
|
28
|
+
answered a REST request with every field of the exception — including `options` and the `cause` the throwing code
|
|
29
|
+
passed (`new BadRequestException('…', { cause: dbError })`). An internal error message, a query or a connection
|
|
30
|
+
string could reach the client that way.
|
|
31
|
+
|
|
32
|
+
**What changed:** error responses now leave `options` and `cause` out. `response`, `status`, `message` and `name` stay
|
|
33
|
+
as before, so frontends that read them need no change. The cause is still logged. A test that asserted `options` or
|
|
34
|
+
`cause` in an error body has to drop that assertion.
|
|
35
|
+
|
|
36
|
+
## References
|
|
37
|
+
|
|
38
|
+
- `src/core/common/filters/http-exception-log.filter.ts`
|
|
39
|
+
- `tests/unit/http-exception-log-filter.spec.ts`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nest-server",
|
|
3
|
-
"version": "12.8.
|
|
3
|
+
"version": "12.8.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Server framework in TypeScript on top of NestJS: GraphQL and REST APIs on MongoDB, PostgreSQL, MySQL or MariaDB, with authentication, field-level permissions, multi-tenancy, offline sync and an AI assistant.",
|
|
6
6
|
"keywords": [
|
|
@@ -41,8 +41,12 @@ export class HttpExceptionLogFilter implements ExceptionFilter {
|
|
|
41
41
|
const ctx = host.switchToHttp();
|
|
42
42
|
const res = ctx.getResponse<Response>();
|
|
43
43
|
const status = exception.getStatus();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
// The exception's own fields, minus what it carries for the log: `options` and the `cause` passed to it (an
|
|
45
|
+
// internal error, a query, a connection string) must never reach the client. The shape the frontends read
|
|
46
|
+
// (response, status, message, name) is unchanged.
|
|
47
|
+
const body: Record<string, unknown> = { ...exception };
|
|
48
|
+
delete body.options;
|
|
49
|
+
delete body.cause;
|
|
50
|
+
res.status(status).json(exception instanceof ServiceUnavailableException ? body.response : body);
|
|
47
51
|
}
|
|
48
52
|
}
|