@itwin/core-backend 5.9.0-dev.9 → 5.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/lib/cjs/BriefcaseManager.d.ts +14 -62
  3. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  4. package/lib/cjs/BriefcaseManager.js +29 -159
  5. package/lib/cjs/BriefcaseManager.js.map +1 -1
  6. package/lib/cjs/Category.d.ts +4 -4
  7. package/lib/cjs/Category.js.map +1 -1
  8. package/lib/cjs/ChangesetECAdaptor.d.ts +9 -1
  9. package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
  10. package/lib/cjs/ChangesetECAdaptor.js +7 -1
  11. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  12. package/lib/cjs/ChangesetReader.d.ts +186 -0
  13. package/lib/cjs/ChangesetReader.d.ts.map +1 -0
  14. package/lib/cjs/ChangesetReader.js +372 -0
  15. package/lib/cjs/ChangesetReader.js.map +1 -0
  16. package/lib/cjs/ChangesetReaderTypes.d.ts +120 -0
  17. package/lib/cjs/ChangesetReaderTypes.d.ts.map +1 -0
  18. package/lib/cjs/ChangesetReaderTypes.js +23 -0
  19. package/lib/cjs/ChangesetReaderTypes.js.map +1 -0
  20. package/lib/cjs/CloudSqlite.d.ts +1 -1
  21. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  22. package/lib/cjs/CloudSqlite.js +68 -13
  23. package/lib/cjs/CloudSqlite.js.map +1 -1
  24. package/lib/cjs/CodeSpecs.d.ts +3 -3
  25. package/lib/cjs/CodeSpecs.js.map +1 -1
  26. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  27. package/lib/cjs/DevTools.js.map +1 -1
  28. package/lib/cjs/DisplayStyle.d.ts +2 -2
  29. package/lib/cjs/DisplayStyle.js.map +1 -1
  30. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  31. package/lib/cjs/ECSqlStatement.js.map +1 -1
  32. package/lib/cjs/EditTxn.d.ts +55 -1
  33. package/lib/cjs/EditTxn.d.ts.map +1 -1
  34. package/lib/cjs/EditTxn.js +43 -1
  35. package/lib/cjs/EditTxn.js.map +1 -1
  36. package/lib/cjs/Element.d.ts +79 -10
  37. package/lib/cjs/Element.d.ts.map +1 -1
  38. package/lib/cjs/Element.js +38 -2
  39. package/lib/cjs/Element.js.map +1 -1
  40. package/lib/cjs/ElementAspect.d.ts +1 -1
  41. package/lib/cjs/ElementAspect.js.map +1 -1
  42. package/lib/cjs/ElementGraphics.js.map +1 -1
  43. package/lib/cjs/ElementTreeWalker.d.ts +5 -5
  44. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  45. package/lib/cjs/ExternalSource.d.ts +2 -2
  46. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  47. package/lib/cjs/ExternalSource.js.map +1 -1
  48. package/lib/cjs/GeographicCRSServices.d.ts +15 -0
  49. package/lib/cjs/GeographicCRSServices.d.ts.map +1 -1
  50. package/lib/cjs/GeographicCRSServices.js +13 -4
  51. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  52. package/lib/cjs/IModelDb.d.ts +31 -23
  53. package/lib/cjs/IModelDb.d.ts.map +1 -1
  54. package/lib/cjs/IModelDb.js +44 -25
  55. package/lib/cjs/IModelDb.js.map +1 -1
  56. package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
  57. package/lib/cjs/IModelJsFs.d.ts +2 -0
  58. package/lib/cjs/IModelJsFs.d.ts.map +1 -1
  59. package/lib/cjs/IModelJsFs.js +14 -0
  60. package/lib/cjs/IModelJsFs.js.map +1 -1
  61. package/lib/cjs/IpcHost.d.ts.map +1 -1
  62. package/lib/cjs/IpcHost.js +20 -9
  63. package/lib/cjs/IpcHost.js.map +1 -1
  64. package/lib/cjs/LineStyle.d.ts +6 -6
  65. package/lib/cjs/LineStyle.js.map +1 -1
  66. package/lib/cjs/Material.d.ts +1 -1
  67. package/lib/cjs/Material.js.map +1 -1
  68. package/lib/cjs/Model.d.ts +40 -6
  69. package/lib/cjs/Model.d.ts.map +1 -1
  70. package/lib/cjs/Model.js +24 -0
  71. package/lib/cjs/Model.js.map +1 -1
  72. package/lib/cjs/PartialChangeUnifier.d.ts +77 -0
  73. package/lib/cjs/PartialChangeUnifier.d.ts.map +1 -0
  74. package/lib/cjs/PartialChangeUnifier.js +234 -0
  75. package/lib/cjs/PartialChangeUnifier.js.map +1 -0
  76. package/lib/cjs/Relationship.d.ts +10 -10
  77. package/lib/cjs/Relationship.js +6 -6
  78. package/lib/cjs/Relationship.js.map +1 -1
  79. package/lib/cjs/SheetIndex.d.ts +4 -4
  80. package/lib/cjs/SheetIndex.d.ts.map +1 -1
  81. package/lib/cjs/SheetIndex.js.map +1 -1
  82. package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
  83. package/lib/cjs/SqliteChangesetReader.js +1 -1
  84. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  85. package/lib/cjs/Texture.d.ts +1 -1
  86. package/lib/cjs/Texture.js.map +1 -1
  87. package/lib/cjs/TxnManager.d.ts +17 -0
  88. package/lib/cjs/TxnManager.d.ts.map +1 -1
  89. package/lib/cjs/TxnManager.js +120 -13
  90. package/lib/cjs/TxnManager.js.map +1 -1
  91. package/lib/cjs/ViewDefinition.d.ts +25 -13
  92. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  93. package/lib/cjs/ViewDefinition.js +77 -25
  94. package/lib/cjs/ViewDefinition.js.map +1 -1
  95. package/lib/cjs/ViewStore.d.ts.map +1 -1
  96. package/lib/cjs/ViewStore.js +63 -21
  97. package/lib/cjs/ViewStore.js.map +1 -1
  98. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +1 -1
  99. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  100. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  101. package/lib/cjs/core-backend.d.ts +3 -0
  102. package/lib/cjs/core-backend.d.ts.map +1 -1
  103. package/lib/cjs/core-backend.js +3 -0
  104. package/lib/cjs/core-backend.js.map +1 -1
  105. package/lib/cjs/domains/FunctionalElements.d.ts +1 -1
  106. package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
  107. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  108. package/lib/cjs/domains/GenericElements.d.ts +2 -2
  109. package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
  110. package/lib/cjs/domains/GenericElements.js.map +1 -1
  111. package/lib/cjs/internal/ChannelAdmin.d.ts +2 -2
  112. package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -1
  113. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  114. package/lib/cjs/internal/IntegrityCheck.d.ts +10 -10
  115. package/lib/cjs/internal/IntegrityCheck.js +22 -22
  116. package/lib/cjs/internal/IntegrityCheck.js.map +1 -1
  117. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  118. package/lib/cjs/workspace/Settings.d.ts +6 -4
  119. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  120. package/lib/cjs/workspace/Settings.js.map +1 -1
  121. package/lib/esm/BriefcaseManager.d.ts +14 -62
  122. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  123. package/lib/esm/BriefcaseManager.js +30 -160
  124. package/lib/esm/BriefcaseManager.js.map +1 -1
  125. package/lib/esm/Category.d.ts +4 -4
  126. package/lib/esm/Category.js.map +1 -1
  127. package/lib/esm/ChangesetECAdaptor.d.ts +9 -1
  128. package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
  129. package/lib/esm/ChangesetECAdaptor.js +7 -1
  130. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  131. package/lib/esm/ChangesetReader.d.ts +186 -0
  132. package/lib/esm/ChangesetReader.d.ts.map +1 -0
  133. package/lib/esm/ChangesetReader.js +368 -0
  134. package/lib/esm/ChangesetReader.js.map +1 -0
  135. package/lib/esm/ChangesetReaderTypes.d.ts +120 -0
  136. package/lib/esm/ChangesetReaderTypes.d.ts.map +1 -0
  137. package/lib/esm/ChangesetReaderTypes.js +20 -0
  138. package/lib/esm/ChangesetReaderTypes.js.map +1 -0
  139. package/lib/esm/CloudSqlite.d.ts +1 -1
  140. package/lib/esm/CloudSqlite.d.ts.map +1 -1
  141. package/lib/esm/CloudSqlite.js +69 -14
  142. package/lib/esm/CloudSqlite.js.map +1 -1
  143. package/lib/esm/CodeSpecs.d.ts +3 -3
  144. package/lib/esm/CodeSpecs.js.map +1 -1
  145. package/lib/esm/ConcurrentQuery.js.map +1 -1
  146. package/lib/esm/DevTools.js.map +1 -1
  147. package/lib/esm/DisplayStyle.d.ts +2 -2
  148. package/lib/esm/DisplayStyle.js.map +1 -1
  149. package/lib/esm/ECSqlStatement.d.ts.map +1 -1
  150. package/lib/esm/ECSqlStatement.js.map +1 -1
  151. package/lib/esm/EditTxn.d.ts +55 -1
  152. package/lib/esm/EditTxn.d.ts.map +1 -1
  153. package/lib/esm/EditTxn.js +43 -1
  154. package/lib/esm/EditTxn.js.map +1 -1
  155. package/lib/esm/Element.d.ts +79 -10
  156. package/lib/esm/Element.d.ts.map +1 -1
  157. package/lib/esm/Element.js +38 -2
  158. package/lib/esm/Element.js.map +1 -1
  159. package/lib/esm/ElementAspect.d.ts +1 -1
  160. package/lib/esm/ElementAspect.js.map +1 -1
  161. package/lib/esm/ElementGraphics.js.map +1 -1
  162. package/lib/esm/ElementTreeWalker.d.ts +5 -5
  163. package/lib/esm/ElementTreeWalker.js.map +1 -1
  164. package/lib/esm/ExternalSource.d.ts +2 -2
  165. package/lib/esm/ExternalSource.d.ts.map +1 -1
  166. package/lib/esm/ExternalSource.js.map +1 -1
  167. package/lib/esm/GeographicCRSServices.d.ts +15 -0
  168. package/lib/esm/GeographicCRSServices.d.ts.map +1 -1
  169. package/lib/esm/GeographicCRSServices.js +12 -4
  170. package/lib/esm/GeographicCRSServices.js.map +1 -1
  171. package/lib/esm/IModelDb.d.ts +31 -23
  172. package/lib/esm/IModelDb.d.ts.map +1 -1
  173. package/lib/esm/IModelDb.js +45 -26
  174. package/lib/esm/IModelDb.js.map +1 -1
  175. package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
  176. package/lib/esm/IModelJsFs.d.ts +2 -0
  177. package/lib/esm/IModelJsFs.d.ts.map +1 -1
  178. package/lib/esm/IModelJsFs.js +14 -0
  179. package/lib/esm/IModelJsFs.js.map +1 -1
  180. package/lib/esm/IpcHost.d.ts.map +1 -1
  181. package/lib/esm/IpcHost.js +20 -9
  182. package/lib/esm/IpcHost.js.map +1 -1
  183. package/lib/esm/LineStyle.d.ts +6 -6
  184. package/lib/esm/LineStyle.js.map +1 -1
  185. package/lib/esm/Material.d.ts +1 -1
  186. package/lib/esm/Material.js.map +1 -1
  187. package/lib/esm/Model.d.ts +40 -6
  188. package/lib/esm/Model.d.ts.map +1 -1
  189. package/lib/esm/Model.js +24 -0
  190. package/lib/esm/Model.js.map +1 -1
  191. package/lib/esm/PartialChangeUnifier.d.ts +77 -0
  192. package/lib/esm/PartialChangeUnifier.d.ts.map +1 -0
  193. package/lib/esm/PartialChangeUnifier.js +230 -0
  194. package/lib/esm/PartialChangeUnifier.js.map +1 -0
  195. package/lib/esm/Relationship.d.ts +10 -10
  196. package/lib/esm/Relationship.js +6 -6
  197. package/lib/esm/Relationship.js.map +1 -1
  198. package/lib/esm/SheetIndex.d.ts +4 -4
  199. package/lib/esm/SheetIndex.d.ts.map +1 -1
  200. package/lib/esm/SheetIndex.js.map +1 -1
  201. package/lib/esm/SqliteChangesetReader.d.ts.map +1 -1
  202. package/lib/esm/SqliteChangesetReader.js +1 -1
  203. package/lib/esm/SqliteChangesetReader.js.map +1 -1
  204. package/lib/esm/Texture.d.ts +1 -1
  205. package/lib/esm/Texture.js.map +1 -1
  206. package/lib/esm/TxnManager.d.ts +17 -0
  207. package/lib/esm/TxnManager.d.ts.map +1 -1
  208. package/lib/esm/TxnManager.js +121 -14
  209. package/lib/esm/TxnManager.js.map +1 -1
  210. package/lib/esm/ViewDefinition.d.ts +25 -13
  211. package/lib/esm/ViewDefinition.d.ts.map +1 -1
  212. package/lib/esm/ViewDefinition.js +78 -26
  213. package/lib/esm/ViewDefinition.js.map +1 -1
  214. package/lib/esm/ViewStore.d.ts.map +1 -1
  215. package/lib/esm/ViewStore.js +64 -22
  216. package/lib/esm/ViewStore.js.map +1 -1
  217. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +1 -1
  218. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  219. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  220. package/lib/esm/core-backend.d.ts +3 -0
  221. package/lib/esm/core-backend.d.ts.map +1 -1
  222. package/lib/esm/core-backend.js +3 -0
  223. package/lib/esm/core-backend.js.map +1 -1
  224. package/lib/esm/domains/FunctionalElements.d.ts +1 -1
  225. package/lib/esm/domains/FunctionalElements.d.ts.map +1 -1
  226. package/lib/esm/domains/FunctionalElements.js.map +1 -1
  227. package/lib/esm/domains/GenericElements.d.ts +2 -2
  228. package/lib/esm/domains/GenericElements.d.ts.map +1 -1
  229. package/lib/esm/domains/GenericElements.js.map +1 -1
  230. package/lib/esm/internal/ChannelAdmin.d.ts +2 -2
  231. package/lib/esm/internal/ChannelAdmin.d.ts.map +1 -1
  232. package/lib/esm/internal/ChannelAdmin.js.map +1 -1
  233. package/lib/esm/internal/IntegrityCheck.d.ts +10 -10
  234. package/lib/esm/internal/IntegrityCheck.js +22 -22
  235. package/lib/esm/internal/IntegrityCheck.js.map +1 -1
  236. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  237. package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -1
  238. package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
  239. package/lib/esm/test/IModelTestUtils.d.ts +1 -0
  240. package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
  241. package/lib/esm/test/IModelTestUtils.js +5 -0
  242. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  243. package/lib/esm/test/IpcHost.test.js +112 -0
  244. package/lib/esm/test/IpcHost.test.js.map +1 -1
  245. package/lib/esm/test/annotations/LeaderGeometry.test.js +0 -1
  246. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  247. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
  248. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  249. package/lib/esm/test/element/DeleteDefinitionElements.test.js +819 -26
  250. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  251. package/lib/esm/test/element/ElementRoundTrip.test.js +144 -3
  252. package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
  253. package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
  254. package/lib/esm/test/hubaccess/Rebase.test.js +1 -1
  255. package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
  256. package/lib/esm/test/hubaccess/SemanticRebase.test.js +2242 -68
  257. package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
  258. package/lib/esm/test/imodel/IModel.test.js +1 -1
  259. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  260. package/lib/esm/test/imodel/SchemaXmlImport.test.js +64 -0
  261. package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
  262. package/lib/esm/test/misc/GeoServices.test.js +43 -1
  263. package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
  264. package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
  265. package/lib/esm/test/standalone/ChangesetReader.test.js +4184 -1654
  266. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  267. package/lib/esm/test/standalone/DeleteElements.test.d.ts +2 -0
  268. package/lib/esm/test/standalone/DeleteElements.test.d.ts.map +1 -0
  269. package/lib/esm/test/standalone/DeleteElements.test.js +625 -0
  270. package/lib/esm/test/standalone/DeleteElements.test.js.map +1 -0
  271. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  272. package/lib/esm/test/standalone/IntegrityCheck.test.js +214 -5
  273. package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
  274. package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.d.ts +2 -0
  275. package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.d.ts.map +1 -0
  276. package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js +1862 -0
  277. package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js.map +1 -0
  278. package/lib/esm/test/standalone/TxnManager.test.js +90 -0
  279. package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
  280. package/lib/esm/test/standalone/ViewDefinition.test.js +18 -7
  281. package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
  282. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  283. package/lib/esm/workspace/Settings.d.ts +6 -4
  284. package/lib/esm/workspace/Settings.d.ts.map +1 -1
  285. package/lib/esm/workspace/Settings.js.map +1 -1
  286. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../../src/workspace/Settings.ts"],"names":[],"mappings":"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","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 [[EditableWorkspaceDb.updateSettingsResource]].\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 no workspaceDb is defined - 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]]. When working in the context of an iTwin,\n * use [[IModelHost.getITwinWorkspace]] to obtain a [[Workspace]] for the iTwin and access its `settings` property.\n * Like iModel-specific settings, any settings supplied by the iTwin will override those defined at the application level.\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 * iTwin-specific settings are stored in a [[CloudSqliteContainer]] in the cloud.\n * When [[IModelHost.getITwinWorkspace]] is invoked, the container is accessed using the iTwinId and the settings are loaded into the returned [[Workspace]].\n * You can add and remove a [[SettingsDictionary]] from the container using [[Workspace.saveSettingsDictionary]] and [[Workspace.deleteSettingsDictionary]].\n *\n * See the [learning article]($docs/learning/backend/Workspace) for a detailed overview and examples.\n *\n * @see [[IModelHost.appWorkspace]] application-wide settings, [[IModelDb.workspace]] for settings specific to a given iModel, and [[IModelHost.getITwinWorkspace]] for settings specific to a given iTwin.\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"]}
1
+ {"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../../src/workspace/Settings.ts"],"names":[],"mappings":"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","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 [[EditableWorkspaceDb.updateSettingsResource]].\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 no workspaceDb is defined - 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]]. When working in the context of an iTwin,\n * use [[IModelHost.getITwinWorkspace]] to obtain a [[Workspace]] for the iTwin and access its `settings` property.\n * Like iModel-specific settings, any settings supplied by the iTwin will override those defined at the application level.\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\n * (and their corresponding [[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 [[EditTxn.saveSettingDictionary]] and [[EditTxn.deleteSettingDictionary]].\n * If you are migrating older code, [[IModelDb.saveSettingDictionary]] and [[IModelDb.deleteSettingDictionary]] are deprecated in favor of the [[EditTxn]] APIs.\n *\n * iTwin-specific settings are stored in a [[CloudSqliteContainer]] in the cloud.\n * When [[IModelHost.getITwinWorkspace]] is invoked, the container is accessed using the iTwinId and the settings are loaded into the returned [[Workspace]].\n * You can add and remove a [[SettingsDictionary]] from the container using [[IModelHost.saveSettingDictionary]] and [[IModelHost.deleteSettingDictionary]].\n *\n * See the [learning article]($docs/learning/backend/Workspace) for a detailed overview and examples.\n *\n * @see [[IModelHost.appWorkspace]] application-wide settings, [[IModelDb.workspace]] for settings specific to a given iModel, and [[IModelHost.getITwinWorkspace]] for settings specific to a given iTwin.\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 * @note Values added via this method exist only for the current session. They are not persisted and will be lost when the host shuts down.\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-backend",
3
- "version": "5.9.0-dev.9",
3
+ "version": "5.9.1",
4
4
  "description": "iTwin.js backend components",
5
5
  "main": "lib/cjs/core-backend.js",
6
6
  "module": "lib/esm/core-backend.js",
@@ -27,10 +27,10 @@
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@opentelemetry/api": "^1.0.4",
30
- "@itwin/core-bentley": "5.9.0-dev.9",
31
- "@itwin/core-geometry": "5.9.0-dev.9",
32
- "@itwin/core-common": "5.9.0-dev.9",
33
- "@itwin/ecschema-metadata": "5.9.0-dev.9"
30
+ "@itwin/core-bentley": "5.9.1",
31
+ "@itwin/core-common": "5.9.1",
32
+ "@itwin/core-geometry": "5.9.1",
33
+ "@itwin/ecschema-metadata": "5.9.1"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
36
  "@opentelemetry/api": {
@@ -56,7 +56,7 @@
56
56
  "@types/sinon": "^17.0.2",
57
57
  "@types/touch": "^3.1.2",
58
58
  "@types/ws": "^7.0.0",
59
- "@xmldom/xmldom": "~0.8.12",
59
+ "@xmldom/xmldom": "~0.8.13",
60
60
  "chai": "^4.3.10",
61
61
  "chai-as-promised": "^7.1.1",
62
62
  "cpx2": "^8.0.0",
@@ -77,17 +77,17 @@
77
77
  "marked": "^14.1.3",
78
78
  "sql-formatter": "^15.4.6",
79
79
  "webpack": "^5.97.1",
80
- "@itwin/build-tools": "5.9.0-dev.9",
81
- "@itwin/core-geometry": "5.9.0-dev.9",
82
- "@itwin/ecschema-metadata": "5.9.0-dev.9",
83
- "@itwin/ecschema-locaters": "5.9.0-dev.9",
84
- "@itwin/core-bentley": "5.9.0-dev.9",
85
- "@itwin/core-common": "5.9.0-dev.9",
86
- "@itwin/ecsql-common": "5.9.0-dev.9",
87
- "internal-tools": "3.0.0-dev.69"
80
+ "@itwin/build-tools": "5.9.1",
81
+ "@itwin/ecschema-locaters": "5.9.1",
82
+ "@itwin/core-geometry": "5.9.1",
83
+ "@itwin/core-bentley": "5.9.1",
84
+ "@itwin/ecschema-metadata": "5.9.1",
85
+ "@itwin/core-common": "5.9.1",
86
+ "internal-tools": "3.0.0-dev.69",
87
+ "@itwin/ecsql-common": "5.9.1"
88
88
  },
89
89
  "dependencies": {
90
- "@bentley/imodeljs-native": "5.9.1",
90
+ "@bentley/imodeljs-native": "5.9.17",
91
91
  "@itwin/object-storage-azure": "^3.0.4",
92
92
  "@azure/storage-blob": "^12.28.0",
93
93
  "form-data": "^4.0.4",