@nhtio/lucid-resourceful 1.20250718.2 → 1.20250724.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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]);
@@ -11800,25 +11807,25 @@ const validateNormalizeAndCastDecoratorOptions = (fieldName, decoratorName, sche
11800
11807
  }
11801
11808
  return value;
11802
11809
  };
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()
11810
+ const resourcefulPropertyDefinitionSchema = Q_.object({
11811
+ propertyKey: Q_.string().default(""),
11812
+ readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
11813
+ writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
11814
+ nullable: Q_.boolean().default(false),
11815
+ description: Q_.string().optional(),
11816
+ default: Q_.any().optional(),
11817
+ externalDocs: Q_.object({
11818
+ description: Q_.string().optional(),
11819
+ url: Q_.string().uri().required()
11813
11820
  }).optional(),
11814
- example: joi.string().optional(),
11815
- deprecated: joi.boolean().default(false)
11821
+ example: Q_.string().optional(),
11822
+ deprecated: Q_.boolean().default(false)
11816
11823
  });
11817
11824
  const joiInstanceCheckerAlternativesFactory = (Ctor, CtorName) => {
11818
11825
  return [
11819
- joi.object().instance(Ctor),
11820
- joi.function().instance(Ctor),
11821
- joi.custom((value, helpers) => {
11826
+ Q_.object().instance(Ctor),
11827
+ Q_.function().instance(Ctor),
11828
+ Q_.custom((value, helpers) => {
11822
11829
  if (isObject$1(value) && value.constructor.name === CtorName) {
11823
11830
  return value;
11824
11831
  }
@@ -11826,7 +11833,7 @@ const joiInstanceCheckerAlternativesFactory = (Ctor, CtorName) => {
11826
11833
  })
11827
11834
  ];
11828
11835
  };
11829
- const resourcefulDataTypeSchema = joi.alternatives(
11836
+ const resourcefulDataTypeSchema = Q_.alternatives(
11830
11837
  ...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, "ResourcefulStringType"),
11831
11838
  ...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, "ResourcefulDateType"),
11832
11839
  ...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, "ResourcefulDateTimeType"),
@@ -11845,95 +11852,95 @@ const resourcefulDataTypeSchema = joi.alternatives(
11845
11852
  const localResourcefulPropertyDefinitionSchema = resourcefulPropertyDefinitionSchema.keys({
11846
11853
  type: resourcefulDataTypeSchema.required()
11847
11854
  });
11848
- const resourcefulColumnOptionsSchema = joi.object({
11855
+ const resourcefulColumnOptionsSchema = Q_.object({
11849
11856
  // 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),
11857
+ columnName: Q_.string().optional(),
11858
+ serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
11859
+ serialize: Q_.function().optional(),
11860
+ consume: Q_.function().optional(),
11861
+ prepare: Q_.function().optional(),
11862
+ meta: Q_.object().optional(),
11863
+ isPrimary: Q_.boolean().default(false),
11864
+ hasDefaultValue: Q_.boolean().default(false),
11858
11865
  // 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()
11866
+ propertyKey: Q_.string().default(""),
11867
+ readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
11868
+ writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
11869
+ nullable: Q_.boolean().default(false),
11870
+ description: Q_.string().optional(),
11871
+ default: Q_.any().optional(),
11872
+ externalDocs: Q_.object({
11873
+ description: Q_.string().optional(),
11874
+ url: Q_.string().uri().required()
11868
11875
  }).optional(),
11869
- example: joi.string().optional(),
11870
- deprecated: joi.boolean().default(false),
11876
+ example: Q_.string().optional(),
11877
+ deprecated: Q_.boolean().default(false),
11871
11878
  type: resourcefulDataTypeSchema.required()
11872
11879
  });
11873
- const dataTypeColumnOptionsSchema = joi.object({
11880
+ const dataTypeColumnOptionsSchema = Q_.object({
11874
11881
  // 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),
11882
+ columnName: Q_.string().optional(),
11883
+ serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
11884
+ serialize: Q_.function().optional(),
11885
+ meta: Q_.object().optional(),
11886
+ isPrimary: Q_.boolean().default(false),
11887
+ hasDefaultValue: Q_.boolean().default(false),
11881
11888
  // 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()
11889
+ propertyKey: Q_.string().default(""),
11890
+ readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
11891
+ writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
11892
+ nullable: Q_.boolean().default(false),
11893
+ description: Q_.string().optional(),
11894
+ default: Q_.any().optional(),
11895
+ externalDocs: Q_.object({
11896
+ description: Q_.string().optional(),
11897
+ url: Q_.string().uri().required()
11891
11898
  }).optional(),
11892
- example: joi.string().optional(),
11893
- deprecated: joi.boolean().default(false),
11899
+ example: Q_.string().optional(),
11900
+ deprecated: Q_.boolean().default(false),
11894
11901
  type: resourcefulDataTypeSchema.optional()
11895
11902
  });
11896
11903
  const baseDateColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11897
- autoCreate: joi.boolean().default(false),
11898
- autoUpdate: joi.boolean().default(false)
11904
+ autoCreate: Q_.boolean().default(false),
11905
+ autoUpdate: Q_.boolean().default(false)
11899
11906
  });
11900
11907
  const stringColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11901
- type: joi.alternatives(
11908
+ type: Q_.alternatives(
11902
11909
  ...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, "ResourcefulStringType")
11903
11910
  ).default(() => new ResourcefulStringType())
11904
11911
  });
11905
11912
  const dateColumnOptionsSchema = baseDateColumnOptionsSchema.keys({
11906
- type: joi.alternatives(
11913
+ type: Q_.alternatives(
11907
11914
  ...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, "ResourcefulDateType")
11908
11915
  ).default(() => new ResourcefulDateType())
11909
11916
  });
11910
11917
  const dateTimeColumnOptionsSchema = baseDateColumnOptionsSchema.keys({
11911
- type: joi.alternatives(
11918
+ type: Q_.alternatives(
11912
11919
  ...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, "ResourcefulDateTimeType")
11913
11920
  ).default(() => new ResourcefulDateTimeType())
11914
11921
  });
11915
11922
  const binaryColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11916
- type: joi.alternatives(
11923
+ type: Q_.alternatives(
11917
11924
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, "ResourcefulBinaryType")
11918
11925
  ).default(() => new ResourcefulBinaryType())
11919
11926
  });
11920
11927
  const numberColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11921
- type: joi.alternatives(
11928
+ type: Q_.alternatives(
11922
11929
  ...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, "ResourcefulNumberType")
11923
11930
  ).default(() => new ResourcefulNumberType())
11924
11931
  });
11925
11932
  const integerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11926
- type: joi.alternatives(
11933
+ type: Q_.alternatives(
11927
11934
  ...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, "ResourcefulIntegerType")
11928
11935
  ).default(() => new ResourcefulIntegerType())
11929
11936
  });
11930
11937
  const bigintColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11931
- type: joi.alternatives(
11938
+ type: Q_.alternatives(
11932
11939
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, "ResourcefulBigintType")
11933
11940
  ).default(() => new ResourcefulBigintType())
11934
11941
  });
11935
11942
  const unsignedIntegerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11936
- type: joi.alternatives(
11943
+ type: Q_.alternatives(
11937
11944
  ...joiInstanceCheckerAlternativesFactory(
11938
11945
  ResourcefulUnsignedIntegerType,
11939
11946
  "ResourcefulUnsignedIntegerType"
@@ -11941,148 +11948,148 @@ const unsignedIntegerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11941
11948
  ).default(() => new ResourcefulUnsignedIntegerType())
11942
11949
  });
11943
11950
  const booleanColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({
11944
- type: joi.alternatives(
11951
+ type: Q_.alternatives(
11945
11952
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, "ResourcefulBooleanType")
11946
11953
  ).default(() => new ResourcefulBooleanType())
11947
11954
  });
11948
- const objectColumnOptionsSchema = joi.object({
11955
+ const objectColumnOptionsSchema = Q_.object({
11949
11956
  // 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),
11957
+ columnName: Q_.string().optional(),
11958
+ serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
11959
+ serialize: Q_.function().optional(),
11960
+ consume: Q_.function().optional(),
11961
+ prepare: Q_.function().optional(),
11962
+ meta: Q_.object().optional(),
11963
+ isPrimary: Q_.boolean().default(false),
11964
+ hasDefaultValue: Q_.boolean().default(false),
11958
11965
  // 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()
11966
+ propertyKey: Q_.string().default(""),
11967
+ readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
11968
+ writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
11969
+ nullable: Q_.boolean().default(false),
11970
+ description: Q_.string().optional(),
11971
+ default: Q_.any().optional(),
11972
+ externalDocs: Q_.object({
11973
+ description: Q_.string().optional(),
11974
+ url: Q_.string().uri().required()
11968
11975
  }).optional(),
11969
- example: joi.string().optional(),
11970
- deprecated: joi.boolean().default(false),
11971
- type: joi.alternatives(
11976
+ example: Q_.string().optional(),
11977
+ deprecated: Q_.boolean().default(false),
11978
+ type: Q_.alternatives(
11972
11979
  ...joiInstanceCheckerAlternativesFactory(ResourcefulObjectType, "ResourcefulObjectType")
11973
11980
  ).default(() => new ResourcefulObjectType())
11974
11981
  });
11975
- const arrayColumnOptionsSchema = joi.object({
11982
+ const arrayColumnOptionsSchema = Q_.object({
11976
11983
  // 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),
11984
+ columnName: Q_.string().optional(),
11985
+ serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
11986
+ serialize: Q_.function().optional(),
11987
+ consume: Q_.function().optional(),
11988
+ prepare: Q_.function().optional(),
11989
+ meta: Q_.object().optional(),
11990
+ isPrimary: Q_.boolean().default(false),
11991
+ hasDefaultValue: Q_.boolean().default(false),
11985
11992
  // 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()
11993
+ propertyKey: Q_.string().default(""),
11994
+ readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
11995
+ writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
11996
+ nullable: Q_.boolean().default(false),
11997
+ description: Q_.string().optional(),
11998
+ default: Q_.any().optional(),
11999
+ externalDocs: Q_.object({
12000
+ description: Q_.string().optional(),
12001
+ url: Q_.string().uri().required()
11995
12002
  }).optional(),
11996
- example: joi.string().optional(),
11997
- deprecated: joi.boolean().default(false),
11998
- type: joi.alternatives(
12003
+ example: Q_.string().optional(),
12004
+ deprecated: Q_.boolean().default(false),
12005
+ type: Q_.alternatives(
11999
12006
  ...joiInstanceCheckerAlternativesFactory(ResourcefulArrayType, "ResourcefulArrayType")
12000
12007
  ).default(() => new ResourcefulArrayType())
12001
12008
  });
12002
12009
  localResourcefulPropertyDefinitionSchema.append({
12003
- writable: joi.boolean().default(false)
12010
+ writable: Q_.boolean().default(false)
12004
12011
  });
12005
- const resourcefulComputedOptionsSchema = joi.object({
12012
+ const resourcefulComputedOptionsSchema = Q_.object({
12006
12013
  // Lucid ComputedOptions (partial)
12007
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
12008
- serialize: joi.function().optional(),
12009
- meta: joi.object().optional(),
12014
+ serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
12015
+ serialize: Q_.function().optional(),
12016
+ meta: Q_.object().optional(),
12010
12017
  // 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()
12018
+ propertyKey: Q_.string().default(""),
12019
+ readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
12020
+ writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
12021
+ nullable: Q_.boolean().default(false),
12022
+ description: Q_.string().optional(),
12023
+ default: Q_.any().optional(),
12024
+ externalDocs: Q_.object({
12025
+ description: Q_.string().optional(),
12026
+ url: Q_.string().uri().required()
12020
12027
  }).optional(),
12021
- example: joi.string().optional(),
12022
- deprecated: joi.boolean().default(false),
12028
+ example: Q_.string().optional(),
12029
+ deprecated: Q_.boolean().default(false),
12023
12030
  type: resourcefulDataTypeSchema.required()
12024
12031
  });
12025
- const dataTypeComputedOptionsSchema = joi.object({
12032
+ const dataTypeComputedOptionsSchema = Q_.object({
12026
12033
  // 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(),
12034
+ serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
12035
+ serialize: Q_.function().optional(),
12036
+ meta: Q_.object().optional(),
12030
12037
  // 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()
12038
+ propertyKey: Q_.string().default(""),
12039
+ readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
12040
+ writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
12041
+ nullable: Q_.boolean().default(false),
12042
+ description: Q_.string().optional(),
12043
+ default: Q_.any().optional(),
12044
+ externalDocs: Q_.object({
12045
+ description: Q_.string().optional(),
12046
+ url: Q_.string().uri().required()
12040
12047
  }).optional(),
12041
- example: joi.string().optional(),
12042
- deprecated: joi.boolean().default(false),
12048
+ example: Q_.string().optional(),
12049
+ deprecated: Q_.boolean().default(false),
12043
12050
  type: resourcefulDataTypeSchema.optional()
12044
12051
  });
12045
12052
  const baseDateComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12046
- autoCreate: joi.boolean().default(false),
12047
- autoUpdate: joi.boolean().default(false)
12053
+ autoCreate: Q_.boolean().default(false),
12054
+ autoUpdate: Q_.boolean().default(false)
12048
12055
  });
12049
12056
  const stringComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12050
- type: joi.alternatives(
12057
+ type: Q_.alternatives(
12051
12058
  ...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, "ResourcefulStringType")
12052
12059
  ).default(() => new ResourcefulStringType())
12053
12060
  });
12054
12061
  const dateComputedOptionsSchema = baseDateComputedOptionsSchema.keys({
12055
- type: joi.alternatives(
12062
+ type: Q_.alternatives(
12056
12063
  ...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, "ResourcefulDateType")
12057
12064
  ).default(() => new ResourcefulDateType())
12058
12065
  });
12059
12066
  const dateTimeComputedOptionsSchema = baseDateComputedOptionsSchema.keys({
12060
- type: joi.alternatives(
12067
+ type: Q_.alternatives(
12061
12068
  ...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, "ResourcefulDateTimeType")
12062
12069
  ).default(() => new ResourcefulDateTimeType())
12063
12070
  });
12064
12071
  const binaryComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12065
- type: joi.alternatives(
12072
+ type: Q_.alternatives(
12066
12073
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, "ResourcefulBinaryType")
12067
12074
  ).default(() => new ResourcefulBinaryType())
12068
12075
  });
12069
12076
  const numberComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12070
- type: joi.alternatives(
12077
+ type: Q_.alternatives(
12071
12078
  ...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, "ResourcefulNumberType")
12072
12079
  ).default(() => new ResourcefulNumberType())
12073
12080
  });
12074
12081
  const integerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12075
- type: joi.alternatives(
12082
+ type: Q_.alternatives(
12076
12083
  ...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, "ResourcefulIntegerType")
12077
12084
  ).default(() => new ResourcefulIntegerType())
12078
12085
  });
12079
12086
  const bigintComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12080
- type: joi.alternatives(
12087
+ type: Q_.alternatives(
12081
12088
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, "ResourcefulBigintType")
12082
12089
  ).default(() => new ResourcefulBigintType())
12083
12090
  });
12084
12091
  const unsignedIntegerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12085
- type: joi.alternatives(
12092
+ type: Q_.alternatives(
12086
12093
  ...joiInstanceCheckerAlternativesFactory(
12087
12094
  ResourcefulUnsignedIntegerType,
12088
12095
  "ResourcefulUnsignedIntegerType"
@@ -12090,99 +12097,99 @@ const unsignedIntegerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys(
12090
12097
  ).default(() => new ResourcefulUnsignedIntegerType())
12091
12098
  });
12092
12099
  const booleanComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({
12093
- type: joi.alternatives(
12100
+ type: Q_.alternatives(
12094
12101
  ...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, "ResourcefulBooleanType")
12095
12102
  ).default(() => new ResourcefulBooleanType())
12096
12103
  });
12097
- const objectComputedOptionsSchema = joi.object({
12104
+ const objectComputedOptionsSchema = Q_.object({
12098
12105
  // Lucid ComputedOptions (full)
12099
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
12100
- serialize: joi.function().optional(),
12101
- meta: joi.object().optional(),
12106
+ serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
12107
+ serialize: Q_.function().optional(),
12108
+ meta: Q_.object().optional(),
12102
12109
  // 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()
12110
+ propertyKey: Q_.string().default(""),
12111
+ readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
12112
+ writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
12113
+ nullable: Q_.boolean().default(false),
12114
+ description: Q_.string().optional(),
12115
+ default: Q_.any().optional(),
12116
+ externalDocs: Q_.object({
12117
+ description: Q_.string().optional(),
12118
+ url: Q_.string().uri().required()
12112
12119
  }).optional(),
12113
- example: joi.string().optional(),
12114
- deprecated: joi.boolean().default(false),
12115
- type: joi.alternatives(
12120
+ example: Q_.string().optional(),
12121
+ deprecated: Q_.boolean().default(false),
12122
+ type: Q_.alternatives(
12116
12123
  ...joiInstanceCheckerAlternativesFactory(ResourcefulObjectType, "ResourcefulObjectType")
12117
12124
  ).default(() => new ResourcefulObjectType())
12118
12125
  });
12119
- const arrayComputedOptionsSchema = joi.object({
12126
+ const arrayComputedOptionsSchema = Q_.object({
12120
12127
  // Lucid ComputedOptions (full)
12121
- serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),
12122
- serialize: joi.function().optional(),
12123
- meta: joi.object().optional(),
12128
+ serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
12129
+ serialize: Q_.function().optional(),
12130
+ meta: Q_.object().optional(),
12124
12131
  // 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()
12132
+ propertyKey: Q_.string().default(""),
12133
+ readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
12134
+ writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
12135
+ nullable: Q_.boolean().default(false),
12136
+ description: Q_.string().optional(),
12137
+ default: Q_.any().optional(),
12138
+ externalDocs: Q_.object({
12139
+ description: Q_.string().optional(),
12140
+ url: Q_.string().uri().required()
12134
12141
  }).optional(),
12135
- example: joi.string().optional(),
12136
- deprecated: joi.boolean().default(false),
12137
- type: joi.alternatives(
12142
+ example: Q_.string().optional(),
12143
+ deprecated: Q_.boolean().default(false),
12144
+ type: Q_.alternatives(
12138
12145
  ...joiInstanceCheckerAlternativesFactory(ResourcefulArrayType, "ResourcefulArrayType")
12139
12146
  ).default(() => new ResourcefulArrayType())
12140
12147
  });
12141
- const resourcefulRelationshipOptionsSchema = joi.object({
12148
+ const resourcefulRelationshipOptionsSchema = Q_.object({
12142
12149
  // 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()
12150
+ propertyKey: Q_.string().default(""),
12151
+ readAccessControlFilters: Q_.array().items(Q_.function()).default([]),
12152
+ writeAccessControlFilters: Q_.array().items(Q_.function()).default([]),
12153
+ nullable: Q_.boolean().default(false),
12154
+ description: Q_.string().optional(),
12155
+ default: Q_.any().optional(),
12156
+ externalDocs: Q_.object({
12157
+ description: Q_.string().optional(),
12158
+ url: Q_.string().uri().required()
12152
12159
  }).optional(),
12153
- example: joi.string().optional(),
12154
- deprecated: joi.boolean().default(false)
12160
+ example: Q_.string().optional(),
12161
+ deprecated: Q_.boolean().default(false)
12155
12162
  });
12156
12163
  const relationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({
12157
12164
  // 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()
12165
+ localKey: Q_.string().optional(),
12166
+ foreignKey: Q_.string().optional(),
12167
+ serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
12168
+ onQuery: Q_.function().optional(),
12169
+ relatedModel: Q_.function()
12163
12170
  });
12164
12171
  const manyToManyRelationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({
12165
12172
  // 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()
12173
+ localKey: Q_.string().optional(),
12174
+ relatedKey: Q_.string().optional(),
12175
+ pivotForeignKey: Q_.string().optional(),
12176
+ pivotRelatedForeignKey: Q_.string().optional(),
12177
+ pivotTable: Q_.string().optional(),
12178
+ pivotTimestamps: Q_.boolean().optional(),
12179
+ pivotColumns: Q_.array().items(Q_.string()).optional(),
12180
+ serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
12181
+ onQuery: Q_.function().optional(),
12182
+ relatedModel: Q_.function()
12176
12183
  });
12177
12184
  const hasManyThroughRelationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({
12178
12185
  // 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()
12186
+ localKey: Q_.string().optional(),
12187
+ foreignKey: Q_.string().optional(),
12188
+ throughLocalKey: Q_.string().optional(),
12189
+ throughForeignKey: Q_.string().optional(),
12190
+ serializeAs: Q_.alternatives().try(Q_.string(), Q_.valid(null)).optional(),
12191
+ onQuery: Q_.function().optional(),
12192
+ relatedModel: Q_.function()
12186
12193
  });
12187
12194
  const extractLucidOptionsForLucidDecorator = (options, keys, overrides) => {
12188
12195
  const extracted = {};
@@ -12737,7 +12744,7 @@ function resourcefulHasManyThrough(model, options = {}) {
12737
12744
  map.set(propertyKey, opts);
12738
12745
  };
12739
12746
  }
12740
- const version = "1.20250718.2";
12747
+ const version = "1.20250724.0";
12741
12748
  export {
12742
12749
  k as definitions,
12743
12750
  w as errors,