@itwin/ecschema-editing 4.8.0-dev.3 → 4.8.0-dev.31
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 +43 -1
- package/lib/cjs/Differencing/Errors.js.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +1 -0
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +23 -11
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.d.ts +10 -119
- package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.js +28 -198
- package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
- package/lib/cjs/Differencing/Utils.d.ts +100 -0
- package/lib/cjs/Differencing/Utils.d.ts.map +1 -0
- package/lib/cjs/Differencing/Utils.js +165 -0
- package/lib/cjs/Differencing/Utils.js.map +1 -0
- package/lib/cjs/Editing/Constants.js.map +1 -1
- package/lib/cjs/Editing/CustomAttributes.d.ts +1 -1
- package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -1
- package/lib/cjs/Editing/CustomAttributes.js +2 -2
- package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
- package/lib/cjs/Editing/ECClasses.d.ts +0 -7
- package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
- package/lib/cjs/Editing/ECClasses.js +0 -27
- package/lib/cjs/Editing/ECClasses.js.map +1 -1
- package/lib/cjs/Editing/Editor.d.ts +19 -3
- package/lib/cjs/Editing/Editor.d.ts.map +1 -1
- package/lib/cjs/Editing/Editor.js +48 -3
- package/lib/cjs/Editing/Editor.js.map +1 -1
- package/lib/cjs/Editing/Entities.js.map +1 -1
- package/lib/cjs/Editing/Enumerations.js +4 -4
- package/lib/cjs/Editing/Enumerations.js.map +1 -1
- package/lib/cjs/Editing/Exception.d.ts +237 -140
- package/lib/cjs/Editing/Exception.d.ts.map +1 -1
- package/lib/cjs/Editing/Exception.js +216 -196
- package/lib/cjs/Editing/Exception.js.map +1 -1
- package/lib/cjs/Editing/Formats.d.ts.map +1 -1
- package/lib/cjs/Editing/Formats.js +4 -1
- package/lib/cjs/Editing/Formats.js.map +1 -1
- package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.js +3 -1
- package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
- 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.d.ts +1 -1
- package/lib/cjs/Editing/Mutable/MutableCAClass.d.ts.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableCAClass.js.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.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.d.ts +2 -0
- package/lib/cjs/Editing/Mutable/MutableSchema.d.ts.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableSchemaItem.d.ts +11 -0
- package/lib/cjs/Editing/Mutable/MutableSchemaItem.d.ts.map +1 -0
- package/lib/cjs/Editing/Mutable/MutableSchemaItem.js +16 -0
- package/lib/cjs/Editing/Mutable/MutableSchemaItem.js.map +1 -0
- 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.js.map +1 -1
- package/lib/cjs/Editing/Properties.d.ts +1 -4
- package/lib/cjs/Editing/Properties.d.ts.map +1 -1
- package/lib/cjs/Editing/Properties.js +4 -5
- package/lib/cjs/Editing/Properties.js.map +1 -1
- package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
- package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
- package/lib/cjs/Editing/SchemaItems.d.ts +21 -2
- package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -1
- package/lib/cjs/Editing/SchemaItems.js +55 -24
- package/lib/cjs/Editing/SchemaItems.js.map +1 -1
- package/lib/cjs/Editing/Structs.js.map +1 -1
- package/lib/cjs/Editing/UnitSystems.js.map +1 -1
- package/lib/cjs/Editing/Units.js.map +1 -1
- package/lib/cjs/Merging/CAClassMerger.js +2 -2
- package/lib/cjs/Merging/CAClassMerger.js.map +1 -1
- package/lib/cjs/Merging/ClassMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/ClassMerger.js +10 -10
- package/lib/cjs/Merging/ClassMerger.js.map +1 -1
- package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
- package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
- package/lib/cjs/Merging/MixinMerger.js.map +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.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaItemMerger.d.ts +4 -4
- package/lib/cjs/Merging/SchemaItemMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaItemMerger.js +18 -18
- package/lib/cjs/Merging/SchemaItemMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.d.ts +7 -7
- package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.js +32 -31
- package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaReferenceMerger.js.map +1 -1
- package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -1
- package/lib/cjs/Validation/Diagnostic.js.map +1 -1
- package/lib/cjs/Validation/DiagnosticReporter.js.map +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.map +1 -1
- package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -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 +25 -14
- package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.js +36 -13
- package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
- package/lib/cjs/Validation/SchemaValidater.js.map +1 -1
- package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
- package/lib/cjs/ecschema-editing.d.ts +3 -1
- package/lib/cjs/ecschema-editing.d.ts.map +1 -1
- package/lib/cjs/ecschema-editing.js +4 -2
- package/lib/cjs/ecschema-editing.js.map +1 -1
- package/package.json +9 -9
- 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,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C/C,OAAO;QACT,CAAC;IACH,CAAC;CACF;AA5WD,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;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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AAI,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, _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,
|
|
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,CAA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AK,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAMlD;;;OAGG;IACU,iBAAiB,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"}
|
|
@@ -53,7 +53,7 @@ class SchemaCompareVisitor {
|
|
|
53
53
|
async visitProperty(propertyA) {
|
|
54
54
|
let propertyB;
|
|
55
55
|
const classB = await this._schemaB.lookupItem(propertyA.class.name);
|
|
56
|
-
if (classB) {
|
|
56
|
+
if (classB && ecschema_metadata_1.ECClass.isECClass(classB)) {
|
|
57
57
|
propertyB = await classB.getProperty(propertyA.name);
|
|
58
58
|
this._schemaComparer.compareProperties(propertyA, propertyB);
|
|
59
59
|
}
|
|
@@ -79,7 +79,8 @@ class SchemaCompareVisitor {
|
|
|
79
79
|
*/
|
|
80
80
|
async visitMixin(mixinA) {
|
|
81
81
|
const mixinB = await this._schemaB.lookupItem(mixinA.name);
|
|
82
|
-
|
|
82
|
+
if (!mixinB || mixinB.schemaItemType === ecschema_metadata_1.SchemaItemType.Mixin)
|
|
83
|
+
this._schemaComparer.compareMixins(mixinA, mixinB);
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
85
86
|
* Called for each [[RelationshipClass]] instance found during schema traversal.
|
|
@@ -87,7 +88,8 @@ class SchemaCompareVisitor {
|
|
|
87
88
|
*/
|
|
88
89
|
async visitRelationshipClass(relationshipA) {
|
|
89
90
|
const relationshipB = await this._schemaB.lookupItem(relationshipA.name);
|
|
90
|
-
|
|
91
|
+
if (!relationshipB || relationshipB.schemaItemType === ecschema_metadata_1.SchemaItemType.RelationshipClass)
|
|
92
|
+
this._schemaComparer.compareRelationshipClasses(relationshipA, relationshipB);
|
|
91
93
|
}
|
|
92
94
|
/**
|
|
93
95
|
* Called for each [[RelationshipConstraint]] of each RelationshipClass found during schema traversal.
|
|
@@ -96,7 +98,7 @@ class SchemaCompareVisitor {
|
|
|
96
98
|
async visitRelationshipConstraint(constraintA) {
|
|
97
99
|
let constraintB;
|
|
98
100
|
const relationshipB = await this._schemaB.lookupItem(constraintA.relationshipClass.name);
|
|
99
|
-
if (relationshipB)
|
|
101
|
+
if (relationshipB && relationshipB.schemaItemType === ecschema_metadata_1.SchemaItemType.RelationshipClass)
|
|
100
102
|
constraintB = constraintA.isSource ? relationshipB.source : relationshipB.target;
|
|
101
103
|
this._schemaComparer.compareRelationshipConstraints(constraintA, constraintB);
|
|
102
104
|
}
|
|
@@ -106,7 +108,8 @@ class SchemaCompareVisitor {
|
|
|
106
108
|
*/
|
|
107
109
|
async visitCustomAttributeClass(customAttributeA) {
|
|
108
110
|
const customAttributeB = await this._schemaB.lookupItem(customAttributeA.name);
|
|
109
|
-
|
|
111
|
+
if (!customAttributeB || customAttributeB.schemaItemType === ecschema_metadata_1.SchemaItemType.CustomAttributeClass)
|
|
112
|
+
this._schemaComparer.compareCustomAttributeClasses(customAttributeA, customAttributeB);
|
|
110
113
|
}
|
|
111
114
|
/**
|
|
112
115
|
* Called for each [[CustomAttribute]] container in the schema.
|
|
@@ -124,7 +127,7 @@ class SchemaCompareVisitor {
|
|
|
124
127
|
}
|
|
125
128
|
else if (ecschema_metadata_1.Property.isProperty(containerA)) {
|
|
126
129
|
const parent = await this._schemaB.lookupItem(containerA.class.name);
|
|
127
|
-
containerB = parent ? await parent.getProperty(shortName) : undefined;
|
|
130
|
+
containerB = parent && ecschema_metadata_1.ECClass.isECClass(parent) ? await parent.getProperty(shortName) : undefined;
|
|
128
131
|
}
|
|
129
132
|
else if (ecschema_metadata_1.RelationshipConstraint.isRelationshipConstraint(containerA)) {
|
|
130
133
|
const parent = await this._schemaB.lookupItem(containerA.relationshipClass.name);
|
|
@@ -138,7 +141,8 @@ class SchemaCompareVisitor {
|
|
|
138
141
|
*/
|
|
139
142
|
async visitEnumeration(enumA) {
|
|
140
143
|
const enumB = await this._schemaB.lookupItem(enumA.name);
|
|
141
|
-
|
|
144
|
+
if (!enumB || enumB.schemaItemType === ecschema_metadata_1.SchemaItemType.Enumeration)
|
|
145
|
+
this._schemaComparer.compareEnumerations(enumA, enumB);
|
|
142
146
|
}
|
|
143
147
|
/**
|
|
144
148
|
* Called for each [[KindOfQuantity]] instance found during schema traversal.
|
|
@@ -146,7 +150,8 @@ class SchemaCompareVisitor {
|
|
|
146
150
|
*/
|
|
147
151
|
async visitKindOfQuantity(koqA) {
|
|
148
152
|
const koqB = await this._schemaB.lookupItem(koqA.name);
|
|
149
|
-
|
|
153
|
+
if (!koqB || koqB.schemaItemType === ecschema_metadata_1.SchemaItemType.KindOfQuantity)
|
|
154
|
+
this._schemaComparer.compareKindOfQuantities(koqA, koqB);
|
|
150
155
|
}
|
|
151
156
|
/**
|
|
152
157
|
* Called for each [[PropertyCategory]] instance found during schema traversal.
|
|
@@ -154,7 +159,8 @@ class SchemaCompareVisitor {
|
|
|
154
159
|
*/
|
|
155
160
|
async visitPropertyCategory(categoryA) {
|
|
156
161
|
const categoryB = await this._schemaB.lookupItem(categoryA.name);
|
|
157
|
-
|
|
162
|
+
if (!categoryB || categoryB.schemaItemType === ecschema_metadata_1.SchemaItemType.PropertyCategory)
|
|
163
|
+
this._schemaComparer.comparePropertyCategories(categoryA, categoryB);
|
|
158
164
|
}
|
|
159
165
|
/**
|
|
160
166
|
* Called for each [[Format]] instance found during schema traversal.
|
|
@@ -162,7 +168,8 @@ class SchemaCompareVisitor {
|
|
|
162
168
|
*/
|
|
163
169
|
async visitFormat(formatA) {
|
|
164
170
|
const formatB = await this._schemaB.lookupItem(formatA.name);
|
|
165
|
-
|
|
171
|
+
if (!formatB || formatB.schemaItemType === ecschema_metadata_1.SchemaItemType.Format)
|
|
172
|
+
this._schemaComparer.compareFormats(formatA, formatB);
|
|
166
173
|
}
|
|
167
174
|
/**
|
|
168
175
|
* Called for each [[Unit]] instance found during schema traversal.
|
|
@@ -170,7 +177,8 @@ class SchemaCompareVisitor {
|
|
|
170
177
|
*/
|
|
171
178
|
async visitUnit(unitA) {
|
|
172
179
|
const unitB = await this._schemaB.lookupItem(unitA.name);
|
|
173
|
-
|
|
180
|
+
if (!unitB || ecschema_metadata_1.Unit.isUnit(unitB))
|
|
181
|
+
this._schemaComparer.compareUnits(unitA, unitB);
|
|
174
182
|
}
|
|
175
183
|
/**
|
|
176
184
|
* Called for each [[InvertedUnit]] instance found during schema traversal.
|
|
@@ -178,7 +186,8 @@ class SchemaCompareVisitor {
|
|
|
178
186
|
*/
|
|
179
187
|
async visitInvertedUnit(invertedUnitA) {
|
|
180
188
|
const invertedUnitB = await this._schemaB.lookupItem(invertedUnitA.name);
|
|
181
|
-
|
|
189
|
+
if (!invertedUnitB || invertedUnitB.schemaItemType === ecschema_metadata_1.SchemaItemType.InvertedUnit)
|
|
190
|
+
this._schemaComparer.compareInvertedUnits(invertedUnitA, invertedUnitB);
|
|
182
191
|
}
|
|
183
192
|
/**
|
|
184
193
|
* Called for each [[UnitSystem]] instance found during schema traversal.
|
|
@@ -193,7 +202,8 @@ class SchemaCompareVisitor {
|
|
|
193
202
|
*/
|
|
194
203
|
async visitPhenomenon(phenomenonA) {
|
|
195
204
|
const phenomenonB = await this._schemaB.lookupItem(phenomenonA.name);
|
|
196
|
-
|
|
205
|
+
if (!phenomenonB || phenomenonB.schemaItemType === ecschema_metadata_1.SchemaItemType.Phenomenon)
|
|
206
|
+
this._schemaComparer.comparePhenomenons(phenomenonA, phenomenonB);
|
|
197
207
|
}
|
|
198
208
|
/**
|
|
199
209
|
* Called for each [[Constant]] instance found during schema traversal.
|
|
@@ -201,7 +211,8 @@ class SchemaCompareVisitor {
|
|
|
201
211
|
*/
|
|
202
212
|
async visitConstant(constantA) {
|
|
203
213
|
const constantB = await this._schemaB.lookupItem(constantA.name);
|
|
204
|
-
|
|
214
|
+
if (!constantB || constantB.schemaItemType === ecschema_metadata_1.SchemaItemType.Constant)
|
|
215
|
+
this._schemaComparer.compareConstants(constantA, constantB);
|
|
205
216
|
}
|
|
206
217
|
}
|
|
207
218
|
exports.SchemaCompareVisitor = SchemaCompareVisitor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaCompareVisitor.js","sourceRoot":"","sources":["../../../src/Validation/SchemaCompareVisitor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAIkC;AAGlC;;;GAGG;AACH,MAAa,oBAAoB;IAI/B;;;;OAIG;IACH,YAAY,cAA+B,EAAE,eAAuB;QAClE,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,OAAe;QAC1C,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,WAAuB;QAClD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACrE,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACpE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,UAAU,CAAC,MAAgB;QACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAW,MAAM,CAAC,IAAI,CAAC,CAAC;QACrE,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC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GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAW,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3E,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC9D,CAAC;CACF;AArND,oDAqNC","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 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 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) {\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 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 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 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)\r\n constraintB = constraintA.isSource ? relationshipB.source : relationshipB.target;\r\n this._schemaComparer.compareRelationshipConstraints(constraintA, constraintB);\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 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 containerB = await this._schemaB.lookupItem(containerA.name);\r\n } else if (Property.isProperty(containerA)) {\r\n const parent = await this._schemaB.lookupItem<ECClass>(containerA.class.name);\r\n containerB = parent ? 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 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 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 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 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 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 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 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 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 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;;;AAEH,gEAIkC;AAGlC;;;GAGG;AACH,MAAa,oBAAoB;IAI/B;;;;OAIG;IACH,YAAY,cAA+B,EAAE,eAAuB;QAClE,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,OAAe;QAC1C,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,WAAuB;QAClD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC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KAAK,CAAC,aAAa,CAAC,SAAmB;QAC5C,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAW,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3E,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,cAAc,KAAK,kCAAc,CAAC,QAAQ;YACpE,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAChE,CAAC;CACF;AAhOD,oDAgOC","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._schemaB.lookupItem(schemaItemA.name);\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._schemaB.lookupItem<AnyClass>(classA.name);\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._schemaB.lookupItem<ECClass>(propertyA.class.name);\n if (classB && ECClass.isECClass(classB)) {\n propertyB = await classB.getProperty(propertyA.name) as AnyProperty;\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._schemaB.lookupItem<EntityClass>(entityA.name);\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._schemaB.lookupItem<Mixin>(mixinA.name);\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._schemaB.lookupItem<RelationshipClass>(relationshipA.name);\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._schemaB.lookupItem<RelationshipClass>(constraintA.relationshipClass.name);\n if (relationshipB && relationshipB.schemaItemType === SchemaItemType.RelationshipClass)\n constraintB = constraintA.isSource ? relationshipB.source : relationshipB.target;\n this._schemaComparer.compareRelationshipConstraints(constraintA, constraintB);\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._schemaB.lookupItem<CustomAttributeClass>(customAttributeA.name);\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 const nameParts = containerA.fullName.split(\".\");\n const shortName = nameParts.length === 1 ? nameParts[0] : nameParts[1];\n let containerB: CustomAttributeContainerProps | undefined;\n\n if (Schema.isSchema(containerA)) {\n containerB = this._schemaB;\n } else if (ECClass.isECClass(containerA)) {\n containerB = await this._schemaB.lookupItem(containerA.name);\n } else if (Property.isProperty(containerA)) {\n const parent = await this._schemaB.lookupItem<ECClass>(containerA.class.name);\n containerB = parent && ECClass.isECClass(parent) ? await parent.getProperty(shortName) : undefined;\n } else if (RelationshipConstraint.isRelationshipConstraint(containerA)) {\n const parent = await this._schemaB.lookupItem<RelationshipClass>(containerA.relationshipClass.name);\n containerB = parent ? containerA.isSource ? parent.source : parent.target : undefined;\n }\n\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._schemaB.lookupItem<Enumeration>(enumA.name);\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._schemaB.lookupItem<KindOfQuantity>(koqA.name);\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._schemaB.lookupItem<PropertyCategory>(categoryA.name);\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._schemaB.lookupItem<Format>(formatA.name);\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._schemaB.lookupItem<Unit>(unitA.name);\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._schemaB.lookupItem<InvertedUnit>(invertedUnitA.name);\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._schemaB.lookupItem<Phenomenon>(phenomenonA.name);\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._schemaB.lookupItem<Constant>(constantA.name);\n if (!constantB || constantB.schemaItemType === SchemaItemType.Constant)\n this._schemaComparer.compareConstants(constantA, constantB);\n }\n}\n"]}
|
|
@@ -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,EACzG,gBAAgB,EAAwB,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,EAChH,UAAU,EAA8D,IAAI,EAC7E,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;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EAAE,gBAAgB,EAAE,SAAS,EAAE,gBAAgB,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3H;;;;OAIG;IACU,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAmExF;;;;OAIG;IACU,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAyC9E;;;;OAIG;IACU,oBAAoB,CAAC,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BtH;;;;OAIG;IACU,kBAAkB,CAAC,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ5G;;;;OAIG;IACU,gBAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;YA4BpF,mBAAmB;YA4GnB,kBAAkB;YAgBlB,kBAAkB;IA0BhC,OAAO,CAAC,4BAA4B;IAqBpC;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAwB1B;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;CAuB1B"}
|
|
@@ -282,9 +282,9 @@ class SchemaComparer {
|
|
|
282
282
|
async compareCustomAttributeClasses(customAttributeClassA, customAttributeClassB) {
|
|
283
283
|
if (this._compareDirection === SchemaCompareDirection.Backward || !customAttributeClassB)
|
|
284
284
|
return;
|
|
285
|
-
if (customAttributeClassA.
|
|
286
|
-
const typeA = (0, ecschema_metadata_1.containerTypeToString)(customAttributeClassA.
|
|
287
|
-
const typeB = (0, ecschema_metadata_1.containerTypeToString)(customAttributeClassB.
|
|
285
|
+
if (customAttributeClassA.appliesTo !== customAttributeClassB.appliesTo) {
|
|
286
|
+
const typeA = (0, ecschema_metadata_1.containerTypeToString)(customAttributeClassA.appliesTo);
|
|
287
|
+
const typeB = (0, ecschema_metadata_1.containerTypeToString)(customAttributeClassB.appliesTo);
|
|
288
288
|
await this._reporter.reportCustomAttributeClassDelta(customAttributeClassA, "appliesTo", typeA, typeB, this._compareDirection);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
@@ -679,8 +679,8 @@ class SchemaComparer {
|
|
|
679
679
|
* @returns true if both names are the same and they come from their respective top level schema.
|
|
680
680
|
*/
|
|
681
681
|
areItemsSameByName(itemKeyA, itemKeyB, topLevelSchemaNameA, topLevelSchemaNameB) {
|
|
682
|
-
const nameA = itemKeyA ? itemKeyA.name : undefined;
|
|
683
|
-
const nameB = itemKeyB ? itemKeyB.name : undefined;
|
|
682
|
+
const nameA = itemKeyA ? itemKeyA.name.toUpperCase() : undefined;
|
|
683
|
+
const nameB = itemKeyB ? itemKeyB.name.toUpperCase() : undefined;
|
|
684
684
|
const schemaNameA = itemKeyA
|
|
685
685
|
? ecschema_metadata_1.SchemaItem.isSchemaItem(itemKeyA)
|
|
686
686
|
? itemKeyA.schema.name
|
|
@@ -702,19 +702,18 @@ class SchemaComparer {
|
|
|
702
702
|
*/
|
|
703
703
|
containerHasClass(attributeA, containerA, containerB) {
|
|
704
704
|
if (containerB && containerB.customAttributes) {
|
|
705
|
-
for (const
|
|
706
|
-
const attributeB = caB[1];
|
|
705
|
+
for (const [_className, attributeB] of containerB.customAttributes) {
|
|
707
706
|
const classItemKeyA = containerA.schema.getSchemaItemKey(attributeA.className);
|
|
708
707
|
const classItemKeyB = containerB.schema.getSchemaItemKey(attributeB.className);
|
|
709
708
|
if (this.areItemsSameByName(classItemKeyA, classItemKeyB, containerA.schema.name, containerB.schema.name)) {
|
|
710
|
-
return Object.keys(attributeA).every((
|
|
711
|
-
const propertyName = property.toString();
|
|
709
|
+
return Object.keys(attributeA).every((propertyName) => {
|
|
712
710
|
const valueA = attributeA[propertyName];
|
|
713
711
|
const valueB = attributeB[propertyName];
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
712
|
+
// If propertyName is class name, they don't need to be compared as this has been done
|
|
713
|
+
// in the areItemsSameByName function.
|
|
714
|
+
if (propertyName === "className")
|
|
715
|
+
return true;
|
|
716
|
+
return deepEquals(valueA, valueB);
|
|
718
717
|
});
|
|
719
718
|
}
|
|
720
719
|
}
|
|
@@ -723,4 +722,28 @@ class SchemaComparer {
|
|
|
723
722
|
}
|
|
724
723
|
}
|
|
725
724
|
exports.SchemaComparer = SchemaComparer;
|
|
725
|
+
/**
|
|
726
|
+
* Compares two values on their deep equality.
|
|
727
|
+
* @param a left side to compare
|
|
728
|
+
* @param b right side to compare
|
|
729
|
+
* @returns true if they are deeply equal, otherwise false.
|
|
730
|
+
*/
|
|
731
|
+
function deepEquals(a, b) {
|
|
732
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
733
|
+
return a.length === b.length && a.every((value, index) => {
|
|
734
|
+
return deepEquals(value, b[index]);
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
if (isObject(a) && isObject(b)) {
|
|
738
|
+
const propertiesA = Object.keys(a);
|
|
739
|
+
const propertiesB = Object.keys(b);
|
|
740
|
+
return propertiesA.length === propertiesB.length && propertiesA.every((propertyName) => {
|
|
741
|
+
return deepEquals(a[propertyName], b[propertyName]);
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
return a === b;
|
|
745
|
+
}
|
|
746
|
+
function isObject(value) {
|
|
747
|
+
return typeof value === "object";
|
|
748
|
+
}
|
|
726
749
|
//# sourceMappingURL=SchemaComparer.js.map
|