@itwin/ecschema-metadata 4.8.0-dev.4 → 4.8.0-dev.41

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 (215) hide show
  1. package/CHANGELOG.md +46 -1
  2. package/lib/cjs/Deserialization/JsonProps.d.ts +4 -0
  3. package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
  4. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  5. package/lib/cjs/Metadata/Class.d.ts +0 -6
  6. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  7. package/lib/cjs/Metadata/Class.js +0 -8
  8. package/lib/cjs/Metadata/Class.js.map +1 -1
  9. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +7 -3
  10. package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
  11. package/lib/cjs/Metadata/CustomAttributeClass.js +16 -10
  12. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  13. package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
  14. package/lib/cjs/Metadata/OverrideFormat.js +3 -1
  15. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  16. package/lib/cjs/Metadata/Schema.d.ts +14 -0
  17. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  18. package/lib/cjs/Metadata/Schema.js +21 -0
  19. package/lib/cjs/Metadata/Schema.js.map +1 -1
  20. package/lib/cjs/Metadata/SchemaItem.d.ts +5 -0
  21. package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
  22. package/lib/cjs/Metadata/SchemaItem.js +7 -0
  23. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  24. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +1 -1
  25. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +1 -1
  26. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  27. package/lib/esm/Constants.d.ts +24 -0
  28. package/lib/esm/Constants.d.ts.map +1 -0
  29. package/lib/esm/Constants.js +30 -0
  30. package/lib/esm/Constants.js.map +1 -0
  31. package/lib/esm/Context.d.ts +219 -0
  32. package/lib/esm/Context.d.ts.map +1 -0
  33. package/lib/esm/Context.js +321 -0
  34. package/lib/esm/Context.js.map +1 -0
  35. package/lib/esm/DelayedPromise.d.ts +89 -0
  36. package/lib/esm/DelayedPromise.d.ts.map +1 -0
  37. package/lib/esm/DelayedPromise.js +88 -0
  38. package/lib/esm/DelayedPromise.js.map +1 -0
  39. package/lib/esm/Deserialization/AbstractParser.d.ts +46 -0
  40. package/lib/esm/Deserialization/AbstractParser.d.ts.map +1 -0
  41. package/lib/esm/Deserialization/AbstractParser.js +8 -0
  42. package/lib/esm/Deserialization/AbstractParser.js.map +1 -0
  43. package/lib/esm/Deserialization/Helper.d.ts +263 -0
  44. package/lib/esm/Deserialization/Helper.d.ts.map +1 -0
  45. package/lib/esm/Deserialization/Helper.js +871 -0
  46. package/lib/esm/Deserialization/Helper.js.map +1 -0
  47. package/lib/esm/Deserialization/JsonParser.d.ts +166 -0
  48. package/lib/esm/Deserialization/JsonParser.d.ts.map +1 -0
  49. package/lib/esm/Deserialization/JsonParser.js +677 -0
  50. package/lib/esm/Deserialization/JsonParser.js.map +1 -0
  51. package/lib/esm/Deserialization/JsonProps.d.ts +273 -0
  52. package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -0
  53. package/lib/esm/Deserialization/JsonProps.js +9 -0
  54. package/lib/esm/Deserialization/JsonProps.js.map +1 -0
  55. package/lib/esm/Deserialization/SchemaGraphUtil.d.ts +35 -0
  56. package/lib/esm/Deserialization/SchemaGraphUtil.d.ts.map +1 -0
  57. package/lib/esm/Deserialization/SchemaGraphUtil.js +74 -0
  58. package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -0
  59. package/lib/esm/Deserialization/XmlParser.d.ts +86 -0
  60. package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -0
  61. package/lib/esm/Deserialization/XmlParser.js +970 -0
  62. package/lib/esm/Deserialization/XmlParser.js.map +1 -0
  63. package/lib/esm/Deserialization/XmlSerializationUtils.d.ts +55 -0
  64. package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -0
  65. package/lib/esm/Deserialization/XmlSerializationUtils.js +172 -0
  66. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -0
  67. package/lib/esm/ECName.d.ts +31 -0
  68. package/lib/esm/ECName.d.ts.map +1 -0
  69. package/lib/esm/ECName.js +82 -0
  70. package/lib/esm/ECName.js.map +1 -0
  71. package/lib/esm/ECObjects.d.ts +166 -0
  72. package/lib/esm/ECObjects.d.ts.map +1 -0
  73. package/lib/esm/ECObjects.js +422 -0
  74. package/lib/esm/ECObjects.js.map +1 -0
  75. package/lib/esm/Exception.d.ts +45 -0
  76. package/lib/esm/Exception.d.ts.map +1 -0
  77. package/lib/esm/Exception.js +82 -0
  78. package/lib/esm/Exception.js.map +1 -0
  79. package/lib/esm/Interfaces.d.ts +79 -0
  80. package/lib/esm/Interfaces.d.ts.map +1 -0
  81. package/lib/esm/Interfaces.js +9 -0
  82. package/lib/esm/Interfaces.js.map +1 -0
  83. package/lib/esm/Metadata/Class.d.ts +245 -0
  84. package/lib/esm/Metadata/Class.d.ts.map +1 -0
  85. package/lib/esm/Metadata/Class.js +552 -0
  86. package/lib/esm/Metadata/Class.js.map +1 -0
  87. package/lib/esm/Metadata/Constant.d.ts +65 -0
  88. package/lib/esm/Metadata/Constant.d.ts.map +1 -0
  89. package/lib/esm/Metadata/Constant.js +119 -0
  90. package/lib/esm/Metadata/Constant.js.map +1 -0
  91. package/lib/esm/Metadata/CustomAttribute.d.ts +24 -0
  92. package/lib/esm/Metadata/CustomAttribute.d.ts.map +1 -0
  93. package/lib/esm/Metadata/CustomAttribute.js +24 -0
  94. package/lib/esm/Metadata/CustomAttribute.js.map +1 -0
  95. package/lib/esm/Metadata/CustomAttributeClass.d.ts +44 -0
  96. package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -0
  97. package/lib/esm/Metadata/CustomAttributeClass.js +70 -0
  98. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -0
  99. package/lib/esm/Metadata/EntityClass.d.ts +78 -0
  100. package/lib/esm/Metadata/EntityClass.d.ts.map +1 -0
  101. package/lib/esm/Metadata/EntityClass.js +224 -0
  102. package/lib/esm/Metadata/EntityClass.js.map +1 -0
  103. package/lib/esm/Metadata/Enumeration.d.ts +87 -0
  104. package/lib/esm/Metadata/Enumeration.d.ts.map +1 -0
  105. package/lib/esm/Metadata/Enumeration.js +155 -0
  106. package/lib/esm/Metadata/Enumeration.js.map +1 -0
  107. package/lib/esm/Metadata/Format.d.ts +99 -0
  108. package/lib/esm/Metadata/Format.d.ts.map +1 -0
  109. package/lib/esm/Metadata/Format.js +238 -0
  110. package/lib/esm/Metadata/Format.js.map +1 -0
  111. package/lib/esm/Metadata/InvertedUnit.d.ts +50 -0
  112. package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -0
  113. package/lib/esm/Metadata/InvertedUnit.js +93 -0
  114. package/lib/esm/Metadata/InvertedUnit.js.map +1 -0
  115. package/lib/esm/Metadata/KindOfQuantity.d.ts +72 -0
  116. package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -0
  117. package/lib/esm/Metadata/KindOfQuantity.js +229 -0
  118. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -0
  119. package/lib/esm/Metadata/Mixin.d.ts +55 -0
  120. package/lib/esm/Metadata/Mixin.d.ts.map +1 -0
  121. package/lib/esm/Metadata/Mixin.js +109 -0
  122. package/lib/esm/Metadata/Mixin.js.map +1 -0
  123. package/lib/esm/Metadata/OverrideFormat.d.ts +68 -0
  124. package/lib/esm/Metadata/OverrideFormat.d.ts.map +1 -0
  125. package/lib/esm/Metadata/OverrideFormat.js +124 -0
  126. package/lib/esm/Metadata/OverrideFormat.js.map +1 -0
  127. package/lib/esm/Metadata/Phenomenon.d.ts +34 -0
  128. package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -0
  129. package/lib/esm/Metadata/Phenomenon.js +55 -0
  130. package/lib/esm/Metadata/Phenomenon.js.map +1 -0
  131. package/lib/esm/Metadata/Property.d.ts +247 -0
  132. package/lib/esm/Metadata/Property.d.ts.map +1 -0
  133. package/lib/esm/Metadata/Property.js +565 -0
  134. package/lib/esm/Metadata/Property.js.map +1 -0
  135. package/lib/esm/Metadata/PropertyCategory.d.ts +40 -0
  136. package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -0
  137. package/lib/esm/Metadata/PropertyCategory.js +57 -0
  138. package/lib/esm/Metadata/PropertyCategory.js.map +1 -0
  139. package/lib/esm/Metadata/RelationshipClass.d.ts +170 -0
  140. package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -0
  141. package/lib/esm/Metadata/RelationshipClass.js +380 -0
  142. package/lib/esm/Metadata/RelationshipClass.js.map +1 -0
  143. package/lib/esm/Metadata/Schema.d.ts +330 -0
  144. package/lib/esm/Metadata/Schema.d.ts.map +1 -0
  145. package/lib/esm/Metadata/Schema.js +570 -0
  146. package/lib/esm/Metadata/Schema.js.map +1 -0
  147. package/lib/esm/Metadata/SchemaItem.d.ts +67 -0
  148. package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -0
  149. package/lib/esm/Metadata/SchemaItem.js +140 -0
  150. package/lib/esm/Metadata/SchemaItem.js.map +1 -0
  151. package/lib/esm/Metadata/Unit.d.ts +77 -0
  152. package/lib/esm/Metadata/Unit.d.ts.map +1 -0
  153. package/lib/esm/Metadata/Unit.js +158 -0
  154. package/lib/esm/Metadata/Unit.js.map +1 -0
  155. package/lib/esm/Metadata/UnitSystem.d.ts +21 -0
  156. package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -0
  157. package/lib/esm/Metadata/UnitSystem.js +25 -0
  158. package/lib/esm/Metadata/UnitSystem.js.map +1 -0
  159. package/lib/esm/PropertyTypes.d.ts +50 -0
  160. package/lib/esm/PropertyTypes.d.ts.map +1 -0
  161. package/lib/esm/PropertyTypes.js +88 -0
  162. package/lib/esm/PropertyTypes.js.map +1 -0
  163. package/lib/esm/SchemaJsonLocater.d.ts +42 -0
  164. package/lib/esm/SchemaJsonLocater.d.ts.map +1 -0
  165. package/lib/esm/SchemaJsonLocater.js +54 -0
  166. package/lib/esm/SchemaJsonLocater.js.map +1 -0
  167. package/lib/esm/SchemaKey.d.ts +111 -0
  168. package/lib/esm/SchemaKey.d.ts.map +1 -0
  169. package/lib/esm/SchemaKey.js +214 -0
  170. package/lib/esm/SchemaKey.js.map +1 -0
  171. package/lib/esm/SchemaLoader.d.ts +32 -0
  172. package/lib/esm/SchemaLoader.d.ts.map +1 -0
  173. package/lib/esm/SchemaLoader.js +53 -0
  174. package/lib/esm/SchemaLoader.js.map +1 -0
  175. package/lib/esm/SchemaPartVisitorDelegate.d.ts +275 -0
  176. package/lib/esm/SchemaPartVisitorDelegate.d.ts.map +1 -0
  177. package/lib/esm/SchemaPartVisitorDelegate.js +209 -0
  178. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -0
  179. package/lib/esm/UnitConversion/Graph.d.ts +35 -0
  180. package/lib/esm/UnitConversion/Graph.d.ts.map +1 -0
  181. package/lib/esm/UnitConversion/Graph.js +80 -0
  182. package/lib/esm/UnitConversion/Graph.js.map +1 -0
  183. package/lib/esm/UnitConversion/Parser.d.ts +9 -0
  184. package/lib/esm/UnitConversion/Parser.d.ts.map +1 -0
  185. package/lib/esm/UnitConversion/Parser.js +39 -0
  186. package/lib/esm/UnitConversion/Parser.js.map +1 -0
  187. package/lib/esm/UnitConversion/UnitConversion.d.ts +46 -0
  188. package/lib/esm/UnitConversion/UnitConversion.d.ts.map +1 -0
  189. package/lib/esm/UnitConversion/UnitConversion.js +74 -0
  190. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -0
  191. package/lib/esm/UnitConversion/UnitConverter.d.ts +40 -0
  192. package/lib/esm/UnitConversion/UnitConverter.d.ts.map +1 -0
  193. package/lib/esm/UnitConversion/UnitConverter.js +113 -0
  194. package/lib/esm/UnitConversion/UnitConverter.js.map +1 -0
  195. package/lib/esm/UnitConversion/UnitTree.d.ts +44 -0
  196. package/lib/esm/UnitConversion/UnitTree.d.ts.map +1 -0
  197. package/lib/esm/UnitConversion/UnitTree.js +165 -0
  198. package/lib/esm/UnitConversion/UnitTree.js.map +1 -0
  199. package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts +78 -0
  200. package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -0
  201. package/lib/esm/UnitProvider/SchemaUnitProvider.js +231 -0
  202. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -0
  203. package/lib/esm/Validation/SchemaWalker.d.ts +24 -0
  204. package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -0
  205. package/lib/esm/Validation/SchemaWalker.js +50 -0
  206. package/lib/esm/Validation/SchemaWalker.js.map +1 -0
  207. package/lib/esm/ecschema-metadata.d.ts +52 -0
  208. package/lib/esm/ecschema-metadata.d.ts.map +1 -0
  209. package/lib/esm/ecschema-metadata.js +55 -0
  210. package/lib/esm/ecschema-metadata.js.map +1 -0
  211. package/lib/esm/utils/SchemaGraph.d.ts +44 -0
  212. package/lib/esm/utils/SchemaGraph.d.ts.map +1 -0
  213. package/lib/esm/utils/SchemaGraph.js +111 -0
  214. package/lib/esm/utils/SchemaGraph.js.map +1 -0
  215. package/package.json +9 -7
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaUnitProvider.js","sourceRoot":"","sources":["../../../src/UnitProvider/SchemaUnitProvider.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sDAAkE;AAElE,wCAA2D;AAC3D,uDAAoD;AACpD,4CAAwD;AACxD,2CAAwC;AACxC,4CAA8C;AAC9C,mEAAgE;AAEhE;;;GAGG;AACH,MAAa,kBAAkB;IAI7B;;;;;;OAMG;IACH,YAAY,gBAAgC,EAAU,iBAAkC,EAAE;QAApC,mBAAc,GAAd,cAAc,CAAsB;QACxF,IAAI,g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UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,UAAU;wBAC9D,IAAI,CAAC,UAAU,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;4BACrF,IAAI,CAAC,UAAU,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;gCACrF,OAAO,IAAI,CAAC;gBACpB,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,IAAI,2BAAY,CAAC,4BAAa,CAAC,KAAK,EAAE,+CAA+C,EAAE,GAAG,EAAE;YAChG,OAAO,EAAE,eAAe,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA5OD,gDA4OC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { BentleyError, BentleyStatus } from \"@itwin/core-bentley\";\r\nimport { UnitConversionProps, UnitExtraData, UnitProps, UnitsProvider } from \"@itwin/core-quantity\";\r\nimport { ISchemaLocater, SchemaContext } from \"../Context\";\r\nimport { SchemaItem } from \"../Metadata/SchemaItem\";\r\nimport { SchemaItemKey, SchemaKey } from \"../SchemaKey\";\r\nimport { Unit } from \"../Metadata/Unit\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { UnitConverter } from \"../UnitConversion/UnitConverter\";\r\n\r\n/**\r\n * Class used to find Units in SchemaContext by attributes such as Phenomenon and DisplayLabel.\r\n * @alpha\r\n */\r\nexport class SchemaUnitProvider implements UnitsProvider {\r\n private _unitConverter: UnitConverter;\r\n private _context: SchemaContext;\r\n\r\n /**\r\n *\r\n * @param contextOrLocater The SchemaContext or a different ISchemaLocater implementation used to retrieve the schema. The SchemaContext\r\n * class implements the ISchemaLocater interface. If the provided locater is not a SchemaContext instance a new SchemaContext will be\r\n * created and the locater will be added.\r\n * @param _unitExtraData Additional data like alternate display label not found in Units Schema to match with Units; Defaults to empty array.\r\n */\r\n constructor(contextOrLocater: ISchemaLocater, private _unitExtraData: UnitExtraData[] = []){\r\n if (contextOrLocater instanceof SchemaContext) {\r\n this._context = contextOrLocater;\r\n } else {\r\n this._context = new SchemaContext();\r\n this._context.addLocater(contextOrLocater);\r\n }\r\n this._unitConverter = new UnitConverter(this._context);\r\n }\r\n\r\n /**\r\n * Find unit in a schema that has unitName.\r\n * @param unitName Full name of unit.\r\n * @returns UnitProps interface from @itwin/core-quantity whose name matches unitName.\r\n */\r\n public async findUnitByName(unitName: string): Promise<UnitProps> {\r\n const unit = await this.findECUnitByName(unitName);\r\n return this.getUnitsProps(unit);\r\n }\r\n\r\n /**\r\n * Find all units in context that belongs to given phenomenon.\r\n * @param phenomenon Full name of phenomenon.\r\n * @returns Array of UnitProps (from @itwin/core-quantity) interface objects whose name matches phenomenon param.\r\n */\r\n public async getUnitsByFamily(phenomenon: string): Promise<Array<UnitProps>> {\r\n // Check if schema exists and phenomenon exists in schema\r\n const [schemaName, schemaItemName] = SchemaItem.parseFullName(phenomenon);\r\n const schemaKey = new SchemaKey(schemaName);\r\n const schema = await this._context.getSchema(schemaKey);\r\n\r\n if (!schema) {\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find schema for phenomenon\", () => {\r\n return { phenomenon, schema: schemaName };\r\n });\r\n }\r\n\r\n const itemKey = new SchemaItemKey(schemaItemName, schema.schemaKey);\r\n const phenom = await this._context.getSchemaItem(itemKey);\r\n if (!phenom)\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find schema item/phenomenon\", () => {\r\n return { item: schemaItemName, schema: schemaName };\r\n });\r\n\r\n if (phenom.schemaItemType !== SchemaItemType.Phenomenon)\r\n throw new BentleyError(BentleyStatus.ERROR, \"Item is not a phenomenon\", () => {\r\n return { itemType: phenom.key.fullName };\r\n });\r\n\r\n // Find units' full name that match given phenomenon param.\r\n const filteredUnits: Array<UnitProps> = [];\r\n const schemaItems = this._context.getSchemaItems();\r\n let { value, done } = schemaItems.next();\r\n while (!done) {\r\n if (Unit.isUnit(value)) {\r\n const foundPhenomenon = await value.phenomenon;\r\n if (foundPhenomenon && foundPhenomenon.key.matchesFullName(phenomenon)) {\r\n const unitProps = this.getUnitsProps(value);\r\n filteredUnits.push(unitProps);\r\n }\r\n }\r\n ({ value, done } = schemaItems.next());\r\n }\r\n\r\n return filteredUnits;\r\n }\r\n\r\n /**\r\n * Find alternate display labels associated with unitName, if any.\r\n * @param unitName Full name of Unit.\r\n */\r\n public getAlternateDisplayLabels(unitName: string): Array<string> {\r\n let alternateLabels: Array<string> = [];\r\n for (const entry of this._unitExtraData) {\r\n if (entry.name.toLowerCase() === unitName.toLowerCase()) {\r\n alternateLabels = entry.altDisplayLabels;\r\n }\r\n }\r\n\r\n return alternateLabels;\r\n }\r\n\r\n /**\r\n * Finds Unit by unitLabel, which could be a display label in the schema or alternate an display label defined in\r\n * this._unitExtraData. If there are duplicates of the same display label in the context or teh same alternate display\r\n * labels, specify schemaName, phenomenon, or unitSystem to get a specific unit.\r\n *\r\n * @param unitLabel Display label or alternate display label to query unit by.\r\n * @param schemaName Ensure Unit with unitLabel belongs to Schema with schemaName.\r\n * @param phenomenon Full name of phenomenon that Unit belongs to.\r\n * @param unitSystem Full name of unitSystem that Unit belongs to.\r\n * @returns The UnitProps interface from the @itwin/core-quantity package.\r\n */\r\n public async findUnit(unitLabel: string, schemaName?: string, phenomenon?: string, unitSystem?: string): Promise<UnitProps> {\r\n const findLabel = unitLabel.toLowerCase();\r\n const findSchema = schemaName ? schemaName.toLowerCase() : undefined;\r\n const findPhenomenon = phenomenon ? phenomenon.toLowerCase() : undefined;\r\n const findUnitSystem = unitSystem ? unitSystem.toLowerCase() : undefined;\r\n let foundUnit: Unit | undefined;\r\n\r\n try {\r\n try {\r\n foundUnit = await this.findUnitByDisplayLabel(findLabel, findSchema, findPhenomenon, findUnitSystem);\r\n } catch (err) {\r\n // If there is no Unit with display label that matches label, then check for alternate display labels that may match\r\n foundUnit = await this.findUnitByAltDisplayLabel(findLabel, findSchema, findPhenomenon, findUnitSystem);\r\n }\r\n } catch (err) {\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find unit with label\", () => {\r\n return { unitLabel };\r\n });\r\n }\r\n\r\n return this.getUnitsProps(foundUnit);\r\n }\r\n\r\n /**\r\n * Gets the @itwin/core-quantity UnitConversionProps for the given fromUnit and toUnit.\r\n * @param fromUnit The UnitProps of the 'from' unit.\r\n * @param toUnit The UnitProps of the 'to' unit.\r\n * @returns The UnitConversionProps interface from the @itwin/core-quantity package.\r\n */\r\n public async getConversion(fromUnit: UnitProps, toUnit: UnitProps): Promise<UnitConversionProps> {\r\n const conversion = await this._unitConverter.calculateConversion(fromUnit.name, toUnit.name);\r\n return {\r\n factor: conversion.factor,\r\n offset: conversion.offset,\r\n };\r\n }\r\n\r\n /**\r\n * Find unit in a schema that has unitName.\r\n * @param unitName Full name of unit.\r\n * @returns Unit whose full name matches unitName.\r\n */\r\n private async findECUnitByName(unitName: string): Promise<Unit> {\r\n // Check if schema exists and unit exists in schema\r\n const [schemaName, schemaItemName] = SchemaItem.parseFullName(unitName);\r\n const schemaKey = new SchemaKey(schemaName);\r\n const schema = await this._context.getSchema(schemaKey);\r\n\r\n if (!schema) {\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find schema for unit\", () => {\r\n return { schema: schemaName, unit: unitName };\r\n });\r\n }\r\n\r\n const itemKey = new SchemaItemKey(schemaItemName, schema.schemaKey);\r\n const item = await this._context.getSchemaItem<Unit>(itemKey);\r\n if (!item)\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find schema item/unit\", () => {\r\n return { item: schemaItemName, schema: schemaName };\r\n });\r\n\r\n if (item.schemaItemType === SchemaItemType.Unit)\r\n return item;\r\n\r\n throw new BentleyError(BentleyStatus.ERROR, \"Item is not a unit\", () => {\r\n return { itemType: item.key.fullName };\r\n });\r\n }\r\n\r\n /**\r\n * Gets the @itwin/core UnitProps for the given Unit.\r\n * @param unit The Unit to convert.\r\n * @returns UnitProps interface from @itwin/core.\r\n */\r\n private getUnitsProps(unit: Unit): UnitProps {\r\n return {\r\n name: unit.fullName,\r\n label: unit.label ?? \"\",\r\n phenomenon: unit.phenomenon ? unit.phenomenon.fullName : \"\",\r\n isValid: true,\r\n system: unit.unitSystem === undefined ? \"\" : unit.unitSystem.fullName,\r\n };\r\n }\r\n\r\n /**\r\n * Finds Unit by displayLabel and that it belongs to schemaName, phenomenon, and unitSystem if defined.\r\n * @internal\r\n */\r\n private async findUnitByDisplayLabel(displayLabel: string, schemaName?: string, phenomenon?: string, unitSystem?: string): Promise<Unit> {\r\n const schemaItems = this._context.getSchemaItems();\r\n let { value, done } = schemaItems.next();\r\n while (!done) {\r\n if (Unit.isUnit(value) && value.label?.toLowerCase() === displayLabel) {\r\n const currPhenomenon = await value.phenomenon;\r\n const currUnitSystem = await value.unitSystem;\r\n if (!schemaName || value.schema.name.toLowerCase() === schemaName)\r\n if (!phenomenon || (currPhenomenon && currPhenomenon.key.matchesFullName(phenomenon)))\r\n if (!unitSystem || (currUnitSystem && currUnitSystem.key.matchesFullName(unitSystem)))\r\n return value;\r\n }\r\n ({ value, done } = schemaItems.next());\r\n }\r\n\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find unit with display label\", () => {\r\n return { displayLabel };\r\n });\r\n }\r\n\r\n /**\r\n * Finds Unit by altDisplayLabel and that it belongs to schemaName, phenomenon, and unitSystem if defined.\r\n * @internal\r\n */\r\n private async findUnitByAltDisplayLabel(altDisplayLabel: string, schemaName?: string, phenomenon?: string, unitSystem?: string): Promise<Unit> {\r\n for (const entry of this._unitExtraData) {\r\n if (entry.altDisplayLabels && entry.altDisplayLabels.length > 0) {\r\n if (entry.altDisplayLabels.findIndex((ref: string) => ref.toLowerCase() === altDisplayLabel) !== -1) {\r\n // Found altDisplayLabel that matches label to find\r\n const unit = await this.findECUnitByName(entry.name);\r\n const foundPhenomenon = await unit.phenomenon;\r\n const foundUnitSystem = await unit.unitSystem;\r\n if (!schemaName || unit.schema.name.toLowerCase() === schemaName)\r\n if (!phenomenon || (foundPhenomenon && foundPhenomenon.key.matchesFullName(phenomenon)))\r\n if (!unitSystem || (foundUnitSystem && foundUnitSystem.key.matchesFullName(unitSystem)))\r\n return unit;\r\n }\r\n }\r\n }\r\n\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find unit with alternate display label\", () => {\r\n return { altDisplayLabel };\r\n });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SchemaUnitProvider.js","sourceRoot":"","sources":["../../../src/UnitProvider/SchemaUnitProvider.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sDAAkE;AAElE,wCAA2D;AAC3D,uDAAoD;AACpD,4CAAwD;AACxD,2CAAwC;AACxC,4CAA8C;AAC9C,mEAAgE;AAEhE;;;GAGG;AACH,MAAa,kBAAkB;IAI7B;;;;;;OAMG;IACH,YAAY,gBAAgC,EAAU,iBAAkC,EAAE;QAApC,mBAAc,GAAd,cAAc,CAAsB;QACxF,IAAI,gBAAgB,YAAY,uBAAa,EAAE,CAAC;YAC9C,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAC;QACnC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,GAAG,IAAI,uBAAa,EAAE,CAAC;YACpC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,cAAc,GAAG,IAAI,6BAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,cAAc,CAAC,QAAgB;QAC1C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC,aAAa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IACL,CAAC;CACF;AA5OD,gDA4OC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { BentleyError, BentleyStatus } from \"@itwin/core-bentley\";\r\nimport { UnitConversionProps, UnitExtraData, UnitProps, UnitsProvider } from \"@itwin/core-quantity\";\r\nimport { ISchemaLocater, SchemaContext } from \"../Context\";\r\nimport { SchemaItem } from \"../Metadata/SchemaItem\";\r\nimport { SchemaItemKey, SchemaKey } from \"../SchemaKey\";\r\nimport { Unit } from \"../Metadata/Unit\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { UnitConverter } from \"../UnitConversion/UnitConverter\";\r\n\r\n/**\r\n * Class used to find Units in SchemaContext by attributes such as Phenomenon and DisplayLabel.\r\n * @beta\r\n */\r\nexport class SchemaUnitProvider implements UnitsProvider {\r\n private _unitConverter: UnitConverter;\r\n private _context: SchemaContext;\r\n\r\n /**\r\n *\r\n * @param contextOrLocater The SchemaContext or a different ISchemaLocater implementation used to retrieve the schema. The SchemaContext\r\n * class implements the ISchemaLocater interface. If the provided locater is not a SchemaContext instance a new SchemaContext will be\r\n * created and the locater will be added.\r\n * @param _unitExtraData Additional data like alternate display label not found in Units Schema to match with Units; Defaults to empty array.\r\n */\r\n constructor(contextOrLocater: ISchemaLocater, private _unitExtraData: UnitExtraData[] = []){\r\n if (contextOrLocater instanceof SchemaContext) {\r\n this._context = contextOrLocater;\r\n } else {\r\n this._context = new SchemaContext();\r\n this._context.addLocater(contextOrLocater);\r\n }\r\n this._unitConverter = new UnitConverter(this._context);\r\n }\r\n\r\n /**\r\n * Find unit in a schema that has unitName.\r\n * @param unitName Full name of unit.\r\n * @returns UnitProps interface from @itwin/core-quantity whose name matches unitName.\r\n */\r\n public async findUnitByName(unitName: string): Promise<UnitProps> {\r\n const unit = await this.findECUnitByName(unitName);\r\n return this.getUnitsProps(unit);\r\n }\r\n\r\n /**\r\n * Find all units in context that belongs to given phenomenon.\r\n * @param phenomenon Full name of phenomenon.\r\n * @returns Array of UnitProps (from @itwin/core-quantity) interface objects whose name matches phenomenon param.\r\n */\r\n public async getUnitsByFamily(phenomenon: string): Promise<Array<UnitProps>> {\r\n // Check if schema exists and phenomenon exists in schema\r\n const [schemaName, schemaItemName] = SchemaItem.parseFullName(phenomenon);\r\n const schemaKey = new SchemaKey(schemaName);\r\n const schema = await this._context.getSchema(schemaKey);\r\n\r\n if (!schema) {\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find schema for phenomenon\", () => {\r\n return { phenomenon, schema: schemaName };\r\n });\r\n }\r\n\r\n const itemKey = new SchemaItemKey(schemaItemName, schema.schemaKey);\r\n const phenom = await this._context.getSchemaItem(itemKey);\r\n if (!phenom)\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find schema item/phenomenon\", () => {\r\n return { item: schemaItemName, schema: schemaName };\r\n });\r\n\r\n if (phenom.schemaItemType !== SchemaItemType.Phenomenon)\r\n throw new BentleyError(BentleyStatus.ERROR, \"Item is not a phenomenon\", () => {\r\n return { itemType: phenom.key.fullName };\r\n });\r\n\r\n // Find units' full name that match given phenomenon param.\r\n const filteredUnits: Array<UnitProps> = [];\r\n const schemaItems = this._context.getSchemaItems();\r\n let { value, done } = schemaItems.next();\r\n while (!done) {\r\n if (Unit.isUnit(value)) {\r\n const foundPhenomenon = await value.phenomenon;\r\n if (foundPhenomenon && foundPhenomenon.key.matchesFullName(phenomenon)) {\r\n const unitProps = this.getUnitsProps(value);\r\n filteredUnits.push(unitProps);\r\n }\r\n }\r\n ({ value, done } = schemaItems.next());\r\n }\r\n\r\n return filteredUnits;\r\n }\r\n\r\n /**\r\n * Find alternate display labels associated with unitName, if any.\r\n * @param unitName Full name of Unit.\r\n */\r\n public getAlternateDisplayLabels(unitName: string): Array<string> {\r\n let alternateLabels: Array<string> = [];\r\n for (const entry of this._unitExtraData) {\r\n if (entry.name.toLowerCase() === unitName.toLowerCase()) {\r\n alternateLabels = entry.altDisplayLabels;\r\n }\r\n }\r\n\r\n return alternateLabels;\r\n }\r\n\r\n /**\r\n * Finds Unit by unitLabel, which could be a display label in the schema or alternate an display label defined in\r\n * this._unitExtraData. If there are duplicates of the same display label in the context or teh same alternate display\r\n * labels, specify schemaName, phenomenon, or unitSystem to get a specific unit.\r\n *\r\n * @param unitLabel Display label or alternate display label to query unit by.\r\n * @param schemaName Ensure Unit with unitLabel belongs to Schema with schemaName.\r\n * @param phenomenon Full name of phenomenon that Unit belongs to.\r\n * @param unitSystem Full name of unitSystem that Unit belongs to.\r\n * @returns The UnitProps interface from the @itwin/core-quantity package.\r\n */\r\n public async findUnit(unitLabel: string, schemaName?: string, phenomenon?: string, unitSystem?: string): Promise<UnitProps> {\r\n const findLabel = unitLabel.toLowerCase();\r\n const findSchema = schemaName ? schemaName.toLowerCase() : undefined;\r\n const findPhenomenon = phenomenon ? phenomenon.toLowerCase() : undefined;\r\n const findUnitSystem = unitSystem ? unitSystem.toLowerCase() : undefined;\r\n let foundUnit: Unit | undefined;\r\n\r\n try {\r\n try {\r\n foundUnit = await this.findUnitByDisplayLabel(findLabel, findSchema, findPhenomenon, findUnitSystem);\r\n } catch (err) {\r\n // If there is no Unit with display label that matches label, then check for alternate display labels that may match\r\n foundUnit = await this.findUnitByAltDisplayLabel(findLabel, findSchema, findPhenomenon, findUnitSystem);\r\n }\r\n } catch (err) {\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find unit with label\", () => {\r\n return { unitLabel };\r\n });\r\n }\r\n\r\n return this.getUnitsProps(foundUnit);\r\n }\r\n\r\n /**\r\n * Gets the @itwin/core-quantity UnitConversionProps for the given fromUnit and toUnit.\r\n * @param fromUnit The UnitProps of the 'from' unit.\r\n * @param toUnit The UnitProps of the 'to' unit.\r\n * @returns The UnitConversionProps interface from the @itwin/core-quantity package.\r\n */\r\n public async getConversion(fromUnit: UnitProps, toUnit: UnitProps): Promise<UnitConversionProps> {\r\n const conversion = await this._unitConverter.calculateConversion(fromUnit.name, toUnit.name);\r\n return {\r\n factor: conversion.factor,\r\n offset: conversion.offset,\r\n };\r\n }\r\n\r\n /**\r\n * Find unit in a schema that has unitName.\r\n * @param unitName Full name of unit.\r\n * @returns Unit whose full name matches unitName.\r\n */\r\n private async findECUnitByName(unitName: string): Promise<Unit> {\r\n // Check if schema exists and unit exists in schema\r\n const [schemaName, schemaItemName] = SchemaItem.parseFullName(unitName);\r\n const schemaKey = new SchemaKey(schemaName);\r\n const schema = await this._context.getSchema(schemaKey);\r\n\r\n if (!schema) {\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find schema for unit\", () => {\r\n return { schema: schemaName, unit: unitName };\r\n });\r\n }\r\n\r\n const itemKey = new SchemaItemKey(schemaItemName, schema.schemaKey);\r\n const item = await this._context.getSchemaItem<Unit>(itemKey);\r\n if (!item)\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find schema item/unit\", () => {\r\n return { item: schemaItemName, schema: schemaName };\r\n });\r\n\r\n if (item.schemaItemType === SchemaItemType.Unit)\r\n return item;\r\n\r\n throw new BentleyError(BentleyStatus.ERROR, \"Item is not a unit\", () => {\r\n return { itemType: item.key.fullName };\r\n });\r\n }\r\n\r\n /**\r\n * Gets the @itwin/core UnitProps for the given Unit.\r\n * @param unit The Unit to convert.\r\n * @returns UnitProps interface from @itwin/core.\r\n */\r\n private getUnitsProps(unit: Unit): UnitProps {\r\n return {\r\n name: unit.fullName,\r\n label: unit.label ?? \"\",\r\n phenomenon: unit.phenomenon ? unit.phenomenon.fullName : \"\",\r\n isValid: true,\r\n system: unit.unitSystem === undefined ? \"\" : unit.unitSystem.fullName,\r\n };\r\n }\r\n\r\n /**\r\n * Finds Unit by displayLabel and that it belongs to schemaName, phenomenon, and unitSystem if defined.\r\n * @internal\r\n */\r\n private async findUnitByDisplayLabel(displayLabel: string, schemaName?: string, phenomenon?: string, unitSystem?: string): Promise<Unit> {\r\n const schemaItems = this._context.getSchemaItems();\r\n let { value, done } = schemaItems.next();\r\n while (!done) {\r\n if (Unit.isUnit(value) && value.label?.toLowerCase() === displayLabel) {\r\n const currPhenomenon = await value.phenomenon;\r\n const currUnitSystem = await value.unitSystem;\r\n if (!schemaName || value.schema.name.toLowerCase() === schemaName)\r\n if (!phenomenon || (currPhenomenon && currPhenomenon.key.matchesFullName(phenomenon)))\r\n if (!unitSystem || (currUnitSystem && currUnitSystem.key.matchesFullName(unitSystem)))\r\n return value;\r\n }\r\n ({ value, done } = schemaItems.next());\r\n }\r\n\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find unit with display label\", () => {\r\n return { displayLabel };\r\n });\r\n }\r\n\r\n /**\r\n * Finds Unit by altDisplayLabel and that it belongs to schemaName, phenomenon, and unitSystem if defined.\r\n * @internal\r\n */\r\n private async findUnitByAltDisplayLabel(altDisplayLabel: string, schemaName?: string, phenomenon?: string, unitSystem?: string): Promise<Unit> {\r\n for (const entry of this._unitExtraData) {\r\n if (entry.altDisplayLabels && entry.altDisplayLabels.length > 0) {\r\n if (entry.altDisplayLabels.findIndex((ref: string) => ref.toLowerCase() === altDisplayLabel) !== -1) {\r\n // Found altDisplayLabel that matches label to find\r\n const unit = await this.findECUnitByName(entry.name);\r\n const foundPhenomenon = await unit.phenomenon;\r\n const foundUnitSystem = await unit.unitSystem;\r\n if (!schemaName || unit.schema.name.toLowerCase() === schemaName)\r\n if (!phenomenon || (foundPhenomenon && foundPhenomenon.key.matchesFullName(phenomenon)))\r\n if (!unitSystem || (foundUnitSystem && foundUnitSystem.key.matchesFullName(unitSystem)))\r\n return unit;\r\n }\r\n }\r\n }\r\n\r\n throw new BentleyError(BentleyStatus.ERROR, \"Cannot find unit with alternate display label\", () => {\r\n return { altDisplayLabel };\r\n });\r\n }\r\n}\r\n"]}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare class ECStringConstants {
5
+ static readonly RELATIONSHIP_END_SOURCE: string;
6
+ static readonly RELATIONSHIP_END_TARGET: string;
7
+ static readonly CONTAINERTYPE_SCHEMA: string;
8
+ static readonly CONTAINERTYPE_ENTITYCLASS: string;
9
+ static readonly CONTAINERTYPE_CUSTOMATTRIBUTECLASS: string;
10
+ static readonly CONTAINERTYPE_STRUCTCLASS: string;
11
+ static readonly CONTAINERTYPE_RELATIONSHIPCLASS: string;
12
+ static readonly CONTAINERTYPE_ANYCLASS: string;
13
+ static readonly CONTAINERTYPE_PRIMITIVEPROPERTY: string;
14
+ static readonly CONTAINERTYPE_STRUCTPROPERTY: string;
15
+ static readonly CONTAINERTYPE_PRIMITIVEARRAYPROPERTY: string;
16
+ static readonly CONTAINERTYPE_STRUCTARRAYPROPERTY: string;
17
+ static readonly CONTAINERTYPE_NAVIGATIONPROPERTY: string;
18
+ static readonly CONTAINERTYPE_ANYPROPERTY: string;
19
+ static readonly CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT: string;
20
+ static readonly CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT: string;
21
+ static readonly CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT: string;
22
+ static readonly CONTAINERTYPE_ANY: string;
23
+ }
24
+ //# sourceMappingURL=Constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,qBAAa,iBAAiB;IAE5B,gBAAuB,uBAAuB,EAAE,MAAM,CAAY;IAClE,gBAAuB,uBAAuB,EAAE,MAAM,CAAY;IAGlE,gBAAuB,oBAAoB,EAAE,MAAM,CAAY;IAC/D,gBAAuB,yBAAyB,EAAE,MAAM,CAAiB;IACzE,gBAAuB,kCAAkC,EAAE,MAAM,CAA0B;IAC3F,gBAAuB,yBAAyB,EAAE,MAAM,CAAiB;IACzE,gBAAuB,+BAA+B,EAAE,MAAM,CAAuB;IACrF,gBAAuB,sBAAsB,EAAE,MAAM,CAAc;IAEnE,gBAAuB,+BAA+B,EAAE,MAAM,CAAuB;IACrF,gBAAuB,4BAA4B,EAAE,MAAM,CAAoB;IAC/E,gBAAuB,oCAAoC,EAAE,MAAM,CAAmB;IACtF,gBAAuB,iCAAiC,EAAE,MAAM,CAAyB;IACzF,gBAAuB,gCAAgC,EAAE,MAAM,CAAwB;IACvF,gBAAuB,yBAAyB,EAAE,MAAM,CAAiB;IAEzE,gBAAuB,0CAA0C,EAAE,MAAM,CAAkC;IAC3G,gBAAuB,0CAA0C,EAAE,MAAM,CAAkC;IAC3G,gBAAuB,uCAAuC,EAAE,MAAM,CAA+B;IAErG,gBAAuB,iBAAiB,EAAE,MAAM,CAAS;CAC1D"}
@@ -0,0 +1,30 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * @internal
7
+ */
8
+ export class ECStringConstants {
9
+ }
10
+ // Relationship End
11
+ ECStringConstants.RELATIONSHIP_END_SOURCE = "Source";
12
+ ECStringConstants.RELATIONSHIP_END_TARGET = "Target";
13
+ // Container Type
14
+ ECStringConstants.CONTAINERTYPE_SCHEMA = "Schema";
15
+ ECStringConstants.CONTAINERTYPE_ENTITYCLASS = "EntityClass";
16
+ ECStringConstants.CONTAINERTYPE_CUSTOMATTRIBUTECLASS = "CustomAttributeClass";
17
+ ECStringConstants.CONTAINERTYPE_STRUCTCLASS = "StructClass";
18
+ ECStringConstants.CONTAINERTYPE_RELATIONSHIPCLASS = "RelationshipClass";
19
+ ECStringConstants.CONTAINERTYPE_ANYCLASS = "AnyClass";
20
+ ECStringConstants.CONTAINERTYPE_PRIMITIVEPROPERTY = "PrimitiveProperty";
21
+ ECStringConstants.CONTAINERTYPE_STRUCTPROPERTY = "StructProperty";
22
+ ECStringConstants.CONTAINERTYPE_PRIMITIVEARRAYPROPERTY = "ArrayProperty";
23
+ ECStringConstants.CONTAINERTYPE_STRUCTARRAYPROPERTY = "StructArrayProperty";
24
+ ECStringConstants.CONTAINERTYPE_NAVIGATIONPROPERTY = "NavigationProperty";
25
+ ECStringConstants.CONTAINERTYPE_ANYPROPERTY = "AnyProperty";
26
+ ECStringConstants.CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT = "SourceRelationshipConstraint";
27
+ ECStringConstants.CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT = "TargetRelationshipConstraint";
28
+ ECStringConstants.CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT = "AnyRelationshipConstraint";
29
+ ECStringConstants.CONTAINERTYPE_ANY = "Any";
30
+ //# sourceMappingURL=Constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,MAAM,OAAO,iBAAiB;;AAC5B,mBAAmB;AACI,yCAAuB,GAAW,QAAQ,CAAC;AAC3C,yCAAuB,GAAW,QAAQ,CAAC;AAElE,iBAAiB;AACM,sCAAoB,GAAW,QAAQ,CAAC;AACxC,2CAAyB,GAAW,aAAa,CAAC;AAClD,oDAAkC,GAAW,sBAAsB,CAAC;AACpE,2CAAyB,GAAW,aAAa,CAAC;AAClD,iDAA+B,GAAW,mBAAmB,CAAC;AAC9D,wCAAsB,GAAW,UAAU,CAAC;AAE5C,iDAA+B,GAAW,mBAAmB,CAAC;AAC9D,8CAA4B,GAAW,gBAAgB,CAAC;AACxD,sDAAoC,GAAW,eAAe,CAAC;AAC/D,mDAAiC,GAAW,qBAAqB,CAAC;AAClE,kDAAgC,GAAW,oBAAoB,CAAC;AAChE,2CAAyB,GAAW,aAAa,CAAC;AAElD,4DAA0C,GAAW,8BAA8B,CAAC;AACpF,4DAA0C,GAAW,8BAA8B,CAAC;AACpF,yDAAuC,GAAW,2BAA2B,CAAC;AAE9E,mCAAiB,GAAW,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class ECStringConstants {\r\n // Relationship End\r\n public static readonly RELATIONSHIP_END_SOURCE: string = \"Source\";\r\n public static readonly RELATIONSHIP_END_TARGET: string = \"Target\";\r\n\r\n // Container Type\r\n public static readonly CONTAINERTYPE_SCHEMA: string = \"Schema\";\r\n public static readonly CONTAINERTYPE_ENTITYCLASS: string = \"EntityClass\";\r\n public static readonly CONTAINERTYPE_CUSTOMATTRIBUTECLASS: string = \"CustomAttributeClass\";\r\n public static readonly CONTAINERTYPE_STRUCTCLASS: string = \"StructClass\";\r\n public static readonly CONTAINERTYPE_RELATIONSHIPCLASS: string = \"RelationshipClass\";\r\n public static readonly CONTAINERTYPE_ANYCLASS: string = \"AnyClass\";\r\n\r\n public static readonly CONTAINERTYPE_PRIMITIVEPROPERTY: string = \"PrimitiveProperty\";\r\n public static readonly CONTAINERTYPE_STRUCTPROPERTY: string = \"StructProperty\";\r\n public static readonly CONTAINERTYPE_PRIMITIVEARRAYPROPERTY: string = \"ArrayProperty\";\r\n public static readonly CONTAINERTYPE_STRUCTARRAYPROPERTY: string = \"StructArrayProperty\";\r\n public static readonly CONTAINERTYPE_NAVIGATIONPROPERTY: string = \"NavigationProperty\";\r\n public static readonly CONTAINERTYPE_ANYPROPERTY: string = \"AnyProperty\";\r\n\r\n public static readonly CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT: string = \"SourceRelationshipConstraint\";\r\n public static readonly CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT: string = \"TargetRelationshipConstraint\";\r\n public static readonly CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT: string = \"AnyRelationshipConstraint\";\r\n\r\n public static readonly CONTAINERTYPE_ANY: string = \"Any\";\r\n}\r\n"]}
@@ -0,0 +1,219 @@
1
+ import { SchemaMatchType } from "./ECObjects";
2
+ import { SchemaInfo } from "./Interfaces";
3
+ import { Schema } from "./Metadata/Schema";
4
+ import { SchemaItem } from "./Metadata/SchemaItem";
5
+ import { SchemaItemKey, SchemaKey } from "./SchemaKey";
6
+ /**
7
+ * The interface defines what is needed to be an `ISchemaLocater`.
8
+ * A Schema Locater loads the requested schema if it can or returns undefined.
9
+ * Schema Locaters should always load the schema on each request and should not hold a cache of schemas.
10
+ * Schema locaters should never be used directly to load a schema, they should be added to a `SchemaContext`
11
+ * and the context should be used to load schemas. The `SchemaContext` caches schemas and manages schema life time.
12
+ * @beta
13
+ */
14
+ export interface ISchemaLocater {
15
+ /**
16
+ * Attempts to get a schema from the locater. Yields undefined if no matching schema is found.
17
+ * For schemas that may have references, construct and call through a SchemaContext instead.
18
+ * @param schemaKey key to look up
19
+ * @param matchType how to match key against candidate schemas
20
+ * @param context context for loading schema references
21
+ */
22
+ getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined>;
23
+ /**
24
+ * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.
25
+ * May return the entire Schema so long as it is completely loaded as it satisfies the SchemaInfo interface.
26
+ * @param schemaKey The SchemaKey describing the schema to get from the cache.
27
+ * @param matchType The match type to use when locating the schema
28
+ */
29
+ getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined>;
30
+ /**
31
+ * Attempts to get a schema from the locater. Yields undefined if no matching schema is found.
32
+ * For schemas that may have references, construct and call through a SchemaContext instead.
33
+ * @param schemaKey key to look up
34
+ * @param matchType how to match key against candidate schemas
35
+ * @param context context for loading schema references
36
+ */
37
+ getSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): T | undefined;
38
+ }
39
+ /**
40
+ * @beta
41
+ */
42
+ export interface ISchemaItemLocater {
43
+ getSchemaItem<T extends SchemaItem>(schemaItemKey: SchemaItemKey): Promise<T | undefined>;
44
+ }
45
+ /**
46
+ * @internal
47
+ */
48
+ export declare class SchemaCache implements ISchemaLocater {
49
+ private _schema;
50
+ constructor();
51
+ get count(): number;
52
+ private loadedSchemaExists;
53
+ private schemaPromiseExists;
54
+ private findEntry;
55
+ private removeSchemaPromise;
56
+ private removeEntry;
57
+ /**
58
+ * Returns true if the schema exists in either the schema cache or the promise cache. SchemaMatchType.Latest used.
59
+ * @param schemaKey The key to search for.
60
+ */
61
+ schemaExists(schemaKey: Readonly<SchemaKey>): boolean;
62
+ /**
63
+ * Adds a promise to load the schema to the cache. Does not allow for duplicate schemas in the cache of schemas or cache of promises, checks using SchemaMatchType.Latest.
64
+ * When the promise completes the schema will be added to the schema cache and the promise will be removed from the promise cache
65
+ * @param schemaInfo An object with the schema key for the schema being loaded and it's references
66
+ * @param schema The partially loaded schema that the promise will fulfill
67
+ * @param schemaPromise The schema promise to add to the cache.
68
+ */
69
+ addSchemaPromise(schemaInfo: SchemaInfo, schema: Schema, schemaPromise: Promise<Schema>): Promise<void>;
70
+ /**
71
+ * Adds a schema to the cache. Does not allow for duplicate schemas, checks using SchemaMatchType.Latest.
72
+ * @param schema The schema to add to the cache.
73
+ */
74
+ addSchema<T extends Schema>(schema: T): Promise<void>;
75
+ /**
76
+ * Adds a schema to the cache. Does not allow for duplicate schemas, checks using SchemaMatchType.Latest.
77
+ * @param schema The schema to add to the cache.
78
+ */
79
+ addSchemaSync<T extends Schema>(schema: T): void;
80
+ /**
81
+ * Gets the schema which matches the provided SchemaKey.
82
+ * @param schemaKey The SchemaKey describing the schema to get from the cache.
83
+ * @param matchType The match type to use when locating the schema
84
+ */
85
+ getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType?: SchemaMatchType): Promise<T | undefined>;
86
+ /**
87
+ * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.
88
+ * @param schemaKey The SchemaKey describing the schema to get from the cache.
89
+ * @param matchType The match type to use when locating the schema
90
+ */
91
+ getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType?: SchemaMatchType): Promise<SchemaInfo | undefined>;
92
+ /**
93
+ * Gets the schema which matches the provided SchemaKey. If the schema is partially loaded an exception will be thrown.
94
+ * @param schemaKey The SchemaKey describing the schema to get from the cache.
95
+ * @param matchType The match type to use when locating the schema
96
+ */
97
+ getSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType?: SchemaMatchType): T | undefined;
98
+ /**
99
+ * Generator function that can iterate through each schema in _schema SchemaMap and items for each Schema.
100
+ * Does not include schema items from schemas that are not completely loaded yet.
101
+ */
102
+ getSchemaItems(): IterableIterator<SchemaItem>;
103
+ /**
104
+ * Gets all the schemas from the schema cache.
105
+ * Does not include schemas from schemas that are not completely loaded yet.
106
+ * @returns An array of Schema objects.
107
+ */
108
+ getAllSchemas(): Schema[];
109
+ }
110
+ /**
111
+ * The SchemaContext, context object is used to facilitate schema and schema item location.
112
+ *
113
+ * The context controls the lifetime of each schema that it knows about. It has to be explicitly removed from the context to delete a schema object.
114
+ *
115
+ * The context is made up of a group of Schema Locators.
116
+ * @beta
117
+ */
118
+ export declare class SchemaContext implements ISchemaItemLocater {
119
+ private _locaters;
120
+ private _knownSchemas;
121
+ constructor();
122
+ addLocater(locater: ISchemaLocater): void;
123
+ /**
124
+ * Adds the schema to this context. Use addSchemaPromise instead when asynchronously loading schemas.
125
+ * @param schema The schema to add to this context
126
+ */
127
+ addSchema(schema: Schema): Promise<void>;
128
+ /**
129
+ * Adds the schema to this context
130
+ * @param schema The schema to add to this context
131
+ */
132
+ addSchemaSync(schema: Schema): void;
133
+ /**
134
+ * Adds the given SchemaItem to the the SchemaContext by locating the schema, with the best match of SchemaMatchType.Exact, and
135
+ * @param schemaItem The SchemaItem to add
136
+ * @deprecated in 4.0 use ecschema-editing package
137
+ */
138
+ addSchemaItem(schemaItem: SchemaItem): Promise<void>;
139
+ /**
140
+ * Returns true if the schema is already in the context. SchemaMatchType.Latest is used to find a match.
141
+ * @param schemaKey
142
+ */
143
+ schemaExists(schemaKey: Readonly<SchemaKey>): boolean;
144
+ /**
145
+ * Adds a promise to load the schema to the cache. Does not allow for duplicate schemas in the cache of schemas or cache of promises, checks using SchemaMatchType.Latest.
146
+ * When the promise completes the schema will be added to the schema cache and the promise will be removed from the promise cache.
147
+ * Use this method over addSchema when asynchronously loading schemas
148
+ * @param schemaInfo An object with the schema key for the schema being loaded and it's references
149
+ * @param schema The partially loaded schema that the promise will fulfill
150
+ * @param schemaPromise The schema promise to add to the cache.
151
+ */
152
+ addSchemaPromise(schemaInfo: SchemaInfo, schema: Schema, schemaPromise: Promise<Schema>): Promise<void>;
153
+ /** Attempts to obtain a schema from this context that matches the specified criteria.
154
+ * @param schemaKey Identifies the schema to obtain.
155
+ * @param matchType Criteria by which to identify potentially matching schemas.
156
+ * @returns the schema matching the input criteria, or `undefined` if no such schema could be located.
157
+ */
158
+ getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType?: SchemaMatchType): Promise<T | undefined>;
159
+ /**
160
+ * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.
161
+ * The fully loaded schema can be gotten later from the context using [[getSchema]].
162
+ * @param schemaKey The SchemaKey describing the schema to get from the cache.
163
+ * @param matchType The match type to use when locating the schema
164
+ */
165
+ getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType): Promise<SchemaInfo | undefined>;
166
+ /** Attempts to obtain a schema from this context that matches the specified criteria.
167
+ * Will return undefined if the schema is partially loaded. Use [[getSchema]] to await until the schema is completely loaded.
168
+ * @param schemaKey Identifies the schema to obtain.
169
+ * @param matchType Criteria by which to identify potentially matching schemas.
170
+ * @returns the schema matching the input criteria, or `undefined` if no such schema could be located.
171
+ */
172
+ getSchemaSync<T extends Schema>(schemaKey: SchemaKey, matchType?: SchemaMatchType): T | undefined;
173
+ /**
174
+ * Attempts to get a Schema from the context's cache.
175
+ * Will await a partially loaded schema then return when it is completely loaded.
176
+ * @param schemaKey The SchemaKey to identify the Schema.
177
+ * @param matchType The SchemaMatch type to use. Default is SchemaMatchType.Latest.
178
+ * @internal
179
+ */
180
+ getCachedSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType?: SchemaMatchType): Promise<T | undefined>;
181
+ /**
182
+ * Attempts to get a Schema from the context's cache.
183
+ * Will return undefined if the cached schema is partially loaded. Use [[getCachedSchema]] to await until the schema is completely loaded.
184
+ * @param schemaKey The SchemaKey to identify the Schema.
185
+ * @param matchType The SchemaMatch type to use. Default is SchemaMatchType.Latest.
186
+ * @internal
187
+ */
188
+ getCachedSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType?: SchemaMatchType): T | undefined;
189
+ /**
190
+ * Gets the schema item from the specified schema if it exists in this [[SchemaContext]].
191
+ * Will await a partially loaded schema then look in it for the requested item
192
+ * @param schemaItemKey The SchemaItemKey identifying the item to return. SchemaMatchType.Latest is used to match the schema.
193
+ * @returns The requested schema item
194
+ */
195
+ getSchemaItem<T extends SchemaItem>(schemaItemKey: SchemaItemKey): Promise<T | undefined>;
196
+ /**
197
+ * Gets the schema item from the specified schema if it exists in this [[SchemaContext]].
198
+ * Will skip a partially loaded schema and return undefined if the item belongs to that schema. Use the async method to await partially loaded schemas.
199
+ * @param schemaItemKey The SchemaItemKey identifying the item to return. SchemaMatchType.Latest is used to match the schema.
200
+ * @returns The requested schema item
201
+ */
202
+ getSchemaItemSync<T extends SchemaItem>(schemaItemKey: SchemaItemKey): T | undefined;
203
+ /**
204
+ * Iterates through the items of each schema known to the context. This includes schemas added to the
205
+ * context using [[SchemaContext.addSchema]]. This does not include schemas that
206
+ * can be located by an ISchemaLocater instance added to the context.
207
+ * Does not include schema items from schemas that are not completely loaded yet.
208
+ */
209
+ getSchemaItems(): IterableIterator<SchemaItem>;
210
+ /**
211
+ * Gets all the Schemas known by the context. This includes schemas added to the
212
+ * context using [[SchemaContext.addSchema]]. This does not include schemas that
213
+ * can be located by an ISchemaLocater instance added to the context. Does not
214
+ * include schemas that are partially loaded.
215
+ * @returns An array of Schema objects.
216
+ */
217
+ getKnownSchemas(): Schema[];
218
+ }
219
+ //# sourceMappingURL=Context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/Context.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAiB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAgBvD;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAE7B;;;;;;OAMG;IACH,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAExI;;;;;MAKE;IACF,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAEnI;;;;;;OAMG;IACH,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,CAAC,GAAG,SAAS,CAAC;CACpI;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,CAAC,CAAC,SAAS,UAAU,EAAE,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,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