@itwin/ecschema-editing 5.0.0-dev.4 → 5.0.0-dev.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +0 -1
  3. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
  4. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +1 -9
  5. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
  6. package/lib/cjs/Differencing/SchemaDifference.d.ts +2 -1
  7. package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
  8. package/lib/cjs/Differencing/SchemaDifference.js +51 -5
  9. package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
  10. package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts +2 -1
  11. package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts.map +1 -1
  12. package/lib/cjs/Differencing/SchemaDifferenceValidator.js +29 -16
  13. package/lib/cjs/Differencing/SchemaDifferenceValidator.js.map +1 -1
  14. package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
  15. package/lib/cjs/Editing/ECClasses.js +1 -16
  16. package/lib/cjs/Editing/ECClasses.js.map +1 -1
  17. package/lib/cjs/Editing/Editor.js +4 -4
  18. package/lib/cjs/Editing/Editor.js.map +1 -1
  19. package/lib/cjs/Editing/Properties.d.ts +2 -2
  20. package/lib/cjs/Editing/Properties.js +2 -2
  21. package/lib/cjs/Editing/Properties.js.map +1 -1
  22. package/lib/cjs/Merging/ConstantMerger.js +3 -3
  23. package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
  24. package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -1
  25. package/lib/cjs/Merging/CustomAttributeMerger.js +5 -9
  26. package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
  27. package/lib/cjs/Merging/Edits/NameMapping.d.ts +22 -0
  28. package/lib/cjs/Merging/Edits/NameMapping.d.ts.map +1 -0
  29. package/lib/cjs/Merging/Edits/NameMapping.js +51 -0
  30. package/lib/cjs/Merging/Edits/NameMapping.js.map +1 -0
  31. package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts +1 -1
  32. package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts.map +1 -1
  33. package/lib/cjs/Merging/Edits/RenameEditHandler.js +1 -260
  34. package/lib/cjs/Merging/Edits/RenameEditHandler.js.map +1 -1
  35. package/lib/cjs/Merging/Edits/SchemaEdits.d.ts +9 -6
  36. package/lib/cjs/Merging/Edits/SchemaEdits.d.ts.map +1 -1
  37. package/lib/cjs/Merging/Edits/SchemaEdits.js +15 -14
  38. package/lib/cjs/Merging/Edits/SchemaEdits.js.map +1 -1
  39. package/lib/cjs/Merging/EntityClassMerger.js +1 -2
  40. package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
  41. package/lib/cjs/Merging/EnumerationMerger.js +1 -1
  42. package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
  43. package/lib/cjs/Merging/EnumeratorMerger.d.ts.map +1 -1
  44. package/lib/cjs/Merging/EnumeratorMerger.js +2 -2
  45. package/lib/cjs/Merging/EnumeratorMerger.js.map +1 -1
  46. package/lib/cjs/Merging/InvertedUnitMerger.d.ts +14 -0
  47. package/lib/cjs/Merging/InvertedUnitMerger.d.ts.map +1 -0
  48. package/lib/cjs/Merging/InvertedUnitMerger.js +45 -0
  49. package/lib/cjs/Merging/InvertedUnitMerger.js.map +1 -0
  50. package/lib/cjs/Merging/KindOfQuantityMerger.js +2 -2
  51. package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
  52. package/lib/cjs/Merging/MixinMerger.js +1 -1
  53. package/lib/cjs/Merging/MixinMerger.js.map +1 -1
  54. package/lib/cjs/Merging/PhenomenonMerger.js +1 -1
  55. package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -1
  56. package/lib/cjs/Merging/PropertyMerger.js +25 -23
  57. package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
  58. package/lib/cjs/Merging/SchemaMerger.d.ts +5 -3
  59. package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
  60. package/lib/cjs/Merging/SchemaMerger.js +35 -5
  61. package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
  62. package/lib/cjs/Merging/SchemaMergingVisitor.d.ts +2 -6
  63. package/lib/cjs/Merging/SchemaMergingVisitor.d.ts.map +1 -1
  64. package/lib/cjs/Merging/SchemaMergingVisitor.js +16 -14
  65. package/lib/cjs/Merging/SchemaMergingVisitor.js.map +1 -1
  66. package/lib/cjs/Merging/UnitMerger.d.ts +14 -0
  67. package/lib/cjs/Merging/UnitMerger.d.ts.map +1 -0
  68. package/lib/cjs/Merging/UnitMerger.js +62 -0
  69. package/lib/cjs/Merging/UnitMerger.js.map +1 -0
  70. package/lib/cjs/Merging/Utils.d.ts +11 -0
  71. package/lib/cjs/Merging/Utils.d.ts.map +1 -1
  72. package/lib/cjs/Merging/Utils.js +22 -2
  73. package/lib/cjs/Merging/Utils.js.map +1 -1
  74. package/lib/cjs/Validation/Diagnostic.js +12 -16
  75. package/lib/cjs/Validation/Diagnostic.js.map +1 -1
  76. package/lib/cjs/Validation/SchemaCompareVisitor.d.ts.map +1 -1
  77. package/lib/cjs/Validation/SchemaCompareVisitor.js +21 -23
  78. package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
  79. package/lib/cjs/Validation/SchemaComparer.d.ts +22 -1
  80. package/lib/cjs/Validation/SchemaComparer.d.ts.map +1 -1
  81. package/lib/cjs/Validation/SchemaComparer.js +25 -3
  82. package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
  83. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,6 +1,31 @@
1
1
  # Change Log - @itwin/ecschema-editing
2
2
 
3
- This log was last generated on Wed, 06 Nov 2024 19:24:30 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 13 Jan 2025 14:09:29 GMT and should not be manually modified.
4
+
5
+ ## 4.10.4
6
+ Mon, 13 Jan 2025 14:06:43 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 4.10.3
11
+ Mon, 06 Jan 2025 14:00:13 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 4.10.2
16
+ Thu, 21 Nov 2024 15:22:20 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 4.10.1
21
+ Thu, 14 Nov 2024 18:11:00 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 4.10.0
26
+ Wed, 13 Nov 2024 15:23:38 GMT
27
+
28
+ _Version update only_
4
29
 
5
30
  ## 4.9.7
6
31
  Wed, 06 Nov 2024 19:23:04 GMT
@@ -23,7 +23,6 @@ export declare class SchemaDiagnosticVisitor {
23
23
  private visitChangedSchemaProperties;
24
24
  private visitMissingSchemaItem;
25
25
  private visitChangedSchemaItem;
26
- private visitChangedEnumeration;
27
26
  private visitMissingEnumerator;
28
27
  private lookupEnumeratorEntry;
29
28
  private visitChangedEnumerator;
@@ -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,CAAC;AAO9D,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAEhC,KAAK,yBAAyB,EAE9B,KAAK,0BAA0B,EAE/B,KAAK,0CAA0C,EAG/C,KAAK,gBAAgB,EAErB,KAAK,yBAAyB,EAC/B,MAAM,oBAAoB,CAAC;AAE5B;;;;;GAKG;AACH,qBAAa,uBAAuB;IAElC,SAAgB,iBAAiB,EAAE,KAAK,CAAC,gBAAgB,GAAG,yBAAyB,CAAC,CAAC;IACvF,SAAgB,qBAAqB,EAAE,KAAK,CAAC,uBAAuB,GAAG,0BAA0B,GAAG,0CAA0C,C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yBAAyB,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC9E,SAAgB,0BAA0B,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;;IAS7E;;;OAGG;IACI,KAAK,CAAC,UAAU,EAAE,aAAa;IA6DtC,OAAO,CAAC,4BAA4B;IAiCpC,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,sBAAsB;IAkC9B,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;CAoBrC"}
@@ -50,9 +50,8 @@ class SchemaDiagnosticVisitor {
50
50
  case SchemaCompareDiagnostics_1.SchemaCompareCodes.PropertyCategoryDelta:
51
51
  case SchemaCompareDiagnostics_1.SchemaCompareCodes.RelationshipDelta:
52
52
  case SchemaCompareDiagnostics_1.SchemaCompareCodes.UnitDelta:
53
- return this.visitChangedSchemaItem(diagnostic);
54
53
  case SchemaCompareDiagnostics_1.SchemaCompareCodes.EnumerationDelta:
55
- return this.visitChangedEnumeration(diagnostic);
54
+ return this.visitChangedSchemaItem(diagnostic);
56
55
  case SchemaCompareDiagnostics_1.SchemaCompareCodes.EnumeratorDelta:
57
56
  return this.visitChangedEnumerator(diagnostic);
58
57
  case SchemaCompareDiagnostics_1.SchemaCompareCodes.EnumeratorMissing:
@@ -147,13 +146,6 @@ class SchemaDiagnosticVisitor {
147
146
  // needs to be handled better in future.
148
147
  modifyEntry.difference[propertyName] = sourceValue;
149
148
  }
150
- visitChangedEnumeration(diagnostic) {
151
- const enumeration = diagnostic.ecDefinition;
152
- if (this.schemaItemPathDifferences.find((entry) => entry.changeType === "add" && entry.itemName === enumeration.name)) {
153
- return;
154
- }
155
- return this.visitChangedSchemaItem(diagnostic);
156
- }
157
149
  visitMissingEnumerator(diagnostic) {
158
150
  const enumeration = diagnostic.ecDefinition;
159
151
  const [enumerator] = diagnostic.messageArgs;
@@ -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,KA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,CAAC,GAAG,UAAU,CAAC,WAAwC,CAAC;QAEjF,IAAI,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAuD,EAAE;YAC5G,OAAO,KAAK,CAAC,UAAU,KAAK,KAAK,IAAI,KAAK,CAAC,UAAU,KAAK,mCAAgB,CAAC,gCAAgC;mBACtG,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC,IAAI,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,QAAQ,GAAG;gBACT,UAAU,EAAE,KAAK;gBACjB,UAAU,EAAE,mCAAgB,CAAC,gCAAgC;gBAC7D,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;AArbD,0DAqbC;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 return this.visitChangedSchemaItem(diagnostic);\n\n case SchemaCompareCodes.EnumerationDelta:\n return this.visitChangedEnumeration(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 visitChangedEnumeration(diagnostic: AnyDiagnostic) {\n const enumeration = diagnostic.ecDefinition as Enumeration;\n if (this.schemaItemPathDifferences.find((entry) => entry.changeType === \"add\" && entry.itemName === enumeration.name)) {\n return;\n }\n\n return this.visitChangedSchemaItem(diagnostic);\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,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,CA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EO,4BAA4B,CAAC,UAAyB;QAC5D,MAAM,GAAG,GAAG,UAAU,CAAC,YAA8B,CAAC;QACtD,MAAM,CAAC,kBAAkB,CAAC,GAAG,UAAU,CAAC,WAAwC,CAAC;QAEjF,IAAI,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAuD,EAAE;YAC5G,OAAO,KAAK,CAAC,UAAU,KAAK,KAAK,IAAI,KAAK,CAAC,UAAU,KAAK,mCAAgB,CAAC,gCAAgC;mBACtG,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC,IAAI,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,QAAQ,GAAG;gBACT,UAAU,EAAE,KAAK;gBACjB,UAAU,EAAE,mCAAgB,CAAC,gCAAgC;gBAC7D,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"]}
@@ -2,6 +2,7 @@
2
2
  * @module Differencing
3
3
  */
4
4
  import { AnySchemaDifferenceConflict } from "./SchemaConflicts";
5
+ import { AnySchemaEdits } from "../Merging/Edits/SchemaEdits";
5
6
  import { AnyEnumerator, AnyPropertyProps, ConstantProps, CustomAttribute, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps, PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, RelationshipConstraintProps, type Schema, SchemaItemFormatProps, SchemaItemProps, SchemaItemType, SchemaItemUnitProps, SchemaReferenceProps, StructClassProps, UnitSystemProps } from "@itwin/ecschema-metadata";
6
7
  /** Utility-Type to remove possible readonly flags on the given type. */
7
8
  type PartialEditable<T> = {
@@ -323,6 +324,6 @@ export interface KindOfQuantityPresentationFormatDifference {
323
324
  * @returns An [[SchemaDifferenceResult]] object.
324
325
  * @alpha
325
326
  */
326
- export declare function getSchemaDifferences(targetSchema: Schema, sourceSchema: Schema): Promise<SchemaDifferenceResult>;
327
+ export declare function getSchemaDifferences(targetSchema: Schema, sourceSchema: Schema, schemaEdits?: Iterable<AnySchemaEdits>): Promise<SchemaDifferenceResult>;
327
328
  export {};
328
329
  //# sourceMappingURL=SchemaDifference.d.ts.map
@@ -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;AAIhE,OAAO,EACL,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAC/D,yBAAyB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EACrG,UAAU,EAAE,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,2BAA2B,EACvG,KAAK,MAAM,EAAE,qBAAqB,EAAE,eAAe,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAClJ,MAAM,0BAA0B,CAAC;AAGlC,wEAAwE;AACxE,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAChC,CAAC;AAEF;;;;GAIG;AACH,KAAK,oBAAoB,CAAC,CAAC,SAAS,eAAe,IAAI;KACpD,CAAC,IAAI,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,aAAa,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACvH,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE9C;;;GAGG;AACH,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,eAAe,oBAAoB;IACnC,QAAQ,aAAa;IACrB,UA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AE,gBAAgB,CAAC,gCAAgC,CAAC;IACvE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;CAC/B;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"}
@@ -9,9 +9,12 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.SchemaOtherTypes = void 0;
11
11
  exports.getSchemaDifferences = getSchemaDifferences;
12
+ const SchemaEdits_1 = require("../Merging/Edits/SchemaEdits");
12
13
  const SchemaDiagnosticVisitor_1 = require("./SchemaDiagnosticVisitor");
13
14
  const SchemaComparer_1 = require("../Validation/SchemaComparer");
15
+ const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
14
16
  const SchemaDifferenceValidator_1 = require("./SchemaDifferenceValidator");
17
+ const NameMapping_1 = require("../Merging/Edits/NameMapping");
15
18
  /**
16
19
  * Defines the SchemaTypes that are not SchemaItems.
17
20
  * @alpha
@@ -35,12 +38,21 @@ var SchemaOtherTypes;
35
38
  * @returns An [[SchemaDifferenceResult]] object.
36
39
  * @alpha
37
40
  */
38
- async function getSchemaDifferences(targetSchema, sourceSchema) {
39
- const changesList = [];
40
- const schemaComparer = new SchemaComparer_1.SchemaComparer({ report: changesList.push.bind(changesList) });
41
+ async function getSchemaDifferences(targetSchema, sourceSchema, schemaEdits) {
42
+ const schemaComparer = new DifferenceSchemaComparer();
43
+ if (schemaEdits) {
44
+ for (const edit of schemaEdits) {
45
+ if (edit.type === SchemaEdits_1.SchemaEditType.RenameSchemaItem) {
46
+ schemaComparer.nameMappings.addItemMapping(edit.key, edit.value);
47
+ }
48
+ if (edit.type === SchemaEdits_1.SchemaEditType.RenameProperty) {
49
+ schemaComparer.nameMappings.addPropertyMapping(edit.key, edit.value);
50
+ }
51
+ }
52
+ }
41
53
  await schemaComparer.compareSchemas(sourceSchema, targetSchema);
42
54
  const visitor = new SchemaDiagnosticVisitor_1.SchemaDiagnosticVisitor();
43
- for (const diagnostic of changesList[0].allDiagnostics) {
55
+ for (const diagnostic of schemaComparer.diagnostics) {
44
56
  visitor.visit(diagnostic);
45
57
  }
46
58
  const differences = [
@@ -49,7 +61,7 @@ async function getSchemaDifferences(targetSchema, sourceSchema) {
49
61
  ...visitor.schemaItemPathDifferences,
50
62
  ...visitor.customAttributeDifferences,
51
63
  ];
52
- const conflicts = await (0, SchemaDifferenceValidator_1.validateDifferences)(differences, targetSchema, sourceSchema);
64
+ const conflicts = await (0, SchemaDifferenceValidator_1.validateDifferences)(differences, targetSchema, sourceSchema, schemaComparer.nameMappings);
53
65
  return {
54
66
  sourceSchemaName: sourceSchema.schemaKey.toString(),
55
67
  targetSchemaName: targetSchema.schemaKey.toString(),
@@ -57,4 +69,38 @@ async function getSchemaDifferences(targetSchema, sourceSchema) {
57
69
  differences,
58
70
  };
59
71
  }
72
+ /**
73
+ * Implementation of a SchemaComparer that is used in the schema differencing process.
74
+ * It extends the SchemaComparer base class with additional functionality to store the
75
+ * name mappings of renamed schema items and properties.
76
+ *
77
+ * @internal
78
+ */
79
+ class DifferenceSchemaComparer extends SchemaComparer_1.SchemaComparer {
80
+ get diagnostics() {
81
+ return this._changes[0].allDiagnostics;
82
+ }
83
+ constructor() {
84
+ super({ report: (changes) => this._changes.push(changes) });
85
+ this._changes = [];
86
+ this.nameMappings = new NameMapping_1.NameMapping();
87
+ }
88
+ async resolveItem(item, lookupSchema) {
89
+ const classKey = this.nameMappings.resolveItemKey(item.key);
90
+ return lookupSchema.lookupItem(classKey.name);
91
+ }
92
+ async resolveProperty(propertyA, ecClass) {
93
+ const propertyKey = this.nameMappings.resolvePropertyKey(new NameMapping_1.PropertyKey(propertyA.name, propertyA.class.key));
94
+ return ecClass.getProperty(propertyKey.propertyName);
95
+ }
96
+ areEqualByName(itemKeyA, itemKeyB) {
97
+ if (itemKeyA) {
98
+ if (ecschema_metadata_1.SchemaItem.isSchemaItem(itemKeyA)) {
99
+ itemKeyA = itemKeyA.key;
100
+ }
101
+ itemKeyA = this.nameMappings.resolveItemKey(itemKeyA);
102
+ }
103
+ return super.areEqualByName(itemKeyA, itemKeyB);
104
+ }
105
+ }
60
106
  //# sourceMappingURL=SchemaDifference.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaDifference.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifference.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAoZH,oDAyBC;AA1aD,uEAAoE;AAEpE,iEAA8D;AAO9D,2EAAkE;AAsBlE;;;GAGG;AACH,IAAY,gBAUX;AAVD,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;AACvE,CAAC,EAVW,gBAAgB,gCAAhB,gBAAgB,QAU3B;AA6VD;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB,CAAC,YAAoB,EAAE,YAAoB;IACnF,MAAM,WAAW,GAAoB,EAAE,CAAC;IACxC,MAAM,cAAc,GAAG,IAAI,+BAAc,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC1F,MAAM,cAAc,CAAC,cAAc,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAEhE,MAAM,OAAO,GAAG,IAAI,iDAAuB,EAAE,CAAC;IAC9C,KAAK,MAAM,UAAU,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC;QACvD,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,WAAW,GAA0B;QACzC,GAAG,OAAO,CAAC,iBAAiB;QAC5B,GAAG,OAAO,CAAC,qBAAqB;QAChC,GAAG,OAAO,CAAC,yBAAyB;QACpC,GAAG,OAAO,CAAC,0BAA0B;KACtC,CAAC;IAEF,MAAM,SAAS,GAAG,MAAM,IAAA,+CAAmB,EAAC,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;IAErF,OAAO;QACL,gBAAgB,EAAE,YAAY,CAAC,SAAS,CAAC,QAAQ,EAAE;QACnD,gBAAgB,EAAE,YAAY,CAAC,SAAS,CAAC,QAAQ,EAAE;QACnD,SAAS,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACvD,WAAW;KACZ,CAAC;AACJ,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 { AnySchemaDifferenceConflict } from \"./SchemaConflicts\";\nimport { SchemaDiagnosticVisitor } from \"./SchemaDiagnosticVisitor\";\nimport { SchemaChanges } from \"../Validation/SchemaChanges\";\nimport { SchemaComparer } from \"../Validation/SchemaComparer\";\nimport {\n AnyEnumerator, AnyPropertyProps, ConstantProps, CustomAttribute,\n CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps,\n MixinProps, PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, RelationshipConstraintProps,\n type Schema, SchemaItemFormatProps, SchemaItemProps, SchemaItemType, SchemaItemUnitProps, SchemaReferenceProps, StructClassProps, UnitSystemProps,\n} from \"@itwin/ecschema-metadata\";\nimport { validateDifferences } from \"./SchemaDifferenceValidator\";\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): Promise<SchemaDifferenceResult> {\n const changesList: SchemaChanges[] = [];\n const schemaComparer = new SchemaComparer({ report: changesList.push.bind(changesList) });\n await schemaComparer.compareSchemas(sourceSchema, targetSchema);\n\n const visitor = new SchemaDiagnosticVisitor();\n for (const diagnostic of changesList[0].allDiagnostics) {\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);\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"]}
1
+ {"version":3,"file":"SchemaDifference.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifference.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAuZH,oDAmCC;AAvbD,8DAA8E;AAC9E,uEAAoE;AAEpE,iEAA8D;AAC9D,gEAKkC;AAClC,2EAAkE;AAElE,8DAAwE;AAsBxE;;;GAGG;AACH,IAAY,gBAUX;AAVD,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;AACvE,CAAC,EAVW,gBAAgB,gCAAhB,gBAAgB,QAU3B;AA6VD;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB,CAAC,YAAoB,EAAE,YAAoB,EAAE,WAAsC;IAC3H,MAAM,cAAc,GAAG,IAAI,wBAAwB,EAAE,CAAC;IACtD,IAAG,WAAW,EAAE,CAAC;QACf,KAAI,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC9B,IAAG,IAAI,CAAC,IAAI,KAAK,4BAAc,CAAC,gBAAgB,EAAE,CAAC;gBACjD,cAAc,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI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CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAwB,CAAC,EAAE,CAAC,CAAC;QAE7E,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,IAAI,yBAAW,EAAE,CAAC;IACxC,CAAC;IAEe,KAAK,CAAC,WAAW,CAA2B,IAAgB,EAAE,YAAoB;QAChG,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;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"]}
@@ -4,6 +4,7 @@
4
4
  import { Schema } from "@itwin/ecschema-metadata";
5
5
  import { AnySchemaDifference } from "./SchemaDifference";
6
6
  import { AnySchemaDifferenceConflict } from "./SchemaConflicts";
7
+ import { NameMapping } from "../Merging/Edits/NameMapping";
7
8
  /**
8
9
  * Validates the given array of schema differences and returns a list of conflicts if the
9
10
  * validation finds violation against rules.
@@ -13,5 +14,5 @@ import { AnySchemaDifferenceConflict } from "./SchemaConflicts";
13
14
  * @returns An array of conflicts found when validating the difference.
14
15
  * @internal
15
16
  */
16
- export declare function validateDifferences(differences: AnySchemaDifference[], targetSchema: Schema, sourceSchema: Schema): Promise<AnySchemaDifferenceConflict[]>;
17
+ export declare function validateDifferences(differences: AnySchemaDifference[], targetSchema: Schema, sourceSchema: Schema, nameMappings: NameMapping): Promise<AnySchemaDifferenceConflict[]>;
17
18
  //# sourceMappingURL=SchemaDifferenceValidator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaDifferenceValidator.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifferenceValidator.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAqM,MAAM,EAA8C,MAAM,0BAA0B,CAAC;AACjS,OAAO,EAA0B,mBAAmB,EAA2mB,MAAM,oBAAoB,CAAC;AAC1rB,OAAO,EAAE,2BAA2B,EAAgB,MAAM,mBAAmB,CAAC;AAG9E;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,mBAAmB,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,0CAOvH"}
1
+ {"version":3,"file":"SchemaDifferenceValidator.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifferenceValidator.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAqM,MAAM,EAA8C,MAAM,0BAA0B,CAAC;AACjS,OAAO,EAA0B,mBAAmB,EAA2mB,MAAM,oBAAoB,CAAC;AAC1rB,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"}