@itwin/core-backend 5.5.0-dev.2 → 5.5.0-dev.5

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 (398) hide show
  1. package/CHANGELOG.md +19 -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.js +8 -8
  42. package/lib/cjs/IModelDb.js.map +1 -1
  43. package/lib/cjs/IModelDbFonts.js.map +1 -1
  44. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  45. package/lib/cjs/IModelHost.js.map +1 -1
  46. package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
  47. package/lib/cjs/IModelJsFs.js.map +1 -1
  48. package/lib/cjs/ImageSourceConversion.js.map +1 -1
  49. package/lib/cjs/IpcHost.js.map +1 -1
  50. package/lib/cjs/LineStyle.js.map +1 -1
  51. package/lib/cjs/LocalHub.js +1 -1
  52. package/lib/cjs/LocalHub.js.map +1 -1
  53. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  54. package/lib/cjs/LockControl.js.map +1 -1
  55. package/lib/cjs/Material.js.map +1 -1
  56. package/lib/cjs/Model.js.map +1 -1
  57. package/lib/cjs/NativeAppStorage.js.map +1 -1
  58. package/lib/cjs/NativeHost.js.map +1 -1
  59. package/lib/cjs/NavigationRelationship.js.map +1 -1
  60. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  61. package/lib/cjs/PropertyStore.js.map +1 -1
  62. package/lib/cjs/Relationship.js.map +1 -1
  63. package/lib/cjs/RpcBackend.js.map +1 -1
  64. package/lib/cjs/SQLiteDb.js.map +1 -1
  65. package/lib/cjs/Schema.js.map +1 -1
  66. package/lib/cjs/SchemaSync.js.map +1 -1
  67. package/lib/cjs/SchemaUtils.js.map +1 -1
  68. package/lib/cjs/SheetIndex.js.map +1 -1
  69. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  70. package/lib/cjs/SqliteStatement.js.map +1 -1
  71. package/lib/cjs/StashManager.js.map +1 -1
  72. package/lib/cjs/Texture.js.map +1 -1
  73. package/lib/cjs/TileStorage.js.map +1 -1
  74. package/lib/cjs/TxnManager.js.map +1 -1
  75. package/lib/cjs/ViewDefinition.js.map +1 -1
  76. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  77. package/lib/cjs/ViewStore.js.map +1 -1
  78. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  79. package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
  80. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
  81. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  82. package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
  83. package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
  84. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
  85. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  86. package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
  87. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
  88. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
  89. package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
  90. package/lib/cjs/core-backend.js.map +1 -1
  91. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  92. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  93. package/lib/cjs/domains/GenericElements.js.map +1 -1
  94. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  95. package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
  96. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  97. package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
  98. package/lib/cjs/internal/FontFileImpl.js.map +1 -1
  99. package/lib/cjs/internal/HubMock.js.map +1 -1
  100. package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
  101. package/lib/cjs/internal/NativePlatform.js.map +1 -1
  102. package/lib/cjs/internal/NoLocks.js.map +1 -1
  103. package/lib/cjs/internal/OnlineStatus.js.map +1 -1
  104. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
  105. package/lib/cjs/internal/Symbols.js.map +1 -1
  106. package/lib/cjs/internal/annotations/fields.js.map +1 -1
  107. package/lib/cjs/internal/cross-package.js.map +1 -1
  108. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
  109. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  110. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  111. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  112. package/lib/cjs/rpc/multipart.js.map +1 -1
  113. package/lib/cjs/rpc/tracing.js.map +1 -1
  114. package/lib/cjs/rpc/web/logging.js.map +1 -1
  115. package/lib/cjs/rpc/web/request.js.map +1 -1
  116. package/lib/cjs/rpc/web/response.js.map +1 -1
  117. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  118. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  119. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  120. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  121. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  122. package/lib/cjs/workspace/Settings.js.map +1 -1
  123. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  124. package/lib/cjs/workspace/Workspace.js.map +1 -1
  125. package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
  126. package/lib/esm/BackendHubAccess.js.map +1 -1
  127. package/lib/esm/BackendLoggerCategory.js.map +1 -1
  128. package/lib/esm/BisCoreSchema.js.map +1 -1
  129. package/lib/esm/BlobContainerService.js.map +1 -1
  130. package/lib/esm/BriefcaseManager.js.map +1 -1
  131. package/lib/esm/CatalogDb.js.map +1 -1
  132. package/lib/esm/Category.js.map +1 -1
  133. package/lib/esm/ChangeSummaryManager.js +2 -2
  134. package/lib/esm/ChangeSummaryManager.js.map +1 -1
  135. package/lib/esm/ChangedElementsDb.js.map +1 -1
  136. package/lib/esm/ChangesetECAdaptor.js +248 -248
  137. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  138. package/lib/esm/ChannelControl.js.map +1 -1
  139. package/lib/esm/CheckpointManager.js.map +1 -1
  140. package/lib/esm/ClassRegistry.js +5 -5
  141. package/lib/esm/ClassRegistry.js.map +1 -1
  142. package/lib/esm/CloudSqlite.js.map +1 -1
  143. package/lib/esm/CodeService.js.map +1 -1
  144. package/lib/esm/CodeSpecs.js.map +1 -1
  145. package/lib/esm/ConcurrentQuery.js.map +1 -1
  146. package/lib/esm/CustomViewState3dCreator.js.map +1 -1
  147. package/lib/esm/DevTools.js.map +1 -1
  148. package/lib/esm/DisplayStyle.js.map +1 -1
  149. package/lib/esm/ECDb.js.map +1 -1
  150. package/lib/esm/ECSchemaXmlContext.js.map +1 -1
  151. package/lib/esm/ECSqlStatement.js.map +1 -1
  152. package/lib/esm/Element.js.map +1 -1
  153. package/lib/esm/ElementAspect.js.map +1 -1
  154. package/lib/esm/ElementGraphics.js.map +1 -1
  155. package/lib/esm/ElementTreeWalker.js.map +1 -1
  156. package/lib/esm/Entity.js.map +1 -1
  157. package/lib/esm/EntityReferences.js.map +1 -1
  158. package/lib/esm/ExportGraphics.js.map +1 -1
  159. package/lib/esm/ExternalSource.js.map +1 -1
  160. package/lib/esm/FontFile.js.map +1 -1
  161. package/lib/esm/GeoCoordConfig.js.map +1 -1
  162. package/lib/esm/GeographicCRSServices.js.map +1 -1
  163. package/lib/esm/GeometrySummary.js +47 -47
  164. package/lib/esm/GeometrySummary.js.map +1 -1
  165. package/lib/esm/IModelDb.js +8 -8
  166. package/lib/esm/IModelDb.js.map +1 -1
  167. package/lib/esm/IModelDbFonts.js.map +1 -1
  168. package/lib/esm/IModelElementCloneContext.js.map +1 -1
  169. package/lib/esm/IModelHost.js.map +1 -1
  170. package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
  171. package/lib/esm/IModelJsFs.js.map +1 -1
  172. package/lib/esm/ImageSourceConversion.js.map +1 -1
  173. package/lib/esm/IpcHost.js.map +1 -1
  174. package/lib/esm/LineStyle.js.map +1 -1
  175. package/lib/esm/LocalHub.js +1 -1
  176. package/lib/esm/LocalHub.js.map +1 -1
  177. package/lib/esm/LocalhostIpcHost.js.map +1 -1
  178. package/lib/esm/LockControl.js.map +1 -1
  179. package/lib/esm/Material.js.map +1 -1
  180. package/lib/esm/Model.js.map +1 -1
  181. package/lib/esm/NativeAppStorage.js.map +1 -1
  182. package/lib/esm/NativeHost.js.map +1 -1
  183. package/lib/esm/NavigationRelationship.js.map +1 -1
  184. package/lib/esm/PromiseMemoizer.js.map +1 -1
  185. package/lib/esm/PropertyStore.js.map +1 -1
  186. package/lib/esm/Relationship.js.map +1 -1
  187. package/lib/esm/RpcBackend.js.map +1 -1
  188. package/lib/esm/SQLiteDb.js.map +1 -1
  189. package/lib/esm/Schema.js.map +1 -1
  190. package/lib/esm/SchemaSync.js.map +1 -1
  191. package/lib/esm/SchemaUtils.js.map +1 -1
  192. package/lib/esm/SheetIndex.js.map +1 -1
  193. package/lib/esm/SqliteChangesetReader.js.map +1 -1
  194. package/lib/esm/SqliteStatement.js.map +1 -1
  195. package/lib/esm/StashManager.js.map +1 -1
  196. package/lib/esm/Texture.js.map +1 -1
  197. package/lib/esm/TileStorage.js.map +1 -1
  198. package/lib/esm/TxnManager.js.map +1 -1
  199. package/lib/esm/ViewDefinition.js.map +1 -1
  200. package/lib/esm/ViewStateHydrator.js.map +1 -1
  201. package/lib/esm/ViewStore.js.map +1 -1
  202. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  203. package/lib/esm/annotations/FrameGeometry.js.map +1 -1
  204. package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
  205. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  206. package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
  207. package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
  208. package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
  209. package/lib/esm/core-backend.js.map +1 -1
  210. package/lib/esm/domains/FunctionalElements.js.map +1 -1
  211. package/lib/esm/domains/FunctionalSchema.js.map +1 -1
  212. package/lib/esm/domains/GenericElements.js.map +1 -1
  213. package/lib/esm/domains/GenericSchema.js.map +1 -1
  214. package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
  215. package/lib/esm/internal/ChannelAdmin.js.map +1 -1
  216. package/lib/esm/internal/ElementLRUCache.js.map +1 -1
  217. package/lib/esm/internal/FontFileImpl.js.map +1 -1
  218. package/lib/esm/internal/HubMock.js.map +1 -1
  219. package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
  220. package/lib/esm/internal/NativePlatform.js.map +1 -1
  221. package/lib/esm/internal/NoLocks.js.map +1 -1
  222. package/lib/esm/internal/OnlineStatus.js.map +1 -1
  223. package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
  224. package/lib/esm/internal/Symbols.js.map +1 -1
  225. package/lib/esm/internal/annotations/fields.js.map +1 -1
  226. package/lib/esm/internal/cross-package.js.map +1 -1
  227. package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
  228. package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  229. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  230. package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  231. package/lib/esm/rpc/multipart.js.map +1 -1
  232. package/lib/esm/rpc/tracing.js.map +1 -1
  233. package/lib/esm/rpc/web/logging.js.map +1 -1
  234. package/lib/esm/rpc/web/request.js.map +1 -1
  235. package/lib/esm/rpc/web/response.js.map +1 -1
  236. package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  237. package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  238. package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  239. package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  240. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  241. package/lib/esm/test/AdvancedEqual.js.map +1 -1
  242. package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
  243. package/lib/esm/test/AttachDb.test.js +11 -11
  244. package/lib/esm/test/AttachDb.test.js.map +1 -1
  245. package/lib/esm/test/ElementDrivesElement.test.js +23 -23
  246. package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
  247. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  248. package/lib/esm/test/GeometryTestUtil.js.map +1 -1
  249. package/lib/esm/test/IModelHost.test.js.map +1 -1
  250. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  251. package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
  252. package/lib/esm/test/IpcHost.test.js.map +1 -1
  253. package/lib/esm/test/KnownTestLocations.js.map +1 -1
  254. package/lib/esm/test/PrintElementTree.js.map +1 -1
  255. package/lib/esm/test/PropertyDb.test.js.map +1 -1
  256. package/lib/esm/test/RevisionUtility.js.map +1 -1
  257. package/lib/esm/test/SchemaUtils.test.js +25 -25
  258. package/lib/esm/test/SchemaUtils.test.js.map +1 -1
  259. package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
  260. package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
  261. package/lib/esm/test/TestUtils.js.map +1 -1
  262. package/lib/esm/test/annotations/Fields.test.js +53 -53
  263. package/lib/esm/test/annotations/Fields.test.js.map +1 -1
  264. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
  265. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  266. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  267. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
  268. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
  269. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js +5 -5
  270. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
  271. package/lib/esm/test/categories/Category.test.js.map +1 -1
  272. package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
  273. package/lib/esm/test/ecdb/CTE.test.js +88 -88
  274. package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
  275. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +15 -15
  276. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
  277. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
  278. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
  279. package/lib/esm/test/ecdb/ECDb.test.js +72 -72
  280. package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
  281. package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
  282. package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
  283. package/lib/esm/test/ecdb/ECSqlAst.test.js +65 -65
  284. package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
  285. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  286. package/lib/esm/test/ecdb/ECSqlReader.test.js +16 -16
  287. package/lib/esm/test/ecdb/ECSqlReader.test.js.map +1 -1
  288. package/lib/esm/test/ecdb/ECSqlStatement.test.js +332 -332
  289. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  290. package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
  291. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
  292. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
  293. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
  294. package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
  295. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  296. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  297. package/lib/esm/test/element/ElementAspect.test.js +22 -22
  298. package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
  299. package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
  300. package/lib/esm/test/element/ElementRoundTrip.test.js +139 -139
  301. package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
  302. package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
  303. package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
  304. package/lib/esm/test/element/NullStructArray.test.js +13 -13
  305. package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
  306. package/lib/esm/test/element/ProjectInformationRecord.test.js.map +1 -1
  307. package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
  308. package/lib/esm/test/element/UrlLink.test.js.map +1 -1
  309. package/lib/esm/test/font/FontFile.test.js.map +1 -1
  310. package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
  311. package/lib/esm/test/hubaccess/ApplyChangeset.test.js +32 -32
  312. package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
  313. package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
  314. package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
  315. package/lib/esm/test/hubaccess/Rebase.test.js +40 -40
  316. package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
  317. package/lib/esm/test/imageData.js.map +1 -1
  318. package/lib/esm/test/imodel/Code.test.js.map +1 -1
  319. package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
  320. package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
  321. package/lib/esm/test/imodel/IModel.test.js +44 -44
  322. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  323. package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
  324. package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
  325. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js +432 -198
  326. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
  327. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js +272 -190
  328. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
  329. package/lib/esm/test/incrementalSchemaLocater/TestContext.d.ts +27 -0
  330. package/lib/esm/test/incrementalSchemaLocater/TestContext.d.ts.map +1 -0
  331. package/lib/esm/test/incrementalSchemaLocater/TestContext.js +136 -0
  332. package/lib/esm/test/incrementalSchemaLocater/TestContext.js.map +1 -0
  333. package/lib/esm/test/index.js.map +1 -1
  334. package/lib/esm/test/misc/DevTools.test.js.map +1 -1
  335. package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
  336. package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
  337. package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
  338. package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
  339. package/lib/esm/test/rpc/response.test.js.map +1 -1
  340. package/lib/esm/test/schema/ClassRegistry.test.js +99 -99
  341. package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
  342. package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
  343. package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
  344. package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
  345. package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
  346. package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
  347. package/lib/esm/test/standalone/ChangesetReader.test.js +346 -127
  348. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  349. package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
  350. package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
  351. package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
  352. package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
  353. package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
  354. package/lib/esm/test/standalone/ExportGraphics.test.js +14 -14
  355. package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
  356. package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
  357. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  358. package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
  359. package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
  360. package/lib/esm/test/standalone/IModelWrite.test.js +27 -27
  361. package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
  362. package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
  363. package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
  364. package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
  365. package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
  366. package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
  367. package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
  368. package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
  369. package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
  370. package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
  371. package/lib/esm/test/standalone/Setting.test.js.map +1 -1
  372. package/lib/esm/test/standalone/Settings.test.js.map +1 -1
  373. package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
  374. package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
  375. package/lib/esm/test/standalone/Texture.test.js.map +1 -1
  376. package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
  377. package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
  378. package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
  379. package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
  380. package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
  381. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  382. package/lib/esm/workspace/Settings.js.map +1 -1
  383. package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
  384. package/lib/esm/workspace/Workspace.js.map +1 -1
  385. package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
  386. package/package.json +14 -14
  387. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts +0 -11
  388. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts.map +0 -1
  389. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js +0 -36
  390. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +0 -1
  391. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts +0 -20
  392. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts.map +0 -1
  393. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js +0 -126
  394. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +0 -1
  395. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts +0 -24
  396. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts.map +0 -1
  397. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js +0 -67
  398. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Workspace.js","sourceRoot":"","sources":["../../../src/workspace/Workspace.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAoC,MAAM,EAAY,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM3G,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAuahE,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,GAAG,sBAAsB,IAAI,IAAI,EAAE,CAAC;AAC7C,CAAC;AAED;;GAEG;AACH,MAAM,KAAW,qBAAqB,CAOrC;AAPD,WAAiB,qBAAqB;IACpC;;;;OAIG;IACU,wCAAkB,GAAG,eAAe,CAAC,oBAAoB,CAAC,CAAC;AAC1E,CAAC,EAPgB,qBAAqB,KAArB,qBAAqB,QAOrC;AA+BD,SAAS,oBAAoB,CAAC,GAAkB,EAAE,IAAY,EAAE,IAAuB;IACrF,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,MAAM,GAAG,GAAG,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACpE,IAAI,SAAS,KAAK,GAAG,EAAE,CAAC;YACtB,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAcD,YAAY;AACZ,MAAM,KAAW,SAAS,CAsFzB;AAtFD,WAAiB,SAAS;IACxB;;;OAGG;IACQ,+BAAqB,GAAG,CAAC,CAAwB,EAAE,EAAE;QAC9D,IAAI,CAAC,YAAY,KAAK;YACpB,MAAM,CAAC,YAAY,CAAC,qBAAqB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;;YAExD,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;IAUF;;;OAGG;IACQ,sCAA4B,GAAG,CAAC,MAAgC,EAAE,EAAE;QAC7E,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,SAAS,EAAE,6BAA6B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,SAAS,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACxI,CAAC,CAAC;IAmBF;;;;;OAKG;IACH,SAAgB,iBAAiB,CAAC,IAA8B;QAC9D,OAAO,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAuB,CAAC;IACnF,CAAC;IAFe,2BAAiB,oBAEhC,CAAA;IAED;;;;;OAKG;IACH,SAAgB,eAAe,CAAC,IAA8B;QAC5D,OAAO,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAA2B,CAAC;IACrF,CAAC;IAFe,yBAAe,kBAE9B,CAAA;IAED;;;OAGG;IACH,SAAgB,cAAc,CAAC,IAAiC;QAC9D,MAAM,SAAS,GAA6C,EAAE,CAAC;QAC/D,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YAC1B,EAAE,CAAC,cAAc,CAAC;gBAChB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBAClB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;wBACzB,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/B,CAAC;gBACH,CAAC;aACF,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAhBe,wBAAc,iBAgB7B,CAAA;AACH,CAAC,EAtFgB,SAAS,KAAT,SAAS,QAsFzB","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 Workspace\n */\n\nimport { AccessToken, BeEvent, ITwinError, Logger, Optional, UnexpectedErrors } from \"@itwin/core-bentley\";\nimport { LocalDirName, LocalFileName } from \"@itwin/core-common\";\nimport { CloudSqlite } from \"../CloudSqlite\";\nimport { SQLiteDb } from \"../SQLiteDb\";\nimport { SettingName, Settings, SettingsDictionary, SettingsPriority } from \"./Settings\";\nimport type { IModelJsNative } from \"@bentley/imodeljs-native\";\nimport { BackendLoggerCategory } from \"../BackendLoggerCategory\";\nimport { _implementationProhibited } from \"../internal/Symbols\";\n\n/** The unique identifier of a [[WorkspaceContainer]]. This becomes the base name for a local file directory holding the container's [[WorkspaceDb]]s.\n * A valid `WorkspaceContainerId` must conform to the following constraints:\n * - Consist solely of a combination of lower case letters, numbers, and dashes.\n * - May not start or end with a dash.\n * - Must be at least 3 characters long and no longer than 63 characters.\n * @beta\n */\nexport type WorkspaceContainerId = string;\n\n/** Properties describing a [[WorkspaceContainer]] for methods like [[Workspace.getContainerAsync]].\n * @beta\n */\nexport interface WorkspaceContainerProps extends Optional<CloudSqlite.ContainerAccessProps, \"accessToken\"> {\n /** Whether to synchronize the container via [[CloudSqlite.CloudContainer.checkForChanges]] whenever it is connected to a [[CloudSqlite.CloudCache]].\n * @note This property defaults to `true`.\n */\n readonly syncOnConnect?: boolean;\n /** A user-friendly description of the container's contents. */\n readonly description?: string;\n /** A message to display to the user if problems occur while loading the container. */\n readonly loadingHelp?: string;\n}\n\n/** The base name of a [[WorkspaceDb]], without any version information.\n * The name must conform to the following constraints:\n * - Case-insensitively unique among all [[WorkspaceDb]]s in the same [[WorkspaceContainer]].\n * - Between 1 and 255 characters in length.\n * - A legal filename on both [Windows](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) and UNIX.\n * - Contain none of the following characters: forward or backward slash, period, single or double quote, backtick, and \"#\".\n * - Begin or end with a whitespace character.\n * @see [[WorkspaceDbFullName]] for the fully-specified name, including version information.\n * @beta\n */\nexport type WorkspaceDbName = string;\n\n/** The fully-specified name of a [[WorkspaceDb]], combining its [[WorkspaceDbName]] and [[WorkspaceDbVersion]] in the format \"name:version\".\n * @beta\n */\nexport type WorkspaceDbFullName = string;\n\n/** A [semver](https://github.com/npm/node-semver) string describing the version of a [[WorkspaceDb]], e.g., \"4.2.11\".\n * @beta\n */\nexport type WorkspaceDbVersion = CloudSqlite.DbVersion;\n\n/** A [semver string](https://github.com/npm/node-semver?tab=readme-ov-file#ranges) describing a range of acceptable [[WorkspaceDbVersion]]s,\n * e.g., \">=1.2.7 <1.3.0\".\n * @beta\n */\nexport type WorkspaceDbVersionRange = CloudSqlite.DbVersionRange;\n\n/** Specifies the name and version of a [[WorkspaceDb]].\n * @beta\n */\nexport type WorkspaceDbNameAndVersion = Optional<CloudSqlite.DbNameAndVersion, \"dbName\">;\n\n/** Properties that specify how to load a [[WorkspaceDb]] within a [[WorkspaceContainer]].\n * @beta\n */\nexport interface WorkspaceDbProps extends WorkspaceDbNameAndVersion {\n /** If true, allow semver [prerelease versions](https://github.com/npm/node-semver?tab=readme-ov-file#prerelease-tags), e.g., \"1.4.2-beta.0\".\n * By default, only released version are allowed.\n */\n readonly includePrerelease?: boolean;\n /** If true, start a prefetch operation whenever this [[WorkspaceDb]] is opened, to begin downloading pages of the database before they are needed. */\n readonly prefetch?: boolean;\n}\n\n/** Properties describing a [[WorkspaceDb]] and the [[WorkspaceContainer]] containing it.\n * @beta\n */\nexport type WorkspaceDbCloudProps = WorkspaceDbProps & WorkspaceContainerProps;\n\n/** A function supplied as [[WorkspaceDbQueryResourcesArgs.callback]] to be invoked to process the requested resources.\n * @beta\n */\nexport type WorkspaceDbQueryResourcesCallback = (resourceNames: Iterable<string>) => void;\n\n/** Arguments supplied to [[WorkspaceDb.queryResources]].\n * @beta\n */\nexport interface WorkspaceDbQueryResourcesArgs {\n /** The type of resource to query. */\n type?: \"string\" | \"blob\";\n /** A pattern against which to compare the name of each resource, using [[nameCompare]] as the comparison operator.\n * Only resources whose names match the pattern will be included in the query results.\n */\n namePattern?: string;\n /** The comparison operator by which to compare the name of each resource to [[namePattern]].\n * Only resources whose names match the pattern will be included in the query results.\n * Ignored if [[namePattern]] is undefined.\n */\n nameCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"<\" | \">\";\n /** A function invoked to process the resources that match the query criterion. */\n callback: WorkspaceDbQueryResourcesCallback;\n}\n\n/** Metadata stored inside a [[WorkspaceDb]] describing the database's contents, to help users understand the purpose of the [[WorkspaceDb]], who to\n * contact with questions about it, and so on.\n * @note Only the [[workspaceName]] field is required, and users may add additional fields for their own purposes.\n * @note Since the information is stored inside of the [[WorkspaceDb]], it is versioned along with the rest of the contents.\n * @beta\n */\nexport interface WorkspaceDbManifest {\n /** The name of the [[WorkspaceDb]] to be shown in user interfaces. Organizations should attempt to make this name informative enough\n * so that users may refer to this name in conversations. It should also be unique enough that there's no confusion when it appears in\n * lists of WorkspaceDbs.\n * @note it is possible and valid to change the workspaceName between new version of a WorkspaceDb (e.g. incorporating a date).\n */\n readonly workspaceName: string;\n /** A description of the contents of this [[WorkspaceDb]] to help users understand its purpose and appropriate usage. */\n readonly description?: string;\n /** The name of the person to contact with questions about this [[WorkspaceDb]]. */\n readonly contactName?: string;\n /** The name of the person who last modified this [[WorkspaceDb]]. */\n readonly lastEditedBy?: string;\n}\n\n/**\n * An exception thrown when attempting to load a [[WorkspaceDb]] or some of its data; for example, if the [[WorkspaceDb]] could not be found or the user\n * is not authorized to access its [[WorkspaceContainer]].\n * @beta\n */\nexport interface WorkspaceDbLoadError extends ITwinError {\n /** The properties of the [[WorkspaceDb]] that was attempted to load, including the identity of its [[WorkspaceContainer]]. */\n wsDbProps?: WorkspaceDbProps & Partial<WorkspaceDbCloudProps>;\n /** The [[WorkspaceDb]] in which the error occurred, if available. */\n wsDb?: WorkspaceDb;\n}\n\n/** An exception that may occur while opening an [[IModelDb]] if any problems are detected while loading its [[IModelDb.workspace]].\n * This exception is never actually thrown; instead, after the iModel is opened, the exception is forwarded to [[Workspace.exceptionDiagnosticFn]]\n * so that the user can be notified of the problems.\n * @beta\n */\nexport interface WorkspaceDbLoadErrors extends ITwinError {\n /** An array of problems that were encountered attempting to load [[WorkspaceDb]]s for an [[IModelDb]]. The most common problem\n * is that the user doesn't have read access to one or more [[WorkspaceContainer]]s used by the iModel's [[Workspace]]..\n */\n wsLoadErrors?: WorkspaceDbLoadError[];\n}\n\n/** Specifies a resource inside a [[WorkspaceDb]] that holds a [[SettingsDictionary]] to load into [[Workspace.settings]].\n * Settings of this type named [[WorkspaceSettingNames.settingsWorkspaces]] are automatically loaded by [[Workspace.loadSettingsDictionary]].\n * @beta\n */\nexport interface WorkspaceDbSettingsProps extends WorkspaceDbCloudProps {\n /** The name of the resource holding the stringified JSON of the [[SettingsDictionary]]. */\n resourceName: string;\n /** The priority to assign to the [[SettingsDictionary]]. */\n priority: SettingsPriority;\n}\n\n/** The name of a blob, string, or file resource stored in a [[WorkspaceDb]].\n * Resource names must conform to the following constraints:\n * - At least 1 character and no more than 1024 characters in length.\n * - No leading or trailing whitespace characters.\n * Each resource of a given type must has a unique name within the [[WorkspaceDb]]. It is technically possible, but discouraged, to define\n * resources with the same name but different types.\n * @beta\n */\nexport type WorkspaceResourceName = string;\n\n/** A SQLite database in a [[Workspace]] containing named resources that the application is configured to use.\n * Resources are referred to by their [[WorkspaceResourceName]]s and can represent any number of things, including:\n * - [GeographicCRS]($common)es used to define the coordinate reference system of an iTwin.\n * - [[SettingsDictionary]]'s that contribute to the [[Workspace.settings]].\n * - Files that can be extracted temporarily to the local file system to be accessed by programs directly from disk.\n *\n * Ultimately, each resource is stored in one of the following formats:\n * - A `string`, which is often a stringified `JSON` representation of the resource;\n * - A binary `blob`; or\n * - An embedded file.\n *\n * Strings and blobs can be accessed directly using [[getString]] and [[getBlob]]. Files must first be copied to the local file system using [[getFile]], and should be avoided unless the software\n * that uses them is written to access them from disk.\n *\n * A `WorkspaceDb` resides in a [[WorkspaceContainer]] that can be published to the cloud. Once published, the `WorkspaceDb` becomes immutable.\n * However, multiple versions of a single `WorkspaceDb` can be created, allowing the [[Workspace]] contents to evolve over time.\n * `WorkspaceDb`s use [semantic versioning](https://github.com/npm/node-semver).\n *\n * The set of available `WorkspaceDb`s available for use for specific purposes are defined in the [[Workspace]]'s [[Settings]]. You can obtain\n * a single `WorkspaceDb` using [[WorkspaceContainer.getWorkspaceDb]], but more commonly you will use [[Workspace.getWorkspaceDbs]] to obtain\n * a list of all of the `WorkspaceDb`s, sorted by priority, that correspond to a given [[SettingName]].\n *\n * You can create new `WorkspaceDb`s (or new versions of existing `WorkspaceDb`s) using [[WorkspaceEditor]].\n * @beta\n */\nexport interface WorkspaceDb {\n /** @internal */\n [_implementationProhibited]: unknown;\n /** The [[WorkspaceContainer]] in which this db resides. */\n readonly container: WorkspaceContainer;\n /** The base name of this WorkspaceDb, without version */\n readonly dbName: WorkspaceDbName;\n /** An event raised before this WorkspaceDb is [[close]]d. */\n readonly onClose: BeEvent<() => void>;\n /** The name by which the WorkspaceDb can be opened. This will be either a local file name or the name of a database in a [[CloudSqlite.CloudContainer]]. */\n readonly dbFileName: string;\n /** The underlying SQLite database that stores this WorkspaceDb's resources. */\n readonly sqliteDb: SQLiteDb;\n /** Whether the underlying [[sqliteDb]] is currently [[open]]ed. */\n readonly isOpen: boolean;\n /** The manifest that describes the contents and context of this WorkspaceDb. */\n readonly manifest: WorkspaceDbManifest;\n /** The version of this WorkspaceDb */\n readonly version: WorkspaceDbVersion;\n\n /** Open the underlying [[sqliteDb]] to perform a query. Generally WorkspaceDbs are left closed and opened/closed as they're used. However,\n * when there will be significant activity against a WorkspaceDb, it may be useful to open it before the operations and close it afterwards.\n * Methods like [[queryResources]] open the SQLite database automatically and [[close]] it before they return.\n */\n open(): void;\n\n /** Close the underlying [[sqliteDb]]. You should call this after [[open]]ing the database and completing your query. */\n close(): void;\n\n /** Look up a string resource by name, if one exists. */\n getString(rscName: WorkspaceResourceName): string | undefined;\n\n /** Look up a binary resource by name, if one exists. */\n getBlob(rscName: WorkspaceResourceName): Uint8Array | undefined;\n\n /** Get a BlobIO reader for a blob WorkspaceResource.\n * @note when finished, caller *must* call `close` on the BlobIO.\n * @internal\n */\n getBlobReader(rscName: WorkspaceResourceName): SQLiteDb.BlobIO;\n\n /**\n * Extract a local copy of a file resource from this WorkspaceDb, if present.\n * @param rscName The name of the file resource in the WorkspaceDb\n * @param targetFileName optional name for extracted file. Some applications require files in specific locations or filenames. If\n * you know the full path to use for the extracted file, you can supply it. Generally, it is best to *not* supply the filename and\n * keep the extracted files in the directory specified by [[WorkspaceContainer.filesDir]].\n * @returns the full path to a file on the local file system, or undefined if the no file named `rscName` exists.\n * @note The file is copied from the file into the local file system so it may be accessed directly. This happens only\n * as necessary, if the local file doesn't exist, or if it is out-of-date because it was updated in the file.\n * For this reason, you should not save the local file name, and instead call this method every time you access it, so its\n * content is always holds the correct version.\n * @note The filename will be a hash value, not the resource name.\n * @note Workspace resource files are set as read-only as they are copied from the file.\n * To edit them, you must first copy them to another location.\n */\n getFile(rscName: WorkspaceResourceName, targetFileName?: LocalFileName): LocalFileName | undefined;\n\n /**\n * Ensure that the contents of this `WorkspaceDb` are downloaded into the local cache so that it may be accessed offline.\n * Until the promise resolves, the `WorkspaceDb` is not fully downloaded, but it *may* be safely accessed during the download.\n * To determine the progress of the download, use the `localBlocks` and `totalBlocks` values returned by `CloudContainer.queryDatabase`.\n * @returns a [[CloudSqlite.CloudPrefetch]] object that can be used to await and/or cancel the prefetch.\n * @throws if this WorkspaceDb is not from a [[CloudSqlite.CloudContainer]].\n */\n prefetch(opts?: CloudSqlite.PrefetchProps): CloudSqlite.CloudPrefetch;\n\n /** Find resources of a particular type with names matching a specified pattern.\n * The matching resources will be supplied to [[WorkspaceDbQueryResourcesArgs.callbackk]].\n * @see [[Workspace.queryResources]] to query resources within multiple `WorkspaceDb`s.\n */\n queryResources(args: WorkspaceDbQueryResourcesArgs): void;\n\n /** @internal */\n queryFileResource(rscName: WorkspaceResourceName): { localFileName: LocalFileName, info: IModelJsNative.EmbedFileQuery } | undefined;\n}\n\n/** Options supplied to [[IModelHost.startup]] via [[IModelHostOptions.workspace]] to customize the initialization of [[IModelHost.appWorkspace]].\n * @beta\n */\nexport interface WorkspaceOpts {\n /** The local directory for non-cloud-based [[WorkspaceDb]] files. The [[Workspace]] API will look in this directory\n * for files named `${containerId}/${dbId}.itwin-workspace`.\n * @note if not supplied, defaults to \"iTwin/Workspace\" in the user-local folder.\n */\n containerDir?: LocalDirName;\n\n /** The name(s) of one or more local JSON files containing [[SettingsDictionary]]s to load when initializing the [[Workspace]]. */\n settingsFiles?: LocalFileName | LocalFileName[];\n}\n\n/** Arguments supplied to [[Workspace.getContainer]] and [[WorkspaceEditor.getContainer]].\n * @beta\n */\nexport interface GetWorkspaceContainerArgs extends WorkspaceContainerProps {\n /** Token required to access the container. */\n accessToken: AccessToken;\n}\n\n/**\n * Settings and resources that customize an application for the current session.\n * See the [learning article]($docs/learning/backend/Workspace) for a detailed overiew and examples.\n * @beta\n */\nexport interface Workspace {\n /** @internal */\n [_implementationProhibited]: unknown;\n\n /** The directory for local WorkspaceDb files with the name `${containerId}/${dbId}.itwin-workspace`.\n * @internal\n */\n readonly containerDir: LocalDirName;\n\n /** The current [[Settings]] for this Workspace */\n readonly settings: Settings;\n\n /** Get the cloud cache for cloud-based [[WorkspaceContainer]]s. */\n getCloudCache(): CloudSqlite.CloudCache;\n\n /** Search for a container previously opened by [[getContainer]] or [[getContainerAsync]].\n * @param containerId The id of the container\n * @returns the [[WorkspaceContainer]] for `containerId`, or `undefined` if no such container has been opened.\n * @internal\n */\n findContainer(containerId: WorkspaceContainerId): WorkspaceContainer | undefined;\n\n /** Obtain the [[WorkspaceContainer]] specified by `props`.\n * @param props The properties of the `WorkspaceContainer`, opening it if it is not already opened.\n * Otherwise it is created.\n * @note This function allows a `WorkspaceContainer.Props` without its [AccessToken]($bentley). It will attempt to obtain one from the [[BlobContainer]] service,\n * hence this function is async.\n * @see [[getContainer]] to obtain a container synchronously.\n */\n getContainerAsync(props: WorkspaceContainerProps): Promise<WorkspaceContainer>;\n\n /** Get a WorkspaceContainer with a supplied access token. This function is synchronous and may be used if:\n * - a valid [AccessToken]($bentley) is already available;\n * - the container has already been previously prefetched in another session (this is useful for offline usage); or\n * - the container is public and doesn't require an [AccessToken]($bentley).\n * @see [[getContainerAsync]] to obtain a container asynchronously if the above conditions do not apply.\n */\n getContainer(props: GetWorkspaceContainerArgs): WorkspaceContainer;\n\n /** Load a [[SettingsDictionary]] from the specified [[WorkspaceDb]] and add it to this workspace's current [[Settings]].\n * @note this function will load the dictionaries from the supplied list, and it will also call itself recursively for any entries in\n * the loaded Settings with the name [[WorkspaceSettingNames.settingsWorkspaces]]. In this manner, WorkspaceSettings may be \"chained\" together so that loading one\n * causes its \"dependent\" WorkspaceSettings to be loaded. Its `Promise` is resolved after all have been loaded (or failed to load).\n */\n loadSettingsDictionary(\n /** The properties of the [[WorkspaceDb]], plus the resourceName and [[SettingsPriority]]. May be either a single value or an array of them */\n props: WorkspaceDbSettingsProps | WorkspaceDbSettingsProps[],\n /** If present, an array that is populated with a list of problems while attempting to load the [[SettingsDictionary]](s). */\n problems?: WorkspaceDbLoadError[]\n ): Promise<void>;\n\n /** Get a single [[WorkspaceDb]]. */\n getWorkspaceDb(props: WorkspaceDbCloudProps): Promise<WorkspaceDb>;\n\n /**\n * Resolve the value of all [[Setting]]s from this workspace with the supplied `settingName` into an array of [[WorkspaceDbCloudProps]]\n * that can be used to query or load workspace resources. The settings must each be an array of type [[WorkspaceDbSettingsProps]].\n * The returned array will be sorted according to their [[SettingsPriority]], with the first entry being the highest priority [[WorkspaceDb]].\n * @note The list is built by combining, in order, all of the settings with the supplied [[SettingName]]. It may therefore include the\n * properties of same WorkspaceDb multiple times. This list is automatically de-duped by [[getWorkspaceDb]].\n * @note This function is rarely used directly. Usually it is called by [[getWorkspaceDbs]]. However, this function is synchronous and may sometimes\n * be useful for editors, tests, or diagnostics.\n */\n resolveWorkspaceDbSetting(\n /** the name of the setting. */\n settingName: SettingName,\n /** optional filter to choose specific WorkspaceDbs from the settings values. If present, only those WorkspaceDbs for which the filter returns `true` will be included. */\n filter?: Workspace.DbListFilter): WorkspaceDbCloudProps[];\n\n /**\n * Get a sorted array of [[WorkspaceDb]]s that can be used to query or load resources. If the arguments supply a `settingName`, this function will\n * use [[resolveWorkspaceDbSetting]] to get get the array of [[WorkspaceDbCloudProps]].\n * @returns A `Promise` resolving to an array of [[WorkspaceDb]]s sorted by [[SettingsPriority]] so that resources found in WorkspaceDbs earlier in the list take precedence\n * over ones with the same name in later WorkspaceDbs. No WorkspaceDb will appear more than once in the list.\n * @note this function may request an [AccessToken]($bentley) for each WorkspaceDb if necessary, and hence is asynchronous.\n */\n getWorkspaceDbs(\n args: Workspace.DbListOrSettingName & {\n /** if supplied, this array is populated with a list of problems (e.g. no read permission) attempting to load WorkspacesDbs. */\n problems?: WorkspaceDbLoadError[];\n /** only valid when called with a settingName, if so passed as `filter` argument to [[resolveWorkspaceDbSetting]] */\n filter?: Workspace.DbListFilter;\n }): Promise<WorkspaceDb[]>;\n}\n\n/**\n * A WorkspaceContainer is a type of [[CloudSqlite.CloudContainer]] that holds one or more [[WorkspaceDb]]s. Normally a WorkspaceContainer will hold (many versions of) a single WorkspaceDb.\n * Each version of a WorkspaceDb is treated as immutable after it is created and is stored in the WorkspaceContainer indefinitely. That means that\n * older versions of the WorkspaceDb may continue to be used, for example by archived projects. For programmers familiar with [NPM](https://www.npmjs.com/), this is conceptually\n * similar and versioning follows the same rules as NPM using [Semantic Versioning](https://semver.org/).\n * @note It is possible to store more than one WorkspaceDb in the same WorkspaceContainer, but access rights are administered per WorkspaceContainer.\n * That is, if a user has rights to access a WorkspaceContainer, that right applies to all WorkspaceDbs in the WorkspaceContainer.\n * @note Not every WorkspaceContainer is associated with a [[CloudSqlite.CloudContainer]] - WorkspaceContainers may also be loaded from the local file system.\n * In this case, [[cloudContainer]] will be `undefined`.\n * @see [[Workspace.getContainer]] and [[Workspace.getContainerAsync]] to load a container.\n * @beta\n */\nexport interface WorkspaceContainer {\n /** @internal */\n [_implementationProhibited]: unknown;\n /** the local directory where this WorkspaceContainer will store temporary files extracted for file-resources.\n * @internal\n */\n readonly filesDir: LocalDirName;\n /** The workspace into which this container was loaded. */\n readonly workspace: Workspace;\n /** Cloud container for this WorkspaceContainer, or `undefined` if this is a local WorkspaceContainer. */\n readonly cloudContainer?: CloudSqlite.CloudContainer;\n /** Properties supplied when this container was loaded */\n readonly fromProps: WorkspaceContainerProps;\n\n /** @internal */\n addWorkspaceDb(toAdd: WorkspaceDb): void;\n\n /**\n * Find the fully-qualified name of a [[WorkspaceDb]] satisfying the name and version criteria specified by `props`.\n * @throws Error if no version satisfying the criteria exists.\n */\n resolveDbFileName(props: WorkspaceDbProps): WorkspaceDbFullName;\n\n /** Obtain a [[WorkspaceDb]] satisfying the name and version criteria specified by `props`. */\n getWorkspaceDb(props?: WorkspaceDbProps): WorkspaceDb;\n\n /** Close and remove a currently opened [[WorkspaceDb]] from this Workspace.\n * @internal\n */\n closeWorkspaceDb(container: WorkspaceDb): void;\n}\n\nfunction makeSettingName(name: string) {\n return `${\"itwin/core/workspace\"}/${name}`;\n}\n\n/** The names of various [[Setting]]s with special meaning to the [[Workspace]] system.\n * @beta\n */\nexport namespace WorkspaceSettingNames {\n /** The name of a setting that, when present in a [[WorkspaceDb]] loaded by [[Workspace.loadSettingsDictionary]], will automatically\n * be used to find and load additional [[SettingsDictionary]]'s in other [[WorkspaceDb]]s. This permits you to chain the settings inside on [[WorkspaceDb]]\n * to others upon which they depend.\n * This setting's value is an array of [[WorkspaceDbSettingsProps]]s.\n */\n export const settingsWorkspaces = makeSettingName(\"settingsWorkspaces\");\n}\n\n/** A function supplied as part of a [[QueryWorkspaceResourcesArgs]] to iterate the resources retrieved by [[Workspace.queryResources]].\n * The `resources` object should only be used inside the function - it is an error to attempt to iterate it after the function returns.\n * @beta\n */\nexport type QueryWorkspaceResourcesCallback = (resources: Iterable<{ name: string, db: WorkspaceDb }>) => void;\n\n/** Arguments supplied to [[Workspace.queryResources]] defining the query criteria and the list of [[WorkspaceDb]]s to query.\n * @beta\n */\nexport interface QueryWorkspaceResourcesArgs {\n /** The list of `WorkspaceDb`s to query, in the order in which they are to be queried.\n * @see [[Workspace.resolveWorkspaceDbSetting]] or [[Workspace.getWorkspaceDbs]] to obtain an appropriate list of `WorkspaceDb`s.\n */\n dbs: WorkspaceDb[];\n /** The type of resource to query. */\n type?: \"string\" | \"blob\";\n /** A pattern against which to compare the name of each resource, using [[nameCompare]] as the comparison operator.\n * Only resources whose names match the pattern will be included in the query results.\n */\n namePattern?: string;\n /** The comparison operator by which to compare the name of each resource to [[namePattern]].\n * Only resources whose names match the pattern will be included in the query results.\n * Ignored i [[namePattern]] is undefined.\n */\n nameCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"<\" | \">\";\n /** A function invoked to process the resources that match the query criteria. */\n callback: QueryWorkspaceResourcesCallback;\n}\n\nfunction getWorkspaceResource(dbs: WorkspaceDb[], name: string, type: \"string\" | \"blob\"): string | Uint8Array | undefined {\n for (const db of dbs) {\n const val = type === \"blob\" ? db.getBlob(name) : db.getString(name);\n if (undefined !== val) {\n return val;\n }\n }\n\n return undefined;\n}\n\n/** Arguments supplied to [[Workspace.getStringResource]] and [[WOrkspace.getBlobResource]].\n * @beta\n */\nexport interface GetWorkspaceResourceArgs {\n /** The list of `WorkspaceDb`s to search, in the order in which they are to be searched.\n * @see [[Workspace.resolveWorkspaceDbSetting]] or [[Workspace.getWorkspaceDbs]] to obtain an appropriate list of `WorkspaceDb`s.\n */\n dbs: WorkspaceDb[];\n /** The name of the resource to find. */\n name: WorkspaceResourceName;\n}\n\n/** @beta */\nexport namespace Workspace {\n /** A function invoked to handle exceptions produced while loading workspace data.\n * Applications can override this function to notify the user and/or attempt to diagnose the problem.\n * The default implementation simply logs each exception.\n */\n export let exceptionDiagnosticFn = (e: WorkspaceDbLoadErrors) => { // eslint-disable-line prefer-const\n if (e instanceof Error)\n Logger.logException(BackendLoggerCategory.Workspace, e);\n else\n UnexpectedErrors.handle(e);\n };\n\n /** Arguments supplied to [[Workspace.onSettingsDictionaryLoadedFn]] for every [[SettingsDictionary]] that is loaded from a [[WorkspaceDb]]. */\n export interface SettingsDictionaryLoaded {\n /** The dictionary that was loaded */\n dict: SettingsDictionary;\n /** The WorkspaceDb from which the dictionary was loaded. */\n from: WorkspaceDb;\n }\n\n /** A function invoked each time any [[SettingsDictionary]] is loaded from a [[WorkspaceDb]].\n * Applications can override this function to notify the user and/or record diagnostics.\n * The default implementation simply records an information message in the [Logger]($bentley).\n */\n export let onSettingsDictionaryLoadedFn = (loaded: SettingsDictionaryLoaded) => { // eslint-disable-line prefer-const\n Logger.logInfo(BackendLoggerCategory.Workspace, `loaded setting dictionary ${loaded.dict.props.name} from ${loaded.from.dbFileName}`);\n };\n\n /** Either an array of [[WorkspaceDbCloudProps]] or the name of a [[Setting]] that resolves to an array of [[WorkspaceDbCloudProps]].\n * Used by [[Workspace.getWorkspaceDbs]].\n */\n export type DbListOrSettingName = { readonly dbs: WorkspaceDbCloudProps[], readonly settingName?: never } | { readonly settingName: SettingName, readonly dbs?: never };\n\n /** In arguments supplied to [[Workspace.getWorkspaceDbs]] and [[Workspace.resolveWorkspaceDbSetting]], an optional function used to exclude some\n * [[WorkspaceDb]]s. Only those [[WorkspaceDb]]s for which the function returns `true` will be included.\n */\n export type DbListFilter = (\n /** The properties of the WorkspaceDb to be returned */\n dbProp: WorkspaceDbCloudProps,\n /** The SettingsDictionary holding the [[WorkspaceSettingNames.settingsWorkspace]] setting. May be used, for example, to determine the\n * [[SettingsPriority]] of the dictionary.\n */\n dict: SettingsDictionary\n ) => boolean;\n\n /** Searches a list of [[WorkspaceDb]]s for a string resource of a given name.\n * The list is searched in order, and the first resource with the request name is returned.\n * If no such resource exists, the function returns `undefined`.\n * @see [[WorkspaceDb.getString]] if you only need to search a single `WorkspaceDb`.\n * @beta\n */\n export function getStringResource(args: GetWorkspaceResourceArgs): string | undefined {\n return getWorkspaceResource(args.dbs, args.name, \"string\") as string | undefined;\n }\n\n /** Searches a list of [[WorkspaceDb]]s for a blob resource of a given name.\n * The list is searched in order, and the first resource with the request name is returned.\n * If no such resource exists, the function returns `undefined`.\n * @see [[WorkspaceDb.getblob]] if you only need to search a single `WorkspaceDb`.\n * @beta\n */\n export function getBlobResource(args: GetWorkspaceResourceArgs): Uint8Array | undefined {\n return getWorkspaceResource(args.dbs, args.name, \"blob\") as Uint8Array | undefined;\n }\n\n /** Query a list of [[WorkspaceDb]]s to find resources of a particular type with names matching a specified pattern.\n * @see [[WorkspaceDb.queryResources]] if you only need to query a single `WorkspaceDb`.\n * @beta\n */\n export function queryResources(args: QueryWorkspaceResourcesArgs): void {\n const resources: Array<{ name: string, db: WorkspaceDb }> = [];\n for (const db of args.dbs) {\n db.queryResources({\n type: args.type,\n namePattern: args.namePattern,\n nameCompare: args.nameCompare,\n callback: (names) => {\n for (const name of names) {\n resources.push({ db, name });\n }\n },\n });\n }\n\n args.callback(resources);\n }\n}\n"]}
1
+ {"version":3,"file":"Workspace.js","sourceRoot":"","sources":["../../../src/workspace/Workspace.ts"],"names":[],"mappings":"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","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 Workspace\r\n */\r\n\r\nimport { AccessToken, BeEvent, ITwinError, Logger, Optional, UnexpectedErrors } from \"@itwin/core-bentley\";\r\nimport { LocalDirName, LocalFileName } from \"@itwin/core-common\";\r\nimport { CloudSqlite } from \"../CloudSqlite\";\r\nimport { SQLiteDb } from \"../SQLiteDb\";\r\nimport { SettingName, Settings, SettingsDictionary, SettingsPriority } from \"./Settings\";\r\nimport type { IModelJsNative } from \"@bentley/imodeljs-native\";\r\nimport { BackendLoggerCategory } from \"../BackendLoggerCategory\";\r\nimport { _implementationProhibited } from \"../internal/Symbols\";\r\n\r\n/** The unique identifier of a [[WorkspaceContainer]]. This becomes the base name for a local file directory holding the container's [[WorkspaceDb]]s.\r\n * A valid `WorkspaceContainerId` must conform to the following constraints:\r\n * - Consist solely of a combination of lower case letters, numbers, and dashes.\r\n * - May not start or end with a dash.\r\n * - Must be at least 3 characters long and no longer than 63 characters.\r\n * @beta\r\n */\r\nexport type WorkspaceContainerId = string;\r\n\r\n/** Properties describing a [[WorkspaceContainer]] for methods like [[Workspace.getContainerAsync]].\r\n * @beta\r\n */\r\nexport interface WorkspaceContainerProps extends Optional<CloudSqlite.ContainerAccessProps, \"accessToken\"> {\r\n /** Whether to synchronize the container via [[CloudSqlite.CloudContainer.checkForChanges]] whenever it is connected to a [[CloudSqlite.CloudCache]].\r\n * @note This property defaults to `true`.\r\n */\r\n readonly syncOnConnect?: boolean;\r\n /** A user-friendly description of the container's contents. */\r\n readonly description?: string;\r\n /** A message to display to the user if problems occur while loading the container. */\r\n readonly loadingHelp?: string;\r\n}\r\n\r\n/** The base name of a [[WorkspaceDb]], without any version information.\r\n * The name must conform to the following constraints:\r\n * - Case-insensitively unique among all [[WorkspaceDb]]s in the same [[WorkspaceContainer]].\r\n * - Between 1 and 255 characters in length.\r\n * - A legal filename on both [Windows](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) and UNIX.\r\n * - Contain none of the following characters: forward or backward slash, period, single or double quote, backtick, and \"#\".\r\n * - Begin or end with a whitespace character.\r\n * @see [[WorkspaceDbFullName]] for the fully-specified name, including version information.\r\n * @beta\r\n */\r\nexport type WorkspaceDbName = string;\r\n\r\n/** The fully-specified name of a [[WorkspaceDb]], combining its [[WorkspaceDbName]] and [[WorkspaceDbVersion]] in the format \"name:version\".\r\n * @beta\r\n */\r\nexport type WorkspaceDbFullName = string;\r\n\r\n/** A [semver](https://github.com/npm/node-semver) string describing the version of a [[WorkspaceDb]], e.g., \"4.2.11\".\r\n * @beta\r\n */\r\nexport type WorkspaceDbVersion = CloudSqlite.DbVersion;\r\n\r\n/** A [semver string](https://github.com/npm/node-semver?tab=readme-ov-file#ranges) describing a range of acceptable [[WorkspaceDbVersion]]s,\r\n * e.g., \">=1.2.7 <1.3.0\".\r\n * @beta\r\n */\r\nexport type WorkspaceDbVersionRange = CloudSqlite.DbVersionRange;\r\n\r\n/** Specifies the name and version of a [[WorkspaceDb]].\r\n * @beta\r\n */\r\nexport type WorkspaceDbNameAndVersion = Optional<CloudSqlite.DbNameAndVersion, \"dbName\">;\r\n\r\n/** Properties that specify how to load a [[WorkspaceDb]] within a [[WorkspaceContainer]].\r\n * @beta\r\n */\r\nexport interface WorkspaceDbProps extends WorkspaceDbNameAndVersion {\r\n /** If true, allow semver [prerelease versions](https://github.com/npm/node-semver?tab=readme-ov-file#prerelease-tags), e.g., \"1.4.2-beta.0\".\r\n * By default, only released version are allowed.\r\n */\r\n readonly includePrerelease?: boolean;\r\n /** If true, start a prefetch operation whenever this [[WorkspaceDb]] is opened, to begin downloading pages of the database before they are needed. */\r\n readonly prefetch?: boolean;\r\n}\r\n\r\n/** Properties describing a [[WorkspaceDb]] and the [[WorkspaceContainer]] containing it.\r\n * @beta\r\n */\r\nexport type WorkspaceDbCloudProps = WorkspaceDbProps & WorkspaceContainerProps;\r\n\r\n/** A function supplied as [[WorkspaceDbQueryResourcesArgs.callback]] to be invoked to process the requested resources.\r\n * @beta\r\n */\r\nexport type WorkspaceDbQueryResourcesCallback = (resourceNames: Iterable<string>) => void;\r\n\r\n/** Arguments supplied to [[WorkspaceDb.queryResources]].\r\n * @beta\r\n */\r\nexport interface WorkspaceDbQueryResourcesArgs {\r\n /** The type of resource to query. */\r\n type?: \"string\" | \"blob\";\r\n /** A pattern against which to compare the name of each resource, using [[nameCompare]] as the comparison operator.\r\n * Only resources whose names match the pattern will be included in the query results.\r\n */\r\n namePattern?: string;\r\n /** The comparison operator by which to compare the name of each resource to [[namePattern]].\r\n * Only resources whose names match the pattern will be included in the query results.\r\n * Ignored if [[namePattern]] is undefined.\r\n */\r\n nameCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"<\" | \">\";\r\n /** A function invoked to process the resources that match the query criterion. */\r\n callback: WorkspaceDbQueryResourcesCallback;\r\n}\r\n\r\n/** Metadata stored inside a [[WorkspaceDb]] describing the database's contents, to help users understand the purpose of the [[WorkspaceDb]], who to\r\n * contact with questions about it, and so on.\r\n * @note Only the [[workspaceName]] field is required, and users may add additional fields for their own purposes.\r\n * @note Since the information is stored inside of the [[WorkspaceDb]], it is versioned along with the rest of the contents.\r\n * @beta\r\n */\r\nexport interface WorkspaceDbManifest {\r\n /** The name of the [[WorkspaceDb]] to be shown in user interfaces. Organizations should attempt to make this name informative enough\r\n * so that users may refer to this name in conversations. It should also be unique enough that there's no confusion when it appears in\r\n * lists of WorkspaceDbs.\r\n * @note it is possible and valid to change the workspaceName between new version of a WorkspaceDb (e.g. incorporating a date).\r\n */\r\n readonly workspaceName: string;\r\n /** A description of the contents of this [[WorkspaceDb]] to help users understand its purpose and appropriate usage. */\r\n readonly description?: string;\r\n /** The name of the person to contact with questions about this [[WorkspaceDb]]. */\r\n readonly contactName?: string;\r\n /** The name of the person who last modified this [[WorkspaceDb]]. */\r\n readonly lastEditedBy?: string;\r\n}\r\n\r\n/**\r\n * An exception thrown when attempting to load a [[WorkspaceDb]] or some of its data; for example, if the [[WorkspaceDb]] could not be found or the user\r\n * is not authorized to access its [[WorkspaceContainer]].\r\n * @beta\r\n */\r\nexport interface WorkspaceDbLoadError extends ITwinError {\r\n /** The properties of the [[WorkspaceDb]] that was attempted to load, including the identity of its [[WorkspaceContainer]]. */\r\n wsDbProps?: WorkspaceDbProps & Partial<WorkspaceDbCloudProps>;\r\n /** The [[WorkspaceDb]] in which the error occurred, if available. */\r\n wsDb?: WorkspaceDb;\r\n}\r\n\r\n/** An exception that may occur while opening an [[IModelDb]] if any problems are detected while loading its [[IModelDb.workspace]].\r\n * This exception is never actually thrown; instead, after the iModel is opened, the exception is forwarded to [[Workspace.exceptionDiagnosticFn]]\r\n * so that the user can be notified of the problems.\r\n * @beta\r\n */\r\nexport interface WorkspaceDbLoadErrors extends ITwinError {\r\n /** An array of problems that were encountered attempting to load [[WorkspaceDb]]s for an [[IModelDb]]. The most common problem\r\n * is that the user doesn't have read access to one or more [[WorkspaceContainer]]s used by the iModel's [[Workspace]]..\r\n */\r\n wsLoadErrors?: WorkspaceDbLoadError[];\r\n}\r\n\r\n/** Specifies a resource inside a [[WorkspaceDb]] that holds a [[SettingsDictionary]] to load into [[Workspace.settings]].\r\n * Settings of this type named [[WorkspaceSettingNames.settingsWorkspaces]] are automatically loaded by [[Workspace.loadSettingsDictionary]].\r\n * @beta\r\n */\r\nexport interface WorkspaceDbSettingsProps extends WorkspaceDbCloudProps {\r\n /** The name of the resource holding the stringified JSON of the [[SettingsDictionary]]. */\r\n resourceName: string;\r\n /** The priority to assign to the [[SettingsDictionary]]. */\r\n priority: SettingsPriority;\r\n}\r\n\r\n/** The name of a blob, string, or file resource stored in a [[WorkspaceDb]].\r\n * Resource names must conform to the following constraints:\r\n * - At least 1 character and no more than 1024 characters in length.\r\n * - No leading or trailing whitespace characters.\r\n * Each resource of a given type must has a unique name within the [[WorkspaceDb]]. It is technically possible, but discouraged, to define\r\n * resources with the same name but different types.\r\n * @beta\r\n */\r\nexport type WorkspaceResourceName = string;\r\n\r\n/** A SQLite database in a [[Workspace]] containing named resources that the application is configured to use.\r\n * Resources are referred to by their [[WorkspaceResourceName]]s and can represent any number of things, including:\r\n * - [GeographicCRS]($common)es used to define the coordinate reference system of an iTwin.\r\n * - [[SettingsDictionary]]'s that contribute to the [[Workspace.settings]].\r\n * - Files that can be extracted temporarily to the local file system to be accessed by programs directly from disk.\r\n *\r\n * Ultimately, each resource is stored in one of the following formats:\r\n * - A `string`, which is often a stringified `JSON` representation of the resource;\r\n * - A binary `blob`; or\r\n * - An embedded file.\r\n *\r\n * Strings and blobs can be accessed directly using [[getString]] and [[getBlob]]. Files must first be copied to the local file system using [[getFile]], and should be avoided unless the software\r\n * that uses them is written to access them from disk.\r\n *\r\n * A `WorkspaceDb` resides in a [[WorkspaceContainer]] that can be published to the cloud. Once published, the `WorkspaceDb` becomes immutable.\r\n * However, multiple versions of a single `WorkspaceDb` can be created, allowing the [[Workspace]] contents to evolve over time.\r\n * `WorkspaceDb`s use [semantic versioning](https://github.com/npm/node-semver).\r\n *\r\n * The set of available `WorkspaceDb`s available for use for specific purposes are defined in the [[Workspace]]'s [[Settings]]. You can obtain\r\n * a single `WorkspaceDb` using [[WorkspaceContainer.getWorkspaceDb]], but more commonly you will use [[Workspace.getWorkspaceDbs]] to obtain\r\n * a list of all of the `WorkspaceDb`s, sorted by priority, that correspond to a given [[SettingName]].\r\n *\r\n * You can create new `WorkspaceDb`s (or new versions of existing `WorkspaceDb`s) using [[WorkspaceEditor]].\r\n * @beta\r\n */\r\nexport interface WorkspaceDb {\r\n /** @internal */\r\n [_implementationProhibited]: unknown;\r\n /** The [[WorkspaceContainer]] in which this db resides. */\r\n readonly container: WorkspaceContainer;\r\n /** The base name of this WorkspaceDb, without version */\r\n readonly dbName: WorkspaceDbName;\r\n /** An event raised before this WorkspaceDb is [[close]]d. */\r\n readonly onClose: BeEvent<() => void>;\r\n /** The name by which the WorkspaceDb can be opened. This will be either a local file name or the name of a database in a [[CloudSqlite.CloudContainer]]. */\r\n readonly dbFileName: string;\r\n /** The underlying SQLite database that stores this WorkspaceDb's resources. */\r\n readonly sqliteDb: SQLiteDb;\r\n /** Whether the underlying [[sqliteDb]] is currently [[open]]ed. */\r\n readonly isOpen: boolean;\r\n /** The manifest that describes the contents and context of this WorkspaceDb. */\r\n readonly manifest: WorkspaceDbManifest;\r\n /** The version of this WorkspaceDb */\r\n readonly version: WorkspaceDbVersion;\r\n\r\n /** Open the underlying [[sqliteDb]] to perform a query. Generally WorkspaceDbs are left closed and opened/closed as they're used. However,\r\n * when there will be significant activity against a WorkspaceDb, it may be useful to open it before the operations and close it afterwards.\r\n * Methods like [[queryResources]] open the SQLite database automatically and [[close]] it before they return.\r\n */\r\n open(): void;\r\n\r\n /** Close the underlying [[sqliteDb]]. You should call this after [[open]]ing the database and completing your query. */\r\n close(): void;\r\n\r\n /** Look up a string resource by name, if one exists. */\r\n getString(rscName: WorkspaceResourceName): string | undefined;\r\n\r\n /** Look up a binary resource by name, if one exists. */\r\n getBlob(rscName: WorkspaceResourceName): Uint8Array | undefined;\r\n\r\n /** Get a BlobIO reader for a blob WorkspaceResource.\r\n * @note when finished, caller *must* call `close` on the BlobIO.\r\n * @internal\r\n */\r\n getBlobReader(rscName: WorkspaceResourceName): SQLiteDb.BlobIO;\r\n\r\n /**\r\n * Extract a local copy of a file resource from this WorkspaceDb, if present.\r\n * @param rscName The name of the file resource in the WorkspaceDb\r\n * @param targetFileName optional name for extracted file. Some applications require files in specific locations or filenames. If\r\n * you know the full path to use for the extracted file, you can supply it. Generally, it is best to *not* supply the filename and\r\n * keep the extracted files in the directory specified by [[WorkspaceContainer.filesDir]].\r\n * @returns the full path to a file on the local file system, or undefined if the no file named `rscName` exists.\r\n * @note The file is copied from the file into the local file system so it may be accessed directly. This happens only\r\n * as necessary, if the local file doesn't exist, or if it is out-of-date because it was updated in the file.\r\n * For this reason, you should not save the local file name, and instead call this method every time you access it, so its\r\n * content is always holds the correct version.\r\n * @note The filename will be a hash value, not the resource name.\r\n * @note Workspace resource files are set as read-only as they are copied from the file.\r\n * To edit them, you must first copy them to another location.\r\n */\r\n getFile(rscName: WorkspaceResourceName, targetFileName?: LocalFileName): LocalFileName | undefined;\r\n\r\n /**\r\n * Ensure that the contents of this `WorkspaceDb` are downloaded into the local cache so that it may be accessed offline.\r\n * Until the promise resolves, the `WorkspaceDb` is not fully downloaded, but it *may* be safely accessed during the download.\r\n * To determine the progress of the download, use the `localBlocks` and `totalBlocks` values returned by `CloudContainer.queryDatabase`.\r\n * @returns a [[CloudSqlite.CloudPrefetch]] object that can be used to await and/or cancel the prefetch.\r\n * @throws if this WorkspaceDb is not from a [[CloudSqlite.CloudContainer]].\r\n */\r\n prefetch(opts?: CloudSqlite.PrefetchProps): CloudSqlite.CloudPrefetch;\r\n\r\n /** Find resources of a particular type with names matching a specified pattern.\r\n * The matching resources will be supplied to [[WorkspaceDbQueryResourcesArgs.callbackk]].\r\n * @see [[Workspace.queryResources]] to query resources within multiple `WorkspaceDb`s.\r\n */\r\n queryResources(args: WorkspaceDbQueryResourcesArgs): void;\r\n\r\n /** @internal */\r\n queryFileResource(rscName: WorkspaceResourceName): { localFileName: LocalFileName, info: IModelJsNative.EmbedFileQuery } | undefined;\r\n}\r\n\r\n/** Options supplied to [[IModelHost.startup]] via [[IModelHostOptions.workspace]] to customize the initialization of [[IModelHost.appWorkspace]].\r\n * @beta\r\n */\r\nexport interface WorkspaceOpts {\r\n /** The local directory for non-cloud-based [[WorkspaceDb]] files. The [[Workspace]] API will look in this directory\r\n * for files named `${containerId}/${dbId}.itwin-workspace`.\r\n * @note if not supplied, defaults to \"iTwin/Workspace\" in the user-local folder.\r\n */\r\n containerDir?: LocalDirName;\r\n\r\n /** The name(s) of one or more local JSON files containing [[SettingsDictionary]]s to load when initializing the [[Workspace]]. */\r\n settingsFiles?: LocalFileName | LocalFileName[];\r\n}\r\n\r\n/** Arguments supplied to [[Workspace.getContainer]] and [[WorkspaceEditor.getContainer]].\r\n * @beta\r\n */\r\nexport interface GetWorkspaceContainerArgs extends WorkspaceContainerProps {\r\n /** Token required to access the container. */\r\n accessToken: AccessToken;\r\n}\r\n\r\n/**\r\n * Settings and resources that customize an application for the current session.\r\n * See the [learning article]($docs/learning/backend/Workspace) for a detailed overiew and examples.\r\n * @beta\r\n */\r\nexport interface Workspace {\r\n /** @internal */\r\n [_implementationProhibited]: unknown;\r\n\r\n /** The directory for local WorkspaceDb files with the name `${containerId}/${dbId}.itwin-workspace`.\r\n * @internal\r\n */\r\n readonly containerDir: LocalDirName;\r\n\r\n /** The current [[Settings]] for this Workspace */\r\n readonly settings: Settings;\r\n\r\n /** Get the cloud cache for cloud-based [[WorkspaceContainer]]s. */\r\n getCloudCache(): CloudSqlite.CloudCache;\r\n\r\n /** Search for a container previously opened by [[getContainer]] or [[getContainerAsync]].\r\n * @param containerId The id of the container\r\n * @returns the [[WorkspaceContainer]] for `containerId`, or `undefined` if no such container has been opened.\r\n * @internal\r\n */\r\n findContainer(containerId: WorkspaceContainerId): WorkspaceContainer | undefined;\r\n\r\n /** Obtain the [[WorkspaceContainer]] specified by `props`.\r\n * @param props The properties of the `WorkspaceContainer`, opening it if it is not already opened.\r\n * Otherwise it is created.\r\n * @note This function allows a `WorkspaceContainer.Props` without its [AccessToken]($bentley). It will attempt to obtain one from the [[BlobContainer]] service,\r\n * hence this function is async.\r\n * @see [[getContainer]] to obtain a container synchronously.\r\n */\r\n getContainerAsync(props: WorkspaceContainerProps): Promise<WorkspaceContainer>;\r\n\r\n /** Get a WorkspaceContainer with a supplied access token. This function is synchronous and may be used if:\r\n * - a valid [AccessToken]($bentley) is already available;\r\n * - the container has already been previously prefetched in another session (this is useful for offline usage); or\r\n * - the container is public and doesn't require an [AccessToken]($bentley).\r\n * @see [[getContainerAsync]] to obtain a container asynchronously if the above conditions do not apply.\r\n */\r\n getContainer(props: GetWorkspaceContainerArgs): WorkspaceContainer;\r\n\r\n /** Load a [[SettingsDictionary]] from the specified [[WorkspaceDb]] and add it to this workspace's current [[Settings]].\r\n * @note this function will load the dictionaries from the supplied list, and it will also call itself recursively for any entries in\r\n * the loaded Settings with the name [[WorkspaceSettingNames.settingsWorkspaces]]. In this manner, WorkspaceSettings may be \"chained\" together so that loading one\r\n * causes its \"dependent\" WorkspaceSettings to be loaded. Its `Promise` is resolved after all have been loaded (or failed to load).\r\n */\r\n loadSettingsDictionary(\r\n /** The properties of the [[WorkspaceDb]], plus the resourceName and [[SettingsPriority]]. May be either a single value or an array of them */\r\n props: WorkspaceDbSettingsProps | WorkspaceDbSettingsProps[],\r\n /** If present, an array that is populated with a list of problems while attempting to load the [[SettingsDictionary]](s). */\r\n problems?: WorkspaceDbLoadError[]\r\n ): Promise<void>;\r\n\r\n /** Get a single [[WorkspaceDb]]. */\r\n getWorkspaceDb(props: WorkspaceDbCloudProps): Promise<WorkspaceDb>;\r\n\r\n /**\r\n * Resolve the value of all [[Setting]]s from this workspace with the supplied `settingName` into an array of [[WorkspaceDbCloudProps]]\r\n * that can be used to query or load workspace resources. The settings must each be an array of type [[WorkspaceDbSettingsProps]].\r\n * The returned array will be sorted according to their [[SettingsPriority]], with the first entry being the highest priority [[WorkspaceDb]].\r\n * @note The list is built by combining, in order, all of the settings with the supplied [[SettingName]]. It may therefore include the\r\n * properties of same WorkspaceDb multiple times. This list is automatically de-duped by [[getWorkspaceDb]].\r\n * @note This function is rarely used directly. Usually it is called by [[getWorkspaceDbs]]. However, this function is synchronous and may sometimes\r\n * be useful for editors, tests, or diagnostics.\r\n */\r\n resolveWorkspaceDbSetting(\r\n /** the name of the setting. */\r\n settingName: SettingName,\r\n /** optional filter to choose specific WorkspaceDbs from the settings values. If present, only those WorkspaceDbs for which the filter returns `true` will be included. */\r\n filter?: Workspace.DbListFilter): WorkspaceDbCloudProps[];\r\n\r\n /**\r\n * Get a sorted array of [[WorkspaceDb]]s that can be used to query or load resources. If the arguments supply a `settingName`, this function will\r\n * use [[resolveWorkspaceDbSetting]] to get get the array of [[WorkspaceDbCloudProps]].\r\n * @returns A `Promise` resolving to an array of [[WorkspaceDb]]s sorted by [[SettingsPriority]] so that resources found in WorkspaceDbs earlier in the list take precedence\r\n * over ones with the same name in later WorkspaceDbs. No WorkspaceDb will appear more than once in the list.\r\n * @note this function may request an [AccessToken]($bentley) for each WorkspaceDb if necessary, and hence is asynchronous.\r\n */\r\n getWorkspaceDbs(\r\n args: Workspace.DbListOrSettingName & {\r\n /** if supplied, this array is populated with a list of problems (e.g. no read permission) attempting to load WorkspacesDbs. */\r\n problems?: WorkspaceDbLoadError[];\r\n /** only valid when called with a settingName, if so passed as `filter` argument to [[resolveWorkspaceDbSetting]] */\r\n filter?: Workspace.DbListFilter;\r\n }): Promise<WorkspaceDb[]>;\r\n}\r\n\r\n/**\r\n * A WorkspaceContainer is a type of [[CloudSqlite.CloudContainer]] that holds one or more [[WorkspaceDb]]s. Normally a WorkspaceContainer will hold (many versions of) a single WorkspaceDb.\r\n * Each version of a WorkspaceDb is treated as immutable after it is created and is stored in the WorkspaceContainer indefinitely. That means that\r\n * older versions of the WorkspaceDb may continue to be used, for example by archived projects. For programmers familiar with [NPM](https://www.npmjs.com/), this is conceptually\r\n * similar and versioning follows the same rules as NPM using [Semantic Versioning](https://semver.org/).\r\n * @note It is possible to store more than one WorkspaceDb in the same WorkspaceContainer, but access rights are administered per WorkspaceContainer.\r\n * That is, if a user has rights to access a WorkspaceContainer, that right applies to all WorkspaceDbs in the WorkspaceContainer.\r\n * @note Not every WorkspaceContainer is associated with a [[CloudSqlite.CloudContainer]] - WorkspaceContainers may also be loaded from the local file system.\r\n * In this case, [[cloudContainer]] will be `undefined`.\r\n * @see [[Workspace.getContainer]] and [[Workspace.getContainerAsync]] to load a container.\r\n * @beta\r\n */\r\nexport interface WorkspaceContainer {\r\n /** @internal */\r\n [_implementationProhibited]: unknown;\r\n /** the local directory where this WorkspaceContainer will store temporary files extracted for file-resources.\r\n * @internal\r\n */\r\n readonly filesDir: LocalDirName;\r\n /** The workspace into which this container was loaded. */\r\n readonly workspace: Workspace;\r\n /** Cloud container for this WorkspaceContainer, or `undefined` if this is a local WorkspaceContainer. */\r\n readonly cloudContainer?: CloudSqlite.CloudContainer;\r\n /** Properties supplied when this container was loaded */\r\n readonly fromProps: WorkspaceContainerProps;\r\n\r\n /** @internal */\r\n addWorkspaceDb(toAdd: WorkspaceDb): void;\r\n\r\n /**\r\n * Find the fully-qualified name of a [[WorkspaceDb]] satisfying the name and version criteria specified by `props`.\r\n * @throws Error if no version satisfying the criteria exists.\r\n */\r\n resolveDbFileName(props: WorkspaceDbProps): WorkspaceDbFullName;\r\n\r\n /** Obtain a [[WorkspaceDb]] satisfying the name and version criteria specified by `props`. */\r\n getWorkspaceDb(props?: WorkspaceDbProps): WorkspaceDb;\r\n\r\n /** Close and remove a currently opened [[WorkspaceDb]] from this Workspace.\r\n * @internal\r\n */\r\n closeWorkspaceDb(container: WorkspaceDb): void;\r\n}\r\n\r\nfunction makeSettingName(name: string) {\r\n return `${\"itwin/core/workspace\"}/${name}`;\r\n}\r\n\r\n/** The names of various [[Setting]]s with special meaning to the [[Workspace]] system.\r\n * @beta\r\n */\r\nexport namespace WorkspaceSettingNames {\r\n /** The name of a setting that, when present in a [[WorkspaceDb]] loaded by [[Workspace.loadSettingsDictionary]], will automatically\r\n * be used to find and load additional [[SettingsDictionary]]'s in other [[WorkspaceDb]]s. This permits you to chain the settings inside on [[WorkspaceDb]]\r\n * to others upon which they depend.\r\n * This setting's value is an array of [[WorkspaceDbSettingsProps]]s.\r\n */\r\n export const settingsWorkspaces = makeSettingName(\"settingsWorkspaces\");\r\n}\r\n\r\n/** A function supplied as part of a [[QueryWorkspaceResourcesArgs]] to iterate the resources retrieved by [[Workspace.queryResources]].\r\n * The `resources` object should only be used inside the function - it is an error to attempt to iterate it after the function returns.\r\n * @beta\r\n */\r\nexport type QueryWorkspaceResourcesCallback = (resources: Iterable<{ name: string, db: WorkspaceDb }>) => void;\r\n\r\n/** Arguments supplied to [[Workspace.queryResources]] defining the query criteria and the list of [[WorkspaceDb]]s to query.\r\n * @beta\r\n */\r\nexport interface QueryWorkspaceResourcesArgs {\r\n /** The list of `WorkspaceDb`s to query, in the order in which they are to be queried.\r\n * @see [[Workspace.resolveWorkspaceDbSetting]] or [[Workspace.getWorkspaceDbs]] to obtain an appropriate list of `WorkspaceDb`s.\r\n */\r\n dbs: WorkspaceDb[];\r\n /** The type of resource to query. */\r\n type?: \"string\" | \"blob\";\r\n /** A pattern against which to compare the name of each resource, using [[nameCompare]] as the comparison operator.\r\n * Only resources whose names match the pattern will be included in the query results.\r\n */\r\n namePattern?: string;\r\n /** The comparison operator by which to compare the name of each resource to [[namePattern]].\r\n * Only resources whose names match the pattern will be included in the query results.\r\n * Ignored i [[namePattern]] is undefined.\r\n */\r\n nameCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"<\" | \">\";\r\n /** A function invoked to process the resources that match the query criteria. */\r\n callback: QueryWorkspaceResourcesCallback;\r\n}\r\n\r\nfunction getWorkspaceResource(dbs: WorkspaceDb[], name: string, type: \"string\" | \"blob\"): string | Uint8Array | undefined {\r\n for (const db of dbs) {\r\n const val = type === \"blob\" ? db.getBlob(name) : db.getString(name);\r\n if (undefined !== val) {\r\n return val;\r\n }\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\n/** Arguments supplied to [[Workspace.getStringResource]] and [[WOrkspace.getBlobResource]].\r\n * @beta\r\n */\r\nexport interface GetWorkspaceResourceArgs {\r\n /** The list of `WorkspaceDb`s to search, in the order in which they are to be searched.\r\n * @see [[Workspace.resolveWorkspaceDbSetting]] or [[Workspace.getWorkspaceDbs]] to obtain an appropriate list of `WorkspaceDb`s.\r\n */\r\n dbs: WorkspaceDb[];\r\n /** The name of the resource to find. */\r\n name: WorkspaceResourceName;\r\n}\r\n\r\n/** @beta */\r\nexport namespace Workspace {\r\n /** A function invoked to handle exceptions produced while loading workspace data.\r\n * Applications can override this function to notify the user and/or attempt to diagnose the problem.\r\n * The default implementation simply logs each exception.\r\n */\r\n export let exceptionDiagnosticFn = (e: WorkspaceDbLoadErrors) => { // eslint-disable-line prefer-const\r\n if (e instanceof Error)\r\n Logger.logException(BackendLoggerCategory.Workspace, e);\r\n else\r\n UnexpectedErrors.handle(e);\r\n };\r\n\r\n /** Arguments supplied to [[Workspace.onSettingsDictionaryLoadedFn]] for every [[SettingsDictionary]] that is loaded from a [[WorkspaceDb]]. */\r\n export interface SettingsDictionaryLoaded {\r\n /** The dictionary that was loaded */\r\n dict: SettingsDictionary;\r\n /** The WorkspaceDb from which the dictionary was loaded. */\r\n from: WorkspaceDb;\r\n }\r\n\r\n /** A function invoked each time any [[SettingsDictionary]] is loaded from a [[WorkspaceDb]].\r\n * Applications can override this function to notify the user and/or record diagnostics.\r\n * The default implementation simply records an information message in the [Logger]($bentley).\r\n */\r\n export let onSettingsDictionaryLoadedFn = (loaded: SettingsDictionaryLoaded) => { // eslint-disable-line prefer-const\r\n Logger.logInfo(BackendLoggerCategory.Workspace, `loaded setting dictionary ${loaded.dict.props.name} from ${loaded.from.dbFileName}`);\r\n };\r\n\r\n /** Either an array of [[WorkspaceDbCloudProps]] or the name of a [[Setting]] that resolves to an array of [[WorkspaceDbCloudProps]].\r\n * Used by [[Workspace.getWorkspaceDbs]].\r\n */\r\n export type DbListOrSettingName = { readonly dbs: WorkspaceDbCloudProps[], readonly settingName?: never } | { readonly settingName: SettingName, readonly dbs?: never };\r\n\r\n /** In arguments supplied to [[Workspace.getWorkspaceDbs]] and [[Workspace.resolveWorkspaceDbSetting]], an optional function used to exclude some\r\n * [[WorkspaceDb]]s. Only those [[WorkspaceDb]]s for which the function returns `true` will be included.\r\n */\r\n export type DbListFilter = (\r\n /** The properties of the WorkspaceDb to be returned */\r\n dbProp: WorkspaceDbCloudProps,\r\n /** The SettingsDictionary holding the [[WorkspaceSettingNames.settingsWorkspace]] setting. May be used, for example, to determine the\r\n * [[SettingsPriority]] of the dictionary.\r\n */\r\n dict: SettingsDictionary\r\n ) => boolean;\r\n\r\n /** Searches a list of [[WorkspaceDb]]s for a string resource of a given name.\r\n * The list is searched in order, and the first resource with the request name is returned.\r\n * If no such resource exists, the function returns `undefined`.\r\n * @see [[WorkspaceDb.getString]] if you only need to search a single `WorkspaceDb`.\r\n * @beta\r\n */\r\n export function getStringResource(args: GetWorkspaceResourceArgs): string | undefined {\r\n return getWorkspaceResource(args.dbs, args.name, \"string\") as string | undefined;\r\n }\r\n\r\n /** Searches a list of [[WorkspaceDb]]s for a blob resource of a given name.\r\n * The list is searched in order, and the first resource with the request name is returned.\r\n * If no such resource exists, the function returns `undefined`.\r\n * @see [[WorkspaceDb.getblob]] if you only need to search a single `WorkspaceDb`.\r\n * @beta\r\n */\r\n export function getBlobResource(args: GetWorkspaceResourceArgs): Uint8Array | undefined {\r\n return getWorkspaceResource(args.dbs, args.name, \"blob\") as Uint8Array | undefined;\r\n }\r\n\r\n /** Query a list of [[WorkspaceDb]]s to find resources of a particular type with names matching a specified pattern.\r\n * @see [[WorkspaceDb.queryResources]] if you only need to query a single `WorkspaceDb`.\r\n * @beta\r\n */\r\n export function queryResources(args: QueryWorkspaceResourcesArgs): void {\r\n const resources: Array<{ name: string, db: WorkspaceDb }> = [];\r\n for (const db of args.dbs) {\r\n db.queryResources({\r\n type: args.type,\r\n namePattern: args.namePattern,\r\n nameCompare: args.nameCompare,\r\n callback: (names) => {\r\n for (const name of names) {\r\n resources.push({ db, name });\r\n }\r\n },\r\n });\r\n }\r\n\r\n args.callback(resources);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceEditor.js","sourceRoot":"","sources":["../../../src/workspace/WorkspaceEditor.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAUH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAGhE,YAAY;AACZ,MAAM,KAAW,eAAe,CAgB/B;AAhBD,WAAiB,eAAe;IAC9B;;;;OAIG;IACH,SAAgB,SAAS;QACvB,OAAO,wBAAwB,EAAE,CAAC;IACpC,CAAC;IAFe,yBAAS,YAExB,CAAA;IAED;;OAEG;IACH,SAAgB,aAAa,CAAC,IAAqE;QACjG,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC;IAFe,6BAAa,gBAE5B,CAAA;AACH,CAAC,EAhBgB,eAAe,KAAf,eAAe,QAgB/B","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 Workspace\n */\n\nimport { LocalFileName } from \"@itwin/core-common\";\nimport { SQLiteDb } from \"../SQLiteDb\";\nimport { SettingsContainer } from \"./Settings\";\nimport { BlobContainer } from \"../BlobContainerService\";\nimport {\n GetWorkspaceContainerArgs, Workspace, WorkspaceContainer, WorkspaceContainerProps, WorkspaceDb, WorkspaceDbCloudProps, WorkspaceDbManifest, WorkspaceDbName, WorkspaceDbNameAndVersion,\n WorkspaceDbProps, WorkspaceDbVersion, WorkspaceResourceName,\n} from \"./Workspace\";\nimport { WorkspaceSqliteDb } from \"../internal/workspace/WorkspaceSqliteDb\";\nimport { constructWorkspaceEditor } from \"../internal/workspace/WorkspaceImpl\";\nimport { _implementationProhibited } from \"../internal/Symbols\";\nimport { CloudSqlite } from \"../CloudSqlite\";\n\n/** @beta */\nexport namespace WorkspaceEditor {\n /**\n * Create a new [[WorkspaceEditor]] for creating new versions of [[WorkspaceDb]]s.\n * @note the caller becomes the owner of the Workspace.Editor and is responsible for calling [[WorkspaceEditor.close]] on it when they are finished using it.\n * @note It is illegal to have more than one Workspace.Editor active in a single session.\n */\n export function construct(): WorkspaceEditor {\n return constructWorkspaceEditor();\n }\n\n /**\n * Create a new, empty, [[EditableWorkspaceDb]] file on the local filesystem for importing [[Workspace]] resources.\n */\n export function createEmptyDb(args: { localFileName: LocalFileName, manifest: WorkspaceDbManifest }): void {\n WorkspaceSqliteDb.createNewDb(args.localFileName, args);\n }\n}\n\n/** Arguments supplied to [[WorkspaceEditor.createNewCloudContainer]] to create a new [[EditableWorkspaceContainer]].\n * @beta\n */\nexport interface CreateNewWorkspaceContainerArgs {\n /**\n * The scope of the container. This determines the ownership of the container, how RBAC rights are assigned,\n * and the location of the datacenter\n */\n scope: BlobContainer.Scope;\n /** The manifest to be stored in the default WorkspaceDb in the new container. */\n manifest: WorkspaceDbManifest;\n /** Metadata stored by the BlobContainer service */\n metadata: Omit<BlobContainer.Metadata, \"containerType\">;\n /** The name of the default [[WorkspaceDb]] created inside the new container.\n * Default: \"workspace-db\";\n */\n dbName?: WorkspaceDbName;\n}\n\n/**\n * A [[WorkspaceContainer]] opened for editing by a [[WorkspaceEditor]].\n * You can create new [[WorkspaceDb]]s or new versions of existing [[WorkspaceDb]]s inside it.\n * Before actually making any changes to the container's contents, you must first obtain an exclusive write lock on it via\n * [[acquireWriteLock]]. Only one user can hold the write lock at any given time. When you have finished making changes,\n * you can use [[releaseWriteLock]] to publish your changes, or [[abandonChanges]] to discard them.\n * @beta\n */\nexport interface EditableWorkspaceContainer extends WorkspaceContainer {\n /**\n * Create a copy of an existing [[WorkspaceDb]] in this container with a new [[WorkspaceDbVersion]].\n * The copy should be modified with new content before the write lock is released,\n * and thereafter may never be modified again.\n * @note The copy actually shares all of the data with the original, but with copy-on-write if/when data in the new WorkspaceDb is modified.\n * @param props - The properties that determine the source WorkspaceDb to serve as the basis for the new version.\n * @returns A promise that resolves to an object containing the old and new WorkspaceDb names and versions.\n */\n createNewWorkspaceDbVersion(props: CreateNewWorkspaceDbVersionArgs): Promise<{ oldDb: WorkspaceDbNameAndVersion, newDb: WorkspaceDbNameAndVersion }>;\n\n /**\n * Create a new, empty [[WorkspaceDb]].\n * @param args - The arguments for creating the new WorkspaceDb.\n * @returns A promise that resolves to an EditableWorkspaceDb.\n */\n createDb(args: { dbName?: WorkspaceDbName, version?: WorkspaceDbVersion, manifest: WorkspaceDbManifest }): Promise<EditableWorkspaceDb>;\n\n /**\n * Get the cloud properties of this container.\n */\n readonly cloudProps: WorkspaceContainerProps | undefined;\n\n /**\n * Get an editable [[WorkspaceDb]] to add, delete, or update resources *within a newly created version* of a WorkspaceDb.\n * @param props - The properties of the WorkspaceDb.\n */\n getEditableDb(props: WorkspaceDbProps): EditableWorkspaceDb;\n\n /**\n * Acquire the write lock on the container. Use [[releaseWriteLock]] to release the lock after publishing your changes, or\n * [[abandonChanges]] to release the lock and discard your changes.\n * Only one use can hold the write lock at any given time. However, readers can continue to read the published contents of the container while\n * a writer holds the write lock. Readers will only see the writer's changes after they are published by [[releaseWriteLock]].\n * @param user - The name of the user acquiring the write lock.\n */\n acquireWriteLock(user: string): void;\n\n /**\n * Release the write lock on the container. This should be called after all changes to the container's contents are complete. It\n * publishes and uploads the changes made to any [[WorkspaceDb]]s while the lock was held, after which those dbs become immutable.\n */\n releaseWriteLock(): void;\n\n /**\n * Abandon any changes made to the container and release the write lock. Any newly created versions of WorkspaceDbs are discarded.\n */\n abandonChanges(): void;\n}\n\n/**\n * Arguments supplied to [[Workspace.createNewWorkspaceDbVersion]].\n * @beta\n */\nexport interface CreateNewWorkspaceDbVersionArgs {\n /**\n * The properties that determine the source [[WorkspaceDb]] to serve as the basis for the new version.\n * This is usually the latest version, but it is possible to create patches to older versions.\n */\n fromProps?: WorkspaceDbProps;\n /** The type of version increment to apply to the source version. */\n versionType: CloudSqlite.SemverIncrement;\n /** For prerelease versions, a string that becomes part of the version name. */\n identifier?: string;\n}\n\n/**\n * An editable [[WorkspaceDb]]. This is used only by tools to allow administrators to create and modify WorkspaceDbs.\n * For cloud-based WorkspaceDbs, the container's write token must be obtained via [[EditableWorkspaceContainer.acquireWriteLock]] before the methods in this interface may be used.\n * Normally, only admins will have write access to a [[Workspace]].\n * Only one admin at a time may be editing a Workspace.\n * @beta\n */\nexport interface EditableWorkspaceDb extends WorkspaceDb {\n readonly container: EditableWorkspaceContainer;\n /**\n * The cloud properties of the [[WorkspaceDb]], if this is a cloud-based WorkspaceDb.\n */\n get cloudProps(): WorkspaceDbCloudProps | undefined;\n\n /**\n * Update the contents of the manifest in this WorkspaceDb.\n * @param manifest - The updated manifest.\n */\n updateManifest(manifest: WorkspaceDbManifest): void;\n\n /**\n * Add or update a resource in this WorkspaceDb that can be loaded as a [[SettingsDictionary]].\n * The `settings` will be stored as stringified JSON.\n * @param settings - The settings object to add or update.\n * @param rscName - The name of the settings resource. Defaults to \"settingsDictionary\" if undefined.\n */\n updateSettingsResource(settings: SettingsContainer, rscName?: string): void;\n\n /**\n * Add a new string resource to this WorkspaceDb.\n * @param rscName - The name of the string resource.\n * @param val - The string to save.\n * @throws if a string resource named `rscName` already exists.\n */\n addString(rscName: WorkspaceResourceName, val: string): void;\n\n /**\n * Update an existing string resource with a new value, or add it if it does not exist.\n * @param rscName - The name of the string resource.\n * @param val - The new value.\n */\n updateString(rscName: WorkspaceResourceName, val: string): void;\n\n /**\n * Remove a string resource.\n * @param rscName - The name of the string resource to remove.\n */\n removeString(rscName: WorkspaceResourceName): void;\n\n /**\n * Add a new binary resource to this WorkspaceDb.\n * @param rscName - The name of the blob resource.\n * @param val - The blob to save.\n * @throws if a blob resource named `rscName` already exists.\n */\n addBlob(rscName: WorkspaceResourceName, val: Uint8Array): void;\n\n /**\n * Update an existing blob resource with a new value, or add it if it does not exist.\n * @param rscName - The name of the blob resource.\n * @param val - The new value.\n */\n updateBlob(rscName: WorkspaceResourceName, val: Uint8Array): void;\n\n /**\n * Get a BlobIO writer for a previously-added blob WorkspaceResource.\n * @param rscName - The name of the blob resource.\n * @returns A BlobIO writer.\n * @note After writing is complete, the caller must call `close` on the BlobIO and must call `saveChanges` on the `db`.\n * @internal\n */\n getBlobWriter(rscName: WorkspaceResourceName): SQLiteDb.BlobIO;\n\n /**\n * Remove a binary resource.\n * @param rscName - The name of the blob resource to remove.\n */\n removeBlob(rscName: WorkspaceResourceName): void;\n\n /**\n * Copy the contents of an existing local file into this WorkspaceDb as a file resource.\n * @param rscName - The name of the file resource.\n * @param localFileName - The name of a local file to be read.\n * @param fileExt - The extension to be appended to the generated fileName when this WorkspaceDb is extracted from the WorkspaceDb.\n * By default, the characters after the last \".\" in `localFileName` are used. Pass this argument to override that.\n */\n addFile(rscName: WorkspaceResourceName, localFileName: LocalFileName, fileExt?: string): void;\n\n /**\n * Replace an existing file resource with the contents of another local file.\n * @param rscName - The name of the file resource.\n * @param localFileName - The name of a local file to be read.\n * @throws If the file resource does not exist.\n */\n updateFile(rscName: WorkspaceResourceName, localFileName: LocalFileName): void;\n\n /**\n * Remove a file resource.\n * @param rscName - The name of the file resource to remove.\n */\n removeFile(rscName: WorkspaceResourceName): void;\n}\n\n/** An object that permits administrators to modify the contents of a [[Workspace]].\n * Use [[WorkspaceEditor.construct]] to obtain a WorkspaceEditor, and [[close]] when finished using it.\n * Only one WorkspaceEditor may be in use at any given time.\n * Use [[getContainer]] to edit an existing [[WorkspaceContainer]], or [[createNewCloudContainer]] to create a new [[WorkspaceContainer]].\n * @beta\n */\nexport interface WorkspaceEditor {\n /** @internal */\n [_implementationProhibited]: unknown;\n\n /**\n * The workspace dedicated to this editor.\n * @note This workspace is independent from [[IModelHost.appWorkspace]] and all [[IModelDb.workspace]]s. It has its own [[Settings]] and [[WorkspaceDb]]s.\n */\n readonly workspace: Workspace;\n\n /**\n * Retrieves a container for the editor with the specified properties and access token.\n */\n getContainer(args: GetWorkspaceContainerArgs): EditableWorkspaceContainer;\n\n /**\n * Asynchronously retrieves a container for the editor with the specified properties.\n */\n getContainerAsync(props: WorkspaceContainerProps): Promise<EditableWorkspaceContainer>;\n\n /**\n * Creates a new cloud container for holding WorkspaceDbs, from the [[BlobContainer]] service.\n * @note The current user must have administrator rights for the iTwin for the container.\n */\n createNewCloudContainer(args: CreateNewWorkspaceContainerArgs): Promise<EditableWorkspaceContainer>;\n\n /**\n * Closes this editor. All [[workspace]] containers are dropped.\n */\n close(): void;\n}\n"]}
1
+ {"version":3,"file":"WorkspaceEditor.js","sourceRoot":"","sources":["../../../src/workspace/WorkspaceEditor.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAUH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAGhE,YAAY;AACZ,MAAM,KAAW,eAAe,CAgB/B;AAhBD,WAAiB,eAAe;IAC9B;;;;OAIG;IACH,SAAgB,SAAS;QACvB,OAAO,wBAAwB,EAAE,CAAC;IACpC,CAAC;IAFe,yBAAS,YAExB,CAAA;IAED;;OAEG;IACH,SAAgB,aAAa,CAAC,IAAqE;QACjG,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC;IAFe,6BAAa,gBAE5B,CAAA;AACH,CAAC,EAhBgB,eAAe,KAAf,eAAe,QAgB/B","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 Workspace\r\n */\r\n\r\nimport { LocalFileName } from \"@itwin/core-common\";\r\nimport { SQLiteDb } from \"../SQLiteDb\";\r\nimport { SettingsContainer } from \"./Settings\";\r\nimport { BlobContainer } from \"../BlobContainerService\";\r\nimport {\r\n GetWorkspaceContainerArgs, Workspace, WorkspaceContainer, WorkspaceContainerProps, WorkspaceDb, WorkspaceDbCloudProps, WorkspaceDbManifest, WorkspaceDbName, WorkspaceDbNameAndVersion,\r\n WorkspaceDbProps, WorkspaceDbVersion, WorkspaceResourceName,\r\n} from \"./Workspace\";\r\nimport { WorkspaceSqliteDb } from \"../internal/workspace/WorkspaceSqliteDb\";\r\nimport { constructWorkspaceEditor } from \"../internal/workspace/WorkspaceImpl\";\r\nimport { _implementationProhibited } from \"../internal/Symbols\";\r\nimport { CloudSqlite } from \"../CloudSqlite\";\r\n\r\n/** @beta */\r\nexport namespace WorkspaceEditor {\r\n /**\r\n * Create a new [[WorkspaceEditor]] for creating new versions of [[WorkspaceDb]]s.\r\n * @note the caller becomes the owner of the Workspace.Editor and is responsible for calling [[WorkspaceEditor.close]] on it when they are finished using it.\r\n * @note It is illegal to have more than one Workspace.Editor active in a single session.\r\n */\r\n export function construct(): WorkspaceEditor {\r\n return constructWorkspaceEditor();\r\n }\r\n\r\n /**\r\n * Create a new, empty, [[EditableWorkspaceDb]] file on the local filesystem for importing [[Workspace]] resources.\r\n */\r\n export function createEmptyDb(args: { localFileName: LocalFileName, manifest: WorkspaceDbManifest }): void {\r\n WorkspaceSqliteDb.createNewDb(args.localFileName, args);\r\n }\r\n}\r\n\r\n/** Arguments supplied to [[WorkspaceEditor.createNewCloudContainer]] to create a new [[EditableWorkspaceContainer]].\r\n * @beta\r\n */\r\nexport interface CreateNewWorkspaceContainerArgs {\r\n /**\r\n * The scope of the container. This determines the ownership of the container, how RBAC rights are assigned,\r\n * and the location of the datacenter\r\n */\r\n scope: BlobContainer.Scope;\r\n /** The manifest to be stored in the default WorkspaceDb in the new container. */\r\n manifest: WorkspaceDbManifest;\r\n /** Metadata stored by the BlobContainer service */\r\n metadata: Omit<BlobContainer.Metadata, \"containerType\">;\r\n /** The name of the default [[WorkspaceDb]] created inside the new container.\r\n * Default: \"workspace-db\";\r\n */\r\n dbName?: WorkspaceDbName;\r\n}\r\n\r\n/**\r\n * A [[WorkspaceContainer]] opened for editing by a [[WorkspaceEditor]].\r\n * You can create new [[WorkspaceDb]]s or new versions of existing [[WorkspaceDb]]s inside it.\r\n * Before actually making any changes to the container's contents, you must first obtain an exclusive write lock on it via\r\n * [[acquireWriteLock]]. Only one user can hold the write lock at any given time. When you have finished making changes,\r\n * you can use [[releaseWriteLock]] to publish your changes, or [[abandonChanges]] to discard them.\r\n * @beta\r\n */\r\nexport interface EditableWorkspaceContainer extends WorkspaceContainer {\r\n /**\r\n * Create a copy of an existing [[WorkspaceDb]] in this container with a new [[WorkspaceDbVersion]].\r\n * The copy should be modified with new content before the write lock is released,\r\n * and thereafter may never be modified again.\r\n * @note The copy actually shares all of the data with the original, but with copy-on-write if/when data in the new WorkspaceDb is modified.\r\n * @param props - The properties that determine the source WorkspaceDb to serve as the basis for the new version.\r\n * @returns A promise that resolves to an object containing the old and new WorkspaceDb names and versions.\r\n */\r\n createNewWorkspaceDbVersion(props: CreateNewWorkspaceDbVersionArgs): Promise<{ oldDb: WorkspaceDbNameAndVersion, newDb: WorkspaceDbNameAndVersion }>;\r\n\r\n /**\r\n * Create a new, empty [[WorkspaceDb]].\r\n * @param args - The arguments for creating the new WorkspaceDb.\r\n * @returns A promise that resolves to an EditableWorkspaceDb.\r\n */\r\n createDb(args: { dbName?: WorkspaceDbName, version?: WorkspaceDbVersion, manifest: WorkspaceDbManifest }): Promise<EditableWorkspaceDb>;\r\n\r\n /**\r\n * Get the cloud properties of this container.\r\n */\r\n readonly cloudProps: WorkspaceContainerProps | undefined;\r\n\r\n /**\r\n * Get an editable [[WorkspaceDb]] to add, delete, or update resources *within a newly created version* of a WorkspaceDb.\r\n * @param props - The properties of the WorkspaceDb.\r\n */\r\n getEditableDb(props: WorkspaceDbProps): EditableWorkspaceDb;\r\n\r\n /**\r\n * Acquire the write lock on the container. Use [[releaseWriteLock]] to release the lock after publishing your changes, or\r\n * [[abandonChanges]] to release the lock and discard your changes.\r\n * Only one use can hold the write lock at any given time. However, readers can continue to read the published contents of the container while\r\n * a writer holds the write lock. Readers will only see the writer's changes after they are published by [[releaseWriteLock]].\r\n * @param user - The name of the user acquiring the write lock.\r\n */\r\n acquireWriteLock(user: string): void;\r\n\r\n /**\r\n * Release the write lock on the container. This should be called after all changes to the container's contents are complete. It\r\n * publishes and uploads the changes made to any [[WorkspaceDb]]s while the lock was held, after which those dbs become immutable.\r\n */\r\n releaseWriteLock(): void;\r\n\r\n /**\r\n * Abandon any changes made to the container and release the write lock. Any newly created versions of WorkspaceDbs are discarded.\r\n */\r\n abandonChanges(): void;\r\n}\r\n\r\n/**\r\n * Arguments supplied to [[Workspace.createNewWorkspaceDbVersion]].\r\n * @beta\r\n */\r\nexport interface CreateNewWorkspaceDbVersionArgs {\r\n /**\r\n * The properties that determine the source [[WorkspaceDb]] to serve as the basis for the new version.\r\n * This is usually the latest version, but it is possible to create patches to older versions.\r\n */\r\n fromProps?: WorkspaceDbProps;\r\n /** The type of version increment to apply to the source version. */\r\n versionType: CloudSqlite.SemverIncrement;\r\n /** For prerelease versions, a string that becomes part of the version name. */\r\n identifier?: string;\r\n}\r\n\r\n/**\r\n * An editable [[WorkspaceDb]]. This is used only by tools to allow administrators to create and modify WorkspaceDbs.\r\n * For cloud-based WorkspaceDbs, the container's write token must be obtained via [[EditableWorkspaceContainer.acquireWriteLock]] before the methods in this interface may be used.\r\n * Normally, only admins will have write access to a [[Workspace]].\r\n * Only one admin at a time may be editing a Workspace.\r\n * @beta\r\n */\r\nexport interface EditableWorkspaceDb extends WorkspaceDb {\r\n readonly container: EditableWorkspaceContainer;\r\n /**\r\n * The cloud properties of the [[WorkspaceDb]], if this is a cloud-based WorkspaceDb.\r\n */\r\n get cloudProps(): WorkspaceDbCloudProps | undefined;\r\n\r\n /**\r\n * Update the contents of the manifest in this WorkspaceDb.\r\n * @param manifest - The updated manifest.\r\n */\r\n updateManifest(manifest: WorkspaceDbManifest): void;\r\n\r\n /**\r\n * Add or update a resource in this WorkspaceDb that can be loaded as a [[SettingsDictionary]].\r\n * The `settings` will be stored as stringified JSON.\r\n * @param settings - The settings object to add or update.\r\n * @param rscName - The name of the settings resource. Defaults to \"settingsDictionary\" if undefined.\r\n */\r\n updateSettingsResource(settings: SettingsContainer, rscName?: string): void;\r\n\r\n /**\r\n * Add a new string resource to this WorkspaceDb.\r\n * @param rscName - The name of the string resource.\r\n * @param val - The string to save.\r\n * @throws if a string resource named `rscName` already exists.\r\n */\r\n addString(rscName: WorkspaceResourceName, val: string): void;\r\n\r\n /**\r\n * Update an existing string resource with a new value, or add it if it does not exist.\r\n * @param rscName - The name of the string resource.\r\n * @param val - The new value.\r\n */\r\n updateString(rscName: WorkspaceResourceName, val: string): void;\r\n\r\n /**\r\n * Remove a string resource.\r\n * @param rscName - The name of the string resource to remove.\r\n */\r\n removeString(rscName: WorkspaceResourceName): void;\r\n\r\n /**\r\n * Add a new binary resource to this WorkspaceDb.\r\n * @param rscName - The name of the blob resource.\r\n * @param val - The blob to save.\r\n * @throws if a blob resource named `rscName` already exists.\r\n */\r\n addBlob(rscName: WorkspaceResourceName, val: Uint8Array): void;\r\n\r\n /**\r\n * Update an existing blob resource with a new value, or add it if it does not exist.\r\n * @param rscName - The name of the blob resource.\r\n * @param val - The new value.\r\n */\r\n updateBlob(rscName: WorkspaceResourceName, val: Uint8Array): void;\r\n\r\n /**\r\n * Get a BlobIO writer for a previously-added blob WorkspaceResource.\r\n * @param rscName - The name of the blob resource.\r\n * @returns A BlobIO writer.\r\n * @note After writing is complete, the caller must call `close` on the BlobIO and must call `saveChanges` on the `db`.\r\n * @internal\r\n */\r\n getBlobWriter(rscName: WorkspaceResourceName): SQLiteDb.BlobIO;\r\n\r\n /**\r\n * Remove a binary resource.\r\n * @param rscName - The name of the blob resource to remove.\r\n */\r\n removeBlob(rscName: WorkspaceResourceName): void;\r\n\r\n /**\r\n * Copy the contents of an existing local file into this WorkspaceDb as a file resource.\r\n * @param rscName - The name of the file resource.\r\n * @param localFileName - The name of a local file to be read.\r\n * @param fileExt - The extension to be appended to the generated fileName when this WorkspaceDb is extracted from the WorkspaceDb.\r\n * By default, the characters after the last \".\" in `localFileName` are used. Pass this argument to override that.\r\n */\r\n addFile(rscName: WorkspaceResourceName, localFileName: LocalFileName, fileExt?: string): void;\r\n\r\n /**\r\n * Replace an existing file resource with the contents of another local file.\r\n * @param rscName - The name of the file resource.\r\n * @param localFileName - The name of a local file to be read.\r\n * @throws If the file resource does not exist.\r\n */\r\n updateFile(rscName: WorkspaceResourceName, localFileName: LocalFileName): void;\r\n\r\n /**\r\n * Remove a file resource.\r\n * @param rscName - The name of the file resource to remove.\r\n */\r\n removeFile(rscName: WorkspaceResourceName): void;\r\n}\r\n\r\n/** An object that permits administrators to modify the contents of a [[Workspace]].\r\n * Use [[WorkspaceEditor.construct]] to obtain a WorkspaceEditor, and [[close]] when finished using it.\r\n * Only one WorkspaceEditor may be in use at any given time.\r\n * Use [[getContainer]] to edit an existing [[WorkspaceContainer]], or [[createNewCloudContainer]] to create a new [[WorkspaceContainer]].\r\n * @beta\r\n */\r\nexport interface WorkspaceEditor {\r\n /** @internal */\r\n [_implementationProhibited]: unknown;\r\n\r\n /**\r\n * The workspace dedicated to this editor.\r\n * @note This workspace is independent from [[IModelHost.appWorkspace]] and all [[IModelDb.workspace]]s. It has its own [[Settings]] and [[WorkspaceDb]]s.\r\n */\r\n readonly workspace: Workspace;\r\n\r\n /**\r\n * Retrieves a container for the editor with the specified properties and access token.\r\n */\r\n getContainer(args: GetWorkspaceContainerArgs): EditableWorkspaceContainer;\r\n\r\n /**\r\n * Asynchronously retrieves a container for the editor with the specified properties.\r\n */\r\n getContainerAsync(props: WorkspaceContainerProps): Promise<EditableWorkspaceContainer>;\r\n\r\n /**\r\n * Creates a new cloud container for holding WorkspaceDbs, from the [[BlobContainer]] service.\r\n * @note The current user must have administrator rights for the iTwin for the container.\r\n */\r\n createNewCloudContainer(args: CreateNewWorkspaceContainerArgs): Promise<EditableWorkspaceContainer>;\r\n\r\n /**\r\n * Closes this editor. All [[workspace]] containers are dropped.\r\n */\r\n close(): void;\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-backend",
3
- "version": "5.5.0-dev.2",
3
+ "version": "5.5.0-dev.5",
4
4
  "description": "iTwin.js backend components",
5
5
  "main": "lib/cjs/core-backend.js",
6
6
  "module": "lib/esm/core-backend.js",
@@ -27,10 +27,10 @@
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@opentelemetry/api": "^1.0.4",
30
- "@itwin/core-bentley": "5.5.0-dev.2",
31
- "@itwin/ecschema-metadata": "5.5.0-dev.2",
32
- "@itwin/core-common": "5.5.0-dev.2",
33
- "@itwin/core-geometry": "5.5.0-dev.2"
30
+ "@itwin/core-bentley": "5.5.0-dev.5",
31
+ "@itwin/core-common": "5.5.0-dev.5",
32
+ "@itwin/core-geometry": "5.5.0-dev.5",
33
+ "@itwin/ecschema-metadata": "5.5.0-dev.5"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
36
  "@opentelemetry/api": {
@@ -77,17 +77,17 @@
77
77
  "marked": "^14.1.3",
78
78
  "sql-formatter": "^15.4.6",
79
79
  "webpack": "^5.97.1",
80
- "@itwin/core-bentley": "5.5.0-dev.2",
81
- "@itwin/build-tools": "5.5.0-dev.2",
82
- "@itwin/ecschema-metadata": "5.5.0-dev.2",
83
- "@itwin/core-common": "5.5.0-dev.2",
84
- "@itwin/ecschema-locaters": "5.5.0-dev.2",
85
- "@itwin/ecsql-common": "5.5.0-dev.2",
86
- "@itwin/core-geometry": "5.5.0-dev.2",
87
- "internal-tools": "3.0.0-dev.69"
80
+ "@itwin/core-bentley": "5.5.0-dev.5",
81
+ "@itwin/build-tools": "5.5.0-dev.5",
82
+ "@itwin/core-geometry": "5.5.0-dev.5",
83
+ "@itwin/ecsql-common": "5.5.0-dev.5",
84
+ "@itwin/ecschema-locaters": "5.5.0-dev.5",
85
+ "@itwin/ecschema-metadata": "5.5.0-dev.5",
86
+ "internal-tools": "3.0.0-dev.69",
87
+ "@itwin/core-common": "5.5.0-dev.5"
88
88
  },
89
89
  "dependencies": {
90
- "@bentley/imodeljs-native": "5.5.4",
90
+ "@bentley/imodeljs-native": "5.5.6",
91
91
  "@itwin/object-storage-azure": "^3.0.4",
92
92
  "@azure/storage-blob": "^12.28.0",
93
93
  "form-data": "^4.0.4",
@@ -1,11 +0,0 @@
1
- import { ISchemaLocater, Schema, SchemaContext, SchemaKey, SchemaMatchType } from "@itwin/ecschema-metadata";
2
- import { SchemaInfo } from "@itwin/ecschema-metadata/lib/cjs/Interfaces";
3
- import { IModelDb } from "../../../IModelDb";
4
- export declare class IModelSchemaLocater implements ISchemaLocater {
5
- private _iModel;
6
- constructor(iModel: IModelDb);
7
- getSchema<T extends Schema>(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined>;
8
- getSchemaInfo(schemaKey: SchemaKey, _matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined>;
9
- getSchemaSync(schemaKey: SchemaKey, _matchType: SchemaMatchType, context: SchemaContext): Schema | undefined;
10
- }
11
- //# sourceMappingURL=IModelSchemaLocater.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IModelSchemaLocater.d.ts","sourceRoot":"","sources":["../../../../../src/test/incrementalSchemaLocater/utils/IModelSchemaLocater.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC7G,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,qBAAa,mBAAoB,YAAW,cAAc;IACxD,OAAO,CAAC,OAAO,CAAW;gBAEP,MAAM,EAAE,QAAQ;IAItB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAO7H,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAW/H,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS;CAWpH"}
@@ -1,36 +0,0 @@
1
- import { Schema } from "@itwin/ecschema-metadata";
2
- export class IModelSchemaLocater {
3
- _iModel;
4
- constructor(iModel) {
5
- this._iModel = iModel;
6
- }
7
- async getSchema(schemaKey, matchType, context) {
8
- await this.getSchemaInfo(schemaKey, matchType, context);
9
- const schema = await context.getCachedSchema(schemaKey, matchType);
10
- return schema;
11
- }
12
- async getSchemaInfo(schemaKey, _matchType, context) {
13
- try {
14
- const schemaJson = this._iModel.getSchemaProps(schemaKey.name);
15
- return await Schema.startLoadingFromJson(schemaJson, context);
16
- }
17
- catch (e) {
18
- if (e.errorNumber === 65574)
19
- return undefined;
20
- throw e;
21
- }
22
- }
23
- getSchemaSync(schemaKey, _matchType, context) {
24
- try {
25
- const schemaJson = this._iModel.getSchemaProps(schemaKey.name);
26
- const schema = Schema.fromJsonSync(schemaJson, context);
27
- return schema;
28
- }
29
- catch (e) {
30
- if (e.errorNumber === 65574)
31
- return undefined;
32
- throw e;
33
- }
34
- }
35
- }
36
- //# sourceMappingURL=IModelSchemaLocater.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IModelSchemaLocater.js","sourceRoot":"","sources":["../../../../../src/test/incrementalSchemaLocater/utils/IModelSchemaLocater.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAA6C,MAAM,0BAA0B,CAAC;AAI7G,MAAM,OAAO,mBAAmB;IACtB,OAAO,CAAW;IAE1B,YAAmB,MAAgB;QACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,SAAS,CAAmB,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QAC/G,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAExD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,MAAW,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,SAAoB,EAAE,UAA2B,EAAE,OAAsB;QAClG,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC/D,OAAO,MAAM,MAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAChE,CAAC;QAAC,OAAM,CAAM,EAAC,CAAC;YACd,IAAI,CAAC,CAAC,WAAW,KAAK,KAAK;gBACzB,OAAO,SAAS,CAAC;YACnB,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;IAEM,aAAa,CAAC,SAAoB,EAAE,UAA2B,EAAE,OAAsB;QAC5F,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC/D,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YACxD,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAM,CAAM,EAAC,CAAC;YACd,IAAI,CAAC,CAAC,WAAW,KAAK,KAAK;gBACzB,OAAO,SAAS,CAAC;YACnB,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;CACF","sourcesContent":["import { ISchemaLocater, Schema, SchemaContext, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\nimport { SchemaInfo } from \"@itwin/ecschema-metadata/lib/cjs/Interfaces\";\nimport { IModelDb } from \"../../../IModelDb\";\n\nexport class IModelSchemaLocater implements ISchemaLocater {\n private _iModel: IModelDb;\n\n public constructor(iModel: IModelDb) {\n this._iModel = iModel;\n }\n\n public async getSchema<T extends Schema>(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined> {\n await this.getSchemaInfo(schemaKey, matchType, context);\n\n const schema = await context.getCachedSchema(schemaKey, matchType);\n return schema as T;\n }\n\n public async getSchemaInfo(schemaKey: SchemaKey, _matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\n try {\n const schemaJson = this._iModel.getSchemaProps(schemaKey.name);\n return await Schema.startLoadingFromJson(schemaJson, context);\n } catch(e: any){\n if (e.errorNumber === 65574)\n return undefined;\n throw e;\n }\n }\n\n public getSchemaSync(schemaKey: SchemaKey, _matchType: SchemaMatchType, context: SchemaContext): Schema | undefined {\n try {\n const schemaJson = this._iModel.getSchemaProps(schemaKey.name);\n const schema = Schema.fromJsonSync(schemaJson, context);\n return schema;\n } catch(e: any){\n if (e.errorNumber === 65574)\n return undefined;\n throw e;\n }\n }\n}"]}
@@ -1,20 +0,0 @@
1
- import { Schema, SchemaContext, SchemaKey } from "@itwin/ecschema-metadata";
2
- import { IModelDb } from "../../../IModelDb";
3
- export declare class IncrementalTestHelper {
4
- private static _iModel;
5
- static context: SchemaContext;
6
- static testBimFile: string;
7
- static get iModel(): IModelDb;
8
- static get isLoaded(): boolean;
9
- static setup(options?: {
10
- bimName?: string;
11
- disableSchemaLoading?: boolean;
12
- }): Promise<void>;
13
- static getSchemaNames(): Promise<string[]>;
14
- private static initializeTestIModel;
15
- static importSchema(schemaKey: SchemaKey): Promise<void>;
16
- static close(): Promise<void>;
17
- static getOrderedSchemaStrings(insertSchema: Schema): Promise<string[]>;
18
- static getSchemaString(schema: Schema): Promise<string>;
19
- }
20
- //# sourceMappingURL=IncrementalTestHelper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IncrementalTestHelper.d.ts","sourceRoot":"","sources":["../../../../../src/test/incrementalSchemaLocater/utils/IncrementalTestHelper.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAmB,SAAS,EAAmB,MAAM,0BAA0B,CAAC;AAI9G,OAAO,EAAe,QAAQ,EAAgB,MAAM,mBAAmB,CAAC;AAKxE,qBAAa,qBAAqB;IAChC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAuB;IAC7C,OAAc,OAAO,EAAE,aAAa,CAAC;IACrC,OAAc,WAAW,EAAE,MAAM,CAAC;IAClC,WAAkB,MAAM,IAAI,QAAQ,CAInC;IAED,WAAkB,QAAQ,IAAI,OAAO,CAEpC;WAEmB,KAAK,CAAC,OAAO,CAAC,EAAE;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,oBAAoB,CAAC,EAAE,OAAO,CAAA;KAAC,GAAG,OAAO,CAAC,IAAI,CAAC;WAqClF,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAevD,OAAO,CAAC,MAAM,CAAC,oBAAoB;WAuBf,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;WAwBjD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;WAOtB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;WAMhE,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAUrE"}
@@ -1,126 +0,0 @@
1
- import { OpenMode } from "@itwin/core-bentley";
2
- import { ProfileOptions } from "@itwin/core-common";
3
- import { SchemaXmlFileLocater } from "@itwin/ecschema-locaters";
4
- import { SchemaContext, SchemaGraphUtil, SchemaMatchType } from "@itwin/ecschema-metadata";
5
- import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
6
- import * as path from "path";
7
- import { IModelSchemaLocater } from "./IModelSchemaLocater";
8
- import { BriefcaseDb, IModelDb, StandaloneDb } from "../../../IModelDb";
9
- import { IModelHost } from "../../../IModelHost";
10
- import { IModelJsFs } from "../../../IModelJsFs";
11
- import { KnownTestLocations } from "../../KnownTestLocations";
12
- export class IncrementalTestHelper {
13
- static _iModel;
14
- static context;
15
- static testBimFile;
16
- static get iModel() {
17
- if (this._iModel === undefined)
18
- throw new Error("iModel not loaded");
19
- return this._iModel;
20
- }
21
- static get isLoaded() {
22
- return this._iModel !== undefined;
23
- }
24
- static async setup(options) {
25
- if (!IModelHost.isValid)
26
- await IModelHost.startup({
27
- incrementalSchemaLoading: "enabled",
28
- });
29
- if (this._iModel !== undefined)
30
- throw new Error("iModel already loaded");
31
- if (options?.bimName) {
32
- const pathToBriefCase = path.join(KnownTestLocations.assetsDir, options.bimName);
33
- this._iModel = await BriefcaseDb.open({
34
- fileName: pathToBriefCase,
35
- readonly: true,
36
- key: "test-iModel",
37
- });
38
- }
39
- else {
40
- this.testBimFile = this.initializeTestIModel();
41
- this._iModel = StandaloneDb.openFile(this.testBimFile, OpenMode.ReadWrite);
42
- }
43
- const configuration = IModelHost.configuration;
44
- if (configuration && options && options.disableSchemaLoading !== undefined) {
45
- const previousSetting = configuration.incrementalSchemaLoading;
46
- configuration.incrementalSchemaLoading = options.disableSchemaLoading ? "disabled" : "enabled";
47
- this._iModel.onBeforeClose.addOnce(() => {
48
- configuration.incrementalSchemaLoading = previousSetting;
49
- });
50
- }
51
- this.context = new SchemaContext();
52
- this.context.addLocater(new IModelSchemaLocater(this._iModel));
53
- const xmlLocater = new SchemaXmlFileLocater();
54
- xmlLocater.addSchemaSearchPath(path.join(KnownTestLocations.assetsDir, "IncrementalSchemaLocater"));
55
- this.context.addLocater(xmlLocater);
56
- }
57
- static async getSchemaNames() {
58
- const result = new Array();
59
- const sqlQuery = "SELECT Name, VersionMajor, VersionWrite, VersionMinor FROM meta.ECSchemaDef ORDER BY Name";
60
- const reader = this.iModel.createQueryReader(sqlQuery);
61
- while (await reader.step()) {
62
- const name = reader.current[0];
63
- const versionMajor = reader.current[1];
64
- const versionWrite = reader.current[2];
65
- const versionMinor = reader.current[3];
66
- result.push(`${name}.${versionMajor}.${versionWrite}.${versionMinor}`);
67
- }
68
- return result;
69
- }
70
- static initializeTestIModel() {
71
- const testBim = path.join(KnownTestLocations.assetsDir, "IncrementalSchemaLocater", "test-bim.bim");
72
- if (IModelJsFs.existsSync(testBim)) {
73
- ~IModelJsFs.removeSync(testBim);
74
- }
75
- const localBim = StandaloneDb.createEmpty(testBim, {
76
- allowEdit: "true",
77
- rootSubject: {
78
- name: "IncrementalSchemaTestingDb"
79
- },
80
- });
81
- localBim.close();
82
- const nativeDb = IModelDb.openDgnDb({ path: testBim }, OpenMode.ReadWrite, { profile: ProfileOptions.Upgrade });
83
- nativeDb.saveChanges();
84
- nativeDb.closeFile();
85
- return testBim;
86
- }
87
- static async importSchema(schemaKey) {
88
- if (!this.isLoaded) {
89
- throw new Error("iModel has not been loaded");
90
- }
91
- if (!this._iModel)
92
- throw new Error("iModel is undefined");
93
- if (undefined !== this._iModel.querySchemaVersion(schemaKey.name))
94
- return;
95
- const testSchema = await this.context.getSchema(schemaKey, SchemaMatchType.Exact);
96
- if (undefined === testSchema)
97
- throw new Error(`The schema '${schemaKey.name}' could not be found.`);
98
- const schemaXml = await this.getOrderedSchemaStrings(testSchema);
99
- await this._iModel.importSchemaStrings(schemaXml);
100
- this._iModel.saveChanges();
101
- if (this._iModel.isBriefcaseDb() && !this._iModel.isReadonly) {
102
- await this.iModel.pushChanges({ description: "import test schema" });
103
- }
104
- }
105
- static async close() {
106
- if (this._iModel !== undefined) {
107
- this._iModel.close();
108
- this._iModel = undefined;
109
- }
110
- }
111
- static async getOrderedSchemaStrings(insertSchema) {
112
- const schemas = SchemaGraphUtil.buildDependencyOrderedSchemaList(insertSchema);
113
- const schemaStrings = await Promise.all(schemas.map(async (schema) => IncrementalTestHelper.getSchemaString(schema)));
114
- return schemaStrings;
115
- }
116
- static async getSchemaString(schema) {
117
- // Serialize schema to the document object
118
- let doc = new DOMParser().parseFromString(`<?xml version="1.0" encoding="UTF-8"?>`, "application/xml");
119
- doc = await schema.toXml(doc);
120
- const serializer = new XMLSerializer();
121
- const xml = serializer.serializeToString(doc);
122
- return xml;
123
- }
124
- }
125
- ;
126
- //# sourceMappingURL=IncrementalTestHelper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IncrementalTestHelper.js","sourceRoot":"","sources":["../../../../../src/test/incrementalSchemaLocater/utils/IncrementalTestHelper.ts"],"names":[],"mappings":"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","sourcesContent":["\nimport { OpenMode } from \"@itwin/core-bentley\";\nimport { ProfileOptions } from \"@itwin/core-common\";\nimport { SchemaXmlFileLocater } from \"@itwin/ecschema-locaters\";\nimport { Schema, SchemaContext, SchemaGraphUtil, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\nimport { DOMParser, XMLSerializer } from \"@xmldom/xmldom\";\nimport * as path from \"path\";\nimport { IModelSchemaLocater } from \"./IModelSchemaLocater\";\nimport { BriefcaseDb, IModelDb, StandaloneDb } from \"../../../IModelDb\";\nimport { IModelHost } from \"../../../IModelHost\";\nimport { IModelJsFs } from \"../../../IModelJsFs\";\nimport { KnownTestLocations } from \"../../KnownTestLocations\";\n\nexport class IncrementalTestHelper {\n private static _iModel: IModelDb | undefined;\n public static context: SchemaContext;\n public static testBimFile: string;\n public static get iModel(): IModelDb {\n if (this._iModel === undefined)\n throw new Error(\"iModel not loaded\");\n return this._iModel;\n }\n\n public static get isLoaded(): boolean {\n return this._iModel !== undefined;\n }\n\n public static async setup(options?: {bimName?: string, disableSchemaLoading?: boolean}): Promise<void> {\n if (!IModelHost.isValid)\n await IModelHost.startup({\n incrementalSchemaLoading: \"enabled\",\n });\n\n if (this._iModel !== undefined)\n throw new Error(\"iModel already loaded\");\n\n if (options?.bimName) {\n const pathToBriefCase = path.join(KnownTestLocations.assetsDir, options.bimName);\n this._iModel = await BriefcaseDb.open({\n fileName: pathToBriefCase,\n readonly: true,\n key: \"test-iModel\",\n });\n } else {\n this.testBimFile = this.initializeTestIModel();\n this._iModel = StandaloneDb.openFile(this.testBimFile, OpenMode.ReadWrite);\n }\n\n const configuration = IModelHost.configuration;\n if(configuration && options && options.disableSchemaLoading !== undefined) {\n const previousSetting = configuration.incrementalSchemaLoading;\n configuration.incrementalSchemaLoading = options.disableSchemaLoading ? \"disabled\" : \"enabled\";\n this._iModel.onBeforeClose.addOnce(() => {\n configuration.incrementalSchemaLoading = previousSetting;\n });\n }\n\n this.context = new SchemaContext();\n this.context.addLocater(new IModelSchemaLocater(this._iModel));\n const xmlLocater = new SchemaXmlFileLocater();\n xmlLocater.addSchemaSearchPath(path.join(KnownTestLocations.assetsDir, \"IncrementalSchemaLocater\"));\n this.context.addLocater(xmlLocater);\n }\n\n public static async getSchemaNames(): Promise<string[]> {\n const result = new Array<string>();\n const sqlQuery = \"SELECT Name, VersionMajor, VersionWrite, VersionMinor FROM meta.ECSchemaDef ORDER BY Name\";\n const reader = this.iModel.createQueryReader(sqlQuery);\n while (await reader.step()) {\n const name = reader.current[0];\n const versionMajor = reader.current[1];\n const versionWrite = reader.current[2];\n const versionMinor = reader.current[3];\n\n result.push(`${name}.${versionMajor}.${versionWrite}.${versionMinor}`);\n }\n return result;\n }\n\n private static initializeTestIModel() {\n const testBim = path.join(KnownTestLocations.assetsDir, \"IncrementalSchemaLocater\", \"test-bim.bim\");\n\n if (IModelJsFs.existsSync(testBim)) {~\n IModelJsFs.removeSync(testBim);\n }\n\n const localBim = StandaloneDb.createEmpty(testBim, {\n allowEdit: \"true\",\n rootSubject: {\n name: \"IncrementalSchemaTestingDb\"\n },\n });\n\n localBim.close();\n\n const nativeDb = IModelDb.openDgnDb({ path: testBim }, OpenMode.ReadWrite, { profile: ProfileOptions.Upgrade });\n nativeDb.saveChanges();\n nativeDb.closeFile();\n\n return testBim;\n }\n\n public static async importSchema(schemaKey: SchemaKey): Promise<void> {\n if (!this.isLoaded) {\n throw new Error(\"iModel has not been loaded\")\n }\n\n if (!this._iModel)\n throw new Error(\"iModel is undefined\");\n\n if (undefined !== this._iModel.querySchemaVersion(schemaKey.name))\n return;\n\n const testSchema = await this.context.getSchema(schemaKey, SchemaMatchType.Exact);\n if (undefined === testSchema)\n throw new Error(`The schema '${schemaKey.name}' could not be found.`);\n const schemaXml = await this.getOrderedSchemaStrings(testSchema);\n\n await this._iModel.importSchemaStrings(schemaXml);\n this._iModel.saveChanges();\n\n if (this._iModel.isBriefcaseDb() && !this._iModel.isReadonly) {\n await (this.iModel as BriefcaseDb).pushChanges({ description: \"import test schema\" });\n }\n }\n\n public static async close(): Promise<void> {\n if (this._iModel !== undefined) {\n this._iModel.close();\n this._iModel = undefined;\n }\n }\n\n public static async getOrderedSchemaStrings(insertSchema: Schema): Promise<string[]> {\n const schemas = SchemaGraphUtil.buildDependencyOrderedSchemaList(insertSchema);\n const schemaStrings = await Promise.all(schemas.map(async (schema) => IncrementalTestHelper.getSchemaString(schema)));\n return schemaStrings;\n }\n\n public static async getSchemaString(schema: Schema): Promise<string> {\n // Serialize schema to the document object\n let doc = new DOMParser().parseFromString(`<?xml version=\"1.0\" encoding=\"UTF-8\"?>`, \"application/xml\");\n doc = await schema.toXml(doc);\n\n const serializer = new XMLSerializer();\n const xml = serializer.serializeToString(doc);\n\n return xml;\n }\n};"]}
@@ -1,24 +0,0 @@
1
- import { ECSqlQueryOptions, ECSqlSchemaLocater, ECSqlSchemaLocaterOptions, SchemaContext, SchemaKey, SchemaProps } from "@itwin/ecschema-metadata";
2
- import { IModelDb } from "../../../IModelDb";
3
- export declare class TestSqlSchemaLocater extends ECSqlSchemaLocater {
4
- private _iModel;
5
- constructor(iModel: IModelDb, queryOptions?: ECSqlSchemaLocaterOptions);
6
- protected executeQuery<TRow>(query: string, options?: ECSqlQueryOptions): Promise<ReadonlyArray<TRow>>;
7
- protected getSchemaProps(_schemaKey: SchemaKey): Promise<SchemaProps | undefined>;
8
- getSchemaJson(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined>;
9
- getConstants(schema: string, context: SchemaContext): Promise<import("@itwin/ecschema-metadata").ConstantProps[]>;
10
- getCustomAttributeClasses(schema: string, context: SchemaContext, queryOverride?: string): Promise<import("@itwin/ecschema-metadata").CustomAttributeClassProps[]>;
11
- getEntities(schema: string, context: SchemaContext, queryOverride?: string): Promise<import("@itwin/ecschema-metadata").EntityClassProps[]>;
12
- getEnumerations(schema: string, context: SchemaContext): Promise<import("@itwin/ecschema-metadata").EnumerationProps[]>;
13
- getFormats(schema: string, context: SchemaContext): Promise<import("@itwin/ecschema-metadata").SchemaItemFormatProps[]>;
14
- getInvertedUnits(schema: string, context: SchemaContext): Promise<import("@itwin/ecschema-metadata").InvertedUnitProps[]>;
15
- getKindOfQuantities(schema: string, context: SchemaContext): Promise<import("@itwin/ecschema-metadata").KindOfQuantityProps[]>;
16
- getMixins(schema: string, context: SchemaContext, queryOverride?: string): Promise<import("@itwin/ecschema-metadata").MixinProps[]>;
17
- getPhenomenon(schema: string, context: SchemaContext): Promise<import("@itwin/ecschema-metadata").PhenomenonProps[]>;
18
- getPropertyCategories(schema: string, context: SchemaContext): Promise<import("@itwin/ecschema-metadata").PropertyCategoryProps[]>;
19
- getRelationships(schema: string, context: SchemaContext): Promise<import("@itwin/ecschema-metadata").RelationshipClassProps[]>;
20
- getStructs(schema: string, context: SchemaContext): Promise<import("@itwin/ecschema-metadata").ClassProps[]>;
21
- getUnits(schema: string, context: SchemaContext): Promise<import("@itwin/ecschema-metadata").SchemaItemUnitProps[]>;
22
- getUnitSystems(schema: string, context: SchemaContext): Promise<import("@itwin/ecschema-metadata").SchemaItemProps[]>;
23
- }
24
- //# sourceMappingURL=TestSqlSchemaLocater.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TestSqlSchemaLocater.d.ts","sourceRoot":"","sources":["../../../../../src/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEnJ,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D,OAAO,CAAC,OAAO,CAAW;gBAEP,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,yBAAyB;cAK7D,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;cAQ5F,cAAc,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAMjE,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa;IAG1D,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAGnD,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,EAAE,MAAM;IAGxF,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,EAAE,MAAM;IAG1E,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAGtD,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAGjD,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAGvD,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAG1D,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,EAAE,MAAM;IAGxE,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAGpD,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAG5D,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAGvD,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAGjD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAG/C,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;CAG5E"}