@web-ts-toolkit/access-router 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -57,6 +57,8 @@ const docsRouter = acl.createOpenApiRouter({
57
57
 
58
58
  ## Main Exports
59
59
 
60
+ Root entrypoint (`@web-ts-toolkit/access-router`):
61
+
60
62
  - default export `acl`
61
63
  - `createAccessRuntime()`
62
64
  - `createOpenApiRouter(...)`
@@ -65,6 +67,38 @@ const docsRouter = acl.createOpenApiRouter({
65
67
  - `RootRouter`, `ModelRouter`, `DataRouter`
66
68
  - validation adapters such as `fromZod(...)` and `defineRequestSchema(...)`
67
69
 
70
+ Subpath entrypoints:
71
+
72
+ - `@web-ts-toolkit/access-router/advanced` — runtime context and advanced internals
73
+ - `@web-ts-toolkit/access-router/processors` — field processors
74
+
75
+ ### Import styles
76
+
77
+ The package ships both a default export and named exports:
78
+
79
+ ```ts
80
+ // default export (preferred for the runtime API)
81
+ import acl from '@web-ts-toolkit/access-router';
82
+
83
+ // named exports (useful when you only need specific helpers)
84
+ import { createOpenApiRouter, fromZod } from '@web-ts-toolkit/access-router';
85
+ ```
86
+
87
+ ### Subpath import example
88
+
89
+ ```ts
90
+ import { setGlobalOptions } from '@web-ts-toolkit/access-router';
91
+ import { copyAndDepopulate } from '@web-ts-toolkit/access-router/processors';
92
+
93
+ setGlobalOptions({
94
+ globalPermissions(req) {
95
+ return [];
96
+ },
97
+ });
98
+
99
+ const depopulated = copyAndDepopulate({ items: [{ _id: 'a1', name: 'Apple' }] }, [{ src: 'items', dest: 'items' }]);
100
+ ```
101
+
68
102
  ## Documentation
69
103
 
70
104
  Full package documentation lives in `website/docs/packages/access-router/`.
package/advanced.d.mts CHANGED
@@ -1,7 +1,6 @@
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 AjvValidatorLike, n as ArkTypeErrorsLike, o as ArkTypeLike, p as ArkTypeProblemLike, B as BaseFilterAccess, C as Codes, q as CountBody, r as CreateArgs, s as CreateOptions, t as CreateQueryInput, u as CustomHeaders, D as DataBaseFilterHook, v as DataFilter, w as DataFindArgs, x as DataFindOneArgs, y as DataFindOneOptions, z as DataFindOptions, E as DataHook, F as DataHookContext, G as DataIdentifierHook, H as DataListHook, I as DataOverrideFilterHook, J as DataRequest, K as DataRequestSchemas, L as DataRouterOptions, M as DecorateAccess, N as DecorateAllAccess, O as DeepFieldPath, P as DefaultModelRouterOptions, Q as Defaults, R as DistinctArgs, S as DistinctBody, T as DocPermissionsAccess, U as ErrorResult, V as ExistsOptions, W as ExtendedDataRouterOptions, X as ExtendedDefaultModelRouterOptions, Y as ExtendedModelRouterOptions, Z as Filter, _ as FilterOperator, $ as FindAccess, a0 as FindArgs, a1 as FindByIdArgs, a2 as FindByIdOptions, a3 as FindOneArgs, a4 as FindOneOptions, a5 as FindOptions, a6 as GlobalOptions, a7 as GlobalPermissionValue, a8 as GuardHook, a9 as IdentifierHook, aa as Include, ab as IoTsContextEntryLike, ac as IoTsDecodeErrorLike, ad as IoTsDecoderLike, ae as JoiSchemaLike, af as JoiValidationErrorDetailLike, ag as KeyValueProjection, ah as ListQueryInput, ai as ListResult, aj as MaybePromise, ak as ModelBaseFilterHook, al as ModelChangeHook, am as ModelDeleteHook, an as ModelDocPermissionsHook, ao as ModelDocument, ap as ModelDocumentHook, aq as ModelHook, ar as ModelHookContext, as as ModelIdentifierHook, at as ModelListHook, au as ModelOverrideFilterHook, av as ModelRequest, aw as ModelRouterOptions, ax as ModelValidateHook, ay as PathValue, az as PermissionSchema, aA as Populate, aB as PopulateAccess, aC as PrepareAccess, aD as Projection, aE as PublicCreateArgs, aF as PublicCreateOptions, aG as PublicListArgs, aH as PublicListOptions, aI as PublicOutput, aJ as PublicReadArgs, aK as PublicReadOptions, aL as PublicUpdateArgs, aM as PublicUpdateOptions, aN as PublicUpsertArgs, aO as PublicUpsertOptions, aP as ReadQueryInput, aQ as Request, aR as RequestSchemaAdapter, aS as RequestSchemaFailure, aT as RequestSchemaIssue, aU as RequestSchemaLike, aV as RequestSchemaOptions, aW as RequestSchemaResult, aX as RequestSchemaSuccess, aY as RequestSchemaValidator, aZ as RequestSchemas, a_ as RootDataListQueryEntry, a$ as RootDataOperation, b0 as RootDataReadByFilterQueryEntry, b1 as RootDataReadByIdQueryEntry, b2 as RootModelCountQueryEntry, b3 as RootModelCreateQueryEntry, b4 as RootModelDeleteQueryEntry, b5 as RootModelDistinctQueryEntry, b6 as RootModelListQueryEntry, b7 as RootModelNewQueryEntry, b8 as RootModelOperation, b9 as RootModelReadByFilterQueryEntry, ba as RootModelReadByIdQueryEntry, bb as RootModelSubBulkUpdateQueryEntry, bc as RootModelSubCreateQueryEntry, bd as RootModelSubDeleteQueryEntry, be as RootModelSubListQueryEntry, bf as RootModelSubReadQueryEntry, bg as RootModelSubUpdateQueryEntry, bh as RootModelUpdateQueryEntry, bi as RootModelUpsertQueryEntry, bj as RootOperationResult, bk as RootQueryEntry, bl as RootRouterOptions, bm as RootSubOperation, bn as RootTarget, bo as RouteGuardAccess, bp as SelectAccess, bq as SelectedPopulatedPublicOutput, br as SelectedPublicOutput, bs as ServiceResult, bt as SingleResult, bu as Sort, bv as SortOrder, bw as StandardSchemaFailure, bx as StandardSchemaInferOutput, by as StandardSchemaIssue, bz as StandardSchemaPathSegment, bA as StandardSchemaResult, bB as StandardSchemaSuccess, bC as StandardSchemaV1, bD as StatusCodes, bE as SubListBody, bF as SubPopulate, bG as SubQueryEntry, bH as SubReadBody, bI as SuperstructFailureLike, bJ as SuperstructValidateLike, bK as Task, bL as TransformAccess, bM as TypedFilter, bN as UpdateByIdArgs, bO as UpdateByIdOptions, bP as UpdateOneArgs, bQ as UpdateOneOptions, bR as UpdateQueryInput, bS as UpsertArgs, bT as UpsertOptions, bU as UpsertQueryInput, bV as ValibotIssueLike, bW as ValibotPathItemLike, bX as ValibotSafeParseLike, bY as ValibotSafeParseResult, bZ as ValidateAccess, b_ as ValidateRule, b$ as Validation, c0 as ValidationError, c1 as VineValidationErrorLike, c2 as VineValidationMessageLike, c3 as VineValidatorLike, c4 as YupSchemaLike, c5 as YupValidationErrorLike, c6 as defineRequestSchema, c7 as fromAjv, c8 as fromArkType, c9 as fromIoTs, ca as fromJoi, cb as fromStandardSchema, cc as fromSuperstruct, cd as fromValibot, ce as fromVine, cf as fromYup, cg as fromZod, ch as parseBody, ci as parseBodyWithSchema, cj as parseNestedBodyWithSchema, ck as parsePathParam, cl as parseQuery } from './parsers-Ce1grlLx.mjs';
1
+ export { A as AccessRouterBaseRequest, a as AccessRouterFieldKey, b as AccessRouterLogger, c as AccessRouterRequest, d as AccessRouterRequestExtensions, e as AdvancedCreateBody, f as AdvancedListBody, g as AdvancedReadBody, h as AdvancedReadFilterBody, i as AdvancedUpdateBody, j as AdvancedUpsertBody, k as AfterPersistAccess, l as AjvErrorObjectLike, m as AjvValidatorLike, n as ArkTypeErrorsLike, o as ArkTypeLike, p as ArkTypeProblemLike, B as BaseFilterAccess, C as Change, q as Codes, r as CountBody, s as CreateArgs, t as CreateOptions, u as CreateQueryInput, v as CustomHeaders, D as DataBaseFilterHook, w as DataFilter, x as DataFindArgs, y as DataFindOneArgs, z as DataFindOneOptions, E as DataFindOptions, F as DataHook, G as DataHookContext, H as DataIdentifierHook, I as DataListHook, J as DataOverrideFilterHook, K as DataRequest, L as DataRequestSchemas, M as DataRouterOptions, N as DecorateAccess, O as DecorateAllAccess, P as DeepFieldPath, Q as DefaultModelRouterOptions, R as Defaults, S as DistinctArgs, T as DistinctBody, U as DocPermissionsAccess, V as ErrorResult, W as ExistsOptions, X as ExtendedDataRouterOptions, Y as ExtendedDefaultModelRouterOptions, Z as ExtendedModelRouterOptions, _ as Filter, $ as FilterOperator, a0 as FindAccess, a1 as FindArgs, a2 as FindByIdArgs, a3 as FindByIdOptions, a4 as FindOneArgs, a5 as FindOneOptions, a6 as FindOptions, a7 as GlobalOptions, a8 as GlobalPermissionValue, a9 as GuardHook, aa as IdentifierHook, ab as Include, ac as IoTsContextEntryLike, ad as IoTsDecodeErrorLike, ae as IoTsDecoderLike, af as JoiSchemaLike, ag as JoiValidationErrorDetailLike, ah as KeyValueProjection, ai as ListQueryInput, aj as ListResult, ak as MaybePromise, al as ModelBaseFilterHook, am as ModelChangeHook, an as ModelDeleteHook, ao as ModelDocPermissionsHook, ap as ModelDocument, aq as ModelDocumentHook, ar as ModelHook, as as ModelHookContext, at as ModelIdentifierHook, au as ModelListHook, av as ModelOverrideFilterHook, aw as ModelRequest, ax as ModelRouterOptions, ay as ModelValidateHook, az as PathValue, aA as PermissionSchema, aB as Populate, aC as PopulateAccess, aD as PrepareAccess, aE as Projection, aF as PublicCreateArgs, aG as PublicCreateOptions, aH as PublicListArgs, aI as PublicListOptions, aJ as PublicOutput, aK as PublicReadArgs, aL as PublicReadOptions, aM as PublicUpdateArgs, aN as PublicUpdateOptions, aO as PublicUpsertArgs, aP as PublicUpsertOptions, aQ as ReadQueryInput, aR as Request, aS as RequestSchemaAdapter, aT as RequestSchemaFailure, aU as RequestSchemaIssue, aV as RequestSchemaLike, aW as RequestSchemaOptions, aX as RequestSchemaResult, aY as RequestSchemaSuccess, aZ as RequestSchemaValidator, a_ as RequestSchemas, a$ as RootDataListQueryEntry, b0 as RootDataOperation, b1 as RootDataReadByFilterQueryEntry, b2 as RootDataReadByIdQueryEntry, b3 as RootModelCountQueryEntry, b4 as RootModelCreateQueryEntry, b5 as RootModelDeleteQueryEntry, b6 as RootModelDistinctQueryEntry, b7 as RootModelListQueryEntry, b8 as RootModelNewQueryEntry, b9 as RootModelOperation, ba as RootModelReadByFilterQueryEntry, bb as RootModelReadByIdQueryEntry, bc as RootModelSubBulkUpdateQueryEntry, bd as RootModelSubCreateQueryEntry, be as RootModelSubDeleteQueryEntry, bf as RootModelSubListQueryEntry, bg as RootModelSubReadQueryEntry, bh as RootModelSubUpdateQueryEntry, bi as RootModelUpdateQueryEntry, bj as RootModelUpsertQueryEntry, bk as RootOperationResult, bl as RootQueryEntry, bm as RootRouterOptions, bn as RootSubOperation, bo as RootTarget, bp as RouteGuardAccess, bq as SelectAccess, br as SelectedPopulatedPublicOutput, bs as SelectedPublicOutput, bt as ServiceResult, bu as SingleResult, bv as Sort, bw as SortOrder, bx as StandardSchemaFailure, by as StandardSchemaInferOutput, bz as StandardSchemaIssue, bA as StandardSchemaPathSegment, bB as StandardSchemaResult, bC as StandardSchemaSuccess, bD as StandardSchemaV1, bE as StatusCodes, bF as SubListBody, bG as SubPopulate, bH as SubQueryEntry, bI as SubReadBody, bJ as SuperstructFailureLike, bK as SuperstructValidateLike, bL as Task, bM as TransformAccess, bN as TypedFilter, bO as UpdateByIdArgs, bP as UpdateByIdOptions, bQ as UpdateOneArgs, bR as UpdateOneOptions, bS as UpdateQueryInput, bT as UpsertArgs, bU as UpsertOptions, bV as UpsertQueryInput, bW as ValibotIssueLike, bX as ValibotPathItemLike, bY as ValibotSafeParseLike, bZ as ValibotSafeParseResult, b_ as ValidateAccess, b$ as ValidateRule, c0 as Validation, c1 as ValidationError, c2 as VineValidationErrorLike, c3 as VineValidationMessageLike, c4 as VineValidatorLike, c5 as YupSchemaLike, c6 as YupValidationErrorLike, c7 as defineRequestSchema, c8 as fromAjv, c9 as fromArkType, ca as fromIoTs, cb as fromJoi, cc as fromStandardSchema, cd as fromSuperstruct, ce as fromValibot, cf as fromVine, cg as fromYup, ch as fromZod, ci as parseBody, cj as parseBodyWithSchema, ck as parseNestedBodyWithSchema, cl as parsePathParam, cm as parseQuery } from './parsers-Cj4r_G4g.mjs';
2
2
  import { z } from 'zod';
3
3
  import 'mongoose';
4
- import 'deep-diff';
5
4
  import 'express';
6
5
 
7
6
  declare const MIDDLEWARE: unique symbol;
package/advanced.d.ts CHANGED
@@ -1,7 +1,6 @@
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 AjvValidatorLike, n as ArkTypeErrorsLike, o as ArkTypeLike, p as ArkTypeProblemLike, B as BaseFilterAccess, C as Codes, q as CountBody, r as CreateArgs, s as CreateOptions, t as CreateQueryInput, u as CustomHeaders, D as DataBaseFilterHook, v as DataFilter, w as DataFindArgs, x as DataFindOneArgs, y as DataFindOneOptions, z as DataFindOptions, E as DataHook, F as DataHookContext, G as DataIdentifierHook, H as DataListHook, I as DataOverrideFilterHook, J as DataRequest, K as DataRequestSchemas, L as DataRouterOptions, M as DecorateAccess, N as DecorateAllAccess, O as DeepFieldPath, P as DefaultModelRouterOptions, Q as Defaults, R as DistinctArgs, S as DistinctBody, T as DocPermissionsAccess, U as ErrorResult, V as ExistsOptions, W as ExtendedDataRouterOptions, X as ExtendedDefaultModelRouterOptions, Y as ExtendedModelRouterOptions, Z as Filter, _ as FilterOperator, $ as FindAccess, a0 as FindArgs, a1 as FindByIdArgs, a2 as FindByIdOptions, a3 as FindOneArgs, a4 as FindOneOptions, a5 as FindOptions, a6 as GlobalOptions, a7 as GlobalPermissionValue, a8 as GuardHook, a9 as IdentifierHook, aa as Include, ab as IoTsContextEntryLike, ac as IoTsDecodeErrorLike, ad as IoTsDecoderLike, ae as JoiSchemaLike, af as JoiValidationErrorDetailLike, ag as KeyValueProjection, ah as ListQueryInput, ai as ListResult, aj as MaybePromise, ak as ModelBaseFilterHook, al as ModelChangeHook, am as ModelDeleteHook, an as ModelDocPermissionsHook, ao as ModelDocument, ap as ModelDocumentHook, aq as ModelHook, ar as ModelHookContext, as as ModelIdentifierHook, at as ModelListHook, au as ModelOverrideFilterHook, av as ModelRequest, aw as ModelRouterOptions, ax as ModelValidateHook, ay as PathValue, az as PermissionSchema, aA as Populate, aB as PopulateAccess, aC as PrepareAccess, aD as Projection, aE as PublicCreateArgs, aF as PublicCreateOptions, aG as PublicListArgs, aH as PublicListOptions, aI as PublicOutput, aJ as PublicReadArgs, aK as PublicReadOptions, aL as PublicUpdateArgs, aM as PublicUpdateOptions, aN as PublicUpsertArgs, aO as PublicUpsertOptions, aP as ReadQueryInput, aQ as Request, aR as RequestSchemaAdapter, aS as RequestSchemaFailure, aT as RequestSchemaIssue, aU as RequestSchemaLike, aV as RequestSchemaOptions, aW as RequestSchemaResult, aX as RequestSchemaSuccess, aY as RequestSchemaValidator, aZ as RequestSchemas, a_ as RootDataListQueryEntry, a$ as RootDataOperation, b0 as RootDataReadByFilterQueryEntry, b1 as RootDataReadByIdQueryEntry, b2 as RootModelCountQueryEntry, b3 as RootModelCreateQueryEntry, b4 as RootModelDeleteQueryEntry, b5 as RootModelDistinctQueryEntry, b6 as RootModelListQueryEntry, b7 as RootModelNewQueryEntry, b8 as RootModelOperation, b9 as RootModelReadByFilterQueryEntry, ba as RootModelReadByIdQueryEntry, bb as RootModelSubBulkUpdateQueryEntry, bc as RootModelSubCreateQueryEntry, bd as RootModelSubDeleteQueryEntry, be as RootModelSubListQueryEntry, bf as RootModelSubReadQueryEntry, bg as RootModelSubUpdateQueryEntry, bh as RootModelUpdateQueryEntry, bi as RootModelUpsertQueryEntry, bj as RootOperationResult, bk as RootQueryEntry, bl as RootRouterOptions, bm as RootSubOperation, bn as RootTarget, bo as RouteGuardAccess, bp as SelectAccess, bq as SelectedPopulatedPublicOutput, br as SelectedPublicOutput, bs as ServiceResult, bt as SingleResult, bu as Sort, bv as SortOrder, bw as StandardSchemaFailure, bx as StandardSchemaInferOutput, by as StandardSchemaIssue, bz as StandardSchemaPathSegment, bA as StandardSchemaResult, bB as StandardSchemaSuccess, bC as StandardSchemaV1, bD as StatusCodes, bE as SubListBody, bF as SubPopulate, bG as SubQueryEntry, bH as SubReadBody, bI as SuperstructFailureLike, bJ as SuperstructValidateLike, bK as Task, bL as TransformAccess, bM as TypedFilter, bN as UpdateByIdArgs, bO as UpdateByIdOptions, bP as UpdateOneArgs, bQ as UpdateOneOptions, bR as UpdateQueryInput, bS as UpsertArgs, bT as UpsertOptions, bU as UpsertQueryInput, bV as ValibotIssueLike, bW as ValibotPathItemLike, bX as ValibotSafeParseLike, bY as ValibotSafeParseResult, bZ as ValidateAccess, b_ as ValidateRule, b$ as Validation, c0 as ValidationError, c1 as VineValidationErrorLike, c2 as VineValidationMessageLike, c3 as VineValidatorLike, c4 as YupSchemaLike, c5 as YupValidationErrorLike, c6 as defineRequestSchema, c7 as fromAjv, c8 as fromArkType, c9 as fromIoTs, ca as fromJoi, cb as fromStandardSchema, cc as fromSuperstruct, cd as fromValibot, ce as fromVine, cf as fromYup, cg as fromZod, ch as parseBody, ci as parseBodyWithSchema, cj as parseNestedBodyWithSchema, ck as parsePathParam, cl as parseQuery } from './parsers-Ce1grlLx.js';
1
+ export { A as AccessRouterBaseRequest, a as AccessRouterFieldKey, b as AccessRouterLogger, c as AccessRouterRequest, d as AccessRouterRequestExtensions, e as AdvancedCreateBody, f as AdvancedListBody, g as AdvancedReadBody, h as AdvancedReadFilterBody, i as AdvancedUpdateBody, j as AdvancedUpsertBody, k as AfterPersistAccess, l as AjvErrorObjectLike, m as AjvValidatorLike, n as ArkTypeErrorsLike, o as ArkTypeLike, p as ArkTypeProblemLike, B as BaseFilterAccess, C as Change, q as Codes, r as CountBody, s as CreateArgs, t as CreateOptions, u as CreateQueryInput, v as CustomHeaders, D as DataBaseFilterHook, w as DataFilter, x as DataFindArgs, y as DataFindOneArgs, z as DataFindOneOptions, E as DataFindOptions, F as DataHook, G as DataHookContext, H as DataIdentifierHook, I as DataListHook, J as DataOverrideFilterHook, K as DataRequest, L as DataRequestSchemas, M as DataRouterOptions, N as DecorateAccess, O as DecorateAllAccess, P as DeepFieldPath, Q as DefaultModelRouterOptions, R as Defaults, S as DistinctArgs, T as DistinctBody, U as DocPermissionsAccess, V as ErrorResult, W as ExistsOptions, X as ExtendedDataRouterOptions, Y as ExtendedDefaultModelRouterOptions, Z as ExtendedModelRouterOptions, _ as Filter, $ as FilterOperator, a0 as FindAccess, a1 as FindArgs, a2 as FindByIdArgs, a3 as FindByIdOptions, a4 as FindOneArgs, a5 as FindOneOptions, a6 as FindOptions, a7 as GlobalOptions, a8 as GlobalPermissionValue, a9 as GuardHook, aa as IdentifierHook, ab as Include, ac as IoTsContextEntryLike, ad as IoTsDecodeErrorLike, ae as IoTsDecoderLike, af as JoiSchemaLike, ag as JoiValidationErrorDetailLike, ah as KeyValueProjection, ai as ListQueryInput, aj as ListResult, ak as MaybePromise, al as ModelBaseFilterHook, am as ModelChangeHook, an as ModelDeleteHook, ao as ModelDocPermissionsHook, ap as ModelDocument, aq as ModelDocumentHook, ar as ModelHook, as as ModelHookContext, at as ModelIdentifierHook, au as ModelListHook, av as ModelOverrideFilterHook, aw as ModelRequest, ax as ModelRouterOptions, ay as ModelValidateHook, az as PathValue, aA as PermissionSchema, aB as Populate, aC as PopulateAccess, aD as PrepareAccess, aE as Projection, aF as PublicCreateArgs, aG as PublicCreateOptions, aH as PublicListArgs, aI as PublicListOptions, aJ as PublicOutput, aK as PublicReadArgs, aL as PublicReadOptions, aM as PublicUpdateArgs, aN as PublicUpdateOptions, aO as PublicUpsertArgs, aP as PublicUpsertOptions, aQ as ReadQueryInput, aR as Request, aS as RequestSchemaAdapter, aT as RequestSchemaFailure, aU as RequestSchemaIssue, aV as RequestSchemaLike, aW as RequestSchemaOptions, aX as RequestSchemaResult, aY as RequestSchemaSuccess, aZ as RequestSchemaValidator, a_ as RequestSchemas, a$ as RootDataListQueryEntry, b0 as RootDataOperation, b1 as RootDataReadByFilterQueryEntry, b2 as RootDataReadByIdQueryEntry, b3 as RootModelCountQueryEntry, b4 as RootModelCreateQueryEntry, b5 as RootModelDeleteQueryEntry, b6 as RootModelDistinctQueryEntry, b7 as RootModelListQueryEntry, b8 as RootModelNewQueryEntry, b9 as RootModelOperation, ba as RootModelReadByFilterQueryEntry, bb as RootModelReadByIdQueryEntry, bc as RootModelSubBulkUpdateQueryEntry, bd as RootModelSubCreateQueryEntry, be as RootModelSubDeleteQueryEntry, bf as RootModelSubListQueryEntry, bg as RootModelSubReadQueryEntry, bh as RootModelSubUpdateQueryEntry, bi as RootModelUpdateQueryEntry, bj as RootModelUpsertQueryEntry, bk as RootOperationResult, bl as RootQueryEntry, bm as RootRouterOptions, bn as RootSubOperation, bo as RootTarget, bp as RouteGuardAccess, bq as SelectAccess, br as SelectedPopulatedPublicOutput, bs as SelectedPublicOutput, bt as ServiceResult, bu as SingleResult, bv as Sort, bw as SortOrder, bx as StandardSchemaFailure, by as StandardSchemaInferOutput, bz as StandardSchemaIssue, bA as StandardSchemaPathSegment, bB as StandardSchemaResult, bC as StandardSchemaSuccess, bD as StandardSchemaV1, bE as StatusCodes, bF as SubListBody, bG as SubPopulate, bH as SubQueryEntry, bI as SubReadBody, bJ as SuperstructFailureLike, bK as SuperstructValidateLike, bL as Task, bM as TransformAccess, bN as TypedFilter, bO as UpdateByIdArgs, bP as UpdateByIdOptions, bQ as UpdateOneArgs, bR as UpdateOneOptions, bS as UpdateQueryInput, bT as UpsertArgs, bU as UpsertOptions, bV as UpsertQueryInput, bW as ValibotIssueLike, bX as ValibotPathItemLike, bY as ValibotSafeParseLike, bZ as ValibotSafeParseResult, b_ as ValidateAccess, b$ as ValidateRule, c0 as Validation, c1 as ValidationError, c2 as VineValidationErrorLike, c3 as VineValidationMessageLike, c4 as VineValidatorLike, c5 as YupSchemaLike, c6 as YupValidationErrorLike, c7 as defineRequestSchema, c8 as fromAjv, c9 as fromArkType, ca as fromIoTs, cb as fromJoi, cc as fromStandardSchema, cd as fromSuperstruct, ce as fromValibot, cf as fromVine, cg as fromYup, ch as fromZod, ci as parseBody, cj as parseBodyWithSchema, ck as parseNestedBodyWithSchema, cl as parsePathParam, cm as parseQuery } from './parsers-Cj4r_G4g.js';
2
2
  import { z } from 'zod';
3
3
  import 'mongoose';
4
- import 'deep-diff';
5
4
  import 'express';
6
5
 
7
6
  declare const MIDDLEWARE: unique symbol;
package/index.d.mts CHANGED
@@ -1,10 +1,9 @@
1
1
  import mongoose from 'mongoose';
2
2
  import { Response, NextFunction, Router } from 'express';
3
- import { a6 as GlobalOptions, P as DefaultModelRouterOptions, X as ExtendedDefaultModelRouterOptions, aw as ModelRouterOptions, Y as ExtendedModelRouterOptions, L as DataRouterOptions, W as ExtendedDataRouterOptions, A as AccessRouterBaseRequest, a8 as GuardHook, av as ModelRequest, J as DataRequest, cm as DataService, cn as Model, co as Service, cp as PublicService, b$ as Validation, bl as RootRouterOptions } from './parsers-Ce1grlLx.mjs';
4
- export { cq as AccessRouterPermissionMap, cr as AccessRouterPermissions, c as AccessRouterRequest, d as AccessRouterRequestExtensions, l as AjvErrorObjectLike, m as AjvValidatorLike, n as ArkTypeErrorsLike, o as ArkTypeLike, ab as IoTsContextEntryLike, ac as IoTsDecodeErrorLike, ad as IoTsDecoderLike, ae as JoiSchemaLike, af as JoiValidationErrorDetailLike, cs as Permissions, aR as RequestSchemaAdapter, aS as RequestSchemaFailure, aT as RequestSchemaIssue, aU as RequestSchemaLike, aV as RequestSchemaOptions, aW as RequestSchemaResult, aX as RequestSchemaSuccess, aY as RequestSchemaValidator, bw as StandardSchemaFailure, bx as StandardSchemaInferOutput, by as StandardSchemaIssue, bz as StandardSchemaPathSegment, bA as StandardSchemaResult, bB as StandardSchemaSuccess, bC as StandardSchemaV1, bI as SuperstructFailureLike, bJ as SuperstructValidateLike, bV as ValibotIssueLike, bW as ValibotPathItemLike, bX as ValibotSafeParseLike, bY as ValibotSafeParseResult, c1 as VineValidationErrorLike, c2 as VineValidationMessageLike, c3 as VineValidatorLike, c4 as YupSchemaLike, c5 as YupValidationErrorLike, c6 as defineRequestSchema, c7 as fromAjv, c8 as fromArkType, c9 as fromIoTs, ca as fromJoi, cb as fromStandardSchema, cc as fromSuperstruct, cd as fromValibot, ce as fromVine, cf as fromYup, cg as fromZod } from './parsers-Ce1grlLx.mjs';
3
+ import { a7 as GlobalOptions, Q as DefaultModelRouterOptions, Y as ExtendedDefaultModelRouterOptions, ax as ModelRouterOptions, Z as ExtendedModelRouterOptions, M as DataRouterOptions, X as ExtendedDataRouterOptions, A as AccessRouterBaseRequest, a9 as GuardHook, aw as ModelRequest, K as DataRequest, cn as DataService, co as Model, cp as Service, cq as PublicService, c0 as Validation, bm as RootRouterOptions } from './parsers-Cj4r_G4g.mjs';
4
+ export { cr as AccessRouterPermissionMap, cs as AccessRouterPermissions, c as AccessRouterRequest, d as AccessRouterRequestExtensions, l as AjvErrorObjectLike, m as AjvValidatorLike, n as ArkTypeErrorsLike, o as ArkTypeLike, ac as IoTsContextEntryLike, ad as IoTsDecodeErrorLike, ae as IoTsDecoderLike, af as JoiSchemaLike, ag as JoiValidationErrorDetailLike, ct as Permissions, aS as RequestSchemaAdapter, aT as RequestSchemaFailure, aU as RequestSchemaIssue, aV as RequestSchemaLike, aW as RequestSchemaOptions, aX as RequestSchemaResult, aY as RequestSchemaSuccess, aZ as RequestSchemaValidator, bx as StandardSchemaFailure, by as StandardSchemaInferOutput, bz as StandardSchemaIssue, bA as StandardSchemaPathSegment, bB as StandardSchemaResult, bC as StandardSchemaSuccess, bD as StandardSchemaV1, bJ as SuperstructFailureLike, bK as SuperstructValidateLike, bW as ValibotIssueLike, bX as ValibotPathItemLike, bY as ValibotSafeParseLike, bZ as ValibotSafeParseResult, c2 as VineValidationErrorLike, c3 as VineValidationMessageLike, c4 as VineValidatorLike, c5 as YupSchemaLike, c6 as YupValidationErrorLike, c7 as defineRequestSchema, c8 as fromAjv, c9 as fromArkType, ca as fromIoTs, cb as fromJoi, cc as fromStandardSchema, cd as fromSuperstruct, ce as fromValibot, cf as fromVine, cg as fromYup, ch as fromZod } from './parsers-Cj4r_G4g.mjs';
5
5
  import JsonRouter from '@web-ts-toolkit/express-json-router';
6
6
  import 'zod';
7
- import 'deep-diff';
8
7
 
9
8
  type OpenApiMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
10
9
  type OpenApiSchema = Record<string, unknown>;
package/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import mongoose from 'mongoose';
2
2
  import { Response, NextFunction, Router } from 'express';
3
- import { a6 as GlobalOptions, P as DefaultModelRouterOptions, X as ExtendedDefaultModelRouterOptions, aw as ModelRouterOptions, Y as ExtendedModelRouterOptions, L as DataRouterOptions, W as ExtendedDataRouterOptions, A as AccessRouterBaseRequest, a8 as GuardHook, av as ModelRequest, J as DataRequest, cm as DataService, cn as Model, co as Service, cp as PublicService, b$ as Validation, bl as RootRouterOptions } from './parsers-Ce1grlLx.js';
4
- export { cq as AccessRouterPermissionMap, cr as AccessRouterPermissions, c as AccessRouterRequest, d as AccessRouterRequestExtensions, l as AjvErrorObjectLike, m as AjvValidatorLike, n as ArkTypeErrorsLike, o as ArkTypeLike, ab as IoTsContextEntryLike, ac as IoTsDecodeErrorLike, ad as IoTsDecoderLike, ae as JoiSchemaLike, af as JoiValidationErrorDetailLike, cs as Permissions, aR as RequestSchemaAdapter, aS as RequestSchemaFailure, aT as RequestSchemaIssue, aU as RequestSchemaLike, aV as RequestSchemaOptions, aW as RequestSchemaResult, aX as RequestSchemaSuccess, aY as RequestSchemaValidator, bw as StandardSchemaFailure, bx as StandardSchemaInferOutput, by as StandardSchemaIssue, bz as StandardSchemaPathSegment, bA as StandardSchemaResult, bB as StandardSchemaSuccess, bC as StandardSchemaV1, bI as SuperstructFailureLike, bJ as SuperstructValidateLike, bV as ValibotIssueLike, bW as ValibotPathItemLike, bX as ValibotSafeParseLike, bY as ValibotSafeParseResult, c1 as VineValidationErrorLike, c2 as VineValidationMessageLike, c3 as VineValidatorLike, c4 as YupSchemaLike, c5 as YupValidationErrorLike, c6 as defineRequestSchema, c7 as fromAjv, c8 as fromArkType, c9 as fromIoTs, ca as fromJoi, cb as fromStandardSchema, cc as fromSuperstruct, cd as fromValibot, ce as fromVine, cf as fromYup, cg as fromZod } from './parsers-Ce1grlLx.js';
3
+ import { a7 as GlobalOptions, Q as DefaultModelRouterOptions, Y as ExtendedDefaultModelRouterOptions, ax as ModelRouterOptions, Z as ExtendedModelRouterOptions, M as DataRouterOptions, X as ExtendedDataRouterOptions, A as AccessRouterBaseRequest, a9 as GuardHook, aw as ModelRequest, K as DataRequest, cn as DataService, co as Model, cp as Service, cq as PublicService, c0 as Validation, bm as RootRouterOptions } from './parsers-Cj4r_G4g.js';
4
+ export { cr as AccessRouterPermissionMap, cs as AccessRouterPermissions, c as AccessRouterRequest, d as AccessRouterRequestExtensions, l as AjvErrorObjectLike, m as AjvValidatorLike, n as ArkTypeErrorsLike, o as ArkTypeLike, ac as IoTsContextEntryLike, ad as IoTsDecodeErrorLike, ae as IoTsDecoderLike, af as JoiSchemaLike, ag as JoiValidationErrorDetailLike, ct as Permissions, aS as RequestSchemaAdapter, aT as RequestSchemaFailure, aU as RequestSchemaIssue, aV as RequestSchemaLike, aW as RequestSchemaOptions, aX as RequestSchemaResult, aY as RequestSchemaSuccess, aZ as RequestSchemaValidator, bx as StandardSchemaFailure, by as StandardSchemaInferOutput, bz as StandardSchemaIssue, bA as StandardSchemaPathSegment, bB as StandardSchemaResult, bC as StandardSchemaSuccess, bD as StandardSchemaV1, bJ as SuperstructFailureLike, bK as SuperstructValidateLike, bW as ValibotIssueLike, bX as ValibotPathItemLike, bY as ValibotSafeParseLike, bZ as ValibotSafeParseResult, c2 as VineValidationErrorLike, c3 as VineValidationMessageLike, c4 as VineValidatorLike, c5 as YupSchemaLike, c6 as YupValidationErrorLike, c7 as defineRequestSchema, c8 as fromAjv, c9 as fromArkType, ca as fromIoTs, cb as fromJoi, cc as fromStandardSchema, cd as fromSuperstruct, ce as fromValibot, cf as fromVine, cg as fromYup, ch as fromZod } from './parsers-Cj4r_G4g.js';
5
5
  import JsonRouter from '@web-ts-toolkit/express-json-router';
6
6
  import 'zod';
7
- import 'deep-diff';
8
7
 
9
8
  type OpenApiMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
10
9
  type OpenApiSchema = Record<string, unknown>;
package/index.js CHANGED
@@ -1258,7 +1258,7 @@ var Base = class {
1258
1258
 
1259
1259
  // src/services/service.ts
1260
1260
  var import_utils13 = require("@web-ts-toolkit/utils");
1261
- var import_deep_diff = __toESM(require("deep-diff"));
1261
+ var import_just_diff = require("just-diff");
1262
1262
 
1263
1263
  // src/model.ts
1264
1264
  var import_mongoose5 = __toESM(require("mongoose"));
@@ -1898,11 +1898,11 @@ var Service = class extends Base {
1898
1898
  doc = await doc.save();
1899
1899
  const diffExcludeFields = [this.options.documentPermissionField, "__v"];
1900
1900
  this.asServiceHookContext(context).diff = (d) => {
1901
- context.changes = (0, import_deep_diff.default)(
1901
+ context.changes = (0, import_just_diff.diff)(
1902
1902
  (0, import_utils13.omit)(context.originalDocumentSnapshot, diffExcludeFields),
1903
1903
  (0, import_utils13.omit)(d.toObject({ virtuals: false }), diffExcludeFields)
1904
1904
  ) || [];
1905
- context.modifiedPaths = (0, import_utils13.uniq)(context.changes.map((di) => di.path.length > 0 ? di.path[0] : ""));
1905
+ context.modifiedPaths = (0, import_utils13.uniq)(context.changes.map((di) => di.path.length > 0 ? String(di.path[0]) : ""));
1906
1906
  };
1907
1907
  doc = assertModelDocument(await this.afterPersist(doc, "update", context), this.modelName, "afterPersist");
1908
1908
  context.currentDocument = doc;
package/index.mjs CHANGED
@@ -1229,7 +1229,7 @@ import {
1229
1229
  pick as pick4,
1230
1230
  uniq as uniq2
1231
1231
  } from "@web-ts-toolkit/utils";
1232
- import diff from "deep-diff";
1232
+ import { diff } from "just-diff";
1233
1233
 
1234
1234
  // src/model.ts
1235
1235
  import mongoose3 from "mongoose";
@@ -1873,7 +1873,7 @@ var Service = class extends Base {
1873
1873
  omit(context.originalDocumentSnapshot, diffExcludeFields),
1874
1874
  omit(d.toObject({ virtuals: false }), diffExcludeFields)
1875
1875
  ) || [];
1876
- context.modifiedPaths = uniq2(context.changes.map((di) => di.path.length > 0 ? di.path[0] : ""));
1876
+ context.modifiedPaths = uniq2(context.changes.map((di) => di.path.length > 0 ? String(di.path[0]) : ""));
1877
1877
  };
1878
1878
  doc = assertModelDocument(await this.afterPersist(doc, "update", context), this.modelName, "afterPersist");
1879
1879
  context.currentDocument = doc;
package/llms.txt ADDED
@@ -0,0 +1,53 @@
1
+ # @web-ts-toolkit/access-router
2
+
3
+ ACL-aware Express routers and in-memory data services for Mongoose-backed APIs.
4
+
5
+ ## Main Patterns
6
+
7
+ ```ts
8
+ import acl from '@web-ts-toolkit/access-router';
9
+
10
+ // configure global permissions
11
+ acl.setGlobalOptions({ globalPermissions(req) { return []; } });
12
+
13
+ // model CRUD router from a Mongoose model name
14
+ const userRouter = acl.createRouter('User', { basePath: '/users' });
15
+
16
+ // in-memory data router
17
+ const fruitRouter = acl.createDataRouter('fruit', {
18
+ basePath: '/fruit',
19
+ idField: 'id',
20
+ data: [{ id: 'apple', name: 'Apple' }],
21
+ });
22
+
23
+ // OpenAPI + Swagger UI
24
+ const docsRouter = acl.createOpenApiRouter({ title: 'Example API', version: '1.0.0' });
25
+ ```
26
+
27
+ Validation adapters:
28
+
29
+ ```ts
30
+ import { fromZod, defineRequestSchema } from '@web-ts-toolkit/access-router';
31
+
32
+ const validator = fromZod(z.object({ name: z.string() }));
33
+ const schema = defineRequestSchema(validator);
34
+ ```
35
+
36
+ Subpath imports:
37
+
38
+ ```ts
39
+ import { copyAndDepopulate } from '@web-ts-toolkit/access-router/processors';
40
+ import { AccessRuntime, defaultRuntime } from '@web-ts-toolkit/access-router/advanced';
41
+ ```
42
+
43
+ ## Gotchas
44
+
45
+ - peer dependencies: `express >= 5` and `mongoose >= 8`
46
+ - default export `acl` and named exports are both available; default is preferred for the runtime API
47
+ - `createRouter('User', ...)` takes a Mongoose model name string, not the model instance
48
+ - `createDataRouter(...)` holds data in-memory; use it for lightweight/non-persisted resources
49
+
50
+ ## Pointers
51
+
52
+ - README: installation, quickstart, main exports
53
+ - website/docs/packages/access-router/: full documentation (routing, configuration, hooks, validation, openapi)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@web-ts-toolkit/access-router",
3
3
  "description": "ACL-aware Express routers and in-memory data services for Mongoose-backed APIs",
4
4
  "homepage": "https://web-ts-toolkit.pages.dev/docs/packages/access-router",
5
- "version": "0.5.0",
5
+ "version": "0.6.1",
6
6
  "sideEffects": false,
7
7
  "keywords": [
8
8
  "express",
@@ -40,9 +40,9 @@
40
40
  "node": ">=20"
41
41
  },
42
42
  "dependencies": {
43
- "@web-ts-toolkit/express-json-router": "0.5.0",
44
- "@web-ts-toolkit/utils": "0.5.0",
45
- "deep-diff": "^1.0.2",
43
+ "@web-ts-toolkit/express-json-router": "0.6.1",
44
+ "@web-ts-toolkit/utils": "0.6.1",
45
+ "just-diff": "^6.0.2",
46
46
  "mongoose-schema-jsonschema": "^4.0.1",
47
47
  "sift": "^17.1.3",
48
48
  "winston": "^3.19.0",
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  import mongoose from 'mongoose';
3
- import { Diff } from 'deep-diff';
4
3
  import express from 'express';
5
4
 
6
5
  interface BooleanObject {
@@ -562,6 +561,11 @@ interface SubPopulate {
562
561
  interface KeyValue {
563
562
  [key: string]: unknown;
564
563
  }
564
+ interface Change {
565
+ op: 'add' | 'replace' | 'remove';
566
+ path: Array<string | number>;
567
+ value?: unknown;
568
+ }
565
569
  interface ModelHookContext {
566
570
  modelName: string;
567
571
  mongooseModel: mongoose.Model<unknown>;
@@ -574,7 +578,7 @@ interface ModelHookContext {
574
578
  preparedData?: Record<string, unknown>;
575
579
  allowedFields?: string[];
576
580
  modifiedPaths?: string[];
577
- changes?: Diff<unknown>[];
581
+ changes?: Change[];
578
582
  docPermissions?: KeyValue;
579
583
  resolvedQuery?: {
580
584
  filter?: Filter;
@@ -843,7 +847,7 @@ type HookChain<TValue, TContext, TRequest extends AccessRouterRequest = AccessRo
843
847
  type ValidateRule = boolean | unknown[];
844
848
  type ValidateHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, allowedData: unknown, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<ValidateRule>;
845
849
  type DocPermissionsHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, doc: unknown, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<Record<string, unknown>>;
846
- type ChangeHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, previousValue: unknown, nextValue: unknown, changes: Diff<unknown>[], context: ModelHookContext) => MaybePromise<void>;
850
+ type ChangeHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, previousValue: unknown, nextValue: unknown, changes: Change[], context: ModelHookContext) => MaybePromise<void>;
847
851
  type DeleteHook<TValue = unknown, TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, value: TValue, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<void>;
848
852
  type DocumentHook<TValue, TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, value: ModelDocument<TValue>, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<ModelDocument<TValue>>;
849
853
  type DocumentHookChain<TValue, TRequest extends AccessRouterRequest = AccessRouterRequest> = DocumentHook<TValue, TRequest> | Array<DocumentHook<TValue, TRequest>>;
@@ -1405,7 +1409,19 @@ declare function parseQuery<TSchema extends z.ZodTypeAny>(schema: TSchema, value
1405
1409
  declare function parseBody<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown): z.output<TSchema>;
1406
1410
  declare function parseBodyWithSchema<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown, userSchema?: RequestSchemaLike): Promise<z.output<TSchema>>;
1407
1411
  declare function parseNestedBodyWithSchema(schema: z.ZodTypeAny, value: unknown, nestedKey: string, userSchema?: RequestSchemaLike): Promise<Record<string, unknown>>;
1412
+ /**
1413
+ * Wraps a request validator into a request schema adapter used by `access-router`.
1414
+ *
1415
+ * @example
1416
+ * const schema = defineRequestSchema(fromZod(z.object({ name: z.string() })));
1417
+ */
1408
1418
  declare function defineRequestSchema<T = unknown>(validator: RequestSchemaValidator<T>, options?: RequestSchemaOptions): RequestSchemaAdapter<T>;
1419
+ /**
1420
+ * Adapts a Zod schema into a `RequestSchemaValidator` for `access-router`.
1421
+ *
1422
+ * @example
1423
+ * const validator = fromZod(z.object({ name: z.string() }));
1424
+ */
1409
1425
  declare function fromZod<TSchema extends z.ZodTypeAny>(schema: TSchema): RequestSchemaValidator<z.output<TSchema>>;
1410
1426
  declare function fromStandardSchema<TSchema extends StandardSchemaV1>(schema: TSchema): RequestSchemaValidator<StandardSchemaInferOutput<TSchema>>;
1411
1427
  declare function fromYup<TSchema extends YupSchemaLike>(schema: TSchema): RequestSchemaValidator;
@@ -1417,4 +1433,4 @@ declare function fromIoTs<TValue = unknown>(decoder: IoTsDecoderLike<TValue>): R
1417
1433
  declare function fromSuperstruct<TStruct, TOutput = unknown>(struct: TStruct, validate: SuperstructValidateLike): RequestSchemaValidator<TOutput>;
1418
1434
  declare function fromVine<TValue = unknown>(validator: VineValidatorLike<TValue>): RequestSchemaValidator<TValue>;
1419
1435
 
1420
- export { type FindAccess as $, type AccessRouterBaseRequest as A, type BaseFilterAccess as B, Codes as C, type DataBaseFilterHook as D, type DataHook as E, type DataHookContext as F, type DataIdentifierHook as G, type DataListHook as H, type DataOverrideFilterHook as I, type DataRequest as J, type DataRequestSchemas as K, type DataRouterOptions as L, type DecorateAccess as M, type DecorateAllAccess as N, type DeepFieldPath as O, type DefaultModelRouterOptions as P, type Defaults as Q, type DistinctArgs as R, type DistinctBody as S, type DocPermissionsAccess as T, type ErrorResult as U, type ExistsOptions as V, type ExtendedDataRouterOptions as W, type ExtendedDefaultModelRouterOptions as X, type ExtendedModelRouterOptions as Y, type Filter as Z, FilterOperator as _, type AccessRouterFieldKey as a, type RootDataOperation as a$, type FindArgs as a0, type FindByIdArgs as a1, type FindByIdOptions as a2, type FindOneArgs as a3, type FindOneOptions as a4, type FindOptions as a5, type GlobalOptions as a6, type GlobalPermissionValue as a7, type GuardHook as a8, type IdentifierHook as a9, type Populate as aA, type PopulateAccess as aB, type PrepareAccess as aC, type Projection as aD, type PublicCreateArgs as aE, type PublicCreateOptions as aF, type PublicListArgs as aG, type PublicListOptions as aH, type PublicOutput as aI, type PublicReadArgs as aJ, type PublicReadOptions as aK, type PublicUpdateArgs as aL, type PublicUpdateOptions as aM, type PublicUpsertArgs as aN, type PublicUpsertOptions as aO, type ReadQueryInput as aP, type Request as aQ, type RequestSchemaAdapter as aR, type RequestSchemaFailure as aS, type RequestSchemaIssue as aT, type RequestSchemaLike as aU, type RequestSchemaOptions as aV, type RequestSchemaResult as aW, type RequestSchemaSuccess as aX, type RequestSchemaValidator as aY, type RequestSchemas as aZ, type RootDataListQueryEntry as a_, type Include as aa, type IoTsContextEntryLike as ab, type IoTsDecodeErrorLike as ac, type IoTsDecoderLike as ad, type JoiSchemaLike as ae, type JoiValidationErrorDetailLike as af, type KeyValueProjection as ag, type ListQueryInput as ah, type ListResult as ai, type MaybePromise as aj, type ModelBaseFilterHook as ak, type ModelChangeHook as al, type ModelDeleteHook as am, type ModelDocPermissionsHook as an, type ModelDocument as ao, type ModelDocumentHook as ap, type ModelHook as aq, type ModelHookContext as ar, type ModelIdentifierHook as as, type ModelListHook as at, type ModelOverrideFilterHook as au, type ModelRequest as av, type ModelRouterOptions as aw, type ModelValidateHook as ax, type PathValue as ay, type PermissionSchema as az, type AccessRouterLogger as b, type Validation as b$, type RootDataReadByFilterQueryEntry as b0, type RootDataReadByIdQueryEntry as b1, type RootModelCountQueryEntry as b2, type RootModelCreateQueryEntry as b3, type RootModelDeleteQueryEntry as b4, type RootModelDistinctQueryEntry as b5, type RootModelListQueryEntry as b6, type RootModelNewQueryEntry as b7, type RootModelOperation as b8, type RootModelReadByFilterQueryEntry as b9, type StandardSchemaResult as bA, type StandardSchemaSuccess as bB, type StandardSchemaV1 as bC, StatusCodes as bD, type SubListBody as bE, type SubPopulate as bF, type SubQueryEntry as bG, type SubReadBody as bH, type SuperstructFailureLike as bI, type SuperstructValidateLike as bJ, type Task as bK, type TransformAccess as bL, type TypedFilter as bM, type UpdateByIdArgs as bN, type UpdateByIdOptions as bO, type UpdateOneArgs as bP, type UpdateOneOptions as bQ, type UpdateQueryInput as bR, type UpsertArgs as bS, type UpsertOptions as bT, type UpsertQueryInput as bU, type ValibotIssueLike as bV, type ValibotPathItemLike as bW, type ValibotSafeParseLike as bX, type ValibotSafeParseResult as bY, type ValidateAccess as bZ, type ValidateRule as b_, type RootModelReadByIdQueryEntry as ba, type RootModelSubBulkUpdateQueryEntry as bb, type RootModelSubCreateQueryEntry as bc, type RootModelSubDeleteQueryEntry as bd, type RootModelSubListQueryEntry as be, type RootModelSubReadQueryEntry as bf, type RootModelSubUpdateQueryEntry as bg, type RootModelUpdateQueryEntry as bh, type RootModelUpsertQueryEntry as bi, type RootOperationResult as bj, type RootQueryEntry as bk, type RootRouterOptions as bl, type RootSubOperation as bm, type RootTarget as bn, type RouteGuardAccess as bo, type SelectAccess as bp, type SelectedPopulatedPublicOutput as bq, type SelectedPublicOutput as br, type ServiceResult as bs, type SingleResult as bt, type Sort as bu, type SortOrder as bv, type StandardSchemaFailure as bw, type StandardSchemaInferOutput as bx, type StandardSchemaIssue as by, type StandardSchemaPathSegment as bz, type AccessRouterRequest as c, type ValidationError as c0, type VineValidationErrorLike as c1, type VineValidationMessageLike as c2, type VineValidatorLike as c3, type YupSchemaLike as c4, type YupValidationErrorLike as c5, defineRequestSchema as c6, fromAjv as c7, fromArkType as c8, fromIoTs as c9, fromJoi as ca, fromStandardSchema as cb, fromSuperstruct as cc, fromValibot as cd, fromVine as ce, fromYup as cf, fromZod as cg, parseBody as ch, parseBodyWithSchema as ci, parseNestedBodyWithSchema as cj, parsePathParam as ck, parseQuery as cl, DataService as cm, Model as cn, Service as co, PublicService as cp, type AccessRouterPermissionMap as cq, type AccessRouterPermissions as cr, type Permissions as cs, type AccessRouterRequestExtensions as d, type AdvancedCreateBody as e, type AdvancedListBody as f, type AdvancedReadBody as g, type AdvancedReadFilterBody as h, type AdvancedUpdateBody as i, type AdvancedUpsertBody as j, type AfterPersistAccess as k, type AjvErrorObjectLike as l, type AjvValidatorLike as m, type ArkTypeErrorsLike as n, type ArkTypeLike as o, type ArkTypeProblemLike as p, type CountBody as q, type CreateArgs as r, type CreateOptions as s, type CreateQueryInput as t, CustomHeaders as u, type DataFilter as v, type DataFindArgs as w, type DataFindOneArgs as x, type DataFindOneOptions as y, type DataFindOptions as z };
1436
+ export { FilterOperator as $, type AccessRouterBaseRequest as A, type BaseFilterAccess as B, type Change as C, type DataBaseFilterHook as D, type DataFindOptions as E, type DataHook as F, type DataHookContext as G, type DataIdentifierHook as H, type DataListHook as I, type DataOverrideFilterHook as J, type DataRequest as K, type DataRequestSchemas as L, type DataRouterOptions as M, type DecorateAccess as N, type DecorateAllAccess as O, type DeepFieldPath as P, type DefaultModelRouterOptions as Q, type Defaults as R, type DistinctArgs as S, type DistinctBody as T, type DocPermissionsAccess as U, type ErrorResult as V, type ExistsOptions as W, type ExtendedDataRouterOptions as X, type ExtendedDefaultModelRouterOptions as Y, type ExtendedModelRouterOptions as Z, type Filter as _, type AccessRouterFieldKey as a, type RootDataListQueryEntry as a$, type FindAccess as a0, type FindArgs as a1, type FindByIdArgs as a2, type FindByIdOptions as a3, type FindOneArgs as a4, type FindOneOptions as a5, type FindOptions as a6, type GlobalOptions as a7, type GlobalPermissionValue as a8, type GuardHook as a9, type PermissionSchema as aA, type Populate as aB, type PopulateAccess as aC, type PrepareAccess as aD, type Projection as aE, type PublicCreateArgs as aF, type PublicCreateOptions as aG, type PublicListArgs as aH, type PublicListOptions as aI, type PublicOutput as aJ, type PublicReadArgs as aK, type PublicReadOptions as aL, type PublicUpdateArgs as aM, type PublicUpdateOptions as aN, type PublicUpsertArgs as aO, type PublicUpsertOptions as aP, type ReadQueryInput as aQ, type Request as aR, type RequestSchemaAdapter as aS, type RequestSchemaFailure as aT, type RequestSchemaIssue as aU, type RequestSchemaLike as aV, type RequestSchemaOptions as aW, type RequestSchemaResult as aX, type RequestSchemaSuccess as aY, type RequestSchemaValidator as aZ, type RequestSchemas as a_, type IdentifierHook as aa, type Include as ab, type IoTsContextEntryLike as ac, type IoTsDecodeErrorLike as ad, type IoTsDecoderLike as ae, type JoiSchemaLike as af, type JoiValidationErrorDetailLike as ag, type KeyValueProjection as ah, type ListQueryInput as ai, type ListResult as aj, type MaybePromise as ak, type ModelBaseFilterHook as al, type ModelChangeHook as am, type ModelDeleteHook as an, type ModelDocPermissionsHook as ao, type ModelDocument as ap, type ModelDocumentHook as aq, type ModelHook as ar, type ModelHookContext as as, type ModelIdentifierHook as at, type ModelListHook as au, type ModelOverrideFilterHook as av, type ModelRequest as aw, type ModelRouterOptions as ax, type ModelValidateHook as ay, type PathValue as az, type AccessRouterLogger as b, type ValidateRule as b$, type RootDataOperation as b0, type RootDataReadByFilterQueryEntry as b1, type RootDataReadByIdQueryEntry as b2, type RootModelCountQueryEntry as b3, type RootModelCreateQueryEntry as b4, type RootModelDeleteQueryEntry as b5, type RootModelDistinctQueryEntry as b6, type RootModelListQueryEntry as b7, type RootModelNewQueryEntry as b8, type RootModelOperation as b9, type StandardSchemaPathSegment as bA, type StandardSchemaResult as bB, type StandardSchemaSuccess as bC, type StandardSchemaV1 as bD, StatusCodes as bE, type SubListBody as bF, type SubPopulate as bG, type SubQueryEntry as bH, type SubReadBody as bI, type SuperstructFailureLike as bJ, type SuperstructValidateLike as bK, type Task as bL, type TransformAccess as bM, type TypedFilter as bN, type UpdateByIdArgs as bO, type UpdateByIdOptions as bP, type UpdateOneArgs as bQ, type UpdateOneOptions as bR, type UpdateQueryInput as bS, type UpsertArgs as bT, type UpsertOptions as bU, type UpsertQueryInput as bV, type ValibotIssueLike as bW, type ValibotPathItemLike as bX, type ValibotSafeParseLike as bY, type ValibotSafeParseResult as bZ, type ValidateAccess as b_, type RootModelReadByFilterQueryEntry as ba, type RootModelReadByIdQueryEntry as bb, type RootModelSubBulkUpdateQueryEntry as bc, type RootModelSubCreateQueryEntry as bd, type RootModelSubDeleteQueryEntry as be, type RootModelSubListQueryEntry as bf, type RootModelSubReadQueryEntry as bg, type RootModelSubUpdateQueryEntry as bh, type RootModelUpdateQueryEntry as bi, type RootModelUpsertQueryEntry as bj, type RootOperationResult as bk, type RootQueryEntry as bl, type RootRouterOptions as bm, type RootSubOperation as bn, type RootTarget as bo, type RouteGuardAccess as bp, type SelectAccess as bq, type SelectedPopulatedPublicOutput as br, type SelectedPublicOutput as bs, type ServiceResult as bt, type SingleResult as bu, type Sort as bv, type SortOrder as bw, type StandardSchemaFailure as bx, type StandardSchemaInferOutput as by, type StandardSchemaIssue as bz, type AccessRouterRequest as c, type Validation as c0, type ValidationError as c1, type VineValidationErrorLike as c2, type VineValidationMessageLike as c3, type VineValidatorLike as c4, type YupSchemaLike as c5, type YupValidationErrorLike as c6, defineRequestSchema as c7, fromAjv as c8, fromArkType as c9, fromIoTs as ca, fromJoi as cb, fromStandardSchema as cc, fromSuperstruct as cd, fromValibot as ce, fromVine as cf, fromYup as cg, fromZod as ch, parseBody as ci, parseBodyWithSchema as cj, parseNestedBodyWithSchema as ck, parsePathParam as cl, parseQuery as cm, DataService as cn, Model as co, Service as cp, PublicService as cq, type AccessRouterPermissionMap as cr, type AccessRouterPermissions as cs, type Permissions as ct, type AccessRouterRequestExtensions as d, type AdvancedCreateBody as e, type AdvancedListBody as f, type AdvancedReadBody as g, type AdvancedReadFilterBody as h, type AdvancedUpdateBody as i, type AdvancedUpsertBody as j, type AfterPersistAccess as k, type AjvErrorObjectLike as l, type AjvValidatorLike as m, type ArkTypeErrorsLike as n, type ArkTypeLike as o, type ArkTypeProblemLike as p, Codes as q, type CountBody as r, type CreateArgs as s, type CreateOptions as t, type CreateQueryInput as u, CustomHeaders as v, type DataFilter as w, type DataFindArgs as x, type DataFindOneArgs as y, type DataFindOneOptions as z };
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  import mongoose from 'mongoose';
3
- import { Diff } from 'deep-diff';
4
3
  import express from 'express';
5
4
 
6
5
  interface BooleanObject {
@@ -562,6 +561,11 @@ interface SubPopulate {
562
561
  interface KeyValue {
563
562
  [key: string]: unknown;
564
563
  }
564
+ interface Change {
565
+ op: 'add' | 'replace' | 'remove';
566
+ path: Array<string | number>;
567
+ value?: unknown;
568
+ }
565
569
  interface ModelHookContext {
566
570
  modelName: string;
567
571
  mongooseModel: mongoose.Model<unknown>;
@@ -574,7 +578,7 @@ interface ModelHookContext {
574
578
  preparedData?: Record<string, unknown>;
575
579
  allowedFields?: string[];
576
580
  modifiedPaths?: string[];
577
- changes?: Diff<unknown>[];
581
+ changes?: Change[];
578
582
  docPermissions?: KeyValue;
579
583
  resolvedQuery?: {
580
584
  filter?: Filter;
@@ -843,7 +847,7 @@ type HookChain<TValue, TContext, TRequest extends AccessRouterRequest = AccessRo
843
847
  type ValidateRule = boolean | unknown[];
844
848
  type ValidateHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, allowedData: unknown, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<ValidateRule>;
845
849
  type DocPermissionsHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, doc: unknown, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<Record<string, unknown>>;
846
- type ChangeHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, previousValue: unknown, nextValue: unknown, changes: Diff<unknown>[], context: ModelHookContext) => MaybePromise<void>;
850
+ type ChangeHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, previousValue: unknown, nextValue: unknown, changes: Change[], context: ModelHookContext) => MaybePromise<void>;
847
851
  type DeleteHook<TValue = unknown, TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, value: TValue, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<void>;
848
852
  type DocumentHook<TValue, TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, value: ModelDocument<TValue>, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<ModelDocument<TValue>>;
849
853
  type DocumentHookChain<TValue, TRequest extends AccessRouterRequest = AccessRouterRequest> = DocumentHook<TValue, TRequest> | Array<DocumentHook<TValue, TRequest>>;
@@ -1405,7 +1409,19 @@ declare function parseQuery<TSchema extends z.ZodTypeAny>(schema: TSchema, value
1405
1409
  declare function parseBody<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown): z.output<TSchema>;
1406
1410
  declare function parseBodyWithSchema<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown, userSchema?: RequestSchemaLike): Promise<z.output<TSchema>>;
1407
1411
  declare function parseNestedBodyWithSchema(schema: z.ZodTypeAny, value: unknown, nestedKey: string, userSchema?: RequestSchemaLike): Promise<Record<string, unknown>>;
1412
+ /**
1413
+ * Wraps a request validator into a request schema adapter used by `access-router`.
1414
+ *
1415
+ * @example
1416
+ * const schema = defineRequestSchema(fromZod(z.object({ name: z.string() })));
1417
+ */
1408
1418
  declare function defineRequestSchema<T = unknown>(validator: RequestSchemaValidator<T>, options?: RequestSchemaOptions): RequestSchemaAdapter<T>;
1419
+ /**
1420
+ * Adapts a Zod schema into a `RequestSchemaValidator` for `access-router`.
1421
+ *
1422
+ * @example
1423
+ * const validator = fromZod(z.object({ name: z.string() }));
1424
+ */
1409
1425
  declare function fromZod<TSchema extends z.ZodTypeAny>(schema: TSchema): RequestSchemaValidator<z.output<TSchema>>;
1410
1426
  declare function fromStandardSchema<TSchema extends StandardSchemaV1>(schema: TSchema): RequestSchemaValidator<StandardSchemaInferOutput<TSchema>>;
1411
1427
  declare function fromYup<TSchema extends YupSchemaLike>(schema: TSchema): RequestSchemaValidator;
@@ -1417,4 +1433,4 @@ declare function fromIoTs<TValue = unknown>(decoder: IoTsDecoderLike<TValue>): R
1417
1433
  declare function fromSuperstruct<TStruct, TOutput = unknown>(struct: TStruct, validate: SuperstructValidateLike): RequestSchemaValidator<TOutput>;
1418
1434
  declare function fromVine<TValue = unknown>(validator: VineValidatorLike<TValue>): RequestSchemaValidator<TValue>;
1419
1435
 
1420
- export { type FindAccess as $, type AccessRouterBaseRequest as A, type BaseFilterAccess as B, Codes as C, type DataBaseFilterHook as D, type DataHook as E, type DataHookContext as F, type DataIdentifierHook as G, type DataListHook as H, type DataOverrideFilterHook as I, type DataRequest as J, type DataRequestSchemas as K, type DataRouterOptions as L, type DecorateAccess as M, type DecorateAllAccess as N, type DeepFieldPath as O, type DefaultModelRouterOptions as P, type Defaults as Q, type DistinctArgs as R, type DistinctBody as S, type DocPermissionsAccess as T, type ErrorResult as U, type ExistsOptions as V, type ExtendedDataRouterOptions as W, type ExtendedDefaultModelRouterOptions as X, type ExtendedModelRouterOptions as Y, type Filter as Z, FilterOperator as _, type AccessRouterFieldKey as a, type RootDataOperation as a$, type FindArgs as a0, type FindByIdArgs as a1, type FindByIdOptions as a2, type FindOneArgs as a3, type FindOneOptions as a4, type FindOptions as a5, type GlobalOptions as a6, type GlobalPermissionValue as a7, type GuardHook as a8, type IdentifierHook as a9, type Populate as aA, type PopulateAccess as aB, type PrepareAccess as aC, type Projection as aD, type PublicCreateArgs as aE, type PublicCreateOptions as aF, type PublicListArgs as aG, type PublicListOptions as aH, type PublicOutput as aI, type PublicReadArgs as aJ, type PublicReadOptions as aK, type PublicUpdateArgs as aL, type PublicUpdateOptions as aM, type PublicUpsertArgs as aN, type PublicUpsertOptions as aO, type ReadQueryInput as aP, type Request as aQ, type RequestSchemaAdapter as aR, type RequestSchemaFailure as aS, type RequestSchemaIssue as aT, type RequestSchemaLike as aU, type RequestSchemaOptions as aV, type RequestSchemaResult as aW, type RequestSchemaSuccess as aX, type RequestSchemaValidator as aY, type RequestSchemas as aZ, type RootDataListQueryEntry as a_, type Include as aa, type IoTsContextEntryLike as ab, type IoTsDecodeErrorLike as ac, type IoTsDecoderLike as ad, type JoiSchemaLike as ae, type JoiValidationErrorDetailLike as af, type KeyValueProjection as ag, type ListQueryInput as ah, type ListResult as ai, type MaybePromise as aj, type ModelBaseFilterHook as ak, type ModelChangeHook as al, type ModelDeleteHook as am, type ModelDocPermissionsHook as an, type ModelDocument as ao, type ModelDocumentHook as ap, type ModelHook as aq, type ModelHookContext as ar, type ModelIdentifierHook as as, type ModelListHook as at, type ModelOverrideFilterHook as au, type ModelRequest as av, type ModelRouterOptions as aw, type ModelValidateHook as ax, type PathValue as ay, type PermissionSchema as az, type AccessRouterLogger as b, type Validation as b$, type RootDataReadByFilterQueryEntry as b0, type RootDataReadByIdQueryEntry as b1, type RootModelCountQueryEntry as b2, type RootModelCreateQueryEntry as b3, type RootModelDeleteQueryEntry as b4, type RootModelDistinctQueryEntry as b5, type RootModelListQueryEntry as b6, type RootModelNewQueryEntry as b7, type RootModelOperation as b8, type RootModelReadByFilterQueryEntry as b9, type StandardSchemaResult as bA, type StandardSchemaSuccess as bB, type StandardSchemaV1 as bC, StatusCodes as bD, type SubListBody as bE, type SubPopulate as bF, type SubQueryEntry as bG, type SubReadBody as bH, type SuperstructFailureLike as bI, type SuperstructValidateLike as bJ, type Task as bK, type TransformAccess as bL, type TypedFilter as bM, type UpdateByIdArgs as bN, type UpdateByIdOptions as bO, type UpdateOneArgs as bP, type UpdateOneOptions as bQ, type UpdateQueryInput as bR, type UpsertArgs as bS, type UpsertOptions as bT, type UpsertQueryInput as bU, type ValibotIssueLike as bV, type ValibotPathItemLike as bW, type ValibotSafeParseLike as bX, type ValibotSafeParseResult as bY, type ValidateAccess as bZ, type ValidateRule as b_, type RootModelReadByIdQueryEntry as ba, type RootModelSubBulkUpdateQueryEntry as bb, type RootModelSubCreateQueryEntry as bc, type RootModelSubDeleteQueryEntry as bd, type RootModelSubListQueryEntry as be, type RootModelSubReadQueryEntry as bf, type RootModelSubUpdateQueryEntry as bg, type RootModelUpdateQueryEntry as bh, type RootModelUpsertQueryEntry as bi, type RootOperationResult as bj, type RootQueryEntry as bk, type RootRouterOptions as bl, type RootSubOperation as bm, type RootTarget as bn, type RouteGuardAccess as bo, type SelectAccess as bp, type SelectedPopulatedPublicOutput as bq, type SelectedPublicOutput as br, type ServiceResult as bs, type SingleResult as bt, type Sort as bu, type SortOrder as bv, type StandardSchemaFailure as bw, type StandardSchemaInferOutput as bx, type StandardSchemaIssue as by, type StandardSchemaPathSegment as bz, type AccessRouterRequest as c, type ValidationError as c0, type VineValidationErrorLike as c1, type VineValidationMessageLike as c2, type VineValidatorLike as c3, type YupSchemaLike as c4, type YupValidationErrorLike as c5, defineRequestSchema as c6, fromAjv as c7, fromArkType as c8, fromIoTs as c9, fromJoi as ca, fromStandardSchema as cb, fromSuperstruct as cc, fromValibot as cd, fromVine as ce, fromYup as cf, fromZod as cg, parseBody as ch, parseBodyWithSchema as ci, parseNestedBodyWithSchema as cj, parsePathParam as ck, parseQuery as cl, DataService as cm, Model as cn, Service as co, PublicService as cp, type AccessRouterPermissionMap as cq, type AccessRouterPermissions as cr, type Permissions as cs, type AccessRouterRequestExtensions as d, type AdvancedCreateBody as e, type AdvancedListBody as f, type AdvancedReadBody as g, type AdvancedReadFilterBody as h, type AdvancedUpdateBody as i, type AdvancedUpsertBody as j, type AfterPersistAccess as k, type AjvErrorObjectLike as l, type AjvValidatorLike as m, type ArkTypeErrorsLike as n, type ArkTypeLike as o, type ArkTypeProblemLike as p, type CountBody as q, type CreateArgs as r, type CreateOptions as s, type CreateQueryInput as t, CustomHeaders as u, type DataFilter as v, type DataFindArgs as w, type DataFindOneArgs as x, type DataFindOneOptions as y, type DataFindOptions as z };
1436
+ export { FilterOperator as $, type AccessRouterBaseRequest as A, type BaseFilterAccess as B, type Change as C, type DataBaseFilterHook as D, type DataFindOptions as E, type DataHook as F, type DataHookContext as G, type DataIdentifierHook as H, type DataListHook as I, type DataOverrideFilterHook as J, type DataRequest as K, type DataRequestSchemas as L, type DataRouterOptions as M, type DecorateAccess as N, type DecorateAllAccess as O, type DeepFieldPath as P, type DefaultModelRouterOptions as Q, type Defaults as R, type DistinctArgs as S, type DistinctBody as T, type DocPermissionsAccess as U, type ErrorResult as V, type ExistsOptions as W, type ExtendedDataRouterOptions as X, type ExtendedDefaultModelRouterOptions as Y, type ExtendedModelRouterOptions as Z, type Filter as _, type AccessRouterFieldKey as a, type RootDataListQueryEntry as a$, type FindAccess as a0, type FindArgs as a1, type FindByIdArgs as a2, type FindByIdOptions as a3, type FindOneArgs as a4, type FindOneOptions as a5, type FindOptions as a6, type GlobalOptions as a7, type GlobalPermissionValue as a8, type GuardHook as a9, type PermissionSchema as aA, type Populate as aB, type PopulateAccess as aC, type PrepareAccess as aD, type Projection as aE, type PublicCreateArgs as aF, type PublicCreateOptions as aG, type PublicListArgs as aH, type PublicListOptions as aI, type PublicOutput as aJ, type PublicReadArgs as aK, type PublicReadOptions as aL, type PublicUpdateArgs as aM, type PublicUpdateOptions as aN, type PublicUpsertArgs as aO, type PublicUpsertOptions as aP, type ReadQueryInput as aQ, type Request as aR, type RequestSchemaAdapter as aS, type RequestSchemaFailure as aT, type RequestSchemaIssue as aU, type RequestSchemaLike as aV, type RequestSchemaOptions as aW, type RequestSchemaResult as aX, type RequestSchemaSuccess as aY, type RequestSchemaValidator as aZ, type RequestSchemas as a_, type IdentifierHook as aa, type Include as ab, type IoTsContextEntryLike as ac, type IoTsDecodeErrorLike as ad, type IoTsDecoderLike as ae, type JoiSchemaLike as af, type JoiValidationErrorDetailLike as ag, type KeyValueProjection as ah, type ListQueryInput as ai, type ListResult as aj, type MaybePromise as ak, type ModelBaseFilterHook as al, type ModelChangeHook as am, type ModelDeleteHook as an, type ModelDocPermissionsHook as ao, type ModelDocument as ap, type ModelDocumentHook as aq, type ModelHook as ar, type ModelHookContext as as, type ModelIdentifierHook as at, type ModelListHook as au, type ModelOverrideFilterHook as av, type ModelRequest as aw, type ModelRouterOptions as ax, type ModelValidateHook as ay, type PathValue as az, type AccessRouterLogger as b, type ValidateRule as b$, type RootDataOperation as b0, type RootDataReadByFilterQueryEntry as b1, type RootDataReadByIdQueryEntry as b2, type RootModelCountQueryEntry as b3, type RootModelCreateQueryEntry as b4, type RootModelDeleteQueryEntry as b5, type RootModelDistinctQueryEntry as b6, type RootModelListQueryEntry as b7, type RootModelNewQueryEntry as b8, type RootModelOperation as b9, type StandardSchemaPathSegment as bA, type StandardSchemaResult as bB, type StandardSchemaSuccess as bC, type StandardSchemaV1 as bD, StatusCodes as bE, type SubListBody as bF, type SubPopulate as bG, type SubQueryEntry as bH, type SubReadBody as bI, type SuperstructFailureLike as bJ, type SuperstructValidateLike as bK, type Task as bL, type TransformAccess as bM, type TypedFilter as bN, type UpdateByIdArgs as bO, type UpdateByIdOptions as bP, type UpdateOneArgs as bQ, type UpdateOneOptions as bR, type UpdateQueryInput as bS, type UpsertArgs as bT, type UpsertOptions as bU, type UpsertQueryInput as bV, type ValibotIssueLike as bW, type ValibotPathItemLike as bX, type ValibotSafeParseLike as bY, type ValibotSafeParseResult as bZ, type ValidateAccess as b_, type RootModelReadByFilterQueryEntry as ba, type RootModelReadByIdQueryEntry as bb, type RootModelSubBulkUpdateQueryEntry as bc, type RootModelSubCreateQueryEntry as bd, type RootModelSubDeleteQueryEntry as be, type RootModelSubListQueryEntry as bf, type RootModelSubReadQueryEntry as bg, type RootModelSubUpdateQueryEntry as bh, type RootModelUpdateQueryEntry as bi, type RootModelUpsertQueryEntry as bj, type RootOperationResult as bk, type RootQueryEntry as bl, type RootRouterOptions as bm, type RootSubOperation as bn, type RootTarget as bo, type RouteGuardAccess as bp, type SelectAccess as bq, type SelectedPopulatedPublicOutput as br, type SelectedPublicOutput as bs, type ServiceResult as bt, type SingleResult as bu, type Sort as bv, type SortOrder as bw, type StandardSchemaFailure as bx, type StandardSchemaInferOutput as by, type StandardSchemaIssue as bz, type AccessRouterRequest as c, type Validation as c0, type ValidationError as c1, type VineValidationErrorLike as c2, type VineValidationMessageLike as c3, type VineValidatorLike as c4, type YupSchemaLike as c5, type YupValidationErrorLike as c6, defineRequestSchema as c7, fromAjv as c8, fromArkType as c9, fromIoTs as ca, fromJoi as cb, fromStandardSchema as cc, fromSuperstruct as cd, fromValibot as ce, fromVine as cf, fromYup as cg, fromZod as ch, parseBody as ci, parseBodyWithSchema as cj, parseNestedBodyWithSchema as ck, parsePathParam as cl, parseQuery as cm, DataService as cn, Model as co, Service as cp, PublicService as cq, type AccessRouterPermissionMap as cr, type AccessRouterPermissions as cs, type Permissions as ct, type AccessRouterRequestExtensions as d, type AdvancedCreateBody as e, type AdvancedListBody as f, type AdvancedReadBody as g, type AdvancedReadFilterBody as h, type AdvancedUpdateBody as i, type AdvancedUpsertBody as j, type AfterPersistAccess as k, type AjvErrorObjectLike as l, type AjvValidatorLike as m, type ArkTypeErrorsLike as n, type ArkTypeLike as o, type ArkTypeProblemLike as p, Codes as q, type CountBody as r, type CreateArgs as s, type CreateOptions as t, type CreateQueryInput as u, CustomHeaders as v, type DataFilter as w, type DataFindArgs as x, type DataFindOneArgs as y, type DataFindOneOptions as z };