@itwin/core-backend 5.8.0-dev.2 → 5.8.0-dev.20

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 (540) hide show
  1. package/CHANGELOG.md +36 -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.d.ts +26 -0
  26. package/lib/cjs/ECDb.d.ts.map +1 -1
  27. package/lib/cjs/ECDb.js +53 -2
  28. package/lib/cjs/ECDb.js.map +1 -1
  29. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  30. package/lib/cjs/ECSqlRowExecutor.d.ts +66 -0
  31. package/lib/cjs/ECSqlRowExecutor.d.ts.map +1 -0
  32. package/lib/cjs/ECSqlRowExecutor.js +135 -0
  33. package/lib/cjs/ECSqlRowExecutor.js.map +1 -0
  34. package/lib/cjs/ECSqlStatement.d.ts +13 -1
  35. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  36. package/lib/cjs/ECSqlStatement.js +30 -0
  37. package/lib/cjs/ECSqlStatement.js.map +1 -1
  38. package/lib/cjs/ECSqlSyncReader.d.ts +104 -0
  39. package/lib/cjs/ECSqlSyncReader.d.ts.map +1 -0
  40. package/lib/cjs/ECSqlSyncReader.js +191 -0
  41. package/lib/cjs/ECSqlSyncReader.js.map +1 -0
  42. package/lib/cjs/Element.js.map +1 -1
  43. package/lib/cjs/ElementAspect.js.map +1 -1
  44. package/lib/cjs/ElementGraphics.js.map +1 -1
  45. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  46. package/lib/cjs/Entity.js.map +1 -1
  47. package/lib/cjs/EntityReferences.js.map +1 -1
  48. package/lib/cjs/ExportGraphics.js.map +1 -1
  49. package/lib/cjs/ExternalSource.js.map +1 -1
  50. package/lib/cjs/FontFile.js.map +1 -1
  51. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  52. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  53. package/lib/cjs/GeometrySummary.js +47 -47
  54. package/lib/cjs/GeometrySummary.js.map +1 -1
  55. package/lib/cjs/IModelDb.d.ts +26 -1
  56. package/lib/cjs/IModelDb.d.ts.map +1 -1
  57. package/lib/cjs/IModelDb.js +63 -11
  58. package/lib/cjs/IModelDb.js.map +1 -1
  59. package/lib/cjs/IModelDbFonts.js.map +1 -1
  60. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  61. package/lib/cjs/IModelHost.js.map +1 -1
  62. package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
  63. package/lib/cjs/IModelJsFs.js.map +1 -1
  64. package/lib/cjs/ImageSourceConversion.js.map +1 -1
  65. package/lib/cjs/IpcHost.d.ts.map +1 -1
  66. package/lib/cjs/IpcHost.js +28 -4
  67. package/lib/cjs/IpcHost.js.map +1 -1
  68. package/lib/cjs/LineStyle.d.ts +6 -0
  69. package/lib/cjs/LineStyle.d.ts.map +1 -1
  70. package/lib/cjs/LineStyle.js +41 -32
  71. package/lib/cjs/LineStyle.js.map +1 -1
  72. package/lib/cjs/LocalHub.d.ts +17 -10
  73. package/lib/cjs/LocalHub.d.ts.map +1 -1
  74. package/lib/cjs/LocalHub.js +127 -29
  75. package/lib/cjs/LocalHub.js.map +1 -1
  76. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  77. package/lib/cjs/LockControl.js.map +1 -1
  78. package/lib/cjs/Material.js.map +1 -1
  79. package/lib/cjs/Model.js.map +1 -1
  80. package/lib/cjs/NativeAppStorage.js.map +1 -1
  81. package/lib/cjs/NativeHost.js.map +1 -1
  82. package/lib/cjs/NavigationRelationship.js.map +1 -1
  83. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  84. package/lib/cjs/PropertyStore.js.map +1 -1
  85. package/lib/cjs/Relationship.js.map +1 -1
  86. package/lib/cjs/RpcBackend.js.map +1 -1
  87. package/lib/cjs/SQLiteDb.js.map +1 -1
  88. package/lib/cjs/Schema.js.map +1 -1
  89. package/lib/cjs/SchemaSync.js.map +1 -1
  90. package/lib/cjs/SchemaUtils.js.map +1 -1
  91. package/lib/cjs/SheetIndex.js.map +1 -1
  92. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  93. package/lib/cjs/SqliteStatement.js.map +1 -1
  94. package/lib/cjs/StashManager.js.map +1 -1
  95. package/lib/cjs/Texture.js.map +1 -1
  96. package/lib/cjs/TileStorage.js.map +1 -1
  97. package/lib/cjs/TxnManager.js.map +1 -1
  98. package/lib/cjs/ViewDefinition.js.map +1 -1
  99. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  100. package/lib/cjs/ViewStore.js.map +1 -1
  101. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  102. package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
  103. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
  104. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  105. package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
  106. package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
  107. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
  108. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  109. package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
  110. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
  111. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
  112. package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
  113. package/lib/cjs/core-backend.d.ts +3 -0
  114. package/lib/cjs/core-backend.d.ts.map +1 -1
  115. package/lib/cjs/core-backend.js +3 -0
  116. package/lib/cjs/core-backend.js.map +1 -1
  117. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  118. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  119. package/lib/cjs/domains/GenericElements.js.map +1 -1
  120. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  121. package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
  122. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  123. package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
  124. package/lib/cjs/internal/FontFileImpl.js.map +1 -1
  125. package/lib/cjs/internal/HubMock.js.map +1 -1
  126. package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
  127. package/lib/cjs/internal/IntegrityCheck.js.map +1 -1
  128. package/lib/cjs/internal/NativePlatform.js.map +1 -1
  129. package/lib/cjs/internal/NoLocks.js.map +1 -1
  130. package/lib/cjs/internal/OnlineStatus.js.map +1 -1
  131. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
  132. package/lib/cjs/internal/Symbols.js.map +1 -1
  133. package/lib/cjs/internal/annotations/fields.js.map +1 -1
  134. package/lib/cjs/internal/cross-package.js.map +1 -1
  135. package/lib/cjs/internal/workspace/SettingsDbImpl.d.ts +38 -0
  136. package/lib/cjs/internal/workspace/SettingsDbImpl.d.ts.map +1 -0
  137. package/lib/cjs/internal/workspace/SettingsDbImpl.js +108 -0
  138. package/lib/cjs/internal/workspace/SettingsDbImpl.js.map +1 -0
  139. package/lib/cjs/internal/workspace/SettingsEditorImpl.d.ts +7 -0
  140. package/lib/cjs/internal/workspace/SettingsEditorImpl.d.ts.map +1 -0
  141. package/lib/cjs/internal/workspace/SettingsEditorImpl.js +266 -0
  142. package/lib/cjs/internal/workspace/SettingsEditorImpl.js.map +1 -0
  143. package/lib/cjs/internal/workspace/SettingsImpl.d.ts +1 -0
  144. package/lib/cjs/internal/workspace/SettingsImpl.d.ts.map +1 -1
  145. package/lib/cjs/internal/workspace/SettingsImpl.js +8 -4
  146. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
  147. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  148. package/lib/cjs/internal/workspace/SettingsSqliteDb.d.ts +14 -0
  149. package/lib/cjs/internal/workspace/SettingsSqliteDb.d.ts.map +1 -0
  150. package/lib/cjs/internal/workspace/SettingsSqliteDb.js +40 -0
  151. package/lib/cjs/internal/workspace/SettingsSqliteDb.js.map +1 -0
  152. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts +1 -0
  153. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  154. package/lib/cjs/internal/workspace/WorkspaceImpl.js +67 -16
  155. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  156. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  157. package/lib/cjs/rpc/multipart.js.map +1 -1
  158. package/lib/cjs/rpc/tracing.js.map +1 -1
  159. package/lib/cjs/rpc/web/logging.js.map +1 -1
  160. package/lib/cjs/rpc/web/request.js.map +1 -1
  161. package/lib/cjs/rpc/web/response.js.map +1 -1
  162. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  163. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  164. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  165. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  166. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  167. package/lib/cjs/workspace/Settings.d.ts +8 -0
  168. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  169. package/lib/cjs/workspace/Settings.js.map +1 -1
  170. package/lib/cjs/workspace/SettingsDb.d.ts +109 -0
  171. package/lib/cjs/workspace/SettingsDb.d.ts.map +1 -0
  172. package/lib/cjs/workspace/SettingsDb.js +19 -0
  173. package/lib/cjs/workspace/SettingsDb.js.map +1 -0
  174. package/lib/cjs/workspace/SettingsEditor.d.ts +250 -0
  175. package/lib/cjs/workspace/SettingsEditor.d.ts.map +1 -0
  176. package/lib/cjs/workspace/SettingsEditor.js +53 -0
  177. package/lib/cjs/workspace/SettingsEditor.js.map +1 -0
  178. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  179. package/lib/cjs/workspace/Workspace.d.ts +42 -19
  180. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  181. package/lib/cjs/workspace/Workspace.js.map +1 -1
  182. package/lib/cjs/workspace/WorkspaceEditor.d.ts +32 -1
  183. package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -1
  184. package/lib/cjs/workspace/WorkspaceEditor.js +19 -0
  185. package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
  186. package/lib/esm/BackendHubAccess.js.map +1 -1
  187. package/lib/esm/BackendLoggerCategory.js.map +1 -1
  188. package/lib/esm/BisCoreSchema.js.map +1 -1
  189. package/lib/esm/BlobContainerService.js.map +1 -1
  190. package/lib/esm/BriefcaseManager.js.map +1 -1
  191. package/lib/esm/CatalogDb.js.map +1 -1
  192. package/lib/esm/Category.js.map +1 -1
  193. package/lib/esm/ChangeSummaryManager.js +2 -2
  194. package/lib/esm/ChangeSummaryManager.js.map +1 -1
  195. package/lib/esm/ChangedElementsDb.js.map +1 -1
  196. package/lib/esm/ChangesetECAdaptor.js +248 -248
  197. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  198. package/lib/esm/ChannelControl.js.map +1 -1
  199. package/lib/esm/CheckpointManager.js.map +1 -1
  200. package/lib/esm/ClassRegistry.js +5 -5
  201. package/lib/esm/ClassRegistry.js.map +1 -1
  202. package/lib/esm/CloudSqlite.js.map +1 -1
  203. package/lib/esm/CodeService.js.map +1 -1
  204. package/lib/esm/CodeSpecs.js.map +1 -1
  205. package/lib/esm/ConcurrentQuery.js.map +1 -1
  206. package/lib/esm/CustomViewState3dCreator.js.map +1 -1
  207. package/lib/esm/DevTools.js.map +1 -1
  208. package/lib/esm/DisplayStyle.js.map +1 -1
  209. package/lib/esm/ECDb.d.ts +26 -0
  210. package/lib/esm/ECDb.d.ts.map +1 -1
  211. package/lib/esm/ECDb.js +54 -3
  212. package/lib/esm/ECDb.js.map +1 -1
  213. package/lib/esm/ECSchemaXmlContext.js.map +1 -1
  214. package/lib/esm/ECSqlRowExecutor.d.ts +66 -0
  215. package/lib/esm/ECSqlRowExecutor.d.ts.map +1 -0
  216. package/lib/esm/ECSqlRowExecutor.js +131 -0
  217. package/lib/esm/ECSqlRowExecutor.js.map +1 -0
  218. package/lib/esm/ECSqlStatement.d.ts +13 -1
  219. package/lib/esm/ECSqlStatement.d.ts.map +1 -1
  220. package/lib/esm/ECSqlStatement.js +30 -0
  221. package/lib/esm/ECSqlStatement.js.map +1 -1
  222. package/lib/esm/ECSqlSyncReader.d.ts +104 -0
  223. package/lib/esm/ECSqlSyncReader.d.ts.map +1 -0
  224. package/lib/esm/ECSqlSyncReader.js +187 -0
  225. package/lib/esm/ECSqlSyncReader.js.map +1 -0
  226. package/lib/esm/Element.js.map +1 -1
  227. package/lib/esm/ElementAspect.js.map +1 -1
  228. package/lib/esm/ElementGraphics.js.map +1 -1
  229. package/lib/esm/ElementTreeWalker.js.map +1 -1
  230. package/lib/esm/Entity.js.map +1 -1
  231. package/lib/esm/EntityReferences.js.map +1 -1
  232. package/lib/esm/ExportGraphics.js.map +1 -1
  233. package/lib/esm/ExternalSource.js.map +1 -1
  234. package/lib/esm/FontFile.js.map +1 -1
  235. package/lib/esm/GeoCoordConfig.js.map +1 -1
  236. package/lib/esm/GeographicCRSServices.js.map +1 -1
  237. package/lib/esm/GeometrySummary.js +47 -47
  238. package/lib/esm/GeometrySummary.js.map +1 -1
  239. package/lib/esm/IModelDb.d.ts +26 -1
  240. package/lib/esm/IModelDb.d.ts.map +1 -1
  241. package/lib/esm/IModelDb.js +63 -11
  242. package/lib/esm/IModelDb.js.map +1 -1
  243. package/lib/esm/IModelDbFonts.js.map +1 -1
  244. package/lib/esm/IModelElementCloneContext.js.map +1 -1
  245. package/lib/esm/IModelHost.js.map +1 -1
  246. package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
  247. package/lib/esm/IModelJsFs.js.map +1 -1
  248. package/lib/esm/ImageSourceConversion.js.map +1 -1
  249. package/lib/esm/IpcHost.d.ts.map +1 -1
  250. package/lib/esm/IpcHost.js +28 -4
  251. package/lib/esm/IpcHost.js.map +1 -1
  252. package/lib/esm/LineStyle.d.ts +6 -0
  253. package/lib/esm/LineStyle.d.ts.map +1 -1
  254. package/lib/esm/LineStyle.js +41 -32
  255. package/lib/esm/LineStyle.js.map +1 -1
  256. package/lib/esm/LocalHub.d.ts +17 -10
  257. package/lib/esm/LocalHub.d.ts.map +1 -1
  258. package/lib/esm/LocalHub.js +128 -30
  259. package/lib/esm/LocalHub.js.map +1 -1
  260. package/lib/esm/LocalhostIpcHost.js.map +1 -1
  261. package/lib/esm/LockControl.js.map +1 -1
  262. package/lib/esm/Material.js.map +1 -1
  263. package/lib/esm/Model.js.map +1 -1
  264. package/lib/esm/NativeAppStorage.js.map +1 -1
  265. package/lib/esm/NativeHost.js.map +1 -1
  266. package/lib/esm/NavigationRelationship.js.map +1 -1
  267. package/lib/esm/PromiseMemoizer.js.map +1 -1
  268. package/lib/esm/PropertyStore.js.map +1 -1
  269. package/lib/esm/Relationship.js.map +1 -1
  270. package/lib/esm/RpcBackend.js.map +1 -1
  271. package/lib/esm/SQLiteDb.js.map +1 -1
  272. package/lib/esm/Schema.js.map +1 -1
  273. package/lib/esm/SchemaSync.js.map +1 -1
  274. package/lib/esm/SchemaUtils.js.map +1 -1
  275. package/lib/esm/SheetIndex.js.map +1 -1
  276. package/lib/esm/SqliteChangesetReader.js.map +1 -1
  277. package/lib/esm/SqliteStatement.js.map +1 -1
  278. package/lib/esm/StashManager.js.map +1 -1
  279. package/lib/esm/Texture.js.map +1 -1
  280. package/lib/esm/TileStorage.js.map +1 -1
  281. package/lib/esm/TxnManager.js.map +1 -1
  282. package/lib/esm/ViewDefinition.js.map +1 -1
  283. package/lib/esm/ViewStateHydrator.js.map +1 -1
  284. package/lib/esm/ViewStore.js.map +1 -1
  285. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  286. package/lib/esm/annotations/FrameGeometry.js.map +1 -1
  287. package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
  288. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  289. package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
  290. package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
  291. package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
  292. package/lib/esm/core-backend.d.ts +3 -0
  293. package/lib/esm/core-backend.d.ts.map +1 -1
  294. package/lib/esm/core-backend.js +3 -0
  295. package/lib/esm/core-backend.js.map +1 -1
  296. package/lib/esm/domains/FunctionalElements.js.map +1 -1
  297. package/lib/esm/domains/FunctionalSchema.js.map +1 -1
  298. package/lib/esm/domains/GenericElements.js.map +1 -1
  299. package/lib/esm/domains/GenericSchema.js.map +1 -1
  300. package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
  301. package/lib/esm/internal/ChannelAdmin.js.map +1 -1
  302. package/lib/esm/internal/ElementLRUCache.js.map +1 -1
  303. package/lib/esm/internal/FontFileImpl.js.map +1 -1
  304. package/lib/esm/internal/HubMock.js.map +1 -1
  305. package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
  306. package/lib/esm/internal/IntegrityCheck.js.map +1 -1
  307. package/lib/esm/internal/NativePlatform.js.map +1 -1
  308. package/lib/esm/internal/NoLocks.js.map +1 -1
  309. package/lib/esm/internal/OnlineStatus.js.map +1 -1
  310. package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
  311. package/lib/esm/internal/Symbols.js.map +1 -1
  312. package/lib/esm/internal/annotations/fields.js.map +1 -1
  313. package/lib/esm/internal/cross-package.js.map +1 -1
  314. package/lib/esm/internal/workspace/SettingsDbImpl.d.ts +38 -0
  315. package/lib/esm/internal/workspace/SettingsDbImpl.d.ts.map +1 -0
  316. package/lib/esm/internal/workspace/SettingsDbImpl.js +104 -0
  317. package/lib/esm/internal/workspace/SettingsDbImpl.js.map +1 -0
  318. package/lib/esm/internal/workspace/SettingsEditorImpl.d.ts +7 -0
  319. package/lib/esm/internal/workspace/SettingsEditorImpl.d.ts.map +1 -0
  320. package/lib/esm/internal/workspace/SettingsEditorImpl.js +263 -0
  321. package/lib/esm/internal/workspace/SettingsEditorImpl.js.map +1 -0
  322. package/lib/esm/internal/workspace/SettingsImpl.d.ts +1 -0
  323. package/lib/esm/internal/workspace/SettingsImpl.d.ts.map +1 -1
  324. package/lib/esm/internal/workspace/SettingsImpl.js +5 -2
  325. package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
  326. package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  327. package/lib/esm/internal/workspace/SettingsSqliteDb.d.ts +14 -0
  328. package/lib/esm/internal/workspace/SettingsSqliteDb.d.ts.map +1 -0
  329. package/lib/esm/internal/workspace/SettingsSqliteDb.js +36 -0
  330. package/lib/esm/internal/workspace/SettingsSqliteDb.js.map +1 -0
  331. package/lib/esm/internal/workspace/WorkspaceImpl.d.ts +1 -0
  332. package/lib/esm/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  333. package/lib/esm/internal/workspace/WorkspaceImpl.js +67 -17
  334. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  335. package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  336. package/lib/esm/rpc/multipart.js.map +1 -1
  337. package/lib/esm/rpc/tracing.js.map +1 -1
  338. package/lib/esm/rpc/web/logging.js.map +1 -1
  339. package/lib/esm/rpc/web/request.js.map +1 -1
  340. package/lib/esm/rpc/web/response.js.map +1 -1
  341. package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  342. package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  343. package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  344. package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  345. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  346. package/lib/esm/test/AdvancedEqual.js.map +1 -1
  347. package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
  348. package/lib/esm/test/AttachDb.test.js +11 -11
  349. package/lib/esm/test/AttachDb.test.js.map +1 -1
  350. package/lib/esm/test/ElementDrivesElement.test.js +23 -23
  351. package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
  352. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  353. package/lib/esm/test/GeometryTestUtil.js.map +1 -1
  354. package/lib/esm/test/IModelHost.test.js.map +1 -1
  355. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  356. package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
  357. package/lib/esm/test/IpcHost.test.js +64 -13
  358. package/lib/esm/test/IpcHost.test.js.map +1 -1
  359. package/lib/esm/test/KnownTestLocations.js.map +1 -1
  360. package/lib/esm/test/PrintElementTree.js.map +1 -1
  361. package/lib/esm/test/PropertyDb.test.js.map +1 -1
  362. package/lib/esm/test/RevisionUtility.js.map +1 -1
  363. package/lib/esm/test/SchemaUtils.test.js +25 -25
  364. package/lib/esm/test/SchemaUtils.test.js.map +1 -1
  365. package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
  366. package/lib/esm/test/SquashSchemaAndDataChanges.test.js +129 -129
  367. package/lib/esm/test/SquashSchemaAndDataChanges.test.js.map +1 -1
  368. package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
  369. package/lib/esm/test/TestUtils.js.map +1 -1
  370. package/lib/esm/test/annotations/Fields.test.js +53 -53
  371. package/lib/esm/test/annotations/Fields.test.js.map +1 -1
  372. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
  373. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  374. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  375. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
  376. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
  377. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
  378. package/lib/esm/test/categories/Category.test.js.map +1 -1
  379. package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
  380. package/lib/esm/test/ecdb/CTE.test.js +88 -88
  381. package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
  382. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +19 -19
  383. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
  384. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
  385. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
  386. package/lib/esm/test/ecdb/ECDb.test.js +72 -72
  387. package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
  388. package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
  389. package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
  390. package/lib/esm/test/ecdb/ECSqlAst.test.js +65 -65
  391. package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
  392. package/lib/esm/test/ecdb/ECSqlQuery.test.js +100 -12
  393. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  394. package/lib/esm/test/ecdb/ECSqlStatement.test.js +332 -332
  395. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  396. package/lib/esm/test/ecdb/ECSqlSyncReader.test.d.ts +2 -0
  397. package/lib/esm/test/ecdb/ECSqlSyncReader.test.d.ts.map +1 -0
  398. package/lib/esm/test/ecdb/ECSqlSyncReader.test.js +122 -0
  399. package/lib/esm/test/ecdb/ECSqlSyncReader.test.js.map +1 -0
  400. package/lib/esm/test/ecdb/QueryReaders.test.d.ts +2 -0
  401. package/lib/esm/test/ecdb/QueryReaders.test.d.ts.map +1 -0
  402. package/lib/esm/test/ecdb/QueryReaders.test.js +1462 -0
  403. package/lib/esm/test/ecdb/QueryReaders.test.js.map +1 -0
  404. package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
  405. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.d.ts.map +1 -1
  406. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js +4 -1
  407. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
  408. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
  409. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
  410. package/lib/esm/test/ecsql/src/ECSqlTestParser.d.ts +1 -1
  411. package/lib/esm/test/ecsql/src/ECSqlTestParser.d.ts.map +1 -1
  412. package/lib/esm/test/ecsql/src/ECSqlTestParser.js +11 -5
  413. package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
  414. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js +186 -100
  415. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  416. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  417. package/lib/esm/test/element/ElementAspect.test.js +22 -22
  418. package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
  419. package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
  420. package/lib/esm/test/element/ElementRoundTrip.test.js +139 -139
  421. package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
  422. package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
  423. package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
  424. package/lib/esm/test/element/NullStructArray.test.js +13 -13
  425. package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
  426. package/lib/esm/test/element/ProjectInformationRecord.test.js.map +1 -1
  427. package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
  428. package/lib/esm/test/element/UrlLink.test.js.map +1 -1
  429. package/lib/esm/test/font/FontFile.test.js.map +1 -1
  430. package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
  431. package/lib/esm/test/hubaccess/ApplyChangeset.test.js +32 -32
  432. package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
  433. package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
  434. package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
  435. package/lib/esm/test/hubaccess/Rebase.test.js +56 -56
  436. package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
  437. package/lib/esm/test/hubaccess/SemanticRebase.test.js +145 -145
  438. package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
  439. package/lib/esm/test/imageData.js.map +1 -1
  440. package/lib/esm/test/imodel/Code.test.js.map +1 -1
  441. package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
  442. package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
  443. package/lib/esm/test/imodel/IModel.test.js +44 -44
  444. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  445. package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
  446. package/lib/esm/test/imodel/SchemaXmlImport.test.js +13 -13
  447. package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
  448. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
  449. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
  450. package/lib/esm/test/incrementalSchemaLocater/TestContext.js.map +1 -1
  451. package/lib/esm/test/index.js.map +1 -1
  452. package/lib/esm/test/misc/DevTools.test.js.map +1 -1
  453. package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
  454. package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
  455. package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
  456. package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
  457. package/lib/esm/test/rpc/response.test.js.map +1 -1
  458. package/lib/esm/test/schema/ClassRegistry.test.js +99 -99
  459. package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
  460. package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
  461. package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
  462. package/lib/esm/test/schema/IModelSchemaContext.test.js +9 -9
  463. package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
  464. package/lib/esm/test/schema/SchemaImportCallbacks.test.js +19 -19
  465. package/lib/esm/test/schema/SchemaImportCallbacks.test.js.map +1 -1
  466. package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
  467. package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
  468. package/lib/esm/test/standalone/ChangesetReader.test.js +135 -135
  469. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  470. package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
  471. package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
  472. package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
  473. package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
  474. package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
  475. package/lib/esm/test/standalone/ExportGraphics.test.js +14 -14
  476. package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
  477. package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
  478. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  479. package/lib/esm/test/standalone/HubMock.test.js +177 -7
  480. package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
  481. package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
  482. package/lib/esm/test/standalone/IModelWrite.test.js +27 -27
  483. package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
  484. package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
  485. package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
  486. package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
  487. package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
  488. package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
  489. package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
  490. package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
  491. package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
  492. package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
  493. package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
  494. package/lib/esm/test/standalone/Setting.test.js.map +1 -1
  495. package/lib/esm/test/standalone/Settings.test.js +18 -0
  496. package/lib/esm/test/standalone/Settings.test.js.map +1 -1
  497. package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
  498. package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
  499. package/lib/esm/test/standalone/StandaloneDb.test.js +51 -1
  500. package/lib/esm/test/standalone/StandaloneDb.test.js.map +1 -1
  501. package/lib/esm/test/standalone/Texture.test.js.map +1 -1
  502. package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
  503. package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
  504. package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
  505. package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
  506. package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
  507. package/lib/esm/test/standalone/Workspace.test.js +213 -0
  508. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  509. package/lib/esm/test/standalone/iModelDb.test.d.ts +2 -0
  510. package/lib/esm/test/standalone/iModelDb.test.d.ts.map +1 -0
  511. package/lib/esm/test/standalone/iModelDb.test.js +35 -0
  512. package/lib/esm/test/standalone/iModelDb.test.js.map +1 -0
  513. package/lib/esm/test/workspace/SettingsDb.test.d.ts +2 -0
  514. package/lib/esm/test/workspace/SettingsDb.test.d.ts.map +1 -0
  515. package/lib/esm/test/workspace/SettingsDb.test.js +465 -0
  516. package/lib/esm/test/workspace/SettingsDb.test.js.map +1 -0
  517. package/lib/esm/workspace/Settings.d.ts +8 -0
  518. package/lib/esm/workspace/Settings.d.ts.map +1 -1
  519. package/lib/esm/workspace/Settings.js.map +1 -1
  520. package/lib/esm/workspace/SettingsDb.d.ts +109 -0
  521. package/lib/esm/workspace/SettingsDb.d.ts.map +1 -0
  522. package/lib/esm/workspace/SettingsDb.js +16 -0
  523. package/lib/esm/workspace/SettingsDb.js.map +1 -0
  524. package/lib/esm/workspace/SettingsEditor.d.ts +250 -0
  525. package/lib/esm/workspace/SettingsEditor.d.ts.map +1 -0
  526. package/lib/esm/workspace/SettingsEditor.js +50 -0
  527. package/lib/esm/workspace/SettingsEditor.js.map +1 -0
  528. package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
  529. package/lib/esm/workspace/Workspace.d.ts +42 -19
  530. package/lib/esm/workspace/Workspace.d.ts.map +1 -1
  531. package/lib/esm/workspace/Workspace.js.map +1 -1
  532. package/lib/esm/workspace/WorkspaceEditor.d.ts +32 -1
  533. package/lib/esm/workspace/WorkspaceEditor.d.ts.map +1 -1
  534. package/lib/esm/workspace/WorkspaceEditor.js +19 -0
  535. package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
  536. package/package.json +15 -15
  537. package/lib/esm/test/ecdb/ECSqlReader.test.d.ts +0 -2
  538. package/lib/esm/test/ecdb/ECSqlReader.test.d.ts.map +0 -1
  539. package/lib/esm/test/ecdb/ECSqlReader.test.js +0 -669
  540. package/lib/esm/test/ecdb/ECSqlReader.test.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../../src/workspace/Settings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAQhE,YAAY;AACZ,MAAM,KAAW,OAAO,CA+DvB;AA/DD,WAAiB,OAAO;IACtB,2CAA2C;IAC3C,SAAgB,KAAK,CAAoB,OAAU;QACjD,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;YACzC,OAAO,OAAO,CAAC;QAEjB,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAS,CAAC;QACvD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAE,OAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC1F,OAAO,MAAM,CAAC;IAChB,CAAC;IAPe,aAAK,QAOpB,CAAA;IAED;;;;;;OAMG;IACH,SAAgB,QAAQ,CAAC,CAAsB,EAAE,CAAsB;QACrE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC;QACd,CAAC;QAED,qCAAqC;QACrC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,CA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CAAC;YACf,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IA5Ce,gBAAQ,WA4CvB,CAAA;AACH,CAAC,EA/DgB,OAAO,KAAP,OAAO,QA+DvB;AA0CD,YAAY;AACZ,MAAM,KAAW,gBAAgB,CAahC;AAbD,WAAiB,gBAAgB;IAC/B,yGAAyG;IAC5F,yBAAQ,GAAG,GAAG,CAAC;IAC5B,sDAAsD;IACzC,4BAAW,GAAG,GAAG,CAAC;IAC/B,6DAA6D;IAChD,6BAAY,GAAG,GAAG,CAAC;IAChC,sDAAsD;IACzC,sBAAK,GAAG,GAAG,CAAC;IACzB,wDAAwD;IAC3C,uBAAM,GAAG,GAAG,CAAC;IAC1B,gDAAgD;IACnC,uBAAM,GAAG,GAAG,CAAC;AAC5B,CAAC,EAbgB,gBAAgB,KAAhB,gBAAgB,QAahC","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 { BeEvent, JSONSchemaType } from \"@itwin/core-bentley\";\r\nimport { LocalDirName, LocalFileName } from \"@itwin/core-common\";\r\nimport { WorkspaceDb } from \"./Workspace\";\r\nimport { _implementationProhibited } from \"../internal/Symbols\";\r\n\r\n/** The value of a single named parameter within a [[Workspace.settings]] that configures some aspect of the applications run-time behavior.\r\n * Settings are stored in a [[SettingsDictionary]]. A setting is described by its [[SettingSchema]].\r\n * @beta\r\n */\r\nexport type Setting = JSONSchemaType;\r\n\r\n/** @beta */\r\nexport namespace Setting { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Create a deep copy of a [[Setting]]. */\r\n export function clone<T extends Setting>(setting: T): T {\r\n if (!setting || typeof setting !== \"object\")\r\n return setting;\r\n\r\n const result = Array.isArray(setting) ? [] : {} as any;\r\n Object.keys(setting).forEach((key: string) => result[key] = clone((setting as any)[key]));\r\n return result;\r\n }\r\n\r\n /** Returns true if `a` and `b` are considered equivalent [[Setting]] values.\r\n * Settings of primitive types like `number` and `string` are compared using `===`.\r\n * Settings of type \"object\" are compared by comparing each property using `areEqual`; the objects are considered\r\n * equal if they have the exact same set of property names with equivalent values.\r\n * Settings of type \"array\" are compared by comparing each element of the arrays use `areEqual`; the arrays are considered\r\n * equal if they have the same number of elements with equivalent values in the same exact order.\r\n */\r\n export function areEqual(a: Setting | undefined, b: Setting | undefined): boolean {\r\n if (a === b) {\r\n return true;\r\n }\r\n\r\n // For primitive types, === suffices.\r\n if (typeof a !== \"object\" || typeof b !== \"object\") {\r\n return false;\r\n }\r\n\r\n if (Array.isArray(a) || Array.isArray(b)) {\r\n if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < a.length; i++) {\r\n if (!areEqual(a[i], b[i])) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n const aKeys = Object.keys(a);\r\n const bKeys = Object.keys(b);\r\n if (aKeys.length !== bKeys.length) {\r\n return false;\r\n }\r\n\r\n aKeys.sort();\r\n bKeys.sort();\r\n for (let i = 0; i < aKeys.length; i++) {\r\n const key = aKeys[i];\r\n if (key !== bKeys[i]) {\r\n return false;\r\n }\r\n\r\n if (!areEqual((a as SettingsContainer)[key], (b as SettingsContainer)[key])) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * The name of a [[Setting]].\r\n * Setting names must be [valid JavaScript property names](https://developer.mozilla.org/en-US/docs/Glossary/property/JavaScript) containing no spaces or periods.\r\n * The name of a setting begins with the schema prefix of the [[SettingGroupSchema]] in which its [[SettingSchema]] is defined.\r\n * A setting name therefore forms a path like file names in a file system.\r\n * For example, the following are setting names defined in the `energyAnalysis`, `iot-scan-visualization`, and `vibration-map` schemas.\r\n *\r\n * ```ts\r\n * \"energyAnalysis/formats/totalWork\"\r\n * \"energyAnalysis/formats/totalHours\"\r\n * \"energyAnalysis/units/power\"\r\n * \"energyAnalysis/units/temperature\"\r\n * \"energyAnalysis/startupMode\"\r\n * \"iot-scan-visualization/ports/cameras\"\r\n * \"vibration-map/filters/scope\"\r\n * \"vibration-map/filters/prefabricated\"\r\n * ```\r\n *\r\n * @beta\r\n */\r\nexport type SettingName = string;\r\n\r\n/** An object that defines the values for any number of [[Setting]]s. Each of its properties' names must conform to the semantics of a [[SettingName]].\r\n * @beta\r\n */\r\nexport interface SettingsContainer {\r\n /** Accesses settings by their names. */\r\n [name: SettingName]: Setting | undefined;\r\n}\r\n\r\n/** Defines the precedence of a [[SettingsDictionary]].\r\n * [[Settings]] may contain multiple dictionaries containing different values for the same [[SettingName]].\r\n * When resolving the value of a [[Setting]], the value from the highest-priority dictionary is used.\r\n * Priorities are grouped into coarse categories like [[SettingsPriority.application]] and [[SettingsPriority.iModel]].\r\n * Settings with priorities less than or equal to [[SettingsPriority.application]] are stored in [[IModelHost.appWorkspace]], while\r\n * those with priorities higher than [[SettingsPriority.application]] are stored inside [[IModelDb.workspace]].\r\n * @beta\r\n */\r\nexport type SettingsPriority = number;\r\n\r\n/** @beta */\r\nexport namespace SettingsPriority { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Settings that originate from default setting files loaded automatically at the start of a session. */\r\n export const defaults = 100;\r\n /** Settings supplied by an application at runtime. */\r\n export const application = 200;\r\n /** Settings that apply to all iTwins for an organization. */\r\n export const organization = 300;\r\n /** Settings that apply to all iModels in an iTwin. */\r\n export const iTwin = 400;\r\n /** Settings that apply to all branches of an iModel. */\r\n export const branch = 500;\r\n /** Settings that apply to a specific iModel. */\r\n export const iModel = 600;\r\n}\r\n\r\n/** A named container that supplies values for [[Setting]]s.\r\n * @see [[Settings.addDictionary]] to register a new settings dictionary.\r\n * @beta\r\n */\r\nexport interface SettingsDictionary {\r\n /** @internal */\r\n [_implementationProhibited]: unknown;\r\n\r\n /** Metadata describing the dictionary. */\r\n readonly props: SettingsDictionaryProps;\r\n\r\n /** Obtain a copy of the value of the setting named `settingName` stored in this dictionary, or `undefined` if no such setting exists.\r\n * The returned value is always cloned using [[Setting.clone]].\r\n * @note Generally, applications use methods like [[Settings.getString]] and [[Setting.getArray]] to resolve a setting value from multiple\r\n * dictionaries. Those methods - unlike this one - also validate that `settingName` is of type `T` as defined by its [[SettingSchema]].\r\n */\r\n getSetting<T extends Setting>(settingName: SettingName): T | undefined;\r\n}\r\n\r\n/** Uniquely identifies a [[SettingsDictionary]].\r\n * @beta\r\n */\r\nexport interface SettingsDictionarySource {\r\n /** The name of the dictionary, which must be unique within its [[workspaceDb]], or - if [[workspaceDb]] is undefined - unique among all dictionaries not associated with any [[WorkspaceDb]]. */\r\n readonly name: string;\r\n /** The [[WorkspaceDb]] from which the dictionary originated. */\r\n readonly workspaceDb?: WorkspaceDb;\r\n}\r\n\r\n/** Properties of a [[SettingsDictionary]], defining its name, the [[WorkspaceDb]] (if any) from which it originated, and its [[priority]] relative to other dictionaries.\r\n * @beta\r\n */\r\nexport interface SettingsDictionaryProps extends SettingsDictionarySource {\r\n /** Precedence value determining which setting value to use when multiple dictionaries supply values for the same [[SettingName]]. */\r\n readonly priority: SettingsPriority;\r\n}\r\n\r\n/**\r\n * The collection of [[Setting]]s that supply the run-time configuration of a [[Workspace]].\r\n * The `Settings` object comprises a collection of named [[SettingsDictionary]] objects.\r\n * Methods like [[getSetting]], [[getString]], and [[getArray]] provide access to the value of an individual [[Setting]] by searching\r\n * the [[dictionaries]] in order by their [[SettingsPriority]] to find the highest-priority setting with the requested [[SettingName]].\r\n * Most methods that retrieve [[Setting]] values validate them against their [[SettingSchema]]s to ensure that they are of the correct type.\r\n * A [[SettingsDictionary]] can be added or removed using [[addDictionary]] and [[dropDictionary]].\r\n * Because [[Setting]]s can change at any time during the session, you should avoid caching their values wherever possible.\r\n * If you must cache them (for example, to display in a user interface), you should listen for the [[onSettingsChanged]] event to be\r\n * notified of potential changes.\r\n *\r\n * Settings are accessed via [[Workspace.settings]]. They are defined at the application level by [[IModelHost.appWorkspace]], but individual iModels may supply\r\n * additional iModel-specific settings or overrides for application-level settings. When working in the context of a specific iModel, use [[IModelDb.workspace]]'s `settings`\r\n * property. Any settings not overridden by the iModel will fall back to the settings defined in [[IModelHost.appWorkspace]].\r\n *\r\n * Application settings are loaded into [[IModelHost.appWorkspace]] when the session begins (i.e., when [[IModelHost.startup]] is invoked), and unloaded when it ends (in [[IModelHost.shutdown]]).\r\n * They are read from [JSON5](https://json5.org/) files delivered with the application. The application should register any additional [[SettingsDictionary]]'s '(and their corresponding\r\n * [[SettingGroupSchema]]s) at this time.\r\n *\r\n * iModel-specific settings are stored in the iModel's property table and loaded into [[IModelDb.workspace]] when the iModel is first opened.\r\n * You can add and remove a [[SettingsDictionary]] from the property table using [[IModelDb.saveSettingDictionary]] and [[IModelDb.deleteSettingDictionary]].\r\n *\r\n * See the [learning article]($docs/learning/backend/Workspace) for a detailed overiew and examples.\r\n *\r\n * @see [[IModelHost.appWorkspace]] application-wide settings, and [[IModelDb.workspace]] for settings specific to a given iModel.\r\n * @beta\r\n */\r\nexport interface Settings {\r\n /** @internal */\r\n [_implementationProhibited]: unknown;\r\n\r\n /** @internal */\r\n close(): void;\r\n\r\n /** The set of settings dictionaries from which [[Setting]] values are obtained, sorted by [[SettingsPriority]].\r\n * The set can contain at most one dictionary for each unique combination of name and [[WorkspaceDb]].\r\n * @see [[addDictionary]], [[addFile]], [[addJson]], and [[addDirectory]] to add a new dictionary.\r\n * @see [[dropDictionary]] to remove a dictionary.\r\n * @see [[getDictionary]] to look up a dictionary.\r\n */\r\n readonly dictionaries: readonly SettingsDictionary[];\r\n\r\n /** Event raised whenever a [[SettingsDictionary]] is added or removed. */\r\n readonly onSettingsChanged: BeEvent<() => void>;\r\n\r\n /** Parses the contents of a local [JSON5](https://json5.org/) file as a [[SettingsContainer]] and invokes [[addDictionary]] to\r\n * add a [[SettingsDictionary]] named `fileName` with the specified priority.\r\n * @param fileName the name of a local settings file containing the dictionary.\r\n * @param priority the priority for the dictionary.\r\n */\r\n addFile(fileName: LocalFileName, priority: SettingsPriority): void;\r\n\r\n /** Invokes [[addFile]] for all files in `directory` with the extension \".json\" or \".json5\". */\r\n addDirectory(directory: LocalDirName, priority: SettingsPriority): void;\r\n\r\n /** Parses `settingsJson` as a [[SettingsContainer]] and invokes [[addDictionary]] to add a [[SettingsDictionary]] with the specified `props`.\r\n * This is typically used when reading dictionaries out of a [[WorkspaceDb]], where they are stored as stringified JSON.\r\n */\r\n addJson(props: SettingsDictionaryProps, settingsJson: string): void;\r\n\r\n /** Find a [[SettingsDictionary]] with the same name and [[WorkspaceDb]] as `source`. */\r\n getDictionary(source: SettingsDictionarySource): SettingsDictionary | undefined;\r\n\r\n /** Add a new [[SettingsDictionary]] with the priority, name, and [[WorkspaceDb]] specified by `props` and setting values supplied by `settings`.\r\n * @note If a dictionary with the same name and [[WorkspaceDb]] already exists, it will be replaced.\r\n * @see [[addFile]], [[addJson]], and [[addDirectory]] for convenient ways to add dictionaries from various sources.\r\n */\r\n addDictionary(props: SettingsDictionaryProps, settings: SettingsContainer): void;\r\n\r\n /** Removes a previously-added [[SettingsDictionary]]. */\r\n dropDictionary(props: SettingsDictionarySource): void;\r\n\r\n /** Looks up the highest priority setting value for a SettingName, falling back to a default value if no value for the setting is found.\r\n * The [[dictionaries]] are searched in order by [[SettingsPriority]]; the first one that provides a value for `settingName` wins.\r\n * @param settingName The name of the setting.\r\n * @param defaultValue value returned if settingName is not present in any [[SettingsDictionary]].\r\n * @note This method is generic on [[Setting]] type, but no type checking is actually performed at run time. So, if you\r\n * use this method to get a setting with an expected type, but its value is a different type, the return type of this method will be wrong.\r\n * You must always type check the result. Use the non-generic \"get\" methods like [[getString]] and [[getArray]] if you only want the value\r\n * if its type is correct.\r\n * @note Unlike [[getArray]], this method does not combine arrays - it ignores [[SettingsSchema.combineArrays]].\r\n */\r\n getSetting<T extends Setting>(settingName: SettingName, defaultValue?: T): T | undefined;\r\n\r\n /** Obtain an iterator over all of the values in the [[dictionaries]] for the [[Setting]] identified by `settingName`, ordered by [[SettingsPriority]]. */\r\n getSettingEntries<T extends Setting>(settingName: SettingName): Iterable<{ value: T, dictionary: SettingsDictionary}>;\r\n\r\n /** Obtain an iterator over all of the values in the [[dictionaries]] for the [[Setting]] identified by `settingName`, ordered by [[SettingsPriority]]. */\r\n getSettingValues<T extends Setting>(settingName: SettingName): Iterable<T>;\r\n\r\n /** Look up the value of a string [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.\r\n * @throws Error if the setting exists but is not a string.\r\n */\r\n getString(settingName: SettingName, defaultValue: string): string;\r\n getString(settingName: SettingName, defaultValue?: string): string | undefined;\r\n\r\n /** Look up the value of a boolean [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.\r\n * @throws Error if the setting exists but is not a boolean.\r\n */\r\n getBoolean(settingName: SettingName, defaultValue: boolean): boolean;\r\n getBoolean(settingName: SettingName, defaultValue?: boolean): boolean | undefined;\r\n\r\n /** Look up the value of a numeric [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.\r\n * @throws Error if the setting exists but is not a number.\r\n */\r\n getNumber(settingName: SettingName, defaultValue: number): number;\r\n getNumber(settingName: SettingName): number | undefined;\r\n\r\n /** Look up the value of an object [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.\r\n * @throws Error if the setting exists but is not an object.\r\n */\r\n getObject<T extends object>(settingName: SettingName, defaultValue: T): T;\r\n getObject<T extends object>(settingName: SettingName): T | undefined;\r\n\r\n /** Look up the value of an array [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.\r\n * @throws Error if the setting exists but is not an array.\r\n */\r\n getArray<T extends Setting>(settingName: SettingName, defaultValue: Array<T>): Array<T>;\r\n getArray<T extends Setting>(settingName: SettingName): Array<T> | undefined;\r\n}\r\n"]}
1
+ {"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../../src/workspace/Settings.ts"],"names":[],"mappings":"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CAAC;IAC/B,6DAA6D;IAChD,6BAAY,GAAG,GAAG,CAAC;IAChC,sDAAsD;IACzC,sBAAK,GAAG,GAAG,CAAC;IACzB,wDAAwD;IAC3C,uBAAM,GAAG,GAAG,CAAC;IAC1B,gDAAgD;IACnC,uBAAM,GAAG,GAAG,CAAC;AAC5B,CAAC,EAbgB,gBAAgB,KAAhB,gBAAgB,QAahC","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 { BeEvent, JSONSchemaType } from \"@itwin/core-bentley\";\nimport { LocalDirName, LocalFileName } from \"@itwin/core-common\";\nimport { WorkspaceDb } from \"./Workspace\";\nimport { _implementationProhibited } from \"../internal/Symbols\";\n\n/** The value of a single named parameter within a [[Workspace.settings]] that configures some aspect of the applications run-time behavior.\n * Settings are stored in a [[SettingsDictionary]]. A setting is described by its [[SettingSchema]].\n * @beta\n */\nexport type Setting = JSONSchemaType;\n\n/** @beta */\nexport namespace Setting { // eslint-disable-line @typescript-eslint/no-redeclare\n /** Create a deep copy of a [[Setting]]. */\n export function clone<T extends Setting>(setting: T): T {\n if (!setting || typeof setting !== \"object\")\n return setting;\n\n const result = Array.isArray(setting) ? [] : {} as any;\n Object.keys(setting).forEach((key: string) => result[key] = clone((setting as any)[key]));\n return result;\n }\n\n /** Returns true if `a` and `b` are considered equivalent [[Setting]] values.\n * Settings of primitive types like `number` and `string` are compared using `===`.\n * Settings of type \"object\" are compared by comparing each property using `areEqual`; the objects are considered\n * equal if they have the exact same set of property names with equivalent values.\n * Settings of type \"array\" are compared by comparing each element of the arrays use `areEqual`; the arrays are considered\n * equal if they have the same number of elements with equivalent values in the same exact order.\n */\n export function areEqual(a: Setting | undefined, b: Setting | undefined): boolean {\n if (a === b) {\n return true;\n }\n\n // For primitive types, === suffices.\n if (typeof a !== \"object\" || typeof b !== \"object\") {\n return false;\n }\n\n if (Array.isArray(a) || Array.isArray(b)) {\n if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n\n for (let i = 0; i < a.length; i++) {\n if (!areEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n\n aKeys.sort();\n bKeys.sort();\n for (let i = 0; i < aKeys.length; i++) {\n const key = aKeys[i];\n if (key !== bKeys[i]) {\n return false;\n }\n\n if (!areEqual((a as SettingsContainer)[key], (b as SettingsContainer)[key])) {\n return false;\n }\n }\n\n return true;\n }\n}\n\n/**\n * The name of a [[Setting]].\n * Setting names must be [valid JavaScript property names](https://developer.mozilla.org/en-US/docs/Glossary/property/JavaScript) containing no spaces or periods.\n * The name of a setting begins with the schema prefix of the [[SettingGroupSchema]] in which its [[SettingSchema]] is defined.\n * A setting name therefore forms a path like file names in a file system.\n * For example, the following are setting names defined in the `energyAnalysis`, `iot-scan-visualization`, and `vibration-map` schemas.\n *\n * ```ts\n * \"energyAnalysis/formats/totalWork\"\n * \"energyAnalysis/formats/totalHours\"\n * \"energyAnalysis/units/power\"\n * \"energyAnalysis/units/temperature\"\n * \"energyAnalysis/startupMode\"\n * \"iot-scan-visualization/ports/cameras\"\n * \"vibration-map/filters/scope\"\n * \"vibration-map/filters/prefabricated\"\n * ```\n *\n * @beta\n */\nexport type SettingName = string;\n\n/** An object that defines the values for any number of [[Setting]]s. Each of its properties' names must conform to the semantics of a [[SettingName]].\n * @beta\n */\nexport interface SettingsContainer {\n /** Accesses settings by their names. */\n [name: SettingName]: Setting | undefined;\n}\n\n/** Defines the precedence of a [[SettingsDictionary]].\n * [[Settings]] may contain multiple dictionaries containing different values for the same [[SettingName]].\n * When resolving the value of a [[Setting]], the value from the highest-priority dictionary is used.\n * Priorities are grouped into coarse categories like [[SettingsPriority.application]] and [[SettingsPriority.iModel]].\n * Settings with priorities less than or equal to [[SettingsPriority.application]] are stored in [[IModelHost.appWorkspace]], while\n * those with priorities higher than [[SettingsPriority.application]] are stored inside [[IModelDb.workspace]].\n * @beta\n */\nexport type SettingsPriority = number;\n\n/** @beta */\nexport namespace SettingsPriority { // eslint-disable-line @typescript-eslint/no-redeclare\n /** Settings that originate from default setting files loaded automatically at the start of a session. */\n export const defaults = 100;\n /** Settings supplied by an application at runtime. */\n export const application = 200;\n /** Settings that apply to all iTwins for an organization. */\n export const organization = 300;\n /** Settings that apply to all iModels in an iTwin. */\n export const iTwin = 400;\n /** Settings that apply to all branches of an iModel. */\n export const branch = 500;\n /** Settings that apply to a specific iModel. */\n export const iModel = 600;\n}\n\n/** A named container that supplies values for [[Setting]]s.\n * @see [[Settings.addDictionary]] to register a new settings dictionary.\n * @beta\n */\nexport interface SettingsDictionary {\n /** @internal */\n [_implementationProhibited]: unknown;\n\n /** Metadata describing the dictionary. */\n readonly props: SettingsDictionaryProps;\n\n /** Obtain a copy of the value of the setting named `settingName` stored in this dictionary, or `undefined` if no such setting exists.\n * The returned value is always cloned using [[Setting.clone]].\n * @note Generally, applications use methods like [[Settings.getString]] and [[Setting.getArray]] to resolve a setting value from multiple\n * dictionaries. Those methods - unlike this one - also validate that `settingName` is of type `T` as defined by its [[SettingSchema]].\n */\n getSetting<T extends Setting>(settingName: SettingName): T | undefined;\n\n /** Return a deep copy of all settings in this dictionary as a [[SettingsContainer]].\n * This is useful for inspecting the full contents of the dictionary or for building a modified copy\n * to pass to [[EditableSettingsDb.updateSettingsDictionary]].\n * The returned container is cloned using [[Setting.clone]], so callers may freely mutate it without\n * affecting this dictionary's internal state.\n * @beta\n */\n toJSON(): SettingsContainer;\n}\n\n/** Uniquely identifies a [[SettingsDictionary]].\n * @beta\n */\nexport interface SettingsDictionarySource {\n /** The name of the dictionary, which must be unique within its [[workspaceDb]], or - if [[workspaceDb]] is undefined - unique among all dictionaries not associated with any [[WorkspaceDb]]. */\n readonly name: string;\n /** The [[WorkspaceDb]] from which the dictionary originated. */\n readonly workspaceDb?: WorkspaceDb;\n}\n\n/** Properties of a [[SettingsDictionary]], defining its name, the [[WorkspaceDb]] (if any) from which it originated, and its [[priority]] relative to other dictionaries.\n * @beta\n */\nexport interface SettingsDictionaryProps extends SettingsDictionarySource {\n /** Precedence value determining which setting value to use when multiple dictionaries supply values for the same [[SettingName]]. */\n readonly priority: SettingsPriority;\n}\n\n/**\n * The collection of [[Setting]]s that supply the run-time configuration of a [[Workspace]].\n * The `Settings` object comprises a collection of named [[SettingsDictionary]] objects.\n * Methods like [[getSetting]], [[getString]], and [[getArray]] provide access to the value of an individual [[Setting]] by searching\n * the [[dictionaries]] in order by their [[SettingsPriority]] to find the highest-priority setting with the requested [[SettingName]].\n * Most methods that retrieve [[Setting]] values validate them against their [[SettingSchema]]s to ensure that they are of the correct type.\n * A [[SettingsDictionary]] can be added or removed using [[addDictionary]] and [[dropDictionary]].\n * Because [[Setting]]s can change at any time during the session, you should avoid caching their values wherever possible.\n * If you must cache them (for example, to display in a user interface), you should listen for the [[onSettingsChanged]] event to be\n * notified of potential changes.\n *\n * Settings are accessed via [[Workspace.settings]]. They are defined at the application level by [[IModelHost.appWorkspace]], but individual iModels may supply\n * additional iModel-specific settings or overrides for application-level settings. When working in the context of a specific iModel, use [[IModelDb.workspace]]'s `settings`\n * property. Any settings not overridden by the iModel will fall back to the settings defined in [[IModelHost.appWorkspace]].\n *\n * Application settings are loaded into [[IModelHost.appWorkspace]] when the session begins (i.e., when [[IModelHost.startup]] is invoked), and unloaded when it ends (in [[IModelHost.shutdown]]).\n * They are read from [JSON5](https://json5.org/) files delivered with the application. The application should register any additional [[SettingsDictionary]]'s '(and their corresponding\n * [[SettingGroupSchema]]s) at this time.\n *\n * iModel-specific settings are stored in the iModel's property table and loaded into [[IModelDb.workspace]] when the iModel is first opened.\n * You can add and remove a [[SettingsDictionary]] from the property table using [[IModelDb.saveSettingDictionary]] and [[IModelDb.deleteSettingDictionary]].\n *\n * See the [learning article]($docs/learning/backend/Workspace) for a detailed overiew and examples.\n *\n * @see [[IModelHost.appWorkspace]] application-wide settings, and [[IModelDb.workspace]] for settings specific to a given iModel.\n * @beta\n */\nexport interface Settings {\n /** @internal */\n [_implementationProhibited]: unknown;\n\n /** @internal */\n close(): void;\n\n /** The set of settings dictionaries from which [[Setting]] values are obtained, sorted by [[SettingsPriority]].\n * The set can contain at most one dictionary for each unique combination of name and [[WorkspaceDb]].\n * @see [[addDictionary]], [[addFile]], [[addJson]], and [[addDirectory]] to add a new dictionary.\n * @see [[dropDictionary]] to remove a dictionary.\n * @see [[getDictionary]] to look up a dictionary.\n */\n readonly dictionaries: readonly SettingsDictionary[];\n\n /** Event raised whenever a [[SettingsDictionary]] is added or removed. */\n readonly onSettingsChanged: BeEvent<() => void>;\n\n /** Parses the contents of a local [JSON5](https://json5.org/) file as a [[SettingsContainer]] and invokes [[addDictionary]] to\n * add a [[SettingsDictionary]] named `fileName` with the specified priority.\n * @param fileName the name of a local settings file containing the dictionary.\n * @param priority the priority for the dictionary.\n */\n addFile(fileName: LocalFileName, priority: SettingsPriority): void;\n\n /** Invokes [[addFile]] for all files in `directory` with the extension \".json\" or \".json5\". */\n addDirectory(directory: LocalDirName, priority: SettingsPriority): void;\n\n /** Parses `settingsJson` as a [[SettingsContainer]] and invokes [[addDictionary]] to add a [[SettingsDictionary]] with the specified `props`.\n * This is typically used when reading dictionaries out of a [[WorkspaceDb]], where they are stored as stringified JSON.\n */\n addJson(props: SettingsDictionaryProps, settingsJson: string): void;\n\n /** Find a [[SettingsDictionary]] with the same name and [[WorkspaceDb]] as `source`. */\n getDictionary(source: SettingsDictionarySource): SettingsDictionary | undefined;\n\n /** Add a new [[SettingsDictionary]] with the priority, name, and [[WorkspaceDb]] specified by `props` and setting values supplied by `settings`.\n * @note If a dictionary with the same name and [[WorkspaceDb]] already exists, it will be replaced.\n * @see [[addFile]], [[addJson]], and [[addDirectory]] for convenient ways to add dictionaries from various sources.\n */\n addDictionary(props: SettingsDictionaryProps, settings: SettingsContainer): void;\n\n /** Removes a previously-added [[SettingsDictionary]]. */\n dropDictionary(props: SettingsDictionarySource): void;\n\n /** Looks up the highest priority setting value for a SettingName, falling back to a default value if no value for the setting is found.\n * The [[dictionaries]] are searched in order by [[SettingsPriority]]; the first one that provides a value for `settingName` wins.\n * @param settingName The name of the setting.\n * @param defaultValue value returned if settingName is not present in any [[SettingsDictionary]].\n * @note This method is generic on [[Setting]] type, but no type checking is actually performed at run time. So, if you\n * use this method to get a setting with an expected type, but its value is a different type, the return type of this method will be wrong.\n * You must always type check the result. Use the non-generic \"get\" methods like [[getString]] and [[getArray]] if you only want the value\n * if its type is correct.\n * @note Unlike [[getArray]], this method does not combine arrays - it ignores [[SettingsSchema.combineArrays]].\n */\n getSetting<T extends Setting>(settingName: SettingName, defaultValue?: T): T | undefined;\n\n /** Obtain an iterator over all of the values in the [[dictionaries]] for the [[Setting]] identified by `settingName`, ordered by [[SettingsPriority]]. */\n getSettingEntries<T extends Setting>(settingName: SettingName): Iterable<{ value: T, dictionary: SettingsDictionary}>;\n\n /** Obtain an iterator over all of the values in the [[dictionaries]] for the [[Setting]] identified by `settingName`, ordered by [[SettingsPriority]]. */\n getSettingValues<T extends Setting>(settingName: SettingName): Iterable<T>;\n\n /** Look up the value of a string [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.\n * @throws Error if the setting exists but is not a string.\n */\n getString(settingName: SettingName, defaultValue: string): string;\n getString(settingName: SettingName, defaultValue?: string): string | undefined;\n\n /** Look up the value of a boolean [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.\n * @throws Error if the setting exists but is not a boolean.\n */\n getBoolean(settingName: SettingName, defaultValue: boolean): boolean;\n getBoolean(settingName: SettingName, defaultValue?: boolean): boolean | undefined;\n\n /** Look up the value of a numeric [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.\n * @throws Error if the setting exists but is not a number.\n */\n getNumber(settingName: SettingName, defaultValue: number): number;\n getNumber(settingName: SettingName): number | undefined;\n\n /** Look up the value of an object [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.\n * @throws Error if the setting exists but is not an object.\n */\n getObject<T extends object>(settingName: SettingName, defaultValue: T): T;\n getObject<T extends object>(settingName: SettingName): T | undefined;\n\n /** Look up the value of an array [[Setting]] named `settingName`, returning `defaultValue` if no such value is defined.\n * @throws Error if the setting exists but is not an array.\n */\n getArray<T extends Setting>(settingName: SettingName, defaultValue: Array<T>): Array<T>;\n getArray<T extends Setting>(settingName: SettingName): Array<T> | undefined;\n}\n"]}
@@ -0,0 +1,109 @@
1
+ /** @packageDocumentation
2
+ * @module Workspace
3
+ */
4
+ import { Setting, SettingName, SettingsContainer, SettingsPriority } from "./Settings";
5
+ import { CloudSqliteContainer, WorkspaceContainerId, WorkspaceDbName } from "./Workspace";
6
+ import { _implementationProhibited } from "../internal/Symbols";
7
+ /** Metadata stored inside a [[SettingsDb]] describing the database's contents, to help users understand
8
+ * the purpose of the [[SettingsDb]] and who to contact with questions about it.
9
+ * @note Only the `settingsName` field is required, and users may add additional fields for their own purposes.
10
+ * @note Since the information is stored inside the [[SettingsDb]], it is versioned along with the rest of the contents.
11
+ * @beta
12
+ */
13
+ export interface SettingsDbManifest {
14
+ /** The name of the [[SettingsDb]] to be shown in user interfaces. Organizations should attempt to make this name
15
+ * informative enough so that users may refer to it in conversations.
16
+ */
17
+ readonly settingsName: string;
18
+ /** A description of the contents of this [[SettingsDb]] to help users understand its purpose and appropriate usage. */
19
+ readonly description?: string;
20
+ /** The name of the person to contact with questions about this [[SettingsDb]]. */
21
+ readonly contactName?: string;
22
+ /** The name of the person who last modified this [[SettingsDb]]. */
23
+ readonly lastEditedBy?: string;
24
+ }
25
+ /** Properties that specify how to load a [[SettingsDb]] within a [[CloudSqliteContainer]].
26
+ * @beta
27
+ */
28
+ export interface SettingsDbProps {
29
+ /** The base name of the [[SettingsDb]], without any version information. Default: `"settings-db"`. */
30
+ readonly dbName?: WorkspaceDbName;
31
+ /** The [semver](https://github.com/npm/node-semver) version string or range for the desired [[SettingsDb]].
32
+ * If not specified, the latest available version is used.
33
+ */
34
+ readonly version?: string;
35
+ }
36
+ /** Arguments for obtaining a [[SettingsDb]] from a previously-loaded container.
37
+ * @beta
38
+ */
39
+ export interface GetSettingsDbArgs {
40
+ /** The [[WorkspaceContainerId]] of the cloud container that holds the [[SettingsDb]].
41
+ * This is an opaque GUID assigned by the BlobContainer service when the container is created — it is
42
+ * **not** the same as an iTwinId or iModelId.
43
+ */
44
+ readonly containerId: WorkspaceContainerId;
45
+ /** The priority to assign to dictionaries loaded from this [[SettingsDb]]. */
46
+ readonly priority: SettingsPriority;
47
+ /** The name of the [[SettingsDb]] to retrieve. Default: `"settings-db"`. */
48
+ readonly dbName?: WorkspaceDbName;
49
+ /** The semantic version string or range for the desired [[SettingsDb]].
50
+ * If not specified, the latest available version is used.
51
+ */
52
+ readonly version?: string;
53
+ }
54
+ /** A CloudSQLite database dedicated to storing settings as key-value pairs. Unlike a general-purpose [[WorkspaceDb]],
55
+ * a `SettingsDb` restricts its API surface to settings-only operations, providing a focused interface
56
+ * for reading settings by name.
57
+ *
58
+ * Internally, all settings are stored in a single JSON blob. Each setting is a named entry in a [[SettingsContainer]].
59
+ *
60
+ * A `SettingsDb` resides in a [[CloudSqliteContainer]] and can be published to the cloud. Once published,
61
+ * the `SettingsDb` becomes immutable; however, multiple versions may be created to allow settings to evolve over time.
62
+ * @beta
63
+ */
64
+ export interface SettingsDb {
65
+ /** @internal */
66
+ [_implementationProhibited]: unknown;
67
+ /** The [[CloudSqliteContainer]] in which this database resides. */
68
+ readonly container: CloudSqliteContainer;
69
+ /** The base name of this SettingsDb, without version. */
70
+ readonly dbName: string;
71
+ /** The resolved [semver](https://github.com/npm/node-semver) version of this SettingsDb.
72
+ * @note For local (non-cloud) containers, this property returns `"0.0.0"`.
73
+ */
74
+ readonly version: string;
75
+ /** The priority assigned to dictionaries loaded from this SettingsDb. */
76
+ readonly priority: SettingsPriority;
77
+ /** Whether the underlying database is currently open. */
78
+ readonly isOpen: boolean;
79
+ /** The manifest describing the contents of this SettingsDb. */
80
+ readonly manifest: SettingsDbManifest;
81
+ /** Open the underlying database for querying. When performing significant activity against a SettingsDb,
82
+ * open it before the operations and [[close]] it afterwards.
83
+ * @note Explicit open/close is a performance optimization for batches of operations. Individual methods like
84
+ * [[getSetting]] and [[getSettings]] will auto-open and auto-close the database if it is not already open.
85
+ */
86
+ open(): void;
87
+ /** Close the underlying database. You should call this after [[open]]ing the database and completing your queries.
88
+ * @note For [[EditableSettingsDb]] instances, if the container's write lock is currently held, closing persists
89
+ * any pending changes and updates the manifest's `lastEditedBy` field with the current write lock holder.
90
+ */
91
+ close(): void;
92
+ /** Return a copy of the value of the setting named `settingName`, or `undefined` if not found.
93
+ * The returned value is always cloned using [[Setting.clone]].
94
+ * @param settingName The name of the setting to retrieve.
95
+ */
96
+ getSetting<T extends Setting>(settingName: SettingName): T | undefined;
97
+ /** Return a deep copy of all settings stored in this SettingsDb as a [[SettingsContainer]].
98
+ * @note The returned object is a fresh copy — mutating it will not affect the stored settings.
99
+ */
100
+ getSettings(): SettingsContainer;
101
+ }
102
+ /** The default resource name used to store settings in a [[SettingsDb]].
103
+ * This is the key under which all settings are stored in the SQLite `strings` table.
104
+ * When loading settings at runtime via [[Workspace.loadSettingsDictionary]], the `resourceName` defaults
105
+ * to this value, ensuring the read and write paths always agree on which key to use.
106
+ * @internal
107
+ */
108
+ export declare const settingsResourceName = "settings";
109
+ //# sourceMappingURL=SettingsDb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsDb.d.ts","sourceRoot":"","sources":["../../../src/workspace/SettingsDb.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,aAAa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AC/D,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IAEtC;;;;OAIG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;;OAGG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;;OAGG;IACH,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,WAAW,EAAE,WAAW,GAAG,CAAC,GAAG,SAAS,CAAC;IAEvE;;OAEG;IACH,WAAW,IAAI,iBAAiB,CAAC;CAClC;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,aAAa,CAAC"}
@@ -0,0 +1,16 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Workspace
7
+ */
8
+ import { _implementationProhibited } from "../internal/Symbols";
9
+ /** The default resource name used to store settings in a [[SettingsDb]].
10
+ * This is the key under which all settings are stored in the SQLite `strings` table.
11
+ * When loading settings at runtime via [[Workspace.loadSettingsDictionary]], the `resourceName` defaults
12
+ * to this value, ensuring the read and write paths always agree on which key to use.
13
+ * @internal
14
+ */
15
+ export const settingsResourceName = "settings";
16
+ //# sourceMappingURL=SettingsDb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsDb.js","sourceRoot":"","sources":["../../../src/workspace/SettingsDb.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAyGhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Workspace\n */\n\nimport { Setting, SettingName, SettingsContainer, SettingsPriority } from \"./Settings\";\nimport { CloudSqliteContainer, WorkspaceContainerId, WorkspaceDbName } from \"./Workspace\";\nimport { _implementationProhibited } from \"../internal/Symbols\";\n\n/** Metadata stored inside a [[SettingsDb]] describing the database's contents, to help users understand\n * the purpose of the [[SettingsDb]] and who to contact with questions about it.\n * @note Only the `settingsName` field is required, and users may add additional fields for their own purposes.\n * @note Since the information is stored inside the [[SettingsDb]], it is versioned along with the rest of the contents.\n * @beta\n */\nexport interface SettingsDbManifest {\n /** The name of the [[SettingsDb]] to be shown in user interfaces. Organizations should attempt to make this name\n * informative enough so that users may refer to it in conversations.\n */\n readonly settingsName: string;\n /** A description of the contents of this [[SettingsDb]] 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 [[SettingsDb]]. */\n readonly contactName?: string;\n /** The name of the person who last modified this [[SettingsDb]]. */\n readonly lastEditedBy?: string;\n}\n\n/** Properties that specify how to load a [[SettingsDb]] within a [[CloudSqliteContainer]].\n * @beta\n */\nexport interface SettingsDbProps {\n /** The base name of the [[SettingsDb]], without any version information. Default: `\"settings-db\"`. */\n readonly dbName?: WorkspaceDbName;\n /** The [semver](https://github.com/npm/node-semver) version string or range for the desired [[SettingsDb]].\n * If not specified, the latest available version is used.\n */\n readonly version?: string;\n}\n\n/** Arguments for obtaining a [[SettingsDb]] from a previously-loaded container.\n * @beta\n */\nexport interface GetSettingsDbArgs {\n /** The [[WorkspaceContainerId]] of the cloud container that holds the [[SettingsDb]].\n * This is an opaque GUID assigned by the BlobContainer service when the container is created — it is\n * **not** the same as an iTwinId or iModelId.\n */\n readonly containerId: WorkspaceContainerId;\n /** The priority to assign to dictionaries loaded from this [[SettingsDb]]. */\n readonly priority: SettingsPriority;\n /** The name of the [[SettingsDb]] to retrieve. Default: `\"settings-db\"`. */\n readonly dbName?: WorkspaceDbName;\n /** The semantic version string or range for the desired [[SettingsDb]].\n * If not specified, the latest available version is used.\n */\n readonly version?: string;\n}\n\n/** A CloudSQLite database dedicated to storing settings as key-value pairs. Unlike a general-purpose [[WorkspaceDb]],\n * a `SettingsDb` restricts its API surface to settings-only operations, providing a focused interface\n * for reading settings by name.\n *\n * Internally, all settings are stored in a single JSON blob. Each setting is a named entry in a [[SettingsContainer]].\n *\n * A `SettingsDb` resides in a [[CloudSqliteContainer]] and can be published to the cloud. Once published,\n * the `SettingsDb` becomes immutable; however, multiple versions may be created to allow settings to evolve over time.\n * @beta\n */\nexport interface SettingsDb {\n /** @internal */\n [_implementationProhibited]: unknown;\n /** The [[CloudSqliteContainer]] in which this database resides. */\n readonly container: CloudSqliteContainer;\n /** The base name of this SettingsDb, without version. */\n readonly dbName: string;\n /** The resolved [semver](https://github.com/npm/node-semver) version of this SettingsDb.\n * @note For local (non-cloud) containers, this property returns `\"0.0.0\"`.\n */\n readonly version: string;\n /** The priority assigned to dictionaries loaded from this SettingsDb. */\n readonly priority: SettingsPriority;\n /** Whether the underlying database is currently open. */\n readonly isOpen: boolean;\n /** The manifest describing the contents of this SettingsDb. */\n readonly manifest: SettingsDbManifest;\n\n /** Open the underlying database for querying. When performing significant activity against a SettingsDb,\n * open it before the operations and [[close]] it afterwards.\n * @note Explicit open/close is a performance optimization for batches of operations. Individual methods like\n * [[getSetting]] and [[getSettings]] will auto-open and auto-close the database if it is not already open.\n */\n open(): void;\n\n /** Close the underlying database. You should call this after [[open]]ing the database and completing your queries.\n * @note For [[EditableSettingsDb]] instances, if the container's write lock is currently held, closing persists\n * any pending changes and updates the manifest's `lastEditedBy` field with the current write lock holder.\n */\n close(): void;\n\n /** Return a copy of the value of the setting named `settingName`, or `undefined` if not found.\n * The returned value is always cloned using [[Setting.clone]].\n * @param settingName The name of the setting to retrieve.\n */\n getSetting<T extends Setting>(settingName: SettingName): T | undefined;\n\n /** Return a deep copy of all settings stored in this SettingsDb as a [[SettingsContainer]].\n * @note The returned object is a fresh copy — mutating it will not affect the stored settings.\n */\n getSettings(): SettingsContainer;\n}\n\n/** The default resource name used to store settings in a [[SettingsDb]].\n * This is the key under which all settings are stored in the SQLite `strings` table.\n * When loading settings at runtime via [[Workspace.loadSettingsDictionary]], the `resourceName` defaults\n * to this value, ensuring the read and write paths always agree on which key to use.\n * @internal\n */\nexport const settingsResourceName = \"settings\";\n"]}
@@ -0,0 +1,250 @@
1
+ /** @packageDocumentation
2
+ * @module Workspace
3
+ */
4
+ import { LocalFileName } from "@itwin/core-common";
5
+ import { GuidString } from "@itwin/core-bentley";
6
+ import { Setting, SettingName, SettingsContainer } from "./Settings";
7
+ import { BlobContainer } from "../BlobContainerService";
8
+ import { CloudSqliteContainer, GetWorkspaceContainerArgs, Workspace, WorkspaceContainerProps, WorkspaceDbName, WorkspaceDbNameAndVersion, WorkspaceDbVersion } from "./Workspace";
9
+ import { SettingsDb, SettingsDbManifest, SettingsDbProps } from "./SettingsDb";
10
+ import { _implementationProhibited } from "../internal/Symbols";
11
+ import { CloudSqlite } from "../CloudSqlite";
12
+ /** @beta */
13
+ export declare namespace SettingsEditor {
14
+ /**
15
+ * Create a new [[SettingsEditor]] for creating new versions of [[SettingsDb]]s.
16
+ * @note The caller becomes the owner of the SettingsEditor and is responsible for calling [[SettingsEditor.close]] on it when finished.
17
+ * @note It is illegal to have more than one SettingsEditor active in a single session.
18
+ */
19
+ function construct(): SettingsEditor;
20
+ /**
21
+ * Create a new, empty, [[SettingsDb]] file on the local filesystem for importing settings dictionaries.
22
+ * @note Do not pass an untrusted or unintended path in `localFileName`.
23
+ * This helper creates or overwrites the file at that location; callers that need fail-if-exists behavior should check first.
24
+ */
25
+ function createEmptyDb(args: {
26
+ localFileName: LocalFileName;
27
+ manifest: SettingsDbManifest;
28
+ }): void;
29
+ /** Arguments for [[SettingsEditor.queryContainers]] and [[SettingsEditor.findContainers]]. */
30
+ interface QuerySettingsContainersArgs {
31
+ /** The iTwinId whose settings containers should be queried. */
32
+ iTwinId: GuidString;
33
+ /** Optional iModelId to further scope the query to containers associated with a specific iModel. */
34
+ iModelId?: GuidString;
35
+ /** Optional label filter. */
36
+ label?: string;
37
+ }
38
+ /**
39
+ * Query the [[BlobContainer]] service for all settings containers associated with a given iTwin.
40
+ * This is a convenience wrapper around `BlobContainer.service.queryContainersMetadata` that
41
+ * automatically filters by `containerType: "settings"`.
42
+ * @param args - The query arguments including the iTwinId.
43
+ * @returns A promise that resolves to the matching container metadata entries.
44
+ * @note Requires [[IModelHost.authorizationClient]] to be configured.
45
+ */
46
+ function queryContainers(args: QuerySettingsContainersArgs): Promise<BlobContainer.MetadataResponse[]>;
47
+ }
48
+ /** Arguments supplied to [[SettingsEditor.createNewCloudContainer]] to create a new [[EditableSettingsCloudContainer]].
49
+ * The created container will automatically have `containerType: "settings"` in its metadata, enabling discovery
50
+ * via `BlobContainer.service.queryContainersMetadata({ containerType: "settings" })`.
51
+ * @beta
52
+ */
53
+ export interface CreateNewSettingsContainerArgs {
54
+ /**
55
+ * The scope of the container. This determines the ownership of the container, how RBAC rights are assigned,
56
+ * and the location of the datacenter.
57
+ */
58
+ scope: BlobContainer.Scope;
59
+ /** The manifest to be stored in the default SettingsDb in the new container. */
60
+ manifest: SettingsDbManifest;
61
+ /** Metadata stored by the BlobContainer service. The `containerType` field is omitted here because it is
62
+ * automatically set to `"settings"` when the container is created (mirroring the `"workspace"` convention for WorkspaceDb containers).
63
+ */
64
+ metadata: Omit<BlobContainer.Metadata, "containerType">;
65
+ /** The name of the default [[SettingsDb]] created inside the new container.
66
+ * Default: "settings-db";
67
+ */
68
+ dbName?: WorkspaceDbName;
69
+ }
70
+ /** Arguments supplied to [[EditableSettingsCloudContainer.createNewSettingsDbVersion]].
71
+ * @beta
72
+ */
73
+ export interface CreateNewSettingsDbVersionArgs {
74
+ /**
75
+ * The properties that determine the source [[SettingsDb]] to serve as the basis for the new version.
76
+ * This is usually the latest version, but it is possible to create patches to older versions.
77
+ */
78
+ fromProps?: SettingsDbProps;
79
+ /** The type of version increment to apply to the source version. */
80
+ versionType: CloudSqlite.SemverIncrement;
81
+ /** For prerelease versions, a string that becomes part of the version name. */
82
+ identifier?: string;
83
+ }
84
+ /** The result of creating a new version of a [[SettingsDb]].
85
+ * @beta
86
+ */
87
+ export interface SettingsDbVersionResult {
88
+ /** The name and version of the source SettingsDb. */
89
+ oldDb: WorkspaceDbNameAndVersion;
90
+ /** The name and version of the newly-created SettingsDb. */
91
+ newDb: WorkspaceDbNameAndVersion;
92
+ }
93
+ /** Arguments supplied to [[EditableSettingsCloudContainer.createDb]] to create a new [[SettingsDb]] in a container.
94
+ * @beta
95
+ */
96
+ export interface CreateSettingsDbArgs {
97
+ /** The name of the new SettingsDb. Default: `"settings-db"`. */
98
+ dbName?: WorkspaceDbName;
99
+ /** The initial version of the new SettingsDb. Default: `"0.0.0"`. */
100
+ version?: WorkspaceDbVersion;
101
+ /** The manifest for the new SettingsDb. */
102
+ manifest: SettingsDbManifest;
103
+ }
104
+ /** Arguments supplied to [[EditableSettingsDb.updateSetting]] to add or update a single [[Setting]].
105
+ * @beta
106
+ */
107
+ export interface UpdateSettingArgs {
108
+ /** The [[SettingName]] of the setting to add or update. */
109
+ readonly settingName: SettingName;
110
+ /** The new value for the setting. */
111
+ readonly value: Setting;
112
+ }
113
+ /**
114
+ * A [[CloudSqliteContainer]] opened for editing settings by a [[SettingsEditor]].
115
+ * You can create new [[SettingsDb]]s or new versions of existing [[SettingsDb]]s inside it.
116
+ * Before actually making any changes to the container's contents, you must first obtain an exclusive write lock on it via
117
+ * [[acquireWriteLock]]. Only one user can hold the write lock at any given time. When you have finished making changes,
118
+ * you can use [[releaseWriteLock]] to publish your changes, or [[abandonChanges]] to discard them.
119
+ * @note Settings containers are separate from workspace containers, providing independent write locks.
120
+ * Editing settings does not block workspace resource editing, and vice versa.
121
+ * @beta
122
+ */
123
+ export interface EditableSettingsCloudContainer extends CloudSqliteContainer {
124
+ /**
125
+ * Create a copy of an existing [[SettingsDb]] in this container with a new [[WorkspaceDbVersion]].
126
+ * The copy should be modified with new content before the write lock is released,
127
+ * and thereafter may never be modified again.
128
+ * @param args - The properties that determine the source SettingsDb and the version increment to apply.
129
+ * @returns A promise that resolves to an object containing the old and new SettingsDb names and versions.
130
+ */
131
+ createNewSettingsDbVersion(args: CreateNewSettingsDbVersionArgs): Promise<SettingsDbVersionResult>;
132
+ /**
133
+ * Create a new, empty [[SettingsDb]].
134
+ * @param args - The arguments for creating the new SettingsDb.
135
+ * @returns A promise that resolves to an EditableSettingsDb.
136
+ */
137
+ createDb(args: CreateSettingsDbArgs): Promise<EditableSettingsDb>;
138
+ /**
139
+ * Get the cloud properties of this container.
140
+ */
141
+ readonly cloudProps: WorkspaceContainerProps | undefined;
142
+ /**
143
+ * Get an editable [[SettingsDb]] to add, delete, or update settings *within a newly created version* of a SettingsDb.
144
+ * Repeated calls that resolve to the same SettingsDb return the same cached instance.
145
+ * @param props - The properties of the SettingsDb.
146
+ * @returns An EditableSettingsDb for modifying settings.
147
+ * @throws if the targeted SettingsDb has already been published and is immutable. Use [[createNewSettingsDbVersion]] first to create an editable version.
148
+ */
149
+ getEditableDb(props?: SettingsDbProps): EditableSettingsDb;
150
+ /**
151
+ * Acquire the write lock on the container. Use [[releaseWriteLock]] to release the lock after publishing your changes, or
152
+ * [[abandonChanges]] to release the lock and discard your changes.
153
+ * Only one user can hold the write lock at any given time. However, readers can continue to read the published contents of the container while
154
+ * a writer holds the write lock. Readers will only see the writer's changes after they are published by [[releaseWriteLock]].
155
+ * @param user - The name of the user acquiring the write lock.
156
+ * @throws if the write lock is already held by another user.
157
+ */
158
+ acquireWriteLock(user: string): void;
159
+ /**
160
+ * Release the write lock on the container. This should be called after all changes to the container's contents are complete. It
161
+ * publishes and uploads the changes made to any [[SettingsDb]]s while the lock was held, after which those dbs become immutable.
162
+ */
163
+ releaseWriteLock(): void;
164
+ /**
165
+ * Abandon any changes made to the container and release the write lock. Any newly created versions of SettingsDbs are discarded.
166
+ */
167
+ abandonChanges(): void;
168
+ }
169
+ /**
170
+ * An editable [[SettingsDb]]. This is used only by tools to allow administrators to create and modify SettingsDbs.
171
+ * For cloud-based SettingsDbs, the container's write token must be obtained via [[EditableSettingsCloudContainer.acquireWriteLock]] before the methods in this interface may be used.
172
+ * Normally, only admins will have write access.
173
+ * Only one admin at a time may be editing a settings container.
174
+ * @note Unlike [[EditableWorkspaceDb]], this interface only supports settings operations — no blob, file, or string resource methods.
175
+ * @beta
176
+ */
177
+ export interface EditableSettingsDb extends SettingsDb {
178
+ /** The editable container that owns this SettingsDb. */
179
+ readonly container: EditableSettingsCloudContainer;
180
+ /**
181
+ * Update the contents of the manifest in this SettingsDb.
182
+ * @note This replaces the stored manifest entirely; omitted fields are lost.
183
+ * @param manifest - The updated manifest.
184
+ */
185
+ updateManifest(manifest: SettingsDbManifest): void;
186
+ /**
187
+ * Replace all settings in this SettingsDb with the given container.
188
+ * @param settings - The settings object to store.
189
+ */
190
+ updateSettings(settings: SettingsContainer): void;
191
+ /**
192
+ * Add or update a single [[Setting]] by name.
193
+ * If a setting with the given name already exists, its value is replaced.
194
+ * If it does not exist, it is added. Other settings are preserved.
195
+ * @param args - The arguments specifying the setting name and value.
196
+ */
197
+ updateSetting(args: UpdateSettingArgs): void;
198
+ /**
199
+ * Remove a single [[Setting]] by name. Other settings are preserved.
200
+ * @param settingName - The name of the setting to remove.
201
+ */
202
+ removeSetting(settingName: SettingName): void;
203
+ }
204
+ /** An object that permits administrators to modify the contents of settings containers.
205
+ * Use [[SettingsEditor.construct]] to obtain a SettingsEditor, and [[close]] when finished using it.
206
+ * Only one SettingsEditor may be in use at any given time.
207
+ * Use [[getContainer]] to edit an existing container, or [[createNewCloudContainer]] to create a new container.
208
+ * @beta
209
+ */
210
+ export interface SettingsEditor {
211
+ /** @internal */
212
+ [_implementationProhibited]: unknown;
213
+ /**
214
+ * The workspace dedicated to this editor.
215
+ * @note This workspace is independent from [[IModelHost.appWorkspace]] and all [[IModelDb.workspace]]s.
216
+ */
217
+ readonly workspace: Workspace;
218
+ /**
219
+ * Retrieves a container for the editor with the specified properties and access token.
220
+ */
221
+ getContainer(args: GetWorkspaceContainerArgs): EditableSettingsCloudContainer;
222
+ /**
223
+ * Asynchronously retrieves a container for the editor with the specified properties.
224
+ */
225
+ getContainerAsync(props: WorkspaceContainerProps): Promise<EditableSettingsCloudContainer>;
226
+ /**
227
+ * Creates a new cloud container for holding SettingsDbs, from the [[BlobContainer]] service.
228
+ * The container is automatically assigned `containerType: "settings"` in its metadata and
229
+ * initialized with a default [[SettingsDb]].
230
+ * @param args - The arguments for creating the container, including scope, metadata, and manifest.
231
+ * @returns A promise that resolves to the new EditableSettingsCloudContainer.
232
+ * @note The current user must have administrator rights for the iTwin for the container.
233
+ * @note Requires [[IModelHost.authorizationClient]] to be configured.
234
+ */
235
+ createNewCloudContainer(args: CreateNewSettingsContainerArgs): Promise<EditableSettingsCloudContainer>;
236
+ /**
237
+ * Find and open existing settings containers by querying the [[BlobContainer]] service.
238
+ * This is a convenience method that queries for all settings containers matching the given iTwinId
239
+ * (and optionally iModelId), requests write access tokens, and opens each matching container.
240
+ * @param args - The query arguments including iTwinId and optionally iModelId and label.
241
+ * @returns A promise that resolves to an array of opened [[EditableSettingsCloudContainer]]s.
242
+ * @note Requires [[IModelHost.authorizationClient]] and [[BlobContainer.service]] to be configured.
243
+ */
244
+ findContainers(args: SettingsEditor.QuerySettingsContainersArgs): Promise<EditableSettingsCloudContainer[]>;
245
+ /**
246
+ * Closes this editor. All settings containers are dropped.
247
+ */
248
+ close(): void;
249
+ }
250
+ //# sourceMappingURL=SettingsEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsEditor.d.ts","sourceRoot":"","sources":["../../../src/workspace/SettingsEditor.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACrE,OA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;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,wDAAwD;IACxD,QAAQ,CAAC,SAAS,EAAE,8BAA8B,CAAC;IAEnD;;;;OAIG;IACH,cAAc,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEnD;;;OAGG;IACH,cAAc,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAElD;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAE7C;;;OAGG;IACH,aAAa,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;CAC/C;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,gBAAgB;IAChB,CAAC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAErC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAE9B;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,yBAAyB,GAAG,8BAA8B,CAAC;IAE9E;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAE3F;;;;;;;;OAQG;IACH,uBAAuB,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAEvG;;;;;;;OAOG;IACH,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,2BAA2B,GAAG,OAAO,CAAC,8BAA8B,EAAE,CAAC,CAAC;IAE5G;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACf"}
@@ -0,0 +1,50 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Workspace
7
+ */
8
+ import { BlobContainer } from "../BlobContainerService";
9
+ import { SettingsSqliteDb } from "../internal/workspace/SettingsSqliteDb";
10
+ import { constructSettingsEditor } from "../internal/workspace/SettingsEditorImpl";
11
+ import { _implementationProhibited } from "../internal/Symbols";
12
+ import { IModelHost } from "../IModelHost";
13
+ /** @beta */
14
+ export var SettingsEditor;
15
+ (function (SettingsEditor) {
16
+ /**
17
+ * Create a new [[SettingsEditor]] for creating new versions of [[SettingsDb]]s.
18
+ * @note The caller becomes the owner of the SettingsEditor and is responsible for calling [[SettingsEditor.close]] on it when finished.
19
+ * @note It is illegal to have more than one SettingsEditor active in a single session.
20
+ */
21
+ function construct() {
22
+ return constructSettingsEditor();
23
+ }
24
+ SettingsEditor.construct = construct;
25
+ /**
26
+ * Create a new, empty, [[SettingsDb]] file on the local filesystem for importing settings dictionaries.
27
+ * @note Do not pass an untrusted or unintended path in `localFileName`.
28
+ * This helper creates or overwrites the file at that location; callers that need fail-if-exists behavior should check first.
29
+ */
30
+ function createEmptyDb(args) {
31
+ SettingsSqliteDb.createNewDb(args.localFileName, args);
32
+ }
33
+ SettingsEditor.createEmptyDb = createEmptyDb;
34
+ /**
35
+ * Query the [[BlobContainer]] service for all settings containers associated with a given iTwin.
36
+ * This is a convenience wrapper around `BlobContainer.service.queryContainersMetadata` that
37
+ * automatically filters by `containerType: "settings"`.
38
+ * @param args - The query arguments including the iTwinId.
39
+ * @returns A promise that resolves to the matching container metadata entries.
40
+ * @note Requires [[IModelHost.authorizationClient]] to be configured.
41
+ */
42
+ async function queryContainers(args) {
43
+ if (undefined === BlobContainer.service)
44
+ throw new Error("BlobContainer.service is not available. Ensure IModelHost is initialized with a valid configuration.");
45
+ const userToken = await IModelHost.getAccessToken();
46
+ return BlobContainer.service.queryContainersMetadata(userToken, { ...args, containerType: "settings" });
47
+ }
48
+ SettingsEditor.queryContainers = queryContainers;
49
+ })(SettingsEditor || (SettingsEditor = {}));
50
+ //# sourceMappingURL=SettingsEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsEditor.js","sourceRoot":"","sources":["../../../src/workspace/SettingsEditor.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAKH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,YAAY;AACZ,MAAM,KAAW,cAAc,CA0C9B;AA1CD,WAAiB,cAAc;IAC7B;;;;OAIG;IACH,SAAgB,SAAS;QACvB,OAAO,uBAAuB,EAAE,CAAC;IACnC,CAAC;IAFe,wBAAS,YAExB,CAAA;IAED;;;;OAIG;IACH,SAAgB,aAAa,CAAC,IAAoE;QAChG,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;IAFe,4BAAa,gBAE5B,CAAA;IAYD;;;;;;;OAOG;IACI,KAAK,UAAU,eAAe,CAAC,IAAiC;QACrE,IAAI,SAAS,KAAK,aAAa,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,sGAAsG,CAAC,CAAC;QACjK,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,cAAc,EAAE,CAAC;QACpD,OAAO,aAAa,CAAC,OAAO,CAAC,uBAAuB,CAAC,SAAS,EAAE,EAAE,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAC;IAC1G,CAAC;IAJqB,8BAAe,kBAIpC,CAAA;AACH,CAAC,EA1CgB,cAAc,KAAd,cAAc,QA0C9B","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 { GuidString } from \"@itwin/core-bentley\";\nimport { Setting, SettingName, SettingsContainer } from \"./Settings\";\nimport { BlobContainer } from \"../BlobContainerService\";\nimport { CloudSqliteContainer, GetWorkspaceContainerArgs, Workspace, WorkspaceContainerProps, WorkspaceDbName, WorkspaceDbNameAndVersion, WorkspaceDbVersion } from \"./Workspace\";\nimport { SettingsDb, SettingsDbManifest, SettingsDbProps } from \"./SettingsDb\";\nimport { SettingsSqliteDb } from \"../internal/workspace/SettingsSqliteDb\";\nimport { constructSettingsEditor } from \"../internal/workspace/SettingsEditorImpl\";\nimport { _implementationProhibited } from \"../internal/Symbols\";\nimport { CloudSqlite } from \"../CloudSqlite\";\nimport { IModelHost } from \"../IModelHost\";\n\n/** @beta */\nexport namespace SettingsEditor {\n /**\n * Create a new [[SettingsEditor]] for creating new versions of [[SettingsDb]]s.\n * @note The caller becomes the owner of the SettingsEditor and is responsible for calling [[SettingsEditor.close]] on it when finished.\n * @note It is illegal to have more than one SettingsEditor active in a single session.\n */\n export function construct(): SettingsEditor {\n return constructSettingsEditor();\n }\n\n /**\n * Create a new, empty, [[SettingsDb]] file on the local filesystem for importing settings dictionaries.\n * @note Do not pass an untrusted or unintended path in `localFileName`.\n * This helper creates or overwrites the file at that location; callers that need fail-if-exists behavior should check first.\n */\n export function createEmptyDb(args: { localFileName: LocalFileName; manifest: SettingsDbManifest }): void {\n SettingsSqliteDb.createNewDb(args.localFileName, args);\n }\n\n /** Arguments for [[SettingsEditor.queryContainers]] and [[SettingsEditor.findContainers]]. */\n export interface QuerySettingsContainersArgs {\n /** The iTwinId whose settings containers should be queried. */\n iTwinId: GuidString;\n /** Optional iModelId to further scope the query to containers associated with a specific iModel. */\n iModelId?: GuidString;\n /** Optional label filter. */\n label?: string;\n }\n\n /**\n * Query the [[BlobContainer]] service for all settings containers associated with a given iTwin.\n * This is a convenience wrapper around `BlobContainer.service.queryContainersMetadata` that\n * automatically filters by `containerType: \"settings\"`.\n * @param args - The query arguments including the iTwinId.\n * @returns A promise that resolves to the matching container metadata entries.\n * @note Requires [[IModelHost.authorizationClient]] to be configured.\n */\n export async function queryContainers(args: QuerySettingsContainersArgs): Promise<BlobContainer.MetadataResponse[]> {\n if (undefined === BlobContainer.service) throw new Error(\"BlobContainer.service is not available. Ensure IModelHost is initialized with a valid configuration.\");\n const userToken = await IModelHost.getAccessToken();\n return BlobContainer.service.queryContainersMetadata(userToken, { ...args, containerType: \"settings\" });\n }\n}\n\n/** Arguments supplied to [[SettingsEditor.createNewCloudContainer]] to create a new [[EditableSettingsCloudContainer]].\n * The created container will automatically have `containerType: \"settings\"` in its metadata, enabling discovery\n * via `BlobContainer.service.queryContainersMetadata({ containerType: \"settings\" })`.\n * @beta\n */\nexport interface CreateNewSettingsContainerArgs {\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 SettingsDb in the new container. */\n manifest: SettingsDbManifest;\n /** Metadata stored by the BlobContainer service. The `containerType` field is omitted here because it is\n * automatically set to `\"settings\"` when the container is created (mirroring the `\"workspace\"` convention for WorkspaceDb containers).\n */\n metadata: Omit<BlobContainer.Metadata, \"containerType\">;\n /** The name of the default [[SettingsDb]] created inside the new container.\n * Default: \"settings-db\";\n */\n dbName?: WorkspaceDbName;\n}\n\n/** Arguments supplied to [[EditableSettingsCloudContainer.createNewSettingsDbVersion]].\n * @beta\n */\nexport interface CreateNewSettingsDbVersionArgs {\n /**\n * The properties that determine the source [[SettingsDb]] 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?: SettingsDbProps;\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/** The result of creating a new version of a [[SettingsDb]].\n * @beta\n */\nexport interface SettingsDbVersionResult {\n /** The name and version of the source SettingsDb. */\n oldDb: WorkspaceDbNameAndVersion;\n /** The name and version of the newly-created SettingsDb. */\n newDb: WorkspaceDbNameAndVersion;\n}\n\n/** Arguments supplied to [[EditableSettingsCloudContainer.createDb]] to create a new [[SettingsDb]] in a container.\n * @beta\n */\nexport interface CreateSettingsDbArgs {\n /** The name of the new SettingsDb. Default: `\"settings-db\"`. */\n dbName?: WorkspaceDbName;\n /** The initial version of the new SettingsDb. Default: `\"0.0.0\"`. */\n version?: WorkspaceDbVersion;\n /** The manifest for the new SettingsDb. */\n manifest: SettingsDbManifest;\n}\n\n/** Arguments supplied to [[EditableSettingsDb.updateSetting]] to add or update a single [[Setting]].\n * @beta\n */\nexport interface UpdateSettingArgs {\n /** The [[SettingName]] of the setting to add or update. */\n readonly settingName: SettingName;\n /** The new value for the setting. */\n readonly value: Setting;\n}\n\n/**\n * A [[CloudSqliteContainer]] opened for editing settings by a [[SettingsEditor]].\n * You can create new [[SettingsDb]]s or new versions of existing [[SettingsDb]]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 * @note Settings containers are separate from workspace containers, providing independent write locks.\n * Editing settings does not block workspace resource editing, and vice versa.\n * @beta\n */\nexport interface EditableSettingsCloudContainer extends CloudSqliteContainer {\n /**\n * Create a copy of an existing [[SettingsDb]] 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 * @param args - The properties that determine the source SettingsDb and the version increment to apply.\n * @returns A promise that resolves to an object containing the old and new SettingsDb names and versions.\n */\n createNewSettingsDbVersion(args: CreateNewSettingsDbVersionArgs): Promise<SettingsDbVersionResult>;\n\n /**\n * Create a new, empty [[SettingsDb]].\n * @param args - The arguments for creating the new SettingsDb.\n * @returns A promise that resolves to an EditableSettingsDb.\n */\n createDb(args: CreateSettingsDbArgs): Promise<EditableSettingsDb>;\n\n /**\n * Get the cloud properties of this container.\n */\n readonly cloudProps: WorkspaceContainerProps | undefined;\n\n /**\n * Get an editable [[SettingsDb]] to add, delete, or update settings *within a newly created version* of a SettingsDb.\n * Repeated calls that resolve to the same SettingsDb return the same cached instance.\n * @param props - The properties of the SettingsDb.\n * @returns An EditableSettingsDb for modifying settings.\n * @throws if the targeted SettingsDb has already been published and is immutable. Use [[createNewSettingsDbVersion]] first to create an editable version.\n */\n getEditableDb(props?: SettingsDbProps): EditableSettingsDb;\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 user 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 * @throws if the write lock is already held by another user.\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 [[SettingsDb]]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 SettingsDbs are discarded.\n */\n abandonChanges(): void;\n}\n\n/**\n * An editable [[SettingsDb]]. This is used only by tools to allow administrators to create and modify SettingsDbs.\n * For cloud-based SettingsDbs, the container's write token must be obtained via [[EditableSettingsCloudContainer.acquireWriteLock]] before the methods in this interface may be used.\n * Normally, only admins will have write access.\n * Only one admin at a time may be editing a settings container.\n * @note Unlike [[EditableWorkspaceDb]], this interface only supports settings operations — no blob, file, or string resource methods.\n * @beta\n */\nexport interface EditableSettingsDb extends SettingsDb {\n /** The editable container that owns this SettingsDb. */\n readonly container: EditableSettingsCloudContainer;\n\n /**\n * Update the contents of the manifest in this SettingsDb.\n * @note This replaces the stored manifest entirely; omitted fields are lost.\n * @param manifest - The updated manifest.\n */\n updateManifest(manifest: SettingsDbManifest): void;\n\n /**\n * Replace all settings in this SettingsDb with the given container.\n * @param settings - The settings object to store.\n */\n updateSettings(settings: SettingsContainer): void;\n\n /**\n * Add or update a single [[Setting]] by name.\n * If a setting with the given name already exists, its value is replaced.\n * If it does not exist, it is added. Other settings are preserved.\n * @param args - The arguments specifying the setting name and value.\n */\n updateSetting(args: UpdateSettingArgs): void;\n\n /**\n * Remove a single [[Setting]] by name. Other settings are preserved.\n * @param settingName - The name of the setting to remove.\n */\n removeSetting(settingName: SettingName): void;\n}\n\n/** An object that permits administrators to modify the contents of settings containers.\n * Use [[SettingsEditor.construct]] to obtain a SettingsEditor, and [[close]] when finished using it.\n * Only one SettingsEditor may be in use at any given time.\n * Use [[getContainer]] to edit an existing container, or [[createNewCloudContainer]] to create a new container.\n * @beta\n */\nexport interface SettingsEditor {\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.\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): EditableSettingsCloudContainer;\n\n /**\n * Asynchronously retrieves a container for the editor with the specified properties.\n */\n getContainerAsync(props: WorkspaceContainerProps): Promise<EditableSettingsCloudContainer>;\n\n /**\n * Creates a new cloud container for holding SettingsDbs, from the [[BlobContainer]] service.\n * The container is automatically assigned `containerType: \"settings\"` in its metadata and\n * initialized with a default [[SettingsDb]].\n * @param args - The arguments for creating the container, including scope, metadata, and manifest.\n * @returns A promise that resolves to the new EditableSettingsCloudContainer.\n * @note The current user must have administrator rights for the iTwin for the container.\n * @note Requires [[IModelHost.authorizationClient]] to be configured.\n */\n createNewCloudContainer(args: CreateNewSettingsContainerArgs): Promise<EditableSettingsCloudContainer>;\n\n /**\n * Find and open existing settings containers by querying the [[BlobContainer]] service.\n * This is a convenience method that queries for all settings containers matching the given iTwinId\n * (and optionally iModelId), requests write access tokens, and opens each matching container.\n * @param args - The query arguments including iTwinId and optionally iModelId and label.\n * @returns A promise that resolves to an array of opened [[EditableSettingsCloudContainer]]s.\n * @note Requires [[IModelHost.authorizationClient]] and [[BlobContainer.service]] to be configured.\n */\n findContainers(args: SettingsEditor.QuerySettingsContainersArgs): Promise<EditableSettingsCloudContainer[]>;\n\n /**\n * Closes this editor. All settings containers are dropped.\n */\n close(): void;\n}\n"]}