@itwin/ecschema-editing 5.0.0-dev.9 → 5.0.0-dev.90
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 +3 -0
- 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/package.json +16 -16
- package/public/locales/en/ECSchemaEditing.json +26 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaCompareResultDelegate.js","sourceRoot":"","sources":["../../../src/Validation/SchemaCompareResultDelegate.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAQH,mDAAgD;AAChD,yEAAsE;AAItE;;;GAGG;AACH,MAAa,2BAA2B;IAKtC;;;OAGG;IACH,YAAY,OAAe,EAAE,OAAe,EAAE,GAAG,SAAmC;QAClF,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC;QACxC,IAAI,CAAC,eAAe,GAAG,IAAI,6BAAa,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,eAAe,GAAG,IAAI,6BAAa,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,IAAW,qBAAqB;QAC9B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACrC,CAAC;IAED;;OAEG;IACI,eAAe;QACpB,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;QAC1E,IAAI,IAAI,CAAC,eAAe;YACtB,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CA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kEA4WC","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 Comparison\r\n */\r\n\r\nimport { AnyClass, AnyEnumerator, AnyProperty, Constant, CustomAttribute,\r\n CustomAttributeClass, CustomAttributeContainerProps, EntityClass, Enumeration, Format, InvertedUnit, KindOfQuantity,\r\n Mixin, OverrideFormat, Phenomenon, PropertyCategory, RelationshipClass, RelationshipConstraint,\r\n Schema, SchemaItem, Unit,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { AnyDiagnostic } from \"./Diagnostic\";\r\nimport { SchemaChanges } from \"./SchemaChanges\";\r\nimport { SchemaCompareDiagnostics } from \"./SchemaCompareDiagnostics\";\r\nimport { SchemaCompareDirection } from \"./SchemaComparer\";\r\nimport { ISchemaCompareReporter } from \"./SchemaCompareReporter\";\r\n\r\n/**\r\n * Used by the [[SchemaComparer]] to report differences found during schema comparison.\r\n * @internal\r\n */\r\nexport class SchemaCompareResultDelegate {\r\n private _schemaChangeReporters: ISchemaCompareReporter[];\r\n private _schemaAChanges: SchemaChanges;\r\n private _schemaBChanges: SchemaChanges;\r\n\r\n /**\r\n * Initializes a new SchemaCompareResultDelegate instance.\r\n * @param reporters The [[ISchemaCompareReporter]] objects to use to report schema differences.\r\n */\r\n constructor(schemaA: Schema, schemaB: Schema, ...reporters: ISchemaCompareReporter[]) {\r\n this._schemaChangeReporters = reporters;\r\n this._schemaAChanges = new SchemaChanges(schemaA);\r\n this._schemaBChanges = new SchemaChanges(schemaB);\r\n }\r\n\r\n public get schemaChangeReporters(): ISchemaCompareReporter[] {\r\n return this._schemaChangeReporters;\r\n }\r\n\r\n /**\r\n * Called by the SchemaComparer when the comparison is complete.\r\n */\r\n public compareComplete() {\r\n this.schemaChangeReporters.forEach((r) => r.report(this._schemaAChanges));\r\n if (this._schemaBChanges)\r\n this.schemaChangeReporters.forEach((r) => r.report(this._schemaBChanges));\r\n }\r\n\r\n /**\r\n * Reports differences between Schema properties.\r\n * @param schemaA The first Schema supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first Schema.\r\n * @param valueB The value from the second Schema.\r\n */\r\n public async reportSchemaDelta(schemaA: Schema, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.SchemaDelta(schemaA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences in the schema reference collection of two schemas.\r\n * @param schemaA The first Schema supplied for comparison.\r\n * @param referenceSchema The missing schema reference.\r\n */\r\n public async reportSchemaReferenceMissing(schemaA: Schema, referenceSchema: Schema, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.SchemaReferenceMissing(schemaA, [referenceSchema]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences in the schema reference collection of two schemas where the reference version differs.\r\n * @param schemaA The first Schema supplied for comparison.\r\n * @param referenceSchema The missing schema reference.\r\n */\r\n public async reportSchemaReferenceDelta(schemaA: Schema, referenceSchema: Schema, versionA: string, versionB: string, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.SchemaReferenceDelta(schemaA, [referenceSchema, versionA, versionB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports that a given SchemaItem could not be found in the second Schema.\r\n * @param schemaItemA The SchemaItem from the first Schema.\r\n */\r\n public async reportSchemaItemMissing(schemaItemA: SchemaItem, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.SchemaItemMissing(schemaItemA, []);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between SchemaItem properties.\r\n * @param schemaItemA The first SchemaItem supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first SchemaItem.\r\n * @param valueB The value from the second SchemaItem.\r\n */\r\n public async reportSchemaItemDelta(schemaItemA: SchemaItem, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.SchemaItemDelta(schemaItemA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between ECClass properties.\r\n * @param classA The first ECClass supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first ECClass.\r\n * @param valueB The value from the second ECClass.\r\n */\r\n public async reportClassDelta(classA: AnyClass, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.ClassDelta(classA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences of the base class defined between two ECClass objects.\r\n * @param classA The first ECClass supplied for comparison.\r\n * @param baseClassA The base class of the first ECClass.\r\n * @param baseClassB The base class of the second ECClass.\r\n */\r\n public async reportBaseClassDelta(classA: AnyClass, baseClassA: AnyClass | undefined, baseClassB: AnyClass | undefined, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.BaseClassDelta(classA, [baseClassA, baseClassB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between ECProperty properties.\r\n * @param propertyA The first ECProperty supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first ECProperty.\r\n * @param valueB The value from the second ECProperty.\r\n */\r\n public async reportPropertyDelta(propertyA: AnyProperty, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.PropertyDelta(propertyA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports that an ECProperty found in the first ECClass could not be found in the second.\r\n * @param propertyA The ECProperty supplied for comparison.\r\n */\r\n public async reportPropertyMissing(propertyA: AnyProperty, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.PropertyMissing(propertyA, []);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports that a Mixin found in the first EntityClass could not be found in the second.\r\n * @param entityClassA The first EntityClass that is missing the Mixin.\r\n * @param mixinA The Mixin from the first EntityClass.\r\n */\r\n public async reportEntityMixinMissing(entityClassA: EntityClass, mixinA: Mixin, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.EntityMixinMissing(entityClassA, [mixinA]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between Mixin properties.\r\n * @param mixinA The first Mixin supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first Mixin.\r\n * @param valueB The value from the second Mixin.\r\n */\r\n public async reportMixinDelta(mixinA: Mixin, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.MixinDelta(mixinA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between RelationshipClass properties.\r\n * @param relationshipClassA The first RelationshipClass supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first RelationshipClass.\r\n * @param valueB The value from the second RelationshipClass.\r\n */\r\n public async reportRelationshipClassDelta(relationshipClassA: RelationshipClass, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.RelationshipDelta(relationshipClassA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between RelationshipConstraint properties.\r\n * @param constraintA The first RelationshipConstraint supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first RelationshipConstraint.\r\n * @param valueB The value from the second RelationshipConstraint.\r\n */\r\n public async reportRelationshipConstraintDelta(constraintA: RelationshipConstraint, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.RelationshipConstraintDelta(constraintA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports that a constraint class found in the first RelationshipConstraint could not be found in the second.\r\n * @param constraintA The first RelationshipConstraint that is missing the class constraint.\r\n * @param constraintClass The constraint ECClass from the first RelationshipConstraint.\r\n */\r\n public async reportRelationshipConstraintClassMissing(constraintA: RelationshipConstraint, constraintClass: EntityClass | Mixin | RelationshipClass, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.RelationshipConstraintClassMissing(constraintA, [constraintClass]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between CustomAttributeClass properties.\r\n * @param customAttributeA The first CustomAttributeClass supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first CustomAttributeClass.\r\n * @param valueB The value from the second CustomAttributeClass.\r\n */\r\n public async reportCustomAttributeClassDelta(customAttributeA: CustomAttributeClass, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.CustomAttributeClassDelta(customAttributeA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports that a CustomAttribute instance found in the first CustomAttribute container could not be found in the second.\r\n * @param customAttributeContainerA The first CustomAttribute container that is missing the CustomAttribute instance.\r\n * @param customAttribute The CustomAttribute missing.\r\n */\r\n public async reportCustomAttributeInstanceClassMissing(customAttributeContainerA: CustomAttributeContainerProps, customAttribute: CustomAttribute, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.CustomAttributeInstanceClassMissing(customAttributeContainerA, [customAttribute]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between Enumeration properties.\r\n * @param enumerationA The first Enumeration supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first Enumeration.\r\n * @param valueB The value from the second Enumeration.\r\n */\r\n public async reportEnumerationDelta(enumerationA: Enumeration, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.EnumerationDelta(enumerationA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports that a enumerator found in the first Enumeration could not be found in the second.\r\n * @param enumerationA The first Enumeration that is missing the enumerator.\r\n * @param enumerator The enumerator missing from the second schema.\r\n */\r\n public async reportEnumeratorMissing(enumerationA: Enumeration, enumerator: AnyEnumerator, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.EnumeratorMissing(enumerationA, [enumerator]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between enumerator properties within a given Enumeration.\r\n * @param enumerationA The first Enumeration supplied for comparison.\r\n * @param enumerator The enumerator containing differing property values.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first enumerator.\r\n * @param valueB The value from the second enumerator.\r\n */\r\n public async reportEnumeratorDelta(enumerationA: Enumeration, enumerator: AnyEnumerator, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.EnumeratorDelta(enumerationA, [enumerator, propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between KindOfQuantity properties.\r\n * @param koqA The first KindOfQuantity supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first KindOfQuantity.\r\n * @param valueB The value from the second KindOfQuantity.\r\n */\r\n public async reportKoqDelta(koqA: KindOfQuantity, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.KoqDelta(koqA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports that a presentation unit found in the first KindOfQuantity could not be found in the second.\r\n * @param koqA The first KindOfQuantity that is missing the presentation unit.\r\n * @param unit The Format or OverrideFormat presentation unit missing from the second schema.\r\n */\r\n public async reportPresentationUnitMissing(koqA: KindOfQuantity, unit: Format | OverrideFormat, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.PresentationUnitMissing(koqA, [unit]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between PropertyCategory properties.\r\n * @param categoryA The first PropertyCategory supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first PropertyCategory.\r\n * @param valueB The value from the second PropertyCategory.\r\n */\r\n public async reportPropertyCategoryDelta(categoryA: PropertyCategory, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.PropertyCategoryDelta(categoryA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between Format properties.\r\n * @param formatA The first Format supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first Format.\r\n * @param valueB The value from the second Format.\r\n */\r\n public async reportFormatDelta(formatA: Format, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.FormatDelta(formatA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports that a unit found in the first Format could not be found in the second.\r\n * @param formatA The first Format that is missing the unit.\r\n * @param unit The Unit or InvertedUnit missing from the second schema.\r\n */\r\n public async reportFormatUnitMissing(formatA: Format, unit: Unit | InvertedUnit, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.FormatUnitMissing(formatA, [unit]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between overridden labels within the Units of a given Format.\r\n * @param formatA The first Format supplied for comparison.\r\n * @param unit The Unit or InvertedUnit with differing label overrides.\r\n * @param labelA The value from the first label.\r\n * @param labelB The value from the second label.\r\n */\r\n public async reportUnitLabelOverrideDelta(formatA: Format, unit: Unit | InvertedUnit, labelA: string | undefined, labelB: string | undefined, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.UnitLabelOverrideDelta(formatA, [unit, labelA, labelB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between Unit properties.\r\n * @param unitA The first Unit supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first Unit.\r\n * @param valueB The value from the second Unit.\r\n */\r\n public async reportUnitDelta(unitA: Unit, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.UnitDelta(unitA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between InvertedUnit properties.\r\n * @param invertedUnitA The first InvertedUnit supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first InvertedUnit.\r\n * @param valueB The value from the second InvertedUnit.\r\n */\r\n public async reportInvertedUnitDelta(invertedUnitA: InvertedUnit, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.InvertedUnitDelta(invertedUnitA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between Phenomenon properties.\r\n * @param phenomenonA The first Phenomenon supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first Phenomenon.\r\n * @param valueB The value from the second Phenomenon.\r\n */\r\n public async reportPhenomenonDelta(phenomenonA: Phenomenon, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.PhenomenonDelta(phenomenonA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n /**\r\n * Reports differences between Constant properties.\r\n * @param constantA The first Constant supplied for comparison.\r\n * @param propertyName The name of the property.\r\n * @param valueA The value from the first Constant.\r\n * @param valueB The value from the second Constant.\r\n */\r\n public async reportConstantDelta(constantA: Constant, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\r\n const diag = new SchemaCompareDiagnostics.ConstantDelta(constantA, [propertyName, valueA, valueB]);\r\n await this.reportDiagnostic(diag);\r\n }\r\n\r\n private async reportDiagnostic(diagnostic: AnyDiagnostic): Promise<void> {\r\n if (this._schemaAChanges.schema === diagnostic.schema) {\r\n this._schemaAChanges.addDiagnostic(diagnostic);\r\n return;\r\n }\r\n if (this._schemaBChanges.schema === diagnostic.schema) {\r\n this._schemaBChanges.addDiagnostic(diagnostic);\r\n return;\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"SchemaCompareResultDelegate.js","sourceRoot":"","sources":["../../../src/Validation/SchemaCompareResultDelegate.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAQH,mDAAgD;AAChD,yEAAsE;AAItE;;;GAGG;AACH,MAAa,2BAA2B;IAC9B,sBAAsB,CAA2B;IACjD,eAAe,CAAgB;IAC/B,eAAe,CAAgB;IAEvC;;;OAGG;IACH,YAAY,OAAe,EAAE,OAAe,EAAE,GAAG,SAAmC;QAClF,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC;QACxC,IAAI,CAAC,eAAe,GAAG,IAAI,6BAAa,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI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MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,UAAyB;QACtD,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,EAAE,CAAC;YACtD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC/C,OAAO;QACT,CAAC;QACD,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,EAAE,CAAC;YACtD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC/C,OAAO;QACT,CAAC;IACH,CAAC;CACF;AA5WD,kEA4WC","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 Comparison\n */\n\nimport { AnyClass, AnyEnumerator, AnyProperty, Constant, CustomAttribute,\n CustomAttributeClass, CustomAttributeContainerProps, EntityClass, Enumeration, Format, InvertedUnit, KindOfQuantity,\n Mixin, OverrideFormat, Phenomenon, PropertyCategory, RelationshipClass, RelationshipConstraint,\n Schema, SchemaItem, Unit,\n} from \"@itwin/ecschema-metadata\";\nimport { AnyDiagnostic } from \"./Diagnostic\";\nimport { SchemaChanges } from \"./SchemaChanges\";\nimport { SchemaCompareDiagnostics } from \"./SchemaCompareDiagnostics\";\nimport { SchemaCompareDirection } from \"./SchemaComparer\";\nimport { ISchemaCompareReporter } from \"./SchemaCompareReporter\";\n\n/**\n * Used by the [[SchemaComparer]] to report differences found during schema comparison.\n * @internal\n */\nexport class SchemaCompareResultDelegate {\n private _schemaChangeReporters: ISchemaCompareReporter[];\n private _schemaAChanges: SchemaChanges;\n private _schemaBChanges: SchemaChanges;\n\n /**\n * Initializes a new SchemaCompareResultDelegate instance.\n * @param reporters The [[ISchemaCompareReporter]] objects to use to report schema differences.\n */\n constructor(schemaA: Schema, schemaB: Schema, ...reporters: ISchemaCompareReporter[]) {\n this._schemaChangeReporters = reporters;\n this._schemaAChanges = new SchemaChanges(schemaA);\n this._schemaBChanges = new SchemaChanges(schemaB);\n }\n\n public get schemaChangeReporters(): ISchemaCompareReporter[] {\n return this._schemaChangeReporters;\n }\n\n /**\n * Called by the SchemaComparer when the comparison is complete.\n */\n public compareComplete() {\n this.schemaChangeReporters.forEach((r) => r.report(this._schemaAChanges));\n if (this._schemaBChanges)\n this.schemaChangeReporters.forEach((r) => r.report(this._schemaBChanges));\n }\n\n /**\n * Reports differences between Schema properties.\n * @param schemaA The first Schema supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first Schema.\n * @param valueB The value from the second Schema.\n */\n public async reportSchemaDelta(schemaA: Schema, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.SchemaDelta(schemaA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences in the schema reference collection of two schemas.\n * @param schemaA The first Schema supplied for comparison.\n * @param referenceSchema The missing schema reference.\n */\n public async reportSchemaReferenceMissing(schemaA: Schema, referenceSchema: Schema, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.SchemaReferenceMissing(schemaA, [referenceSchema]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences in the schema reference collection of two schemas where the reference version differs.\n * @param schemaA The first Schema supplied for comparison.\n * @param referenceSchema The missing schema reference.\n */\n public async reportSchemaReferenceDelta(schemaA: Schema, referenceSchema: Schema, versionA: string, versionB: string, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.SchemaReferenceDelta(schemaA, [referenceSchema, versionA, versionB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports that a given SchemaItem could not be found in the second Schema.\n * @param schemaItemA The SchemaItem from the first Schema.\n */\n public async reportSchemaItemMissing(schemaItemA: SchemaItem, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.SchemaItemMissing(schemaItemA, []);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between SchemaItem properties.\n * @param schemaItemA The first SchemaItem supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first SchemaItem.\n * @param valueB The value from the second SchemaItem.\n */\n public async reportSchemaItemDelta(schemaItemA: SchemaItem, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.SchemaItemDelta(schemaItemA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between ECClass properties.\n * @param classA The first ECClass supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first ECClass.\n * @param valueB The value from the second ECClass.\n */\n public async reportClassDelta(classA: AnyClass, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.ClassDelta(classA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences of the base class defined between two ECClass objects.\n * @param classA The first ECClass supplied for comparison.\n * @param baseClassA The base class of the first ECClass.\n * @param baseClassB The base class of the second ECClass.\n */\n public async reportBaseClassDelta(classA: AnyClass, baseClassA: AnyClass | undefined, baseClassB: AnyClass | undefined, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.BaseClassDelta(classA, [baseClassA, baseClassB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between ECProperty properties.\n * @param propertyA The first ECProperty supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first ECProperty.\n * @param valueB The value from the second ECProperty.\n */\n public async reportPropertyDelta(propertyA: AnyProperty, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.PropertyDelta(propertyA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports that an ECProperty found in the first ECClass could not be found in the second.\n * @param propertyA The ECProperty supplied for comparison.\n */\n public async reportPropertyMissing(propertyA: AnyProperty, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.PropertyMissing(propertyA, []);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports that a Mixin found in the first EntityClass could not be found in the second.\n * @param entityClassA The first EntityClass that is missing the Mixin.\n * @param mixinA The Mixin from the first EntityClass.\n */\n public async reportEntityMixinMissing(entityClassA: EntityClass, mixinA: Mixin, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.EntityMixinMissing(entityClassA, [mixinA]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between Mixin properties.\n * @param mixinA The first Mixin supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first Mixin.\n * @param valueB The value from the second Mixin.\n */\n public async reportMixinDelta(mixinA: Mixin, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.MixinDelta(mixinA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between RelationshipClass properties.\n * @param relationshipClassA The first RelationshipClass supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first RelationshipClass.\n * @param valueB The value from the second RelationshipClass.\n */\n public async reportRelationshipClassDelta(relationshipClassA: RelationshipClass, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.RelationshipDelta(relationshipClassA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between RelationshipConstraint properties.\n * @param constraintA The first RelationshipConstraint supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first RelationshipConstraint.\n * @param valueB The value from the second RelationshipConstraint.\n */\n public async reportRelationshipConstraintDelta(constraintA: RelationshipConstraint, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.RelationshipConstraintDelta(constraintA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports that a constraint class found in the first RelationshipConstraint could not be found in the second.\n * @param constraintA The first RelationshipConstraint that is missing the class constraint.\n * @param constraintClass The constraint ECClass from the first RelationshipConstraint.\n */\n public async reportRelationshipConstraintClassMissing(constraintA: RelationshipConstraint, constraintClass: EntityClass | Mixin | RelationshipClass, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.RelationshipConstraintClassMissing(constraintA, [constraintClass]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between CustomAttributeClass properties.\n * @param customAttributeA The first CustomAttributeClass supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first CustomAttributeClass.\n * @param valueB The value from the second CustomAttributeClass.\n */\n public async reportCustomAttributeClassDelta(customAttributeA: CustomAttributeClass, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.CustomAttributeClassDelta(customAttributeA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports that a CustomAttribute instance found in the first CustomAttribute container could not be found in the second.\n * @param customAttributeContainerA The first CustomAttribute container that is missing the CustomAttribute instance.\n * @param customAttribute The CustomAttribute missing.\n */\n public async reportCustomAttributeInstanceClassMissing(customAttributeContainerA: CustomAttributeContainerProps, customAttribute: CustomAttribute, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.CustomAttributeInstanceClassMissing(customAttributeContainerA, [customAttribute]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between Enumeration properties.\n * @param enumerationA The first Enumeration supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first Enumeration.\n * @param valueB The value from the second Enumeration.\n */\n public async reportEnumerationDelta(enumerationA: Enumeration, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.EnumerationDelta(enumerationA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports that a enumerator found in the first Enumeration could not be found in the second.\n * @param enumerationA The first Enumeration that is missing the enumerator.\n * @param enumerator The enumerator missing from the second schema.\n */\n public async reportEnumeratorMissing(enumerationA: Enumeration, enumerator: AnyEnumerator, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.EnumeratorMissing(enumerationA, [enumerator]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between enumerator properties within a given Enumeration.\n * @param enumerationA The first Enumeration supplied for comparison.\n * @param enumerator The enumerator containing differing property values.\n * @param propertyName The name of the property.\n * @param valueA The value from the first enumerator.\n * @param valueB The value from the second enumerator.\n */\n public async reportEnumeratorDelta(enumerationA: Enumeration, enumerator: AnyEnumerator, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.EnumeratorDelta(enumerationA, [enumerator, propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between KindOfQuantity properties.\n * @param koqA The first KindOfQuantity supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first KindOfQuantity.\n * @param valueB The value from the second KindOfQuantity.\n */\n public async reportKoqDelta(koqA: KindOfQuantity, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.KoqDelta(koqA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports that a presentation unit found in the first KindOfQuantity could not be found in the second.\n * @param koqA The first KindOfQuantity that is missing the presentation unit.\n * @param unit The Format or OverrideFormat presentation unit missing from the second schema.\n */\n public async reportPresentationUnitMissing(koqA: KindOfQuantity, unit: Format | OverrideFormat, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.PresentationUnitMissing(koqA, [unit]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between PropertyCategory properties.\n * @param categoryA The first PropertyCategory supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first PropertyCategory.\n * @param valueB The value from the second PropertyCategory.\n */\n public async reportPropertyCategoryDelta(categoryA: PropertyCategory, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.PropertyCategoryDelta(categoryA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between Format properties.\n * @param formatA The first Format supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first Format.\n * @param valueB The value from the second Format.\n */\n public async reportFormatDelta(formatA: Format, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.FormatDelta(formatA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports that a unit found in the first Format could not be found in the second.\n * @param formatA The first Format that is missing the unit.\n * @param unit The Unit or InvertedUnit missing from the second schema.\n */\n public async reportFormatUnitMissing(formatA: Format, unit: [Unit | InvertedUnit, string | undefined], _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.FormatUnitMissing(formatA, unit);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between overridden labels within the Units of a given Format.\n * @param formatA The first Format supplied for comparison.\n * @param unit The Unit or InvertedUnit with differing label overrides.\n * @param labelA The value from the first label.\n * @param labelB The value from the second label.\n */\n public async reportUnitLabelOverrideDelta(formatA: Format, unit: Unit | InvertedUnit, labelA: string | undefined, labelB: string | undefined, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.UnitLabelOverrideDelta(formatA, [unit, labelA, labelB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between Unit properties.\n * @param unitA The first Unit supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first Unit.\n * @param valueB The value from the second Unit.\n */\n public async reportUnitDelta(unitA: Unit, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.UnitDelta(unitA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between InvertedUnit properties.\n * @param invertedUnitA The first InvertedUnit supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first InvertedUnit.\n * @param valueB The value from the second InvertedUnit.\n */\n public async reportInvertedUnitDelta(invertedUnitA: InvertedUnit, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.InvertedUnitDelta(invertedUnitA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between Phenomenon properties.\n * @param phenomenonA The first Phenomenon supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first Phenomenon.\n * @param valueB The value from the second Phenomenon.\n */\n public async reportPhenomenonDelta(phenomenonA: Phenomenon, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.PhenomenonDelta(phenomenonA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n /**\n * Reports differences between Constant properties.\n * @param constantA The first Constant supplied for comparison.\n * @param propertyName The name of the property.\n * @param valueA The value from the first Constant.\n * @param valueB The value from the second Constant.\n */\n public async reportConstantDelta(constantA: Constant, propertyName: string, valueA: any, valueB: any, _compareDirection: SchemaCompareDirection): Promise<void> {\n const diag = new SchemaCompareDiagnostics.ConstantDelta(constantA, [propertyName, valueA, valueB]);\n await this.reportDiagnostic(diag);\n }\n\n private async reportDiagnostic(diagnostic: AnyDiagnostic): Promise<void> {\n if (this._schemaAChanges.schema === diagnostic.schema) {\n this._schemaAChanges.addDiagnostic(diagnostic);\n return;\n }\n if (this._schemaBChanges.schema === diagnostic.schema) {\n this._schemaBChanges.addDiagnostic(diagnostic);\n return;\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaCompareVisitor.d.ts","sourceRoot":"","sources":["../../../src/Validation/SchemaCompareVisitor.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,oBAAoB,EAAE,6BAA6B,EAClF,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,KAAK,EAClG,UAAU,EAAY,gBAAgB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,EAAE,UAAU,EACrF,WAAW,EAAE,IAAI,EAAE,UAAU,EAC9C,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,kBAAkB;IAC7D,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,eAAe,CAAkB;IAEzC;;;;OAIG;gBACS,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM;IAKpE;;;OAGG;IACU,eAAe,CAAC,OAAO,EAAE,MAAM;IAI5C;;;OAGG;IACU,eAAe,CAAC,WAAW,EAAE,UAAU;IAKpD;;;OAGG;IACU,UAAU,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxD;;;OAGG;IACU,aAAa,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAAC,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B,CAAC,aAAa,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAM1E;;;OAGG;IACU,eAAe,CAAC,YAAY,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrE;;;OAGG;IACU,eAAe,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAMpE;;;OAGG;IACU,aAAa,CAAC,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAK/D"}
|
|
@@ -14,6 +14,8 @@ const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
16
|
class SchemaCompareVisitor {
|
|
17
|
+
_schemaB;
|
|
18
|
+
_schemaComparer;
|
|
17
19
|
/**
|
|
18
20
|
* Initializes a new SchemaCompareVisitor instance.
|
|
19
21
|
* @param schemaComparer The [[SchemaComparer]] to use to compare each item of the schema.
|
|
@@ -35,7 +37,7 @@ class SchemaCompareVisitor {
|
|
|
35
37
|
* @param schemaItem a SchemaItem object.
|
|
36
38
|
*/
|
|
37
39
|
async visitSchemaItem(schemaItemA) {
|
|
38
|
-
const schemaItemB = await this.
|
|
40
|
+
const schemaItemB = await this._schemaComparer.resolveItem(schemaItemA, this._schemaB, ecschema_metadata_1.SchemaItem);
|
|
39
41
|
this._schemaComparer.compareSchemaItems(schemaItemA, schemaItemB);
|
|
40
42
|
}
|
|
41
43
|
/**
|
|
@@ -43,7 +45,7 @@ class SchemaCompareVisitor {
|
|
|
43
45
|
* @param ecClass an ECClass object.
|
|
44
46
|
*/
|
|
45
47
|
async visitClass(classA) {
|
|
46
|
-
const classB = await this.
|
|
48
|
+
const classB = await this._schemaComparer.resolveItem(classA, this._schemaB, ecschema_metadata_1.ECClass);
|
|
47
49
|
if (classB && classA.schemaItemType === classB.schemaItemType)
|
|
48
50
|
this._schemaComparer.compareClasses(classA, classB);
|
|
49
51
|
}
|
|
@@ -53,9 +55,9 @@ class SchemaCompareVisitor {
|
|
|
53
55
|
*/
|
|
54
56
|
async visitProperty(propertyA) {
|
|
55
57
|
let propertyB;
|
|
56
|
-
const classB = await this.
|
|
58
|
+
const classB = await this._schemaComparer.resolveItem(propertyA.class, this._schemaB, ecschema_metadata_1.ECClass);
|
|
57
59
|
if (classB && propertyA.class.schemaItemType === classB.schemaItemType) {
|
|
58
|
-
propertyB = await
|
|
60
|
+
propertyB = await this._schemaComparer.resolveProperty(propertyA, classB);
|
|
59
61
|
this._schemaComparer.compareProperties(propertyA, propertyB);
|
|
60
62
|
}
|
|
61
63
|
}
|
|
@@ -64,7 +66,7 @@ class SchemaCompareVisitor {
|
|
|
64
66
|
* @param entityClass an EntityClass object.
|
|
65
67
|
*/
|
|
66
68
|
async visitEntityClass(entityA) {
|
|
67
|
-
const entityB = await this.
|
|
69
|
+
const entityB = await this._schemaComparer.resolveItem(entityA, this._schemaB, ecschema_metadata_1.EntityClass);
|
|
68
70
|
if (entityB && entityB.schemaItemType === ecschema_metadata_1.SchemaItemType.EntityClass)
|
|
69
71
|
this._schemaComparer.compareEntityClasses(entityA, entityB);
|
|
70
72
|
}
|
|
@@ -80,7 +82,7 @@ class SchemaCompareVisitor {
|
|
|
80
82
|
* @param mixin a Mixin object.
|
|
81
83
|
*/
|
|
82
84
|
async visitMixin(mixinA) {
|
|
83
|
-
const mixinB = await this.
|
|
85
|
+
const mixinB = await this._schemaComparer.resolveItem(mixinA, this._schemaB, ecschema_metadata_1.Mixin);
|
|
84
86
|
if (mixinB && mixinB.schemaItemType === ecschema_metadata_1.SchemaItemType.Mixin)
|
|
85
87
|
this._schemaComparer.compareMixins(mixinA, mixinB);
|
|
86
88
|
}
|
|
@@ -89,7 +91,7 @@ class SchemaCompareVisitor {
|
|
|
89
91
|
* @param relationshipClass a RelationshipClass object.
|
|
90
92
|
*/
|
|
91
93
|
async visitRelationshipClass(relationshipA) {
|
|
92
|
-
const relationshipB = await this.
|
|
94
|
+
const relationshipB = await this._schemaComparer.resolveItem(relationshipA, this._schemaB, ecschema_metadata_1.RelationshipClass);
|
|
93
95
|
if (relationshipB && relationshipB.schemaItemType === ecschema_metadata_1.SchemaItemType.RelationshipClass)
|
|
94
96
|
this._schemaComparer.compareRelationshipClasses(relationshipA, relationshipB);
|
|
95
97
|
}
|
|
@@ -99,7 +101,7 @@ class SchemaCompareVisitor {
|
|
|
99
101
|
*/
|
|
100
102
|
async visitRelationshipConstraint(constraintA) {
|
|
101
103
|
let constraintB;
|
|
102
|
-
const relationshipB = await this.
|
|
104
|
+
const relationshipB = await this._schemaComparer.resolveItem(constraintA.relationshipClass, this._schemaB, ecschema_metadata_1.RelationshipClass);
|
|
103
105
|
if (relationshipB && relationshipB.schemaItemType === ecschema_metadata_1.SchemaItemType.RelationshipClass) {
|
|
104
106
|
constraintB = constraintA.isSource ? relationshipB.source : relationshipB.target;
|
|
105
107
|
if (constraintB) {
|
|
@@ -112,7 +114,7 @@ class SchemaCompareVisitor {
|
|
|
112
114
|
* @param customAttributeClass a CustomAttributeClass object.
|
|
113
115
|
*/
|
|
114
116
|
async visitCustomAttributeClass(customAttributeA) {
|
|
115
|
-
const customAttributeB = await this.
|
|
117
|
+
const customAttributeB = await this._schemaComparer.resolveItem(customAttributeA, this._schemaB, ecschema_metadata_1.CustomAttributeClass);
|
|
116
118
|
if (customAttributeB && customAttributeB.schemaItemType === ecschema_metadata_1.SchemaItemType.CustomAttributeClass)
|
|
117
119
|
this._schemaComparer.compareCustomAttributeClasses(customAttributeA, customAttributeB);
|
|
118
120
|
}
|
|
@@ -121,22 +123,20 @@ class SchemaCompareVisitor {
|
|
|
121
123
|
* @param customAttributeContainer a [[CustomAttributeContainerProps]] object.
|
|
122
124
|
*/
|
|
123
125
|
async visitCustomAttributeContainer(containerA) {
|
|
124
|
-
const nameParts = containerA.fullName.split(".");
|
|
125
|
-
const shortName = nameParts.length === 1 ? nameParts[0] : nameParts[1];
|
|
126
126
|
let containerB;
|
|
127
127
|
if (ecschema_metadata_1.Schema.isSchema(containerA)) {
|
|
128
128
|
containerB = this._schemaB;
|
|
129
129
|
}
|
|
130
130
|
else if (ecschema_metadata_1.ECClass.isECClass(containerA)) {
|
|
131
|
-
const parent = await this.
|
|
131
|
+
const parent = await this._schemaComparer.resolveItem(containerA, this._schemaB, ecschema_metadata_1.ECClass);
|
|
132
132
|
containerB = parent && parent.schemaItemType === containerA.schemaItemType ? parent : undefined;
|
|
133
133
|
}
|
|
134
134
|
else if (ecschema_metadata_1.Property.isProperty(containerA)) {
|
|
135
|
-
const parent = await this.
|
|
136
|
-
containerB = parent && parent.schemaItemType === containerA.class.schemaItemType ? await
|
|
135
|
+
const parent = await this._schemaComparer.resolveItem(containerA.class, this._schemaB, ecschema_metadata_1.ECClass);
|
|
136
|
+
containerB = parent && parent.schemaItemType === containerA.class.schemaItemType ? await this._schemaComparer.resolveProperty(containerA, parent) : undefined;
|
|
137
137
|
}
|
|
138
138
|
else if (ecschema_metadata_1.RelationshipConstraint.isRelationshipConstraint(containerA)) {
|
|
139
|
-
const parent = await this.
|
|
139
|
+
const parent = await this._schemaComparer.resolveItem(containerA.relationshipClass, this._schemaB, ecschema_metadata_1.RelationshipClass);
|
|
140
140
|
containerB = parent ? containerA.isSource ? parent.source : parent.target : undefined;
|
|
141
141
|
}
|
|
142
142
|
if (containerB)
|
|
@@ -147,7 +147,7 @@ class SchemaCompareVisitor {
|
|
|
147
147
|
* @param enumeration an Enumeration object.
|
|
148
148
|
*/
|
|
149
149
|
async visitEnumeration(enumA) {
|
|
150
|
-
const enumB = await this.
|
|
150
|
+
const enumB = await this._schemaComparer.resolveItem(enumA, this._schemaB, ecschema_metadata_1.Enumeration);
|
|
151
151
|
if (enumB && enumB.schemaItemType === ecschema_metadata_1.SchemaItemType.Enumeration)
|
|
152
152
|
this._schemaComparer.compareEnumerations(enumA, enumB);
|
|
153
153
|
}
|
|
@@ -156,7 +156,7 @@ class SchemaCompareVisitor {
|
|
|
156
156
|
* @param koq a KindOfQuantity object.
|
|
157
157
|
*/
|
|
158
158
|
async visitKindOfQuantity(koqA) {
|
|
159
|
-
const koqB = await this.
|
|
159
|
+
const koqB = await this._schemaComparer.resolveItem(koqA, this._schemaB, ecschema_metadata_1.KindOfQuantity);
|
|
160
160
|
if (koqB && koqB.schemaItemType === ecschema_metadata_1.SchemaItemType.KindOfQuantity)
|
|
161
161
|
this._schemaComparer.compareKindOfQuantities(koqA, koqB);
|
|
162
162
|
}
|
|
@@ -165,7 +165,7 @@ class SchemaCompareVisitor {
|
|
|
165
165
|
* @param category a PropertyCategory object.
|
|
166
166
|
*/
|
|
167
167
|
async visitPropertyCategory(categoryA) {
|
|
168
|
-
const categoryB = await this.
|
|
168
|
+
const categoryB = await this._schemaComparer.resolveItem(categoryA, this._schemaB, ecschema_metadata_1.PropertyCategory);
|
|
169
169
|
if (categoryB && categoryB.schemaItemType === ecschema_metadata_1.SchemaItemType.PropertyCategory)
|
|
170
170
|
this._schemaComparer.comparePropertyCategories(categoryA, categoryB);
|
|
171
171
|
}
|
|
@@ -174,7 +174,7 @@ class SchemaCompareVisitor {
|
|
|
174
174
|
* @param format a Format object.
|
|
175
175
|
*/
|
|
176
176
|
async visitFormat(formatA) {
|
|
177
|
-
const formatB = await this.
|
|
177
|
+
const formatB = await this._schemaComparer.resolveItem(formatA, this._schemaB, ecschema_metadata_1.Format);
|
|
178
178
|
if (formatB && formatB.schemaItemType === ecschema_metadata_1.SchemaItemType.Format)
|
|
179
179
|
this._schemaComparer.compareFormats(formatA, formatB);
|
|
180
180
|
}
|
|
@@ -183,7 +183,7 @@ class SchemaCompareVisitor {
|
|
|
183
183
|
* @param unit a Unit object.
|
|
184
184
|
*/
|
|
185
185
|
async visitUnit(unitA) {
|
|
186
|
-
const unitB = await this.
|
|
186
|
+
const unitB = await this._schemaComparer.resolveItem(unitA, this._schemaB, ecschema_metadata_1.Unit);
|
|
187
187
|
if (unitB && ecschema_metadata_1.Unit.isUnit(unitB))
|
|
188
188
|
this._schemaComparer.compareUnits(unitA, unitB);
|
|
189
189
|
}
|
|
@@ -192,7 +192,7 @@ class SchemaCompareVisitor {
|
|
|
192
192
|
* @param invertedUnit an InvertedUnit object.
|
|
193
193
|
*/
|
|
194
194
|
async visitInvertedUnit(invertedUnitA) {
|
|
195
|
-
const invertedUnitB = await this.
|
|
195
|
+
const invertedUnitB = await this._schemaComparer.resolveItem(invertedUnitA, this._schemaB, ecschema_metadata_1.InvertedUnit);
|
|
196
196
|
if (invertedUnitB && invertedUnitB.schemaItemType === ecschema_metadata_1.SchemaItemType.InvertedUnit)
|
|
197
197
|
this._schemaComparer.compareInvertedUnits(invertedUnitA, invertedUnitB);
|
|
198
198
|
}
|
|
@@ -208,7 +208,7 @@ class SchemaCompareVisitor {
|
|
|
208
208
|
* @param phenomena a Phenomenon object.
|
|
209
209
|
*/
|
|
210
210
|
async visitPhenomenon(phenomenonA) {
|
|
211
|
-
const phenomenonB = await this.
|
|
211
|
+
const phenomenonB = await this._schemaComparer.resolveItem(phenomenonA, this._schemaB, ecschema_metadata_1.Phenomenon);
|
|
212
212
|
if (phenomenonB && phenomenonB.schemaItemType === ecschema_metadata_1.SchemaItemType.Phenomenon)
|
|
213
213
|
this._schemaComparer.comparePhenomenons(phenomenonA, phenomenonB);
|
|
214
214
|
}
|
|
@@ -217,7 +217,7 @@ class SchemaCompareVisitor {
|
|
|
217
217
|
* @param constant a Constant object.
|
|
218
218
|
*/
|
|
219
219
|
async visitConstant(constantA) {
|
|
220
|
-
const constantB = await this.
|
|
220
|
+
const constantB = await this._schemaComparer.resolveItem(constantA, this._schemaB, ecschema_metadata_1.Constant);
|
|
221
221
|
if (constantB && constantB.schemaItemType === ecschema_metadata_1.SchemaItemType.Constant)
|
|
222
222
|
this._schemaComparer.compareConstants(constantA, constantB);
|
|
223
223
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaCompareVisitor.js","sourceRoot":"","sources":["../../../src/Validation/SchemaCompareVisitor.ts"],"names":[],"mappings":";AAAA;;;+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K,CAAC;YAC7B,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,iBAAiB,CAAC,aAA2B;QACxD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAe,aAAa,CAAC,IAAI,CAAC,CAAC;QACvF,IAAI,aAAa,IAAI,aAAa,CAAC,cAAc,KAAK,kCAAc,CAAC,YAAY;YAC/E,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IAC5E,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,YAAwB;QACnD,mDAAmD;IACrD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,WAAuB;QAClD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAa,WAAW,CAAC,IAAI,CAAC,CAAC;QACjF,IAAI,WAAW,IAAI,WAAW,CAAC,cAAc,KAAK,kCAAc,CAAC,UAAU;YACzE,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,aAAa,CAAC,SAAmB;QAC5C,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAW,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3E,IAAI,SAAS,IAAI,SAAS,CAAC,cAAc,KAAK,kCAAc,CAAC,QAAQ;YACnE,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAChE,CAAC;CACF;AAvOD,oDAuOC","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 Comparison\r\n */\r\n\r\nimport { AnyClass, AnyProperty, Constant, CustomAttributeClass, CustomAttributeContainerProps,\r\n ECClass, EntityClass, Enumeration, Format, InvertedUnit, ISchemaPartVisitor, KindOfQuantity, Mixin,\r\n Phenomenon, Property, PropertyCategory, RelationshipClass, RelationshipConstraint, Schema, SchemaItem,\r\n SchemaItemType, StructClass, Unit, UnitSystem,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { ISchemaComparer } from \"./SchemaComparer\";\r\n\r\n/**\r\n * An ISchemaPartVisitor interface implementation that is used to compare to Schemas.\r\n * @internal\r\n */\r\nexport class SchemaCompareVisitor implements ISchemaPartVisitor {\r\n private _schemaB: Schema;\r\n private _schemaComparer: ISchemaComparer;\r\n\r\n /**\r\n * Initializes a new SchemaCompareVisitor instance.\r\n * @param schemaComparer The [[SchemaComparer]] to use to compare each item of the schema.\r\n * @param schemaToCompare The second or 'B' schema to compare against the schema being traversed (Schema A).\r\n */\r\n constructor(schemaComparer: ISchemaComparer, schemaToCompare: Schema) {\r\n this._schemaComparer = schemaComparer;\r\n this._schemaB = schemaToCompare;\r\n }\r\n\r\n /**\r\n * Called before schema traversal.\r\n * @param schema a Schema object.\r\n */\r\n public async visitFullSchema(schemaA: Schema) {\r\n this._schemaComparer.compareSchemaProps(schemaA, this._schemaB);\r\n }\r\n\r\n /**\r\n * Called for each [[SchemaItem]] instance found during schema traversal.\r\n * @param schemaItem a SchemaItem object.\r\n */\r\n public async visitSchemaItem(schemaItemA: SchemaItem) {\r\n const schemaItemB = await this._schemaB.lookupItem(schemaItemA.name);\r\n this._schemaComparer.compareSchemaItems(schemaItemA, schemaItemB);\r\n }\r\n\r\n /**\r\n * Called for each [[AnyClass]] instance found during schema traversal.\r\n * @param ecClass an ECClass object.\r\n */\r\n public async visitClass(classA: AnyClass): Promise<void> {\r\n const classB = await this._schemaB.lookupItem<AnyClass>(classA.name);\r\n if (classB && classA.schemaItemType === classB.schemaItemType)\r\n this._schemaComparer.compareClasses(classA, classB);\r\n }\r\n\r\n /**\r\n * Called for each [[AnyProperty]] instance of an ECClass.\r\n * @param property an AnyProperty object.\r\n */\r\n public async visitProperty(propertyA: AnyProperty): Promise<void> {\r\n let propertyB: AnyProperty | undefined;\r\n\r\n const classB = await this._schemaB.lookupItem<ECClass>(propertyA.class.name);\r\n if (classB && propertyA.class.schemaItemType === classB.schemaItemType){\r\n propertyB = await classB.getProperty(propertyA.name) as AnyProperty;\r\n this._schemaComparer.compareProperties(propertyA, propertyB);\r\n }\r\n }\r\n\r\n /**\r\n * Called for each [[EntityClass]] instance found during schema traversal.\r\n * @param entityClass an EntityClass object.\r\n */\r\n public async visitEntityClass(entityA: EntityClass): Promise<void> {\r\n const entityB = await this._schemaB.lookupItem<EntityClass>(entityA.name);\r\n if (entityB && entityB.schemaItemType === SchemaItemType.EntityClass)\r\n this._schemaComparer.compareEntityClasses(entityA, entityB);\r\n }\r\n\r\n /**\r\n * Called for each [[StructClass]] instance found during schema traversal.\r\n * @param structClass a StructClass object.\r\n */\r\n public async visitStructClass(_structA: StructClass): Promise<void> {\r\n // No comparison to make specifically on StructClasses\r\n }\r\n\r\n /**\r\n * Called for each [[Mixin]] instance found during schema traversal.\r\n * @param mixin a Mixin object.\r\n */\r\n public async visitMixin(mixinA: Mixin): Promise<void> {\r\n const mixinB = await this._schemaB.lookupItem<Mixin>(mixinA.name);\r\n if (mixinB && mixinB.schemaItemType === SchemaItemType.Mixin)\r\n this._schemaComparer.compareMixins(mixinA, mixinB);\r\n }\r\n\r\n /**\r\n * Called for each [[RelationshipClass]] instance found during schema traversal.\r\n * @param relationshipClass a RelationshipClass object.\r\n */\r\n public async visitRelationshipClass(relationshipA: RelationshipClass): Promise<void> {\r\n const relationshipB = await this._schemaB.lookupItem<RelationshipClass>(relationshipA.name);\r\n if (relationshipB && relationshipB.schemaItemType === SchemaItemType.RelationshipClass)\r\n this._schemaComparer.compareRelationshipClasses(relationshipA, relationshipB);\r\n }\r\n\r\n /**\r\n * Called for each [[RelationshipConstraint]] of each RelationshipClass found during schema traversal.\r\n * @param relationshipConstraint a RelationshipConstraint object.\r\n */\r\n public async visitRelationshipConstraint(constraintA: RelationshipConstraint): Promise<void> {\r\n let constraintB: RelationshipConstraint | undefined;\r\n const relationshipB = await this._schemaB.lookupItem<RelationshipClass>(constraintA.relationshipClass.name);\r\n if (relationshipB && relationshipB.schemaItemType === SchemaItemType.RelationshipClass) {\r\n constraintB = constraintA.isSource ? relationshipB.source : relationshipB.target;\r\n if (constraintB) {\r\n this._schemaComparer.compareRelationshipConstraints(constraintA, constraintB);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Called for each [[CustomAttributeClass]] instance found during schema traversal.\r\n * @param customAttributeClass a CustomAttributeClass object.\r\n */\r\n public async visitCustomAttributeClass(customAttributeA: CustomAttributeClass): Promise<void> {\r\n const customAttributeB = await this._schemaB.lookupItem<CustomAttributeClass>(customAttributeA.name);\r\n if (customAttributeB && customAttributeB.schemaItemType === SchemaItemType.CustomAttributeClass)\r\n this._schemaComparer.compareCustomAttributeClasses(customAttributeA, customAttributeB);\r\n }\r\n\r\n /**\r\n * Called for each [[CustomAttribute]] container in the schema.\r\n * @param customAttributeContainer a [[CustomAttributeContainerProps]] object.\r\n */\r\n public async visitCustomAttributeContainer(containerA: CustomAttributeContainerProps): Promise<void> {\r\n const nameParts = containerA.fullName.split(\".\");\r\n const shortName = nameParts.length === 1 ? nameParts[0] : nameParts[1];\r\n let containerB: CustomAttributeContainerProps | undefined;\r\n\r\n if (Schema.isSchema(containerA)) {\r\n containerB = this._schemaB;\r\n } else if (ECClass.isECClass(containerA)) {\r\n const parent = await this._schemaB.lookupItem<ECClass>(containerA.name);\r\n containerB = parent && parent.schemaItemType === containerA.schemaItemType ? parent : undefined;\r\n } else if (Property.isProperty(containerA)) {\r\n const parent = await this._schemaB.lookupItem<ECClass>(containerA.class.name);\r\n containerB = parent && parent.schemaItemType === containerA.class.schemaItemType ? await parent.getProperty(shortName) : undefined;\r\n } else if (RelationshipConstraint.isRelationshipConstraint(containerA)) {\r\n const parent = await this._schemaB.lookupItem<RelationshipClass>(containerA.relationshipClass.name);\r\n containerB = parent ? containerA.isSource ? parent.source : parent.target : undefined;\r\n }\r\n\r\n if (containerB)\r\n this._schemaComparer.compareCustomAttributeContainers(containerA, containerB);\r\n }\r\n\r\n /**\r\n * Called for each [[Enumeration]] instance found during schema traversal.\r\n * @param enumeration an Enumeration object.\r\n */\r\n public async visitEnumeration(enumA: Enumeration) {\r\n const enumB = await this._schemaB.lookupItem<Enumeration>(enumA.name);\r\n if (enumB && enumB.schemaItemType === SchemaItemType.Enumeration)\r\n this._schemaComparer.compareEnumerations(enumA, enumB);\r\n }\r\n\r\n /**\r\n * Called for each [[KindOfQuantity]] instance found during schema traversal.\r\n * @param koq a KindOfQuantity object.\r\n */\r\n public async visitKindOfQuantity(koqA: KindOfQuantity) {\r\n const koqB = await this._schemaB.lookupItem<KindOfQuantity>(koqA.name);\r\n if (koqB && koqB.schemaItemType === SchemaItemType.KindOfQuantity)\r\n this._schemaComparer.compareKindOfQuantities(koqA, koqB);\r\n }\r\n\r\n /**\r\n * Called for each [[PropertyCategory]] instance found during schema traversal.\r\n * @param category a PropertyCategory object.\r\n */\r\n public async visitPropertyCategory(categoryA: PropertyCategory) {\r\n const categoryB = await this._schemaB.lookupItem<PropertyCategory>(categoryA.name);\r\n if (categoryB && categoryB.schemaItemType === SchemaItemType.PropertyCategory)\r\n this._schemaComparer.comparePropertyCategories(categoryA, categoryB);\r\n }\r\n\r\n /**\r\n * Called for each [[Format]] instance found during schema traversal.\r\n * @param format a Format object.\r\n */\r\n public async visitFormat(formatA: Format): Promise<void> {\r\n const formatB = await this._schemaB.lookupItem<Format>(formatA.name);\r\n if (formatB && formatB.schemaItemType === SchemaItemType.Format)\r\n this._schemaComparer.compareFormats(formatA, formatB);\r\n }\r\n\r\n /**\r\n * Called for each [[Unit]] instance found during schema traversal.\r\n * @param unit a Unit object.\r\n */\r\n public async visitUnit(unitA: Unit): Promise<void> {\r\n const unitB = await this._schemaB.lookupItem<Unit>(unitA.name);\r\n if (unitB && Unit.isUnit(unitB))\r\n this._schemaComparer.compareUnits(unitA, unitB);\r\n }\r\n\r\n /**\r\n * Called for each [[InvertedUnit]] instance found during schema traversal.\r\n * @param invertedUnit an InvertedUnit object.\r\n */\r\n public async visitInvertedUnit(invertedUnitA: InvertedUnit): Promise<void> {\r\n const invertedUnitB = await this._schemaB.lookupItem<InvertedUnit>(invertedUnitA.name);\r\n if (invertedUnitB && invertedUnitB.schemaItemType === SchemaItemType.InvertedUnit)\r\n this._schemaComparer.compareInvertedUnits(invertedUnitA, invertedUnitB);\r\n }\r\n\r\n /**\r\n * Called for each [[UnitSystem]] instance found during schema traversal.\r\n * @param unitSystem a UnitSystem object.\r\n */\r\n public async visitUnitSystem(_unitSystemA: UnitSystem): Promise<void> {\r\n // No comparison to make specifically on unitSystem\r\n }\r\n\r\n /**\r\n * Called for each [[Phenomenon]] instance found during schema traversal.\r\n * @param phenomena a Phenomenon object.\r\n */\r\n public async visitPhenomenon(phenomenonA: Phenomenon): Promise<void> {\r\n const phenomenonB = await this._schemaB.lookupItem<Phenomenon>(phenomenonA.name);\r\n if (phenomenonB && phenomenonB.schemaItemType === SchemaItemType.Phenomenon)\r\n this._schemaComparer.comparePhenomenons(phenomenonA, phenomenonB);\r\n }\r\n\r\n /**\r\n * Called for each [[Constant]] instance found during schema traversal.\r\n * @param constant a Constant object.\r\n */\r\n public async visitConstant(constantA: Constant): Promise<void> {\r\n const constantB = await this._schemaB.lookupItem<Constant>(constantA.name);\r\n if (constantB && constantB.schemaItemType === SchemaItemType.Constant)\r\n this._schemaComparer.compareConstants(constantA, constantB);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"SchemaCompareVisitor.js","sourceRoot":"","sources":["../../../src/Validation/SchemaCompareVisitor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;A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F,IAAI,SAAS,IAAI,SAAS,CAAC,cAAc,KAAK,kCAAc,CAAC,QAAQ;YACnE,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAChE,CAAC;CACF;AArOD,oDAqOC","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 Comparison\n */\n\nimport { AnyClass, AnyProperty, Constant, CustomAttributeClass, CustomAttributeContainerProps,\n ECClass, EntityClass, Enumeration, Format, InvertedUnit, ISchemaPartVisitor, KindOfQuantity, Mixin,\n Phenomenon, Property, PropertyCategory, RelationshipClass, RelationshipConstraint, Schema, SchemaItem,\n SchemaItemType, StructClass, Unit, UnitSystem,\n} from \"@itwin/ecschema-metadata\";\nimport { ISchemaComparer } from \"./SchemaComparer\";\n\n/**\n * An ISchemaPartVisitor interface implementation that is used to compare to Schemas.\n * @internal\n */\nexport class SchemaCompareVisitor implements ISchemaPartVisitor {\n private _schemaB: Schema;\n private _schemaComparer: ISchemaComparer;\n\n /**\n * Initializes a new SchemaCompareVisitor instance.\n * @param schemaComparer The [[SchemaComparer]] to use to compare each item of the schema.\n * @param schemaToCompare The second or 'B' schema to compare against the schema being traversed (Schema A).\n */\n constructor(schemaComparer: ISchemaComparer, schemaToCompare: Schema) {\n this._schemaComparer = schemaComparer;\n this._schemaB = schemaToCompare;\n }\n\n /**\n * Called before schema traversal.\n * @param schema a Schema object.\n */\n public async visitFullSchema(schemaA: Schema) {\n this._schemaComparer.compareSchemaProps(schemaA, this._schemaB);\n }\n\n /**\n * Called for each [[SchemaItem]] instance found during schema traversal.\n * @param schemaItem a SchemaItem object.\n */\n public async visitSchemaItem(schemaItemA: SchemaItem) {\n const schemaItemB = await this._schemaComparer.resolveItem(schemaItemA, this._schemaB, SchemaItem);\n this._schemaComparer.compareSchemaItems(schemaItemA, schemaItemB);\n }\n\n /**\n * Called for each [[AnyClass]] instance found during schema traversal.\n * @param ecClass an ECClass object.\n */\n public async visitClass(classA: AnyClass): Promise<void> {\n const classB = await this._schemaComparer.resolveItem(classA, this._schemaB, ECClass);\n if (classB && classA.schemaItemType === classB.schemaItemType)\n this._schemaComparer.compareClasses(classA, classB);\n }\n\n /**\n * Called for each [[AnyProperty]] instance of an ECClass.\n * @param property an AnyProperty object.\n */\n public async visitProperty(propertyA: AnyProperty): Promise<void> {\n let propertyB: AnyProperty | undefined;\n\n const classB = await this._schemaComparer.resolveItem(propertyA.class, this._schemaB, ECClass);\n if (classB && propertyA.class.schemaItemType === classB.schemaItemType){\n propertyB = await this._schemaComparer.resolveProperty(propertyA, classB);\n this._schemaComparer.compareProperties(propertyA, propertyB);\n }\n }\n\n /**\n * Called for each [[EntityClass]] instance found during schema traversal.\n * @param entityClass an EntityClass object.\n */\n public async visitEntityClass(entityA: EntityClass): Promise<void> {\n const entityB = await this._schemaComparer.resolveItem(entityA, this._schemaB, EntityClass);\n if (entityB && entityB.schemaItemType === SchemaItemType.EntityClass)\n this._schemaComparer.compareEntityClasses(entityA, entityB);\n }\n\n /**\n * Called for each [[StructClass]] instance found during schema traversal.\n * @param structClass a StructClass object.\n */\n public async visitStructClass(_structA: StructClass): Promise<void> {\n // No comparison to make specifically on StructClasses\n }\n\n /**\n * Called for each [[Mixin]] instance found during schema traversal.\n * @param mixin a Mixin object.\n */\n public async visitMixin(mixinA: Mixin): Promise<void> {\n const mixinB = await this._schemaComparer.resolveItem(mixinA, this._schemaB, Mixin);\n if (mixinB && mixinB.schemaItemType === SchemaItemType.Mixin)\n this._schemaComparer.compareMixins(mixinA, mixinB);\n }\n\n /**\n * Called for each [[RelationshipClass]] instance found during schema traversal.\n * @param relationshipClass a RelationshipClass object.\n */\n public async visitRelationshipClass(relationshipA: RelationshipClass): Promise<void> {\n const relationshipB = await this._schemaComparer.resolveItem(relationshipA, this._schemaB, RelationshipClass);\n if (relationshipB && relationshipB.schemaItemType === SchemaItemType.RelationshipClass)\n this._schemaComparer.compareRelationshipClasses(relationshipA, relationshipB);\n }\n\n /**\n * Called for each [[RelationshipConstraint]] of each RelationshipClass found during schema traversal.\n * @param relationshipConstraint a RelationshipConstraint object.\n */\n public async visitRelationshipConstraint(constraintA: RelationshipConstraint): Promise<void> {\n let constraintB: RelationshipConstraint | undefined;\n const relationshipB = await this._schemaComparer.resolveItem(constraintA.relationshipClass, this._schemaB, RelationshipClass);\n if (relationshipB && relationshipB.schemaItemType === SchemaItemType.RelationshipClass) {\n constraintB = constraintA.isSource ? relationshipB.source : relationshipB.target;\n if (constraintB) {\n this._schemaComparer.compareRelationshipConstraints(constraintA, constraintB);\n }\n }\n }\n\n /**\n * Called for each [[CustomAttributeClass]] instance found during schema traversal.\n * @param customAttributeClass a CustomAttributeClass object.\n */\n public async visitCustomAttributeClass(customAttributeA: CustomAttributeClass): Promise<void> {\n const customAttributeB = await this._schemaComparer.resolveItem(customAttributeA, this._schemaB, CustomAttributeClass);\n if (customAttributeB && customAttributeB.schemaItemType === SchemaItemType.CustomAttributeClass)\n this._schemaComparer.compareCustomAttributeClasses(customAttributeA, customAttributeB);\n }\n\n /**\n * Called for each [[CustomAttribute]] container in the schema.\n * @param customAttributeContainer a [[CustomAttributeContainerProps]] object.\n */\n public async visitCustomAttributeContainer(containerA: CustomAttributeContainerProps): Promise<void> {\n let containerB: CustomAttributeContainerProps | undefined;\n\n if (Schema.isSchema(containerA)) {\n containerB = this._schemaB;\n } else if (ECClass.isECClass(containerA)) {\n const parent = await this._schemaComparer.resolveItem(containerA, this._schemaB, ECClass);\n containerB = parent && parent.schemaItemType === containerA.schemaItemType ? parent : undefined;\n } else if (Property.isProperty(containerA)) {\n const parent = await this._schemaComparer.resolveItem(containerA.class, this._schemaB, ECClass);\n containerB = parent && parent.schemaItemType === containerA.class.schemaItemType ? await this._schemaComparer.resolveProperty(containerA, parent) : undefined;\n } else if (RelationshipConstraint.isRelationshipConstraint(containerA)) {\n const parent = await this._schemaComparer.resolveItem(containerA.relationshipClass, this._schemaB, RelationshipClass);\n containerB = parent ? containerA.isSource ? parent.source : parent.target : undefined;\n }\n\n if (containerB)\n this._schemaComparer.compareCustomAttributeContainers(containerA, containerB);\n }\n\n /**\n * Called for each [[Enumeration]] instance found during schema traversal.\n * @param enumeration an Enumeration object.\n */\n public async visitEnumeration(enumA: Enumeration) {\n const enumB = await this._schemaComparer.resolveItem(enumA, this._schemaB, Enumeration);\n if (enumB && enumB.schemaItemType === SchemaItemType.Enumeration)\n this._schemaComparer.compareEnumerations(enumA, enumB);\n }\n\n /**\n * Called for each [[KindOfQuantity]] instance found during schema traversal.\n * @param koq a KindOfQuantity object.\n */\n public async visitKindOfQuantity(koqA: KindOfQuantity) {\n const koqB = await this._schemaComparer.resolveItem(koqA, this._schemaB, KindOfQuantity);\n if (koqB && koqB.schemaItemType === SchemaItemType.KindOfQuantity)\n this._schemaComparer.compareKindOfQuantities(koqA, koqB);\n }\n\n /**\n * Called for each [[PropertyCategory]] instance found during schema traversal.\n * @param category a PropertyCategory object.\n */\n public async visitPropertyCategory(categoryA: PropertyCategory) {\n const categoryB = await this._schemaComparer.resolveItem(categoryA, this._schemaB, PropertyCategory);\n if (categoryB && categoryB.schemaItemType === SchemaItemType.PropertyCategory)\n this._schemaComparer.comparePropertyCategories(categoryA, categoryB);\n }\n\n /**\n * Called for each [[Format]] instance found during schema traversal.\n * @param format a Format object.\n */\n public async visitFormat(formatA: Format): Promise<void> {\n const formatB = await this._schemaComparer.resolveItem(formatA, this._schemaB, Format);\n if (formatB && formatB.schemaItemType === SchemaItemType.Format)\n this._schemaComparer.compareFormats(formatA, formatB);\n }\n\n /**\n * Called for each [[Unit]] instance found during schema traversal.\n * @param unit a Unit object.\n */\n public async visitUnit(unitA: Unit): Promise<void> {\n const unitB = await this._schemaComparer.resolveItem(unitA, this._schemaB, Unit);\n if (unitB && Unit.isUnit(unitB))\n this._schemaComparer.compareUnits(unitA, unitB);\n }\n\n /**\n * Called for each [[InvertedUnit]] instance found during schema traversal.\n * @param invertedUnit an InvertedUnit object.\n */\n public async visitInvertedUnit(invertedUnitA: InvertedUnit): Promise<void> {\n const invertedUnitB = await this._schemaComparer.resolveItem(invertedUnitA, this._schemaB, InvertedUnit);\n if (invertedUnitB && invertedUnitB.schemaItemType === SchemaItemType.InvertedUnit)\n this._schemaComparer.compareInvertedUnits(invertedUnitA, invertedUnitB);\n }\n\n /**\n * Called for each [[UnitSystem]] instance found during schema traversal.\n * @param unitSystem a UnitSystem object.\n */\n public async visitUnitSystem(_unitSystemA: UnitSystem): Promise<void> {\n // No comparison to make specifically on unitSystem\n }\n\n /**\n * Called for each [[Phenomenon]] instance found during schema traversal.\n * @param phenomena a Phenomenon object.\n */\n public async visitPhenomenon(phenomenonA: Phenomenon): Promise<void> {\n const phenomenonB = await this._schemaComparer.resolveItem(phenomenonA, this._schemaB, Phenomenon);\n if (phenomenonB && phenomenonB.schemaItemType === SchemaItemType.Phenomenon)\n this._schemaComparer.comparePhenomenons(phenomenonA, phenomenonB);\n }\n\n /**\n * Called for each [[Constant]] instance found during schema traversal.\n * @param constant a Constant object.\n */\n public async visitConstant(constantA: Constant): Promise<void> {\n const constantB = await this._schemaComparer.resolveItem(constantA, this._schemaB, Constant);\n if (constantB && constantB.schemaItemType === SchemaItemType.Constant)\n this._schemaComparer.compareConstants(constantA, constantB);\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Comparison
|
|
3
3
|
*/
|
|
4
|
-
import { AnyClass, AnyProperty, Constant, CustomAttributeClass, CustomAttributeContainerProps, EntityClass, Enumeration, Format, InvertedUnit, KindOfQuantity, Mixin, Phenomenon, PropertyCategory, RelationshipClass, RelationshipConstraint, Schema, SchemaItem, Unit } from "@itwin/ecschema-metadata";
|
|
4
|
+
import { AnyClass, AnyProperty, Constant, CustomAttributeClass, CustomAttributeContainerProps, ECClass, EntityClass, Enumeration, Format, InvertedUnit, KindOfQuantity, Mixin, Phenomenon, PropertyCategory, RelationshipClass, RelationshipConstraint, Schema, SchemaItem, SchemaItemKey, Unit } from "@itwin/ecschema-metadata";
|
|
5
5
|
import { ISchemaCompareReporter } from "./SchemaCompareReporter";
|
|
6
6
|
/**
|
|
7
7
|
* Enum that identifies if Schema A is being iterated (Forward) or
|
|
@@ -36,6 +36,12 @@ export interface ISchemaComparer {
|
|
|
36
36
|
compareInvertedUnits(invertedUnitA: InvertedUnit, invertedUnitB: InvertedUnit): void;
|
|
37
37
|
comparePhenomenons(phenomenonA: Phenomenon, phenomenonB: Phenomenon): void;
|
|
38
38
|
compareConstants(constantA: Constant, constantB: Constant): void;
|
|
39
|
+
/** @internal */
|
|
40
|
+
resolveItem<TItem extends typeof SchemaItem>(item: SchemaItem, lookupSchema: Schema, itemConstructor: TItem): Promise<InstanceType<TItem> | undefined>;
|
|
41
|
+
/** @internal */
|
|
42
|
+
resolveProperty(propertyA: AnyProperty, ecClass: ECClass): Promise<AnyProperty | undefined>;
|
|
43
|
+
/** @internal */
|
|
44
|
+
areEqualByName(itemKeyA?: Readonly<SchemaItemKey> | SchemaItem, itemKeyB?: Readonly<SchemaItemKey> | SchemaItem): boolean;
|
|
39
45
|
}
|
|
40
46
|
/**
|
|
41
47
|
* Compares EC Schemas and reports differences using the [[IDiagnosticReporter]] objects
|
|
@@ -51,6 +57,21 @@ export declare class SchemaComparer {
|
|
|
51
57
|
* @param reporters The [[IDiagnosticReporter]] object(s) to use to report the results.
|
|
52
58
|
*/
|
|
53
59
|
constructor(...reporters: ISchemaCompareReporter[]);
|
|
60
|
+
/**
|
|
61
|
+
* Resolves a schema Item from the given lookup schema.
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
resolveItem<TItem extends typeof SchemaItem>(item: SchemaItem, lookupSchema: Schema, itemConstructor: TItem): Promise<InstanceType<TItem> | undefined>;
|
|
65
|
+
/**
|
|
66
|
+
* Resolves a property from a class.
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
resolveProperty(propertyA: AnyProperty, ecClass: ECClass): Promise<AnyProperty | undefined>;
|
|
70
|
+
/**
|
|
71
|
+
* Compares two schema items to determine if they are the same by name.
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
areEqualByName(itemKeyA?: Readonly<SchemaItemKey> | SchemaItem, itemKeyB?: Readonly<SchemaItemKey> | SchemaItem): boolean;
|
|
54
75
|
/**
|
|
55
76
|
* Compares two schemas to identify differences.
|
|
56
77
|
* @param schemaA The first Schema.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaComparer.d.ts","sourceRoot":"","sources":["../../../src/Validation/SchemaComparer.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAAiB,WAAW,EAAyB,QAAQ,EAA0C,oBAAoB,EACnI,6BAA6B,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAkB,UAAU,
|
|
1
|
+
{"version":3,"file":"SchemaComparer.d.ts","sourceRoot":"","sources":["../../../src/Validation/SchemaComparer.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAAiB,WAAW,EAAyB,QAAQ,EAA0C,oBAAoB,EACnI,6BAA6B,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAkB,UAAU,EAClH,gBAAgB,EAAwB,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,EAChH,UAAU,EAAE,aAAa,EAA+C,IAAI,EAC7E,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAKjE;;;;GAIG;AACH,oBAAY,sBAAsB;IAChC,OAAO,IAAI;IACX,QAAQ,IAAI;CACb;AACD;;;GAGG;AACH,MAAM,WAAW,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;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAuB1B;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;CAuB1B"}
|
|
@@ -34,6 +34,9 @@ function labelsMatch(label1, label2) {
|
|
|
34
34
|
* @alpha
|
|
35
35
|
*/
|
|
36
36
|
class SchemaComparer {
|
|
37
|
+
_compareDirection;
|
|
38
|
+
_reporter;
|
|
39
|
+
_reporters;
|
|
37
40
|
/**
|
|
38
41
|
* Initializes a new SchemaComparer instance.
|
|
39
42
|
* @param reporters The [[IDiagnosticReporter]] object(s) to use to report the results.
|
|
@@ -42,6 +45,29 @@ class SchemaComparer {
|
|
|
42
45
|
this._compareDirection = SchemaCompareDirection.Forward;
|
|
43
46
|
this._reporters = reporters;
|
|
44
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Resolves a schema Item from the given lookup schema.
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
async resolveItem(item, lookupSchema, itemConstructor) {
|
|
53
|
+
return lookupSchema.lookupItem(item.name, itemConstructor);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Resolves a property from a class.
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
async resolveProperty(propertyA, ecClass) {
|
|
60
|
+
return ecClass.getProperty(propertyA.name);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Compares two schema items to determine if they are the same by name.
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
areEqualByName(itemKeyA, itemKeyB) {
|
|
67
|
+
const nameA = itemKeyA ? itemKeyA.name.toUpperCase() : undefined;
|
|
68
|
+
const nameB = itemKeyB ? itemKeyB.name.toUpperCase() : undefined;
|
|
69
|
+
return nameA === nameB;
|
|
70
|
+
}
|
|
45
71
|
/**
|
|
46
72
|
* Compares two schemas to identify differences.
|
|
47
73
|
* @param schemaA The first Schema.
|
|
@@ -644,7 +670,7 @@ class SchemaComparer {
|
|
|
644
670
|
for (const unitA of formatA.units) {
|
|
645
671
|
const unitB = formatB.units ? formatB.units.find((u) => this.areItemsSameByName(unitA[0], u[0], formatA.schema.name, formatB.schema.name)) : undefined;
|
|
646
672
|
if (!unitB) {
|
|
647
|
-
promises.push(this._reporter.reportFormatUnitMissing(formatA, unitA
|
|
673
|
+
promises.push(this._reporter.reportFormatUnitMissing(formatA, unitA, this._compareDirection));
|
|
648
674
|
continue;
|
|
649
675
|
}
|
|
650
676
|
if (this._compareDirection === SchemaCompareDirection.Backward)
|
|
@@ -652,7 +678,7 @@ class SchemaComparer {
|
|
|
652
678
|
if (unitA[1] !== unitB[1]) {
|
|
653
679
|
const labelA = unitA[1];
|
|
654
680
|
const labelB = unitB[1];
|
|
655
|
-
promises.push(this._reporter.reportUnitLabelOverrideDelta(formatA,
|
|
681
|
+
promises.push(this._reporter.reportUnitLabelOverrideDelta(formatA, unitA[0], labelA, labelB, this._compareDirection));
|
|
656
682
|
}
|
|
657
683
|
}
|
|
658
684
|
await Promise.all(promises);
|
|
@@ -679,8 +705,7 @@ class SchemaComparer {
|
|
|
679
705
|
* @returns true if both names are the same and they come from their respective top level schema.
|
|
680
706
|
*/
|
|
681
707
|
areItemsSameByName(itemKeyA, itemKeyB, topLevelSchemaNameA, topLevelSchemaNameB) {
|
|
682
|
-
const
|
|
683
|
-
const nameB = itemKeyB ? itemKeyB.name.toUpperCase() : undefined;
|
|
708
|
+
const equalByName = this.areEqualByName(itemKeyA, itemKeyB);
|
|
684
709
|
const schemaNameA = itemKeyA
|
|
685
710
|
? ecschema_metadata_1.SchemaItem.isSchemaItem(itemKeyA)
|
|
686
711
|
? itemKeyA.schema.name
|
|
@@ -691,7 +716,7 @@ class SchemaComparer {
|
|
|
691
716
|
? itemKeyB.schema.name
|
|
692
717
|
: itemKeyB.schemaName
|
|
693
718
|
: undefined;
|
|
694
|
-
return (
|
|
719
|
+
return (equalByName && schemaNameA === topLevelSchemaNameA && schemaNameB === topLevelSchemaNameB) || (equalByName && schemaNameA === schemaNameB);
|
|
695
720
|
}
|
|
696
721
|
/**
|
|
697
722
|
* Looks for same classA in containerB using key.
|