@itwin/core-backend 4.8.0-dev.2 → 4.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 (230) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/lib/cjs/BackendHubAccess.d.ts +18 -16
  3. package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
  4. package/lib/cjs/BackendHubAccess.js +16 -15
  5. package/lib/cjs/BackendHubAccess.js.map +1 -1
  6. package/lib/cjs/BackendLoggerCategory.d.ts +3 -1
  7. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
  8. package/lib/cjs/BackendLoggerCategory.js +2 -0
  9. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  10. package/lib/cjs/BlobContainerService.d.ts +3 -3
  11. package/lib/cjs/BlobContainerService.d.ts.map +1 -1
  12. package/lib/cjs/BlobContainerService.js.map +1 -1
  13. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  14. package/lib/cjs/BriefcaseManager.js +4 -2
  15. package/lib/cjs/BriefcaseManager.js.map +1 -1
  16. package/lib/cjs/Category.d.ts +0 -6
  17. package/lib/cjs/Category.d.ts.map +1 -1
  18. package/lib/cjs/Category.js +0 -6
  19. package/lib/cjs/Category.js.map +1 -1
  20. package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
  21. package/lib/cjs/ChangeSummaryManager.js +4 -3
  22. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  23. package/lib/cjs/ChangedElementsDb.d.ts +1 -0
  24. package/lib/cjs/ChangedElementsDb.d.ts.map +1 -1
  25. package/lib/cjs/ChangedElementsDb.js +3 -2
  26. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  27. package/lib/cjs/ChannelControl.d.ts +4 -26
  28. package/lib/cjs/ChannelControl.d.ts.map +1 -1
  29. package/lib/cjs/ChannelControl.js +2 -101
  30. package/lib/cjs/ChannelControl.js.map +1 -1
  31. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  32. package/lib/cjs/CheckpointManager.js +2 -1
  33. package/lib/cjs/CheckpointManager.js.map +1 -1
  34. package/lib/cjs/CloudSqlite.d.ts +49 -24
  35. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  36. package/lib/cjs/CloudSqlite.js +66 -7
  37. package/lib/cjs/CloudSqlite.js.map +1 -1
  38. package/lib/cjs/CodeService.d.ts +4 -4
  39. package/lib/cjs/CodeService.d.ts.map +1 -1
  40. package/lib/cjs/CodeService.js.map +1 -1
  41. package/lib/cjs/DevTools.d.ts.map +1 -1
  42. package/lib/cjs/DevTools.js +2 -1
  43. package/lib/cjs/DevTools.js.map +1 -1
  44. package/lib/cjs/DisplayStyle.d.ts +0 -3
  45. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  46. package/lib/cjs/DisplayStyle.js +0 -3
  47. package/lib/cjs/DisplayStyle.js.map +1 -1
  48. package/lib/cjs/ECDb.js +2 -2
  49. package/lib/cjs/ECDb.js.map +1 -1
  50. package/lib/cjs/ECSchemaXmlContext.js +2 -2
  51. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  52. package/lib/cjs/ECSqlStatement.d.ts +6 -3
  53. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  54. package/lib/cjs/ECSqlStatement.js +3 -3
  55. package/lib/cjs/ECSqlStatement.js.map +1 -1
  56. package/lib/cjs/Element.d.ts +3 -60
  57. package/lib/cjs/Element.d.ts.map +1 -1
  58. package/lib/cjs/Element.js +8 -64
  59. package/lib/cjs/Element.js.map +1 -1
  60. package/lib/cjs/ElementAspect.d.ts +0 -5
  61. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  62. package/lib/cjs/ElementAspect.js +4 -8
  63. package/lib/cjs/ElementAspect.js.map +1 -1
  64. package/lib/cjs/GeoCoordConfig.d.ts +10 -0
  65. package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
  66. package/lib/cjs/GeoCoordConfig.js +22 -24
  67. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  68. package/lib/cjs/GeographicCRSServices.js +2 -2
  69. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  70. package/lib/cjs/IModelDb.d.ts +27 -97
  71. package/lib/cjs/IModelDb.d.ts.map +1 -1
  72. package/lib/cjs/IModelDb.js +131 -55
  73. package/lib/cjs/IModelDb.js.map +1 -1
  74. package/lib/cjs/IModelElementCloneContext.js +2 -2
  75. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  76. package/lib/cjs/IModelHost.d.ts +13 -4
  77. package/lib/cjs/IModelHost.d.ts.map +1 -1
  78. package/lib/cjs/IModelHost.js +39 -32
  79. package/lib/cjs/IModelHost.js.map +1 -1
  80. package/lib/cjs/IpcHost.d.ts.map +1 -1
  81. package/lib/cjs/IpcHost.js +2 -1
  82. package/lib/cjs/IpcHost.js.map +1 -1
  83. package/lib/cjs/LocalHub.d.ts +2 -2
  84. package/lib/cjs/LocalHub.d.ts.map +1 -1
  85. package/lib/cjs/LocalHub.js +17 -17
  86. package/lib/cjs/LocalHub.js.map +1 -1
  87. package/lib/cjs/LockControl.d.ts +66 -0
  88. package/lib/cjs/LockControl.d.ts.map +1 -0
  89. package/lib/cjs/LockControl.js +11 -0
  90. package/lib/cjs/LockControl.js.map +1 -0
  91. package/lib/cjs/Material.d.ts +2 -5
  92. package/lib/cjs/Material.d.ts.map +1 -1
  93. package/lib/cjs/Material.js +6 -4
  94. package/lib/cjs/Material.js.map +1 -1
  95. package/lib/cjs/Model.d.ts +0 -22
  96. package/lib/cjs/Model.d.ts.map +1 -1
  97. package/lib/cjs/Model.js +4 -25
  98. package/lib/cjs/Model.js.map +1 -1
  99. package/lib/cjs/PropertyStore.d.ts +17 -7
  100. package/lib/cjs/PropertyStore.d.ts.map +1 -1
  101. package/lib/cjs/PropertyStore.js +11 -5
  102. package/lib/cjs/PropertyStore.js.map +1 -1
  103. package/lib/cjs/Relationship.d.ts +0 -12
  104. package/lib/cjs/Relationship.d.ts.map +1 -1
  105. package/lib/cjs/Relationship.js +0 -12
  106. package/lib/cjs/Relationship.js.map +1 -1
  107. package/lib/cjs/SQLiteDb.d.ts +2 -3
  108. package/lib/cjs/SQLiteDb.d.ts.map +1 -1
  109. package/lib/cjs/SQLiteDb.js +5 -6
  110. package/lib/cjs/SQLiteDb.js.map +1 -1
  111. package/lib/cjs/SchemaSync.d.ts +1 -1
  112. package/lib/cjs/SchemaSync.d.ts.map +1 -1
  113. package/lib/cjs/SchemaSync.js +2 -2
  114. package/lib/cjs/SchemaSync.js.map +1 -1
  115. package/lib/cjs/SchemaUtils.js +3 -3
  116. package/lib/cjs/SchemaUtils.js.map +1 -1
  117. package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
  118. package/lib/cjs/SqliteChangesetReader.js +2 -2
  119. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  120. package/lib/cjs/SqliteStatement.js +2 -2
  121. package/lib/cjs/SqliteStatement.js.map +1 -1
  122. package/lib/cjs/TextAnnotationGeometry.d.ts +5 -1
  123. package/lib/cjs/TextAnnotationGeometry.d.ts.map +1 -1
  124. package/lib/cjs/TextAnnotationGeometry.js +11 -8
  125. package/lib/cjs/TextAnnotationGeometry.js.map +1 -1
  126. package/lib/cjs/TextAnnotationLayout.d.ts +21 -13
  127. package/lib/cjs/TextAnnotationLayout.d.ts.map +1 -1
  128. package/lib/cjs/TextAnnotationLayout.js +134 -92
  129. package/lib/cjs/TextAnnotationLayout.js.map +1 -1
  130. package/lib/cjs/TxnManager.d.ts +2 -1
  131. package/lib/cjs/TxnManager.d.ts.map +1 -1
  132. package/lib/cjs/TxnManager.js +2 -1
  133. package/lib/cjs/TxnManager.js.map +1 -1
  134. package/lib/cjs/ViewDefinition.d.ts +1 -18
  135. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  136. package/lib/cjs/ViewDefinition.js +1 -18
  137. package/lib/cjs/ViewDefinition.js.map +1 -1
  138. package/lib/cjs/ViewStore.d.ts +16 -2
  139. package/lib/cjs/ViewStore.d.ts.map +1 -1
  140. package/lib/cjs/ViewStore.js +14 -1
  141. package/lib/cjs/ViewStore.js.map +1 -1
  142. package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +33 -0
  143. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +17 -21
  144. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +80 -38
  145. package/lib/cjs/assets/Settings/backend.setting.json5 +8 -119
  146. package/lib/cjs/core-backend.d.ts +3 -2
  147. package/lib/cjs/core-backend.d.ts.map +1 -1
  148. package/lib/cjs/core-backend.js +4 -6
  149. package/lib/cjs/core-backend.js.map +1 -1
  150. package/lib/cjs/domains/FunctionalElements.d.ts +0 -10
  151. package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
  152. package/lib/cjs/domains/FunctionalElements.js +0 -10
  153. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  154. package/lib/cjs/domains/GenericElements.d.ts +0 -18
  155. package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
  156. package/lib/cjs/domains/GenericElements.js +0 -18
  157. package/lib/cjs/domains/GenericElements.js.map +1 -1
  158. package/lib/cjs/internal/ChangesetConflictArgs.d.ts +24 -0
  159. package/lib/cjs/internal/ChangesetConflictArgs.d.ts.map +1 -0
  160. package/lib/cjs/internal/ChangesetConflictArgs.js +7 -0
  161. package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -0
  162. package/lib/cjs/internal/ChannelAdmin.d.ts +34 -0
  163. package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -0
  164. package/lib/cjs/internal/ChannelAdmin.js +117 -0
  165. package/lib/cjs/internal/ChannelAdmin.js.map +1 -0
  166. package/lib/cjs/internal/NativePlatform.d.ts +15 -0
  167. package/lib/cjs/internal/NativePlatform.d.ts.map +1 -0
  168. package/lib/cjs/internal/NativePlatform.js +49 -0
  169. package/lib/cjs/internal/NativePlatform.js.map +1 -0
  170. package/lib/cjs/internal/NoLocks.d.ts +6 -0
  171. package/lib/cjs/internal/NoLocks.d.ts.map +1 -0
  172. package/lib/cjs/internal/NoLocks.js +30 -0
  173. package/lib/cjs/internal/NoLocks.js.map +1 -0
  174. package/lib/cjs/{ServerBasedLocks.d.ts → internal/ServerBasedLocks.d.ts} +10 -17
  175. package/lib/cjs/internal/ServerBasedLocks.d.ts.map +1 -0
  176. package/lib/cjs/{ServerBasedLocks.js → internal/ServerBasedLocks.js} +22 -17
  177. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -0
  178. package/lib/cjs/internal/Symbols.d.ts +9 -0
  179. package/lib/cjs/internal/Symbols.d.ts.map +1 -0
  180. package/lib/cjs/internal/Symbols.js +19 -0
  181. package/lib/cjs/internal/Symbols.js.map +1 -0
  182. package/lib/cjs/internal/cross-package.d.ts +3 -0
  183. package/lib/cjs/internal/cross-package.d.ts.map +1 -0
  184. package/lib/cjs/internal/cross-package.js +14 -0
  185. package/lib/cjs/internal/cross-package.js.map +1 -0
  186. package/lib/cjs/internal/workspace/SettingsImpl.d.ts +43 -0
  187. package/lib/cjs/internal/workspace/SettingsImpl.d.ts.map +1 -0
  188. package/lib/cjs/internal/workspace/SettingsImpl.js +161 -0
  189. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -0
  190. package/lib/cjs/internal/workspace/SettingsSchemasImpl.d.ts +6 -0
  191. package/lib/cjs/internal/workspace/SettingsSchemasImpl.d.ts.map +1 -0
  192. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +276 -0
  193. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -0
  194. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts +41 -0
  195. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -0
  196. package/lib/cjs/internal/workspace/WorkspaceImpl.js +696 -0
  197. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -0
  198. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.d.ts +10 -0
  199. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.d.ts.map +1 -0
  200. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js +41 -0
  201. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -0
  202. package/lib/cjs/rpc/tracing.js +1 -1
  203. package/lib/cjs/rpc/tracing.js.map +1 -1
  204. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +1 -0
  205. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  206. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +5 -2
  207. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  208. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  209. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +2 -1
  210. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  211. package/lib/cjs/workspace/Settings.d.ts +167 -138
  212. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  213. package/lib/cjs/workspace/Settings.js +68 -138
  214. package/lib/cjs/workspace/Settings.js.map +1 -1
  215. package/lib/cjs/workspace/SettingsSchemas.d.ts +112 -48
  216. package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
  217. package/lib/cjs/workspace/SettingsSchemas.js +1 -172
  218. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  219. package/lib/cjs/workspace/Workspace.d.ts +411 -277
  220. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  221. package/lib/cjs/workspace/Workspace.js +76 -457
  222. package/lib/cjs/workspace/Workspace.js.map +1 -1
  223. package/lib/cjs/workspace/WorkspaceEditor.d.ts +245 -0
  224. package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -0
  225. package/lib/cjs/workspace/WorkspaceEditor.js +34 -0
  226. package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -0
  227. package/package.json +15 -14
  228. package/lib/cjs/ServerBasedLocks.d.ts.map +0 -1
  229. package/lib/cjs/ServerBasedLocks.js.map +0 -1
  230. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +0 -45
@@ -11,13 +11,13 @@ exports.ExternalSourceAspect = exports.ChannelRootAspect = exports.ElementMultiA
11
11
  const core_common_1 = require("@itwin/core-common");
12
12
  const Entity_1 = require("./Entity");
13
13
  const core_bentley_1 = require("@itwin/core-bentley");
14
+ const Symbols_1 = require("./internal/Symbols");
14
15
  /** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.
15
16
  * Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.
16
17
  * BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.
17
18
  * @public
18
19
  */
19
20
  class ElementAspect extends Entity_1.Entity {
20
- /** @internal */
21
21
  static get className() { return "ElementAspect"; }
22
22
  /** Construct an aspect from its JSON representation and its containing iModel. */
23
23
  constructor(props, iModel) {
@@ -36,7 +36,7 @@ class ElementAspect extends Entity_1.Entity {
36
36
  */
37
37
  static onInsert(arg) {
38
38
  const { props, iModel } = arg;
39
- iModel.channels.verifyChannel(arg.model);
39
+ iModel.channels[Symbols_1._verifyChannel](arg.model);
40
40
  iModel.locks.checkExclusiveLock(props.element.id, "element", "insert aspect");
41
41
  }
42
42
  /** Called after a new ElementAspect was inserted.
@@ -51,7 +51,7 @@ class ElementAspect extends Entity_1.Entity {
51
51
  */
52
52
  static onUpdate(arg) {
53
53
  const { props, iModel } = arg;
54
- iModel.channels.verifyChannel(arg.model);
54
+ iModel.channels[Symbols_1._verifyChannel](arg.model);
55
55
  iModel.locks.checkExclusiveLock(props.element.id, "element", "update aspect");
56
56
  }
57
57
  /** Called after an ElementAspect was updated.
@@ -66,7 +66,7 @@ class ElementAspect extends Entity_1.Entity {
66
66
  */
67
67
  static onDelete(arg) {
68
68
  const { aspectId, iModel } = arg;
69
- iModel.channels.verifyChannel(arg.model);
69
+ iModel.channels[Symbols_1._verifyChannel](arg.model);
70
70
  const { element } = iModel.elements.getAspect(aspectId);
71
71
  iModel.locks.checkExclusiveLock(element.id, "element", "delete aspect");
72
72
  }
@@ -81,7 +81,6 @@ exports.ElementAspect = ElementAspect;
81
81
  * @public
82
82
  */
83
83
  class ElementUniqueAspect extends ElementAspect {
84
- /** @internal */
85
84
  static get className() { return "ElementUniqueAspect"; }
86
85
  }
87
86
  exports.ElementUniqueAspect = ElementUniqueAspect;
@@ -89,7 +88,6 @@ exports.ElementUniqueAspect = ElementUniqueAspect;
89
88
  * @public
90
89
  */
91
90
  class ElementMultiAspect extends ElementAspect {
92
- /** @internal */
93
91
  static get className() { return "ElementMultiAspect"; }
94
92
  }
95
93
  exports.ElementMultiAspect = ElementMultiAspect;
@@ -97,7 +95,6 @@ exports.ElementMultiAspect = ElementMultiAspect;
97
95
  * @public
98
96
  */
99
97
  class ChannelRootAspect extends ElementUniqueAspect {
100
- /** @internal */
101
98
  static get className() { return "ChannelRootAspect"; }
102
99
  /** Insert a ChannelRootAspect on the specified element.
103
100
  * @deprecated in 4.0 use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.
@@ -113,7 +110,6 @@ exports.ChannelRootAspect = ChannelRootAspect;
113
110
  * @public
114
111
  */
115
112
  class ExternalSourceAspect extends ElementMultiAspect {
116
- /** @internal */
117
113
  static get className() { return "ExternalSourceAspect"; }
118
114
  /** Construct an aspect from its JSON representation and its containing iModel. */
119
115
  constructor(props, iModel) {
@@ -1 +1 @@
1
- {"version":3,"file":"ElementAspect.js","sourceRoot":"","sources":["../../src/ElementAspect.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAA+I;AAC/I,qCAAkC;AAGlC,sDAA2D;AA0B3D;;;;GAIG;AACH,MAAa,aAAc,SAAQ,eAAM;IACvC,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAG1E,kFAAkF;IAClF,YAAY,KAAyB,EAAE,MAAgB;QACrD,KAAK,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,CAAC;QAC3B,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACzC,OAAO,GAAG,CAAC;IACb,CAAC;IAEkB,mBAAmB,CAAC,YAAgC;QACrE,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,IAAI,IAAI,CAAC,KAAK;YACZ,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,MAAM;YACb,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF;AAvGD,oDAuGC;AAED,cAAc;AACd,WAAiB,oBAAoB;IACnC;;OAEG;IACH,IAAY,IASX;IATD,WAAY,IAAI;QACd,oFAAoF;QACpF,2BAAmB,CAAA;QACnB,yFAAyF;QACzF,qCAA6B,CAAA;QAC7B;;WAEG;QACH,uBAAe,CAAA;IACjB,CAAC,EATW,IAAI,GAAJ,yBAAI,KAAJ,yBAAI,QASf;AACH,CAAC,EAdgB,oBAAoB,oCAApB,oBAAoB,QAcpC","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 ElementAspects\r\n */\r\n\r\nimport { ChannelRootAspectProps, ElementAspectProps, EntityReferenceSet, ExternalSourceAspectProps, RelatedElement } from \"@itwin/core-common\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { ECSqlStatement } from \"./ECSqlStatement\";\r\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\r\n\r\n/** Argument for the `ElementAspect.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnAspectArg {\r\n /** The iModel for the aspect affected by this event. */\r\n iModel: IModelDb;\r\n /** The model for the aspect affected by this event */\r\n model: Id64String;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that supply the properties of an aspect to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnAspectPropsArg extends OnAspectArg {\r\n /** The new properties of the aspect affected by this event. */\r\n props: Readonly<ElementAspectProps>;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that only supply the Id of the affected aspect.\r\n * @beta\r\n */\r\nexport interface OnAspectIdArg extends OnAspectArg {\r\n /** The Id of the aspect affected by this event */\r\n aspectId: Id64String;\r\n}\r\n\r\n/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.\r\n * Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.\r\n * BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.\r\n * @public\r\n */\r\nexport class ElementAspect extends Entity {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementAspect\"; }\r\n public element: RelatedElement;\r\n\r\n /** Construct an aspect from its JSON representation and its containing iModel. */\r\n constructor(props: ElementAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.element = RelatedElement.fromJSON(props.element)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n }\r\n\r\n public override toJSON(): ElementAspectProps {\r\n const val = super.toJSON() as ElementAspectProps;\r\n val.element = this.element;\r\n return val;\r\n }\r\n\r\n /** Called before a new ElementAspect is inserted.\r\n * @note throw an exception to disallow the insert\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInsert(arg: OnAspectPropsArg): void {\r\n const { props, iModel } = arg;\r\n iModel.channels.verifyChannel(arg.model);\r\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"insert aspect\");\r\n }\r\n\r\n /** Called after a new ElementAspect was inserted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInserted(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect is updated.\r\n * @note throw an exception to disallow the update\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdate(arg: OnAspectPropsArg): void {\r\n const { props, iModel } = arg;\r\n iModel.channels.verifyChannel(arg.model);\r\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"update aspect\");\r\n }\r\n\r\n /** Called after an ElementAspect was updated.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect is deleted.\r\n * @note throw an exception to disallow the delete\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDelete(arg: OnAspectIdArg): void {\r\n const { aspectId, iModel } = arg;\r\n iModel.channels.verifyChannel(arg.model);\r\n const { element } = iModel.elements.getAspect(aspectId);\r\n iModel.locks.checkExclusiveLock(element.id, \"element\", \"delete aspect\");\r\n }\r\n\r\n /** Called after an ElementAspect was deleted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnAspectIdArg): void { }\r\n}\r\n/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementUniqueAspect extends ElementAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementUniqueAspect\"; }\r\n}\r\n\r\n/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementMultiAspect extends ElementAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementMultiAspect\"; }\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport class ChannelRootAspect extends ElementUniqueAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ChannelRootAspect\"; }\r\n /** Insert a ChannelRootAspect on the specified element.\r\n * @deprecated in 4.0 use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.\r\n */\r\n public static insert(iModel: IModelDb, ownerId: Id64String, channelName: string) {\r\n const props: ChannelRootAspectProps = { classFullName: this.classFullName, element: { id: ownerId }, owner: channelName };\r\n iModel.elements.insertAspect(props);\r\n }\r\n}\r\n\r\n/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.2\r\n * @public\r\n */\r\nexport class ExternalSourceAspect extends ElementMultiAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceAspect\"; }\r\n\r\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\r\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\r\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\r\n */\r\n public scope: RelatedElement;\r\n /** The identifier of the object in the source repository. */\r\n public identifier: string;\r\n /** The kind of object within the source repository. */\r\n public kind: string;\r\n /** The cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\r\n public checksum?: string;\r\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\r\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\r\n * If present, this value must be guaranteed to change when any of the source object's content changes.\r\n */\r\n public version?: string;\r\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\r\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\r\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\r\n */\r\n public jsonProperties?: string;\r\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\r\n public source?: RelatedElement;\r\n\r\n /** Construct an aspect from its JSON representation and its containing iModel. */\r\n constructor(props: ExternalSourceAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.scope = RelatedElement.fromJSON(props.scope)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n this.source = RelatedElement.fromJSON(props.source);\r\n this.identifier = props.identifier;\r\n this.kind = props.kind;\r\n this.checksum = props.checksum;\r\n this.version = props.version;\r\n this.jsonProperties = props.jsonProperties;\r\n }\r\n\r\n /** @deprecated in 3.x. findAllBySource */\r\n public static findBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): { elementId?: Id64String, aspectId?: Id64String } {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n let elementId: Id64String | undefined;\r\n let aspectId: Id64String | undefined;\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n if (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n elementId = statement.getValue(0).getId();\r\n aspectId = statement.getValue(1).getId();\r\n }\r\n });\r\n return { elementId, aspectId };\r\n }\r\n\r\n /** Look up the elements that contain one or more ExternalSourceAspect with the specified Scope, Kind, and Identifier.\r\n * The result of this function is an array of all of the ExternalSourceAspects that were found, each associated with the owning element.\r\n * A given element could have more than one ExternalSourceAspect with the given scope, kind, and identifier.\r\n * Also, many elements could have ExternalSourceAspect with the same scope, kind, and identifier.\r\n * Therefore, the result array could have more than one entry with the same elementId.\r\n * Aspects are never shared. Each aspect has its own unique ECInstanceId.\r\n * @param iModelDb The iModel to query\r\n * @param scope The scope of the ExternalSourceAspects to find\r\n * @param kind The kind of the ExternalSourceAspects to find\r\n * @param identifier The identifier of the ExternalSourceAspects to find\r\n * @returns the query results\r\n */\r\n public static findAllBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): Array<{ elementId: Id64String, aspectId: Id64String }> {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n const found: Array<{ elementId: Id64String, aspectId: Id64String }> = [];\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n found.push({ elementId: statement.getValue(0).getId(), aspectId: statement.getValue(1).getId() });\r\n }\r\n });\r\n return found;\r\n }\r\n\r\n public override toJSON(): ExternalSourceAspectProps {\r\n const val = super.toJSON() as ExternalSourceAspectProps;\r\n val.scope = this.scope;\r\n val.source = this.source;\r\n val.identifier = this.identifier;\r\n val.kind = this.kind;\r\n val.checksum = this.checksum;\r\n val.version = this.version;\r\n val.jsonProperties = this.jsonProperties;\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.scope)\r\n referenceIds.addElement(this.scope.id);\r\n referenceIds.addElement(this.element.id);\r\n if (this.source)\r\n referenceIds.addElement(this.source.id);\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace ExternalSourceAspect { // eslint-disable-line no-redeclare\r\n /** Standard values for the `Kind` property of `ExternalSourceAspect`.\r\n * @public\r\n */\r\n export enum Kind {\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Element]] provenance */\r\n Element = \"Element\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Relationship]] provenance */\r\n Relationship = \"Relationship\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing *scope* provenance\r\n * @see [[ExternalSourceAspect.scope]]\r\n */\r\n Scope = \"Scope\",\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ElementAspect.js","sourceRoot":"","sources":["../../src/ElementAspect.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAA+I;AAC/I,qCAAkC;AAGlC,sDAA2D;AAC3D,gDAAoD;AA0BpD;;;;GAIG;AACH,MAAa,aAAc,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;QACrB,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACzC,OAAO,GAAG,CAAC;IACb,CAAC;IAEkB,mBAAmB,CAAC,YAAgC;QACrE,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,IAAI,IAAI,CAAC,KAAK;YACZ,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,MAAM;YACb,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF;AAtGD,oDAsGC;AAED,cAAc;AACd,WAAiB,oBAAoB;IACnC;;OAEG;IACH,IAAY,IASX;IATD,WAAY,IAAI;QACd,oFAAoF;QACpF,2BAAmB,CAAA;QACnB,yFAAyF;QACzF,qCAA6B,CAAA;QAC7B;;WAEG;QACH,uBAAe,CAAA;IACjB,CAAC,EATW,IAAI,GAAJ,yBAAI,KAAJ,yBAAI,QASf;AACH,CAAC,EAdgB,oBAAoB,oCAApB,oBAAoB,QAcpC","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 ElementAspects\r\n */\r\n\r\nimport { ChannelRootAspectProps, ElementAspectProps, EntityReferenceSet, ExternalSourceAspectProps, RelatedElement } from \"@itwin/core-common\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { ECSqlStatement } from \"./ECSqlStatement\";\r\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\r\nimport { _verifyChannel } from \"./internal/Symbols\";\r\n\r\n/** Argument for the `ElementAspect.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnAspectArg {\r\n /** The iModel for the aspect affected by this event. */\r\n iModel: IModelDb;\r\n /** The model for the aspect affected by this event */\r\n model: Id64String;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that supply the properties of an aspect to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnAspectPropsArg extends OnAspectArg {\r\n /** The new properties of the aspect affected by this event. */\r\n props: Readonly<ElementAspectProps>;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that only supply the Id of the affected aspect.\r\n * @beta\r\n */\r\nexport interface OnAspectIdArg extends OnAspectArg {\r\n /** The Id of the aspect affected by this event */\r\n aspectId: Id64String;\r\n}\r\n\r\n/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.\r\n * Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.\r\n * BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.\r\n * @public\r\n */\r\nexport class ElementAspect extends Entity {\r\n public static override get className(): string { return \"ElementAspect\"; }\r\n public element: RelatedElement;\r\n\r\n /** Construct an aspect from its JSON representation and its containing iModel. */\r\n constructor(props: ElementAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.element = RelatedElement.fromJSON(props.element)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n }\r\n\r\n public override toJSON(): ElementAspectProps {\r\n const val = super.toJSON() as ElementAspectProps;\r\n val.element = this.element;\r\n return val;\r\n }\r\n\r\n /** Called before a new ElementAspect is inserted.\r\n * @note throw an exception to disallow the insert\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInsert(arg: OnAspectPropsArg): void {\r\n const { props, iModel } = arg;\r\n iModel.channels[_verifyChannel](arg.model);\r\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"insert aspect\");\r\n }\r\n\r\n /** Called after a new ElementAspect was inserted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInserted(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect is updated.\r\n * @note throw an exception to disallow the update\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdate(arg: OnAspectPropsArg): void {\r\n const { props, iModel } = arg;\r\n iModel.channels[_verifyChannel](arg.model);\r\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"update aspect\");\r\n }\r\n\r\n /** Called after an ElementAspect was updated.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect is deleted.\r\n * @note throw an exception to disallow the delete\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDelete(arg: OnAspectIdArg): void {\r\n const { aspectId, iModel } = arg;\r\n iModel.channels[_verifyChannel](arg.model);\r\n const { element } = iModel.elements.getAspect(aspectId);\r\n iModel.locks.checkExclusiveLock(element.id, \"element\", \"delete aspect\");\r\n }\r\n\r\n /** Called after an ElementAspect was deleted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnAspectIdArg): void { }\r\n}\r\n/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementUniqueAspect extends ElementAspect {\r\n public static override get className(): string { return \"ElementUniqueAspect\"; }\r\n}\r\n\r\n/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementMultiAspect extends ElementAspect {\r\n public static override get className(): string { return \"ElementMultiAspect\"; }\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport class ChannelRootAspect extends ElementUniqueAspect {\r\n public static override get className(): string { return \"ChannelRootAspect\"; }\r\n /** Insert a ChannelRootAspect on the specified element.\r\n * @deprecated in 4.0 use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.\r\n */\r\n public static insert(iModel: IModelDb, ownerId: Id64String, channelName: string) {\r\n const props: ChannelRootAspectProps = { classFullName: this.classFullName, element: { id: ownerId }, owner: channelName };\r\n iModel.elements.insertAspect(props);\r\n }\r\n}\r\n\r\n/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.2\r\n * @public\r\n */\r\nexport class ExternalSourceAspect extends ElementMultiAspect {\r\n public static override get className(): string { return \"ExternalSourceAspect\"; }\r\n\r\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\r\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\r\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\r\n */\r\n public scope: RelatedElement;\r\n /** The identifier of the object in the source repository. */\r\n public identifier: string;\r\n /** The kind of object within the source repository. */\r\n public kind: string;\r\n /** The cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\r\n public checksum?: string;\r\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\r\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\r\n * If present, this value must be guaranteed to change when any of the source object's content changes.\r\n */\r\n public version?: string;\r\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\r\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\r\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\r\n */\r\n public jsonProperties?: string;\r\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\r\n public source?: RelatedElement;\r\n\r\n /** Construct an aspect from its JSON representation and its containing iModel. */\r\n constructor(props: ExternalSourceAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.scope = RelatedElement.fromJSON(props.scope)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n this.source = RelatedElement.fromJSON(props.source);\r\n this.identifier = props.identifier;\r\n this.kind = props.kind;\r\n this.checksum = props.checksum;\r\n this.version = props.version;\r\n this.jsonProperties = props.jsonProperties;\r\n }\r\n\r\n /** @deprecated in 3.x. findAllBySource */\r\n public static findBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): { elementId?: Id64String, aspectId?: Id64String } {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n let elementId: Id64String | undefined;\r\n let aspectId: Id64String | undefined;\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n if (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n elementId = statement.getValue(0).getId();\r\n aspectId = statement.getValue(1).getId();\r\n }\r\n });\r\n return { elementId, aspectId };\r\n }\r\n\r\n /** Look up the elements that contain one or more ExternalSourceAspect with the specified Scope, Kind, and Identifier.\r\n * The result of this function is an array of all of the ExternalSourceAspects that were found, each associated with the owning element.\r\n * A given element could have more than one ExternalSourceAspect with the given scope, kind, and identifier.\r\n * Also, many elements could have ExternalSourceAspect with the same scope, kind, and identifier.\r\n * Therefore, the result array could have more than one entry with the same elementId.\r\n * Aspects are never shared. Each aspect has its own unique ECInstanceId.\r\n * @param iModelDb The iModel to query\r\n * @param scope The scope of the ExternalSourceAspects to find\r\n * @param kind The kind of the ExternalSourceAspects to find\r\n * @param identifier The identifier of the ExternalSourceAspects to find\r\n * @returns the query results\r\n */\r\n public static findAllBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): Array<{ elementId: Id64String, aspectId: Id64String }> {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n const found: Array<{ elementId: Id64String, aspectId: Id64String }> = [];\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n found.push({ elementId: statement.getValue(0).getId(), aspectId: statement.getValue(1).getId() });\r\n }\r\n });\r\n return found;\r\n }\r\n\r\n public override toJSON(): ExternalSourceAspectProps {\r\n const val = super.toJSON() as ExternalSourceAspectProps;\r\n val.scope = this.scope;\r\n val.source = this.source;\r\n val.identifier = this.identifier;\r\n val.kind = this.kind;\r\n val.checksum = this.checksum;\r\n val.version = this.version;\r\n val.jsonProperties = this.jsonProperties;\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.scope)\r\n referenceIds.addElement(this.scope.id);\r\n referenceIds.addElement(this.element.id);\r\n if (this.source)\r\n referenceIds.addElement(this.source.id);\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace ExternalSourceAspect { // eslint-disable-line no-redeclare\r\n /** Standard values for the `Kind` property of `ExternalSourceAspect`.\r\n * @public\r\n */\r\n export enum Kind {\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Element]] provenance */\r\n Element = \"Element\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Relationship]] provenance */\r\n Relationship = \"Relationship\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing *scope* provenance\r\n * @see [[ExternalSourceAspect.scope]]\r\n */\r\n Scope = \"Scope\",\r\n }\r\n}\r\n"]}
@@ -3,6 +3,11 @@
3
3
  */
4
4
  import { CloudSqlite } from "./CloudSqlite";
5
5
  import { Settings } from "./workspace/Settings";
6
+ import { WorkspaceDbCloudProps } from "./workspace/Workspace";
7
+ /** @internal */
8
+ export interface GcsDbProps extends WorkspaceDbCloudProps {
9
+ priority?: number;
10
+ }
6
11
  /**
7
12
  * Internal class to configure and load the gcs workspaces for an iModel.
8
13
  * @internal
@@ -10,6 +15,11 @@ import { Settings } from "./workspace/Settings";
10
15
  export declare class GeoCoordConfig {
11
16
  /** array of cloud prefetch tasks that may be awaited to permit offline usage */
12
17
  static readonly prefetches: CloudSqlite.CloudPrefetch[];
18
+ static readonly settingName: {
19
+ databases: string;
20
+ defaultDatabases: string;
21
+ disableWorkspaces: string;
22
+ };
13
23
  private static addGcsWorkspace;
14
24
  private static loadAll;
15
25
  private static _defaultDbsLoaded;
@@ -1 +1 @@
1
- {"version":3,"file":"GeoCoordConfig.d.ts","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAUhD;;;GAGG;AACH,qBAAa,cAAc;IACzB,gFAAgF;IAChF,gBAAuB,UAAU,EAAE,WAAW,CAAC,aAAa,EAAE,CAAM;IAEpE,OAAO,CAAC,MAAM,CAAC,eAAe;IAyC9B,OAAO,CAAC,MAAM,CAAC,OAAO;IAYtB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAS;WAC3B,SAAS;WAKT,oBAAoB,IAAI,IAAI;WAO5B,aAAa,CAAC,QAAQ,EAAE,QAAQ;CAI/C"}
1
+ {"version":3,"file":"GeoCoordConfig.d.ts","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,gBAAgB;AAChB,MAAM,WAAW,UAAW,SAAQ,qBAAqB;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD;;;GAGG;AACH,qBAAa,cAAc;IACzB,gFAAgF;IAChF,gBAAuB,UAAU,EAAE,WAAW,CAAC,aAAa,EAAE,CAAM;IACpE,gBAAuB,WAAW;;;;MAIhC;IAEF,OAAO,CAAC,MAAM,CAAC,eAAe;IAkC9B,OAAO,CAAC,MAAM,CAAC,OAAO;IAStB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAS;WAC3B,SAAS;WAKT,oBAAoB,IAAI,IAAI;WAO5B,aAAa,CAAC,QAAQ,EAAE,QAAQ;CAI/C"}
@@ -11,56 +11,49 @@ exports.GeoCoordConfig = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const CloudSqlite_1 = require("./CloudSqlite");
13
13
  const IModelHost_1 = require("./IModelHost");
14
+ const NativePlatform_1 = require("./internal/NativePlatform");
14
15
  const loggerCat = "GeoCoord";
16
+ const makeSettingName = (name) => `${"itwin/core/gcs"}/${name}`;
15
17
  /**
16
18
  * Internal class to configure and load the gcs workspaces for an iModel.
17
19
  * @internal
18
20
  */
19
21
  class GeoCoordConfig {
20
- static addGcsWorkspace(gcsDbAlias) {
22
+ static addGcsWorkspace(dbProps) {
21
23
  // override to disable loading GCS data from workspaces
22
- if (IModelHost_1.IModelHost.appWorkspace.settings.getBoolean("gcs/disableWorkspaces", false))
24
+ if (IModelHost_1.IModelHost.appWorkspace.settings.getBoolean(GeoCoordConfig.settingName.disableWorkspaces, false))
23
25
  return;
24
- let containerProps;
25
26
  try {
26
27
  const ws = IModelHost_1.IModelHost.appWorkspace;
27
- const dbProps = ws.resolveDatabase(gcsDbAlias);
28
- containerProps = ws.resolveContainer(dbProps.containerName);
29
- const container = ws.getContainer(containerProps);
28
+ const container = ws.getContainer({ ...dbProps, accessToken: "" }); // all gcs containers are public so no accessToken is required
30
29
  const cloudContainer = container.cloudContainer;
31
30
  if (!cloudContainer?.isConnected) {
32
- core_bentley_1.Logger.logError("GeoCoord", `could not load gcs database "${gcsDbAlias}"`);
31
+ core_bentley_1.Logger.logError("GeoCoord", `could not load gcs database "${dbProps.dbName}"`);
33
32
  return;
34
33
  }
35
34
  const gcsDbName = container.resolveDbFileName(dbProps);
36
35
  const gcsDbProps = cloudContainer.queryDatabase(gcsDbName);
37
36
  if (undefined === gcsDbProps)
38
- throw new Error(`database "${gcsDbName}" not found in container "${containerProps.containerId}"`);
39
- if (!IModelHost_1.IModelHost.platform.addGcsWorkspaceDb(gcsDbName, cloudContainer, dbProps.priority))
37
+ throw new Error(`database "${gcsDbName}" not found in container "${dbProps.containerId}"`);
38
+ if (!NativePlatform_1.IModelNative.platform.addGcsWorkspaceDb(gcsDbName, cloudContainer, dbProps.priority))
40
39
  return; // already had this db
41
- if (IModelHost_1.IModelHost.appWorkspace.settings.getBoolean("gcs/noLocalData", false))
42
- IModelHost_1.IModelHost.platform.enableLocalGcsFiles(false);
43
- core_bentley_1.Logger.logInfo(loggerCat, `loaded gcsDb "${gcsDbName}", from "${containerProps.baseUri}/${containerProps.containerId}" size=${gcsDbProps.totalBlocks}, local=${gcsDbProps.localBlocks}`);
40
+ core_bentley_1.Logger.logInfo(loggerCat, `loaded gcsDb "${gcsDbName}", from "${dbProps.baseUri}/${dbProps.containerId}" size=${gcsDbProps.totalBlocks}, local=${gcsDbProps.localBlocks}`);
44
41
  if (true === dbProps.prefetch)
45
42
  this.prefetches.push(CloudSqlite_1.CloudSqlite.startCloudPrefetch(cloudContainer, gcsDbName));
46
43
  }
47
44
  catch (e) {
48
45
  let msg = `Cannot load GCS workspace (${e.errorNumber}): ${core_bentley_1.BentleyError.getErrorMessage(e)}`;
49
- if (containerProps)
50
- msg += `,container=${containerProps.baseUri}/${containerProps.containerId}, storage=${containerProps.storageType}, public=${containerProps.isPublic}, cacheDir=${IModelHost_1.IModelHost.cacheDir}`;
46
+ msg += `,container=${dbProps.baseUri}/${dbProps.containerId}, storage=${dbProps.storageType}, public=${dbProps.isPublic}, cacheDir=${IModelHost_1.IModelHost.cacheDir}`;
51
47
  core_bentley_1.Logger.logError(loggerCat, msg);
52
48
  }
53
49
  }
54
50
  static loadAll(settings, settingName) {
55
- settings.resolveSetting(settingName, (val) => {
56
- if (Array.isArray(val)) {
57
- for (const entry of val) {
58
- if (typeof entry === "string")
59
- this.addGcsWorkspace(entry);
60
- }
51
+ const dbProps = settings.getArray(settingName);
52
+ if (dbProps) {
53
+ for (const entry of dbProps) {
54
+ this.addGcsWorkspace(entry);
61
55
  }
62
- return undefined; // keep going through all dictionaries
63
- });
56
+ }
64
57
  }
65
58
  static onStartup() {
66
59
  this._defaultDbsLoaded = false;
@@ -69,16 +62,21 @@ class GeoCoordConfig {
69
62
  static loadDefaultDatabases() {
70
63
  if (!this._defaultDbsLoaded) {
71
64
  this._defaultDbsLoaded = true;
72
- this.loadAll(IModelHost_1.IModelHost.appWorkspace.settings, "gcs/default/databases");
65
+ this.loadAll(IModelHost_1.IModelHost.appWorkspace.settings, this.settingName.defaultDatabases);
73
66
  }
74
67
  }
75
68
  static loadForImodel(settings) {
76
69
  this.loadDefaultDatabases();
77
- this.loadAll(settings, "gcs/databases");
70
+ this.loadAll(settings, this.settingName.databases);
78
71
  }
79
72
  }
80
73
  exports.GeoCoordConfig = GeoCoordConfig;
81
74
  /** array of cloud prefetch tasks that may be awaited to permit offline usage */
82
75
  GeoCoordConfig.prefetches = [];
76
+ GeoCoordConfig.settingName = {
77
+ databases: makeSettingName("databases"),
78
+ defaultDatabases: makeSettingName("default/databases"),
79
+ disableWorkspaces: makeSettingName("disableWorkspaces"),
80
+ };
83
81
  GeoCoordConfig._defaultDbsLoaded = false;
84
82
  //# sourceMappingURL=GeoCoordConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GeoCoordConfig.js","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2D;AAC3D,+CAA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AS;QACrB,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7B,CAAC;IAEM,MAAM,CAAC,oBAAoB;QAChC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;YAC9B,IAAI,CAAC,OAAO,CAAC,uBAAU,CAAC,YAAY,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,QAAkB;QAC5C,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IAC1C,CAAC;;AAzEH,wCA0EC;AAzEC,gFAAgF;AACzD,yBAAU,GAAgC,EAAE,CAAC;AAuDrD,gCAAiB,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { BentleyError, Logger } from \"@itwin/core-bentley\";\r\nimport { CloudSqlite } from \"./CloudSqlite\";\r\nimport { IModelHost } from \"./IModelHost\";\r\nimport { Settings } from \"./workspace/Settings\";\r\nimport { WorkspaceContainer, WorkspaceDb } from \"./workspace/Workspace\";\r\n\r\nconst loggerCat = \"GeoCoord\";\r\n\r\ninterface GcsDbProps extends WorkspaceDb.Props, WorkspaceContainer.Alias {\r\n prefetch?: boolean;\r\n priority?: number;\r\n}\r\n\r\n/**\r\n * Internal class to configure and load the gcs workspaces for an iModel.\r\n * @internal\r\n */\r\nexport class GeoCoordConfig {\r\n /** array of cloud prefetch tasks that may be awaited to permit offline usage */\r\n public static readonly prefetches: CloudSqlite.CloudPrefetch[] = [];\r\n\r\n private static addGcsWorkspace(gcsDbAlias: string) {\r\n // override to disable loading GCS data from workspaces\r\n if (IModelHost.appWorkspace.settings.getBoolean(\"gcs/disableWorkspaces\", false))\r\n return;\r\n\r\n let containerProps: WorkspaceContainer.Props | undefined;\r\n try {\r\n const ws = IModelHost.appWorkspace;\r\n const dbProps = ws.resolveDatabase(gcsDbAlias) as GcsDbProps;\r\n containerProps = ws.resolveContainer(dbProps.containerName);\r\n const container = ws.getContainer(containerProps);\r\n const cloudContainer = container.cloudContainer;\r\n if (!cloudContainer?.isConnected) {\r\n Logger.logError(\"GeoCoord\", `could not load gcs database \"${gcsDbAlias}\"`);\r\n return;\r\n }\r\n\r\n const gcsDbName = container.resolveDbFileName(dbProps);\r\n const gcsDbProps = cloudContainer.queryDatabase(gcsDbName);\r\n if (undefined === gcsDbProps)\r\n throw new Error(`database \"${gcsDbName}\" not found in container \"${containerProps.containerId}\"`);\r\n\r\n if (!IModelHost.platform.addGcsWorkspaceDb(gcsDbName, cloudContainer, dbProps.priority))\r\n return; // already had this db\r\n\r\n if (IModelHost.appWorkspace.settings.getBoolean(\"gcs/noLocalData\", false))\r\n IModelHost.platform.enableLocalGcsFiles(false);\r\n\r\n Logger.logInfo(loggerCat, `loaded gcsDb \"${gcsDbName}\", from \"${containerProps.baseUri}/${containerProps.containerId}\" size=${gcsDbProps.totalBlocks}, local=${gcsDbProps.localBlocks}`);\r\n\r\n if (true === dbProps.prefetch)\r\n this.prefetches.push(CloudSqlite.startCloudPrefetch(cloudContainer, gcsDbName));\r\n\r\n } catch (e: any) {\r\n let msg = `Cannot load GCS workspace (${e.errorNumber}): ${BentleyError.getErrorMessage(e)}`;\r\n if (containerProps)\r\n msg += `,container=${containerProps.baseUri}/${containerProps.containerId}, storage=${containerProps.storageType}, public=${containerProps.isPublic}, cacheDir=${IModelHost.cacheDir}`;\r\n Logger.logError(loggerCat, msg);\r\n }\r\n }\r\n\r\n private static loadAll(settings: Settings, settingName: string) {\r\n settings.resolveSetting(settingName, (val) => {\r\n if (Array.isArray(val)) {\r\n for (const entry of val) {\r\n if (typeof entry === \"string\")\r\n this.addGcsWorkspace(entry);\r\n }\r\n }\r\n return undefined; // keep going through all dictionaries\r\n });\r\n }\r\n\r\n private static _defaultDbsLoaded = false;\r\n public static onStartup() {\r\n this._defaultDbsLoaded = false;\r\n this.prefetches.length = 0;\r\n }\r\n\r\n public static loadDefaultDatabases(): void {\r\n if (!this._defaultDbsLoaded) {\r\n this._defaultDbsLoaded = true;\r\n this.loadAll(IModelHost.appWorkspace.settings, \"gcs/default/databases\");\r\n }\r\n }\r\n\r\n public static loadForImodel(settings: Settings) {\r\n this.loadDefaultDatabases();\r\n this.loadAll(settings, \"gcs/databases\");\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"GeoCoordConfig.js","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2D;AAC3D,+CAA4C;AAC5C,6CAA0C;AAG1C,8DAAyD;AAEzD,MAAM,SAAS,GAAG,UAAU,CAAC;AAM7B,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,GAAG,gBAAgB,IAAI,IAAI,EAAE,CAAC;AAExE;;;GAGG;AACH,MAAa,cAAc;IASjB,MAAM,CAAC,eAAe,CAAC,OAAmB;QAChD,uDAAuD;QACvD,IAAI,uBAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC,iBAAiB,EAAE,KAAK,CAAC;YAClG,OAAO;QAET,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,uBAAU,CAAC,YAAY,CAAC;YACnC,MAAM,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,GAAG,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,8DAA8D;YAClI,MAAM,cAAc,GAAG,SAAS,CAAC,cAAc,CAAC;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AAG,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,OAAO,CAAC,QAAkB,EAAE,WAAmB;QAC5D,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAa,WAAW,CAAC,CAAC;QAC3D,IAAI,OAAO,EAAE,CAAC;YACZ,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC5B,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IAGM,MAAM,CAAC,SAAS;QACrB,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7B,CAAC;IAEM,MAAM,CAAC,oBAAoB;QAChC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;YAC9B,IAAI,CAAC,OAAO,CAAC,uBAAU,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QACpF,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,QAAkB;QAC5C,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;;AApEH,wCAqEC;AApEC,gFAAgF;AACzD,yBAAU,GAAgC,EAAE,CAAC;AAC7C,0BAAW,GAAG;IACnC,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC;IACvC,gBAAgB,EAAE,eAAe,CAAC,mBAAmB,CAAC;IACtD,iBAAiB,EAAE,eAAe,CAAC,mBAAmB,CAAC;CACxD,CAAC;AA6Ca,gCAAiB,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { BentleyError, Logger } from \"@itwin/core-bentley\";\r\nimport { CloudSqlite } from \"./CloudSqlite\";\r\nimport { IModelHost } from \"./IModelHost\";\r\nimport { Settings } from \"./workspace/Settings\";\r\nimport { WorkspaceDbCloudProps } from \"./workspace/Workspace\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\n\r\nconst loggerCat = \"GeoCoord\";\r\n\r\n/** @internal */\r\nexport interface GcsDbProps extends WorkspaceDbCloudProps {\r\n priority?: number;\r\n}\r\nconst makeSettingName = (name: string) => `${\"itwin/core/gcs\"}/${name}`;\r\n\r\n/**\r\n * Internal class to configure and load the gcs workspaces for an iModel.\r\n * @internal\r\n */\r\nexport class GeoCoordConfig {\r\n /** array of cloud prefetch tasks that may be awaited to permit offline usage */\r\n public static readonly prefetches: CloudSqlite.CloudPrefetch[] = [];\r\n public static readonly settingName = {\r\n databases: makeSettingName(\"databases\"),\r\n defaultDatabases: makeSettingName(\"default/databases\"),\r\n disableWorkspaces: makeSettingName(\"disableWorkspaces\"),\r\n };\r\n\r\n private static addGcsWorkspace(dbProps: GcsDbProps) {\r\n // override to disable loading GCS data from workspaces\r\n if (IModelHost.appWorkspace.settings.getBoolean(GeoCoordConfig.settingName.disableWorkspaces, false))\r\n return;\r\n\r\n try {\r\n const ws = IModelHost.appWorkspace;\r\n const container = ws.getContainer({ ...dbProps, accessToken: \"\" }); // all gcs containers are public so no accessToken is required\r\n const cloudContainer = container.cloudContainer;\r\n if (!cloudContainer?.isConnected) {\r\n Logger.logError(\"GeoCoord\", `could not load gcs database \"${dbProps.dbName}\"`);\r\n return;\r\n }\r\n\r\n const gcsDbName = container.resolveDbFileName(dbProps);\r\n const gcsDbProps = cloudContainer.queryDatabase(gcsDbName);\r\n if (undefined === gcsDbProps)\r\n throw new Error(`database \"${gcsDbName}\" not found in container \"${dbProps.containerId}\"`);\r\n\r\n if (!IModelNative.platform.addGcsWorkspaceDb(gcsDbName, cloudContainer, dbProps.priority))\r\n return; // already had this db\r\n\r\n Logger.logInfo(loggerCat, `loaded gcsDb \"${gcsDbName}\", from \"${dbProps.baseUri}/${dbProps.containerId}\" size=${gcsDbProps.totalBlocks}, local=${gcsDbProps.localBlocks}`);\r\n\r\n if (true === dbProps.prefetch)\r\n this.prefetches.push(CloudSqlite.startCloudPrefetch(cloudContainer, gcsDbName));\r\n\r\n } catch (e: any) {\r\n let msg = `Cannot load GCS workspace (${e.errorNumber}): ${BentleyError.getErrorMessage(e)}`;\r\n msg += `,container=${dbProps.baseUri}/${dbProps.containerId}, storage=${dbProps.storageType}, public=${dbProps.isPublic}, cacheDir=${IModelHost.cacheDir}`;\r\n Logger.logError(loggerCat, msg);\r\n }\r\n }\r\n\r\n private static loadAll(settings: Settings, settingName: string) {\r\n const dbProps = settings.getArray<GcsDbProps>(settingName);\r\n if (dbProps) {\r\n for (const entry of dbProps) {\r\n this.addGcsWorkspace(entry);\r\n }\r\n }\r\n }\r\n\r\n private static _defaultDbsLoaded = false;\r\n public static onStartup() {\r\n this._defaultDbsLoaded = false;\r\n this.prefetches.length = 0;\r\n }\r\n\r\n public static loadDefaultDatabases(): void {\r\n if (!this._defaultDbsLoaded) {\r\n this._defaultDbsLoaded = true;\r\n this.loadAll(IModelHost.appWorkspace.settings, this.settingName.defaultDatabases);\r\n }\r\n }\r\n\r\n public static loadForImodel(settings: Settings) {\r\n this.loadDefaultDatabases();\r\n this.loadAll(settings, this.settingName.databases);\r\n }\r\n}\r\n"]}
@@ -8,14 +8,14 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.getAvailableCoordinateReferenceSystems = void 0;
11
- const IModelHost_1 = require("./IModelHost");
11
+ const NativePlatform_1 = require("./internal/NativePlatform");
12
12
  /** Get a list of Geographic Coordinate Reference Systems.
13
13
  * @param options Specifies the parameters to filter the returned list.
14
14
  * @returns The list of Geographic Coordinate Reference Systems, according to the supplied parameters.
15
15
  * @beta
16
16
  */
17
17
  async function getAvailableCoordinateReferenceSystems(args) {
18
- return IModelHost_1.IModelHost.platform.GeoServices.getListOfCRS(args.extent);
18
+ return NativePlatform_1.IModelNative.platform.GeoServices.getListOfCRS(args.extent);
19
19
  }
20
20
  exports.getAvailableCoordinateReferenceSystems = getAvailableCoordinateReferenceSystems;
21
21
  //# sourceMappingURL=GeographicCRSServices.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GeographicCRSServices.js","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,6CAA0C;AAiC1C;;;;GAIG;AACI,KAAK,UAAU,sCAAsC,CAAC,IAAgD;IAC3G,OAAO,uBAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACnE,CAAC;AAFD,wFAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { Range2dProps } from \"@itwin/core-geometry\";\r\nimport { IModelHost } from \"./IModelHost\";\r\n\r\n/** Describes a geographic coordinate reference system produced by [[getAvailableCoordinateReferenceSystems]].\r\n * @beta\r\n */\r\nexport interface AvailableCoordinateReferenceSystemProps {\r\n /** The name of the coordinate reference system. It can be presented to the user in the UI as an identifier for the coordinate reference system. */\r\n name: string;\r\n /** The description of the coordinate reference system. It can be presented to the user in the UI as extra information for the coordinate reference system. */\r\n description: string;\r\n /** Indicate if the coordinate reference system is deprecated. A coordinate reference system is deprecated if it is no longer recommended for use.\r\n * A deprecated coordinate reference system can usually be substituted by a more accurate one. It is possible that an existing project uses a deprecated coordinate reference system.\r\n * However, for new projects, it is recommended to use a non-deprecated coordinate reference system.\r\n */\r\n deprecated: boolean;\r\n /** Extent of the coordinate reference system. This is the area where the coordinate reference system can be used.\r\n * Outside of this area, the coordinate reference system may not be accurate. The extent is defined by a range of longitude and latitude values.\r\n * Minimum longitude and latitude correspond to crsExtent.low.x and crsExtent.low.y, respectively.\r\n * Maximum longitude and latitude correspond to crsExtent.high.x and crsExtent.high.y, respectively.\r\n */\r\n crsExtent: Range2dProps;\r\n}\r\n\r\n/** Arguments supplied to [[getAvailableCoordinateReferenceSystems]].\r\n * @beta\r\n */\r\nexport interface GetAvailableCoordinateReferenceSystemsArgs {\r\n /** If provided, only return CRS's that contain the given extent. Minimum longitude and latitude correspond to extent.low.x and extent.low.y, respectively.\r\n * Maximum longitude and latitude correspond to extent.high.x and extent.high.y, respectively.\r\n */\r\n extent?: Range2dProps;\r\n}\r\n\r\n/** Get a list of Geographic Coordinate Reference Systems.\r\n * @param options Specifies the parameters to filter the returned list.\r\n * @returns The list of Geographic Coordinate Reference Systems, according to the supplied parameters.\r\n * @beta\r\n */\r\nexport async function getAvailableCoordinateReferenceSystems(args: GetAvailableCoordinateReferenceSystemsArgs): Promise<AvailableCoordinateReferenceSystemProps[]> {\r\n return IModelHost.platform.GeoServices.getListOfCRS(args.extent);\r\n}\r\n"]}
1
+ {"version":3,"file":"GeographicCRSServices.js","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,8DAAyD;AAiCzD;;;;GAIG;AACI,KAAK,UAAU,sCAAsC,CAAC,IAAgD;IAC3G,OAAO,6BAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrE,CAAC;AAFD,wFAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { Range2dProps } from \"@itwin/core-geometry\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\n\r\n/** Describes a geographic coordinate reference system produced by [[getAvailableCoordinateReferenceSystems]].\r\n * @beta\r\n */\r\nexport interface AvailableCoordinateReferenceSystemProps {\r\n /** The name of the coordinate reference system. It can be presented to the user in the UI as an identifier for the coordinate reference system. */\r\n name: string;\r\n /** The description of the coordinate reference system. It can be presented to the user in the UI as extra information for the coordinate reference system. */\r\n description: string;\r\n /** Indicate if the coordinate reference system is deprecated. A coordinate reference system is deprecated if it is no longer recommended for use.\r\n * A deprecated coordinate reference system can usually be substituted by a more accurate one. It is possible that an existing project uses a deprecated coordinate reference system.\r\n * However, for new projects, it is recommended to use a non-deprecated coordinate reference system.\r\n */\r\n deprecated: boolean;\r\n /** Extent of the coordinate reference system. This is the area where the coordinate reference system can be used.\r\n * Outside of this area, the coordinate reference system may not be accurate. The extent is defined by a range of longitude and latitude values.\r\n * Minimum longitude and latitude correspond to crsExtent.low.x and crsExtent.low.y, respectively.\r\n * Maximum longitude and latitude correspond to crsExtent.high.x and crsExtent.high.y, respectively.\r\n */\r\n crsExtent: Range2dProps;\r\n}\r\n\r\n/** Arguments supplied to [[getAvailableCoordinateReferenceSystems]].\r\n * @beta\r\n */\r\nexport interface GetAvailableCoordinateReferenceSystemsArgs {\r\n /** If provided, only return CRS's that contain the given extent. Minimum longitude and latitude correspond to extent.low.x and extent.low.y, respectively.\r\n * Maximum longitude and latitude correspond to extent.high.x and extent.high.y, respectively.\r\n */\r\n extent?: Range2dProps;\r\n}\r\n\r\n/** Get a list of Geographic Coordinate Reference Systems.\r\n * @param options Specifies the parameters to filter the returned list.\r\n * @returns The list of Geographic Coordinate Reference Systems, according to the supplied parameters.\r\n * @beta\r\n */\r\nexport async function getAvailableCoordinateReferenceSystems(args: GetAvailableCoordinateReferenceSystemsArgs): Promise<AvailableCoordinateReferenceSystemProps[]> {\r\n return IModelNative.platform.GeoServices.getListOfCRS(args.extent);\r\n}\r\n"]}
@@ -2,7 +2,7 @@
2
2
  * @module iModels
3
3
  */
4
4
  import { IModelJsNative } from "@bentley/imodeljs-native";
5
- import { AccessToken, BeEvent, DbChangeStage, DbConflictCause, DbOpcode, DbResult, DbValueType, GuidString, Id64Arg, Id64Array, Id64Set, Id64String, IModelStatus, OpenMode } from "@itwin/core-bentley";
5
+ import { AccessToken, BeEvent, DbResult, GuidString, Id64Arg, Id64Array, Id64Set, Id64String, IModelStatus, OpenMode } from "@itwin/core-bentley";
6
6
  import { AxisAlignedBox3d, BRepGeometryCreate, BriefcaseId, ChangesetIdWithIndex, Code, CodeProps, CreateEmptySnapshotIModelProps, CreateEmptyStandaloneIModelProps, CreateSnapshotIModelProps, EcefLocation, ECSchemaProps, ECSqlReader, ElementAspectProps, ElementGeometryRequest, ElementGraphicsRequestProps, ElementLoadProps, ElementProps, EntityMetaData, EntityProps, EntityQueryParams, FilePropertyProps, FontId, FontMap, FontType, GeoCoordinatesRequestProps, GeoCoordinatesResponseProps, GeometryContainmentRequestProps, GeometryContainmentResponseProps, IModel, IModelCoordinatesRequestProps, IModelCoordinatesResponseProps, IModelTileTreeProps, LocalFileName, MassPropertiesRequestProps, MassPropertiesResponseProps, ModelExtentsProps, ModelLoadProps, ModelProps, OpenBriefcaseProps, OpenCheckpointArgs, OpenSqliteArgs, PropertyCallback, QueryBinder, QueryOptions, SchemaState, SnapRequestProps, SnapResponseProps, SnapshotOpenOptions, SubCategoryResultRow, TextureData, TextureLoadProps, ThumbnailProps, UpgradeOptions, ViewDefinitionProps, ViewIdString, ViewQueryParams, ViewStateLoadProps, ViewStateProps } from "@itwin/core-common";
7
7
  import { Range3d } from "@itwin/core-geometry";
8
8
  import { PullChangesArgs, PushChangesArgs } from "./BriefcaseManager";
@@ -21,33 +21,14 @@ import { ExportGraphicsOptions, ExportPartGraphicsOptions } from "./ExportGraphi
21
21
  import { Model } from "./Model";
22
22
  import { Relationships } from "./Relationship";
23
23
  import { SqliteStatement } from "./SqliteStatement";
24
+ import { ComputeRangesForTextLayoutArgs, TextLayoutRanges } from "./TextAnnotationLayout";
24
25
  import { TxnManager } from "./TxnManager";
25
26
  import { ViewDefinition } from "./ViewDefinition";
26
27
  import { ViewStore } from "./ViewStore";
27
- import { SettingDictionary } from "./workspace/Settings";
28
+ import { SettingsContainer } from "./workspace/Settings";
28
29
  import { Workspace } from "./workspace/Workspace";
29
- import { ComputeRangesForTextLayoutArgs, TextLayoutRanges } from "./TextAnnotationLayout";
30
+ import { LockControl } from "./LockControl";
30
31
  import type { BlobContainer } from "./BlobContainerService";
31
- /** @internal */
32
- export interface ChangesetConflictArgs {
33
- cause: DbConflictCause;
34
- opcode: DbOpcode;
35
- indirect: boolean;
36
- tableName: string;
37
- changesetFile?: string;
38
- columnCount: number;
39
- getForeignKeyConflicts: () => number;
40
- dump: () => void;
41
- setLastError: (message: string) => void;
42
- getPrimaryKeyColumns: () => number[];
43
- getValueType: (columnIndex: number, stage: DbChangeStage) => DbValueType | null | undefined;
44
- getValueBinary: (columnIndex: number, stage: DbChangeStage) => Uint8Array | null | undefined;
45
- getValueId: (columnIndex: number, stage: DbChangeStage) => Id64String | null | undefined;
46
- getValueText: (columnIndex: number, stage: DbChangeStage) => string | null | undefined;
47
- getValueInteger: (columnIndex: number, stage: DbChangeStage) => number | null | undefined;
48
- getValueDouble: (columnIndex: number, stage: DbChangeStage) => number | null | undefined;
49
- isValueNull: (columnIndex: number, stage: DbChangeStage) => boolean | undefined;
50
- }
51
32
  /** Options for [[IModelDb.Models.updateModel]]
52
33
  * @note To mark *only* the geometry as changed, use [[IModelDb.Models.updateGeometryGuid]] instead.
53
34
  * @public
@@ -78,65 +59,6 @@ export interface ComputedProjectExtents {
78
59
  /** If requested by caller, the Ids of outlier elements excluded from the computed extents. */
79
60
  outliers?: Id64Array;
80
61
  }
81
- /**
82
- * Interface for acquiring element locks to coordinate simultaneous edits from multiple briefcases.
83
- * @beta
84
- */
85
- export interface LockControl {
86
- /**
87
- * true if this LockControl uses a server-based concurrency approach.
88
- */
89
- readonly isServerBased: boolean;
90
- /**
91
- * Close the local lock control database
92
- * @internal
93
- */
94
- close(): void;
95
- /**
96
- * Notification that a new element was just created. Called by [[Element.onInserted]]
97
- * @internal
98
- */
99
- elementWasCreated(id: Id64String): void;
100
- /**
101
- * Throw if locks are required and the exclusive lock is not held on the supplied element.
102
- * Note: there is no need to check the shared locks on parents/models since an element cannot hold the exclusive lock without first obtaining them.
103
- * Called by [[Element.onUpdate]], [[Element.onDelete]], etc.
104
- * @internal
105
- */
106
- checkExclusiveLock(id: Id64String, type: string, operation: string): void;
107
- /**
108
- * Throw if locks are required and a shared lock is not held on the supplied element.
109
- * Called by [[Element.onInsert]] to ensure shared lock is held on model and parent.
110
- * @internal
111
- */
112
- checkSharedLock(id: Id64String, type: string, operation: string): void;
113
- /**
114
- * Determine whether the supplied element currently holds the exclusive lock
115
- */
116
- holdsExclusiveLock(id: Id64String): boolean;
117
- /**
118
- * Determine whether the supplied element currently holds a shared lock
119
- */
120
- holdsSharedLock(id: Id64String): boolean;
121
- /**
122
- * Acquire locks on one or more elements from the lock server, if required and not already held.
123
- * If any required lock is not available, this method throws an exception and *none* of the requested locks are acquired.
124
- * > Note: acquiring the exclusive lock on an element requires also obtaining a shared lock on all its owner elements. This method will
125
- * attempt to acquire all necessary locks for both sets of input ids.
126
- */
127
- acquireLocks(arg: {
128
- /** if present, one or more elements to obtain shared lock */
129
- shared?: Id64Arg;
130
- /** if present, one or more elements to obtain exclusive lock */
131
- exclusive?: Id64Arg;
132
- }): Promise<void>;
133
- /**
134
- * Release all locks currently held by this Briefcase from the lock server.
135
- * Not possible to release locks unless push or abandon all changes. Should only be called internally.
136
- * @internal
137
- */
138
- releaseAllLocks(): Promise<void>;
139
- }
140
62
  /**
141
63
  * Options for the importing of schemas
142
64
  * @public
@@ -177,7 +99,6 @@ export declare abstract class IModelDb extends IModel {
177
99
  private _codeSpecs?;
178
100
  private _classMetaDataRegistry?;
179
101
  protected _fontMap?: FontMap;
180
- /** @internal */
181
102
  private _workspace?;
182
103
  private readonly _snaps;
183
104
  private static _shutdownListener;
@@ -187,10 +108,7 @@ export declare abstract class IModelDb extends IModel {
187
108
  protected _codeService?: CodeService;
188
109
  /** @alpha */
189
110
  get codeService(): CodeService | undefined;
190
- /**
191
- * Get the [[LockControl]] for this iModel.
192
- * @beta
193
- */
111
+ /** The [[LockControl]] that orchestrates [concurrent editing]($docs/learning/backend/ConcurrencyControl.md) of this iModel. */
194
112
  get locks(): LockControl;
195
113
  /**
196
114
  * Get the [[Workspace]] for this iModel.
@@ -198,7 +116,7 @@ export declare abstract class IModelDb extends IModel {
198
116
  */
199
117
  get workspace(): Workspace;
200
118
  /** Acquire the exclusive schema lock on this iModel.
201
- * > Note: To acquire the schema lock, all other briefcases must first release *all* their locks. No other briefcases
119
+ * @note: To acquire the schema lock, all other briefcases must first release *all* their locks. No other briefcases
202
120
  * will be able to acquire *any* locks while the schema lock is held.
203
121
  */
204
122
  acquireSchemaLock(): Promise<void>;
@@ -405,7 +323,13 @@ export declare abstract class IModelDb extends IModel {
405
323
  */
406
324
  prepareSqliteStatement(sql: string, logErrors?: boolean): SqliteStatement;
407
325
  /**
408
- * queries the BisCore.SubCategory table for the entries that are children of the passed categoryIds
326
+ * queries the BisCore.SubCategory table for entries that are children of used spatial categories and 3D elements.
327
+ * @returns array of SubCategoryResultRow
328
+ * @internal
329
+ */
330
+ queryAllUsedSpatialSubCategories(): Promise<SubCategoryResultRow[]>;
331
+ /**
332
+ * queries the BisCore.SubCategory table for the entries that are children of the passed categoryIds.
409
333
  * @param categoryIds categoryIds to query
410
334
  * @returns array of SubCategoryResultRow
411
335
  * @internal
@@ -460,7 +384,9 @@ export declare abstract class IModelDb extends IModel {
460
384
  * rarely be copied, and even less so while they're opened. But this scenario is sometimes encountered for tests.
461
385
  */
462
386
  performCheckpoint(): void;
463
- /** @internal */
387
+ /** @internal
388
+ * @deprecated in 4.8. Use `txns.reverseTxns`.
389
+ */
464
390
  reverseTxns(numOperations: number): IModelStatus;
465
391
  /** @internal */
466
392
  reinstateTxn(): IModelStatus;
@@ -694,16 +620,20 @@ export declare abstract class IModelDb extends IModel {
694
620
  * @note All saved `SettingDictionary`s are loaded into [[workspace.settings]] every time an iModel is opened.
695
621
  * @beta
696
622
  */
697
- saveSettingDictionary(name: string, dict: SettingDictionary): void;
623
+ saveSettingDictionary(name: string, dict: SettingsContainer): void;
698
624
  /** Delete a SettingDictionary, previously added with [[saveSettingDictionary]], from this iModel.
699
625
  * @param name The name of the dictionary to delete.
700
626
  * @beta
701
627
  */
702
628
  deleteSettingDictionary(name: string): void;
703
629
  /** Load all setting dictionaries in this iModel into `this.workspace.settings` */
704
- private loadSettingDictionaries;
630
+ private loadIModelSettings;
631
+ /** @internal */
632
+ protected loadWorkspaceSettings(): Promise<void>;
705
633
  /**
706
- * Controls how [Code]($common)s are copied from this iModel into another iModel, to work around problems with iModels created by older connectors. The [imodel-transformer](https://github.com/iTwin/imodel-transformer) sets this appropriately on your behalf - you should never need to set or interrogate this property yourself.
634
+ * Controls how [Code]($common)s are copied from this iModel into another iModel, to work around problems with iModels
635
+ * created by older connectors. The [imodel-transformer](https://github.com/iTwin/imodel-transformer) sets this appropriately
636
+ * on your behalf - you should never need to set or interrogate this property yourself.
707
637
  * @public
708
638
  */
709
639
  get codeValueBehavior(): "exact" | "trim-unicode-whitespace";
@@ -1021,7 +951,6 @@ export declare namespace IModelDb {
1021
951
  set viewStore(viewStore: ViewStore.CloudAccess);
1022
952
  /** @beta */
1023
953
  accessViewStore(args: {
1024
- userToken?: AccessToken;
1025
954
  props?: CloudSqlite.ContainerProps;
1026
955
  accessLevel?: BlobContainer.RequestAccessLevel;
1027
956
  }): Promise<ViewStore.CloudAccess>;
@@ -1183,12 +1112,13 @@ export declare class BriefcaseDb extends IModelDb {
1183
1112
  * @param args parameters that specify the file name, and options for opening the briefcase file
1184
1113
  */
1185
1114
  static open(args: OpenBriefcaseArgs): Promise<BriefcaseDb>;
1115
+ /** This is called by native code when applying a changeset */
1186
1116
  private onChangesetConflict;
1187
1117
  /** If the briefcase is read-only, reopen the native briefcase for writing.
1188
1118
  * Execute the supplied function.
1189
1119
  * If the briefcase was read-only, reopen the native briefcase as read-only.
1190
1120
  * @note this._openMode is not changed from its initial value.
1191
- * @internal Exported strictly for tests.
1121
+ * @internal Exported strictly for tests
1192
1122
  */
1193
1123
  executeWritable(func: () => Promise<void>): Promise<void>;
1194
1124
  private closeAndReopen;
@@ -1219,7 +1149,7 @@ export declare class SnapshotDb extends IModelDb {
1219
1149
  static tryFindByKey(key: string): SnapshotDb | undefined;
1220
1150
  /** Create an *empty* local [Snapshot]($docs/learning/backend/AccessingIModels.md#snapshot-imodels) iModel file.
1221
1151
  * Snapshots are not synchronized with iModelHub, so do not have a change timeline.
1222
- * > Note: A *snapshot* cannot be modified after [[close]] is called.
1152
+ * @note: A *snapshot* cannot be modified after [[close]] is called.
1223
1153
  * @param filePath The file that will contain the new iModel *snapshot*
1224
1154
  * @param options The parameters that define the new iModel *snapshot*
1225
1155
  * @returns A writeable SnapshotDb
@@ -1228,7 +1158,7 @@ export declare class SnapshotDb extends IModelDb {
1228
1158
  static createEmpty(filePath: LocalFileName, options: CreateEmptySnapshotIModelProps): SnapshotDb;
1229
1159
  /** Create a local [Snapshot]($docs/learning/backend/AccessingIModels.md#snapshot-imodels) iModel file, using this iModel as a *seed* or starting point.
1230
1160
  * Snapshots are not synchronized with iModelHub, so do not have a change timeline.
1231
- * > Note: A *snapshot* cannot be modified after [[close]] is called.
1161
+ * @note: A *snapshot* cannot be modified after [[close]] is called.
1232
1162
  * @param iModelDb The snapshot will be initialized from the current contents of this iModelDb
1233
1163
  * @param snapshotFile The file that will contain the new iModel *snapshot*
1234
1164
  * @param options Optional properties that determine how the snapshot iModel is created.