@adaptivestone/framework 5.3.2 → 5.4.0

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.
Files changed (82) hide show
  1. package/AGENTS.md +37 -0
  2. package/CHANGELOG.md +109 -0
  3. package/CLAUDE.md +1 -0
  4. package/README.md +34 -1
  5. package/dist/controllers/Auth.js +103 -33
  6. package/dist/controllers/Auth.js.map +1 -1
  7. package/dist/helpers/translate.d.ts +11 -0
  8. package/dist/helpers/translate.js +14 -0
  9. package/dist/helpers/translate.js.map +1 -0
  10. package/dist/locales/en/translation.json +1 -27
  11. package/dist/locales/ru/translation.json +3 -7
  12. package/dist/models/User.d.ts +3 -4
  13. package/dist/models/User.js +8 -0
  14. package/dist/models/User.js.map +1 -1
  15. package/dist/models/UserOld.js +8 -0
  16. package/dist/models/UserOld.js.map +1 -1
  17. package/dist/modules/BaseModel.d.ts +18 -3
  18. package/dist/modules/BaseModel.js.map +1 -1
  19. package/dist/services/http/HttpServer.js +9 -4
  20. package/dist/services/http/HttpServer.js.map +1 -1
  21. package/dist/services/http/middleware/AbstractMiddleware.d.ts +8 -0
  22. package/dist/services/http/middleware/AbstractMiddleware.js +11 -0
  23. package/dist/services/http/middleware/AbstractMiddleware.js.map +1 -1
  24. package/dist/services/http/middleware/Auth.js +1 -1
  25. package/dist/services/http/middleware/Auth.js.map +1 -1
  26. package/dist/services/http/middleware/I18n.js +6 -1
  27. package/dist/services/http/middleware/I18n.js.map +1 -1
  28. package/dist/services/http/middleware/RateLimiter.js +3 -1
  29. package/dist/services/http/middleware/RateLimiter.js.map +1 -1
  30. package/dist/services/http/middleware/RequestParser.js +3 -3
  31. package/dist/services/http/middleware/RequestParser.js.map +1 -1
  32. package/dist/services/http/middleware/Role.js +6 -2
  33. package/dist/services/http/middleware/Role.js.map +1 -1
  34. package/dist/services/i18n/I18n.d.ts +12 -0
  35. package/dist/services/i18n/I18n.js +73 -6
  36. package/dist/services/i18n/I18n.js.map +1 -1
  37. package/dist/services/messaging/email/escapeHtml.d.ts +6 -0
  38. package/dist/services/messaging/email/escapeHtml.js +12 -0
  39. package/dist/services/messaging/email/escapeHtml.js.map +1 -0
  40. package/dist/services/messaging/email/templates/recovery/html.d.ts +3 -0
  41. package/dist/services/messaging/email/templates/recovery/html.js +20 -0
  42. package/dist/services/messaging/email/templates/recovery/html.js.map +1 -0
  43. package/dist/services/messaging/email/templates/recovery/subject.d.ts +3 -0
  44. package/dist/services/messaging/email/templates/recovery/subject.js +3 -0
  45. package/dist/services/messaging/email/templates/recovery/subject.js.map +1 -0
  46. package/dist/services/messaging/email/templates/recovery/text.d.ts +3 -0
  47. package/dist/services/messaging/email/templates/recovery/text.js +15 -0
  48. package/dist/services/messaging/email/templates/recovery/text.js.map +1 -0
  49. package/dist/services/messaging/email/templates/verification/html.d.ts +3 -0
  50. package/dist/services/messaging/email/templates/verification/html.js +23 -0
  51. package/dist/services/messaging/email/templates/verification/html.js.map +1 -0
  52. package/dist/services/messaging/email/templates/verification/subject.d.ts +3 -0
  53. package/dist/services/messaging/email/templates/verification/subject.js +3 -0
  54. package/dist/services/messaging/email/templates/verification/subject.js.map +1 -0
  55. package/dist/services/messaging/email/templates/verification/text.d.ts +3 -0
  56. package/dist/services/messaging/email/templates/verification/text.js +15 -0
  57. package/dist/services/messaging/email/templates/verification/text.js.map +1 -0
  58. package/dist/services/messaging/email/types.d.ts +28 -0
  59. package/dist/services/messaging/email/types.js +2 -0
  60. package/dist/services/messaging/email/types.js.map +1 -0
  61. package/dist/tests/assertions.d.ts +4 -2
  62. package/dist/tests/assertions.js.map +1 -1
  63. package/dist/tests/mocks.d.ts +7 -0
  64. package/dist/tests/mocks.js +9 -0
  65. package/dist/tests/mocks.js.map +1 -1
  66. package/dist/tests/setupFramework.d.ts +4 -0
  67. package/dist/tests/setupFramework.js +8 -1
  68. package/dist/tests/setupFramework.js.map +1 -1
  69. package/dist/tests/setupNodeTest.js +7 -0
  70. package/dist/tests/setupNodeTest.js.map +1 -1
  71. package/dist/tests/testHelpers.d.ts +28 -8
  72. package/dist/tests/testHelpers.js +29 -0
  73. package/dist/tests/testHelpers.js.map +1 -1
  74. package/package.json +20 -8
  75. package/tsconfig.tests.json +14 -0
  76. package/dist/services/messaging/email/templates/.gitkeep +0 -0
  77. package/dist/services/messaging/email/templates/recovery/html.pug +0 -8
  78. package/dist/services/messaging/email/templates/recovery/subject.pug +0 -2
  79. package/dist/services/messaging/email/templates/recovery/text.pug +0 -3
  80. package/dist/services/messaging/email/templates/verification/html.pug +0 -10
  81. package/dist/services/messaging/email/templates/verification/subject.pug +0 -1
  82. package/dist/services/messaging/email/templates/verification/text.pug +0 -1
package/AGENTS.md ADDED
@@ -0,0 +1,37 @@
1
+ # AGENTS.md
2
+
3
+ Guidance for AI agents (and humans in a hurry) working on `@adaptivestone/framework`.
4
+
5
+ ## Check the plans first
6
+
7
+ All non-trivial work is tracked in `.plans/refactor/`. Status = directory:
8
+ `done/` shipped · `active/` in flight · `queued/` designed, not started · `later/` v6+ horizon.
9
+ `.plans/refactor/README.md` is the index and dependency map — it can lag the code, so verify its claims against the source before relying on them.
10
+
11
+ Before starting any task:
12
+
13
+ 1. Read `.plans/refactor/README.md`.
14
+ 2. Open every plan whose area overlaps the task (search the folder for the files/terms you are about to touch).
15
+ 3. If a plan covers the task, follow its settled decisions — do not silently re-design them.
16
+ 4. If your change conflicts with a queued/active plan, stop and flag the conflict instead of shipping a competing design.
17
+
18
+ Keep the plans in sync with the work:
19
+
20
+ - Finishing planned work = update the plan file, move it to the right status directory, and fix the README index in the same change.
21
+ - New non-trivial work gets a plan doc in `queued/` before implementation starts.
22
+
23
+ ## Verification
24
+
25
+ Run before claiming anything is done:
26
+
27
+ - `npm test` — full suite (node:test)
28
+ - `npm run check` — biome lint + format
29
+ - `npm run check:types` — codegen + `tsc --noEmit`
30
+ - `npm run check:types:tests` — same, but with the test suite included (`tsconfig.tests.json`)
31
+ - `npm run smoke` — packaging smoke test (pack → install into a scratch consumer)
32
+
33
+ ## Conventions
34
+
35
+ - Do not commit or push. Leave changes in the working tree — a human reviews every diff and does their own git.
36
+ - Changelog entries go under `Unreleased` in `CHANGELOG.md`.
37
+ - Match the surrounding code style; `biome` is the arbiter. Compact JSDoc, no framework-internals talk in public-facing docs.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,115 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ## [5.4.0] - 2026-09-01
10
+
11
+ ### Deprecated
12
+
13
+ - **`email.greeating` → `email.greeting`.** The greeting key the shipped email templates emit had carried a typo since it was introduced. The templates now emit the correctly spelled `email.greeting`; a catalog that only translates the old `email.greeating` keeps working — it is honoured as a fallback (new key → old key → the English default) until v6 removes it. Translate the new spelling going forward.
14
+
15
+ ### Fixed
16
+
17
+ - **`configureTestServer` now works in the documented arrangement — the boot no longer beats the preload that declares the options.** node:test runs a root `before()` registered from a `--import` preload immediately, synchronously inside the `before()` call — while the preload's module graph is still evaluating. The shipped setup glue therefore booted the test server, and closed the options window, during its own import; the preload's module body — where the 5.3.3 snippet places the `configureTestServer` call, below its hoisted imports — ran only afterwards, so every test file died on the helper's own "must be called before the test server boots" guard. The glue's `before()` hook now yields one microtask before booting, resuming after the whole preload graph has evaluated, so the documented snippet (setup-glue import above, call at module scope below) works as written. One arrangement remains out of reach: a preload that awaits at top level before calling — deferral cannot outwait arbitrary async work — and the guard's error message now names the fix for it (move the call into a separate module imported before the setup glue). Pinned by a spawned-runner regression test that executes the documented preload arrangement under `--test`.
18
+
19
+ ### Added
20
+
21
+ - **The test suite is type-checked now — `npm run check:types:tests`.** `tsconfig.json` excludes `src/**/*.test.ts` from the build, so no test file had ever been through `tsc`; a first run surfaced 164 errors. The new `tsconfig.tests.json` extends the build config with the tests included (fixtures stay out — they carry deliberate module augmentations and are already checked in isolation by `ModelTyping.typecheck.test.ts` and `routeTypes.golden.test.ts`), and CI runs it alongside `check:types`. Two things it caught, both silent until now: 20 `it()` calls still used Vitest's `it(name, fn, timeout)` signature, which node:test ignores — every one of those per-test timeouts, up to 240s, had quietly been running under the global 10s cap and is now declared as `it(name, { timeout }, fn)`; and `assertThrowsLike` / `assertRejectsLike` in `tests/assertions.js` matched error *classes* at runtime while typing the argument as a plain function, so `assertThrowsLike(fn, MyError)` failed to compile. The parameter now accepts constructors.
22
+
23
+ - **The shipped test bootstrap now accepts project `Server` options, so `bootHttp` runs under test.** `Server` takes exactly two things — `folders` and the `bootHttp` hook — and the test bootstrap passed only the first, hardcoding `new Server({ folders })`. Every project that wires app-wide HTTP behavior in `bootHttp` (error handlers via `registerErrorHandler`, ad-hoc routes, Express middleware) therefore ran its tests against a server that had none of it: a mapped 400 in production showed up as a 500 under test, with nothing reporting the difference. Declare them with `configureTestServer` from `tests/testHelpers.js`, at module scope in the preload that imports the setup glue:
24
+
25
+ ```ts
26
+ import { configureTestServer } from '@adaptivestone/framework/tests/testHelpers.js';
27
+ import '@adaptivestone/framework/tests/setupNodeTest.js';
28
+
29
+ configureTestServer({ bootHttp: (app) => { /* same wiring as production */ } });
30
+ ```
31
+
32
+ `folders` stays owned by the bootstrap (it resolves those from the `TEST_FOLDER_*` env vars). Calling it after the server has booted throws rather than silently doing nothing — a late call cannot retroactively wire the running server, and a silent skip is exactly the failure this fixes. Also closes a coverage hole: `bootHttp` shipped in 5.1 with no test exercising it end to end, for the same reason.
33
+
34
+ - **Built-in middleware messages are now translatable — and can no longer leak a raw key.** The six messages the shipped middleware return were hardcoded English with no way for an app to reword or translate them. Each is now emitted with an i18n key **and** the current English text as its in-code default, so responses stay byte-identical unless the app's locale files actually define the key:
35
+
36
+ | Key | Default (English) |
37
+ |---|---|
38
+ | `middleware.auth.notLoggedIn` | Please login to application |
39
+ | `middleware.role.userRequired` | User should be provided |
40
+ | `middleware.role.noAccess` | You do not have access |
41
+ | `middleware.rateLimiter.tooManyRequests` | Too Many Requests |
42
+ | `middleware.requestParser.entityTooLarge` | Request entity too large. Your upload exceeds the allowed size or count limits. |
43
+ | `middleware.requestParser.parseError` | Error to parse your request. You provided invalid content type or content-length. Please check your request headers and content type. |
44
+
45
+ Nothing is added to the framework's own locale files — the in-code default is the single English source of truth, and a key present in the app's locales always wins, so existing translations keep working unchanged. The default also holds in every degenerate case: i18n disabled (the fallback translator now honours `defaultValue` instead of handing back the key), a request with no i18n at all, or a `t()` that returns a non-string. Custom middleware get the same behavior from the new protected `translate(req, key, defaultValue)` helper on `AbstractMiddleware`. Machine-readable fields are untouched — the auth 401 still carries `error: 'AUTH001'` — and the rate limiter's 500 `RateLimiter error` stays hardcoded, as it reports a misconfigured limiter to operators rather than something the caller can act on. With `saveMissing: true` in `config/i18n.ts`, a request that hits one of these messages writes the English default into `<lng>/translation.missing.json`, giving translators a ready-made starter file.
46
+
47
+ - **The 404 and 500 fallback responses joined the translatable set.** `HttpServer`'s two sinks — the 404 for a path no route matched, and the generic 500 that finalizes an unhandled error — answered with hardcoded JSON. Both now emit an i18n key with the current English text as its in-code default, exactly like the middleware messages above:
48
+
49
+ | Key | Default (English) |
50
+ |---|---|
51
+ | `http.notFound` | 404 |
52
+ | `http.serverError` | Something broke! |
53
+
54
+ Same semantics: nothing is added to the framework's locale files, a key present in the app's locales wins, and the English default holds when i18n is disabled, when the request carries no i18n at all, or when `t()` returns a non-string — so untranslated responses stay byte-identical. Status codes are untouched, as is the guard that hands a 500 arriving after the response already started to Express's own finalizer.
55
+
56
+ - **Bun 1.4+ is now a supported runtime.** The same application code runs on Bun through its Node compatibility layer and the existing Express adapter — no Bun-specific build, no `Bun.serve` path, no dependency pin or override. 1.4.0 is the declared floor because it is the first stable Bun that imports the Mongoose/BSON dependency graph the framework resolves; `engines` now declares `bun: >=1.4.0` alongside `node: >=24.0.0`, which npm and Bun both read as alternative runtime constraints. CI runs two new jobs on the floor and on latest stable Bun: the framework suite (`npm run test:bun`) and a packed-consumer smoke test (`npm run smoke:bun`) that installs the published tarball with `bun install`, imports every public entry point, checks the exports map still blocks internal subpaths, boots a `Server` against a real MongoDB, serves a request, runs Mongoose create/read/update/delete and shuts down clean. Node remains the primary runtime and is unaffected.
57
+
58
+ Two things stay Node-only, and are documented in `README.md`. **`cluster.js` / `runCluster`** imports fine under Bun but only the Node path is tested — run single-process under Bun. **Node's test-runner CLI**: Bun implements the `node:test` API but not `node --test`, so a Bun project runs its suite with `bun test` plus the framework's existing preloads instead of the Node flags. Four framework test files need `mock.module()` (Node's `--experimental-test-module-mocks`), which Bun does not implement ([oven-sh/bun#5090](https://github.com/oven-sh/bun/issues/5090)); they are the only exclusions from the Bun run and are named in the README. Every other test passes on both runtimes. One further Bun quirk worth knowing when writing tests: `assert.deepStrictEqual` reports any `Proxy` — which is what a Mongoose array is — as unequal, so spread it first (`[...doc.tags]`).
59
+
60
+ ### Changed
61
+
62
+ - **Behavior change — a framework message whose key is missing now falls back to English instead of leaking the raw key, and `i18next` is optional.** The built-in auth controller, its request validation and the shipped email templates emitted bare i18n keys with no default, so an app whose locale files did not carry the key answered with `auth.messageSome` or `email.registered` in place of a sentence — the example project copied 3 of 26 keys and hit exactly that. Every framework-emitted key now travels with its current English text as an in-code `defaultValue` (validation issues carry it in `params`, which `ValidateService` already forwards to `t()`), so a key present in your locales still wins and existing translations are byte-identical, while a miss reads as English:
63
+
64
+ | Key | Default (English) |
65
+ |---|---|
66
+ | `auth.emailProvided` | Email must be provided |
67
+ | `auth.emailValid` | Email is not valid |
68
+ | `auth.passwordProvided` | Password must be provided |
69
+ | `auth.passwordValid` | Password is not valid,only a-z,A-Z,0-9,!,@,#,$,%,ˆ,&,*,(,),_,+,{,},[,],<,> |
70
+ | `auth.passwordRecoveryTokenProvided` | Password recovery token must be provided |
71
+ | `auth.nickNameValid` | Nick name is not valid,only a-z,A-Z,0-9 |
72
+ | `auth.nameValid` | Name is not valid |
73
+ | `auth.errorUPValid` | User/password not valid |
74
+ | `auth.nicknameExists` | User with such nickname already exists |
75
+ | `auth.recoveryEmailSent` | If an account exists for this address, a recovery email has been sent. |
76
+ | `auth.verificationEmailSent` | If an account exists for this address, a verification email has been sent. |
77
+ | `email.notVerified` | Your email is not verified |
78
+ | `email.registered` | User with such an email already registered |
79
+ | `email.alreadyVerifiedOrWrongToken` | Your email is already verified or your verification token is wrong |
80
+ | `email.passwordRecovery` | Recovery password |
81
+ | `email.passwordChanged` | Password changed |
82
+ | `email.greeating` | Dear user |
83
+ | `password.wrongToken` | Password recovery token is not valid |
84
+
85
+ `password.wrongToken` is the one message that never had a catalog entry at all — a wrong recovery token answered with the literal string `password.wrongToken` — so its English text is new. The in-code default is now the single English source of truth: the keys above were removed from the framework's `en/translation.json` (what remains there has no emit site in the framework, so nothing covers it), and `ru/translation.json` still ships in full and still wins for `ru` requests.
86
+
87
+ `i18next` and `i18next-fs-backend` move from dependencies to **optional peer dependencies**, the treatment `@redis/client`, `yup` and `oxc-parser` already got. **Install both only if you actually translate** (`npm i i18next i18next-fs-backend`); the default `i18n.enabled: true` no longer implies they are present. They are still imported lazily and only when i18n is enabled, so a fresh install serves every framework message in English with no translation engine at all; the first request that needs a translator logs one warning — naming both packages and the `enabled` flag — and then falls back for the rest of the process, rather than repeating per request or failing the request. `getI18nBaseInstance()` (the raw i18next instance) still rejects with that message for callers that require the real thing. Consumers who type-check with `skipLibCheck: false` will see `Cannot find module 'i18next'` reported inside the framework's `.d.ts` files if the package is absent — the same trade-off the other optional peers already carry; keep `skipLibCheck: true` (what the project template ships) or install the packages.
88
+
89
+ - **The shipped email templates are now JavaScript template modules, and the built-in auth mails require `@adaptivestone/framework-module-email` >= 2.1.** `recovery` and `verification` shipped as `.pug` files, which rendered only because the email module used to bundle Pug; v2 dropped every bundled engine, so on module v2 an app that triggered password recovery or email verification without registering a Pug engine got a render failure instead of a mail. Each template file is now a small module whose default export turns the render data into the rendered string — `html`, `subject` and `text` per template folder — which module 2.1 renders with its built-in module engine. `tsc` compiles them into `dist`, and `postbuild` no longer copies `src/services/messaging` wholesale: the email module picks its renderer from the on-disk extension, so a raw `.ts` sitting next to the compiled `.js` could be handed to a consumer that cannot run it. A published template folder now holds compiled `.js` only, which the packaging smoke test asserts and renders. `folders.emails` overrides are unchanged — an app still points at its own folder and ships `.ts` (run natively), `.js` (compiled) or any extension it registers an engine for. The `peerDependencies` range narrows from `^1.0.0 || ^2.0.0` to `^2.1.0` to match: **an older module renders the new defaults as an unknown-extension error, exactly the failure the `.pug` defaults already produced there, so no working setup regresses.** The module stays an *optional* peer — an app that never sends the built-in auth mails still needs none of it. The data a template receives is typed by `TEmailTemplateData` (`locale`, `t`, `link`, `editor`, plus anything `globalVariablesToTemplates` adds), which ships compiled in `dist` but is not on the package `exports` map yet.
90
+
91
+ - **The shipped email HTML now declares the language it is written in.** `recovery` and `verification` hardcoded `<html lang="en">` while every sentence inside already followed the request locale, so a Russian mail still announced itself as English to screen readers, mail clients and translation prompts. Both templates now render `lang` from the `locale` the email module passes in — escaped like every other interpolated value — and fall back to `en` when it is absent or empty.
92
+
93
+ ### Fixed
94
+
95
+ - **Plain nested paths carried a phantom `_id` on hydrated documents.** Mongoose builds a subdocument, and generates an `_id` for it, only for the `{ type: { … } }` spelling; a plain nested object (`name: { first: String, last: String }`) is a path grouping that never gets an `_id` at runtime. `InferHydratedDocType` types both the same way, intersecting `{ _id: ObjectId }` onto nested paths too — so `doc.name._id` compiled for a value that is always `undefined`, and assigning the real runtime shape (`doc.name = { first: 'Ada' }`) was a type error on a property Mongoose will never persist, pushing consumers to `Omit<…, 'name'>` bridges or `unknown` casts at every nested-path call site. The framework's hydrated correction — which already strips the `_id` Mongoose adds to `_id: false` subdocuments — now also drops it from plain nested paths, at any depth, using the same no-`type`-wrapper discriminator the override pass uses. Real single-nested subdocuments keep their `_id`, and the raw/lean/create surfaces are untouched: those already matched runtime exactly. The framework's own `User.name` was affected.
96
+
97
+ - **Verification emails were hardcoded Russian.** `verification/{subject,html,text}` carried Russian sentences and not a single `t()` call, so every app sent `Верификаия емейла` to every user whatever their locale — and the HTML greeted `#{username}`, a variable the auth flow never passes, so the greeting rendered empty for everyone. The three templates now mirror `recovery`: English text, every string emitted through `t(key, { defaultValue })` so a key present in your locales wins and a miss reads as English, and the greeting taken from the existing `email.greeating` key instead of a phantom variable.
98
+
99
+ | Key | Default (English) |
100
+ |---|---|
101
+ | `email.emailConfirm` | Email confirmation |
102
+ | `email.verify` | Verify email |
103
+ | `email.verifyInstructions` | To verify your email address, follow the link: |
104
+ | `email.greeating` | Dear user |
105
+
106
+ `email.emailConfirm` and `email.verify` were already in the locale files with no emit site anywhere; now that they are emitted their English text lives in code like every other framework message, so the two keys were dropped from `en/translation.json`. `ru/translation.json` still wins for `ru` requests and now carries a Russian `email.verifyInstructions` of its own. Values interpolated into the HTML body are escaped, which the template language used to do implicitly.
107
+
108
+ - **An auth mail for a user with no email address is now a logged `false` instead of a crash or a mail to nobody.** `email` is optional on both `User` and `UserOld`, but `sendVerificationEmail` and `sendPasswordRecoveryEmail` went straight to minting a token and handing `this.email` to the mailer: `User` rejected with `Email is required` from the token helper it calls first, and `UserOld` hashed the literal string `undefined` into a token, saved it on the user, and then called `mail.send(undefined)`. All four methods now check the address first, report `Cannot send <kind> email: user has no email address` through the same logger that already reports a missing mailer module, and return `false` — the value every call site handles.
109
+
110
+ ### Removed
111
+
112
+ - **Three dead framework locale keys.** `auth.errorUExist`, `auth.errorUAlready` and `auth.noAccessRights` had no emit site left anywhere in the framework — nothing could produce them — so they are gone from both `en/translation.json` and `ru/translation.json`. An app that defines the same keys in its own locales is unaffected: the framework never looked them up.
113
+
114
+ - **Two more dead framework locale keys.** `auth.userProvided` and `email.newPassword` had no emit site in the framework either. `auth.userProvided` was quoted only by a benchmark fixture, which now carries its English text as an in-code `defaultValue` like every framework message does, so nothing looks the key up any more. Both are gone from `en/translation.json` and `ru/translation.json` — that leaves `en`'s `email` namespace empty, so it went with them. An app that defines the same keys in its own locales is unaffected.
115
+
7
116
  ## [5.3.2] - 2026-08-08
8
117
 
9
118
  ### Fixed
package/CLAUDE.md ADDED
@@ -0,0 +1 @@
1
+ @AGENTS.md
package/README.md CHANGED
@@ -10,10 +10,43 @@ types, and batteries-included auth, rate limiting, i18n, and caching.
10
10
 
11
11
  ## Requirements
12
12
 
13
- - **Node ≥ 24** (ESM-only, runs `.ts` sources natively)
13
+ - **Node ≥ 24** (ESM-only, runs `.ts` sources natively) — or **Bun ≥ 1.4.0**, see [Runtimes](#runtimes)
14
14
  - **MongoDB** — required; boot fails fast without `MONGO_DSN`
15
15
  - **`AUTH_SALT`** — required; generate one with `node src/cli.ts generateRandomBytes`
16
16
 
17
+ ## Runtimes
18
+
19
+ Node is the primary runtime. **Bun ≥ 1.4.0** is supported as an additional one:
20
+ the same application code, the same Express adapter, running on Bun's Node
21
+ compatibility layer — there is no Bun-specific build, no `Bun.serve` path, and
22
+ no dependency pin or override needed. 1.4.0 is the floor because it is the first
23
+ stable Bun that imports the Mongoose/BSON graph the framework resolves.
24
+
25
+ Certified on every release, on both the floor and the latest stable Bun: the
26
+ framework test suite; and a consumer that installs the published tarball with
27
+ `bun install`, imports the public entry points, boots a `Server`, serves a
28
+ request, runs Mongoose create/read/update/delete against MongoDB and shuts down.
29
+
30
+ Node-only, as of Bun 1.4:
31
+
32
+ - **`cluster.js` / `runCluster`** — the multi-process production entry point. It
33
+ imports fine under Bun, but only the Node path is tested; run single-process
34
+ under Bun (or put the process manager outside the app).
35
+ - **Node's test-runner CLI.** Bun implements the `node:test` *API* but not
36
+ `node --test`, so a Bun project runs its suite with `bun test` and the
37
+ framework preloads rather than the flags the Node docs show. Four framework
38
+ test files need `mock.module()` (Node's `--experimental-test-module-mocks`),
39
+ which Bun does not implement ([oven-sh/bun#5090][bun-5090]), and are the only
40
+ thing excluded from the Bun run: `cluster.test.ts`, `models/UserOld.test.ts`,
41
+ `helpers/redis/redisConnection.failure.test.ts`,
42
+ `services/i18n/I18n.missing.test.ts`. Everything else passes on both runtimes.
43
+ - **`assert.deepStrictEqual` against a Mongoose array.** Bun 1.4 reports any
44
+ `Proxy` — which is what a Mongoose array is — as unequal. Spread it first
45
+ (`[...doc.tags]`). This is a test-assertion quirk; the values themselves are
46
+ correct.
47
+
48
+ [bun-5090]: https://github.com/oven-sh/bun/issues/5090
49
+
17
50
  ## Quickstart
18
51
 
19
52
  The fastest way to start is to clone the example project and use it as a
@@ -4,8 +4,31 @@ import GetUserByToken from '../services/http/middleware/GetUserByToken.js';
4
4
  import RateLimiter from '../services/http/middleware/RateLimiter.js';
5
5
  import { defineSchema } from '../services/validate/defineSchema.js';
6
6
  // Zero-dependency validation for the built-in auth routes. Messages are i18n
7
- // keys (see `src/locales/*`); the framework auto-translates them via the
8
- // request's `i18n.t` before the error is serialized.
7
+ // keys; the framework auto-translates them via the request's `i18n.t` before
8
+ // the error is serialized, passing the English text below as `defaultValue`.
9
+ // English source of truth for the built-in auth messages. Every emit site sends
10
+ // its i18n key together with this text as i18next's `defaultValue`: an app that
11
+ // ships the key in its own locales still wins, an app that ships nothing gets
12
+ // English instead of a raw `auth.*`/`email.*` key.
13
+ const EN = {
14
+ 'auth.emailProvided': 'Email must be provided',
15
+ 'auth.emailValid': 'Email is not valid',
16
+ 'auth.passwordProvided': 'Password must be provided',
17
+ 'auth.passwordValid': 'Password is not valid,only a-z,A-Z,0-9,!,@,#,$,%,ˆ,&,*,(,),_,+,{,},[,],<,>',
18
+ 'auth.passwordRecoveryTokenProvided': 'Password recovery token must be provided',
19
+ 'auth.nickNameValid': 'Nick name is not valid,only a-z,A-Z,0-9',
20
+ 'auth.nameValid': 'Name is not valid',
21
+ 'auth.errorUPValid': 'User/password not valid',
22
+ 'auth.nicknameExists': 'User with such nickname already exists',
23
+ 'auth.recoveryEmailSent': 'If an account exists for this address, a recovery email has been sent.',
24
+ 'auth.verificationEmailSent': 'If an account exists for this address, a verification email has been sent.',
25
+ 'email.notVerified': 'Your email is not verified',
26
+ 'email.registered': 'User with such an email already registered',
27
+ 'email.alreadyVerifiedOrWrongToken': 'Your email is already verified or your verification token is wrong',
28
+ // The only key with no catalog entry: until now this response leaked the raw
29
+ // `password.wrongToken` string, so the English text is new in this release.
30
+ 'password.wrongToken': 'Password recovery token is not valid',
31
+ };
9
32
  const EMAIL_RE = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
10
33
  const PASSWORD_RE = /^[a-zA-Z0-9!@#$%ˆ^&*()_+\-{}[\]<>]+$/;
11
34
  const NICK_RE = /^[a-zA-Z0-9_\-.]+$/;
@@ -32,10 +55,18 @@ const duplicateKeyFields = (err) => {
32
55
  };
33
56
  const pushEmailIssues = (email, issues) => {
34
57
  if (isMissing(email)) {
35
- issues.push({ message: 'auth.emailProvided', path: ['email'] });
58
+ issues.push({
59
+ message: 'auth.emailProvided',
60
+ path: ['email'],
61
+ params: { defaultValue: EN['auth.emailProvided'] },
62
+ });
36
63
  }
37
64
  else if (typeof email !== 'string' || !EMAIL_RE.test(email)) {
38
- issues.push({ message: 'auth.emailValid', path: ['email'] });
65
+ issues.push({
66
+ message: 'auth.emailValid',
67
+ path: ['email'],
68
+ params: { defaultValue: EN['auth.emailValid'] },
69
+ });
39
70
  }
40
71
  };
41
72
  // Back-compat: the auth config key was misspelled `isAuthWithVefificationFlow`
@@ -70,6 +101,7 @@ class Auth extends AbstractController {
70
101
  issues.push({
71
102
  message: 'auth.passwordProvided',
72
103
  path: ['password'],
104
+ params: { defaultValue: EN['auth.passwordProvided'] },
73
105
  });
74
106
  }
75
107
  if (issues.length) {
@@ -98,6 +130,7 @@ class Auth extends AbstractController {
98
130
  issues.push({
99
131
  message: 'auth.passwordProvided',
100
132
  path: ['password'],
133
+ params: { defaultValue: EN['auth.passwordProvided'] },
101
134
  });
102
135
  }
103
136
  else if (typeof password !== 'string' ||
@@ -105,6 +138,7 @@ class Auth extends AbstractController {
105
138
  issues.push({
106
139
  message: 'auth.passwordValid',
107
140
  path: ['password'],
141
+ params: { defaultValue: EN['auth.passwordValid'] },
108
142
  });
109
143
  }
110
144
  // nickName is optional, but an empty string is invalid (matches the
@@ -114,16 +148,25 @@ class Auth extends AbstractController {
114
148
  issues.push({
115
149
  message: 'auth.nickNameValid',
116
150
  path: ['nickName'],
151
+ params: { defaultValue: EN['auth.nickNameValid'] },
117
152
  });
118
153
  }
119
154
  // firstName/lastName are optional free-form strings, but a non-string
120
155
  // (array/object) would otherwise reach `User.create` and fail the
121
156
  // Mongoose String cast with a 500. Reject it as a 400 (yup parity).
122
157
  if (firstName != null && typeof firstName !== 'string') {
123
- issues.push({ message: 'auth.nameValid', path: ['firstName'] });
158
+ issues.push({
159
+ message: 'auth.nameValid',
160
+ path: ['firstName'],
161
+ params: { defaultValue: EN['auth.nameValid'] },
162
+ });
124
163
  }
125
164
  if (lastName != null && typeof lastName !== 'string') {
126
- issues.push({ message: 'auth.nameValid', path: ['lastName'] });
165
+ issues.push({
166
+ message: 'auth.nameValid',
167
+ path: ['lastName'],
168
+ params: { defaultValue: EN['auth.nameValid'] },
169
+ });
127
170
  }
128
171
  if (issues.length) {
129
172
  return { issues };
@@ -165,6 +208,7 @@ class Auth extends AbstractController {
165
208
  issues.push({
166
209
  message: 'auth.passwordProvided',
167
210
  path: ['password'],
211
+ params: { defaultValue: EN['auth.passwordProvided'] },
168
212
  });
169
213
  }
170
214
  else if (typeof password !== 'string' ||
@@ -172,12 +216,16 @@ class Auth extends AbstractController {
172
216
  issues.push({
173
217
  message: 'auth.passwordValid',
174
218
  path: ['password'],
219
+ params: { defaultValue: EN['auth.passwordValid'] },
175
220
  });
176
221
  }
177
222
  if (isMissing(passwordRecoveryToken)) {
178
223
  issues.push({
179
224
  message: 'auth.passwordRecoveryTokenProvided',
180
225
  path: ['passwordRecoveryToken'],
226
+ params: {
227
+ defaultValue: EN['auth.passwordRecoveryTokenProvided'],
228
+ },
181
229
  });
182
230
  }
183
231
  if (issues.length) {
@@ -212,16 +260,20 @@ class Auth extends AbstractController {
212
260
  const userResult = await User.getUserByEmailAndPassword(req.appInfo.request.email, // we do a request casting
213
261
  req.appInfo.request.password);
214
262
  if (!userResult) {
215
- return res
216
- .status(400)
217
- .json({ message: req.appInfo.i18n?.t('auth.errorUPValid') });
263
+ return res.status(400).json({
264
+ message: req.appInfo.i18n?.t('auth.errorUPValid', {
265
+ defaultValue: EN['auth.errorUPValid'],
266
+ }),
267
+ });
218
268
  }
219
269
  // TypeScript now knows userResult is not false, so it has the instance methods
220
270
  const user = userResult;
221
271
  const isAuthWithVerificationFlow = isVerificationFlowEnabled(this.app.getConfig('auth'));
222
272
  if (isAuthWithVerificationFlow && !user.isVerified) {
223
273
  return res.status(400).json({
224
- message: req.appInfo.i18n?.t('email.notVerified'),
274
+ message: req.appInfo.i18n?.t('email.notVerified', {
275
+ defaultValue: EN['email.notVerified'],
276
+ }),
225
277
  notVerified: true,
226
278
  });
227
279
  }
@@ -237,18 +289,22 @@ class Auth extends AbstractController {
237
289
  // forbids registration enumeration, move to an email-verification-first flow.
238
290
  let user = (await User.getUserByEmail(req.appInfo.request.email));
239
291
  if (user) {
240
- return res
241
- .status(400)
242
- .json({ message: req.appInfo.i18n?.t('email.registered') });
292
+ return res.status(400).json({
293
+ message: req.appInfo.i18n?.t('email.registered', {
294
+ defaultValue: EN['email.registered'],
295
+ }),
296
+ });
243
297
  }
244
298
  if (req.appInfo.request.nickName) {
245
299
  user = (await User.findOne({
246
300
  'name.nick': req.appInfo.request.nickName,
247
301
  }));
248
302
  if (user) {
249
- return res
250
- .status(400)
251
- .json({ message: req.appInfo.i18n?.t('auth.nicknameExists') });
303
+ return res.status(400).json({
304
+ message: req.appInfo.i18n?.t('auth.nicknameExists', {
305
+ defaultValue: EN['auth.nicknameExists'],
306
+ }),
307
+ });
252
308
  }
253
309
  }
254
310
  try {
@@ -270,14 +326,18 @@ class Auth extends AbstractController {
270
326
  // so the error-handler registry keeps returning its honest 500.
271
327
  const dupFields = duplicateKeyFields(err);
272
328
  if (dupFields?.includes('email')) {
273
- return res
274
- .status(400)
275
- .json({ message: req.appInfo.i18n?.t('email.registered') });
329
+ return res.status(400).json({
330
+ message: req.appInfo.i18n?.t('email.registered', {
331
+ defaultValue: EN['email.registered'],
332
+ }),
333
+ });
276
334
  }
277
335
  if (dupFields?.includes('name.nick')) {
278
- return res
279
- .status(400)
280
- .json({ message: req.appInfo.i18n?.t('auth.nicknameExists') });
336
+ return res.status(400).json({
337
+ message: req.appInfo.i18n?.t('auth.nicknameExists', {
338
+ defaultValue: EN['auth.nicknameExists'],
339
+ }),
340
+ });
281
341
  }
282
342
  throw err;
283
343
  }
@@ -314,13 +374,17 @@ class Auth extends AbstractController {
314
374
  }
315
375
  catch {
316
376
  return res.status(400).json({
317
- message: req.appInfo.i18n?.t('email.alreadyVerifiedOrWrongToken'),
377
+ message: req.appInfo.i18n?.t('email.alreadyVerifiedOrWrongToken', {
378
+ defaultValue: EN['email.alreadyVerifiedOrWrongToken'],
379
+ }),
318
380
  });
319
381
  }
320
382
  this.logger?.debug(`Verify user ${user?.id}`);
321
383
  if (!user) {
322
384
  return res.status(400).json({
323
- message: req.appInfo.i18n?.t('email.alreadyVerifiedOrWrongToken'),
385
+ message: req.appInfo.i18n?.t('email.alreadyVerifiedOrWrongToken', {
386
+ defaultValue: EN['email.alreadyVerifiedOrWrongToken'],
387
+ }),
324
388
  });
325
389
  }
326
390
  user.isVerified = true;
@@ -344,9 +408,11 @@ class Auth extends AbstractController {
344
408
  catch (e) {
345
409
  this.logger?.error(e);
346
410
  }
347
- return res
348
- .status(200)
349
- .json({ message: req.appInfo.i18n?.t('auth.recoveryEmailSent') });
411
+ return res.status(200).json({
412
+ message: req.appInfo.i18n?.t('auth.recoveryEmailSent', {
413
+ defaultValue: EN['auth.recoveryEmailSent'],
414
+ }),
415
+ });
350
416
  }
351
417
  async recoverPassword(req, res) {
352
418
  const User = this.app.getModel('User');
@@ -354,9 +420,11 @@ class Auth extends AbstractController {
354
420
  this.logger?.error(e);
355
421
  });
356
422
  if (!user) {
357
- return res
358
- .status(400)
359
- .json({ message: req.appInfo.i18n?.t('password.wrongToken') });
423
+ return res.status(400).json({
424
+ message: req.appInfo.i18n?.t('password.wrongToken', {
425
+ defaultValue: EN['password.wrongToken'],
426
+ }),
427
+ });
360
428
  }
361
429
  this.logger?.debug(`Password recovery user ${user.id}`);
362
430
  user.password = req.appInfo.request.password;
@@ -383,9 +451,11 @@ class Auth extends AbstractController {
383
451
  catch (e) {
384
452
  this.logger?.error(e);
385
453
  }
386
- return res
387
- .status(200)
388
- .json({ message: req.appInfo.i18n?.t('auth.verificationEmailSent') });
454
+ return res.status(200).json({
455
+ message: req.appInfo.i18n?.t('auth.verificationEmailSent', {
456
+ defaultValue: EN['auth.verificationEmailSent'],
457
+ }),
458
+ });
389
459
  }
390
460
  static get middleware() {
391
461
  return new Map([['/{*splat}', [GetUserByToken, RateLimiter]]]);
@@ -1 +1 @@
1
- {"version":3,"file":"Auth.js","sourceRoot":"","sources":["../../src/controllers/Auth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,kBAAkB,MAAM,kCAAkC,CAAC;AAClE,OAAO,cAAc,MAAM,+CAA+C,CAAC;AAC3E,OAAO,WAAW,MAAM,4CAA4C,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAcpE,6EAA6E;AAC7E,yEAAyE;AACzE,qDAAqD;AACrD,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAC9C,MAAM,WAAW,GAAG,sCAAsC,CAAC;AAC3D,MAAM,OAAO,GAAG,oBAAoB,CAAC;AACrC,MAAM,SAAS,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AAC5E,+EAA+E;AAC/E,wEAAwE;AACxE,gFAAgF;AAChF,0EAA0E;AAC1E,MAAM,SAAS,GAAG,CAAC,CAAU,EAAW,EAAE,CACxC,CAAC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G,CAAC,QAAQ,CAAC,MAAM,CAAqB,CAAC;QAC3D,2EAA2E;QAC3E,0EAA0E;QAC1E,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAClE,IAAI,IAAI,EAAE,CAAC;gBACT,KAAM,IAAqB;qBACxB,qBAAqB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;qBACvC,KAAK,CAAC,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YAC1B,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,4BAA4B,EAAE;gBACzD,YAAY,EAAE,EAAE,CAAC,4BAA4B,CAAC;aAC/C,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,UAAU;QACnB,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;CACF;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { FrameworkRequest } from '../services/http/HttpServer.ts';
2
+ /**
3
+ * Translate a framework message with an in-code English default — the single
4
+ * implementation behind `AbstractMiddleware.translate()` and the HTTP 404/500
5
+ * sinks. The default is the source of truth: it is returned when the request
6
+ * carries no i18n (direct instantiation, i18n disabled), when the key is
7
+ * absent from the app's locales, or when `t()` gives back something that is
8
+ * not a string (malformed resource / `returnObjects`). A present key always
9
+ * wins.
10
+ */
11
+ export declare const translateWithDefault: (req: FrameworkRequest, key: string, defaultValue: string) => string;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Translate a framework message with an in-code English default — the single
3
+ * implementation behind `AbstractMiddleware.translate()` and the HTTP 404/500
4
+ * sinks. The default is the source of truth: it is returned when the request
5
+ * carries no i18n (direct instantiation, i18n disabled), when the key is
6
+ * absent from the app's locales, or when `t()` gives back something that is
7
+ * not a string (malformed resource / `returnObjects`). A present key always
8
+ * wins.
9
+ */
10
+ export const translateWithDefault = (req, key, defaultValue) => {
11
+ const translated = req.appInfo?.i18n?.t(key, { defaultValue });
12
+ return typeof translated === 'string' ? translated : defaultValue;
13
+ };
14
+ //# sourceMappingURL=translate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate.js","sourceRoot":"","sources":["../../src/helpers/translate.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,GAAqB,EACrB,GAAW,EACX,YAAoB,EACZ,EAAE;IACV,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/D,OAAO,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC;AACpE,CAAC,CAAC"}
@@ -1,32 +1,6 @@
1
1
  {
2
2
  "auth": {
3
- "userProvided": "User not specified",
4
- "passwordProvided": "Password must be provided",
5
- "emailProvided": "Email must be provided",
6
- "nickNameValid": "Nick name is not valid,only a-z,A-Z,0-9",
7
- "nameValid": "Name is not valid",
8
- "passwordRecoveryTokenProvided": "Password recovery token must be provided",
9
- "passwordValid": "Password is not valid,only a-z,A-Z,0-9,!,@,#,$,%,ˆ,&,*,(,),_,+,{,},[,],<,>",
10
3
  "passwordTooShort": "Password must be at least {{min}} characters",
11
- "emailValid": "Email is not valid",
12
- "errorUPValid": "User/password not valid",
13
- "messageSome": "Some server problem. Please try later",
14
- "errorUExist": "User with such email isn't registered on this site",
15
- "recoveryEmailSent": "If an account exists for this address, a recovery email has been sent.",
16
- "verificationEmailSent": "If an account exists for this address, a verification email has been sent.",
17
- "errorUAlready": "That user already exists",
18
- "nicknameExists": "User with such nickname already exists",
19
- "noAccessRights": "No access rights"
20
- },
21
- "email": {
22
- "newPassword": "New password",
23
- "verify": "Verify email",
24
- "notVerified": "Your email is not verified",
25
- "registered": "User with such an email already registered",
26
- "alreadyVerifiedOrWrongToken": "Your email is already verified or your verification token is wrong",
27
- "greeating": "Dear user",
28
- "passwordChanged": "Password changed",
29
- "passwordRecovery": "Recovery password",
30
- "emailConfirm": "Email confirmation"
4
+ "messageSome": "Some server problem. Please try later"
31
5
  }
32
6
  }