@itwin/ecschema-editing 5.0.0-dev.11 → 5.0.0-dev.111
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 +71 -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 -2
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +56 -2
- 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 +33 -22
- 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 +11 -2
- 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 +3 -2
- package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.js +14 -10
- 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 +10 -3
- 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.d.ts +4 -4
- package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.d.ts.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.d.ts +7 -7
- package/lib/cjs/Editing/Mutable/MutableRelationshipClass.d.ts.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.map +1 -1
- package/lib/cjs/Editing/Properties.js +10 -8
- 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 +29 -22
- package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
- package/lib/cjs/Editing/SchemaItems.d.ts +3 -3
- package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -1
- package/lib/cjs/Editing/SchemaItems.js +11 -14
- 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.d.ts.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 +145 -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 +8 -6
- 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.d.ts.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 +5 -5
- 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 +24 -4
- 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 +5 -5
- 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 +41 -71
- 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 +47 -11
- 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 +67 -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 +139 -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 +92 -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 +781 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECRules.js","sourceRoot":"","sources":["../../../src/Validation/ECRules.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AAU,qBAAqB,CAAC,UAAkC;IACrE,MAAM,kBAAkB,GAAG,MAAM,UAAU,CAAC,kBAAkB,CAAC;IAC/D,IAAI,kBAAkB;QACpB,OAAO,kBAAkB,CAAC;IAE5B,MAAM,gBAAgB,GAAG,MAAM,UAAU,CAAC,iBAAiB,CAAC,SAA8B,CAAC;IAC3F,IAAI,CAAC,gBAAgB;QACnB,OAAO;IAET,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC;IAE/F,OAAO,qBAAqB,CAAC,cAAc,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Validation\r\n */\r\n\r\nimport {\r\n AnyClass, AnyProperty, CustomAttribute, CustomAttributeContainerProps, ECClass, ECClassModifier,\r\n ECStringConstants, EntityClass, Enumeration, PrimitiveProperty, PrimitiveType, primitiveTypeToString,\r\n Property, RelationshipClass, RelationshipConstraint, RelationshipMultiplicity, Schema, SchemaGraph, SchemaItemType,\r\n StrengthDirection, strengthDirectionToString,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport {\r\n ClassDiagnostic, createClassDiagnosticClass, createCustomAttributeContainerDiagnosticClass, createPropertyDiagnosticClass,\r\n createRelationshipConstraintDiagnosticClass, createSchemaDiagnosticClass, createSchemaItemDiagnosticClass, CustomAttributeContainerDiagnostic,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n DiagnosticType, PropertyDiagnostic, RelationshipConstraintDiagnostic, SchemaDiagnostic, SchemaItemDiagnostic,\r\n} from \"./Diagnostic\";\r\nimport { IRuleSet } from \"./Rules\";\r\n\r\nconst ruleSetName = \"ECObjects\";\r\n\r\nfunction getCode(code: number): string {\r\n return `${ruleSetName}-${code}`;\r\n}\r\n\r\n/**\r\n * The unique diagnostic codes for ECObjects rules.\r\n *\r\n * To provide meaning to code values, with anticipation\r\n * of future rules for all current EC Types, the following\r\n * value ranges should be used:\r\n *\r\n * - Schema: 000-099\r\n * - Class: 100-199\r\n * - Constant: 200-299\r\n * - CustomAttribute 300-399\r\n * - CustomAttributeClass: 400-499\r\n * - CustomAttributeContainer: 500-599\r\n * - EntityClass: 600-699\r\n * - Enumeration: 700-799\r\n * - Format: 800-899\r\n * - InvertedUnit: 900-999\r\n * - KindOfQuantity: 1000-1099\r\n * - Mixin: 1100-1199\r\n * - Phenomenon: 1200-1299\r\n * - Property: 1300-1399\r\n * - PropertyCategory: 1400-1499\r\n * - RelationshipClass: 1500-1599\r\n * - RelationshipConstraint: 1600-1699\r\n * - StructClass: 1700-1799\r\n * - Unit: 1800-1899\r\n * - UnitSystem: 1900-1999\r\n * @beta\r\n */\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\nexport const DiagnosticCodes = {\r\n // Class Rule Codes (100-199)\r\n BaseClassIsSealed: getCode(100),\r\n BaseClassOfDifferentType: getCode(101),\r\n // EC-102 has been deprecated. Leaving the code here to prevent re-use.\r\n AbstractClassWithNonAbstractBase: getCode(102),\r\n\r\n // CA Container Rule Codes (500-599)\r\n CustomAttributeNotOfConcreteClass: getCode(500),\r\n CustomAttributeSchemaMustBeReferenced: getCode(501),\r\n CustomAttributeClassNotFound: getCode(502),\r\n\r\n // Enumeration Rule Codes (700-799)\r\n EnumerationTypeUnsupported: getCode(700),\r\n\r\n // Mixin Rule Codes (1100-1199)\r\n MixinAppliedToClassMustDeriveFromConstraint: getCode(1100),\r\n\r\n // Property Rule Codes (1300-1399)\r\n IncompatibleValueTypePropertyOverride: getCode(1300),\r\n IncompatibleTypePropertyOverride: getCode(1301),\r\n IncompatibleUnitPropertyOverride: getCode(1302),\r\n\r\n // Relationship Rule Codes (1500-1599)\r\n AbstractConstraintMustNarrowBaseConstraints: getCode(1500),\r\n DerivedConstraintsMustNarrowBaseConstraints: getCode(1501),\r\n ConstraintClassesDeriveFromAbstractConstraint: getCode(1502),\r\n\r\n // Relationship Constraint Rule Codes (1600-1699)\r\n AtLeastOneConstraintClassDefined: getCode(1600),\r\n AbstractConstraintMustExistWithMultipleConstraints: getCode(1601),\r\n};\r\n\r\n/**\r\n * The list of [[IDiagnostic]] implementation classes used by the EC rule implementations.\r\n * @beta\r\n */\r\nexport const Diagnostics = {\r\n /** EC-001: Required message parameters: schema name, referenced schema name */\r\n SupplementalSchemasCannotBeReferenced: createSchemaDiagnosticClass<[string, string]>(getCode(1),\r\n \"Referenced schema '{1}' of schema '{0}' is a supplemental schema. Supplemental schemas are not allowed to be referenced.\"),\r\n\r\n /** EC-002: Required message parameters: schema name, reference schema alias, first schema reference name, second schema reference name. */\r\n SchemaRefAliasMustBeUnique: createSchemaDiagnosticClass<[string, string, string, string]>(getCode(2),\r\n \"Schema '{0}' has multiple schema references ({2}, {3}) with the same alias '{1}', which is not allowed.\"),\r\n\r\n /** EC-003: Required message parameters: schema name, cycle text */\r\n ReferenceCyclesNotAllowed: createSchemaDiagnosticClass<[string, string]>(getCode(3),\r\n \"Schema '{0}' has reference cycles: {1}\"),\r\n\r\n /** EC-100: Required message parameters: childClass.FullName, baseClass.FullName */\r\n BaseClassIsSealed: createClassDiagnosticClass<[string, string]>(DiagnosticCodes.BaseClassIsSealed,\r\n \"Class '{0}' cannot derive from sealed base class '{1}'.\"),\r\n\r\n /** EC-101: Required message parameters: childClass.FullName, baseClass.FullName, baseClass.schemaItemType */\r\n BaseClassIsOfDifferentType: createClassDiagnosticClass<[string, string, string]>(DiagnosticCodes.BaseClassOfDifferentType,\r\n \"Class '{0}' cannot derive from base class '{1}' of type '{2}'.\"),\r\n\r\n /** **DEPRECATED** EC-102: Required message parameters: childClass.FullName, baseClass.FullName */\r\n AbstractClassWithNonAbstractBase: createClassDiagnosticClass<[string, string]>(DiagnosticCodes.AbstractClassWithNonAbstractBase,\r\n \"Abstract Class '{0}' cannot derive from base class '{1}' because it is not an abstract class.\"),\r\n\r\n /** EC-500: Required message parameters: CustomAttribute container name and CustomAttributeClass name. */\r\n CustomAttributeNotOfConcreteClass: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeNotOfConcreteClass,\r\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' which is not a concrete class.\"),\r\n\r\n /** EC-501: Required message parameters: CustomAttribute container name, CustomAttributeClass name, CustomAttributeClass Schema name. */\r\n CustomAttributeSchemaMustBeReferenced: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeSchemaMustBeReferenced,\r\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' whose schema is not referenced by the container's Schema.\"),\r\n\r\n /** EC-502: Required message parameters: CustomAttribute container name and CustomAttributeClass name. */\r\n CustomAttributeClassNotFound: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeClassNotFound,\r\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' which cannot be found.\"),\r\n\r\n /** EC-700: Required message parameters: Enumeration name */\r\n EnumerationTypeUnsupported: createSchemaItemDiagnosticClass<Enumeration, [string]>(DiagnosticCodes.EnumerationTypeUnsupported,\r\n \"Enumeration '{0}' has invalid primitive type.\"),\r\n\r\n /** EC-1100: Required message parameters: mixin class fullName, class fullName, applies to constraint class fullName */\r\n MixinAppliedToClassMustDeriveFromConstraint: createSchemaItemDiagnosticClass<EntityClass, [string, string, string]>(DiagnosticCodes.MixinAppliedToClassMustDeriveFromConstraint,\r\n \"Mixin '{0}' cannot be applied to the class '{1}' because it does not satisfy the applies to constraint '{2}'.\"),\r\n\r\n /** EC-1300: Required message parameters: childClass.FullName, property name, baseClass.FullName, base value type, child value type */\r\n IncompatibleValueTypePropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string]>(DiagnosticCodes.IncompatibleValueTypePropertyOverride,\r\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with a value type of {3} which is incompatible with the value type of {4}.\"),\r\n\r\n /** EC-1301: Required message parameters: childClass.FullName, property name, baseClass.FullName, base property type, child property type */\r\n IncompatibleTypePropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string]>(DiagnosticCodes.IncompatibleTypePropertyOverride,\r\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with a type of {3} which is incompatible with the type of {4}.\"),\r\n\r\n /** EC-1302: Required message parameters: childClass.Name, property name, baseClass.Name, baseClass Koq name, baseClass Koq persistence unit name, child class Koq persistence unit name, child class Koq name */\r\n IncompatibleUnitPropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string, string, string]>(DiagnosticCodes.IncompatibleUnitPropertyOverride,\r\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with KindOfQuantity '{3}' with persistence unit '{4}' which is not the same as the persistence unit '{5}' of the provided KindOfQuantity '{6}'.\"),\r\n\r\n /** EC-1303: Required message parameters: property.fullName, navigation relationship.fullName */\r\n NavigationRelationshipMustBeRoot: createPropertyDiagnosticClass<[string, string]>(getCode(1303),\r\n \"The referenced relationship '{1}', used in NavigationProperty '{0}' is not the root relationship.\"),\r\n\r\n /** EC-1304: Required message parameters: property.fullName, navigation relationship.fullName */\r\n NavigationTargetMustHaveSingularMultiplicity: createPropertyDiagnosticClass<[string, string, string]>(getCode(1304),\r\n \"NavigationProperty '{0}' uses the relationship '{1}' that cannot be traversed in the '{2}' direction due to a max multiplicity greater than 1.\"),\r\n\r\n /** EC-1305: Required message parameters: property.fullName, navigation relationship.fullName */\r\n NavigationRelationshipAbstractConstraintEntityOrMixin: createPropertyDiagnosticClass<[string, string]>(getCode(1305),\r\n \"The NavigationProperty '{0}', using the relationship '{1}', points to a RelationshipClass, which is not allowed. NavigationProperties must point to an EntityClass or Mixin.\"),\r\n\r\n /** EC-1306: Required message parameters: class name, property name, navigation relationship.fullName */\r\n NavigationClassMustBeAConstraintClassOfRelationship: createPropertyDiagnosticClass<[string, string, string, string]>(getCode(1306),\r\n \"The class '{0}' of NavigationProperty '{1}' is not supported by the {3} constraint of the referenced relationship '{2}'.\"),\r\n\r\n /** EC-1500: Required message parameters: abstract constraint class name, relationship end (source/target), relationship name, base relationship name */\r\n AbstractConstraintMustNarrowBaseConstraints: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.AbstractConstraintMustNarrowBaseConstraints,\r\n \"The abstract constraint class '{0}' on the {1}-Constraint of '{2}' is not supported by the base class constraint in '{3}'.\"),\r\n\r\n /** EC-1501: Required message parameters: constraint class name, relationship end (source/target), relationship name, base relationship name */\r\n DerivedConstraintsMustNarrowBaseConstraints: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.DerivedConstraintsMustNarrowBaseConstraints,\r\n \"The constraint class '{0}' on the {1}-Constraint of '{2}' is not supported by the base class constraint in '{3}'.\"),\r\n\r\n /** EC-1502: Required message parameters: constraint class name, relationship end (source/target), relationship name, abstract constraint class name */\r\n ConstraintClassesDeriveFromAbstractConstraint: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.ConstraintClassesDeriveFromAbstractConstraint,\r\n \"The constraint class '{0}' on the {1}-Constraint of '{2}' is not derived from the abstract constraint class '{3}'.\"),\r\n\r\n /** EC-1600: Required message parameters: relationship end (source/target), relationship name */\r\n AtLeastOneConstraintClassDefined: createRelationshipConstraintDiagnosticClass<[string, string]>(DiagnosticCodes.AtLeastOneConstraintClassDefined,\r\n \"The {0}-Constraint of '{1}' does not contain any constraint classes.\"),\r\n\r\n /** EC-1601: Required message parameters: relationship end (source/target), relationship name */\r\n AbstractConstraintMustExistWithMultipleConstraints: createRelationshipConstraintDiagnosticClass<[string, string]>(DiagnosticCodes.AbstractConstraintMustExistWithMultipleConstraints,\r\n \"The {0}-Constraint of '{1}' has multiple constraint classes which requires an abstract constraint to be defined.\"),\r\n};\r\n\r\n/**\r\n * All schema validation rules that fall under the category of ECObjects.\r\n * @beta\r\n */\r\nexport const ECRuleSet: IRuleSet = {\r\n name: ruleSetName,\r\n\r\n schemaRules: [\r\n validateSchemaReferences,\r\n ],\r\n classRules: [\r\n baseClassIsSealed,\r\n baseClassIsOfDifferentType,\r\n ],\r\n propertyRules: [\r\n incompatibleValueTypePropertyOverride,\r\n incompatibleTypePropertyOverride,\r\n incompatibleUnitPropertyOverride,\r\n validateNavigationProperty,\r\n ],\r\n relationshipRules: [\r\n abstractConstraintMustNarrowBaseConstraints,\r\n constraintClassesDeriveFromAbstractConstraint,\r\n derivedConstraintsMustNarrowBaseConstraints,\r\n ],\r\n relationshipConstraintRules: [\r\n atLeastOneConstraintClassDefined,\r\n abstractConstraintMustExistWithMultipleConstraints,\r\n ],\r\n enumerationRules: [\r\n enumerationTypeUnsupported,\r\n ],\r\n entityClassRules: [\r\n mixinAppliedToClassMustDeriveFromConstraint,\r\n ],\r\n customAttributeInstanceRules: [\r\n validateCustomAttributeInstance,\r\n ],\r\n};\r\n\r\n/* eslint-enable @typescript-eslint/naming-convention */\r\n\r\n/**\r\n * Validates schema references against multiple EC rules.\r\n * @param schema The schema to validate.\r\n * @internal\r\n */\r\nexport async function* validateSchemaReferences(schema: Schema): AsyncIterable<SchemaDiagnostic<any[]>> {\r\n yield* validateSchemaReferencesSync(schema);\r\n}\r\n\r\n/**\r\n * Validates schema references against multiple EC rules.\r\n * @param schema The schema to validate.\r\n * @internal\r\n */\r\nexport function* validateSchemaReferencesSync(schema: Schema): Iterable<SchemaDiagnostic<any[]>> {\r\n const aliases = new Map();\r\n for (const schemaRef of schema.references) {\r\n if (schemaRef.customAttributes && schemaRef.customAttributes.has(\"CoreCustomAttributes.SupplementalSchema\"))\r\n yield new Diagnostics.SupplementalSchemasCannotBeReferenced(schema, [schema.name, schemaRef.name]);\r\n\r\n if (schema.schemaKey.matches(schemaRef.schemaKey))\r\n yield new Diagnostics.ReferenceCyclesNotAllowed(schema, [schema.name, `${schema.name} --> ${schemaRef.name}`]);\r\n\r\n if (aliases.has(schemaRef.alias)) {\r\n const currentRef = aliases.get(schemaRef.alias);\r\n yield new Diagnostics.SchemaRefAliasMustBeUnique(schema, [schema.name, schemaRef.alias, currentRef.name, schemaRef.name]);\r\n } else {\r\n aliases.set(schemaRef.alias, schemaRef);\r\n }\r\n }\r\n\r\n const graph = SchemaGraph.generateGraphSync(schema);\r\n const cycles = graph.detectCycles();\r\n if (cycles) {\r\n const result = cycles.map((cycle) => `${cycle.schema.schemaKey.name} --> ${cycle.refSchema.schemaKey.name}`).join(\", \");\r\n yield new Diagnostics.ReferenceCyclesNotAllowed(schema, [schema.name, result]);\r\n }\r\n}\r\n/**\r\n * EC Rule: Sealed classes cannot be a base class.\r\n * @internal\r\n */\r\nexport async function* baseClassIsSealed(ecClass: AnyClass): AsyncIterable<ClassDiagnostic<any[]>> {\r\n if (!ecClass.baseClass)\r\n return;\r\n\r\n const baseClass = await ecClass.baseClass;\r\n // return if rule passed\r\n if (baseClass.modifier !== ECClassModifier.Sealed)\r\n return;\r\n\r\n yield new Diagnostics.BaseClassIsSealed(ecClass, [ecClass.fullName, baseClass.fullName]);\r\n}\r\n\r\n/**\r\n * EC Rule: Base and child class must be of the same type (i.e. Entity, Mixin, Relationship, etc.)\r\n * @internal\r\n */\r\nexport async function* baseClassIsOfDifferentType(ecClass: AnyClass): AsyncIterable<ClassDiagnostic<any[]>> {\r\n if (!ecClass.baseClass)\r\n return;\r\n\r\n const baseClass = await ecClass.baseClass;\r\n // return if rule passed\r\n if (baseClass.schemaItemType === ecClass.schemaItemType)\r\n return;\r\n\r\n const itemType = baseClass.schemaItemType;\r\n yield new Diagnostics.BaseClassIsOfDifferentType(ecClass, [ecClass.fullName, baseClass.fullName, itemType]);\r\n}\r\n\r\n/**\r\n * EC Rule: When overriding a class primitive property, the child and base property must be of the same type (string, number, etc...).\r\n * @internal\r\n*/\r\nexport async function* incompatibleValueTypePropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\r\n if (!property.class.baseClass)\r\n return;\r\n\r\n const primitiveType = getPrimitiveType(property);\r\n if (!primitiveType)\r\n return;\r\n\r\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\r\n const baseProperty = await baseClass.getProperty(property.name);\r\n if (!baseProperty)\r\n return;\r\n\r\n // Other rules will catch this if false, but we need to make sure\r\n // types match for this rule to be valid.\r\n if (!propertyTypesMatch(property, baseProperty))\r\n return;\r\n\r\n const baseType = getPrimitiveType(baseProperty);\r\n\r\n // Return if rule passed\r\n if (!baseType || primitiveType === baseType)\r\n return;\r\n\r\n return new Diagnostics.IncompatibleValueTypePropertyOverride(property, [property.class.fullName, property.name, baseClass.fullName, primitiveTypeToString(baseType), primitiveTypeToString(primitiveType!)]);\r\n }\r\n\r\n for await (const baseClass of property.class.getAllBaseClasses()) {\r\n const result = await callback(baseClass);\r\n if (result)\r\n yield result;\r\n }\r\n}\r\n\r\n/**\r\n * EC Rule: When overriding a class property, the child and base property must be of the same property type (primitive, struct, enumeration, etc...).\r\n * @internal\r\n */\r\nexport async function* incompatibleTypePropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\r\n if (!property.class.baseClass)\r\n return;\r\n\r\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\r\n const baseProperty = await baseClass.getProperty(property.name);\r\n if (!baseProperty)\r\n return;\r\n\r\n // Return if rule passed\r\n if (propertyTypesMatch(property, baseProperty))\r\n return;\r\n\r\n return new Diagnostics.IncompatibleTypePropertyOverride(property, [property.class.fullName, property.name, baseClass.fullName, baseProperty.constructor.name, property.constructor.name]);\r\n }\r\n\r\n for await (const baseClass of property.class.getAllBaseClasses()) {\r\n const result = await callback(baseClass);\r\n if (result)\r\n yield result;\r\n }\r\n}\r\n\r\n/**\r\n * EC Rule: When overriding a kindOfQuantity property, the child and base property units must be the same.\r\n * @internal\r\n */\r\nexport async function* incompatibleUnitPropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\r\n if (!property.kindOfQuantity || !property.class.baseClass)\r\n return;\r\n\r\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\r\n const baseProperty = await baseClass.getProperty(property.name);\r\n if (!baseProperty || !baseProperty.kindOfQuantity)\r\n return;\r\n\r\n // Other rules will catch this if false, but we need to make sure\r\n // types match for this rule to be valid.\r\n if (!propertyTypesMatch(property, baseProperty))\r\n return;\r\n\r\n const koq = await property.kindOfQuantity;\r\n const baseKoq = await baseProperty.kindOfQuantity;\r\n if (!koq || !baseKoq)\r\n return;\r\n\r\n const unit = await koq.persistenceUnit;\r\n const baseUnit = await baseKoq.persistenceUnit;\r\n\r\n if (!unit || !baseUnit)\r\n return;\r\n\r\n // return if rule passed\r\n if (unit.key.matches(baseUnit.key))\r\n return;\r\n\r\n return new Diagnostics.IncompatibleUnitPropertyOverride(property, [\r\n property.class.fullName,\r\n property.name,\r\n baseClass.fullName,\r\n baseKoq.fullName,\r\n baseUnit.fullName,\r\n unit.fullName,\r\n koq.fullName,\r\n ]);\r\n }\r\n\r\n for await (const baseClass of property.class.getAllBaseClasses()) {\r\n const result = await callback(baseClass);\r\n if (result)\r\n yield result;\r\n }\r\n}\r\n\r\n/**\r\n * Validates Navigation Properties. EC Rules: 1303, 1304\r\n * @internal\r\n */\r\nexport async function* validateNavigationProperty(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\r\n if (!property.isNavigation())\r\n return;\r\n\r\n const navProp = property;\r\n const relationship = await navProp.relationshipClass;\r\n\r\n if (relationship.baseClass)\r\n yield new Diagnostics.NavigationRelationshipMustBeRoot(property, [property.fullName, relationship.fullName]);\r\n\r\n let thisConstraint: RelationshipConstraint;\r\n let thatConstraint: RelationshipConstraint;\r\n let navigationClassSide: string;\r\n if (navProp.direction === StrengthDirection.Forward) {\r\n thisConstraint = relationship.source;\r\n thatConstraint = relationship.target;\r\n navigationClassSide = \"source\";\r\n } else {\r\n thisConstraint = relationship.target;\r\n thatConstraint = relationship.source;\r\n navigationClassSide = \"target\";\r\n }\r\n\r\n const thatAbstractConstraint = await thatConstraint.abstractConstraint;\r\n if (thatAbstractConstraint && thatAbstractConstraint.schemaItemType === SchemaItemType.RelationshipClass) {\r\n yield new Diagnostics.NavigationRelationshipAbstractConstraintEntityOrMixin(property, [property.fullName, relationship.fullName]);\r\n }\r\n\r\n const isClassSupported = async (ecClass: ECClass, propertyName: string, constraintName: string): Promise<boolean> => {\r\n if (constraintName === ecClass.fullName && undefined !== await ecClass.getProperty(propertyName))\r\n return true;\r\n\r\n const inheritedProp = await ecClass.getInheritedProperty(propertyName);\r\n if (inheritedProp && constraintName === inheritedProp.class.fullName)\r\n return true;\r\n\r\n const baseClass = await ecClass.baseClass;\r\n if (!baseClass)\r\n return false;\r\n\r\n return isClassSupported(baseClass, propertyName, constraintName);\r\n };\r\n\r\n let classSupported = false;\r\n if (thisConstraint.constraintClasses) {\r\n for (const constraintClass of thisConstraint.constraintClasses) {\r\n classSupported = await isClassSupported(property.class, property.name, constraintClass.fullName);\r\n if (classSupported)\r\n break;\r\n }\r\n }\r\n\r\n if (!classSupported)\r\n yield new Diagnostics.NavigationClassMustBeAConstraintClassOfRelationship(property, [property.class.name, property.name, relationship.fullName, navigationClassSide]);\r\n\r\n if (thatConstraint.multiplicity === RelationshipMultiplicity.oneMany || thatConstraint.multiplicity === RelationshipMultiplicity.zeroMany) {\r\n const direction = strengthDirectionToString(navProp.direction);\r\n yield new Diagnostics.NavigationTargetMustHaveSingularMultiplicity(property, [property.fullName, relationship.fullName, direction]);\r\n }\r\n\r\n return;\r\n}\r\n\r\n/**\r\n * Validates a Relationship class and yields EC-1500, EC-1501, and EC-1502 rule violations.\r\n * @internal\r\n */\r\nexport async function* validateRelationship(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\r\n yield* abstractConstraintMustNarrowBaseConstraints(ecClass);\r\n yield* derivedConstraintsMustNarrowBaseConstraints(ecClass);\r\n yield* constraintClassesDeriveFromAbstractConstraint(ecClass);\r\n}\r\n\r\n/**\r\n * EC Rule: When overriding a RelationshipClass, the derived abstract constraint must narrow the base constraint classes.\r\n * @internal\r\n */\r\nexport async function* abstractConstraintMustNarrowBaseConstraints(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\r\n if (!ecClass.baseClass)\r\n return;\r\n\r\n const baseRelationship = await ecClass.baseClass as RelationshipClass;\r\n\r\n const sourceResult = await applyAbstractConstraintMustNarrowBaseConstraints(ecClass, ecClass.source, baseRelationship);\r\n if (sourceResult)\r\n yield sourceResult;\r\n const targetResult = await applyAbstractConstraintMustNarrowBaseConstraints(ecClass, ecClass.target, baseRelationship);\r\n if (targetResult)\r\n yield targetResult;\r\n}\r\n\r\n/**\r\n * EC Rule: When overriding a RelationshipClass, derived constraint classes must narrow base constraint classes.\r\n * @internal\r\n */\r\nexport async function* derivedConstraintsMustNarrowBaseConstraints(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\r\n if (!ecClass.baseClass)\r\n return;\r\n\r\n const baseRelationship = await ecClass.baseClass as RelationshipClass;\r\n\r\n const sourceResult = await applyDerivedConstraintsMustNarrowBaseConstraints(ecClass, ecClass.source, baseRelationship);\r\n if (sourceResult)\r\n yield sourceResult;\r\n const targetResult = await applyDerivedConstraintsMustNarrowBaseConstraints(ecClass, ecClass.target, baseRelationship);\r\n if (targetResult)\r\n yield targetResult;\r\n}\r\n\r\n/**\r\n * EC Rule: All constraint classes must have a common base class specified in the abstract constraint.\r\n * @internal\r\n */\r\nexport async function* constraintClassesDeriveFromAbstractConstraint(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\r\n const sourceResult = await applyConstraintClassesDeriveFromAbstractConstraint(ecClass, ecClass.source);\r\n if (sourceResult)\r\n yield sourceResult;\r\n const targetResult = await applyConstraintClassesDeriveFromAbstractConstraint(ecClass, ecClass.target);\r\n if (targetResult)\r\n yield targetResult;\r\n}\r\n\r\n/**\r\n * Validates a RelationshipConstraint and yields EC-1600 and EC-1601 rule violations.\r\n * @internal\r\n */\r\nexport async function* validateRelationshipConstraint(constraint: RelationshipConstraint): AsyncIterable<RelationshipConstraintDiagnostic<any[]>> {\r\n yield* atLeastOneConstraintClassDefined(constraint);\r\n yield* abstractConstraintMustExistWithMultipleConstraints(constraint);\r\n}\r\n\r\n/**\r\n * EC Rule: At least on concrete constraint class must be defined in the list of constraint classes.\r\n * @internal\r\n */\r\nexport async function* atLeastOneConstraintClassDefined(constraint: RelationshipConstraint): AsyncIterable<RelationshipConstraintDiagnostic<any[]>> {\r\n if (!constraint.constraintClasses || constraint.constraintClasses.length === 0) {\r\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\r\n yield new Diagnostics.AtLeastOneConstraintClassDefined(constraint, [constraintType, constraint.relationshipClass.fullName]);\r\n }\r\n}\r\n\r\n/**\r\n * EC Rule: If multiple constraints exist, an abstract constraint must be defined.\r\n * @internal\r\n */\r\nexport async function* abstractConstraintMustExistWithMultipleConstraints(constraint: RelationshipConstraint): AsyncIterable<RelationshipConstraintDiagnostic<any[]>> {\r\n if (!constraint.constraintClasses || constraint.constraintClasses.length <= 1) {\r\n return;\r\n }\r\n\r\n const abstractConstraint = await getAbstractConstraint(constraint);\r\n if (abstractConstraint)\r\n return;\r\n\r\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\r\n yield new Diagnostics.AbstractConstraintMustExistWithMultipleConstraints(constraint, [constraintType, constraint.relationshipClass.fullName]);\r\n}\r\n\r\nfunction propertyTypesMatch(propertyA: Property, propertyB: Property) {\r\n return propertyA.constructor.name === propertyB.constructor.name;\r\n}\r\n\r\nfunction getPrimitiveType(property: Property): PrimitiveType | undefined {\r\n if (property.isPrimitive())\r\n return (property as PrimitiveProperty).primitiveType;\r\n\r\n return undefined;\r\n}\r\n\r\n/**\r\n * EC Rule: Enumeration type must be a string or integer\r\n * @internal\r\n */\r\nexport async function* enumerationTypeUnsupported(enumeration: Enumeration): AsyncIterable<SchemaItemDiagnostic<Enumeration, any[]>> {\r\n const type = enumeration.type;\r\n if (type === PrimitiveType.Integer || type === PrimitiveType.String)\r\n return;\r\n\r\n yield new Diagnostics.EnumerationTypeUnsupported(enumeration, [enumeration.fullName]);\r\n}\r\n\r\n/**\r\n * EC Rule: Mixin applied to class must derived from the Mixin appliesTo constraint.\r\n * @internal\r\n */\r\nexport async function* mixinAppliedToClassMustDeriveFromConstraint(entityClass: EntityClass): AsyncIterable<SchemaItemDiagnostic<EntityClass, any[]>> {\r\n for (const lazyMixin of entityClass.mixins) {\r\n const mixin = await lazyMixin;\r\n if (!mixin.appliesTo)\r\n continue;\r\n\r\n if (!await entityClass.is(await mixin.appliesTo))\r\n yield new Diagnostics.MixinAppliedToClassMustDeriveFromConstraint(entityClass, [mixin.fullName, entityClass.fullName, mixin.appliesTo.fullName]);\r\n }\r\n\r\n return;\r\n}\r\n\r\n/**\r\n * Validates a custom attribute instance and yields EC-500, EC-501, and EC-502 rule violations.\r\n * @internal\r\n */\r\nexport async function* validateCustomAttributeInstance(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\r\n yield* customAttributeNotOfConcreteClass(container, customAttribute);\r\n yield* customAttributeSchemaMustBeReferenced(container, customAttribute);\r\n yield* customAttributeClassMustExist(container, customAttribute);\r\n}\r\n\r\n/** EC Rule: CustomAttribute instance must be of a concrete CustomAttributeClass. */\r\nasync function* customAttributeNotOfConcreteClass(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\r\n const schema = container.schema;\r\n const caClass = await schema.lookupItem(customAttribute.className) as ECClass;\r\n if (!caClass)\r\n return;\r\n\r\n if (caClass.modifier !== ECClassModifier.Abstract)\r\n return;\r\n\r\n yield new Diagnostics.CustomAttributeNotOfConcreteClass(container, [container.fullName, caClass.fullName]);\r\n}\r\n\r\n/** EC Rule: CustomAttribute Schema must be referenced by the container's Schema. */\r\nasync function* customAttributeSchemaMustBeReferenced(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\r\n const schema = container.schema;\r\n const nameParts = customAttribute.className.split(\".\");\r\n if (nameParts.length === 1 || nameParts[0] === schema.name)\r\n return;\r\n\r\n if (schema.references.some((s) => s.name === nameParts[0]))\r\n return;\r\n\r\n yield new Diagnostics.CustomAttributeSchemaMustBeReferenced(container, [container.fullName, customAttribute.className]);\r\n}\r\n\r\n/** EC Rule: CustomAttribute instance class must exist. */\r\nasync function* customAttributeClassMustExist(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\r\n const schema = container.schema;\r\n const caClass = await schema.lookupItem(customAttribute.className) as ECClass;\r\n if (!caClass)\r\n yield new Diagnostics.CustomAttributeClassNotFound(container, [container.fullName, customAttribute.className]);\r\n}\r\n\r\nasync function applyAbstractConstraintMustNarrowBaseConstraints(ecClass: RelationshipClass, constraint: RelationshipConstraint, baseRelationship: RelationshipClass): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\r\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\r\n const abstractConstraint = await constraint.abstractConstraint;\r\n if (!abstractConstraint)\r\n return;\r\n\r\n if (await baseConstraint.supportsClass(abstractConstraint))\r\n return;\r\n\r\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\r\n return new Diagnostics.AbstractConstraintMustNarrowBaseConstraints(ecClass, [abstractConstraint.fullName, constraintType, constraint.relationshipClass.fullName, baseRelationship.fullName]);\r\n}\r\n\r\nasync function applyDerivedConstraintsMustNarrowBaseConstraints(ecClass: RelationshipClass, constraint: RelationshipConstraint, baseRelationship: RelationshipClass): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\r\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\r\n\r\n if (!constraint.constraintClasses)\r\n return;\r\n\r\n for (const classPromise of constraint.constraintClasses) {\r\n const constraintClass = await classPromise;\r\n\r\n if (await baseConstraint.supportsClass(constraintClass))\r\n continue;\r\n\r\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\r\n return new Diagnostics.DerivedConstraintsMustNarrowBaseConstraints(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, baseRelationship.fullName]);\r\n }\r\n\r\n return;\r\n}\r\n\r\nasync function applyConstraintClassesDeriveFromAbstractConstraint(ecClass: RelationshipClass, constraint: RelationshipConstraint): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\r\n const abstractConstraint = await getAbstractConstraint(constraint);\r\n if (!abstractConstraint)\r\n return;\r\n\r\n if (!constraint.constraintClasses)\r\n return;\r\n\r\n for (const classPromise of constraint.constraintClasses) {\r\n const constraintClass = await classPromise;\r\n\r\n if (constraintClass.schemaItemType === SchemaItemType.Mixin && abstractConstraint.schemaItemType === SchemaItemType.EntityClass) {\r\n if (!await (constraintClass).applicableTo(abstractConstraint as EntityClass)) {\r\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\r\n return new Diagnostics.ConstraintClassesDeriveFromAbstractConstraint(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, abstractConstraint.fullName]);\r\n }\r\n continue;\r\n }\r\n\r\n if (!await constraintClass.is(abstractConstraint)) {\r\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\r\n return new Diagnostics.ConstraintClassesDeriveFromAbstractConstraint(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, abstractConstraint.fullName]);\r\n }\r\n }\r\n\r\n return;\r\n}\r\n\r\nasync function getAbstractConstraint(constraint: RelationshipConstraint): Promise<ECClass | undefined> {\r\n const abstractConstraint = await constraint.abstractConstraint;\r\n if (abstractConstraint)\r\n return abstractConstraint;\r\n\r\n const baseRelationship = await constraint.relationshipClass.baseClass as RelationshipClass;\r\n if (!baseRelationship)\r\n return;\r\n\r\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\r\n\r\n return getAbstractConstraint(baseConstraint);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ECRules.js","sourceRoot":"","sources":["../../../src/Validation/ECRules.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAsOH,4DAEC;AAOD,oEAuBC;AAKD,8CAUC;AAMD,gEAWC;AAMD,sFAgCC;AAMD,4EAqBC;AAMD,4EA6CC;AAMD,gEA6DC;AAMD,oDAIC;AAMD,kGAYC;AAMD,kGAYC;AAMD,sGAOC;AAMD,wEAGC;AAMD,4EAKC;AAMD,gHAWC;AAiBD,gEAMC;AAMD,kGAWC;AAMD,0EAIC;AA7mBD,gEAKkC;AAClC,6CAKsB;AAGtB,MAAM,WAAW,GAAG,WAAW,CAAC;AAEhC,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,GAAG,WAAW,IAAI,IAAI,EAAE,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,yDAAyD;AAC5C,QAAA,eAAe,GAAG;IAC7B,6BAA6B;IAC7B,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC,GAAG,CAAC;IACtC,uEAAuE;IACvE,gCAAgC,EAAE,OAAO,CAAC,GAAG,CAAC;IAE9C,oCAAoC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C,iBAAiB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;YAChM,CAAC;YACD,SAAS;QACX,CAAC;QAED,IAAI,CAAC,MAAM,eAAe,CAAC,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAClD,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,qCAAiB,CAAC,uBAAuB,CAAC,CAAC,CAAC,qCAAiB,CAAC,uBAAuB,CAAC;YACnI,OAAO,IAAI,mBAAW,CAAC,6CAA6C,CAAC,OAAO,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,CAAC,iBAAiB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAChM,CAAC;IACH,CAAC;IAED,OAAO;AACT,CAAC;AAED,KAAK,UAAU,qBAAqB,CAAC,UAAkC;IACrE,MAAM,kBAAkB,GAAG,MAAM,UAAU,CAAC,kBAAkB,CAAC;IAC/D,IAAI,kBAAkB;QACpB,OAAO,kBAAkB,CAAC;IAE5B,MAAM,gBAAgB,GAAG,MAAM,UAAU,CAAC,iBAAiB,CAAC,SAA8B,CAAC;IAC3F,IAAI,CAAC,gBAAgB;QACnB,OAAO;IAET,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC;IAE/F,OAAO,qBAAqB,CAAC,cAAc,CAAC,CAAC;AAC/C,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 Validation\n */\n\nimport {\n AnyClass, AnyProperty, CustomAttribute, CustomAttributeContainerProps, ECClass, ECClassModifier,\n ECStringConstants, EntityClass, Enumeration, Mixin, PrimitiveProperty, PrimitiveType, primitiveTypeToString,\n Property, RelationshipClass, RelationshipConstraint, RelationshipMultiplicity, Schema, SchemaGraph, SchemaItemType,\n StrengthDirection, strengthDirectionToString,\n} from \"@itwin/ecschema-metadata\";\nimport {\n ClassDiagnostic, createClassDiagnosticClass, createCustomAttributeContainerDiagnosticClass, createPropertyDiagnosticClass,\n createRelationshipConstraintDiagnosticClass, createSchemaDiagnosticClass, createSchemaItemDiagnosticClass, CustomAttributeContainerDiagnostic,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DiagnosticType, PropertyDiagnostic, RelationshipConstraintDiagnostic, SchemaDiagnostic, SchemaItemDiagnostic,\n} from \"./Diagnostic\";\nimport { IRuleSet } from \"./Rules\";\n\nconst ruleSetName = \"ECObjects\";\n\nfunction getCode(code: number): string {\n return `${ruleSetName}-${code}`;\n}\n\n/**\n * The unique diagnostic codes for ECObjects rules.\n *\n * To provide meaning to code values, with anticipation\n * of future rules for all current EC Types, the following\n * value ranges should be used:\n *\n * - Schema: 000-099\n * - Class: 100-199\n * - Constant: 200-299\n * - CustomAttribute 300-399\n * - CustomAttributeClass: 400-499\n * - CustomAttributeContainer: 500-599\n * - EntityClass: 600-699\n * - Enumeration: 700-799\n * - Format: 800-899\n * - InvertedUnit: 900-999\n * - KindOfQuantity: 1000-1099\n * - Mixin: 1100-1199\n * - Phenomenon: 1200-1299\n * - Property: 1300-1399\n * - PropertyCategory: 1400-1499\n * - RelationshipClass: 1500-1599\n * - RelationshipConstraint: 1600-1699\n * - StructClass: 1700-1799\n * - Unit: 1800-1899\n * - UnitSystem: 1900-1999\n * @beta\n */\n/* eslint-disable @typescript-eslint/naming-convention */\nexport const DiagnosticCodes = {\n // Class Rule Codes (100-199)\n BaseClassIsSealed: getCode(100),\n BaseClassOfDifferentType: getCode(101),\n // EC-102 has been deprecated. Leaving the code here to prevent re-use.\n AbstractClassWithNonAbstractBase: getCode(102),\n\n // CA Container Rule Codes (500-599)\n CustomAttributeNotOfConcreteClass: getCode(500),\n CustomAttributeSchemaMustBeReferenced: getCode(501),\n CustomAttributeClassNotFound: getCode(502),\n\n // Enumeration Rule Codes (700-799)\n EnumerationTypeUnsupported: getCode(700),\n\n // Mixin Rule Codes (1100-1199)\n MixinAppliedToClassMustDeriveFromConstraint: getCode(1100),\n\n // Property Rule Codes (1300-1399)\n IncompatibleValueTypePropertyOverride: getCode(1300),\n IncompatibleTypePropertyOverride: getCode(1301),\n IncompatibleUnitPropertyOverride: getCode(1302),\n\n // Relationship Rule Codes (1500-1599)\n AbstractConstraintMustNarrowBaseConstraints: getCode(1500),\n DerivedConstraintsMustNarrowBaseConstraints: getCode(1501),\n ConstraintClassesDeriveFromAbstractConstraint: getCode(1502),\n\n // Relationship Constraint Rule Codes (1600-1699)\n AtLeastOneConstraintClassDefined: getCode(1600),\n AbstractConstraintMustExistWithMultipleConstraints: getCode(1601),\n};\n\n/**\n * The list of [[IDiagnostic]] implementation classes used by the EC rule implementations.\n * @beta\n */\nexport const Diagnostics = {\n /** EC-001: Required message parameters: schema name, referenced schema name */\n SupplementalSchemasCannotBeReferenced: createSchemaDiagnosticClass<[string, string]>(getCode(1),\n \"Referenced schema '{1}' of schema '{0}' is a supplemental schema. Supplemental schemas are not allowed to be referenced.\"),\n\n /** EC-002: Required message parameters: schema name, reference schema alias, first schema reference name, second schema reference name. */\n SchemaRefAliasMustBeUnique: createSchemaDiagnosticClass<[string, string, string, string]>(getCode(2),\n \"Schema '{0}' has multiple schema references ({2}, {3}) with the same alias '{1}', which is not allowed.\"),\n\n /** EC-003: Required message parameters: schema name, cycle text */\n ReferenceCyclesNotAllowed: createSchemaDiagnosticClass<[string, string]>(getCode(3),\n \"Schema '{0}' has reference cycles: {1}\"),\n\n /** EC-100: Required message parameters: childClass.FullName, baseClass.FullName */\n BaseClassIsSealed: createClassDiagnosticClass<[string, string]>(DiagnosticCodes.BaseClassIsSealed,\n \"Class '{0}' cannot derive from sealed base class '{1}'.\"),\n\n /** EC-101: Required message parameters: childClass.FullName, baseClass.FullName, baseClass.schemaItemType */\n BaseClassIsOfDifferentType: createClassDiagnosticClass<[string, string, string]>(DiagnosticCodes.BaseClassOfDifferentType,\n \"Class '{0}' cannot derive from base class '{1}' of type '{2}'.\"),\n\n /** **DEPRECATED** EC-102: Required message parameters: childClass.FullName, baseClass.FullName */\n AbstractClassWithNonAbstractBase: createClassDiagnosticClass<[string, string]>(DiagnosticCodes.AbstractClassWithNonAbstractBase,\n \"Abstract Class '{0}' cannot derive from base class '{1}' because it is not an abstract class.\"),\n\n /** EC-500: Required message parameters: CustomAttribute container name and CustomAttributeClass name. */\n CustomAttributeNotOfConcreteClass: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeNotOfConcreteClass,\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' which is not a concrete class.\"),\n\n /** EC-501: Required message parameters: CustomAttribute container name, CustomAttributeClass name, CustomAttributeClass Schema name. */\n CustomAttributeSchemaMustBeReferenced: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeSchemaMustBeReferenced,\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' whose schema is not referenced by the container's Schema.\"),\n\n /** EC-502: Required message parameters: CustomAttribute container name and CustomAttributeClass name. */\n CustomAttributeClassNotFound: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeClassNotFound,\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' which cannot be found.\"),\n\n /** EC-700: Required message parameters: Enumeration name */\n EnumerationTypeUnsupported: createSchemaItemDiagnosticClass<Enumeration, [string]>(DiagnosticCodes.EnumerationTypeUnsupported,\n \"Enumeration '{0}' has invalid primitive type.\"),\n\n /** EC-1100: Required message parameters: mixin class fullName, class fullName, applies to constraint class fullName */\n MixinAppliedToClassMustDeriveFromConstraint: createSchemaItemDiagnosticClass<EntityClass, [string, string, string]>(DiagnosticCodes.MixinAppliedToClassMustDeriveFromConstraint,\n \"Mixin '{0}' cannot be applied to the class '{1}' because it does not satisfy the applies to constraint '{2}'.\"),\n\n /** EC-1300: Required message parameters: childClass.FullName, property name, baseClass.FullName, base value type, child value type */\n IncompatibleValueTypePropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string]>(DiagnosticCodes.IncompatibleValueTypePropertyOverride,\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with a value type of {3} which is incompatible with the value type of {4}.\"),\n\n /** EC-1301: Required message parameters: childClass.FullName, property name, baseClass.FullName, base property type, child property type */\n IncompatibleTypePropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string]>(DiagnosticCodes.IncompatibleTypePropertyOverride,\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with a type of {3} which is incompatible with the type of {4}.\"),\n\n /** EC-1302: Required message parameters: childClass.Name, property name, baseClass.Name, baseClass Koq name, baseClass Koq persistence unit name, child class Koq persistence unit name, child class Koq name */\n IncompatibleUnitPropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string, string, string]>(DiagnosticCodes.IncompatibleUnitPropertyOverride,\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with KindOfQuantity '{3}' with persistence unit '{4}' which is not the same as the persistence unit '{5}' of the provided KindOfQuantity '{6}'.\"),\n\n /** EC-1303: Required message parameters: property.fullName, navigation relationship.fullName */\n NavigationRelationshipMustBeRoot: createPropertyDiagnosticClass<[string, string]>(getCode(1303),\n \"The referenced relationship '{1}', used in NavigationProperty '{0}' is not the root relationship.\"),\n\n /** EC-1304: Required message parameters: property.fullName, navigation relationship.fullName */\n NavigationTargetMustHaveSingularMultiplicity: createPropertyDiagnosticClass<[string, string, string]>(getCode(1304),\n \"NavigationProperty '{0}' uses the relationship '{1}' that cannot be traversed in the '{2}' direction due to a max multiplicity greater than 1.\"),\n\n /** EC-1305: Required message parameters: property.fullName, navigation relationship.fullName */\n NavigationRelationshipAbstractConstraintEntityOrMixin: createPropertyDiagnosticClass<[string, string]>(getCode(1305),\n \"The NavigationProperty '{0}', using the relationship '{1}', points to a RelationshipClass, which is not allowed. NavigationProperties must point to an EntityClass or Mixin.\"),\n\n /** EC-1306: Required message parameters: class name, property name, navigation relationship.fullName */\n NavigationClassMustBeAConstraintClassOfRelationship: createPropertyDiagnosticClass<[string, string, string, string]>(getCode(1306),\n \"The class '{0}' of NavigationProperty '{1}' is not supported by the {3} constraint of the referenced relationship '{2}'.\"),\n\n /** EC-1500: Required message parameters: abstract constraint class name, relationship end (source/target), relationship name, base relationship name */\n AbstractConstraintMustNarrowBaseConstraints: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.AbstractConstraintMustNarrowBaseConstraints,\n \"The abstract constraint class '{0}' on the {1}-Constraint of '{2}' is not supported by the base class constraint in '{3}'.\"),\n\n /** EC-1501: Required message parameters: constraint class name, relationship end (source/target), relationship name, base relationship name */\n DerivedConstraintsMustNarrowBaseConstraints: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.DerivedConstraintsMustNarrowBaseConstraints,\n \"The constraint class '{0}' on the {1}-Constraint of '{2}' is not supported by the base class constraint in '{3}'.\"),\n\n /** EC-1502: Required message parameters: constraint class name, relationship end (source/target), relationship name, abstract constraint class name */\n ConstraintClassesDeriveFromAbstractConstraint: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.ConstraintClassesDeriveFromAbstractConstraint,\n \"The constraint class '{0}' on the {1}-Constraint of '{2}' is not derived from the abstract constraint class '{3}'.\"),\n\n /** EC-1600: Required message parameters: relationship end (source/target), relationship name */\n AtLeastOneConstraintClassDefined: createRelationshipConstraintDiagnosticClass<[string, string]>(DiagnosticCodes.AtLeastOneConstraintClassDefined,\n \"The {0}-Constraint of '{1}' does not contain any constraint classes.\"),\n\n /** EC-1601: Required message parameters: relationship end (source/target), relationship name */\n AbstractConstraintMustExistWithMultipleConstraints: createRelationshipConstraintDiagnosticClass<[string, string]>(DiagnosticCodes.AbstractConstraintMustExistWithMultipleConstraints,\n \"The {0}-Constraint of '{1}' has multiple constraint classes which requires an abstract constraint to be defined.\"),\n};\n\n/**\n * All schema validation rules that fall under the category of ECObjects.\n * @beta\n */\nexport const ECRuleSet: IRuleSet = {\n name: ruleSetName,\n\n schemaRules: [\n validateSchemaReferences,\n ],\n classRules: [\n baseClassIsSealed,\n baseClassIsOfDifferentType,\n ],\n propertyRules: [\n incompatibleValueTypePropertyOverride,\n incompatibleTypePropertyOverride,\n incompatibleUnitPropertyOverride,\n validateNavigationProperty,\n ],\n relationshipRules: [\n abstractConstraintMustNarrowBaseConstraints,\n constraintClassesDeriveFromAbstractConstraint,\n derivedConstraintsMustNarrowBaseConstraints,\n ],\n relationshipConstraintRules: [\n atLeastOneConstraintClassDefined,\n abstractConstraintMustExistWithMultipleConstraints,\n ],\n enumerationRules: [\n enumerationTypeUnsupported,\n ],\n entityClassRules: [\n mixinAppliedToClassMustDeriveFromConstraint,\n ],\n customAttributeInstanceRules: [\n validateCustomAttributeInstance,\n ],\n};\n\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/**\n * Validates schema references against multiple EC rules.\n * @param schema The schema to validate.\n * @internal\n */\nexport async function* validateSchemaReferences(schema: Schema): AsyncIterable<SchemaDiagnostic<any[]>> {\n yield* validateSchemaReferencesSync(schema);\n}\n\n/**\n * Validates schema references against multiple EC rules.\n * @param schema The schema to validate.\n * @internal\n */\nexport function* validateSchemaReferencesSync(schema: Schema): Iterable<SchemaDiagnostic<any[]>> {\n const aliases = new Map();\n for (const schemaRef of schema.references) {\n if (schemaRef.customAttributes && schemaRef.customAttributes.has(\"CoreCustomAttributes.SupplementalSchema\"))\n yield new Diagnostics.SupplementalSchemasCannotBeReferenced(schema, [schema.name, schemaRef.name]);\n\n if (schema.schemaKey.matches(schemaRef.schemaKey))\n yield new Diagnostics.ReferenceCyclesNotAllowed(schema, [schema.name, `${schema.name} --> ${schemaRef.name}`]);\n\n if (aliases.has(schemaRef.alias)) {\n const currentRef = aliases.get(schemaRef.alias);\n yield new Diagnostics.SchemaRefAliasMustBeUnique(schema, [schema.name, schemaRef.alias, currentRef.name, schemaRef.name]);\n } else {\n aliases.set(schemaRef.alias, schemaRef);\n }\n }\n\n const graph = SchemaGraph.generateGraphSync(schema);\n const cycles = graph.detectCycles();\n if (cycles) {\n const result = cycles.map((cycle) => `${cycle.schema.schemaKey.name} --> ${cycle.refSchema.schemaKey.name}`).join(\", \");\n yield new Diagnostics.ReferenceCyclesNotAllowed(schema, [schema.name, result]);\n }\n}\n/**\n * EC Rule: Sealed classes cannot be a base class.\n * @internal\n */\nexport async function* baseClassIsSealed(ecClass: AnyClass): AsyncIterable<ClassDiagnostic<any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseClass = await ecClass.baseClass;\n // return if rule passed\n if (baseClass.modifier !== ECClassModifier.Sealed)\n return;\n\n yield new Diagnostics.BaseClassIsSealed(ecClass, [ecClass.fullName, baseClass.fullName]);\n}\n\n/**\n * EC Rule: Base and child class must be of the same type (i.e. Entity, Mixin, Relationship, etc.)\n * @internal\n */\nexport async function* baseClassIsOfDifferentType(ecClass: AnyClass): AsyncIterable<ClassDiagnostic<any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseClass = await ecClass.baseClass;\n // return if rule passed\n if (baseClass.schemaItemType === ecClass.schemaItemType)\n return;\n\n const itemType = baseClass.schemaItemType;\n yield new Diagnostics.BaseClassIsOfDifferentType(ecClass, [ecClass.fullName, baseClass.fullName, itemType]);\n}\n\n/**\n * EC Rule: When overriding a class primitive property, the child and base property must be of the same type (string, number, etc...).\n * @internal\n*/\nexport async function* incompatibleValueTypePropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.class.baseClass)\n return;\n\n const primitiveType = getPrimitiveType(property);\n if (!primitiveType)\n return;\n\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\n const baseProperty = await baseClass.getProperty(property.name, true);\n if (!baseProperty)\n return;\n\n // Other rules will catch this if false, but we need to make sure\n // types match for this rule to be valid.\n if (!propertyTypesMatch(property, baseProperty))\n return;\n\n const baseType = getPrimitiveType(baseProperty);\n\n // Return if rule passed\n if (!baseType || primitiveType === baseType)\n return;\n\n return new Diagnostics.IncompatibleValueTypePropertyOverride(property, [property.class.fullName, property.name, baseClass.fullName, primitiveTypeToString(baseType), primitiveTypeToString(primitiveType!)]);\n }\n\n for await (const baseClass of property.class.getAllBaseClasses()) {\n const result = await callback(baseClass);\n if (result)\n yield result;\n }\n}\n\n/**\n * EC Rule: When overriding a class property, the child and base property must be of the same property type (primitive, struct, enumeration, etc...).\n * @internal\n */\nexport async function* incompatibleTypePropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.class.baseClass)\n return;\n\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\n const baseProperty = await baseClass.getProperty(property.name, true);\n if (!baseProperty)\n return;\n\n // Return if rule passed\n if (propertyTypesMatch(property, baseProperty))\n return;\n\n return new Diagnostics.IncompatibleTypePropertyOverride(property, [property.class.fullName, property.name, baseClass.fullName, baseProperty.constructor.name, property.constructor.name]);\n }\n\n for await (const baseClass of property.class.getAllBaseClasses()) {\n const result = await callback(baseClass);\n if (result)\n yield result;\n }\n}\n\n/**\n * EC Rule: When overriding a kindOfQuantity property, the child and base property units must be the same.\n * @internal\n */\nexport async function* incompatibleUnitPropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.kindOfQuantity || !property.class.baseClass)\n return;\n\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\n const baseProperty = await baseClass.getProperty(property.name, true);\n if (!baseProperty || !baseProperty.kindOfQuantity)\n return;\n\n // Other rules will catch this if false, but we need to make sure\n // types match for this rule to be valid.\n if (!propertyTypesMatch(property, baseProperty))\n return;\n\n const koq = await property.kindOfQuantity;\n const baseKoq = await baseProperty.kindOfQuantity;\n if (!koq || !baseKoq)\n return;\n\n const unit = await koq.persistenceUnit;\n const baseUnit = await baseKoq.persistenceUnit;\n\n if (!unit || !baseUnit)\n return;\n\n // return if rule passed\n if (unit.key.matches(baseUnit.key))\n return;\n\n return new Diagnostics.IncompatibleUnitPropertyOverride(property, [\n property.class.fullName,\n property.name,\n baseClass.fullName,\n baseKoq.fullName,\n baseUnit.fullName,\n unit.fullName,\n koq.fullName,\n ]);\n }\n\n for await (const baseClass of property.class.getAllBaseClasses()) {\n const result = await callback(baseClass);\n if (result)\n yield result;\n }\n}\n\n/**\n * Validates Navigation Properties. EC Rules: 1303, 1304\n * @internal\n */\nexport async function* validateNavigationProperty(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.isNavigation())\n return;\n\n const navProp = property;\n const relationship = await navProp.relationshipClass;\n\n if (relationship.baseClass)\n yield new Diagnostics.NavigationRelationshipMustBeRoot(property, [property.fullName, relationship.fullName]);\n\n let thisConstraint: RelationshipConstraint;\n let thatConstraint: RelationshipConstraint;\n let navigationClassSide: string;\n if (navProp.direction === StrengthDirection.Forward) {\n thisConstraint = relationship.source;\n thatConstraint = relationship.target;\n navigationClassSide = \"source\";\n } else {\n thisConstraint = relationship.target;\n thatConstraint = relationship.source;\n navigationClassSide = \"target\";\n }\n\n const thatAbstractConstraint = await thatConstraint.abstractConstraint;\n if (thatAbstractConstraint && thatAbstractConstraint.schemaItemType === SchemaItemType.RelationshipClass) {\n yield new Diagnostics.NavigationRelationshipAbstractConstraintEntityOrMixin(property, [property.fullName, relationship.fullName]);\n }\n\n const isClassSupported = async (ecClass: ECClass, propertyName: string, constraintName: string): Promise<boolean> => {\n if (constraintName === ecClass.fullName && undefined !== await ecClass.getProperty(propertyName, true))\n return true;\n\n const inheritedProp = await ecClass.getInheritedProperty(propertyName);\n if (inheritedProp && constraintName === inheritedProp.class.fullName)\n return true;\n\n const baseClass = await ecClass.baseClass;\n if (!baseClass)\n return false;\n\n return isClassSupported(baseClass, propertyName, constraintName);\n };\n\n let classSupported = false;\n if (thisConstraint.constraintClasses) {\n for (const constraintClass of thisConstraint.constraintClasses) {\n classSupported = await isClassSupported(property.class, property.name, constraintClass.fullName);\n if (classSupported)\n break;\n }\n }\n\n if (!classSupported)\n yield new Diagnostics.NavigationClassMustBeAConstraintClassOfRelationship(property, [property.class.name, property.name, relationship.fullName, navigationClassSide]);\n\n if (thatConstraint.multiplicity === RelationshipMultiplicity.oneMany || thatConstraint.multiplicity === RelationshipMultiplicity.zeroMany) {\n const direction = strengthDirectionToString(navProp.direction);\n yield new Diagnostics.NavigationTargetMustHaveSingularMultiplicity(property, [property.fullName, relationship.fullName, direction]);\n }\n\n return;\n}\n\n/**\n * Validates a Relationship class and yields EC-1500, EC-1501, and EC-1502 rule violations.\n * @internal\n */\nexport async function* validateRelationship(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\n yield* abstractConstraintMustNarrowBaseConstraints(ecClass);\n yield* derivedConstraintsMustNarrowBaseConstraints(ecClass);\n yield* constraintClassesDeriveFromAbstractConstraint(ecClass);\n}\n\n/**\n * EC Rule: When overriding a RelationshipClass, the derived abstract constraint must narrow the base constraint classes.\n * @internal\n */\nexport async function* abstractConstraintMustNarrowBaseConstraints(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseRelationship = await ecClass.baseClass as RelationshipClass;\n\n const sourceResult = await applyAbstractConstraintMustNarrowBaseConstraints(ecClass, ecClass.source, baseRelationship);\n if (sourceResult)\n yield sourceResult;\n const targetResult = await applyAbstractConstraintMustNarrowBaseConstraints(ecClass, ecClass.target, baseRelationship);\n if (targetResult)\n yield targetResult;\n}\n\n/**\n * EC Rule: When overriding a RelationshipClass, derived constraint classes must narrow base constraint classes.\n * @internal\n */\nexport async function* derivedConstraintsMustNarrowBaseConstraints(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseRelationship = await ecClass.baseClass as RelationshipClass;\n\n const sourceResult = await applyDerivedConstraintsMustNarrowBaseConstraints(ecClass, ecClass.source, baseRelationship);\n if (sourceResult)\n yield sourceResult;\n const targetResult = await applyDerivedConstraintsMustNarrowBaseConstraints(ecClass, ecClass.target, baseRelationship);\n if (targetResult)\n yield targetResult;\n}\n\n/**\n * EC Rule: All constraint classes must have a common base class specified in the abstract constraint.\n * @internal\n */\nexport async function* constraintClassesDeriveFromAbstractConstraint(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\n const sourceResult = await applyConstraintClassesDeriveFromAbstractConstraint(ecClass, ecClass.source);\n if (sourceResult)\n yield sourceResult;\n const targetResult = await applyConstraintClassesDeriveFromAbstractConstraint(ecClass, ecClass.target);\n if (targetResult)\n yield targetResult;\n}\n\n/**\n * Validates a RelationshipConstraint and yields EC-1600 and EC-1601 rule violations.\n * @internal\n */\nexport async function* validateRelationshipConstraint(constraint: RelationshipConstraint): AsyncIterable<RelationshipConstraintDiagnostic<any[]>> {\n yield* atLeastOneConstraintClassDefined(constraint);\n yield* abstractConstraintMustExistWithMultipleConstraints(constraint);\n}\n\n/**\n * EC Rule: At least on concrete constraint class must be defined in the list of constraint classes.\n * @internal\n */\nexport async function* atLeastOneConstraintClassDefined(constraint: RelationshipConstraint): AsyncIterable<RelationshipConstraintDiagnostic<any[]>> {\n if (!constraint.constraintClasses || constraint.constraintClasses.length === 0) {\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n yield new Diagnostics.AtLeastOneConstraintClassDefined(constraint, [constraintType, constraint.relationshipClass.fullName]);\n }\n}\n\n/**\n * EC Rule: If multiple constraints exist, an abstract constraint must be defined.\n * @internal\n */\nexport async function* abstractConstraintMustExistWithMultipleConstraints(constraint: RelationshipConstraint): AsyncIterable<RelationshipConstraintDiagnostic<any[]>> {\n if (!constraint.constraintClasses || constraint.constraintClasses.length <= 1) {\n return;\n }\n\n const abstractConstraint = await getAbstractConstraint(constraint);\n if (abstractConstraint)\n return;\n\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n yield new Diagnostics.AbstractConstraintMustExistWithMultipleConstraints(constraint, [constraintType, constraint.relationshipClass.fullName]);\n}\n\nfunction propertyTypesMatch(propertyA: Property, propertyB: Property) {\n return propertyA.constructor.name === propertyB.constructor.name;\n}\n\nfunction getPrimitiveType(property: Property): PrimitiveType | undefined {\n if (property.isPrimitive())\n return (property as PrimitiveProperty).primitiveType;\n\n return undefined;\n}\n\n/**\n * EC Rule: Enumeration type must be a string or integer\n * @internal\n */\nexport async function* enumerationTypeUnsupported(enumeration: Enumeration): AsyncIterable<SchemaItemDiagnostic<Enumeration, any[]>> {\n const type = enumeration.type;\n if (type === PrimitiveType.Integer || type === PrimitiveType.String)\n return;\n\n yield new Diagnostics.EnumerationTypeUnsupported(enumeration, [enumeration.fullName]);\n}\n\n/**\n * EC Rule: Mixin applied to class must derived from the Mixin appliesTo constraint.\n * @internal\n */\nexport async function* mixinAppliedToClassMustDeriveFromConstraint(entityClass: EntityClass): AsyncIterable<SchemaItemDiagnostic<EntityClass, any[]>> {\n for (const lazyMixin of entityClass.mixins) {\n const mixin = await lazyMixin;\n if (!mixin.appliesTo)\n continue;\n\n if (!await entityClass.is(await mixin.appliesTo))\n yield new Diagnostics.MixinAppliedToClassMustDeriveFromConstraint(entityClass, [mixin.fullName, entityClass.fullName, mixin.appliesTo.fullName]);\n }\n\n return;\n}\n\n/**\n * Validates a custom attribute instance and yields EC-500, EC-501, and EC-502 rule violations.\n * @internal\n */\nexport async function* validateCustomAttributeInstance(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n yield* customAttributeNotOfConcreteClass(container, customAttribute);\n yield* customAttributeSchemaMustBeReferenced(container, customAttribute);\n yield* customAttributeClassMustExist(container, customAttribute);\n}\n\n/** EC Rule: CustomAttribute instance must be of a concrete CustomAttributeClass. */\nasync function* customAttributeNotOfConcreteClass(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n const schema = container.schema;\n const caClass = await schema.lookupItem(customAttribute.className) as ECClass;\n if (!caClass)\n return;\n\n if (caClass.modifier !== ECClassModifier.Abstract)\n return;\n\n yield new Diagnostics.CustomAttributeNotOfConcreteClass(container, [container.fullName, caClass.fullName]);\n}\n\n/** EC Rule: CustomAttribute Schema must be referenced by the container's Schema. */\nasync function* customAttributeSchemaMustBeReferenced(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n const schema = container.schema;\n const nameParts = customAttribute.className.split(\".\");\n if (nameParts.length === 1 || nameParts[0] === schema.name)\n return;\n\n if (schema.references.some((s) => s.name === nameParts[0]))\n return;\n\n yield new Diagnostics.CustomAttributeSchemaMustBeReferenced(container, [container.fullName, customAttribute.className]);\n}\n\n/** EC Rule: CustomAttribute instance class must exist. */\nasync function* customAttributeClassMustExist(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n const schema = container.schema;\n const caClass = await schema.lookupItem(customAttribute.className) as ECClass;\n if (!caClass)\n yield new Diagnostics.CustomAttributeClassNotFound(container, [container.fullName, customAttribute.className]);\n}\n\nasync function applyAbstractConstraintMustNarrowBaseConstraints(ecClass: RelationshipClass, constraint: RelationshipConstraint, baseRelationship: RelationshipClass): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\n const abstractConstraint = await constraint.abstractConstraint;\n if (!abstractConstraint)\n return;\n\n if (await baseConstraint.supportsClass(abstractConstraint))\n return;\n\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.AbstractConstraintMustNarrowBaseConstraints(ecClass, [abstractConstraint.fullName, constraintType, constraint.relationshipClass.fullName, baseRelationship.fullName]);\n}\n\nasync function applyDerivedConstraintsMustNarrowBaseConstraints(ecClass: RelationshipClass, constraint: RelationshipConstraint, baseRelationship: RelationshipClass): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\n\n if (!constraint.constraintClasses)\n return;\n\n for (const classPromise of constraint.constraintClasses) {\n const constraintClass = await classPromise;\n\n if (await baseConstraint.supportsClass(constraintClass))\n continue;\n\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.DerivedConstraintsMustNarrowBaseConstraints(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, baseRelationship.fullName]);\n }\n\n return;\n}\n\nasync function applyConstraintClassesDeriveFromAbstractConstraint(ecClass: RelationshipClass, constraint: RelationshipConstraint): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\n const abstractConstraint = await getAbstractConstraint(constraint);\n if (!abstractConstraint)\n return;\n\n if (!constraint.constraintClasses)\n return;\n\n for (const classPromise of constraint.constraintClasses) {\n const constraintClass = await classPromise;\n\n if (Mixin.isMixin(constraintClass) && EntityClass.isEntityClass(abstractConstraint)) {\n if (!await (constraintClass).applicableTo(abstractConstraint)) {\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.ConstraintClassesDeriveFromAbstractConstraint(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, abstractConstraint.fullName]);\n }\n continue;\n }\n\n if (!await constraintClass.is(abstractConstraint)) {\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.ConstraintClassesDeriveFromAbstractConstraint(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, abstractConstraint.fullName]);\n }\n }\n\n return;\n}\n\nasync function getAbstractConstraint(constraint: RelationshipConstraint): Promise<ECClass | undefined> {\n const abstractConstraint = await constraint.abstractConstraint;\n if (abstractConstraint)\n return abstractConstraint;\n\n const baseRelationship = await constraint.relationshipClass.baseClass as RelationshipClass;\n if (!baseRelationship)\n return;\n\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\n\n return getAbstractConstraint(baseConstraint);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggingDiagnosticReporter.js","sourceRoot":"","sources":["../../../src/Validation/LoggingDiagnosticReporter.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,6CAAiE;AACjE,6DAAgE;AAEhE,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,6CAAwB;IAC9D,gBAAgB,CAAC,UAAyB,EAAE,WAAmB;QACpE,QAAQ,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC5B,KAAK,+BAAkB,CAAC,KAAK;gBAC3B,qBAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;gBACrF,OAAO;YACT,KAAK,+BAAkB,CAAC,OAAO;gBAC7B,qBAAM,CAAC,UAAU,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;gBACvF,OAAO;YACT,KAAK,+BAAkB,CAAC,OAAO,CAAC;YAChC,KAAK,+BAAkB,CAAC,UAAU;gBAChC,qBAAM,CAAC,OAAO,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;gBACpF,OAAO;YACT;gBACE,qBAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,UAAyB;QAC9C,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,CAAC,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC;IACnL,CAAC;CACF;AArBD,8DAqBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"LoggingDiagnosticReporter.js","sourceRoot":"","sources":["../../../src/Validation/LoggingDiagnosticReporter.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,6CAAiE;AACjE,6DAAgE;AAEhE,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,6CAAwB;IAC9D,gBAAgB,CAAC,UAAyB,EAAE,WAAmB;QACpE,QAAQ,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC5B,KAAK,+BAAkB,CAAC,KAAK;gBAC3B,qBAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;gBACrF,OAAO;YACT,KAAK,+BAAkB,CAAC,OAAO;gBAC7B,qBAAM,CAAC,UAAU,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;gBACvF,OAAO;YACT,KAAK,+BAAkB,CAAC,OAAO,CAAC;YAChC,KAAK,+BAAkB,CAAC,UAAU;gBAChC,qBAAM,CAAC,OAAO,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;gBACpF,OAAO;YACT;gBACE,qBAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,UAAyB;QAC9C,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,CAAC,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC;IACnL,CAAC;CACF;AArBD,8DAqBC","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 Diagnostic\n */\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { AnyDiagnostic, DiagnosticCategory } from \"./Diagnostic\";\nimport { FormatDiagnosticReporter } from \"./DiagnosticReporter\";\n\nconst loggingCategory = \"ecschema-metadata\";\n\n/**\n * An [[IDiagnosticReporter]] for logging [[IDiagnostic]] objects.\n * @beta\n */\nexport class LoggingDiagnosticReporter extends FormatDiagnosticReporter {\n public reportDiagnostic(diagnostic: AnyDiagnostic, messageText: string) {\n switch (diagnostic.category) {\n case DiagnosticCategory.Error:\n Logger.logError(loggingCategory, messageText, () => this.getLogMetaData(diagnostic));\n return;\n case DiagnosticCategory.Warning:\n Logger.logWarning(loggingCategory, messageText, () => this.getLogMetaData(diagnostic));\n return;\n case DiagnosticCategory.Message:\n case DiagnosticCategory.Suggestion:\n Logger.logInfo(loggingCategory, messageText, () => this.getLogMetaData(diagnostic));\n return;\n default:\n Logger.logTrace(loggingCategory, messageText, () => this.getLogMetaData(diagnostic));\n }\n }\n\n private getLogMetaData(diagnostic: AnyDiagnostic) {\n return { ...diagnostic, ...{ code: diagnostic.code, category: diagnostic.category, diagnosticType: diagnostic.diagnosticType, messageText: undefined, messageArgs: undefined } };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuleSuppressionSet.js","sourceRoot":"","sources":["../../../src/Validation/RuleSuppressionSet.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"RuleSuppressionSet.js","sourceRoot":"","sources":["../../../src/Validation/RuleSuppressionSet.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","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 Validation\n */\n\nimport { AnyClass, AnyECType, AnyProperty, Constant, CustomAttribute, CustomAttributeClass,\n CustomAttributeContainerProps, EntityClass, Enumeration, Format, InvertedUnit, KindOfQuantity, Mixin, Phenomenon,\n PropertyCategory, RelationshipClass, RelationshipConstraint, Schema, SchemaItem, StructClass, Unit,\n UnitSystem } from \"@itwin/ecschema-metadata\";\nimport { AnyDiagnostic } from \"./Diagnostic\";\n\n/**\n * Interface used for all rule suppressions used during schema validation.\n * Just telling us whether a rule is suppressed or not.\n * @beta\n */\nexport type ISuppressionRule<T extends AnyECType, U = object> = (diagnostic: AnyDiagnostic, ecDefinition: T, ...args: U[]) => Promise<boolean>;\n\n/** @beta */\nexport type BaseSuppressionRule<T extends AnyECType, U extends AnyECType> = ISuppressionRule<T, U>;\n\n/** @internal */\nexport type AnyRuleSuppressionMap = IRuleSuppressionMap<AnyECType>;\n\n/**\n * Interface used to represent elements of a rule suppression\n * @beta\n */\nexport interface IRuleSuppressionMap<T extends AnyECType, U = object> {\n ruleCode: string;\n rule: ISuppressionRule<T, U>;\n}\n\n/**\n * Interface used to represent elements of a rule suppression\n * @beta\n */\nexport interface BaseRuleSuppressionMap<T extends AnyECType, U extends AnyECType> {\n ruleCode: string;\n rule: BaseSuppressionRule<T, U>;\n}\n\n/**\n * Interface used to represent logical collection of [[ISuppressionRule]] instances.\n * @beta\n */\nexport interface IRuleSuppressionSet {\n name: string;\n schemaRuleSuppressions?: Array<IRuleSuppressionMap<Schema>>;\n schemaItemRuleSuppressions?: Array<IRuleSuppressionMap<SchemaItem>>;\n classRuleSuppressions?: Array<IRuleSuppressionMap<AnyClass>>;\n propertyRuleSuppressions?: Array<IRuleSuppressionMap<AnyProperty>>;\n entityRuleSuppressions?: Array<IRuleSuppressionMap<EntityClass>>;\n structRuleSuppressions?: Array<IRuleSuppressionMap<StructClass>>;\n mixinRuleSuppressions?: Array<IRuleSuppressionMap<Mixin>>;\n relationshipRuleSuppressions?: Array<IRuleSuppressionMap<RelationshipClass>>;\n relationshipConstraintRuleSuppressions?: Array<IRuleSuppressionMap<RelationshipConstraint>>;\n customAttributeRuleSuppressions?: Array<IRuleSuppressionMap<CustomAttributeClass>>;\n customAttributeContainerSuppressions?: Array<IRuleSuppressionMap<CustomAttributeContainerProps>>;\n customAttributeInstanceSuppressions?: Array<BaseRuleSuppressionMap<CustomAttributeContainerProps, CustomAttribute>>;\n enumerationRuleSuppressions?: Array<IRuleSuppressionMap<Enumeration>>;\n koqRuleSuppressions?: Array<IRuleSuppressionMap<KindOfQuantity>>;\n propertyCategoryRuleSuppressions?: Array<IRuleSuppressionMap<PropertyCategory>>;\n formatRuleSuppressions?: Array<IRuleSuppressionMap<Format>>;\n unitRuleSuppressions?: Array<IRuleSuppressionMap<Unit>>;\n invertedUnitRuleSuppressions?: Array<IRuleSuppressionMap<InvertedUnit>>;\n unitSystemRuleSuppressions?: Array<IRuleSuppressionMap<UnitSystem>>;\n phenomenonRuleSuppressions?: Array<IRuleSuppressionMap<Phenomenon>>;\n constantRuleSuppressions?: Array<IRuleSuppressionMap<Constant>>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rules.js","sourceRoot":"","sources":["../../../src/Validation/Rules.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Rules.js","sourceRoot":"","sources":["../../../src/Validation/Rules.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","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 Validation\n */\n\nimport { AnyClass, AnyECType, AnyProperty, Constant, CustomAttribute, CustomAttributeClass,\n CustomAttributeContainerProps, EntityClass, Enumeration, Format, InvertedUnit, KindOfQuantity, Mixin, Phenomenon,\n PropertyCategory, RelationshipClass, RelationshipConstraint, Schema, SchemaItem, StructClass, Unit,\n UnitSystem } from \"@itwin/ecschema-metadata\";\nimport { BaseDiagnostic } from \"./Diagnostic\";\n\n/**\n * Interface used for all rule implementations used during schema validation.\n * @beta\n */\nexport type IRule<T extends AnyECType, U = object> = (ecDefinition: T, ...args: U[]) => AsyncIterable<BaseDiagnostic<T, any[]>>;\n\n/** @beta */\nexport type BaseRule<T extends AnyECType, U extends AnyECType> = IRule<T, U>;\n\n/**\n * Interface used to represent logical collection of [IRule]($ecschema-editing) instances.\n * @beta\n */\nexport interface IRuleSet {\n /** The name of the rule set. */\n name: string;\n\n /** A collection of schema names that should be excluded from adhering to the rules defined in this rule set. */\n schemaExclusionSet?: string[];\n\n /** The rules that apply to [Schema]($ecschema-metadata) objects. */\n schemaRules?: Array<IRule<Schema>>;\n /** The rules that apply to [SchemaItem]($ecschema-metadata) objects. */\n schemaItemRules?: Array<IRule<SchemaItem>>;\n /** The rules that apply to [ECClass]($ecschema-metadata) objects. */\n classRules?: Array<IRule<AnyClass>>;\n /** The rules that apply to [Property]($ecschema-metadata) objects. */\n propertyRules?: Array<IRule<AnyProperty>>;\n /** The rules that apply to [EntityClass]($ecschema-metadata) objects. */\n entityClassRules?: Array<IRule<EntityClass>>;\n /** The rules that apply to [StructClass]($ecschema-metadata) objects. */\n structClassRules?: Array<IRule<StructClass>>;\n /** The rules that apply to [Mixin]($ecschema-metadata) objects. */\n mixinRules?: Array<IRule<Mixin>>;\n /** The rules that apply to [RelationshipClass]($ecschema-metadata) objects. */\n relationshipRules?: Array<IRule<RelationshipClass>>;\n /** The rules that apply to [RelationshipConstraint]($ecschema-metadata) objects. */\n relationshipConstraintRules?: Array<IRule<RelationshipConstraint>>;\n /** The rules that apply to [CustomAttributeClass]($ecschema-metadata) objects. */\n customAttributeClassRules?: Array<IRule<CustomAttributeClass>>;\n /** The rules that apply to [CustomAttributeContainerProps]($ecschema-metadata) objects. */\n customAttributeContainerRules?: Array<IRule<CustomAttributeContainerProps>>;\n /** The rules that apply to [CustomAttribute]($ecschema-metadata) objects. */\n customAttributeInstanceRules?: Array<BaseRule<CustomAttributeContainerProps, CustomAttribute>>;\n /** The rules that apply to [Enumeration]($ecschema-metadata) objects. */\n enumerationRules?: Array<IRule<Enumeration>>;\n /** The rules that apply to [KindOfQuantity]($ecschema-metadata) objects. */\n kindOfQuantityRules?: Array<IRule<KindOfQuantity>>;\n /** The rules that apply to [PropertyCategory]($ecschema-metadata) objects. */\n propertyCategoryRules?: Array<IRule<PropertyCategory>>;\n /** The rules that apply to [Format]($ecschema-metadata) objects. */\n formatRules?: Array<IRule<Format>>;\n /** The rules that apply to [Unit]($ecschema-metadata) objects. */\n unitRules?: Array<IRule<Unit>>;\n /** The rules that apply to [InvertedUnit]($ecschema-metadata) objects. */\n invertedUnitRules?: Array<IRule<InvertedUnit>>;\n /** The rules that apply to [UnitSystem]($ecschema-metadata) objects. */\n unitSystemRules?: Array<IRule<UnitSystem>>;\n /** The rules that apply to [Phenomenon]($ecschema-metadata) objects. */\n phenomenonRules?: Array<IRule<Phenomenon>>;\n /** The rules that apply to [Constant]($ecschema-metadata) objects. */\n constantRules?: Array<IRule<Constant>>;\n}\n"]}
|
|
@@ -25,6 +25,8 @@ var ChangeType;
|
|
|
25
25
|
* @alpha
|
|
26
26
|
*/
|
|
27
27
|
class BaseSchemaChange {
|
|
28
|
+
_diagnostic;
|
|
29
|
+
_changeType;
|
|
28
30
|
/**
|
|
29
31
|
* Initializes a new BaseSchemaChange instance.
|
|
30
32
|
* @param diagnostic The diagnostic holding the change data.
|
|
@@ -54,12 +56,12 @@ class BaseSchemaChange {
|
|
|
54
56
|
*/
|
|
55
57
|
getNameFromArgument(index, allowUndefined = false, fullName = false) {
|
|
56
58
|
if (!this.diagnostic.messageArgs || this.diagnostic.messageArgs.length <= index)
|
|
57
|
-
throw new ecschema_metadata_1.
|
|
59
|
+
throw new ecschema_metadata_1.ECSchemaError(ecschema_metadata_1.ECSchemaStatus.InvalidSchemaComparisonArgument, `Schema comparison diagnostic '${this.diagnostic.code}' for SchemaItem '${this.topLevelSchemaItem.fullName}' has invalid arguments`);
|
|
58
60
|
const schemaItem = this.getValueFromArgument(index);
|
|
59
61
|
if (ecschema_metadata_1.Schema.isSchema(schemaItem) || ecschema_metadata_1.SchemaItem.isSchemaItem(schemaItem) || ecschema_metadata_1.OverrideFormat.isOverrideFormat(schemaItem))
|
|
60
62
|
return fullName ? schemaItem.fullName : schemaItem.name;
|
|
61
63
|
if (!allowUndefined)
|
|
62
|
-
throw new ecschema_metadata_1.
|
|
64
|
+
throw new ecschema_metadata_1.ECSchemaError(ecschema_metadata_1.ECSchemaStatus.InvalidSchemaComparisonArgument, `Schema comparison diagnostic '${this.diagnostic.code}' for SchemaItem '${this.topLevelSchemaItem.fullName}' has invalid arguments`);
|
|
63
65
|
return "undefined";
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
@@ -95,13 +97,15 @@ exports.BaseSchemaChange = BaseSchemaChange;
|
|
|
95
97
|
* @alpha
|
|
96
98
|
*/
|
|
97
99
|
class BaseSchemaChanges {
|
|
100
|
+
_ecTypeName;
|
|
101
|
+
_schema;
|
|
102
|
+
_propertyValueChanges = [];
|
|
98
103
|
/**
|
|
99
104
|
* Initializes a new BaseSchemaChanges instance.
|
|
100
105
|
* @param schema The schema containing the changes.
|
|
101
106
|
* @param anyECTypeName The name of the EC type.
|
|
102
107
|
*/
|
|
103
108
|
constructor(schema, anyECTypeName) {
|
|
104
|
-
this._propertyValueChanges = [];
|
|
105
109
|
this._schema = schema;
|
|
106
110
|
this._ecTypeName = anyECTypeName;
|
|
107
111
|
}
|
|
@@ -183,23 +187,23 @@ exports.BaseSchemaChanges = BaseSchemaChanges;
|
|
|
183
187
|
* @alpha
|
|
184
188
|
*/
|
|
185
189
|
class SchemaChanges extends BaseSchemaChanges {
|
|
190
|
+
_diagnostics = [];
|
|
191
|
+
_missingSchemaReferences = [];
|
|
192
|
+
_schemaReferenceDeltas = [];
|
|
193
|
+
_customAttributeChanges = new Map();
|
|
194
|
+
_classChanges = new Map();
|
|
195
|
+
_entityClassChanges = new Map();
|
|
196
|
+
_relationshipClassChanges = new Map();
|
|
197
|
+
_schemaItemChanges = new Map();
|
|
198
|
+
_enumerationChanges = new Map();
|
|
199
|
+
_kindOfQuantityChanges = new Map();
|
|
200
|
+
_formatChanges = new Map();
|
|
186
201
|
/**
|
|
187
202
|
* Initializes a new SchemaChanges instance.
|
|
188
203
|
* @param schema The schema containing the changes.
|
|
189
204
|
*/
|
|
190
205
|
constructor(schema) {
|
|
191
206
|
super(schema, schema.name);
|
|
192
|
-
this._diagnostics = [];
|
|
193
|
-
this._missingSchemaReferences = [];
|
|
194
|
-
this._schemaReferenceDeltas = [];
|
|
195
|
-
this._customAttributeChanges = new Map();
|
|
196
|
-
this._classChanges = new Map();
|
|
197
|
-
this._entityClassChanges = new Map();
|
|
198
|
-
this._relationshipClassChanges = new Map();
|
|
199
|
-
this._schemaItemChanges = new Map();
|
|
200
|
-
this._enumerationChanges = new Map();
|
|
201
|
-
this._kindOfQuantityChanges = new Map();
|
|
202
|
-
this._formatChanges = new Map();
|
|
203
207
|
}
|
|
204
208
|
/** Gets the MissingSchemaReferences collection. */
|
|
205
209
|
get missingSchemaReferences() { return this._missingSchemaReferences; }
|
|
@@ -435,6 +439,8 @@ exports.SchemaChanges = SchemaChanges;
|
|
|
435
439
|
* @alpha
|
|
436
440
|
*/
|
|
437
441
|
class SchemaItemChanges extends BaseSchemaChanges {
|
|
442
|
+
_schemaItemType;
|
|
443
|
+
_schemaItemMissing;
|
|
438
444
|
/**
|
|
439
445
|
* Initializes a new SchemaItemChanges instance.
|
|
440
446
|
* @param schema The Schema containing the change.
|
|
@@ -482,11 +488,9 @@ exports.SchemaItemChanges = SchemaItemChanges;
|
|
|
482
488
|
* @alpha
|
|
483
489
|
*/
|
|
484
490
|
class ClassChanges extends SchemaItemChanges {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
this._customAttributeChanges = new Map();
|
|
489
|
-
}
|
|
491
|
+
_baseClassDelta;
|
|
492
|
+
_propertyChanges = new Map();
|
|
493
|
+
_customAttributeChanges = new Map();
|
|
490
494
|
/** Gets the BaseClassDelta change. Maybe undefined. */
|
|
491
495
|
get baseClassDelta() {
|
|
492
496
|
return this._baseClassDelta;
|
|
@@ -526,10 +530,7 @@ exports.ClassChanges = ClassChanges;
|
|
|
526
530
|
* @alpha
|
|
527
531
|
*/
|
|
528
532
|
class EntityClassChanges extends ClassChanges {
|
|
529
|
-
|
|
530
|
-
super(...arguments);
|
|
531
|
-
this._entityMixinChanges = new Map();
|
|
532
|
-
}
|
|
533
|
+
_entityMixinChanges = new Map();
|
|
533
534
|
/** Gets the EntityMixinChanges Map. */
|
|
534
535
|
get entityMixinChanges() {
|
|
535
536
|
return this._entityMixinChanges;
|
|
@@ -553,11 +554,8 @@ exports.EntityClassChanges = EntityClassChanges;
|
|
|
553
554
|
* @alpha
|
|
554
555
|
*/
|
|
555
556
|
class RelationshipClassChanges extends ClassChanges {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
this._sourceConstraintChanges = new Map();
|
|
559
|
-
this._targetConstraintChanges = new Map();
|
|
560
|
-
}
|
|
557
|
+
_sourceConstraintChanges = new Map();
|
|
558
|
+
_targetConstraintChanges = new Map();
|
|
561
559
|
/** Gets the source RelationshipConstraintChanges Map. */
|
|
562
560
|
get sourceConstraintChanges() {
|
|
563
561
|
return this._sourceConstraintChanges;
|
|
@@ -587,10 +585,8 @@ exports.RelationshipClassChanges = RelationshipClassChanges;
|
|
|
587
585
|
* @alpha
|
|
588
586
|
*/
|
|
589
587
|
class PropertyChanges extends BaseSchemaChanges {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
this._customAttributeChanges = new Map();
|
|
593
|
-
}
|
|
588
|
+
_propertyMissing;
|
|
589
|
+
_customAttributeChanges = new Map();
|
|
594
590
|
/** Gets the PropertyMissing change. Maybe undefined. */
|
|
595
591
|
get propertyMissing() {
|
|
596
592
|
return this._propertyMissing;
|
|
@@ -630,10 +626,7 @@ exports.PropertyChanges = PropertyChanges;
|
|
|
630
626
|
* @alpha
|
|
631
627
|
*/
|
|
632
628
|
class EnumerationChanges extends SchemaItemChanges {
|
|
633
|
-
|
|
634
|
-
super(...arguments);
|
|
635
|
-
this._enumeratorChanges = new Map();
|
|
636
|
-
}
|
|
629
|
+
_enumeratorChanges = new Map();
|
|
637
630
|
/** Gets the EnumeratorChanges map. */
|
|
638
631
|
get enumeratorChanges() {
|
|
639
632
|
return this._enumeratorChanges;
|
|
@@ -660,10 +653,7 @@ exports.EnumerationChanges = EnumerationChanges;
|
|
|
660
653
|
* @alpha
|
|
661
654
|
*/
|
|
662
655
|
class CustomAttributeContainerChanges extends BaseSchemaChanges {
|
|
663
|
-
|
|
664
|
-
super(...arguments);
|
|
665
|
-
this._customAttributeChanges = [];
|
|
666
|
-
}
|
|
656
|
+
_customAttributeChanges = [];
|
|
667
657
|
/** Gets the CustomAttributeContainerChange collection. */
|
|
668
658
|
get customAttributeChanges() {
|
|
669
659
|
return this._customAttributeChanges;
|
|
@@ -683,11 +673,8 @@ exports.CustomAttributeContainerChanges = CustomAttributeContainerChanges;
|
|
|
683
673
|
* @alpha
|
|
684
674
|
*/
|
|
685
675
|
class RelationshipConstraintChanges extends BaseSchemaChanges {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
this._constraintClassChanges = [];
|
|
689
|
-
this._customAttributeChanges = new Map();
|
|
690
|
-
}
|
|
676
|
+
_constraintClassChanges = [];
|
|
677
|
+
_customAttributeChanges = new Map();
|
|
691
678
|
/** Gets the RelationshipConstraintClassChange collection. */
|
|
692
679
|
get constraintClassChanges() {
|
|
693
680
|
return this._constraintClassChanges;
|
|
@@ -729,10 +716,8 @@ exports.RelationshipConstraintChanges = RelationshipConstraintChanges;
|
|
|
729
716
|
* @alpha
|
|
730
717
|
*/
|
|
731
718
|
class EnumeratorChanges extends BaseSchemaChanges {
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
this._enumeratorDeltas = [];
|
|
735
|
-
}
|
|
719
|
+
_enumeratorDeltas = [];
|
|
720
|
+
_enumeratorMissing;
|
|
736
721
|
/** Gets the EnumeratorDelta collection. */
|
|
737
722
|
get enumeratorDeltas() {
|
|
738
723
|
return this._enumeratorDeltas;
|
|
@@ -760,10 +745,7 @@ exports.EnumeratorChanges = EnumeratorChanges;
|
|
|
760
745
|
* @alpha
|
|
761
746
|
*/
|
|
762
747
|
class EntityMixinChanges extends BaseSchemaChanges {
|
|
763
|
-
|
|
764
|
-
super(...arguments);
|
|
765
|
-
this._entityMixinChange = [];
|
|
766
|
-
}
|
|
748
|
+
_entityMixinChange = [];
|
|
767
749
|
/** Gets the EntityMixinChange collection. */
|
|
768
750
|
get entityMixinChange() {
|
|
769
751
|
return this._entityMixinChange;
|
|
@@ -783,10 +765,7 @@ exports.EntityMixinChanges = EntityMixinChanges;
|
|
|
783
765
|
* @alpha
|
|
784
766
|
*/
|
|
785
767
|
class KindOfQuantityChanges extends SchemaItemChanges {
|
|
786
|
-
|
|
787
|
-
super(...arguments);
|
|
788
|
-
this._presentationUnitChanges = new Map();
|
|
789
|
-
}
|
|
768
|
+
_presentationUnitChanges = new Map();
|
|
790
769
|
/** Gets the EntityMixinChange Map. */
|
|
791
770
|
get presentationUnitChanges() {
|
|
792
771
|
return this._presentationUnitChanges;
|
|
@@ -807,10 +786,7 @@ exports.KindOfQuantityChanges = KindOfQuantityChanges;
|
|
|
807
786
|
* @alpha
|
|
808
787
|
*/
|
|
809
788
|
class PresentationUnitChanges extends BaseSchemaChanges {
|
|
810
|
-
|
|
811
|
-
super(...arguments);
|
|
812
|
-
this._presentationUnitChange = [];
|
|
813
|
-
}
|
|
789
|
+
_presentationUnitChange = [];
|
|
814
790
|
/** Gets the PresentationUnitChange collection. */
|
|
815
791
|
get presentationUnitChange() {
|
|
816
792
|
return this._presentationUnitChange;
|
|
@@ -830,10 +806,7 @@ exports.PresentationUnitChanges = PresentationUnitChanges;
|
|
|
830
806
|
* @alpha
|
|
831
807
|
*/
|
|
832
808
|
class FormatChanges extends SchemaItemChanges {
|
|
833
|
-
|
|
834
|
-
super(...arguments);
|
|
835
|
-
this._formatUnitChanges = new Map();
|
|
836
|
-
}
|
|
809
|
+
_formatUnitChanges = new Map();
|
|
837
810
|
/** Gets the FormatUnitChanges collection. */
|
|
838
811
|
get formatUnitChanges() {
|
|
839
812
|
return this._formatUnitChanges;
|
|
@@ -858,11 +831,8 @@ exports.FormatChanges = FormatChanges;
|
|
|
858
831
|
* @alpha
|
|
859
832
|
*/
|
|
860
833
|
class FormatUnitChanges extends BaseSchemaChanges {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
this._unitLabelOverrideDeltas = [];
|
|
864
|
-
this._formatUnitChanges = [];
|
|
865
|
-
}
|
|
834
|
+
_unitLabelOverrideDeltas = [];
|
|
835
|
+
_formatUnitChanges = [];
|
|
866
836
|
/** Gets the UnitLabelOverrideDelta collection. */
|
|
867
837
|
get unitLabelOverrideDeltas() {
|
|
868
838
|
return this._unitLabelOverrideDeltas;
|
|
@@ -1166,7 +1136,7 @@ class FormatUnitChange extends BaseSchemaChange {
|
|
|
1166
1136
|
}
|
|
1167
1137
|
/** Gets a string representation of the change. */
|
|
1168
1138
|
toString() {
|
|
1169
|
-
return `Unit: ${this.changeKey}`;
|
|
1139
|
+
return `Unit: ${this.changeKey}, label: ${this.getStringFromArgument(1)}`;
|
|
1170
1140
|
}
|
|
1171
1141
|
get _isInvertedUnit() {
|
|
1172
1142
|
if (!this.diagnostic.messageArgs)
|