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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/CHANGELOG.md +73 -1
  2. package/lib/cjs/Constants.d.ts +8 -0
  3. package/lib/cjs/Constants.d.ts.map +1 -1
  4. package/lib/cjs/Constants.js +30 -21
  5. package/lib/cjs/Constants.js.map +1 -1
  6. package/lib/cjs/Context.d.ts +85 -36
  7. package/lib/cjs/Context.d.ts.map +1 -1
  8. package/lib/cjs/Context.js +79 -29
  9. package/lib/cjs/Context.js.map +1 -1
  10. package/lib/cjs/DelayedPromise.d.ts +9 -8
  11. package/lib/cjs/DelayedPromise.d.ts.map +1 -1
  12. package/lib/cjs/DelayedPromise.js +8 -6
  13. package/lib/cjs/DelayedPromise.js.map +1 -1
  14. package/lib/cjs/Deserialization/AbstractParser.js +1 -0
  15. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  16. package/lib/cjs/Deserialization/Helper.d.ts +3 -3
  17. package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
  18. package/lib/cjs/Deserialization/Helper.js +35 -26
  19. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  20. package/lib/cjs/Deserialization/JsonParser.js +153 -150
  21. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  22. package/lib/cjs/Deserialization/JsonProps.d.ts +47 -33
  23. package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
  24. package/lib/cjs/Deserialization/JsonProps.js +3 -3
  25. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  26. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  27. package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
  28. package/lib/cjs/Deserialization/XmlParser.js +60 -52
  29. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  30. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +0 -5
  31. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
  32. package/lib/cjs/Deserialization/XmlSerializationUtils.js +8 -17
  33. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  34. package/lib/cjs/ECName.d.ts +2 -2
  35. package/lib/cjs/ECName.js +5 -4
  36. package/lib/cjs/ECName.js.map +1 -1
  37. package/lib/cjs/ECObjects.d.ts +41 -9
  38. package/lib/cjs/ECObjects.d.ts.map +1 -1
  39. package/lib/cjs/ECObjects.js +78 -24
  40. package/lib/cjs/ECObjects.js.map +1 -1
  41. package/lib/cjs/Exception.d.ts +4 -4
  42. package/lib/cjs/Exception.d.ts.map +1 -1
  43. package/lib/cjs/Exception.js +61 -60
  44. package/lib/cjs/Exception.js.map +1 -1
  45. package/lib/cjs/Interfaces.d.ts +35 -32
  46. package/lib/cjs/Interfaces.d.ts.map +1 -1
  47. package/lib/cjs/Interfaces.js.map +1 -1
  48. package/lib/cjs/Metadata/Class.d.ts +179 -32
  49. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  50. package/lib/cjs/Metadata/Class.js +290 -88
  51. package/lib/cjs/Metadata/Class.js.map +1 -1
  52. package/lib/cjs/Metadata/Constant.d.ts +26 -10
  53. package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
  54. package/lib/cjs/Metadata/Constant.js +38 -10
  55. package/lib/cjs/Metadata/Constant.js.map +1 -1
  56. package/lib/cjs/Metadata/CustomAttribute.d.ts +2 -2
  57. package/lib/cjs/Metadata/CustomAttribute.d.ts.map +1 -1
  58. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  59. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +21 -7
  60. package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
  61. package/lib/cjs/Metadata/CustomAttributeClass.js +28 -8
  62. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  63. package/lib/cjs/Metadata/EntityClass.d.ts +40 -11
  64. package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
  65. package/lib/cjs/Metadata/EntityClass.js +72 -34
  66. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  67. package/lib/cjs/Metadata/Enumeration.d.ts +30 -10
  68. package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
  69. package/lib/cjs/Metadata/Enumeration.js +41 -13
  70. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  71. package/lib/cjs/Metadata/Format.d.ts +65 -17
  72. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  73. package/lib/cjs/Metadata/Format.js +107 -22
  74. package/lib/cjs/Metadata/Format.js.map +1 -1
  75. package/lib/cjs/Metadata/InvertedUnit.d.ts +19 -10
  76. package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
  77. package/lib/cjs/Metadata/InvertedUnit.js +32 -15
  78. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  79. package/lib/cjs/Metadata/KindOfQuantity.d.ts +38 -18
  80. package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
  81. package/lib/cjs/Metadata/KindOfQuantity.js +90 -40
  82. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  83. package/lib/cjs/Metadata/Mixin.d.ts +31 -4
  84. package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
  85. package/lib/cjs/Metadata/Mixin.js +42 -8
  86. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  87. package/lib/cjs/Metadata/OverrideFormat.d.ts +12 -12
  88. package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
  89. package/lib/cjs/Metadata/OverrideFormat.js +36 -19
  90. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  91. package/lib/cjs/Metadata/Phenomenon.d.ts +24 -3
  92. package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
  93. package/lib/cjs/Metadata/Phenomenon.js +32 -3
  94. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  95. package/lib/cjs/Metadata/Property.d.ts +47 -25
  96. package/lib/cjs/Metadata/Property.d.ts.map +1 -1
  97. package/lib/cjs/Metadata/Property.js +128 -49
  98. package/lib/cjs/Metadata/Property.js.map +1 -1
  99. package/lib/cjs/Metadata/PropertyCategory.d.ts +20 -4
  100. package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
  101. package/lib/cjs/Metadata/PropertyCategory.js +31 -4
  102. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  103. package/lib/cjs/Metadata/RelationshipClass.d.ts +63 -27
  104. package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
  105. package/lib/cjs/Metadata/RelationshipClass.js +100 -43
  106. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  107. package/lib/cjs/Metadata/Schema.d.ts +167 -41
  108. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  109. package/lib/cjs/Metadata/Schema.js +211 -111
  110. package/lib/cjs/Metadata/Schema.js.map +1 -1
  111. package/lib/cjs/Metadata/SchemaItem.d.ts +19 -19
  112. package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
  113. package/lib/cjs/Metadata/SchemaItem.js +23 -21
  114. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  115. package/lib/cjs/Metadata/Unit.d.ts +24 -21
  116. package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
  117. package/lib/cjs/Metadata/Unit.js +40 -24
  118. package/lib/cjs/Metadata/Unit.js.map +1 -1
  119. package/lib/cjs/Metadata/UnitSystem.d.ts +17 -4
  120. package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
  121. package/lib/cjs/Metadata/UnitSystem.js +24 -4
  122. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  123. package/lib/cjs/PropertyTypes.d.ts +11 -11
  124. package/lib/cjs/PropertyTypes.d.ts.map +1 -1
  125. package/lib/cjs/PropertyTypes.js +28 -20
  126. package/lib/cjs/PropertyTypes.js.map +1 -1
  127. package/lib/cjs/SchemaFormatsProvider.d.ts +39 -0
  128. package/lib/cjs/SchemaFormatsProvider.d.ts.map +1 -0
  129. package/lib/cjs/SchemaFormatsProvider.js +146 -0
  130. package/lib/cjs/SchemaFormatsProvider.js.map +1 -0
  131. package/lib/cjs/SchemaJsonLocater.d.ts +8 -8
  132. package/lib/cjs/SchemaJsonLocater.d.ts.map +1 -1
  133. package/lib/cjs/SchemaJsonLocater.js +7 -7
  134. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  135. package/lib/cjs/SchemaKey.d.ts +13 -7
  136. package/lib/cjs/SchemaKey.d.ts.map +1 -1
  137. package/lib/cjs/SchemaKey.js +22 -12
  138. package/lib/cjs/SchemaKey.js.map +1 -1
  139. package/lib/cjs/SchemaLoader.d.ts +5 -5
  140. package/lib/cjs/SchemaLoader.d.ts.map +1 -1
  141. package/lib/cjs/SchemaLoader.js +5 -4
  142. package/lib/cjs/SchemaLoader.js.map +1 -1
  143. package/lib/cjs/SchemaPartVisitorDelegate.d.ts +2 -2
  144. package/lib/cjs/SchemaPartVisitorDelegate.js +2 -1
  145. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  146. package/lib/cjs/UnitConversion/Graph.js +69 -65
  147. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  148. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  149. package/lib/cjs/UnitConversion/UnitConversion.d.ts +1 -1
  150. package/lib/cjs/UnitConversion/UnitConversion.d.ts.map +1 -1
  151. package/lib/cjs/UnitConversion/UnitConversion.js +9 -7
  152. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  153. package/lib/cjs/UnitConversion/UnitConverter.js +2 -0
  154. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  155. package/lib/cjs/UnitConversion/UnitTree.d.ts +2 -0
  156. package/lib/cjs/UnitConversion/UnitTree.d.ts.map +1 -1
  157. package/lib/cjs/UnitConversion/UnitTree.js +11 -1
  158. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  159. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
  160. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +8 -9
  161. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  162. package/lib/cjs/Validation/SchemaWalker.d.ts +1 -1
  163. package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -1
  164. package/lib/cjs/Validation/SchemaWalker.js +6 -4
  165. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  166. package/lib/cjs/ecschema-metadata.d.ts +1 -0
  167. package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
  168. package/lib/cjs/ecschema-metadata.js +1 -0
  169. package/lib/cjs/ecschema-metadata.js.map +1 -1
  170. package/lib/cjs/utils/SchemaGraph.js +5 -6
  171. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  172. package/lib/esm/Constants.d.ts +8 -0
  173. package/lib/esm/Constants.d.ts.map +1 -1
  174. package/lib/esm/Constants.js +29 -20
  175. package/lib/esm/Constants.js.map +1 -1
  176. package/lib/esm/Context.d.ts +85 -36
  177. package/lib/esm/Context.d.ts.map +1 -1
  178. package/lib/esm/Context.js +78 -28
  179. package/lib/esm/Context.js.map +1 -1
  180. package/lib/esm/DelayedPromise.d.ts +9 -8
  181. package/lib/esm/DelayedPromise.d.ts.map +1 -1
  182. package/lib/esm/DelayedPromise.js +8 -6
  183. package/lib/esm/DelayedPromise.js.map +1 -1
  184. package/lib/esm/Deserialization/AbstractParser.js +1 -0
  185. package/lib/esm/Deserialization/AbstractParser.js.map +1 -1
  186. package/lib/esm/Deserialization/Helper.d.ts +3 -3
  187. package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
  188. package/lib/esm/Deserialization/Helper.js +36 -27
  189. package/lib/esm/Deserialization/Helper.js.map +1 -1
  190. package/lib/esm/Deserialization/JsonParser.js +154 -151
  191. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  192. package/lib/esm/Deserialization/JsonProps.d.ts +47 -33
  193. package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
  194. package/lib/esm/Deserialization/JsonProps.js +3 -3
  195. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  196. package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -1
  197. package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -1
  198. package/lib/esm/Deserialization/XmlParser.js +61 -53
  199. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  200. package/lib/esm/Deserialization/XmlSerializationUtils.d.ts +0 -5
  201. package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
  202. package/lib/esm/Deserialization/XmlSerializationUtils.js +9 -18
  203. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
  204. package/lib/esm/ECName.d.ts +2 -2
  205. package/lib/esm/ECName.js +6 -5
  206. package/lib/esm/ECName.js.map +1 -1
  207. package/lib/esm/ECObjects.d.ts +41 -9
  208. package/lib/esm/ECObjects.d.ts.map +1 -1
  209. package/lib/esm/ECObjects.js +77 -24
  210. package/lib/esm/ECObjects.js.map +1 -1
  211. package/lib/esm/Exception.d.ts +4 -4
  212. package/lib/esm/Exception.d.ts.map +1 -1
  213. package/lib/esm/Exception.js +59 -58
  214. package/lib/esm/Exception.js.map +1 -1
  215. package/lib/esm/Interfaces.d.ts +35 -32
  216. package/lib/esm/Interfaces.d.ts.map +1 -1
  217. package/lib/esm/Interfaces.js.map +1 -1
  218. package/lib/esm/Metadata/Class.d.ts +179 -32
  219. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  220. package/lib/esm/Metadata/Class.js +292 -90
  221. package/lib/esm/Metadata/Class.js.map +1 -1
  222. package/lib/esm/Metadata/Constant.d.ts +26 -10
  223. package/lib/esm/Metadata/Constant.d.ts.map +1 -1
  224. package/lib/esm/Metadata/Constant.js +39 -11
  225. package/lib/esm/Metadata/Constant.js.map +1 -1
  226. package/lib/esm/Metadata/CustomAttribute.d.ts +2 -2
  227. package/lib/esm/Metadata/CustomAttribute.d.ts.map +1 -1
  228. package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
  229. package/lib/esm/Metadata/CustomAttributeClass.d.ts +21 -7
  230. package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
  231. package/lib/esm/Metadata/CustomAttributeClass.js +29 -9
  232. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  233. package/lib/esm/Metadata/EntityClass.d.ts +40 -11
  234. package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
  235. package/lib/esm/Metadata/EntityClass.js +73 -35
  236. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  237. package/lib/esm/Metadata/Enumeration.d.ts +30 -10
  238. package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
  239. package/lib/esm/Metadata/Enumeration.js +42 -14
  240. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  241. package/lib/esm/Metadata/Format.d.ts +65 -17
  242. package/lib/esm/Metadata/Format.d.ts.map +1 -1
  243. package/lib/esm/Metadata/Format.js +108 -23
  244. package/lib/esm/Metadata/Format.js.map +1 -1
  245. package/lib/esm/Metadata/InvertedUnit.d.ts +19 -10
  246. package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
  247. package/lib/esm/Metadata/InvertedUnit.js +33 -16
  248. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  249. package/lib/esm/Metadata/KindOfQuantity.d.ts +38 -18
  250. package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
  251. package/lib/esm/Metadata/KindOfQuantity.js +91 -41
  252. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  253. package/lib/esm/Metadata/Mixin.d.ts +31 -4
  254. package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
  255. package/lib/esm/Metadata/Mixin.js +44 -10
  256. package/lib/esm/Metadata/Mixin.js.map +1 -1
  257. package/lib/esm/Metadata/OverrideFormat.d.ts +12 -12
  258. package/lib/esm/Metadata/OverrideFormat.d.ts.map +1 -1
  259. package/lib/esm/Metadata/OverrideFormat.js +37 -20
  260. package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
  261. package/lib/esm/Metadata/Phenomenon.d.ts +24 -3
  262. package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
  263. package/lib/esm/Metadata/Phenomenon.js +33 -4
  264. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  265. package/lib/esm/Metadata/Property.d.ts +47 -25
  266. package/lib/esm/Metadata/Property.d.ts.map +1 -1
  267. package/lib/esm/Metadata/Property.js +130 -51
  268. package/lib/esm/Metadata/Property.js.map +1 -1
  269. package/lib/esm/Metadata/PropertyCategory.d.ts +20 -4
  270. package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
  271. package/lib/esm/Metadata/PropertyCategory.js +31 -4
  272. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  273. package/lib/esm/Metadata/RelationshipClass.d.ts +63 -27
  274. package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
  275. package/lib/esm/Metadata/RelationshipClass.js +102 -45
  276. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  277. package/lib/esm/Metadata/Schema.d.ts +167 -41
  278. package/lib/esm/Metadata/Schema.d.ts.map +1 -1
  279. package/lib/esm/Metadata/Schema.js +212 -112
  280. package/lib/esm/Metadata/Schema.js.map +1 -1
  281. package/lib/esm/Metadata/SchemaItem.d.ts +19 -19
  282. package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
  283. package/lib/esm/Metadata/SchemaItem.js +25 -23
  284. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  285. package/lib/esm/Metadata/Unit.d.ts +24 -21
  286. package/lib/esm/Metadata/Unit.d.ts.map +1 -1
  287. package/lib/esm/Metadata/Unit.js +41 -25
  288. package/lib/esm/Metadata/Unit.js.map +1 -1
  289. package/lib/esm/Metadata/UnitSystem.d.ts +17 -4
  290. package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
  291. package/lib/esm/Metadata/UnitSystem.js +24 -4
  292. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  293. package/lib/esm/PropertyTypes.d.ts +11 -11
  294. package/lib/esm/PropertyTypes.d.ts.map +1 -1
  295. package/lib/esm/PropertyTypes.js +29 -21
  296. package/lib/esm/PropertyTypes.js.map +1 -1
  297. package/lib/esm/SchemaFormatsProvider.d.ts +39 -0
  298. package/lib/esm/SchemaFormatsProvider.d.ts.map +1 -0
  299. package/lib/esm/SchemaFormatsProvider.js +142 -0
  300. package/lib/esm/SchemaFormatsProvider.js.map +1 -0
  301. package/lib/esm/SchemaJsonLocater.d.ts +8 -8
  302. package/lib/esm/SchemaJsonLocater.d.ts.map +1 -1
  303. package/lib/esm/SchemaJsonLocater.js +7 -7
  304. package/lib/esm/SchemaJsonLocater.js.map +1 -1
  305. package/lib/esm/SchemaKey.d.ts +13 -7
  306. package/lib/esm/SchemaKey.d.ts.map +1 -1
  307. package/lib/esm/SchemaKey.js +23 -13
  308. package/lib/esm/SchemaKey.js.map +1 -1
  309. package/lib/esm/SchemaLoader.d.ts +5 -5
  310. package/lib/esm/SchemaLoader.d.ts.map +1 -1
  311. package/lib/esm/SchemaLoader.js +6 -5
  312. package/lib/esm/SchemaLoader.js.map +1 -1
  313. package/lib/esm/SchemaPartVisitorDelegate.d.ts +2 -2
  314. package/lib/esm/SchemaPartVisitorDelegate.js +2 -1
  315. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
  316. package/lib/esm/UnitConversion/Graph.js +69 -65
  317. package/lib/esm/UnitConversion/Graph.js.map +1 -1
  318. package/lib/esm/UnitConversion/Parser.js.map +1 -1
  319. package/lib/esm/UnitConversion/UnitConversion.d.ts +1 -1
  320. package/lib/esm/UnitConversion/UnitConversion.d.ts.map +1 -1
  321. package/lib/esm/UnitConversion/UnitConversion.js +9 -7
  322. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
  323. package/lib/esm/UnitConversion/UnitConverter.js +2 -0
  324. package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
  325. package/lib/esm/UnitConversion/UnitTree.d.ts +2 -0
  326. package/lib/esm/UnitConversion/UnitTree.d.ts.map +1 -1
  327. package/lib/esm/UnitConversion/UnitTree.js +11 -1
  328. package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
  329. package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
  330. package/lib/esm/UnitProvider/SchemaUnitProvider.js +8 -9
  331. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  332. package/lib/esm/Validation/SchemaWalker.d.ts +1 -1
  333. package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -1
  334. package/lib/esm/Validation/SchemaWalker.js +6 -4
  335. package/lib/esm/Validation/SchemaWalker.js.map +1 -1
  336. package/lib/esm/ecschema-metadata.d.ts +1 -0
  337. package/lib/esm/ecschema-metadata.d.ts.map +1 -1
  338. package/lib/esm/ecschema-metadata.js +1 -0
  339. package/lib/esm/ecschema-metadata.js.map +1 -1
  340. package/lib/esm/utils/SchemaGraph.js +6 -7
  341. package/lib/esm/utils/SchemaGraph.js.map +1 -1
  342. package/package.json +16 -14
@@ -15,10 +15,13 @@ function isObject(x) {
15
15
  const SCHEMAURL_JSON = "https://dev\\.bentley\\.com/json_schemas/ec";
16
16
  /** @internal */
17
17
  class JsonParser extends AbstractParser_1.AbstractParser {
18
+ _rawSchema;
19
+ _schemaName;
20
+ _currentItemFullName;
18
21
  constructor(rawSchema) {
19
22
  super();
20
23
  if (!isObject(rawSchema))
21
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `Invalid JSON object.`);
24
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `Invalid JSON object.`);
22
25
  this._rawSchema = rawSchema;
23
26
  this._schemaName = rawSchema.name;
24
27
  this._ecSpecVersion = JsonParser.parseJSUri(rawSchema.$schema);
@@ -41,28 +44,28 @@ class JsonParser extends AbstractParser_1.AbstractParser {
41
44
  */
42
45
  parseSchema() {
43
46
  if (undefined === this._rawSchema.name)
44
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `An ECSchema is missing the required 'name' attribute.`);
47
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `An ECSchema is missing the required 'name' attribute.`);
45
48
  if (typeof (this._rawSchema.name) !== "string")
46
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `An ECSchema has an invalid 'name' attribute. It should be of type 'string'.`);
49
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `An ECSchema has an invalid 'name' attribute. It should be of type 'string'.`);
47
50
  if (undefined === this._rawSchema.$schema)
48
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required '$schema' attribute.`);
51
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required '$schema' attribute.`);
49
52
  if (typeof (this._rawSchema.$schema) !== "string")
50
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid '$schema' attribute. It should be of type 'string'.`);
53
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid '$schema' attribute. It should be of type 'string'.`);
51
54
  if (undefined === this._rawSchema.version)
52
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required 'version' attribute.`);
55
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required 'version' attribute.`);
53
56
  if (typeof (this._rawSchema.version) !== "string")
54
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'version' attribute. It should be of type 'string'.`);
57
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'version' attribute. It should be of type 'string'.`);
55
58
  if (undefined !== this._rawSchema.alias) {
56
59
  if (typeof (this._rawSchema.alias) !== "string")
57
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'alias' attribute. It should be of type 'string'.`);
60
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'alias' attribute. It should be of type 'string'.`);
58
61
  }
59
62
  if (undefined !== this._rawSchema.label) {
60
63
  if (typeof (this._rawSchema.label) !== "string")
61
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'label' attribute. It should be of type 'string'.`);
64
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'label' attribute. It should be of type 'string'.`);
62
65
  }
63
66
  if (undefined !== this._rawSchema.description) {
64
67
  if (typeof (this._rawSchema.description) !== "string")
65
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'description' attribute. It should be of type 'string'.`);
68
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'description' attribute. It should be of type 'string'.`);
66
69
  }
67
70
  const ecVersions = JsonParser.parseJSUri(this._rawSchema.$schema);
68
71
  return {
@@ -74,7 +77,7 @@ class JsonParser extends AbstractParser_1.AbstractParser {
74
77
  *getReferences() {
75
78
  if (undefined !== this._rawSchema.references) {
76
79
  if (!Array.isArray(this._rawSchema.references))
77
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The schema ${this._rawSchema.name} has an invalid 'references' attribute. It should be of type 'object[]'.`);
80
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The schema ${this._rawSchema.name} has an invalid 'references' attribute. It should be of type 'object[]'.`);
78
81
  for (const ref of this._rawSchema.references) {
79
82
  yield this.checkSchemaReference(ref);
80
83
  }
@@ -82,33 +85,33 @@ class JsonParser extends AbstractParser_1.AbstractParser {
82
85
  }
83
86
  checkSchemaReference(jsonObj) {
84
87
  if (!isObject(jsonObj))
85
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. It should be of type 'object[]'.`);
88
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. It should be of type 'object[]'.`);
86
89
  if (undefined === jsonObj.name)
87
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'name' attribute.`);
90
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'name' attribute.`);
88
91
  if (typeof (jsonObj.name) !== "string")
89
- throw new Exception_1.ECObjectsError(Exception_1.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'.`);
92
+ throw new Exception_1.ECSchemaError(Exception_1.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'.`);
90
93
  if (undefined === jsonObj.version)
91
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'version' attribute.`);
94
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'version' attribute.`);
92
95
  if (typeof (jsonObj.version) !== "string")
93
- throw new Exception_1.ECObjectsError(Exception_1.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'.`);
96
+ throw new Exception_1.ECSchemaError(Exception_1.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'.`);
94
97
  return jsonObj;
95
98
  }
96
99
  *getItems() {
97
100
  const items = this._rawSchema.items;
98
101
  if (undefined !== items) {
99
102
  if (!isObject(items) || Array.isArray(items))
100
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);
103
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);
101
104
  // eslint-disable-next-line guard-for-in
102
105
  for (const itemName in items) {
103
106
  const item = items[itemName];
104
107
  if (!isObject(item))
105
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);
108
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);
106
109
  if (!ECName_1.ECName.validate(itemName))
107
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);
110
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);
108
111
  if (undefined === item.schemaItemType)
109
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);
112
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);
110
113
  if (typeof (item.schemaItemType) !== "string")
111
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);
114
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);
112
115
  this._currentItemFullName = `${this._schemaName}.${itemName}`;
113
116
  yield [itemName, item.schemaItemType, item];
114
117
  }
@@ -118,17 +121,17 @@ class JsonParser extends AbstractParser_1.AbstractParser {
118
121
  const items = this._rawSchema.items;
119
122
  if (undefined !== items) {
120
123
  if (!isObject(items) || Array.isArray(items))
121
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);
124
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);
122
125
  const item = items[itemName];
123
126
  if (undefined !== item) {
124
127
  if (!isObject(item))
125
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);
128
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);
126
129
  if (!ECName_1.ECName.validate(itemName))
127
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);
130
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);
128
131
  if (undefined === item.schemaItemType)
129
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);
132
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);
130
133
  if (typeof (item.schemaItemType) !== "string")
131
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);
134
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);
132
135
  this._currentItemFullName = `${this._schemaName}.${itemName}`;
133
136
  return [itemName, item.schemaItemType, item];
134
137
  }
@@ -142,33 +145,33 @@ class JsonParser extends AbstractParser_1.AbstractParser {
142
145
  checkSchemaItemProps(jsonObj) {
143
146
  if (undefined !== jsonObj.description) {
144
147
  if (typeof (jsonObj.description) !== "string")
145
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'description' attribute. It should be of type 'string'.`);
148
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'description' attribute. It should be of type 'string'.`);
146
149
  }
147
150
  if (undefined !== jsonObj.label) {
148
151
  if (typeof (jsonObj.label) !== "string")
149
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'label' attribute. It should be of type 'string'.`);
152
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'label' attribute. It should be of type 'string'.`);
150
153
  }
151
154
  }
152
155
  *getProperties(jsonObj, itemName) {
153
156
  const properties = jsonObj.properties;
154
157
  if (undefined !== properties) {
155
158
  if (!Array.isArray(properties))
156
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECClass ${itemName} has an invalid 'properties' attribute. It should be of type 'object[]'.`);
159
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECClass ${itemName} has an invalid 'properties' attribute. It should be of type 'object[]'.`);
157
160
  for (const property of properties) {
158
161
  if (!isObject(property))
159
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `An ECProperty in ${itemName} is an invalid JSON object.`);
162
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} is an invalid JSON object.`);
160
163
  if (undefined === property.name)
161
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `An ECProperty in ${itemName} is missing the required 'name' attribute.`);
164
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} is missing the required 'name' attribute.`);
162
165
  if (typeof (property.name) !== "string")
163
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `An ECProperty in ${itemName} has an invalid 'name' attribute. It should be of type 'string'.`);
166
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} has an invalid 'name' attribute. It should be of type 'string'.`);
164
167
  if (undefined === property.type)
165
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} does not have the required 'type' attribute.`);
168
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} does not have the required 'type' attribute.`);
166
169
  if (typeof (property.type) !== "string")
167
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. It should be of type 'string'.`);
170
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. It should be of type 'string'.`);
168
171
  if (!this.isValidPropertyType(property.type)) {
169
172
  if (Helper_1.SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
170
173
  return;
171
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. '${property.type}' is not a valid type.`);
174
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. '${property.type}' is not a valid type.`);
172
175
  }
173
176
  yield [property.name, property.type, property];
174
177
  }
@@ -182,15 +185,15 @@ class JsonParser extends AbstractParser_1.AbstractParser {
182
185
  this.checkSchemaItemProps(jsonObj);
183
186
  if (undefined !== jsonObj.modifier) {
184
187
  if (typeof (jsonObj.modifier) !== "string")
185
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'modifier' attribute. It should be of type 'string'.`);
188
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'modifier' attribute. It should be of type 'string'.`);
186
189
  }
187
190
  if (undefined !== jsonObj.baseClass) {
188
191
  if (typeof (jsonObj.baseClass) !== "string")
189
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'baseClass' attribute. It should be of type 'string'.`);
192
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'baseClass' attribute. It should be of type 'string'.`);
190
193
  }
191
194
  if (undefined !== jsonObj.customAttributes) {
192
195
  if (!Array.isArray(jsonObj.customAttributes)) {
193
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
196
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
194
197
  }
195
198
  }
196
199
  }
@@ -203,10 +206,10 @@ class JsonParser extends AbstractParser_1.AbstractParser {
203
206
  this.checkClassProps(jsonObj);
204
207
  if (undefined !== jsonObj.mixins) {
205
208
  if (!Array.isArray(jsonObj.mixins))
206
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);
209
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);
207
210
  for (const mixinName of jsonObj.mixins) {
208
211
  if (typeof (mixinName) !== "string")
209
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);
212
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);
210
213
  }
211
214
  }
212
215
  return {
@@ -223,9 +226,9 @@ class JsonParser extends AbstractParser_1.AbstractParser {
223
226
  parseMixin(jsonObj) {
224
227
  this.checkClassProps(jsonObj);
225
228
  if (undefined === jsonObj.appliesTo)
226
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);
229
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);
227
230
  if (typeof (jsonObj.appliesTo) !== "string")
228
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);
231
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);
229
232
  return {
230
233
  ...jsonObj,
231
234
  originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,
@@ -240,9 +243,9 @@ class JsonParser extends AbstractParser_1.AbstractParser {
240
243
  parseCustomAttributeClass(jsonObj) {
241
244
  this.checkClassProps(jsonObj);
242
245
  if (undefined === jsonObj.appliesTo)
243
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);
246
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);
244
247
  if (typeof (jsonObj.appliesTo) !== "string")
245
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);
248
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);
246
249
  return {
247
250
  ...jsonObj,
248
251
  originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,
@@ -269,22 +272,22 @@ class JsonParser extends AbstractParser_1.AbstractParser {
269
272
  parseRelationshipClass(jsonObj) {
270
273
  this.checkClassProps(jsonObj);
271
274
  if (undefined === jsonObj.strength)
272
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strength' attribute.`);
275
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strength' attribute.`);
273
276
  if (typeof (jsonObj.strength) !== "string")
274
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strength' attribute. It should be of type 'string'.`);
277
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strength' attribute. It should be of type 'string'.`);
275
278
  if (undefined === jsonObj.strengthDirection)
276
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strengthDirection' attribute.`);
279
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strengthDirection' attribute.`);
277
280
  if (typeof (jsonObj.strengthDirection) !== "string")
278
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strengthDirection' attribute. It should be of type 'string'.`);
281
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strengthDirection' attribute. It should be of type 'string'.`);
279
282
  if (undefined === jsonObj.source)
280
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required source constraint.`);
283
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required source constraint.`);
281
284
  if (!isObject(jsonObj.source))
282
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid source constraint. It should be of type 'object'.`);
285
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid source constraint. It should be of type 'object'.`);
283
286
  this.checkRelationshipConstraintProps(jsonObj.source, true);
284
287
  if (undefined === jsonObj.target)
285
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required target constraint.`);
288
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required target constraint.`);
286
289
  if (!isObject(jsonObj.target))
287
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid target constraint. It should be of type 'object'.`);
290
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid target constraint. It should be of type 'object'.`);
288
291
  this.checkRelationshipConstraintProps(jsonObj.target, false);
289
292
  return {
290
293
  ...jsonObj,
@@ -301,29 +304,29 @@ class JsonParser extends AbstractParser_1.AbstractParser {
301
304
  checkRelationshipConstraintProps(jsonObj, isSource) {
302
305
  const constraintName = `${(isSource) ? "Source" : "Target"} Constraint of ${this._currentItemFullName}`; // most specific name to call RelationshipConstraint
303
306
  if (undefined === jsonObj.multiplicity)
304
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${constraintName} is missing the required 'multiplicity' attribute.`);
307
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'multiplicity' attribute.`);
305
308
  if (typeof (jsonObj.multiplicity) !== "string")
306
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'multiplicity' attribute. It should be of type 'string'.`);
309
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'multiplicity' attribute. It should be of type 'string'.`);
307
310
  if (undefined === jsonObj.roleLabel)
308
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${constraintName} is missing the required 'roleLabel' attribute.`);
311
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'roleLabel' attribute.`);
309
312
  if (typeof (jsonObj.roleLabel) !== "string")
310
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'roleLabel' attribute. It should be of type 'string'.`);
313
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'roleLabel' attribute. It should be of type 'string'.`);
311
314
  if (undefined === jsonObj.polymorphic)
312
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${constraintName} is missing the required 'polymorphic' attribute.`);
315
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'polymorphic' attribute.`);
313
316
  if (typeof (jsonObj.polymorphic) !== "boolean")
314
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'polymorphic' attribute. It should be of type 'boolean'.`);
317
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'polymorphic' attribute. It should be of type 'boolean'.`);
315
318
  if (undefined !== jsonObj.abstractConstraint && typeof (jsonObj.abstractConstraint) !== "string")
316
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'abstractConstraint' attribute. It should be of type 'string'.`);
319
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'abstractConstraint' attribute. It should be of type 'string'.`);
317
320
  if (undefined === jsonObj.constraintClasses)
318
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${constraintName} is missing the required 'constraintClasses' attribute.`);
321
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'constraintClasses' attribute.`);
319
322
  if (!Array.isArray(jsonObj.constraintClasses))
320
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);
323
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);
321
324
  for (const constraintClassName of jsonObj.constraintClasses) {
322
325
  if (typeof (constraintClassName) !== "string")
323
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);
326
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);
324
327
  }
325
328
  if (undefined !== jsonObj.customAttributes && !Array.isArray(jsonObj.customAttributes))
326
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${constraintName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
329
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
327
330
  }
328
331
  /**
329
332
  * Type checks Enumeration and returns EnumerationProps interface
@@ -333,9 +336,9 @@ class JsonParser extends AbstractParser_1.AbstractParser {
333
336
  parseEnumeration(jsonObj) {
334
337
  this.checkSchemaItemProps(jsonObj);
335
338
  if (undefined === jsonObj.type)
336
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'type' attribute.`);
339
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'type' attribute.`);
337
340
  if (typeof (jsonObj.type) !== "string")
338
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);
341
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);
339
342
  const isValidEnumerationType = (type) => {
340
343
  type = type.toLowerCase();
341
344
  return (type === "int") ||
@@ -346,37 +349,37 @@ class JsonParser extends AbstractParser_1.AbstractParser {
346
349
  if (Helper_1.SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
347
350
  jsonObj.type = "string";
348
351
  else
349
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be either "int" or "string".`);
352
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be either "int" or "string".`);
350
353
  }
351
354
  if (undefined !== jsonObj.isStrict) { // TODO: make required
352
355
  if (typeof (jsonObj.isStrict) !== "boolean")
353
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'isStrict' attribute. It should be of type 'boolean'.`);
356
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'isStrict' attribute. It should be of type 'boolean'.`);
354
357
  }
355
358
  if (undefined === jsonObj.enumerators)
356
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'enumerators' attribute.`);
359
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'enumerators' attribute.`);
357
360
  if (!Array.isArray(jsonObj.enumerators))
358
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);
361
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);
359
362
  for (const enumerator of jsonObj.enumerators) {
360
363
  if (!isObject(enumerator))
361
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);
364
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);
362
365
  if (undefined === enumerator.value)
363
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'value'.`);
366
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'value'.`);
364
367
  // TODO: Should this really be handled here?
365
368
  const expectedType = jsonObj.type;
366
369
  const receivedType = (typeof (enumerator.value) === "number") ? "int" : typeof (enumerator.value);
367
370
  if (!expectedType.includes(receivedType)) // is receivedType a substring of expectedType? - easiest way to check "int" === "int" | "integer" && "string" === "string"
368
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an incompatible type. It must be "${expectedType}", not "${receivedType}".`);
371
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an incompatible type. It must be "${expectedType}", not "${receivedType}".`);
369
372
  if (undefined === enumerator.name)
370
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'name'.`);
373
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'name'.`);
371
374
  if (typeof (enumerator.name) !== "string")
372
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'name' attribute. It should be of type 'string'.`);
375
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'name' attribute. It should be of type 'string'.`);
373
376
  if (undefined !== enumerator.label) {
374
377
  if (typeof (enumerator.label) !== "string")
375
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'label' attribute. It should be of type 'string'.`);
378
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'label' attribute. It should be of type 'string'.`);
376
379
  }
377
380
  if (undefined !== enumerator.description) {
378
381
  if (typeof (enumerator.description) !== "string")
379
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'description' attribute. It should be of type 'string'.`);
382
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'description' attribute. It should be of type 'string'.`);
380
383
  }
381
384
  }
382
385
  return jsonObj;
@@ -389,17 +392,17 @@ class JsonParser extends AbstractParser_1.AbstractParser {
389
392
  parseKindOfQuantity(jsonObj) {
390
393
  this.checkSchemaItemProps(jsonObj);
391
394
  if (undefined === jsonObj.relativeError)
392
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);
395
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);
393
396
  if (typeof (jsonObj.relativeError) !== "number")
394
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be of type 'number'.`);
397
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be of type 'number'.`);
395
398
  if (undefined !== jsonObj.presentationUnits) {
396
399
  if (!Array.isArray(jsonObj.presentationUnits) && typeof (jsonObj.presentationUnits) !== "string")
397
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'presentationUnits' attribute. It should be of type 'string' or 'string[]'.`);
400
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'presentationUnits' attribute. It should be of type 'string' or 'string[]'.`);
398
401
  }
399
402
  if (undefined === jsonObj.persistenceUnit)
400
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'persistenceUnit' attribute.`);
403
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'persistenceUnit' attribute.`);
401
404
  if (typeof (jsonObj.persistenceUnit) !== "string")
402
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'persistenceUnit' attribute. It should be of type 'string'.`);
405
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'persistenceUnit' attribute. It should be of type 'string'.`);
403
406
  return jsonObj;
404
407
  }
405
408
  /**
@@ -411,7 +414,7 @@ class JsonParser extends AbstractParser_1.AbstractParser {
411
414
  this.checkSchemaItemProps(jsonObj);
412
415
  if (undefined !== jsonObj.priority) { // TODO: make required
413
416
  if (typeof (jsonObj.priority) !== "number")
414
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be of type 'number'.`);
417
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be of type 'number'.`);
415
418
  }
416
419
  return jsonObj;
417
420
  }
@@ -423,28 +426,28 @@ class JsonParser extends AbstractParser_1.AbstractParser {
423
426
  parseUnit(jsonObj) {
424
427
  this.checkSchemaItemProps(jsonObj);
425
428
  if (undefined === jsonObj.phenomenon)
426
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);
429
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);
427
430
  if (typeof (jsonObj.phenomenon) !== "string")
428
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);
431
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);
429
432
  if (undefined === jsonObj.unitSystem)
430
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);
433
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);
431
434
  if (typeof (jsonObj.unitSystem) !== "string")
432
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);
435
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);
433
436
  if (undefined === jsonObj.definition)
434
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'definition' attribute.`);
437
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'definition' attribute.`);
435
438
  if (typeof (jsonObj.definition) !== "string")
436
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
439
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
437
440
  if (undefined !== jsonObj.numerator) {
438
441
  if (typeof (jsonObj.numerator) !== "number")
439
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);
442
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);
440
443
  }
441
444
  if (undefined !== jsonObj.denominator) {
442
445
  if (typeof (jsonObj.denominator) !== "number")
443
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);
446
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);
444
447
  }
445
448
  if (undefined !== jsonObj.offset) {
446
449
  if (typeof (jsonObj.offset) !== "number")
447
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'offset' attribute. It should be of type 'number'.`);
450
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'offset' attribute. It should be of type 'number'.`);
448
451
  }
449
452
  return jsonObj;
450
453
  }
@@ -456,13 +459,13 @@ class JsonParser extends AbstractParser_1.AbstractParser {
456
459
  parseInvertedUnit(jsonObj) {
457
460
  this.checkSchemaItemProps(jsonObj);
458
461
  if (undefined === jsonObj.invertsUnit)
459
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'invertsUnit' attribute.`);
462
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'invertsUnit' attribute.`);
460
463
  if (typeof (jsonObj.invertsUnit) !== "string")
461
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'invertsUnit' attribute. It should be of type 'string'.`);
464
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'invertsUnit' attribute. It should be of type 'string'.`);
462
465
  if (undefined === jsonObj.unitSystem)
463
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);
466
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);
464
467
  if (typeof (jsonObj.unitSystem) !== "string")
465
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);
468
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);
466
469
  return jsonObj;
467
470
  }
468
471
  /**
@@ -473,20 +476,20 @@ class JsonParser extends AbstractParser_1.AbstractParser {
473
476
  parseConstant(jsonObj) {
474
477
  this.checkSchemaItemProps(jsonObj);
475
478
  if (undefined === jsonObj.phenomenon)
476
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);
479
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);
477
480
  if (typeof (jsonObj.phenomenon) !== "string")
478
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);
481
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);
479
482
  if (undefined === jsonObj.definition)
480
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'definition' attribute.`);
483
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'definition' attribute.`);
481
484
  if (typeof (jsonObj.definition) !== "string")
482
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
485
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
483
486
  if (undefined !== jsonObj.numerator) {
484
487
  if (typeof (jsonObj.numerator) !== "number")
485
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);
488
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);
486
489
  }
487
490
  if (undefined !== jsonObj.denominator) {
488
491
  if (typeof (jsonObj.denominator) !== "number")
489
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);
492
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);
490
493
  }
491
494
  return jsonObj;
492
495
  }
@@ -498,9 +501,9 @@ class JsonParser extends AbstractParser_1.AbstractParser {
498
501
  parsePhenomenon(jsonObj) {
499
502
  this.checkSchemaItemProps(jsonObj);
500
503
  if (undefined === jsonObj.definition)
501
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} does not have the required 'definition' attribute.`);
504
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} does not have the required 'definition' attribute.`);
502
505
  if (typeof (jsonObj.definition) !== "string")
503
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
506
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);
504
507
  return jsonObj;
505
508
  }
506
509
  /**
@@ -511,54 +514,54 @@ class JsonParser extends AbstractParser_1.AbstractParser {
511
514
  parseFormat(jsonObj) {
512
515
  this.checkSchemaItemProps(jsonObj);
513
516
  if (undefined === jsonObj.type)
514
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} does not have the required 'type' attribute.`);
517
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} does not have the required 'type' attribute.`);
515
518
  if (typeof (jsonObj.type) !== "string")
516
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);
519
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);
517
520
  if (undefined !== jsonObj.precision && typeof (jsonObj.precision) !== "number")
518
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'precision' attribute. It should be of type 'number'.`);
521
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'precision' attribute. It should be of type 'number'.`);
519
522
  if (undefined !== jsonObj.roundFactor && typeof (jsonObj.roundFactor) !== "number")
520
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'roundFactor' attribute. It should be of type 'number'.`);
523
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'roundFactor' attribute. It should be of type 'number'.`);
521
524
  if (undefined !== jsonObj.minWidth && typeof (jsonObj.minWidth) !== "number")
522
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'minWidth' attribute. It should be of type 'number'.`);
525
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'minWidth' attribute. It should be of type 'number'.`);
523
526
  if (undefined !== jsonObj.showSignOption && typeof (jsonObj.showSignOption) !== "string")
524
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'showSignOption' attribute. It should be of type 'string'.`);
527
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'showSignOption' attribute. It should be of type 'string'.`);
525
528
  if (undefined !== jsonObj.formatTraits) {
526
529
  if (!Array.isArray(jsonObj.formatTraits) && typeof (jsonObj.formatTraits) !== "string") // must be either an array of strings or a string
527
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'formatTraits' attribute. It should be of type 'string' or 'string[]'.`);
530
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'formatTraits' attribute. It should be of type 'string' or 'string[]'.`);
528
531
  }
529
532
  if (undefined !== jsonObj.decimalSeparator && typeof (jsonObj.decimalSeparator) !== "string")
530
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'decimalSeparator' attribute. It should be of type 'string'.`);
533
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'decimalSeparator' attribute. It should be of type 'string'.`);
531
534
  if (undefined !== jsonObj.thousandSeparator && typeof (jsonObj.thousandSeparator) !== "string")
532
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'thousandSeparator' attribute. It should be of type 'string'.`);
535
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'thousandSeparator' attribute. It should be of type 'string'.`);
533
536
  if (undefined !== jsonObj.uomSeparator && typeof (jsonObj.uomSeparator) !== "string")
534
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'uomSeparator' attribute. It should be of type 'string'.`);
537
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'uomSeparator' attribute. It should be of type 'string'.`);
535
538
  if (undefined !== jsonObj.scientificType && typeof (jsonObj.scientificType) !== "string")
536
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'scientificType' attribute. It should be of type 'string'.`);
539
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'scientificType' attribute. It should be of type 'string'.`);
537
540
  if (undefined !== jsonObj.stationOffsetSize && typeof (jsonObj.stationOffsetSize) !== "number")
538
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationOffsetSize' attribute. It should be of type 'number'.`);
541
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationOffsetSize' attribute. It should be of type 'number'.`);
539
542
  if (undefined !== jsonObj.stationSeparator && typeof (jsonObj.stationSeparator) !== "string")
540
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationSeparator' attribute. It should be of type 'string'.`);
543
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationSeparator' attribute. It should be of type 'string'.`);
541
544
  if (undefined !== jsonObj.composite) { // optional
542
545
  if (!isObject(jsonObj.composite))
543
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'composite' object.`);
546
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'composite' object.`);
544
547
  if (undefined !== jsonObj.composite.includeZero && typeof (jsonObj.composite.includeZero) !== "boolean")
545
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'includeZero' attribute. It should be of type 'boolean'.`);
548
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'includeZero' attribute. It should be of type 'boolean'.`);
546
549
  if (undefined !== jsonObj.composite.spacer && typeof (jsonObj.composite.spacer) !== "string")
547
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'spacer' attribute. It should be of type 'string'.`);
550
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'spacer' attribute. It should be of type 'string'.`);
548
551
  // if composite is defined
549
552
  if (undefined === jsonObj.composite.units)
550
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'Composite' attribute. It should have 1-4 units.`);
553
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'Composite' attribute. It should have 1-4 units.`);
551
554
  if (!Array.isArray(jsonObj.composite.units))
552
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);
555
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);
553
556
  for (let i = 0; i < jsonObj.composite.units.length; i++) {
554
557
  if (!isObject(jsonObj.composite.units[i]))
555
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);
558
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);
556
559
  if (undefined === jsonObj.composite.units[i].name) // required
557
- throw new Exception_1.ECObjectsError(Exception_1.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.`);
560
+ throw new Exception_1.ECSchemaError(Exception_1.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.`);
558
561
  if (typeof (jsonObj.composite.units[i].name) !== "string")
559
- throw new Exception_1.ECObjectsError(Exception_1.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'.`);
562
+ throw new Exception_1.ECSchemaError(Exception_1.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'.`);
560
563
  if (undefined !== jsonObj.composite.units[i].label && typeof (jsonObj.composite.units[i].label) !== "string")
561
- throw new Exception_1.ECObjectsError(Exception_1.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'.`);
564
+ throw new Exception_1.ECSchemaError(Exception_1.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'.`);
562
565
  }
563
566
  }
564
567
  return jsonObj;
@@ -579,36 +582,36 @@ class JsonParser extends AbstractParser_1.AbstractParser {
579
582
  checkPropertyProps(jsonObj) {
580
583
  const propName = jsonObj.name;
581
584
  if (undefined !== jsonObj.label && typeof (jsonObj.label) !== "string")
582
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'label' attribute. It should be of type 'string'.`);
585
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'label' attribute. It should be of type 'string'.`);
583
586
  if (undefined !== jsonObj.description && typeof (jsonObj.description) !== "string")
584
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'description' attribute. It should be of type 'string'.`);
587
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'description' attribute. It should be of type 'string'.`);
585
588
  if (undefined !== jsonObj.priority && typeof (jsonObj.priority) !== "number")
586
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'priority' attribute. It should be of type 'number'.`);
589
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'priority' attribute. It should be of type 'number'.`);
587
590
  if (undefined !== jsonObj.isReadOnly && typeof (jsonObj.isReadOnly) !== "boolean")
588
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'isReadOnly' attribute. It should be of type 'boolean'.`);
591
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'isReadOnly' attribute. It should be of type 'boolean'.`);
589
592
  if (undefined !== jsonObj.category && typeof (jsonObj.category) !== "string")
590
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'category' attribute. It should be of type 'string'.`);
593
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'category' attribute. It should be of type 'string'.`);
591
594
  if (undefined !== jsonObj.kindOfQuantity && typeof (jsonObj.kindOfQuantity) !== "string")
592
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'kindOfQuantity' attribute. It should be of type 'string'.`);
595
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'kindOfQuantity' attribute. It should be of type 'string'.`);
593
596
  if (undefined !== jsonObj.inherited && typeof (jsonObj.inherited) !== "boolean")
594
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'inherited' attribute. It should be of type 'boolean'.`);
597
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'inherited' attribute. It should be of type 'boolean'.`);
595
598
  if (undefined !== jsonObj.customAttributes && !Array.isArray(jsonObj.customAttributes))
596
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
599
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);
597
600
  return jsonObj;
598
601
  }
599
602
  checkPropertyTypename(jsonObj) {
600
603
  const propName = jsonObj.name;
601
604
  if (undefined === jsonObj.typeName)
602
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} is missing the required 'typeName' attribute.`);
605
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} is missing the required 'typeName' attribute.`);
603
606
  if (typeof (jsonObj.typeName) !== "string")
604
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'typeName' attribute. It should be of type 'string'.`);
607
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'typeName' attribute. It should be of type 'string'.`);
605
608
  }
606
609
  checkPropertyMinAndMaxOccurs(jsonObj) {
607
610
  const propName = jsonObj.name;
608
611
  if (undefined !== jsonObj.minOccurs && typeof (jsonObj.minOccurs) !== "number")
609
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minOccurs' attribute. It should be of type 'number'.`);
612
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minOccurs' attribute. It should be of type 'number'.`);
610
613
  if (undefined !== jsonObj.maxOccurs && typeof (jsonObj.maxOccurs) !== "number")
611
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be of type 'number'.`);
614
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be of type 'number'.`);
612
615
  }
613
616
  /**
614
617
  * Type checks PrimitiveOrEnumProperty and returns PrimitiveOrEnumPropertyBaseProps interface
@@ -620,15 +623,15 @@ class JsonParser extends AbstractParser_1.AbstractParser {
620
623
  this.checkPropertyTypename(jsonObj);
621
624
  const propName = jsonObj.name;
622
625
  if (undefined !== jsonObj.minLength && typeof (jsonObj.minLength) !== "number")
623
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minLength' attribute. It should be of type 'number'.`);
626
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minLength' attribute. It should be of type 'number'.`);
624
627
  if (undefined !== jsonObj.maxLength && typeof (jsonObj.maxLength) !== "number")
625
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxLength' attribute. It should be of type 'number'.`);
628
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxLength' attribute. It should be of type 'number'.`);
626
629
  if (undefined !== jsonObj.minValue && typeof (jsonObj.minValue) !== "number")
627
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minValue' attribute. It should be of type 'number'.`);
630
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minValue' attribute. It should be of type 'number'.`);
628
631
  if (undefined !== jsonObj.maxValue && typeof (jsonObj.maxValue) !== "number")
629
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxValue' attribute. It should be of type 'number'.`);
632
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxValue' attribute. It should be of type 'number'.`);
630
633
  if (undefined !== jsonObj.extendedTypeName && typeof (jsonObj.extendedTypeName) !== "string")
631
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'extendedTypeName' attribute. It should be of type 'string'.`);
634
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'extendedTypeName' attribute. It should be of type 'string'.`);
632
635
  return jsonObj;
633
636
  }
634
637
  /**
@@ -680,13 +683,13 @@ class JsonParser extends AbstractParser_1.AbstractParser {
680
683
  this.checkPropertyProps(jsonObj);
681
684
  const fullname = `${this._currentItemFullName}.${jsonObj.name}`;
682
685
  if (undefined === jsonObj.relationshipName)
683
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'relationshipName' property.`);
686
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'relationshipName' property.`);
684
687
  if (typeof (jsonObj.relationshipName) !== "string")
685
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'relationshipName' property. It should be of type 'string'.`);
688
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'relationshipName' property. It should be of type 'string'.`);
686
689
  if (undefined === jsonObj.direction)
687
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'direction' property.`);
690
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'direction' property.`);
688
691
  if (typeof (jsonObj.direction) !== "string")
689
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'direction' property. It should be of type 'string'.`);
692
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'direction' property. It should be of type 'string'.`);
690
693
  return jsonObj;
691
694
  }
692
695
  getSchemaCustomAttributeProviders() {
@@ -706,14 +709,14 @@ class JsonParser extends AbstractParser_1.AbstractParser {
706
709
  *getCustomAttributeProviders(jsonObj, type, name) {
707
710
  if (undefined !== jsonObj.customAttributes) {
708
711
  if (!Array.isArray(jsonObj.customAttributes))
709
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);
712
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);
710
713
  for (const instance of jsonObj.customAttributes) {
711
714
  if (!isObject(instance) || Array.isArray(instance))
712
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);
715
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);
713
716
  if (undefined === instance.className)
714
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes is missing the required 'className' attribute.`);
717
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes is missing the required 'className' attribute.`);
715
718
  if (typeof (instance.className) !== "string")
716
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes has an invalid 'className' attribute. It should be of type 'string'.`);
719
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes has an invalid 'className' attribute. It should be of type 'string'.`);
717
720
  const provider = (_caClass) => {
718
721
  return instance;
719
722
  };