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

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