@takeshape/schema 8.105.0 → 8.106.1
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/{lib → dist}/api-version.d.ts +0 -0
- package/{lib → dist}/api-version.d.ts.map +0 -0
- package/{lib → dist}/api-version.js +0 -0
- package/{lib → dist}/auth-schemas.d.ts +0 -0
- package/{lib → dist}/auth-schemas.d.ts.map +0 -0
- package/{lib → dist}/auth-schemas.js +0 -0
- package/{lib → dist}/builtin-schema.d.ts +0 -0
- package/{lib → dist}/builtin-schema.d.ts.map +0 -0
- package/{lib → dist}/builtin-schema.js +0 -0
- package/{lib → dist}/content-schema-transform.d.ts +0 -0
- package/{lib → dist}/content-schema-transform.d.ts.map +0 -0
- package/{lib → dist}/content-schema-transform.js +0 -0
- package/{lib → dist}/enum.d.ts +0 -0
- package/{lib → dist}/enum.d.ts.map +0 -0
- package/{lib → dist}/enum.js +0 -0
- package/{lib → dist}/flatten-templates.d.ts +0 -0
- package/{lib → dist}/flatten-templates.d.ts.map +0 -0
- package/{lib → dist}/flatten-templates.js +0 -0
- package/{lib → dist}/get-is-leaf.d.ts +0 -0
- package/{lib → dist}/get-is-leaf.d.ts.map +0 -0
- package/{lib → dist}/get-is-leaf.js +0 -0
- package/{lib → dist}/index.d.ts +0 -0
- package/{lib → dist}/index.d.ts.map +0 -0
- package/{lib → dist}/index.js +0 -0
- package/{lib → dist}/layers/layers.d.ts +0 -0
- package/{lib → dist}/layers/layers.d.ts.map +0 -0
- package/{lib → dist}/layers/layers.js +0 -0
- package/{lib → dist}/layers/refs.d.ts +0 -0
- package/{lib → dist}/layers/refs.d.ts.map +0 -0
- package/{lib → dist}/layers/refs.js +0 -0
- package/{lib → dist}/layers/type-utils.d.ts +0 -0
- package/{lib → dist}/layers/type-utils.d.ts.map +0 -0
- package/{lib → dist}/layers/type-utils.js +0 -0
- package/{lib → dist}/layers/visitor.d.ts +0 -0
- package/{lib → dist}/layers/visitor.d.ts.map +0 -0
- package/{lib → dist}/layers/visitor.js +0 -0
- package/{lib → dist}/migration/index.d.ts +0 -0
- package/{lib → dist}/migration/index.d.ts.map +0 -0
- package/{lib → dist}/migration/index.js +0 -0
- package/{lib → dist}/migration/to/v3.0.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.0.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.0.0.js +0 -0
- package/{lib → dist}/migration/to/v3.1.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.1.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.1.0.js +0 -0
- package/{lib → dist}/migration/to/v3.10.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.10.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.10.0.js +0 -0
- package/{lib → dist}/migration/to/v3.11.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.11.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.11.0.js +0 -0
- package/{lib → dist}/migration/to/v3.12.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.12.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.12.0.js +0 -0
- package/{lib → dist}/migration/to/v3.12.1.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.12.1.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.12.1.js +0 -0
- package/{lib → dist}/migration/to/v3.12.2.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.12.2.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.12.2.js +0 -0
- package/{lib → dist}/migration/to/v3.12.3.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.12.3.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.12.3.js +0 -0
- package/{lib → dist}/migration/to/v3.13.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.13.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.13.0.js +0 -0
- package/{lib → dist}/migration/to/v3.14.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.14.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.14.0.js +0 -0
- package/{lib → dist}/migration/to/v3.15.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.15.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.15.0.js +0 -0
- package/{lib → dist}/migration/to/v3.16.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.16.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.16.0.js +0 -0
- package/{lib → dist}/migration/to/v3.17.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.17.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.17.0.js +0 -0
- package/{lib → dist}/migration/to/v3.2.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.2.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.2.0.js +0 -0
- package/{lib → dist}/migration/to/v3.3.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.3.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.3.0.js +0 -0
- package/{lib → dist}/migration/to/v3.4.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.4.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.4.0.js +0 -0
- package/{lib → dist}/migration/to/v3.5.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.5.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.5.0.js +0 -0
- package/{lib → dist}/migration/to/v3.5.1.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.5.1.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.5.1.js +0 -0
- package/{lib → dist}/migration/to/v3.6.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.6.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.6.0.js +0 -0
- package/{lib → dist}/migration/to/v3.7.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.7.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.7.0.js +0 -0
- package/{lib → dist}/migration/to/v3.8.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.8.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.8.0.js +0 -0
- package/{lib → dist}/migration/to/v3.9.0.d.ts +0 -0
- package/{lib → dist}/migration/to/v3.9.0.d.ts.map +0 -0
- package/{lib → dist}/migration/to/v3.9.0.js +0 -0
- package/{lib → dist}/migration/types.d.ts +0 -0
- package/{lib → dist}/migration/types.d.ts.map +0 -0
- package/{lib → dist}/migration/types.js +0 -0
- package/{lib → dist}/migration/utils.d.ts +0 -0
- package/{lib → dist}/migration/utils.d.ts.map +0 -0
- package/{lib → dist}/migration/utils.js +0 -0
- package/{lib → dist}/mocks.d.ts +0 -0
- package/{lib → dist}/mocks.d.ts.map +0 -0
- package/{lib → dist}/mocks.js +0 -0
- package/{lib → dist}/patterns.d.ts +0 -0
- package/{lib → dist}/patterns.d.ts.map +0 -0
- package/{lib → dist}/patterns.js +0 -0
- package/{lib → dist}/project-schema/index.d.ts +0 -0
- package/{lib → dist}/project-schema/index.d.ts.map +0 -0
- package/{lib → dist}/project-schema/index.js +0 -0
- package/{lib → dist}/project-schema/latest.d.ts +0 -0
- package/{lib → dist}/project-schema/latest.d.ts.map +0 -0
- package/{lib → dist}/project-schema/latest.js +0 -0
- package/{lib → dist}/project-schema/migrate.d.ts +0 -0
- package/{lib → dist}/project-schema/migrate.d.ts.map +0 -0
- package/{lib → dist}/project-schema/migrate.js +0 -0
- package/{lib → dist}/project-schema/v1.0.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v1.0.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v1.0.0.js +0 -0
- package/{lib → dist}/project-schema/v3.0.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.0.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.0.0.js +0 -0
- package/{lib → dist}/project-schema/v3.1.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.1.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.1.0.js +0 -0
- package/{lib → dist}/project-schema/v3.10.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.10.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.10.0.js +0 -0
- package/{lib → dist}/project-schema/v3.11.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.11.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.11.0.js +0 -0
- package/{lib → dist}/project-schema/v3.12.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.12.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.12.0.js +0 -0
- package/{lib → dist}/project-schema/v3.12.1.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.12.1.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.12.1.js +0 -0
- package/{lib → dist}/project-schema/v3.12.2.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.12.2.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.12.2.js +0 -0
- package/{lib → dist}/project-schema/v3.12.3.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.12.3.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.12.3.js +0 -0
- package/{lib → dist}/project-schema/v3.13.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.13.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.13.0.js +0 -0
- package/{lib → dist}/project-schema/v3.13.1.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.13.1.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.13.1.js +0 -0
- package/{lib → dist}/project-schema/v3.14.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.14.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.14.0.js +0 -0
- package/{lib → dist}/project-schema/v3.15.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.15.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.15.0.js +0 -0
- package/{lib → dist}/project-schema/v3.16.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.16.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.16.0.js +0 -0
- package/{lib → dist}/project-schema/v3.17.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.17.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.17.0.js +0 -0
- package/{lib → dist}/project-schema/v3.2.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.2.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.2.0.js +0 -0
- package/{lib → dist}/project-schema/v3.3.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.3.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.3.0.js +0 -0
- package/{lib → dist}/project-schema/v3.4.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.4.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.4.0.js +0 -0
- package/{lib → dist}/project-schema/v3.5.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.5.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.5.0.js +0 -0
- package/{lib → dist}/project-schema/v3.5.1.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.5.1.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.5.1.js +0 -0
- package/{lib → dist}/project-schema/v3.6.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.6.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.6.0.js +0 -0
- package/{lib → dist}/project-schema/v3.7.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.7.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.7.0.js +0 -0
- package/{lib → dist}/project-schema/v3.8.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.8.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.8.0.js +0 -0
- package/{lib → dist}/project-schema/v3.9.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v3.9.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v3.9.0.js +0 -0
- package/{lib → dist}/project-schema/v4.0.0.d.ts +0 -0
- package/{lib → dist}/project-schema/v4.0.0.d.ts.map +0 -0
- package/{lib → dist}/project-schema/v4.0.0.js +0 -0
- package/{lib → dist}/refs.d.ts +0 -0
- package/{lib → dist}/refs.d.ts.map +0 -0
- package/{lib → dist}/refs.js +0 -0
- package/dist/relationships.d.ts +11 -0
- package/dist/relationships.d.ts.map +1 -0
- package/dist/relationships.js +66 -0
- package/{lib → dist}/rewrite.d.ts +0 -0
- package/{lib → dist}/rewrite.d.ts.map +0 -0
- package/{lib → dist}/rewrite.js +0 -0
- package/{lib → dist}/scalars.d.ts +0 -0
- package/{lib → dist}/scalars.d.ts.map +0 -0
- package/{lib → dist}/scalars.js +0 -0
- package/{lib → dist}/schema-util.d.ts +2 -0
- package/dist/schema-util.d.ts.map +1 -0
- package/{lib → dist}/schema-util.js +10 -7
- package/{lib → dist}/schemas/auth-schemas.json +0 -0
- package/{lib → dist}/schemas/index.d.ts +0 -0
- package/{lib → dist}/schemas/index.d.ts.map +0 -0
- package/{lib → dist}/schemas/index.js +0 -0
- package/{lib → dist}/schemas/index.ts +0 -0
- package/{lib → dist}/schemas/project-schema/latest.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v1.0.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v3.0.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v3.1.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v3.2.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v3.3.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v3.4.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v3.5.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v3.5.1.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v3.6.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v3.7.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v3.8.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/meta-schema-v3.9.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v1.0.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.0.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.1.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.10.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.11.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.12.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.12.1.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.12.2.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.12.3.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.13.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.14.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.15.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.16.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.17.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.2.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.3.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.4.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.5.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.5.1.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.6.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.7.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.8.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v3.9.0.json +0 -0
- package/{lib → dist}/schemas/project-schema/v4.0.0.json +0 -0
- package/{lib → dist}/schemas/project-schema.json +0 -0
- package/{lib → dist}/schemas/user-schema.json +0 -0
- package/{lib → dist}/services.d.ts +0 -0
- package/{lib → dist}/services.d.ts.map +0 -0
- package/{lib → dist}/services.js +0 -0
- package/{lib → dist}/taxonomies.d.ts +0 -0
- package/{lib → dist}/taxonomies.d.ts.map +0 -0
- package/{lib → dist}/taxonomies.js +0 -0
- package/{lib → dist}/template-shapes/index.d.ts +0 -0
- package/{lib → dist}/template-shapes/index.d.ts.map +0 -0
- package/{lib → dist}/template-shapes/index.js +0 -0
- package/{lib → dist}/template-shapes/templates.d.ts +0 -0
- package/{lib → dist}/template-shapes/templates.d.ts.map +0 -0
- package/{lib → dist}/template-shapes/templates.js +0 -0
- package/{lib → dist}/template-shapes/types.d.ts +0 -0
- package/{lib → dist}/template-shapes/types.d.ts.map +0 -0
- package/{lib → dist}/template-shapes/types.js +0 -0
- package/{lib → dist}/template-shapes/where.d.ts +0 -1
- package/{lib → dist}/template-shapes/where.d.ts.map +1 -1
- package/{lib → dist}/template-shapes/where.js +3 -26
- package/{lib → dist}/types/index.d.ts +0 -0
- package/{lib → dist}/types/index.d.ts.map +0 -0
- package/{lib → dist}/types/index.js +0 -0
- package/{lib → dist}/types/types.d.ts +0 -0
- package/{lib → dist}/types/types.d.ts.map +0 -0
- package/{lib → dist}/types/types.js +0 -0
- package/{lib → dist}/types/utils.d.ts +0 -0
- package/{lib → dist}/types/utils.d.ts.map +0 -0
- package/{lib → dist}/types/utils.js +0 -0
- package/{lib → dist}/unions.d.ts +0 -0
- package/{lib → dist}/unions.d.ts.map +0 -0
- package/{lib → dist}/unions.js +0 -0
- package/{lib → dist}/user-schema.d.ts +0 -0
- package/{lib → dist}/user-schema.d.ts.map +0 -0
- package/{lib → dist}/user-schema.js +0 -0
- package/{lib → dist}/util/detect-cycles.d.ts +0 -0
- package/{lib → dist}/util/detect-cycles.d.ts.map +0 -0
- package/{lib → dist}/util/detect-cycles.js +0 -0
- package/{lib → dist}/util/index.d.ts +0 -0
- package/{lib → dist}/util/index.d.ts.map +0 -0
- package/{lib → dist}/util/index.js +0 -0
- package/{lib → dist}/util/merge.d.ts +0 -0
- package/{lib → dist}/util/merge.d.ts.map +0 -0
- package/{lib → dist}/util/merge.js +0 -0
- package/{lib → dist}/validate.d.ts +0 -0
- package/{lib → dist}/validate.d.ts.map +0 -0
- package/{lib → dist}/validate.js +0 -0
- package/{lib → dist}/versions.d.ts +0 -0
- package/{lib → dist}/versions.d.ts.map +0 -0
- package/{lib → dist}/versions.js +0 -0
- package/{lib → dist}/workflows.d.ts +0 -0
- package/{lib → dist}/workflows.d.ts.map +0 -0
- package/{lib → dist}/workflows.js +0 -0
- package/es/relationships.js +38 -0
- package/es/schema-util.js +10 -7
- package/es/template-shapes/where.js +1 -23
- package/package.json +11 -11
- package/lib/relationships.d.ts +0 -3
- package/lib/relationships.d.ts.map +0 -1
- package/lib/relationships.js +0 -24
- package/lib/schema-util.d.ts.map +0 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getRelationshipSchema = getRelationshipSchema;
|
|
7
|
+
exports.hasUnequalRelationships = hasUnequalRelationships;
|
|
8
|
+
exports.isEqualRelationship = isEqualRelationship;
|
|
9
|
+
|
|
10
|
+
function getRelationshipSchema(relationship) {
|
|
11
|
+
const itemSchema = {
|
|
12
|
+
$ref: '#/shapes/TSRelationship/schema'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
if (relationship.type === 'multiple') {
|
|
16
|
+
return {
|
|
17
|
+
type: 'array',
|
|
18
|
+
items: itemSchema,
|
|
19
|
+
'@relationship': relationship
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return { ...itemSchema,
|
|
24
|
+
'@relationship': relationship
|
|
25
|
+
};
|
|
26
|
+
} // TODO: Code below will likely cause a conflict with @relationship PR...
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Test whether two PropertySchemas have equal realtionships
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
function isEqualRelationship(a, b) {
|
|
34
|
+
var _a$Relationship, _b$Relationship;
|
|
35
|
+
|
|
36
|
+
// non-relationships are considered equal in that they are both equal that regard
|
|
37
|
+
if (!a['@relationship'] && !b['@relationship']) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const idsA = (_a$Relationship = a['@relationship']) === null || _a$Relationship === void 0 ? void 0 : _a$Relationship.shapeIds;
|
|
42
|
+
|
|
43
|
+
if (!idsA) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const idsB = (_b$Relationship = b['@relationship']) === null || _b$Relationship === void 0 ? void 0 : _b$Relationship.shapeIds;
|
|
48
|
+
|
|
49
|
+
if (!idsB || idsA.length !== idsB.length) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const idSet = new Set(idsA);
|
|
54
|
+
return idsB.every(id => idSet.has(id));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Test whether an array of PropertySchemas have unequal relationships
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
function hasUnequalRelationships(relationships) {
|
|
62
|
+
return Boolean(relationships.find((propertySchema, index, allRelationships) => {
|
|
63
|
+
const nextPropertySchema = allRelationships[index + 1];
|
|
64
|
+
return nextPropertySchema ? !isEqualRelationship(propertySchema, nextPropertySchema) : false;
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
File without changes
|
|
File without changes
|
package/{lib → dist}/rewrite.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/{lib → dist}/scalars.js
RENAMED
|
File without changes
|
|
@@ -47,6 +47,8 @@ export interface RelationshipEnv {
|
|
|
47
47
|
path: string[];
|
|
48
48
|
hasBackreference: boolean;
|
|
49
49
|
relatedName?: string;
|
|
50
|
+
schema: PropertySchema;
|
|
51
|
+
shapeName: string;
|
|
50
52
|
}
|
|
51
53
|
export declare function stringifyQuerySource(providerId: string, serviceId: string): string;
|
|
52
54
|
export declare function parseQuerySource(source: string): {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-util.d.ts","sourceRoot":"","sources":["../../src/schema-util.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,UAAU,EAEV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EAGX,WAAW,EAEZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,+BAA+B,EAC/B,UAAU,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAElB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACd,MAAM,eAAe,CAAC;AAWvB,OAAO,EAAC,KAAK,EAAuB,MAAM,iBAAiB,CAAC;AAe5D,OAAO,EAUL,OAAO,EAIP,eAAe,EACf,eAAe,EACf,qBAAqB,EACtB,MAAM,QAAQ,CAAC;AAKhB,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AAEpE,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEzD;AAID,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,wBAAgB,aAAa,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,GAAG,OAAO,CAG7F;AAED,eAAO,MAAM,kBAAkB,UAU9B,CAAC;AACF,eAAO,MAAM,gBAAgB,UAAyD,CAAC;AAEvF,eAAO,MAAM,gBAAgB,UAY5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAkD,CAAC;AAEhF,eAAO,MAAM,eAAe,UAA2F,CAAC;AAExH,eAAO,MAAM,8BAA8B,UAAkD,CAAC;AAG9F,eAAO,MAAM,uBAAuB,UAQnC,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O,MAAM,YAAY,kBACR,kBAAkB,aACtB,MAAM,YACP,MAAM,KACf,MAAM,GAAG,SAA4E,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,WAAW,kBAAmB,kBAAkB,aAAa,MAAM,YAAY,MAAM,KAAG,MACrC,CAAC;AACjE;;;GAGG;AACH,eAAO,MAAM,cAAc,kBAAmB,kBAAkB,aAAa,MAAM,YAAY,MAAM,KAAG,MACrC,CAAC;AAEpE;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,KAAK,CAAC,UAAU,CAAC,CAEnB;AAED,oBAAY,2BAA2B,GACnC,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,qBAAqB,CAAC;AAE1B;;GAEG;AACH,eAAO,MAAM,sBAAsB,cAAe,MAAM,YAAY,2BAA2B,KAAG,MAGjG,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAQ3F"}
|
|
@@ -549,7 +549,7 @@ function findExistingRelationships(projectSchema, shapes) {
|
|
|
549
549
|
const shapesSeen = new Set();
|
|
550
550
|
const shapeIds = new Set(shapeArray.map(shape => shape.id));
|
|
551
551
|
|
|
552
|
-
const findRelationships = (schema, path) => {
|
|
552
|
+
const findRelationships = (schema, path, parentShapeName) => {
|
|
553
553
|
if (schema['@relationship']) {
|
|
554
554
|
var _schema$Backreferenc;
|
|
555
555
|
|
|
@@ -566,7 +566,9 @@ function findExistingRelationships(projectSchema, shapes) {
|
|
|
566
566
|
relatedName,
|
|
567
567
|
path: path.slice(1),
|
|
568
568
|
shapeId: path[0],
|
|
569
|
-
hasBackreference: Boolean((_schema$Backreferenc2 = schema['@backreference']) === null || _schema$Backreferenc2 === void 0 ? void 0 : _schema$Backreferenc2.enabled)
|
|
569
|
+
hasBackreference: Boolean((_schema$Backreferenc2 = schema['@backreference']) === null || _schema$Backreferenc2 === void 0 ? void 0 : _schema$Backreferenc2.enabled),
|
|
570
|
+
schema,
|
|
571
|
+
shapeName: parentShapeName
|
|
570
572
|
});
|
|
571
573
|
}
|
|
572
574
|
}
|
|
@@ -591,13 +593,13 @@ function findExistingRelationships(projectSchema, shapes) {
|
|
|
591
593
|
|
|
592
594
|
if (prop.properties) {
|
|
593
595
|
for (const name of Object.keys(prop.properties)) {
|
|
594
|
-
findRelationships(prop.properties[name], path.concat(name));
|
|
596
|
+
findRelationships(prop.properties[name], path.concat(name), shapeName ?? parentShapeName);
|
|
595
597
|
}
|
|
596
598
|
} else if (prop.items) {
|
|
597
|
-
findRelationships(prop.items, path);
|
|
599
|
+
findRelationships(prop.items, path, shapeName ?? parentShapeName);
|
|
598
600
|
} else if ((0, _unions.isUnionSchema)(prop)) {
|
|
599
601
|
for (const child of prop.oneOf) {
|
|
600
|
-
findRelationships(child, path);
|
|
602
|
+
findRelationships(child, path, shapeName ?? parentShapeName);
|
|
601
603
|
}
|
|
602
604
|
}
|
|
603
605
|
};
|
|
@@ -606,9 +608,10 @@ function findExistingRelationships(projectSchema, shapes) {
|
|
|
606
608
|
if (isModelShape(shape)) {
|
|
607
609
|
const {
|
|
608
610
|
schema,
|
|
609
|
-
id
|
|
611
|
+
id,
|
|
612
|
+
name
|
|
610
613
|
} = shape;
|
|
611
|
-
findRelationships(schema, [id]);
|
|
614
|
+
findRelationships(schema, [id], name);
|
|
612
615
|
}
|
|
613
616
|
}
|
|
614
617
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/{lib → dist}/services.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -20,7 +20,6 @@ export declare const fieldTypeComparison: Record<string, {
|
|
|
20
20
|
export declare const comparatorDescriptions: Record<string, string>;
|
|
21
21
|
export declare const booleanOperators: string[];
|
|
22
22
|
export declare const boolOpDescriptionMap: Record<string, string>;
|
|
23
|
-
export declare function isEqualRelationship(a: PropertySchema, b: PropertySchema): boolean;
|
|
24
23
|
export declare function getFieldTypeComparison(fieldType: string): Maybe<Record<string, PropertySchema>>;
|
|
25
24
|
export interface PropertyContext {
|
|
26
25
|
shapeCache: ShapeCache;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"where.d.ts","sourceRoot":"","sources":["../../../src/template-shapes/where.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,EAAY,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAC,cAAc,EAAE,aAAa,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAI5E,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAczD,OAAO,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"where.d.ts","sourceRoot":"","sources":["../../../src/template-shapes/where.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,EAAY,MAAM,iBAA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AAU,CAAC;IACvB,qBAAqB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,aAAa,EAAE,aAAa,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAgBD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAkBrH;AAYD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,GACvB,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAkFvC;AAkED,wBAAgB,aAAa,CAAC,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,gBAAgB,CA4BrG;AAED,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,KAAK,EAAE,GACtB;IAAC,MAAM,EAAE,YAAY,CAAC;IAAC,YAAY,EAAE,QAAQ,CAAA;CAAC,CAchD"}
|
|
@@ -9,7 +9,6 @@ exports.getFields = getFields;
|
|
|
9
9
|
exports.getPropertyComparisonType = getPropertyComparisonType;
|
|
10
10
|
exports.getWhereSearchArg = getWhereSearchArg;
|
|
11
11
|
exports.getWhereShape = getWhereShape;
|
|
12
|
-
exports.isEqualRelationship = isEqualRelationship;
|
|
13
12
|
|
|
14
13
|
var _util = require("@takeshape/util");
|
|
15
14
|
|
|
@@ -31,6 +30,8 @@ var _uniqBy = _interopRequireDefault(require("lodash/uniqBy"));
|
|
|
31
30
|
|
|
32
31
|
var _blueimpMd = _interopRequireDefault(require("blueimp-md5"));
|
|
33
32
|
|
|
33
|
+
var _relationships = require("../relationships");
|
|
34
|
+
|
|
34
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
36
|
|
|
36
37
|
const MAX_RELATIONSHIP_DEPTH = 1;
|
|
@@ -137,37 +138,13 @@ const boolOpDescriptionMap = {
|
|
|
137
138
|
};
|
|
138
139
|
exports.boolOpDescriptionMap = boolOpDescriptionMap;
|
|
139
140
|
|
|
140
|
-
function isEqualRelationship(a, b) {
|
|
141
|
-
var _a$Relationship, _b$Relationship;
|
|
142
|
-
|
|
143
|
-
// non-relationships are considered equal in that they are both equal that regard
|
|
144
|
-
if (!a['@relationship'] && !b['@relationship']) {
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const idsA = (_a$Relationship = a['@relationship']) === null || _a$Relationship === void 0 ? void 0 : _a$Relationship.shapeIds;
|
|
149
|
-
|
|
150
|
-
if (!idsA) {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const idsB = (_b$Relationship = b['@relationship']) === null || _b$Relationship === void 0 ? void 0 : _b$Relationship.shapeIds;
|
|
155
|
-
|
|
156
|
-
if (!idsB || idsA.length !== idsB.length) {
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
const idSet = new Set(idsA);
|
|
161
|
-
return idsB.every(id => idSet.has(id));
|
|
162
|
-
}
|
|
163
|
-
|
|
164
141
|
function getConflictingProperties(projectSchema, shapes) {
|
|
165
142
|
const conflicts = new Set();
|
|
166
143
|
const allProps = {};
|
|
167
144
|
|
|
168
145
|
for (const shape of Object.values(shapes)) {
|
|
169
146
|
for (const [name, prop] of (0, _schemaUtil.createSchemaPropertyList)(projectSchema, shape).getNodes()) {
|
|
170
|
-
if (name in allProps && (allProps[name].type !== prop.type || !isEqualRelationship(allProps[name], prop))) {
|
|
147
|
+
if (name in allProps && (allProps[name].type !== prop.type || !(0, _relationships.isEqualRelationship)(allProps[name], prop))) {
|
|
171
148
|
conflicts.add(name);
|
|
172
149
|
}
|
|
173
150
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/{lib → dist}/unions.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
package/{lib → dist}/unions.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/{lib → dist}/validate.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/{lib → dist}/versions.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/es/relationships.js
CHANGED
|
@@ -14,4 +14,42 @@ export function getRelationshipSchema(relationship) {
|
|
|
14
14
|
return { ...itemSchema,
|
|
15
15
|
'@relationship': relationship
|
|
16
16
|
};
|
|
17
|
+
} // TODO: Code below will likely cause a conflict with @relationship PR...
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Test whether two PropertySchemas have equal realtionships
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export function isEqualRelationship(a, b) {
|
|
24
|
+
var _a$Relationship, _b$Relationship;
|
|
25
|
+
|
|
26
|
+
// non-relationships are considered equal in that they are both equal that regard
|
|
27
|
+
if (!a['@relationship'] && !b['@relationship']) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const idsA = (_a$Relationship = a['@relationship']) === null || _a$Relationship === void 0 ? void 0 : _a$Relationship.shapeIds;
|
|
32
|
+
|
|
33
|
+
if (!idsA) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const idsB = (_b$Relationship = b['@relationship']) === null || _b$Relationship === void 0 ? void 0 : _b$Relationship.shapeIds;
|
|
38
|
+
|
|
39
|
+
if (!idsB || idsA.length !== idsB.length) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const idSet = new Set(idsA);
|
|
44
|
+
return idsB.every(id => idSet.has(id));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Test whether an array of PropertySchemas have unequal relationships
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
export function hasUnequalRelationships(relationships) {
|
|
51
|
+
return Boolean(relationships.find((propertySchema, index, allRelationships) => {
|
|
52
|
+
const nextPropertySchema = allRelationships[index + 1];
|
|
53
|
+
return nextPropertySchema ? !isEqualRelationship(propertySchema, nextPropertySchema) : false;
|
|
54
|
+
}));
|
|
17
55
|
}
|
package/es/schema-util.js
CHANGED
|
@@ -433,7 +433,7 @@ export function findExistingRelationships(projectSchema, shapes) {
|
|
|
433
433
|
const shapesSeen = new Set();
|
|
434
434
|
const shapeIds = new Set(shapeArray.map(shape => shape.id));
|
|
435
435
|
|
|
436
|
-
const findRelationships = (schema, path) => {
|
|
436
|
+
const findRelationships = (schema, path, parentShapeName) => {
|
|
437
437
|
if (schema['@relationship']) {
|
|
438
438
|
var _schema$Backreferenc;
|
|
439
439
|
|
|
@@ -450,7 +450,9 @@ export function findExistingRelationships(projectSchema, shapes) {
|
|
|
450
450
|
relatedName,
|
|
451
451
|
path: path.slice(1),
|
|
452
452
|
shapeId: path[0],
|
|
453
|
-
hasBackreference: Boolean((_schema$Backreferenc2 = schema['@backreference']) === null || _schema$Backreferenc2 === void 0 ? void 0 : _schema$Backreferenc2.enabled)
|
|
453
|
+
hasBackreference: Boolean((_schema$Backreferenc2 = schema['@backreference']) === null || _schema$Backreferenc2 === void 0 ? void 0 : _schema$Backreferenc2.enabled),
|
|
454
|
+
schema,
|
|
455
|
+
shapeName: parentShapeName
|
|
454
456
|
});
|
|
455
457
|
}
|
|
456
458
|
}
|
|
@@ -475,13 +477,13 @@ export function findExistingRelationships(projectSchema, shapes) {
|
|
|
475
477
|
|
|
476
478
|
if (prop.properties) {
|
|
477
479
|
for (const name of Object.keys(prop.properties)) {
|
|
478
|
-
findRelationships(prop.properties[name], path.concat(name));
|
|
480
|
+
findRelationships(prop.properties[name], path.concat(name), shapeName ?? parentShapeName);
|
|
479
481
|
}
|
|
480
482
|
} else if (prop.items) {
|
|
481
|
-
findRelationships(prop.items, path);
|
|
483
|
+
findRelationships(prop.items, path, shapeName ?? parentShapeName);
|
|
482
484
|
} else if (isUnionSchema(prop)) {
|
|
483
485
|
for (const child of prop.oneOf) {
|
|
484
|
-
findRelationships(child, path);
|
|
486
|
+
findRelationships(child, path, shapeName ?? parentShapeName);
|
|
485
487
|
}
|
|
486
488
|
}
|
|
487
489
|
};
|
|
@@ -490,9 +492,10 @@ export function findExistingRelationships(projectSchema, shapes) {
|
|
|
490
492
|
if (isModelShape(shape)) {
|
|
491
493
|
const {
|
|
492
494
|
schema,
|
|
493
|
-
id
|
|
495
|
+
id,
|
|
496
|
+
name
|
|
494
497
|
} = shape;
|
|
495
|
-
findRelationships(schema, [id]);
|
|
498
|
+
findRelationships(schema, [id], name);
|
|
496
499
|
}
|
|
497
500
|
}
|
|
498
501
|
|
|
@@ -8,6 +8,7 @@ import { enumerateOneOfKeys, isUnionSchema } from '../unions';
|
|
|
8
8
|
import { isObjectSchema } from '../types';
|
|
9
9
|
import uniqBy from 'lodash/uniqBy';
|
|
10
10
|
import md5 from 'blueimp-md5';
|
|
11
|
+
import { isEqualRelationship } from '../relationships';
|
|
11
12
|
export const MAX_RELATIONSHIP_DEPTH = 1;
|
|
12
13
|
export const exceededRelationshipDepth = (depth = 0) => depth >= MAX_RELATIONSHIP_DEPTH;
|
|
13
14
|
|
|
@@ -103,29 +104,6 @@ export const boolOpDescriptionMap = {
|
|
|
103
104
|
OR: 'OR takes an array of conditions that should appear in the matching results. Nested boolean operators can be used to create complex filters.',
|
|
104
105
|
NOT: 'NOT takes a single condition that must not appear in the matching results.'
|
|
105
106
|
};
|
|
106
|
-
export function isEqualRelationship(a, b) {
|
|
107
|
-
var _a$Relationship, _b$Relationship;
|
|
108
|
-
|
|
109
|
-
// non-relationships are considered equal in that they are both equal that regard
|
|
110
|
-
if (!a['@relationship'] && !b['@relationship']) {
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const idsA = (_a$Relationship = a['@relationship']) === null || _a$Relationship === void 0 ? void 0 : _a$Relationship.shapeIds;
|
|
115
|
-
|
|
116
|
-
if (!idsA) {
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const idsB = (_b$Relationship = b['@relationship']) === null || _b$Relationship === void 0 ? void 0 : _b$Relationship.shapeIds;
|
|
121
|
-
|
|
122
|
-
if (!idsB || idsA.length !== idsB.length) {
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const idSet = new Set(idsA);
|
|
127
|
-
return idsB.every(id => idSet.has(id));
|
|
128
|
-
}
|
|
129
107
|
|
|
130
108
|
function getConflictingProperties(projectSchema, shapes) {
|
|
131
109
|
const conflicts = new Set();
|