@itwin/core-backend 5.4.0-dev.7 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/lib/cjs/BackendHubAccess.js.map +1 -1
  3. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  4. package/lib/cjs/BisCoreSchema.js.map +1 -1
  5. package/lib/cjs/BlobContainerService.js.map +1 -1
  6. package/lib/cjs/BriefcaseManager.js.map +1 -1
  7. package/lib/cjs/CatalogDb.js.map +1 -1
  8. package/lib/cjs/Category.js.map +1 -1
  9. package/lib/cjs/ChangeSummaryManager.js +2 -2
  10. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  11. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  12. package/lib/cjs/ChangesetECAdaptor.js +248 -248
  13. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  14. package/lib/cjs/ChannelControl.js.map +1 -1
  15. package/lib/cjs/CheckpointManager.js.map +1 -1
  16. package/lib/cjs/ClassRegistry.js +5 -5
  17. package/lib/cjs/ClassRegistry.js.map +1 -1
  18. package/lib/cjs/CloudSqlite.js.map +1 -1
  19. package/lib/cjs/CodeService.js.map +1 -1
  20. package/lib/cjs/CodeSpecs.js.map +1 -1
  21. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  22. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  23. package/lib/cjs/DevTools.js.map +1 -1
  24. package/lib/cjs/DisplayStyle.js.map +1 -1
  25. package/lib/cjs/ECDb.js.map +1 -1
  26. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  27. package/lib/cjs/ECSqlStatement.js.map +1 -1
  28. package/lib/cjs/Element.js.map +1 -1
  29. package/lib/cjs/ElementAspect.js.map +1 -1
  30. package/lib/cjs/ElementGraphics.js.map +1 -1
  31. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  32. package/lib/cjs/Entity.js.map +1 -1
  33. package/lib/cjs/EntityReferences.js.map +1 -1
  34. package/lib/cjs/ExportGraphics.js.map +1 -1
  35. package/lib/cjs/ExternalSource.js.map +1 -1
  36. package/lib/cjs/FontFile.js.map +1 -1
  37. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  38. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  39. package/lib/cjs/GeometrySummary.js +47 -47
  40. package/lib/cjs/GeometrySummary.js.map +1 -1
  41. package/lib/cjs/IModelDb.d.ts.map +1 -1
  42. package/lib/cjs/IModelDb.js +20 -17
  43. package/lib/cjs/IModelDb.js.map +1 -1
  44. package/lib/cjs/IModelDbFonts.js.map +1 -1
  45. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  46. package/lib/cjs/IModelHost.d.ts +11 -0
  47. package/lib/cjs/IModelHost.d.ts.map +1 -1
  48. package/lib/cjs/IModelHost.js +6 -0
  49. package/lib/cjs/IModelHost.js.map +1 -1
  50. package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
  51. package/lib/cjs/IModelJsFs.js.map +1 -1
  52. package/lib/cjs/ImageSourceConversion.js.map +1 -1
  53. package/lib/cjs/IpcHost.js.map +1 -1
  54. package/lib/cjs/LineStyle.js.map +1 -1
  55. package/lib/cjs/LocalHub.js +1 -1
  56. package/lib/cjs/LocalHub.js.map +1 -1
  57. package/lib/cjs/LocalhostIpcHost.d.ts +1 -0
  58. package/lib/cjs/LocalhostIpcHost.d.ts.map +1 -1
  59. package/lib/cjs/LocalhostIpcHost.js +1 -1
  60. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  61. package/lib/cjs/LockControl.js.map +1 -1
  62. package/lib/cjs/Material.js.map +1 -1
  63. package/lib/cjs/Model.js.map +1 -1
  64. package/lib/cjs/NativeAppStorage.js.map +1 -1
  65. package/lib/cjs/NativeHost.js.map +1 -1
  66. package/lib/cjs/NavigationRelationship.js.map +1 -1
  67. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  68. package/lib/cjs/PropertyStore.js.map +1 -1
  69. package/lib/cjs/Relationship.js.map +1 -1
  70. package/lib/cjs/RpcBackend.js.map +1 -1
  71. package/lib/cjs/SQLiteDb.js.map +1 -1
  72. package/lib/cjs/Schema.js.map +1 -1
  73. package/lib/cjs/SchemaSync.js.map +1 -1
  74. package/lib/cjs/SchemaUtils.js.map +1 -1
  75. package/lib/cjs/SheetIndex.js.map +1 -1
  76. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  77. package/lib/cjs/SqliteStatement.js.map +1 -1
  78. package/lib/cjs/StashManager.js.map +1 -1
  79. package/lib/cjs/Texture.js.map +1 -1
  80. package/lib/cjs/TileStorage.js.map +1 -1
  81. package/lib/cjs/TxnManager.d.ts +16 -4
  82. package/lib/cjs/TxnManager.d.ts.map +1 -1
  83. package/lib/cjs/TxnManager.js +25 -3
  84. package/lib/cjs/TxnManager.js.map +1 -1
  85. package/lib/cjs/ViewDefinition.js.map +1 -1
  86. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  87. package/lib/cjs/ViewStore.js.map +1 -1
  88. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  89. package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
  90. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
  91. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  92. package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
  93. package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
  94. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
  95. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  96. package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
  97. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
  98. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
  99. package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
  100. package/lib/cjs/core-backend.js.map +1 -1
  101. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  102. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  103. package/lib/cjs/domains/GenericElements.js.map +1 -1
  104. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  105. package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
  106. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  107. package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
  108. package/lib/cjs/internal/FontFileImpl.js.map +1 -1
  109. package/lib/cjs/internal/HubMock.js.map +1 -1
  110. package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
  111. package/lib/cjs/internal/NativePlatform.js.map +1 -1
  112. package/lib/cjs/internal/NoLocks.js.map +1 -1
  113. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
  114. package/lib/cjs/internal/Symbols.js.map +1 -1
  115. package/lib/cjs/internal/annotations/fields.js.map +1 -1
  116. package/lib/cjs/internal/cross-package.js.map +1 -1
  117. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
  118. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  119. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  120. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  121. package/lib/cjs/rpc/multipart.js.map +1 -1
  122. package/lib/cjs/rpc/tracing.js.map +1 -1
  123. package/lib/cjs/rpc/web/logging.js.map +1 -1
  124. package/lib/cjs/rpc/web/request.js.map +1 -1
  125. package/lib/cjs/rpc/web/response.js.map +1 -1
  126. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  127. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  128. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  129. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  130. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  131. package/lib/cjs/workspace/Settings.js.map +1 -1
  132. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  133. package/lib/cjs/workspace/Workspace.js.map +1 -1
  134. package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
  135. package/lib/esm/BackendHubAccess.js.map +1 -1
  136. package/lib/esm/BackendLoggerCategory.js.map +1 -1
  137. package/lib/esm/BisCoreSchema.js.map +1 -1
  138. package/lib/esm/BlobContainerService.js.map +1 -1
  139. package/lib/esm/BriefcaseManager.js.map +1 -1
  140. package/lib/esm/CatalogDb.js.map +1 -1
  141. package/lib/esm/Category.js.map +1 -1
  142. package/lib/esm/ChangeSummaryManager.js +2 -2
  143. package/lib/esm/ChangeSummaryManager.js.map +1 -1
  144. package/lib/esm/ChangedElementsDb.js.map +1 -1
  145. package/lib/esm/ChangesetECAdaptor.js +248 -248
  146. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  147. package/lib/esm/ChannelControl.js.map +1 -1
  148. package/lib/esm/CheckpointManager.js.map +1 -1
  149. package/lib/esm/ClassRegistry.js +5 -5
  150. package/lib/esm/ClassRegistry.js.map +1 -1
  151. package/lib/esm/CloudSqlite.js.map +1 -1
  152. package/lib/esm/CodeService.js.map +1 -1
  153. package/lib/esm/CodeSpecs.js.map +1 -1
  154. package/lib/esm/ConcurrentQuery.js.map +1 -1
  155. package/lib/esm/CustomViewState3dCreator.js.map +1 -1
  156. package/lib/esm/DevTools.js.map +1 -1
  157. package/lib/esm/DisplayStyle.js.map +1 -1
  158. package/lib/esm/ECDb.js.map +1 -1
  159. package/lib/esm/ECSchemaXmlContext.js.map +1 -1
  160. package/lib/esm/ECSqlStatement.js.map +1 -1
  161. package/lib/esm/Element.js.map +1 -1
  162. package/lib/esm/ElementAspect.js.map +1 -1
  163. package/lib/esm/ElementGraphics.js.map +1 -1
  164. package/lib/esm/ElementTreeWalker.js.map +1 -1
  165. package/lib/esm/Entity.js.map +1 -1
  166. package/lib/esm/EntityReferences.js.map +1 -1
  167. package/lib/esm/ExportGraphics.js.map +1 -1
  168. package/lib/esm/ExternalSource.js.map +1 -1
  169. package/lib/esm/FontFile.js.map +1 -1
  170. package/lib/esm/GeoCoordConfig.js.map +1 -1
  171. package/lib/esm/GeographicCRSServices.js.map +1 -1
  172. package/lib/esm/GeometrySummary.js +47 -47
  173. package/lib/esm/GeometrySummary.js.map +1 -1
  174. package/lib/esm/IModelDb.d.ts.map +1 -1
  175. package/lib/esm/IModelDb.js +20 -17
  176. package/lib/esm/IModelDb.js.map +1 -1
  177. package/lib/esm/IModelDbFonts.js.map +1 -1
  178. package/lib/esm/IModelElementCloneContext.js.map +1 -1
  179. package/lib/esm/IModelHost.d.ts +11 -0
  180. package/lib/esm/IModelHost.d.ts.map +1 -1
  181. package/lib/esm/IModelHost.js +6 -0
  182. package/lib/esm/IModelHost.js.map +1 -1
  183. package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
  184. package/lib/esm/IModelJsFs.js.map +1 -1
  185. package/lib/esm/ImageSourceConversion.js.map +1 -1
  186. package/lib/esm/IpcHost.js.map +1 -1
  187. package/lib/esm/LineStyle.js.map +1 -1
  188. package/lib/esm/LocalHub.js +1 -1
  189. package/lib/esm/LocalHub.js.map +1 -1
  190. package/lib/esm/LocalhostIpcHost.d.ts +1 -0
  191. package/lib/esm/LocalhostIpcHost.d.ts.map +1 -1
  192. package/lib/esm/LocalhostIpcHost.js +1 -1
  193. package/lib/esm/LocalhostIpcHost.js.map +1 -1
  194. package/lib/esm/LockControl.js.map +1 -1
  195. package/lib/esm/Material.js.map +1 -1
  196. package/lib/esm/Model.js.map +1 -1
  197. package/lib/esm/NativeAppStorage.js.map +1 -1
  198. package/lib/esm/NativeHost.js.map +1 -1
  199. package/lib/esm/NavigationRelationship.js.map +1 -1
  200. package/lib/esm/PromiseMemoizer.js.map +1 -1
  201. package/lib/esm/PropertyStore.js.map +1 -1
  202. package/lib/esm/Relationship.js.map +1 -1
  203. package/lib/esm/RpcBackend.js.map +1 -1
  204. package/lib/esm/SQLiteDb.js.map +1 -1
  205. package/lib/esm/Schema.js.map +1 -1
  206. package/lib/esm/SchemaSync.js.map +1 -1
  207. package/lib/esm/SchemaUtils.js.map +1 -1
  208. package/lib/esm/SheetIndex.js.map +1 -1
  209. package/lib/esm/SqliteChangesetReader.js.map +1 -1
  210. package/lib/esm/SqliteStatement.js.map +1 -1
  211. package/lib/esm/StashManager.js.map +1 -1
  212. package/lib/esm/Texture.js.map +1 -1
  213. package/lib/esm/TileStorage.js.map +1 -1
  214. package/lib/esm/TxnManager.d.ts +16 -4
  215. package/lib/esm/TxnManager.d.ts.map +1 -1
  216. package/lib/esm/TxnManager.js +25 -3
  217. package/lib/esm/TxnManager.js.map +1 -1
  218. package/lib/esm/ViewDefinition.js.map +1 -1
  219. package/lib/esm/ViewStateHydrator.js.map +1 -1
  220. package/lib/esm/ViewStore.js.map +1 -1
  221. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  222. package/lib/esm/annotations/FrameGeometry.js.map +1 -1
  223. package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
  224. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  225. package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
  226. package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
  227. package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
  228. package/lib/esm/core-backend.js.map +1 -1
  229. package/lib/esm/domains/FunctionalElements.js.map +1 -1
  230. package/lib/esm/domains/FunctionalSchema.js.map +1 -1
  231. package/lib/esm/domains/GenericElements.js.map +1 -1
  232. package/lib/esm/domains/GenericSchema.js.map +1 -1
  233. package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
  234. package/lib/esm/internal/ChannelAdmin.js.map +1 -1
  235. package/lib/esm/internal/ElementLRUCache.js.map +1 -1
  236. package/lib/esm/internal/FontFileImpl.js.map +1 -1
  237. package/lib/esm/internal/HubMock.js.map +1 -1
  238. package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
  239. package/lib/esm/internal/NativePlatform.js.map +1 -1
  240. package/lib/esm/internal/NoLocks.js.map +1 -1
  241. package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
  242. package/lib/esm/internal/Symbols.js.map +1 -1
  243. package/lib/esm/internal/annotations/fields.js.map +1 -1
  244. package/lib/esm/internal/cross-package.js.map +1 -1
  245. package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
  246. package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  247. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  248. package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  249. package/lib/esm/rpc/multipart.js.map +1 -1
  250. package/lib/esm/rpc/tracing.js.map +1 -1
  251. package/lib/esm/rpc/web/logging.js.map +1 -1
  252. package/lib/esm/rpc/web/request.js.map +1 -1
  253. package/lib/esm/rpc/web/response.js.map +1 -1
  254. package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  255. package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  256. package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  257. package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  258. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  259. package/lib/esm/test/AdvancedEqual.js.map +1 -1
  260. package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
  261. package/lib/esm/test/AttachDb.test.js +11 -11
  262. package/lib/esm/test/AttachDb.test.js.map +1 -1
  263. package/lib/esm/test/ElementDrivesElement.test.js +23 -23
  264. package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
  265. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  266. package/lib/esm/test/GeometryTestUtil.js.map +1 -1
  267. package/lib/esm/test/IModelHost.test.js.map +1 -1
  268. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  269. package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
  270. package/lib/esm/test/IpcHost.test.js.map +1 -1
  271. package/lib/esm/test/KnownTestLocations.js.map +1 -1
  272. package/lib/esm/test/PrintElementTree.js.map +1 -1
  273. package/lib/esm/test/PropertyDb.test.js.map +1 -1
  274. package/lib/esm/test/RevisionUtility.js.map +1 -1
  275. package/lib/esm/test/SchemaUtils.test.js +25 -25
  276. package/lib/esm/test/SchemaUtils.test.js.map +1 -1
  277. package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
  278. package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
  279. package/lib/esm/test/TestUtils.js.map +1 -1
  280. package/lib/esm/test/annotations/Fields.test.js +53 -53
  281. package/lib/esm/test/annotations/Fields.test.js.map +1 -1
  282. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
  283. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  284. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  285. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
  286. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
  287. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
  288. package/lib/esm/test/categories/Category.test.js.map +1 -1
  289. package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
  290. package/lib/esm/test/ecdb/CTE.test.js +88 -88
  291. package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
  292. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +15 -15
  293. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
  294. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
  295. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
  296. package/lib/esm/test/ecdb/ECDb.test.js +72 -72
  297. package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
  298. package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
  299. package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
  300. package/lib/esm/test/ecdb/ECSqlAst.test.js +65 -65
  301. package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
  302. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  303. package/lib/esm/test/ecdb/ECSqlReader.test.js +16 -16
  304. package/lib/esm/test/ecdb/ECSqlReader.test.js.map +1 -1
  305. package/lib/esm/test/ecdb/ECSqlStatement.test.js +332 -332
  306. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  307. package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
  308. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
  309. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
  310. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
  311. package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
  312. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  313. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  314. package/lib/esm/test/element/ElementAspect.test.js +22 -22
  315. package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
  316. package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
  317. package/lib/esm/test/element/ElementRoundTrip.test.js +139 -139
  318. package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
  319. package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
  320. package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
  321. package/lib/esm/test/element/NullStructArray.test.js +13 -13
  322. package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
  323. package/lib/esm/test/element/ProjectInformationRecord.test.js.map +1 -1
  324. package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
  325. package/lib/esm/test/element/UrlLink.test.js.map +1 -1
  326. package/lib/esm/test/font/FontFile.test.js.map +1 -1
  327. package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
  328. package/lib/esm/test/hubaccess/ApplyChangeset.test.js +132 -34
  329. package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
  330. package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
  331. package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
  332. package/lib/esm/test/hubaccess/Rebase.test.js +197 -41
  333. package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
  334. package/lib/esm/test/imageData.js.map +1 -1
  335. package/lib/esm/test/imodel/Code.test.js +369 -248
  336. package/lib/esm/test/imodel/Code.test.js.map +1 -1
  337. package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
  338. package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
  339. package/lib/esm/test/imodel/IModel.test.js +47 -44
  340. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  341. package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
  342. package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
  343. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
  344. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js +27 -8
  345. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
  346. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +1 -1
  347. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts +4 -1
  348. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts.map +1 -1
  349. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js +14 -4
  350. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +1 -1
  351. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +1 -1
  352. package/lib/esm/test/index.js.map +1 -1
  353. package/lib/esm/test/misc/DevTools.test.js.map +1 -1
  354. package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
  355. package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
  356. package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
  357. package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
  358. package/lib/esm/test/rpc/response.test.js.map +1 -1
  359. package/lib/esm/test/schema/ClassRegistry.test.js +99 -99
  360. package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
  361. package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
  362. package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
  363. package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
  364. package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
  365. package/lib/esm/test/standalone/ChangeMerge.test.js +24 -0
  366. package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
  367. package/lib/esm/test/standalone/ChangesetReader.test.js +124 -124
  368. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  369. package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
  370. package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
  371. package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
  372. package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
  373. package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
  374. package/lib/esm/test/standalone/ExportGraphics.test.js +14 -14
  375. package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
  376. package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
  377. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  378. package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
  379. package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
  380. package/lib/esm/test/standalone/IModelWrite.test.js +27 -27
  381. package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
  382. package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
  383. package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
  384. package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
  385. package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
  386. package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
  387. package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
  388. package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
  389. package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
  390. package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
  391. package/lib/esm/test/standalone/Setting.test.js.map +1 -1
  392. package/lib/esm/test/standalone/Settings.test.js.map +1 -1
  393. package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
  394. package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
  395. package/lib/esm/test/standalone/Texture.test.js.map +1 -1
  396. package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
  397. package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
  398. package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
  399. package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
  400. package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
  401. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  402. package/lib/esm/workspace/Settings.js.map +1 -1
  403. package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
  404. package/lib/esm/workspace/Workspace.js.map +1 -1
  405. package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
  406. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"file":"IModelDbFonts.js","sourceRoot":"","sources":["../../src/IModelDbFonts.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport { FontFamilyDescriptor, FontFamilySelector, FontId, FontProps } from \"@itwin/core-common\";\nimport { _implementationProhibited } from \"./internal/Symbols\";\nimport { FontFile } from \"./FontFile\";\n\n/** Arguments supplied to [[IModelDbFonts.embedFontFile]].\n * @beta\n */\nexport interface EmbedFontFileArgs {\n /** The file to embed. */\n file: FontFile;\n /** Unless true, [[IModelDbFonts.acquireId]] will be used to ensure that every font family in [[file]] is assigned a [FontId]($common). */\n skipFontIdAllocation?: boolean;\n}\n\n/** Arguments supplied to [[IModelDbFonts.queryMappedFamilies]].\n * @beta\n */\nexport interface QueryMappedFamiliesArgs {\n /** If true, include families that have been assigned a [FontId]($common) but for which no [FontFace]($common)s have been embedded. */\n includeNonEmbedded?: boolean;\n}\n\n/** Provides read-write access to the [font-related information]($docs/learning/backend/Fonts.md) stored in an [[IModelDb]].\n * @see [[IModelDb.fonts]] to access the fonts for a specific iModel.\n * @beta\n */\nexport interface IModelDbFonts {\n /** @internal */\n readonly [_implementationProhibited]: unknown;\n\n /** Obtain the collection of font families that have been assigned a [FontId]($common).\n * By default, font families with no corresponding embedded font faces are omitted.\n */\n queryMappedFamilies(args?: QueryMappedFamiliesArgs): Iterable<FontProps>;\n\n /** Obtain the collection of [[FontFile]]s embedded in the iModel.\n * A FontFile obtained from one iModel can be embedded into another iModel using [[embedFontFile]], but the source iModel must remain open\n */\n queryEmbeddedFontFiles(): Iterable<FontFile>;\n\n /** Store a [[FontFile]] in the iModel. By default, this method also ensures a [FontId]($common) is assigned to each font family in the file. */\n embedFontFile(args: EmbedFontFileArgs): Promise<void>;\n\n /** Returns the Id assigned to the specified font family, or `undefined` if no Id has been assigned.\n * If only a name is supplied instead of a descriptor, and more than one family with the same name but different types exist, then\n * [FontType.TrueType]($common) will be preferred over [FontType.Rsc]($common), and [FontType.Rsc]($common) over [FontType.Shx]($common).\n * @see [[acquireId]] to assign an Id.\n * @see [[findDescriptor]] to perform a reverse lookup.\n */\n findId(selector: FontFamilySelector): FontId | undefined;\n\n /** Returns the font family associated with the specified Id, or `undefined` if no such mapping exists.\n * @see [[findId]] to perform a reverse lookup.\n */\n findDescriptor(id: FontId): FontFamilyDescriptor | undefined;\n\n /** Look up the Id assigned to the specified font family, allocating a new Id if one has not already been assigned. */\n acquireId(descriptor: FontFamilyDescriptor): Promise<FontId>;\n}\n"]}
1
+ {"version":3,"file":"IModelDbFonts.js","sourceRoot":"","sources":["../../src/IModelDbFonts.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { FontFamilyDescriptor, FontFamilySelector, FontId, FontProps } from \"@itwin/core-common\";\r\nimport { _implementationProhibited } from \"./internal/Symbols\";\r\nimport { FontFile } from \"./FontFile\";\r\n\r\n/** Arguments supplied to [[IModelDbFonts.embedFontFile]].\r\n * @beta\r\n */\r\nexport interface EmbedFontFileArgs {\r\n /** The file to embed. */\r\n file: FontFile;\r\n /** Unless true, [[IModelDbFonts.acquireId]] will be used to ensure that every font family in [[file]] is assigned a [FontId]($common). */\r\n skipFontIdAllocation?: boolean;\r\n}\r\n\r\n/** Arguments supplied to [[IModelDbFonts.queryMappedFamilies]].\r\n * @beta\r\n */\r\nexport interface QueryMappedFamiliesArgs {\r\n /** If true, include families that have been assigned a [FontId]($common) but for which no [FontFace]($common)s have been embedded. */\r\n includeNonEmbedded?: boolean;\r\n}\r\n\r\n/** Provides read-write access to the [font-related information]($docs/learning/backend/Fonts.md) stored in an [[IModelDb]].\r\n * @see [[IModelDb.fonts]] to access the fonts for a specific iModel.\r\n * @beta\r\n */\r\nexport interface IModelDbFonts {\r\n /** @internal */\r\n readonly [_implementationProhibited]: unknown;\r\n\r\n /** Obtain the collection of font families that have been assigned a [FontId]($common).\r\n * By default, font families with no corresponding embedded font faces are omitted.\r\n */\r\n queryMappedFamilies(args?: QueryMappedFamiliesArgs): Iterable<FontProps>;\r\n\r\n /** Obtain the collection of [[FontFile]]s embedded in the iModel.\r\n * A FontFile obtained from one iModel can be embedded into another iModel using [[embedFontFile]], but the source iModel must remain open\r\n */\r\n queryEmbeddedFontFiles(): Iterable<FontFile>;\r\n\r\n /** Store a [[FontFile]] in the iModel. By default, this method also ensures a [FontId]($common) is assigned to each font family in the file. */\r\n embedFontFile(args: EmbedFontFileArgs): Promise<void>;\r\n\r\n /** Returns the Id assigned to the specified font family, or `undefined` if no Id has been assigned.\r\n * If only a name is supplied instead of a descriptor, and more than one family with the same name but different types exist, then\r\n * [FontType.TrueType]($common) will be preferred over [FontType.Rsc]($common), and [FontType.Rsc]($common) over [FontType.Shx]($common).\r\n * @see [[acquireId]] to assign an Id.\r\n * @see [[findDescriptor]] to perform a reverse lookup.\r\n */\r\n findId(selector: FontFamilySelector): FontId | undefined;\r\n\r\n /** Returns the font family associated with the specified Id, or `undefined` if no such mapping exists.\r\n * @see [[findId]] to perform a reverse lookup.\r\n */\r\n findDescriptor(id: FontId): FontFamilyDescriptor | undefined;\r\n\r\n /** Look up the Id assigned to the specified font family, allocating a new Id if one has not already been assigned. */\r\n acquireId(descriptor: FontFamilyDescriptor): Promise<FontId>;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IModelElementCloneContext.js","sourceRoot":"","sources":["../../src/IModelElementCloneContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,aAAa,EAA0B,MAAM,EAAoB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE3H,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;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AC,CAAC,CAAC;IACrD,CAAC;CACF","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 iModels\n */\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\nimport { Code, CodeScopeSpec, CodeSpec, ElementProps, IModel, PropertyMetaData, RelatedElement } from \"@itwin/core-common\";\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\nimport { SubCategory } from \"./Category\";\nimport { Element } from \"./Element\";\nimport { IModelDb } from \"./IModelDb\";\nimport { IModelNative } from \"./internal/NativePlatform\";\nimport { SQLiteDb } from \"./SQLiteDb\";\nimport { _nativeDb } from \"./internal/Symbols\";\n\n/** The context for transforming a *source* Element to a *target* Element and remapping internal identifiers to the target iModel.\n * @beta\n */\nexport class IModelElementCloneContext {\n /** The source IModelDb. */\n public readonly sourceDb: IModelDb;\n /** The target IModelDb. */\n public readonly targetDb: IModelDb;\n /** The native import context */\n private _nativeContext: IModelJsNative.ImportContext;\n\n /** Construct a new IModelElementCloneContext. It must be initialized with `initialize`, consider using [[IModelElementCloneContext.create]] instead\n * @param sourceDb The source IModelDb.\n * @param targetDb If provided the target IModelDb. If not provided, the source and target are the same IModelDb.\n */\n public constructor(sourceDb: IModelDb, targetDb?: IModelDb) {\n this.sourceDb = sourceDb;\n this.targetDb = (undefined !== targetDb) ? targetDb : sourceDb;\n this._nativeContext = new IModelNative.platform.ImportContext(this.sourceDb[_nativeDb], this.targetDb[_nativeDb]);\n }\n\n /** perform necessary initialization to use a clone context, namely caching the reference types in the source's schemas */\n public async initialize() {\n }\n\n /** construct and initialize an IModelElementCloneContext at once, for where you construct in an async context */\n public static async create(...args: ConstructorParameters<typeof IModelElementCloneContext>): Promise<IModelElementCloneContext> {\n const instance = new this(...args);\n await instance.initialize();\n return instance;\n }\n\n /** Returns `true` if this context is for transforming between 2 iModels and `false` if it for transforming within the same iModel. */\n public get isBetweenIModels(): boolean { return this.sourceDb !== this.targetDb; }\n\n /** Dispose any native resources associated with this IModelElementCloneContext. */\n public [Symbol.dispose](): void { this._nativeContext.dispose(); }\n\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */\n public dispose() {\n this[Symbol.dispose]();\n }\n\n /** Debugging aid that dumps the Id remapping details and other information to the specified output file.\n * @internal\n */\n public dump(outputFileName: string): void { this._nativeContext.dump(outputFileName); }\n\n /** Add a rule that remaps the specified source [CodeSpec]($common) to the specified target [CodeSpec]($common).\n * @param sourceCodeSpecName The name of the CodeSpec from the source iModel.\n * @param targetCodeSpecName The name of the CodeSpec from the target iModel.\n * @throws [[IModelError]] if either CodeSpec could not be found.\n */\n public remapCodeSpec(sourceCodeSpecName: string, targetCodeSpecName: string): void {\n const sourceCodeSpec: CodeSpec = this.sourceDb.codeSpecs.getByName(sourceCodeSpecName);\n const targetCodeSpec: CodeSpec = this.targetDb.codeSpecs.getByName(targetCodeSpecName);\n this._nativeContext.addCodeSpecId(sourceCodeSpec.id, targetCodeSpec.id);\n }\n\n /** Add a rule that remaps the specified source class to the specified target class. */\n public remapElementClass(sourceClassFullName: string, targetClassFullName: string): void {\n this._nativeContext.addClass(sourceClassFullName, targetClassFullName);\n }\n\n /** Add a rule that remaps the specified source Element to the specified target Element. */\n public remapElement(sourceId: Id64String, targetId: Id64String): void {\n this._nativeContext.addElementId(sourceId, targetId);\n }\n\n /** Remove a rule that remaps the specified source Element. */\n public removeElement(sourceId: Id64String): void {\n this._nativeContext.removeElementId(sourceId);\n }\n\n /** Look up a target CodeSpecId from the source CodeSpecId.\n * @returns the target CodeSpecId or [Id64.invalid]($bentley) if a mapping not found.\n */\n public findTargetCodeSpecId(sourceId: Id64String): Id64String {\n if (Id64.invalid === sourceId) {\n return Id64.invalid;\n }\n return this._nativeContext.findCodeSpecId(sourceId);\n }\n\n /** Look up a target ElementId from the source ElementId.\n * @returns the target ElementId or [Id64.invalid]($bentley) if a mapping not found.\n */\n public findTargetElementId(sourceElementId: Id64String): Id64String {\n if (Id64.invalid === sourceElementId) {\n return Id64.invalid;\n }\n return this._nativeContext.findElementId(sourceElementId);\n }\n\n /** Filter out geometry entries in the specified SubCategory from GeometryStreams in the target iModel.\n * @note It is not possible to filter out a *default* SubCategory. A request to do so will be ignored.\n * @see [SubCategory.isDefaultSubCategory]($backend)\n */\n public filterSubCategory(sourceSubCategoryId: Id64String): void {\n const sourceSubCategory = this.sourceDb.elements.tryGetElement<SubCategory>(sourceSubCategoryId, SubCategory);\n if (sourceSubCategory && !sourceSubCategory.isDefaultSubCategory) {\n this._nativeContext.filterSubCategoryId(sourceSubCategoryId);\n }\n }\n\n /** Returns `true` if there are any SubCategories being filtered. */\n public get hasSubCategoryFilter(): boolean {\n return this._nativeContext.hasSubCategoryFilter();\n }\n\n /** Returns `true` if this SubCategory is being filtered. */\n public isSubCategoryFiltered(subCategoryId: Id64String): boolean {\n return this._nativeContext.isSubCategoryFiltered(subCategoryId);\n }\n\n /** Import the specified font from the source iModel into the target iModel.\n * @internal\n */\n public importFont(sourceFontNumber: number): void {\n this.targetDb.clearFontMap(); // so it will be reloaded with new font info\n this._nativeContext.importFont(sourceFontNumber);\n }\n\n /** Import a single CodeSpec from the source iModel into the target iModel.\n * @internal\n */\n public importCodeSpec(sourceCodeSpecId: Id64String): void {\n this._nativeContext.importCodeSpec(sourceCodeSpecId);\n }\n\n /** Clone the specified source Element into ElementProps for the target iModel.\n * @internal\n */\n public async cloneElement(sourceElement: Element, cloneOptions?: IModelJsNative.CloneElementOptions): Promise<ElementProps> {\n const targetElementProps: ElementProps = this._nativeContext.cloneElement(sourceElement.id, cloneOptions);\n // Ensure that all NavigationProperties in targetElementProps have a defined value so \"clearing\" changes will be part of the JSON used for update\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n sourceElement.forEachProperty((propertyName: string, meta: PropertyMetaData) => {\n if ((meta.isNavigation) && (undefined === (sourceElement as any)[propertyName])) {\n (targetElementProps as any)[propertyName] = RelatedElement.none;\n }\n }, false); // exclude custom because C++ has already handled them\n if (this.isBetweenIModels) {\n // The native C++ cloneElement strips off federationGuid, want to put it back if transformation is between iModels\n targetElementProps.federationGuid = sourceElement.federationGuid;\n if (CodeScopeSpec.Type.Repository === this.targetDb.codeSpecs.getById(targetElementProps.code.spec).scopeType) {\n targetElementProps.code.scope = IModel.rootSubjectId;\n }\n }\n // unlike other references, code cannot be null. If it is null, use an empty code instead\n if (targetElementProps.code.scope === Id64.invalid || targetElementProps.code.spec === Id64.invalid) {\n targetElementProps.code = Code.createEmpty();\n }\n const jsClass = this.sourceDb.getJsClass<typeof Element>(sourceElement.classFullName);\n // eslint-disable-next-line @typescript-eslint/dot-notation\n await jsClass[\"onCloned\"](this, sourceElement.toJSON(), targetElementProps);\n return targetElementProps;\n }\n\n /**\n * serialize state to a sqlite database at a given path\n * assumes the database has not already had any context state serialized to it\n * @internal\n */\n public saveStateToDb(db: SQLiteDb): void {\n this._nativeContext.saveStateToDb(db[_nativeDb]);\n }\n\n /**\n * load state from a sqlite database at a given path\n * @internal\n */\n public loadStateFromDb(db: SQLiteDb): void {\n this._nativeContext.loadStateFromDb(db[_nativeDb]);\n }\n}\n"]}
1
+ {"version":3,"file":"IModelElementCloneContext.js","sourceRoot":"","sources":["../../src/IModelElementCloneContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,aAAa,EAA0B,MAAM,EAAoB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE3H,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAO,yBAAyB;IACpC,2B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jE,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC1B,kHAAkH;YAClH,kBAAkB,CAAC,cAAc,GAAG,aAAa,CAAC,cAAc,CAAC;YACjE,IAAI,aAAa,CAAC,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;gBAC9G,kBAAkB,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,aAAa,CAAC;YACvD,CAAC;QACH,CAAC;QACD,yFAAyF;QACzF,IAAI,kBAAkB,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;YACpG,kBAAkB,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC/C,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAiB,aAAa,CAAC,aAAa,CAAC,CAAC;QACtF,2DAA2D;QAC3D,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC;QAC5E,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,EAAY;QAC/B,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACnD,CAAC;IAED;;;OAGG;IACI,eAAe,CAAC,EAAY;QACjC,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACrD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { Code, CodeScopeSpec, CodeSpec, ElementProps, IModel, PropertyMetaData, RelatedElement } from \"@itwin/core-common\";\r\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\r\nimport { SubCategory } from \"./Category\";\r\nimport { Element } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\nimport { SQLiteDb } from \"./SQLiteDb\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\n\r\n/** The context for transforming a *source* Element to a *target* Element and remapping internal identifiers to the target iModel.\r\n * @beta\r\n */\r\nexport class IModelElementCloneContext {\r\n /** The source IModelDb. */\r\n public readonly sourceDb: IModelDb;\r\n /** The target IModelDb. */\r\n public readonly targetDb: IModelDb;\r\n /** The native import context */\r\n private _nativeContext: IModelJsNative.ImportContext;\r\n\r\n /** Construct a new IModelElementCloneContext. It must be initialized with `initialize`, consider using [[IModelElementCloneContext.create]] instead\r\n * @param sourceDb The source IModelDb.\r\n * @param targetDb If provided the target IModelDb. If not provided, the source and target are the same IModelDb.\r\n */\r\n public constructor(sourceDb: IModelDb, targetDb?: IModelDb) {\r\n this.sourceDb = sourceDb;\r\n this.targetDb = (undefined !== targetDb) ? targetDb : sourceDb;\r\n this._nativeContext = new IModelNative.platform.ImportContext(this.sourceDb[_nativeDb], this.targetDb[_nativeDb]);\r\n }\r\n\r\n /** perform necessary initialization to use a clone context, namely caching the reference types in the source's schemas */\r\n public async initialize() {\r\n }\r\n\r\n /** construct and initialize an IModelElementCloneContext at once, for where you construct in an async context */\r\n public static async create(...args: ConstructorParameters<typeof IModelElementCloneContext>): Promise<IModelElementCloneContext> {\r\n const instance = new this(...args);\r\n await instance.initialize();\r\n return instance;\r\n }\r\n\r\n /** Returns `true` if this context is for transforming between 2 iModels and `false` if it for transforming within the same iModel. */\r\n public get isBetweenIModels(): boolean { return this.sourceDb !== this.targetDb; }\r\n\r\n /** Dispose any native resources associated with this IModelElementCloneContext. */\r\n public [Symbol.dispose](): void { this._nativeContext.dispose(); }\r\n\r\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */\r\n public dispose() {\r\n this[Symbol.dispose]();\r\n }\r\n\r\n /** Debugging aid that dumps the Id remapping details and other information to the specified output file.\r\n * @internal\r\n */\r\n public dump(outputFileName: string): void { this._nativeContext.dump(outputFileName); }\r\n\r\n /** Add a rule that remaps the specified source [CodeSpec]($common) to the specified target [CodeSpec]($common).\r\n * @param sourceCodeSpecName The name of the CodeSpec from the source iModel.\r\n * @param targetCodeSpecName The name of the CodeSpec from the target iModel.\r\n * @throws [[IModelError]] if either CodeSpec could not be found.\r\n */\r\n public remapCodeSpec(sourceCodeSpecName: string, targetCodeSpecName: string): void {\r\n const sourceCodeSpec: CodeSpec = this.sourceDb.codeSpecs.getByName(sourceCodeSpecName);\r\n const targetCodeSpec: CodeSpec = this.targetDb.codeSpecs.getByName(targetCodeSpecName);\r\n this._nativeContext.addCodeSpecId(sourceCodeSpec.id, targetCodeSpec.id);\r\n }\r\n\r\n /** Add a rule that remaps the specified source class to the specified target class. */\r\n public remapElementClass(sourceClassFullName: string, targetClassFullName: string): void {\r\n this._nativeContext.addClass(sourceClassFullName, targetClassFullName);\r\n }\r\n\r\n /** Add a rule that remaps the specified source Element to the specified target Element. */\r\n public remapElement(sourceId: Id64String, targetId: Id64String): void {\r\n this._nativeContext.addElementId(sourceId, targetId);\r\n }\r\n\r\n /** Remove a rule that remaps the specified source Element. */\r\n public removeElement(sourceId: Id64String): void {\r\n this._nativeContext.removeElementId(sourceId);\r\n }\r\n\r\n /** Look up a target CodeSpecId from the source CodeSpecId.\r\n * @returns the target CodeSpecId or [Id64.invalid]($bentley) if a mapping not found.\r\n */\r\n public findTargetCodeSpecId(sourceId: Id64String): Id64String {\r\n if (Id64.invalid === sourceId) {\r\n return Id64.invalid;\r\n }\r\n return this._nativeContext.findCodeSpecId(sourceId);\r\n }\r\n\r\n /** Look up a target ElementId from the source ElementId.\r\n * @returns the target ElementId or [Id64.invalid]($bentley) if a mapping not found.\r\n */\r\n public findTargetElementId(sourceElementId: Id64String): Id64String {\r\n if (Id64.invalid === sourceElementId) {\r\n return Id64.invalid;\r\n }\r\n return this._nativeContext.findElementId(sourceElementId);\r\n }\r\n\r\n /** Filter out geometry entries in the specified SubCategory from GeometryStreams in the target iModel.\r\n * @note It is not possible to filter out a *default* SubCategory. A request to do so will be ignored.\r\n * @see [SubCategory.isDefaultSubCategory]($backend)\r\n */\r\n public filterSubCategory(sourceSubCategoryId: Id64String): void {\r\n const sourceSubCategory = this.sourceDb.elements.tryGetElement<SubCategory>(sourceSubCategoryId, SubCategory);\r\n if (sourceSubCategory && !sourceSubCategory.isDefaultSubCategory) {\r\n this._nativeContext.filterSubCategoryId(sourceSubCategoryId);\r\n }\r\n }\r\n\r\n /** Returns `true` if there are any SubCategories being filtered. */\r\n public get hasSubCategoryFilter(): boolean {\r\n return this._nativeContext.hasSubCategoryFilter();\r\n }\r\n\r\n /** Returns `true` if this SubCategory is being filtered. */\r\n public isSubCategoryFiltered(subCategoryId: Id64String): boolean {\r\n return this._nativeContext.isSubCategoryFiltered(subCategoryId);\r\n }\r\n\r\n /** Import the specified font from the source iModel into the target iModel.\r\n * @internal\r\n */\r\n public importFont(sourceFontNumber: number): void {\r\n this.targetDb.clearFontMap(); // so it will be reloaded with new font info\r\n this._nativeContext.importFont(sourceFontNumber);\r\n }\r\n\r\n /** Import a single CodeSpec from the source iModel into the target iModel.\r\n * @internal\r\n */\r\n public importCodeSpec(sourceCodeSpecId: Id64String): void {\r\n this._nativeContext.importCodeSpec(sourceCodeSpecId);\r\n }\r\n\r\n /** Clone the specified source Element into ElementProps for the target iModel.\r\n * @internal\r\n */\r\n public async cloneElement(sourceElement: Element, cloneOptions?: IModelJsNative.CloneElementOptions): Promise<ElementProps> {\r\n const targetElementProps: ElementProps = this._nativeContext.cloneElement(sourceElement.id, cloneOptions);\r\n // Ensure that all NavigationProperties in targetElementProps have a defined value so \"clearing\" changes will be part of the JSON used for update\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n sourceElement.forEachProperty((propertyName: string, meta: PropertyMetaData) => {\r\n if ((meta.isNavigation) && (undefined === (sourceElement as any)[propertyName])) {\r\n (targetElementProps as any)[propertyName] = RelatedElement.none;\r\n }\r\n }, false); // exclude custom because C++ has already handled them\r\n if (this.isBetweenIModels) {\r\n // The native C++ cloneElement strips off federationGuid, want to put it back if transformation is between iModels\r\n targetElementProps.federationGuid = sourceElement.federationGuid;\r\n if (CodeScopeSpec.Type.Repository === this.targetDb.codeSpecs.getById(targetElementProps.code.spec).scopeType) {\r\n targetElementProps.code.scope = IModel.rootSubjectId;\r\n }\r\n }\r\n // unlike other references, code cannot be null. If it is null, use an empty code instead\r\n if (targetElementProps.code.scope === Id64.invalid || targetElementProps.code.spec === Id64.invalid) {\r\n targetElementProps.code = Code.createEmpty();\r\n }\r\n const jsClass = this.sourceDb.getJsClass<typeof Element>(sourceElement.classFullName);\r\n // eslint-disable-next-line @typescript-eslint/dot-notation\r\n await jsClass[\"onCloned\"](this, sourceElement.toJSON(), targetElementProps);\r\n return targetElementProps;\r\n }\r\n\r\n /**\r\n * serialize state to a sqlite database at a given path\r\n * assumes the database has not already had any context state serialized to it\r\n * @internal\r\n */\r\n public saveStateToDb(db: SQLiteDb): void {\r\n this._nativeContext.saveStateToDb(db[_nativeDb]);\r\n }\r\n\r\n /**\r\n * load state from a sqlite database at a given path\r\n * @internal\r\n */\r\n public loadStateFromDb(db: SQLiteDb): void {\r\n this._nativeContext.loadStateFromDb(db[_nativeDb]);\r\n }\r\n}\r\n"]}
@@ -150,6 +150,11 @@ export interface IModelHostOptions {
150
150
  * @beta
151
151
  */
152
152
  disableRestorePointOnPullMerge?: true;
153
+ /**
154
+ * Configuration controlling whether incremental schema loading is enabled or disabled.
155
+ * @beta
156
+ */
157
+ incrementalSchemaLoading?: "enabled" | "disabled";
153
158
  }
154
159
  /** Configuration of core-backend.
155
160
  * @public
@@ -193,6 +198,12 @@ export declare class IModelHostConfiguration implements IModelHostOptions {
193
198
  * @beta
194
199
  */
195
200
  disableRestorePointOnPullMerge?: true;
201
+ /**
202
+ * Configuration controlling whether incremental schema loading is disabled.
203
+ * Default is "disabled" at the moment to preserve existing behavior.
204
+ * @beta
205
+ */
206
+ incrementalSchemaLoading: "enabled" | "disabled";
196
207
  }
197
208
  /** IModelHost initializes ($backend) and captures its configuration. A backend must call [[IModelHost.startup]] before using any backend classes.
198
209
  * See [the learning article]($docs/learning/backend/IModelHost.md)
@@ -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,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,8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BAAoB,IAAI,MAAM,CAE/C;IAED;;OAEG;IACH,WAAkB,sBAAsB,IAAI,OAAO,CAElD;IAED;;OAEG;IACH,WAAkB,0BAA0B,IAAI,OAAO,CAEtD;IAED;;OAEG;IACH,WAAkB,mBAAmB,IAAI,OAAO,CAE/C;IAED,OAAO,CAAC,MAAM,CAAC,cAAc;IAqB7B,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAclC,gBAAgB;WACF,qBAAqB,CAAC,GAAG,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM;CAG5H;AAED;;GAEG;AACH,qBAAa,QAAQ;IACnB,oCAAoC;IACpC,WAAkB,YAAY,IAAI,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAEzF;CACF;AAED;;GAEG;AACH,qBAAa,cAAc;IAEzB,iEAAiE;IACjE,WAAkB,eAAe,IAAI,YAAY,CAEhD;IAED,8DAA8D;IAC9D,WAAkB,gBAAgB,IAAI,YAAY,CAEjD;IAED,+BAA+B;IAC/B,WAAkB,MAAM,IAAI,YAAY,CAEvC;CACF;AAED;;;;;GAKG;AACH,8BAAsB,gBAAgB;IACpC;;;OAGG;IACI,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAC1D;;;;OAIG;IACI,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAO1C;;;OAGG;IACI,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IACjE;;;;OAIG;IACI,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAOnD"}
@@ -77,6 +77,12 @@ export class IModelHostConfiguration {
77
77
  * @beta
78
78
  */
79
79
  disableRestorePointOnPullMerge;
80
+ /**
81
+ * Configuration controlling whether incremental schema loading is disabled.
82
+ * Default is "disabled" at the moment to preserve existing behavior.
83
+ * @beta
84
+ */
85
+ incrementalSchemaLoading = "disabled";
80
86
  }
81
87
  /**
82
88
  * Settings for `IModelHost.appWorkspace`.
@@ -1 +1 @@
1
- {"version":3,"file":"IModelHost.js","sourceRoot":"","sources":["../../src/IModelHost.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,yFAAyF;AACzF,OAAO,YAAY,CAAC,CAAC,mCAAmC;AAExD,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAe,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAc,YAAY,EAAE,MAAM,EAAW,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9J,OAAO,EAAuB,WAAW,EAA8B,MAAM,oBAAoB,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAA4B,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACrH,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAGpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,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A+B;IACxB,MAAM,KAAK,MAAM;QACtB,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC;IACrB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAgB,gBAAgB;IACpC;;;OAGG;IACI,aAAa,CAAC,QAAgB,IAAwB,OAAO,SAAS,CAAC,CAAC,CAAC;IAChF;;;;OAIG;IACI,UAAU,CAAC,OAAe;QAC/B,MAAM,gBAAgB,GAAuB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACzE,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC;YACnC,MAAM,IAAI,WAAW,CAAC,YAAY,CAAC,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,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,UAAU,eAAe,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF","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\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\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 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,OAAO,YAAY,CAAC,CAAC,mCAAmC;AAExD,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAe,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAc,YAAY,EAAE,MAAM,EAAW,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9J,OAAO,EAAuB,WAAW,EAA8B,MAAM,oBAAoB,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAA4B,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACrH,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAGpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MA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C;QAC7E,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module IModelHost\r\n */\r\n\r\n// To avoid circular load errors, the \"Element\" classes must be loaded before IModelHost.\r\nimport \"./IModelDb\"; // DO NOT REMOVE OR MOVE THIS LINE!\r\n\r\nimport { IModelNative, loadNativePlatform } from \"./internal/NativePlatform\";\r\nimport * as os from \"node:os\";\r\nimport { NativeLibrary } from \"@bentley/imodeljs-native\";\r\nimport { AccessToken, assert, BeEvent, BentleyStatus, DbResult, Guid, GuidString, IModelStatus, Logger, Mutable, ProcessDetector } from \"@itwin/core-bentley\";\r\nimport { AuthorizationClient, IModelError, LocalDirName, SessionProps } from \"@itwin/core-common\";\r\nimport { AzureServerStorage, AzureServerStorageConfig, BlobServiceClientWrapper } from \"@itwin/object-storage-azure\";\r\nimport { BlobServiceClient, StorageSharedKeyCredential } from \"@azure/storage-blob\";\r\nimport type { ServerStorage } from \"@itwin/object-storage-core\";\r\nimport { BackendHubAccess, CreateNewIModelProps } from \"./BackendHubAccess\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { BisCoreSchema } from \"./BisCoreSchema\";\r\nimport { BriefcaseManager } from \"./BriefcaseManager\";\r\nimport { CloudSqlite } from \"./CloudSqlite\";\r\nimport { FunctionalSchema } from \"./domains/FunctionalSchema\";\r\nimport { GenericSchema } from \"./domains/GenericSchema\";\r\nimport { GeoCoordConfig } from \"./GeoCoordConfig\";\r\nimport { IModelJsFs } from \"./IModelJsFs\";\r\nimport { DevToolsRpcImpl } from \"./rpc-impl/DevToolsRpcImpl\";\r\nimport { IModelReadRpcImpl } from \"./rpc-impl/IModelReadRpcImpl\";\r\nimport { IModelTileRpcImpl } from \"./rpc-impl/IModelTileRpcImpl\";\r\nimport { SnapshotIModelRpcImpl } from \"./rpc-impl/SnapshotIModelRpcImpl\";\r\nimport { initializeRpcBackend } from \"./RpcBackend\";\r\nimport { TileStorage } from \"./TileStorage\";\r\nimport { SettingsContainer, SettingsPriority } from \"./workspace/Settings\";\r\nimport { SettingsSchemas } from \"./workspace/SettingsSchemas\";\r\nimport { Workspace, WorkspaceOpts } from \"./workspace/Workspace\";\r\nimport { join, normalize as normalizeDir } from \"path\";\r\nimport { constructWorkspace, OwnedWorkspace } from \"./internal/workspace/WorkspaceImpl\";\r\nimport { SettingsImpl } from \"./internal/workspace/SettingsImpl\";\r\nimport { constructSettingsSchemas } from \"./internal/workspace/SettingsSchemasImpl\";\r\nimport { _getHubAccess, _hubAccess, _setHubAccess } from \"./internal/Symbols\";\r\n\r\nconst loggerCategory = BackendLoggerCategory.IModelHost;\r\n\r\n// cspell:ignore nodereport fatalerror apicall alicloud rpcs\r\n\r\n/** @internal */\r\nexport interface CrashReportingConfigNameValuePair {\r\n name: string;\r\n value: string;\r\n}\r\n\r\n/** Configuration of the crash-reporting system.\r\n * @internal\r\n */\r\nexport interface CrashReportingConfig {\r\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. */\r\n crashDir: string;\r\n /** max # .dmp files that may exist in crashDir. The default is 50. */\r\n maxDumpsInDir?: number;\r\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. */\r\n enableCrashDumps?: boolean;\r\n /** If enableCrashDumps is true, do you want a full-memory dump? Defaults to false. */\r\n wantFullMemoryDumps?: boolean;\r\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. */\r\n enableNodeReport?: boolean;\r\n /** Additional name, value pairs to write to iModelJsNativeCrash*.properties.txt file in the event of a crash. */\r\n params?: CrashReportingConfigNameValuePair[];\r\n /** Run this .js file to process .dmp and Node.js crash reporting .json files in the event of a crash.\r\n * This script will be executed with a single command-line parameter: the name of the dump or Node.js report file.\r\n * In the case of a dump file, there will be a second file with the same basename and the extension \".properties.txt\".\r\n * Since it runs in a separate process, this script will have no access to the Javascript\r\n * context of the exiting backend. No default.\r\n */\r\n dumpProcessorScriptFileName?: string;\r\n /** Upload crash dump and node-reports to Bentley's crash-reporting service? Defaults to false */\r\n uploadToBentley?: boolean;\r\n}\r\n\r\n/** @beta */\r\nexport interface AzureBlobStorageCredentials {\r\n account: string;\r\n accessKey: string;\r\n baseUrl?: string;\r\n}\r\n\r\n/**\r\n * Options for [[IModelHost.startup]]\r\n * @public\r\n */\r\nexport interface IModelHostOptions {\r\n /**\r\n * The name of the *Profile* subdirectory of [[cacheDir]] for this process. If not present, \"default\" is used.\r\n * @see [[IModelHost.profileName]]\r\n * @beta\r\n */\r\n profileName?: string;\r\n\r\n /**\r\n * Root of the directory holding all the files that iTwin.js caches\r\n * - If not specified at startup a platform specific default is used -\r\n * - Windows: $(HOMEDIR)/AppData/Local/iModelJs/\r\n * - Mac/iOS: $(HOMEDIR)/Library/Caches/iModelJs/\r\n * - Linux: $(HOMEDIR)/.cache/iModelJs/\r\n * where $(HOMEDIR) is documented [here](https://nodejs.org/api/os.html#os_os_homedir)\r\n * - if specified, ensure it is set to a folder with read/write access.\r\n * @see [[IModelHost.cacheDir]] for the value it's set to after startup\r\n */\r\n cacheDir?: LocalDirName;\r\n\r\n /** The directory where application assets are found. */\r\n appAssetsDir?: LocalDirName;\r\n\r\n /**\r\n * Options for creating the [[IModelHost.appWorkspace]]\r\n * @beta\r\n */\r\n workspace?: WorkspaceOpts;\r\n\r\n /**\r\n * The kind of iModel hub server to use.\r\n */\r\n hubAccess?: BackendHubAccess;\r\n\r\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.\r\n * @beta\r\n */\r\n tileCacheAzureCredentials?: AzureBlobStorageCredentials;\r\n\r\n /**\r\n * @beta\r\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),\r\n * set this property with a custom ServerStorage.\r\n */\r\n tileCacheStorage?: ServerStorage;\r\n\r\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.\r\n * The local cache is used only if an external cache has not been configured via [[tileCacheStorage]], and [[tileCacheAzureCredentials]].\r\n * Defaults to 1 GB. Must be an unsigned integer. A value of zero disables the local cache entirely.\r\n * @beta\r\n */\r\n maxTileCacheDbSize?: number;\r\n\r\n /** Whether to restrict tile cache URLs by client IP address (if available).\r\n * @beta\r\n */\r\n restrictTileUrlsByClientIp?: boolean;\r\n\r\n /** Whether to enable OpenTelemetry tracing.\r\n * Defaults to `false`.\r\n */\r\n enableOpenTelemetry?: boolean;\r\n\r\n /** Whether to compress cached tiles.\r\n * Defaults to `true`.\r\n */\r\n compressCachedTiles?: boolean;\r\n\r\n /** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileTreeProps]($common) should wait before returning a \"pending\" status.\r\n * @internal\r\n */\r\n tileTreeRequestTimeout?: number;\r\n\r\n /** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileContent]($common) should wait before returning a \"pending\" status.\r\n * @internal\r\n */\r\n tileContentRequestTimeout?: number;\r\n\r\n /** The backend will log when a tile took longer to load than this threshold in seconds.\r\n * @internal\r\n */\r\n logTileLoadTimeThreshold?: number;\r\n\r\n /** The backend will log when a tile is loaded with a size in bytes above this threshold.\r\n * @internal\r\n */\r\n logTileSizeThreshold?: number;\r\n\r\n /** Crash-reporting configuration\r\n * @internal\r\n */\r\n crashReportingConfig?: CrashReportingConfig;\r\n\r\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\r\n authorizationClient?: AuthorizationClient;\r\n\r\n /**\r\n * Automatically enable shared channel when opening iModels for read/write (see [Working With Channels]($docs/learning/backend/Channel.md)).\r\n * If not present, defaults to `true` for backwards compatibility. This means that the shared channel may be edited by default. Generally\r\n * that is undesirable because it allows applications to \"accidentally\" modify data it shouldn't be allowed to modify. Unfortunately the\r\n * previous versions of iTwin.js allowed it so this is necessary so they won't break.\r\n * Will be changed to default to `false` in 5.0.\r\n */\r\n allowSharedChannel?: boolean;\r\n\r\n /**\r\n * Setting this to true will revert to the previous behavior of using the native side for all CRUD operations.\r\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.\r\n * This workflow performs work previously done on the native side in the TS side, resulting in performance improvements, if errors are detected,\r\n * this option can be set to true to revert to old workflow.\r\n */\r\n disableThinnedNativeInstanceWorkflow?: boolean;\r\n\r\n /**\r\n * Configuration controlling whether to disable the creation of restore points during pull/merge operations.\r\n * @beta\r\n */\r\n disableRestorePointOnPullMerge?: true;\r\n /**\r\n * Configuration controlling whether incremental schema loading is enabled or disabled.\r\n * @beta\r\n */\r\n incrementalSchemaLoading?: \"enabled\" | \"disabled\";\r\n}\r\n\r\n/** Configuration of core-backend.\r\n * @public\r\n */\r\nexport class IModelHostConfiguration implements IModelHostOptions {\r\n public static defaultTileRequestTimeout = 20 * 1000;\r\n public static defaultLogTileLoadTimeThreshold = 40;\r\n public static defaultLogTileSizeThreshold = 20 * 1000000;\r\n /** @internal */\r\n public static defaultMaxTileCacheDbSize = 1024 * 1024 * 1024;\r\n public appAssetsDir?: LocalDirName;\r\n public cacheDir?: LocalDirName;\r\n\r\n /** @beta */\r\n public workspace?: WorkspaceOpts;\r\n public hubAccess?: BackendHubAccess;\r\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\r\n public authorizationClient?: AuthorizationClient;\r\n /** @beta */\r\n public restrictTileUrlsByClientIp?: boolean;\r\n public compressCachedTiles?: boolean;\r\n /** @beta */\r\n public tileCacheAzureCredentials?: AzureBlobStorageCredentials;\r\n /** @internal */\r\n public tileTreeRequestTimeout = IModelHostConfiguration.defaultTileRequestTimeout;\r\n /** @internal */\r\n public tileContentRequestTimeout = IModelHostConfiguration.defaultTileRequestTimeout;\r\n /** @internal */\r\n public logTileLoadTimeThreshold = IModelHostConfiguration.defaultLogTileLoadTimeThreshold;\r\n /** @internal */\r\n public logTileSizeThreshold = IModelHostConfiguration.defaultLogTileSizeThreshold;\r\n /** @internal */\r\n public crashReportingConfig?: CrashReportingConfig;\r\n /**\r\n * Configuration controlling whether to use the thinned down native instance functions for element, model, and aspect CRUD operations\r\n * or use the previous behavior of using the native side for all CRUD operations. Set to true to revert to the previous behavior.\r\n * @beta\r\n */\r\n public disableThinnedNativeInstanceWorkflow?: boolean;\r\n\r\n /**\r\n * Configuration controlling whether to disable the creation of restore points during pull/merge operations.\r\n * @beta\r\n */\r\n public disableRestorePointOnPullMerge?: true;\r\n /**\r\n * Configuration controlling whether incremental schema loading is disabled.\r\n * Default is \"disabled\" at the moment to preserve existing behavior.\r\n * @beta\r\n */\r\n public incrementalSchemaLoading: \"enabled\" | \"disabled\" = \"disabled\";\r\n}\r\n\r\n/**\r\n * Settings for `IModelHost.appWorkspace`.\r\n * @note this includes the default dictionary from the SettingsSpecRegistry\r\n */\r\nclass ApplicationSettings extends SettingsImpl {\r\n private _remove?: VoidFunction;\r\n protected override verifyPriority(priority: SettingsPriority) {\r\n if (priority > SettingsPriority.application) // only application or lower may appear in ApplicationSettings\r\n throw new Error(\"Use IModelSettings\");\r\n }\r\n private updateDefaults() {\r\n const defaults: SettingsContainer = {};\r\n for (const [schemaName, val] of IModelHost.settingsSchemas.settingDefs) {\r\n if (val.default)\r\n defaults[schemaName] = val.default;\r\n }\r\n this.addDictionary({ name: \"_default_\", priority: 0 }, defaults);\r\n }\r\n\r\n public constructor() {\r\n super();\r\n this._remove = IModelHost.settingsSchemas.onSchemaChanged.addListener(() => this.updateDefaults());\r\n this.updateDefaults();\r\n }\r\n\r\n public override close() {\r\n if (this._remove) {\r\n this._remove();\r\n this._remove = undefined;\r\n }\r\n }\r\n}\r\n\r\nconst definedInStartup = <T>(obj: T | undefined): T => {\r\n if (obj === undefined)\r\n throw new Error(\"IModelHost.startup must be called first\");\r\n return obj;\r\n};\r\n\r\n/** IModelHost initializes ($backend) and captures its configuration. A backend must call [[IModelHost.startup]] before using any backend classes.\r\n * See [the learning article]($docs/learning/backend/IModelHost.md)\r\n * @public\r\n */\r\nexport class IModelHost {\r\n private constructor() { }\r\n\r\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\r\n public static authorizationClient?: AuthorizationClient;\r\n\r\n public static backendVersion = \"\";\r\n private static _profileName: string;\r\n private static _cacheDir = \"\";\r\n private static _settingsSchemas?: SettingsSchemas;\r\n private static _appWorkspace?: OwnedWorkspace;\r\n\r\n // Omit the hubAccess field from configuration so it stays internal.\r\n public static configuration?: Omit<IModelHostOptions, \"hubAccess\">;\r\n\r\n /**\r\n * The name of the *Profile* directory (a subdirectory of \"[[cacheDir]]/profiles/\") for this process.\r\n *\r\n * The *Profile* directory is used to cache data that is specific to a type-of-usage of the iTwin.js library.\r\n * It is important that information in the profile cache be consistent but isolated across sessions (i.e.\r\n * data for a profile is maintained between runs, but each profile is completely independent and\r\n * unaffected by the presence or use of others.)\r\n * @note **Only one process at a time may be using a given profile**, and an exception will be thrown by [[startup]]\r\n * if a second process attempts to use the same profile.\r\n * @beta\r\n */\r\n public static get profileName(): string {\r\n return this._profileName;\r\n }\r\n\r\n /** The full path of the Profile directory.\r\n * @see [[profileName]]\r\n * @beta\r\n */\r\n public static get profileDir(): LocalDirName {\r\n return join(this._cacheDir, \"profiles\", this._profileName);\r\n }\r\n\r\n /** Event raised during startup to allow loading settings data */\r\n public static readonly onWorkspaceStartup = new BeEvent<() => void>();\r\n\r\n /** Event raised just after the backend IModelHost was started */\r\n public static readonly onAfterStartup = new BeEvent<() => void>();\r\n\r\n /** Event raised just before the backend IModelHost is to be shut down */\r\n public static readonly onBeforeShutdown = new BeEvent<() => void>();\r\n\r\n /** @internal */\r\n public static readonly session: Mutable<SessionProps> = { applicationId: \"2686\", applicationVersion: \"1.0.0\", sessionId: \"\" };\r\n\r\n /** A uniqueId for this session */\r\n public static get sessionId() { return this.session.sessionId; }\r\n public static set sessionId(id: GuidString) { this.session.sessionId = id; }\r\n\r\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. */\r\n public static get applicationId() { return this.session.applicationId; }\r\n public static set applicationId(id: string) { this.session.applicationId = id; }\r\n\r\n /** The version of this application - needs to be set if is an agent application. The applicationVersion will otherwise originate at the frontend. */\r\n public static get applicationVersion() { return this.session.applicationVersion; }\r\n public static set applicationVersion(version: string) { this.session.applicationVersion = version; }\r\n\r\n /** A string that can identify the current user to other users when collaborating. */\r\n public static userMoniker = \"unknown\";\r\n\r\n /** Root directory holding files that iTwin.js caches */\r\n public static get cacheDir(): LocalDirName { return this._cacheDir; }\r\n\r\n /** The application [[Workspace]] for this `IModelHost`\r\n * @note this `Workspace` only holds [[WorkspaceContainer]]s and [[Settings]] scoped to the currently loaded application(s).\r\n * All organization, iTwin, and iModel based containers or settings must be accessed through [[IModelDb.workspace]] and\r\n * attempting to add them to this Workspace will fail.\r\n * @beta\r\n */\r\n public static get appWorkspace(): Workspace { return definedInStartup(this._appWorkspace); }\r\n\r\n /** The registry of schemas describing the [[Setting]]s for the application session.\r\n * Applications should register their schemas via methods like [[SettingsSchemas.addGroup]].\r\n * @beta\r\n */\r\n public static get settingsSchemas(): SettingsSchemas { return definedInStartup(this._settingsSchemas); }\r\n\r\n /** The optional [[FileNameResolver]] that resolves keys and partial file names for snapshot iModels.\r\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.\r\n */\r\n public static snapshotFileNameResolver?: FileNameResolver; // eslint-disable-line @typescript-eslint/no-deprecated\r\n\r\n /** Get the current access token for this IModelHost, or a blank string if none is available.\r\n * @note for web backends, this will *always* return a blank string because the backend itself has no token (but never needs one either.)\r\n * For all IpcHosts, where this backend is servicing a single frontend, this will be the user's token. For ElectronHost, the backend\r\n * obtains the token and forwards it to the frontend.\r\n * @note accessTokens expire periodically and are automatically refreshed, if possible. Therefore tokens should not be saved, and the value\r\n * returned by this method may change over time throughout the course of a session.\r\n */\r\n public static async getAccessToken(): Promise<AccessToken> {\r\n try {\r\n return (await IModelHost.authorizationClient?.getAccessToken()) ?? \"\";\r\n } catch {\r\n return \"\";\r\n }\r\n }\r\n\r\n private static loadNative(options: IModelHostOptions) {\r\n loadNativePlatform();\r\n\r\n if (options.crashReportingConfig && options.crashReportingConfig.crashDir && !ProcessDetector.isElectronAppBackend && !ProcessDetector.isMobileAppBackend) {\r\n IModelNative.platform.setCrashReporting(options.crashReportingConfig);\r\n\r\n Logger.logTrace(loggerCategory, \"Configured crash reporting\", {\r\n enableCrashDumps: options.crashReportingConfig?.enableCrashDumps,\r\n wantFullMemoryDumps: options.crashReportingConfig?.wantFullMemoryDumps,\r\n enableNodeReport: options.crashReportingConfig?.enableNodeReport,\r\n uploadToBentley: options.crashReportingConfig?.uploadToBentley,\r\n });\r\n\r\n if (options.crashReportingConfig.enableNodeReport) {\r\n if (process.report !== undefined) {\r\n process.report.reportOnFatalError = true;\r\n process.report.reportOnUncaughtException = true;\r\n process.report.directory = options.crashReportingConfig.crashDir;\r\n Logger.logTrace(loggerCategory, \"Configured Node.js crash reporting\");\r\n } else {\r\n Logger.logWarning(loggerCategory, \"Unable to configure Node.js crash reporting\");\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static tileStorage?: TileStorage;\r\n\r\n private static _hubAccess?: BackendHubAccess;\r\n /** @internal */\r\n public static [_setHubAccess](hubAccess: BackendHubAccess | undefined) { this._hubAccess = hubAccess; }\r\n\r\n /** get the current hubAccess, if present.\r\n * @internal\r\n */\r\n public static [_getHubAccess](): BackendHubAccess | undefined { return this._hubAccess; }\r\n\r\n /** Provides access to the IModelHub for this IModelHost\r\n * @internal\r\n * @note If [[IModelHostOptions.hubAccess]] was undefined when initializing this class, accessing this property will throw an error.\r\n * To determine whether one is present, use [[_getHubAccess]].\r\n */\r\n public static get [_hubAccess](): BackendHubAccess {\r\n if (IModelHost._hubAccess === undefined)\r\n throw new IModelError(IModelStatus.BadRequest, \"No BackendHubAccess supplied in IModelHostOptions\");\r\n return IModelHost._hubAccess;\r\n }\r\n\r\n private static initializeWorkspace(configuration: IModelHostOptions) {\r\n const settingAssets = join(KnownLocations.packageAssetsDir, \"Settings\");\r\n this._settingsSchemas = constructSettingsSchemas();\r\n this._settingsSchemas.addDirectory(join(settingAssets, \"Schemas\"));\r\n this._appWorkspace = constructWorkspace(new ApplicationSettings(), configuration.workspace);\r\n\r\n // Create the CloudCache for Workspaces. This will fail if another process is already using the same profile.\r\n try {\r\n this.appWorkspace.getCloudCache();\r\n } catch (e: any) {\r\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;\r\n }\r\n\r\n this.appWorkspace.settings.addDirectory(settingAssets, SettingsPriority.defaults);\r\n\r\n GeoCoordConfig.onStartup();\r\n // allow applications to load their default settings\r\n this.onWorkspaceStartup.raiseEvent();\r\n }\r\n\r\n private static _isValid = false;\r\n\r\n /** true between a successful call to [[startup]] and before [[shutdown]] */\r\n public static get isValid() {\r\n return IModelHost._isValid;\r\n }\r\n\r\n /** This method must be called before any iTwin.js services are used.\r\n * @param options Host configuration data.\r\n * Raises [[onAfterStartup]].\r\n * @see [[shutdown]].\r\n */\r\n public static async startup(options?: IModelHostOptions): Promise<void> {\r\n if (this._isValid)\r\n return; // we're already initialized\r\n this._isValid = true;\r\n\r\n options = options ?? {};\r\n if (this.sessionId === \"\")\r\n this.sessionId = Guid.createValue();\r\n\r\n this.authorizationClient = options.authorizationClient;\r\n\r\n this.backendVersion = require(\"../../package.json\").version; // eslint-disable-line @typescript-eslint/no-require-imports\r\n initializeRpcBackend(options.enableOpenTelemetry);\r\n\r\n this.loadNative(options);\r\n this.setupCacheDir(options);\r\n this.initializeWorkspace(options);\r\n\r\n BriefcaseManager.initialize(join(this._cacheDir, \"imodels\"));\r\n\r\n [\r\n IModelReadRpcImpl,\r\n IModelTileRpcImpl,\r\n SnapshotIModelRpcImpl, // eslint-disable-line @typescript-eslint/no-deprecated\r\n DevToolsRpcImpl,\r\n ].forEach((rpc) => rpc.register()); // register all of the RPC implementations\r\n\r\n [\r\n BisCoreSchema,\r\n GenericSchema,\r\n FunctionalSchema,\r\n ].forEach((schema) => schema.registerSchema()); // register all of the schemas\r\n\r\n const { hubAccess, ...otherOptions } = options;\r\n if (undefined !== hubAccess)\r\n this._hubAccess = hubAccess;\r\n\r\n this.configuration = otherOptions;\r\n this.setupTileCache();\r\n\r\n process.once(\"beforeExit\", IModelHost.shutdown);\r\n this.onAfterStartup.raiseEvent();\r\n }\r\n\r\n private static setupCacheDir(configuration: IModelHostOptions) {\r\n this._cacheDir = normalizeDir(configuration.cacheDir ?? NativeLibrary.defaultCacheDir);\r\n IModelJsFs.recursiveMkDirSync(this._cacheDir);\r\n\r\n this._profileName = configuration.profileName ?? \"default\";\r\n Logger.logInfo(loggerCategory, `cacheDir: [${this.cacheDir}], profileDir: [${this.profileDir}]`);\r\n }\r\n\r\n /** This method must be called when an iTwin.js host is shut down. Raises [[onBeforeShutdown]] */\r\n public static async shutdown(this: void): Promise<void> {\r\n // Note: This method is set as a node listener where `this` is unbound. Call private method to\r\n // ensure `this` is correct. Don't combine these methods.\r\n return IModelHost.doShutdown();\r\n }\r\n\r\n /**\r\n * Create a new iModel.\r\n * @returns the Guid of the newly created iModel.\r\n * @throws [IModelError]($common) in case of errors.\r\n * @note If [[IModelHostOptions.hubAccess]] was undefined in the call to [[startup]], this function will throw an error.\r\n */\r\n public static async createNewIModel(arg: CreateNewIModelProps): Promise<GuidString> {\r\n return this[_hubAccess].createNewIModel(arg);\r\n }\r\n\r\n private static async doShutdown() {\r\n if (!this._isValid)\r\n return;\r\n\r\n this._isValid = false;\r\n this.onBeforeShutdown.raiseEvent();\r\n\r\n this.configuration = undefined;\r\n this.tileStorage = undefined;\r\n\r\n this._appWorkspace?.close();\r\n this._appWorkspace = undefined;\r\n this._settingsSchemas = undefined;\r\n\r\n CloudSqlite.CloudCaches.destroy();\r\n process.removeListener(\"beforeExit\", IModelHost.shutdown);\r\n }\r\n\r\n /**\r\n * Add or update a property that should be included in a crash report.\r\n * @internal\r\n */\r\n public static setCrashReportProperty(name: string, value: string): void {\r\n IModelNative.platform.setCrashReportProperty(name, value);\r\n }\r\n\r\n /**\r\n * Remove a previously defined property so that will not be included in a crash report.\r\n * @internal\r\n */\r\n public static removeCrashReportProperty(name: string): void {\r\n IModelNative.platform.setCrashReportProperty(name, undefined);\r\n }\r\n\r\n /**\r\n * Get all properties that will be included in a crash report.\r\n * @internal\r\n */\r\n public static getCrashReportProperties(): CrashReportingConfigNameValuePair[] {\r\n return IModelNative.platform.getCrashReportProperties();\r\n }\r\n\r\n /** The directory where application assets may be found */\r\n public static get appAssetsDir(): string | undefined {\r\n return undefined !== IModelHost.configuration ? IModelHost.configuration.appAssetsDir : undefined;\r\n }\r\n\r\n /** The time, in milliseconds, for which IModelTileRpcInterface.requestTileTreeProps should wait before returning a \"pending\" status.\r\n * @internal\r\n */\r\n public static get tileTreeRequestTimeout(): number {\r\n return IModelHost.configuration?.tileTreeRequestTimeout ?? IModelHostConfiguration.defaultTileRequestTimeout;\r\n }\r\n /** The time, in milliseconds, for which IModelTileRpcInterface.requestTileContent should wait before returning a \"pending\" status.\r\n * @internal\r\n */\r\n public static get tileContentRequestTimeout(): number {\r\n return IModelHost.configuration?.tileContentRequestTimeout ?? IModelHostConfiguration.defaultTileRequestTimeout;\r\n }\r\n\r\n /** The backend will log when a tile took longer to load than this threshold in seconds. */\r\n public static get logTileLoadTimeThreshold(): number {\r\n return IModelHost.configuration?.logTileLoadTimeThreshold ?? IModelHostConfiguration.defaultLogTileLoadTimeThreshold;\r\n }\r\n /** The backend will log when a tile is loaded with a size in bytes above this threshold. */\r\n public static get logTileSizeThreshold(): number {\r\n return IModelHost.configuration?.logTileSizeThreshold ?? IModelHostConfiguration.defaultLogTileSizeThreshold;\r\n }\r\n\r\n /** Whether external tile caching is active.\r\n * @internal\r\n */\r\n public static get usingExternalTileCache(): boolean {\r\n return undefined !== IModelHost.tileStorage;\r\n }\r\n\r\n /** Whether to restrict tile cache URLs by client IP address.\r\n * @internal\r\n */\r\n public static get restrictTileUrlsByClientIp(): boolean {\r\n return undefined !== IModelHost.configuration && (IModelHost.configuration.restrictTileUrlsByClientIp ? true : false);\r\n }\r\n\r\n /** Whether to compress cached tiles.\r\n * @internal\r\n */\r\n public static get compressCachedTiles(): boolean {\r\n return false !== IModelHost.configuration?.compressCachedTiles;\r\n }\r\n\r\n private static setupTileCache() {\r\n assert(undefined !== IModelHost.configuration);\r\n const config = IModelHost.configuration;\r\n const storage = config.tileCacheStorage;\r\n const credentials = config.tileCacheAzureCredentials;\r\n\r\n if (!storage && !credentials) {\r\n IModelNative.platform.setMaxTileCacheSize(config.maxTileCacheDbSize ?? IModelHostConfiguration.defaultMaxTileCacheDbSize);\r\n return;\r\n }\r\n\r\n IModelNative.platform.setMaxTileCacheSize(0);\r\n if (credentials) {\r\n if (storage)\r\n throw new IModelError(BentleyStatus.ERROR, \"Cannot use both Azure and custom cloud storage providers for tile cache.\");\r\n this.setupAzureTileCache(credentials);\r\n }\r\n if (storage)\r\n IModelHost.tileStorage = new TileStorage(storage);\r\n }\r\n\r\n private static setupAzureTileCache(credentials: AzureBlobStorageCredentials) {\r\n const storageConfig: AzureServerStorageConfig = {\r\n accountName: credentials.account,\r\n accountKey: credentials.accessKey,\r\n baseUrl: credentials.baseUrl ?? `https://${credentials.account}.blob.core.windows.net`,\r\n }\r\n const blobServiceClient = new BlobServiceClient(\r\n storageConfig.baseUrl,\r\n new StorageSharedKeyCredential(storageConfig.accountName, storageConfig.accountKey),\r\n );\r\n const azureStorage: ServerStorage = new AzureServerStorage(storageConfig, new BlobServiceClientWrapper(blobServiceClient))\r\n IModelHost.tileStorage = new TileStorage(azureStorage);\r\n }\r\n\r\n /** @internal */\r\n public static computeSchemaChecksum(arg: { schemaXmlPath: string, referencePaths: string[], exactMatch?: boolean }): string {\r\n return IModelNative.platform.computeSchemaChecksum(arg);\r\n }\r\n}\r\n\r\n/** Information about the platform on which the app is running.\r\n * @public\r\n */\r\nexport class Platform {\r\n /** Get the name of the platform. */\r\n public static get platformName(): \"win32\" | \"linux\" | \"darwin\" | \"ios\" | \"android\" | \"uwp\" {\r\n return process.platform as any;\r\n }\r\n}\r\n\r\n/** Well known directories that may be used by the application.\r\n * @public\r\n */\r\nexport class KnownLocations {\r\n\r\n /** The directory where the imodeljs-native assets are stored. */\r\n public static get nativeAssetsDir(): LocalDirName {\r\n return IModelNative.platform.DgnDb.getAssetsDir();\r\n }\r\n\r\n /** The directory where the core-backend assets are stored. */\r\n public static get packageAssetsDir(): LocalDirName {\r\n return join(__dirname, \"assets\");\r\n }\r\n\r\n /** The temporary directory. */\r\n public static get tmpdir(): LocalDirName {\r\n return os.tmpdir();\r\n }\r\n}\r\n\r\n/** Extend this class to provide custom file name resolution behavior.\r\n * @note Only `tryResolveKey` and/or `tryResolveFileName` need to be overridden as the implementations of `resolveKey` and `resolveFileName` work for most purposes.\r\n * @see [[IModelHost.snapshotFileNameResolver]]\r\n * @public\r\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.\r\n */\r\nexport abstract class FileNameResolver {\r\n /** Resolve a file name from the specified key.\r\n * @param _fileKey The key that identifies the file name in a `Map` or other similar data structure.\r\n * @returns The resolved file name or `undefined` if not found.\r\n */\r\n public tryResolveKey(_fileKey: string): string | undefined { return undefined; }\r\n /** Resolve a file name from the specified key.\r\n * @param fileKey The key that identifies the file name in a `Map` or other similar data structure.\r\n * @returns The resolved file name.\r\n * @throws [[IModelError]] if not found.\r\n */\r\n public resolveKey(fileKey: string): string {\r\n const resolvedFileName: string | undefined = this.tryResolveKey(fileKey);\r\n if (undefined === resolvedFileName) {\r\n throw new IModelError(IModelStatus.NotFound, `${fileKey} not resolved`);\r\n }\r\n return resolvedFileName;\r\n }\r\n /** Resolve the input file name, which may be a partial name, into a full path file name.\r\n * @param inFileName The partial file name.\r\n * @returns The resolved full path file name or `undefined` if not found.\r\n */\r\n public tryResolveFileName(inFileName: string): string | undefined { return inFileName; }\r\n /** Resolve the input file name, which may be a partial name, into a full path file name.\r\n * @param inFileName The partial file name.\r\n * @returns The resolved full path file name.\r\n * @throws [[IModelError]] if not found.\r\n */\r\n public resolveFileName(inFileName: string): string {\r\n const resolvedFileName: string | undefined = this.tryResolveFileName(inFileName);\r\n if (undefined === resolvedFileName) {\r\n throw new IModelError(IModelStatus.NotFound, `${inFileName} not resolved`);\r\n }\r\n return resolvedFileName;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IModelIncrementalSchemaLocater.js","sourceRoot":"","sources":["../../src/IModelIncrementalSchemaLocater.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,EAAqB,kBAAkB,EAAqD,MAAM,0BAA0B,CAAC;AACpI,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGjE;;;GAGG;AACH,MAAM,OAAO,8BAA+B,SAAQ,kBAAkB;IACnD,OAAO,CAAW;IAEnC;;;;OAIG;IACH,YAAY,MAAgB,EAAE,OAAmC;QAC/D,KAAK,CAAC,OAAO,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,cAAc,CAAC,SAAoB;QACjD,iFAAiF;QACjF,iFAAiF;QACjF,eAAe;QACf,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE;YACtD,IAAI,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAgB,CAAC,CAAC;YACtE,CAAC;YACD,OAAO,KAAU,EAAE,CAAC;gBAClB,MAAM,CAAC,KAAc,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACT,CAAC;IAED;;;;;OAKG;IACO,KAAK,CAAC,YAAY,CAAO,KAAa,EAAE,OAA2B;QAC3E,MAAM,eAAe,GAAG,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEzG,OAAO,IAAI,CAAC,OAAO;aAChB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE;YACzC,SAAS,EAAE,cAAc,CAAC,qBAAqB;YAC/C,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;SACjC,CAAC;aACD,OAAO,EAAE,CAAC;IACf,CAAC;CACF","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 iModels\n */\nimport { ECSqlQueryOptions, ECSqlSchemaLocater, ECSqlSchemaLocaterOptions, SchemaKey, SchemaProps } from \"@itwin/ecschema-metadata\";\nimport { QueryBinder, QueryRowFormat } from \"@itwin/core-common\";\nimport { IModelDb } from \"./IModelDb\";\n\n/**\n * A [[ECSqlSchemaLocater]]($ecschema-metadata) implementation that uses the [[IModelDb]] to load schemas incrementally.\n * @beta\n */\nexport class IModelIncrementalSchemaLocater extends ECSqlSchemaLocater {\n private readonly _iModel: IModelDb;\n\n /**\n * Constructs a new IModelIncrementalSchemaLocater instance.\n * @param iModel The [[IModelDb]] to query.\n * @param options Optional [[ECSqlSchemaLocaterOptions]]($ecschema-metadata).\n */\n constructor(iModel: IModelDb, options?: ECSqlSchemaLocaterOptions) {\n super(options ?? { useMultipleQueries: true });\n this._iModel = iModel;\n }\n\n /**\n * Gets [[SchemaProps]]($ecschema-metadata) for the given [[SchemaKey]]($ecschema-metadata).\n * This is the full schema json with all elements that are defined in the schema.\n * @param schemaKey The key of the schema to be resolved.\n */\n protected async getSchemaProps(schemaKey: SchemaKey): Promise<SchemaProps | undefined> {\n // To keep the main thread from being blocked in sync loading cases the resolving\n // is triggered through a timeout. Even if there is no delay, it improves loading\n // time by ~3x.\n return new Promise((resolve, reject) => setTimeout(() => {\n try {\n resolve(this._iModel.getSchemaProps(schemaKey.name) as SchemaProps);\n }\n catch (error: any) {\n reject(error as Error);\n }\n }, 0));\n }\n\n /**\n * Executes an ECSql query against the IModelDb.\n * @param query The query to execute\n * @param options The [[ECSqlQueryOptions]]($ecschema-metadata) to use.\n * @returns A promise that resolves to read-only array of type TRow.\n */\n protected async executeQuery<TRow>(query: string, options?: ECSqlQueryOptions): Promise<ReadonlyArray<TRow>> {\n const queryParameters = options && options.parameters ? QueryBinder.from(options.parameters) : undefined;\n\n return this._iModel\n .createQueryReader(query, queryParameters, {\n rowFormat: QueryRowFormat.UseECSqlPropertyNames,\n limit: { count: options?.limit },\n })\n .toArray();\n }\n}"]}
1
+ {"version":3,"file":"IModelIncrementalSchemaLocater.js","sourceRoot":"","sources":["../../src/IModelIncrementalSchemaLocater.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,EAAqB,kBAAkB,EAAqD,MAAM,0BAA0B,CAAC;AACpI,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGjE;;;GAGG;AACH,MAAM,OAAO,8BAA+B,SAAQ,kBAAkB;IACnD,OAAO,CAAW;IAEnC;;;;OAIG;IACH,YAAY,MAAgB,EAAE,OAAmC;QAC/D,KAAK,CAAC,OAAO,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,cAAc,CAAC,SAAoB;QACjD,iFAAiF;QACjF,iFAAiF;QACjF,eAAe;QACf,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE;YACtD,IAAI,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAgB,CAAC,CAAC;YACtE,CAAC;YACD,OAAO,KAAU,EAAE,CAAC;gBAClB,MAAM,CAAC,KAAc,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACT,CAAC;IAED;;;;;OAKG;IACO,KAAK,CAAC,YAAY,CAAO,KAAa,EAAE,OAA2B;QAC3E,MAAM,eAAe,GAAG,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEzG,OAAO,IAAI,CAAC,OAAO;aAChB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE;YACzC,SAAS,EAAE,cAAc,CAAC,qBAAqB;YAC/C,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;SACjC,CAAC;aACD,OAAO,EAAE,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\nimport { ECSqlQueryOptions, ECSqlSchemaLocater, ECSqlSchemaLocaterOptions, SchemaKey, SchemaProps } from \"@itwin/ecschema-metadata\";\r\nimport { QueryBinder, QueryRowFormat } from \"@itwin/core-common\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\n/**\r\n * A [[ECSqlSchemaLocater]]($ecschema-metadata) implementation that uses the [[IModelDb]] to load schemas incrementally.\r\n * @beta\r\n */\r\nexport class IModelIncrementalSchemaLocater extends ECSqlSchemaLocater {\r\n private readonly _iModel: IModelDb;\r\n\r\n /**\r\n * Constructs a new IModelIncrementalSchemaLocater instance.\r\n * @param iModel The [[IModelDb]] to query.\r\n * @param options Optional [[ECSqlSchemaLocaterOptions]]($ecschema-metadata).\r\n */\r\n constructor(iModel: IModelDb, options?: ECSqlSchemaLocaterOptions) {\r\n super(options ?? { useMultipleQueries: true });\r\n this._iModel = iModel;\r\n }\r\n\r\n /**\r\n * Gets [[SchemaProps]]($ecschema-metadata) for the given [[SchemaKey]]($ecschema-metadata).\r\n * This is the full schema json with all elements that are defined in the schema.\r\n * @param schemaKey The key of the schema to be resolved.\r\n */\r\n protected async getSchemaProps(schemaKey: SchemaKey): Promise<SchemaProps | undefined> {\r\n // To keep the main thread from being blocked in sync loading cases the resolving\r\n // is triggered through a timeout. Even if there is no delay, it improves loading\r\n // time by ~3x.\r\n return new Promise((resolve, reject) => setTimeout(() => {\r\n try {\r\n resolve(this._iModel.getSchemaProps(schemaKey.name) as SchemaProps);\r\n }\r\n catch (error: any) {\r\n reject(error as Error);\r\n }\r\n }, 0));\r\n }\r\n\r\n /**\r\n * Executes an ECSql query against the IModelDb.\r\n * @param query The query to execute\r\n * @param options The [[ECSqlQueryOptions]]($ecschema-metadata) to use.\r\n * @returns A promise that resolves to read-only array of type TRow.\r\n */\r\n protected async executeQuery<TRow>(query: string, options?: ECSqlQueryOptions): Promise<ReadonlyArray<TRow>> {\r\n const queryParameters = options && options.parameters ? QueryBinder.from(options.parameters) : undefined;\r\n\r\n return this._iModel\r\n .createQueryReader(query, queryParameters, {\r\n rowFormat: QueryRowFormat.UseECSqlPropertyNames,\r\n limit: { count: options?.limit },\r\n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AK,EAAE,CAAC;gBACV,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAClC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF","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\n/** @packageDocumentation\n * @module Portability\n */\n\n// cspell: ignore wflag\n\nimport * as fs from \"fs-extra\";\nimport * as path from \"path\";\n\n/* TODO: define File Mode Constants: S_IWUSR, et al. */\n/** Information about a file. See [[IModelJsFs.lstatSync]]\n * @public\n */\nexport class IModelJsFsStats {\n constructor(\n public size: number,\n public atimeMs: number,\n public mtimeMs: number,\n public birthtimeMs: number,\n public isDirectory: boolean,\n public isFile: boolean,\n public isSocket: boolean,\n public isSymbolicLink: boolean,\n public isReadOnly: boolean,\n ) { }\n}\n\n/** File system operations that are defined on all platforms. See also [[Platform]] and [[KnownLocations]]\n * @public\n */\nexport class IModelJsFs {\n\n /** Does file or directory exist? */\n public static existsSync(pathname: string): boolean { return fs.existsSync(pathname); }\n\n /** Delete a file. */\n public static unlinkSync(pathname: string): void { fs.unlinkSync(pathname); }\n\n /** Delete a file or remove a directory (rm -r). */\n public static removeSync(pathname: string): void { fs.removeSync(pathname); }\n\n /** Create a directory. */\n public static mkdirSync(pathname: string): void { fs.mkdirSync(pathname); }\n\n /** Remove a directory. */\n public static rmdirSync(pathname: string): void { fs.rmdirSync(pathname); }\n\n /** Write to a file. */\n public static writeFileSync(pathname: string, data: string | Uint8Array, wflag: string = \"w\"): void { fs.writeFileSync(pathname, data, { flag: wflag }); }\n\n /** Append to a file. */\n public static appendFileSync(pathname: string, str: string): void { fs.appendFileSync(pathname, str); }\n\n /** Make a copy of a file */\n public static copySync(src: string, dest: string, opts?: any): void { fs.copySync(src, dest, opts); }\n\n /** Gets the file and directory names in the specified directory. Excludes \".\" and \"..\". Returns an empty array if the specified directory does not exist. */\n public static readdirSync(pathname: string): string[] { return fs.existsSync(pathname) ? fs.readdirSync(pathname) : []; }\n\n /** Read file */\n public static readFileSync(pathname: string): string | Buffer { return fs.readFileSync(pathname); }\n\n /** Test if the current user has permission to write to a file. */\n private static isFileWritable(pathname: string): boolean {\n try {\n fs.accessSync(pathname, fs.constants.W_OK);\n return true;\n } catch {\n return false;\n }\n }\n\n /** Get information about a file. */\n public static lstatSync(pathname: string): IModelJsFsStats | undefined {\n const stats = fs.lstatSync(pathname);\n if (stats === undefined)\n return undefined;\n\n return new IModelJsFsStats(\n stats.size,\n stats.atime.getTime(),\n stats.mtime.getTime(),\n stats.birthtime.getTime(),\n stats.isDirectory(),\n stats.isFile(),\n stats.isSocket(),\n stats.isSymbolicLink(),\n !IModelJsFs.isFileWritable(pathname));\n }\n\n /**\n * Finds files recursively based on a pattern\n * @param rootDir Directory from where to start searching for files.\n * @param pattern A Regex that would be match to basename of files including extension\n * @returns list of file that match the pattern.\n */\n public static recursiveFindSync(rootDir: string, pattern: RegExp): string[] {\n const files: string[] = [];\n IModelJsFs.walkDirSync(rootDir, (pathname: string, isDir: boolean) => {\n if (!isDir) {\n const fileName = path.basename(pathname);\n if (pattern.test(fileName)) {\n files.push(pathname);\n }\n }\n return true;\n });\n return files;\n }\n\n /**\n * Walks a directory in breadth first fashion\n * @param rootDir directory from where the traversal starts\n * @param cb callback that would be called with full path of file or directory\n */\n public static walkDirSync(rootDir: string, cb: (pathname: string, isDir: boolean) => boolean): void {\n const subDir = [];\n for (const childPath of IModelJsFs.readdirSync(rootDir)) {\n const fullPath = path.join(rootDir, childPath);\n const isDir = IModelJsFs.lstatSync(fullPath)?.isDirectory;\n if (!cb(fullPath, isDir ?? false)) {\n return;\n }\n // Need to check if the directory still exists in case the callback has deleted it.\n if (isDir && IModelJsFs.existsSync(fullPath)) {\n subDir.push(fullPath);\n }\n }\n subDir.forEach((v) => {\n IModelJsFs.walkDirSync(v, cb);\n });\n }\n\n /** Create a directory, recursively setting up the path as necessary */\n public static recursiveMkDirSync(dirPath: string) {\n if (IModelJsFs.existsSync(dirPath))\n return;\n const parentPath = path.dirname(dirPath);\n if (parentPath !== dirPath)\n IModelJsFs.recursiveMkDirSync(parentPath);\n try {\n IModelJsFs.mkdirSync(dirPath);\n } catch (err: any) {\n // Ignore the error if the folder has been created since the existence check\n if (err?.code !== \"EEXIST\")\n throw err;\n }\n }\n\n /** Remove a directory, recursively */\n public static purgeDirSync(dirPath: string) {\n if (!IModelJsFs.existsSync(dirPath))\n return;\n\n IModelJsFs.walkDirSync(dirPath, (pathName: string, isDir: boolean) => {\n if (isDir) {\n IModelJsFs.purgeDirSync(pathName);\n IModelJsFs.removeSync(pathName);\n } else {\n IModelJsFs.unlinkSync(pathName);\n }\n return true;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"IModelJsFs.js","sourceRoot":"","sources":["../../src/IModelJsFs.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,uBAAuB;AAEvB,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,uDAAuD;AACvD;;GAEG;AACH,MAAM,OAAO,eAAe;IAEjB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IATT,YACS,IAAY,EACZ,OAAe,EACf,OAAe,EACf,WAAmB,EACnB,WAAoB,EACpB,MAAe,EACf,QAAiB,EACjB,cAAuB,EACvB,UAAmB;QARnB,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAAQ;QACf,gBAAW,GAAX,WAAW,CAAQ;QACnB,gBAAW,GAAX,WAAW,CAAS;QACpB,WAA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U,CAAC,OAAO,CAAC;YAChC,OAAO;QACT,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,UAAU,KAAK,OAAO;YACxB,UAAU,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,CAAC;YACH,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,4EAA4E;YAC5E,IAAI,GAAG,EAAE,IAAI,KAAK,QAAQ;gBACxB,MAAM,GAAG,CAAC;QACd,CAAC;IACH,CAAC;IAED,sCAAsC;IAC/B,MAAM,CAAC,YAAY,CAAC,OAAe;QACxC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC;YACjC,OAAO;QAET,UAAU,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,QAAgB,EAAE,KAAc,EAAE,EAAE;YACnE,IAAI,KAAK,EAAE,CAAC;gBACV,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAClC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Portability\r\n */\r\n\r\n// cspell: ignore wflag\r\n\r\nimport * as fs from \"fs-extra\";\r\nimport * as path from \"path\";\r\n\r\n/* TODO: define File Mode Constants: S_IWUSR, et al. */\r\n/** Information about a file. See [[IModelJsFs.lstatSync]]\r\n * @public\r\n */\r\nexport class IModelJsFsStats {\r\n constructor(\r\n public size: number,\r\n public atimeMs: number,\r\n public mtimeMs: number,\r\n public birthtimeMs: number,\r\n public isDirectory: boolean,\r\n public isFile: boolean,\r\n public isSocket: boolean,\r\n public isSymbolicLink: boolean,\r\n public isReadOnly: boolean,\r\n ) { }\r\n}\r\n\r\n/** File system operations that are defined on all platforms. See also [[Platform]] and [[KnownLocations]]\r\n * @public\r\n */\r\nexport class IModelJsFs {\r\n\r\n /** Does file or directory exist? */\r\n public static existsSync(pathname: string): boolean { return fs.existsSync(pathname); }\r\n\r\n /** Delete a file. */\r\n public static unlinkSync(pathname: string): void { fs.unlinkSync(pathname); }\r\n\r\n /** Delete a file or remove a directory (rm -r). */\r\n public static removeSync(pathname: string): void { fs.removeSync(pathname); }\r\n\r\n /** Create a directory. */\r\n public static mkdirSync(pathname: string): void { fs.mkdirSync(pathname); }\r\n\r\n /** Remove a directory. */\r\n public static rmdirSync(pathname: string): void { fs.rmdirSync(pathname); }\r\n\r\n /** Write to a file. */\r\n public static writeFileSync(pathname: string, data: string | Uint8Array, wflag: string = \"w\"): void { fs.writeFileSync(pathname, data, { flag: wflag }); }\r\n\r\n /** Append to a file. */\r\n public static appendFileSync(pathname: string, str: string): void { fs.appendFileSync(pathname, str); }\r\n\r\n /** Make a copy of a file */\r\n public static copySync(src: string, dest: string, opts?: any): void { fs.copySync(src, dest, opts); }\r\n\r\n /** Gets the file and directory names in the specified directory. Excludes \".\" and \"..\". Returns an empty array if the specified directory does not exist. */\r\n public static readdirSync(pathname: string): string[] { return fs.existsSync(pathname) ? fs.readdirSync(pathname) : []; }\r\n\r\n /** Read file */\r\n public static readFileSync(pathname: string): string | Buffer { return fs.readFileSync(pathname); }\r\n\r\n /** Test if the current user has permission to write to a file. */\r\n private static isFileWritable(pathname: string): boolean {\r\n try {\r\n fs.accessSync(pathname, fs.constants.W_OK);\r\n return true;\r\n } catch {\r\n return false;\r\n }\r\n }\r\n\r\n /** Get information about a file. */\r\n public static lstatSync(pathname: string): IModelJsFsStats | undefined {\r\n const stats = fs.lstatSync(pathname);\r\n if (stats === undefined)\r\n return undefined;\r\n\r\n return new IModelJsFsStats(\r\n stats.size,\r\n stats.atime.getTime(),\r\n stats.mtime.getTime(),\r\n stats.birthtime.getTime(),\r\n stats.isDirectory(),\r\n stats.isFile(),\r\n stats.isSocket(),\r\n stats.isSymbolicLink(),\r\n !IModelJsFs.isFileWritable(pathname));\r\n }\r\n\r\n /**\r\n * Finds files recursively based on a pattern\r\n * @param rootDir Directory from where to start searching for files.\r\n * @param pattern A Regex that would be match to basename of files including extension\r\n * @returns list of file that match the pattern.\r\n */\r\n public static recursiveFindSync(rootDir: string, pattern: RegExp): string[] {\r\n const files: string[] = [];\r\n IModelJsFs.walkDirSync(rootDir, (pathname: string, isDir: boolean) => {\r\n if (!isDir) {\r\n const fileName = path.basename(pathname);\r\n if (pattern.test(fileName)) {\r\n files.push(pathname);\r\n }\r\n }\r\n return true;\r\n });\r\n return files;\r\n }\r\n\r\n /**\r\n * Walks a directory in breadth first fashion\r\n * @param rootDir directory from where the traversal starts\r\n * @param cb callback that would be called with full path of file or directory\r\n */\r\n public static walkDirSync(rootDir: string, cb: (pathname: string, isDir: boolean) => boolean): void {\r\n const subDir = [];\r\n for (const childPath of IModelJsFs.readdirSync(rootDir)) {\r\n const fullPath = path.join(rootDir, childPath);\r\n const isDir = IModelJsFs.lstatSync(fullPath)?.isDirectory;\r\n if (!cb(fullPath, isDir ?? false)) {\r\n return;\r\n }\r\n // Need to check if the directory still exists in case the callback has deleted it.\r\n if (isDir && IModelJsFs.existsSync(fullPath)) {\r\n subDir.push(fullPath);\r\n }\r\n }\r\n subDir.forEach((v) => {\r\n IModelJsFs.walkDirSync(v, cb);\r\n });\r\n }\r\n\r\n /** Create a directory, recursively setting up the path as necessary */\r\n public static recursiveMkDirSync(dirPath: string) {\r\n if (IModelJsFs.existsSync(dirPath))\r\n return;\r\n const parentPath = path.dirname(dirPath);\r\n if (parentPath !== dirPath)\r\n IModelJsFs.recursiveMkDirSync(parentPath);\r\n try {\r\n IModelJsFs.mkdirSync(dirPath);\r\n } catch (err: any) {\r\n // Ignore the error if the folder has been created since the existence check\r\n if (err?.code !== \"EEXIST\")\r\n throw err;\r\n }\r\n }\r\n\r\n /** Remove a directory, recursively */\r\n public static purgeDirSync(dirPath: string) {\r\n if (!IModelJsFs.existsSync(dirPath))\r\n return;\r\n\r\n IModelJsFs.walkDirSync(dirPath, (pathName: string, isDir: boolean) => {\r\n if (isDir) {\r\n IModelJsFs.purgeDirSync(pathName);\r\n IModelJsFs.removeSync(pathName);\r\n } else {\r\n IModelJsFs.unlinkSync(pathName);\r\n }\r\n return true;\r\n });\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ImageSourceConversion.js","sourceRoot":"","sources":["../../src/ImageSourceConversion.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAqB,WAAW,EAAE,iBAAiB,EAAqB,MAAM,oBAAoB,CAAC;AAC1G,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAczD;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAoC;IAC7E,MAAM,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,0BAA0B,CAC1D,IAAI,CAAC,MAAM,CAAC,MAAM,EAClB,IAAI,CAAC,MAAM,CAAC,IAAI,EAChB,IAAI,CAAC,YAAY,IAAI,GAAG,EACxB,KAAK,CACN,CAAC;IAEF,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;AAC7D,CAAC;AAwBD;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAoC;IAC7E,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IAED,OAAO,YAAY,CAAC,QAAQ,CAAC,0BAA0B,CACrD,IAAI,CAAC,KAAK,CAAC,MAAM,EACjB,IAAI,CAAC,KAAK,CAAC,IAAI,EACf,IAAI,CAAC,KAAK,CAAC,KAAK,EAChB,IAAI,CAAC,KAAK,CAAC,MAAM,EACjB,IAAI,CAAC,YAAY,IAAI,GAAG,EACxB,IAAI,CAAC,cAAc,IAAI,KAAK,EAC5B,IAAI,CAAC,WAAW,IAAI,GAAG,CACxB,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Images\n */\n\nimport { BinaryImageSource, ImageBuffer, ImageBufferFormat, ImageSourceFormat } from \"@itwin/core-common\";\nimport { IModelNative } from \"./internal/NativePlatform\";\n\n/** Arguments supplied to [[imageBufferFromImageSource]].\n * @public\n */\nexport interface ImageBufferFromImageSourceArgs {\n /** The encoded image to be decoded into an [ImageBuffer]($common). */\n source: BinaryImageSource;\n /** The desired format for the decoded [ImageBuffer]($common).\n * If unspecified, it defaults to [ImageBufferFormat.Rgb]($common) unless an alpha channel is present in [[source]].\n */\n targetFormat?: ImageBufferFormat.Rgb | ImageBufferFormat.Rgba;\n}\n\n/** Decode a [BinaryImageSource]($common) into an [ImageBuffer]($common).\n * Returns `undefined` if decoding fails, typically because the input was invalid.\n * @see [[imageSourceFromImageBuffer]] for the inverse conversion.\n * @public\n */\nexport function imageBufferFromImageSource(args: ImageBufferFromImageSourceArgs): ImageBuffer | undefined {\n const ret = IModelNative.platform.imageBufferFromImageSource(\n args.source.format,\n args.source.data,\n args.targetFormat ?? 255,\n false\n );\n\n if (!ret) {\n return undefined;\n }\n\n return ImageBuffer.create(ret.data, ret.format, ret.width);\n}\n\n/** Arguments supplied to [[imageSourceFromImageBuffer]].\n * @public\n */\nexport interface ImageSourceFromImageBufferArgs {\n /** The image to be encoded.\n * The image must be in [ImageBufferFormat.Rgb]($common) or [ImageBufferFormat.Rgba]($common) - [ImageBufferFormat.Alpha]($common) cannot be converted to an [ImageSource]($common).\n */\n image: ImageBuffer;\n /** The desired encoding for the resultant [BinaryImageSource]($common).\n * Defaults to [ImageSourceFormat.Jpeg]($common) unless an alpha channel is present in [[image]].\n */\n targetFormat?: ImageSourceFormat.Png | ImageSourceFormat.Jpeg;\n /** If true, invert the order of the rows of the encoded image. */\n flipVertically?: boolean;\n /** If [[targetFormat]] is (or defaults to) [ImageSourceFormat.Jpeg]($common), an integer between 0 and 100 indicating\n * the desired trade-off between image compression and image fidelity. This is a scale where 0 sacrifices image quality\n * in favor of minimizing the size of the encoded image, and 100 minimizes compression artifacts at the expense of size.\n * Default: 100.\n */\n jpegQuality?: number;\n}\n\n/** Encode an [ImageBuffer]($common) into a [BinaryImageSource]($common).\n * Returns `undefined` if encoding fails, typically because the input was invalid.\n * @throws Error if the ImageBuffer is of [ImageBufferFormat.Alpha]($common).\n * @public\n */\nexport function imageSourceFromImageBuffer(args: ImageSourceFromImageBufferArgs): BinaryImageSource | undefined {\n if (args.image.format === ImageBufferFormat.Alpha) {\n throw new Error(\"imageSourceFromImageBuffer cannot be used with alpha-only images\");\n }\n\n return IModelNative.platform.imageSourceFromImageBuffer(\n args.image.format,\n args.image.data,\n args.image.width,\n args.image.height,\n args.targetFormat ?? 255,\n args.flipVertically ?? false,\n args.jpegQuality ?? 100\n );\n}\n"]}
1
+ {"version":3,"file":"ImageSourceConversion.js","sourceRoot":"","sources":["../../src/ImageSourceConversion.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAqB,WAAW,EAAE,iBAAiB,EAAqB,MAAM,oBAAoB,CAAC;AAC1G,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAczD;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAoC;IAC7E,MAAM,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,0BAA0B,CAC1D,IAAI,CAAC,MAAM,CAAC,MAAM,EAClB,IAAI,CAAC,MAAM,CAAC,IAAI,EAChB,IAAI,CAAC,YAAY,IAAI,GAAG,EACxB,KAAK,CACN,CAAC;IAEF,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;AAC7D,CAAC;AAwBD;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAoC;IAC7E,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IAED,OAAO,YAAY,CAAC,QAAQ,CAAC,0BAA0B,CACrD,IAAI,CAAC,KAAK,CAAC,MAAM,EACjB,IAAI,CAAC,KAAK,CAAC,IAAI,EACf,IAAI,CAAC,KAAK,CAAC,KAAK,EAChB,IAAI,CAAC,KAAK,CAAC,MAAM,EACjB,IAAI,CAAC,YAAY,IAAI,GAAG,EACxB,IAAI,CAAC,cAAc,IAAI,KAAK,EAC5B,IAAI,CAAC,WAAW,IAAI,GAAG,CACxB,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Images\r\n */\r\n\r\nimport { BinaryImageSource, ImageBuffer, ImageBufferFormat, ImageSourceFormat } from \"@itwin/core-common\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\n\r\n/** Arguments supplied to [[imageBufferFromImageSource]].\r\n * @public\r\n */\r\nexport interface ImageBufferFromImageSourceArgs {\r\n /** The encoded image to be decoded into an [ImageBuffer]($common). */\r\n source: BinaryImageSource;\r\n /** The desired format for the decoded [ImageBuffer]($common).\r\n * If unspecified, it defaults to [ImageBufferFormat.Rgb]($common) unless an alpha channel is present in [[source]].\r\n */\r\n targetFormat?: ImageBufferFormat.Rgb | ImageBufferFormat.Rgba;\r\n}\r\n\r\n/** Decode a [BinaryImageSource]($common) into an [ImageBuffer]($common).\r\n * Returns `undefined` if decoding fails, typically because the input was invalid.\r\n * @see [[imageSourceFromImageBuffer]] for the inverse conversion.\r\n * @public\r\n */\r\nexport function imageBufferFromImageSource(args: ImageBufferFromImageSourceArgs): ImageBuffer | undefined {\r\n const ret = IModelNative.platform.imageBufferFromImageSource(\r\n args.source.format,\r\n args.source.data,\r\n args.targetFormat ?? 255,\r\n false\r\n );\r\n\r\n if (!ret) {\r\n return undefined;\r\n }\r\n\r\n return ImageBuffer.create(ret.data, ret.format, ret.width);\r\n}\r\n\r\n/** Arguments supplied to [[imageSourceFromImageBuffer]].\r\n * @public\r\n */\r\nexport interface ImageSourceFromImageBufferArgs {\r\n /** The image to be encoded.\r\n * The image must be in [ImageBufferFormat.Rgb]($common) or [ImageBufferFormat.Rgba]($common) - [ImageBufferFormat.Alpha]($common) cannot be converted to an [ImageSource]($common).\r\n */\r\n image: ImageBuffer;\r\n /** The desired encoding for the resultant [BinaryImageSource]($common).\r\n * Defaults to [ImageSourceFormat.Jpeg]($common) unless an alpha channel is present in [[image]].\r\n */\r\n targetFormat?: ImageSourceFormat.Png | ImageSourceFormat.Jpeg;\r\n /** If true, invert the order of the rows of the encoded image. */\r\n flipVertically?: boolean;\r\n /** If [[targetFormat]] is (or defaults to) [ImageSourceFormat.Jpeg]($common), an integer between 0 and 100 indicating\r\n * the desired trade-off between image compression and image fidelity. This is a scale where 0 sacrifices image quality\r\n * in favor of minimizing the size of the encoded image, and 100 minimizes compression artifacts at the expense of size.\r\n * Default: 100.\r\n */\r\n jpegQuality?: number;\r\n}\r\n\r\n/** Encode an [ImageBuffer]($common) into a [BinaryImageSource]($common).\r\n * Returns `undefined` if encoding fails, typically because the input was invalid.\r\n * @throws Error if the ImageBuffer is of [ImageBufferFormat.Alpha]($common).\r\n * @public\r\n */\r\nexport function imageSourceFromImageBuffer(args: ImageSourceFromImageBufferArgs): BinaryImageSource | undefined {\r\n if (args.image.format === ImageBufferFormat.Alpha) {\r\n throw new Error(\"imageSourceFromImageBuffer cannot be used with alpha-only images\");\r\n }\r\n\r\n return IModelNative.platform.imageSourceFromImageBuffer(\r\n args.image.format,\r\n args.image.data,\r\n args.image.width,\r\n args.image.height,\r\n args.targetFormat ?? 255,\r\n args.flipVertically ?? false,\r\n args.jpegQuality ?? 100\r\n );\r\n}\r\n"]}