@itwin/ecschema-editing 5.0.0-dev.9 → 5.0.0-dev.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -1
- package/lib/cjs/Differencing/Errors.js +6 -0
- package/lib/cjs/Differencing/Errors.js.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.d.ts +3 -1
- package/lib/cjs/Differencing/SchemaConflicts.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.js +2 -0
- package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +4 -3
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +57 -11
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.d.ts +33 -4
- package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.js +55 -5
- package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts +2 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js +78 -19
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.js +5 -0
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.js.map +1 -1
- package/lib/cjs/Differencing/Utils.js.map +1 -1
- package/lib/cjs/Editing/Constants.d.ts +2 -1
- package/lib/cjs/Editing/Constants.d.ts.map +1 -1
- package/lib/cjs/Editing/Constants.js +4 -1
- package/lib/cjs/Editing/Constants.js.map +1 -1
- package/lib/cjs/Editing/CustomAttributes.d.ts +2 -1
- package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -1
- package/lib/cjs/Editing/CustomAttributes.js +3 -0
- package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
- package/lib/cjs/Editing/ECClasses.d.ts +6 -1
- package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
- package/lib/cjs/Editing/ECClasses.js +48 -49
- package/lib/cjs/Editing/ECClasses.js.map +1 -1
- package/lib/cjs/Editing/Editor.d.ts +2 -2
- package/lib/cjs/Editing/Editor.d.ts.map +1 -1
- package/lib/cjs/Editing/Editor.js +32 -21
- package/lib/cjs/Editing/Editor.js.map +1 -1
- package/lib/cjs/Editing/Entities.d.ts +2 -1
- package/lib/cjs/Editing/Entities.d.ts.map +1 -1
- package/lib/cjs/Editing/Entities.js +18 -14
- package/lib/cjs/Editing/Entities.js.map +1 -1
- package/lib/cjs/Editing/Enumerations.d.ts +2 -1
- package/lib/cjs/Editing/Enumerations.d.ts.map +1 -1
- package/lib/cjs/Editing/Enumerations.js +6 -3
- package/lib/cjs/Editing/Enumerations.js.map +1 -1
- package/lib/cjs/Editing/Exception.js +35 -6
- package/lib/cjs/Editing/Exception.js.map +1 -1
- package/lib/cjs/Editing/Formats.d.ts +2 -1
- package/lib/cjs/Editing/Formats.d.ts.map +1 -1
- package/lib/cjs/Editing/Formats.js +5 -1
- package/lib/cjs/Editing/Formats.js.map +1 -1
- package/lib/cjs/Editing/InvertedUnits.d.ts +2 -1
- package/lib/cjs/Editing/InvertedUnits.d.ts.map +1 -1
- package/lib/cjs/Editing/InvertedUnits.js +10 -6
- package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.d.ts +2 -1
- package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.js +11 -7
- package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
- package/lib/cjs/Editing/Mixins.d.ts +2 -1
- package/lib/cjs/Editing/Mixins.d.ts.map +1 -1
- package/lib/cjs/Editing/Mixins.js +13 -9
- package/lib/cjs/Editing/Mixins.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableArrayProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableCAClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableClass.d.ts +2 -1
- package/lib/cjs/Editing/Mutable/MutableClass.d.ts.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableConstant.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableEnumeration.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.d.ts +8 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.d.ts.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableMixin.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableNavigationProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePhenomenon.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableSchemaItem.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableStructProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableUnit.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableUnitSystem.js.map +1 -1
- package/lib/cjs/Editing/Phenomena.d.ts +2 -1
- package/lib/cjs/Editing/Phenomena.d.ts.map +1 -1
- package/lib/cjs/Editing/Phenomena.js +3 -0
- package/lib/cjs/Editing/Phenomena.js.map +1 -1
- package/lib/cjs/Editing/Properties.d.ts +2 -2
- package/lib/cjs/Editing/Properties.d.ts.map +1 -1
- package/lib/cjs/Editing/Properties.js +6 -4
- package/lib/cjs/Editing/Properties.js.map +1 -1
- package/lib/cjs/Editing/PropertyCategories.d.ts +2 -1
- package/lib/cjs/Editing/PropertyCategories.d.ts.map +1 -1
- package/lib/cjs/Editing/PropertyCategories.js +5 -1
- package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
- package/lib/cjs/Editing/RelationshipClasses.d.ts +1 -0
- package/lib/cjs/Editing/RelationshipClasses.d.ts.map +1 -1
- package/lib/cjs/Editing/RelationshipClasses.js +17 -10
- package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
- package/lib/cjs/Editing/SchemaItems.d.ts +2 -2
- package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -1
- package/lib/cjs/Editing/SchemaItems.js +8 -11
- package/lib/cjs/Editing/SchemaItems.js.map +1 -1
- package/lib/cjs/Editing/Structs.d.ts +2 -1
- package/lib/cjs/Editing/Structs.d.ts.map +1 -1
- package/lib/cjs/Editing/Structs.js +3 -0
- package/lib/cjs/Editing/Structs.js.map +1 -1
- package/lib/cjs/Editing/UnitSystems.d.ts +2 -1
- package/lib/cjs/Editing/UnitSystems.d.ts.map +1 -1
- package/lib/cjs/Editing/UnitSystems.js +3 -0
- package/lib/cjs/Editing/UnitSystems.js.map +1 -1
- package/lib/cjs/Editing/Units.d.ts +2 -1
- package/lib/cjs/Editing/Units.d.ts.map +1 -1
- package/lib/cjs/Editing/Units.js +5 -2
- package/lib/cjs/Editing/Units.js.map +1 -1
- package/lib/cjs/Merging/ClassMerger.js.map +1 -1
- package/lib/cjs/Merging/ConstantMerger.js +4 -4
- package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeClassMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.js +7 -6
- package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
- package/lib/cjs/Merging/Edits/NameMapping.d.ts +22 -0
- package/lib/cjs/Merging/Edits/NameMapping.d.ts.map +1 -0
- package/lib/cjs/Merging/Edits/NameMapping.js +54 -0
- package/lib/cjs/Merging/Edits/NameMapping.js.map +1 -0
- package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts +1 -1
- package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts.map +1 -1
- package/lib/cjs/Merging/Edits/RenameEditHandler.js +1 -260
- package/lib/cjs/Merging/Edits/RenameEditHandler.js.map +1 -1
- package/lib/cjs/Merging/Edits/SchemaEdits.d.ts +9 -6
- package/lib/cjs/Merging/Edits/SchemaEdits.d.ts.map +1 -1
- package/lib/cjs/Merging/Edits/SchemaEdits.js +19 -14
- package/lib/cjs/Merging/Edits/SchemaEdits.js.map +1 -1
- package/lib/cjs/Merging/Edits/SkipEditHandler.js.map +1 -1
- package/lib/cjs/Merging/EntityClassMerger.js +1 -2
- package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumeratorMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/EnumeratorMerger.js +2 -2
- package/lib/cjs/Merging/EnumeratorMerger.js.map +1 -1
- package/lib/cjs/Merging/FormatMerger.d.ts +24 -0
- package/lib/cjs/Merging/FormatMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/FormatMerger.js +143 -0
- package/lib/cjs/Merging/FormatMerger.js.map +1 -0
- package/lib/cjs/Merging/InvertedUnitMerger.d.ts +14 -0
- package/lib/cjs/Merging/InvertedUnitMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/InvertedUnitMerger.js +45 -0
- package/lib/cjs/Merging/InvertedUnitMerger.js.map +1 -0
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.js +4 -5
- package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
- package/lib/cjs/Merging/MixinMerger.js +1 -1
- package/lib/cjs/Merging/MixinMerger.js.map +1 -1
- package/lib/cjs/Merging/PhenomenonMerger.js +1 -1
- package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyCategoryMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyMerger.js +28 -26
- package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.js +4 -4
- package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.d.ts +5 -3
- package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.js +45 -5
- package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts +14 -8
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.js +42 -17
- package/lib/cjs/Merging/SchemaMergingVisitor.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.js +2 -0
- package/lib/cjs/Merging/SchemaMergingWalker.js.map +1 -1
- package/lib/cjs/Merging/SchemaReferenceMerger.js.map +1 -1
- package/lib/cjs/Merging/StructClassMerger.js.map +1 -1
- package/lib/cjs/Merging/UnitMerger.d.ts +14 -0
- package/lib/cjs/Merging/UnitMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/UnitMerger.js +62 -0
- package/lib/cjs/Merging/UnitMerger.js.map +1 -0
- package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -1
- package/lib/cjs/Merging/Utils.d.ts +11 -0
- package/lib/cjs/Merging/Utils.d.ts.map +1 -1
- package/lib/cjs/Merging/Utils.js +23 -3
- package/lib/cjs/Merging/Utils.js.map +1 -1
- package/lib/cjs/Validation/Diagnostic.js +18 -16
- package/lib/cjs/Validation/Diagnostic.js.map +1 -1
- package/lib/cjs/Validation/DiagnosticReporter.js +4 -1
- package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
- package/lib/cjs/Validation/ECRules.js +1 -1
- package/lib/cjs/Validation/ECRules.js.map +1 -1
- package/lib/cjs/Validation/LoggingDiagnosticReporter.js.map +1 -1
- package/lib/cjs/Validation/RuleSuppressionSet.js.map +1 -1
- package/lib/cjs/Validation/Rules.js.map +1 -1
- package/lib/cjs/Validation/SchemaChanges.js +39 -69
- package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareDiagnostics.d.ts +2 -2
- package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js +4 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareVisitor.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaCompareVisitor.js +23 -23
- package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.d.ts +22 -1
- package/lib/cjs/Validation/SchemaComparer.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.js +30 -5
- package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
- package/lib/cjs/Validation/SchemaValidater.js +1 -4
- package/lib/cjs/Validation/SchemaValidater.js.map +1 -1
- package/lib/cjs/Validation/SchemaValidationVisitor.js +3 -4
- package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.js +6 -4
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
- package/lib/cjs/ecschema-editing.js.map +1 -1
- package/lib/esm/Differencing/Errors.d.ts +19 -0
- package/lib/esm/Differencing/Errors.d.ts.map +1 -0
- package/lib/esm/Differencing/Errors.js +26 -0
- package/lib/esm/Differencing/Errors.js.map +1 -0
- package/lib/esm/Differencing/SchemaConflicts.d.ts +84 -0
- package/lib/esm/Differencing/SchemaConflicts.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaConflicts.js +60 -0
- package/lib/esm/Differencing/SchemaConflicts.js.map +1 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.d.ts +41 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.js +443 -0
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.js.map +1 -0
- package/lib/esm/Differencing/SchemaDifference.d.ts +357 -0
- package/lib/esm/Differencing/SchemaDifference.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDifference.js +106 -0
- package/lib/esm/Differencing/SchemaDifference.js.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.d.ts +18 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.js +521 -0
- package/lib/esm/Differencing/SchemaDifferenceValidator.js.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.d.ts +32 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.js +88 -0
- package/lib/esm/Differencing/SchemaDifferenceVisitor.js.map +1 -0
- package/lib/esm/Differencing/Utils.d.ts +110 -0
- package/lib/esm/Differencing/Utils.d.ts.map +1 -0
- package/lib/esm/Differencing/Utils.js +161 -0
- package/lib/esm/Differencing/Utils.js.map +1 -0
- package/lib/esm/Editing/Constants.d.ts +22 -0
- package/lib/esm/Editing/Constants.d.ts.map +1 -0
- package/lib/esm/Editing/Constants.js +55 -0
- package/lib/esm/Editing/Constants.js.map +1 -0
- package/lib/esm/Editing/CustomAttributes.d.ts +22 -0
- package/lib/esm/Editing/CustomAttributes.d.ts.map +1 -0
- package/lib/esm/Editing/CustomAttributes.js +49 -0
- package/lib/esm/Editing/CustomAttributes.js.map +1 -0
- package/lib/esm/Editing/ECClasses.d.ts +86 -0
- package/lib/esm/Editing/ECClasses.d.ts.map +1 -0
- package/lib/esm/Editing/ECClasses.js +294 -0
- package/lib/esm/Editing/ECClasses.js.map +1 -0
- package/lib/esm/Editing/Editor.d.ts +117 -0
- package/lib/esm/Editing/Editor.d.ts.map +1 -0
- package/lib/esm/Editing/Editor.js +264 -0
- package/lib/esm/Editing/Editor.js.map +1 -0
- package/lib/esm/Editing/Entities.d.ts +38 -0
- package/lib/esm/Editing/Entities.d.ts.map +1 -0
- package/lib/esm/Editing/Entities.js +126 -0
- package/lib/esm/Editing/Entities.js.map +1 -0
- package/lib/esm/Editing/Enumerations.d.ts +25 -0
- package/lib/esm/Editing/Enumerations.d.ts.map +1 -0
- package/lib/esm/Editing/Enumerations.js +90 -0
- package/lib/esm/Editing/Enumerations.js.map +1 -0
- package/lib/esm/Editing/Exception.d.ts +358 -0
- package/lib/esm/Editing/Exception.d.ts.map +1 -0
- package/lib/esm/Editing/Exception.js +471 -0
- package/lib/esm/Editing/Exception.js.map +1 -0
- package/lib/esm/Editing/Formats.d.ts +23 -0
- package/lib/esm/Editing/Formats.d.ts.map +1 -0
- package/lib/esm/Editing/Formats.js +62 -0
- package/lib/esm/Editing/Formats.js.map +1 -0
- package/lib/esm/Editing/InvertedUnits.d.ts +19 -0
- package/lib/esm/Editing/InvertedUnits.d.ts.map +1 -0
- package/lib/esm/Editing/InvertedUnits.js +68 -0
- package/lib/esm/Editing/InvertedUnits.js.map +1 -0
- package/lib/esm/Editing/KindOfQuantities.d.ts +30 -0
- package/lib/esm/Editing/KindOfQuantities.d.ts.map +1 -0
- package/lib/esm/Editing/KindOfQuantities.js +92 -0
- package/lib/esm/Editing/KindOfQuantities.js.map +1 -0
- package/lib/esm/Editing/Mixins.d.ts +35 -0
- package/lib/esm/Editing/Mixins.d.ts.map +1 -0
- package/lib/esm/Editing/Mixins.js +90 -0
- package/lib/esm/Editing/Mixins.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.d.ts +10 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableArrayProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.d.ts +10 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.js +12 -0
- package/lib/esm/Editing/Mutable/MutableCAClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableClass.d.ts +39 -0
- package/lib/esm/Editing/Mutable/MutableClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableClass.js +18 -0
- package/lib/esm/Editing/Mutable/MutableClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableConstant.d.ts +14 -0
- package/lib/esm/Editing/Mutable/MutableConstant.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableConstant.js +12 -0
- package/lib/esm/Editing/Mutable/MutableConstant.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.d.ts +12 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.js +12 -0
- package/lib/esm/Editing/Mutable/MutableEntityClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.js +11 -0
- package/lib/esm/Editing/Mutable/MutableEnumeration.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableFormat.d.ts +26 -0
- package/lib/esm/Editing/Mutable/MutableFormat.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableFormat.js +12 -0
- package/lib/esm/Editing/Mutable/MutableFormat.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.js +12 -0
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.d.ts +14 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.js +12 -0
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableMixin.d.ts +12 -0
- package/lib/esm/Editing/Mutable/MutableMixin.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableMixin.js +12 -0
- package/lib/esm/Editing/Mutable/MutableMixin.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.d.ts +8 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.js +12 -0
- package/lib/esm/Editing/Mutable/MutablePhenomenon.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.d.ts +13 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableProperty.d.ts +16 -0
- package/lib/esm/Editing/Mutable/MutableProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.js +12 -0
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.d.ts +30 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.js +20 -0
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchema.d.ts +51 -0
- package/lib/esm/Editing/Mutable/MutableSchema.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchema.js +14 -0
- package/lib/esm/Editing/Mutable/MutableSchema.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.d.ts +11 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.js +12 -0
- package/lib/esm/Editing/Mutable/MutableSchemaItem.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.d.ts +8 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.js +12 -0
- package/lib/esm/Editing/Mutable/MutableStructProperty.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnit.d.ts +12 -0
- package/lib/esm/Editing/Mutable/MutableUnit.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnit.js +12 -0
- package/lib/esm/Editing/Mutable/MutableUnit.js.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.d.ts +10 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.d.ts.map +1 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.js +12 -0
- package/lib/esm/Editing/Mutable/MutableUnitSystem.js.map +1 -0
- package/lib/esm/Editing/Phenomena.d.ts +17 -0
- package/lib/esm/Editing/Phenomena.d.ts.map +1 -0
- package/lib/esm/Editing/Phenomena.js +44 -0
- package/lib/esm/Editing/Phenomena.js.map +1 -0
- package/lib/esm/Editing/Properties.d.ts +206 -0
- package/lib/esm/Editing/Properties.d.ts.map +1 -0
- package/lib/esm/Editing/Properties.js +415 -0
- package/lib/esm/Editing/Properties.js.map +1 -0
- package/lib/esm/Editing/PropertyCategories.d.ts +18 -0
- package/lib/esm/Editing/PropertyCategories.d.ts.map +1 -0
- package/lib/esm/Editing/PropertyCategories.js +54 -0
- package/lib/esm/Editing/PropertyCategories.js.map +1 -0
- package/lib/esm/Editing/RelationshipClasses.d.ts +69 -0
- package/lib/esm/Editing/RelationshipClasses.d.ts.map +1 -0
- package/lib/esm/Editing/RelationshipClasses.js +236 -0
- package/lib/esm/Editing/RelationshipClasses.js.map +1 -0
- package/lib/esm/Editing/SchemaItems.d.ts +42 -0
- package/lib/esm/Editing/SchemaItems.d.ts.map +1 -0
- package/lib/esm/Editing/SchemaItems.js +104 -0
- package/lib/esm/Editing/SchemaItems.js.map +1 -0
- package/lib/esm/Editing/Structs.d.ts +21 -0
- package/lib/esm/Editing/Structs.d.ts.map +1 -0
- package/lib/esm/Editing/Structs.js +47 -0
- package/lib/esm/Editing/Structs.js.map +1 -0
- package/lib/esm/Editing/UnitSystems.d.ts +17 -0
- package/lib/esm/Editing/UnitSystems.d.ts.map +1 -0
- package/lib/esm/Editing/UnitSystems.js +43 -0
- package/lib/esm/Editing/UnitSystems.js.map +1 -0
- package/lib/esm/Editing/Units.d.ts +17 -0
- package/lib/esm/Editing/Units.d.ts.map +1 -0
- package/lib/esm/Editing/Units.js +49 -0
- package/lib/esm/Editing/Units.js.map +1 -0
- package/lib/esm/Merging/ClassMerger.d.ts +9 -0
- package/lib/esm/Merging/ClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/ClassMerger.js +66 -0
- package/lib/esm/Merging/ClassMerger.js.map +1 -0
- package/lib/esm/Merging/ConstantMerger.d.ts +14 -0
- package/lib/esm/Merging/ConstantMerger.d.ts.map +1 -0
- package/lib/esm/Merging/ConstantMerger.js +64 -0
- package/lib/esm/Merging/ConstantMerger.js.map +1 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.d.ts +14 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.js +36 -0
- package/lib/esm/Merging/CustomAttributeClassMerger.js.map +1 -0
- package/lib/esm/Merging/CustomAttributeMerger.d.ts +19 -0
- package/lib/esm/Merging/CustomAttributeMerger.d.ts.map +1 -0
- package/lib/esm/Merging/CustomAttributeMerger.js +66 -0
- package/lib/esm/Merging/CustomAttributeMerger.js.map +1 -0
- package/lib/esm/Merging/Edits/NameMapping.d.ts +22 -0
- package/lib/esm/Merging/Edits/NameMapping.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/NameMapping.js +49 -0
- package/lib/esm/Merging/Edits/NameMapping.js.map +1 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.d.ts +14 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.js +62 -0
- package/lib/esm/Merging/Edits/RenameEditHandler.js.map +1 -0
- package/lib/esm/Merging/Edits/SchemaEdits.d.ts +81 -0
- package/lib/esm/Merging/Edits/SchemaEdits.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/SchemaEdits.js +112 -0
- package/lib/esm/Merging/Edits/SchemaEdits.js.map +1 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.d.ts +14 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.d.ts.map +1 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.js +60 -0
- package/lib/esm/Merging/Edits/SkipEditHandler.js.map +1 -0
- package/lib/esm/Merging/EntityClassMerger.d.ts +19 -0
- package/lib/esm/Merging/EntityClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/EntityClassMerger.js +39 -0
- package/lib/esm/Merging/EntityClassMerger.js.map +1 -0
- package/lib/esm/Merging/EnumerationMerger.d.ts +14 -0
- package/lib/esm/Merging/EnumerationMerger.d.ts.map +1 -0
- package/lib/esm/Merging/EnumerationMerger.js +48 -0
- package/lib/esm/Merging/EnumerationMerger.js.map +1 -0
- package/lib/esm/Merging/EnumeratorMerger.d.ts +14 -0
- package/lib/esm/Merging/EnumeratorMerger.d.ts.map +1 -0
- package/lib/esm/Merging/EnumeratorMerger.js +36 -0
- package/lib/esm/Merging/EnumeratorMerger.js.map +1 -0
- package/lib/esm/Merging/FormatMerger.d.ts +24 -0
- package/lib/esm/Merging/FormatMerger.d.ts.map +1 -0
- package/lib/esm/Merging/FormatMerger.js +137 -0
- package/lib/esm/Merging/FormatMerger.js.map +1 -0
- package/lib/esm/Merging/InvertedUnitMerger.d.ts +14 -0
- package/lib/esm/Merging/InvertedUnitMerger.d.ts.map +1 -0
- package/lib/esm/Merging/InvertedUnitMerger.js +41 -0
- package/lib/esm/Merging/InvertedUnitMerger.js.map +1 -0
- package/lib/esm/Merging/KindOfQuantityMerger.d.ts +19 -0
- package/lib/esm/Merging/KindOfQuantityMerger.d.ts.map +1 -0
- package/lib/esm/Merging/KindOfQuantityMerger.js +89 -0
- package/lib/esm/Merging/KindOfQuantityMerger.js.map +1 -0
- package/lib/esm/Merging/MixinMerger.d.ts +14 -0
- package/lib/esm/Merging/MixinMerger.d.ts.map +1 -0
- package/lib/esm/Merging/MixinMerger.js +33 -0
- package/lib/esm/Merging/MixinMerger.js.map +1 -0
- package/lib/esm/Merging/PhenomenonMerger.d.ts +14 -0
- package/lib/esm/Merging/PhenomenonMerger.d.ts.map +1 -0
- package/lib/esm/Merging/PhenomenonMerger.js +36 -0
- package/lib/esm/Merging/PhenomenonMerger.js.map +1 -0
- package/lib/esm/Merging/PropertyCategoryMerger.d.ts +14 -0
- package/lib/esm/Merging/PropertyCategoryMerger.d.ts.map +1 -0
- package/lib/esm/Merging/PropertyCategoryMerger.js +31 -0
- package/lib/esm/Merging/PropertyCategoryMerger.js.map +1 -0
- package/lib/esm/Merging/PropertyMerger.d.ts +12 -0
- package/lib/esm/Merging/PropertyMerger.d.ts.map +1 -0
- package/lib/esm/Merging/PropertyMerger.js +228 -0
- package/lib/esm/Merging/PropertyMerger.js.map +1 -0
- package/lib/esm/Merging/RelationshipClassMerger.d.ts +27 -0
- package/lib/esm/Merging/RelationshipClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/RelationshipClassMerger.js +136 -0
- package/lib/esm/Merging/RelationshipClassMerger.js.map +1 -0
- package/lib/esm/Merging/SchemaMerger.d.ts +49 -0
- package/lib/esm/Merging/SchemaMerger.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaMerger.js +117 -0
- package/lib/esm/Merging/SchemaMerger.js.map +1 -0
- package/lib/esm/Merging/SchemaMergingVisitor.d.ts +149 -0
- package/lib/esm/Merging/SchemaMergingVisitor.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaMergingVisitor.js +339 -0
- package/lib/esm/Merging/SchemaMergingVisitor.js.map +1 -0
- package/lib/esm/Merging/SchemaMergingWalker.d.ts +19 -0
- package/lib/esm/Merging/SchemaMergingWalker.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaMergingWalker.js +61 -0
- package/lib/esm/Merging/SchemaMergingWalker.js.map +1 -0
- package/lib/esm/Merging/SchemaReferenceMerger.d.ts +13 -0
- package/lib/esm/Merging/SchemaReferenceMerger.d.ts.map +1 -0
- package/lib/esm/Merging/SchemaReferenceMerger.js +57 -0
- package/lib/esm/Merging/SchemaReferenceMerger.js.map +1 -0
- package/lib/esm/Merging/StructClassMerger.d.ts +14 -0
- package/lib/esm/Merging/StructClassMerger.d.ts.map +1 -0
- package/lib/esm/Merging/StructClassMerger.js +20 -0
- package/lib/esm/Merging/StructClassMerger.js.map +1 -0
- package/lib/esm/Merging/UnitMerger.d.ts +14 -0
- package/lib/esm/Merging/UnitMerger.d.ts.map +1 -0
- package/lib/esm/Merging/UnitMerger.js +58 -0
- package/lib/esm/Merging/UnitMerger.js.map +1 -0
- package/lib/esm/Merging/UnitSystemMerger.d.ts +14 -0
- package/lib/esm/Merging/UnitSystemMerger.d.ts.map +1 -0
- package/lib/esm/Merging/UnitSystemMerger.js +24 -0
- package/lib/esm/Merging/UnitSystemMerger.js.map +1 -0
- package/lib/esm/Merging/Utils.d.ts +34 -0
- package/lib/esm/Merging/Utils.d.ts.map +1 -0
- package/lib/esm/Merging/Utils.js +90 -0
- package/lib/esm/Merging/Utils.js.map +1 -0
- package/lib/esm/Validation/Diagnostic.d.ts +322 -0
- package/lib/esm/Validation/Diagnostic.d.ts.map +1 -0
- package/lib/esm/Validation/Diagnostic.js +295 -0
- package/lib/esm/Validation/Diagnostic.js.map +1 -0
- package/lib/esm/Validation/DiagnosticReporter.d.ts +97 -0
- package/lib/esm/Validation/DiagnosticReporter.d.ts.map +1 -0
- package/lib/esm/Validation/DiagnosticReporter.js +105 -0
- package/lib/esm/Validation/DiagnosticReporter.js.map +1 -0
- package/lib/esm/Validation/ECRules.d.ts +454 -0
- package/lib/esm/Validation/ECRules.d.ts.map +1 -0
- package/lib/esm/Validation/ECRules.js +578 -0
- package/lib/esm/Validation/ECRules.js.map +1 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.d.ts +14 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.d.ts.map +1 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.js +37 -0
- package/lib/esm/Validation/LoggingDiagnosticReporter.js.map +1 -0
- package/lib/esm/Validation/RuleSuppressionSet.d.ts +60 -0
- package/lib/esm/Validation/RuleSuppressionSet.d.ts.map +1 -0
- package/lib/esm/Validation/RuleSuppressionSet.js +9 -0
- package/lib/esm/Validation/RuleSuppressionSet.js.map +1 -0
- package/lib/esm/Validation/Rules.d.ts +65 -0
- package/lib/esm/Validation/Rules.d.ts.map +1 -0
- package/lib/esm/Validation/Rules.js +9 -0
- package/lib/esm/Validation/Rules.js.map +1 -0
- package/lib/esm/Validation/SchemaChanges.d.ts +640 -0
- package/lib/esm/Validation/SchemaChanges.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaChanges.js +1141 -0
- package/lib/esm/Validation/SchemaChanges.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.d.ts +423 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.js +109 -0
- package/lib/esm/Validation/SchemaCompareDiagnostics.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareReporter.d.ts +12 -0
- package/lib/esm/Validation/SchemaCompareReporter.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareReporter.js +9 -0
- package/lib/esm/Validation/SchemaCompareReporter.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.d.ts +237 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.js +346 -0
- package/lib/esm/Validation/SchemaCompareResultDelegate.js.map +1 -0
- package/lib/esm/Validation/SchemaCompareVisitor.d.ts +120 -0
- package/lib/esm/Validation/SchemaCompareVisitor.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaCompareVisitor.js +222 -0
- package/lib/esm/Validation/SchemaCompareVisitor.js.map +1 -0
- package/lib/esm/Validation/SchemaComparer.d.ts +211 -0
- package/lib/esm/Validation/SchemaComparer.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaComparer.js +770 -0
- package/lib/esm/Validation/SchemaComparer.js.map +1 -0
- package/lib/esm/Validation/SchemaValidater.d.ts +20 -0
- package/lib/esm/Validation/SchemaValidater.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaValidater.js +55 -0
- package/lib/esm/Validation/SchemaValidater.js.map +1 -0
- package/lib/esm/Validation/SchemaValidationVisitor.d.ts +171 -0
- package/lib/esm/Validation/SchemaValidationVisitor.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaValidationVisitor.js +488 -0
- package/lib/esm/Validation/SchemaValidationVisitor.js.map +1 -0
- package/lib/esm/Validation/SchemaWalker.d.ts +23 -0
- package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaWalker.js +50 -0
- package/lib/esm/Validation/SchemaWalker.js.map +1 -0
- package/lib/esm/ecschema-editing.d.ts +49 -0
- package/lib/esm/ecschema-editing.d.ts.map +1 -0
- package/lib/esm/ecschema-editing.js +52 -0
- package/lib/esm/ecschema-editing.js.map +1 -0
- package/package.json +19 -17
- package/public/locales/en/ECSchemaEditing.json +26 -26
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Diagnostic.js","sourceRoot":"","sources":["../../../src/Validation/Diagnostic.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,iDAAiD;AAEjD,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,GAAG,IAAc,EAAE,EAAE;IACzD,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;QACrD,OAAO,OAAO,IAAI,CAAC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KAAK,cAAc,CAAC,wBAAwB;YAC1C,OAAO,0BAA0B,CAAC;QACpC,KAAK,cAAc,CAAC,IAAI;YACtB,OAAO,MAAM,CAAC;QAChB,KAAK,cAAc,CAAC,QAAQ;YAC1B,OAAO,UAAU,CAAC;QACpB,KAAK,cAAc,CAAC,sBAAsB;YACxC,OAAO,wBAAwB,CAAC;QAClC,KAAK,cAAc,CAAC,MAAM;YACxB,OAAO,QAAQ,CAAC;QAClB,KAAK,cAAc,CAAC,UAAU;YAC5B,OAAO,YAAY,CAAC;IACxB,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,GAAG,GAAG,mBAAmB,IAAI,0DAA0D,CAAC;IAC9F,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IAEvB,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;AACzB,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 Diagnostic\n */\n\nimport { AnyClass, AnyECType, AnyProperty, CustomAttributeContainerProps, RelationshipConstraint, Schema, SchemaItem } from \"@itwin/ecschema-metadata\";\n\n/* eslint-disable @typescript-eslint/no-shadow */\n\nconst formatString = (format: string, ...args: string[]) => {\n return format.replace(/{(\\d+)}/g, (match, theNumber) => {\n return typeof args[theNumber] !== \"undefined\"\n ? args[theNumber]\n : match;\n });\n};\n\n/**\n * Defines the possible diagnostic types.\n * @beta\n */\nexport enum DiagnosticType {\n None,\n Schema,\n SchemaItem,\n Property,\n CustomAttributeContainer,\n RelationshipConstraint,\n}\n\n/**\n * Defines the possible diagnostic categories.\n * @beta\n */\nexport enum DiagnosticCategory {\n Warning,\n Error,\n Suggestion,\n Message,\n}\n\n/**\n * The interface implemented by all diagnostics used during schema validation.\n * @beta\n */\nexport interface IDiagnostic<TYPE extends AnyECType, ARGS extends any[]> {\n /** The diagnostic category (error, warning, etc...). Value is static across all instances. */\n category: DiagnosticCategory;\n /** The unique string identifier of the diagnostic in the format '<ruleSetName>:<number>. Value is static across all instances. */\n code: string;\n /** The context type of diagnostic (schema, schema item, property, etc...). Value is static across all instances. */\n diagnosticType: DiagnosticType;\n /** The unformatted message text associated with the diagnostic. Value is static across all instances. */\n messageText: string;\n /** The arguments used when formatted the diagnostic instance's message. */\n messageArgs?: ARGS;\n /** The EC object associated with the diagnostic instance. */\n ecDefinition: TYPE;\n /** The schema where the diagnostic originated. */\n schema: Schema;\n}\n\n/**\n * Type which encapsulates all possible diagnostics.\n * @beta\n */\nexport type AnyDiagnostic = IDiagnostic<AnyECType, any[]>;\n\n/**\n * The abstract base class for all [[IDiagnostic]] implementations.\n * @beta\n */\nexport abstract class BaseDiagnostic<TYPE extends AnyECType, ARGS extends any[]> implements IDiagnostic<TYPE, ARGS> {\n /**\n * Initializes a new BaseDiagnostic.\n * @param ecDefinition The EC object to associate with the diagnostic.\n * @param messageArgs The arguments used when formatting the diagnostic message.\n * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.\n */\n constructor(ecDefinition: TYPE, messageArgs?: ARGS, category: DiagnosticCategory = DiagnosticCategory.Error) {\n this.ecDefinition = ecDefinition;\n this.messageArgs = messageArgs;\n this.category = category;\n }\n\n /** Gets the unique string identifier for the diagnostic in the format '<ruleSetName>:<number>'. */\n public abstract get code(): string;\n /** Gets the context type of the diagnostic (schema, schema item, property, etc...) */\n public abstract get diagnosticType(): DiagnosticType;\n /** Gets the message associated with the diagnostic. */\n public abstract get messageText(): string;\n /** Gets the schema where the diagnostic originated. */\n public abstract get schema(): Schema;\n\n /** The EC object to associate with the diagnostic. */\n public ecDefinition: TYPE;\n /** The arguments used when formatting the diagnostic message. */\n public messageArgs?: ARGS;\n /** The diagnostic category is of the type DiagnosticCategory; which is defined as an enumeration above. */\n public category: DiagnosticCategory;\n}\n\n/**\n * An [[IDiagnostic]] implementation used for [[Schema]] diagnostics.\n * @beta\n */\nexport abstract class SchemaDiagnostic<ARGS extends any[]> extends BaseDiagnostic<Schema, ARGS> {\n public static diagnosticType = DiagnosticType.SchemaItem;\n\n /**\n * Initializes a new SchemaDiagnostic.\n * @param ecDefinition The EC object to associate with the diagnostic.\n * @param messageArgs The arguments used when formatting the diagnostic message.\n * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.\n */\n constructor(schema: Schema, messageArgs: ARGS, category: DiagnosticCategory = DiagnosticCategory.Error) {\n super(schema, messageArgs, category);\n }\n\n /** Gets the schema where the diagnostic originated. */\n public get schema(): Schema { return this.ecDefinition; }\n\n /** Gets the DiagnosticType. */\n public get diagnosticType(): DiagnosticType { return DiagnosticType.Schema; }\n}\n\n/**\n * An [[IDiagnostic]] implementation used for [[SchemaItem]] diagnostics.\n * @beta\n */\nexport abstract class SchemaItemDiagnostic<TYPE extends SchemaItem, ARGS extends any[]> extends BaseDiagnostic<TYPE, ARGS> {\n public static diagnosticType = DiagnosticType.SchemaItem;\n /**\n * Initializes a new SchemaItemDiagnostic.\n * @param ecDefinition The EC object to associate with the diagnostic.\n * @param messageArgs The arguments used when formatting the diagnostic message.\n * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.\n */\n constructor(ecDefinition: SchemaItem, messageArgs: ARGS, category: DiagnosticCategory = DiagnosticCategory.Error) {\n super(ecDefinition as TYPE, messageArgs, category);\n }\n\n /** Gets the schema where the diagnostic originated. */\n public get schema(): Schema { return this.ecDefinition.schema; }\n\n /** Gets the DiagnosticType. */\n public get diagnosticType(): DiagnosticType { return DiagnosticType.SchemaItem; }\n}\n\n/**\n * An [[IDiagnostic]] implementation used for [[ECClass]] diagnostics.\n * @beta\n */\nexport abstract class ClassDiagnostic<ARGS extends any[]> extends SchemaItemDiagnostic<AnyClass, ARGS> {\n /**\n * Initializes a new ClassDiagnostic.\n * @param ecClass The class to associate with the diagnostic.\n * @param messageArgs The arguments used when formatting the diagnostic message.\n * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.\n */\n constructor(ecClass: AnyClass, messageArgs: ARGS, category: DiagnosticCategory = DiagnosticCategory.Error) {\n super(ecClass, messageArgs, category);\n }\n\n /** Gets the schema where the diagnostic originated. */\n public override get schema(): Schema { return this.ecDefinition.schema; }\n}\n\n/**\n * An [[IDiagnostic]] implementation used for [[Property]] diagnostics.\n * @beta\n */\nexport abstract class PropertyDiagnostic<ARGS extends any[]> extends BaseDiagnostic<AnyProperty, ARGS> {\n /**\n * Initializes a new PropertyDiagnostic.\n * @param property The property to associate with the diagnostic.\n * @param messageArgs The arguments used when formatting the diagnostic message.\n * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.\n */\n constructor(property: AnyProperty, messageArgs?: ARGS, category: DiagnosticCategory = DiagnosticCategory.Error) {\n super(property, messageArgs, category);\n }\n\n /** Gets the schema where the diagnostic originated. */\n public get schema(): Schema { return this.ecDefinition.schema; }\n\n /** Gets the DiagnosticType. */\n public get diagnosticType(): DiagnosticType { return DiagnosticType.Property; }\n}\n\n/**\n * An [[IDiagnostic]] implementation used for [[RelationshipConstraint]] diagnostics.\n * @beta\n */\nexport abstract class RelationshipConstraintDiagnostic<ARGS extends any[]> extends BaseDiagnostic<RelationshipConstraint, ARGS> {\n /**\n * Initializes a new RelationshipConstraintDiagnostic.\n * @param constraint The Relationship Constraint to associate with the diagnostic.\n * @param messageArgs The arguments used when formatting the diagnostic message.\n * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.\n */\n constructor(constraint: RelationshipConstraint, messageArgs: ARGS, category: DiagnosticCategory = DiagnosticCategory.Error) {\n super(constraint, messageArgs, category);\n }\n\n /** Gets the schema where the diagnostic originated. */\n public get schema(): Schema { return this.ecDefinition.schema; }\n\n /** Gets the DiagnosticType. */\n public get diagnosticType(): DiagnosticType { return DiagnosticType.RelationshipConstraint; }\n}\n\n/**\n * An [[IDiagnostic]] implementation used for [[CustomAttributeContainerProps]] diagnostics.\n * @beta\n */\nexport abstract class CustomAttributeContainerDiagnostic<ARGS extends any[]> extends BaseDiagnostic<CustomAttributeContainerProps, ARGS> {\n /**\n * Initializes a new CustomAttributeContainerDiagnostic.\n * @param constraint The Custom Attribute Container to associate with the diagnostic.\n * @param messageArgs The arguments used when formatting the diagnostic message.\n * @param category The [[DiagnosticCategory]] to associate with the diagnostic, Error by default.\n */\n constructor(container: CustomAttributeContainerProps, messageArgs: ARGS, category: DiagnosticCategory = DiagnosticCategory.Error) {\n super(container, messageArgs, category);\n }\n\n /** Gets the schema where the diagnostic originated. */\n public get schema(): Schema { return this.ecDefinition.schema; }\n\n /** Gets the DiagnosticType. */\n public get diagnosticType(): DiagnosticType { return DiagnosticType.CustomAttributeContainer; }\n}\n\n/**\n * Helper method for creating [[SchemaDiagnostic]] child classes.\n * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.\n * @param messageText The message to associate with the diagnostic class.\n * @beta\n */\nexport function createSchemaDiagnosticClass<ARGS extends any[]>(code: string, messageText: string) {\n validateCode(code);\n return class extends SchemaDiagnostic<ARGS> {\n public static code = code;\n public get code(): string { return code; }\n public get messageText(): string { return undefined === this.messageArgs ? messageText : formatString(messageText, ...this.messageArgs); }\n };\n}\n\n/**\n * Helper method for creating [[SchemaItemDiagnostic]] child classes.\n * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.\n * @param messageText The message to associate with the diagnostic class.\n * @beta\n */\nexport function createSchemaItemDiagnosticClass<ITEM extends SchemaItem, ARGS extends any[]>(code: string, messageText: string) {\n validateCode(code);\n return class extends SchemaItemDiagnostic<ITEM, ARGS> {\n public get code(): string { return code; }\n public get messageText(): string { return undefined === this.messageArgs ? messageText : formatString(messageText, ...this.messageArgs); }\n };\n}\n\n/**\n * Helper method for creating [[ClassDiagnostic]] child classes.\n * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.\n * @param messageText The message to associate with the diagnostic class.\n * @beta\n */\nexport function createClassDiagnosticClass<ARGS extends any[]>(code: string, messageText: string) {\n validateCode(code);\n return class extends ClassDiagnostic<ARGS> {\n public get code(): string { return code; }\n public get messageText(): string { return undefined === this.messageArgs ? messageText : formatString(messageText, ...this.messageArgs); }\n };\n}\n\n/**\n * Helper method for creating [[PropertyDiagnostic]] child classes.\n * @param code The string that uniquely identifies the diagnostic in the format '<ruleSetName>:<number>'.\n * @param messageText The message to associate with the diagnostic class.\n * @beta\n */\nexport function createPropertyDiagnosticClass<ARGS extends any[]>(code: string, messageText: string) {\n validateCode(code);\n return class extends PropertyDiagnostic<ARGS> {\n public static code = code;\n public get code(): string { return code; }\n public get messageText(): string { return undefined === this.messageArgs ? messageText : formatString(messageText, ...this.messageArgs); }\n };\n}\n\n/**\n * Helper method for creating [[RelationshipConstraintDiagnostic]] child classes.\n * @param code The string that uniquely identifies the type of diagnostic in the format '<ruleSetName>:<number>'.\n * @param messageText The message to associate with the diagnostic class.\n * @beta\n */\nexport function createRelationshipConstraintDiagnosticClass<ARGS extends any[]>(code: string, messageText: string) {\n validateCode(code);\n return class extends RelationshipConstraintDiagnostic<ARGS> {\n public get code(): string { return code; }\n public get messageText(): string { return undefined === this.messageArgs ? messageText : formatString(messageText, ...this.messageArgs); }\n };\n}\n\n/**\n * Helper method for creating [[CustomAttributeContainerDiagnostic]] child classes.\n * @param code The that uniquely identifies the type of diagnostic in the format '<ruleSetName>:<number>'.\n * @param messageText The message to associate with the diagnostic class.\n * @beta\n */\nexport function createCustomAttributeContainerDiagnosticClass<ARGS extends any[]>(code: string, messageText: string) {\n validateCode(code);\n return class extends CustomAttributeContainerDiagnostic<ARGS> {\n public get code(): string { return code; }\n public get messageText(): string { return undefined === this.messageArgs ? messageText : formatString(messageText, ...this.messageArgs); }\n };\n}\n\n/** @beta */\nexport function diagnosticCategoryToString(category: DiagnosticCategory) {\n switch (category) {\n case DiagnosticCategory.Error:\n return \"Error\";\n case DiagnosticCategory.Warning:\n return \"Warning\";\n case DiagnosticCategory.Message:\n return \"Message\";\n case DiagnosticCategory.Suggestion:\n return \"Suggestion\";\n }\n}\n\n/** @beta */\nexport function diagnosticTypeToString(type: DiagnosticType) {\n switch (type) {\n case DiagnosticType.CustomAttributeContainer:\n return \"CustomAttributeContainer\";\n case DiagnosticType.None:\n return \"None\";\n case DiagnosticType.Property:\n return \"Property\";\n case DiagnosticType.RelationshipConstraint:\n return \"RelationshipConstraint\";\n case DiagnosticType.Schema:\n return \"Schema\";\n case DiagnosticType.SchemaItem:\n return \"SchemaItem\";\n }\n}\n\nfunction validateCode(code: string) {\n const msg = `Diagnostic code ${code} is invalid. Expected the format <ruleSetName>-<number>.`;\n const parts = code.split(\"-\");\n if (parts.length !== 2)\n throw new Error(msg);\n\n if (isNaN(Number(parts[1])))\n throw new Error(msg);\n}\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Diagnostic
|
|
3
|
+
*/
|
|
4
|
+
import { Localization } from "@itwin/core-common";
|
|
5
|
+
import { AnyDiagnostic } from "./Diagnostic";
|
|
6
|
+
/**
|
|
7
|
+
* Interface used to report [[IDiagnostic]] objects created during schema validation.
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export interface IDiagnosticReporter {
|
|
11
|
+
/**
|
|
12
|
+
* A map where the key is a schema full name and the value is a collection
|
|
13
|
+
* of diagnostics codes identifying which rules violations to ignore during validation.
|
|
14
|
+
*/
|
|
15
|
+
suppressions?: Map<string, string[]>;
|
|
16
|
+
/** The localization object to use for message translation. */
|
|
17
|
+
localization?: Localization;
|
|
18
|
+
/**
|
|
19
|
+
* Handles the given [[IDiagnostic]] based on the implementation requirements for a
|
|
20
|
+
* given reporter.
|
|
21
|
+
* @param diagnostic The diagnostic to report.
|
|
22
|
+
*/
|
|
23
|
+
report(diagnostic: AnyDiagnostic): void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* An abstract base class for [[IDiagnosticReporter]] implementation that used the
|
|
27
|
+
* provided Map to suppress certain rule violations from being reported. The Map's key
|
|
28
|
+
* a schema full name, and the Map's value is a collection of rule codes to suppress.
|
|
29
|
+
* @beta
|
|
30
|
+
*/
|
|
31
|
+
export declare abstract class SuppressionDiagnosticReporter implements IDiagnosticReporter {
|
|
32
|
+
private _suppressions?;
|
|
33
|
+
/**
|
|
34
|
+
* Initializes a new SuppressionDiagnosticReporter
|
|
35
|
+
* @param suppressions A Map where the key is a schema full name and the value is collection of diagnostic codes to suppress.
|
|
36
|
+
*/
|
|
37
|
+
constructor(suppressions?: Map<string, string[]>);
|
|
38
|
+
/**
|
|
39
|
+
* Gets the collection of ISchemaDiagnosticSuppression objects that identify
|
|
40
|
+
* rules violations to ignore during validation.
|
|
41
|
+
*/
|
|
42
|
+
get suppressions(): Map<string, string[]> | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Prior to reporting the [[IDiagnostic]], the diagnostic message is formatted (with translations)
|
|
45
|
+
* base on arguments contained in the diagnostic. Calls reportDiagnostic after the message is formatted.
|
|
46
|
+
* @param diagnostic The diagnostic to report.
|
|
47
|
+
*/
|
|
48
|
+
report(diagnostic: AnyDiagnostic): void;
|
|
49
|
+
/**
|
|
50
|
+
* Handles the given [[IDiagnostic]] based on the implementation requirements for a
|
|
51
|
+
* given reporter.
|
|
52
|
+
* @param diagnostic The diagnostic to report.
|
|
53
|
+
*/
|
|
54
|
+
protected abstract reportInternal(diagnostic: AnyDiagnostic): void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* An abstract [[SuppressionDiagnosticReporter]] implementation that formats the
|
|
58
|
+
* diagnostic message with the message args. If a Localization implementation is specified,
|
|
59
|
+
* the message will also be translated.
|
|
60
|
+
* @beta
|
|
61
|
+
*/
|
|
62
|
+
export declare abstract class FormatDiagnosticReporter extends SuppressionDiagnosticReporter {
|
|
63
|
+
/**
|
|
64
|
+
* Initializes a new FormatDiagnosticReporter
|
|
65
|
+
* @param suppressions A Map where the key is a schema full name and the value is collection of diagnostic codes to suppress.
|
|
66
|
+
* @param localization The Localization instance to use to translate validation messages.
|
|
67
|
+
*/
|
|
68
|
+
constructor(suppressions?: Map<string, string[]>, localization?: Localization);
|
|
69
|
+
/** The Localization object to use for message translation. If undefined, no translation will occur. */
|
|
70
|
+
localization?: Localization;
|
|
71
|
+
/**
|
|
72
|
+
* Prior to reporting the [[IDiagnostic]], the diagnostic message is formatted (with translations)
|
|
73
|
+
* base on arguments contained in the diagnostic. Calls reportDiagnostic after the message is formatted.
|
|
74
|
+
* @param diagnostic The diagnostic to report.
|
|
75
|
+
*/
|
|
76
|
+
reportInternal(diagnostic: AnyDiagnostic): void;
|
|
77
|
+
/**
|
|
78
|
+
* Handles the given [[IDiagnostic]] based on the implementation requirements for a
|
|
79
|
+
* given reporter.
|
|
80
|
+
* @param diagnostic The diagnostic to report.
|
|
81
|
+
* @param messageText The formatted message.
|
|
82
|
+
*/
|
|
83
|
+
protected abstract reportDiagnostic(diagnostic: AnyDiagnostic, messageText: string): void;
|
|
84
|
+
/**
|
|
85
|
+
* Helper method that formats string with provided arguments where the place holders
|
|
86
|
+
* are in the the format '{0}', '{1}', etc.
|
|
87
|
+
* @param text The text to format.
|
|
88
|
+
* @param args The arguments to place in the text.
|
|
89
|
+
* @param baseIndex The base index for the args, used for validation (typically 0, which is the default).
|
|
90
|
+
*/
|
|
91
|
+
protected formatStringFromArgs(text: string, args: ArrayLike<string>, baseIndex?: number): string;
|
|
92
|
+
private formatMessage;
|
|
93
|
+
private translateMessage;
|
|
94
|
+
private getTranslationKey;
|
|
95
|
+
private assertDefined;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=DiagnosticReporter.d.ts.map
|
|
@@ -0,0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E,aAAa,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAEzF;;;;;;OAMG;IACH,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,SAAI,GAAG,MAAM;IAI5F,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,aAAa;CAMtB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Diagnostic
|
|
7
|
+
*/
|
|
8
|
+
import * as assert from "assert";
|
|
9
|
+
const translationNamespace = "ECSchemaMetaData";
|
|
10
|
+
const subTranslationNamespace = "Diagnostics";
|
|
11
|
+
const baseTranslationKey = `${translationNamespace}:${subTranslationNamespace}`;
|
|
12
|
+
/**
|
|
13
|
+
* An abstract base class for [[IDiagnosticReporter]] implementation that used the
|
|
14
|
+
* provided Map to suppress certain rule violations from being reported. The Map's key
|
|
15
|
+
* a schema full name, and the Map's value is a collection of rule codes to suppress.
|
|
16
|
+
* @beta
|
|
17
|
+
*/
|
|
18
|
+
export class SuppressionDiagnosticReporter {
|
|
19
|
+
_suppressions;
|
|
20
|
+
/**
|
|
21
|
+
* Initializes a new SuppressionDiagnosticReporter
|
|
22
|
+
* @param suppressions A Map where the key is a schema full name and the value is collection of diagnostic codes to suppress.
|
|
23
|
+
*/
|
|
24
|
+
constructor(suppressions) {
|
|
25
|
+
this._suppressions = suppressions;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Gets the collection of ISchemaDiagnosticSuppression objects that identify
|
|
29
|
+
* rules violations to ignore during validation.
|
|
30
|
+
*/
|
|
31
|
+
get suppressions() {
|
|
32
|
+
return this._suppressions;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Prior to reporting the [[IDiagnostic]], the diagnostic message is formatted (with translations)
|
|
36
|
+
* base on arguments contained in the diagnostic. Calls reportDiagnostic after the message is formatted.
|
|
37
|
+
* @param diagnostic The diagnostic to report.
|
|
38
|
+
*/
|
|
39
|
+
report(diagnostic) {
|
|
40
|
+
if (this._suppressions && this._suppressions.has(diagnostic.schema.fullName)) {
|
|
41
|
+
const suppressedCodes = this._suppressions.get(diagnostic.schema.fullName);
|
|
42
|
+
if (suppressedCodes.includes(diagnostic.code))
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.reportInternal(diagnostic);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* An abstract [[SuppressionDiagnosticReporter]] implementation that formats the
|
|
50
|
+
* diagnostic message with the message args. If a Localization implementation is specified,
|
|
51
|
+
* the message will also be translated.
|
|
52
|
+
* @beta
|
|
53
|
+
*/
|
|
54
|
+
export class FormatDiagnosticReporter extends SuppressionDiagnosticReporter {
|
|
55
|
+
/**
|
|
56
|
+
* Initializes a new FormatDiagnosticReporter
|
|
57
|
+
* @param suppressions A Map where the key is a schema full name and the value is collection of diagnostic codes to suppress.
|
|
58
|
+
* @param localization The Localization instance to use to translate validation messages.
|
|
59
|
+
*/
|
|
60
|
+
constructor(suppressions, localization) {
|
|
61
|
+
super(suppressions);
|
|
62
|
+
this.localization = localization;
|
|
63
|
+
}
|
|
64
|
+
/** The Localization object to use for message translation. If undefined, no translation will occur. */
|
|
65
|
+
localization;
|
|
66
|
+
/**
|
|
67
|
+
* Prior to reporting the [[IDiagnostic]], the diagnostic message is formatted (with translations)
|
|
68
|
+
* base on arguments contained in the diagnostic. Calls reportDiagnostic after the message is formatted.
|
|
69
|
+
* @param diagnostic The diagnostic to report.
|
|
70
|
+
*/
|
|
71
|
+
reportInternal(diagnostic) {
|
|
72
|
+
const message = this.formatMessage(diagnostic);
|
|
73
|
+
this.reportDiagnostic(diagnostic, message);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Helper method that formats string with provided arguments where the place holders
|
|
77
|
+
* are in the the format '{0}', '{1}', etc.
|
|
78
|
+
* @param text The text to format.
|
|
79
|
+
* @param args The arguments to place in the text.
|
|
80
|
+
* @param baseIndex The base index for the args, used for validation (typically 0, which is the default).
|
|
81
|
+
*/
|
|
82
|
+
formatStringFromArgs(text, args, baseIndex = 0) {
|
|
83
|
+
return text.replace(/{(\d+)}/g, (_match, index) => this.assertDefined(args[+index + baseIndex]));
|
|
84
|
+
}
|
|
85
|
+
formatMessage(diagnostic) {
|
|
86
|
+
let translatedMessage = this.translateMessage(diagnostic);
|
|
87
|
+
if (diagnostic.messageArgs && diagnostic.messageArgs.length > 0)
|
|
88
|
+
translatedMessage = this.formatStringFromArgs(translatedMessage, diagnostic.messageArgs);
|
|
89
|
+
return translatedMessage;
|
|
90
|
+
}
|
|
91
|
+
translateMessage(diagnostic) {
|
|
92
|
+
if (!this.localization)
|
|
93
|
+
return diagnostic.messageText;
|
|
94
|
+
return this.localization.getLocalizedString(this.getTranslationKey(diagnostic));
|
|
95
|
+
}
|
|
96
|
+
getTranslationKey(diagnostic) {
|
|
97
|
+
return `${baseTranslationKey}.${diagnostic.code}`;
|
|
98
|
+
}
|
|
99
|
+
assertDefined(value, message) {
|
|
100
|
+
if (value === undefined || value === null)
|
|
101
|
+
return assert(false, message);
|
|
102
|
+
return value;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=DiagnosticReporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiagnosticReporter.js","sourceRoot":"","sources":["../../../src/Validation/DiagnosticReporter.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;A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IACO,oBAAoB,CAAC,IAAY,EAAE,IAAuB,EAAE,SAAS,GAAG,CAAC;QACjF,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,KAAa,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC3G,CAAC;IAEO,aAAa,CAAC,UAAyB;QAC7C,IAAI,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAE1D,IAAI,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC;YAC7D,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3F,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAEO,gBAAgB,CAAC,UAAyB;QAChD,IAAI,CAAC,IAAI,CAAC,YAAY;YACpB,OAAO,UAAU,CAAC,WAAW,CAAC;QAEhC,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;IAClF,CAAC;IAEO,iBAAiB,CAAC,UAAyB;QACjD,OAAO,GAAG,kBAAkB,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;IACpD,CAAC;IAEO,aAAa,CAAI,KAA2B,EAAE,OAAgB;QACpE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;YACvC,OAAO,MAAM,CAAC,KAAK,EAAE,OAAO,CAAU,CAAC;QAEzC,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Diagnostic\n */\n\nimport { Localization } from \"@itwin/core-common\";\nimport { AnyDiagnostic } from \"./Diagnostic\";\n\nimport * as assert from \"assert\";\n\nconst translationNamespace = \"ECSchemaMetaData\";\nconst subTranslationNamespace = \"Diagnostics\";\nconst baseTranslationKey = `${translationNamespace}:${subTranslationNamespace}`;\n\n/**\n * Interface used to report [[IDiagnostic]] objects created during schema validation.\n * @beta\n */\nexport interface IDiagnosticReporter {\n /**\n * A map where the key is a schema full name and the value is a collection\n * of diagnostics codes identifying which rules violations to ignore during validation.\n */\n suppressions?: Map<string, string[]>;\n\n /** The localization object to use for message translation. */\n localization?: Localization;\n\n /**\n * Handles the given [[IDiagnostic]] based on the implementation requirements for a\n * given reporter.\n * @param diagnostic The diagnostic to report.\n */\n report(diagnostic: AnyDiagnostic): void;\n}\n\n/**\n * An abstract base class for [[IDiagnosticReporter]] implementation that used the\n * provided Map to suppress certain rule violations from being reported. The Map's key\n * a schema full name, and the Map's value is a collection of rule codes to suppress.\n * @beta\n */\nexport abstract class SuppressionDiagnosticReporter implements IDiagnosticReporter {\n private _suppressions?: Map<string, string[]>;\n\n /**\n * Initializes a new SuppressionDiagnosticReporter\n * @param suppressions A Map where the key is a schema full name and the value is collection of diagnostic codes to suppress.\n */\n constructor(suppressions?: Map<string, string[]>) {\n this._suppressions = suppressions;\n }\n\n /**\n * Gets the collection of ISchemaDiagnosticSuppression objects that identify\n * rules violations to ignore during validation.\n */\n public get suppressions(): Map<string, string[]> | undefined {\n return this._suppressions;\n }\n\n /**\n * Prior to reporting the [[IDiagnostic]], the diagnostic message is formatted (with translations)\n * base on arguments contained in the diagnostic. Calls reportDiagnostic after the message is formatted.\n * @param diagnostic The diagnostic to report.\n */\n public report(diagnostic: AnyDiagnostic) {\n if (this._suppressions && this._suppressions.has(diagnostic.schema.fullName)) {\n const suppressedCodes = this._suppressions.get(diagnostic.schema.fullName);\n if (suppressedCodes!.includes(diagnostic.code))\n return;\n }\n\n this.reportInternal(diagnostic);\n }\n\n /**\n * Handles the given [[IDiagnostic]] based on the implementation requirements for a\n * given reporter.\n * @param diagnostic The diagnostic to report.\n */\n protected abstract reportInternal(diagnostic: AnyDiagnostic): void;\n}\n\n/**\n * An abstract [[SuppressionDiagnosticReporter]] implementation that formats the\n * diagnostic message with the message args. If a Localization implementation is specified,\n * the message will also be translated.\n * @beta\n */\nexport abstract class FormatDiagnosticReporter extends SuppressionDiagnosticReporter {\n /**\n * Initializes a new FormatDiagnosticReporter\n * @param suppressions A Map where the key is a schema full name and the value is collection of diagnostic codes to suppress.\n * @param localization The Localization instance to use to translate validation messages.\n */\n constructor(suppressions?: Map<string, string[]>, localization?: Localization) {\n super(suppressions);\n this.localization = localization;\n }\n\n /** The Localization object to use for message translation. If undefined, no translation will occur. */\n public localization?: Localization;\n\n /**\n * Prior to reporting the [[IDiagnostic]], the diagnostic message is formatted (with translations)\n * base on arguments contained in the diagnostic. Calls reportDiagnostic after the message is formatted.\n * @param diagnostic The diagnostic to report.\n */\n public reportInternal(diagnostic: AnyDiagnostic) {\n const message = this.formatMessage(diagnostic);\n this.reportDiagnostic(diagnostic, message);\n }\n\n /**\n * Handles the given [[IDiagnostic]] based on the implementation requirements for a\n * given reporter.\n * @param diagnostic The diagnostic to report.\n * @param messageText The formatted message.\n */\n protected abstract reportDiagnostic(diagnostic: AnyDiagnostic, messageText: string): void;\n\n /**\n * Helper method that formats string with provided arguments where the place holders\n * are in the the format '{0}', '{1}', etc.\n * @param text The text to format.\n * @param args The arguments to place in the text.\n * @param baseIndex The base index for the args, used for validation (typically 0, which is the default).\n */\n protected formatStringFromArgs(text: string, args: ArrayLike<string>, baseIndex = 0): string {\n return text.replace(/{(\\d+)}/g, (_match, index: string) => this.assertDefined(args[+index + baseIndex]));\n }\n\n private formatMessage(diagnostic: AnyDiagnostic): string {\n let translatedMessage = this.translateMessage(diagnostic);\n\n if (diagnostic.messageArgs && diagnostic.messageArgs.length > 0)\n translatedMessage = this.formatStringFromArgs(translatedMessage, diagnostic.messageArgs);\n return translatedMessage;\n }\n\n private translateMessage(diagnostic: AnyDiagnostic): string {\n if (!this.localization)\n return diagnostic.messageText;\n\n return this.localization.getLocalizedString(this.getTranslationKey(diagnostic));\n }\n\n private getTranslationKey(diagnostic: AnyDiagnostic): string {\n return `${baseTranslationKey}.${diagnostic.code}`;\n }\n\n private assertDefined<T>(value: T | null | undefined, message?: string): T {\n if (value === undefined || value === null)\n return assert(false, message) as never;\n\n return value;\n }\n}\n"]}
|