@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.
- package/es/builtin-schema.js +23 -0
- package/es/migration/index.js +3 -1
- package/es/migration/to/v3.17.0.js +27 -0
- package/es/project-schema/index.js +3 -1
- package/es/project-schema/migrate.js +5 -1
- package/es/project-schema/v3.17.0.js +1 -0
- package/es/schema-util.js +29 -17
- package/es/schemas/index.js +4 -3
- package/es/schemas/index.ts +4 -2
- package/es/schemas/project-schema/latest.json +7 -8
- package/es/schemas/project-schema/v3.17.0.json +2358 -0
- package/es/schemas/project-schema.json +3 -0
- package/es/template-shapes/where.js +1 -1
- package/es/validate.js +12 -8
- package/examples/latest/betzino.json +1393 -349
- 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/fabric-ecommerce.json +1 -1
- package/examples/latest/frank-and-fred-schema.json +1 -1
- package/examples/latest/massive-schema.json +1 -1
- package/examples/latest/mill-components-schema.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 +145 -37
- package/examples/latest/rick-and-morty-graphql.json +113 -29
- 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-store-with-widget.json +81 -21
- package/examples/latest/stripe-starter-resolved.json +49 -13
- package/examples/latest/user-schema-no-required.json +1 -1
- package/examples/latest/user-schema-with-defaults.json +1 -1
- package/lib/builtin-schema.d.ts.map +1 -1
- package/lib/builtin-schema.js +23 -0
- package/lib/migration/index.d.ts +1 -0
- package/lib/migration/index.d.ts.map +1 -1
- package/lib/migration/index.js +4 -1
- package/lib/migration/to/v3.17.0.d.ts +5 -0
- package/lib/migration/to/v3.17.0.d.ts.map +1 -0
- package/lib/migration/to/v3.17.0.js +40 -0
- package/lib/project-schema/index.d.ts +4 -1
- package/lib/project-schema/index.d.ts.map +1 -1
- package/lib/project-schema/index.js +20 -3
- package/lib/project-schema/latest.d.ts +2 -5
- package/lib/project-schema/latest.d.ts.map +1 -1
- package/lib/project-schema/migrate.d.ts.map +1 -1
- package/lib/project-schema/migrate.js +4 -0
- package/lib/project-schema/v3.17.0.d.ts +1456 -0
- package/lib/project-schema/v3.17.0.d.ts.map +1 -0
- package/lib/project-schema/v3.17.0.js +5 -0
- package/lib/schema-util.d.ts.map +1 -1
- package/lib/schema-util.js +29 -17
- package/lib/schemas/index.d.ts +2301 -2
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +6 -4
- package/lib/schemas/index.ts +4 -2
- package/lib/schemas/project-schema/latest.json +7 -8
- package/lib/schemas/project-schema/v3.17.0.json +2358 -0
- package/lib/schemas/project-schema.json +3 -0
- package/lib/template-shapes/where.d.ts.map +1 -1
- package/lib/template-shapes/where.js +1 -1
- package/lib/types/types.d.ts +2 -2
- package/lib/types/types.d.ts.map +1 -1
- package/lib/validate.d.ts.map +1 -1
- package/lib/validate.js +12 -8
- package/package.json +4 -4
|
@@ -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['@
|
|
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
|
|
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
|
-
|
|
208
|
+
if (shapeName) {
|
|
209
|
+
var _indexedShapes;
|
|
209
210
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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 {
|