@itwin/ecschema-editing 5.0.0-dev.9 → 5.0.0-dev.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -1
- package/lib/cjs/Differencing/Errors.js +6 -0
- package/lib/cjs/Differencing/Errors.js.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.d.ts +3 -1
- package/lib/cjs/Differencing/SchemaConflicts.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.js +2 -0
- package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +4 -3
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +57 -11
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.d.ts +33 -4
- package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.js +55 -5
- package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts +2 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js +78 -19
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.js +5 -0
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.js.map +1 -1
- package/lib/cjs/Differencing/Utils.js.map +1 -1
- package/lib/cjs/Editing/Constants.d.ts +2 -1
- package/lib/cjs/Editing/Constants.d.ts.map +1 -1
- package/lib/cjs/Editing/Constants.js +4 -1
- package/lib/cjs/Editing/Constants.js.map +1 -1
- package/lib/cjs/Editing/CustomAttributes.d.ts +2 -1
- package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -1
- package/lib/cjs/Editing/CustomAttributes.js +3 -0
- package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
- package/lib/cjs/Editing/ECClasses.d.ts +6 -1
- package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
- package/lib/cjs/Editing/ECClasses.js +48 -49
- package/lib/cjs/Editing/ECClasses.js.map +1 -1
- package/lib/cjs/Editing/Editor.d.ts +2 -2
- package/lib/cjs/Editing/Editor.d.ts.map +1 -1
- package/lib/cjs/Editing/Editor.js +32 -21
- package/lib/cjs/Editing/Editor.js.map +1 -1
- package/lib/cjs/Editing/Entities.d.ts +2 -1
- package/lib/cjs/Editing/Entities.d.ts.map +1 -1
- package/lib/cjs/Editing/Entities.js +18 -14
- package/lib/cjs/Editing/Entities.js.map +1 -1
- package/lib/cjs/Editing/Enumerations.d.ts +2 -1
- package/lib/cjs/Editing/Enumerations.d.ts.map +1 -1
- package/lib/cjs/Editing/Enumerations.js +6 -3
- package/lib/cjs/Editing/Enumerations.js.map +1 -1
- package/lib/cjs/Editing/Exception.js +35 -6
- package/lib/cjs/Editing/Exception.js.map +1 -1
- package/lib/cjs/Editing/Formats.d.ts +2 -1
- package/lib/cjs/Editing/Formats.d.ts.map +1 -1
- package/lib/cjs/Editing/Formats.js +5 -1
- package/lib/cjs/Editing/Formats.js.map +1 -1
- package/lib/cjs/Editing/InvertedUnits.d.ts +2 -1
- package/lib/cjs/Editing/InvertedUnits.d.ts.map +1 -1
- package/lib/cjs/Editing/InvertedUnits.js +10 -6
- package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.d.ts +2 -1
- package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.js +11 -7
- package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
- package/lib/cjs/Editing/Mixins.d.ts +2 -1
- package/lib/cjs/Editing/Mixins.d.ts.map +1 -1
- package/lib/cjs/Editing/Mixins.js +13 -9
- package/lib/cjs/Editing/Mixins.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableArrayProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableCAClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableClass.d.ts +2 -1
- package/lib/cjs/Editing/Mutable/MutableClass.d.ts.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableConstant.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableEnumeration.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.d.ts +8 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.d.ts.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableMixin.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableNavigationProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePhenomenon.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableSchemaItem.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableStructProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableUnit.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableUnitSystem.js.map +1 -1
- package/lib/cjs/Editing/Phenomena.d.ts +2 -1
- package/lib/cjs/Editing/Phenomena.d.ts.map +1 -1
- package/lib/cjs/Editing/Phenomena.js +3 -0
- package/lib/cjs/Editing/Phenomena.js.map +1 -1
- package/lib/cjs/Editing/Properties.d.ts +2 -2
- package/lib/cjs/Editing/Properties.d.ts.map +1 -1
- package/lib/cjs/Editing/Properties.js +6 -4
- package/lib/cjs/Editing/Properties.js.map +1 -1
- package/lib/cjs/Editing/PropertyCategories.d.ts +2 -1
- package/lib/cjs/Editing/PropertyCategories.d.ts.map +1 -1
- package/lib/cjs/Editing/PropertyCategories.js +5 -1
- package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
- package/lib/cjs/Editing/RelationshipClasses.d.ts +1 -0
- package/lib/cjs/Editing/RelationshipClasses.d.ts.map +1 -1
- package/lib/cjs/Editing/RelationshipClasses.js +17 -10
- package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
- package/lib/cjs/Editing/SchemaItems.d.ts +2 -2
- package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -1
- package/lib/cjs/Editing/SchemaItems.js +8 -11
- package/lib/cjs/Editing/SchemaItems.js.map +1 -1
- package/lib/cjs/Editing/Structs.d.ts +2 -1
- package/lib/cjs/Editing/Structs.d.ts.map +1 -1
- package/lib/cjs/Editing/Structs.js +3 -0
- package/lib/cjs/Editing/Structs.js.map +1 -1
- package/lib/cjs/Editing/UnitSystems.d.ts +2 -1
- package/lib/cjs/Editing/UnitSystems.d.ts.map +1 -1
- package/lib/cjs/Editing/UnitSystems.js +3 -0
- package/lib/cjs/Editing/UnitSystems.js.map +1 -1
- package/lib/cjs/Editing/Units.d.ts +2 -1
- package/lib/cjs/Editing/Units.d.ts.map +1 -1
- package/lib/cjs/Editing/Units.js +5 -2
- package/lib/cjs/Editing/Units.js.map +1 -1
- package/lib/cjs/Merging/ClassMerger.js.map +1 -1
- package/lib/cjs/Merging/ConstantMerger.js +4 -4
- package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeClassMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.js +7 -6
- package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
- package/lib/cjs/Merging/Edits/NameMapping.d.ts +22 -0
- package/lib/cjs/Merging/Edits/NameMapping.d.ts.map +1 -0
- package/lib/cjs/Merging/Edits/NameMapping.js +54 -0
- package/lib/cjs/Merging/Edits/NameMapping.js.map +1 -0
- package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts +1 -1
- package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts.map +1 -1
- package/lib/cjs/Merging/Edits/RenameEditHandler.js +1 -260
- package/lib/cjs/Merging/Edits/RenameEditHandler.js.map +1 -1
- package/lib/cjs/Merging/Edits/SchemaEdits.d.ts +9 -6
- package/lib/cjs/Merging/Edits/SchemaEdits.d.ts.map +1 -1
- package/lib/cjs/Merging/Edits/SchemaEdits.js +19 -14
- package/lib/cjs/Merging/Edits/SchemaEdits.js.map +1 -1
- package/lib/cjs/Merging/Edits/SkipEditHandler.js.map +1 -1
- package/lib/cjs/Merging/EntityClassMerger.js +1 -2
- package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumeratorMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/EnumeratorMerger.js +2 -2
- package/lib/cjs/Merging/EnumeratorMerger.js.map +1 -1
- package/lib/cjs/Merging/FormatMerger.d.ts +24 -0
- package/lib/cjs/Merging/FormatMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/FormatMerger.js +143 -0
- package/lib/cjs/Merging/FormatMerger.js.map +1 -0
- package/lib/cjs/Merging/InvertedUnitMerger.d.ts +14 -0
- package/lib/cjs/Merging/InvertedUnitMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/InvertedUnitMerger.js +45 -0
- package/lib/cjs/Merging/InvertedUnitMerger.js.map +1 -0
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.js +4 -5
- package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
- package/lib/cjs/Merging/MixinMerger.js +1 -1
- package/lib/cjs/Merging/MixinMerger.js.map +1 -1
- package/lib/cjs/Merging/PhenomenonMerger.js +1 -1
- package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyCategoryMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyMerger.js +28 -26
- package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.js +4 -4
- package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.d.ts +5 -3
- package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.js +45 -5
- package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts +14 -8
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.js +42 -17
- package/lib/cjs/Merging/SchemaMergingVisitor.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.js +2 -0
- package/lib/cjs/Merging/SchemaMergingWalker.js.map +1 -1
- package/lib/cjs/Merging/SchemaReferenceMerger.js.map +1 -1
- package/lib/cjs/Merging/StructClassMerger.js.map +1 -1
- package/lib/cjs/Merging/UnitMerger.d.ts +14 -0
- package/lib/cjs/Merging/UnitMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/UnitMerger.js +62 -0
- package/lib/cjs/Merging/UnitMerger.js.map +1 -0
- package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -1
- package/lib/cjs/Merging/Utils.d.ts +11 -0
- package/lib/cjs/Merging/Utils.d.ts.map +1 -1
- package/lib/cjs/Merging/Utils.js +23 -3
- package/lib/cjs/Merging/Utils.js.map +1 -1
- package/lib/cjs/Validation/Diagnostic.js +18 -16
- package/lib/cjs/Validation/Diagnostic.js.map +1 -1
- package/lib/cjs/Validation/DiagnosticReporter.js +4 -1
- package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
- package/lib/cjs/Validation/ECRules.js +1 -1
- package/lib/cjs/Validation/ECRules.js.map +1 -1
- package/lib/cjs/Validation/LoggingDiagnosticReporter.js.map +1 -1
- package/lib/cjs/Validation/RuleSuppressionSet.js.map +1 -1
- package/lib/cjs/Validation/Rules.js.map +1 -1
- package/lib/cjs/Validation/SchemaChanges.js +39 -69
- package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareDiagnostics.d.ts +2 -2
- package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js +4 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareVisitor.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaCompareVisitor.js +23 -23
- package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.d.ts +22 -1
- package/lib/cjs/Validation/SchemaComparer.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.js +30 -5
- package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
- package/lib/cjs/Validation/SchemaValidater.js +1 -4
- package/lib/cjs/Validation/SchemaValidater.js.map +1 -1
- package/lib/cjs/Validation/SchemaValidationVisitor.js +3 -4
- package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.js +6 -4
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
- package/lib/cjs/ecschema-editing.js.map +1 -1
- package/lib/esm/Differencing/Errors.d.ts +19 -0
- package/lib/esm/Differencing/Errors.d.ts.map +1 -0
- package/lib/esm/Differencing/Errors.js +26 -0
- package/lib/esm/Differencing/Errors.js.map +1 -0
- package/lib/esm/Differencing/SchemaConflicts.d.ts +84 -0
- package/lib/esm/Differencing/SchemaConflicts.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaConflicts.js +60 -0
- package/lib/esm/Differencing/SchemaConflicts.js.map +1 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.d.ts +41 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.js +443 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.js.map +1 -0
- package/lib/esm/Differencing/SchemaDifference.d.ts +357 -0
- package/lib/esm/Differencing/SchemaDifference.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDifference.js +106 -0
- package/lib/esm/Differencing/SchemaDifference.js.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.d.ts +18 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.js +521 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.js.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.d.ts +32 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.js +88 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.js.map +1 -0
- package/lib/esm/Differencing/Utils.d.ts +110 -0
- package/lib/esm/Differencing/Utils.d.ts.map +1 -0
- package/lib/esm/Differencing/Utils.js +161 -0
- package/lib/esm/Differencing/Utils.js.map +1 -0
- package/lib/esm/Editing/Constants.d.ts +22 -0
- package/lib/esm/Editing/Constants.d.ts.map +1 -0
- package/lib/esm/Editing/Constants.js +55 -0
- package/lib/esm/Editing/Constants.js.map +1 -0
- package/lib/esm/Editing/CustomAttributes.d.ts +22 -0
- package/lib/esm/Editing/CustomAttributes.d.ts.map +1 -0
- package/lib/esm/Editing/CustomAttributes.js +49 -0
- package/lib/esm/Editing/CustomAttributes.js.map +1 -0
- package/lib/esm/Editing/ECClasses.d.ts +86 -0
- package/lib/esm/Editing/ECClasses.d.ts.map +1 -0
- package/lib/esm/Editing/ECClasses.js +294 -0
- package/lib/esm/Editing/ECClasses.js.map +1 -0
- package/lib/esm/Editing/Editor.d.ts +117 -0
- package/lib/esm/Editing/Editor.d.ts.map +1 -0
- package/lib/esm/Editing/Editor.js +264 -0
- package/lib/esm/Editing/Editor.js.map +1 -0
- package/lib/esm/Editing/Entities.d.ts +38 -0
- package/lib/esm/Editing/Entities.d.ts.map +1 -0
- package/lib/esm/Editing/Entities.js +126 -0
- package/lib/esm/Editing/Entities.js.map +1 -0
- package/lib/esm/Editing/Enumerations.d.ts +25 -0
- package/lib/esm/Editing/Enumerations.d.ts.map +1 -0
- package/lib/esm/Editing/Enumerations.js +90 -0
- package/lib/esm/Editing/Enumerations.js.map +1 -0
- package/lib/esm/Editing/Exception.d.ts +358 -0
- package/lib/esm/Editing/Exception.d.ts.map +1 -0
- package/lib/esm/Editing/Exception.js +471 -0
- package/lib/esm/Editing/Exception.js.map +1 -0
- package/lib/esm/Editing/Formats.d.ts +23 -0
- package/lib/esm/Editing/Formats.d.ts.map +1 -0
- package/lib/esm/Editing/Formats.js +62 -0
- package/lib/esm/Editing/Formats.js.map +1 -0
- package/lib/esm/Editing/InvertedUnits.d.ts +19 -0
- package/lib/esm/Editing/InvertedUnits.d.ts.map +1 -0
- package/lib/esm/Editing/InvertedUnits.js +68 -0
- package/lib/esm/Editing/InvertedUnits.js.map +1 -0
- package/lib/esm/Editing/KindOfQuantities.d.ts +30 -0
- package/lib/esm/Editing/KindOfQuantities.d.ts.map +1 -0
- package/lib/esm/Editing/KindOfQuantities.js +92 -0
- package/lib/esm/Editing/KindOfQuantities.js.map +1 -0
- package/lib/esm/Editing/Mixins.d.ts +35 -0
- package/lib/esm/Editing/Mixins.d.ts.map +1 -0
- package/lib/esm/Editing/Mixins.js +90 -0
- package/lib/esm/Editing/Mixins.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.d.ts +10 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.d.ts +10 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.js +12 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableClass.d.ts +39 -0
- package/lib/esm/Editing/Mutable/MutableClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableClass.js +18 -0
- package/lib/esm/Editing/Mutable/MutableClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableConstant.d.ts +14 -0
- package/lib/esm/Editing/Mutable/MutableConstant.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableConstant.js +12 -0
- package/lib/esm/Editing/Mutable/MutableConstant.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.d.ts +12 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.js +12 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.js +11 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableFormat.d.ts +26 -0
- package/lib/esm/Editing/Mutable/MutableFormat.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableFormat.js +12 -0
- package/lib/esm/Editing/Mutable/MutableFormat.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.js +12 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.d.ts +14 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.js +12 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableMixin.d.ts +12 -0
- package/lib/esm/Editing/Mutable/MutableMixin.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableMixin.js +12 -0
- package/lib/esm/Editing/Mutable/MutableMixin.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.d.ts +8 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.js +12 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.d.ts +13 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableProperty.d.ts +16 -0
- package/lib/esm/Editing/Mutable/MutableProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.js +12 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.d.ts +30 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.js +20 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchema.d.ts +51 -0
- package/lib/esm/Editing/Mutable/MutableSchema.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchema.js +14 -0
- package/lib/esm/Editing/Mutable/MutableSchema.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.js +12 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.d.ts +8 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnit.d.ts +12 -0
- package/lib/esm/Editing/Mutable/MutableUnit.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnit.js +12 -0
- package/lib/esm/Editing/Mutable/MutableUnit.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.d.ts +10 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.js +12 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.js.map +1 -0
- package/lib/esm/Editing/Phenomena.d.ts +17 -0
- package/lib/esm/Editing/Phenomena.d.ts.map +1 -0
- package/lib/esm/Editing/Phenomena.js +44 -0
- package/lib/esm/Editing/Phenomena.js.map +1 -0
- package/lib/esm/Editing/Properties.d.ts +206 -0
- package/lib/esm/Editing/Properties.d.ts.map +1 -0
- package/lib/esm/Editing/Properties.js +415 -0
- package/lib/esm/Editing/Properties.js.map +1 -0
- package/lib/esm/Editing/PropertyCategories.d.ts +18 -0
- package/lib/esm/Editing/PropertyCategories.d.ts.map +1 -0
- package/lib/esm/Editing/PropertyCategories.js +54 -0
- package/lib/esm/Editing/PropertyCategories.js.map +1 -0
- package/lib/esm/Editing/RelationshipClasses.d.ts +69 -0
- package/lib/esm/Editing/RelationshipClasses.d.ts.map +1 -0
- package/lib/esm/Editing/RelationshipClasses.js +236 -0
- package/lib/esm/Editing/RelationshipClasses.js.map +1 -0
- package/lib/esm/Editing/SchemaItems.d.ts +42 -0
- package/lib/esm/Editing/SchemaItems.d.ts.map +1 -0
- package/lib/esm/Editing/SchemaItems.js +104 -0
- package/lib/esm/Editing/SchemaItems.js.map +1 -0
- package/lib/esm/Editing/Structs.d.ts +21 -0
- package/lib/esm/Editing/Structs.d.ts.map +1 -0
- package/lib/esm/Editing/Structs.js +47 -0
- package/lib/esm/Editing/Structs.js.map +1 -0
- package/lib/esm/Editing/UnitSystems.d.ts +17 -0
- package/lib/esm/Editing/UnitSystems.d.ts.map +1 -0
- package/lib/esm/Editing/UnitSystems.js +43 -0
- package/lib/esm/Editing/UnitSystems.js.map +1 -0
- package/lib/esm/Editing/Units.d.ts +17 -0
- package/lib/esm/Editing/Units.d.ts.map +1 -0
- package/lib/esm/Editing/Units.js +49 -0
- package/lib/esm/Editing/Units.js.map +1 -0
- package/lib/esm/Merging/ClassMerger.d.ts +9 -0
- package/lib/esm/Merging/ClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/ClassMerger.js +66 -0
- package/lib/esm/Merging/ClassMerger.js.map +1 -0
- package/lib/esm/Merging/ConstantMerger.d.ts +14 -0
- package/lib/esm/Merging/ConstantMerger.d.ts.map +1 -0
- package/lib/esm/Merging/ConstantMerger.js +64 -0
- package/lib/esm/Merging/ConstantMerger.js.map +1 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.d.ts +14 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.js +36 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.js.map +1 -0
- package/lib/esm/Merging/CustomAttributeMerger.d.ts +19 -0
- package/lib/esm/Merging/CustomAttributeMerger.d.ts.map +1 -0
- package/lib/esm/Merging/CustomAttributeMerger.js +66 -0
- package/lib/esm/Merging/CustomAttributeMerger.js.map +1 -0
- package/lib/esm/Merging/Edits/NameMapping.d.ts +22 -0
- package/lib/esm/Merging/Edits/NameMapping.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/NameMapping.js +49 -0
- package/lib/esm/Merging/Edits/NameMapping.js.map +1 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.d.ts +14 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.js +62 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.js.map +1 -0
- package/lib/esm/Merging/Edits/SchemaEdits.d.ts +81 -0
- package/lib/esm/Merging/Edits/SchemaEdits.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/SchemaEdits.js +112 -0
- package/lib/esm/Merging/Edits/SchemaEdits.js.map +1 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.d.ts +14 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.js +60 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.js.map +1 -0
- package/lib/esm/Merging/EntityClassMerger.d.ts +19 -0
- package/lib/esm/Merging/EntityClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/EntityClassMerger.js +39 -0
- package/lib/esm/Merging/EntityClassMerger.js.map +1 -0
- package/lib/esm/Merging/EnumerationMerger.d.ts +14 -0
- package/lib/esm/Merging/EnumerationMerger.d.ts.map +1 -0
- package/lib/esm/Merging/EnumerationMerger.js +48 -0
- package/lib/esm/Merging/EnumerationMerger.js.map +1 -0
- package/lib/esm/Merging/EnumeratorMerger.d.ts +14 -0
- package/lib/esm/Merging/EnumeratorMerger.d.ts.map +1 -0
- package/lib/esm/Merging/EnumeratorMerger.js +36 -0
- package/lib/esm/Merging/EnumeratorMerger.js.map +1 -0
- package/lib/esm/Merging/FormatMerger.d.ts +24 -0
- package/lib/esm/Merging/FormatMerger.d.ts.map +1 -0
- package/lib/esm/Merging/FormatMerger.js +137 -0
- package/lib/esm/Merging/FormatMerger.js.map +1 -0
- package/lib/esm/Merging/InvertedUnitMerger.d.ts +14 -0
- package/lib/esm/Merging/InvertedUnitMerger.d.ts.map +1 -0
- package/lib/esm/Merging/InvertedUnitMerger.js +41 -0
- package/lib/esm/Merging/InvertedUnitMerger.js.map +1 -0
- package/lib/esm/Merging/KindOfQuantityMerger.d.ts +19 -0
- package/lib/esm/Merging/KindOfQuantityMerger.d.ts.map +1 -0
- package/lib/esm/Merging/KindOfQuantityMerger.js +89 -0
- package/lib/esm/Merging/KindOfQuantityMerger.js.map +1 -0
- package/lib/esm/Merging/MixinMerger.d.ts +14 -0
- package/lib/esm/Merging/MixinMerger.d.ts.map +1 -0
- package/lib/esm/Merging/MixinMerger.js +33 -0
- package/lib/esm/Merging/MixinMerger.js.map +1 -0
- package/lib/esm/Merging/PhenomenonMerger.d.ts +14 -0
- package/lib/esm/Merging/PhenomenonMerger.d.ts.map +1 -0
- package/lib/esm/Merging/PhenomenonMerger.js +36 -0
- package/lib/esm/Merging/PhenomenonMerger.js.map +1 -0
- package/lib/esm/Merging/PropertyCategoryMerger.d.ts +14 -0
- package/lib/esm/Merging/PropertyCategoryMerger.d.ts.map +1 -0
- package/lib/esm/Merging/PropertyCategoryMerger.js +31 -0
- package/lib/esm/Merging/PropertyCategoryMerger.js.map +1 -0
- package/lib/esm/Merging/PropertyMerger.d.ts +12 -0
- package/lib/esm/Merging/PropertyMerger.d.ts.map +1 -0
- package/lib/esm/Merging/PropertyMerger.js +228 -0
- package/lib/esm/Merging/PropertyMerger.js.map +1 -0
- package/lib/esm/Merging/RelationshipClassMerger.d.ts +27 -0
- package/lib/esm/Merging/RelationshipClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/RelationshipClassMerger.js +136 -0
- package/lib/esm/Merging/RelationshipClassMerger.js.map +1 -0
- package/lib/esm/Merging/SchemaMerger.d.ts +49 -0
- package/lib/esm/Merging/SchemaMerger.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaMerger.js +117 -0
- package/lib/esm/Merging/SchemaMerger.js.map +1 -0
- package/lib/esm/Merging/SchemaMergingVisitor.d.ts +149 -0
- package/lib/esm/Merging/SchemaMergingVisitor.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaMergingVisitor.js +339 -0
- package/lib/esm/Merging/SchemaMergingVisitor.js.map +1 -0
- package/lib/esm/Merging/SchemaMergingWalker.d.ts +19 -0
- package/lib/esm/Merging/SchemaMergingWalker.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaMergingWalker.js +61 -0
- package/lib/esm/Merging/SchemaMergingWalker.js.map +1 -0
- package/lib/esm/Merging/SchemaReferenceMerger.d.ts +13 -0
- package/lib/esm/Merging/SchemaReferenceMerger.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaReferenceMerger.js +57 -0
- package/lib/esm/Merging/SchemaReferenceMerger.js.map +1 -0
- package/lib/esm/Merging/StructClassMerger.d.ts +14 -0
- package/lib/esm/Merging/StructClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/StructClassMerger.js +20 -0
- package/lib/esm/Merging/StructClassMerger.js.map +1 -0
- package/lib/esm/Merging/UnitMerger.d.ts +14 -0
- package/lib/esm/Merging/UnitMerger.d.ts.map +1 -0
- package/lib/esm/Merging/UnitMerger.js +58 -0
- package/lib/esm/Merging/UnitMerger.js.map +1 -0
- package/lib/esm/Merging/UnitSystemMerger.d.ts +14 -0
- package/lib/esm/Merging/UnitSystemMerger.d.ts.map +1 -0
- package/lib/esm/Merging/UnitSystemMerger.js +24 -0
- package/lib/esm/Merging/UnitSystemMerger.js.map +1 -0
- package/lib/esm/Merging/Utils.d.ts +34 -0
- package/lib/esm/Merging/Utils.d.ts.map +1 -0
- package/lib/esm/Merging/Utils.js +90 -0
- package/lib/esm/Merging/Utils.js.map +1 -0
- package/lib/esm/Validation/Diagnostic.d.ts +322 -0
- package/lib/esm/Validation/Diagnostic.d.ts.map +1 -0
- package/lib/esm/Validation/Diagnostic.js +295 -0
- package/lib/esm/Validation/Diagnostic.js.map +1 -0
- package/lib/esm/Validation/DiagnosticReporter.d.ts +97 -0
- package/lib/esm/Validation/DiagnosticReporter.d.ts.map +1 -0
- package/lib/esm/Validation/DiagnosticReporter.js +105 -0
- package/lib/esm/Validation/DiagnosticReporter.js.map +1 -0
- package/lib/esm/Validation/ECRules.d.ts +454 -0
- package/lib/esm/Validation/ECRules.d.ts.map +1 -0
- package/lib/esm/Validation/ECRules.js +578 -0
- package/lib/esm/Validation/ECRules.js.map +1 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.d.ts +14 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.d.ts.map +1 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.js +37 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.js.map +1 -0
- package/lib/esm/Validation/RuleSuppressionSet.d.ts +60 -0
- package/lib/esm/Validation/RuleSuppressionSet.d.ts.map +1 -0
- package/lib/esm/Validation/RuleSuppressionSet.js +9 -0
- package/lib/esm/Validation/RuleSuppressionSet.js.map +1 -0
- package/lib/esm/Validation/Rules.d.ts +65 -0
- package/lib/esm/Validation/Rules.d.ts.map +1 -0
- package/lib/esm/Validation/Rules.js +9 -0
- package/lib/esm/Validation/Rules.js.map +1 -0
- package/lib/esm/Validation/SchemaChanges.d.ts +640 -0
- package/lib/esm/Validation/SchemaChanges.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaChanges.js +1141 -0
- package/lib/esm/Validation/SchemaChanges.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.d.ts +423 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.js +109 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareReporter.d.ts +12 -0
- package/lib/esm/Validation/SchemaCompareReporter.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareReporter.js +9 -0
- package/lib/esm/Validation/SchemaCompareReporter.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.d.ts +237 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.js +346 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareVisitor.d.ts +120 -0
- package/lib/esm/Validation/SchemaCompareVisitor.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareVisitor.js +222 -0
- package/lib/esm/Validation/SchemaCompareVisitor.js.map +1 -0
- package/lib/esm/Validation/SchemaComparer.d.ts +211 -0
- package/lib/esm/Validation/SchemaComparer.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaComparer.js +770 -0
- package/lib/esm/Validation/SchemaComparer.js.map +1 -0
- package/lib/esm/Validation/SchemaValidater.d.ts +20 -0
- package/lib/esm/Validation/SchemaValidater.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaValidater.js +55 -0
- package/lib/esm/Validation/SchemaValidater.js.map +1 -0
- package/lib/esm/Validation/SchemaValidationVisitor.d.ts +171 -0
- package/lib/esm/Validation/SchemaValidationVisitor.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaValidationVisitor.js +488 -0
- package/lib/esm/Validation/SchemaValidationVisitor.js.map +1 -0
- package/lib/esm/Validation/SchemaWalker.d.ts +23 -0
- package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaWalker.js +50 -0
- package/lib/esm/Validation/SchemaWalker.js.map +1 -0
- package/lib/esm/ecschema-editing.d.ts +49 -0
- package/lib/esm/ecschema-editing.d.ts.map +1 -0
- package/lib/esm/ecschema-editing.js +52 -0
- package/lib/esm/ecschema-editing.js.map +1 -0
- package/package.json +19 -17
- package/public/locales/en/ECSchemaEditing.json +26 -26
|
@@ -0,0 +1,770 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Comparison
|
|
7
|
+
*/
|
|
8
|
+
import { classModifierToString, containerTypeToString, OverrideFormat, primitiveTypeToString, propertyTypeToString, SchemaItem, strengthDirectionToString, strengthToString, } from "@itwin/ecschema-metadata";
|
|
9
|
+
import { formatTraitsToArray } from "@itwin/core-quantity";
|
|
10
|
+
import { SchemaCompareResultDelegate } from "./SchemaCompareResultDelegate";
|
|
11
|
+
import { SchemaCompareVisitor } from "./SchemaCompareVisitor";
|
|
12
|
+
import { SchemaWalker } from "./SchemaWalker";
|
|
13
|
+
/**
|
|
14
|
+
* Enum that identifies if Schema A is being iterated (Forward) or
|
|
15
|
+
* Schema B is being iterated (Backward);
|
|
16
|
+
* @alpha
|
|
17
|
+
*/
|
|
18
|
+
export var SchemaCompareDirection;
|
|
19
|
+
(function (SchemaCompareDirection) {
|
|
20
|
+
SchemaCompareDirection[SchemaCompareDirection["Forward"] = 0] = "Forward";
|
|
21
|
+
SchemaCompareDirection[SchemaCompareDirection["Backward"] = 1] = "Backward";
|
|
22
|
+
})(SchemaCompareDirection || (SchemaCompareDirection = {}));
|
|
23
|
+
function labelsMatch(label1, label2) {
|
|
24
|
+
label1 = label1 === undefined ? "" : label1;
|
|
25
|
+
label2 = label2 === undefined ? "" : label2;
|
|
26
|
+
return label1 === label2;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Compares EC Schemas and reports differences using the [[IDiagnosticReporter]] objects
|
|
30
|
+
* specified.
|
|
31
|
+
* @alpha
|
|
32
|
+
*/
|
|
33
|
+
export class SchemaComparer {
|
|
34
|
+
_compareDirection;
|
|
35
|
+
_reporter;
|
|
36
|
+
_reporters;
|
|
37
|
+
/**
|
|
38
|
+
* Initializes a new SchemaComparer instance.
|
|
39
|
+
* @param reporters The [[IDiagnosticReporter]] object(s) to use to report the results.
|
|
40
|
+
*/
|
|
41
|
+
constructor(...reporters) {
|
|
42
|
+
this._compareDirection = SchemaCompareDirection.Forward;
|
|
43
|
+
this._reporters = reporters;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Resolves a schema Item from the given lookup schema.
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
async resolveItem(item, lookupSchema, itemConstructor) {
|
|
50
|
+
return lookupSchema.lookupItem(item.name, itemConstructor);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Resolves a property from a class.
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
async resolveProperty(propertyA, ecClass) {
|
|
57
|
+
return ecClass.getProperty(propertyA.name);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Compares two schema items to determine if they are the same by name.
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
areEqualByName(itemKeyA, itemKeyB) {
|
|
64
|
+
const nameA = itemKeyA ? itemKeyA.name.toUpperCase() : undefined;
|
|
65
|
+
const nameB = itemKeyB ? itemKeyB.name.toUpperCase() : undefined;
|
|
66
|
+
return nameA === nameB;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Compares two schemas to identify differences.
|
|
70
|
+
* @param schemaA The first Schema.
|
|
71
|
+
* @param schemaB The second Schema.
|
|
72
|
+
*/
|
|
73
|
+
async compareSchemas(schemaA, schemaB) {
|
|
74
|
+
this._reporter = new SchemaCompareResultDelegate(schemaA, schemaB, ...this._reporters);
|
|
75
|
+
let visitor = new SchemaCompareVisitor(this, schemaB);
|
|
76
|
+
let walker = new SchemaWalker(visitor);
|
|
77
|
+
await walker.traverseSchema(schemaA);
|
|
78
|
+
this._compareDirection = SchemaCompareDirection.Backward;
|
|
79
|
+
visitor = new SchemaCompareVisitor(this, schemaA);
|
|
80
|
+
walker = new SchemaWalker(visitor);
|
|
81
|
+
await walker.traverseSchema(schemaB);
|
|
82
|
+
this._compareDirection = SchemaCompareDirection.Forward;
|
|
83
|
+
this._reporter.compareComplete();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Compares two schemas to identify differences between property values.
|
|
87
|
+
* @param schemaA The first Schema.
|
|
88
|
+
* @param schemaB The second Schema.
|
|
89
|
+
*/
|
|
90
|
+
async compareSchemaProps(schemaA, schemaB) {
|
|
91
|
+
const promises = [];
|
|
92
|
+
for (const ref of schemaA.references) {
|
|
93
|
+
const refB = await schemaB.getReference(ref.fullName);
|
|
94
|
+
if (!refB)
|
|
95
|
+
promises.push(this._reporter.reportSchemaReferenceMissing(schemaA, ref, this._compareDirection));
|
|
96
|
+
else if (!refB.schemaKey.matches(ref.schemaKey))
|
|
97
|
+
promises.push(this._reporter.reportSchemaReferenceDelta(schemaA, ref, ref.schemaKey.version.toString(), refB.schemaKey.version.toString(), this._compareDirection));
|
|
98
|
+
}
|
|
99
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
100
|
+
return;
|
|
101
|
+
if (schemaA.schemaKey.toString() !== schemaB.schemaKey.toString())
|
|
102
|
+
promises.push(this._reporter.reportSchemaDelta(schemaA, "schemaKey", schemaA.schemaKey.toString(), schemaB.schemaKey.toString(), this._compareDirection));
|
|
103
|
+
if (schemaA.alias !== schemaB.alias)
|
|
104
|
+
promises.push(this._reporter.reportSchemaDelta(schemaA, "alias", schemaA.alias, schemaB.alias, this._compareDirection));
|
|
105
|
+
if (schemaA.description !== schemaB.description)
|
|
106
|
+
promises.push(this._reporter.reportSchemaDelta(schemaA, "description", schemaA.description, schemaB.description, this._compareDirection));
|
|
107
|
+
if (schemaA.label !== schemaB.label)
|
|
108
|
+
promises.push(this._reporter.reportSchemaDelta(schemaA, "label", schemaA.label, schemaB.label, this._compareDirection));
|
|
109
|
+
await Promise.all(promises);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Compares two SchemaItems to identify differences between property values.
|
|
113
|
+
* @param schemaItemA The first SchemaItem.
|
|
114
|
+
* @param schemaItemB The second SchemaItem.
|
|
115
|
+
*/
|
|
116
|
+
async compareSchemaItems(schemaItemA, schemaItemB) {
|
|
117
|
+
const promises = [];
|
|
118
|
+
if (!schemaItemB) {
|
|
119
|
+
promises.push(this._reporter.reportSchemaItemMissing(schemaItemA, this._compareDirection));
|
|
120
|
+
await Promise.all(promises);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
124
|
+
return;
|
|
125
|
+
if (schemaItemA.schemaItemType !== schemaItemB.schemaItemType) {
|
|
126
|
+
const aType = schemaItemA.schemaItemType;
|
|
127
|
+
const bType = schemaItemB.schemaItemType;
|
|
128
|
+
promises.push(this._reporter.reportSchemaItemDelta(schemaItemA, "schemaItemType", aType, bType, this._compareDirection));
|
|
129
|
+
await Promise.all(promises);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (schemaItemA.description !== schemaItemB.description)
|
|
133
|
+
promises.push(this._reporter.reportSchemaItemDelta(schemaItemA, "description", schemaItemA.description, schemaItemB.description, this._compareDirection));
|
|
134
|
+
if (!labelsMatch(schemaItemA.label, schemaItemB.label))
|
|
135
|
+
promises.push(this._reporter.reportSchemaItemDelta(schemaItemA, "label", schemaItemA.label, schemaItemB.label, this._compareDirection));
|
|
136
|
+
await Promise.all(promises);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Compares two ECClasses to identify differences between property values.
|
|
140
|
+
* @param classA The first ECClass.
|
|
141
|
+
* @param classB The second ECClass.
|
|
142
|
+
*/
|
|
143
|
+
async compareClasses(classA, classB) {
|
|
144
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
145
|
+
return;
|
|
146
|
+
const promises = [];
|
|
147
|
+
if (classA.modifier !== classB.modifier) {
|
|
148
|
+
const aMod = classModifierToString(classA.modifier);
|
|
149
|
+
const bMod = classModifierToString(classB.modifier);
|
|
150
|
+
promises.push(this._reporter.reportClassDelta(classA, "modifier", aMod, bMod, this._compareDirection));
|
|
151
|
+
}
|
|
152
|
+
if (classA.baseClass || classB.baseClass) {
|
|
153
|
+
const fullNameA = classA.baseClass?.fullName;
|
|
154
|
+
const fullNameB = classB.baseClass?.fullName;
|
|
155
|
+
if (fullNameA !== fullNameB) {
|
|
156
|
+
const areSameByName = this.areItemsSameByName(classA.baseClass, classB.baseClass, classA.schema.name, classB.schema.name);
|
|
157
|
+
if (!areSameByName) {
|
|
158
|
+
const baseA = await classA.baseClass;
|
|
159
|
+
const baseB = await classB.baseClass;
|
|
160
|
+
promises.push(this._reporter.reportBaseClassDelta(classA, baseA, baseB, this._compareDirection));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
await Promise.all(promises);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Compares two ECProperties to identify differences between property values.
|
|
168
|
+
* @param propertyA The first ECProperty.
|
|
169
|
+
* @param propertyB The second ECProperty.
|
|
170
|
+
*/
|
|
171
|
+
async compareProperties(propertyA, propertyB) {
|
|
172
|
+
const promises = [];
|
|
173
|
+
if (!propertyB) {
|
|
174
|
+
promises.push(this._reporter.reportPropertyMissing(propertyA, this._compareDirection));
|
|
175
|
+
await Promise.all(promises);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
179
|
+
return;
|
|
180
|
+
const propertyTypeA = propertyTypeToString(propertyA.propertyType);
|
|
181
|
+
const propertyTypeB = propertyTypeToString(propertyB.propertyType);
|
|
182
|
+
if (propertyTypeA !== propertyTypeB) {
|
|
183
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "type", propertyTypeA, propertyTypeB, this._compareDirection));
|
|
184
|
+
await Promise.all(promises);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (!labelsMatch(propertyA.label, propertyB.label))
|
|
188
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "label", propertyA.label, propertyB.label, this._compareDirection));
|
|
189
|
+
if (propertyA.description !== propertyB.description)
|
|
190
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "description", propertyA.description, propertyB.description, this._compareDirection));
|
|
191
|
+
if (propertyA.isReadOnly !== propertyB.isReadOnly)
|
|
192
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "isReadOnly", propertyA.isReadOnly, propertyB.isReadOnly, this._compareDirection));
|
|
193
|
+
if (propertyA.priority !== propertyB.priority)
|
|
194
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "priority", propertyA.priority, propertyB.priority, this._compareDirection));
|
|
195
|
+
if (propertyA.category || propertyB.category) {
|
|
196
|
+
const catKeyA = propertyA.category?.fullName;
|
|
197
|
+
const catKeyB = propertyB.category?.fullName;
|
|
198
|
+
if (catKeyA !== catKeyB) {
|
|
199
|
+
const areSameByName = this.areItemsSameByName(propertyA.category, propertyB.category, propertyA.schema.name, propertyB.schema.name);
|
|
200
|
+
if (!areSameByName)
|
|
201
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "category", catKeyA, catKeyB, this._compareDirection));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (propertyA.kindOfQuantity || propertyB.kindOfQuantity) {
|
|
205
|
+
const koqKeyA = propertyA.kindOfQuantity?.fullName;
|
|
206
|
+
const koqKeyB = propertyB.kindOfQuantity?.fullName;
|
|
207
|
+
if (koqKeyA !== koqKeyB) {
|
|
208
|
+
const areSameByName = this.areItemsSameByName(propertyA.kindOfQuantity, propertyB.kindOfQuantity, propertyA.schema.name, propertyB.schema.name);
|
|
209
|
+
if (!areSameByName)
|
|
210
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "kindOfQuantity", koqKeyA, koqKeyB, this._compareDirection));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
promises.push(this.comparePropertyType(propertyA, propertyB));
|
|
214
|
+
await Promise.all(promises);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Compares two EntityClass objects to identify differences between property values.
|
|
218
|
+
* @param entityA
|
|
219
|
+
* @param entityB
|
|
220
|
+
*/
|
|
221
|
+
async compareEntityClasses(entityA, entityB) {
|
|
222
|
+
const promises = [];
|
|
223
|
+
for (const mixinA of entityA.mixins) {
|
|
224
|
+
if (-1 === entityB.mixins.findIndex((mixinB) => this.areItemsSameByName(mixinA, mixinB, entityA.schema.name, entityB.schema.name)))
|
|
225
|
+
promises.push(this._reporter.reportEntityMixinMissing(entityA, await mixinA, this._compareDirection));
|
|
226
|
+
}
|
|
227
|
+
await Promise.all(promises);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Compares two Mixin objects to identify differences between property values.
|
|
231
|
+
* @param mixinA
|
|
232
|
+
* @param mixinB
|
|
233
|
+
*/
|
|
234
|
+
async compareMixins(mixinA, mixinB) {
|
|
235
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
236
|
+
return;
|
|
237
|
+
if (mixinA.appliesTo || mixinB.appliesTo) {
|
|
238
|
+
const appliesToA = mixinA.appliesTo?.fullName;
|
|
239
|
+
const appliesToB = mixinB.appliesTo?.fullName;
|
|
240
|
+
if (appliesToA !== appliesToB) {
|
|
241
|
+
const areSameByName = this.areItemsSameByName(mixinA.appliesTo, mixinB.appliesTo, mixinA.schema.name, mixinB.schema.name);
|
|
242
|
+
if (!areSameByName)
|
|
243
|
+
await this._reporter.reportMixinDelta(mixinA, "appliesTo", appliesToA, appliesToB, this._compareDirection);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Compares two RelationshipClass objects to identify differences between property values.
|
|
249
|
+
* @param relationshipA
|
|
250
|
+
* @param relationshipB
|
|
251
|
+
*/
|
|
252
|
+
async compareRelationshipClasses(relationshipA, relationshipB) {
|
|
253
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
254
|
+
return;
|
|
255
|
+
const promises = [];
|
|
256
|
+
if (relationshipA.strength !== relationshipB.strength) {
|
|
257
|
+
const strengthAString = strengthToString(relationshipA.strength);
|
|
258
|
+
const strengthBString = strengthToString(relationshipB.strength);
|
|
259
|
+
promises.push(this._reporter.reportRelationshipClassDelta(relationshipA, "strength", strengthAString, strengthBString, this._compareDirection));
|
|
260
|
+
}
|
|
261
|
+
if (relationshipA.strengthDirection !== relationshipB.strengthDirection) {
|
|
262
|
+
const directionAString = strengthDirectionToString(relationshipA.strengthDirection);
|
|
263
|
+
const directionBString = strengthDirectionToString(relationshipB.strengthDirection);
|
|
264
|
+
promises.push(this._reporter.reportRelationshipClassDelta(relationshipA, "strengthDirection", directionAString, directionBString, this._compareDirection));
|
|
265
|
+
}
|
|
266
|
+
await Promise.all(promises);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Compares two RelationshipConstraint objects to identify differences between property values.
|
|
270
|
+
* @param relationshipConstraintA
|
|
271
|
+
* @param relationshipConstraintB
|
|
272
|
+
*/
|
|
273
|
+
async compareRelationshipConstraints(constraintA, constraintB) {
|
|
274
|
+
const promises = [];
|
|
275
|
+
if (constraintA.constraintClasses) {
|
|
276
|
+
for (const classA of constraintA.constraintClasses) {
|
|
277
|
+
if (!constraintB.constraintClasses || -1 === constraintB.constraintClasses.findIndex((classB) => this.areItemsSameByName(classA, classB, constraintA.schema.name, constraintB.schema.name)))
|
|
278
|
+
promises.push(this._reporter.reportRelationshipConstraintClassMissing(constraintA, await classA, this._compareDirection));
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (this._compareDirection === SchemaCompareDirection.Backward) {
|
|
282
|
+
await Promise.all(promises);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
if (constraintA.multiplicity || constraintB.multiplicity) {
|
|
286
|
+
const multiplicityA = constraintA.multiplicity.toString();
|
|
287
|
+
const multiplicityB = constraintB.multiplicity.toString();
|
|
288
|
+
if (multiplicityA !== multiplicityB)
|
|
289
|
+
promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, "multiplicity", multiplicityA, multiplicityB, this._compareDirection));
|
|
290
|
+
}
|
|
291
|
+
if (constraintA.roleLabel !== constraintB.roleLabel)
|
|
292
|
+
promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, "roleLabel", constraintA.roleLabel, constraintB.roleLabel, this._compareDirection));
|
|
293
|
+
if (constraintA.polymorphic !== constraintB.polymorphic)
|
|
294
|
+
promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, "polymorphic", constraintA.polymorphic, constraintB.polymorphic, this._compareDirection));
|
|
295
|
+
if (constraintA.abstractConstraint || constraintB.abstractConstraint) {
|
|
296
|
+
const abstractA = constraintA.abstractConstraint?.fullName;
|
|
297
|
+
const abstractB = constraintB.abstractConstraint?.fullName;
|
|
298
|
+
if (abstractA !== abstractB) {
|
|
299
|
+
const areSameByName = this.areItemsSameByName(constraintA.abstractConstraint, constraintB.abstractConstraint, constraintA.schema.name, constraintB.schema.name);
|
|
300
|
+
if (!areSameByName) {
|
|
301
|
+
promises.push(this._reporter.reportRelationshipConstraintDelta(constraintA, "abstractConstraint", abstractA, abstractB, this._compareDirection));
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
await Promise.all(promises);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Compares two CustomAttributeClass objects to identify differences between property values.
|
|
309
|
+
* @param customAttributeClassA
|
|
310
|
+
* @param customAttributeClassB
|
|
311
|
+
*/
|
|
312
|
+
async compareCustomAttributeClasses(customAttributeClassA, customAttributeClassB) {
|
|
313
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
314
|
+
return;
|
|
315
|
+
if (customAttributeClassA.appliesTo !== customAttributeClassB.appliesTo) {
|
|
316
|
+
const typeA = containerTypeToString(customAttributeClassA.appliesTo);
|
|
317
|
+
const typeB = containerTypeToString(customAttributeClassB.appliesTo);
|
|
318
|
+
await this._reporter.reportCustomAttributeClassDelta(customAttributeClassA, "appliesTo", typeA, typeB, this._compareDirection);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Compares two CustomAttributeContainerProps objects to identify differences between property values.
|
|
323
|
+
* @param containerA
|
|
324
|
+
* @param containerB
|
|
325
|
+
*/
|
|
326
|
+
async compareCustomAttributeContainers(containerA, containerB) {
|
|
327
|
+
const promises = [];
|
|
328
|
+
if (containerA.customAttributes) {
|
|
329
|
+
for (const ca of containerA.customAttributes) {
|
|
330
|
+
if (!containerB.customAttributes || !this.containerHasClass(ca[1], containerA, containerB))
|
|
331
|
+
promises.push(this._reporter.reportCustomAttributeInstanceClassMissing(containerA, ca[1], this._compareDirection));
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
await Promise.all(promises);
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Compares two Enumeration objects to identify differences between property values.
|
|
338
|
+
* @param enumA
|
|
339
|
+
* @param enumB
|
|
340
|
+
*/
|
|
341
|
+
async compareEnumerations(enumA, enumB) {
|
|
342
|
+
const promises = [];
|
|
343
|
+
for (const enumeratorA of enumA.enumerators) {
|
|
344
|
+
const enumeratorB = enumB.enumerators.find((e) => e.name === enumeratorA.name);
|
|
345
|
+
if (!enumeratorB) {
|
|
346
|
+
promises.push(this._reporter.reportEnumeratorMissing(enumA, enumeratorA, this._compareDirection));
|
|
347
|
+
}
|
|
348
|
+
else if (this._compareDirection === SchemaCompareDirection.Forward) {
|
|
349
|
+
promises.push(this.compareEnumerators(enumeratorA, enumeratorB, enumA, enumB));
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (this._compareDirection === SchemaCompareDirection.Backward) {
|
|
353
|
+
await Promise.all(promises);
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
if (enumA.type !== enumB.type) {
|
|
357
|
+
const typeAString = enumA.type ? primitiveTypeToString(enumA.type) : undefined;
|
|
358
|
+
const typeBString = enumB.type ? primitiveTypeToString(enumB.type) : undefined;
|
|
359
|
+
promises.push(this._reporter.reportEnumerationDelta(enumA, "type", typeAString, typeBString, this._compareDirection));
|
|
360
|
+
}
|
|
361
|
+
if (enumA.isStrict !== enumB.isStrict)
|
|
362
|
+
promises.push(this._reporter.reportEnumerationDelta(enumA, "isStrict", enumA.isStrict, enumB.isStrict, this._compareDirection));
|
|
363
|
+
await Promise.all(promises);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Compares two KindOfQuantity objects to identify differences between property values.
|
|
367
|
+
* @param koqA
|
|
368
|
+
* @param koqB
|
|
369
|
+
*/
|
|
370
|
+
async compareKindOfQuantities(koqA, koqB) {
|
|
371
|
+
const promises = [];
|
|
372
|
+
if (koqA.presentationFormats) {
|
|
373
|
+
for (const unitA of koqA.presentationFormats) {
|
|
374
|
+
if (-1 === koqB.presentationFormats.findIndex((unitB) => this.areOverrideFormatsSameByName(unitA, unitB, koqA.schema.name, koqB.schema.name)))
|
|
375
|
+
promises.push(this._reporter.reportPresentationUnitMissing(koqA, unitA, this._compareDirection));
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (this._compareDirection === SchemaCompareDirection.Backward) {
|
|
379
|
+
await Promise.all(promises);
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
if (koqA.relativeError !== koqB.relativeError) {
|
|
383
|
+
promises.push(this._reporter.reportKoqDelta(koqA, "relativeError", koqA.relativeError, koqB.relativeError, this._compareDirection));
|
|
384
|
+
}
|
|
385
|
+
if (koqA.persistenceUnit || koqB.persistenceUnit) {
|
|
386
|
+
const unitNameA = koqA.persistenceUnit?.fullName;
|
|
387
|
+
const unitNameB = koqB.persistenceUnit?.fullName;
|
|
388
|
+
if (unitNameA !== unitNameB) {
|
|
389
|
+
const eqByName = this.areItemsSameByName(koqA.persistenceUnit, koqB.persistenceUnit, koqA.schema.name, koqB.schema.name);
|
|
390
|
+
if (!eqByName)
|
|
391
|
+
promises.push(this._reporter.reportKoqDelta(koqA, "persistenceUnit", unitNameA, unitNameB, this._compareDirection));
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
await Promise.all(promises);
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Compares two PropertyCategory objects to identify differences between property values.
|
|
398
|
+
* @param categoryA
|
|
399
|
+
* @param categoryB
|
|
400
|
+
*/
|
|
401
|
+
async comparePropertyCategories(categoryA, categoryB) {
|
|
402
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
403
|
+
return;
|
|
404
|
+
if (categoryA.priority !== categoryB.priority)
|
|
405
|
+
await this._reporter.reportPropertyCategoryDelta(categoryA, "priority", categoryA.priority, categoryB.priority, this._compareDirection);
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Compares two Format objects to identify differences between property values.
|
|
409
|
+
* @param formatA
|
|
410
|
+
* @param formatB
|
|
411
|
+
*/
|
|
412
|
+
async compareFormats(formatA, formatB) {
|
|
413
|
+
const promises = [];
|
|
414
|
+
promises.push(this.compareFormatUnits(formatA, formatB));
|
|
415
|
+
if (this._compareDirection === SchemaCompareDirection.Backward) {
|
|
416
|
+
await Promise.all(promises);
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
if (formatA.roundFactor !== formatB.roundFactor)
|
|
420
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "roundFactor", formatA.roundFactor, formatB.roundFactor, this._compareDirection));
|
|
421
|
+
if (formatA.type !== formatB.type) {
|
|
422
|
+
const typeAString = formatA.type;
|
|
423
|
+
const typeBString = formatB.type;
|
|
424
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "type", typeAString, typeBString, this._compareDirection));
|
|
425
|
+
}
|
|
426
|
+
if (formatA.precision !== formatB.precision)
|
|
427
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "precision", formatA.precision, formatB.precision, this._compareDirection));
|
|
428
|
+
if (formatA.minWidth !== formatB.minWidth)
|
|
429
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "minWidth", formatA.minWidth, formatB.minWidth, this._compareDirection));
|
|
430
|
+
if (formatA.scientificType !== formatB.scientificType) {
|
|
431
|
+
const typeAString = formatA.scientificType !== undefined ? formatA.scientificType : undefined;
|
|
432
|
+
const typeBString = formatB.scientificType !== undefined ? formatB.scientificType : undefined;
|
|
433
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "scientificType", typeAString, typeBString, this._compareDirection));
|
|
434
|
+
}
|
|
435
|
+
if (formatA.showSignOption !== formatB.showSignOption) {
|
|
436
|
+
const optionA = formatA.showSignOption;
|
|
437
|
+
const optionB = formatB.showSignOption;
|
|
438
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "showSignOption", optionA, optionB, this._compareDirection));
|
|
439
|
+
}
|
|
440
|
+
if (formatA.decimalSeparator !== formatB.decimalSeparator)
|
|
441
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "decimalSeparator", formatA.decimalSeparator, formatB.decimalSeparator, this._compareDirection));
|
|
442
|
+
if (formatA.thousandSeparator !== formatB.thousandSeparator)
|
|
443
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "thousandSeparator", formatA.thousandSeparator, formatB.thousandSeparator, this._compareDirection));
|
|
444
|
+
if (formatA.uomSeparator !== formatB.uomSeparator)
|
|
445
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "uomSeparator", formatA.uomSeparator, formatB.uomSeparator, this._compareDirection));
|
|
446
|
+
if (formatA.stationSeparator !== formatB.stationSeparator)
|
|
447
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "stationSeparator", formatA.stationSeparator, formatB.stationSeparator, this._compareDirection));
|
|
448
|
+
if (formatA.stationOffsetSize !== formatB.stationOffsetSize)
|
|
449
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "stationOffsetSize", formatA.stationOffsetSize, formatB.stationOffsetSize, this._compareDirection));
|
|
450
|
+
if (formatA.formatTraits !== formatB.formatTraits) {
|
|
451
|
+
const traitsA = formatTraitsToArray(formatA.formatTraits);
|
|
452
|
+
const traitsB = formatTraitsToArray(formatB.formatTraits);
|
|
453
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "formatTraits", traitsA.toString(), traitsB.toString(), this._compareDirection));
|
|
454
|
+
}
|
|
455
|
+
if (formatA.spacer !== formatB.spacer)
|
|
456
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "spacer", formatA.spacer, formatB.spacer, this._compareDirection));
|
|
457
|
+
if (formatA.includeZero !== formatB.includeZero)
|
|
458
|
+
promises.push(this._reporter.reportFormatDelta(formatA, "includeZero", formatA.includeZero, formatB.includeZero, this._compareDirection));
|
|
459
|
+
await Promise.all(promises);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Compares two Unit objects to identify differences between property values.
|
|
463
|
+
* @param unitA
|
|
464
|
+
* @param unitB
|
|
465
|
+
*/
|
|
466
|
+
async compareUnits(unitA, unitB) {
|
|
467
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
468
|
+
return;
|
|
469
|
+
const promises = [];
|
|
470
|
+
if (unitA.phenomenon || unitB.phenomenon) {
|
|
471
|
+
const fullNameA = unitA.phenomenon?.fullName;
|
|
472
|
+
const fullNameB = unitB.phenomenon?.fullName;
|
|
473
|
+
if (fullNameA !== fullNameB) {
|
|
474
|
+
const eqByName = this.areItemsSameByName(unitA.phenomenon, unitB.phenomenon, unitA.schema.name, unitB.schema.name);
|
|
475
|
+
if (!eqByName)
|
|
476
|
+
promises.push(this._reporter.reportUnitDelta(unitA, "phenomenon", fullNameA, fullNameB, this._compareDirection));
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
if (unitA.unitSystem || unitB.unitSystem) {
|
|
480
|
+
const fullNameA = unitA.unitSystem?.fullName;
|
|
481
|
+
const fullNameB = unitB.unitSystem?.fullName;
|
|
482
|
+
if (fullNameA !== fullNameB) {
|
|
483
|
+
const eqByName = this.areItemsSameByName(unitA.unitSystem, unitB.unitSystem, unitA.schema.name, unitB.schema.name);
|
|
484
|
+
if (!eqByName)
|
|
485
|
+
promises.push(this._reporter.reportUnitDelta(unitA, "unitSystem", fullNameA, fullNameB, this._compareDirection));
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
if (unitA.definition !== unitB.definition)
|
|
489
|
+
promises.push(this._reporter.reportUnitDelta(unitA, "definition", unitA.definition, unitB.definition, this._compareDirection));
|
|
490
|
+
if (unitA.numerator !== unitB.numerator)
|
|
491
|
+
promises.push(this._reporter.reportUnitDelta(unitA, "numerator", unitA.numerator, unitB.numerator, this._compareDirection));
|
|
492
|
+
if (unitA.denominator !== unitB.denominator)
|
|
493
|
+
promises.push(this._reporter.reportUnitDelta(unitA, "denominator", unitA.denominator, unitB.denominator, this._compareDirection));
|
|
494
|
+
if (unitA.offset !== unitB.offset)
|
|
495
|
+
promises.push(this._reporter.reportUnitDelta(unitA, "offset", unitA.offset, unitB.offset, this._compareDirection));
|
|
496
|
+
await Promise.all(promises);
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Compares two InvertedUnit objects to identify differences between property values.
|
|
500
|
+
* @param invertedUnitA
|
|
501
|
+
* @param invertedUnitB
|
|
502
|
+
*/
|
|
503
|
+
async compareInvertedUnits(invertedUnitA, invertedUnitB) {
|
|
504
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
505
|
+
return;
|
|
506
|
+
const promises = [];
|
|
507
|
+
if (invertedUnitA.invertsUnit || invertedUnitB.invertsUnit) {
|
|
508
|
+
const fullNameA = invertedUnitA.invertsUnit?.fullName;
|
|
509
|
+
const fullNameB = invertedUnitB.invertsUnit?.fullName;
|
|
510
|
+
if (fullNameA !== fullNameB) {
|
|
511
|
+
const eqByName = this.areItemsSameByName(invertedUnitA.invertsUnit, invertedUnitB.invertsUnit, invertedUnitA.schema.name, invertedUnitB.schema.name);
|
|
512
|
+
if (!eqByName)
|
|
513
|
+
promises.push(this._reporter.reportInvertedUnitDelta(invertedUnitA, "invertsUnit", fullNameA, fullNameB, this._compareDirection));
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
if (invertedUnitA.unitSystem || invertedUnitB.unitSystem) {
|
|
517
|
+
const fullNameA = invertedUnitA.unitSystem?.fullName;
|
|
518
|
+
const fullNameB = invertedUnitB.unitSystem?.fullName;
|
|
519
|
+
if (fullNameA !== fullNameB) {
|
|
520
|
+
const eqByName = this.areItemsSameByName(invertedUnitA.unitSystem, invertedUnitB.unitSystem, invertedUnitA.schema.name, invertedUnitB.schema.name);
|
|
521
|
+
if (!eqByName)
|
|
522
|
+
promises.push(this._reporter.reportInvertedUnitDelta(invertedUnitA, "unitSystem", fullNameA, fullNameB, this._compareDirection));
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
await Promise.all(promises);
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Compares two Phenomenon objects to identify differences between property values.
|
|
529
|
+
* @param phenomenonA
|
|
530
|
+
* @param phenomenonB
|
|
531
|
+
*/
|
|
532
|
+
async comparePhenomenons(phenomenonA, phenomenonB) {
|
|
533
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
534
|
+
return;
|
|
535
|
+
if (phenomenonA.definition !== phenomenonB.definition)
|
|
536
|
+
await this._reporter.reportPhenomenonDelta(phenomenonA, "definition", phenomenonA.definition, phenomenonB.definition, this._compareDirection);
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Compares two Constant objects to identify differences between property values.
|
|
540
|
+
* @param constantA
|
|
541
|
+
* @param constantB
|
|
542
|
+
*/
|
|
543
|
+
async compareConstants(constantA, constantB) {
|
|
544
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
545
|
+
return;
|
|
546
|
+
const promises = [];
|
|
547
|
+
if (constantA.phenomenon || constantB.phenomenon) {
|
|
548
|
+
const fullNameA = constantA.phenomenon?.fullName;
|
|
549
|
+
const fullNameB = constantB.phenomenon?.fullName;
|
|
550
|
+
if (fullNameA !== fullNameB) {
|
|
551
|
+
const eqByName = this.areItemsSameByName(constantA.phenomenon, constantB.phenomenon, constantA.schema.name, constantB.schema.name);
|
|
552
|
+
if (!eqByName)
|
|
553
|
+
promises.push(this._reporter.reportConstantDelta(constantA, "phenomenon", fullNameA, fullNameB, this._compareDirection));
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
if (constantA.definition !== constantB.definition)
|
|
557
|
+
promises.push(this._reporter.reportConstantDelta(constantA, "definition", constantA.definition, constantB.definition, this._compareDirection));
|
|
558
|
+
if (constantA.numerator !== constantB.numerator)
|
|
559
|
+
promises.push(this._reporter.reportConstantDelta(constantA, "numerator", constantA.numerator, constantB.numerator, this._compareDirection));
|
|
560
|
+
if (constantA.denominator !== constantB.denominator)
|
|
561
|
+
promises.push(this._reporter.reportConstantDelta(constantA, "denominator", constantA.denominator, constantB.denominator, this._compareDirection));
|
|
562
|
+
await Promise.all(promises);
|
|
563
|
+
}
|
|
564
|
+
async comparePropertyType(propertyA, propertyB) {
|
|
565
|
+
const promises = [];
|
|
566
|
+
if (propertyA.isArray()) {
|
|
567
|
+
const minOccursB = propertyB.isArray() ? propertyB.minOccurs : undefined;
|
|
568
|
+
if (propertyA.minOccurs !== minOccursB) {
|
|
569
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "minOccurs", propertyA.minOccurs, minOccursB, this._compareDirection));
|
|
570
|
+
}
|
|
571
|
+
const maxOccursB = propertyB.isArray() ? propertyB.maxOccurs : undefined;
|
|
572
|
+
if (propertyA.maxOccurs !== maxOccursB) {
|
|
573
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "maxOccurs", propertyA.maxOccurs, maxOccursB, this._compareDirection));
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
if (propertyA.isEnumeration()) {
|
|
577
|
+
const enumerationB = propertyB.isEnumeration() ? propertyB.enumeration : undefined;
|
|
578
|
+
if (propertyA.enumeration || enumerationB) {
|
|
579
|
+
const enumA = propertyA.enumeration?.fullName;
|
|
580
|
+
const enumB = enumerationB?.fullName;
|
|
581
|
+
if (enumA !== enumB) {
|
|
582
|
+
const areSameByName = this.areItemsSameByName(propertyA.enumeration, enumerationB, propertyA.schema.name, propertyB.schema.name);
|
|
583
|
+
if (!areSameByName) {
|
|
584
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "enumeration", enumA, enumB, this._compareDirection));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
if (propertyA.isNavigation()) {
|
|
590
|
+
const strengthDirectionB = propertyB.isNavigation() ? propertyB.direction : undefined;
|
|
591
|
+
if (propertyA.direction !== strengthDirectionB) {
|
|
592
|
+
const dirA = strengthDirectionToString(propertyA.direction);
|
|
593
|
+
const dirB = strengthDirectionB !== undefined ? strengthDirectionToString(strengthDirectionB) : undefined;
|
|
594
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "direction", dirA, dirB, this._compareDirection));
|
|
595
|
+
}
|
|
596
|
+
if (propertyA.relationshipClass) { // eslint-disable-line @typescript-eslint/no-misused-promises
|
|
597
|
+
const relationshipClassB = propertyB.isNavigation() ? propertyB.relationshipClass : undefined;
|
|
598
|
+
const relA = propertyA.relationshipClass.fullName;
|
|
599
|
+
const relB = relationshipClassB ? relationshipClassB.fullName : undefined;
|
|
600
|
+
if (relA !== relB) {
|
|
601
|
+
const areSameByName = this.areItemsSameByName(propertyA.relationshipClass, relationshipClassB, propertyA.schema.name, propertyB.schema.name);
|
|
602
|
+
if (!areSameByName)
|
|
603
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "relationshipClass", relA, relB, this._compareDirection));
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
if (propertyA.isPrimitive()) {
|
|
608
|
+
const primitiveTypeB = propertyB.isPrimitive() ? propertyB.primitiveType : undefined;
|
|
609
|
+
if (propertyA.primitiveType !== primitiveTypeB) {
|
|
610
|
+
const aType = primitiveTypeToString(propertyA.primitiveType);
|
|
611
|
+
const bType = primitiveTypeB !== undefined ? primitiveTypeToString(primitiveTypeB) : undefined;
|
|
612
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "primitiveType", aType, bType, this._compareDirection));
|
|
613
|
+
}
|
|
614
|
+
const minLengthB = propertyB.isPrimitive() ? propertyB.minLength : undefined;
|
|
615
|
+
if (propertyA.minLength !== minLengthB) {
|
|
616
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "minLength", propertyA.minLength, minLengthB, this._compareDirection));
|
|
617
|
+
}
|
|
618
|
+
// valid for primitive and enumeration properties
|
|
619
|
+
const maxLengthB = propertyB.isPrimitive() ? propertyB.maxLength : undefined;
|
|
620
|
+
if (propertyA.maxLength !== maxLengthB) {
|
|
621
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "maxLength", propertyA.maxLength, maxLengthB, this._compareDirection));
|
|
622
|
+
}
|
|
623
|
+
const minValueB = propertyB.isPrimitive() ? propertyB.minValue : undefined;
|
|
624
|
+
if (propertyA.minValue !== minValueB) {
|
|
625
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "minValue", propertyA.minValue, minValueB, this._compareDirection));
|
|
626
|
+
}
|
|
627
|
+
const maxValueB = propertyB.isPrimitive() ? propertyB.maxValue : undefined;
|
|
628
|
+
if (propertyA.maxValue !== maxValueB) {
|
|
629
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "maxValue", propertyA.maxValue, maxValueB, this._compareDirection));
|
|
630
|
+
}
|
|
631
|
+
const extendedTypeNameB = propertyB.isPrimitive() ? propertyB.extendedTypeName : undefined;
|
|
632
|
+
if (propertyA.extendedTypeName !== extendedTypeNameB) {
|
|
633
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "extendedTypeName", propertyA.extendedTypeName, extendedTypeNameB, this._compareDirection));
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
if (propertyA.isStruct()) {
|
|
637
|
+
const structA = propertyA.structClass;
|
|
638
|
+
const structB = propertyB.isStruct() ? propertyB.structClass : undefined;
|
|
639
|
+
if (structA || structB) {
|
|
640
|
+
const structNameA = structA.fullName;
|
|
641
|
+
const structNameB = structB?.fullName;
|
|
642
|
+
if (structNameA !== structNameB) {
|
|
643
|
+
const areSameByName = this.areItemsSameByName(structA.key, structB?.key, propertyA.schema.name, propertyB.schema.name);
|
|
644
|
+
if (!areSameByName) {
|
|
645
|
+
promises.push(this._reporter.reportPropertyDelta(propertyA, "structClass", structNameA, structNameB, this._compareDirection));
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
await Promise.all(promises);
|
|
651
|
+
}
|
|
652
|
+
async compareEnumerators(enumeratorA, enumeratorB, enumA, enumB) {
|
|
653
|
+
const promises = [];
|
|
654
|
+
if (enumeratorA.description !== enumeratorB.description)
|
|
655
|
+
promises.push(this._reporter.reportEnumeratorDelta(enumA, enumeratorA, "description", enumeratorA.description, enumeratorB.description, this._compareDirection));
|
|
656
|
+
if (!labelsMatch(enumeratorA.label, enumeratorB.label))
|
|
657
|
+
promises.push(this._reporter.reportEnumeratorDelta(enumA, enumeratorA, "label", enumeratorA.label, enumeratorB.label, this._compareDirection));
|
|
658
|
+
// No need to compare values if the type is different (which will be reported separately)
|
|
659
|
+
if (enumA.type === enumB.type && enumeratorA.value !== enumeratorB.value)
|
|
660
|
+
promises.push(this._reporter.reportEnumeratorDelta(enumA, enumeratorA, "value", enumeratorA.value, enumeratorB.value, this._compareDirection));
|
|
661
|
+
await Promise.all(promises);
|
|
662
|
+
}
|
|
663
|
+
async compareFormatUnits(formatA, formatB) {
|
|
664
|
+
if (!formatA.units)
|
|
665
|
+
return;
|
|
666
|
+
const promises = [];
|
|
667
|
+
for (const unitA of formatA.units) {
|
|
668
|
+
const unitB = formatB.units ? formatB.units.find((u) => this.areItemsSameByName(unitA[0], u[0], formatA.schema.name, formatB.schema.name)) : undefined;
|
|
669
|
+
if (!unitB) {
|
|
670
|
+
promises.push(this._reporter.reportFormatUnitMissing(formatA, unitA, this._compareDirection));
|
|
671
|
+
continue;
|
|
672
|
+
}
|
|
673
|
+
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
674
|
+
continue;
|
|
675
|
+
if (unitA[1] !== unitB[1]) {
|
|
676
|
+
const labelA = unitA[1];
|
|
677
|
+
const labelB = unitB[1];
|
|
678
|
+
promises.push(this._reporter.reportUnitLabelOverrideDelta(formatA, unitA[0], labelA, labelB, this._compareDirection));
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
await Promise.all(promises);
|
|
682
|
+
}
|
|
683
|
+
areOverrideFormatsSameByName(itemKeyA, itemKeyB, topLevelSchemaNameA, topLevelSchemaNameB) {
|
|
684
|
+
if (itemKeyA.units) {
|
|
685
|
+
for (const unitA of itemKeyA.units) {
|
|
686
|
+
if (!itemKeyB.units
|
|
687
|
+
|| -1 === itemKeyB.units.findIndex((unitB) => this.areItemsSameByName(unitA[0], unitB[0], topLevelSchemaNameA, topLevelSchemaNameB)
|
|
688
|
+
&& unitA[1] === unitB[1]))
|
|
689
|
+
return false;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
const itemA = OverrideFormat.isOverrideFormat(itemKeyA) ? itemKeyA.parent : itemKeyA;
|
|
693
|
+
const itemB = OverrideFormat.isOverrideFormat(itemKeyB) ? itemKeyB.parent : itemKeyB;
|
|
694
|
+
return itemKeyA.precision === itemKeyB.precision && this.areItemsSameByName(itemA, itemB, topLevelSchemaNameA, topLevelSchemaNameB);
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Compares two item keys.
|
|
698
|
+
* @param itemKeyA item key A to compare to.
|
|
699
|
+
* @param itemKeyB item key B to compare to.
|
|
700
|
+
* @param topLevelSchemaNameA top level schema name in which the item A exists.
|
|
701
|
+
* @param topLevelSchemaNameB top level schema name in which the item B exists.
|
|
702
|
+
* @returns true if both names are the same and they come from their respective top level schema.
|
|
703
|
+
*/
|
|
704
|
+
areItemsSameByName(itemKeyA, itemKeyB, topLevelSchemaNameA, topLevelSchemaNameB) {
|
|
705
|
+
const equalByName = this.areEqualByName(itemKeyA, itemKeyB);
|
|
706
|
+
const schemaNameA = itemKeyA
|
|
707
|
+
? SchemaItem.isSchemaItem(itemKeyA)
|
|
708
|
+
? itemKeyA.schema.name
|
|
709
|
+
: itemKeyA.schemaName
|
|
710
|
+
: undefined;
|
|
711
|
+
const schemaNameB = itemKeyB
|
|
712
|
+
? SchemaItem.isSchemaItem(itemKeyB)
|
|
713
|
+
? itemKeyB.schema.name
|
|
714
|
+
: itemKeyB.schemaName
|
|
715
|
+
: undefined;
|
|
716
|
+
return (equalByName && schemaNameA === topLevelSchemaNameA && schemaNameB === topLevelSchemaNameB) || (equalByName && schemaNameA === schemaNameB);
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Looks for same classA in containerB using key.
|
|
720
|
+
* @param classNameA name of the class to look for in containerB.
|
|
721
|
+
* @param containerA container which classNameA belongs to.
|
|
722
|
+
* @param containerB container in which to look for classNameA.
|
|
723
|
+
* @returns true if a same classA is in containerB, otherwise false.
|
|
724
|
+
*/
|
|
725
|
+
containerHasClass(attributeA, containerA, containerB) {
|
|
726
|
+
if (containerB && containerB.customAttributes) {
|
|
727
|
+
for (const [_className, attributeB] of containerB.customAttributes) {
|
|
728
|
+
const classItemKeyA = containerA.schema.getSchemaItemKey(attributeA.className);
|
|
729
|
+
const classItemKeyB = containerB.schema.getSchemaItemKey(attributeB.className);
|
|
730
|
+
if (this.areItemsSameByName(classItemKeyA, classItemKeyB, containerA.schema.name, containerB.schema.name)) {
|
|
731
|
+
return Object.keys(attributeA).every((propertyName) => {
|
|
732
|
+
const valueA = attributeA[propertyName];
|
|
733
|
+
const valueB = attributeB[propertyName];
|
|
734
|
+
// If propertyName is class name, they don't need to be compared as this has been done
|
|
735
|
+
// in the areItemsSameByName function.
|
|
736
|
+
if (propertyName === "className")
|
|
737
|
+
return true;
|
|
738
|
+
return deepEquals(valueA, valueB);
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
return false;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Compares two values on their deep equality.
|
|
748
|
+
* @param a left side to compare
|
|
749
|
+
* @param b right side to compare
|
|
750
|
+
* @returns true if they are deeply equal, otherwise false.
|
|
751
|
+
*/
|
|
752
|
+
function deepEquals(a, b) {
|
|
753
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
754
|
+
return a.length === b.length && a.every((value, index) => {
|
|
755
|
+
return deepEquals(value, b[index]);
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
if (isObject(a) && isObject(b)) {
|
|
759
|
+
const propertiesA = Object.keys(a);
|
|
760
|
+
const propertiesB = Object.keys(b);
|
|
761
|
+
return propertiesA.length === propertiesB.length && propertiesA.every((propertyName) => {
|
|
762
|
+
return deepEquals(a[propertyName], b[propertyName]);
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
return a === b;
|
|
766
|
+
}
|
|
767
|
+
function isObject(value) {
|
|
768
|
+
return typeof value === "object";
|
|
769
|
+
}
|
|
770
|
+
//# sourceMappingURL=SchemaComparer.js.map
|