@web-ts-toolkit/access-router 0.4.0 → 0.6.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/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
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@web-ts-toolkit/access-router",
3
- "description": "Access-policy Express routers and in-memory data services for Mongoose-backed APIs",
4
- "version": "0.4.0",
3
+ "description": "ACL-aware Express routers and in-memory data services for Mongoose-backed APIs",
4
+ "homepage": "https://web-ts-toolkit.pages.dev/docs/packages/access-router",
5
+ "version": "0.6.0",
6
+ "sideEffects": false,
5
7
  "keywords": [
6
8
  "express",
7
9
  "mongoose",
8
- "access",
10
+ "acl",
11
+ "crud",
12
+ "openapi",
9
13
  "access-router",
10
14
  "router"
11
15
  ],
@@ -32,12 +36,15 @@
32
36
  "default": "./processors.js"
33
37
  }
34
38
  },
39
+ "engines": {
40
+ "node": ">=20"
41
+ },
35
42
  "dependencies": {
36
- "@web-ts-toolkit/express-json-router": "0.4.0",
37
- "deep-diff": "^1.0.2",
43
+ "@web-ts-toolkit/express-json-router": "0.6.0",
44
+ "@web-ts-toolkit/utils": "0.6.0",
45
+ "just-diff": "^6.0.2",
38
46
  "mongoose-schema-jsonschema": "^4.0.1",
39
47
  "sift": "^17.1.3",
40
- "@web-ts-toolkit/utils": "0.4.0",
41
48
  "winston": "^3.19.0",
42
49
  "zod": "^4.1.12"
43
50
  },
@@ -49,9 +56,6 @@
49
56
  "bugs": {
50
57
  "url": "https://github.com/egose/web-ts-toolkit/issues"
51
58
  },
52
- "engines": {
53
- "node": ">=20"
54
- },
55
59
  "license": "Apache-2.0",
56
60
  "repository": {
57
61
  "type": "git",
@@ -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 {
@@ -26,8 +25,8 @@ type Permissions = Permission;
26
25
  type AccessRouterPermissions = Permission;
27
26
 
28
27
  declare class Base<TModel = unknown> {
29
- req: ModelRequest;
30
- modelName: string;
28
+ protected req: ModelRequest;
29
+ protected modelName: string;
31
30
  constructor(req: ModelRequest, modelName: string);
32
31
  decorate<T>(doc: T, access: DecorateAccess, context: ModelHookContext): Promise<T>;
33
32
  decorateAll<T>(docs: T[], access: DecorateAllAccess, context: ModelHookContext): Promise<T[]>;
@@ -98,19 +97,17 @@ declare class Model {
98
97
  find({ filter, select, sort, populate, limit, skip, lean }: FindProps): mongoose.Query<any[], any, {}, any, "find", {}>;
99
98
  validateSort(sort: SortType, logError?: (msg: string, ...args: unknown[]) => void): boolean;
100
99
  findOne({ filter, select, sort, populate, lean }: FindOneProps): mongoose.Query<any, any, {}, any, "findOne", {}>;
101
- findOneAndDelete(filter: any): mongoose.Query<any, any, {}, any, "findOneAndDelete", {}>;
102
100
  exists(filter: any): mongoose.Query<any, any, {}, any, "findOne", {}>;
103
101
  countDocuments(filter?: {}): mongoose.Query<number, any, {}, any, "countDocuments", {}>;
104
- estimatedDocumentCount(): mongoose.Query<number, any, {}, any, "estimatedDocumentCount", {}>;
105
102
  distinct(field: string, conditions?: {}): mongoose.Query<any[], any, {}, any, "distinct", {}>;
106
103
  }
107
104
 
108
105
  declare class Service<TModel = unknown> extends Base<TModel> {
109
- model: Model;
110
- options: ModelRouterOptions<TModel>;
106
+ protected model: Model;
107
+ protected options: ModelRouterOptions<TModel>;
111
108
  defaults: Defaults<TModel>;
112
- baseFields: string[];
113
- baseFieldsExt: string[];
109
+ protected baseFields: string[];
110
+ protected baseFieldsExt: string[];
114
111
  private asServiceHookContext;
115
112
  constructor(req: ModelRequest, modelName: string);
116
113
  findOne(filter: Filter<TModel>, args?: FindOneArgs<TModel>, options?: FindOneOptions): Promise<SingleResult<TModel> | ErrorResult>;
@@ -210,10 +207,10 @@ declare class PublicService<TModel = unknown> extends Service<TModel> {
210
207
  }
211
208
 
212
209
  declare class DataService<T> {
213
- req: DataRequest;
214
- dataName: string;
215
- options: DataRouterOptions<T>;
216
- data: T[];
210
+ protected req: DataRequest;
211
+ protected dataName: string;
212
+ protected options: DataRouterOptions<T>;
213
+ protected data: T[];
217
214
  constructor(req: DataRequest, dataName: string);
218
215
  findOne<TSelect extends Projection | undefined = undefined>(filter: DataFilter<T>, args?: DataFindOneArgs<T, TSelect>, options?: DataFindOneOptions): Promise<SingleResult<SelectedPublicOutput<T, TSelect>> | ErrorResult>;
219
216
  findById<TSelect extends Projection | undefined = undefined>(id: string, args?: DataFindOneArgs<T, TSelect>, options?: DataFindOneOptions): Promise<SingleResult<SelectedPublicOutput<T, TSelect>> | ErrorResult>;
@@ -564,6 +561,11 @@ interface SubPopulate {
564
561
  interface KeyValue {
565
562
  [key: string]: unknown;
566
563
  }
564
+ interface Change {
565
+ op: 'add' | 'replace' | 'remove';
566
+ path: Array<string | number>;
567
+ value?: unknown;
568
+ }
567
569
  interface ModelHookContext {
568
570
  modelName: string;
569
571
  mongooseModel: mongoose.Model<unknown>;
@@ -576,7 +578,7 @@ interface ModelHookContext {
576
578
  preparedData?: Record<string, unknown>;
577
579
  allowedFields?: string[];
578
580
  modifiedPaths?: string[];
579
- changes?: Diff<unknown>[];
581
+ changes?: Change[];
580
582
  docPermissions?: KeyValue;
581
583
  resolvedQuery?: {
582
584
  filter?: Filter;
@@ -845,7 +847,7 @@ type HookChain<TValue, TContext, TRequest extends AccessRouterRequest = AccessRo
845
847
  type ValidateRule = boolean | unknown[];
846
848
  type ValidateHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, allowedData: unknown, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<ValidateRule>;
847
849
  type DocPermissionsHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, doc: unknown, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<Record<string, unknown>>;
848
- 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>;
849
851
  type DeleteHook<TValue = unknown, TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, value: TValue, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<void>;
850
852
  type DocumentHook<TValue, TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, value: ModelDocument<TValue>, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<ModelDocument<TValue>>;
851
853
  type DocumentHookChain<TValue, TRequest extends AccessRouterRequest = AccessRouterRequest> = DocumentHook<TValue, TRequest> | Array<DocumentHook<TValue, TRequest>>;
@@ -886,6 +888,10 @@ type RequestSchemaResult<T = unknown> = RequestSchemaSuccess<T> | RequestSchemaF
886
888
  type RequestSchemaValidator<T = unknown> = (value: unknown) => RequestSchemaResult<T> | Promise<RequestSchemaResult<T>>;
887
889
  type RequestSchemaAdapter<T = unknown> = {
888
890
  validate: RequestSchemaValidator<T>;
891
+ openapi?: Record<string, unknown>;
892
+ };
893
+ type RequestSchemaOptions = {
894
+ openapi?: Record<string, unknown>;
889
895
  };
890
896
  type StandardSchemaPathSegment = {
891
897
  key: PropertyKey;
@@ -1403,7 +1409,19 @@ declare function parseQuery<TSchema extends z.ZodTypeAny>(schema: TSchema, value
1403
1409
  declare function parseBody<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown): z.output<TSchema>;
1404
1410
  declare function parseBodyWithSchema<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown, userSchema?: RequestSchemaLike): Promise<z.output<TSchema>>;
1405
1411
  declare function parseNestedBodyWithSchema(schema: z.ZodTypeAny, value: unknown, nestedKey: string, userSchema?: RequestSchemaLike): Promise<Record<string, unknown>>;
1406
- declare function defineRequestSchema<T = unknown>(validator: RequestSchemaValidator<T>): RequestSchemaValidator<T>;
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
+ */
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
+ */
1407
1425
  declare function fromZod<TSchema extends z.ZodTypeAny>(schema: TSchema): RequestSchemaValidator<z.output<TSchema>>;
1408
1426
  declare function fromStandardSchema<TSchema extends StandardSchemaV1>(schema: TSchema): RequestSchemaValidator<StandardSchemaInferOutput<TSchema>>;
1409
1427
  declare function fromYup<TSchema extends YupSchemaLike>(schema: TSchema): RequestSchemaValidator;
@@ -1415,4 +1433,4 @@ declare function fromIoTs<TValue = unknown>(decoder: IoTsDecoderLike<TValue>): R
1415
1433
  declare function fromSuperstruct<TStruct, TOutput = unknown>(struct: TStruct, validate: SuperstructValidateLike): RequestSchemaValidator<TOutput>;
1416
1434
  declare function fromVine<TValue = unknown>(validator: VineValidatorLike<TValue>): RequestSchemaValidator<TValue>;
1417
1435
 
1418
- 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 RootDataReadByFilterQueryEntry 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 RequestSchemaResult as aV, type RequestSchemaSuccess as aW, type RequestSchemaValidator as aX, type RequestSchemas as aY, type RootDataListQueryEntry as aZ, type RootDataOperation 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 ValidationError as b$, type RootDataReadByIdQueryEntry as b0, type RootModelCountQueryEntry as b1, type RootModelCreateQueryEntry as b2, type RootModelDeleteQueryEntry as b3, type RootModelDistinctQueryEntry as b4, type RootModelListQueryEntry as b5, type RootModelNewQueryEntry as b6, type RootModelOperation as b7, type RootModelReadByFilterQueryEntry as b8, type RootModelReadByIdQueryEntry as b9, type StandardSchemaSuccess as bA, type StandardSchemaV1 as bB, StatusCodes as bC, type SubListBody as bD, type SubPopulate as bE, type SubQueryEntry as bF, type SubReadBody as bG, type SuperstructFailureLike as bH, type SuperstructValidateLike as bI, type Task as bJ, type TransformAccess as bK, type TypedFilter as bL, type UpdateByIdArgs as bM, type UpdateByIdOptions as bN, type UpdateOneArgs as bO, type UpdateOneOptions as bP, type UpdateQueryInput as bQ, type UpsertArgs as bR, type UpsertOptions as bS, type UpsertQueryInput as bT, type ValibotIssueLike as bU, type ValibotPathItemLike as bV, type ValibotSafeParseLike as bW, type ValibotSafeParseResult as bX, type ValidateAccess as bY, type ValidateRule as bZ, type Validation as b_, type RootModelSubBulkUpdateQueryEntry as ba, type RootModelSubCreateQueryEntry as bb, type RootModelSubDeleteQueryEntry as bc, type RootModelSubListQueryEntry as bd, type RootModelSubReadQueryEntry as be, type RootModelSubUpdateQueryEntry as bf, type RootModelUpdateQueryEntry as bg, type RootModelUpsertQueryEntry as bh, type RootOperationResult as bi, type RootQueryEntry as bj, type RootRouterOptions as bk, type RootSubOperation as bl, type RootTarget as bm, type RouteGuardAccess as bn, type SelectAccess as bo, type SelectedPopulatedPublicOutput as bp, type SelectedPublicOutput as bq, type ServiceResult as br, type SingleResult as bs, type Sort as bt, type SortOrder as bu, type StandardSchemaFailure as bv, type StandardSchemaInferOutput as bw, type StandardSchemaIssue as bx, type StandardSchemaPathSegment as by, type StandardSchemaResult as bz, type AccessRouterRequest as c, type VineValidationErrorLike as c0, type VineValidationMessageLike as c1, type VineValidatorLike as c2, type YupSchemaLike as c3, type YupValidationErrorLike as c4, defineRequestSchema as c5, fromAjv as c6, fromArkType as c7, fromIoTs as c8, fromJoi as c9, fromStandardSchema as ca, fromSuperstruct as cb, fromValibot as cc, fromVine as cd, fromYup as ce, fromZod as cf, parseBody as cg, parseBodyWithSchema as ch, parseNestedBodyWithSchema as ci, parsePathParam as cj, parseQuery as ck, DataService as cl, Model as cm, Service as cn, PublicService as co, type AccessRouterPermissionMap as cp, type AccessRouterPermissions as cq, type Permissions as cr, 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 {
@@ -26,8 +25,8 @@ type Permissions = Permission;
26
25
  type AccessRouterPermissions = Permission;
27
26
 
28
27
  declare class Base<TModel = unknown> {
29
- req: ModelRequest;
30
- modelName: string;
28
+ protected req: ModelRequest;
29
+ protected modelName: string;
31
30
  constructor(req: ModelRequest, modelName: string);
32
31
  decorate<T>(doc: T, access: DecorateAccess, context: ModelHookContext): Promise<T>;
33
32
  decorateAll<T>(docs: T[], access: DecorateAllAccess, context: ModelHookContext): Promise<T[]>;
@@ -98,19 +97,17 @@ declare class Model {
98
97
  find({ filter, select, sort, populate, limit, skip, lean }: FindProps): mongoose.Query<any[], any, {}, any, "find", {}>;
99
98
  validateSort(sort: SortType, logError?: (msg: string, ...args: unknown[]) => void): boolean;
100
99
  findOne({ filter, select, sort, populate, lean }: FindOneProps): mongoose.Query<any, any, {}, any, "findOne", {}>;
101
- findOneAndDelete(filter: any): mongoose.Query<any, any, {}, any, "findOneAndDelete", {}>;
102
100
  exists(filter: any): mongoose.Query<any, any, {}, any, "findOne", {}>;
103
101
  countDocuments(filter?: {}): mongoose.Query<number, any, {}, any, "countDocuments", {}>;
104
- estimatedDocumentCount(): mongoose.Query<number, any, {}, any, "estimatedDocumentCount", {}>;
105
102
  distinct(field: string, conditions?: {}): mongoose.Query<any[], any, {}, any, "distinct", {}>;
106
103
  }
107
104
 
108
105
  declare class Service<TModel = unknown> extends Base<TModel> {
109
- model: Model;
110
- options: ModelRouterOptions<TModel>;
106
+ protected model: Model;
107
+ protected options: ModelRouterOptions<TModel>;
111
108
  defaults: Defaults<TModel>;
112
- baseFields: string[];
113
- baseFieldsExt: string[];
109
+ protected baseFields: string[];
110
+ protected baseFieldsExt: string[];
114
111
  private asServiceHookContext;
115
112
  constructor(req: ModelRequest, modelName: string);
116
113
  findOne(filter: Filter<TModel>, args?: FindOneArgs<TModel>, options?: FindOneOptions): Promise<SingleResult<TModel> | ErrorResult>;
@@ -210,10 +207,10 @@ declare class PublicService<TModel = unknown> extends Service<TModel> {
210
207
  }
211
208
 
212
209
  declare class DataService<T> {
213
- req: DataRequest;
214
- dataName: string;
215
- options: DataRouterOptions<T>;
216
- data: T[];
210
+ protected req: DataRequest;
211
+ protected dataName: string;
212
+ protected options: DataRouterOptions<T>;
213
+ protected data: T[];
217
214
  constructor(req: DataRequest, dataName: string);
218
215
  findOne<TSelect extends Projection | undefined = undefined>(filter: DataFilter<T>, args?: DataFindOneArgs<T, TSelect>, options?: DataFindOneOptions): Promise<SingleResult<SelectedPublicOutput<T, TSelect>> | ErrorResult>;
219
216
  findById<TSelect extends Projection | undefined = undefined>(id: string, args?: DataFindOneArgs<T, TSelect>, options?: DataFindOneOptions): Promise<SingleResult<SelectedPublicOutput<T, TSelect>> | ErrorResult>;
@@ -564,6 +561,11 @@ interface SubPopulate {
564
561
  interface KeyValue {
565
562
  [key: string]: unknown;
566
563
  }
564
+ interface Change {
565
+ op: 'add' | 'replace' | 'remove';
566
+ path: Array<string | number>;
567
+ value?: unknown;
568
+ }
567
569
  interface ModelHookContext {
568
570
  modelName: string;
569
571
  mongooseModel: mongoose.Model<unknown>;
@@ -576,7 +578,7 @@ interface ModelHookContext {
576
578
  preparedData?: Record<string, unknown>;
577
579
  allowedFields?: string[];
578
580
  modifiedPaths?: string[];
579
- changes?: Diff<unknown>[];
581
+ changes?: Change[];
580
582
  docPermissions?: KeyValue;
581
583
  resolvedQuery?: {
582
584
  filter?: Filter;
@@ -845,7 +847,7 @@ type HookChain<TValue, TContext, TRequest extends AccessRouterRequest = AccessRo
845
847
  type ValidateRule = boolean | unknown[];
846
848
  type ValidateHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, allowedData: unknown, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<ValidateRule>;
847
849
  type DocPermissionsHook<TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, doc: unknown, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<Record<string, unknown>>;
848
- 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>;
849
851
  type DeleteHook<TValue = unknown, TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, value: TValue, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<void>;
850
852
  type DocumentHook<TValue, TRequest extends AccessRouterRequest = AccessRouterRequest> = (this: TRequest, value: ModelDocument<TValue>, permissions: AccessRouterPermissions, context: ModelHookContext) => MaybePromise<ModelDocument<TValue>>;
851
853
  type DocumentHookChain<TValue, TRequest extends AccessRouterRequest = AccessRouterRequest> = DocumentHook<TValue, TRequest> | Array<DocumentHook<TValue, TRequest>>;
@@ -886,6 +888,10 @@ type RequestSchemaResult<T = unknown> = RequestSchemaSuccess<T> | RequestSchemaF
886
888
  type RequestSchemaValidator<T = unknown> = (value: unknown) => RequestSchemaResult<T> | Promise<RequestSchemaResult<T>>;
887
889
  type RequestSchemaAdapter<T = unknown> = {
888
890
  validate: RequestSchemaValidator<T>;
891
+ openapi?: Record<string, unknown>;
892
+ };
893
+ type RequestSchemaOptions = {
894
+ openapi?: Record<string, unknown>;
889
895
  };
890
896
  type StandardSchemaPathSegment = {
891
897
  key: PropertyKey;
@@ -1403,7 +1409,19 @@ declare function parseQuery<TSchema extends z.ZodTypeAny>(schema: TSchema, value
1403
1409
  declare function parseBody<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown): z.output<TSchema>;
1404
1410
  declare function parseBodyWithSchema<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown, userSchema?: RequestSchemaLike): Promise<z.output<TSchema>>;
1405
1411
  declare function parseNestedBodyWithSchema(schema: z.ZodTypeAny, value: unknown, nestedKey: string, userSchema?: RequestSchemaLike): Promise<Record<string, unknown>>;
1406
- declare function defineRequestSchema<T = unknown>(validator: RequestSchemaValidator<T>): RequestSchemaValidator<T>;
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
+ */
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
+ */
1407
1425
  declare function fromZod<TSchema extends z.ZodTypeAny>(schema: TSchema): RequestSchemaValidator<z.output<TSchema>>;
1408
1426
  declare function fromStandardSchema<TSchema extends StandardSchemaV1>(schema: TSchema): RequestSchemaValidator<StandardSchemaInferOutput<TSchema>>;
1409
1427
  declare function fromYup<TSchema extends YupSchemaLike>(schema: TSchema): RequestSchemaValidator;
@@ -1415,4 +1433,4 @@ declare function fromIoTs<TValue = unknown>(decoder: IoTsDecoderLike<TValue>): R
1415
1433
  declare function fromSuperstruct<TStruct, TOutput = unknown>(struct: TStruct, validate: SuperstructValidateLike): RequestSchemaValidator<TOutput>;
1416
1434
  declare function fromVine<TValue = unknown>(validator: VineValidatorLike<TValue>): RequestSchemaValidator<TValue>;
1417
1435
 
1418
- 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 RootDataReadByFilterQueryEntry 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 RequestSchemaResult as aV, type RequestSchemaSuccess as aW, type RequestSchemaValidator as aX, type RequestSchemas as aY, type RootDataListQueryEntry as aZ, type RootDataOperation 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 ValidationError as b$, type RootDataReadByIdQueryEntry as b0, type RootModelCountQueryEntry as b1, type RootModelCreateQueryEntry as b2, type RootModelDeleteQueryEntry as b3, type RootModelDistinctQueryEntry as b4, type RootModelListQueryEntry as b5, type RootModelNewQueryEntry as b6, type RootModelOperation as b7, type RootModelReadByFilterQueryEntry as b8, type RootModelReadByIdQueryEntry as b9, type StandardSchemaSuccess as bA, type StandardSchemaV1 as bB, StatusCodes as bC, type SubListBody as bD, type SubPopulate as bE, type SubQueryEntry as bF, type SubReadBody as bG, type SuperstructFailureLike as bH, type SuperstructValidateLike as bI, type Task as bJ, type TransformAccess as bK, type TypedFilter as bL, type UpdateByIdArgs as bM, type UpdateByIdOptions as bN, type UpdateOneArgs as bO, type UpdateOneOptions as bP, type UpdateQueryInput as bQ, type UpsertArgs as bR, type UpsertOptions as bS, type UpsertQueryInput as bT, type ValibotIssueLike as bU, type ValibotPathItemLike as bV, type ValibotSafeParseLike as bW, type ValibotSafeParseResult as bX, type ValidateAccess as bY, type ValidateRule as bZ, type Validation as b_, type RootModelSubBulkUpdateQueryEntry as ba, type RootModelSubCreateQueryEntry as bb, type RootModelSubDeleteQueryEntry as bc, type RootModelSubListQueryEntry as bd, type RootModelSubReadQueryEntry as be, type RootModelSubUpdateQueryEntry as bf, type RootModelUpdateQueryEntry as bg, type RootModelUpsertQueryEntry as bh, type RootOperationResult as bi, type RootQueryEntry as bj, type RootRouterOptions as bk, type RootSubOperation as bl, type RootTarget as bm, type RouteGuardAccess as bn, type SelectAccess as bo, type SelectedPopulatedPublicOutput as bp, type SelectedPublicOutput as bq, type ServiceResult as br, type SingleResult as bs, type Sort as bt, type SortOrder as bu, type StandardSchemaFailure as bv, type StandardSchemaInferOutput as bw, type StandardSchemaIssue as bx, type StandardSchemaPathSegment as by, type StandardSchemaResult as bz, type AccessRouterRequest as c, type VineValidationErrorLike as c0, type VineValidationMessageLike as c1, type VineValidatorLike as c2, type YupSchemaLike as c3, type YupValidationErrorLike as c4, defineRequestSchema as c5, fromAjv as c6, fromArkType as c7, fromIoTs as c8, fromJoi as c9, fromStandardSchema as ca, fromSuperstruct as cb, fromValibot as cc, fromVine as cd, fromYup as ce, fromZod as cf, parseBody as cg, parseBodyWithSchema as ch, parseNestedBodyWithSchema as ci, parsePathParam as cj, parseQuery as ck, DataService as cl, Model as cm, Service as cn, PublicService as co, type AccessRouterPermissionMap as cp, type AccessRouterPermissions as cq, type Permissions as cr, 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 };