@itwin/ecschema-metadata 5.0.0-dev.99 → 5.1.0-dev.0

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