@web-ts-toolkit/access-router 0.58.0 → 0.60.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/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.58.0",
5
+ "version": "0.60.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.58.0",
61
- "@web-ts-toolkit/utils": "0.58.0",
60
+ "@web-ts-toolkit/express-json-router": "0.60.0",
61
+ "@web-ts-toolkit/utils": "0.60.0",
62
62
  "just-diff": "^6.0.2",
63
63
  "mongoose-schema-jsonschema": "^4.0.1",
64
64
  "sift": "^17.1.3",
@@ -1022,6 +1022,10 @@ declare const documentAuthorizationBrand: unique symbol;
1022
1022
  * and permission metadata are trimmed. Use the original unchanged output or a
1023
1023
  * package-created helper subset; caller spreads, matching IDs, changed values, another
1024
1024
  * row/call/access or pre-/post-write stages cannot establish validity and reject.
1025
+ * A list/read handle with its server unsafeSkipListDocumentSnapshotChecks or
1026
+ * unsafeSkipReadDocumentSnapshotChecks flag enabled retains that weakened source-
1027
+ * mutation policy; output mutation/ownership checks still apply. Turning a setting
1028
+ * off affects new calls, not an existing handle or captured read-to-list retry.
1025
1029
  */
1026
1030
  interface DocumentAuthorization {
1027
1031
  readonly [documentAuthorizationBrand]: true;
@@ -1155,6 +1159,9 @@ interface AuthorizationFieldCatalog {
1155
1159
  }
1156
1160
  interface AuthorizationConfiguration {
1157
1161
  readonly catalog: AuthorizationFieldCatalog;
1162
+ /** Captured server model option; alone it never issues relaxed document authority. */
1163
+ readonly unsafeSkipListDocumentSnapshotChecks?: boolean;
1164
+ readonly unsafeSkipReadDocumentSnapshotChecks?: boolean;
1158
1165
  /** Opaque terminal private-input capture. Never related authority or public document metadata. */
1159
1166
  readonly virtualPopulateSnapshot?: VirtualPopulateSnapshotToken;
1160
1167
  /** Runtime-owned private input admission mode, not public output/related authority. */
@@ -3438,6 +3445,37 @@ interface DefaultModelRouterOptions<TModel = unknown> {
3438
3445
  * `includePermissions`. Defaults to `false`.
3439
3446
  */
3440
3447
  disableFieldPermissions?: boolean;
3448
+ /**
3449
+ * TEMPORARY UNSAFE performance escape hatch (default `false`). Only literal `true`
3450
+ * skips repeated projected-document snapshot comparisons for this model's top-level
3451
+ * `find`/public/root list responses. Captured before awaits; list-origin handles keep
3452
+ * that mode. Single reads use the independent unsafeSkipReadDocumentSnapshotChecks
3453
+ * setting. Writes, embedded/related stages and fresh standalone helpers stay strict.
3454
+ *
3455
+ * Row/field permissions, exact ownership/binding, output provenance/mutation checks
3456
+ * and detached callback/grant copies still run. However, source changes during a
3457
+ * callback/await are no longer detected: stale grants/decisions may authorize output.
3458
+ * Use only with trusted non-mutating application hooks, measure before rollout, and
3459
+ * restore `false` as soon as possible. Enabling logs a warning once per model transition.
3460
+ * Server model configuration only, never service.defaults, per-call or wire options.
3461
+ */
3462
+ unsafeSkipListDocumentSnapshotChecks?: boolean;
3463
+ /**
3464
+ * TEMPORARY UNSAFE single-read escape hatch (default `false`). Only literal `true`
3465
+ * skips repeated projected-document snapshot comparisons in top-level findOne,
3466
+ * findById, public identifier/filter reads and root reads. Read-to-list retries use
3467
+ * this setting, not unsafeSkipListDocumentSnapshotChecks. Captured before awaits;
3468
+ * read-origin handles and retries keep that mode. List operations use their own flag.
3469
+ *
3470
+ * Permission rules, exact ownership/binding, output-mutation/provenance checks and
3471
+ * detached callback/grant copies still run. Source changes during callbacks/awaits
3472
+ * can leave stale grants/decisions and incorrectly authorized output. Use only with
3473
+ * trusted non-mutating hooks, measure before rollout and restore `false` promptly.
3474
+ * Writes (including read-like output), embedded/related stages and fresh helpers
3475
+ * remain strict. Enabling warns once per model/flag transition. Server model or
3476
+ * model-starting-default configuration only; never method defaults or wire options.
3477
+ */
3478
+ unsafeSkipReadDocumentSnapshotChecks?: boolean;
3441
3479
  }
3442
3480
  interface ExtendedDefaultModelRouterOptions<TModel = unknown> extends DefaultModelRouterOptions<TModel> {
3443
3481
  'hydration.publicList'?: HydrationMode;
@@ -1022,6 +1022,10 @@ declare const documentAuthorizationBrand: unique symbol;
1022
1022
  * and permission metadata are trimmed. Use the original unchanged output or a
1023
1023
  * package-created helper subset; caller spreads, matching IDs, changed values, another
1024
1024
  * row/call/access or pre-/post-write stages cannot establish validity and reject.
1025
+ * A list/read handle with its server unsafeSkipListDocumentSnapshotChecks or
1026
+ * unsafeSkipReadDocumentSnapshotChecks flag enabled retains that weakened source-
1027
+ * mutation policy; output mutation/ownership checks still apply. Turning a setting
1028
+ * off affects new calls, not an existing handle or captured read-to-list retry.
1025
1029
  */
1026
1030
  interface DocumentAuthorization {
1027
1031
  readonly [documentAuthorizationBrand]: true;
@@ -1155,6 +1159,9 @@ interface AuthorizationFieldCatalog {
1155
1159
  }
1156
1160
  interface AuthorizationConfiguration {
1157
1161
  readonly catalog: AuthorizationFieldCatalog;
1162
+ /** Captured server model option; alone it never issues relaxed document authority. */
1163
+ readonly unsafeSkipListDocumentSnapshotChecks?: boolean;
1164
+ readonly unsafeSkipReadDocumentSnapshotChecks?: boolean;
1158
1165
  /** Opaque terminal private-input capture. Never related authority or public document metadata. */
1159
1166
  readonly virtualPopulateSnapshot?: VirtualPopulateSnapshotToken;
1160
1167
  /** Runtime-owned private input admission mode, not public output/related authority. */
@@ -3438,6 +3445,37 @@ interface DefaultModelRouterOptions<TModel = unknown> {
3438
3445
  * `includePermissions`. Defaults to `false`.
3439
3446
  */
3440
3447
  disableFieldPermissions?: boolean;
3448
+ /**
3449
+ * TEMPORARY UNSAFE performance escape hatch (default `false`). Only literal `true`
3450
+ * skips repeated projected-document snapshot comparisons for this model's top-level
3451
+ * `find`/public/root list responses. Captured before awaits; list-origin handles keep
3452
+ * that mode. Single reads use the independent unsafeSkipReadDocumentSnapshotChecks
3453
+ * setting. Writes, embedded/related stages and fresh standalone helpers stay strict.
3454
+ *
3455
+ * Row/field permissions, exact ownership/binding, output provenance/mutation checks
3456
+ * and detached callback/grant copies still run. However, source changes during a
3457
+ * callback/await are no longer detected: stale grants/decisions may authorize output.
3458
+ * Use only with trusted non-mutating application hooks, measure before rollout, and
3459
+ * restore `false` as soon as possible. Enabling logs a warning once per model transition.
3460
+ * Server model configuration only, never service.defaults, per-call or wire options.
3461
+ */
3462
+ unsafeSkipListDocumentSnapshotChecks?: boolean;
3463
+ /**
3464
+ * TEMPORARY UNSAFE single-read escape hatch (default `false`). Only literal `true`
3465
+ * skips repeated projected-document snapshot comparisons in top-level findOne,
3466
+ * findById, public identifier/filter reads and root reads. Read-to-list retries use
3467
+ * this setting, not unsafeSkipListDocumentSnapshotChecks. Captured before awaits;
3468
+ * read-origin handles and retries keep that mode. List operations use their own flag.
3469
+ *
3470
+ * Permission rules, exact ownership/binding, output-mutation/provenance checks and
3471
+ * detached callback/grant copies still run. Source changes during callbacks/awaits
3472
+ * can leave stale grants/decisions and incorrectly authorized output. Use only with
3473
+ * trusted non-mutating hooks, measure before rollout and restore `false` promptly.
3474
+ * Writes (including read-like output), embedded/related stages and fresh helpers
3475
+ * remain strict. Enabling warns once per model/flag transition. Server model or
3476
+ * model-starting-default configuration only; never method defaults or wire options.
3477
+ */
3478
+ unsafeSkipReadDocumentSnapshotChecks?: boolean;
3441
3479
  }
3442
3480
  interface ExtendedDefaultModelRouterOptions<TModel = unknown> extends DefaultModelRouterOptions<TModel> {
3443
3481
  'hydration.publicList'?: HydrationMode;