@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,86 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Editing
|
|
3
|
+
*/
|
|
4
|
+
import { CustomAttribute, CustomAttributeContainerProps, ECClass, Enumeration, EnumerationPropertyProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PrimitiveType, SchemaItemKey, SchemaItemType, SchemaKey, StructArrayPropertyProps, StructClass, StructPropertyProps } from "@itwin/ecschema-metadata";
|
|
5
|
+
import { SchemaContextEditor } from "./Editor";
|
|
6
|
+
import { ArrayProperties, EnumerationProperties, PrimitiveProperties, Properties, StructProperties } from "./Properties";
|
|
7
|
+
import { CreateSchemaItem, SchemaItems } from "./SchemaItems";
|
|
8
|
+
export type ECClassSchemaItems = SchemaItemType.EntityClass | SchemaItemType.StructClass | SchemaItemType.RelationshipClass | SchemaItemType.Mixin | SchemaItemType.CustomAttributeClass;
|
|
9
|
+
/**
|
|
10
|
+
* @alpha
|
|
11
|
+
* Acts as a base class for schema class creation. Enables property creation.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ECClasses extends SchemaItems {
|
|
14
|
+
protected constructor(schemaItemType: ECClassSchemaItems, schemaEditor: SchemaContextEditor);
|
|
15
|
+
protected schemaItemType: ECClassSchemaItems;
|
|
16
|
+
/**
|
|
17
|
+
* Allows access for the editors itemType class instance.
|
|
18
|
+
* It returns ECClass here, but editors for subclasses will override this to return the
|
|
19
|
+
* appropriate subclass.
|
|
20
|
+
*/
|
|
21
|
+
protected get itemTypeClass(): typeof ECClass;
|
|
22
|
+
/**
|
|
23
|
+
* Allows access for editing of base Property attributes.
|
|
24
|
+
*/
|
|
25
|
+
readonly properties: Properties;
|
|
26
|
+
/**
|
|
27
|
+
* Allows access for editing of ArrayProperty attributes.
|
|
28
|
+
*/
|
|
29
|
+
readonly arrayProperties: ArrayProperties;
|
|
30
|
+
/**
|
|
31
|
+
* Allows access for editing of PrimitiveProperty attributes.
|
|
32
|
+
*/
|
|
33
|
+
readonly primitiveProperties: PrimitiveProperties;
|
|
34
|
+
/**
|
|
35
|
+
* Allows access for editing of EnumerationProperty attributes.
|
|
36
|
+
*/
|
|
37
|
+
readonly enumerationProperties: EnumerationProperties;
|
|
38
|
+
/**
|
|
39
|
+
* Allows access for editing of StructProperty attributes.
|
|
40
|
+
*/
|
|
41
|
+
readonly structProperties: StructProperties;
|
|
42
|
+
createClass<T extends ECClass>(schemaKey: SchemaKey, type: SchemaItemType, create: CreateSchemaItem<T>, name: string, baseClassKey?: SchemaItemKey, ...args: any[]): Promise<T>;
|
|
43
|
+
/**
|
|
44
|
+
* Creates a property on class identified by the given SchemaItemKey. This method restricts the
|
|
45
|
+
* property type to primitives of type Double, String, DateTime and Integer.
|
|
46
|
+
* @param classKey The SchemaItemKey of the class.
|
|
47
|
+
* @param name The name of the new property.
|
|
48
|
+
* @param type The PrimitiveType assigned to the new property.
|
|
49
|
+
*/
|
|
50
|
+
createProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType, prefix: string): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Create a primitive property on class identified by the given SchemaItemKey.
|
|
53
|
+
* @param classKey The SchemaItemKey of the class.
|
|
54
|
+
* @param name The name of the new property.
|
|
55
|
+
* @param type The PrimitiveType assigned to the new property.
|
|
56
|
+
*/
|
|
57
|
+
createPrimitiveProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType): Promise<void>;
|
|
58
|
+
createPrimitivePropertyFromProps(classKey: SchemaItemKey, name: string, type: PrimitiveType, primitiveProps: PrimitivePropertyProps): Promise<void>;
|
|
59
|
+
createEnumerationProperty(classKey: SchemaItemKey, name: string, type: Enumeration): Promise<void>;
|
|
60
|
+
createEnumerationPropertyFromProps(classKey: SchemaItemKey, name: string, type: Enumeration, enumProps: EnumerationPropertyProps): Promise<void>;
|
|
61
|
+
createPrimitiveArrayProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType): Promise<void>;
|
|
62
|
+
createPrimitiveArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: PrimitiveType, primitiveProps: PrimitiveArrayPropertyProps): Promise<void>;
|
|
63
|
+
createEnumerationArrayProperty(classKey: SchemaItemKey, name: string, type: Enumeration): Promise<void>;
|
|
64
|
+
createEnumerationArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: Enumeration, props: PrimitiveArrayPropertyProps): Promise<void>;
|
|
65
|
+
createStructProperty(classKey: SchemaItemKey, name: string, type: StructClass): Promise<void>;
|
|
66
|
+
createStructPropertyFromProps(classKey: SchemaItemKey, name: string, type: StructClass, structProps: StructPropertyProps): Promise<void>;
|
|
67
|
+
createStructArrayProperty(classKey: SchemaItemKey, name: string, type: StructClass): Promise<void>;
|
|
68
|
+
createStructArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: StructClass, structProps: StructArrayPropertyProps): Promise<void>;
|
|
69
|
+
deleteProperty(classKey: SchemaItemKey, name: string): Promise<void>;
|
|
70
|
+
delete(classKey: SchemaItemKey): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Adds a CustomAttribute instance to the Class identified by the given SchemaItemKey
|
|
73
|
+
* @param classKey The SchemaItemKey identifying the schema.
|
|
74
|
+
* @param customAttribute The CustomAttribute instance to add.
|
|
75
|
+
*/
|
|
76
|
+
addCustomAttribute(classKey: SchemaItemKey, customAttribute: CustomAttribute): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Sets the base class of a SchemaItem.
|
|
79
|
+
* @param itemKey The SchemaItemKey of the Item.
|
|
80
|
+
* @param baseClassKey The SchemaItemKey of the base class. Specifying 'undefined' removes the base class.
|
|
81
|
+
*/
|
|
82
|
+
setBaseClass(itemKey: SchemaItemKey, baseClassKey?: SchemaItemKey): Promise<void>;
|
|
83
|
+
private getClass;
|
|
84
|
+
protected removeCustomAttribute(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): void;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=ECClasses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ECClasses.d.ts","sourceRoot":"","sources":["../../../src/Editing/ECClasses.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,eAAe,EACf,6BAA6B,EAE7B,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,2BAA2B,EAC3E,sBAAsB,EAAE,aAAa,EAAc,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,wBAAwB,EACrH,WAAW,EAAE,mBAAmB,EACjC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE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,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAUxI,yBAAyB,CAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IASlG,kCAAkC,CAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAUlJ,cAAc,CAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASpE,MAAM,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAa3D;;;;OAIG;IACU,kBAAkB,CAAC,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBzG;;;;OAIG;IACU,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,YAAY,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;YAsBhF,QAAQ;IAatB,SAAS,CAAC,qBAAqB,CAAC,SAAS,EAAE,6BAA6B,EAAE,eAAe,EAAE,eAAe;CAK3G"}
|
|
@@ -0,0 +1,294 @@
|
|
|
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 { DelayedPromiseWithProps, ECClass, PrimitiveType, SchemaItemType, } from "@itwin/ecschema-metadata";
|
|
9
|
+
import { assert } from "@itwin/core-bentley";
|
|
10
|
+
import * as Rules from "../Validation/ECRules";
|
|
11
|
+
import { ArrayProperties, EnumerationProperties, PrimitiveProperties, Properties, StructProperties } from "./Properties";
|
|
12
|
+
import { ClassId, CustomAttributeId, ECEditingStatus, PropertyId, SchemaEditingError, SchemaId, SchemaItemId } from "./Exception";
|
|
13
|
+
import { SchemaItems } from "./SchemaItems";
|
|
14
|
+
/**
|
|
15
|
+
* @alpha
|
|
16
|
+
* Acts as a base class for schema class creation. Enables property creation.
|
|
17
|
+
*/
|
|
18
|
+
export class ECClasses extends SchemaItems {
|
|
19
|
+
constructor(schemaItemType, schemaEditor) {
|
|
20
|
+
super(schemaItemType, schemaEditor);
|
|
21
|
+
this.schemaItemType = schemaItemType;
|
|
22
|
+
this.properties = new Properties(this.schemaItemType, this.schemaEditor);
|
|
23
|
+
this.arrayProperties = new ArrayProperties(this.schemaItemType, this.schemaEditor);
|
|
24
|
+
this.primitiveProperties = new PrimitiveProperties(this.schemaItemType, this.schemaEditor);
|
|
25
|
+
this.enumerationProperties = new EnumerationProperties(this.schemaItemType, this.schemaEditor);
|
|
26
|
+
this.structProperties = new StructProperties(this.schemaItemType, this.schemaEditor);
|
|
27
|
+
}
|
|
28
|
+
schemaItemType;
|
|
29
|
+
/**
|
|
30
|
+
* Allows access for the editors itemType class instance.
|
|
31
|
+
* It returns ECClass here, but editors for subclasses will override this to return the
|
|
32
|
+
* appropriate subclass.
|
|
33
|
+
*/
|
|
34
|
+
get itemTypeClass() {
|
|
35
|
+
return ECClass;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Allows access for editing of base Property attributes.
|
|
39
|
+
*/
|
|
40
|
+
properties;
|
|
41
|
+
/**
|
|
42
|
+
* Allows access for editing of ArrayProperty attributes.
|
|
43
|
+
*/
|
|
44
|
+
arrayProperties;
|
|
45
|
+
/**
|
|
46
|
+
* Allows access for editing of PrimitiveProperty attributes.
|
|
47
|
+
*/
|
|
48
|
+
primitiveProperties;
|
|
49
|
+
/**
|
|
50
|
+
* Allows access for editing of EnumerationProperty attributes.
|
|
51
|
+
*/
|
|
52
|
+
enumerationProperties;
|
|
53
|
+
/**
|
|
54
|
+
* Allows access for editing of StructProperty attributes.
|
|
55
|
+
*/
|
|
56
|
+
structProperties;
|
|
57
|
+
async createClass(schemaKey, type, create, name, baseClassKey, ...args) {
|
|
58
|
+
const newClass = await this.createSchemaItem(schemaKey, type, create, name, ...args);
|
|
59
|
+
if (baseClassKey !== undefined) {
|
|
60
|
+
if (!await this.schemaEditor.schemaContext.getSchema(baseClassKey.schemaKey)) {
|
|
61
|
+
throw new SchemaEditingError(ECEditingStatus.SchemaNotFound, new SchemaId(baseClassKey.schemaKey));
|
|
62
|
+
}
|
|
63
|
+
const baseClassItem = await this.getSchemaItem(baseClassKey, this.itemTypeClass);
|
|
64
|
+
await newClass.setBaseClass(new DelayedPromiseWithProps(baseClassKey, async () => baseClassItem));
|
|
65
|
+
}
|
|
66
|
+
return newClass;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Creates a property on class identified by the given SchemaItemKey. This method restricts the
|
|
70
|
+
* property type to primitives of type Double, String, DateTime and Integer.
|
|
71
|
+
* @param classKey The SchemaItemKey of the class.
|
|
72
|
+
* @param name The name of the new property.
|
|
73
|
+
* @param type The PrimitiveType assigned to the new property.
|
|
74
|
+
*/
|
|
75
|
+
async createProperty(classKey, name, type, prefix) {
|
|
76
|
+
if (type !== PrimitiveType.Double && type !== PrimitiveType.String && type !== PrimitiveType.DateTime
|
|
77
|
+
&& type !== PrimitiveType.Integer)
|
|
78
|
+
throw new Error("Property creation is restricted to type Double, String, DateTime, and Integer.");
|
|
79
|
+
if ("" === prefix)
|
|
80
|
+
throw new Error("The specified property name prefix is invalid");
|
|
81
|
+
const prefixedName = `${prefix}_${name}`;
|
|
82
|
+
const mutableClass = await this.getClass(classKey);
|
|
83
|
+
await mutableClass.createPrimitiveProperty(prefixedName, type);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create a primitive property on class identified by the given SchemaItemKey.
|
|
87
|
+
* @param classKey The SchemaItemKey of the class.
|
|
88
|
+
* @param name The name of the new property.
|
|
89
|
+
* @param type The PrimitiveType assigned to the new property.
|
|
90
|
+
*/
|
|
91
|
+
async createPrimitiveProperty(classKey, name, type) {
|
|
92
|
+
try {
|
|
93
|
+
const mutableClass = await this.getClass(classKey);
|
|
94
|
+
await mutableClass.createPrimitiveProperty(name, type);
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
throw new SchemaEditingError(ECEditingStatus.CreatePrimitiveProperty, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async createPrimitivePropertyFromProps(classKey, name, type, primitiveProps) {
|
|
101
|
+
try {
|
|
102
|
+
const mutableClass = await this.getClass(classKey);
|
|
103
|
+
const newProperty = await mutableClass.createPrimitiveProperty(name, type);
|
|
104
|
+
await newProperty.fromJSON(primitiveProps);
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
throw new SchemaEditingError(ECEditingStatus.CreatePrimitivePropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async createEnumerationProperty(classKey, name, type) {
|
|
111
|
+
try {
|
|
112
|
+
const mutableClass = await this.getClass(classKey);
|
|
113
|
+
const enumSchemaItemKey = mutableClass.schema.getSchemaItemKey(type.fullName);
|
|
114
|
+
if (enumSchemaItemKey === undefined)
|
|
115
|
+
throw new SchemaEditingError(ECEditingStatus.SchemaItemNotFound, new SchemaItemId(SchemaItemType.Enumeration, type.name, mutableClass.schema.schemaKey));
|
|
116
|
+
await mutableClass.createPrimitiveProperty(name, type);
|
|
117
|
+
}
|
|
118
|
+
catch (e) {
|
|
119
|
+
throw new SchemaEditingError(ECEditingStatus.CreateEnumerationProperty, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async createEnumerationPropertyFromProps(classKey, name, type, enumProps) {
|
|
123
|
+
try {
|
|
124
|
+
const mutableClass = await this.getClass(classKey);
|
|
125
|
+
const newProperty = await mutableClass.createPrimitiveProperty(name, type);
|
|
126
|
+
await newProperty.fromJSON(enumProps);
|
|
127
|
+
}
|
|
128
|
+
catch (e) {
|
|
129
|
+
throw new SchemaEditingError(ECEditingStatus.CreateEnumerationArrayPropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async createPrimitiveArrayProperty(classKey, name, type) {
|
|
133
|
+
try {
|
|
134
|
+
const mutableClass = await this.getClass(classKey);
|
|
135
|
+
await mutableClass.createPrimitiveArrayProperty(name, type);
|
|
136
|
+
}
|
|
137
|
+
catch (e) {
|
|
138
|
+
throw new SchemaEditingError(ECEditingStatus.CreatePrimitiveArrayProperty, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
async createPrimitiveArrayPropertyFromProps(classKey, name, type, primitiveProps) {
|
|
142
|
+
try {
|
|
143
|
+
const mutableClass = await this.getClass(classKey);
|
|
144
|
+
const newProperty = await mutableClass.createPrimitiveArrayProperty(name, type);
|
|
145
|
+
await newProperty.fromJSON(primitiveProps);
|
|
146
|
+
}
|
|
147
|
+
catch (e) {
|
|
148
|
+
throw new SchemaEditingError(ECEditingStatus.CreatePrimitiveArrayPropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
async createEnumerationArrayProperty(classKey, name, type) {
|
|
152
|
+
try {
|
|
153
|
+
const mutableClass = await this.getClass(classKey);
|
|
154
|
+
await mutableClass.createPrimitiveArrayProperty(name, type);
|
|
155
|
+
}
|
|
156
|
+
catch (e) {
|
|
157
|
+
throw new SchemaEditingError(ECEditingStatus.CreateEnumerationArrayProperty, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async createEnumerationArrayPropertyFromProps(classKey, name, type, props) {
|
|
161
|
+
try {
|
|
162
|
+
const mutableClass = await this.getClass(classKey);
|
|
163
|
+
const newProperty = await mutableClass.createPrimitiveArrayProperty(name, type);
|
|
164
|
+
await newProperty.fromJSON(props);
|
|
165
|
+
}
|
|
166
|
+
catch (e) {
|
|
167
|
+
throw new SchemaEditingError(ECEditingStatus.CreateEnumerationArrayPropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
async createStructProperty(classKey, name, type) {
|
|
171
|
+
try {
|
|
172
|
+
const mutableClass = await this.getClass(classKey);
|
|
173
|
+
await mutableClass.createStructProperty(name, type);
|
|
174
|
+
}
|
|
175
|
+
catch (e) {
|
|
176
|
+
throw new SchemaEditingError(ECEditingStatus.CreateStructProperty, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
async createStructPropertyFromProps(classKey, name, type, structProps) {
|
|
180
|
+
try {
|
|
181
|
+
const mutableClass = await this.getClass(classKey);
|
|
182
|
+
const newProperty = await mutableClass.createStructProperty(name, type);
|
|
183
|
+
await newProperty.fromJSON(structProps);
|
|
184
|
+
}
|
|
185
|
+
catch (e) {
|
|
186
|
+
throw new SchemaEditingError(ECEditingStatus.CreateStructPropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
async createStructArrayProperty(classKey, name, type) {
|
|
190
|
+
try {
|
|
191
|
+
const mutableClass = await this.getClass(classKey);
|
|
192
|
+
await mutableClass.createStructArrayProperty(name, type);
|
|
193
|
+
}
|
|
194
|
+
catch (e) {
|
|
195
|
+
throw new SchemaEditingError(ECEditingStatus.CreateStructArrayProperty, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
async createStructArrayPropertyFromProps(classKey, name, type, structProps) {
|
|
199
|
+
try {
|
|
200
|
+
const mutableClass = await this.getClass(classKey);
|
|
201
|
+
const newProperty = await mutableClass.createStructArrayProperty(name, type);
|
|
202
|
+
await newProperty.fromJSON(structProps);
|
|
203
|
+
}
|
|
204
|
+
catch (e) {
|
|
205
|
+
throw new SchemaEditingError(ECEditingStatus.CreateStructArrayPropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
async deleteProperty(classKey, name) {
|
|
209
|
+
try {
|
|
210
|
+
const mutableClass = await this.getClass(classKey);
|
|
211
|
+
await mutableClass.deleteProperty(name);
|
|
212
|
+
}
|
|
213
|
+
catch (e) {
|
|
214
|
+
throw new SchemaEditingError(ECEditingStatus.DeleteProperty, new PropertyId(this.schemaItemType, classKey, name), e);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
async delete(classKey) {
|
|
218
|
+
try {
|
|
219
|
+
const schema = await this.getSchema(classKey.schemaKey);
|
|
220
|
+
const ecClass = await schema.getItem(classKey.name, this.itemTypeClass);
|
|
221
|
+
if (ecClass === undefined)
|
|
222
|
+
return;
|
|
223
|
+
await schema.deleteClass(ecClass.name);
|
|
224
|
+
}
|
|
225
|
+
catch (e) {
|
|
226
|
+
throw new SchemaEditingError(ECEditingStatus.DeleteClass, new ClassId(this.schemaItemType, classKey), e);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Adds a CustomAttribute instance to the Class identified by the given SchemaItemKey
|
|
231
|
+
* @param classKey The SchemaItemKey identifying the schema.
|
|
232
|
+
* @param customAttribute The CustomAttribute instance to add.
|
|
233
|
+
*/
|
|
234
|
+
async addCustomAttribute(classKey, customAttribute) {
|
|
235
|
+
try {
|
|
236
|
+
const mutableClass = await this.getClass(classKey);
|
|
237
|
+
mutableClass.addCustomAttribute(customAttribute);
|
|
238
|
+
const diagnosticIterable = Rules.validateCustomAttributeInstance(mutableClass, customAttribute);
|
|
239
|
+
const diagnostics = [];
|
|
240
|
+
for await (const diagnostic of diagnosticIterable) {
|
|
241
|
+
diagnostics.push(diagnostic);
|
|
242
|
+
}
|
|
243
|
+
if (diagnostics.length > 0) {
|
|
244
|
+
this.removeCustomAttribute(mutableClass, customAttribute);
|
|
245
|
+
throw new SchemaEditingError(ECEditingStatus.RuleViolation, new CustomAttributeId(customAttribute.className, mutableClass), undefined, diagnostics);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
catch (e) {
|
|
249
|
+
throw new SchemaEditingError(ECEditingStatus.AddCustomAttributeToClass, new ClassId(this.schemaItemType, classKey), e);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Sets the base class of a SchemaItem.
|
|
254
|
+
* @param itemKey The SchemaItemKey of the Item.
|
|
255
|
+
* @param baseClassKey The SchemaItemKey of the base class. Specifying 'undefined' removes the base class.
|
|
256
|
+
*/
|
|
257
|
+
async setBaseClass(itemKey, baseClassKey) {
|
|
258
|
+
try {
|
|
259
|
+
const classItem = await this.getSchemaItem(itemKey, this.itemTypeClass);
|
|
260
|
+
if (!baseClassKey) {
|
|
261
|
+
await classItem.setBaseClass(undefined);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (!await this.schemaEditor.schemaContext.getSchema(baseClassKey.schemaKey)) {
|
|
265
|
+
throw new SchemaEditingError(ECEditingStatus.SchemaNotFound, new SchemaId(baseClassKey.schemaKey));
|
|
266
|
+
}
|
|
267
|
+
const baseClassItem = await this.getSchemaItem(baseClassKey, this.itemTypeClass);
|
|
268
|
+
if (classItem.baseClass !== undefined && !await baseClassItem.is(await classItem.baseClass))
|
|
269
|
+
throw new SchemaEditingError(ECEditingStatus.InvalidBaseClass, new ClassId(this.schemaItemType, baseClassKey), undefined, undefined, `Base class ${baseClassKey.fullName} must derive from ${(await classItem.baseClass).fullName}.`);
|
|
270
|
+
await classItem.setBaseClass(new DelayedPromiseWithProps(baseClassKey, async () => baseClassItem));
|
|
271
|
+
}
|
|
272
|
+
catch (e) {
|
|
273
|
+
throw new SchemaEditingError(ECEditingStatus.SetBaseClass, new ClassId(this.schemaItemType, itemKey), e);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
async getClass(classKey) {
|
|
277
|
+
const schema = await this.getSchema(classKey.schemaKey);
|
|
278
|
+
const ecClass = await schema.getItem(classKey.name);
|
|
279
|
+
if (ecClass === undefined)
|
|
280
|
+
throw new SchemaEditingError(ECEditingStatus.SchemaItemNotFound, new ClassId(this.schemaItemType, classKey));
|
|
281
|
+
if (!isMutableClass(ecClass))
|
|
282
|
+
throw new SchemaEditingError(ECEditingStatus.InvalidSchemaItemType, new ClassId(this.schemaItemType, classKey));
|
|
283
|
+
return ecClass;
|
|
284
|
+
}
|
|
285
|
+
removeCustomAttribute(container, customAttribute) {
|
|
286
|
+
assert(container.customAttributes !== undefined);
|
|
287
|
+
const map = container.customAttributes;
|
|
288
|
+
map.delete(customAttribute.className);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
function isMutableClass(schemaItem) {
|
|
292
|
+
return ECClass.isECClass(schemaItem);
|
|
293
|
+
}
|
|
294
|
+
//# sourceMappingURL=ECClasses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ECClasses.js","sourceRoot":"","sources":["../../../src/Editing/ECClasses.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAGL,uBAAuB,EACvB,OAAO,EACiB,aAAa,EAA6B,cAAc,GAEjF,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,OAAO,KAAK,KAAK,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACzH,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAA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AAC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC;QAElH,OAAO,OAAO,CAAC;IACjB,CAAC;IAES,qBAAqB,CAAC,SAAwC,EAAE,eAAgC;QACxG,MAAM,CAAC,SAAS,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC;QACjD,MAAM,GAAG,GAAG,SAAS,CAAC,gBAAgD,CAAC;QACvE,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;CACF;AAED,SAAS,cAAc,CAAC,UAAsB;IAC5C,OAAO,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACvC,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 Editing\n */\n\nimport {\n CustomAttribute,\n CustomAttributeContainerProps,\n DelayedPromiseWithProps,\n ECClass, Enumeration, EnumerationPropertyProps, PrimitiveArrayPropertyProps,\n PrimitivePropertyProps, PrimitiveType, SchemaItem, SchemaItemKey, SchemaItemType, SchemaKey, StructArrayPropertyProps,\n StructClass, StructPropertyProps,\n} from \"@itwin/ecschema-metadata\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { SchemaContextEditor } from \"./Editor\";\nimport { MutableClass } from \"./Mutable/MutableClass\";\nimport * as Rules from \"../Validation/ECRules\";\nimport { ArrayProperties, EnumerationProperties, PrimitiveProperties, Properties, StructProperties } from \"./Properties\";\nimport { ClassId, CustomAttributeId, ECEditingStatus, PropertyId, SchemaEditingError, SchemaId, SchemaItemId } from \"./Exception\";\nimport { AnyDiagnostic } from \"../Validation/Diagnostic\";\nimport { CreateSchemaItem, SchemaItems } from \"./SchemaItems\";\n\nexport type ECClassSchemaItems = SchemaItemType.EntityClass | SchemaItemType.StructClass | SchemaItemType.RelationshipClass | SchemaItemType.Mixin | SchemaItemType.CustomAttributeClass;\n\n/**\n * @alpha\n * Acts as a base class for schema class creation. Enables property creation.\n */\nexport class ECClasses extends SchemaItems{\n\n protected constructor(schemaItemType: ECClassSchemaItems, schemaEditor: SchemaContextEditor) {\n super(schemaItemType, schemaEditor);\n this.schemaItemType = schemaItemType;\n this.properties = new Properties(this.schemaItemType, this.schemaEditor);\n this.arrayProperties = new ArrayProperties(this.schemaItemType, this.schemaEditor);\n this.primitiveProperties = new PrimitiveProperties(this.schemaItemType, this.schemaEditor);\n this.enumerationProperties = new EnumerationProperties(this.schemaItemType, this.schemaEditor);\n this.structProperties = new StructProperties(this.schemaItemType, this.schemaEditor);\n }\n\n protected override schemaItemType: ECClassSchemaItems;\n\n /**\n * Allows access for the editors itemType class instance.\n * It returns ECClass here, but editors for subclasses will override this to return the\n * appropriate subclass.\n */\n protected override get itemTypeClass(): typeof ECClass {\n return ECClass;\n }\n\n /**\n * Allows access for editing of base Property attributes.\n */\n public readonly properties: Properties;\n /**\n * Allows access for editing of ArrayProperty attributes.\n */\n public readonly arrayProperties: ArrayProperties;\n /**\n * Allows access for editing of PrimitiveProperty attributes.\n */\n public readonly primitiveProperties: PrimitiveProperties;\n /**\n * Allows access for editing of EnumerationProperty attributes.\n */\n public readonly enumerationProperties: EnumerationProperties;\n /**\n * Allows access for editing of StructProperty attributes.\n */\n public readonly structProperties: StructProperties;\n\n public async createClass<T extends ECClass>(schemaKey: SchemaKey, type: SchemaItemType, create: CreateSchemaItem<T>, name: string, baseClassKey?: SchemaItemKey, ...args: any[]): Promise<T> {\n const newClass = await this.createSchemaItem(schemaKey, type, create, name, ...args);\n\n if (baseClassKey !== undefined) {\n if(!await this.schemaEditor.schemaContext.getSchema(baseClassKey.schemaKey)) {\n throw new SchemaEditingError(ECEditingStatus.SchemaNotFound, new SchemaId(baseClassKey.schemaKey));\n }\n\n const baseClassItem = await this.getSchemaItem(baseClassKey, this.itemTypeClass);\n await (newClass as ECClass as MutableClass).setBaseClass(new DelayedPromiseWithProps<SchemaItemKey, T>(baseClassKey, async () => baseClassItem as T));\n }\n\n return newClass;\n }\n\n /**\n * Creates a property on class identified by the given SchemaItemKey. This method restricts the\n * property type to primitives of type Double, String, DateTime and Integer.\n * @param classKey The SchemaItemKey of the class.\n * @param name The name of the new property.\n * @param type The PrimitiveType assigned to the new property.\n */\n public async createProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType, prefix: string): Promise<void> {\n if (type !== PrimitiveType.Double && type !== PrimitiveType.String && type !== PrimitiveType.DateTime\n && type !== PrimitiveType.Integer)\n throw new Error (\"Property creation is restricted to type Double, String, DateTime, and Integer.\");\n\n if (\"\" === prefix)\n throw new Error(\"The specified property name prefix is invalid\");\n\n const prefixedName = `${prefix}_${name}`;\n\n const mutableClass = await this.getClass(classKey);\n\n await mutableClass.createPrimitiveProperty(prefixedName, type);\n }\n\n /**\n * Create a primitive property on class identified by the given SchemaItemKey.\n * @param classKey The SchemaItemKey of the class.\n * @param name The name of the new property.\n * @param type The PrimitiveType assigned to the new property.\n */\n public async createPrimitiveProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n await mutableClass.createPrimitiveProperty(name, type);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreatePrimitiveProperty, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async createPrimitivePropertyFromProps(classKey: SchemaItemKey, name: string, type: PrimitiveType, primitiveProps: PrimitivePropertyProps): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n const newProperty = await mutableClass.createPrimitiveProperty(name, type);\n await newProperty.fromJSON(primitiveProps);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreatePrimitivePropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async createEnumerationProperty(classKey: SchemaItemKey, name: string, type: Enumeration): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n const enumSchemaItemKey = mutableClass.schema.getSchemaItemKey(type.fullName);\n if (enumSchemaItemKey === undefined)\n throw new SchemaEditingError(ECEditingStatus.SchemaItemNotFound, new SchemaItemId(SchemaItemType.Enumeration, type.name, mutableClass.schema.schemaKey));\n\n await mutableClass.createPrimitiveProperty(name, type);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateEnumerationProperty, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async createEnumerationPropertyFromProps(classKey: SchemaItemKey, name: string, type: Enumeration, enumProps: EnumerationPropertyProps): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n const newProperty = await mutableClass.createPrimitiveProperty(name, type);\n await newProperty.fromJSON(enumProps);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateEnumerationArrayPropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async createPrimitiveArrayProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n await mutableClass.createPrimitiveArrayProperty(name, type);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreatePrimitiveArrayProperty, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async createPrimitiveArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: PrimitiveType, primitiveProps: PrimitiveArrayPropertyProps): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n const newProperty = await mutableClass.createPrimitiveArrayProperty(name, type);\n await newProperty.fromJSON(primitiveProps);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreatePrimitiveArrayPropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async createEnumerationArrayProperty(classKey: SchemaItemKey, name: string, type: Enumeration): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n await mutableClass.createPrimitiveArrayProperty(name, type);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateEnumerationArrayProperty, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async createEnumerationArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: Enumeration, props: PrimitiveArrayPropertyProps): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n const newProperty = await mutableClass.createPrimitiveArrayProperty(name, type);\n await newProperty.fromJSON(props);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateEnumerationArrayPropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async createStructProperty(classKey: SchemaItemKey, name: string, type: StructClass): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n await mutableClass.createStructProperty(name, type);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateStructProperty, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async createStructPropertyFromProps(classKey: SchemaItemKey, name: string, type: StructClass, structProps: StructPropertyProps): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n const newProperty = await mutableClass.createStructProperty(name, type);\n await newProperty.fromJSON(structProps);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateStructPropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async createStructArrayProperty(classKey: SchemaItemKey, name: string, type: StructClass): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n await mutableClass.createStructArrayProperty(name, type);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateStructArrayProperty, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async createStructArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: StructClass, structProps: StructArrayPropertyProps): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n const newProperty = await mutableClass.createStructArrayProperty(name, type);\n await newProperty.fromJSON(structProps);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateStructArrayPropertyFromProps, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async deleteProperty(classKey: SchemaItemKey, name: string): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n await mutableClass.deleteProperty(name);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.DeleteProperty, new PropertyId(this.schemaItemType, classKey, name), e);\n }\n }\n\n public async delete(classKey: SchemaItemKey): Promise<void> {\n try {\n const schema = await this.getSchema(classKey.schemaKey);\n const ecClass = await schema.getItem(classKey.name, this.itemTypeClass);\n if (ecClass === undefined)\n return;\n\n await schema.deleteClass(ecClass.name);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.DeleteClass, new ClassId(this.schemaItemType, classKey), e);\n }\n }\n\n /**\n * Adds a CustomAttribute instance to the Class identified by the given SchemaItemKey\n * @param classKey The SchemaItemKey identifying the schema.\n * @param customAttribute The CustomAttribute instance to add.\n */\n public async addCustomAttribute(classKey: SchemaItemKey, customAttribute: CustomAttribute): Promise<void> {\n try {\n const mutableClass = await this.getClass(classKey);\n mutableClass.addCustomAttribute(customAttribute);\n\n const diagnosticIterable = Rules.validateCustomAttributeInstance(mutableClass, customAttribute);\n\n const diagnostics: AnyDiagnostic[] = [];\n for await (const diagnostic of diagnosticIterable) {\n diagnostics.push(diagnostic);\n }\n\n if (diagnostics.length > 0) {\n this.removeCustomAttribute(mutableClass, customAttribute);\n throw new SchemaEditingError(ECEditingStatus.RuleViolation, new CustomAttributeId(customAttribute.className, mutableClass), undefined, diagnostics);\n }\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.AddCustomAttributeToClass, new ClassId(this.schemaItemType, classKey), e);\n }\n }\n\n /**\n * Sets the base class of a SchemaItem.\n * @param itemKey The SchemaItemKey of the Item.\n * @param baseClassKey The SchemaItemKey of the base class. Specifying 'undefined' removes the base class.\n */\n public async setBaseClass(itemKey: SchemaItemKey, baseClassKey?: SchemaItemKey): Promise<void> {\n try {\n const classItem = await this.getSchemaItem(itemKey, this.itemTypeClass);\n if (!baseClassKey) {\n await (classItem as MutableClass).setBaseClass(undefined);\n return;\n }\n\n if(!await this.schemaEditor.schemaContext.getSchema(baseClassKey.schemaKey)) {\n throw new SchemaEditingError(ECEditingStatus.SchemaNotFound, new SchemaId(baseClassKey.schemaKey));\n }\n\n const baseClassItem = await this.getSchemaItem(baseClassKey, this.itemTypeClass);\n if (classItem.baseClass !== undefined && !await baseClassItem.is(await classItem.baseClass))\n throw new SchemaEditingError(ECEditingStatus.InvalidBaseClass, new ClassId(this.schemaItemType, baseClassKey), undefined, undefined, `Base class ${baseClassKey.fullName} must derive from ${(await classItem.baseClass).fullName}.`);\n\n await (classItem as MutableClass).setBaseClass(new DelayedPromiseWithProps<SchemaItemKey, ECClass>(baseClassKey, async () => baseClassItem));\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.SetBaseClass, new ClassId(this.schemaItemType, itemKey), e);\n }\n }\n\n private async getClass(classKey: SchemaItemKey): Promise<MutableClass> {\n const schema = await this.getSchema(classKey.schemaKey);\n\n const ecClass = await schema.getItem(classKey.name);\n if (ecClass === undefined)\n throw new SchemaEditingError(ECEditingStatus.SchemaItemNotFound, new ClassId(this.schemaItemType, classKey));\n\n if(!isMutableClass(ecClass))\n throw new SchemaEditingError(ECEditingStatus.InvalidSchemaItemType, new ClassId(this.schemaItemType, classKey));\n\n return ecClass;\n }\n\n protected removeCustomAttribute(container: CustomAttributeContainerProps, customAttribute: CustomAttribute) {\n assert(container.customAttributes !== undefined);\n const map = container.customAttributes as Map<string, CustomAttribute>;\n map.delete(customAttribute.className);\n }\n}\n\nfunction isMutableClass(schemaItem: SchemaItem): schemaItem is MutableClass {\n return ECClass.isECClass(schemaItem);\n}\n"]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Editing
|
|
3
|
+
*/
|
|
4
|
+
import { CustomAttribute, Schema, SchemaContext, SchemaItem, SchemaItemKey, SchemaItemType, SchemaKey } from "@itwin/ecschema-metadata";
|
|
5
|
+
import { MutableSchema } from "./Mutable/MutableSchema";
|
|
6
|
+
import { Constants } from "./Constants";
|
|
7
|
+
import { CustomAttributes } from "./CustomAttributes";
|
|
8
|
+
import { Entities } from "./Entities";
|
|
9
|
+
import { Enumerations } from "./Enumerations";
|
|
10
|
+
import { Formats } from "./Formats";
|
|
11
|
+
import { InvertedUnits } from "./InvertedUnits";
|
|
12
|
+
import { KindOfQuantities } from "./KindOfQuantities";
|
|
13
|
+
import { Mixins } from "./Mixins";
|
|
14
|
+
import { Phenomena } from "./Phenomena";
|
|
15
|
+
import { PropertyCategories } from "./PropertyCategories";
|
|
16
|
+
import { RelationshipClasses } from "./RelationshipClasses";
|
|
17
|
+
import { Structs } from "./Structs";
|
|
18
|
+
import { Units } from "./Units";
|
|
19
|
+
import { UnitSystems } from "./UnitSystems";
|
|
20
|
+
/**
|
|
21
|
+
* A class that allows you to edit and create schemas, classes, and items from the SchemaContext level.
|
|
22
|
+
* @alpha
|
|
23
|
+
*/
|
|
24
|
+
export declare class SchemaContextEditor {
|
|
25
|
+
private _schemaContext;
|
|
26
|
+
readonly entities: Entities;
|
|
27
|
+
readonly mixins: Mixins;
|
|
28
|
+
readonly structs: Structs;
|
|
29
|
+
readonly customAttributes: CustomAttributes;
|
|
30
|
+
readonly relationships: RelationshipClasses;
|
|
31
|
+
readonly constants: Constants;
|
|
32
|
+
readonly enumerations: Enumerations;
|
|
33
|
+
readonly formats: Formats;
|
|
34
|
+
readonly kindOfQuantities: KindOfQuantities;
|
|
35
|
+
readonly units: Units;
|
|
36
|
+
readonly phenomenons: Phenomena;
|
|
37
|
+
readonly unitSystems: UnitSystems;
|
|
38
|
+
readonly propertyCategories: PropertyCategories;
|
|
39
|
+
readonly invertedUnits: InvertedUnits;
|
|
40
|
+
/**
|
|
41
|
+
* Creates a new SchemaContextEditor instance.
|
|
42
|
+
* @param schemaContext The SchemaContext the Editor will use to edit in.
|
|
43
|
+
*/
|
|
44
|
+
constructor(schemaContext: SchemaContext);
|
|
45
|
+
/** Allows you to get schema classes and items through regular SchemaContext methods. */
|
|
46
|
+
get schemaContext(): SchemaContext;
|
|
47
|
+
finish(): Promise<SchemaContext>;
|
|
48
|
+
/**
|
|
49
|
+
* Helper method for retrieving a schema, previously added, from the SchemaContext.
|
|
50
|
+
* @param schemaKey The SchemaKey identifying the schema.
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
getSchema(schemaKey: SchemaKey): Promise<MutableSchema>;
|
|
54
|
+
/**
|
|
55
|
+
* Creates a Schema with the given properties and adds it to the current schema context.
|
|
56
|
+
* @param name The name given to the new schema.
|
|
57
|
+
* @param alias The alias of the new schema.
|
|
58
|
+
* @param readVersion The read version number of the schema.
|
|
59
|
+
* @param writeVersion The write version number of the schema.
|
|
60
|
+
* @param minorVersion The minor version number of the schema.
|
|
61
|
+
* @returns Resolves to the SchemaKey of created schema.
|
|
62
|
+
*/
|
|
63
|
+
createSchema(name: string, alias: string, readVersion: number, writeVersion: number, minorVersion: number): Promise<SchemaKey>;
|
|
64
|
+
/**
|
|
65
|
+
* Adds a referenced schema to the schema identified by the given SchemaKey.
|
|
66
|
+
* @param schemaKey The SchemaKey identifying the schema.
|
|
67
|
+
* @param refSchema The referenced schema to add.
|
|
68
|
+
*/
|
|
69
|
+
addSchemaReference(schemaKey: SchemaKey, refSchema: Schema): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Adds a CustomAttribute instance to the schema identified by the given SchemaKey
|
|
72
|
+
* @param schemaKey The SchemaKey identifying the schema.
|
|
73
|
+
* @param customAttribute The CustomAttribute instance to add.
|
|
74
|
+
*/
|
|
75
|
+
addCustomAttribute(schemaKey: SchemaKey, customAttribute: CustomAttribute): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Sets the schema version.
|
|
78
|
+
* @param schemaKey The SchemaKey identifying the schema.
|
|
79
|
+
* @param readVersion The read version of the schema. If not specified, the existing read version will be maintained.
|
|
80
|
+
* @param writeVersion The write version of the schema. If not specified, the existing write version will be maintained.
|
|
81
|
+
* @param minorVersion The minor version of the schema. If not specified, the existing minor version will be maintained.
|
|
82
|
+
* @returns Resolves to the new SchemaKey containing version updates.
|
|
83
|
+
*/
|
|
84
|
+
setVersion(schemaKey: SchemaKey, readVersion?: number, writeVersion?: number, minorVersion?: number): Promise<SchemaKey>;
|
|
85
|
+
/**
|
|
86
|
+
* Increments the minor version of a schema.
|
|
87
|
+
* @param schemaKey The SchemaKey identifying the schema.
|
|
88
|
+
* @returns Resolves to the new SchemaKey containing version updates.
|
|
89
|
+
*/
|
|
90
|
+
incrementMinorVersion(schemaKey: SchemaKey): Promise<SchemaKey>;
|
|
91
|
+
/** @internal */
|
|
92
|
+
lookupSchemaItem(schemaOrKey: Schema | SchemaKey, schemaItemKey: SchemaItemKey, schemaItemType: SchemaItemType): Promise<SchemaItem>;
|
|
93
|
+
/** @internal */
|
|
94
|
+
getSchemaItem<T extends typeof SchemaItem>(schemaItemKey: SchemaItemKey, itemConstructor: T): Promise<InstanceType<T>>;
|
|
95
|
+
private removeReference;
|
|
96
|
+
private removeCustomAttribute;
|
|
97
|
+
private lookupSchema;
|
|
98
|
+
/**
|
|
99
|
+
* Sets the Schemas description.
|
|
100
|
+
* @param schemaKey The SchemaKey identifying the schema.
|
|
101
|
+
* @param description The new description to set.
|
|
102
|
+
*/
|
|
103
|
+
setDescription(schemaKey: SchemaKey, description: string): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Sets the Schemas display label.
|
|
106
|
+
* @param schemaKey The SchemaKey identifying the schema.
|
|
107
|
+
* @param label The new label to set.
|
|
108
|
+
*/
|
|
109
|
+
setDisplayLabel(schemaKey: SchemaKey, label: string): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Sets the Schemas alias.
|
|
112
|
+
* @param schemaKey The SchemaKey identifying the schema.
|
|
113
|
+
* @param alias The new alias to set.
|
|
114
|
+
*/
|
|
115
|
+
setAlias(schemaKey: SchemaKey, alias: string): Promise<void>;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=Editor.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