@itwin/ecschema-editing 4.4.0-dev.8 → 4.5.0-dev.0

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
  3. package/lib/cjs/Editing/ECClasses.js +5 -0
  4. package/lib/cjs/Editing/ECClasses.js.map +1 -1
  5. package/lib/cjs/Editing/Editor.d.ts +1 -1
  6. package/lib/cjs/Editing/Editor.d.ts.map +1 -1
  7. package/lib/cjs/Editing/Editor.js +1 -1
  8. package/lib/cjs/Editing/Editor.js.map +1 -1
  9. package/lib/cjs/Editing/Entities.d.ts.map +1 -1
  10. package/lib/cjs/Editing/Entities.js +8 -6
  11. package/lib/cjs/Editing/Entities.js.map +1 -1
  12. package/lib/cjs/Editing/Formats.d.ts.map +1 -1
  13. package/lib/cjs/Editing/Formats.js +2 -0
  14. package/lib/cjs/Editing/Formats.js.map +1 -1
  15. package/lib/cjs/Editing/KindOfQuantities.d.ts +1 -0
  16. package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
  17. package/lib/cjs/Editing/KindOfQuantities.js +20 -0
  18. package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
  19. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.d.ts +2 -1
  20. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.d.ts.map +1 -1
  21. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
  22. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.d.ts +9 -1
  23. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.d.ts.map +1 -1
  24. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js.map +1 -1
  25. package/lib/cjs/Editing/RelationshipClasses.d.ts +33 -2
  26. package/lib/cjs/Editing/RelationshipClasses.d.ts.map +1 -1
  27. package/lib/cjs/Editing/RelationshipClasses.js +148 -22
  28. package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
  29. package/lib/cjs/Merging/ClassMerger.d.ts.map +1 -1
  30. package/lib/cjs/Merging/ClassMerger.js +9 -1
  31. package/lib/cjs/Merging/ClassMerger.js.map +1 -1
  32. package/lib/cjs/Merging/ClassPropertyMerger.d.ts.map +1 -1
  33. package/lib/cjs/Merging/ClassPropertyMerger.js +8 -1
  34. package/lib/cjs/Merging/ClassPropertyMerger.js.map +1 -1
  35. package/lib/cjs/Merging/CustomAttributeMerger.d.ts +21 -0
  36. package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -0
  37. package/lib/cjs/Merging/CustomAttributeMerger.js +51 -0
  38. package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -0
  39. package/lib/cjs/Merging/KindOfQuantityMerger.d.ts +15 -0
  40. package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -0
  41. package/lib/cjs/Merging/KindOfQuantityMerger.js +66 -0
  42. package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -0
  43. package/lib/cjs/Merging/SchemaItemFactory.d.ts.map +1 -1
  44. package/lib/cjs/Merging/SchemaItemFactory.js +10 -0
  45. package/lib/cjs/Merging/SchemaItemFactory.js.map +1 -1
  46. package/lib/cjs/Merging/SchemaItemMerger.d.ts +2 -1
  47. package/lib/cjs/Merging/SchemaItemMerger.d.ts.map +1 -1
  48. package/lib/cjs/Merging/SchemaItemMerger.js +11 -4
  49. package/lib/cjs/Merging/SchemaItemMerger.js.map +1 -1
  50. package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
  51. package/lib/cjs/Merging/SchemaMerger.js +7 -0
  52. package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
  53. package/lib/cjs/Validation/ECRules.d.ts +13 -3
  54. package/lib/cjs/Validation/ECRules.d.ts.map +1 -1
  55. package/lib/cjs/Validation/ECRules.js +30 -11
  56. package/lib/cjs/Validation/ECRules.js.map +1 -1
  57. package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts +1 -1
  58. package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts.map +1 -1
  59. package/lib/cjs/Validation/SchemaCompareResultDelegate.js +2 -4
  60. package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
  61. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"ECRules.js","sourceRoot":"","sources":["../../../src/Validation/ECRules.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAKkC;AAClC,6CAIsB;AAGtB,MAAM,WAAW,GAAG,WAAW,CAAC;AAEhC,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,GAAG,WAAW,IAAI,IAAI,EAAE,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,yDAAyD;AAC5C,QAAA,eAAe,GAAG;IAC7B,6BAA6B;IAC7B,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC,GAAG,CAAC;IACtC,uEAAuE;IACvE,gCAAgC,EAAE,OAAO,CAAC,GAAG,CAAC;IAE9C,oCAAoC;IACpC,iCAAiC,EAAE,OAAO,CAAC,GAAG,CAAC;IAC/C,qCAAqC,EAAE,OAAO,CAAC,GAAG,CAAC;IACnD,4BAA4B,EAAE,OAAO,CAAC,GAAG,CAAC;IAE1C,mCAAmC;IACnC,0BAA0B,EAAE,OAAO,CAAC,GAAG,CAAC;IAExC,+BAA+B;IAC/B,2CAA2C,EAAE,OAAO,CAAC,IAAI,CAAC;IAE1D,kCAAkC;IAClC,qCAAqC,EAAE,OAAO,CAAC,IAAI,CAAC;IACpD,gCAAgC,EAAE,OAAO,CAAC,IAAI,CAAC;IAC/C,gCAAgC,EAAE,OAAO,CAAC,IAAI,CAAC;IAE/C,sCAAsC;IACtC,2CAA2C,EAAE,OAAO,CAAC,IAAI,CAAC;IAC1D,2CAA2C,EAAE,OAAO,CAAC,I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Content":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Validation\n */\n\nimport {\n AnyClass, AnyProperty, CustomAttribute, CustomAttributeContainerProps, ECClass, ECClassModifier,\n ECStringConstants, EntityClass, Enumeration, PrimitiveProperty, PrimitiveType, primitiveTypeToString,\n Property, RelationshipClass, RelationshipConstraint, RelationshipMultiplicity, Schema, SchemaGraph, SchemaItemType,\n schemaItemTypeToString, StrengthDirection, strengthDirectionToString,\n} from \"@itwin/ecschema-metadata\";\nimport {\n ClassDiagnostic, createClassDiagnosticClass, createCustomAttributeContainerDiagnosticClass, createPropertyDiagnosticClass,\n createRelationshipConstraintDiagnosticClass, createSchemaDiagnosticClass, createSchemaItemDiagnosticClass, CustomAttributeContainerDiagnostic,\n PropertyDiagnostic, RelationshipConstraintDiagnostic, SchemaDiagnostic, SchemaItemDiagnostic,\n} from \"./Diagnostic\";\nimport { IRuleSet } from \"./Rules\";\n\nconst ruleSetName = \"ECObjects\";\n\nfunction getCode(code: number): string {\n return `${ruleSetName}-${code}`;\n}\n\n/**\n * The unique diagnostic codes for ECObjects rules.\n *\n * To provide meaning to code values, with anticipation\n * of future rules for all current EC Types, the following\n * value ranges should be used:\n *\n * - Schema: 000-099\n * - Class: 100-199\n * - Constant: 200-299\n * - CustomAttribute 300-399\n * - CustomAttributeClass: 400-499\n * - CustomAttributeContainer: 500-599\n * - EntityClass: 600-699\n * - Enumeration: 700-799\n * - Format: 800-899\n * - InvertedUnit: 900-999\n * - KindOfQuantity: 1000-1099\n * - Mixin: 1100-1199\n * - Phenomenon: 1200-1299\n * - Property: 1300-1399\n * - PropertyCategory: 1400-1499\n * - RelationshipClass: 1500-1599\n * - RelationshipConstraint: 1600-1699\n * - StructClass: 1700-1799\n * - Unit: 1800-1899\n * - UnitSystem: 1900-1999\n * @beta\n */\n/* eslint-disable @typescript-eslint/naming-convention */\nexport const DiagnosticCodes = {\n // Class Rule Codes (100-199)\n BaseClassIsSealed: getCode(100),\n BaseClassOfDifferentType: getCode(101),\n // EC-102 has been deprecated. Leaving the code here to prevent re-use.\n AbstractClassWithNonAbstractBase: getCode(102),\n\n // CA Container Rule Codes (500-599)\n CustomAttributeNotOfConcreteClass: getCode(500),\n CustomAttributeSchemaMustBeReferenced: getCode(501),\n CustomAttributeClassNotFound: getCode(502),\n\n // Enumeration Rule Codes (700-799)\n EnumerationTypeUnsupported: getCode(700),\n\n // Mixin Rule Codes (1100-1199)\n MixinAppliedToClassMustDeriveFromConstraint: getCode(1100),\n\n // Property Rule Codes (1300-1399)\n IncompatibleValueTypePropertyOverride: getCode(1300),\n IncompatibleTypePropertyOverride: getCode(1301),\n IncompatibleUnitPropertyOverride: getCode(1302),\n\n // Relationship Rule Codes (1500-1599)\n AbstractConstraintMustNarrowBaseConstraints: getCode(1500),\n DerivedConstraintsMustNarrowBaseConstraints: getCode(1501),\n ConstraintClassesDeriveFromAbstractContraint: getCode(1502),\n\n // Relationship Constraint Rule Codes (1600-1699)\n AtLeastOneConstraintClassDefined: getCode(1600),\n AbstractConstraintMustExistWithMultipleConstraints: getCode(1601),\n};\n\n/**\n * The list of [[IDiagnostic]] implementation classes used by the EC rule implementations.\n * @beta\n */\nexport const Diagnostics = {\n /** EC-001: Required message parameters: schema name, referenced schema name */\n SupplementalSchemasCannotBeReferenced: createSchemaDiagnosticClass<[string, string]>(getCode(1),\n \"Referenced schema '{1}' of schema '{0}' is a supplemental schema. Supplemental schemas are not allowed to be referenced.\"),\n\n /** EC-002: Required message parameters: schema name, reference schema alias, first schema reference name, second schema reference name. */\n SchemaRefAliasMustBeUnique: createSchemaDiagnosticClass<[string, string, string, string]>(getCode(2),\n \"Schema '{0}' has multiple schema references ({2}, {3}) with the same alias '{1}', which is not allowed.\"),\n\n /** EC-003: Required message parameters: schema name, cycle text */\n ReferenceCyclesNotAllowed: createSchemaDiagnosticClass<[string, string]>(getCode(3),\n \"Schema '{0}' has reference cycles: {1}\"),\n\n /** EC-100: Required message parameters: childClass.FullName, baseClass.FullName */\n BaseClassIsSealed: createClassDiagnosticClass<[string, string]>(DiagnosticCodes.BaseClassIsSealed,\n \"Class '{0}' cannot derive from sealed base class '{1}'.\"),\n\n /** EC-101: Required message parameters: childClass.FullName, baseClass.FullName, baseClass.schemaItemType */\n BaseClassIsOfDifferentType: createClassDiagnosticClass<[string, string, string]>(DiagnosticCodes.BaseClassOfDifferentType,\n \"Class '{0}' cannot derive from base class '{1}' of type '{2}'.\"),\n\n /** **DEPRECATED** EC-102: Required message parameters: childClass.FullName, baseClass.FullName */\n AbstractClassWithNonAbstractBase: createClassDiagnosticClass<[string, string]>(DiagnosticCodes.AbstractClassWithNonAbstractBase,\n \"Abstract Class '{0}' cannot derive from base class '{1}' because it is not an abstract class.\"),\n\n /** EC-500: Required message parameters: CustomAttribute container name and CustomAttributeClass name. */\n CustomAttributeNotOfConcreteClass: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeNotOfConcreteClass,\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' which is not a concrete class.\"),\n\n /** EC-501: Required message parameters: CustomAttribute container name, CustomAttributeClass name, CustomAttributeClass Schema name. */\n CustomAttributeSchemaMustBeReferenced: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeSchemaMustBeReferenced,\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' whose schema is not referenced by the container's Schema.\"),\n\n /** EC-502: Required message parameters: CustomAttribute container name and CustomAttributeClass name. */\n CustomAttributeClassNotFound: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeClassNotFound,\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' which cannot be found.\"),\n\n /** EC-700: Required message parameters: Enumeration name */\n EnumerationTypeUnsupported: createSchemaItemDiagnosticClass<Enumeration, [string]>(DiagnosticCodes.EnumerationTypeUnsupported,\n \"Enumeration '{0}' has invalid primitive type.\"),\n\n /** EC-1100: Required message parameters: mixin class fullName, class fullName, applies to constraint class fullName */\n MixinAppliedToClassMustDeriveFromConstraint: createSchemaItemDiagnosticClass<EntityClass, [string, string, string]>(DiagnosticCodes.MixinAppliedToClassMustDeriveFromConstraint,\n \"Mixin '{0}' cannot be applied to the class '{1}' because it does not satisfy the applies to constraint '{2}'.\"),\n\n /** EC-1300: Required message parameters: childClass.FullName, property name, baseClass.FullName, base value type, child value type */\n IncompatibleValueTypePropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string]>(DiagnosticCodes.IncompatibleValueTypePropertyOverride,\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with a value type of {3} which is incompatible with the value type of {4}.\"),\n\n /** EC-1301: Required message parameters: childClass.FullName, property name, baseClass.FullName, base property type, child property type */\n IncompatibleTypePropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string]>(DiagnosticCodes.IncompatibleTypePropertyOverride,\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with a type of {3} which is incompatible with the type of {4}.\"),\n\n /** EC-1302: Required message parameters: childClass.Name, property name, baseClass.Name, baseClass Koq name, baseClass Koq persistence unit name, child class Koq persistence unit name, child class Koq name */\n IncompatibleUnitPropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string, string, string]>(DiagnosticCodes.IncompatibleUnitPropertyOverride,\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with KindOfQuantity '{3}' with persistence unit '{4}' which is not the same as the persistence unit '{5}' of the provided KindOfQuantity '{6}'.\"),\n\n /** EC-1303: Required message parameters: property.fullName, navigation relationship.fullName */\n NavigationRelationshipMustBeRoot: createPropertyDiagnosticClass<[string, string]>(getCode(1303),\n \"The referenced relationship '{1}', used in NavigationProperty '{0}' is not the root relationship.\"),\n\n /** EC-1304: Required message parameters: property.fullName, navigation relationship.fullName */\n NavigationTargetMustHaveSingularMultiplicity: createPropertyDiagnosticClass<[string, string, string]>(getCode(1304),\n \"NavigationProperty '{0}' uses the relationship '{1}' that cannot be traversed in the '{2}' direction due to a max multiplicity greater than 1.\"),\n\n /** EC-1305: Required message parameters: property.fullName, navigation relationship.fullName */\n NavigationRelationshipAbstractConstraintEntityOrMixin: createPropertyDiagnosticClass<[string, string]>(getCode(1305),\n \"The NavigationProperty '{0}', using the relationship '{1}', points to a RelationshipClass, which is not allowed. NavigationProperties must point to an EntityClass or Mixin.\"),\n\n /** EC-1306: Required message parameters: class name, property name, navigation relationship.fullName */\n NavigationClassMustBeAConstraintClassOfRelationship: createPropertyDiagnosticClass<[string, string, string, string]>(getCode(1306),\n \"The class '{0}' of NavigationProperty '{1}' is not supported by the {3} constraint of the referenced relationship '{2}'.\"),\n\n /** EC-1500: Required message parameters: abstract constraint class name, relationship end (source/target), relationship name, base relationship name */\n AbstractConstraintMustNarrowBaseConstraints: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.AbstractConstraintMustNarrowBaseConstraints,\n \"The abstract constraint class '{0}' on the {1}-Constraint of '{2}' is not supported by the base class constraint in '{3}'.\"),\n\n /** EC-1501: Required message parameters: constraint class name, relationship end (source/target), relationship name, base relationship name */\n DerivedConstraintsMustNarrowBaseConstraints: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.DerivedConstraintsMustNarrowBaseConstraints,\n \"The constraint class '{0}' on the {1}-Constraint of '{2}' is not supported by the base class constraint in '{3}'.\"),\n\n /** EC-1502: Required message parameters: constraint class name, relationship end (source/target), relationship name, abstract constraint class name */\n ConstraintClassesDeriveFromAbstractContraint: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.ConstraintClassesDeriveFromAbstractContraint,\n \"The constraint class '{0}' on the {1}-Constraint of '{2}' is not derived from the abstract constraint class '{3}'.\"),\n\n /** EC-1600: Required message parameters: relationship end (source/target), relationship name */\n AtLeastOneConstraintClassDefined: createRelationshipConstraintDiagnosticClass<[string, string]>(DiagnosticCodes.AtLeastOneConstraintClassDefined,\n \"The {0}-Constraint of '{1}' does not contain any constraint classes.\"),\n\n /** EC-1601: Required message parameters: relationship end (source/target), relationship name */\n AbstractConstraintMustExistWithMultipleConstraints: createRelationshipConstraintDiagnosticClass<[string, string]>(DiagnosticCodes.AbstractConstraintMustExistWithMultipleConstraints,\n \"The {0}-Constraint of '{1}' has multiple constraint classes which requires an abstract constraint to be defined.\"),\n};\n\n/**\n * All schema validation rules that fall under the category of ECObjects.\n * @beta\n */\nexport const ECRuleSet: IRuleSet = {\n name: ruleSetName,\n\n schemaRules: [\n validateSchemaReferences,\n ],\n classRules: [\n baseClassIsSealed,\n baseClassIsOfDifferentType,\n ],\n propertyRules: [\n incompatibleValueTypePropertyOverride,\n incompatibleTypePropertyOverride,\n incompatibleUnitPropertyOverride,\n validateNavigationProperty,\n ],\n relationshipRules: [\n abstractConstraintMustNarrowBaseConstraints,\n constraintClassesDeriveFromAbstractContraint,\n derivedConstraintsMustNarrowBaseConstraints,\n ],\n relationshipConstraintRules: [\n atLeastOneConstraintClassDefined,\n abstractConstraintMustExistWithMultipleConstraints,\n ],\n enumerationRules: [\n enumerationTypeUnsupported,\n ],\n entityClassRules: [\n mixinAppliedToClassMustDeriveFromConstraint,\n ],\n customAttributeInstanceRules: [\n validateCustomAttributeInstance,\n ],\n};\n\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/**\n * Validates schema references against multiple EC rules.\n * @param schema The schema to validate.\n * @internal\n */\nexport async function* validateSchemaReferences(schema: Schema): AsyncIterable<SchemaDiagnostic<any[]>> {\n yield* validateSchemaReferencesSync(schema);\n}\n\n/**\n * Validates schema references against multiple EC rules.\n * @param schema The schema to validate.\n * @internal\n */\nexport function* validateSchemaReferencesSync(schema: Schema): Iterable<SchemaDiagnostic<any[]>> {\n const aliases = new Map();\n for (const schemaRef of schema.references) {\n if (schemaRef.customAttributes && schemaRef.customAttributes.has(\"CoreCustomAttributes.SupplementalSchema\"))\n yield new Diagnostics.SupplementalSchemasCannotBeReferenced(schema, [schema.name, schemaRef.name]);\n\n if (schema.schemaKey.matches(schemaRef.schemaKey))\n yield new Diagnostics.ReferenceCyclesNotAllowed(schema, [schema.name, `${schema.name} --> ${schemaRef.name}`]);\n\n if (aliases.has(schemaRef.alias)) {\n const currentRef = aliases.get(schemaRef.alias);\n yield new Diagnostics.SchemaRefAliasMustBeUnique(schema, [schema.name, schemaRef.alias, currentRef.name, schemaRef.name]);\n } else {\n aliases.set(schemaRef.alias, schemaRef);\n }\n }\n\n const graph = SchemaGraph.generateGraphSync(schema);\n const cycles = graph.detectCycles();\n if (cycles) {\n const result = cycles.map((cycle) => `${cycle.schema.schemaKey.name} --> ${cycle.refSchema.schemaKey.name}`).join(\", \");\n yield new Diagnostics.ReferenceCyclesNotAllowed(schema, [schema.name, result]);\n }\n}\n/**\n * EC Rule: Sealed classes cannot be a base class.\n * @internal\n */\nexport async function* baseClassIsSealed(ecClass: AnyClass): AsyncIterable<ClassDiagnostic<any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseClass = await ecClass.baseClass;\n // return if rule passed\n if (baseClass.modifier !== ECClassModifier.Sealed)\n return;\n\n yield new Diagnostics.BaseClassIsSealed(ecClass, [ecClass.fullName, baseClass.fullName]);\n}\n\n/**\n * EC Rule: Base and child class must be of the same type (i.e. Entity, Mixin, Relationship, etc.)\n * @internal\n */\nexport async function* baseClassIsOfDifferentType(ecClass: AnyClass): AsyncIterable<ClassDiagnostic<any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseClass = await ecClass.baseClass;\n // return if rule passed\n if (baseClass.schemaItemType === ecClass.schemaItemType)\n return;\n\n const itemType = schemaItemTypeToString(baseClass.schemaItemType);\n yield new Diagnostics.BaseClassIsOfDifferentType(ecClass, [ecClass.fullName, baseClass.fullName, itemType]);\n}\n\n/**\n * EC Rule: When overriding a class primitive property, the child and base property must be of the same type (string, number, etc...).\n * @internal\n*/\nexport async function* incompatibleValueTypePropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.class.baseClass)\n return;\n\n const primitiveType = getPrimitiveType(property);\n if (!primitiveType)\n return;\n\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\n const baseProperty = await baseClass.getProperty(property.name);\n if (!baseProperty)\n return;\n\n // Other rules will catch this if false, but we need to make sure\n // types match for this rule to be valid.\n if (!propertyTypesMatch(property, baseProperty))\n return;\n\n const baseType = getPrimitiveType(baseProperty);\n\n // Return if rule passed\n if (!baseType || primitiveType === baseType)\n return;\n\n return new Diagnostics.IncompatibleValueTypePropertyOverride(property, [property.class.fullName, property.name, baseClass.fullName, primitiveTypeToString(baseType), primitiveTypeToString(primitiveType!)]);\n }\n\n for await (const baseClass of property.class.getAllBaseClasses()) {\n const result = await callback(baseClass);\n if (result)\n yield result;\n }\n}\n\n/**\n * EC Rule: When overriding a class property, the child and base property must be of the same property type (primitive, struct, enumeration, etc...).\n * @internal\n */\nexport async function* incompatibleTypePropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.class.baseClass)\n return;\n\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\n const baseProperty = await baseClass.getProperty(property.name);\n if (!baseProperty)\n return;\n\n // Return if rule passed\n if (propertyTypesMatch(property, baseProperty))\n return;\n\n return new Diagnostics.IncompatibleTypePropertyOverride(property, [property.class.fullName, property.name, baseClass.fullName, baseProperty.constructor.name, property.constructor.name]);\n }\n\n for await (const baseClass of property.class.getAllBaseClasses()) {\n const result = await callback(baseClass);\n if (result)\n yield result;\n }\n}\n\n/**\n * EC Rule: When overriding a kindOfQuantity property, the child and base property units must be the same.\n * @internal\n */\nexport async function* incompatibleUnitPropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.kindOfQuantity || !property.class.baseClass)\n return;\n\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\n const baseProperty = await baseClass.getProperty(property.name);\n if (!baseProperty || !baseProperty.kindOfQuantity)\n return;\n\n // Other rules will catch this if false, but we need to make sure\n // types match for this rule to be valid.\n if (!propertyTypesMatch(property, baseProperty))\n return;\n\n const koq = await property.kindOfQuantity;\n const baseKoq = await baseProperty.kindOfQuantity;\n if (!koq || !baseKoq)\n return;\n\n const unit = await koq.persistenceUnit;\n const baseUnit = await baseKoq.persistenceUnit;\n\n if (!unit || !baseUnit)\n return;\n\n // return if rule passed\n if (unit.key.matches(baseUnit.key))\n return;\n\n return new Diagnostics.IncompatibleUnitPropertyOverride(property, [\n property.class.fullName,\n property.name,\n baseClass.fullName,\n baseKoq.fullName,\n baseUnit.fullName,\n unit.fullName,\n koq.fullName,\n ]);\n }\n\n for await (const baseClass of property.class.getAllBaseClasses()) {\n const result = await callback(baseClass);\n if (result)\n yield result;\n }\n}\n\n/**\n * Validates Navigation Properties. EC Rules: 1303, 1304\n * @internal\n */\nexport async function* validateNavigationProperty(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.isNavigation())\n return;\n\n const navProp = property;\n const relationship = await navProp.relationshipClass;\n\n if (relationship.baseClass)\n yield new Diagnostics.NavigationRelationshipMustBeRoot(property, [property.fullName, relationship.fullName]);\n\n let thisConstraint: RelationshipConstraint;\n let thatConstraint: RelationshipConstraint;\n let navigationClassSide: string;\n if (navProp.direction === StrengthDirection.Forward) {\n thisConstraint = relationship.source;\n thatConstraint = relationship.target;\n navigationClassSide = \"source\";\n } else {\n thisConstraint = relationship.target;\n thatConstraint = relationship.source;\n navigationClassSide = \"target\";\n }\n\n const thatAbstractConstraint = await thatConstraint.abstractConstraint;\n if (thatAbstractConstraint && thatAbstractConstraint.schemaItemType === SchemaItemType.RelationshipClass) {\n yield new Diagnostics.NavigationRelationshipAbstractConstraintEntityOrMixin(property, [property.fullName, relationship.fullName]);\n }\n\n const isClassSupported = async (ecClass: ECClass, propertyName: string, constraintName: string): Promise<boolean> => {\n if (constraintName === ecClass.fullName && undefined !== await ecClass.getProperty(propertyName))\n return true;\n\n const inheritedProp = await ecClass.getInheritedProperty(propertyName);\n if (inheritedProp && constraintName === inheritedProp.class.fullName)\n return true;\n\n const baseClass = await ecClass.baseClass;\n if (!baseClass)\n return false;\n\n return isClassSupported(baseClass, propertyName, constraintName);\n };\n\n let classSupported = false;\n if (thisConstraint.constraintClasses) {\n for (const constraintClass of thisConstraint.constraintClasses) {\n classSupported = await isClassSupported(property.class, property.name, constraintClass.fullName);\n if (classSupported)\n break;\n }\n }\n\n if (!classSupported)\n yield new Diagnostics.NavigationClassMustBeAConstraintClassOfRelationship(property, [property.class.name, property.name, relationship.fullName, navigationClassSide]);\n\n if (thatConstraint.multiplicity === RelationshipMultiplicity.oneMany || thatConstraint.multiplicity === RelationshipMultiplicity.zeroMany) {\n const direction = strengthDirectionToString(navProp.direction);\n yield new Diagnostics.NavigationTargetMustHaveSingularMultiplicity(property, [property.fullName, relationship.fullName, direction]);\n }\n\n return;\n}\n\n/**\n * EC Rule: When overriding a RelationshipClass, the derived abstract constraint must narrow the base constraint classes.\n * @internal\n */\nexport async function* abstractConstraintMustNarrowBaseConstraints(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseRelationship = await ecClass.baseClass as RelationshipClass;\n\n const sourceResult = await applyAbstractConstraintMustNarrowBaseConstraints(ecClass, ecClass.source, baseRelationship);\n if (sourceResult)\n yield sourceResult;\n const targetResult = await applyAbstractConstraintMustNarrowBaseConstraints(ecClass, ecClass.target, baseRelationship);\n if (targetResult)\n yield targetResult;\n}\n\n/**\n * EC Rule: When overriding a RelationshipClass, derived constraint classes must narrow base constraint classes.\n * @internal\n */\nexport async function* derivedConstraintsMustNarrowBaseConstraints(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseRelationship = await ecClass.baseClass as RelationshipClass;\n\n const sourceResult = await applyDerivedConstraintsMustNarrowBaseConstraints(ecClass, ecClass.source, baseRelationship);\n if (sourceResult)\n yield sourceResult;\n const targetResult = await applyDerivedConstraintsMustNarrowBaseConstraints(ecClass, ecClass.target, baseRelationship);\n if (targetResult)\n yield targetResult;\n}\n\n/**\n * EC Rule: All constraint classes must have a common base class specified in the abstract constraint.\n * @internal\n */\nexport async function* constraintClassesDeriveFromAbstractContraint(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\n const sourceResult = await applyConstraintClassesDeriveFromAbstractContraint(ecClass, ecClass.source);\n if (sourceResult)\n yield sourceResult;\n const targetResult = await applyConstraintClassesDeriveFromAbstractContraint(ecClass, ecClass.target);\n if (targetResult)\n yield targetResult;\n}\n\n/**\n * EC Rule: At least on concrete constraint class must be defined in the list of constraint classes.\n * @internal\n */\nexport async function* atLeastOneConstraintClassDefined(constraint: RelationshipConstraint): AsyncIterable<RelationshipConstraintDiagnostic<any[]>> {\n if (!constraint.constraintClasses || constraint.constraintClasses.length === 0) {\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n yield new Diagnostics.AtLeastOneConstraintClassDefined(constraint, [constraintType, constraint.relationshipClass.fullName]);\n }\n}\n\n/**\n * EC Rule: If multiple constraints exist, an abstract constraint must be defined.\n * @internal\n */\nexport async function* abstractConstraintMustExistWithMultipleConstraints(constraint: RelationshipConstraint): AsyncIterable<RelationshipConstraintDiagnostic<any[]>> {\n if (!constraint.constraintClasses || constraint.constraintClasses.length <= 1) {\n return;\n }\n\n const abstractConstraint = await getAbstractConstraint(constraint);\n if (abstractConstraint)\n return;\n\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n yield new Diagnostics.AbstractConstraintMustExistWithMultipleConstraints(constraint, [constraintType, constraint.relationshipClass.fullName]);\n}\n\nfunction propertyTypesMatch(propertyA: Property, propertyB: Property) {\n return propertyA.constructor.name === propertyB.constructor.name;\n}\n\nfunction getPrimitiveType(property: Property): PrimitiveType | undefined {\n if (property.isPrimitive())\n return (property as PrimitiveProperty).primitiveType;\n\n return undefined;\n}\n\n/**\n * EC Rule: Enumeration type must be a string or integer\n * @internal\n */\nexport async function* enumerationTypeUnsupported(enumeration: Enumeration): AsyncIterable<SchemaItemDiagnostic<Enumeration, any[]>> {\n const type = enumeration.type;\n if (type === PrimitiveType.Integer || type === PrimitiveType.String)\n return;\n\n yield new Diagnostics.EnumerationTypeUnsupported(enumeration, [enumeration.fullName]);\n}\n\n/**\n * EC Rule: Mixin applied to class must derived from the Mixin appliesTo constraint.\n * @internal\n */\nexport async function* mixinAppliedToClassMustDeriveFromConstraint(entityClass: EntityClass): AsyncIterable<SchemaItemDiagnostic<EntityClass, any[]>> {\n for (const lazyMixin of entityClass.mixins) {\n const mixin = await lazyMixin;\n if (!mixin.appliesTo)\n continue;\n\n if (!await entityClass.is(await mixin.appliesTo))\n yield new Diagnostics.MixinAppliedToClassMustDeriveFromConstraint(entityClass, [mixin.fullName, entityClass.fullName, mixin.appliesTo.fullName]);\n }\n\n return;\n}\n\n/**\n * Validates a custom attribute instance and yields EC-500, EC-501, and EC-502 rule violations.\n * @internal\n */\nexport async function* validateCustomAttributeInstance(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n yield* customAttributeNotOfConcreteClass(container, customAttribute);\n yield* customAttributeSchemaMustBeReferenced(container, customAttribute);\n yield* customAttributeClassMustExist(container, customAttribute);\n}\n\n/** EC Rule: CustomAttribute instance must be of a concrete CustomAttributeClass. */\nasync function* customAttributeNotOfConcreteClass(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n const schema = container.schema;\n const caClass = await schema.lookupItem(customAttribute.className) as ECClass;\n if (!caClass)\n return;\n\n if (caClass.modifier !== ECClassModifier.Abstract)\n return;\n\n yield new Diagnostics.CustomAttributeNotOfConcreteClass(container, [container.fullName, caClass.fullName]);\n}\n\n/** EC Rule: CustomAttribute Schema must be referenced by the container's Schema. */\nasync function* customAttributeSchemaMustBeReferenced(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n const schema = container.schema;\n const nameParts = customAttribute.className.split(\".\");\n if (nameParts.length === 1 || nameParts[0] === schema.name)\n return;\n\n if (schema.references.some((s) => s.name === nameParts[0]))\n return;\n\n yield new Diagnostics.CustomAttributeSchemaMustBeReferenced(container, [container.fullName, customAttribute.className]);\n}\n\n/** EC Rule: CustomAttribute instance class must exist. */\nasync function* customAttributeClassMustExist(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n const schema = container.schema;\n const caClass = await schema.lookupItem(customAttribute.className) as ECClass;\n if (!caClass)\n yield new Diagnostics.CustomAttributeClassNotFound(container, [container.fullName, customAttribute.className]);\n}\n\nasync function applyAbstractConstraintMustNarrowBaseConstraints(ecClass: RelationshipClass, constraint: RelationshipConstraint, baseRelationship: RelationshipClass): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\n const abstractConstraint = await constraint.abstractConstraint;\n if (!abstractConstraint)\n return;\n\n if (await baseConstraint.supportsClass(abstractConstraint))\n return;\n\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.AbstractConstraintMustNarrowBaseConstraints(ecClass, [abstractConstraint.fullName, constraintType, constraint.relationshipClass.fullName, baseRelationship.fullName]);\n}\n\nasync function applyDerivedConstraintsMustNarrowBaseConstraints(ecClass: RelationshipClass, constraint: RelationshipConstraint, baseRelationship: RelationshipClass): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\n\n if (!constraint.constraintClasses)\n return;\n\n for (const classPromise of constraint.constraintClasses) {\n const constraintClass = await classPromise;\n\n if (await baseConstraint.supportsClass(constraintClass))\n continue;\n\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.DerivedConstraintsMustNarrowBaseConstraints(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, baseRelationship.fullName]);\n }\n\n return;\n}\n\nasync function applyConstraintClassesDeriveFromAbstractContraint(ecClass: RelationshipClass, constraint: RelationshipConstraint): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\n const abstractConstraint = await getAbstractConstraint(constraint);\n if (!abstractConstraint)\n return;\n\n if (!constraint.constraintClasses)\n return;\n\n for (const classPromise of constraint.constraintClasses) {\n const constraintClass = await classPromise;\n\n if (constraintClass.schemaItemType === SchemaItemType.Mixin && abstractConstraint.schemaItemType === SchemaItemType.EntityClass) {\n if (!await (constraintClass).applicableTo(abstractConstraint as EntityClass)) {\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.ConstraintClassesDeriveFromAbstractContraint(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, abstractConstraint.fullName]);\n }\n continue;\n }\n\n if (!await constraintClass.is(abstractConstraint)) {\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.ConstraintClassesDeriveFromAbstractContraint(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, abstractConstraint.fullName]);\n }\n }\n\n return;\n}\n\nasync function getAbstractConstraint(constraint: RelationshipConstraint): Promise<ECClass | undefined> {\n const abstractConstraint = await constraint.abstractConstraint;\n if (abstractConstraint)\n return abstractConstraint;\n\n const baseRelationship = await constraint.relationshipClass.baseClass as RelationshipClass;\n if (!baseRelationship)\n return;\n\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\n\n return getAbstractConstraint(baseConstraint);\n}\n"]}
1
+ {"version":3,"file":"ECRules.js","sourceRoot":"","sources":["../../../src/Validation/ECRules.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAKkC;AAClC,6CAIsB;AAGtB,MAAM,WAAW,GAAG,WAAW,CAAC;AAEhC,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,GAAG,WAAW,IAAI,IAAI,EAAE,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,yDAAyD;AAC5C,QAAA,eAAe,GAAG;IAC7B,6BAA6B;IAC7B,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC,GAAG,CAAC;IACtC,uEAAuE;IACvE,gCAAgC,EAAE,OAAO,CAAC,GAAG,CAAC;IAE9C,oCAAoC;IACpC,iCAAiC,EAAE,OAAO,CAAC,GAAG,CAAC;IAC/C,qCAAqC,EAAE,OAAO,CAAC,GAAG,CAAC;IACnD,4BAA4B,EAAE,OAAO,CAAC,GAAG,CAAC;IAE1C,mCAAmC;IACnC,0BAA0B,EAAE,OAAO,CAAC,GAAG,CAAC;IAExC,+BAA+B;IAC/B,2CAA2C,EAAE,OAAO,CAAC,IAAI,CAAC;IAE1D,kCAAkC;IAClC,qCAAqC,EAAE,OAAO,CAAC,IAAI,CAAC;IACpD,gCAAgC,EAAE,OAAO,CAAC,IAAI,CAAC;IAC/C,gCAAgC,EAAE,OAAO,CAAC,IAAI,CAAC;IAE/C,sCAAsC;IACtC,2CAA2C,EAAE,OAAO,CAAC,IAAI,CAAC;IAC1D,2CAA2C,EAAE,OAAO,CAAC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,OAAO;AACT,CAAC;AAED,KAAK,UAAU,qBAAqB,CAAC,UAAkC;IACrE,MAAM,kBAAkB,GAAG,MAAM,UAAU,CAAC,kBAAkB,CAAC;IAC/D,IAAI,kBAAkB;QACpB,OAAO,kBAAkB,CAAC;IAE5B,MAAM,gBAAgB,GAAG,MAAM,UAAU,CAAC,iBAAiB,CAAC,SAA8B,CAAC;IAC3F,IAAI,CAAC,gBAAgB;QACnB,OAAO;IAET,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC;IAE/F,OAAO,qBAAqB,CAAC,cAAc,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Validation\n */\n\nimport {\n AnyClass, AnyProperty, CustomAttribute, CustomAttributeContainerProps, ECClass, ECClassModifier,\n ECStringConstants, EntityClass, Enumeration, PrimitiveProperty, PrimitiveType, primitiveTypeToString,\n Property, RelationshipClass, RelationshipConstraint, RelationshipMultiplicity, Schema, SchemaGraph, SchemaItemType,\n schemaItemTypeToString, StrengthDirection, strengthDirectionToString,\n} from \"@itwin/ecschema-metadata\";\nimport {\n ClassDiagnostic, createClassDiagnosticClass, createCustomAttributeContainerDiagnosticClass, createPropertyDiagnosticClass,\n createRelationshipConstraintDiagnosticClass, createSchemaDiagnosticClass, createSchemaItemDiagnosticClass, CustomAttributeContainerDiagnostic,\n PropertyDiagnostic, RelationshipConstraintDiagnostic, SchemaDiagnostic, SchemaItemDiagnostic,\n} from \"./Diagnostic\";\nimport { IRuleSet } from \"./Rules\";\n\nconst ruleSetName = \"ECObjects\";\n\nfunction getCode(code: number): string {\n return `${ruleSetName}-${code}`;\n}\n\n/**\n * The unique diagnostic codes for ECObjects rules.\n *\n * To provide meaning to code values, with anticipation\n * of future rules for all current EC Types, the following\n * value ranges should be used:\n *\n * - Schema: 000-099\n * - Class: 100-199\n * - Constant: 200-299\n * - CustomAttribute 300-399\n * - CustomAttributeClass: 400-499\n * - CustomAttributeContainer: 500-599\n * - EntityClass: 600-699\n * - Enumeration: 700-799\n * - Format: 800-899\n * - InvertedUnit: 900-999\n * - KindOfQuantity: 1000-1099\n * - Mixin: 1100-1199\n * - Phenomenon: 1200-1299\n * - Property: 1300-1399\n * - PropertyCategory: 1400-1499\n * - RelationshipClass: 1500-1599\n * - RelationshipConstraint: 1600-1699\n * - StructClass: 1700-1799\n * - Unit: 1800-1899\n * - UnitSystem: 1900-1999\n * @beta\n */\n/* eslint-disable @typescript-eslint/naming-convention */\nexport const DiagnosticCodes = {\n // Class Rule Codes (100-199)\n BaseClassIsSealed: getCode(100),\n BaseClassOfDifferentType: getCode(101),\n // EC-102 has been deprecated. Leaving the code here to prevent re-use.\n AbstractClassWithNonAbstractBase: getCode(102),\n\n // CA Container Rule Codes (500-599)\n CustomAttributeNotOfConcreteClass: getCode(500),\n CustomAttributeSchemaMustBeReferenced: getCode(501),\n CustomAttributeClassNotFound: getCode(502),\n\n // Enumeration Rule Codes (700-799)\n EnumerationTypeUnsupported: getCode(700),\n\n // Mixin Rule Codes (1100-1199)\n MixinAppliedToClassMustDeriveFromConstraint: getCode(1100),\n\n // Property Rule Codes (1300-1399)\n IncompatibleValueTypePropertyOverride: getCode(1300),\n IncompatibleTypePropertyOverride: getCode(1301),\n IncompatibleUnitPropertyOverride: getCode(1302),\n\n // Relationship Rule Codes (1500-1599)\n AbstractConstraintMustNarrowBaseConstraints: getCode(1500),\n DerivedConstraintsMustNarrowBaseConstraints: getCode(1501),\n ConstraintClassesDeriveFromAbstractConstraint: getCode(1502),\n\n // Relationship Constraint Rule Codes (1600-1699)\n AtLeastOneConstraintClassDefined: getCode(1600),\n AbstractConstraintMustExistWithMultipleConstraints: getCode(1601),\n};\n\n/**\n * The list of [[IDiagnostic]] implementation classes used by the EC rule implementations.\n * @beta\n */\nexport const Diagnostics = {\n /** EC-001: Required message parameters: schema name, referenced schema name */\n SupplementalSchemasCannotBeReferenced: createSchemaDiagnosticClass<[string, string]>(getCode(1),\n \"Referenced schema '{1}' of schema '{0}' is a supplemental schema. Supplemental schemas are not allowed to be referenced.\"),\n\n /** EC-002: Required message parameters: schema name, reference schema alias, first schema reference name, second schema reference name. */\n SchemaRefAliasMustBeUnique: createSchemaDiagnosticClass<[string, string, string, string]>(getCode(2),\n \"Schema '{0}' has multiple schema references ({2}, {3}) with the same alias '{1}', which is not allowed.\"),\n\n /** EC-003: Required message parameters: schema name, cycle text */\n ReferenceCyclesNotAllowed: createSchemaDiagnosticClass<[string, string]>(getCode(3),\n \"Schema '{0}' has reference cycles: {1}\"),\n\n /** EC-100: Required message parameters: childClass.FullName, baseClass.FullName */\n BaseClassIsSealed: createClassDiagnosticClass<[string, string]>(DiagnosticCodes.BaseClassIsSealed,\n \"Class '{0}' cannot derive from sealed base class '{1}'.\"),\n\n /** EC-101: Required message parameters: childClass.FullName, baseClass.FullName, baseClass.schemaItemType */\n BaseClassIsOfDifferentType: createClassDiagnosticClass<[string, string, string]>(DiagnosticCodes.BaseClassOfDifferentType,\n \"Class '{0}' cannot derive from base class '{1}' of type '{2}'.\"),\n\n /** **DEPRECATED** EC-102: Required message parameters: childClass.FullName, baseClass.FullName */\n AbstractClassWithNonAbstractBase: createClassDiagnosticClass<[string, string]>(DiagnosticCodes.AbstractClassWithNonAbstractBase,\n \"Abstract Class '{0}' cannot derive from base class '{1}' because it is not an abstract class.\"),\n\n /** EC-500: Required message parameters: CustomAttribute container name and CustomAttributeClass name. */\n CustomAttributeNotOfConcreteClass: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeNotOfConcreteClass,\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' which is not a concrete class.\"),\n\n /** EC-501: Required message parameters: CustomAttribute container name, CustomAttributeClass name, CustomAttributeClass Schema name. */\n CustomAttributeSchemaMustBeReferenced: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeSchemaMustBeReferenced,\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' whose schema is not referenced by the container's Schema.\"),\n\n /** EC-502: Required message parameters: CustomAttribute container name and CustomAttributeClass name. */\n CustomAttributeClassNotFound: createCustomAttributeContainerDiagnosticClass<[string, string]>(DiagnosticCodes.CustomAttributeClassNotFound,\n \"The CustomAttribute container '{0}' has a CustomAttribute with the class '{1}' which cannot be found.\"),\n\n /** EC-700: Required message parameters: Enumeration name */\n EnumerationTypeUnsupported: createSchemaItemDiagnosticClass<Enumeration, [string]>(DiagnosticCodes.EnumerationTypeUnsupported,\n \"Enumeration '{0}' has invalid primitive type.\"),\n\n /** EC-1100: Required message parameters: mixin class fullName, class fullName, applies to constraint class fullName */\n MixinAppliedToClassMustDeriveFromConstraint: createSchemaItemDiagnosticClass<EntityClass, [string, string, string]>(DiagnosticCodes.MixinAppliedToClassMustDeriveFromConstraint,\n \"Mixin '{0}' cannot be applied to the class '{1}' because it does not satisfy the applies to constraint '{2}'.\"),\n\n /** EC-1300: Required message parameters: childClass.FullName, property name, baseClass.FullName, base value type, child value type */\n IncompatibleValueTypePropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string]>(DiagnosticCodes.IncompatibleValueTypePropertyOverride,\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with a value type of {3} which is incompatible with the value type of {4}.\"),\n\n /** EC-1301: Required message parameters: childClass.FullName, property name, baseClass.FullName, base property type, child property type */\n IncompatibleTypePropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string]>(DiagnosticCodes.IncompatibleTypePropertyOverride,\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with a type of {3} which is incompatible with the type of {4}.\"),\n\n /** EC-1302: Required message parameters: childClass.Name, property name, baseClass.Name, baseClass Koq name, baseClass Koq persistence unit name, child class Koq persistence unit name, child class Koq name */\n IncompatibleUnitPropertyOverride: createPropertyDiagnosticClass<[string, string, string, string, string, string, string]>(DiagnosticCodes.IncompatibleUnitPropertyOverride,\n \"The ECProperty '{0}.{1}' has a base property '{2}.{1}' with KindOfQuantity '{3}' with persistence unit '{4}' which is not the same as the persistence unit '{5}' of the provided KindOfQuantity '{6}'.\"),\n\n /** EC-1303: Required message parameters: property.fullName, navigation relationship.fullName */\n NavigationRelationshipMustBeRoot: createPropertyDiagnosticClass<[string, string]>(getCode(1303),\n \"The referenced relationship '{1}', used in NavigationProperty '{0}' is not the root relationship.\"),\n\n /** EC-1304: Required message parameters: property.fullName, navigation relationship.fullName */\n NavigationTargetMustHaveSingularMultiplicity: createPropertyDiagnosticClass<[string, string, string]>(getCode(1304),\n \"NavigationProperty '{0}' uses the relationship '{1}' that cannot be traversed in the '{2}' direction due to a max multiplicity greater than 1.\"),\n\n /** EC-1305: Required message parameters: property.fullName, navigation relationship.fullName */\n NavigationRelationshipAbstractConstraintEntityOrMixin: createPropertyDiagnosticClass<[string, string]>(getCode(1305),\n \"The NavigationProperty '{0}', using the relationship '{1}', points to a RelationshipClass, which is not allowed. NavigationProperties must point to an EntityClass or Mixin.\"),\n\n /** EC-1306: Required message parameters: class name, property name, navigation relationship.fullName */\n NavigationClassMustBeAConstraintClassOfRelationship: createPropertyDiagnosticClass<[string, string, string, string]>(getCode(1306),\n \"The class '{0}' of NavigationProperty '{1}' is not supported by the {3} constraint of the referenced relationship '{2}'.\"),\n\n /** EC-1500: Required message parameters: abstract constraint class name, relationship end (source/target), relationship name, base relationship name */\n AbstractConstraintMustNarrowBaseConstraints: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.AbstractConstraintMustNarrowBaseConstraints,\n \"The abstract constraint class '{0}' on the {1}-Constraint of '{2}' is not supported by the base class constraint in '{3}'.\"),\n\n /** EC-1501: Required message parameters: constraint class name, relationship end (source/target), relationship name, base relationship name */\n DerivedConstraintsMustNarrowBaseConstraints: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.DerivedConstraintsMustNarrowBaseConstraints,\n \"The constraint class '{0}' on the {1}-Constraint of '{2}' is not supported by the base class constraint in '{3}'.\"),\n\n /** EC-1502: Required message parameters: constraint class name, relationship end (source/target), relationship name, abstract constraint class name */\n ConstraintClassesDeriveFromAbstractConstraint: createSchemaItemDiagnosticClass<RelationshipClass, [string, string, string, string]>(DiagnosticCodes.ConstraintClassesDeriveFromAbstractConstraint,\n \"The constraint class '{0}' on the {1}-Constraint of '{2}' is not derived from the abstract constraint class '{3}'.\"),\n\n /** EC-1600: Required message parameters: relationship end (source/target), relationship name */\n AtLeastOneConstraintClassDefined: createRelationshipConstraintDiagnosticClass<[string, string]>(DiagnosticCodes.AtLeastOneConstraintClassDefined,\n \"The {0}-Constraint of '{1}' does not contain any constraint classes.\"),\n\n /** EC-1601: Required message parameters: relationship end (source/target), relationship name */\n AbstractConstraintMustExistWithMultipleConstraints: createRelationshipConstraintDiagnosticClass<[string, string]>(DiagnosticCodes.AbstractConstraintMustExistWithMultipleConstraints,\n \"The {0}-Constraint of '{1}' has multiple constraint classes which requires an abstract constraint to be defined.\"),\n};\n\n/**\n * All schema validation rules that fall under the category of ECObjects.\n * @beta\n */\nexport const ECRuleSet: IRuleSet = {\n name: ruleSetName,\n\n schemaRules: [\n validateSchemaReferences,\n ],\n classRules: [\n baseClassIsSealed,\n baseClassIsOfDifferentType,\n ],\n propertyRules: [\n incompatibleValueTypePropertyOverride,\n incompatibleTypePropertyOverride,\n incompatibleUnitPropertyOverride,\n validateNavigationProperty,\n ],\n relationshipRules: [\n abstractConstraintMustNarrowBaseConstraints,\n constraintClassesDeriveFromAbstractConstraint,\n derivedConstraintsMustNarrowBaseConstraints,\n ],\n relationshipConstraintRules: [\n atLeastOneConstraintClassDefined,\n abstractConstraintMustExistWithMultipleConstraints,\n ],\n enumerationRules: [\n enumerationTypeUnsupported,\n ],\n entityClassRules: [\n mixinAppliedToClassMustDeriveFromConstraint,\n ],\n customAttributeInstanceRules: [\n validateCustomAttributeInstance,\n ],\n};\n\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/**\n * Validates schema references against multiple EC rules.\n * @param schema The schema to validate.\n * @internal\n */\nexport async function* validateSchemaReferences(schema: Schema): AsyncIterable<SchemaDiagnostic<any[]>> {\n yield* validateSchemaReferencesSync(schema);\n}\n\n/**\n * Validates schema references against multiple EC rules.\n * @param schema The schema to validate.\n * @internal\n */\nexport function* validateSchemaReferencesSync(schema: Schema): Iterable<SchemaDiagnostic<any[]>> {\n const aliases = new Map();\n for (const schemaRef of schema.references) {\n if (schemaRef.customAttributes && schemaRef.customAttributes.has(\"CoreCustomAttributes.SupplementalSchema\"))\n yield new Diagnostics.SupplementalSchemasCannotBeReferenced(schema, [schema.name, schemaRef.name]);\n\n if (schema.schemaKey.matches(schemaRef.schemaKey))\n yield new Diagnostics.ReferenceCyclesNotAllowed(schema, [schema.name, `${schema.name} --> ${schemaRef.name}`]);\n\n if (aliases.has(schemaRef.alias)) {\n const currentRef = aliases.get(schemaRef.alias);\n yield new Diagnostics.SchemaRefAliasMustBeUnique(schema, [schema.name, schemaRef.alias, currentRef.name, schemaRef.name]);\n } else {\n aliases.set(schemaRef.alias, schemaRef);\n }\n }\n\n const graph = SchemaGraph.generateGraphSync(schema);\n const cycles = graph.detectCycles();\n if (cycles) {\n const result = cycles.map((cycle) => `${cycle.schema.schemaKey.name} --> ${cycle.refSchema.schemaKey.name}`).join(\", \");\n yield new Diagnostics.ReferenceCyclesNotAllowed(schema, [schema.name, result]);\n }\n}\n/**\n * EC Rule: Sealed classes cannot be a base class.\n * @internal\n */\nexport async function* baseClassIsSealed(ecClass: AnyClass): AsyncIterable<ClassDiagnostic<any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseClass = await ecClass.baseClass;\n // return if rule passed\n if (baseClass.modifier !== ECClassModifier.Sealed)\n return;\n\n yield new Diagnostics.BaseClassIsSealed(ecClass, [ecClass.fullName, baseClass.fullName]);\n}\n\n/**\n * EC Rule: Base and child class must be of the same type (i.e. Entity, Mixin, Relationship, etc.)\n * @internal\n */\nexport async function* baseClassIsOfDifferentType(ecClass: AnyClass): AsyncIterable<ClassDiagnostic<any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseClass = await ecClass.baseClass;\n // return if rule passed\n if (baseClass.schemaItemType === ecClass.schemaItemType)\n return;\n\n const itemType = schemaItemTypeToString(baseClass.schemaItemType);\n yield new Diagnostics.BaseClassIsOfDifferentType(ecClass, [ecClass.fullName, baseClass.fullName, itemType]);\n}\n\n/**\n * EC Rule: When overriding a class primitive property, the child and base property must be of the same type (string, number, etc...).\n * @internal\n*/\nexport async function* incompatibleValueTypePropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.class.baseClass)\n return;\n\n const primitiveType = getPrimitiveType(property);\n if (!primitiveType)\n return;\n\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\n const baseProperty = await baseClass.getProperty(property.name);\n if (!baseProperty)\n return;\n\n // Other rules will catch this if false, but we need to make sure\n // types match for this rule to be valid.\n if (!propertyTypesMatch(property, baseProperty))\n return;\n\n const baseType = getPrimitiveType(baseProperty);\n\n // Return if rule passed\n if (!baseType || primitiveType === baseType)\n return;\n\n return new Diagnostics.IncompatibleValueTypePropertyOverride(property, [property.class.fullName, property.name, baseClass.fullName, primitiveTypeToString(baseType), primitiveTypeToString(primitiveType!)]);\n }\n\n for await (const baseClass of property.class.getAllBaseClasses()) {\n const result = await callback(baseClass);\n if (result)\n yield result;\n }\n}\n\n/**\n * EC Rule: When overriding a class property, the child and base property must be of the same property type (primitive, struct, enumeration, etc...).\n * @internal\n */\nexport async function* incompatibleTypePropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.class.baseClass)\n return;\n\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\n const baseProperty = await baseClass.getProperty(property.name);\n if (!baseProperty)\n return;\n\n // Return if rule passed\n if (propertyTypesMatch(property, baseProperty))\n return;\n\n return new Diagnostics.IncompatibleTypePropertyOverride(property, [property.class.fullName, property.name, baseClass.fullName, baseProperty.constructor.name, property.constructor.name]);\n }\n\n for await (const baseClass of property.class.getAllBaseClasses()) {\n const result = await callback(baseClass);\n if (result)\n yield result;\n }\n}\n\n/**\n * EC Rule: When overriding a kindOfQuantity property, the child and base property units must be the same.\n * @internal\n */\nexport async function* incompatibleUnitPropertyOverride(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.kindOfQuantity || !property.class.baseClass)\n return;\n\n async function callback(baseClass: ECClass): Promise<PropertyDiagnostic<any[]> | undefined> {\n const baseProperty = await baseClass.getProperty(property.name);\n if (!baseProperty || !baseProperty.kindOfQuantity)\n return;\n\n // Other rules will catch this if false, but we need to make sure\n // types match for this rule to be valid.\n if (!propertyTypesMatch(property, baseProperty))\n return;\n\n const koq = await property.kindOfQuantity;\n const baseKoq = await baseProperty.kindOfQuantity;\n if (!koq || !baseKoq)\n return;\n\n const unit = await koq.persistenceUnit;\n const baseUnit = await baseKoq.persistenceUnit;\n\n if (!unit || !baseUnit)\n return;\n\n // return if rule passed\n if (unit.key.matches(baseUnit.key))\n return;\n\n return new Diagnostics.IncompatibleUnitPropertyOverride(property, [\n property.class.fullName,\n property.name,\n baseClass.fullName,\n baseKoq.fullName,\n baseUnit.fullName,\n unit.fullName,\n koq.fullName,\n ]);\n }\n\n for await (const baseClass of property.class.getAllBaseClasses()) {\n const result = await callback(baseClass);\n if (result)\n yield result;\n }\n}\n\n/**\n * Validates Navigation Properties. EC Rules: 1303, 1304\n * @internal\n */\nexport async function* validateNavigationProperty(property: AnyProperty): AsyncIterable<PropertyDiagnostic<any[]>> {\n if (!property.isNavigation())\n return;\n\n const navProp = property;\n const relationship = await navProp.relationshipClass;\n\n if (relationship.baseClass)\n yield new Diagnostics.NavigationRelationshipMustBeRoot(property, [property.fullName, relationship.fullName]);\n\n let thisConstraint: RelationshipConstraint;\n let thatConstraint: RelationshipConstraint;\n let navigationClassSide: string;\n if (navProp.direction === StrengthDirection.Forward) {\n thisConstraint = relationship.source;\n thatConstraint = relationship.target;\n navigationClassSide = \"source\";\n } else {\n thisConstraint = relationship.target;\n thatConstraint = relationship.source;\n navigationClassSide = \"target\";\n }\n\n const thatAbstractConstraint = await thatConstraint.abstractConstraint;\n if (thatAbstractConstraint && thatAbstractConstraint.schemaItemType === SchemaItemType.RelationshipClass) {\n yield new Diagnostics.NavigationRelationshipAbstractConstraintEntityOrMixin(property, [property.fullName, relationship.fullName]);\n }\n\n const isClassSupported = async (ecClass: ECClass, propertyName: string, constraintName: string): Promise<boolean> => {\n if (constraintName === ecClass.fullName && undefined !== await ecClass.getProperty(propertyName))\n return true;\n\n const inheritedProp = await ecClass.getInheritedProperty(propertyName);\n if (inheritedProp && constraintName === inheritedProp.class.fullName)\n return true;\n\n const baseClass = await ecClass.baseClass;\n if (!baseClass)\n return false;\n\n return isClassSupported(baseClass, propertyName, constraintName);\n };\n\n let classSupported = false;\n if (thisConstraint.constraintClasses) {\n for (const constraintClass of thisConstraint.constraintClasses) {\n classSupported = await isClassSupported(property.class, property.name, constraintClass.fullName);\n if (classSupported)\n break;\n }\n }\n\n if (!classSupported)\n yield new Diagnostics.NavigationClassMustBeAConstraintClassOfRelationship(property, [property.class.name, property.name, relationship.fullName, navigationClassSide]);\n\n if (thatConstraint.multiplicity === RelationshipMultiplicity.oneMany || thatConstraint.multiplicity === RelationshipMultiplicity.zeroMany) {\n const direction = strengthDirectionToString(navProp.direction);\n yield new Diagnostics.NavigationTargetMustHaveSingularMultiplicity(property, [property.fullName, relationship.fullName, direction]);\n }\n\n return;\n}\n\n/**\n * Validates a Relationship class and yields EC-1500, EC-1501, and EC-1502 rule violations.\n * @internal\n */\nexport async function* validateRelationship(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\n yield* abstractConstraintMustNarrowBaseConstraints(ecClass);\n yield* derivedConstraintsMustNarrowBaseConstraints(ecClass);\n yield* constraintClassesDeriveFromAbstractConstraint(ecClass);\n}\n\n/**\n * EC Rule: When overriding a RelationshipClass, the derived abstract constraint must narrow the base constraint classes.\n * @internal\n */\nexport async function* abstractConstraintMustNarrowBaseConstraints(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseRelationship = await ecClass.baseClass as RelationshipClass;\n\n const sourceResult = await applyAbstractConstraintMustNarrowBaseConstraints(ecClass, ecClass.source, baseRelationship);\n if (sourceResult)\n yield sourceResult;\n const targetResult = await applyAbstractConstraintMustNarrowBaseConstraints(ecClass, ecClass.target, baseRelationship);\n if (targetResult)\n yield targetResult;\n}\n\n/**\n * EC Rule: When overriding a RelationshipClass, derived constraint classes must narrow base constraint classes.\n * @internal\n */\nexport async function* derivedConstraintsMustNarrowBaseConstraints(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\n if (!ecClass.baseClass)\n return;\n\n const baseRelationship = await ecClass.baseClass as RelationshipClass;\n\n const sourceResult = await applyDerivedConstraintsMustNarrowBaseConstraints(ecClass, ecClass.source, baseRelationship);\n if (sourceResult)\n yield sourceResult;\n const targetResult = await applyDerivedConstraintsMustNarrowBaseConstraints(ecClass, ecClass.target, baseRelationship);\n if (targetResult)\n yield targetResult;\n}\n\n/**\n * EC Rule: All constraint classes must have a common base class specified in the abstract constraint.\n * @internal\n */\nexport async function* constraintClassesDeriveFromAbstractConstraint(ecClass: RelationshipClass): AsyncIterable<SchemaItemDiagnostic<RelationshipClass, any[]>> {\n const sourceResult = await applyConstraintClassesDeriveFromAbstractConstraint(ecClass, ecClass.source);\n if (sourceResult)\n yield sourceResult;\n const targetResult = await applyConstraintClassesDeriveFromAbstractConstraint(ecClass, ecClass.target);\n if (targetResult)\n yield targetResult;\n}\n\n/**\n * Validates a RelationshipConstraint and yields EC-1600 and EC-1601 rule violations.\n * @internal\n */\nexport async function* validateRelationshipConstraint(constraint: RelationshipConstraint): AsyncIterable<RelationshipConstraintDiagnostic<any[]>> {\n yield* atLeastOneConstraintClassDefined(constraint);\n yield* abstractConstraintMustExistWithMultipleConstraints(constraint);\n}\n\n/**\n * EC Rule: At least on concrete constraint class must be defined in the list of constraint classes.\n * @internal\n */\nexport async function* atLeastOneConstraintClassDefined(constraint: RelationshipConstraint): AsyncIterable<RelationshipConstraintDiagnostic<any[]>> {\n if (!constraint.constraintClasses || constraint.constraintClasses.length === 0) {\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n yield new Diagnostics.AtLeastOneConstraintClassDefined(constraint, [constraintType, constraint.relationshipClass.fullName]);\n }\n}\n\n/**\n * EC Rule: If multiple constraints exist, an abstract constraint must be defined.\n * @internal\n */\nexport async function* abstractConstraintMustExistWithMultipleConstraints(constraint: RelationshipConstraint): AsyncIterable<RelationshipConstraintDiagnostic<any[]>> {\n if (!constraint.constraintClasses || constraint.constraintClasses.length <= 1) {\n return;\n }\n\n const abstractConstraint = await getAbstractConstraint(constraint);\n if (abstractConstraint)\n return;\n\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n yield new Diagnostics.AbstractConstraintMustExistWithMultipleConstraints(constraint, [constraintType, constraint.relationshipClass.fullName]);\n}\n\nfunction propertyTypesMatch(propertyA: Property, propertyB: Property) {\n return propertyA.constructor.name === propertyB.constructor.name;\n}\n\nfunction getPrimitiveType(property: Property): PrimitiveType | undefined {\n if (property.isPrimitive())\n return (property as PrimitiveProperty).primitiveType;\n\n return undefined;\n}\n\n/**\n * EC Rule: Enumeration type must be a string or integer\n * @internal\n */\nexport async function* enumerationTypeUnsupported(enumeration: Enumeration): AsyncIterable<SchemaItemDiagnostic<Enumeration, any[]>> {\n const type = enumeration.type;\n if (type === PrimitiveType.Integer || type === PrimitiveType.String)\n return;\n\n yield new Diagnostics.EnumerationTypeUnsupported(enumeration, [enumeration.fullName]);\n}\n\n/**\n * EC Rule: Mixin applied to class must derived from the Mixin appliesTo constraint.\n * @internal\n */\nexport async function* mixinAppliedToClassMustDeriveFromConstraint(entityClass: EntityClass): AsyncIterable<SchemaItemDiagnostic<EntityClass, any[]>> {\n for (const lazyMixin of entityClass.mixins) {\n const mixin = await lazyMixin;\n if (!mixin.appliesTo)\n continue;\n\n if (!await entityClass.is(await mixin.appliesTo))\n yield new Diagnostics.MixinAppliedToClassMustDeriveFromConstraint(entityClass, [mixin.fullName, entityClass.fullName, mixin.appliesTo.fullName]);\n }\n\n return;\n}\n\n/**\n * Validates a custom attribute instance and yields EC-500, EC-501, and EC-502 rule violations.\n * @internal\n */\nexport async function* validateCustomAttributeInstance(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n yield* customAttributeNotOfConcreteClass(container, customAttribute);\n yield* customAttributeSchemaMustBeReferenced(container, customAttribute);\n yield* customAttributeClassMustExist(container, customAttribute);\n}\n\n/** EC Rule: CustomAttribute instance must be of a concrete CustomAttributeClass. */\nasync function* customAttributeNotOfConcreteClass(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n const schema = container.schema;\n const caClass = await schema.lookupItem(customAttribute.className) as ECClass;\n if (!caClass)\n return;\n\n if (caClass.modifier !== ECClassModifier.Abstract)\n return;\n\n yield new Diagnostics.CustomAttributeNotOfConcreteClass(container, [container.fullName, caClass.fullName]);\n}\n\n/** EC Rule: CustomAttribute Schema must be referenced by the container's Schema. */\nasync function* customAttributeSchemaMustBeReferenced(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n const schema = container.schema;\n const nameParts = customAttribute.className.split(\".\");\n if (nameParts.length === 1 || nameParts[0] === schema.name)\n return;\n\n if (schema.references.some((s) => s.name === nameParts[0]))\n return;\n\n yield new Diagnostics.CustomAttributeSchemaMustBeReferenced(container, [container.fullName, customAttribute.className]);\n}\n\n/** EC Rule: CustomAttribute instance class must exist. */\nasync function* customAttributeClassMustExist(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): AsyncIterable<CustomAttributeContainerDiagnostic<any[]>> {\n const schema = container.schema;\n const caClass = await schema.lookupItem(customAttribute.className) as ECClass;\n if (!caClass)\n yield new Diagnostics.CustomAttributeClassNotFound(container, [container.fullName, customAttribute.className]);\n}\n\nasync function applyAbstractConstraintMustNarrowBaseConstraints(ecClass: RelationshipClass, constraint: RelationshipConstraint, baseRelationship: RelationshipClass): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\n const abstractConstraint = await constraint.abstractConstraint;\n if (!abstractConstraint)\n return;\n\n if (await baseConstraint.supportsClass(abstractConstraint))\n return;\n\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.AbstractConstraintMustNarrowBaseConstraints(ecClass, [abstractConstraint.fullName, constraintType, constraint.relationshipClass.fullName, baseRelationship.fullName]);\n}\n\nasync function applyDerivedConstraintsMustNarrowBaseConstraints(ecClass: RelationshipClass, constraint: RelationshipConstraint, baseRelationship: RelationshipClass): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\n\n if (!constraint.constraintClasses)\n return;\n\n for (const classPromise of constraint.constraintClasses) {\n const constraintClass = await classPromise;\n\n if (await baseConstraint.supportsClass(constraintClass))\n continue;\n\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.DerivedConstraintsMustNarrowBaseConstraints(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, baseRelationship.fullName]);\n }\n\n return;\n}\n\nasync function applyConstraintClassesDeriveFromAbstractConstraint(ecClass: RelationshipClass, constraint: RelationshipConstraint): Promise<SchemaItemDiagnostic<RelationshipClass, any[]> | undefined> {\n const abstractConstraint = await getAbstractConstraint(constraint);\n if (!abstractConstraint)\n return;\n\n if (!constraint.constraintClasses)\n return;\n\n for (const classPromise of constraint.constraintClasses) {\n const constraintClass = await classPromise;\n\n if (constraintClass.schemaItemType === SchemaItemType.Mixin && abstractConstraint.schemaItemType === SchemaItemType.EntityClass) {\n if (!await (constraintClass).applicableTo(abstractConstraint as EntityClass)) {\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.ConstraintClassesDeriveFromAbstractConstraint(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, abstractConstraint.fullName]);\n }\n continue;\n }\n\n if (!await constraintClass.is(abstractConstraint)) {\n const constraintType = constraint.isSource ? ECStringConstants.RELATIONSHIP_END_SOURCE : ECStringConstants.RELATIONSHIP_END_TARGET;\n return new Diagnostics.ConstraintClassesDeriveFromAbstractConstraint(ecClass, [constraintClass.fullName, constraintType, constraint.relationshipClass.fullName, abstractConstraint.fullName]);\n }\n }\n\n return;\n}\n\nasync function getAbstractConstraint(constraint: RelationshipConstraint): Promise<ECClass | undefined> {\n const abstractConstraint = await constraint.abstractConstraint;\n if (abstractConstraint)\n return abstractConstraint;\n\n const baseRelationship = await constraint.relationshipClass.baseClass as RelationshipClass;\n if (!baseRelationship)\n return;\n\n const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;\n\n return getAbstractConstraint(baseConstraint);\n}\n"]}
@@ -11,7 +11,7 @@ import { ISchemaCompareReporter } from "./SchemaCompareReporter";
11
11
  export declare class SchemaCompareResultDelegate {
12
12
  private _schemaChangeReporters;
13
13
  private _schemaAChanges;
14
- private _schemaBChanges?;
14
+ private _schemaBChanges;
15
15
  /**
16
16
  * Initializes a new SchemaCompareResultDelegate instance.
17
17
  * @param reporters The [[ISchemaCompareReporter]] objects to use to report schema differences.
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaCompareResultDelegate.d.ts","sourceRoot":"","sources":["../../../src/Validation/SchemaCompareResultDelegate.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EACtE,oBAAoB,EAAE,6BAA6B,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EACnH,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,sBAAsB,EAC9F,MAAM,EAAE,UAAU,EAAE,IAAI,EACzB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;;GAGG;AACH,qBAAa,2BAA2B;IACtC,OAAO,CAAC,sBAAsB,CAA2B;IACzD,OAAO,CAAC,eAAe,CAAgB;IACvC,OAAO,CAAC,eAAe,CAAC,CAAgB;IAExC;;;OAGG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,sBAAsB,EAAE;IAQpF,IAAW,qBAAqB,IAAI,sBAAsB,EAAE,CAE3D;IAED;;OAEG;IACI,eAAe;IAMtB;;;;;;OAMG;IACU,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzJ;;;;OAIG;IACU,4BA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,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,iBAAiB,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvM;;;;;;OAMG;IACU,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnJ;;;;;;OAMG;IACU,uBAAuB,CAAC,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3K;;;;;;OAMG;IACU,qBAAqB,CAAC,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrK;;;;;;OAMG;IACU,mBAAmB,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;YAKjJ,gBAAgB;CAU/B"}
@@ -21,10 +21,8 @@ class SchemaCompareResultDelegate {
21
21
  */
22
22
  constructor(schemaA, schemaB, ...reporters) {
23
23
  this._schemaChangeReporters = reporters;
24
- const keyMismatch = !schemaA.schemaKey.matches(schemaB.schemaKey);
25
24
  this._schemaAChanges = new SchemaChanges_1.SchemaChanges(schemaA);
26
- if (keyMismatch)
27
- this._schemaBChanges = new SchemaChanges_1.SchemaChanges(schemaB);
25
+ this._schemaBChanges = new SchemaChanges_1.SchemaChanges(schemaB);
28
26
  }
29
27
  get schemaChangeReporters() {
30
28
  return this._schemaChangeReporters;
@@ -335,7 +333,7 @@ class SchemaCompareResultDelegate {
335
333
  await this.reportDiagnostic(diag);
336
334
  }
337
335
  async reportDiagnostic(diagnostic) {
338
- if (!this._schemaBChanges || this._schemaAChanges.schema === diagnostic.schema) {
336
+ if (this._schemaAChanges.schema === diagnostic.schema) {
339
337
  this._schemaAChanges.addDiagnostic(diagnostic);
340
338
  return;
341
339
  }
@@ -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,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAClE,IAAI,CAAC,eAAe,GAAG,IAAI,6BAAa,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,WAAW;YACb,IAAI,CAAC,eAAe,GAAG,IAAI,6BAAa,CAAC,OAAO,CAAC,CAAC;IACtD,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,C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AAC,eAAe,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC/C,OAAO;SACR;IACH,CAAC;CACF;AA9WD,kEA8WC","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 const keyMismatch = !schemaA.schemaKey.matches(schemaB.schemaKey);\n this._schemaAChanges = new SchemaChanges(schemaA);\n if (keyMismatch)\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._schemaBChanges || 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
+ {"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,CAAC;IAC9E,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,iBAAiB,CAAC,OAAe,EAAE,YAAoB,EAAE,MAAW,EAAE,MAAW,EAAE,iBAAyC;QACvI,MAAM,IAAI,GAAG,IAAI,mDAAwB,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAC/F,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,4BAA4B,CAAC,OAAe,EAAE,eAAuB,EAA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,mDAAwB,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QACvG,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,mBAAmB,CAAC,SAAmB,EAAE,YAAoB,EAAE,MAAW,EAAE,MAAW,EAAE,iBAAyC;QAC7I,MAAM,IAAI,GAAG,IAAI,mDAAwB,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QACnG,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;YACrD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC/C,OAAO;SACR;QACD,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,EAAE;YACrD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC/C,OAAO;SACR;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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/ecschema-editing",
3
- "version": "4.4.0-dev.8",
3
+ "version": "4.5.0-dev.0",
4
4
  "description": "ECSchema editing and validation API",
5
5
  "license": "MIT",
6
6
  "main": "lib/cjs/ecschema-editing.js",
@@ -42,16 +42,16 @@
42
42
  "rimraf": "^3.0.2",
43
43
  "sinon": "^17.0.1",
44
44
  "typescript": "~5.0.2",
45
- "@itwin/core-quantity": "4.4.0-dev.8",
46
- "@itwin/build-tools": "4.4.0-dev.8",
47
- "@itwin/core-bentley": "4.4.0-dev.8",
48
- "@itwin/core-common": "4.4.0-dev.8",
49
- "@itwin/ecschema-metadata": "4.4.0-dev.8"
45
+ "@itwin/build-tools": "4.5.0-dev.0",
46
+ "@itwin/core-bentley": "4.5.0-dev.0",
47
+ "@itwin/core-common": "4.5.0-dev.0",
48
+ "@itwin/ecschema-metadata": "4.5.0-dev.0",
49
+ "@itwin/core-quantity": "4.5.0-dev.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "@itwin/core-bentley": "^4.4.0-dev.8",
53
- "@itwin/core-quantity": "^4.4.0-dev.8",
54
- "@itwin/ecschema-metadata": "^4.4.0-dev.8"
52
+ "@itwin/core-bentley": "^4.5.0-dev.0",
53
+ "@itwin/core-quantity": "^4.5.0-dev.0",
54
+ "@itwin/ecschema-metadata": "^4.5.0-dev.0"
55
55
  },
56
56
  "nyc": {
57
57
  "extends": "./node_modules/@itwin/build-tools/.nycrc"