@takeshape/schema 8.145.1 → 8.150.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 (125) hide show
  1. package/dist/builtin-schema.d.ts.map +1 -1
  2. package/dist/builtin-schema.js +17 -0
  3. package/dist/get-is-leaf.d.ts +1 -1
  4. package/dist/get-is-leaf.d.ts.map +1 -1
  5. package/dist/get-is-leaf.js +3 -1
  6. package/dist/migration/index.d.ts +1 -0
  7. package/dist/migration/index.d.ts.map +1 -1
  8. package/dist/migration/index.js +4 -1
  9. package/dist/migration/to/v3.0.0.d.ts.map +1 -1
  10. package/dist/migration/to/v3.18.0.d.ts +5 -0
  11. package/dist/migration/to/v3.18.0.d.ts.map +1 -0
  12. package/dist/migration/to/v3.18.0.js +85 -0
  13. package/dist/mocks.d.ts.map +1 -1
  14. package/dist/mocks.js +4 -2
  15. package/dist/project-schema/index.d.ts +4 -1
  16. package/dist/project-schema/index.d.ts.map +1 -1
  17. package/dist/project-schema/index.js +20 -3
  18. package/dist/project-schema/latest.d.ts +4 -139
  19. package/dist/project-schema/latest.d.ts.map +1 -1
  20. package/dist/project-schema/migrate.d.ts.map +1 -1
  21. package/dist/project-schema/migrate.js +4 -0
  22. package/dist/project-schema/v3.18.0.d.ts +1334 -0
  23. package/dist/project-schema/v3.18.0.d.ts.map +1 -0
  24. package/dist/project-schema/v3.18.0.js +5 -0
  25. package/dist/refs.d.ts +14 -2
  26. package/dist/refs.d.ts.map +1 -1
  27. package/dist/refs.js +26 -0
  28. package/dist/relationships.d.ts +28 -2
  29. package/dist/relationships.d.ts.map +1 -1
  30. package/dist/relationships.js +234 -19
  31. package/dist/rewrite.d.ts.map +1 -1
  32. package/dist/rewrite.js +10 -2
  33. package/dist/schema-util.d.ts +1 -18
  34. package/dist/schema-util.d.ts.map +1 -1
  35. package/dist/schema-util.js +36 -120
  36. package/dist/schemas/index.d.ts +2 -2
  37. package/dist/schemas/index.d.ts.map +1 -1
  38. package/dist/schemas/index.js +6 -4
  39. package/dist/schemas/index.ts +4 -2
  40. package/dist/schemas/project-schema/latest.json +2175 -2195
  41. package/dist/schemas/project-schema/v3.18.0.json +2350 -0
  42. package/dist/schemas/project-schema.json +3 -0
  43. package/dist/template-shapes/templates.d.ts +5 -0
  44. package/dist/template-shapes/templates.d.ts.map +1 -1
  45. package/dist/template-shapes/templates.js +59 -28
  46. package/dist/template-shapes/where.d.ts +3 -4
  47. package/dist/template-shapes/where.d.ts.map +1 -1
  48. package/dist/template-shapes/where.js +32 -26
  49. package/dist/types/types.d.ts +42 -2
  50. package/dist/types/types.d.ts.map +1 -1
  51. package/dist/types/utils.d.ts +2 -0
  52. package/dist/types/utils.d.ts.map +1 -1
  53. package/dist/types/utils.js +9 -1
  54. package/dist/unions.d.ts.map +1 -1
  55. package/dist/unions.js +3 -1
  56. package/dist/util/detect-cycles.d.ts +3 -1
  57. package/dist/util/detect-cycles.d.ts.map +1 -1
  58. package/dist/util/detect-cycles.js +37 -28
  59. package/dist/util/form-config.d.ts +9 -0
  60. package/dist/util/form-config.d.ts.map +1 -0
  61. package/dist/util/form-config.js +97 -0
  62. package/dist/util/index.d.ts +1 -0
  63. package/dist/util/index.d.ts.map +1 -1
  64. package/dist/util/index.js +13 -0
  65. package/dist/validate.d.ts.map +1 -1
  66. package/dist/validate.js +75 -45
  67. package/es/builtin-schema.js +17 -0
  68. package/es/get-is-leaf.js +2 -1
  69. package/es/migration/index.js +3 -1
  70. package/es/migration/to/v3.18.0.js +72 -0
  71. package/es/mocks.js +4 -2
  72. package/es/project-schema/index.js +3 -1
  73. package/es/project-schema/migrate.js +5 -1
  74. package/es/project-schema/v3.18.0.js +1 -0
  75. package/es/refs.js +22 -1
  76. package/es/relationships.js +215 -19
  77. package/es/rewrite.js +10 -2
  78. package/es/schema-util.js +38 -119
  79. package/es/schemas/index.js +4 -3
  80. package/es/schemas/index.ts +4 -2
  81. package/es/schemas/project-schema/latest.json +2175 -2195
  82. package/es/schemas/project-schema/v3.18.0.json +2350 -0
  83. package/es/schemas/project-schema.json +3 -0
  84. package/es/template-shapes/templates.js +55 -29
  85. package/es/template-shapes/where.js +29 -23
  86. package/es/types/utils.js +8 -2
  87. package/es/unions.js +2 -1
  88. package/es/util/detect-cycles.js +36 -28
  89. package/es/util/form-config.js +85 -0
  90. package/es/util/index.js +2 -1
  91. package/es/validate.js +74 -46
  92. package/examples/latest/betzino.json +12383 -6066
  93. package/examples/latest/blog-schema.json +46 -25
  94. package/examples/latest/brewery-schema.json +14 -9
  95. package/examples/latest/complex-project-schema.json +442 -244
  96. package/examples/latest/complex-schema.json +17205 -0
  97. package/examples/latest/fabric-ecommerce.json +2 -2
  98. package/examples/latest/frank-and-fred-schema.json +5141 -2391
  99. package/examples/latest/klirr-schema.json +35445 -0
  100. package/examples/latest/massive-schema.json +1205 -640
  101. package/examples/latest/mill-components-schema.json +241 -113
  102. package/examples/latest/one-earth.json +14429 -0
  103. package/examples/latest/pet-oneof-array.json +2 -2
  104. package/examples/latest/post-schema.json +18 -11
  105. package/examples/latest/pruned-shopify-product-schema.json +2 -2
  106. package/examples/latest/real-world-schema.json +81 -41
  107. package/examples/latest/recursive-repeater-schema.json +14 -9
  108. package/examples/latest/recursive-schema.json +14 -9
  109. package/examples/latest/rick-and-morty-ast.json +138 -80
  110. package/examples/latest/rick-and-morty-graphql.json +78 -45
  111. package/examples/latest/rick-and-morty-rest.json +2 -2
  112. package/examples/latest/schema-with-repeater-draftjs.json +38 -23
  113. package/examples/latest/shape-books-v3_2_0.json +138 -80
  114. package/examples/latest/shape-books.json +138 -80
  115. package/examples/latest/shopify-lookbook.json +30 -16
  116. package/examples/latest/shopify-namespace-schema.json +364 -0
  117. package/examples/latest/shopify-store-with-widget.json +2 -2
  118. package/examples/latest/stripe-starter-resolved.json +14 -8
  119. package/examples/latest/user-schema-no-required.json +2 -2
  120. package/examples/latest/user-schema-with-defaults.json +2 -2
  121. package/examples/source/complex-schema.json +12760 -0
  122. package/examples/source/klirr-schema.json +27716 -0
  123. package/examples/source/one-earth.json +11897 -0
  124. package/examples/source/post-schema.json +0 -1
  125. package/package.json +5 -4
@@ -689,15 +689,20 @@
689
689
  "featureImage": {
690
690
  "title": "Feature Image",
691
691
  "@mapping": "takeshape:local:Post.BybUznPIW",
692
- "$ref": "#/shapes/TSRelationship/schema",
693
- "@relationship": {
694
- "shapeIds": [
695
- "ASSET"
696
- ],
697
- "type": "single"
698
- },
699
692
  "@backreference": {
700
693
  "enabled": true
694
+ },
695
+ "@ref": "local:Asset",
696
+ "@input": {
697
+ "@ref": "local:TSRelationship"
698
+ },
699
+ "@args": "TSRelationshipArgs",
700
+ "@resolver": {
701
+ "name": "takeshape:getRelated",
702
+ "service": "takeshape:local",
703
+ "options": {
704
+ "nullable": true
705
+ }
701
706
  }
702
707
  },
703
708
  "title": {
@@ -709,15 +714,20 @@
709
714
  "author": {
710
715
  "title": "Author",
711
716
  "@mapping": "takeshape:local:Post.rJgad7TLZ",
712
- "$ref": "#/shapes/TSRelationship/schema",
713
- "@relationship": {
714
- "shapeIds": [
715
- "SJDIicDUZ"
716
- ],
717
- "type": "single"
718
- },
719
717
  "@backreference": {
720
718
  "enabled": true
719
+ },
720
+ "@ref": "local:Author",
721
+ "@input": {
722
+ "@ref": "local:TSRelationship"
723
+ },
724
+ "@args": "TSRelationshipArgs",
725
+ "@resolver": {
726
+ "name": "takeshape:getRelated",
727
+ "service": "takeshape:local",
728
+ "options": {
729
+ "nullable": true
730
+ }
721
731
  }
722
732
  },
723
733
  "deck": {
@@ -729,18 +739,26 @@
729
739
  "tags": {
730
740
  "title": "Tags",
731
741
  "@mapping": "takeshape:local:Post.Hkb57EkOQ",
732
- "type": "array",
733
742
  "items": {
734
- "$ref": "#/shapes/TSRelationship/schema"
735
- },
736
- "@relationship": {
737
- "shapeIds": [
738
- "rJBYXVyuQ"
739
- ],
740
- "type": "multiple"
743
+ "@ref": "local:Tag"
741
744
  },
742
745
  "@backreference": {
743
746
  "enabled": true
747
+ },
748
+ "type": "array",
749
+ "@input": {
750
+ "type": "array",
751
+ "items": {
752
+ "@ref": "local:TSRelationship"
753
+ }
754
+ },
755
+ "@args": "TSRelationshipArgs",
756
+ "@resolver": {
757
+ "name": "takeshape:getRelated",
758
+ "service": "takeshape:local",
759
+ "options": {
760
+ "nullable": true
761
+ }
744
762
  }
745
763
  }
746
764
  },
@@ -769,15 +787,20 @@
769
787
  "photo": {
770
788
  "title": "Photo",
771
789
  "@mapping": "takeshape:local:Author.BkyFrpUcb",
772
- "$ref": "#/shapes/TSRelationship/schema",
773
- "@relationship": {
774
- "shapeIds": [
775
- "ASSET"
776
- ],
777
- "type": "single"
778
- },
779
790
  "@backreference": {
780
791
  "enabled": true
792
+ },
793
+ "@ref": "local:Asset",
794
+ "@input": {
795
+ "@ref": "local:TSRelationship"
796
+ },
797
+ "@args": "TSRelationshipArgs",
798
+ "@resolver": {
799
+ "name": "takeshape:getRelated",
800
+ "service": "takeshape:local",
801
+ "options": {
802
+ "nullable": true
803
+ }
781
804
  }
782
805
  },
783
806
  "biography": {
@@ -813,15 +836,20 @@
813
836
  "featuredBook": {
814
837
  "title": "Featured Book",
815
838
  "@mapping": "takeshape:local:Homepage.r1xPx1OUW",
816
- "$ref": "#/shapes/TSRelationship/schema",
817
- "@relationship": {
818
- "shapeIds": [
819
- "r166qcP8Z"
820
- ],
821
- "type": "single"
822
- },
823
839
  "@backreference": {
824
840
  "enabled": true
841
+ },
842
+ "@ref": "local:Book",
843
+ "@input": {
844
+ "@ref": "local:TSRelationship"
845
+ },
846
+ "@args": "TSRelationshipArgs",
847
+ "@resolver": {
848
+ "name": "takeshape:getRelated",
849
+ "service": "takeshape:local",
850
+ "options": {
851
+ "nullable": true
852
+ }
825
853
  }
826
854
  },
827
855
  "hero": {
@@ -842,30 +870,40 @@
842
870
  "image": {
843
871
  "title": "Image",
844
872
  "@mapping": "takeshape:local:HomepageHero.H1vBnAv8-",
845
- "$ref": "#/shapes/TSRelationship/schema",
846
- "@relationship": {
847
- "shapeIds": [
848
- "ASSET"
849
- ],
850
- "type": "single"
851
- },
852
873
  "@backreference": {
853
874
  "enabled": true
875
+ },
876
+ "@ref": "local:Asset",
877
+ "@input": {
878
+ "@ref": "local:TSRelationship"
879
+ },
880
+ "@args": "TSRelationshipArgs",
881
+ "@resolver": {
882
+ "name": "takeshape:getRelated",
883
+ "service": "takeshape:local",
884
+ "options": {
885
+ "nullable": true
886
+ }
854
887
  }
855
888
  },
856
889
  "featuredPost": {
857
890
  "title": "Featured Post",
858
891
  "@mapping": "takeshape:local:HomepageHero.SJ1Xo0v8b",
859
- "$ref": "#/shapes/TSRelationship/schema",
860
- "@relationship": {
861
- "shapeIds": [
862
- "rJoobhv8W"
863
- ],
864
- "type": "single"
865
- },
866
892
  "@backreference": {
867
893
  "enabled": true,
868
894
  "name": "heroFeaturedPost"
895
+ },
896
+ "@ref": "local:Post",
897
+ "@input": {
898
+ "@ref": "local:TSRelationship"
899
+ },
900
+ "@args": "TSRelationshipArgs",
901
+ "@resolver": {
902
+ "name": "takeshape:getRelated",
903
+ "service": "takeshape:local",
904
+ "options": {
905
+ "nullable": true
906
+ }
869
907
  }
870
908
  }
871
909
  }
@@ -941,15 +979,20 @@
941
979
  "authorTag": {
942
980
  "title": "Author Tag",
943
981
  "@mapping": "takeshape:local:Asset.SyQiZrgdX",
944
- "$ref": "#/shapes/TSRelationship/schema",
945
- "@relationship": {
946
- "shapeIds": [
947
- "SJDIicDUZ"
948
- ],
949
- "type": "single"
950
- },
951
982
  "@backreference": {
952
983
  "enabled": true
984
+ },
985
+ "@ref": "local:Author",
986
+ "@input": {
987
+ "@ref": "local:TSRelationship"
988
+ },
989
+ "@args": "TSRelationshipArgs",
990
+ "@resolver": {
991
+ "name": "takeshape:getRelated",
992
+ "service": "takeshape:local",
993
+ "options": {
994
+ "nullable": true
995
+ }
953
996
  }
954
997
  },
955
998
  "credit": {
@@ -978,45 +1021,60 @@
978
1021
  "author": {
979
1022
  "title": "Author",
980
1023
  "@mapping": "takeshape:local:Book.BJ7Xn5vLW",
981
- "$ref": "#/shapes/TSRelationship/schema",
982
- "@relationship": {
983
- "shapeIds": [
984
- "SJDIicDUZ"
985
- ],
986
- "type": "single"
987
- },
988
1024
  "@backreference": {
989
1025
  "enabled": true,
990
1026
  "name": "authored"
1027
+ },
1028
+ "@ref": "local:Author",
1029
+ "@input": {
1030
+ "@ref": "local:TSRelationship"
1031
+ },
1032
+ "@args": "TSRelationshipArgs",
1033
+ "@resolver": {
1034
+ "name": "takeshape:getRelated",
1035
+ "service": "takeshape:local",
1036
+ "options": {
1037
+ "nullable": true
1038
+ }
991
1039
  }
992
1040
  },
993
1041
  "coverImage": {
994
1042
  "title": "Cover Image",
995
1043
  "@mapping": "takeshape:local:Book.SymsKiD8W",
996
- "$ref": "#/shapes/TSRelationship/schema",
997
- "@relationship": {
998
- "shapeIds": [
999
- "ASSET"
1000
- ],
1001
- "type": "single"
1002
- },
1003
1044
  "@backreference": {
1004
1045
  "enabled": true
1046
+ },
1047
+ "@ref": "local:Asset",
1048
+ "@input": {
1049
+ "@ref": "local:TSRelationship"
1050
+ },
1051
+ "@args": "TSRelationshipArgs",
1052
+ "@resolver": {
1053
+ "name": "takeshape:getRelated",
1054
+ "service": "takeshape:local",
1055
+ "options": {
1056
+ "nullable": true
1057
+ }
1005
1058
  }
1006
1059
  },
1007
1060
  "genre": {
1008
1061
  "title": "Genre",
1009
1062
  "@mapping": "takeshape:local:Book.B1E4ZMkW7",
1010
- "$ref": "#/shapes/TSRelationship/schema",
1011
- "@relationship": {
1012
- "shapeIds": [
1013
- "rJ9bZzk-m"
1014
- ],
1015
- "type": "single"
1016
- },
1017
1063
  "@backreference": {
1018
1064
  "enabled": true,
1019
1065
  "name": "books"
1066
+ },
1067
+ "@ref": "local:Genre",
1068
+ "@input": {
1069
+ "@ref": "local:TSRelationship"
1070
+ },
1071
+ "@args": "TSRelationshipArgs",
1072
+ "@resolver": {
1073
+ "name": "takeshape:getRelated",
1074
+ "service": "takeshape:local",
1075
+ "options": {
1076
+ "nullable": true
1077
+ }
1020
1078
  }
1021
1079
  },
1022
1080
  "publishDate": {
@@ -1070,6 +1128,6 @@
1070
1128
  }
1071
1129
  }
1072
1130
  },
1073
- "schemaVersion": "3.17.1",
1131
+ "schemaVersion": "3.18.0",
1074
1132
  "services": {}
1075
- }
1133
+ }
@@ -1076,16 +1076,22 @@
1076
1076
  },
1077
1077
  "photo": {
1078
1078
  "description": "",
1079
- "$ref": "#/shapes/TSRelationship/schema",
1080
- "@relationship": {
1081
- "shapeIds": [
1082
- "ASSET"
1083
- ]
1084
- },
1085
1079
  "title": "Photo",
1086
1080
  "@mapping": "takeshape:local:Look.4WzSq3aHx",
1087
1081
  "@backreference": {
1088
1082
  "enabled": true
1083
+ },
1084
+ "@ref": "local:Asset",
1085
+ "@input": {
1086
+ "@ref": "local:TSRelationship"
1087
+ },
1088
+ "@args": "TSRelationshipArgs",
1089
+ "@resolver": {
1090
+ "name": "takeshape:getRelated",
1091
+ "service": "takeshape:local",
1092
+ "options": {
1093
+ "nullable": true
1094
+ }
1089
1095
  }
1090
1096
  },
1091
1097
  "text": {
@@ -1097,21 +1103,29 @@
1097
1103
  },
1098
1104
  "products": {
1099
1105
  "description": "",
1100
- "type": "array",
1101
1106
  "items": {
1102
- "$ref": "#/shapes/TSRelationship/schema"
1103
- },
1104
- "@relationship": {
1105
- "shapeIds": [
1106
- "0DeHE3eJn"
1107
- ],
1108
- "type": "multiple"
1107
+ "@ref": "local:Product"
1109
1108
  },
1110
1109
  "title": "Products",
1111
1110
  "@mapping": "takeshape:local:Look.dGVaGVDct",
1112
1111
  "@backreference": {
1113
1112
  "enabled": true,
1114
1113
  "name": "looks"
1114
+ },
1115
+ "type": "array",
1116
+ "@input": {
1117
+ "type": "array",
1118
+ "items": {
1119
+ "@ref": "local:TSRelationship"
1120
+ }
1121
+ },
1122
+ "@args": "TSRelationshipArgs",
1123
+ "@resolver": {
1124
+ "name": "takeshape:getRelated",
1125
+ "service": "takeshape:local",
1126
+ "options": {
1127
+ "nullable": true
1128
+ }
1115
1129
  }
1116
1130
  }
1117
1131
  },
@@ -1182,5 +1196,5 @@
1182
1196
  }
1183
1197
  }
1184
1198
  },
1185
- "schemaVersion": "3.17.1"
1186
- }
1199
+ "schemaVersion": "3.18.0"
1200
+ }