@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
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- import { ECObjectsError, ECObjectsStatus } from "../Exception";
5
+ import { ECSchemaError, ECSchemaStatus } from "../Exception";
6
6
  import { ECName } from "../ECName";
7
7
  import { AbstractParser } from "./AbstractParser";
8
8
  import { SchemaReadHelper } from "./Helper";
@@ -12,10 +12,13 @@ function isObject(x) {
12
12
  const SCHEMAURL_JSON = "https://dev\\.bentley\\.com/json_schemas/ec";
13
13
  /** @internal */
14
14
  export class JsonParser extends AbstractParser {
15
+ _rawSchema;
16
+ _schemaName;
17
+ _currentItemFullName;
15
18
  constructor(rawSchema) {
16
19
  super();
17
20
  if (!isObject(rawSchema))
18
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Invalid JSON object.`);
21
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Invalid JSON object.`);
19
22
  this._rawSchema = rawSchema;
20
23
  this._schemaName = rawSchema.name;
21
24
  this._ecSpecVersion = JsonParser.parseJSUri(rawSchema.$schema);
@@ -38,28 +41,28 @@ export class JsonParser extends AbstractParser {
38
41
  */
39
42
  parseSchema() {
40
43
  if (undefined === this._rawSchema.name)
41
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `An ECSchema is missing the required 'name' attribute.`);
44
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECSchema is missing the required 'name' attribute.`);
42
45
  if (typeof (this._rawSchema.name) !== "string")
43
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `An ECSchema has an invalid 'name' attribute. It should be of type 'string'.`);
46
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECSchema has an invalid 'name' attribute. It should be of type 'string'.`);
44
47
  if (undefined === this._rawSchema.$schema)
45
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required '$schema' attribute.`);
48
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required '$schema' attribute.`);
46
49
  if (typeof (this._rawSchema.$schema) !== "string")
47
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid '$schema' attribute. It should be of type 'string'.`);
50
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid '$schema' attribute. It should be of type 'string'.`);
48
51
  if (undefined === this._rawSchema.version)
49
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required 'version' attribute.`);
52
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required 'version' attribute.`);
50
53
  if (typeof (this._rawSchema.version) !== "string")
51
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'version' attribute. It should be of type 'string'.`);
54
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'version' attribute. It should be of type 'string'.`);
52
55
  if (undefined !== this._rawSchema.alias) {
53
56
  if (typeof (this._rawSchema.alias) !== "string")
54
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'alias' attribute. It should be of type 'string'.`);
57
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'alias' attribute. It should be of type 'string'.`);
55
58
  }
56
59
  if (undefined !== this._rawSchema.label) {
57
60
  if (typeof (this._rawSchema.label) !== "string")
58
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'label' attribute. It should be of type 'string'.`);
61
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'label' attribute. It should be of type 'string'.`);
59
62
  }
60
63
  if (undefined !== this._rawSchema.description) {
61
64
  if (typeof (this._rawSchema.description) !== "string")
62
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'description' attribute. It should be of type 'string'.`);
65
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'description' attribute. It should be of type 'string'.`);
63
66
  }
64
67
  const ecVersions = JsonParser.parseJSUri(this._rawSchema.$schema);
65
68
  return {
@@ -71,7 +74,7 @@ export class JsonParser extends AbstractParser {
71
74
  *getReferences() {
72
75
  if (undefined !== this._rawSchema.references) {
73
76
  if (!Array.isArray(this._rawSchema.references))
74
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema ${this._rawSchema.name} has an invalid 'references' attribute. It should be of type 'object[]'.`);
77
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._rawSchema.name} has an invalid 'references' attribute. It should be of type 'object[]'.`);
75
78
  for (const ref of this._rawSchema.references) {
76
79
  yield this.checkSchemaReference(ref);
77
80
  }
@@ -79,33 +82,33 @@ export class JsonParser extends AbstractParser {
79
82
  }
80
83
  checkSchemaReference(jsonObj) {
81
84
  if (!isObject(jsonObj))
82
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. It should be of type 'object[]'.`);
85
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. It should be of type 'object[]'.`);
83
86
  if (undefined === jsonObj.name)
84
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'name' attribute.`);
87
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'name' attribute.`);
85
88
  if (typeof (jsonObj.name) !== "string")
86
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references has an invalid 'name' attribute. It should be of type 'string'.`);
89
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references has an invalid 'name' attribute. It should be of type 'string'.`);
87
90
  if (undefined === jsonObj.version)
88
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'version' attribute.`);
91
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'version' attribute.`);
89
92
  if (typeof (jsonObj.version) !== "string")
90
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references has an invalid 'version' attribute. It should be of type 'string'.`);
93
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references has an invalid 'version' attribute. It should be of type 'string'.`);
91
94
  return jsonObj;
92
95
  }
93
96
  *getItems() {
94
97
  const items = this._rawSchema.items;
95
98
  if (undefined !== items) {
96
99
  if (!isObject(items) || Array.isArray(items))
97
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);
100
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);
98
101
  // eslint-disable-next-line guard-for-in
99
102
  for (const itemName in items) {
100
103
  const item = items[itemName];
101
104
  if (!isObject(item))
102
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);
105
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);
103
106
  if (!ECName.validate(itemName))
104
- throw new ECObjectsError(ECObjectsStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);
107
+ throw new ECSchemaError(ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);
105
108
  if (undefined === item.schemaItemType)
106
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);
109
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);
107
110
  if (typeof (item.schemaItemType) !== "string")
108
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);
111
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);
109
112
  this._currentItemFullName = `${this._schemaName}.${itemName}`;
110
113
  yield [itemName, item.schemaItemType, item];
111
114
  }
@@ -115,17 +118,17 @@ export class JsonParser extends AbstractParser {
115
118
  const items = this._rawSchema.items;
116
119
  if (undefined !== items) {
117
120
  if (!isObject(items) || Array.isArray(items))
118
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);
121
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);
119
122
  const item = items[itemName];
120
123
  if (undefined !== item) {
121
124
  if (!isObject(item))
122
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);
125
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);
123
126
  if (!ECName.validate(itemName))
124
- throw new ECObjectsError(ECObjectsStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);
127
+ throw new ECSchemaError(ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);
125
128
  if (undefined === item.schemaItemType)
126
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);
129
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);
127
130
  if (typeof (item.schemaItemType) !== "string")
128
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);
131
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);
129
132
  this._currentItemFullName = `${this._schemaName}.${itemName}`;
130
133
  return [itemName, item.schemaItemType, item];
131
134
  }
@@ -139,33 +142,33 @@ export class JsonParser extends AbstractParser {
139
142
  checkSchemaItemProps(jsonObj) {
140
143
  if (undefined !== jsonObj.description) {
141
144
  if (typeof (jsonObj.description) !== "string")
142
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'description' attribute. It should be of type 'string'.`);
145
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'description' attribute. It should be of type 'string'.`);
143
146
  }
144
147
  if (undefined !== jsonObj.label) {
145
148
  if (typeof (jsonObj.label) !== "string")
146
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'label' attribute. It should be of type 'string'.`);
149
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'label' attribute. It should be of type 'string'.`);
147
150
  }
148
151
  }
149
152
  *getProperties(jsonObj, itemName) {
150
153
  const properties = jsonObj.properties;
151
154
  if (undefined !== properties) {
152
155
  if (!Array.isArray(properties))
153
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECClass ${itemName} has an invalid 'properties' attribute. It should be of type 'object[]'.`);
156
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${itemName} has an invalid 'properties' attribute. It should be of type 'object[]'.`);
154
157
  for (const property of properties) {
155
158
  if (!isObject(property))
156
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `An ECProperty in ${itemName} is an invalid JSON object.`);
159
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} is an invalid JSON object.`);
157
160
  if (undefined === property.name)
158
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `An ECProperty in ${itemName} is missing the required 'name' attribute.`);
161
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} is missing the required 'name' attribute.`);
159
162
  if (typeof (property.name) !== "string")
160
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `An ECProperty in ${itemName} has an invalid 'name' attribute. It should be of type 'string'.`);
163
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} has an invalid 'name' attribute. It should be of type 'string'.`);
161
164
  if (undefined === property.type)
162
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} does not have the required 'type' attribute.`);
165
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} does not have the required 'type' attribute.`);
163
166
  if (typeof (property.type) !== "string")
164
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. It should be of type 'string'.`);
167
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. It should be of type 'string'.`);
165
168
  if (!this.isValidPropertyType(property.type)) {
166
169
  if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
167
170
  return;
168
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. '${property.type}' is not a valid type.`);
171
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. '${property.type}' is not a valid type.`);
169
172
  }
170
173
  yield [property.name, property.type, property];
171
174
  }
@@ -179,15 +182,15 @@ export class JsonParser extends AbstractParser {
179
182
  this.checkSchemaItemProps(jsonObj);
180
183
  if (undefined !== jsonObj.modifier) {
181
184
  if (typeof (jsonObj.modifier) !== "string")
182
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'modifier' attribute. It should be of type 'string'.`);
185
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'modifier' attribute. It should be of type 'string'.`);
183
186
  }
184
187
  if (undefined !== jsonObj.baseClass) {
185
188
  if (typeof (jsonObj.baseClass) !== "string")
186
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'baseClass' attribute. It should be of type 'string'.`);
189
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'baseClass' attribute. It should be of type 'string'.`);
187
190
  }
188
191
  if (undefined !== jsonObj.customAttributes) {
189
192
  if (!Array.isArray(jsonObj.customAttributes)) {
190
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
193
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
191
194
  }
192
195
  }
193
196
  }
@@ -200,10 +203,10 @@ export class JsonParser extends AbstractParser {
200
203
  this.checkClassProps(jsonObj);
201
204
  if (undefined !== jsonObj.mixins) {
202
205
  if (!Array.isArray(jsonObj.mixins))
203
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);
206
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);
204
207
  for (const mixinName of jsonObj.mixins) {
205
208
  if (typeof (mixinName) !== "string")
206
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);
209
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);
207
210
  }
208
211
  }
209
212
  return {
@@ -220,9 +223,9 @@ export class JsonParser extends AbstractParser {
220
223
  parseMixin(jsonObj) {
221
224
  this.checkClassProps(jsonObj);
222
225
  if (undefined === jsonObj.appliesTo)
223
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);
226
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);
224
227
  if (typeof (jsonObj.appliesTo) !== "string")
225
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);
228
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);
226
229
  return {
227
230
  ...jsonObj,
228
231
  originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,
@@ -237,9 +240,9 @@ export class JsonParser extends AbstractParser {
237
240
  parseCustomAttributeClass(jsonObj) {
238
241
  this.checkClassProps(jsonObj);
239
242
  if (undefined === jsonObj.appliesTo)
240
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);
243
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);
241
244
  if (typeof (jsonObj.appliesTo) !== "string")
242
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);
245
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);
243
246
  return {
244
247
  ...jsonObj,
245
248
  originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,
@@ -266,22 +269,22 @@ export class JsonParser extends AbstractParser {
266
269
  parseRelationshipClass(jsonObj) {
267
270
  this.checkClassProps(jsonObj);
268
271
  if (undefined === jsonObj.strength)
269
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strength' attribute.`);
272
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strength' attribute.`);
270
273
  if (typeof (jsonObj.strength) !== "string")
271
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strength' attribute. It should be of type 'string'.`);
274
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strength' attribute. It should be of type 'string'.`);
272
275
  if (undefined === jsonObj.strengthDirection)
273
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strengthDirection' attribute.`);
276
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strengthDirection' attribute.`);
274
277
  if (typeof (jsonObj.strengthDirection) !== "string")
275
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strengthDirection' attribute. It should be of type 'string'.`);
278
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strengthDirection' attribute. It should be of type 'string'.`);
276
279
  if (undefined === jsonObj.source)
277
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required source constraint.`);
280
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required source constraint.`);
278
281
  if (!isObject(jsonObj.source))
279
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid source constraint. It should be of type 'object'.`);
282
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid source constraint. It should be of type 'object'.`);
280
283
  this.checkRelationshipConstraintProps(jsonObj.source, true);
281
284
  if (undefined === jsonObj.target)
282
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required target constraint.`);
285
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required target constraint.`);
283
286
  if (!isObject(jsonObj.target))
284
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid target constraint. It should be of type 'object'.`);
287
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid target constraint. It should be of type 'object'.`);
285
288
  this.checkRelationshipConstraintProps(jsonObj.target, false);
286
289
  return {
287
290
  ...jsonObj,
@@ -298,29 +301,29 @@ export class JsonParser extends AbstractParser {
298
301
  checkRelationshipConstraintProps(jsonObj, isSource) {
299
302
  const constraintName = `${(isSource) ? "Source" : "Target"} Constraint of ${this._currentItemFullName}`; // most specific name to call RelationshipConstraint
300
303
  if (undefined === jsonObj.multiplicity)
301
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${constraintName} is missing the required 'multiplicity' attribute.`);
304
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'multiplicity' attribute.`);
302
305
  if (typeof (jsonObj.multiplicity) !== "string")
303
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'multiplicity' attribute. It should be of type 'string'.`);
306
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'multiplicity' attribute. It should be of type 'string'.`);
304
307
  if (undefined === jsonObj.roleLabel)
305
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${constraintName} is missing the required 'roleLabel' attribute.`);
308
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'roleLabel' attribute.`);
306
309
  if (typeof (jsonObj.roleLabel) !== "string")
307
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'roleLabel' attribute. It should be of type 'string'.`);
310
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'roleLabel' attribute. It should be of type 'string'.`);
308
311
  if (undefined === jsonObj.polymorphic)
309
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${constraintName} is missing the required 'polymorphic' attribute.`);
312
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'polymorphic' attribute.`);
310
313
  if (typeof (jsonObj.polymorphic) !== "boolean")
311
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'polymorphic' attribute. It should be of type 'boolean'.`);
314
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'polymorphic' attribute. It should be of type 'boolean'.`);
312
315
  if (undefined !== jsonObj.abstractConstraint && typeof (jsonObj.abstractConstraint) !== "string")
313
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'abstractConstraint' attribute. It should be of type 'string'.`);
316
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'abstractConstraint' attribute. It should be of type 'string'.`);
314
317
  if (undefined === jsonObj.constraintClasses)
315
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${constraintName} is missing the required 'constraintClasses' attribute.`);
318
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'constraintClasses' attribute.`);
316
319
  if (!Array.isArray(jsonObj.constraintClasses))
317
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);
320
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);
318
321
  for (const constraintClassName of jsonObj.constraintClasses) {
319
322
  if (typeof (constraintClassName) !== "string")
320
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);
323
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);
321
324
  }
322
325
  if (undefined !== jsonObj.customAttributes && !Array.isArray(jsonObj.customAttributes))
323
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
326
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
324
327
  }
325
328
  /**
326
329
  * Type checks Enumeration and returns EnumerationProps interface
@@ -330,9 +333,9 @@ export class JsonParser extends AbstractParser {
330
333
  parseEnumeration(jsonObj) {
331
334
  this.checkSchemaItemProps(jsonObj);
332
335
  if (undefined === jsonObj.type)
333
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'type' attribute.`);
336
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'type' attribute.`);
334
337
  if (typeof (jsonObj.type) !== "string")
335
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);
338
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);
336
339
  const isValidEnumerationType = (type) => {
337
340
  type = type.toLowerCase();
338
341
  return (type === "int") ||
@@ -343,37 +346,37 @@ export class JsonParser extends AbstractParser {
343
346
  if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
344
347
  jsonObj.type = "string";
345
348
  else
346
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be either "int" or "string".`);
349
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be either "int" or "string".`);
347
350
  }
348
351
  if (undefined !== jsonObj.isStrict) { // TODO: make required
349
352
  if (typeof (jsonObj.isStrict) !== "boolean")
350
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'isStrict' attribute. It should be of type 'boolean'.`);
353
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'isStrict' attribute. It should be of type 'boolean'.`);
351
354
  }
352
355
  if (undefined === jsonObj.enumerators)
353
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'enumerators' attribute.`);
356
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'enumerators' attribute.`);
354
357
  if (!Array.isArray(jsonObj.enumerators))
355
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);
358
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);
356
359
  for (const enumerator of jsonObj.enumerators) {
357
360
  if (!isObject(enumerator))
358
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);
361
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);
359
362
  if (undefined === enumerator.value)
360
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'value'.`);
363
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'value'.`);
361
364
  // TODO: Should this really be handled here?
362
365
  const expectedType = jsonObj.type;
363
366
  const receivedType = (typeof (enumerator.value) === "number") ? "int" : typeof (enumerator.value);
364
367
  if (!expectedType.includes(receivedType)) // is receivedType a substring of expectedType? - easiest way to check "int" === "int" | "integer" && "string" === "string"
365
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an incompatible type. It must be "${expectedType}", not "${receivedType}".`);
368
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an incompatible type. It must be "${expectedType}", not "${receivedType}".`);
366
369
  if (undefined === enumerator.name)
367
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'name'.`);
370
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'name'.`);
368
371
  if (typeof (enumerator.name) !== "string")
369
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'name' attribute. It should be of type 'string'.`);
372
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'name' attribute. It should be of type 'string'.`);
370
373
  if (undefined !== enumerator.label) {
371
374
  if (typeof (enumerator.label) !== "string")
372
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'label' attribute. It should be of type 'string'.`);
375
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'label' attribute. It should be of type 'string'.`);
373
376
  }
374
377
  if (undefined !== enumerator.description) {
375
378
  if (typeof (enumerator.description) !== "string")
376
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'description' attribute. It should be of type 'string'.`);
379
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'description' attribute. It should be of type 'string'.`);
377
380
  }
378
381
  }
379
382
  return jsonObj;
@@ -386,17 +389,17 @@ export class JsonParser extends AbstractParser {
386
389
  parseKindOfQuantity(jsonObj) {
387
390
  this.checkSchemaItemProps(jsonObj);
388
391
  if (undefined === jsonObj.relativeError)
389
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);
392
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);
390
393
  if (typeof (jsonObj.relativeError) !== "number")
391
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be of type 'number'.`);
394
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be of type 'number'.`);
392
395
  if (undefined !== jsonObj.presentationUnits) {
393
396
  if (!Array.isArray(jsonObj.presentationUnits) && typeof (jsonObj.presentationUnits) !== "string")
394
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'presentationUnits' attribute. It should be of type 'string' or 'string[]'.`);
397
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'presentationUnits' attribute. It should be of type 'string' or 'string[]'.`);
395
398
  }
396
399
  if (undefined === jsonObj.persistenceUnit)
397
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'persistenceUnit' attribute.`);
400
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'persistenceUnit' attribute.`);
398
401
  if (typeof (jsonObj.persistenceUnit) !== "string")
399
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'persistenceUnit' attribute. It should be of type 'string'.`);
402
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'persistenceUnit' attribute. It should be of type 'string'.`);
400
403
  return jsonObj;
401
404
  }
402
405
  /**
@@ -408,7 +411,7 @@ export class JsonParser extends AbstractParser {
408
411
  this.checkSchemaItemProps(jsonObj);
409
412
  if (undefined !== jsonObj.priority) { // TODO: make required
410
413
  if (typeof (jsonObj.priority) !== "number")
411
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be of type 'number'.`);
414
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be of type 'number'.`);
412
415
  }
413
416
  return jsonObj;
414
417
  }
@@ -420,28 +423,28 @@ export class JsonParser extends AbstractParser {
420
423
  parseUnit(jsonObj) {
421
424
  this.checkSchemaItemProps(jsonObj);
422
425
  if (undefined === jsonObj.phenomenon)
423
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);
426
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);
424
427
  if (typeof (jsonObj.phenomenon) !== "string")
425
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);
428
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);
426
429
  if (undefined === jsonObj.unitSystem)
427
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);
430
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);
428
431
  if (typeof (jsonObj.unitSystem) !== "string")
429
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);
432
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);
430
433
  if (undefined === jsonObj.definition)
431
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'definition' attribute.`);
434
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'definition' attribute.`);
432
435
  if (typeof (jsonObj.definition) !== "string")
433
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
436
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
434
437
  if (undefined !== jsonObj.numerator) {
435
438
  if (typeof (jsonObj.numerator) !== "number")
436
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);
439
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);
437
440
  }
438
441
  if (undefined !== jsonObj.denominator) {
439
442
  if (typeof (jsonObj.denominator) !== "number")
440
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);
443
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);
441
444
  }
442
445
  if (undefined !== jsonObj.offset) {
443
446
  if (typeof (jsonObj.offset) !== "number")
444
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'offset' attribute. It should be of type 'number'.`);
447
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'offset' attribute. It should be of type 'number'.`);
445
448
  }
446
449
  return jsonObj;
447
450
  }
@@ -453,13 +456,13 @@ export class JsonParser extends AbstractParser {
453
456
  parseInvertedUnit(jsonObj) {
454
457
  this.checkSchemaItemProps(jsonObj);
455
458
  if (undefined === jsonObj.invertsUnit)
456
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'invertsUnit' attribute.`);
459
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'invertsUnit' attribute.`);
457
460
  if (typeof (jsonObj.invertsUnit) !== "string")
458
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'invertsUnit' attribute. It should be of type 'string'.`);
461
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'invertsUnit' attribute. It should be of type 'string'.`);
459
462
  if (undefined === jsonObj.unitSystem)
460
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);
463
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);
461
464
  if (typeof (jsonObj.unitSystem) !== "string")
462
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);
465
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);
463
466
  return jsonObj;
464
467
  }
465
468
  /**
@@ -470,20 +473,20 @@ export class JsonParser extends AbstractParser {
470
473
  parseConstant(jsonObj) {
471
474
  this.checkSchemaItemProps(jsonObj);
472
475
  if (undefined === jsonObj.phenomenon)
473
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);
476
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);
474
477
  if (typeof (jsonObj.phenomenon) !== "string")
475
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);
478
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);
476
479
  if (undefined === jsonObj.definition)
477
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'definition' attribute.`);
480
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'definition' attribute.`);
478
481
  if (typeof (jsonObj.definition) !== "string")
479
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
482
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
480
483
  if (undefined !== jsonObj.numerator) {
481
484
  if (typeof (jsonObj.numerator) !== "number")
482
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);
485
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);
483
486
  }
484
487
  if (undefined !== jsonObj.denominator) {
485
488
  if (typeof (jsonObj.denominator) !== "number")
486
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);
489
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);
487
490
  }
488
491
  return jsonObj;
489
492
  }
@@ -495,9 +498,9 @@ export class JsonParser extends AbstractParser {
495
498
  parsePhenomenon(jsonObj) {
496
499
  this.checkSchemaItemProps(jsonObj);
497
500
  if (undefined === jsonObj.definition)
498
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} does not have the required 'definition' attribute.`);
501
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} does not have the required 'definition' attribute.`);
499
502
  if (typeof (jsonObj.definition) !== "string")
500
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
503
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
501
504
  return jsonObj;
502
505
  }
503
506
  /**
@@ -508,54 +511,54 @@ export class JsonParser extends AbstractParser {
508
511
  parseFormat(jsonObj) {
509
512
  this.checkSchemaItemProps(jsonObj);
510
513
  if (undefined === jsonObj.type)
511
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} does not have the required 'type' attribute.`);
514
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} does not have the required 'type' attribute.`);
512
515
  if (typeof (jsonObj.type) !== "string")
513
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);
516
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);
514
517
  if (undefined !== jsonObj.precision && typeof (jsonObj.precision) !== "number")
515
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'precision' attribute. It should be of type 'number'.`);
518
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'precision' attribute. It should be of type 'number'.`);
516
519
  if (undefined !== jsonObj.roundFactor && typeof (jsonObj.roundFactor) !== "number")
517
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'roundFactor' attribute. It should be of type 'number'.`);
520
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'roundFactor' attribute. It should be of type 'number'.`);
518
521
  if (undefined !== jsonObj.minWidth && typeof (jsonObj.minWidth) !== "number")
519
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'minWidth' attribute. It should be of type 'number'.`);
522
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'minWidth' attribute. It should be of type 'number'.`);
520
523
  if (undefined !== jsonObj.showSignOption && typeof (jsonObj.showSignOption) !== "string")
521
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'showSignOption' attribute. It should be of type 'string'.`);
524
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'showSignOption' attribute. It should be of type 'string'.`);
522
525
  if (undefined !== jsonObj.formatTraits) {
523
526
  if (!Array.isArray(jsonObj.formatTraits) && typeof (jsonObj.formatTraits) !== "string") // must be either an array of strings or a string
524
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'formatTraits' attribute. It should be of type 'string' or 'string[]'.`);
527
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'formatTraits' attribute. It should be of type 'string' or 'string[]'.`);
525
528
  }
526
529
  if (undefined !== jsonObj.decimalSeparator && typeof (jsonObj.decimalSeparator) !== "string")
527
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'decimalSeparator' attribute. It should be of type 'string'.`);
530
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'decimalSeparator' attribute. It should be of type 'string'.`);
528
531
  if (undefined !== jsonObj.thousandSeparator && typeof (jsonObj.thousandSeparator) !== "string")
529
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'thousandSeparator' attribute. It should be of type 'string'.`);
532
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'thousandSeparator' attribute. It should be of type 'string'.`);
530
533
  if (undefined !== jsonObj.uomSeparator && typeof (jsonObj.uomSeparator) !== "string")
531
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'uomSeparator' attribute. It should be of type 'string'.`);
534
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'uomSeparator' attribute. It should be of type 'string'.`);
532
535
  if (undefined !== jsonObj.scientificType && typeof (jsonObj.scientificType) !== "string")
533
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'scientificType' attribute. It should be of type 'string'.`);
536
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'scientificType' attribute. It should be of type 'string'.`);
534
537
  if (undefined !== jsonObj.stationOffsetSize && typeof (jsonObj.stationOffsetSize) !== "number")
535
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationOffsetSize' attribute. It should be of type 'number'.`);
538
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationOffsetSize' attribute. It should be of type 'number'.`);
536
539
  if (undefined !== jsonObj.stationSeparator && typeof (jsonObj.stationSeparator) !== "string")
537
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationSeparator' attribute. It should be of type 'string'.`);
540
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationSeparator' attribute. It should be of type 'string'.`);
538
541
  if (undefined !== jsonObj.composite) { // optional
539
542
  if (!isObject(jsonObj.composite))
540
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'composite' object.`);
543
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'composite' object.`);
541
544
  if (undefined !== jsonObj.composite.includeZero && typeof (jsonObj.composite.includeZero) !== "boolean")
542
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'includeZero' attribute. It should be of type 'boolean'.`);
545
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'includeZero' attribute. It should be of type 'boolean'.`);
543
546
  if (undefined !== jsonObj.composite.spacer && typeof (jsonObj.composite.spacer) !== "string")
544
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'spacer' attribute. It should be of type 'string'.`);
547
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'spacer' attribute. It should be of type 'string'.`);
545
548
  // if composite is defined
546
549
  if (undefined === jsonObj.composite.units)
547
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'Composite' attribute. It should have 1-4 units.`);
550
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'Composite' attribute. It should have 1-4 units.`);
548
551
  if (!Array.isArray(jsonObj.composite.units))
549
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);
552
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);
550
553
  for (let i = 0; i < jsonObj.composite.units.length; i++) {
551
554
  if (!isObject(jsonObj.composite.units[i]))
552
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);
555
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);
553
556
  if (undefined === jsonObj.composite.units[i].name) // required
554
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} is missing the required 'name' attribute.`);
557
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} is missing the required 'name' attribute.`);
555
558
  if (typeof (jsonObj.composite.units[i].name) !== "string")
556
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} has an invalid 'name' attribute. It should be of type 'string'.`);
559
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} has an invalid 'name' attribute. It should be of type 'string'.`);
557
560
  if (undefined !== jsonObj.composite.units[i].label && typeof (jsonObj.composite.units[i].label) !== "string")
558
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} has an invalid 'label' attribute. It should be of type 'string'.`);
561
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} has an invalid 'label' attribute. It should be of type 'string'.`);
559
562
  }
560
563
  }
561
564
  return jsonObj;
@@ -576,36 +579,36 @@ export class JsonParser extends AbstractParser {
576
579
  checkPropertyProps(jsonObj) {
577
580
  const propName = jsonObj.name;
578
581
  if (undefined !== jsonObj.label && typeof (jsonObj.label) !== "string")
579
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'label' attribute. It should be of type 'string'.`);
582
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'label' attribute. It should be of type 'string'.`);
580
583
  if (undefined !== jsonObj.description && typeof (jsonObj.description) !== "string")
581
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'description' attribute. It should be of type 'string'.`);
584
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'description' attribute. It should be of type 'string'.`);
582
585
  if (undefined !== jsonObj.priority && typeof (jsonObj.priority) !== "number")
583
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'priority' attribute. It should be of type 'number'.`);
586
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'priority' attribute. It should be of type 'number'.`);
584
587
  if (undefined !== jsonObj.isReadOnly && typeof (jsonObj.isReadOnly) !== "boolean")
585
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'isReadOnly' attribute. It should be of type 'boolean'.`);
588
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'isReadOnly' attribute. It should be of type 'boolean'.`);
586
589
  if (undefined !== jsonObj.category && typeof (jsonObj.category) !== "string")
587
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'category' attribute. It should be of type 'string'.`);
590
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'category' attribute. It should be of type 'string'.`);
588
591
  if (undefined !== jsonObj.kindOfQuantity && typeof (jsonObj.kindOfQuantity) !== "string")
589
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'kindOfQuantity' attribute. It should be of type 'string'.`);
592
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'kindOfQuantity' attribute. It should be of type 'string'.`);
590
593
  if (undefined !== jsonObj.inherited && typeof (jsonObj.inherited) !== "boolean")
591
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'inherited' attribute. It should be of type 'boolean'.`);
594
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'inherited' attribute. It should be of type 'boolean'.`);
592
595
  if (undefined !== jsonObj.customAttributes && !Array.isArray(jsonObj.customAttributes))
593
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
596
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
594
597
  return jsonObj;
595
598
  }
596
599
  checkPropertyTypename(jsonObj) {
597
600
  const propName = jsonObj.name;
598
601
  if (undefined === jsonObj.typeName)
599
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} is missing the required 'typeName' attribute.`);
602
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} is missing the required 'typeName' attribute.`);
600
603
  if (typeof (jsonObj.typeName) !== "string")
601
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'typeName' attribute. It should be of type 'string'.`);
604
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'typeName' attribute. It should be of type 'string'.`);
602
605
  }
603
606
  checkPropertyMinAndMaxOccurs(jsonObj) {
604
607
  const propName = jsonObj.name;
605
608
  if (undefined !== jsonObj.minOccurs && typeof (jsonObj.minOccurs) !== "number")
606
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minOccurs' attribute. It should be of type 'number'.`);
609
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minOccurs' attribute. It should be of type 'number'.`);
607
610
  if (undefined !== jsonObj.maxOccurs && typeof (jsonObj.maxOccurs) !== "number")
608
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be of type 'number'.`);
611
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be of type 'number'.`);
609
612
  }
610
613
  /**
611
614
  * Type checks PrimitiveOrEnumProperty and returns PrimitiveOrEnumPropertyBaseProps interface
@@ -617,15 +620,15 @@ export class JsonParser extends AbstractParser {
617
620
  this.checkPropertyTypename(jsonObj);
618
621
  const propName = jsonObj.name;
619
622
  if (undefined !== jsonObj.minLength && typeof (jsonObj.minLength) !== "number")
620
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minLength' attribute. It should be of type 'number'.`);
623
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minLength' attribute. It should be of type 'number'.`);
621
624
  if (undefined !== jsonObj.maxLength && typeof (jsonObj.maxLength) !== "number")
622
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxLength' attribute. It should be of type 'number'.`);
625
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxLength' attribute. It should be of type 'number'.`);
623
626
  if (undefined !== jsonObj.minValue && typeof (jsonObj.minValue) !== "number")
624
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minValue' attribute. It should be of type 'number'.`);
627
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minValue' attribute. It should be of type 'number'.`);
625
628
  if (undefined !== jsonObj.maxValue && typeof (jsonObj.maxValue) !== "number")
626
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxValue' attribute. It should be of type 'number'.`);
629
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxValue' attribute. It should be of type 'number'.`);
627
630
  if (undefined !== jsonObj.extendedTypeName && typeof (jsonObj.extendedTypeName) !== "string")
628
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'extendedTypeName' attribute. It should be of type 'string'.`);
631
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'extendedTypeName' attribute. It should be of type 'string'.`);
629
632
  return jsonObj;
630
633
  }
631
634
  /**
@@ -677,13 +680,13 @@ export class JsonParser extends AbstractParser {
677
680
  this.checkPropertyProps(jsonObj);
678
681
  const fullname = `${this._currentItemFullName}.${jsonObj.name}`;
679
682
  if (undefined === jsonObj.relationshipName)
680
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'relationshipName' property.`);
683
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'relationshipName' property.`);
681
684
  if (typeof (jsonObj.relationshipName) !== "string")
682
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'relationshipName' property. It should be of type 'string'.`);
685
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'relationshipName' property. It should be of type 'string'.`);
683
686
  if (undefined === jsonObj.direction)
684
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'direction' property.`);
687
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'direction' property.`);
685
688
  if (typeof (jsonObj.direction) !== "string")
686
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'direction' property. It should be of type 'string'.`);
689
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'direction' property. It should be of type 'string'.`);
687
690
  return jsonObj;
688
691
  }
689
692
  getSchemaCustomAttributeProviders() {
@@ -703,14 +706,14 @@ export class JsonParser extends AbstractParser {
703
706
  *getCustomAttributeProviders(jsonObj, type, name) {
704
707
  if (undefined !== jsonObj.customAttributes) {
705
708
  if (!Array.isArray(jsonObj.customAttributes))
706
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);
709
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);
707
710
  for (const instance of jsonObj.customAttributes) {
708
711
  if (!isObject(instance) || Array.isArray(instance))
709
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);
712
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);
710
713
  if (undefined === instance.className)
711
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes is missing the required 'className' attribute.`);
714
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes is missing the required 'className' attribute.`);
712
715
  if (typeof (instance.className) !== "string")
713
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes has an invalid 'className' attribute. It should be of type 'string'.`);
716
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes has an invalid 'className' attribute. It should be of type 'string'.`);
714
717
  const provider = (_caClass) => {
715
718
  return instance;
716
719
  };