@itwin/ecschema-editing 5.0.0-dev.90 → 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/lib/cjs/Validation/DiagnosticReporter.js +1 -1
- package/lib/cjs/Validation/DiagnosticReporter.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 +12 -10
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Differencing
|
|
3
|
+
*/
|
|
4
|
+
import { AnySchemaDifferenceConflict } from "./SchemaConflicts";
|
|
5
|
+
import { AnySchemaEdits } from "../Merging/Edits/SchemaEdits";
|
|
6
|
+
import { AnyEnumerator, AnyPropertyProps, ConstantProps, CustomAttribute, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps, PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, RelationshipConstraintProps, type Schema, SchemaItemFormatProps, SchemaItemProps, SchemaItemType, SchemaItemUnitProps, SchemaReferenceProps, StructClassProps, UnitSystemProps } from "@itwin/ecschema-metadata";
|
|
7
|
+
/** Utility-Type to remove possible readonly flags on the given type. */
|
|
8
|
+
type PartialEditable<T> = {
|
|
9
|
+
-readonly [P in keyof T]?: T[P];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Utility-Type to simplify the expected SchemaItem props by omitting the base properties
|
|
13
|
+
* that are not needed for the schema differencing. Also all properties are made mutable
|
|
14
|
+
* by removing the readonly flag if present.
|
|
15
|
+
*/
|
|
16
|
+
type SchemaItemProperties<T extends SchemaItemProps> = {
|
|
17
|
+
[P in keyof PartialEditable<Omit<T, keyof Omit<SchemaItemProps, "label" | "description" | "customAttributes">>>]: T[P];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Defines the type of the difference operation.
|
|
21
|
+
* @alpha
|
|
22
|
+
*/
|
|
23
|
+
export type DifferenceType = "add" | "modify";
|
|
24
|
+
/**
|
|
25
|
+
* Defines the SchemaTypes that are not SchemaItems.
|
|
26
|
+
* @alpha
|
|
27
|
+
*/
|
|
28
|
+
export declare enum SchemaOtherTypes {
|
|
29
|
+
Schema = "Schema",
|
|
30
|
+
SchemaReference = "SchemaReference",
|
|
31
|
+
Property = "Property",
|
|
32
|
+
Enumerator = "Enumerator",
|
|
33
|
+
CustomAttributeInstance = "CustomAttributeInstance",
|
|
34
|
+
RelationshipConstraint = "RelationshipConstraint",
|
|
35
|
+
RelationshipConstraintClass = "RelationshipConstraintClass",
|
|
36
|
+
EntityClassMixin = "EntityClassMixin",
|
|
37
|
+
KindOfQuantityPresentationFormat = "KindOfQuantityPresentationFormat",
|
|
38
|
+
FormatUnit = "FormatUnit",
|
|
39
|
+
FormatUnitLabel = "FormatUnitLabel"
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Defines the possible values SchemaTypes that can occur in SchemaDifferences or Conflicts.
|
|
43
|
+
* @alpha
|
|
44
|
+
*/
|
|
45
|
+
export type SchemaType = SchemaOtherTypes | SchemaItemType;
|
|
46
|
+
/**
|
|
47
|
+
* Definition of the difference result between two Schemas.
|
|
48
|
+
* @alpha
|
|
49
|
+
*/
|
|
50
|
+
export interface SchemaDifferenceResult {
|
|
51
|
+
/** Full name of the source schema */
|
|
52
|
+
readonly sourceSchemaName: string;
|
|
53
|
+
/** Full name of the target schema */
|
|
54
|
+
readonly targetSchemaName: string;
|
|
55
|
+
/** List of differences between the compared schemas. */
|
|
56
|
+
readonly differences: AnySchemaDifference[];
|
|
57
|
+
/** List of conflicts found while comparing the schemas. */
|
|
58
|
+
readonly conflicts?: AnySchemaDifferenceConflict[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Union of all supported schema differencing types.
|
|
62
|
+
* @alpha
|
|
63
|
+
*/
|
|
64
|
+
export type AnySchemaDifference = SchemaDifference | SchemaReferenceDifference | AnySchemaItemDifference | AnySchemaItemPathDifference | EntityClassMixinDifference | CustomAttributeDifference | KindOfQuantityPresentationFormatDifference | FormatUnitDifference;
|
|
65
|
+
/**
|
|
66
|
+
* Differencing entry for changes on a Schema.
|
|
67
|
+
* @alpha
|
|
68
|
+
*/
|
|
69
|
+
export interface SchemaDifference {
|
|
70
|
+
readonly changeType: "modify";
|
|
71
|
+
readonly schemaType: SchemaOtherTypes.Schema;
|
|
72
|
+
readonly difference: {
|
|
73
|
+
label?: string;
|
|
74
|
+
description?: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Differencing entry for added or changed Schema References of a Schema.
|
|
79
|
+
* @alpha
|
|
80
|
+
*/
|
|
81
|
+
export interface SchemaReferenceDifference {
|
|
82
|
+
readonly changeType: "add" | "modify";
|
|
83
|
+
readonly schemaType: SchemaOtherTypes.SchemaReference;
|
|
84
|
+
readonly difference: SchemaReferenceProps;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Union of all supported schema item differencing types.
|
|
88
|
+
* @alpha
|
|
89
|
+
*/
|
|
90
|
+
export type AnySchemaItemDifference = AnyClassItemDifference | ConstantDifference | EnumerationDifference | FormatDifference | KindOfQuantityDifference | InvertedUnitDifference | PhenomenonDifference | PropertyCategoryDifference | UnitDifference | UnitSystemDifference;
|
|
91
|
+
/**
|
|
92
|
+
* Union for supported class Schema Items.
|
|
93
|
+
* @alpha
|
|
94
|
+
*/
|
|
95
|
+
export type AnyClassItemDifference = EntityClassDifference | MixinClassDifference | StructClassDifference | CustomAttributeClassDifference | RelationshipClassDifference;
|
|
96
|
+
/**
|
|
97
|
+
* Union of all differences that have a path pointing inside a schema item.
|
|
98
|
+
* @alpha
|
|
99
|
+
*/
|
|
100
|
+
export type AnySchemaItemPathDifference = RelationshipConstraintDifference | RelationshipConstraintClassDifference | CustomAttributePropertyDifference | EnumeratorDifference | ClassPropertyDifference | FormatUnitLabelDifference;
|
|
101
|
+
/**
|
|
102
|
+
* Internal base class for all Schema Item differencing entries.
|
|
103
|
+
* @alpha
|
|
104
|
+
*/
|
|
105
|
+
interface SchemaItemDifference<T extends SchemaItemProps> {
|
|
106
|
+
readonly changeType: "add" | "modify";
|
|
107
|
+
readonly itemName: string;
|
|
108
|
+
readonly difference: SchemaItemProperties<T>;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Differencing entry for Constant Schema Items.
|
|
112
|
+
* @alpha
|
|
113
|
+
*/
|
|
114
|
+
export interface ConstantDifference extends SchemaItemDifference<ConstantProps> {
|
|
115
|
+
readonly schemaType: SchemaItemType.Constant;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Differencing entry for Custom Attribute Class Schema Items.
|
|
119
|
+
* @alpha
|
|
120
|
+
*/
|
|
121
|
+
export interface CustomAttributeClassDifference extends SchemaItemDifference<CustomAttributeClassProps> {
|
|
122
|
+
readonly schemaType: SchemaItemType.CustomAttributeClass;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Differencing entry for Entity Class Schema Items.
|
|
126
|
+
* @alpha
|
|
127
|
+
*/
|
|
128
|
+
export interface EntityClassDifference extends SchemaItemDifference<EntityClassProps> {
|
|
129
|
+
readonly schemaType: SchemaItemType.EntityClass;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Differencing entry for Enumerator Schema Items.
|
|
133
|
+
* @alpha
|
|
134
|
+
*/
|
|
135
|
+
export interface EnumerationDifference extends SchemaItemDifference<EnumerationProps> {
|
|
136
|
+
readonly schemaType: SchemaItemType.Enumeration;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Differencing entry for Kind-Of-Quantities Schema Items.
|
|
140
|
+
* @alpha
|
|
141
|
+
*/
|
|
142
|
+
export interface KindOfQuantityDifference extends SchemaItemDifference<KindOfQuantityProps> {
|
|
143
|
+
readonly schemaType: SchemaItemType.KindOfQuantity;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Differencing entry for Mixin Class Schema Items.
|
|
147
|
+
* @alpha
|
|
148
|
+
*/
|
|
149
|
+
export interface MixinClassDifference extends SchemaItemDifference<MixinProps> {
|
|
150
|
+
readonly schemaType: SchemaItemType.Mixin;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Differencing entry for Phenomenon Schema Items.
|
|
154
|
+
* @alpha
|
|
155
|
+
*/
|
|
156
|
+
export interface PhenomenonDifference extends SchemaItemDifference<PhenomenonProps> {
|
|
157
|
+
readonly schemaType: SchemaItemType.Phenomenon;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Differencing entry for Property Category Schema Items.
|
|
161
|
+
* @alpha
|
|
162
|
+
*/
|
|
163
|
+
export interface PropertyCategoryDifference extends SchemaItemDifference<PropertyCategoryProps> {
|
|
164
|
+
readonly schemaType: SchemaItemType.PropertyCategory;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Differencing entry for Relationship Class Schema Items.
|
|
168
|
+
* @alpha
|
|
169
|
+
*/
|
|
170
|
+
export interface RelationshipClassDifference extends SchemaItemDifference<RelationshipClassProps> {
|
|
171
|
+
readonly schemaType: SchemaItemType.RelationshipClass;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Differencing entry for Struct Class Schema Items.
|
|
175
|
+
* @alpha
|
|
176
|
+
*/
|
|
177
|
+
export interface StructClassDifference extends SchemaItemDifference<StructClassProps> {
|
|
178
|
+
readonly schemaType: SchemaItemType.StructClass;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Differencing entry for Unit System Schema Items.
|
|
182
|
+
* @alpha
|
|
183
|
+
*/
|
|
184
|
+
export interface UnitSystemDifference extends SchemaItemDifference<UnitSystemProps> {
|
|
185
|
+
readonly schemaType: SchemaItemType.UnitSystem;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Differencing entry for Unit Schema Items.
|
|
189
|
+
* @alpha
|
|
190
|
+
*/
|
|
191
|
+
export interface UnitDifference extends SchemaItemDifference<SchemaItemUnitProps> {
|
|
192
|
+
readonly schemaType: SchemaItemType.Unit;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Differencing entry for Inverted Unit Schema Items.
|
|
196
|
+
* @alpha
|
|
197
|
+
*/
|
|
198
|
+
export interface InvertedUnitDifference extends SchemaItemDifference<InvertedUnitProps> {
|
|
199
|
+
readonly schemaType: SchemaItemType.InvertedUnit;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Differencing entry for Format Schema Items.
|
|
203
|
+
* @alpha
|
|
204
|
+
*/
|
|
205
|
+
export interface FormatDifference extends SchemaItemDifference<SchemaItemFormatProps> {
|
|
206
|
+
readonly schemaType: SchemaItemType.Format;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Differencing entry for added or changed Properties.
|
|
210
|
+
* @alpha
|
|
211
|
+
*/
|
|
212
|
+
export interface ClassPropertyDifference {
|
|
213
|
+
readonly changeType: "add" | "modify";
|
|
214
|
+
readonly schemaType: SchemaOtherTypes.Property;
|
|
215
|
+
readonly itemName: string;
|
|
216
|
+
readonly path: string;
|
|
217
|
+
readonly difference: PartialEditable<AnyPropertyProps>;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Union of supported Custom Attribute Differences.
|
|
221
|
+
* @alpha
|
|
222
|
+
*/
|
|
223
|
+
export type CustomAttributeDifference = CustomAttributeSchemaDifference | CustomAttributeSchemaItemDifference | CustomAttributePropertyDifference | CustomAttributeRelationshipConstraintDifference;
|
|
224
|
+
/**
|
|
225
|
+
* Differencing entry for Custom Attributes on Schema.
|
|
226
|
+
* @alpha
|
|
227
|
+
*/
|
|
228
|
+
export interface CustomAttributeSchemaDifference {
|
|
229
|
+
readonly changeType: "add";
|
|
230
|
+
readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;
|
|
231
|
+
readonly appliedTo: "Schema";
|
|
232
|
+
readonly difference: PartialEditable<CustomAttribute>;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Differencing entry for Custom Attributes on Schema Items.
|
|
236
|
+
* @alpha
|
|
237
|
+
*/
|
|
238
|
+
export interface CustomAttributeSchemaItemDifference {
|
|
239
|
+
readonly changeType: "add";
|
|
240
|
+
readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;
|
|
241
|
+
readonly appliedTo: "SchemaItem";
|
|
242
|
+
readonly itemName: string;
|
|
243
|
+
readonly difference: PartialEditable<CustomAttribute>;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Differencing entry for Custom Attributes on Properties.
|
|
247
|
+
* @alpha
|
|
248
|
+
*/
|
|
249
|
+
export interface CustomAttributePropertyDifference {
|
|
250
|
+
readonly changeType: "add";
|
|
251
|
+
readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;
|
|
252
|
+
readonly appliedTo: "Property";
|
|
253
|
+
readonly itemName: string;
|
|
254
|
+
readonly path: string;
|
|
255
|
+
readonly difference: PartialEditable<CustomAttribute>;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Differencing entry for Custom Attributes on Relationship Constraints.
|
|
259
|
+
* @alpha
|
|
260
|
+
*/
|
|
261
|
+
export interface CustomAttributeRelationshipConstraintDifference {
|
|
262
|
+
readonly changeType: "add";
|
|
263
|
+
readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;
|
|
264
|
+
readonly appliedTo: "RelationshipConstraint";
|
|
265
|
+
readonly itemName: string;
|
|
266
|
+
readonly path: "$source" | "$target";
|
|
267
|
+
readonly difference: PartialEditable<CustomAttribute>;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Differencing entry for changed mixins on EntityClasses.
|
|
271
|
+
* @alpha
|
|
272
|
+
*/
|
|
273
|
+
export interface EntityClassMixinDifference {
|
|
274
|
+
readonly changeType: "add";
|
|
275
|
+
readonly schemaType: SchemaOtherTypes.EntityClassMixin;
|
|
276
|
+
readonly itemName: string;
|
|
277
|
+
readonly difference: string[];
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Differencing entry for changed Enumerators on Enumerable Schema Items.
|
|
281
|
+
* @alpha
|
|
282
|
+
*/
|
|
283
|
+
export interface EnumeratorDifference {
|
|
284
|
+
readonly changeType: "add" | "modify";
|
|
285
|
+
readonly schemaType: SchemaOtherTypes.Enumerator;
|
|
286
|
+
readonly itemName: string;
|
|
287
|
+
readonly path: string;
|
|
288
|
+
readonly difference: PartialEditable<AnyEnumerator>;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Differencing entry for Relationship Constraints.
|
|
292
|
+
* @alpha
|
|
293
|
+
*/
|
|
294
|
+
export interface RelationshipConstraintDifference {
|
|
295
|
+
readonly changeType: "modify";
|
|
296
|
+
readonly schemaType: SchemaOtherTypes.RelationshipConstraint;
|
|
297
|
+
readonly itemName: string;
|
|
298
|
+
readonly path: "$source" | "$target";
|
|
299
|
+
readonly difference: PartialEditable<Omit<RelationshipConstraintProps, "constraintClasses">>;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Differencing entry for constraint classes added to Relationship Constrains.
|
|
303
|
+
* @alpha
|
|
304
|
+
*/
|
|
305
|
+
export interface RelationshipConstraintClassDifference {
|
|
306
|
+
readonly changeType: "add";
|
|
307
|
+
readonly schemaType: SchemaOtherTypes.RelationshipConstraintClass;
|
|
308
|
+
readonly itemName: string;
|
|
309
|
+
readonly path: "$source" | "$target";
|
|
310
|
+
readonly difference: string[];
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Differencing entry for presentation formats added to KindOfQuantities.
|
|
314
|
+
* @alpha
|
|
315
|
+
*/
|
|
316
|
+
export interface KindOfQuantityPresentationFormatDifference {
|
|
317
|
+
readonly changeType: "add";
|
|
318
|
+
readonly schemaType: SchemaOtherTypes.KindOfQuantityPresentationFormat;
|
|
319
|
+
readonly itemName: string;
|
|
320
|
+
readonly difference: string[];
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Differencing entry for changed Units on Formats.
|
|
324
|
+
* @alpha
|
|
325
|
+
*/
|
|
326
|
+
export interface FormatUnitDifference {
|
|
327
|
+
readonly changeType: "modify";
|
|
328
|
+
readonly schemaType: SchemaOtherTypes.FormatUnit;
|
|
329
|
+
readonly itemName: string;
|
|
330
|
+
readonly difference: {
|
|
331
|
+
name: string;
|
|
332
|
+
label?: string;
|
|
333
|
+
}[];
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Differencing entry for changed labels on Format Units.
|
|
337
|
+
* @alpha
|
|
338
|
+
*/
|
|
339
|
+
export interface FormatUnitLabelDifference {
|
|
340
|
+
readonly changeType: "modify";
|
|
341
|
+
readonly schemaType: SchemaOtherTypes.FormatUnitLabel;
|
|
342
|
+
readonly itemName: string;
|
|
343
|
+
readonly path: string;
|
|
344
|
+
readonly difference: {
|
|
345
|
+
label?: string;
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Creates a [[SchemaDifferenceResult]] for two given schemas.
|
|
350
|
+
* @param targetSchema The schema the differences gets merged into.
|
|
351
|
+
* @param sourceSchema The schema to get merged in the target.
|
|
352
|
+
* @returns An [[SchemaDifferenceResult]] object.
|
|
353
|
+
* @alpha
|
|
354
|
+
*/
|
|
355
|
+
export declare function getSchemaDifferences(targetSchema: Schema, sourceSchema: Schema, schemaEdits?: Iterable<AnySchemaEdits>): Promise<SchemaDifferenceResult>;
|
|
356
|
+
export {};
|
|
357
|
+
//# sourceMappingURL=SchemaDifference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaDifference.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifference.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAkB,MAAM,8BAA8B,CAAC;AAI9E,OAAO,EAAE,aAAa,EAAe,gBAAgB,EAAE,aAAa,EAAE,eAAe,EACnF,yBAAyB,EAAW,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAC9G,UAAU,EAAE,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,2BAA2B,EACvG,KAAK,MAAM,EAAc,qBAAqB,EAAiB,eAAe,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAC7K,MAAM,0BAA0B,CAAC;AAKlC,wEAAwE;AACxE,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAChC,CAAC;AAEF;;;;GAIG;AACH,KAAK,oBAAoB,CAAC,CAAC,SAAS,eAAe,IAAI;KACpD,CAAC,IAAI,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,aAAa,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACvH,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM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ACxC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,eAAe,CAAC;IACtD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAmC9J"}
|
|
@@ -0,0 +1,106 @@
|
|
|
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 Differencing
|
|
7
|
+
*/
|
|
8
|
+
import { SchemaEditType } from "../Merging/Edits/SchemaEdits";
|
|
9
|
+
import { SchemaDiagnosticVisitor } from "./SchemaDiagnosticVisitor";
|
|
10
|
+
import { SchemaComparer } from "../Validation/SchemaComparer";
|
|
11
|
+
import { SchemaItem, } from "@itwin/ecschema-metadata";
|
|
12
|
+
import { validateDifferences } from "./SchemaDifferenceValidator";
|
|
13
|
+
import { NameMapping, PropertyKey } from "../Merging/Edits/NameMapping";
|
|
14
|
+
/**
|
|
15
|
+
* Defines the SchemaTypes that are not SchemaItems.
|
|
16
|
+
* @alpha
|
|
17
|
+
*/
|
|
18
|
+
export var SchemaOtherTypes;
|
|
19
|
+
(function (SchemaOtherTypes) {
|
|
20
|
+
SchemaOtherTypes["Schema"] = "Schema";
|
|
21
|
+
SchemaOtherTypes["SchemaReference"] = "SchemaReference";
|
|
22
|
+
SchemaOtherTypes["Property"] = "Property";
|
|
23
|
+
SchemaOtherTypes["Enumerator"] = "Enumerator";
|
|
24
|
+
SchemaOtherTypes["CustomAttributeInstance"] = "CustomAttributeInstance";
|
|
25
|
+
SchemaOtherTypes["RelationshipConstraint"] = "RelationshipConstraint";
|
|
26
|
+
SchemaOtherTypes["RelationshipConstraintClass"] = "RelationshipConstraintClass";
|
|
27
|
+
SchemaOtherTypes["EntityClassMixin"] = "EntityClassMixin";
|
|
28
|
+
SchemaOtherTypes["KindOfQuantityPresentationFormat"] = "KindOfQuantityPresentationFormat";
|
|
29
|
+
SchemaOtherTypes["FormatUnit"] = "FormatUnit";
|
|
30
|
+
SchemaOtherTypes["FormatUnitLabel"] = "FormatUnitLabel";
|
|
31
|
+
})(SchemaOtherTypes || (SchemaOtherTypes = {}));
|
|
32
|
+
/**
|
|
33
|
+
* Creates a [[SchemaDifferenceResult]] for two given schemas.
|
|
34
|
+
* @param targetSchema The schema the differences gets merged into.
|
|
35
|
+
* @param sourceSchema The schema to get merged in the target.
|
|
36
|
+
* @returns An [[SchemaDifferenceResult]] object.
|
|
37
|
+
* @alpha
|
|
38
|
+
*/
|
|
39
|
+
export async function getSchemaDifferences(targetSchema, sourceSchema, schemaEdits) {
|
|
40
|
+
const schemaComparer = new DifferenceSchemaComparer();
|
|
41
|
+
if (schemaEdits) {
|
|
42
|
+
for (const edit of schemaEdits) {
|
|
43
|
+
if (edit.type === SchemaEditType.RenameSchemaItem) {
|
|
44
|
+
schemaComparer.nameMappings.addItemMapping(edit.key, edit.value);
|
|
45
|
+
}
|
|
46
|
+
if (edit.type === SchemaEditType.RenameProperty) {
|
|
47
|
+
schemaComparer.nameMappings.addPropertyMapping(edit.key, edit.value);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
await schemaComparer.compareSchemas(sourceSchema, targetSchema);
|
|
52
|
+
const visitor = new SchemaDiagnosticVisitor();
|
|
53
|
+
for (const diagnostic of schemaComparer.diagnostics) {
|
|
54
|
+
visitor.visit(diagnostic);
|
|
55
|
+
}
|
|
56
|
+
const differences = [
|
|
57
|
+
...visitor.schemaDifferences,
|
|
58
|
+
...visitor.schemaItemDifferences,
|
|
59
|
+
...visitor.schemaItemPathDifferences,
|
|
60
|
+
...visitor.customAttributeDifferences,
|
|
61
|
+
];
|
|
62
|
+
const conflicts = await validateDifferences(differences, targetSchema, sourceSchema, schemaComparer.nameMappings);
|
|
63
|
+
return {
|
|
64
|
+
sourceSchemaName: sourceSchema.schemaKey.toString(),
|
|
65
|
+
targetSchemaName: targetSchema.schemaKey.toString(),
|
|
66
|
+
conflicts: conflicts.length > 0 ? conflicts : undefined,
|
|
67
|
+
differences,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Implementation of a SchemaComparer that is used in the schema differencing process.
|
|
72
|
+
* It extends the SchemaComparer base class with additional functionality to store the
|
|
73
|
+
* name mappings of renamed schema items and properties.
|
|
74
|
+
*
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
class DifferenceSchemaComparer extends SchemaComparer {
|
|
78
|
+
nameMappings;
|
|
79
|
+
_changes;
|
|
80
|
+
get diagnostics() {
|
|
81
|
+
return this._changes[0].allDiagnostics;
|
|
82
|
+
}
|
|
83
|
+
constructor() {
|
|
84
|
+
super({ report: (changes) => this._changes.push(changes) });
|
|
85
|
+
this._changes = [];
|
|
86
|
+
this.nameMappings = new NameMapping();
|
|
87
|
+
}
|
|
88
|
+
async resolveItem(item, lookupSchema, itemConstructor) {
|
|
89
|
+
const classKey = this.nameMappings.resolveItemKey(item.key);
|
|
90
|
+
return lookupSchema.lookupItem(classKey.name, itemConstructor);
|
|
91
|
+
}
|
|
92
|
+
async resolveProperty(propertyA, ecClass) {
|
|
93
|
+
const propertyKey = this.nameMappings.resolvePropertyKey(new PropertyKey(propertyA.name, propertyA.class.key));
|
|
94
|
+
return ecClass.getProperty(propertyKey.propertyName);
|
|
95
|
+
}
|
|
96
|
+
areEqualByName(itemKeyA, itemKeyB) {
|
|
97
|
+
if (itemKeyA) {
|
|
98
|
+
if (SchemaItem.isSchemaItem(itemKeyA)) {
|
|
99
|
+
itemKeyA = itemKeyA.key;
|
|
100
|
+
}
|
|
101
|
+
itemKeyA = this.nameMappings.resolveItemKey(itemKeyA);
|
|
102
|
+
}
|
|
103
|
+
return super.areEqualByName(itemKeyA, itemKeyB);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=SchemaDifference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaDifference.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifference.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAkB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAGQ,UAAU,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAsBxE;;;GAGG;AACH,MAAM,CAAN,IAAY,gBAYX;AAZD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,uDAAmC,CAAA;IACnC,yCAAqB,CAAA;IACrB,6CAAyB,CAAA;IACzB,uEAAmD,CAAA;IACnD,qEAAiD,CAAA;IACjD,+EAA2D,CAAA;IAC3D,yDAAqC,CAAA;IACrC,yFAAqE,CAAA;IACrE,6CAAyB,CAAA;IACzB,uDAAmC,CAAA;AACrC,CAAC,EAZW,gBAAgB,KAAhB,gBAAgB,QAY3B;AA2XD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,YAAoB,EAAE,Y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;YACD,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Differencing\n */\n\nimport { AnySchemaDifferenceConflict } from \"./SchemaConflicts\";\nimport { AnySchemaEdits, SchemaEditType } from \"../Merging/Edits/SchemaEdits\";\nimport { SchemaDiagnosticVisitor } from \"./SchemaDiagnosticVisitor\";\nimport { SchemaChanges } from \"../Validation/SchemaChanges\";\nimport { SchemaComparer } from \"../Validation/SchemaComparer\";\nimport { AnyEnumerator, AnyProperty, AnyPropertyProps, ConstantProps, CustomAttribute,\n CustomAttributeClassProps, ECClass, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps,\n MixinProps, PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, RelationshipConstraintProps,\n type Schema, SchemaItem, SchemaItemFormatProps, SchemaItemKey, SchemaItemProps, SchemaItemType, SchemaItemUnitProps, SchemaReferenceProps, StructClassProps, UnitSystemProps,\n} from \"@itwin/ecschema-metadata\";\nimport { validateDifferences } from \"./SchemaDifferenceValidator\";\nimport { AnyDiagnostic } from \"../Validation/Diagnostic\";\nimport { NameMapping, PropertyKey } from \"../Merging/Edits/NameMapping\";\n\n/** Utility-Type to remove possible readonly flags on the given type. */\ntype PartialEditable<T> = {\n -readonly [P in keyof T]?: T[P];\n};\n\n/**\n * Utility-Type to simplify the expected SchemaItem props by omitting the base properties\n * that are not needed for the schema differencing. Also all properties are made mutable\n * by removing the readonly flag if present.\n */\ntype SchemaItemProperties<T extends SchemaItemProps> = {\n [P in keyof PartialEditable<Omit<T, keyof Omit<SchemaItemProps, \"label\" | \"description\" | \"customAttributes\">>>]: T[P]\n};\n\n/**\n * Defines the type of the difference operation.\n * @alpha\n */\nexport type DifferenceType = \"add\" | \"modify\";\n\n/**\n * Defines the SchemaTypes that are not SchemaItems.\n * @alpha\n */\nexport enum SchemaOtherTypes {\n Schema = \"Schema\",\n SchemaReference = \"SchemaReference\",\n Property = \"Property\",\n Enumerator = \"Enumerator\",\n CustomAttributeInstance = \"CustomAttributeInstance\",\n RelationshipConstraint = \"RelationshipConstraint\",\n RelationshipConstraintClass = \"RelationshipConstraintClass\",\n EntityClassMixin = \"EntityClassMixin\",\n KindOfQuantityPresentationFormat = \"KindOfQuantityPresentationFormat\",\n FormatUnit = \"FormatUnit\",\n FormatUnitLabel = \"FormatUnitLabel\",\n}\n\n/**\n * Defines the possible values SchemaTypes that can occur in SchemaDifferences or Conflicts.\n * @alpha\n */\nexport type SchemaType = SchemaOtherTypes | SchemaItemType;\n\n/**\n * Definition of the difference result between two Schemas.\n * @alpha\n */\nexport interface SchemaDifferenceResult {\n /** Full name of the source schema */\n readonly sourceSchemaName: string;\n /** Full name of the target schema */\n readonly targetSchemaName: string;\n\n /** List of differences between the compared schemas. */\n readonly differences: AnySchemaDifference[];\n\n /** List of conflicts found while comparing the schemas. */\n readonly conflicts?: AnySchemaDifferenceConflict[];\n}\n\n/**\n * Union of all supported schema differencing types.\n * @alpha\n */\nexport type AnySchemaDifference =\n SchemaDifference |\n SchemaReferenceDifference |\n AnySchemaItemDifference |\n AnySchemaItemPathDifference |\n EntityClassMixinDifference |\n CustomAttributeDifference |\n KindOfQuantityPresentationFormatDifference |\n FormatUnitDifference;\n\n/**\n * Differencing entry for changes on a Schema.\n * @alpha\n */\nexport interface SchemaDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.Schema;\n readonly difference: {\n label?: string;\n description?: string;\n };\n}\n\n/**\n * Differencing entry for added or changed Schema References of a Schema.\n * @alpha\n */\nexport interface SchemaReferenceDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.SchemaReference;\n readonly difference: SchemaReferenceProps;\n}\n\n/**\n * Union of all supported schema item differencing types.\n * @alpha\n */\nexport type AnySchemaItemDifference =\n AnyClassItemDifference |\n ConstantDifference |\n EnumerationDifference |\n FormatDifference |\n KindOfQuantityDifference |\n InvertedUnitDifference |\n PhenomenonDifference |\n PropertyCategoryDifference |\n UnitDifference |\n UnitSystemDifference;\n\n/**\n * Union for supported class Schema Items.\n * @alpha\n */\nexport type AnyClassItemDifference =\n EntityClassDifference |\n MixinClassDifference |\n StructClassDifference |\n CustomAttributeClassDifference |\n RelationshipClassDifference;\n\n/**\n * Union of all differences that have a path pointing inside a schema item.\n * @alpha\n */\nexport type AnySchemaItemPathDifference =\n RelationshipConstraintDifference |\n RelationshipConstraintClassDifference |\n CustomAttributePropertyDifference |\n EnumeratorDifference |\n ClassPropertyDifference |\n FormatUnitLabelDifference;\n\n/**\n * Internal base class for all Schema Item differencing entries.\n * @alpha\n */\ninterface SchemaItemDifference<T extends SchemaItemProps> {\n readonly changeType: \"add\" | \"modify\";\n readonly itemName: string;\n readonly difference: SchemaItemProperties<T>;\n}\n\n/**\n * Differencing entry for Constant Schema Items.\n * @alpha\n */\nexport interface ConstantDifference extends SchemaItemDifference<ConstantProps> {\n readonly schemaType: SchemaItemType.Constant;\n}\n\n/**\n * Differencing entry for Custom Attribute Class Schema Items.\n * @alpha\n */\nexport interface CustomAttributeClassDifference extends SchemaItemDifference<CustomAttributeClassProps> {\n readonly schemaType: SchemaItemType.CustomAttributeClass;\n}\n\n/**\n * Differencing entry for Entity Class Schema Items.\n * @alpha\n */\nexport interface EntityClassDifference extends SchemaItemDifference<EntityClassProps> {\n readonly schemaType: SchemaItemType.EntityClass;\n}\n\n/**\n * Differencing entry for Enumerator Schema Items.\n * @alpha\n */\nexport interface EnumerationDifference extends SchemaItemDifference<EnumerationProps> {\n readonly schemaType: SchemaItemType.Enumeration;\n}\n\n/**\n * Differencing entry for Kind-Of-Quantities Schema Items.\n * @alpha\n */\nexport interface KindOfQuantityDifference extends SchemaItemDifference<KindOfQuantityProps> {\n readonly schemaType: SchemaItemType.KindOfQuantity;\n}\n\n/**\n * Differencing entry for Mixin Class Schema Items.\n * @alpha\n */\nexport interface MixinClassDifference extends SchemaItemDifference<MixinProps> {\n readonly schemaType: SchemaItemType.Mixin;\n}\n\n/**\n * Differencing entry for Phenomenon Schema Items.\n * @alpha\n */\nexport interface PhenomenonDifference extends SchemaItemDifference<PhenomenonProps> {\n readonly schemaType: SchemaItemType.Phenomenon;\n}\n\n/**\n * Differencing entry for Property Category Schema Items.\n * @alpha\n */\nexport interface PropertyCategoryDifference extends SchemaItemDifference<PropertyCategoryProps> {\n readonly schemaType: SchemaItemType.PropertyCategory;\n}\n\n/**\n * Differencing entry for Relationship Class Schema Items.\n * @alpha\n */\nexport interface RelationshipClassDifference extends SchemaItemDifference<RelationshipClassProps> {\n readonly schemaType: SchemaItemType.RelationshipClass;\n}\n\n/**\n * Differencing entry for Struct Class Schema Items.\n * @alpha\n */\nexport interface StructClassDifference extends SchemaItemDifference<StructClassProps> {\n readonly schemaType: SchemaItemType.StructClass;\n}\n\n/**\n * Differencing entry for Unit System Schema Items.\n * @alpha\n */\nexport interface UnitSystemDifference extends SchemaItemDifference<UnitSystemProps> {\n readonly schemaType: SchemaItemType.UnitSystem;\n}\n\n/**\n * Differencing entry for Unit Schema Items.\n * @alpha\n */\nexport interface UnitDifference extends SchemaItemDifference<SchemaItemUnitProps> {\n readonly schemaType: SchemaItemType.Unit;\n}\n\n/**\n * Differencing entry for Inverted Unit Schema Items.\n * @alpha\n */\nexport interface InvertedUnitDifference extends SchemaItemDifference<InvertedUnitProps> {\n readonly schemaType: SchemaItemType.InvertedUnit;\n}\n/**\n * Differencing entry for Format Schema Items.\n * @alpha\n */\nexport interface FormatDifference extends SchemaItemDifference<SchemaItemFormatProps> {\n readonly schemaType: SchemaItemType.Format;\n}\n\n/**\n * Differencing entry for added or changed Properties.\n * @alpha\n */\nexport interface ClassPropertyDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.Property;\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<AnyPropertyProps>;\n}\n\n/**\n * Union of supported Custom Attribute Differences.\n * @alpha\n */\nexport type CustomAttributeDifference =\n CustomAttributeSchemaDifference |\n CustomAttributeSchemaItemDifference |\n CustomAttributePropertyDifference |\n CustomAttributeRelationshipConstraintDifference;\n\n/**\n * Differencing entry for Custom Attributes on Schema.\n * @alpha\n */\nexport interface CustomAttributeSchemaDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"Schema\";\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Schema Items.\n * @alpha\n */\nexport interface CustomAttributeSchemaItemDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"SchemaItem\";\n readonly itemName: string;\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Properties.\n * @alpha\n */\nexport interface CustomAttributePropertyDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"Property\";\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Relationship Constraints.\n * @alpha\n */\nexport interface CustomAttributeRelationshipConstraintDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"RelationshipConstraint\";\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for changed mixins on EntityClasses.\n * @alpha\n */\nexport interface EntityClassMixinDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.EntityClassMixin;\n readonly itemName: string;\n readonly difference: string[];\n}\n\n/**\n * Differencing entry for changed Enumerators on Enumerable Schema Items.\n * @alpha\n */\nexport interface EnumeratorDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.Enumerator;\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<AnyEnumerator>;\n}\n\n/**\n * Differencing entry for Relationship Constraints.\n * @alpha\n */\nexport interface RelationshipConstraintDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.RelationshipConstraint;\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: PartialEditable<Omit<RelationshipConstraintProps, \"constraintClasses\">>;\n}\n\n/**\n * Differencing entry for constraint classes added to Relationship Constrains.\n * @alpha\n */\nexport interface RelationshipConstraintClassDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.RelationshipConstraintClass;\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: string[];\n}\n\n/**\n * Differencing entry for presentation formats added to KindOfQuantities.\n * @alpha\n */\nexport interface KindOfQuantityPresentationFormatDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.KindOfQuantityPresentationFormat;\n readonly itemName: string;\n readonly difference: string[];\n}\n\n/**\n * Differencing entry for changed Units on Formats.\n * @alpha\n */\nexport interface FormatUnitDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.FormatUnit;\n readonly itemName: string;\n readonly difference: {\n name: string;\n label?: string;\n }[];\n}\n\n/**\n * Differencing entry for changed labels on Format Units.\n * @alpha\n */\nexport interface FormatUnitLabelDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.FormatUnitLabel;\n readonly itemName: string;\n readonly path: string;\n readonly difference: {\n label?: string;\n };\n}\n\n/**\n * Creates a [[SchemaDifferenceResult]] for two given schemas.\n * @param targetSchema The schema the differences gets merged into.\n * @param sourceSchema The schema to get merged in the target.\n * @returns An [[SchemaDifferenceResult]] object.\n * @alpha\n */\nexport async function getSchemaDifferences(targetSchema: Schema, sourceSchema: Schema, schemaEdits?: Iterable<AnySchemaEdits>): Promise<SchemaDifferenceResult> {\n const schemaComparer = new DifferenceSchemaComparer();\n if(schemaEdits) {\n for(const edit of schemaEdits) {\n if(edit.type === SchemaEditType.RenameSchemaItem) {\n schemaComparer.nameMappings.addItemMapping(edit.key, edit.value);\n }\n if(edit.type === SchemaEditType.RenameProperty) {\n schemaComparer.nameMappings.addPropertyMapping(edit.key, edit.value);\n }\n }\n }\n\n await schemaComparer.compareSchemas(sourceSchema, targetSchema);\n\n const visitor = new SchemaDiagnosticVisitor();\n for (const diagnostic of schemaComparer.diagnostics) {\n visitor.visit(diagnostic);\n }\n\n const differences: AnySchemaDifference[] = [\n ...visitor.schemaDifferences,\n ...visitor.schemaItemDifferences,\n ...visitor.schemaItemPathDifferences,\n ...visitor.customAttributeDifferences,\n ];\n\n const conflicts = await validateDifferences(differences, targetSchema, sourceSchema, schemaComparer.nameMappings);\n\n return {\n sourceSchemaName: sourceSchema.schemaKey.toString(),\n targetSchemaName: targetSchema.schemaKey.toString(),\n conflicts: conflicts.length > 0 ? conflicts : undefined,\n differences,\n };\n}\n\n/**\n * Implementation of a SchemaComparer that is used in the schema differencing process.\n * It extends the SchemaComparer base class with additional functionality to store the\n * name mappings of renamed schema items and properties.\n *\n * @internal\n */\nclass DifferenceSchemaComparer extends SchemaComparer {\n public readonly nameMappings: NameMapping;\n private readonly _changes: Array<SchemaChanges>;\n\n public get diagnostics(): Iterable<AnyDiagnostic> {\n return this._changes[0].allDiagnostics;\n }\n\n constructor() {\n super({ report: (changes) => this._changes.push(changes as SchemaChanges) });\n\n this._changes = [];\n this.nameMappings = new NameMapping();\n }\n\n public override async resolveItem<TItem extends typeof SchemaItem>(item: SchemaItem, lookupSchema: Schema, itemConstructor: TItem): Promise<InstanceType<TItem> | undefined> {\n const classKey = this.nameMappings.resolveItemKey(item.key);\n return lookupSchema.lookupItem(classKey.name, itemConstructor);\n }\n\n public override async resolveProperty(propertyA: AnyProperty, ecClass: ECClass): Promise<AnyProperty | undefined> {\n const propertyKey = this.nameMappings.resolvePropertyKey(new PropertyKey(propertyA.name, propertyA.class.key));\n return ecClass.getProperty(propertyKey.propertyName) as Promise<AnyProperty | undefined>;\n }\n\n public override areEqualByName(itemKeyA?: Readonly<SchemaItemKey> | SchemaItem, itemKeyB?: Readonly<SchemaItemKey> | SchemaItem): boolean {\n if (itemKeyA) {\n if (SchemaItem.isSchemaItem(itemKeyA)) {\n itemKeyA = itemKeyA.key;\n }\n itemKeyA = this.nameMappings.resolveItemKey(itemKeyA);\n }\n return super.areEqualByName(itemKeyA, itemKeyB);\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Differencing
|
|
3
|
+
*/
|
|
4
|
+
import { Schema } from "@itwin/ecschema-metadata";
|
|
5
|
+
import { AnySchemaDifference } from "./SchemaDifference";
|
|
6
|
+
import { AnySchemaDifferenceConflict } from "./SchemaConflicts";
|
|
7
|
+
import { NameMapping } from "../Merging/Edits/NameMapping";
|
|
8
|
+
/**
|
|
9
|
+
* Validates the given array of schema differences and returns a list of conflicts if the
|
|
10
|
+
* validation finds violation against rules.
|
|
11
|
+
* @param differences An array of schema differences.
|
|
12
|
+
* @param targetSchema The target schema reference.
|
|
13
|
+
* @param sourceSchema The source schema reference.
|
|
14
|
+
* @returns An array of conflicts found when validating the difference.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare function validateDifferences(differences: AnySchemaDifference[], targetSchema: Schema, sourceSchema: Schema, nameMappings: NameMapping): Promise<AnySchemaDifferenceConflict[]>;
|
|
18
|
+
//# sourceMappingURL=SchemaDifferenceValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaDifferenceValidator.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifferenceValidator.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA2N,MAAM,EAAoD,MAAM,0BAA0B,CAAC;AAC7T,OAAO,EAA0B,mBAAmB,EAA4pB,MAAM,oBAAoB,CAAC;AAC3uB,OAAO,EAAE,2BAA2B,EAAgB,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAe,MAAM,8BAA8B,CAAC;AAExE;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,mBAAmB,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,0CAOlJ"}
|