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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # @web-ts-toolkit/access-router
1
+ # `@web-ts-toolkit/access-router`
2
2
 
3
- Access-policy Express routers and in-memory data services for Mongoose-backed APIs.
3
+ ACL-aware Express routers and in-memory data services for Mongoose-backed APIs.
4
4
 
5
5
  ## Installation
6
6
 
@@ -8,19 +8,71 @@ Access-policy Express routers and in-memory data services for Mongoose-backed AP
8
8
  pnpm add @web-ts-toolkit/access-router express mongoose
9
9
  ```
10
10
 
11
- ## Documentation
11
+ Peer dependencies:
12
+
13
+ - `express >= 5`
14
+ - `mongoose >= 8`
12
15
 
13
- - Full package documentation lives in `website/docs/packages/access-router/`.
14
- - Browse the docs site from `website` to read the full guide alongside the rest of the workspace packages.
16
+ ## Highlights
15
17
 
16
- ## Minimal Example
18
+ - generated model CRUD routers
19
+ - generated in-memory data routers
20
+ - access control, field permissions, and request-time hooks
21
+ - root batch router for grouped operations
22
+ - request validation adapters
23
+ - generated OpenAPI JSON and Swagger UI routes
24
+
25
+ ## Quick Start
17
26
 
18
27
  ```ts
19
28
  import acl from '@web-ts-toolkit/access-router';
20
29
 
21
- const router = acl.createDataRouter('fruit', {
30
+ acl.setGlobalOptions({
31
+ globalPermissions(req) {
32
+ return req.headers.user === 'admin' ? ['isAdmin'] : [];
33
+ },
34
+ });
35
+
36
+ const fruitRouter = acl.createDataRouter('fruit', {
22
37
  basePath: '/fruit',
23
38
  idField: 'id',
39
+ operationAccess: { list: true, read: true },
24
40
  data: [{ id: 'apple', name: 'Apple', public: true }],
41
+ permissionSchema: {
42
+ id: true,
43
+ name: 'isAdmin',
44
+ public: true,
45
+ },
46
+ });
47
+
48
+ const userRouter = acl.createRouter('User', {
49
+ basePath: '/users',
50
+ });
51
+
52
+ const docsRouter = acl.createOpenApiRouter({
53
+ title: 'Example API',
54
+ version: '1.0.0',
25
55
  });
26
56
  ```
57
+
58
+ ## Main Exports
59
+
60
+ - default export `acl`
61
+ - `createAccessRuntime()`
62
+ - `createOpenApiRouter(...)`
63
+ - `combineRoutes(...)`
64
+ - `guard(...)`
65
+ - `RootRouter`, `ModelRouter`, `DataRouter`
66
+ - validation adapters such as `fromZod(...)` and `defineRequestSchema(...)`
67
+
68
+ ## Documentation
69
+
70
+ Full package documentation lives in `website/docs/packages/access-router/`.
71
+
72
+ - live docs: https://web-ts-toolkit.pages.dev/docs/packages/access-router
73
+ - overview: `website/docs/packages/access-router/index.mdx`
74
+ - routing: `website/docs/packages/access-router/routing.mdx`
75
+ - configuration: `website/docs/packages/access-router/configuration.mdx`
76
+ - hooks: `website/docs/packages/access-router/hooks.mdx`
77
+ - validation: `website/docs/packages/access-router/validation.mdx`
78
+ - OpenAPI: `website/docs/packages/access-router/openapi.mdx`
package/advanced.d.mts CHANGED
@@ -1,146 +1,14 @@
1
- import { P as Projection, a as Populate, T as Task, F as Filter, S as Sort, I as Include, b as SubPopulate } from './service-DLKAswCS.mjs';
2
- export { A as AccessRouterBaseRequest, c as AccessRouterFieldKey, d as AccessRouterLogger, e as AccessRouterRequest, f as AccessRouterRequestExtensions, g as AfterPersistAccess, B as BaseFilterAccess, C as Codes, h as CreateArgs, i as CreateOptions, j as CustomHeaders, D as DataBaseFilterHook, k as DataFilter, l as DataFindArgs, m as DataFindOneArgs, n as DataFindOneOptions, o as DataFindOptions, p as DataHook, q as DataHookContext, r as DataIdentifierHook, s as DataListHook, t as DataOverrideFilterHook, u as DataRequest, v as DataRequestSchemas, w as DataRouterOptions, x as DecorateAccess, y as DecorateAllAccess, z as DeepFieldPath, E as DefaultModelRouterOptions, G as Defaults, H as DistinctArgs, J as DocPermissionsAccess, K as ErrorResult, L as ExistsOptions, M as ExtendedDataRouterOptions, N as ExtendedDefaultModelRouterOptions, O as ExtendedModelRouterOptions, Q as FilterOperator, R as FindAccess, U as FindArgs, V as FindByIdArgs, W as FindByIdOptions, X as FindOneArgs, Y as FindOneOptions, Z as FindOptions, _ as GlobalOptions, $ as GlobalPermissionValue, a0 as GuardHook, a1 as IdentifierHook, a2 as KeyValueProjection, a3 as ListResult, a4 as MaybePromise, a5 as ModelBaseFilterHook, a6 as ModelChangeHook, a7 as ModelDeleteHook, a8 as ModelDocPermissionsHook, a9 as ModelDocument, aa as ModelDocumentHook, ab as ModelHook, ac as ModelHookContext, ad as ModelIdentifierHook, ae as ModelListHook, af as ModelOverrideFilterHook, ag as ModelRequest, ah as ModelRouterOptions, ai as ModelValidateHook, aj as PathValue, ak as PermissionSchema, al as PopulateAccess, am as PrepareAccess, an as PublicCreateArgs, ao as PublicCreateOptions, ap as PublicListArgs, aq as PublicListOptions, ar as PublicOutput, as as PublicReadArgs, at as PublicReadOptions, au as PublicUpdateArgs, av as PublicUpdateOptions, aw as PublicUpsertArgs, ax as PublicUpsertOptions, ay as Request, az as RequestSchemas, aA as RootDataListQueryEntry, aB as RootDataOperation, aC as RootDataReadByFilterQueryEntry, aD as RootDataReadByIdQueryEntry, aE as RootModelCountQueryEntry, aF as RootModelCreateQueryEntry, aG as RootModelDeleteQueryEntry, aH as RootModelDistinctQueryEntry, aI as RootModelListQueryEntry, aJ as RootModelNewQueryEntry, aK as RootModelOperation, aL as RootModelReadByFilterQueryEntry, aM as RootModelReadByIdQueryEntry, aN as RootModelSubBulkUpdateQueryEntry, aO as RootModelSubCreateQueryEntry, aP as RootModelSubDeleteQueryEntry, aQ as RootModelSubListQueryEntry, aR as RootModelSubReadQueryEntry, aS as RootModelSubUpdateQueryEntry, aT as RootModelUpdateQueryEntry, aU as RootModelUpsertQueryEntry, aV as RootOperationResult, aW as RootQueryEntry, aX as RootRouterOptions, aY as RootSubOperation, aZ as RootTarget, a_ as RouteGuardAccess, a$ as SelectAccess, b0 as SelectedPopulatedPublicOutput, b1 as SelectedPublicOutput, b2 as ServiceResult, b3 as SingleResult, b4 as SortOrder, b5 as StatusCodes, b6 as SubQueryEntry, b7 as TransformAccess, b8 as TypedFilter, b9 as UpdateByIdArgs, ba as UpdateByIdOptions, bb as UpdateOneArgs, bc as UpdateOneOptions, bd as UpsertArgs, be as UpsertOptions, bf as ValidateAccess, bg as ValidateRule, bh as Validation } from './service-DLKAswCS.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 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';
3
2
  import { z } from 'zod';
4
- import 'express';
5
3
  import 'mongoose';
6
4
  import 'deep-diff';
5
+ import 'express';
7
6
 
8
7
  declare const MIDDLEWARE: unique symbol;
9
8
  declare const DATA_MIDDLEWARE: unique symbol;
10
- declare const CORE: unique symbol;
11
9
  declare const PERMISSIONS: unique symbol;
12
10
  declare const PERMISSION_KEYS: unique symbol;
13
11
 
14
- type ValidationError = {
15
- detail: string;
16
- pointer?: string;
17
- parameter?: string;
18
- };
19
- type ListQueryInput = {
20
- skip?: string;
21
- limit?: string;
22
- page?: string;
23
- page_size?: string;
24
- skim?: 'true' | 'false';
25
- include_permissions?: 'true' | 'false';
26
- include_count?: 'true' | 'false';
27
- include_extra_headers?: 'true' | 'false';
28
- };
29
- type CreateQueryInput = {
30
- include_permissions?: 'true' | 'false';
31
- };
32
- type ReadQueryInput = {
33
- include_permissions?: 'true' | 'false';
34
- try_list?: 'true' | 'false';
35
- };
36
- type UpdateQueryInput = {
37
- returning_all?: 'true' | 'false';
38
- };
39
- type UpsertQueryInput = {
40
- returning_all?: 'true' | 'false';
41
- include_permissions?: 'true' | 'false';
42
- };
43
- type AdvancedListBody = {
44
- filter?: Filter | unknown[];
45
- select?: Projection;
46
- sort?: Sort;
47
- populate?: Populate[] | string;
48
- include?: Include | Include[];
49
- tasks?: Task | Task[];
50
- skip?: string | number;
51
- limit?: string | number;
52
- page?: string | number;
53
- pageSize?: string | number;
54
- options?: {
55
- skim?: boolean;
56
- includePermissions?: boolean;
57
- includeCount?: boolean;
58
- includeExtraHeaders?: boolean;
59
- populateAccess?: unknown;
60
- };
61
- };
62
- type CountBody = {
63
- filter?: Filter | unknown[];
64
- options?: {
65
- access?: unknown;
66
- };
67
- };
68
- type AdvancedReadFilterBody = {
69
- filter?: Filter | unknown[];
70
- select?: Projection;
71
- sort?: Sort;
72
- populate?: Populate[] | string;
73
- include?: Include | Include[];
74
- tasks?: Task | Task[];
75
- options?: {
76
- skim?: boolean;
77
- includePermissions?: boolean;
78
- tryList?: boolean;
79
- populateAccess?: unknown;
80
- };
81
- };
82
- type AdvancedReadBody = {
83
- select?: Projection;
84
- populate?: Populate[] | string;
85
- include?: Include | Include[];
86
- tasks?: Task | Task[];
87
- options?: {
88
- skim?: boolean;
89
- includePermissions?: boolean;
90
- tryList?: boolean;
91
- populateAccess?: unknown;
92
- };
93
- };
94
- type AdvancedCreateBody = {
95
- data: unknown;
96
- select?: Projection;
97
- populate?: Populate[] | string;
98
- tasks?: Task | Task[];
99
- options?: {
100
- includePermissions?: boolean;
101
- populateAccess?: unknown;
102
- };
103
- };
104
- type AdvancedUpdateBody = {
105
- data: unknown;
106
- select?: Projection;
107
- populate?: Populate[] | string;
108
- tasks?: Task | Task[];
109
- options?: {
110
- returningAll?: boolean;
111
- includePermissions?: boolean;
112
- populateAccess?: unknown;
113
- };
114
- };
115
- type AdvancedUpsertBody = {
116
- data: Record<string, unknown>;
117
- select?: Projection;
118
- populate?: Populate[] | string;
119
- tasks?: Task | Task[];
120
- options?: {
121
- returningAll?: boolean;
122
- includePermissions?: boolean;
123
- populateAccess?: unknown;
124
- };
125
- };
126
- type DistinctBody = {
127
- filter?: Filter | unknown[];
128
- };
129
- type SubListBody = {
130
- filter?: Filter;
131
- select?: string[];
132
- };
133
- type SubReadBody = {
134
- select?: string[];
135
- populate?: SubPopulate | SubPopulate[] | string | string[];
136
- };
137
-
138
- declare function parsePathParam(value: string | string[] | undefined, parameter: string): string;
139
- declare function parseQuery<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown): z.output<TSchema>;
140
- declare function parseBody<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown): z.output<TSchema>;
141
- declare function parseBodyWithSchema<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown, userSchema?: z.ZodTypeAny): z.output<TSchema>;
142
- declare function parseNestedBodyWithSchema(schema: z.ZodTypeAny, value: unknown, nestedKey: string, userSchema?: z.ZodTypeAny): Record<string, unknown>;
143
-
144
12
  declare const listQuerySchema: z.ZodObject<{
145
13
  skip: z.ZodOptional<z.ZodString>;
146
14
  limit: z.ZodOptional<z.ZodString>;
@@ -208,23 +76,23 @@ declare const listBodySchema: z.ZodObject<{
208
76
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
209
77
  match: z.ZodOptional<z.ZodUnknown>;
210
78
  access: z.ZodOptional<z.ZodEnum<{
211
- read: "read";
212
79
  list: "list";
80
+ read: "read";
213
81
  }>>;
214
82
  }, z.core.$loose>]>>, z.ZodObject<{
215
83
  path: z.ZodString;
216
84
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
217
85
  match: z.ZodOptional<z.ZodUnknown>;
218
86
  access: z.ZodOptional<z.ZodEnum<{
219
- read: "read";
220
87
  list: "list";
88
+ read: "read";
221
89
  }>>;
222
90
  }, z.core.$loose>]>>;
223
91
  include: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
224
92
  model: z.ZodString;
225
93
  op: z.ZodEnum<{
226
- read: "read";
227
94
  list: "list";
95
+ read: "read";
228
96
  count: "count";
229
97
  }>;
230
98
  path: z.ZodString;
@@ -236,8 +104,8 @@ declare const listBodySchema: z.ZodObject<{
236
104
  }, z.core.$loose>, z.ZodArray<z.ZodObject<{
237
105
  model: z.ZodString;
238
106
  op: z.ZodEnum<{
239
- read: "read";
240
107
  list: "list";
108
+ read: "read";
241
109
  count: "count";
242
110
  }>;
243
111
  path: z.ZodString;
@@ -283,23 +151,23 @@ declare const readFilterBodySchema: z.ZodObject<{
283
151
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
284
152
  match: z.ZodOptional<z.ZodUnknown>;
285
153
  access: z.ZodOptional<z.ZodEnum<{
286
- read: "read";
287
154
  list: "list";
155
+ read: "read";
288
156
  }>>;
289
157
  }, z.core.$loose>]>>, z.ZodObject<{
290
158
  path: z.ZodString;
291
159
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
292
160
  match: z.ZodOptional<z.ZodUnknown>;
293
161
  access: z.ZodOptional<z.ZodEnum<{
294
- read: "read";
295
162
  list: "list";
163
+ read: "read";
296
164
  }>>;
297
165
  }, z.core.$loose>]>>;
298
166
  include: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
299
167
  model: z.ZodString;
300
168
  op: z.ZodEnum<{
301
- read: "read";
302
169
  list: "list";
170
+ read: "read";
303
171
  count: "count";
304
172
  }>;
305
173
  path: z.ZodString;
@@ -311,8 +179,8 @@ declare const readFilterBodySchema: z.ZodObject<{
311
179
  }, z.core.$loose>, z.ZodArray<z.ZodObject<{
312
180
  model: z.ZodString;
313
181
  op: z.ZodEnum<{
314
- read: "read";
315
182
  list: "list";
183
+ read: "read";
316
184
  count: "count";
317
185
  }>;
318
186
  path: z.ZodString;
@@ -345,23 +213,23 @@ declare const readByIdBodySchema: z.ZodObject<{
345
213
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
346
214
  match: z.ZodOptional<z.ZodUnknown>;
347
215
  access: z.ZodOptional<z.ZodEnum<{
348
- read: "read";
349
216
  list: "list";
217
+ read: "read";
350
218
  }>>;
351
219
  }, z.core.$loose>]>>, z.ZodObject<{
352
220
  path: z.ZodString;
353
221
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
354
222
  match: z.ZodOptional<z.ZodUnknown>;
355
223
  access: z.ZodOptional<z.ZodEnum<{
356
- read: "read";
357
224
  list: "list";
225
+ read: "read";
358
226
  }>>;
359
227
  }, z.core.$loose>]>>;
360
228
  include: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
361
229
  model: z.ZodString;
362
230
  op: z.ZodEnum<{
363
- read: "read";
364
231
  list: "list";
232
+ read: "read";
365
233
  count: "count";
366
234
  }>;
367
235
  path: z.ZodString;
@@ -373,8 +241,8 @@ declare const readByIdBodySchema: z.ZodObject<{
373
241
  }, z.core.$loose>, z.ZodArray<z.ZodObject<{
374
242
  model: z.ZodString;
375
243
  op: z.ZodEnum<{
376
- read: "read";
377
244
  list: "list";
245
+ read: "read";
378
246
  count: "count";
379
247
  }>;
380
248
  path: z.ZodString;
@@ -408,16 +276,16 @@ declare const advancedCreateBodySchema: z.ZodObject<{
408
276
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
409
277
  match: z.ZodOptional<z.ZodUnknown>;
410
278
  access: z.ZodOptional<z.ZodEnum<{
411
- read: "read";
412
279
  list: "list";
280
+ read: "read";
413
281
  }>>;
414
282
  }, z.core.$loose>]>>, z.ZodObject<{
415
283
  path: z.ZodString;
416
284
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
417
285
  match: z.ZodOptional<z.ZodUnknown>;
418
286
  access: z.ZodOptional<z.ZodEnum<{
419
- read: "read";
420
287
  list: "list";
288
+ read: "read";
421
289
  }>>;
422
290
  }, z.core.$loose>]>>;
423
291
  tasks: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -444,16 +312,16 @@ declare const advancedUpdateBodySchema: z.ZodObject<{
444
312
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
445
313
  match: z.ZodOptional<z.ZodUnknown>;
446
314
  access: z.ZodOptional<z.ZodEnum<{
447
- read: "read";
448
315
  list: "list";
316
+ read: "read";
449
317
  }>>;
450
318
  }, z.core.$loose>]>>, z.ZodObject<{
451
319
  path: z.ZodString;
452
320
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
453
321
  match: z.ZodOptional<z.ZodUnknown>;
454
322
  access: z.ZodOptional<z.ZodEnum<{
455
- read: "read";
456
323
  list: "list";
324
+ read: "read";
457
325
  }>>;
458
326
  }, z.core.$loose>]>>;
459
327
  tasks: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -480,16 +348,16 @@ declare const advancedUpsertBodySchema: z.ZodObject<{
480
348
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
481
349
  match: z.ZodOptional<z.ZodUnknown>;
482
350
  access: z.ZodOptional<z.ZodEnum<{
483
- read: "read";
484
351
  list: "list";
352
+ read: "read";
485
353
  }>>;
486
354
  }, z.core.$loose>]>>, z.ZodObject<{
487
355
  path: z.ZodString;
488
356
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
489
357
  match: z.ZodOptional<z.ZodUnknown>;
490
358
  access: z.ZodOptional<z.ZodEnum<{
491
- read: "read";
492
359
  list: "list";
360
+ read: "read";
493
361
  }>>;
494
362
  }, z.core.$loose>]>>;
495
363
  tasks: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -623,23 +491,23 @@ declare const rootQuerySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readon
623
491
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
624
492
  match: z.ZodOptional<z.ZodUnknown>;
625
493
  access: z.ZodOptional<z.ZodEnum<{
626
- read: "read";
627
494
  list: "list";
495
+ read: "read";
628
496
  }>>;
629
497
  }, z.core.$loose>]>>, z.ZodObject<{
630
498
  path: z.ZodString;
631
499
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
632
500
  match: z.ZodOptional<z.ZodUnknown>;
633
501
  access: z.ZodOptional<z.ZodEnum<{
634
- read: "read";
635
502
  list: "list";
503
+ read: "read";
636
504
  }>>;
637
505
  }, z.core.$loose>]>>;
638
506
  include: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
639
507
  model: z.ZodString;
640
508
  op: z.ZodEnum<{
641
- read: "read";
642
509
  list: "list";
510
+ read: "read";
643
511
  count: "count";
644
512
  }>;
645
513
  path: z.ZodString;
@@ -651,8 +519,8 @@ declare const rootQuerySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readon
651
519
  }, z.core.$loose>, z.ZodArray<z.ZodObject<{
652
520
  model: z.ZodString;
653
521
  op: z.ZodEnum<{
654
- read: "read";
655
522
  list: "list";
523
+ read: "read";
656
524
  count: "count";
657
525
  }>;
658
526
  path: z.ZodString;
@@ -697,23 +565,23 @@ declare const rootQuerySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readon
697
565
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
698
566
  match: z.ZodOptional<z.ZodUnknown>;
699
567
  access: z.ZodOptional<z.ZodEnum<{
700
- read: "read";
701
568
  list: "list";
569
+ read: "read";
702
570
  }>>;
703
571
  }, z.core.$loose>]>>, z.ZodObject<{
704
572
  path: z.ZodString;
705
573
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
706
574
  match: z.ZodOptional<z.ZodUnknown>;
707
575
  access: z.ZodOptional<z.ZodEnum<{
708
- read: "read";
709
576
  list: "list";
577
+ read: "read";
710
578
  }>>;
711
579
  }, z.core.$loose>]>>;
712
580
  include: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
713
581
  model: z.ZodString;
714
582
  op: z.ZodEnum<{
715
- read: "read";
716
583
  list: "list";
584
+ read: "read";
717
585
  count: "count";
718
586
  }>;
719
587
  path: z.ZodString;
@@ -725,8 +593,8 @@ declare const rootQuerySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readon
725
593
  }, z.core.$loose>, z.ZodArray<z.ZodObject<{
726
594
  model: z.ZodString;
727
595
  op: z.ZodEnum<{
728
- read: "read";
729
596
  list: "list";
597
+ read: "read";
730
598
  count: "count";
731
599
  }>;
732
600
  path: z.ZodString;
@@ -766,23 +634,23 @@ declare const rootQuerySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readon
766
634
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
767
635
  match: z.ZodOptional<z.ZodUnknown>;
768
636
  access: z.ZodOptional<z.ZodEnum<{
769
- read: "read";
770
637
  list: "list";
638
+ read: "read";
771
639
  }>>;
772
640
  }, z.core.$loose>]>>, z.ZodObject<{
773
641
  path: z.ZodString;
774
642
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
775
643
  match: z.ZodOptional<z.ZodUnknown>;
776
644
  access: z.ZodOptional<z.ZodEnum<{
777
- read: "read";
778
645
  list: "list";
646
+ read: "read";
779
647
  }>>;
780
648
  }, z.core.$loose>]>>;
781
649
  include: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
782
650
  model: z.ZodString;
783
651
  op: z.ZodEnum<{
784
- read: "read";
785
652
  list: "list";
653
+ read: "read";
786
654
  count: "count";
787
655
  }>;
788
656
  path: z.ZodString;
@@ -794,8 +662,8 @@ declare const rootQuerySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readon
794
662
  }, z.core.$loose>, z.ZodArray<z.ZodObject<{
795
663
  model: z.ZodString;
796
664
  op: z.ZodEnum<{
797
- read: "read";
798
665
  list: "list";
666
+ read: "read";
799
667
  count: "count";
800
668
  }>;
801
669
  path: z.ZodString;
@@ -836,16 +704,16 @@ declare const rootQuerySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readon
836
704
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
837
705
  match: z.ZodOptional<z.ZodUnknown>;
838
706
  access: z.ZodOptional<z.ZodEnum<{
839
- read: "read";
840
707
  list: "list";
708
+ read: "read";
841
709
  }>>;
842
710
  }, z.core.$loose>]>>, z.ZodObject<{
843
711
  path: z.ZodString;
844
712
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
845
713
  match: z.ZodOptional<z.ZodUnknown>;
846
714
  access: z.ZodOptional<z.ZodEnum<{
847
- read: "read";
848
715
  list: "list";
716
+ read: "read";
849
717
  }>>;
850
718
  }, z.core.$loose>]>>;
851
719
  tasks: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -877,16 +745,16 @@ declare const rootQuerySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readon
877
745
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
878
746
  match: z.ZodOptional<z.ZodUnknown>;
879
747
  access: z.ZodOptional<z.ZodEnum<{
880
- read: "read";
881
748
  list: "list";
749
+ read: "read";
882
750
  }>>;
883
751
  }, z.core.$loose>]>>, z.ZodObject<{
884
752
  path: z.ZodString;
885
753
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
886
754
  match: z.ZodOptional<z.ZodUnknown>;
887
755
  access: z.ZodOptional<z.ZodEnum<{
888
- read: "read";
889
756
  list: "list";
757
+ read: "read";
890
758
  }>>;
891
759
  }, z.core.$loose>]>>;
892
760
  tasks: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -918,16 +786,16 @@ declare const rootQuerySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readon
918
786
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
919
787
  match: z.ZodOptional<z.ZodUnknown>;
920
788
  access: z.ZodOptional<z.ZodEnum<{
921
- read: "read";
922
789
  list: "list";
790
+ read: "read";
923
791
  }>>;
924
792
  }, z.core.$loose>]>>, z.ZodObject<{
925
793
  path: z.ZodString;
926
794
  select: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>]>>]>>;
927
795
  match: z.ZodOptional<z.ZodUnknown>;
928
796
  access: z.ZodOptional<z.ZodEnum<{
929
- read: "read";
930
797
  list: "list";
798
+ read: "read";
931
799
  }>>;
932
800
  }, z.core.$loose>]>>;
933
801
  tasks: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -1069,4 +937,4 @@ declare const rootQuerySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readon
1069
937
  order: z.ZodOptional<z.ZodNumber>;
1070
938
  }, z.core.$loose>]>]>>;
1071
939
 
1072
- export { type AdvancedCreateBody, type AdvancedListBody, type AdvancedReadBody, type AdvancedReadFilterBody, type AdvancedUpdateBody, type AdvancedUpsertBody, CORE, type CountBody, type CreateQueryInput, DATA_MIDDLEWARE, type DistinctBody, Filter, Include, type ListQueryInput, MIDDLEWARE, PERMISSIONS, PERMISSION_KEYS, Populate, Projection, type ReadQueryInput, Sort, type SubListBody, SubPopulate, type SubReadBody, Task, type UpdateQueryInput, type UpsertQueryInput, type ValidationError, advancedCreateBodySchema, advancedUpdateBodySchema, advancedUpsertBodySchema, countBodySchema, createBodySchema, createQuerySchema, dataListBodySchema, dataReadByIdBodySchema, dataReadFilterBodySchema, distinctBodySchema, listBodySchema, listQuerySchema, parseBody, parseBodyWithSchema, parseNestedBodyWithSchema, parsePathParam, parseQuery, readByIdBodySchema, readFilterBodySchema, readQuerySchema, requestSchemas, rootQuerySchema, subListBodySchema, subMutationBodySchema, subReadBodySchema, updateBodySchema, updateQuerySchema, upsertBodySchema, upsertQuerySchema };
940
+ export { DATA_MIDDLEWARE, MIDDLEWARE, PERMISSIONS, PERMISSION_KEYS, advancedCreateBodySchema, advancedUpdateBodySchema, advancedUpsertBodySchema, countBodySchema, createBodySchema, createQuerySchema, dataListBodySchema, dataReadByIdBodySchema, dataReadFilterBodySchema, distinctBodySchema, listBodySchema, listQuerySchema, readByIdBodySchema, readFilterBodySchema, readQuerySchema, requestSchemas, rootQuerySchema, subListBodySchema, subMutationBodySchema, subReadBodySchema, updateBodySchema, updateQuerySchema, upsertBodySchema, upsertQuerySchema };