@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,137 @@
|
|
|
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
|
+
import { InvertedUnit, Unit } from "@itwin/ecschema-metadata";
|
|
6
|
+
import { FormatTraits, parseFormatTrait, parseScientificType, parseShowSignOption } from "@itwin/core-quantity";
|
|
7
|
+
import { updateSchemaItemFullName, updateSchemaItemKey } from "./Utils";
|
|
8
|
+
/**
|
|
9
|
+
* Merges a new Format into the target schema.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export async function addFormat(context, change) {
|
|
13
|
+
if (change.difference.type === undefined) {
|
|
14
|
+
throw new Error("Format must define type");
|
|
15
|
+
}
|
|
16
|
+
if (change.difference.composite && change.difference.composite.units) {
|
|
17
|
+
for (let index = 0; index < change.difference.composite.units.length; index++) {
|
|
18
|
+
const compositeUnitName = await updateSchemaItemFullName(context, change.difference.composite.units[index].name);
|
|
19
|
+
change.difference.composite.units[index] = {
|
|
20
|
+
name: compositeUnitName,
|
|
21
|
+
label: change.difference.composite.units[index].label,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
await context.editor.formats.createFromProps(context.targetSchemaKey, {
|
|
26
|
+
...change.difference,
|
|
27
|
+
name: change.itemName,
|
|
28
|
+
schemaItemType: change.schemaType,
|
|
29
|
+
type: change.difference.type,
|
|
30
|
+
composite: change.difference.composite,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Merges differences to an existing Format in the target schema.
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export async function modifyFormat(context, change, itemKey) {
|
|
38
|
+
const format = await context.targetSchema.lookupItem(itemKey);
|
|
39
|
+
if (change.difference.type !== undefined) {
|
|
40
|
+
throw new Error(`Changing the format '${change.itemName}' type is not supported.`);
|
|
41
|
+
}
|
|
42
|
+
if (change.difference.label !== undefined) {
|
|
43
|
+
await context.editor.formats.setDisplayLabel(itemKey, change.difference.label);
|
|
44
|
+
}
|
|
45
|
+
if (change.difference.description !== undefined) {
|
|
46
|
+
await context.editor.formats.setDescription(itemKey, change.difference.description);
|
|
47
|
+
}
|
|
48
|
+
if (change.difference.precision !== undefined) {
|
|
49
|
+
format.setPrecision(change.difference.precision);
|
|
50
|
+
}
|
|
51
|
+
if (change.difference.roundFactor !== undefined) {
|
|
52
|
+
format.setRoundFactor(change.difference.roundFactor);
|
|
53
|
+
}
|
|
54
|
+
if (change.difference.minWidth !== undefined) {
|
|
55
|
+
format.setMinWidth(change.difference.minWidth);
|
|
56
|
+
}
|
|
57
|
+
if (change.difference.showSignOption !== undefined) {
|
|
58
|
+
const showSignOption = parseShowSignOption(change.difference.showSignOption, change.itemName);
|
|
59
|
+
format.setShowSignOption(showSignOption);
|
|
60
|
+
}
|
|
61
|
+
if (change.difference.formatTraits !== undefined) {
|
|
62
|
+
const formatTraits = parseFormatTraits(change.difference.formatTraits, change.itemName);
|
|
63
|
+
format.setFormatTraits(formatTraits);
|
|
64
|
+
}
|
|
65
|
+
if (change.difference.decimalSeparator !== undefined) {
|
|
66
|
+
format.setDecimalSeparator(change.difference.decimalSeparator);
|
|
67
|
+
}
|
|
68
|
+
if (change.difference.thousandSeparator !== undefined) {
|
|
69
|
+
format.setThousandSeparator(change.difference.thousandSeparator);
|
|
70
|
+
}
|
|
71
|
+
if (change.difference.uomSeparator !== undefined) {
|
|
72
|
+
format.setUomSeparator(change.difference.uomSeparator);
|
|
73
|
+
}
|
|
74
|
+
if (change.difference.scientificType !== undefined) {
|
|
75
|
+
const scientificType = parseScientificType(change.difference.scientificType, change.itemName);
|
|
76
|
+
format.setScientificType(scientificType);
|
|
77
|
+
}
|
|
78
|
+
if (change.difference.stationOffsetSize !== undefined) {
|
|
79
|
+
format.setStationOffsetSize(change.difference.stationOffsetSize);
|
|
80
|
+
}
|
|
81
|
+
if (change.difference.stationSeparator !== undefined) {
|
|
82
|
+
format.setStationSeparator(change.difference.stationSeparator);
|
|
83
|
+
}
|
|
84
|
+
if (change.difference.composite !== undefined) {
|
|
85
|
+
if (change.difference.composite.includeZero !== undefined) {
|
|
86
|
+
format.setIncludeZero(change.difference.composite.includeZero);
|
|
87
|
+
}
|
|
88
|
+
if (change.difference.composite.spacer !== undefined) {
|
|
89
|
+
format.setSpacer(change.difference.composite.spacer);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Merges source format units into the target format
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
export async function modifyFormatUnit(context, change, itemKey) {
|
|
98
|
+
const format = await context.targetSchema.lookupItem(itemKey);
|
|
99
|
+
const units = [];
|
|
100
|
+
for (const { name, label } of change.difference) {
|
|
101
|
+
const lookupKey = await updateSchemaItemKey(context, name);
|
|
102
|
+
const formatUnit = await context.editor.schemaContext.getSchemaItem(lookupKey);
|
|
103
|
+
if (formatUnit === undefined || (!Unit.isUnit(formatUnit) && !InvertedUnit.isInvertedUnit(formatUnit))) {
|
|
104
|
+
throw new Error(`Could not find format unit ${lookupKey.fullName} in the current context`);
|
|
105
|
+
}
|
|
106
|
+
units.push([formatUnit, label]);
|
|
107
|
+
}
|
|
108
|
+
format.setUnits(units);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Overrides format unit label
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
114
|
+
export async function modifyFormatUnitLabel(context, change, itemKey) {
|
|
115
|
+
const format = await context.targetSchema.lookupItem(itemKey);
|
|
116
|
+
if (format.units !== undefined) {
|
|
117
|
+
const unitKey = await updateSchemaItemKey(context, change.path);
|
|
118
|
+
/* eslint-disable @typescript-eslint/prefer-for-of */
|
|
119
|
+
for (let index = 0; index < format.units.length; index++) {
|
|
120
|
+
if (format.units[index][0].key.matches(unitKey)) {
|
|
121
|
+
format.units[index][1] = change.difference.label;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function parseFormatTraits(formatTraitsFromJson, formatName) {
|
|
127
|
+
let formatTraits = FormatTraits.Uninitialized;
|
|
128
|
+
const formatTraitIterable = Array.isArray(formatTraitsFromJson)
|
|
129
|
+
? formatTraitsFromJson
|
|
130
|
+
: formatTraitsFromJson.split(/,|;|\|/);
|
|
131
|
+
for (const formatTraitsString of formatTraitIterable) {
|
|
132
|
+
const formatTrait = parseFormatTrait(formatTraitsString, formatName);
|
|
133
|
+
formatTraits = formatTraits | formatTrait;
|
|
134
|
+
}
|
|
135
|
+
return formatTraits;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMapp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,SAAS,iBAAiB,CAAC,oBAAuC,EAAE,UAAkB;IACpF,IAAI,YAAY,GAAiB,YAAY,CAAC,aAAa,CAAC;IAC5D,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC;QAC7D,CAAC,CAAC,oBAAoB;QACtB,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzC,KAAK,MAAM,kBAAkB,IAAI,mBAAmB,EAAE,CAAC;QACrD,MAAM,WAAW,GAAG,gBAAgB,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;QACrE,YAAY,GAAG,YAAY,GAAG,WAAW,CAAC;IAC5C,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { InvertedUnit, SchemaItemKey, Unit } from \"@itwin/ecschema-metadata\";\nimport { FormatTraits, parseFormatTrait, parseScientificType, parseShowSignOption } from \"@itwin/core-quantity\";\nimport { FormatDifference, FormatUnitDifference, FormatUnitLabelDifference } from \"../Differencing/SchemaDifference\";\nimport { MutableFormat } from \"../Editing/Mutable/MutableFormat\";\nimport { SchemaMergeContext } from \"./SchemaMerger\";\nimport { updateSchemaItemFullName, updateSchemaItemKey } from \"./Utils\";\n\n/**\n * Merges a new Format into the target schema.\n * @internal\n */\nexport async function addFormat(context: SchemaMergeContext, change: FormatDifference) {\n if (change.difference.type === undefined) {\n throw new Error(\"Format must define type\");\n }\n\n if (change.difference.composite && change.difference.composite.units) {\n for (let index = 0; index < change.difference.composite.units.length; index++) {\n const compositeUnitName = await updateSchemaItemFullName(context, change.difference.composite.units[index].name);\n change.difference.composite.units[index] = {\n name: compositeUnitName,\n label: change.difference.composite.units[index].label,\n }\n }\n }\n\n await context.editor.formats.createFromProps(context.targetSchemaKey, {\n ...change.difference,\n name: change.itemName,\n schemaItemType: change.schemaType,\n type: change.difference.type,\n composite: change.difference.composite,\n });\n}\n\n/**\n * Merges differences to an existing Format in the target schema.\n * @internal\n */\nexport async function modifyFormat(context: SchemaMergeContext, change: FormatDifference, itemKey: SchemaItemKey) {\n const format = await context.targetSchema.lookupItem(itemKey) as MutableFormat;\n if (change.difference.type !== undefined) {\n throw new Error(`Changing the format '${change.itemName}' type is not supported.`);\n }\n\n if (change.difference.label !== undefined) {\n await context.editor.formats.setDisplayLabel(itemKey, change.difference.label);\n }\n if (change.difference.description !== undefined) {\n await context.editor.formats.setDescription(itemKey, change.difference.description);\n }\n if (change.difference.precision !== undefined) {\n format.setPrecision(change.difference.precision);\n }\n if (change.difference.roundFactor !== undefined) {\n format.setRoundFactor(change.difference.roundFactor);\n }\n if (change.difference.minWidth !== undefined) {\n format.setMinWidth(change.difference.minWidth);\n }\n if (change.difference.showSignOption !== undefined) {\n const showSignOption = parseShowSignOption(change.difference.showSignOption, change.itemName);\n format.setShowSignOption(showSignOption);\n }\n if (change.difference.formatTraits !== undefined) {\n const formatTraits = parseFormatTraits(change.difference.formatTraits, change.itemName);\n format.setFormatTraits(formatTraits);\n }\n if (change.difference.decimalSeparator !== undefined) {\n format.setDecimalSeparator(change.difference.decimalSeparator);\n }\n if (change.difference.thousandSeparator !== undefined) {\n format.setThousandSeparator(change.difference.thousandSeparator);\n }\n if (change.difference.uomSeparator !== undefined) {\n format.setUomSeparator(change.difference.uomSeparator);\n }\n if (change.difference.scientificType !== undefined) {\n const scientificType = parseScientificType(change.difference.scientificType, change.itemName);\n format.setScientificType(scientificType);\n }\n if (change.difference.stationOffsetSize !== undefined) {\n format.setStationOffsetSize(change.difference.stationOffsetSize);\n }\n if (change.difference.stationSeparator !== undefined) {\n format.setStationSeparator(change.difference.stationSeparator);\n }\n if (change.difference.composite !== undefined) {\n if (change.difference.composite.includeZero !== undefined) {\n format.setIncludeZero(change.difference.composite.includeZero);\n }\n if (change.difference.composite.spacer !== undefined) {\n format.setSpacer(change.difference.composite.spacer);\n }\n }\n}\n\n/**\n * Merges source format units into the target format\n * @internal\n*/\nexport async function modifyFormatUnit(context: SchemaMergeContext, change: FormatUnitDifference, itemKey: SchemaItemKey) {\n const format = await context.targetSchema.lookupItem(itemKey) as MutableFormat;\n\n const units: [Unit | InvertedUnit, string | undefined][] = [];\n for (const { name, label } of change.difference) {\n const lookupKey = await updateSchemaItemKey(context, name);\n const formatUnit = await context.editor.schemaContext.getSchemaItem(lookupKey);\n if (formatUnit === undefined || (!Unit.isUnit(formatUnit) && !InvertedUnit.isInvertedUnit(formatUnit))) {\n throw new Error(`Could not find format unit ${lookupKey.fullName} in the current context`);\n }\n units.push([formatUnit, label]);\n }\n format.setUnits(units);\n}\n\n/**\n * Overrides format unit label\n * @internal\n*/\nexport async function modifyFormatUnitLabel(context: SchemaMergeContext, change: FormatUnitLabelDifference, itemKey: SchemaItemKey) {\n const format = await context.targetSchema.lookupItem(itemKey) as MutableFormat;\n\n if (format.units !== undefined) {\n const unitKey = await updateSchemaItemKey(context, change.path);\n /* eslint-disable @typescript-eslint/prefer-for-of */\n for (let index = 0; index < format.units.length; index++) {\n if (format.units[index][0].key.matches(unitKey)) {\n format.units[index][1] = change.difference.label;\n }\n }\n }\n}\n\nfunction parseFormatTraits(formatTraitsFromJson: string | string[], formatName: string): FormatTraits {\n let formatTraits: FormatTraits = FormatTraits.Uninitialized;\n const formatTraitIterable = Array.isArray(formatTraitsFromJson)\n ? formatTraitsFromJson\n : formatTraitsFromJson.split(/,|;|\\|/);\n for (const formatTraitsString of formatTraitIterable) {\n const formatTrait = parseFormatTrait(formatTraitsString, formatName);\n formatTraits = formatTraits | formatTrait;\n }\n return formatTraits;\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SchemaItemKey } from "@itwin/ecschema-metadata";
|
|
2
|
+
import { InvertedUnitDifference } from "../Differencing/SchemaDifference";
|
|
3
|
+
import { SchemaMergeContext } from "./SchemaMerger";
|
|
4
|
+
/**
|
|
5
|
+
* Merges a new InvertedUnit into the target schema.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function addInvertedUnit(context: SchemaMergeContext, change: InvertedUnitDifference): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Merges differences to an existing InvertedUnit in the target schema.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function modifyInvertedUnit(context: SchemaMergeContext, change: InvertedUnitDifference, itemKey: SchemaItemKey): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=InvertedUnitMerger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvertedUnitMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/InvertedUnitMerger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGpD;;;GAGG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,sBAAsB,iBAkBhG;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,aAAa,iBAc3H"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { updateSchemaItemFullName } from "./Utils";
|
|
2
|
+
/**
|
|
3
|
+
* Merges a new InvertedUnit into the target schema.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export async function addInvertedUnit(context, change) {
|
|
7
|
+
if (change.difference.unitSystem === undefined) {
|
|
8
|
+
throw new Error("InvertedUnit must define unitSystem");
|
|
9
|
+
}
|
|
10
|
+
if (change.difference.invertsUnit === undefined) {
|
|
11
|
+
throw new Error("InvertedUnit must define invertsUnit");
|
|
12
|
+
}
|
|
13
|
+
change.difference.unitSystem = await updateSchemaItemFullName(context, change.difference.unitSystem);
|
|
14
|
+
change.difference.invertsUnit = await updateSchemaItemFullName(context, change.difference.invertsUnit);
|
|
15
|
+
await context.editor.invertedUnits.createFromProps(context.targetSchemaKey, {
|
|
16
|
+
...change.difference,
|
|
17
|
+
name: change.itemName,
|
|
18
|
+
schemaItemType: change.schemaType,
|
|
19
|
+
unitSystem: change.difference.unitSystem,
|
|
20
|
+
invertsUnit: change.difference.invertsUnit,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Merges differences to an existing InvertedUnit in the target schema.
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export async function modifyInvertedUnit(context, change, itemKey) {
|
|
28
|
+
if (change.difference.unitSystem !== undefined) {
|
|
29
|
+
throw new Error(`Changing the invertedUnit '${change.itemName}' unitSystem is not supported.`);
|
|
30
|
+
}
|
|
31
|
+
if (change.difference.invertsUnit !== undefined) {
|
|
32
|
+
throw new Error(`Changing the invertedUnit '${change.itemName}' invertsUnit is not supported.`);
|
|
33
|
+
}
|
|
34
|
+
if (change.difference.label !== undefined) {
|
|
35
|
+
await context.editor.invertedUnits.setDisplayLabel(itemKey, change.difference.label);
|
|
36
|
+
}
|
|
37
|
+
if (change.difference.description !== undefined) {
|
|
38
|
+
await context.editor.invertedUnits.setDescription(itemKey, change.difference.description);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=InvertedUnitMerger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvertedUnitMerger.js","sourceRoot":"","sources":["../../../src/Merging/InvertedUnitMerger.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAA2B,EAAE,MAA8B;IAC/F,IAAI,MAAM,CAA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AAK,SAAS,EAAE,CAAC;QAC1C,MAAM,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACvF,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QAChD,MAAM,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { SchemaItemKey } from \"@itwin/ecschema-metadata\";\nimport { InvertedUnitDifference } from \"../Differencing/SchemaDifference\";\nimport { SchemaMergeContext } from \"./SchemaMerger\";\nimport { updateSchemaItemFullName } from \"./Utils\";\n\n/**\n * Merges a new InvertedUnit into the target schema.\n * @internal\n */\nexport async function addInvertedUnit(context: SchemaMergeContext, change: InvertedUnitDifference) {\n if (change.difference.unitSystem === undefined) {\n throw new Error(\"InvertedUnit must define unitSystem\");\n }\n if (change.difference.invertsUnit === undefined) {\n throw new Error(\"InvertedUnit must define invertsUnit\");\n }\n\n change.difference.unitSystem = await updateSchemaItemFullName(context, change.difference.unitSystem);\n change.difference.invertsUnit = await updateSchemaItemFullName(context, change.difference.invertsUnit);\n\n await context.editor.invertedUnits.createFromProps(context.targetSchemaKey, {\n ...change.difference,\n name: change.itemName,\n schemaItemType: change.schemaType,\n unitSystem: change.difference.unitSystem,\n invertsUnit: change.difference.invertsUnit,\n });\n}\n\n/**\n * Merges differences to an existing InvertedUnit in the target schema.\n * @internal\n */\nexport async function modifyInvertedUnit(context: SchemaMergeContext, change: InvertedUnitDifference, itemKey: SchemaItemKey) {\n if (change.difference.unitSystem !== undefined) {\n throw new Error(`Changing the invertedUnit '${change.itemName}' unitSystem is not supported.`);\n }\n if (change.difference.invertsUnit !== undefined) {\n throw new Error(`Changing the invertedUnit '${change.itemName}' invertsUnit is not supported.`);\n }\n\n if (change.difference.label !== undefined) {\n await context.editor.invertedUnits.setDisplayLabel(itemKey, change.difference.label);\n }\n if (change.difference.description !== undefined) {\n await context.editor.invertedUnits.setDescription(itemKey, change.difference.description);\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { KindOfQuantityDifference, KindOfQuantityPresentationFormatDifference } from "../Differencing/SchemaDifference";
|
|
2
|
+
import type { SchemaMergeContext } from "./SchemaMerger";
|
|
3
|
+
import { SchemaItemKey } from "@itwin/ecschema-metadata";
|
|
4
|
+
/**
|
|
5
|
+
* Merges a new KindOfQuantity into the target schema.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function addKindOfQuantity(context: SchemaMergeContext, change: KindOfQuantityDifference): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Merges differences to an existing KindOfQuantity in the target schema.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function modifyKindOfQuantity(context: SchemaMergeContext, change: KindOfQuantityDifference, itemKey: SchemaItemKey): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Merges a new presentation format into the target kind of quantity
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function addPresentationFormat(context: SchemaMergeContext, change: KindOfQuantityPresentationFormatDifference, itemKey: SchemaItemKey): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=KindOfQuantityMerger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KindOfQuantityMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/KindOfQuantityMerger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,0CAA0C,EAAE,MAAM,kCAAkC,CAAC;AAE7H,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAwC,aAAa,EAAQ,MAAM,0BAA0B,CAAC;AAGrG;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,wBAAwB,iBA4BpG;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,wBAAwB,EAAE,OAAO,EAAE,aAAa,iBAe/H;AACD;;;EAGE;AACF,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,0CAA0C,EAAE,OAAO,EAAE,aAAa,iBASlJ"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { OverrideFormat } from "@itwin/ecschema-metadata";
|
|
2
|
+
import { updateSchemaItemFullName, updateSchemaItemKey } from "./Utils";
|
|
3
|
+
/**
|
|
4
|
+
* Merges a new KindOfQuantity into the target schema.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export async function addKindOfQuantity(context, change) {
|
|
8
|
+
if (change.difference.persistenceUnit === undefined) {
|
|
9
|
+
throw new Error("KindOfQuantity must define persistenceUnit");
|
|
10
|
+
}
|
|
11
|
+
if (change.difference.relativeError === undefined) {
|
|
12
|
+
throw new Error("KindOfQuantity must define relativeError");
|
|
13
|
+
}
|
|
14
|
+
change.difference.persistenceUnit = await updateSchemaItemFullName(context, change.difference.persistenceUnit);
|
|
15
|
+
if (change.difference.presentationUnits) {
|
|
16
|
+
if (Array.isArray(change.difference.presentationUnits)) {
|
|
17
|
+
for (let index = 0; index < change.difference.presentationUnits.length; index++) {
|
|
18
|
+
const presentationFormat = await updateOverrideFormat(context, change.difference.presentationUnits[index]);
|
|
19
|
+
change.difference.presentationUnits[index] = presentationFormat.fullName;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const presentationFormat = await updateOverrideFormat(context, change.difference.presentationUnits);
|
|
24
|
+
change.difference.presentationUnits = presentationFormat.name;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
await context.editor.kindOfQuantities.createFromProps(context.targetSchemaKey, {
|
|
28
|
+
...change.difference,
|
|
29
|
+
name: change.itemName,
|
|
30
|
+
schemaItemType: change.schemaType,
|
|
31
|
+
persistenceUnit: change.difference.persistenceUnit,
|
|
32
|
+
presentationUnits: change.difference.presentationUnits,
|
|
33
|
+
relativeError: change.difference.relativeError,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Merges differences to an existing KindOfQuantity in the target schema.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export async function modifyKindOfQuantity(context, change, itemKey) {
|
|
41
|
+
const kindOfQuantity = await context.targetSchema.lookupItem(itemKey);
|
|
42
|
+
if (change.difference.label !== undefined) {
|
|
43
|
+
await context.editor.kindOfQuantities.setDisplayLabel(itemKey, change.difference.label);
|
|
44
|
+
}
|
|
45
|
+
if (change.difference.description !== undefined) {
|
|
46
|
+
await context.editor.kindOfQuantities.setDescription(itemKey, change.difference.description);
|
|
47
|
+
}
|
|
48
|
+
if (change.difference.relativeError !== undefined) {
|
|
49
|
+
kindOfQuantity.setRelativeError(change.difference.relativeError);
|
|
50
|
+
}
|
|
51
|
+
if (change.difference.persistenceUnit !== undefined) {
|
|
52
|
+
// TODO: It should be checked if the unit is the same, but referring to the source schema.
|
|
53
|
+
throw new Error(`Changing the kind of quantity '${change.itemName}' persistenceUnit is not supported.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Merges a new presentation format into the target kind of quantity
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
export async function addPresentationFormat(context, change, itemKey) {
|
|
61
|
+
for (const formatString of change.difference) {
|
|
62
|
+
const presentationFormat = await updateOverrideFormat(context, formatString);
|
|
63
|
+
if (OverrideFormat.isOverrideFormat(presentationFormat)) {
|
|
64
|
+
await context.editor.kindOfQuantities.addPresentationOverrideFormat(itemKey, presentationFormat);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
await context.editor.kindOfQuantities.addPresentationFormat(itemKey, presentationFormat.key);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async function updateOverrideFormat(context, formatString) {
|
|
72
|
+
// https://www.itwinjs.org/v1/bis/ec/kindofquantity/#format-string
|
|
73
|
+
const match = OverrideFormat.parseFormatString(formatString);
|
|
74
|
+
const formatKey = await updateSchemaItemKey(context, match.name);
|
|
75
|
+
const format = await context.targetSchema.lookupItem(formatKey);
|
|
76
|
+
if (undefined === match.precision && undefined === match.unitAndLabels)
|
|
77
|
+
return format;
|
|
78
|
+
let unitAndLabels;
|
|
79
|
+
if (undefined !== match.unitAndLabels) {
|
|
80
|
+
unitAndLabels = [];
|
|
81
|
+
for (const unitOverride of match.unitAndLabels) {
|
|
82
|
+
const unitKey = await updateSchemaItemKey(context, unitOverride[0]);
|
|
83
|
+
const unit = await context.targetSchema.lookupItem(unitKey);
|
|
84
|
+
unitAndLabels.push([unit, unitOverride[1]]);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return context.editor.kindOfQuantities.createFormatOverride(formatKey, match.precision, unitAndLabels);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=KindOfQuantityMerger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KindOfQuantityMerger.js","sourceRoot":"","sources":["../../../src/Merging/KindOfQuantityMerger.ts"],"names":[],"mappings":"AAOA,OAAO,EAAwB,cAAc,EAAuB,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAExE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAA2B,EAAE,MAAgC;IACnG,IAAI,MAAM,CAAC,UAAU,CAAC,eAAe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,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AACzG,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { KindOfQuantityDifference, KindOfQuantityPresentationFormatDifference } from \"../Differencing/SchemaDifference\";\nimport type { MutableKindOfQuantity } from \"../Editing/Mutable/MutableKindOfQuantity\";\nimport type { SchemaMergeContext } from \"./SchemaMerger\";\nimport { Format, InvertedUnit, OverrideFormat, SchemaItemKey, Unit } from \"@itwin/ecschema-metadata\";\nimport { updateSchemaItemFullName, updateSchemaItemKey } from \"./Utils\";\n\n/**\n * Merges a new KindOfQuantity into the target schema.\n * @internal\n */\nexport async function addKindOfQuantity(context: SchemaMergeContext, change: KindOfQuantityDifference) {\n if (change.difference.persistenceUnit === undefined) {\n throw new Error(\"KindOfQuantity must define persistenceUnit\");\n }\n if (change.difference.relativeError === undefined) {\n throw new Error(\"KindOfQuantity must define relativeError\");\n }\n change.difference.persistenceUnit = await updateSchemaItemFullName(context, change.difference.persistenceUnit);\n if(change.difference.presentationUnits) {\n if(Array.isArray(change.difference.presentationUnits)) {\n for(let index = 0; index < change.difference.presentationUnits.length; index++) {\n const presentationFormat = await updateOverrideFormat(context, change.difference.presentationUnits[index]);\n change.difference.presentationUnits[index] = presentationFormat.fullName;\n }\n } else {\n const presentationFormat = await updateOverrideFormat(context, change.difference.presentationUnits);\n change.difference.presentationUnits = presentationFormat.name;\n }\n }\n\n await context.editor.kindOfQuantities.createFromProps(context.targetSchemaKey, {\n ...change.difference,\n name: change.itemName,\n schemaItemType: change.schemaType,\n persistenceUnit: change.difference.persistenceUnit,\n presentationUnits: change.difference.presentationUnits,\n relativeError: change.difference.relativeError,\n });\n}\n\n/**\n * Merges differences to an existing KindOfQuantity in the target schema.\n * @internal\n */\nexport async function modifyKindOfQuantity(context: SchemaMergeContext, change: KindOfQuantityDifference, itemKey: SchemaItemKey) {\n const kindOfQuantity = await context.targetSchema.lookupItem(itemKey) as MutableKindOfQuantity;\n if(change.difference.label !== undefined) {\n await context.editor.kindOfQuantities.setDisplayLabel(itemKey, change.difference.label);\n }\n if(change.difference.description !== undefined) {\n await context.editor.kindOfQuantities.setDescription(itemKey, change.difference.description);\n }\n if(change.difference.relativeError !== undefined) {\n kindOfQuantity.setRelativeError(change.difference.relativeError);\n }\n if(change.difference.persistenceUnit !== undefined) {\n // TODO: It should be checked if the unit is the same, but referring to the source schema.\n throw new Error(`Changing the kind of quantity '${change.itemName}' persistenceUnit is not supported.`);\n }\n}\n/**\n * Merges a new presentation format into the target kind of quantity\n * @internal\n*/\nexport async function addPresentationFormat(context: SchemaMergeContext, change: KindOfQuantityPresentationFormatDifference, itemKey: SchemaItemKey) {\n for (const formatString of change.difference) {\n const presentationFormat = await updateOverrideFormat(context, formatString);\n if (OverrideFormat.isOverrideFormat(presentationFormat)) {\n await context.editor.kindOfQuantities.addPresentationOverrideFormat(itemKey, presentationFormat);\n } else {\n await context.editor.kindOfQuantities.addPresentationFormat(itemKey, presentationFormat.key);\n }\n }\n}\n\nasync function updateOverrideFormat(context: SchemaMergeContext, formatString: string): Promise<Format | OverrideFormat> {\n // https://www.itwinjs.org/v1/bis/ec/kindofquantity/#format-string\n const match = OverrideFormat.parseFormatString(formatString);\n const formatKey = await updateSchemaItemKey(context, match.name);\n const format = await context.targetSchema.lookupItem(formatKey) as Format;\n\n if (undefined === match.precision && undefined === match.unitAndLabels)\n return format;\n\n let unitAndLabels: Array<[Unit | InvertedUnit, string | undefined]> | undefined;\n if (undefined !== match.unitAndLabels) {\n unitAndLabels = [];\n for (const unitOverride of match.unitAndLabels) {\n const unitKey = await updateSchemaItemKey(context, unitOverride[0]);\n const unit = await context.targetSchema.lookupItem(unitKey) as Unit | InvertedUnit;\n unitAndLabels.push([unit, unitOverride[1]]);\n }\n }\n return context.editor.kindOfQuantities.createFormatOverride(formatKey, match.precision, unitAndLabels);\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MixinClassDifference } from "../Differencing/SchemaDifference";
|
|
2
|
+
import type { SchemaMergeContext } from "./SchemaMerger";
|
|
3
|
+
import type { SchemaItemKey } from "@itwin/ecschema-metadata";
|
|
4
|
+
/**
|
|
5
|
+
* Merges a new Mixin into the target schema.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function addMixinClass(context: SchemaMergeContext, change: MixinClassDifference): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Merges differences to an existing Mixin in the target schema.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function modifyMixinClass(context: SchemaMergeContext, change: MixinClassDifference, itemKey: SchemaItemKey): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=MixinMerger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MixinMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/MixinMerger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D;;;GAGG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,oBAAoB,iBAU5F;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,aAAa,iBAWvH"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { updateSchemaItemFullName, updateSchemaItemKey } from "./Utils";
|
|
2
|
+
import { modifyClass } from "./ClassMerger";
|
|
3
|
+
/**
|
|
4
|
+
* Merges a new Mixin into the target schema.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export async function addMixinClass(context, change) {
|
|
8
|
+
if (change.difference.appliesTo === undefined) {
|
|
9
|
+
throw new Error("Mixin must define appliesTo");
|
|
10
|
+
}
|
|
11
|
+
await context.editor.mixins.createFromProps(context.targetSchemaKey, {
|
|
12
|
+
...change.difference,
|
|
13
|
+
name: change.itemName,
|
|
14
|
+
schemaItemType: change.schemaType,
|
|
15
|
+
appliesTo: await updateSchemaItemFullName(context, change.difference.appliesTo),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Merges differences to an existing Mixin in the target schema.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export async function modifyMixinClass(context, change, itemKey) {
|
|
23
|
+
const mixin = await context.targetSchema.lookupItem(itemKey);
|
|
24
|
+
if (change.difference.appliesTo !== undefined) {
|
|
25
|
+
const appliesTo = await updateSchemaItemKey(context, change.difference.appliesTo);
|
|
26
|
+
const currentValue = await mixin.appliesTo;
|
|
27
|
+
if (currentValue !== undefined && !appliesTo.matches(currentValue.key)) {
|
|
28
|
+
throw new Error(`Changing the mixin '${change.itemName}' appliesTo is not supported.`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return modifyClass(context, change, itemKey, mixin);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=MixinMerger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MixinMerger.js","sourceRoot":"","sources":["../../../src/Merging/MixinMerger.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAA2B,EAAE,MAA4B;IAC3F,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IACD,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,eAAe,EAAE;QACnE,GAAG,MAAM,CAAC,UAAU;QACpB,IAAI,EAAE,MAAM,CAAC,QAAQ;QACrB,cAAc,EAAE,MAAM,CAAC,UAAU;QACjC,SAAS,EAAE,MAAM,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC;KAChF,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAA2B,EAAE,MAA4B,EAAE,OAAsB;IACtH,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAiB,CAAC;IAC7E,IAAG,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC7C,MAAM,SAAS,GAAG,MAAM,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAClF,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC;QAC3C,IAAI,YAAY,KAAK,SAAS,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YACvE,MAAM,IAAI,KAAK,CAAC,uBAAuB,MAAM,CAAC,QAAQ,+BAA+B,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { MixinClassDifference } from \"../Differencing/SchemaDifference\";\nimport type { MutableMixin } from \"../Editing/Mutable/MutableMixin\";\nimport type { SchemaMergeContext } from \"./SchemaMerger\";\nimport type { SchemaItemKey } from \"@itwin/ecschema-metadata\";\nimport { updateSchemaItemFullName, updateSchemaItemKey } from \"./Utils\";\nimport { modifyClass } from \"./ClassMerger\";\n\n/**\n * Merges a new Mixin into the target schema.\n * @internal\n */\nexport async function addMixinClass(context: SchemaMergeContext, change: MixinClassDifference) {\n if (change.difference.appliesTo === undefined) {\n throw new Error(\"Mixin must define appliesTo\");\n }\n await context.editor.mixins.createFromProps(context.targetSchemaKey, {\n ...change.difference,\n name: change.itemName,\n schemaItemType: change.schemaType,\n appliesTo: await updateSchemaItemFullName(context, change.difference.appliesTo),\n });\n}\n\n/**\n * Merges differences to an existing Mixin in the target schema.\n * @internal\n */\nexport async function modifyMixinClass(context: SchemaMergeContext, change: MixinClassDifference, itemKey: SchemaItemKey) {\n const mixin = await context.targetSchema.lookupItem(itemKey) as MutableMixin;\n if(change.difference.appliesTo !== undefined) {\n const appliesTo = await updateSchemaItemKey(context, change.difference.appliesTo);\n const currentValue = await mixin.appliesTo;\n if (currentValue !== undefined && !appliesTo.matches(currentValue.key)) {\n throw new Error(`Changing the mixin '${change.itemName}' appliesTo is not supported.`);\n }\n }\n\n return modifyClass(context, change, itemKey, mixin);\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PhenomenonDifference } from "../Differencing/SchemaDifference";
|
|
2
|
+
import type { SchemaMergeContext } from "./SchemaMerger";
|
|
3
|
+
import { type SchemaItemKey } from "@itwin/ecschema-metadata";
|
|
4
|
+
/**
|
|
5
|
+
* Merges a new Phenomenon into the target schema.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function addPhenomenon(context: SchemaMergeContext, change: PhenomenonDifference): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Merges differences to an existing Phenomenon in the target schema.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function modifyPhenomenon(context: SchemaMergeContext, change: PhenomenonDifference, itemKey: SchemaItemKey): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=PhenomenonMerger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhenomenonMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/PhenomenonMerger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAmC,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE/F;;;GAGG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,oBAAoB,iBAW5F;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,aAAa,iBAgBvH"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ECObjectsError, ECObjectsStatus } from "@itwin/ecschema-metadata";
|
|
2
|
+
/**
|
|
3
|
+
* Merges a new Phenomenon into the target schema.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export async function addPhenomenon(context, change) {
|
|
7
|
+
if (change.difference.definition === undefined) {
|
|
8
|
+
throw new Error("Phenomenon must define definition");
|
|
9
|
+
}
|
|
10
|
+
await context.editor.phenomenons.createFromProps(context.targetSchemaKey, {
|
|
11
|
+
...change.difference,
|
|
12
|
+
name: change.itemName,
|
|
13
|
+
schemaItemType: change.schemaType,
|
|
14
|
+
definition: change.difference.definition,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Merges differences to an existing Phenomenon in the target schema.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export async function modifyPhenomenon(context, change, itemKey) {
|
|
22
|
+
const phenomenon = await context.targetSchema.lookupItem(itemKey);
|
|
23
|
+
if (change.difference.label !== undefined) {
|
|
24
|
+
await context.editor.phenomenons.setDisplayLabel(itemKey, change.difference.label);
|
|
25
|
+
}
|
|
26
|
+
if (change.difference.description !== undefined) {
|
|
27
|
+
await context.editor.phenomenons.setDescription(itemKey, change.difference.description);
|
|
28
|
+
}
|
|
29
|
+
if (change.difference.definition !== undefined) {
|
|
30
|
+
// It would be better if the validation would be part of phenomenon.setDefinition.
|
|
31
|
+
if (phenomenon.definition !== "" && change.difference.definition.toLowerCase() !== phenomenon.definition.toLowerCase())
|
|
32
|
+
throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Phenomenon ${change.itemName} has an invalid 'definition' attribute.`);
|
|
33
|
+
await phenomenon.setDefinition(change.difference.definition);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=PhenomenonMerger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhenomenonMerger.js","sourceRoot":"","sources":["../../../src/Merging/PhenomenonMerger.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAsB,MAAM,0BAA0B,CAAC;AAE/F;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAA2B,EAAE,MAA4B;IAC3F,IAAI,MAAM,CAAC,UAAU,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,eAAe,EAAE;QACxE,GAAG,MAAM,CAAC,UAAU;QACpB,IAAI,EAAE,MAAM,CAAC,QAAQ;QACrB,cAAc,EAAE,MAAM,CAAC,UAAU;QACjC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU;KACzC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAA2B,EAAE,MAA4B,EAAE,OAAsB;IACtH,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAsB,CAAC;IACvF,IAAG,MAAM,CAAC,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACzC,MAAM,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACrF,CAAC;IACD,IAAG,MAAM,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QAC/C,MAAM,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC1F,CAAC;IAED,IAAG,MAAM,CAAC,UAAU,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAC9C,kFAAkF;QAClF,IAAI,UAAU,CAAC,UAAU,KAAK,EAAE,IAAI,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE;YACpH,MAAM,IAAI,cAAc,CAAC,eAAe,CAAC,aAAa,EAAE,kBAAkB,MAAM,CAAC,QAAQ,yCAAyC,CAAC,CAAC;QAEtI,MAAM,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { PhenomenonDifference } from \"../Differencing/SchemaDifference\";\nimport type { MutablePhenomenon } from \"../Editing/Mutable/MutablePhenomenon\";\nimport type { SchemaMergeContext } from \"./SchemaMerger\";\nimport { ECObjectsError, ECObjectsStatus, type SchemaItemKey } from \"@itwin/ecschema-metadata\";\n\n/**\n * Merges a new Phenomenon into the target schema.\n * @internal\n */\nexport async function addPhenomenon(context: SchemaMergeContext, change: PhenomenonDifference) {\n if (change.difference.definition === undefined) {\n throw new Error(\"Phenomenon must define definition\");\n }\n\n await context.editor.phenomenons.createFromProps(context.targetSchemaKey, {\n ...change.difference,\n name: change.itemName,\n schemaItemType: change.schemaType,\n definition: change.difference.definition,\n });\n}\n\n/**\n * Merges differences to an existing Phenomenon in the target schema.\n * @internal\n */\nexport async function modifyPhenomenon(context: SchemaMergeContext, change: PhenomenonDifference, itemKey: SchemaItemKey) {\n const phenomenon = await context.targetSchema.lookupItem(itemKey) as MutablePhenomenon;\n if(change.difference.label !== undefined) {\n await context.editor.phenomenons.setDisplayLabel(itemKey, change.difference.label);\n }\n if(change.difference.description !== undefined) {\n await context.editor.phenomenons.setDescription(itemKey, change.difference.description);\n }\n\n if(change.difference.definition !== undefined) {\n // It would be better if the validation would be part of phenomenon.setDefinition.\n if (phenomenon.definition !== \"\" && change.difference.definition.toLowerCase() !== phenomenon.definition.toLowerCase())\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Phenomenon ${change.itemName} has an invalid 'definition' attribute.`);\n\n await phenomenon.setDefinition(change.difference.definition);\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PropertyCategoryDifference } from "../Differencing/SchemaDifference";
|
|
2
|
+
import type { SchemaMergeContext } from "./SchemaMerger";
|
|
3
|
+
import type { SchemaItemKey } from "@itwin/ecschema-metadata";
|
|
4
|
+
/**
|
|
5
|
+
* Merges a new PropertyCategory into the target schema.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function addPropertyCategory(context: SchemaMergeContext, change: PropertyCategoryDifference): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Merges differences to an existing PropertyCategory in the target schema.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function modifyPropertyCategory(context: SchemaMergeContext, change: PropertyCategoryDifference, itemKey: SchemaItemKey): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=PropertyCategoryMerger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyCategoryMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/PropertyCategoryMerger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,0BAA0B,iBAWxG;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,0BAA0B,EAAE,OAAO,EAAE,aAAa,iBAUnI"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merges a new PropertyCategory into the target schema.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export async function addPropertyCategory(context, change) {
|
|
6
|
+
if (change.difference.priority === undefined) {
|
|
7
|
+
throw new Error("PropertyCategory must define priority");
|
|
8
|
+
}
|
|
9
|
+
await context.editor.propertyCategories.createFromProps(context.targetSchemaKey, {
|
|
10
|
+
...change.difference,
|
|
11
|
+
name: change.itemName,
|
|
12
|
+
schemaItemType: change.schemaType,
|
|
13
|
+
priority: change.difference.priority,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Merges differences to an existing PropertyCategory in the target schema.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export async function modifyPropertyCategory(context, change, itemKey) {
|
|
21
|
+
if (change.difference.label !== undefined) {
|
|
22
|
+
await context.editor.propertyCategories.setDisplayLabel(itemKey, change.difference.label);
|
|
23
|
+
}
|
|
24
|
+
if (change.difference.description !== undefined) {
|
|
25
|
+
await context.editor.propertyCategories.setDescription(itemKey, change.difference.description);
|
|
26
|
+
}
|
|
27
|
+
if (change.difference.priority !== undefined) {
|
|
28
|
+
await context.editor.propertyCategories.setPriority(itemKey, change.difference.priority);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=PropertyCategoryMerger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyCategoryMerger.js","sourceRoot":"","sources":["../../../src/Merging/PropertyCategoryMerger.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAA2B,EAAE,MAAkC;IACvG,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC,eAAe,EAAE;QAC/E,GAAG,MAAM,CAAC,UAAU;QACpB,IAAI,EAAE,MAAM,CAAC,QAAQ;QACrB,cAAc,EAAE,MAAM,CAAC,UAAU;QACjC,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ;KACrC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,OAA2B,EAAE,MAAkC,EAAE,OAAsB;IAClI,IAAG,MAAM,CAAC,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACzC,MAAM,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAC5F,CAAC;IACD,IAAG,MAAM,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QAC/C,MAAM,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACjG,CAAC;IACD,IAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5C,MAAM,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC3F,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { PropertyCategoryDifference } from \"../Differencing/SchemaDifference\";\nimport type { SchemaMergeContext } from \"./SchemaMerger\";\nimport type { SchemaItemKey } from \"@itwin/ecschema-metadata\";\n\n/**\n * Merges a new PropertyCategory into the target schema.\n * @internal\n */\nexport async function addPropertyCategory(context: SchemaMergeContext, change: PropertyCategoryDifference) {\n if (change.difference.priority === undefined) {\n throw new Error(\"PropertyCategory must define priority\");\n }\n\n await context.editor.propertyCategories.createFromProps(context.targetSchemaKey, {\n ...change.difference,\n name: change.itemName,\n schemaItemType: change.schemaType,\n priority: change.difference.priority,\n });\n}\n\n/**\n * Merges differences to an existing PropertyCategory in the target schema.\n * @internal\n */\nexport async function modifyPropertyCategory(context: SchemaMergeContext, change: PropertyCategoryDifference, itemKey: SchemaItemKey) {\n if(change.difference.label !== undefined) {\n await context.editor.propertyCategories.setDisplayLabel(itemKey, change.difference.label);\n }\n if(change.difference.description !== undefined) {\n await context.editor.propertyCategories.setDescription(itemKey, change.difference.description);\n }\n if(change.difference.priority !== undefined) {\n await context.editor.propertyCategories.setPriority(itemKey, change.difference.priority);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SchemaMergeContext } from "./SchemaMerger";
|
|
2
|
+
import type { AnyClassItemDifference, ClassPropertyDifference } from "../Differencing/SchemaDifference";
|
|
3
|
+
import { SchemaItemKey } from "@itwin/ecschema-metadata";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function mergePropertyDifference(context: SchemaMergeContext, change: ClassPropertyDifference): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function mergeClassProperties(context: SchemaMergeContext, change: AnyClassItemDifference, itemKey: SchemaItemKey): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=PropertyMerger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/PropertyMerger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAkB,MAAM,kCAAkC,CAAC;AACxH,OAAO,EAA8M,aAAa,EAAoD,MAAM,0BAA0B,CAAC;AAevT;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzH;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7I"}
|