@itwin/ecschema-editing 5.0.0-dev.50 → 5.0.0-dev.52
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/cjs/Differencing/SchemaConflicts.d.ts +3 -1
- package/lib/cjs/Differencing/SchemaConflicts.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.js +2 -0
- package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +4 -2
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +52 -2
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.d.ts +31 -3
- package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.js +2 -0
- package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js +42 -0
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.js +4 -0
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.d.ts +8 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.d.ts.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -1
- package/lib/cjs/Merging/FormatMerger.d.ts +24 -0
- package/lib/cjs/Merging/FormatMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/FormatMerger.js +138 -0
- package/lib/cjs/Merging/FormatMerger.js.map +1 -0
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.js +3 -4
- package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts +12 -2
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.js +25 -3
- package/lib/cjs/Merging/SchemaMergingVisitor.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.js +2 -0
- package/lib/cjs/Merging/SchemaMergingWalker.js.map +1 -1
- package/lib/cjs/Validation/SchemaChanges.js +1 -1
- package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareDiagnostics.d.ts +2 -2
- package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.js +2 -2
- package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
- package/package.json +9 -9
|
@@ -43,6 +43,8 @@ export declare enum ConflictCode {
|
|
|
43
43
|
ConflictingClassModifier = "C-103",
|
|
44
44
|
ConflictingEnumerationType = "C-700",
|
|
45
45
|
ConflictingEnumeratorValue = "C-701",
|
|
46
|
+
ConflictingFormatUnit = "C-800",
|
|
47
|
+
ConflictingFormatUnitPhenomenon = "C-801",
|
|
46
48
|
ConflictingPersistenceUnit = "C-1010",
|
|
47
49
|
MixinAppliedMustDeriveFromConstraint = "C-1100",
|
|
48
50
|
ConflictingPropertyName = "C-1300",
|
|
@@ -77,6 +79,6 @@ type EcClassTypes = SchemaItemType.CustomAttributeClass | SchemaItemType.EntityC
|
|
|
77
79
|
* Union of all supported schema differencing conflict types.
|
|
78
80
|
* @alpha
|
|
79
81
|
*/
|
|
80
|
-
export type AnySchemaDifferenceConflict = SchemaDifferenceConflict<ConflictCode.ConflictingItemName, SchemaItemType> | SchemaDifferenceConflict<ConflictCode.ConflictingReferenceAlias, SchemaOtherTypes.SchemaReference> | SchemaDifferenceConflict<ConflictCode.ConflictingReferenceVersion, SchemaOtherTypes.SchemaReference> | SchemaDifferenceConflict<ConflictCode.ConflictingBaseClass, EcClassTypes> | SchemaDifferenceConflict<ConflictCode.RemovingBaseClass, EcClassTypes> | SchemaDifferenceConflict<ConflictCode.SealedBaseClass, EcClassTypes> | SchemaDifferenceConflict<ConflictCode.ConflictingClassModifier, EcClassTypes> | SchemaDifferenceConflict<ConflictCode.ConflictingEnumerationType, SchemaItemType.Enumeration> | SchemaDifferenceConflict<ConflictCode.ConflictingEnumeratorValue, SchemaOtherTypes.Enumerator> | SchemaDifferenceConflict<ConflictCode.ConflictingPersistenceUnit, SchemaItemType.KindOfQuantity> | SchemaDifferenceConflict<ConflictCode.MixinAppliedMustDeriveFromConstraint, SchemaOtherTypes.EntityClassMixin> | SchemaDifferenceConflict<ConflictCode.ConflictingPropertyName, SchemaOtherTypes.Property> | SchemaDifferenceConflict<ConflictCode.ConflictingPropertyKindOfQuantity, SchemaOtherTypes.Property> | SchemaDifferenceConflict<ConflictCode.ConflictingPropertyKindOfQuantityUnit, SchemaOtherTypes.Property> | SchemaDifferenceConflict<ConflictCode.AbstractConstraintMustNarrowBaseConstraints, SchemaOtherTypes.RelationshipConstraint> | SchemaDifferenceConflict<ConflictCode.DerivedConstraintsMustNarrowBaseConstraints, SchemaOtherTypes.RelationshipConstraint> | SchemaDifferenceConflict<ConflictCode.ConstraintClassesDeriveFromAbstractConstraint, SchemaOtherTypes.RelationshipConstraint>;
|
|
82
|
+
export type AnySchemaDifferenceConflict = SchemaDifferenceConflict<ConflictCode.ConflictingItemName, SchemaItemType> | SchemaDifferenceConflict<ConflictCode.ConflictingReferenceAlias, SchemaOtherTypes.SchemaReference> | SchemaDifferenceConflict<ConflictCode.ConflictingReferenceVersion, SchemaOtherTypes.SchemaReference> | SchemaDifferenceConflict<ConflictCode.ConflictingBaseClass, EcClassTypes> | SchemaDifferenceConflict<ConflictCode.RemovingBaseClass, EcClassTypes> | SchemaDifferenceConflict<ConflictCode.SealedBaseClass, EcClassTypes> | SchemaDifferenceConflict<ConflictCode.ConflictingClassModifier, EcClassTypes> | SchemaDifferenceConflict<ConflictCode.ConflictingEnumerationType, SchemaItemType.Enumeration> | SchemaDifferenceConflict<ConflictCode.ConflictingEnumeratorValue, SchemaOtherTypes.Enumerator> | SchemaDifferenceConflict<ConflictCode.ConflictingPersistenceUnit, SchemaItemType.KindOfQuantity> | SchemaDifferenceConflict<ConflictCode.MixinAppliedMustDeriveFromConstraint, SchemaOtherTypes.EntityClassMixin> | SchemaDifferenceConflict<ConflictCode.ConflictingPropertyName, SchemaOtherTypes.Property> | SchemaDifferenceConflict<ConflictCode.ConflictingPropertyKindOfQuantity, SchemaOtherTypes.Property> | SchemaDifferenceConflict<ConflictCode.ConflictingPropertyKindOfQuantityUnit, SchemaOtherTypes.Property> | SchemaDifferenceConflict<ConflictCode.ConflictingFormatUnit, SchemaOtherTypes.FormatUnit> | SchemaDifferenceConflict<ConflictCode.ConflictingFormatUnitPhenomenon, SchemaOtherTypes.FormatUnit> | SchemaDifferenceConflict<ConflictCode.AbstractConstraintMustNarrowBaseConstraints, SchemaOtherTypes.RelationshipConstraint> | SchemaDifferenceConflict<ConflictCode.DerivedConstraintsMustNarrowBaseConstraints, SchemaOtherTypes.RelationshipConstraint> | SchemaDifferenceConflict<ConflictCode.ConstraintClassesDeriveFromAbstractConstraint, SchemaOtherTypes.RelationshipConstraint>;
|
|
81
83
|
export {};
|
|
82
84
|
//# sourceMappingURL=SchemaConflicts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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,EAAE,gBAAgB,CAAC,UAAU,CAAC,GACzF,wBAAwB,CAAC,YAAY,CAAC,+BAA+B,EAAE,gBAAgB,CAAC,UAAU,CAAC,GACnG,wBAAwB,CAAC,YAAY,CAAC,2CAA2C,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,GAC3H,wBAAwB,CAAC,YAAY,CAAC,2CAA2C,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,GAC3H,wBAAwB,CAAC,YAAY,CAAC,6CAA6C,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAC9H"}
|
|
@@ -49,6 +49,8 @@ var ConflictCode;
|
|
|
49
49
|
ConflictCode["ConflictingClassModifier"] = "C-103";
|
|
50
50
|
ConflictCode["ConflictingEnumerationType"] = "C-700";
|
|
51
51
|
ConflictCode["ConflictingEnumeratorValue"] = "C-701";
|
|
52
|
+
ConflictCode["ConflictingFormatUnit"] = "C-800";
|
|
53
|
+
ConflictCode["ConflictingFormatUnitPhenomenon"] = "C-801";
|
|
52
54
|
ConflictCode["ConflictingPersistenceUnit"] = "C-1010";
|
|
53
55
|
ConflictCode["MixinAppliedMustDeriveFromConstraint"] = "C-1100";
|
|
54
56
|
ConflictCode["ConflictingPropertyName"] = "C-1300";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaConflicts.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaConflicts.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAKH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"SchemaConflicts.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaConflicts.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAKH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,IAAY,YA2BX;AA3BD,WAAY,YAAY;IAEtB,6CAA6B,CAAA;IAC7B,mDAAmC,CAAA;IACnC,qDAAqC,CAAA;IAErC,8CAA8B,CAAA;IAC9B,2CAA2B,CAAA;IAC3B,yCAAyB,CAAA;IACzB,kDAAkC,CAAA;IAElC,oDAAoC,CAAA;IACpC,oDAAoC,CAAA;IAEpC,+CAA+B,CAAA;IAC/B,yDAAyC,CAAA;IAEzC,qDAAqC,CAAA;IACrC,+DAA+C,CAAA;IAE/C,kDAAkC,CAAA;IAClC,4DAA4C,CAAA;IAC5C,gEAAgD,CAAA;IAEhD,sEAAsD,CAAA;IACtD,sEAAsD,CAAA;IACtD,wEAAwD,CAAA;AAC1D,CAAC,EA3BW,YAAY,4BAAZ,YAAY,QA2BvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Differencing\n */\n\nimport type { SchemaItemType } from \"@itwin/ecschema-metadata\";\nimport type { AnySchemaDifference, SchemaOtherTypes, SchemaType } from \"./SchemaDifference\";\n\n/**\n * The unique conflicts codes for Schema differencing.\n *\n * To provide meaning to code values, with anticipation\n * of future rules for all current EC Types, the following\n * value ranges should be used:\n *\n * - Schema: 000-099\n * - Class: 100-199\n * - Constant: 200-299\n * - CustomAttribute 300-399\n * - CustomAttributeClass: 400-499\n * - CustomAttributeContainer: 500-599\n * - EntityClass: 600-699\n * - Enumeration: 700-799\n * - Format: 800-899\n * - InvertedUnit: 900-999\n * - KindOfQuantity: 1000-1099\n * - Mixin: 1100-1199\n * - Phenomenon: 1200-1299\n * - Property: 1300-1399\n * - PropertyCategory: 1400-1499\n * - RelationshipClass: 1500-1599\n * - RelationshipConstraint: 1600-1699\n * - StructClass: 1700-1799\n * - Unit: 1800-1899\n * - UnitSystem: 1900-1999\n *\n * @alpha\n */\nexport enum ConflictCode {\n\n ConflictingItemName = \"C-001\",\n ConflictingReferenceAlias = \"C-002\",\n ConflictingReferenceVersion = \"C-003\",\n\n ConflictingBaseClass = \"C-100\",\n RemovingBaseClass = \"C-101\",\n SealedBaseClass = \"C-102\",\n ConflictingClassModifier = \"C-103\",\n\n ConflictingEnumerationType = \"C-700\",\n ConflictingEnumeratorValue = \"C-701\",\n\n ConflictingFormatUnit = \"C-800\",\n ConflictingFormatUnitPhenomenon = \"C-801\",\n\n ConflictingPersistenceUnit = \"C-1010\",\n MixinAppliedMustDeriveFromConstraint = \"C-1100\",\n\n ConflictingPropertyName = \"C-1300\",\n ConflictingPropertyKindOfQuantity = \"C-1301\",\n ConflictingPropertyKindOfQuantityUnit = \"C-1302\",\n\n AbstractConstraintMustNarrowBaseConstraints = \"C-1500\",\n DerivedConstraintsMustNarrowBaseConstraints = \"C-1501\",\n ConstraintClassesDeriveFromAbstractConstraint = \"C-1502\",\n}\n\n/**\n * Defines the interface for a conflict during Schema Differencing. Conflicts were discovered\n * while comparing the changed elements. Conflicts in the whole schema context are not found\n * on that level.\n */\ninterface SchemaDifferenceConflict<TCode extends ConflictCode, TType extends SchemaType, TDifference = Extract<AnySchemaDifference, { schemaType: TType }>> {\n /** The associated schema difference instance */\n readonly difference: TDifference;\n\n /** The unique conflicting code. */\n readonly code: TCode;\n\n /** A description of the conflict. */\n readonly description: string;\n\n /** The value in the source schema. */\n readonly source: unknown;\n\n /** The value in the target schema. */\n readonly target: unknown;\n}\n\n/** Union type of class types */\ntype EcClassTypes = SchemaItemType.CustomAttributeClass | SchemaItemType.EntityClass | SchemaItemType.StructClass | SchemaItemType.Mixin | SchemaItemType.RelationshipClass;\n\n/**\n * Union of all supported schema differencing conflict types.\n * @alpha\n */\nexport type AnySchemaDifferenceConflict =\n SchemaDifferenceConflict<ConflictCode.ConflictingItemName, SchemaItemType> |\n SchemaDifferenceConflict<ConflictCode.ConflictingReferenceAlias, SchemaOtherTypes.SchemaReference> |\n SchemaDifferenceConflict<ConflictCode.ConflictingReferenceVersion, SchemaOtherTypes.SchemaReference> |\n SchemaDifferenceConflict<ConflictCode.ConflictingBaseClass, EcClassTypes> |\n SchemaDifferenceConflict<ConflictCode.RemovingBaseClass, EcClassTypes> |\n SchemaDifferenceConflict<ConflictCode.SealedBaseClass, EcClassTypes> |\n SchemaDifferenceConflict<ConflictCode.ConflictingClassModifier, EcClassTypes> |\n SchemaDifferenceConflict<ConflictCode.ConflictingEnumerationType, SchemaItemType.Enumeration> |\n SchemaDifferenceConflict<ConflictCode.ConflictingEnumeratorValue, SchemaOtherTypes.Enumerator> |\n SchemaDifferenceConflict<ConflictCode.ConflictingPersistenceUnit, SchemaItemType.KindOfQuantity> |\n SchemaDifferenceConflict<ConflictCode.MixinAppliedMustDeriveFromConstraint, SchemaOtherTypes.EntityClassMixin> |\n SchemaDifferenceConflict<ConflictCode.ConflictingPropertyName, SchemaOtherTypes.Property> |\n SchemaDifferenceConflict<ConflictCode.ConflictingPropertyKindOfQuantity, SchemaOtherTypes.Property> |\n SchemaDifferenceConflict<ConflictCode.ConflictingPropertyKindOfQuantityUnit, SchemaOtherTypes.Property> |\n SchemaDifferenceConflict<ConflictCode.ConflictingFormatUnit, SchemaOtherTypes.FormatUnit> |\n SchemaDifferenceConflict<ConflictCode.ConflictingFormatUnitPhenomenon, SchemaOtherTypes.FormatUnit> |\n SchemaDifferenceConflict<ConflictCode.AbstractConstraintMustNarrowBaseConstraints, SchemaOtherTypes.RelationshipConstraint> |\n SchemaDifferenceConflict<ConflictCode.DerivedConstraintsMustNarrowBaseConstraints, SchemaOtherTypes.RelationshipConstraint> |\n SchemaDifferenceConflict<ConflictCode.ConstraintClassesDeriveFromAbstractConstraint, SchemaOtherTypes.RelationshipConstraint>\n;\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Differencing
|
|
3
3
|
*/
|
|
4
4
|
import type { AnyDiagnostic } from "../Validation/Diagnostic";
|
|
5
|
-
import { type AnySchemaItemDifference, type AnySchemaItemPathDifference, type CustomAttributeDifference, type EntityClassMixinDifference, type KindOfQuantityPresentationFormatDifference, type SchemaDifference, type SchemaReferenceDifference } from "./SchemaDifference";
|
|
5
|
+
import { type AnySchemaItemDifference, type AnySchemaItemPathDifference, type CustomAttributeDifference, type EntityClassMixinDifference, type FormatUnitDifference, type KindOfQuantityPresentationFormatDifference, type SchemaDifference, type SchemaReferenceDifference } from "./SchemaDifference";
|
|
6
6
|
/**
|
|
7
7
|
* The SchemaDiagnosticVisitor is a visitor implementation for diagnostic entries
|
|
8
8
|
* from the schema comparer api. Depending on the diagnostic code, the difference
|
|
@@ -11,7 +11,7 @@ import { type AnySchemaItemDifference, type AnySchemaItemPathDifference, type Cu
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class SchemaDiagnosticVisitor {
|
|
13
13
|
readonly schemaDifferences: Array<SchemaDifference | SchemaReferenceDifference>;
|
|
14
|
-
readonly schemaItemDifferences: Array<AnySchemaItemDifference | EntityClassMixinDifference | KindOfQuantityPresentationFormatDifference>;
|
|
14
|
+
readonly schemaItemDifferences: Array<AnySchemaItemDifference | EntityClassMixinDifference | KindOfQuantityPresentationFormatDifference | FormatUnitDifference>;
|
|
15
15
|
readonly schemaItemPathDifferences: Array<AnySchemaItemPathDifference>;
|
|
16
16
|
readonly customAttributeDifferences: Array<CustomAttributeDifference>;
|
|
17
17
|
constructor();
|
|
@@ -35,5 +35,7 @@ export declare class SchemaDiagnosticVisitor {
|
|
|
35
35
|
private visitSchemaReference;
|
|
36
36
|
private visitMissingCustomAttributeInstance;
|
|
37
37
|
private visitMissingPresentationUnit;
|
|
38
|
+
private visitMissingFormatUnit;
|
|
39
|
+
private visitChangedFormatUnitLabel;
|
|
38
40
|
}
|
|
39
41
|
//# sourceMappingURL=SchemaDiagnosticVisitor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaDiagnosticVisitor.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDiagnosticVisitor.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,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kC9B,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,sBAAsB;IA2B9B,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,oBAAoB;IA4B5B,OAAO,CAAC,qBAAqB;IAqB7B,OAAO,CAAC,wBAAwB;IAoBhC,OAAO,CAAC,uCAAuC;IAwB/C,OAAO,CAAC,kCAAkC;IAsC1C,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,mCAAmC;IA8C3C,OAAO,CAAC,4BAA4B;IAqBpC,OAAO,CAAC,sBAAsB;IAkC9B,OAAO,CAAC,2BAA2B;CAmBpC"}
|
|
@@ -72,10 +72,10 @@ class SchemaDiagnosticVisitor {
|
|
|
72
72
|
return this.visitMissingCustomAttributeInstance(diagnostic);
|
|
73
73
|
case SchemaCompareDiagnostics_1.SchemaCompareCodes.PresentationUnitMissing:
|
|
74
74
|
return this.visitMissingPresentationUnit(diagnostic);
|
|
75
|
-
// Currently not handled...
|
|
76
75
|
case SchemaCompareDiagnostics_1.SchemaCompareCodes.FormatUnitMissing:
|
|
76
|
+
return this.visitMissingFormatUnit(diagnostic);
|
|
77
77
|
case SchemaCompareDiagnostics_1.SchemaCompareCodes.UnitLabelOverrideDelta:
|
|
78
|
-
|
|
78
|
+
return this.visitChangedFormatUnitLabel(diagnostic);
|
|
79
79
|
}
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
@@ -381,8 +381,58 @@ class SchemaDiagnosticVisitor {
|
|
|
381
381
|
}
|
|
382
382
|
addEntry.difference.push(presentationFormat.fullName);
|
|
383
383
|
}
|
|
384
|
+
visitMissingFormatUnit(diagnostic) {
|
|
385
|
+
const format = diagnostic.ecDefinition;
|
|
386
|
+
for (let index = this.schemaItemPathDifferences.length - 1; index >= 0; index--) {
|
|
387
|
+
const entry = this.schemaItemPathDifferences[index];
|
|
388
|
+
if (entry.changeType === "modify" && entry.schemaType === SchemaDifference_1.SchemaOtherTypes.FormatUnitLabel && entry.itemName === format.name) {
|
|
389
|
+
this.schemaItemPathDifferences.splice(index, 1);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
let modifyEntry = this.schemaItemDifferences.find((entry) => {
|
|
393
|
+
return entry.changeType === "modify" && entry.schemaType === SchemaDifference_1.SchemaOtherTypes.FormatUnit
|
|
394
|
+
&& entry.itemName === format.name;
|
|
395
|
+
});
|
|
396
|
+
if (modifyEntry === undefined && format.units) {
|
|
397
|
+
modifyEntry = {
|
|
398
|
+
changeType: "modify",
|
|
399
|
+
schemaType: SchemaDifference_1.SchemaOtherTypes.FormatUnit,
|
|
400
|
+
itemName: format.name,
|
|
401
|
+
difference: [],
|
|
402
|
+
};
|
|
403
|
+
for (const [unit, label] of format.units) {
|
|
404
|
+
modifyEntry.difference.push({
|
|
405
|
+
name: unit.fullName,
|
|
406
|
+
label,
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
;
|
|
410
|
+
this.schemaItemDifferences.push(modifyEntry);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
visitChangedFormatUnitLabel(diagnostic) {
|
|
414
|
+
const format = diagnostic.ecDefinition;
|
|
415
|
+
if (this.schemaItemDifferences.find((entry) => {
|
|
416
|
+
return entry.changeType === "modify"
|
|
417
|
+
&& entry.schemaType === SchemaDifference_1.SchemaOtherTypes.FormatUnit && entry.itemName === format.name;
|
|
418
|
+
})) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
const [unit, label] = diagnostic.messageArgs;
|
|
422
|
+
this.schemaItemPathDifferences.push({
|
|
423
|
+
changeType: "modify",
|
|
424
|
+
schemaType: SchemaDifference_1.SchemaOtherTypes.FormatUnitLabel,
|
|
425
|
+
itemName: format.name,
|
|
426
|
+
path: unit.fullName,
|
|
427
|
+
difference: {
|
|
428
|
+
label,
|
|
429
|
+
},
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
;
|
|
384
433
|
}
|
|
385
434
|
exports.SchemaDiagnosticVisitor = SchemaDiagnosticVisitor;
|
|
435
|
+
;
|
|
386
436
|
function isPropertyTypeName(property, propertyName) {
|
|
387
437
|
return (propertyName === "type") ||
|
|
388
438
|
(property.isEnumeration() && propertyName === "enumeration") ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaDiagnosticVisitor.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaDiagnosticVisitor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,qFAA4E;AAC5E,gEAIkC;AAClC,yDAe4B;AAE5B;;;;;GAKG;AACH,MAAa,uBAAuB;IAOlC;QACE,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,yBAAyB,GAAG,EAAE,CAAC;QACpC,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,UAAyB;QACpC,QAAQ,UAAU,CAAC,IAAI,EAAE,CAAC;YACxB,KAAK,6CAAkB,CAAC,WAAW;gBACjC,OAAO,IAAI,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC;YAEvD,KAAK,6CAAkB,CAAC,sBAAsB;gBAC5C,OAAO,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YACtD,KAAK,6CAAkB,CAAC,oBAAoB;gBAC1C,OAAO,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YAEzD,KAAK,6CAAkB,CAAC,iBAAiB;gBACvC,OAAO,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC;YAEjD,KAAK,6CAAkB,CAAC,eAAe,CAAC;YACxC,KAAK,6CAAkB,CAAC,UAAU,CAAC;YACnC,KAAK,6CAAkB,CAAC,aAAa,CAAC;YACtC,KAAK,6CAAkB,CAAC,yBAAyB,CAAC;YAClD,KAA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D,QAAQ,EAAE,GAAG,CAAC,IAAI;gBAClB,UAAU,EAAE,EAAE;aACf,CAAC;YACF,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5C,CAAC;QACD,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;CACF;AA1aD,0DA0aC;AAED,SAAS,kBAAkB,CAAC,QAAkB,EAAE,YAAoB;IAClE,OAAO,CAAC,YAAY,KAAK,MAAM,CAAC;QAC9B,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,YAAY,KAAK,aAAa,CAAC;QAC5D,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,YAAY,KAAK,eAAe,CAAC;QAC5D,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,YAAY,KAAK,aAAa,CAAC;QACvD,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,YAAY,KAAK,mBAAmB,CAAC,CAAC;AACtE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Differencing\n */\n\nimport type { AnyDiagnostic } from \"../Validation/Diagnostic\";\nimport { SchemaCompareCodes } from \"../Validation/SchemaCompareDiagnostics\";\nimport {\n AnyEnumerator, AnyPropertyProps, AnySchemaItem, CustomAttribute, ECClass,\n Enumeration, Format, KindOfQuantity, Mixin, OverrideFormat, Property, PropertyProps,\n RelationshipConstraint, RelationshipConstraintProps, Schema, SchemaItem,\n} from \"@itwin/ecschema-metadata\";\nimport {\n type AnyClassItemDifference,\n type AnySchemaItemDifference,\n type AnySchemaItemPathDifference,\n type ClassPropertyDifference,\n type CustomAttributeDifference,\n type DifferenceType,\n type EntityClassMixinDifference,\n type EnumeratorDifference,\n type KindOfQuantityPresentationFormatDifference,\n type RelationshipConstraintClassDifference,\n type RelationshipConstraintDifference,\n type SchemaDifference,\n SchemaOtherTypes,\n type SchemaReferenceDifference,\n} from \"./SchemaDifference\";\n\n/**\n * The SchemaDiagnosticVisitor is a visitor implementation for diagnostic entries\n * from the schema comparer api. Depending on the diagnostic code, the difference\n * result is build together.\n * @internal\n */\nexport class SchemaDiagnosticVisitor {\n\n public readonly schemaDifferences: Array<SchemaDifference | SchemaReferenceDifference>;\n public readonly schemaItemDifferences: Array<AnySchemaItemDifference | EntityClassMixinDifference | KindOfQuantityPresentationFormatDifference>;\n public readonly schemaItemPathDifferences: Array<AnySchemaItemPathDifference>;\n public readonly customAttributeDifferences: Array<CustomAttributeDifference>;\n\n constructor() {\n this.schemaDifferences = [];\n this.schemaItemDifferences = [];\n this.schemaItemPathDifferences = [];\n this.customAttributeDifferences = [];\n }\n\n /**\n * Visitor function to process the schema change diagnostic object.\n * @internal\n */\n public visit(diagnostic: AnyDiagnostic) {\n switch (diagnostic.code) {\n case SchemaCompareCodes.SchemaDelta:\n return this.visitChangedSchemaProperties(diagnostic);\n\n case SchemaCompareCodes.SchemaReferenceMissing:\n return this.visitSchemaReference(diagnostic, \"add\");\n case SchemaCompareCodes.SchemaReferenceDelta:\n return this.visitSchemaReference(diagnostic, \"modify\");\n\n case SchemaCompareCodes.SchemaItemMissing:\n return this.visitMissingSchemaItem(diagnostic);\n\n case SchemaCompareCodes.SchemaItemDelta:\n case SchemaCompareCodes.ClassDelta:\n case SchemaCompareCodes.ConstantDelta:\n case SchemaCompareCodes.CustomAttributeClassDelta:\n case SchemaCompareCodes.FormatDelta:\n case SchemaCompareCodes.InvertedUnitDelta:\n case SchemaCompareCodes.KoqDelta:\n case SchemaCompareCodes.MixinDelta:\n case SchemaCompareCodes.PhenomenonDelta:\n case SchemaCompareCodes.PropertyCategoryDelta:\n case SchemaCompareCodes.RelationshipDelta:\n case SchemaCompareCodes.UnitDelta:\n case SchemaCompareCodes.EnumerationDelta:\n return this.visitChangedSchemaItem(diagnostic);\n\n case SchemaCompareCodes.EnumeratorDelta:\n return this.visitChangedEnumerator(diagnostic);\n case SchemaCompareCodes.EnumeratorMissing:\n return this.visitMissingEnumerator(diagnostic);\n\n case SchemaCompareCodes.BaseClassDelta:\n return this.visitMissingBaseClass(diagnostic);\n case SchemaCompareCodes.EntityMixinMissing:\n return this.visitMissingMixinOnClass(diagnostic);\n case SchemaCompareCodes.PropertyDelta:\n return this.visitChangedProperty(diagnostic);\n case SchemaCompareCodes.PropertyMissing:\n return this.visitMissingProperty(diagnostic);\n\n case SchemaCompareCodes.RelationshipConstraintClassMissing:\n return this.visitMissingRelationshipConstraintClass(diagnostic);\n case SchemaCompareCodes.RelationshipConstraintDelta:\n return this.visitChangedRelationshipConstraint(diagnostic);\n\n case SchemaCompareCodes.CustomAttributeInstanceClassMissing:\n return this.visitMissingCustomAttributeInstance(diagnostic);\n\n case SchemaCompareCodes.PresentationUnitMissing:\n return this.visitMissingPresentationUnit(diagnostic);\n\n // Currently not handled...\n case SchemaCompareCodes.FormatUnitMissing:\n case SchemaCompareCodes.UnitLabelOverrideDelta:\n break;\n }\n return;\n }\n\n private visitChangedSchemaProperties(diagnostic: AnyDiagnostic) {\n let modifyEntry = this.schemaDifferences.find((entry): entry is SchemaDifference => {\n return entry.changeType === \"modify\" && entry.schemaType === SchemaOtherTypes.Schema;\n });\n\n let hasChanges = false;\n let addEntry = false;\n if (modifyEntry === undefined) {\n addEntry = true;\n modifyEntry = {\n changeType: \"modify\",\n schemaType: SchemaOtherTypes.Schema,\n difference: {},\n };\n }\n\n // Only label and description are taken from the source schema. If the schema name or alias\n // differs, those are ignored for now.\n const [propertyName, propertyValue] = diagnostic.messageArgs as [string, any];\n if (propertyName === \"label\") {\n modifyEntry.difference.label = propertyValue;\n hasChanges = true;\n }\n if (propertyName === \"description\") {\n modifyEntry.difference.description = propertyValue;\n hasChanges = true;\n }\n\n if (addEntry && hasChanges) {\n this.schemaDifferences.push(modifyEntry);\n }\n }\n\n private visitMissingSchemaItem(diagnostic: AnyDiagnostic) {\n const schemaItem = diagnostic.ecDefinition as AnySchemaItem;\n\n this.schemaItemDifferences.push({\n changeType: \"add\",\n schemaType: schemaItem.schemaItemType,\n itemName: schemaItem.name,\n difference: schemaItem.toJSON(),\n });\n }\n\n private visitChangedSchemaItem(diagnostic: AnyDiagnostic) {\n const schemaItem = diagnostic.ecDefinition as AnySchemaItem;\n const [propertyName, sourceValue, _targetValue] = diagnostic.messageArgs as [string, unknown, unknown];\n if (propertyName === \"schemaItemType\") {\n // If the schema item type is different, the whole item is added as \"new\" item. The\n // difference validator will then figure whether there is a conflict with items of\n // of the same name.\n return this.visitMissingSchemaItem(diagnostic);\n }\n\n if (sourceValue === undefined) {\n return;\n }\n\n let modifyEntry = this.schemaItemDifferences.find((entry): entry is AnySchemaItemDifference => {\n return entry.changeType === \"modify\" && entry.itemName === schemaItem.name;\n });\n\n if (modifyEntry === undefined) {\n modifyEntry = {\n changeType: \"modify\",\n schemaType: schemaItem.schemaItemType,\n itemName: schemaItem.name,\n difference: {},\n } as AnySchemaItemDifference;\n this.schemaItemDifferences.push(modifyEntry);\n }\n\n // TODO: Since propertyName is type of string, the compiler complains about accepting\n // an unspecific string as property indexer. Casted to any as short term fix but that\n // needs to be handled better in future.\n (modifyEntry.difference as any)[propertyName] = sourceValue;\n }\n\n private visitMissingEnumerator(diagnostic: AnyDiagnostic) {\n const enumeration = diagnostic.ecDefinition as Enumeration;\n const [enumerator] = diagnostic.messageArgs as [AnyEnumerator];\n this.schemaItemPathDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.Enumerator,\n itemName: enumeration.name,\n path: \"$enumerators\",\n difference: enumerator,\n });\n }\n\n private lookupEnumeratorEntry(changeType: DifferenceType, item: string, enumeratorName: string) {\n return this.schemaItemPathDifferences.find((change) => {\n return change.changeType === changeType\n && change.schemaType === SchemaOtherTypes.Enumerator\n && change.itemName === item\n && change.path === \"$enumerators\"\n && change.difference.name === enumeratorName;\n });\n }\n\n private visitChangedEnumerator(diagnostic: AnyDiagnostic) {\n const enumeration = diagnostic.ecDefinition as Enumeration;\n const [enumerator, propertyName, sourceValue] = diagnostic.messageArgs as [AnyEnumerator, keyof AnyEnumerator, any];\n if (this.lookupEnumeratorEntry(\"add\", enumeration.name, enumerator.name)) {\n return;\n }\n\n let modifyEntry = this.schemaItemPathDifferences.find((entry): entry is EnumeratorDifference => {\n return entry.changeType === \"modify\" && entry.schemaType === SchemaOtherTypes.Enumerator && entry.itemName === enumeration.name && entry.path === enumerator.name;\n });\n\n if (modifyEntry === undefined) {\n modifyEntry = {\n changeType: \"modify\",\n schemaType: SchemaOtherTypes.Enumerator,\n itemName: enumeration.name,\n path: enumerator.name,\n difference: {},\n };\n this.schemaItemPathDifferences.push(modifyEntry);\n }\n\n if (sourceValue !== undefined) {\n modifyEntry.difference[propertyName] = sourceValue;\n }\n }\n\n private visitMissingProperty(diagnostic: AnyDiagnostic) {\n const property = diagnostic.ecDefinition as Property;\n this.schemaItemPathDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.Property,\n itemName: property.class.name,\n path: property.name,\n difference: property.toJSON() as AnyPropertyProps,\n });\n }\n\n private visitChangedProperty(diagnostic: AnyDiagnostic) {\n const property = diagnostic.ecDefinition as Property;\n const [propertyName, sourceValue] = diagnostic.messageArgs as [keyof PropertyProps, any, any];\n\n if (isPropertyTypeName(property, propertyName)) {\n return this.visitMissingProperty(diagnostic);\n }\n\n let modifyEntry = this.schemaItemPathDifferences.find((entry): entry is ClassPropertyDifference => {\n return entry.changeType === \"modify\" && entry.schemaType === SchemaOtherTypes.Property && entry.itemName === property.class.name && entry.path === property.name;\n });\n\n if (modifyEntry === undefined) {\n modifyEntry = {\n changeType: \"modify\",\n schemaType: SchemaOtherTypes.Property,\n itemName: property.class.name,\n path: property.name,\n difference: {},\n };\n this.schemaItemPathDifferences.push(modifyEntry);\n }\n\n if (propertyName !== \"name\") {\n modifyEntry.difference[propertyName] = sourceValue;\n }\n }\n\n private visitMissingBaseClass(diagnostic: AnyDiagnostic) {\n const ecClass = diagnostic.ecDefinition as ECClass;\n const [sourceBaseClass] = diagnostic.messageArgs as [ECClass, ECClass];\n\n let modifyEntry = this.schemaItemDifferences.find((entry): entry is AnyClassItemDifference => {\n return entry.changeType === \"modify\" && entry.schemaType === ecClass.schemaItemType && entry.itemName === ecClass.name;\n });\n\n if (modifyEntry === undefined) {\n modifyEntry = {\n changeType: \"modify\",\n schemaType: ecClass.schemaItemType,\n itemName: ecClass.name,\n difference: {},\n } as AnyClassItemDifference;\n this.schemaItemDifferences.push(modifyEntry);\n }\n\n modifyEntry.difference.baseClass = sourceBaseClass !== undefined ? sourceBaseClass.fullName : undefined;\n }\n\n private visitMissingMixinOnClass(diagnostic: AnyDiagnostic) {\n const ecClass = diagnostic.ecDefinition as ECClass;\n const [mixin] = diagnostic.messageArgs as [Mixin];\n\n let addEntry = this.schemaItemDifferences.find((entry): entry is EntityClassMixinDifference => {\n return entry.changeType === \"add\" && entry.schemaType === SchemaOtherTypes.EntityClassMixin && entry.itemName === ecClass.name;\n });\n\n if (addEntry === undefined) {\n addEntry = {\n changeType: \"add\",\n schemaType: SchemaOtherTypes.EntityClassMixin,\n itemName: ecClass.name,\n difference: [],\n };\n this.schemaItemDifferences.push(addEntry);\n }\n addEntry.difference.push(mixin.fullName);\n }\n\n private visitMissingRelationshipConstraintClass(diagnostic: AnyDiagnostic) {\n const constraint = diagnostic.ecDefinition as RelationshipConstraint;\n const className = constraint.relationshipClass.name;\n const constraintPath = constraint.isSource ? \"$source\" : \"$target\";\n\n let addEntry = this.schemaItemPathDifferences.find((entry): entry is RelationshipConstraintClassDifference => {\n return entry.changeType === \"add\" && entry.schemaType === SchemaOtherTypes.RelationshipConstraintClass, entry.itemName === className && entry.path === constraintPath;\n });\n\n if (!addEntry) {\n addEntry = {\n changeType: \"add\",\n schemaType: SchemaOtherTypes.RelationshipConstraintClass,\n itemName: className,\n path: constraintPath,\n difference: [],\n };\n this.schemaItemPathDifferences.push(addEntry);\n }\n\n const [constraintClass] = diagnostic.messageArgs as [ECClass];\n addEntry.difference.push(constraintClass.fullName);\n }\n\n private visitChangedRelationshipConstraint(diagnostic: AnyDiagnostic) {\n const constraint = diagnostic.ecDefinition as RelationshipConstraint;\n const className = constraint.relationshipClass.name;\n const constraintPath = constraint.isSource ? \"$source\" : \"$target\";\n if (this.schemaItemDifferences.find((entry) => entry.changeType === \"add\" && entry.itemName === className)) {\n return;\n }\n\n let modifyEntry = this.schemaItemPathDifferences.find((entry): entry is RelationshipConstraintDifference => {\n return entry.changeType === \"modify\" && entry.schemaType === SchemaOtherTypes.RelationshipConstraint && entry.itemName === className && entry.path === constraintPath;\n });\n\n if (modifyEntry === undefined) {\n modifyEntry = {\n changeType: \"modify\",\n schemaType: SchemaOtherTypes.RelationshipConstraint,\n itemName: className,\n path: constraintPath,\n difference: {},\n };\n this.schemaItemPathDifferences.push(modifyEntry);\n }\n\n const [propertyName, propertyValue] = diagnostic.messageArgs as [keyof RelationshipConstraintProps, any];\n if (propertyName === \"abstractConstraint\" && propertyValue !== undefined) {\n modifyEntry.difference.abstractConstraint = propertyValue;\n }\n if (propertyName === \"multiplicity\" && propertyValue !== undefined) {\n modifyEntry.difference.multiplicity = propertyValue;\n }\n if (propertyName === \"polymorphic\" && propertyValue !== undefined) {\n modifyEntry.difference.polymorphic = propertyValue;\n }\n if (propertyName === \"roleLabel\" && propertyValue !== undefined) {\n modifyEntry.difference.roleLabel = propertyValue;\n }\n }\n\n private visitSchemaReference(diagnostic: AnyDiagnostic, changeType: DifferenceType) {\n const [referencedSchema] = diagnostic.messageArgs as [Schema];\n this.schemaDifferences.push({\n changeType,\n schemaType: SchemaOtherTypes.SchemaReference,\n difference: {\n name: referencedSchema.name,\n version: referencedSchema.schemaKey.version.toString(),\n },\n });\n }\n\n private visitMissingCustomAttributeInstance(diagnostic: AnyDiagnostic) {\n const [customAttribute] = diagnostic.messageArgs as [CustomAttribute];\n const ecType = diagnostic.ecDefinition;\n if (Schema.isSchema(ecType)) {\n return this.customAttributeDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.CustomAttributeInstance,\n appliedTo: \"Schema\",\n difference: customAttribute,\n });\n }\n\n if (SchemaItem.isSchemaItem(ecType)) {\n return this.customAttributeDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.CustomAttributeInstance,\n appliedTo: \"SchemaItem\",\n itemName: ecType.name,\n difference: customAttribute,\n });\n }\n\n if (Property.isProperty(ecType)) {\n return this.customAttributeDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.CustomAttributeInstance,\n appliedTo: \"Property\",\n itemName: ecType.class.name,\n path: ecType.name,\n difference: customAttribute,\n });\n }\n\n if (RelationshipConstraint.isRelationshipConstraint(ecType)) {\n return this.customAttributeDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.CustomAttributeInstance,\n appliedTo: \"RelationshipConstraint\",\n itemName: ecType.relationshipClass.name,\n path: ecType.isSource ? \"$source\" : \"$target\",\n difference: customAttribute,\n });\n }\n return;\n }\n\n private visitMissingPresentationUnit(diagnostic: AnyDiagnostic) {\n const koq = diagnostic.ecDefinition as KindOfQuantity;\n const [presentationFormat] = diagnostic.messageArgs as [Format | OverrideFormat];\n\n let addEntry = this.schemaItemDifferences.find((entry): entry is KindOfQuantityPresentationFormatDifference => {\n return entry.changeType === \"add\" && entry.schemaType === SchemaOtherTypes.KindOfQuantityPresentationFormat\n && entry.itemName === koq.name;\n });\n\n if (addEntry === undefined) {\n addEntry = {\n changeType: \"add\",\n schemaType: SchemaOtherTypes.KindOfQuantityPresentationFormat,\n itemName: koq.name,\n difference: [],\n };\n this.schemaItemDifferences.push(addEntry);\n }\n addEntry.difference.push(presentationFormat.fullName);\n }\n}\n\nfunction isPropertyTypeName(property: Property, propertyName: string) {\n return (propertyName === \"type\") ||\n (property.isEnumeration() && propertyName === \"enumeration\") ||\n (property.isPrimitive() && propertyName === \"primitiveType\") ||\n (property.isStruct() && propertyName === \"structClass\") ||\n (property.isNavigation() && propertyName === \"relationshipClass\");\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SchemaDiagnosticVisitor.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaDiagnosticVisitor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,qFAA4E;AAC5E,gEAIkC;AAClC,yDAgB4B;AAE5B;;;;;GAKG;AACH,MAAa,uBAAuB;IAUlC;QACE,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,yBAAyB,GAAG,EAAE,CAAC;QACpC,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,UAAyB;QACpC,QAAQ,UAAU,CAAC,IAAI,EAAE,CAAC;YACxB,KAAK,6CAAkB,CAAC,WAAW;gBACjC,OAAO,IAAI,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC;YAEvD,KAAK,6CAAkB,CAAC,sBAAsB;gBAC5C,OAAO,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YACtD,KAAK,6CAAkB,CAAC,oBAAoB;gBAC1C,OAAO,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YAEzD,KAAK,6CAAkB,CAAC,iBAAiB;gBACvC,OAAO,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC;YAEjD,KAAK,6CAAkB,CAAC,eAAe,CAAC;YACxC,KAAK,6CAAkB,CAAC,UAAU,CAAC;YACnC,KAAK,6CAAkB,CAAC,aAAa,CAAC;YACtC,KAAK,6CAAkB,CAAC,yBAAyB,CAAC;YAClD,KAAK,6CAAkB,CAAC,WAAW,CAAC;YACpC,KAAK,6CAAkB,CAAC,iBAAiB,CAAC;YAC1C,KAAK,6CAAkB,CAAC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,IAAI,YAAY,KAAK,eAAe,CAAC;QAC5D,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,YAAY,KAAK,aAAa,CAAC;QACvD,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,YAAY,KAAK,mBAAmB,CAAC,CAAC;AACtE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Differencing\n */\n\nimport type { AnyDiagnostic } from \"../Validation/Diagnostic\";\nimport { SchemaCompareCodes } from \"../Validation/SchemaCompareDiagnostics\";\nimport {\n AnyEnumerator, AnyPropertyProps, AnySchemaItem, CustomAttribute, ECClass,\n Enumeration, Format, InvertedUnit, KindOfQuantity, Mixin, OverrideFormat, Property, PropertyProps,\n RelationshipConstraint, RelationshipConstraintProps, Schema, SchemaItem, Unit,\n} from \"@itwin/ecschema-metadata\";\nimport {\n type AnyClassItemDifference,\n type AnySchemaItemDifference,\n type AnySchemaItemPathDifference,\n type ClassPropertyDifference,\n type CustomAttributeDifference,\n type DifferenceType,\n type EntityClassMixinDifference,\n type EnumeratorDifference,\n type FormatUnitDifference,\n type KindOfQuantityPresentationFormatDifference,\n type RelationshipConstraintClassDifference,\n type RelationshipConstraintDifference,\n type SchemaDifference,\n SchemaOtherTypes,\n type SchemaReferenceDifference,\n} from \"./SchemaDifference\";\n\n/**\n * The SchemaDiagnosticVisitor is a visitor implementation for diagnostic entries\n * from the schema comparer api. Depending on the diagnostic code, the difference\n * result is build together.\n * @internal\n */\nexport class SchemaDiagnosticVisitor {\n\n public readonly schemaDifferences: Array<SchemaDifference | SchemaReferenceDifference>;\n public readonly schemaItemDifferences: Array<AnySchemaItemDifference \n | EntityClassMixinDifference \n | KindOfQuantityPresentationFormatDifference \n | FormatUnitDifference>;\n public readonly schemaItemPathDifferences: Array<AnySchemaItemPathDifference>;\n public readonly customAttributeDifferences: Array<CustomAttributeDifference>;\n\n constructor() {\n this.schemaDifferences = [];\n this.schemaItemDifferences = [];\n this.schemaItemPathDifferences = [];\n this.customAttributeDifferences = [];\n }\n\n /**\n * Visitor function to process the schema change diagnostic object.\n * @internal\n */\n public visit(diagnostic: AnyDiagnostic) {\n switch (diagnostic.code) {\n case SchemaCompareCodes.SchemaDelta:\n return this.visitChangedSchemaProperties(diagnostic);\n\n case SchemaCompareCodes.SchemaReferenceMissing:\n return this.visitSchemaReference(diagnostic, \"add\");\n case SchemaCompareCodes.SchemaReferenceDelta:\n return this.visitSchemaReference(diagnostic, \"modify\");\n\n case SchemaCompareCodes.SchemaItemMissing:\n return this.visitMissingSchemaItem(diagnostic);\n\n case SchemaCompareCodes.SchemaItemDelta:\n case SchemaCompareCodes.ClassDelta:\n case SchemaCompareCodes.ConstantDelta:\n case SchemaCompareCodes.CustomAttributeClassDelta:\n case SchemaCompareCodes.FormatDelta:\n case SchemaCompareCodes.InvertedUnitDelta:\n case SchemaCompareCodes.KoqDelta:\n case SchemaCompareCodes.MixinDelta:\n case SchemaCompareCodes.PhenomenonDelta:\n case SchemaCompareCodes.PropertyCategoryDelta:\n case SchemaCompareCodes.RelationshipDelta:\n case SchemaCompareCodes.UnitDelta:\n case SchemaCompareCodes.EnumerationDelta:\n return this.visitChangedSchemaItem(diagnostic);\n\n case SchemaCompareCodes.EnumeratorDelta:\n return this.visitChangedEnumerator(diagnostic);\n case SchemaCompareCodes.EnumeratorMissing:\n return this.visitMissingEnumerator(diagnostic);\n\n case SchemaCompareCodes.BaseClassDelta:\n return this.visitMissingBaseClass(diagnostic);\n case SchemaCompareCodes.EntityMixinMissing:\n return this.visitMissingMixinOnClass(diagnostic);\n case SchemaCompareCodes.PropertyDelta:\n return this.visitChangedProperty(diagnostic);\n case SchemaCompareCodes.PropertyMissing:\n return this.visitMissingProperty(diagnostic);\n\n case SchemaCompareCodes.RelationshipConstraintClassMissing:\n return this.visitMissingRelationshipConstraintClass(diagnostic);\n case SchemaCompareCodes.RelationshipConstraintDelta:\n return this.visitChangedRelationshipConstraint(diagnostic);\n\n case SchemaCompareCodes.CustomAttributeInstanceClassMissing:\n return this.visitMissingCustomAttributeInstance(diagnostic);\n\n case SchemaCompareCodes.PresentationUnitMissing:\n return this.visitMissingPresentationUnit(diagnostic);\n\n case SchemaCompareCodes.FormatUnitMissing:\n return this.visitMissingFormatUnit(diagnostic);\n case SchemaCompareCodes.UnitLabelOverrideDelta:\n return this.visitChangedFormatUnitLabel(diagnostic);\n }\n return;\n }\n\n private visitChangedSchemaProperties(diagnostic: AnyDiagnostic) {\n let modifyEntry = this.schemaDifferences.find((entry): entry is SchemaDifference => {\n return entry.changeType === \"modify\" && entry.schemaType === SchemaOtherTypes.Schema;\n });\n\n let hasChanges = false;\n let addEntry = false;\n if (modifyEntry === undefined) {\n addEntry = true;\n modifyEntry = {\n changeType: \"modify\",\n schemaType: SchemaOtherTypes.Schema,\n difference: {},\n };\n }\n\n // Only label and description are taken from the source schema. If the schema name or alias\n // differs, those are ignored for now.\n const [propertyName, propertyValue] = diagnostic.messageArgs as [string, any];\n if (propertyName === \"label\") {\n modifyEntry.difference.label = propertyValue;\n hasChanges = true;\n }\n if (propertyName === \"description\") {\n modifyEntry.difference.description = propertyValue;\n hasChanges = true;\n }\n\n if (addEntry && hasChanges) {\n this.schemaDifferences.push(modifyEntry);\n }\n }\n\n private visitMissingSchemaItem(diagnostic: AnyDiagnostic) {\n const schemaItem = diagnostic.ecDefinition as AnySchemaItem;\n\n this.schemaItemDifferences.push({\n changeType: \"add\",\n schemaType: schemaItem.schemaItemType,\n itemName: schemaItem.name,\n difference: schemaItem.toJSON(),\n });\n }\n\n private visitChangedSchemaItem(diagnostic: AnyDiagnostic) {\n const schemaItem = diagnostic.ecDefinition as AnySchemaItem;\n const [propertyName, sourceValue, _targetValue] = diagnostic.messageArgs as [string, unknown, unknown];\n if (propertyName === \"schemaItemType\") {\n // If the schema item type is different, the whole item is added as \"new\" item. The\n // difference validator will then figure whether there is a conflict with items of\n // of the same name.\n return this.visitMissingSchemaItem(diagnostic);\n }\n\n if (sourceValue === undefined) {\n return;\n }\n\n let modifyEntry = this.schemaItemDifferences.find((entry): entry is AnySchemaItemDifference => {\n return entry.changeType === \"modify\" && entry.itemName === schemaItem.name;\n });\n\n if (modifyEntry === undefined) {\n modifyEntry = {\n changeType: \"modify\",\n schemaType: schemaItem.schemaItemType,\n itemName: schemaItem.name,\n difference: {},\n } as AnySchemaItemDifference;\n this.schemaItemDifferences.push(modifyEntry);\n }\n\n // TODO: Since propertyName is type of string, the compiler complains about accepting\n // an unspecific string as property indexer. Casted to any as short term fix but that\n // needs to be handled better in future.\n (modifyEntry.difference as any)[propertyName] = sourceValue;\n }\n\n private visitMissingEnumerator(diagnostic: AnyDiagnostic) {\n const enumeration = diagnostic.ecDefinition as Enumeration;\n const [enumerator] = diagnostic.messageArgs as [AnyEnumerator];\n this.schemaItemPathDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.Enumerator,\n itemName: enumeration.name,\n path: \"$enumerators\",\n difference: enumerator,\n });\n }\n\n private lookupEnumeratorEntry(changeType: DifferenceType, item: string, enumeratorName: string) {\n return this.schemaItemPathDifferences.find((change) => {\n return change.changeType === changeType\n && change.schemaType === SchemaOtherTypes.Enumerator\n && change.itemName === item\n && change.path === \"$enumerators\"\n && change.difference.name === enumeratorName;\n });\n }\n\n private visitChangedEnumerator(diagnostic: AnyDiagnostic) {\n const enumeration = diagnostic.ecDefinition as Enumeration;\n const [enumerator, propertyName, sourceValue] = diagnostic.messageArgs as [AnyEnumerator, keyof AnyEnumerator, any];\n if (this.lookupEnumeratorEntry(\"add\", enumeration.name, enumerator.name)) {\n return;\n }\n\n let modifyEntry = this.schemaItemPathDifferences.find((entry): entry is EnumeratorDifference => {\n return entry.changeType === \"modify\" && entry.schemaType === SchemaOtherTypes.Enumerator && entry.itemName === enumeration.name && entry.path === enumerator.name;\n });\n\n if (modifyEntry === undefined) {\n modifyEntry = {\n changeType: \"modify\",\n schemaType: SchemaOtherTypes.Enumerator,\n itemName: enumeration.name,\n path: enumerator.name,\n difference: {},\n };\n this.schemaItemPathDifferences.push(modifyEntry);\n }\n\n if (sourceValue !== undefined) {\n modifyEntry.difference[propertyName] = sourceValue;\n }\n }\n\n private visitMissingProperty(diagnostic: AnyDiagnostic) {\n const property = diagnostic.ecDefinition as Property;\n this.schemaItemPathDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.Property,\n itemName: property.class.name,\n path: property.name,\n difference: property.toJSON() as AnyPropertyProps,\n });\n }\n\n private visitChangedProperty(diagnostic: AnyDiagnostic) {\n const property = diagnostic.ecDefinition as Property;\n const [propertyName, sourceValue] = diagnostic.messageArgs as [keyof PropertyProps, any, any];\n\n if (isPropertyTypeName(property, propertyName)) {\n return this.visitMissingProperty(diagnostic);\n }\n\n let modifyEntry = this.schemaItemPathDifferences.find((entry): entry is ClassPropertyDifference => {\n return entry.changeType === \"modify\" && entry.schemaType === SchemaOtherTypes.Property && entry.itemName === property.class.name && entry.path === property.name;\n });\n\n if (modifyEntry === undefined) {\n modifyEntry = {\n changeType: \"modify\",\n schemaType: SchemaOtherTypes.Property,\n itemName: property.class.name,\n path: property.name,\n difference: {},\n };\n this.schemaItemPathDifferences.push(modifyEntry);\n }\n\n if (propertyName !== \"name\") {\n modifyEntry.difference[propertyName] = sourceValue;\n }\n }\n\n private visitMissingBaseClass(diagnostic: AnyDiagnostic) {\n const ecClass = diagnostic.ecDefinition as ECClass;\n const [sourceBaseClass] = diagnostic.messageArgs as [ECClass, ECClass];\n\n let modifyEntry = this.schemaItemDifferences.find((entry): entry is AnyClassItemDifference => {\n return entry.changeType === \"modify\" && entry.schemaType === ecClass.schemaItemType && entry.itemName === ecClass.name;\n });\n\n if (modifyEntry === undefined) {\n modifyEntry = {\n changeType: \"modify\",\n schemaType: ecClass.schemaItemType,\n itemName: ecClass.name,\n difference: {},\n } as AnyClassItemDifference;\n this.schemaItemDifferences.push(modifyEntry);\n }\n\n modifyEntry.difference.baseClass = sourceBaseClass !== undefined ? sourceBaseClass.fullName : undefined;\n }\n\n private visitMissingMixinOnClass(diagnostic: AnyDiagnostic) {\n const ecClass = diagnostic.ecDefinition as ECClass;\n const [mixin] = diagnostic.messageArgs as [Mixin];\n\n let addEntry = this.schemaItemDifferences.find((entry): entry is EntityClassMixinDifference => {\n return entry.changeType === \"add\" && entry.schemaType === SchemaOtherTypes.EntityClassMixin && entry.itemName === ecClass.name;\n });\n\n if (addEntry === undefined) {\n addEntry = {\n changeType: \"add\",\n schemaType: SchemaOtherTypes.EntityClassMixin,\n itemName: ecClass.name,\n difference: [],\n };\n this.schemaItemDifferences.push(addEntry);\n }\n addEntry.difference.push(mixin.fullName);\n }\n\n private visitMissingRelationshipConstraintClass(diagnostic: AnyDiagnostic) {\n const constraint = diagnostic.ecDefinition as RelationshipConstraint;\n const className = constraint.relationshipClass.name;\n const constraintPath = constraint.isSource ? \"$source\" : \"$target\";\n\n let addEntry = this.schemaItemPathDifferences.find((entry): entry is RelationshipConstraintClassDifference => {\n return entry.changeType === \"add\" && entry.schemaType === SchemaOtherTypes.RelationshipConstraintClass, entry.itemName === className && entry.path === constraintPath;\n });\n\n if (!addEntry) {\n addEntry = {\n changeType: \"add\",\n schemaType: SchemaOtherTypes.RelationshipConstraintClass,\n itemName: className,\n path: constraintPath,\n difference: [],\n };\n this.schemaItemPathDifferences.push(addEntry);\n }\n\n const [constraintClass] = diagnostic.messageArgs as [ECClass];\n addEntry.difference.push(constraintClass.fullName);\n }\n\n private visitChangedRelationshipConstraint(diagnostic: AnyDiagnostic) {\n const constraint = diagnostic.ecDefinition as RelationshipConstraint;\n const className = constraint.relationshipClass.name;\n const constraintPath = constraint.isSource ? \"$source\" : \"$target\";\n if (this.schemaItemDifferences.find((entry) => entry.changeType === \"add\" && entry.itemName === className)) {\n return;\n }\n\n let modifyEntry = this.schemaItemPathDifferences.find((entry): entry is RelationshipConstraintDifference => {\n return entry.changeType === \"modify\" && entry.schemaType === SchemaOtherTypes.RelationshipConstraint && entry.itemName === className && entry.path === constraintPath;\n });\n\n if (modifyEntry === undefined) {\n modifyEntry = {\n changeType: \"modify\",\n schemaType: SchemaOtherTypes.RelationshipConstraint,\n itemName: className,\n path: constraintPath,\n difference: {},\n };\n this.schemaItemPathDifferences.push(modifyEntry);\n }\n\n const [propertyName, propertyValue] = diagnostic.messageArgs as [keyof RelationshipConstraintProps, any];\n if (propertyName === \"abstractConstraint\" && propertyValue !== undefined) {\n modifyEntry.difference.abstractConstraint = propertyValue;\n }\n if (propertyName === \"multiplicity\" && propertyValue !== undefined) {\n modifyEntry.difference.multiplicity = propertyValue;\n }\n if (propertyName === \"polymorphic\" && propertyValue !== undefined) {\n modifyEntry.difference.polymorphic = propertyValue;\n }\n if (propertyName === \"roleLabel\" && propertyValue !== undefined) {\n modifyEntry.difference.roleLabel = propertyValue;\n }\n }\n\n private visitSchemaReference(diagnostic: AnyDiagnostic, changeType: DifferenceType) {\n const [referencedSchema] = diagnostic.messageArgs as [Schema];\n this.schemaDifferences.push({\n changeType,\n schemaType: SchemaOtherTypes.SchemaReference,\n difference: {\n name: referencedSchema.name,\n version: referencedSchema.schemaKey.version.toString(),\n },\n });\n }\n\n private visitMissingCustomAttributeInstance(diagnostic: AnyDiagnostic) {\n const [customAttribute] = diagnostic.messageArgs as [CustomAttribute];\n const ecType = diagnostic.ecDefinition;\n if (Schema.isSchema(ecType)) {\n return this.customAttributeDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.CustomAttributeInstance,\n appliedTo: \"Schema\",\n difference: customAttribute,\n });\n }\n\n if (SchemaItem.isSchemaItem(ecType)) {\n return this.customAttributeDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.CustomAttributeInstance,\n appliedTo: \"SchemaItem\",\n itemName: ecType.name,\n difference: customAttribute,\n });\n }\n\n if (Property.isProperty(ecType)) {\n return this.customAttributeDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.CustomAttributeInstance,\n appliedTo: \"Property\",\n itemName: ecType.class.name,\n path: ecType.name,\n difference: customAttribute,\n });\n }\n\n if (RelationshipConstraint.isRelationshipConstraint(ecType)) {\n return this.customAttributeDifferences.push({\n changeType: \"add\",\n schemaType: SchemaOtherTypes.CustomAttributeInstance,\n appliedTo: \"RelationshipConstraint\",\n itemName: ecType.relationshipClass.name,\n path: ecType.isSource ? \"$source\" : \"$target\",\n difference: customAttribute,\n });\n }\n return;\n }\n\n private visitMissingPresentationUnit(diagnostic: AnyDiagnostic) {\n const koq = diagnostic.ecDefinition as KindOfQuantity;\n const [presentationFormat] = diagnostic.messageArgs as [Format | OverrideFormat];\n\n let addEntry = this.schemaItemDifferences.find((entry): entry is KindOfQuantityPresentationFormatDifference => {\n return entry.changeType === \"add\" && entry.schemaType === SchemaOtherTypes.KindOfQuantityPresentationFormat\n && entry.itemName === koq.name;\n });\n\n if (addEntry === undefined) {\n addEntry = {\n changeType: \"add\",\n schemaType: SchemaOtherTypes.KindOfQuantityPresentationFormat,\n itemName: koq.name,\n difference: [],\n };\n this.schemaItemDifferences.push(addEntry);\n }\n addEntry.difference.push(presentationFormat.fullName);\n }\n\n private visitMissingFormatUnit(diagnostic: AnyDiagnostic) {\n const format = diagnostic.ecDefinition as Format;\n\n for (let index = this.schemaItemPathDifferences.length-1; index>=0; index--) {\n const entry = this.schemaItemPathDifferences[index];\n if (entry.changeType === \"modify\" && entry.schemaType === SchemaOtherTypes.FormatUnitLabel && entry.itemName === format.name) {\n this.schemaItemPathDifferences.splice(index, 1);\n }\n }\n\n let modifyEntry = this.schemaItemDifferences.find((entry): entry is FormatUnitDifference => {\n return entry.changeType === \"modify\" && entry.schemaType === SchemaOtherTypes.FormatUnit\n && entry.itemName === format.name;\n });\n\n if (modifyEntry === undefined && format.units) {\n modifyEntry = {\n changeType: \"modify\",\n schemaType: SchemaOtherTypes.FormatUnit,\n itemName: format.name,\n difference: [],\n };\n\n for (const [unit, label] of format.units) {\n modifyEntry.difference.push({\n name: unit.fullName,\n label,\n });\n };\n\n this.schemaItemDifferences.push(modifyEntry);\n }\n }\n\n private visitChangedFormatUnitLabel(diagnostic: AnyDiagnostic) {\n const format = diagnostic.ecDefinition as Format;\n\n if (this.schemaItemDifferences.find((entry): entry is FormatUnitDifference => { return entry.changeType === \"modify\"\n && entry.schemaType === SchemaOtherTypes.FormatUnit && entry.itemName === format.name})) {\n return;\n }\n\n const [unit, label] = diagnostic.messageArgs as [Unit | InvertedUnit, string | undefined];\n this.schemaItemPathDifferences.push({\n changeType: \"modify\",\n schemaType: SchemaOtherTypes.FormatUnitLabel,\n itemName: format.name,\n path: unit.fullName,\n difference: {\n label,\n },\n });\n };\n};\n\nfunction isPropertyTypeName(property: Property, propertyName: string) {\n return (propertyName === \"type\") ||\n (property.isEnumeration() && propertyName === \"enumeration\") ||\n (property.isPrimitive() && propertyName === \"primitiveType\") ||\n (property.isStruct() && propertyName === \"structClass\") ||\n (property.isNavigation() && propertyName === \"relationshipClass\");\n}\n"]}
|
|
@@ -34,7 +34,9 @@ export declare enum SchemaOtherTypes {
|
|
|
34
34
|
RelationshipConstraint = "RelationshipConstraint",
|
|
35
35
|
RelationshipConstraintClass = "RelationshipConstraintClass",
|
|
36
36
|
EntityClassMixin = "EntityClassMixin",
|
|
37
|
-
KindOfQuantityPresentationFormat = "KindOfQuantityPresentationFormat"
|
|
37
|
+
KindOfQuantityPresentationFormat = "KindOfQuantityPresentationFormat",
|
|
38
|
+
FormatUnit = "FormatUnit",
|
|
39
|
+
FormatUnitLabel = "FormatUnitLabel"
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
42
|
* Defines the possible values SchemaTypes that can occur in SchemaDifferences or Conflicts.
|
|
@@ -59,7 +61,7 @@ export interface SchemaDifferenceResult {
|
|
|
59
61
|
* Union of all supported schema differencing types.
|
|
60
62
|
* @alpha
|
|
61
63
|
*/
|
|
62
|
-
export type AnySchemaDifference = SchemaDifference | SchemaReferenceDifference | AnySchemaItemDifference | AnySchemaItemPathDifference | EntityClassMixinDifference | CustomAttributeDifference | KindOfQuantityPresentationFormatDifference;
|
|
64
|
+
export type AnySchemaDifference = SchemaDifference | SchemaReferenceDifference | AnySchemaItemDifference | AnySchemaItemPathDifference | EntityClassMixinDifference | CustomAttributeDifference | KindOfQuantityPresentationFormatDifference | FormatUnitDifference;
|
|
63
65
|
/**
|
|
64
66
|
* Differencing entry for changes on a Schema.
|
|
65
67
|
* @alpha
|
|
@@ -95,7 +97,7 @@ export type AnyClassItemDifference = EntityClassDifference | MixinClassDifferenc
|
|
|
95
97
|
* Union of all differences that have a path pointing inside a schema item.
|
|
96
98
|
* @alpha
|
|
97
99
|
*/
|
|
98
|
-
export type AnySchemaItemPathDifference = RelationshipConstraintDifference | RelationshipConstraintClassDifference | CustomAttributePropertyDifference | EnumeratorDifference | ClassPropertyDifference;
|
|
100
|
+
export type AnySchemaItemPathDifference = RelationshipConstraintDifference | RelationshipConstraintClassDifference | CustomAttributePropertyDifference | EnumeratorDifference | ClassPropertyDifference | FormatUnitLabelDifference;
|
|
99
101
|
/**
|
|
100
102
|
* Internal base class for all Schema Item differencing entries.
|
|
101
103
|
* @alpha
|
|
@@ -317,6 +319,32 @@ export interface KindOfQuantityPresentationFormatDifference {
|
|
|
317
319
|
readonly itemName: string;
|
|
318
320
|
readonly difference: string[];
|
|
319
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Differencing entry for changed Units on Formats.
|
|
324
|
+
* @alpha
|
|
325
|
+
*/
|
|
326
|
+
export interface FormatUnitDifference {
|
|
327
|
+
readonly changeType: "modify";
|
|
328
|
+
readonly schemaType: SchemaOtherTypes.FormatUnit;
|
|
329
|
+
readonly itemName: string;
|
|
330
|
+
readonly difference: {
|
|
331
|
+
name: string;
|
|
332
|
+
label?: string;
|
|
333
|
+
}[];
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Differencing entry for changed labels on Format Units.
|
|
337
|
+
* @alpha
|
|
338
|
+
*/
|
|
339
|
+
export interface FormatUnitLabelDifference {
|
|
340
|
+
readonly changeType: "modify";
|
|
341
|
+
readonly schemaType: SchemaOtherTypes.FormatUnitLabel;
|
|
342
|
+
readonly itemName: string;
|
|
343
|
+
readonly path: string;
|
|
344
|
+
readonly difference: {
|
|
345
|
+
label?: string;
|
|
346
|
+
};
|
|
347
|
+
}
|
|
320
348
|
/**
|
|
321
349
|
* Creates a [[SchemaDifferenceResult]] for two given schemas.
|
|
322
350
|
* @param targetSchema The schema the differences gets merged into.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaDifference.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifference.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAkB,MAAM,8BAA8B,CAAC;AAI9E,OAAO,
|
|
1
|
+
{"version":3,"file":"SchemaDifference.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifference.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAkB,MAAM,8BAA8B,CAAC;AAI9E,OAAO,EAAE,aAAa,EAAe,gBAAgB,EAAE,aAAa,EAAE,eAAe,EACnF,yBAAyB,EAAW,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAC9G,UAAU,EAAE,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,2BAA2B,EACvG,KAAK,MAAM,EAAc,qBAAqB,EAAiB,eAAe,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAC7K,MAAM,0BAA0B,CAAC;AAKlC,wEAAwE;AACxE,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,C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H,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EAAE,CAAC;CACL;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,eAAe,CAAC;IACtD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAmC9J"}
|
|
@@ -30,6 +30,8 @@ var SchemaOtherTypes;
|
|
|
30
30
|
SchemaOtherTypes["RelationshipConstraintClass"] = "RelationshipConstraintClass";
|
|
31
31
|
SchemaOtherTypes["EntityClassMixin"] = "EntityClassMixin";
|
|
32
32
|
SchemaOtherTypes["KindOfQuantityPresentationFormat"] = "KindOfQuantityPresentationFormat";
|
|
33
|
+
SchemaOtherTypes["FormatUnit"] = "FormatUnit";
|
|
34
|
+
SchemaOtherTypes["FormatUnitLabel"] = "FormatUnitLabel";
|
|
33
35
|
})(SchemaOtherTypes || (exports.SchemaOtherTypes = SchemaOtherTypes = {}));
|
|
34
36
|
/**
|
|
35
37
|
* Creates a [[SchemaDifferenceResult]] for two given schemas.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;QAC5D,OAAO,YAAY,CAAC,UAAU,CAAQ,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAEe,KAAK,CAAC,eAAe,CAAC,SAAsB,EAAE,OAAgB;QAC5E,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,IAAI,yBAAW,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/G,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,YAAY,CAAqC,CAAC;IAC3F,CAAC;IAEe,cAAc,CAAC,QAA+C,EAAE,QAA+C;QAC7H,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,8BAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACtC,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC;YAC1B,CAAC;YACD,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Differencing\n */\n\nimport { AnySchemaDifferenceConflict } from \"./SchemaConflicts\";\nimport { AnySchemaEdits, SchemaEditType } from \"../Merging/Edits/SchemaEdits\";\nimport { SchemaDiagnosticVisitor } from \"./SchemaDiagnosticVisitor\";\nimport { SchemaChanges } from \"../Validation/SchemaChanges\";\nimport { SchemaComparer } from \"../Validation/SchemaComparer\";\nimport {\n AnyEnumerator, AnyProperty, AnyPropertyProps, ConstantProps, CustomAttribute,\n CustomAttributeClassProps, ECClass, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps,\n MixinProps, PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, RelationshipConstraintProps,\n type Schema, SchemaItem, SchemaItemFormatProps, SchemaItemKey, SchemaItemProps, SchemaItemType, SchemaItemUnitProps, SchemaReferenceProps, StructClassProps, UnitSystemProps,\n} from \"@itwin/ecschema-metadata\";\nimport { validateDifferences } from \"./SchemaDifferenceValidator\";\nimport { AnyDiagnostic } from \"../Validation/Diagnostic\";\nimport { NameMapping, PropertyKey } from \"../Merging/Edits/NameMapping\";\n\n/** Utility-Type to remove possible readonly flags on the given type. */\ntype PartialEditable<T> = {\n -readonly [P in keyof T]?: T[P];\n};\n\n/**\n * Utility-Type to simplify the expected SchemaItem props by omitting the base properties\n * that are not needed for the schema differencing. Also all properties are made mutable\n * by removing the readonly flag if present.\n */\ntype SchemaItemProperties<T extends SchemaItemProps> = {\n [P in keyof PartialEditable<Omit<T, keyof Omit<SchemaItemProps, \"label\" | \"description\" | \"customAttributes\">>>]: T[P]\n};\n\n/**\n * Defines the type of the difference operation.\n * @alpha\n */\nexport type DifferenceType = \"add\" | \"modify\";\n\n/**\n * Defines the SchemaTypes that are not SchemaItems.\n * @alpha\n */\nexport enum SchemaOtherTypes {\n Schema = \"Schema\",\n SchemaReference = \"SchemaReference\",\n Property = \"Property\",\n Enumerator = \"Enumerator\",\n CustomAttributeInstance = \"CustomAttributeInstance\",\n RelationshipConstraint = \"RelationshipConstraint\",\n RelationshipConstraintClass = \"RelationshipConstraintClass\",\n EntityClassMixin = \"EntityClassMixin\",\n KindOfQuantityPresentationFormat = \"KindOfQuantityPresentationFormat\",\n}\n\n/**\n * Defines the possible values SchemaTypes that can occur in SchemaDifferences or Conflicts.\n * @alpha\n */\nexport type SchemaType = SchemaOtherTypes | SchemaItemType;\n\n/**\n * Definition of the difference result between two Schemas.\n * @alpha\n */\nexport interface SchemaDifferenceResult {\n /** Full name of the source schema */\n readonly sourceSchemaName: string;\n /** Full name of the target schema */\n readonly targetSchemaName: string;\n\n /** List of differences between the compared schemas. */\n readonly differences: AnySchemaDifference[];\n\n /** List of conflicts found while comparing the schemas. */\n readonly conflicts?: AnySchemaDifferenceConflict[];\n}\n\n/**\n * Union of all supported schema differencing types.\n * @alpha\n */\nexport type AnySchemaDifference =\n SchemaDifference |\n SchemaReferenceDifference |\n AnySchemaItemDifference |\n AnySchemaItemPathDifference |\n EntityClassMixinDifference |\n CustomAttributeDifference |\n KindOfQuantityPresentationFormatDifference;\n\n/**\n * Differencing entry for changes on a Schema.\n * @alpha\n */\nexport interface SchemaDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.Schema;\n readonly difference: {\n label?: string;\n description?: string;\n };\n}\n\n/**\n * Differencing entry for added or changed Schema References of a Schema.\n * @alpha\n */\nexport interface SchemaReferenceDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.SchemaReference;\n readonly difference: SchemaReferenceProps;\n}\n\n/**\n * Union of all supported schema item differencing types.\n * @alpha\n */\nexport type AnySchemaItemDifference =\n AnyClassItemDifference |\n ConstantDifference |\n EnumerationDifference |\n FormatDifference |\n KindOfQuantityDifference |\n InvertedUnitDifference |\n PhenomenonDifference |\n PropertyCategoryDifference |\n UnitDifference |\n UnitSystemDifference;\n\n/**\n * Union for supported class Schema Items.\n * @alpha\n */\nexport type AnyClassItemDifference =\n EntityClassDifference |\n MixinClassDifference |\n StructClassDifference |\n CustomAttributeClassDifference |\n RelationshipClassDifference;\n\n/**\n * Union of all differences that have a path pointing inside a schema item.\n * @alpha\n */\nexport type AnySchemaItemPathDifference =\n RelationshipConstraintDifference |\n RelationshipConstraintClassDifference |\n CustomAttributePropertyDifference |\n EnumeratorDifference |\n ClassPropertyDifference;\n\n/**\n * Internal base class for all Schema Item differencing entries.\n * @alpha\n */\ninterface SchemaItemDifference<T extends SchemaItemProps> {\n readonly changeType: \"add\" | \"modify\";\n readonly itemName: string;\n readonly difference: SchemaItemProperties<T>;\n}\n\n/**\n * Differencing entry for Constant Schema Items.\n * @alpha\n */\nexport interface ConstantDifference extends SchemaItemDifference<ConstantProps> {\n readonly schemaType: SchemaItemType.Constant;\n}\n\n/**\n * Differencing entry for Custom Attribute Class Schema Items.\n * @alpha\n */\nexport interface CustomAttributeClassDifference extends SchemaItemDifference<CustomAttributeClassProps> {\n readonly schemaType: SchemaItemType.CustomAttributeClass;\n}\n\n/**\n * Differencing entry for Entity Class Schema Items.\n * @alpha\n */\nexport interface EntityClassDifference extends SchemaItemDifference<EntityClassProps> {\n readonly schemaType: SchemaItemType.EntityClass;\n}\n\n/**\n * Differencing entry for Enumerator Schema Items.\n * @alpha\n */\nexport interface EnumerationDifference extends SchemaItemDifference<EnumerationProps> {\n readonly schemaType: SchemaItemType.Enumeration;\n}\n\n/**\n * Differencing entry for Kind-Of-Quantities Schema Items.\n * @alpha\n */\nexport interface KindOfQuantityDifference extends SchemaItemDifference<KindOfQuantityProps> {\n readonly schemaType: SchemaItemType.KindOfQuantity;\n}\n\n/**\n * Differencing entry for Mixin Class Schema Items.\n * @alpha\n */\nexport interface MixinClassDifference extends SchemaItemDifference<MixinProps> {\n readonly schemaType: SchemaItemType.Mixin;\n}\n\n/**\n * Differencing entry for Phenomenon Schema Items.\n * @alpha\n */\nexport interface PhenomenonDifference extends SchemaItemDifference<PhenomenonProps> {\n readonly schemaType: SchemaItemType.Phenomenon;\n}\n\n/**\n * Differencing entry for Property Category Schema Items.\n * @alpha\n */\nexport interface PropertyCategoryDifference extends SchemaItemDifference<PropertyCategoryProps> {\n readonly schemaType: SchemaItemType.PropertyCategory;\n}\n\n/**\n * Differencing entry for Relationship Class Schema Items.\n * @alpha\n */\nexport interface RelationshipClassDifference extends SchemaItemDifference<RelationshipClassProps> {\n readonly schemaType: SchemaItemType.RelationshipClass;\n}\n\n/**\n * Differencing entry for Struct Class Schema Items.\n * @alpha\n */\nexport interface StructClassDifference extends SchemaItemDifference<StructClassProps> {\n readonly schemaType: SchemaItemType.StructClass;\n}\n\n/**\n * Differencing entry for Unit System Schema Items.\n * @alpha\n */\nexport interface UnitSystemDifference extends SchemaItemDifference<UnitSystemProps> {\n readonly schemaType: SchemaItemType.UnitSystem;\n}\n\n/**\n * Differencing entry for Unit Schema Items.\n * @alpha\n */\nexport interface UnitDifference extends SchemaItemDifference<SchemaItemUnitProps> {\n readonly schemaType: SchemaItemType.Unit;\n}\n\n/**\n * Differencing entry for Inverted Unit Schema Items.\n * @alpha\n */\nexport interface InvertedUnitDifference extends SchemaItemDifference<InvertedUnitProps> {\n readonly schemaType: SchemaItemType.InvertedUnit;\n}\n/**\n * Differencing entry for Format Schema Items.\n * @alpha\n */\nexport interface FormatDifference extends SchemaItemDifference<SchemaItemFormatProps> {\n readonly schemaType: SchemaItemType.Format;\n}\n\n/**\n * Differencing entry for added or changed Properties.\n * @alpha\n */\nexport interface ClassPropertyDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.Property;\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<AnyPropertyProps>;\n}\n\n/**\n * Union of supported Custom Attribute Differences.\n * @alpha\n */\nexport type CustomAttributeDifference =\n CustomAttributeSchemaDifference |\n CustomAttributeSchemaItemDifference |\n CustomAttributePropertyDifference |\n CustomAttributeRelationshipConstraintDifference;\n\n/**\n * Differencing entry for Custom Attributes on Schema.\n * @alpha\n */\nexport interface CustomAttributeSchemaDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"Schema\";\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Schema Items.\n * @alpha\n */\nexport interface CustomAttributeSchemaItemDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"SchemaItem\";\n readonly itemName: string;\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Properties.\n * @alpha\n */\nexport interface CustomAttributePropertyDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"Property\";\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Relationship Constraints.\n * @alpha\n */\nexport interface CustomAttributeRelationshipConstraintDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"RelationshipConstraint\";\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for changed mixins on EntityClasses.\n * @alpha\n */\nexport interface EntityClassMixinDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.EntityClassMixin;\n readonly itemName: string;\n readonly difference: string[];\n}\n\n/**\n * Differencing entry for changed Enumerators on Enumerable Schema Items.\n * @alpha\n */\nexport interface EnumeratorDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.Enumerator;\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<AnyEnumerator>;\n}\n\n/**\n * Differencing entry for Relationship Constraints.\n * @alpha\n */\nexport interface RelationshipConstraintDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.RelationshipConstraint;\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: PartialEditable<Omit<RelationshipConstraintProps, \"constraintClasses\">>;\n}\n\n/**\n * Differencing entry for constraint classes added to Relationship Constrains.\n * @alpha\n */\nexport interface RelationshipConstraintClassDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.RelationshipConstraintClass;\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: string[];\n}\n\n/**\n * Differencing entry for presentation formats added to KindOfQuantities.\n * @alpha\n */\nexport interface KindOfQuantityPresentationFormatDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.KindOfQuantityPresentationFormat;\n readonly itemName: string;\n readonly difference: string[];\n}\n\n/**\n * Creates a [[SchemaDifferenceResult]] for two given schemas.\n * @param targetSchema The schema the differences gets merged into.\n * @param sourceSchema The schema to get merged in the target.\n * @returns An [[SchemaDifferenceResult]] object.\n * @alpha\n */\nexport async function getSchemaDifferences(targetSchema: Schema, sourceSchema: Schema, schemaEdits?: Iterable<AnySchemaEdits>): Promise<SchemaDifferenceResult> {\n const schemaComparer = new DifferenceSchemaComparer();\n if(schemaEdits) {\n for(const edit of schemaEdits) {\n if(edit.type === SchemaEditType.RenameSchemaItem) {\n schemaComparer.nameMappings.addItemMapping(edit.key, edit.value);\n }\n if(edit.type === SchemaEditType.RenameProperty) {\n schemaComparer.nameMappings.addPropertyMapping(edit.key, edit.value);\n }\n }\n }\n\n await schemaComparer.compareSchemas(sourceSchema, targetSchema);\n\n const visitor = new SchemaDiagnosticVisitor();\n for (const diagnostic of schemaComparer.diagnostics) {\n visitor.visit(diagnostic);\n }\n\n const differences: AnySchemaDifference[] = [\n ...visitor.schemaDifferences,\n ...visitor.schemaItemDifferences,\n ...visitor.schemaItemPathDifferences,\n ...visitor.customAttributeDifferences,\n ];\n\n const conflicts = await validateDifferences(differences, targetSchema, sourceSchema, schemaComparer.nameMappings);\n\n return {\n sourceSchemaName: sourceSchema.schemaKey.toString(),\n targetSchemaName: targetSchema.schemaKey.toString(),\n conflicts: conflicts.length > 0 ? conflicts : undefined,\n differences,\n };\n}\n\n/**\n * Implementation of a SchemaComparer that is used in the schema differencing process.\n * It extends the SchemaComparer base class with additional functionality to store the\n * name mappings of renamed schema items and properties.\n *\n * @internal\n */\nclass DifferenceSchemaComparer extends SchemaComparer {\n public readonly nameMappings: NameMapping;\n private readonly _changes: Array<SchemaChanges>;\n\n public get diagnostics(): Iterable<AnyDiagnostic> {\n return this._changes[0].allDiagnostics;\n }\n\n constructor() {\n super({ report: (changes) => this._changes.push(changes as SchemaChanges) });\n\n this._changes = [];\n this.nameMappings = new NameMapping();\n }\n\n public override async resolveItem<TItem extends SchemaItem>(item: SchemaItem, lookupSchema: Schema): Promise<TItem | undefined> {\n const classKey = this.nameMappings.resolveItemKey(item.key);\n return lookupSchema.lookupItem<TItem>(classKey.name);\n }\n\n public override async resolveProperty(propertyA: AnyProperty, ecClass: ECClass): Promise<AnyProperty | undefined> {\n const propertyKey = this.nameMappings.resolvePropertyKey(new PropertyKey(propertyA.name, propertyA.class.key));\n return ecClass.getProperty(propertyKey.propertyName) as Promise<AnyProperty | undefined>;\n }\n\n public override areEqualByName(itemKeyA?: Readonly<SchemaItemKey> | SchemaItem, itemKeyB?: Readonly<SchemaItemKey> | SchemaItem): boolean {\n if (itemKeyA) {\n if (SchemaItem.isSchemaItem(itemKeyA)) {\n itemKeyA = itemKeyA.key;\n }\n itemKeyA = this.nameMappings.resolveItemKey(itemKeyA);\n }\n return super.areEqualByName(itemKeyA, itemKeyB);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SchemaDifference.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifference.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAsbH,oDAmCC;AAtdD,8DAA8E;AAC9E,uEAAoE;AAEpE,iEAA8D;AAC9D,gEAIkC;AAClC,2EAAkE;AAElE,8DAAwE;AAsBxE;;;GAGG;AACH,IAAY,gBAYX;AAZD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,uDAAmC,CAAA;IACnC,yCAAqB,CAAA;IACrB,6CAAyB,CAAA;IACzB,uEAAmD,CAAA;IACnD,qEAAiD,CAAA;IACjD,+EAA2D,CAAA;IAC3D,yDAAqC,CAAA;IACrC,yFAAqE,CAAA;IACrE,6CAAyB,CAAA;IACzB,uDAAmC,CAAA;AACrC,CAAC,EAZW,gBAAgB,gCAAhB,gBAAgB,QAY3B;AA2XD;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB,CAAC,YAAoB,EAAE,YAAoB,EAAE,WAAsC;IAC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QACxD,CAAC;QACD,OAAO,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Differencing\n */\n\nimport { AnySchemaDifferenceConflict } from \"./SchemaConflicts\";\nimport { AnySchemaEdits, SchemaEditType } from \"../Merging/Edits/SchemaEdits\";\nimport { SchemaDiagnosticVisitor } from \"./SchemaDiagnosticVisitor\";\nimport { SchemaChanges } from \"../Validation/SchemaChanges\";\nimport { SchemaComparer } from \"../Validation/SchemaComparer\";\nimport { AnyEnumerator, AnyProperty, AnyPropertyProps, ConstantProps, CustomAttribute,\n CustomAttributeClassProps, ECClass, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps,\n MixinProps, PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, RelationshipConstraintProps,\n type Schema, SchemaItem, SchemaItemFormatProps, SchemaItemKey, SchemaItemProps, SchemaItemType, SchemaItemUnitProps, SchemaReferenceProps, StructClassProps, UnitSystemProps,\n} from \"@itwin/ecschema-metadata\";\nimport { validateDifferences } from \"./SchemaDifferenceValidator\";\nimport { AnyDiagnostic } from \"../Validation/Diagnostic\";\nimport { NameMapping, PropertyKey } from \"../Merging/Edits/NameMapping\";\n\n/** Utility-Type to remove possible readonly flags on the given type. */\ntype PartialEditable<T> = {\n -readonly [P in keyof T]?: T[P];\n};\n\n/**\n * Utility-Type to simplify the expected SchemaItem props by omitting the base properties\n * that are not needed for the schema differencing. Also all properties are made mutable\n * by removing the readonly flag if present.\n */\ntype SchemaItemProperties<T extends SchemaItemProps> = {\n [P in keyof PartialEditable<Omit<T, keyof Omit<SchemaItemProps, \"label\" | \"description\" | \"customAttributes\">>>]: T[P]\n};\n\n/**\n * Defines the type of the difference operation.\n * @alpha\n */\nexport type DifferenceType = \"add\" | \"modify\";\n\n/**\n * Defines the SchemaTypes that are not SchemaItems.\n * @alpha\n */\nexport enum SchemaOtherTypes {\n Schema = \"Schema\",\n SchemaReference = \"SchemaReference\",\n Property = \"Property\",\n Enumerator = \"Enumerator\",\n CustomAttributeInstance = \"CustomAttributeInstance\",\n RelationshipConstraint = \"RelationshipConstraint\",\n RelationshipConstraintClass = \"RelationshipConstraintClass\",\n EntityClassMixin = \"EntityClassMixin\",\n KindOfQuantityPresentationFormat = \"KindOfQuantityPresentationFormat\",\n FormatUnit = \"FormatUnit\",\n FormatUnitLabel = \"FormatUnitLabel\",\n}\n\n/**\n * Defines the possible values SchemaTypes that can occur in SchemaDifferences or Conflicts.\n * @alpha\n */\nexport type SchemaType = SchemaOtherTypes | SchemaItemType;\n\n/**\n * Definition of the difference result between two Schemas.\n * @alpha\n */\nexport interface SchemaDifferenceResult {\n /** Full name of the source schema */\n readonly sourceSchemaName: string;\n /** Full name of the target schema */\n readonly targetSchemaName: string;\n\n /** List of differences between the compared schemas. */\n readonly differences: AnySchemaDifference[];\n\n /** List of conflicts found while comparing the schemas. */\n readonly conflicts?: AnySchemaDifferenceConflict[];\n}\n\n/**\n * Union of all supported schema differencing types.\n * @alpha\n */\nexport type AnySchemaDifference =\n SchemaDifference |\n SchemaReferenceDifference |\n AnySchemaItemDifference |\n AnySchemaItemPathDifference |\n EntityClassMixinDifference |\n CustomAttributeDifference |\n KindOfQuantityPresentationFormatDifference |\n FormatUnitDifference;\n\n/**\n * Differencing entry for changes on a Schema.\n * @alpha\n */\nexport interface SchemaDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.Schema;\n readonly difference: {\n label?: string;\n description?: string;\n };\n}\n\n/**\n * Differencing entry for added or changed Schema References of a Schema.\n * @alpha\n */\nexport interface SchemaReferenceDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.SchemaReference;\n readonly difference: SchemaReferenceProps;\n}\n\n/**\n * Union of all supported schema item differencing types.\n * @alpha\n */\nexport type AnySchemaItemDifference =\n AnyClassItemDifference |\n ConstantDifference |\n EnumerationDifference |\n FormatDifference |\n KindOfQuantityDifference |\n InvertedUnitDifference |\n PhenomenonDifference |\n PropertyCategoryDifference |\n UnitDifference |\n UnitSystemDifference;\n\n/**\n * Union for supported class Schema Items.\n * @alpha\n */\nexport type AnyClassItemDifference =\n EntityClassDifference |\n MixinClassDifference |\n StructClassDifference |\n CustomAttributeClassDifference |\n RelationshipClassDifference;\n\n/**\n * Union of all differences that have a path pointing inside a schema item.\n * @alpha\n */\nexport type AnySchemaItemPathDifference =\n RelationshipConstraintDifference |\n RelationshipConstraintClassDifference |\n CustomAttributePropertyDifference |\n EnumeratorDifference |\n ClassPropertyDifference |\n FormatUnitLabelDifference;\n\n/**\n * Internal base class for all Schema Item differencing entries.\n * @alpha\n */\ninterface SchemaItemDifference<T extends SchemaItemProps> {\n readonly changeType: \"add\" | \"modify\";\n readonly itemName: string;\n readonly difference: SchemaItemProperties<T>;\n}\n\n/**\n * Differencing entry for Constant Schema Items.\n * @alpha\n */\nexport interface ConstantDifference extends SchemaItemDifference<ConstantProps> {\n readonly schemaType: SchemaItemType.Constant;\n}\n\n/**\n * Differencing entry for Custom Attribute Class Schema Items.\n * @alpha\n */\nexport interface CustomAttributeClassDifference extends SchemaItemDifference<CustomAttributeClassProps> {\n readonly schemaType: SchemaItemType.CustomAttributeClass;\n}\n\n/**\n * Differencing entry for Entity Class Schema Items.\n * @alpha\n */\nexport interface EntityClassDifference extends SchemaItemDifference<EntityClassProps> {\n readonly schemaType: SchemaItemType.EntityClass;\n}\n\n/**\n * Differencing entry for Enumerator Schema Items.\n * @alpha\n */\nexport interface EnumerationDifference extends SchemaItemDifference<EnumerationProps> {\n readonly schemaType: SchemaItemType.Enumeration;\n}\n\n/**\n * Differencing entry for Kind-Of-Quantities Schema Items.\n * @alpha\n */\nexport interface KindOfQuantityDifference extends SchemaItemDifference<KindOfQuantityProps> {\n readonly schemaType: SchemaItemType.KindOfQuantity;\n}\n\n/**\n * Differencing entry for Mixin Class Schema Items.\n * @alpha\n */\nexport interface MixinClassDifference extends SchemaItemDifference<MixinProps> {\n readonly schemaType: SchemaItemType.Mixin;\n}\n\n/**\n * Differencing entry for Phenomenon Schema Items.\n * @alpha\n */\nexport interface PhenomenonDifference extends SchemaItemDifference<PhenomenonProps> {\n readonly schemaType: SchemaItemType.Phenomenon;\n}\n\n/**\n * Differencing entry for Property Category Schema Items.\n * @alpha\n */\nexport interface PropertyCategoryDifference extends SchemaItemDifference<PropertyCategoryProps> {\n readonly schemaType: SchemaItemType.PropertyCategory;\n}\n\n/**\n * Differencing entry for Relationship Class Schema Items.\n * @alpha\n */\nexport interface RelationshipClassDifference extends SchemaItemDifference<RelationshipClassProps> {\n readonly schemaType: SchemaItemType.RelationshipClass;\n}\n\n/**\n * Differencing entry for Struct Class Schema Items.\n * @alpha\n */\nexport interface StructClassDifference extends SchemaItemDifference<StructClassProps> {\n readonly schemaType: SchemaItemType.StructClass;\n}\n\n/**\n * Differencing entry for Unit System Schema Items.\n * @alpha\n */\nexport interface UnitSystemDifference extends SchemaItemDifference<UnitSystemProps> {\n readonly schemaType: SchemaItemType.UnitSystem;\n}\n\n/**\n * Differencing entry for Unit Schema Items.\n * @alpha\n */\nexport interface UnitDifference extends SchemaItemDifference<SchemaItemUnitProps> {\n readonly schemaType: SchemaItemType.Unit;\n}\n\n/**\n * Differencing entry for Inverted Unit Schema Items.\n * @alpha\n */\nexport interface InvertedUnitDifference extends SchemaItemDifference<InvertedUnitProps> {\n readonly schemaType: SchemaItemType.InvertedUnit;\n}\n/**\n * Differencing entry for Format Schema Items.\n * @alpha\n */\nexport interface FormatDifference extends SchemaItemDifference<SchemaItemFormatProps> {\n readonly schemaType: SchemaItemType.Format;\n}\n\n/**\n * Differencing entry for added or changed Properties.\n * @alpha\n */\nexport interface ClassPropertyDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.Property;\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<AnyPropertyProps>;\n}\n\n/**\n * Union of supported Custom Attribute Differences.\n * @alpha\n */\nexport type CustomAttributeDifference =\n CustomAttributeSchemaDifference |\n CustomAttributeSchemaItemDifference |\n CustomAttributePropertyDifference |\n CustomAttributeRelationshipConstraintDifference;\n\n/**\n * Differencing entry for Custom Attributes on Schema.\n * @alpha\n */\nexport interface CustomAttributeSchemaDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"Schema\";\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Schema Items.\n * @alpha\n */\nexport interface CustomAttributeSchemaItemDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"SchemaItem\";\n readonly itemName: string;\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Properties.\n * @alpha\n */\nexport interface CustomAttributePropertyDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"Property\";\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Relationship Constraints.\n * @alpha\n */\nexport interface CustomAttributeRelationshipConstraintDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"RelationshipConstraint\";\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for changed mixins on EntityClasses.\n * @alpha\n */\nexport interface EntityClassMixinDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.EntityClassMixin;\n readonly itemName: string;\n readonly difference: string[];\n}\n\n/**\n * Differencing entry for changed Enumerators on Enumerable Schema Items.\n * @alpha\n */\nexport interface EnumeratorDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.Enumerator;\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<AnyEnumerator>;\n}\n\n/**\n * Differencing entry for Relationship Constraints.\n * @alpha\n */\nexport interface RelationshipConstraintDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.RelationshipConstraint;\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: PartialEditable<Omit<RelationshipConstraintProps, \"constraintClasses\">>;\n}\n\n/**\n * Differencing entry for constraint classes added to Relationship Constrains.\n * @alpha\n */\nexport interface RelationshipConstraintClassDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.RelationshipConstraintClass;\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: string[];\n}\n\n/**\n * Differencing entry for presentation formats added to KindOfQuantities.\n * @alpha\n */\nexport interface KindOfQuantityPresentationFormatDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.KindOfQuantityPresentationFormat;\n readonly itemName: string;\n readonly difference: string[];\n}\n\n/**\n * Differencing entry for changed Units on Formats.\n * @alpha\n */\nexport interface FormatUnitDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.FormatUnit;\n readonly itemName: string;\n readonly difference: {\n name: string;\n label?: string;\n }[];\n}\n\n/**\n * Differencing entry for changed labels on Format Units.\n * @alpha\n */\nexport interface FormatUnitLabelDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.FormatUnitLabel;\n readonly itemName: string;\n readonly path: string;\n readonly difference: {\n label?: string;\n };\n}\n\n/**\n * Creates a [[SchemaDifferenceResult]] for two given schemas.\n * @param targetSchema The schema the differences gets merged into.\n * @param sourceSchema The schema to get merged in the target.\n * @returns An [[SchemaDifferenceResult]] object.\n * @alpha\n */\nexport async function getSchemaDifferences(targetSchema: Schema, sourceSchema: Schema, schemaEdits?: Iterable<AnySchemaEdits>): Promise<SchemaDifferenceResult> {\n const schemaComparer = new DifferenceSchemaComparer();\n if(schemaEdits) {\n for(const edit of schemaEdits) {\n if(edit.type === SchemaEditType.RenameSchemaItem) {\n schemaComparer.nameMappings.addItemMapping(edit.key, edit.value);\n }\n if(edit.type === SchemaEditType.RenameProperty) {\n schemaComparer.nameMappings.addPropertyMapping(edit.key, edit.value);\n }\n }\n }\n\n await schemaComparer.compareSchemas(sourceSchema, targetSchema);\n\n const visitor = new SchemaDiagnosticVisitor();\n for (const diagnostic of schemaComparer.diagnostics) {\n visitor.visit(diagnostic);\n }\n\n const differences: AnySchemaDifference[] = [\n ...visitor.schemaDifferences,\n ...visitor.schemaItemDifferences,\n ...visitor.schemaItemPathDifferences,\n ...visitor.customAttributeDifferences,\n ];\n\n const conflicts = await validateDifferences(differences, targetSchema, sourceSchema, schemaComparer.nameMappings);\n\n return {\n sourceSchemaName: sourceSchema.schemaKey.toString(),\n targetSchemaName: targetSchema.schemaKey.toString(),\n conflicts: conflicts.length > 0 ? conflicts : undefined,\n differences,\n };\n}\n\n/**\n * Implementation of a SchemaComparer that is used in the schema differencing process.\n * It extends the SchemaComparer base class with additional functionality to store the\n * name mappings of renamed schema items and properties.\n *\n * @internal\n */\nclass DifferenceSchemaComparer extends SchemaComparer {\n public readonly nameMappings: NameMapping;\n private readonly _changes: Array<SchemaChanges>;\n\n public get diagnostics(): Iterable<AnyDiagnostic> {\n return this._changes[0].allDiagnostics;\n }\n\n constructor() {\n super({ report: (changes) => this._changes.push(changes as SchemaChanges) });\n\n this._changes = [];\n this.nameMappings = new NameMapping();\n }\n\n public override async resolveItem<TItem extends SchemaItem>(item: SchemaItem, lookupSchema: Schema): Promise<TItem | undefined> {\n const classKey = this.nameMappings.resolveItemKey(item.key);\n return lookupSchema.lookupItem<TItem>(classKey.name);\n }\n\n public override async resolveProperty(propertyA: AnyProperty, ecClass: ECClass): Promise<AnyProperty | undefined> {\n const propertyKey = this.nameMappings.resolvePropertyKey(new PropertyKey(propertyA.name, propertyA.class.key));\n return ecClass.getProperty(propertyKey.propertyName) as Promise<AnyProperty | undefined>;\n }\n\n public override areEqualByName(itemKeyA?: Readonly<SchemaItemKey> | SchemaItem, itemKeyB?: Readonly<SchemaItemKey> | SchemaItem): boolean {\n if (itemKeyA) {\n if (SchemaItem.isSchemaItem(itemKeyA)) {\n itemKeyA = itemKeyA.key;\n }\n itemKeyA = this.nameMappings.resolveItemKey(itemKeyA);\n }\n return super.areEqualByName(itemKeyA, itemKeyB);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaDifferenceValidator.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifferenceValidator.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"SchemaDifferenceValidator.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifferenceValidator.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA2N,MAAM,EAAoE,MAAM,0BAA0B,CAAC;AAC7U,OAAO,EAA0B,mBAAmB,EAA4pB,MAAM,oBAAoB,CAAC;AAC3uB,OAAO,EAAE,2BAA2B,EAAgB,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAe,MAAM,8BAA8B,CAAC;AAExE;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,mBAAmB,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,0CAOlJ"}
|