@itwin/ecschema-metadata 5.0.0-dev.59 → 5.0.0-dev.61

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 (209) hide show
  1. package/lib/cjs/Context.d.ts +36 -15
  2. package/lib/cjs/Context.d.ts.map +1 -1
  3. package/lib/cjs/Context.js +10 -18
  4. package/lib/cjs/Context.js.map +1 -1
  5. package/lib/cjs/Deserialization/Helper.d.ts +3 -3
  6. package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
  7. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  8. package/lib/cjs/Deserialization/XmlParser.js +2 -1
  9. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  10. package/lib/cjs/ECObjects.d.ts +21 -1
  11. package/lib/cjs/ECObjects.d.ts.map +1 -1
  12. package/lib/cjs/ECObjects.js +34 -2
  13. package/lib/cjs/ECObjects.js.map +1 -1
  14. package/lib/cjs/Interfaces.d.ts +7 -0
  15. package/lib/cjs/Interfaces.d.ts.map +1 -1
  16. package/lib/cjs/Interfaces.js.map +1 -1
  17. package/lib/cjs/Metadata/Class.d.ts +24 -2
  18. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  19. package/lib/cjs/Metadata/Class.js +40 -10
  20. package/lib/cjs/Metadata/Class.js.map +1 -1
  21. package/lib/cjs/Metadata/Constant.d.ts +14 -1
  22. package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
  23. package/lib/cjs/Metadata/Constant.js +23 -2
  24. package/lib/cjs/Metadata/Constant.js.map +1 -1
  25. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +15 -1
  26. package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
  27. package/lib/cjs/Metadata/CustomAttributeClass.js +21 -1
  28. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  29. package/lib/cjs/Metadata/EntityClass.d.ts +17 -3
  30. package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
  31. package/lib/cjs/Metadata/EntityClass.js +28 -6
  32. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  33. package/lib/cjs/Metadata/Enumeration.d.ts +14 -1
  34. package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
  35. package/lib/cjs/Metadata/Enumeration.js +19 -1
  36. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  37. package/lib/cjs/Metadata/Format.d.ts +13 -1
  38. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  39. package/lib/cjs/Metadata/Format.js +24 -3
  40. package/lib/cjs/Metadata/Format.js.map +1 -1
  41. package/lib/cjs/Metadata/InvertedUnit.d.ts +8 -1
  42. package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
  43. package/lib/cjs/Metadata/InvertedUnit.js +15 -3
  44. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  45. package/lib/cjs/Metadata/KindOfQuantity.d.ts +14 -1
  46. package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
  47. package/lib/cjs/Metadata/KindOfQuantity.js +40 -13
  48. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  49. package/lib/cjs/Metadata/Mixin.d.ts +15 -1
  50. package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
  51. package/lib/cjs/Metadata/Mixin.js +22 -2
  52. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  53. package/lib/cjs/Metadata/Phenomenon.d.ts +14 -1
  54. package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
  55. package/lib/cjs/Metadata/Phenomenon.js +21 -1
  56. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  57. package/lib/cjs/Metadata/Property.d.ts +1 -1
  58. package/lib/cjs/Metadata/Property.d.ts.map +1 -1
  59. package/lib/cjs/Metadata/Property.js +11 -6
  60. package/lib/cjs/Metadata/Property.js.map +1 -1
  61. package/lib/cjs/Metadata/PropertyCategory.d.ts +14 -1
  62. package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
  63. package/lib/cjs/Metadata/PropertyCategory.js +20 -1
  64. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  65. package/lib/cjs/Metadata/RelationshipClass.d.ts +15 -1
  66. package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
  67. package/lib/cjs/Metadata/RelationshipClass.js +29 -6
  68. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  69. package/lib/cjs/Metadata/Schema.d.ts +114 -6
  70. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  71. package/lib/cjs/Metadata/Schema.js +125 -24
  72. package/lib/cjs/Metadata/Schema.js.map +1 -1
  73. package/lib/cjs/Metadata/SchemaItem.d.ts +11 -2
  74. package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
  75. package/lib/cjs/Metadata/SchemaItem.js +6 -1
  76. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  77. package/lib/cjs/Metadata/Unit.d.ts +8 -1
  78. package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
  79. package/lib/cjs/Metadata/Unit.js +15 -3
  80. package/lib/cjs/Metadata/Unit.js.map +1 -1
  81. package/lib/cjs/Metadata/UnitSystem.d.ts +14 -1
  82. package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
  83. package/lib/cjs/Metadata/UnitSystem.js +22 -1
  84. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  85. package/lib/cjs/SchemaJsonLocater.d.ts +2 -2
  86. package/lib/cjs/SchemaJsonLocater.d.ts.map +1 -1
  87. package/lib/cjs/SchemaJsonLocater.js +1 -1
  88. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  89. package/lib/cjs/SchemaKey.d.ts +6 -0
  90. package/lib/cjs/SchemaKey.d.ts.map +1 -1
  91. package/lib/cjs/SchemaKey.js +6 -0
  92. package/lib/cjs/SchemaKey.js.map +1 -1
  93. package/lib/cjs/SchemaLoader.d.ts +2 -2
  94. package/lib/cjs/SchemaLoader.d.ts.map +1 -1
  95. package/lib/cjs/SchemaLoader.js.map +1 -1
  96. package/lib/cjs/UnitConversion/UnitConversion.d.ts +1 -1
  97. package/lib/cjs/UnitConversion/UnitConversion.d.ts.map +1 -1
  98. package/lib/cjs/UnitConversion/UnitConversion.js +5 -5
  99. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  100. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +3 -3
  101. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  102. package/lib/cjs/Validation/SchemaWalker.d.ts +1 -1
  103. package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -1
  104. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  105. package/lib/esm/Context.d.ts +36 -15
  106. package/lib/esm/Context.d.ts.map +1 -1
  107. package/lib/esm/Context.js +8 -16
  108. package/lib/esm/Context.js.map +1 -1
  109. package/lib/esm/Deserialization/Helper.d.ts +3 -3
  110. package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
  111. package/lib/esm/Deserialization/Helper.js.map +1 -1
  112. package/lib/esm/Deserialization/XmlParser.js +2 -1
  113. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  114. package/lib/esm/ECObjects.d.ts +21 -1
  115. package/lib/esm/ECObjects.d.ts.map +1 -1
  116. package/lib/esm/ECObjects.js +32 -1
  117. package/lib/esm/ECObjects.js.map +1 -1
  118. package/lib/esm/Interfaces.d.ts +7 -0
  119. package/lib/esm/Interfaces.d.ts.map +1 -1
  120. package/lib/esm/Interfaces.js.map +1 -1
  121. package/lib/esm/Metadata/Class.d.ts +24 -2
  122. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  123. package/lib/esm/Metadata/Class.js +41 -11
  124. package/lib/esm/Metadata/Class.js.map +1 -1
  125. package/lib/esm/Metadata/Constant.d.ts +14 -1
  126. package/lib/esm/Metadata/Constant.d.ts.map +1 -1
  127. package/lib/esm/Metadata/Constant.js +23 -2
  128. package/lib/esm/Metadata/Constant.js.map +1 -1
  129. package/lib/esm/Metadata/CustomAttributeClass.d.ts +15 -1
  130. package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
  131. package/lib/esm/Metadata/CustomAttributeClass.js +21 -1
  132. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  133. package/lib/esm/Metadata/EntityClass.d.ts +17 -3
  134. package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
  135. package/lib/esm/Metadata/EntityClass.js +28 -6
  136. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  137. package/lib/esm/Metadata/Enumeration.d.ts +14 -1
  138. package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
  139. package/lib/esm/Metadata/Enumeration.js +19 -1
  140. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  141. package/lib/esm/Metadata/Format.d.ts +13 -1
  142. package/lib/esm/Metadata/Format.d.ts.map +1 -1
  143. package/lib/esm/Metadata/Format.js +24 -3
  144. package/lib/esm/Metadata/Format.js.map +1 -1
  145. package/lib/esm/Metadata/InvertedUnit.d.ts +8 -1
  146. package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
  147. package/lib/esm/Metadata/InvertedUnit.js +15 -3
  148. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  149. package/lib/esm/Metadata/KindOfQuantity.d.ts +14 -1
  150. package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
  151. package/lib/esm/Metadata/KindOfQuantity.js +40 -13
  152. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  153. package/lib/esm/Metadata/Mixin.d.ts +15 -1
  154. package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
  155. package/lib/esm/Metadata/Mixin.js +23 -3
  156. package/lib/esm/Metadata/Mixin.js.map +1 -1
  157. package/lib/esm/Metadata/Phenomenon.d.ts +14 -1
  158. package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
  159. package/lib/esm/Metadata/Phenomenon.js +21 -1
  160. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  161. package/lib/esm/Metadata/Property.d.ts +1 -1
  162. package/lib/esm/Metadata/Property.d.ts.map +1 -1
  163. package/lib/esm/Metadata/Property.js +12 -7
  164. package/lib/esm/Metadata/Property.js.map +1 -1
  165. package/lib/esm/Metadata/PropertyCategory.d.ts +14 -1
  166. package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
  167. package/lib/esm/Metadata/PropertyCategory.js +20 -1
  168. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  169. package/lib/esm/Metadata/RelationshipClass.d.ts +15 -1
  170. package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
  171. package/lib/esm/Metadata/RelationshipClass.js +30 -7
  172. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  173. package/lib/esm/Metadata/Schema.d.ts +114 -6
  174. package/lib/esm/Metadata/Schema.d.ts.map +1 -1
  175. package/lib/esm/Metadata/Schema.js +125 -24
  176. package/lib/esm/Metadata/Schema.js.map +1 -1
  177. package/lib/esm/Metadata/SchemaItem.d.ts +11 -2
  178. package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
  179. package/lib/esm/Metadata/SchemaItem.js +7 -2
  180. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  181. package/lib/esm/Metadata/Unit.d.ts +8 -1
  182. package/lib/esm/Metadata/Unit.d.ts.map +1 -1
  183. package/lib/esm/Metadata/Unit.js +15 -3
  184. package/lib/esm/Metadata/Unit.js.map +1 -1
  185. package/lib/esm/Metadata/UnitSystem.d.ts +14 -1
  186. package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
  187. package/lib/esm/Metadata/UnitSystem.js +22 -1
  188. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  189. package/lib/esm/SchemaJsonLocater.d.ts +2 -2
  190. package/lib/esm/SchemaJsonLocater.d.ts.map +1 -1
  191. package/lib/esm/SchemaJsonLocater.js +1 -1
  192. package/lib/esm/SchemaJsonLocater.js.map +1 -1
  193. package/lib/esm/SchemaKey.d.ts +6 -0
  194. package/lib/esm/SchemaKey.d.ts.map +1 -1
  195. package/lib/esm/SchemaKey.js +6 -0
  196. package/lib/esm/SchemaKey.js.map +1 -1
  197. package/lib/esm/SchemaLoader.d.ts +2 -2
  198. package/lib/esm/SchemaLoader.d.ts.map +1 -1
  199. package/lib/esm/SchemaLoader.js.map +1 -1
  200. package/lib/esm/UnitConversion/UnitConversion.d.ts +1 -1
  201. package/lib/esm/UnitConversion/UnitConversion.d.ts.map +1 -1
  202. package/lib/esm/UnitConversion/UnitConversion.js +5 -5
  203. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
  204. package/lib/esm/UnitProvider/SchemaUnitProvider.js +3 -3
  205. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  206. package/lib/esm/Validation/SchemaWalker.d.ts +1 -1
  207. package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -1
  208. package/lib/esm/Validation/SchemaWalker.js.map +1 -1
  209. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipClass.js","sourceRoot":"","sources":["../../../src/Metadata/RelationshipClass.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAiB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EACY,aAAa,EAAE,sBAAsB,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,yBAAyB,EACrI,gBAAgB,EAAE,YAAY,GAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAsE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAClI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nD,OAAO,wBAAwB,CAAC,OAAO,CAAC;QAE1C,OAAO,IAAI,wBAAwB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;IAEM,MAAM,CAAC,GAA6B;QACzC,OAAO,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU,CAAC;IAClF,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC;IAC1F,CAAC;;AAGH;;;GAGG;AACH,MAAM,OAAgB,wBAAyB,SAAQ,iBAAiB;IACtE,IAAoB,MAAM,KAAK,OAAO,IAAI,CAAC,OAAwC,CAAC,CAAC,CAAC;IACtF,IAAoB,MAAM,KAAK,OAAO,IAAI,CAAC,OAAwC,CAAC,CAAC,CAAC;CAMvF","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 Metadata\n */\n\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\nimport { RelationshipClassProps, RelationshipConstraintProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport {\n ECClassModifier, parseStrength, parseStrengthDirection, RelationshipEnd, SchemaItemType, StrengthDirection, strengthDirectionToString,\n strengthToString, StrengthType,\n} from \"../ECObjects\";\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\nimport { LazyLoadedRelationshipConstraintClass } from \"../Interfaces\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { ECClass } from \"./Class\";\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\nimport { createNavigationProperty, createNavigationPropertySync, EntityClass } from \"./EntityClass\";\nimport { Mixin } from \"./Mixin\";\nimport { NavigationProperty } from \"./Property\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\n\ntype AnyConstraintClass = EntityClass | Mixin | RelationshipClass;\n\n/**\n * A Typescript class representation of a ECRelationshipClass.\n * @beta\n */\nexport class RelationshipClass extends ECClass {\n public override readonly schemaItemType = SchemaItemType.RelationshipClass;\n protected _strength: StrengthType;\n protected _strengthDirection: StrengthDirection;\n protected _source: RelationshipConstraint;\n protected _target: RelationshipConstraint;\n\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\n super(schema, name, modifier);\n this._strengthDirection = StrengthDirection.Forward;\n this._strength = StrengthType.Referencing;\n this._source = new RelationshipConstraint(this, RelationshipEnd.Source);\n this._target = new RelationshipConstraint(this, RelationshipEnd.Target);\n }\n\n public get strength() { return this._strength; }\n public get strengthDirection() { return this._strengthDirection; }\n public get source() { return this._source; }\n public get target() { return this._target; }\n\n /**\n *\n * @param name\n * @param relationship\n * @param direction\n */\n protected async createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\n return this.addProperty(await createNavigationProperty(this, name, relationship, direction));\n }\n\n protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\n return this.addProperty(createNavigationPropertySync(this, name, relationship, direction));\n }\n\n /**\n * @alpha Used for schema editing.\n */\n protected setStrength(strength: StrengthType) {\n this._strength = strength;\n }\n\n /**\n * @alpha Used for schema editing.\n */\n protected setStrengthDirection(direction: StrengthDirection) {\n this._strengthDirection = direction;\n }\n\n /**\n * @alpha Used for schema editing.\n */\n protected setSourceConstraint(source: RelationshipConstraint) {\n this._source = source;\n }\n\n /**\n * @alpha Used for schema editing.\n */\n protected setTargetConstraint(target: RelationshipConstraint) {\n this._target = target;\n }\n /**\n * Save this RelationshipClass's properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): RelationshipClassProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n schemaJson.strength = strengthToString(this.strength);\n schemaJson.strengthDirection = strengthDirectionToString(this.strengthDirection);\n schemaJson.source = this.source.toJSON();\n schemaJson.target = this.target.toJSON();\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"strength\", strengthToString(this.strength));\n itemElement.setAttribute(\"strengthDirection\", strengthDirectionToString(this.strengthDirection));\n itemElement.appendChild(await this.source.toXml(schemaXml));\n itemElement.appendChild(await this.target.toXml(schemaXml));\n return itemElement;\n }\n\n public override fromJSONSync(relationshipClassProps: RelationshipClassProps) {\n super.fromJSONSync(relationshipClassProps);\n\n let strength = parseStrength(relationshipClassProps.strength);\n if (undefined === strength) {\n if (SchemaReadHelper.isECSpecVersionNewer({ readVersion: relationshipClassProps.originalECSpecMajorVersion, writeVersion: relationshipClassProps.originalECSpecMinorVersion } as ECSpecVersion))\n strength = StrengthType.Referencing;\n else\n throw new ECObjectsError(ECObjectsStatus.InvalidStrength, `The RelationshipClass ${this.fullName} has an invalid 'strength' attribute. '${relationshipClassProps.strength}' is not a valid StrengthType.`);\n }\n\n const strengthDirection = parseStrengthDirection(relationshipClassProps.strengthDirection);\n if (undefined === strengthDirection)\n throw new ECObjectsError(ECObjectsStatus.InvalidStrength, `The RelationshipClass ${this.fullName} has an invalid 'strengthDirection' attribute. '${relationshipClassProps.strengthDirection}' is not a valid StrengthDirection.`);\n\n this._strength = strength;\n this._strengthDirection = strengthDirection;\n }\n\n public override async fromJSON(relationshipClassProps: RelationshipClassProps) {\n this.fromJSONSync(relationshipClassProps);\n }\n}\n\n/**\n * A Typescript class representation of a ECRelationshipConstraint.\n * @beta\n */\nexport class RelationshipConstraint implements CustomAttributeContainerProps {\n protected _abstractConstraint?: LazyLoadedRelationshipConstraintClass;\n protected _relationshipClass: RelationshipClass;\n protected _relationshipEnd: RelationshipEnd;\n protected _multiplicity?: RelationshipMultiplicity;\n protected _polymorphic?: boolean;\n protected _roleLabel?: string;\n protected _constraintClasses?: LazyLoadedRelationshipConstraintClass[];\n private _customAttributes?: Map<string, CustomAttribute>;\n\n constructor(relClass: RelationshipClass, relEnd: RelationshipEnd, roleLabel?: string, polymorphic?: boolean) {\n this._relationshipEnd = relEnd;\n if (polymorphic)\n this._polymorphic = polymorphic;\n else\n this._polymorphic = false;\n\n this._multiplicity = RelationshipMultiplicity.zeroOne;\n this._relationshipClass = relClass;\n this._roleLabel = roleLabel;\n }\n\n public get multiplicity() { return this._multiplicity ?? RelationshipMultiplicity.zeroOne; }\n protected set multiplicity(multiplicity: RelationshipMultiplicity) {\n this._multiplicity = multiplicity;\n }\n\n public get polymorphic() { return this._polymorphic ?? false; }\n protected set polymorphic(polymorphic: boolean) {\n this._polymorphic = polymorphic;\n }\n\n public get roleLabel() { return this._roleLabel; }\n protected set roleLabel(roleLabel: string | undefined) {\n this._roleLabel = roleLabel;\n }\n\n public get constraintClasses(): LazyLoadedRelationshipConstraintClass[] | undefined { return this._constraintClasses; }\n\n public get relationshipClass() { return this._relationshipClass; }\n\n public get relationshipEnd() { return this._relationshipEnd; }\n protected set relationshipEnd(relationshipEnd: RelationshipEnd) {\n this._relationshipEnd = relationshipEnd;\n }\n\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\n\n /** Returns the constraint name, ie. 'RelationshipName.Source/Target' */\n public get fullName() { return `${this._relationshipClass.name}:${this.isSource ? \"Source\" : \"Target\"}`; }\n\n /** Returns the schema of the RelationshipClass. */\n public get schema(): Schema { return this._relationshipClass.schema; }\n\n public get abstractConstraint(): LazyLoadedRelationshipConstraintClass | undefined {\n if (this._abstractConstraint)\n return this._abstractConstraint;\n\n if (this.constraintClasses && this.constraintClasses.length === 1)\n return this.constraintClasses[0];\n\n return this._abstractConstraint;\n }\n\n public set abstractConstraint(abstractConstraint: LazyLoadedRelationshipConstraintClass | undefined) {\n this._abstractConstraint = abstractConstraint;\n }\n\n /**\n * True if this RelationshipConstraint is the Source relationship end.\n */\n public get isSource(): boolean { return this.relationshipEnd === RelationshipEnd.Source; }\n\n /**\n * Adds the provided class as a constraint class to this constraint.\n * @param constraint The class to add as a constraint class.\n */\n public addClass(constraint: EntityClass | Mixin | RelationshipClass): void {\n // TODO: Ensure we don't start mixing constraint class types\n // TODO: Check that this class is or subclasses abstract constraint?\n\n if (!this._constraintClasses)\n this._constraintClasses = [];\n\n // TODO: Handle relationship constraints\n this._constraintClasses.push(new DelayedPromiseWithProps(constraint.key, async () => constraint));\n }\n\n /**\n * Removes the provided class as a constraint class from this constraint.\n * @param constraint The class to add as a constraint class.\n */\n protected removeClass(constraint: EntityClass | Mixin | RelationshipClass): void {\n if (undefined === this._constraintClasses)\n return;\n\n this._constraintClasses.forEach((item, index) => {\n const constraintName = item.fullName;\n if (constraintName === constraint.fullName)\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._constraintClasses?.splice(index, 1);\n });\n }\n\n /**\n * Save this RelationshipConstraint's properties to an object for serializing to JSON.\n */\n public toJSON(): RelationshipConstraintProps {\n const schemaJson: { [value: string]: any } = {};\n schemaJson.multiplicity = this.multiplicity.toString();\n schemaJson.roleLabel = this.roleLabel;\n schemaJson.polymorphic = this.polymorphic;\n if (undefined !== this._abstractConstraint)\n schemaJson.abstractConstraint = this._abstractConstraint.fullName;\n if (undefined !== this.constraintClasses && this.constraintClasses.length > 0)\n schemaJson.constraintClasses = this.constraintClasses.map((constraintClass) => constraintClass.fullName);\n\n const customAttributes = serializeCustomAttributes(this.customAttributes);\n if (undefined !== customAttributes)\n schemaJson.customAttributes = customAttributes;\n return schemaJson as RelationshipConstraintProps;\n }\n\n /** @internal */\n public async toXml(schemaXml: Document): Promise<Element> {\n const elementName = this.isSource ? \"Source\" : \"Target\";\n const itemElement = schemaXml.createElement(elementName);\n if (undefined !== this.polymorphic)\n itemElement.setAttribute(\"polymorphic\", this.polymorphic.toString());\n if (undefined !== this.roleLabel)\n itemElement.setAttribute(\"roleLabel\", this.roleLabel);\n if (undefined !== this.multiplicity)\n itemElement.setAttribute(\"multiplicity\", this.multiplicity.toString());\n\n const abstractConstraint = await this.abstractConstraint;\n if (undefined !== abstractConstraint) {\n const abstractConstraintName = XmlSerializationUtils.createXmlTypedName(this.schema, abstractConstraint.schema, abstractConstraint.name);\n itemElement.setAttribute(\"abstractConstraint\", abstractConstraintName);\n }\n\n if (undefined !== this.constraintClasses) {\n for (const item of this.constraintClasses) {\n const constraintClass = await item;\n const classElement = schemaXml.createElement(\"Class\");\n const constraintClassName = XmlSerializationUtils.createXmlTypedName(this.schema, constraintClass.schema, constraintClass.name);\n classElement.setAttribute(\"class\", constraintClassName);\n itemElement.appendChild(classElement);\n }\n }\n\n if (this._customAttributes) {\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\n for (const [name, attribute] of this._customAttributes) {\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\n caContainerElement.appendChild(caElement);\n }\n itemElement.appendChild(caContainerElement);\n }\n\n return itemElement;\n }\n\n public fromJSONSync(relationshipConstraintProps: RelationshipConstraintProps) {\n\n this._roleLabel = relationshipConstraintProps.roleLabel;\n this._polymorphic = relationshipConstraintProps.polymorphic;\n\n const parsedMultiplicity = RelationshipMultiplicity.fromString(relationshipConstraintProps.multiplicity);\n if (!parsedMultiplicity)\n throw new ECObjectsError(ECObjectsStatus.InvalidMultiplicity, ``);\n this._multiplicity = parsedMultiplicity;\n\n const relClassSchema = this.relationshipClass.schema;\n\n if (undefined !== relationshipConstraintProps.abstractConstraint) {\n const abstractConstraintSchemaItemKey = relClassSchema.getSchemaItemKey(relationshipConstraintProps.abstractConstraint);\n if (!abstractConstraintSchemaItemKey)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the abstractConstraint ${relationshipConstraintProps.abstractConstraint}.`);\n this.abstractConstraint = new DelayedPromiseWithProps<SchemaItemKey, AnyConstraintClass>(abstractConstraintSchemaItemKey,\n async () => {\n const tempAbstractConstraint = await relClassSchema.lookupItem<AnyConstraintClass>(relationshipConstraintProps.abstractConstraint!);\n if (undefined === tempAbstractConstraint)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the abstractConstraint ${relationshipConstraintProps.abstractConstraint}.`);\n\n return tempAbstractConstraint;\n });\n }\n\n const loadEachConstraint = (constraintClassName: any) => {\n const tempConstraintClass = relClassSchema.lookupItemSync<AnyConstraintClass>(constraintClassName);\n if (!tempConstraintClass)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, ``);\n return tempConstraintClass;\n };\n\n for (const constraintClassName of relationshipConstraintProps.constraintClasses) {\n const constraintClass = loadEachConstraint(constraintClassName);\n this.addClass(constraintClass);\n }\n }\n\n public async fromJSON(relationshipConstraintProps: RelationshipConstraintProps) {\n this.fromJSONSync(relationshipConstraintProps);\n }\n\n /**\n * Indicates if the provided [[ECClass]] is supported by this [[RelationshipConstraint]].\n * @param ecClass The class to check.\n */\n public async supportsClass(ecClass: ECClass): Promise<boolean> {\n if (!this.constraintClasses) {\n if (this.relationshipClass.baseClass) {\n const baseRelationship = await this.relationshipClass.baseClass as RelationshipClass;\n const baseConstraint = this.isSource ? baseRelationship.source : baseRelationship.target;\n return baseConstraint.supportsClass(ecClass);\n }\n return false;\n }\n\n if (ecClass.schemaItemType !== SchemaItemType.EntityClass && ecClass.schemaItemType !== SchemaItemType.RelationshipClass &&\n ecClass.schemaItemType !== SchemaItemType.Mixin) {\n return false;\n }\n\n const abstractConstraint = await this.abstractConstraint;\n\n if (abstractConstraint && await RelationshipConstraint.classCompatibleWithConstraint(abstractConstraint, ecClass, this.polymorphic || false))\n return true;\n\n for (const constraint of this.constraintClasses) {\n if (await RelationshipConstraint.classCompatibleWithConstraint(await constraint, ecClass, this.polymorphic || false))\n return true;\n }\n\n return false;\n }\n\n /**\n * Indicates if an ECClass is of the type or applies to the type (if a mixin) of the ECClass specified by the constraintClass parameter.\n * @param constraintClass The ECClass that is a constraint class of a relationship.\n * @param testClass The ECClass to check against the constraint class.\n * @param isPolymorphic Indicates if the testClass should be checked polymorphically.\n */\n public static async classCompatibleWithConstraint(constraintClass: ECClass, testClass: ECClass, isPolymorphic: boolean): Promise<boolean> {\n if (SchemaItem.equalByKey(constraintClass, testClass))\n return true;\n\n if (isPolymorphic) {\n if (testClass.schemaItemType === SchemaItemType.EntityClass || testClass.schemaItemType === SchemaItemType.RelationshipClass) {\n return testClass.is(constraintClass);\n }\n\n if (testClass.schemaItemType === SchemaItemType.Mixin) {\n if (constraintClass.schemaItemType === SchemaItemType.EntityClass)\n return (testClass as Mixin).applicableTo(constraintClass as EntityClass);\n else\n return testClass.is(constraintClass);\n }\n }\n return false;\n }\n\n /**\n * @internal\n */\n public static isRelationshipConstraint(object: any): object is RelationshipConstraint {\n const relationshipConstrait = object as RelationshipConstraint;\n\n return relationshipConstrait !== undefined && relationshipConstrait.polymorphic !== undefined && relationshipConstrait.multiplicity !== undefined\n && relationshipConstrait.relationshipEnd !== undefined && relationshipConstrait._relationshipClass !== undefined;\n }\n\n protected addCustomAttribute(customAttribute: CustomAttribute) {\n if (!this._customAttributes)\n this._customAttributes = new Map<string, CustomAttribute>();\n\n this._customAttributes.set(customAttribute.className, customAttribute);\n }\n\n}\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * @internal\n */\nexport abstract class MutableRelationshipConstraint extends RelationshipConstraint {\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n\n}\n\nconst INT32_MAX = 2147483647;\n\n/**\n * @beta\n */\nexport class RelationshipMultiplicity {\n public static readonly zeroOne = new RelationshipMultiplicity(0, 1);\n public static readonly zeroMany = new RelationshipMultiplicity(0, INT32_MAX);\n public static readonly oneOne = new RelationshipMultiplicity(1, 1);\n public static readonly oneMany = new RelationshipMultiplicity(1, INT32_MAX);\n\n public readonly lowerLimit: number;\n public readonly upperLimit: number;\n\n constructor(lowerLimit: number, upperLimit: number) {\n this.lowerLimit = lowerLimit;\n this.upperLimit = upperLimit;\n }\n\n public static fromString(str: string): RelationshipMultiplicity | undefined {\n const matches = /^\\(([0-9]*)\\.\\.([0-9]*|\\*)\\)$/.exec(str);\n if (matches === null || matches.length !== 3)\n return undefined;\n\n const lowerLimit = parseInt(matches[1], 10);\n const upperLimit = matches[2] === \"*\" ? INT32_MAX : parseInt(matches[2], 10);\n if (0 === lowerLimit && 1 === upperLimit)\n return RelationshipMultiplicity.zeroOne;\n else if (0 === lowerLimit && INT32_MAX === upperLimit)\n return RelationshipMultiplicity.zeroMany;\n else if (1 === lowerLimit && 1 === upperLimit)\n return RelationshipMultiplicity.oneOne;\n else if (1 === lowerLimit && INT32_MAX === upperLimit)\n return RelationshipMultiplicity.oneMany;\n\n return new RelationshipMultiplicity(lowerLimit, upperLimit);\n }\n\n public equals(rhs: RelationshipMultiplicity): boolean {\n return this.lowerLimit === rhs.lowerLimit && this.upperLimit === rhs.upperLimit;\n }\n\n public toString(): string {\n return `(${this.lowerLimit}..${this.upperLimit === INT32_MAX ? \"*\" : this.upperLimit})`;\n }\n}\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableRelationshipClass extends RelationshipClass {\n public override get source() { return this._source as MutableRelationshipConstraint; }\n public override get target() { return this._target as MutableRelationshipConstraint; }\n public abstract override setStrength(strength: StrengthType): void;\n public abstract override setStrengthDirection(direction: StrengthDirection): void;\n public abstract override createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;\n public abstract override createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;\n public abstract override setDisplayLabel(displayLabel: string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O,CAAC;aACrC,IAAI,CAAC,KAAK,UAAU,IAAI,SAAS,KAAK,UAAU;YACnD,OAAO,wBAAwB,CAAC,QAAQ,CAAC;aACtC,IAAI,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,UAAU;YAC3C,OAAO,wBAAwB,CAAC,MAAM,CAAC;aACpC,IAAI,CAAC,KAAK,UAAU,IAAI,SAAS,KAAK,UAAU;YACnD,OAAO,wBAAwB,CAAC,OAAO,CAAC;QAE1C,OAAO,IAAI,wBAAwB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;IAEM,MAAM,CAAC,GAA6B;QACzC,OAAO,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU,CAAC;IAClF,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC;IAC1F,CAAC;;AAGH;;;GAGG;AACH,MAAM,OAAgB,wBAAyB,SAAQ,iBAAiB;IACtE,IAAoB,MAAM,KAAK,OAAO,IAAI,CAAC,OAAwC,CAAC,CAAC,CAAC;IACtF,IAAoB,MAAM,KAAK,OAAO,IAAI,CAAC,OAAwC,CAAC,CAAC,CAAC;CAMvF","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 Metadata\n */\n\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\nimport { RelationshipClassProps, RelationshipConstraintProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport {\n ECClassModifier, parseStrength, parseStrengthDirection, RelationshipEnd, SchemaItemType, StrengthDirection, strengthDirectionToString,\n strengthToString, StrengthType,\n} from \"../ECObjects\";\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\nimport { LazyLoadedRelationshipConstraintClass } from \"../Interfaces\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { ECClass } from \"./Class\";\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\nimport { createNavigationProperty, createNavigationPropertySync, EntityClass } from \"./EntityClass\";\nimport { Mixin } from \"./Mixin\";\nimport { NavigationProperty } from \"./Property\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\n\ntype AnyConstraintClass = EntityClass | Mixin | RelationshipClass;\n\n/**\n * A Typescript class representation of a ECRelationshipClass.\n * @beta\n */\nexport class RelationshipClass extends ECClass {\n public override readonly schemaItemType = RelationshipClass.schemaItemType;\n public static override get schemaItemType() { return SchemaItemType.RelationshipClass; }\n protected _strength: StrengthType;\n protected _strengthDirection: StrengthDirection;\n protected _source: RelationshipConstraint;\n protected _target: RelationshipConstraint;\n\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\n super(schema, name, modifier);\n this._strengthDirection = StrengthDirection.Forward;\n this._strength = StrengthType.Referencing;\n this._source = new RelationshipConstraint(this, RelationshipEnd.Source);\n this._target = new RelationshipConstraint(this, RelationshipEnd.Target);\n }\n\n public get strength() { return this._strength; }\n public get strengthDirection() { return this._strengthDirection; }\n public get source() { return this._source; }\n public get target() { return this._target; }\n\n /**\n *\n * @param name\n * @param relationship\n * @param direction\n */\n protected async createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\n return this.addProperty(await createNavigationProperty(this, name, relationship, direction));\n }\n\n protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\n return this.addProperty(createNavigationPropertySync(this, name, relationship, direction));\n }\n\n /**\n * @alpha Used for schema editing.\n */\n protected setStrength(strength: StrengthType) {\n this._strength = strength;\n }\n\n /**\n * @alpha Used for schema editing.\n */\n protected setStrengthDirection(direction: StrengthDirection) {\n this._strengthDirection = direction;\n }\n\n /**\n * @alpha Used for schema editing.\n */\n protected setSourceConstraint(source: RelationshipConstraint) {\n this._source = source;\n }\n\n /**\n * @alpha Used for schema editing.\n */\n protected setTargetConstraint(target: RelationshipConstraint) {\n this._target = target;\n }\n /**\n * Save this RelationshipClass's properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): RelationshipClassProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n schemaJson.strength = strengthToString(this.strength);\n schemaJson.strengthDirection = strengthDirectionToString(this.strengthDirection);\n schemaJson.source = this.source.toJSON();\n schemaJson.target = this.target.toJSON();\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"strength\", strengthToString(this.strength));\n itemElement.setAttribute(\"strengthDirection\", strengthDirectionToString(this.strengthDirection));\n itemElement.appendChild(await this.source.toXml(schemaXml));\n itemElement.appendChild(await this.target.toXml(schemaXml));\n return itemElement;\n }\n\n public override fromJSONSync(relationshipClassProps: RelationshipClassProps) {\n super.fromJSONSync(relationshipClassProps);\n\n let strength = parseStrength(relationshipClassProps.strength);\n if (undefined === strength) {\n if (SchemaReadHelper.isECSpecVersionNewer({ readVersion: relationshipClassProps.originalECSpecMajorVersion, writeVersion: relationshipClassProps.originalECSpecMinorVersion } as ECSpecVersion))\n strength = StrengthType.Referencing;\n else\n throw new ECObjectsError(ECObjectsStatus.InvalidStrength, `The RelationshipClass ${this.fullName} has an invalid 'strength' attribute. '${relationshipClassProps.strength}' is not a valid StrengthType.`);\n }\n\n const strengthDirection = parseStrengthDirection(relationshipClassProps.strengthDirection);\n if (undefined === strengthDirection)\n throw new ECObjectsError(ECObjectsStatus.InvalidStrength, `The RelationshipClass ${this.fullName} has an invalid 'strengthDirection' attribute. '${relationshipClassProps.strengthDirection}' is not a valid StrengthDirection.`);\n\n this._strength = strength;\n this._strengthDirection = strengthDirection;\n }\n\n public override async fromJSON(relationshipClassProps: RelationshipClassProps) {\n this.fromJSONSync(relationshipClassProps);\n }\n\n /**\n * Type guard to check if the SchemaItem is of type RelationshipClass.\n * @param item The SchemaItem to check.\n * @returns True if the item is a RelationshipClass, false otherwise.\n */\n public static isRelationshipClass(item?: SchemaItem): item is RelationshipClass {\n if (item && item.schemaItemType === SchemaItemType.RelationshipClass)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type RelationshipClass.\n * @param item The SchemaItem to check.\n * @returns The item cast to RelationshipClass if it is a RelationshipClass, undefined otherwise.\n */\n public static assertIsRelationshipClass(item?: SchemaItem): asserts item is RelationshipClass {\n if (!this.isRelationshipClass(item))\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.RelationshipClass}' (RelationshipClass)`);\n }\n}\n\n/**\n * A Typescript class representation of a ECRelationshipConstraint.\n * @beta\n */\nexport class RelationshipConstraint implements CustomAttributeContainerProps {\n protected _abstractConstraint?: LazyLoadedRelationshipConstraintClass;\n protected _relationshipClass: RelationshipClass;\n protected _relationshipEnd: RelationshipEnd;\n protected _multiplicity?: RelationshipMultiplicity;\n protected _polymorphic?: boolean;\n protected _roleLabel?: string;\n protected _constraintClasses?: LazyLoadedRelationshipConstraintClass[];\n private _customAttributes?: Map<string, CustomAttribute>;\n\n constructor(relClass: RelationshipClass, relEnd: RelationshipEnd, roleLabel?: string, polymorphic?: boolean) {\n this._relationshipEnd = relEnd;\n if (polymorphic)\n this._polymorphic = polymorphic;\n else\n this._polymorphic = false;\n\n this._multiplicity = RelationshipMultiplicity.zeroOne;\n this._relationshipClass = relClass;\n this._roleLabel = roleLabel;\n }\n\n public get multiplicity() { return this._multiplicity ?? RelationshipMultiplicity.zeroOne; }\n protected set multiplicity(multiplicity: RelationshipMultiplicity) {\n this._multiplicity = multiplicity;\n }\n\n public get polymorphic() { return this._polymorphic ?? false; }\n protected set polymorphic(polymorphic: boolean) {\n this._polymorphic = polymorphic;\n }\n\n public get roleLabel() { return this._roleLabel; }\n protected set roleLabel(roleLabel: string | undefined) {\n this._roleLabel = roleLabel;\n }\n\n public get constraintClasses(): LazyLoadedRelationshipConstraintClass[] | undefined { return this._constraintClasses; }\n\n public get relationshipClass() { return this._relationshipClass; }\n\n public get relationshipEnd() { return this._relationshipEnd; }\n protected set relationshipEnd(relationshipEnd: RelationshipEnd) {\n this._relationshipEnd = relationshipEnd;\n }\n\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\n\n /** Returns the constraint name, ie. 'RelationshipName.Source/Target' */\n public get fullName() { return `${this._relationshipClass.name}:${this.isSource ? \"Source\" : \"Target\"}`; }\n\n /** Returns the schema of the RelationshipClass. */\n public get schema(): Schema { return this._relationshipClass.schema; }\n\n public get abstractConstraint(): LazyLoadedRelationshipConstraintClass | undefined {\n if (this._abstractConstraint)\n return this._abstractConstraint;\n\n if (this.constraintClasses && this.constraintClasses.length === 1)\n return this.constraintClasses[0];\n\n return this._abstractConstraint;\n }\n\n public set abstractConstraint(abstractConstraint: LazyLoadedRelationshipConstraintClass | undefined) {\n this._abstractConstraint = abstractConstraint;\n }\n\n /**\n * True if this RelationshipConstraint is the Source relationship end.\n */\n public get isSource(): boolean { return this.relationshipEnd === RelationshipEnd.Source; }\n\n /**\n * Adds the provided class as a constraint class to this constraint.\n * @param constraint The class to add as a constraint class.\n */\n public addClass(constraint: EntityClass | Mixin | RelationshipClass): void {\n // TODO: Ensure we don't start mixing constraint class types\n // TODO: Check that this class is or subclasses abstract constraint?\n\n if (!this._constraintClasses)\n this._constraintClasses = [];\n\n // TODO: Handle relationship constraints\n this._constraintClasses.push(new DelayedPromiseWithProps(constraint.key, async () => constraint));\n }\n\n /**\n * Removes the provided class as a constraint class from this constraint.\n * @param constraint The class to add as a constraint class.\n */\n protected removeClass(constraint: EntityClass | Mixin | RelationshipClass): void {\n if (undefined === this._constraintClasses)\n return;\n\n this._constraintClasses.forEach((item, index) => {\n const constraintName = item.fullName;\n if (constraintName === constraint.fullName)\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._constraintClasses?.splice(index, 1);\n });\n }\n\n /**\n * Save this RelationshipConstraint's properties to an object for serializing to JSON.\n */\n public toJSON(): RelationshipConstraintProps {\n const schemaJson: { [value: string]: any } = {};\n schemaJson.multiplicity = this.multiplicity.toString();\n schemaJson.roleLabel = this.roleLabel;\n schemaJson.polymorphic = this.polymorphic;\n if (undefined !== this._abstractConstraint)\n schemaJson.abstractConstraint = this._abstractConstraint.fullName;\n if (undefined !== this.constraintClasses && this.constraintClasses.length > 0)\n schemaJson.constraintClasses = this.constraintClasses.map((constraintClass) => constraintClass.fullName);\n\n const customAttributes = serializeCustomAttributes(this.customAttributes);\n if (undefined !== customAttributes)\n schemaJson.customAttributes = customAttributes;\n return schemaJson as RelationshipConstraintProps;\n }\n\n /** @internal */\n public async toXml(schemaXml: Document): Promise<Element> {\n const elementName = this.isSource ? \"Source\" : \"Target\";\n const itemElement = schemaXml.createElement(elementName);\n if (undefined !== this.polymorphic)\n itemElement.setAttribute(\"polymorphic\", this.polymorphic.toString());\n if (undefined !== this.roleLabel)\n itemElement.setAttribute(\"roleLabel\", this.roleLabel);\n if (undefined !== this.multiplicity)\n itemElement.setAttribute(\"multiplicity\", this.multiplicity.toString());\n\n const abstractConstraint = await this.abstractConstraint;\n if (undefined !== abstractConstraint) {\n const abstractConstraintName = XmlSerializationUtils.createXmlTypedName(this.schema, abstractConstraint.schema, abstractConstraint.name);\n itemElement.setAttribute(\"abstractConstraint\", abstractConstraintName);\n }\n\n if (undefined !== this.constraintClasses) {\n for (const item of this.constraintClasses) {\n const constraintClass = await item;\n const classElement = schemaXml.createElement(\"Class\");\n const constraintClassName = XmlSerializationUtils.createXmlTypedName(this.schema, constraintClass.schema, constraintClass.name);\n classElement.setAttribute(\"class\", constraintClassName);\n itemElement.appendChild(classElement);\n }\n }\n\n if (this._customAttributes) {\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\n for (const [name, attribute] of this._customAttributes) {\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\n caContainerElement.appendChild(caElement);\n }\n itemElement.appendChild(caContainerElement);\n }\n\n return itemElement;\n }\n\n public fromJSONSync(relationshipConstraintProps: RelationshipConstraintProps) {\n\n this._roleLabel = relationshipConstraintProps.roleLabel;\n this._polymorphic = relationshipConstraintProps.polymorphic;\n\n const parsedMultiplicity = RelationshipMultiplicity.fromString(relationshipConstraintProps.multiplicity);\n if (!parsedMultiplicity)\n throw new ECObjectsError(ECObjectsStatus.InvalidMultiplicity, ``);\n this._multiplicity = parsedMultiplicity;\n\n const relClassSchema = this.relationshipClass.schema;\n\n if (undefined !== relationshipConstraintProps.abstractConstraint) {\n const abstractConstraintSchemaItemKey = relClassSchema.getSchemaItemKey(relationshipConstraintProps.abstractConstraint);\n if (!abstractConstraintSchemaItemKey)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the abstractConstraint ${relationshipConstraintProps.abstractConstraint}.`);\n this.abstractConstraint = new DelayedPromiseWithProps<SchemaItemKey, AnyConstraintClass>(abstractConstraintSchemaItemKey,\n async () => {\n const tempAbstractConstraint = await relClassSchema.lookupItem(relationshipConstraintProps.abstractConstraint!);\n if (undefined === tempAbstractConstraint ||\n (!EntityClass.isEntityClass(tempAbstractConstraint) && !Mixin.isMixin(tempAbstractConstraint) && !RelationshipClass.isRelationshipClass(tempAbstractConstraint)))\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the abstractConstraint ${relationshipConstraintProps.abstractConstraint}.`);\n\n return tempAbstractConstraint;\n });\n }\n\n const loadEachConstraint = (constraintClassName: any) => {\n const tempConstraintClass = relClassSchema.lookupItemSync(constraintClassName);\n if (!tempConstraintClass ||\n (!EntityClass.isEntityClass(tempConstraintClass) && !Mixin.isMixin(tempConstraintClass) && !RelationshipClass.isRelationshipClass(tempConstraintClass)))\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, ``);\n return tempConstraintClass;\n };\n\n for (const constraintClassName of relationshipConstraintProps.constraintClasses) {\n const constraintClass = loadEachConstraint(constraintClassName);\n this.addClass(constraintClass);\n }\n }\n\n public async fromJSON(relationshipConstraintProps: RelationshipConstraintProps) {\n this.fromJSONSync(relationshipConstraintProps);\n }\n\n /**\n * Indicates if the provided [[ECClass]] is supported by this [[RelationshipConstraint]].\n * @param ecClass The class to check.\n */\n public async supportsClass(ecClass: ECClass): Promise<boolean> {\n if (!this.constraintClasses) {\n if (this.relationshipClass.baseClass) {\n const baseRelationship = await this.relationshipClass.baseClass as RelationshipClass;\n const baseConstraint = this.isSource ? baseRelationship.source : baseRelationship.target;\n return baseConstraint.supportsClass(ecClass);\n }\n return false;\n }\n\n if (ecClass.schemaItemType !== SchemaItemType.EntityClass && ecClass.schemaItemType !== SchemaItemType.RelationshipClass &&\n ecClass.schemaItemType !== SchemaItemType.Mixin) {\n return false;\n }\n\n const abstractConstraint = await this.abstractConstraint;\n\n if (abstractConstraint && await RelationshipConstraint.classCompatibleWithConstraint(abstractConstraint, ecClass, this.polymorphic || false))\n return true;\n\n for (const constraint of this.constraintClasses) {\n if (await RelationshipConstraint.classCompatibleWithConstraint(await constraint, ecClass, this.polymorphic || false))\n return true;\n }\n\n return false;\n }\n\n /**\n * Indicates if an ECClass is of the type or applies to the type (if a mixin) of the ECClass specified by the constraintClass parameter.\n * @param constraintClass The ECClass that is a constraint class of a relationship.\n * @param testClass The ECClass to check against the constraint class.\n * @param isPolymorphic Indicates if the testClass should be checked polymorphically.\n */\n public static async classCompatibleWithConstraint(constraintClass: ECClass, testClass: ECClass, isPolymorphic: boolean): Promise<boolean> {\n if (SchemaItem.equalByKey(constraintClass, testClass))\n return true;\n\n if (isPolymorphic) {\n if (testClass.schemaItemType === SchemaItemType.EntityClass || testClass.schemaItemType === SchemaItemType.RelationshipClass) {\n return testClass.is(constraintClass);\n }\n\n if (testClass.schemaItemType === SchemaItemType.Mixin) {\n if (constraintClass.schemaItemType === SchemaItemType.EntityClass)\n return (testClass as Mixin).applicableTo(constraintClass as EntityClass);\n else\n return testClass.is(constraintClass);\n }\n }\n return false;\n }\n\n /**\n * @internal\n */\n public static isRelationshipConstraint(object: any): object is RelationshipConstraint {\n const relationshipConstraint = object as RelationshipConstraint;\n\n return relationshipConstraint !== undefined && relationshipConstraint.polymorphic !== undefined && relationshipConstraint.multiplicity !== undefined\n && relationshipConstraint.relationshipEnd !== undefined && relationshipConstraint._relationshipClass !== undefined;\n }\n\n protected addCustomAttribute(customAttribute: CustomAttribute) {\n if (!this._customAttributes)\n this._customAttributes = new Map<string, CustomAttribute>();\n\n this._customAttributes.set(customAttribute.className, customAttribute);\n }\n\n}\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * @internal\n */\nexport abstract class MutableRelationshipConstraint extends RelationshipConstraint {\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n\n}\n\nconst INT32_MAX = 2147483647;\n\n/**\n * @beta\n */\nexport class RelationshipMultiplicity {\n public static readonly zeroOne = new RelationshipMultiplicity(0, 1);\n public static readonly zeroMany = new RelationshipMultiplicity(0, INT32_MAX);\n public static readonly oneOne = new RelationshipMultiplicity(1, 1);\n public static readonly oneMany = new RelationshipMultiplicity(1, INT32_MAX);\n\n public readonly lowerLimit: number;\n public readonly upperLimit: number;\n\n constructor(lowerLimit: number, upperLimit: number) {\n this.lowerLimit = lowerLimit;\n this.upperLimit = upperLimit;\n }\n\n public static fromString(str: string): RelationshipMultiplicity | undefined {\n const matches = /^\\(([0-9]*)\\.\\.([0-9]*|\\*)\\)$/.exec(str);\n if (matches === null || matches.length !== 3)\n return undefined;\n\n const lowerLimit = parseInt(matches[1], 10);\n const upperLimit = matches[2] === \"*\" ? INT32_MAX : parseInt(matches[2], 10);\n if (0 === lowerLimit && 1 === upperLimit)\n return RelationshipMultiplicity.zeroOne;\n else if (0 === lowerLimit && INT32_MAX === upperLimit)\n return RelationshipMultiplicity.zeroMany;\n else if (1 === lowerLimit && 1 === upperLimit)\n return RelationshipMultiplicity.oneOne;\n else if (1 === lowerLimit && INT32_MAX === upperLimit)\n return RelationshipMultiplicity.oneMany;\n\n return new RelationshipMultiplicity(lowerLimit, upperLimit);\n }\n\n public equals(rhs: RelationshipMultiplicity): boolean {\n return this.lowerLimit === rhs.lowerLimit && this.upperLimit === rhs.upperLimit;\n }\n\n public toString(): string {\n return `(${this.lowerLimit}..${this.upperLimit === INT32_MAX ? \"*\" : this.upperLimit})`;\n }\n}\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableRelationshipClass extends RelationshipClass {\n public override get source() { return this._source as MutableRelationshipConstraint; }\n public override get target() { return this._target as MutableRelationshipConstraint; }\n public abstract override setStrength(strength: StrengthType): void;\n public abstract override setStrengthDirection(direction: StrengthDirection): void;\n public abstract override createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;\n public abstract override createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
@@ -222,31 +222,139 @@ export declare class Schema implements CustomAttributeContainerProps {
222
222
  * @param minorVersion The minor version of the schema. If undefined, the value from the existing SchemaKey will be used.
223
223
  */
224
224
  setVersion(readVersion?: number, writeVersion?: number, minorVersion?: number): void;
225
+ /**
226
+ * Shortcut for calling getItem with EntityClass.
227
+ * @param name The local (unqualified) name of the item to return.
228
+ * @returns The requested EntityClass or undefined if not found.
229
+ */
230
+ getEntityClass(name: string): Promise<EntityClass | undefined>;
231
+ /**
232
+ * Shortcut for calling getItem with Mixin.
233
+ * @param name The local (unqualified) name of the item to return.
234
+ * @returns The requested Mixin or undefined if not found.
235
+ */
236
+ getMixin(name: string): Promise<Mixin | undefined>;
237
+ /**
238
+ * Shortcut for calling getItem with StructClass.
239
+ * @param name The local (unqualified) name of the item to return.
240
+ * @returns The requested StructClass or undefined if not found.
241
+ */
242
+ getStructClass(name: string): Promise<StructClass | undefined>;
243
+ /**
244
+ * Shortcut for calling getItem with CustomAttributeClass.
245
+ * @param name The local (unqualified) name of the item to return.
246
+ * @returns The requested CustomAttributeClass or undefined if not found.
247
+ */
248
+ getCustomAttributeClass(name: string): Promise<CustomAttributeClass | undefined>;
249
+ /**
250
+ * Shortcut for calling getItem with RelationshipClass.
251
+ * @param name The local (unqualified) name of the item to return.
252
+ * @returns The requested RelationshipClass or undefined if not found.
253
+ */
254
+ getRelationshipClass(name: string): Promise<RelationshipClass | undefined>;
255
+ /**
256
+ * Shortcut for calling getItem with Enumeration.
257
+ * @param name The local (unqualified) name of the item to return.
258
+ * @returns The requested Enumeration or undefined if not found.
259
+ */
260
+ getEnumeration(name: string): Promise<Enumeration | undefined>;
261
+ /**
262
+ * Shortcut for calling getItem with KindOfQuantity.
263
+ * @param name The local (unqualified) name of the item to return.
264
+ * @returns The requested KindOfQuantity or undefined if not found.
265
+ */
266
+ getKindOfQuantity(name: string): Promise<KindOfQuantity | undefined>;
267
+ /**
268
+ * Shortcut for calling getItem with PropertyCategory.
269
+ * @param name The local (unqualified) name of the item to return.
270
+ * @returns The requested PropertyCategory or undefined if not found.
271
+ */
272
+ getPropertyCategory(name: string): Promise<PropertyCategory | undefined>;
273
+ /**
274
+ * Shortcut for calling getItem with Unit.
275
+ * @param name The local (unqualified) name of the item to return.
276
+ * @returns The requested Unit or undefined if not found.
277
+ */
278
+ getUnit(name: string): Promise<Unit | undefined>;
279
+ /**
280
+ * Shortcut for calling getItem with InvertedUnit.
281
+ * @param name The local (unqualified) name of the item to return.
282
+ * @returns The requested InvertedUnit or undefined if not found.
283
+ */
284
+ getInvertedUnit(name: string): Promise<InvertedUnit | undefined>;
285
+ /**
286
+ * Shortcut for calling getItem with Constant.
287
+ * @param name The local (unqualified) name of the item to return.
288
+ * @returns The requested Constant or undefined if not found.
289
+ */
290
+ getConstant(name: string): Promise<Constant | undefined>;
291
+ /**
292
+ * Shortcut for calling getItem with Phenomenon.
293
+ * @param name The local (unqualified) name of the item to return.
294
+ * @returns The requested Phenomenon or undefined if not found.
295
+ */
296
+ getPhenomenon(name: string): Promise<Phenomenon | undefined>;
297
+ /**
298
+ * Shortcut for calling getItem with UnitSystem.
299
+ * @param name The local (unqualified) name of the item to return.
300
+ * @returns The requested UnitSystem or undefined if not found.
301
+ */
302
+ getUnitSystem(name: string): Promise<UnitSystem | undefined>;
303
+ /**
304
+ * Shortcut for calling getItem with Format.
305
+ * @param name The local (unqualified) name of the item to return.
306
+ * @returns The requested Format or undefined if not found.
307
+ */
308
+ getFormat(name: string): Promise<Format | undefined>;
225
309
  /**
226
310
  * Gets an item from within this schema. To get by full name use lookupItem instead.
227
311
  * @param key the local (unqualified) name, lookup is case-insensitive
228
312
  */
229
- getItem<T extends SchemaItem>(name: string): Promise<T | undefined>;
313
+ getItem(name: string): Promise<SchemaItem | undefined>;
314
+ getItem<T extends typeof SchemaItem>(name: string, itemConstructor: T): Promise<InstanceType<T> | undefined>;
230
315
  /**
231
316
  * Gets an item from within this schema. To get by full name use lookupItem instead.
317
+ * If an item of the name exists but does not match the requested type, undefined is returned
232
318
  * @param key the local (unqualified) name, lookup is case-insensitive
319
+ * @param itemConstructor The constructor of the item to return.
233
320
  */
234
- getItemSync<T extends SchemaItem>(name: string): T | undefined;
321
+ getItemSync(name: string): SchemaItem | undefined;
322
+ getItemSync<T extends typeof SchemaItem>(name: string, itemConstructor: T): InstanceType<T> | undefined;
235
323
  /**
236
324
  * Attempts to find a schema item within this schema or a (directly) referenced schema
237
325
  * @param key The full name or a SchemaItemKey identifying the desired item.
238
326
  */
239
- lookupItem<T extends SchemaItem>(key: Readonly<SchemaItemKey> | string): Promise<T | undefined>;
327
+ lookupItem(key: Readonly<SchemaItemKey> | string): Promise<SchemaItem | undefined>;
328
+ lookupItem<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor: T): Promise<InstanceType<T> | undefined>;
240
329
  /**
241
330
  * Attempts to find a schema item within this schema or a (directly) referenced schema
242
331
  * @param key The full name or a SchemaItemKey identifying the desired item.
243
332
  */
244
- lookupItemSync<T extends SchemaItem>(key: Readonly<SchemaItemKey> | string): T | undefined;
333
+ lookupItemSync(key: Readonly<SchemaItemKey> | string): SchemaItem | undefined;
334
+ lookupItemSync<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor: T): InstanceType<T> | undefined;
335
+ /**
336
+ * Returns an iterator over all of the items in this schema.
337
+ */
245
338
  getItems<T extends AnySchemaItem>(): IterableIterator<T>;
339
+ /**
340
+ * Returns an iterator over all ECClasses within this schema
341
+ */
246
342
  getClasses(): IterableIterator<ECClass>;
247
- getReference<T extends Schema>(refSchemaName: string): Promise<T | undefined>;
343
+ /**
344
+ * Gets a referenced schema by name
345
+ * @param refSchemaName schema name to find
346
+ */
347
+ getReference(refSchemaName: string): Promise<Schema | undefined>;
348
+ /**
349
+ * Gets a referenced schema by alias
350
+ * @param alias alias to find
351
+ */
248
352
  getReferenceNameByAlias(alias: string): string | undefined;
249
- getReferenceSync<T extends Schema>(refSchemaName: string): T | undefined;
353
+ /**
354
+ * Gets a referenced schema by name
355
+ * @param refSchemaName schema name to find
356
+ */
357
+ getReferenceSync(refSchemaName: string): Schema | undefined;
250
358
  /**
251
359
  * Save this Schema's properties to an object for serializing to JSON.
252
360
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/Metadata/Schema.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAA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{ XmlParser } from "../Deserialization/XmlParser";
11
11
  import { XmlSerializationUtils } from "../Deserialization/XmlSerializationUtils";
12
+ import { isSupportedSchemaItemType } from "../ECObjects";
12
13
  import { ECObjectsError, ECObjectsStatus } from "../Exception";
13
14
  import { ECVersion, SchemaItemKey, SchemaKey } from "../SchemaKey";
14
15
  import { ECName } from "../ECName";
@@ -361,26 +362,104 @@ export class Schema {
361
362
  this._schemaKey = new SchemaKey(this._schemaKey.name, newVersion);
362
363
  }
363
364
  /**
364
- * Gets an item from within this schema. To get by full name use lookupItem instead.
365
- * @param key the local (unqualified) name, lookup is case-insensitive
365
+ * Shortcut for calling getItem with EntityClass.
366
+ * @param name The local (unqualified) name of the item to return.
367
+ * @returns The requested EntityClass or undefined if not found.
366
368
  */
367
- async getItem(name) {
368
- // this method exists so we can rewire it later when we load partial schemas, for now it is identical to the sync version
369
- return this.getItemSync(name);
370
- }
369
+ async getEntityClass(name) { return this.getItem(name, EntityClass); }
371
370
  /**
372
- * Gets an item from within this schema. To get by full name use lookupItem instead.
373
- * @param key the local (unqualified) name, lookup is case-insensitive
371
+ * Shortcut for calling getItem with Mixin.
372
+ * @param name The local (unqualified) name of the item to return.
373
+ * @returns The requested Mixin or undefined if not found.
374
374
  */
375
- getItemSync(name) {
376
- // Case-insensitive search
377
- return this._items.get(name.toUpperCase());
378
- }
375
+ async getMixin(name) { return this.getItem(name, Mixin); }
376
+ /**
377
+ * Shortcut for calling getItem with StructClass.
378
+ * @param name The local (unqualified) name of the item to return.
379
+ * @returns The requested StructClass or undefined if not found.
380
+ */
381
+ async getStructClass(name) { return this.getItem(name, StructClass); }
382
+ /**
383
+ * Shortcut for calling getItem with CustomAttributeClass.
384
+ * @param name The local (unqualified) name of the item to return.
385
+ * @returns The requested CustomAttributeClass or undefined if not found.
386
+ */
387
+ async getCustomAttributeClass(name) { return this.getItem(name, CustomAttributeClass); }
388
+ /**
389
+ * Shortcut for calling getItem with RelationshipClass.
390
+ * @param name The local (unqualified) name of the item to return.
391
+ * @returns The requested RelationshipClass or undefined if not found.
392
+ */
393
+ async getRelationshipClass(name) { return this.getItem(name, RelationshipClass); }
394
+ /**
395
+ * Shortcut for calling getItem with Enumeration.
396
+ * @param name The local (unqualified) name of the item to return.
397
+ * @returns The requested Enumeration or undefined if not found.
398
+ */
399
+ async getEnumeration(name) { return this.getItem(name, Enumeration); }
400
+ /**
401
+ * Shortcut for calling getItem with KindOfQuantity.
402
+ * @param name The local (unqualified) name of the item to return.
403
+ * @returns The requested KindOfQuantity or undefined if not found.
404
+ */
405
+ async getKindOfQuantity(name) { return this.getItem(name, KindOfQuantity); }
406
+ /**
407
+ * Shortcut for calling getItem with PropertyCategory.
408
+ * @param name The local (unqualified) name of the item to return.
409
+ * @returns The requested PropertyCategory or undefined if not found.
410
+ */
411
+ async getPropertyCategory(name) { return this.getItem(name, PropertyCategory); }
412
+ /**
413
+ * Shortcut for calling getItem with Unit.
414
+ * @param name The local (unqualified) name of the item to return.
415
+ * @returns The requested Unit or undefined if not found.
416
+ */
417
+ async getUnit(name) { return this.getItem(name, Unit); }
418
+ /**
419
+ * Shortcut for calling getItem with InvertedUnit.
420
+ * @param name The local (unqualified) name of the item to return.
421
+ * @returns The requested InvertedUnit or undefined if not found.
422
+ */
423
+ async getInvertedUnit(name) { return this.getItem(name, InvertedUnit); }
379
424
  /**
380
- * Attempts to find a schema item within this schema or a (directly) referenced schema
381
- * @param key The full name or a SchemaItemKey identifying the desired item.
425
+ * Shortcut for calling getItem with Constant.
426
+ * @param name The local (unqualified) name of the item to return.
427
+ * @returns The requested Constant or undefined if not found.
382
428
  */
383
- async lookupItem(key) {
429
+ async getConstant(name) { return this.getItem(name, Constant); }
430
+ /**
431
+ * Shortcut for calling getItem with Phenomenon.
432
+ * @param name The local (unqualified) name of the item to return.
433
+ * @returns The requested Phenomenon or undefined if not found.
434
+ */
435
+ async getPhenomenon(name) { return this.getItem(name, Phenomenon); }
436
+ /**
437
+ * Shortcut for calling getItem with UnitSystem.
438
+ * @param name The local (unqualified) name of the item to return.
439
+ * @returns The requested UnitSystem or undefined if not found.
440
+ */
441
+ async getUnitSystem(name) { return this.getItem(name, UnitSystem); }
442
+ /**
443
+ * Shortcut for calling getItem with Format.
444
+ * @param name The local (unqualified) name of the item to return.
445
+ * @returns The requested Format or undefined if not found.
446
+ */
447
+ async getFormat(name) { return this.getItem(name, Format); }
448
+ async getItem(name, itemConstructor) {
449
+ // this method exists so we can rewire it later when we load partial schemas, for now it is identical to the sync version
450
+ if (itemConstructor === undefined)
451
+ return this.getItemSync(name);
452
+ return this.getItemSync(name, itemConstructor);
453
+ }
454
+ getItemSync(name, itemConstructor) {
455
+ const value = this._items.get(name.toUpperCase());
456
+ if (value === undefined || itemConstructor === undefined)
457
+ return value;
458
+ if (isSupportedSchemaItemType(value.schemaItemType, itemConstructor.schemaItemType))
459
+ return value;
460
+ return undefined;
461
+ }
462
+ async lookupItem(key, itemConstructor) {
384
463
  let schemaName, itemName;
385
464
  if (typeof (key) === "string") {
386
465
  [schemaName, itemName] = SchemaItem.parseFullName(key);
@@ -390,18 +469,18 @@ export class Schema {
390
469
  schemaName = key.schemaName;
391
470
  }
392
471
  if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {
393
- return this.getItem(itemName);
472
+ return itemConstructor
473
+ ? this.getItem(itemName, itemConstructor)
474
+ : this.getItem(itemName);
394
475
  }
395
476
  const refSchema = await this.getReference(schemaName);
396
477
  if (!refSchema)
397
478
  return undefined;
398
- return refSchema.getItem(itemName);
479
+ return itemConstructor
480
+ ? refSchema.getItem(itemName, itemConstructor)
481
+ : refSchema.getItem(itemName);
399
482
  }
400
- /**
401
- * Attempts to find a schema item within this schema or a (directly) referenced schema
402
- * @param key The full name or a SchemaItemKey identifying the desired item.
403
- */
404
- lookupItemSync(key) {
483
+ lookupItemSync(key, itemConstructor) {
405
484
  let schemaName, itemName;
406
485
  if (typeof (key) === "string") {
407
486
  [schemaName, itemName] = SchemaItem.parseFullName(key);
@@ -411,35 +490,57 @@ export class Schema {
411
490
  schemaName = key.schemaName;
412
491
  }
413
492
  if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {
414
- return this.getItemSync(itemName);
493
+ return itemConstructor
494
+ ? this.getItemSync(itemName, itemConstructor)
495
+ : this.getItemSync(itemName);
415
496
  }
416
497
  const refSchema = this.getReferenceSync(schemaName);
417
498
  if (!refSchema)
418
499
  return undefined;
419
- return refSchema.getItemSync(itemName);
500
+ return itemConstructor
501
+ ? refSchema.getItemSync(itemName, itemConstructor)
502
+ : refSchema.getItemSync(itemName);
420
503
  }
504
+ /**
505
+ * Returns an iterator over all of the items in this schema.
506
+ */
421
507
  getItems() {
422
508
  if (!this._items)
423
509
  return new Map().values();
424
510
  return this._items.values();
425
511
  }
512
+ /**
513
+ * Returns an iterator over all ECClasses within this schema
514
+ */
426
515
  *getClasses() {
427
516
  for (const [, value] of this._items) {
428
517
  if (ECClass.isECClass(value))
429
518
  yield value;
430
519
  }
431
520
  }
521
+ /**
522
+ * Gets a referenced schema by name
523
+ * @param refSchemaName schema name to find
524
+ */
432
525
  async getReference(refSchemaName) {
433
526
  if (this.references.length === 0)
434
527
  return undefined;
435
528
  return this.references.find((ref) => ref.name.toLowerCase() === refSchemaName.toLowerCase());
436
529
  }
530
+ /**
531
+ * Gets a referenced schema by alias
532
+ * @param alias alias to find
533
+ */
437
534
  getReferenceNameByAlias(alias) {
438
535
  if (this.references.length === 0)
439
536
  return undefined;
440
537
  const schema = this.references.find((ref) => ref.alias ? ref.alias.toLowerCase() === alias.toLowerCase() : false);
441
538
  return schema ? schema.name : undefined;
442
539
  }
540
+ /**
541
+ * Gets a referenced schema by name
542
+ * @param refSchemaName schema name to find
543
+ */
443
544
  getReferenceSync(refSchemaName) {
444
545
  if (this.references.length === 0)
445
546
  return undefined;