@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 +34 -0
- package/advanced.d.mts +1 -2
- package/advanced.d.ts +1 -2
- package/index.d.mts +2 -3
- package/index.d.ts +2 -3
- package/index.js +3 -3
- package/index.mjs +2 -2
- package/llms.txt +53 -0
- package/package.json +4 -4
- package/{parsers-Ce1grlLx.d.mts → parsers-Cj4r_G4g.d.mts} +20 -4
- package/{parsers-Ce1grlLx.d.ts → parsers-Cj4r_G4g.d.ts} +20 -4
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
|
|
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
|
|
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 {
|
|
4
|
-
export {
|
|
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 {
|
|
4
|
-
export {
|
|
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
|
|
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,
|
|
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 "
|
|
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
|
+
"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.
|
|
44
|
-
"@web-ts-toolkit/utils": "0.
|
|
45
|
-
"
|
|
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?:
|
|
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:
|
|
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 {
|
|
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?:
|
|
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:
|
|
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 {
|
|
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 };
|