@nhtio/lucid-resourceful 0.1.0-master-888baa5f → 0.1.0-master-71781cfd
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/{definitions-B66EPk0H.js → definitions-B88XBTUF.js} +119 -119
- package/{definitions-B66EPk0H.js.map → definitions-B88XBTUF.js.map} +1 -1
- package/{definitions-BrN-oCRI.cjs → definitions-DgI468dW.cjs} +119 -119
- package/{definitions-BrN-oCRI.cjs.map → definitions-DgI468dW.cjs.map} +1 -1
- package/definitions.cjs +1 -1
- package/definitions.mjs +1 -1
- package/index.cjs +387 -401
- package/index.cjs.map +1 -1
- package/index.mjs +374 -388
- package/index.mjs.map +1 -1
- package/joi.cjs +12389 -2
- package/joi.cjs.map +1 -1
- package/joi.mjs +12391 -2
- package/joi.mjs.map +1 -1
- package/package.json +1 -1
- package/private/joi/index.d.ts +3 -65
- package/private/mixin.d.ts +4 -1
- package/index-Cv6KC1rC.cjs +0 -670
- package/index-Cv6KC1rC.cjs.map +0 -1
- package/index-DDaZ2qr2.js +0 -671
- package/index-DDaZ2qr2.js.map +0 -1
- package/private/joi/bigint.d.ts +0 -85
package/index.mjs
CHANGED
|
@@ -11,12 +11,12 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
12
|
var _a, _hookHandlers, _cleanupHandlers, _state, _handlersToIgnore, _skipAllHooks, _Runner_instances, filter_fn, exec_fn, _b, _hooks, _c, _d;
|
|
13
13
|
import { I as isObject$1, J as isResourcefulModel, K as CRUDOperationsEnum, L as operationCRUDToACL, M as ACLOperationsEnum, N as isFunction, O as prepareFields, P as isString$1, Q as DateTime, F as consumeString, u as prepareString, y as consumeBinary, m as prepareBinary, D as consumeNumber, s as prepareNumber, C as consumeInteger, r as prepareInteger, x as consumeBigint, l as prepareBigint, G as consumeUnsignedint, v as prepareUnsignedint, z as consumeBoolean, n as prepareBoolean, E as consumeObject, t as prepareObject, w as consumeArray, p as prepareArray } from "./decorator_utils-YSb1EGJ6.js";
|
|
14
|
-
import {
|
|
14
|
+
import { joi as Q_ } from "./joi.mjs";
|
|
15
15
|
import { parse as parse$2, SyntaxError as SyntaxError$1 } from "liqe";
|
|
16
16
|
import { d as E_LUCENE_SYNTAX_EXCEPTION, e as E_LUCENE_UNEXPECTED_EXCEPTION, f as E_LUCENE_INVALID_TYPE, g as E_INVALID_RESOURCEFUL_MIXIN_OPTIONS, h as E_MISSING_PRIMARY_KEY_EXCEPTION, i as E_FORBIDDEN, j as E_INVALID_COLUMN_ACCESS, k as E_INVALID_RESOUREFUL_INDEX_REQUEST_EXCEPTION, l as E_RECORD_NOT_FOUND_EXCEPTION, m as E_INVALID_PAYLOAD_EXCEPTION, n as E_FORBIDDEN_PAYLOAD_EXCEPTION, o as createError, p as Exception, q as getDefaultExportFromCjs, r as commonjsGlobal, s as index_default, t as defineStaticProperty, u as lodash, v as E_INVALID_RESOURCEFUL_DECORATOR_OPTIONS } from "./errors-B1rr67uM.js";
|
|
17
17
|
import { w } from "./errors-B1rr67uM.js";
|
|
18
|
-
import { R as ResourcefulArrayType, a as ResourcefulObjectType, b as ResourcefulBooleanType, c as ResourcefulUnsignedIntegerType, d as ResourcefulBigintType, e as ResourcefulIntegerType, f as ResourcefulNumberType, g as ResourcefulBinaryType, h as ResourcefulDateTimeType, i as ResourcefulDateType, j as ResourcefulStringType } from "./definitions-
|
|
19
|
-
import { k } from "./definitions-
|
|
18
|
+
import { R as ResourcefulArrayType, a as ResourcefulObjectType, b as ResourcefulBooleanType, c as ResourcefulUnsignedIntegerType, d as ResourcefulBigintType, e as ResourcefulIntegerType, f as ResourcefulNumberType, g as ResourcefulBinaryType, h as ResourcefulDateTimeType, i as ResourcefulDateType, j as ResourcefulStringType } from "./definitions-B88XBTUF.js";
|
|
19
|
+
import { k } from "./definitions-B88XBTUF.js";
|
|
20
20
|
import require$$0, { debuglog } from "util";
|
|
21
21
|
import "node:path";
|
|
22
22
|
import "node:url";
|
|
@@ -598,31 +598,31 @@ const getFieldKey = (key, definition) => {
|
|
|
598
598
|
};
|
|
599
599
|
function withResourceful(options = {}) {
|
|
600
600
|
return (superclass) => {
|
|
601
|
-
const optionsSchema =
|
|
602
|
-
name:
|
|
603
|
-
readRequiredForWrite:
|
|
604
|
-
accessControlFilters:
|
|
605
|
-
list:
|
|
606
|
-
create:
|
|
607
|
-
read:
|
|
608
|
-
update:
|
|
609
|
-
delete:
|
|
601
|
+
const optionsSchema = Q_.object({
|
|
602
|
+
name: Q_.string().default(superclass.name),
|
|
603
|
+
readRequiredForWrite: Q_.boolean().default(false),
|
|
604
|
+
accessControlFilters: Q_.object({
|
|
605
|
+
list: Q_.array().items(Q_.function()).default([]),
|
|
606
|
+
create: Q_.array().items(Q_.function()).default([]),
|
|
607
|
+
read: Q_.array().items(Q_.function()).default([]),
|
|
608
|
+
update: Q_.array().items(Q_.function()).default([]),
|
|
609
|
+
delete: Q_.array().items(Q_.function()).default([])
|
|
610
610
|
}).default({}),
|
|
611
|
-
onACLError:
|
|
612
|
-
onValidationScopeError:
|
|
613
|
-
queryScopeCallbacks:
|
|
614
|
-
list:
|
|
615
|
-
access:
|
|
611
|
+
onACLError: Q_.string().valid(...ResourcefulErrorHandlerMethod).default("throw"),
|
|
612
|
+
onValidationScopeError: Q_.string().valid(...ResourcefulErrorHandlerMethod).default("throw"),
|
|
613
|
+
queryScopeCallbacks: Q_.object({
|
|
614
|
+
list: Q_.array().items(Q_.function()).default([]),
|
|
615
|
+
access: Q_.array().items(Q_.function()).default([])
|
|
616
616
|
}).default({}),
|
|
617
|
-
description:
|
|
618
|
-
externalDocs:
|
|
619
|
-
description:
|
|
620
|
-
url:
|
|
617
|
+
description: Q_.string().optional(),
|
|
618
|
+
externalDocs: Q_.object({
|
|
619
|
+
description: Q_.string().optional(),
|
|
620
|
+
url: Q_.string().uri().required()
|
|
621
621
|
}).optional(),
|
|
622
|
-
example:
|
|
623
|
-
advanced:
|
|
624
|
-
propertyEvaluationConcurrency:
|
|
625
|
-
aclEvaluationConcurrency:
|
|
622
|
+
example: Q_.string().optional(),
|
|
623
|
+
advanced: Q_.object({
|
|
624
|
+
propertyEvaluationConcurrency: Q_.number().integer().min(1).default(10),
|
|
625
|
+
aclEvaluationConcurrency: Q_.number().integer().min(1).default(2)
|
|
626
626
|
}).default({
|
|
627
627
|
propertyEvaluationConcurrency: 10,
|
|
628
628
|
aclEvaluationConcurrency: 2
|
|
@@ -763,7 +763,7 @@ function withResourceful(options = {}) {
|
|
|
763
763
|
"relationship"
|
|
764
764
|
),
|
|
765
765
|
kind: "relationship",
|
|
766
|
-
validator:
|
|
766
|
+
validator: Q_.forbidden(),
|
|
767
767
|
relatedModel: relationshipDefinition.relatedModel
|
|
768
768
|
};
|
|
769
769
|
if (!resourcefulModelRelationshipMetaSchema.canRead && !resourcefulModelRelationshipMetaSchema.canWrite)
|
|
@@ -778,7 +778,7 @@ function withResourceful(options = {}) {
|
|
|
778
778
|
}
|
|
779
779
|
static $getPropertyValidator(ctx, app, key, datatype, nullable, validationScopes, kind, writable = false) {
|
|
780
780
|
if ("relationship" === kind || "computedAccessor" === kind && !writable) {
|
|
781
|
-
return
|
|
781
|
+
return Q_.any().forbidden();
|
|
782
782
|
}
|
|
783
783
|
const baseValidator = this.$getPropertyBaseValidator(datatype, nullable, kind, writable);
|
|
784
784
|
if (Array.isArray(validationScopes) && validationScopes.length > 0) {
|
|
@@ -800,7 +800,7 @@ function withResourceful(options = {}) {
|
|
|
800
800
|
case "pass":
|
|
801
801
|
break;
|
|
802
802
|
case "fail":
|
|
803
|
-
return
|
|
803
|
+
return Q_.any().forbidden();
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
806
|
});
|
|
@@ -809,13 +809,13 @@ function withResourceful(options = {}) {
|
|
|
809
809
|
}
|
|
810
810
|
static $getPropertyBaseValidator(datatype, nullable, kind, writable = false) {
|
|
811
811
|
if ("relationship" === kind || "computedAccessor" === kind && !writable) {
|
|
812
|
-
return
|
|
812
|
+
return Q_.any().forbidden();
|
|
813
813
|
}
|
|
814
814
|
nullable = nullable || "boolean" === typeof datatype.nullable && datatype.nullable;
|
|
815
815
|
switch (true) {
|
|
816
816
|
case datatype instanceof ResourcefulStringType: {
|
|
817
817
|
const d = datatype;
|
|
818
|
-
const r =
|
|
818
|
+
const r = Q_.string().min(d.minLength).max(d.maxLength);
|
|
819
819
|
if (d.pattern) {
|
|
820
820
|
r.pattern(new RegExp(d.pattern));
|
|
821
821
|
}
|
|
@@ -828,14 +828,14 @@ function withResourceful(options = {}) {
|
|
|
828
828
|
return r;
|
|
829
829
|
}
|
|
830
830
|
case datatype instanceof ResourcefulDateType: {
|
|
831
|
-
const r =
|
|
831
|
+
const r = Q_.date().iso();
|
|
832
832
|
if (nullable) {
|
|
833
833
|
r.allow(null);
|
|
834
834
|
}
|
|
835
835
|
return r;
|
|
836
836
|
}
|
|
837
837
|
case datatype instanceof ResourcefulDateTimeType: {
|
|
838
|
-
const r =
|
|
838
|
+
const r = Q_.date().iso();
|
|
839
839
|
if (nullable) {
|
|
840
840
|
r.allow(null);
|
|
841
841
|
}
|
|
@@ -843,7 +843,7 @@ function withResourceful(options = {}) {
|
|
|
843
843
|
}
|
|
844
844
|
case datatype instanceof ResourcefulBinaryType: {
|
|
845
845
|
const d = datatype;
|
|
846
|
-
const r =
|
|
846
|
+
const r = Q_.string();
|
|
847
847
|
if (nullable) {
|
|
848
848
|
r.allow(null);
|
|
849
849
|
}
|
|
@@ -857,7 +857,7 @@ function withResourceful(options = {}) {
|
|
|
857
857
|
}
|
|
858
858
|
case datatype instanceof ResourcefulNumberType: {
|
|
859
859
|
const d = datatype;
|
|
860
|
-
const r =
|
|
860
|
+
const r = Q_.number();
|
|
861
861
|
if (nullable) {
|
|
862
862
|
r.allow(null);
|
|
863
863
|
}
|
|
@@ -876,7 +876,7 @@ function withResourceful(options = {}) {
|
|
|
876
876
|
}
|
|
877
877
|
case datatype instanceof ResourcefulIntegerType: {
|
|
878
878
|
const d = datatype;
|
|
879
|
-
const r =
|
|
879
|
+
const r = Q_.number();
|
|
880
880
|
if (nullable) {
|
|
881
881
|
r.allow(null);
|
|
882
882
|
}
|
|
@@ -895,7 +895,7 @@ function withResourceful(options = {}) {
|
|
|
895
895
|
}
|
|
896
896
|
case datatype instanceof ResourcefulBigintType: {
|
|
897
897
|
const d = datatype;
|
|
898
|
-
const r =
|
|
898
|
+
const r = Q_.bigint();
|
|
899
899
|
if (nullable) {
|
|
900
900
|
r.allow(null);
|
|
901
901
|
}
|
|
@@ -914,7 +914,7 @@ function withResourceful(options = {}) {
|
|
|
914
914
|
}
|
|
915
915
|
case datatype instanceof ResourcefulUnsignedIntegerType: {
|
|
916
916
|
const d = datatype;
|
|
917
|
-
const r =
|
|
917
|
+
const r = Q_.number().unsafe();
|
|
918
918
|
if (nullable) {
|
|
919
919
|
r.allow(null);
|
|
920
920
|
}
|
|
@@ -932,7 +932,7 @@ function withResourceful(options = {}) {
|
|
|
932
932
|
return r;
|
|
933
933
|
}
|
|
934
934
|
case datatype instanceof ResourcefulBooleanType: {
|
|
935
|
-
const r =
|
|
935
|
+
const r = Q_.boolean();
|
|
936
936
|
if (nullable) {
|
|
937
937
|
r.allow(null);
|
|
938
938
|
}
|
|
@@ -952,7 +952,7 @@ function withResourceful(options = {}) {
|
|
|
952
952
|
!(item.readOnly || false)
|
|
953
953
|
)
|
|
954
954
|
);
|
|
955
|
-
propValidator =
|
|
955
|
+
propValidator = Q_.alternatives().try(...alternatives);
|
|
956
956
|
} else if ("allOf" in propDef) {
|
|
957
957
|
const schemas = propDef.allOf.map(
|
|
958
958
|
(item) => this.$getPropertyBaseValidator(
|
|
@@ -962,7 +962,7 @@ function withResourceful(options = {}) {
|
|
|
962
962
|
!(item.readOnly || false)
|
|
963
963
|
)
|
|
964
964
|
);
|
|
965
|
-
propValidator = schemas.reduce((acc, schema) => acc.concat(schema),
|
|
965
|
+
propValidator = schemas.reduce((acc, schema) => acc.concat(schema), Q_.any());
|
|
966
966
|
} else if ("anyOf" in propDef) {
|
|
967
967
|
const alternatives = propDef.anyOf.map(
|
|
968
968
|
(item) => this.$getPropertyBaseValidator(
|
|
@@ -972,7 +972,7 @@ function withResourceful(options = {}) {
|
|
|
972
972
|
!(item.readOnly || false)
|
|
973
973
|
)
|
|
974
974
|
);
|
|
975
|
-
propValidator =
|
|
975
|
+
propValidator = Q_.alternatives().try(...alternatives);
|
|
976
976
|
} else if ("not" in propDef) {
|
|
977
977
|
const notSchemas = propDef.not.map(
|
|
978
978
|
(item) => this.$getPropertyBaseValidator(
|
|
@@ -982,7 +982,7 @@ function withResourceful(options = {}) {
|
|
|
982
982
|
!(item.readOnly || false)
|
|
983
983
|
)
|
|
984
984
|
);
|
|
985
|
-
propValidator =
|
|
985
|
+
propValidator = Q_.any().not(...notSchemas);
|
|
986
986
|
} else {
|
|
987
987
|
propValidator = this.$getPropertyBaseValidator(
|
|
988
988
|
propDef,
|
|
@@ -996,7 +996,7 @@ function withResourceful(options = {}) {
|
|
|
996
996
|
}
|
|
997
997
|
objectSchema[propKey] = propValidator;
|
|
998
998
|
});
|
|
999
|
-
const r =
|
|
999
|
+
const r = Q_.object(objectSchema);
|
|
1000
1000
|
if (nullable) {
|
|
1001
1001
|
r.allow(null);
|
|
1002
1002
|
}
|
|
@@ -1009,7 +1009,7 @@ function withResourceful(options = {}) {
|
|
|
1009
1009
|
if (isObject$1(d.additionalProperties)) {
|
|
1010
1010
|
const additionalPropertiesType = d.additionalProperties;
|
|
1011
1011
|
r.pattern(
|
|
1012
|
-
|
|
1012
|
+
Q_.string(),
|
|
1013
1013
|
this.$getPropertyBaseValidator(
|
|
1014
1014
|
additionalPropertiesType,
|
|
1015
1015
|
additionalPropertiesType.nullable || false,
|
|
@@ -1024,7 +1024,7 @@ function withResourceful(options = {}) {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
case datatype instanceof ResourcefulArrayType: {
|
|
1026
1026
|
const d = datatype;
|
|
1027
|
-
const r =
|
|
1027
|
+
const r = Q_.array();
|
|
1028
1028
|
if (nullable) {
|
|
1029
1029
|
r.allow(null);
|
|
1030
1030
|
}
|
|
@@ -1038,7 +1038,7 @@ function withResourceful(options = {}) {
|
|
|
1038
1038
|
!(item.readOnly || false)
|
|
1039
1039
|
)
|
|
1040
1040
|
);
|
|
1041
|
-
itemValidator =
|
|
1041
|
+
itemValidator = Q_.alternatives().try(...alternatives);
|
|
1042
1042
|
} else if ("allOf" in d.items) {
|
|
1043
1043
|
const schemas = d.items.allOf.map(
|
|
1044
1044
|
(item) => this.$getPropertyBaseValidator(
|
|
@@ -1048,7 +1048,7 @@ function withResourceful(options = {}) {
|
|
|
1048
1048
|
!(item.readOnly || false)
|
|
1049
1049
|
)
|
|
1050
1050
|
);
|
|
1051
|
-
itemValidator = schemas.reduce((acc, schema) => acc.concat(schema),
|
|
1051
|
+
itemValidator = schemas.reduce((acc, schema) => acc.concat(schema), Q_.any());
|
|
1052
1052
|
} else if ("anyOf" in d.items) {
|
|
1053
1053
|
const alternatives = d.items.anyOf.map(
|
|
1054
1054
|
(item) => this.$getPropertyBaseValidator(
|
|
@@ -1058,7 +1058,7 @@ function withResourceful(options = {}) {
|
|
|
1058
1058
|
!(item.readOnly || false)
|
|
1059
1059
|
)
|
|
1060
1060
|
);
|
|
1061
|
-
itemValidator =
|
|
1061
|
+
itemValidator = Q_.alternatives().try(...alternatives);
|
|
1062
1062
|
} else if ("not" in d.items) {
|
|
1063
1063
|
const notSchemas = d.items.not.map(
|
|
1064
1064
|
(item) => this.$getPropertyBaseValidator(
|
|
@@ -1068,7 +1068,7 @@ function withResourceful(options = {}) {
|
|
|
1068
1068
|
!(item.readOnly || false)
|
|
1069
1069
|
)
|
|
1070
1070
|
);
|
|
1071
|
-
itemValidator =
|
|
1071
|
+
itemValidator = Q_.any().not(...notSchemas);
|
|
1072
1072
|
} else {
|
|
1073
1073
|
itemValidator = this.$getPropertyBaseValidator(
|
|
1074
1074
|
d.items,
|
|
@@ -1090,7 +1090,7 @@ function withResourceful(options = {}) {
|
|
|
1090
1090
|
return r;
|
|
1091
1091
|
}
|
|
1092
1092
|
default:
|
|
1093
|
-
return
|
|
1093
|
+
return Q_.any().forbidden();
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
1096
|
static async $getPropertyCanReadWrite(ctx, app, key, lucidDefinition, readAclFilters = [], writeAclFilters = [], kind, writable = false) {
|
|
@@ -1192,7 +1192,6 @@ function withResourceful(options = {}) {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
static $resourcefulModelColumnMetaToOpenApiSchema(propertyKey, propertyMeta) {
|
|
1194
1194
|
const ret = stripUndefinedValuesFromObject({
|
|
1195
|
-
type: propertyMeta.definition.type,
|
|
1196
1195
|
items: propertyMeta.definition.items,
|
|
1197
1196
|
title: getFieldKey(propertyKey, propertyMeta.lucidDefinitions) || propertyKey,
|
|
1198
1197
|
description: propertyMeta.definition.description,
|
|
@@ -1223,13 +1222,13 @@ function withResourceful(options = {}) {
|
|
|
1223
1222
|
readOnly: propertyMeta.canRead && !propertyMeta.canWrite,
|
|
1224
1223
|
writeOnly: !propertyMeta.canRead && propertyMeta.canWrite,
|
|
1225
1224
|
externalDocs: propertyMeta.definition.externalDocs,
|
|
1226
|
-
example: propertyMeta.definition.example
|
|
1225
|
+
example: propertyMeta.definition.example,
|
|
1226
|
+
...propertyMeta.definition.type
|
|
1227
1227
|
});
|
|
1228
1228
|
return ret;
|
|
1229
1229
|
}
|
|
1230
1230
|
static $resourcefulModelComputedAccessorMetaToOpenApiSchema(propertyKey, propertyMeta) {
|
|
1231
1231
|
const ret = stripUndefinedValuesFromObject({
|
|
1232
|
-
type: propertyMeta.definition.type,
|
|
1233
1232
|
items: propertyMeta.definition.items,
|
|
1234
1233
|
title: getFieldKey(propertyKey, propertyMeta.lucidDefinitions) || propertyKey,
|
|
1235
1234
|
description: propertyMeta.definition.description,
|
|
@@ -1260,7 +1259,8 @@ function withResourceful(options = {}) {
|
|
|
1260
1259
|
readOnly: propertyMeta.canRead && !propertyMeta.canWrite,
|
|
1261
1260
|
writeOnly: !propertyMeta.canRead && propertyMeta.canWrite,
|
|
1262
1261
|
externalDocs: propertyMeta.definition.externalDocs,
|
|
1263
|
-
example: propertyMeta.definition.example
|
|
1262
|
+
example: propertyMeta.definition.example,
|
|
1263
|
+
...propertyMeta.definition.type
|
|
1264
1264
|
});
|
|
1265
1265
|
return ret;
|
|
1266
1266
|
}
|
|
@@ -1443,7 +1443,7 @@ function withResourceful(options = {}) {
|
|
|
1443
1443
|
static $resourcefulGetQueryBuilder() {
|
|
1444
1444
|
return this.$adapter.modelConstructorClient(this).query().from(this.table);
|
|
1445
1445
|
}
|
|
1446
|
-
static async $onResourcefulIndex(filter, page, perPage, fields, ctx, app, hooks = []) {
|
|
1446
|
+
static async $onResourcefulIndex(filter, page, perPage, fields, sort, ctx, app, hooks = []) {
|
|
1447
1447
|
var _a2;
|
|
1448
1448
|
const primaryKey = this.$getPrivateKeyAttribute();
|
|
1449
1449
|
if (!primaryKey) {
|
|
@@ -1465,11 +1465,11 @@ function withResourceful(options = {}) {
|
|
|
1465
1465
|
if (possibleFields.length === 0) {
|
|
1466
1466
|
throw new E_INVALID_COLUMN_ACCESS("No fields available for access");
|
|
1467
1467
|
}
|
|
1468
|
-
const schema =
|
|
1469
|
-
filter:
|
|
1470
|
-
page:
|
|
1471
|
-
perPage:
|
|
1472
|
-
fields:
|
|
1468
|
+
const schema = Q_.object({
|
|
1469
|
+
filter: Q_.string().allow("").required(),
|
|
1470
|
+
page: Q_.number().integer().min(1).required(),
|
|
1471
|
+
perPage: Q_.number().integer().min(1).max(100).required(),
|
|
1472
|
+
fields: Q_.array().items(Q_.string().valid(...possibleFields)).required()
|
|
1473
1473
|
});
|
|
1474
1474
|
const { error: methodValidationError, value: validatedMethodOptions } = schema.validate(
|
|
1475
1475
|
{
|
|
@@ -1504,6 +1504,13 @@ function withResourceful(options = {}) {
|
|
|
1504
1504
|
const recordsQuery = query.clone();
|
|
1505
1505
|
countQuery.count("*", "total");
|
|
1506
1506
|
recordsQuery.select(columnsToSelect).forPage(validatedMethodOptions.page, validatedMethodOptions.perPage);
|
|
1507
|
+
if (Array.isArray(sort) && sort.length > 0) {
|
|
1508
|
+
sort.forEach(([field, direction]) => {
|
|
1509
|
+
if (allowedFieldsMap.has(field)) {
|
|
1510
|
+
recordsQuery.orderBy(field, direction);
|
|
1511
|
+
}
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1507
1514
|
const countQueryQuery = countQuery.toQuery();
|
|
1508
1515
|
const recordsQueryQuery = recordsQuery.toQuery();
|
|
1509
1516
|
const [countResults, rawRecords] = await Promise.all([countQuery, recordsQuery]);
|
|
@@ -2806,7 +2813,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
2806
2813
|
var ys = arrObjKeys(obj, inspect2);
|
|
2807
2814
|
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
2808
2815
|
var protoTag = obj instanceof Object ? "" : "null prototype";
|
|
2809
|
-
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
|
|
2816
|
+
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
|
|
2810
2817
|
var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
|
|
2811
2818
|
var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
|
|
2812
2819
|
if (ys.length === 0) {
|
|
@@ -2831,25 +2838,25 @@ function canTrustToString(obj) {
|
|
|
2831
2838
|
return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
|
|
2832
2839
|
}
|
|
2833
2840
|
function isArray$3(obj) {
|
|
2834
|
-
return toStr(obj) === "[object Array]" && canTrustToString(obj);
|
|
2841
|
+
return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
|
|
2835
2842
|
}
|
|
2836
2843
|
function isDate(obj) {
|
|
2837
|
-
return toStr(obj) === "[object Date]" && canTrustToString(obj);
|
|
2844
|
+
return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
|
|
2838
2845
|
}
|
|
2839
2846
|
function isRegExp$1(obj) {
|
|
2840
|
-
return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
|
|
2847
|
+
return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
|
|
2841
2848
|
}
|
|
2842
2849
|
function isError(obj) {
|
|
2843
|
-
return toStr(obj) === "[object Error]" && canTrustToString(obj);
|
|
2850
|
+
return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
|
|
2844
2851
|
}
|
|
2845
2852
|
function isString(obj) {
|
|
2846
|
-
return toStr(obj) === "[object String]" && canTrustToString(obj);
|
|
2853
|
+
return toStr$1(obj) === "[object String]" && canTrustToString(obj);
|
|
2847
2854
|
}
|
|
2848
2855
|
function isNumber(obj) {
|
|
2849
|
-
return toStr(obj) === "[object Number]" && canTrustToString(obj);
|
|
2856
|
+
return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
|
|
2850
2857
|
}
|
|
2851
2858
|
function isBoolean(obj) {
|
|
2852
|
-
return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
|
|
2859
|
+
return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
|
|
2853
2860
|
}
|
|
2854
2861
|
function isSymbol(obj) {
|
|
2855
2862
|
if (hasShammedSymbols) {
|
|
@@ -2885,7 +2892,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
|
|
|
2885
2892
|
function has$3(obj, key) {
|
|
2886
2893
|
return hasOwn$1.call(obj, key);
|
|
2887
2894
|
}
|
|
2888
|
-
function toStr(obj) {
|
|
2895
|
+
function toStr$1(obj) {
|
|
2889
2896
|
return objectToString.call(obj);
|
|
2890
2897
|
}
|
|
2891
2898
|
function nameOf(f) {
|
|
@@ -3194,7 +3201,7 @@ var syntax = SyntaxError;
|
|
|
3194
3201
|
var uri = URIError;
|
|
3195
3202
|
var abs$1 = Math.abs;
|
|
3196
3203
|
var floor$1 = Math.floor;
|
|
3197
|
-
var max$
|
|
3204
|
+
var max$2 = Math.max;
|
|
3198
3205
|
var min$1 = Math.min;
|
|
3199
3206
|
var pow$1 = Math.pow;
|
|
3200
3207
|
var round$1 = Math.round;
|
|
@@ -3323,99 +3330,78 @@ function requireObject_getPrototypeOf() {
|
|
|
3323
3330
|
Object_getPrototypeOf = $Object2.getPrototypeOf || null;
|
|
3324
3331
|
return Object_getPrototypeOf;
|
|
3325
3332
|
}
|
|
3326
|
-
var
|
|
3327
|
-
var
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
var
|
|
3332
|
-
var
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
var
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
}
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
var str = "";
|
|
3354
|
-
for (var i = 0; i < arr.length; i += 1) {
|
|
3355
|
-
str += arr[i];
|
|
3356
|
-
if (i + 1 < arr.length) {
|
|
3357
|
-
str += joiner;
|
|
3358
|
-
}
|
|
3333
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
3334
|
+
var toStr = Object.prototype.toString;
|
|
3335
|
+
var max$1 = Math.max;
|
|
3336
|
+
var funcType = "[object Function]";
|
|
3337
|
+
var concatty = function concatty2(a2, b) {
|
|
3338
|
+
var arr = [];
|
|
3339
|
+
for (var i = 0; i < a2.length; i += 1) {
|
|
3340
|
+
arr[i] = a2[i];
|
|
3341
|
+
}
|
|
3342
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
3343
|
+
arr[j + a2.length] = b[j];
|
|
3344
|
+
}
|
|
3345
|
+
return arr;
|
|
3346
|
+
};
|
|
3347
|
+
var slicy = function slicy2(arrLike, offset) {
|
|
3348
|
+
var arr = [];
|
|
3349
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
3350
|
+
arr[j] = arrLike[i];
|
|
3351
|
+
}
|
|
3352
|
+
return arr;
|
|
3353
|
+
};
|
|
3354
|
+
var joiny = function(arr, joiner) {
|
|
3355
|
+
var str = "";
|
|
3356
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
3357
|
+
str += arr[i];
|
|
3358
|
+
if (i + 1 < arr.length) {
|
|
3359
|
+
str += joiner;
|
|
3359
3360
|
}
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
);
|
|
3375
|
-
if (Object(result) === result) {
|
|
3376
|
-
return result;
|
|
3377
|
-
}
|
|
3378
|
-
return this;
|
|
3379
|
-
}
|
|
3380
|
-
return target.apply(
|
|
3381
|
-
that,
|
|
3361
|
+
}
|
|
3362
|
+
return str;
|
|
3363
|
+
};
|
|
3364
|
+
var implementation$1 = function bind(that) {
|
|
3365
|
+
var target = this;
|
|
3366
|
+
if (typeof target !== "function" || toStr.apply(target) !== funcType) {
|
|
3367
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
3368
|
+
}
|
|
3369
|
+
var args = slicy(arguments, 1);
|
|
3370
|
+
var bound;
|
|
3371
|
+
var binder = function() {
|
|
3372
|
+
if (this instanceof bound) {
|
|
3373
|
+
var result = target.apply(
|
|
3374
|
+
this,
|
|
3382
3375
|
concatty(args, arguments)
|
|
3383
3376
|
);
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
boundArgs[i] = "$" + i;
|
|
3389
|
-
}
|
|
3390
|
-
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
3391
|
-
if (target.prototype) {
|
|
3392
|
-
var Empty = function Empty2() {
|
|
3393
|
-
};
|
|
3394
|
-
Empty.prototype = target.prototype;
|
|
3395
|
-
bound.prototype = new Empty();
|
|
3396
|
-
Empty.prototype = null;
|
|
3377
|
+
if (Object(result) === result) {
|
|
3378
|
+
return result;
|
|
3379
|
+
}
|
|
3380
|
+
return this;
|
|
3397
3381
|
}
|
|
3398
|
-
return
|
|
3382
|
+
return target.apply(
|
|
3383
|
+
that,
|
|
3384
|
+
concatty(args, arguments)
|
|
3385
|
+
);
|
|
3399
3386
|
};
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
var
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
}
|
|
3387
|
+
var boundLength = max$1(0, target.length - args.length);
|
|
3388
|
+
var boundArgs = [];
|
|
3389
|
+
for (var i = 0; i < boundLength; i++) {
|
|
3390
|
+
boundArgs[i] = "$" + i;
|
|
3391
|
+
}
|
|
3392
|
+
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
3393
|
+
if (target.prototype) {
|
|
3394
|
+
var Empty = function Empty2() {
|
|
3395
|
+
};
|
|
3396
|
+
Empty.prototype = target.prototype;
|
|
3397
|
+
bound.prototype = new Empty();
|
|
3398
|
+
Empty.prototype = null;
|
|
3399
|
+
}
|
|
3400
|
+
return bound;
|
|
3401
|
+
};
|
|
3402
|
+
var implementation = implementation$1;
|
|
3403
|
+
var functionBind = Function.prototype.bind || implementation;
|
|
3404
|
+
var functionCall = Function.prototype.call;
|
|
3419
3405
|
var functionApply;
|
|
3420
3406
|
var hasRequiredFunctionApply;
|
|
3421
3407
|
function requireFunctionApply() {
|
|
@@ -3425,14 +3411,14 @@ function requireFunctionApply() {
|
|
|
3425
3411
|
return functionApply;
|
|
3426
3412
|
}
|
|
3427
3413
|
var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
|
|
3428
|
-
var bind$2 =
|
|
3414
|
+
var bind$2 = functionBind;
|
|
3429
3415
|
var $apply$1 = requireFunctionApply();
|
|
3430
|
-
var $call$2 =
|
|
3416
|
+
var $call$2 = functionCall;
|
|
3431
3417
|
var $reflectApply = reflectApply;
|
|
3432
3418
|
var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
|
|
3433
|
-
var bind$1 =
|
|
3419
|
+
var bind$1 = functionBind;
|
|
3434
3420
|
var $TypeError$4 = type;
|
|
3435
|
-
var $call$1 =
|
|
3421
|
+
var $call$1 = functionCall;
|
|
3436
3422
|
var $actualApply = actualApply;
|
|
3437
3423
|
var callBindApplyHelpers = function callBindBasic(args) {
|
|
3438
3424
|
if (args.length < 1 || typeof args[0] !== "function") {
|
|
@@ -3498,8 +3484,8 @@ function requireHasown() {
|
|
|
3498
3484
|
hasRequiredHasown = 1;
|
|
3499
3485
|
var call = Function.prototype.call;
|
|
3500
3486
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
3501
|
-
var
|
|
3502
|
-
hasown =
|
|
3487
|
+
var bind3 = functionBind;
|
|
3488
|
+
hasown = bind3.call(call, $hasOwn);
|
|
3503
3489
|
return hasown;
|
|
3504
3490
|
}
|
|
3505
3491
|
var undefined$1;
|
|
@@ -3513,7 +3499,7 @@ var $TypeError$3 = type;
|
|
|
3513
3499
|
var $URIError = uri;
|
|
3514
3500
|
var abs = abs$1;
|
|
3515
3501
|
var floor = floor$1;
|
|
3516
|
-
var max = max$
|
|
3502
|
+
var max = max$2;
|
|
3517
3503
|
var min = min$1;
|
|
3518
3504
|
var pow = pow$1;
|
|
3519
3505
|
var round = round$1;
|
|
@@ -3547,7 +3533,7 @@ var getProto = requireGetProto();
|
|
|
3547
3533
|
var $ObjectGPO = requireObject_getPrototypeOf();
|
|
3548
3534
|
var $ReflectGPO = requireReflect_getPrototypeOf();
|
|
3549
3535
|
var $apply = requireFunctionApply();
|
|
3550
|
-
var $call =
|
|
3536
|
+
var $call = functionCall;
|
|
3551
3537
|
var needsEval = {};
|
|
3552
3538
|
var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
3553
3539
|
var INTRINSICS = {
|
|
@@ -3718,13 +3704,13 @@ var LEGACY_ALIASES = {
|
|
|
3718
3704
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
3719
3705
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
3720
3706
|
};
|
|
3721
|
-
var
|
|
3707
|
+
var bind2 = functionBind;
|
|
3722
3708
|
var hasOwn = requireHasown();
|
|
3723
|
-
var $concat =
|
|
3724
|
-
var $spliceApply =
|
|
3725
|
-
var $replace =
|
|
3726
|
-
var $strSlice =
|
|
3727
|
-
var $exec =
|
|
3709
|
+
var $concat = bind2.call($call, Array.prototype.concat);
|
|
3710
|
+
var $spliceApply = bind2.call($apply, Array.prototype.splice);
|
|
3711
|
+
var $replace = bind2.call($call, String.prototype.replace);
|
|
3712
|
+
var $strSlice = bind2.call($call, String.prototype.slice);
|
|
3713
|
+
var $exec = bind2.call($call, RegExp.prototype.exec);
|
|
3728
3714
|
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
3729
3715
|
var reEscapeChar = /\\(\\)?/g;
|
|
3730
3716
|
var stringToPath = function stringToPath2(string) {
|
|
@@ -11800,25 +11786,25 @@ const validateNormalizeAndCastDecoratorOptions = (fieldName, decoratorName, sche
|
|
|
11800
11786
|
}
|
|
11801
11787
|
return value;
|
|
11802
11788
|
};
|
|
11803
|
-
const resourcefulPropertyDefinitionSchema =
|
|
11804
|
-
propertyKey:
|
|
11805
|
-
readAccessControlFilters:
|
|
11806
|
-
writeAccessControlFilters:
|
|
11807
|
-
nullable:
|
|
11808
|
-
description:
|
|
11809
|
-
default:
|
|
11810
|
-
externalDocs:
|
|
11811
|
-
description:
|
|
11812
|
-
url:
|
|
11789
|
+
const resourcefulPropertyDefinitionSchema = Q_.object({
|
|
11790
|
+
propertyKey: Q_.string().default(""),
|
|
11791
|
+
readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
11792
|
+
writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
11793
|
+
nullable: Q_.boolean().default(false),
|
|
11794
|
+
description: Q_.string().optional(),
|
|
11795
|
+
default: Q_.any().optional(),
|
|
11796
|
+
externalDocs: Q_.object({
|
|
11797
|
+
description: Q_.string().optional(),
|
|
11798
|
+
url: Q_.string().uri().required()
|
|
11813
11799
|
}).optional(),
|
|
11814
|
-
example:
|
|
11815
|
-
deprecated:
|
|
11800
|
+
example: Q_.string().optional(),
|
|
11801
|
+
deprecated: Q_.boolean().default(false)
|
|
11816
11802
|
});
|
|
11817
11803
|
const joiInstanceCheckerAlternativesFactory = (Ctor, CtorName) => {
|
|
11818
11804
|
return [
|
|
11819
|
-
|
|
11820
|
-
|
|
11821
|
-
|
|
11805
|
+
Q_.object().instance(Ctor),
|
|
11806
|
+
Q_.function().instance(Ctor),
|
|
11807
|
+
Q_.custom((value, helpers) => {
|
|
11822
11808
|
if (isObject$1(value) && value.constructor.name === CtorName) {
|
|
11823
11809
|
return value;
|
|
11824
11810
|
}
|
|
@@ -11826,7 +11812,7 @@ const joiInstanceCheckerAlternativesFactory = (Ctor, CtorName) => {
|
|
|
11826
11812
|
})
|
|
11827
11813
|
];
|
|
11828
11814
|
};
|
|
11829
|
-
const resourcefulDataTypeSchema =
|
|
11815
|
+
const resourcefulDataTypeSchema = Q_.alternatives(
|
|
11830
11816
|
...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, "ResourcefulStringType"),
|
|
11831
11817
|
...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, "ResourcefulDateType"),
|
|
11832
11818
|
...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, "ResourcefulDateTimeType"),
|
|
@@ -11845,95 +11831,95 @@ const resourcefulDataTypeSchema = joi.alternatives(
|
|
|
11845
11831
|
const localResourcefulPropertyDefinitionSchema = resourcefulPropertyDefinitionSchema.keys({
|
|
11846
11832
|
type: resourcefulDataTypeSchema.required()
|
|
11847
11833
|
});
|
|
11848
|
-
const resourcefulColumnOptionsSchema =
|
|
11834
|
+
const resourcefulColumnOptionsSchema = Q_.object({
|
|
11849
11835
|
// Lucid ColumnOptions (partial)
|
|
11850
|
-
columnName:
|
|
11851
|
-
serializeAs:
|
|
11852
|
-
serialize:
|
|
11853
|
-
consume:
|
|
11854
|
-
prepare:
|
|
11855
|
-
meta:
|
|
11856
|
-
isPrimary:
|
|
11857
|
-
hasDefaultValue:
|
|
11836
|
+
columnName: Q_.string().optional(),
|
|
11837
|
+
serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
|
|
11838
|
+
serialize: Q_.function().optional(),
|
|
11839
|
+
consume: Q_.function().optional(),
|
|
11840
|
+
prepare: Q_.function().optional(),
|
|
11841
|
+
meta: Q_.object().optional(),
|
|
11842
|
+
isPrimary: Q_.boolean().default(false),
|
|
11843
|
+
hasDefaultValue: Q_.boolean().default(false),
|
|
11858
11844
|
// Resourceful options
|
|
11859
|
-
propertyKey:
|
|
11860
|
-
readAccessControlFilters:
|
|
11861
|
-
writeAccessControlFilters:
|
|
11862
|
-
nullable:
|
|
11863
|
-
description:
|
|
11864
|
-
default:
|
|
11865
|
-
externalDocs:
|
|
11866
|
-
description:
|
|
11867
|
-
url:
|
|
11845
|
+
propertyKey: Q_.string().default(""),
|
|
11846
|
+
readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
11847
|
+
writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
11848
|
+
nullable: Q_.boolean().default(false),
|
|
11849
|
+
description: Q_.string().optional(),
|
|
11850
|
+
default: Q_.any().optional(),
|
|
11851
|
+
externalDocs: Q_.object({
|
|
11852
|
+
description: Q_.string().optional(),
|
|
11853
|
+
url: Q_.string().uri().required()
|
|
11868
11854
|
}).optional(),
|
|
11869
|
-
example:
|
|
11870
|
-
deprecated:
|
|
11855
|
+
example: Q_.string().optional(),
|
|
11856
|
+
deprecated: Q_.boolean().default(false),
|
|
11871
11857
|
type: resourcefulDataTypeSchema.required()
|
|
11872
11858
|
});
|
|
11873
|
-
const dataTypeColumnOptionsSchema =
|
|
11859
|
+
const dataTypeColumnOptionsSchema = Q_.object({
|
|
11874
11860
|
// Lucid ColumnOptions (partial) - excluding 'prepare' and 'consume'
|
|
11875
|
-
columnName:
|
|
11876
|
-
serializeAs:
|
|
11877
|
-
serialize:
|
|
11878
|
-
meta:
|
|
11879
|
-
isPrimary:
|
|
11880
|
-
hasDefaultValue:
|
|
11861
|
+
columnName: Q_.string().optional(),
|
|
11862
|
+
serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
|
|
11863
|
+
serialize: Q_.function().optional(),
|
|
11864
|
+
meta: Q_.object().optional(),
|
|
11865
|
+
isPrimary: Q_.boolean().default(false),
|
|
11866
|
+
hasDefaultValue: Q_.boolean().default(false),
|
|
11881
11867
|
// Resourceful options
|
|
11882
|
-
propertyKey:
|
|
11883
|
-
readAccessControlFilters:
|
|
11884
|
-
writeAccessControlFilters:
|
|
11885
|
-
nullable:
|
|
11886
|
-
description:
|
|
11887
|
-
default:
|
|
11888
|
-
externalDocs:
|
|
11889
|
-
description:
|
|
11890
|
-
url:
|
|
11868
|
+
propertyKey: Q_.string().default(""),
|
|
11869
|
+
readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
11870
|
+
writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
11871
|
+
nullable: Q_.boolean().default(false),
|
|
11872
|
+
description: Q_.string().optional(),
|
|
11873
|
+
default: Q_.any().optional(),
|
|
11874
|
+
externalDocs: Q_.object({
|
|
11875
|
+
description: Q_.string().optional(),
|
|
11876
|
+
url: Q_.string().uri().required()
|
|
11891
11877
|
}).optional(),
|
|
11892
|
-
example:
|
|
11893
|
-
deprecated:
|
|
11878
|
+
example: Q_.string().optional(),
|
|
11879
|
+
deprecated: Q_.boolean().default(false),
|
|
11894
11880
|
type: resourcefulDataTypeSchema.optional()
|
|
11895
11881
|
});
|
|
11896
11882
|
const baseDateColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
|
|
11897
|
-
autoCreate:
|
|
11898
|
-
autoUpdate:
|
|
11883
|
+
autoCreate: Q_.boolean().default(false),
|
|
11884
|
+
autoUpdate: Q_.boolean().default(false)
|
|
11899
11885
|
});
|
|
11900
11886
|
const stringColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
|
|
11901
|
-
type:
|
|
11887
|
+
type: Q_.alternatives(
|
|
11902
11888
|
...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, "ResourcefulStringType")
|
|
11903
11889
|
).default(() => new ResourcefulStringType())
|
|
11904
11890
|
});
|
|
11905
11891
|
const dateColumnOptionsSchema = baseDateColumnOptionsSchema.keys({
|
|
11906
|
-
type:
|
|
11892
|
+
type: Q_.alternatives(
|
|
11907
11893
|
...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, "ResourcefulDateType")
|
|
11908
11894
|
).default(() => new ResourcefulDateType())
|
|
11909
11895
|
});
|
|
11910
11896
|
const dateTimeColumnOptionsSchema = baseDateColumnOptionsSchema.keys({
|
|
11911
|
-
type:
|
|
11897
|
+
type: Q_.alternatives(
|
|
11912
11898
|
...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, "ResourcefulDateTimeType")
|
|
11913
11899
|
).default(() => new ResourcefulDateTimeType())
|
|
11914
11900
|
});
|
|
11915
11901
|
const binaryColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
|
|
11916
|
-
type:
|
|
11902
|
+
type: Q_.alternatives(
|
|
11917
11903
|
...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, "ResourcefulBinaryType")
|
|
11918
11904
|
).default(() => new ResourcefulBinaryType())
|
|
11919
11905
|
});
|
|
11920
11906
|
const numberColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
|
|
11921
|
-
type:
|
|
11907
|
+
type: Q_.alternatives(
|
|
11922
11908
|
...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, "ResourcefulNumberType")
|
|
11923
11909
|
).default(() => new ResourcefulNumberType())
|
|
11924
11910
|
});
|
|
11925
11911
|
const integerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
|
|
11926
|
-
type:
|
|
11912
|
+
type: Q_.alternatives(
|
|
11927
11913
|
...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, "ResourcefulIntegerType")
|
|
11928
11914
|
).default(() => new ResourcefulIntegerType())
|
|
11929
11915
|
});
|
|
11930
11916
|
const bigintColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
|
|
11931
|
-
type:
|
|
11917
|
+
type: Q_.alternatives(
|
|
11932
11918
|
...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, "ResourcefulBigintType")
|
|
11933
11919
|
).default(() => new ResourcefulBigintType())
|
|
11934
11920
|
});
|
|
11935
11921
|
const unsignedIntegerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
|
|
11936
|
-
type:
|
|
11922
|
+
type: Q_.alternatives(
|
|
11937
11923
|
...joiInstanceCheckerAlternativesFactory(
|
|
11938
11924
|
ResourcefulUnsignedIntegerType,
|
|
11939
11925
|
"ResourcefulUnsignedIntegerType"
|
|
@@ -11941,148 +11927,148 @@ const unsignedIntegerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
|
|
|
11941
11927
|
).default(() => new ResourcefulUnsignedIntegerType())
|
|
11942
11928
|
});
|
|
11943
11929
|
const booleanColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
|
|
11944
|
-
type:
|
|
11930
|
+
type: Q_.alternatives(
|
|
11945
11931
|
...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, "ResourcefulBooleanType")
|
|
11946
11932
|
).default(() => new ResourcefulBooleanType())
|
|
11947
11933
|
});
|
|
11948
|
-
const objectColumnOptionsSchema =
|
|
11934
|
+
const objectColumnOptionsSchema = Q_.object({
|
|
11949
11935
|
// Lucid ColumnOptions (full)
|
|
11950
|
-
columnName:
|
|
11951
|
-
serializeAs:
|
|
11952
|
-
serialize:
|
|
11953
|
-
consume:
|
|
11954
|
-
prepare:
|
|
11955
|
-
meta:
|
|
11956
|
-
isPrimary:
|
|
11957
|
-
hasDefaultValue:
|
|
11936
|
+
columnName: Q_.string().optional(),
|
|
11937
|
+
serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
|
|
11938
|
+
serialize: Q_.function().optional(),
|
|
11939
|
+
consume: Q_.function().optional(),
|
|
11940
|
+
prepare: Q_.function().optional(),
|
|
11941
|
+
meta: Q_.object().optional(),
|
|
11942
|
+
isPrimary: Q_.boolean().default(false),
|
|
11943
|
+
hasDefaultValue: Q_.boolean().default(false),
|
|
11958
11944
|
// Resourceful options
|
|
11959
|
-
propertyKey:
|
|
11960
|
-
readAccessControlFilters:
|
|
11961
|
-
writeAccessControlFilters:
|
|
11962
|
-
nullable:
|
|
11963
|
-
description:
|
|
11964
|
-
default:
|
|
11965
|
-
externalDocs:
|
|
11966
|
-
description:
|
|
11967
|
-
url:
|
|
11945
|
+
propertyKey: Q_.string().default(""),
|
|
11946
|
+
readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
11947
|
+
writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
11948
|
+
nullable: Q_.boolean().default(false),
|
|
11949
|
+
description: Q_.string().optional(),
|
|
11950
|
+
default: Q_.any().optional(),
|
|
11951
|
+
externalDocs: Q_.object({
|
|
11952
|
+
description: Q_.string().optional(),
|
|
11953
|
+
url: Q_.string().uri().required()
|
|
11968
11954
|
}).optional(),
|
|
11969
|
-
example:
|
|
11970
|
-
deprecated:
|
|
11971
|
-
type:
|
|
11955
|
+
example: Q_.string().optional(),
|
|
11956
|
+
deprecated: Q_.boolean().default(false),
|
|
11957
|
+
type: Q_.alternatives(
|
|
11972
11958
|
...joiInstanceCheckerAlternativesFactory(ResourcefulObjectType, "ResourcefulObjectType")
|
|
11973
11959
|
).default(() => new ResourcefulObjectType())
|
|
11974
11960
|
});
|
|
11975
|
-
const arrayColumnOptionsSchema =
|
|
11961
|
+
const arrayColumnOptionsSchema = Q_.object({
|
|
11976
11962
|
// Lucid ColumnOptions (full)
|
|
11977
|
-
columnName:
|
|
11978
|
-
serializeAs:
|
|
11979
|
-
serialize:
|
|
11980
|
-
consume:
|
|
11981
|
-
prepare:
|
|
11982
|
-
meta:
|
|
11983
|
-
isPrimary:
|
|
11984
|
-
hasDefaultValue:
|
|
11963
|
+
columnName: Q_.string().optional(),
|
|
11964
|
+
serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
|
|
11965
|
+
serialize: Q_.function().optional(),
|
|
11966
|
+
consume: Q_.function().optional(),
|
|
11967
|
+
prepare: Q_.function().optional(),
|
|
11968
|
+
meta: Q_.object().optional(),
|
|
11969
|
+
isPrimary: Q_.boolean().default(false),
|
|
11970
|
+
hasDefaultValue: Q_.boolean().default(false),
|
|
11985
11971
|
// Resourceful options
|
|
11986
|
-
propertyKey:
|
|
11987
|
-
readAccessControlFilters:
|
|
11988
|
-
writeAccessControlFilters:
|
|
11989
|
-
nullable:
|
|
11990
|
-
description:
|
|
11991
|
-
default:
|
|
11992
|
-
externalDocs:
|
|
11993
|
-
description:
|
|
11994
|
-
url:
|
|
11972
|
+
propertyKey: Q_.string().default(""),
|
|
11973
|
+
readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
11974
|
+
writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
11975
|
+
nullable: Q_.boolean().default(false),
|
|
11976
|
+
description: Q_.string().optional(),
|
|
11977
|
+
default: Q_.any().optional(),
|
|
11978
|
+
externalDocs: Q_.object({
|
|
11979
|
+
description: Q_.string().optional(),
|
|
11980
|
+
url: Q_.string().uri().required()
|
|
11995
11981
|
}).optional(),
|
|
11996
|
-
example:
|
|
11997
|
-
deprecated:
|
|
11998
|
-
type:
|
|
11982
|
+
example: Q_.string().optional(),
|
|
11983
|
+
deprecated: Q_.boolean().default(false),
|
|
11984
|
+
type: Q_.alternatives(
|
|
11999
11985
|
...joiInstanceCheckerAlternativesFactory(ResourcefulArrayType, "ResourcefulArrayType")
|
|
12000
11986
|
).default(() => new ResourcefulArrayType())
|
|
12001
11987
|
});
|
|
12002
11988
|
localResourcefulPropertyDefinitionSchema.append({
|
|
12003
|
-
writable:
|
|
11989
|
+
writable: Q_.boolean().default(false)
|
|
12004
11990
|
});
|
|
12005
|
-
const resourcefulComputedOptionsSchema =
|
|
11991
|
+
const resourcefulComputedOptionsSchema = Q_.object({
|
|
12006
11992
|
// Lucid ComputedOptions (partial)
|
|
12007
|
-
serializeAs:
|
|
12008
|
-
serialize:
|
|
12009
|
-
meta:
|
|
11993
|
+
serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
|
|
11994
|
+
serialize: Q_.function().optional(),
|
|
11995
|
+
meta: Q_.object().optional(),
|
|
12010
11996
|
// Resourceful options
|
|
12011
|
-
propertyKey:
|
|
12012
|
-
readAccessControlFilters:
|
|
12013
|
-
writeAccessControlFilters:
|
|
12014
|
-
nullable:
|
|
12015
|
-
description:
|
|
12016
|
-
default:
|
|
12017
|
-
externalDocs:
|
|
12018
|
-
description:
|
|
12019
|
-
url:
|
|
11997
|
+
propertyKey: Q_.string().default(""),
|
|
11998
|
+
readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
11999
|
+
writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
12000
|
+
nullable: Q_.boolean().default(false),
|
|
12001
|
+
description: Q_.string().optional(),
|
|
12002
|
+
default: Q_.any().optional(),
|
|
12003
|
+
externalDocs: Q_.object({
|
|
12004
|
+
description: Q_.string().optional(),
|
|
12005
|
+
url: Q_.string().uri().required()
|
|
12020
12006
|
}).optional(),
|
|
12021
|
-
example:
|
|
12022
|
-
deprecated:
|
|
12007
|
+
example: Q_.string().optional(),
|
|
12008
|
+
deprecated: Q_.boolean().default(false),
|
|
12023
12009
|
type: resourcefulDataTypeSchema.required()
|
|
12024
12010
|
});
|
|
12025
|
-
const dataTypeComputedOptionsSchema =
|
|
12011
|
+
const dataTypeComputedOptionsSchema = Q_.object({
|
|
12026
12012
|
// Lucid ComputedOptions (partial) - excluding 'prepare' and 'consume'
|
|
12027
|
-
serializeAs:
|
|
12028
|
-
serialize:
|
|
12029
|
-
meta:
|
|
12013
|
+
serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
|
|
12014
|
+
serialize: Q_.function().optional(),
|
|
12015
|
+
meta: Q_.object().optional(),
|
|
12030
12016
|
// Resourceful options
|
|
12031
|
-
propertyKey:
|
|
12032
|
-
readAccessControlFilters:
|
|
12033
|
-
writeAccessControlFilters:
|
|
12034
|
-
nullable:
|
|
12035
|
-
description:
|
|
12036
|
-
default:
|
|
12037
|
-
externalDocs:
|
|
12038
|
-
description:
|
|
12039
|
-
url:
|
|
12017
|
+
propertyKey: Q_.string().default(""),
|
|
12018
|
+
readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
12019
|
+
writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
12020
|
+
nullable: Q_.boolean().default(false),
|
|
12021
|
+
description: Q_.string().optional(),
|
|
12022
|
+
default: Q_.any().optional(),
|
|
12023
|
+
externalDocs: Q_.object({
|
|
12024
|
+
description: Q_.string().optional(),
|
|
12025
|
+
url: Q_.string().uri().required()
|
|
12040
12026
|
}).optional(),
|
|
12041
|
-
example:
|
|
12042
|
-
deprecated:
|
|
12027
|
+
example: Q_.string().optional(),
|
|
12028
|
+
deprecated: Q_.boolean().default(false),
|
|
12043
12029
|
type: resourcefulDataTypeSchema.optional()
|
|
12044
12030
|
});
|
|
12045
12031
|
const baseDateComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
|
|
12046
|
-
autoCreate:
|
|
12047
|
-
autoUpdate:
|
|
12032
|
+
autoCreate: Q_.boolean().default(false),
|
|
12033
|
+
autoUpdate: Q_.boolean().default(false)
|
|
12048
12034
|
});
|
|
12049
12035
|
const stringComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
|
|
12050
|
-
type:
|
|
12036
|
+
type: Q_.alternatives(
|
|
12051
12037
|
...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, "ResourcefulStringType")
|
|
12052
12038
|
).default(() => new ResourcefulStringType())
|
|
12053
12039
|
});
|
|
12054
12040
|
const dateComputedOptionsSchema = baseDateComputedOptionsSchema.keys({
|
|
12055
|
-
type:
|
|
12041
|
+
type: Q_.alternatives(
|
|
12056
12042
|
...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, "ResourcefulDateType")
|
|
12057
12043
|
).default(() => new ResourcefulDateType())
|
|
12058
12044
|
});
|
|
12059
12045
|
const dateTimeComputedOptionsSchema = baseDateComputedOptionsSchema.keys({
|
|
12060
|
-
type:
|
|
12046
|
+
type: Q_.alternatives(
|
|
12061
12047
|
...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, "ResourcefulDateTimeType")
|
|
12062
12048
|
).default(() => new ResourcefulDateTimeType())
|
|
12063
12049
|
});
|
|
12064
12050
|
const binaryComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
|
|
12065
|
-
type:
|
|
12051
|
+
type: Q_.alternatives(
|
|
12066
12052
|
...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, "ResourcefulBinaryType")
|
|
12067
12053
|
).default(() => new ResourcefulBinaryType())
|
|
12068
12054
|
});
|
|
12069
12055
|
const numberComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
|
|
12070
|
-
type:
|
|
12056
|
+
type: Q_.alternatives(
|
|
12071
12057
|
...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, "ResourcefulNumberType")
|
|
12072
12058
|
).default(() => new ResourcefulNumberType())
|
|
12073
12059
|
});
|
|
12074
12060
|
const integerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
|
|
12075
|
-
type:
|
|
12061
|
+
type: Q_.alternatives(
|
|
12076
12062
|
...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, "ResourcefulIntegerType")
|
|
12077
12063
|
).default(() => new ResourcefulIntegerType())
|
|
12078
12064
|
});
|
|
12079
12065
|
const bigintComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
|
|
12080
|
-
type:
|
|
12066
|
+
type: Q_.alternatives(
|
|
12081
12067
|
...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, "ResourcefulBigintType")
|
|
12082
12068
|
).default(() => new ResourcefulBigintType())
|
|
12083
12069
|
});
|
|
12084
12070
|
const unsignedIntegerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
|
|
12085
|
-
type:
|
|
12071
|
+
type: Q_.alternatives(
|
|
12086
12072
|
...joiInstanceCheckerAlternativesFactory(
|
|
12087
12073
|
ResourcefulUnsignedIntegerType,
|
|
12088
12074
|
"ResourcefulUnsignedIntegerType"
|
|
@@ -12090,99 +12076,99 @@ const unsignedIntegerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys(
|
|
|
12090
12076
|
).default(() => new ResourcefulUnsignedIntegerType())
|
|
12091
12077
|
});
|
|
12092
12078
|
const booleanComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
|
|
12093
|
-
type:
|
|
12079
|
+
type: Q_.alternatives(
|
|
12094
12080
|
...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, "ResourcefulBooleanType")
|
|
12095
12081
|
).default(() => new ResourcefulBooleanType())
|
|
12096
12082
|
});
|
|
12097
|
-
const objectComputedOptionsSchema =
|
|
12083
|
+
const objectComputedOptionsSchema = Q_.object({
|
|
12098
12084
|
// Lucid ComputedOptions (full)
|
|
12099
|
-
serializeAs:
|
|
12100
|
-
serialize:
|
|
12101
|
-
meta:
|
|
12085
|
+
serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
|
|
12086
|
+
serialize: Q_.function().optional(),
|
|
12087
|
+
meta: Q_.object().optional(),
|
|
12102
12088
|
// Resourceful options
|
|
12103
|
-
propertyKey:
|
|
12104
|
-
readAccessControlFilters:
|
|
12105
|
-
writeAccessControlFilters:
|
|
12106
|
-
nullable:
|
|
12107
|
-
description:
|
|
12108
|
-
default:
|
|
12109
|
-
externalDocs:
|
|
12110
|
-
description:
|
|
12111
|
-
url:
|
|
12089
|
+
propertyKey: Q_.string().default(""),
|
|
12090
|
+
readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
12091
|
+
writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
12092
|
+
nullable: Q_.boolean().default(false),
|
|
12093
|
+
description: Q_.string().optional(),
|
|
12094
|
+
default: Q_.any().optional(),
|
|
12095
|
+
externalDocs: Q_.object({
|
|
12096
|
+
description: Q_.string().optional(),
|
|
12097
|
+
url: Q_.string().uri().required()
|
|
12112
12098
|
}).optional(),
|
|
12113
|
-
example:
|
|
12114
|
-
deprecated:
|
|
12115
|
-
type:
|
|
12099
|
+
example: Q_.string().optional(),
|
|
12100
|
+
deprecated: Q_.boolean().default(false),
|
|
12101
|
+
type: Q_.alternatives(
|
|
12116
12102
|
...joiInstanceCheckerAlternativesFactory(ResourcefulObjectType, "ResourcefulObjectType")
|
|
12117
12103
|
).default(() => new ResourcefulObjectType())
|
|
12118
12104
|
});
|
|
12119
|
-
const arrayComputedOptionsSchema =
|
|
12105
|
+
const arrayComputedOptionsSchema = Q_.object({
|
|
12120
12106
|
// Lucid ComputedOptions (full)
|
|
12121
|
-
serializeAs:
|
|
12122
|
-
serialize:
|
|
12123
|
-
meta:
|
|
12107
|
+
serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
|
|
12108
|
+
serialize: Q_.function().optional(),
|
|
12109
|
+
meta: Q_.object().optional(),
|
|
12124
12110
|
// Resourceful options
|
|
12125
|
-
propertyKey:
|
|
12126
|
-
readAccessControlFilters:
|
|
12127
|
-
writeAccessControlFilters:
|
|
12128
|
-
nullable:
|
|
12129
|
-
description:
|
|
12130
|
-
default:
|
|
12131
|
-
externalDocs:
|
|
12132
|
-
description:
|
|
12133
|
-
url:
|
|
12111
|
+
propertyKey: Q_.string().default(""),
|
|
12112
|
+
readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
12113
|
+
writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
12114
|
+
nullable: Q_.boolean().default(false),
|
|
12115
|
+
description: Q_.string().optional(),
|
|
12116
|
+
default: Q_.any().optional(),
|
|
12117
|
+
externalDocs: Q_.object({
|
|
12118
|
+
description: Q_.string().optional(),
|
|
12119
|
+
url: Q_.string().uri().required()
|
|
12134
12120
|
}).optional(),
|
|
12135
|
-
example:
|
|
12136
|
-
deprecated:
|
|
12137
|
-
type:
|
|
12121
|
+
example: Q_.string().optional(),
|
|
12122
|
+
deprecated: Q_.boolean().default(false),
|
|
12123
|
+
type: Q_.alternatives(
|
|
12138
12124
|
...joiInstanceCheckerAlternativesFactory(ResourcefulArrayType, "ResourcefulArrayType")
|
|
12139
12125
|
).default(() => new ResourcefulArrayType())
|
|
12140
12126
|
});
|
|
12141
|
-
const resourcefulRelationshipOptionsSchema =
|
|
12127
|
+
const resourcefulRelationshipOptionsSchema = Q_.object({
|
|
12142
12128
|
// Resourceful options
|
|
12143
|
-
propertyKey:
|
|
12144
|
-
readAccessControlFilters:
|
|
12145
|
-
writeAccessControlFilters:
|
|
12146
|
-
nullable:
|
|
12147
|
-
description:
|
|
12148
|
-
default:
|
|
12149
|
-
externalDocs:
|
|
12150
|
-
description:
|
|
12151
|
-
url:
|
|
12129
|
+
propertyKey: Q_.string().default(""),
|
|
12130
|
+
readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
12131
|
+
writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
|
|
12132
|
+
nullable: Q_.boolean().default(false),
|
|
12133
|
+
description: Q_.string().optional(),
|
|
12134
|
+
default: Q_.any().optional(),
|
|
12135
|
+
externalDocs: Q_.object({
|
|
12136
|
+
description: Q_.string().optional(),
|
|
12137
|
+
url: Q_.string().uri().required()
|
|
12152
12138
|
}).optional(),
|
|
12153
|
-
example:
|
|
12154
|
-
deprecated:
|
|
12139
|
+
example: Q_.string().optional(),
|
|
12140
|
+
deprecated: Q_.boolean().default(false)
|
|
12155
12141
|
});
|
|
12156
12142
|
const relationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({
|
|
12157
12143
|
// Lucid RelationOptions
|
|
12158
|
-
localKey:
|
|
12159
|
-
foreignKey:
|
|
12160
|
-
serializeAs:
|
|
12161
|
-
onQuery:
|
|
12162
|
-
relatedModel:
|
|
12144
|
+
localKey: Q_.string().optional(),
|
|
12145
|
+
foreignKey: Q_.string().optional(),
|
|
12146
|
+
serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
|
|
12147
|
+
onQuery: Q_.function().optional(),
|
|
12148
|
+
relatedModel: Q_.function()
|
|
12163
12149
|
});
|
|
12164
12150
|
const manyToManyRelationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({
|
|
12165
12151
|
// Lucid ManyToManyRelationOptions
|
|
12166
|
-
localKey:
|
|
12167
|
-
relatedKey:
|
|
12168
|
-
pivotForeignKey:
|
|
12169
|
-
pivotRelatedForeignKey:
|
|
12170
|
-
pivotTable:
|
|
12171
|
-
pivotTimestamps:
|
|
12172
|
-
pivotColumns:
|
|
12173
|
-
serializeAs:
|
|
12174
|
-
onQuery:
|
|
12175
|
-
relatedModel:
|
|
12152
|
+
localKey: Q_.string().optional(),
|
|
12153
|
+
relatedKey: Q_.string().optional(),
|
|
12154
|
+
pivotForeignKey: Q_.string().optional(),
|
|
12155
|
+
pivotRelatedForeignKey: Q_.string().optional(),
|
|
12156
|
+
pivotTable: Q_.string().optional(),
|
|
12157
|
+
pivotTimestamps: Q_.boolean().optional(),
|
|
12158
|
+
pivotColumns: Q_.array().items(Q_.string()).optional(),
|
|
12159
|
+
serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
|
|
12160
|
+
onQuery: Q_.function().optional(),
|
|
12161
|
+
relatedModel: Q_.function()
|
|
12176
12162
|
});
|
|
12177
12163
|
const hasManyThroughRelationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({
|
|
12178
12164
|
// Lucid HasManyThroughRelationOptions (ThroughRelationOptions without throughModel)
|
|
12179
|
-
localKey:
|
|
12180
|
-
foreignKey:
|
|
12181
|
-
throughLocalKey:
|
|
12182
|
-
throughForeignKey:
|
|
12183
|
-
serializeAs:
|
|
12184
|
-
onQuery:
|
|
12185
|
-
relatedModel:
|
|
12165
|
+
localKey: Q_.string().optional(),
|
|
12166
|
+
foreignKey: Q_.string().optional(),
|
|
12167
|
+
throughLocalKey: Q_.string().optional(),
|
|
12168
|
+
throughForeignKey: Q_.string().optional(),
|
|
12169
|
+
serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
|
|
12170
|
+
onQuery: Q_.function().optional(),
|
|
12171
|
+
relatedModel: Q_.function()
|
|
12186
12172
|
});
|
|
12187
12173
|
const extractLucidOptionsForLucidDecorator = (options, keys, overrides) => {
|
|
12188
12174
|
const extracted = {};
|
|
@@ -12737,7 +12723,7 @@ function resourcefulHasManyThrough(model, options = {}) {
|
|
|
12737
12723
|
map.set(propertyKey, opts);
|
|
12738
12724
|
};
|
|
12739
12725
|
}
|
|
12740
|
-
const version = "0.1.0-master-
|
|
12726
|
+
const version = "0.1.0-master-71781cfd";
|
|
12741
12727
|
export {
|
|
12742
12728
|
k as definitions,
|
|
12743
12729
|
w as errors,
|