@web-ts-toolkit/access-router 0.52.0 → 0.53.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 +175 -14
- package/advanced.d.mts +1 -4
- package/advanced.d.ts +1 -4
- package/advanced.js +81 -5
- package/advanced.mjs +81 -5
- package/index.d.mts +7 -4
- package/index.d.ts +7 -4
- package/index.js +840 -658
- package/index.mjs +436 -254
- package/llms.txt +4 -1
- package/package.json +3 -3
- package/{parsers-BnmChTfF.d.mts → parsers-ZSrF7SNu.d.mts} +71 -26
- package/{parsers-BnmChTfF.d.ts → parsers-ZSrF7SNu.d.ts} +71 -26
- package/processors.js +86 -47
- package/processors.mjs +49 -10
package/advanced.mjs
CHANGED
|
@@ -112,7 +112,38 @@ function assertPublicAdmission(input, kind = "envelope") {
|
|
|
112
112
|
for (const key of ["filter", "match", "data"]) add(record[key], "data", key);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
+
function assertHydrationDefaults(defaults) {
|
|
116
|
+
if (defaults && typeof defaults === "object") {
|
|
117
|
+
const record = defaults;
|
|
118
|
+
if ("hydration" in record)
|
|
119
|
+
throw new TypeError("defaults.hydration is unsupported; use model hydration configuration");
|
|
120
|
+
for (const bucket of [
|
|
121
|
+
"publicListOptions",
|
|
122
|
+
"publicReadOptions",
|
|
123
|
+
"findOptions",
|
|
124
|
+
"findOneOptions",
|
|
125
|
+
"findByIdOptions",
|
|
126
|
+
"createOptions",
|
|
127
|
+
"updateOneOptions",
|
|
128
|
+
"updateByIdOptions",
|
|
129
|
+
"upsertOptions",
|
|
130
|
+
"existsOptions",
|
|
131
|
+
"publicCreateOptions",
|
|
132
|
+
"publicUpdateOptions"
|
|
133
|
+
]) {
|
|
134
|
+
const options = record[bucket];
|
|
135
|
+
if (!options || typeof options !== "object" && typeof options !== "function") continue;
|
|
136
|
+
for (const key of ["lean", "hydration"]) {
|
|
137
|
+
if (!(key in options)) continue;
|
|
138
|
+
const method = bucket.slice(0, -"Options".length);
|
|
139
|
+
const migration = ["publicList", "publicRead", "find", "findOne", "findById"].includes(method) ? `use model hydration.${method} ('lean' or 'hydrated')` : "this method has a fixed fetch mode";
|
|
140
|
+
throw new TypeError(`defaults.${bucket}.${key} is unsupported; ${migration}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
115
145
|
function assertPublicDefaults(defaults) {
|
|
146
|
+
assertHydrationDefaults(defaults);
|
|
116
147
|
assertPublicAdmission(defaults);
|
|
117
148
|
if (defaults && typeof defaults === "object") {
|
|
118
149
|
for (const value of Object.values(defaults)) assertPublicAdmission(value);
|
|
@@ -120,6 +151,31 @@ function assertPublicDefaults(defaults) {
|
|
|
120
151
|
}
|
|
121
152
|
var requestAuthorization = Object.freeze({ outputFields: Object.freeze({ mode: "request" }) });
|
|
122
153
|
|
|
154
|
+
// src/options/hydration.ts
|
|
155
|
+
var methods = ["publicList", "publicRead", "find", "findOne", "findById"];
|
|
156
|
+
function normalizeHydration(value, path = "hydration") {
|
|
157
|
+
if (value === void 0) return void 0;
|
|
158
|
+
if (value === null || typeof value !== "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(value)))
|
|
159
|
+
throw new TypeError(`${path} must be a plain record of model hydration modes`);
|
|
160
|
+
const result = {};
|
|
161
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
162
|
+
if (typeof key !== "string" || !methods.includes(key))
|
|
163
|
+
throw new TypeError(`${path}.${String(key)} is not a supported hydration method`);
|
|
164
|
+
const mode = value[key];
|
|
165
|
+
if (mode !== void 0 && mode !== "lean" && mode !== "hydrated")
|
|
166
|
+
throw new TypeError(`${path}.${key} must be 'lean', 'hydrated', or undefined`);
|
|
167
|
+
result[key] = mode;
|
|
168
|
+
}
|
|
169
|
+
return Object.freeze(result);
|
|
170
|
+
}
|
|
171
|
+
function normalizeHydrationUpdate(current, key, value) {
|
|
172
|
+
if (key === "hydration") return normalizeHydration(value);
|
|
173
|
+
const method = key.slice("hydration.".length);
|
|
174
|
+
if (!methods.includes(method))
|
|
175
|
+
throw new TypeError(`${key} is not a supported hydration method`);
|
|
176
|
+
return normalizeHydration({ ...normalizeHydration(current), [method]: value });
|
|
177
|
+
}
|
|
178
|
+
|
|
123
179
|
// src/runtime.ts
|
|
124
180
|
import mschema2Jsonschema from "mongoose-schema-jsonschema";
|
|
125
181
|
import {
|
|
@@ -1611,9 +1667,25 @@ var AccessRuntime = class {
|
|
|
1611
1667
|
}
|
|
1612
1668
|
/** Update model starting defaults shallowly; already-stored model values are not broadcast-replaced. */
|
|
1613
1669
|
setDefaultModelOptions(options) {
|
|
1670
|
+
assertPublicDefaults(options.defaults);
|
|
1671
|
+
if ("hydration" in options) options = { ...options, hydration: normalizeHydration(options.hydration) };
|
|
1614
1672
|
this.defaultModelOptions.assign(options);
|
|
1615
1673
|
}
|
|
1616
1674
|
setDefaultModelOption(key, value) {
|
|
1675
|
+
const keyStr = String(key);
|
|
1676
|
+
if (keyStr === "hydration" || keyStr.startsWith("hydration.")) {
|
|
1677
|
+
this.defaultModelOptions.set(
|
|
1678
|
+
"hydration",
|
|
1679
|
+
normalizeHydrationUpdate(this.getDefaultModelOptions().hydration, keyStr, value)
|
|
1680
|
+
);
|
|
1681
|
+
return;
|
|
1682
|
+
}
|
|
1683
|
+
if (keyStr === "defaults") assertPublicDefaults(value);
|
|
1684
|
+
else if (keyStr.startsWith("defaults.")) {
|
|
1685
|
+
const proposed = {};
|
|
1686
|
+
set3(proposed, keyStr.slice("defaults.".length), value);
|
|
1687
|
+
assertPublicDefaults(proposed);
|
|
1688
|
+
}
|
|
1617
1689
|
this.defaultModelOptions.set(key, value);
|
|
1618
1690
|
}
|
|
1619
1691
|
getDefaultModelOptions() {
|
|
@@ -1663,6 +1735,7 @@ var AccessRuntime = class {
|
|
|
1663
1735
|
*/
|
|
1664
1736
|
setModelOptions(modelName, options) {
|
|
1665
1737
|
assertPublicDefaults(options.defaults);
|
|
1738
|
+
if ("hydration" in options) options = { ...options, hydration: normalizeHydration(options.hydration) };
|
|
1666
1739
|
const manager = this.getOrCreateModelOptions(modelName);
|
|
1667
1740
|
const defaultOptions = this.getDefaultModelOptions();
|
|
1668
1741
|
const currentModelOptions = manager.fetch();
|
|
@@ -1673,14 +1746,19 @@ var AccessRuntime = class {
|
|
|
1673
1746
|
manager.assign({ ...defaultOptions, ...currentModelOptions, ...options });
|
|
1674
1747
|
}
|
|
1675
1748
|
setModelOption(modelName, key, value) {
|
|
1676
|
-
const manager = this.getOrCreateModelOptions(modelName);
|
|
1677
1749
|
const keyStr = String(key);
|
|
1750
|
+
if (keyStr === "hydration" || keyStr.startsWith("hydration.")) {
|
|
1751
|
+
const hydration = normalizeHydrationUpdate(this.modelOptions[modelName]?.get("hydration"), keyStr, value);
|
|
1752
|
+
this.getOrCreateModelOptions(modelName).set("hydration", hydration);
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1678
1755
|
if (keyStr === "defaults") assertPublicDefaults(value);
|
|
1679
1756
|
else if (keyStr.startsWith("defaults.")) {
|
|
1680
1757
|
const proposed = {};
|
|
1681
1758
|
set3(proposed, keyStr.slice("defaults.".length), value);
|
|
1682
1759
|
assertPublicDefaults(proposed);
|
|
1683
1760
|
}
|
|
1761
|
+
const manager = this.getOrCreateModelOptions(modelName);
|
|
1684
1762
|
if (keyStr === "virtuals" || keyStr.startsWith("virtuals.") || keyStr === "documentPermissionField") {
|
|
1685
1763
|
const model = this.getModelInstance(modelName);
|
|
1686
1764
|
const currentVirtuals = manager.get("virtuals");
|
|
@@ -3042,8 +3120,7 @@ var rootModelListOptionsSchema = z5.object({
|
|
|
3042
3120
|
includePermissions: z5.boolean().optional(),
|
|
3043
3121
|
includeFieldPermissions: z5.boolean().optional(),
|
|
3044
3122
|
includeCount: z5.boolean().optional(),
|
|
3045
|
-
populateAccess: populateAccessSchema.optional()
|
|
3046
|
-
lean: z5.boolean().optional()
|
|
3123
|
+
populateAccess: populateAccessSchema.optional()
|
|
3047
3124
|
}).passthrough();
|
|
3048
3125
|
var rootModelReadArgsSchema = z5.object({
|
|
3049
3126
|
select: projectionSchema.optional(),
|
|
@@ -3059,8 +3136,7 @@ var rootModelReadOptionsSchema = z5.object({
|
|
|
3059
3136
|
includePermissions: z5.boolean().optional(),
|
|
3060
3137
|
includeFieldPermissions: z5.boolean().optional(),
|
|
3061
3138
|
tryList: z5.boolean().optional(),
|
|
3062
|
-
populateAccess: populateAccessSchema.optional()
|
|
3063
|
-
lean: z5.boolean().optional()
|
|
3139
|
+
populateAccess: populateAccessSchema.optional()
|
|
3064
3140
|
}).passthrough();
|
|
3065
3141
|
var rootModelCreateArgsSchema = z5.object({
|
|
3066
3142
|
select: projectionSchema.optional(),
|
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,
|
|
4
|
-
export {
|
|
3
|
+
import { A as AccessRouterBaseRequest, aq as GuardHook, aT as ModelRequest, dP as AccessRuntime, _ as DataRouterOptions, Y as DataRequest, dQ as DataService, aa as ExtendedDataRouterOptions, af as Filter, bm as Projection, ct as Sort, bi as Populate, aU as ModelRouterOptions, dR as Service, dS as PublicService, b1 as ModelVirtualRecordAccess, aZ as ModelVirtualDescriptor, a$ as ModelVirtualGetter, b0 as ModelVirtualLeaf, ac as ExtendedModelRouterOptions, dq as Validation, cd as RootRouterOptions, dT as OpenApiRouterOptions, dU as OpenApiRegistryOptions, dV as OpenApiRouteDescriptor, dW as OpenApiDocumentOptions, dX as OpenApiParameter, dY as OpenApiSchema, dZ as OpenApiResponses, ao as GlobalOptions, a2 as DefaultModelRouterOptions, ab as ExtendedDefaultModelRouterOptions } from './parsers-ZSrF7SNu.mjs';
|
|
4
|
+
export { d_ as AccessRouterPermissionMap, d$ 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, b2 as ModelVirtuals, b3 as MutationAuthorization, b4 as NewArgs, b5 as NewOptions, e0 as OpenApiMethod, b6 as OperationAccess, b7 as OperationAuthorization, b8 as OutputAuthorization, b9 as OutputFieldOptions, ba as OutputFieldPath, bb as OutputPlanningOptions, be as PairedRouteAccess, bh as PermissionSchema, e1 as Permissions, bk as PopulatePlanningOptions, by as PublicSubdocumentCreateOptions, bz as PublicSubdocumentListOptions, bA as PublicSubdocumentMutationOptions, bB as PublicSubdocumentReadOptions, bH as RelatedAuthorization, bJ as RequestSchemaAdapter, bK as RequestSchemaFailure, bL as RequestSchemaIssue, bM as RequestSchemaLike, bN as RequestSchemaOptions, bO as RequestSchemaResult, bP as RequestSchemaSuccess, bQ as RequestSchemaValidator, cg as RouteBaseAccess, ch as RouteGuardAccess, ci as RouteVariant, cj as RouteVariantAccess, ck as RowAuthorization, co as ServiceAuthorization, cp as ServiceOutputContext, cq as ServiceOutputDecorator, cv as StandardSchemaFailure, cw as StandardSchemaInferOutput, cx as StandardSchemaIssue, cy as StandardSchemaPathSegment, cz as StandardSchemaResult, cA as StandardSchemaSuccess, cB as StandardSchemaV1, cE as SubOperationAccess, cI as SubRouteGuardOptions, cL as SubdocumentCreateAuthorization, cN as SubdocumentCreateOptions, cO as SubdocumentCreateVisibilityAuthorization, cP as SubdocumentDeleteAuthorization, cQ as SubdocumentDeleteOptions, cR as SubdocumentGateAuthorization, cT as SubdocumentInputAuthorization, cU as SubdocumentListOptions, cV as SubdocumentModel, cW as SubdocumentMutationAuthorization, cX as SubdocumentName, cY as SubdocumentOutputAuthorization, c$ as SubdocumentReadAuthorization, d0 as SubdocumentReadOptions, d2 as SubdocumentUpdateOptions, d3 as SubdocumentVirtuals, d4 as SubdocumentVisibilityAuthorization, d5 as SuperstructFailureLike, d6 as SuperstructValidateLike, dj as ValibotIssueLike, dk as ValibotPathItemLike, dl as ValibotSafeParseLike, dm as ValibotSafeParseResult, ds as VineValidationErrorLike, dt as VineValidationMessageLike, du as VineValidatorLike, dv as VirtualSubModel, dw as WithVirtuals, dx as YupSchemaLike, dy as YupValidationErrorLike, e2 as defaultRuntime, dz as defineRequestSchema, dA as fromAjv, dB as fromArkType, dC as fromIoTs, dD as fromJoi, dE as fromStandardSchema, dF as fromSuperstruct, dG as fromValibot, dH as fromVine, dI as fromYup, dJ as fromZod } from './parsers-ZSrF7SNu.mjs';
|
|
5
5
|
import JsonRouter from '@web-ts-toolkit/express-json-router';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
|
@@ -460,7 +460,10 @@ interface Options {
|
|
|
460
460
|
* Option lookup uses the active runtime, or the default runtime outside managed execution.
|
|
461
461
|
* This plugin neither computes grants nor enables field enforcement: routers/services
|
|
462
462
|
* already enforce operationAccess and permissionSchema without it. It is separate from
|
|
463
|
-
* the package's computed `virtuals` output API
|
|
463
|
+
* the package's computed `virtuals` output API. Finalized rows already get their
|
|
464
|
+
* own non-enumerable `permissions` alias from exposed metadata in both modes without
|
|
465
|
+
* this plugin. virtualPermissionField only names this raw getter; its literal _doc
|
|
466
|
+
* lookup does not traverse dotted metadata paths.
|
|
464
467
|
*/
|
|
465
468
|
declare function permissionsPlugin(schema: Schema, options: Options): void;
|
|
466
469
|
|
|
@@ -570,7 +573,7 @@ type AccessRuntimeApi = typeof macl & Wtt;
|
|
|
570
573
|
* The returned callable facade exposes factories/setters; `.runtime` is its owner.
|
|
571
574
|
* Mount generated `.routes` after express.json(); connect MongoDB before listening.
|
|
572
575
|
* Model operations default to denied until operationAccess is configured, and field
|
|
573
|
-
* visibility requires permissionSchema. permissionsPlugin is only an optional alias.
|
|
576
|
+
* visibility requires permissionSchema. permissionsPlugin is only an optional raw-document alias.
|
|
574
577
|
*
|
|
575
578
|
* @example
|
|
576
579
|
* ```ts
|
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,
|
|
4
|
-
export {
|
|
3
|
+
import { A as AccessRouterBaseRequest, aq as GuardHook, aT as ModelRequest, dP as AccessRuntime, _ as DataRouterOptions, Y as DataRequest, dQ as DataService, aa as ExtendedDataRouterOptions, af as Filter, bm as Projection, ct as Sort, bi as Populate, aU as ModelRouterOptions, dR as Service, dS as PublicService, b1 as ModelVirtualRecordAccess, aZ as ModelVirtualDescriptor, a$ as ModelVirtualGetter, b0 as ModelVirtualLeaf, ac as ExtendedModelRouterOptions, dq as Validation, cd as RootRouterOptions, dT as OpenApiRouterOptions, dU as OpenApiRegistryOptions, dV as OpenApiRouteDescriptor, dW as OpenApiDocumentOptions, dX as OpenApiParameter, dY as OpenApiSchema, dZ as OpenApiResponses, ao as GlobalOptions, a2 as DefaultModelRouterOptions, ab as ExtendedDefaultModelRouterOptions } from './parsers-ZSrF7SNu.js';
|
|
4
|
+
export { d_ as AccessRouterPermissionMap, d$ 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, b2 as ModelVirtuals, b3 as MutationAuthorization, b4 as NewArgs, b5 as NewOptions, e0 as OpenApiMethod, b6 as OperationAccess, b7 as OperationAuthorization, b8 as OutputAuthorization, b9 as OutputFieldOptions, ba as OutputFieldPath, bb as OutputPlanningOptions, be as PairedRouteAccess, bh as PermissionSchema, e1 as Permissions, bk as PopulatePlanningOptions, by as PublicSubdocumentCreateOptions, bz as PublicSubdocumentListOptions, bA as PublicSubdocumentMutationOptions, bB as PublicSubdocumentReadOptions, bH as RelatedAuthorization, bJ as RequestSchemaAdapter, bK as RequestSchemaFailure, bL as RequestSchemaIssue, bM as RequestSchemaLike, bN as RequestSchemaOptions, bO as RequestSchemaResult, bP as RequestSchemaSuccess, bQ as RequestSchemaValidator, cg as RouteBaseAccess, ch as RouteGuardAccess, ci as RouteVariant, cj as RouteVariantAccess, ck as RowAuthorization, co as ServiceAuthorization, cp as ServiceOutputContext, cq as ServiceOutputDecorator, cv as StandardSchemaFailure, cw as StandardSchemaInferOutput, cx as StandardSchemaIssue, cy as StandardSchemaPathSegment, cz as StandardSchemaResult, cA as StandardSchemaSuccess, cB as StandardSchemaV1, cE as SubOperationAccess, cI as SubRouteGuardOptions, cL as SubdocumentCreateAuthorization, cN as SubdocumentCreateOptions, cO as SubdocumentCreateVisibilityAuthorization, cP as SubdocumentDeleteAuthorization, cQ as SubdocumentDeleteOptions, cR as SubdocumentGateAuthorization, cT as SubdocumentInputAuthorization, cU as SubdocumentListOptions, cV as SubdocumentModel, cW as SubdocumentMutationAuthorization, cX as SubdocumentName, cY as SubdocumentOutputAuthorization, c$ as SubdocumentReadAuthorization, d0 as SubdocumentReadOptions, d2 as SubdocumentUpdateOptions, d3 as SubdocumentVirtuals, d4 as SubdocumentVisibilityAuthorization, d5 as SuperstructFailureLike, d6 as SuperstructValidateLike, dj as ValibotIssueLike, dk as ValibotPathItemLike, dl as ValibotSafeParseLike, dm as ValibotSafeParseResult, ds as VineValidationErrorLike, dt as VineValidationMessageLike, du as VineValidatorLike, dv as VirtualSubModel, dw as WithVirtuals, dx as YupSchemaLike, dy as YupValidationErrorLike, e2 as defaultRuntime, dz as defineRequestSchema, dA as fromAjv, dB as fromArkType, dC as fromIoTs, dD as fromJoi, dE as fromStandardSchema, dF as fromSuperstruct, dG as fromValibot, dH as fromVine, dI as fromYup, dJ as fromZod } from './parsers-ZSrF7SNu.js';
|
|
5
5
|
import JsonRouter from '@web-ts-toolkit/express-json-router';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
|
@@ -460,7 +460,10 @@ interface Options {
|
|
|
460
460
|
* Option lookup uses the active runtime, or the default runtime outside managed execution.
|
|
461
461
|
* This plugin neither computes grants nor enables field enforcement: routers/services
|
|
462
462
|
* already enforce operationAccess and permissionSchema without it. It is separate from
|
|
463
|
-
* the package's computed `virtuals` output API
|
|
463
|
+
* the package's computed `virtuals` output API. Finalized rows already get their
|
|
464
|
+
* own non-enumerable `permissions` alias from exposed metadata in both modes without
|
|
465
|
+
* this plugin. virtualPermissionField only names this raw getter; its literal _doc
|
|
466
|
+
* lookup does not traverse dotted metadata paths.
|
|
464
467
|
*/
|
|
465
468
|
declare function permissionsPlugin(schema: Schema, options: Options): void;
|
|
466
469
|
|
|
@@ -570,7 +573,7 @@ type AccessRuntimeApi = typeof macl & Wtt;
|
|
|
570
573
|
* The returned callable facade exposes factories/setters; `.runtime` is its owner.
|
|
571
574
|
* Mount generated `.routes` after express.json(); connect MongoDB before listening.
|
|
572
575
|
* Model operations default to denied until operationAccess is configured, and field
|
|
573
|
-
* visibility requires permissionSchema. permissionsPlugin is only an optional alias.
|
|
576
|
+
* visibility requires permissionSchema. permissionsPlugin is only an optional raw-document alias.
|
|
574
577
|
*
|
|
575
578
|
* @example
|
|
576
579
|
* ```ts
|