@itwin/ecschema-metadata 5.0.0-dev.11 → 5.0.0-dev.111

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 (342) hide show
  1. package/CHANGELOG.md +73 -1
  2. package/lib/cjs/Constants.d.ts +8 -0
  3. package/lib/cjs/Constants.d.ts.map +1 -1
  4. package/lib/cjs/Constants.js +30 -21
  5. package/lib/cjs/Constants.js.map +1 -1
  6. package/lib/cjs/Context.d.ts +85 -36
  7. package/lib/cjs/Context.d.ts.map +1 -1
  8. package/lib/cjs/Context.js +79 -29
  9. package/lib/cjs/Context.js.map +1 -1
  10. package/lib/cjs/DelayedPromise.d.ts +9 -8
  11. package/lib/cjs/DelayedPromise.d.ts.map +1 -1
  12. package/lib/cjs/DelayedPromise.js +8 -6
  13. package/lib/cjs/DelayedPromise.js.map +1 -1
  14. package/lib/cjs/Deserialization/AbstractParser.js +1 -0
  15. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  16. package/lib/cjs/Deserialization/Helper.d.ts +3 -3
  17. package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
  18. package/lib/cjs/Deserialization/Helper.js +35 -26
  19. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  20. package/lib/cjs/Deserialization/JsonParser.js +153 -150
  21. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  22. package/lib/cjs/Deserialization/JsonProps.d.ts +47 -33
  23. package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
  24. package/lib/cjs/Deserialization/JsonProps.js +3 -3
  25. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  26. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  27. package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
  28. package/lib/cjs/Deserialization/XmlParser.js +60 -52
  29. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  30. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +0 -5
  31. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
  32. package/lib/cjs/Deserialization/XmlSerializationUtils.js +8 -17
  33. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  34. package/lib/cjs/ECName.d.ts +2 -2
  35. package/lib/cjs/ECName.js +5 -4
  36. package/lib/cjs/ECName.js.map +1 -1
  37. package/lib/cjs/ECObjects.d.ts +41 -9
  38. package/lib/cjs/ECObjects.d.ts.map +1 -1
  39. package/lib/cjs/ECObjects.js +78 -24
  40. package/lib/cjs/ECObjects.js.map +1 -1
  41. package/lib/cjs/Exception.d.ts +4 -4
  42. package/lib/cjs/Exception.d.ts.map +1 -1
  43. package/lib/cjs/Exception.js +61 -60
  44. package/lib/cjs/Exception.js.map +1 -1
  45. package/lib/cjs/Interfaces.d.ts +35 -32
  46. package/lib/cjs/Interfaces.d.ts.map +1 -1
  47. package/lib/cjs/Interfaces.js.map +1 -1
  48. package/lib/cjs/Metadata/Class.d.ts +179 -32
  49. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  50. package/lib/cjs/Metadata/Class.js +290 -88
  51. package/lib/cjs/Metadata/Class.js.map +1 -1
  52. package/lib/cjs/Metadata/Constant.d.ts +26 -10
  53. package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
  54. package/lib/cjs/Metadata/Constant.js +38 -10
  55. package/lib/cjs/Metadata/Constant.js.map +1 -1
  56. package/lib/cjs/Metadata/CustomAttribute.d.ts +2 -2
  57. package/lib/cjs/Metadata/CustomAttribute.d.ts.map +1 -1
  58. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  59. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +21 -7
  60. package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
  61. package/lib/cjs/Metadata/CustomAttributeClass.js +28 -8
  62. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  63. package/lib/cjs/Metadata/EntityClass.d.ts +40 -11
  64. package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
  65. package/lib/cjs/Metadata/EntityClass.js +72 -34
  66. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  67. package/lib/cjs/Metadata/Enumeration.d.ts +30 -10
  68. package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
  69. package/lib/cjs/Metadata/Enumeration.js +41 -13
  70. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  71. package/lib/cjs/Metadata/Format.d.ts +65 -17
  72. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  73. package/lib/cjs/Metadata/Format.js +107 -22
  74. package/lib/cjs/Metadata/Format.js.map +1 -1
  75. package/lib/cjs/Metadata/InvertedUnit.d.ts +19 -10
  76. package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
  77. package/lib/cjs/Metadata/InvertedUnit.js +32 -15
  78. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  79. package/lib/cjs/Metadata/KindOfQuantity.d.ts +38 -18
  80. package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
  81. package/lib/cjs/Metadata/KindOfQuantity.js +90 -40
  82. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  83. package/lib/cjs/Metadata/Mixin.d.ts +31 -4
  84. package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
  85. package/lib/cjs/Metadata/Mixin.js +42 -8
  86. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  87. package/lib/cjs/Metadata/OverrideFormat.d.ts +12 -12
  88. package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
  89. package/lib/cjs/Metadata/OverrideFormat.js +36 -19
  90. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  91. package/lib/cjs/Metadata/Phenomenon.d.ts +24 -3
  92. package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
  93. package/lib/cjs/Metadata/Phenomenon.js +32 -3
  94. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  95. package/lib/cjs/Metadata/Property.d.ts +47 -25
  96. package/lib/cjs/Metadata/Property.d.ts.map +1 -1
  97. package/lib/cjs/Metadata/Property.js +128 -49
  98. package/lib/cjs/Metadata/Property.js.map +1 -1
  99. package/lib/cjs/Metadata/PropertyCategory.d.ts +20 -4
  100. package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
  101. package/lib/cjs/Metadata/PropertyCategory.js +31 -4
  102. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  103. package/lib/cjs/Metadata/RelationshipClass.d.ts +63 -27
  104. package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
  105. package/lib/cjs/Metadata/RelationshipClass.js +100 -43
  106. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  107. package/lib/cjs/Metadata/Schema.d.ts +167 -41
  108. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  109. package/lib/cjs/Metadata/Schema.js +211 -111
  110. package/lib/cjs/Metadata/Schema.js.map +1 -1
  111. package/lib/cjs/Metadata/SchemaItem.d.ts +19 -19
  112. package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
  113. package/lib/cjs/Metadata/SchemaItem.js +23 -21
  114. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  115. package/lib/cjs/Metadata/Unit.d.ts +24 -21
  116. package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
  117. package/lib/cjs/Metadata/Unit.js +40 -24
  118. package/lib/cjs/Metadata/Unit.js.map +1 -1
  119. package/lib/cjs/Metadata/UnitSystem.d.ts +17 -4
  120. package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
  121. package/lib/cjs/Metadata/UnitSystem.js +24 -4
  122. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  123. package/lib/cjs/PropertyTypes.d.ts +11 -11
  124. package/lib/cjs/PropertyTypes.d.ts.map +1 -1
  125. package/lib/cjs/PropertyTypes.js +28 -20
  126. package/lib/cjs/PropertyTypes.js.map +1 -1
  127. package/lib/cjs/SchemaFormatsProvider.d.ts +39 -0
  128. package/lib/cjs/SchemaFormatsProvider.d.ts.map +1 -0
  129. package/lib/cjs/SchemaFormatsProvider.js +146 -0
  130. package/lib/cjs/SchemaFormatsProvider.js.map +1 -0
  131. package/lib/cjs/SchemaJsonLocater.d.ts +8 -8
  132. package/lib/cjs/SchemaJsonLocater.d.ts.map +1 -1
  133. package/lib/cjs/SchemaJsonLocater.js +7 -7
  134. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  135. package/lib/cjs/SchemaKey.d.ts +13 -7
  136. package/lib/cjs/SchemaKey.d.ts.map +1 -1
  137. package/lib/cjs/SchemaKey.js +22 -12
  138. package/lib/cjs/SchemaKey.js.map +1 -1
  139. package/lib/cjs/SchemaLoader.d.ts +5 -5
  140. package/lib/cjs/SchemaLoader.d.ts.map +1 -1
  141. package/lib/cjs/SchemaLoader.js +5 -4
  142. package/lib/cjs/SchemaLoader.js.map +1 -1
  143. package/lib/cjs/SchemaPartVisitorDelegate.d.ts +2 -2
  144. package/lib/cjs/SchemaPartVisitorDelegate.js +2 -1
  145. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  146. package/lib/cjs/UnitConversion/Graph.js +69 -65
  147. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  148. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  149. package/lib/cjs/UnitConversion/UnitConversion.d.ts +1 -1
  150. package/lib/cjs/UnitConversion/UnitConversion.d.ts.map +1 -1
  151. package/lib/cjs/UnitConversion/UnitConversion.js +9 -7
  152. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  153. package/lib/cjs/UnitConversion/UnitConverter.js +2 -0
  154. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  155. package/lib/cjs/UnitConversion/UnitTree.d.ts +2 -0
  156. package/lib/cjs/UnitConversion/UnitTree.d.ts.map +1 -1
  157. package/lib/cjs/UnitConversion/UnitTree.js +11 -1
  158. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  159. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
  160. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +8 -9
  161. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  162. package/lib/cjs/Validation/SchemaWalker.d.ts +1 -1
  163. package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -1
  164. package/lib/cjs/Validation/SchemaWalker.js +6 -4
  165. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  166. package/lib/cjs/ecschema-metadata.d.ts +1 -0
  167. package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
  168. package/lib/cjs/ecschema-metadata.js +1 -0
  169. package/lib/cjs/ecschema-metadata.js.map +1 -1
  170. package/lib/cjs/utils/SchemaGraph.js +5 -6
  171. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  172. package/lib/esm/Constants.d.ts +8 -0
  173. package/lib/esm/Constants.d.ts.map +1 -1
  174. package/lib/esm/Constants.js +29 -20
  175. package/lib/esm/Constants.js.map +1 -1
  176. package/lib/esm/Context.d.ts +85 -36
  177. package/lib/esm/Context.d.ts.map +1 -1
  178. package/lib/esm/Context.js +78 -28
  179. package/lib/esm/Context.js.map +1 -1
  180. package/lib/esm/DelayedPromise.d.ts +9 -8
  181. package/lib/esm/DelayedPromise.d.ts.map +1 -1
  182. package/lib/esm/DelayedPromise.js +8 -6
  183. package/lib/esm/DelayedPromise.js.map +1 -1
  184. package/lib/esm/Deserialization/AbstractParser.js +1 -0
  185. package/lib/esm/Deserialization/AbstractParser.js.map +1 -1
  186. package/lib/esm/Deserialization/Helper.d.ts +3 -3
  187. package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
  188. package/lib/esm/Deserialization/Helper.js +36 -27
  189. package/lib/esm/Deserialization/Helper.js.map +1 -1
  190. package/lib/esm/Deserialization/JsonParser.js +154 -151
  191. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  192. package/lib/esm/Deserialization/JsonProps.d.ts +47 -33
  193. package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
  194. package/lib/esm/Deserialization/JsonProps.js +3 -3
  195. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  196. package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -1
  197. package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -1
  198. package/lib/esm/Deserialization/XmlParser.js +61 -53
  199. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  200. package/lib/esm/Deserialization/XmlSerializationUtils.d.ts +0 -5
  201. package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
  202. package/lib/esm/Deserialization/XmlSerializationUtils.js +9 -18
  203. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
  204. package/lib/esm/ECName.d.ts +2 -2
  205. package/lib/esm/ECName.js +6 -5
  206. package/lib/esm/ECName.js.map +1 -1
  207. package/lib/esm/ECObjects.d.ts +41 -9
  208. package/lib/esm/ECObjects.d.ts.map +1 -1
  209. package/lib/esm/ECObjects.js +77 -24
  210. package/lib/esm/ECObjects.js.map +1 -1
  211. package/lib/esm/Exception.d.ts +4 -4
  212. package/lib/esm/Exception.d.ts.map +1 -1
  213. package/lib/esm/Exception.js +59 -58
  214. package/lib/esm/Exception.js.map +1 -1
  215. package/lib/esm/Interfaces.d.ts +35 -32
  216. package/lib/esm/Interfaces.d.ts.map +1 -1
  217. package/lib/esm/Interfaces.js.map +1 -1
  218. package/lib/esm/Metadata/Class.d.ts +179 -32
  219. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  220. package/lib/esm/Metadata/Class.js +292 -90
  221. package/lib/esm/Metadata/Class.js.map +1 -1
  222. package/lib/esm/Metadata/Constant.d.ts +26 -10
  223. package/lib/esm/Metadata/Constant.d.ts.map +1 -1
  224. package/lib/esm/Metadata/Constant.js +39 -11
  225. package/lib/esm/Metadata/Constant.js.map +1 -1
  226. package/lib/esm/Metadata/CustomAttribute.d.ts +2 -2
  227. package/lib/esm/Metadata/CustomAttribute.d.ts.map +1 -1
  228. package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
  229. package/lib/esm/Metadata/CustomAttributeClass.d.ts +21 -7
  230. package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
  231. package/lib/esm/Metadata/CustomAttributeClass.js +29 -9
  232. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  233. package/lib/esm/Metadata/EntityClass.d.ts +40 -11
  234. package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
  235. package/lib/esm/Metadata/EntityClass.js +73 -35
  236. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  237. package/lib/esm/Metadata/Enumeration.d.ts +30 -10
  238. package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
  239. package/lib/esm/Metadata/Enumeration.js +42 -14
  240. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  241. package/lib/esm/Metadata/Format.d.ts +65 -17
  242. package/lib/esm/Metadata/Format.d.ts.map +1 -1
  243. package/lib/esm/Metadata/Format.js +108 -23
  244. package/lib/esm/Metadata/Format.js.map +1 -1
  245. package/lib/esm/Metadata/InvertedUnit.d.ts +19 -10
  246. package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
  247. package/lib/esm/Metadata/InvertedUnit.js +33 -16
  248. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  249. package/lib/esm/Metadata/KindOfQuantity.d.ts +38 -18
  250. package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
  251. package/lib/esm/Metadata/KindOfQuantity.js +91 -41
  252. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  253. package/lib/esm/Metadata/Mixin.d.ts +31 -4
  254. package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
  255. package/lib/esm/Metadata/Mixin.js +44 -10
  256. package/lib/esm/Metadata/Mixin.js.map +1 -1
  257. package/lib/esm/Metadata/OverrideFormat.d.ts +12 -12
  258. package/lib/esm/Metadata/OverrideFormat.d.ts.map +1 -1
  259. package/lib/esm/Metadata/OverrideFormat.js +37 -20
  260. package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
  261. package/lib/esm/Metadata/Phenomenon.d.ts +24 -3
  262. package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
  263. package/lib/esm/Metadata/Phenomenon.js +33 -4
  264. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  265. package/lib/esm/Metadata/Property.d.ts +47 -25
  266. package/lib/esm/Metadata/Property.d.ts.map +1 -1
  267. package/lib/esm/Metadata/Property.js +130 -51
  268. package/lib/esm/Metadata/Property.js.map +1 -1
  269. package/lib/esm/Metadata/PropertyCategory.d.ts +20 -4
  270. package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
  271. package/lib/esm/Metadata/PropertyCategory.js +31 -4
  272. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  273. package/lib/esm/Metadata/RelationshipClass.d.ts +63 -27
  274. package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
  275. package/lib/esm/Metadata/RelationshipClass.js +102 -45
  276. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  277. package/lib/esm/Metadata/Schema.d.ts +167 -41
  278. package/lib/esm/Metadata/Schema.d.ts.map +1 -1
  279. package/lib/esm/Metadata/Schema.js +212 -112
  280. package/lib/esm/Metadata/Schema.js.map +1 -1
  281. package/lib/esm/Metadata/SchemaItem.d.ts +19 -19
  282. package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
  283. package/lib/esm/Metadata/SchemaItem.js +25 -23
  284. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  285. package/lib/esm/Metadata/Unit.d.ts +24 -21
  286. package/lib/esm/Metadata/Unit.d.ts.map +1 -1
  287. package/lib/esm/Metadata/Unit.js +41 -25
  288. package/lib/esm/Metadata/Unit.js.map +1 -1
  289. package/lib/esm/Metadata/UnitSystem.d.ts +17 -4
  290. package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
  291. package/lib/esm/Metadata/UnitSystem.js +24 -4
  292. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  293. package/lib/esm/PropertyTypes.d.ts +11 -11
  294. package/lib/esm/PropertyTypes.d.ts.map +1 -1
  295. package/lib/esm/PropertyTypes.js +29 -21
  296. package/lib/esm/PropertyTypes.js.map +1 -1
  297. package/lib/esm/SchemaFormatsProvider.d.ts +39 -0
  298. package/lib/esm/SchemaFormatsProvider.d.ts.map +1 -0
  299. package/lib/esm/SchemaFormatsProvider.js +142 -0
  300. package/lib/esm/SchemaFormatsProvider.js.map +1 -0
  301. package/lib/esm/SchemaJsonLocater.d.ts +8 -8
  302. package/lib/esm/SchemaJsonLocater.d.ts.map +1 -1
  303. package/lib/esm/SchemaJsonLocater.js +7 -7
  304. package/lib/esm/SchemaJsonLocater.js.map +1 -1
  305. package/lib/esm/SchemaKey.d.ts +13 -7
  306. package/lib/esm/SchemaKey.d.ts.map +1 -1
  307. package/lib/esm/SchemaKey.js +23 -13
  308. package/lib/esm/SchemaKey.js.map +1 -1
  309. package/lib/esm/SchemaLoader.d.ts +5 -5
  310. package/lib/esm/SchemaLoader.d.ts.map +1 -1
  311. package/lib/esm/SchemaLoader.js +6 -5
  312. package/lib/esm/SchemaLoader.js.map +1 -1
  313. package/lib/esm/SchemaPartVisitorDelegate.d.ts +2 -2
  314. package/lib/esm/SchemaPartVisitorDelegate.js +2 -1
  315. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
  316. package/lib/esm/UnitConversion/Graph.js +69 -65
  317. package/lib/esm/UnitConversion/Graph.js.map +1 -1
  318. package/lib/esm/UnitConversion/Parser.js.map +1 -1
  319. package/lib/esm/UnitConversion/UnitConversion.d.ts +1 -1
  320. package/lib/esm/UnitConversion/UnitConversion.d.ts.map +1 -1
  321. package/lib/esm/UnitConversion/UnitConversion.js +9 -7
  322. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
  323. package/lib/esm/UnitConversion/UnitConverter.js +2 -0
  324. package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
  325. package/lib/esm/UnitConversion/UnitTree.d.ts +2 -0
  326. package/lib/esm/UnitConversion/UnitTree.d.ts.map +1 -1
  327. package/lib/esm/UnitConversion/UnitTree.js +11 -1
  328. package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
  329. package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
  330. package/lib/esm/UnitProvider/SchemaUnitProvider.js +8 -9
  331. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  332. package/lib/esm/Validation/SchemaWalker.d.ts +1 -1
  333. package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -1
  334. package/lib/esm/Validation/SchemaWalker.js +6 -4
  335. package/lib/esm/Validation/SchemaWalker.js.map +1 -1
  336. package/lib/esm/ecschema-metadata.d.ts +1 -0
  337. package/lib/esm/ecschema-metadata.d.ts.map +1 -1
  338. package/lib/esm/ecschema-metadata.js +1 -0
  339. package/lib/esm/ecschema-metadata.js.map +1 -1
  340. package/lib/esm/utils/SchemaGraph.js +6 -7
  341. package/lib/esm/utils/SchemaGraph.js.map +1 -1
  342. package/package.json +16 -14
@@ -8,6 +8,7 @@ exports.XmlParser = void 0;
8
8
  const core_bentley_1 = require("@itwin/core-bentley");
9
9
  const ECObjects_1 = require("../ECObjects");
10
10
  const Exception_1 = require("../Exception");
11
+ const Enumeration_1 = require("../Metadata/Enumeration");
11
12
  const ECName_1 = require("../ECName");
12
13
  const AbstractParser_1 = require("./AbstractParser");
13
14
  const Helper_1 = require("./Helper");
@@ -15,6 +16,15 @@ const NON_ITEM_SCHEMA_ELEMENTS = ["ECSchemaReference", "ECCustomAttributes"];
15
16
  const ECXML_URI = "http://www\\.bentley\\.com/schemas/Bentley\\.ECXML";
16
17
  /** @internal */
17
18
  class XmlParser extends AbstractParser_1.AbstractParser {
19
+ _rawSchema;
20
+ _schemaName;
21
+ _schemaReferenceNames;
22
+ _schemaAlias;
23
+ _schemaVersion;
24
+ _xmlNamespace;
25
+ _currentItemFullName;
26
+ _schemaItems;
27
+ _mapIsPopulated;
18
28
  constructor(rawSchema) {
19
29
  super();
20
30
  this._rawSchema = rawSchema;
@@ -42,18 +52,18 @@ class XmlParser extends AbstractParser_1.AbstractParser {
42
52
  parseSchema() {
43
53
  const schemaMetadata = this._rawSchema.documentElement;
44
54
  if ("ECSchema" !== schemaMetadata.nodeName)
45
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, "An ECSchema is missing the required metadata.");
55
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, "An ECSchema is missing the required metadata.");
46
56
  const schemaDefDuplicates = this.getElementChildrenByTagName(schemaMetadata, "ECSchema");
47
57
  if (schemaDefDuplicates.length > 1)
48
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, "An ECSchema has more than one ECSchema definition. Only one is allowed.");
58
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, "An ECSchema has more than one ECSchema definition. Only one is allowed.");
49
59
  if (this._schemaName === undefined)
50
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `An ECSchema is missing a required 'schemaName' attribute`);
60
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `An ECSchema is missing a required 'schemaName' attribute`);
51
61
  if (this._schemaVersion === undefined)
52
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'version' attribute`);
62
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'version' attribute`);
53
63
  if (this._xmlNamespace === undefined)
54
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'xmlns' attribute`);
64
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'xmlns' attribute`);
55
65
  if (this._ecSpecVersion === undefined)
56
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} has an invalid 'xmlns' attribute`);
66
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} has an invalid 'xmlns' attribute`);
57
67
  const alias = this.getRequiredAttribute(schemaMetadata, "alias", `The ECSchema ${this._schemaName} is missing a required 'alias' attribute`);
58
68
  const description = this.getOptionalAttribute(schemaMetadata, "description");
59
69
  const displayLabel = this.getOptionalAttribute(schemaMetadata, "displayLabel");
@@ -94,11 +104,11 @@ class XmlParser extends AbstractParser_1.AbstractParser {
94
104
  if (itemType === undefined) {
95
105
  if (Helper_1.SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
96
106
  continue;
97
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `A SchemaItem in ${this._schemaName} has an invalid type. '${rawItemType}' is not a valid SchemaItem type.`);
107
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `A SchemaItem in ${this._schemaName} has an invalid type. '${rawItemType}' is not a valid SchemaItem type.`);
98
108
  }
99
109
  const itemName = this.getRequiredAttribute(item, "typeName", `A SchemaItem in ${this._schemaName} is missing the required 'typeName' attribute.`);
100
110
  if (!ECName_1.ECName.validate(itemName))
101
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'typeName' attribute. '${itemName}' is not a valid ECName.`);
111
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'typeName' attribute. '${itemName}' is not a valid ECName.`);
102
112
  this._currentItemFullName = `${this._schemaName}.${itemName}`;
103
113
  this._schemaItems.set(itemName, [itemType, item]);
104
114
  yield [itemName, itemType, item];
@@ -157,22 +167,22 @@ class XmlParser extends AbstractParser_1.AbstractParser {
157
167
  const baseClasses = this.getElementChildrenByTagName(xmlElement, "BaseClass");
158
168
  // Mixins can only have one base class
159
169
  if (baseClasses.length > 1)
160
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} has more than one base class which is not allowed.`);
170
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} has more than one base class which is not allowed.`);
161
171
  const customAttributesResult = this.getElementChildrenByTagName(xmlElement, "ECCustomAttributes");
162
172
  if (customAttributesResult.length < 1)
163
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
173
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
164
174
  const customAttributes = customAttributesResult[0];
165
175
  const isMixinResult = this.getElementChildrenByTagName(customAttributes, "IsMixin");
166
176
  if (isMixinResult.length < 1)
167
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
177
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);
168
178
  const mixinAttributes = isMixinResult[0];
169
179
  const appliesToResult = this.getElementChildrenByTagName(mixinAttributes, "AppliesToEntityClass");
170
180
  if (appliesToResult.length < 1)
171
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
181
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
172
182
  const appliesToElement = appliesToResult[0];
173
183
  let appliesTo = appliesToElement.textContent;
174
184
  if (appliesTo === null || appliesTo.length === 0)
175
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
185
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);
176
186
  appliesTo = this.getQualifiedTypeName(appliesTo);
177
187
  const mixinProps = {
178
188
  ...classProps,
@@ -201,17 +211,17 @@ class XmlParser extends AbstractParser_1.AbstractParser {
201
211
  const sourceResult = this.getElementChildrenByTagName(xmlElement, "Source");
202
212
  if (sourceResult.length !== 1) {
203
213
  if (sourceResult.length === 0)
204
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
214
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
205
215
  else
206
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Source constraint tag. Only one is allowed.`);
216
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Source constraint tag. Only one is allowed.`);
207
217
  }
208
218
  const source = this.getRelationshipConstraintProps(sourceResult[0], true);
209
219
  const targetResult = this.getElementChildrenByTagName(xmlElement, "Target");
210
220
  if (targetResult.length !== 1) {
211
221
  if (targetResult.length === 0)
212
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
222
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
213
223
  else
214
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Target constraint tag. Only one is allowed.`);
224
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Target constraint tag. Only one is allowed.`);
215
225
  }
216
226
  const target = this.getRelationshipConstraintProps(targetResult[0], false);
217
227
  return {
@@ -238,7 +248,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
238
248
  if (Helper_1.SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
239
249
  tempBackingType = ECObjects_1.PrimitiveType.String;
240
250
  else
241
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'backingTypeName' attribute. It should be either "int" or "string".`);
251
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'backingTypeName' attribute. It should be either "int" or "string".`);
242
252
  }
243
253
  let isStrictString = this.getOptionalAttribute(xmlElement, "isStrict");
244
254
  if (isStrictString === undefined)
@@ -253,7 +263,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
253
263
  if (ECObjects_1.PrimitiveType.Integer === tempBackingType) {
254
264
  const numericValue = parseInt(valueString, 10);
255
265
  if (isNaN(numericValue))
256
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Enumeration ${this._currentItemFullName} of type "int" has an enumerator with a non-integer value.`);
266
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Enumeration ${this._currentItemFullName} of type "int" has an enumerator with a non-integer value.`);
257
267
  value = numericValue;
258
268
  }
259
269
  const label = this.getOptionalAttribute(element, "displayLabel");
@@ -279,7 +289,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
279
289
  const relativeErrorString = this.getRequiredAttribute(xmlElement, "relativeError", `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);
280
290
  const relativeError = parseFloat(relativeErrorString);
281
291
  if (isNaN(relativeError))
282
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be a numeric value.`);
292
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be a numeric value.`);
283
293
  const presentationUnitsString = this.getOptionalAttribute(xmlElement, "presentationUnits");
284
294
  let presentationUnits;
285
295
  if (presentationUnitsString)
@@ -298,7 +308,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
298
308
  const priorityString = this.getRequiredAttribute(xmlElement, "priority", `The PropertyCategory ${this._currentItemFullName} is missing the required 'priority' attribute.`);
299
309
  const priority = parseInt(priorityString, 10);
300
310
  if (isNaN(priority))
301
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be a numeric value.`);
311
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be a numeric value.`);
302
312
  return {
303
313
  ...itemProps,
304
314
  priority,
@@ -387,11 +397,11 @@ class XmlParser extends AbstractParser_1.AbstractParser {
387
397
  const units = new Array();
388
398
  const unitsResult = this.getElementChildrenByTagName(compositeElement, "Unit");
389
399
  if (unitsResult.length < 1)
390
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has an invalid 'Composite' element. It should have 1-4 Unit elements.`);
400
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has an invalid 'Composite' element. It should have 1-4 Unit elements.`);
391
401
  for (const unit of unitsResult) {
392
402
  let name = unit.textContent;
393
403
  if (null === name || 0 === name.length)
394
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has a Composite with an invalid Unit. One of the Units is missing the required 'name' attribute.`);
404
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has a Composite with an invalid Unit. One of the Units is missing the required 'name' attribute.`);
395
405
  const label = this.getOptionalAttribute(unit, "label");
396
406
  name = this.getQualifiedTypeName(name);
397
407
  units.push({ name, label });
@@ -431,7 +441,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
431
441
  const propertyType = this.getPropertyType(childType);
432
442
  // This may not be needed, just a failsafe if the regex is faulty
433
443
  if (propertyType === undefined)
434
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECProperty ${itemName}.${propertyName} has an invalid type. ${childType} is not a valid ECProperty type.`);
444
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${itemName}.${propertyName} has an invalid type. ${childType} is not a valid ECProperty type.`);
435
445
  yield [propertyName, propertyType, child];
436
446
  }
437
447
  }
@@ -492,12 +502,12 @@ class XmlParser extends AbstractParser_1.AbstractParser {
492
502
  getRelationshipConstraintCustomAttributeProviders(xmlElement) {
493
503
  const sourceResult = this.getElementChildrenByTagName(xmlElement, "Source");
494
504
  if (sourceResult.length < 1)
495
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
505
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);
496
506
  const sourceElement = sourceResult[0];
497
507
  const sourceCustomAttributes = this.getCustomAttributeProviders(sourceElement, "Source Constraint of", this._currentItemFullName);
498
508
  const targetResult = this.getElementChildrenByTagName(xmlElement, "Target");
499
509
  if (targetResult.length < 1)
500
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
510
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);
501
511
  const targetElement = targetResult[0];
502
512
  const targetCustomAttributes = this.getCustomAttributeProviders(targetElement, "Source Constraint of", this._currentItemFullName);
503
513
  return [sourceCustomAttributes, targetCustomAttributes];
@@ -546,7 +556,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
546
556
  if (resultString) {
547
557
  result = parseFloat(resultString);
548
558
  if (isNaN(result))
549
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, parseErrorMsg);
559
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);
550
560
  }
551
561
  return result;
552
562
  }
@@ -556,7 +566,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
556
566
  if (resultString) {
557
567
  result = parseInt(resultString, 10);
558
568
  if (isNaN(result))
559
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, parseErrorMsg);
569
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);
560
570
  }
561
571
  return result;
562
572
  }
@@ -567,14 +577,14 @@ class XmlParser extends AbstractParser_1.AbstractParser {
567
577
  else if ("false" === textString)
568
578
  return false;
569
579
  else
570
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, parseErrorMsg);
580
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);
571
581
  }
572
582
  getRequiredAttribute(xmlElement, attributeName, errorMsg) {
573
583
  if (!xmlElement.hasAttribute(attributeName))
574
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, errorMsg);
584
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, errorMsg);
575
585
  const result = xmlElement.getAttribute(attributeName);
576
586
  if (result === null)
577
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, errorMsg);
587
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, errorMsg);
578
588
  return result;
579
589
  }
580
590
  getSchemaReference(xmlElement) {
@@ -650,11 +660,11 @@ class XmlParser extends AbstractParser_1.AbstractParser {
650
660
  const constraintClasses = new Array();
651
661
  const constraintClassesResult = this.getElementChildrenByTagName(xmlElement, "Class");
652
662
  if (constraintClassesResult.length < 1)
653
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ${constraintName} is missing the required Class tags.`);
663
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ${constraintName} is missing the required Class tags.`);
654
664
  for (const constraintClass of constraintClassesResult) {
655
665
  let constraintClassId = constraintClass.getAttribute("class");
656
666
  if (null === constraintClassId || 0 === constraintClassId.length)
657
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ${constraintName} has a Class that is missing the required 'class' attribute.`);
667
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ${constraintName} has a Class that is missing the required 'class' attribute.`);
658
668
  constraintClassId = this.getQualifiedTypeName(constraintClassId);
659
669
  constraintClasses.push(constraintClassId);
660
670
  }
@@ -683,7 +693,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
683
693
  const propName = this.getPropertyName(xmlElement);
684
694
  const propType = this.getPropertyType(xmlElement.nodeName);
685
695
  if (propType === undefined)
686
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid type. ${propType} is not a valid ECProperty type.`);
696
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid type. ${propType} is not a valid ECProperty type.`);
687
697
  const label = this.getOptionalAttribute(xmlElement, "displayLabel");
688
698
  const description = this.getOptionalAttribute(xmlElement, "description");
689
699
  const readOnlyString = this.getOptionalAttribute(xmlElement, "readOnly");
@@ -751,7 +761,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
751
761
  else if (undefined !== maxOccursStr) {
752
762
  maxOccurs = parseInt(maxOccursStr, 10);
753
763
  if (isNaN(maxOccurs))
754
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be a numeric value.`);
764
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be a numeric value.`);
755
765
  }
756
766
  return { minOccurs, maxOccurs };
757
767
  }
@@ -775,7 +785,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
775
785
  ns = `${this._schemaName}.${this._schemaVersion}`;
776
786
  }
777
787
  if (null === ns || !this.isSchemaFullNameValidForVersion(ns, this._ecSpecVersion))
778
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Custom attribute namespaces must contain a valid 3.2 full schema name in the form <schemaName>.RR.ww.mm.`);
788
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Custom attribute namespaces must contain a valid 3.2 full schema name in the form <schemaName>.RR.ww.mm.`);
779
789
  const schemaNameParts = ns.split(".");
780
790
  const className = `${schemaNameParts[0]}.${xmlCustomAttribute.tagName}`;
781
791
  const properties = this.getElementChildren(xmlCustomAttribute);
@@ -786,8 +796,6 @@ class XmlParser extends AbstractParser_1.AbstractParser {
786
796
  }
787
797
  addCAPropertyValues(caClass, propertyElements) {
788
798
  const instance = { className: caClass.fullName };
789
- if (!caClass.properties)
790
- return instance;
791
799
  for (const propertyElement of propertyElements) {
792
800
  const value = this.readPropertyValue(propertyElement, caClass);
793
801
  if (value !== undefined)
@@ -804,9 +812,9 @@ class XmlParser extends AbstractParser_1.AbstractParser {
804
812
  let enumeration;
805
813
  if (propertyClass.isPrimitive()) {
806
814
  if (propertyClass.isEnumeration() && propertyClass.enumeration) {
807
- enumeration = propertyClass.schema.lookupItemSync(propertyClass.enumeration.fullName);
815
+ enumeration = propertyClass.schema.lookupItemSync(propertyClass.enumeration.fullName, Enumeration_1.Enumeration);
808
816
  if (!enumeration)
809
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.ClassNotFound, `The Enumeration class '${propertyClass.enumeration.fullName}' could not be found.`);
817
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.ClassNotFound, `The Enumeration class '${propertyClass.enumeration.fullName}' could not be found.`);
810
818
  }
811
819
  const primitiveType = enumeration && enumeration.type ? enumeration.type : (propertyClass).primitiveType;
812
820
  return this.readPrimitivePropertyValue(propElement, primitiveType);
@@ -853,9 +861,9 @@ class XmlParser extends AbstractParser_1.AbstractParser {
853
861
  }
854
862
  readPrimitivePropertyValue(propElement, primitiveType) {
855
863
  if (undefined === propElement.textContent || null === propElement.textContent)
856
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
864
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
857
865
  if (propElement.textContent === "" && primitiveType !== ECObjects_1.PrimitiveType.String)
858
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
866
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);
859
867
  // TODO: Mapping all primitive types to string, number and boolean
860
868
  // for now. Need to review with IModelJs.
861
869
  switch (primitiveType) {
@@ -877,7 +885,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
877
885
  case ECObjects_1.PrimitiveType.Double:
878
886
  return this.getDoublePropertyValue(propElement.textContent, propElement.tagName);
879
887
  default:
880
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid primitive type.`);
888
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid primitive type.`);
881
889
  }
882
890
  }
883
891
  getBooleanPropertyValue(propValue, propName) {
@@ -889,47 +897,47 @@ class XmlParser extends AbstractParser_1.AbstractParser {
889
897
  Number.parseInt(propValue, 10) === 0) {
890
898
  return false;
891
899
  }
892
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An boolean value was expected.`);
900
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An boolean value was expected.`);
893
901
  }
894
902
  getIntegerPropertyValue(propValue, propName) {
895
903
  const result = Number.parseFloat(propValue);
896
904
  if (isNaN(result) || result % 1 !== 0)
897
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An integer value was expected.`);
905
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An integer value was expected.`);
898
906
  return result;
899
907
  }
900
908
  getDatePropertyValue(propValue, propName) {
901
909
  const result = Number.parseInt(propValue, 10);
902
910
  if (isNaN(result))
903
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A date in milliseconds was expected.`);
911
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A date in milliseconds was expected.`);
904
912
  return new Date(result);
905
913
  }
906
914
  getDoublePropertyValue(propValue, propName) {
907
915
  const result = Number.parseFloat(propValue);
908
916
  if (isNaN(result))
909
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A double value was expected.`);
917
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A double value was expected.`);
910
918
  return result;
911
919
  }
912
920
  getPoint2DPropertyValue(propValue, propName) {
913
921
  const result = propValue.split(",");
914
922
  if (result.length !== 2) {
915
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
923
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
916
924
  }
917
925
  const x = Number.parseFloat(result[0]);
918
926
  const y = Number.parseFloat(result[1]);
919
927
  if (isNaN(x) || isNaN(y))
920
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
928
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);
921
929
  return { x, y };
922
930
  }
923
931
  getPoint3DPropertyValue(propValue, propName) {
924
932
  const result = propValue.split(",");
925
933
  if (result.length !== 3) {
926
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
934
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
927
935
  }
928
936
  const x = Number.parseFloat(result[0]);
929
937
  const y = Number.parseFloat(result[1]);
930
938
  const z = Number.parseFloat(result[2]);
931
939
  if (isNaN(x) || isNaN(y) || isNaN(z))
932
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
940
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
933
941
  return { x, y, z };
934
942
  }
935
943
  isSchemaFullNameValidForVersion(schemaFullName, ecSpecVersion) {
@@ -961,7 +969,7 @@ class XmlParser extends AbstractParser_1.AbstractParser {
961
969
  return `${this._schemaName}.${nameParts[1]}`;
962
970
  if (this._schemaReferenceNames.has(nameParts[0].toLowerCase()))
963
971
  return `${this._schemaReferenceNames.get(nameParts[0].toLowerCase())}.${nameParts[1]}`;
964
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaXML, `No valid schema found for alias ${nameParts[0]}`);
972
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `No valid schema found for alias ${nameParts[0]}`);
965
973
  }
966
974
  /** The rest of the API uses the full name format of `{SchemaName}.{SchemaItemName}`,
967
975
  * meaning all of the references in the format string need to be changed.