@valbuild/core 0.96.3 → 0.97.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.
Files changed (28) hide show
  1. package/dist/declarations/src/index.d.ts +1 -0
  2. package/dist/declarations/src/initSchema.d.ts +13 -0
  3. package/dist/declarations/src/schema/array.d.ts +10 -1
  4. package/dist/declarations/src/schema/boolean.d.ts +10 -1
  5. package/dist/declarations/src/schema/date.d.ts +10 -1
  6. package/dist/declarations/src/schema/datetime.d.ts +56 -0
  7. package/dist/declarations/src/schema/file.d.ts +10 -1
  8. package/dist/declarations/src/schema/image.d.ts +10 -1
  9. package/dist/declarations/src/schema/index.d.ts +16 -1
  10. package/dist/declarations/src/schema/keyOf.d.ts +10 -1
  11. package/dist/declarations/src/schema/literal.d.ts +10 -1
  12. package/dist/declarations/src/schema/number.d.ts +10 -1
  13. package/dist/declarations/src/schema/object.d.ts +10 -1
  14. package/dist/declarations/src/schema/record.d.ts +10 -1
  15. package/dist/declarations/src/schema/richtext.d.ts +10 -1
  16. package/dist/declarations/src/schema/route.d.ts +10 -1
  17. package/dist/declarations/src/schema/string.d.ts +10 -1
  18. package/dist/declarations/src/schema/union.d.ts +13 -1
  19. package/dist/{index-ba727e96.esm.js → index-50fd9c06.esm.js} +660 -112
  20. package/dist/{index-d020e978.cjs.dev.js → index-96716d5d.cjs.dev.js} +660 -111
  21. package/dist/{index-5bc1d576.cjs.prod.js → index-f203e2fa.cjs.prod.js} +660 -111
  22. package/dist/valbuild-core.cjs.dev.js +2 -1
  23. package/dist/valbuild-core.cjs.prod.js +2 -1
  24. package/dist/valbuild-core.esm.js +1 -1
  25. package/package.json +1 -1
  26. package/patch/dist/valbuild-core-patch.cjs.dev.js +1 -1
  27. package/patch/dist/valbuild-core-patch.cjs.prod.js +1 -1
  28. package/patch/dist/valbuild-core-patch.esm.js +2 -2
@@ -416,6 +416,9 @@ var FileSchema = /*#__PURE__*/function (_Schema) {
416
416
  var isRemote = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
417
417
  var customValidateFunctions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
418
418
  var moduleMetadata = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
419
+ var isReadonly = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
420
+ var isHidden = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
421
+ var description = arguments.length > 7 ? arguments[7] : undefined;
419
422
  _classCallCheck(this, FileSchema);
420
423
  _this = _callSuper(this, FileSchema);
421
424
  _this.options = options;
@@ -423,18 +426,26 @@ var FileSchema = /*#__PURE__*/function (_Schema) {
423
426
  _this.isRemote = isRemote;
424
427
  _this.customValidateFunctions = customValidateFunctions;
425
428
  _this.moduleMetadata = moduleMetadata;
429
+ _this.isReadonly = isReadonly;
430
+ _this.isHidden = isHidden;
431
+ _this.description = description;
426
432
  return _this;
427
433
  }
428
434
  _inherits(FileSchema, _Schema);
429
435
  return _createClass(FileSchema, [{
436
+ key: "describe",
437
+ value: function describe(description) {
438
+ return new FileSchema(this.options, this.opt, this.isRemote, this.customValidateFunctions, this.moduleMetadata, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
439
+ }
440
+ }, {
430
441
  key: "remote",
431
442
  value: function remote() {
432
- return new FileSchema(this.options, this.opt, true, this.customValidateFunctions, this.moduleMetadata);
443
+ return new FileSchema(this.options, this.opt, true, this.customValidateFunctions, this.moduleMetadata, this.isReadonly, this.isHidden, this.description);
433
444
  }
434
445
  }, {
435
446
  key: "validate",
436
447
  value: function validate(validationFunction) {
437
- return new FileSchema(this.options, this.opt, this.isRemote, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.moduleMetadata);
448
+ return new FileSchema(this.options, this.opt, this.isRemote, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.moduleMetadata, this.isReadonly, this.isHidden, this.description);
438
449
  }
439
450
  }, {
440
451
  key: "executeValidate",
@@ -595,7 +606,17 @@ var FileSchema = /*#__PURE__*/function (_Schema) {
595
606
  }, {
596
607
  key: "nullable",
597
608
  value: function nullable() {
598
- return new FileSchema(this.options, true, this.isRemote, this.customValidateFunctions, this.moduleMetadata);
609
+ return new FileSchema(this.options, true, this.isRemote, this.customValidateFunctions, this.moduleMetadata, this.isReadonly, this.isHidden, this.description);
610
+ }
611
+ }, {
612
+ key: "readonly",
613
+ value: function readonly() {
614
+ return new FileSchema(this.options, this.opt, this.isRemote, this.customValidateFunctions, this.moduleMetadata, true, this.isHidden, this.description);
615
+ }
616
+ }, {
617
+ key: "hidden",
618
+ value: function hidden() {
619
+ return new FileSchema(this.options, this.opt, this.isRemote, this.customValidateFunctions, this.moduleMetadata, this.isReadonly, true, this.description);
599
620
  }
600
621
  }, {
601
622
  key: "executeSerialize",
@@ -608,7 +629,10 @@ var FileSchema = /*#__PURE__*/function (_Schema) {
608
629
  opt: this.opt,
609
630
  remote: this.isRemote,
610
631
  customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
611
- referencedModule: modulePaths.length > 0 ? modulePaths[0] : undefined
632
+ referencedModule: modulePaths.length > 0 ? modulePaths[0] : undefined,
633
+ readonly: this.isReadonly,
634
+ hidden: this.isHidden,
635
+ description: this.description
612
636
  };
613
637
  }
614
638
  }, {
@@ -688,6 +712,9 @@ var StringSchema = /*#__PURE__*/function (_Schema) {
688
712
  var isRaw = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
689
713
  var customValidateFunctions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
690
714
  var renderInput = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
715
+ var isReadonly = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
716
+ var isHidden = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
717
+ var description = arguments.length > 7 ? arguments[7] : undefined;
691
718
  _classCallCheck(this, StringSchema);
692
719
  _this = _callSuper(this, StringSchema);
693
720
  _this.options = options;
@@ -695,14 +722,22 @@ var StringSchema = /*#__PURE__*/function (_Schema) {
695
722
  _this.isRaw = isRaw;
696
723
  _this.customValidateFunctions = customValidateFunctions;
697
724
  _this.renderInput = renderInput;
725
+ _this.isReadonly = isReadonly;
726
+ _this.isHidden = isHidden;
727
+ _this.description = description;
698
728
  return _this;
699
729
  }
700
-
701
- /**
702
- * @deprecated Use `minLength` instead
703
- */
704
730
  _inherits(StringSchema, _Schema);
705
731
  return _createClass(StringSchema, [{
732
+ key: "describe",
733
+ value: function describe(description) {
734
+ return new StringSchema(this.options, this.opt, this.isRaw, this.customValidateFunctions, this.renderInput, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
735
+ }
736
+
737
+ /**
738
+ * @deprecated Use `minLength` instead
739
+ */
740
+ }, {
706
741
  key: "min",
707
742
  value: function min(minLength) {
708
743
  return this.minLength(minLength);
@@ -712,7 +747,7 @@ var StringSchema = /*#__PURE__*/function (_Schema) {
712
747
  value: function minLength(_minLength) {
713
748
  return new StringSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
714
749
  minLength: _minLength
715
- }), this.opt, this.isRaw, this.customValidateFunctions, this.renderInput);
750
+ }), this.opt, this.isRaw, this.customValidateFunctions, this.renderInput, this.isReadonly, this.isHidden, this.description);
716
751
  }
717
752
 
718
753
  /**
@@ -728,7 +763,7 @@ var StringSchema = /*#__PURE__*/function (_Schema) {
728
763
  value: function maxLength(_maxLength) {
729
764
  return new StringSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
730
765
  maxLength: _maxLength
731
- }), this.opt, this.isRaw, this.customValidateFunctions, this.renderInput);
766
+ }), this.opt, this.isRaw, this.customValidateFunctions, this.renderInput, this.isReadonly, this.isHidden, this.description);
732
767
  }
733
768
  }, {
734
769
  key: "regexp",
@@ -736,12 +771,12 @@ var StringSchema = /*#__PURE__*/function (_Schema) {
736
771
  return new StringSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
737
772
  regexp: _regexp,
738
773
  regExpMessage: message
739
- }), this.opt, this.isRaw, this.customValidateFunctions, this.renderInput);
774
+ }), this.opt, this.isRaw, this.customValidateFunctions, this.renderInput, this.isReadonly, this.isHidden, this.description);
740
775
  }
741
776
  }, {
742
777
  key: "validate",
743
778
  value: function validate(validationFunction) {
744
- return new StringSchema(this.options, this.opt, this.isRaw, this.customValidateFunctions.concat(validationFunction), this.renderInput);
779
+ return new StringSchema(this.options, this.opt, this.isRaw, this.customValidateFunctions.concat(validationFunction), this.renderInput, this.isReadonly, this.isHidden, this.description);
745
780
  }
746
781
  }, {
747
782
  key: "executeValidate",
@@ -814,12 +849,22 @@ var StringSchema = /*#__PURE__*/function (_Schema) {
814
849
  }, {
815
850
  key: "nullable",
816
851
  value: function nullable() {
817
- return new StringSchema(this.options, true, this.isRaw, this.customValidateFunctions, this.renderInput);
852
+ return new StringSchema(this.options, true, this.isRaw, this.customValidateFunctions, this.renderInput, this.isReadonly, this.isHidden, this.description);
853
+ }
854
+ }, {
855
+ key: "readonly",
856
+ value: function readonly() {
857
+ return new StringSchema(this.options, this.opt, this.isRaw, this.customValidateFunctions, this.renderInput, true, this.isHidden, this.description);
858
+ }
859
+ }, {
860
+ key: "hidden",
861
+ value: function hidden() {
862
+ return new StringSchema(this.options, this.opt, this.isRaw, this.customValidateFunctions, this.renderInput, this.isReadonly, true, this.description);
818
863
  }
819
864
  }, {
820
865
  key: "raw",
821
866
  value: function raw() {
822
- return new StringSchema(this.options, this.opt, true, this.customValidateFunctions, this.renderInput);
867
+ return new StringSchema(this.options, this.opt, true, this.customValidateFunctions, this.renderInput, this.isReadonly, this.isHidden, this.description);
823
868
  }
824
869
  }, {
825
870
  key: "executeSerialize",
@@ -839,13 +884,16 @@ var StringSchema = /*#__PURE__*/function (_Schema) {
839
884
  },
840
885
  opt: this.opt,
841
886
  raw: this.isRaw,
842
- customValidate: this.customValidateFunctions && ((_this$customValidateF2 = this.customValidateFunctions) === null || _this$customValidateF2 === void 0 ? void 0 : _this$customValidateF2.length) > 0
887
+ customValidate: this.customValidateFunctions && ((_this$customValidateF2 = this.customValidateFunctions) === null || _this$customValidateF2 === void 0 ? void 0 : _this$customValidateF2.length) > 0,
888
+ readonly: this.isReadonly,
889
+ hidden: this.isHidden,
890
+ description: this.description
843
891
  };
844
892
  }
845
893
  }, {
846
894
  key: "render",
847
895
  value: function render(input) {
848
- return new StringSchema(this.options, this.opt, this.isRaw, this.customValidateFunctions, input);
896
+ return new StringSchema(this.options, this.opt, this.isRaw, this.customValidateFunctions, input, this.isReadonly, this.isHidden, this.description);
849
897
  }
850
898
  }, {
851
899
  key: "executeRender",
@@ -880,18 +928,29 @@ var ObjectSchema = /*#__PURE__*/function (_Schema) {
880
928
  var _this;
881
929
  var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
882
930
  var customValidateFunctions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
931
+ var isReadonly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
932
+ var isHidden = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
933
+ var description = arguments.length > 5 ? arguments[5] : undefined;
883
934
  _classCallCheck(this, ObjectSchema);
884
935
  _this = _callSuper(this, ObjectSchema);
885
936
  _this.items = items;
886
937
  _this.opt = opt;
887
938
  _this.customValidateFunctions = customValidateFunctions;
939
+ _this.isReadonly = isReadonly;
940
+ _this.isHidden = isHidden;
941
+ _this.description = description;
888
942
  return _this;
889
943
  }
890
944
  _inherits(ObjectSchema, _Schema);
891
945
  return _createClass(ObjectSchema, [{
946
+ key: "describe",
947
+ value: function describe(description) {
948
+ return new ObjectSchema(this.items, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
949
+ }
950
+ }, {
892
951
  key: "validate",
893
952
  value: function validate(validationFunction) {
894
- return new ObjectSchema(this.items, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]));
953
+ return new ObjectSchema(this.items, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description);
895
954
  }
896
955
  }, {
897
956
  key: "executeValidate",
@@ -1015,7 +1074,17 @@ var ObjectSchema = /*#__PURE__*/function (_Schema) {
1015
1074
  }, {
1016
1075
  key: "nullable",
1017
1076
  value: function nullable() {
1018
- return new ObjectSchema(this.items, true);
1077
+ return new ObjectSchema(this.items, true, [], this.isReadonly, this.isHidden, this.description);
1078
+ }
1079
+ }, {
1080
+ key: "readonly",
1081
+ value: function readonly() {
1082
+ return new ObjectSchema(this.items, this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
1083
+ }
1084
+ }, {
1085
+ key: "hidden",
1086
+ value: function hidden() {
1087
+ return new ObjectSchema(this.items, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
1019
1088
  }
1020
1089
  }, {
1021
1090
  key: "executeSerialize",
@@ -1030,7 +1099,10 @@ var ObjectSchema = /*#__PURE__*/function (_Schema) {
1030
1099
  return [key, schema["executeSerialize"]()];
1031
1100
  })),
1032
1101
  opt: this.opt,
1033
- customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0
1102
+ customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
1103
+ readonly: this.isReadonly,
1104
+ hidden: this.isHidden,
1105
+ description: this.description
1034
1106
  };
1035
1107
  }
1036
1108
  }, {
@@ -1070,19 +1142,30 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
1070
1142
  var _this;
1071
1143
  var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1072
1144
  var customValidateFunctions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
1145
+ var isReadonly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
1146
+ var isHidden = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
1147
+ var description = arguments.length > 5 ? arguments[5] : undefined;
1073
1148
  _classCallCheck(this, ArraySchema);
1074
1149
  _this = _callSuper(this, ArraySchema);
1075
1150
  _defineProperty(_this, "renderInput", null);
1076
1151
  _this.item = item;
1077
1152
  _this.opt = opt;
1078
1153
  _this.customValidateFunctions = customValidateFunctions;
1154
+ _this.isReadonly = isReadonly;
1155
+ _this.isHidden = isHidden;
1156
+ _this.description = description;
1079
1157
  return _this;
1080
1158
  }
1081
1159
  _inherits(ArraySchema, _Schema);
1082
1160
  return _createClass(ArraySchema, [{
1161
+ key: "describe",
1162
+ value: function describe(description) {
1163
+ return new ArraySchema(this.item, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
1164
+ }
1165
+ }, {
1083
1166
  key: "validate",
1084
1167
  value: function validate(validationFunction) {
1085
- return new ArraySchema(this.item, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]));
1168
+ return new ArraySchema(this.item, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description);
1086
1169
  }
1087
1170
  }, {
1088
1171
  key: "executeValidate",
@@ -1154,7 +1237,17 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
1154
1237
  }, {
1155
1238
  key: "nullable",
1156
1239
  value: function nullable() {
1157
- return new ArraySchema(this.item, true);
1240
+ return new ArraySchema(this.item, true, [], this.isReadonly, this.isHidden, this.description);
1241
+ }
1242
+ }, {
1243
+ key: "readonly",
1244
+ value: function readonly() {
1245
+ return new ArraySchema(this.item, this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
1246
+ }
1247
+ }, {
1248
+ key: "hidden",
1249
+ value: function hidden() {
1250
+ return new ArraySchema(this.item, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
1158
1251
  }
1159
1252
  }, {
1160
1253
  key: "executeSerialize",
@@ -1164,7 +1257,10 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
1164
1257
  type: "array",
1165
1258
  item: this.item["executeSerialize"](),
1166
1259
  opt: this.opt,
1167
- customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0
1260
+ customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
1261
+ readonly: this.isReadonly,
1262
+ hidden: this.isHidden,
1263
+ description: this.description
1168
1264
  };
1169
1265
  }
1170
1266
  }, {
@@ -1245,18 +1341,29 @@ var LiteralSchema = /*#__PURE__*/function (_Schema) {
1245
1341
  var _this;
1246
1342
  var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1247
1343
  var customValidateFunctions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
1344
+ var isReadonly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
1345
+ var isHidden = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
1346
+ var description = arguments.length > 5 ? arguments[5] : undefined;
1248
1347
  _classCallCheck(this, LiteralSchema);
1249
1348
  _this = _callSuper(this, LiteralSchema);
1250
1349
  _this.value = value;
1251
1350
  _this.opt = opt;
1252
1351
  _this.customValidateFunctions = customValidateFunctions;
1352
+ _this.isReadonly = isReadonly;
1353
+ _this.isHidden = isHidden;
1354
+ _this.description = description;
1253
1355
  return _this;
1254
1356
  }
1255
1357
  _inherits(LiteralSchema, _Schema);
1256
1358
  return _createClass(LiteralSchema, [{
1359
+ key: "describe",
1360
+ value: function describe(description) {
1361
+ return new LiteralSchema(this.value, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
1362
+ }
1363
+ }, {
1257
1364
  key: "validate",
1258
1365
  value: function validate(validationFunction) {
1259
- return new LiteralSchema(this.value, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]));
1366
+ return new LiteralSchema(this.value, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description);
1260
1367
  }
1261
1368
  }, {
1262
1369
  key: "executeValidate",
@@ -1319,7 +1426,17 @@ var LiteralSchema = /*#__PURE__*/function (_Schema) {
1319
1426
  }, {
1320
1427
  key: "nullable",
1321
1428
  value: function nullable() {
1322
- return new LiteralSchema(this.value, true);
1429
+ return new LiteralSchema(this.value, true, [], this.isReadonly, this.isHidden, this.description);
1430
+ }
1431
+ }, {
1432
+ key: "readonly",
1433
+ value: function readonly() {
1434
+ return new LiteralSchema(this.value, this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
1435
+ }
1436
+ }, {
1437
+ key: "hidden",
1438
+ value: function hidden() {
1439
+ return new LiteralSchema(this.value, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
1323
1440
  }
1324
1441
  }, {
1325
1442
  key: "executeSerialize",
@@ -1329,7 +1446,10 @@ var LiteralSchema = /*#__PURE__*/function (_Schema) {
1329
1446
  type: "literal",
1330
1447
  value: this.value,
1331
1448
  opt: this.opt,
1332
- customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0
1449
+ customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
1450
+ readonly: this.isReadonly,
1451
+ hidden: this.isHidden,
1452
+ description: this.description
1333
1453
  };
1334
1454
  }
1335
1455
  }, {
@@ -1348,19 +1468,30 @@ var UnionSchema = /*#__PURE__*/function (_Schema) {
1348
1468
  var _this;
1349
1469
  var opt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1350
1470
  var customValidateFunctions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
1471
+ var isReadonly = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
1472
+ var isHidden = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
1473
+ var description = arguments.length > 6 ? arguments[6] : undefined;
1351
1474
  _classCallCheck(this, UnionSchema);
1352
1475
  _this = _callSuper(this, UnionSchema);
1353
1476
  _this.key = key;
1354
1477
  _this.items = items;
1355
1478
  _this.opt = opt;
1356
1479
  _this.customValidateFunctions = customValidateFunctions;
1480
+ _this.isReadonly = isReadonly;
1481
+ _this.isHidden = isHidden;
1482
+ _this.description = description;
1357
1483
  return _this;
1358
1484
  }
1359
1485
  _inherits(UnionSchema, _Schema);
1360
1486
  return _createClass(UnionSchema, [{
1487
+ key: "describe",
1488
+ value: function describe(description) {
1489
+ return new UnionSchema(this.key, this.items, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
1490
+ }
1491
+ }, {
1361
1492
  key: "validate",
1362
1493
  value: function validate(validationFunction) {
1363
- return new UnionSchema(this.key, this.items, this.opt, this.customValidateFunctions.concat(validationFunction));
1494
+ return new UnionSchema(this.key, this.items, this.opt, this.customValidateFunctions.concat(validationFunction), this.isReadonly, this.isHidden, this.description);
1364
1495
  }
1365
1496
  }, {
1366
1497
  key: "executeValidate",
@@ -1653,7 +1784,17 @@ var UnionSchema = /*#__PURE__*/function (_Schema) {
1653
1784
  }, {
1654
1785
  key: "nullable",
1655
1786
  value: function nullable() {
1656
- return new UnionSchema(this.key, this.items, true);
1787
+ return new UnionSchema(this.key, this.items, true, [], this.isReadonly, this.isHidden, this.description);
1788
+ }
1789
+ }, {
1790
+ key: "readonly",
1791
+ value: function readonly() {
1792
+ return new UnionSchema(this.key, this.items, this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
1793
+ }
1794
+ }, {
1795
+ key: "hidden",
1796
+ value: function hidden() {
1797
+ return new UnionSchema(this.key, this.items, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
1657
1798
  }
1658
1799
  }, {
1659
1800
  key: "executeSerialize",
@@ -1668,7 +1809,10 @@ var UnionSchema = /*#__PURE__*/function (_Schema) {
1668
1809
  return o["executeSerialize"]();
1669
1810
  }),
1670
1811
  opt: this.opt,
1671
- customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0
1812
+ customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
1813
+ readonly: this.isReadonly,
1814
+ hidden: this.isHidden,
1815
+ description: this.description
1672
1816
  };
1673
1817
  }
1674
1818
  return {
@@ -1678,7 +1822,10 @@ var UnionSchema = /*#__PURE__*/function (_Schema) {
1678
1822
  return o["executeSerialize"]();
1679
1823
  }),
1680
1824
  opt: this.opt,
1681
- customValidate: this.customValidateFunctions && ((_this$customValidateF2 = this.customValidateFunctions) === null || _this$customValidateF2 === void 0 ? void 0 : _this$customValidateF2.length) > 0
1825
+ customValidate: this.customValidateFunctions && ((_this$customValidateF2 = this.customValidateFunctions) === null || _this$customValidateF2 === void 0 ? void 0 : _this$customValidateF2.length) > 0,
1826
+ readonly: this.isReadonly,
1827
+ hidden: this.isHidden,
1828
+ description: this.description
1682
1829
  };
1683
1830
  }
1684
1831
  }, {
@@ -1739,6 +1886,9 @@ var ImageSchema = /*#__PURE__*/function (_Schema) {
1739
1886
  var isRemote = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1740
1887
  var customValidateFunctions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
1741
1888
  var moduleMetadata = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
1889
+ var isReadonly = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
1890
+ var isHidden = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
1891
+ var description = arguments.length > 7 ? arguments[7] : undefined;
1742
1892
  _classCallCheck(this, ImageSchema);
1743
1893
  _this = _callSuper(this, ImageSchema);
1744
1894
  _this.options = options;
@@ -1746,18 +1896,26 @@ var ImageSchema = /*#__PURE__*/function (_Schema) {
1746
1896
  _this.isRemote = isRemote;
1747
1897
  _this.customValidateFunctions = customValidateFunctions;
1748
1898
  _this.moduleMetadata = moduleMetadata;
1899
+ _this.isReadonly = isReadonly;
1900
+ _this.isHidden = isHidden;
1901
+ _this.description = description;
1749
1902
  return _this;
1750
1903
  }
1751
1904
  _inherits(ImageSchema, _Schema);
1752
1905
  return _createClass(ImageSchema, [{
1906
+ key: "describe",
1907
+ value: function describe(description) {
1908
+ return new ImageSchema(this.options, this.opt, this.isRemote, this.customValidateFunctions, this.moduleMetadata, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
1909
+ }
1910
+ }, {
1753
1911
  key: "remote",
1754
1912
  value: function remote() {
1755
- return new ImageSchema(this.options, this.opt, true, this.customValidateFunctions, this.moduleMetadata);
1913
+ return new ImageSchema(this.options, this.opt, true, this.customValidateFunctions, this.moduleMetadata, this.isReadonly, this.isHidden, this.description);
1756
1914
  }
1757
1915
  }, {
1758
1916
  key: "validate",
1759
1917
  value: function validate(validationFunction) {
1760
- return new ImageSchema(this.options, this.opt, this.isRemote, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.moduleMetadata);
1918
+ return new ImageSchema(this.options, this.opt, this.isRemote, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.moduleMetadata, this.isReadonly, this.isHidden, this.description);
1761
1919
  }
1762
1920
  }, {
1763
1921
  key: "executeValidate",
@@ -1937,7 +2095,17 @@ var ImageSchema = /*#__PURE__*/function (_Schema) {
1937
2095
  }, {
1938
2096
  key: "nullable",
1939
2097
  value: function nullable() {
1940
- return new ImageSchema(this.options, true, this.isRemote, this.customValidateFunctions, this.moduleMetadata);
2098
+ return new ImageSchema(this.options, true, this.isRemote, this.customValidateFunctions, this.moduleMetadata, this.isReadonly, this.isHidden, this.description);
2099
+ }
2100
+ }, {
2101
+ key: "readonly",
2102
+ value: function readonly() {
2103
+ return new ImageSchema(this.options, this.opt, this.isRemote, this.customValidateFunctions, this.moduleMetadata, true, this.isHidden, this.description);
2104
+ }
2105
+ }, {
2106
+ key: "hidden",
2107
+ value: function hidden() {
2108
+ return new ImageSchema(this.options, this.opt, this.isRemote, this.customValidateFunctions, this.moduleMetadata, this.isReadonly, true, this.description);
1941
2109
  }
1942
2110
  }, {
1943
2111
  key: "executeSerialize",
@@ -1950,7 +2118,10 @@ var ImageSchema = /*#__PURE__*/function (_Schema) {
1950
2118
  opt: this.opt,
1951
2119
  remote: this.isRemote,
1952
2120
  customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
1953
- referencedModule: modulePaths.length > 0 ? modulePaths[0] : undefined
2121
+ referencedModule: modulePaths.length > 0 ? modulePaths[0] : undefined,
2122
+ readonly: this.isReadonly,
2123
+ hidden: this.isHidden,
2124
+ description: this.description
1954
2125
  };
1955
2126
  }
1956
2127
  }, {
@@ -1982,33 +2153,44 @@ var RouteSchema = /*#__PURE__*/function (_Schema) {
1982
2153
  var _this;
1983
2154
  var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1984
2155
  var customValidateFunctions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
2156
+ var isReadonly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
2157
+ var isHidden = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
2158
+ var description = arguments.length > 5 ? arguments[5] : undefined;
1985
2159
  _classCallCheck(this, RouteSchema);
1986
2160
  _this = _callSuper(this, RouteSchema);
1987
2161
  _this.options = options;
1988
2162
  _this.opt = opt;
1989
2163
  _this.customValidateFunctions = customValidateFunctions;
2164
+ _this.isReadonly = isReadonly;
2165
+ _this.isHidden = isHidden;
2166
+ _this.description = description;
1990
2167
  return _this;
1991
2168
  }
1992
-
1993
- /**
1994
- * Specify a pattern for which routes are allowed.
1995
- *
1996
- * Semantics:
1997
- * - If only include is set: route must match include pattern
1998
- * - If only exclude is set: route must NOT match exclude pattern
1999
- * - If both are set: route must match include AND must NOT match exclude
2000
- *
2001
- * @example
2002
- * s.route().include(/^\/(home|about|contact)$/) // Only these specific routes
2003
- * s.route().include(/^\/api\//).exclude(/^\/api\/internal\//) // API routes except internal
2004
- */
2005
2169
  _inherits(RouteSchema, _Schema);
2006
2170
  return _createClass(RouteSchema, [{
2171
+ key: "describe",
2172
+ value: function describe(description) {
2173
+ return new RouteSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
2174
+ }
2175
+
2176
+ /**
2177
+ * Specify a pattern for which routes are allowed.
2178
+ *
2179
+ * Semantics:
2180
+ * - If only include is set: route must match include pattern
2181
+ * - If only exclude is set: route must NOT match exclude pattern
2182
+ * - If both are set: route must match include AND must NOT match exclude
2183
+ *
2184
+ * @example
2185
+ * s.route().include(/^\/(home|about|contact)$/) // Only these specific routes
2186
+ * s.route().include(/^\/api\//).exclude(/^\/api\/internal\//) // API routes except internal
2187
+ */
2188
+ }, {
2007
2189
  key: "include",
2008
2190
  value: function include(pattern) {
2009
2191
  return new RouteSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
2010
2192
  include: pattern
2011
- }), this.opt, this.customValidateFunctions);
2193
+ }), this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description);
2012
2194
  }
2013
2195
 
2014
2196
  /**
@@ -2028,12 +2210,12 @@ var RouteSchema = /*#__PURE__*/function (_Schema) {
2028
2210
  value: function exclude(pattern) {
2029
2211
  return new RouteSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
2030
2212
  exclude: pattern
2031
- }), this.opt, this.customValidateFunctions);
2213
+ }), this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description);
2032
2214
  }
2033
2215
  }, {
2034
2216
  key: "validate",
2035
2217
  value: function validate(validationFunction) {
2036
- return new RouteSchema(this.options, this.opt, this.customValidateFunctions.concat(validationFunction));
2218
+ return new RouteSchema(this.options, this.opt, this.customValidateFunctions.concat(validationFunction), this.isReadonly, this.isHidden, this.description);
2037
2219
  }
2038
2220
  }, {
2039
2221
  key: "executeValidate",
@@ -2088,7 +2270,17 @@ var RouteSchema = /*#__PURE__*/function (_Schema) {
2088
2270
  }, {
2089
2271
  key: "nullable",
2090
2272
  value: function nullable() {
2091
- return new RouteSchema(this.options, true, this.customValidateFunctions);
2273
+ return new RouteSchema(this.options, true, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description);
2274
+ }
2275
+ }, {
2276
+ key: "readonly",
2277
+ value: function readonly() {
2278
+ return new RouteSchema(this.options, this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
2279
+ }
2280
+ }, {
2281
+ key: "hidden",
2282
+ value: function hidden() {
2283
+ return new RouteSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
2092
2284
  }
2093
2285
  }, {
2094
2286
  key: "executeSerialize",
@@ -2108,7 +2300,10 @@ var RouteSchema = /*#__PURE__*/function (_Schema) {
2108
2300
  customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0
2109
2301
  },
2110
2302
  opt: this.opt,
2111
- customValidate: this.customValidateFunctions && ((_this$customValidateF2 = this.customValidateFunctions) === null || _this$customValidateF2 === void 0 ? void 0 : _this$customValidateF2.length) > 0
2303
+ customValidate: this.customValidateFunctions && ((_this$customValidateF2 = this.customValidateFunctions) === null || _this$customValidateF2 === void 0 ? void 0 : _this$customValidateF2.length) > 0,
2304
+ readonly: this.isReadonly,
2305
+ hidden: this.isHidden,
2306
+ description: this.description
2112
2307
  };
2113
2308
  }
2114
2309
  }, {
@@ -2127,32 +2322,43 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
2127
2322
  var _this;
2128
2323
  var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2129
2324
  var customValidateFunctions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
2325
+ var isReadonly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
2326
+ var isHidden = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
2327
+ var description = arguments.length > 5 ? arguments[5] : undefined;
2130
2328
  _classCallCheck(this, RichTextSchema);
2131
2329
  _this = _callSuper(this, RichTextSchema);
2132
2330
  _this.options = options;
2133
2331
  _this.opt = opt;
2134
2332
  _this.customValidateFunctions = customValidateFunctions;
2333
+ _this.isReadonly = isReadonly;
2334
+ _this.isHidden = isHidden;
2335
+ _this.description = description;
2135
2336
  return _this;
2136
2337
  }
2137
2338
  _inherits(RichTextSchema, _Schema);
2138
2339
  return _createClass(RichTextSchema, [{
2340
+ key: "describe",
2341
+ value: function describe(description) {
2342
+ return new RichTextSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
2343
+ }
2344
+ }, {
2139
2345
  key: "maxLength",
2140
2346
  value: function maxLength(max) {
2141
2347
  return new RichTextSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
2142
2348
  maxLength: max
2143
- }), this.opt);
2349
+ }), this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description);
2144
2350
  }
2145
2351
  }, {
2146
2352
  key: "minLength",
2147
2353
  value: function minLength(min) {
2148
2354
  return new RichTextSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
2149
2355
  minLength: min
2150
- }), this.opt);
2356
+ }), this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description);
2151
2357
  }
2152
2358
  }, {
2153
2359
  key: "validate",
2154
2360
  value: function validate(validationFunction) {
2155
- return new RichTextSchema(this.options, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]));
2361
+ return new RichTextSchema(this.options, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description);
2156
2362
  }
2157
2363
  }, {
2158
2364
  key: "executeValidate",
@@ -2602,7 +2808,17 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
2602
2808
  }, {
2603
2809
  key: "nullable",
2604
2810
  value: function nullable() {
2605
- return new RichTextSchema(this.options, true);
2811
+ return new RichTextSchema(this.options, true, [], this.isReadonly, this.isHidden, this.description);
2812
+ }
2813
+ }, {
2814
+ key: "readonly",
2815
+ value: function readonly() {
2816
+ return new RichTextSchema(this.options, this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
2817
+ }
2818
+ }, {
2819
+ key: "hidden",
2820
+ value: function hidden() {
2821
+ return new RichTextSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
2606
2822
  }
2607
2823
  }, {
2608
2824
  key: "executeSerialize",
@@ -2636,7 +2852,10 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
2636
2852
  type: "richtext",
2637
2853
  opt: this.opt,
2638
2854
  options: serializedOptions,
2639
- customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0
2855
+ customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
2856
+ readonly: this.isReadonly,
2857
+ hidden: this.isHidden,
2858
+ description: this.description
2640
2859
  };
2641
2860
  }
2642
2861
  }, {
@@ -2691,6 +2910,9 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
2691
2910
  var currentRouter = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
2692
2911
  var keySchema = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
2693
2912
  var mediaOptions = arguments.length > 5 ? arguments[5] : undefined;
2913
+ var isReadonly = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
2914
+ var isHidden = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
2915
+ var description = arguments.length > 8 ? arguments[8] : undefined;
2694
2916
  _classCallCheck(this, RecordSchema);
2695
2917
  _this = _callSuper(this, RecordSchema);
2696
2918
  _defineProperty(_this, "renderInput", null);
@@ -2700,13 +2922,21 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
2700
2922
  _this.currentRouter = currentRouter;
2701
2923
  _this.keySchema = keySchema;
2702
2924
  _this.mediaOptions = mediaOptions;
2925
+ _this.isReadonly = isReadonly;
2926
+ _this.isHidden = isHidden;
2927
+ _this.description = description;
2703
2928
  return _this;
2704
2929
  }
2705
2930
  _inherits(RecordSchema, _Schema);
2706
2931
  return _createClass(RecordSchema, [{
2932
+ key: "describe",
2933
+ value: function describe(description) {
2934
+ return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
2935
+ }
2936
+ }, {
2707
2937
  key: "validate",
2708
2938
  value: function validate(validationFunction) {
2709
- return new RecordSchema(this.item, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.currentRouter, this.keySchema, this.mediaOptions);
2939
+ return new RecordSchema(this.item, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description);
2710
2940
  }
2711
2941
  }, {
2712
2942
  key: "executeValidate",
@@ -3052,19 +3282,29 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3052
3282
  }, {
3053
3283
  key: "nullable",
3054
3284
  value: function nullable() {
3055
- return new RecordSchema(this.item, true, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions);
3285
+ return new RecordSchema(this.item, true, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description);
3286
+ }
3287
+ }, {
3288
+ key: "readonly",
3289
+ value: function readonly() {
3290
+ return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, true, this.isHidden, this.description);
3291
+ }
3292
+ }, {
3293
+ key: "hidden",
3294
+ value: function hidden() {
3295
+ return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, true, this.description);
3056
3296
  }
3057
3297
  }, {
3058
3298
  key: "router",
3059
3299
  value: function router(_router) {
3060
- return new RecordSchema(this.item, this.opt, this.customValidateFunctions, _router, this.keySchema, this.mediaOptions);
3300
+ return new RecordSchema(this.item, this.opt, this.customValidateFunctions, _router, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description);
3061
3301
  }
3062
3302
  }, {
3063
3303
  key: "remote",
3064
3304
  value: function remote() {
3065
3305
  return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions ? _objectSpread2(_objectSpread2({}, this.mediaOptions), {}, {
3066
3306
  remote: true
3067
- }) : undefined);
3307
+ }) : undefined, this.isReadonly, this.isHidden, this.description);
3068
3308
  }
3069
3309
  }, {
3070
3310
  key: "getRouterValidations",
@@ -3118,7 +3358,10 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3118
3358
  key: (_this$keySchema = this.keySchema) === null || _this$keySchema === void 0 ? void 0 : _this$keySchema["executeSerialize"](),
3119
3359
  opt: this.opt,
3120
3360
  router: (_this$currentRouter = this.currentRouter) === null || _this$currentRouter === void 0 ? void 0 : _this$currentRouter.getRouterId(),
3121
- customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0
3361
+ customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
3362
+ readonly: this.isReadonly,
3363
+ hidden: this.isHidden,
3364
+ description: this.description
3122
3365
  };
3123
3366
  if (this.mediaOptions) {
3124
3367
  result.mediaType = this.mediaOptions.type;
@@ -3738,18 +3981,29 @@ var NumberSchema = /*#__PURE__*/function (_Schema) {
3738
3981
  var _this;
3739
3982
  var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3740
3983
  var customValidateFunctions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
3984
+ var isReadonly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
3985
+ var isHidden = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
3986
+ var description = arguments.length > 5 ? arguments[5] : undefined;
3741
3987
  _classCallCheck(this, NumberSchema);
3742
3988
  _this = _callSuper(this, NumberSchema);
3743
3989
  _this.options = options;
3744
3990
  _this.opt = opt;
3745
3991
  _this.customValidateFunctions = customValidateFunctions;
3992
+ _this.isReadonly = isReadonly;
3993
+ _this.isHidden = isHidden;
3994
+ _this.description = description;
3746
3995
  return _this;
3747
3996
  }
3748
3997
  _inherits(NumberSchema, _Schema);
3749
3998
  return _createClass(NumberSchema, [{
3999
+ key: "describe",
4000
+ value: function describe(description) {
4001
+ return new NumberSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
4002
+ }
4003
+ }, {
3750
4004
  key: "validate",
3751
4005
  value: function validate(validationFunction) {
3752
- return new NumberSchema(this.options, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]));
4006
+ return new NumberSchema(this.options, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description);
3753
4007
  }
3754
4008
  }, {
3755
4009
  key: "executeValidate",
@@ -3819,21 +4073,31 @@ var NumberSchema = /*#__PURE__*/function (_Schema) {
3819
4073
  }, {
3820
4074
  key: "nullable",
3821
4075
  value: function nullable() {
3822
- return new NumberSchema(this.options, true);
4076
+ return new NumberSchema(this.options, true, [], this.isReadonly, this.isHidden, this.description);
4077
+ }
4078
+ }, {
4079
+ key: "readonly",
4080
+ value: function readonly() {
4081
+ return new NumberSchema(this.options, this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
4082
+ }
4083
+ }, {
4084
+ key: "hidden",
4085
+ value: function hidden() {
4086
+ return new NumberSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
3823
4087
  }
3824
4088
  }, {
3825
4089
  key: "max",
3826
4090
  value: function max(_max) {
3827
4091
  return new NumberSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
3828
4092
  max: _max
3829
- }), this.opt);
4093
+ }), this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description);
3830
4094
  }
3831
4095
  }, {
3832
4096
  key: "min",
3833
4097
  value: function min(_min) {
3834
4098
  return new NumberSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
3835
4099
  min: _min
3836
- }), this.opt);
4100
+ }), this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description);
3837
4101
  }
3838
4102
  }, {
3839
4103
  key: "executeSerialize",
@@ -3843,7 +4107,10 @@ var NumberSchema = /*#__PURE__*/function (_Schema) {
3843
4107
  type: "number",
3844
4108
  options: this.options,
3845
4109
  opt: this.opt,
3846
- customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0
4110
+ customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
4111
+ readonly: this.isReadonly,
4112
+ hidden: this.isHidden,
4113
+ description: this.description
3847
4114
  };
3848
4115
  }
3849
4116
  }, {
@@ -3862,17 +4129,28 @@ var BooleanSchema = /*#__PURE__*/function (_Schema) {
3862
4129
  var _this;
3863
4130
  var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
3864
4131
  var customValidateFunctions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
4132
+ var isReadonly = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
4133
+ var isHidden = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
4134
+ var description = arguments.length > 4 ? arguments[4] : undefined;
3865
4135
  _classCallCheck(this, BooleanSchema);
3866
4136
  _this = _callSuper(this, BooleanSchema);
3867
4137
  _this.opt = opt;
3868
4138
  _this.customValidateFunctions = customValidateFunctions;
4139
+ _this.isReadonly = isReadonly;
4140
+ _this.isHidden = isHidden;
4141
+ _this.description = description;
3869
4142
  return _this;
3870
4143
  }
3871
4144
  _inherits(BooleanSchema, _Schema);
3872
4145
  return _createClass(BooleanSchema, [{
4146
+ key: "describe",
4147
+ value: function describe(description) {
4148
+ return new BooleanSchema(this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
4149
+ }
4150
+ }, {
3873
4151
  key: "validate",
3874
4152
  value: function validate(validationFunction) {
3875
- return new BooleanSchema(this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]));
4153
+ return new BooleanSchema(this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description);
3876
4154
  }
3877
4155
  }, {
3878
4156
  key: "executeValidate",
@@ -3923,7 +4201,17 @@ var BooleanSchema = /*#__PURE__*/function (_Schema) {
3923
4201
  }, {
3924
4202
  key: "nullable",
3925
4203
  value: function nullable() {
3926
- return new BooleanSchema(true);
4204
+ return new BooleanSchema(true, [], this.isReadonly, this.isHidden, this.description);
4205
+ }
4206
+ }, {
4207
+ key: "readonly",
4208
+ value: function readonly() {
4209
+ return new BooleanSchema(this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
4210
+ }
4211
+ }, {
4212
+ key: "hidden",
4213
+ value: function hidden() {
4214
+ return new BooleanSchema(this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
3927
4215
  }
3928
4216
  }, {
3929
4217
  key: "executeSerialize",
@@ -3932,7 +4220,10 @@ var BooleanSchema = /*#__PURE__*/function (_Schema) {
3932
4220
  return {
3933
4221
  type: "boolean",
3934
4222
  opt: this.opt,
3935
- customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0
4223
+ customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
4224
+ readonly: this.isReadonly,
4225
+ hidden: this.isHidden,
4226
+ description: this.description
3936
4227
  };
3937
4228
  }
3938
4229
  }, {
@@ -3951,19 +4242,30 @@ var KeyOfSchema = /*#__PURE__*/function (_Schema) {
3951
4242
  var _this;
3952
4243
  var opt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
3953
4244
  var customValidateFunctions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
4245
+ var isReadonly = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
4246
+ var isHidden = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
4247
+ var description = arguments.length > 6 ? arguments[6] : undefined;
3954
4248
  _classCallCheck(this, KeyOfSchema);
3955
4249
  _this = _callSuper(this, KeyOfSchema);
3956
4250
  _this.schema = schema;
3957
4251
  _this.sourcePath = sourcePath;
3958
4252
  _this.opt = opt;
3959
4253
  _this.customValidateFunctions = customValidateFunctions;
4254
+ _this.isReadonly = isReadonly;
4255
+ _this.isHidden = isHidden;
4256
+ _this.description = description;
3960
4257
  return _this;
3961
4258
  }
3962
4259
  _inherits(KeyOfSchema, _Schema);
3963
4260
  return _createClass(KeyOfSchema, [{
4261
+ key: "describe",
4262
+ value: function describe(description) {
4263
+ return new KeyOfSchema(this.schema, this.sourcePath, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
4264
+ }
4265
+ }, {
3964
4266
  key: "validate",
3965
4267
  value: function validate(validationFunction) {
3966
- return new KeyOfSchema(this.schema, this.sourcePath, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]));
4268
+ return new KeyOfSchema(this.schema, this.sourcePath, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description);
3967
4269
  }
3968
4270
  }, {
3969
4271
  key: "executeValidate",
@@ -4093,7 +4395,17 @@ var KeyOfSchema = /*#__PURE__*/function (_Schema) {
4093
4395
  }, {
4094
4396
  key: "nullable",
4095
4397
  value: function nullable() {
4096
- return new KeyOfSchema(this.schema, this.sourcePath, true);
4398
+ return new KeyOfSchema(this.schema, this.sourcePath, true, [], this.isReadonly, this.isHidden, this.description);
4399
+ }
4400
+ }, {
4401
+ key: "readonly",
4402
+ value: function readonly() {
4403
+ return new KeyOfSchema(this.schema, this.sourcePath, this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
4404
+ }
4405
+ }, {
4406
+ key: "hidden",
4407
+ value: function hidden() {
4408
+ return new KeyOfSchema(this.schema, this.sourcePath, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
4097
4409
  }
4098
4410
  }, {
4099
4411
  key: "executeSerialize",
@@ -4125,7 +4437,10 @@ var KeyOfSchema = /*#__PURE__*/function (_Schema) {
4125
4437
  schema: serializedSchema,
4126
4438
  opt: this.opt,
4127
4439
  values: values,
4128
- customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0
4440
+ customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
4441
+ readonly: this.isReadonly,
4442
+ hidden: this.isHidden,
4443
+ description: this.description
4129
4444
  };
4130
4445
  }
4131
4446
  }, {
@@ -4202,68 +4517,78 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
4202
4517
  var _this;
4203
4518
  var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4204
4519
  var customValidateFunctions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4520
+ var isReadonly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
4521
+ var isHidden = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
4522
+ var description = arguments.length > 5 ? arguments[5] : undefined;
4205
4523
  _classCallCheck(this, DateSchema);
4206
4524
  _this = _callSuper(this, DateSchema);
4207
4525
  _this.options = options;
4208
4526
  _this.opt = opt;
4209
4527
  _this.customValidateFunctions = customValidateFunctions;
4528
+ _this.isReadonly = isReadonly;
4529
+ _this.isHidden = isHidden;
4530
+ _this.description = description;
4210
4531
  return _this;
4211
4532
  }
4212
4533
  _inherits(DateSchema, _Schema);
4213
4534
  return _createClass(DateSchema, [{
4535
+ key: "describe",
4536
+ value: function describe(description) {
4537
+ return new DateSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
4538
+ }
4539
+ }, {
4214
4540
  key: "validate",
4215
4541
  value: function validate(validationFunction) {
4216
- return new DateSchema(this.options, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]));
4542
+ return new DateSchema(this.options, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description);
4217
4543
  }
4218
4544
  }, {
4219
4545
  key: "executeValidate",
4220
4546
  value: function executeValidate(path, src) {
4221
4547
  var _this$options, _this$options2, _this$options3, _this$options4;
4548
+ var errors = this.executeCustomValidateFunctions(src, this.customValidateFunctions, {
4549
+ path: path
4550
+ });
4222
4551
  if (this.opt && (src === null || src === undefined)) {
4223
- return false;
4552
+ return errors.length > 0 ? _defineProperty({}, path, errors) : false;
4224
4553
  }
4225
4554
  if (typeof src !== "string") {
4226
- return _defineProperty({}, path, [{
4555
+ errors.push({
4227
4556
  message: "Expected 'string', got '".concat(_typeof(src), "'"),
4228
4557
  value: src
4229
- }]);
4558
+ });
4559
+ return _defineProperty({}, path, errors);
4230
4560
  }
4231
4561
  if ((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.from && (_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.to) {
4232
4562
  if (this.options.from > this.options.to) {
4233
- return _defineProperty({}, path, [{
4563
+ errors.push({
4234
4564
  message: "From date ".concat(this.options.from, " is after to date ").concat(this.options.to),
4235
4565
  value: src,
4236
4566
  typeError: true
4237
- }]);
4238
- }
4239
- if (src < this.options.from || src > this.options.to) {
4240
- return _defineProperty({}, path, [{
4567
+ });
4568
+ } else if (src < this.options.from || src > this.options.to) {
4569
+ errors.push({
4241
4570
  message: "Date is not between ".concat(this.options.from, " and ").concat(this.options.to),
4242
4571
  value: src
4243
- }]);
4572
+ });
4244
4573
  }
4245
4574
  } else if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.from) {
4246
4575
  if (src < this.options.from) {
4247
- return _defineProperty({}, path, [{
4576
+ errors.push({
4248
4577
  message: "Date is before the minimum date ".concat(this.options.from),
4249
4578
  value: src
4250
- }]);
4579
+ });
4251
4580
  }
4252
4581
  } else if ((_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.to) {
4253
4582
  if (src > this.options.to) {
4254
- return _defineProperty({}, path, [{
4583
+ errors.push({
4255
4584
  message: "Date is after the maximum date ".concat(this.options.to),
4256
4585
  value: src
4257
- }]);
4586
+ });
4258
4587
  }
4259
4588
  }
4260
- // const errors = [];
4261
-
4262
- // if (errors.length > 0) {
4263
- // return {
4264
- // [path]: errors,
4265
- // } as ValidationErrors;
4266
- // }
4589
+ if (errors.length > 0) {
4590
+ return _defineProperty({}, path, errors);
4591
+ }
4267
4592
  return false;
4268
4593
  }
4269
4594
  }, {
@@ -4303,19 +4628,29 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
4303
4628
  value: function from(_from) {
4304
4629
  return new DateSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
4305
4630
  from: _from
4306
- }), this.opt);
4631
+ }), this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description);
4307
4632
  }
4308
4633
  }, {
4309
4634
  key: "to",
4310
4635
  value: function to(_to) {
4311
4636
  return new DateSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
4312
4637
  to: _to
4313
- }), this.opt);
4638
+ }), this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description);
4314
4639
  }
4315
4640
  }, {
4316
4641
  key: "nullable",
4317
4642
  value: function nullable() {
4318
- return new DateSchema(this.options, true);
4643
+ return new DateSchema(this.options, true, [], this.isReadonly, this.isHidden, this.description);
4644
+ }
4645
+ }, {
4646
+ key: "readonly",
4647
+ value: function readonly() {
4648
+ return new DateSchema(this.options, this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
4649
+ }
4650
+ }, {
4651
+ key: "hidden",
4652
+ value: function hidden() {
4653
+ return new DateSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
4319
4654
  }
4320
4655
  }, {
4321
4656
  key: "executeSerialize",
@@ -4325,7 +4660,10 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
4325
4660
  type: "date",
4326
4661
  opt: this.opt,
4327
4662
  options: this.options,
4328
- customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0
4663
+ customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
4664
+ readonly: this.isReadonly,
4665
+ hidden: this.isHidden,
4666
+ description: this.description
4329
4667
  };
4330
4668
  }
4331
4669
  }, {
@@ -4339,6 +4677,203 @@ var date = function date(options) {
4339
4677
  return new DateSchema(options);
4340
4678
  };
4341
4679
 
4680
+ var DateTimeSchema = /*#__PURE__*/function (_Schema) {
4681
+ function DateTimeSchema(options) {
4682
+ var _this;
4683
+ var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4684
+ var customValidateFunctions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4685
+ var isReadonly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
4686
+ var isHidden = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
4687
+ var description = arguments.length > 5 ? arguments[5] : undefined;
4688
+ _classCallCheck(this, DateTimeSchema);
4689
+ _this = _callSuper(this, DateTimeSchema);
4690
+ _this.options = options;
4691
+ _this.opt = opt;
4692
+ _this.customValidateFunctions = customValidateFunctions;
4693
+ _this.isReadonly = isReadonly;
4694
+ _this.isHidden = isHidden;
4695
+ _this.description = description;
4696
+ return _this;
4697
+ }
4698
+ _inherits(DateTimeSchema, _Schema);
4699
+ return _createClass(DateTimeSchema, [{
4700
+ key: "describe",
4701
+ value: function describe(description) {
4702
+ return new DateTimeSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
4703
+ }
4704
+ }, {
4705
+ key: "validate",
4706
+ value: function validate(validationFunction) {
4707
+ return new DateTimeSchema(this.options, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description);
4708
+ }
4709
+ }, {
4710
+ key: "executeValidate",
4711
+ value: function executeValidate(path, src) {
4712
+ var _this$options, _this$options2;
4713
+ var errors = this.executeCustomValidateFunctions(src, this.customValidateFunctions, {
4714
+ path: path
4715
+ });
4716
+ if (this.opt && (src === null || src === undefined)) {
4717
+ return errors.length > 0 ? _defineProperty({}, path, errors) : false;
4718
+ }
4719
+ if (typeof src !== "string") {
4720
+ errors.push({
4721
+ message: "Expected 'string', got '".concat(_typeof(src), "'"),
4722
+ value: src
4723
+ });
4724
+ return _defineProperty({}, path, errors);
4725
+ }
4726
+ var srcMs = Date.parse(src);
4727
+ if (Number.isNaN(srcMs)) {
4728
+ errors.push({
4729
+ message: "Value '".concat(src, "' is not a valid ISO 8601 datetime"),
4730
+ value: src
4731
+ });
4732
+ return _defineProperty({}, path, errors);
4733
+ }
4734
+ var fromMs = ((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.from) !== undefined ? Date.parse(this.options.from) : undefined;
4735
+ var toMs = ((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.to) !== undefined ? Date.parse(this.options.to) : undefined;
4736
+ if (fromMs !== undefined && Number.isNaN(fromMs)) {
4737
+ var _this$options3;
4738
+ errors.push({
4739
+ message: "From datetime '".concat((_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.from, "' is not a valid ISO 8601 datetime"),
4740
+ value: src,
4741
+ typeError: true
4742
+ });
4743
+ return _defineProperty({}, path, errors);
4744
+ }
4745
+ if (toMs !== undefined && Number.isNaN(toMs)) {
4746
+ var _this$options4;
4747
+ errors.push({
4748
+ message: "To datetime '".concat((_this$options4 = this.options) === null || _this$options4 === void 0 ? void 0 : _this$options4.to, "' is not a valid ISO 8601 datetime"),
4749
+ value: src,
4750
+ typeError: true
4751
+ });
4752
+ return _defineProperty({}, path, errors);
4753
+ }
4754
+ if (fromMs !== undefined && toMs !== undefined) {
4755
+ if (fromMs > toMs) {
4756
+ var _this$options5, _this$options6;
4757
+ errors.push({
4758
+ message: "From datetime ".concat((_this$options5 = this.options) === null || _this$options5 === void 0 ? void 0 : _this$options5.from, " is after to datetime ").concat((_this$options6 = this.options) === null || _this$options6 === void 0 ? void 0 : _this$options6.to),
4759
+ value: src,
4760
+ typeError: true
4761
+ });
4762
+ } else if (srcMs < fromMs || srcMs > toMs) {
4763
+ var _this$options7, _this$options8;
4764
+ errors.push({
4765
+ message: "Datetime is not between ".concat((_this$options7 = this.options) === null || _this$options7 === void 0 ? void 0 : _this$options7.from, " and ").concat((_this$options8 = this.options) === null || _this$options8 === void 0 ? void 0 : _this$options8.to),
4766
+ value: src
4767
+ });
4768
+ }
4769
+ } else if (fromMs !== undefined) {
4770
+ if (srcMs < fromMs) {
4771
+ var _this$options9;
4772
+ errors.push({
4773
+ message: "Datetime is before the minimum datetime ".concat((_this$options9 = this.options) === null || _this$options9 === void 0 ? void 0 : _this$options9.from),
4774
+ value: src
4775
+ });
4776
+ }
4777
+ } else if (toMs !== undefined) {
4778
+ if (srcMs > toMs) {
4779
+ var _this$options0;
4780
+ errors.push({
4781
+ message: "Datetime is after the maximum datetime ".concat((_this$options0 = this.options) === null || _this$options0 === void 0 ? void 0 : _this$options0.to),
4782
+ value: src
4783
+ });
4784
+ }
4785
+ }
4786
+ if (errors.length > 0) {
4787
+ return _defineProperty({}, path, errors);
4788
+ }
4789
+ return false;
4790
+ }
4791
+ }, {
4792
+ key: "executeAssert",
4793
+ value: function executeAssert(path, src) {
4794
+ if (this.opt && src === null) {
4795
+ return {
4796
+ success: true,
4797
+ data: src
4798
+ };
4799
+ }
4800
+ if (src === null) {
4801
+ return {
4802
+ success: false,
4803
+ errors: _defineProperty({}, path, [{
4804
+ message: "Expected 'string', got 'null'",
4805
+ typeError: true
4806
+ }])
4807
+ };
4808
+ }
4809
+ if (typeof src !== "string") {
4810
+ return {
4811
+ success: false,
4812
+ errors: _defineProperty({}, path, [{
4813
+ message: "Expected 'string', got '".concat(_typeof(src), "'"),
4814
+ typeError: true
4815
+ }])
4816
+ };
4817
+ }
4818
+ return {
4819
+ success: true,
4820
+ data: src
4821
+ };
4822
+ }
4823
+ }, {
4824
+ key: "from",
4825
+ value: function from(_from) {
4826
+ return new DateTimeSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
4827
+ from: _from
4828
+ }), this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description);
4829
+ }
4830
+ }, {
4831
+ key: "to",
4832
+ value: function to(_to) {
4833
+ return new DateTimeSchema(_objectSpread2(_objectSpread2({}, this.options), {}, {
4834
+ to: _to
4835
+ }), this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description);
4836
+ }
4837
+ }, {
4838
+ key: "nullable",
4839
+ value: function nullable() {
4840
+ return new DateTimeSchema(this.options, true, [], this.isReadonly, this.isHidden, this.description);
4841
+ }
4842
+ }, {
4843
+ key: "readonly",
4844
+ value: function readonly() {
4845
+ return new DateTimeSchema(this.options, this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
4846
+ }
4847
+ }, {
4848
+ key: "hidden",
4849
+ value: function hidden() {
4850
+ return new DateTimeSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
4851
+ }
4852
+ }, {
4853
+ key: "executeSerialize",
4854
+ value: function executeSerialize() {
4855
+ var _this$customValidateF;
4856
+ return {
4857
+ type: "dateTime",
4858
+ opt: this.opt,
4859
+ options: this.options,
4860
+ customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
4861
+ readonly: this.isReadonly,
4862
+ hidden: this.isHidden,
4863
+ description: this.description
4864
+ };
4865
+ }
4866
+ }, {
4867
+ key: "executeRender",
4868
+ value: function executeRender() {
4869
+ return {};
4870
+ }
4871
+ }]);
4872
+ }(Schema);
4873
+ var datetime = function datetime(options) {
4874
+ return new DateTimeSchema(options);
4875
+ };
4876
+
4342
4877
  function router(router, item) {
4343
4878
  var keySchema = string();
4344
4879
  var recordSchema = new RecordSchema(item, false, [], router, keySchema);
@@ -4423,6 +4958,7 @@ function initSchema() {
4423
4958
  file: file,
4424
4959
  files: files,
4425
4960
  date: date,
4961
+ datetime: datetime,
4426
4962
  route: route,
4427
4963
  router: router,
4428
4964
  images: images
@@ -5806,28 +6342,38 @@ function getFileHash(text) {
5806
6342
  }
5807
6343
 
5808
6344
  function deserializeSchema(serialized) {
6345
+ var schema = deserializeSchemaImpl(serialized);
6346
+ if (serialized.readonly) {
6347
+ schema = schema.readonly();
6348
+ }
6349
+ if (serialized.hidden) {
6350
+ schema = schema.hidden();
6351
+ }
6352
+ return schema;
6353
+ }
6354
+ function deserializeSchemaImpl(serialized) {
5809
6355
  var _serialized$options, _serialized$options2, _serialized$accept, _serialized$directory, _serialized$remote;
5810
6356
  switch (serialized.type) {
5811
6357
  case "string":
5812
6358
  return new StringSchema(_objectSpread2(_objectSpread2({}, serialized.options), {}, {
5813
6359
  regexp: ((_serialized$options = serialized.options) === null || _serialized$options === void 0 ? void 0 : _serialized$options.regexp) && new RegExp(serialized.options.regexp.source, serialized.options.regexp.flags),
5814
6360
  regExpMessage: (_serialized$options2 = serialized.options) === null || _serialized$options2 === void 0 || (_serialized$options2 = _serialized$options2.regexp) === null || _serialized$options2 === void 0 ? void 0 : _serialized$options2.message
5815
- }), serialized.opt, serialized.raw);
6361
+ }), serialized.opt, serialized.raw, [], null, false, false, serialized.description);
5816
6362
  case "literal":
5817
- return new LiteralSchema(serialized.value, serialized.opt);
6363
+ return new LiteralSchema(serialized.value, serialized.opt, [], false, false, serialized.description);
5818
6364
  case "boolean":
5819
- return new BooleanSchema(serialized.opt);
6365
+ return new BooleanSchema(serialized.opt, [], false, false, serialized.description);
5820
6366
  case "number":
5821
- return new NumberSchema(serialized.options, serialized.opt);
6367
+ return new NumberSchema(serialized.options, serialized.opt, [], false, false, serialized.description);
5822
6368
  case "object":
5823
6369
  return new ObjectSchema(Object.fromEntries(Object.entries(serialized.items).map(function (_ref) {
5824
6370
  var _ref2 = _slicedToArray(_ref, 2),
5825
6371
  key = _ref2[0],
5826
6372
  item = _ref2[1];
5827
6373
  return [key, deserializeSchema(item)];
5828
- })), serialized.opt);
6374
+ })), serialized.opt, [], false, false, serialized.description);
5829
6375
  case "array":
5830
- return new ArraySchema(deserializeSchema(serialized.item), serialized.opt);
6376
+ return new ArraySchema(deserializeSchema(serialized.item), serialized.opt, [], false, false, serialized.description);
5831
6377
  case "union":
5832
6378
  return new UnionSchema(typeof serialized.key === "string" ? serialized.key :
5833
6379
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -5836,7 +6382,7 @@ function deserializeSchema(serialized) {
5836
6382
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5837
6383
  serialized.items.map(deserializeSchema),
5838
6384
  // TODO: we do not really need any here - right?
5839
- serialized.opt);
6385
+ serialized.opt, [], false, false, serialized.description);
5840
6386
  case "richtext":
5841
6387
  {
5842
6388
  var _serialized$options3, _serialized$options4, _serialized$options5, _serialized$options6, _serialized$options7, _serialized$options8, _serialized$options9;
@@ -5846,7 +6392,7 @@ function deserializeSchema(serialized) {
5846
6392
  img: _typeof((_serialized$options7 = serialized.options) === null || _serialized$options7 === void 0 || (_serialized$options7 = _serialized$options7.inline) === null || _serialized$options7 === void 0 ? void 0 : _serialized$options7.img) === "object" ? deserializeSchema(serialized.options.inline.img) : (_serialized$options8 = serialized.options) === null || _serialized$options8 === void 0 || (_serialized$options8 = _serialized$options8.inline) === null || _serialized$options8 === void 0 ? void 0 : _serialized$options8.img
5847
6393
  } : (_serialized$options9 = serialized.options) === null || _serialized$options9 === void 0 ? void 0 : _serialized$options9.inline
5848
6394
  });
5849
- return new RichTextSchema(deserializedOptions, serialized.opt);
6395
+ return new RichTextSchema(deserializedOptions, serialized.opt, [], false, false, serialized.description);
5850
6396
  }
5851
6397
  case "record":
5852
6398
  return new RecordSchema(deserializeSchema(serialized.item), serialized.opt, [], null, serialized.key ? deserializeSchema(serialized.key) : null, serialized.mediaType ? {
@@ -5855,23 +6401,25 @@ function deserializeSchema(serialized) {
5855
6401
  directory: (_serialized$directory = serialized.directory) !== null && _serialized$directory !== void 0 ? _serialized$directory : "/public/val",
5856
6402
  remote: (_serialized$remote = serialized.remote) !== null && _serialized$remote !== void 0 ? _serialized$remote : false,
5857
6403
  altSchema: serialized.alt ? deserializeSchema(serialized.alt) : undefined
5858
- } : undefined);
6404
+ } : undefined, false, false, serialized.description);
5859
6405
  case "keyOf":
5860
- return new KeyOfSchema(serialized.schema, serialized.path, serialized.opt);
6406
+ return new KeyOfSchema(serialized.schema, serialized.path, serialized.opt, [], false, false, serialized.description);
5861
6407
  case "route":
5862
6408
  {
5863
6409
  var routeOptions = serialized.options ? {
5864
6410
  include: serialized.options.include ? new RegExp(serialized.options.include.source, serialized.options.include.flags) : undefined,
5865
6411
  exclude: serialized.options.exclude ? new RegExp(serialized.options.exclude.source, serialized.options.exclude.flags) : undefined
5866
6412
  } : undefined;
5867
- return new RouteSchema(routeOptions, serialized.opt);
6413
+ return new RouteSchema(routeOptions, serialized.opt, [], false, false, serialized.description);
5868
6414
  }
5869
6415
  case "file":
5870
- return new FileSchema(serialized.options, serialized.opt, serialized.remote);
6416
+ return new FileSchema(serialized.options, serialized.opt, serialized.remote, [], {}, false, false, serialized.description);
5871
6417
  case "image":
5872
- return new ImageSchema(serialized.options, serialized.opt, serialized.remote);
6418
+ return new ImageSchema(serialized.options, serialized.opt, serialized.remote, [], {}, false, false, serialized.description);
5873
6419
  case "date":
5874
- return new DateSchema(serialized.options, serialized.opt);
6420
+ return new DateSchema(serialized.options, serialized.opt, [], false, false, serialized.description);
6421
+ case "dateTime":
6422
+ return new DateTimeSchema(serialized.options, serialized.opt, [], false, false, serialized.description);
5875
6423
  default:
5876
6424
  {
5877
6425
  var exhaustiveCheck = serialized;
@@ -6235,4 +6783,4 @@ function tryJsonParse(str) {
6235
6783
  }
6236
6784
  }
6237
6785
 
6238
- export { ArraySchema as A, BooleanSchema as B, DEFAULT_CONTENT_HOST as D, FATAL_ERROR_TYPES as F, GenericSelector as G, Internal as I, KeyOfSchema as K, LiteralSchema as L, ModuleFilePathSep as M, NumberSchema as N, ObjectSchema as O, PatchError as P, RecordSchema as R, Schema as S, UnionSchema as U, VAL_EXTENSION as V, _typeof as _, _slicedToArray as a, _createClass as b, _classCallCheck as c, _toConsumableArray as d, DEFAULT_APP_HOST as e, DEFAULT_VAL_REMOTE_HOST as f, FILE_REF_PROP as g, FILE_REF_SUBTYPE_TAG as h, initVal as i, derefPatch as j, StringSchema as k, ImageSchema as l, modules as m, FileSchema as n, DateSchema as o, RouteSchema as p, RichTextSchema as q, deserializeSchema as r, splitModuleFilePathAndModulePath as s, getSourcePathFromRoute as t };
6786
+ export { ArraySchema as A, BooleanSchema as B, DEFAULT_CONTENT_HOST as D, FATAL_ERROR_TYPES as F, GenericSelector as G, Internal as I, KeyOfSchema as K, LiteralSchema as L, ModuleFilePathSep as M, NumberSchema as N, ObjectSchema as O, PatchError as P, RecordSchema as R, Schema as S, UnionSchema as U, VAL_EXTENSION as V, _typeof as _, _slicedToArray as a, _createClass as b, _classCallCheck as c, _toConsumableArray as d, DEFAULT_APP_HOST as e, DEFAULT_VAL_REMOTE_HOST as f, FILE_REF_PROP as g, FILE_REF_SUBTYPE_TAG as h, initVal as i, derefPatch as j, StringSchema as k, ImageSchema as l, modules as m, FileSchema as n, DateSchema as o, DateTimeSchema as p, RouteSchema as q, RichTextSchema as r, splitModuleFilePathAndModulePath as s, deserializeSchema as t, getSourcePathFromRoute as u };