@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.
- package/dist/migration/index.d.ts +1 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +4 -1
- package/dist/migration/to/v3.26.0.d.ts +5 -0
- package/dist/migration/to/v3.26.0.d.ts.map +1 -0
- package/dist/migration/to/v3.26.0.js +18 -0
- package/dist/project-schema/index.d.ts +4 -1
- package/dist/project-schema/index.d.ts.map +1 -1
- package/dist/project-schema/index.js +20 -3
- package/dist/project-schema/latest.d.ts +28 -3
- package/dist/project-schema/latest.d.ts.map +1 -1
- package/dist/project-schema/migrate.d.ts.map +1 -1
- package/dist/project-schema/migrate.js +4 -0
- package/dist/project-schema/v3.26.0.d.ts +1389 -0
- package/dist/project-schema/v3.26.0.d.ts.map +1 -0
- package/dist/project-schema/v3.26.0.js +5 -0
- package/dist/refs.d.ts +4 -0
- package/dist/refs.d.ts.map +1 -1
- package/dist/refs.js +23 -0
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +6 -4
- package/dist/schemas/index.ts +4 -2
- package/dist/schemas/project-schema/latest.json +57 -4
- package/dist/schemas/project-schema/v3.26.0.json +2956 -0
- package/dist/schemas/project-schema.json +3 -0
- package/dist/types/types.d.ts +3 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/util/get-return-shape.d.ts +1 -1
- package/dist/util/get-return-shape.d.ts.map +1 -1
- package/dist/util/get-return-shape.js +3 -7
- package/dist/validate.js +1 -1
- package/es/migration/index.js +3 -1
- package/es/migration/to/v3.26.0.js +10 -0
- package/es/project-schema/index.js +3 -1
- package/es/project-schema/migrate.js +5 -1
- package/es/project-schema/v3.26.0.js +1 -0
- package/es/refs.js +20 -0
- package/es/schemas/index.js +4 -3
- package/es/schemas/index.ts +4 -2
- package/es/schemas/project-schema/latest.json +57 -4
- package/es/schemas/project-schema/v3.26.0.json +2956 -0
- package/es/schemas/project-schema.json +3 -0
- package/es/util/get-return-shape.js +3 -7
- package/es/validate.js +1 -1
- package/examples/latest/betzino.json +1 -1
- package/examples/latest/blog-schema.json +1 -1
- package/examples/latest/brewery-schema.json +1 -1
- package/examples/latest/complex-project-schema.json +1 -1
- package/examples/latest/complex-schema.json +1 -1
- package/examples/latest/fabric-ecommerce.json +1 -1
- package/examples/latest/frank-and-fred-schema.json +1 -1
- package/examples/latest/klirr-schema.json +1 -1
- package/examples/latest/massive-schema.json +1 -1
- package/examples/latest/mill-components-schema.json +1 -1
- package/examples/latest/one-earth.json +1 -1
- package/examples/latest/pet-oneof-array.json +1 -1
- package/examples/latest/post-schema.json +1 -1
- package/examples/latest/pruned-shopify-product-schema.json +1 -1
- package/examples/latest/real-world-schema.json +1 -1
- package/examples/latest/recursive-repeater-schema.json +1 -1
- package/examples/latest/recursive-schema.json +1 -1
- package/examples/latest/rick-and-morty-ast.json +1 -1
- package/examples/latest/rick-and-morty-graphql.json +1 -1
- package/examples/latest/rick-and-morty-rest.json +1 -1
- package/examples/latest/schema-with-repeater-draftjs.json +1 -1
- package/examples/latest/shape-books-v3_2_0.json +1 -1
- package/examples/latest/shape-books.json +1 -1
- package/examples/latest/shopify-lookbook.json +1 -1
- package/examples/latest/shopify-product-2022-07.json +1 -1
- package/examples/latest/shopify-store-with-widget.json +1 -1
- package/examples/latest/stripe-product-runtime-schema.json +1 -1
- package/examples/latest/stripe-starter-resolved.json +1 -1
- package/examples/latest/user-schema-no-required.json +1 -1
- package/examples/latest/user-schema-with-defaults.json +1 -1
- package/package.json +4 -4
|
@@ -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 (
|
|
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.
|
|
52528
|
+
"schemaVersion": "3.26.0",
|
|
52529
52529
|
"services": {}
|
|
52530
52530
|
}
|
|
@@ -10505,5 +10505,5 @@
|
|
|
10505
10505
|
}
|
|
10506
10506
|
}
|
|
10507
10507
|
},
|
|
10508
|
-
"schemaVersion": "3.
|
|
10508
|
+
"schemaVersion": "3.26.0"
|
|
10509
10509
|
}
|
|
@@ -23251,6 +23251,6 @@
|
|
|
23251
23251
|
}
|
|
23252
23252
|
}
|
|
23253
23253
|
},
|
|
23254
|
-
"schemaVersion": "3.
|
|
23254
|
+
"schemaVersion": "3.26.0",
|
|
23255
23255
|
"services": {}
|
|
23256
23256
|
}
|
|
@@ -34786,6 +34786,6 @@
|
|
|
34786
34786
|
}
|
|
34787
34787
|
}
|
|
34788
34788
|
},
|
|
34789
|
-
"schemaVersion": "3.
|
|
34789
|
+
"schemaVersion": "3.26.0",
|
|
34790
34790
|
"services": {}
|
|
34791
34791
|
}
|
|
@@ -14216,6 +14216,6 @@
|
|
|
14216
14216
|
}
|
|
14217
14217
|
}
|
|
14218
14218
|
},
|
|
14219
|
-
"schemaVersion": "3.
|
|
14219
|
+
"schemaVersion": "3.26.0",
|
|
14220
14220
|
"services": {}
|
|
14221
14221
|
}
|
|
@@ -12560,5 +12560,5 @@
|
|
|
12560
12560
|
}
|
|
12561
12561
|
}
|
|
12562
12562
|
},
|
|
12563
|
-
"schemaVersion": "3.
|
|
12563
|
+
"schemaVersion": "3.26.0"
|
|
12564
12564
|
}
|
|
@@ -29316,5 +29316,5 @@
|
|
|
29316
29316
|
}
|
|
29317
29317
|
}
|
|
29318
29318
|
},
|
|
29319
|
-
"schemaVersion": "3.
|
|
29319
|
+
"schemaVersion": "3.26.0"
|
|
29320
29320
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/schema",
|
|
3
|
-
"version": "8.
|
|
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/
|
|
34
|
-
"@takeshape/
|
|
35
|
-
"@takeshape/
|
|
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",
|