@cloudhal/core-contracts 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/generated/content-entry.d.ts +1 -1
- package/dist/src/generated/content-entry.js +1 -1
- package/dist/src/generated/index.d.ts +1 -1
- package/dist/src/generated/index.js +1 -1
- package/dist/src/generated/schemas.d.ts +778 -2
- package/dist/src/generated/schemas.js +480 -1
- package/dist/src/generated/site.d.ts +248 -0
- package/dist/src/generated/site.js +258 -0
- package/dist/src/generated/validators.js +3393 -1156
- package/package.json +1 -1
- package/schemas/content-entry.schema.json +1 -1
- package/schemas/site.schema.json +408 -0
|
@@ -625,6 +625,15 @@ export const SiteSchema = {
|
|
|
625
625
|
"oldest",
|
|
626
626
|
"title"
|
|
627
627
|
]
|
|
628
|
+
},
|
|
629
|
+
"fields": {
|
|
630
|
+
"type": "array",
|
|
631
|
+
"description": "RFC-0041: the collection's typed custom fields, in form order. Values live in ContentEntry.fields under each key. At most 200 per site and unique keys (checked in code).",
|
|
632
|
+
"minItems": 1,
|
|
633
|
+
"maxItems": 30,
|
|
634
|
+
"items": {
|
|
635
|
+
"$ref": "#/$defs/FieldDefinition"
|
|
636
|
+
}
|
|
628
637
|
}
|
|
629
638
|
}
|
|
630
639
|
},
|
|
@@ -681,6 +690,476 @@ export const SiteSchema = {
|
|
|
681
690
|
}
|
|
682
691
|
}
|
|
683
692
|
},
|
|
693
|
+
"FieldDefinition": {
|
|
694
|
+
"description": "RFC-0041: one typed custom field of a collection, discriminated by `type`.",
|
|
695
|
+
"oneOf": [
|
|
696
|
+
{
|
|
697
|
+
"title": "TextField",
|
|
698
|
+
"type": "object",
|
|
699
|
+
"description": "Plain text: a string of at most maxLength characters.",
|
|
700
|
+
"additionalProperties": false,
|
|
701
|
+
"required": [
|
|
702
|
+
"key",
|
|
703
|
+
"type",
|
|
704
|
+
"labels",
|
|
705
|
+
"localized"
|
|
706
|
+
],
|
|
707
|
+
"properties": {
|
|
708
|
+
"key": {
|
|
709
|
+
"$ref": "#/$defs/FieldKey"
|
|
710
|
+
},
|
|
711
|
+
"type": {
|
|
712
|
+
"type": "string",
|
|
713
|
+
"enum": [
|
|
714
|
+
"text"
|
|
715
|
+
]
|
|
716
|
+
},
|
|
717
|
+
"labels": {
|
|
718
|
+
"$ref": "#/$defs/FieldLabels"
|
|
719
|
+
},
|
|
720
|
+
"localized": {
|
|
721
|
+
"type": "boolean",
|
|
722
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
723
|
+
},
|
|
724
|
+
"requiredToPublish": {
|
|
725
|
+
"type": "boolean",
|
|
726
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
727
|
+
},
|
|
728
|
+
"migration": {
|
|
729
|
+
"$ref": "#/$defs/FieldMigration"
|
|
730
|
+
},
|
|
731
|
+
"maxLength": {
|
|
732
|
+
"type": "integer",
|
|
733
|
+
"description": "Absent: 5000.",
|
|
734
|
+
"minimum": 1,
|
|
735
|
+
"maximum": 5000
|
|
736
|
+
},
|
|
737
|
+
"multiline": {
|
|
738
|
+
"type": "boolean",
|
|
739
|
+
"description": "Line breaks allowed. Absent: false."
|
|
740
|
+
},
|
|
741
|
+
"searchable": {
|
|
742
|
+
"type": "boolean",
|
|
743
|
+
"description": "Its words go into site search. Absent: false."
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"title": "RichTextField",
|
|
749
|
+
"type": "object",
|
|
750
|
+
"description": "Cloudhal Markdown v1 (ADR-0028), at most 50 000 characters.",
|
|
751
|
+
"additionalProperties": false,
|
|
752
|
+
"required": [
|
|
753
|
+
"key",
|
|
754
|
+
"type",
|
|
755
|
+
"labels",
|
|
756
|
+
"localized"
|
|
757
|
+
],
|
|
758
|
+
"properties": {
|
|
759
|
+
"key": {
|
|
760
|
+
"$ref": "#/$defs/FieldKey"
|
|
761
|
+
},
|
|
762
|
+
"type": {
|
|
763
|
+
"type": "string",
|
|
764
|
+
"enum": [
|
|
765
|
+
"richText"
|
|
766
|
+
]
|
|
767
|
+
},
|
|
768
|
+
"labels": {
|
|
769
|
+
"$ref": "#/$defs/FieldLabels"
|
|
770
|
+
},
|
|
771
|
+
"localized": {
|
|
772
|
+
"type": "boolean",
|
|
773
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
774
|
+
},
|
|
775
|
+
"requiredToPublish": {
|
|
776
|
+
"type": "boolean",
|
|
777
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
778
|
+
},
|
|
779
|
+
"migration": {
|
|
780
|
+
"$ref": "#/$defs/FieldMigration"
|
|
781
|
+
},
|
|
782
|
+
"searchable": {
|
|
783
|
+
"type": "boolean",
|
|
784
|
+
"description": "Its words go into site search. Absent: false."
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
"title": "NumberField",
|
|
790
|
+
"type": "object",
|
|
791
|
+
"description": "A finite number.",
|
|
792
|
+
"additionalProperties": false,
|
|
793
|
+
"required": [
|
|
794
|
+
"key",
|
|
795
|
+
"type",
|
|
796
|
+
"labels",
|
|
797
|
+
"localized"
|
|
798
|
+
],
|
|
799
|
+
"properties": {
|
|
800
|
+
"key": {
|
|
801
|
+
"$ref": "#/$defs/FieldKey"
|
|
802
|
+
},
|
|
803
|
+
"type": {
|
|
804
|
+
"type": "string",
|
|
805
|
+
"enum": [
|
|
806
|
+
"number"
|
|
807
|
+
]
|
|
808
|
+
},
|
|
809
|
+
"labels": {
|
|
810
|
+
"$ref": "#/$defs/FieldLabels"
|
|
811
|
+
},
|
|
812
|
+
"localized": {
|
|
813
|
+
"type": "boolean",
|
|
814
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
815
|
+
},
|
|
816
|
+
"requiredToPublish": {
|
|
817
|
+
"type": "boolean",
|
|
818
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
819
|
+
},
|
|
820
|
+
"migration": {
|
|
821
|
+
"$ref": "#/$defs/FieldMigration"
|
|
822
|
+
},
|
|
823
|
+
"integer": {
|
|
824
|
+
"type": "boolean",
|
|
825
|
+
"description": "Whole numbers only. Absent: false."
|
|
826
|
+
},
|
|
827
|
+
"minimum": {
|
|
828
|
+
"type": "number"
|
|
829
|
+
},
|
|
830
|
+
"maximum": {
|
|
831
|
+
"type": "number"
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
"title": "BooleanField",
|
|
837
|
+
"type": "object",
|
|
838
|
+
"description": "true or false; absent reads as false, so it cannot be required to publish.",
|
|
839
|
+
"additionalProperties": false,
|
|
840
|
+
"required": [
|
|
841
|
+
"key",
|
|
842
|
+
"type",
|
|
843
|
+
"labels",
|
|
844
|
+
"localized"
|
|
845
|
+
],
|
|
846
|
+
"properties": {
|
|
847
|
+
"key": {
|
|
848
|
+
"$ref": "#/$defs/FieldKey"
|
|
849
|
+
},
|
|
850
|
+
"type": {
|
|
851
|
+
"type": "string",
|
|
852
|
+
"enum": [
|
|
853
|
+
"boolean"
|
|
854
|
+
]
|
|
855
|
+
},
|
|
856
|
+
"labels": {
|
|
857
|
+
"$ref": "#/$defs/FieldLabels"
|
|
858
|
+
},
|
|
859
|
+
"localized": {
|
|
860
|
+
"type": "boolean",
|
|
861
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
862
|
+
},
|
|
863
|
+
"migration": {
|
|
864
|
+
"$ref": "#/$defs/FieldMigration"
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"title": "DateField",
|
|
870
|
+
"type": "object",
|
|
871
|
+
"description": "A calendar day without a zone (YYYY-MM-DD).",
|
|
872
|
+
"additionalProperties": false,
|
|
873
|
+
"required": [
|
|
874
|
+
"key",
|
|
875
|
+
"type",
|
|
876
|
+
"labels",
|
|
877
|
+
"localized"
|
|
878
|
+
],
|
|
879
|
+
"properties": {
|
|
880
|
+
"key": {
|
|
881
|
+
"$ref": "#/$defs/FieldKey"
|
|
882
|
+
},
|
|
883
|
+
"type": {
|
|
884
|
+
"type": "string",
|
|
885
|
+
"enum": [
|
|
886
|
+
"date"
|
|
887
|
+
]
|
|
888
|
+
},
|
|
889
|
+
"labels": {
|
|
890
|
+
"$ref": "#/$defs/FieldLabels"
|
|
891
|
+
},
|
|
892
|
+
"localized": {
|
|
893
|
+
"type": "boolean",
|
|
894
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
895
|
+
},
|
|
896
|
+
"requiredToPublish": {
|
|
897
|
+
"type": "boolean",
|
|
898
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
899
|
+
},
|
|
900
|
+
"migration": {
|
|
901
|
+
"$ref": "#/$defs/FieldMigration"
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"title": "DateTimeField",
|
|
907
|
+
"type": "object",
|
|
908
|
+
"description": "An instant with the zone it was entered in: {at, timeZone} (RFC-0008 §9.1).",
|
|
909
|
+
"additionalProperties": false,
|
|
910
|
+
"required": [
|
|
911
|
+
"key",
|
|
912
|
+
"type",
|
|
913
|
+
"labels",
|
|
914
|
+
"localized"
|
|
915
|
+
],
|
|
916
|
+
"properties": {
|
|
917
|
+
"key": {
|
|
918
|
+
"$ref": "#/$defs/FieldKey"
|
|
919
|
+
},
|
|
920
|
+
"type": {
|
|
921
|
+
"type": "string",
|
|
922
|
+
"enum": [
|
|
923
|
+
"datetime"
|
|
924
|
+
]
|
|
925
|
+
},
|
|
926
|
+
"labels": {
|
|
927
|
+
"$ref": "#/$defs/FieldLabels"
|
|
928
|
+
},
|
|
929
|
+
"localized": {
|
|
930
|
+
"type": "boolean",
|
|
931
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
932
|
+
},
|
|
933
|
+
"requiredToPublish": {
|
|
934
|
+
"type": "boolean",
|
|
935
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
936
|
+
},
|
|
937
|
+
"migration": {
|
|
938
|
+
"$ref": "#/$defs/FieldMigration"
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
"title": "UrlField",
|
|
944
|
+
"type": "object",
|
|
945
|
+
"description": "A link: https, http, mailto, tel, a site-relative path or a #fragment; at most 2048 characters.",
|
|
946
|
+
"additionalProperties": false,
|
|
947
|
+
"required": [
|
|
948
|
+
"key",
|
|
949
|
+
"type",
|
|
950
|
+
"labels",
|
|
951
|
+
"localized"
|
|
952
|
+
],
|
|
953
|
+
"properties": {
|
|
954
|
+
"key": {
|
|
955
|
+
"$ref": "#/$defs/FieldKey"
|
|
956
|
+
},
|
|
957
|
+
"type": {
|
|
958
|
+
"type": "string",
|
|
959
|
+
"enum": [
|
|
960
|
+
"url"
|
|
961
|
+
]
|
|
962
|
+
},
|
|
963
|
+
"labels": {
|
|
964
|
+
"$ref": "#/$defs/FieldLabels"
|
|
965
|
+
},
|
|
966
|
+
"localized": {
|
|
967
|
+
"type": "boolean",
|
|
968
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
969
|
+
},
|
|
970
|
+
"requiredToPublish": {
|
|
971
|
+
"type": "boolean",
|
|
972
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
973
|
+
},
|
|
974
|
+
"migration": {
|
|
975
|
+
"$ref": "#/$defs/FieldMigration"
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
"title": "ImageField",
|
|
981
|
+
"type": "object",
|
|
982
|
+
"description": "An image Asset of the same site, by id (asset_…).",
|
|
983
|
+
"additionalProperties": false,
|
|
984
|
+
"required": [
|
|
985
|
+
"key",
|
|
986
|
+
"type",
|
|
987
|
+
"labels",
|
|
988
|
+
"localized"
|
|
989
|
+
],
|
|
990
|
+
"properties": {
|
|
991
|
+
"key": {
|
|
992
|
+
"$ref": "#/$defs/FieldKey"
|
|
993
|
+
},
|
|
994
|
+
"type": {
|
|
995
|
+
"type": "string",
|
|
996
|
+
"enum": [
|
|
997
|
+
"image"
|
|
998
|
+
]
|
|
999
|
+
},
|
|
1000
|
+
"labels": {
|
|
1001
|
+
"$ref": "#/$defs/FieldLabels"
|
|
1002
|
+
},
|
|
1003
|
+
"localized": {
|
|
1004
|
+
"type": "boolean",
|
|
1005
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
1006
|
+
},
|
|
1007
|
+
"requiredToPublish": {
|
|
1008
|
+
"type": "boolean",
|
|
1009
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
1010
|
+
},
|
|
1011
|
+
"migration": {
|
|
1012
|
+
"$ref": "#/$defs/FieldMigration"
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
"title": "SelectField",
|
|
1018
|
+
"type": "object",
|
|
1019
|
+
"description": "One of a closed list of options, or several when multiple.",
|
|
1020
|
+
"additionalProperties": false,
|
|
1021
|
+
"required": [
|
|
1022
|
+
"key",
|
|
1023
|
+
"type",
|
|
1024
|
+
"labels",
|
|
1025
|
+
"localized",
|
|
1026
|
+
"options"
|
|
1027
|
+
],
|
|
1028
|
+
"properties": {
|
|
1029
|
+
"key": {
|
|
1030
|
+
"$ref": "#/$defs/FieldKey"
|
|
1031
|
+
},
|
|
1032
|
+
"type": {
|
|
1033
|
+
"type": "string",
|
|
1034
|
+
"enum": [
|
|
1035
|
+
"select"
|
|
1036
|
+
]
|
|
1037
|
+
},
|
|
1038
|
+
"labels": {
|
|
1039
|
+
"$ref": "#/$defs/FieldLabels"
|
|
1040
|
+
},
|
|
1041
|
+
"localized": {
|
|
1042
|
+
"type": "boolean",
|
|
1043
|
+
"description": "true: each language version has its own value (missing reads the original's); false: only the translation group's original holds it."
|
|
1044
|
+
},
|
|
1045
|
+
"requiredToPublish": {
|
|
1046
|
+
"type": "boolean",
|
|
1047
|
+
"description": "An entry in review or published needs a value. Absent: false."
|
|
1048
|
+
},
|
|
1049
|
+
"migration": {
|
|
1050
|
+
"$ref": "#/$defs/FieldMigration"
|
|
1051
|
+
},
|
|
1052
|
+
"options": {
|
|
1053
|
+
"type": "array",
|
|
1054
|
+
"minItems": 1,
|
|
1055
|
+
"maxItems": 50,
|
|
1056
|
+
"items": {
|
|
1057
|
+
"$ref": "#/$defs/FieldOption"
|
|
1058
|
+
}
|
|
1059
|
+
},
|
|
1060
|
+
"multiple": {
|
|
1061
|
+
"type": "boolean",
|
|
1062
|
+
"description": "The value is a list of option values. Absent: false."
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
]
|
|
1067
|
+
},
|
|
1068
|
+
"FieldKey": {
|
|
1069
|
+
"type": "string",
|
|
1070
|
+
"description": "The field's key in ContentEntry.fields: lower camelCase, a JavaScript identifier. Unique in its collection; built-in entry property names are reserved (checked in code).",
|
|
1071
|
+
"pattern": "^[a-z][A-Za-z0-9]{0,39}$"
|
|
1072
|
+
},
|
|
1073
|
+
"FieldLabel": {
|
|
1074
|
+
"type": "object",
|
|
1075
|
+
"additionalProperties": false,
|
|
1076
|
+
"required": [
|
|
1077
|
+
"label"
|
|
1078
|
+
],
|
|
1079
|
+
"properties": {
|
|
1080
|
+
"label": {
|
|
1081
|
+
"type": "string",
|
|
1082
|
+
"minLength": 1,
|
|
1083
|
+
"maxLength": 100
|
|
1084
|
+
},
|
|
1085
|
+
"help": {
|
|
1086
|
+
"type": "string",
|
|
1087
|
+
"maxLength": 300
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
},
|
|
1091
|
+
"FieldLabels": {
|
|
1092
|
+
"type": "object",
|
|
1093
|
+
"description": "The field's label and help per locale. Missing a locale: the default locale's, then the key.",
|
|
1094
|
+
"propertyNames": {
|
|
1095
|
+
"$ref": "#/$defs/Locale"
|
|
1096
|
+
},
|
|
1097
|
+
"minProperties": 1,
|
|
1098
|
+
"additionalProperties": {
|
|
1099
|
+
"$ref": "#/$defs/FieldLabel"
|
|
1100
|
+
}
|
|
1101
|
+
},
|
|
1102
|
+
"FieldMigration": {
|
|
1103
|
+
"type": "object",
|
|
1104
|
+
"description": "RFC-0041 §6: present only while a field operation rewrites entries.",
|
|
1105
|
+
"additionalProperties": false,
|
|
1106
|
+
"required": [
|
|
1107
|
+
"id"
|
|
1108
|
+
],
|
|
1109
|
+
"properties": {
|
|
1110
|
+
"id": {
|
|
1111
|
+
"$ref": "#/$defs/Id",
|
|
1112
|
+
"description": "The operation's \"before\" snapshot."
|
|
1113
|
+
},
|
|
1114
|
+
"fromKey": {
|
|
1115
|
+
"$ref": "#/$defs/FieldKey"
|
|
1116
|
+
},
|
|
1117
|
+
"fromType": {
|
|
1118
|
+
"type": "string",
|
|
1119
|
+
"enum": [
|
|
1120
|
+
"text",
|
|
1121
|
+
"richText",
|
|
1122
|
+
"number",
|
|
1123
|
+
"boolean",
|
|
1124
|
+
"date",
|
|
1125
|
+
"datetime",
|
|
1126
|
+
"url",
|
|
1127
|
+
"image",
|
|
1128
|
+
"select"
|
|
1129
|
+
]
|
|
1130
|
+
},
|
|
1131
|
+
"fromLocalized": {
|
|
1132
|
+
"type": "boolean"
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
},
|
|
1136
|
+
"FieldOption": {
|
|
1137
|
+
"type": "object",
|
|
1138
|
+
"description": "One option of a select field. Values are unique in the field (checked in code).",
|
|
1139
|
+
"additionalProperties": false,
|
|
1140
|
+
"required": [
|
|
1141
|
+
"value",
|
|
1142
|
+
"labels"
|
|
1143
|
+
],
|
|
1144
|
+
"properties": {
|
|
1145
|
+
"value": {
|
|
1146
|
+
"$ref": "#/$defs/Slug",
|
|
1147
|
+
"description": "Stored in entries, never shown."
|
|
1148
|
+
},
|
|
1149
|
+
"labels": {
|
|
1150
|
+
"type": "object",
|
|
1151
|
+
"propertyNames": {
|
|
1152
|
+
"$ref": "#/$defs/Locale"
|
|
1153
|
+
},
|
|
1154
|
+
"minProperties": 1,
|
|
1155
|
+
"additionalProperties": {
|
|
1156
|
+
"type": "string",
|
|
1157
|
+
"minLength": 1,
|
|
1158
|
+
"maxLength": 100
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
},
|
|
684
1163
|
"FooterColumn": {
|
|
685
1164
|
"type": "object",
|
|
686
1165
|
"additionalProperties": false,
|
|
@@ -2468,7 +2947,7 @@ export const ContentEntrySchema = {
|
|
|
2468
2947
|
},
|
|
2469
2948
|
"fields": {
|
|
2470
2949
|
"type": "object",
|
|
2471
|
-
"description": "Collection-specific values; any JSON.",
|
|
2950
|
+
"description": "Collection-specific values, keyed by field. A collection with typed fields (RFC-0041, Site.collections.<key>.fields) checks each value against its definition on write; otherwise any JSON. An absent key means no value.",
|
|
2472
2951
|
"additionalProperties": true
|
|
2473
2952
|
},
|
|
2474
2953
|
"tags": {
|