@itwin/ecschema-editing 4.8.0-dev.3 → 4.8.0-dev.32

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 (79) hide show
  1. package/CHANGELOG.md +43 -1
  2. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +1 -0
  3. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
  4. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +23 -11
  5. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
  6. package/lib/cjs/Differencing/SchemaDifference.d.ts +10 -119
  7. package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
  8. package/lib/cjs/Differencing/SchemaDifference.js +28 -198
  9. package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
  10. package/lib/cjs/Differencing/Utils.d.ts +100 -0
  11. package/lib/cjs/Differencing/Utils.d.ts.map +1 -0
  12. package/lib/cjs/Differencing/Utils.js +165 -0
  13. package/lib/cjs/Differencing/Utils.js.map +1 -0
  14. package/lib/cjs/Editing/CustomAttributes.d.ts +1 -1
  15. package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -1
  16. package/lib/cjs/Editing/CustomAttributes.js +2 -2
  17. package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
  18. package/lib/cjs/Editing/ECClasses.d.ts +0 -7
  19. package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
  20. package/lib/cjs/Editing/ECClasses.js +0 -27
  21. package/lib/cjs/Editing/ECClasses.js.map +1 -1
  22. package/lib/cjs/Editing/Editor.d.ts +19 -3
  23. package/lib/cjs/Editing/Editor.d.ts.map +1 -1
  24. package/lib/cjs/Editing/Editor.js +48 -3
  25. package/lib/cjs/Editing/Editor.js.map +1 -1
  26. package/lib/cjs/Editing/Enumerations.js +4 -4
  27. package/lib/cjs/Editing/Enumerations.js.map +1 -1
  28. package/lib/cjs/Editing/Exception.d.ts +237 -140
  29. package/lib/cjs/Editing/Exception.d.ts.map +1 -1
  30. package/lib/cjs/Editing/Exception.js +216 -196
  31. package/lib/cjs/Editing/Exception.js.map +1 -1
  32. package/lib/cjs/Editing/Formats.d.ts.map +1 -1
  33. package/lib/cjs/Editing/Formats.js +4 -1
  34. package/lib/cjs/Editing/Formats.js.map +1 -1
  35. package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
  36. package/lib/cjs/Editing/KindOfQuantities.js +3 -1
  37. package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
  38. package/lib/cjs/Editing/Mutable/MutableCAClass.d.ts +1 -1
  39. package/lib/cjs/Editing/Mutable/MutableCAClass.d.ts.map +1 -1
  40. package/lib/cjs/Editing/Mutable/MutableCAClass.js.map +1 -1
  41. package/lib/cjs/Editing/Mutable/MutableSchema.d.ts +2 -0
  42. package/lib/cjs/Editing/Mutable/MutableSchema.d.ts.map +1 -1
  43. package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
  44. package/lib/cjs/Editing/Mutable/MutableSchemaItem.d.ts +11 -0
  45. package/lib/cjs/Editing/Mutable/MutableSchemaItem.d.ts.map +1 -0
  46. package/lib/cjs/Editing/Mutable/MutableSchemaItem.js +16 -0
  47. package/lib/cjs/Editing/Mutable/MutableSchemaItem.js.map +1 -0
  48. package/lib/cjs/Editing/Properties.d.ts +1 -4
  49. package/lib/cjs/Editing/Properties.d.ts.map +1 -1
  50. package/lib/cjs/Editing/Properties.js +4 -5
  51. package/lib/cjs/Editing/Properties.js.map +1 -1
  52. package/lib/cjs/Editing/SchemaItems.d.ts +21 -2
  53. package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -1
  54. package/lib/cjs/Editing/SchemaItems.js +55 -24
  55. package/lib/cjs/Editing/SchemaItems.js.map +1 -1
  56. package/lib/cjs/Merging/CAClassMerger.js +2 -2
  57. package/lib/cjs/Merging/CAClassMerger.js.map +1 -1
  58. package/lib/cjs/Merging/ClassMerger.d.ts.map +1 -1
  59. package/lib/cjs/Merging/ClassMerger.js +10 -10
  60. package/lib/cjs/Merging/ClassMerger.js.map +1 -1
  61. package/lib/cjs/Merging/SchemaItemMerger.d.ts +4 -4
  62. package/lib/cjs/Merging/SchemaItemMerger.d.ts.map +1 -1
  63. package/lib/cjs/Merging/SchemaItemMerger.js +18 -18
  64. package/lib/cjs/Merging/SchemaItemMerger.js.map +1 -1
  65. package/lib/cjs/Merging/SchemaMerger.d.ts +7 -7
  66. package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
  67. package/lib/cjs/Merging/SchemaMerger.js +32 -31
  68. package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
  69. package/lib/cjs/Validation/SchemaCompareVisitor.d.ts.map +1 -1
  70. package/lib/cjs/Validation/SchemaCompareVisitor.js +25 -14
  71. package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
  72. package/lib/cjs/Validation/SchemaComparer.d.ts.map +1 -1
  73. package/lib/cjs/Validation/SchemaComparer.js +36 -13
  74. package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
  75. package/lib/cjs/ecschema-editing.d.ts +3 -1
  76. package/lib/cjs/ecschema-editing.d.ts.map +1 -1
  77. package/lib/cjs/ecschema-editing.js +4 -2
  78. package/lib/cjs/ecschema-editing.js.map +1 -1
  79. package/package.json +9 -9
@@ -282,9 +282,9 @@ class SchemaComparer {
282
282
  async compareCustomAttributeClasses(customAttributeClassA, customAttributeClassB) {
283
283
  if (this._compareDirection === SchemaCompareDirection.Backward || !customAttributeClassB)
284
284
  return;
285
- if (customAttributeClassA.containerType !== customAttributeClassB.containerType) {
286
- const typeA = (0, ecschema_metadata_1.containerTypeToString)(customAttributeClassA.containerType);
287
- const typeB = (0, ecschema_metadata_1.containerTypeToString)(customAttributeClassB.containerType);
285
+ if (customAttributeClassA.appliesTo !== customAttributeClassB.appliesTo) {
286
+ const typeA = (0, ecschema_metadata_1.containerTypeToString)(customAttributeClassA.appliesTo);
287
+ const typeB = (0, ecschema_metadata_1.containerTypeToString)(customAttributeClassB.appliesTo);
288
288
  await this._reporter.reportCustomAttributeClassDelta(customAttributeClassA, "appliesTo", typeA, typeB, this._compareDirection);
289
289
  }
290
290
  }
@@ -679,8 +679,8 @@ class SchemaComparer {
679
679
  * @returns true if both names are the same and they come from their respective top level schema.
680
680
  */
681
681
  areItemsSameByName(itemKeyA, itemKeyB, topLevelSchemaNameA, topLevelSchemaNameB) {
682
- const nameA = itemKeyA ? itemKeyA.name : undefined;
683
- const nameB = itemKeyB ? itemKeyB.name : undefined;
682
+ const nameA = itemKeyA ? itemKeyA.name.toUpperCase() : undefined;
683
+ const nameB = itemKeyB ? itemKeyB.name.toUpperCase() : undefined;
684
684
  const schemaNameA = itemKeyA
685
685
  ? ecschema_metadata_1.SchemaItem.isSchemaItem(itemKeyA)
686
686
  ? itemKeyA.schema.name
@@ -702,19 +702,18 @@ class SchemaComparer {
702
702
  */
703
703
  containerHasClass(attributeA, containerA, containerB) {
704
704
  if (containerB && containerB.customAttributes) {
705
- for (const caB of containerB.customAttributes) {
706
- const attributeB = caB[1];
705
+ for (const [_className, attributeB] of containerB.customAttributes) {
707
706
  const classItemKeyA = containerA.schema.getSchemaItemKey(attributeA.className);
708
707
  const classItemKeyB = containerB.schema.getSchemaItemKey(attributeB.className);
709
708
  if (this.areItemsSameByName(classItemKeyA, classItemKeyB, containerA.schema.name, containerB.schema.name)) {
710
- return Object.keys(attributeA).every((property) => {
711
- const propertyName = property.toString();
709
+ return Object.keys(attributeA).every((propertyName) => {
712
710
  const valueA = attributeA[propertyName];
713
711
  const valueB = attributeB[propertyName];
714
- return propertyName === "className"
715
- || valueA === valueB
716
- || Array.isArray(valueA) && Array.isArray(valueB) && valueA.length === valueB.length
717
- && valueA.every((val, idx) => val === valueB[idx]);
712
+ // If propertyName is class name, they don't need to be compared as this has been done
713
+ // in the areItemsSameByName function.
714
+ if (propertyName === "className")
715
+ return true;
716
+ return deepEquals(valueA, valueB);
718
717
  });
719
718
  }
720
719
  }
@@ -723,4 +722,28 @@ class SchemaComparer {
723
722
  }
724
723
  }
725
724
  exports.SchemaComparer = SchemaComparer;
725
+ /**
726
+ * Compares two values on their deep equality.
727
+ * @param a left side to compare
728
+ * @param b right side to compare
729
+ * @returns true if they are deeply equal, otherwise false.
730
+ */
731
+ function deepEquals(a, b) {
732
+ if (Array.isArray(a) && Array.isArray(b)) {
733
+ return a.length === b.length && a.every((value, index) => {
734
+ return deepEquals(value, b[index]);
735
+ });
736
+ }
737
+ if (isObject(a) && isObject(b)) {
738
+ const propertiesA = Object.keys(a);
739
+ const propertiesB = Object.keys(b);
740
+ return propertiesA.length === propertiesB.length && propertiesA.every((propertyName) => {
741
+ return deepEquals(a[propertyName], b[propertyName]);
742
+ });
743
+ }
744
+ return a === b;
745
+ }
746
+ function isObject(value) {
747
+ return typeof value === "object";
748
+ }
726
749
  //# sourceMappingURL=SchemaComparer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaComparer.js","sourceRoot":"","sources":["../../../src/Validation/SchemaComparer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAKkC;AAClC,wDAA+H;AAE/H,+EAA4E;AAC5E,iEAA8D;AAC9D,iDAA8C;AAE9C;;;;GAIG;AACH,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,yEAAW,CAAA;IACX,2EAAY,CAAA;AACd,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC;AA2BD,SAAS,WAAW,CAAC,MAAe,EAAE,MAAe;IACnD,MAAM,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,MAAM,KAAK,MAAM,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAa,cAAc;IAKzB;;;O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D,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA70BD,wCA60BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Comparison\r\n */\r\n\r\nimport {\r\n AnyClass, AnyEnumerator, AnyProperty, classModifierToString, Constant, containerTypeToString, CustomAttribute, CustomAttributeClass,\r\n CustomAttributeContainerProps, EntityClass, Enumeration, Format, InvertedUnit, KindOfQuantity, Mixin, OverrideFormat, Phenomenon,\r\n primitiveTypeToString, PropertyCategory, propertyTypeToString, RelationshipClass, RelationshipConstraint, Schema,\r\n SchemaItem, SchemaItemKey, strengthDirectionToString, strengthToString, Unit,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { formatTraitsToArray, formatTypeToString, scientificTypeToString, showSignOptionToString } from \"@itwin/core-quantity\";\r\nimport { ISchemaCompareReporter } from \"./SchemaCompareReporter\";\r\nimport { SchemaCompareResultDelegate } from \"./SchemaCompareResultDelegate\";\r\nimport { SchemaCompareVisitor } from \"./SchemaCompareVisitor\";\r\nimport { SchemaWalker } from \"./SchemaWalker\";\r\n\r\n/**\r\n * Enum that identifies if Schema A is being iterated (Forward) or\r\n * Schema B is being iterated (Backward);\r\n * @alpha\r\n */\r\nexport enum SchemaCompareDirection {\r\n Forward = 0,\r\n Backward = 1,\r\n}\r\n/**\r\n * Interface for comparing EC Schemas.\r\n * @alpha\r\n */\r\nexport interface ISchemaComparer {\r\n compareSchemas(schemaA: Schema, schemaB: Schema): void;\r\n compareSchemaProps(schemaA: Schema, schemaB: Schema): void;\r\n compareSchemaItems(schemaItemA: SchemaItem, schemaItemB: SchemaItem | undefined): void;\r\n compareClasses(classA: AnyClass, classB: AnyClass | undefined): void;\r\n compareProperties(propertyA: AnyProperty, propertyB: AnyProperty | undefined): void;\r\n compareEntityClasses(entityA: EntityClass, entityB: EntityClass | undefined): void;\r\n compareMixins(mixinA: Mixin, mixinB: Mixin | undefined): void;\r\n compareRelationshipClasses(relationshipClassA: RelationshipClass, relationshipClassB: RelationshipClass | undefined): void;\r\n compareRelationshipConstraints(relationshipConstraintA: RelationshipConstraint, relationshipConstraintB: RelationshipConstraint | undefined): void;\r\n compareCustomAttributeClasses(customAttributeClassA: CustomAttributeClass, customAttributeClassB: CustomAttributeClass | undefined): void;\r\n compareCustomAttributeContainers(containerA: CustomAttributeContainerProps, containerB: CustomAttributeContainerProps | undefined): void;\r\n compareEnumerations(enumA: Enumeration, enumB: Enumeration | undefined): void;\r\n compareKindOfQuantities(koqA: KindOfQuantity, koqB: KindOfQuantity | undefined): void;\r\n comparePropertyCategories(categoryA: PropertyCategory, categoryB: PropertyCategory | undefined): void;\r\n compareFormats(formatA: Format, formatB: Format | undefined): void;\r\n compareUnits(unitA: Unit, unitB: Unit | undefined): void;\r\n compareInvertedUnits(invertedUnitA: InvertedUnit, invertedUnitB: InvertedUnit | undefined): void;\r\n comparePhenomenons(phenomenonA: Phenomenon, phenomenonB: Phenomenon | undefined): void;\r\n compareConstants(constantA: Constant, constantB: Constant | undefined): void;\r\n}\r\n\r\nfunction labelsMatch(label1?: string, label2?: string) {\r\n label1 = label1 === undefined ? \"\" : label1;\r\n label2 = label2 === undefined ? \"\" : label2;\r\n return label1 === label2;\r\n}\r\n\r\n/**\r\n * Compares EC Schemas and reports differences using the [[IDiagnosticReporter]] objects\r\n * specified.\r\n * @alpha\r\n */\r\nexport class SchemaComparer {\r\n private _compareDirection: SchemaCompareDirection;\r\n private _reporter!: SchemaCompareResultDelegate;\r\n private _reporters: ISchemaCompareReporter[];\r\n\r\n /**\r\n * Initializes a new SchemaComparer instance.\r\n * @param reporters The [[IDiagnosticReporter]] object(s) to use to report the results.\r\n */\r\n constructor(...reporters: ISchemaCompareReporter[]) {\r\n this._compareDirection = SchemaCompareDirection.Forward;\r\n this._reporters = reporters;\r\n }\r\n\r\n /**\r\n * Compares two schemas to identify differences.\r\n * @param schemaA The first Schema.\r\n * @param schemaB The second Schema.\r\n */\r\n public async compareSchemas(schemaA: Schema, schemaB: Schema) {\r\n this._reporter = new SchemaCompareResultDelegate(schemaA, schemaB, ...this._reporters);\r\n let visitor = new SchemaCompareVisitor(this, schemaB);\r\n let walker = new SchemaWalker(visitor);\r\n await walker.traverseSchema(schemaA);\r\n\r\n this._compareDirection = SchemaCompareDirection.Backward;\r\n\r\n visitor = new SchemaCompareVisitor(this, schemaA);\r\n walker = new SchemaWalker(visitor);\r\n await walker.traverseSchema(schemaB);\r\n\r\n this._compareDirection = SchemaCompareDirection.Forward;\r\n this._reporter.compareComplete();\r\n }\r\n\r\n /**\r\n * Compares two schemas to identify differences between property values.\r\n * @param schemaA The first Schema.\r\n * @param schemaB The second Schema.\r\n */\r\n public async compareSchemaProps(schemaA: Schema, schemaB: Schema): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n for (const ref of schemaA.references) {\r\n const refB = await schemaB.getReference(ref.fullName);\r\n if (!refB)\r\n promises.push(this._reporter.reportSchemaReferenceMissing(schemaA, ref, this._compareDirection));\r\n else if (!refB.schemaKey.matches(ref.schemaKey))\r\n promises.push(this._reporter.reportSchemaReferenceDelta(schemaA, ref, ref.schemaKey.version.toString(), refB.schemaKey.version.toString(), this._compareDirection));\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward)\r\n return;\r\n\r\n if (schemaA.schemaKey.toString() !== schemaB.schemaKey.toString())\r\n promises.push(this._reporter.reportSchemaDelta(schemaA, \"schemaKey\", schemaA.schemaKey.toString(), schemaB.schemaKey.toString(), this._compareDirection));\r\n\r\n if (schemaA.alias !== schemaB.alias)\r\n promises.push(this._reporter.reportSchemaDelta(schemaA, \"alias\", schemaA.alias, schemaB.alias, this._compareDirection));\r\n\r\n if (schemaA.description !== schemaB.description)\r\n promises.push(this._reporter.reportSchemaDelta(schemaA, \"description\", schemaA.description, schemaB.description, this._compareDirection));\r\n\r\n if (schemaA.label !== schemaB.label)\r\n promises.push(this._reporter.reportSchemaDelta(schemaA, \"label\", schemaA.label, schemaB.label, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two SchemaItems to identify differences between property values.\r\n * @param schemaItemA The first SchemaItem.\r\n * @param schemaItemB The second SchemaItem.\r\n */\r\n public async compareSchemaItems(schemaItemA: SchemaItem, schemaItemB: SchemaItem | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n if (!schemaItemB) {\r\n promises.push(this._reporter.reportSchemaItemMissing(schemaItemA, this._compareDirection));\r\n await Promise.all(promises);\r\n return;\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward)\r\n return;\r\n\r\n if (schemaItemA.description !== schemaItemB.description)\r\n promises.push(this._reporter.reportSchemaItemDelta(schemaItemA, \"description\", schemaItemA.description, schemaItemB.description, this._compareDirection));\r\n\r\n if (!labelsMatch(schemaItemA.label, schemaItemB.label))\r\n promises.push(this._reporter.reportSchemaItemDelta(schemaItemA, \"label\", schemaItemA.label, schemaItemB.label, this._compareDirection));\r\n\r\n if (schemaItemA.schemaItemType !== schemaItemB.schemaItemType) {\r\n const aType = schemaItemA.schemaItemType;\r\n const bType = schemaItemB.schemaItemType;\r\n promises.push(this._reporter.reportSchemaItemDelta(schemaItemA, \"schemaItemType\", aType, bType, this._compareDirection));\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two ECClasses to identify differences between property values.\r\n * @param classA The first ECClass.\r\n * @param classB The second ECClass.\r\n */\r\n public async compareClasses(classA: AnyClass, classB: AnyClass | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !classB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (classA.modifier !== classB.modifier) {\r\n const aMod = classModifierToString(classA.modifier);\r\n const bMod = classModifierToString(classB.modifier);\r\n promises.push(this._reporter.reportClassDelta(classA, \"modifier\", aMod, bMod, this._compareDirection));\r\n }\r\n\r\n if (classA.baseClass || classB.baseClass) {\r\n const fullNameA = classA.baseClass?.fullName;\r\n const fullNameB = classB.baseClass?.fullName;\r\n\r\n if (fullNameA !== fullNameB) {\r\n const areSameByName = this.areItemsSameByName(classA.baseClass, classB.baseClass, classA.schema.name, classB.schema.name);\r\n if (!areSameByName) {\r\n const baseA = await classA.baseClass as AnyClass;\r\n const baseB = await classB.baseClass as AnyClass;\r\n promises.push(this._reporter.reportBaseClassDelta(classA, baseA, baseB, this._compareDirection));\r\n }\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two ECProperties to identify differences between property values.\r\n * @param propertyA The first ECProperty.\r\n * @param propertyB The second ECProperty.\r\n */\r\n public async compareProperties(propertyA: AnyProperty, propertyB: AnyProperty | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (!propertyB) {\r\n promises.push(this._reporter.reportPropertyMissing(propertyA, this._compareDirection));\r\n await Promise.all(promises);\r\n return;\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward)\r\n return;\r\n\r\n if (!labelsMatch(propertyA.label, propertyB.label))\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"label\", propertyA.label, propertyB.label, this._compareDirection));\r\n\r\n if (propertyA.description !== propertyB.description)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"description\", propertyA.description, propertyB.description, this._compareDirection));\r\n\r\n if (propertyA.isReadOnly !== propertyB.isReadOnly)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"isReadOnly\", propertyA.isReadOnly, propertyB.isReadOnly, this._compareDirection));\r\n\r\n if (propertyA.priority !== propertyB.priority)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"priority\", propertyA.priority, propertyB.priority, this._compareDirection));\r\n\r\n if (propertyA.category || propertyB.category) {\r\n const catKeyA = propertyA.category?.fullName;\r\n const catKeyB = propertyB.category?.fullName;\r\n if (catKeyA !== catKeyB) {\r\n const areSameByName = this.areItemsSameByName(propertyA.category, propertyB.category, propertyA.schema.name, propertyB.schema.name);\r\n if (!areSameByName)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"category\", catKeyA, catKeyB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (propertyA.kindOfQuantity || propertyB.kindOfQuantity) {\r\n const koqKeyA = propertyA.kindOfQuantity?.fullName;\r\n const koqKeyB = propertyB.kindOfQuantity?.fullName;\r\n if (koqKeyA !== koqKeyB) {\r\n const areSameByName = this.areItemsSameByName(propertyA.kindOfQuantity, propertyB.kindOfQuantity, propertyA.schema.name, propertyB.schema.name);\r\n if (!areSameByName)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"kindOfQuantity\", koqKeyA, koqKeyB, this._compareDirection));\r\n }\r\n }\r\n\r\n promises.push(this.comparePropertyType(propertyA, propertyB));\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two EntityClass objects to identify differences between property values.\r\n * @param entityA\r\n * @param entityB\r\n */\r\n public async compareEntityClasses(entityA: EntityClass, entityB: EntityClass | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n if (entityB) {\r\n for (const mixinA of entityA.mixins) {\r\n if (-1 === entityB.mixins.findIndex((mixinB) => this.areItemsSameByName(mixinA, mixinB, entityA.schema.name, entityB.schema.name)))\r\n promises.push(this._reporter.reportEntityMixinMissing(entityA, await mixinA, this._compareDirection));\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two Mixin objects to identify differences between property values.\r\n * @param mixinA\r\n * @param mixinB\r\n */\r\n public async compareMixins(mixinA: Mixin, mixinB: Mixin | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !mixinB)\r\n return;\r\n\r\n if (mixinA.appliesTo || mixinB.appliesTo) {\r\n const appliesToA = mixinA.appliesTo?.fullName;\r\n const appliesToB = mixinB.appliesTo?.fullName;\r\n if (appliesToA !== appliesToB) {\r\n const areSameByName = this.areItemsSameByName(mixinA.appliesTo, mixinB.appliesTo, mixinA.schema.name, mixinB.schema.name);\r\n if (!areSameByName)\r\n await this._reporter.reportMixinDelta(mixinA, \"appliesTo\", appliesToA, appliesToB, this._compareDirection);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Compares two RelationshipClass objects to identify differences between property values.\r\n * @param relationshipA\r\n * @param relationshipB\r\n */\r\n public async compareRelationshipClasses(relationshipA: RelationshipClass, relationshipB: RelationshipClass | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !relationshipB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (relationshipA.strength !== relationshipB.strength) {\r\n const strengthAString = strengthToString(relationshipA.strength);\r\n const strengthBString = strengthToString(relationshipB.strength);\r\n promises.push(this._reporter.reportRelationshipClassDelta(relationshipA, \"strength\", strengthAString, strengthBString, this._compareDirection));\r\n }\r\n\r\n if (relationshipA.strengthDirection !== relationshipB.strengthDirection) {\r\n const directionAString = strengthDirectionToString(relationshipA.strengthDirection);\r\n const directionBString = strengthDirectionToString(relationshipB.strengthDirection);\r\n promises.push(this._reporter.reportRelationshipClassDelta(relationshipA, \"strengthDirection\", directionAString, directionBString, this._compareDirection));\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two RelationshipConstraint objects to identify differences between property values.\r\n * @param relationshipConstraintA\r\n * @param relationshipConstraintB\r\n */\r\n public async compareRelationshipConstraints(constraintA: RelationshipConstraint, constraintB: RelationshipConstraint | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (constraintB && constraintA.constraintClasses) {\r\n for (const classA of constraintA.constraintClasses) {\r\n if (!constraintB.constraintClasses || -1 === constraintB.constraintClasses.findIndex((classB) =>\r\n this.areItemsSameByName(classA, classB, constraintA.schema.name, constraintB.schema.name)))\r\n promises.push(this._reporter.reportRelationshipConstraintClassMissing(constraintA, await classA, this._compareDirection));\r\n }\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !constraintB) {\r\n await Promise.all(promises);\r\n return;\r\n }\r\n\r\n if (constraintA.multiplicity || constraintB.multiplicity) {\r\n const multiplicityA = constraintA.multiplicity.toString();\r\n const multiplicityB = constraintB.multiplicity.toString();\r\n if (multiplicityA !== multiplicityB)\r\n promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, \"multiplicity\", multiplicityA, multiplicityB, this._compareDirection));\r\n }\r\n\r\n if (constraintA.roleLabel !== constraintB.roleLabel)\r\n promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, \"roleLabel\", constraintA.roleLabel, constraintB.roleLabel, this._compareDirection));\r\n\r\n if (constraintA.polymorphic !== constraintB.polymorphic)\r\n promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, \"polymorphic\", constraintA.polymorphic, constraintB.polymorphic, this._compareDirection));\r\n\r\n if (constraintA.abstractConstraint || constraintB.abstractConstraint) {\r\n const abstractA = constraintA.abstractConstraint?.fullName;\r\n const abstractB = constraintB.abstractConstraint?.fullName;\r\n if (abstractA !== abstractB) {\r\n const areSameByName = this.areItemsSameByName(constraintA.abstractConstraint, constraintB.abstractConstraint, constraintA.schema.name, constraintB.schema.name);\r\n if (!areSameByName) {\r\n promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, \"abstractConstraint\", abstractA, abstractB, this._compareDirection));\r\n }\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two CustomAttributeClass objects to identify differences between property values.\r\n * @param customAttributeClassA\r\n * @param customAttributeClassB\r\n */\r\n public async compareCustomAttributeClasses(customAttributeClassA: CustomAttributeClass, customAttributeClassB: CustomAttributeClass | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !customAttributeClassB)\r\n return;\r\n\r\n if (customAttributeClassA.containerType !== customAttributeClassB.containerType) {\r\n const typeA = containerTypeToString(customAttributeClassA.containerType);\r\n const typeB = containerTypeToString(customAttributeClassB.containerType);\r\n await this._reporter.reportCustomAttributeClassDelta(customAttributeClassA, \"appliesTo\", typeA, typeB, this._compareDirection);\r\n }\r\n }\r\n\r\n /**\r\n * Compares two CustomAttributeContainerProps objects to identify differences between property values.\r\n * @param containerA\r\n * @param containerB\r\n */\r\n public async compareCustomAttributeContainers(containerA: CustomAttributeContainerProps, containerB: CustomAttributeContainerProps | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (containerB && containerA.customAttributes) {\r\n for (const ca of containerA.customAttributes) {\r\n if (!containerB.customAttributes || !this.containerHasClass(ca[1], containerA, containerB))\r\n promises.push(this._reporter.reportCustomAttributeInstanceClassMissing(containerA, ca[1], this._compareDirection));\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two Enumeration objects to identify differences between property values.\r\n * @param enumA\r\n * @param enumB\r\n */\r\n public async compareEnumerations(enumA: Enumeration, enumB: Enumeration | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (enumB) {\r\n for (const enumeratorA of enumA.enumerators) {\r\n const enumeratorB = enumB.enumerators.find((e) => e.name === enumeratorA.name);\r\n if (!enumeratorB) {\r\n promises.push(this._reporter.reportEnumeratorMissing(enumA, enumeratorA, this._compareDirection));\r\n } else if (this._compareDirection === SchemaCompareDirection.Forward) {\r\n promises.push(this.compareEnumerators(enumeratorA, enumeratorB, enumA, enumB));\r\n }\r\n }\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !enumB) {\r\n await Promise.all(promises);\r\n return;\r\n }\r\n if (enumA.type !== enumB.type) {\r\n const typeAString = enumA.type ? primitiveTypeToString(enumA.type) : undefined;\r\n const typeBString = enumB.type ? primitiveTypeToString(enumB.type) : undefined;\r\n promises.push(this._reporter.reportEnumerationDelta(enumA, \"type\", typeAString, typeBString, this._compareDirection));\r\n }\r\n\r\n if (enumA.isStrict !== enumB.isStrict)\r\n promises.push(this._reporter.reportEnumerationDelta(enumA, \"isStrict\", enumA.isStrict, enumB.isStrict, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two KindOfQuantity objects to identify differences between property values.\r\n * @param koqA\r\n * @param koqB\r\n */\r\n public async compareKindOfQuantities(koqA: KindOfQuantity, koqB: KindOfQuantity | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (koqB && koqA.presentationFormats) {\r\n for (const unitA of koqA.presentationFormats) {\r\n if (-1 === koqB.presentationFormats.findIndex((unitB) => this.areOverrideFormatsSameByName(unitA, unitB, koqA.schema.name, koqB.schema.name)))\r\n promises.push(this._reporter.reportPresentationUnitMissing(koqA, unitA, this._compareDirection));\r\n }\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !koqB) {\r\n await Promise.all(promises);\r\n return;\r\n }\r\n\r\n if (koqA.relativeError !== koqB.relativeError) {\r\n promises.push(this._reporter.reportKoqDelta(koqA, \"relativeError\", koqA.relativeError, koqB.relativeError, this._compareDirection));\r\n }\r\n\r\n if (koqA.persistenceUnit || koqB.persistenceUnit) {\r\n const unitNameA = koqA.persistenceUnit?.fullName;\r\n const unitNameB = koqB.persistenceUnit?.fullName;\r\n if (unitNameA !== unitNameB) {\r\n const eqByName = this.areItemsSameByName(koqA.persistenceUnit, koqB.persistenceUnit, koqA.schema.name, koqB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportKoqDelta(koqA, \"persistenceUnit\", unitNameA, unitNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two PropertyCategory objects to identify differences between property values.\r\n * @param categoryA\r\n * @param categoryB\r\n */\r\n public async comparePropertyCategories(categoryA: PropertyCategory, categoryB: PropertyCategory | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !categoryB)\r\n return;\r\n\r\n if (categoryA.priority !== categoryB.priority)\r\n await this._reporter.reportPropertyCategoryDelta(categoryA, \"priority\", categoryA.priority, categoryB.priority, this._compareDirection);\r\n }\r\n\r\n /**\r\n * Compares two Format objects to identify differences between property values.\r\n * @param formatA\r\n * @param formatB\r\n */\r\n public async compareFormats(formatA: Format, formatB: Format | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n promises.push(this.compareFormatUnits(formatA, formatB));\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !formatB) {\r\n await Promise.all(promises);\r\n return;\r\n }\r\n\r\n if (formatA.roundFactor !== formatB.roundFactor)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"roundFactor\", formatA.roundFactor, formatB.roundFactor, this._compareDirection));\r\n\r\n if (formatA.type !== formatB.type) {\r\n const typeAString = formatTypeToString(formatA.type);\r\n const typeBString = formatTypeToString(formatB.type);\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"type\", typeAString, typeBString, this._compareDirection));\r\n }\r\n\r\n if (formatA.precision !== formatB.precision)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"precision\", formatA.precision, formatB.precision, this._compareDirection));\r\n\r\n if (formatA.minWidth !== formatB.minWidth)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"minWidth\", formatA.minWidth, formatB.minWidth, this._compareDirection));\r\n\r\n if (formatA.scientificType !== formatB.scientificType) {\r\n const typeAString = formatA.scientificType !== undefined ? scientificTypeToString(formatA.scientificType) : undefined;\r\n const typeBString = formatB.scientificType !== undefined ? scientificTypeToString(formatB.scientificType) : undefined;\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"scientificType\", typeAString, typeBString, this._compareDirection));\r\n }\r\n\r\n if (formatA.showSignOption !== formatB.showSignOption) {\r\n const optionA = showSignOptionToString(formatA.showSignOption);\r\n const optionB = showSignOptionToString(formatB.showSignOption);\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"showSignOption\", optionA, optionB, this._compareDirection));\r\n }\r\n\r\n if (formatA.decimalSeparator !== formatB.decimalSeparator)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"decimalSeparator\", formatA.decimalSeparator, formatB.decimalSeparator, this._compareDirection));\r\n\r\n if (formatA.thousandSeparator !== formatB.thousandSeparator)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"thousandSeparator\", formatA.thousandSeparator, formatB.thousandSeparator, this._compareDirection));\r\n\r\n if (formatA.uomSeparator !== formatB.uomSeparator)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"uomSeparator\", formatA.uomSeparator, formatB.uomSeparator, this._compareDirection));\r\n\r\n if (formatA.stationSeparator !== formatB.stationSeparator)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"stationSeparator\", formatA.stationSeparator, formatB.stationSeparator, this._compareDirection));\r\n\r\n if (formatA.stationOffsetSize !== formatB.stationOffsetSize)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"stationOffsetSize\", formatA.stationOffsetSize, formatB.stationOffsetSize, this._compareDirection));\r\n\r\n if (formatA.formatTraits !== formatB.formatTraits) {\r\n const traitsA = formatTraitsToArray(formatA.formatTraits);\r\n const traitsB = formatTraitsToArray(formatB.formatTraits);\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"formatTraits\", traitsA.toString(), traitsB.toString(), this._compareDirection));\r\n }\r\n\r\n if (formatA.spacer !== formatB.spacer)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"spacer\", formatA.spacer, formatB.spacer, this._compareDirection));\r\n\r\n if (formatA.includeZero !== formatB.includeZero)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"includeZero\", formatA.includeZero, formatB.includeZero, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two Unit objects to identify differences between property values.\r\n * @param unitA\r\n * @param unitB\r\n */\r\n public async compareUnits(unitA: Unit, unitB: Unit | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !unitB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (unitA.phenomenon || unitB.phenomenon) {\r\n const fullNameA = unitA.phenomenon?.fullName;\r\n const fullNameB = unitB.phenomenon?.fullName;\r\n if (fullNameA !== fullNameB) {\r\n const eqByName = this.areItemsSameByName(unitA.phenomenon, unitB.phenomenon, unitA.schema.name, unitB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"phenomenon\", fullNameA, fullNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (unitA.unitSystem || unitB.unitSystem) {\r\n const fullNameA = unitA.unitSystem?.fullName;\r\n const fullNameB = unitB.unitSystem?.fullName;\r\n if (fullNameA !== fullNameB) {\r\n const eqByName = this.areItemsSameByName(unitA.unitSystem, unitB.unitSystem, unitA.schema.name, unitB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"unitSystem\", fullNameA, fullNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (unitA.definition !== unitB.definition)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"definition\", unitA.definition, unitB.definition, this._compareDirection));\r\n\r\n if (unitA.numerator !== unitB.numerator)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"numerator\", unitA.numerator, unitB.numerator, this._compareDirection));\r\n\r\n if (unitA.denominator !== unitB.denominator)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"denominator\", unitA.denominator, unitB.denominator, this._compareDirection));\r\n\r\n if (unitA.offset !== unitB.offset)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"offset\", unitA.offset, unitB.offset, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two InvertedUnit objects to identify differences between property values.\r\n * @param invertedUnitA\r\n * @param invertedUnitB\r\n */\r\n public async compareInvertedUnits(invertedUnitA: InvertedUnit, invertedUnitB: InvertedUnit | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !invertedUnitB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (invertedUnitA.invertsUnit || invertedUnitB.invertsUnit) {\r\n const fullNameA = invertedUnitA.invertsUnit?.fullName;\r\n const fullNameB = invertedUnitB.invertsUnit?.fullName;\r\n if (fullNameA !== fullNameB) {\r\n const eqByName = this.areItemsSameByName(invertedUnitA.invertsUnit, invertedUnitB.invertsUnit, invertedUnitA.schema.name, invertedUnitB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportInvertedUnitDelta(invertedUnitA, \"invertsUnit\", fullNameA, fullNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (invertedUnitA.unitSystem || invertedUnitB.unitSystem) {\r\n const fullNameA = invertedUnitA.unitSystem?.fullName;\r\n const fullNameB = invertedUnitB.unitSystem?.fullName;\r\n if (fullNameA !== fullNameB) {\r\n const eqByName = this.areItemsSameByName(invertedUnitA.unitSystem, invertedUnitB.unitSystem, invertedUnitA.schema.name, invertedUnitB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportInvertedUnitDelta(invertedUnitA, \"unitSystem\", fullNameA, fullNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two Phenomenon objects to identify differences between property values.\r\n * @param phenomenonA\r\n * @param phenomenonB\r\n */\r\n public async comparePhenomenons(phenomenonA: Phenomenon, phenomenonB: Phenomenon | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !phenomenonB)\r\n return;\r\n\r\n if (phenomenonA.definition !== phenomenonB.definition)\r\n await this._reporter.reportPhenomenonDelta(phenomenonA, \"definition\", phenomenonA.definition, phenomenonB.definition, this._compareDirection);\r\n }\r\n\r\n /**\r\n * Compares two Constant objects to identify differences between property values.\r\n * @param constantA\r\n * @param constantB\r\n */\r\n public async compareConstants(constantA: Constant, constantB: Constant | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !constantB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (constantA.phenomenon || constantB.phenomenon) {\r\n const fullNameA = constantA.phenomenon?.fullName;\r\n const fullNameB = constantB.phenomenon?.fullName;\r\n if (fullNameA !== fullNameB) {\r\n const eqByName = this.areItemsSameByName(constantA.phenomenon, constantB.phenomenon, constantA.schema.name, constantB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportConstantDelta(constantA, \"phenomenon\", fullNameA, fullNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (constantA.definition !== constantB.definition)\r\n promises.push(this._reporter.reportConstantDelta(constantA, \"definition\", constantA.definition, constantB.definition, this._compareDirection));\r\n\r\n if (constantA.numerator !== constantB.numerator)\r\n promises.push(this._reporter.reportConstantDelta(constantA, \"numerator\", constantA.numerator, constantB.numerator, this._compareDirection));\r\n\r\n if (constantA.denominator !== constantB.denominator)\r\n promises.push(this._reporter.reportConstantDelta(constantA, \"denominator\", constantA.denominator, constantB.denominator, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n private async comparePropertyType(propertyA: AnyProperty, propertyB: AnyProperty): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n const propertyTypeA = propertyTypeToString(propertyA.propertyType);\r\n const propertyTypeB = propertyTypeToString(propertyB.propertyType);\r\n if (propertyTypeA !== propertyTypeB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"type\", propertyTypeA, propertyTypeB, this._compareDirection));\r\n }\r\n\r\n if (propertyA.isArray()) {\r\n const minOccursB = propertyB.isArray() ? propertyB.minOccurs : undefined;\r\n if (propertyA.minOccurs !== minOccursB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"minOccurs\", propertyA.minOccurs, minOccursB, this._compareDirection));\r\n }\r\n\r\n const maxOccursB = propertyB.isArray() ? propertyB.maxOccurs : undefined;\r\n if (propertyA.maxOccurs !== maxOccursB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"maxOccurs\", propertyA.maxOccurs, maxOccursB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (propertyA.isEnumeration()) {\r\n const enumerationB = propertyB.isEnumeration() ? propertyB.enumeration : undefined;\r\n if (propertyA.enumeration || enumerationB) {\r\n const enumA = propertyA.enumeration?.fullName;\r\n const enumB = enumerationB?.fullName;\r\n if (enumA !== enumB) {\r\n const areSameByName = this.areItemsSameByName(propertyA.enumeration, enumerationB, propertyA.schema.name, propertyB.schema.name);\r\n if (!areSameByName) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"enumeration\", enumA, enumB, this._compareDirection));\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (propertyA.isNavigation()) {\r\n const strengthDirectionB = propertyB.isNavigation() ? propertyB.direction : undefined;\r\n if (propertyA.direction !== strengthDirectionB) {\r\n const dirA = strengthDirectionToString(propertyA.direction);\r\n const dirB = strengthDirectionB !== undefined ? strengthDirectionToString(strengthDirectionB) : undefined;\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"direction\", dirA, dirB, this._compareDirection));\r\n }\r\n\r\n if (propertyA.relationshipClass) { // eslint-disable-line @typescript-eslint/no-misused-promises\r\n const relationshipClassB = propertyB.isNavigation() ? propertyB.relationshipClass : undefined;\r\n const relA = propertyA.relationshipClass.fullName;\r\n const relB = relationshipClassB ? relationshipClassB.fullName : undefined;\r\n if (relA !== relB){\r\n const areSameByName = this.areItemsSameByName(propertyA.relationshipClass, relationshipClassB, propertyA.schema.name, propertyB.schema.name);\r\n if(!areSameByName)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"relationshipClass\", relA, relB, this._compareDirection));\r\n }\r\n }\r\n }\r\n\r\n if (propertyA.isPrimitive()) {\r\n const primitiveTypeB = propertyB.isPrimitive() ? propertyB.primitiveType : undefined;\r\n if (propertyA.primitiveType !== primitiveTypeB) {\r\n const aType = primitiveTypeToString(propertyA.primitiveType);\r\n const bType = primitiveTypeB !== undefined ? primitiveTypeToString(primitiveTypeB) : undefined;\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"primitiveType\", aType, bType, this._compareDirection));\r\n }\r\n\r\n const minLengthB = propertyB.isPrimitive() ? propertyB.minLength : undefined;\r\n if (propertyA.minLength !== minLengthB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"minLength\", propertyA.minLength, minLengthB, this._compareDirection));\r\n }\r\n\r\n // valid for primitive and enumeration properties\r\n const maxLengthB = propertyB.isPrimitive() ? propertyB.maxLength : undefined;\r\n if (propertyA.maxLength !== maxLengthB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"maxLength\", propertyA.maxLength, maxLengthB, this._compareDirection));\r\n }\r\n\r\n const minValueB = propertyB.isPrimitive() ? propertyB.minValue : undefined;\r\n if (propertyA.minValue !== minValueB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"minValue\", propertyA.minValue, minValueB, this._compareDirection));\r\n }\r\n\r\n const maxValueB = propertyB.isPrimitive() ? propertyB.maxValue : undefined;\r\n if (propertyA.maxValue !== maxValueB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"maxValue\", propertyA.maxValue, maxValueB, this._compareDirection));\r\n }\r\n\r\n const extendedTypeNameB = propertyB.isPrimitive() ? propertyB.extendedTypeName : undefined;\r\n if (propertyA.extendedTypeName !== extendedTypeNameB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"extendedTypeName\", propertyA.extendedTypeName, extendedTypeNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (propertyA.isStruct()) {\r\n const structA = propertyA.structClass;\r\n const structB = propertyB.isStruct() ? propertyB.structClass : undefined;\r\n if (structA || structB) {\r\n const structNameA = structA.fullName;\r\n const structNameB = structB?.fullName;\r\n if (structNameA !== structNameB) {\r\n const areSameByName = this.areItemsSameByName(structA.key, structB?.key, propertyA.schema.name, propertyB.schema.name);\r\n if (!areSameByName) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"structClass\", structNameA, structNameB, this._compareDirection));\r\n }\r\n }\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n private async compareEnumerators(enumeratorA: AnyEnumerator, enumeratorB: AnyEnumerator, enumA: Enumeration, enumB: Enumeration): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (enumeratorA.description !== enumeratorB.description)\r\n promises.push(this._reporter.reportEnumeratorDelta(enumA, enumeratorA, \"description\", enumeratorA.description, enumeratorB.description, this._compareDirection));\r\n\r\n if (!labelsMatch(enumeratorA.label, enumeratorB.label))\r\n promises.push(this._reporter.reportEnumeratorDelta(enumA, enumeratorA, \"label\", enumeratorA.label, enumeratorB.label, this._compareDirection));\r\n\r\n // No need to compare values if the type is different (which will be reported separately)\r\n if (enumA.type === enumB.type && enumeratorA.value !== enumeratorB.value)\r\n promises.push(this._reporter.reportEnumeratorDelta(enumA, enumeratorA, \"value\", enumeratorA.value, enumeratorB.value, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n private async compareFormatUnits(formatA: Format, formatB: Format | undefined): Promise<void> {\r\n if (!formatA.units || !formatB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n for (const unitA of formatA.units) {\r\n const unitB = formatB.units ? formatB.units.find((u) => this.areItemsSameByName(unitA[0], u[0], formatA.schema.name, formatB.schema.name)) : undefined;\r\n if (!unitB) {\r\n promises.push(this._reporter.reportFormatUnitMissing(formatA, unitA[0], this._compareDirection));\r\n continue;\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward)\r\n continue;\r\n\r\n if (unitA[1] !== unitB[1]) {\r\n const labelA = unitA[1];\r\n const labelB = unitB[1];\r\n promises.push(this._reporter.reportUnitLabelOverrideDelta(formatA, unitB[0], labelA, labelB, this._compareDirection));\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n private areOverrideFormatsSameByName(\r\n itemKeyA: Format | OverrideFormat,\r\n itemKeyB: Format | OverrideFormat,\r\n topLevelSchemaNameA: string,\r\n topLevelSchemaNameB: string | undefined ): boolean {\r\n\r\n if (itemKeyA.units) {\r\n for (const unitA of itemKeyA.units) {\r\n if (!itemKeyB.units\r\n || -1 === itemKeyB.units.findIndex((unitB) => this.areItemsSameByName(unitA[0], unitB[0], topLevelSchemaNameA, topLevelSchemaNameB)\r\n && unitA[1] === unitB[1]))\r\n return false;\r\n }\r\n }\r\n\r\n const itemA = OverrideFormat.isOverrideFormat(itemKeyA) ? itemKeyA.parent : itemKeyA;\r\n const itemB = OverrideFormat.isOverrideFormat(itemKeyB) ? itemKeyB.parent : itemKeyB;\r\n\r\n return itemKeyA.precision === itemKeyB.precision && this.areItemsSameByName(itemA, itemB, topLevelSchemaNameA, topLevelSchemaNameB);\r\n }\r\n\r\n /**\r\n * Compares two item keys.\r\n * @param itemKeyA item key A to compare to.\r\n * @param itemKeyB item key B to compare to.\r\n * @param topLevelSchemaNameA top level schema name in which the item A exists.\r\n * @param topLevelSchemaNameB top level schema name in which the item B exists.\r\n * @returns true if both names are the same and they come from their respective top level schema.\r\n */\r\n private areItemsSameByName(\r\n itemKeyA: Readonly<SchemaItemKey> | SchemaItem | undefined,\r\n itemKeyB: Readonly<SchemaItemKey> | SchemaItem | undefined,\r\n topLevelSchemaNameA: string,\r\n topLevelSchemaNameB: string | undefined ): boolean {\r\n\r\n const nameA = itemKeyA ? itemKeyA.name : undefined;\r\n const nameB = itemKeyB ? itemKeyB.name : undefined;\r\n\r\n const schemaNameA = itemKeyA\r\n ? SchemaItem.isSchemaItem(itemKeyA)\r\n ? itemKeyA.schema.name\r\n : itemKeyA.schemaName\r\n : undefined;\r\n\r\n const schemaNameB = itemKeyB\r\n ? SchemaItem.isSchemaItem(itemKeyB)\r\n ? itemKeyB.schema.name\r\n : itemKeyB.schemaName\r\n : undefined;\r\n\r\n return (nameA === nameB && schemaNameA === topLevelSchemaNameA && schemaNameB === topLevelSchemaNameB) || (nameA === nameB && schemaNameA === schemaNameB);\r\n }\r\n\r\n /**\r\n * Looks for same classA in containerB using key.\r\n * @param classNameA name of the class to look for in containerB.\r\n * @param containerA container which classNameA belongs to.\r\n * @param containerB container in which to look for classNameA.\r\n * @returns true if a same classA is in containerB, otherwise false.\r\n */\r\n private containerHasClass(attributeA: CustomAttribute, containerA: CustomAttributeContainerProps, containerB: CustomAttributeContainerProps): boolean {\r\n if (containerB && containerB.customAttributes) {\r\n for (const caB of containerB.customAttributes) {\r\n const attributeB = caB[1];\r\n const classItemKeyA = containerA.schema.getSchemaItemKey(attributeA.className);\r\n const classItemKeyB = containerB.schema.getSchemaItemKey(attributeB.className);\r\n if (this.areItemsSameByName(classItemKeyA, classItemKeyB, containerA.schema.name, containerB.schema.name)) {\r\n return Object.keys(attributeA).every((property: any) => {\r\n const propertyName = property.toString();\r\n const valueA = attributeA[propertyName];\r\n const valueB = attributeB[propertyName];\r\n return propertyName === \"className\"\r\n || valueA === valueB\r\n || Array.isArray(valueA) && Array.isArray(valueB) && valueA.length === valueB.length\r\n && valueA.every((val: any, idx: number) => val === valueB[idx]);\r\n });\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SchemaComparer.js","sourceRoot":"","sources":["../../../src/Validation/SchemaComparer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAKkC;AAClC,wDAA+H;AAE/H,+EAA4E;AAC5E,iEAA8D;AAC9D,iDAA8C;AAE9C;;;;GAIG;AACH,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,yEAAW,CAAA;IACX,2EAAY,CAAA;AACd,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC;AA2BD,SAAS,WAAW,CAAC,MAAe,EAAE,MAAe;IACnD,MAAM,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MA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KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACxC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YACvD,OAAO,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnC,OAAO,WAAW,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,EAAE;YACrF,OAAO,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Comparison\r\n */\r\n\r\nimport {\r\n AnyClass, AnyEnumerator, AnyProperty, classModifierToString, Constant, containerTypeToString, CustomAttribute, CustomAttributeClass,\r\n CustomAttributeContainerProps, EntityClass, Enumeration, Format, InvertedUnit, KindOfQuantity, Mixin, OverrideFormat, Phenomenon,\r\n primitiveTypeToString, PropertyCategory, propertyTypeToString, RelationshipClass, RelationshipConstraint, Schema,\r\n SchemaItem, SchemaItemKey, strengthDirectionToString, strengthToString, Unit,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { formatTraitsToArray, formatTypeToString, scientificTypeToString, showSignOptionToString } from \"@itwin/core-quantity\";\r\nimport { ISchemaCompareReporter } from \"./SchemaCompareReporter\";\r\nimport { SchemaCompareResultDelegate } from \"./SchemaCompareResultDelegate\";\r\nimport { SchemaCompareVisitor } from \"./SchemaCompareVisitor\";\r\nimport { SchemaWalker } from \"./SchemaWalker\";\r\n\r\n/**\r\n * Enum that identifies if Schema A is being iterated (Forward) or\r\n * Schema B is being iterated (Backward);\r\n * @alpha\r\n */\r\nexport enum SchemaCompareDirection {\r\n Forward = 0,\r\n Backward = 1,\r\n}\r\n/**\r\n * Interface for comparing EC Schemas.\r\n * @alpha\r\n */\r\nexport interface ISchemaComparer {\r\n compareSchemas(schemaA: Schema, schemaB: Schema): void;\r\n compareSchemaProps(schemaA: Schema, schemaB: Schema): void;\r\n compareSchemaItems(schemaItemA: SchemaItem, schemaItemB: SchemaItem | undefined): void;\r\n compareClasses(classA: AnyClass, classB: AnyClass | undefined): void;\r\n compareProperties(propertyA: AnyProperty, propertyB: AnyProperty | undefined): void;\r\n compareEntityClasses(entityA: EntityClass, entityB: EntityClass | undefined): void;\r\n compareMixins(mixinA: Mixin, mixinB: Mixin | undefined): void;\r\n compareRelationshipClasses(relationshipClassA: RelationshipClass, relationshipClassB: RelationshipClass | undefined): void;\r\n compareRelationshipConstraints(relationshipConstraintA: RelationshipConstraint, relationshipConstraintB: RelationshipConstraint | undefined): void;\r\n compareCustomAttributeClasses(customAttributeClassA: CustomAttributeClass, customAttributeClassB: CustomAttributeClass | undefined): void;\r\n compareCustomAttributeContainers(containerA: CustomAttributeContainerProps, containerB: CustomAttributeContainerProps | undefined): void;\r\n compareEnumerations(enumA: Enumeration, enumB: Enumeration | undefined): void;\r\n compareKindOfQuantities(koqA: KindOfQuantity, koqB: KindOfQuantity | undefined): void;\r\n comparePropertyCategories(categoryA: PropertyCategory, categoryB: PropertyCategory | undefined): void;\r\n compareFormats(formatA: Format, formatB: Format | undefined): void;\r\n compareUnits(unitA: Unit, unitB: Unit | undefined): void;\r\n compareInvertedUnits(invertedUnitA: InvertedUnit, invertedUnitB: InvertedUnit | undefined): void;\r\n comparePhenomenons(phenomenonA: Phenomenon, phenomenonB: Phenomenon | undefined): void;\r\n compareConstants(constantA: Constant, constantB: Constant | undefined): void;\r\n}\r\n\r\nfunction labelsMatch(label1?: string, label2?: string) {\r\n label1 = label1 === undefined ? \"\" : label1;\r\n label2 = label2 === undefined ? \"\" : label2;\r\n return label1 === label2;\r\n}\r\n\r\n/**\r\n * Compares EC Schemas and reports differences using the [[IDiagnosticReporter]] objects\r\n * specified.\r\n * @alpha\r\n */\r\nexport class SchemaComparer {\r\n private _compareDirection: SchemaCompareDirection;\r\n private _reporter!: SchemaCompareResultDelegate;\r\n private _reporters: ISchemaCompareReporter[];\r\n\r\n /**\r\n * Initializes a new SchemaComparer instance.\r\n * @param reporters The [[IDiagnosticReporter]] object(s) to use to report the results.\r\n */\r\n constructor(...reporters: ISchemaCompareReporter[]) {\r\n this._compareDirection = SchemaCompareDirection.Forward;\r\n this._reporters = reporters;\r\n }\r\n\r\n /**\r\n * Compares two schemas to identify differences.\r\n * @param schemaA The first Schema.\r\n * @param schemaB The second Schema.\r\n */\r\n public async compareSchemas(schemaA: Schema, schemaB: Schema) {\r\n this._reporter = new SchemaCompareResultDelegate(schemaA, schemaB, ...this._reporters);\r\n let visitor = new SchemaCompareVisitor(this, schemaB);\r\n let walker = new SchemaWalker(visitor);\r\n await walker.traverseSchema(schemaA);\r\n\r\n this._compareDirection = SchemaCompareDirection.Backward;\r\n\r\n visitor = new SchemaCompareVisitor(this, schemaA);\r\n walker = new SchemaWalker(visitor);\r\n await walker.traverseSchema(schemaB);\r\n\r\n this._compareDirection = SchemaCompareDirection.Forward;\r\n this._reporter.compareComplete();\r\n }\r\n\r\n /**\r\n * Compares two schemas to identify differences between property values.\r\n * @param schemaA The first Schema.\r\n * @param schemaB The second Schema.\r\n */\r\n public async compareSchemaProps(schemaA: Schema, schemaB: Schema): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n for (const ref of schemaA.references) {\r\n const refB = await schemaB.getReference(ref.fullName);\r\n if (!refB)\r\n promises.push(this._reporter.reportSchemaReferenceMissing(schemaA, ref, this._compareDirection));\r\n else if (!refB.schemaKey.matches(ref.schemaKey))\r\n promises.push(this._reporter.reportSchemaReferenceDelta(schemaA, ref, ref.schemaKey.version.toString(), refB.schemaKey.version.toString(), this._compareDirection));\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward)\r\n return;\r\n\r\n if (schemaA.schemaKey.toString() !== schemaB.schemaKey.toString())\r\n promises.push(this._reporter.reportSchemaDelta(schemaA, \"schemaKey\", schemaA.schemaKey.toString(), schemaB.schemaKey.toString(), this._compareDirection));\r\n\r\n if (schemaA.alias !== schemaB.alias)\r\n promises.push(this._reporter.reportSchemaDelta(schemaA, \"alias\", schemaA.alias, schemaB.alias, this._compareDirection));\r\n\r\n if (schemaA.description !== schemaB.description)\r\n promises.push(this._reporter.reportSchemaDelta(schemaA, \"description\", schemaA.description, schemaB.description, this._compareDirection));\r\n\r\n if (schemaA.label !== schemaB.label)\r\n promises.push(this._reporter.reportSchemaDelta(schemaA, \"label\", schemaA.label, schemaB.label, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two SchemaItems to identify differences between property values.\r\n * @param schemaItemA The first SchemaItem.\r\n * @param schemaItemB The second SchemaItem.\r\n */\r\n public async compareSchemaItems(schemaItemA: SchemaItem, schemaItemB: SchemaItem | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n if (!schemaItemB) {\r\n promises.push(this._reporter.reportSchemaItemMissing(schemaItemA, this._compareDirection));\r\n await Promise.all(promises);\r\n return;\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward)\r\n return;\r\n\r\n if (schemaItemA.description !== schemaItemB.description)\r\n promises.push(this._reporter.reportSchemaItemDelta(schemaItemA, \"description\", schemaItemA.description, schemaItemB.description, this._compareDirection));\r\n\r\n if (!labelsMatch(schemaItemA.label, schemaItemB.label))\r\n promises.push(this._reporter.reportSchemaItemDelta(schemaItemA, \"label\", schemaItemA.label, schemaItemB.label, this._compareDirection));\r\n\r\n if (schemaItemA.schemaItemType !== schemaItemB.schemaItemType) {\r\n const aType = schemaItemA.schemaItemType;\r\n const bType = schemaItemB.schemaItemType;\r\n promises.push(this._reporter.reportSchemaItemDelta(schemaItemA, \"schemaItemType\", aType, bType, this._compareDirection));\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two ECClasses to identify differences between property values.\r\n * @param classA The first ECClass.\r\n * @param classB The second ECClass.\r\n */\r\n public async compareClasses(classA: AnyClass, classB: AnyClass | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !classB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (classA.modifier !== classB.modifier) {\r\n const aMod = classModifierToString(classA.modifier);\r\n const bMod = classModifierToString(classB.modifier);\r\n promises.push(this._reporter.reportClassDelta(classA, \"modifier\", aMod, bMod, this._compareDirection));\r\n }\r\n\r\n if (classA.baseClass || classB.baseClass) {\r\n const fullNameA = classA.baseClass?.fullName;\r\n const fullNameB = classB.baseClass?.fullName;\r\n\r\n if (fullNameA !== fullNameB) {\r\n const areSameByName = this.areItemsSameByName(classA.baseClass, classB.baseClass, classA.schema.name, classB.schema.name);\r\n if (!areSameByName) {\r\n const baseA = await classA.baseClass as AnyClass;\r\n const baseB = await classB.baseClass as AnyClass;\r\n promises.push(this._reporter.reportBaseClassDelta(classA, baseA, baseB, this._compareDirection));\r\n }\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two ECProperties to identify differences between property values.\r\n * @param propertyA The first ECProperty.\r\n * @param propertyB The second ECProperty.\r\n */\r\n public async compareProperties(propertyA: AnyProperty, propertyB: AnyProperty | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (!propertyB) {\r\n promises.push(this._reporter.reportPropertyMissing(propertyA, this._compareDirection));\r\n await Promise.all(promises);\r\n return;\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward)\r\n return;\r\n\r\n if (!labelsMatch(propertyA.label, propertyB.label))\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"label\", propertyA.label, propertyB.label, this._compareDirection));\r\n\r\n if (propertyA.description !== propertyB.description)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"description\", propertyA.description, propertyB.description, this._compareDirection));\r\n\r\n if (propertyA.isReadOnly !== propertyB.isReadOnly)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"isReadOnly\", propertyA.isReadOnly, propertyB.isReadOnly, this._compareDirection));\r\n\r\n if (propertyA.priority !== propertyB.priority)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"priority\", propertyA.priority, propertyB.priority, this._compareDirection));\r\n\r\n if (propertyA.category || propertyB.category) {\r\n const catKeyA = propertyA.category?.fullName;\r\n const catKeyB = propertyB.category?.fullName;\r\n if (catKeyA !== catKeyB) {\r\n const areSameByName = this.areItemsSameByName(propertyA.category, propertyB.category, propertyA.schema.name, propertyB.schema.name);\r\n if (!areSameByName)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"category\", catKeyA, catKeyB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (propertyA.kindOfQuantity || propertyB.kindOfQuantity) {\r\n const koqKeyA = propertyA.kindOfQuantity?.fullName;\r\n const koqKeyB = propertyB.kindOfQuantity?.fullName;\r\n if (koqKeyA !== koqKeyB) {\r\n const areSameByName = this.areItemsSameByName(propertyA.kindOfQuantity, propertyB.kindOfQuantity, propertyA.schema.name, propertyB.schema.name);\r\n if (!areSameByName)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"kindOfQuantity\", koqKeyA, koqKeyB, this._compareDirection));\r\n }\r\n }\r\n\r\n promises.push(this.comparePropertyType(propertyA, propertyB));\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two EntityClass objects to identify differences between property values.\r\n * @param entityA\r\n * @param entityB\r\n */\r\n public async compareEntityClasses(entityA: EntityClass, entityB: EntityClass | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n if (entityB) {\r\n for (const mixinA of entityA.mixins) {\r\n if (-1 === entityB.mixins.findIndex((mixinB) => this.areItemsSameByName(mixinA, mixinB, entityA.schema.name, entityB.schema.name)))\r\n promises.push(this._reporter.reportEntityMixinMissing(entityA, await mixinA, this._compareDirection));\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two Mixin objects to identify differences between property values.\r\n * @param mixinA\r\n * @param mixinB\r\n */\r\n public async compareMixins(mixinA: Mixin, mixinB: Mixin | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !mixinB)\r\n return;\r\n\r\n if (mixinA.appliesTo || mixinB.appliesTo) {\r\n const appliesToA = mixinA.appliesTo?.fullName;\r\n const appliesToB = mixinB.appliesTo?.fullName;\r\n if (appliesToA !== appliesToB) {\r\n const areSameByName = this.areItemsSameByName(mixinA.appliesTo, mixinB.appliesTo, mixinA.schema.name, mixinB.schema.name);\r\n if (!areSameByName)\r\n await this._reporter.reportMixinDelta(mixinA, \"appliesTo\", appliesToA, appliesToB, this._compareDirection);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Compares two RelationshipClass objects to identify differences between property values.\r\n * @param relationshipA\r\n * @param relationshipB\r\n */\r\n public async compareRelationshipClasses(relationshipA: RelationshipClass, relationshipB: RelationshipClass | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !relationshipB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (relationshipA.strength !== relationshipB.strength) {\r\n const strengthAString = strengthToString(relationshipA.strength);\r\n const strengthBString = strengthToString(relationshipB.strength);\r\n promises.push(this._reporter.reportRelationshipClassDelta(relationshipA, \"strength\", strengthAString, strengthBString, this._compareDirection));\r\n }\r\n\r\n if (relationshipA.strengthDirection !== relationshipB.strengthDirection) {\r\n const directionAString = strengthDirectionToString(relationshipA.strengthDirection);\r\n const directionBString = strengthDirectionToString(relationshipB.strengthDirection);\r\n promises.push(this._reporter.reportRelationshipClassDelta(relationshipA, \"strengthDirection\", directionAString, directionBString, this._compareDirection));\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two RelationshipConstraint objects to identify differences between property values.\r\n * @param relationshipConstraintA\r\n * @param relationshipConstraintB\r\n */\r\n public async compareRelationshipConstraints(constraintA: RelationshipConstraint, constraintB: RelationshipConstraint | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (constraintB && constraintA.constraintClasses) {\r\n for (const classA of constraintA.constraintClasses) {\r\n if (!constraintB.constraintClasses || -1 === constraintB.constraintClasses.findIndex((classB) =>\r\n this.areItemsSameByName(classA, classB, constraintA.schema.name, constraintB.schema.name)))\r\n promises.push(this._reporter.reportRelationshipConstraintClassMissing(constraintA, await classA, this._compareDirection));\r\n }\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !constraintB) {\r\n await Promise.all(promises);\r\n return;\r\n }\r\n\r\n if (constraintA.multiplicity || constraintB.multiplicity) {\r\n const multiplicityA = constraintA.multiplicity.toString();\r\n const multiplicityB = constraintB.multiplicity.toString();\r\n if (multiplicityA !== multiplicityB)\r\n promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, \"multiplicity\", multiplicityA, multiplicityB, this._compareDirection));\r\n }\r\n\r\n if (constraintA.roleLabel !== constraintB.roleLabel)\r\n promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, \"roleLabel\", constraintA.roleLabel, constraintB.roleLabel, this._compareDirection));\r\n\r\n if (constraintA.polymorphic !== constraintB.polymorphic)\r\n promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, \"polymorphic\", constraintA.polymorphic, constraintB.polymorphic, this._compareDirection));\r\n\r\n if (constraintA.abstractConstraint || constraintB.abstractConstraint) {\r\n const abstractA = constraintA.abstractConstraint?.fullName;\r\n const abstractB = constraintB.abstractConstraint?.fullName;\r\n if (abstractA !== abstractB) {\r\n const areSameByName = this.areItemsSameByName(constraintA.abstractConstraint, constraintB.abstractConstraint, constraintA.schema.name, constraintB.schema.name);\r\n if (!areSameByName) {\r\n promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, \"abstractConstraint\", abstractA, abstractB, this._compareDirection));\r\n }\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two CustomAttributeClass objects to identify differences between property values.\r\n * @param customAttributeClassA\r\n * @param customAttributeClassB\r\n */\r\n public async compareCustomAttributeClasses(customAttributeClassA: CustomAttributeClass, customAttributeClassB: CustomAttributeClass | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !customAttributeClassB)\r\n return;\r\n\r\n if (customAttributeClassA.appliesTo !== customAttributeClassB.appliesTo) {\r\n const typeA = containerTypeToString(customAttributeClassA.appliesTo);\r\n const typeB = containerTypeToString(customAttributeClassB.appliesTo);\r\n await this._reporter.reportCustomAttributeClassDelta(customAttributeClassA, \"appliesTo\", typeA, typeB, this._compareDirection);\r\n }\r\n }\r\n\r\n /**\r\n * Compares two CustomAttributeContainerProps objects to identify differences between property values.\r\n * @param containerA\r\n * @param containerB\r\n */\r\n public async compareCustomAttributeContainers(containerA: CustomAttributeContainerProps, containerB: CustomAttributeContainerProps | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (containerB && containerA.customAttributes) {\r\n for (const ca of containerA.customAttributes) {\r\n if (!containerB.customAttributes || !this.containerHasClass(ca[1], containerA, containerB))\r\n promises.push(this._reporter.reportCustomAttributeInstanceClassMissing(containerA, ca[1], this._compareDirection));\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two Enumeration objects to identify differences between property values.\r\n * @param enumA\r\n * @param enumB\r\n */\r\n public async compareEnumerations(enumA: Enumeration, enumB: Enumeration | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (enumB) {\r\n for (const enumeratorA of enumA.enumerators) {\r\n const enumeratorB = enumB.enumerators.find((e) => e.name === enumeratorA.name);\r\n if (!enumeratorB) {\r\n promises.push(this._reporter.reportEnumeratorMissing(enumA, enumeratorA, this._compareDirection));\r\n } else if (this._compareDirection === SchemaCompareDirection.Forward) {\r\n promises.push(this.compareEnumerators(enumeratorA, enumeratorB, enumA, enumB));\r\n }\r\n }\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !enumB) {\r\n await Promise.all(promises);\r\n return;\r\n }\r\n if (enumA.type !== enumB.type) {\r\n const typeAString = enumA.type ? primitiveTypeToString(enumA.type) : undefined;\r\n const typeBString = enumB.type ? primitiveTypeToString(enumB.type) : undefined;\r\n promises.push(this._reporter.reportEnumerationDelta(enumA, \"type\", typeAString, typeBString, this._compareDirection));\r\n }\r\n\r\n if (enumA.isStrict !== enumB.isStrict)\r\n promises.push(this._reporter.reportEnumerationDelta(enumA, \"isStrict\", enumA.isStrict, enumB.isStrict, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two KindOfQuantity objects to identify differences between property values.\r\n * @param koqA\r\n * @param koqB\r\n */\r\n public async compareKindOfQuantities(koqA: KindOfQuantity, koqB: KindOfQuantity | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (koqB && koqA.presentationFormats) {\r\n for (const unitA of koqA.presentationFormats) {\r\n if (-1 === koqB.presentationFormats.findIndex((unitB) => this.areOverrideFormatsSameByName(unitA, unitB, koqA.schema.name, koqB.schema.name)))\r\n promises.push(this._reporter.reportPresentationUnitMissing(koqA, unitA, this._compareDirection));\r\n }\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !koqB) {\r\n await Promise.all(promises);\r\n return;\r\n }\r\n\r\n if (koqA.relativeError !== koqB.relativeError) {\r\n promises.push(this._reporter.reportKoqDelta(koqA, \"relativeError\", koqA.relativeError, koqB.relativeError, this._compareDirection));\r\n }\r\n\r\n if (koqA.persistenceUnit || koqB.persistenceUnit) {\r\n const unitNameA = koqA.persistenceUnit?.fullName;\r\n const unitNameB = koqB.persistenceUnit?.fullName;\r\n if (unitNameA !== unitNameB) {\r\n const eqByName = this.areItemsSameByName(koqA.persistenceUnit, koqB.persistenceUnit, koqA.schema.name, koqB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportKoqDelta(koqA, \"persistenceUnit\", unitNameA, unitNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two PropertyCategory objects to identify differences between property values.\r\n * @param categoryA\r\n * @param categoryB\r\n */\r\n public async comparePropertyCategories(categoryA: PropertyCategory, categoryB: PropertyCategory | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !categoryB)\r\n return;\r\n\r\n if (categoryA.priority !== categoryB.priority)\r\n await this._reporter.reportPropertyCategoryDelta(categoryA, \"priority\", categoryA.priority, categoryB.priority, this._compareDirection);\r\n }\r\n\r\n /**\r\n * Compares two Format objects to identify differences between property values.\r\n * @param formatA\r\n * @param formatB\r\n */\r\n public async compareFormats(formatA: Format, formatB: Format | undefined): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n promises.push(this.compareFormatUnits(formatA, formatB));\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !formatB) {\r\n await Promise.all(promises);\r\n return;\r\n }\r\n\r\n if (formatA.roundFactor !== formatB.roundFactor)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"roundFactor\", formatA.roundFactor, formatB.roundFactor, this._compareDirection));\r\n\r\n if (formatA.type !== formatB.type) {\r\n const typeAString = formatTypeToString(formatA.type);\r\n const typeBString = formatTypeToString(formatB.type);\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"type\", typeAString, typeBString, this._compareDirection));\r\n }\r\n\r\n if (formatA.precision !== formatB.precision)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"precision\", formatA.precision, formatB.precision, this._compareDirection));\r\n\r\n if (formatA.minWidth !== formatB.minWidth)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"minWidth\", formatA.minWidth, formatB.minWidth, this._compareDirection));\r\n\r\n if (formatA.scientificType !== formatB.scientificType) {\r\n const typeAString = formatA.scientificType !== undefined ? scientificTypeToString(formatA.scientificType) : undefined;\r\n const typeBString = formatB.scientificType !== undefined ? scientificTypeToString(formatB.scientificType) : undefined;\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"scientificType\", typeAString, typeBString, this._compareDirection));\r\n }\r\n\r\n if (formatA.showSignOption !== formatB.showSignOption) {\r\n const optionA = showSignOptionToString(formatA.showSignOption);\r\n const optionB = showSignOptionToString(formatB.showSignOption);\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"showSignOption\", optionA, optionB, this._compareDirection));\r\n }\r\n\r\n if (formatA.decimalSeparator !== formatB.decimalSeparator)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"decimalSeparator\", formatA.decimalSeparator, formatB.decimalSeparator, this._compareDirection));\r\n\r\n if (formatA.thousandSeparator !== formatB.thousandSeparator)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"thousandSeparator\", formatA.thousandSeparator, formatB.thousandSeparator, this._compareDirection));\r\n\r\n if (formatA.uomSeparator !== formatB.uomSeparator)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"uomSeparator\", formatA.uomSeparator, formatB.uomSeparator, this._compareDirection));\r\n\r\n if (formatA.stationSeparator !== formatB.stationSeparator)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"stationSeparator\", formatA.stationSeparator, formatB.stationSeparator, this._compareDirection));\r\n\r\n if (formatA.stationOffsetSize !== formatB.stationOffsetSize)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"stationOffsetSize\", formatA.stationOffsetSize, formatB.stationOffsetSize, this._compareDirection));\r\n\r\n if (formatA.formatTraits !== formatB.formatTraits) {\r\n const traitsA = formatTraitsToArray(formatA.formatTraits);\r\n const traitsB = formatTraitsToArray(formatB.formatTraits);\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"formatTraits\", traitsA.toString(), traitsB.toString(), this._compareDirection));\r\n }\r\n\r\n if (formatA.spacer !== formatB.spacer)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"spacer\", formatA.spacer, formatB.spacer, this._compareDirection));\r\n\r\n if (formatA.includeZero !== formatB.includeZero)\r\n promises.push(this._reporter.reportFormatDelta(formatA, \"includeZero\", formatA.includeZero, formatB.includeZero, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two Unit objects to identify differences between property values.\r\n * @param unitA\r\n * @param unitB\r\n */\r\n public async compareUnits(unitA: Unit, unitB: Unit | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !unitB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (unitA.phenomenon || unitB.phenomenon) {\r\n const fullNameA = unitA.phenomenon?.fullName;\r\n const fullNameB = unitB.phenomenon?.fullName;\r\n if (fullNameA !== fullNameB) {\r\n const eqByName = this.areItemsSameByName(unitA.phenomenon, unitB.phenomenon, unitA.schema.name, unitB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"phenomenon\", fullNameA, fullNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (unitA.unitSystem || unitB.unitSystem) {\r\n const fullNameA = unitA.unitSystem?.fullName;\r\n const fullNameB = unitB.unitSystem?.fullName;\r\n if (fullNameA !== fullNameB) {\r\n const eqByName = this.areItemsSameByName(unitA.unitSystem, unitB.unitSystem, unitA.schema.name, unitB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"unitSystem\", fullNameA, fullNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (unitA.definition !== unitB.definition)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"definition\", unitA.definition, unitB.definition, this._compareDirection));\r\n\r\n if (unitA.numerator !== unitB.numerator)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"numerator\", unitA.numerator, unitB.numerator, this._compareDirection));\r\n\r\n if (unitA.denominator !== unitB.denominator)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"denominator\", unitA.denominator, unitB.denominator, this._compareDirection));\r\n\r\n if (unitA.offset !== unitB.offset)\r\n promises.push(this._reporter.reportUnitDelta(unitA, \"offset\", unitA.offset, unitB.offset, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two InvertedUnit objects to identify differences between property values.\r\n * @param invertedUnitA\r\n * @param invertedUnitB\r\n */\r\n public async compareInvertedUnits(invertedUnitA: InvertedUnit, invertedUnitB: InvertedUnit | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !invertedUnitB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (invertedUnitA.invertsUnit || invertedUnitB.invertsUnit) {\r\n const fullNameA = invertedUnitA.invertsUnit?.fullName;\r\n const fullNameB = invertedUnitB.invertsUnit?.fullName;\r\n if (fullNameA !== fullNameB) {\r\n const eqByName = this.areItemsSameByName(invertedUnitA.invertsUnit, invertedUnitB.invertsUnit, invertedUnitA.schema.name, invertedUnitB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportInvertedUnitDelta(invertedUnitA, \"invertsUnit\", fullNameA, fullNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (invertedUnitA.unitSystem || invertedUnitB.unitSystem) {\r\n const fullNameA = invertedUnitA.unitSystem?.fullName;\r\n const fullNameB = invertedUnitB.unitSystem?.fullName;\r\n if (fullNameA !== fullNameB) {\r\n const eqByName = this.areItemsSameByName(invertedUnitA.unitSystem, invertedUnitB.unitSystem, invertedUnitA.schema.name, invertedUnitB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportInvertedUnitDelta(invertedUnitA, \"unitSystem\", fullNameA, fullNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n /**\r\n * Compares two Phenomenon objects to identify differences between property values.\r\n * @param phenomenonA\r\n * @param phenomenonB\r\n */\r\n public async comparePhenomenons(phenomenonA: Phenomenon, phenomenonB: Phenomenon | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !phenomenonB)\r\n return;\r\n\r\n if (phenomenonA.definition !== phenomenonB.definition)\r\n await this._reporter.reportPhenomenonDelta(phenomenonA, \"definition\", phenomenonA.definition, phenomenonB.definition, this._compareDirection);\r\n }\r\n\r\n /**\r\n * Compares two Constant objects to identify differences between property values.\r\n * @param constantA\r\n * @param constantB\r\n */\r\n public async compareConstants(constantA: Constant, constantB: Constant | undefined): Promise<void> {\r\n if (this._compareDirection === SchemaCompareDirection.Backward || !constantB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (constantA.phenomenon || constantB.phenomenon) {\r\n const fullNameA = constantA.phenomenon?.fullName;\r\n const fullNameB = constantB.phenomenon?.fullName;\r\n if (fullNameA !== fullNameB) {\r\n const eqByName = this.areItemsSameByName(constantA.phenomenon, constantB.phenomenon, constantA.schema.name, constantB.schema.name);\r\n if (!eqByName)\r\n promises.push(this._reporter.reportConstantDelta(constantA, \"phenomenon\", fullNameA, fullNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (constantA.definition !== constantB.definition)\r\n promises.push(this._reporter.reportConstantDelta(constantA, \"definition\", constantA.definition, constantB.definition, this._compareDirection));\r\n\r\n if (constantA.numerator !== constantB.numerator)\r\n promises.push(this._reporter.reportConstantDelta(constantA, \"numerator\", constantA.numerator, constantB.numerator, this._compareDirection));\r\n\r\n if (constantA.denominator !== constantB.denominator)\r\n promises.push(this._reporter.reportConstantDelta(constantA, \"denominator\", constantA.denominator, constantB.denominator, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n private async comparePropertyType(propertyA: AnyProperty, propertyB: AnyProperty): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n const propertyTypeA = propertyTypeToString(propertyA.propertyType);\r\n const propertyTypeB = propertyTypeToString(propertyB.propertyType);\r\n if (propertyTypeA !== propertyTypeB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"type\", propertyTypeA, propertyTypeB, this._compareDirection));\r\n }\r\n\r\n if (propertyA.isArray()) {\r\n const minOccursB = propertyB.isArray() ? propertyB.minOccurs : undefined;\r\n if (propertyA.minOccurs !== minOccursB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"minOccurs\", propertyA.minOccurs, minOccursB, this._compareDirection));\r\n }\r\n\r\n const maxOccursB = propertyB.isArray() ? propertyB.maxOccurs : undefined;\r\n if (propertyA.maxOccurs !== maxOccursB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"maxOccurs\", propertyA.maxOccurs, maxOccursB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (propertyA.isEnumeration()) {\r\n const enumerationB = propertyB.isEnumeration() ? propertyB.enumeration : undefined;\r\n if (propertyA.enumeration || enumerationB) {\r\n const enumA = propertyA.enumeration?.fullName;\r\n const enumB = enumerationB?.fullName;\r\n if (enumA !== enumB) {\r\n const areSameByName = this.areItemsSameByName(propertyA.enumeration, enumerationB, propertyA.schema.name, propertyB.schema.name);\r\n if (!areSameByName) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"enumeration\", enumA, enumB, this._compareDirection));\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (propertyA.isNavigation()) {\r\n const strengthDirectionB = propertyB.isNavigation() ? propertyB.direction : undefined;\r\n if (propertyA.direction !== strengthDirectionB) {\r\n const dirA = strengthDirectionToString(propertyA.direction);\r\n const dirB = strengthDirectionB !== undefined ? strengthDirectionToString(strengthDirectionB) : undefined;\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"direction\", dirA, dirB, this._compareDirection));\r\n }\r\n\r\n if (propertyA.relationshipClass) { // eslint-disable-line @typescript-eslint/no-misused-promises\r\n const relationshipClassB = propertyB.isNavigation() ? propertyB.relationshipClass : undefined;\r\n const relA = propertyA.relationshipClass.fullName;\r\n const relB = relationshipClassB ? relationshipClassB.fullName : undefined;\r\n if (relA !== relB){\r\n const areSameByName = this.areItemsSameByName(propertyA.relationshipClass, relationshipClassB, propertyA.schema.name, propertyB.schema.name);\r\n if(!areSameByName)\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"relationshipClass\", relA, relB, this._compareDirection));\r\n }\r\n }\r\n }\r\n\r\n if (propertyA.isPrimitive()) {\r\n const primitiveTypeB = propertyB.isPrimitive() ? propertyB.primitiveType : undefined;\r\n if (propertyA.primitiveType !== primitiveTypeB) {\r\n const aType = primitiveTypeToString(propertyA.primitiveType);\r\n const bType = primitiveTypeB !== undefined ? primitiveTypeToString(primitiveTypeB) : undefined;\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"primitiveType\", aType, bType, this._compareDirection));\r\n }\r\n\r\n const minLengthB = propertyB.isPrimitive() ? propertyB.minLength : undefined;\r\n if (propertyA.minLength !== minLengthB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"minLength\", propertyA.minLength, minLengthB, this._compareDirection));\r\n }\r\n\r\n // valid for primitive and enumeration properties\r\n const maxLengthB = propertyB.isPrimitive() ? propertyB.maxLength : undefined;\r\n if (propertyA.maxLength !== maxLengthB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"maxLength\", propertyA.maxLength, maxLengthB, this._compareDirection));\r\n }\r\n\r\n const minValueB = propertyB.isPrimitive() ? propertyB.minValue : undefined;\r\n if (propertyA.minValue !== minValueB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"minValue\", propertyA.minValue, minValueB, this._compareDirection));\r\n }\r\n\r\n const maxValueB = propertyB.isPrimitive() ? propertyB.maxValue : undefined;\r\n if (propertyA.maxValue !== maxValueB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"maxValue\", propertyA.maxValue, maxValueB, this._compareDirection));\r\n }\r\n\r\n const extendedTypeNameB = propertyB.isPrimitive() ? propertyB.extendedTypeName : undefined;\r\n if (propertyA.extendedTypeName !== extendedTypeNameB) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"extendedTypeName\", propertyA.extendedTypeName, extendedTypeNameB, this._compareDirection));\r\n }\r\n }\r\n\r\n if (propertyA.isStruct()) {\r\n const structA = propertyA.structClass;\r\n const structB = propertyB.isStruct() ? propertyB.structClass : undefined;\r\n if (structA || structB) {\r\n const structNameA = structA.fullName;\r\n const structNameB = structB?.fullName;\r\n if (structNameA !== structNameB) {\r\n const areSameByName = this.areItemsSameByName(structA.key, structB?.key, propertyA.schema.name, propertyB.schema.name);\r\n if (!areSameByName) {\r\n promises.push(this._reporter.reportPropertyDelta(propertyA, \"structClass\", structNameA, structNameB, this._compareDirection));\r\n }\r\n }\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n private async compareEnumerators(enumeratorA: AnyEnumerator, enumeratorB: AnyEnumerator, enumA: Enumeration, enumB: Enumeration): Promise<void> {\r\n const promises: Array<Promise<void>> = [];\r\n\r\n if (enumeratorA.description !== enumeratorB.description)\r\n promises.push(this._reporter.reportEnumeratorDelta(enumA, enumeratorA, \"description\", enumeratorA.description, enumeratorB.description, this._compareDirection));\r\n\r\n if (!labelsMatch(enumeratorA.label, enumeratorB.label))\r\n promises.push(this._reporter.reportEnumeratorDelta(enumA, enumeratorA, \"label\", enumeratorA.label, enumeratorB.label, this._compareDirection));\r\n\r\n // No need to compare values if the type is different (which will be reported separately)\r\n if (enumA.type === enumB.type && enumeratorA.value !== enumeratorB.value)\r\n promises.push(this._reporter.reportEnumeratorDelta(enumA, enumeratorA, \"value\", enumeratorA.value, enumeratorB.value, this._compareDirection));\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n private async compareFormatUnits(formatA: Format, formatB: Format | undefined): Promise<void> {\r\n if (!formatA.units || !formatB)\r\n return;\r\n\r\n const promises: Array<Promise<void>> = [];\r\n\r\n for (const unitA of formatA.units) {\r\n const unitB = formatB.units ? formatB.units.find((u) => this.areItemsSameByName(unitA[0], u[0], formatA.schema.name, formatB.schema.name)) : undefined;\r\n if (!unitB) {\r\n promises.push(this._reporter.reportFormatUnitMissing(formatA, unitA[0], this._compareDirection));\r\n continue;\r\n }\r\n\r\n if (this._compareDirection === SchemaCompareDirection.Backward)\r\n continue;\r\n\r\n if (unitA[1] !== unitB[1]) {\r\n const labelA = unitA[1];\r\n const labelB = unitB[1];\r\n promises.push(this._reporter.reportUnitLabelOverrideDelta(formatA, unitB[0], labelA, labelB, this._compareDirection));\r\n }\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n private areOverrideFormatsSameByName(\r\n itemKeyA: Format | OverrideFormat,\r\n itemKeyB: Format | OverrideFormat,\r\n topLevelSchemaNameA: string,\r\n topLevelSchemaNameB: string | undefined ): boolean {\r\n\r\n if (itemKeyA.units) {\r\n for (const unitA of itemKeyA.units) {\r\n if (!itemKeyB.units\r\n || -1 === itemKeyB.units.findIndex((unitB) => this.areItemsSameByName(unitA[0], unitB[0], topLevelSchemaNameA, topLevelSchemaNameB)\r\n && unitA[1] === unitB[1]))\r\n return false;\r\n }\r\n }\r\n\r\n const itemA = OverrideFormat.isOverrideFormat(itemKeyA) ? itemKeyA.parent : itemKeyA;\r\n const itemB = OverrideFormat.isOverrideFormat(itemKeyB) ? itemKeyB.parent : itemKeyB;\r\n\r\n return itemKeyA.precision === itemKeyB.precision && this.areItemsSameByName(itemA, itemB, topLevelSchemaNameA, topLevelSchemaNameB);\r\n }\r\n\r\n /**\r\n * Compares two item keys.\r\n * @param itemKeyA item key A to compare to.\r\n * @param itemKeyB item key B to compare to.\r\n * @param topLevelSchemaNameA top level schema name in which the item A exists.\r\n * @param topLevelSchemaNameB top level schema name in which the item B exists.\r\n * @returns true if both names are the same and they come from their respective top level schema.\r\n */\r\n private areItemsSameByName(\r\n itemKeyA: Readonly<SchemaItemKey> | SchemaItem | undefined,\r\n itemKeyB: Readonly<SchemaItemKey> | SchemaItem | undefined,\r\n topLevelSchemaNameA: string,\r\n topLevelSchemaNameB: string | undefined ): boolean {\r\n\r\n const nameA = itemKeyA ? itemKeyA.name.toUpperCase() : undefined;\r\n const nameB = itemKeyB ? itemKeyB.name.toUpperCase() : undefined;\r\n\r\n const schemaNameA = itemKeyA\r\n ? SchemaItem.isSchemaItem(itemKeyA)\r\n ? itemKeyA.schema.name\r\n : itemKeyA.schemaName\r\n : undefined;\r\n\r\n const schemaNameB = itemKeyB\r\n ? SchemaItem.isSchemaItem(itemKeyB)\r\n ? itemKeyB.schema.name\r\n : itemKeyB.schemaName\r\n : undefined;\r\n\r\n return (nameA === nameB && schemaNameA === topLevelSchemaNameA && schemaNameB === topLevelSchemaNameB) || (nameA === nameB && schemaNameA === schemaNameB);\r\n }\r\n\r\n /**\r\n * Looks for same classA in containerB using key.\r\n * @param classNameA name of the class to look for in containerB.\r\n * @param containerA container which classNameA belongs to.\r\n * @param containerB container in which to look for classNameA.\r\n * @returns true if a same classA is in containerB, otherwise false.\r\n */\r\n private containerHasClass(attributeA: CustomAttribute, containerA: CustomAttributeContainerProps, containerB: CustomAttributeContainerProps): boolean {\r\n if (containerB && containerB.customAttributes) {\r\n for (const [_className, attributeB] of containerB.customAttributes) {\r\n const classItemKeyA = containerA.schema.getSchemaItemKey(attributeA.className);\r\n const classItemKeyB = containerB.schema.getSchemaItemKey(attributeB.className);\r\n\r\n if (this.areItemsSameByName(classItemKeyA, classItemKeyB, containerA.schema.name, containerB.schema.name)) {\r\n return Object.keys(attributeA).every((propertyName) => {\r\n const valueA = attributeA[propertyName];\r\n const valueB = attributeB[propertyName];\r\n\r\n // If propertyName is class name, they don't need to be compared as this has been done\r\n // in the areItemsSameByName function.\r\n if(propertyName === \"className\")\r\n return true;\r\n\r\n return deepEquals(valueA, valueB);\r\n });\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\n\r\n/**\r\n * Compares two values on their deep equality.\r\n * @param a left side to compare\r\n * @param b right side to compare\r\n * @returns true if they are deeply equal, otherwise false.\r\n */\r\nfunction deepEquals(a: unknown, b: unknown): boolean {\r\n if(Array.isArray(a) && Array.isArray(b)) {\r\n return a.length === b.length && a.every((value, index) => {\r\n return deepEquals(value, b[index]);\r\n });\r\n }\r\n if(isObject(a) && isObject(b)) {\r\n const propertiesA = Object.keys(a);\r\n const propertiesB = Object.keys(b);\r\n return propertiesA.length === propertiesB.length && propertiesA.every((propertyName) => {\r\n return deepEquals(a[propertyName], b[propertyName]);\r\n });\r\n }\r\n return a === b;\r\n}\r\n\r\nfunction isObject(value: unknown): value is { [property: string]: unknown } {\r\n return typeof value === \"object\";\r\n}\r\n"]}
@@ -10,12 +10,14 @@ export * from "./Validation/SchemaChanges";
10
10
  export * from "./Validation/SchemaComparer";
11
11
  export * from "./Validation/SchemaCompareReporter";
12
12
  export * from "./Editing/Editor";
13
+ export * from "./Editing/Exception";
13
14
  export { ISuppressionRule, IRuleSuppressionSet, IRuleSuppressionMap } from "./Validation/RuleSuppressionSet";
14
15
  export { SchemaValidater } from "./Validation/SchemaValidater";
15
- export { SchemaMerger } from "./Merging/SchemaMerger";
16
16
  export * from "./Differencing/SchemaDifference";
17
17
  export * from "./Differencing/SchemaConflicts";
18
18
  export * from "./Differencing/Errors";
19
+ export * from "./Differencing/Utils";
20
+ export { SchemaMerger } from "./Merging/SchemaMerger";
19
21
  /** @docs-package-description
20
22
  * The ecschema-editing package contains classes for validating, and editing ECSchemas that can be used in both [frontend]($docs/learning/frontend/index.md) and [backend]($docs/learning/backend/index.md).
21
23
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ecschema-editing.d.ts","sourceRoot":"","sources":["../../src/ecschema-editing.ts"],"names":[],"mappings":"AAKA,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/E,cAAc,wCAAwC,CAAC;AACvD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC7G,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AAEtC;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
1
+ {"version":3,"file":"ecschema-editing.d.ts","sourceRoot":"","sources":["../../src/ecschema-editing.ts"],"names":[],"mappings":"AAKA,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/E,cAAc,wCAAwC,CAAC;AACvD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC7G,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
@@ -35,13 +35,15 @@ __exportStar(require("./Validation/SchemaChanges"), exports);
35
35
  __exportStar(require("./Validation/SchemaComparer"), exports);
36
36
  __exportStar(require("./Validation/SchemaCompareReporter"), exports);
37
37
  __exportStar(require("./Editing/Editor"), exports);
38
+ __exportStar(require("./Editing/Exception"), exports);
38
39
  var SchemaValidater_1 = require("./Validation/SchemaValidater");
39
40
  Object.defineProperty(exports, "SchemaValidater", { enumerable: true, get: function () { return SchemaValidater_1.SchemaValidater; } });
40
- var SchemaMerger_1 = require("./Merging/SchemaMerger");
41
- Object.defineProperty(exports, "SchemaMerger", { enumerable: true, get: function () { return SchemaMerger_1.SchemaMerger; } });
42
41
  __exportStar(require("./Differencing/SchemaDifference"), exports);
43
42
  __exportStar(require("./Differencing/SchemaConflicts"), exports);
44
43
  __exportStar(require("./Differencing/Errors"), exports);
44
+ __exportStar(require("./Differencing/Utils"), exports);
45
+ var SchemaMerger_1 = require("./Merging/SchemaMerger");
46
+ Object.defineProperty(exports, "SchemaMerger", { enumerable: true, get: function () { return SchemaMerger_1.SchemaMerger; } });
45
47
  /** @docs-package-description
46
48
  * The ecschema-editing package contains classes for validating, and editing ECSchemas that can be used in both [frontend]($docs/learning/frontend/index.md) and [backend]($docs/learning/backend/index.md).
47
49
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ecschema-editing.js","sourceRoot":"","sources":["../../src/ecschema-editing.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F,0DAAwC;AACxC,kEAAgD;AAChD,sDAAsD;AACtD,gDAA+E;AAAtE,0GAAA,eAAe,OAAA;AAAE,sGAAA,WAAW,OAAA;AAAE,oGAAA,SAAS,OAAA;AAChD,yEAAuD;AACvD,qDAAmC;AACnC,uEAAqD;AACrD,4DAA0C;AAC1C,wEAAsD;AACtD,6DAA2C;AAC3C,8DAA4C;AAC5C,qEAAmD;AACnD,mDAAiC;AAEjC,gEAA+D;AAAtD,kHAAA,eAAe,OAAA;AACxB,uDAAsD;AAA7C,4GAAA,YAAY,OAAA;AACrB,kEAAgD;AAChD,iEAA+C;AAC/C,wDAAsC;AAEtC;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./Validation/Diagnostic\";\r\nexport * from \"./Validation/DiagnosticReporter\";\r\n/* eslint-disable-next-line deprecation/deprecation */\r\nexport { DiagnosticCodes, Diagnostics, ECRuleSet } from \"./Validation/ECRules\";\r\nexport * from \"./Validation/LoggingDiagnosticReporter\";\r\nexport * from \"./Validation/Rules\";\r\nexport * from \"./Validation/SchemaValidationVisitor\";\r\nexport * from \"./Validation/SchemaWalker\";\r\nexport * from \"./Validation/SchemaCompareDiagnostics\";\r\nexport * from \"./Validation/SchemaChanges\";\r\nexport * from \"./Validation/SchemaComparer\";\r\nexport * from \"./Validation/SchemaCompareReporter\";\r\nexport * from \"./Editing/Editor\";\r\nexport { ISuppressionRule, IRuleSuppressionSet, IRuleSuppressionMap } from \"./Validation/RuleSuppressionSet\";\r\nexport { SchemaValidater } from \"./Validation/SchemaValidater\";\r\nexport { SchemaMerger } from \"./Merging/SchemaMerger\";\r\nexport * from \"./Differencing/SchemaDifference\";\r\nexport * from \"./Differencing/SchemaConflicts\";\r\nexport * from \"./Differencing/Errors\";\r\n\r\n/** @docs-package-description\r\n * The ecschema-editing package contains classes for validating, and editing ECSchemas that can be used in both [frontend]($docs/learning/frontend/index.md) and [backend]($docs/learning/backend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Editing\r\n * Set of classes used to perform editing of ECSchemas.\r\n */\r\n/**\r\n * @docs-group-description Diagnostic\r\n * Set of classes to categorize and manage ECSchema validation results.\r\n */\r\n/**\r\n * @docs-group-description Validation\r\n * Set of classes used to perform validation on ECSchemas.\r\n */\r\n/**\r\n * @docs-group-description Comparison\r\n * Set of classes to enable comparison of ECSchemas.\r\n */\r\n/**\r\n * @docs-group-description Merging\r\n * Set of classes used to merge schemas.\r\n */\r\n/**\r\n * @docs-group-description Differencing\r\n * Set of classes used to perform differences between ECSchemas.\r\n */\r\n"]}
1
+ {"version":3,"file":"ecschema-editing.js","sourceRoot":"","sources":["../../src/ecschema-editing.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F,0DAAwC;AACxC,kEAAgD;AAChD,sDAAsD;AACtD,gDAA+E;AAAtE,0GAAA,eAAe,OAAA;AAAE,sGAAA,WAAW,OAAA;AAAE,oGAAA,SAAS,OAAA;AAChD,yEAAuD;AACvD,qDAAmC;AACnC,uEAAqD;AACrD,4DAA0C;AAC1C,wEAAsD;AACtD,6DAA2C;AAC3C,8DAA4C;AAC5C,qEAAmD;AACnD,mDAAiC;AACjC,sDAAoC;AAEpC,gEAA+D;AAAtD,kHAAA,eAAe,OAAA;AACxB,kEAAgD;AAChD,iEAA+C;AAC/C,wDAAsC;AACtC,uDAAqC;AACrC,uDAAsD;AAA7C,4GAAA,YAAY,OAAA;AAErB;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./Validation/Diagnostic\";\r\nexport * from \"./Validation/DiagnosticReporter\";\r\n/* eslint-disable-next-line deprecation/deprecation */\r\nexport { DiagnosticCodes, Diagnostics, ECRuleSet } from \"./Validation/ECRules\";\r\nexport * from \"./Validation/LoggingDiagnosticReporter\";\r\nexport * from \"./Validation/Rules\";\r\nexport * from \"./Validation/SchemaValidationVisitor\";\r\nexport * from \"./Validation/SchemaWalker\";\r\nexport * from \"./Validation/SchemaCompareDiagnostics\";\r\nexport * from \"./Validation/SchemaChanges\";\r\nexport * from \"./Validation/SchemaComparer\";\r\nexport * from \"./Validation/SchemaCompareReporter\";\r\nexport * from \"./Editing/Editor\";\r\nexport * from \"./Editing/Exception\";\r\nexport { ISuppressionRule, IRuleSuppressionSet, IRuleSuppressionMap } from \"./Validation/RuleSuppressionSet\";\r\nexport { SchemaValidater } from \"./Validation/SchemaValidater\";\r\nexport * from \"./Differencing/SchemaDifference\";\r\nexport * from \"./Differencing/SchemaConflicts\";\r\nexport * from \"./Differencing/Errors\";\r\nexport * from \"./Differencing/Utils\";\r\nexport { SchemaMerger } from \"./Merging/SchemaMerger\";\r\n\r\n/** @docs-package-description\r\n * The ecschema-editing package contains classes for validating, and editing ECSchemas that can be used in both [frontend]($docs/learning/frontend/index.md) and [backend]($docs/learning/backend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Editing\r\n * Set of classes used to perform editing of ECSchemas.\r\n */\r\n/**\r\n * @docs-group-description Diagnostic\r\n * Set of classes to categorize and manage ECSchema validation results.\r\n */\r\n/**\r\n * @docs-group-description Validation\r\n * Set of classes used to perform validation on ECSchemas.\r\n */\r\n/**\r\n * @docs-group-description Comparison\r\n * Set of classes to enable comparison of ECSchemas.\r\n */\r\n/**\r\n * @docs-group-description Merging\r\n * Set of classes used to merge schemas.\r\n */\r\n/**\r\n * @docs-group-description Differencing\r\n * Set of classes used to perform differences between ECSchemas.\r\n */\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/ecschema-editing",
3
- "version": "4.8.0-dev.3",
3
+ "version": "4.8.0-dev.32",
4
4
  "description": "ECSchema editing and validation API",
5
5
  "license": "MIT",
6
6
  "main": "lib/cjs/ecschema-editing.js",
@@ -42,16 +42,16 @@
42
42
  "rimraf": "^3.0.2",
43
43
  "sinon": "^17.0.1",
44
44
  "typescript": "~5.3.3",
45
- "@itwin/build-tools": "4.8.0-dev.3",
46
- "@itwin/ecschema-metadata": "4.8.0-dev.3",
47
- "@itwin/core-common": "4.8.0-dev.3",
48
- "@itwin/core-bentley": "4.8.0-dev.3",
49
- "@itwin/core-quantity": "4.8.0-dev.3"
45
+ "@itwin/build-tools": "4.8.0-dev.32",
46
+ "@itwin/core-bentley": "4.8.0-dev.32",
47
+ "@itwin/core-quantity": "4.8.0-dev.32",
48
+ "@itwin/core-common": "4.8.0-dev.32",
49
+ "@itwin/ecschema-metadata": "4.8.0-dev.32"
50
50
  },
51
51
  "peerDependencies": {
52
- "@itwin/core-bentley": "^4.8.0-dev.3",
53
- "@itwin/core-quantity": "^4.8.0-dev.3",
54
- "@itwin/ecschema-metadata": "^4.8.0-dev.3"
52
+ "@itwin/core-bentley": "^4.8.0-dev.32",
53
+ "@itwin/core-quantity": "^4.8.0-dev.32",
54
+ "@itwin/ecschema-metadata": "^4.8.0-dev.32"
55
55
  },
56
56
  "nyc": {
57
57
  "extends": "./node_modules/@itwin/build-tools/.nycrc"