@web-ts-toolkit/access-router 0.65.1 → 0.66.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/MIGRATION.md +777 -0
- package/README.md +229 -550
- package/advanced.d.mts +2 -1
- package/advanced.d.ts +2 -1
- package/advanced.js +1322 -497
- package/advanced.mjs +1210 -385
- package/index.d.mts +14 -5
- package/index.d.ts +14 -5
- package/index.js +11482 -11188
- package/index.mjs +11206 -10914
- package/llms.txt +6 -3
- package/package.json +3 -3
- package/{parsers-h_oU4bB0.d.mts → parsers-BiFHfrNd.d.mts} +2608 -2929
- package/{parsers-h_oU4bB0.d.ts → parsers-BiFHfrNd.d.ts} +2608 -2929
- package/processors.js +13 -1
- package/processors.mjs +13 -1
package/llms.txt
CHANGED
|
@@ -18,22 +18,25 @@
|
|
|
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
|
-
- [
|
|
22
|
-
- [
|
|
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.
|
|
22
|
+
- [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
23
|
- [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
24
|
- [Root batches: maxOrderGroups bounds both group count and numeric order](README.md#root-batch-bounds)
|
|
25
25
|
- [Request validation and OpenAPI](README.md#request-validation-and-openapi) · [AJV sync/async contract](README.md#ajv-validation-contract)
|
|
26
26
|
|
|
27
27
|
## Business and migration contracts
|
|
28
28
|
|
|
29
|
+
- [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.
|
|
29
30
|
- [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.
|
|
30
31
|
- [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.
|
|
31
32
|
- [Finalized permissions alias](README.md#finalized-permissions-alias): non-enumerable value alias to already-exposed canonical metadata, including dotted paths, independent of hydration/plugin. Stripping suppresses it; business/virtual/include collisions win. Package copies preserve it where metadata exists; no metadata synthesis or arbitrary-copy/client-wrapper promise. The optional Mongoose raw getter is separate.
|
|
32
33
|
- [Trusted service authorization](README.md#trusted-service-authorization) · [Request admission](README.md#public-request-admission-and-backend-options): policy is server-only; wire/default control slots reject it.
|
|
33
|
-
- [Selection, grants and document
|
|
34
|
+
- [Selection, grants and document results](README.md#selection-grants-and-document-results) · [Runnable Mongo authorization example](README.md#runnable-service-authorization): DTOs/metadata are DATA, never reusable authority. Raw helpers use global permissions + frozen empty facts and add zero reads/hooks; current document-dependent authority requires a new normal query (+1 read/hook for a single-row refresh).
|
|
34
35
|
- [Independent mutation input](README.md#independent-mutation-input-authority) · [Scoped subdocuments](README.md#dedicated-subdocument-authorization) · [Successful hidden-write responses](README.md#subdocument-writes-with-hidden-responses)
|
|
35
36
|
- [Row scope vs query transformation](README.md#backend-row-authorization-and-filter-migration) · [Denial vs miss](README.md#denial-and-request-validation) · [Whole-value distinct](README.md#distinct-whole-value-request-authorization)
|
|
36
37
|
- [Removed overrides migration](README.md#breaking-release-service-overrides-migration) · [Named helper migration and data compatibility](README.md#breaking-release-named-helpers-and-default-behavior)
|
|
38
|
+
|
|
39
|
+
- [Optional raw collections](README.md#optional-raw-collections-one-deliberately-shared-capture): model Service/PublicService (both getters) and Core expose `pickAllowedFieldsMany(rows, access, options?)` (Core prepends modelName), reusing server-only OutputFieldOptions; no DataService/HTTP/client API. One entry actor/model/catalog/config/scope/policy capture is NOT N fresh picks or a default handle/H3 migration. All sources owned before first predicate; independent row EMPTY stages/memos in all modes, no DB/doc hooks/virtuals/row or target admission/restoration. Ordinary presentation normally uses zero helpers; current facts need a new normal READ/LIST with private hook inputs. Dense ordinary 0–1,000-position arrays, nullish preserved; per-row 20,000/depth-100 owners plus whole-call 200,000 work / 16 MiB cumulative router-controlled admission/staging/traversal/copies. EXCLUDES opaque Mongoose/native internals/dependency allocations, trusted effects and engine enumeration; NOT total-memory/RSS/whole-normalization/CPU/sandbox cap. Admit normalized returns before next explicit router copy; explicit native/wire preparation still counts. Bounded shared gate, stable order, sticky whole 400/close/drain/clear (predicate-body errors omit fields), no partial results/rollback/retry. Root/advanced type-only FilteredOutput<T>: deep optional readonly strings, nullish arrays, string Map-to-record, canonical Date/RegExp/Buffer; other BSON/hydrated (including string IDs)/depth-eight unknown. Readonly is not native freeze/input validation/exact field inference. See exact installed M3 recipes; no measured speedup or old-gate substitution.
|
|
37
40
|
- [Includes/count cardinality](README.md#include-cardinality) · [Bounded numeric Map counts and Set-to-number migration](README.md#numeric-grouped-count-service-api-breaking-migration) · [Source/attachment provenance](README.md#safe-include-output-paths)
|
|
38
41
|
- [Correlated includes and literal escapes](README.md#correlated-includes) · [Nested writes and trusted hooks](README.md#nested-updates-and-trusted-hooks)
|
|
39
42
|
- [Virtuals, literal-filter preservation and output compatibility](README.md#virtuals-computed-fields) · [Request/runtime reentrant hook chains](README.md#hook-admission-and-reentrant-service-calls) · [Separate persistence limits](README.md#persistence-concurrency-and-resource-limits)
|
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.
|
|
5
|
+
"version": "0.66.0",
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"./**/index.js",
|
|
8
8
|
"./**/index.mjs",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"node": ">=22"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@web-ts-toolkit/express-json-router": "0.
|
|
61
|
-
"@web-ts-toolkit/utils": "0.
|
|
60
|
+
"@web-ts-toolkit/express-json-router": "0.66.0",
|
|
61
|
+
"@web-ts-toolkit/utils": "0.66.0",
|
|
62
62
|
"just-diff": "^6.0.2",
|
|
63
63
|
"mongoose-schema-jsonschema": "^4.0.1",
|
|
64
64
|
"sift": "^17.1.3",
|