@itwin/core-backend 4.8.0-dev.9 → 4.9.0-dev.2

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 (267) hide show
  1. package/CHANGELOG.md +45 -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.js.map +1 -1
  7. package/lib/cjs/BisCoreSchema.js.map +1 -1
  8. package/lib/cjs/BlobContainerService.js.map +1 -1
  9. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  10. package/lib/cjs/BriefcaseManager.js +19 -11
  11. package/lib/cjs/BriefcaseManager.js.map +1 -1
  12. package/lib/cjs/Category.d.ts +0 -6
  13. package/lib/cjs/Category.d.ts.map +1 -1
  14. package/lib/cjs/Category.js +0 -6
  15. package/lib/cjs/Category.js.map +1 -1
  16. package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
  17. package/lib/cjs/ChangeSummaryManager.js +13 -11
  18. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  19. package/lib/cjs/ChangedElementsDb.d.ts.map +1 -1
  20. package/lib/cjs/ChangedElementsDb.js +5 -3
  21. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  22. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  23. package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
  24. package/lib/cjs/ChangesetECAdaptor.js +242 -237
  25. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  26. package/lib/cjs/ChannelControl.d.ts +4 -26
  27. package/lib/cjs/ChannelControl.d.ts.map +1 -1
  28. package/lib/cjs/ChannelControl.js +2 -101
  29. package/lib/cjs/ChannelControl.js.map +1 -1
  30. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  31. package/lib/cjs/CheckpointManager.js +5 -3
  32. package/lib/cjs/CheckpointManager.js.map +1 -1
  33. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  34. package/lib/cjs/ClassRegistry.js +8 -7
  35. package/lib/cjs/ClassRegistry.js.map +1 -1
  36. package/lib/cjs/CloudSqlite.d.ts +1 -1
  37. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  38. package/lib/cjs/CloudSqlite.js +2 -2
  39. package/lib/cjs/CloudSqlite.js.map +1 -1
  40. package/lib/cjs/CodeService.js.map +1 -1
  41. package/lib/cjs/CodeSpecs.js.map +1 -1
  42. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  43. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  44. package/lib/cjs/DevTools.d.ts.map +1 -1
  45. package/lib/cjs/DevTools.js +2 -1
  46. package/lib/cjs/DevTools.js.map +1 -1
  47. package/lib/cjs/DisplayStyle.d.ts +0 -3
  48. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  49. package/lib/cjs/DisplayStyle.js +0 -3
  50. package/lib/cjs/DisplayStyle.js.map +1 -1
  51. package/lib/cjs/ECDb.d.ts +6 -1
  52. package/lib/cjs/ECDb.d.ts.map +1 -1
  53. package/lib/cjs/ECDb.js +19 -14
  54. package/lib/cjs/ECDb.js.map +1 -1
  55. package/lib/cjs/ECSchemaXmlContext.js +2 -2
  56. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  57. package/lib/cjs/ECSqlStatement.d.ts +6 -3
  58. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  59. package/lib/cjs/ECSqlStatement.js +3 -3
  60. package/lib/cjs/ECSqlStatement.js.map +1 -1
  61. package/lib/cjs/Element.d.ts +2 -59
  62. package/lib/cjs/Element.d.ts.map +1 -1
  63. package/lib/cjs/Element.js +7 -63
  64. package/lib/cjs/Element.js.map +1 -1
  65. package/lib/cjs/ElementAspect.d.ts +0 -5
  66. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  67. package/lib/cjs/ElementAspect.js +4 -8
  68. package/lib/cjs/ElementAspect.js.map +1 -1
  69. package/lib/cjs/ElementGraphics.d.ts.map +1 -1
  70. package/lib/cjs/ElementGraphics.js +2 -1
  71. package/lib/cjs/ElementGraphics.js.map +1 -1
  72. package/lib/cjs/ElementTreeWalker.d.ts +19 -0
  73. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  74. package/lib/cjs/ElementTreeWalker.js +23 -9
  75. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  76. package/lib/cjs/Entity.js.map +1 -1
  77. package/lib/cjs/EntityReferences.js.map +1 -1
  78. package/lib/cjs/ExportGraphics.js.map +1 -1
  79. package/lib/cjs/ExternalSource.js.map +1 -1
  80. package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
  81. package/lib/cjs/GeoCoordConfig.js +2 -1
  82. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  83. package/lib/cjs/GeographicCRSServices.js +2 -2
  84. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  85. package/lib/cjs/GeometrySummary.d.ts.map +1 -1
  86. package/lib/cjs/GeometrySummary.js +49 -48
  87. package/lib/cjs/GeometrySummary.js.map +1 -1
  88. package/lib/cjs/HubMock.js.map +1 -1
  89. package/lib/cjs/IModelCloneContext.js.map +1 -1
  90. package/lib/cjs/IModelDb.d.ts +24 -94
  91. package/lib/cjs/IModelDb.d.ts.map +1 -1
  92. package/lib/cjs/IModelDb.js +196 -151
  93. package/lib/cjs/IModelDb.js.map +1 -1
  94. package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
  95. package/lib/cjs/IModelElementCloneContext.js +5 -4
  96. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  97. package/lib/cjs/IModelHost.d.ts +5 -3
  98. package/lib/cjs/IModelHost.d.ts.map +1 -1
  99. package/lib/cjs/IModelHost.js +16 -18
  100. package/lib/cjs/IModelHost.js.map +1 -1
  101. package/lib/cjs/IModelJsFs.js.map +1 -1
  102. package/lib/cjs/IpcHost.d.ts.map +1 -1
  103. package/lib/cjs/IpcHost.js +15 -13
  104. package/lib/cjs/IpcHost.js.map +1 -1
  105. package/lib/cjs/LineStyle.js.map +1 -1
  106. package/lib/cjs/LocalHub.d.ts +2 -2
  107. package/lib/cjs/LocalHub.d.ts.map +1 -1
  108. package/lib/cjs/LocalHub.js +18 -18
  109. package/lib/cjs/LocalHub.js.map +1 -1
  110. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  111. package/lib/cjs/LockControl.d.ts +73 -0
  112. package/lib/cjs/LockControl.d.ts.map +1 -0
  113. package/lib/cjs/LockControl.js +11 -0
  114. package/lib/cjs/LockControl.js.map +1 -0
  115. package/lib/cjs/Material.d.ts +2 -5
  116. package/lib/cjs/Material.d.ts.map +1 -1
  117. package/lib/cjs/Material.js +1 -4
  118. package/lib/cjs/Material.js.map +1 -1
  119. package/lib/cjs/Model.d.ts +0 -22
  120. package/lib/cjs/Model.d.ts.map +1 -1
  121. package/lib/cjs/Model.js +5 -26
  122. package/lib/cjs/Model.js.map +1 -1
  123. package/lib/cjs/NativeAppStorage.js.map +1 -1
  124. package/lib/cjs/NativeHost.js.map +1 -1
  125. package/lib/cjs/NavigationRelationship.js.map +1 -1
  126. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  127. package/lib/cjs/PropertyStore.js.map +1 -1
  128. package/lib/cjs/Relationship.d.ts +0 -12
  129. package/lib/cjs/Relationship.d.ts.map +1 -1
  130. package/lib/cjs/Relationship.js +5 -16
  131. package/lib/cjs/Relationship.js.map +1 -1
  132. package/lib/cjs/RpcBackend.js.map +1 -1
  133. package/lib/cjs/SQLiteDb.d.ts +6 -1
  134. package/lib/cjs/SQLiteDb.d.ts.map +1 -1
  135. package/lib/cjs/SQLiteDb.js +23 -16
  136. package/lib/cjs/SQLiteDb.js.map +1 -1
  137. package/lib/cjs/Schema.js.map +1 -1
  138. package/lib/cjs/SchemaSync.d.ts +3 -0
  139. package/lib/cjs/SchemaSync.d.ts.map +1 -1
  140. package/lib/cjs/SchemaSync.js +24 -11
  141. package/lib/cjs/SchemaSync.js.map +1 -1
  142. package/lib/cjs/SchemaUtils.js +3 -3
  143. package/lib/cjs/SchemaUtils.js.map +1 -1
  144. package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
  145. package/lib/cjs/SqliteChangesetReader.js +2 -2
  146. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  147. package/lib/cjs/SqliteStatement.js +2 -2
  148. package/lib/cjs/SqliteStatement.js.map +1 -1
  149. package/lib/cjs/TextAnnotationElement.js.map +1 -1
  150. package/lib/cjs/TextAnnotationGeometry.js.map +1 -1
  151. package/lib/cjs/TextAnnotationLayout.js.map +1 -1
  152. package/lib/cjs/Texture.js.map +1 -1
  153. package/lib/cjs/TileStorage.js.map +1 -1
  154. package/lib/cjs/TxnManager.d.ts +2 -1
  155. package/lib/cjs/TxnManager.d.ts.map +1 -1
  156. package/lib/cjs/TxnManager.js +4 -2
  157. package/lib/cjs/TxnManager.js.map +1 -1
  158. package/lib/cjs/ViewDefinition.d.ts +1 -18
  159. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  160. package/lib/cjs/ViewDefinition.js +1 -18
  161. package/lib/cjs/ViewDefinition.js.map +1 -1
  162. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  163. package/lib/cjs/ViewStore.d.ts.map +1 -1
  164. package/lib/cjs/ViewStore.js +6 -5
  165. package/lib/cjs/ViewStore.js.map +1 -1
  166. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  167. package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
  168. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
  169. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
  170. package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
  171. package/lib/cjs/core-backend.d.ts +2 -1
  172. package/lib/cjs/core-backend.d.ts.map +1 -1
  173. package/lib/cjs/core-backend.js +3 -5
  174. package/lib/cjs/core-backend.js.map +1 -1
  175. package/lib/cjs/domains/FunctionalElements.d.ts +0 -10
  176. package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
  177. package/lib/cjs/domains/FunctionalElements.js +0 -10
  178. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  179. package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -1
  180. package/lib/cjs/domains/FunctionalSchema.js +2 -1
  181. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  182. package/lib/cjs/domains/GenericElements.d.ts +0 -18
  183. package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
  184. package/lib/cjs/domains/GenericElements.js +0 -18
  185. package/lib/cjs/domains/GenericElements.js.map +1 -1
  186. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  187. package/lib/cjs/internal/ChangesetConflictArgs.d.ts +24 -0
  188. package/lib/cjs/internal/ChangesetConflictArgs.d.ts.map +1 -0
  189. package/lib/cjs/internal/ChangesetConflictArgs.js +7 -0
  190. package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -0
  191. package/lib/cjs/internal/ChannelAdmin.d.ts +34 -0
  192. package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -0
  193. package/lib/cjs/internal/ChannelAdmin.js +117 -0
  194. package/lib/cjs/internal/ChannelAdmin.js.map +1 -0
  195. package/lib/cjs/internal/NativePlatform.d.ts +15 -0
  196. package/lib/cjs/internal/NativePlatform.d.ts.map +1 -0
  197. package/lib/cjs/internal/NativePlatform.js +49 -0
  198. package/lib/cjs/internal/NativePlatform.js.map +1 -0
  199. package/lib/cjs/internal/NoLocks.d.ts +6 -0
  200. package/lib/cjs/internal/NoLocks.d.ts.map +1 -0
  201. package/lib/cjs/internal/NoLocks.js +31 -0
  202. package/lib/cjs/internal/NoLocks.js.map +1 -0
  203. package/lib/cjs/{ServerBasedLocks.d.ts → internal/ServerBasedLocks.d.ts} +10 -16
  204. package/lib/cjs/internal/ServerBasedLocks.d.ts.map +1 -0
  205. package/lib/cjs/{ServerBasedLocks.js → internal/ServerBasedLocks.js} +29 -18
  206. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -0
  207. package/lib/cjs/internal/Symbols.d.ts +11 -0
  208. package/lib/cjs/internal/Symbols.d.ts.map +1 -0
  209. package/lib/cjs/internal/Symbols.js +21 -0
  210. package/lib/cjs/internal/Symbols.js.map +1 -0
  211. package/lib/cjs/internal/cross-package.d.ts +4 -0
  212. package/lib/cjs/internal/cross-package.d.ts.map +1 -0
  213. package/lib/cjs/internal/cross-package.js +16 -0
  214. package/lib/cjs/internal/cross-package.js.map +1 -0
  215. package/lib/cjs/internal/workspace/SettingsImpl.d.ts +2 -2
  216. package/lib/cjs/internal/workspace/SettingsImpl.d.ts.map +1 -1
  217. package/lib/cjs/internal/workspace/SettingsImpl.js +3 -3
  218. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
  219. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +2 -2
  220. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  221. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  222. package/lib/cjs/internal/workspace/WorkspaceImpl.js +31 -27
  223. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  224. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.d.ts.map +1 -1
  225. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js +2 -1
  226. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  227. package/lib/cjs/rpc/multipart.js.map +1 -1
  228. package/lib/cjs/rpc/tracing.d.ts.map +1 -1
  229. package/lib/cjs/rpc/tracing.js +5 -2
  230. package/lib/cjs/rpc/tracing.js.map +1 -1
  231. package/lib/cjs/rpc/web/logging.js.map +1 -1
  232. package/lib/cjs/rpc/web/request.js.map +1 -1
  233. package/lib/cjs/rpc/web/response.js.map +1 -1
  234. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  235. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +1 -0
  236. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  237. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +9 -4
  238. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  239. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  240. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +5 -3
  241. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  242. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  243. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  244. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  245. package/lib/cjs/workspace/Settings.d.ts +3 -3
  246. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  247. package/lib/cjs/workspace/Settings.js +1 -1
  248. package/lib/cjs/workspace/Settings.js.map +1 -1
  249. package/lib/cjs/workspace/SettingsSchemas.d.ts +2 -2
  250. package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
  251. package/lib/cjs/workspace/SettingsSchemas.js +1 -1
  252. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  253. package/lib/cjs/workspace/Workspace.d.ts +4 -4
  254. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  255. package/lib/cjs/workspace/Workspace.js +1 -1
  256. package/lib/cjs/workspace/Workspace.js.map +1 -1
  257. package/lib/cjs/workspace/WorkspaceEditor.d.ts +2 -2
  258. package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -1
  259. package/lib/cjs/workspace/WorkspaceEditor.js +1 -1
  260. package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
  261. package/package.json +13 -13
  262. package/lib/cjs/ServerBasedLocks.d.ts.map +0 -1
  263. package/lib/cjs/ServerBasedLocks.js.map +0 -1
  264. package/lib/cjs/internal/ImplementationProhibited.d.ts +0 -44
  265. package/lib/cjs/internal/ImplementationProhibited.d.ts.map +0 -1
  266. package/lib/cjs/internal/ImplementationProhibited.js +0 -51
  267. package/lib/cjs/internal/ImplementationProhibited.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"GenericElements.js","sourceRoot":"","sources":["../../../src/domains/GenericElements.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAG4B;AAC5B,wCAGoB;AAEpB,0CAA+C;AAC/C,oCAAmE;AACnE,sEAAyE;AAEzE;;GAEG;AACH,MAAsB,eAAgB,SAAQ,4BAAkB;IAC9D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAC5E,YAAmB,KAA8B,EAAE,MAAgB;QACjE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,0CAMC;AAED;;GAEG;AACH,MAAa,SAAU,SAAQ,eAAe;IAC5C,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,WAAW,CAAC,CAAC,CAAC;IACtE,YAAmB,KAA8B,EAAE,MAAgB;QACjE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,8BAMC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,eAAe;IACtD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAChF,YAAmB,KAA+B,EAAE,MAAgB;QAClE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,kDAMC;AAED;;GAEG;AACH,MAAsB,OAAQ,SAAQ,eAAe;IACnD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IACpE,YAAmB,KAAmB,EAAE,MAAgB;QACtD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;I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AAE,MAAgB;QACtD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,0CAMC;AAED;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,2BAAgB;IAC3D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,kBAAkB,CAAC,CAAC,CAAC;IAC7E,YAAmB,KAA6B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,0DAMC;AAED;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,sBAAY;IACnD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,cAAc,CAAC,CAAC,CAAC;IACzE,YAAmB,KAAwB,EAAE,MAAgB;QAC3D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,kDAMC;AAED;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,yBAAe;IACzD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAC5E,YAAmB,KAAiC,EAAE,MAAgB;QACpE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,wDAMC","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 Elements\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport {\n CalloutProps, DefinitionElementProps, ElementProps, GeometricElement2dProps, GeometricElement3dProps, GeometricModel3dProps, IModel,\n InformationPartitionElementProps, ModelProps, PhysicalElementProps, PhysicalTypeProps, TypeDefinitionElementProps, ViewAttachmentLabelProps,\n} from \"@itwin/core-common\";\nimport {\n Document, GraphicalElement2d, GraphicalElement3d, GraphicalPartition3d, GraphicalType2d, GroupInformationElement, GroupInformationPartition,\n PhysicalElement, PhysicalType, SpatialLocationElement,\n} from \"../Element\";\nimport { IModelDb } from \"../IModelDb\";\nimport { PhysicalMaterial } from \"../Material\";\nimport { GraphicalModel3d, GroupInformationModel } from \"../Model\";\nimport { SubjectOwnsPartitionElements } from \"../NavigationRelationship\";\n\n/** A graphical detailing symbol that is placed on a [[Drawing]] or [[Sheet]].\n * @public\n */\nexport abstract class DetailingSymbol extends GraphicalElement2d {\n /** @internal */\n public static override get className(): string { return \"DetailingSymbol\"; }\n public constructor(props: GeometricElement2dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical DetailingSymbol that contains title text.\n * @public\n */\nexport class TitleText extends DetailingSymbol {\n /** @internal */\n public static override get className(): string { return \"TitleText\"; }\n public constructor(props: GeometricElement2dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical DetailingSymbol that contains a view attachment label.\n * @public\n */\nexport class ViewAttachmentLabel extends DetailingSymbol {\n /** @internal */\n public static override get className(): string { return \"ViewAttachmentLabel\"; }\n public constructor(props: ViewAttachmentLabelProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical DetailingSymbol that calls out a reference to another drawing.\n * @public\n */\nexport abstract class Callout extends DetailingSymbol {\n /** @internal */\n public static override get className(): string { return \"Callout\"; }\n public constructor(props: CalloutProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical Callout that references a section drawing.\n * @public\n */\nexport class SectionCallout extends Callout {\n /** @internal */\n public static override get className(): string { return \"SectionCallout\"; }\n public constructor(props: CalloutProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical Callout that references an elevation drawing.\n * @public\n */\nexport class ElevationCallout extends Callout {\n /** @internal */\n public static override get className(): string { return \"ElevationCallout\"; }\n public constructor(props: CalloutProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical Callout that references a plan drawing.\n * @public\n */\nexport class PlanCallout extends Callout {\n /** @internal */\n public static override get className(): string { return \"PlanCallout\"; }\n public constructor(props: CalloutProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical Callout that references a detail drawing.\n * @public\n */\nexport class DetailCallout extends Callout {\n /** @internal */\n public static override get className(): string { return \"DetailCallout\"; }\n public constructor(props: CalloutProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A generic container for persisting BisCore:GraphicalElement3d instances.\n * @public\n */\nexport class GenericGraphicalModel3d extends GraphicalModel3d {\n /** @internal */\n public static override get className(): string { return \"GraphicalModel3d\"; }\n public constructor(props: GeometricModel3dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n /** Insert a BisCore:GraphicalPartition3d and a Generic:GraphicalModel3d that sub-models it.\n * @param iModelDb Insert into this iModel\n * @param parentSubjectId The GraphicalPartition3d will be inserted as a child of this Subject element.\n * @param name The name of the GraphicalPartition3d that the new Generic:GraphicalModel3d will sub-model.\n * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.\n * @returns The Id of the newly inserted GraphicalPartition3d and GraphicalModel3d (same value).\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String {\n const partitionProps: InformationPartitionElementProps = {\n classFullName: GraphicalPartition3d.classFullName,\n model: IModel.repositoryModelId,\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\n code: GraphicalPartition3d.createCode(iModelDb, parentSubjectId, name),\n };\n const partitionId = iModelDb.elements.insertElement(partitionProps);\n const modelProps: GeometricModel3dProps = {\n classFullName: this.classFullName,\n modeledElement: { id: partitionId },\n isPlanProjection,\n };\n return iModelDb.models.insertModel(modelProps);\n }\n}\n\n/** The Generic:Graphic3d class is used when 3D graphics cannot be further classified.\n * @note More-specific BisCore:GraphicalElement3d subclasses should be used wherever possible.\n * @public\n */\nexport class Graphic3d extends GraphicalElement3d {\n /** @internal */\n public static override get className(): string { return \"Graphic3d\"; }\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:PhysicalObject class is used when physical elements cannot be further classified.\n * @note More-specific BisCore:PhysicalElement subclasses should be used wherever possible.\n * @public\n */\nexport class PhysicalObject extends PhysicalElement {\n /** @internal */\n public static override get className(): string { return \"PhysicalObject\"; }\n public constructor(props: PhysicalElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:SpatialLocation class is used when spatial locations cannot be further classified.\n * @note More-specific BisCore:SpatialLocationElement subclasses should be used wherever possible.\n * @public\n */\nexport class SpatialLocation extends SpatialLocationElement {\n /** @internal */\n public static override get className(): string { return \"SpatialLocation\"; }\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A generic container for BisCore:GroupInformationElement instances.\n * @public\n */\nexport class GroupModel extends GroupInformationModel {\n /** @internal */\n public static override get className(): string { return \"GroupModel\"; }\n public constructor(props: ModelProps, iModel: IModelDb) {\n super(props, iModel);\n }\n /** Insert a GroupInformationPartition and a GroupModel that breaks it down.\n * @param iModelDb Insert into this iModel\n * @param parentSubjectId The GroupInformationPartition will be inserted as a child of this Subject element.\n * @param name The name of the GroupInformationPartition that the new GroupModel will break down.\n * @returns The Id of the newly inserted GroupModel.\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\n const partitionProps: InformationPartitionElementProps = {\n classFullName: GroupInformationPartition.classFullName,\n model: IModel.repositoryModelId,\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\n code: GroupInformationPartition.createCode(iModelDb, parentSubjectId, name),\n };\n const partitionId = iModelDb.elements.insertElement(partitionProps);\n return iModelDb.models.insertModel({\n classFullName: this.classFullName,\n modeledElement: { id: partitionId },\n });\n }\n}\n\n/** The Generic:Group class is used when the group cannot be further classified.\n * @public\n */\nexport class Group extends GroupInformationElement {\n /** @internal */\n public static override get className(): string { return \"Group\"; }\n public constructor(props: ElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:Document class is used when a document cannot be further classified.\n * @note More-specific BisCore:Document subclasses should be used wherever possible.\n * @public\n */\nexport class GenericDocument extends Document {\n /** @internal */\n public static override get className(): string { return \"Document\"; }\n public constructor(props: ElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:PhysicalMaterial class is used when the physical material cannot be further classified.\n * @note More-specific BisCore:PhysicalMaterial subclasses should be used wherever possible.\n * @public\n */\nexport class GenericPhysicalMaterial extends PhysicalMaterial {\n /** @internal */\n public static override get className(): string { return \"PhysicalMaterial\"; }\n public constructor(props: DefinitionElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:PhysicalType class is used when the physical type cannot be further classified.\n * @note More-specific BisCore:PhysicalType subclasses should be used wherever possible.\n * @public\n */\nexport class GenericPhysicalType extends PhysicalType {\n /** @internal */\n public static override get className(): string { return \"PhysicalType\"; }\n public constructor(props: PhysicalTypeProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:GraphicalType2d class is used when graphical types cannot be further classified.\n * @note More-specific BisCore:GraphicalType2d subclasses should be used wherever possible.\n * @public\n */\nexport class GenericGraphicalType2d extends GraphicalType2d {\n /** @internal */\n public static override get className(): string { return \"GraphicalType2d\"; }\n public constructor(props: TypeDefinitionElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n"]}
1
+ {"version":3,"file":"GenericElements.js","sourceRoot":"","sources":["../../../src/domains/GenericElements.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAG4B;AAC5B,wCAGoB;AAEpB,0CAA+C;AAC/C,oCAAmE;AACnE,sEAAyE;AAEzE;;GAEG;AACH,MAAsB,eAAgB,SAAQ,4BAAkB;IACvD,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAC5E,YAAmB,KAA8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AE,MAAgB;QACpE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AALD,wDAKC","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 Elements\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n CalloutProps, DefinitionElementProps, ElementProps, GeometricElement2dProps, GeometricElement3dProps, GeometricModel3dProps, IModel,\r\n InformationPartitionElementProps, ModelProps, PhysicalElementProps, PhysicalTypeProps, TypeDefinitionElementProps, ViewAttachmentLabelProps,\r\n} from \"@itwin/core-common\";\r\nimport {\r\n Document, GraphicalElement2d, GraphicalElement3d, GraphicalPartition3d, GraphicalType2d, GroupInformationElement, GroupInformationPartition,\r\n PhysicalElement, PhysicalType, SpatialLocationElement,\r\n} from \"../Element\";\r\nimport { IModelDb } from \"../IModelDb\";\r\nimport { PhysicalMaterial } from \"../Material\";\r\nimport { GraphicalModel3d, GroupInformationModel } from \"../Model\";\r\nimport { SubjectOwnsPartitionElements } from \"../NavigationRelationship\";\r\n\r\n/** A graphical detailing symbol that is placed on a [[Drawing]] or [[Sheet]].\r\n * @public\r\n */\r\nexport abstract class DetailingSymbol extends GraphicalElement2d {\r\n public static override get className(): string { return \"DetailingSymbol\"; }\r\n public constructor(props: GeometricElement2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical DetailingSymbol that contains title text.\r\n * @public\r\n */\r\nexport class TitleText extends DetailingSymbol {\r\n public static override get className(): string { return \"TitleText\"; }\r\n public constructor(props: GeometricElement2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical DetailingSymbol that contains a view attachment label.\r\n * @public\r\n */\r\nexport class ViewAttachmentLabel extends DetailingSymbol {\r\n public static override get className(): string { return \"ViewAttachmentLabel\"; }\r\n public constructor(props: ViewAttachmentLabelProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical DetailingSymbol that calls out a reference to another drawing.\r\n * @public\r\n */\r\nexport abstract class Callout extends DetailingSymbol {\r\n public static override get className(): string { return \"Callout\"; }\r\n public constructor(props: CalloutProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical Callout that references a section drawing.\r\n * @public\r\n */\r\nexport class SectionCallout extends Callout {\r\n public static override get className(): string { return \"SectionCallout\"; }\r\n public constructor(props: CalloutProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical Callout that references an elevation drawing.\r\n * @public\r\n */\r\nexport class ElevationCallout extends Callout {\r\n public static override get className(): string { return \"ElevationCallout\"; }\r\n public constructor(props: CalloutProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical Callout that references a plan drawing.\r\n * @public\r\n */\r\nexport class PlanCallout extends Callout {\r\n public static override get className(): string { return \"PlanCallout\"; }\r\n public constructor(props: CalloutProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical Callout that references a detail drawing.\r\n * @public\r\n */\r\nexport class DetailCallout extends Callout {\r\n public static override get className(): string { return \"DetailCallout\"; }\r\n public constructor(props: CalloutProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A generic container for persisting BisCore:GraphicalElement3d instances.\r\n * @public\r\n */\r\nexport class GenericGraphicalModel3d extends GraphicalModel3d {\r\n public static override get className(): string { return \"GraphicalModel3d\"; }\r\n public constructor(props: GeometricModel3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n /** Insert a BisCore:GraphicalPartition3d and a Generic:GraphicalModel3d that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The GraphicalPartition3d will be inserted as a child of this Subject element.\r\n * @param name The name of the GraphicalPartition3d that the new Generic:GraphicalModel3d will sub-model.\r\n * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.\r\n * @returns The Id of the newly inserted GraphicalPartition3d and GraphicalModel3d (same value).\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: GraphicalPartition3d.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: GraphicalPartition3d.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId = iModelDb.elements.insertElement(partitionProps);\r\n const modelProps: GeometricModel3dProps = {\r\n classFullName: this.classFullName,\r\n modeledElement: { id: partitionId },\r\n isPlanProjection,\r\n };\r\n return iModelDb.models.insertModel(modelProps);\r\n }\r\n}\r\n\r\n/** The Generic:Graphic3d class is used when 3D graphics cannot be further classified.\r\n * @note More-specific BisCore:GraphicalElement3d subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class Graphic3d extends GraphicalElement3d {\r\n public static override get className(): string { return \"Graphic3d\"; }\r\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:PhysicalObject class is used when physical elements cannot be further classified.\r\n * @note More-specific BisCore:PhysicalElement subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class PhysicalObject extends PhysicalElement {\r\n public static override get className(): string { return \"PhysicalObject\"; }\r\n public constructor(props: PhysicalElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:SpatialLocation class is used when spatial locations cannot be further classified.\r\n * @note More-specific BisCore:SpatialLocationElement subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class SpatialLocation extends SpatialLocationElement {\r\n public static override get className(): string { return \"SpatialLocation\"; }\r\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A generic container for BisCore:GroupInformationElement instances.\r\n * @public\r\n */\r\nexport class GroupModel extends GroupInformationModel {\r\n public static override get className(): string { return \"GroupModel\"; }\r\n public constructor(props: ModelProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n /** Insert a GroupInformationPartition and a GroupModel that breaks it down.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The GroupInformationPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the GroupInformationPartition that the new GroupModel will break down.\r\n * @returns The Id of the newly inserted GroupModel.\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: GroupInformationPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: GroupInformationPartition.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId = iModelDb.elements.insertElement(partitionProps);\r\n return iModelDb.models.insertModel({\r\n classFullName: this.classFullName,\r\n modeledElement: { id: partitionId },\r\n });\r\n }\r\n}\r\n\r\n/** The Generic:Group class is used when the group cannot be further classified.\r\n * @public\r\n */\r\nexport class Group extends GroupInformationElement {\r\n public static override get className(): string { return \"Group\"; }\r\n public constructor(props: ElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:Document class is used when a document cannot be further classified.\r\n * @note More-specific BisCore:Document subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class GenericDocument extends Document {\r\n public static override get className(): string { return \"Document\"; }\r\n public constructor(props: ElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:PhysicalMaterial class is used when the physical material cannot be further classified.\r\n * @note More-specific BisCore:PhysicalMaterial subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class GenericPhysicalMaterial extends PhysicalMaterial {\r\n public static override get className(): string { return \"PhysicalMaterial\"; }\r\n public constructor(props: DefinitionElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:PhysicalType class is used when the physical type cannot be further classified.\r\n * @note More-specific BisCore:PhysicalType subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class GenericPhysicalType extends PhysicalType {\r\n public static override get className(): string { return \"PhysicalType\"; }\r\n public constructor(props: PhysicalTypeProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:GraphicalType2d class is used when graphical types cannot be further classified.\r\n * @note More-specific BisCore:GraphicalType2d subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class GenericGraphicalType2d extends GraphicalType2d {\r\n public static override get className(): string { return \"GraphicalType2d\"; }\r\n public constructor(props: TypeDefinitionElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GenericSchema.js","sourceRoot":"","sources":["../../../src/domains/GenericSchema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6BAA6B;AAC7B,oDAAiD;AACjD,8CAA+C;AAC/C,sCAA4C;AAC5C,oDAAoD;AAEpD,cAAc;AACd,MAAa,aAAc,SAAQ,eAAM;IAChC,MAAM,KAAc,UAAU,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IAC9D,MAAM,KAAK,cAAc,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,2BAAc,CAAC,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,UAAU,eAAe,CAAC,CAAC,CAAC,CAAC;IACzJ,MAAM,CAAC,cAAc;QAC1B,IAAI,IAAI,KAAK,gBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC1D,gBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC1C,gBAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC7B,6BAAa,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;CACF;AAVD,sCAUC","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 Schema\n */\n\nimport * as path from \"path\";\nimport { ClassRegistry } from \"../ClassRegistry\";\nimport { KnownLocations } from \"../IModelHost\";\nimport { Schema, Schemas } from \"../Schema\";\nimport * as elementsModule from \"./GenericElements\";\n\n/** @public */\nexport class GenericSchema extends Schema {\n public static override get schemaName(): string { return \"Generic\"; }\n public static get schemaFilePath(): string { return path.join(KnownLocations.nativeAssetsDir, \"ECSchemas\", \"Dgn\", `${GenericSchema.schemaName}.ecschema.xml`); }\n public static registerSchema() {\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\n Schemas.unregisterSchema(this.schemaName);\n Schemas.registerSchema(this);\n ClassRegistry.registerModule(elementsModule, this);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"GenericSchema.js","sourceRoot":"","sources":["../../../src/domains/GenericSchema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6BAA6B;AAC7B,oDAAiD;AACjD,8CAA+C;AAC/C,sCAA4C;AAC5C,oDAAoD;AAEpD,cAAc;AACd,MAAa,aAAc,SAAQ,eAAM;IAChC,MAAM,KAAc,UAAU,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IAC9D,MAAM,KAAK,cAAc,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,2BAAc,CAAC,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,UAAU,eAAe,CAAC,CAAC,CAAC,CAAC;IACzJ,MAAM,CAAC,cAAc;QAC1B,IAAI,IAAI,KAAK,gBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC1D,gBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC1C,gBAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC7B,6BAAa,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;CACF;AAVD,sCAUC","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 Schema\r\n */\r\n\r\nimport * as path from \"path\";\r\nimport { ClassRegistry } from \"../ClassRegistry\";\r\nimport { KnownLocations } from \"../IModelHost\";\r\nimport { Schema, Schemas } from \"../Schema\";\r\nimport * as elementsModule from \"./GenericElements\";\r\n\r\n/** @public */\r\nexport class GenericSchema extends Schema {\r\n public static override get schemaName(): string { return \"Generic\"; }\r\n public static get schemaFilePath(): string { return path.join(KnownLocations.nativeAssetsDir, \"ECSchemas\", \"Dgn\", `${GenericSchema.schemaName}.ecschema.xml`); }\r\n public static registerSchema() {\r\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\r\n Schemas.unregisterSchema(this.schemaName);\r\n Schemas.registerSchema(this);\r\n ClassRegistry.registerModule(elementsModule, this);\r\n }\r\n }\r\n}\r\n"]}
@@ -0,0 +1,24 @@
1
+ /** @packageDocumentation
2
+ * @module iModels
3
+ */
4
+ import { DbChangeStage, DbConflictCause, DbOpcode, DbValueType, Id64String } from "@itwin/core-bentley";
5
+ export interface ChangesetConflictArgs {
6
+ cause: DbConflictCause;
7
+ opcode: DbOpcode;
8
+ indirect: boolean;
9
+ tableName: string;
10
+ changesetFile?: string;
11
+ columnCount: number;
12
+ getForeignKeyConflicts: () => number;
13
+ dump: () => void;
14
+ setLastError: (message: string) => void;
15
+ getPrimaryKeyColumns: () => number[];
16
+ getValueType: (columnIndex: number, stage: DbChangeStage) => DbValueType | null | undefined;
17
+ getValueBinary: (columnIndex: number, stage: DbChangeStage) => Uint8Array | null | undefined;
18
+ getValueId: (columnIndex: number, stage: DbChangeStage) => Id64String | null | undefined;
19
+ getValueText: (columnIndex: number, stage: DbChangeStage) => string | null | undefined;
20
+ getValueInteger: (columnIndex: number, stage: DbChangeStage) => number | null | undefined;
21
+ getValueDouble: (columnIndex: number, stage: DbChangeStage) => number | null | undefined;
22
+ isValueNull: (columnIndex: number, stage: DbChangeStage) => boolean | undefined;
23
+ }
24
+ //# sourceMappingURL=ChangesetConflictArgs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangesetConflictArgs.d.ts","sourceRoot":"","sources":["../../../src/internal/ChangesetConflictArgs.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAExG,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,EAAE,MAAM,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,oBAAoB,EAAE,MAAM,MAAM,EAAE,CAAC;IACrC,YAAY,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5F,cAAc,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7F,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IACzF,YAAY,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvF,eAAe,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1F,cAAc,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzF,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,OAAO,GAAG,SAAS,CAAC;CACjF"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=ChangesetConflictArgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangesetConflictArgs.js","sourceRoot":"","sources":["../../../src/internal/ChangesetConflictArgs.ts"],"names":[],"mappings":";AAAA;;;+FAG+F","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { DbChangeStage, DbConflictCause, DbOpcode, DbValueType, Id64String } from \"@itwin/core-bentley\";\r\n\r\nexport interface ChangesetConflictArgs {\r\n cause: DbConflictCause;\r\n opcode: DbOpcode;\r\n indirect: boolean;\r\n tableName: string;\r\n changesetFile?: string;\r\n columnCount: number;\r\n getForeignKeyConflicts: () => number;\r\n dump: () => void;\r\n setLastError: (message: string) => void;\r\n getPrimaryKeyColumns: () => number[];\r\n getValueType: (columnIndex: number, stage: DbChangeStage) => DbValueType | null | undefined;\r\n getValueBinary: (columnIndex: number, stage: DbChangeStage) => Uint8Array | null | undefined;\r\n getValueId: (columnIndex: number, stage: DbChangeStage) => Id64String | null | undefined;\r\n getValueText: (columnIndex: number, stage: DbChangeStage) => string | null | undefined;\r\n getValueInteger: (columnIndex: number, stage: DbChangeStage) => number | null | undefined;\r\n getValueDouble: (columnIndex: number, stage: DbChangeStage) => number | null | undefined;\r\n isValueNull: (columnIndex: number, stage: DbChangeStage) => boolean | undefined;\r\n}\r\n\r\n"]}
@@ -0,0 +1,34 @@
1
+ /** @packageDocumentation
2
+ * @module Elements
3
+ */
4
+ import { Id64String } from "@itwin/core-bentley";
5
+ import { IModelDb } from "../IModelDb";
6
+ import { ChannelControl, ChannelKey } from "../ChannelControl";
7
+ import { _implementationProhibited, _verifyChannel } from "./Symbols";
8
+ declare class ChannelAdmin implements ChannelControl {
9
+ private _iModel;
10
+ static readonly channelClassName = "bis:ChannelRootAspect";
11
+ readonly [_implementationProhibited]: undefined;
12
+ private _allowedChannels;
13
+ private _allowedModels;
14
+ private _deniedModels;
15
+ constructor(_iModel: IModelDb);
16
+ addAllowedChannel(channelKey: ChannelKey): void;
17
+ removeAllowedChannel(channelKey: ChannelKey): void;
18
+ getChannelKey(elementId: Id64String): ChannelKey;
19
+ [_verifyChannel](modelId: Id64String): void;
20
+ makeChannelRoot(args: {
21
+ elementId: Id64String;
22
+ channelKey: ChannelKey;
23
+ }): void;
24
+ insertChannelSubject(args: {
25
+ subjectName: string;
26
+ channelKey: ChannelKey;
27
+ parentSubjectId?: Id64String;
28
+ description?: string;
29
+ }): Id64String;
30
+ queryChannelRoot(channelKey: ChannelKey): Id64String | undefined;
31
+ }
32
+ export declare function createChannelControl(iModel: IModelDb): ChannelAdmin;
33
+ export {};
34
+ //# sourceMappingURL=ChannelAdmin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChannelAdmin.d.ts","sourceRoot":"","sources":["../../../src/internal/ChannelAdmin.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAY,UAAU,EAAgB,MAAM,qBAAqB,CAAC;AAGzE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAa,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjF,cAAM,YAAa,YAAW,cAAc;IAQvB,OAAO,CAAC,OAAO;IAPlC,gBAAuB,gBAAgB,2BAA2B;IAElE,SAAgB,CAAC,yBAAyB,CAAC,YAAa;IACxD,OAAO,CAAC,gBAAgB,CAAyB;IACjD,OAAO,CAAC,cAAc,CAAyB;IAC/C,OAAO,CAAC,aAAa,CAAqC;gBAE/B,OAAO,EAAE,QAAQ;IAMrC,iBAAiB,CAAC,UAAU,EAAE,UAAU;IAKxC,oBAAoB,CAAC,UAAU,EAAE,UAAU;IAK3C,aAAa,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IA4BhD,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;IAmB3C,eAAe,CAAC,IAAI,EAAE;QAAE,SAAS,EAAE,UAAU,CAAC;QAAC,UAAU,EAAE,UAAU,CAAA;KAAE;IAWvE,oBAAoB,CAAC,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,UAAU,CAAC;QAAC,eAAe,CAAC,EAAE,UAAU,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,UAAU;IAY3I,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS;CAmBxE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,GAAG,YAAY,CAEnE"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Elements
8
+ */
9
+ var _a;
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.createChannelControl = void 0;
12
+ const core_bentley_1 = require("@itwin/core-bentley");
13
+ const core_common_1 = require("@itwin/core-common");
14
+ const Element_1 = require("../Element");
15
+ const IModelHost_1 = require("../IModelHost");
16
+ const ChannelControl_1 = require("../ChannelControl");
17
+ const Symbols_1 = require("./Symbols");
18
+ class ChannelAdmin {
19
+ constructor(_iModel) {
20
+ this._iModel = _iModel;
21
+ this[_a] = undefined;
22
+ this._allowedChannels = new Set();
23
+ this._allowedModels = new Set();
24
+ this._deniedModels = new Map();
25
+ // for backwards compatibility, allow the shared channel unless explicitly turned off in IModelHostOptions.
26
+ if (IModelHost_1.IModelHost.configuration?.allowSharedChannel !== false)
27
+ this._allowedChannels.add(ChannelControl_1.ChannelControl.sharedChannelName);
28
+ }
29
+ addAllowedChannel(channelKey) {
30
+ this._allowedChannels.add(channelKey);
31
+ this._deniedModels.clear();
32
+ }
33
+ removeAllowedChannel(channelKey) {
34
+ this._allowedChannels.delete(channelKey);
35
+ this._allowedModels.clear();
36
+ }
37
+ getChannelKey(elementId) {
38
+ if (elementId === core_common_1.IModel.rootSubjectId)
39
+ return ChannelControl_1.ChannelControl.sharedChannelName;
40
+ try {
41
+ const channel = this._iModel.withPreparedStatement(`SELECT Owner FROM ${ChannelAdmin.channelClassName} WHERE Element.Id=?`, (stmt) => {
42
+ stmt.bindId(1, elementId);
43
+ return core_bentley_1.DbResult.BE_SQLITE_ROW === stmt.step() ? stmt.getValue(0).getString() : undefined;
44
+ });
45
+ if (channel !== undefined)
46
+ return channel;
47
+ }
48
+ catch {
49
+ // Exception happens if the iModel is too old: ChannelRootAspect class not present in the BisCore schema (older than v1.0.10).
50
+ // In that case all data in such iModel is assumed to be in the shared channel.
51
+ return ChannelControl_1.ChannelControl.sharedChannelName;
52
+ }
53
+ const parentId = this._iModel.withPreparedSqliteStatement("SELECT ParentId,ModelId FROM bis_Element WHERE id=?", (stmt) => {
54
+ stmt.bindId(1, elementId);
55
+ if (core_bentley_1.DbResult.BE_SQLITE_ROW !== stmt.step())
56
+ throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, "Element does not exist");
57
+ return stmt.getValueId(0) ?? stmt.getValueId(1); // if parent is undefined, use modelId
58
+ });
59
+ return this.getChannelKey(parentId);
60
+ }
61
+ [(_a = Symbols_1._implementationProhibited, Symbols_1._verifyChannel)](modelId) {
62
+ // Note: indirect changes are permitted to change any channel
63
+ if (this._allowedModels.has(modelId) || this._iModel[Symbols_1._nativeDb].isIndirectChanges())
64
+ return;
65
+ const deniedChannel = this._deniedModels.get(modelId);
66
+ if (undefined !== deniedChannel)
67
+ throw new Error(`channel "${deniedChannel}" is not allowed`);
68
+ const channel = this.getChannelKey(modelId);
69
+ if (this._allowedChannels.has(channel)) {
70
+ this._allowedModels.add(modelId);
71
+ return;
72
+ }
73
+ this._deniedModels.set(modelId, channel);
74
+ return this[Symbols_1._verifyChannel](modelId);
75
+ }
76
+ makeChannelRoot(args) {
77
+ if (ChannelControl_1.ChannelControl.sharedChannelName !== this.getChannelKey(args.elementId))
78
+ throw new Error("channels may not nest");
79
+ if (this.queryChannelRoot(args.channelKey) !== undefined)
80
+ throw new Error("a channel root for the specified key already exists");
81
+ const props = { classFullName: ChannelAdmin.channelClassName, element: { id: args.elementId }, owner: args.channelKey };
82
+ this._iModel.elements.insertAspect(props);
83
+ }
84
+ insertChannelSubject(args) {
85
+ // Check if channelKey already exists before inserting Subject.
86
+ // makeChannelRoot will check that again, but at that point the new Subject is already inserted.
87
+ // Prefer to check twice instead of deleting the Subject in the latter option.
88
+ if (this.queryChannelRoot(args.channelKey) !== undefined)
89
+ throw new Error("a channel root for the specified key already exists");
90
+ const elementId = Element_1.Subject.insert(this._iModel, args.parentSubjectId ?? core_common_1.IModel.rootSubjectId, args.subjectName, args.description);
91
+ this.makeChannelRoot({ elementId, channelKey: args.channelKey });
92
+ return elementId;
93
+ }
94
+ queryChannelRoot(channelKey) {
95
+ if (channelKey === ChannelControl_1.ChannelControl.sharedChannelName)
96
+ // RootSubject acts as the ChannelRoot element of the shared channel
97
+ return core_common_1.IModel.rootSubjectId;
98
+ try {
99
+ const channelRoot = this._iModel.withPreparedStatement(`SELECT Element.Id FROM ${ChannelAdmin.channelClassName} WHERE Owner=?`, (stmt) => {
100
+ stmt.bindString(1, channelKey);
101
+ return core_bentley_1.DbResult.BE_SQLITE_ROW === stmt.step() ? stmt.getValue(0).getId() : undefined;
102
+ });
103
+ return channelRoot;
104
+ }
105
+ catch {
106
+ // Exception happens if the iModel is too old: ChannelRootAspect class not present in the BisCore schema (older than v1.0.10).
107
+ // In that case all data in such iModel is assumed to be in the shared channel.
108
+ return undefined;
109
+ }
110
+ }
111
+ }
112
+ ChannelAdmin.channelClassName = "bis:ChannelRootAspect";
113
+ function createChannelControl(iModel) {
114
+ return new ChannelAdmin(iModel);
115
+ }
116
+ exports.createChannelControl = createChannelControl;
117
+ //# sourceMappingURL=ChannelAdmin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChannelAdmin.js","sourceRoot":"","sources":["../../../src/internal/ChannelAdmin.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;AAEH,sDAAyE;AACzE,oDAAiF;AACjF,wCAAqC;AAErC,8CAA2C;AAC3C,sDAA+D;AAC/D,uCAAiF;AAEjF,MAAM,YAAY;IAQhB,YA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AAsB;QAC5C,IAAI,UAAU,KAAK,+BAAc,CAAC,iBAAiB;YACjD,oEAAoE;YACpE,OAAO,oBAAM,CAAC,aAAa,CAAC;QAE9B,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,0BAA0B,YAAY,CAAC,gBAAgB,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE;gBACvI,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;gBAC/B,OAAO,uBAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YACvF,CAAC,CAAC,CAAC;YAEH,OAAO,WAAW,CAAC;QACrB,CAAC;QAAC,MAAM,CAAC;YACP,8HAA8H;YAC9H,+EAA+E;YAC/E,OAAO,SAAS,CAAC;QACnB,CAAC;IAEH,CAAC;;AA/GsB,6BAAgB,GAAG,uBAAuB,AAA1B,CAA2B;AAkHpE,SAAgB,oBAAoB,CAAC,MAAgB;IACnD,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAFD,oDAEC","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 Elements\r\n */\r\n\r\nimport { DbResult, Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { ChannelRootAspectProps, IModel, IModelError } from \"@itwin/core-common\";\r\nimport { Subject } from \"../Element\";\r\nimport { IModelDb } from \"../IModelDb\";\r\nimport { IModelHost } from \"../IModelHost\";\r\nimport { ChannelControl, ChannelKey } from \"../ChannelControl\";\r\nimport { _implementationProhibited, _nativeDb, _verifyChannel } from \"./Symbols\";\r\n\r\nclass ChannelAdmin implements ChannelControl {\r\n public static readonly channelClassName = \"bis:ChannelRootAspect\";\r\n\r\n public readonly [_implementationProhibited] = undefined;\r\n private _allowedChannels = new Set<ChannelKey>();\r\n private _allowedModels = new Set<Id64String>();\r\n private _deniedModels = new Map<Id64String, ChannelKey>();\r\n\r\n public constructor(private _iModel: IModelDb) {\r\n // for backwards compatibility, allow the shared channel unless explicitly turned off in IModelHostOptions.\r\n if (IModelHost.configuration?.allowSharedChannel !== false)\r\n this._allowedChannels.add(ChannelControl.sharedChannelName);\r\n }\r\n\r\n public addAllowedChannel(channelKey: ChannelKey) {\r\n this._allowedChannels.add(channelKey);\r\n this._deniedModels.clear();\r\n }\r\n\r\n public removeAllowedChannel(channelKey: ChannelKey) {\r\n this._allowedChannels.delete(channelKey);\r\n this._allowedModels.clear();\r\n }\r\n\r\n public getChannelKey(elementId: Id64String): ChannelKey {\r\n if (elementId === IModel.rootSubjectId)\r\n return ChannelControl.sharedChannelName;\r\n\r\n try {\r\n const channel = this._iModel.withPreparedStatement(`SELECT Owner FROM ${ChannelAdmin.channelClassName} WHERE Element.Id=?`, (stmt) => {\r\n stmt.bindId(1, elementId);\r\n return DbResult.BE_SQLITE_ROW === stmt.step() ? stmt.getValue(0).getString() : undefined;\r\n });\r\n\r\n if (channel !== undefined)\r\n return channel;\r\n } catch {\r\n // Exception happens if the iModel is too old: ChannelRootAspect class not present in the BisCore schema (older than v1.0.10).\r\n // In that case all data in such iModel is assumed to be in the shared channel.\r\n return ChannelControl.sharedChannelName;\r\n }\r\n\r\n const parentId = this._iModel.withPreparedSqliteStatement(\"SELECT ParentId,ModelId FROM bis_Element WHERE id=?\", (stmt) => {\r\n stmt.bindId(1, elementId);\r\n if (DbResult.BE_SQLITE_ROW !== stmt.step())\r\n throw new IModelError(IModelStatus.NotFound, \"Element does not exist\");\r\n return stmt.getValueId(0) ?? stmt.getValueId(1); // if parent is undefined, use modelId\r\n });\r\n\r\n return this.getChannelKey(parentId);\r\n }\r\n\r\n public [_verifyChannel](modelId: Id64String): void {\r\n // Note: indirect changes are permitted to change any channel\r\n if (this._allowedModels.has(modelId) || this._iModel[_nativeDb].isIndirectChanges())\r\n return;\r\n\r\n const deniedChannel = this._deniedModels.get(modelId);\r\n if (undefined !== deniedChannel)\r\n throw new Error(`channel \"${deniedChannel}\" is not allowed`);\r\n\r\n const channel = this.getChannelKey(modelId);\r\n if (this._allowedChannels.has(channel)) {\r\n this._allowedModels.add(modelId);\r\n return;\r\n }\r\n\r\n this._deniedModels.set(modelId, channel);\r\n return this[_verifyChannel](modelId);\r\n }\r\n\r\n public makeChannelRoot(args: { elementId: Id64String, channelKey: ChannelKey }) {\r\n if (ChannelControl.sharedChannelName !== this.getChannelKey(args.elementId))\r\n throw new Error(\"channels may not nest\");\r\n\r\n if (this.queryChannelRoot(args.channelKey) !== undefined)\r\n throw new Error(\"a channel root for the specified key already exists\");\r\n\r\n const props: ChannelRootAspectProps = { classFullName: ChannelAdmin.channelClassName, element: { id: args.elementId }, owner: args.channelKey };\r\n this._iModel.elements.insertAspect(props);\r\n }\r\n\r\n public insertChannelSubject(args: { subjectName: string, channelKey: ChannelKey, parentSubjectId?: Id64String, description?: string }): Id64String {\r\n // Check if channelKey already exists before inserting Subject.\r\n // makeChannelRoot will check that again, but at that point the new Subject is already inserted.\r\n // Prefer to check twice instead of deleting the Subject in the latter option.\r\n if (this.queryChannelRoot(args.channelKey) !== undefined)\r\n throw new Error(\"a channel root for the specified key already exists\");\r\n\r\n const elementId = Subject.insert(this._iModel, args.parentSubjectId ?? IModel.rootSubjectId, args.subjectName, args.description);\r\n this.makeChannelRoot({ elementId, channelKey: args.channelKey });\r\n return elementId;\r\n }\r\n\r\n public queryChannelRoot(channelKey: ChannelKey): Id64String | undefined {\r\n if (channelKey === ChannelControl.sharedChannelName)\r\n // RootSubject acts as the ChannelRoot element of the shared channel\r\n return IModel.rootSubjectId;\r\n\r\n try {\r\n const channelRoot = this._iModel.withPreparedStatement(`SELECT Element.Id FROM ${ChannelAdmin.channelClassName} WHERE Owner=?`, (stmt) => {\r\n stmt.bindString(1, channelKey);\r\n return DbResult.BE_SQLITE_ROW === stmt.step() ? stmt.getValue(0).getId() : undefined;\r\n });\r\n\r\n return channelRoot;\r\n } catch {\r\n // Exception happens if the iModel is too old: ChannelRootAspect class not present in the BisCore schema (older than v1.0.10).\r\n // In that case all data in such iModel is assumed to be in the shared channel.\r\n return undefined;\r\n }\r\n\r\n }\r\n}\r\n\r\nexport function createChannelControl(iModel: IModelDb): ChannelAdmin {\r\n return new ChannelAdmin(iModel);\r\n}\r\n"]}
@@ -0,0 +1,15 @@
1
+ /** @packageDocumentation
2
+ * @module IModelHost
3
+ */
4
+ import { IModelJsNative } from "@bentley/imodeljs-native";
5
+ /** Provides access to the internal APIs defined in @bentley/imodeljs-native.
6
+ * @internal
7
+ */
8
+ export declare class IModelNative {
9
+ static get platform(): typeof IModelJsNative;
10
+ }
11
+ /** @internal Strictly to be called by IModelHost.startup. */
12
+ export declare function loadNativePlatform(): void;
13
+ /** @internal Strictly for tests. */
14
+ export declare function overrideSyncNativeLogLevels(func?: () => void): void;
15
+ //# sourceMappingURL=NativePlatform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativePlatform.d.ts","sourceRoot":"","sources":["../../../src/internal/NativePlatform.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAezE;;GAEG;AACH,qBAAa,YAAY;IACvB,WAAkB,QAAQ,IAAI,OAAO,cAAc,CAMlD;CACF;AAED,6DAA6D;AAC7D,wBAAgB,kBAAkB,IAAI,IAAI,CAMzC;AAED,oCAAoC;AACpC,wBAAgB,2BAA2B,CAAC,IAAI,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAEnE"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module IModelHost
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.overrideSyncNativeLogLevels = exports.loadNativePlatform = exports.IModelNative = void 0;
11
+ const imodeljs_native_1 = require("@bentley/imodeljs-native");
12
+ const core_bentley_1 = require("@itwin/core-bentley");
13
+ let nativePlatform;
14
+ let syncNativeLogLevelsOverride;
15
+ function syncNativeLogLevels() {
16
+ if (syncNativeLogLevelsOverride) {
17
+ syncNativeLogLevelsOverride();
18
+ }
19
+ else {
20
+ nativePlatform?.clearLogLevelCache();
21
+ }
22
+ }
23
+ /** Provides access to the internal APIs defined in @bentley/imodeljs-native.
24
+ * @internal
25
+ */
26
+ class IModelNative {
27
+ static get platform() {
28
+ if (undefined === nativePlatform) {
29
+ throw new Error("IModelHost.startup must be called first");
30
+ }
31
+ return nativePlatform;
32
+ }
33
+ }
34
+ exports.IModelNative = IModelNative;
35
+ /** @internal Strictly to be called by IModelHost.startup. */
36
+ function loadNativePlatform() {
37
+ if (undefined === nativePlatform) {
38
+ nativePlatform = core_bentley_1.ProcessDetector.isMobileAppBackend ? process._linkedBinding("iModelJsNative") : imodeljs_native_1.NativeLibrary.load();
39
+ nativePlatform.logger = core_bentley_1.Logger;
40
+ core_bentley_1.Logger.onLogLevelChanged.addListener(() => syncNativeLogLevels());
41
+ }
42
+ }
43
+ exports.loadNativePlatform = loadNativePlatform;
44
+ /** @internal Strictly for tests. */
45
+ function overrideSyncNativeLogLevels(func) {
46
+ syncNativeLogLevelsOverride = func;
47
+ }
48
+ exports.overrideSyncNativeLogLevels = overrideSyncNativeLogLevels;
49
+ //# sourceMappingURL=NativePlatform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativePlatform.js","sourceRoot":"","sources":["../../../src/internal/NativePlatform.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,8DAAyE;AACzE,sDAA8D;AAE9D,IAAI,cAAiD,CAAC;AAEtD,IAAI,2BAAqD,CAAC;AAE1D,SAAS,mBAAmB;IAC1B,IAAI,2BAA2B,EAAE,CAAC;QAChC,2BAA2B,EAAE,CAAC;IAChC,CAAC;SAAM,CAAC;QACN,cAAc,EAAE,kBAAkB,EAAE,CAAC;IACvC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAa,YAAY;IAChB,MAAM,KAAK,QAAQ;QACxB,IAAI,SAAS,KAAK,cAAc,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AARD,oCAQC;AAED,6DAA6D;AAC7D,SAAgB,kBAAkB;IAChC,IAAI,SAAS,KAAK,cAAc,EAAE,CAAC;QACjC,cAAc,GAAG,8BAAe,CAAC,kBAAkB,CAAC,CAAC,CAAE,OAAe,CAAC,cAAc,CAAC,gBAAgB,CAA0B,CAAC,CAAC,CAAC,+BAAa,CAAC,IAAI,EAAE,CAAC;QACxJ,cAAc,CAAC,MAAM,GAAG,qBAAM,CAAC;QAC/B,qBAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,mBAAmB,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAND,gDAMC;AAED,oCAAoC;AACpC,SAAgB,2BAA2B,CAAC,IAAiB;IAC3D,2BAA2B,GAAG,IAAI,CAAC;AACrC,CAAC;AAFD,kEAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module IModelHost\r\n */\r\n\r\nimport { IModelJsNative, NativeLibrary } from \"@bentley/imodeljs-native\";\r\nimport { Logger, ProcessDetector } from \"@itwin/core-bentley\";\r\n\r\nlet nativePlatform: typeof IModelJsNative | undefined;\r\n\r\nlet syncNativeLogLevelsOverride: (() => void) | undefined;\r\n\r\nfunction syncNativeLogLevels() {\r\n if (syncNativeLogLevelsOverride) {\r\n syncNativeLogLevelsOverride();\r\n } else {\r\n nativePlatform?.clearLogLevelCache();\r\n }\r\n}\r\n\r\n/** Provides access to the internal APIs defined in @bentley/imodeljs-native.\r\n * @internal\r\n */\r\nexport class IModelNative {\r\n public static get platform(): typeof IModelJsNative {\r\n if (undefined === nativePlatform) {\r\n throw new Error(\"IModelHost.startup must be called first\");\r\n }\r\n\r\n return nativePlatform;\r\n }\r\n}\r\n\r\n/** @internal Strictly to be called by IModelHost.startup. */\r\nexport function loadNativePlatform(): void {\r\n if (undefined === nativePlatform) {\r\n nativePlatform = ProcessDetector.isMobileAppBackend ? (process as any)._linkedBinding(\"iModelJsNative\") as typeof IModelJsNative : NativeLibrary.load();\r\n nativePlatform.logger = Logger;\r\n Logger.onLogLevelChanged.addListener(() => syncNativeLogLevels());\r\n }\r\n}\r\n\r\n/** @internal Strictly for tests. */\r\nexport function overrideSyncNativeLogLevels(func?: () => void): void {\r\n syncNativeLogLevelsOverride = func;\r\n}\r\n"]}
@@ -0,0 +1,6 @@
1
+ /** @packageDocumentation
2
+ * @module iModels
3
+ */
4
+ import { LockControl } from "../LockControl";
5
+ export declare function createNoOpLockControl(): LockControl;
6
+ //# sourceMappingURL=NoLocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoLocks.d.ts","sourceRoot":"","sources":["../../../src/internal/NoLocks.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAmB7C,wBAAgB,qBAAqB,IAAI,WAAW,CAEnD"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ var _a;
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.createNoOpLockControl = void 0;
9
+ const Symbols_1 = require("./Symbols");
10
+ /** A null-implementation of LockControl that does not attempt to limit access between briefcases. This relies on change-merging to resolve conflicts. */
11
+ class NoLocks {
12
+ constructor() {
13
+ this[_a] = undefined;
14
+ }
15
+ get isServerBased() { return false; }
16
+ [(_a = Symbols_1._implementationProhibited, Symbols_1._close)]() { }
17
+ clearAllLocks() { }
18
+ holdsExclusiveLock() { return false; }
19
+ holdsSharedLock() { return false; }
20
+ checkExclusiveLock() { }
21
+ checkSharedLock() { }
22
+ [Symbols_1._elementWasCreated]() { }
23
+ async acquireLocks() { }
24
+ async [Symbols_1._releaseAllLocks]() { }
25
+ async releaseAllLocks() { }
26
+ }
27
+ function createNoOpLockControl() {
28
+ return new NoLocks();
29
+ }
30
+ exports.createNoOpLockControl = createNoOpLockControl;
31
+ //# sourceMappingURL=NoLocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoLocks.js","sourceRoot":"","sources":["../../../src/internal/NoLocks.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;AAO/F,uCAAoG;AAEpG,yJAAyJ;AACzJ,MAAM,OAAO;IAAb;QACkB,QAA2B,GAAG,SAAS,CAAC;IAY1D,CAAC;IAXC,IAAW,aAAa,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC;IACrC,OAFU,mCAAyB,EAElC,gBAAM,EAAC,KAAW,CAAC;IACpB,aAAa,KAAW,CAAC;IACzB,kBAAkB,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IAC/C,eAAe,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IAC5C,kBAAkB,KAAW,CAAC;IAC9B,eAAe,KAAW,CAAC;IAC3B,CAAC,4BAAkB,CAAC,KAAW,CAAC;IAChC,KAAK,CAAC,YAAY,KAAK,CAAC;IACxB,KAAK,CAAC,CAAC,0BAAgB,CAAC,KAAoB,CAAC;IAC7C,KAAK,CAAC,eAAe,KAAoB,CAAC;CAClD;AAED,SAAgB,qBAAqB;IACnC,OAAO,IAAI,OAAO,EAAE,CAAC;AACvB,CAAC;AAFD,sDAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { LockControl } from \"../LockControl\";\r\nimport { _close, _elementWasCreated, _implementationProhibited, _releaseAllLocks } from \"./Symbols\";\r\n\r\n/** A null-implementation of LockControl that does not attempt to limit access between briefcases. This relies on change-merging to resolve conflicts. */\r\nclass NoLocks implements LockControl {\r\n public readonly [_implementationProhibited] = undefined;\r\n public get isServerBased() { return false; }\r\n public [_close](): void { }\r\n public clearAllLocks(): void { }\r\n public holdsExclusiveLock(): boolean { return false; }\r\n public holdsSharedLock(): boolean { return false; }\r\n public checkExclusiveLock(): void { }\r\n public checkSharedLock(): void { }\r\n public [_elementWasCreated](): void { }\r\n public async acquireLocks() { }\r\n public async [_releaseAllLocks](): Promise<void> { }\r\n public async releaseAllLocks(): Promise<void> { }\r\n}\r\n\r\nexport function createNoOpLockControl(): LockControl {\r\n return new NoLocks();\r\n}\r\n"]}
@@ -2,26 +2,18 @@
2
2
  * @module iModels
3
3
  */
4
4
  import { Id64Arg, Id64String } from "@itwin/core-bentley";
5
- import { LockState } from "./BackendHubAccess";
6
- import { BriefcaseDb, LockControl } from "./IModelDb";
7
- import { SQLiteDb } from "./SQLiteDb";
8
- /**
9
- * Both the Model and Parent of an element are considered "owners" of their member elements. That means:
10
- * 1) they must hold at least a shared lock before an exclusive lock can be acquired for their members
11
- * 2) if they hold an exclusive lock, then all of their members are exclusively locked implicitly.
12
- * @internal
13
- */
14
- export interface ElementOwners {
15
- readonly modelId: Id64String;
16
- readonly parentId: Id64String | undefined;
17
- }
18
- /** @internal */
5
+ import { LockState } from "@itwin/core-common";
6
+ import { BriefcaseDb } from "../IModelDb";
7
+ import { LockControl } from "../LockControl";
8
+ import { SQLiteDb } from "../SQLiteDb";
9
+ import { _close, _elementWasCreated, _implementationProhibited, _releaseAllLocks } from "./Symbols";
19
10
  export declare class ServerBasedLocks implements LockControl {
11
+ readonly [_implementationProhibited]: undefined;
20
12
  get isServerBased(): boolean;
21
13
  protected readonly lockDb: SQLiteDb;
22
14
  protected readonly briefcase: BriefcaseDb;
23
15
  constructor(iModel: BriefcaseDb);
24
- close(): void;
16
+ [_close](): void;
25
17
  private getOwners;
26
18
  private getLockState;
27
19
  /** Clear the cache of locally held locks.
@@ -30,6 +22,7 @@ export declare class ServerBasedLocks implements LockControl {
30
22
  private clearAllLocks;
31
23
  /** only for tests */
32
24
  getLockCount(state: LockState): number;
25
+ [_releaseAllLocks](): Promise<void>;
33
26
  releaseAllLocks(): Promise<void>;
34
27
  private insertLock;
35
28
  private ownerHoldsExclusiveLock;
@@ -47,7 +40,7 @@ export declare class ServerBasedLocks implements LockControl {
47
40
  exclusive?: Id64Arg;
48
41
  }): Promise<void>;
49
42
  /** When an element is newly created in a session, we hold the lock on it implicitly. Save that fact. */
50
- elementWasCreated(id: Id64String): void;
43
+ [_elementWasCreated](id: Id64String): void;
51
44
  /** locks are not necessary during change propagation. */
52
45
  private get _locksAreRequired();
53
46
  /** throw if locks are currently required and the exclusive lock is not held on the supplied element */
@@ -55,4 +48,5 @@ export declare class ServerBasedLocks implements LockControl {
55
48
  /** throw if locks are currently required and a shared lock is not held on the supplied element */
56
49
  checkSharedLock(id: Id64String, type: string, operation: string): void;
57
50
  }
51
+ export declare function createServerBasedLocks(iModel: BriefcaseDb): LockControl;
58
52
  //# sourceMappingURL=ServerBasedLocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerBasedLocks.d.ts","sourceRoot":"","sources":["../../../src/internal/ServerBasedLocks.ts"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