@takeshape/schema 8.87.2 → 8.89.2

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 (73) hide show
  1. package/es/builtin-schema.js +23 -0
  2. package/es/migration/index.js +3 -1
  3. package/es/migration/to/v3.17.0.js +27 -0
  4. package/es/project-schema/index.js +3 -1
  5. package/es/project-schema/migrate.js +5 -1
  6. package/es/project-schema/v3.17.0.js +1 -0
  7. package/es/schema-util.js +29 -17
  8. package/es/schemas/index.js +4 -3
  9. package/es/schemas/index.ts +4 -2
  10. package/es/schemas/project-schema/latest.json +7 -8
  11. package/es/schemas/project-schema/v3.17.0.json +2358 -0
  12. package/es/schemas/project-schema.json +3 -0
  13. package/es/template-shapes/where.js +1 -1
  14. package/es/validate.js +12 -8
  15. package/examples/latest/betzino.json +1393 -349
  16. package/examples/latest/blog-schema.json +1 -1
  17. package/examples/latest/brewery-schema.json +1 -1
  18. package/examples/latest/complex-project-schema.json +1 -1
  19. package/examples/latest/fabric-ecommerce.json +1 -1
  20. package/examples/latest/frank-and-fred-schema.json +1 -1
  21. package/examples/latest/massive-schema.json +1 -1
  22. package/examples/latest/mill-components-schema.json +1 -1
  23. package/examples/latest/pet-oneof-array.json +1 -1
  24. package/examples/latest/post-schema.json +1 -1
  25. package/examples/latest/pruned-shopify-product-schema.json +1 -1
  26. package/examples/latest/real-world-schema.json +1 -1
  27. package/examples/latest/recursive-repeater-schema.json +1 -1
  28. package/examples/latest/recursive-schema.json +1 -1
  29. package/examples/latest/rick-and-morty-ast.json +145 -37
  30. package/examples/latest/rick-and-morty-graphql.json +113 -29
  31. package/examples/latest/rick-and-morty-rest.json +1 -1
  32. package/examples/latest/schema-with-repeater-draftjs.json +1 -1
  33. package/examples/latest/shape-books-v3_2_0.json +1 -1
  34. package/examples/latest/shape-books.json +1 -1
  35. package/examples/latest/shopify-lookbook.json +1 -1
  36. package/examples/latest/shopify-store-with-widget.json +81 -21
  37. package/examples/latest/stripe-starter-resolved.json +49 -13
  38. package/examples/latest/user-schema-no-required.json +1 -1
  39. package/examples/latest/user-schema-with-defaults.json +1 -1
  40. package/lib/builtin-schema.d.ts.map +1 -1
  41. package/lib/builtin-schema.js +23 -0
  42. package/lib/migration/index.d.ts +1 -0
  43. package/lib/migration/index.d.ts.map +1 -1
  44. package/lib/migration/index.js +4 -1
  45. package/lib/migration/to/v3.17.0.d.ts +5 -0
  46. package/lib/migration/to/v3.17.0.d.ts.map +1 -0
  47. package/lib/migration/to/v3.17.0.js +40 -0
  48. package/lib/project-schema/index.d.ts +4 -1
  49. package/lib/project-schema/index.d.ts.map +1 -1
  50. package/lib/project-schema/index.js +20 -3
  51. package/lib/project-schema/latest.d.ts +2 -5
  52. package/lib/project-schema/latest.d.ts.map +1 -1
  53. package/lib/project-schema/migrate.d.ts.map +1 -1
  54. package/lib/project-schema/migrate.js +4 -0
  55. package/lib/project-schema/v3.17.0.d.ts +1456 -0
  56. package/lib/project-schema/v3.17.0.d.ts.map +1 -0
  57. package/lib/project-schema/v3.17.0.js +5 -0
  58. package/lib/schema-util.d.ts.map +1 -1
  59. package/lib/schema-util.js +29 -17
  60. package/lib/schemas/index.d.ts +2301 -2
  61. package/lib/schemas/index.d.ts.map +1 -1
  62. package/lib/schemas/index.js +6 -4
  63. package/lib/schemas/index.ts +4 -2
  64. package/lib/schemas/project-schema/latest.json +7 -8
  65. package/lib/schemas/project-schema/v3.17.0.json +2358 -0
  66. package/lib/schemas/project-schema.json +3 -0
  67. package/lib/template-shapes/where.d.ts.map +1 -1
  68. package/lib/template-shapes/where.js +1 -1
  69. package/lib/types/types.d.ts +2 -2
  70. package/lib/types/types.d.ts.map +1 -1
  71. package/lib/validate.d.ts.map +1 -1
  72. package/lib/validate.js +12 -8
  73. package/package.json +4 -4
@@ -69,6 +69,9 @@
69
69
  {
70
70
  "$ref": "https://schema.takeshape.io/project-schema/v3.16.0#"
71
71
  },
72
+ {
73
+ "$ref": "https://schema.takeshape.io/project-schema/v3.17.0#"
74
+ },
72
75
  {
73
76
  "$ref": "https://schema.takeshape.io/project-schema/v4.0.0#"
74
77
  }
@@ -281,7 +281,7 @@ function getTypeName(name, prop, shapeName, context) {
281
281
  }
282
282
 
283
283
  function skipField(name, prop, projectSchema, exceededRelationshipDepth) {
284
- return Boolean(prop['@user'] || prop['@sensitive'] || prop['@resolver'] || prop['@relationship'] && exceededRelationshipDepth || (name === '_enabled' || name === '_enabledAt') && workflowsEnabled(projectSchema.apiVersion));
284
+ return Boolean(prop['@sensitive'] || prop['@resolver'] || prop['@relationship'] && exceededRelationshipDepth || (name === '_enabled' || name === '_enabledAt') && workflowsEnabled(projectSchema.apiVersion));
285
285
  }
286
286
 
287
287
  export function getFields(typeName, shapes, context) {
package/es/validate.js CHANGED
@@ -193,7 +193,7 @@ function validateResolver(projectSchema, basePath, resolver) {
193
193
  }
194
194
 
195
195
  if (resolver.name.startsWith('takeshape')) {
196
- var _options, _indexedShapes;
196
+ var _options;
197
197
 
198
198
  let shapeName;
199
199
 
@@ -205,14 +205,18 @@ function validateResolver(projectSchema, basePath, resolver) {
205
205
  shapeName = resolver.shapeName;
206
206
  }
207
207
 
208
- const modelShape = shapeName ? projectSchema.shapes[shapeName] : undefined;
208
+ if (shapeName) {
209
+ var _indexedShapes;
209
210
 
210
- if (!(modelShape !== null && modelShape !== void 0 && modelShape.model) && !(shapeName && (_indexedShapes = projectSchema.indexedShapes) !== null && _indexedShapes !== void 0 && _indexedShapes[shapeName])) {
211
- errors.push({
212
- type: 'notFound',
213
- path: basePath.concat(['options', 'model']),
214
- message: `Invalid Model Shape "${shapeName ?? ''}"`
215
- });
211
+ const modelShape = projectSchema.shapes[shapeName];
212
+
213
+ if (!(modelShape !== null && modelShape !== void 0 && modelShape.model) && !(shapeName && (_indexedShapes = projectSchema.indexedShapes) !== null && _indexedShapes !== void 0 && _indexedShapes[shapeName])) {
214
+ errors.push({
215
+ type: 'notFound',
216
+ path: basePath.concat(['options', 'model']),
217
+ message: `Invalid Model Shape "${shapeName ?? ''}"`
218
+ });
219
+ }
216
220
  }
217
221
  }
218
222
  } else {