@itwin/core-backend 5.1.0-dev.9 → 5.2.0-dev.1

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 (441) hide show
  1. package/CHANGELOG.md +112 -1
  2. package/lib/cjs/BackendHubAccess.d.ts +1 -1
  3. package/lib/cjs/BackendHubAccess.js +1 -1
  4. package/lib/cjs/BackendHubAccess.js.map +1 -1
  5. package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
  6. package/lib/cjs/BisCoreSchema.js +4 -2
  7. package/lib/cjs/BisCoreSchema.js.map +1 -1
  8. package/lib/cjs/BriefcaseManager.d.ts +10 -2
  9. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  10. package/lib/cjs/BriefcaseManager.js +16 -0
  11. package/lib/cjs/BriefcaseManager.js.map +1 -1
  12. package/lib/cjs/Category.d.ts +4 -4
  13. package/lib/cjs/Category.js +4 -4
  14. package/lib/cjs/Category.js.map +1 -1
  15. package/lib/cjs/ChangesetECAdaptor.d.ts +67 -8
  16. package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
  17. package/lib/cjs/ChangesetECAdaptor.js +248 -33
  18. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  19. package/lib/cjs/ClassRegistry.d.ts +9 -1
  20. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  21. package/lib/cjs/ClassRegistry.js +9 -1
  22. package/lib/cjs/ClassRegistry.js.map +1 -1
  23. package/lib/cjs/CloudSqlite.js +1 -1
  24. package/lib/cjs/CloudSqlite.js.map +1 -1
  25. package/lib/cjs/CodeSpecs.d.ts +1 -1
  26. package/lib/cjs/CodeSpecs.js +1 -1
  27. package/lib/cjs/CodeSpecs.js.map +1 -1
  28. package/lib/cjs/DisplayStyle.d.ts +4 -4
  29. package/lib/cjs/DisplayStyle.js +3 -3
  30. package/lib/cjs/DisplayStyle.js.map +1 -1
  31. package/lib/cjs/ECDb.d.ts +4 -4
  32. package/lib/cjs/ECDb.d.ts.map +1 -1
  33. package/lib/cjs/ECDb.js +4 -4
  34. package/lib/cjs/ECDb.js.map +1 -1
  35. package/lib/cjs/ECSqlStatement.d.ts +15 -6
  36. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  37. package/lib/cjs/ECSqlStatement.js +19 -4
  38. package/lib/cjs/ECSqlStatement.js.map +1 -1
  39. package/lib/cjs/Element.d.ts +54 -51
  40. package/lib/cjs/Element.d.ts.map +1 -1
  41. package/lib/cjs/Element.js +67 -52
  42. package/lib/cjs/Element.js.map +1 -1
  43. package/lib/cjs/ElementAspect.d.ts +8 -8
  44. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  45. package/lib/cjs/ElementAspect.js +8 -8
  46. package/lib/cjs/ElementAspect.js.map +1 -1
  47. package/lib/cjs/Entity.d.ts +10 -7
  48. package/lib/cjs/Entity.d.ts.map +1 -1
  49. package/lib/cjs/Entity.js +35 -13
  50. package/lib/cjs/Entity.js.map +1 -1
  51. package/lib/cjs/ExportGraphics.d.ts +54 -8
  52. package/lib/cjs/ExportGraphics.d.ts.map +1 -1
  53. package/lib/cjs/ExportGraphics.js +158 -59
  54. package/lib/cjs/ExportGraphics.js.map +1 -1
  55. package/lib/cjs/GeographicCRSServices.d.ts +6 -2
  56. package/lib/cjs/GeographicCRSServices.d.ts.map +1 -1
  57. package/lib/cjs/GeographicCRSServices.js +1 -1
  58. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  59. package/lib/cjs/IModelDb.d.ts +37 -26
  60. package/lib/cjs/IModelDb.d.ts.map +1 -1
  61. package/lib/cjs/IModelDb.js +124 -47
  62. package/lib/cjs/IModelDb.js.map +1 -1
  63. package/lib/cjs/IModelElementCloneContext.d.ts +1 -1
  64. package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
  65. package/lib/cjs/IModelElementCloneContext.js +1 -1
  66. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  67. package/lib/cjs/IModelHost.d.ts +2 -3
  68. package/lib/cjs/IModelHost.d.ts.map +1 -1
  69. package/lib/cjs/IModelHost.js +2 -3
  70. package/lib/cjs/IModelHost.js.map +1 -1
  71. package/lib/cjs/IModelIncrementalSchemaLocater.d.ts +36 -0
  72. package/lib/cjs/IModelIncrementalSchemaLocater.d.ts.map +1 -0
  73. package/lib/cjs/IModelIncrementalSchemaLocater.js +69 -0
  74. package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -0
  75. package/lib/cjs/LocalHub.d.ts.map +1 -1
  76. package/lib/cjs/LocalHub.js +6 -4
  77. package/lib/cjs/LocalHub.js.map +1 -1
  78. package/lib/cjs/Material.d.ts +4 -3
  79. package/lib/cjs/Material.d.ts.map +1 -1
  80. package/lib/cjs/Material.js +5 -5
  81. package/lib/cjs/Material.js.map +1 -1
  82. package/lib/cjs/Model.d.ts +22 -22
  83. package/lib/cjs/Model.js +22 -22
  84. package/lib/cjs/Model.js.map +1 -1
  85. package/lib/cjs/Relationship.d.ts +3 -0
  86. package/lib/cjs/Relationship.d.ts.map +1 -1
  87. package/lib/cjs/Relationship.js +15 -0
  88. package/lib/cjs/Relationship.js.map +1 -1
  89. package/lib/cjs/SQLiteDb.d.ts +1 -1
  90. package/lib/cjs/SQLiteDb.js +1 -1
  91. package/lib/cjs/SQLiteDb.js.map +1 -1
  92. package/lib/cjs/Schema.d.ts +25 -0
  93. package/lib/cjs/Schema.d.ts.map +1 -1
  94. package/lib/cjs/Schema.js +25 -0
  95. package/lib/cjs/Schema.js.map +1 -1
  96. package/lib/cjs/SqliteStatement.d.ts +1 -1
  97. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  98. package/lib/cjs/SqliteStatement.js +1 -1
  99. package/lib/cjs/SqliteStatement.js.map +1 -1
  100. package/lib/cjs/Texture.d.ts +1 -1
  101. package/lib/cjs/Texture.js +1 -1
  102. package/lib/cjs/Texture.js.map +1 -1
  103. package/lib/cjs/TxnManager.d.ts +4 -4
  104. package/lib/cjs/TxnManager.js +1 -1
  105. package/lib/cjs/TxnManager.js.map +1 -1
  106. package/lib/cjs/ViewDefinition.d.ts +40 -14
  107. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  108. package/lib/cjs/ViewDefinition.js +42 -14
  109. package/lib/cjs/ViewDefinition.js.map +1 -1
  110. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +61 -0
  111. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
  112. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +110 -0
  113. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -0
  114. package/lib/cjs/annotations/FrameGeometry.d.ts +51 -0
  115. package/lib/cjs/annotations/FrameGeometry.d.ts.map +1 -0
  116. package/lib/cjs/annotations/FrameGeometry.js +249 -0
  117. package/lib/cjs/annotations/FrameGeometry.js.map +1 -0
  118. package/lib/cjs/annotations/LeaderGeometry.d.ts +53 -0
  119. package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -0
  120. package/lib/cjs/annotations/LeaderGeometry.js +184 -0
  121. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -0
  122. package/lib/cjs/annotations/TextAnnotationElement.d.ts +204 -0
  123. package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -0
  124. package/lib/cjs/annotations/TextAnnotationElement.js +411 -0
  125. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -0
  126. package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +33 -0
  127. package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -0
  128. package/lib/cjs/annotations/TextAnnotationGeometry.js +137 -0
  129. package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -0
  130. package/lib/cjs/annotations/TextBlockGeometry.d.ts +16 -0
  131. package/lib/cjs/annotations/TextBlockGeometry.d.ts.map +1 -0
  132. package/lib/cjs/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +28 -70
  133. package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -0
  134. package/lib/cjs/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +69 -22
  135. package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -0
  136. package/lib/cjs/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +174 -49
  137. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -0
  138. package/lib/cjs/core-backend.d.ts +7 -3
  139. package/lib/cjs/core-backend.d.ts.map +1 -1
  140. package/lib/cjs/core-backend.js +27 -6
  141. package/lib/cjs/core-backend.js.map +1 -1
  142. package/lib/cjs/internal/ElementLRUCache.d.ts +23 -0
  143. package/lib/cjs/internal/ElementLRUCache.d.ts.map +1 -1
  144. package/lib/cjs/internal/ElementLRUCache.js +167 -3
  145. package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
  146. package/lib/cjs/internal/Symbols.d.ts +1 -0
  147. package/lib/cjs/internal/Symbols.d.ts.map +1 -1
  148. package/lib/cjs/internal/Symbols.js +2 -1
  149. package/lib/cjs/internal/Symbols.js.map +1 -1
  150. package/lib/cjs/internal/annotations/fields.d.ts +22 -0
  151. package/lib/cjs/internal/annotations/fields.d.ts.map +1 -0
  152. package/lib/cjs/internal/annotations/fields.js +237 -0
  153. package/lib/cjs/internal/annotations/fields.js.map +1 -0
  154. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +1 -1
  155. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +1 -1
  156. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  157. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
  158. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  159. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
  160. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
  161. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  162. package/lib/cjs/workspace/Workspace.d.ts +0 -1
  163. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  164. package/lib/cjs/workspace/Workspace.js.map +1 -1
  165. package/lib/esm/BackendHubAccess.d.ts +1 -1
  166. package/lib/esm/BackendHubAccess.js +1 -1
  167. package/lib/esm/BackendHubAccess.js.map +1 -1
  168. package/lib/esm/BisCoreSchema.d.ts.map +1 -1
  169. package/lib/esm/BisCoreSchema.js +4 -2
  170. package/lib/esm/BisCoreSchema.js.map +1 -1
  171. package/lib/esm/BriefcaseManager.d.ts +10 -2
  172. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  173. package/lib/esm/BriefcaseManager.js +17 -1
  174. package/lib/esm/BriefcaseManager.js.map +1 -1
  175. package/lib/esm/Category.d.ts +4 -4
  176. package/lib/esm/Category.js +4 -4
  177. package/lib/esm/Category.js.map +1 -1
  178. package/lib/esm/ChangesetECAdaptor.d.ts +67 -8
  179. package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
  180. package/lib/esm/ChangesetECAdaptor.js +248 -33
  181. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  182. package/lib/esm/ClassRegistry.d.ts +9 -1
  183. package/lib/esm/ClassRegistry.d.ts.map +1 -1
  184. package/lib/esm/ClassRegistry.js +9 -1
  185. package/lib/esm/ClassRegistry.js.map +1 -1
  186. package/lib/esm/CloudSqlite.js +1 -1
  187. package/lib/esm/CloudSqlite.js.map +1 -1
  188. package/lib/esm/CodeSpecs.d.ts +1 -1
  189. package/lib/esm/CodeSpecs.js +1 -1
  190. package/lib/esm/CodeSpecs.js.map +1 -1
  191. package/lib/esm/DisplayStyle.d.ts +4 -4
  192. package/lib/esm/DisplayStyle.js +3 -3
  193. package/lib/esm/DisplayStyle.js.map +1 -1
  194. package/lib/esm/ECDb.d.ts +4 -4
  195. package/lib/esm/ECDb.d.ts.map +1 -1
  196. package/lib/esm/ECDb.js +4 -4
  197. package/lib/esm/ECDb.js.map +1 -1
  198. package/lib/esm/ECSqlStatement.d.ts +15 -6
  199. package/lib/esm/ECSqlStatement.d.ts.map +1 -1
  200. package/lib/esm/ECSqlStatement.js +19 -4
  201. package/lib/esm/ECSqlStatement.js.map +1 -1
  202. package/lib/esm/Element.d.ts +54 -51
  203. package/lib/esm/Element.d.ts.map +1 -1
  204. package/lib/esm/Element.js +67 -52
  205. package/lib/esm/Element.js.map +1 -1
  206. package/lib/esm/ElementAspect.d.ts +8 -8
  207. package/lib/esm/ElementAspect.d.ts.map +1 -1
  208. package/lib/esm/ElementAspect.js +8 -8
  209. package/lib/esm/ElementAspect.js.map +1 -1
  210. package/lib/esm/Entity.d.ts +10 -7
  211. package/lib/esm/Entity.d.ts.map +1 -1
  212. package/lib/esm/Entity.js +36 -14
  213. package/lib/esm/Entity.js.map +1 -1
  214. package/lib/esm/ExportGraphics.d.ts +54 -8
  215. package/lib/esm/ExportGraphics.d.ts.map +1 -1
  216. package/lib/esm/ExportGraphics.js +156 -58
  217. package/lib/esm/ExportGraphics.js.map +1 -1
  218. package/lib/esm/GeographicCRSServices.d.ts +6 -2
  219. package/lib/esm/GeographicCRSServices.d.ts.map +1 -1
  220. package/lib/esm/GeographicCRSServices.js +1 -1
  221. package/lib/esm/GeographicCRSServices.js.map +1 -1
  222. package/lib/esm/IModelDb.d.ts +37 -26
  223. package/lib/esm/IModelDb.d.ts.map +1 -1
  224. package/lib/esm/IModelDb.js +128 -51
  225. package/lib/esm/IModelDb.js.map +1 -1
  226. package/lib/esm/IModelElementCloneContext.d.ts +1 -1
  227. package/lib/esm/IModelElementCloneContext.d.ts.map +1 -1
  228. package/lib/esm/IModelElementCloneContext.js +1 -1
  229. package/lib/esm/IModelElementCloneContext.js.map +1 -1
  230. package/lib/esm/IModelHost.d.ts +2 -3
  231. package/lib/esm/IModelHost.d.ts.map +1 -1
  232. package/lib/esm/IModelHost.js +2 -3
  233. package/lib/esm/IModelHost.js.map +1 -1
  234. package/lib/esm/IModelIncrementalSchemaLocater.d.ts +36 -0
  235. package/lib/esm/IModelIncrementalSchemaLocater.d.ts.map +1 -0
  236. package/lib/esm/IModelIncrementalSchemaLocater.js +65 -0
  237. package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -0
  238. package/lib/esm/LocalHub.d.ts.map +1 -1
  239. package/lib/esm/LocalHub.js +6 -4
  240. package/lib/esm/LocalHub.js.map +1 -1
  241. package/lib/esm/Material.d.ts +4 -3
  242. package/lib/esm/Material.d.ts.map +1 -1
  243. package/lib/esm/Material.js +5 -5
  244. package/lib/esm/Material.js.map +1 -1
  245. package/lib/esm/Model.d.ts +22 -22
  246. package/lib/esm/Model.js +22 -22
  247. package/lib/esm/Model.js.map +1 -1
  248. package/lib/esm/Relationship.d.ts +3 -0
  249. package/lib/esm/Relationship.d.ts.map +1 -1
  250. package/lib/esm/Relationship.js +15 -0
  251. package/lib/esm/Relationship.js.map +1 -1
  252. package/lib/esm/SQLiteDb.d.ts +1 -1
  253. package/lib/esm/SQLiteDb.js +1 -1
  254. package/lib/esm/SQLiteDb.js.map +1 -1
  255. package/lib/esm/Schema.d.ts +25 -0
  256. package/lib/esm/Schema.d.ts.map +1 -1
  257. package/lib/esm/Schema.js +25 -0
  258. package/lib/esm/Schema.js.map +1 -1
  259. package/lib/esm/SqliteStatement.d.ts +1 -1
  260. package/lib/esm/SqliteStatement.d.ts.map +1 -1
  261. package/lib/esm/SqliteStatement.js +1 -1
  262. package/lib/esm/SqliteStatement.js.map +1 -1
  263. package/lib/esm/Texture.d.ts +1 -1
  264. package/lib/esm/Texture.js +1 -1
  265. package/lib/esm/Texture.js.map +1 -1
  266. package/lib/esm/TxnManager.d.ts +4 -4
  267. package/lib/esm/TxnManager.js +1 -1
  268. package/lib/esm/TxnManager.js.map +1 -1
  269. package/lib/esm/ViewDefinition.d.ts +40 -14
  270. package/lib/esm/ViewDefinition.d.ts.map +1 -1
  271. package/lib/esm/ViewDefinition.js +42 -14
  272. package/lib/esm/ViewDefinition.js.map +1 -1
  273. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +61 -0
  274. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
  275. package/lib/esm/annotations/ElementDrivesTextAnnotation.js +105 -0
  276. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -0
  277. package/lib/esm/annotations/FrameGeometry.d.ts +51 -0
  278. package/lib/esm/annotations/FrameGeometry.d.ts.map +1 -0
  279. package/lib/esm/annotations/FrameGeometry.js +244 -0
  280. package/lib/esm/annotations/FrameGeometry.js.map +1 -0
  281. package/lib/esm/annotations/LeaderGeometry.d.ts +53 -0
  282. package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -0
  283. package/lib/esm/annotations/LeaderGeometry.js +179 -0
  284. package/lib/esm/annotations/LeaderGeometry.js.map +1 -0
  285. package/lib/esm/annotations/TextAnnotationElement.d.ts +204 -0
  286. package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -0
  287. package/lib/esm/annotations/TextAnnotationElement.js +405 -0
  288. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -0
  289. package/lib/esm/annotations/TextAnnotationGeometry.d.ts +33 -0
  290. package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -0
  291. package/lib/esm/annotations/TextAnnotationGeometry.js +134 -0
  292. package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -0
  293. package/lib/esm/annotations/TextBlockGeometry.d.ts +16 -0
  294. package/lib/esm/annotations/TextBlockGeometry.d.ts.map +1 -0
  295. package/lib/esm/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +28 -70
  296. package/lib/esm/annotations/TextBlockGeometry.js.map +1 -0
  297. package/lib/esm/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +69 -22
  298. package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -0
  299. package/lib/esm/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +172 -48
  300. package/lib/esm/annotations/TextBlockLayout.js.map +1 -0
  301. package/lib/esm/core-backend.d.ts +7 -3
  302. package/lib/esm/core-backend.d.ts.map +1 -1
  303. package/lib/esm/core-backend.js +27 -3
  304. package/lib/esm/core-backend.js.map +1 -1
  305. package/lib/esm/internal/ElementLRUCache.d.ts +23 -0
  306. package/lib/esm/internal/ElementLRUCache.d.ts.map +1 -1
  307. package/lib/esm/internal/ElementLRUCache.js +165 -2
  308. package/lib/esm/internal/ElementLRUCache.js.map +1 -1
  309. package/lib/esm/internal/Symbols.d.ts +1 -0
  310. package/lib/esm/internal/Symbols.d.ts.map +1 -1
  311. package/lib/esm/internal/Symbols.js +1 -0
  312. package/lib/esm/internal/Symbols.js.map +1 -1
  313. package/lib/esm/internal/annotations/fields.d.ts +22 -0
  314. package/lib/esm/internal/annotations/fields.d.ts.map +1 -0
  315. package/lib/esm/internal/annotations/fields.js +231 -0
  316. package/lib/esm/internal/annotations/fields.js.map +1 -0
  317. package/lib/esm/rpc-impl/IModelReadRpcImpl.d.ts +1 -1
  318. package/lib/esm/rpc-impl/IModelReadRpcImpl.js +1 -1
  319. package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  320. package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
  321. package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  322. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
  323. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
  324. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  325. package/lib/esm/test/AnnotationTestUtils.d.ts +15 -0
  326. package/lib/esm/test/AnnotationTestUtils.d.ts.map +1 -0
  327. package/lib/esm/test/AnnotationTestUtils.js +41 -0
  328. package/lib/esm/test/AnnotationTestUtils.js.map +1 -0
  329. package/lib/esm/test/ElementLRUCache.test.js +224 -1
  330. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  331. package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
  332. package/lib/esm/test/IModelTestUtils.js +1 -0
  333. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  334. package/lib/esm/test/TestUtils.d.ts +1 -1
  335. package/lib/esm/test/TestUtils.d.ts.map +1 -1
  336. package/lib/esm/test/TestUtils.js +1 -1
  337. package/lib/esm/test/TestUtils.js.map +1 -1
  338. package/lib/esm/test/annotations/Fields.test.d.ts +2 -0
  339. package/lib/esm/test/annotations/Fields.test.d.ts.map +1 -0
  340. package/lib/esm/test/annotations/Fields.test.js +576 -0
  341. package/lib/esm/test/annotations/Fields.test.js.map +1 -0
  342. package/lib/esm/test/annotations/FrameGeometry.test.d.ts +2 -0
  343. package/lib/esm/test/annotations/FrameGeometry.test.d.ts.map +1 -0
  344. package/lib/esm/test/annotations/FrameGeometry.test.js +86 -0
  345. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -0
  346. package/lib/esm/test/annotations/LeaderGeometry.test.d.ts +2 -0
  347. package/lib/esm/test/annotations/LeaderGeometry.test.d.ts.map +1 -0
  348. package/lib/esm/test/annotations/LeaderGeometry.test.js +256 -0
  349. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -0
  350. package/lib/esm/test/annotations/TextAnnotation.test.js +269 -1047
  351. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  352. package/lib/esm/test/annotations/TextBlock.test.d.ts +2 -0
  353. package/lib/esm/test/annotations/TextBlock.test.d.ts.map +1 -0
  354. package/lib/esm/test/annotations/TextBlock.test.js +1199 -0
  355. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -0
  356. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.d.ts +60 -0
  357. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.d.ts.map +1 -0
  358. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js +69 -0
  359. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -0
  360. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts +1442 -0
  361. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts.map +1 -0
  362. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js +817 -0
  363. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -0
  364. package/lib/esm/test/ecdb/ConcurrentQuery.test.d.ts +2 -0
  365. package/lib/esm/test/ecdb/ConcurrentQuery.test.d.ts.map +1 -0
  366. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +164 -0
  367. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -0
  368. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +22 -32
  369. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
  370. package/lib/esm/test/ecdb/ECDb.test.js +29 -8
  371. package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
  372. package/lib/esm/test/ecdb/ECSqlQuery.test.js +0 -55
  373. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  374. package/lib/esm/test/ecdb/ECSqlStatement.test.js +192 -0
  375. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  376. package/lib/esm/test/hubaccess/ApplyChangeset.test.d.ts +2 -0
  377. package/lib/esm/test/hubaccess/ApplyChangeset.test.d.ts.map +1 -0
  378. package/lib/esm/test/hubaccess/ApplyChangeset.test.js +86 -0
  379. package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -0
  380. package/lib/esm/test/imodel/IModel.test.js +313 -5
  381. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  382. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.d.ts +2 -0
  383. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.d.ts.map +1 -0
  384. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js +343 -0
  385. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -0
  386. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.d.ts +2 -0
  387. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.d.ts.map +1 -0
  388. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js +207 -0
  389. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -0
  390. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts +11 -0
  391. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts.map +1 -0
  392. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js +36 -0
  393. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +1 -0
  394. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts +17 -0
  395. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts.map +1 -0
  396. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js +116 -0
  397. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +1 -0
  398. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts +9 -0
  399. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts.map +1 -0
  400. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js +20 -0
  401. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +1 -0
  402. package/lib/esm/test/misc/GeoServices.test.js +36 -10
  403. package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
  404. package/lib/esm/test/schema/ClassRegistry.test.js +104 -2
  405. package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
  406. package/lib/esm/test/standalone/ChangesetReader.test.js +547 -136
  407. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  408. package/lib/esm/test/standalone/ExportGraphics.test.js +53 -1
  409. package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
  410. package/lib/esm/test/standalone/GeometryStream.test.js +49 -1
  411. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  412. package/lib/esm/test/standalone/IModelLimits.test.d.ts +2 -0
  413. package/lib/esm/test/standalone/IModelLimits.test.d.ts.map +1 -0
  414. package/lib/esm/test/standalone/IModelLimits.test.js +103 -0
  415. package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -0
  416. package/lib/esm/test/standalone/RenderMaterialElement.test.js +24 -1
  417. package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
  418. package/lib/esm/test/standalone/SnapshotDb.test.js +19 -1
  419. package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
  420. package/lib/esm/workspace/Workspace.d.ts +0 -1
  421. package/lib/esm/workspace/Workspace.d.ts.map +1 -1
  422. package/lib/esm/workspace/Workspace.js.map +1 -1
  423. package/package.json +21 -15
  424. package/lib/cjs/TextAnnotationElement.d.ts +0 -54
  425. package/lib/cjs/TextAnnotationElement.d.ts.map +0 -1
  426. package/lib/cjs/TextAnnotationElement.js +0 -94
  427. package/lib/cjs/TextAnnotationElement.js.map +0 -1
  428. package/lib/cjs/TextAnnotationGeometry.d.ts +0 -32
  429. package/lib/cjs/TextAnnotationGeometry.d.ts.map +0 -1
  430. package/lib/cjs/TextAnnotationGeometry.js.map +0 -1
  431. package/lib/cjs/TextAnnotationLayout.d.ts.map +0 -1
  432. package/lib/cjs/TextAnnotationLayout.js.map +0 -1
  433. package/lib/esm/TextAnnotationElement.d.ts +0 -54
  434. package/lib/esm/TextAnnotationElement.d.ts.map +0 -1
  435. package/lib/esm/TextAnnotationElement.js +0 -89
  436. package/lib/esm/TextAnnotationElement.js.map +0 -1
  437. package/lib/esm/TextAnnotationGeometry.d.ts +0 -32
  438. package/lib/esm/TextAnnotationGeometry.d.ts.map +0 -1
  439. package/lib/esm/TextAnnotationGeometry.js.map +0 -1
  440. package/lib/esm/TextAnnotationLayout.d.ts.map +0 -1
  441. package/lib/esm/TextAnnotationLayout.js.map +0 -1
@@ -9,7 +9,7 @@ import * as fs from "fs";
9
9
  import { join } from "path";
10
10
  import * as touch from "touch";
11
11
  import { assert, BeEvent, BentleyStatus, ChangeSetStatus, DbChangeStage, DbConflictCause, DbConflictResolution, DbResult, Guid, Id64, IModelStatus, JsonUtils, Logger, LogLevel, LRUMap, OpenMode } from "@itwin/core-bentley";
12
- import { BriefcaseIdValue, Code, DomainOptions, ECJsNames, ECSqlReader, EntityMetaData, FontMap, IModel, IModelError, IModelNotFoundResponse, ProfileOptions, QueryRowFormat, SchemaState, ViewStoreRpc } from "@itwin/core-common";
12
+ import { BriefcaseIdValue, Code, DomainOptions, ECJsNames, ECSqlReader, EntityMetaData, FontMap, IModel, IModelError, IModelNotFoundResponse, ProfileOptions, QueryRowFormat, SchemaState, ViewStoreError, ViewStoreRpc } from "@itwin/core-common";
13
13
  import { Range2d, Range3d } from "@itwin/core-geometry";
14
14
  import { BackendLoggerCategory } from "./BackendLoggerCategory";
15
15
  import { BriefcaseManager } from "./BriefcaseManager";
@@ -44,10 +44,10 @@ import { SettingsImpl } from "./internal/workspace/SettingsImpl";
44
44
  import { IModelNative } from "./internal/NativePlatform";
45
45
  import { createNoOpLockControl } from "./internal/NoLocks";
46
46
  import { createIModelDbFonts } from "./internal/IModelDbFontsImpl";
47
- import { _cache, _close, _hubAccess, _nativeDb, _releaseAllLocks } from "./internal/Symbols";
48
- import { SchemaContext, SchemaJsonLocater } from "@itwin/ecschema-metadata";
47
+ import { _cache, _close, _hubAccess, _instanceKeyCache, _nativeDb, _releaseAllLocks } from "./internal/Symbols";
48
+ import { ECVersion, SchemaContext, SchemaJsonLocater } from "@itwin/ecschema-metadata";
49
49
  import { SchemaMap } from "./Schema";
50
- import { ElementLRUCache } from "./internal/ElementLRUCache";
50
+ import { ElementLRUCache, InstanceKeyLRUCache } from "./internal/ElementLRUCache";
51
51
  // spell:ignore fontid fontmap
52
52
  const loggerCategory = BackendLoggerCategory.IModelDb;
53
53
  /** @internal */
@@ -107,7 +107,7 @@ export class IModelDb extends IModel {
107
107
  _jsClassMap;
108
108
  _schemaMap;
109
109
  _schemaContext;
110
- /** @deprecated in 5.0.0. Use [[fonts]]. */
110
+ /** @deprecated in 5.0.0 - will not be removed until after 2026-06-13. Use [[fonts]]. */
111
111
  _fontMap; // eslint-disable-line @typescript-eslint/no-deprecated
112
112
  _fonts = createIModelDbFonts(this);
113
113
  _workspace;
@@ -163,7 +163,7 @@ export class IModelDb extends IModel {
163
163
  restartDefaultTxn() {
164
164
  this[_nativeDb].restartDefaultTxn();
165
165
  }
166
- /** @deprecated in 5.0.0. Use [[fonts]]. */
166
+ /** @deprecated in 5.0.0 - will not be removed until after 2026-06-13. Use [[fonts]]. */
167
167
  get fontMap() {
168
168
  return this._fontMap ?? (this._fontMap = new FontMap(this[_nativeDb].readFontMap())); // eslint-disable-line @typescript-eslint/no-deprecated
169
169
  }
@@ -340,7 +340,7 @@ export class IModelDb extends IModel {
340
340
  * @returns the value returned by `callback`.
341
341
  * @see [[withStatement]]
342
342
  * @public
343
- * @deprecated in 4.11. Use [[createQueryReader]] instead.
343
+ * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [[createQueryReader]] instead.
344
344
  */
345
345
  // eslint-disable-next-line @typescript-eslint/no-deprecated
346
346
  withPreparedStatement(ecsql, callback, logErrors = true) {
@@ -372,7 +372,7 @@ export class IModelDb extends IModel {
372
372
  * @returns the value returned by `callback`.
373
373
  * @see [[withPreparedStatement]]
374
374
  * @public
375
- * @deprecated in 4.11. Use [[createQueryReader]] instead.
375
+ * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [[createQueryReader]] instead.
376
376
  */
377
377
  // eslint-disable-next-line @typescript-eslint/no-deprecated
378
378
  withStatement(ecsql, callback, logErrors = true) {
@@ -579,6 +579,8 @@ export class IModelDb extends IModel {
579
579
  this._schemaContext = undefined;
580
580
  this.elements[_cache].clear();
581
581
  this.models[_cache].clear();
582
+ this.elements[_instanceKeyCache].clear();
583
+ this.models[_instanceKeyCache].clear();
582
584
  }
583
585
  /** Update the project extents for this iModel.
584
586
  * <p><em>Example:</em>
@@ -634,6 +636,7 @@ export class IModelDb extends IModel {
634
636
  * @note This will not delete Txns that have already been saved, even if they have not yet been pushed.
635
637
  */
636
638
  abandonChanges() {
639
+ this.clearCaches();
637
640
  this[_nativeDb].abandonChanges();
638
641
  }
639
642
  /**
@@ -647,11 +650,14 @@ export class IModelDb extends IModel {
647
650
  performCheckpoint() {
648
651
  if (!this.isReadonly) {
649
652
  this.saveChanges();
653
+ this.clearCaches();
654
+ this[_nativeDb].concurrentQueryShutdown();
655
+ this[_nativeDb].clearECDbCache();
650
656
  this[_nativeDb].performCheckpoint();
651
657
  }
652
658
  }
653
659
  /** @internal
654
- * @deprecated in 4.8. Use `txns.reverseTxns`.
660
+ * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use `txns.reverseTxns`.
655
661
  */
656
662
  reverseTxns(numOperations) {
657
663
  return this[_nativeDb].reverseTxns(numOperations);
@@ -877,7 +883,7 @@ export class IModelDb extends IModel {
877
883
  }
878
884
  /** The registry of entity metadata for this iModel.
879
885
  * @internal
880
- * @deprecated in 5.0. Please use `schemaContext` from the `iModel` instead.
886
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `schemaContext` from the `iModel` instead.
881
887
  *
882
888
  * @example
883
889
  * ```typescript
@@ -937,7 +943,7 @@ export class IModelDb extends IModel {
937
943
  * @param sql The ECSQL statement to prepare
938
944
  * @param logErrors Determines if error will be logged if statement fail to prepare
939
945
  * @throws [[IModelError]] if there is a problem preparing the statement.
940
- * @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
946
+ * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
941
947
  */
942
948
  // eslint-disable-next-line @typescript-eslint/no-deprecated
943
949
  prepareStatement(sql, logErrors = true) {
@@ -949,7 +955,7 @@ export class IModelDb extends IModel {
949
955
  /** Prepare an ECSQL statement.
950
956
  * @param sql The ECSQL statement to prepare
951
957
  * @returns `undefined` if there is a problem preparing the statement.
952
- * @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
958
+ * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
953
959
  */
954
960
  // eslint-disable-next-line @typescript-eslint/no-deprecated
955
961
  tryPrepareStatement(sql) {
@@ -999,7 +1005,7 @@ export class IModelDb extends IModel {
999
1005
  }
1000
1006
  /** Get metadata for a class. This method will load the metadata from the iModel into the cache as a side-effect, if necessary.
1001
1007
  * @throws [[IModelError]] if the metadata cannot be found nor loaded.
1002
- * @deprecated in 5.0. Please use `getSchemaItem` from `SchemaContext` class instead.
1008
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `getSchemaItem` from `SchemaContext` class instead.
1003
1009
  *
1004
1010
  * @example
1005
1011
  * * ```typescript
@@ -1025,7 +1031,7 @@ export class IModelDb extends IModel {
1025
1031
  return metadata;
1026
1032
  }
1027
1033
  /** Identical to [[getMetaData]], except it returns `undefined` instead of throwing an error if the metadata cannot be found nor loaded.
1028
- * @deprecated in 5.0. Please use `getSchemaItem` from `SchemaContext` class instead.
1034
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `getSchemaItem` from `SchemaContext` class instead.
1029
1035
  *
1030
1036
  * @example
1031
1037
  * * ```typescript
@@ -1053,7 +1059,7 @@ export class IModelDb extends IModel {
1053
1059
  * @param func The callback to be invoked on each property
1054
1060
  * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
1055
1061
  * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
1056
- * @deprecated in 5.0. Please use `forEachProperty` instead.
1062
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `forEachProperty` instead.
1057
1063
  *
1058
1064
  * @example
1059
1065
  * ```typescript
@@ -1079,7 +1085,7 @@ export class IModelDb extends IModel {
1079
1085
  * @param func The callback to be invoked on each property
1080
1086
  * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
1081
1087
  * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
1082
- * @deprecated in 5.0. Use `forEachProperty` from `SchemaContext` class instead.
1088
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `forEachProperty` from `SchemaContext` class instead.
1083
1089
  *
1084
1090
  * @example
1085
1091
  * ```typescript
@@ -1109,7 +1115,7 @@ export class IModelDb extends IModel {
1109
1115
  }
1110
1116
  /**
1111
1117
  * @internal
1112
- * @deprecated in 5.0. Please use `schemaContext` from `iModel` instead to get metadata.
1118
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `schemaContext` from `iModel` instead to get metadata.
1113
1119
  */
1114
1120
  loadMetaData(classFullName) {
1115
1121
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -1149,19 +1155,26 @@ export class IModelDb extends IModel {
1149
1155
  const classNameParts = classFullName.replace(".", ":").split(":");
1150
1156
  return classNameParts.length === 2 && this[_nativeDb].getECClassMetaData(classNameParts[0], classNameParts[1]).error === undefined;
1151
1157
  }
1152
- /** Query for a schema of the specified name in this iModel.
1158
+ /** Query the version of a schema of the specified name in this iModel.
1153
1159
  * @returns The schema version as a semver-compatible string or `undefined` if the schema has not been imported.
1154
1160
  */
1155
1161
  querySchemaVersion(schemaName) {
1162
+ const version = this.querySchemaVersionNumbers(schemaName);
1163
+ return version?.toString(false);
1164
+ }
1165
+ /** Query the version of a schema of the specified name in this iModel.
1166
+ * @returns the version numbers, or `undefined` if the schema has not been imported.
1167
+ */
1168
+ querySchemaVersionNumbers(schemaName) {
1156
1169
  const sql = `SELECT VersionMajor,VersionWrite,VersionMinor FROM ECDbMeta.ECSchemaDef WHERE Name=:schemaName LIMIT 1`;
1157
1170
  // eslint-disable-next-line @typescript-eslint/no-deprecated
1158
1171
  return this.withPreparedStatement(sql, (statement) => {
1159
1172
  statement.bindString("schemaName", schemaName);
1160
1173
  if (DbResult.BE_SQLITE_ROW === statement.step()) {
1161
- const versionMajor = statement.getValue(0).getInteger(); // ECSchemaDef.VersionMajor --> semver.major
1162
- const versionWrite = statement.getValue(1).getInteger(); // ECSchemaDef.VersionWrite --> semver.minor
1163
- const versionMinor = statement.getValue(2).getInteger(); // ECSchemaDef.VersionMinor --> semver.patch
1164
- return `${versionMajor}.${versionWrite}.${versionMinor}`;
1174
+ const read = statement.getValue(0).getInteger(); // ECSchemaDef.VersionMajor --> semver.major
1175
+ const write = statement.getValue(1).getInteger(); // ECSchemaDef.VersionWrite --> semver.minor
1176
+ const minor = statement.getValue(2).getInteger(); // ECSchemaDef.VersionMinor --> semver.patch
1177
+ return new ECVersion(read, write, minor);
1165
1178
  }
1166
1179
  return undefined;
1167
1180
  });
@@ -1240,11 +1253,21 @@ export class IModelDb extends IModel {
1240
1253
  }
1241
1254
  /** Get the IModel coordinate corresponding to each GeoCoordinate point in the input */
1242
1255
  async getIModelCoordinatesFromGeoCoordinates(props) {
1243
- return this[_nativeDb].getIModelCoordinatesFromGeoCoordinates(props);
1256
+ const response = this[_nativeDb].getIModelCoordinatesFromGeoCoordinates(props);
1257
+ // fromCache is only meaningful on the front-end; provide it for compatibility with return type.
1258
+ response.fromCache = 0;
1259
+ // Native omits the array if the input was empty.
1260
+ response.iModelCoords = response.iModelCoords ?? [];
1261
+ return response;
1244
1262
  }
1245
1263
  /** Get the GeoCoordinate (longitude, latitude, elevation) corresponding to each IModel Coordinate point in the input */
1246
1264
  async getGeoCoordinatesFromIModelCoordinates(props) {
1247
- return this[_nativeDb].getGeoCoordinatesFromIModelCoordinates(props);
1265
+ const response = this[_nativeDb].getGeoCoordinatesFromIModelCoordinates(props);
1266
+ // fromCache is only meaningful on the front-end; provide it for compatibility with return type.
1267
+ response.fromCache = 0;
1268
+ // Native omits the array if the input was empty.
1269
+ response.geoCoords = response.geoCoords ?? [];
1270
+ return response;
1248
1271
  }
1249
1272
  /** Export meshes suitable for graphics APIs from arbitrary geometry in elements in this IModelDb.
1250
1273
  * * Requests can be slow when processing many elements so it is expected that this function be used on a dedicated backend,
@@ -1474,7 +1497,7 @@ function processSchemaWriteStatus(status) {
1474
1497
  /** @public */
1475
1498
  (function (IModelDb) {
1476
1499
  /** The collection of models in an [[IModelDb]].
1477
- * @public
1500
+ * @public @preview
1478
1501
  */
1479
1502
  class Models {
1480
1503
  _iModel;
@@ -1482,6 +1505,8 @@ function processSchemaWriteStatus(status) {
1482
1505
  /** @internal */
1483
1506
  [_cache] = new LRUMap(this._modelCacheSize);
1484
1507
  /** @internal */
1508
+ [_instanceKeyCache] = new InstanceKeyLRUCache(this._modelCacheSize);
1509
+ /** @internal */
1485
1510
  constructor(_iModel) {
1486
1511
  this._iModel = _iModel;
1487
1512
  }
@@ -1584,7 +1609,16 @@ function processSchemaWriteStatus(status) {
1584
1609
  else {
1585
1610
  throw new IModelError(IModelStatus.InvalidId, `Invalid model identifier: ${JSON.stringify(modelIdArg)}`);
1586
1611
  }
1587
- return this._iModel[_nativeDb].resolveInstanceKey(args);
1612
+ // Check the cache to avoid unnecessary native calls
1613
+ const cachedResult = this[_instanceKeyCache].get(args);
1614
+ if (cachedResult) {
1615
+ return cachedResult;
1616
+ }
1617
+ else {
1618
+ const instanceKey = this._iModel[_nativeDb].resolveInstanceKey(args);
1619
+ this[_instanceKeyCache].set(args, instanceKey);
1620
+ return instanceKey;
1621
+ }
1588
1622
  }
1589
1623
  /** Get the sub-model of the specified Element.
1590
1624
  * See [[IModelDb.Elements.queryElementIdByCode]] for more on how to find an element by Code.
@@ -1628,7 +1662,9 @@ function processSchemaWriteStatus(status) {
1628
1662
  return props.id = this._iModel[_nativeDb].insertModel(props);
1629
1663
  }
1630
1664
  catch (err) {
1631
- throw new IModelError(err.errorNumber, `Error inserting model [${err.message}], class=${props.classFullName}`);
1665
+ const error = new IModelError(err.errorNumber, `Error inserting model [${err.message}], class=${props.classFullName}`);
1666
+ error.cause = err;
1667
+ throw error;
1632
1668
  }
1633
1669
  }
1634
1670
  /** Update an existing model.
@@ -1642,7 +1678,9 @@ function processSchemaWriteStatus(status) {
1642
1678
  this._iModel[_nativeDb].updateModel(props);
1643
1679
  }
1644
1680
  catch (err) {
1645
- throw new IModelError(err.errorNumber, `error updating model [${err.message}] id=${props.id}`);
1681
+ const error = new IModelError(err.errorNumber, `Error updating model [${err.message}], id: ${props.id}`);
1682
+ error.cause = err;
1683
+ throw error;
1646
1684
  }
1647
1685
  }
1648
1686
  /** Mark the geometry of [[GeometricModel]] as having changed, by recording an indirect change to its GeometryGuid property.
@@ -1658,7 +1696,7 @@ function processSchemaWriteStatus(status) {
1658
1696
  this._iModel.models[_cache].delete(modelId);
1659
1697
  const error = this._iModel[_nativeDb].updateModelGeometryGuid(modelId);
1660
1698
  if (error !== IModelStatus.Success)
1661
- throw new IModelError(error, `updating geometry guid for model ${modelId}`);
1699
+ throw new IModelError(error, `Error updating geometry guid for model ${modelId}`);
1662
1700
  }
1663
1701
  /** Delete one or more existing models.
1664
1702
  * @param ids The Ids of the models to be deleted
@@ -1668,10 +1706,13 @@ function processSchemaWriteStatus(status) {
1668
1706
  Id64.toIdSet(ids).forEach((id) => {
1669
1707
  try {
1670
1708
  this[_cache].delete(id);
1709
+ this[_instanceKeyCache].deleteById(id);
1671
1710
  this._iModel[_nativeDb].deleteModel(id);
1672
1711
  }
1673
1712
  catch (err) {
1674
- throw new IModelError(err.errorNumber, `error deleting model [${err.message}] id ${id}`);
1713
+ const error = new IModelError(err.errorNumber, `Error deleting model [${err.message}], id: ${id}`);
1714
+ error.cause = err;
1715
+ throw error;
1675
1716
  }
1676
1717
  });
1677
1718
  }
@@ -1701,7 +1742,7 @@ function processSchemaWriteStatus(status) {
1701
1742
  }
1702
1743
  IModelDb.Models = Models;
1703
1744
  /** The collection of elements in an [[IModelDb]].
1704
- * @public
1745
+ * @public @preview
1705
1746
  */
1706
1747
  class Elements {
1707
1748
  _iModel;
@@ -1709,6 +1750,8 @@ function processSchemaWriteStatus(status) {
1709
1750
  /** @internal */
1710
1751
  [_cache] = new ElementLRUCache(this._elementCacheSize);
1711
1752
  /** @internal */
1753
+ [_instanceKeyCache] = new InstanceKeyLRUCache(this._elementCacheSize);
1754
+ /** @internal */
1712
1755
  constructor(_iModel) {
1713
1756
  this._iModel = _iModel;
1714
1757
  }
@@ -1757,7 +1800,16 @@ function processSchemaWriteStatus(status) {
1757
1800
  throw new IModelError(IModelStatus.InvalidId, "Element Id or FederationGuid or Code is required");
1758
1801
  }
1759
1802
  }
1760
- return this._iModel[_nativeDb].resolveInstanceKey(args);
1803
+ // Check the cache to avoid unnecessary native calls
1804
+ const cachedResult = this[_instanceKeyCache].get(args);
1805
+ if (cachedResult) {
1806
+ return cachedResult;
1807
+ }
1808
+ else {
1809
+ const instanceKey = this._iModel[_nativeDb].resolveInstanceKey(args);
1810
+ this[_instanceKeyCache].set(args, instanceKey);
1811
+ return instanceKey;
1812
+ }
1761
1813
  }
1762
1814
  /** Get properties of an Element by Id, FederationGuid, or Code
1763
1815
  * @returns The properties of the element or `undefined` if the element is not found.
@@ -1804,7 +1856,7 @@ function processSchemaWriteStatus(status) {
1804
1856
  if (typeof elementId === "string" || elementId instanceof Code)
1805
1857
  throw new IModelError(IModelStatus.NotFound, `Element=${elementId}`);
1806
1858
  else
1807
- throw new IModelError(IModelStatus.NotFound, `Element={id: ${elementId.id} federationGuid: ${elementId.federationGuid}, code: ${elementId.code}}`);
1859
+ throw new IModelError(IModelStatus.NotFound, `Element={id: ${elementId.id} federationGuid: ${elementId.federationGuid}, code={spec: ${elementId.code?.spec}, scope: ${elementId.code?.scope}, value: ${elementId.code?.value}}}`);
1808
1860
  }
1809
1861
  return element;
1810
1862
  }
@@ -1847,15 +1899,16 @@ function processSchemaWriteStatus(status) {
1847
1899
  throw new IModelError(IModelStatus.InvalidCodeSpec, "Invalid CodeSpec");
1848
1900
  if (code.value === undefined)
1849
1901
  throw new IModelError(IModelStatus.InvalidCode, "Invalid Code");
1850
- // eslint-disable-next-line @typescript-eslint/no-deprecated
1851
- return this._iModel.withPreparedStatement("SELECT ECInstanceId FROM BisCore:Element WHERE CodeSpec.Id=? AND CodeScope.Id=? AND CodeValue=?", (stmt) => {
1852
- stmt.bindId(1, code.spec);
1853
- stmt.bindId(2, Id64.fromString(code.scope));
1854
- stmt.bindString(3, code.value);
1855
- if (DbResult.BE_SQLITE_ROW !== stmt.step())
1902
+ const codeToQuery = new Code(code);
1903
+ try {
1904
+ const elementKey = this.resolveElementKey(codeToQuery);
1905
+ return Id64.fromString(elementKey.id);
1906
+ }
1907
+ catch (err) {
1908
+ if (err.errorNumber === IModelStatus.NotFound)
1856
1909
  return undefined;
1857
- return stmt.getValue(0).getId();
1858
- });
1910
+ throw err;
1911
+ }
1859
1912
  }
1860
1913
  /** Query for an [[Element]]'s last modified time.
1861
1914
  * @param elementId The Id of the element.
@@ -1879,7 +1932,7 @@ function processSchemaWriteStatus(status) {
1879
1932
  /** Insert a new element into the iModel.
1880
1933
  * @param elProps The properties of the new element.
1881
1934
  * @returns The newly inserted element's Id.
1882
- * @throws [[IModelError]] if unable to insert the element.
1935
+ * @throws [[ITwinError]] if unable to insert the element.
1883
1936
  * @note For convenience, the value of `elProps.id` is updated to reflect the resultant element's id.
1884
1937
  * However when `elProps.federationGuid` is not present or undefined, a new Guid will be generated and stored on the resultant element. But
1885
1938
  * the value of `elProps.federationGuid` is *not* updated. Generally, it is best to re-read the element after inserting (e.g. via [[getElementProps]])
@@ -1909,7 +1962,7 @@ function processSchemaWriteStatus(status) {
1909
1962
  * @param elProps the properties of the element to update.
1910
1963
  * @note The values of `classFullName` and `model` *may not be changed* by this method. Further, it will permute the `elProps` object by adding or
1911
1964
  * overwriting their values to the correct values.
1912
- * @throws [[IModelError]] if unable to update the element.
1965
+ * @throws [[ITwinError]] if unable to update the element.
1913
1966
  */
1914
1967
  updateElement(elProps) {
1915
1968
  try {
@@ -1928,7 +1981,7 @@ function processSchemaWriteStatus(status) {
1928
1981
  }
1929
1982
  /** Delete one or more elements from this iModel.
1930
1983
  * @param ids The set of Ids of the element(s) to be deleted
1931
- * @throws [[IModelError]]
1984
+ * @throws [[ITwinError]]
1932
1985
  * @see deleteDefinitionElements
1933
1986
  */
1934
1987
  deleteElement(ids) {
@@ -1936,6 +1989,7 @@ function processSchemaWriteStatus(status) {
1936
1989
  Id64.toIdSet(ids).forEach((id) => {
1937
1990
  try {
1938
1991
  this[_cache].delete({ id });
1992
+ this[_instanceKeyCache].deleteById(id);
1939
1993
  iModel[_nativeDb].deleteElement(id);
1940
1994
  }
1941
1995
  catch (err) {
@@ -2215,7 +2269,9 @@ function processSchemaWriteStatus(status) {
2215
2269
  return this._iModel[_nativeDb].insertElementAspect(aspectProps);
2216
2270
  }
2217
2271
  catch (err) {
2218
- throw new IModelError(err.errorNumber, `Error inserting ElementAspect [${err.message}], class: ${aspectProps.classFullName}`);
2272
+ const error = new IModelError(err.errorNumber, `Error inserting ElementAspect [${err.message}], class: ${aspectProps.classFullName}`, aspectProps);
2273
+ error.cause = err;
2274
+ throw error;
2219
2275
  }
2220
2276
  }
2221
2277
  /** Update an exist ElementAspect within the iModel.
@@ -2227,7 +2283,9 @@ function processSchemaWriteStatus(status) {
2227
2283
  this._iModel[_nativeDb].updateElementAspect(aspectProps);
2228
2284
  }
2229
2285
  catch (err) {
2230
- throw new IModelError(err.errorNumber, `Error updating ElementAspect [${err.message}], id: ${aspectProps.id}`);
2286
+ const error = new IModelError(err.errorNumber, `Error updating ElementAspect [${err.message}], id: ${aspectProps.id}`, aspectProps);
2287
+ error.cause = err;
2288
+ throw error;
2231
2289
  }
2232
2290
  }
2233
2291
  /** Delete one or more ElementAspects from this iModel.
@@ -2241,14 +2299,16 @@ function processSchemaWriteStatus(status) {
2241
2299
  iModel[_nativeDb].deleteElementAspect(aspectInstanceId);
2242
2300
  }
2243
2301
  catch (err) {
2244
- throw new IModelError(err.errorNumber, `Error deleting ElementAspect [${err.message}], id: ${aspectInstanceId}`);
2302
+ const error = new IModelError(err.errorNumber, `Error deleting ElementAspect [${err.message}], id: ${aspectInstanceId}`);
2303
+ error.cause = err;
2304
+ throw error;
2245
2305
  }
2246
2306
  });
2247
2307
  }
2248
2308
  }
2249
2309
  IModelDb.Elements = Elements;
2250
2310
  /** The collection of views in an [[IModelDb]].
2251
- * @public
2311
+ * @public @preview
2252
2312
  */
2253
2313
  class Views {
2254
2314
  _iModel;
@@ -2274,7 +2334,7 @@ function processSchemaWriteStatus(status) {
2274
2334
  if (undefined === props) {
2275
2335
  const propsString = this._iModel.queryFilePropertyString(Views.viewStoreProperty);
2276
2336
  if (!propsString)
2277
- throw new Error("iModel does not have a default ViewStore");
2337
+ ViewStoreError.throwError("no-viewstore", { message: "iModel does not have a default ViewStore" });
2278
2338
  props = JSON.parse(propsString);
2279
2339
  }
2280
2340
  const accessToken = await CloudSqlite.requestToken({
@@ -2395,7 +2455,7 @@ function processSchemaWriteStatus(status) {
2395
2455
  }
2396
2456
  getViewThumbnailArg(viewDefinitionId) {
2397
2457
  if (!Id64.isValid(viewDefinitionId))
2398
- throw new Error("illegal thumbnail id");
2458
+ throw new IModelError(IModelStatus.BadArg, "illegal thumbnail id");
2399
2459
  return { namespace: "dgn_View", name: "Thumbnail", id: viewDefinitionId };
2400
2460
  }
2401
2461
  /** Get the thumbnail for a view.
@@ -2424,7 +2484,7 @@ function processSchemaWriteStatus(status) {
2424
2484
  }
2425
2485
  /** Set the default view property the iModel.
2426
2486
  * @param viewId The Id of the ViewDefinition to use as the default
2427
- * @deprecated in 4.2.x. Avoid setting this property - it is not practical for one single view to serve the needs of the many applications
2487
+ * @deprecated in 4.2.0 - will not be removed until after 2026-06-13. Avoid setting this property - it is not practical for one single view to serve the needs of the many applications
2428
2488
  * that might wish to view the contents of the iModel.
2429
2489
  */
2430
2490
  setDefaultViewId(viewId) {
@@ -2918,6 +2978,15 @@ export class BriefcaseDb extends IModelDb {
2918
2978
  IpcHost.notifyTxns(this, "notifyPulledChanges", this.changeset);
2919
2979
  this.txns.touchWatchFile();
2920
2980
  }
2981
+ async enableChangesetStatTracking() {
2982
+ this[_nativeDb].enableChangesetStatsTracking();
2983
+ }
2984
+ async disableChangesetStatTracking() {
2985
+ this[_nativeDb].disableChangesetStatsTracking();
2986
+ }
2987
+ async getAllChangesetHealthData() {
2988
+ return this[_nativeDb].getAllChangesetHealthData();
2989
+ }
2921
2990
  /** Revert timeline changes and then push resulting changeset */
2922
2991
  async revertAndPushChanges(arg) {
2923
2992
  const nativeDb = this[_nativeDb];
@@ -3102,6 +3171,10 @@ export class SnapshotDb extends IModelDb {
3102
3171
  snapshotDb.channels.addAllowedChannel(ChannelControl.sharedChannelName);
3103
3172
  if (options.createClassViews)
3104
3173
  snapshotDb._createClassViewsOnClose = true; // save flag that will be checked when close() is called
3174
+ if (options.geographicCoordinateSystem)
3175
+ snapshotDb.setGeographicCoordinateSystem(options.geographicCoordinateSystem);
3176
+ if (options.ecefLocation)
3177
+ snapshotDb.setEcefLocation(options.ecefLocation);
3105
3178
  return snapshotDb;
3106
3179
  }
3107
3180
  /** Create a local [Snapshot]($docs/learning/backend/AccessingIModels.md#snapshot-imodels) iModel file, using this iModel as a *seed* or starting point.
@@ -3256,6 +3329,10 @@ export class StandaloneDb extends BriefcaseDb {
3256
3329
  nativeDb.resetBriefcaseId(BriefcaseIdValue.Unassigned);
3257
3330
  nativeDb.saveChanges();
3258
3331
  const db = new this({ nativeDb, key: Guid.createValue(), briefcaseId: BriefcaseIdValue.Unassigned, openMode: OpenMode.ReadWrite });
3332
+ if (args.geographicCoordinateSystem)
3333
+ db.setGeographicCoordinateSystem(args.geographicCoordinateSystem);
3334
+ if (args.ecefLocation)
3335
+ db.setEcefLocation(args.ecefLocation);
3259
3336
  db.channels.addAllowedChannel(ChannelControl.sharedChannelName);
3260
3337
  return db;
3261
3338
  }