@web-ts-toolkit/access-router 0.56.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 +177 -120
- package/advanced.d.mts +1 -1
- package/advanced.d.ts +1 -1
- package/advanced.js +95 -66
- package/advanced.mjs +62 -33
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.js +545 -514
- package/index.mjs +282 -251
- package/llms.txt +2 -2
- package/package.json +3 -3
- package/{parsers-BXKoUKMa.d.mts → parsers-CngKnVjW.d.mts} +65 -37
- package/{parsers-BXKoUKMa.d.ts → parsers-CngKnVjW.d.ts} +65 -37
package/advanced.mjs
CHANGED
|
@@ -186,7 +186,7 @@ import {
|
|
|
186
186
|
isBoolean,
|
|
187
187
|
isFunction as isFunction2,
|
|
188
188
|
isNil as isNil2,
|
|
189
|
-
isPlainObject as
|
|
189
|
+
isPlainObject as isPlainObject13,
|
|
190
190
|
isString as isString3,
|
|
191
191
|
keys,
|
|
192
192
|
normalizeUrlPath,
|
|
@@ -1168,7 +1168,7 @@ function resolveSnapshotDescriptor(scopeVirtuals, virtualName, access) {
|
|
|
1168
1168
|
}
|
|
1169
1169
|
|
|
1170
1170
|
// src/acl/virtual-populate-dependencies.ts
|
|
1171
|
-
import { get as get2, isPlainObject as
|
|
1171
|
+
import { get as get2, isPlainObject as isPlainObject12 } from "@web-ts-toolkit/utils";
|
|
1172
1172
|
|
|
1173
1173
|
// src/acl/authorization-snapshot.ts
|
|
1174
1174
|
import { isDeepStrictEqual } from "util";
|
|
@@ -1376,6 +1376,25 @@ function captureAuthorizationFieldCatalog(schema, virtuals, documentPermissionFi
|
|
|
1376
1376
|
});
|
|
1377
1377
|
}
|
|
1378
1378
|
|
|
1379
|
+
// src/acl/populate-target-configuration.ts
|
|
1380
|
+
import { isPlainObject as isPlainObject11 } from "@web-ts-toolkit/utils";
|
|
1381
|
+
function capturePopulateTargetConfiguration(runtime, modelName, source, proposedOptions) {
|
|
1382
|
+
const label = `Populate target "${modelName}" for ${source}`;
|
|
1383
|
+
if (!proposedOptions && !runtime.hasModel(modelName))
|
|
1384
|
+
authorizationError(
|
|
1385
|
+
`${label} must be configured first in this runtime; register its Mongoose model and setModelOptions with an object permissionSchema`
|
|
1386
|
+
);
|
|
1387
|
+
const model = runtime.getModelInstance(modelName);
|
|
1388
|
+
if (!model) authorizationError(`${label} requires an actual registered Mongoose model in this runtime`);
|
|
1389
|
+
const options = proposedOptions ?? runtime.getModelOptions(modelName);
|
|
1390
|
+
const permissionSchema = options.permissionSchema === void 0 ? runtime.getDefaultModelOption("permissionSchema") : options.permissionSchema;
|
|
1391
|
+
if (!isPlainObject11(permissionSchema))
|
|
1392
|
+
authorizationError(
|
|
1393
|
+
`${label} requires an effective object permissionSchema; configure the model or runtime model defaults ({} explicitly closes business fields)`
|
|
1394
|
+
);
|
|
1395
|
+
return { model, options: { ...options, permissionSchema } };
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1379
1398
|
// src/acl/virtual-populate-dependencies.ts
|
|
1380
1399
|
var elementType = (type) => type.$embeddedSchemaType ?? type.embeddedSchemaType ?? type.caster;
|
|
1381
1400
|
var join = (prefix, path) => prefix ? `${prefix}.${path}` : path;
|
|
@@ -1387,7 +1406,7 @@ var fail = (label, message) => {
|
|
|
1387
1406
|
var varyingSchema = (schema) => Object.keys(schema.discriminators ?? {}).length > 0 || schema.discriminatorMapping?.isRoot === false;
|
|
1388
1407
|
var varyingModel = (model) => !!model.baseModelName || Object.keys(model.discriminators ?? {}).length > 0 || varyingSchema(model.schema);
|
|
1389
1408
|
function record(value, label) {
|
|
1390
|
-
if (!
|
|
1409
|
+
if (!isPlainObject12(value)) return fail(label, "entries must be plain { path, select? } objects");
|
|
1391
1410
|
for (const key of Reflect.ownKeys(value)) {
|
|
1392
1411
|
const property = Object.getOwnPropertyDescriptor(value, key);
|
|
1393
1412
|
if (typeof key !== "string" || !property.enumerable || !("value" in property))
|
|
@@ -1476,7 +1495,8 @@ function normalizeSelection(select, catalog, label) {
|
|
|
1476
1495
|
};
|
|
1477
1496
|
}
|
|
1478
1497
|
function captureVirtualPopulateDependencies(runtime, modelName, options, globalOptions = runtime.getGlobalOptions()) {
|
|
1479
|
-
const
|
|
1498
|
+
const requireOperationAccessForPopulateDependencies = globalOptions.requireOperationAccessForPopulateDependencies !== false;
|
|
1499
|
+
const requireOperationAccessForPopulateQueries = globalOptions.requireOperationAccessForPopulateQueries !== false;
|
|
1480
1500
|
const model = runtime.getModelInstance(modelName);
|
|
1481
1501
|
const targets = /* @__PURE__ */ new Map();
|
|
1482
1502
|
const scopes = [];
|
|
@@ -1516,7 +1536,12 @@ function captureVirtualPopulateDependencies(runtime, modelName, options, globalO
|
|
|
1516
1536
|
label,
|
|
1517
1537
|
`target "${ref}" requires a registered same-connection non-discriminator ObjectId model bound to the source ref`
|
|
1518
1538
|
);
|
|
1519
|
-
const
|
|
1539
|
+
const { options: targetOptions } = capturePopulateTargetConfiguration(
|
|
1540
|
+
runtime,
|
|
1541
|
+
ref,
|
|
1542
|
+
`dependsOnPopulate virtual "${label}"`,
|
|
1543
|
+
ref === modelName ? options : void 0
|
|
1544
|
+
);
|
|
1520
1545
|
const defaults = runtime.getDefaultModelOptions();
|
|
1521
1546
|
const readOption = (key) => resolveNestedOption((path2, fallback) => get2(targetOptions, path2, fallback), key, get2(defaults, key));
|
|
1522
1547
|
const documentPermissionField = targetOptions.documentPermissionField ?? defaults.documentPermissionField;
|
|
@@ -1525,7 +1550,9 @@ function captureVirtualPopulateDependencies(runtime, modelName, options, globalO
|
|
|
1525
1550
|
{
|
|
1526
1551
|
catalog,
|
|
1527
1552
|
documentPermissionField,
|
|
1528
|
-
|
|
1553
|
+
requireOperationAccessForPopulateDependencies,
|
|
1554
|
+
requireOperationAccessForPopulateQueries,
|
|
1555
|
+
permissionSchema: targetOptions.permissionSchema,
|
|
1529
1556
|
operationAccess: { read: readOption("operationAccess.read") },
|
|
1530
1557
|
baseFilter: { read: readOption("baseFilter.read") },
|
|
1531
1558
|
overrideFilter: { read: readOption("overrideFilter.read") },
|
|
@@ -1574,13 +1601,13 @@ function captureVirtualPopulateDependencies(runtime, modelName, options, globalO
|
|
|
1574
1601
|
);
|
|
1575
1602
|
continue;
|
|
1576
1603
|
}
|
|
1577
|
-
if (!
|
|
1604
|
+
if (!isPlainObject12(raw)) continue;
|
|
1578
1605
|
const entry = raw;
|
|
1579
1606
|
const label = join(sourcePrefix, name);
|
|
1580
1607
|
captureList(entry.dependsOnPopulate, label);
|
|
1581
1608
|
if (!("get" in entry))
|
|
1582
1609
|
for (const access of accesses) {
|
|
1583
|
-
if (
|
|
1610
|
+
if (isPlainObject12(entry[access]))
|
|
1584
1611
|
captureList(entry[access].dependsOnPopulate, `${label}.${access}`);
|
|
1585
1612
|
}
|
|
1586
1613
|
const byAccess = {};
|
|
@@ -1654,7 +1681,7 @@ var classifyPermissionSchema = (permissionSchema, modelPermissionPrefix) => {
|
|
|
1654
1681
|
const modelPermissionKeys = {};
|
|
1655
1682
|
forEach2(schemaKeys, (schemaKey) => {
|
|
1656
1683
|
const schemaRule = permissionSchema[schemaKey];
|
|
1657
|
-
const ruleEntries =
|
|
1684
|
+
const ruleEntries = isPlainObject13(schemaRule) ? Object.entries(schemaRule) : FIELD_ACCESS_KEYS.map((accessKey) => [accessKey, schemaRule]);
|
|
1658
1685
|
for (let x = 0; x < ruleEntries.length; x++) {
|
|
1659
1686
|
const [accessKey, value] = ruleEntries[x];
|
|
1660
1687
|
if (!isArray4(globalPermissionKeys[accessKey])) {
|
|
@@ -1695,7 +1722,7 @@ var VIRTUAL_UNSUPPORTED_ACCESSES = ["delete", "distinct", "count"];
|
|
|
1695
1722
|
var VIRTUAL_RESERVED_NAMES = /* @__PURE__ */ new Set(["_id", "__v", "id"]);
|
|
1696
1723
|
var VIRTUAL_DANGEROUS_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
1697
1724
|
var VIRTUAL_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_$]*$/;
|
|
1698
|
-
var isVirtualContainerValue2 = (value) =>
|
|
1725
|
+
var isVirtualContainerValue2 = (value) => isPlainObject13(value) && "sub" in value;
|
|
1699
1726
|
var virtualFullPath = (prefix, name) => prefix ? `${prefix}.${name}` : name;
|
|
1700
1727
|
var virtualPathsOverlap = (virtualPath, permissionField) => {
|
|
1701
1728
|
if (!virtualPath || !permissionField) return false;
|
|
@@ -1790,7 +1817,7 @@ var validateVirtualDependsOn = (dependsOn, entryLabel, storedFields, siblingVirt
|
|
|
1790
1817
|
};
|
|
1791
1818
|
var validateVirtualLeafValue = (value, entryLabel, storedFields, siblingVirtualNames, sharedDependsOn) => {
|
|
1792
1819
|
if (isFunction2(value)) return;
|
|
1793
|
-
if (!
|
|
1820
|
+
if (!isPlainObject13(value)) {
|
|
1794
1821
|
throw new Error(`Virtual ${entryLabel}: descriptor must be a getter function or { get, dependsOn }`);
|
|
1795
1822
|
}
|
|
1796
1823
|
const record2 = value;
|
|
@@ -1836,7 +1863,7 @@ var validateVirtualsScope = (scope, documentPermissionField) => {
|
|
|
1836
1863
|
`Virtual ${scopeLabel}${name}: scope-container must only hold "sub" (embedded container "${name}" is not a virtual-leaf collision)`
|
|
1837
1864
|
);
|
|
1838
1865
|
}
|
|
1839
|
-
if (!
|
|
1866
|
+
if (!isPlainObject13(record3.sub)) {
|
|
1840
1867
|
throw new Error(`Virtual ${scopeLabel}${name}: scope-container "sub" must be a plain object`);
|
|
1841
1868
|
}
|
|
1842
1869
|
continue;
|
|
@@ -1847,7 +1874,7 @@ var validateVirtualsScope = (scope, documentPermissionField) => {
|
|
|
1847
1874
|
);
|
|
1848
1875
|
}
|
|
1849
1876
|
if (isFunction2(raw)) continue;
|
|
1850
|
-
if (!
|
|
1877
|
+
if (!isPlainObject13(raw)) {
|
|
1851
1878
|
throw new Error(
|
|
1852
1879
|
`Virtual ${scopeLabel}${name}: malformed descriptor (expected getter, { get, dependsOn }, or per-access record)`
|
|
1853
1880
|
);
|
|
@@ -1901,7 +1928,7 @@ var validateVirtualsScope = (scope, documentPermissionField) => {
|
|
|
1901
1928
|
};
|
|
1902
1929
|
var validateVirtualsTree = (model, virtuals, documentPermissionField, modelName) => {
|
|
1903
1930
|
if (virtuals === void 0 || virtuals === null) return;
|
|
1904
|
-
if (!
|
|
1931
|
+
if (!isPlainObject13(virtuals)) {
|
|
1905
1932
|
throw new Error(`Virtuals for model "${modelName}": virtuals must be a plain object mapping names to descriptors`);
|
|
1906
1933
|
}
|
|
1907
1934
|
const rootSchema = model?.schema ?? null;
|
|
@@ -1953,8 +1980,8 @@ var AccessRuntime = class {
|
|
|
1953
1980
|
{
|
|
1954
1981
|
requestPermissionField: "_permissions",
|
|
1955
1982
|
globalPermissions: () => ({}),
|
|
1956
|
-
|
|
1957
|
-
|
|
1983
|
+
requireOperationAccessForPopulateQueries: true,
|
|
1984
|
+
requireOperationAccessForPopulateDependencies: true,
|
|
1958
1985
|
logger: defaultLogger,
|
|
1959
1986
|
requestComplexity: defaultRequestComplexity
|
|
1960
1987
|
},
|
|
@@ -2128,13 +2155,15 @@ var AccessRuntime = class {
|
|
|
2128
2155
|
/** Shallowly replace supplied global values; nested objects such as requestComplexity are not deep-merged. */
|
|
2129
2156
|
setGlobalOptions(options) {
|
|
2130
2157
|
const next = { ...options };
|
|
2131
|
-
if ("
|
|
2132
|
-
next.
|
|
2158
|
+
if ("requireOperationAccessForPopulateQueries" in next)
|
|
2159
|
+
next.requireOperationAccessForPopulateQueries = next.requireOperationAccessForPopulateQueries !== false;
|
|
2160
|
+
if ("requireOperationAccessForPopulateDependencies" in next)
|
|
2161
|
+
next.requireOperationAccessForPopulateDependencies = next.requireOperationAccessForPopulateDependencies !== false;
|
|
2133
2162
|
this.globalOptions.assign(next);
|
|
2134
2163
|
}
|
|
2135
2164
|
setGlobalOption(key, value) {
|
|
2136
|
-
if (key === "
|
|
2137
|
-
this.globalOptions.set(
|
|
2165
|
+
if (key === "requireOperationAccessForPopulateQueries" || key === "requireOperationAccessForPopulateDependencies") {
|
|
2166
|
+
this.globalOptions.set(key, value !== false);
|
|
2138
2167
|
return;
|
|
2139
2168
|
}
|
|
2140
2169
|
this.globalOptions.set(key, value);
|
|
@@ -2257,10 +2286,10 @@ var AccessRuntime = class {
|
|
|
2257
2286
|
const segments = nestedPath.split(".");
|
|
2258
2287
|
let cursor = cloned;
|
|
2259
2288
|
for (let i = 0; i < segments.length - 1; i++) {
|
|
2260
|
-
if (!
|
|
2289
|
+
if (!isPlainObject13(cursor)) break;
|
|
2261
2290
|
cursor = cursor[segments[i]];
|
|
2262
2291
|
}
|
|
2263
|
-
if (
|
|
2292
|
+
if (isPlainObject13(cursor)) {
|
|
2264
2293
|
delete cursor[segments[segments.length - 1]];
|
|
2265
2294
|
}
|
|
2266
2295
|
proposedVirtuals = cloned;
|
|
@@ -2459,7 +2488,7 @@ var getGlobalOption = (key, defaultValue) => {
|
|
|
2459
2488
|
|
|
2460
2489
|
// src/validation/common.ts
|
|
2461
2490
|
import { z as z2 } from "zod";
|
|
2462
|
-
import { isPlainObject as
|
|
2491
|
+
import { isPlainObject as isPlainObject15 } from "@web-ts-toolkit/utils";
|
|
2463
2492
|
|
|
2464
2493
|
// src/validation/public-admission-schema.ts
|
|
2465
2494
|
var admissions = /* @__PURE__ */ new WeakMap();
|
|
@@ -2481,7 +2510,7 @@ function assertTransformedPublicAdmission(schema, value) {
|
|
|
2481
2510
|
}
|
|
2482
2511
|
|
|
2483
2512
|
// src/correlated-includes.ts
|
|
2484
|
-
import { cloneDeep, isArray as isArray5, isPlainObject as
|
|
2513
|
+
import { cloneDeep, isArray as isArray5, isPlainObject as isPlainObject14 } from "@web-ts-toolkit/utils";
|
|
2485
2514
|
var PARENT_MARKER_KEY = "$parent";
|
|
2486
2515
|
var ESCAPE_WRAPPER_KEY = "$escape";
|
|
2487
2516
|
var SUBQUERY_PAYLOAD_KEYS = /* @__PURE__ */ new Set(["$$sq", "$$date"]);
|
|
@@ -2492,10 +2521,10 @@ var FIELD_SEGMENT_PATTERN = /^[A-Za-z_][A-Za-z0-9_$]*$/;
|
|
|
2492
2521
|
var ARRAY_INDEX_SEGMENT_PATTERN = /^(0|[1-9]\d*)$/;
|
|
2493
2522
|
var ownKeys = (value) => Object.keys(value);
|
|
2494
2523
|
function isParentRefMarker(value) {
|
|
2495
|
-
return
|
|
2524
|
+
return isPlainObject14(value) && ownKeys(value).length === 1 && ownKeys(value)[0] === PARENT_MARKER_KEY;
|
|
2496
2525
|
}
|
|
2497
2526
|
function isEscapedParentRef(value) {
|
|
2498
|
-
return
|
|
2527
|
+
return isPlainObject14(value) && ownKeys(value).length === 1 && ownKeys(value)[0] === ESCAPE_WRAPPER_KEY;
|
|
2499
2528
|
}
|
|
2500
2529
|
function hasMarkerKey(value) {
|
|
2501
2530
|
return ownKeys(value).includes(PARENT_MARKER_KEY) || ownKeys(value).includes(ESCAPE_WRAPPER_KEY);
|
|
@@ -2519,7 +2548,7 @@ function containsParentMarkerShape(value) {
|
|
|
2519
2548
|
seen.add(current);
|
|
2520
2549
|
return current.some(visit);
|
|
2521
2550
|
}
|
|
2522
|
-
if (
|
|
2551
|
+
if (isPlainObject14(current)) {
|
|
2523
2552
|
if (seen.has(current)) return false;
|
|
2524
2553
|
seen.add(current);
|
|
2525
2554
|
if (hasMarkerKey(current)) return true;
|
|
@@ -2549,7 +2578,7 @@ function scanTemplateValueNode(value, path, issues) {
|
|
|
2549
2578
|
}
|
|
2550
2579
|
return;
|
|
2551
2580
|
}
|
|
2552
|
-
if (
|
|
2581
|
+
if (isPlainObject14(value)) {
|
|
2553
2582
|
if (hasMarkerKey(value)) {
|
|
2554
2583
|
issues.push({
|
|
2555
2584
|
message: 'Malformed $parent reference: objects carrying $parent must be exactly { "$parent": "<field>" }',
|
|
@@ -2614,7 +2643,7 @@ function scanTemplateObjectEntries(obj, basePath, issues) {
|
|
|
2614
2643
|
});
|
|
2615
2644
|
return;
|
|
2616
2645
|
}
|
|
2617
|
-
if (
|
|
2646
|
+
if (isPlainObject14(clause)) {
|
|
2618
2647
|
scanTemplateObjectEntries(clause, clausePath, issues);
|
|
2619
2648
|
}
|
|
2620
2649
|
});
|
|
@@ -2625,7 +2654,7 @@ function scanTemplateObjectEntries(obj, basePath, issues) {
|
|
|
2625
2654
|
}
|
|
2626
2655
|
function validateCorrelatedFilterTemplate(filter) {
|
|
2627
2656
|
const issues = [];
|
|
2628
|
-
if (!
|
|
2657
|
+
if (!isPlainObject14(filter)) {
|
|
2629
2658
|
issues.push({ message: "Correlated include filter must be an object", path: [] });
|
|
2630
2659
|
return issues;
|
|
2631
2660
|
}
|
|
@@ -2753,7 +2782,7 @@ var correlatedFilterSchema = z2.record(z2.string(), z2.unknown()).superRefine((f
|
|
|
2753
2782
|
}
|
|
2754
2783
|
});
|
|
2755
2784
|
var correlatedEmptyOptionsSchema = z2.unknown().refine(
|
|
2756
|
-
(value) => value === void 0 ||
|
|
2785
|
+
(value) => value === void 0 || isPlainObject15(value) && Object.keys(value).length === 0,
|
|
2757
2786
|
"Correlated include options must be absent or empty"
|
|
2758
2787
|
).optional();
|
|
2759
2788
|
var correlatedPathSchema = z2.string().min(1).superRefine((path, ctx) => {
|
|
@@ -2790,7 +2819,7 @@ var correlatedListArgsSchema = z2.object({
|
|
|
2790
2819
|
include: z2.lazy(() => correlatedNestedIncludeSchema).optional()
|
|
2791
2820
|
}).strict().superRefine((args, ctx) => checkArgsMarkers(args.select, args.sort, ctx));
|
|
2792
2821
|
var correlatedCountArgsSchema = z2.unknown().refine(
|
|
2793
|
-
(value) => value === void 0 ||
|
|
2822
|
+
(value) => value === void 0 || isPlainObject15(value) && Object.keys(value).length === 0,
|
|
2794
2823
|
"Count includes accept no args"
|
|
2795
2824
|
).optional();
|
|
2796
2825
|
var correlatedReadByIdSchema = z2.object({
|
|
@@ -2843,7 +2872,7 @@ var correlatedNestedIncludeSchema = z2.union([includeItemSchema, z2.array(includ
|
|
|
2843
2872
|
var rejectDuplicateCorrelatedPaths = (items, ctx) => {
|
|
2844
2873
|
const seen = /* @__PURE__ */ new Set();
|
|
2845
2874
|
items.forEach((item, index) => {
|
|
2846
|
-
if (
|
|
2875
|
+
if (isPlainObject15(item) && item.mode === "correlated" && typeof item.path === "string") {
|
|
2847
2876
|
if (seen.has(item.path)) {
|
|
2848
2877
|
ctx.addIssue({
|
|
2849
2878
|
code: z2.ZodIssueCode.custom,
|
package/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mongoose, { Schema } from 'mongoose';
|
|
2
2
|
import { Response, NextFunction, RequestHandler, Router } from 'express';
|
|
3
|
-
import { A as AccessRouterBaseRequest, aq as GuardHook, aT as ModelRequest, dR as AccessRuntime, _ as DataRouterOptions, Y as DataRequest, dS as DataService, aa as ExtendedDataRouterOptions, af as Filter, bo as Projection, cv as Sort, bk as Populate, aU as ModelRouterOptions, dT as Service, dU as PublicService, b3 as ModelVirtualRecordAccess, aZ as ModelVirtualDescriptor, a$ as ModelVirtualGetter, b0 as ModelVirtualLeaf, ac as ExtendedModelRouterOptions, ds as Validation, cf as RootRouterOptions, dV as OpenApiRouterOptions, dW as OpenApiRegistryOptions, dX as OpenApiRouteDescriptor, dY as OpenApiDocumentOptions, dZ as OpenApiParameter, d_ as OpenApiSchema, d$ as OpenApiResponses, ao as GlobalOptions, a2 as DefaultModelRouterOptions, ab as ExtendedDefaultModelRouterOptions } from './parsers-
|
|
4
|
-
export { e0 as AccessRouterPermissionMap, e1 as AccessRouterPermissions, c as AccessRouterRequest, d as AccessRouterRequestExtensions, l as AjvErrorObjectLike, n as AjvValidatorLike, o as AllowedOutputFieldOptions, p as ArkTypeErrorsLike, q as ArkTypeLike, s as AuthorizedListResult, t as AuthorizedSingleResult, H as CreateAuthorization, N as DataFieldOptions, a7 as DocumentAuthorization, ad as FieldAuthorization, ae as FieldOperationAccess, ap as GlobalPermissionValue, ar as HydrationMode, au as InputFieldAuthorization, av as InputFieldPath, aw as IoTsContextEntryLike, ax as IoTsDecodeErrorLike, ay as IoTsDecoderLike, az as JoiSchemaLike, aA as JoiValidationErrorDetailLike, aG as MaybePromise, aH as ModelBaseFilterHook, aJ as ModelDeleteHook, aK as ModelDocPermissionsHook, aM as ModelDocumentHook, aN as ModelHook, aP as ModelHydrationOptions, aQ as ModelIdentifierHook, aR as ModelListHook, aS as ModelOverrideFilterHook, aV as ModelValidateHook, aW as ModelVirtualAccess, aX as ModelVirtualAccessRecord, aY as ModelVirtualContext, a_ as ModelVirtualDoc, b1 as ModelVirtualPopulateDependency, b2 as ModelVirtualPopulateInputs, b4 as ModelVirtuals, b5 as MutationAuthorization, b6 as NewArgs, b7 as NewOptions, e2 as OpenApiMethod, b8 as OperationAccess, b9 as OperationAuthorization, ba as OutputAuthorization, bb as OutputFieldOptions, bc as OutputFieldPath, bd as OutputPlanningOptions, bg as PairedRouteAccess, bj as PermissionSchema, e3 as Permissions, bm as PopulatePlanningOptions, bA as PublicSubdocumentCreateOptions, bB as PublicSubdocumentListOptions, bC as PublicSubdocumentMutationOptions, bD as PublicSubdocumentReadOptions, bJ as RelatedAuthorization, bL as RequestSchemaAdapter, bM as RequestSchemaFailure, bN as RequestSchemaIssue, bO as RequestSchemaLike, bP as RequestSchemaOptions, bQ as RequestSchemaResult, bR as RequestSchemaSuccess, bS as RequestSchemaValidator, ci as RouteBaseAccess, cj as RouteGuardAccess, ck as RouteVariant, cl as RouteVariantAccess, cm as RowAuthorization, cq as ServiceAuthorization, cr as ServiceOutputContext, cs as ServiceOutputDecorator, cx as StandardSchemaFailure, cy as StandardSchemaInferOutput, cz as StandardSchemaIssue, cA as StandardSchemaPathSegment, cB as StandardSchemaResult, cC as StandardSchemaSuccess, cD as StandardSchemaV1, cG as SubOperationAccess, cK as SubRouteGuardOptions, cN as SubdocumentCreateAuthorization, cP as SubdocumentCreateOptions, cQ as SubdocumentCreateVisibilityAuthorization, cR as SubdocumentDeleteAuthorization, cS as SubdocumentDeleteOptions, cT as SubdocumentGateAuthorization, cV as SubdocumentInputAuthorization, cW as SubdocumentListOptions, cX as SubdocumentModel, cY as SubdocumentMutationAuthorization, cZ as SubdocumentName, c_ as SubdocumentOutputAuthorization, d1 as SubdocumentReadAuthorization, d2 as SubdocumentReadOptions, d4 as SubdocumentUpdateOptions, d5 as SubdocumentVirtuals, d6 as SubdocumentVisibilityAuthorization, d7 as SuperstructFailureLike, d8 as SuperstructValidateLike, dl as ValibotIssueLike, dm as ValibotPathItemLike, dn as ValibotSafeParseLike, dp as ValibotSafeParseResult, du as VineValidationErrorLike, dv as VineValidationMessageLike, dw as VineValidatorLike, dx as VirtualSubModel, dy as WithVirtuals, dz as YupSchemaLike, dA as YupValidationErrorLike, e4 as defaultRuntime, 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 } from './parsers-
|
|
3
|
+
import { A as AccessRouterBaseRequest, aq as GuardHook, aT as ModelRequest, dR as AccessRuntime, _ as DataRouterOptions, Y as DataRequest, dS as DataService, aa as ExtendedDataRouterOptions, af as Filter, bo as Projection, cv as Sort, bk as Populate, aU as ModelRouterOptions, dT as Service, dU as PublicService, b3 as ModelVirtualRecordAccess, aZ as ModelVirtualDescriptor, a$ as ModelVirtualGetter, b0 as ModelVirtualLeaf, ac as ExtendedModelRouterOptions, ds as Validation, cf as RootRouterOptions, dV as OpenApiRouterOptions, dW as OpenApiRegistryOptions, dX as OpenApiRouteDescriptor, dY as OpenApiDocumentOptions, dZ as OpenApiParameter, d_ as OpenApiSchema, d$ as OpenApiResponses, ao as GlobalOptions, a2 as DefaultModelRouterOptions, ab as ExtendedDefaultModelRouterOptions } from './parsers-CngKnVjW.mjs';
|
|
4
|
+
export { e0 as AccessRouterPermissionMap, e1 as AccessRouterPermissions, c as AccessRouterRequest, d as AccessRouterRequestExtensions, l as AjvErrorObjectLike, n as AjvValidatorLike, o as AllowedOutputFieldOptions, p as ArkTypeErrorsLike, q as ArkTypeLike, s as AuthorizedListResult, t as AuthorizedSingleResult, H as CreateAuthorization, N as DataFieldOptions, a7 as DocumentAuthorization, ad as FieldAuthorization, ae as FieldOperationAccess, ap as GlobalPermissionValue, ar as HydrationMode, au as InputFieldAuthorization, av as InputFieldPath, aw as IoTsContextEntryLike, ax as IoTsDecodeErrorLike, ay as IoTsDecoderLike, az as JoiSchemaLike, aA as JoiValidationErrorDetailLike, aG as MaybePromise, aH as ModelBaseFilterHook, aJ as ModelDeleteHook, aK as ModelDocPermissionsHook, aM as ModelDocumentHook, aN as ModelHook, aP as ModelHydrationOptions, aQ as ModelIdentifierHook, aR as ModelListHook, aS as ModelOverrideFilterHook, aV as ModelValidateHook, aW as ModelVirtualAccess, aX as ModelVirtualAccessRecord, aY as ModelVirtualContext, a_ as ModelVirtualDoc, b1 as ModelVirtualPopulateDependency, b2 as ModelVirtualPopulateInputs, b4 as ModelVirtuals, b5 as MutationAuthorization, b6 as NewArgs, b7 as NewOptions, e2 as OpenApiMethod, b8 as OperationAccess, b9 as OperationAuthorization, ba as OutputAuthorization, bb as OutputFieldOptions, bc as OutputFieldPath, bd as OutputPlanningOptions, bg as PairedRouteAccess, bj as PermissionSchema, e3 as Permissions, bm as PopulatePlanningOptions, bA as PublicSubdocumentCreateOptions, bB as PublicSubdocumentListOptions, bC as PublicSubdocumentMutationOptions, bD as PublicSubdocumentReadOptions, bJ as RelatedAuthorization, bL as RequestSchemaAdapter, bM as RequestSchemaFailure, bN as RequestSchemaIssue, bO as RequestSchemaLike, bP as RequestSchemaOptions, bQ as RequestSchemaResult, bR as RequestSchemaSuccess, bS as RequestSchemaValidator, ci as RouteBaseAccess, cj as RouteGuardAccess, ck as RouteVariant, cl as RouteVariantAccess, cm as RowAuthorization, cq as ServiceAuthorization, cr as ServiceOutputContext, cs as ServiceOutputDecorator, cx as StandardSchemaFailure, cy as StandardSchemaInferOutput, cz as StandardSchemaIssue, cA as StandardSchemaPathSegment, cB as StandardSchemaResult, cC as StandardSchemaSuccess, cD as StandardSchemaV1, cG as SubOperationAccess, cK as SubRouteGuardOptions, cN as SubdocumentCreateAuthorization, cP as SubdocumentCreateOptions, cQ as SubdocumentCreateVisibilityAuthorization, cR as SubdocumentDeleteAuthorization, cS as SubdocumentDeleteOptions, cT as SubdocumentGateAuthorization, cV as SubdocumentInputAuthorization, cW as SubdocumentListOptions, cX as SubdocumentModel, cY as SubdocumentMutationAuthorization, cZ as SubdocumentName, c_ as SubdocumentOutputAuthorization, d1 as SubdocumentReadAuthorization, d2 as SubdocumentReadOptions, d4 as SubdocumentUpdateOptions, d5 as SubdocumentVirtuals, d6 as SubdocumentVisibilityAuthorization, d7 as SuperstructFailureLike, d8 as SuperstructValidateLike, dl as ValibotIssueLike, dm as ValibotPathItemLike, dn as ValibotSafeParseLike, dp as ValibotSafeParseResult, du as VineValidationErrorLike, dv as VineValidationMessageLike, dw as VineValidatorLike, dx as VirtualSubModel, dy as WithVirtuals, dz as YupSchemaLike, dA as YupValidationErrorLike, e4 as defaultRuntime, 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 } from './parsers-CngKnVjW.mjs';
|
|
5
5
|
import JsonRouter from '@web-ts-toolkit/express-json-router';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mongoose, { Schema } from 'mongoose';
|
|
2
2
|
import { Response, NextFunction, RequestHandler, Router } from 'express';
|
|
3
|
-
import { A as AccessRouterBaseRequest, aq as GuardHook, aT as ModelRequest, dR as AccessRuntime, _ as DataRouterOptions, Y as DataRequest, dS as DataService, aa as ExtendedDataRouterOptions, af as Filter, bo as Projection, cv as Sort, bk as Populate, aU as ModelRouterOptions, dT as Service, dU as PublicService, b3 as ModelVirtualRecordAccess, aZ as ModelVirtualDescriptor, a$ as ModelVirtualGetter, b0 as ModelVirtualLeaf, ac as ExtendedModelRouterOptions, ds as Validation, cf as RootRouterOptions, dV as OpenApiRouterOptions, dW as OpenApiRegistryOptions, dX as OpenApiRouteDescriptor, dY as OpenApiDocumentOptions, dZ as OpenApiParameter, d_ as OpenApiSchema, d$ as OpenApiResponses, ao as GlobalOptions, a2 as DefaultModelRouterOptions, ab as ExtendedDefaultModelRouterOptions } from './parsers-
|
|
4
|
-
export { e0 as AccessRouterPermissionMap, e1 as AccessRouterPermissions, c as AccessRouterRequest, d as AccessRouterRequestExtensions, l as AjvErrorObjectLike, n as AjvValidatorLike, o as AllowedOutputFieldOptions, p as ArkTypeErrorsLike, q as ArkTypeLike, s as AuthorizedListResult, t as AuthorizedSingleResult, H as CreateAuthorization, N as DataFieldOptions, a7 as DocumentAuthorization, ad as FieldAuthorization, ae as FieldOperationAccess, ap as GlobalPermissionValue, ar as HydrationMode, au as InputFieldAuthorization, av as InputFieldPath, aw as IoTsContextEntryLike, ax as IoTsDecodeErrorLike, ay as IoTsDecoderLike, az as JoiSchemaLike, aA as JoiValidationErrorDetailLike, aG as MaybePromise, aH as ModelBaseFilterHook, aJ as ModelDeleteHook, aK as ModelDocPermissionsHook, aM as ModelDocumentHook, aN as ModelHook, aP as ModelHydrationOptions, aQ as ModelIdentifierHook, aR as ModelListHook, aS as ModelOverrideFilterHook, aV as ModelValidateHook, aW as ModelVirtualAccess, aX as ModelVirtualAccessRecord, aY as ModelVirtualContext, a_ as ModelVirtualDoc, b1 as ModelVirtualPopulateDependency, b2 as ModelVirtualPopulateInputs, b4 as ModelVirtuals, b5 as MutationAuthorization, b6 as NewArgs, b7 as NewOptions, e2 as OpenApiMethod, b8 as OperationAccess, b9 as OperationAuthorization, ba as OutputAuthorization, bb as OutputFieldOptions, bc as OutputFieldPath, bd as OutputPlanningOptions, bg as PairedRouteAccess, bj as PermissionSchema, e3 as Permissions, bm as PopulatePlanningOptions, bA as PublicSubdocumentCreateOptions, bB as PublicSubdocumentListOptions, bC as PublicSubdocumentMutationOptions, bD as PublicSubdocumentReadOptions, bJ as RelatedAuthorization, bL as RequestSchemaAdapter, bM as RequestSchemaFailure, bN as RequestSchemaIssue, bO as RequestSchemaLike, bP as RequestSchemaOptions, bQ as RequestSchemaResult, bR as RequestSchemaSuccess, bS as RequestSchemaValidator, ci as RouteBaseAccess, cj as RouteGuardAccess, ck as RouteVariant, cl as RouteVariantAccess, cm as RowAuthorization, cq as ServiceAuthorization, cr as ServiceOutputContext, cs as ServiceOutputDecorator, cx as StandardSchemaFailure, cy as StandardSchemaInferOutput, cz as StandardSchemaIssue, cA as StandardSchemaPathSegment, cB as StandardSchemaResult, cC as StandardSchemaSuccess, cD as StandardSchemaV1, cG as SubOperationAccess, cK as SubRouteGuardOptions, cN as SubdocumentCreateAuthorization, cP as SubdocumentCreateOptions, cQ as SubdocumentCreateVisibilityAuthorization, cR as SubdocumentDeleteAuthorization, cS as SubdocumentDeleteOptions, cT as SubdocumentGateAuthorization, cV as SubdocumentInputAuthorization, cW as SubdocumentListOptions, cX as SubdocumentModel, cY as SubdocumentMutationAuthorization, cZ as SubdocumentName, c_ as SubdocumentOutputAuthorization, d1 as SubdocumentReadAuthorization, d2 as SubdocumentReadOptions, d4 as SubdocumentUpdateOptions, d5 as SubdocumentVirtuals, d6 as SubdocumentVisibilityAuthorization, d7 as SuperstructFailureLike, d8 as SuperstructValidateLike, dl as ValibotIssueLike, dm as ValibotPathItemLike, dn as ValibotSafeParseLike, dp as ValibotSafeParseResult, du as VineValidationErrorLike, dv as VineValidationMessageLike, dw as VineValidatorLike, dx as VirtualSubModel, dy as WithVirtuals, dz as YupSchemaLike, dA as YupValidationErrorLike, e4 as defaultRuntime, 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 } from './parsers-
|
|
3
|
+
import { A as AccessRouterBaseRequest, aq as GuardHook, aT as ModelRequest, dR as AccessRuntime, _ as DataRouterOptions, Y as DataRequest, dS as DataService, aa as ExtendedDataRouterOptions, af as Filter, bo as Projection, cv as Sort, bk as Populate, aU as ModelRouterOptions, dT as Service, dU as PublicService, b3 as ModelVirtualRecordAccess, aZ as ModelVirtualDescriptor, a$ as ModelVirtualGetter, b0 as ModelVirtualLeaf, ac as ExtendedModelRouterOptions, ds as Validation, cf as RootRouterOptions, dV as OpenApiRouterOptions, dW as OpenApiRegistryOptions, dX as OpenApiRouteDescriptor, dY as OpenApiDocumentOptions, dZ as OpenApiParameter, d_ as OpenApiSchema, d$ as OpenApiResponses, ao as GlobalOptions, a2 as DefaultModelRouterOptions, ab as ExtendedDefaultModelRouterOptions } from './parsers-CngKnVjW.js';
|
|
4
|
+
export { e0 as AccessRouterPermissionMap, e1 as AccessRouterPermissions, c as AccessRouterRequest, d as AccessRouterRequestExtensions, l as AjvErrorObjectLike, n as AjvValidatorLike, o as AllowedOutputFieldOptions, p as ArkTypeErrorsLike, q as ArkTypeLike, s as AuthorizedListResult, t as AuthorizedSingleResult, H as CreateAuthorization, N as DataFieldOptions, a7 as DocumentAuthorization, ad as FieldAuthorization, ae as FieldOperationAccess, ap as GlobalPermissionValue, ar as HydrationMode, au as InputFieldAuthorization, av as InputFieldPath, aw as IoTsContextEntryLike, ax as IoTsDecodeErrorLike, ay as IoTsDecoderLike, az as JoiSchemaLike, aA as JoiValidationErrorDetailLike, aG as MaybePromise, aH as ModelBaseFilterHook, aJ as ModelDeleteHook, aK as ModelDocPermissionsHook, aM as ModelDocumentHook, aN as ModelHook, aP as ModelHydrationOptions, aQ as ModelIdentifierHook, aR as ModelListHook, aS as ModelOverrideFilterHook, aV as ModelValidateHook, aW as ModelVirtualAccess, aX as ModelVirtualAccessRecord, aY as ModelVirtualContext, a_ as ModelVirtualDoc, b1 as ModelVirtualPopulateDependency, b2 as ModelVirtualPopulateInputs, b4 as ModelVirtuals, b5 as MutationAuthorization, b6 as NewArgs, b7 as NewOptions, e2 as OpenApiMethod, b8 as OperationAccess, b9 as OperationAuthorization, ba as OutputAuthorization, bb as OutputFieldOptions, bc as OutputFieldPath, bd as OutputPlanningOptions, bg as PairedRouteAccess, bj as PermissionSchema, e3 as Permissions, bm as PopulatePlanningOptions, bA as PublicSubdocumentCreateOptions, bB as PublicSubdocumentListOptions, bC as PublicSubdocumentMutationOptions, bD as PublicSubdocumentReadOptions, bJ as RelatedAuthorization, bL as RequestSchemaAdapter, bM as RequestSchemaFailure, bN as RequestSchemaIssue, bO as RequestSchemaLike, bP as RequestSchemaOptions, bQ as RequestSchemaResult, bR as RequestSchemaSuccess, bS as RequestSchemaValidator, ci as RouteBaseAccess, cj as RouteGuardAccess, ck as RouteVariant, cl as RouteVariantAccess, cm as RowAuthorization, cq as ServiceAuthorization, cr as ServiceOutputContext, cs as ServiceOutputDecorator, cx as StandardSchemaFailure, cy as StandardSchemaInferOutput, cz as StandardSchemaIssue, cA as StandardSchemaPathSegment, cB as StandardSchemaResult, cC as StandardSchemaSuccess, cD as StandardSchemaV1, cG as SubOperationAccess, cK as SubRouteGuardOptions, cN as SubdocumentCreateAuthorization, cP as SubdocumentCreateOptions, cQ as SubdocumentCreateVisibilityAuthorization, cR as SubdocumentDeleteAuthorization, cS as SubdocumentDeleteOptions, cT as SubdocumentGateAuthorization, cV as SubdocumentInputAuthorization, cW as SubdocumentListOptions, cX as SubdocumentModel, cY as SubdocumentMutationAuthorization, cZ as SubdocumentName, c_ as SubdocumentOutputAuthorization, d1 as SubdocumentReadAuthorization, d2 as SubdocumentReadOptions, d4 as SubdocumentUpdateOptions, d5 as SubdocumentVirtuals, d6 as SubdocumentVisibilityAuthorization, d7 as SuperstructFailureLike, d8 as SuperstructValidateLike, dl as ValibotIssueLike, dm as ValibotPathItemLike, dn as ValibotSafeParseLike, dp as ValibotSafeParseResult, du as VineValidationErrorLike, dv as VineValidationMessageLike, dw as VineValidatorLike, dx as VirtualSubModel, dy as WithVirtuals, dz as YupSchemaLike, dA as YupValidationErrorLike, e4 as defaultRuntime, 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 } from './parsers-CngKnVjW.js';
|
|
5
5
|
import JsonRouter from '@web-ts-toolkit/express-json-router';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|