@contentful/experiences-validators 1.42.0-prerelease-20250630T1135-a8b68d4.0 → 1.42.1-beta.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/index.d.ts CHANGED
@@ -719,232 +719,148 @@ declare const ComponentSettingsSchema: z.ZodObject<{
719
719
  }>>;
720
720
  thumbnailId: z.ZodOptional<z.ZodEnum<["columns", "columnsPlusRight", "imagesSquare", "subtitles", "rowsPlusBottom", "userRectangle", "textbox", "monitorPlay", "article", "table", "star", "heartStraight", "frameCorners", "rows", "dotsThreeOutline", "listDashes", "checkerBoard", "gridFour", "slideshow", "diamondsFour", "cards", "textColumns", "duplex"]>>;
721
721
  category: z.ZodOptional<z.ZodString>;
722
- prebindingDefinitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
723
- id: z.ZodString;
724
- variableMappings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
725
- parameterId: z.ZodString;
726
- type: z.ZodLiteral<"ContentTypeMapping">;
727
- pathsByContentType: z.ZodRecord<z.ZodString, z.ZodObject<{
728
- path: z.ZodString;
729
- }, "strip", z.ZodTypeAny, {
730
- path: string;
731
- }, {
732
- path: string;
733
- }>>;
722
+ variableMappings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
723
+ parameterId: z.ZodString;
724
+ type: z.ZodLiteral<"ContentTypeMapping">;
725
+ pathsByContentType: z.ZodRecord<z.ZodString, z.ZodObject<{
726
+ path: z.ZodString;
734
727
  }, "strip", z.ZodTypeAny, {
735
- type: "ContentTypeMapping";
736
- parameterId: string;
737
- pathsByContentType: Record<string, {
738
- path: string;
739
- }>;
728
+ path: string;
740
729
  }, {
741
- type: "ContentTypeMapping";
742
- parameterId: string;
743
- pathsByContentType: Record<string, {
744
- path: string;
745
- }>;
746
- }>>>;
747
- parameterDefinitions: z.ZodRecord<z.ZodString, z.ZodObject<{
748
- defaultSource: z.ZodOptional<z.ZodObject<{
749
- type: z.ZodEnum<["Entry"]>;
750
- contentTypeId: z.ZodString;
751
- link: z.ZodObject<{
752
- sys: z.ZodObject<{
753
- type: z.ZodLiteral<"Link">;
754
- id: z.ZodString;
755
- linkType: z.ZodEnum<["Entry"]>;
756
- }, "strict", z.ZodTypeAny, {
757
- type: "Link";
758
- id: string;
759
- linkType: "Entry";
760
- }, {
761
- type: "Link";
762
- id: string;
763
- linkType: "Entry";
764
- }>;
765
- }, "strict", z.ZodTypeAny, {
766
- sys: {
767
- type: "Link";
768
- id: string;
769
- linkType: "Entry";
770
- };
771
- }, {
772
- sys: {
773
- type: "Link";
774
- id: string;
775
- linkType: "Entry";
776
- };
777
- }>;
778
- }, "strict", z.ZodTypeAny, {
779
- type: "Entry";
780
- contentTypeId: string;
781
- link: {
782
- sys: {
783
- type: "Link";
784
- id: string;
785
- linkType: "Entry";
786
- };
787
- };
788
- }, {
789
- type: "Entry";
790
- contentTypeId: string;
791
- link: {
792
- sys: {
793
- type: "Link";
794
- id: string;
795
- linkType: "Entry";
796
- };
797
- };
798
- }>>;
799
- contentTypes: z.ZodRecord<z.ZodString, z.ZodObject<{
730
+ path: string;
731
+ }>>;
732
+ }, "strip", z.ZodTypeAny, {
733
+ type: "ContentTypeMapping";
734
+ parameterId: string;
735
+ pathsByContentType: Record<string, {
736
+ path: string;
737
+ }>;
738
+ }, {
739
+ type: "ContentTypeMapping";
740
+ parameterId: string;
741
+ pathsByContentType: Record<string, {
742
+ path: string;
743
+ }>;
744
+ }>>>;
745
+ parameterDefinitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
746
+ defaultSource: z.ZodOptional<z.ZodObject<{
747
+ type: z.ZodEnum<["Entry"]>;
748
+ contentTypeId: z.ZodString;
749
+ link: z.ZodObject<{
800
750
  sys: z.ZodObject<{
801
751
  type: z.ZodLiteral<"Link">;
802
752
  id: z.ZodString;
803
- linkType: z.ZodEnum<["ContentType"]>;
804
- }, "strip", z.ZodTypeAny, {
753
+ linkType: z.ZodEnum<["Entry"]>;
754
+ }, "strict", z.ZodTypeAny, {
805
755
  type: "Link";
806
756
  id: string;
807
- linkType: "ContentType";
757
+ linkType: "Entry";
808
758
  }, {
809
759
  type: "Link";
810
760
  id: string;
811
- linkType: "ContentType";
761
+ linkType: "Entry";
812
762
  }>;
813
- }, "strip", z.ZodTypeAny, {
763
+ }, "strict", z.ZodTypeAny, {
814
764
  sys: {
815
765
  type: "Link";
816
766
  id: string;
817
- linkType: "ContentType";
767
+ linkType: "Entry";
818
768
  };
819
769
  }, {
820
770
  sys: {
821
771
  type: "Link";
822
772
  id: string;
823
- linkType: "ContentType";
773
+ linkType: "Entry";
824
774
  };
825
- }>>;
826
- }, "strip", z.ZodTypeAny, {
827
- contentTypes: Record<string, {
775
+ }>;
776
+ }, "strict", z.ZodTypeAny, {
777
+ type: "Entry";
778
+ contentTypeId: string;
779
+ link: {
828
780
  sys: {
829
781
  type: "Link";
830
782
  id: string;
831
- linkType: "ContentType";
783
+ linkType: "Entry";
832
784
  };
833
- }>;
834
- defaultSource?: {
835
- type: "Entry";
836
- contentTypeId: string;
837
- link: {
838
- sys: {
839
- type: "Link";
840
- id: string;
841
- linkType: "Entry";
842
- };
843
- };
844
- } | undefined;
785
+ };
845
786
  }, {
846
- contentTypes: Record<string, {
787
+ type: "Entry";
788
+ contentTypeId: string;
789
+ link: {
847
790
  sys: {
848
791
  type: "Link";
849
792
  id: string;
850
- linkType: "ContentType";
851
- };
852
- }>;
853
- defaultSource?: {
854
- type: "Entry";
855
- contentTypeId: string;
856
- link: {
857
- sys: {
858
- type: "Link";
859
- id: string;
860
- linkType: "Entry";
861
- };
793
+ linkType: "Entry";
862
794
  };
863
- } | undefined;
795
+ };
864
796
  }>>;
865
- passToNodes: z.ZodOptional<z.ZodArray<z.ZodObject<{
866
- nodeId: z.ZodString;
867
- parameterId: z.ZodString;
868
- prebindingId: z.ZodString;
869
- }, "strict", z.ZodTypeAny, {
870
- parameterId: string;
871
- nodeId: string;
872
- prebindingId: string;
797
+ contentTypes: z.ZodRecord<z.ZodString, z.ZodObject<{
798
+ sys: z.ZodObject<{
799
+ type: z.ZodLiteral<"Link">;
800
+ id: z.ZodString;
801
+ linkType: z.ZodEnum<["ContentType"]>;
802
+ }, "strip", z.ZodTypeAny, {
803
+ type: "Link";
804
+ id: string;
805
+ linkType: "ContentType";
806
+ }, {
807
+ type: "Link";
808
+ id: string;
809
+ linkType: "ContentType";
810
+ }>;
811
+ }, "strip", z.ZodTypeAny, {
812
+ sys: {
813
+ type: "Link";
814
+ id: string;
815
+ linkType: "ContentType";
816
+ };
873
817
  }, {
874
- parameterId: string;
875
- nodeId: string;
876
- prebindingId: string;
877
- }>, "many">>;
878
- }, "strict", z.ZodTypeAny, {
879
- id: string;
880
- parameterDefinitions: Record<string, {
881
- contentTypes: Record<string, {
818
+ sys: {
819
+ type: "Link";
820
+ id: string;
821
+ linkType: "ContentType";
822
+ };
823
+ }>>;
824
+ }, "strip", z.ZodTypeAny, {
825
+ contentTypes: Record<string, {
826
+ sys: {
827
+ type: "Link";
828
+ id: string;
829
+ linkType: "ContentType";
830
+ };
831
+ }>;
832
+ defaultSource?: {
833
+ type: "Entry";
834
+ contentTypeId: string;
835
+ link: {
882
836
  sys: {
883
837
  type: "Link";
884
838
  id: string;
885
- linkType: "ContentType";
886
- };
887
- }>;
888
- defaultSource?: {
889
- type: "Entry";
890
- contentTypeId: string;
891
- link: {
892
- sys: {
893
- type: "Link";
894
- id: string;
895
- linkType: "Entry";
896
- };
839
+ linkType: "Entry";
897
840
  };
898
- } | undefined;
899
- }>;
900
- variableMappings?: Record<string, {
901
- type: "ContentTypeMapping";
902
- parameterId: string;
903
- pathsByContentType: Record<string, {
904
- path: string;
905
- }>;
906
- }> | undefined;
907
- passToNodes?: {
908
- parameterId: string;
909
- nodeId: string;
910
- prebindingId: string;
911
- }[] | undefined;
841
+ };
842
+ } | undefined;
912
843
  }, {
913
- id: string;
914
- parameterDefinitions: Record<string, {
915
- contentTypes: Record<string, {
844
+ contentTypes: Record<string, {
845
+ sys: {
846
+ type: "Link";
847
+ id: string;
848
+ linkType: "ContentType";
849
+ };
850
+ }>;
851
+ defaultSource?: {
852
+ type: "Entry";
853
+ contentTypeId: string;
854
+ link: {
916
855
  sys: {
917
856
  type: "Link";
918
857
  id: string;
919
- linkType: "ContentType";
920
- };
921
- }>;
922
- defaultSource?: {
923
- type: "Entry";
924
- contentTypeId: string;
925
- link: {
926
- sys: {
927
- type: "Link";
928
- id: string;
929
- linkType: "Entry";
930
- };
858
+ linkType: "Entry";
931
859
  };
932
- } | undefined;
933
- }>;
934
- variableMappings?: Record<string, {
935
- type: "ContentTypeMapping";
936
- parameterId: string;
937
- pathsByContentType: Record<string, {
938
- path: string;
939
- }>;
940
- }> | undefined;
941
- passToNodes?: {
942
- parameterId: string;
943
- nodeId: string;
944
- prebindingId: string;
945
- }[] | undefined;
946
- }>, "many">>;
947
- }, "strict", z.ZodTypeAny, {
860
+ };
861
+ } | undefined;
862
+ }>>>;
863
+ }, "strip", z.ZodTypeAny, {
948
864
  variableDefinitions: Record<string, {
949
865
  type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
950
866
  displayName?: string | undefined;
@@ -981,41 +897,33 @@ declare const ComponentSettingsSchema: z.ZodObject<{
981
897
  }>;
982
898
  thumbnailId?: "columns" | "columnsPlusRight" | "imagesSquare" | "subtitles" | "rowsPlusBottom" | "userRectangle" | "textbox" | "monitorPlay" | "article" | "table" | "star" | "heartStraight" | "frameCorners" | "rows" | "dotsThreeOutline" | "listDashes" | "checkerBoard" | "gridFour" | "slideshow" | "diamondsFour" | "cards" | "textColumns" | "duplex" | undefined;
983
899
  category?: string | undefined;
984
- prebindingDefinitions?: {
985
- id: string;
986
- parameterDefinitions: Record<string, {
987
- contentTypes: Record<string, {
900
+ variableMappings?: Record<string, {
901
+ type: "ContentTypeMapping";
902
+ parameterId: string;
903
+ pathsByContentType: Record<string, {
904
+ path: string;
905
+ }>;
906
+ }> | undefined;
907
+ parameterDefinitions?: Record<string, {
908
+ contentTypes: Record<string, {
909
+ sys: {
910
+ type: "Link";
911
+ id: string;
912
+ linkType: "ContentType";
913
+ };
914
+ }>;
915
+ defaultSource?: {
916
+ type: "Entry";
917
+ contentTypeId: string;
918
+ link: {
988
919
  sys: {
989
920
  type: "Link";
990
921
  id: string;
991
- linkType: "ContentType";
992
- };
993
- }>;
994
- defaultSource?: {
995
- type: "Entry";
996
- contentTypeId: string;
997
- link: {
998
- sys: {
999
- type: "Link";
1000
- id: string;
1001
- linkType: "Entry";
1002
- };
922
+ linkType: "Entry";
1003
923
  };
1004
- } | undefined;
1005
- }>;
1006
- variableMappings?: Record<string, {
1007
- type: "ContentTypeMapping";
1008
- parameterId: string;
1009
- pathsByContentType: Record<string, {
1010
- path: string;
1011
- }>;
1012
- }> | undefined;
1013
- passToNodes?: {
1014
- parameterId: string;
1015
- nodeId: string;
1016
- prebindingId: string;
1017
- }[] | undefined;
1018
- }[] | undefined;
924
+ };
925
+ } | undefined;
926
+ }> | undefined;
1019
927
  }, {
1020
928
  variableDefinitions: Record<string, {
1021
929
  type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
@@ -1053,41 +961,33 @@ declare const ComponentSettingsSchema: z.ZodObject<{
1053
961
  }>;
1054
962
  thumbnailId?: "columns" | "columnsPlusRight" | "imagesSquare" | "subtitles" | "rowsPlusBottom" | "userRectangle" | "textbox" | "monitorPlay" | "article" | "table" | "star" | "heartStraight" | "frameCorners" | "rows" | "dotsThreeOutline" | "listDashes" | "checkerBoard" | "gridFour" | "slideshow" | "diamondsFour" | "cards" | "textColumns" | "duplex" | undefined;
1055
963
  category?: string | undefined;
1056
- prebindingDefinitions?: {
1057
- id: string;
1058
- parameterDefinitions: Record<string, {
1059
- contentTypes: Record<string, {
964
+ variableMappings?: Record<string, {
965
+ type: "ContentTypeMapping";
966
+ parameterId: string;
967
+ pathsByContentType: Record<string, {
968
+ path: string;
969
+ }>;
970
+ }> | undefined;
971
+ parameterDefinitions?: Record<string, {
972
+ contentTypes: Record<string, {
973
+ sys: {
974
+ type: "Link";
975
+ id: string;
976
+ linkType: "ContentType";
977
+ };
978
+ }>;
979
+ defaultSource?: {
980
+ type: "Entry";
981
+ contentTypeId: string;
982
+ link: {
1060
983
  sys: {
1061
984
  type: "Link";
1062
985
  id: string;
1063
- linkType: "ContentType";
986
+ linkType: "Entry";
1064
987
  };
1065
- }>;
1066
- defaultSource?: {
1067
- type: "Entry";
1068
- contentTypeId: string;
1069
- link: {
1070
- sys: {
1071
- type: "Link";
1072
- id: string;
1073
- linkType: "Entry";
1074
- };
1075
- };
1076
- } | undefined;
1077
- }>;
1078
- variableMappings?: Record<string, {
1079
- type: "ContentTypeMapping";
1080
- parameterId: string;
1081
- pathsByContentType: Record<string, {
1082
- path: string;
1083
- }>;
1084
- }> | undefined;
1085
- passToNodes?: {
1086
- parameterId: string;
1087
- nodeId: string;
1088
- prebindingId: string;
1089
- }[] | undefined;
1090
- }[] | undefined;
988
+ };
989
+ } | undefined;
990
+ }> | undefined;
1091
991
  }>;
1092
992
  declare const PatternFieldsCMAShapeSchema: z.ZodObject<{
1093
993
  componentTree: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
package/dist/index.js CHANGED
@@ -270,29 +270,13 @@ const ParameterDefinitionsSchema = z.record(propertyKeySchema, ParameterDefiniti
270
270
  const VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);
271
271
  const ComponentVariablesSchema = z.record(z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/), // Here the key is <variableName>_<nanoidId> so we need to allow for a longer length
272
272
  ComponentVariableSchema);
273
- const PassToNodeSchema = z
274
- .object({
275
- nodeId: propertyKeySchema,
276
- parameterId: propertyKeySchema,
277
- prebindingId: propertyKeySchema,
278
- })
279
- .strict();
280
- const PrebindingDefinitionSchema = z
281
- .object({
282
- id: propertyKeySchema,
283
- variableMappings: VariableMappingsSchema.optional(),
284
- parameterDefinitions: ParameterDefinitionsSchema,
285
- passToNodes: z.array(PassToNodeSchema).optional(),
286
- })
287
- .strict();
288
- const ComponentSettingsSchema = z
289
- .object({
273
+ const ComponentSettingsSchema = z.object({
290
274
  variableDefinitions: ComponentVariablesSchema,
291
275
  thumbnailId: z.enum(THUMBNAIL_IDS).optional(),
292
276
  category: z.string().max(50, 'Category must contain at most 50 characters').optional(),
293
- prebindingDefinitions: z.array(PrebindingDefinitionSchema).optional(),
294
- })
295
- .strict();
277
+ variableMappings: VariableMappingsSchema.optional(),
278
+ parameterDefinitions: ParameterDefinitionsSchema.optional(),
279
+ });
296
280
  const PatternFieldsCMAShapeSchema = z.object({
297
281
  componentTree: localeWrapper(ComponentTreeSchema),
298
282
  dataSource: localeWrapper(DataSourceSchema),