@itwin/core-backend 4.8.0-dev.4 → 4.8.0-dev.41

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 +62 -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/BriefcaseManager.d.ts.map +1 -1
  7. package/lib/cjs/BriefcaseManager.js +19 -11
  8. package/lib/cjs/BriefcaseManager.js.map +1 -1
  9. package/lib/cjs/Category.d.ts +0 -6
  10. package/lib/cjs/Category.d.ts.map +1 -1
  11. package/lib/cjs/Category.js +0 -6
  12. package/lib/cjs/Category.js.map +1 -1
  13. package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
  14. package/lib/cjs/ChangeSummaryManager.js +11 -9
  15. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  16. package/lib/cjs/ChangedElementsDb.d.ts +1 -0
  17. package/lib/cjs/ChangedElementsDb.d.ts.map +1 -1
  18. package/lib/cjs/ChangedElementsDb.js +6 -4
  19. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  20. package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
  21. package/lib/cjs/ChangesetECAdaptor.js +26 -21
  22. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  23. package/lib/cjs/ChannelControl.d.ts +4 -26
  24. package/lib/cjs/ChannelControl.d.ts.map +1 -1
  25. package/lib/cjs/ChannelControl.js +2 -101
  26. package/lib/cjs/ChannelControl.js.map +1 -1
  27. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  28. package/lib/cjs/CheckpointManager.js +5 -3
  29. package/lib/cjs/CheckpointManager.js.map +1 -1
  30. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  31. package/lib/cjs/ClassRegistry.js +3 -2
  32. package/lib/cjs/ClassRegistry.js.map +1 -1
  33. package/lib/cjs/CloudSqlite.d.ts +28 -11
  34. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  35. package/lib/cjs/CloudSqlite.js +42 -1
  36. package/lib/cjs/CloudSqlite.js.map +1 -1
  37. package/lib/cjs/DevTools.d.ts.map +1 -1
  38. package/lib/cjs/DevTools.js +2 -1
  39. package/lib/cjs/DevTools.js.map +1 -1
  40. package/lib/cjs/DisplayStyle.d.ts +0 -3
  41. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  42. package/lib/cjs/DisplayStyle.js +0 -3
  43. package/lib/cjs/DisplayStyle.js.map +1 -1
  44. package/lib/cjs/ECDb.d.ts +6 -1
  45. package/lib/cjs/ECDb.d.ts.map +1 -1
  46. package/lib/cjs/ECDb.js +19 -14
  47. package/lib/cjs/ECDb.js.map +1 -1
  48. package/lib/cjs/ECSchemaXmlContext.js +2 -2
  49. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  50. package/lib/cjs/ECSqlStatement.d.ts +6 -3
  51. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  52. package/lib/cjs/ECSqlStatement.js +3 -3
  53. package/lib/cjs/ECSqlStatement.js.map +1 -1
  54. package/lib/cjs/Element.d.ts +3 -60
  55. package/lib/cjs/Element.d.ts.map +1 -1
  56. package/lib/cjs/Element.js +8 -64
  57. package/lib/cjs/Element.js.map +1 -1
  58. package/lib/cjs/ElementAspect.d.ts +0 -5
  59. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  60. package/lib/cjs/ElementAspect.js +4 -8
  61. package/lib/cjs/ElementAspect.js.map +1 -1
  62. package/lib/cjs/ElementGraphics.d.ts.map +1 -1
  63. package/lib/cjs/ElementGraphics.js +2 -1
  64. package/lib/cjs/ElementGraphics.js.map +1 -1
  65. package/lib/cjs/ElementTreeWalker.d.ts +19 -0
  66. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  67. package/lib/cjs/ElementTreeWalker.js +23 -9
  68. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  69. package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
  70. package/lib/cjs/GeoCoordConfig.js +2 -1
  71. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  72. package/lib/cjs/GeographicCRSServices.js +2 -2
  73. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  74. package/lib/cjs/GeometrySummary.d.ts.map +1 -1
  75. package/lib/cjs/GeometrySummary.js +2 -1
  76. package/lib/cjs/GeometrySummary.js.map +1 -1
  77. package/lib/cjs/IModelDb.d.ts +25 -95
  78. package/lib/cjs/IModelDb.d.ts.map +1 -1
  79. package/lib/cjs/IModelDb.js +192 -142
  80. package/lib/cjs/IModelDb.js.map +1 -1
  81. package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
  82. package/lib/cjs/IModelElementCloneContext.js +5 -4
  83. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  84. package/lib/cjs/IModelHost.d.ts +5 -3
  85. package/lib/cjs/IModelHost.d.ts.map +1 -1
  86. package/lib/cjs/IModelHost.js +16 -18
  87. package/lib/cjs/IModelHost.js.map +1 -1
  88. package/lib/cjs/IpcHost.d.ts.map +1 -1
  89. package/lib/cjs/IpcHost.js +15 -13
  90. package/lib/cjs/IpcHost.js.map +1 -1
  91. package/lib/cjs/LocalHub.d.ts +2 -2
  92. package/lib/cjs/LocalHub.d.ts.map +1 -1
  93. package/lib/cjs/LocalHub.js +17 -17
  94. package/lib/cjs/LocalHub.js.map +1 -1
  95. package/lib/cjs/LockControl.d.ts +73 -0
  96. package/lib/cjs/LockControl.d.ts.map +1 -0
  97. package/lib/cjs/LockControl.js +11 -0
  98. package/lib/cjs/LockControl.js.map +1 -0
  99. package/lib/cjs/Material.d.ts +2 -5
  100. package/lib/cjs/Material.d.ts.map +1 -1
  101. package/lib/cjs/Material.js +6 -4
  102. package/lib/cjs/Material.js.map +1 -1
  103. package/lib/cjs/Model.d.ts +0 -22
  104. package/lib/cjs/Model.d.ts.map +1 -1
  105. package/lib/cjs/Model.js +5 -26
  106. package/lib/cjs/Model.js.map +1 -1
  107. package/lib/cjs/Relationship.d.ts +0 -12
  108. package/lib/cjs/Relationship.d.ts.map +1 -1
  109. package/lib/cjs/Relationship.js +5 -16
  110. package/lib/cjs/Relationship.js.map +1 -1
  111. package/lib/cjs/SQLiteDb.d.ts +6 -1
  112. package/lib/cjs/SQLiteDb.d.ts.map +1 -1
  113. package/lib/cjs/SQLiteDb.js +23 -16
  114. package/lib/cjs/SQLiteDb.js.map +1 -1
  115. package/lib/cjs/SchemaSync.d.ts +3 -0
  116. package/lib/cjs/SchemaSync.d.ts.map +1 -1
  117. package/lib/cjs/SchemaSync.js +24 -11
  118. package/lib/cjs/SchemaSync.js.map +1 -1
  119. package/lib/cjs/SchemaUtils.js +3 -3
  120. package/lib/cjs/SchemaUtils.js.map +1 -1
  121. package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
  122. package/lib/cjs/SqliteChangesetReader.js +2 -2
  123. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  124. package/lib/cjs/SqliteStatement.js +2 -2
  125. package/lib/cjs/SqliteStatement.js.map +1 -1
  126. package/lib/cjs/TextAnnotationGeometry.d.ts +1 -1
  127. package/lib/cjs/TextAnnotationGeometry.d.ts.map +1 -1
  128. package/lib/cjs/TextAnnotationGeometry.js +9 -5
  129. package/lib/cjs/TextAnnotationGeometry.js.map +1 -1
  130. package/lib/cjs/TextAnnotationLayout.d.ts.map +1 -1
  131. package/lib/cjs/TextAnnotationLayout.js +18 -5
  132. package/lib/cjs/TextAnnotationLayout.js.map +1 -1
  133. package/lib/cjs/TxnManager.d.ts +2 -1
  134. package/lib/cjs/TxnManager.d.ts.map +1 -1
  135. package/lib/cjs/TxnManager.js +4 -2
  136. package/lib/cjs/TxnManager.js.map +1 -1
  137. package/lib/cjs/ViewDefinition.d.ts +1 -18
  138. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  139. package/lib/cjs/ViewDefinition.js +1 -18
  140. package/lib/cjs/ViewDefinition.js.map +1 -1
  141. package/lib/cjs/ViewStore.d.ts.map +1 -1
  142. package/lib/cjs/ViewStore.js +6 -5
  143. package/lib/cjs/ViewStore.js.map +1 -1
  144. package/lib/cjs/core-backend.d.ts +2 -1
  145. package/lib/cjs/core-backend.d.ts.map +1 -1
  146. package/lib/cjs/core-backend.js +3 -5
  147. package/lib/cjs/core-backend.js.map +1 -1
  148. package/lib/cjs/domains/FunctionalElements.d.ts +0 -10
  149. package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
  150. package/lib/cjs/domains/FunctionalElements.js +0 -10
  151. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  152. package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -1
  153. package/lib/cjs/domains/FunctionalSchema.js +2 -1
  154. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  155. package/lib/cjs/domains/GenericElements.d.ts +0 -18
  156. package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
  157. package/lib/cjs/domains/GenericElements.js +0 -18
  158. package/lib/cjs/domains/GenericElements.js.map +1 -1
  159. package/lib/cjs/internal/ChangesetConflictArgs.d.ts +24 -0
  160. package/lib/cjs/internal/ChangesetConflictArgs.d.ts.map +1 -0
  161. package/lib/cjs/internal/ChangesetConflictArgs.js +7 -0
  162. package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -0
  163. package/lib/cjs/internal/ChannelAdmin.d.ts +34 -0
  164. package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -0
  165. package/lib/cjs/internal/ChannelAdmin.js +117 -0
  166. package/lib/cjs/internal/ChannelAdmin.js.map +1 -0
  167. package/lib/cjs/internal/NativePlatform.d.ts +15 -0
  168. package/lib/cjs/internal/NativePlatform.d.ts.map +1 -0
  169. package/lib/cjs/internal/NativePlatform.js +49 -0
  170. package/lib/cjs/internal/NativePlatform.js.map +1 -0
  171. package/lib/cjs/internal/NoLocks.d.ts +6 -0
  172. package/lib/cjs/internal/NoLocks.d.ts.map +1 -0
  173. package/lib/cjs/internal/NoLocks.js +31 -0
  174. package/lib/cjs/internal/NoLocks.js.map +1 -0
  175. package/lib/cjs/{ServerBasedLocks.d.ts → internal/ServerBasedLocks.d.ts} +10 -16
  176. package/lib/cjs/internal/ServerBasedLocks.d.ts.map +1 -0
  177. package/lib/cjs/{ServerBasedLocks.js → internal/ServerBasedLocks.js} +29 -18
  178. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -0
  179. package/lib/cjs/internal/Symbols.d.ts +11 -0
  180. package/lib/cjs/internal/Symbols.d.ts.map +1 -0
  181. package/lib/cjs/internal/Symbols.js +21 -0
  182. package/lib/cjs/internal/Symbols.js.map +1 -0
  183. package/lib/cjs/internal/cross-package.d.ts +4 -0
  184. package/lib/cjs/internal/cross-package.d.ts.map +1 -0
  185. package/lib/cjs/internal/cross-package.js +16 -0
  186. package/lib/cjs/internal/cross-package.js.map +1 -0
  187. package/lib/cjs/internal/workspace/SettingsImpl.d.ts +2 -2
  188. package/lib/cjs/internal/workspace/SettingsImpl.d.ts.map +1 -1
  189. package/lib/cjs/internal/workspace/SettingsImpl.js +3 -3
  190. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
  191. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +2 -2
  192. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  193. package/lib/cjs/internal/workspace/WorkspaceImpl.js +14 -14
  194. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  195. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.d.ts.map +1 -1
  196. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js +2 -1
  197. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  198. package/lib/cjs/rpc/tracing.d.ts.map +1 -1
  199. package/lib/cjs/rpc/tracing.js +5 -2
  200. package/lib/cjs/rpc/tracing.js.map +1 -1
  201. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +1 -0
  202. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  203. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +9 -4
  204. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  205. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  206. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +5 -3
  207. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  208. package/lib/cjs/workspace/Settings.d.ts +3 -3
  209. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  210. package/lib/cjs/workspace/Settings.js +1 -1
  211. package/lib/cjs/workspace/Settings.js.map +1 -1
  212. package/lib/cjs/workspace/SettingsSchemas.d.ts +2 -2
  213. package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
  214. package/lib/cjs/workspace/SettingsSchemas.js +1 -1
  215. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  216. package/lib/cjs/workspace/Workspace.d.ts +4 -4
  217. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  218. package/lib/cjs/workspace/Workspace.js +1 -1
  219. package/lib/cjs/workspace/Workspace.js.map +1 -1
  220. package/lib/cjs/workspace/WorkspaceEditor.d.ts +2 -2
  221. package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -1
  222. package/lib/cjs/workspace/WorkspaceEditor.js +1 -1
  223. package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
  224. package/package.json +15 -14
  225. package/lib/cjs/ServerBasedLocks.d.ts.map +0 -1
  226. package/lib/cjs/ServerBasedLocks.js.map +0 -1
  227. package/lib/cjs/internal/ImplementationProhibited.d.ts +0 -44
  228. package/lib/cjs/internal/ImplementationProhibited.d.ts.map +0 -1
  229. package/lib/cjs/internal/ImplementationProhibited.js +0 -51
  230. package/lib/cjs/internal/ImplementationProhibited.js.map +0 -1
@@ -1 +1 @@
1
-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gBAAgB;IAC7C,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,WAAW,CAAC,CAAC,CAAC;CACvE;AAHD,8BAGC;AAED;;GAEG;AACH,MAAa,eAAgB,SAAQ,eAAe;IAClD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;CAC7E;AAHD,0CAGC;AAED;;GAEG;AACH,MAAa,gBAAiB,SAAQ,YAAY;IAChD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,kBAAkB,CAAC,CAAC,CAAC;CAC9E;AAHD,4CAGC","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 Models\r\n */\r\n\r\n// cspell:ignore elid\r\n\r\nimport { GuidString, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { Point2d, Range3d } from \"@itwin/core-geometry\";\r\nimport {\r\n AxisAlignedBox3d, ElementProps, EntityReferenceSet, GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, IModel,\r\n InformationPartitionElementProps, ModelProps, RelatedElement,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionPartition, DocumentPartition, InformationRecordPartition, PhysicalPartition, SpatialLocationPartition } from \"./Element\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { SubjectOwnsPartitionElements } from \"./NavigationRelationship\";\r\n\r\n/** Argument for the `Model.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnModelArg {\r\n /** The iModel for the Model affected. */\r\n iModel: IModelDb;\r\n}\r\n\r\n/** Argument for the `Model.onXxx` static methods that supply the properties of a Model to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnModelPropsArg extends OnModelArg {\r\n /** The new properties of the Model affected. */\r\n props: Readonly<ModelProps>;\r\n}\r\n\r\n/** Argument for the `Model.onXxx` static methods that only supply the Id of the affected Model.\r\n * @beta\r\n */\r\nexport interface OnModelIdArg extends OnModelArg {\r\n /** The Id of the Model affected */\r\n id: Id64String;\r\n}\r\n\r\n/** Argument for the `Model.onXxxElement` static methods that supply the properties of an Element for a Model.\r\n * @beta\r\n */\r\nexport interface OnElementInModelPropsArg extends OnModelIdArg {\r\n /** The new properties of an Element for the affected Model */\r\n elementProps: Readonly<ElementProps>;\r\n}\r\n\r\n/** Argument for the `Model.onXxxElement` static methods that supply the Id of an Element for a Model.\r\n * @beta\r\n */\r\nexport interface OnElementInModelIdArg extends OnModelIdArg {\r\n /** The Id of the Element for the affected Model */\r\n elementId: Id64String;\r\n}\r\n\r\n/** A Model is a container for persisting a collection of related elements within an iModel.\r\n * See [[IModelDb.Models]] for how to query and manage the Models in an IModelDb.\r\n * See [Creating models]($docs/learning/backend/CreateModels.md)\r\n * @public\r\n */\r\nexport class Model extends Entity {\r\n /** @internal */\r\n public static override get className(): string { return \"Model\"; }\r\n /** @internal */\r\n public static override get protectedOperations() { return [\"onInsert\", \"onUpdate\", \"onDelete\"]; }\r\n public readonly modeledElement!: RelatedElement;\r\n public readonly name: string;\r\n public readonly parentModel!: Id64String;\r\n public readonly jsonProperties: { [key: string]: any };\r\n public isPrivate: boolean;\r\n public isTemplate: boolean;\r\n\r\n protected constructor(props: ModelProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.name = props.name ? props.name : \"\"; // NB this isn't really a property of Model (it's the code.value of the modeled element), but it comes in ModelProps because it's often needed\r\n this.isPrivate = JsonUtils.asBool(props.isPrivate);\r\n this.isTemplate = JsonUtils.asBool(props.isTemplate);\r\n this.jsonProperties = { ...props.jsonProperties }; // make sure we have our own copy\r\n }\r\n\r\n public override toJSON(): ModelProps {\r\n const val = super.toJSON() as ModelProps;\r\n val.name = this.name; // for cloning\r\n return val;\r\n }\r\n\r\n /** Called before a new Model 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 * @note `this` is the class of the Model to be inserted\r\n * @beta\r\n */\r\n protected static onInsert(arg: OnModelPropsArg): void {\r\n const { props, iModel } = arg;\r\n iModel.channels.verifyChannel(props.modeledElement.id);\r\n if (props.parentModel) // inserting requires shared lock on parent, if present\r\n iModel.locks.checkSharedLock(props.parentModel, \"parent model\", \"insert\");\r\n }\r\n\r\n /** Called after a new Model is inserted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that was inserted\r\n * @beta\r\n */\r\n protected static onInserted(_arg: OnModelIdArg): void {\r\n // we don't need to tell LockControl about models being created - their ModeledElement does that\r\n }\r\n\r\n /** Called before a Model 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 * @note `this` is the class of the Model to be updated\r\n * @beta\r\n */\r\n protected static onUpdate(arg: OnModelPropsArg): void {\r\n const id = arg.props.id!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n arg.iModel.channels.verifyChannel(id);\r\n arg.iModel.locks.checkExclusiveLock(id, \"model\", \"update\");\r\n }\r\n\r\n /** Called after a Model is updated.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that was updated.\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnModelIdArg): void {\r\n }\r\n\r\n /** Called before a Model 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 * @note `this` is the class of the Model to be deleted\r\n * @beta\r\n */\r\n protected static onDelete(arg: OnModelIdArg): void {\r\n arg.iModel.channels.verifyChannel(arg.id);\r\n arg.iModel.locks.checkExclusiveLock(arg.id, \"model\", \"delete\");\r\n }\r\n\r\n /** Called after a Model was deleted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that was deleted\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnModelIdArg): void { }\r\n\r\n /** Called before a prospective Element is to be inserted into an instance of a Model of this class.\r\n * @note throw an exception to disallow the insert\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model to hold the element\r\n * @beta\r\n */\r\n protected static onInsertElement(_arg: OnElementInModelPropsArg): void { }\r\n\r\n /** Called after an Element has been inserted into an instance of a Model of this class.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onInsertedElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n /** Called when an Element in an instance of a Model of this class is about to be 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 * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onUpdateElement(_arg: OnElementInModelPropsArg): void { }\r\n\r\n /** Called after an Element in an instance of a Model of this class has been updated.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onUpdatedElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n /** Called when an Element in an instance of a Model of this class is about to be 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 * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onDeleteElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n /** Called after an Element in an instance of a Model of this class has been deleted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that held the element\r\n * @beta\r\n */\r\n protected static onDeletedElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n private getAllUserProperties(): any {\r\n if (!this.jsonProperties.UserProps)\r\n this.jsonProperties.UserProps = new Object();\r\n\r\n return this.jsonProperties.UserProps;\r\n }\r\n\r\n /** Get a set of JSON user properties by namespace */\r\n public getUserProperties(namespace: string) { return this.getAllUserProperties()[namespace]; }\r\n\r\n /** Change a set of user JSON properties of this Element by namespace. */\r\n public setUserProperties(nameSpace: string, value: any) { this.getAllUserProperties()[nameSpace] = value; }\r\n\r\n /** Remove a set of JSON user properties, specified by namespace, from this Element */\r\n public removeUserProperties(nameSpace: string) { delete this.getAllUserProperties()[nameSpace]; }\r\n\r\n public getJsonProperty(name: string): any { return this.jsonProperties[name]; }\r\n public setJsonProperty(name: string, value: any) { this.jsonProperties[name] = value; }\r\n\r\n /** Insert this Model in the iModel */\r\n public insert() { return this.id = this.iModel.models.insertModel(this.toJSON()); }\r\n /** Update this Model in the iModel. */\r\n public update() { this.iModel.models.updateModel(this.toJSON()); }\r\n /** Delete this Model from the iModel. */\r\n public delete() { this.iModel.models.deleteModel(this.id); }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.parentModel)\r\n referenceIds.addModel(this.parentModel);\r\n referenceIds.addElement(this.modeledElement.id);\r\n }\r\n}\r\n\r\n/** A container for persisting geometric elements.\r\n * @public\r\n */\r\nexport class GeometricModel extends Model {\r\n public geometryGuid?: GuidString; // Initialized by the Entity constructor\r\n\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricModel\"; }\r\n\r\n protected constructor(props: GeometricModelProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Query for the union of the extents of the elements contained by this model.\r\n * @note This function blocks the JavaScript event loop. Consider using [[queryRange]] instead.\r\n */\r\n public queryExtents(): AxisAlignedBox3d {\r\n const extents = this.iModel.nativeDb.queryModelExtents({ id: this.id }).modelExtents;\r\n return Range3d.fromJSON(extents);\r\n }\r\n\r\n /** Query for the union of the extents of all elements contained within this model. */\r\n public async queryRange(): Promise<AxisAlignedBox3d> {\r\n return this.iModel.models.queryRange(this.id);\r\n }\r\n}\r\n\r\n/** A container for persisting 3d geometric elements.\r\n * @public\r\n */\r\nexport abstract class GeometricModel3d extends GeometricModel {\r\n /** If true, then the elements in this GeometricModel3d are expected to be in an XY plane.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isPlanProjection: boolean;\r\n /** If true, then the elements in this GeometricModel3d are not in real-world coordinates and will not be in the spatial index.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isNotSpatiallyLocated: boolean;\r\n /** If true, then the elements in this GeometricModel3d are in real-world coordinates and will be in the spatial index. */\r\n public get isSpatiallyLocated(): boolean { return !this.isNotSpatiallyLocated; }\r\n\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricModel3d\"; }\r\n\r\n protected constructor(props: GeometricModel3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.isNotSpatiallyLocated = JsonUtils.asBool(props.isNotSpatiallyLocated);\r\n this.isPlanProjection = JsonUtils.asBool(props.isPlanProjection);\r\n }\r\n\r\n public override toJSON(): GeometricModel3dProps {\r\n const val = super.toJSON() as GeometricModel3dProps;\r\n if (this.isNotSpatiallyLocated)\r\n val.isNotSpatiallyLocated = true;\r\n\r\n if (this.isPlanProjection)\r\n val.isPlanProjection = true;\r\n\r\n return val;\r\n }\r\n}\r\n\r\n/** A container for persisting 2d geometric elements.\r\n * @public\r\n */\r\nexport abstract class GeometricModel2d extends GeometricModel {\r\n /** The actual coordinates of (0,0) in modeling coordinates. An offset applied to all modeling coordinates. */\r\n public globalOrigin?: Point2d; // Initialized by the Entity constructor\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricModel2d\"; }\r\n\r\n protected constructor(props: GeometricModel2dProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n public override toJSON(): GeometricModel2dProps {\r\n const val = super.toJSON() as GeometricModel2dProps;\r\n if (undefined !== this.globalOrigin)\r\n val.globalOrigin = Point2d.fromJSON(this.globalOrigin);\r\n\r\n return val;\r\n }\r\n}\r\n\r\n/** A container for persisting 2d graphical elements.\r\n * @public\r\n */\r\nexport abstract class GraphicalModel2d extends GeometricModel2d {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalModel2d\"; }\r\n}\r\n\r\n/** A container for persisting GraphicalElement3d instances.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.8\r\n * @see [[GraphicalPartition3d]]\r\n * @public\r\n */\r\nexport abstract class GraphicalModel3d extends GeometricModel3d {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalModel3d\"; }\r\n}\r\n\r\n/** A container for persisting 3d geometric elements that are spatially located.\r\n * @public\r\n */\r\nexport abstract class SpatialModel extends GeometricModel3d {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialModel\"; }\r\n}\r\n\r\n/** A container for persisting physical elements that model physical space.\r\n * @see [[PhysicalPartition]]\r\n * @public\r\n */\r\nexport class PhysicalModel extends SpatialModel {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalModel\"; }\r\n /** Insert a PhysicalPartition and a PhysicalModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The PhysicalPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the PhysicalPartition that the new PhysicalModel 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 PhysicalPartition and PhysicalModel (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: PhysicalPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: PhysicalPartition.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/** A container for persisting spatial location elements.\r\n * @see [[SpatialLocationPartition]]\r\n * @public\r\n */\r\nexport class SpatialLocationModel extends SpatialModel {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialLocationModel\"; }\r\n /** Insert a SpatialLocationPartition and a SpatialLocationModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The SpatialLocationPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the SpatialLocationPartition that the new SpatialLocationModel 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 SpatialLocationPartition and SpatialLocationModel (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: SpatialLocationPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: SpatialLocationPartition.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/** A 2d model that holds [[DrawingGraphic]]s. DrawingModels may be dimensional or non-dimensional.\r\n * @public\r\n */\r\nexport class DrawingModel extends GraphicalModel2d {\r\n /** @internal */\r\n public static override get className(): string { return \"DrawingModel\"; }\r\n}\r\n\r\n/** A container for persisting section [[DrawingGraphic]]s.\r\n * @public\r\n */\r\nexport class SectionDrawingModel extends DrawingModel {\r\n /** @internal */\r\n public static override get className(): string { return \"SectionDrawingModel\"; }\r\n}\r\n\r\n/** A container for persisting [[ViewAttachment]]s and [[DrawingGraphic]]s.\r\n * A SheetModel is a digital representation of a *sheet of paper*. SheetModels are 2d models in bounded paper coordinates.\r\n * SheetModels may contain annotation Elements as well as references to 2d or 3d Views.\r\n * @public\r\n */\r\nexport class SheetModel extends GraphicalModel2d {\r\n /** @internal */\r\n public static override get className(): string { return \"SheetModel\"; }\r\n}\r\n\r\n/** A container for persisting role elements.\r\n * @public\r\n */\r\nexport class RoleModel extends Model {\r\n /** @internal */\r\n public static override get className(): string { return \"RoleModel\"; }\r\n}\r\n\r\n/** A container for persisting information elements.\r\n * @public\r\n */\r\nexport abstract class InformationModel extends Model {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationModel\"; }\r\n}\r\n\r\n/** A container for persisting group information elements.\r\n * @see [[GroupInformationPartition]]\r\n * @public\r\n */\r\nexport abstract class GroupInformationModel extends InformationModel {\r\n /** @internal */\r\n public static override get className(): string { return \"GroupInformationModel\"; }\r\n}\r\n\r\n/** A container for persisting Information Record Elements\r\n * @see [[InformationRecordPartition]]\r\n * @public\r\n */\r\nexport class InformationRecordModel extends InformationModel {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationRecordModel\"; }\r\n\r\n /** Insert a InformationRecordPartition and a InformationRecordModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The InformationRecordPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the InformationRecordPartition that the new InformationRecordModel will sub-model.\r\n * @returns The Id of the newly inserted InformationRecordModel.\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: InformationRecordPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: InformationRecordPartition.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/** A container for persisting definition elements.\r\n * @see [[DefinitionPartition]]\r\n * @public\r\n */\r\nexport class DefinitionModel extends InformationModel {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionModel\"; }\r\n\r\n /** Insert a DefinitionPartition and a DefinitionModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The DefinitionPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the DefinitionPartition that the new DefinitionModel will sub-model.\r\n * @returns The Id of the newly inserted DefinitionModel.\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: DefinitionPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: DefinitionPartition.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 singleton container of repository-related information elements.\r\n * @public\r\n */\r\nexport class RepositoryModel extends DefinitionModel {\r\n /** @internal */\r\n public static override get className(): string { return \"RepositoryModel\"; }\r\n}\r\n\r\n/** Contains a list of document elements.\r\n * @see [[DocumentPartition]]\r\n * @public\r\n */\r\nexport class DocumentListModel extends InformationModel {\r\n /** @internal */\r\n public static override get className(): string { return \"DocumentListModel\"; }\r\n /** Insert a DocumentPartition and a DocumentListModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The DocumentPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the DocumentPartition that the new DocumentListModel will sub-model.\r\n * @returns The Id of the newly inserted DocumentPartition and DocumentListModel (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): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: DocumentPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: DocumentPartition.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId: Id64String = 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/** A container for persisting link elements.\r\n * @see [[LinkPartition]]\r\n * @public\r\n */\r\nexport class LinkModel extends InformationModel {\r\n /** @internal */\r\n public static override get className(): string { return \"LinkModel\"; }\r\n}\r\n\r\n/** The singleton container for repository-specific definition elements.\r\n * @public\r\n */\r\nexport class DictionaryModel extends DefinitionModel {\r\n /** @internal */\r\n public static override get className(): string { return \"DictionaryModel\"; }\r\n}\r\n\r\n/** Obtains and displays multi-resolution tiled raster organized according to the WebMercator tiling system.\r\n * @public\r\n */\r\nexport class WebMercatorModel extends SpatialModel {\r\n /** @internal */\r\n public static override get className(): string { return \"WebMercatorModel\"; }\r\n}\r\n"]}
1
+ {"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/Model.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qBAAqB;AAErB,sDAAwE;AACxE,wDAAwD;AACxD,oDAG4B;AAC5B,uCAA4I;AAC5I,qCAAkC;AAElC,qEAAwE;AACxE,gDAA+D;AA0C/D;;;;GAIG;AACH,MAAa,KAAM,SAAQ,eAAM;IACxB,MAAM,KAAc,SAAS,KAAa,OAAO,OAAO,CAAC,CAAC,CAAC;IAClE,gBAAgB;IACT,MAAM,KAAc,mBAAmB,KAAK,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAQjG,YAAsB,KAAiB,EAAE,MAAgB;QACvD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,8IAA8I;QACxL,IAAI,CAAC,SAAS,GAAG,wBAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU,GAAG,wBAAS,CAAC,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AC,aAAa,CAAC,cAAc,CAAC,CAAC;QAChF,OAAO,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC;YACjC,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,cAAc,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE;SACpC,CAAC,CAAC;IACL,CAAC;CACF;AAtBD,8CAsBC;AAED;;;GAGG;AACH,MAAa,SAAU,SAAQ,gBAAgB;IACtC,MAAM,KAAc,SAAS,KAAa,OAAO,WAAW,CAAC,CAAC,CAAC;CACvE;AAFD,8BAEC;AAED;;GAEG;AACH,MAAa,eAAgB,SAAQ,eAAe;IAC3C,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;CAC7E;AAFD,0CAEC;AAED;;GAEG;AACH,MAAa,gBAAiB,SAAQ,YAAY;IACzC,MAAM,KAAc,SAAS,KAAa,OAAO,kBAAkB,CAAC,CAAC,CAAC;CAC9E;AAFD,4CAEC","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 Models\r\n */\r\n\r\n// cspell:ignore elid\r\n\r\nimport { GuidString, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { Point2d, Range3d } from \"@itwin/core-geometry\";\r\nimport {\r\n AxisAlignedBox3d, ElementProps, EntityReferenceSet, GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, IModel,\r\n InformationPartitionElementProps, ModelProps, RelatedElement,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionPartition, DocumentPartition, InformationRecordPartition, PhysicalPartition, SpatialLocationPartition } from \"./Element\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { SubjectOwnsPartitionElements } from \"./NavigationRelationship\";\r\nimport { _nativeDb, _verifyChannel } from \"./internal/Symbols\";\r\n\r\n/** Argument for the `Model.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnModelArg {\r\n /** The iModel for the Model affected. */\r\n iModel: IModelDb;\r\n}\r\n\r\n/** Argument for the `Model.onXxx` static methods that supply the properties of a Model to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnModelPropsArg extends OnModelArg {\r\n /** The new properties of the Model affected. */\r\n props: Readonly<ModelProps>;\r\n}\r\n\r\n/** Argument for the `Model.onXxx` static methods that only supply the Id of the affected Model.\r\n * @beta\r\n */\r\nexport interface OnModelIdArg extends OnModelArg {\r\n /** The Id of the Model affected */\r\n id: Id64String;\r\n}\r\n\r\n/** Argument for the `Model.onXxxElement` static methods that supply the properties of an Element for a Model.\r\n * @beta\r\n */\r\nexport interface OnElementInModelPropsArg extends OnModelIdArg {\r\n /** The new properties of an Element for the affected Model */\r\n elementProps: Readonly<ElementProps>;\r\n}\r\n\r\n/** Argument for the `Model.onXxxElement` static methods that supply the Id of an Element for a Model.\r\n * @beta\r\n */\r\nexport interface OnElementInModelIdArg extends OnModelIdArg {\r\n /** The Id of the Element for the affected Model */\r\n elementId: Id64String;\r\n}\r\n\r\n/** A Model is a container for persisting a collection of related elements within an iModel.\r\n * See [[IModelDb.Models]] for how to query and manage the Models in an IModelDb.\r\n * See [Creating models]($docs/learning/backend/CreateModels.md)\r\n * @public\r\n */\r\nexport class Model extends Entity {\r\n public static override get className(): string { return \"Model\"; }\r\n /** @internal */\r\n public static override get protectedOperations() { return [\"onInsert\", \"onUpdate\", \"onDelete\"]; }\r\n public readonly modeledElement!: RelatedElement;\r\n public readonly name: string;\r\n public readonly parentModel!: Id64String;\r\n public readonly jsonProperties: { [key: string]: any };\r\n public isPrivate: boolean;\r\n public isTemplate: boolean;\r\n\r\n protected constructor(props: ModelProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.name = props.name ? props.name : \"\"; // NB this isn't really a property of Model (it's the code.value of the modeled element), but it comes in ModelProps because it's often needed\r\n this.isPrivate = JsonUtils.asBool(props.isPrivate);\r\n this.isTemplate = JsonUtils.asBool(props.isTemplate);\r\n this.jsonProperties = { ...props.jsonProperties }; // make sure we have our own copy\r\n }\r\n\r\n public override toJSON(): ModelProps {\r\n const val = super.toJSON() as ModelProps;\r\n val.name = this.name; // for cloning\r\n return val;\r\n }\r\n\r\n /** Called before a new Model 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 * @note `this` is the class of the Model to be inserted\r\n * @beta\r\n */\r\n protected static onInsert(arg: OnModelPropsArg): void {\r\n const { props, iModel } = arg;\r\n iModel.channels[_verifyChannel](props.modeledElement.id);\r\n if (props.parentModel) // inserting requires shared lock on parent, if present\r\n iModel.locks.checkSharedLock(props.parentModel, \"parent model\", \"insert\");\r\n }\r\n\r\n /** Called after a new Model is inserted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that was inserted\r\n * @beta\r\n */\r\n protected static onInserted(_arg: OnModelIdArg): void {\r\n // we don't need to tell LockControl about models being created - their ModeledElement does that\r\n }\r\n\r\n /** Called before a Model 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 * @note `this` is the class of the Model to be updated\r\n * @beta\r\n */\r\n protected static onUpdate(arg: OnModelPropsArg): void {\r\n const id = arg.props.id!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n arg.iModel.channels[_verifyChannel](id);\r\n arg.iModel.locks.checkExclusiveLock(id, \"model\", \"update\");\r\n }\r\n\r\n /** Called after a Model is updated.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that was updated.\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnModelIdArg): void {\r\n }\r\n\r\n /** Called before a Model 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 * @note `this` is the class of the Model to be deleted\r\n * @beta\r\n */\r\n protected static onDelete(arg: OnModelIdArg): void {\r\n arg.iModel.channels[_verifyChannel](arg.id);\r\n arg.iModel.locks.checkExclusiveLock(arg.id, \"model\", \"delete\");\r\n }\r\n\r\n /** Called after a Model was deleted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that was deleted\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnModelIdArg): void { }\r\n\r\n /** Called before a prospective Element is to be inserted into an instance of a Model of this class.\r\n * @note throw an exception to disallow the insert\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model to hold the element\r\n * @beta\r\n */\r\n protected static onInsertElement(_arg: OnElementInModelPropsArg): void { }\r\n\r\n /** Called after an Element has been inserted into an instance of a Model of this class.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onInsertedElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n /** Called when an Element in an instance of a Model of this class is about to be 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 * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onUpdateElement(_arg: OnElementInModelPropsArg): void { }\r\n\r\n /** Called after an Element in an instance of a Model of this class has been updated.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onUpdatedElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n /** Called when an Element in an instance of a Model of this class is about to be 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 * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onDeleteElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n /** Called after an Element in an instance of a Model of this class has been deleted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that held the element\r\n * @beta\r\n */\r\n protected static onDeletedElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n private getAllUserProperties(): any {\r\n if (!this.jsonProperties.UserProps)\r\n this.jsonProperties.UserProps = new Object();\r\n\r\n return this.jsonProperties.UserProps;\r\n }\r\n\r\n /** Get a set of JSON user properties by namespace */\r\n public getUserProperties(namespace: string) { return this.getAllUserProperties()[namespace]; }\r\n\r\n /** Change a set of user JSON properties of this Element by namespace. */\r\n public setUserProperties(nameSpace: string, value: any) { this.getAllUserProperties()[nameSpace] = value; }\r\n\r\n /** Remove a set of JSON user properties, specified by namespace, from this Element */\r\n public removeUserProperties(nameSpace: string) { delete this.getAllUserProperties()[nameSpace]; }\r\n\r\n public getJsonProperty(name: string): any { return this.jsonProperties[name]; }\r\n public setJsonProperty(name: string, value: any) { this.jsonProperties[name] = value; }\r\n\r\n /** Insert this Model in the iModel */\r\n public insert() { return this.id = this.iModel.models.insertModel(this.toJSON()); }\r\n /** Update this Model in the iModel. */\r\n public update() { this.iModel.models.updateModel(this.toJSON()); }\r\n /** Delete this Model from the iModel. */\r\n public delete() { this.iModel.models.deleteModel(this.id); }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.parentModel)\r\n referenceIds.addModel(this.parentModel);\r\n referenceIds.addElement(this.modeledElement.id);\r\n }\r\n}\r\n\r\n/** A container for persisting geometric elements.\r\n * @public\r\n */\r\nexport class GeometricModel extends Model {\r\n public geometryGuid?: GuidString; // Initialized by the Entity constructor\r\n\r\n public static override get className(): string { return \"GeometricModel\"; }\r\n\r\n protected constructor(props: GeometricModelProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Query for the union of the extents of the elements contained by this model.\r\n * @note This function blocks the JavaScript event loop. Consider using [[queryRange]] instead.\r\n */\r\n public queryExtents(): AxisAlignedBox3d {\r\n const extents = this.iModel[_nativeDb].queryModelExtents({ id: this.id }).modelExtents;\r\n return Range3d.fromJSON(extents);\r\n }\r\n\r\n /** Query for the union of the extents of all elements contained within this model. */\r\n public async queryRange(): Promise<AxisAlignedBox3d> {\r\n return this.iModel.models.queryRange(this.id);\r\n }\r\n}\r\n\r\n/** A container for persisting 3d geometric elements.\r\n * @public\r\n */\r\nexport abstract class GeometricModel3d extends GeometricModel {\r\n /** If true, then the elements in this GeometricModel3d are expected to be in an XY plane.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isPlanProjection: boolean;\r\n /** If true, then the elements in this GeometricModel3d are not in real-world coordinates and will not be in the spatial index.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isNotSpatiallyLocated: boolean;\r\n /** If true, then the elements in this GeometricModel3d are in real-world coordinates and will be in the spatial index. */\r\n public get isSpatiallyLocated(): boolean { return !this.isNotSpatiallyLocated; }\r\n\r\n public static override get className(): string { return \"GeometricModel3d\"; }\r\n\r\n protected constructor(props: GeometricModel3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.isNotSpatiallyLocated = JsonUtils.asBool(props.isNotSpatiallyLocated);\r\n this.isPlanProjection = JsonUtils.asBool(props.isPlanProjection);\r\n }\r\n\r\n public override toJSON(): GeometricModel3dProps {\r\n const val = super.toJSON() as GeometricModel3dProps;\r\n if (this.isNotSpatiallyLocated)\r\n val.isNotSpatiallyLocated = true;\r\n\r\n if (this.isPlanProjection)\r\n val.isPlanProjection = true;\r\n\r\n return val;\r\n }\r\n}\r\n\r\n/** A container for persisting 2d geometric elements.\r\n * @public\r\n */\r\nexport abstract class GeometricModel2d extends GeometricModel {\r\n /** The actual coordinates of (0,0) in modeling coordinates. An offset applied to all modeling coordinates. */\r\n public globalOrigin?: Point2d; // Initialized by the Entity constructor\r\n public static override get className(): string { return \"GeometricModel2d\"; }\r\n\r\n protected constructor(props: GeometricModel2dProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n public override toJSON(): GeometricModel2dProps {\r\n const val = super.toJSON() as GeometricModel2dProps;\r\n if (undefined !== this.globalOrigin)\r\n val.globalOrigin = Point2d.fromJSON(this.globalOrigin);\r\n\r\n return val;\r\n }\r\n}\r\n\r\n/** A container for persisting 2d graphical elements.\r\n * @public\r\n */\r\nexport abstract class GraphicalModel2d extends GeometricModel2d {\r\n public static override get className(): string { return \"GraphicalModel2d\"; }\r\n}\r\n\r\n/** A container for persisting GraphicalElement3d instances.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.8\r\n * @see [[GraphicalPartition3d]]\r\n * @public\r\n */\r\nexport abstract class GraphicalModel3d extends GeometricModel3d {\r\n public static override get className(): string { return \"GraphicalModel3d\"; }\r\n}\r\n\r\n/** A container for persisting 3d geometric elements that are spatially located.\r\n * @public\r\n */\r\nexport abstract class SpatialModel extends GeometricModel3d {\r\n public static override get className(): string { return \"SpatialModel\"; }\r\n}\r\n\r\n/** A container for persisting physical elements that model physical space.\r\n * @see [[PhysicalPartition]]\r\n * @public\r\n */\r\nexport class PhysicalModel extends SpatialModel {\r\n public static override get className(): string { return \"PhysicalModel\"; }\r\n /** Insert a PhysicalPartition and a PhysicalModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The PhysicalPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the PhysicalPartition that the new PhysicalModel 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 PhysicalPartition and PhysicalModel (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: PhysicalPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: PhysicalPartition.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/** A container for persisting spatial location elements.\r\n * @see [[SpatialLocationPartition]]\r\n * @public\r\n */\r\nexport class SpatialLocationModel extends SpatialModel {\r\n public static override get className(): string { return \"SpatialLocationModel\"; }\r\n /** Insert a SpatialLocationPartition and a SpatialLocationModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The SpatialLocationPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the SpatialLocationPartition that the new SpatialLocationModel 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 SpatialLocationPartition and SpatialLocationModel (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: SpatialLocationPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: SpatialLocationPartition.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/** A 2d model that holds [[DrawingGraphic]]s. DrawingModels may be dimensional or non-dimensional.\r\n * @public\r\n */\r\nexport class DrawingModel extends GraphicalModel2d {\r\n public static override get className(): string { return \"DrawingModel\"; }\r\n}\r\n\r\n/** A container for persisting section [[DrawingGraphic]]s.\r\n * @public\r\n */\r\nexport class SectionDrawingModel extends DrawingModel {\r\n public static override get className(): string { return \"SectionDrawingModel\"; }\r\n}\r\n\r\n/** A container for persisting [[ViewAttachment]]s and [[DrawingGraphic]]s.\r\n * A SheetModel is a digital representation of a *sheet of paper*. SheetModels are 2d models in bounded paper coordinates.\r\n * SheetModels may contain annotation Elements as well as references to 2d or 3d Views.\r\n * @public\r\n */\r\nexport class SheetModel extends GraphicalModel2d {\r\n public static override get className(): string { return \"SheetModel\"; }\r\n}\r\n\r\n/** A container for persisting role elements.\r\n * @public\r\n */\r\nexport class RoleModel extends Model {\r\n public static override get className(): string { return \"RoleModel\"; }\r\n}\r\n\r\n/** A container for persisting information elements.\r\n * @public\r\n */\r\nexport abstract class InformationModel extends Model {\r\n public static override get className(): string { return \"InformationModel\"; }\r\n}\r\n\r\n/** A container for persisting group information elements.\r\n * @see [[GroupInformationPartition]]\r\n * @public\r\n */\r\nexport abstract class GroupInformationModel extends InformationModel {\r\n public static override get className(): string { return \"GroupInformationModel\"; }\r\n}\r\n\r\n/** A container for persisting Information Record Elements\r\n * @see [[InformationRecordPartition]]\r\n * @public\r\n */\r\nexport class InformationRecordModel extends InformationModel {\r\n public static override get className(): string { return \"InformationRecordModel\"; }\r\n\r\n /** Insert a InformationRecordPartition and a InformationRecordModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The InformationRecordPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the InformationRecordPartition that the new InformationRecordModel will sub-model.\r\n * @returns The Id of the newly inserted InformationRecordModel.\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: InformationRecordPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: InformationRecordPartition.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/** A container for persisting definition elements.\r\n * @see [[DefinitionPartition]]\r\n * @public\r\n */\r\nexport class DefinitionModel extends InformationModel {\r\n public static override get className(): string { return \"DefinitionModel\"; }\r\n\r\n /** Insert a DefinitionPartition and a DefinitionModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The DefinitionPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the DefinitionPartition that the new DefinitionModel will sub-model.\r\n * @returns The Id of the newly inserted DefinitionModel.\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: DefinitionPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: DefinitionPartition.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 singleton container of repository-related information elements.\r\n * @public\r\n */\r\nexport class RepositoryModel extends DefinitionModel {\r\n public static override get className(): string { return \"RepositoryModel\"; }\r\n}\r\n\r\n/** Contains a list of document elements.\r\n * @see [[DocumentPartition]]\r\n * @public\r\n */\r\nexport class DocumentListModel extends InformationModel {\r\n public static override get className(): string { return \"DocumentListModel\"; }\r\n /** Insert a DocumentPartition and a DocumentListModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The DocumentPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the DocumentPartition that the new DocumentListModel will sub-model.\r\n * @returns The Id of the newly inserted DocumentPartition and DocumentListModel (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): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: DocumentPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: DocumentPartition.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId: Id64String = 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/** A container for persisting link elements.\r\n * @see [[LinkPartition]]\r\n * @public\r\n */\r\nexport class LinkModel extends InformationModel {\r\n public static override get className(): string { return \"LinkModel\"; }\r\n}\r\n\r\n/** The singleton container for repository-specific definition elements.\r\n * @public\r\n */\r\nexport class DictionaryModel extends DefinitionModel {\r\n public static override get className(): string { return \"DictionaryModel\"; }\r\n}\r\n\r\n/** Obtains and displays multi-resolution tiled raster organized according to the WebMercator tiling system.\r\n * @public\r\n */\r\nexport class WebMercatorModel extends SpatialModel {\r\n public static override get className(): string { return \"WebMercatorModel\"; }\r\n}\r\n"]}
@@ -10,7 +10,6 @@ export type { SourceAndTarget, RelationshipProps } from "@itwin/core-common";
10
10
  * @public
11
11
  */
12
12
  export declare class Relationship extends Entity {
13
- /** @internal */
14
13
  static get className(): string;
15
14
  readonly sourceId: Id64String;
16
15
  readonly targetId: Id64String;
@@ -43,7 +42,6 @@ export declare class Relationship extends Entity {
43
42
  * @public
44
43
  */
45
44
  export declare class ElementRefersToElements extends Relationship {
46
- /** @internal */
47
45
  static get className(): string;
48
46
  /** Create an instance of the Relationship.
49
47
  * @param iModel The iModel that will contain the relationship
@@ -65,14 +63,12 @@ export declare class ElementRefersToElements extends Relationship {
65
63
  * @public
66
64
  */
67
65
  export declare class DrawingGraphicRepresentsElement extends ElementRefersToElements {
68
- /** @internal */
69
66
  static get className(): string;
70
67
  }
71
68
  /** Relates a [[GraphicalElement3d]] to the [[Element]] that it represents
72
69
  * @public
73
70
  */
74
71
  export declare class GraphicalElement3dRepresentsElement extends ElementRefersToElements {
75
- /** @internal */
76
72
  static get className(): string;
77
73
  }
78
74
  /** Relates a [[SynchronizationConfigLink]] to N [[ExternalSource]] instances.
@@ -81,7 +77,6 @@ export declare class GraphicalElement3dRepresentsElement extends ElementRefersTo
81
77
  * @beta
82
78
  */
83
79
  export declare class SynchronizationConfigProcessesSources extends ElementRefersToElements {
84
- /** @internal */
85
80
  static get className(): string;
86
81
  }
87
82
  /** Relates a [[SynchronizationConfigLink]] to *root* [[ExternalSource]] instances.
@@ -89,7 +84,6 @@ export declare class SynchronizationConfigProcessesSources extends ElementRefers
89
84
  * @beta
90
85
  */
91
86
  export declare class SynchronizationConfigSpecifiesRootSources extends SynchronizationConfigProcessesSources {
92
- /** @internal */
93
87
  static get className(): string;
94
88
  }
95
89
  /** Properties that are common to all types of link table ECRelationships
@@ -102,7 +96,6 @@ export interface ElementGroupsMembersProps extends RelationshipProps {
102
96
  * @public
103
97
  */
104
98
  export declare class ElementGroupsMembers extends ElementRefersToElements {
105
- /** @internal */
106
99
  static get className(): string;
107
100
  memberPriority: number;
108
101
  constructor(props: ElementGroupsMembersProps, iModel: IModelDb);
@@ -113,7 +106,6 @@ export declare class ElementGroupsMembers extends ElementRefersToElements {
113
106
  * @public
114
107
  */
115
108
  export declare class DefinitionGroupGroupsDefinitions extends ElementGroupsMembers {
116
- /** @internal */
117
109
  static get className(): string;
118
110
  }
119
111
  /** Represents group membership where the group Element (and its properties) impart information about the member Elements above mere membership.
@@ -122,7 +114,6 @@ export declare class DefinitionGroupGroupsDefinitions extends ElementGroupsMembe
122
114
  * @public
123
115
  */
124
116
  export declare class GroupImpartsToMembers extends ElementGroupsMembers {
125
- /** @internal */
126
117
  static get className(): string;
127
118
  }
128
119
  /** Relates an [[ExternalSourceGroup]] to its [[ExternalSource]] members.
@@ -130,7 +121,6 @@ export declare class GroupImpartsToMembers extends ElementGroupsMembers {
130
121
  * @beta
131
122
  */
132
123
  export declare class ExternalSourceGroupGroupsSources extends ElementGroupsMembers {
133
- /** @internal */
134
124
  static get className(): string;
135
125
  }
136
126
  /** Properties that are common to all types of ElementDrivesElements
@@ -325,7 +315,6 @@ export interface ElementDrivesElementProps extends RelationshipProps {
325
315
  * @beta
326
316
  */
327
317
  export declare class ElementDrivesElement extends Relationship {
328
- /** @internal */
329
318
  static get className(): string;
330
319
  /** Relationship status
331
320
  * * 0 indicates no errors. Set after a successful evaluation.
@@ -347,7 +336,6 @@ export declare class ElementDrivesElement extends Relationship {
347
336
  * @internal
348
337
  */
349
338
  export declare class ModelSelectorRefersToModels extends Relationship {
350
- /** @internal */
351
339
  static get className(): string;
352
340
  protected collectReferenceIds(referenceIds: EntityReferenceSet): void;
353
341
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Relationship.d.ts","sourceRoot":"","sources":["../../src/Relationship.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAkB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAA6B,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEvH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE7E;;GAEG;AACH,qBAAa,YAAa,SAAQ,MAAM;IACtC,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAA2B;IACzE,SAAgB,QAAQ,EAAE,UAAU,CAAC;IACrC,SAAgB,QAAQ,EAAE,UAAU,CAAC;IAErC,SAAS,aAAa,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,QAAQ;IAMhD,MAAM,IAAI,iBAAiB;IAO3C;;;;;;OAMG;WACW,aAAa,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,QAAQ,GAAG,IAAI;IAE/E;;;;;OAKG;WACW,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,QAAQ,GAAG,IAAI;IAErF,gDAAgD;IACzC,MAAM,IAAI,UAAU;IAC3B,8CAA8C;IACvC,MAAM;IACb,gDAAgD;IACzC,MAAM;WAEC,WAAW,CAAC,CAAC,SAAS,YAAY,EAAE,MAAM,EAAE,QAAQ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AM9B;;;;OAIG;IACI,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,UAAU;IAK3D;;OAEG;IACI,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAIrD,wDAAwD;IACjD,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAIrD;;;;;OAKG;IACI,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,eAAe,GAAG,CAAC;IAQzH;;;;;;OAMG;IACI,mBAAmB,CAAC,CAAC,SAAS,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,eAAe,GAAG,CAAC,GAAG,SAAS;IAoBxI;;;;;OAKG;IACI,WAAW,CAAC,CAAC,SAAS,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,eAAe,GAAG,CAAC;IAI9G;;;;;;OAMG;IACI,cAAc,CAAC,CAAC,SAAS,YAAY,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,eAAe,GAAG,CAAC,GAAG,SAAS;CAI/H"}
@@ -11,11 +11,11 @@ exports.Relationships = exports.ModelSelectorRefersToModels = exports.ElementDri
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const core_common_1 = require("@itwin/core-common");
13
13
  const Entity_1 = require("./Entity");
14
+ const Symbols_1 = require("./internal/Symbols");
14
15
  /** Base class for all link table ECRelationships
15
16
  * @public
16
17
  */
17
18
  class Relationship extends Entity_1.Entity {
18
- /** @internal */
19
19
  static get className() { return "Relationship"; }
20
20
  constructor(props, iModel) {
21
21
  super(props, iModel);
@@ -56,7 +56,6 @@ exports.Relationship = Relationship;
56
56
  * @public
57
57
  */
58
58
  class ElementRefersToElements extends Relationship {
59
- /** @internal */
60
59
  static get className() { return "ElementRefersToElements"; }
61
60
  /** Create an instance of the Relationship.
62
61
  * @param iModel The iModel that will contain the relationship
@@ -88,7 +87,6 @@ exports.ElementRefersToElements = ElementRefersToElements;
88
87
  * @public
89
88
  */
90
89
  class DrawingGraphicRepresentsElement extends ElementRefersToElements {
91
- /** @internal */
92
90
  static get className() { return "DrawingGraphicRepresentsElement"; }
93
91
  }
94
92
  exports.DrawingGraphicRepresentsElement = DrawingGraphicRepresentsElement;
@@ -96,7 +94,6 @@ exports.DrawingGraphicRepresentsElement = DrawingGraphicRepresentsElement;
96
94
  * @public
97
95
  */
98
96
  class GraphicalElement3dRepresentsElement extends ElementRefersToElements {
99
- /** @internal */
100
97
  static get className() { return "GraphicalElement3dRepresentsElement"; }
101
98
  }
102
99
  exports.GraphicalElement3dRepresentsElement = GraphicalElement3dRepresentsElement;
@@ -106,7 +103,6 @@ exports.GraphicalElement3dRepresentsElement = GraphicalElement3dRepresentsElemen
106
103
  * @beta
107
104
  */
108
105
  class SynchronizationConfigProcessesSources extends ElementRefersToElements {
109
- /** @internal */
110
106
  static get className() { return "SynchronizationConfigProcessesSources"; }
111
107
  }
112
108
  exports.SynchronizationConfigProcessesSources = SynchronizationConfigProcessesSources;
@@ -115,7 +111,6 @@ exports.SynchronizationConfigProcessesSources = SynchronizationConfigProcessesSo
115
111
  * @beta
116
112
  */
117
113
  class SynchronizationConfigSpecifiesRootSources extends SynchronizationConfigProcessesSources {
118
- /** @internal */
119
114
  static get className() { return "SynchronizationConfigSpecifiesRootSources"; }
120
115
  }
121
116
  exports.SynchronizationConfigSpecifiesRootSources = SynchronizationConfigSpecifiesRootSources;
@@ -123,7 +118,6 @@ exports.SynchronizationConfigSpecifiesRootSources = SynchronizationConfigSpecifi
123
118
  * @public
124
119
  */
125
120
  class ElementGroupsMembers extends ElementRefersToElements {
126
- /** @internal */
127
121
  static get className() { return "ElementGroupsMembers"; }
128
122
  constructor(props, iModel) {
129
123
  super(props, iModel);
@@ -140,7 +134,6 @@ exports.ElementGroupsMembers = ElementGroupsMembers;
140
134
  * @public
141
135
  */
142
136
  class DefinitionGroupGroupsDefinitions extends ElementGroupsMembers {
143
- /** @internal */
144
137
  static get className() { return "DefinitionGroupGroupsDefinitions"; }
145
138
  }
146
139
  exports.DefinitionGroupGroupsDefinitions = DefinitionGroupGroupsDefinitions;
@@ -150,7 +143,6 @@ exports.DefinitionGroupGroupsDefinitions = DefinitionGroupGroupsDefinitions;
150
143
  * @public
151
144
  */
152
145
  class GroupImpartsToMembers extends ElementGroupsMembers {
153
- /** @internal */
154
146
  static get className() { return "GroupImpartsToMembers"; }
155
147
  }
156
148
  exports.GroupImpartsToMembers = GroupImpartsToMembers;
@@ -159,7 +151,6 @@ exports.GroupImpartsToMembers = GroupImpartsToMembers;
159
151
  * @beta
160
152
  */
161
153
  class ExternalSourceGroupGroupsSources extends ElementGroupsMembers {
162
- /** @internal */
163
154
  static get className() { return "ExternalSourceGroupGroupsSources"; }
164
155
  }
165
156
  exports.ExternalSourceGroupGroupsSources = ExternalSourceGroupGroupsSources;
@@ -348,7 +339,6 @@ exports.ExternalSourceGroupGroupsSources = ExternalSourceGroupGroupsSources;
348
339
  * @beta
349
340
  */
350
341
  class ElementDrivesElement extends Relationship {
351
- /** @internal */
352
342
  static get className() { return "ElementDrivesElement"; }
353
343
  constructor(props, iModel) {
354
344
  super(props, iModel);
@@ -379,7 +369,6 @@ exports.ElementDrivesElement = ElementDrivesElement;
379
369
  * @internal
380
370
  */
381
371
  class ModelSelectorRefersToModels extends Relationship {
382
- /** @internal */
383
372
  static get className() { return "ModelSelectorRefersToModels"; }
384
373
  collectReferenceIds(referenceIds) {
385
374
  super.collectReferenceIds(referenceIds);
@@ -401,7 +390,7 @@ class Relationships {
401
390
  createInstance(props) { return this._iModel.constructEntity(props); }
402
391
  /** Check classFullName to ensure it is a link table relationship class. */
403
392
  checkRelationshipClass(classFullName) {
404
- if (!this._iModel.nativeDb.isLinkTableRelationship(classFullName.replace(".", ":"))) {
393
+ if (!this._iModel[Symbols_1._nativeDb].isLinkTableRelationship(classFullName.replace(".", ":"))) {
405
394
  throw new core_common_1.IModelError(core_bentley_1.DbResult.BE_SQLITE_ERROR, `Class '${classFullName}' must be a relationship class and it should be subclass of BisCore:ElementRefersToElements or BisCore:ElementDrivesElement.`);
406
395
  }
407
396
  }
@@ -412,17 +401,17 @@ class Relationships {
412
401
  */
413
402
  insertInstance(props) {
414
403
  this.checkRelationshipClass(props.classFullName);
415
- return props.id = this._iModel.nativeDb.insertLinkTableRelationship(props);
404
+ return props.id = this._iModel[Symbols_1._nativeDb].insertLinkTableRelationship(props);
416
405
  }
417
406
  /** Update the properties of an existing relationship instance in the iModel.
418
407
  * @param props the properties of the relationship instance to update. Any properties that are not present will be left unchanged.
419
408
  */
420
409
  updateInstance(props) {
421
- this._iModel.nativeDb.updateLinkTableRelationship(props);
410
+ this._iModel[Symbols_1._nativeDb].updateLinkTableRelationship(props);
422
411
  }
423
412
  /** Delete an Relationship instance from this iModel. */
424
413
  deleteInstance(props) {
425
- this._iModel.nativeDb.deleteLinkTableRelationship(props);
414
+ this._iModel[Symbols_1._nativeDb].deleteLinkTableRelationship(props);
426
415
  }
427
416
  /** Get the props of a Relationship instance
428
417
  * @param relClassFullName The full class name of the relationship in the form of "schema:class"
@@ -1 +1 @@
1
- {"version":3,"file":"Relationship.js","sourceRoot":"","sources":["../../src/Relationship.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAiE;AACjE,oDAAuH;AAEvH,qCAAkC;AAKlC;;GAEG;AACH,MAAa,YAAa,SAAQ,eAAM;IACtC,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,cAAc,CAAC,CAAC,CAAC;IAIzE,YAAsB,KAAwB,EAAE,MAAgB;QAC9D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,mBAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG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AAS,KAAK,KAAK,EAAE,CAAC;YACxB,KAAK,CAAC,aAAa,GAAI,KAAa,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,WAAW,CAAyB,eAAuB,EAAE,QAAsC;QACxG,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAI,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;OAMG;IACI,cAAc,CAAyB,gBAAwB,EAAE,QAAsC;QAC5G,MAAM,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,CAAoB,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAClG,OAAO,SAAS,KAAK,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1G,CAAC;CACF;AAvGD,sCAuGC","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 Relationships\r\n */\r\n\r\nimport { DbResult, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { EntityReferenceSet, IModelError, IModelStatus, RelationshipProps, SourceAndTarget } from \"@itwin/core-common\";\r\nimport { ECSqlStatement } from \"./ECSqlStatement\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\nexport type { SourceAndTarget, RelationshipProps } from \"@itwin/core-common\"; // for backwards compatibility\r\n\r\n/** Base class for all link table ECRelationships\r\n * @public\r\n */\r\nexport class Relationship extends Entity {\r\n /** @internal */\r\n public static override get className(): string { return \"Relationship\"; }\r\n public readonly sourceId: Id64String;\r\n public readonly targetId: Id64String;\r\n\r\n protected constructor(props: RelationshipProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.sourceId = Id64.fromJSON(props.sourceId);\r\n this.targetId = Id64.fromJSON(props.targetId);\r\n }\r\n\r\n public override toJSON(): RelationshipProps {\r\n const val = super.toJSON() as RelationshipProps;\r\n val.sourceId = this.sourceId;\r\n val.targetId = this.targetId;\r\n return val;\r\n }\r\n\r\n /**\r\n * Callback invoked by saveChanges on an ElementDrivesElement relationship when its input has changed or is the output of some upstream relationship whose input has changed.\r\n * This callback is invoked after the input element has been processed by upstream relationships.\r\n * A subclass of ElementDrivesElement can re-implement this static method to take some action. onRootChanged may modify the output element only.\r\n * @param _props The ElementDrivesElement relationship instance.\r\n * @param _iModel The iModel\r\n */\r\n public static onRootChanged(_props: RelationshipProps, _iModel: IModelDb): void { }\r\n\r\n /**\r\n * Callback invoked by saveChanges on an ElementDrivesElement relationship when the relationship instance has been deleted.\r\n * A subclass of ElementDrivesElement can re-implement this static method to take some action.\r\n * @param _props The deleted ElementDrivesElement relationship instance.\r\n * @param _iModel The iModel\r\n */\r\n public static onDeletedDependency(_props: RelationshipProps, _iModel: IModelDb): void { }\r\n\r\n /** Insert this Relationship into the iModel. */\r\n public insert(): Id64String { return this.id = this.iModel.relationships.insertInstance(this.toJSON()); }\r\n /** Update this Relationship in the iModel. */\r\n public update() { this.iModel.relationships.updateInstance(this.toJSON()); }\r\n /** Delete this Relationship from the iModel. */\r\n public delete() { this.iModel.relationships.deleteInstance(this.toJSON()); }\r\n\r\n public static getInstance<T extends Relationship>(iModel: IModelDb, criteria: Id64String | SourceAndTarget): T { return iModel.relationships.getInstance(this.classFullName, criteria); }\r\n}\r\n\r\n/** A Relationship where one Element refers to another Element\r\n * @public\r\n */\r\nexport class ElementRefersToElements extends Relationship {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementRefersToElements\"; }\r\n /** Create an instance of the Relationship.\r\n * @param iModel The iModel that will contain the relationship\r\n * @param sourceId The sourceId of the relationship, that is, the driver element\r\n * @param targetId The targetId of the relationship, that is, the driven element\r\n * @return an instance of the specified class.\r\n */\r\n public static create<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String): T {\r\n return iModel.relationships.createInstance({ sourceId, targetId, classFullName: this.classFullName }) as T;\r\n }\r\n /** Insert a new instance of the Relationship.\r\n * @param iModel The iModel that will contain the relationship\r\n * @param sourceId The sourceId of the relationship, that is, the driver element\r\n * @param targetId The targetId of the relationship, that is, the driven element\r\n * @return The Id of the inserted Relationship.\r\n */\r\n public static insert<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String): Id64String {\r\n const relationship: T = this.create(iModel, sourceId, targetId);\r\n return iModel.relationships.insertInstance(relationship.toJSON());\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.sourceId);\r\n referenceIds.addElement(this.targetId);\r\n }\r\n}\r\n\r\n/** Relates a [[DrawingGraphic]] to the [[Element]] that it represents\r\n * @public\r\n */\r\nexport class DrawingGraphicRepresentsElement extends ElementRefersToElements {\r\n /** @internal */\r\n public static override get className(): string { return \"DrawingGraphicRepresentsElement\"; }\r\n}\r\n\r\n/** Relates a [[GraphicalElement3d]] to the [[Element]] that it represents\r\n * @public\r\n */\r\nexport class GraphicalElement3dRepresentsElement extends ElementRefersToElements {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalElement3dRepresentsElement\"; }\r\n}\r\n\r\n/** Relates a [[SynchronizationConfigLink]] to N [[ExternalSource]] instances.\r\n * Each relationship instance represents an external source processed by the synchronization configuration.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class SynchronizationConfigProcessesSources extends ElementRefersToElements {\r\n /** @internal */\r\n public static override get className(): string { return \"SynchronizationConfigProcessesSources\"; }\r\n}\r\n\r\n/** Relates a [[SynchronizationConfigLink]] to *root* [[ExternalSource]] instances.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class SynchronizationConfigSpecifiesRootSources extends SynchronizationConfigProcessesSources {\r\n /** @internal */\r\n public static override get className(): string { return \"SynchronizationConfigSpecifiesRootSources\"; }\r\n}\r\n\r\n/** Properties that are common to all types of link table ECRelationships\r\n * @public\r\n */\r\nexport interface ElementGroupsMembersProps extends RelationshipProps {\r\n memberPriority: number;\r\n}\r\n\r\n/** An ElementRefersToElements relationship where one Element *groups* a set of other Elements.\r\n * @public\r\n */\r\nexport class ElementGroupsMembers extends ElementRefersToElements {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementGroupsMembers\"; }\r\n public memberPriority: number;\r\n\r\n constructor(props: ElementGroupsMembersProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.memberPriority = props.memberPriority;\r\n }\r\n\r\n public static override create<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String, memberPriority: number = 0): T {\r\n const props: ElementGroupsMembersProps = { sourceId, targetId, memberPriority, classFullName: this.classFullName };\r\n return iModel.relationships.createInstance(props) as T;\r\n }\r\n}\r\n\r\n/** Relates a [[DefinitionGroup]] to its [[DefinitionElement]] members.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.10\r\n * @public\r\n */\r\nexport class DefinitionGroupGroupsDefinitions extends ElementGroupsMembers {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionGroupGroupsDefinitions\"; }\r\n}\r\n\r\n/** Represents group membership where the group Element (and its properties) impart information about the member Elements above mere membership.\r\n * Implies that properties of the group should be considered as properties of its members.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.11\r\n * @public\r\n */\r\nexport class GroupImpartsToMembers extends ElementGroupsMembers {\r\n /** @internal */\r\n public static override get className(): string { return \"GroupImpartsToMembers\"; }\r\n}\r\n\r\n/** Relates an [[ExternalSourceGroup]] to its [[ExternalSource]] members.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceGroupGroupsSources extends ElementGroupsMembers {\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceGroupGroupsSources\"; }\r\n}\r\n\r\n/** Properties that are common to all types of ElementDrivesElements\r\n * @beta\r\n */\r\nexport interface ElementDrivesElementProps extends RelationshipProps {\r\n status: number;\r\n priority: number;\r\n}\r\n\r\n/** A Relationship indicating that one Element *drives* another Element.\r\n * An ElementDrivesElement relationship defines a one-way \"driving\" relationship from the source to the target.\r\n * When the source of an ElementDrivesElement relationship changes, the ElementDrivesElement itself can get a callback, and both the source and target elements can get callbacks.\r\n * By inserting ElementDrivesElement relationships, an app can create and store an acyclic directed graph of dependencies between elements.\r\n *\r\n * # Defining dependencies\r\n * Create an ElementDrivesElement relationship to specify that the source element drives the target element.\r\n * For example, to specify that element e1 drives element e2, create a relationship between them like this:\r\n * ```ts\r\n * const ede = ElementDrivesElement.create(iModel, e1id, e2id);\r\n * ede.insert();\r\n * ```\r\n * This creates a persistent relationship. The fact that e1 drives e2 is persisted in the iModel.\r\n *\r\n * # Defining dependency graphs\r\n * When you create multiple ElementDrivesElement relationships, you create a network of dependencies. The target of one may be the source of another.\r\n * A change in the content of an DgnElement can therefore trigger changes to many downstream elements.\r\n *\r\n * For example, to make element e1 drive element e2 and e2 drive another element, e3, create two relationships like this:\r\n * ```ts\r\n * const ede12 = ElementDrivesElement.create(iModel, e1id, e2id);\r\n * const ede23 = ElementDrivesElement.create(iModel, e2id, e3id);\r\n * ede12.insert();\r\n * ede23.insert();\r\n * ```\r\n * Those two relationships create this graph:\r\n * ```\r\n * e1 --> e2 --> e3\r\n * ```\r\n * Where the \"-->\" is meant to represent a driving relationship.\r\n *\r\n * The order in which you create the relationships does not matter.\r\n * The graph indicates that e3 depends on e2 and e2 depends on e1.\r\n *\r\n * An ElementDrivesElement relationship is between one source element and one target element.\r\n * Many ElementDrivesElement relationships can point to a given element, and many can point out of it.\r\n * Thus, you can define many:many relationships.\r\n * For example:\r\n * ```ts\r\n * const ede12 = ElementDrivesElement.create(iModel, e1id, e2id);\r\n * const ede112 = ElementDrivesElement.create(iModel, e11id, e2id);\r\n * const ede23 = ElementDrivesElement.create(iModel, e2id, e3id);\r\n * const ede231 = ElementDrivesElement.create(iModel, e2id, e31id);\r\n * ede12.insert();\r\n * ede112.insert();\r\n * ede23.insert();\r\n * ede231.insert();\r\n * ```\r\n * Creates this graph:\r\n * ```\r\n * e1 e3\r\n * \\ /\r\n * e2\r\n * / \\\r\n * e11 e31\r\n * ```\r\n * e2 depends on both e1 and e11. e2 then drives e3 and e31.\r\n *\r\n * In an ElementDrivesElement dependency graph, the relationships are the \"edges\" and the Elements are the \"nodes\".\r\n * The following terms are used when referring to the elements (nodes) in a dependency graph:\r\n * * Inputs - The sources of all edges that point to the element. This includes all upstream elements that flow into the element.\r\n * * Outputs - The targets of all edges that point out of the element. This includes all downstream elements.\r\n *\r\n * # Subgraph Processing\r\n * When changes are made, only the part of the overall graph that is affected will be processed. So, for example,\r\n * suppose we have this graph:\r\n * ```\r\n * e1 --> e2 --> e3\r\n * ```\r\n * If e1 changes, then the subgraph to be processed is equal to the full graph, as shown.\r\n *\r\n * If only e2 changes, then the subgraph to be processed is just:\r\n * ```\r\n * e2 --> e3\r\n * ```\r\n * If only e3 changes, then the subgraph consists of e3 by itself.\r\n *\r\n * Returning to the second example above, suppose we have this graph:\r\n * ```\r\n * e1 e3\r\n * \\ /\r\n * e2\r\n * / \\\r\n * e11 e31\r\n * ```\r\n * If e1 is changed, the affected subgraph is:\r\n * ```\r\n * e1 e3\r\n * \\ /\r\n * e2\r\n * \\\r\n * e31\r\n * ```\r\n * If e2 is changed, the affected subgraph is:\r\n * ```\r\n * e3\r\n * /\r\n * e2\r\n * \\\r\n * e31\r\n * ```\r\n * # Callbacks\r\n * Once the affected subgraph to process is found, it propagates changes through it by making callbacks.\r\n * Classes for both elements (nodes) and ElementDrivesElements relationships (edges) can receive callbacks.\r\n *\r\n * ## ElementDrivesElement Callbacks\r\n * The following callbacks are invoked on ElementDrivesElement relationship classes (edges):\r\n * * onRootChanged\r\n * * onDeletedDependency\r\n *\r\n * Note that these are static methods. Their default implementations do nothing.\r\n * To receive and act on these callbacks, a domain should define a subclass of ElementDrivesElement and use that to create relationships.\r\n * The subclass should then implement the callbacks that it would like to act on.\r\n *\r\n * A ElementDrivesElement subclass callback is expected to make changes to the output element only!\r\n *\r\n * ## Element Callbacks\r\n * The following callbacks are invoked on Element classes (nodes):\r\n * * Element.onBeforeOutputsHandled\r\n * * Element.onAllInputsHandled\r\n *\r\n * ## Order\r\n * Callbacks are invoked by BriefcaseDb.saveChanges.\r\n * They are invoked in dependency (topological) order: driving elements first, then driven elements.\r\n *\r\n * Each callback is invoked only once. No matter how many times a given element was changed during the transaction,\r\n * a callback such as ElementDrivesElement.onRootChanged will be invoked only once.\r\n * In the same way, no matter how many of its inputs were changed, a callback such as Element.onAllInputsHandled will be\r\n * invoked only once.\r\n *\r\n * For example, suppose we have a graph:\r\n * ```\r\n * e1 --> e2 --> e3\r\n * ```\r\n *\r\n * Suppose that e1 is directly modified. No callbacks are made at that time.\r\n * Later, when BriefcaseDb.saveChanges is called, the following callbacks are made, in order:\r\n * 1. Element.onBeforeOutputsHandled e1\r\n * 1. ElementDrivesElement.onRootChanged e1->e2\r\n * 1. Element.onAllInputsHandled e2\r\n * 1. ElementDrivesElement.onRootChanged e2->e3\r\n * 1. Element.onAllInputsHandled e3\r\n *\r\n * Suppose that e3 is modified directly and BriefcaseDb.saveChanges is called.\r\n * Since no input to a relationship was changed, the sub-graph will be empty, and no callbacks will be made.\r\n *\r\n * Returning to the second example above, suppose we have this graph:\r\n * ```\r\n * e1 e3\r\n * \\ /\r\n * e2\r\n * / \\\r\n * e11 e31\r\n * ```\r\n * If e1 is changed and BriefcaseDb.saveChanges is called, the subgraph is:\r\n * ```\r\n * e1 e3\r\n * \\ /\r\n * e2\r\n * \\\r\n * e31\r\n * ```\r\n * The callbacks are:\r\n * 1. Element.onBeforeOutputsHandled e1\r\n * 1. ElementDrivesElement.onRootChanged e1->e2\r\n * 1. Element.onAllInputsHandled e2\r\n * 1. ElementDrivesElement.onRootChanged e2->e3\r\n * 1. Element.onAllInputsHandled e3\r\n * 1. ElementDrivesElement.onRootChanged e2->e31\r\n * 1. Element.onAllInputsHandled e31\r\n *\r\n * (The ElementDrivesElement.)\r\n *\r\n * #Errors\r\n * Circular dependencies are not permitted. If a cycle is detected, that is treated as a fatal error. All ElementDrivesElement relationships\r\n * involved in a cycle will have their status set to 1, indicating a failure.\r\n *\r\n * A callback may call txnManager.reportError to reject an invalid change. It can classify the error as fatal or just a warning.\r\n * A callback make set the status value of an ElementDrivesElement instance to 1 to indicate a processing failure in that edge.\r\n *\r\n * After BriefcaseDb.saveChanges is called, an app should check db.txns.validationErrors and db.txns.hasFatalError to find out if graph-evaluation failed.\r\n *\r\n * @beta\r\n */\r\nexport class ElementDrivesElement extends Relationship {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementDrivesElement\"; }\r\n /** Relationship status\r\n * * 0 indicates no errors. Set after a successful evaluation.\r\n * * 1 indicates that this driving relationship could not be evaluated. The callback itself can set this to indicate that it failed to process the input changes. Also, it is set if the relationship is part of a circular dependency.\r\n * * 0x80 The app or callback can set this to indicate to not propagate changes through this relationship.\r\n */\r\n public status: number;\r\n /** Affects the order in which relationships are processed in the case where two relationships have the same output. */\r\n public priority: number;\r\n\r\n protected constructor(props: ElementDrivesElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.status = props.status;\r\n this.priority = props.priority;\r\n }\r\n\r\n public static create<T extends ElementDrivesElement>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String, priority: number = 0): T {\r\n const props: ElementDrivesElementProps = { sourceId, targetId, priority, status: 0, classFullName: this.classFullName };\r\n return iModel.relationships.createInstance(props) as T;\r\n }\r\n\r\n public override toJSON(): ElementDrivesElementProps {\r\n const props = super.toJSON() as ElementDrivesElementProps;\r\n props.status = this.status;\r\n props.priority = this.priority;\r\n return props;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.sourceId);\r\n referenceIds.addElement(this.targetId);\r\n }\r\n}\r\n\r\n/** The third (and last) possible link-table relationship base class in an iModel.\r\n * Has no external use, but is included for completeness of the [Entity.collectReferenceIds]($backend)\r\n * implementations for link-table relationships. Generating the types of the source and target automatically would require\r\n * coupling this package with ecschema-metadata which we do not want to do.\r\n * @internal\r\n */\r\nexport class ModelSelectorRefersToModels extends Relationship {\r\n /** @internal */\r\n public static override get className(): string { return \"ModelSelectorRefersToModels\"; }\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.sourceId);\r\n referenceIds.addModel(this.targetId);\r\n }\r\n}\r\n\r\n/** Manages [[Relationship]]s.\r\n * @public\r\n */\r\nexport class Relationships {\r\n private _iModel: IModelDb;\r\n\r\n /** @internal */\r\n public constructor(iModel: IModelDb) { this._iModel = iModel; }\r\n\r\n /** Create a new instance of a Relationship.\r\n * @param props The properties of the new Relationship.\r\n * @throws [[IModelError]] if there is a problem creating the Relationship.\r\n */\r\n public createInstance(props: RelationshipProps): Relationship { return this._iModel.constructEntity<Relationship>(props); }\r\n\r\n /** Check classFullName to ensure it is a link table relationship class. */\r\n private checkRelationshipClass(classFullName: string) {\r\n if (!this._iModel.nativeDb.isLinkTableRelationship(classFullName.replace(\".\", \":\"))) {\r\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Class '${classFullName}' must be a relationship class and it should be subclass of BisCore:ElementRefersToElements or BisCore:ElementDrivesElement.`);\r\n }\r\n }\r\n\r\n /** Insert a new relationship instance into the iModel. The relationship provided must be subclass of BisCore:ElementRefersToElements or BisCore:ElementDrivesElement.\r\n * @param props The properties of the new relationship.\r\n * @returns The Id of the newly inserted relationship.\r\n * @note The id property of the props object is set as a side effect of this function.\r\n */\r\n public insertInstance(props: RelationshipProps): Id64String {\r\n this.checkRelationshipClass(props.classFullName);\r\n return props.id = this._iModel.nativeDb.insertLinkTableRelationship(props);\r\n }\r\n\r\n /** Update the properties of an existing relationship instance in the iModel.\r\n * @param props the properties of the relationship instance to update. Any properties that are not present will be left unchanged.\r\n */\r\n public updateInstance(props: RelationshipProps): void {\r\n this._iModel.nativeDb.updateLinkTableRelationship(props);\r\n }\r\n\r\n /** Delete an Relationship instance from this iModel. */\r\n public deleteInstance(props: RelationshipProps): void {\r\n this._iModel.nativeDb.deleteLinkTableRelationship(props);\r\n }\r\n\r\n /** Get the props of a Relationship instance\r\n * @param relClassFullName The full class name of the relationship in the form of \"schema:class\"\r\n * @param criteria Either the relationship instanceId or the source and target Ids\r\n * @throws [IModelError]($common) if the relationship is not found or cannot be loaded.\r\n * @see tryGetInstanceProps\r\n */\r\n public getInstanceProps<T extends RelationshipProps>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T {\r\n const relationshipProps = this.tryGetInstanceProps<T>(relClassFullName, criteria);\r\n if (undefined === relationshipProps) {\r\n throw new IModelError(IModelStatus.NotFound, \"Relationship not found\");\r\n }\r\n return relationshipProps;\r\n }\r\n\r\n /** Get the props of a Relationship instance\r\n * @param relClassFullName The full class name of the relationship in the form of \"schema:class\"\r\n * @param criteria Either the relationship instanceId or the source and target Ids\r\n * @returns The RelationshipProps or `undefined` if the relationship is not found.\r\n * @note Useful for cases when a relationship may or may not exist and throwing an `Error` would be overkill.\r\n * @see getInstanceProps\r\n */\r\n public tryGetInstanceProps<T extends RelationshipProps>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T | undefined {\r\n let props: T | undefined;\r\n if (typeof criteria === \"string\") {\r\n props = this._iModel.withPreparedStatement(`SELECT * FROM ${relClassFullName} WHERE ecinstanceid=?`, (stmt: ECSqlStatement) => {\r\n stmt.bindId(1, criteria);\r\n return DbResult.BE_SQLITE_ROW === stmt.step() ? stmt.getRow() as T : undefined;\r\n });\r\n } else {\r\n props = this._iModel.withPreparedStatement(`SELECT * FROM ${relClassFullName} WHERE SourceECInstanceId=? AND TargetECInstanceId=?`, (stmt: ECSqlStatement) => {\r\n stmt.bindId(1, criteria.sourceId);\r\n stmt.bindId(2, criteria.targetId);\r\n return DbResult.BE_SQLITE_ROW === stmt.step() ? stmt.getRow() as T : undefined;\r\n });\r\n }\r\n if (undefined !== props) {\r\n props.classFullName = (props as any).className.replace(\".\", \":\");\r\n }\r\n return props;\r\n }\r\n\r\n /** Get a Relationship instance\r\n * @param relClassFullName The full class name of the relationship in the form of \"schema:class\"\r\n * @param criteria Either the relationship instanceId or the source and target Ids\r\n * @throws [IModelError]($common) if the relationship is not found or cannot be loaded.\r\n * @see tryGetInstance\r\n */\r\n public getInstance<T extends Relationship>(relClassSqlName: string, criteria: Id64String | SourceAndTarget): T {\r\n return this._iModel.constructEntity<T>(this.getInstanceProps(relClassSqlName, criteria));\r\n }\r\n\r\n /** Get a Relationship instance\r\n * @param relClassFullName The full class name of the relationship in the form of \"schema:class\"\r\n * @param criteria Either the relationship instanceId or the source and target Ids\r\n * @returns The relationship or `undefined` if the relationship is not found.\r\n * @note Useful for cases when a relationship may or may not exist and throwing an `Error` would be overkill.\r\n * @see getInstance\r\n */\r\n public tryGetInstance<T extends Relationship>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T | undefined {\r\n const relationshipProps = this.tryGetInstanceProps<RelationshipProps>(relClassFullName, criteria);\r\n return undefined !== relationshipProps ? this._iModel.constructEntity<T>(relationshipProps) : undefined;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Relationship.js","sourceRoot":"","sources":["../../src/Relationship.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAiE;AACjE,oDAAuH;AAEvH,qCAAkC;AAElC,gDAA+C;AAI/C;;GAEG;AACH,MAAa,YAAa,SAAQ,eAAM;IAC/B,MAAM,KAAc,SAAS,KAAa,OAAO,cAAc,CAAC,CAA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MAAM,EAAO,CAAC,CAAC,CAAC,SAAS,CAAC;YACjF,CAAC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;YACxB,KAAK,CAAC,aAAa,GAAI,KAAa,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,WAAW,CAAyB,eAAuB,EAAE,QAAsC;QACxG,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAI,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;OAMG;IACI,cAAc,CAAyB,gBAAwB,EAAE,QAAsC;QAC5G,MAAM,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,CAAoB,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAClG,OAAO,SAAS,KAAK,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1G,CAAC;CACF;AAvGD,sCAuGC","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 Relationships\r\n */\r\n\r\nimport { DbResult, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { EntityReferenceSet, IModelError, IModelStatus, RelationshipProps, SourceAndTarget } from \"@itwin/core-common\";\r\nimport { ECSqlStatement } from \"./ECSqlStatement\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\n\r\nexport type { SourceAndTarget, RelationshipProps } from \"@itwin/core-common\"; // for backwards compatibility\r\n\r\n/** Base class for all link table ECRelationships\r\n * @public\r\n */\r\nexport class Relationship extends Entity {\r\n public static override get className(): string { return \"Relationship\"; }\r\n public readonly sourceId: Id64String;\r\n public readonly targetId: Id64String;\r\n\r\n protected constructor(props: RelationshipProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.sourceId = Id64.fromJSON(props.sourceId);\r\n this.targetId = Id64.fromJSON(props.targetId);\r\n }\r\n\r\n public override toJSON(): RelationshipProps {\r\n const val = super.toJSON() as RelationshipProps;\r\n val.sourceId = this.sourceId;\r\n val.targetId = this.targetId;\r\n return val;\r\n }\r\n\r\n /**\r\n * Callback invoked by saveChanges on an ElementDrivesElement relationship when its input has changed or is the output of some upstream relationship whose input has changed.\r\n * This callback is invoked after the input element has been processed by upstream relationships.\r\n * A subclass of ElementDrivesElement can re-implement this static method to take some action. onRootChanged may modify the output element only.\r\n * @param _props The ElementDrivesElement relationship instance.\r\n * @param _iModel The iModel\r\n */\r\n public static onRootChanged(_props: RelationshipProps, _iModel: IModelDb): void { }\r\n\r\n /**\r\n * Callback invoked by saveChanges on an ElementDrivesElement relationship when the relationship instance has been deleted.\r\n * A subclass of ElementDrivesElement can re-implement this static method to take some action.\r\n * @param _props The deleted ElementDrivesElement relationship instance.\r\n * @param _iModel The iModel\r\n */\r\n public static onDeletedDependency(_props: RelationshipProps, _iModel: IModelDb): void { }\r\n\r\n /** Insert this Relationship into the iModel. */\r\n public insert(): Id64String { return this.id = this.iModel.relationships.insertInstance(this.toJSON()); }\r\n /** Update this Relationship in the iModel. */\r\n public update() { this.iModel.relationships.updateInstance(this.toJSON()); }\r\n /** Delete this Relationship from the iModel. */\r\n public delete() { this.iModel.relationships.deleteInstance(this.toJSON()); }\r\n\r\n public static getInstance<T extends Relationship>(iModel: IModelDb, criteria: Id64String | SourceAndTarget): T { return iModel.relationships.getInstance(this.classFullName, criteria); }\r\n}\r\n\r\n/** A Relationship where one Element refers to another Element\r\n * @public\r\n */\r\nexport class ElementRefersToElements extends Relationship {\r\n public static override get className(): string { return \"ElementRefersToElements\"; }\r\n /** Create an instance of the Relationship.\r\n * @param iModel The iModel that will contain the relationship\r\n * @param sourceId The sourceId of the relationship, that is, the driver element\r\n * @param targetId The targetId of the relationship, that is, the driven element\r\n * @return an instance of the specified class.\r\n */\r\n public static create<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String): T {\r\n return iModel.relationships.createInstance({ sourceId, targetId, classFullName: this.classFullName }) as T;\r\n }\r\n /** Insert a new instance of the Relationship.\r\n * @param iModel The iModel that will contain the relationship\r\n * @param sourceId The sourceId of the relationship, that is, the driver element\r\n * @param targetId The targetId of the relationship, that is, the driven element\r\n * @return The Id of the inserted Relationship.\r\n */\r\n public static insert<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String): Id64String {\r\n const relationship: T = this.create(iModel, sourceId, targetId);\r\n return iModel.relationships.insertInstance(relationship.toJSON());\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.sourceId);\r\n referenceIds.addElement(this.targetId);\r\n }\r\n}\r\n\r\n/** Relates a [[DrawingGraphic]] to the [[Element]] that it represents\r\n * @public\r\n */\r\nexport class DrawingGraphicRepresentsElement extends ElementRefersToElements {\r\n public static override get className(): string { return \"DrawingGraphicRepresentsElement\"; }\r\n}\r\n\r\n/** Relates a [[GraphicalElement3d]] to the [[Element]] that it represents\r\n * @public\r\n */\r\nexport class GraphicalElement3dRepresentsElement extends ElementRefersToElements {\r\n public static override get className(): string { return \"GraphicalElement3dRepresentsElement\"; }\r\n}\r\n\r\n/** Relates a [[SynchronizationConfigLink]] to N [[ExternalSource]] instances.\r\n * Each relationship instance represents an external source processed by the synchronization configuration.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class SynchronizationConfigProcessesSources extends ElementRefersToElements {\r\n public static override get className(): string { return \"SynchronizationConfigProcessesSources\"; }\r\n}\r\n\r\n/** Relates a [[SynchronizationConfigLink]] to *root* [[ExternalSource]] instances.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class SynchronizationConfigSpecifiesRootSources extends SynchronizationConfigProcessesSources {\r\n public static override get className(): string { return \"SynchronizationConfigSpecifiesRootSources\"; }\r\n}\r\n\r\n/** Properties that are common to all types of link table ECRelationships\r\n * @public\r\n */\r\nexport interface ElementGroupsMembersProps extends RelationshipProps {\r\n memberPriority: number;\r\n}\r\n\r\n/** An ElementRefersToElements relationship where one Element *groups* a set of other Elements.\r\n * @public\r\n */\r\nexport class ElementGroupsMembers extends ElementRefersToElements {\r\n public static override get className(): string { return \"ElementGroupsMembers\"; }\r\n public memberPriority: number;\r\n\r\n constructor(props: ElementGroupsMembersProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.memberPriority = props.memberPriority;\r\n }\r\n\r\n public static override create<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String, memberPriority: number = 0): T {\r\n const props: ElementGroupsMembersProps = { sourceId, targetId, memberPriority, classFullName: this.classFullName };\r\n return iModel.relationships.createInstance(props) as T;\r\n }\r\n}\r\n\r\n/** Relates a [[DefinitionGroup]] to its [[DefinitionElement]] members.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.10\r\n * @public\r\n */\r\nexport class DefinitionGroupGroupsDefinitions extends ElementGroupsMembers {\r\n public static override get className(): string { return \"DefinitionGroupGroupsDefinitions\"; }\r\n}\r\n\r\n/** Represents group membership where the group Element (and its properties) impart information about the member Elements above mere membership.\r\n * Implies that properties of the group should be considered as properties of its members.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.11\r\n * @public\r\n */\r\nexport class GroupImpartsToMembers extends ElementGroupsMembers {\r\n public static override get className(): string { return \"GroupImpartsToMembers\"; }\r\n}\r\n\r\n/** Relates an [[ExternalSourceGroup]] to its [[ExternalSource]] members.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceGroupGroupsSources extends ElementGroupsMembers {\r\n public static override get className(): string { return \"ExternalSourceGroupGroupsSources\"; }\r\n}\r\n\r\n/** Properties that are common to all types of ElementDrivesElements\r\n * @beta\r\n */\r\nexport interface ElementDrivesElementProps extends RelationshipProps {\r\n status: number;\r\n priority: number;\r\n}\r\n\r\n/** A Relationship indicating that one Element *drives* another Element.\r\n * An ElementDrivesElement relationship defines a one-way \"driving\" relationship from the source to the target.\r\n * When the source of an ElementDrivesElement relationship changes, the ElementDrivesElement itself can get a callback, and both the source and target elements can get callbacks.\r\n * By inserting ElementDrivesElement relationships, an app can create and store an acyclic directed graph of dependencies between elements.\r\n *\r\n * # Defining dependencies\r\n * Create an ElementDrivesElement relationship to specify that the source element drives the target element.\r\n * For example, to specify that element e1 drives element e2, create a relationship between them like this:\r\n * ```ts\r\n * const ede = ElementDrivesElement.create(iModel, e1id, e2id);\r\n * ede.insert();\r\n * ```\r\n * This creates a persistent relationship. The fact that e1 drives e2 is persisted in the iModel.\r\n *\r\n * # Defining dependency graphs\r\n * When you create multiple ElementDrivesElement relationships, you create a network of dependencies. The target of one may be the source of another.\r\n * A change in the content of an DgnElement can therefore trigger changes to many downstream elements.\r\n *\r\n * For example, to make element e1 drive element e2 and e2 drive another element, e3, create two relationships like this:\r\n * ```ts\r\n * const ede12 = ElementDrivesElement.create(iModel, e1id, e2id);\r\n * const ede23 = ElementDrivesElement.create(iModel, e2id, e3id);\r\n * ede12.insert();\r\n * ede23.insert();\r\n * ```\r\n * Those two relationships create this graph:\r\n * ```\r\n * e1 --> e2 --> e3\r\n * ```\r\n * Where the \"-->\" is meant to represent a driving relationship.\r\n *\r\n * The order in which you create the relationships does not matter.\r\n * The graph indicates that e3 depends on e2 and e2 depends on e1.\r\n *\r\n * An ElementDrivesElement relationship is between one source element and one target element.\r\n * Many ElementDrivesElement relationships can point to a given element, and many can point out of it.\r\n * Thus, you can define many:many relationships.\r\n * For example:\r\n * ```ts\r\n * const ede12 = ElementDrivesElement.create(iModel, e1id, e2id);\r\n * const ede112 = ElementDrivesElement.create(iModel, e11id, e2id);\r\n * const ede23 = ElementDrivesElement.create(iModel, e2id, e3id);\r\n * const ede231 = ElementDrivesElement.create(iModel, e2id, e31id);\r\n * ede12.insert();\r\n * ede112.insert();\r\n * ede23.insert();\r\n * ede231.insert();\r\n * ```\r\n * Creates this graph:\r\n * ```\r\n * e1 e3\r\n * \\ /\r\n * e2\r\n * / \\\r\n * e11 e31\r\n * ```\r\n * e2 depends on both e1 and e11. e2 then drives e3 and e31.\r\n *\r\n * In an ElementDrivesElement dependency graph, the relationships are the \"edges\" and the Elements are the \"nodes\".\r\n * The following terms are used when referring to the elements (nodes) in a dependency graph:\r\n * * Inputs - The sources of all edges that point to the element. This includes all upstream elements that flow into the element.\r\n * * Outputs - The targets of all edges that point out of the element. This includes all downstream elements.\r\n *\r\n * # Subgraph Processing\r\n * When changes are made, only the part of the overall graph that is affected will be processed. So, for example,\r\n * suppose we have this graph:\r\n * ```\r\n * e1 --> e2 --> e3\r\n * ```\r\n * If e1 changes, then the subgraph to be processed is equal to the full graph, as shown.\r\n *\r\n * If only e2 changes, then the subgraph to be processed is just:\r\n * ```\r\n * e2 --> e3\r\n * ```\r\n * If only e3 changes, then the subgraph consists of e3 by itself.\r\n *\r\n * Returning to the second example above, suppose we have this graph:\r\n * ```\r\n * e1 e3\r\n * \\ /\r\n * e2\r\n * / \\\r\n * e11 e31\r\n * ```\r\n * If e1 is changed, the affected subgraph is:\r\n * ```\r\n * e1 e3\r\n * \\ /\r\n * e2\r\n * \\\r\n * e31\r\n * ```\r\n * If e2 is changed, the affected subgraph is:\r\n * ```\r\n * e3\r\n * /\r\n * e2\r\n * \\\r\n * e31\r\n * ```\r\n * # Callbacks\r\n * Once the affected subgraph to process is found, it propagates changes through it by making callbacks.\r\n * Classes for both elements (nodes) and ElementDrivesElements relationships (edges) can receive callbacks.\r\n *\r\n * ## ElementDrivesElement Callbacks\r\n * The following callbacks are invoked on ElementDrivesElement relationship classes (edges):\r\n * * onRootChanged\r\n * * onDeletedDependency\r\n *\r\n * Note that these are static methods. Their default implementations do nothing.\r\n * To receive and act on these callbacks, a domain should define a subclass of ElementDrivesElement and use that to create relationships.\r\n * The subclass should then implement the callbacks that it would like to act on.\r\n *\r\n * A ElementDrivesElement subclass callback is expected to make changes to the output element only!\r\n *\r\n * ## Element Callbacks\r\n * The following callbacks are invoked on Element classes (nodes):\r\n * * Element.onBeforeOutputsHandled\r\n * * Element.onAllInputsHandled\r\n *\r\n * ## Order\r\n * Callbacks are invoked by BriefcaseDb.saveChanges.\r\n * They are invoked in dependency (topological) order: driving elements first, then driven elements.\r\n *\r\n * Each callback is invoked only once. No matter how many times a given element was changed during the transaction,\r\n * a callback such as ElementDrivesElement.onRootChanged will be invoked only once.\r\n * In the same way, no matter how many of its inputs were changed, a callback such as Element.onAllInputsHandled will be\r\n * invoked only once.\r\n *\r\n * For example, suppose we have a graph:\r\n * ```\r\n * e1 --> e2 --> e3\r\n * ```\r\n *\r\n * Suppose that e1 is directly modified. No callbacks are made at that time.\r\n * Later, when BriefcaseDb.saveChanges is called, the following callbacks are made, in order:\r\n * 1. Element.onBeforeOutputsHandled e1\r\n * 1. ElementDrivesElement.onRootChanged e1->e2\r\n * 1. Element.onAllInputsHandled e2\r\n * 1. ElementDrivesElement.onRootChanged e2->e3\r\n * 1. Element.onAllInputsHandled e3\r\n *\r\n * Suppose that e3 is modified directly and BriefcaseDb.saveChanges is called.\r\n * Since no input to a relationship was changed, the sub-graph will be empty, and no callbacks will be made.\r\n *\r\n * Returning to the second example above, suppose we have this graph:\r\n * ```\r\n * e1 e3\r\n * \\ /\r\n * e2\r\n * / \\\r\n * e11 e31\r\n * ```\r\n * If e1 is changed and BriefcaseDb.saveChanges is called, the subgraph is:\r\n * ```\r\n * e1 e3\r\n * \\ /\r\n * e2\r\n * \\\r\n * e31\r\n * ```\r\n * The callbacks are:\r\n * 1. Element.onBeforeOutputsHandled e1\r\n * 1. ElementDrivesElement.onRootChanged e1->e2\r\n * 1. Element.onAllInputsHandled e2\r\n * 1. ElementDrivesElement.onRootChanged e2->e3\r\n * 1. Element.onAllInputsHandled e3\r\n * 1. ElementDrivesElement.onRootChanged e2->e31\r\n * 1. Element.onAllInputsHandled e31\r\n *\r\n * (The ElementDrivesElement.)\r\n *\r\n * #Errors\r\n * Circular dependencies are not permitted. If a cycle is detected, that is treated as a fatal error. All ElementDrivesElement relationships\r\n * involved in a cycle will have their status set to 1, indicating a failure.\r\n *\r\n * A callback may call txnManager.reportError to reject an invalid change. It can classify the error as fatal or just a warning.\r\n * A callback make set the status value of an ElementDrivesElement instance to 1 to indicate a processing failure in that edge.\r\n *\r\n * After BriefcaseDb.saveChanges is called, an app should check db.txns.validationErrors and db.txns.hasFatalError to find out if graph-evaluation failed.\r\n *\r\n * @beta\r\n */\r\nexport class ElementDrivesElement extends Relationship {\r\n public static override get className(): string { return \"ElementDrivesElement\"; }\r\n /** Relationship status\r\n * * 0 indicates no errors. Set after a successful evaluation.\r\n * * 1 indicates that this driving relationship could not be evaluated. The callback itself can set this to indicate that it failed to process the input changes. Also, it is set if the relationship is part of a circular dependency.\r\n * * 0x80 The app or callback can set this to indicate to not propagate changes through this relationship.\r\n */\r\n public status: number;\r\n /** Affects the order in which relationships are processed in the case where two relationships have the same output. */\r\n public priority: number;\r\n\r\n protected constructor(props: ElementDrivesElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.status = props.status;\r\n this.priority = props.priority;\r\n }\r\n\r\n public static create<T extends ElementDrivesElement>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String, priority: number = 0): T {\r\n const props: ElementDrivesElementProps = { sourceId, targetId, priority, status: 0, classFullName: this.classFullName };\r\n return iModel.relationships.createInstance(props) as T;\r\n }\r\n\r\n public override toJSON(): ElementDrivesElementProps {\r\n const props = super.toJSON() as ElementDrivesElementProps;\r\n props.status = this.status;\r\n props.priority = this.priority;\r\n return props;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.sourceId);\r\n referenceIds.addElement(this.targetId);\r\n }\r\n}\r\n\r\n/** The third (and last) possible link-table relationship base class in an iModel.\r\n * Has no external use, but is included for completeness of the [Entity.collectReferenceIds]($backend)\r\n * implementations for link-table relationships. Generating the types of the source and target automatically would require\r\n * coupling this package with ecschema-metadata which we do not want to do.\r\n * @internal\r\n */\r\nexport class ModelSelectorRefersToModels extends Relationship {\r\n public static override get className(): string { return \"ModelSelectorRefersToModels\"; }\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.sourceId);\r\n referenceIds.addModel(this.targetId);\r\n }\r\n}\r\n\r\n/** Manages [[Relationship]]s.\r\n * @public\r\n */\r\nexport class Relationships {\r\n private _iModel: IModelDb;\r\n\r\n /** @internal */\r\n public constructor(iModel: IModelDb) { this._iModel = iModel; }\r\n\r\n /** Create a new instance of a Relationship.\r\n * @param props The properties of the new Relationship.\r\n * @throws [[IModelError]] if there is a problem creating the Relationship.\r\n */\r\n public createInstance(props: RelationshipProps): Relationship { return this._iModel.constructEntity<Relationship>(props); }\r\n\r\n /** Check classFullName to ensure it is a link table relationship class. */\r\n private checkRelationshipClass(classFullName: string) {\r\n if (!this._iModel[_nativeDb].isLinkTableRelationship(classFullName.replace(\".\", \":\"))) {\r\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Class '${classFullName}' must be a relationship class and it should be subclass of BisCore:ElementRefersToElements or BisCore:ElementDrivesElement.`);\r\n }\r\n }\r\n\r\n /** Insert a new relationship instance into the iModel. The relationship provided must be subclass of BisCore:ElementRefersToElements or BisCore:ElementDrivesElement.\r\n * @param props The properties of the new relationship.\r\n * @returns The Id of the newly inserted relationship.\r\n * @note The id property of the props object is set as a side effect of this function.\r\n */\r\n public insertInstance(props: RelationshipProps): Id64String {\r\n this.checkRelationshipClass(props.classFullName);\r\n return props.id = this._iModel[_nativeDb].insertLinkTableRelationship(props);\r\n }\r\n\r\n /** Update the properties of an existing relationship instance in the iModel.\r\n * @param props the properties of the relationship instance to update. Any properties that are not present will be left unchanged.\r\n */\r\n public updateInstance(props: RelationshipProps): void {\r\n this._iModel[_nativeDb].updateLinkTableRelationship(props);\r\n }\r\n\r\n /** Delete an Relationship instance from this iModel. */\r\n public deleteInstance(props: RelationshipProps): void {\r\n this._iModel[_nativeDb].deleteLinkTableRelationship(props);\r\n }\r\n\r\n /** Get the props of a Relationship instance\r\n * @param relClassFullName The full class name of the relationship in the form of \"schema:class\"\r\n * @param criteria Either the relationship instanceId or the source and target Ids\r\n * @throws [IModelError]($common) if the relationship is not found or cannot be loaded.\r\n * @see tryGetInstanceProps\r\n */\r\n public getInstanceProps<T extends RelationshipProps>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T {\r\n const relationshipProps = this.tryGetInstanceProps<T>(relClassFullName, criteria);\r\n if (undefined === relationshipProps) {\r\n throw new IModelError(IModelStatus.NotFound, \"Relationship not found\");\r\n }\r\n return relationshipProps;\r\n }\r\n\r\n /** Get the props of a Relationship instance\r\n * @param relClassFullName The full class name of the relationship in the form of \"schema:class\"\r\n * @param criteria Either the relationship instanceId or the source and target Ids\r\n * @returns The RelationshipProps or `undefined` if the relationship is not found.\r\n * @note Useful for cases when a relationship may or may not exist and throwing an `Error` would be overkill.\r\n * @see getInstanceProps\r\n */\r\n public tryGetInstanceProps<T extends RelationshipProps>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T | undefined {\r\n let props: T | undefined;\r\n if (typeof criteria === \"string\") {\r\n props = this._iModel.withPreparedStatement(`SELECT * FROM ${relClassFullName} WHERE ecinstanceid=?`, (stmt: ECSqlStatement) => {\r\n stmt.bindId(1, criteria);\r\n return DbResult.BE_SQLITE_ROW === stmt.step() ? stmt.getRow() as T : undefined;\r\n });\r\n } else {\r\n props = this._iModel.withPreparedStatement(`SELECT * FROM ${relClassFullName} WHERE SourceECInstanceId=? AND TargetECInstanceId=?`, (stmt: ECSqlStatement) => {\r\n stmt.bindId(1, criteria.sourceId);\r\n stmt.bindId(2, criteria.targetId);\r\n return DbResult.BE_SQLITE_ROW === stmt.step() ? stmt.getRow() as T : undefined;\r\n });\r\n }\r\n if (undefined !== props) {\r\n props.classFullName = (props as any).className.replace(\".\", \":\");\r\n }\r\n return props;\r\n }\r\n\r\n /** Get a Relationship instance\r\n * @param relClassFullName The full class name of the relationship in the form of \"schema:class\"\r\n * @param criteria Either the relationship instanceId or the source and target Ids\r\n * @throws [IModelError]($common) if the relationship is not found or cannot be loaded.\r\n * @see tryGetInstance\r\n */\r\n public getInstance<T extends Relationship>(relClassSqlName: string, criteria: Id64String | SourceAndTarget): T {\r\n return this._iModel.constructEntity<T>(this.getInstanceProps(relClassSqlName, criteria));\r\n }\r\n\r\n /** Get a Relationship instance\r\n * @param relClassFullName The full class name of the relationship in the form of \"schema:class\"\r\n * @param criteria Either the relationship instanceId or the source and target Ids\r\n * @returns The relationship or `undefined` if the relationship is not found.\r\n * @note Useful for cases when a relationship may or may not exist and throwing an `Error` would be overkill.\r\n * @see getInstance\r\n */\r\n public tryGetInstance<T extends Relationship>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T | undefined {\r\n const relationshipProps = this.tryGetInstanceProps<RelationshipProps>(relClassFullName, criteria);\r\n return undefined !== relationshipProps ? this._iModel.constructEntity<T>(relationshipProps) : undefined;\r\n }\r\n}\r\n"]}
@@ -6,13 +6,18 @@ import { DbResult, OpenMode } from "@itwin/core-bentley";
6
6
  import { LocalFileName } from "@itwin/core-common";
7
7
  import { CloudSqlite } from "./CloudSqlite";
8
8
  import { SqliteStatement } from "./SqliteStatement";
9
+ import { _nativeDb } from "./internal/Symbols";
9
10
  /**
10
11
  * A "generic" SQLiteDb. This class may be used to access local files or databases in a cloud container.
11
12
  * @public
12
13
  */
13
14
  export declare class SQLiteDb {
15
+ /** @internal
16
+ * @deprecated in 4.8. This internal API will be removed in 5.0. Use SQLiteDb's public API instead.
17
+ */
18
+ get nativeDb(): IModelJsNative.SQLiteDb;
14
19
  /** @internal */
15
- readonly nativeDb: IModelJsNative.SQLiteDb;
20
+ readonly [_nativeDb]: IModelJsNative.SQLiteDb;
16
21
  private _sqliteStatementCache;
17
22
  /** @internal */
18
23
  static createBlobIO(): SQLiteDb.BlobIO;
@@ -1 +1 @@
1
- {"version":3,"file":"SQLiteDb.d.ts","sourceRoot":"","sources":["../../src/SQLiteDb.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAkB,MAAM,mBAAmB,CAAC;AAMpE;;;GAGG;AACH,qBAAa,QAAQ;IACnB,gBAAgB;IAChB,SAAgB,QAAQ,0BAAsC;IAC9D,OAAO,CAAC,qBAAqB,CAAyC;IAEtE,gBAAgB;WACF,YAAY,IAAI,QAAQ,CAAC,MAAM;IAI7C;;OAEG;IACI,OAAO,IAAI,IAAI;IAItB;;OAEG;IACI,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IACrC,YAAY;IACL,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,YAAY,GAAG,IAAI;IAK7G;;OAEG;IACI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,UAAU,GAAG,IAAI;IAC7E;;;OAGG;IACI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAA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