@web-ts-toolkit/access-router 0.3.0 → 0.4.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/advanced.d.mts +3 -134
- package/advanced.d.ts +3 -134
- package/advanced.js +323 -17
- package/advanced.mjs +312 -17
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.js +358 -40
- package/index.mjs +347 -40
- package/package.json +3 -3
- package/{service-DLKAswCS.d.mts → parsers-CsyGHYQR.d.mts} +349 -48
- package/{service-DLKAswCS.d.ts → parsers-CsyGHYQR.d.ts} +349 -48
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import express from 'express';
|
|
3
2
|
import mongoose from 'mongoose';
|
|
4
3
|
import { Diff } from 'deep-diff';
|
|
4
|
+
import express from 'express';
|
|
5
5
|
|
|
6
6
|
interface BooleanObject {
|
|
7
7
|
[key: string]: boolean;
|
|
@@ -865,39 +865,323 @@ type ModelListHook<TValue = unknown> = HookChain<TValue[], ModelHookContext, Mod
|
|
|
865
865
|
type DataHook<TValue = unknown> = HookChain<TValue, DataHookContext, DataRequest>;
|
|
866
866
|
type DataListHook<TValue = unknown> = HookChain<TValue[], DataHookContext, DataRequest>;
|
|
867
867
|
|
|
868
|
+
type ValidationError = {
|
|
869
|
+
detail: string;
|
|
870
|
+
pointer?: string;
|
|
871
|
+
parameter?: string;
|
|
872
|
+
};
|
|
873
|
+
type RequestSchemaIssue = {
|
|
874
|
+
message: string;
|
|
875
|
+
path?: Array<string | number>;
|
|
876
|
+
};
|
|
877
|
+
type RequestSchemaSuccess<T = unknown> = {
|
|
878
|
+
success: true;
|
|
879
|
+
data: T;
|
|
880
|
+
};
|
|
881
|
+
type RequestSchemaFailure = {
|
|
882
|
+
success: false;
|
|
883
|
+
issues: RequestSchemaIssue[];
|
|
884
|
+
};
|
|
885
|
+
type RequestSchemaResult<T = unknown> = RequestSchemaSuccess<T> | RequestSchemaFailure;
|
|
886
|
+
type RequestSchemaValidator<T = unknown> = (value: unknown) => RequestSchemaResult<T> | Promise<RequestSchemaResult<T>>;
|
|
887
|
+
type RequestSchemaAdapter<T = unknown> = {
|
|
888
|
+
validate: RequestSchemaValidator<T>;
|
|
889
|
+
};
|
|
890
|
+
type StandardSchemaPathSegment = {
|
|
891
|
+
key: PropertyKey;
|
|
892
|
+
};
|
|
893
|
+
type StandardSchemaIssue = {
|
|
894
|
+
message: string;
|
|
895
|
+
path?: ReadonlyArray<PropertyKey | StandardSchemaPathSegment>;
|
|
896
|
+
};
|
|
897
|
+
type StandardSchemaSuccess<T = unknown> = {
|
|
898
|
+
value: T;
|
|
899
|
+
issues?: undefined;
|
|
900
|
+
};
|
|
901
|
+
type StandardSchemaFailure = {
|
|
902
|
+
issues: ReadonlyArray<StandardSchemaIssue>;
|
|
903
|
+
};
|
|
904
|
+
type StandardSchemaResult<T = unknown> = StandardSchemaSuccess<T> | StandardSchemaFailure;
|
|
905
|
+
type StandardSchemaV1<Input = unknown, Output = Input> = {
|
|
906
|
+
readonly '~standard': {
|
|
907
|
+
readonly version: 1;
|
|
908
|
+
readonly vendor: string;
|
|
909
|
+
readonly validate: (value: unknown, options?: {
|
|
910
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
911
|
+
}) => StandardSchemaResult<Output> | Promise<StandardSchemaResult<Output>>;
|
|
912
|
+
readonly types?: {
|
|
913
|
+
readonly input: Input;
|
|
914
|
+
readonly output: Output;
|
|
915
|
+
};
|
|
916
|
+
};
|
|
917
|
+
};
|
|
918
|
+
type StandardSchemaInferOutput<TSchema extends StandardSchemaV1> = NonNullable<TSchema['~standard']['types']>['output'];
|
|
919
|
+
type RequestSchemaLike<T = unknown> = RequestSchemaValidator<T> | RequestSchemaAdapter<T> | StandardSchemaV1;
|
|
920
|
+
type YupValidationErrorLike = {
|
|
921
|
+
message: string;
|
|
922
|
+
path?: string;
|
|
923
|
+
inner?: ReadonlyArray<YupValidationErrorLike>;
|
|
924
|
+
};
|
|
925
|
+
type YupSchemaLike<T = unknown> = {
|
|
926
|
+
validate: (value: unknown, options?: {
|
|
927
|
+
abortEarly?: boolean;
|
|
928
|
+
stripUnknown?: boolean;
|
|
929
|
+
}) => Promise<T> | T;
|
|
930
|
+
};
|
|
931
|
+
type JoiValidationErrorDetailLike = {
|
|
932
|
+
message: string;
|
|
933
|
+
path?: ReadonlyArray<string | number>;
|
|
934
|
+
};
|
|
935
|
+
type JoiSchemaLike<T = unknown> = {
|
|
936
|
+
validate: (value: unknown, options?: {
|
|
937
|
+
abortEarly?: boolean;
|
|
938
|
+
stripUnknown?: boolean;
|
|
939
|
+
}) => {
|
|
940
|
+
value: T;
|
|
941
|
+
error?: {
|
|
942
|
+
details?: ReadonlyArray<JoiValidationErrorDetailLike>;
|
|
943
|
+
};
|
|
944
|
+
} | Promise<{
|
|
945
|
+
value: T;
|
|
946
|
+
error?: {
|
|
947
|
+
details?: ReadonlyArray<JoiValidationErrorDetailLike>;
|
|
948
|
+
};
|
|
949
|
+
}>;
|
|
950
|
+
};
|
|
951
|
+
type AjvErrorObjectLike = {
|
|
952
|
+
message?: string;
|
|
953
|
+
instancePath?: string;
|
|
954
|
+
schemaPath?: string;
|
|
955
|
+
params?: {
|
|
956
|
+
missingProperty?: string;
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
type AjvValidatorLike<T = unknown> = {
|
|
960
|
+
(value: unknown): boolean | Promise<boolean>;
|
|
961
|
+
errors?: ReadonlyArray<AjvErrorObjectLike> | null;
|
|
962
|
+
};
|
|
963
|
+
type ValibotPathItemLike = {
|
|
964
|
+
key?: unknown;
|
|
965
|
+
};
|
|
966
|
+
type ValibotIssueLike = {
|
|
967
|
+
message: string;
|
|
968
|
+
path?: ReadonlyArray<ValibotPathItemLike>;
|
|
969
|
+
};
|
|
970
|
+
type ValibotSafeParseResult<T = unknown> = {
|
|
971
|
+
success: true;
|
|
972
|
+
output: T;
|
|
973
|
+
issues?: undefined;
|
|
974
|
+
} | {
|
|
975
|
+
success: false;
|
|
976
|
+
output?: undefined;
|
|
977
|
+
issues: ReadonlyArray<ValibotIssueLike>;
|
|
978
|
+
};
|
|
979
|
+
type ValibotSafeParseLike = <TSchema, TOutput = unknown>(schema: TSchema, value: unknown, config?: {
|
|
980
|
+
abortEarly?: boolean;
|
|
981
|
+
}) => ValibotSafeParseResult<TOutput> | Promise<ValibotSafeParseResult<TOutput>>;
|
|
982
|
+
type ArkTypeProblemLike = {
|
|
983
|
+
path?: ReadonlyArray<string | number>;
|
|
984
|
+
message?: string;
|
|
985
|
+
problem?: string;
|
|
986
|
+
};
|
|
987
|
+
type ArkTypeErrorsLike = ReadonlyArray<ArkTypeProblemLike> & {
|
|
988
|
+
summary?: string;
|
|
989
|
+
};
|
|
990
|
+
type ArkTypeLike<T = unknown> = {
|
|
991
|
+
(value: unknown): T | ArkTypeErrorsLike;
|
|
992
|
+
errors?: unknown;
|
|
993
|
+
};
|
|
994
|
+
type IoTsContextEntryLike = {
|
|
995
|
+
key: string;
|
|
996
|
+
};
|
|
997
|
+
type IoTsDecodeErrorLike = {
|
|
998
|
+
message?: string;
|
|
999
|
+
context: ReadonlyArray<IoTsContextEntryLike>;
|
|
1000
|
+
};
|
|
1001
|
+
type IoTsDecoderLike<T = unknown> = {
|
|
1002
|
+
decode: (value: unknown) => {
|
|
1003
|
+
_tag: 'Left';
|
|
1004
|
+
left: ReadonlyArray<IoTsDecodeErrorLike>;
|
|
1005
|
+
} | {
|
|
1006
|
+
_tag: 'Right';
|
|
1007
|
+
right: T;
|
|
1008
|
+
};
|
|
1009
|
+
};
|
|
1010
|
+
type SuperstructFailureLike = {
|
|
1011
|
+
message?: string;
|
|
1012
|
+
path?: ReadonlyArray<string | number>;
|
|
1013
|
+
key?: string | number;
|
|
1014
|
+
branch?: ReadonlyArray<unknown>;
|
|
1015
|
+
failures?: () => ReadonlyArray<SuperstructFailureLike>;
|
|
1016
|
+
};
|
|
1017
|
+
type SuperstructValidateLike = <TStruct, TOutput = unknown>(value: unknown, struct: TStruct) => readonly [failure: SuperstructFailureLike, value: undefined] | readonly [failure: undefined, value: TOutput] | Promise<readonly [failure: SuperstructFailureLike, value: undefined] | readonly [failure: undefined, value: TOutput]>;
|
|
1018
|
+
type VineValidationMessageLike = {
|
|
1019
|
+
field: string;
|
|
1020
|
+
message: string;
|
|
1021
|
+
index?: number;
|
|
1022
|
+
};
|
|
1023
|
+
type VineValidationErrorLike = {
|
|
1024
|
+
messages: ReadonlyArray<VineValidationMessageLike>;
|
|
1025
|
+
};
|
|
1026
|
+
type VineValidatorLike<T = unknown> = {
|
|
1027
|
+
validate: (value: unknown) => Promise<T> | T;
|
|
1028
|
+
};
|
|
1029
|
+
type ListQueryInput = {
|
|
1030
|
+
skip?: string;
|
|
1031
|
+
limit?: string;
|
|
1032
|
+
page?: string;
|
|
1033
|
+
page_size?: string;
|
|
1034
|
+
skim?: 'true' | 'false';
|
|
1035
|
+
include_permissions?: 'true' | 'false';
|
|
1036
|
+
include_count?: 'true' | 'false';
|
|
1037
|
+
include_extra_headers?: 'true' | 'false';
|
|
1038
|
+
};
|
|
1039
|
+
type CreateQueryInput = {
|
|
1040
|
+
include_permissions?: 'true' | 'false';
|
|
1041
|
+
};
|
|
1042
|
+
type ReadQueryInput = {
|
|
1043
|
+
include_permissions?: 'true' | 'false';
|
|
1044
|
+
try_list?: 'true' | 'false';
|
|
1045
|
+
};
|
|
1046
|
+
type UpdateQueryInput = {
|
|
1047
|
+
returning_all?: 'true' | 'false';
|
|
1048
|
+
};
|
|
1049
|
+
type UpsertQueryInput = {
|
|
1050
|
+
returning_all?: 'true' | 'false';
|
|
1051
|
+
include_permissions?: 'true' | 'false';
|
|
1052
|
+
};
|
|
1053
|
+
type AdvancedListBody = {
|
|
1054
|
+
filter?: Filter | unknown[];
|
|
1055
|
+
select?: Projection;
|
|
1056
|
+
sort?: Sort;
|
|
1057
|
+
populate?: Populate[] | string;
|
|
1058
|
+
include?: Include | Include[];
|
|
1059
|
+
tasks?: Task | Task[];
|
|
1060
|
+
skip?: string | number;
|
|
1061
|
+
limit?: string | number;
|
|
1062
|
+
page?: string | number;
|
|
1063
|
+
pageSize?: string | number;
|
|
1064
|
+
options?: {
|
|
1065
|
+
skim?: boolean;
|
|
1066
|
+
includePermissions?: boolean;
|
|
1067
|
+
includeCount?: boolean;
|
|
1068
|
+
includeExtraHeaders?: boolean;
|
|
1069
|
+
populateAccess?: unknown;
|
|
1070
|
+
};
|
|
1071
|
+
};
|
|
1072
|
+
type CountBody = {
|
|
1073
|
+
filter?: Filter | unknown[];
|
|
1074
|
+
options?: {
|
|
1075
|
+
access?: unknown;
|
|
1076
|
+
};
|
|
1077
|
+
};
|
|
1078
|
+
type AdvancedReadFilterBody = {
|
|
1079
|
+
filter?: Filter | unknown[];
|
|
1080
|
+
select?: Projection;
|
|
1081
|
+
sort?: Sort;
|
|
1082
|
+
populate?: Populate[] | string;
|
|
1083
|
+
include?: Include | Include[];
|
|
1084
|
+
tasks?: Task | Task[];
|
|
1085
|
+
options?: {
|
|
1086
|
+
skim?: boolean;
|
|
1087
|
+
includePermissions?: boolean;
|
|
1088
|
+
tryList?: boolean;
|
|
1089
|
+
populateAccess?: unknown;
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1092
|
+
type AdvancedReadBody = {
|
|
1093
|
+
select?: Projection;
|
|
1094
|
+
populate?: Populate[] | string;
|
|
1095
|
+
include?: Include | Include[];
|
|
1096
|
+
tasks?: Task | Task[];
|
|
1097
|
+
options?: {
|
|
1098
|
+
skim?: boolean;
|
|
1099
|
+
includePermissions?: boolean;
|
|
1100
|
+
tryList?: boolean;
|
|
1101
|
+
populateAccess?: unknown;
|
|
1102
|
+
};
|
|
1103
|
+
};
|
|
1104
|
+
type AdvancedCreateBody = {
|
|
1105
|
+
data: unknown;
|
|
1106
|
+
select?: Projection;
|
|
1107
|
+
populate?: Populate[] | string;
|
|
1108
|
+
tasks?: Task | Task[];
|
|
1109
|
+
options?: {
|
|
1110
|
+
includePermissions?: boolean;
|
|
1111
|
+
populateAccess?: unknown;
|
|
1112
|
+
};
|
|
1113
|
+
};
|
|
1114
|
+
type AdvancedUpdateBody = {
|
|
1115
|
+
data: unknown;
|
|
1116
|
+
select?: Projection;
|
|
1117
|
+
populate?: Populate[] | string;
|
|
1118
|
+
tasks?: Task | Task[];
|
|
1119
|
+
options?: {
|
|
1120
|
+
returningAll?: boolean;
|
|
1121
|
+
includePermissions?: boolean;
|
|
1122
|
+
populateAccess?: unknown;
|
|
1123
|
+
};
|
|
1124
|
+
};
|
|
1125
|
+
type AdvancedUpsertBody = {
|
|
1126
|
+
data: Record<string, unknown>;
|
|
1127
|
+
select?: Projection;
|
|
1128
|
+
populate?: Populate[] | string;
|
|
1129
|
+
tasks?: Task | Task[];
|
|
1130
|
+
options?: {
|
|
1131
|
+
returningAll?: boolean;
|
|
1132
|
+
includePermissions?: boolean;
|
|
1133
|
+
populateAccess?: unknown;
|
|
1134
|
+
};
|
|
1135
|
+
};
|
|
1136
|
+
type DistinctBody = {
|
|
1137
|
+
filter?: Filter | unknown[];
|
|
1138
|
+
};
|
|
1139
|
+
type SubListBody = {
|
|
1140
|
+
filter?: Filter;
|
|
1141
|
+
select?: string[];
|
|
1142
|
+
};
|
|
1143
|
+
type SubReadBody = {
|
|
1144
|
+
select?: string[];
|
|
1145
|
+
populate?: SubPopulate | SubPopulate[] | string | string[];
|
|
1146
|
+
};
|
|
1147
|
+
|
|
868
1148
|
interface DefaultFindOneArgs<TModel = unknown> extends Omit<FindOneArgs<TModel>, 'overrides'> {
|
|
869
1149
|
}
|
|
870
1150
|
interface DefaultFindByIdArgs<TModel = unknown> extends Omit<FindByIdArgs<TModel>, 'overrides'> {
|
|
871
1151
|
}
|
|
872
1152
|
interface DefaultFindArgs<TModel = unknown> extends Omit<FindArgs<TModel>, 'overrides'> {
|
|
873
1153
|
}
|
|
874
|
-
type
|
|
1154
|
+
type RequestSchema = RequestSchemaLike;
|
|
1155
|
+
type NestedRequestSchema = {
|
|
1156
|
+
default?: RequestSchema;
|
|
1157
|
+
data?: RequestSchema;
|
|
1158
|
+
};
|
|
875
1159
|
type SubRouteGuardOptions = Record<string, Validation | Record<string, Validation>>;
|
|
876
1160
|
interface RequestSchemas {
|
|
877
|
-
create?:
|
|
878
|
-
update?:
|
|
879
|
-
upsert?:
|
|
880
|
-
count?:
|
|
881
|
-
distinct?:
|
|
882
|
-
advancedList?:
|
|
883
|
-
advancedReadFilter?:
|
|
884
|
-
advancedRead?:
|
|
885
|
-
advancedCreate?:
|
|
886
|
-
advancedCreateData?:
|
|
887
|
-
advancedUpdate?:
|
|
888
|
-
advancedUpdateData?:
|
|
889
|
-
advancedUpsert?:
|
|
890
|
-
advancedUpsertData?:
|
|
891
|
-
subList?:
|
|
892
|
-
subRead?:
|
|
893
|
-
subCreate?:
|
|
894
|
-
subUpdate?:
|
|
895
|
-
subBulkUpdate?:
|
|
1161
|
+
create?: RequestSchema;
|
|
1162
|
+
update?: RequestSchema;
|
|
1163
|
+
upsert?: RequestSchema;
|
|
1164
|
+
count?: RequestSchema;
|
|
1165
|
+
distinct?: RequestSchema;
|
|
1166
|
+
advancedList?: RequestSchema;
|
|
1167
|
+
advancedReadFilter?: RequestSchema;
|
|
1168
|
+
advancedRead?: RequestSchema;
|
|
1169
|
+
advancedCreate?: RequestSchema | NestedRequestSchema;
|
|
1170
|
+
advancedCreateData?: RequestSchema;
|
|
1171
|
+
advancedUpdate?: RequestSchema | NestedRequestSchema;
|
|
1172
|
+
advancedUpdateData?: RequestSchema;
|
|
1173
|
+
advancedUpsert?: RequestSchema | NestedRequestSchema;
|
|
1174
|
+
advancedUpsertData?: RequestSchema;
|
|
1175
|
+
subList?: RequestSchema;
|
|
1176
|
+
subRead?: RequestSchema;
|
|
1177
|
+
subCreate?: RequestSchema;
|
|
1178
|
+
subUpdate?: RequestSchema;
|
|
1179
|
+
subBulkUpdate?: RequestSchema;
|
|
896
1180
|
}
|
|
897
1181
|
interface DataRequestSchemas {
|
|
898
|
-
advancedList?:
|
|
899
|
-
advancedReadFilter?:
|
|
900
|
-
advancedRead?:
|
|
1182
|
+
advancedList?: RequestSchema;
|
|
1183
|
+
advancedReadFilter?: RequestSchema;
|
|
1184
|
+
advancedRead?: RequestSchema;
|
|
901
1185
|
}
|
|
902
1186
|
interface Defaults<TModel = unknown> {
|
|
903
1187
|
findOneArgs?: DefaultFindOneArgs<TModel>;
|
|
@@ -1061,26 +1345,26 @@ interface ExtendedModelRouterOptions<TModel = unknown> extends ModelRouterOption
|
|
|
1061
1345
|
'afterPersist.create'?: ModelDocumentHook;
|
|
1062
1346
|
'afterPersist.update'?: ModelDocumentHook;
|
|
1063
1347
|
onChange?: Record<string, ModelChangeHook>;
|
|
1064
|
-
'requestSchemas.create'?:
|
|
1065
|
-
'requestSchemas.update'?:
|
|
1066
|
-
'requestSchemas.upsert'?:
|
|
1067
|
-
'requestSchemas.count'?:
|
|
1068
|
-
'requestSchemas.distinct'?:
|
|
1069
|
-
'requestSchemas.advancedList'?:
|
|
1070
|
-
'requestSchemas.advancedReadFilter'?:
|
|
1071
|
-
'requestSchemas.advancedRead'?:
|
|
1072
|
-
'requestSchemas.advancedCreate.default'?:
|
|
1073
|
-
'requestSchemas.advancedCreate.data'?:
|
|
1074
|
-
'requestSchemas.advancedUpdate'?:
|
|
1075
|
-
'requestSchemas.advancedUpdate.default'?:
|
|
1076
|
-
'requestSchemas.advancedUpdate.data'?:
|
|
1077
|
-
'requestSchemas.advancedUpsert.default'?:
|
|
1078
|
-
'requestSchemas.advancedUpsert.data'?:
|
|
1079
|
-
'requestSchemas.subList'?:
|
|
1080
|
-
'requestSchemas.subRead'?:
|
|
1081
|
-
'requestSchemas.subCreate'?:
|
|
1082
|
-
'requestSchemas.subUpdate'?:
|
|
1083
|
-
'requestSchemas.subBulkUpdate'?:
|
|
1348
|
+
'requestSchemas.create'?: RequestSchema;
|
|
1349
|
+
'requestSchemas.update'?: RequestSchema;
|
|
1350
|
+
'requestSchemas.upsert'?: RequestSchema;
|
|
1351
|
+
'requestSchemas.count'?: RequestSchema;
|
|
1352
|
+
'requestSchemas.distinct'?: RequestSchema;
|
|
1353
|
+
'requestSchemas.advancedList'?: RequestSchema;
|
|
1354
|
+
'requestSchemas.advancedReadFilter'?: RequestSchema;
|
|
1355
|
+
'requestSchemas.advancedRead'?: RequestSchema;
|
|
1356
|
+
'requestSchemas.advancedCreate.default'?: RequestSchema;
|
|
1357
|
+
'requestSchemas.advancedCreate.data'?: RequestSchema;
|
|
1358
|
+
'requestSchemas.advancedUpdate'?: RequestSchema;
|
|
1359
|
+
'requestSchemas.advancedUpdate.default'?: RequestSchema;
|
|
1360
|
+
'requestSchemas.advancedUpdate.data'?: RequestSchema;
|
|
1361
|
+
'requestSchemas.advancedUpsert.default'?: RequestSchema;
|
|
1362
|
+
'requestSchemas.advancedUpsert.data'?: RequestSchema;
|
|
1363
|
+
'requestSchemas.subList'?: RequestSchema;
|
|
1364
|
+
'requestSchemas.subRead'?: RequestSchema;
|
|
1365
|
+
'requestSchemas.subCreate'?: RequestSchema;
|
|
1366
|
+
'requestSchemas.subUpdate'?: RequestSchema;
|
|
1367
|
+
'requestSchemas.subBulkUpdate'?: RequestSchema;
|
|
1084
1368
|
'defaults.findOneArgs'?: DefaultFindOneArgs<TModel>;
|
|
1085
1369
|
'defaults.findOneOptions'?: FindOneOptions;
|
|
1086
1370
|
'defaults.findByIdArgs'?: DefaultFindByIdArgs<TModel>;
|
|
@@ -1105,13 +1389,30 @@ interface ExtendedModelRouterOptions<TModel = unknown> extends ModelRouterOption
|
|
|
1105
1389
|
'defaults.publicUpdateOptions'?: PublicUpdateOptions;
|
|
1106
1390
|
}
|
|
1107
1391
|
interface ExtendedDataRouterOptions<TData = unknown> extends DataRouterOptions<TData> {
|
|
1108
|
-
'requestSchemas.advancedList'?:
|
|
1109
|
-
'requestSchemas.advancedReadFilter'?:
|
|
1110
|
-
'requestSchemas.advancedRead'?:
|
|
1392
|
+
'requestSchemas.advancedList'?: RequestSchema;
|
|
1393
|
+
'requestSchemas.advancedReadFilter'?: RequestSchema;
|
|
1394
|
+
'requestSchemas.advancedRead'?: RequestSchema;
|
|
1111
1395
|
}
|
|
1112
1396
|
|
|
1113
1397
|
interface DistinctArgs<T = unknown> {
|
|
1114
1398
|
filter?: Filter<T>;
|
|
1115
1399
|
}
|
|
1116
1400
|
|
|
1117
|
-
|
|
1401
|
+
declare function parsePathParam(value: string | string[] | undefined, parameter: string): string;
|
|
1402
|
+
declare function parseQuery<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown): z.output<TSchema>;
|
|
1403
|
+
declare function parseBody<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown): z.output<TSchema>;
|
|
1404
|
+
declare function parseBodyWithSchema<TSchema extends z.ZodTypeAny>(schema: TSchema, value: unknown, userSchema?: RequestSchemaLike): Promise<z.output<TSchema>>;
|
|
1405
|
+
declare function parseNestedBodyWithSchema(schema: z.ZodTypeAny, value: unknown, nestedKey: string, userSchema?: RequestSchemaLike): Promise<Record<string, unknown>>;
|
|
1406
|
+
declare function defineRequestSchema<T = unknown>(validator: RequestSchemaValidator<T>): RequestSchemaValidator<T>;
|
|
1407
|
+
declare function fromZod<TSchema extends z.ZodTypeAny>(schema: TSchema): RequestSchemaValidator<z.output<TSchema>>;
|
|
1408
|
+
declare function fromStandardSchema<TSchema extends StandardSchemaV1>(schema: TSchema): RequestSchemaValidator<StandardSchemaInferOutput<TSchema>>;
|
|
1409
|
+
declare function fromYup<TSchema extends YupSchemaLike>(schema: TSchema): RequestSchemaValidator;
|
|
1410
|
+
declare function fromJoi<TSchema extends JoiSchemaLike>(schema: TSchema): RequestSchemaValidator;
|
|
1411
|
+
declare function fromAjv<TValue = unknown>(validator: AjvValidatorLike<TValue>): RequestSchemaValidator<TValue>;
|
|
1412
|
+
declare function fromValibot<TSchema, TOutput = unknown>(schema: TSchema, safeParse: ValibotSafeParseLike): RequestSchemaValidator<TOutput>;
|
|
1413
|
+
declare function fromArkType<TValue = unknown>(type: ArkTypeLike<TValue>): RequestSchemaValidator<TValue>;
|
|
1414
|
+
declare function fromIoTs<TValue = unknown>(decoder: IoTsDecoderLike<TValue>): RequestSchemaValidator<TValue>;
|
|
1415
|
+
declare function fromSuperstruct<TStruct, TOutput = unknown>(struct: TStruct, validate: SuperstructValidateLike): RequestSchemaValidator<TOutput>;
|
|
1416
|
+
declare function fromVine<TValue = unknown>(validator: VineValidatorLike<TValue>): RequestSchemaValidator<TValue>;
|
|
1417
|
+
|
|
1418
|
+
export { type FindAccess as $, type AccessRouterBaseRequest as A, type BaseFilterAccess as B, Codes as C, type DataBaseFilterHook as D, type DataHook as E, type DataHookContext as F, type DataIdentifierHook as G, type DataListHook as H, type DataOverrideFilterHook as I, type DataRequest as J, type DataRequestSchemas as K, type DataRouterOptions as L, type DecorateAccess as M, type DecorateAllAccess as N, type DeepFieldPath as O, type DefaultModelRouterOptions as P, type Defaults as Q, type DistinctArgs as R, type DistinctBody as S, type DocPermissionsAccess as T, type ErrorResult as U, type ExistsOptions as V, type ExtendedDataRouterOptions as W, type ExtendedDefaultModelRouterOptions as X, type ExtendedModelRouterOptions as Y, type Filter as Z, FilterOperator as _, type AccessRouterFieldKey as a, type RootDataReadByFilterQueryEntry as a$, type FindArgs as a0, type FindByIdArgs as a1, type FindByIdOptions as a2, type FindOneArgs as a3, type FindOneOptions as a4, type FindOptions as a5, type GlobalOptions as a6, type GlobalPermissionValue as a7, type GuardHook as a8, type IdentifierHook as a9, type Populate as aA, type PopulateAccess as aB, type PrepareAccess as aC, type Projection as aD, type PublicCreateArgs as aE, type PublicCreateOptions as aF, type PublicListArgs as aG, type PublicListOptions as aH, type PublicOutput as aI, type PublicReadArgs as aJ, type PublicReadOptions as aK, type PublicUpdateArgs as aL, type PublicUpdateOptions as aM, type PublicUpsertArgs as aN, type PublicUpsertOptions as aO, type ReadQueryInput as aP, type Request as aQ, type RequestSchemaAdapter as aR, type RequestSchemaFailure as aS, type RequestSchemaIssue as aT, type RequestSchemaLike as aU, type RequestSchemaResult as aV, type RequestSchemaSuccess as aW, type RequestSchemaValidator as aX, type RequestSchemas as aY, type RootDataListQueryEntry as aZ, type RootDataOperation as a_, type Include as aa, type IoTsContextEntryLike as ab, type IoTsDecodeErrorLike as ac, type IoTsDecoderLike as ad, type JoiSchemaLike as ae, type JoiValidationErrorDetailLike as af, type KeyValueProjection as ag, type ListQueryInput as ah, type ListResult as ai, type MaybePromise as aj, type ModelBaseFilterHook as ak, type ModelChangeHook as al, type ModelDeleteHook as am, type ModelDocPermissionsHook as an, type ModelDocument as ao, type ModelDocumentHook as ap, type ModelHook as aq, type ModelHookContext as ar, type ModelIdentifierHook as as, type ModelListHook as at, type ModelOverrideFilterHook as au, type ModelRequest as av, type ModelRouterOptions as aw, type ModelValidateHook as ax, type PathValue as ay, type PermissionSchema as az, type AccessRouterLogger as b, type ValidationError as b$, type RootDataReadByIdQueryEntry as b0, type RootModelCountQueryEntry as b1, type RootModelCreateQueryEntry as b2, type RootModelDeleteQueryEntry as b3, type RootModelDistinctQueryEntry as b4, type RootModelListQueryEntry as b5, type RootModelNewQueryEntry as b6, type RootModelOperation as b7, type RootModelReadByFilterQueryEntry as b8, type RootModelReadByIdQueryEntry as b9, type StandardSchemaSuccess as bA, type StandardSchemaV1 as bB, StatusCodes as bC, type SubListBody as bD, type SubPopulate as bE, type SubQueryEntry as bF, type SubReadBody as bG, type SuperstructFailureLike as bH, type SuperstructValidateLike as bI, type Task as bJ, type TransformAccess as bK, type TypedFilter as bL, type UpdateByIdArgs as bM, type UpdateByIdOptions as bN, type UpdateOneArgs as bO, type UpdateOneOptions as bP, type UpdateQueryInput as bQ, type UpsertArgs as bR, type UpsertOptions as bS, type UpsertQueryInput as bT, type ValibotIssueLike as bU, type ValibotPathItemLike as bV, type ValibotSafeParseLike as bW, type ValibotSafeParseResult as bX, type ValidateAccess as bY, type ValidateRule as bZ, type Validation as b_, type RootModelSubBulkUpdateQueryEntry as ba, type RootModelSubCreateQueryEntry as bb, type RootModelSubDeleteQueryEntry as bc, type RootModelSubListQueryEntry as bd, type RootModelSubReadQueryEntry as be, type RootModelSubUpdateQueryEntry as bf, type RootModelUpdateQueryEntry as bg, type RootModelUpsertQueryEntry as bh, type RootOperationResult as bi, type RootQueryEntry as bj, type RootRouterOptions as bk, type RootSubOperation as bl, type RootTarget as bm, type RouteGuardAccess as bn, type SelectAccess as bo, type SelectedPopulatedPublicOutput as bp, type SelectedPublicOutput as bq, type ServiceResult as br, type SingleResult as bs, type Sort as bt, type SortOrder as bu, type StandardSchemaFailure as bv, type StandardSchemaInferOutput as bw, type StandardSchemaIssue as bx, type StandardSchemaPathSegment as by, type StandardSchemaResult as bz, type AccessRouterRequest as c, type VineValidationErrorLike as c0, type VineValidationMessageLike as c1, type VineValidatorLike as c2, type YupSchemaLike as c3, type YupValidationErrorLike as c4, defineRequestSchema as c5, fromAjv as c6, fromArkType as c7, fromIoTs as c8, fromJoi as c9, fromStandardSchema as ca, fromSuperstruct as cb, fromValibot as cc, fromVine as cd, fromYup as ce, fromZod as cf, parseBody as cg, parseBodyWithSchema as ch, parseNestedBodyWithSchema as ci, parsePathParam as cj, parseQuery as ck, DataService as cl, Model as cm, Service as cn, PublicService as co, type AccessRouterPermissionMap as cp, type AccessRouterPermissions as cq, type Permissions as cr, type AccessRouterRequestExtensions as d, type AdvancedCreateBody as e, type AdvancedListBody as f, type AdvancedReadBody as g, type AdvancedReadFilterBody as h, type AdvancedUpdateBody as i, type AdvancedUpsertBody as j, type AfterPersistAccess as k, type AjvErrorObjectLike as l, type AjvValidatorLike as m, type ArkTypeErrorsLike as n, type ArkTypeLike as o, type ArkTypeProblemLike as p, type CountBody as q, type CreateArgs as r, type CreateOptions as s, type CreateQueryInput as t, CustomHeaders as u, type DataFilter as v, type DataFindArgs as w, type DataFindOneArgs as x, type DataFindOneOptions as y, type DataFindOptions as z };
|