@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/advanced.mjs CHANGED
@@ -186,7 +186,7 @@ import {
186
186
  isBoolean,
187
187
  isFunction as isFunction2,
188
188
  isNil as isNil2,
189
- isPlainObject as isPlainObject12,
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 isPlainObject11 } from "@web-ts-toolkit/utils";
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 (!isPlainObject11(value)) return fail(label, "entries must be plain { path, select? } objects");
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))
@@ -1475,7 +1494,9 @@ function normalizeSelection(select, catalog, label) {
1475
1494
  includeId: selection.includes("_id")
1476
1495
  };
1477
1496
  }
1478
- function captureVirtualPopulateDependencies(runtime, modelName, options) {
1497
+ function captureVirtualPopulateDependencies(runtime, modelName, options, globalOptions = runtime.getGlobalOptions()) {
1498
+ const requireOperationAccessForPopulateDependencies = globalOptions.requireOperationAccessForPopulateDependencies !== false;
1499
+ const requireOperationAccessForPopulateQueries = globalOptions.requireOperationAccessForPopulateQueries !== false;
1479
1500
  const model = runtime.getModelInstance(modelName);
1480
1501
  const targets = /* @__PURE__ */ new Map();
1481
1502
  const scopes = [];
@@ -1515,7 +1536,12 @@ function captureVirtualPopulateDependencies(runtime, modelName, options) {
1515
1536
  label,
1516
1537
  `target "${ref}" requires a registered same-connection non-discriminator ObjectId model bound to the source ref`
1517
1538
  );
1518
- const targetOptions = ref === modelName ? options : runtime.getModelOptions(ref);
1539
+ const { options: targetOptions } = capturePopulateTargetConfiguration(
1540
+ runtime,
1541
+ ref,
1542
+ `dependsOnPopulate virtual "${label}"`,
1543
+ ref === modelName ? options : void 0
1544
+ );
1519
1545
  const defaults = runtime.getDefaultModelOptions();
1520
1546
  const readOption = (key) => resolveNestedOption((path2, fallback) => get2(targetOptions, path2, fallback), key, get2(defaults, key));
1521
1547
  const documentPermissionField = targetOptions.documentPermissionField ?? defaults.documentPermissionField;
@@ -1524,6 +1550,9 @@ function captureVirtualPopulateDependencies(runtime, modelName, options) {
1524
1550
  {
1525
1551
  catalog,
1526
1552
  documentPermissionField,
1553
+ requireOperationAccessForPopulateDependencies,
1554
+ requireOperationAccessForPopulateQueries,
1555
+ permissionSchema: targetOptions.permissionSchema,
1527
1556
  operationAccess: { read: readOption("operationAccess.read") },
1528
1557
  baseFilter: { read: readOption("baseFilter.read") },
1529
1558
  overrideFilter: { read: readOption("overrideFilter.read") },
@@ -1572,13 +1601,13 @@ function captureVirtualPopulateDependencies(runtime, modelName, options) {
1572
1601
  );
1573
1602
  continue;
1574
1603
  }
1575
- if (!isPlainObject11(raw)) continue;
1604
+ if (!isPlainObject12(raw)) continue;
1576
1605
  const entry = raw;
1577
1606
  const label = join(sourcePrefix, name);
1578
1607
  captureList(entry.dependsOnPopulate, label);
1579
1608
  if (!("get" in entry))
1580
1609
  for (const access of accesses) {
1581
- if (isPlainObject11(entry[access]))
1610
+ if (isPlainObject12(entry[access]))
1582
1611
  captureList(entry[access].dependsOnPopulate, `${label}.${access}`);
1583
1612
  }
1584
1613
  const byAccess = {};
@@ -1652,7 +1681,7 @@ var classifyPermissionSchema = (permissionSchema, modelPermissionPrefix) => {
1652
1681
  const modelPermissionKeys = {};
1653
1682
  forEach2(schemaKeys, (schemaKey) => {
1654
1683
  const schemaRule = permissionSchema[schemaKey];
1655
- const ruleEntries = isPlainObject12(schemaRule) ? Object.entries(schemaRule) : FIELD_ACCESS_KEYS.map((accessKey) => [accessKey, schemaRule]);
1684
+ const ruleEntries = isPlainObject13(schemaRule) ? Object.entries(schemaRule) : FIELD_ACCESS_KEYS.map((accessKey) => [accessKey, schemaRule]);
1656
1685
  for (let x = 0; x < ruleEntries.length; x++) {
1657
1686
  const [accessKey, value] = ruleEntries[x];
1658
1687
  if (!isArray4(globalPermissionKeys[accessKey])) {
@@ -1693,7 +1722,7 @@ var VIRTUAL_UNSUPPORTED_ACCESSES = ["delete", "distinct", "count"];
1693
1722
  var VIRTUAL_RESERVED_NAMES = /* @__PURE__ */ new Set(["_id", "__v", "id"]);
1694
1723
  var VIRTUAL_DANGEROUS_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
1695
1724
  var VIRTUAL_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_$]*$/;
1696
- var isVirtualContainerValue2 = (value) => isPlainObject12(value) && "sub" in value;
1725
+ var isVirtualContainerValue2 = (value) => isPlainObject13(value) && "sub" in value;
1697
1726
  var virtualFullPath = (prefix, name) => prefix ? `${prefix}.${name}` : name;
1698
1727
  var virtualPathsOverlap = (virtualPath, permissionField) => {
1699
1728
  if (!virtualPath || !permissionField) return false;
@@ -1788,7 +1817,7 @@ var validateVirtualDependsOn = (dependsOn, entryLabel, storedFields, siblingVirt
1788
1817
  };
1789
1818
  var validateVirtualLeafValue = (value, entryLabel, storedFields, siblingVirtualNames, sharedDependsOn) => {
1790
1819
  if (isFunction2(value)) return;
1791
- if (!isPlainObject12(value)) {
1820
+ if (!isPlainObject13(value)) {
1792
1821
  throw new Error(`Virtual ${entryLabel}: descriptor must be a getter function or { get, dependsOn }`);
1793
1822
  }
1794
1823
  const record2 = value;
@@ -1834,7 +1863,7 @@ var validateVirtualsScope = (scope, documentPermissionField) => {
1834
1863
  `Virtual ${scopeLabel}${name}: scope-container must only hold "sub" (embedded container "${name}" is not a virtual-leaf collision)`
1835
1864
  );
1836
1865
  }
1837
- if (!isPlainObject12(record3.sub)) {
1866
+ if (!isPlainObject13(record3.sub)) {
1838
1867
  throw new Error(`Virtual ${scopeLabel}${name}: scope-container "sub" must be a plain object`);
1839
1868
  }
1840
1869
  continue;
@@ -1845,7 +1874,7 @@ var validateVirtualsScope = (scope, documentPermissionField) => {
1845
1874
  );
1846
1875
  }
1847
1876
  if (isFunction2(raw)) continue;
1848
- if (!isPlainObject12(raw)) {
1877
+ if (!isPlainObject13(raw)) {
1849
1878
  throw new Error(
1850
1879
  `Virtual ${scopeLabel}${name}: malformed descriptor (expected getter, { get, dependsOn }, or per-access record)`
1851
1880
  );
@@ -1899,7 +1928,7 @@ var validateVirtualsScope = (scope, documentPermissionField) => {
1899
1928
  };
1900
1929
  var validateVirtualsTree = (model, virtuals, documentPermissionField, modelName) => {
1901
1930
  if (virtuals === void 0 || virtuals === null) return;
1902
- if (!isPlainObject12(virtuals)) {
1931
+ if (!isPlainObject13(virtuals)) {
1903
1932
  throw new Error(`Virtuals for model "${modelName}": virtuals must be a plain object mapping names to descriptors`);
1904
1933
  }
1905
1934
  const rootSchema = model?.schema ?? null;
@@ -1951,7 +1980,8 @@ var AccessRuntime = class {
1951
1980
  {
1952
1981
  requestPermissionField: "_permissions",
1953
1982
  globalPermissions: () => ({}),
1954
- requireRegisteredPopulateModels: true,
1983
+ requireOperationAccessForPopulateQueries: true,
1984
+ requireOperationAccessForPopulateDependencies: true,
1955
1985
  logger: defaultLogger,
1956
1986
  requestComplexity: defaultRequestComplexity
1957
1987
  },
@@ -2124,9 +2154,18 @@ var AccessRuntime = class {
2124
2154
  }
2125
2155
  /** Shallowly replace supplied global values; nested objects such as requestComplexity are not deep-merged. */
2126
2156
  setGlobalOptions(options) {
2127
- this.globalOptions.assign(options);
2157
+ const next = { ...options };
2158
+ if ("requireOperationAccessForPopulateQueries" in next)
2159
+ next.requireOperationAccessForPopulateQueries = next.requireOperationAccessForPopulateQueries !== false;
2160
+ if ("requireOperationAccessForPopulateDependencies" in next)
2161
+ next.requireOperationAccessForPopulateDependencies = next.requireOperationAccessForPopulateDependencies !== false;
2162
+ this.globalOptions.assign(next);
2128
2163
  }
2129
2164
  setGlobalOption(key, value) {
2165
+ if (key === "requireOperationAccessForPopulateQueries" || key === "requireOperationAccessForPopulateDependencies") {
2166
+ this.globalOptions.set(key, value !== false);
2167
+ return;
2168
+ }
2130
2169
  this.globalOptions.set(key, value);
2131
2170
  }
2132
2171
  getGlobalOptions() {
@@ -2247,10 +2286,10 @@ var AccessRuntime = class {
2247
2286
  const segments = nestedPath.split(".");
2248
2287
  let cursor = cloned;
2249
2288
  for (let i = 0; i < segments.length - 1; i++) {
2250
- if (!isPlainObject12(cursor)) break;
2289
+ if (!isPlainObject13(cursor)) break;
2251
2290
  cursor = cursor[segments[i]];
2252
2291
  }
2253
- if (isPlainObject12(cursor)) {
2292
+ if (isPlainObject13(cursor)) {
2254
2293
  delete cursor[segments[segments.length - 1]];
2255
2294
  }
2256
2295
  proposedVirtuals = cloned;
@@ -2449,7 +2488,7 @@ var getGlobalOption = (key, defaultValue) => {
2449
2488
 
2450
2489
  // src/validation/common.ts
2451
2490
  import { z as z2 } from "zod";
2452
- import { isPlainObject as isPlainObject14 } from "@web-ts-toolkit/utils";
2491
+ import { isPlainObject as isPlainObject15 } from "@web-ts-toolkit/utils";
2453
2492
 
2454
2493
  // src/validation/public-admission-schema.ts
2455
2494
  var admissions = /* @__PURE__ */ new WeakMap();
@@ -2471,7 +2510,7 @@ function assertTransformedPublicAdmission(schema, value) {
2471
2510
  }
2472
2511
 
2473
2512
  // src/correlated-includes.ts
2474
- import { cloneDeep, isArray as isArray5, isPlainObject as isPlainObject13 } from "@web-ts-toolkit/utils";
2513
+ import { cloneDeep, isArray as isArray5, isPlainObject as isPlainObject14 } from "@web-ts-toolkit/utils";
2475
2514
  var PARENT_MARKER_KEY = "$parent";
2476
2515
  var ESCAPE_WRAPPER_KEY = "$escape";
2477
2516
  var SUBQUERY_PAYLOAD_KEYS = /* @__PURE__ */ new Set(["$$sq", "$$date"]);
@@ -2482,10 +2521,10 @@ var FIELD_SEGMENT_PATTERN = /^[A-Za-z_][A-Za-z0-9_$]*$/;
2482
2521
  var ARRAY_INDEX_SEGMENT_PATTERN = /^(0|[1-9]\d*)$/;
2483
2522
  var ownKeys = (value) => Object.keys(value);
2484
2523
  function isParentRefMarker(value) {
2485
- return isPlainObject13(value) && ownKeys(value).length === 1 && ownKeys(value)[0] === PARENT_MARKER_KEY;
2524
+ return isPlainObject14(value) && ownKeys(value).length === 1 && ownKeys(value)[0] === PARENT_MARKER_KEY;
2486
2525
  }
2487
2526
  function isEscapedParentRef(value) {
2488
- return isPlainObject13(value) && ownKeys(value).length === 1 && ownKeys(value)[0] === ESCAPE_WRAPPER_KEY;
2527
+ return isPlainObject14(value) && ownKeys(value).length === 1 && ownKeys(value)[0] === ESCAPE_WRAPPER_KEY;
2489
2528
  }
2490
2529
  function hasMarkerKey(value) {
2491
2530
  return ownKeys(value).includes(PARENT_MARKER_KEY) || ownKeys(value).includes(ESCAPE_WRAPPER_KEY);
@@ -2509,7 +2548,7 @@ function containsParentMarkerShape(value) {
2509
2548
  seen.add(current);
2510
2549
  return current.some(visit);
2511
2550
  }
2512
- if (isPlainObject13(current)) {
2551
+ if (isPlainObject14(current)) {
2513
2552
  if (seen.has(current)) return false;
2514
2553
  seen.add(current);
2515
2554
  if (hasMarkerKey(current)) return true;
@@ -2539,7 +2578,7 @@ function scanTemplateValueNode(value, path, issues) {
2539
2578
  }
2540
2579
  return;
2541
2580
  }
2542
- if (isPlainObject13(value)) {
2581
+ if (isPlainObject14(value)) {
2543
2582
  if (hasMarkerKey(value)) {
2544
2583
  issues.push({
2545
2584
  message: 'Malformed $parent reference: objects carrying $parent must be exactly { "$parent": "<field>" }',
@@ -2604,7 +2643,7 @@ function scanTemplateObjectEntries(obj, basePath, issues) {
2604
2643
  });
2605
2644
  return;
2606
2645
  }
2607
- if (isPlainObject13(clause)) {
2646
+ if (isPlainObject14(clause)) {
2608
2647
  scanTemplateObjectEntries(clause, clausePath, issues);
2609
2648
  }
2610
2649
  });
@@ -2615,7 +2654,7 @@ function scanTemplateObjectEntries(obj, basePath, issues) {
2615
2654
  }
2616
2655
  function validateCorrelatedFilterTemplate(filter) {
2617
2656
  const issues = [];
2618
- if (!isPlainObject13(filter)) {
2657
+ if (!isPlainObject14(filter)) {
2619
2658
  issues.push({ message: "Correlated include filter must be an object", path: [] });
2620
2659
  return issues;
2621
2660
  }
@@ -2743,7 +2782,7 @@ var correlatedFilterSchema = z2.record(z2.string(), z2.unknown()).superRefine((f
2743
2782
  }
2744
2783
  });
2745
2784
  var correlatedEmptyOptionsSchema = z2.unknown().refine(
2746
- (value) => value === void 0 || isPlainObject14(value) && Object.keys(value).length === 0,
2785
+ (value) => value === void 0 || isPlainObject15(value) && Object.keys(value).length === 0,
2747
2786
  "Correlated include options must be absent or empty"
2748
2787
  ).optional();
2749
2788
  var correlatedPathSchema = z2.string().min(1).superRefine((path, ctx) => {
@@ -2780,7 +2819,7 @@ var correlatedListArgsSchema = z2.object({
2780
2819
  include: z2.lazy(() => correlatedNestedIncludeSchema).optional()
2781
2820
  }).strict().superRefine((args, ctx) => checkArgsMarkers(args.select, args.sort, ctx));
2782
2821
  var correlatedCountArgsSchema = z2.unknown().refine(
2783
- (value) => value === void 0 || isPlainObject14(value) && Object.keys(value).length === 0,
2822
+ (value) => value === void 0 || isPlainObject15(value) && Object.keys(value).length === 0,
2784
2823
  "Count includes accept no args"
2785
2824
  ).optional();
2786
2825
  var correlatedReadByIdSchema = z2.object({
@@ -2833,7 +2872,7 @@ var correlatedNestedIncludeSchema = z2.union([includeItemSchema, z2.array(includ
2833
2872
  var rejectDuplicateCorrelatedPaths = (items, ctx) => {
2834
2873
  const seen = /* @__PURE__ */ new Set();
2835
2874
  items.forEach((item, index) => {
2836
- if (isPlainObject14(item) && item.mode === "correlated" && typeof item.path === "string") {
2875
+ if (isPlainObject15(item) && item.mode === "correlated" && typeof item.path === "string") {
2837
2876
  if (seen.has(item.path)) {
2838
2877
  ctx.addIssue({
2839
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-BrVRL2fg.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-BrVRL2fg.mjs';
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-BrVRL2fg.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-BrVRL2fg.js';
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