@takeshape/schema 8.145.1 → 8.146.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
@@ -223,33 +223,46 @@
223
223
  "title": "Image",
224
224
  "@l10n": true,
225
225
  "@mapping": "takeshape:local:HomepageHero.imageId",
226
- "$ref": "#/shapes/TSRelationship/schema",
227
- "@relationship": {
228
- "shapeIds": [
229
- "ASSET"
230
- ],
231
- "type": "single"
232
- },
233
226
  "@backreference": {
234
227
  "enabled": true
228
+ },
229
+ "@ref": "local:Asset",
230
+ "@input": {
231
+ "@ref": "local:TSRelationship"
232
+ },
233
+ "@args": "TSRelationshipArgs",
234
+ "@resolver": {
235
+ "name": "takeshape:getRelated",
236
+ "service": "takeshape:local",
237
+ "options": {
238
+ "nullable": true
239
+ }
235
240
  }
236
241
  },
237
242
  "featuredPosts": {
238
243
  "@l10n": true,
239
244
  "@mapping": "takeshape:local:HomepageHero.featuredPostsId",
240
- "type": "array",
241
245
  "items": {
242
- "$ref": "#/shapes/TSRelationship/schema"
243
- },
244
- "@relationship": {
245
- "shapeIds": [
246
- "<postContentTypeId>"
247
- ],
248
- "type": "multiple"
246
+ "@ref": "local:Post"
249
247
  },
250
248
  "@backreference": {
251
249
  "enabled": true,
252
250
  "name": "heroFeaturedPosts"
251
+ },
252
+ "type": "array",
253
+ "@input": {
254
+ "type": "array",
255
+ "items": {
256
+ "@ref": "local:TSRelationship"
257
+ }
258
+ },
259
+ "@args": "TSRelationshipArgs",
260
+ "@resolver": {
261
+ "name": "takeshape:getRelated",
262
+ "service": "takeshape:local",
263
+ "options": {
264
+ "nullable": true
265
+ }
253
266
  }
254
267
  }
255
268
  }
@@ -286,19 +299,27 @@
286
299
  },
287
300
  "tags": {
288
301
  "@mapping": "takeshape:local:Post.tagsId",
289
- "type": "array",
290
302
  "items": {
291
- "$ref": "#/shapes/TSRelationship/schema"
292
- },
293
- "@relationship": {
294
- "shapeIds": [
295
- "<tagContentTypeId>"
296
- ],
297
- "type": "multiple"
303
+ "@ref": "local:Tag"
298
304
  },
299
305
  "@backreference": {
300
306
  "enabled": true,
301
307
  "name": "firstTags"
308
+ },
309
+ "type": "array",
310
+ "@input": {
311
+ "type": "array",
312
+ "items": {
313
+ "@ref": "local:TSRelationship"
314
+ }
315
+ },
316
+ "@args": "TSRelationshipArgs",
317
+ "@resolver": {
318
+ "name": "takeshape:getRelated",
319
+ "service": "takeshape:local",
320
+ "options": {
321
+ "nullable": true
322
+ }
302
323
  }
303
324
  }
304
325
  },
@@ -382,6 +403,6 @@
382
403
  }
383
404
  }
384
405
  },
385
- "schemaVersion": "3.17.1",
406
+ "schemaVersion": "3.18.0",
386
407
  "services": {}
387
- }
408
+ }
@@ -261,15 +261,20 @@
261
261
  "title": "Image",
262
262
  "description": "",
263
263
  "@mapping": "takeshape:local:BreweryAddresses.HkIsDL6ye",
264
- "$ref": "#/shapes/TSRelationship/schema",
265
- "@relationship": {
266
- "shapeIds": [
267
- "ASSET"
268
- ],
269
- "type": "single"
270
- },
271
264
  "@backreference": {
272
265
  "enabled": true
266
+ },
267
+ "@ref": "local:Asset",
268
+ "@input": {
269
+ "@ref": "local:TSRelationship"
270
+ },
271
+ "@args": "TSRelationshipArgs",
272
+ "@resolver": {
273
+ "name": "takeshape:getRelated",
274
+ "service": "takeshape:local",
275
+ "options": {
276
+ "nullable": true
277
+ }
273
278
  }
274
279
  },
275
280
  "zipCode": {
@@ -381,6 +386,6 @@
381
386
  }
382
387
  }
383
388
  },
384
- "schemaVersion": "3.17.1",
389
+ "schemaVersion": "3.18.0",
385
390
  "services": {}
386
- }
391
+ }