@itwin/ecschema-editing 5.0.0-dev.9 → 5.0.0-dev.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -1
- package/lib/cjs/Differencing/Errors.js +6 -0
- package/lib/cjs/Differencing/Errors.js.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.d.ts +3 -1
- package/lib/cjs/Differencing/SchemaConflicts.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.js +2 -0
- package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +4 -3
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +57 -11
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.d.ts +33 -4
- package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.js +55 -5
- package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts +2 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js +78 -19
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.js +5 -0
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.js.map +1 -1
- package/lib/cjs/Differencing/Utils.js.map +1 -1
- package/lib/cjs/Editing/Constants.d.ts +2 -1
- package/lib/cjs/Editing/Constants.d.ts.map +1 -1
- package/lib/cjs/Editing/Constants.js +4 -1
- package/lib/cjs/Editing/Constants.js.map +1 -1
- package/lib/cjs/Editing/CustomAttributes.d.ts +2 -1
- package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -1
- package/lib/cjs/Editing/CustomAttributes.js +3 -0
- package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
- package/lib/cjs/Editing/ECClasses.d.ts +6 -1
- package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
- package/lib/cjs/Editing/ECClasses.js +48 -49
- package/lib/cjs/Editing/ECClasses.js.map +1 -1
- package/lib/cjs/Editing/Editor.d.ts +2 -2
- package/lib/cjs/Editing/Editor.d.ts.map +1 -1
- package/lib/cjs/Editing/Editor.js +32 -21
- package/lib/cjs/Editing/Editor.js.map +1 -1
- package/lib/cjs/Editing/Entities.d.ts +2 -1
- package/lib/cjs/Editing/Entities.d.ts.map +1 -1
- package/lib/cjs/Editing/Entities.js +18 -14
- package/lib/cjs/Editing/Entities.js.map +1 -1
- package/lib/cjs/Editing/Enumerations.d.ts +2 -1
- package/lib/cjs/Editing/Enumerations.d.ts.map +1 -1
- package/lib/cjs/Editing/Enumerations.js +6 -3
- package/lib/cjs/Editing/Enumerations.js.map +1 -1
- package/lib/cjs/Editing/Exception.js +35 -6
- package/lib/cjs/Editing/Exception.js.map +1 -1
- package/lib/cjs/Editing/Formats.d.ts +2 -1
- package/lib/cjs/Editing/Formats.d.ts.map +1 -1
- package/lib/cjs/Editing/Formats.js +5 -1
- package/lib/cjs/Editing/Formats.js.map +1 -1
- package/lib/cjs/Editing/InvertedUnits.d.ts +2 -1
- package/lib/cjs/Editing/InvertedUnits.d.ts.map +1 -1
- package/lib/cjs/Editing/InvertedUnits.js +10 -6
- package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.d.ts +2 -1
- package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.js +11 -7
- package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
- package/lib/cjs/Editing/Mixins.d.ts +2 -1
- package/lib/cjs/Editing/Mixins.d.ts.map +1 -1
- package/lib/cjs/Editing/Mixins.js +13 -9
- package/lib/cjs/Editing/Mixins.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableArrayProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableCAClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableClass.d.ts +2 -1
- package/lib/cjs/Editing/Mutable/MutableClass.d.ts.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableConstant.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableEnumeration.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.d.ts +8 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.d.ts.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableMixin.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableNavigationProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePhenomenon.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableSchemaItem.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableStructProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableUnit.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableUnitSystem.js.map +1 -1
- package/lib/cjs/Editing/Phenomena.d.ts +2 -1
- package/lib/cjs/Editing/Phenomena.d.ts.map +1 -1
- package/lib/cjs/Editing/Phenomena.js +3 -0
- package/lib/cjs/Editing/Phenomena.js.map +1 -1
- package/lib/cjs/Editing/Properties.d.ts +2 -2
- package/lib/cjs/Editing/Properties.d.ts.map +1 -1
- package/lib/cjs/Editing/Properties.js +6 -4
- package/lib/cjs/Editing/Properties.js.map +1 -1
- package/lib/cjs/Editing/PropertyCategories.d.ts +2 -1
- package/lib/cjs/Editing/PropertyCategories.d.ts.map +1 -1
- package/lib/cjs/Editing/PropertyCategories.js +5 -1
- package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
- package/lib/cjs/Editing/RelationshipClasses.d.ts +1 -0
- package/lib/cjs/Editing/RelationshipClasses.d.ts.map +1 -1
- package/lib/cjs/Editing/RelationshipClasses.js +17 -10
- package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
- package/lib/cjs/Editing/SchemaItems.d.ts +2 -2
- package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -1
- package/lib/cjs/Editing/SchemaItems.js +8 -11
- package/lib/cjs/Editing/SchemaItems.js.map +1 -1
- package/lib/cjs/Editing/Structs.d.ts +2 -1
- package/lib/cjs/Editing/Structs.d.ts.map +1 -1
- package/lib/cjs/Editing/Structs.js +3 -0
- package/lib/cjs/Editing/Structs.js.map +1 -1
- package/lib/cjs/Editing/UnitSystems.d.ts +2 -1
- package/lib/cjs/Editing/UnitSystems.d.ts.map +1 -1
- package/lib/cjs/Editing/UnitSystems.js +3 -0
- package/lib/cjs/Editing/UnitSystems.js.map +1 -1
- package/lib/cjs/Editing/Units.d.ts +2 -1
- package/lib/cjs/Editing/Units.d.ts.map +1 -1
- package/lib/cjs/Editing/Units.js +5 -2
- package/lib/cjs/Editing/Units.js.map +1 -1
- package/lib/cjs/Merging/ClassMerger.js.map +1 -1
- package/lib/cjs/Merging/ConstantMerger.js +4 -4
- package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeClassMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.js +7 -6
- package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
- package/lib/cjs/Merging/Edits/NameMapping.d.ts +22 -0
- package/lib/cjs/Merging/Edits/NameMapping.d.ts.map +1 -0
- package/lib/cjs/Merging/Edits/NameMapping.js +54 -0
- package/lib/cjs/Merging/Edits/NameMapping.js.map +1 -0
- package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts +1 -1
- package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts.map +1 -1
- package/lib/cjs/Merging/Edits/RenameEditHandler.js +1 -260
- package/lib/cjs/Merging/Edits/RenameEditHandler.js.map +1 -1
- package/lib/cjs/Merging/Edits/SchemaEdits.d.ts +9 -6
- package/lib/cjs/Merging/Edits/SchemaEdits.d.ts.map +1 -1
- package/lib/cjs/Merging/Edits/SchemaEdits.js +19 -14
- package/lib/cjs/Merging/Edits/SchemaEdits.js.map +1 -1
- package/lib/cjs/Merging/Edits/SkipEditHandler.js.map +1 -1
- package/lib/cjs/Merging/EntityClassMerger.js +1 -2
- package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumeratorMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/EnumeratorMerger.js +2 -2
- package/lib/cjs/Merging/EnumeratorMerger.js.map +1 -1
- package/lib/cjs/Merging/FormatMerger.d.ts +24 -0
- package/lib/cjs/Merging/FormatMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/FormatMerger.js +143 -0
- package/lib/cjs/Merging/FormatMerger.js.map +1 -0
- package/lib/cjs/Merging/InvertedUnitMerger.d.ts +14 -0
- package/lib/cjs/Merging/InvertedUnitMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/InvertedUnitMerger.js +45 -0
- package/lib/cjs/Merging/InvertedUnitMerger.js.map +1 -0
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.js +4 -5
- package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
- package/lib/cjs/Merging/MixinMerger.js +1 -1
- package/lib/cjs/Merging/MixinMerger.js.map +1 -1
- package/lib/cjs/Merging/PhenomenonMerger.js +1 -1
- package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyCategoryMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyMerger.js +28 -26
- package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.js +4 -4
- package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.d.ts +5 -3
- package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.js +45 -5
- package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts +14 -8
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.js +42 -17
- package/lib/cjs/Merging/SchemaMergingVisitor.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.js +2 -0
- package/lib/cjs/Merging/SchemaMergingWalker.js.map +1 -1
- package/lib/cjs/Merging/SchemaReferenceMerger.js.map +1 -1
- package/lib/cjs/Merging/StructClassMerger.js.map +1 -1
- package/lib/cjs/Merging/UnitMerger.d.ts +14 -0
- package/lib/cjs/Merging/UnitMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/UnitMerger.js +62 -0
- package/lib/cjs/Merging/UnitMerger.js.map +1 -0
- package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -1
- package/lib/cjs/Merging/Utils.d.ts +11 -0
- package/lib/cjs/Merging/Utils.d.ts.map +1 -1
- package/lib/cjs/Merging/Utils.js +23 -3
- package/lib/cjs/Merging/Utils.js.map +1 -1
- package/lib/cjs/Validation/Diagnostic.js +18 -16
- package/lib/cjs/Validation/Diagnostic.js.map +1 -1
- package/lib/cjs/Validation/DiagnosticReporter.js +4 -1
- package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
- package/lib/cjs/Validation/ECRules.js +1 -1
- package/lib/cjs/Validation/ECRules.js.map +1 -1
- package/lib/cjs/Validation/LoggingDiagnosticReporter.js.map +1 -1
- package/lib/cjs/Validation/RuleSuppressionSet.js.map +1 -1
- package/lib/cjs/Validation/Rules.js.map +1 -1
- package/lib/cjs/Validation/SchemaChanges.js +39 -69
- package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareDiagnostics.d.ts +2 -2
- package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js +4 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareVisitor.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaCompareVisitor.js +23 -23
- package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.d.ts +22 -1
- package/lib/cjs/Validation/SchemaComparer.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.js +30 -5
- package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
- package/lib/cjs/Validation/SchemaValidater.js +1 -4
- package/lib/cjs/Validation/SchemaValidater.js.map +1 -1
- package/lib/cjs/Validation/SchemaValidationVisitor.js +3 -4
- package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.js +6 -4
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
- package/lib/cjs/ecschema-editing.js.map +1 -1
- package/lib/esm/Differencing/Errors.d.ts +19 -0
- package/lib/esm/Differencing/Errors.d.ts.map +1 -0
- package/lib/esm/Differencing/Errors.js +26 -0
- package/lib/esm/Differencing/Errors.js.map +1 -0
- package/lib/esm/Differencing/SchemaConflicts.d.ts +84 -0
- package/lib/esm/Differencing/SchemaConflicts.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaConflicts.js +60 -0
- package/lib/esm/Differencing/SchemaConflicts.js.map +1 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.d.ts +41 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.js +443 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.js.map +1 -0
- package/lib/esm/Differencing/SchemaDifference.d.ts +357 -0
- package/lib/esm/Differencing/SchemaDifference.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDifference.js +106 -0
- package/lib/esm/Differencing/SchemaDifference.js.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.d.ts +18 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.js +521 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.js.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.d.ts +32 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.js +88 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.js.map +1 -0
- package/lib/esm/Differencing/Utils.d.ts +110 -0
- package/lib/esm/Differencing/Utils.d.ts.map +1 -0
- package/lib/esm/Differencing/Utils.js +161 -0
- package/lib/esm/Differencing/Utils.js.map +1 -0
- package/lib/esm/Editing/Constants.d.ts +22 -0
- package/lib/esm/Editing/Constants.d.ts.map +1 -0
- package/lib/esm/Editing/Constants.js +55 -0
- package/lib/esm/Editing/Constants.js.map +1 -0
- package/lib/esm/Editing/CustomAttributes.d.ts +22 -0
- package/lib/esm/Editing/CustomAttributes.d.ts.map +1 -0
- package/lib/esm/Editing/CustomAttributes.js +49 -0
- package/lib/esm/Editing/CustomAttributes.js.map +1 -0
- package/lib/esm/Editing/ECClasses.d.ts +86 -0
- package/lib/esm/Editing/ECClasses.d.ts.map +1 -0
- package/lib/esm/Editing/ECClasses.js +294 -0
- package/lib/esm/Editing/ECClasses.js.map +1 -0
- package/lib/esm/Editing/Editor.d.ts +117 -0
- package/lib/esm/Editing/Editor.d.ts.map +1 -0
- package/lib/esm/Editing/Editor.js +264 -0
- package/lib/esm/Editing/Editor.js.map +1 -0
- package/lib/esm/Editing/Entities.d.ts +38 -0
- package/lib/esm/Editing/Entities.d.ts.map +1 -0
- package/lib/esm/Editing/Entities.js +126 -0
- package/lib/esm/Editing/Entities.js.map +1 -0
- package/lib/esm/Editing/Enumerations.d.ts +25 -0
- package/lib/esm/Editing/Enumerations.d.ts.map +1 -0
- package/lib/esm/Editing/Enumerations.js +90 -0
- package/lib/esm/Editing/Enumerations.js.map +1 -0
- package/lib/esm/Editing/Exception.d.ts +358 -0
- package/lib/esm/Editing/Exception.d.ts.map +1 -0
- package/lib/esm/Editing/Exception.js +471 -0
- package/lib/esm/Editing/Exception.js.map +1 -0
- package/lib/esm/Editing/Formats.d.ts +23 -0
- package/lib/esm/Editing/Formats.d.ts.map +1 -0
- package/lib/esm/Editing/Formats.js +62 -0
- package/lib/esm/Editing/Formats.js.map +1 -0
- package/lib/esm/Editing/InvertedUnits.d.ts +19 -0
- package/lib/esm/Editing/InvertedUnits.d.ts.map +1 -0
- package/lib/esm/Editing/InvertedUnits.js +68 -0
- package/lib/esm/Editing/InvertedUnits.js.map +1 -0
- package/lib/esm/Editing/KindOfQuantities.d.ts +30 -0
- package/lib/esm/Editing/KindOfQuantities.d.ts.map +1 -0
- package/lib/esm/Editing/KindOfQuantities.js +92 -0
- package/lib/esm/Editing/KindOfQuantities.js.map +1 -0
- package/lib/esm/Editing/Mixins.d.ts +35 -0
- package/lib/esm/Editing/Mixins.d.ts.map +1 -0
- package/lib/esm/Editing/Mixins.js +90 -0
- package/lib/esm/Editing/Mixins.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.d.ts +10 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.d.ts +10 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.js +12 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableClass.d.ts +39 -0
- package/lib/esm/Editing/Mutable/MutableClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableClass.js +18 -0
- package/lib/esm/Editing/Mutable/MutableClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableConstant.d.ts +14 -0
- package/lib/esm/Editing/Mutable/MutableConstant.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableConstant.js +12 -0
- package/lib/esm/Editing/Mutable/MutableConstant.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.d.ts +12 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.js +12 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.js +11 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableFormat.d.ts +26 -0
- package/lib/esm/Editing/Mutable/MutableFormat.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableFormat.js +12 -0
- package/lib/esm/Editing/Mutable/MutableFormat.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.js +12 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.d.ts +14 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.js +12 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableMixin.d.ts +12 -0
- package/lib/esm/Editing/Mutable/MutableMixin.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableMixin.js +12 -0
- package/lib/esm/Editing/Mutable/MutableMixin.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.d.ts +8 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.js +12 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.d.ts +13 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableProperty.d.ts +16 -0
- package/lib/esm/Editing/Mutable/MutableProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.js +12 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.d.ts +30 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.js +20 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchema.d.ts +51 -0
- package/lib/esm/Editing/Mutable/MutableSchema.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchema.js +14 -0
- package/lib/esm/Editing/Mutable/MutableSchema.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.js +12 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.d.ts +8 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnit.d.ts +12 -0
- package/lib/esm/Editing/Mutable/MutableUnit.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnit.js +12 -0
- package/lib/esm/Editing/Mutable/MutableUnit.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.d.ts +10 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.js +12 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.js.map +1 -0
- package/lib/esm/Editing/Phenomena.d.ts +17 -0
- package/lib/esm/Editing/Phenomena.d.ts.map +1 -0
- package/lib/esm/Editing/Phenomena.js +44 -0
- package/lib/esm/Editing/Phenomena.js.map +1 -0
- package/lib/esm/Editing/Properties.d.ts +206 -0
- package/lib/esm/Editing/Properties.d.ts.map +1 -0
- package/lib/esm/Editing/Properties.js +415 -0
- package/lib/esm/Editing/Properties.js.map +1 -0
- package/lib/esm/Editing/PropertyCategories.d.ts +18 -0
- package/lib/esm/Editing/PropertyCategories.d.ts.map +1 -0
- package/lib/esm/Editing/PropertyCategories.js +54 -0
- package/lib/esm/Editing/PropertyCategories.js.map +1 -0
- package/lib/esm/Editing/RelationshipClasses.d.ts +69 -0
- package/lib/esm/Editing/RelationshipClasses.d.ts.map +1 -0
- package/lib/esm/Editing/RelationshipClasses.js +236 -0
- package/lib/esm/Editing/RelationshipClasses.js.map +1 -0
- package/lib/esm/Editing/SchemaItems.d.ts +42 -0
- package/lib/esm/Editing/SchemaItems.d.ts.map +1 -0
- package/lib/esm/Editing/SchemaItems.js +104 -0
- package/lib/esm/Editing/SchemaItems.js.map +1 -0
- package/lib/esm/Editing/Structs.d.ts +21 -0
- package/lib/esm/Editing/Structs.d.ts.map +1 -0
- package/lib/esm/Editing/Structs.js +47 -0
- package/lib/esm/Editing/Structs.js.map +1 -0
- package/lib/esm/Editing/UnitSystems.d.ts +17 -0
- package/lib/esm/Editing/UnitSystems.d.ts.map +1 -0
- package/lib/esm/Editing/UnitSystems.js +43 -0
- package/lib/esm/Editing/UnitSystems.js.map +1 -0
- package/lib/esm/Editing/Units.d.ts +17 -0
- package/lib/esm/Editing/Units.d.ts.map +1 -0
- package/lib/esm/Editing/Units.js +49 -0
- package/lib/esm/Editing/Units.js.map +1 -0
- package/lib/esm/Merging/ClassMerger.d.ts +9 -0
- package/lib/esm/Merging/ClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/ClassMerger.js +66 -0
- package/lib/esm/Merging/ClassMerger.js.map +1 -0
- package/lib/esm/Merging/ConstantMerger.d.ts +14 -0
- package/lib/esm/Merging/ConstantMerger.d.ts.map +1 -0
- package/lib/esm/Merging/ConstantMerger.js +64 -0
- package/lib/esm/Merging/ConstantMerger.js.map +1 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.d.ts +14 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.js +36 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.js.map +1 -0
- package/lib/esm/Merging/CustomAttributeMerger.d.ts +19 -0
- package/lib/esm/Merging/CustomAttributeMerger.d.ts.map +1 -0
- package/lib/esm/Merging/CustomAttributeMerger.js +66 -0
- package/lib/esm/Merging/CustomAttributeMerger.js.map +1 -0
- package/lib/esm/Merging/Edits/NameMapping.d.ts +22 -0
- package/lib/esm/Merging/Edits/NameMapping.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/NameMapping.js +49 -0
- package/lib/esm/Merging/Edits/NameMapping.js.map +1 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.d.ts +14 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.js +62 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.js.map +1 -0
- package/lib/esm/Merging/Edits/SchemaEdits.d.ts +81 -0
- package/lib/esm/Merging/Edits/SchemaEdits.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/SchemaEdits.js +112 -0
- package/lib/esm/Merging/Edits/SchemaEdits.js.map +1 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.d.ts +14 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.js +60 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.js.map +1 -0
- package/lib/esm/Merging/EntityClassMerger.d.ts +19 -0
- package/lib/esm/Merging/EntityClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/EntityClassMerger.js +39 -0
- package/lib/esm/Merging/EntityClassMerger.js.map +1 -0
- package/lib/esm/Merging/EnumerationMerger.d.ts +14 -0
- package/lib/esm/Merging/EnumerationMerger.d.ts.map +1 -0
- package/lib/esm/Merging/EnumerationMerger.js +48 -0
- package/lib/esm/Merging/EnumerationMerger.js.map +1 -0
- package/lib/esm/Merging/EnumeratorMerger.d.ts +14 -0
- package/lib/esm/Merging/EnumeratorMerger.d.ts.map +1 -0
- package/lib/esm/Merging/EnumeratorMerger.js +36 -0
- package/lib/esm/Merging/EnumeratorMerger.js.map +1 -0
- package/lib/esm/Merging/FormatMerger.d.ts +24 -0
- package/lib/esm/Merging/FormatMerger.d.ts.map +1 -0
- package/lib/esm/Merging/FormatMerger.js +137 -0
- package/lib/esm/Merging/FormatMerger.js.map +1 -0
- package/lib/esm/Merging/InvertedUnitMerger.d.ts +14 -0
- package/lib/esm/Merging/InvertedUnitMerger.d.ts.map +1 -0
- package/lib/esm/Merging/InvertedUnitMerger.js +41 -0
- package/lib/esm/Merging/InvertedUnitMerger.js.map +1 -0
- package/lib/esm/Merging/KindOfQuantityMerger.d.ts +19 -0
- package/lib/esm/Merging/KindOfQuantityMerger.d.ts.map +1 -0
- package/lib/esm/Merging/KindOfQuantityMerger.js +89 -0
- package/lib/esm/Merging/KindOfQuantityMerger.js.map +1 -0
- package/lib/esm/Merging/MixinMerger.d.ts +14 -0
- package/lib/esm/Merging/MixinMerger.d.ts.map +1 -0
- package/lib/esm/Merging/MixinMerger.js +33 -0
- package/lib/esm/Merging/MixinMerger.js.map +1 -0
- package/lib/esm/Merging/PhenomenonMerger.d.ts +14 -0
- package/lib/esm/Merging/PhenomenonMerger.d.ts.map +1 -0
- package/lib/esm/Merging/PhenomenonMerger.js +36 -0
- package/lib/esm/Merging/PhenomenonMerger.js.map +1 -0
- package/lib/esm/Merging/PropertyCategoryMerger.d.ts +14 -0
- package/lib/esm/Merging/PropertyCategoryMerger.d.ts.map +1 -0
- package/lib/esm/Merging/PropertyCategoryMerger.js +31 -0
- package/lib/esm/Merging/PropertyCategoryMerger.js.map +1 -0
- package/lib/esm/Merging/PropertyMerger.d.ts +12 -0
- package/lib/esm/Merging/PropertyMerger.d.ts.map +1 -0
- package/lib/esm/Merging/PropertyMerger.js +228 -0
- package/lib/esm/Merging/PropertyMerger.js.map +1 -0
- package/lib/esm/Merging/RelationshipClassMerger.d.ts +27 -0
- package/lib/esm/Merging/RelationshipClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/RelationshipClassMerger.js +136 -0
- package/lib/esm/Merging/RelationshipClassMerger.js.map +1 -0
- package/lib/esm/Merging/SchemaMerger.d.ts +49 -0
- package/lib/esm/Merging/SchemaMerger.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaMerger.js +117 -0
- package/lib/esm/Merging/SchemaMerger.js.map +1 -0
- package/lib/esm/Merging/SchemaMergingVisitor.d.ts +149 -0
- package/lib/esm/Merging/SchemaMergingVisitor.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaMergingVisitor.js +339 -0
- package/lib/esm/Merging/SchemaMergingVisitor.js.map +1 -0
- package/lib/esm/Merging/SchemaMergingWalker.d.ts +19 -0
- package/lib/esm/Merging/SchemaMergingWalker.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaMergingWalker.js +61 -0
- package/lib/esm/Merging/SchemaMergingWalker.js.map +1 -0
- package/lib/esm/Merging/SchemaReferenceMerger.d.ts +13 -0
- package/lib/esm/Merging/SchemaReferenceMerger.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaReferenceMerger.js +57 -0
- package/lib/esm/Merging/SchemaReferenceMerger.js.map +1 -0
- package/lib/esm/Merging/StructClassMerger.d.ts +14 -0
- package/lib/esm/Merging/StructClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/StructClassMerger.js +20 -0
- package/lib/esm/Merging/StructClassMerger.js.map +1 -0
- package/lib/esm/Merging/UnitMerger.d.ts +14 -0
- package/lib/esm/Merging/UnitMerger.d.ts.map +1 -0
- package/lib/esm/Merging/UnitMerger.js +58 -0
- package/lib/esm/Merging/UnitMerger.js.map +1 -0
- package/lib/esm/Merging/UnitSystemMerger.d.ts +14 -0
- package/lib/esm/Merging/UnitSystemMerger.d.ts.map +1 -0
- package/lib/esm/Merging/UnitSystemMerger.js +24 -0
- package/lib/esm/Merging/UnitSystemMerger.js.map +1 -0
- package/lib/esm/Merging/Utils.d.ts +34 -0
- package/lib/esm/Merging/Utils.d.ts.map +1 -0
- package/lib/esm/Merging/Utils.js +90 -0
- package/lib/esm/Merging/Utils.js.map +1 -0
- package/lib/esm/Validation/Diagnostic.d.ts +322 -0
- package/lib/esm/Validation/Diagnostic.d.ts.map +1 -0
- package/lib/esm/Validation/Diagnostic.js +295 -0
- package/lib/esm/Validation/Diagnostic.js.map +1 -0
- package/lib/esm/Validation/DiagnosticReporter.d.ts +97 -0
- package/lib/esm/Validation/DiagnosticReporter.d.ts.map +1 -0
- package/lib/esm/Validation/DiagnosticReporter.js +105 -0
- package/lib/esm/Validation/DiagnosticReporter.js.map +1 -0
- package/lib/esm/Validation/ECRules.d.ts +454 -0
- package/lib/esm/Validation/ECRules.d.ts.map +1 -0
- package/lib/esm/Validation/ECRules.js +578 -0
- package/lib/esm/Validation/ECRules.js.map +1 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.d.ts +14 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.d.ts.map +1 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.js +37 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.js.map +1 -0
- package/lib/esm/Validation/RuleSuppressionSet.d.ts +60 -0
- package/lib/esm/Validation/RuleSuppressionSet.d.ts.map +1 -0
- package/lib/esm/Validation/RuleSuppressionSet.js +9 -0
- package/lib/esm/Validation/RuleSuppressionSet.js.map +1 -0
- package/lib/esm/Validation/Rules.d.ts +65 -0
- package/lib/esm/Validation/Rules.d.ts.map +1 -0
- package/lib/esm/Validation/Rules.js +9 -0
- package/lib/esm/Validation/Rules.js.map +1 -0
- package/lib/esm/Validation/SchemaChanges.d.ts +640 -0
- package/lib/esm/Validation/SchemaChanges.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaChanges.js +1141 -0
- package/lib/esm/Validation/SchemaChanges.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.d.ts +423 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.js +109 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareReporter.d.ts +12 -0
- package/lib/esm/Validation/SchemaCompareReporter.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareReporter.js +9 -0
- package/lib/esm/Validation/SchemaCompareReporter.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.d.ts +237 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.js +346 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareVisitor.d.ts +120 -0
- package/lib/esm/Validation/SchemaCompareVisitor.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareVisitor.js +222 -0
- package/lib/esm/Validation/SchemaCompareVisitor.js.map +1 -0
- package/lib/esm/Validation/SchemaComparer.d.ts +211 -0
- package/lib/esm/Validation/SchemaComparer.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaComparer.js +770 -0
- package/lib/esm/Validation/SchemaComparer.js.map +1 -0
- package/lib/esm/Validation/SchemaValidater.d.ts +20 -0
- package/lib/esm/Validation/SchemaValidater.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaValidater.js +55 -0
- package/lib/esm/Validation/SchemaValidater.js.map +1 -0
- package/lib/esm/Validation/SchemaValidationVisitor.d.ts +171 -0
- package/lib/esm/Validation/SchemaValidationVisitor.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaValidationVisitor.js +488 -0
- package/lib/esm/Validation/SchemaValidationVisitor.js.map +1 -0
- package/lib/esm/Validation/SchemaWalker.d.ts +23 -0
- package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaWalker.js +50 -0
- package/lib/esm/Validation/SchemaWalker.js.map +1 -0
- package/lib/esm/ecschema-editing.d.ts +49 -0
- package/lib/esm/ecschema-editing.d.ts.map +1 -0
- package/lib/esm/ecschema-editing.js +52 -0
- package/lib/esm/ecschema-editing.js.map +1 -0
- package/package.json +19 -17
- package/public/locales/en/ECSchemaEditing.json +26 -26
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Differencing
|
|
7
|
+
*/
|
|
8
|
+
import { SchemaItemType } from "@itwin/ecschema-metadata";
|
|
9
|
+
import { SchemaOtherTypes } from "./SchemaDifference";
|
|
10
|
+
/**
|
|
11
|
+
* Implementation of a walker that traverses schema differences and calls the appropriate
|
|
12
|
+
* method on the visitor.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export class SchemaDifferenceWalker {
|
|
16
|
+
_visitor;
|
|
17
|
+
/** Initializes a new instance of SchemaDifferenceWalker class. */
|
|
18
|
+
constructor(visitor) {
|
|
19
|
+
this._visitor = visitor;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Traverses the schema differences and calls the appropriate method on the visitor.
|
|
23
|
+
* @param differences The differences to traverse.
|
|
24
|
+
*/
|
|
25
|
+
async traverse(differences) {
|
|
26
|
+
for (const [index, entry] of differences.entries()) {
|
|
27
|
+
await this.visit(entry, index, differences);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Calls the appropriate method on the visitor based on the schema difference type.
|
|
32
|
+
*/
|
|
33
|
+
async visit(difference, index, array) {
|
|
34
|
+
switch (difference.schemaType) {
|
|
35
|
+
case SchemaOtherTypes.Schema:
|
|
36
|
+
return this._visitor.visitSchemaDifference(difference, index, array);
|
|
37
|
+
case SchemaOtherTypes.SchemaReference:
|
|
38
|
+
return this._visitor.visitSchemaReferenceDifference(difference, index, array);
|
|
39
|
+
case SchemaItemType.Constant:
|
|
40
|
+
return this._visitor.visitConstantDifference(difference, index, array);
|
|
41
|
+
case SchemaItemType.CustomAttributeClass:
|
|
42
|
+
return this._visitor.visitCustomAttributeClassDifference(difference, index, array);
|
|
43
|
+
case SchemaOtherTypes.CustomAttributeInstance:
|
|
44
|
+
return this._visitor.visitCustomAttributeInstanceDifference(difference, index, array);
|
|
45
|
+
case SchemaItemType.EntityClass:
|
|
46
|
+
return this._visitor.visitEntityClassDifference(difference, index, array);
|
|
47
|
+
case SchemaOtherTypes.EntityClassMixin:
|
|
48
|
+
return this._visitor.visitEntityClassMixinDifference(difference, index, array);
|
|
49
|
+
case SchemaItemType.Enumeration:
|
|
50
|
+
return this._visitor.visitEnumerationDifference(difference, index, array);
|
|
51
|
+
case SchemaOtherTypes.Enumerator:
|
|
52
|
+
return this._visitor.visitEnumeratorDifference(difference, index, array);
|
|
53
|
+
case SchemaItemType.Format:
|
|
54
|
+
return this._visitor.visitFormatDifference(difference, index, array);
|
|
55
|
+
case SchemaOtherTypes.FormatUnit:
|
|
56
|
+
return this._visitor.visitFormatUnitDifference(difference, index, array);
|
|
57
|
+
case SchemaOtherTypes.FormatUnitLabel:
|
|
58
|
+
return this._visitor.visitFormatUnitLabelDifference(difference, index, array);
|
|
59
|
+
case SchemaItemType.InvertedUnit:
|
|
60
|
+
return this._visitor.visitInvertedUnitDifference(difference, index, array);
|
|
61
|
+
case SchemaItemType.KindOfQuantity:
|
|
62
|
+
return this._visitor.visitKindOfQuantityDifference(difference, index, array);
|
|
63
|
+
case SchemaOtherTypes.KindOfQuantityPresentationFormat:
|
|
64
|
+
return this._visitor.visitKindOfQuantityPresentationFormatDifference(difference, index, array);
|
|
65
|
+
case SchemaItemType.Mixin:
|
|
66
|
+
return this._visitor.visitMixinDifference(difference, index, array);
|
|
67
|
+
case SchemaItemType.Phenomenon:
|
|
68
|
+
return this._visitor.visitPhenomenonDifference(difference, index, array);
|
|
69
|
+
case SchemaOtherTypes.Property:
|
|
70
|
+
return this._visitor.visitPropertyDifference(difference, index, array);
|
|
71
|
+
case SchemaItemType.PropertyCategory:
|
|
72
|
+
return this._visitor.visitPropertyCategoryDifference(difference, index, array);
|
|
73
|
+
case SchemaItemType.RelationshipClass:
|
|
74
|
+
return this._visitor.visitRelationshipClassDifference(difference, index, array);
|
|
75
|
+
case SchemaOtherTypes.RelationshipConstraint:
|
|
76
|
+
return this._visitor.visitRelationshipConstraintDifference(difference, index, array);
|
|
77
|
+
case SchemaOtherTypes.RelationshipConstraintClass:
|
|
78
|
+
return this._visitor.visitRelationshipConstraintClassDifference(difference, index, array);
|
|
79
|
+
case SchemaItemType.StructClass:
|
|
80
|
+
return this._visitor.visitStructClassDifference(difference, index, array);
|
|
81
|
+
case SchemaItemType.Unit:
|
|
82
|
+
return this._visitor.visitUnitDifference(difference, index, array);
|
|
83
|
+
case SchemaItemType.UnitSystem:
|
|
84
|
+
return this._visitor.visitUnitSystemDifference(difference, index, array);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=SchemaDifferenceVisitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaDifferenceVisitor.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifferenceVisitor.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAA4B,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAWhF;;;;GAIG;AACH,MAAM,OAAO,sBAAsB;IAEhB,QAAQ,CAA0B;IAEnD,kEAAkE;IAClE,YAAY,OAAgC;QAC1C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,QAAQ,CAAC,WAAuC;QAC3D,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;YACnD,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,KAAK,CAAC,UAA+B,EAAE,KAAa,EAAE,KAA4B;QAC9F,QAAQ,UAAU,CAAC,UAAU,EAAE,CAAC;YAC9B,KAAK,gBAAgB,CAAC,MAAM;gBAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YACvE,KAAK,gBAAgB,CAAC,eAAe;gBACnC,OAAO,IAAI,CAAC,QAAQ,CA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E,KAAK,EAAE,KAAK,CAAC,CAAC;YACvF,KAAK,gBAAgB,CAAC,2BAA2B;gBAC/C,OAAO,IAAI,CAAC,QAAQ,CAAC,0CAA0C,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YAC5F,KAAK,cAAc,CAAC,WAAW;gBAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,0BAA0B,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YAC5E,KAAK,cAAc,CAAC,IAAI;gBACtB,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YACrE,KAAK,cAAc,CAAC,UAAU;gBAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Differencing\n */\n\nimport { SchemaItemType } from \"@itwin/ecschema-metadata\";\nimport { type AnySchemaDifference, SchemaOtherTypes } from \"./SchemaDifference\";\n\n/**\n * Defines the interface for a visitor that can be used to traverse schema differences.\n * It dynamically creates a method for each schema difference type.\n * @internal\n */\nexport type SchemaDifferenceVisitor = {\n [Difference in AnySchemaDifference as `visit${Difference[\"schemaType\"]}Difference`]: (entry: Difference, index: number, array: AnySchemaDifference[]) => Promise<void>;\n};\n\n/**\n * Implementation of a walker that traverses schema differences and calls the appropriate\n * method on the visitor.\n * @internal\n */\nexport class SchemaDifferenceWalker {\n\n private readonly _visitor: SchemaDifferenceVisitor;\n\n /** Initializes a new instance of SchemaDifferenceWalker class. */\n constructor(visitor: SchemaDifferenceVisitor) {\n this._visitor = visitor;\n }\n\n /**\n * Traverses the schema differences and calls the appropriate method on the visitor.\n * @param differences The differences to traverse.\n */\n public async traverse(differences: Array<AnySchemaDifference>): Promise<void> {\n for (const [index, entry] of differences.entries()) {\n await this.visit(entry, index, differences);\n }\n }\n\n /**\n * Calls the appropriate method on the visitor based on the schema difference type.\n */\n private async visit(difference: AnySchemaDifference, index: number, array: AnySchemaDifference[]) {\n switch (difference.schemaType) {\n case SchemaOtherTypes.Schema:\n return this._visitor.visitSchemaDifference(difference, index, array);\n case SchemaOtherTypes.SchemaReference:\n return this._visitor.visitSchemaReferenceDifference(difference, index, array);\n case SchemaItemType.Constant:\n return this._visitor.visitConstantDifference(difference, index, array);\n case SchemaItemType.CustomAttributeClass:\n return this._visitor.visitCustomAttributeClassDifference(difference, index, array);\n case SchemaOtherTypes.CustomAttributeInstance:\n return this._visitor.visitCustomAttributeInstanceDifference(difference, index, array);\n case SchemaItemType.EntityClass:\n return this._visitor.visitEntityClassDifference(difference, index, array);\n case SchemaOtherTypes.EntityClassMixin:\n return this._visitor.visitEntityClassMixinDifference(difference, index, array);\n case SchemaItemType.Enumeration:\n return this._visitor.visitEnumerationDifference(difference, index, array);\n case SchemaOtherTypes.Enumerator:\n return this._visitor.visitEnumeratorDifference(difference, index, array);\n case SchemaItemType.Format:\n return this._visitor.visitFormatDifference(difference, index, array);\n case SchemaOtherTypes.FormatUnit:\n return this._visitor.visitFormatUnitDifference(difference, index, array);\n case SchemaOtherTypes.FormatUnitLabel:\n return this._visitor.visitFormatUnitLabelDifference(difference, index, array);\n case SchemaItemType.InvertedUnit:\n return this._visitor.visitInvertedUnitDifference(difference, index, array);\n case SchemaItemType.KindOfQuantity:\n return this._visitor.visitKindOfQuantityDifference(difference, index, array);\n case SchemaOtherTypes.KindOfQuantityPresentationFormat:\n return this._visitor.visitKindOfQuantityPresentationFormatDifference(difference, index, array);\n case SchemaItemType.Mixin:\n return this._visitor.visitMixinDifference(difference, index, array);\n case SchemaItemType.Phenomenon:\n return this._visitor.visitPhenomenonDifference(difference, index, array);\n case SchemaOtherTypes.Property:\n return this._visitor.visitPropertyDifference(difference, index, array);\n case SchemaItemType.PropertyCategory:\n return this._visitor.visitPropertyCategoryDifference(difference, index, array);\n case SchemaItemType.RelationshipClass:\n return this._visitor.visitRelationshipClassDifference(difference, index, array);\n case SchemaOtherTypes.RelationshipConstraint:\n return this._visitor.visitRelationshipConstraintDifference(difference, index, array);\n case SchemaOtherTypes.RelationshipConstraintClass:\n return this._visitor.visitRelationshipConstraintClassDifference(difference, index, array);\n case SchemaItemType.StructClass:\n return this._visitor.visitStructClassDifference(difference, index, array);\n case SchemaItemType.Unit:\n return this._visitor.visitUnitDifference(difference, index, array);\n case SchemaItemType.UnitSystem:\n return this._visitor.visitUnitSystemDifference(difference, index, array);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Differencing
|
|
3
|
+
*/
|
|
4
|
+
import { type AnyClassItemDifference, type AnySchemaDifference, type AnySchemaItemDifference, type ClassPropertyDifference, type ConstantDifference, type CustomAttributeClassDifference, type CustomAttributeDifference, type EntityClassDifference, type EntityClassMixinDifference, type EnumerationDifference, type EnumeratorDifference, type KindOfQuantityDifference, type MixinClassDifference, type PhenomenonDifference, type PropertyCategoryDifference, type RelationshipClassDifference, type RelationshipConstraintClassDifference, type RelationshipConstraintDifference, type SchemaDifference, type SchemaReferenceDifference, type StructClassDifference, type UnitSystemDifference } from "./SchemaDifference";
|
|
5
|
+
/**
|
|
6
|
+
* Indicates whether the given difference is type of ConstantDifference.
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
9
|
+
export declare function isConstantDifference(difference: AnySchemaDifference): difference is ConstantDifference;
|
|
10
|
+
/**
|
|
11
|
+
* Indicates whether the given difference is type of ClassPropertyDifference.
|
|
12
|
+
* @alpha
|
|
13
|
+
*/
|
|
14
|
+
export declare function isClassPropertyDifference(difference: AnySchemaDifference): difference is ClassPropertyDifference;
|
|
15
|
+
/**
|
|
16
|
+
* Indicates whether the given difference is type of CustomAttributeClassDifference.
|
|
17
|
+
* @alpha
|
|
18
|
+
*/
|
|
19
|
+
export declare function isCustomAttributeClassDifference(difference: AnySchemaDifference): difference is CustomAttributeClassDifference;
|
|
20
|
+
/**
|
|
21
|
+
* Indicates whether the given difference is type of CustomAttributeDifference.
|
|
22
|
+
* @alpha
|
|
23
|
+
*/
|
|
24
|
+
export declare function isCustomAttributeDifference(difference: AnySchemaDifference): difference is CustomAttributeDifference;
|
|
25
|
+
/**
|
|
26
|
+
* Indicates whether the given difference is type of EntityClassDifference.
|
|
27
|
+
* @alpha
|
|
28
|
+
*/
|
|
29
|
+
export declare function isEntityClassDifference(difference: AnySchemaDifference): difference is EntityClassDifference;
|
|
30
|
+
/**
|
|
31
|
+
* Indicates whether the given difference is type of EntityClassMixinDifference.
|
|
32
|
+
* @alpha
|
|
33
|
+
*/
|
|
34
|
+
export declare function isEntityClassMixinDifference(difference: AnySchemaDifference): difference is EntityClassMixinDifference;
|
|
35
|
+
/**
|
|
36
|
+
* Indicates whether the given difference is type of EnumerationDifference.
|
|
37
|
+
* @alpha
|
|
38
|
+
*/
|
|
39
|
+
export declare function isEnumerationDifference(difference: AnySchemaDifference): difference is EnumerationDifference;
|
|
40
|
+
/**
|
|
41
|
+
* Indicates whether the given difference is type of EnumeratorDifference.
|
|
42
|
+
* @alpha
|
|
43
|
+
*/
|
|
44
|
+
export declare function isEnumeratorDifference(difference: AnySchemaDifference): difference is EnumeratorDifference;
|
|
45
|
+
/**
|
|
46
|
+
* Indicates whether the given difference is type of KindOfQuantityDifference.
|
|
47
|
+
* @alpha
|
|
48
|
+
*/
|
|
49
|
+
export declare function isKindOfQuantityDifference(difference: AnySchemaDifference): difference is KindOfQuantityDifference;
|
|
50
|
+
/**
|
|
51
|
+
* Indicates whether the given difference is type of MixinClassDifference.
|
|
52
|
+
* @alpha
|
|
53
|
+
*/
|
|
54
|
+
export declare function isMixinClassDifference(difference: AnySchemaDifference): difference is MixinClassDifference;
|
|
55
|
+
/**
|
|
56
|
+
* Indicates whether the given difference is type of PhenomenonDifference.
|
|
57
|
+
* @alpha
|
|
58
|
+
*/
|
|
59
|
+
export declare function isPhenomenonDifference(difference: AnySchemaDifference): difference is PhenomenonDifference;
|
|
60
|
+
/**
|
|
61
|
+
* Indicates whether the given difference is type of PropertyCategoryDifference.
|
|
62
|
+
* @alpha
|
|
63
|
+
*/
|
|
64
|
+
export declare function isPropertyCategoryDifference(difference: AnySchemaDifference): difference is PropertyCategoryDifference;
|
|
65
|
+
/**
|
|
66
|
+
* Indicates whether the given difference is type of SchemaDifference.
|
|
67
|
+
* @alpha
|
|
68
|
+
*/
|
|
69
|
+
export declare function isSchemaDifference(difference: AnySchemaDifference): difference is SchemaDifference;
|
|
70
|
+
/**
|
|
71
|
+
* Indicates whether the given difference is type of SchemaReferenceDifference.
|
|
72
|
+
* @alpha
|
|
73
|
+
*/
|
|
74
|
+
export declare function isSchemaReferenceDifference(difference: AnySchemaDifference): difference is SchemaReferenceDifference;
|
|
75
|
+
/**
|
|
76
|
+
* Indicates whether the given difference is type of CustomAttributeDifference.
|
|
77
|
+
* @alpha
|
|
78
|
+
*/
|
|
79
|
+
export declare function isStructClassDifference(difference: AnySchemaDifference): difference is StructClassDifference;
|
|
80
|
+
/**
|
|
81
|
+
* Indicates whether the given difference is type of UnitSystemDifference.
|
|
82
|
+
* @alpha
|
|
83
|
+
*/
|
|
84
|
+
export declare function isUnitSystemDifference(difference: AnySchemaDifference): difference is UnitSystemDifference;
|
|
85
|
+
/**
|
|
86
|
+
* Indicates whether the given difference is type of RelationshipClassDifference.
|
|
87
|
+
* @alpha
|
|
88
|
+
*/
|
|
89
|
+
export declare function isRelationshipClassDifference(difference: AnySchemaDifference): difference is RelationshipClassDifference;
|
|
90
|
+
/**
|
|
91
|
+
* Indicates whether the given difference is type of RelationshipConstraintDifference.
|
|
92
|
+
* @alpha
|
|
93
|
+
*/
|
|
94
|
+
export declare function isRelationshipConstraintDifference(difference: AnySchemaDifference): difference is RelationshipConstraintDifference;
|
|
95
|
+
/**
|
|
96
|
+
* Indicates whether the given difference is type of RelationshipConstraintClassDifference.
|
|
97
|
+
* @alpha
|
|
98
|
+
*/
|
|
99
|
+
export declare function isRelationshipConstraintClassDifference(difference: AnySchemaDifference): difference is RelationshipConstraintClassDifference;
|
|
100
|
+
/**
|
|
101
|
+
* Indicates whether the given difference is type of AnySchemaItemDifference.
|
|
102
|
+
* @alpha
|
|
103
|
+
*/
|
|
104
|
+
export declare function isSchemaItemDifference(difference: AnySchemaDifference): difference is AnySchemaItemDifference;
|
|
105
|
+
/**
|
|
106
|
+
* Indicates whether the given difference is type of ClassItemDifference.
|
|
107
|
+
* @alpha
|
|
108
|
+
*/
|
|
109
|
+
export declare function isClassDifference(difference: AnySchemaDifference): difference is AnyClassItemDifference;
|
|
110
|
+
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../src/Differencing/Utils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,qCAAqC,EAC1C,KAAK,gCAAgC,EACrC,KAAK,gBAAgB,EAErB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EA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AAE,mBAAmB,GAAG,UAAU,IAAI,yBAAyB,CAEpH;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,mBAAmB,GAAG,UAAU,IAAI,qBAAqB,CAE5G;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,mBAAmB,GAAG,UAAU,IAAI,oBAAoB,CAE1G;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,mBAAmB,GAAG,UAAU,IAAI,2BAA2B,CAExH;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,mBAAmB,GAAG,UAAU,IAAI,gCAAgC,CAElI;AAED;;;GAGG;AACH,wBAAgB,uCAAuC,CAAC,UAAU,EAAE,mBAAmB,GAAG,UAAU,IAAI,qCAAqC,CAE5I;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,mBAAmB,GAAG,UAAU,IAAI,uBAAuB,CAE7G;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,mBAAmB,GAAG,UAAU,IAAI,sBAAsB,CAMvG"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Differencing
|
|
7
|
+
*/
|
|
8
|
+
import { SchemaItemType } from "@itwin/ecschema-metadata";
|
|
9
|
+
import { SchemaOtherTypes, } from "./SchemaDifference";
|
|
10
|
+
/**
|
|
11
|
+
* Indicates whether the given difference is type of ConstantDifference.
|
|
12
|
+
* @alpha
|
|
13
|
+
*/
|
|
14
|
+
export function isConstantDifference(difference) {
|
|
15
|
+
return difference.schemaType === SchemaItemType.Constant;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Indicates whether the given difference is type of ClassPropertyDifference.
|
|
19
|
+
* @alpha
|
|
20
|
+
*/
|
|
21
|
+
export function isClassPropertyDifference(difference) {
|
|
22
|
+
return difference.schemaType === SchemaOtherTypes.Property;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Indicates whether the given difference is type of CustomAttributeClassDifference.
|
|
26
|
+
* @alpha
|
|
27
|
+
*/
|
|
28
|
+
export function isCustomAttributeClassDifference(difference) {
|
|
29
|
+
return difference.schemaType === SchemaItemType.CustomAttributeClass;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Indicates whether the given difference is type of CustomAttributeDifference.
|
|
33
|
+
* @alpha
|
|
34
|
+
*/
|
|
35
|
+
export function isCustomAttributeDifference(difference) {
|
|
36
|
+
return difference.schemaType === SchemaOtherTypes.CustomAttributeInstance;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Indicates whether the given difference is type of EntityClassDifference.
|
|
40
|
+
* @alpha
|
|
41
|
+
*/
|
|
42
|
+
export function isEntityClassDifference(difference) {
|
|
43
|
+
return difference.schemaType === SchemaItemType.EntityClass;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Indicates whether the given difference is type of EntityClassMixinDifference.
|
|
47
|
+
* @alpha
|
|
48
|
+
*/
|
|
49
|
+
export function isEntityClassMixinDifference(difference) {
|
|
50
|
+
return difference.schemaType === SchemaOtherTypes.EntityClassMixin;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Indicates whether the given difference is type of EnumerationDifference.
|
|
54
|
+
* @alpha
|
|
55
|
+
*/
|
|
56
|
+
export function isEnumerationDifference(difference) {
|
|
57
|
+
return difference.schemaType === SchemaItemType.Enumeration;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Indicates whether the given difference is type of EnumeratorDifference.
|
|
61
|
+
* @alpha
|
|
62
|
+
*/
|
|
63
|
+
export function isEnumeratorDifference(difference) {
|
|
64
|
+
return difference.schemaType === SchemaOtherTypes.Enumerator;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Indicates whether the given difference is type of KindOfQuantityDifference.
|
|
68
|
+
* @alpha
|
|
69
|
+
*/
|
|
70
|
+
export function isKindOfQuantityDifference(difference) {
|
|
71
|
+
return difference.schemaType === SchemaItemType.KindOfQuantity;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Indicates whether the given difference is type of MixinClassDifference.
|
|
75
|
+
* @alpha
|
|
76
|
+
*/
|
|
77
|
+
export function isMixinClassDifference(difference) {
|
|
78
|
+
return difference.schemaType === SchemaItemType.Mixin;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Indicates whether the given difference is type of PhenomenonDifference.
|
|
82
|
+
* @alpha
|
|
83
|
+
*/
|
|
84
|
+
export function isPhenomenonDifference(difference) {
|
|
85
|
+
return difference.schemaType === SchemaItemType.Phenomenon;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Indicates whether the given difference is type of PropertyCategoryDifference.
|
|
89
|
+
* @alpha
|
|
90
|
+
*/
|
|
91
|
+
export function isPropertyCategoryDifference(difference) {
|
|
92
|
+
return difference.schemaType === SchemaItemType.PropertyCategory;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Indicates whether the given difference is type of SchemaDifference.
|
|
96
|
+
* @alpha
|
|
97
|
+
*/
|
|
98
|
+
export function isSchemaDifference(difference) {
|
|
99
|
+
return difference.schemaType === SchemaOtherTypes.Schema;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Indicates whether the given difference is type of SchemaReferenceDifference.
|
|
103
|
+
* @alpha
|
|
104
|
+
*/
|
|
105
|
+
export function isSchemaReferenceDifference(difference) {
|
|
106
|
+
return difference.schemaType === SchemaOtherTypes.SchemaReference;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Indicates whether the given difference is type of CustomAttributeDifference.
|
|
110
|
+
* @alpha
|
|
111
|
+
*/
|
|
112
|
+
export function isStructClassDifference(difference) {
|
|
113
|
+
return difference.schemaType === SchemaItemType.StructClass;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Indicates whether the given difference is type of UnitSystemDifference.
|
|
117
|
+
* @alpha
|
|
118
|
+
*/
|
|
119
|
+
export function isUnitSystemDifference(difference) {
|
|
120
|
+
return difference.schemaType === SchemaItemType.UnitSystem;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Indicates whether the given difference is type of RelationshipClassDifference.
|
|
124
|
+
* @alpha
|
|
125
|
+
*/
|
|
126
|
+
export function isRelationshipClassDifference(difference) {
|
|
127
|
+
return difference.schemaType === SchemaItemType.RelationshipClass;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Indicates whether the given difference is type of RelationshipConstraintDifference.
|
|
131
|
+
* @alpha
|
|
132
|
+
*/
|
|
133
|
+
export function isRelationshipConstraintDifference(difference) {
|
|
134
|
+
return difference.schemaType === SchemaOtherTypes.RelationshipConstraint;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Indicates whether the given difference is type of RelationshipConstraintClassDifference.
|
|
138
|
+
* @alpha
|
|
139
|
+
*/
|
|
140
|
+
export function isRelationshipConstraintClassDifference(difference) {
|
|
141
|
+
return difference.schemaType === SchemaOtherTypes.RelationshipConstraintClass;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Indicates whether the given difference is type of AnySchemaItemDifference.
|
|
145
|
+
* @alpha
|
|
146
|
+
*/
|
|
147
|
+
export function isSchemaItemDifference(difference) {
|
|
148
|
+
return difference.schemaType in SchemaItemType;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Indicates whether the given difference is type of ClassItemDifference.
|
|
152
|
+
* @alpha
|
|
153
|
+
*/
|
|
154
|
+
export function isClassDifference(difference) {
|
|
155
|
+
return isStructClassDifference(difference)
|
|
156
|
+
|| isCustomAttributeClassDifference(difference)
|
|
157
|
+
|| isEntityClassDifference(difference)
|
|
158
|
+
|| isMixinClassDifference(difference)
|
|
159
|
+
|| isRelationshipClassDifference(difference);
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=Utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/Differencing/Utils.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAoBL,gBAAgB,GAIjB,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAA+B;IAClE,OAAO,UAAU,CAAC,UAAU,KAAK,cAAc,CAAC,QAAQ,CAAC;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,UAA+B;IACvE,OAAO,UAAU,CAAC,UAAU,KAAK,gBAAgB,CAAC,QAAQ,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gCAAgC,CAAC,UAA+B;IAC9E,OAAO,UAAU,CAAC,UAAU,KAAK,cAAc,CAAC,oBAAoB,CAAC;AACvE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,UAA+B;IACzE,OAAO,UAAU,CAAC,UAAU,KAAK,gBAAgB,CAAC,uBAAuB,CAAC;AAC5E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,UAA+B;IACrE,OAAO,UAAU,CAAC,UAAU,KAAK,cAAc,CAAC,WAAW,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,UAA+B;IAC1E,OAAO,UAAU,CAAC,UAAU,KAAK,gBAAgB,CAAC,gBAAgB,CAAC;AACrE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,U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AM,UAAU,6BAA6B,CAAC,UAA+B;IAC3E,OAAO,UAAU,CAAC,UAAU,KAAK,cAAc,CAAC,iBAAiB,CAAC;AACpE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kCAAkC,CAAC,UAA+B;IAChF,OAAO,UAAU,CAAC,UAAU,KAAK,gBAAgB,CAAC,sBAAsB,CAAC;AAC3E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uCAAuC,CAAC,UAA+B;IACrF,OAAO,UAAU,CAAC,UAAU,KAAK,gBAAgB,CAAC,2BAA2B,CAAC;AAChF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,UAA+B;IACpE,OAAO,UAAU,CAAC,UAAU,IAAI,cAAc,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAA+B;IAC/D,OAAO,uBAAuB,CAAC,UAAU,CAAC;WACrC,gCAAgC,CAAC,UAAU,CAAC;WAC5C,uBAAuB,CAAC,UAAU,CAAC;WACnC,sBAAsB,CAAC,UAAU,CAAC;WAClC,6BAA6B,CAAC,UAAU,CAAC,CAAC;AACjD,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*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Differencing\n */\n\nimport { SchemaItemType } from \"@itwin/ecschema-metadata\";\nimport {\n type AnyClassItemDifference,\n type AnySchemaDifference,\n type AnySchemaItemDifference,\n type ClassPropertyDifference,\n type ConstantDifference,\n type CustomAttributeClassDifference,\n type CustomAttributeDifference,\n type EntityClassDifference,\n type EntityClassMixinDifference,\n type EnumerationDifference,\n type EnumeratorDifference,\n type KindOfQuantityDifference,\n type MixinClassDifference,\n type PhenomenonDifference,\n type PropertyCategoryDifference,\n type RelationshipClassDifference,\n type RelationshipConstraintClassDifference,\n type RelationshipConstraintDifference,\n type SchemaDifference,\n SchemaOtherTypes,\n type SchemaReferenceDifference,\n type StructClassDifference,\n type UnitSystemDifference,\n} from \"./SchemaDifference\";\n\n/**\n * Indicates whether the given difference is type of ConstantDifference.\n * @alpha\n */\nexport function isConstantDifference(difference: AnySchemaDifference): difference is ConstantDifference {\n return difference.schemaType === SchemaItemType.Constant;\n}\n\n/**\n * Indicates whether the given difference is type of ClassPropertyDifference.\n * @alpha\n */\nexport function isClassPropertyDifference(difference: AnySchemaDifference): difference is ClassPropertyDifference {\n return difference.schemaType === SchemaOtherTypes.Property;\n}\n\n/**\n * Indicates whether the given difference is type of CustomAttributeClassDifference.\n * @alpha\n */\nexport function isCustomAttributeClassDifference(difference: AnySchemaDifference): difference is CustomAttributeClassDifference {\n return difference.schemaType === SchemaItemType.CustomAttributeClass;\n}\n\n/**\n * Indicates whether the given difference is type of CustomAttributeDifference.\n * @alpha\n */\nexport function isCustomAttributeDifference(difference: AnySchemaDifference): difference is CustomAttributeDifference {\n return difference.schemaType === SchemaOtherTypes.CustomAttributeInstance;\n}\n\n/**\n * Indicates whether the given difference is type of EntityClassDifference.\n * @alpha\n */\nexport function isEntityClassDifference(difference: AnySchemaDifference): difference is EntityClassDifference {\n return difference.schemaType === SchemaItemType.EntityClass;\n}\n\n/**\n * Indicates whether the given difference is type of EntityClassMixinDifference.\n * @alpha\n */\nexport function isEntityClassMixinDifference(difference: AnySchemaDifference): difference is EntityClassMixinDifference {\n return difference.schemaType === SchemaOtherTypes.EntityClassMixin;\n}\n\n/**\n * Indicates whether the given difference is type of EnumerationDifference.\n * @alpha\n */\nexport function isEnumerationDifference(difference: AnySchemaDifference): difference is EnumerationDifference {\n return difference.schemaType === SchemaItemType.Enumeration;\n}\n\n/**\n * Indicates whether the given difference is type of EnumeratorDifference.\n * @alpha\n */\nexport function isEnumeratorDifference(difference: AnySchemaDifference): difference is EnumeratorDifference {\n return difference.schemaType === SchemaOtherTypes.Enumerator;\n}\n\n/**\n * Indicates whether the given difference is type of KindOfQuantityDifference.\n * @alpha\n */\nexport function isKindOfQuantityDifference(difference: AnySchemaDifference): difference is KindOfQuantityDifference {\n return difference.schemaType === SchemaItemType.KindOfQuantity;\n}\n\n/**\n * Indicates whether the given difference is type of MixinClassDifference.\n * @alpha\n */\nexport function isMixinClassDifference(difference: AnySchemaDifference): difference is MixinClassDifference {\n return difference.schemaType === SchemaItemType.Mixin;\n}\n\n/**\n * Indicates whether the given difference is type of PhenomenonDifference.\n * @alpha\n */\nexport function isPhenomenonDifference(difference: AnySchemaDifference): difference is PhenomenonDifference {\n return difference.schemaType === SchemaItemType.Phenomenon;\n}\n\n/**\n * Indicates whether the given difference is type of PropertyCategoryDifference.\n * @alpha\n */\nexport function isPropertyCategoryDifference(difference: AnySchemaDifference): difference is PropertyCategoryDifference {\n return difference.schemaType === SchemaItemType.PropertyCategory;\n}\n\n/**\n * Indicates whether the given difference is type of SchemaDifference.\n * @alpha\n */\nexport function isSchemaDifference(difference: AnySchemaDifference): difference is SchemaDifference {\n return difference.schemaType === SchemaOtherTypes.Schema;\n}\n\n/**\n * Indicates whether the given difference is type of SchemaReferenceDifference.\n * @alpha\n */\nexport function isSchemaReferenceDifference(difference: AnySchemaDifference): difference is SchemaReferenceDifference {\n return difference.schemaType === SchemaOtherTypes.SchemaReference;\n}\n\n/**\n * Indicates whether the given difference is type of CustomAttributeDifference.\n * @alpha\n */\nexport function isStructClassDifference(difference: AnySchemaDifference): difference is StructClassDifference {\n return difference.schemaType === SchemaItemType.StructClass;\n}\n\n/**\n * Indicates whether the given difference is type of UnitSystemDifference.\n * @alpha\n */\nexport function isUnitSystemDifference(difference: AnySchemaDifference): difference is UnitSystemDifference {\n return difference.schemaType === SchemaItemType.UnitSystem;\n}\n\n/**\n * Indicates whether the given difference is type of RelationshipClassDifference.\n * @alpha\n */\nexport function isRelationshipClassDifference(difference: AnySchemaDifference): difference is RelationshipClassDifference {\n return difference.schemaType === SchemaItemType.RelationshipClass;\n}\n\n/**\n * Indicates whether the given difference is type of RelationshipConstraintDifference.\n * @alpha\n */\nexport function isRelationshipConstraintDifference(difference: AnySchemaDifference): difference is RelationshipConstraintDifference {\n return difference.schemaType === SchemaOtherTypes.RelationshipConstraint;\n}\n\n/**\n * Indicates whether the given difference is type of RelationshipConstraintClassDifference.\n * @alpha\n */\nexport function isRelationshipConstraintClassDifference(difference: AnySchemaDifference): difference is RelationshipConstraintClassDifference {\n return difference.schemaType === SchemaOtherTypes.RelationshipConstraintClass;\n}\n\n/**\n * Indicates whether the given difference is type of AnySchemaItemDifference.\n * @alpha\n */\nexport function isSchemaItemDifference(difference: AnySchemaDifference): difference is AnySchemaItemDifference {\n return difference.schemaType in SchemaItemType;\n}\n\n/**\n * Indicates whether the given difference is type of ClassItemDifference.\n * @alpha\n */\nexport function isClassDifference(difference: AnySchemaDifference): difference is AnyClassItemDifference {\n return isStructClassDifference(difference)\n || isCustomAttributeClassDifference(difference)\n || isEntityClassDifference(difference)\n || isMixinClassDifference(difference)\n || isRelationshipClassDifference(difference);\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Editing
|
|
3
|
+
*/
|
|
4
|
+
import { Constant, ConstantProps, SchemaItemKey, SchemaKey } from "@itwin/ecschema-metadata";
|
|
5
|
+
import { SchemaContextEditor } from "./Editor";
|
|
6
|
+
import { SchemaItems } from "./SchemaItems";
|
|
7
|
+
/**
|
|
8
|
+
* @alpha
|
|
9
|
+
* A class allowing you to create schema items of type Constant.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Constants extends SchemaItems {
|
|
12
|
+
protected get itemTypeClass(): typeof Constant;
|
|
13
|
+
constructor(schemaEditor: SchemaContextEditor);
|
|
14
|
+
create(schemaKey: SchemaKey, name: string, phenomenon: SchemaItemKey, definition: string, displayLabel?: string, numerator?: number, denominator?: number): Promise<SchemaItemKey>;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a Constant through a ConstantProps.
|
|
17
|
+
* @param schemaKey a SchemaKey of the Schema that will house the new object.
|
|
18
|
+
* @param relationshipProps a json object that will be used to populate the new RelationshipClass. Needs a name value passed in.
|
|
19
|
+
*/
|
|
20
|
+
createFromProps(schemaKey: SchemaKey, constantProps: ConstantProps): Promise<SchemaItemKey>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=Constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../src/Editing/Constants.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAuC,aAAa,EAAkB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClJ,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC,cAAuB,aAAa,IAAI,OAAO,QAAQ,CAEtD;gBAEkB,YAAY,EAAE,mBAAmB;IAIvC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAwB/L;;;;OAIG;IACU,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;CAQzG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 Editing
|
|
7
|
+
*/
|
|
8
|
+
import { Constant, DelayedPromiseWithProps, Phenomenon, SchemaItemType } from "@itwin/ecschema-metadata";
|
|
9
|
+
import { ECEditingStatus, SchemaEditingError, SchemaItemId } from "./Exception";
|
|
10
|
+
import { SchemaItems } from "./SchemaItems";
|
|
11
|
+
/**
|
|
12
|
+
* @alpha
|
|
13
|
+
* A class allowing you to create schema items of type Constant.
|
|
14
|
+
*/
|
|
15
|
+
export class Constants extends SchemaItems {
|
|
16
|
+
get itemTypeClass() {
|
|
17
|
+
return Constant;
|
|
18
|
+
}
|
|
19
|
+
constructor(schemaEditor) {
|
|
20
|
+
super(SchemaItemType.Constant, schemaEditor);
|
|
21
|
+
}
|
|
22
|
+
async create(schemaKey, name, phenomenon, definition, displayLabel, numerator, denominator) {
|
|
23
|
+
try {
|
|
24
|
+
const newConstant = await this.createSchemaItem(schemaKey, this.schemaItemType, (schema) => schema.createConstant.bind(schema), name);
|
|
25
|
+
const newPhenomenon = (await this.getSchemaItem(phenomenon, Phenomenon));
|
|
26
|
+
newConstant.setPhenomenon(new DelayedPromiseWithProps(newPhenomenon.key, async () => newPhenomenon));
|
|
27
|
+
newConstant.setDefinition(definition);
|
|
28
|
+
if (numerator)
|
|
29
|
+
newConstant.setNumerator(numerator);
|
|
30
|
+
if (denominator)
|
|
31
|
+
newConstant.setDenominator(denominator);
|
|
32
|
+
if (displayLabel)
|
|
33
|
+
newConstant.setDisplayLabel(displayLabel);
|
|
34
|
+
return newConstant.key;
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new SchemaItemId(this.schemaItemType, name, schemaKey), e);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates a Constant through a ConstantProps.
|
|
42
|
+
* @param schemaKey a SchemaKey of the Schema that will house the new object.
|
|
43
|
+
* @param relationshipProps a json object that will be used to populate the new RelationshipClass. Needs a name value passed in.
|
|
44
|
+
*/
|
|
45
|
+
async createFromProps(schemaKey, constantProps) {
|
|
46
|
+
try {
|
|
47
|
+
const newConstant = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createConstant.bind(schema), constantProps);
|
|
48
|
+
return newConstant.key;
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, constantProps.name, schemaKey), e);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=Constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/Editing/Constants.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAiB,uBAAuB,EAAE,UAAU,EAAiB,cAAc,EAAa,MAAM,0BAA0B,CAAC;AAGlJ,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC,IAAuB,aAAa;QAClC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,YAAmB,YAAiC;QAClD,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,UAAyB,EAAE,UAAkB,EAAE,YAAqB,EAAE,SAAkB,EAAE,WAAoB;QACpK,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAW,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,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AAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QACpJ,CAAC;IACH,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 Editing\n */\n\nimport { Constant, ConstantProps, DelayedPromiseWithProps, Phenomenon, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\nimport { SchemaContextEditor } from \"./Editor\";\nimport { MutableConstant } from \"./Mutable/MutableConstant\";\nimport { ECEditingStatus, SchemaEditingError, SchemaItemId } from \"./Exception\";\nimport { SchemaItems } from \"./SchemaItems\";\n\n/**\n * @alpha\n * A class allowing you to create schema items of type Constant.\n */\nexport class Constants extends SchemaItems {\n protected override get itemTypeClass(): typeof Constant {\n return Constant;\n }\n\n public constructor(schemaEditor: SchemaContextEditor) {\n super(SchemaItemType.Constant, schemaEditor);\n }\n\n public async create(schemaKey: SchemaKey, name: string, phenomenon: SchemaItemKey, definition: string, displayLabel?: string, numerator?: number, denominator?: number): Promise<SchemaItemKey> {\n try {\n const newConstant = await this.createSchemaItem<Constant>(schemaKey, this.schemaItemType, (schema) => schema.createConstant.bind(schema), name) as MutableConstant;\n\n const newPhenomenon = (await this.getSchemaItem(phenomenon, Phenomenon));\n newConstant.setPhenomenon(new DelayedPromiseWithProps<SchemaItemKey, Phenomenon>(newPhenomenon.key, async () => newPhenomenon));\n\n newConstant.setDefinition(definition);\n\n if (numerator)\n newConstant.setNumerator(numerator);\n\n if (denominator)\n newConstant.setDenominator(denominator);\n\n if (displayLabel)\n newConstant.setDisplayLabel(displayLabel);\n\n return newConstant.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new SchemaItemId(this.schemaItemType, name, schemaKey), e);\n }\n }\n\n /**\n * Creates a Constant through a ConstantProps.\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\n * @param relationshipProps a json object that will be used to populate the new RelationshipClass. Needs a name value passed in.\n */\n public async createFromProps(schemaKey: SchemaKey, constantProps: ConstantProps): Promise<SchemaItemKey> {\n try {\n const newConstant = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createConstant.bind(schema), constantProps);\n return newConstant.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, constantProps.name!, schemaKey), e);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Editing
|
|
3
|
+
*/
|
|
4
|
+
import { CustomAttributeClass, CustomAttributeClassProps, CustomAttributeContainerType, SchemaItemKey, SchemaKey } from "@itwin/ecschema-metadata";
|
|
5
|
+
import { SchemaContextEditor } from "./Editor";
|
|
6
|
+
import { ECClasses } from "./ECClasses";
|
|
7
|
+
/**
|
|
8
|
+
* @alpha
|
|
9
|
+
* A class extending ECClasses allowing you to create schema items of type CustomAttributeClass.
|
|
10
|
+
*/
|
|
11
|
+
export declare class CustomAttributes extends ECClasses {
|
|
12
|
+
constructor(schemaEditor: SchemaContextEditor);
|
|
13
|
+
protected get itemTypeClass(): typeof CustomAttributeClass;
|
|
14
|
+
create(schemaKey: SchemaKey, name: string, appliesTo: CustomAttributeContainerType, displayLabel?: string, baseClassKey?: SchemaItemKey): Promise<SchemaItemKey>;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a CustomAttributeClass through a CustomAttributeClassProps.
|
|
17
|
+
* @param schemaKey a SchemaKey of the Schema that will house the new object.
|
|
18
|
+
* @param caProps a json object that will be used to populate the new CustomAttributeClass. Needs a name value passed in.
|
|
19
|
+
*/
|
|
20
|
+
createFromProps(schemaKey: SchemaKey, caProps: CustomAttributeClassProps): Promise<SchemaItemKey>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=CustomAttributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomAttributes.d.ts","sourceRoot":"","sources":["../../../src/Editing/CustomAttributes.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EAAE,4BAA4B,EACvD,aAAa,EAAkB,SAAS,EACzC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;gBAC1B,YAAY,EAAE,mBAAmB;IAIpD,cAAuB,aAAa,IAAI,OAAO,oBAAoB,CAElE;IAEY,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,4BAA4B,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAc7K;;;;OAIG;IACU,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC;CAQ/G"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 Editing
|
|
7
|
+
*/
|
|
8
|
+
import { CustomAttributeClass, SchemaItemType, } from "@itwin/ecschema-metadata";
|
|
9
|
+
import { ECClasses } from "./ECClasses";
|
|
10
|
+
import { ClassId, ECEditingStatus, SchemaEditingError } from "./Exception";
|
|
11
|
+
/**
|
|
12
|
+
* @alpha
|
|
13
|
+
* A class extending ECClasses allowing you to create schema items of type CustomAttributeClass.
|
|
14
|
+
*/
|
|
15
|
+
export class CustomAttributes extends ECClasses {
|
|
16
|
+
constructor(schemaEditor) {
|
|
17
|
+
super(SchemaItemType.CustomAttributeClass, schemaEditor);
|
|
18
|
+
}
|
|
19
|
+
get itemTypeClass() {
|
|
20
|
+
return CustomAttributeClass;
|
|
21
|
+
}
|
|
22
|
+
async create(schemaKey, name, appliesTo, displayLabel, baseClassKey) {
|
|
23
|
+
try {
|
|
24
|
+
const newClass = await this.createClass(schemaKey, this.schemaItemType, (schema) => schema.createCustomAttributeClass.bind(schema), name, baseClassKey);
|
|
25
|
+
if (displayLabel)
|
|
26
|
+
newClass.setDisplayLabel(displayLabel);
|
|
27
|
+
newClass.setAppliesTo(appliesTo);
|
|
28
|
+
return newClass.key;
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new ClassId(this.schemaItemType, name, schemaKey), e);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Creates a CustomAttributeClass through a CustomAttributeClassProps.
|
|
36
|
+
* @param schemaKey a SchemaKey of the Schema that will house the new object.
|
|
37
|
+
* @param caProps a json object that will be used to populate the new CustomAttributeClass. Needs a name value passed in.
|
|
38
|
+
*/
|
|
39
|
+
async createFromProps(schemaKey, caProps) {
|
|
40
|
+
try {
|
|
41
|
+
const newClass = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createCustomAttributeClass.bind(schema), caProps);
|
|
42
|
+
return newClass.key;
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new ClassId(this.schemaItemType, caProps.name, schemaKey), e);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=CustomAttributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomAttributes.js","sourceR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ACnF,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;YAC3J,OAAO,QAAQ,CAAC,GAAG,CAAC;QACtB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,yBAAyB,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,IAAK,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QACzI,CAAC;IACH,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 Editing\n */\n\nimport {\n CustomAttributeClass,\n CustomAttributeClassProps, CustomAttributeContainerType,\n SchemaItemKey, SchemaItemType, SchemaKey,\n} from \"@itwin/ecschema-metadata\";\nimport { SchemaContextEditor } from \"./Editor\";\nimport { ECClasses } from \"./ECClasses\";\nimport { MutableCAClass } from \"./Mutable/MutableCAClass\";\nimport { ClassId, ECEditingStatus, SchemaEditingError } from \"./Exception\";\n\n/**\n * @alpha\n * A class extending ECClasses allowing you to create schema items of type CustomAttributeClass.\n */\nexport class CustomAttributes extends ECClasses {\n public constructor(schemaEditor: SchemaContextEditor) {\n super(SchemaItemType.CustomAttributeClass, schemaEditor);\n }\n\n protected override get itemTypeClass(): typeof CustomAttributeClass {\n return CustomAttributeClass;\n }\n\n public async create(schemaKey: SchemaKey, name: string, appliesTo: CustomAttributeContainerType, displayLabel?: string, baseClassKey?: SchemaItemKey): Promise<SchemaItemKey> {\n try {\n const newClass = await this.createClass<CustomAttributeClass>(schemaKey, this.schemaItemType, (schema) => schema.createCustomAttributeClass.bind(schema), name, baseClassKey) as MutableCAClass;\n\n if (displayLabel)\n newClass.setDisplayLabel(displayLabel);\n\n newClass.setAppliesTo(appliesTo);\n return newClass.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new ClassId(this.schemaItemType, name, schemaKey), e);\n }\n }\n\n /**\n * Creates a CustomAttributeClass through a CustomAttributeClassProps.\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\n * @param caProps a json object that will be used to populate the new CustomAttributeClass. Needs a name value passed in.\n */\n public async createFromProps(schemaKey: SchemaKey, caProps: CustomAttributeClassProps): Promise<SchemaItemKey> {\n try {\n const newClass = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createCustomAttributeClass.bind(schema), caProps);\n return newClass.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new ClassId(this.schemaItemType, caProps.name!, schemaKey), e);\n }\n }\n}\n"]}
|