@web-ts-toolkit/access-router 0.55.0 → 0.57.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 +218 -56
- package/advanced.d.mts +1 -1
- package/advanced.d.ts +1 -1
- package/advanced.js +100 -61
- package/advanced.mjs +67 -28
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.js +624 -533
- package/index.mjs +361 -270
- package/llms.txt +3 -2
- package/package.json +3 -3
- package/{parsers-BrVRL2fg.d.mts → parsers-CngKnVjW.d.mts} +93 -14
- package/{parsers-BrVRL2fg.d.ts → parsers-CngKnVjW.d.ts} +93 -14
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ package-managed execution, falling back to `defaultRuntime` outside it.
|
|
|
126
126
|
|
|
127
127
|
| Layer / public type | Where to put it | Scope and examples |
|
|
128
128
|
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
129
|
-
| Runtime/global — `GlobalOptions` | `api.setGlobalOptions({...})`, `api.setGlobalOption(key, value)`; `api.set` is an alias for these forms | That runtime's request grants (`globalPermissions`, `requestPermissionField`), logger, registered-populate policy and `requestComplexity`.
|
|
129
|
+
| Runtime/global — `GlobalOptions` | `api.setGlobalOptions({...})`, `api.setGlobalOption(key, value)`; `api.set` is an alias for these forms | That runtime's request grants (`globalPermissions`, `requestPermissionField`), logger, registered-populate/private-input read policy and `requestComplexity`. |
|
|
130
130
|
| Model defaults — `DefaultModelRouterOptions` | `api.setDefaultModelOptions({...})`, `api.setDefaultModelOption(path, value)` | Shared model starting values such as `listHardLimit`, IDs, route segments, `operationAccess`, `hydration` and metadata posture. Data/root routers do not inherit them. |
|
|
131
131
|
| Model router — `ModelRouterOptions<Model, Virtuals>` | `api.createRouter(Model, {...})`, then `router.setOptions`, `router.setOption` / `router.set` | One registered model's guards, `permissionSchema`, hooks, virtuals, request schemas, `hydration` and method defaults. Routers for the same model/runtime share its stored options. |
|
|
132
132
|
| Data router — `DataRouterOptions<Data>` | `api.createDataRouter(name, {...})`, its setters, or `api.runtime.setDataOptions` / `setDataOption` | Owned in-memory `data`, list/read guards, request-only fields/filters and decorators. No model `defaults` or model authorization policy. Set `idParam` and `idField` explicitly for data identifier routes. |
|
|
@@ -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
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
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,89 @@ 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
|
|
|
2594
|
+
#### Runtime populate operation policies
|
|
2595
|
+
|
|
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.
|
|
2623
|
+
|
|
2624
|
+
<!-- doc-example: partial -->
|
|
2625
|
+
|
|
2626
|
+
```ts
|
|
2627
|
+
import { createAccessRuntime, type GlobalOptions } from '@web-ts-toolkit/access-router';
|
|
2628
|
+
|
|
2629
|
+
const api = createAccessRuntime();
|
|
2630
|
+
api.setGlobalOptions({
|
|
2631
|
+
requireOperationAccessForPopulateQueries: true,
|
|
2632
|
+
requireOperationAccessForPopulateDependencies: false,
|
|
2633
|
+
});
|
|
2634
|
+
// The exact setter and api.set(key, value)/api.set(options) aliases are also typed.
|
|
2635
|
+
api.setGlobalOption('requireOperationAccessForPopulateQueries', false);
|
|
2636
|
+
const snapshot: GlobalOptions = api.getGlobalOptions();
|
|
2637
|
+
const mode: boolean | undefined = api.getGlobalOption('requireOperationAccessForPopulateDependencies');
|
|
2638
|
+
void [snapshot, mode];
|
|
2639
|
+
```
|
|
2640
|
+
|
|
2641
|
+
Missing/undefined or malformed JavaScript values (`'false'`, `0`, null, objects)
|
|
2642
|
+
use the conservative true mode; typed setters accept only boolean/undefined. An
|
|
2643
|
+
omitted property in a shallow object setter preserves the current setting. The
|
|
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
|
|
2646
|
+
calls see updates. Separate runtimes remain isolated.
|
|
2647
|
+
|
|
2648
|
+
These are **server/runtime configuration**, not model defaults, service query options,
|
|
2649
|
+
HTTP/root/client control or persisted capability. Business fields with the same
|
|
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.
|
|
2669
|
+
|
|
2589
2670
|
#### Runnable private dependency example
|
|
2590
2671
|
|
|
2591
2672
|
Save as `private-populate-example.mts` and run with Node 22.18+ or compile with
|
|
2592
2673
|
TypeScript/NodeNext. Install the package, Express and Mongoose as above. This
|
|
2593
2674
|
self-contained example creates/removes a uniquely named database, registers the
|
|
2594
|
-
|
|
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
|
|
2595
2677
|
tenant is server-owned; real applications derive it from their authenticated actor.
|
|
2596
2678
|
|
|
2597
2679
|
<!-- doc-example: complete-runtime -->
|
|
@@ -2604,8 +2686,9 @@ import type { Server } from 'node:http';
|
|
|
2604
2686
|
import express from 'express';
|
|
2605
2687
|
import mongoose from 'mongoose';
|
|
2606
2688
|
import { createAccessRuntime, type ModelVirtualDescriptor } from '@web-ts-toolkit/access-router';
|
|
2689
|
+
import type { ModelRequest } from '@web-ts-toolkit/access-router/advanced';
|
|
2607
2690
|
|
|
2608
|
-
interface
|
|
2691
|
+
interface DocumentRecord {
|
|
2609
2692
|
name: string;
|
|
2610
2693
|
balance: number;
|
|
2611
2694
|
creditLimit: number;
|
|
@@ -2613,7 +2696,7 @@ interface Account {
|
|
|
2613
2696
|
}
|
|
2614
2697
|
interface Order {
|
|
2615
2698
|
total: number;
|
|
2616
|
-
account: mongoose.Types.ObjectId | null; // stays a persisted ref, not
|
|
2699
|
+
account: mongoose.Types.ObjectId | null; // stays a persisted ref, not a DocumentRecord
|
|
2617
2700
|
}
|
|
2618
2701
|
interface OrderVirtuals {
|
|
2619
2702
|
canPlaceOrder: boolean;
|
|
@@ -2629,9 +2712,9 @@ async function runPrivatePopulateExample() {
|
|
|
2629
2712
|
try {
|
|
2630
2713
|
const api = createAccessRuntime();
|
|
2631
2714
|
api.setGlobalOptions({ globalPermissions: () => [] });
|
|
2632
|
-
const
|
|
2633
|
-
'
|
|
2634
|
-
new mongoose.Schema<
|
|
2715
|
+
const DocumentModel = connection.model<DocumentRecord>(
|
|
2716
|
+
'Document',
|
|
2717
|
+
new mongoose.Schema<DocumentRecord>({
|
|
2635
2718
|
name: String,
|
|
2636
2719
|
balance: { type: Number, select: false },
|
|
2637
2720
|
creditLimit: Number,
|
|
@@ -2639,8 +2722,9 @@ async function runPrivatePopulateExample() {
|
|
|
2639
2722
|
}),
|
|
2640
2723
|
);
|
|
2641
2724
|
// Both the actual model instance and its options must exist in this runtime first.
|
|
2642
|
-
|
|
2643
|
-
|
|
2725
|
+
api.registerModelInstance(DocumentModel.modelName, DocumentModel);
|
|
2726
|
+
api.setModelOptions(DocumentModel.modelName, {
|
|
2727
|
+
operationAccess: { read: false, list: false },
|
|
2644
2728
|
baseFilter: { read: () => ({ tenantId: 'shop-a' }) },
|
|
2645
2729
|
permissionSchema: { name: true, balance: false, creditLimit: false },
|
|
2646
2730
|
stripPermissionsField: true,
|
|
@@ -2649,11 +2733,11 @@ async function runPrivatePopulateExample() {
|
|
|
2649
2733
|
'PrivateExampleOrder',
|
|
2650
2734
|
new mongoose.Schema<Order>({
|
|
2651
2735
|
total: Number,
|
|
2652
|
-
account: { type: mongoose.Schema.Types.ObjectId, ref:
|
|
2736
|
+
account: { type: mongoose.Schema.Types.ObjectId, ref: DocumentModel.modelName },
|
|
2653
2737
|
}),
|
|
2654
2738
|
);
|
|
2655
2739
|
// Explicit target map: an ObjectId alone cannot infer its related model.
|
|
2656
|
-
const canPlaceOrder: ModelVirtualDescriptor<Order, boolean, { account:
|
|
2740
|
+
const canPlaceOrder: ModelVirtualDescriptor<Order, boolean, { account: DocumentRecord }> = {
|
|
2657
2741
|
dependsOn: ['total'],
|
|
2658
2742
|
dependsOnPopulate: [{ path: 'account', select: ['balance', 'creditLimit'] }],
|
|
2659
2743
|
get(doc, _permissions, _context, populated = {}) {
|
|
@@ -2670,11 +2754,20 @@ async function runPrivatePopulateExample() {
|
|
|
2670
2754
|
virtuals: { canPlaceOrder }, // assign the separately typed descriptor normally
|
|
2671
2755
|
stripPermissionsField: true,
|
|
2672
2756
|
});
|
|
2673
|
-
const account = await
|
|
2757
|
+
const account = await DocumentModel.create({ name: 'Main', balance: 80, creditLimit: 20, tenantId: 'shop-a' });
|
|
2674
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 });
|
|
2675
2767
|
const app = express();
|
|
2676
2768
|
app.use(express.json());
|
|
2677
2769
|
app.use(orders.routes);
|
|
2770
|
+
app.use(root.routes); // no Document HTTP router is constructed or mounted
|
|
2678
2771
|
server = app.listen(0, '127.0.0.1');
|
|
2679
2772
|
await once(server, 'listening');
|
|
2680
2773
|
const address = server.address();
|
|
@@ -2690,27 +2783,56 @@ async function runPrivatePopulateExample() {
|
|
|
2690
2783
|
return response.json();
|
|
2691
2784
|
}
|
|
2692
2785
|
const select = ['account', 'canPlaceOrder', '-_id'];
|
|
2693
|
-
|
|
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 });
|
|
2694
2807
|
assert.deepEqual(await read({ select, populate: [{ path: 'account', select: 'name -_id' }] }), {
|
|
2695
2808
|
account: { name: 'Main' },
|
|
2696
2809
|
canPlaceOrder: true,
|
|
2697
2810
|
});
|
|
2698
|
-
|
|
2699
|
-
assert.deepEqual(
|
|
2700
|
-
//
|
|
2701
|
-
assert.deepEqual(
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
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,
|
|
2818
|
+
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
|
+
]),
|
|
2707
2830
|
});
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
assert.deepEqual(await read({ select: ['canPlaceOrder', '-_id'] }), {});
|
|
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');
|
|
2835
|
+
}
|
|
2714
2836
|
} finally {
|
|
2715
2837
|
if (server)
|
|
2716
2838
|
await new Promise<void>((resolve, reject) => server!.close((error) => (error ? reject(error) : resolve())));
|
|
@@ -2753,12 +2875,13 @@ becomes computed output**; this is not a prohibition on returning derived values
|
|
|
2753
2875
|
|
|
2754
2876
|
#### Target authority, selection and reconstruction
|
|
2755
2877
|
|
|
2756
|
-
Private targets
|
|
2757
|
-
source lists, writes and templates. The original actor's `operationAccess.read
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2878
|
+
Private targets use captured base **`read`** row semantics, including array refs,
|
|
2879
|
+
source lists, writes and templates. The original actor's `operationAccess.read` gates
|
|
2880
|
+
private loading in default/true mode; false bypasses only that admission. In either
|
|
2881
|
+
mode, `overrideFilter.read` (starting with `{}`) and `baseFilter.read` use request row
|
|
2882
|
+
authority with their normal exact → default → bare fallback/cache rules (including
|
|
2883
|
+
runtime defaults). Mandatory source IDs are ANDed afterward, preserving tenant scope.
|
|
2884
|
+
There is no private read-to-list fallback or route-variant gate. `authorization.related` governs only an ordinary
|
|
2762
2885
|
requested populate/include; its grants/replacement rows, public `match`, `access`
|
|
2763
2886
|
and `select` cannot redefine private inputs. A related policy naming only a
|
|
2764
2887
|
dependency-only path is unused/invalid.
|
|
@@ -2771,14 +2894,26 @@ separate and immutable. Even a readable private field is omitted unless original
|
|
|
2771
2894
|
selected and permitted. Public exclusions and `-_id` remain effective. Different
|
|
2772
2895
|
public match/access/row scopes require independent queries.
|
|
2773
2896
|
|
|
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 |
|
|
2907
|
+
|
|
2774
2908
|
The original query includes resolved server defaults. A default populate is ordinary
|
|
2775
|
-
population; explicit `populate: []` suppresses it.
|
|
2776
|
-
its original target projection, match/missing/null/array behavior.
|
|
2777
|
-
population
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2909
|
+
population; explicit `populate: []` suppresses it. Allowed ordinary population retains
|
|
2910
|
+
its original target projection, match/missing/null/array behavior. Without admitted
|
|
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.
|
|
2782
2917
|
|
|
2783
2918
|
#### Supported declarations and validation
|
|
2784
2919
|
|
|
@@ -2811,23 +2946,25 @@ runs even when the getter is omitted or fails, before presentation hooks/tasks.
|
|
|
2811
2946
|
undefined inherits, and null rejects. Descriptor arrays/masks and target policies
|
|
2812
2947
|
are captured with the getter before asynchronous work; later calls see updates.
|
|
2813
2948
|
- Validation is eager and atomic for constructors, bulk and dotted setters. Target
|
|
2814
|
-
model instances **and options
|
|
2815
|
-
|
|
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
|
|
2816
2951
|
both options before assigning virtuals; self-refs use the proposed source options.
|
|
2817
2952
|
Operation capture rechecks schema/target/metadata binding before hooks or writes.
|
|
2818
2953
|
|
|
2819
2954
|
#### Absence, errors, lifecycle and measured work
|
|
2820
2955
|
|
|
2821
2956
|
Absent/undefined source refs omit the virtual without invoking it. Present null and
|
|
2822
|
-
empty arrays invoke the getter with null/[] without a target query when
|
|
2823
|
-
|
|
2957
|
+
empty arrays invoke the getter with null/[] without a target query when private
|
|
2958
|
+
admission/row policy permits. Deleted/out-of-scope target rows become scalar null or null array slots;
|
|
2824
2959
|
private arrays preserve original order, duplicates and null/missing slots. Missing
|
|
2825
2960
|
target fields remain partial inputs; null/false/zero/empty-string stay present and
|
|
2826
2961
|
the getter decides what to return.
|
|
2827
2962
|
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2963
|
+
In true mode, target read denial makes dependencies unavailable; in either mode,
|
|
2964
|
+
a terminal false `overrideFilter.read`/`baseFilter.read` does so. Affected virtuals
|
|
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.
|
|
2831
2968
|
There is no raw fallback, retry or new retryable write error: a successful write
|
|
2832
2969
|
stays successful. A failed query that also serves ordinary public population keeps
|
|
2833
2970
|
that ordinary error path. Getter undefined/throw omits fail-closed; invalid server
|
|
@@ -2840,7 +2977,8 @@ distinct, exists, delete identities, include-count and field helpers add no priv
|
|
|
2840
2977
|
dependency I/O/getters. `SubPopulate` remains path/select-only. Writes capture
|
|
2841
2978
|
post-save/post-afterPersist refs on detached output copies after lifecycle work;
|
|
2842
2979
|
hidden mutation rows do not run getters. `new` still ignores `args.select`, uses
|
|
2843
|
-
create access, and loads present default refs under
|
|
2980
|
+
create access, and loads present default refs under the captured private-read mode and
|
|
2981
|
+
request read-row scope without saving.
|
|
2844
2982
|
|
|
2845
2983
|
Private fetches use the receiving output's captured hydration: source read mode for
|
|
2846
2984
|
direct reads/populate, fixed lean for include targets, hydrated for dedicated child
|
|
@@ -2854,7 +2992,7 @@ issued 1 parent find + 2 target finds**, in lean and hydrated modes. Getter coun
|
|
|
2854
2992
|
were 4 and 96; observed persistence/getter peaks were 1/1 or 2/2 at matching limits.
|
|
2855
2993
|
Compatible rows/virtuals/scopes batch and deduplicate fetched IDs, not reconstructed
|
|
2856
2994
|
slots or public authorization. Covered raw work can be reused only within its
|
|
2857
|
-
captured request/runtime/family/mode and ID/projection coverage. Different scopes
|
|
2995
|
+
captured request/runtime/family/private-read mode, hydration and ID/projection coverage. Different scopes
|
|
2858
2996
|
still query separately; ordinary per-parent correlated public queries remain
|
|
2859
2997
|
per-parent. This is not a constant-query-count promise for independent includes.
|
|
2860
2998
|
|
|
@@ -2862,9 +3000,33 @@ per-parent. This is not a constant-query-count promise for independent includes.
|
|
|
2862
3000
|
keep their first-argument and three-argument direct-call contract. Opt in by adding
|
|
2863
3001
|
the declaration and a separately typed descriptor/default fourth argument; no new
|
|
2864
3002
|
router-wide generic, entrypoint, client API or persisted-field migration is required.
|
|
2865
|
-
The
|
|
3003
|
+
The declaration's opt-in constraints are eager target registration and strict static
|
|
2866
3004
|
reference/target-selection validation; ordinary public populate grammar is unchanged.
|
|
2867
3005
|
|
|
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.
|
|
3029
|
+
|
|
2868
3030
|
### Hook admission and reentrant service calls
|
|
2869
3031
|
|
|
2870
3032
|
`requestComplexity.maxHookConcurrency` (default `10`) limits **independently
|
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-
|
|
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-
|
|
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';
|