@takeshape/schema 8.274.0 → 8.278.3

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 (76) hide show
  1. package/dist/migration/index.d.ts +1 -0
  2. package/dist/migration/index.d.ts.map +1 -1
  3. package/dist/migration/index.js +4 -1
  4. package/dist/migration/to/v3.26.0.d.ts +5 -0
  5. package/dist/migration/to/v3.26.0.d.ts.map +1 -0
  6. package/dist/migration/to/v3.26.0.js +18 -0
  7. package/dist/project-schema/index.d.ts +4 -1
  8. package/dist/project-schema/index.d.ts.map +1 -1
  9. package/dist/project-schema/index.js +20 -3
  10. package/dist/project-schema/latest.d.ts +28 -3
  11. package/dist/project-schema/latest.d.ts.map +1 -1
  12. package/dist/project-schema/migrate.d.ts.map +1 -1
  13. package/dist/project-schema/migrate.js +4 -0
  14. package/dist/project-schema/v3.26.0.d.ts +1389 -0
  15. package/dist/project-schema/v3.26.0.d.ts.map +1 -0
  16. package/dist/project-schema/v3.26.0.js +5 -0
  17. package/dist/refs.d.ts +4 -0
  18. package/dist/refs.d.ts.map +1 -1
  19. package/dist/refs.js +23 -0
  20. package/dist/schemas/index.d.ts +2 -2
  21. package/dist/schemas/index.d.ts.map +1 -1
  22. package/dist/schemas/index.js +6 -4
  23. package/dist/schemas/index.ts +4 -2
  24. package/dist/schemas/project-schema/latest.json +57 -4
  25. package/dist/schemas/project-schema/v3.26.0.json +2956 -0
  26. package/dist/schemas/project-schema.json +3 -0
  27. package/dist/types/types.d.ts +3 -2
  28. package/dist/types/types.d.ts.map +1 -1
  29. package/dist/util/get-return-shape.d.ts +1 -1
  30. package/dist/util/get-return-shape.d.ts.map +1 -1
  31. package/dist/util/get-return-shape.js +3 -7
  32. package/dist/validate.js +1 -1
  33. package/es/migration/index.js +3 -1
  34. package/es/migration/to/v3.26.0.js +10 -0
  35. package/es/project-schema/index.js +3 -1
  36. package/es/project-schema/migrate.js +5 -1
  37. package/es/project-schema/v3.26.0.js +1 -0
  38. package/es/refs.js +20 -0
  39. package/es/schemas/index.js +4 -3
  40. package/es/schemas/index.ts +4 -2
  41. package/es/schemas/project-schema/latest.json +57 -4
  42. package/es/schemas/project-schema/v3.26.0.json +2956 -0
  43. package/es/schemas/project-schema.json +3 -0
  44. package/es/util/get-return-shape.js +3 -7
  45. package/es/validate.js +1 -1
  46. package/examples/latest/betzino.json +1 -1
  47. package/examples/latest/blog-schema.json +1 -1
  48. package/examples/latest/brewery-schema.json +1 -1
  49. package/examples/latest/complex-project-schema.json +1 -1
  50. package/examples/latest/complex-schema.json +1 -1
  51. package/examples/latest/fabric-ecommerce.json +1 -1
  52. package/examples/latest/frank-and-fred-schema.json +1 -1
  53. package/examples/latest/klirr-schema.json +1 -1
  54. package/examples/latest/massive-schema.json +1 -1
  55. package/examples/latest/mill-components-schema.json +1 -1
  56. package/examples/latest/one-earth.json +1 -1
  57. package/examples/latest/pet-oneof-array.json +1 -1
  58. package/examples/latest/post-schema.json +1 -1
  59. package/examples/latest/pruned-shopify-product-schema.json +1 -1
  60. package/examples/latest/real-world-schema.json +1 -1
  61. package/examples/latest/recursive-repeater-schema.json +1 -1
  62. package/examples/latest/recursive-schema.json +1 -1
  63. package/examples/latest/rick-and-morty-ast.json +1 -1
  64. package/examples/latest/rick-and-morty-graphql.json +1 -1
  65. package/examples/latest/rick-and-morty-rest.json +1 -1
  66. package/examples/latest/schema-with-repeater-draftjs.json +1 -1
  67. package/examples/latest/shape-books-v3_2_0.json +1 -1
  68. package/examples/latest/shape-books.json +1 -1
  69. package/examples/latest/shopify-lookbook.json +1 -1
  70. package/examples/latest/shopify-product-2022-07.json +1 -1
  71. package/examples/latest/shopify-store-with-widget.json +1 -1
  72. package/examples/latest/stripe-product-runtime-schema.json +1 -1
  73. package/examples/latest/stripe-starter-resolved.json +1 -1
  74. package/examples/latest/user-schema-no-required.json +1 -1
  75. package/examples/latest/user-schema-with-defaults.json +1 -1
  76. package/package.json +4 -4
@@ -105,6 +105,9 @@
105
105
  {
106
106
  "$ref": "https://schema.takeshape.io/project-schema/v3.25.0#"
107
107
  },
108
+ {
109
+ "$ref": "https://schema.takeshape.io/project-schema/v3.26.0#"
110
+ },
108
111
  {
109
112
  "$ref": "https://schema.takeshape.io/project-schema/v4.0.0#"
110
113
  }
@@ -20,10 +20,6 @@ function getReturnShapeHelper(projectSchema, propOrQuery) {
20
20
  }
21
21
  }
22
22
 
23
- if (!shape) {
24
- throw new Error(`Unable to find return shape for ${JSON.stringify(propOrQuery)}`);
25
- }
26
-
27
23
  return shape;
28
24
  }
29
25
 
@@ -31,10 +27,10 @@ const cache = new WeakMap();
31
27
  export function getReturnShape(projectSchema, propOrQuery) {
32
28
  let result = cache.get(propOrQuery);
33
29
 
34
- if (!result) {
30
+ if (result === undefined) {
35
31
  result = getReturnShapeHelper(projectSchema, propOrQuery);
36
- cache.set(propOrQuery, result);
32
+ cache.set(propOrQuery, result ?? null);
37
33
  }
38
34
 
39
- return result;
35
+ return result ?? undefined;
40
36
  }
package/es/validate.js CHANGED
@@ -398,7 +398,7 @@ function validateIndexedShapes(projectSchema) {
398
398
  return errors;
399
399
  }
400
400
 
401
- const builtInShapeNames = [...Object.keys(builtInShapes), ...scalars];
401
+ const builtInShapeNames = [...Object.keys(builtInShapes), ...scalars, 'object'];
402
402
 
403
403
  function getModelShapeIds(shapes) {
404
404
  return Object.values(shapes).filter(shape => shape.model).map(shape => shape.id);
@@ -52525,6 +52525,6 @@
52525
52525
  }
52526
52526
  }
52527
52527
  },
52528
- "schemaVersion": "3.25.0",
52528
+ "schemaVersion": "3.26.0",
52529
52529
  "services": {}
52530
52530
  }
@@ -399,6 +399,6 @@
399
399
  }
400
400
  }
401
401
  },
402
- "schemaVersion": "3.25.0",
402
+ "schemaVersion": "3.26.0",
403
403
  "services": {}
404
404
  }
@@ -382,6 +382,6 @@
382
382
  }
383
383
  }
384
384
  },
385
- "schemaVersion": "3.25.0",
385
+ "schemaVersion": "3.26.0",
386
386
  "services": {}
387
387
  }
@@ -4185,6 +4185,6 @@
4185
4185
  }
4186
4186
  }
4187
4187
  },
4188
- "schemaVersion": "3.25.0",
4188
+ "schemaVersion": "3.26.0",
4189
4189
  "services": {}
4190
4190
  }
@@ -15,7 +15,7 @@
15
15
  "apiVersion": "1",
16
16
  "queries": {},
17
17
  "mutations": {},
18
- "schemaVersion": "3.25.0",
18
+ "schemaVersion": "3.26.0",
19
19
  "shapes": {
20
20
  "DocumentUploadForm": {
21
21
  "id": "HJPFlRKkr",
@@ -10505,5 +10505,5 @@
10505
10505
  }
10506
10506
  }
10507
10507
  },
10508
- "schemaVersion": "3.25.0"
10508
+ "schemaVersion": "3.26.0"
10509
10509
  }
@@ -23251,6 +23251,6 @@
23251
23251
  }
23252
23252
  }
23253
23253
  },
23254
- "schemaVersion": "3.25.0",
23254
+ "schemaVersion": "3.26.0",
23255
23255
  "services": {}
23256
23256
  }
@@ -34786,6 +34786,6 @@
34786
34786
  }
34787
34787
  }
34788
34788
  },
34789
- "schemaVersion": "3.25.0",
34789
+ "schemaVersion": "3.26.0",
34790
34790
  "services": {}
34791
34791
  }
@@ -7837,6 +7837,6 @@
7837
7837
  }
7838
7838
  }
7839
7839
  },
7840
- "schemaVersion": "3.25.0",
7840
+ "schemaVersion": "3.26.0",
7841
7841
  "services": {}
7842
7842
  }
@@ -1884,6 +1884,6 @@
1884
1884
  }
1885
1885
  }
1886
1886
  },
1887
- "schemaVersion": "3.25.0",
1887
+ "schemaVersion": "3.26.0",
1888
1888
  "services": {}
1889
1889
  }
@@ -14216,6 +14216,6 @@
14216
14216
  }
14217
14217
  }
14218
14218
  },
14219
- "schemaVersion": "3.25.0",
14219
+ "schemaVersion": "3.26.0",
14220
14220
  "services": {}
14221
14221
  }
@@ -388,6 +388,6 @@
388
388
  }
389
389
  }
390
390
  },
391
- "schemaVersion": "3.25.0",
391
+ "schemaVersion": "3.26.0",
392
392
  "services": {}
393
393
  }
@@ -226,6 +226,6 @@
226
226
  }
227
227
  }
228
228
  },
229
- "schemaVersion": "3.25.0",
229
+ "schemaVersion": "3.26.0",
230
230
  "services": {}
231
231
  }
@@ -9756,5 +9756,5 @@
9756
9756
  }
9757
9757
  }
9758
9758
  },
9759
- "schemaVersion": "3.25.0"
9759
+ "schemaVersion": "3.26.0"
9760
9760
  }
@@ -1041,6 +1041,6 @@
1041
1041
  }
1042
1042
  }
1043
1043
  },
1044
- "schemaVersion": "3.25.0",
1044
+ "schemaVersion": "3.26.0",
1045
1045
  "services": {}
1046
1046
  }
@@ -142,6 +142,6 @@
142
142
  }
143
143
  }
144
144
  },
145
- "schemaVersion": "3.25.0",
145
+ "schemaVersion": "3.26.0",
146
146
  "services": {}
147
147
  }
@@ -149,6 +149,6 @@
149
149
  }
150
150
  }
151
151
  },
152
- "schemaVersion": "3.25.0",
152
+ "schemaVersion": "3.26.0",
153
153
  "services": {}
154
154
  }
@@ -2820,5 +2820,5 @@
2820
2820
  }
2821
2821
  }
2822
2822
  },
2823
- "schemaVersion": "3.25.0"
2823
+ "schemaVersion": "3.26.0"
2824
2824
  }
@@ -2292,5 +2292,5 @@
2292
2292
  }
2293
2293
  }
2294
2294
  },
2295
- "schemaVersion": "3.25.0"
2295
+ "schemaVersion": "3.26.0"
2296
2296
  }
@@ -91,5 +91,5 @@
91
91
  }
92
92
  }
93
93
  },
94
- "schemaVersion": "3.25.0"
94
+ "schemaVersion": "3.26.0"
95
95
  }
@@ -397,6 +397,6 @@
397
397
  }
398
398
  }
399
399
  },
400
- "schemaVersion": "3.25.0",
400
+ "schemaVersion": "3.26.0",
401
401
  "services": {}
402
402
  }
@@ -1124,6 +1124,6 @@
1124
1124
  }
1125
1125
  }
1126
1126
  },
1127
- "schemaVersion": "3.25.0",
1127
+ "schemaVersion": "3.26.0",
1128
1128
  "services": {}
1129
1129
  }
@@ -1124,6 +1124,6 @@
1124
1124
  }
1125
1125
  }
1126
1126
  },
1127
- "schemaVersion": "3.25.0",
1127
+ "schemaVersion": "3.26.0",
1128
1128
  "services": {}
1129
1129
  }
@@ -1177,5 +1177,5 @@
1177
1177
  }
1178
1178
  }
1179
1179
  },
1180
- "schemaVersion": "3.25.0"
1180
+ "schemaVersion": "3.26.0"
1181
1181
  }
@@ -5,7 +5,7 @@
5
5
  "en-us"
6
6
  ],
7
7
  "apiVersion": "2",
8
- "schemaVersion": "3.25.0",
8
+ "schemaVersion": "3.26.0",
9
9
  "queries": {
10
10
  "getAsset": {
11
11
  "shape": "Asset",
@@ -12560,5 +12560,5 @@
12560
12560
  }
12561
12561
  }
12562
12562
  },
12563
- "schemaVersion": "3.25.0"
12563
+ "schemaVersion": "3.26.0"
12564
12564
  }
@@ -5,7 +5,7 @@
5
5
  "en-us"
6
6
  ],
7
7
  "apiVersion": "2",
8
- "schemaVersion": "3.25.0",
8
+ "schemaVersion": "3.26.0",
9
9
  "queries": {
10
10
  "getAsset": {
11
11
  "shape": "Asset",
@@ -29316,5 +29316,5 @@
29316
29316
  }
29317
29317
  }
29318
29318
  },
29319
- "schemaVersion": "3.25.0"
29319
+ "schemaVersion": "3.26.0"
29320
29320
  }
@@ -165,6 +165,6 @@
165
165
  }
166
166
  }
167
167
  },
168
- "schemaVersion": "3.25.0",
168
+ "schemaVersion": "3.26.0",
169
169
  "services": {}
170
170
  }
@@ -190,6 +190,6 @@
190
190
  }
191
191
  }
192
192
  },
193
- "schemaVersion": "3.25.0",
193
+ "schemaVersion": "3.26.0",
194
194
  "services": {}
195
195
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeshape/schema",
3
- "version": "8.274.0",
3
+ "version": "8.278.3",
4
4
  "description": "TakeShape Schema",
5
5
  "homepage": "https://www.takeshape.io",
6
6
  "repository": {
@@ -30,9 +30,9 @@
30
30
  "p-reduce": "^2.1.0",
31
31
  "semver": "^7.3.2",
32
32
  "tiny-invariant": "^1.2.0",
33
- "@takeshape/json-schema": "8.274.0",
34
- "@takeshape/errors": "8.274.0",
35
- "@takeshape/util": "8.274.0"
33
+ "@takeshape/errors": "8.278.3",
34
+ "@takeshape/util": "8.278.3",
35
+ "@takeshape/json-schema": "8.278.3"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@takeshape/json-schema-to-typescript": "^11.0.0",