@itwin/core-backend 5.9.0-dev.1 → 5.9.0-dev.10

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 (551) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/lib/cjs/BackendHubAccess.d.ts +38 -0
  3. package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
  4. package/lib/cjs/BackendHubAccess.js.map +1 -1
  5. package/lib/cjs/BriefcaseManager.js +3 -3
  6. package/lib/cjs/BriefcaseManager.js.map +1 -1
  7. package/lib/cjs/Category.d.ts +37 -7
  8. package/lib/cjs/Category.d.ts.map +1 -1
  9. package/lib/cjs/Category.js +33 -42
  10. package/lib/cjs/Category.js.map +1 -1
  11. package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
  12. package/lib/cjs/ChangesetECAdaptor.js +5 -2
  13. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  14. package/lib/cjs/ChannelControl.d.ts +29 -0
  15. package/lib/cjs/ChannelControl.d.ts.map +1 -1
  16. package/lib/cjs/ChannelControl.js.map +1 -1
  17. package/lib/cjs/CheckpointManager.js +1 -1
  18. package/lib/cjs/CheckpointManager.js.map +1 -1
  19. package/lib/cjs/CloudSqlite.d.ts +1 -1
  20. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  21. package/lib/cjs/CloudSqlite.js +68 -13
  22. package/lib/cjs/CloudSqlite.js.map +1 -1
  23. package/lib/cjs/CodeSpecs.d.ts +32 -3
  24. package/lib/cjs/CodeSpecs.d.ts.map +1 -1
  25. package/lib/cjs/CodeSpecs.js +48 -20
  26. package/lib/cjs/CodeSpecs.js.map +1 -1
  27. package/lib/cjs/DisplayStyle.d.ts +18 -3
  28. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  29. package/lib/cjs/DisplayStyle.js +10 -21
  30. package/lib/cjs/DisplayStyle.js.map +1 -1
  31. package/lib/cjs/EditTxn.d.ts +262 -0
  32. package/lib/cjs/EditTxn.d.ts.map +1 -0
  33. package/lib/cjs/EditTxn.js +548 -0
  34. package/lib/cjs/EditTxn.js.map +1 -0
  35. package/lib/cjs/Element.d.ts +74 -5
  36. package/lib/cjs/Element.d.ts.map +1 -1
  37. package/lib/cjs/Element.js +63 -75
  38. package/lib/cjs/Element.js.map +1 -1
  39. package/lib/cjs/ElementAspect.d.ts +10 -0
  40. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  41. package/lib/cjs/ElementAspect.js +21 -12
  42. package/lib/cjs/ElementAspect.js.map +1 -1
  43. package/lib/cjs/ElementTreeWalker.d.ts +56 -3
  44. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  45. package/lib/cjs/ElementTreeWalker.js +53 -40
  46. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  47. package/lib/cjs/ExternalSource.d.ts +11 -2
  48. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  49. package/lib/cjs/ExternalSource.js +10 -8
  50. package/lib/cjs/ExternalSource.js.map +1 -1
  51. package/lib/cjs/IModelDb.d.ts +66 -22
  52. package/lib/cjs/IModelDb.d.ts.map +1 -1
  53. package/lib/cjs/IModelDb.js +175 -289
  54. package/lib/cjs/IModelDb.js.map +1 -1
  55. package/lib/cjs/IModelHost.d.ts +58 -1
  56. package/lib/cjs/IModelHost.d.ts.map +1 -1
  57. package/lib/cjs/IModelHost.js +89 -0
  58. package/lib/cjs/IModelHost.js.map +1 -1
  59. package/lib/cjs/IpcHost.d.ts.map +1 -1
  60. package/lib/cjs/IpcHost.js +35 -15
  61. package/lib/cjs/IpcHost.js.map +1 -1
  62. package/lib/cjs/LineStyle.d.ts +47 -7
  63. package/lib/cjs/LineStyle.d.ts.map +1 -1
  64. package/lib/cjs/LineStyle.js +38 -33
  65. package/lib/cjs/LineStyle.js.map +1 -1
  66. package/lib/cjs/LockControl.d.ts +85 -1
  67. package/lib/cjs/LockControl.d.ts.map +1 -1
  68. package/lib/cjs/LockControl.js.map +1 -1
  69. package/lib/cjs/Material.d.ts +8 -1
  70. package/lib/cjs/Material.d.ts.map +1 -1
  71. package/lib/cjs/Material.js +6 -12
  72. package/lib/cjs/Material.js.map +1 -1
  73. package/lib/cjs/Model.d.ts +59 -20
  74. package/lib/cjs/Model.d.ts.map +1 -1
  75. package/lib/cjs/Model.js +38 -80
  76. package/lib/cjs/Model.js.map +1 -1
  77. package/lib/cjs/Relationship.d.ts +72 -7
  78. package/lib/cjs/Relationship.d.ts.map +1 -1
  79. package/lib/cjs/Relationship.js +39 -21
  80. package/lib/cjs/Relationship.js.map +1 -1
  81. package/lib/cjs/SchemaSync.js +4 -4
  82. package/lib/cjs/SchemaSync.js.map +1 -1
  83. package/lib/cjs/SheetIndex.d.ts +9 -0
  84. package/lib/cjs/SheetIndex.d.ts.map +1 -1
  85. package/lib/cjs/SheetIndex.js +38 -35
  86. package/lib/cjs/SheetIndex.js.map +1 -1
  87. package/lib/cjs/StashManager.js +1 -1
  88. package/lib/cjs/StashManager.js.map +1 -1
  89. package/lib/cjs/Texture.d.ts +6 -0
  90. package/lib/cjs/Texture.d.ts.map +1 -1
  91. package/lib/cjs/Texture.js +6 -14
  92. package/lib/cjs/Texture.js.map +1 -1
  93. package/lib/cjs/TxnManager.d.ts +105 -9
  94. package/lib/cjs/TxnManager.d.ts.map +1 -1
  95. package/lib/cjs/TxnManager.js +194 -15
  96. package/lib/cjs/TxnManager.js.map +1 -1
  97. package/lib/cjs/ViewDefinition.d.ts +21 -1
  98. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  99. package/lib/cjs/ViewDefinition.js +27 -66
  100. package/lib/cjs/ViewDefinition.js.map +1 -1
  101. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +14 -6
  102. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
  103. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +33 -27
  104. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  105. package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
  106. package/lib/cjs/annotations/TextAnnotationElement.js +6 -5
  107. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  108. package/lib/cjs/core-backend.d.ts +1 -0
  109. package/lib/cjs/core-backend.d.ts.map +1 -1
  110. package/lib/cjs/core-backend.js +1 -0
  111. package/lib/cjs/core-backend.js.map +1 -1
  112. package/lib/cjs/domains/FunctionalElements.d.ts +6 -2
  113. package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
  114. package/lib/cjs/domains/FunctionalElements.js +8 -13
  115. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  116. package/lib/cjs/domains/GenericElements.d.ts +11 -4
  117. package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
  118. package/lib/cjs/domains/GenericElements.js +13 -24
  119. package/lib/cjs/domains/GenericElements.js.map +1 -1
  120. package/lib/cjs/internal/ChannelAdmin.d.ts +15 -0
  121. package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -1
  122. package/lib/cjs/internal/ChannelAdmin.js +5 -3
  123. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  124. package/lib/cjs/internal/HubMock.d.ts +2 -0
  125. package/lib/cjs/internal/HubMock.d.ts.map +1 -1
  126. package/lib/cjs/internal/HubMock.js +7 -0
  127. package/lib/cjs/internal/HubMock.js.map +1 -1
  128. package/lib/cjs/internal/NoLocks.d.ts.map +1 -1
  129. package/lib/cjs/internal/NoLocks.js +6 -0
  130. package/lib/cjs/internal/NoLocks.js.map +1 -1
  131. package/lib/cjs/internal/ServerBasedLocks.d.ts +12 -0
  132. package/lib/cjs/internal/ServerBasedLocks.d.ts.map +1 -1
  133. package/lib/cjs/internal/ServerBasedLocks.js +285 -4
  134. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
  135. package/lib/cjs/internal/Symbols.d.ts +4 -0
  136. package/lib/cjs/internal/Symbols.d.ts.map +1 -1
  137. package/lib/cjs/internal/Symbols.js +5 -1
  138. package/lib/cjs/internal/Symbols.js.map +1 -1
  139. package/lib/cjs/internal/annotations/fields.d.ts +3 -2
  140. package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
  141. package/lib/cjs/internal/annotations/fields.js +7 -6
  142. package/lib/cjs/internal/annotations/fields.js.map +1 -1
  143. package/lib/cjs/internal/workspace/SettingsEditorImpl.d.ts +18 -3
  144. package/lib/cjs/internal/workspace/SettingsEditorImpl.d.ts.map +1 -1
  145. package/lib/cjs/internal/workspace/SettingsEditorImpl.js +49 -242
  146. package/lib/cjs/internal/workspace/SettingsEditorImpl.js.map +1 -1
  147. package/lib/cjs/internal/workspace/SettingsImpl.d.ts.map +1 -1
  148. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
  149. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts +0 -1
  150. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  151. package/lib/cjs/internal/workspace/WorkspaceImpl.js +70 -41
  152. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  153. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  154. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  155. package/lib/cjs/workspace/Settings.d.ts +11 -5
  156. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  157. package/lib/cjs/workspace/Settings.js.map +1 -1
  158. package/lib/cjs/workspace/SettingsDb.d.ts +20 -99
  159. package/lib/cjs/workspace/SettingsDb.d.ts.map +1 -1
  160. package/lib/cjs/workspace/SettingsDb.js +23 -7
  161. package/lib/cjs/workspace/SettingsDb.js.map +1 -1
  162. package/lib/cjs/workspace/SettingsEditor.d.ts +40 -226
  163. package/lib/cjs/workspace/SettingsEditor.d.ts.map +1 -1
  164. package/lib/cjs/workspace/SettingsEditor.js +86 -25
  165. package/lib/cjs/workspace/SettingsEditor.js.map +1 -1
  166. package/lib/cjs/workspace/Workspace.d.ts +7 -11
  167. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  168. package/lib/cjs/workspace/Workspace.js.map +1 -1
  169. package/lib/cjs/workspace/WorkspaceEditor.d.ts +14 -0
  170. package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -1
  171. package/lib/cjs/workspace/WorkspaceEditor.js +1 -1
  172. package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
  173. package/lib/esm/BackendHubAccess.d.ts +38 -0
  174. package/lib/esm/BackendHubAccess.d.ts.map +1 -1
  175. package/lib/esm/BackendHubAccess.js.map +1 -1
  176. package/lib/esm/BriefcaseManager.js +3 -3
  177. package/lib/esm/BriefcaseManager.js.map +1 -1
  178. package/lib/esm/Category.d.ts +37 -7
  179. package/lib/esm/Category.d.ts.map +1 -1
  180. package/lib/esm/Category.js +33 -42
  181. package/lib/esm/Category.js.map +1 -1
  182. package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
  183. package/lib/esm/ChangesetECAdaptor.js +5 -2
  184. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  185. package/lib/esm/ChannelControl.d.ts +29 -0
  186. package/lib/esm/ChannelControl.d.ts.map +1 -1
  187. package/lib/esm/ChannelControl.js.map +1 -1
  188. package/lib/esm/CheckpointManager.js +1 -1
  189. package/lib/esm/CheckpointManager.js.map +1 -1
  190. package/lib/esm/CloudSqlite.d.ts +1 -1
  191. package/lib/esm/CloudSqlite.d.ts.map +1 -1
  192. package/lib/esm/CloudSqlite.js +69 -14
  193. package/lib/esm/CloudSqlite.js.map +1 -1
  194. package/lib/esm/CodeSpecs.d.ts +32 -3
  195. package/lib/esm/CodeSpecs.d.ts.map +1 -1
  196. package/lib/esm/CodeSpecs.js +49 -21
  197. package/lib/esm/CodeSpecs.js.map +1 -1
  198. package/lib/esm/DisplayStyle.d.ts +18 -3
  199. package/lib/esm/DisplayStyle.d.ts.map +1 -1
  200. package/lib/esm/DisplayStyle.js +10 -21
  201. package/lib/esm/DisplayStyle.js.map +1 -1
  202. package/lib/esm/EditTxn.d.ts +262 -0
  203. package/lib/esm/EditTxn.d.ts.map +1 -0
  204. package/lib/esm/EditTxn.js +543 -0
  205. package/lib/esm/EditTxn.js.map +1 -0
  206. package/lib/esm/Element.d.ts +74 -5
  207. package/lib/esm/Element.d.ts.map +1 -1
  208. package/lib/esm/Element.js +64 -76
  209. package/lib/esm/Element.js.map +1 -1
  210. package/lib/esm/ElementAspect.d.ts +10 -0
  211. package/lib/esm/ElementAspect.d.ts.map +1 -1
  212. package/lib/esm/ElementAspect.js +22 -13
  213. package/lib/esm/ElementAspect.js.map +1 -1
  214. package/lib/esm/ElementTreeWalker.d.ts +56 -3
  215. package/lib/esm/ElementTreeWalker.d.ts.map +1 -1
  216. package/lib/esm/ElementTreeWalker.js +53 -40
  217. package/lib/esm/ElementTreeWalker.js.map +1 -1
  218. package/lib/esm/ExternalSource.d.ts +11 -2
  219. package/lib/esm/ExternalSource.d.ts.map +1 -1
  220. package/lib/esm/ExternalSource.js +10 -8
  221. package/lib/esm/ExternalSource.js.map +1 -1
  222. package/lib/esm/IModelDb.d.ts +66 -22
  223. package/lib/esm/IModelDb.d.ts.map +1 -1
  224. package/lib/esm/IModelDb.js +177 -291
  225. package/lib/esm/IModelDb.js.map +1 -1
  226. package/lib/esm/IModelHost.d.ts +58 -1
  227. package/lib/esm/IModelHost.d.ts.map +1 -1
  228. package/lib/esm/IModelHost.js +91 -2
  229. package/lib/esm/IModelHost.js.map +1 -1
  230. package/lib/esm/IpcHost.d.ts.map +1 -1
  231. package/lib/esm/IpcHost.js +36 -16
  232. package/lib/esm/IpcHost.js.map +1 -1
  233. package/lib/esm/LineStyle.d.ts +47 -7
  234. package/lib/esm/LineStyle.d.ts.map +1 -1
  235. package/lib/esm/LineStyle.js +38 -33
  236. package/lib/esm/LineStyle.js.map +1 -1
  237. package/lib/esm/LockControl.d.ts +85 -1
  238. package/lib/esm/LockControl.d.ts.map +1 -1
  239. package/lib/esm/LockControl.js.map +1 -1
  240. package/lib/esm/Material.d.ts +8 -1
  241. package/lib/esm/Material.d.ts.map +1 -1
  242. package/lib/esm/Material.js +6 -12
  243. package/lib/esm/Material.js.map +1 -1
  244. package/lib/esm/Model.d.ts +59 -20
  245. package/lib/esm/Model.d.ts.map +1 -1
  246. package/lib/esm/Model.js +39 -81
  247. package/lib/esm/Model.js.map +1 -1
  248. package/lib/esm/Relationship.d.ts +72 -7
  249. package/lib/esm/Relationship.d.ts.map +1 -1
  250. package/lib/esm/Relationship.js +40 -22
  251. package/lib/esm/Relationship.js.map +1 -1
  252. package/lib/esm/SchemaSync.js +5 -5
  253. package/lib/esm/SchemaSync.js.map +1 -1
  254. package/lib/esm/SheetIndex.d.ts +9 -0
  255. package/lib/esm/SheetIndex.d.ts.map +1 -1
  256. package/lib/esm/SheetIndex.js +38 -35
  257. package/lib/esm/SheetIndex.js.map +1 -1
  258. package/lib/esm/StashManager.js +1 -1
  259. package/lib/esm/StashManager.js.map +1 -1
  260. package/lib/esm/Texture.d.ts +6 -0
  261. package/lib/esm/Texture.d.ts.map +1 -1
  262. package/lib/esm/Texture.js +6 -14
  263. package/lib/esm/Texture.js.map +1 -1
  264. package/lib/esm/TxnManager.d.ts +105 -9
  265. package/lib/esm/TxnManager.d.ts.map +1 -1
  266. package/lib/esm/TxnManager.js +194 -15
  267. package/lib/esm/TxnManager.js.map +1 -1
  268. package/lib/esm/ViewDefinition.d.ts +21 -1
  269. package/lib/esm/ViewDefinition.d.ts.map +1 -1
  270. package/lib/esm/ViewDefinition.js +27 -66
  271. package/lib/esm/ViewDefinition.js.map +1 -1
  272. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +14 -6
  273. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
  274. package/lib/esm/annotations/ElementDrivesTextAnnotation.js +33 -27
  275. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  276. package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
  277. package/lib/esm/annotations/TextAnnotationElement.js +6 -5
  278. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  279. package/lib/esm/core-backend.d.ts +1 -0
  280. package/lib/esm/core-backend.d.ts.map +1 -1
  281. package/lib/esm/core-backend.js +1 -0
  282. package/lib/esm/core-backend.js.map +1 -1
  283. package/lib/esm/domains/FunctionalElements.d.ts +6 -2
  284. package/lib/esm/domains/FunctionalElements.d.ts.map +1 -1
  285. package/lib/esm/domains/FunctionalElements.js +8 -13
  286. package/lib/esm/domains/FunctionalElements.js.map +1 -1
  287. package/lib/esm/domains/GenericElements.d.ts +11 -4
  288. package/lib/esm/domains/GenericElements.d.ts.map +1 -1
  289. package/lib/esm/domains/GenericElements.js +13 -24
  290. package/lib/esm/domains/GenericElements.js.map +1 -1
  291. package/lib/esm/internal/ChannelAdmin.d.ts +15 -0
  292. package/lib/esm/internal/ChannelAdmin.d.ts.map +1 -1
  293. package/lib/esm/internal/ChannelAdmin.js +6 -4
  294. package/lib/esm/internal/ChannelAdmin.js.map +1 -1
  295. package/lib/esm/internal/HubMock.d.ts +2 -0
  296. package/lib/esm/internal/HubMock.d.ts.map +1 -1
  297. package/lib/esm/internal/HubMock.js +7 -0
  298. package/lib/esm/internal/HubMock.js.map +1 -1
  299. package/lib/esm/internal/NoLocks.d.ts.map +1 -1
  300. package/lib/esm/internal/NoLocks.js +6 -0
  301. package/lib/esm/internal/NoLocks.js.map +1 -1
  302. package/lib/esm/internal/ServerBasedLocks.d.ts +12 -0
  303. package/lib/esm/internal/ServerBasedLocks.d.ts.map +1 -1
  304. package/lib/esm/internal/ServerBasedLocks.js +286 -5
  305. package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
  306. package/lib/esm/internal/Symbols.d.ts +4 -0
  307. package/lib/esm/internal/Symbols.d.ts.map +1 -1
  308. package/lib/esm/internal/Symbols.js +4 -0
  309. package/lib/esm/internal/Symbols.js.map +1 -1
  310. package/lib/esm/internal/annotations/fields.d.ts +3 -2
  311. package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
  312. package/lib/esm/internal/annotations/fields.js +7 -6
  313. package/lib/esm/internal/annotations/fields.js.map +1 -1
  314. package/lib/esm/internal/workspace/SettingsEditorImpl.d.ts +18 -3
  315. package/lib/esm/internal/workspace/SettingsEditorImpl.d.ts.map +1 -1
  316. package/lib/esm/internal/workspace/SettingsEditorImpl.js +52 -246
  317. package/lib/esm/internal/workspace/SettingsEditorImpl.js.map +1 -1
  318. package/lib/esm/internal/workspace/SettingsImpl.d.ts.map +1 -1
  319. package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
  320. package/lib/esm/internal/workspace/WorkspaceImpl.d.ts +0 -1
  321. package/lib/esm/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  322. package/lib/esm/internal/workspace/WorkspaceImpl.js +71 -41
  323. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  324. package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  325. package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  326. package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
  327. package/lib/esm/test/ElementDrivesElement.test.d.ts +20 -19
  328. package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -1
  329. package/lib/esm/test/ElementDrivesElement.test.js +111 -96
  330. package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
  331. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  332. package/lib/esm/test/IModelHost.test.js +56 -2
  333. package/lib/esm/test/IModelHost.test.js.map +1 -1
  334. package/lib/esm/test/IModelTestUtils.d.ts +23 -23
  335. package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
  336. package/lib/esm/test/IModelTestUtils.js +466 -449
  337. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  338. package/lib/esm/test/IpcHost.test.js +112 -0
  339. package/lib/esm/test/IpcHost.test.js.map +1 -1
  340. package/lib/esm/test/PropertyDb.test.js +2 -2
  341. package/lib/esm/test/PropertyDb.test.js.map +1 -1
  342. package/lib/esm/test/SquashSchemaAndDataChanges.test.js +27 -18
  343. package/lib/esm/test/SquashSchemaAndDataChanges.test.js.map +1 -1
  344. package/lib/esm/test/TestChangeSetUtility.d.ts.map +1 -1
  345. package/lib/esm/test/TestChangeSetUtility.js +11 -7
  346. package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
  347. package/lib/esm/test/TestEditTxn.d.ts +8 -0
  348. package/lib/esm/test/TestEditTxn.d.ts.map +1 -0
  349. package/lib/esm/test/TestEditTxn.js +34 -0
  350. package/lib/esm/test/TestEditTxn.js.map +1 -0
  351. package/lib/esm/test/TestUtils.d.ts +1 -0
  352. package/lib/esm/test/TestUtils.d.ts.map +1 -1
  353. package/lib/esm/test/TestUtils.js +8 -1
  354. package/lib/esm/test/TestUtils.js.map +1 -1
  355. package/lib/esm/test/annotations/Fields.test.js +82 -90
  356. package/lib/esm/test/annotations/Fields.test.js.map +1 -1
  357. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
  358. package/lib/esm/test/annotations/TextAnnotation.test.js +156 -99
  359. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  360. package/lib/esm/test/annotations/TextBlock.test.js +5 -3
  361. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
  362. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
  363. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
  364. package/lib/esm/test/categories/Category.test.js +63 -3
  365. package/lib/esm/test/categories/Category.test.js.map +1 -1
  366. package/lib/esm/test/codespec/CodeSpec.test.js +88 -5
  367. package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
  368. package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
  369. package/lib/esm/test/ecdb/ECSqlAst.test.js +3 -2
  370. package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
  371. package/lib/esm/test/ecdb/ECSqlQuery.test.js +2 -2
  372. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  373. package/lib/esm/test/ecdb/ECSqlStatement.test.js +0 -1
  374. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  375. package/lib/esm/test/ecdb/QueryReaders.test.js +17 -14
  376. package/lib/esm/test/ecdb/QueryReaders.test.js.map +1 -1
  377. package/lib/esm/test/ecdb/SqliteStatement.test.js +2 -2
  378. package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
  379. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.d.ts.map +1 -1
  380. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js +30 -28
  381. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
  382. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
  383. package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
  384. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  385. package/lib/esm/test/element/DeleteDefinitionElements.test.js +159 -143
  386. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  387. package/lib/esm/test/element/ElementAspect.test.js +68 -60
  388. package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
  389. package/lib/esm/test/element/ElementDependencyGraph.test.d.ts.map +1 -1
  390. package/lib/esm/test/element/ElementDependencyGraph.test.js +51 -43
  391. package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
  392. package/lib/esm/test/element/ElementRoundTrip.test.js +37 -38
  393. package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
  394. package/lib/esm/test/element/ExcludedElements.test.js +2 -2
  395. package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
  396. package/lib/esm/test/element/ExternalSource.test.js +40 -38
  397. package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
  398. package/lib/esm/test/element/NullStructArray.test.js +10 -9
  399. package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
  400. package/lib/esm/test/element/ProjectInformationRecord.test.js +5 -2
  401. package/lib/esm/test/element/ProjectInformationRecord.test.js.map +1 -1
  402. package/lib/esm/test/element/SheetInformationAspect.test.js +43 -11
  403. package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
  404. package/lib/esm/test/element/UrlLink.test.js +2 -2
  405. package/lib/esm/test/element/UrlLink.test.js.map +1 -1
  406. package/lib/esm/test/font/IModelDbFonts.test.js +87 -73
  407. package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
  408. package/lib/esm/test/hubaccess/ApplyChangeset.test.js +164 -125
  409. package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
  410. package/lib/esm/test/hubaccess/BriefcaseManager.test.js +2 -4
  411. package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
  412. package/lib/esm/test/hubaccess/Rebase.test.js +313 -247
  413. package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
  414. package/lib/esm/test/hubaccess/SemanticRebase.test.js +322 -247
  415. package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
  416. package/lib/esm/test/imodel/Code.test.js +31 -31
  417. package/lib/esm/test/imodel/Code.test.js.map +1 -1
  418. package/lib/esm/test/imodel/ElementTreeWalker.test.js +57 -48
  419. package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
  420. package/lib/esm/test/imodel/IModel.test.js +419 -344
  421. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  422. package/lib/esm/test/imodel/ProjectExtents.test.js +2 -2
  423. package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
  424. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
  425. package/lib/esm/test/incrementalSchemaLocater/TestContext.d.ts.map +1 -1
  426. package/lib/esm/test/incrementalSchemaLocater/TestContext.js +2 -2
  427. package/lib/esm/test/incrementalSchemaLocater/TestContext.js.map +1 -1
  428. package/lib/esm/test/index.d.ts +1 -0
  429. package/lib/esm/test/index.d.ts.map +1 -1
  430. package/lib/esm/test/index.js +1 -0
  431. package/lib/esm/test/index.js.map +1 -1
  432. package/lib/esm/test/schema/ClassRegistry.test.js +23 -22
  433. package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
  434. package/lib/esm/test/schema/FunctionalDomain.test.js +36 -34
  435. package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
  436. package/lib/esm/test/schema/GenericDomain.test.js +114 -94
  437. package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
  438. package/lib/esm/test/schema/IModelSchemaContext.test.js +2 -1
  439. package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
  440. package/lib/esm/test/schema/SchemaImportCallbacks.test.js +207 -192
  441. package/lib/esm/test/schema/SchemaImportCallbacks.test.js.map +1 -1
  442. package/lib/esm/test/sheetindex/SheetIndex.test.d.ts +1 -3
  443. package/lib/esm/test/sheetindex/SheetIndex.test.d.ts.map +1 -1
  444. package/lib/esm/test/sheetindex/SheetIndex.test.js +312 -247
  445. package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
  446. package/lib/esm/test/standalone/ChangeMerge.test.js +101 -82
  447. package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
  448. package/lib/esm/test/standalone/ChangesetReader.test.js +114 -85
  449. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  450. package/lib/esm/test/standalone/DisplayStyle.test.js +43 -40
  451. package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
  452. package/lib/esm/test/standalone/Drawing.test.js +4 -3
  453. package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
  454. package/lib/esm/test/standalone/EditTxn.test.d.ts +2 -0
  455. package/lib/esm/test/standalone/EditTxn.test.d.ts.map +1 -0
  456. package/lib/esm/test/standalone/EditTxn.test.js +219 -0
  457. package/lib/esm/test/standalone/EditTxn.test.js.map +1 -0
  458. package/lib/esm/test/standalone/ElementMesh.test.js +16 -13
  459. package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
  460. package/lib/esm/test/standalone/ExportGraphics.test.js +26 -20
  461. package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
  462. package/lib/esm/test/standalone/GeometryChangeEvents.test.js +11 -15
  463. package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
  464. package/lib/esm/test/standalone/GeometryStream.test.js +212 -165
  465. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  466. package/lib/esm/test/standalone/HubMock.test.js +31 -25
  467. package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
  468. package/lib/esm/test/standalone/IModelLimits.test.js +11 -8
  469. package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
  470. package/lib/esm/test/standalone/IModelWrite.test.d.ts +2 -2
  471. package/lib/esm/test/standalone/IModelWrite.test.d.ts.map +1 -1
  472. package/lib/esm/test/standalone/IModelWrite.test.js +184 -142
  473. package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
  474. package/lib/esm/test/standalone/ITwinWorkspace.test.d.ts +2 -0
  475. package/lib/esm/test/standalone/ITwinWorkspace.test.d.ts.map +1 -0
  476. package/lib/esm/test/standalone/ITwinWorkspace.test.js +236 -0
  477. package/lib/esm/test/standalone/ITwinWorkspace.test.js.map +1 -0
  478. package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js +25 -22
  479. package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
  480. package/lib/esm/test/standalone/IntegrityCheck.test.js +20 -18
  481. package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
  482. package/lib/esm/test/standalone/MergeConflict.test.d.ts +2 -2
  483. package/lib/esm/test/standalone/MergeConflict.test.d.ts.map +1 -1
  484. package/lib/esm/test/standalone/MergeConflict.test.js +49 -33
  485. package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
  486. package/lib/esm/test/standalone/RenderMaterialElement.test.js +5 -5
  487. package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
  488. package/lib/esm/test/standalone/RenderTimeline.test.js +3 -2
  489. package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
  490. package/lib/esm/test/standalone/SectionDrawing.test.js +7 -7
  491. package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
  492. package/lib/esm/test/standalone/ServerBasedLocks.test.js +928 -22
  493. package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
  494. package/lib/esm/test/standalone/Settings.test.js +26 -4
  495. package/lib/esm/test/standalone/Settings.test.js.map +1 -1
  496. package/lib/esm/test/standalone/SettingsSchemas.test.js +2 -1
  497. package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
  498. package/lib/esm/test/standalone/SnapshotDb.test.js +3 -1
  499. package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
  500. package/lib/esm/test/standalone/StandaloneDb.test.js +7 -6
  501. package/lib/esm/test/standalone/StandaloneDb.test.js.map +1 -1
  502. package/lib/esm/test/standalone/Texture.test.js +5 -4
  503. package/lib/esm/test/standalone/Texture.test.js.map +1 -1
  504. package/lib/esm/test/standalone/TileCache.test.d.ts.map +1 -1
  505. package/lib/esm/test/standalone/TileCache.test.js +5 -3
  506. package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
  507. package/lib/esm/test/standalone/TileTree.test.js +35 -31
  508. package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
  509. package/lib/esm/test/standalone/TxnManager.test.js +700 -653
  510. package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
  511. package/lib/esm/test/standalone/ViewDefinition.test.js +295 -229
  512. package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
  513. package/lib/esm/test/standalone/Workspace.test.js +72 -22
  514. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  515. package/lib/esm/test/workspace/SettingsDb.test.js +28 -456
  516. package/lib/esm/test/workspace/SettingsDb.test.js.map +1 -1
  517. package/lib/esm/workspace/Settings.d.ts +11 -5
  518. package/lib/esm/workspace/Settings.d.ts.map +1 -1
  519. package/lib/esm/workspace/Settings.js.map +1 -1
  520. package/lib/esm/workspace/SettingsDb.d.ts +20 -99
  521. package/lib/esm/workspace/SettingsDb.d.ts.map +1 -1
  522. package/lib/esm/workspace/SettingsDb.js +20 -6
  523. package/lib/esm/workspace/SettingsDb.js.map +1 -1
  524. package/lib/esm/workspace/SettingsEditor.d.ts +40 -226
  525. package/lib/esm/workspace/SettingsEditor.d.ts.map +1 -1
  526. package/lib/esm/workspace/SettingsEditor.js +85 -24
  527. package/lib/esm/workspace/SettingsEditor.js.map +1 -1
  528. package/lib/esm/workspace/Workspace.d.ts +7 -11
  529. package/lib/esm/workspace/Workspace.d.ts.map +1 -1
  530. package/lib/esm/workspace/Workspace.js.map +1 -1
  531. package/lib/esm/workspace/WorkspaceEditor.d.ts +14 -0
  532. package/lib/esm/workspace/WorkspaceEditor.d.ts.map +1 -1
  533. package/lib/esm/workspace/WorkspaceEditor.js +1 -1
  534. package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
  535. package/package.json +14 -14
  536. package/lib/cjs/internal/workspace/SettingsDbImpl.d.ts +0 -38
  537. package/lib/cjs/internal/workspace/SettingsDbImpl.d.ts.map +0 -1
  538. package/lib/cjs/internal/workspace/SettingsDbImpl.js +0 -108
  539. package/lib/cjs/internal/workspace/SettingsDbImpl.js.map +0 -1
  540. package/lib/cjs/internal/workspace/SettingsSqliteDb.d.ts +0 -14
  541. package/lib/cjs/internal/workspace/SettingsSqliteDb.d.ts.map +0 -1
  542. package/lib/cjs/internal/workspace/SettingsSqliteDb.js +0 -40
  543. package/lib/cjs/internal/workspace/SettingsSqliteDb.js.map +0 -1
  544. package/lib/esm/internal/workspace/SettingsDbImpl.d.ts +0 -38
  545. package/lib/esm/internal/workspace/SettingsDbImpl.d.ts.map +0 -1
  546. package/lib/esm/internal/workspace/SettingsDbImpl.js +0 -104
  547. package/lib/esm/internal/workspace/SettingsDbImpl.js.map +0 -1
  548. package/lib/esm/internal/workspace/SettingsSqliteDb.d.ts +0 -14
  549. package/lib/esm/internal/workspace/SettingsSqliteDb.d.ts.map +0 -1
  550. package/lib/esm/internal/workspace/SettingsSqliteDb.js +0 -36
  551. package/lib/esm/internal/workspace/SettingsSqliteDb.js.map +0 -1
@@ -7,8 +7,10 @@ import { AuthorizationClient, LocalDirName, SessionProps } from "@itwin/core-com
7
7
  import type { ServerStorage } from "@itwin/object-storage-core";
8
8
  import { BackendHubAccess, CreateNewIModelProps } from "./BackendHubAccess";
9
9
  import { TileStorage } from "./TileStorage";
10
+ import { SettingsContainer } from "./workspace/Settings";
10
11
  import { SettingsSchemas } from "./workspace/SettingsSchemas";
11
- import { Workspace, WorkspaceOpts } from "./workspace/Workspace";
12
+ import { Workspace, WorkspaceDbSettingsProps, WorkspaceOpts } from "./workspace/Workspace";
13
+ import { OwnedWorkspace } from "./internal/workspace/WorkspaceImpl";
12
14
  import { _getHubAccess, _hubAccess, _setHubAccess } from "./internal/Symbols";
13
15
  /** @internal */
14
16
  export interface CrashReportingConfigNameValuePair {
@@ -47,6 +49,15 @@ export interface AzureBlobStorageCredentials {
47
49
  accessKey: string;
48
50
  baseUrl?: string;
49
51
  }
52
+ /** Controls how iModel writes through the implicit transaction are enforced.
53
+ *
54
+ * Allowed values:
55
+ * - "allow": preserve pre-version 5.8.0 behavior for backwards compatibility.
56
+ * - "log": allow the operation but log each implicit write as an error case.
57
+ * - "throw": reject writes through the implicit transaction and require explicit EditTxns.
58
+ * @beta
59
+ */
60
+ export type ImplicitWriteEnforcement = "allow" | "log" | "throw";
50
61
  /**
51
62
  * Options for [[IModelHost.startup]]
52
63
  * @public
@@ -160,6 +171,13 @@ export interface IModelHostOptions {
160
171
  * @beta
161
172
  */
162
173
  useSemanticRebase?: boolean;
174
+ /**
175
+ * Controls how writes through the implicit transaction are enforced.
176
+ * See [[ImplicitWriteEnforcement]] for the allowed values.
177
+ * Defaults to "allow" for backwards compatibility.
178
+ * @beta
179
+ */
180
+ implicitWriteEnforcement?: ImplicitWriteEnforcement;
163
181
  }
164
182
  /** Configuration of core-backend.
165
183
  * @public
@@ -214,6 +232,12 @@ export declare class IModelHostConfiguration implements IModelHostOptions {
214
232
  * @beta
215
233
  */
216
234
  useSemanticRebase?: boolean;
235
+ /**
236
+ * Controls how writes through the implicit transaction are enforced.
237
+ * See [[IModelHostOptions.implicitWriteEnforcement]] for the meaning of each allowed value.
238
+ * @beta
239
+ */
240
+ implicitWriteEnforcement: ImplicitWriteEnforcement;
217
241
  }
218
242
  /** IModelHost initializes ($backend) and captures its configuration. A backend must call [[IModelHost.startup]] before using any backend classes.
219
243
  * See [the learning article]($docs/learning/backend/IModelHost.md)
@@ -274,6 +298,39 @@ export declare class IModelHost {
274
298
  * @beta
275
299
  */
276
300
  static get appWorkspace(): Workspace;
301
+ /** Obtain the [[Workspace]] for an iTwin by discovering its settings container.
302
+ * All named dictionary resources in the container's [[WorkspaceDb]] are loaded into the workspace at [[SettingsPriority.iTwin]].
303
+ * @note This method requires an internet connection to discover the container.
304
+ * To use an iTwin workspace offline, use the overload that accepts [[WorkspaceDbSettingsProps]].
305
+ * @note The returned workspace is caller-owned. Call `close` when finished.
306
+ * @beta
307
+ */
308
+ static getITwinWorkspace(iTwinId: GuidString): Promise<OwnedWorkspace>;
309
+ /** Obtain the [[Workspace]] for an iTwin.
310
+ * The supplied [[WorkspaceDbSettingsProps]] are passed directly to [[Workspace.loadSettingsDictionary]].
311
+ * @note You can derive these from the `settingsSources` property on a previously returned workspace.
312
+ * @note The returned workspace is caller-owned. Call `close` when finished.
313
+ * @beta
314
+ */
315
+ static getITwinWorkspace(props: WorkspaceDbSettingsProps | WorkspaceDbSettingsProps[]): Promise<OwnedWorkspace>;
316
+ /** Save a named [[SettingsDictionary]] to the iTwin's settings container.
317
+ * If no iTwin settings container exists for `iTwinId`, one is created.
318
+ * The dictionary is stored as a named resource in the container's default [[WorkspaceDb]], where `name` is used as the resource name.
319
+ * @param iTwinId The iTwin whose settings container should be updated.
320
+ * @param name The name of the dictionary, used as the resource name in the [[WorkspaceDb]].
321
+ * @param settings The settings key-value pairs to store.
322
+ * @note uses [[IModelHost.userMoniker]] as the user name for acquiring the write lock on the settings container.
323
+ * @beta
324
+ */
325
+ static saveSettingDictionary(iTwinId: GuidString, name: string, settings: SettingsContainer): Promise<void>;
326
+ /** Delete a named [[SettingsDictionary]] from the iTwin's settings container.
327
+ * If no iTwin settings container exists, this method does nothing.
328
+ * @param iTwinId The iTwin whose settings container should be updated.
329
+ * @param name The name of the dictionary (resource name) to delete.
330
+ * @note uses [[IModelHost.userMoniker]] as the user name for acquiring the write lock on the settings container.
331
+ * @beta
332
+ */
333
+ static deleteSettingDictionary(iTwinId: GuidString, name: string): Promise<void>;
277
334
  /** The registry of schemas describing the [[Setting]]s for the application session.
278
335
  * Applications should register their schemas via methods like [[SettingsSchemas.addGroup]].
279
336
  * @beta
@@ -1 +1 @@
1
- {"version":3,"file":"IModelHost.d.ts","sourceRoot":"","sources":["../../src/IModelHost.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,YAAY,CAAC;AAKpB,OAAO,EAAE,WAAW,EAAU,OAAO,EAAiC,UAAU,EAAwB,OAAO,EAAmB,MAAM,qBAAqB,CAAC;AAC9J,OAAO,EAAE,mBAAmB,EAAe,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAc5E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAKjE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAM9E,gBAAgB;AAChB,MAAM,WAAW,iCAAiC;IAChD,IAAI,EA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CloudSqlite_1 = require("./CloudSqlite");
24
24
  const FunctionalSchema_1 = require("./domains/FunctionalSchema");
25
25
  const GenericSchema_1 = require("./domains/GenericSchema");
26
+ const EditTxn_1 = require("./EditTxn");
26
27
  const GeoCoordConfig_1 = require("./GeoCoordConfig");
27
28
  const IModelJsFs_1 = require("./IModelJsFs");
28
29
  const DevToolsRpcImpl_1 = require("./rpc-impl/DevToolsRpcImpl");
@@ -32,6 +33,8 @@ const SnapshotIModelRpcImpl_1 = require("./rpc-impl/SnapshotIModelRpcImpl");
32
33
  const RpcBackend_1 = require("./RpcBackend");
33
34
  const TileStorage_1 = require("./TileStorage");
34
35
  const Settings_1 = require("./workspace/Settings");
36
+ const SettingsDb_1 = require("./workspace/SettingsDb");
37
+ const SettingsEditor_1 = require("./workspace/SettingsEditor");
35
38
  const path_1 = require("path");
36
39
  const WorkspaceImpl_1 = require("./internal/workspace/WorkspaceImpl");
37
40
  const SettingsImpl_1 = require("./internal/workspace/SettingsImpl");
@@ -91,6 +94,12 @@ class IModelHostConfiguration {
91
94
  * @beta
92
95
  */
93
96
  useSemanticRebase;
97
+ /**
98
+ * Controls how writes through the implicit transaction are enforced.
99
+ * See [[IModelHostOptions.implicitWriteEnforcement]] for the meaning of each allowed value.
100
+ * @beta
101
+ */
102
+ implicitWriteEnforcement = "allow";
94
103
  }
95
104
  exports.IModelHostConfiguration = IModelHostConfiguration;
96
105
  /**
@@ -123,6 +132,21 @@ class ApplicationSettings extends SettingsImpl_1.SettingsImpl {
123
132
  }
124
133
  }
125
134
  }
135
+ /**
136
+ * Settings for an iTwin. May only include settings priority for iTwin and organization.
137
+ */
138
+ class ITwinWorkspaceSettings extends SettingsImpl_1.SettingsImpl {
139
+ verifyPriority(priority) {
140
+ if (priority <= Settings_1.SettingsPriority.application)
141
+ core_common_1.ITwinSettingsError.throwError("invalid-priority", { message: `Settings with priority ${priority} cannot be added to an iTwin workspace.` });
142
+ if (priority > Settings_1.SettingsPriority.iTwin)
143
+ core_common_1.ITwinSettingsError.throwError("invalid-priority", { message: `Settings with priority ${priority} cannot be added to an iTwin workspace.` });
144
+ }
145
+ *getSettingEntries(name) {
146
+ yield* super.getSettingEntries(name);
147
+ yield* IModelHost.appWorkspace.settings.getSettingEntries(name);
148
+ }
149
+ }
126
150
  const definedInStartup = (obj) => {
127
151
  if (obj === undefined)
128
152
  throw new Error("IModelHost.startup must be called first");
@@ -192,6 +216,69 @@ class IModelHost {
192
216
  * @beta
193
217
  */
194
218
  static get appWorkspace() { return definedInStartup(this._appWorkspace); }
219
+ /** @internal */
220
+ static async getITwinWorkspace(args) {
221
+ const isITwinId = typeof args === "string";
222
+ const workspace = (0, WorkspaceImpl_1.constructWorkspace)(new ITwinWorkspaceSettings());
223
+ try {
224
+ const settingsSources = isITwinId ? await SettingsEditor_1.SettingsContainers.getITwinSettingsSources(args) : args;
225
+ if (undefined === settingsSources)
226
+ return workspace;
227
+ workspace.settingsSources = settingsSources;
228
+ const problems = [];
229
+ await workspace.loadSettingsDictionary(settingsSources, problems);
230
+ if (problems.length > 0) {
231
+ const label = isITwinId ? `iTwin '${args}'` : "the supplied settings workspace db properties";
232
+ (0, WorkspaceImpl_1.throwWorkspaceDbLoadErrors)(`attempting to load workspace settings for ${label}`, problems);
233
+ }
234
+ return workspace;
235
+ }
236
+ catch (error) {
237
+ workspace.close();
238
+ throw error;
239
+ }
240
+ }
241
+ /** Save a named [[SettingsDictionary]] to the iTwin's settings container.
242
+ * If no iTwin settings container exists for `iTwinId`, one is created.
243
+ * The dictionary is stored as a named resource in the container's default [[WorkspaceDb]], where `name` is used as the resource name.
244
+ * @param iTwinId The iTwin whose settings container should be updated.
245
+ * @param name The name of the dictionary, used as the resource name in the [[WorkspaceDb]].
246
+ * @param settings The settings key-value pairs to store.
247
+ * @note uses [[IModelHost.userMoniker]] as the user name for acquiring the write lock on the settings container.
248
+ * @beta
249
+ */
250
+ static async saveSettingDictionary(iTwinId, name, settings) {
251
+ const { editor, container } = await SettingsEditor_1.SettingsEditor.constructForITwin(iTwinId);
252
+ try {
253
+ await container.withEditableDb(this.userMoniker, (db) => {
254
+ db.updateSettingsResource(settings, name);
255
+ }, { dbName: SettingsDb_1.settingsWorkspaceDbName });
256
+ }
257
+ finally {
258
+ editor.close();
259
+ }
260
+ }
261
+ /** Delete a named [[SettingsDictionary]] from the iTwin's settings container.
262
+ * If no iTwin settings container exists, this method does nothing.
263
+ * @param iTwinId The iTwin whose settings container should be updated.
264
+ * @param name The name of the dictionary (resource name) to delete.
265
+ * @note uses [[IModelHost.userMoniker]] as the user name for acquiring the write lock on the settings container.
266
+ * @beta
267
+ */
268
+ static async deleteSettingDictionary(iTwinId, name) {
269
+ const settingsEditor = await SettingsEditor_1.SettingsEditor.getForITwin(iTwinId);
270
+ if (undefined === settingsEditor)
271
+ return;
272
+ const { editor, container } = settingsEditor;
273
+ try {
274
+ await container.withEditableDb(this.userMoniker, (db) => {
275
+ db.removeString(name);
276
+ }, { dbName: SettingsDb_1.settingsWorkspaceDbName });
277
+ }
278
+ finally {
279
+ editor.close();
280
+ }
281
+ }
195
282
  /** The registry of schemas describing the [[Setting]]s for the application session.
196
283
  * Applications should register their schemas via methods like [[SettingsSchemas.addGroup]].
197
284
  * @beta
@@ -298,6 +385,7 @@ class IModelHost {
298
385
  this.loadNative(options);
299
386
  this.setupCacheDir(options);
300
387
  this.initializeWorkspace(options);
388
+ EditTxn_1.EditTxn.implicitWriteEnforcement = options.implicitWriteEnforcement ?? "allow";
301
389
  BriefcaseManager_1.BriefcaseManager.initialize((0, path_1.join)(this._cacheDir, "imodels"));
302
390
  [
303
391
  IModelReadRpcImpl_1.IModelReadRpcImpl,
@@ -345,6 +433,7 @@ class IModelHost {
345
433
  this._isValid = false;
346
434
  this.onBeforeShutdown.raiseEvent();
347
435
  this.configuration = undefined;
436
+ EditTxn_1.EditTxn.implicitWriteEnforcement = "allow";
348
437
  this.tileStorage = undefined;
349
438
  this._appWorkspace?.close();
350
439
  this._appWorkspace = undefined;
@@ -1 +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nCD,4CAmCC","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 IModelHost\n */\n\n// To avoid circular load errors, the \"Element\" classes must be loaded before IModelHost.\nimport \"./IModelDb\"; // DO NOT REMOVE OR MOVE THIS LINE!\n\nimport { IModelNative, loadNativePlatform } from \"./internal/NativePlatform\";\nimport * as os from \"node:os\";\nimport { NativeLibrary } from \"@bentley/imodeljs-native\";\nimport { AccessToken, assert, BeEvent, BentleyStatus, DbResult, Guid, GuidString, IModelStatus, Logger, Mutable, ProcessDetector } from \"@itwin/core-bentley\";\nimport { AuthorizationClient, IModelError, LocalDirName, SessionProps } from \"@itwin/core-common\";\nimport { AzureServerStorage, AzureServerStorageConfig, BlobServiceClientWrapper } from \"@itwin/object-storage-azure\";\nimport { BlobServiceClient, StorageSharedKeyCredential } from \"@azure/storage-blob\";\nimport type { ServerStorage } from \"@itwin/object-storage-core\";\nimport { BackendHubAccess, CreateNewIModelProps } from \"./BackendHubAccess\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\nimport { BisCoreSchema } from \"./BisCoreSchema\";\nimport { BriefcaseManager } from \"./BriefcaseManager\";\nimport { CloudSqlite } from \"./CloudSqlite\";\nimport { FunctionalSchema } from \"./domains/FunctionalSchema\";\nimport { GenericSchema } from \"./domains/GenericSchema\";\nimport { GeoCoordConfig } from \"./GeoCoordConfig\";\nimport { IModelJsFs } from \"./IModelJsFs\";\nimport { DevToolsRpcImpl } from \"./rpc-impl/DevToolsRpcImpl\";\nimport { IModelReadRpcImpl } from \"./rpc-impl/IModelReadRpcImpl\";\nimport { IModelTileRpcImpl } from \"./rpc-impl/IModelTileRpcImpl\";\nimport { SnapshotIModelRpcImpl } from \"./rpc-impl/SnapshotIModelRpcImpl\";\nimport { initializeRpcBackend } from \"./RpcBackend\";\nimport { TileStorage } from \"./TileStorage\";\nimport { SettingsContainer, SettingsPriority } from \"./workspace/Settings\";\nimport { SettingsSchemas } from \"./workspace/SettingsSchemas\";\nimport { Workspace, WorkspaceOpts } from \"./workspace/Workspace\";\nimport { join, normalize as normalizeDir } from \"path\";\nimport { constructWorkspace, OwnedWorkspace } from \"./internal/workspace/WorkspaceImpl\";\nimport { SettingsImpl } from \"./internal/workspace/SettingsImpl\";\nimport { constructSettingsSchemas } from \"./internal/workspace/SettingsSchemasImpl\";\nimport { _getHubAccess, _hubAccess, _setHubAccess } from \"./internal/Symbols\";\n\nconst loggerCategory = BackendLoggerCategory.IModelHost;\n\n// cspell:ignore nodereport fatalerror apicall alicloud rpcs\n\n/** @internal */\nexport interface CrashReportingConfigNameValuePair {\n name: string;\n value: string;\n}\n\n/** Configuration of the crash-reporting system.\n * @internal\n */\nexport interface CrashReportingConfig {\n /** The directory to which *.dmp and/or iModelJsNativeCrash*.properties.txt files are written. This directory will be created if it does not already exist. */\n crashDir: string;\n /** max # .dmp files that may exist in crashDir. The default is 50. */\n maxDumpsInDir?: number;\n /** Enable crash-dumps? If so, .dmp and .properties.txt files will be generated and written to crashDir in the event of an unhandled native-code exception. If not, only .properties.txt files will be written. The default is false. */\n enableCrashDumps?: boolean;\n /** If enableCrashDumps is true, do you want a full-memory dump? Defaults to false. */\n wantFullMemoryDumps?: boolean;\n /** Enable Node.js crash reporting? If so, report files will be generated in the event of an unhandled exception or fatal error and written to crashDir. The default is false. */\n enableNodeReport?: boolean;\n /** Additional name, value pairs to write to iModelJsNativeCrash*.properties.txt file in the event of a crash. */\n params?: CrashReportingConfigNameValuePair[];\n /** Run this .js file to process .dmp and Node.js crash reporting .json files in the event of a crash.\n * This script will be executed with a single command-line parameter: the name of the dump or Node.js report file.\n * In the case of a dump file, there will be a second file with the same basename and the extension \".properties.txt\".\n * Since it runs in a separate process, this script will have no access to the Javascript\n * context of the exiting backend. No default.\n */\n dumpProcessorScriptFileName?: string;\n /** Upload crash dump and node-reports to Bentley's crash-reporting service? Defaults to false */\n uploadToBentley?: boolean;\n}\n\n/** @beta */\nexport interface AzureBlobStorageCredentials {\n account: string;\n accessKey: string;\n baseUrl?: string;\n}\n\n/**\n * Options for [[IModelHost.startup]]\n * @public\n */\nexport interface IModelHostOptions {\n /**\n * The name of the *Profile* subdirectory of [[cacheDir]] for this process. If not present, \"default\" is used.\n * @see [[IModelHost.profileName]]\n * @beta\n */\n profileName?: string;\n\n /**\n * Root of the directory holding all the files that iTwin.js caches\n * - If not specified at startup a platform specific default is used -\n * - Windows: $(HOMEDIR)/AppData/Local/iModelJs/\n * - Mac/iOS: $(HOMEDIR)/Library/Caches/iModelJs/\n * - Linux: $(HOMEDIR)/.cache/iModelJs/\n * where $(HOMEDIR) is documented [here](https://nodejs.org/api/os.html#os_os_homedir)\n * - if specified, ensure it is set to a folder with read/write access.\n * @see [[IModelHost.cacheDir]] for the value it's set to after startup\n */\n cacheDir?: LocalDirName;\n\n /** The directory where application assets are found. */\n appAssetsDir?: LocalDirName;\n\n /**\n * Options for creating the [[IModelHost.appWorkspace]]\n * @beta\n */\n workspace?: WorkspaceOpts;\n\n /**\n * The kind of iModel hub server to use.\n */\n hubAccess?: BackendHubAccess;\n\n /** The Azure blob storage credentials to use for the tile cache service. If omitted and no external service implementation is provided, a local cache will be used.\n * @beta\n */\n tileCacheAzureCredentials?: AzureBlobStorageCredentials;\n\n /**\n * @beta\n * @note A reference implementation is set for AzureServerStorage from @itwin/object-storage-azure if [[tileCacheAzureCredentials]] property is set. To supply a different implementation for any service provider (such as AWS),\n * set this property with a custom ServerStorage.\n */\n tileCacheStorage?: ServerStorage;\n\n /** The maximum size in bytes to which a local sqlite database used for caching tiles can grow before it is purged of least-recently-used tiles.\n * The local cache is used only if an external cache has not been configured via [[tileCacheStorage]], and [[tileCacheAzureCredentials]].\n * Defaults to 1 GB. Must be an unsigned integer. A value of zero disables the local cache entirely.\n * @beta\n */\n maxTileCacheDbSize?: number;\n\n /** Whether to restrict tile cache URLs by client IP address (if available).\n * @beta\n */\n restrictTileUrlsByClientIp?: boolean;\n\n /** Whether to enable OpenTelemetry tracing.\n * Defaults to `false`.\n */\n enableOpenTelemetry?: boolean;\n\n /** Whether to compress cached tiles.\n * Defaults to `true`.\n */\n compressCachedTiles?: boolean;\n\n /** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileTreeProps]($common) should wait before returning a \"pending\" status.\n * @internal\n */\n tileTreeRequestTimeout?: number;\n\n /** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileContent]($common) should wait before returning a \"pending\" status.\n * @internal\n */\n tileContentRequestTimeout?: number;\n\n /** The backend will log when a tile took longer to load than this threshold in seconds.\n * @internal\n */\n logTileLoadTimeThreshold?: number;\n\n /** The backend will log when a tile is loaded with a size in bytes above this threshold.\n * @internal\n */\n logTileSizeThreshold?: number;\n\n /** Crash-reporting configuration\n * @internal\n */\n crashReportingConfig?: CrashReportingConfig;\n\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\n authorizationClient?: AuthorizationClient;\n\n /**\n * Automatically enable shared channel when opening iModels for read/write (see [Working With Channels]($docs/learning/backend/Channel.md)).\n * If not present, defaults to `true` for backwards compatibility. This means that the shared channel may be edited by default. Generally\n * that is undesirable because it allows applications to \"accidentally\" modify data it shouldn't be allowed to modify. Unfortunately the\n * previous versions of iTwin.js allowed it so this is necessary so they won't break.\n * Will be changed to default to `false` in 5.0.\n */\n allowSharedChannel?: boolean;\n\n /**\n * Setting this to true will revert to the previous behavior of using the native side for all CRUD operations.\n * While set to false, the getElement(), getModel() and getAspect() functions will use a thinned down native workflow to read the entities from the database.\n * This workflow performs work previously done on the native side in the TS side, resulting in performance improvements, if errors are detected,\n * this option can be set to true to revert to old workflow.\n */\n disableThinnedNativeInstanceWorkflow?: boolean;\n\n /**\n * Configuration controlling whether to disable the creation of restore points during pull/merge operations.\n * @beta\n */\n disableRestorePointOnPullMerge?: true;\n /**\n * Configuration controlling whether incremental schema loading is enabled or disabled.\n * @beta\n */\n incrementalSchemaLoading?: \"enabled\" | \"disabled\";\n /**\n * Configuration controlling whether to use semantic rebase or not.\n * @beta\n */\n useSemanticRebase?: boolean;\n}\n\n/** Configuration of core-backend.\n * @public\n */\nexport class IModelHostConfiguration implements IModelHostOptions {\n public static defaultTileRequestTimeout = 20 * 1000;\n public static defaultLogTileLoadTimeThreshold = 40;\n public static defaultLogTileSizeThreshold = 20 * 1000000;\n /** @internal */\n public static defaultMaxTileCacheDbSize = 1024 * 1024 * 1024;\n public appAssetsDir?: LocalDirName;\n public cacheDir?: LocalDirName;\n\n /** @beta */\n public workspace?: WorkspaceOpts;\n public hubAccess?: BackendHubAccess;\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\n public authorizationClient?: AuthorizationClient;\n /** @beta */\n public restrictTileUrlsByClientIp?: boolean;\n public compressCachedTiles?: boolean;\n /** @beta */\n public tileCacheAzureCredentials?: AzureBlobStorageCredentials;\n /** @internal */\n public tileTreeRequestTimeout = IModelHostConfiguration.defaultTileRequestTimeout;\n /** @internal */\n public tileContentRequestTimeout = IModelHostConfiguration.defaultTileRequestTimeout;\n /** @internal */\n public logTileLoadTimeThreshold = IModelHostConfiguration.defaultLogTileLoadTimeThreshold;\n /** @internal */\n public logTileSizeThreshold = IModelHostConfiguration.defaultLogTileSizeThreshold;\n /** @internal */\n public crashReportingConfig?: CrashReportingConfig;\n /**\n * Configuration controlling whether to use the thinned down native instance functions for element, model, and aspect CRUD operations\n * or use the previous behavior of using the native side for all CRUD operations. Set to true to revert to the previous behavior.\n * @beta\n */\n public disableThinnedNativeInstanceWorkflow?: boolean;\n\n /**\n * Configuration controlling whether to disable the creation of restore points during pull/merge operations.\n * @beta\n */\n public disableRestorePointOnPullMerge?: true;\n /**\n * Configuration controlling whether incremental schema loading is disabled.\n * Default is \"disabled\" at the moment to preserve existing behavior.\n * @beta\n */\n public incrementalSchemaLoading: \"enabled\" | \"disabled\" = \"disabled\";\n /**\n * Configuration controlling whether to use semantic rebase or not. By default it is undefined meaning semantic rebase is not used.\n * @beta\n */\n public useSemanticRebase?: boolean;\n}\n\n/**\n * Settings for `IModelHost.appWorkspace`.\n * @note this includes the default dictionary from the SettingsSpecRegistry\n */\nclass ApplicationSettings extends SettingsImpl {\n private _remove?: VoidFunction;\n protected override verifyPriority(priority: SettingsPriority) {\n if (priority > SettingsPriority.application) // only application or lower may appear in ApplicationSettings\n throw new Error(\"Use IModelSettings\");\n }\n private updateDefaults() {\n const defaults: SettingsContainer = {};\n for (const [schemaName, val] of IModelHost.settingsSchemas.settingDefs) {\n if (val.default)\n defaults[schemaName] = val.default;\n }\n this.addDictionary({ name: \"_default_\", priority: 0 }, defaults);\n }\n\n public constructor() {\n super();\n this._remove = IModelHost.settingsSchemas.onSchemaChanged.addListener(() => this.updateDefaults());\n this.updateDefaults();\n }\n\n public override close() {\n if (this._remove) {\n this._remove();\n this._remove = undefined;\n }\n }\n}\n\nconst definedInStartup = <T>(obj: T | undefined): T => {\n if (obj === undefined)\n throw new Error(\"IModelHost.startup must be called first\");\n return obj;\n};\n\n/** IModelHost initializes ($backend) and captures its configuration. A backend must call [[IModelHost.startup]] before using any backend classes.\n * See [the learning article]($docs/learning/backend/IModelHost.md)\n * @public\n */\nexport class IModelHost {\n private constructor() { }\n\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\n public static authorizationClient?: AuthorizationClient;\n\n public static backendVersion = \"\";\n private static _profileName: string;\n private static _cacheDir = \"\";\n private static _settingsSchemas?: SettingsSchemas;\n private static _appWorkspace?: OwnedWorkspace;\n\n // Omit the hubAccess field from configuration so it stays internal.\n public static configuration?: Omit<IModelHostOptions, \"hubAccess\">;\n\n /**\n * The name of the *Profile* directory (a subdirectory of \"[[cacheDir]]/profiles/\") for this process.\n *\n * The *Profile* directory is used to cache data that is specific to a type-of-usage of the iTwin.js library.\n * It is important that information in the profile cache be consistent but isolated across sessions (i.e.\n * data for a profile is maintained between runs, but each profile is completely independent and\n * unaffected by the presence or use of others.)\n * @note **Only one process at a time may be using a given profile**, and an exception will be thrown by [[startup]]\n * if a second process attempts to use the same profile.\n * @beta\n */\n public static get profileName(): string {\n return this._profileName;\n }\n\n /** The full path of the Profile directory.\n * @see [[profileName]]\n * @beta\n */\n public static get profileDir(): LocalDirName {\n return join(this._cacheDir, \"profiles\", this._profileName);\n }\n\n /** Event raised during startup to allow loading settings data */\n public static readonly onWorkspaceStartup = new BeEvent<() => void>();\n\n /** Event raised just after the backend IModelHost was started */\n public static readonly onAfterStartup = new BeEvent<() => void>();\n\n /** Event raised just before the backend IModelHost is to be shut down */\n public static readonly onBeforeShutdown = new BeEvent<() => void>();\n\n /** @internal */\n public static readonly session: Mutable<SessionProps> = { applicationId: \"2686\", applicationVersion: \"1.0.0\", sessionId: \"\" };\n\n /** A uniqueId for this session */\n public static get sessionId() { return this.session.sessionId; }\n public static set sessionId(id: GuidString) { this.session.sessionId = id; }\n\n /** The Id of this application - needs to be set only if it is an agent application. The applicationId will otherwise originate at the frontend. */\n public static get applicationId() { return this.session.applicationId; }\n public static set applicationId(id: string) { this.session.applicationId = id; }\n\n /** The version of this application - needs to be set if is an agent application. The applicationVersion will otherwise originate at the frontend. */\n public static get applicationVersion() { return this.session.applicationVersion; }\n public static set applicationVersion(version: string) { this.session.applicationVersion = version; }\n\n /** A string that can identify the current user to other users when collaborating. */\n public static userMoniker = \"unknown\";\n\n /** Root directory holding files that iTwin.js caches */\n public static get cacheDir(): LocalDirName { return this._cacheDir; }\n\n /** The application [[Workspace]] for this `IModelHost`\n * @note this `Workspace` only holds [[WorkspaceContainer]]s and [[Settings]] scoped to the currently loaded application(s).\n * All organization, iTwin, and iModel based containers or settings must be accessed through [[IModelDb.workspace]] and\n * attempting to add them to this Workspace will fail.\n * @beta\n */\n public static get appWorkspace(): Workspace { return definedInStartup(this._appWorkspace); }\n\n /** The registry of schemas describing the [[Setting]]s for the application session.\n * Applications should register their schemas via methods like [[SettingsSchemas.addGroup]].\n * @beta\n */\n public static get settingsSchemas(): SettingsSchemas { return definedInStartup(this._settingsSchemas); }\n\n /** The optional [[FileNameResolver]] that resolves keys and partial file names for snapshot iModels.\n * @deprecated in 4.10 - will not be removed until after 2026-06-13. When opening a snapshot by file name, ensure to pass already resolved path. Using a key to open a snapshot is now deprecated.\n */\n public static snapshotFileNameResolver?: FileNameResolver; // eslint-disable-line @typescript-eslint/no-deprecated\n\n /** Get the current access token for this IModelHost, or a blank string if none is available.\n * @note for web backends, this will *always* return a blank string because the backend itself has no token (but never needs one either.)\n * For all IpcHosts, where this backend is servicing a single frontend, this will be the user's token. For ElectronHost, the backend\n * obtains the token and forwards it to the frontend.\n * @note accessTokens expire periodically and are automatically refreshed, if possible. Therefore tokens should not be saved, and the value\n * returned by this method may change over time throughout the course of a session.\n */\n public static async getAccessToken(): Promise<AccessToken> {\n try {\n return (await IModelHost.authorizationClient?.getAccessToken()) ?? \"\";\n } catch {\n return \"\";\n }\n }\n\n private static loadNative(options: IModelHostOptions) {\n loadNativePlatform();\n\n if (options.crashReportingConfig && options.crashReportingConfig.crashDir && !ProcessDetector.isElectronAppBackend && !ProcessDetector.isMobileAppBackend) {\n IModelNative.platform.setCrashReporting(options.crashReportingConfig);\n\n Logger.logTrace(loggerCategory, \"Configured crash reporting\", {\n enableCrashDumps: options.crashReportingConfig?.enableCrashDumps,\n wantFullMemoryDumps: options.crashReportingConfig?.wantFullMemoryDumps,\n enableNodeReport: options.crashReportingConfig?.enableNodeReport,\n uploadToBentley: options.crashReportingConfig?.uploadToBentley,\n });\n\n if (options.crashReportingConfig.enableNodeReport) {\n if (process.report !== undefined) {\n process.report.reportOnFatalError = true;\n process.report.reportOnUncaughtException = true;\n process.report.directory = options.crashReportingConfig.crashDir;\n Logger.logTrace(loggerCategory, \"Configured Node.js crash reporting\");\n } else {\n Logger.logWarning(loggerCategory, \"Unable to configure Node.js crash reporting\");\n }\n }\n }\n }\n\n /** @internal */\n public static tileStorage?: TileStorage;\n\n private static _hubAccess?: BackendHubAccess;\n /** @internal */\n public static [_setHubAccess](hubAccess: BackendHubAccess | undefined) { this._hubAccess = hubAccess; }\n\n /** get the current hubAccess, if present.\n * @internal\n */\n public static [_getHubAccess](): BackendHubAccess | undefined { return this._hubAccess; }\n\n /** Provides access to the IModelHub for this IModelHost\n * @internal\n * @note If [[IModelHostOptions.hubAccess]] was undefined when initializing this class, accessing this property will throw an error.\n * To determine whether one is present, use [[_getHubAccess]].\n */\n public static get [_hubAccess](): BackendHubAccess {\n if (IModelHost._hubAccess === undefined)\n throw new IModelError(IModelStatus.BadRequest, \"No BackendHubAccess supplied in IModelHostOptions\");\n return IModelHost._hubAccess;\n }\n\n private static initializeWorkspace(configuration: IModelHostOptions) {\n const settingAssets = join(KnownLocations.packageAssetsDir, \"Settings\");\n this._settingsSchemas = constructSettingsSchemas();\n this._settingsSchemas.addDirectory(join(settingAssets, \"Schemas\"));\n this._appWorkspace = constructWorkspace(new ApplicationSettings(), configuration.workspace);\n\n // Create the CloudCache for Workspaces. This will fail if another process is already using the same profile.\n try {\n this.appWorkspace.getCloudCache();\n } catch (e: any) {\n throw (e.errorNumber === DbResult.BE_SQLITE_BUSY) ? new IModelError(DbResult.BE_SQLITE_BUSY, `Profile [${this.profileDir}] is already in use by another process`) : e;\n }\n\n this.appWorkspace.settings.addDirectory(settingAssets, SettingsPriority.defaults);\n\n GeoCoordConfig.onStartup();\n // allow applications to load their default settings\n this.onWorkspaceStartup.raiseEvent();\n }\n\n private static _isValid = false;\n\n /** true between a successful call to [[startup]] and before [[shutdown]] */\n public static get isValid() {\n return IModelHost._isValid;\n }\n\n /** This method must be called before any iTwin.js services are used.\n * @param options Host configuration data.\n * Raises [[onAfterStartup]].\n * @see [[shutdown]].\n */\n public static async startup(options?: IModelHostOptions): Promise<void> {\n if (this._isValid)\n return; // we're already initialized\n this._isValid = true;\n\n options = options ?? {};\n if (this.sessionId === \"\")\n this.sessionId = Guid.createValue();\n\n this.authorizationClient = options.authorizationClient;\n\n this.backendVersion = require(\"../../package.json\").version; // eslint-disable-line @typescript-eslint/no-require-imports\n initializeRpcBackend(options.enableOpenTelemetry);\n\n this.loadNative(options);\n this.setupCacheDir(options);\n this.initializeWorkspace(options);\n\n BriefcaseManager.initialize(join(this._cacheDir, \"imodels\"));\n\n [\n IModelReadRpcImpl,\n IModelTileRpcImpl,\n SnapshotIModelRpcImpl, // eslint-disable-line @typescript-eslint/no-deprecated\n DevToolsRpcImpl,\n ].forEach((rpc) => rpc.register()); // register all of the RPC implementations\n\n [\n BisCoreSchema,\n GenericSchema,\n FunctionalSchema,\n ].forEach((schema) => schema.registerSchema()); // register all of the schemas\n\n const { hubAccess, ...otherOptions } = options;\n if (undefined !== hubAccess)\n this._hubAccess = hubAccess;\n\n this.configuration = otherOptions;\n this.setupTileCache();\n\n process.once(\"beforeExit\", IModelHost.shutdown);\n this.onAfterStartup.raiseEvent();\n }\n\n private static setupCacheDir(configuration: IModelHostOptions) {\n this._cacheDir = normalizeDir(configuration.cacheDir ?? NativeLibrary.defaultCacheDir);\n IModelJsFs.recursiveMkDirSync(this._cacheDir);\n\n this._profileName = configuration.profileName ?? \"default\";\n Logger.logInfo(loggerCategory, `cacheDir: [${this.cacheDir}], profileDir: [${this.profileDir}]`);\n }\n\n /** This method must be called when an iTwin.js host is shut down. Raises [[onBeforeShutdown]] */\n public static async shutdown(this: void): Promise<void> {\n // Note: This method is set as a node listener where `this` is unbound. Call private method to\n // ensure `this` is correct. Don't combine these methods.\n return IModelHost.doShutdown();\n }\n\n /**\n * Create a new iModel.\n * @returns the Guid of the newly created iModel.\n * @throws [IModelError]($common) in case of errors.\n * @note If [[IModelHostOptions.hubAccess]] was undefined in the call to [[startup]], this function will throw an error.\n */\n public static async createNewIModel(arg: CreateNewIModelProps): Promise<GuidString> {\n return this[_hubAccess].createNewIModel(arg);\n }\n\n private static async doShutdown() {\n if (!this._isValid)\n return;\n\n this._isValid = false;\n this.onBeforeShutdown.raiseEvent();\n\n this.configuration = undefined;\n this.tileStorage = undefined;\n\n this._appWorkspace?.close();\n this._appWorkspace = undefined;\n this._settingsSchemas = undefined;\n\n CloudSqlite.CloudCaches.destroy();\n process.removeListener(\"beforeExit\", IModelHost.shutdown);\n }\n\n /**\n * Add or update a property that should be included in a crash report.\n * @internal\n */\n public static setCrashReportProperty(name: string, value: string): void {\n IModelNative.platform.setCrashReportProperty(name, value);\n }\n\n /**\n * Remove a previously defined property so that will not be included in a crash report.\n * @internal\n */\n public static removeCrashReportProperty(name: string): void {\n IModelNative.platform.setCrashReportProperty(name, undefined);\n }\n\n /**\n * Get all properties that will be included in a crash report.\n * @internal\n */\n public static getCrashReportProperties(): CrashReportingConfigNameValuePair[] {\n return IModelNative.platform.getCrashReportProperties();\n }\n\n /** The directory where application assets may be found */\n public static get appAssetsDir(): string | undefined {\n return undefined !== IModelHost.configuration ? IModelHost.configuration.appAssetsDir : undefined;\n }\n\n /** The time, in milliseconds, for which IModelTileRpcInterface.requestTileTreeProps should wait before returning a \"pending\" status.\n * @internal\n */\n public static get tileTreeRequestTimeout(): number {\n return IModelHost.configuration?.tileTreeRequestTimeout ?? IModelHostConfiguration.defaultTileRequestTimeout;\n }\n /** The time, in milliseconds, for which IModelTileRpcInterface.requestTileContent should wait before returning a \"pending\" status.\n * @internal\n */\n public static get tileContentRequestTimeout(): number {\n return IModelHost.configuration?.tileContentRequestTimeout ?? IModelHostConfiguration.defaultTileRequestTimeout;\n }\n\n /** The backend will log when a tile took longer to load than this threshold in seconds. */\n public static get logTileLoadTimeThreshold(): number {\n return IModelHost.configuration?.logTileLoadTimeThreshold ?? IModelHostConfiguration.defaultLogTileLoadTimeThreshold;\n }\n /** The backend will log when a tile is loaded with a size in bytes above this threshold. */\n public static get logTileSizeThreshold(): number {\n return IModelHost.configuration?.logTileSizeThreshold ?? IModelHostConfiguration.defaultLogTileSizeThreshold;\n }\n\n /** Whether external tile caching is active.\n * @internal\n */\n public static get usingExternalTileCache(): boolean {\n return undefined !== IModelHost.tileStorage;\n }\n\n /** Whether to restrict tile cache URLs by client IP address.\n * @internal\n */\n public static get restrictTileUrlsByClientIp(): boolean {\n return undefined !== IModelHost.configuration && (IModelHost.configuration.restrictTileUrlsByClientIp ? true : false);\n }\n\n /** Whether to compress cached tiles.\n * @internal\n */\n public static get compressCachedTiles(): boolean {\n return false !== IModelHost.configuration?.compressCachedTiles;\n }\n\n /**\n * Whether to use semantic rebase or not.\n * @internal\n */\n public static get useSemanticRebase(): boolean {\n return undefined !== IModelHost.configuration && (IModelHost.configuration.useSemanticRebase ? true : false);\n }\n\n private static setupTileCache() {\n assert(undefined !== IModelHost.configuration);\n const config = IModelHost.configuration;\n const storage = config.tileCacheStorage;\n const credentials = config.tileCacheAzureCredentials;\n\n if (!storage && !credentials) {\n IModelNative.platform.setMaxTileCacheSize(config.maxTileCacheDbSize ?? IModelHostConfiguration.defaultMaxTileCacheDbSize);\n return;\n }\n\n IModelNative.platform.setMaxTileCacheSize(0);\n if (credentials) {\n if (storage)\n throw new IModelError(BentleyStatus.ERROR, \"Cannot use both Azure and custom cloud storage providers for tile cache.\");\n this.setupAzureTileCache(credentials);\n }\n if (storage)\n IModelHost.tileStorage = new TileStorage(storage);\n }\n\n private static setupAzureTileCache(credentials: AzureBlobStorageCredentials) {\n const storageConfig: AzureServerStorageConfig = {\n accountName: credentials.account,\n accountKey: credentials.accessKey,\n baseUrl: credentials.baseUrl ?? `https://${credentials.account}.blob.core.windows.net`,\n }\n const blobServiceClient = new BlobServiceClient(\n storageConfig.baseUrl,\n new StorageSharedKeyCredential(storageConfig.accountName, storageConfig.accountKey),\n );\n const azureStorage: ServerStorage = new AzureServerStorage(storageConfig, new BlobServiceClientWrapper(blobServiceClient))\n IModelHost.tileStorage = new TileStorage(azureStorage);\n }\n\n /** @internal */\n public static computeSchemaChecksum(arg: { schemaXmlPath: string, referencePaths: string[], exactMatch?: boolean }): string {\n return IModelNative.platform.computeSchemaChecksum(arg);\n }\n}\n\n/** Information about the platform on which the app is running.\n * @public\n */\nexport class Platform {\n /** Get the name of the platform. */\n public static get platformName(): \"win32\" | \"linux\" | \"darwin\" | \"ios\" | \"android\" | \"uwp\" {\n return process.platform as any;\n }\n}\n\n/** Well known directories that may be used by the application.\n * @public\n */\nexport class KnownLocations {\n\n /** The directory where the imodeljs-native assets are stored. */\n public static get nativeAssetsDir(): LocalDirName {\n return IModelNative.platform.DgnDb.getAssetsDir();\n }\n\n /** The directory where the core-backend assets are stored. */\n public static get packageAssetsDir(): LocalDirName {\n return join(__dirname, \"assets\");\n }\n\n /** The temporary directory. */\n public static get tmpdir(): LocalDirName {\n return os.tmpdir();\n }\n}\n\n/** Extend this class to provide custom file name resolution behavior.\n * @note Only `tryResolveKey` and/or `tryResolveFileName` need to be overridden as the implementations of `resolveKey` and `resolveFileName` work for most purposes.\n * @see [[IModelHost.snapshotFileNameResolver]]\n * @public\n * @deprecated in 4.10 - will not be removed until after 2026-06-13. When opening a snapshot by file name, ensure to pass already resolved path. Using a key to open a snapshot is now deprecated.\n */\nexport abstract class FileNameResolver {\n /** Resolve a file name from the specified key.\n * @param _fileKey The key that identifies the file name in a `Map` or other similar data structure.\n * @returns The resolved file name or `undefined` if not found.\n */\n public tryResolveKey(_fileKey: string): string | undefined { return undefined; }\n /** Resolve a file name from the specified key.\n * @param fileKey The key that identifies the file name in a `Map` or other similar data structure.\n * @returns The resolved file name.\n * @throws [[IModelError]] if not found.\n */\n public resolveKey(fileKey: string): string {\n const resolvedFileName: string | undefined = this.tryResolveKey(fileKey);\n if (undefined === resolvedFileName) {\n throw new IModelError(IModelStatus.NotFound, `${fileKey} not resolved`);\n }\n return resolvedFileName;\n }\n /** Resolve the input file name, which may be a partial name, into a full path file name.\n * @param inFileName The partial file name.\n * @returns The resolved full path file name or `undefined` if not found.\n */\n public tryResolveFileName(inFileName: string): string | undefined { return inFileName; }\n /** Resolve the input file name, which may be a partial name, into a full path file name.\n * @param inFileName The partial file name.\n * @returns The resolved full path file name.\n * @throws [[IModelError]] if not found.\n */\n public resolveFileName(inFileName: string): string {\n const resolvedFileName: string | undefined = this.tryResolveFileName(inFileName);\n if (undefined === resolvedFileName) {\n throw new IModelError(IModelStatus.NotFound, `${inFileName} not resolved`);\n }\n return resolvedFileName;\n }\n}\n"]}
1
+ {"version":3,"file":"IModelHost.js","sourceRoot":"","sources":["../../src/IModelHost.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yFAAyF;AACzF,sBAAoB,CAAC,mCAAmC;AAExD,8DAA6E;AAC7E,8BAA8B;AAC9B,8DAAyD;AACzD,sDAA8J;AAC9J,oDAAsH;AACtH,sEAAqH;AACrH,sDAAoF;AAGpF,mEAAgE;AAChE,mDAAgD;AAChD,yDAAsD;AACtD,+CAA4C;AAC5C,iEAA8D;AAC9D,2DAAwD;AACxD,uCAAoC;AACpC,qDAAkD;AAClD,6CAA0C;AAC1C,gEAA6D;AAC7D,oEAAiE;AACjE,oEAAiE;AACjE,4EAAyE;AACzE,6CAAoD;AACpD,+CAA4C;AAC5C,mDAA6G;AAC7G,uDAAiE;AACjE,+DAAgF;AAGhF,+BAAuD;AACvD,sEAAoH;AACpH,oEAAiE;AACjE,kFAAoF;AACpF,gDAA8E;AAE9E,MAAM,cAAc,GAAG,6CAAqB,CAAC,UAAU,CAAC;AAoMxD;;GAEG;AACH,MAAa,uBAAuB;IAC3B,MAAM,CAAC,yBAAyB,GAAG,EAAE,GAAG,IAAI,CAAC;IAC7C,MAAM,CAAC,+BAA+B,GAAG,EAAE,CAAC;IAC5C,MAAM,CAAC,2BAA2B,GAAG,EAAE,GAAG,OAAO,CAAC;IACzD,gBAAgB;IACT,MAAM,CAAC,yBAAyB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACtD,YAAY,CAAgB;IAC5B,QAAQ,CAAgB;IAE/B,YAAY;IACL,SAAS,CAAiB;IAC1B,SAAS,CAAoB;IACpC,uEAAuE;IAChE,mBAAmB,CAAuB;IACjD,YAAY;IACL,0BAA0B,CAAW;IACrC,mBAAmB,CAAW;IACrC,Y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AC,QAAQ,EAAE,GAAG,OAAO,eAAe,CAAC,CAAC;QAC1E,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IACD;;;OAGG;IACI,kBAAkB,CAAC,UAAkB,IAAwB,OAAO,UAAU,CAAC,CAAC,CAAC;IACxF;;;;OAIG;IACI,eAAe,CAAC,UAAkB;QACvC,MAAM,gBAAgB,GAAuB,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACjF,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC;YACnC,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,QAAQ,EAAE,GAAG,UAAU,eAAe,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF;AAnCD,4CAmCC","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 IModelHost\n */\n\n// To avoid circular load errors, the \"Element\" classes must be loaded before IModelHost.\nimport \"./IModelDb\"; // DO NOT REMOVE OR MOVE THIS LINE!\n\nimport { IModelNative, loadNativePlatform } from \"./internal/NativePlatform\";\nimport * as os from \"node:os\";\nimport { NativeLibrary } from \"@bentley/imodeljs-native\";\nimport { AccessToken, assert, BeEvent, BentleyStatus, DbResult, Guid, GuidString, IModelStatus, Logger, Mutable, ProcessDetector } from \"@itwin/core-bentley\";\nimport { AuthorizationClient, IModelError, ITwinSettingsError, LocalDirName, SessionProps } from \"@itwin/core-common\";\nimport { AzureServerStorage, AzureServerStorageConfig, BlobServiceClientWrapper } from \"@itwin/object-storage-azure\";\nimport { BlobServiceClient, StorageSharedKeyCredential } from \"@azure/storage-blob\";\nimport type { ServerStorage } from \"@itwin/object-storage-core\";\nimport { BackendHubAccess, CreateNewIModelProps } from \"./BackendHubAccess\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\nimport { BisCoreSchema } from \"./BisCoreSchema\";\nimport { BriefcaseManager } from \"./BriefcaseManager\";\nimport { CloudSqlite } from \"./CloudSqlite\";\nimport { FunctionalSchema } from \"./domains/FunctionalSchema\";\nimport { GenericSchema } from \"./domains/GenericSchema\";\nimport { EditTxn } from \"./EditTxn\";\nimport { GeoCoordConfig } from \"./GeoCoordConfig\";\nimport { IModelJsFs } from \"./IModelJsFs\";\nimport { DevToolsRpcImpl } from \"./rpc-impl/DevToolsRpcImpl\";\nimport { IModelReadRpcImpl } from \"./rpc-impl/IModelReadRpcImpl\";\nimport { IModelTileRpcImpl } from \"./rpc-impl/IModelTileRpcImpl\";\nimport { SnapshotIModelRpcImpl } from \"./rpc-impl/SnapshotIModelRpcImpl\";\nimport { initializeRpcBackend } from \"./RpcBackend\";\nimport { TileStorage } from \"./TileStorage\";\nimport { type Setting, SettingsContainer, SettingsDictionary, SettingsPriority } from \"./workspace/Settings\";\nimport { settingsWorkspaceDbName } from \"./workspace/SettingsDb\";\nimport { SettingsContainers, SettingsEditor } from \"./workspace/SettingsEditor\";\nimport { SettingsSchemas } from \"./workspace/SettingsSchemas\";\nimport { Workspace, WorkspaceDbLoadError, WorkspaceDbSettingsProps, WorkspaceOpts } from \"./workspace/Workspace\";\nimport { join, normalize as normalizeDir } from \"path\";\nimport { constructWorkspace, OwnedWorkspace, throwWorkspaceDbLoadErrors } from \"./internal/workspace/WorkspaceImpl\";\nimport { SettingsImpl } from \"./internal/workspace/SettingsImpl\";\nimport { constructSettingsSchemas } from \"./internal/workspace/SettingsSchemasImpl\";\nimport { _getHubAccess, _hubAccess, _setHubAccess } from \"./internal/Symbols\";\n\nconst loggerCategory = BackendLoggerCategory.IModelHost;\n\n// cspell:ignore nodereport fatalerror apicall alicloud rpcs\n\n/** @internal */\nexport interface CrashReportingConfigNameValuePair {\n name: string;\n value: string;\n}\n\n/** Configuration of the crash-reporting system.\n * @internal\n */\nexport interface CrashReportingConfig {\n /** The directory to which *.dmp and/or iModelJsNativeCrash*.properties.txt files are written. This directory will be created if it does not already exist. */\n crashDir: string;\n /** max # .dmp files that may exist in crashDir. The default is 50. */\n maxDumpsInDir?: number;\n /** Enable crash-dumps? If so, .dmp and .properties.txt files will be generated and written to crashDir in the event of an unhandled native-code exception. If not, only .properties.txt files will be written. The default is false. */\n enableCrashDumps?: boolean;\n /** If enableCrashDumps is true, do you want a full-memory dump? Defaults to false. */\n wantFullMemoryDumps?: boolean;\n /** Enable Node.js crash reporting? If so, report files will be generated in the event of an unhandled exception or fatal error and written to crashDir. The default is false. */\n enableNodeReport?: boolean;\n /** Additional name, value pairs to write to iModelJsNativeCrash*.properties.txt file in the event of a crash. */\n params?: CrashReportingConfigNameValuePair[];\n /** Run this .js file to process .dmp and Node.js crash reporting .json files in the event of a crash.\n * This script will be executed with a single command-line parameter: the name of the dump or Node.js report file.\n * In the case of a dump file, there will be a second file with the same basename and the extension \".properties.txt\".\n * Since it runs in a separate process, this script will have no access to the Javascript\n * context of the exiting backend. No default.\n */\n dumpProcessorScriptFileName?: string;\n /** Upload crash dump and node-reports to Bentley's crash-reporting service? Defaults to false */\n uploadToBentley?: boolean;\n}\n\n/** @beta */\nexport interface AzureBlobStorageCredentials {\n account: string;\n accessKey: string;\n baseUrl?: string;\n}\n\n/** Controls how iModel writes through the implicit transaction are enforced.\n *\n * Allowed values:\n * - \"allow\": preserve pre-version 5.8.0 behavior for backwards compatibility.\n * - \"log\": allow the operation but log each implicit write as an error case.\n * - \"throw\": reject writes through the implicit transaction and require explicit EditTxns.\n * @beta\n */\nexport type ImplicitWriteEnforcement = \"allow\" | \"log\" | \"throw\";\n\n/**\n * Options for [[IModelHost.startup]]\n * @public\n */\nexport interface IModelHostOptions {\n /**\n * The name of the *Profile* subdirectory of [[cacheDir]] for this process. If not present, \"default\" is used.\n * @see [[IModelHost.profileName]]\n * @beta\n */\n profileName?: string;\n\n /**\n * Root of the directory holding all the files that iTwin.js caches\n * - If not specified at startup a platform specific default is used -\n * - Windows: $(HOMEDIR)/AppData/Local/iModelJs/\n * - Mac/iOS: $(HOMEDIR)/Library/Caches/iModelJs/\n * - Linux: $(HOMEDIR)/.cache/iModelJs/\n * where $(HOMEDIR) is documented [here](https://nodejs.org/api/os.html#os_os_homedir)\n * - if specified, ensure it is set to a folder with read/write access.\n * @see [[IModelHost.cacheDir]] for the value it's set to after startup\n */\n cacheDir?: LocalDirName;\n\n /** The directory where application assets are found. */\n appAssetsDir?: LocalDirName;\n\n /**\n * Options for creating the [[IModelHost.appWorkspace]]\n * @beta\n */\n workspace?: WorkspaceOpts;\n\n /**\n * The kind of iModel hub server to use.\n */\n hubAccess?: BackendHubAccess;\n\n /** The Azure blob storage credentials to use for the tile cache service. If omitted and no external service implementation is provided, a local cache will be used.\n * @beta\n */\n tileCacheAzureCredentials?: AzureBlobStorageCredentials;\n\n /**\n * @beta\n * @note A reference implementation is set for AzureServerStorage from @itwin/object-storage-azure if [[tileCacheAzureCredentials]] property is set. To supply a different implementation for any service provider (such as AWS),\n * set this property with a custom ServerStorage.\n */\n tileCacheStorage?: ServerStorage;\n\n /** The maximum size in bytes to which a local sqlite database used for caching tiles can grow before it is purged of least-recently-used tiles.\n * The local cache is used only if an external cache has not been configured via [[tileCacheStorage]], and [[tileCacheAzureCredentials]].\n * Defaults to 1 GB. Must be an unsigned integer. A value of zero disables the local cache entirely.\n * @beta\n */\n maxTileCacheDbSize?: number;\n\n /** Whether to restrict tile cache URLs by client IP address (if available).\n * @beta\n */\n restrictTileUrlsByClientIp?: boolean;\n\n /** Whether to enable OpenTelemetry tracing.\n * Defaults to `false`.\n */\n enableOpenTelemetry?: boolean;\n\n /** Whether to compress cached tiles.\n * Defaults to `true`.\n */\n compressCachedTiles?: boolean;\n\n /** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileTreeProps]($common) should wait before returning a \"pending\" status.\n * @internal\n */\n tileTreeRequestTimeout?: number;\n\n /** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileContent]($common) should wait before returning a \"pending\" status.\n * @internal\n */\n tileContentRequestTimeout?: number;\n\n /** The backend will log when a tile took longer to load than this threshold in seconds.\n * @internal\n */\n logTileLoadTimeThreshold?: number;\n\n /** The backend will log when a tile is loaded with a size in bytes above this threshold.\n * @internal\n */\n logTileSizeThreshold?: number;\n\n /** Crash-reporting configuration\n * @internal\n */\n crashReportingConfig?: CrashReportingConfig;\n\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\n authorizationClient?: AuthorizationClient;\n\n /**\n * Automatically enable shared channel when opening iModels for read/write (see [Working With Channels]($docs/learning/backend/Channel.md)).\n * If not present, defaults to `true` for backwards compatibility. This means that the shared channel may be edited by default. Generally\n * that is undesirable because it allows applications to \"accidentally\" modify data it shouldn't be allowed to modify. Unfortunately the\n * previous versions of iTwin.js allowed it so this is necessary so they won't break.\n * Will be changed to default to `false` in 5.0.\n */\n allowSharedChannel?: boolean;\n\n /**\n * Setting this to true will revert to the previous behavior of using the native side for all CRUD operations.\n * While set to false, the getElement(), getModel() and getAspect() functions will use a thinned down native workflow to read the entities from the database.\n * This workflow performs work previously done on the native side in the TS side, resulting in performance improvements, if errors are detected,\n * this option can be set to true to revert to old workflow.\n */\n disableThinnedNativeInstanceWorkflow?: boolean;\n\n /**\n * Configuration controlling whether to disable the creation of restore points during pull/merge operations.\n * @beta\n */\n disableRestorePointOnPullMerge?: true;\n /**\n * Configuration controlling whether incremental schema loading is enabled or disabled.\n * @beta\n */\n incrementalSchemaLoading?: \"enabled\" | \"disabled\";\n /**\n * Configuration controlling whether to use semantic rebase or not.\n * @beta\n */\n useSemanticRebase?: boolean;\n\n /**\n * Controls how writes through the implicit transaction are enforced.\n * See [[ImplicitWriteEnforcement]] for the allowed values.\n * Defaults to \"allow\" for backwards compatibility.\n * @beta\n */\n implicitWriteEnforcement?: ImplicitWriteEnforcement;\n}\n\n/** Configuration of core-backend.\n * @public\n */\nexport class IModelHostConfiguration implements IModelHostOptions {\n public static defaultTileRequestTimeout = 20 * 1000;\n public static defaultLogTileLoadTimeThreshold = 40;\n public static defaultLogTileSizeThreshold = 20 * 1000000;\n /** @internal */\n public static defaultMaxTileCacheDbSize = 1024 * 1024 * 1024;\n public appAssetsDir?: LocalDirName;\n public cacheDir?: LocalDirName;\n\n /** @beta */\n public workspace?: WorkspaceOpts;\n public hubAccess?: BackendHubAccess;\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\n public authorizationClient?: AuthorizationClient;\n /** @beta */\n public restrictTileUrlsByClientIp?: boolean;\n public compressCachedTiles?: boolean;\n /** @beta */\n public tileCacheAzureCredentials?: AzureBlobStorageCredentials;\n /** @internal */\n public tileTreeRequestTimeout = IModelHostConfiguration.defaultTileRequestTimeout;\n /** @internal */\n public tileContentRequestTimeout = IModelHostConfiguration.defaultTileRequestTimeout;\n /** @internal */\n public logTileLoadTimeThreshold = IModelHostConfiguration.defaultLogTileLoadTimeThreshold;\n /** @internal */\n public logTileSizeThreshold = IModelHostConfiguration.defaultLogTileSizeThreshold;\n /** @internal */\n public crashReportingConfig?: CrashReportingConfig;\n /**\n * Configuration controlling whether to use the thinned down native instance functions for element, model, and aspect CRUD operations\n * or use the previous behavior of using the native side for all CRUD operations. Set to true to revert to the previous behavior.\n * @beta\n */\n public disableThinnedNativeInstanceWorkflow?: boolean;\n\n /**\n * Configuration controlling whether to disable the creation of restore points during pull/merge operations.\n * @beta\n */\n public disableRestorePointOnPullMerge?: true;\n /**\n * Configuration controlling whether incremental schema loading is disabled.\n * Default is \"disabled\" at the moment to preserve existing behavior.\n * @beta\n */\n public incrementalSchemaLoading: \"enabled\" | \"disabled\" = \"disabled\";\n /**\n * Configuration controlling whether to use semantic rebase or not. By default it is undefined meaning semantic rebase is not used.\n * @beta\n */\n public useSemanticRebase?: boolean;\n /**\n * Controls how writes through the implicit transaction are enforced.\n * See [[IModelHostOptions.implicitWriteEnforcement]] for the meaning of each allowed value.\n * @beta\n */\n public implicitWriteEnforcement: ImplicitWriteEnforcement = \"allow\";\n}\n\n/**\n * Settings for `IModelHost.appWorkspace`.\n * @note this includes the default dictionary from the SettingsSpecRegistry\n */\nclass ApplicationSettings extends SettingsImpl {\n private _remove?: VoidFunction;\n protected override verifyPriority(priority: SettingsPriority) {\n if (priority > SettingsPriority.application) // only application or lower may appear in ApplicationSettings\n throw new Error(\"Use IModelSettings\");\n }\n private updateDefaults() {\n const defaults: SettingsContainer = {};\n for (const [schemaName, val] of IModelHost.settingsSchemas.settingDefs) {\n if (val.default)\n defaults[schemaName] = val.default;\n }\n this.addDictionary({ name: \"_default_\", priority: 0 }, defaults);\n }\n\n public constructor() {\n super();\n this._remove = IModelHost.settingsSchemas.onSchemaChanged.addListener(() => this.updateDefaults());\n this.updateDefaults();\n }\n\n public override close() {\n if (this._remove) {\n this._remove();\n this._remove = undefined;\n }\n }\n}\n\n/**\n * Settings for an iTwin. May only include settings priority for iTwin and organization.\n */\nclass ITwinWorkspaceSettings extends SettingsImpl {\n protected override verifyPriority(priority: SettingsPriority) {\n if (priority <= SettingsPriority.application)\n ITwinSettingsError.throwError(\"invalid-priority\", { message: `Settings with priority ${priority} cannot be added to an iTwin workspace.` });\n if (priority > SettingsPriority.iTwin)\n ITwinSettingsError.throwError(\"invalid-priority\", { message: `Settings with priority ${priority} cannot be added to an iTwin workspace.` });\n }\n\n public override * getSettingEntries<T extends Setting>(name: string): Iterable<{ value: T, dictionary: SettingsDictionary }> {\n yield* super.getSettingEntries(name);\n yield* IModelHost.appWorkspace.settings.getSettingEntries(name);\n }\n}\n\nconst definedInStartup = <T>(obj: T | undefined): T => {\n if (obj === undefined)\n throw new Error(\"IModelHost.startup must be called first\");\n return obj;\n};\n\n/** IModelHost initializes ($backend) and captures its configuration. A backend must call [[IModelHost.startup]] before using any backend classes.\n * See [the learning article]($docs/learning/backend/IModelHost.md)\n * @public\n */\nexport class IModelHost {\n private constructor() { }\n\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\n public static authorizationClient?: AuthorizationClient;\n\n public static backendVersion = \"\";\n private static _profileName: string;\n private static _cacheDir = \"\";\n private static _settingsSchemas?: SettingsSchemas;\n private static _appWorkspace?: OwnedWorkspace;\n\n // Omit the hubAccess field from configuration so it stays internal.\n public static configuration?: Omit<IModelHostOptions, \"hubAccess\">;\n\n /**\n * The name of the *Profile* directory (a subdirectory of \"[[cacheDir]]/profiles/\") for this process.\n *\n * The *Profile* directory is used to cache data that is specific to a type-of-usage of the iTwin.js library.\n * It is important that information in the profile cache be consistent but isolated across sessions (i.e.\n * data for a profile is maintained between runs, but each profile is completely independent and\n * unaffected by the presence or use of others.)\n * @note **Only one process at a time may be using a given profile**, and an exception will be thrown by [[startup]]\n * if a second process attempts to use the same profile.\n * @beta\n */\n public static get profileName(): string {\n return this._profileName;\n }\n\n /** The full path of the Profile directory.\n * @see [[profileName]]\n * @beta\n */\n public static get profileDir(): LocalDirName {\n return join(this._cacheDir, \"profiles\", this._profileName);\n }\n\n /** Event raised during startup to allow loading settings data */\n public static readonly onWorkspaceStartup = new BeEvent<() => void>();\n\n /** Event raised just after the backend IModelHost was started */\n public static readonly onAfterStartup = new BeEvent<() => void>();\n\n /** Event raised just before the backend IModelHost is to be shut down */\n public static readonly onBeforeShutdown = new BeEvent<() => void>();\n\n /** @internal */\n public static readonly session: Mutable<SessionProps> = { applicationId: \"2686\", applicationVersion: \"1.0.0\", sessionId: \"\" };\n\n /** A uniqueId for this session */\n public static get sessionId() { return this.session.sessionId; }\n public static set sessionId(id: GuidString) { this.session.sessionId = id; }\n\n /** The Id of this application - needs to be set only if it is an agent application. The applicationId will otherwise originate at the frontend. */\n public static get applicationId() { return this.session.applicationId; }\n public static set applicationId(id: string) { this.session.applicationId = id; }\n\n /** The version of this application - needs to be set if is an agent application. The applicationVersion will otherwise originate at the frontend. */\n public static get applicationVersion() { return this.session.applicationVersion; }\n public static set applicationVersion(version: string) { this.session.applicationVersion = version; }\n\n /** A string that can identify the current user to other users when collaborating. */\n public static userMoniker = \"unknown\";\n\n /** Root directory holding files that iTwin.js caches */\n public static get cacheDir(): LocalDirName { return this._cacheDir; }\n\n /** The application [[Workspace]] for this `IModelHost`\n * @note this `Workspace` only holds [[WorkspaceContainer]]s and [[Settings]] scoped to the currently loaded application(s).\n * All organization, iTwin, and iModel based containers or settings must be accessed through [[IModelDb.workspace]] and\n * attempting to add them to this Workspace will fail.\n * @beta\n */\n public static get appWorkspace(): Workspace { return definedInStartup(this._appWorkspace); }\n\n /** Obtain the [[Workspace]] for an iTwin by discovering its settings container.\n * All named dictionary resources in the container's [[WorkspaceDb]] are loaded into the workspace at [[SettingsPriority.iTwin]].\n * @note This method requires an internet connection to discover the container.\n * To use an iTwin workspace offline, use the overload that accepts [[WorkspaceDbSettingsProps]].\n * @note The returned workspace is caller-owned. Call `close` when finished.\n * @beta\n */\n public static async getITwinWorkspace(iTwinId: GuidString): Promise<OwnedWorkspace>;\n /** Obtain the [[Workspace]] for an iTwin.\n * The supplied [[WorkspaceDbSettingsProps]] are passed directly to [[Workspace.loadSettingsDictionary]].\n * @note You can derive these from the `settingsSources` property on a previously returned workspace.\n * @note The returned workspace is caller-owned. Call `close` when finished.\n * @beta\n */\n public static async getITwinWorkspace(props: WorkspaceDbSettingsProps | WorkspaceDbSettingsProps[]): Promise<OwnedWorkspace>;\n /** @internal */\n public static async getITwinWorkspace(args: GuidString | WorkspaceDbSettingsProps | WorkspaceDbSettingsProps[]): Promise<OwnedWorkspace> {\n const isITwinId = typeof args === \"string\";\n const workspace = constructWorkspace(new ITwinWorkspaceSettings());\n\n try {\n const settingsSources = isITwinId ? await SettingsContainers.getITwinSettingsSources(args) : args;\n if (undefined === settingsSources)\n return workspace;\n\n workspace.settingsSources = settingsSources;\n\n const problems: WorkspaceDbLoadError[] = [];\n await workspace.loadSettingsDictionary(settingsSources, problems);\n\n if (problems.length > 0) {\n const label = isITwinId ? `iTwin '${args}'` : \"the supplied settings workspace db properties\";\n throwWorkspaceDbLoadErrors(`attempting to load workspace settings for ${label}`, problems);\n }\n\n return workspace;\n } catch (error) {\n workspace.close();\n throw error;\n }\n }\n\n /** Save a named [[SettingsDictionary]] to the iTwin's settings container.\n * If no iTwin settings container exists for `iTwinId`, one is created.\n * The dictionary is stored as a named resource in the container's default [[WorkspaceDb]], where `name` is used as the resource name.\n * @param iTwinId The iTwin whose settings container should be updated.\n * @param name The name of the dictionary, used as the resource name in the [[WorkspaceDb]].\n * @param settings The settings key-value pairs to store.\n * @note uses [[IModelHost.userMoniker]] as the user name for acquiring the write lock on the settings container.\n * @beta\n */\n public static async saveSettingDictionary(iTwinId: GuidString, name: string, settings: SettingsContainer): Promise<void> {\n const { editor, container } = await SettingsEditor.constructForITwin(iTwinId);\n try {\n await container.withEditableDb(this.userMoniker, (db) => {\n db.updateSettingsResource(settings, name);\n }, { dbName: settingsWorkspaceDbName });\n } finally {\n editor.close();\n }\n }\n\n /** Delete a named [[SettingsDictionary]] from the iTwin's settings container.\n * If no iTwin settings container exists, this method does nothing.\n * @param iTwinId The iTwin whose settings container should be updated.\n * @param name The name of the dictionary (resource name) to delete.\n * @note uses [[IModelHost.userMoniker]] as the user name for acquiring the write lock on the settings container.\n * @beta\n */\n public static async deleteSettingDictionary(iTwinId: GuidString, name: string): Promise<void> {\n const settingsEditor = await SettingsEditor.getForITwin(iTwinId);\n if (undefined === settingsEditor)\n return;\n\n const { editor, container } = settingsEditor;\n try {\n await container.withEditableDb(this.userMoniker, (db) => {\n db.removeString(name);\n }, { dbName: settingsWorkspaceDbName });\n } finally {\n editor.close();\n }\n }\n\n /** The registry of schemas describing the [[Setting]]s for the application session.\n * Applications should register their schemas via methods like [[SettingsSchemas.addGroup]].\n * @beta\n */\n public static get settingsSchemas(): SettingsSchemas { return definedInStartup(this._settingsSchemas); }\n\n /** The optional [[FileNameResolver]] that resolves keys and partial file names for snapshot iModels.\n * @deprecated in 4.10 - will not be removed until after 2026-06-13. When opening a snapshot by file name, ensure to pass already resolved path. Using a key to open a snapshot is now deprecated.\n */\n public static snapshotFileNameResolver?: FileNameResolver; // eslint-disable-line @typescript-eslint/no-deprecated\n\n /** Get the current access token for this IModelHost, or a blank string if none is available.\n * @note for web backends, this will *always* return a blank string because the backend itself has no token (but never needs one either.)\n * For all IpcHosts, where this backend is servicing a single frontend, this will be the user's token. For ElectronHost, the backend\n * obtains the token and forwards it to the frontend.\n * @note accessTokens expire periodically and are automatically refreshed, if possible. Therefore tokens should not be saved, and the value\n * returned by this method may change over time throughout the course of a session.\n */\n public static async getAccessToken(): Promise<AccessToken> {\n try {\n return (await IModelHost.authorizationClient?.getAccessToken()) ?? \"\";\n } catch {\n return \"\";\n }\n }\n\n private static loadNative(options: IModelHostOptions) {\n loadNativePlatform();\n\n if (options.crashReportingConfig && options.crashReportingConfig.crashDir && !ProcessDetector.isElectronAppBackend && !ProcessDetector.isMobileAppBackend) {\n IModelNative.platform.setCrashReporting(options.crashReportingConfig);\n\n Logger.logTrace(loggerCategory, \"Configured crash reporting\", {\n enableCrashDumps: options.crashReportingConfig?.enableCrashDumps,\n wantFullMemoryDumps: options.crashReportingConfig?.wantFullMemoryDumps,\n enableNodeReport: options.crashReportingConfig?.enableNodeReport,\n uploadToBentley: options.crashReportingConfig?.uploadToBentley,\n });\n\n if (options.crashReportingConfig.enableNodeReport) {\n if (process.report !== undefined) {\n process.report.reportOnFatalError = true;\n process.report.reportOnUncaughtException = true;\n process.report.directory = options.crashReportingConfig.crashDir;\n Logger.logTrace(loggerCategory, \"Configured Node.js crash reporting\");\n } else {\n Logger.logWarning(loggerCategory, \"Unable to configure Node.js crash reporting\");\n }\n }\n }\n }\n\n /** @internal */\n public static tileStorage?: TileStorage;\n\n private static _hubAccess?: BackendHubAccess;\n /** @internal */\n public static [_setHubAccess](hubAccess: BackendHubAccess | undefined) { this._hubAccess = hubAccess; }\n\n /** get the current hubAccess, if present.\n * @internal\n */\n public static [_getHubAccess](): BackendHubAccess | undefined { return this._hubAccess; }\n\n /** Provides access to the IModelHub for this IModelHost\n * @internal\n * @note If [[IModelHostOptions.hubAccess]] was undefined when initializing this class, accessing this property will throw an error.\n * To determine whether one is present, use [[_getHubAccess]].\n */\n public static get [_hubAccess](): BackendHubAccess {\n if (IModelHost._hubAccess === undefined)\n throw new IModelError(IModelStatus.BadRequest, \"No BackendHubAccess supplied in IModelHostOptions\");\n return IModelHost._hubAccess;\n }\n\n private static initializeWorkspace(configuration: IModelHostOptions) {\n const settingAssets = join(KnownLocations.packageAssetsDir, \"Settings\");\n this._settingsSchemas = constructSettingsSchemas();\n this._settingsSchemas.addDirectory(join(settingAssets, \"Schemas\"));\n this._appWorkspace = constructWorkspace(new ApplicationSettings(), configuration.workspace);\n\n // Create the CloudCache for Workspaces. This will fail if another process is already using the same profile.\n try {\n this.appWorkspace.getCloudCache();\n } catch (e: any) {\n throw (e.errorNumber === DbResult.BE_SQLITE_BUSY) ? new IModelError(DbResult.BE_SQLITE_BUSY, `Profile [${this.profileDir}] is already in use by another process`) : e;\n }\n\n this.appWorkspace.settings.addDirectory(settingAssets, SettingsPriority.defaults);\n\n GeoCoordConfig.onStartup();\n // allow applications to load their default settings\n this.onWorkspaceStartup.raiseEvent();\n }\n\n private static _isValid = false;\n\n /** true between a successful call to [[startup]] and before [[shutdown]] */\n public static get isValid() {\n return IModelHost._isValid;\n }\n\n /** This method must be called before any iTwin.js services are used.\n * @param options Host configuration data.\n * Raises [[onAfterStartup]].\n * @see [[shutdown]].\n */\n public static async startup(options?: IModelHostOptions): Promise<void> {\n if (this._isValid)\n return; // we're already initialized\n this._isValid = true;\n\n options = options ?? {};\n if (this.sessionId === \"\")\n this.sessionId = Guid.createValue();\n\n this.authorizationClient = options.authorizationClient;\n\n this.backendVersion = require(\"../../package.json\").version; // eslint-disable-line @typescript-eslint/no-require-imports\n initializeRpcBackend(options.enableOpenTelemetry);\n\n this.loadNative(options);\n this.setupCacheDir(options);\n this.initializeWorkspace(options);\n EditTxn.implicitWriteEnforcement = options.implicitWriteEnforcement ?? \"allow\";\n BriefcaseManager.initialize(join(this._cacheDir, \"imodels\"));\n\n [\n IModelReadRpcImpl,\n IModelTileRpcImpl,\n SnapshotIModelRpcImpl, // eslint-disable-line @typescript-eslint/no-deprecated\n DevToolsRpcImpl,\n ].forEach((rpc) => rpc.register()); // register all of the RPC implementations\n\n [\n BisCoreSchema,\n GenericSchema,\n FunctionalSchema,\n ].forEach((schema) => schema.registerSchema()); // register all of the schemas\n\n const { hubAccess, ...otherOptions } = options;\n if (undefined !== hubAccess)\n this._hubAccess = hubAccess;\n\n this.configuration = otherOptions;\n this.setupTileCache();\n\n process.once(\"beforeExit\", IModelHost.shutdown);\n this.onAfterStartup.raiseEvent();\n }\n\n private static setupCacheDir(configuration: IModelHostOptions) {\n this._cacheDir = normalizeDir(configuration.cacheDir ?? NativeLibrary.defaultCacheDir);\n IModelJsFs.recursiveMkDirSync(this._cacheDir);\n\n this._profileName = configuration.profileName ?? \"default\";\n Logger.logInfo(loggerCategory, `cacheDir: [${this.cacheDir}], profileDir: [${this.profileDir}]`);\n }\n\n /** This method must be called when an iTwin.js host is shut down. Raises [[onBeforeShutdown]] */\n public static async shutdown(this: void): Promise<void> {\n // Note: This method is set as a node listener where `this` is unbound. Call private method to\n // ensure `this` is correct. Don't combine these methods.\n return IModelHost.doShutdown();\n }\n\n /**\n * Create a new iModel.\n * @returns the Guid of the newly created iModel.\n * @throws [IModelError]($common) in case of errors.\n * @note If [[IModelHostOptions.hubAccess]] was undefined in the call to [[startup]], this function will throw an error.\n */\n public static async createNewIModel(arg: CreateNewIModelProps): Promise<GuidString> {\n return this[_hubAccess].createNewIModel(arg);\n }\n\n private static async doShutdown() {\n if (!this._isValid)\n return;\n\n this._isValid = false;\n this.onBeforeShutdown.raiseEvent();\n\n this.configuration = undefined;\n EditTxn.implicitWriteEnforcement = \"allow\";\n this.tileStorage = undefined;\n\n this._appWorkspace?.close();\n this._appWorkspace = undefined;\n this._settingsSchemas = undefined;\n\n CloudSqlite.CloudCaches.destroy();\n process.removeListener(\"beforeExit\", IModelHost.shutdown);\n }\n\n /**\n * Add or update a property that should be included in a crash report.\n * @internal\n */\n public static setCrashReportProperty(name: string, value: string): void {\n IModelNative.platform.setCrashReportProperty(name, value);\n }\n\n /**\n * Remove a previously defined property so that will not be included in a crash report.\n * @internal\n */\n public static removeCrashReportProperty(name: string): void {\n IModelNative.platform.setCrashReportProperty(name, undefined);\n }\n\n /**\n * Get all properties that will be included in a crash report.\n * @internal\n */\n public static getCrashReportProperties(): CrashReportingConfigNameValuePair[] {\n return IModelNative.platform.getCrashReportProperties();\n }\n\n /** The directory where application assets may be found */\n public static get appAssetsDir(): string | undefined {\n return undefined !== IModelHost.configuration ? IModelHost.configuration.appAssetsDir : undefined;\n }\n\n /** The time, in milliseconds, for which IModelTileRpcInterface.requestTileTreeProps should wait before returning a \"pending\" status.\n * @internal\n */\n public static get tileTreeRequestTimeout(): number {\n return IModelHost.configuration?.tileTreeRequestTimeout ?? IModelHostConfiguration.defaultTileRequestTimeout;\n }\n /** The time, in milliseconds, for which IModelTileRpcInterface.requestTileContent should wait before returning a \"pending\" status.\n * @internal\n */\n public static get tileContentRequestTimeout(): number {\n return IModelHost.configuration?.tileContentRequestTimeout ?? IModelHostConfiguration.defaultTileRequestTimeout;\n }\n\n /** The backend will log when a tile took longer to load than this threshold in seconds. */\n public static get logTileLoadTimeThreshold(): number {\n return IModelHost.configuration?.logTileLoadTimeThreshold ?? IModelHostConfiguration.defaultLogTileLoadTimeThreshold;\n }\n /** The backend will log when a tile is loaded with a size in bytes above this threshold. */\n public static get logTileSizeThreshold(): number {\n return IModelHost.configuration?.logTileSizeThreshold ?? IModelHostConfiguration.defaultLogTileSizeThreshold;\n }\n\n /** Whether external tile caching is active.\n * @internal\n */\n public static get usingExternalTileCache(): boolean {\n return undefined !== IModelHost.tileStorage;\n }\n\n /** Whether to restrict tile cache URLs by client IP address.\n * @internal\n */\n public static get restrictTileUrlsByClientIp(): boolean {\n return undefined !== IModelHost.configuration && (IModelHost.configuration.restrictTileUrlsByClientIp ? true : false);\n }\n\n /** Whether to compress cached tiles.\n * @internal\n */\n public static get compressCachedTiles(): boolean {\n return false !== IModelHost.configuration?.compressCachedTiles;\n }\n\n /**\n * Whether to use semantic rebase or not.\n * @internal\n */\n public static get useSemanticRebase(): boolean {\n return undefined !== IModelHost.configuration && (IModelHost.configuration.useSemanticRebase ? true : false);\n }\n\n private static setupTileCache() {\n assert(undefined !== IModelHost.configuration);\n const config = IModelHost.configuration;\n const storage = config.tileCacheStorage;\n const credentials = config.tileCacheAzureCredentials;\n\n if (!storage && !credentials) {\n IModelNative.platform.setMaxTileCacheSize(config.maxTileCacheDbSize ?? IModelHostConfiguration.defaultMaxTileCacheDbSize);\n return;\n }\n\n IModelNative.platform.setMaxTileCacheSize(0);\n if (credentials) {\n if (storage)\n throw new IModelError(BentleyStatus.ERROR, \"Cannot use both Azure and custom cloud storage providers for tile cache.\");\n this.setupAzureTileCache(credentials);\n }\n if (storage)\n IModelHost.tileStorage = new TileStorage(storage);\n }\n\n private static setupAzureTileCache(credentials: AzureBlobStorageCredentials) {\n const storageConfig: AzureServerStorageConfig = {\n accountName: credentials.account,\n accountKey: credentials.accessKey,\n baseUrl: credentials.baseUrl ?? `https://${credentials.account}.blob.core.windows.net`,\n }\n const blobServiceClient = new BlobServiceClient(\n storageConfig.baseUrl,\n new StorageSharedKeyCredential(storageConfig.accountName, storageConfig.accountKey),\n );\n const azureStorage: ServerStorage = new AzureServerStorage(storageConfig, new BlobServiceClientWrapper(blobServiceClient))\n IModelHost.tileStorage = new TileStorage(azureStorage);\n }\n\n /** @internal */\n public static computeSchemaChecksum(arg: { schemaXmlPath: string, referencePaths: string[], exactMatch?: boolean }): string {\n return IModelNative.platform.computeSchemaChecksum(arg);\n }\n}\n\n/** Information about the platform on which the app is running.\n * @public\n */\nexport class Platform {\n /** Get the name of the platform. */\n public static get platformName(): \"win32\" | \"linux\" | \"darwin\" | \"ios\" | \"android\" | \"uwp\" {\n return process.platform as any;\n }\n}\n\n/** Well known directories that may be used by the application.\n * @public\n */\nexport class KnownLocations {\n\n /** The directory where the imodeljs-native assets are stored. */\n public static get nativeAssetsDir(): LocalDirName {\n return IModelNative.platform.DgnDb.getAssetsDir();\n }\n\n /** The directory where the core-backend assets are stored. */\n public static get packageAssetsDir(): LocalDirName {\n return join(__dirname, \"assets\");\n }\n\n /** The temporary directory. */\n public static get tmpdir(): LocalDirName {\n return os.tmpdir();\n }\n}\n\n/** Extend this class to provide custom file name resolution behavior.\n * @note Only `tryResolveKey` and/or `tryResolveFileName` need to be overridden as the implementations of `resolveKey` and `resolveFileName` work for most purposes.\n * @see [[IModelHost.snapshotFileNameResolver]]\n * @public\n * @deprecated in 4.10 - will not be removed until after 2026-06-13. When opening a snapshot by file name, ensure to pass already resolved path. Using a key to open a snapshot is now deprecated.\n */\nexport abstract class FileNameResolver {\n /** Resolve a file name from the specified key.\n * @param _fileKey The key that identifies the file name in a `Map` or other similar data structure.\n * @returns The resolved file name or `undefined` if not found.\n */\n public tryResolveKey(_fileKey: string): string | undefined { return undefined; }\n /** Resolve a file name from the specified key.\n * @param fileKey The key that identifies the file name in a `Map` or other similar data structure.\n * @returns The resolved file name.\n * @throws [[IModelError]] if not found.\n */\n public resolveKey(fileKey: string): string {\n const resolvedFileName: string | undefined = this.tryResolveKey(fileKey);\n if (undefined === resolvedFileName) {\n throw new IModelError(IModelStatus.NotFound, `${fileKey} not resolved`);\n }\n return resolvedFileName;\n }\n /** Resolve the input file name, which may be a partial name, into a full path file name.\n * @param inFileName The partial file name.\n * @returns The resolved full path file name or `undefined` if not found.\n */\n public tryResolveFileName(inFileName: string): string | undefined { return inFileName; }\n /** Resolve the input file name, which may be a partial name, into a full path file name.\n * @param inFileName The partial file name.\n * @returns The resolved full path file name.\n * @throws [[IModelError]] if not found.\n */\n public resolveFileName(inFileName: string): string {\n const resolvedFileName: string | undefined = this.tryResolveFileName(inFileName);\n if (undefined === resolvedFileName) {\n throw new IModelError(IModelStatus.NotFound, `${inFileName} not resolved`);\n }\n return resolvedFileName;\n }\n}\n"]}
@@ -1 +1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,MAAM,mBAAmB,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAI/H,gBAAgB;WACF,UAAU,CAAC,CAAC,SAAS,MAAM,gBAAgB,EAAE,SAAS,EAAE,WAAW,GAAG,YAAY,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAIzJ,gBAAgB;WACF,kBAAkB,CAAC,CAAC,SAAS,MAAM,yBAAyB,EAAE,SAAS,EAAE,WAAW,GAAG,YAAY,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAInL;;;;OAIG;WACiB,OAAO,CAAC,GAAG,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAY7D,mEAAmE;WAC/C,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAI9C;AAED;;;;;;;;;;;GAWG;AACH,8BAAsB,UAAU;IAC9B;;;;;;OAMG;IACH,aAAoB,WAAW,IAAI,MAAM,CAAC;IAE1C;;;;;OAKG;WACW,QAAQ,IAAI,cAAc;CA0EzC;AA6JD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAa9I"}
@@ -140,19 +140,37 @@ class IpcHandler {
140
140
  visited.add(e);
141
141
  try {
142
142
  const serialized = { ...e };
143
+ for (const sym of Object.getOwnPropertySymbols(serialized))
144
+ delete serialized[sym]; // symbol-keyed properties cannot be structured-cloned
143
145
  if (e instanceof Error) {
144
146
  serialized.message = e.message; // NB: .message and .stack are non-enumerable on Error instances
145
147
  if (includeStack)
146
148
  serialized.stack = e.stack;
149
+ // Error.cause is typically non-enumerable and must be copied explicitly.
150
+ if (Object.prototype.hasOwnProperty.call(e, "cause"))
151
+ serialized.cause = e.cause;
152
+ }
153
+ if (e instanceof core_bentley_1.BentleyError) {
154
+ serialized.iTwinErrorId = e.iTwinErrorId;
155
+ if (e.hasMetaData)
156
+ serialized.loggingMetadata = e.loggingMetadata;
157
+ delete serialized._metaData;
147
158
  }
148
159
  // Only recurse into Error instances and plain objects — not class instances like Date or Buffer.
149
160
  const shouldRecurse = (val) => val instanceof Error || (core_bentley_1.JsonUtils.isObject(val) && Object.getPrototypeOf(val) === Object.prototype);
161
+ const isSerializableLeaf = (val) => {
162
+ const t = typeof val;
163
+ return val === null || val === undefined || val instanceof Date
164
+ || t === "string" || t === "number" || t === "boolean";
165
+ };
150
166
  for (const key of Object.keys(serialized)) {
151
167
  const val = serialized[key];
152
168
  if (Array.isArray(val))
153
- serialized[key] = val.map((item) => shouldRecurse(item) ? serializeError(item, includeStack, visited) : item);
169
+ serialized[key] = val.map((item) => shouldRecurse(item) ? serializeError(item, includeStack, visited) : isSerializableLeaf(item) ? item : undefined);
154
170
  else if (shouldRecurse(val))
155
171
  serialized[key] = serializeError(val, includeStack, visited);
172
+ else if (!isSerializableLeaf(val))
173
+ delete serialized[key]; // strip non-cloneable values (functions, class instances, etc.)
156
174
  }
157
175
  return serialized;
158
176
  }
@@ -161,14 +179,7 @@ class IpcHandler {
161
179
  visited.delete(e);
162
180
  }
163
181
  };
164
- const ret = { error: serializeError(err, !IpcHost.noStack) };
165
- if (err instanceof core_bentley_1.BentleyError) {
166
- ret.error.iTwinErrorId = err.iTwinErrorId;
167
- if (err.hasMetaData)
168
- ret.error.loggingMetadata = err.loggingMetadata;
169
- delete ret.error._metaData;
170
- }
171
- return ret;
182
+ return { error: serializeError(err, !IpcHost.noStack) };
172
183
  }
173
184
  });
174
185
  }
@@ -225,10 +236,10 @@ class IpcAppHandler extends IpcHandler {
225
236
  IModelDb_1.IModelDb.findByKey(key).close();
226
237
  }
227
238
  async saveChanges(key, description) {
228
- IModelDb_1.IModelDb.findByKey(key).saveChanges(description);
239
+ IModelDb_1.IModelDb.findByKey(key)[Symbols_1._implicitTxn].saveChanges(description);
229
240
  }
230
241
  async abandonChanges(key) {
231
- IModelDb_1.IModelDb.findByKey(key).abandonChanges();
242
+ IModelDb_1.IModelDb.findByKey(key)[Symbols_1._implicitTxn].abandonChanges();
232
243
  }
233
244
  async hasPendingTxns(key) {
234
245
  return IModelDb_1.IModelDb.findByKey(key)[Symbols_1._nativeDb].hasPendingTxns();
@@ -287,16 +298,25 @@ class IpcAppHandler extends IpcHandler {
287
298
  return IModelDb_1.IModelDb.findByKey(key)[Symbols_1._nativeDb].isGeometricModelTrackingSupported();
288
299
  }
289
300
  async reverseTxns(key, numOperations) {
290
- return IModelDb_1.IModelDb.findByKey(key)[Symbols_1._nativeDb].reverseTxns(numOperations);
301
+ return IModelDb_1.BriefcaseDb.findByKey(key).txns.reverseTxns(numOperations);
302
+ }
303
+ async reverseTxnsAsync(key, numOperations, args) {
304
+ return IModelDb_1.BriefcaseDb.findByKey(key).txns.reverseTxnsAsync(numOperations, args);
291
305
  }
292
306
  async reverseAllTxn(key) {
293
- return IModelDb_1.IModelDb.findByKey(key)[Symbols_1._nativeDb].reverseAll();
307
+ return IModelDb_1.BriefcaseDb.findByKey(key).txns.reverseAll();
308
+ }
309
+ async reverseAllTxnsAsync(key, args) {
310
+ return IModelDb_1.BriefcaseDb.findByKey(key).txns.reverseAllTxnsAsync(args);
294
311
  }
295
312
  async reinstateTxn(key) {
296
- return IModelDb_1.IModelDb.findByKey(key)[Symbols_1._nativeDb].reinstateTxn();
313
+ return IModelDb_1.BriefcaseDb.findByKey(key).txns.reinstateTxn();
314
+ }
315
+ async reinstateTxnAsync(key, args) {
316
+ return IModelDb_1.BriefcaseDb.findByKey(key).txns.reinstateTxnAsync(args);
297
317
  }
298
318
  async restartTxnSession(key) {
299
- return IModelDb_1.IModelDb.findByKey(key)[Symbols_1._nativeDb].restartTxnSession();
319
+ return IModelDb_1.IModelDb.findByKey(key).restartTxnSession();
300
320
  }
301
321
  async queryConcurrency(pool) {
302
322
  return NativePlatform_1.IModelNative.platform.queryConcurrency(pool);