@itwin/ecschema-editing 5.0.0-dev.90 → 5.0.0-dev.93
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,117 @@
|
|
|
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 Merging
|
|
7
|
+
*/
|
|
8
|
+
import { SchemaContext, SchemaItemKey, SchemaKey } from "@itwin/ecschema-metadata";
|
|
9
|
+
import { SchemaContextEditor } from "../Editing/Editor";
|
|
10
|
+
import { SchemaConflictsError } from "../Differencing/Errors";
|
|
11
|
+
import { getSchemaDifferences } from "../Differencing/SchemaDifference";
|
|
12
|
+
import { SchemaMergingVisitor } from "./SchemaMergingVisitor";
|
|
13
|
+
import { SchemaMergingWalker } from "./SchemaMergingWalker";
|
|
14
|
+
import { ECEditingStatus, SchemaEditingError } from "../Editing/Exception";
|
|
15
|
+
import { NameMapping } from "./Edits/NameMapping";
|
|
16
|
+
/**
|
|
17
|
+
* Class to merge two schemas together.
|
|
18
|
+
* @see [[merge]] or [[mergeSchemas]] to merge two schemas together.
|
|
19
|
+
* @beta
|
|
20
|
+
*/
|
|
21
|
+
export class SchemaMerger {
|
|
22
|
+
_editingContext;
|
|
23
|
+
/**
|
|
24
|
+
* Constructs a new instance of the SchemaMerger object.
|
|
25
|
+
* @param editingContext The schema contexts that holds the schema to be edited.
|
|
26
|
+
*/
|
|
27
|
+
constructor(editingContext) {
|
|
28
|
+
this._editingContext = editingContext;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Copy the SchemaItems of the source schemas to the target schema.
|
|
32
|
+
* @param targetSchema The schema the SchemaItems gets merged to.
|
|
33
|
+
* @param sourceSchema The schema the SchemaItems gets copied from.
|
|
34
|
+
* @param edits An optional instance of schema edits that shall be applied before the schemas get merged.
|
|
35
|
+
* @returns The merged target schema.
|
|
36
|
+
* @alpha
|
|
37
|
+
*/
|
|
38
|
+
async mergeSchemas(targetSchema, sourceSchema, edits) {
|
|
39
|
+
return this.merge(await getSchemaDifferences(targetSchema, sourceSchema, edits), edits);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Merges the schema differences into the target schema context.
|
|
43
|
+
* @param differenceResult The differences that shall be applied to the target schema.
|
|
44
|
+
* @param edits An optional instance of schema edits that shall be applied before the schemas get merged.
|
|
45
|
+
* @alpha
|
|
46
|
+
*/
|
|
47
|
+
async merge(differenceResult, edits) {
|
|
48
|
+
const targetSchemaKey = SchemaKey.parseString(differenceResult.targetSchemaName);
|
|
49
|
+
const sourceSchemaKey = SchemaKey.parseString(differenceResult.sourceSchemaName);
|
|
50
|
+
const nameMapping = new NameMapping();
|
|
51
|
+
const editor = new SchemaContextEditor(new MergingSchemaContext(this._editingContext, nameMapping));
|
|
52
|
+
// If schema changes were provided, they'll get applied and a new SchemaDifferenceResult is returned
|
|
53
|
+
// to prevent altering the differenceResult the caller passed in.
|
|
54
|
+
if (edits) {
|
|
55
|
+
await edits.applyTo(differenceResult = { ...differenceResult }, nameMapping);
|
|
56
|
+
}
|
|
57
|
+
if (differenceResult.conflicts && differenceResult.conflicts.length > 0) {
|
|
58
|
+
throw new SchemaConflictsError("Schema's can't be merged if there are unresolved conflicts.", differenceResult.conflicts, sourceSchemaKey, targetSchemaKey);
|
|
59
|
+
}
|
|
60
|
+
const schema = await editor.getSchema(targetSchemaKey).catch((error) => {
|
|
61
|
+
if (error instanceof SchemaEditingError && error.errorNumber === ECEditingStatus.SchemaNotFound) {
|
|
62
|
+
throw new Error(`The target schema '${targetSchemaKey.name}' could not be found in the editing context.`);
|
|
63
|
+
}
|
|
64
|
+
throw error;
|
|
65
|
+
});
|
|
66
|
+
if (!schema.customAttributes || !schema.customAttributes.has("CoreCustomAttributes.DynamicSchema")) {
|
|
67
|
+
throw new Error(`The target schema '${targetSchemaKey.name}' is not dynamic. Only dynamic schemas are supported for merging.`);
|
|
68
|
+
}
|
|
69
|
+
const visitor = new SchemaMergingVisitor({
|
|
70
|
+
editor,
|
|
71
|
+
targetSchema: schema,
|
|
72
|
+
targetSchemaKey,
|
|
73
|
+
sourceSchemaKey,
|
|
74
|
+
nameMapping,
|
|
75
|
+
});
|
|
76
|
+
const walker = new SchemaMergingWalker(visitor);
|
|
77
|
+
await walker.traverse(differenceResult.differences, "add");
|
|
78
|
+
await walker.traverse(differenceResult.differences, "modify");
|
|
79
|
+
return schema;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* SchemaContext implementation that overrides certain methods to allow to apply name mappings
|
|
84
|
+
* for certain schema elements during the schema merging process.
|
|
85
|
+
*
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
class MergingSchemaContext extends SchemaContext {
|
|
89
|
+
_internalContext;
|
|
90
|
+
_nameMappings;
|
|
91
|
+
constructor(internalContext, nameMapping) {
|
|
92
|
+
super();
|
|
93
|
+
this._internalContext = internalContext;
|
|
94
|
+
this._nameMappings = nameMapping;
|
|
95
|
+
}
|
|
96
|
+
async getCachedSchema(schemaKey, matchType) {
|
|
97
|
+
return this._internalContext.getCachedSchema(schemaKey, matchType);
|
|
98
|
+
}
|
|
99
|
+
async getSchema(schemaKey, matchType) {
|
|
100
|
+
return this._internalContext.getSchema(schemaKey, matchType);
|
|
101
|
+
}
|
|
102
|
+
async getSchemaItem(schemaNameOrKey, itemNameOrCtor, itemConstructor) {
|
|
103
|
+
let schemaItemKey;
|
|
104
|
+
if (typeof schemaNameOrKey === "string")
|
|
105
|
+
schemaItemKey = new SchemaItemKey(itemNameOrCtor, new SchemaKey(schemaNameOrKey));
|
|
106
|
+
else
|
|
107
|
+
schemaItemKey = schemaNameOrKey;
|
|
108
|
+
const mappedKey = this._nameMappings.resolveItemKey(schemaItemKey);
|
|
109
|
+
if (mappedKey !== undefined) {
|
|
110
|
+
schemaItemKey = mappedKey;
|
|
111
|
+
}
|
|
112
|
+
if (itemConstructor === undefined)
|
|
113
|
+
return this._internalContext.getSchemaItem(schemaItemKey);
|
|
114
|
+
return this._internalContext.getSchemaItem(schemaItemKey, itemConstructor);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=SchemaMerger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaMerger.js","sourceRoot":"","sources":["../../../src/Merging/SchemaMerger.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAU,aAAa,EAAc,aAAa,EAAE,SAAS,EAAmB,MAAM,0BAA0B,CAAC;AACxH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AA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8B,EAAE,WAAwB;QACzE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC;IACnC,CAAC;IAEe,KAAK,CAAC,eAAe,CAAC,SAAoB,EAAE,SAA2B;QACrF,OAAO,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACrE,CAAC;IAEe,KAAK,CAAC,SAAS,CAAC,SAAoB,EAAE,SAA2B;QAC/E,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;IAEe,KAAK,CAAC,aAAa,CAA8B,eAAuC,EAAE,cAA2B,EAAE,eAAmB;QACxJ,IAAI,aAA4B,CAAC;QACjC,IAAI,OAAO,eAAe,KAAK,QAAQ;YACrC,aAAa,GAAG,IAAI,aAAa,CAAC,cAAwB,EAAE,IAAI,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC;;YAE5F,aAAa,GAAG,eAAe,CAAC;QAElC,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QACnE,IAAG,SAAS,KAAK,SAAS,EAAE,CAAC;YAC3B,aAAa,GAAG,SAA0B,CAAC;QAC7C,CAAC;QAED,IAAG,eAAe,KAAK,SAAS;YAC9B,OAAO,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAE5D,OAAO,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAC7E,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 Merging\n */\n\nimport { Schema, SchemaContext, SchemaItem, SchemaItemKey, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\nimport { SchemaContextEditor } from \"../Editing/Editor\";\nimport { SchemaConflictsError } from \"../Differencing/Errors\";\nimport { getSchemaDifferences, type SchemaDifferenceResult } from \"../Differencing/SchemaDifference\";\nimport { SchemaMergingVisitor } from \"./SchemaMergingVisitor\";\nimport { SchemaMergingWalker } from \"./SchemaMergingWalker\";\nimport { SchemaEdits } from \"./Edits/SchemaEdits\";\nimport { ECEditingStatus, SchemaEditingError } from \"../Editing/Exception\";\nimport { NameMapping } from \"./Edits/NameMapping\";\n\n/**\n * Defines the context of a Schema merging run.\n * @internal\n */\nexport interface SchemaMergeContext {\n readonly targetSchema: Schema;\n readonly targetSchemaKey: SchemaKey;\n readonly sourceSchemaKey: SchemaKey;\n readonly editor: SchemaContextEditor;\n readonly nameMapping: NameMapping;\n}\n\n/**\n * Class to merge two schemas together.\n * @see [[merge]] or [[mergeSchemas]] to merge two schemas together.\n * @beta\n */\nexport class SchemaMerger {\n\n private readonly _editingContext: SchemaContext;\n\n /**\n * Constructs a new instance of the SchemaMerger object.\n * @param editingContext The schema contexts that holds the schema to be edited.\n */\n constructor(editingContext: SchemaContext) {\n this._editingContext = editingContext;\n }\n\n /**\n * Copy the SchemaItems of the source schemas to the target schema.\n * @param targetSchema The schema the SchemaItems gets merged to.\n * @param sourceSchema The schema the SchemaItems gets copied from.\n * @param edits An optional instance of schema edits that shall be applied before the schemas get merged.\n * @returns The merged target schema.\n * @alpha\n */\n public async mergeSchemas(targetSchema: Schema, sourceSchema: Schema, edits?: SchemaEdits): Promise<Schema> {\n return this.merge(await getSchemaDifferences(targetSchema, sourceSchema, edits), edits);\n }\n\n /**\n * Merges the schema differences into the target schema context.\n * @param differenceResult The differences that shall be applied to the target schema.\n * @param edits An optional instance of schema edits that shall be applied before the schemas get merged.\n * @alpha\n */\n public async merge(differenceResult: SchemaDifferenceResult, edits?: SchemaEdits): Promise<Schema> {\n const targetSchemaKey = SchemaKey.parseString(differenceResult.targetSchemaName);\n const sourceSchemaKey = SchemaKey.parseString(differenceResult.sourceSchemaName);\n\n const nameMapping = new NameMapping();\n const editor = new SchemaContextEditor(new MergingSchemaContext(this._editingContext, nameMapping));\n\n // If schema changes were provided, they'll get applied and a new SchemaDifferenceResult is returned\n // to prevent altering the differenceResult the caller passed in.\n if (edits) {\n await edits.applyTo(differenceResult = { ...differenceResult }, nameMapping);\n }\n\n if (differenceResult.conflicts && differenceResult.conflicts.length > 0) {\n throw new SchemaConflictsError(\n \"Schema's can't be merged if there are unresolved conflicts.\",\n differenceResult.conflicts,\n sourceSchemaKey,\n targetSchemaKey,\n );\n }\n\n const schema = await editor.getSchema(targetSchemaKey).catch((error: Error) => {\n if (error instanceof SchemaEditingError && error.errorNumber === ECEditingStatus.SchemaNotFound) {\n throw new Error(`The target schema '${targetSchemaKey.name}' could not be found in the editing context.`);\n }\n throw error;\n });\n\n if (!schema.customAttributes || !schema.customAttributes.has(\"CoreCustomAttributes.DynamicSchema\")) {\n throw new Error(`The target schema '${targetSchemaKey.name}' is not dynamic. Only dynamic schemas are supported for merging.`);\n }\n\n const visitor = new SchemaMergingVisitor({\n editor,\n targetSchema: schema,\n targetSchemaKey,\n sourceSchemaKey,\n nameMapping,\n });\n\n const walker = new SchemaMergingWalker(visitor);\n await walker.traverse(differenceResult.differences, \"add\");\n await walker.traverse(differenceResult.differences, \"modify\");\n\n return schema;\n }\n}\n\n/**\n * SchemaContext implementation that overrides certain methods to allow to apply name mappings\n * for certain schema elements during the schema merging process.\n *\n * @internal\n */\nclass MergingSchemaContext extends SchemaContext {\n private _internalContext: SchemaContext;\n private _nameMappings: NameMapping;\n\n public constructor(internalContext: SchemaContext, nameMapping: NameMapping) {\n super();\n this._internalContext = internalContext;\n this._nameMappings = nameMapping;\n }\n\n public override async getCachedSchema(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<Schema | undefined> {\n return this._internalContext.getCachedSchema(schemaKey, matchType);\n }\n\n public override async getSchema(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<Schema | undefined> {\n return this._internalContext.getSchema(schemaKey, matchType);\n }\n\n public override async getSchemaItem<T extends typeof SchemaItem>(schemaNameOrKey: string | SchemaItemKey, itemNameOrCtor?: string | T, itemConstructor?: T): Promise<SchemaItem | InstanceType<T> | undefined> {\n let schemaItemKey: SchemaItemKey;\n if (typeof schemaNameOrKey === \"string\")\n schemaItemKey = new SchemaItemKey(itemNameOrCtor as string, new SchemaKey(schemaNameOrKey));\n else\n schemaItemKey = schemaNameOrKey;\n\n const mappedKey = this._nameMappings.resolveItemKey(schemaItemKey);\n if(mappedKey !== undefined) {\n schemaItemKey = mappedKey as SchemaItemKey;\n }\n\n if(itemConstructor === undefined)\n return this._internalContext.getSchemaItem(schemaItemKey);\n\n return this._internalContext.getSchemaItem(schemaItemKey, itemConstructor);\n }\n}\n"]}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { AnySchemaDifference, ClassPropertyDifference, ConstantDifference, CustomAttributeClassDifference, CustomAttributeDifference, EntityClassDifference, EntityClassMixinDifference, EnumerationDifference, EnumeratorDifference, FormatDifference, FormatUnitDifference, FormatUnitLabelDifference, InvertedUnitDifference, KindOfQuantityDifference, KindOfQuantityPresentationFormatDifference, MixinClassDifference, PhenomenonDifference, PropertyCategoryDifference, RelationshipClassDifference, RelationshipConstraintClassDifference, RelationshipConstraintDifference, SchemaDifference, SchemaReferenceDifference, StructClassDifference, UnitDifference, UnitSystemDifference } from "../Differencing/SchemaDifference";
|
|
2
|
+
import { SchemaDifferenceVisitor } from "../Differencing/SchemaDifferenceVisitor";
|
|
3
|
+
import { SchemaMergeContext } from "./SchemaMerger";
|
|
4
|
+
/**
|
|
5
|
+
* Implementation of ISchemaDifferenceVisitor that can be used to traverse schema
|
|
6
|
+
* differences to call the appropriated merger methods.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class SchemaMergingVisitor implements SchemaDifferenceVisitor {
|
|
10
|
+
private readonly _context;
|
|
11
|
+
/**
|
|
12
|
+
* Initializes a new instance of SchemaMergingVisitor class.
|
|
13
|
+
*/
|
|
14
|
+
constructor(context: SchemaMergeContext);
|
|
15
|
+
/**
|
|
16
|
+
* Shared merging logic for all types of ClassItemDifference union.
|
|
17
|
+
*/
|
|
18
|
+
private visitClassDifference;
|
|
19
|
+
/**
|
|
20
|
+
* Visitor implementation for handling ConstantDifference.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
visitConstantDifference(entry: ConstantDifference): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Visitor implementation for handling CustomAttributeClassDifference.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
visitCustomAttributeClassDifference(entry: CustomAttributeClassDifference, index: number, array: AnySchemaDifference[]): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Visitor implementation for handling CustomAttributeDifference.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
visitCustomAttributeInstanceDifference(entry: CustomAttributeDifference): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Visitor implementation for handling EntityClassDifference.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
visitEntityClassDifference(entry: EntityClassDifference, index: number, array: AnySchemaDifference[]): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Visitor implementation for handling EntityClassMixinDifference.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
visitEntityClassMixinDifference(entry: EntityClassMixinDifference): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Visitor implementation for handling EnumerationDifference.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
visitEnumerationDifference(entry: EnumerationDifference): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Visitor implementation for handling EnumeratorDifference.
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
visitEnumeratorDifference(entry: EnumeratorDifference): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Visitor implementation for handling FormatDifference.
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
visitFormatDifference(entry: FormatDifference): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Visitor implementation for handling FormatUnitDifference.
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
visitFormatUnitDifference(entry: FormatUnitDifference): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Visitor implementation for handling FormatUnitLabelDifference.
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
visitFormatUnitLabelDifference(entry: FormatUnitLabelDifference): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Visitor implementation for handling InvertedUnitDifference.
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
visitInvertedUnitDifference(entry: InvertedUnitDifference): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Visitor implementation for handling KindOfQuantityDifference.
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
visitKindOfQuantityDifference(entry: KindOfQuantityDifference): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Visitor implementation for handling MixinClassDifference.
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
visitMixinDifference(entry: MixinClassDifference, index: number, array: AnySchemaDifference[]): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Visitor implementation for handling PhenomenonDifference.
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
visitPhenomenonDifference(entry: PhenomenonDifference): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Visitor implementation for handling PropertyCategoryDifference.
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
visitPropertyCategoryDifference(entry: PropertyCategoryDifference): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Visitor implementation for handling ClassPropertyDifference.
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
visitPropertyDifference(entry: ClassPropertyDifference): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Visitor implementation for handling RelationshipClassDifference.
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
visitRelationshipClassDifference(entry: RelationshipClassDifference, index: number, array: AnySchemaDifference[]): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Visitor implementation for handling RelationshipConstraintClassDifference.
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
visitRelationshipConstraintClassDifference(entry: RelationshipConstraintClassDifference): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Visitor implementation for handling RelationshipConstraintDifference.
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
visitRelationshipConstraintDifference(entry: RelationshipConstraintDifference): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Visitor implementation for handling SchemaDifference.
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
visitSchemaDifference({ difference }: SchemaDifference): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Shared merging logic for all types of AnySchemaItemDifference union.
|
|
121
|
+
*/
|
|
122
|
+
private visitSchemaItemDifference;
|
|
123
|
+
/**
|
|
124
|
+
* Visitor implementation for handling SchemaReferenceDifference.
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
visitSchemaReferenceDifference(entry: SchemaReferenceDifference): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Visitor implementation for handling StructClassDifference.
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
visitStructClassDifference(entry: StructClassDifference, index: number, array: AnySchemaDifference[]): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Visitor implementation for handling UnitDifference.
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
137
|
+
visitUnitDifference(entry: UnitDifference): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Visitor implementation for handling UnitSystemDifference.
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
visitUnitSystemDifference(entry: UnitSystemDifference): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Visitor implementation for handling KindOfQuantityPresentationFormatDifference.
|
|
145
|
+
* @internal
|
|
146
|
+
*/
|
|
147
|
+
visitKindOfQuantityPresentationFormatDifference(entry: KindOfQuantityPresentationFormatDifference): Promise<void>;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=SchemaMergingVisitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaMergingVisitor.d.ts","sourceRoot":"","sources":["../../../src/Merging/SchemaMergingVisitor.ts"],"names":[],"mappings":"AAIA,OAAO,EAA0B,mBAAmB,EAA2B,uBAAuB,EACpG,kBAAkB,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,qBAAqB,EACpG,0BAA0B,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,oBAAoB,EAC/G,yBAAyB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,0CAA0C,EACvH,oBAAoB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,2BAA2B,EACnG,qCAAqC,EAAE,gCAAgC,EAAE,gBAAgB,EAAE,yBAAyB,EACpH,qBAAqB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAiBxG,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAYpD;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,uBAAuB;IAElE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAE9C;;OAEG;gBACS,OAAO,EAAE,kBAAkB;IAIvC;;OAEG;YACW,oBAAoB;IAmClC;;;OAGG;IACU,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAA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ger";
|
|
2
|
+
import { addCustomAttribute } from "./CustomAttributeMerger";
|
|
3
|
+
import { addCustomAttributeClass, modifyCustomAttributeClass } from "./CustomAttributeClassMerger";
|
|
4
|
+
import { addClassMixins, addEntityClass, modifyEntityClass } from "./EntityClassMerger";
|
|
5
|
+
import { addEnumeration, modifyEnumeration } from "./EnumerationMerger";
|
|
6
|
+
import { addEnumerator, modifyEnumerator } from "./EnumeratorMerger";
|
|
7
|
+
import { addKindOfQuantity, addPresentationFormat, modifyKindOfQuantity } from "./KindOfQuantityMerger";
|
|
8
|
+
import { addMixinClass, modifyMixinClass } from "./MixinMerger";
|
|
9
|
+
import { addPhenomenon, modifyPhenomenon } from "./PhenomenonMerger";
|
|
10
|
+
import { addPropertyCategory, modifyPropertyCategory } from "./PropertyCategoryMerger";
|
|
11
|
+
import { addRelationshipClass, mergeRelationshipClassConstraint, mergeRelationshipConstraint, modifyRelationshipClass } from "./RelationshipClassMerger";
|
|
12
|
+
import { addSchemaReferences, modifySchemaReferences } from "./SchemaReferenceMerger";
|
|
13
|
+
import { addStructClass, modifyStructClass } from "./StructClassMerger";
|
|
14
|
+
import { addUnitSystem, modifyUnitSystem } from "./UnitSystemMerger";
|
|
15
|
+
import { mergePropertyDifference } from "./PropertyMerger";
|
|
16
|
+
import { isClassDifference } from "../Differencing/Utils";
|
|
17
|
+
import { toItemKey } from "./Utils";
|
|
18
|
+
import { addUnit, modifyUnit } from "./UnitMerger";
|
|
19
|
+
import { addInvertedUnit, modifyInvertedUnit } from "./InvertedUnitMerger";
|
|
20
|
+
import { addFormat, modifyFormat, modifyFormatUnit, modifyFormatUnitLabel } from "./FormatMerger";
|
|
21
|
+
/**
|
|
22
|
+
* Implementation of ISchemaDifferenceVisitor that can be used to traverse schema
|
|
23
|
+
* differences to call the appropriated merger methods.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export class SchemaMergingVisitor {
|
|
27
|
+
_context;
|
|
28
|
+
/**
|
|
29
|
+
* Initializes a new instance of SchemaMergingVisitor class.
|
|
30
|
+
*/
|
|
31
|
+
constructor(context) {
|
|
32
|
+
this._context = context;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Shared merging logic for all types of ClassItemDifference union.
|
|
36
|
+
*/
|
|
37
|
+
async visitClassDifference(entry, index, array, handler) {
|
|
38
|
+
return this.visitSchemaItemDifference(entry, {
|
|
39
|
+
add: async (context) => {
|
|
40
|
+
// To add classes a slightly different approach is done. In fact the class entries gets processed
|
|
41
|
+
// two times. The first time, a stub with the bare minimum is added to the schema. The second time,
|
|
42
|
+
// the class gets completed with all properties, mixins, etc...
|
|
43
|
+
if (entry.changeType === "add" && !await context.targetSchema.getItem(entry.itemName)) {
|
|
44
|
+
await handler.add(this._context, {
|
|
45
|
+
...entry,
|
|
46
|
+
difference: {
|
|
47
|
+
...entry.difference,
|
|
48
|
+
// Remove everything we want to validate before setting, this is done in the second iteration.
|
|
49
|
+
baseClass: undefined,
|
|
50
|
+
mixins: undefined,
|
|
51
|
+
properties: undefined,
|
|
52
|
+
customAttributes: undefined,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
// Searches for the last class difference and adds the entry after it. That way,
|
|
56
|
+
// the class is completed before class related entries get processed.
|
|
57
|
+
const insertIndex = findIndexOf(array, (e) => !isClassDifference(e), index) || array.length;
|
|
58
|
+
array.splice(insertIndex, 0, entry);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// Now both a modification change or the second add iteration is a modification of an existing class.
|
|
62
|
+
// So, regardless of the actual change type, modify is called.
|
|
63
|
+
return handler.modify(this._context, entry, toItemKey(this._context, entry.itemName));
|
|
64
|
+
},
|
|
65
|
+
modify: handler.modify,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Visitor implementation for handling ConstantDifference.
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
async visitConstantDifference(entry) {
|
|
73
|
+
return this.visitSchemaItemDifference(entry, {
|
|
74
|
+
add: addConstant,
|
|
75
|
+
modify: modifyConstant,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Visitor implementation for handling CustomAttributeClassDifference.
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
async visitCustomAttributeClassDifference(entry, index, array) {
|
|
83
|
+
return this.visitClassDifference(entry, index, array, {
|
|
84
|
+
add: addCustomAttributeClass,
|
|
85
|
+
modify: modifyCustomAttributeClass,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Visitor implementation for handling CustomAttributeDifference.
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
async visitCustomAttributeInstanceDifference(entry) {
|
|
93
|
+
switch (entry.changeType) {
|
|
94
|
+
case "add": return addCustomAttribute(this._context, entry);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Visitor implementation for handling EntityClassDifference.
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
async visitEntityClassDifference(entry, index, array) {
|
|
102
|
+
return this.visitClassDifference(entry, index, array, {
|
|
103
|
+
add: addEntityClass,
|
|
104
|
+
modify: modifyEntityClass,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Visitor implementation for handling EntityClassMixinDifference.
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
async visitEntityClassMixinDifference(entry) {
|
|
112
|
+
switch (entry.changeType) {
|
|
113
|
+
case "add": return addClassMixins(this._context, entry);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Visitor implementation for handling EnumerationDifference.
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
async visitEnumerationDifference(entry) {
|
|
121
|
+
return this.visitSchemaItemDifference(entry, {
|
|
122
|
+
add: addEnumeration,
|
|
123
|
+
modify: modifyEnumeration,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Visitor implementation for handling EnumeratorDifference.
|
|
128
|
+
* @internal
|
|
129
|
+
*/
|
|
130
|
+
async visitEnumeratorDifference(entry) {
|
|
131
|
+
switch (entry.changeType) {
|
|
132
|
+
case "add": return addEnumerator(this._context, entry);
|
|
133
|
+
case "modify": return modifyEnumerator(this._context, entry, toItemKey(this._context, entry.itemName));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Visitor implementation for handling FormatDifference.
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
140
|
+
async visitFormatDifference(entry) {
|
|
141
|
+
return this.visitSchemaItemDifference(entry, {
|
|
142
|
+
add: addFormat,
|
|
143
|
+
modify: modifyFormat,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Visitor implementation for handling FormatUnitDifference.
|
|
148
|
+
* @internal
|
|
149
|
+
*/
|
|
150
|
+
async visitFormatUnitDifference(entry) {
|
|
151
|
+
switch (entry.changeType) {
|
|
152
|
+
case "modify": return modifyFormatUnit(this._context, entry, toItemKey(this._context, entry.itemName));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Visitor implementation for handling FormatUnitLabelDifference.
|
|
157
|
+
* @internal
|
|
158
|
+
*/
|
|
159
|
+
async visitFormatUnitLabelDifference(entry) {
|
|
160
|
+
switch (entry.changeType) {
|
|
161
|
+
case "modify": return modifyFormatUnitLabel(this._context, entry, toItemKey(this._context, entry.itemName));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Visitor implementation for handling InvertedUnitDifference.
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
async visitInvertedUnitDifference(entry) {
|
|
169
|
+
return this.visitSchemaItemDifference(entry, {
|
|
170
|
+
add: addInvertedUnit,
|
|
171
|
+
modify: modifyInvertedUnit,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Visitor implementation for handling KindOfQuantityDifference.
|
|
176
|
+
* @internal
|
|
177
|
+
*/
|
|
178
|
+
async visitKindOfQuantityDifference(entry) {
|
|
179
|
+
return this.visitSchemaItemDifference(entry, {
|
|
180
|
+
add: addKindOfQuantity,
|
|
181
|
+
modify: modifyKindOfQuantity,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Visitor implementation for handling MixinClassDifference.
|
|
186
|
+
* @internal
|
|
187
|
+
*/
|
|
188
|
+
async visitMixinDifference(entry, index, array) {
|
|
189
|
+
return this.visitClassDifference(entry, index, array, {
|
|
190
|
+
add: addMixinClass,
|
|
191
|
+
modify: modifyMixinClass,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Visitor implementation for handling PhenomenonDifference.
|
|
196
|
+
* @internal
|
|
197
|
+
*/
|
|
198
|
+
async visitPhenomenonDifference(entry) {
|
|
199
|
+
return this.visitSchemaItemDifference(entry, {
|
|
200
|
+
add: addPhenomenon,
|
|
201
|
+
modify: modifyPhenomenon,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Visitor implementation for handling PropertyCategoryDifference.
|
|
206
|
+
* @internal
|
|
207
|
+
*/
|
|
208
|
+
async visitPropertyCategoryDifference(entry) {
|
|
209
|
+
return this.visitSchemaItemDifference(entry, {
|
|
210
|
+
add: addPropertyCategory,
|
|
211
|
+
modify: modifyPropertyCategory,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Visitor implementation for handling ClassPropertyDifference.
|
|
216
|
+
* @internal
|
|
217
|
+
*/
|
|
218
|
+
async visitPropertyDifference(entry) {
|
|
219
|
+
await mergePropertyDifference(this._context, entry);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Visitor implementation for handling RelationshipClassDifference.
|
|
223
|
+
* @internal
|
|
224
|
+
*/
|
|
225
|
+
async visitRelationshipClassDifference(entry, index, array) {
|
|
226
|
+
return this.visitClassDifference(entry, index, array, {
|
|
227
|
+
add: addRelationshipClass,
|
|
228
|
+
modify: modifyRelationshipClass,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Visitor implementation for handling RelationshipConstraintClassDifference.
|
|
233
|
+
* @internal
|
|
234
|
+
*/
|
|
235
|
+
async visitRelationshipConstraintClassDifference(entry) {
|
|
236
|
+
await mergeRelationshipClassConstraint(this._context, entry);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Visitor implementation for handling RelationshipConstraintDifference.
|
|
240
|
+
* @internal
|
|
241
|
+
*/
|
|
242
|
+
async visitRelationshipConstraintDifference(entry) {
|
|
243
|
+
await mergeRelationshipConstraint(this._context, entry);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Visitor implementation for handling SchemaDifference.
|
|
247
|
+
* @internal
|
|
248
|
+
*/
|
|
249
|
+
async visitSchemaDifference({ difference }) {
|
|
250
|
+
if (difference.label !== undefined) {
|
|
251
|
+
await this._context.editor.setDisplayLabel(this._context.targetSchemaKey, difference.label);
|
|
252
|
+
}
|
|
253
|
+
if (difference.description !== undefined) {
|
|
254
|
+
await this._context.editor.setDescription(this._context.targetSchemaKey, difference.description);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Shared merging logic for all types of AnySchemaItemDifference union.
|
|
259
|
+
*/
|
|
260
|
+
async visitSchemaItemDifference(entry, handler) {
|
|
261
|
+
switch (entry.changeType) {
|
|
262
|
+
case "add": {
|
|
263
|
+
return handler.add(this._context, entry);
|
|
264
|
+
}
|
|
265
|
+
case "modify":
|
|
266
|
+
{
|
|
267
|
+
if ("schemaItemType" in entry.difference && entry.difference.schemaItemType !== entry.schemaType) {
|
|
268
|
+
throw new Error(`Changing the type of item '${entry.itemName}' not supported.`);
|
|
269
|
+
}
|
|
270
|
+
return handler.modify(this._context, entry, toItemKey(this._context, entry.itemName));
|
|
271
|
+
}
|
|
272
|
+
;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Visitor implementation for handling SchemaReferenceDifference.
|
|
277
|
+
* @internal
|
|
278
|
+
*/
|
|
279
|
+
async visitSchemaReferenceDifference(entry) {
|
|
280
|
+
switch (entry.changeType) {
|
|
281
|
+
case "add": return addSchemaReferences(this._context, entry);
|
|
282
|
+
case "modify": return modifySchemaReferences(this._context, entry);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Visitor implementation for handling StructClassDifference.
|
|
287
|
+
* @internal
|
|
288
|
+
*/
|
|
289
|
+
async visitStructClassDifference(entry, index, array) {
|
|
290
|
+
return this.visitClassDifference(entry, index, array, {
|
|
291
|
+
add: addStructClass,
|
|
292
|
+
modify: modifyStructClass,
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Visitor implementation for handling UnitDifference.
|
|
297
|
+
* @internal
|
|
298
|
+
*/
|
|
299
|
+
async visitUnitDifference(entry) {
|
|
300
|
+
return this.visitSchemaItemDifference(entry, {
|
|
301
|
+
add: addUnit,
|
|
302
|
+
modify: modifyUnit,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Visitor implementation for handling UnitSystemDifference.
|
|
307
|
+
* @internal
|
|
308
|
+
*/
|
|
309
|
+
async visitUnitSystemDifference(entry) {
|
|
310
|
+
return this.visitSchemaItemDifference(entry, {
|
|
311
|
+
add: addUnitSystem,
|
|
312
|
+
modify: modifyUnitSystem,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Visitor implementation for handling KindOfQuantityPresentationFormatDifference.
|
|
317
|
+
* @internal
|
|
318
|
+
*/
|
|
319
|
+
async visitKindOfQuantityPresentationFormatDifference(entry) {
|
|
320
|
+
switch (entry.changeType) {
|
|
321
|
+
case "add": return addPresentationFormat(this._context, entry, toItemKey(this._context, entry.itemName));
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Helper method to get the index of the first element in the array that satisfies the provided testing function.
|
|
327
|
+
* @param array Array to search.
|
|
328
|
+
* @param predicate Function to execute on each value in the array.
|
|
329
|
+
* @param fromIndex The index to start the search at.
|
|
330
|
+
* @returns An index in the array if an element passes the test; otherwise, false.
|
|
331
|
+
*/
|
|
332
|
+
function findIndexOf(array, predicate, fromIndex) {
|
|
333
|
+
for (let i = fromIndex; i < array.length; i++) {
|
|
334
|
+
if (predicate(array[i]))
|
|
335
|
+
return i;
|
|
336
|
+
}
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
//# sourceMappingURL=SchemaMergingVisitor.js.map
|