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