@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/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 { j as joi } from "./index-DDaZ2qr2.js";
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-B66EPk0H.js";
19
- import { k } from "./definitions-B66EPk0H.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-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 = joi.object({
602
- name: joi.string().default(superclass.name),
603
- readRequiredForWrite: joi.boolean().default(false),
604
- accessControlFilters: joi.object({
605
- list: joi.array().items(joi.function()).default([]),
606
- create: joi.array().items(joi.function()).default([]),
607
- read: joi.array().items(joi.function()).default([]),
608
- update: joi.array().items(joi.function()).default([]),
609
- delete: joi.array().items(joi.function()).default([])
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: joi.string().valid(...ResourcefulErrorHandlerMethod).default("throw"),
612
- onValidationScopeError: joi.string().valid(...ResourcefulErrorHandlerMethod).default("throw"),
613
- queryScopeCallbacks: joi.object({
614
- list: joi.array().items(joi.function()).default([]),
615
- access: joi.array().items(joi.function()).default([])
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: joi.string().optional(),
618
- externalDocs: joi.object({
619
- description: joi.string().optional(),
620
- url: joi.string().uri().required()
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: joi.string().optional(),
623
- advanced: joi.object({
624
- propertyEvaluationConcurrency: joi.number().integer().min(1).default(10),
625
- aclEvaluationConcurrency: joi.number().integer().min(1).default(2)
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: joi.forbidden(),
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 joi.any().forbidden();
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 joi.any().forbidden();
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 joi.any().forbidden();
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 = joi.string().min(d.minLength).max(d.maxLength);
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 = joi.date().iso();
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 = joi.date().iso();
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 = joi.string();
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 = joi.number();
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 = joi.number();
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 = joi.bigint();
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 = joi.number().unsafe();
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 = joi.boolean();
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 = joi.alternatives().try(...alternatives);
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), joi.any());
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 = joi.alternatives().try(...alternatives);
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 = joi.any().not(...notSchemas);
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 = joi.object(objectSchema);
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
- joi.string(),
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 = joi.array();
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 = joi.alternatives().try(...alternatives);
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), joi.any());
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 = joi.alternatives().try(...alternatives);
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 = joi.any().not(...notSchemas);
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 joi.any().forbidden();
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 = joi.object({
1469
- filter: joi.string().allow("").required(),
1470
- page: joi.number().integer().min(1).required(),
1471
- perPage: joi.number().integer().min(1).max(100).required(),
1472
- fields: joi.array().items(joi.string().valid(...possibleFields)).required()
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$1 = Math.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 implementation;
3327
- var hasRequiredImplementation;
3328
- function requireImplementation() {
3329
- if (hasRequiredImplementation) return implementation;
3330
- hasRequiredImplementation = 1;
3331
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
3332
- var toStr2 = Object.prototype.toString;
3333
- var max2 = Math.max;
3334
- var funcType = "[object Function]";
3335
- var concatty = function concatty2(a2, b) {
3336
- var arr = [];
3337
- for (var i = 0; i < a2.length; i += 1) {
3338
- arr[i] = a2[i];
3339
- }
3340
- for (var j = 0; j < b.length; j += 1) {
3341
- arr[j + a2.length] = b[j];
3342
- }
3343
- return arr;
3344
- };
3345
- var slicy = function slicy2(arrLike, offset) {
3346
- var arr = [];
3347
- for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
3348
- arr[j] = arrLike[i];
3349
- }
3350
- return arr;
3351
- };
3352
- var joiny = function(arr, joiner) {
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
- return str;
3361
- };
3362
- implementation = function bind2(that) {
3363
- var target = this;
3364
- if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
3365
- throw new TypeError(ERROR_MESSAGE + target);
3366
- }
3367
- var args = slicy(arguments, 1);
3368
- var bound;
3369
- var binder = function() {
3370
- if (this instanceof bound) {
3371
- var result = target.apply(
3372
- this,
3373
- concatty(args, arguments)
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
- var boundLength = max2(0, target.length - args.length);
3386
- var boundArgs = [];
3387
- for (var i = 0; i < boundLength; i++) {
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 bound;
3382
+ return target.apply(
3383
+ that,
3384
+ concatty(args, arguments)
3385
+ );
3399
3386
  };
3400
- return implementation;
3401
- }
3402
- var functionBind;
3403
- var hasRequiredFunctionBind;
3404
- function requireFunctionBind() {
3405
- if (hasRequiredFunctionBind) return functionBind;
3406
- hasRequiredFunctionBind = 1;
3407
- var implementation2 = requireImplementation();
3408
- functionBind = Function.prototype.bind || implementation2;
3409
- return functionBind;
3410
- }
3411
- var functionCall;
3412
- var hasRequiredFunctionCall;
3413
- function requireFunctionCall() {
3414
- if (hasRequiredFunctionCall) return functionCall;
3415
- hasRequiredFunctionCall = 1;
3416
- functionCall = Function.prototype.call;
3417
- return functionCall;
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 = requireFunctionBind();
3414
+ var bind$2 = functionBind;
3429
3415
  var $apply$1 = requireFunctionApply();
3430
- var $call$2 = requireFunctionCall();
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 = requireFunctionBind();
3419
+ var bind$1 = functionBind;
3434
3420
  var $TypeError$4 = type;
3435
- var $call$1 = requireFunctionCall();
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 bind2 = requireFunctionBind();
3502
- hasown = bind2.call(call, $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$1;
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 = requireFunctionCall();
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 bind = requireFunctionBind();
3707
+ var bind2 = functionBind;
3722
3708
  var hasOwn = requireHasown();
3723
- var $concat = bind.call($call, Array.prototype.concat);
3724
- var $spliceApply = bind.call($apply, Array.prototype.splice);
3725
- var $replace = bind.call($call, String.prototype.replace);
3726
- var $strSlice = bind.call($call, String.prototype.slice);
3727
- var $exec = bind.call($call, RegExp.prototype.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 = joi.object({
11804
- propertyKey: joi.string().default(""),
11805
- readAccessControlFilters: joi.array().items(joi.function()).default([]),
11806
- writeAccessControlFilters: joi.array().items(joi.function()).default([]),
11807
- nullable: joi.boolean().default(false),
11808
- description: joi.string().optional(),
11809
- default: joi.any().optional(),
11810
- externalDocs: joi.object({
11811
- description: joi.string().optional(),
11812
- url: joi.string().uri().required()
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: joi.string().optional(),
11815
- deprecated: joi.boolean().default(false)
11800
+ example: Q_.string().optional(),
11801
+ deprecated: Q_.boolean().default(false)
11816
11802
  });
11817
11803
  const joiInstanceCheckerAlternativesFactory = (Ctor, CtorName) => {
11818
11804
  return [
11819
- joi.object().instance(Ctor),
11820
- joi.function().instance(Ctor),
11821
- joi.custom((value, helpers) => {
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 = joi.alternatives(
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 = joi.object({
11834
+ const resourcefulColumnOptionsSchema = Q_.object({
11849
11835
  // Lucid ColumnOptions (partial)
11850
- columnName: joi.string().optional(),
11851
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
11852
- serialize: joi.function().optional(),
11853
- consume: joi.function().optional(),
11854
- prepare: joi.function().optional(),
11855
- meta: joi.object().optional(),
11856
- isPrimary: joi.boolean().default(false),
11857
- hasDefaultValue: joi.boolean().default(false),
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: joi.string().default(""),
11860
- readAccessControlFilters: joi.array().items(joi.function()).default([]),
11861
- writeAccessControlFilters: joi.array().items(joi.function()).default([]),
11862
- nullable: joi.boolean().default(false),
11863
- description: joi.string().optional(),
11864
- default: joi.any().optional(),
11865
- externalDocs: joi.object({
11866
- description: joi.string().optional(),
11867
- url: joi.string().uri().required()
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: joi.string().optional(),
11870
- deprecated: joi.boolean().default(false),
11855
+ example: Q_.string().optional(),
11856
+ deprecated: Q_.boolean().default(false),
11871
11857
  type: resourcefulDataTypeSchema.required()
11872
11858
  });
11873
- const dataTypeColumnOptionsSchema = joi.object({
11859
+ const dataTypeColumnOptionsSchema = Q_.object({
11874
11860
  // Lucid ColumnOptions (partial) - excluding 'prepare' and 'consume'
11875
- columnName: joi.string().optional(),
11876
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
11877
- serialize: joi.function().optional(),
11878
- meta: joi.object().optional(),
11879
- isPrimary: joi.boolean().default(false),
11880
- hasDefaultValue: joi.boolean().default(false),
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: joi.string().default(""),
11883
- readAccessControlFilters: joi.array().items(joi.function()).default([]),
11884
- writeAccessControlFilters: joi.array().items(joi.function()).default([]),
11885
- nullable: joi.boolean().default(false),
11886
- description: joi.string().optional(),
11887
- default: joi.any().optional(),
11888
- externalDocs: joi.object({
11889
- description: joi.string().optional(),
11890
- url: joi.string().uri().required()
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: joi.string().optional(),
11893
- deprecated: joi.boolean().default(false),
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: joi.boolean().default(false),
11898
- autoUpdate: joi.boolean().default(false)
11883
+ autoCreate: Q_.boolean().default(false),
11884
+ autoUpdate: Q_.boolean().default(false)
11899
11885
  });
11900
11886
  const stringColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11901
- type: joi.alternatives(
11887
+ type: Q_.alternatives(
11902
11888
  ...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, "ResourcefulStringType")
11903
11889
  ).default(() => new ResourcefulStringType())
11904
11890
  });
11905
11891
  const dateColumnOptionsSchema = baseDateColumnOptionsSchema.keys({
11906
- type: joi.alternatives(
11892
+ type: Q_.alternatives(
11907
11893
  ...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, "ResourcefulDateType")
11908
11894
  ).default(() => new ResourcefulDateType())
11909
11895
  });
11910
11896
  const dateTimeColumnOptionsSchema = baseDateColumnOptionsSchema.keys({
11911
- type: joi.alternatives(
11897
+ type: Q_.alternatives(
11912
11898
  ...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, "ResourcefulDateTimeType")
11913
11899
  ).default(() => new ResourcefulDateTimeType())
11914
11900
  });
11915
11901
  const binaryColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11916
- type: joi.alternatives(
11902
+ type: Q_.alternatives(
11917
11903
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, "ResourcefulBinaryType")
11918
11904
  ).default(() => new ResourcefulBinaryType())
11919
11905
  });
11920
11906
  const numberColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11921
- type: joi.alternatives(
11907
+ type: Q_.alternatives(
11922
11908
  ...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, "ResourcefulNumberType")
11923
11909
  ).default(() => new ResourcefulNumberType())
11924
11910
  });
11925
11911
  const integerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11926
- type: joi.alternatives(
11912
+ type: Q_.alternatives(
11927
11913
  ...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, "ResourcefulIntegerType")
11928
11914
  ).default(() => new ResourcefulIntegerType())
11929
11915
  });
11930
11916
  const bigintColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11931
- type: joi.alternatives(
11917
+ type: Q_.alternatives(
11932
11918
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, "ResourcefulBigintType")
11933
11919
  ).default(() => new ResourcefulBigintType())
11934
11920
  });
11935
11921
  const unsignedIntegerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11936
- type: joi.alternatives(
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: joi.alternatives(
11930
+ type: Q_.alternatives(
11945
11931
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, "ResourcefulBooleanType")
11946
11932
  ).default(() => new ResourcefulBooleanType())
11947
11933
  });
11948
- const objectColumnOptionsSchema = joi.object({
11934
+ const objectColumnOptionsSchema = Q_.object({
11949
11935
  // Lucid ColumnOptions (full)
11950
- columnName: joi.string().optional(),
11951
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
11952
- serialize: joi.function().optional(),
11953
- consume: joi.function().optional(),
11954
- prepare: joi.function().optional(),
11955
- meta: joi.object().optional(),
11956
- isPrimary: joi.boolean().default(false),
11957
- hasDefaultValue: joi.boolean().default(false),
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: joi.string().default(""),
11960
- readAccessControlFilters: joi.array().items(joi.function()).default([]),
11961
- writeAccessControlFilters: joi.array().items(joi.function()).default([]),
11962
- nullable: joi.boolean().default(false),
11963
- description: joi.string().optional(),
11964
- default: joi.any().optional(),
11965
- externalDocs: joi.object({
11966
- description: joi.string().optional(),
11967
- url: joi.string().uri().required()
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: joi.string().optional(),
11970
- deprecated: joi.boolean().default(false),
11971
- type: joi.alternatives(
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 = joi.object({
11961
+ const arrayColumnOptionsSchema = Q_.object({
11976
11962
  // Lucid ColumnOptions (full)
11977
- columnName: joi.string().optional(),
11978
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
11979
- serialize: joi.function().optional(),
11980
- consume: joi.function().optional(),
11981
- prepare: joi.function().optional(),
11982
- meta: joi.object().optional(),
11983
- isPrimary: joi.boolean().default(false),
11984
- hasDefaultValue: joi.boolean().default(false),
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: joi.string().default(""),
11987
- readAccessControlFilters: joi.array().items(joi.function()).default([]),
11988
- writeAccessControlFilters: joi.array().items(joi.function()).default([]),
11989
- nullable: joi.boolean().default(false),
11990
- description: joi.string().optional(),
11991
- default: joi.any().optional(),
11992
- externalDocs: joi.object({
11993
- description: joi.string().optional(),
11994
- url: joi.string().uri().required()
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: joi.string().optional(),
11997
- deprecated: joi.boolean().default(false),
11998
- type: joi.alternatives(
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: joi.boolean().default(false)
11989
+ writable: Q_.boolean().default(false)
12004
11990
  });
12005
- const resourcefulComputedOptionsSchema = joi.object({
11991
+ const resourcefulComputedOptionsSchema = Q_.object({
12006
11992
  // Lucid ComputedOptions (partial)
12007
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
12008
- serialize: joi.function().optional(),
12009
- meta: joi.object().optional(),
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: joi.string().default(""),
12012
- readAccessControlFilters: joi.array().items(joi.function()).default([]),
12013
- writeAccessControlFilters: joi.array().items(joi.function()).default([]),
12014
- nullable: joi.boolean().default(false),
12015
- description: joi.string().optional(),
12016
- default: joi.any().optional(),
12017
- externalDocs: joi.object({
12018
- description: joi.string().optional(),
12019
- url: joi.string().uri().required()
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: joi.string().optional(),
12022
- deprecated: joi.boolean().default(false),
12007
+ example: Q_.string().optional(),
12008
+ deprecated: Q_.boolean().default(false),
12023
12009
  type: resourcefulDataTypeSchema.required()
12024
12010
  });
12025
- const dataTypeComputedOptionsSchema = joi.object({
12011
+ const dataTypeComputedOptionsSchema = Q_.object({
12026
12012
  // Lucid ComputedOptions (partial) - excluding 'prepare' and 'consume'
12027
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
12028
- serialize: joi.function().optional(),
12029
- meta: joi.object().optional(),
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: joi.string().default(""),
12032
- readAccessControlFilters: joi.array().items(joi.function()).default([]),
12033
- writeAccessControlFilters: joi.array().items(joi.function()).default([]),
12034
- nullable: joi.boolean().default(false),
12035
- description: joi.string().optional(),
12036
- default: joi.any().optional(),
12037
- externalDocs: joi.object({
12038
- description: joi.string().optional(),
12039
- url: joi.string().uri().required()
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: joi.string().optional(),
12042
- deprecated: joi.boolean().default(false),
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: joi.boolean().default(false),
12047
- autoUpdate: joi.boolean().default(false)
12032
+ autoCreate: Q_.boolean().default(false),
12033
+ autoUpdate: Q_.boolean().default(false)
12048
12034
  });
12049
12035
  const stringComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12050
- type: joi.alternatives(
12036
+ type: Q_.alternatives(
12051
12037
  ...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, "ResourcefulStringType")
12052
12038
  ).default(() => new ResourcefulStringType())
12053
12039
  });
12054
12040
  const dateComputedOptionsSchema = baseDateComputedOptionsSchema.keys({
12055
- type: joi.alternatives(
12041
+ type: Q_.alternatives(
12056
12042
  ...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, "ResourcefulDateType")
12057
12043
  ).default(() => new ResourcefulDateType())
12058
12044
  });
12059
12045
  const dateTimeComputedOptionsSchema = baseDateComputedOptionsSchema.keys({
12060
- type: joi.alternatives(
12046
+ type: Q_.alternatives(
12061
12047
  ...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, "ResourcefulDateTimeType")
12062
12048
  ).default(() => new ResourcefulDateTimeType())
12063
12049
  });
12064
12050
  const binaryComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12065
- type: joi.alternatives(
12051
+ type: Q_.alternatives(
12066
12052
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, "ResourcefulBinaryType")
12067
12053
  ).default(() => new ResourcefulBinaryType())
12068
12054
  });
12069
12055
  const numberComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12070
- type: joi.alternatives(
12056
+ type: Q_.alternatives(
12071
12057
  ...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, "ResourcefulNumberType")
12072
12058
  ).default(() => new ResourcefulNumberType())
12073
12059
  });
12074
12060
  const integerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12075
- type: joi.alternatives(
12061
+ type: Q_.alternatives(
12076
12062
  ...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, "ResourcefulIntegerType")
12077
12063
  ).default(() => new ResourcefulIntegerType())
12078
12064
  });
12079
12065
  const bigintComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12080
- type: joi.alternatives(
12066
+ type: Q_.alternatives(
12081
12067
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, "ResourcefulBigintType")
12082
12068
  ).default(() => new ResourcefulBigintType())
12083
12069
  });
12084
12070
  const unsignedIntegerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12085
- type: joi.alternatives(
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: joi.alternatives(
12079
+ type: Q_.alternatives(
12094
12080
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, "ResourcefulBooleanType")
12095
12081
  ).default(() => new ResourcefulBooleanType())
12096
12082
  });
12097
- const objectComputedOptionsSchema = joi.object({
12083
+ const objectComputedOptionsSchema = Q_.object({
12098
12084
  // Lucid ComputedOptions (full)
12099
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
12100
- serialize: joi.function().optional(),
12101
- meta: joi.object().optional(),
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: joi.string().default(""),
12104
- readAccessControlFilters: joi.array().items(joi.function()).default([]),
12105
- writeAccessControlFilters: joi.array().items(joi.function()).default([]),
12106
- nullable: joi.boolean().default(false),
12107
- description: joi.string().optional(),
12108
- default: joi.any().optional(),
12109
- externalDocs: joi.object({
12110
- description: joi.string().optional(),
12111
- url: joi.string().uri().required()
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: joi.string().optional(),
12114
- deprecated: joi.boolean().default(false),
12115
- type: joi.alternatives(
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 = joi.object({
12105
+ const arrayComputedOptionsSchema = Q_.object({
12120
12106
  // Lucid ComputedOptions (full)
12121
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
12122
- serialize: joi.function().optional(),
12123
- meta: joi.object().optional(),
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: joi.string().default(""),
12126
- readAccessControlFilters: joi.array().items(joi.function()).default([]),
12127
- writeAccessControlFilters: joi.array().items(joi.function()).default([]),
12128
- nullable: joi.boolean().default(false),
12129
- description: joi.string().optional(),
12130
- default: joi.any().optional(),
12131
- externalDocs: joi.object({
12132
- description: joi.string().optional(),
12133
- url: joi.string().uri().required()
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: joi.string().optional(),
12136
- deprecated: joi.boolean().default(false),
12137
- type: joi.alternatives(
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 = joi.object({
12127
+ const resourcefulRelationshipOptionsSchema = Q_.object({
12142
12128
  // Resourceful options
12143
- propertyKey: joi.string().default(""),
12144
- readAccessControlFilters: joi.array().items(joi.function()).default([]),
12145
- writeAccessControlFilters: joi.array().items(joi.function()).default([]),
12146
- nullable: joi.boolean().default(false),
12147
- description: joi.string().optional(),
12148
- default: joi.any().optional(),
12149
- externalDocs: joi.object({
12150
- description: joi.string().optional(),
12151
- url: joi.string().uri().required()
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: joi.string().optional(),
12154
- deprecated: joi.boolean().default(false)
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: joi.string().optional(),
12159
- foreignKey: joi.string().optional(),
12160
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
12161
- onQuery: joi.function().optional(),
12162
- relatedModel: joi.function()
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: joi.string().optional(),
12167
- relatedKey: joi.string().optional(),
12168
- pivotForeignKey: joi.string().optional(),
12169
- pivotRelatedForeignKey: joi.string().optional(),
12170
- pivotTable: joi.string().optional(),
12171
- pivotTimestamps: joi.boolean().optional(),
12172
- pivotColumns: joi.array().items(joi.string()).optional(),
12173
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
12174
- onQuery: joi.function().optional(),
12175
- relatedModel: joi.function()
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: joi.string().optional(),
12180
- foreignKey: joi.string().optional(),
12181
- throughLocalKey: joi.string().optional(),
12182
- throughForeignKey: joi.string().optional(),
12183
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
12184
- onQuery: joi.function().optional(),
12185
- relatedModel: joi.function()
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-888baa5f";
12726
+ const version = "0.1.0-master-71781cfd";
12741
12727
  export {
12742
12728
  k as definitions,
12743
12729
  w as errors,