@itwin/ecschema-metadata 5.0.0-dev.98 → 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
@@ -34,7 +34,7 @@ const Unit_1 = require("./Unit");
34
34
  const UnitSystem_1 = require("./UnitSystem");
35
35
  const Constants_1 = require("../Constants");
36
36
  /**
37
- * @beta
37
+ * @public @preview
38
38
  */
39
39
  class Schema {
40
40
  static _currentECSpecVersion = "3.2";
@@ -58,34 +58,34 @@ class Schema {
58
58
  this._alias = alias;
59
59
  }
60
60
  else if (nameOrKey !== undefined) {
61
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);
61
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);
62
62
  }
63
63
  this._originalECSpecMajorVersion = Schema.currentECSpecMajorVersion;
64
64
  this._originalECSpecMinorVersion = Schema.currentECSpecMinorVersion;
65
65
  }
66
66
  get schemaKey() {
67
67
  if (undefined === this._schemaKey)
68
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
68
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
69
69
  return this._schemaKey;
70
70
  }
71
71
  get name() {
72
72
  if (this._schemaKey === undefined)
73
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
73
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
74
74
  return this.schemaKey.name;
75
75
  }
76
76
  get readVersion() {
77
77
  if (this._schemaKey === undefined)
78
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
78
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
79
79
  return this.schemaKey.readVersion;
80
80
  }
81
81
  get writeVersion() {
82
82
  if (this._schemaKey === undefined)
83
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
83
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
84
84
  return this.schemaKey.writeVersion;
85
85
  }
86
86
  get minorVersion() {
87
87
  if (this._schemaKey === undefined)
88
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
88
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
89
89
  return this.schemaKey.minorVersion;
90
90
  }
91
91
  get originalECSpecMajorVersion() { return this._originalECSpecMajorVersion; }
@@ -98,7 +98,7 @@ class Schema {
98
98
  }
99
99
  get alias() {
100
100
  if (this._alias === undefined || this._alias === null) {
101
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);
101
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);
102
102
  }
103
103
  else {
104
104
  return this._alias;
@@ -123,18 +123,19 @@ class Schema {
123
123
  if (this.name !== schemaName) {
124
124
  const newSchemaRef = this.getReferenceSync(schemaName);
125
125
  if (undefined === newSchemaRef)
126
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `Unable to find the referenced SchemaItem ${itemName}.`);
126
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `Unable to find the referenced SchemaItem ${itemName}.`);
127
127
  schemaKey = newSchemaRef.schemaKey;
128
128
  }
129
129
  return new SchemaKey_1.SchemaItemKey(itemName, schemaKey);
130
130
  }
131
+ /** @internal */
131
132
  addItem(item) {
132
133
  if (undefined !== this.getItemSync(item.name))
133
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.DuplicateItem, `The SchemaItem ${item.name} cannot be added to the schema ${this.name} because it already exists`);
134
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.DuplicateItem, `The SchemaItem ${item.name} cannot be added to the schema ${this.name} because it already exists`);
134
135
  this._items.set(item.name.toUpperCase(), item);
135
136
  }
136
137
  /**
137
- * @alpha
138
+ * @internal
138
139
  */
139
140
  createClass(type, name, modifier) {
140
141
  const item = new type(this, name, modifier);
@@ -144,7 +145,7 @@ class Schema {
144
145
  /**
145
146
  * Deletes a class from within this schema.
146
147
  * @param name the local (unqualified) class name, lookup is case-insensitive
147
- * @alpha
148
+ * @internal
148
149
  */
149
150
  async deleteClass(name) {
150
151
  const schemaItem = await this.getItem(name);
@@ -155,7 +156,7 @@ class Schema {
155
156
  /**
156
157
  * Deletes a class from within this schema.
157
158
  * @param name the local (unqualified) class name, lookup is case-insensitive
158
- * @alpha
159
+ * @internal
159
160
  */
160
161
  deleteClassSync(name) {
161
162
  const schemaItem = this.getItemSync(name);
@@ -165,7 +166,7 @@ class Schema {
165
166
  /**
166
167
  * Deletes a SchemaItem from within this schema.
167
168
  * @param name the local (unqualified) class name, lookup is case-insensitive
168
- * @alpha
169
+ * @internal
169
170
  */
170
171
  async deleteSchemaItem(name) {
171
172
  const schemaItem = await this.getItem(name);
@@ -176,21 +177,20 @@ class Schema {
176
177
  /**
177
178
  * Deletes a SchemaItem from within this schema.
178
179
  * @param name the local (unqualified) class name, lookup is case-insensitive
179
- * @alpha
180
+ * @internal
180
181
  */
181
182
  deleteSchemaItemSync(name) {
182
183
  const schemaItem = this.getItemSync(name);
183
184
  if (SchemaItem_1.SchemaItem.isSchemaItem(schemaItem))
184
185
  this._items.delete(name.toUpperCase());
185
186
  }
186
- /**
187
- * @alpha
188
- */
187
+ /** @internal */
189
188
  createItem(type, name) {
190
189
  const item = new type(this, name);
191
190
  this.addItem(item);
192
191
  return item;
193
192
  }
193
+ /** @internal */
194
194
  addCustomAttribute(customAttribute) {
195
195
  if (!this._customAttributes)
196
196
  this._customAttributes = new Map();
@@ -200,27 +200,33 @@ class Schema {
200
200
  * Creates a EntityClass with the provided name in this schema.
201
201
  * @param name
202
202
  * @param modifier
203
+ * @internal
203
204
  */
204
205
  async createEntityClass(name, modifier) {
205
206
  return this.createClass(EntityClass_1.EntityClass, name, modifier);
206
207
  }
208
+ /** @internal */
207
209
  createEntityClassSync(name, modifier) {
208
210
  return this.createClass(EntityClass_1.EntityClass, name, modifier);
209
211
  }
210
212
  /**
211
213
  * Creates a Mixin with the provided name in this schema.
212
214
  * @param name
215
+ * @internal
213
216
  */
214
217
  async createMixinClass(name) { return this.createClass(Mixin_1.Mixin, name); }
218
+ /** @internal */
215
219
  createMixinClassSync(name) { return this.createClass(Mixin_1.Mixin, name); }
216
220
  /**
217
221
  * Creates a StructClass with the provided name in this schema.
218
222
  * @param name
219
223
  * @param modifier
224
+ * @internal
220
225
  */
221
226
  async createStructClass(name, modifier) {
222
227
  return this.createClass(Class_1.StructClass, name, modifier);
223
228
  }
229
+ /** @internal */
224
230
  createStructClassSync(name, modifier) {
225
231
  return this.createClass(Class_1.StructClass, name, modifier);
226
232
  }
@@ -228,10 +234,12 @@ class Schema {
228
234
  * Creates a CustomAttributeClass with the provided name in this schema.
229
235
  * @param name
230
236
  * @param modifier
237
+ * @internal
231
238
  */
232
239
  async createCustomAttributeClass(name, modifier) {
233
240
  return this.createClass(CustomAttributeClass_1.CustomAttributeClass, name, modifier);
234
241
  }
242
+ /** @internal */
235
243
  createCustomAttributeClassSync(name, modifier) {
236
244
  return this.createClass(CustomAttributeClass_1.CustomAttributeClass, name, modifier);
237
245
  }
@@ -239,20 +247,26 @@ class Schema {
239
247
  * Creates a RelationshipClass with the provided name in this schema.
240
248
  * @param name
241
249
  * @param modifier
250
+ * @internal
242
251
  */
243
252
  async createRelationshipClass(name, modifier) {
244
253
  return this.createRelationshipClassSync(name, modifier);
245
254
  }
255
+ /** @internal */
246
256
  createRelationshipClassSync(name, modifier) {
247
257
  return this.createClass(RelationshipClass_1.RelationshipClass, name, modifier);
248
258
  }
249
259
  /**
250
260
  * Creates an Enumeration with the provided name in this schema.
251
261
  * @param name
262
+ * @param primitiveType
263
+ *
264
+ * @internal
252
265
  */
253
266
  async createEnumeration(name, primitiveType) {
254
267
  return this.createEnumerationSync(name, primitiveType);
255
268
  }
269
+ /** @internal */
256
270
  createEnumerationSync(name, primitiveType) {
257
271
  const item = new Enumeration_1.Enumeration(this, name, primitiveType);
258
272
  this.addItem(item);
@@ -261,97 +275,113 @@ class Schema {
261
275
  /**
262
276
  * Creates an KindOfQuantity with the provided name in this schema.
263
277
  * @param name
278
+ * @internal
264
279
  */
265
280
  async createKindOfQuantity(name) {
266
281
  return this.createKindOfQuantitySync(name);
267
282
  }
283
+ /** @internal */
268
284
  createKindOfQuantitySync(name) {
269
285
  return this.createItem(KindOfQuantity_1.KindOfQuantity, name);
270
286
  }
271
287
  /**
272
288
  * Creates a Constant with the provided name in this schema.
273
289
  * @param name
290
+ * @internal
274
291
  */
275
292
  async createConstant(name) {
276
293
  return this.createItem(Constant_1.Constant, name);
277
294
  }
295
+ /** @internal */
278
296
  createConstantSync(name) {
279
297
  return this.createItem(Constant_1.Constant, name);
280
298
  }
281
299
  /**
282
300
  * Creates a Inverted Unit with the provided name in this schema.
283
301
  * @param name
302
+ * @internal
284
303
  */
285
304
  async createInvertedUnit(name) {
286
305
  return this.createItem(InvertedUnit_1.InvertedUnit, name);
287
306
  }
307
+ /** @internal */
288
308
  createInvertedUnitSync(name) {
289
309
  return this.createItem(InvertedUnit_1.InvertedUnit, name);
290
310
  }
291
311
  /**
292
312
  * Creates an Format with the provided name in this schema.
293
313
  * @param name
314
+ * @internal
294
315
  */
295
316
  async createFormat(name) {
296
317
  return this.createItem(Format_1.Format, name);
297
318
  }
319
+ /** @internal */
298
320
  createFormatSync(name) {
299
321
  return this.createItem(Format_1.Format, name);
300
322
  }
301
323
  /**
302
324
  * Creates a UnitSystem with the provided name in this schema.
303
325
  * @param name
326
+ * @internal
304
327
  */
305
328
  async createUnitSystem(name) {
306
329
  return this.createItem(UnitSystem_1.UnitSystem, name);
307
330
  }
331
+ /** @internal */
308
332
  createUnitSystemSync(name) {
309
333
  return this.createItem(UnitSystem_1.UnitSystem, name);
310
334
  }
311
335
  /**
312
336
  * Creates a Phenomenon with the provided name in this schema.
313
337
  * @param name
338
+ * @internal
314
339
  */
315
340
  async createPhenomenon(name) {
316
341
  return this.createItem(Phenomenon_1.Phenomenon, name);
317
342
  }
343
+ /** @internal */
318
344
  createPhenomenonSync(name) {
319
345
  return this.createItem(Phenomenon_1.Phenomenon, name);
320
346
  }
321
347
  /**
322
348
  * Creates a Unit with the provided name in this schema.
323
349
  * @param name
350
+ * @internal
324
351
  */
325
352
  async createUnit(name) {
326
353
  return this.createItem(Unit_1.Unit, name);
327
354
  }
355
+ /** @internal */
328
356
  createUnitSync(name) {
329
357
  return this.createItem(Unit_1.Unit, name);
330
358
  }
331
359
  /**
332
360
  * Creates an PropertyCategory with the provided name in this schema.
333
361
  * @param name
362
+ * @internal
334
363
  */
335
364
  async createPropertyCategory(name) {
336
365
  return this.createItem(PropertyCategory_1.PropertyCategory, name);
337
366
  }
367
+ /** @internal */
338
368
  createPropertyCategorySync(name) {
339
369
  return this.createItem(PropertyCategory_1.PropertyCategory, name);
340
370
  }
341
371
  /**
342
372
  *
343
373
  * @param refSchema
374
+ * @internal
344
375
  */
345
376
  async addReference(refSchema) {
346
377
  // TODO validation of reference schema. For now just adding
347
378
  this.addReferenceSync(refSchema);
348
379
  }
380
+ /** @internal */
349
381
  addReferenceSync(refSchema) {
350
382
  this.references.push(refSchema);
351
383
  }
352
- /**
353
- * @alpha Used for schema editing.
354
- */
384
+ /** @internal */
355
385
  setContext(context) {
356
386
  this._context = context;
357
387
  }
@@ -360,10 +390,11 @@ class Schema {
360
390
  * @param readVersion The read version of the schema. If undefined, the value from the existing SchemaKey will be used.
361
391
  * @param writeVersion The write version of the schema. If undefined, the value from the existing SchemaKey will be used.
362
392
  * @param minorVersion The minor version of the schema. If undefined, the value from the existing SchemaKey will be used.
393
+ * @internal
363
394
  */
364
395
  setVersion(readVersion, writeVersion, minorVersion) {
365
396
  if (!this._schemaKey)
366
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaKey, `The schema '${this.name}' has an invalid SchemaKey.`);
397
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaKey, `The schema '${this.name}' has an invalid SchemaKey.`);
367
398
  const newVersion = new SchemaKey_1.ECVersion(readVersion ?? this._schemaKey.readVersion, writeVersion ?? this._schemaKey.writeVersion, minorVersion ?? this._schemaKey.minorVersion);
368
399
  this._schemaKey = new SchemaKey_1.SchemaKey(this._schemaKey.name, newVersion);
369
400
  }
@@ -548,7 +579,7 @@ class Schema {
548
579
  */
549
580
  toJSON() {
550
581
  if (this._isECSpecVersionUnsupported)
551
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);
582
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);
552
583
  const schemaJson = {};
553
584
  schemaJson.$schema = Constants_1.ECSchemaNamespaceUris.SCHEMAURL3_2_JSON; // $schema is required
554
585
  schemaJson.name = this.name; // name is required
@@ -577,7 +608,7 @@ class Schema {
577
608
  */
578
609
  async toXml(schemaXml) {
579
610
  if (this._isECSpecVersionUnsupported)
580
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);
611
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);
581
612
  const schemaMetadata = schemaXml.createElement("ECSchema");
582
613
  schemaMetadata.setAttribute("xmlns", Constants_1.ECSchemaNamespaceUris.SCHEMAURL3_2_XML);
583
614
  schemaMetadata.setAttribute("version", this.schemaKey.version.toString());
@@ -623,12 +654,12 @@ class Schema {
623
654
  }
624
655
  else {
625
656
  if (schemaProps.name.toLowerCase() !== this.name.toLowerCase())
626
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not match the provided name, '${schemaProps.name}'.`);
657
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not match the provided name, '${schemaProps.name}'.`);
627
658
  if (this.schemaKey.version.compare(SchemaKey_1.ECVersion.fromString(schemaProps.version)))
628
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Schema ${this.name} has the version '${this.schemaKey.version}' that does not match the provided version '${schemaProps.version}'.`);
659
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Schema ${this.name} has the version '${this.schemaKey.version}' that does not match the provided version '${schemaProps.version}'.`);
629
660
  }
630
661
  if (schemaProps.$schema.match(`https://dev\\.bentley\\.com/json_schemas/ec/([0-9]+)/ecschema`) == null && schemaProps.$schema.match(`http://www\\.bentley\\.com/schemas/Bentley\\.ECXML\\.([0-9]+)`) == null)
631
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.MissingSchemaUrl, `The Schema '${this.name}' has an unsupported namespace '${schemaProps.$schema}'.`);
662
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.MissingSchemaUrl, `The Schema '${this.name}' has an unsupported namespace '${schemaProps.$schema}'.`);
632
663
  // The schema props have not been parsed. Parse the ECXml version from the $schema attribute
633
664
  let ecVersion;
634
665
  if (schemaProps.ecSpecMajorVersion === undefined || schemaProps.ecSpecMinorVersion === undefined) {
@@ -640,12 +671,12 @@ class Schema {
640
671
  this._originalECSpecMajorVersion = ecVersion.readVersion;
641
672
  this._originalECSpecMinorVersion = ecVersion.writeVersion;
642
673
  if (ecVersion.readVersion !== 3 || (ecVersion.readVersion === 3 && ecVersion.writeVersion < 2))
643
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECVersion, `The Schema '${this.name}' has an unsupported ECVersion ${ecVersion.readVersion}.${ecVersion.writeVersion} and cannot be loaded.`);
674
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECVersion, `The Schema '${this.name}' has an unsupported ECVersion ${ecVersion.readVersion}.${ecVersion.writeVersion} and cannot be loaded.`);
644
675
  if (ECName_1.ECName.validate(schemaProps.alias)) {
645
676
  this._alias = schemaProps.alias;
646
677
  }
647
678
  else {
648
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECJson, `The Schema ${schemaProps.name} does not have the required 'alias' attribute.`);
679
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Schema ${schemaProps.name} does not have the required 'alias' attribute.`);
649
680
  }
650
681
  if (undefined !== schemaProps.label)
651
682
  this._label = schemaProps.label;
@@ -692,27 +723,18 @@ class Schema {
692
723
  const schema = object;
693
724
  return schema !== undefined && schema.schemaKey !== undefined && schema.context !== undefined;
694
725
  }
695
- /**
696
- * @alpha
697
- * Used for schema editing.
698
- */
726
+ /** @internal */
699
727
  setDisplayLabel(displayLabel) {
700
728
  this._label = displayLabel;
701
729
  }
702
- /**
703
- * @alpha
704
- * Used for schema editing.
705
- */
730
+ /** @internal */
706
731
  setDescription(description) {
707
732
  this._description = description;
708
733
  }
709
- /**
710
- * @alpha
711
- * Used for schema editing.
712
- */
734
+ /** @internal */
713
735
  setAlias(alias) {
714
736
  if (!ECName_1.ECName.validate(alias)) {
715
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidECName, "The specified schema alias is invalid.");
737
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECName, "The specified schema alias is invalid.");
716
738
  }
717
739
  this._alias = alias;
718
740
  }