@web-ts-toolkit/access-router 0.66.0 → 0.68.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.
package/llms.txt CHANGED
@@ -18,7 +18,8 @@
18
18
  - [Names with different jobs](README.md#names-with-different-jobs) · [skim: deprecated compatibility no-op](README.md#skim-compatibility-no-op)
19
19
  - [Runtime isolation and nullish grants](README.md#default-runtime-vs-isolated-runtime) · [Factory overloads](README.md#createrouter-overloads) · [Optional raw-document metadata getter](README.md#optional-permissions-plugin)
20
20
  - [Operation matrix and fallback](README.md#basic-and-advanced-operation-access) · [Live setters](README.md#live-updates-and-option-snapshots)
21
- - [Owned READ/LIST modes](README.md#owned-readlist-authorization-modes): one engine, isolated default, trusted source borrowing only; independent model/default readAuthorizationMode/listAuthorizationMode. Actor/policy/boolean facts remain owned; related targets choose their own mode, embedded scopes inherit genuine owners, READ retries retain READ, writes/new/dedicated origins isolated. No per-call/wire selector or retired flag aliases.
21
+ - [Nested operation breaking migration](MIGRATION.md#breaking-change-nested-operation-access): hard removal of flat keys and RouteVariantAccess, no aliases/translation. Root/advanced export OperationAccessContext, OperationAccessVariants, OperationAccessRule and typed whole/member setters. Scalar or { default, basic, advanced, root } per operation; exact same-owner runtime context defaults precede operation scalar/default, then outer fallback, then deny. Only undefined falls through; objects do not deep-merge. Defined subdocument fields stay closed; absent fields use top-level policy, scalar fields retain fallback. Omitted model policy inherits; explicit whole undefined retains exact-operation defaults, not bare/outer catch-alls. Root target member is independent of the scalar outer batch guard; unpaired direct routes use basic, root counterparts root. Secondary populate/private/include/retry/visibility checks use scalar/default only; trusted services and flags unchanged. Context paths are configuration, not wire/populate selectors; requestSchemas/client/field/permission names are unchanged. Generic option getters are raw fallback lookups, not final entry resolution.
22
+ - [Owned authorization modes](README.md#owned-authorization-modes): exactly readAuthorizationMode/listAuthorizationMode/createAuthorizationMode/updateAuthorizationMode on server model/default options, same literal AuthorizationMode, isolated default; undefined restores inheritance. CREATE/UPDATE apply only to post-persistence/lifecycle output; UPSERT selects the captured executed branch while retaining upsert. Both write modes always acquire a full bounded detached source/native leaves; trusted omits only the subsequent doc-hook view copy, never lends live documents/_doc/payloads/snapshots. Target-own READ/LIST mode also selects genuine write-origin populate, still with mandatory full detachment (unlike query-origin trusted hidden graphs). Embedded scopes inherit owner mode/facts; independent calls recapture, READ retries retain READ. Actor/policy/boolean facts, getter views/private inputs/selected bounds stay protected. Input admission/hydrated pre-write UPDATE hook/lifecycle unchanged, not sandboxed. NEW/helpers/dedicated/count/delete/distinct/custom origins gain no trusted stage. No implicit save/query/rollback; output failure may follow commit. No per-call/wire selector, alternate spellings or retired flag aliases.
22
23
  - [Shipped breaking migration](MIGRATION.md): M1 boolean DocumentGrants/two-argument FieldPermissionHook; M2 frozen ModelOutputContext vs mutable lifecycle; M3 no handles, zero-read empty-fact raw helpers vs explicit current read; M4 all ten rejected keys and tested revision rollback; M5 search checklist/errors/module conditions. Complete workflow is compiled/executed from installed public imports.
23
24
  - [Data list/read](README.md#data-routers) · [Data ownership/native values](README.md#in-memory-data-ownership) · [Runnable data example](README.md#runnable-data-router-split)
24
25
  - [Root batches: maxOrderGroups bounds both group count and numeric order](README.md#root-batch-bounds)
@@ -26,6 +27,7 @@
26
27
 
27
28
  ## Business and migration contracts
28
29
 
30
+ - [Document-permission dependencies](README.md#document-permission-dependencies-breaking-change): alwaysSelectFields is removed, no alias/setter. Root/advanced export ModelDocPermissionsDescriptor/Definition/AccessRecord. Functions or { dependsOn?, get } directly or per-access/default/custom; active docPermissionsAccess exact→default only, no output-access dependency union. Top-level persisted schema keys only (whole nested containers); dotted/unsafe/unknown/virtual inputs reject. Missing inputs never skip get; dependencies grant no output. Whole-definition dotted setters, no partial member edits. Owning embedded facts, independent related/pre-/post-write stages; raw helpers never calculate hooks or fetch inputs.
29
31
  - [Model-condition guards](README.md#model-condition-guards): private fresh visible-row/fact read, no DTO/field/virtual/include-output/metadata/decorate/task work or `_read` override interception. Source/fact/necessary-input errors remain 400; ordinary denied/missing is 401. Same defaults/projection/hydration/hook source and target-input admission. Request-only service admission is distinct from generated HTTP READ operation admission; captured LIST retry only for an admitted miss. Security belongs in operation/row/fact hooks; a separately checked normal DTO read adds its explicit cost. See shipped M2/M3/M5 migration.
30
32
  - [Server-owned hydration and migration](README.md#breaking-release-server-owned-hydration): root/advanced types `HydrationMode` and `ModelHydrationOptions`; model/starting-default `hydration` has exactly publicList (built-in lean), publicRead/find/findOne/findById (built-in hydrated). Records replace shallowly; exact dotted setters update one member. Fresh calls capture their owning runtime; in-flight calls keep theirs. Move `defaults.*Options.lean`/`service.defaults` deliberately to model-wide configuration (true → 'lean', false → 'hydrated'); legacy method-default controls throw. No per-call/client/wire replacement; stale permissive keys are inert, strict correlated options still reject, and business fields keep their meaning.
31
33
  - [Fixed/related modes and value caveat](README.md#breaking-release-server-owned-hydration): includes/post-save subdocument visibility stay lean; raw parents/lifecycle documents stay hydrated; $$sq uses target public configuration; populate inherits its parent query. Plain finalized results do not imply identical schema defaults/getters/transforms/init-hook values or a measured speedup.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@web-ts-toolkit/access-router",
3
3
  "description": "ACL-aware Express routers and in-memory data services for Mongoose-backed APIs",
4
4
  "homepage": "https://web-ts-toolkit.pages.dev/docs/packages/access-router",
5
- "version": "0.66.0",
5
+ "version": "0.68.0",
6
6
  "sideEffects": [
7
7
  "./**/index.js",
8
8
  "./**/index.mjs",
@@ -54,11 +54,11 @@
54
54
  }
55
55
  },
56
56
  "engines": {
57
- "node": ">=22"
57
+ "node": ">=24"
58
58
  },
59
59
  "dependencies": {
60
- "@web-ts-toolkit/express-json-router": "0.66.0",
61
- "@web-ts-toolkit/utils": "0.66.0",
60
+ "@web-ts-toolkit/express-json-router": "0.68.0",
61
+ "@web-ts-toolkit/utils": "0.68.0",
62
62
  "just-diff": "^6.0.2",
63
63
  "mongoose-schema-jsonschema": "^4.0.1",
64
64
  "sift": "^17.1.3",