@web-ts-toolkit/access-router 0.56.0 → 0.58.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/README.md CHANGED
@@ -533,11 +533,16 @@ use `result.context.getDocumentAuthorization(child)` (or the corresponding list-
533
533
  context) with **that target model's** helper. Private dependencies and join keys do
534
534
  not become output grants; related copies retain their own document results.
535
535
 
536
- The existing `requireRegisteredPopulateModels: false` configuration remains an
537
- explicit compatibility opt-out for requested unregistered populate targets. Those
538
- values retain the descriptor's projection, have no target authorization handle,
539
- and cannot receive `related` policies. It does not make an unassociated object
540
- passed to a raw-policy helper into authorized target output.
536
+ Every requested populate target needs an actual registered Mongoose model and ACL
537
+ configuration with an **effective object `permissionSchema`** in the owning runtime.
538
+ Runtime model defaults may supply the schema; `{}` explicitly closes business fields.
539
+ Missing registration/schema is controlled BadRequest before target I/O or initiating
540
+ mutation persistence. Unused ordinary schema refs need not be configured at startup.
541
+ There is no raw/unregistered passthrough. Configure a model without mounting target
542
+ HTTP routes using `registerModelInstance` + `setModelOptions`; its own read/list can
543
+ stay false while ordinary population skips only target operation admission with
544
+ `requireOperationAccessForPopulateQueries: false`. See the [two-flag policy matrix](#runtime-populate-operation-policies)
545
+ and [runnable Document example](#runnable-private-dependency-example).
541
546
 
542
547
  ### Selection, grants and document results
543
548
 
@@ -2586,12 +2591,35 @@ The source ref is retained automatically; repeating it in local `dependsOn` is u
2586
2591
  resolved getter's fourth argument**. It neither requests public population nor
2587
2592
  grants output. HTTP, root, service query and client options cannot declare it.
2588
2593
 
2589
- #### Runtime private-read mode
2594
+ #### Runtime populate operation policies
2590
2595
 
2591
- `GlobalOptions.requireReadOperationAccessForPopulateDependencies` defaults to **true**.
2592
- True requires the original caller's captured target base `operationAccess.read` before
2593
- private loading. Set **literal boolean false** on the owning runtime to allow declared
2594
- private computation inputs despite that operation denial:
2596
+ `GlobalOptions` exposes exactly two independent populate operation flags, both
2597
+ defaulting to **true**. Only **literal boolean false** disables their respective gate:
2598
+
2599
+ - `requireOperationAccessForPopulateQueries`: ordinary caller population requires
2600
+ the target's effective operation (`read` normally, supported `list` or trusted custom
2601
+ access). False skips **only** that admission: source entry/source-field access,
2602
+ target field/document grants, row/base/transform filters, original selection and
2603
+ `_id` exclusions, requested match and mandatory reference IDs still apply.
2604
+ - `requireOperationAccessForPopulateDependencies`: private loading requires the
2605
+ original caller's captured target **base `operationAccess.read`**. False skips only
2606
+ that gate. The server declaration already grants source/target input fields; the
2607
+ virtual's own output authorization and request-mode `baseFilter.read`,
2608
+ `overrideFilter.read` and original IDs remain mandatory. No private read-to-list fallback.
2609
+
2610
+ For a registered target whose relevant public operation and base read are denied,
2611
+ with selected/permitted source refs and otherwise eligible fields/rows:
2612
+
2613
+ | Query flag | Dependency flag | Requested ordinary population | Authorized private virtual |
2614
+ | ---------- | --------------- | --------------------------------- | ----------------------------- |
2615
+ | true | true | Original parent ID(s) | Omitted |
2616
+ | false | true | Selected/authorized target DTO(s) | Omitted |
2617
+ | true | false | Original parent ID(s) | Computed from declared inputs |
2618
+ | false | false | Selected/authorized target DTO(s) | Computed from declared inputs |
2619
+
2620
+ Direct/generated target endpoints and root target reads/lists still enforce their
2621
+ own operation access. A configuration-only `Document` requires no mounted routes.
2622
+ Neither flag grants standalone target access, fields, rows or writes.
2595
2623
 
2596
2624
  <!-- doc-example: partial -->
2597
2625
 
@@ -2599,43 +2627,53 @@ private computation inputs despite that operation denial:
2599
2627
  import { createAccessRuntime, type GlobalOptions } from '@web-ts-toolkit/access-router';
2600
2628
 
2601
2629
  const api = createAccessRuntime();
2602
- api.setGlobalOptions({ requireReadOperationAccessForPopulateDependencies: false });
2630
+ api.setGlobalOptions({
2631
+ requireOperationAccessForPopulateQueries: true,
2632
+ requireOperationAccessForPopulateDependencies: false,
2633
+ });
2603
2634
  // The exact setter and api.set(key, value)/api.set(options) aliases are also typed.
2604
- api.setGlobalOption('requireReadOperationAccessForPopulateDependencies', false);
2635
+ api.setGlobalOption('requireOperationAccessForPopulateQueries', false);
2605
2636
  const snapshot: GlobalOptions = api.getGlobalOptions();
2606
- const mode: boolean | undefined = api.getGlobalOption('requireReadOperationAccessForPopulateDependencies');
2637
+ const mode: boolean | undefined = api.getGlobalOption('requireOperationAccessForPopulateDependencies');
2607
2638
  void [snapshot, mode];
2608
2639
  ```
2609
2640
 
2610
2641
  Missing/undefined or malformed JavaScript values (`'false'`, `0`, null, objects)
2611
2642
  use the conservative true mode; typed setters accept only boolean/undefined. An
2612
2643
  omitted property in a shallow object setter preserves the current setting. The
2613
- flag is captured with source/target configuration and query intent **before the first
2614
- await**. Nested related/embedded/subdocument output retains that call's mode; later
2644
+ flags are captured with source/target configuration and query intent **before the first
2645
+ await**. Nested related/embedded/subdocument output retains that call's modes; later
2615
2646
  calls see updates. Separate runtimes remain isolated.
2616
2647
 
2617
- This is **server/runtime configuration**, not a model default, service query option,
2648
+ These are **server/runtime configuration**, not model defaults, service query options,
2618
2649
  HTTP/root/client control or persisted capability. Business fields with the same
2619
- spelling keep ordinary data semantics. It is independent of
2620
- `requireRegisteredPopulateModels`: private targets still require eager registration
2621
- and valid static server declarations in either mode.
2622
-
2623
- False bypasses **only private target-operation read admission**. Source/target
2624
- `permissionSchema` input-field rules are already bypassed by the declaration;
2625
- the virtual's own output authorization still governs its result. Target request-mode
2626
- `baseFilter.read`, `overrideFilter.read` and retained source IDs still constrain every
2627
- private read. False grants no public target read, field, row, query or write authority.
2628
- If only the virtual is output-eligible, false mode adds no operation check solely to
2629
- fetch its private inputs. A potentially visible reference has a separate target-read
2630
- output check in **both** modes, as [specified below](#target-authority-selection-and-reconstruction).
2650
+ spelling keep ordinary data semantics. Actual runtime registration and an effective
2651
+ object `permissionSchema` are mandatory in **all four combinations**; private targets
2652
+ also require eagerly validated static declarations. `api.getGlobalOptions()` returns
2653
+ a frozen snapshot; read it again to observe later setters. The named root exports
2654
+ `getGlobalOptions`/`getGlobalOption` refer to the shared default runtime.
2655
+
2656
+ There is **no additional target-base-read reference-visibility gate**. Adding a virtual
2657
+ does not change ordinary ref shape. Without admitted public population, selected/
2658
+ permitted parent fields retain exact IDs even on strict private denial, row/query/getter
2659
+ failure or deferred virtual denial. Only parent field denial/unselection omits them.
2660
+ Actual admitted population misses yield scalar null or filtered arrays, never restored
2661
+ IDs. See [reconstruction](#target-authority-selection-and-reconstruction).
2662
+
2663
+ Missing target configuration/schema raises a controlled service result with
2664
+ `code: 'bad_request'` and actionable `errors[].detail` (HTTP 400); direct helpers and
2665
+ configuration setters throw with the same controlled `result`. Private declaration
2666
+ validation is eager/atomic. Ordinary required operation-hook errors propagate; bypass
2667
+ does not call that guard. Private required guard errors make inputs unavailable and
2668
+ omit the virtual with structural-only logging, preserving permitted parent IDs.
2631
2669
 
2632
2670
  #### Runnable private dependency example
2633
2671
 
2634
2672
  Save as `private-populate-example.mts` and run with Node 22.18+ or compile with
2635
2673
  TypeScript/NodeNext. Install the package, Express and Mongoose as above. This
2636
2674
  self-contained example creates/removes a uniquely named database, registers the
2637
- target **before** the source, and checks population, exact IDs and omission, including
2638
- false-mode computation with a selected/permitted source and denied target. The example
2675
+ configuration-only `Document` **before** the source, and checks all four modes,
2676
+ selection/field denial, exact IDs, population misses and standalone denial. The example
2639
2677
  tenant is server-owned; real applications derive it from their authenticated actor.
2640
2678
 
2641
2679
  <!-- doc-example: complete-runtime -->
@@ -2648,8 +2686,9 @@ import type { Server } from 'node:http';
2648
2686
  import express from 'express';
2649
2687
  import mongoose from 'mongoose';
2650
2688
  import { createAccessRuntime, type ModelVirtualDescriptor } from '@web-ts-toolkit/access-router';
2689
+ import type { ModelRequest } from '@web-ts-toolkit/access-router/advanced';
2651
2690
 
2652
- interface Account {
2691
+ interface DocumentRecord {
2653
2692
  name: string;
2654
2693
  balance: number;
2655
2694
  creditLimit: number;
@@ -2657,7 +2696,7 @@ interface Account {
2657
2696
  }
2658
2697
  interface Order {
2659
2698
  total: number;
2660
- account: mongoose.Types.ObjectId | null; // stays a persisted ref, not an Account
2699
+ account: mongoose.Types.ObjectId | null; // stays a persisted ref, not a DocumentRecord
2661
2700
  }
2662
2701
  interface OrderVirtuals {
2663
2702
  canPlaceOrder: boolean;
@@ -2673,9 +2712,9 @@ async function runPrivatePopulateExample() {
2673
2712
  try {
2674
2713
  const api = createAccessRuntime();
2675
2714
  api.setGlobalOptions({ globalPermissions: () => [] });
2676
- const AccountModel = connection.model<Account>(
2677
- 'PrivateExampleAccount',
2678
- new mongoose.Schema<Account>({
2715
+ const DocumentModel = connection.model<DocumentRecord>(
2716
+ 'Document',
2717
+ new mongoose.Schema<DocumentRecord>({
2679
2718
  name: String,
2680
2719
  balance: { type: Number, select: false },
2681
2720
  creditLimit: Number,
@@ -2683,8 +2722,9 @@ async function runPrivatePopulateExample() {
2683
2722
  }),
2684
2723
  );
2685
2724
  // Both the actual model instance and its options must exist in this runtime first.
2686
- const accounts = api.createRouter(AccountModel, {
2687
- operationAccess: { read: true },
2725
+ api.registerModelInstance(DocumentModel.modelName, DocumentModel);
2726
+ api.setModelOptions(DocumentModel.modelName, {
2727
+ operationAccess: { read: false, list: false },
2688
2728
  baseFilter: { read: () => ({ tenantId: 'shop-a' }) },
2689
2729
  permissionSchema: { name: true, balance: false, creditLimit: false },
2690
2730
  stripPermissionsField: true,
@@ -2693,11 +2733,11 @@ async function runPrivatePopulateExample() {
2693
2733
  'PrivateExampleOrder',
2694
2734
  new mongoose.Schema<Order>({
2695
2735
  total: Number,
2696
- account: { type: mongoose.Schema.Types.ObjectId, ref: AccountModel.modelName },
2736
+ account: { type: mongoose.Schema.Types.ObjectId, ref: DocumentModel.modelName },
2697
2737
  }),
2698
2738
  );
2699
2739
  // Explicit target map: an ObjectId alone cannot infer its related model.
2700
- const canPlaceOrder: ModelVirtualDescriptor<Order, boolean, { account: Account }> = {
2740
+ const canPlaceOrder: ModelVirtualDescriptor<Order, boolean, { account: DocumentRecord }> = {
2701
2741
  dependsOn: ['total'],
2702
2742
  dependsOnPopulate: [{ path: 'account', select: ['balance', 'creditLimit'] }],
2703
2743
  get(doc, _permissions, _context, populated = {}) {
@@ -2714,11 +2754,20 @@ async function runPrivatePopulateExample() {
2714
2754
  virtuals: { canPlaceOrder }, // assign the separately typed descriptor normally
2715
2755
  stripPermissionsField: true,
2716
2756
  });
2717
- const account = await AccountModel.create({ name: 'Main', balance: 80, creditLimit: 20, tenantId: 'shop-a' });
2757
+ const account = await DocumentModel.create({ name: 'Main', balance: 80, creditLimit: 20, tenantId: 'shop-a' });
2718
2758
  const order = await OrderModel.create({ total: 90, account: account._id });
2759
+ // Check standalone base admission without constructing target HTTP routes.
2760
+ orders.router.post('/verify-target', async (req, res) => {
2761
+ const core = (req as ModelRequest).macl;
2762
+ assert.equal(await core.isAllowed(DocumentModel.modelName, 'read'), false);
2763
+ assert.equal(await core.isAllowed(DocumentModel.modelName, 'list'), false);
2764
+ res.json({ ok: true });
2765
+ });
2766
+ const root = api.createRouter({ basePath: '/batch', operationAccess: true });
2719
2767
  const app = express();
2720
2768
  app.use(express.json());
2721
2769
  app.use(orders.routes);
2770
+ app.use(root.routes); // no Document HTTP router is constructed or mounted
2722
2771
  server = app.listen(0, '127.0.0.1');
2723
2772
  await once(server, 'listening');
2724
2773
  const address = server.address();
@@ -2734,49 +2783,55 @@ async function runPrivatePopulateExample() {
2734
2783
  return response.json();
2735
2784
  }
2736
2785
  const select = ['account', 'canPlaceOrder', '-_id'];
2737
- // 1. Public population: fetch name + private inputs, return only the public mask.
2738
- assert.deepEqual(await read({ select, populate: [{ path: 'account', select: 'name -_id' }] }), {
2739
- account: { name: 'Main' },
2740
- canPlaceOrder: true,
2741
- });
2742
- // 2. No ordinary population: restore the exact selected/permitted original ID.
2743
- assert.deepEqual(await read({ select }), { account: String(account._id), canPlaceOrder: true });
2744
- // 3. Unselected reference: compute privately, omit account entirely.
2745
- assert.deepEqual(await read({ select: ['canPlaceOrder', '-_id'] }), { canPlaceOrder: true });
2746
- // Readable-but-unrequested private fields still do not join public output.
2747
- accounts.setOption('permissionSchema', { name: true, balance: true, creditLimit: true });
2786
+ const populate = [{ path: 'account', select: 'name balance -_id' }];
2787
+ for (const queries of [true, false]) {
2788
+ for (const dependencies of [true, false]) {
2789
+ api.setGlobalOptions({
2790
+ requireOperationAccessForPopulateQueries: queries,
2791
+ requireOperationAccessForPopulateDependencies: dependencies,
2792
+ });
2793
+ const computed = dependencies ? {} : { canPlaceOrder: true };
2794
+ assert.deepEqual(await read({ select, populate }), {
2795
+ account: queries ? String(account._id) : { name: 'Main' }, // balance stays private
2796
+ ...computed,
2797
+ });
2798
+ assert.deepEqual(await read({ select }), { account: String(account._id), ...computed });
2799
+ assert.deepEqual(await read({ select: ['canPlaceOrder', '-_id'] }), computed);
2800
+ orders.permissionSchema('account', false);
2801
+ assert.deepEqual(await read({ select, populate }), computed);
2802
+ orders.permissionSchema('account', true);
2803
+ }
2804
+ }
2805
+ // Both false: readable-but-unrequested private fetch inputs still cannot widen the public mask.
2806
+ api.setModelOption(DocumentModel.modelName, 'permissionSchema', { name: true, balance: true, creditLimit: false });
2748
2807
  assert.deepEqual(await read({ select, populate: [{ path: 'account', select: 'name -_id' }] }), {
2749
2808
  account: { name: 'Main' },
2750
2809
  canPlaceOrder: true,
2751
2810
  });
2752
- // Denying the source field also leaves only the authorized virtual result.
2753
- orders.permissionSchema('account', false);
2754
- assert.deepEqual(await read({ select }), { canPlaceOrder: true });
2755
- // Default true: input-field authority does not bypass the target's base read operation.
2756
- accounts.setOption('operationAccess.read', false);
2757
- assert.deepEqual(await read({ select: ['canPlaceOrder', '-_id'] }), {});
2758
- // Select and permit the source ref: denied target read removes even its ID.
2759
- orders.permissionSchema('account', true);
2760
- assert.deepEqual(await read({ select }), {});
2761
- api.setGlobalOptions({ requireReadOperationAccessForPopulateDependencies: false });
2762
- assert.deepEqual(await read({ select }), { canPlaceOrder: true });
2763
- // An ordinary list-populate grant cannot override the additional base-read visibility gate.
2764
- accounts.setOption('operationAccess.list', true);
2765
- assert.deepEqual(await read({ select, populate: [{ path: 'account', select: 'name -_id', access: 'list' }] }), {
2766
- canPlaceOrder: true,
2767
- });
2768
- // Strict control: denied target read now prevents private computation too.
2769
- api.setGlobalOption('requireReadOperationAccessForPopulateDependencies', true);
2770
- assert.deepEqual(await read({ select }), {});
2771
- // Allowed-target controls in BOTH modes: original public mask or exact original ID.
2772
- accounts.setOption('operationAccess.read', true);
2773
- for (const strict of [true, false]) {
2774
- api.setGlobalOption('requireReadOperationAccessForPopulateDependencies', strict);
2775
- assert.deepEqual(await read({ select, populate: [{ path: 'account', select: 'name -_id' }] }), {
2776
- account: { name: 'Main' },
2811
+ const withId = await read({ select, populate: [{ path: 'account', select: ['name'] }] });
2812
+ assert.deepEqual(withId.account, { _id: String(account._id), name: 'Main' });
2813
+ // Admitted public match miss is null; private inputs retain their independent read-row scope.
2814
+ assert.deepEqual(
2815
+ await read({ select, populate: [{ path: 'account', select: 'name -_id', match: { name: 'Other' } }] }),
2816
+ {
2817
+ account: null,
2777
2818
  canPlaceOrder: true,
2778
- });
2779
- assert.deepEqual(await read({ select }), { account: String(account._id), canPlaceOrder: true });
2819
+ },
2820
+ );
2821
+ const origin = `http://127.0.0.1:${address.port}`;
2822
+ assert.equal((await fetch(`${origin}/orders/verify-target`, { method: 'POST' })).status, 200);
2823
+ const batch = await fetch(`${origin}/batch`, {
2824
+ method: 'POST',
2825
+ headers: { 'content-type': 'application/json' },
2826
+ body: JSON.stringify([
2827
+ { target: 'model', name: DocumentModel.modelName, op: 'read', id: String(account._id) },
2828
+ { target: 'model', name: DocumentModel.modelName, op: 'list' },
2829
+ ]),
2830
+ });
2831
+ assert.equal(batch.status, 200);
2832
+ for (const entry of await batch.json()) {
2833
+ assert.equal(entry.statusCode, 401);
2834
+ assert.equal(entry.result.code, 'unauthorized');
2780
2835
  }
2781
2836
  } finally {
2782
2837
  if (server)
@@ -2839,31 +2894,26 @@ separate and immutable. Even a readable private field is omitted unless original
2839
2894
  selected and permitted. Public exclusions and `-_id` remain effective. Different
2840
2895
  public match/access/row scopes require independent queries.
2841
2896
 
2842
- **Independent reference visibility, in both modes:** for paths in an **active selected/
2843
- applicable `dependsOnPopulate` plan**, the captured target base **read** rule and original
2844
- actor/permissions decide visibility separately from private fetch availability. It uses
2845
- the same exact/default/bare/runtime-default semantics, not a route variant or an ordinary
2846
- populate list/custom rule. A public `authorization.related` operation grant cannot
2847
- override it. Strict private admission is reused for this decision; false mode evaluates
2848
- the output-only check only after source selection/field authorization makes output eligible.
2849
-
2850
- | Source field / captured caller target base read / original query | Returned dependency-backed reference in either mode |
2851
- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
2852
- | Source unselected, excluded or denied | Omitted entirely |
2853
- | Source selected/permitted, target read denied or check failed | Omitted entirely, **including its ID**, with or without ordinary population |
2854
- | Source selected/permitted, target read allowed, ordinary population requested/admitted | Original requested and authorized populated projection |
2855
- | Source selected/permitted, target read allowed, no ordinary population | Exact original ID/array of IDs |
2897
+ **Ordinary reference visibility is independent of private computation, in all four modes.**
2898
+ The extra target-base-read reference-visibility gate is removed. Adding a virtual,
2899
+ selecting it, or changing private input availability must not change ordinary ref shape.
2900
+
2901
+ | Source field / original query | Returned reference |
2902
+ | --------------------------------------------------------------------------- | -------------------------------------------------------------- |
2903
+ | Source unselected, excluded or field-denied | Omitted entirely |
2904
+ | Source selected/permitted, ordinary population denied/not requested | Exact original ID/array of IDs |
2905
+ | Source selected/permitted, ordinary population admitted | Original requested/authorized populated projection |
2906
+ | Source selected/permitted, admitted population finds no matching target row | Scalar null / filtered array (possibly `[]`), not original IDs |
2856
2907
 
2857
2908
  The original query includes resolved server defaults. A default populate is ordinary
2858
2909
  population; explicit `populate: []` suppresses it. Allowed ordinary population retains
2859
2910
  its original target projection, match/missing/null/array behavior. Without admitted
2860
- ordinary population, read-allowed refs restore exact pre-populate IDs/arrays, including
2861
- missing target IDs, order, duplicates, nulls, empty arrays and own absence. Denied/failed
2862
- target-read visibility always takes precedence over ID restoration, including after
2863
- private row denial/query failure or getter omission/failure/deferred authorization denial.
2864
- Cleanup runs before output copying/handles and presentation hooks/tasks. **No active
2865
- dependency plan means ordinary reference/populate behavior is unchanged**; this is not
2866
- a new gate on every reference in a model with virtuals.
2911
+ ordinary population, permitted refs restore exact pre-populate IDs/arrays, including
2912
+ missing target IDs, order, duplicates, nulls, empty arrays and own absence. Strict
2913
+ private operation denial, private row/query failure, getter omission/failure and deferred
2914
+ virtual authorization denial cannot hide permitted IDs. Public list/custom population
2915
+ and scoped backend operation grants retain their own admission and target-owned output
2916
+ authority. Cleanup runs before output copying/handles and presentation hooks/tasks.
2867
2917
 
2868
2918
  #### Supported declarations and validation
2869
2919
 
@@ -2896,8 +2946,8 @@ a new gate on every reference in a model with virtuals.
2896
2946
  undefined inherits, and null rejects. Descriptor arrays/masks and target policies
2897
2947
  are captured with the getter before asynchronous work; later calls see updates.
2898
2948
  - Validation is eager and atomic for constructors, bulk and dotted setters. Target
2899
- model instances **and options must be registered first**, even with
2900
- `requireRegisteredPopulateModels: false`. For mutually referencing models, register
2949
+ model instances **and options with an effective object `permissionSchema` must be
2950
+ registered first**, regardless of either operation flag. For mutually referencing models, register
2901
2951
  both options before assigning virtuals; self-refs use the proposed source options.
2902
2952
  Operation capture rechecks schema/target/metadata binding before hooks or writes.
2903
2953
 
@@ -2912,9 +2962,9 @@ the getter decides what to return.
2912
2962
 
2913
2963
  In true mode, target read denial makes dependencies unavailable; in either mode,
2914
2964
  a terminal false `overrideFilter.read`/`baseFilter.read` does so. Affected virtuals
2915
- are omitted even for null/empty source refs. In false mode, a denied/failed output-only
2916
- read check hides the ref without removing otherwise available private computation. A
2917
- dependency-only query/hook/cast failure also omits them with structural-only logging.
2965
+ are omitted even for null/empty source refs. Permitted parent IDs remain available
2966
+ independently of those private outcomes. A dependency-only query/hook/cast failure
2967
+ also omits the virtual with structural-only logging.
2918
2968
  There is no raw fallback, retry or new retryable write error: a successful write
2919
2969
  stays successful. A failed query that also serves ordinary public population keeps
2920
2970
  that ordinary error path. Getter undefined/throw omits fail-closed; invalid server
@@ -2953,22 +3003,29 @@ router-wide generic, entrypoint, client API or persisted-field migration is requ
2953
3003
  The declaration's opt-in constraints are eager target registration and strict static
2954
3004
  reference/target-selection validation; ordinary public populate grammar is unchanged.
2955
3005
 
2956
- #### Release compatibility: dependency-reference omission
2957
-
2958
- This release intentionally tightens the earlier private-dependency **D1** contract:
2959
- for active dependency-backed refs, denied/failed caller target base read now removes
2960
- the **entire field, including IDs**, even in default/true mode. Earlier denied ordinary
2961
- population could leave IDs behind; that fallback is superseded in this scope, even
2962
- without an ordinary populate descriptor and even with public list/custom access or a
2963
- trusted related-operation grant. No active plan/no feature retains ordinary behavior.
2964
-
2965
- Consumers must handle absent dependency-backed refs rather than assuming a denied
2966
- population leaves an ID. Keep the default true for strict private admission, or set
2967
- false explicitly when the authorized virtual is intended to compute despite target
2968
- operation denial. False does **not** restore denied IDs or relax row filters. To return
2969
- references, independently permit the source field and caller-context target base read;
2970
- ordinary population still applies its original requested/authorized mask. Existing local
2971
- views, fourth-argument isolation, registration, static-ref and hydration limitations remain.
3006
+ #### Breaking release: populate policy migration
3007
+
3008
+ **Removed:** `requireRegisteredPopulateModels` and
3009
+ `requireReadOperationAccessForPopulateDependencies`. There are no aliases, deprecated
3010
+ mappings or replacement registration enums. Register every used target's actual model
3011
+ and ACL options with an effective object `permissionSchema`; use an explicit `{}` to
3012
+ close its business fields. Defaults may supply the schema. Old unregistered/raw output
3013
+ is no longer supported, including with both new flags false.
3014
+
3015
+ Choose `requireOperationAccessForPopulateQueries` and
3016
+ `requireOperationAccessForPopulateDependencies` explicitly from the matrix above;
3017
+ both default true. Migrate a deliberate private operation bypass to the new dependency
3018
+ name, then review the query policy independently. Changing a registration setting is
3019
+ not a boolean-to-new-policy migration. Keep configuration in the owning runtime, not
3020
+ model defaults, per-call options or clients.
3021
+
3022
+ The former PPR whole-reference omission rule is superseded: selected/permitted parent
3023
+ IDs survive denied ordinary/private admission and private failure. Source-field denial
3024
+ or unselection still omits the field; admitted population still returns its DTO/null/
3025
+ filtered-array result. Consumers that relied on target-read denial to conceal IDs must
3026
+ deny the **source field** instead. Private inputs remain isolated fourth arguments,
3027
+ and registration, row, static-ref and hydration limitations remain mandatory. Plan this
3028
+ as a breaking application upgrade; no release/version automation is changed here.
2972
3029
 
2973
3030
  ### Hook admission and reentrant service calls
2974
3031
 
package/advanced.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AccessRouterBaseRequest, a as AccessRouterFieldKey, b as AccessRouterLogger, c as AccessRouterRequest, d as AccessRouterRequestExtensions, e as AdvancedCreateBody, f as AdvancedListBody, g as AdvancedReadBody, h as AdvancedReadFilterBody, i as AdvancedUpdateBody, j as AdvancedUpsertBody, k as AfterPersistAccess, l as AjvErrorObjectLike, m as AjvValidationErrorLike, n as AjvValidatorLike, o as AllowedOutputFieldOptions, p as ArkTypeErrorsLike, q as ArkTypeLike, r as ArkTypeProblemLike, s as AuthorizedListResult, t as AuthorizedSingleResult, B as BaseFilterAccess, C as Change, u as Codes, v as CorrelatedCountInclude, w as CorrelatedFilter, x as CorrelatedInclude, y as CorrelatedIncludeArgs, z as CorrelatedListInclude, D as CorrelatedReadByFilterInclude, E as CorrelatedReadByIdInclude, F as CountBody, G as CreateArgs, H as CreateAuthorization, I as CreateOptions, J as CreateQueryInput, K as CustomHeaders, L as DATA_MIDDLEWARE, M as DataBaseFilterHook, N as DataFieldOptions, O as DataFilter, P as DataFindArgs, Q as DataFindOneArgs, R as DataFindOneOptions, S as DataFindOptions, T as DataHook, U as DataHookContext, V as DataIdentifierHook, W as DataListHook, X as DataOverrideFilterHook, Y as DataRequest, Z as DataRequestSchemas, _ as DataRouterOptions, $ as DecorateAccess, a0 as DecorateAllAccess, a1 as DeepFieldPath, a2 as DefaultModelRouterOptions, a3 as Defaults, a4 as DistinctArgs, a5 as DistinctBody, a6 as DocPermissionsAccess, a7 as DocumentAuthorization, a8 as ErrorResult, a9 as ExistsOptions, aa as ExtendedDataRouterOptions, ab as ExtendedDefaultModelRouterOptions, ac as ExtendedModelRouterOptions, ad as FieldAuthorization, ae as FieldOperationAccess, af as Filter, ag as FilterOperator, ah as FindAccess, ai as FindArgs, aj as FindByIdArgs, ak as FindByIdOptions, al as FindOneArgs, am as FindOneOptions, an as FindOptions, ao as GlobalOptions, ap as GlobalPermissionValue, aq as GuardHook, ar as HydrationMode, as as IdentifierHook, at as Include, au as InputFieldAuthorization, av as InputFieldPath, aw as IoTsContextEntryLike, ax as IoTsDecodeErrorLike, ay as IoTsDecoderLike, az as JoiSchemaLike, aA as JoiValidationErrorDetailLike, aB as KeyValueProjection, aC as LegacyInclude, aD as ListQueryInput, aE as ListResult, aF as MIDDLEWARE, aG as MaybePromise, aH as ModelBaseFilterHook, aI as ModelChangeHook, aJ as ModelDeleteHook, aK as ModelDocPermissionsHook, aL as ModelDocument, aM as ModelDocumentHook, aN as ModelHook, aO as ModelHookContext, aP as ModelHydrationOptions, aQ as ModelIdentifierHook, aR as ModelListHook, aS as ModelOverrideFilterHook, aT as ModelRequest, aU as ModelRouterOptions, aV as ModelValidateHook, aW as ModelVirtualAccess, aX as ModelVirtualAccessRecord, aY as ModelVirtualContext, aZ as ModelVirtualDescriptor, a_ as ModelVirtualDoc, a$ as ModelVirtualGetter, b0 as ModelVirtualLeaf, b1 as ModelVirtualPopulateDependency, b2 as ModelVirtualPopulateInputs, b3 as ModelVirtualRecordAccess, b4 as ModelVirtuals, b5 as MutationAuthorization, b6 as NewArgs, b7 as NewOptions, b8 as OperationAccess, b9 as OperationAuthorization, ba as OutputAuthorization, bb as OutputFieldOptions, bc as OutputFieldPath, bd as OutputPlanningOptions, be as PERMISSIONS, bf as PERMISSION_KEYS, bg as PairedRouteAccess, bh as ParentRef, bi as PathValue, bj as PermissionSchema, bk as Populate, bl as PopulateAccess, bm as PopulatePlanningOptions, bn as PrepareAccess, bo as Projection, bp as PublicCreateArgs, bq as PublicCreateOptions, br as PublicErrorResult, bs as PublicListArgs, bt as PublicListOptions, bu as PublicListResult, bv as PublicOutput, bw as PublicReadArgs, bx as PublicReadOptions, by as PublicServiceResult, bz as PublicSingleResult, bA as PublicSubdocumentCreateOptions, bB as PublicSubdocumentListOptions, bC as PublicSubdocumentMutationOptions, bD as PublicSubdocumentReadOptions, bE as PublicUpdateArgs, bF as PublicUpdateOptions, bG as PublicUpsertArgs, bH as PublicUpsertOptions, bI as ReadQueryInput, bJ as RelatedAuthorization, bK as Request, bL as RequestSchemaAdapter, bM as RequestSchemaFailure, bN as RequestSchemaIssue, bO as RequestSchemaLike, bP as RequestSchemaOptions, bQ as RequestSchemaResult, bR as RequestSchemaSuccess, bS as RequestSchemaValidator, bT as RequestSchemas, bU as RootDataListQueryEntry, bV as RootDataOperation, bW as RootDataReadByFilterQueryEntry, bX as RootDataReadByIdQueryEntry, bY as RootModelCountQueryEntry, bZ as RootModelCreateQueryEntry, b_ as RootModelDeleteQueryEntry, b$ as RootModelDistinctQueryEntry, c0 as RootModelListQueryEntry, c1 as RootModelNewQueryEntry, c2 as RootModelOperation, c3 as RootModelReadByFilterQueryEntry, c4 as RootModelReadByIdQueryEntry, c5 as RootModelSubBulkUpdateQueryEntry, c6 as RootModelSubCreateQueryEntry, c7 as RootModelSubDeleteQueryEntry, c8 as RootModelSubListQueryEntry, c9 as RootModelSubReadQueryEntry, ca as RootModelSubUpdateQueryEntry, cb as RootModelUpdateQueryEntry, cc as RootModelUpsertQueryEntry, cd as RootOperationResult, ce as RootQueryEntry, cf as RootRouterOptions, cg as RootSubOperation, ch as RootTarget, ci as RouteBaseAccess, cj as RouteGuardAccess, ck as RouteVariant, cl as RouteVariantAccess, cm as RowAuthorization, cn as SelectAccess, co as SelectedPopulatedPublicOutput, cp as SelectedPublicOutput, cq as ServiceAuthorization, cr as ServiceOutputContext, cs as ServiceOutputDecorator, ct as ServiceResult, cu as SingleResult, cv as Sort, cw as SortOrder, cx as StandardSchemaFailure, cy as StandardSchemaInferOutput, cz as StandardSchemaIssue, cA as StandardSchemaPathSegment, cB as StandardSchemaResult, cC as StandardSchemaSuccess, cD as StandardSchemaV1, cE as StatusCodes, cF as SubListBody, cG as SubOperationAccess, cH as SubPopulate, cI as SubQueryEntry, cJ as SubReadBody, cK as SubRouteGuardOptions, cL as SubdocumentBulkRecord, cM as SubdocumentBulkUpdateInput, cN as SubdocumentCreateAuthorization, cO as SubdocumentCreateInput, cP as SubdocumentCreateOptions, cQ as SubdocumentCreateVisibilityAuthorization, cR as SubdocumentDeleteAuthorization, cS as SubdocumentDeleteOptions, cT as SubdocumentGateAuthorization, cU as SubdocumentId, cV as SubdocumentInputAuthorization, cW as SubdocumentListOptions, cX as SubdocumentModel, cY as SubdocumentMutationAuthorization, cZ as SubdocumentName, c_ as SubdocumentOutputAuthorization, c$ as SubdocumentParentArgs, d0 as SubdocumentParentOptions, d1 as SubdocumentReadAuthorization, d2 as SubdocumentReadOptions, d3 as SubdocumentRecord, d4 as SubdocumentUpdateOptions, d5 as SubdocumentVirtuals, d6 as SubdocumentVisibilityAuthorization, d7 as SuperstructFailureLike, d8 as SuperstructValidateLike, d9 as Task, da as TaskType, db as TransformAccess, dc as TypedFilter, dd as UpdateByIdArgs, de as UpdateByIdOptions, df as UpdateOneArgs, dg as UpdateOneOptions, dh as UpdateQueryInput, di as UpsertArgs, dj as UpsertOptions, dk as UpsertQueryInput, dl as ValibotIssueLike, dm as ValibotPathItemLike, dn as ValibotSafeParseLike, dp as ValibotSafeParseResult, dq as ValidateAccess, dr as ValidateRule, ds as Validation, dt as ValidationError, du as VineValidationErrorLike, dv as VineValidationMessageLike, dw as VineValidatorLike, dx as VirtualSubModel, dy as WithVirtuals, dz as YupSchemaLike, dA as YupValidationErrorLike, dB as defineRequestSchema, dC as fromAjv, dD as fromArkType, dE as fromIoTs, dF as fromJoi, dG as fromStandardSchema, dH as fromSuperstruct, dI as fromValibot, dJ as fromVine, dK as fromYup, dL as fromZod, dM as parseBody, dN as parseBodyWithSchema, dO as parseNestedBodyWithSchema, dP as parsePathParam, dQ as parseQuery } from './parsers-BXKoUKMa.mjs';
1
+ export { A as AccessRouterBaseRequest, a as AccessRouterFieldKey, b as AccessRouterLogger, c as AccessRouterRequest, d as AccessRouterRequestExtensions, e as AdvancedCreateBody, f as AdvancedListBody, g as AdvancedReadBody, h as AdvancedReadFilterBody, i as AdvancedUpdateBody, j as AdvancedUpsertBody, k as AfterPersistAccess, l as AjvErrorObjectLike, m as AjvValidationErrorLike, n as AjvValidatorLike, o as AllowedOutputFieldOptions, p as ArkTypeErrorsLike, q as ArkTypeLike, r as ArkTypeProblemLike, s as AuthorizedListResult, t as AuthorizedSingleResult, B as BaseFilterAccess, C as Change, u as Codes, v as CorrelatedCountInclude, w as CorrelatedFilter, x as CorrelatedInclude, y as CorrelatedIncludeArgs, z as CorrelatedListInclude, D as CorrelatedReadByFilterInclude, E as CorrelatedReadByIdInclude, F as CountBody, G as CreateArgs, H as CreateAuthorization, I as CreateOptions, J as CreateQueryInput, K as CustomHeaders, L as DATA_MIDDLEWARE, M as DataBaseFilterHook, N as DataFieldOptions, O as DataFilter, P as DataFindArgs, Q as DataFindOneArgs, R as DataFindOneOptions, S as DataFindOptions, T as DataHook, U as DataHookContext, V as DataIdentifierHook, W as DataListHook, X as DataOverrideFilterHook, Y as DataRequest, Z as DataRequestSchemas, _ as DataRouterOptions, $ as DecorateAccess, a0 as DecorateAllAccess, a1 as DeepFieldPath, a2 as DefaultModelRouterOptions, a3 as Defaults, a4 as DistinctArgs, a5 as DistinctBody, a6 as DocPermissionsAccess, a7 as DocumentAuthorization, a8 as ErrorResult, a9 as ExistsOptions, aa as ExtendedDataRouterOptions, ab as ExtendedDefaultModelRouterOptions, ac as ExtendedModelRouterOptions, ad as FieldAuthorization, ae as FieldOperationAccess, af as Filter, ag as FilterOperator, ah as FindAccess, ai as FindArgs, aj as FindByIdArgs, ak as FindByIdOptions, al as FindOneArgs, am as FindOneOptions, an as FindOptions, ao as GlobalOptions, ap as GlobalPermissionValue, aq as GuardHook, ar as HydrationMode, as as IdentifierHook, at as Include, au as InputFieldAuthorization, av as InputFieldPath, aw as IoTsContextEntryLike, ax as IoTsDecodeErrorLike, ay as IoTsDecoderLike, az as JoiSchemaLike, aA as JoiValidationErrorDetailLike, aB as KeyValueProjection, aC as LegacyInclude, aD as ListQueryInput, aE as ListResult, aF as MIDDLEWARE, aG as MaybePromise, aH as ModelBaseFilterHook, aI as ModelChangeHook, aJ as ModelDeleteHook, aK as ModelDocPermissionsHook, aL as ModelDocument, aM as ModelDocumentHook, aN as ModelHook, aO as ModelHookContext, aP as ModelHydrationOptions, aQ as ModelIdentifierHook, aR as ModelListHook, aS as ModelOverrideFilterHook, aT as ModelRequest, aU as ModelRouterOptions, aV as ModelValidateHook, aW as ModelVirtualAccess, aX as ModelVirtualAccessRecord, aY as ModelVirtualContext, aZ as ModelVirtualDescriptor, a_ as ModelVirtualDoc, a$ as ModelVirtualGetter, b0 as ModelVirtualLeaf, b1 as ModelVirtualPopulateDependency, b2 as ModelVirtualPopulateInputs, b3 as ModelVirtualRecordAccess, b4 as ModelVirtuals, b5 as MutationAuthorization, b6 as NewArgs, b7 as NewOptions, b8 as OperationAccess, b9 as OperationAuthorization, ba as OutputAuthorization, bb as OutputFieldOptions, bc as OutputFieldPath, bd as OutputPlanningOptions, be as PERMISSIONS, bf as PERMISSION_KEYS, bg as PairedRouteAccess, bh as ParentRef, bi as PathValue, bj as PermissionSchema, bk as Populate, bl as PopulateAccess, bm as PopulatePlanningOptions, bn as PrepareAccess, bo as Projection, bp as PublicCreateArgs, bq as PublicCreateOptions, br as PublicErrorResult, bs as PublicListArgs, bt as PublicListOptions, bu as PublicListResult, bv as PublicOutput, bw as PublicReadArgs, bx as PublicReadOptions, by as PublicServiceResult, bz as PublicSingleResult, bA as PublicSubdocumentCreateOptions, bB as PublicSubdocumentListOptions, bC as PublicSubdocumentMutationOptions, bD as PublicSubdocumentReadOptions, bE as PublicUpdateArgs, bF as PublicUpdateOptions, bG as PublicUpsertArgs, bH as PublicUpsertOptions, bI as ReadQueryInput, bJ as RelatedAuthorization, bK as Request, bL as RequestSchemaAdapter, bM as RequestSchemaFailure, bN as RequestSchemaIssue, bO as RequestSchemaLike, bP as RequestSchemaOptions, bQ as RequestSchemaResult, bR as RequestSchemaSuccess, bS as RequestSchemaValidator, bT as RequestSchemas, bU as RootDataListQueryEntry, bV as RootDataOperation, bW as RootDataReadByFilterQueryEntry, bX as RootDataReadByIdQueryEntry, bY as RootModelCountQueryEntry, bZ as RootModelCreateQueryEntry, b_ as RootModelDeleteQueryEntry, b$ as RootModelDistinctQueryEntry, c0 as RootModelListQueryEntry, c1 as RootModelNewQueryEntry, c2 as RootModelOperation, c3 as RootModelReadByFilterQueryEntry, c4 as RootModelReadByIdQueryEntry, c5 as RootModelSubBulkUpdateQueryEntry, c6 as RootModelSubCreateQueryEntry, c7 as RootModelSubDeleteQueryEntry, c8 as RootModelSubListQueryEntry, c9 as RootModelSubReadQueryEntry, ca as RootModelSubUpdateQueryEntry, cb as RootModelUpdateQueryEntry, cc as RootModelUpsertQueryEntry, cd as RootOperationResult, ce as RootQueryEntry, cf as RootRouterOptions, cg as RootSubOperation, ch as RootTarget, ci as RouteBaseAccess, cj as RouteGuardAccess, ck as RouteVariant, cl as RouteVariantAccess, cm as RowAuthorization, cn as SelectAccess, co as SelectedPopulatedPublicOutput, cp as SelectedPublicOutput, cq as ServiceAuthorization, cr as ServiceOutputContext, cs as ServiceOutputDecorator, ct as ServiceResult, cu as SingleResult, cv as Sort, cw as SortOrder, cx as StandardSchemaFailure, cy as StandardSchemaInferOutput, cz as StandardSchemaIssue, cA as StandardSchemaPathSegment, cB as StandardSchemaResult, cC as StandardSchemaSuccess, cD as StandardSchemaV1, cE as StatusCodes, cF as SubListBody, cG as SubOperationAccess, cH as SubPopulate, cI as SubQueryEntry, cJ as SubReadBody, cK as SubRouteGuardOptions, cL as SubdocumentBulkRecord, cM as SubdocumentBulkUpdateInput, cN as SubdocumentCreateAuthorization, cO as SubdocumentCreateInput, cP as SubdocumentCreateOptions, cQ as SubdocumentCreateVisibilityAuthorization, cR as SubdocumentDeleteAuthorization, cS as SubdocumentDeleteOptions, cT as SubdocumentGateAuthorization, cU as SubdocumentId, cV as SubdocumentInputAuthorization, cW as SubdocumentListOptions, cX as SubdocumentModel, cY as SubdocumentMutationAuthorization, cZ as SubdocumentName, c_ as SubdocumentOutputAuthorization, c$ as SubdocumentParentArgs, d0 as SubdocumentParentOptions, d1 as SubdocumentReadAuthorization, d2 as SubdocumentReadOptions, d3 as SubdocumentRecord, d4 as SubdocumentUpdateOptions, d5 as SubdocumentVirtuals, d6 as SubdocumentVisibilityAuthorization, d7 as SuperstructFailureLike, d8 as SuperstructValidateLike, d9 as Task, da as TaskType, db as TransformAccess, dc as TypedFilter, dd as UpdateByIdArgs, de as UpdateByIdOptions, df as UpdateOneArgs, dg as UpdateOneOptions, dh as UpdateQueryInput, di as UpsertArgs, dj as UpsertOptions, dk as UpsertQueryInput, dl as ValibotIssueLike, dm as ValibotPathItemLike, dn as ValibotSafeParseLike, dp as ValibotSafeParseResult, dq as ValidateAccess, dr as ValidateRule, ds as Validation, dt as ValidationError, du as VineValidationErrorLike, dv as VineValidationMessageLike, dw as VineValidatorLike, dx as VirtualSubModel, dy as WithVirtuals, dz as YupSchemaLike, dA as YupValidationErrorLike, dB as defineRequestSchema, dC as fromAjv, dD as fromArkType, dE as fromIoTs, dF as fromJoi, dG as fromStandardSchema, dH as fromSuperstruct, dI as fromValibot, dJ as fromVine, dK as fromYup, dL as fromZod, dM as parseBody, dN as parseBodyWithSchema, dO as parseNestedBodyWithSchema, dP as parsePathParam, dQ as parseQuery } from './parsers-CngKnVjW.mjs';
2
2
  import { z } from 'zod';
3
3
  import 'mongoose';
4
4
  import 'express';
package/advanced.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AccessRouterBaseRequest, a as AccessRouterFieldKey, b as AccessRouterLogger, c as AccessRouterRequest, d as AccessRouterRequestExtensions, e as AdvancedCreateBody, f as AdvancedListBody, g as AdvancedReadBody, h as AdvancedReadFilterBody, i as AdvancedUpdateBody, j as AdvancedUpsertBody, k as AfterPersistAccess, l as AjvErrorObjectLike, m as AjvValidationErrorLike, n as AjvValidatorLike, o as AllowedOutputFieldOptions, p as ArkTypeErrorsLike, q as ArkTypeLike, r as ArkTypeProblemLike, s as AuthorizedListResult, t as AuthorizedSingleResult, B as BaseFilterAccess, C as Change, u as Codes, v as CorrelatedCountInclude, w as CorrelatedFilter, x as CorrelatedInclude, y as CorrelatedIncludeArgs, z as CorrelatedListInclude, D as CorrelatedReadByFilterInclude, E as CorrelatedReadByIdInclude, F as CountBody, G as CreateArgs, H as CreateAuthorization, I as CreateOptions, J as CreateQueryInput, K as CustomHeaders, L as DATA_MIDDLEWARE, M as DataBaseFilterHook, N as DataFieldOptions, O as DataFilter, P as DataFindArgs, Q as DataFindOneArgs, R as DataFindOneOptions, S as DataFindOptions, T as DataHook, U as DataHookContext, V as DataIdentifierHook, W as DataListHook, X as DataOverrideFilterHook, Y as DataRequest, Z as DataRequestSchemas, _ as DataRouterOptions, $ as DecorateAccess, a0 as DecorateAllAccess, a1 as DeepFieldPath, a2 as DefaultModelRouterOptions, a3 as Defaults, a4 as DistinctArgs, a5 as DistinctBody, a6 as DocPermissionsAccess, a7 as DocumentAuthorization, a8 as ErrorResult, a9 as ExistsOptions, aa as ExtendedDataRouterOptions, ab as ExtendedDefaultModelRouterOptions, ac as ExtendedModelRouterOptions, ad as FieldAuthorization, ae as FieldOperationAccess, af as Filter, ag as FilterOperator, ah as FindAccess, ai as FindArgs, aj as FindByIdArgs, ak as FindByIdOptions, al as FindOneArgs, am as FindOneOptions, an as FindOptions, ao as GlobalOptions, ap as GlobalPermissionValue, aq as GuardHook, ar as HydrationMode, as as IdentifierHook, at as Include, au as InputFieldAuthorization, av as InputFieldPath, aw as IoTsContextEntryLike, ax as IoTsDecodeErrorLike, ay as IoTsDecoderLike, az as JoiSchemaLike, aA as JoiValidationErrorDetailLike, aB as KeyValueProjection, aC as LegacyInclude, aD as ListQueryInput, aE as ListResult, aF as MIDDLEWARE, aG as MaybePromise, aH as ModelBaseFilterHook, aI as ModelChangeHook, aJ as ModelDeleteHook, aK as ModelDocPermissionsHook, aL as ModelDocument, aM as ModelDocumentHook, aN as ModelHook, aO as ModelHookContext, aP as ModelHydrationOptions, aQ as ModelIdentifierHook, aR as ModelListHook, aS as ModelOverrideFilterHook, aT as ModelRequest, aU as ModelRouterOptions, aV as ModelValidateHook, aW as ModelVirtualAccess, aX as ModelVirtualAccessRecord, aY as ModelVirtualContext, aZ as ModelVirtualDescriptor, a_ as ModelVirtualDoc, a$ as ModelVirtualGetter, b0 as ModelVirtualLeaf, b1 as ModelVirtualPopulateDependency, b2 as ModelVirtualPopulateInputs, b3 as ModelVirtualRecordAccess, b4 as ModelVirtuals, b5 as MutationAuthorization, b6 as NewArgs, b7 as NewOptions, b8 as OperationAccess, b9 as OperationAuthorization, ba as OutputAuthorization, bb as OutputFieldOptions, bc as OutputFieldPath, bd as OutputPlanningOptions, be as PERMISSIONS, bf as PERMISSION_KEYS, bg as PairedRouteAccess, bh as ParentRef, bi as PathValue, bj as PermissionSchema, bk as Populate, bl as PopulateAccess, bm as PopulatePlanningOptions, bn as PrepareAccess, bo as Projection, bp as PublicCreateArgs, bq as PublicCreateOptions, br as PublicErrorResult, bs as PublicListArgs, bt as PublicListOptions, bu as PublicListResult, bv as PublicOutput, bw as PublicReadArgs, bx as PublicReadOptions, by as PublicServiceResult, bz as PublicSingleResult, bA as PublicSubdocumentCreateOptions, bB as PublicSubdocumentListOptions, bC as PublicSubdocumentMutationOptions, bD as PublicSubdocumentReadOptions, bE as PublicUpdateArgs, bF as PublicUpdateOptions, bG as PublicUpsertArgs, bH as PublicUpsertOptions, bI as ReadQueryInput, bJ as RelatedAuthorization, bK as Request, bL as RequestSchemaAdapter, bM as RequestSchemaFailure, bN as RequestSchemaIssue, bO as RequestSchemaLike, bP as RequestSchemaOptions, bQ as RequestSchemaResult, bR as RequestSchemaSuccess, bS as RequestSchemaValidator, bT as RequestSchemas, bU as RootDataListQueryEntry, bV as RootDataOperation, bW as RootDataReadByFilterQueryEntry, bX as RootDataReadByIdQueryEntry, bY as RootModelCountQueryEntry, bZ as RootModelCreateQueryEntry, b_ as RootModelDeleteQueryEntry, b$ as RootModelDistinctQueryEntry, c0 as RootModelListQueryEntry, c1 as RootModelNewQueryEntry, c2 as RootModelOperation, c3 as RootModelReadByFilterQueryEntry, c4 as RootModelReadByIdQueryEntry, c5 as RootModelSubBulkUpdateQueryEntry, c6 as RootModelSubCreateQueryEntry, c7 as RootModelSubDeleteQueryEntry, c8 as RootModelSubListQueryEntry, c9 as RootModelSubReadQueryEntry, ca as RootModelSubUpdateQueryEntry, cb as RootModelUpdateQueryEntry, cc as RootModelUpsertQueryEntry, cd as RootOperationResult, ce as RootQueryEntry, cf as RootRouterOptions, cg as RootSubOperation, ch as RootTarget, ci as RouteBaseAccess, cj as RouteGuardAccess, ck as RouteVariant, cl as RouteVariantAccess, cm as RowAuthorization, cn as SelectAccess, co as SelectedPopulatedPublicOutput, cp as SelectedPublicOutput, cq as ServiceAuthorization, cr as ServiceOutputContext, cs as ServiceOutputDecorator, ct as ServiceResult, cu as SingleResult, cv as Sort, cw as SortOrder, cx as StandardSchemaFailure, cy as StandardSchemaInferOutput, cz as StandardSchemaIssue, cA as StandardSchemaPathSegment, cB as StandardSchemaResult, cC as StandardSchemaSuccess, cD as StandardSchemaV1, cE as StatusCodes, cF as SubListBody, cG as SubOperationAccess, cH as SubPopulate, cI as SubQueryEntry, cJ as SubReadBody, cK as SubRouteGuardOptions, cL as SubdocumentBulkRecord, cM as SubdocumentBulkUpdateInput, cN as SubdocumentCreateAuthorization, cO as SubdocumentCreateInput, cP as SubdocumentCreateOptions, cQ as SubdocumentCreateVisibilityAuthorization, cR as SubdocumentDeleteAuthorization, cS as SubdocumentDeleteOptions, cT as SubdocumentGateAuthorization, cU as SubdocumentId, cV as SubdocumentInputAuthorization, cW as SubdocumentListOptions, cX as SubdocumentModel, cY as SubdocumentMutationAuthorization, cZ as SubdocumentName, c_ as SubdocumentOutputAuthorization, c$ as SubdocumentParentArgs, d0 as SubdocumentParentOptions, d1 as SubdocumentReadAuthorization, d2 as SubdocumentReadOptions, d3 as SubdocumentRecord, d4 as SubdocumentUpdateOptions, d5 as SubdocumentVirtuals, d6 as SubdocumentVisibilityAuthorization, d7 as SuperstructFailureLike, d8 as SuperstructValidateLike, d9 as Task, da as TaskType, db as TransformAccess, dc as TypedFilter, dd as UpdateByIdArgs, de as UpdateByIdOptions, df as UpdateOneArgs, dg as UpdateOneOptions, dh as UpdateQueryInput, di as UpsertArgs, dj as UpsertOptions, dk as UpsertQueryInput, dl as ValibotIssueLike, dm as ValibotPathItemLike, dn as ValibotSafeParseLike, dp as ValibotSafeParseResult, dq as ValidateAccess, dr as ValidateRule, ds as Validation, dt as ValidationError, du as VineValidationErrorLike, dv as VineValidationMessageLike, dw as VineValidatorLike, dx as VirtualSubModel, dy as WithVirtuals, dz as YupSchemaLike, dA as YupValidationErrorLike, dB as defineRequestSchema, dC as fromAjv, dD as fromArkType, dE as fromIoTs, dF as fromJoi, dG as fromStandardSchema, dH as fromSuperstruct, dI as fromValibot, dJ as fromVine, dK as fromYup, dL as fromZod, dM as parseBody, dN as parseBodyWithSchema, dO as parseNestedBodyWithSchema, dP as parsePathParam, dQ as parseQuery } from './parsers-BXKoUKMa.js';
1
+ export { A as AccessRouterBaseRequest, a as AccessRouterFieldKey, b as AccessRouterLogger, c as AccessRouterRequest, d as AccessRouterRequestExtensions, e as AdvancedCreateBody, f as AdvancedListBody, g as AdvancedReadBody, h as AdvancedReadFilterBody, i as AdvancedUpdateBody, j as AdvancedUpsertBody, k as AfterPersistAccess, l as AjvErrorObjectLike, m as AjvValidationErrorLike, n as AjvValidatorLike, o as AllowedOutputFieldOptions, p as ArkTypeErrorsLike, q as ArkTypeLike, r as ArkTypeProblemLike, s as AuthorizedListResult, t as AuthorizedSingleResult, B as BaseFilterAccess, C as Change, u as Codes, v as CorrelatedCountInclude, w as CorrelatedFilter, x as CorrelatedInclude, y as CorrelatedIncludeArgs, z as CorrelatedListInclude, D as CorrelatedReadByFilterInclude, E as CorrelatedReadByIdInclude, F as CountBody, G as CreateArgs, H as CreateAuthorization, I as CreateOptions, J as CreateQueryInput, K as CustomHeaders, L as DATA_MIDDLEWARE, M as DataBaseFilterHook, N as DataFieldOptions, O as DataFilter, P as DataFindArgs, Q as DataFindOneArgs, R as DataFindOneOptions, S as DataFindOptions, T as DataHook, U as DataHookContext, V as DataIdentifierHook, W as DataListHook, X as DataOverrideFilterHook, Y as DataRequest, Z as DataRequestSchemas, _ as DataRouterOptions, $ as DecorateAccess, a0 as DecorateAllAccess, a1 as DeepFieldPath, a2 as DefaultModelRouterOptions, a3 as Defaults, a4 as DistinctArgs, a5 as DistinctBody, a6 as DocPermissionsAccess, a7 as DocumentAuthorization, a8 as ErrorResult, a9 as ExistsOptions, aa as ExtendedDataRouterOptions, ab as ExtendedDefaultModelRouterOptions, ac as ExtendedModelRouterOptions, ad as FieldAuthorization, ae as FieldOperationAccess, af as Filter, ag as FilterOperator, ah as FindAccess, ai as FindArgs, aj as FindByIdArgs, ak as FindByIdOptions, al as FindOneArgs, am as FindOneOptions, an as FindOptions, ao as GlobalOptions, ap as GlobalPermissionValue, aq as GuardHook, ar as HydrationMode, as as IdentifierHook, at as Include, au as InputFieldAuthorization, av as InputFieldPath, aw as IoTsContextEntryLike, ax as IoTsDecodeErrorLike, ay as IoTsDecoderLike, az as JoiSchemaLike, aA as JoiValidationErrorDetailLike, aB as KeyValueProjection, aC as LegacyInclude, aD as ListQueryInput, aE as ListResult, aF as MIDDLEWARE, aG as MaybePromise, aH as ModelBaseFilterHook, aI as ModelChangeHook, aJ as ModelDeleteHook, aK as ModelDocPermissionsHook, aL as ModelDocument, aM as ModelDocumentHook, aN as ModelHook, aO as ModelHookContext, aP as ModelHydrationOptions, aQ as ModelIdentifierHook, aR as ModelListHook, aS as ModelOverrideFilterHook, aT as ModelRequest, aU as ModelRouterOptions, aV as ModelValidateHook, aW as ModelVirtualAccess, aX as ModelVirtualAccessRecord, aY as ModelVirtualContext, aZ as ModelVirtualDescriptor, a_ as ModelVirtualDoc, a$ as ModelVirtualGetter, b0 as ModelVirtualLeaf, b1 as ModelVirtualPopulateDependency, b2 as ModelVirtualPopulateInputs, b3 as ModelVirtualRecordAccess, b4 as ModelVirtuals, b5 as MutationAuthorization, b6 as NewArgs, b7 as NewOptions, b8 as OperationAccess, b9 as OperationAuthorization, ba as OutputAuthorization, bb as OutputFieldOptions, bc as OutputFieldPath, bd as OutputPlanningOptions, be as PERMISSIONS, bf as PERMISSION_KEYS, bg as PairedRouteAccess, bh as ParentRef, bi as PathValue, bj as PermissionSchema, bk as Populate, bl as PopulateAccess, bm as PopulatePlanningOptions, bn as PrepareAccess, bo as Projection, bp as PublicCreateArgs, bq as PublicCreateOptions, br as PublicErrorResult, bs as PublicListArgs, bt as PublicListOptions, bu as PublicListResult, bv as PublicOutput, bw as PublicReadArgs, bx as PublicReadOptions, by as PublicServiceResult, bz as PublicSingleResult, bA as PublicSubdocumentCreateOptions, bB as PublicSubdocumentListOptions, bC as PublicSubdocumentMutationOptions, bD as PublicSubdocumentReadOptions, bE as PublicUpdateArgs, bF as PublicUpdateOptions, bG as PublicUpsertArgs, bH as PublicUpsertOptions, bI as ReadQueryInput, bJ as RelatedAuthorization, bK as Request, bL as RequestSchemaAdapter, bM as RequestSchemaFailure, bN as RequestSchemaIssue, bO as RequestSchemaLike, bP as RequestSchemaOptions, bQ as RequestSchemaResult, bR as RequestSchemaSuccess, bS as RequestSchemaValidator, bT as RequestSchemas, bU as RootDataListQueryEntry, bV as RootDataOperation, bW as RootDataReadByFilterQueryEntry, bX as RootDataReadByIdQueryEntry, bY as RootModelCountQueryEntry, bZ as RootModelCreateQueryEntry, b_ as RootModelDeleteQueryEntry, b$ as RootModelDistinctQueryEntry, c0 as RootModelListQueryEntry, c1 as RootModelNewQueryEntry, c2 as RootModelOperation, c3 as RootModelReadByFilterQueryEntry, c4 as RootModelReadByIdQueryEntry, c5 as RootModelSubBulkUpdateQueryEntry, c6 as RootModelSubCreateQueryEntry, c7 as RootModelSubDeleteQueryEntry, c8 as RootModelSubListQueryEntry, c9 as RootModelSubReadQueryEntry, ca as RootModelSubUpdateQueryEntry, cb as RootModelUpdateQueryEntry, cc as RootModelUpsertQueryEntry, cd as RootOperationResult, ce as RootQueryEntry, cf as RootRouterOptions, cg as RootSubOperation, ch as RootTarget, ci as RouteBaseAccess, cj as RouteGuardAccess, ck as RouteVariant, cl as RouteVariantAccess, cm as RowAuthorization, cn as SelectAccess, co as SelectedPopulatedPublicOutput, cp as SelectedPublicOutput, cq as ServiceAuthorization, cr as ServiceOutputContext, cs as ServiceOutputDecorator, ct as ServiceResult, cu as SingleResult, cv as Sort, cw as SortOrder, cx as StandardSchemaFailure, cy as StandardSchemaInferOutput, cz as StandardSchemaIssue, cA as StandardSchemaPathSegment, cB as StandardSchemaResult, cC as StandardSchemaSuccess, cD as StandardSchemaV1, cE as StatusCodes, cF as SubListBody, cG as SubOperationAccess, cH as SubPopulate, cI as SubQueryEntry, cJ as SubReadBody, cK as SubRouteGuardOptions, cL as SubdocumentBulkRecord, cM as SubdocumentBulkUpdateInput, cN as SubdocumentCreateAuthorization, cO as SubdocumentCreateInput, cP as SubdocumentCreateOptions, cQ as SubdocumentCreateVisibilityAuthorization, cR as SubdocumentDeleteAuthorization, cS as SubdocumentDeleteOptions, cT as SubdocumentGateAuthorization, cU as SubdocumentId, cV as SubdocumentInputAuthorization, cW as SubdocumentListOptions, cX as SubdocumentModel, cY as SubdocumentMutationAuthorization, cZ as SubdocumentName, c_ as SubdocumentOutputAuthorization, c$ as SubdocumentParentArgs, d0 as SubdocumentParentOptions, d1 as SubdocumentReadAuthorization, d2 as SubdocumentReadOptions, d3 as SubdocumentRecord, d4 as SubdocumentUpdateOptions, d5 as SubdocumentVirtuals, d6 as SubdocumentVisibilityAuthorization, d7 as SuperstructFailureLike, d8 as SuperstructValidateLike, d9 as Task, da as TaskType, db as TransformAccess, dc as TypedFilter, dd as UpdateByIdArgs, de as UpdateByIdOptions, df as UpdateOneArgs, dg as UpdateOneOptions, dh as UpdateQueryInput, di as UpsertArgs, dj as UpsertOptions, dk as UpsertQueryInput, dl as ValibotIssueLike, dm as ValibotPathItemLike, dn as ValibotSafeParseLike, dp as ValibotSafeParseResult, dq as ValidateAccess, dr as ValidateRule, ds as Validation, dt as ValidationError, du as VineValidationErrorLike, dv as VineValidationMessageLike, dw as VineValidatorLike, dx as VirtualSubModel, dy as WithVirtuals, dz as YupSchemaLike, dA as YupValidationErrorLike, dB as defineRequestSchema, dC as fromAjv, dD as fromArkType, dE as fromIoTs, dF as fromJoi, dG as fromStandardSchema, dH as fromSuperstruct, dI as fromValibot, dJ as fromVine, dK as fromYup, dL as fromZod, dM as parseBody, dN as parseBodyWithSchema, dO as parseNestedBodyWithSchema, dP as parsePathParam, dQ as parseQuery } from './parsers-CngKnVjW.js';
2
2
  import { z } from 'zod';
3
3
  import 'mongoose';
4
4
  import 'express';