@web-ts-toolkit/access-router 0.45.0 → 0.47.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 +255 -9
- package/advanced.d.mts +1 -1
- package/advanced.d.ts +1 -1
- package/advanced.js +40 -17
- package/advanced.mjs +42 -18
- package/index.d.mts +5 -186
- package/index.d.ts +5 -186
- package/index.js +622 -291
- package/index.mjs +485 -152
- package/llms.txt +68 -3
- package/package.json +3 -3
- package/{parsers-DppKW-Fd.d.mts → parsers-BidvJUu7.d.mts} +353 -9
- package/{parsers-DppKW-Fd.d.ts → parsers-BidvJUu7.d.ts} +353 -9
|
@@ -30,6 +30,7 @@ declare class Service<TModel = unknown> extends Base<TModel> {
|
|
|
30
30
|
defaults: Defaults<TModel>;
|
|
31
31
|
protected baseFields: string[];
|
|
32
32
|
protected baseFieldsExt: string[];
|
|
33
|
+
private readonly persist;
|
|
33
34
|
findRawParentDoc(args: {
|
|
34
35
|
filter: Filter<TModel>;
|
|
35
36
|
select: string;
|
|
@@ -39,6 +40,7 @@ declare class Service<TModel = unknown> extends Base<TModel> {
|
|
|
39
40
|
protected createModelAdapter(modelName: string): any;
|
|
40
41
|
protected getModelRouterOptions(modelName: string): ModelRouterOptions<TModel>;
|
|
41
42
|
private asServiceHookContext;
|
|
43
|
+
private getEffectiveAllowedSortFields;
|
|
42
44
|
private beginOp;
|
|
43
45
|
private completeOp;
|
|
44
46
|
constructor(req: ModelRequest, modelName: string);
|
|
@@ -53,13 +55,27 @@ declare class Service<TModel = unknown> extends Base<TModel> {
|
|
|
53
55
|
skim?: boolean;
|
|
54
56
|
includePermissions?: boolean;
|
|
55
57
|
}): Promise<SingleResult<TModel>>;
|
|
58
|
+
/**
|
|
59
|
+
* Update at authorized policy paths: admitted leaves preserve omitted siblings;
|
|
60
|
+
* whole-authorized objects/arrays replace. Shared by updateById and existing-row
|
|
61
|
+
* upsert. Validation precedes trusted prepare output (not re-filtered); partial
|
|
62
|
+
* prepare containers preserve omissions. Transform retains explicit document-setter
|
|
63
|
+
* replacement authority. Send nested client JSON, not literal dotted update keys.
|
|
64
|
+
*/
|
|
56
65
|
updateOne(filter: Filter<TModel>, data: Record<string, unknown>, args?: UpdateOneArgs<TModel>, options?: UpdateOneOptions, decorate?: (doc: unknown, context?: ModelHookContext) => unknown): Promise<SingleResult<TModel> | ErrorResult>;
|
|
57
66
|
updateById(id: string, data: Record<string, unknown>, args?: UpdateByIdArgs<TModel>, options?: UpdateByIdOptions, decorate?: (doc: unknown, context?: ModelHookContext) => unknown): Promise<SingleResult<TModel> | ErrorResult>;
|
|
58
67
|
upsert(filter: Filter<TModel>, data: Record<string, unknown>, args?: UpsertArgs<TModel>, options?: UpsertOptions, decorate?: (doc: unknown, context?: ModelHookContext) => unknown): Promise<ServiceResult<TModel>>;
|
|
59
68
|
delete(id: string): Promise<SingleResult<unknown> | ErrorResult>;
|
|
69
|
+
/**
|
|
70
|
+
* Check existence under row policy (read by default). Terminal false returns a
|
|
71
|
+
* Forbidden ErrorResult before adapter dispatch, in both includeId modes.
|
|
72
|
+
* Allowed matches return true or an `{ _id }` record; misses return false or null.
|
|
73
|
+
* Custom HTTP routes must map ErrorResult to their intended response status.
|
|
74
|
+
*/
|
|
60
75
|
exists(filter: Filter<TModel>, options: ExistsOptions & {
|
|
61
76
|
includeId: true;
|
|
62
77
|
}): Promise<SingleResult<unknown> | ErrorResult>;
|
|
78
|
+
/** Boolean existence; terminal false policy returns Forbidden, not successful false. */
|
|
63
79
|
exists(filter: Filter<TModel>, options?: ExistsOptions): Promise<SingleResult<boolean> | ErrorResult>;
|
|
64
80
|
protected isValidDistinctFieldName(field: unknown): boolean;
|
|
65
81
|
protected authorizeDistinctField(field: string): Promise<ErrorResult | null>;
|
|
@@ -72,6 +88,13 @@ declare class Service<TModel = unknown> extends Base<TModel> {
|
|
|
72
88
|
* validation and subquery parsing so substituted parent data stays inert.
|
|
73
89
|
*/
|
|
74
90
|
countTrusted(authorizedFilter: Filter<TModel>): Promise<SingleResult<number> | ErrorResult>;
|
|
91
|
+
/**
|
|
92
|
+
* Group target document IDs by original parent-key aliases using one aggregate.
|
|
93
|
+
* Resolves the requested row policy (legacy count includes pass `count`), casts
|
|
94
|
+
* authorized filters/foreign operands with the target schema, and deduplicates IDs
|
|
95
|
+
* independently of pagination. Cast failures return BadRequest; false policy returns
|
|
96
|
+
* Forbidden. Casting does not execute countDocuments middleware/plugins.
|
|
97
|
+
*/
|
|
75
98
|
countByFieldValues(foreignField: string, values: unknown[], filter?: Filter<TModel>, access?: BaseFilterAccess): Promise<SingleResult<Map<string, Set<string>>> | ErrorResult>;
|
|
76
99
|
getDocPermissions(doc: unknown): Record<string, unknown>;
|
|
77
100
|
private resolveFindOneArgs;
|
|
@@ -93,8 +116,28 @@ declare class Service<TModel = unknown> extends Base<TModel> {
|
|
|
93
116
|
private getAccessibleIdSet;
|
|
94
117
|
listSub(id: SubdocumentId, sub: SubdocumentName, options?: SubdocumentListOptions<TModel>): Promise<ListResult | ErrorResult>;
|
|
95
118
|
readSub(id: SubdocumentId, sub: SubdocumentName, subId: SubdocumentId, options?: SubdocumentReadOptions): Promise<SingleResult | ErrorResult>;
|
|
119
|
+
/**
|
|
120
|
+
* Apply authorized policy-path updates, preserving protected siblings, then save.
|
|
121
|
+
* Output requires post-save parent read and subdocument read operation/row access;
|
|
122
|
+
* hidden output is successful `data: null` (direct/root-entry 200), not a failed write.
|
|
123
|
+
* Visible output uses read fields plus `_id`. Do not retry solely for null output.
|
|
124
|
+
*/
|
|
96
125
|
updateSub(id: SubdocumentId, sub: SubdocumentName, subId: SubdocumentId, data: Record<string, unknown>): Promise<SingleResult | ErrorResult>;
|
|
126
|
+
/**
|
|
127
|
+
* Save authorized targeted updates, then return readable targets in stored order.
|
|
128
|
+
* Requires parent/subdocument read access for output, not subdocument list access;
|
|
129
|
+
* uses read fields plus `_id`. Hidden output succeeds with `data: [], count: 0`
|
|
130
|
+
* (direct/root-entry 200); count measures visible rows, not all updated rows.
|
|
131
|
+
*/
|
|
97
132
|
bulkUpdateSub(id: SubdocumentId, sub: SubdocumentName, data: SubdocumentBulkUpdateInput | Record<string, unknown>): Promise<ListResult | ErrorResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Append/prepend admitted rows, then return the visible full array (including when
|
|
135
|
+
* input is empty). Output requires post-save parent read and subdocument list AND
|
|
136
|
+
* read guards/row filters; fields use read projection plus `_id`.
|
|
137
|
+
* Hidden output succeeds with code `created`, `data: [], count: 0`
|
|
138
|
+
* (direct/root-entry 201). Visible count/order follow filtered stored rows.
|
|
139
|
+
* Empty output does not mean the write failed; addFirst is a service option.
|
|
140
|
+
*/
|
|
98
141
|
createSub(id: SubdocumentId, sub: SubdocumentName, data: SubdocumentCreateInput, options?: SubdocumentCreateOptions): Promise<ListResult | ErrorResult>;
|
|
99
142
|
deleteSub(id: SubdocumentId, sub: SubdocumentName, subId: SubdocumentId): Promise<SingleResult | ErrorResult>;
|
|
100
143
|
getParentDoc(id: SubdocumentId, sub: SubdocumentName, args?: SubdocumentParentArgs, options?: SubdocumentParentOptions): Promise<any>;
|
|
@@ -128,6 +171,11 @@ declare class PublicService<TModel = unknown> extends Service<TModel> {
|
|
|
128
171
|
select?: TSelect;
|
|
129
172
|
populate?: TPopulate;
|
|
130
173
|
}, options?: PublicUpdateOptions): Promise<SingleResult<SelectedPopulatedPublicOutput<TModel, TSelect, TPopulate>> | ErrorResult>;
|
|
174
|
+
/**
|
|
175
|
+
* With an _id, check update-policy existence then update: terminal denial returns
|
|
176
|
+
* Forbidden, an allowed miss remains Unauthorized, and neither creates a row.
|
|
177
|
+
* Without an _id, use the create path.
|
|
178
|
+
*/
|
|
131
179
|
_upsert<TSelect extends Projection | undefined = undefined, TPopulate extends Populate[] | string | undefined = undefined>(data: Record<string, unknown>, args?: Omit<PublicUpsertArgs, 'select' | 'populate'> & {
|
|
132
180
|
select?: TSelect;
|
|
133
181
|
populate?: TPopulate;
|
|
@@ -244,12 +292,32 @@ type AjvErrorObjectLike = {
|
|
|
244
292
|
};
|
|
245
293
|
};
|
|
246
294
|
type AjvValidationErrorLike = {
|
|
247
|
-
|
|
295
|
+
ajv: true;
|
|
296
|
+
validation: true;
|
|
297
|
+
errors: ReadonlyArray<AjvErrorObjectLike>;
|
|
248
298
|
};
|
|
249
|
-
|
|
250
|
-
|
|
299
|
+
/**
|
|
300
|
+
* Structural AJV contract; AJV is not a runtime dependency of access-router.
|
|
301
|
+
* Sync validators return boolean verdicts and expose mutable errors, snapshotted
|
|
302
|
+
* in the same turn. Tagged `$async: true` validators resolve with data (even
|
|
303
|
+
* false/true/null), or reject with AJV ValidationError diagnostics.
|
|
304
|
+
*
|
|
305
|
+
* Untagged promises/thenables are unsupported. Migrate async boolean-verdict
|
|
306
|
+
* wrappers to RequestSchemaValidator, or return data/reject validation errors
|
|
307
|
+
* and retain the literal `$async: true` tag. Real AJV ValidateFunction and
|
|
308
|
+
* AsyncValidateFunction overloads infer output via their type guard without casts; a synchronous
|
|
309
|
+
* structural validator's output type can be supplied explicitly to fromAjv<T>.
|
|
310
|
+
* AJV can type inline async schemas through a sync overload; an AsyncSchema-typed
|
|
311
|
+
* schema selects its async compile/compileAsync overload. Runtime uses the tag.
|
|
312
|
+
*/
|
|
313
|
+
type AjvValidatorLike<T = unknown> = ({
|
|
314
|
+
(value: unknown): boolean;
|
|
315
|
+
$async?: false;
|
|
316
|
+
} | {
|
|
317
|
+
(value: unknown): PromiseLike<T>;
|
|
318
|
+
$async: true;
|
|
319
|
+
}) & {
|
|
251
320
|
errors?: ReadonlyArray<AjvErrorObjectLike> | null;
|
|
252
|
-
$async?: boolean;
|
|
253
321
|
};
|
|
254
322
|
type ValibotPathItemLike = {
|
|
255
323
|
key?: unknown;
|
|
@@ -447,17 +515,221 @@ interface RequestComplexityOptions {
|
|
|
447
515
|
maxBulkItems?: number;
|
|
448
516
|
maxIncludeCount?: number;
|
|
449
517
|
maxSubQueryCount?: number;
|
|
518
|
+
/**
|
|
519
|
+
* Defaults to 10. Shared request-and-runtime-owned ceiling on awaited model-service
|
|
520
|
+
* adapter/document persistence operations, including nested includes/root entries.
|
|
521
|
+
* Recursive orchestration holds no permit; internal map/run bounds are per call.
|
|
522
|
+
* One operation may issue multiple driver commands via Mongoose middleware/populate;
|
|
523
|
+
* direct DB/network calls from trusted application hooks are outside this ceiling.
|
|
524
|
+
* Not a process-wide connection limit or protection against competing edits.
|
|
525
|
+
*/
|
|
450
526
|
maxBulkConcurrency?: number;
|
|
451
527
|
maxHookConcurrency?: number;
|
|
528
|
+
/** Cumulative correlated target executions per request/runtime (default 100); permit release does not refund this budget. */
|
|
452
529
|
maxCorrelatedQueries?: number;
|
|
530
|
+
/** Correlated template nesting bound (default 5), independent of persistence concurrency. */
|
|
453
531
|
maxCorrelatedDepth?: number;
|
|
454
532
|
}
|
|
455
533
|
|
|
534
|
+
type OpenApiMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
|
|
535
|
+
type OpenApiSchema = Record<string, unknown>;
|
|
536
|
+
type OpenApiSchemaSource = unknown;
|
|
537
|
+
type OpenApiParameter = {
|
|
538
|
+
name: string;
|
|
539
|
+
in: 'path' | 'query';
|
|
540
|
+
required?: boolean;
|
|
541
|
+
description?: string;
|
|
542
|
+
schema?: OpenApiSchema;
|
|
543
|
+
};
|
|
544
|
+
type OpenApiResponse = {
|
|
545
|
+
description: string;
|
|
546
|
+
content?: Record<string, {
|
|
547
|
+
schema: OpenApiSchema;
|
|
548
|
+
}>;
|
|
549
|
+
};
|
|
550
|
+
type OpenApiResponses = Record<string, OpenApiResponse>;
|
|
551
|
+
type OpenApiRouteDescriptor = {
|
|
552
|
+
method: OpenApiMethod;
|
|
553
|
+
path: string;
|
|
554
|
+
operationId?: string;
|
|
555
|
+
summary?: string;
|
|
556
|
+
description?: string;
|
|
557
|
+
tags?: string[];
|
|
558
|
+
acl?: string;
|
|
559
|
+
deprecated?: boolean;
|
|
560
|
+
query?: OpenApiSchemaSource;
|
|
561
|
+
body?: OpenApiSchemaSource;
|
|
562
|
+
pathParams?: Record<string, OpenApiSchemaSource>;
|
|
563
|
+
responses?: OpenApiResponses;
|
|
564
|
+
/**
|
|
565
|
+
* When true, replaces an existing registration with the same method/path
|
|
566
|
+
* even when the descriptors differ. When false (default), conflicting
|
|
567
|
+
* registrations throw at registration time so consumers can detect
|
|
568
|
+
* accidental route shadowing.
|
|
569
|
+
*/
|
|
570
|
+
allowReplace?: boolean;
|
|
571
|
+
/**
|
|
572
|
+
* When true, this exact descriptor is idempotent and registering the same
|
|
573
|
+
* method/path with an equivalent descriptor again is silently accepted.
|
|
574
|
+
* Differing re-registrations still throw unless {@link allowReplace} is set.
|
|
575
|
+
* Additionally, an idempotent descriptor may share its operationId with
|
|
576
|
+
* another idempotent descriptor mounted at a different path on the same
|
|
577
|
+
* registry, so reserved operations (e.g. the root batch route) can be
|
|
578
|
+
* exposed from multiple base paths without triggering strict-mode
|
|
579
|
+
* duplicate-operationId rejection.
|
|
580
|
+
*/
|
|
581
|
+
idempotent?: boolean;
|
|
582
|
+
};
|
|
583
|
+
type OpenApiRegistryOptions = {
|
|
584
|
+
/**
|
|
585
|
+
* Throw when the same method/path is registered twice with differing
|
|
586
|
+
* descriptors, instead of silently replacing. Default: true (strict).
|
|
587
|
+
* The {@link AccessRuntime} registry is constructed in strict mode by
|
|
588
|
+
* default; construct {@link OpenApiRegistry} directly with
|
|
589
|
+
* `rejectConflicts: false` for legacy replacement semantics.
|
|
590
|
+
*/
|
|
591
|
+
rejectConflicts?: boolean;
|
|
592
|
+
/**
|
|
593
|
+
* Throw when the same operationId is registered more than once, including
|
|
594
|
+
* when {@link OpenApiRouteDescriptor.allowReplace} is set. Default: true.
|
|
595
|
+
*/
|
|
596
|
+
rejectDuplicateOperationIds?: boolean;
|
|
597
|
+
};
|
|
598
|
+
type OpenApiDocumentOptions = {
|
|
599
|
+
title: string;
|
|
600
|
+
version: string;
|
|
601
|
+
description?: string;
|
|
602
|
+
servers?: Array<{
|
|
603
|
+
url: string;
|
|
604
|
+
description?: string;
|
|
605
|
+
}>;
|
|
606
|
+
};
|
|
607
|
+
type OpenApiRouterOptions = Partial<OpenApiDocumentOptions> & {
|
|
608
|
+
jsonPath?: string;
|
|
609
|
+
docsPath?: string | false;
|
|
610
|
+
swaggerUiCssUrl?: string;
|
|
611
|
+
swaggerUiBundleUrl?: string;
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
type ModelReferenceMap = {
|
|
615
|
+
[key: string]: string | ModelReferenceMap;
|
|
616
|
+
};
|
|
617
|
+
declare class AccessRuntime {
|
|
618
|
+
private readonly allowGlobalModelLookup;
|
|
619
|
+
constructor(options?: {
|
|
620
|
+
allowGlobalModelLookup?: boolean;
|
|
621
|
+
});
|
|
622
|
+
private readonly globalOptions;
|
|
623
|
+
private readonly defaultModelOptions;
|
|
624
|
+
private readonly modelOptions;
|
|
625
|
+
private readonly modelJsonSchemas;
|
|
626
|
+
private readonly dataOptions;
|
|
627
|
+
private readonly modelRefs;
|
|
628
|
+
private readonly modelSubs;
|
|
629
|
+
private readonly modelAtts;
|
|
630
|
+
private readonly modelInstances;
|
|
631
|
+
private readonly openApiRegistry;
|
|
632
|
+
private openApiPathPrefix;
|
|
633
|
+
registerModelInstance<TModel>(modelName: string, model: mongoose.Model<TModel>): void;
|
|
634
|
+
hasModelInstance(modelName: string): boolean;
|
|
635
|
+
getModelInstance<TModel = unknown>(modelName: string): mongoose.Model<TModel> | null;
|
|
636
|
+
registerOpenApiRoute(route: OpenApiRouteDescriptor): void;
|
|
637
|
+
/**
|
|
638
|
+
* Compose OpenAPI paths while synchronously constructing mounted routers.
|
|
639
|
+
* Prefixes apply before collision checks; prior descriptors and Express paths
|
|
640
|
+
* are unchanged. Nested calls compose and the prior scope is restored even on
|
|
641
|
+
* failure. The callback must finish registration synchronously (no async work).
|
|
642
|
+
*/
|
|
643
|
+
withOpenApiPathPrefix<T>(prefix: string, build: () => T): T;
|
|
644
|
+
/**
|
|
645
|
+
* Enable strict OpenAPI collision detection for the remainder of this
|
|
646
|
+
* runtime's lifetime. After this call, conflicting method/path
|
|
647
|
+
* registrations and duplicate operationIds throw {@link OpenApiCollisionError}
|
|
648
|
+
* instead of silently replacing. Existing already-registered routes are
|
|
649
|
+
* not retroactively re-validated.
|
|
650
|
+
*/
|
|
651
|
+
enableOpenApiCollisionDetection(): void;
|
|
652
|
+
getOpenApiRoutes(): OpenApiRouteDescriptor[];
|
|
653
|
+
clearOpenApiRoutes(): void;
|
|
654
|
+
getOpenApiSpec(info: OpenApiDocumentOptions): {
|
|
655
|
+
openapi: string;
|
|
656
|
+
info: Omit<OpenApiDocumentOptions, "servers">;
|
|
657
|
+
servers?: OpenApiDocumentOptions["servers"];
|
|
658
|
+
paths: Record<string, Record<string, {
|
|
659
|
+
[key: `x-${string}`]: unknown;
|
|
660
|
+
operationId?: string;
|
|
661
|
+
summary?: string;
|
|
662
|
+
description?: string;
|
|
663
|
+
tags?: string[];
|
|
664
|
+
deprecated?: boolean;
|
|
665
|
+
parameters?: OpenApiParameter[];
|
|
666
|
+
requestBody?: {
|
|
667
|
+
required?: boolean;
|
|
668
|
+
content: Record<string, {
|
|
669
|
+
schema: OpenApiSchema;
|
|
670
|
+
}>;
|
|
671
|
+
};
|
|
672
|
+
responses: OpenApiResponses;
|
|
673
|
+
}>>;
|
|
674
|
+
};
|
|
675
|
+
createBootstrapSnapshot(): {
|
|
676
|
+
globalOptions: GlobalOptions;
|
|
677
|
+
defaultModelOptions: DefaultModelRouterOptions;
|
|
678
|
+
modelOptions: Record<string, ModelRouterOptions>;
|
|
679
|
+
dataOptions: Record<string, DataRouterOptions>;
|
|
680
|
+
modelInstances: Record<string, mongoose.Model<unknown>>;
|
|
681
|
+
modelJsonSchemas: Record<string, Record<string, unknown>>;
|
|
682
|
+
modelRefs: Record<string, ModelReferenceMap>;
|
|
683
|
+
modelSubs: Record<string, string[]>;
|
|
684
|
+
modelAtts: Record<string, string[]>;
|
|
685
|
+
openApi: {
|
|
686
|
+
routes: OpenApiRouteDescriptor[];
|
|
687
|
+
options: Required<OpenApiRegistryOptions>;
|
|
688
|
+
};
|
|
689
|
+
};
|
|
690
|
+
restoreBootstrapSnapshot(snapshot: ReturnType<AccessRuntime['createBootstrapSnapshot']>): void;
|
|
691
|
+
setGlobalOptions(options: GlobalOptions): void;
|
|
692
|
+
setGlobalOption<K extends keyof GlobalOptions>(key: K, value: GlobalOptions[K]): void;
|
|
693
|
+
getGlobalOptions(): GlobalOptions;
|
|
694
|
+
getGlobalOption<K extends keyof GlobalOptions>(key: K, defaultValue?: GlobalOptions[K]): GlobalOptions[K];
|
|
695
|
+
setDefaultModelOptions(options: DefaultModelRouterOptions): void;
|
|
696
|
+
setDefaultModelOption<K extends keyof ExtendedDefaultModelRouterOptions>(key: K, value: ExtendedDefaultModelRouterOptions[K]): void;
|
|
697
|
+
getDefaultModelOptions(): DefaultModelRouterOptions<unknown>;
|
|
698
|
+
getDefaultModelOption<K extends keyof ExtendedDefaultModelRouterOptions>(key: K, defaultValue?: ExtendedDefaultModelRouterOptions[K]): ExtendedDefaultModelRouterOptions<unknown>[K];
|
|
699
|
+
private createModelOptions;
|
|
700
|
+
private getOrCreateModelOptions;
|
|
701
|
+
setModelOptions<TModel = unknown>(modelName: string, options: ModelRouterOptions<TModel>): void;
|
|
702
|
+
setModelOption<K extends keyof ExtendedModelRouterOptions<TModel>, TModel = unknown>(modelName: string, key: K, value: ExtendedModelRouterOptions<TModel>[K]): void;
|
|
703
|
+
getModelOptions<TModel = unknown>(modelName: string): ModelRouterOptions<TModel>;
|
|
704
|
+
getModelOption<K extends keyof ExtendedModelRouterOptions<TModel>, TModel = unknown>(modelName: string, key: K | string, defaultValue?: ExtendedModelRouterOptions<TModel>[K]): ExtendedModelRouterOptions<TModel>[K];
|
|
705
|
+
getExactModelOption<K extends keyof ExtendedModelRouterOptions<TModel>, TModel = unknown>(modelName: string, key: K | string): ExtendedModelRouterOptions<TModel>[K];
|
|
706
|
+
getModelNames(): string[];
|
|
707
|
+
hasModel(modelName: string): boolean;
|
|
708
|
+
getModelJsonSchema(modelName: string): Record<string, unknown>;
|
|
709
|
+
private createDataOptions;
|
|
710
|
+
private getOrCreateDataOptions;
|
|
711
|
+
setDataOptions<TData = unknown>(dataName: string, options: DataRouterOptions<TData>): void;
|
|
712
|
+
setDataOption<K extends keyof DataRouterOptions<TData>, TData = unknown>(dataName: string, key: K, value: DataRouterOptions<TData>[K]): void;
|
|
713
|
+
getDataOptions<TData = unknown>(dataName: string): DataRouterOptions<TData>;
|
|
714
|
+
getDataSnapshot<TData = unknown>(dataName: string): readonly TData[];
|
|
715
|
+
getDataOption<K extends keyof DataRouterOptions<TData>, TData = unknown>(dataName: string, key: K | string, defaultValue?: DataRouterOptions<TData>[K]): DataRouterOptions<TData>[K];
|
|
716
|
+
getExactDataOption<K extends keyof ExtendedDataRouterOptions<TData>, TData = unknown>(dataName: string, key: K | string): ExtendedDataRouterOptions<TData>[K];
|
|
717
|
+
getDataNames(): string[];
|
|
718
|
+
ensureModelMeta(modelName: string): void;
|
|
719
|
+
getModelRef(modelName: string, refPath: string): string | null;
|
|
720
|
+
getModelSub(modelName: string): string[];
|
|
721
|
+
getModelAtt(modelName: string): string[];
|
|
722
|
+
}
|
|
723
|
+
declare const defaultRuntime: AccessRuntime;
|
|
724
|
+
|
|
456
725
|
declare class RequestConcurrencyScheduler {
|
|
457
726
|
readonly limit: number;
|
|
727
|
+
private activeWork;
|
|
728
|
+
private readonly waiters;
|
|
458
729
|
constructor(limit: number);
|
|
459
730
|
map<TInput, TOutput>(items: TInput[], iteratee: (item: TInput, index: number, scheduled: true) => Promise<TOutput>): Promise<TOutput[]>;
|
|
460
731
|
run<TOutput>(iteratee: (scheduled: true) => Promise<TOutput>): Promise<TOutput>;
|
|
732
|
+
work<TOutput>(operation: () => TOutput | PromiseLike<TOutput>): Promise<TOutput>;
|
|
461
733
|
}
|
|
462
734
|
|
|
463
735
|
type CrossResourceModelOperation = 'list' | 'read' | 'count';
|
|
@@ -468,6 +740,7 @@ interface CorrelatedExecState {
|
|
|
468
740
|
declare class Base<TModel = unknown> {
|
|
469
741
|
protected req: ModelRequest;
|
|
470
742
|
protected modelName: string;
|
|
743
|
+
protected readonly requestRuntime: AccessRuntime;
|
|
471
744
|
constructor(req: ModelRequest, modelName: string);
|
|
472
745
|
decorate<T>(doc: T, access: DecorateAccess, context: ModelHookContext): Promise<T>;
|
|
473
746
|
decorateAll<T>(docs: T[], access: DecorateAllAccess, context: ModelHookContext): Promise<T[]>;
|
|
@@ -507,6 +780,8 @@ declare class Base<TModel = unknown> {
|
|
|
507
780
|
includePaths: string[];
|
|
508
781
|
correlatedReferenceFields: string[];
|
|
509
782
|
};
|
|
783
|
+
private validateIncludeOutputPath;
|
|
784
|
+
private assertIncludeOutputPaths;
|
|
510
785
|
private getForeignKeyValues;
|
|
511
786
|
private getForeignKey;
|
|
512
787
|
private buildForeignKeyIndex;
|
|
@@ -712,6 +987,7 @@ interface PublicReadOptions {
|
|
|
712
987
|
populateAccess?: PopulateAccess;
|
|
713
988
|
lean?: boolean;
|
|
714
989
|
includePermissions?: boolean;
|
|
990
|
+
/** Retry an authorized read miss with list access (default true); requires list operation access. Forbidden/BadRequest never retry. */
|
|
715
991
|
tryList?: boolean;
|
|
716
992
|
}
|
|
717
993
|
|
|
@@ -724,6 +1000,7 @@ interface PublicUpsertArgs extends PublicUpdateArgs {
|
|
|
724
1000
|
}
|
|
725
1001
|
interface UpdateOneArgs<T = unknown> extends Omit<PublicUpdateArgs, 'select' | 'tasks'> {
|
|
726
1002
|
overrides?: {
|
|
1003
|
+
/** Trusted replacement: nullish generates row policy; false returns Forbidden without filter generation or persistence. */
|
|
727
1004
|
filter?: Filter<T>;
|
|
728
1005
|
populate?: Populate[] | string;
|
|
729
1006
|
};
|
|
@@ -731,6 +1008,7 @@ interface UpdateOneArgs<T = unknown> extends Omit<PublicUpdateArgs, 'select' | '
|
|
|
731
1008
|
interface UpdateByIdArgs<T = unknown> extends Omit<UpdateOneArgs<T>, 'overrides'> {
|
|
732
1009
|
overrides?: {
|
|
733
1010
|
populate?: Populate[] | string;
|
|
1011
|
+
/** Nullish resolves the identifier; false denies without ID/filter generation or persistence. Objects still receive row policy. */
|
|
734
1012
|
idFilter?: Filter<T>;
|
|
735
1013
|
};
|
|
736
1014
|
}
|
|
@@ -861,10 +1139,21 @@ type TypedFilterObject<T> = {
|
|
|
861
1139
|
};
|
|
862
1140
|
type TypedFilter<T> = false | TypedFilterObject<WithDefaultId<T>>;
|
|
863
1141
|
type Filter<T = unknown> = IsUnknown<T> extends true ? LooseFilter : TypedFilter<T>;
|
|
1142
|
+
/**
|
|
1143
|
+
* Batched related-data join. Count uses one grouped aggregate per execution,
|
|
1144
|
+
* counting distinct authorized target documents independently of list pagination.
|
|
1145
|
+
* The target schema casts authorized filters/foreign operands; invalid casts return
|
|
1146
|
+
* BadRequest. Query casting does not execute countDocuments middleware/plugins.
|
|
1147
|
+
*/
|
|
864
1148
|
interface LegacyInclude {
|
|
865
1149
|
mode?: 'legacy';
|
|
866
1150
|
model: string;
|
|
867
1151
|
op: 'list' | 'read' | 'count';
|
|
1152
|
+
/**
|
|
1153
|
+
* Output path; must not overlap the receiving model's documentPermissionField
|
|
1154
|
+
* (equal, ancestor or descendant, including equivalent bracket paths).
|
|
1155
|
+
* Nested receiving-model settings apply. Rejected before target persistence.
|
|
1156
|
+
*/
|
|
868
1157
|
path: string;
|
|
869
1158
|
filter?: Filter;
|
|
870
1159
|
localField: string;
|
|
@@ -895,6 +1184,11 @@ interface CorrelatedIncludeBase {
|
|
|
895
1184
|
mode: 'correlated';
|
|
896
1185
|
model: string;
|
|
897
1186
|
op: 'list' | 'read' | 'count';
|
|
1187
|
+
/**
|
|
1188
|
+
* Output-only field path. Must not equal, contain or descend from the receiving
|
|
1189
|
+
* model's documentPermissionField (default `_permissions`). The include tree is
|
|
1190
|
+
* preflighted before target persistence; violations return BadRequest.
|
|
1191
|
+
*/
|
|
898
1192
|
path: string;
|
|
899
1193
|
args?: CorrelatedIncludeArgs;
|
|
900
1194
|
options?: Record<string, never>;
|
|
@@ -921,6 +1215,7 @@ interface CorrelatedCountInclude extends CorrelatedIncludeBase {
|
|
|
921
1215
|
id?: never;
|
|
922
1216
|
}
|
|
923
1217
|
type CorrelatedInclude = CorrelatedReadByIdInclude | CorrelatedReadByFilterInclude | CorrelatedListInclude | CorrelatedCountInclude;
|
|
1218
|
+
/** Related output cannot overwrite authorization metadata at any supported nested level. */
|
|
924
1219
|
type Include = LegacyInclude | CorrelatedInclude;
|
|
925
1220
|
type FindAccess = 'list' | 'read';
|
|
926
1221
|
type PopulateAccess = 'list' | 'read';
|
|
@@ -1218,6 +1513,7 @@ interface FindArgs<T = unknown> {
|
|
|
1218
1513
|
page?: string | number;
|
|
1219
1514
|
pageSize?: string | number;
|
|
1220
1515
|
overrides?: {
|
|
1516
|
+
/** Trusted replacement: nullish generates row policy; false returns Forbidden without filter generation or persistence. */
|
|
1221
1517
|
filter?: Filter<T>;
|
|
1222
1518
|
select?: Projection;
|
|
1223
1519
|
populate?: Populate[] | string;
|
|
@@ -1236,6 +1532,7 @@ interface FindOneArgs<T = unknown> {
|
|
|
1236
1532
|
populate?: Populate[] | string;
|
|
1237
1533
|
include?: Include | Include[];
|
|
1238
1534
|
overrides?: {
|
|
1535
|
+
/** Trusted replacement: nullish generates row policy; false returns Forbidden without filter generation or persistence. */
|
|
1239
1536
|
filter?: Filter<T>;
|
|
1240
1537
|
select?: Projection;
|
|
1241
1538
|
populate?: Populate[] | string;
|
|
@@ -1255,14 +1552,18 @@ interface FindByIdArgs<T = unknown> {
|
|
|
1255
1552
|
overrides?: {
|
|
1256
1553
|
select?: Projection;
|
|
1257
1554
|
populate?: Populate[] | string;
|
|
1555
|
+
/** Nullish resolves the identifier; false denies without ID/filter generation or persistence. Objects still receive row policy. */
|
|
1258
1556
|
idFilter?: Filter<T>;
|
|
1259
1557
|
};
|
|
1260
1558
|
}
|
|
1261
1559
|
interface FindByIdOptions extends FindOneOptions {
|
|
1262
1560
|
}
|
|
1263
1561
|
|
|
1562
|
+
/** Terminal false row policy returns Forbidden in either result mode, before adapter dispatch. */
|
|
1264
1563
|
interface ExistsOptions {
|
|
1564
|
+
/** Row-policy access, defaulting to read. */
|
|
1265
1565
|
access?: BaseFilterAccess;
|
|
1566
|
+
/** Return an `{ _id }` record or null instead of a match/miss boolean. Denial is an ErrorResult, never a miss. */
|
|
1266
1567
|
includeId?: boolean;
|
|
1267
1568
|
}
|
|
1268
1569
|
|
|
@@ -1380,6 +1681,7 @@ interface RootRouterOptions {
|
|
|
1380
1681
|
operationAccess?: Validation;
|
|
1381
1682
|
maxBatchEntries?: number;
|
|
1382
1683
|
maxOrderGroups?: number;
|
|
1684
|
+
/** Whole root operations per order group; separate from requestComplexity.maxBulkConcurrency persistence admission. */
|
|
1383
1685
|
maxConcurrentOperations?: number;
|
|
1384
1686
|
}
|
|
1385
1687
|
interface OperationAccess {
|
|
@@ -1404,6 +1706,7 @@ interface DocPermissions {
|
|
|
1404
1706
|
}
|
|
1405
1707
|
interface DefaultModelRouterOptions<TModel = unknown> {
|
|
1406
1708
|
listHardLimit?: number;
|
|
1709
|
+
/** Authorization metadata path (default `_permissions`); include output cannot equal, contain or descend from it. */
|
|
1407
1710
|
documentPermissionField?: string;
|
|
1408
1711
|
idParam?: string;
|
|
1409
1712
|
idField?: string;
|
|
@@ -1413,6 +1716,19 @@ interface DefaultModelRouterOptions<TModel = unknown> {
|
|
|
1413
1716
|
mutationRouteSegment?: string;
|
|
1414
1717
|
operationAccess?: Validation | OperationAccess;
|
|
1415
1718
|
modelPermissionPrefix?: string;
|
|
1719
|
+
/**
|
|
1720
|
+
* Extra fields allowed in `sort` regardless of `list`/`read` field policy.
|
|
1721
|
+
* Merged as a union with permission-derived allowed fields (`id`/`_id` are
|
|
1722
|
+
* always allowed). Does not grant output visibility, only sortability.
|
|
1723
|
+
*/
|
|
1724
|
+
sortableFields?: string[];
|
|
1725
|
+
/**
|
|
1726
|
+
* When `true`, disallowed `sort` keys are omitted from the sort sent upstream
|
|
1727
|
+
* (Mongoose) instead of returning `BadRequest`. Malformed sort syntax still
|
|
1728
|
+
* returns `BadRequest`. If every key is stripped, no sort is applied.
|
|
1729
|
+
* Defaults to `false` (strict: disallowed sort returns `BadRequest`).
|
|
1730
|
+
*/
|
|
1731
|
+
stripDisallowedSort?: boolean;
|
|
1416
1732
|
}
|
|
1417
1733
|
interface ExtendedDefaultModelRouterOptions<TModel = unknown> extends DefaultModelRouterOptions<TModel> {
|
|
1418
1734
|
'operationAccess.default'?: Validation;
|
|
@@ -1430,6 +1746,11 @@ interface ExtendedDefaultModelRouterOptions<TModel = unknown> extends DefaultMod
|
|
|
1430
1746
|
interface ModelRouterOptions<TModel = unknown> extends DefaultModelRouterOptions<TModel> {
|
|
1431
1747
|
modelName?: string;
|
|
1432
1748
|
basePath?: string;
|
|
1749
|
+
/**
|
|
1750
|
+
* Update grants define assignment boundaries: authorized leaves preserve omitted
|
|
1751
|
+
* siblings; a whole-object/array grant permits replacement (no generic deep merge).
|
|
1752
|
+
* Send nested JSON; literal dotted client keys are not update operators.
|
|
1753
|
+
*/
|
|
1433
1754
|
permissionSchema?: PermissionSchema<AccessRouterFieldKey<TModel>>;
|
|
1434
1755
|
alwaysSelectFields?: string[];
|
|
1435
1756
|
docPermissions?: DocPermissions | ModelDocPermissionsHook;
|
|
@@ -1438,7 +1759,19 @@ interface ModelRouterOptions<TModel = unknown> extends DefaultModelRouterOptions
|
|
|
1438
1759
|
decorate?: ModelHook<TModel> | Record<string, ModelHook<TModel>>;
|
|
1439
1760
|
decorateAll?: ModelListHook<TModel> | Record<string, ModelListHook<TModel>>;
|
|
1440
1761
|
validate?: ValidateRule | ModelValidateHook | Record<string, ValidateRule | ModelValidateHook>;
|
|
1762
|
+
/**
|
|
1763
|
+
* Trusted model hook after validation of selected client data; output is not
|
|
1764
|
+
* re-filtered and may add protected/server-only fields. During update, supplied
|
|
1765
|
+
* children at partial policy ancestors apply without deleting omitted siblings.
|
|
1766
|
+
* Explicit null/undefined can clear/unset a parent; no output means no assignments.
|
|
1767
|
+
* Use transform document setters for deliberate whole-parent replacement.
|
|
1768
|
+
*/
|
|
1441
1769
|
prepare?: ModelHook<TModel> | Record<string, ModelHook<TModel>>;
|
|
1770
|
+
/**
|
|
1771
|
+
* Trusted live-document hook after update assignment and before save. May replace
|
|
1772
|
+
* protected state explicitly with document setters; do not blindly reintroduce
|
|
1773
|
+
* unfiltered context.originalData. Model hooks are not added to subdocument writes.
|
|
1774
|
+
*/
|
|
1442
1775
|
transform?: ModelDocumentHook<TModel> | Record<string, ModelDocumentHook<TModel>>;
|
|
1443
1776
|
afterPersist?: ModelDocumentHook<TModel> | Record<string, ModelDocumentHook<TModel>>;
|
|
1444
1777
|
onChange?: Record<string, ModelChangeHook>;
|
|
@@ -1623,11 +1956,22 @@ declare function fromJoi<TSchema extends JoiSchemaLike>(schema: TSchema): Reques
|
|
|
1623
1956
|
* diagnostics via mutable `validator.errors`; those errors are snapshotted
|
|
1624
1957
|
* synchronously before any suspension so concurrent same-turn validations do
|
|
1625
1958
|
* not observe another input's diagnostics. Asynchronous AJV schemas
|
|
1626
|
-
* (`$async: true`)
|
|
1627
|
-
*
|
|
1628
|
-
*
|
|
1629
|
-
*
|
|
1959
|
+
* (`$async: true`) resolve with validated data, including false/true/null.
|
|
1960
|
+
* AJV `ValidationError` rejections (`ajv: true`, `validation: true`, `errors`
|
|
1961
|
+
* array) are normalized; other throws/rejections preserve operational identity.
|
|
1962
|
+
* Async paths never read shared `validator.errors`.
|
|
1963
|
+
*
|
|
1964
|
+
* Untagged promises/thenables throw TypeError and are observed to prevent
|
|
1965
|
+
* unhandled rejection. Migrate async boolean-verdict wrappers to a custom
|
|
1966
|
+
* RequestSchemaValidator, or retain `$async: true` and return data/reject AJV
|
|
1967
|
+
* validation errors. Sync validators must return boolean verdicts. Real AJV
|
|
1968
|
+
* sync/async validators are accepted without casts; no runtime AJV import is used.
|
|
1969
|
+
* Output is inferred from genuine AJV's type-guard overload (including its async
|
|
1970
|
+
* subtype); structural async output is inferred from the promise. Pass TValue
|
|
1971
|
+
* explicitly for a structural sync boolean validator without a type guard.
|
|
1630
1972
|
*/
|
|
1973
|
+
declare function fromAjv<TValue>(validator: AjvValidatorLike<TValue> & ((value: unknown) => value is TValue)): RequestSchemaValidator<TValue>;
|
|
1974
|
+
/** Adapts structural AJV validators with the same sync-verdict / tagged-async-data contract. */
|
|
1631
1975
|
declare function fromAjv<TValue = unknown>(validator: AjvValidatorLike<TValue>): RequestSchemaValidator<TValue>;
|
|
1632
1976
|
declare function fromValibot<TSchema, TOutput = unknown>(schema: TSchema, safeParse: ValibotSafeParseLike): RequestSchemaValidator<TOutput>;
|
|
1633
1977
|
/**
|
|
@@ -1649,4 +1993,4 @@ declare function fromIoTs<TValue = unknown>(decoder: IoTsDecoderLike<TValue>): R
|
|
|
1649
1993
|
declare function fromSuperstruct<TStruct, TOutput = unknown>(struct: TStruct, validate: SuperstructValidateLike): RequestSchemaValidator<TOutput>;
|
|
1650
1994
|
declare function fromVine<TValue = unknown>(validator: VineValidatorLike<TValue>): RequestSchemaValidator<TValue>;
|
|
1651
1995
|
|
|
1652
|
-
export { type DistinctArgs as $, type AccessRouterBaseRequest as A, type BaseFilterAccess as B, type Change as C, type CreateArgs as D, type CreateOptions as E, type CreateQueryInput as F, CustomHeaders as G, DATA_MIDDLEWARE as H, type DataBaseFilterHook as I, type DataFilter as J, type DataFindArgs as K, type DataFindOneArgs as L, type DataFindOneOptions as M, type DataFindOptions as N, type DataHook as O, type DataHookContext as P, type DataIdentifierHook as Q, type DataListHook as R, type DataOverrideFilterHook as S, type DataRequest as T, type DataRequestSchemas as U, type DataRouterOptions as V, type DecorateAccess as W, type DecorateAllAccess as X, type DeepFieldPath as Y, type DefaultModelRouterOptions as Z, type Defaults as _, type AccessRouterFieldKey as a, type PublicReadOptions as a$, type DistinctBody as a0, type DocPermissionsAccess as a1, type ErrorResult as a2, type ExistsOptions as a3, type ExtendedDataRouterOptions as a4, type ExtendedDefaultModelRouterOptions as a5, type ExtendedModelRouterOptions as a6, type Filter as a7, FilterOperator as a8, type FindAccess as a9, type ModelDocument as aA, type ModelDocumentHook as aB, type ModelHook as aC, type ModelHookContext as aD, type ModelIdentifierHook as aE, type ModelListHook as aF, type ModelOverrideFilterHook as aG, type ModelRequest as aH, type ModelRouterOptions as aI, type ModelValidateHook as aJ, PERMISSIONS as aK, PERMISSION_KEYS as aL, type ParentRef as aM, type PathValue as aN, type PermissionSchema as aO, type Populate as aP, type PopulateAccess as aQ, type PrepareAccess as aR, type Projection as aS, type PublicCreateArgs as aT, type PublicCreateOptions as aU, type PublicErrorResult as aV, type PublicListArgs as aW, type PublicListOptions as aX, type PublicListResult as aY, type PublicOutput as aZ, type PublicReadArgs as a_, type FindArgs as aa, type FindByIdArgs as ab, type FindByIdOptions as ac, type FindOneArgs as ad, type FindOneOptions as ae, type FindOptions as af, type GlobalOptions as ag, type GlobalPermissionValue as ah, type GuardHook as ai, type IdentifierHook as aj, type Include as ak, type IoTsContextEntryLike as al, type IoTsDecodeErrorLike as am, type IoTsDecoderLike as an, type JoiSchemaLike as ao, type JoiValidationErrorDetailLike as ap, type KeyValueProjection as aq, type LegacyInclude as ar, type ListQueryInput as as, type ListResult as at, MIDDLEWARE as au, type MaybePromise as av, type ModelBaseFilterHook as aw, type ModelChangeHook as ax, type ModelDeleteHook as ay, type ModelDocPermissionsHook as az, type AccessRouterLogger as b, type SubdocumentBulkRecord as b$, type PublicServiceResult as b0, type PublicSingleResult as b1, type PublicUpdateArgs as b2, type PublicUpdateOptions as b3, type PublicUpsertArgs as b4, type PublicUpsertOptions as b5, type ReadQueryInput as b6, type Request as b7, type RequestSchemaAdapter as b8, type RequestSchemaFailure as b9, type RootModelUpdateQueryEntry as bA, type RootModelUpsertQueryEntry as bB, type RootOperationResult as bC, type RootQueryEntry as bD, type RootRouterOptions as bE, type RootSubOperation as bF, type RootTarget as bG, type RouteGuardAccess as bH, type SelectAccess as bI, type SelectedPopulatedPublicOutput as bJ, type SelectedPublicOutput as bK, type ServiceResult as bL, type SingleResult as bM, type Sort as bN, type SortOrder as bO, type StandardSchemaFailure as bP, type StandardSchemaInferOutput as bQ, type StandardSchemaIssue as bR, type StandardSchemaPathSegment as bS, type StandardSchemaResult as bT, type StandardSchemaSuccess as bU, type StandardSchemaV1 as bV, StatusCodes as bW, type SubListBody as bX, type SubPopulate as bY, type SubQueryEntry as bZ, type SubReadBody as b_, type RequestSchemaIssue as ba, type RequestSchemaLike as bb, type RequestSchemaOptions as bc, type RequestSchemaResult as bd, type RequestSchemaSuccess as be, type RequestSchemaValidator as bf, type RequestSchemas as bg, type RootDataListQueryEntry as bh, type RootDataOperation as bi, type RootDataReadByFilterQueryEntry as bj, type RootDataReadByIdQueryEntry as bk, type RootModelCountQueryEntry as bl, type RootModelCreateQueryEntry as bm, type RootModelDeleteQueryEntry as bn, type RootModelDistinctQueryEntry as bo, type RootModelListQueryEntry as bp, type RootModelNewQueryEntry as bq, type RootModelOperation as br, type RootModelReadByFilterQueryEntry as bs, type RootModelReadByIdQueryEntry as bt, type RootModelSubBulkUpdateQueryEntry as bu, type RootModelSubCreateQueryEntry as bv, type RootModelSubDeleteQueryEntry as bw, type RootModelSubListQueryEntry as bx, type RootModelSubReadQueryEntry as by, type RootModelSubUpdateQueryEntry as bz, type AccessRouterRequest as c, type SubdocumentBulkUpdateInput as c0, type SubdocumentCreateInput as c1, type SubdocumentCreateOptions as c2, type SubdocumentId as c3, type SubdocumentListOptions as c4, type SubdocumentName as c5, type SubdocumentParentArgs as c6, type SubdocumentParentOptions as c7, type SubdocumentReadOptions as c8, type SubdocumentRecord as c9, type YupValidationErrorLike as cA, defineRequestSchema as cB, fromAjv as cC, fromArkType as cD, fromIoTs as cE, fromJoi as cF, fromStandardSchema as cG, fromSuperstruct as cH, fromValibot as cI, fromVine as cJ, fromYup as cK, fromZod as cL, parseBody as cM, parseBodyWithSchema as cN, parseNestedBodyWithSchema as cO, parsePathParam as cP, parseQuery as cQ,
|
|
1996
|
+
export { type DistinctArgs as $, type AccessRouterBaseRequest as A, type BaseFilterAccess as B, type Change as C, type CreateArgs as D, type CreateOptions as E, type CreateQueryInput as F, CustomHeaders as G, DATA_MIDDLEWARE as H, type DataBaseFilterHook as I, type DataFilter as J, type DataFindArgs as K, type DataFindOneArgs as L, type DataFindOneOptions as M, type DataFindOptions as N, type DataHook as O, type DataHookContext as P, type DataIdentifierHook as Q, type DataListHook as R, type DataOverrideFilterHook as S, type DataRequest as T, type DataRequestSchemas as U, type DataRouterOptions as V, type DecorateAccess as W, type DecorateAllAccess as X, type DeepFieldPath as Y, type DefaultModelRouterOptions as Z, type Defaults as _, type AccessRouterFieldKey as a, type PublicReadOptions as a$, type DistinctBody as a0, type DocPermissionsAccess as a1, type ErrorResult as a2, type ExistsOptions as a3, type ExtendedDataRouterOptions as a4, type ExtendedDefaultModelRouterOptions as a5, type ExtendedModelRouterOptions as a6, type Filter as a7, FilterOperator as a8, type FindAccess as a9, type ModelDocument as aA, type ModelDocumentHook as aB, type ModelHook as aC, type ModelHookContext as aD, type ModelIdentifierHook as aE, type ModelListHook as aF, type ModelOverrideFilterHook as aG, type ModelRequest as aH, type ModelRouterOptions as aI, type ModelValidateHook as aJ, PERMISSIONS as aK, PERMISSION_KEYS as aL, type ParentRef as aM, type PathValue as aN, type PermissionSchema as aO, type Populate as aP, type PopulateAccess as aQ, type PrepareAccess as aR, type Projection as aS, type PublicCreateArgs as aT, type PublicCreateOptions as aU, type PublicErrorResult as aV, type PublicListArgs as aW, type PublicListOptions as aX, type PublicListResult as aY, type PublicOutput as aZ, type PublicReadArgs as a_, type FindArgs as aa, type FindByIdArgs as ab, type FindByIdOptions as ac, type FindOneArgs as ad, type FindOneOptions as ae, type FindOptions as af, type GlobalOptions as ag, type GlobalPermissionValue as ah, type GuardHook as ai, type IdentifierHook as aj, type Include as ak, type IoTsContextEntryLike as al, type IoTsDecodeErrorLike as am, type IoTsDecoderLike as an, type JoiSchemaLike as ao, type JoiValidationErrorDetailLike as ap, type KeyValueProjection as aq, type LegacyInclude as ar, type ListQueryInput as as, type ListResult as at, MIDDLEWARE as au, type MaybePromise as av, type ModelBaseFilterHook as aw, type ModelChangeHook as ax, type ModelDeleteHook as ay, type ModelDocPermissionsHook as az, type AccessRouterLogger as b, type SubdocumentBulkRecord as b$, type PublicServiceResult as b0, type PublicSingleResult as b1, type PublicUpdateArgs as b2, type PublicUpdateOptions as b3, type PublicUpsertArgs as b4, type PublicUpsertOptions as b5, type ReadQueryInput as b6, type Request as b7, type RequestSchemaAdapter as b8, type RequestSchemaFailure as b9, type RootModelUpdateQueryEntry as bA, type RootModelUpsertQueryEntry as bB, type RootOperationResult as bC, type RootQueryEntry as bD, type RootRouterOptions as bE, type RootSubOperation as bF, type RootTarget as bG, type RouteGuardAccess as bH, type SelectAccess as bI, type SelectedPopulatedPublicOutput as bJ, type SelectedPublicOutput as bK, type ServiceResult as bL, type SingleResult as bM, type Sort as bN, type SortOrder as bO, type StandardSchemaFailure as bP, type StandardSchemaInferOutput as bQ, type StandardSchemaIssue as bR, type StandardSchemaPathSegment as bS, type StandardSchemaResult as bT, type StandardSchemaSuccess as bU, type StandardSchemaV1 as bV, StatusCodes as bW, type SubListBody as bX, type SubPopulate as bY, type SubQueryEntry as bZ, type SubReadBody as b_, type RequestSchemaIssue as ba, type RequestSchemaLike as bb, type RequestSchemaOptions as bc, type RequestSchemaResult as bd, type RequestSchemaSuccess as be, type RequestSchemaValidator as bf, type RequestSchemas as bg, type RootDataListQueryEntry as bh, type RootDataOperation as bi, type RootDataReadByFilterQueryEntry as bj, type RootDataReadByIdQueryEntry as bk, type RootModelCountQueryEntry as bl, type RootModelCreateQueryEntry as bm, type RootModelDeleteQueryEntry as bn, type RootModelDistinctQueryEntry as bo, type RootModelListQueryEntry as bp, type RootModelNewQueryEntry as bq, type RootModelOperation as br, type RootModelReadByFilterQueryEntry as bs, type RootModelReadByIdQueryEntry as bt, type RootModelSubBulkUpdateQueryEntry as bu, type RootModelSubCreateQueryEntry as bv, type RootModelSubDeleteQueryEntry as bw, type RootModelSubListQueryEntry as bx, type RootModelSubReadQueryEntry as by, type RootModelSubUpdateQueryEntry as bz, type AccessRouterRequest as c, type OpenApiResponses as c$, type SubdocumentBulkUpdateInput as c0, type SubdocumentCreateInput as c1, type SubdocumentCreateOptions as c2, type SubdocumentId as c3, type SubdocumentListOptions as c4, type SubdocumentName as c5, type SubdocumentParentArgs as c6, type SubdocumentParentOptions as c7, type SubdocumentReadOptions as c8, type SubdocumentRecord as c9, type YupValidationErrorLike as cA, defineRequestSchema as cB, fromAjv as cC, fromArkType as cD, fromIoTs as cE, fromJoi as cF, fromStandardSchema as cG, fromSuperstruct as cH, fromValibot as cI, fromVine as cJ, fromYup as cK, fromZod as cL, parseBody as cM, parseBodyWithSchema as cN, parseNestedBodyWithSchema as cO, parsePathParam as cP, parseQuery as cQ, AccessRuntime as cR, DataService as cS, Service as cT, PublicService as cU, type OpenApiRouterOptions as cV, type OpenApiRegistryOptions as cW, type OpenApiRouteDescriptor as cX, type OpenApiDocumentOptions as cY, type OpenApiParameter as cZ, type OpenApiSchema as c_, type SuperstructFailureLike as ca, type SuperstructValidateLike as cb, type Task as cc, type TaskType as cd, type TransformAccess as ce, type TypedFilter as cf, type UpdateByIdArgs as cg, type UpdateByIdOptions as ch, type UpdateOneArgs as ci, type UpdateOneOptions as cj, type UpdateQueryInput as ck, type UpsertArgs as cl, type UpsertOptions as cm, type UpsertQueryInput as cn, type ValibotIssueLike as co, type ValibotPathItemLike as cp, type ValibotSafeParseLike as cq, type ValibotSafeParseResult as cr, type ValidateAccess as cs, type ValidateRule as ct, type Validation as cu, type ValidationError as cv, type VineValidationErrorLike as cw, type VineValidationMessageLike as cx, type VineValidatorLike as cy, type YupSchemaLike as cz, type AccessRouterRequestExtensions as d, type AccessRouterPermissionMap as d0, type AccessRouterPermissions as d1, type OpenApiMethod as d2, type Permissions as d3, defaultRuntime as d4, 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 AjvValidationErrorLike as m, type AjvValidatorLike as n, type ArkTypeErrorsLike as o, type ArkTypeLike as p, type ArkTypeProblemLike as q, Codes as r, type CorrelatedCountInclude as s, type CorrelatedFilter as t, type CorrelatedInclude as u, type CorrelatedIncludeArgs as v, type CorrelatedListInclude as w, type CorrelatedReadByFilterInclude as x, type CorrelatedReadByIdInclude as y, type CountBody as z };
|