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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/CHANGELOG.md +73 -1
  2. package/lib/cjs/Constants.d.ts +8 -0
  3. package/lib/cjs/Constants.d.ts.map +1 -1
  4. package/lib/cjs/Constants.js +30 -21
  5. package/lib/cjs/Constants.js.map +1 -1
  6. package/lib/cjs/Context.d.ts +85 -36
  7. package/lib/cjs/Context.d.ts.map +1 -1
  8. package/lib/cjs/Context.js +79 -29
  9. package/lib/cjs/Context.js.map +1 -1
  10. package/lib/cjs/DelayedPromise.d.ts +9 -8
  11. package/lib/cjs/DelayedPromise.d.ts.map +1 -1
  12. package/lib/cjs/DelayedPromise.js +8 -6
  13. package/lib/cjs/DelayedPromise.js.map +1 -1
  14. package/lib/cjs/Deserialization/AbstractParser.js +1 -0
  15. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  16. package/lib/cjs/Deserialization/Helper.d.ts +3 -3
  17. package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
  18. package/lib/cjs/Deserialization/Helper.js +35 -26
  19. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  20. package/lib/cjs/Deserialization/JsonParser.js +153 -150
  21. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  22. package/lib/cjs/Deserialization/JsonProps.d.ts +47 -33
  23. package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
  24. package/lib/cjs/Deserialization/JsonProps.js +3 -3
  25. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  26. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  27. package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
  28. package/lib/cjs/Deserialization/XmlParser.js +60 -52
  29. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  30. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +0 -5
  31. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
  32. package/lib/cjs/Deserialization/XmlSerializationUtils.js +8 -17
  33. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  34. package/lib/cjs/ECName.d.ts +2 -2
  35. package/lib/cjs/ECName.js +5 -4
  36. package/lib/cjs/ECName.js.map +1 -1
  37. package/lib/cjs/ECObjects.d.ts +41 -9
  38. package/lib/cjs/ECObjects.d.ts.map +1 -1
  39. package/lib/cjs/ECObjects.js +78 -24
  40. package/lib/cjs/ECObjects.js.map +1 -1
  41. package/lib/cjs/Exception.d.ts +4 -4
  42. package/lib/cjs/Exception.d.ts.map +1 -1
  43. package/lib/cjs/Exception.js +61 -60
  44. package/lib/cjs/Exception.js.map +1 -1
  45. package/lib/cjs/Interfaces.d.ts +35 -32
  46. package/lib/cjs/Interfaces.d.ts.map +1 -1
  47. package/lib/cjs/Interfaces.js.map +1 -1
  48. package/lib/cjs/Metadata/Class.d.ts +179 -32
  49. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  50. package/lib/cjs/Metadata/Class.js +290 -88
  51. package/lib/cjs/Metadata/Class.js.map +1 -1
  52. package/lib/cjs/Metadata/Constant.d.ts +26 -10
  53. package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
  54. package/lib/cjs/Metadata/Constant.js +38 -10
  55. package/lib/cjs/Metadata/Constant.js.map +1 -1
  56. package/lib/cjs/Metadata/CustomAttribute.d.ts +2 -2
  57. package/lib/cjs/Metadata/CustomAttribute.d.ts.map +1 -1
  58. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  59. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +21 -7
  60. package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
  61. package/lib/cjs/Metadata/CustomAttributeClass.js +28 -8
  62. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  63. package/lib/cjs/Metadata/EntityClass.d.ts +40 -11
  64. package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
  65. package/lib/cjs/Metadata/EntityClass.js +72 -34
  66. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  67. package/lib/cjs/Metadata/Enumeration.d.ts +30 -10
  68. package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
  69. package/lib/cjs/Metadata/Enumeration.js +41 -13
  70. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  71. package/lib/cjs/Metadata/Format.d.ts +65 -17
  72. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  73. package/lib/cjs/Metadata/Format.js +107 -22
  74. package/lib/cjs/Metadata/Format.js.map +1 -1
  75. package/lib/cjs/Metadata/InvertedUnit.d.ts +19 -10
  76. package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
  77. package/lib/cjs/Metadata/InvertedUnit.js +32 -15
  78. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  79. package/lib/cjs/Metadata/KindOfQuantity.d.ts +38 -18
  80. package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
  81. package/lib/cjs/Metadata/KindOfQuantity.js +90 -40
  82. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  83. package/lib/cjs/Metadata/Mixin.d.ts +31 -4
  84. package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
  85. package/lib/cjs/Metadata/Mixin.js +42 -8
  86. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  87. package/lib/cjs/Metadata/OverrideFormat.d.ts +12 -12
  88. package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
  89. package/lib/cjs/Metadata/OverrideFormat.js +36 -19
  90. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  91. package/lib/cjs/Metadata/Phenomenon.d.ts +24 -3
  92. package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
  93. package/lib/cjs/Metadata/Phenomenon.js +32 -3
  94. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  95. package/lib/cjs/Metadata/Property.d.ts +47 -25
  96. package/lib/cjs/Metadata/Property.d.ts.map +1 -1
  97. package/lib/cjs/Metadata/Property.js +128 -49
  98. package/lib/cjs/Metadata/Property.js.map +1 -1
  99. package/lib/cjs/Metadata/PropertyCategory.d.ts +20 -4
  100. package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
  101. package/lib/cjs/Metadata/PropertyCategory.js +31 -4
  102. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  103. package/lib/cjs/Metadata/RelationshipClass.d.ts +63 -27
  104. package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
  105. package/lib/cjs/Metadata/RelationshipClass.js +100 -43
  106. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  107. package/lib/cjs/Metadata/Schema.d.ts +167 -41
  108. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  109. package/lib/cjs/Metadata/Schema.js +211 -111
  110. package/lib/cjs/Metadata/Schema.js.map +1 -1
  111. package/lib/cjs/Metadata/SchemaItem.d.ts +19 -19
  112. package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
  113. package/lib/cjs/Metadata/SchemaItem.js +23 -21
  114. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  115. package/lib/cjs/Metadata/Unit.d.ts +24 -21
  116. package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
  117. package/lib/cjs/Metadata/Unit.js +40 -24
  118. package/lib/cjs/Metadata/Unit.js.map +1 -1
  119. package/lib/cjs/Metadata/UnitSystem.d.ts +17 -4
  120. package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
  121. package/lib/cjs/Metadata/UnitSystem.js +24 -4
  122. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  123. package/lib/cjs/PropertyTypes.d.ts +11 -11
  124. package/lib/cjs/PropertyTypes.d.ts.map +1 -1
  125. package/lib/cjs/PropertyTypes.js +28 -20
  126. package/lib/cjs/PropertyTypes.js.map +1 -1
  127. package/lib/cjs/SchemaFormatsProvider.d.ts +39 -0
  128. package/lib/cjs/SchemaFormatsProvider.d.ts.map +1 -0
  129. package/lib/cjs/SchemaFormatsProvider.js +146 -0
  130. package/lib/cjs/SchemaFormatsProvider.js.map +1 -0
  131. package/lib/cjs/SchemaJsonLocater.d.ts +8 -8
  132. package/lib/cjs/SchemaJsonLocater.d.ts.map +1 -1
  133. package/lib/cjs/SchemaJsonLocater.js +7 -7
  134. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  135. package/lib/cjs/SchemaKey.d.ts +13 -7
  136. package/lib/cjs/SchemaKey.d.ts.map +1 -1
  137. package/lib/cjs/SchemaKey.js +22 -12
  138. package/lib/cjs/SchemaKey.js.map +1 -1
  139. package/lib/cjs/SchemaLoader.d.ts +5 -5
  140. package/lib/cjs/SchemaLoader.d.ts.map +1 -1
  141. package/lib/cjs/SchemaLoader.js +5 -4
  142. package/lib/cjs/SchemaLoader.js.map +1 -1
  143. package/lib/cjs/SchemaPartVisitorDelegate.d.ts +2 -2
  144. package/lib/cjs/SchemaPartVisitorDelegate.js +2 -1
  145. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  146. package/lib/cjs/UnitConversion/Graph.js +69 -65
  147. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  148. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  149. package/lib/cjs/UnitConversion/UnitConversion.d.ts +1 -1
  150. package/lib/cjs/UnitConversion/UnitConversion.d.ts.map +1 -1
  151. package/lib/cjs/UnitConversion/UnitConversion.js +9 -7
  152. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  153. package/lib/cjs/UnitConversion/UnitConverter.js +2 -0
  154. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  155. package/lib/cjs/UnitConversion/UnitTree.d.ts +2 -0
  156. package/lib/cjs/UnitConversion/UnitTree.d.ts.map +1 -1
  157. package/lib/cjs/UnitConversion/UnitTree.js +11 -1
  158. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  159. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
  160. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +8 -9
  161. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  162. package/lib/cjs/Validation/SchemaWalker.d.ts +1 -1
  163. package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -1
  164. package/lib/cjs/Validation/SchemaWalker.js +6 -4
  165. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  166. package/lib/cjs/ecschema-metadata.d.ts +1 -0
  167. package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
  168. package/lib/cjs/ecschema-metadata.js +1 -0
  169. package/lib/cjs/ecschema-metadata.js.map +1 -1
  170. package/lib/cjs/utils/SchemaGraph.js +5 -6
  171. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  172. package/lib/esm/Constants.d.ts +8 -0
  173. package/lib/esm/Constants.d.ts.map +1 -1
  174. package/lib/esm/Constants.js +29 -20
  175. package/lib/esm/Constants.js.map +1 -1
  176. package/lib/esm/Context.d.ts +85 -36
  177. package/lib/esm/Context.d.ts.map +1 -1
  178. package/lib/esm/Context.js +78 -28
  179. package/lib/esm/Context.js.map +1 -1
  180. package/lib/esm/DelayedPromise.d.ts +9 -8
  181. package/lib/esm/DelayedPromise.d.ts.map +1 -1
  182. package/lib/esm/DelayedPromise.js +8 -6
  183. package/lib/esm/DelayedPromise.js.map +1 -1
  184. package/lib/esm/Deserialization/AbstractParser.js +1 -0
  185. package/lib/esm/Deserialization/AbstractParser.js.map +1 -1
  186. package/lib/esm/Deserialization/Helper.d.ts +3 -3
  187. package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
  188. package/lib/esm/Deserialization/Helper.js +36 -27
  189. package/lib/esm/Deserialization/Helper.js.map +1 -1
  190. package/lib/esm/Deserialization/JsonParser.js +154 -151
  191. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  192. package/lib/esm/Deserialization/JsonProps.d.ts +47 -33
  193. package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
  194. package/lib/esm/Deserialization/JsonProps.js +3 -3
  195. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  196. package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -1
  197. package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -1
  198. package/lib/esm/Deserialization/XmlParser.js +61 -53
  199. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  200. package/lib/esm/Deserialization/XmlSerializationUtils.d.ts +0 -5
  201. package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
  202. package/lib/esm/Deserialization/XmlSerializationUtils.js +9 -18
  203. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
  204. package/lib/esm/ECName.d.ts +2 -2
  205. package/lib/esm/ECName.js +6 -5
  206. package/lib/esm/ECName.js.map +1 -1
  207. package/lib/esm/ECObjects.d.ts +41 -9
  208. package/lib/esm/ECObjects.d.ts.map +1 -1
  209. package/lib/esm/ECObjects.js +77 -24
  210. package/lib/esm/ECObjects.js.map +1 -1
  211. package/lib/esm/Exception.d.ts +4 -4
  212. package/lib/esm/Exception.d.ts.map +1 -1
  213. package/lib/esm/Exception.js +59 -58
  214. package/lib/esm/Exception.js.map +1 -1
  215. package/lib/esm/Interfaces.d.ts +35 -32
  216. package/lib/esm/Interfaces.d.ts.map +1 -1
  217. package/lib/esm/Interfaces.js.map +1 -1
  218. package/lib/esm/Metadata/Class.d.ts +179 -32
  219. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  220. package/lib/esm/Metadata/Class.js +292 -90
  221. package/lib/esm/Metadata/Class.js.map +1 -1
  222. package/lib/esm/Metadata/Constant.d.ts +26 -10
  223. package/lib/esm/Metadata/Constant.d.ts.map +1 -1
  224. package/lib/esm/Metadata/Constant.js +39 -11
  225. package/lib/esm/Metadata/Constant.js.map +1 -1
  226. package/lib/esm/Metadata/CustomAttribute.d.ts +2 -2
  227. package/lib/esm/Metadata/CustomAttribute.d.ts.map +1 -1
  228. package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
  229. package/lib/esm/Metadata/CustomAttributeClass.d.ts +21 -7
  230. package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
  231. package/lib/esm/Metadata/CustomAttributeClass.js +29 -9
  232. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  233. package/lib/esm/Metadata/EntityClass.d.ts +40 -11
  234. package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
  235. package/lib/esm/Metadata/EntityClass.js +73 -35
  236. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  237. package/lib/esm/Metadata/Enumeration.d.ts +30 -10
  238. package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
  239. package/lib/esm/Metadata/Enumeration.js +42 -14
  240. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  241. package/lib/esm/Metadata/Format.d.ts +65 -17
  242. package/lib/esm/Metadata/Format.d.ts.map +1 -1
  243. package/lib/esm/Metadata/Format.js +108 -23
  244. package/lib/esm/Metadata/Format.js.map +1 -1
  245. package/lib/esm/Metadata/InvertedUnit.d.ts +19 -10
  246. package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
  247. package/lib/esm/Metadata/InvertedUnit.js +33 -16
  248. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  249. package/lib/esm/Metadata/KindOfQuantity.d.ts +38 -18
  250. package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
  251. package/lib/esm/Metadata/KindOfQuantity.js +91 -41
  252. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  253. package/lib/esm/Metadata/Mixin.d.ts +31 -4
  254. package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
  255. package/lib/esm/Metadata/Mixin.js +44 -10
  256. package/lib/esm/Metadata/Mixin.js.map +1 -1
  257. package/lib/esm/Metadata/OverrideFormat.d.ts +12 -12
  258. package/lib/esm/Metadata/OverrideFormat.d.ts.map +1 -1
  259. package/lib/esm/Metadata/OverrideFormat.js +37 -20
  260. package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
  261. package/lib/esm/Metadata/Phenomenon.d.ts +24 -3
  262. package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
  263. package/lib/esm/Metadata/Phenomenon.js +33 -4
  264. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  265. package/lib/esm/Metadata/Property.d.ts +47 -25
  266. package/lib/esm/Metadata/Property.d.ts.map +1 -1
  267. package/lib/esm/Metadata/Property.js +130 -51
  268. package/lib/esm/Metadata/Property.js.map +1 -1
  269. package/lib/esm/Metadata/PropertyCategory.d.ts +20 -4
  270. package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
  271. package/lib/esm/Metadata/PropertyCategory.js +31 -4
  272. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  273. package/lib/esm/Metadata/RelationshipClass.d.ts +63 -27
  274. package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
  275. package/lib/esm/Metadata/RelationshipClass.js +102 -45
  276. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  277. package/lib/esm/Metadata/Schema.d.ts +167 -41
  278. package/lib/esm/Metadata/Schema.d.ts.map +1 -1
  279. package/lib/esm/Metadata/Schema.js +212 -112
  280. package/lib/esm/Metadata/Schema.js.map +1 -1
  281. package/lib/esm/Metadata/SchemaItem.d.ts +19 -19
  282. package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
  283. package/lib/esm/Metadata/SchemaItem.js +25 -23
  284. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  285. package/lib/esm/Metadata/Unit.d.ts +24 -21
  286. package/lib/esm/Metadata/Unit.d.ts.map +1 -1
  287. package/lib/esm/Metadata/Unit.js +41 -25
  288. package/lib/esm/Metadata/Unit.js.map +1 -1
  289. package/lib/esm/Metadata/UnitSystem.d.ts +17 -4
  290. package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
  291. package/lib/esm/Metadata/UnitSystem.js +24 -4
  292. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  293. package/lib/esm/PropertyTypes.d.ts +11 -11
  294. package/lib/esm/PropertyTypes.d.ts.map +1 -1
  295. package/lib/esm/PropertyTypes.js +29 -21
  296. package/lib/esm/PropertyTypes.js.map +1 -1
  297. package/lib/esm/SchemaFormatsProvider.d.ts +39 -0
  298. package/lib/esm/SchemaFormatsProvider.d.ts.map +1 -0
  299. package/lib/esm/SchemaFormatsProvider.js +142 -0
  300. package/lib/esm/SchemaFormatsProvider.js.map +1 -0
  301. package/lib/esm/SchemaJsonLocater.d.ts +8 -8
  302. package/lib/esm/SchemaJsonLocater.d.ts.map +1 -1
  303. package/lib/esm/SchemaJsonLocater.js +7 -7
  304. package/lib/esm/SchemaJsonLocater.js.map +1 -1
  305. package/lib/esm/SchemaKey.d.ts +13 -7
  306. package/lib/esm/SchemaKey.d.ts.map +1 -1
  307. package/lib/esm/SchemaKey.js +23 -13
  308. package/lib/esm/SchemaKey.js.map +1 -1
  309. package/lib/esm/SchemaLoader.d.ts +5 -5
  310. package/lib/esm/SchemaLoader.d.ts.map +1 -1
  311. package/lib/esm/SchemaLoader.js +6 -5
  312. package/lib/esm/SchemaLoader.js.map +1 -1
  313. package/lib/esm/SchemaPartVisitorDelegate.d.ts +2 -2
  314. package/lib/esm/SchemaPartVisitorDelegate.js +2 -1
  315. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
  316. package/lib/esm/UnitConversion/Graph.js +69 -65
  317. package/lib/esm/UnitConversion/Graph.js.map +1 -1
  318. package/lib/esm/UnitConversion/Parser.js.map +1 -1
  319. package/lib/esm/UnitConversion/UnitConversion.d.ts +1 -1
  320. package/lib/esm/UnitConversion/UnitConversion.d.ts.map +1 -1
  321. package/lib/esm/UnitConversion/UnitConversion.js +9 -7
  322. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
  323. package/lib/esm/UnitConversion/UnitConverter.js +2 -0
  324. package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
  325. package/lib/esm/UnitConversion/UnitTree.d.ts +2 -0
  326. package/lib/esm/UnitConversion/UnitTree.d.ts.map +1 -1
  327. package/lib/esm/UnitConversion/UnitTree.js +11 -1
  328. package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
  329. package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
  330. package/lib/esm/UnitProvider/SchemaUnitProvider.js +8 -9
  331. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  332. package/lib/esm/Validation/SchemaWalker.d.ts +1 -1
  333. package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -1
  334. package/lib/esm/Validation/SchemaWalker.js +6 -4
  335. package/lib/esm/Validation/SchemaWalker.js.map +1 -1
  336. package/lib/esm/ecschema-metadata.d.ts +1 -0
  337. package/lib/esm/ecschema-metadata.d.ts.map +1 -1
  338. package/lib/esm/ecschema-metadata.js +1 -0
  339. package/lib/esm/ecschema-metadata.js.map +1 -1
  340. package/lib/esm/utils/SchemaGraph.js +6 -7
  341. package/lib/esm/utils/SchemaGraph.js.map +1 -1
  342. package/package.json +16 -14
@@ -20,7 +20,7 @@
20
20
  * additional (non-lazily-loaded) "nested" properties can be added.
21
21
  *
22
22
  * [!alert text="*Remember:* Unlike regular Promises in JavaScript, DelayedPromises represent processes that **may not** already be happening." kind="warning"]
23
- * @beta
23
+ * @internal
24
24
  */
25
25
  export declare class DelayedPromise<T> implements Promise<T> {
26
26
  /**
@@ -54,7 +54,7 @@ export declare class DelayedPromise<T> implements Promise<T> {
54
54
  finally(onFinally?: (() => void) | undefined | null): Promise<T>;
55
55
  }
56
56
  /**
57
- * @beta
57
+ * @internal
58
58
  */
59
59
  export interface NoDelayedPromiseMethods {
60
60
  [propName: string]: any;
@@ -63,7 +63,7 @@ export interface NoDelayedPromiseMethods {
63
63
  catch?: never;
64
64
  }
65
65
  /**
66
- * @beta
66
+ * @internal
67
67
  */
68
68
  export interface DelayedPromiseWithPropsConstructor {
69
69
  /**
@@ -76,14 +76,15 @@ export interface DelayedPromiseWithPropsConstructor {
76
76
  * as if they were readonly properties of the DelayedPromiseWithProps object being constructed.
77
77
  * @param startCallback The asynchronous callback to execute when as soon as this DelayedPromise should be "started".
78
78
  */
79
- new <TProps extends NoDelayedPromiseMethods, TPayload>(props: TProps, startCallback: () => Promise<TPayload>): Readonly<TProps> & DelayedPromise<TPayload>;
79
+ new <TProps extends NoDelayedPromiseMethods, TPayload>(props: TProps, startCallback: () => Promise<TPayload>): TProps & DelayedPromise<TPayload>;
80
80
  }
81
81
  /**
82
- * @beta
82
+ * @internal
83
83
  */
84
84
  export declare const DelayedPromiseWithProps: DelayedPromiseWithPropsConstructor;
85
- /** Define the type of a DelayedPromiseWithProps instance
86
- * @beta
85
+ /**
86
+ * Define the type of a DelayedPromiseWithProps instance
87
+ * @internal
87
88
  */
88
- export type DelayedPromiseWithProps<TProps, TPayload> = Readonly<TProps> & DelayedPromise<TPayload>;
89
+ export type DelayedPromiseWithProps<TProps, TPayload> = TProps & DelayedPromise<TPayload>;
89
90
  //# sourceMappingURL=DelayedPromise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DelayedPromise.d.ts","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,cAAc,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IAElD;;;OAGG;gBACS,aAAa,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;IAS3C,SAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,YAAsB;IAE1D;;OAEG;IACI,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IAE/B;;;;;OAKG;IACU,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,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CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAGD;;GAEG;AACH,MAAM,WAAW,kCAAkC;IAEjD;;;;;;;;;OASG;IACH,KAAK,MAAM,SAAS,uBAAuB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;CAClJ;AAID;;GAEG;AAEH,eAAO,MAAM,uBAAuB,EAY9B,kCAAkC,CAAC;AAIzC;;;GAGG;AACH,MAAM,MAAM,uBAAuB,CAAC,MAAM,EAAE,QAAQ,IAAI,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC"}
@@ -5,7 +5,6 @@
5
5
  /** @packageDocumentation
6
6
  * @module Utils
7
7
  */
8
- var _a;
9
8
  /**
10
9
  * Similar to a normal Promise, a DelayedPromise represents the eventual completion (or failure)
11
10
  * and resulting value of an asynchronous operation ***that has not yet started***.
@@ -25,7 +24,7 @@ var _a;
25
24
  * additional (non-lazily-loaded) "nested" properties can be added.
26
25
  *
27
26
  * [!alert text="*Remember:* Unlike regular Promises in JavaScript, DelayedPromises represent processes that **may not** already be happening." kind="warning"]
28
- * @beta
27
+ * @internal
29
28
  */
30
29
  export class DelayedPromise {
31
30
  /**
@@ -33,14 +32,18 @@ export class DelayedPromise {
33
32
  * @param startCallback The asynchronous callback to execute when this DelayedPromise should be "started".
34
33
  */
35
34
  constructor(startCallback) {
36
- // We need this in order to fulfill the Promise interface defined in lib.es2015.symbol.wellknown.d.ts
37
- this[_a] = "Promise";
38
35
  let pending;
39
36
  this.start = async () => {
40
37
  pending = pending || startCallback();
41
38
  return pending;
42
39
  };
43
40
  }
41
+ // We need this in order to fulfill the Promise interface defined in lib.es2015.symbol.wellknown.d.ts
42
+ [Symbol.toStringTag] = "Promise";
43
+ /**
44
+ * Explicitly starts the asynchronous operation behind this DelayedPromise (if it hasn't started already).
45
+ */
46
+ start;
44
47
  /**
45
48
  * Attaches callbacks for the resolution and/or rejection of the Promise.
46
49
  * @param onfulfilled The callback to execute when the Promise is resolved.
@@ -67,11 +70,10 @@ export class DelayedPromise {
67
70
  return this.start().finally(onFinally);
68
71
  }
69
72
  }
70
- _a = Symbol.toStringTag;
71
73
  // Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.
72
74
  // So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>
73
75
  /**
74
- * @beta
76
+ * @internal
75
77
  */
76
78
  // eslint-disable-next-line @typescript-eslint/naming-convention
77
79
  export const DelayedPromiseWithProps = (class extends DelayedPromise {
@@ -1 +1 @@
1
- {"version":3,"file":"DelayedPromise.js","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,cAAc;IAEzB;;;OAGG;IACH,YAAY,aAA+B;QAQ3C,qGAAqG;QACrF,QAAoB,GAAG,SAAkB,CAAC;QARxD,IAAI,OAA+B,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;YACtB,OAAO,GAAG,OAAO,IAAI,aAAa,EAAE,CAAC;YACrC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;IAUD;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CAAiC,WAAiF,EAAE,UAAmF;QACtN,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAK,CAAkB,UAAiF;QACnH,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO,CAAC,SAA2C;QAC9D,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;KAlCkB,MAAM,CAAC,WAAW;AAkErC,wGAAwG;AACxG,+HAA+H;AAC/H;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAyD,SAAQ,cAAwB;IAC/H,YAAY,KAAa,EAAE,EAA2B;QACpD,KAAK,CAAC,EAAE,CAAC,CAAC;QAEV,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,CAAC,MAAc,EAAE,IAAY,EAAE,EAAE;gBACpC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAkB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAoB,CAAC,CAAC;YAClF,CAAC;SACF,CAAC;QAEF,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,CAAgD,CAAC;IAClF,CAAC;CACF,CAAuC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\n/**\r\n * Similar to a normal Promise, a DelayedPromise represents the eventual completion (or failure)\r\n * and resulting value of an asynchronous operation ***that has not yet started***.\r\n *\r\n * The asynchronous operation behind a DelayedPromise will start when any of the following occurs:\r\n * - The DelayedPromise is `await`ed.\r\n * - A callback is attached via `.then()` or `.catch(() => { })`.\r\n * - The asynchronous operation is explicitly started via `.start()`\r\n *\r\n * Just as normal Promises will never return to their pending state once fulfilled or rejected,\r\n * a DelayedPromise will never re-execute its asynchronous operation more than **once**.\r\n *\r\n * Ultimately, a DelayedPromise is nothing more than some syntactic sugar that allows you to\r\n * represent an (asynchronously) lazily-loaded value as an instance property instead of a method.\r\n * You could also accomplish something similar by defining an async function as a property getter.\r\n * However, since a property defined as a DelayedPromise will not start simply by being accessed,\r\n * additional (non-lazily-loaded) \"nested\" properties can be added.\r\n *\r\n * [!alert text=\"*Remember:* Unlike regular Promises in JavaScript, DelayedPromises represent processes that **may not** already be happening.\" kind=\"warning\"]\r\n * @beta\r\n */\r\nexport class DelayedPromise<T> implements Promise<T> {\r\n\r\n /**\r\n * Constructs a DelayedPromise object.\r\n * @param startCallback The asynchronous callback to execute when this DelayedPromise should be \"started\".\r\n */\r\n constructor(startCallback: () => Promise<T>) {\r\n let pending: Promise<T> | undefined;\r\n this.start = async () => {\r\n pending = pending || startCallback();\r\n return pending;\r\n };\r\n }\r\n\r\n // We need this in order to fulfill the Promise interface defined in lib.es2015.symbol.wellknown.d.ts\r\n public readonly [Symbol.toStringTag] = \"Promise\" as const;\r\n\r\n /**\r\n * Explicitly starts the asynchronous operation behind this DelayedPromise (if it hasn't started already).\r\n */\r\n public start: () => Promise<T>;\r\n\r\n /**\r\n * Attaches callbacks for the resolution and/or rejection of the Promise.\r\n * @param onfulfilled The callback to execute when the Promise is resolved.\r\n * @param onrejected The callback to execute when the Promise is rejected.\r\n * @return A Promise for the completion of which ever callback is executed.\r\n */\r\n public async then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2> {\r\n return this.start().then(onfulfilled, onrejected);\r\n }\r\n\r\n /**\r\n * Attaches a callback for only the rejection of the Promise.\r\n * @param onrejected The callback to execute when the Promise is rejected.\r\n * @return A Promise for the completion of the callback.\r\n */\r\n public async catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult> {\r\n return this.start().catch(onrejected);\r\n }\r\n\r\n /**\r\n * Attaches a callback for only the finally clause of the Promise.\r\n * @param onrejected The callback to execute when the Promise is finalized.\r\n * @return A Promise for the completion of the callback.\r\n */\r\n public async finally(onFinally?: (() => void) | undefined | null): Promise<T> {\r\n return this.start().finally(onFinally);\r\n }\r\n}\r\n\r\n// This keeps us from accidentally overriding one of DelayedPromise's methods in the DelayedPromiseWithProps constructor\r\n/**\r\n * @beta\r\n */\r\nexport interface NoDelayedPromiseMethods {\r\n [propName: string]: any;\r\n start?: never;\r\n then?: never;\r\n catch?: never;\r\n}\r\n\r\n// See definition of DelayedPromiseWithProps below\r\n/**\r\n * @beta\r\n */\r\nexport interface DelayedPromiseWithPropsConstructor {\r\n\r\n /**\r\n * Constructs a DelayedPromiseWithProps object, which is at once both:\r\n * - A DelayedPromise object representing the eventual completion (or failure)\r\n * of an asynchronous operation returning a value of type `TPayload`\r\n * - _and_ a readonly \"wrapper\" around an instance of type `TProps`\r\n *\r\n * @param props An object with properties and methods that will be accessible\r\n * as if they were readonly properties of the DelayedPromiseWithProps object being constructed.\r\n * @param startCallback The asynchronous callback to execute when as soon as this DelayedPromise should be \"started\".\r\n */\r\n new <TProps extends NoDelayedPromiseMethods, TPayload>(props: TProps, startCallback: () => Promise<TPayload>): Readonly<TProps> & DelayedPromise<TPayload>; // eslint-disable-line @typescript-eslint/prefer-function-type\r\n}\r\n\r\n// Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.\r\n// So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>\r\n/**\r\n * @beta\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const DelayedPromiseWithProps = (class <TProps extends NoDelayedPromiseMethods, TPayload> extends DelayedPromise<TPayload> {\r\n constructor(props: TProps, cb: () => Promise<TPayload>) {\r\n super(cb);\r\n\r\n const handler = {\r\n get: (target: TProps, name: string) => {\r\n return (name in this) ? this[name as keyof this] : target[name as keyof TProps];\r\n },\r\n };\r\n\r\n return new Proxy(props, handler) as Readonly<TProps> & DelayedPromise<TPayload>;\r\n }\r\n}) as DelayedPromiseWithPropsConstructor;\r\n\r\n/* eslint-disable @typescript-eslint/no-redeclare */\r\n\r\n/** Define the type of a DelayedPromiseWithProps instance\r\n * @beta\r\n */\r\nexport type DelayedPromiseWithProps<TProps, TPayload> = Readonly<TProps> & DelayedPromise<TPayload>;\r\n"]}
1
+ {"version":3,"file":"DelayedPromise.js","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,cAAc;IAEzB;;;OAGG;IACH,YAAY,aAA+B;QACzC,IAAI,OAA+B,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;YACtB,OAAO,GAAG,OAAO,IAAI,aAAa,EAAE,CAAC;YACrC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;IAED,qGAAqG;IACrF,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,SAAkB,CAAC;IAE1D;;OAEG;IACI,KAAK,CAAmB;IAE/B;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CAAiC,WAAiF,EAAE,UAAmF;QACtN,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAK,CAAkB,UAAiF;QACnH,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO,CAAC,SAA2C;QAC9D,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AAgCD,wGAAwG;AACxG,+HAA+H;AAC/H;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAyD,SAAQ,cAAwB;IAC/H,YAAY,KAAa,EAAE,EAA2B;QACpD,KAAK,CAAC,EAAE,CAAC,CAAC;QAEV,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,CAAC,MAAc,EAAE,IAAY,EAAE,EAAE;gBACpC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAkB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAoB,CAAC,CAAC;YAClF,CAAC;SACF,CAAC;QAEF,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,CAAsC,CAAC;IACxE,CAAC;CACF,CAAuC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utils\n */\n\n/**\n * Similar to a normal Promise, a DelayedPromise represents the eventual completion (or failure)\n * and resulting value of an asynchronous operation ***that has not yet started***.\n *\n * The asynchronous operation behind a DelayedPromise will start when any of the following occurs:\n * - The DelayedPromise is `await`ed.\n * - A callback is attached via `.then()` or `.catch(() => { })`.\n * - The asynchronous operation is explicitly started via `.start()`\n *\n * Just as normal Promises will never return to their pending state once fulfilled or rejected,\n * a DelayedPromise will never re-execute its asynchronous operation more than **once**.\n *\n * Ultimately, a DelayedPromise is nothing more than some syntactic sugar that allows you to\n * represent an (asynchronously) lazily-loaded value as an instance property instead of a method.\n * You could also accomplish something similar by defining an async function as a property getter.\n * However, since a property defined as a DelayedPromise will not start simply by being accessed,\n * additional (non-lazily-loaded) \"nested\" properties can be added.\n *\n * [!alert text=\"*Remember:* Unlike regular Promises in JavaScript, DelayedPromises represent processes that **may not** already be happening.\" kind=\"warning\"]\n * @internal\n */\nexport class DelayedPromise<T> implements Promise<T> {\n\n /**\n * Constructs a DelayedPromise object.\n * @param startCallback The asynchronous callback to execute when this DelayedPromise should be \"started\".\n */\n constructor(startCallback: () => Promise<T>) {\n let pending: Promise<T> | undefined;\n this.start = async () => {\n pending = pending || startCallback();\n return pending;\n };\n }\n\n // We need this in order to fulfill the Promise interface defined in lib.es2015.symbol.wellknown.d.ts\n public readonly [Symbol.toStringTag] = \"Promise\" as const;\n\n /**\n * Explicitly starts the asynchronous operation behind this DelayedPromise (if it hasn't started already).\n */\n public start: () => Promise<T>;\n\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @return A Promise for the completion of which ever callback is executed.\n */\n public async then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2> {\n return this.start().then(onfulfilled, onrejected);\n }\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @return A Promise for the completion of the callback.\n */\n public async catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult> {\n return this.start().catch(onrejected);\n }\n\n /**\n * Attaches a callback for only the finally clause of the Promise.\n * @param onrejected The callback to execute when the Promise is finalized.\n * @return A Promise for the completion of the callback.\n */\n public async finally(onFinally?: (() => void) | undefined | null): Promise<T> {\n return this.start().finally(onFinally);\n }\n}\n\n// This keeps us from accidentally overriding one of DelayedPromise's methods in the DelayedPromiseWithProps constructor\n/**\n * @internal\n */\nexport interface NoDelayedPromiseMethods {\n [propName: string]: any;\n start?: never;\n then?: never;\n catch?: never;\n}\n\n// See definition of DelayedPromiseWithProps below\n/**\n * @internal\n */\nexport interface DelayedPromiseWithPropsConstructor {\n\n /**\n * Constructs a DelayedPromiseWithProps object, which is at once both:\n * - A DelayedPromise object representing the eventual completion (or failure)\n * of an asynchronous operation returning a value of type `TPayload`\n * - _and_ a readonly \"wrapper\" around an instance of type `TProps`\n *\n * @param props An object with properties and methods that will be accessible\n * as if they were readonly properties of the DelayedPromiseWithProps object being constructed.\n * @param startCallback The asynchronous callback to execute when as soon as this DelayedPromise should be \"started\".\n */\n new <TProps extends NoDelayedPromiseMethods, TPayload>(props: TProps, startCallback: () => Promise<TPayload>): TProps & DelayedPromise<TPayload>; // eslint-disable-line @typescript-eslint/prefer-function-type\n}\n\n// Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.\n// So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DelayedPromiseWithProps = (class <TProps extends NoDelayedPromiseMethods, TPayload> extends DelayedPromise<TPayload> {\n constructor(props: TProps, cb: () => Promise<TPayload>) {\n super(cb);\n\n const handler = {\n get: (target: TProps, name: string) => {\n return (name in this) ? this[name as keyof this] : target[name as keyof TProps];\n },\n };\n\n return new Proxy(props, handler) as TProps & DelayedPromise<TPayload>;\n }\n}) as DelayedPromiseWithPropsConstructor;\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\n/**\n * Define the type of a DelayedPromiseWithProps instance\n * @internal\n */\nexport type DelayedPromiseWithProps<TProps, TPayload> = TProps & DelayedPromise<TPayload>;\n"]}
@@ -4,5 +4,6 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  /** @internal */
6
6
  export class AbstractParser {
7
+ _ecSpecVersion;
7
8
  }
8
9
  //# sourceMappingURL=AbstractParser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AbstractParser.js","sourceRoot":"","sources":["../../../src/Deserialization/AbstractParser.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAoB/F,gBAAgB;AAChB,MAAM,OAAgB,cAAc;CAoCnC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport {\r\n ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps,\r\n NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps,\r\n SchemaItemFormatProps, SchemaItemUnitProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitSystemProps,\r\n} from \"../Deserialization/JsonProps\";\r\nimport { CustomAttribute } from \"../Metadata/CustomAttribute\";\r\nimport { CustomAttributeClass } from \"../Metadata/CustomAttributeClass\";\r\nimport { ECSpecVersion } from \"./Helper\";\r\n\r\ntype SchemaItemTuple<T> = Readonly<[string /** Name */, string /** SchemaItemType */, Readonly<T>]>;\r\ntype PropertyTuple<T> = Readonly<[string /** Name */, string /** Property */, Readonly<T>]>;\r\n\r\n/** @internal */\r\nexport type CustomAttributeProvider = (caClass: CustomAttributeClass) => CustomAttribute;\r\n\r\n/** @internal */\r\nexport type CAProviderTuple = Readonly<[string /** Full Name */, CustomAttributeProvider]>;\r\n\r\n/** @internal */\r\nexport abstract class AbstractParser<TItem = any, TProperty = TItem> {\r\n protected _ecSpecVersion?: ECSpecVersion;\r\n\r\n public abstract parseSchema(): SchemaProps;\r\n public abstract getReferences(): Iterable<SchemaReferenceProps>;\r\n\r\n public abstract getItems(): Iterable<SchemaItemTuple<TItem>>;\r\n public abstract findItem(itemName: string): SchemaItemTuple<TItem> | undefined;\r\n\r\n public abstract parseEntityClass(data: Readonly<TItem>): EntityClassProps;\r\n public abstract parseMixin(data: Readonly<TItem>): MixinProps;\r\n public abstract parseStructClass(data: Readonly<TItem>): StructClassProps;\r\n public abstract parseCustomAttributeClass(data: Readonly<TItem>): CustomAttributeClassProps;\r\n public abstract parseRelationshipClass(data: Readonly<TItem>): RelationshipClassProps;\r\n public abstract parseEnumeration(data: Readonly<TItem>): EnumerationProps;\r\n public abstract parseKindOfQuantity(data: Readonly<TItem>): KindOfQuantityProps;\r\n public abstract parsePropertyCategory(data: Readonly<TItem>): PropertyCategoryProps;\r\n public abstract parseUnit(data: Readonly<TItem>): SchemaItemUnitProps;\r\n public abstract parseInvertedUnit(data: Readonly<TItem>): InvertedUnitProps;\r\n public abstract parseConstant(data: Readonly<TItem>): ConstantProps;\r\n public abstract parsePhenomenon(data: Readonly<TItem>): PhenomenonProps;\r\n public abstract parseFormat(data: Readonly<TItem>): SchemaItemFormatProps;\r\n public abstract parseUnitSystem(data: Readonly<TItem>): UnitSystemProps;\r\n\r\n public abstract getProperties(data: Readonly<TItem>, itemName: string): Iterable<PropertyTuple<TProperty>>;\r\n public abstract parsePrimitiveProperty(data: Readonly<TProperty>): PrimitivePropertyProps;\r\n public abstract parseStructProperty(data: Readonly<TProperty>): StructPropertyProps;\r\n public abstract parsePrimitiveArrayProperty(data: Readonly<TProperty>): PrimitiveArrayPropertyProps;\r\n public abstract parseStructArrayProperty(data: Readonly<TProperty>): StructArrayPropertyProps;\r\n public abstract parseNavigationProperty(data: Readonly<TProperty>): NavigationPropertyProps;\r\n\r\n public abstract getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple>;\r\n public abstract getClassCustomAttributeProviders(data: Readonly<TItem>): Iterable<CAProviderTuple>;\r\n public abstract getPropertyCustomAttributeProviders(data: Readonly<TProperty>): Iterable<CAProviderTuple>;\r\n public abstract getRelationshipConstraintCustomAttributeProviders(data: Readonly<TItem>): [Iterable<CAProviderTuple> /* source */, Iterable<CAProviderTuple> /* target */];\r\n public abstract get getECSpecVersion(): ECSpecVersion | undefined;\r\n}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/prefer-function-type\r\nexport interface AbstractParserConstructor<TSchema, TItem = any, TProperty = TItem> { new(obj: Readonly<TSchema>): AbstractParser<TItem, TProperty> }\r\n"]}
1
+ {"version":3,"file":"AbstractParser.js","sourceRoot":"","sources":["../../../src/Deserialization/AbstractParser.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAoB/F,gBAAgB;AAChB,MAAM,OAAgB,cAAc;IACxB,cAAc,CAAiB;CAmC1C","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport {\n ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps,\n NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps,\n SchemaItemFormatProps, SchemaItemUnitProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitSystemProps,\n} from \"../Deserialization/JsonProps\";\nimport { CustomAttribute } from \"../Metadata/CustomAttribute\";\nimport { CustomAttributeClass } from \"../Metadata/CustomAttributeClass\";\nimport { ECSpecVersion } from \"./Helper\";\n\ntype SchemaItemTuple<T> = Readonly<[string /** Name */, string /** SchemaItemType */, Readonly<T>]>;\ntype PropertyTuple<T> = Readonly<[string /** Name */, string /** Property */, Readonly<T>]>;\n\n/** @internal */\nexport type CustomAttributeProvider = (caClass: CustomAttributeClass) => CustomAttribute;\n\n/** @internal */\nexport type CAProviderTuple = Readonly<[string /** Full Name */, CustomAttributeProvider]>;\n\n/** @internal */\nexport abstract class AbstractParser<TItem = any, TProperty = TItem> {\n protected _ecSpecVersion?: ECSpecVersion;\n\n public abstract parseSchema(): SchemaProps;\n public abstract getReferences(): Iterable<SchemaReferenceProps>;\n\n public abstract getItems(): Iterable<SchemaItemTuple<TItem>>;\n public abstract findItem(itemName: string): SchemaItemTuple<TItem> | undefined;\n\n public abstract parseEntityClass(data: Readonly<TItem>): EntityClassProps;\n public abstract parseMixin(data: Readonly<TItem>): MixinProps;\n public abstract parseStructClass(data: Readonly<TItem>): StructClassProps;\n public abstract parseCustomAttributeClass(data: Readonly<TItem>): CustomAttributeClassProps;\n public abstract parseRelationshipClass(data: Readonly<TItem>): RelationshipClassProps;\n public abstract parseEnumeration(data: Readonly<TItem>): EnumerationProps;\n public abstract parseKindOfQuantity(data: Readonly<TItem>): KindOfQuantityProps;\n public abstract parsePropertyCategory(data: Readonly<TItem>): PropertyCategoryProps;\n public abstract parseUnit(data: Readonly<TItem>): SchemaItemUnitProps;\n public abstract parseInvertedUnit(data: Readonly<TItem>): InvertedUnitProps;\n public abstract parseConstant(data: Readonly<TItem>): ConstantProps;\n public abstract parsePhenomenon(data: Readonly<TItem>): PhenomenonProps;\n public abstract parseFormat(data: Readonly<TItem>): SchemaItemFormatProps;\n public abstract parseUnitSystem(data: Readonly<TItem>): UnitSystemProps;\n\n public abstract getProperties(data: Readonly<TItem>, itemName: string): Iterable<PropertyTuple<TProperty>>;\n public abstract parsePrimitiveProperty(data: Readonly<TProperty>): PrimitivePropertyProps;\n public abstract parseStructProperty(data: Readonly<TProperty>): StructPropertyProps;\n public abstract parsePrimitiveArrayProperty(data: Readonly<TProperty>): PrimitiveArrayPropertyProps;\n public abstract parseStructArrayProperty(data: Readonly<TProperty>): StructArrayPropertyProps;\n public abstract parseNavigationProperty(data: Readonly<TProperty>): NavigationPropertyProps;\n\n public abstract getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple>;\n public abstract getClassCustomAttributeProviders(data: Readonly<TItem>): Iterable<CAProviderTuple>;\n public abstract getPropertyCustomAttributeProviders(data: Readonly<TProperty>): Iterable<CAProviderTuple>;\n public abstract getRelationshipConstraintCustomAttributeProviders(data: Readonly<TItem>): [Iterable<CAProviderTuple> /* source */, Iterable<CAProviderTuple> /* target */];\n public abstract get getECSpecVersion(): ECSpecVersion | undefined;\n}\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/prefer-function-type\nexport interface AbstractParserConstructor<TSchema, TItem = any, TProperty = TItem> { new(obj: Readonly<TSchema>): AbstractParser<TItem, TProperty> }\n"]}
@@ -31,20 +31,20 @@ export declare class SchemaReadHelper<T = unknown> {
31
31
  * @param schema The Schema to populate
32
32
  * @param rawSchema The serialized data to use to populate the Schema.
33
33
  */
34
- readSchemaInfo<U extends Schema>(schema: U, rawSchema: T): Promise<SchemaInfo>;
34
+ readSchemaInfo(schema: Schema, rawSchema: T): Promise<SchemaInfo>;
35
35
  /**
36
36
  * Populates the given Schema from a serialized representation.
37
37
  * @param schema The Schema to populate
38
38
  * @param rawSchema The serialized data to use to populate the Schema.
39
39
  */
40
- readSchema<U extends Schema>(schema: U, rawSchema: T): Promise<U>;
40
+ readSchema(schema: Schema, rawSchema: T): Promise<Schema>;
41
41
  private loadSchema;
42
42
  /**
43
43
  * Populates the given Schema from a serialized representation.
44
44
  * @param schema The Schema to populate
45
45
  * @param rawSchema The serialized data to use to populate the Schema.
46
46
  */
47
- readSchemaSync<U extends Schema>(schema: U, rawSchema: T): U;
47
+ readSchemaSync(schema: Schema, rawSchema: T): Schema;
48
48
  /**
49
49
  * Ensures that the schema references can be located and adds them to the schema.
50
50
  * @param ref The object to read the SchemaReference's props from.
@@ -1 +1 @@
1
- {"version":3,"file":"Helper.d.ts","sourceRoot":"","sources":["../../../src/Deserialization/Helper.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAA2B,UAAU,EAAE,MAAM,eAAe,CAAC;AAWpE,OAAO,EAAiB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAI3D,OAAO,EAAE,kBAAkB,EAA6B,MAAM,8BAA8B,CAAC;AAE7F,OAAO,EAAkB,yBAAyB,EAAmB,MAAM,kBAAkB,CAAC;AAO9F;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,qBAAa,gBAAgB,CAAC,CAAC,GAAG,OAAO;IACvC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,cAAc,CAAC,CAA4B;IACnD,OAAO,CA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;OAIG;YACW,UAAU;IAYxB;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAatB;;;;;OAKG;YACW,SAAS;IAsBvB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAsBrB;;;;OAIG;YACW,eAAe;IAY7B;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAY3B;;;;OAIG;YACW,SAAS;IAavB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAarB;;;;OAIG;YACW,qBAAqB;IAWnC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;IAWjC;;;;OAIG;YACW,0BAA0B;IAYxC;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;IAatC;;;;;;OAMG;YACW,iBAAiB;IAmD/B;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAkD7B;;;;;OAKG;YACW,YAAY;IAa1B;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAaxB;;;;;OAKG;YACW,oBAAoB;IAmBlC;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;WAYlB,oBAAoB,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,OAAO;CAM3E"}
@@ -4,7 +4,7 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import { SchemaContext } from "../Context";
6
6
  import { parsePrimitiveType, parseSchemaItemType, SchemaItemType, SchemaMatchType } from "../ECObjects";
7
- import { ECObjectsError, ECObjectsStatus } from "../Exception";
7
+ import { ECSchemaError, ECSchemaStatus } from "../Exception";
8
8
  import { Schema } from "../Metadata/Schema";
9
9
  import { SchemaItem } from "../Metadata/SchemaItem";
10
10
  import { ECVersion, SchemaItemKey, SchemaKey } from "../SchemaKey";
@@ -17,6 +17,14 @@ import { SchemaGraph } from "../utils/SchemaGraph";
17
17
  * @internal
18
18
  */
19
19
  export class SchemaReadHelper {
20
+ _context;
21
+ _visitorHelper;
22
+ _parserType;
23
+ _parser;
24
+ // Cache of the schema currently being loaded. This schema is in the _context but to
25
+ // avoid going back to the context every time, the cache is used.
26
+ _schema;
27
+ _schemaInfo;
20
28
  constructor(parserType, context, visitor) {
21
29
  this._context = (undefined !== context) ? context : new SchemaContext();
22
30
  this._visitorHelper = visitor ? new SchemaPartVisitorDelegate(visitor) : undefined;
@@ -33,7 +41,7 @@ export class SchemaReadHelper {
33
41
  // Ensure context matches schema context
34
42
  if (schema.context) {
35
43
  if (this._context !== schema.context)
36
- throw new ECObjectsError(ECObjectsStatus.DifferentSchemaContexts, "The SchemaContext of the schema must be the same SchemaContext held by the SchemaReadHelper.");
44
+ throw new ECSchemaError(ECSchemaStatus.DifferentSchemaContexts, "The SchemaContext of the schema must be the same SchemaContext held by the SchemaReadHelper.");
37
45
  }
38
46
  else {
39
47
  schema.setContext(this._context);
@@ -42,10 +50,11 @@ export class SchemaReadHelper {
42
50
  // Loads all of the properties on the Schema object
43
51
  await schema.fromJSON(this._parser.parseSchema());
44
52
  this._schema = schema;
45
- const schemaInfo = { schemaKey: schema.schemaKey, references: [] };
53
+ const schemaInfoReferences = [];
54
+ const schemaInfo = { schemaKey: schema.schemaKey, alias: schema.alias, references: schemaInfoReferences };
46
55
  for (const reference of this._parser.getReferences()) {
47
56
  const refKey = new SchemaKey(reference.name, ECVersion.fromString(reference.version));
48
- schemaInfo.references.push({ schemaKey: refKey });
57
+ schemaInfoReferences.push({ schemaKey: refKey });
49
58
  }
50
59
  this._schemaInfo = schemaInfo;
51
60
  // Need to add this schema to the context to be able to locate schemaItems within the context.
@@ -65,7 +74,7 @@ export class SchemaReadHelper {
65
74
  }
66
75
  const cachedSchema = await this._context.getCachedSchema(this._schemaInfo.schemaKey, SchemaMatchType.Latest);
67
76
  if (undefined === cachedSchema)
68
- throw new ECObjectsError(ECObjectsStatus.UnableToLoadSchema, `Could not load schema ${schema.schemaKey.toString()}`);
77
+ throw new ECSchemaError(ECSchemaStatus.UnableToLoadSchema, `Could not load schema ${schema.schemaKey.toString()}`);
69
78
  return cachedSchema;
70
79
  }
71
80
  /* Finish loading the rest of the schema */
@@ -136,7 +145,7 @@ export class SchemaReadHelper {
136
145
  async loadSchemaReference(schemaInfo, refKey) {
137
146
  const refSchema = await this._context.getSchema(refKey, SchemaMatchType.LatestWriteCompatible);
138
147
  if (undefined === refSchema)
139
- throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `Could not locate the referenced schema, ${refKey.name}.${refKey.version.toString()}, of ${schemaInfo.schemaKey.name}`);
148
+ throw new ECSchemaError(ECSchemaStatus.UnableToLocateSchema, `Could not locate the referenced schema, ${refKey.name}.${refKey.version.toString()}, of ${schemaInfo.schemaKey.name}`);
140
149
  await this._schema.addReference(refSchema);
141
150
  const results = this.validateSchemaReferences(this._schema);
142
151
  let errorMessage = "";
@@ -144,7 +153,7 @@ export class SchemaReadHelper {
144
153
  errorMessage += `${result}\r\n`;
145
154
  }
146
155
  if (errorMessage) {
147
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `${errorMessage}`);
156
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `${errorMessage}`);
148
157
  }
149
158
  }
150
159
  /**
@@ -155,7 +164,7 @@ export class SchemaReadHelper {
155
164
  const schemaKey = new SchemaKey(ref.name, ECVersion.fromString(ref.version));
156
165
  const refSchema = this._context.getSchemaSync(schemaKey, SchemaMatchType.LatestWriteCompatible);
157
166
  if (!refSchema)
158
- throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `Could not locate the referenced schema, ${ref.name}.${ref.version}, of ${this._schema.schemaKey.name}`);
167
+ throw new ECSchemaError(ECSchemaStatus.UnableToLocateSchema, `Could not locate the referenced schema, ${ref.name}.${ref.version}, of ${this._schema.schemaKey.name}`);
159
168
  this._schema.addReferenceSync(refSchema);
160
169
  SchemaGraph.generateGraphSync(this._schema).throwIfCycles();
161
170
  const results = this.validateSchemaReferences(this._schema);
@@ -164,7 +173,7 @@ export class SchemaReadHelper {
164
173
  errorMessage += `${result}\r\n`;
165
174
  }
166
175
  if (errorMessage) {
167
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `${errorMessage}`);
176
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `${errorMessage}`);
168
177
  }
169
178
  }
170
179
  /**
@@ -350,7 +359,7 @@ export class SchemaReadHelper {
350
359
  if (undefined !== schema && -1 !== fullOrQualifiedName.indexOf(":")) {
351
360
  const refName = schema.getReferenceNameByAlias(schemaName);
352
361
  if (undefined === refName)
353
- throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `Could not resolve schema alias '${schemaName}' for schema item '${itemName}.`);
362
+ throw new ECSchemaError(ECSchemaStatus.UnableToLocateSchema, `Could not resolve schema alias '${schemaName}' for schema item '${itemName}.`);
354
363
  return [refName, itemName];
355
364
  }
356
365
  return [schemaName, itemName];
@@ -369,7 +378,7 @@ export class SchemaReadHelper {
369
378
  const [schemaName, itemName] = SchemaReadHelper.resolveSchemaAndItemName(name, this._schema);
370
379
  const isInThisSchema = (this._schema && this._schema.name.toLowerCase() === schemaName.toLowerCase());
371
380
  if (undefined === schemaName || 0 === schemaName.length)
372
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The SchemaItem ${name} is invalid without a schema name`);
381
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${name} is invalid without a schema name`);
373
382
  if (isInThisSchema) {
374
383
  schemaItem = await this._schema.getItem(itemName);
375
384
  if (schemaItem)
@@ -384,11 +393,11 @@ export class SchemaReadHelper {
384
393
  loadCallBack(schemaItem);
385
394
  return schemaItem;
386
395
  }
387
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
396
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
388
397
  }
389
398
  schemaItem = await this._context.getSchemaItem(new SchemaItemKey(itemName, new SchemaKey(schemaName)));
390
399
  if (undefined === schemaItem)
391
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
400
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
392
401
  return schemaItem;
393
402
  }
394
403
  /**
@@ -405,7 +414,7 @@ export class SchemaReadHelper {
405
414
  const [schemaName, itemName] = SchemaReadHelper.resolveSchemaAndItemName(name, this._schema);
406
415
  const isInThisSchema = (this._schema && this._schema.name.toLowerCase() === schemaName.toLowerCase());
407
416
  if (undefined === schemaName || schemaName.length === 0)
408
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The SchemaItem ${name} is invalid without a schema name`);
417
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${name} is invalid without a schema name`);
409
418
  if (isInThisSchema && undefined === this._schema.getItemSync(itemName)) {
410
419
  const foundItem = this._parser.findItem(itemName);
411
420
  if (foundItem) {
@@ -417,11 +426,11 @@ export class SchemaReadHelper {
417
426
  loadCallBack(schemaItem);
418
427
  return schemaItem;
419
428
  }
420
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
429
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
421
430
  }
422
431
  schemaItem = this._context.getSchemaItemSync(new SchemaItemKey(itemName, new SchemaKey(schemaName)));
423
432
  if (undefined === schemaItem)
424
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
433
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
425
434
  return schemaItem;
426
435
  }
427
436
  /**
@@ -725,16 +734,16 @@ export class SchemaReadHelper {
725
734
  const loadTypeName = async (typeName) => {
726
735
  if (undefined === parsePrimitiveType(typeName)) {
727
736
  if (SchemaReadHelper.isECSpecVersionNewer(this._parser.getECSpecVersion))
728
- return ECObjectsStatus.NewerECSpecVersion;
737
+ return ECSchemaStatus.NewerECSpecVersion;
729
738
  await this.findSchemaItem(typeName);
730
739
  }
731
- return ECObjectsStatus.Success;
740
+ return ECSchemaStatus.Success;
732
741
  };
733
742
  const lowerCasePropType = propType.toLowerCase();
734
743
  switch (lowerCasePropType) {
735
744
  case "primitiveproperty":
736
745
  const primPropertyProps = this._parser.parsePrimitiveProperty(rawProperty);
737
- if (await loadTypeName(primPropertyProps.typeName) === ECObjectsStatus.NewerECSpecVersion)
746
+ if (await loadTypeName(primPropertyProps.typeName) === ECSchemaStatus.NewerECSpecVersion)
738
747
  primPropertyProps.typeName = "string";
739
748
  const primProp = await classObj.createPrimitiveProperty(propName, primPropertyProps.typeName);
740
749
  return this.loadProperty(primProp, primPropertyProps, rawProperty);
@@ -745,7 +754,7 @@ export class SchemaReadHelper {
745
754
  return this.loadProperty(structProp, structPropertyProps, rawProperty);
746
755
  case "primitivearrayproperty":
747
756
  const primArrPropertyProps = this._parser.parsePrimitiveArrayProperty(rawProperty);
748
- if (await loadTypeName(primArrPropertyProps.typeName) === ECObjectsStatus.NewerECSpecVersion)
757
+ if (await loadTypeName(primArrPropertyProps.typeName) === ECSchemaStatus.NewerECSpecVersion)
749
758
  primArrPropertyProps.typeName = "string";
750
759
  const primArrProp = await classObj.createPrimitiveArrayProperty(propName, primArrPropertyProps.typeName);
751
760
  return this.loadProperty(primArrProp, primArrPropertyProps, rawProperty);
@@ -756,7 +765,7 @@ export class SchemaReadHelper {
756
765
  return this.loadProperty(structArrProp, structArrPropertyProps, rawProperty);
757
766
  case "navigationproperty":
758
767
  if (classObj.schemaItemType !== SchemaItemType.EntityClass && classObj.schemaItemType !== SchemaItemType.RelationshipClass && classObj.schemaItemType !== SchemaItemType.Mixin)
759
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Navigation Property ${classObj.name}.${propName} is invalid, because only EntityClasses, Mixins, and RelationshipClasses can have NavigationProperties.`);
768
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${classObj.name}.${propName} is invalid, because only EntityClasses, Mixins, and RelationshipClasses can have NavigationProperties.`);
760
769
  const navPropertyProps = this._parser.parseNavigationProperty(rawProperty);
761
770
  await this.findSchemaItem(navPropertyProps.relationshipName);
762
771
  const navProp = await classObj.createNavigationProperty(propName, navPropertyProps.relationshipName, navPropertyProps.direction);
@@ -774,16 +783,16 @@ export class SchemaReadHelper {
774
783
  const loadTypeName = (typeName) => {
775
784
  if (undefined === parsePrimitiveType(typeName)) {
776
785
  if (SchemaReadHelper.isECSpecVersionNewer(this._parser.getECSpecVersion))
777
- return ECObjectsStatus.NewerECSpecVersion;
786
+ return ECSchemaStatus.NewerECSpecVersion;
778
787
  this.findSchemaItemSync(typeName);
779
788
  }
780
- return ECObjectsStatus.Success;
789
+ return ECSchemaStatus.Success;
781
790
  };
782
791
  const lowerCasePropType = propType.toLowerCase();
783
792
  switch (lowerCasePropType) {
784
793
  case "primitiveproperty":
785
794
  const primPropertyProps = this._parser.parsePrimitiveProperty(rawProperty);
786
- if (loadTypeName(primPropertyProps.typeName) === ECObjectsStatus.NewerECSpecVersion)
795
+ if (loadTypeName(primPropertyProps.typeName) === ECSchemaStatus.NewerECSpecVersion)
787
796
  primPropertyProps.typeName = "string";
788
797
  const primProp = classObj.createPrimitivePropertySync(propName, primPropertyProps.typeName);
789
798
  return this.loadPropertySync(primProp, primPropertyProps, rawProperty);
@@ -794,7 +803,7 @@ export class SchemaReadHelper {
794
803
  return this.loadPropertySync(structProp, structPropertyProps, rawProperty);
795
804
  case "primitivearrayproperty":
796
805
  const primArrPropertyProps = this._parser.parsePrimitiveArrayProperty(rawProperty);
797
- if (loadTypeName(primArrPropertyProps.typeName) === ECObjectsStatus.NewerECSpecVersion)
806
+ if (loadTypeName(primArrPropertyProps.typeName) === ECSchemaStatus.NewerECSpecVersion)
798
807
  primArrPropertyProps.typeName = "string";
799
808
  const primArrProp = classObj.createPrimitiveArrayPropertySync(propName, primArrPropertyProps.typeName);
800
809
  return this.loadPropertySync(primArrProp, primArrPropertyProps, rawProperty);
@@ -805,7 +814,7 @@ export class SchemaReadHelper {
805
814
  return this.loadPropertySync(structArrProp, structArrPropertyProps, rawProperty);
806
815
  case "navigationproperty":
807
816
  if (classObj.schemaItemType !== SchemaItemType.EntityClass && classObj.schemaItemType !== SchemaItemType.RelationshipClass && classObj.schemaItemType !== SchemaItemType.Mixin)
808
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Navigation Property ${classObj.name}.${propName} is invalid, because only EntityClasses, Mixins, and RelationshipClasses can have NavigationProperties.`);
817
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${classObj.name}.${propName} is invalid, because only EntityClasses, Mixins, and RelationshipClasses can have NavigationProperties.`);
809
818
  const navPropertyProps = this._parser.parseNavigationProperty(rawProperty);
810
819
  this.findSchemaItemSync(navPropertyProps.relationshipName);
811
820
  const navProp = classObj.createNavigationPropertySync(propName, navPropertyProps.relationshipName, navPropertyProps.direction);
@@ -857,7 +866,7 @@ export class SchemaReadHelper {
857
866
  // If custom attribute exist within the context and is referenced, validate the reference is defined in the container's schema
858
867
  if (caClass && caClass.key.schemaName !== container.schema.name &&
859
868
  !container.schema.getReferenceSync(caClass.key.schemaName)) {
860
- throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to load custom attribute ${caClass.fullName} from container ${container.fullName}, ${caClass.key.schemaName} reference not defined`);
869
+ throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to load custom attribute ${caClass.fullName} from container ${container.fullName}, ${caClass.key.schemaName} reference not defined`);
861
870
  }
862
871
  // Second tuple entry ia a function that provides the CA instance.
863
872
  const provider = providerTuple[1];