You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/agent-memory/lt-dev-npm-package-maintainer/MEMORY.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,14 @@
10
10
-`@getbrevo/brevo` 3.x → 5.x: Complete API redesign (TransactionalEmailsApi, SendSmtpEmail, TransactionalEmailsApiApiKeys removed). Would require rewriting `src/core/common/services/brevo.service.ts`. See `blocking-updates.md` for details.
11
11
-`graphql-upload` 15.x → 17.x: Extension changed from `.js` to `.mjs`. Import paths in `src/core.module.ts`, `src/core/modules/file/core-file.resolver.ts`, `src/server/modules/file/file.resolver.ts`, and `src/types/graphql-upload.d.ts` would all need updating.
12
12
-`vite` 7.x → 8.x + `vite-plugin-node` 7.x → 8.x: Both must update together. vite-plugin-node@8.0.0 peerDep requires `vite: '^8.0.0'`. Blocked together.
13
-
-`better-auth` + `@better-auth/passkey` 1.5.5 → 1.5.6: `@better-auth/core@1.5.6/dist/instrumentation/tracer.mjs` directly imports `@opentelemetry/api`(SpanStatusCode, trace) — causes "Cannot find package '@opentelemetry/api'" errors across 38+ test files. Verified on 2026-04-04. Do NOT update until better-auth resolves this dep or we add @opentelemetry/api as a dev dep.
13
+
-`better-auth` + `@better-auth/passkey` 1.5.5 → 1.6.0: `@better-auth/core@1.6.0/dist/instrumentation/tracer.mjs`still directly imports `@opentelemetry/api` — causes "Cannot find package '@opentelemetry/api'" errors across 38+ test files. Verified on 2026-04-07. Do NOT update until better-auth resolves this dep or we add @opentelemetry/api as a dev dep. NOTE: 1.5.6 AND 1.6.0 both have this issue.
14
14
-`typescript` 5.x → 6.x: TypeScript 6.0.2 released 2026-03-23 (very new). Ecosystem readiness unknown — skip until NestJS/tools explicitly support it.
15
15
16
+
### Categorization Fix (Fixed 2026-04-07)
17
+
-`supertest` and `@types/supertest` moved from `devDependencies` to `dependencies`.
18
+
Reason: `src/test/test.helper.ts` (exported via `src/index.ts`) imports `supertest` at runtime.
19
+
Consuming projects would get runtime errors without it in `dependencies`.
20
+
16
21
### Critical Categorization Issue (Fixed in 2026-03-11)
17
22
-`ts-morph` was incorrectly in `devDependencies` but is IMPORTED in `src/core/modules/permissions/permissions-scanner.ts`. Moved to `dependencies`.
18
23
@@ -21,17 +26,18 @@
21
26
-`mongoose@9.4.1` bundles `~mongodb@7.1.x` (same as 9.3.x), so current mongodb@7.1.1 is still compatible.
22
27
- mongodb@7.1.1 is still the latest in the 7.x line — no update needed there.
23
28
24
-
### Overrides Status (updated 2026-04-04)
25
-
- minimatch overrides: updated to latest versions (3.1.5, 9.0.9, 10.2.5)
26
-
-`rollup@>=4.0.0 <4.60.1` → `4.60.1` override: still needed (4.60.1 is current latest)
29
+
### Overrides Status (updated 2026-04-07)
30
+
- minimatch overrides: at latest versions (3.1.5, 9.0.9, 10.2.5) — still needed
31
+
-`rollup@>=4.0.0 <4.60.1` → `4.60.1` override: **REMOVED 2026-04-07** — vite@7.3.2 now pulls rollup@4.60.1 directly, override was redundant
27
32
-`ajv` overrides still needed
28
-
-`undici@>=7.0.0 <7.24.7` → `7.24.7` override: updated from 7.24.3. @compodoc/compodoc>cheerio requires `^7.12.0` — still needed in 7.x range
29
-
-`srvx@<0.11.15` → `0.11.15` override: updated from 0.11.13. @tus/server 2.3.0 requires `~0.8.2` — still needed
30
-
-`handlebars@>=4.0.0 <4.7.9` → `4.7.9` override: @compodoc/compodoc requires `^4.7.8` — still needed for safety
33
+
-`undici@>=7.0.0 <7.24.7` → `7.24.7` override: still needed. @compodoc/compodoc>cheerio requires `^7.12.0` — still needed in 7.x range
34
+
-`srvx@<0.11.15` → `0.11.15` override: still needed. @tus/server 2.3.0 requires `~0.8.2` — still needed
35
+
-`handlebars@>=4.0.0 <4.7.9` → `4.7.9` override: still needed for safety
31
36
-`brace-expansion`, `picomatch`, `kysely` overrides: still needed (at latest)
32
-
-`path-to-regexp@>=8.0.0 <8.4.2` → `8.4.2` override: updated from 8.4.1 (new patch)
37
+
-`path-to-regexp@>=8.0.0 <8.4.2` → `8.4.2` override: still needed
33
38
-`lodash@>=4.0.0 <4.18.0` → `4.18.1` override: @nestjs/graphql pins lodash@4.17.23 which has CVE. 4.18.1 is now the latest lodash.
34
-
-`defu@<=6.1.4` → `6.1.6` override: still needed (6.1.6 is current latest)
39
+
-`defu@<=6.1.4` → `6.1.6` override: **UPDATED 2026-04-07** to `defu@<=6.1.6` → `6.1.7` (6.1.7 is now the latest)
40
+
-`vite@>=7.0.0 <=7.3.1` + `vite@>=7.1.0 <=7.3.1` duplicate overrides: **CONSOLIDATED 2026-04-07** to single `vite@>=7.0.0 <7.3.2` → `7.3.2`. Direct vite dep is now at 7.3.2.
35
41
-**REMOVED 2026-04-03**: `file-type@>=13.0.0 <21.3.2` → all nestjs packages now at 11.1.17 with file-type 21.3.2 natively
| Multi-Tenancy |`multiTenancy`| Presence Implies Enabled |`headerName: 'x-tenant-id'`, `membershipModel: 'TenantMember'`, `adminBypass: true`, `excludeSchemas: []`, `roleHierarchy: { member: 1, manager: 2, owner: 3 }`, `cacheTtlMs: 30000` (0 disables, process-local). System roles (`S_EVERYONE`, `S_USER`, `S_VERIFIED`) are checked as OR alternatives before real roles; method-level system roles take precedence; membership validated for context when system role grants access + header present. Hierarchy roles use level comparison, normal roles use exact match. Use `DefaultHR` or `createHierarchyRoles()` for type-safe role constants. Bypass: `RequestContext.runWithBypassTenantGuard()`. Cache invalidation: `CoreTenantGuard.invalidateUser(userId)` / `invalidateAll()`|
216
216
| BetterAuth Tenant Skip |`betterAuth.skipTenantCheck`| Explicit Boolean |`true` (default). When `true` and no `X-Tenant-Id` header is sent, IAM endpoints (controller + resolver) skip `CoreTenantGuard` tenant validation. When header IS present, normal membership validation runs regardless. Set `false` for tenant-aware auth scenarios (subdomain-based, invite links, SSO per tenant) |
217
+
| Debug Process Input |`debugProcessInput`| Explicit Boolean |`false` (default). When `true`, logs a debug message when `prepareInput()` changes the input type during `process()`. Has performance cost due to `JSON.stringify` on every `process()` call — enable only for debugging |
The `process()` pipeline (prepareInput → checkRights → serviceFunc → processFieldSelection → prepareOutput → checkRights) adds memory overhead per call through object cloning, Mongoose hydration, and populate operations. For typical API usage this is negligible, but it can become significant in:
209
+
210
+
-**High-frequency operations** (e.g. monitor checks running every 10-60 seconds)
211
+
-**Service cascades** (Service A → Service B → Service C, each going through process())
212
+
-**Populate chains** (3-5 levels of nested population)
213
+
214
+
**If a project experiences memory issues under high traffic**, check whether `process()` wrapping is the cause. Alternatives that preserve security:
215
+
216
+
| Instead of | Use | Security |
217
+
|-----------|-----|----------|
218
+
|`CrudService.create(input)`|`Model.insertMany([input])` — triggers all Mongoose plugins | Tenant, Audit, RoleGuard, Password all active |
219
+
|`CrudService.update(id, input)`|`Model.findByIdAndUpdate(id, input)` — triggers all Mongoose plugins | Tenant filter, Audit, RoleGuard all active |
220
+
|`CrudService.updateForce(id, input)`|`Model.findByIdAndUpdate(id, { $set: input }).lean()` — for system-internal updates | Plugins active, no process() overhead |
221
+
222
+
**NEVER** bypass Mongoose entirely via `collection.*` — see section above. The CheckSecurityInterceptor acts as a safety net on HTTP responses regardless of how data was written.
Copy file name to clipboardExpand all lines: FRAMEWORK-API.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# @lenne.tech/nest-server — Framework API Reference
2
2
3
-
> Auto-generated from source code on 2026-04-04 (v11.22.1)
3
+
> Auto-generated from source code on 2026-04-07 (v11.23.0)
4
4
> File: `FRAMEWORK-API.md` — compact, machine-readable API surface for Claude Code
5
5
6
6
## CoreModule.forRoot()
@@ -21,6 +21,7 @@
21
21
-`compression?`: `boolean | compression.CompressionOptions` — Whether to use the compression middleware package to enable gzip compression.
22
22
-`cookies?`: `boolean` — Whether to use cookies for authentication handling
23
23
-`cronJobs?`: `Record<string, string | false | 0 | CronJobConfigWithTimeZone<null, null> | C...` — Cron jobs configuration object with the name of the cron job function as key
24
+
-`debugProcessInput?`: `boolean` (default: `false`) — When true, logs a debug message when prepareInput() changes the input type during process().
24
25
-`email?`: `{ defaultSender?: { email?: string; name?: string; }; mailjet?: MailjetOption...` — SMTP and template configuration for sending emails
25
26
-`env?`: `string` — Environment
26
27
-`errorCode?`: `IErrorCode` — Configuration for the error code module
When `process()` is called from within another `process()` call (service cascades like A.create → B.create → C.create), steps 4–6 are **conditionally skipped** on inner calls to avoid redundant work:
1. Input authorization (step 2) always runs at every depth
881
+
2. Output authorization (step 6) runs at the outermost call
882
+
3.`CheckSecurityInterceptor` (Safety Net) runs on the final HTTP response
883
+
884
+
**Important:** Code running at depth > 0 (cron jobs, queue consumers, event handlers outside the HTTP cycle) must NOT return data directly to external consumers without either an outer depth-0 `process()` call or manual `checkRights` — the output rights check is skipped at depth > 0.
885
+
886
+
See [process() Performance Optimization](process-performance-optimization.md) for details.
`processResult()` handles population and `prepareOutput()` only. Security is handled by the Safety Net (Mongoose plugins for input, interceptors for output).
909
+
`processResult()` handles population and `prepareOutput()` only. It does **not** perform authorization checks (`checkRights`). Security is handled by the Safety Net (Mongoose plugins for input, interceptors for output). If called outside an HTTP request cycle (cron, queue), call `checkRights` manually before returning data to external consumers.
0 commit comments