@itwin/core-backend 5.10.0-dev.8 → 5.10.0

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 (278) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/lib/cjs/BriefcaseManager.d.ts +8 -1
  3. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  4. package/lib/cjs/BriefcaseManager.js.map +1 -1
  5. package/lib/cjs/Category.d.ts +4 -4
  6. package/lib/cjs/Category.js.map +1 -1
  7. package/lib/cjs/ChangesetECAdaptor.d.ts +6 -6
  8. package/lib/cjs/ChangesetECAdaptor.js +4 -4
  9. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  10. package/lib/cjs/ChangesetReader.d.ts +84 -1
  11. package/lib/cjs/ChangesetReader.d.ts.map +1 -1
  12. package/lib/cjs/ChangesetReader.js +108 -12
  13. package/lib/cjs/ChangesetReader.js.map +1 -1
  14. package/lib/cjs/ClassRegistry.d.ts +3 -3
  15. package/lib/cjs/ClassRegistry.js +3 -3
  16. package/lib/cjs/ClassRegistry.js.map +1 -1
  17. package/lib/cjs/CodeSpecs.d.ts +3 -3
  18. package/lib/cjs/CodeSpecs.js.map +1 -1
  19. package/lib/cjs/DisplayStyle.d.ts +2 -2
  20. package/lib/cjs/DisplayStyle.js.map +1 -1
  21. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  22. package/lib/cjs/ECSqlStatement.js +4 -0
  23. package/lib/cjs/ECSqlStatement.js.map +1 -1
  24. package/lib/cjs/ECSqlSyncReader.d.ts.map +1 -1
  25. package/lib/cjs/ECSqlSyncReader.js +1 -0
  26. package/lib/cjs/ECSqlSyncReader.js.map +1 -1
  27. package/lib/cjs/Element.d.ts +16 -13
  28. package/lib/cjs/Element.d.ts.map +1 -1
  29. package/lib/cjs/Element.js +8 -5
  30. package/lib/cjs/Element.js.map +1 -1
  31. package/lib/cjs/ElementAspect.d.ts +1 -1
  32. package/lib/cjs/ElementAspect.js.map +1 -1
  33. package/lib/cjs/ElementTreeWalker.d.ts +5 -5
  34. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  35. package/lib/cjs/Entity.d.ts +13 -5
  36. package/lib/cjs/Entity.d.ts.map +1 -1
  37. package/lib/cjs/Entity.js +13 -5
  38. package/lib/cjs/Entity.js.map +1 -1
  39. package/lib/cjs/ExternalSource.d.ts +2 -2
  40. package/lib/cjs/ExternalSource.js.map +1 -1
  41. package/lib/cjs/IModelDb.d.ts +112 -40
  42. package/lib/cjs/IModelDb.d.ts.map +1 -1
  43. package/lib/cjs/IModelDb.js +215 -42
  44. package/lib/cjs/IModelDb.js.map +1 -1
  45. package/lib/cjs/LineStyle.d.ts +6 -6
  46. package/lib/cjs/LineStyle.js.map +1 -1
  47. package/lib/cjs/LocalHub.d.ts +6 -0
  48. package/lib/cjs/LocalHub.d.ts.map +1 -1
  49. package/lib/cjs/LocalHub.js +23 -0
  50. package/lib/cjs/LocalHub.js.map +1 -1
  51. package/lib/cjs/Material.d.ts +1 -1
  52. package/lib/cjs/Material.js.map +1 -1
  53. package/lib/cjs/Model.d.ts +6 -6
  54. package/lib/cjs/Model.js.map +1 -1
  55. package/lib/cjs/Relationship.d.ts +13 -11
  56. package/lib/cjs/Relationship.d.ts.map +1 -1
  57. package/lib/cjs/Relationship.js +9 -7
  58. package/lib/cjs/Relationship.js.map +1 -1
  59. package/lib/cjs/SheetIndex.d.ts +4 -4
  60. package/lib/cjs/SheetIndex.js.map +1 -1
  61. package/lib/cjs/Texture.d.ts +1 -1
  62. package/lib/cjs/Texture.js.map +1 -1
  63. package/lib/cjs/TxnManager.d.ts.map +1 -1
  64. package/lib/cjs/TxnManager.js +7 -0
  65. package/lib/cjs/TxnManager.js.map +1 -1
  66. package/lib/cjs/ViewDefinition.d.ts +6 -6
  67. package/lib/cjs/ViewDefinition.js.map +1 -1
  68. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +1 -1
  69. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  70. package/lib/cjs/annotations/FrameGeometry.d.ts.map +1 -1
  71. package/lib/cjs/annotations/FrameGeometry.js +2 -3
  72. package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
  73. package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +6 -2
  74. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +1 -0
  75. package/lib/cjs/domains/FunctionalElements.d.ts +1 -1
  76. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  77. package/lib/cjs/domains/GenericElements.d.ts +2 -2
  78. package/lib/cjs/domains/GenericElements.js.map +1 -1
  79. package/lib/cjs/internal/ChannelAdmin.d.ts +2 -2
  80. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  81. package/lib/cjs/internal/ElementLRUCache.d.ts.map +1 -1
  82. package/lib/cjs/internal/ElementLRUCache.js +23 -4
  83. package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
  84. package/lib/cjs/internal/HubMock.d.ts +24 -1
  85. package/lib/cjs/internal/HubMock.d.ts.map +1 -1
  86. package/lib/cjs/internal/HubMock.js +60 -39
  87. package/lib/cjs/internal/HubMock.js.map +1 -1
  88. package/lib/cjs/internal/ServerBasedLocks.d.ts +19 -1
  89. package/lib/cjs/internal/ServerBasedLocks.d.ts.map +1 -1
  90. package/lib/cjs/internal/ServerBasedLocks.js +55 -1
  91. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
  92. package/lib/cjs/internal/cross-package.d.ts +1 -1
  93. package/lib/cjs/internal/cross-package.d.ts.map +1 -1
  94. package/lib/cjs/internal/cross-package.js +1 -2
  95. package/lib/cjs/internal/cross-package.js.map +1 -1
  96. package/lib/cjs/internal/workspace/SettingsSchemasImpl.d.ts.map +1 -1
  97. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +55 -9
  98. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  99. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  100. package/lib/cjs/internal/workspace/WorkspaceImpl.js +7 -11
  101. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  102. package/lib/cjs/workspace/SettingsSchemas.d.ts +20 -3
  103. package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
  104. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  105. package/lib/cjs/workspace/Workspace.d.ts +3 -1
  106. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  107. package/lib/cjs/workspace/Workspace.js.map +1 -1
  108. package/lib/esm/BriefcaseManager.d.ts +8 -1
  109. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  110. package/lib/esm/BriefcaseManager.js.map +1 -1
  111. package/lib/esm/Category.d.ts +4 -4
  112. package/lib/esm/Category.js.map +1 -1
  113. package/lib/esm/ChangesetECAdaptor.d.ts +6 -6
  114. package/lib/esm/ChangesetECAdaptor.js +4 -4
  115. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  116. package/lib/esm/ChangesetReader.d.ts +84 -1
  117. package/lib/esm/ChangesetReader.d.ts.map +1 -1
  118. package/lib/esm/ChangesetReader.js +108 -12
  119. package/lib/esm/ChangesetReader.js.map +1 -1
  120. package/lib/esm/ClassRegistry.d.ts +3 -3
  121. package/lib/esm/ClassRegistry.js +3 -3
  122. package/lib/esm/ClassRegistry.js.map +1 -1
  123. package/lib/esm/CodeSpecs.d.ts +3 -3
  124. package/lib/esm/CodeSpecs.js.map +1 -1
  125. package/lib/esm/DisplayStyle.d.ts +2 -2
  126. package/lib/esm/DisplayStyle.js.map +1 -1
  127. package/lib/esm/ECSqlStatement.d.ts.map +1 -1
  128. package/lib/esm/ECSqlStatement.js +4 -0
  129. package/lib/esm/ECSqlStatement.js.map +1 -1
  130. package/lib/esm/ECSqlSyncReader.d.ts.map +1 -1
  131. package/lib/esm/ECSqlSyncReader.js +1 -0
  132. package/lib/esm/ECSqlSyncReader.js.map +1 -1
  133. package/lib/esm/Element.d.ts +16 -13
  134. package/lib/esm/Element.d.ts.map +1 -1
  135. package/lib/esm/Element.js +8 -5
  136. package/lib/esm/Element.js.map +1 -1
  137. package/lib/esm/ElementAspect.d.ts +1 -1
  138. package/lib/esm/ElementAspect.js.map +1 -1
  139. package/lib/esm/ElementTreeWalker.d.ts +5 -5
  140. package/lib/esm/ElementTreeWalker.js.map +1 -1
  141. package/lib/esm/Entity.d.ts +13 -5
  142. package/lib/esm/Entity.d.ts.map +1 -1
  143. package/lib/esm/Entity.js +13 -5
  144. package/lib/esm/Entity.js.map +1 -1
  145. package/lib/esm/ExternalSource.d.ts +2 -2
  146. package/lib/esm/ExternalSource.js.map +1 -1
  147. package/lib/esm/IModelDb.d.ts +112 -40
  148. package/lib/esm/IModelDb.d.ts.map +1 -1
  149. package/lib/esm/IModelDb.js +216 -43
  150. package/lib/esm/IModelDb.js.map +1 -1
  151. package/lib/esm/LineStyle.d.ts +6 -6
  152. package/lib/esm/LineStyle.js.map +1 -1
  153. package/lib/esm/LocalHub.d.ts +6 -0
  154. package/lib/esm/LocalHub.d.ts.map +1 -1
  155. package/lib/esm/LocalHub.js +23 -0
  156. package/lib/esm/LocalHub.js.map +1 -1
  157. package/lib/esm/Material.d.ts +1 -1
  158. package/lib/esm/Material.js.map +1 -1
  159. package/lib/esm/Model.d.ts +6 -6
  160. package/lib/esm/Model.js.map +1 -1
  161. package/lib/esm/Relationship.d.ts +13 -11
  162. package/lib/esm/Relationship.d.ts.map +1 -1
  163. package/lib/esm/Relationship.js +9 -7
  164. package/lib/esm/Relationship.js.map +1 -1
  165. package/lib/esm/SheetIndex.d.ts +4 -4
  166. package/lib/esm/SheetIndex.js.map +1 -1
  167. package/lib/esm/Texture.d.ts +1 -1
  168. package/lib/esm/Texture.js.map +1 -1
  169. package/lib/esm/TxnManager.d.ts.map +1 -1
  170. package/lib/esm/TxnManager.js +7 -0
  171. package/lib/esm/TxnManager.js.map +1 -1
  172. package/lib/esm/ViewDefinition.d.ts +6 -6
  173. package/lib/esm/ViewDefinition.js.map +1 -1
  174. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +1 -1
  175. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  176. package/lib/esm/annotations/FrameGeometry.d.ts.map +1 -1
  177. package/lib/esm/annotations/FrameGeometry.js +2 -3
  178. package/lib/esm/annotations/FrameGeometry.js.map +1 -1
  179. package/lib/esm/domains/FunctionalElements.d.ts +1 -1
  180. package/lib/esm/domains/FunctionalElements.js.map +1 -1
  181. package/lib/esm/domains/GenericElements.d.ts +2 -2
  182. package/lib/esm/domains/GenericElements.js.map +1 -1
  183. package/lib/esm/internal/ChannelAdmin.d.ts +2 -2
  184. package/lib/esm/internal/ChannelAdmin.js.map +1 -1
  185. package/lib/esm/internal/ElementLRUCache.d.ts.map +1 -1
  186. package/lib/esm/internal/ElementLRUCache.js +23 -4
  187. package/lib/esm/internal/ElementLRUCache.js.map +1 -1
  188. package/lib/esm/internal/HubMock.d.ts +24 -1
  189. package/lib/esm/internal/HubMock.d.ts.map +1 -1
  190. package/lib/esm/internal/HubMock.js +61 -40
  191. package/lib/esm/internal/HubMock.js.map +1 -1
  192. package/lib/esm/internal/ServerBasedLocks.d.ts +19 -1
  193. package/lib/esm/internal/ServerBasedLocks.d.ts.map +1 -1
  194. package/lib/esm/internal/ServerBasedLocks.js +55 -1
  195. package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
  196. package/lib/esm/internal/cross-package.d.ts +1 -1
  197. package/lib/esm/internal/cross-package.d.ts.map +1 -1
  198. package/lib/esm/internal/cross-package.js +1 -1
  199. package/lib/esm/internal/cross-package.js.map +1 -1
  200. package/lib/esm/internal/workspace/SettingsSchemasImpl.d.ts.map +1 -1
  201. package/lib/esm/internal/workspace/SettingsSchemasImpl.js +55 -9
  202. package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  203. package/lib/esm/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  204. package/lib/esm/internal/workspace/WorkspaceImpl.js +7 -11
  205. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  206. package/lib/esm/test/ElementLRUCache.test.js +60 -0
  207. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  208. package/lib/esm/test/SchemaChangesetCanBeReversed.test.d.ts +2 -0
  209. package/lib/esm/test/SchemaChangesetCanBeReversed.test.d.ts.map +1 -0
  210. package/lib/esm/test/SchemaChangesetCanBeReversed.test.js +239 -0
  211. package/lib/esm/test/SchemaChangesetCanBeReversed.test.js.map +1 -0
  212. package/lib/esm/test/annotations/FrameGeometry.test.js +2 -1
  213. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
  214. package/lib/esm/test/ecdb/CTE.test.js +1 -0
  215. package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
  216. package/lib/esm/test/ecdb/ECSqlQuery.test.js +10 -2
  217. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  218. package/lib/esm/test/ecdb/ECSqlStatement.test.js +10 -0
  219. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  220. package/lib/esm/test/ecdb/ECSqlSyncReader.test.js +1 -0
  221. package/lib/esm/test/ecdb/ECSqlSyncReader.test.js.map +1 -1
  222. package/lib/esm/test/ecdb/QueryReaders.test.js +13 -0
  223. package/lib/esm/test/ecdb/QueryReaders.test.js.map +1 -1
  224. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js +1 -0
  225. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  226. package/lib/esm/test/element/DeleteDefinitionElements.test.js +6 -2
  227. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  228. package/lib/esm/test/element/ElementRoundTrip.test.js +5 -0
  229. package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
  230. package/lib/esm/test/element/ExcludedElements.test.js +1 -0
  231. package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
  232. package/lib/esm/test/hubaccess/ApplyChangeset.test.js +10 -0
  233. package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
  234. package/lib/esm/test/hubaccess/SemanticRebase.test.js +1 -0
  235. package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
  236. package/lib/esm/test/imodel/IModel.test.js +31 -0
  237. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  238. package/lib/esm/test/schema/ClassRegistry.test.js +3 -0
  239. package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
  240. package/lib/esm/test/schema/IModelSchemaContext.test.js +2 -0
  241. package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
  242. package/lib/esm/test/schema/SchemaViewHidden.test.d.ts +2 -0
  243. package/lib/esm/test/schema/SchemaViewHidden.test.d.ts.map +1 -0
  244. package/lib/esm/test/schema/SchemaViewHidden.test.js +275 -0
  245. package/lib/esm/test/schema/SchemaViewHidden.test.js.map +1 -0
  246. package/lib/esm/test/schema/SchemaViewKoQ.test.d.ts +2 -0
  247. package/lib/esm/test/schema/SchemaViewKoQ.test.d.ts.map +1 -0
  248. package/lib/esm/test/schema/SchemaViewKoQ.test.js +184 -0
  249. package/lib/esm/test/schema/SchemaViewKoQ.test.js.map +1 -0
  250. package/lib/esm/test/schema/SchemaViewLifecycle.test.d.ts +2 -0
  251. package/lib/esm/test/schema/SchemaViewLifecycle.test.d.ts.map +1 -0
  252. package/lib/esm/test/schema/SchemaViewLifecycle.test.js +141 -0
  253. package/lib/esm/test/schema/SchemaViewLifecycle.test.js.map +1 -0
  254. package/lib/esm/test/schema/SchemaViewValidation.test.d.ts +2 -0
  255. package/lib/esm/test/schema/SchemaViewValidation.test.d.ts.map +1 -0
  256. package/lib/esm/test/schema/SchemaViewValidation.test.js +475 -0
  257. package/lib/esm/test/schema/SchemaViewValidation.test.js.map +1 -0
  258. package/lib/esm/test/standalone/ChangesetReader.test.js +945 -337
  259. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  260. package/lib/esm/test/standalone/DeleteElements.test.js +45 -0
  261. package/lib/esm/test/standalone/DeleteElements.test.js.map +1 -1
  262. package/lib/esm/test/standalone/IModelWrite.test.js +6 -0
  263. package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
  264. package/lib/esm/test/standalone/ServerBasedLocks.test.js +62 -0
  265. package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
  266. package/lib/esm/test/standalone/Settings.test.js +2 -0
  267. package/lib/esm/test/standalone/Settings.test.js.map +1 -1
  268. package/lib/esm/test/standalone/SettingsSchemas.test.js +397 -0
  269. package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
  270. package/lib/esm/test/standalone/Workspace.test.js +23 -0
  271. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  272. package/lib/esm/workspace/SettingsSchemas.d.ts +20 -3
  273. package/lib/esm/workspace/SettingsSchemas.d.ts.map +1 -1
  274. package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
  275. package/lib/esm/workspace/Workspace.d.ts +3 -1
  276. package/lib/esm/workspace/Workspace.d.ts.map +1 -1
  277. package/lib/esm/workspace/Workspace.js.map +1 -1
  278. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuD;AACvD,oDAA6H;AAG7H,gEAA4G;AAC5G,gDAA+C;AAgC/C;;;;GAIG;AACH,MAAa,MAAM;IACjB;;OAEG;IACa,kBAAkB,GAAG,IAAa,CAAC;IACnD,0CAA0C;IACnC,MAAM,CAAC,MAAM,CAAgB,CAAC,mGAAmG;IAExI,IAAY,KAAK,KAAoB,OAAO,IAAI,CAAC,WAA4B,CAAC,CAAC,CAAC;IAEhF;;;;OAIG;IACI,MAAM,KAAK,SAAS,KAAa,OAAO,QAAQ,CAAC,CAAC,CAAC;IAE1D;;OAEG;IACI,MAAM,KAAK,aAAa;QAC7B,gFAAgF;QAChF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IACT,MAAM,KAAK,mBAAmB,KAAe,OAAO,EAAE,CAAC,CAAC,CAAC;IAEhE;;;;;OAKG;IACI,MAAM,CAAC,EAAE,CAAC,UAAyB;QACxC,6EAA6E;QAC7E,OAAO,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,SAAS,YAAY,UAAU,CAAC;IACrE,CAAC;IAED;;;OAGG;IACI,MAAM,KAAK,gBAAgB,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC;IAEtD;;;;;OAKG;IACI,eAAe;QACpB,MAAM,YAAY,GAAG,IAAI,gCAAkB,EAAE,CAAC;QAC9C,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACvC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;;;;OAOG;IACO,mBAAmB,CAAC,aAAiC;QAC7D,OAAO,CAAC,2BAA2B;IACrC,CAAC;;AAxRH,wBAyRC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Schema\n */\n\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\nimport { ElementLoadOptions, EntityProps, EntityReferenceSet, PropertyCallback, PropertyMetaData } from \"@itwin/core-common\";\nimport type { IModelDb } from \"./IModelDb\";\nimport { Schema } from \"./Schema\";\nimport { ECClass, EntityClass, Property, RelationshipClass, SchemaItemKey } from \"@itwin/ecschema-metadata\";\nimport { _nativeDb } from \"./internal/Symbols\";\n\n/** Represents a row returned by an ECSql query. The row is returned as a map of property names to values.\n * ECSqlRow has same schema as declared in ECSchema for the class and similar to if ECSQL SELECT * FROM <schema>:<class> were executed.\n * @beta */\nexport interface ECSqlRow {\n [key: string]: any\n}\n\n/** Set of properties that are used to deserialize an [[EntityProps]] from an ECSqlRow.\n * @beta */\nexport interface DeserializeEntityArgs {\n /** Row to deserialize */\n row: ECSqlRow;\n /** The IModel that contains this Entity */\n iModel: IModelDb;\n /** The options used when loading */\n options?: {\n /** Options used when loading an element */\n element?: ElementLoadOptions;\n }\n}\n\n/** A property of an [[Entity]] that needs to be custom handled during deserialization and serialization.\n * @beta */\nexport interface CustomHandledProperty {\n /** The name of the property as it appears in the ECSqlRow */\n readonly propertyName: string;\n /** Where the property is defined */\n readonly source: \"Class\" | \"Computed\";\n}\n\n/** Represents one of the fundamental building block in an [[IModelDb]]: as an [[Element]], [[Model]], or [[Relationship]].\n * Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).\n * An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].\n * @public @preview\n */\nexport class Entity {\n /** An immutable property used to discriminate between [[Entity]] and [EntityProps]($common), used to inform the TypeScript compiler that these two types\n * are never substitutable for one another. To obtain an EntityProps from an Entity, use [[Entity.toJSON]].\n */\n public readonly isInstanceOfEntity = true as const;\n /** The Schema that defines this class. */\n public static schema: typeof Schema; // TODO: Schema key on the static level, but it requires a version which may differ between imodels\n\n private get _ctor(): typeof Entity { return this.constructor as typeof Entity; }\n\n /** The name of the BIS class associated with this class.\n * @note Every subclass of Entity **MUST** override this method to identify its BIS class.\n * Failure to do so will ordinarily result in an error when the class is registered, since there may only\n * be one JavaScript class for a given BIS class (usually the errant class will collide with its superclass.)\n */\n public static get className(): string { return \"Entity\"; }\n\n /** Serves as a unique identifier for this class. Typed variant of [[classFullName]].\n * @public @preview\n */\n public static get schemaItemKey(): SchemaItemKey {\n // We cannot cache this here because the className gets overridden in subclasses\n return new SchemaItemKey(this.className, this.schema.schemaKey);\n }\n\n /** Cached Metadata for the ECClass */\n protected _metadata?: EntityClass | RelationshipClass;\n\n /** When working with an Entity it can be useful to set property values directly, bypassing the compiler's type checking.\n * This property makes such code slightly less tedious to read and write.\n * @internal\n */\n public get asAny(): any { return this; }\n\n /** The name of the BIS Schema that defines this class */\n public get schemaName(): string { return this._ctor.schema.schemaName; }\n\n /** The name of the BIS class associated with this class. */\n public get className(): string { return this._ctor.className; }\n\n /** The [[IModelDb]] that contains this Entity */\n public iModel: IModelDb;\n\n /** The Id of this Entity. May be invalid if the Entity has not yet been saved in the database. */\n public id: Id64String;\n\n\n protected constructor(props: EntityProps, iModel: IModelDb) {\n this.iModel = iModel;\n this.id = Id64.fromJSON(props.id);\n // copy all auto-handled properties from input to the object being constructed\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.forEachProperty((propName: string, meta: PropertyMetaData) => (this as any)[propName] = meta.createProperty((props as any)[propName]), false);\n }\n\n /** Invoke the constructor of the specified `Entity` subclass.\n * @internal\n */\n public static instantiate(subclass: typeof Entity, props: EntityProps, iModel: IModelDb): Entity {\n return new subclass(props, iModel);\n }\n\n /** List of properties that are need to be custom handled during deserialization and serialization.\n * These properties differ between the ECSql instance of an Entity and the Entity itself.\n * @beta */\n protected static readonly _customHandledProps: CustomHandledProperty[] = [\n { propertyName: \"id\", source: \"Class\" },\n { propertyName: \"className\", source: \"Class\" },\n { propertyName: \"jsonProperties\", source: \"Class\" }\n ];\n\n /** Get the list of properties that are custom handled by this class and its superclasses.\n * @internal */\n private static getCustomHandledProperties(): readonly CustomHandledProperty[] {\n if (this.name === \"Entity\") {\n return this._customHandledProps;\n }\n\n const superClass = Object.getPrototypeOf(this) as typeof Entity;\n return [\n ...superClass.getCustomHandledProperties(),\n ...this._customHandledProps,\n ];\n }\n\n /** Converts an ECSqlRow of an Entity to an EntityProps. This is used to deserialize an Entity from the database.\n * @beta */\n public static deserialize(props: DeserializeEntityArgs): EntityProps {\n const enProps: EntityProps = {\n classFullName: props.row.classFullName,\n id: props.row.id,\n }\n\n // Handles cases where id64 ints are stored in the jsonProperties and converts them to hex before parsing as a json object in js\n if (props.row.jsonProperties) {\n enProps.jsonProperties = JSON.parse(props.iModel[_nativeDb].patchJsonProperties(props.row.jsonProperties));\n }\n // Auto handles all properties that are not in the 'customHandledProperties' list\n const customHandledProperties = this.getCustomHandledProperties();\n Object.keys(props.row)\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\n .forEach((propertyName) => (enProps as ECSqlRow)[propertyName] = props.row[propertyName]\n );\n // Handles custom relClassNames to use '.' instead of ':'\n Object.keys(enProps).forEach((propertyName) => {\n if ((enProps as ECSqlRow)[propertyName].relClassName !== undefined && propertyName !== \"modeledElement\" && propertyName !== \"parentModel\") {\n (enProps as ECSqlRow)[propertyName].relClassName = (enProps as ECSqlRow)[propertyName].relClassName.replace(':', '.');\n }\n });\n return enProps;\n }\n\n /** Converts an EntityProps to an ECSqlRow. This is used to serialize an Entity to prepare to write it to the database.\n * @beta */\n public static serialize(props: EntityProps, _iModel: IModelDb): ECSqlRow {\n const inst: ECSqlRow = {\n classFullName: props.classFullName,\n id: props.id,\n }\n\n const customHandledProperties = this.getCustomHandledProperties();\n Object.keys(props)\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\n .forEach((propertyName) => inst[propertyName] = (props as ECSqlRow)[propertyName]\n );\n return inst;\n }\n\n /** Obtain the JSON representation of this Entity. Subclasses of [[Entity]] typically override this method to return their corresponding sub-type of [EntityProps]($common) -\n * for example, [[GeometricElement.toJSON]] returns a [GeometricElementProps]($common).\n */\n public toJSON(): EntityProps {\n const val: any = {};\n val.classFullName = this.classFullName;\n if (Id64.isValid(this.id))\n val.id = this.id;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.forEachProperty((propName: string) => val[propName] = (this as any)[propName], false);\n return val;\n }\n\n /** Call a function for each property of this Entity.\n * @param func The callback to be invoked on each property\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `forEach` to get the metadata and iterate over the properties instead.\n *\n * @example\n * ```typescript\n * // Deprecated method\n * entity.forEachProperty((name, propMetaData) => {\n * console.log(`Property name: ${name}, Property type: ${propMetaData.primitiveType}`);\n * });\n *\n * // New method\n * entity.forEach((name, property) => {\n * console.log(`Property name: ${name}, Property type: ${property.propertyType}`);\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public forEachProperty(func: PropertyCallback, includeCustom: boolean = true) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.iModel.forEachMetaData(this.classFullName, true, func, includeCustom);\n }\n\n /**\n * Call a function for each property of this Entity.\n * @param func The callback to be invoked on each property.\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\n * @throws Error if metadata for the class cannot be retrieved.\n *\n * @example\n * ```typescript\n * entity.forEach((name, property) => {\n * console.log(`Property name: ${name}, Property type: ${property.propertyType}`);\n * });\n * ```\n */\n public forEach(func: PropertyHandler, includeCustom: boolean = true) {\n const item = this._metadata ?? this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey);\n\n if (EntityClass.isEntityClass(item) || RelationshipClass.isRelationshipClass(item)) {\n for (const property of item.getPropertiesSync()) {\n if (includeCustom || !property.customAttributes?.has(`BisCore.CustomHandledProperty`))\n func(property.name, property);\n }\n } else {\n throw new Error(`Cannot get metadata for ${this.classFullName}. Class is not an EntityClass or RelationshipClass.`);\n }\n }\n\n /** Get the full BIS class name of this Entity in the form \"schema:class\" */\n public static get classFullName(): string { return `${this.schema.schemaName}:${this.className}`; }\n\n /** Get the full BIS class name of this Entity in the form \"schema:class\". */\n public get classFullName(): string { return this._ctor.classFullName; }\n /**\n * Get the item key used by the ecschema-metadata package to identify this entity class\n * @public @preview\n */\n public get schemaItemKey(): SchemaItemKey { return this._ctor.schemaItemKey; }\n\n /** Query metadata for this entity class from the iModel's schema. Returns cached metadata if available.\n * @throws [[IModelError]] if there is a problem querying the schema\n * @returns The metadata for the current entity\n * @public @preview\n */\n public async getMetaData(): Promise<EntityClass | RelationshipClass> {\n if (this._metadata) {\n return this._metadata;\n }\n\n const ecClass = await this.iModel.schemaContext.getSchemaItem(this.schemaItemKey, ECClass);\n if (EntityClass.isEntityClass(ecClass) || RelationshipClass.isRelationshipClass(ecClass)) {\n this._metadata = ecClass;\n return this._metadata;\n } else {\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\n }\n }\n\n /** @internal */\n public getMetaDataSync(): EntityClass | RelationshipClass {\n if (this._metadata) {\n return this._metadata;\n }\n\n const ecClass = this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey, ECClass);\n if (EntityClass.isEntityClass(ecClass) || RelationshipClass.isRelationshipClass(ecClass)) {\n this._metadata = ecClass;\n return this._metadata;\n } else {\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\n }\n }\n \n /** @internal */\n public static get protectedOperations(): string[] { return []; }\n\n /** return whether this Entity class is a subclass of another Entity class\n * @note the subclass-ness is checked according to JavaScript inheritance, to check the underlying raw EC class's\n * inheritance, you can use [ECClass.is]($ecschema-metadata)\n * @note this should have a type of `is<T extends typeof Entity>(otherClass: T): this is T` but can't because of\n * typescript's restriction on the `this` type in static methods\n */\n public static is(otherClass: typeof Entity): boolean {\n // inline of @itwin/core-bentley's isSubclassOf due to protected constructor.\n return this === otherClass || this.prototype instanceof otherClass;\n }\n\n /** whether this JavaScript class was generated for this ECClass because there was no registered custom implementation\n * ClassRegistry overrides this when generating a class\n * @internal\n */\n public static get isGeneratedClass() { return false; }\n\n /** Get the set of this entity's *entity references*, [EntityReferenceSet]($backend). An *entity reference* is any id\n * stored on the entity, in its EC properties or json fields.\n * This is important for cloning operations but can be useful in other situations as well.\n * @see this.collectReferenceIds\n * @beta\n */\n public getReferenceIds(): EntityReferenceSet {\n const referenceIds = new EntityReferenceSet();\n this.collectReferenceIds(referenceIds);\n return referenceIds;\n }\n\n /** Collect the Ids of this entity's *references* at this level of the class hierarchy.\n * A *reference* is any entity referenced by this entity's EC Data, including json fields.\n * This is important for cloning operations but can be useful in other situations as well.\n * @param _referenceIds The Id64Set to populate with reference Ids.\n * @note This should be overridden (with `super` called) at each level the class hierarchy that introduces references.\n * @see getReferenceIds\n * @beta\n */\n protected collectReferenceIds(_referenceIds: EntityReferenceSet): void {\n return; // no references by default\n }\n}\n\n/** A callback function to process properties of an Entity\n * @public @preview\n */\nexport type PropertyHandler = (name: string, property: Property) => void;\n\n/** Parameter type that can accept both abstract constructor types and non-abstract constructor types for `instanceof` to test.\n * @public @preview\n */\nexport type EntityClassType<T> = Function & { prototype: T }; // eslint-disable-line @typescript-eslint/no-unsafe-function-type\n"]}
1
+ {"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuD;AACvD,oDAA6H;AAG7H,gEAA4G;AAC5G,gDAA+C;AAgC/C;;;;GAIG;AACH,MAAa,MAAM;IACjB;;OAEG;IACa,kBAAkB,GAAG,IAAa,CAAC;IACnD,0CAA0C;IACnC,MAAM,CAAC,MAAM,CAAgB,CAAC,mGAAmG;IAExI,IAAY,KAAK,KAAoB,OAAO,IAAI,CAAC,WAA4B,CAAC,CAAC,CAAC;IAEhF;;;;OAIG;IACI,MAAM,KAAK,SAAS,KAAa,OAAO,QAAQ,CAAC,CAAC,CAAC;IAE1D;;OAEG;IACI,MAAM,KAAK,aAAa;QAC7B,gFAAgF;QAChF,OAAO,IAAI,iCAAa,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAClE,CAAC;IAED,sCAAsC;IAC5B,SAAS,CAAmC;IAEtD;;;OAGG;IACH,IAAW,KAAK,KAAU,OAAO,IAAI,CAAC,CAAC,CAAC;IAExC,yDAAyD;IACzD,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAExE,4DAA4D;IAC5D,IAAW,SAAS,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAE/D,iDAAiD;IA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AAC;QACvC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;;;;OAOG;IACO,mBAAmB,CAAC,aAAiC;QAC7D,OAAO,CAAC,2BAA2B;IACrC,CAAC;;AAhSH,wBAiSC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Schema\n */\n\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\nimport { ElementLoadOptions, EntityProps, EntityReferenceSet, PropertyCallback, PropertyMetaData } from \"@itwin/core-common\";\nimport type { IModelDb } from \"./IModelDb\";\nimport { Schema } from \"./Schema\";\nimport { ECClass, EntityClass, Property, RelationshipClass, SchemaItemKey } from \"@itwin/ecschema-metadata\";\nimport { _nativeDb } from \"./internal/Symbols\";\n\n/** Represents a row returned by an ECSql query. The row is returned as a map of property names to values.\n * ECSqlRow has same schema as declared in ECSchema for the class and similar to if ECSQL SELECT * FROM <schema>:<class> were executed.\n * @beta */\nexport interface ECSqlRow {\n [key: string]: any\n}\n\n/** Set of properties that are used to deserialize an [[EntityProps]] from an ECSqlRow.\n * @beta */\nexport interface DeserializeEntityArgs {\n /** Row to deserialize */\n row: ECSqlRow;\n /** The IModel that contains this Entity */\n iModel: IModelDb;\n /** The options used when loading */\n options?: {\n /** Options used when loading an element */\n element?: ElementLoadOptions;\n }\n}\n\n/** A property of an [[Entity]] that needs to be custom handled during deserialization and serialization.\n * @beta */\nexport interface CustomHandledProperty {\n /** The name of the property as it appears in the ECSqlRow */\n readonly propertyName: string;\n /** Where the property is defined */\n readonly source: \"Class\" | \"Computed\";\n}\n\n/** Represents one of the fundamental building block in an [[IModelDb]]: as an [[Element]], [[Model]], or [[Relationship]].\n * Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).\n * An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].\n * @public @preview\n */\nexport class Entity {\n /** An immutable property used to discriminate between [[Entity]] and [EntityProps]($common), used to inform the TypeScript compiler that these two types\n * are never substitutable for one another. To obtain an EntityProps from an Entity, use [[Entity.toJSON]].\n */\n public readonly isInstanceOfEntity = true as const;\n /** The Schema that defines this class. */\n public static schema: typeof Schema; // TODO: Schema key on the static level, but it requires a version which may differ between imodels\n\n private get _ctor(): typeof Entity { return this.constructor as typeof Entity; }\n\n /** The name of the BIS class associated with this class.\n * @note Every subclass of Entity **MUST** override this method to identify its BIS class.\n * Failure to do so will ordinarily result in an error when the class is registered, since there may only\n * be one JavaScript class for a given BIS class (usually the errant class will collide with its superclass.)\n */\n public static get className(): string { return \"Entity\"; }\n\n /** Serves as a unique identifier for this class. Typed variant of [[classFullName]].\n * @public @preview\n */\n public static get schemaItemKey(): SchemaItemKey {\n // We cannot cache this here because the className gets overridden in subclasses\n return new SchemaItemKey(this.className, this.schema.schemaKey);\n }\n\n /** Cached Metadata for the ECClass */\n protected _metadata?: EntityClass | RelationshipClass;\n\n /** When working with an Entity it can be useful to set property values directly, bypassing the compiler's type checking.\n * This property makes such code slightly less tedious to read and write.\n * @internal\n */\n public get asAny(): any { return this; }\n\n /** The name of the BIS Schema that defines this class */\n public get schemaName(): string { return this._ctor.schema.schemaName; }\n\n /** The name of the BIS class associated with this class. */\n public get className(): string { return this._ctor.className; }\n\n /** The [[IModelDb]] that contains this Entity */\n public iModel: IModelDb;\n\n /** The Id of this Entity. May be invalid if the Entity has not yet been saved in the database. */\n public id: Id64String;\n\n\n protected constructor(props: EntityProps, iModel: IModelDb) {\n this.iModel = iModel;\n this.id = Id64.fromJSON(props.id);\n // copy all auto-handled properties from input to the object being constructed\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.forEachProperty((propName: string, meta: PropertyMetaData) => (this as any)[propName] = meta.createProperty((props as any)[propName]), false);\n }\n\n /** Invoke the constructor of the specified `Entity` subclass.\n * @internal\n */\n public static instantiate(subclass: typeof Entity, props: EntityProps, iModel: IModelDb): Entity {\n return new subclass(props, iModel);\n }\n\n /** List of properties that are need to be custom handled during deserialization and serialization.\n * These properties differ between the ECSql instance of an Entity and the Entity itself.\n * @beta */\n protected static readonly _customHandledProps: CustomHandledProperty[] = [\n { propertyName: \"id\", source: \"Class\" },\n { propertyName: \"className\", source: \"Class\" },\n { propertyName: \"jsonProperties\", source: \"Class\" }\n ];\n\n /** Get the list of properties that are custom handled by this class and its superclasses.\n * @internal */\n private static getCustomHandledProperties(): readonly CustomHandledProperty[] {\n if (this.name === \"Entity\") {\n return this._customHandledProps;\n }\n\n const superClass = Object.getPrototypeOf(this) as typeof Entity;\n return [\n ...superClass.getCustomHandledProperties(),\n ...this._customHandledProps,\n ];\n }\n\n /** Converts an ECSqlRow of an Entity to an EntityProps. This is used to deserialize an Entity from the database.\n * @beta */\n public static deserialize(props: DeserializeEntityArgs): EntityProps {\n const enProps: EntityProps = {\n classFullName: props.row.classFullName,\n id: props.row.id,\n }\n\n // Handles cases where id64 ints are stored in the jsonProperties and converts them to hex before parsing as a json object in js\n if (props.row.jsonProperties) {\n enProps.jsonProperties = JSON.parse(props.iModel[_nativeDb].patchJsonProperties(props.row.jsonProperties));\n }\n // Auto handles all properties that are not in the 'customHandledProperties' list\n const customHandledProperties = this.getCustomHandledProperties();\n Object.keys(props.row)\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\n .forEach((propertyName) => (enProps as ECSqlRow)[propertyName] = props.row[propertyName]\n );\n // Handles custom relClassNames to use '.' instead of ':'\n Object.keys(enProps).forEach((propertyName) => {\n if ((enProps as ECSqlRow)[propertyName].relClassName !== undefined && propertyName !== \"modeledElement\" && propertyName !== \"parentModel\") {\n (enProps as ECSqlRow)[propertyName].relClassName = (enProps as ECSqlRow)[propertyName].relClassName.replace(':', '.');\n }\n });\n return enProps;\n }\n\n /** Converts an EntityProps to an ECSqlRow. This is used to serialize an Entity to prepare to write it to the database.\n * @beta */\n public static serialize(props: EntityProps, _iModel: IModelDb): ECSqlRow {\n const inst: ECSqlRow = {\n classFullName: props.classFullName,\n id: props.id,\n }\n\n const customHandledProperties = this.getCustomHandledProperties();\n Object.keys(props)\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\n .forEach((propertyName) => inst[propertyName] = (props as ECSqlRow)[propertyName]\n );\n return inst;\n }\n\n /** Obtain the JSON representation of this Entity. Subclasses of [[Entity]] typically override this method to return their corresponding sub-type of [EntityProps]($common) -\n * for example, [[GeometricElement.toJSON]] returns a [GeometricElementProps]($common).\n */\n public toJSON(): EntityProps {\n const val: any = {};\n val.classFullName = this.classFullName;\n if (Id64.isValid(this.id))\n val.id = this.id;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.forEachProperty((propName: string) => val[propName] = (this as any)[propName], false);\n return val;\n }\n\n /** Call a function for each property of this Entity.\n * @param func The callback to be invoked on each property\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Obtain a `SchemaView` via `iModel.getSchemaView()` and iterate `view.findClass(entity.classFullName)?.getProperties()` instead. (`forEach` is also deprecated.)\n *\n * @example\n * ```typescript\n * // Deprecated method\n * entity.forEachProperty((name, propMetaData) => {\n * console.log(`Property name: ${name}, Property type: ${propMetaData.primitiveType}`);\n * });\n *\n * // New method\n * entity.forEach((name, property) => {\n * console.log(`Property name: ${name}, Property type: ${property.propertyType}`);\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public forEachProperty(func: PropertyCallback, includeCustom: boolean = true) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.iModel.forEachMetaData(this.classFullName, true, func, includeCustom);\n }\n\n /**\n * Call a function for each property of this Entity.\n * @param func The callback to be invoked on each property.\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\n * @throws Error if metadata for the class cannot be retrieved.\n * @deprecated in 5.10.0 - will not be removed until after 2026-09-03. Obtain a `SchemaView` via `iModel.getSchemaView()` and iterate `view.findClass(entity.classFullName)?.getProperties()` yourself. SchemaView does not expose the `BisCore.CustomHandledProperty` custom attribute, so the `includeCustom: false` filter must be replicated by the caller (query the custom-handled property set via ECSql) if needed.\n *\n * @example\n * ```typescript\n * const view = await entity.iModel.getSchemaView();\n * const cls = view.findClass(entity.classFullName);\n * if (cls) {\n * for (const property of cls.getProperties()) {\n * console.log(`Property name: ${property.name}, Kind: ${property.kind}`);\n * }\n * }\n * ```\n */\n public forEach(func: PropertyHandler, includeCustom: boolean = true) {\n const item = this._metadata ?? this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey);\n\n if (EntityClass.isEntityClass(item) || RelationshipClass.isRelationshipClass(item)) {\n for (const property of item.getPropertiesSync()) {\n if (includeCustom || !property.customAttributes?.has(`BisCore.CustomHandledProperty`))\n func(property.name, property);\n }\n } else {\n throw new Error(`Cannot get metadata for ${this.classFullName}. Class is not an EntityClass or RelationshipClass.`);\n }\n }\n\n /** Get the full BIS class name of this Entity in the form \"schema:class\" */\n public static get classFullName(): string { return `${this.schema.schemaName}:${this.className}`; }\n\n /** Get the full BIS class name of this Entity in the form \"schema:class\". */\n public get classFullName(): string { return this._ctor.classFullName; }\n /**\n * Get the item key used by the ecschema-metadata package to identify this entity class\n * @public @preview\n */\n public get schemaItemKey(): SchemaItemKey { return this._ctor.schemaItemKey; }\n\n /** Query metadata for this entity class from the iModel's schema. Returns cached metadata if available.\n * @throws [[IModelError]] if there is a problem querying the schema\n * @returns The metadata for the current entity\n * @public @preview\n * @deprecated in 5.10.0 - will not be removed until after 2026-09-03. Obtain a `SchemaView` via `iModel.getSchemaView()` and call `view.findClass(entity.classFullName)` to retrieve a `SchemaView.Class`. The returned type differs from `EntityClass | RelationshipClass` and offers a synchronous, snapshot-style API.\n */\n public async getMetaData(): Promise<EntityClass | RelationshipClass> {\n if (this._metadata) {\n return this._metadata;\n }\n\n const ecClass = await this.iModel.schemaContext.getSchemaItem(this.schemaItemKey, ECClass);\n if (EntityClass.isEntityClass(ecClass) || RelationshipClass.isRelationshipClass(ecClass)) {\n this._metadata = ecClass;\n return this._metadata;\n } else {\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\n }\n }\n\n /** @internal\n * @deprecated in 5.10.0 - will not be removed until after 2026-09-03. Internal callers should obtain a `SchemaView` via `iModel.getSchemaView()` (or retain a pre-loaded one) and call `view.findClass(...)` instead. Note that `getSchemaView()` is async.\n */\n public getMetaDataSync(): EntityClass | RelationshipClass {\n if (this._metadata) {\n return this._metadata;\n }\n\n const ecClass = this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey, ECClass);\n if (EntityClass.isEntityClass(ecClass) || RelationshipClass.isRelationshipClass(ecClass)) {\n this._metadata = ecClass;\n return this._metadata;\n } else {\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\n }\n }\n \n /** @internal */\n public static get protectedOperations(): string[] { return []; }\n\n /** return whether this Entity class is a subclass of another Entity class\n * @note the subclass-ness is checked according to JavaScript inheritance, to check the underlying raw EC class's\n * inheritance, you can use [ECClass.is]($ecschema-metadata)\n * @note this should have a type of `is<T extends typeof Entity>(otherClass: T): this is T` but can't because of\n * typescript's restriction on the `this` type in static methods\n */\n public static is(otherClass: typeof Entity): boolean {\n // inline of @itwin/core-bentley's isSubclassOf due to protected constructor.\n return this === otherClass || this.prototype instanceof otherClass;\n }\n\n /** whether this JavaScript class was generated for this ECClass because there was no registered custom implementation\n * ClassRegistry overrides this when generating a class\n * @internal\n */\n public static get isGeneratedClass() { return false; }\n\n /** Get the set of this entity's *entity references*, [EntityReferenceSet]($backend). An *entity reference* is any id\n * stored on the entity, in its EC properties or json fields.\n * This is important for cloning operations but can be useful in other situations as well.\n * @see this.collectReferenceIds\n * @beta\n */\n public getReferenceIds(): EntityReferenceSet {\n const referenceIds = new EntityReferenceSet();\n this.collectReferenceIds(referenceIds);\n return referenceIds;\n }\n\n /** Collect the Ids of this entity's *references* at this level of the class hierarchy.\n * A *reference* is any entity referenced by this entity's EC Data, including json fields.\n * This is important for cloning operations but can be useful in other situations as well.\n * @param _referenceIds The Id64Set to populate with reference Ids.\n * @note This should be overridden (with `super` called) at each level the class hierarchy that introduces references.\n * @see getReferenceIds\n * @beta\n */\n protected collectReferenceIds(_referenceIds: EntityReferenceSet): void {\n return; // no references by default\n }\n}\n\n/** A callback function to process properties of an Entity\n * @public @preview\n */\nexport type PropertyHandler = (name: string, property: Property) => void;\n\n/** Parameter type that can accept both abstract constructor types and non-abstract constructor types for `instanceof` to test.\n * @public @preview\n */\nexport type EntityClassType<T> = Function & { prototype: T }; // eslint-disable-line @typescript-eslint/no-unsafe-function-type\n"]}
@@ -27,7 +27,7 @@ export declare class ExternalSource extends InformationReferenceElement {
27
27
  * @param txn The active EditTxn.
28
28
  */
29
29
  static ensureCodeSpec(txn: EditTxn): Id64String;
30
- /** @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use ExternalSource.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */
30
+ /** @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use ExternalSource.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */
31
31
  static ensureCodeSpec(iModelDb: IModelDb): Id64String;
32
32
  /** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.
33
33
  * @param iModelDb The IModelDb
@@ -64,7 +64,7 @@ export declare class ExternalSourceAttachment extends InformationReferenceElemen
64
64
  * @param txn The active EditTxn.
65
65
  */
66
66
  static ensureCodeSpec(txn: EditTxn): Id64String;
67
- /** @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use ExternalSourceAttachment.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */
67
+ /** @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use ExternalSourceAttachment.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */
68
68
  static ensureCodeSpec(iModelDb: IModelDb): Id64String;
69
69
  /** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].
70
70
  * @param iModelDb The IModelDb
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalSource.js","sourceRoot":"","sources":["../../src/ExternalSource.ts"],"names":[],"mappings":";AACA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA+C;AAC/C,oDAG4B;AAC5B,uCAAiE;AACjE,uCAAoC;AAEpC,qEAAgH;AAChH,gDAAkD;AAElD;;;GAGG;AACH,MAAa,cAAe,SAAQ,qCAA2B;IAC7D,wDAAwD;IACjD,UAAU,CAAgC;IACjD,2EAA2E;IACpE,aAAa,CAAU;IAC9B,8EAA8E;IACvE,gBAAgB,CAAU;IACjC,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,gBAAgB,CAAC,CAAC,CAAC;IAE3E,YAAsB,KAA0B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,KAAK,CAAC,UAAU;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,qDAA4B,CAAC,4BAAc,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACpG,CAAC;IAEe,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,sDAAsD;IAC/E,CAAC;IAOM,MAAM,CAAC,cAAc,CAAC,WAA+B;QAC1D,MAAM,GAAG,GAAG,WAAW,YAAY,iBAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,sBAAY,CAAC,CAAC;QACrF,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,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AAE,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAClF,CAAC;CACF;AA3DD,4DA2DC;AAED;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,cAAc;IACrD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAEhF,YAAsB,KAA0B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAPD,kDAOC;AAED;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,iBAAO;IACpD,6EAA6E;IACtE,iBAAiB,CAAU;IAClC,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,2BAA2B,CAAC,CAAC,CAAC;IAEtF,YAAsB,KAAqC,EAAE,MAAgB;QAC3E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;IAEe,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,sDAAsD;IAC/E,CAAC;CACF;AAbD,8DAaC","sourcesContent":["\n/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Elements\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Point3d } from \"@itwin/core-geometry\";\nimport {\n BisCodeSpec, Code, CodeScopeSpec, EntityReferenceSet, ExternalSourceAttachmentProps, ExternalSourceAttachmentRole, ExternalSourceProps, IModel, RelatedElement,\n SynchronizationConfigLinkProps,\n} from \"@itwin/core-common\";\nimport { InformationReferenceElement, UrlLink } from \"./Element\";\nimport { EditTxn } from \"./EditTxn\";\nimport { IModelDb } from \"./IModelDb\";\nimport { ExternalSourceAttachmentAttachesSource, ExternalSourceIsInRepository } from \"./NavigationRelationship\";\nimport { _implicitTxn } from \"./internal/Symbols\";\n\n/** An ExternalSource refers to an 'information container' found in a repository. In some cases, the container is the entire repository.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSource extends InformationReferenceElement {\n /** The repository that contains this ExternalSource. */\n public repository?: ExternalSourceIsInRepository;\n /** The name of the iModel Connecter that processed this ExternalSource. */\n public connectorName?: string;\n /** The version of the iModel Connecter that processed this ExternalSource. */\n public connectorVersion?: string;\n /** @internal */\n public static override get className(): string { return \"ExternalSource\"; }\n\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\n super(props, iModel);\n if (props.repository)\n this.repository = new ExternalSourceIsInRepository(RelatedElement.idFromJson(props.repository));\n }\n\n public override toJSON(): ExternalSourceProps { // This override only specializes the return type\n return super.toJSON(); // Entity.toJSON takes care of auto-handled properties\n }\n /** Ensure the [[CodeSpec]] for ExternalSource elements exists, using an explicit transaction.\n * @param txn The active EditTxn.\n */\n public static ensureCodeSpec(txn: EditTxn): Id64String;\n /** @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use ExternalSource.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String;\n public static ensureCodeSpec(txnOrIModel: EditTxn | IModelDb): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n try {\n const codeSpec = txn.iModel.codeSpecs.getByName(BisCodeSpec.externalSource);\n return codeSpec.id;\n } catch {\n return txn.iModel.codeSpecs.insert(txn, BisCodeSpec.externalSource, CodeScopeSpec.Type.Repository);\n }\n }\n\n /** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.\n * @param iModelDb The IModelDb\n * @param codeValue The ExternalSource name\n * @see [[ensureCodeSpec]]\n */\n public static createCode(iModelDb: IModelDb, codeValue: string): Code {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\n return new Code({ spec: codeSpec.id, scope: IModel.rootSubjectId, value: codeValue });\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n if (this.repository)\n referenceIds.addElement(this.repository.id);\n }\n}\n\n/** Attachment of an ExternalSource\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceAttachment extends InformationReferenceElement {\n /** The [[ExternalSource]] that is attached by this ExternalSourceAttachment. */\n public attaches?: ExternalSourceAttachmentAttachesSource;\n /** Specifies whether the attached [[ExternalSource]] provides context or models a part of the whole. */\n public role?: ExternalSourceAttachmentRole;\n /** The translation or offset in global coordinates of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public translation?: Point3d;\n /** The Yaw angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public yaw?: number;\n /** The Pitch angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public pitch?: number;\n /** The Roll angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public roll?: number;\n /** The scale of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public scale?: Point3d;\n /** @internal */\n public static override get className(): string { return \"ExternalSourceAttachment\"; }\n\n protected constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb) {\n super(props, iModel);\n if (props.attaches)\n this.attaches = new ExternalSourceAttachmentAttachesSource(RelatedElement.idFromJson(props.attaches));\n\n if (props.translation)\n this.translation = Point3d.fromJSON(props.translation);\n\n if (props.scale)\n this.scale = Point3d.fromJSON(props.scale);\n }\n\n public override toJSON(): ExternalSourceAttachmentProps { // This override only specializes the return type\n return super.toJSON(); // Entity.toJSON takes care of auto-handled properties\n }\n /** Ensure the [[CodeSpec]] for ExternalSourceAttachment elements exists, using an explicit transaction.\n * @param txn The active EditTxn.\n */\n public static ensureCodeSpec(txn: EditTxn): Id64String;\n /** @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use ExternalSourceAttachment.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String;\n public static ensureCodeSpec(txnOrIModel: EditTxn | IModelDb): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n try {\n const codeSpec = txn.iModel.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\n return codeSpec.id;\n } catch {\n return txn.iModel.codeSpecs.insert(txn, BisCodeSpec.externalSourceAttachment, CodeScopeSpec.Type.ParentElement);\n }\n }\n\n /** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].\n * @param iModelDb The IModelDb\n * @param scopeElementId The parent ExternalSource\n * @param codeValue The ExternalSourceAttachment name\n * @see [[ensureCodeSpec]]\n */\n public static createCode(iModelDb: IModelDb, scopeElementId: Id64String, codeValue: string): Code {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\n return new Code({ spec: codeSpec.id, scope: scopeElementId, value: codeValue });\n }\n}\n\n/** A group of ExternalSources that are collectively a source of information for one or more elements.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceGroup extends ExternalSource {\n /** @internal */\n public static override get className(): string { return \"ExternalSourceGroup\"; }\n\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** Link to the Configuration for an iModel Synchronization Job\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class SynchronizationConfigLink extends UrlLink {\n /** Date/Time of last successful run of this synchronization configuration */\n public lastSuccessfulRun?: string;\n /** @internal */\n public static override get className(): string { return \"SynchronizationConfigLink\"; }\n\n protected constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n public override toJSON(): SynchronizationConfigLinkProps { // This override only specializes the return type\n return super.toJSON(); // Entity.toJSON takes care of auto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AC;IAEhF,YAAsB,KAA0B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAPD,kDAOC;AAED;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,iBAAO;IACpD,6EAA6E;IACtE,iBAAiB,CAAU;IAClC,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,2BAA2B,CAAC,CAAC,CAAC;IAEtF,YAAsB,KAAqC,EAAE,MAAgB;QAC3E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;IAEe,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,sDAAsD;IAC/E,CAAC;CACF;AAbD,8DAaC","sourcesContent":["\n/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Elements\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Point3d } from \"@itwin/core-geometry\";\nimport {\n BisCodeSpec, Code, CodeScopeSpec, EntityReferenceSet, ExternalSourceAttachmentProps, ExternalSourceAttachmentRole, ExternalSourceProps, IModel, RelatedElement,\n SynchronizationConfigLinkProps,\n} from \"@itwin/core-common\";\nimport { InformationReferenceElement, UrlLink } from \"./Element\";\nimport { EditTxn } from \"./EditTxn\";\nimport { IModelDb } from \"./IModelDb\";\nimport { ExternalSourceAttachmentAttachesSource, ExternalSourceIsInRepository } from \"./NavigationRelationship\";\nimport { _implicitTxn } from \"./internal/Symbols\";\n\n/** An ExternalSource refers to an 'information container' found in a repository. In some cases, the container is the entire repository.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSource extends InformationReferenceElement {\n /** The repository that contains this ExternalSource. */\n public repository?: ExternalSourceIsInRepository;\n /** The name of the iModel Connecter that processed this ExternalSource. */\n public connectorName?: string;\n /** The version of the iModel Connecter that processed this ExternalSource. */\n public connectorVersion?: string;\n /** @internal */\n public static override get className(): string { return \"ExternalSource\"; }\n\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\n super(props, iModel);\n if (props.repository)\n this.repository = new ExternalSourceIsInRepository(RelatedElement.idFromJson(props.repository));\n }\n\n public override toJSON(): ExternalSourceProps { // This override only specializes the return type\n return super.toJSON(); // Entity.toJSON takes care of auto-handled properties\n }\n /** Ensure the [[CodeSpec]] for ExternalSource elements exists, using an explicit transaction.\n * @param txn The active EditTxn.\n */\n public static ensureCodeSpec(txn: EditTxn): Id64String;\n /** @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use ExternalSource.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String;\n public static ensureCodeSpec(txnOrIModel: EditTxn | IModelDb): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n try {\n const codeSpec = txn.iModel.codeSpecs.getByName(BisCodeSpec.externalSource);\n return codeSpec.id;\n } catch {\n return txn.iModel.codeSpecs.insert(txn, BisCodeSpec.externalSource, CodeScopeSpec.Type.Repository);\n }\n }\n\n /** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.\n * @param iModelDb The IModelDb\n * @param codeValue The ExternalSource name\n * @see [[ensureCodeSpec]]\n */\n public static createCode(iModelDb: IModelDb, codeValue: string): Code {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\n return new Code({ spec: codeSpec.id, scope: IModel.rootSubjectId, value: codeValue });\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n if (this.repository)\n referenceIds.addElement(this.repository.id);\n }\n}\n\n/** Attachment of an ExternalSource\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceAttachment extends InformationReferenceElement {\n /** The [[ExternalSource]] that is attached by this ExternalSourceAttachment. */\n public attaches?: ExternalSourceAttachmentAttachesSource;\n /** Specifies whether the attached [[ExternalSource]] provides context or models a part of the whole. */\n public role?: ExternalSourceAttachmentRole;\n /** The translation or offset in global coordinates of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public translation?: Point3d;\n /** The Yaw angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public yaw?: number;\n /** The Pitch angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public pitch?: number;\n /** The Roll angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public roll?: number;\n /** The scale of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public scale?: Point3d;\n /** @internal */\n public static override get className(): string { return \"ExternalSourceAttachment\"; }\n\n protected constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb) {\n super(props, iModel);\n if (props.attaches)\n this.attaches = new ExternalSourceAttachmentAttachesSource(RelatedElement.idFromJson(props.attaches));\n\n if (props.translation)\n this.translation = Point3d.fromJSON(props.translation);\n\n if (props.scale)\n this.scale = Point3d.fromJSON(props.scale);\n }\n\n public override toJSON(): ExternalSourceAttachmentProps { // This override only specializes the return type\n return super.toJSON(); // Entity.toJSON takes care of auto-handled properties\n }\n /** Ensure the [[CodeSpec]] for ExternalSourceAttachment elements exists, using an explicit transaction.\n * @param txn The active EditTxn.\n */\n public static ensureCodeSpec(txn: EditTxn): Id64String;\n /** @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use ExternalSourceAttachment.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String;\n public static ensureCodeSpec(txnOrIModel: EditTxn | IModelDb): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n try {\n const codeSpec = txn.iModel.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\n return codeSpec.id;\n } catch {\n return txn.iModel.codeSpecs.insert(txn, BisCodeSpec.externalSourceAttachment, CodeScopeSpec.Type.ParentElement);\n }\n }\n\n /** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].\n * @param iModelDb The IModelDb\n * @param scopeElementId The parent ExternalSource\n * @param codeValue The ExternalSourceAttachment name\n * @see [[ensureCodeSpec]]\n */\n public static createCode(iModelDb: IModelDb, scopeElementId: Id64String, codeValue: string): Code {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\n return new Code({ spec: codeSpec.id, scope: scopeElementId, value: codeValue });\n }\n}\n\n/** A group of ExternalSources that are collectively a source of information for one or more elements.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceGroup extends ExternalSource {\n /** @internal */\n public static override get className(): string { return \"ExternalSourceGroup\"; }\n\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** Link to the Configuration for an iModel Synchronization Job\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class SynchronizationConfigLink extends UrlLink {\n /** Date/Time of last successful run of this synchronization configuration */\n public lastSuccessfulRun?: string;\n /** @internal */\n public static override get className(): string { return \"SynchronizationConfigLink\"; }\n\n protected constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n public override toJSON(): SynchronizationConfigLinkProps { // This override only specializes the return type\n return super.toJSON(); // Entity.toJSON takes care of auto-handled properties\n }\n}\n\n"]}
@@ -23,7 +23,7 @@ import { Relationships } from "./Relationship";
23
23
  import { SqliteStatement } from "./SqliteStatement";
24
24
  import { ComputeRangesForTextLayoutArgs, TextLayoutRanges } from "./annotations/TextBlockLayout";
25
25
  import { TxnManager } from "./TxnManager";
26
- import { EditTxn } from "./EditTxn";
26
+ import { BulkDeleteElementsArgs, BulkDeleteElementsResult, EditTxn } from "./EditTxn";
27
27
  import { ViewDefinition } from "./ViewDefinition";
28
28
  import { ViewStore } from "./ViewStore";
29
29
  import { SettingsContainer } from "./workspace/Settings";
@@ -32,7 +32,7 @@ import { LockControl } from "./LockControl";
32
32
  import type { BlobContainer } from "./BlobContainerService";
33
33
  import { IModelDbFonts } from "./IModelDbFonts";
34
34
  import { _activeTxn, _cache, _implicitTxn, _instanceKeyCache, _nativeDb, _resetIModelDb } from "./internal/Symbols";
35
- import { ECSpecVersion, ECVersion, SchemaContext } from "@itwin/ecschema-metadata";
35
+ import { ECSpecVersion, ECVersion, SchemaContext, SchemaView } from "@itwin/ecschema-metadata";
36
36
  import { SchemaMap } from "./Schema";
37
37
  import { ElementLRUCache, InstanceKeyLRUCache } from "./internal/ElementLRUCache";
38
38
  import { IntegrityCheckResult } from "./internal/IntegrityCheck";
@@ -306,6 +306,7 @@ export declare abstract class IModelDb extends IModel {
306
306
  private _jsClassMap?;
307
307
  private _schemaMap?;
308
308
  private _schemaContext?;
309
+ private _schemasPromise?;
309
310
  /** @deprecated in 5.0.0 - will not be removed until after 2026-06-13. Use [[fonts]]. */
310
311
  protected _fontMap?: FontMap;
311
312
  private readonly _fonts;
@@ -626,7 +627,7 @@ export declare abstract class IModelDb extends IModel {
626
627
  * ``` ts
627
628
  * [[include:IModelDb.updateProjectExtents]]
628
629
  * ```
629
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use EditTxn.updateProjectExtents instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
630
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use EditTxn.updateProjectExtents instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
630
631
  */
631
632
  updateProjectExtents(newExtents: AxisAlignedBox3d): void;
632
633
  /** Compute an appropriate project extents for this iModel based on the ranges of all spatial elements.
@@ -639,11 +640,11 @@ export declare abstract class IModelDb extends IModel {
639
640
  */
640
641
  computeProjectExtents(options?: ComputeProjectExtentsOptions): ComputedProjectExtents;
641
642
  /** Update the [EcefLocation]($docs/learning/glossary#eceflocation) of this iModel.
642
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use EditTxn.updateEcefLocation instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
643
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use EditTxn.updateEcefLocation instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
643
644
  */
644
645
  updateEcefLocation(ecef: EcefLocation): void;
645
646
  /** Update the IModelProps of this iModel in the database.
646
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use EditTxn.updateIModelProps instead, within an explicit EditTxn scope (or via withEditTxn).
647
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use EditTxn.updateIModelProps instead, within an explicit EditTxn scope (or via withEditTxn).
647
648
  */
648
649
  updateIModelProps(): void;
649
650
  /** Commit unsaved changes in memory as a Txn to this iModelDb.
@@ -652,7 +653,7 @@ export declare abstract class IModelDb extends IModel {
652
653
  * @note This will not push changes to the iModelHub.
653
654
  * @note This method should not be called from {TxnManager.withIndirectTxnModeAsync}, {TxnManager.withIndirectTxnMode} or {RebaseHandler.recompute}.
654
655
  * @see [[IModelDb.pushChanges]] to push changes to the iModelHub.
655
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use EditTxn.saveChanges instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
656
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use EditTxn.saveChanges instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
656
657
  */
657
658
  saveChanges(description?: string): void;
658
659
  /** Commit unsaved changes in memory as a Txn to this iModelDb. This is preferable for case where application like to store additional structured information with the change that could be useful later when rebasing.
@@ -662,11 +663,11 @@ export declare abstract class IModelDb extends IModel {
662
663
  * @note This will not push changes to the iModelHub.
663
664
  * @note This method should not be called from {TxnManager.withIndirectTxnModeAsync}, {TxnManager.withIndirectTxnMode} or {RebaseHandler.recompute}.
664
665
  * @see [[IModelDb.pushChanges]] to push changes to the iModelHub.
665
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use EditTxn.saveChanges instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
666
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use EditTxn.saveChanges instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
666
667
  */
667
668
  saveChanges(args: SaveChangesArgs): void;
668
669
  /** Abandon changes in memory that have not been saved as a Txn to this iModelDb.
669
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use EditTxn.abandonChanges instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
670
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use EditTxn.abandonChanges instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
670
671
  */
671
672
  abandonChanges(): void;
672
673
  /**
@@ -770,7 +771,7 @@ export declare abstract class IModelDb extends IModel {
770
771
  static validateSchemas(filePath: LocalFileName, forReadWrite: boolean): SchemaState;
771
772
  /** The registry of entity metadata for this iModel.
772
773
  * @internal
773
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `schemaContext` from the `iModel` instead.
774
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `getSchemaView()` from the `iModel` instead.
774
775
  *
775
776
  * @example
776
777
  * ```typescript
@@ -778,7 +779,8 @@ export declare abstract class IModelDb extends IModel {
778
779
  * const classMetaData: EntityMetaData | undefined = iModel.classMetaDataRegistry.find("SchemaName:ClassName");
779
780
  *
780
781
  * // Replacement:
781
- * const metaData: EntityClass | undefined = imodel.schemaContext.getSchemaItemSync("SchemaName.ClassName", EntityClass);
782
+ * const view = await imodel.getSchemaView();
783
+ * const cls = view.findClass("SchemaName:ClassName");
782
784
  * ```
783
785
  */
784
786
  get classMetaDataRegistry(): MetaDataRegistry;
@@ -791,10 +793,28 @@ export declare abstract class IModelDb extends IModel {
791
793
  */
792
794
  get schemaMap(): SchemaMap;
793
795
  /**
794
- * Gets the context that allows accessing the metadata (ecschema-metadata package) of this iModel
796
+ * Gets the context that allows accessing the metadata (`@itwin/ecschema-metadata` package) of this iModel.
797
+ *
798
+ * For runtime read-only access - class/property iteration, IS-A checks, navigating relationships, KOQ lookups -
799
+ * prefer [[getSchemaView]]. `schemaContext` remains the right choice when you need schema authoring
800
+ * (via `@itwin/ecschema-editing`), custom-attribute deserialization, or the full ecschema-metadata object graph.
795
801
  * @public @preview
796
802
  */
797
803
  get schemaContext(): SchemaContext;
804
+ /** Get the schema view for this iModel. The view is built lazily on
805
+ * first call by fetching compact binary schema data via `PRAGMA schema_view` through
806
+ * the ConcurrentQuery thread pool. Subsequent calls return the cached view. Multiple
807
+ * concurrent callers share a single in-flight build.
808
+ *
809
+ * The returned `SchemaView` is a lightweight, read-only, synchronous API for
810
+ * navigating schema metadata - classes, properties, relationships, enumerations, etc.
811
+ * It is the recommended default for runtime read-only metadata access and is significantly
812
+ * faster and lower-memory than [[schemaContext]]. Use [[schemaContext]] for schema authoring,
813
+ * custom-attribute deserialization, or anywhere you need the full ecschema-metadata object graph.
814
+ * @beta
815
+ */
816
+ getSchemaView(): Promise<SchemaView>;
817
+ private _hydrateSchemas;
798
818
  /** Get the linkTableRelationships for this IModel */
799
819
  get relationships(): Relationships;
800
820
  /** Get the CodeSpecs in this IModel. */
@@ -825,7 +845,7 @@ export declare abstract class IModelDb extends IModel {
825
845
  getInstanceArgs(instanceId?: Id64String, baseClassName?: string, federationGuid?: GuidString, code?: CodeProps): IModelJsNative.ResolveInstanceKeyArgs;
826
846
  /** Get metadata for a class. This method will load the metadata from the iModel into the cache as a side-effect, if necessary.
827
847
  * @throws [[IModelError]] if the metadata cannot be found nor loaded.
828
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `getSchemaItem` from `SchemaContext` class instead.
848
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `getSchemaView()` on the iModel and call `view.findClass(...)` instead.
829
849
  *
830
850
  * @example
831
851
  * * ```typescript
@@ -833,12 +853,13 @@ export declare abstract class IModelDb extends IModel {
833
853
  * const metaData: EntityMetaData = imodel.getMetaData("SchemaName:ClassName");
834
854
  *
835
855
  * // Replacement:
836
- * const metaData: EntityClass | undefined = imodel.schemaContext.getSchemaItemSync("SchemaName", "ClassName", EntityClass);
856
+ * const view = await imodel.getSchemaView();
857
+ * const cls = view.findClass("SchemaName:ClassName");
837
858
  * ```
838
859
  */
839
860
  getMetaData(classFullName: string): EntityMetaData;
840
861
  /** Identical to [[getMetaData]], except it returns `undefined` instead of throwing an error if the metadata cannot be found nor loaded.
841
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `getSchemaItem` from `SchemaContext` class instead.
862
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `getSchemaView()` on the iModel and call `view.findClass(...)` instead.
842
863
  *
843
864
  * @example
844
865
  * * ```typescript
@@ -846,7 +867,8 @@ export declare abstract class IModelDb extends IModel {
846
867
  * const metaData: EntityMetaData | undefined = imodel.tryGetMetaData("SchemaName:ClassName");
847
868
  *
848
869
  * // Replacement:
849
- * const metaData: EntityClass | undefined = imodel.schemaContext.getSchemaItemSync("SchemaName.ClassName", EntityClass);
870
+ * const view = await imodel.getSchemaView();
871
+ * const cls = view.findClass("SchemaName:ClassName");
850
872
  * ```
851
873
  */
852
874
  tryGetMetaData(classFullName: string): EntityMetaData | undefined;
@@ -857,7 +879,7 @@ export declare abstract class IModelDb extends IModel {
857
879
  * @param func The callback to be invoked on each property
858
880
  * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
859
881
  * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
860
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `forEachProperty` instead.
882
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `getSchemaView()` on the iModel and iterate `view.findClass(classFullName)?.getProperties()` instead.
861
883
  *
862
884
  * @example
863
885
  * ```typescript
@@ -867,9 +889,10 @@ export declare abstract class IModelDb extends IModel {
867
889
  * }, false);
868
890
  *
869
891
  * // Replacement:
870
- * await IModelDb.forEachProperty(imodel, "TestDomain.TestDomainClass", true, (propName: string, property: Property) => {
871
- * console.log(`Property name: ${propName}, Property type: ${property.propertyType}`);
872
- * }, false);
892
+ * const view = await imodel.getSchemaView();
893
+ * for (const property of view.findClass("BisCore:Element")?.getProperties() ?? []) {
894
+ * console.log(`Property name: ${property.name}, Kind: ${property.kind}`);
895
+ * }
873
896
  * ```
874
897
  */
875
898
  static forEachMetaData(iModel: IModelDb, classFullName: string, wantSuper: boolean, func: PropertyCallback, includeCustom?: boolean): void;
@@ -879,7 +902,7 @@ export declare abstract class IModelDb extends IModel {
879
902
  * @param func The callback to be invoked on each property
880
903
  * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
881
904
  * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
882
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `forEachProperty` from `SchemaContext` class instead.
905
+ * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `getSchemaView()` on the iModel and iterate `view.findClass(classFullName)?.getProperties()` instead.
883
906
  *
884
907
  * @example
885
908
  * ```typescript
@@ -889,9 +912,10 @@ export declare abstract class IModelDb extends IModel {
889
912
  * });
890
913
  *
891
914
  * // Replacement:
892
- * imodel.schemaContext.forEachProperty("BisCore:Element", true, (propName: string, property: Property) => {
893
- * console.log(`Property name: ${propName}, Property type: ${property.propertyType}`);
894
- * });
915
+ * const view = await imodel.getSchemaView();
916
+ * for (const property of view.findClass("BisCore:Element")?.getProperties() ?? []) {
917
+ * console.log(`Property name: ${property.name}, Kind: ${property.kind}`);
918
+ * }
895
919
  * ```
896
920
  */
897
921
  forEachMetaData(classFullName: string, wantSuper: boolean, func: PropertyCallback, includeCustom?: boolean): void;
@@ -950,13 +974,13 @@ export declare abstract class IModelDb extends IModel {
950
974
  * @param prop the FilePropertyProps that describes the new property
951
975
  * @param value either a string or a blob to save as the file property
952
976
  * @note This method should not be called from {TxnManager.withIndirectTxnModeAsync} or {TxnManager.withIndirectTxnMode}.
953
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use EditTxn.saveFileProperty instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
977
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use EditTxn.saveFileProperty instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
954
978
  */
955
979
  saveFileProperty(prop: FilePropertyProps, strValue: string | undefined, blobVal?: Uint8Array): void;
956
980
  /** delete a "file property" from this iModel
957
981
  * @param prop the FilePropertyProps that describes the property
958
982
  * @note This method should not be called from {TxnManager.withIndirectTxnModeAsync} or {TxnManager.withIndirectTxnMode}.
959
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use EditTxn.deleteFileProperty instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
983
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use EditTxn.deleteFileProperty instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
960
984
  */
961
985
  deleteFileProperty(prop: FilePropertyProps): void;
962
986
  /** Query for the next available major id for a "file property" from this iModel.
@@ -1106,12 +1130,12 @@ export declare abstract class IModelDb extends IModel {
1106
1130
  * @param dict The SettingDictionary object to stringify and save.
1107
1131
  * @note All saved `SettingDictionary`s are loaded into [[workspace.settings]] every time an iModel is opened.
1108
1132
  * @see [[Settings.addDictionary]] to register a dictionary for the current session only without persisting it.
1109
- * @beta @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use EditTxn.saveSettingDictionary instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1133
+ * @beta @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use EditTxn.saveSettingDictionary instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1110
1134
  */
1111
1135
  saveSettingDictionary(name: string, dict: SettingsContainer): void;
1112
1136
  /** Delete a SettingDictionary, previously added with [[saveSettingDictionary]], from this iModel.
1113
1137
  * @param name The name of the dictionary to delete.
1114
- * @beta @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use EditTxn.deleteSettingDictionary instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1138
+ * @beta @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use EditTxn.deleteSettingDictionary instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1115
1139
  */
1116
1140
  deleteSettingDictionary(name: string): void;
1117
1141
  /** Load all setting dictionaries in this iModel into `this.workspace.settings` */
@@ -1238,13 +1262,13 @@ export declare namespace IModelDb {
1238
1262
  * @param props The data for the new model.
1239
1263
  * @returns The newly inserted model's Id.
1240
1264
  * @throws [[IModelError]] if insertion fails.
1241
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.insertModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1265
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.insertModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1242
1266
  */
1243
1267
  insertModel(props: ModelProps): Id64String;
1244
1268
  /** Update an existing model.
1245
1269
  * @param props the properties of the model to change
1246
1270
  * @throws [[IModelError]] if update fails.
1247
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.updateModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1271
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.updateModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1248
1272
  */
1249
1273
  updateModel(props: UpdateModelOptions): void;
1250
1274
  /** Mark the geometry of [[GeometricModel]] as having changed, by recording an indirect change to its GeometryGuid property.
@@ -1254,14 +1278,14 @@ export declare namespace IModelDb {
1254
1278
  * Cached [Tile]($frontend)s are only invalidated after the geometry guid of the model changes.
1255
1279
  * @note This will throw IModelError with [IModelStatus.VersionTooOld]($core-bentley) if a version of the BisCore schema older than 1.0.11 is present in the iModel.
1256
1280
  * @throws [[IModelError]] if the update fails.
1257
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.updateGeometryGuid instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1281
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.updateGeometryGuid instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1258
1282
  * @see [[TxnManager.onModelGeometryChanged]] for the event emitted in response to such a change.
1259
1283
  */
1260
1284
  updateGeometryGuid(modelId: Id64String): void;
1261
1285
  /** Delete one or more existing models.
1262
1286
  * @param ids The Ids of the models to be deleted
1263
1287
  * @throws [[IModelError]] if deletion fails.
1264
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.deleteModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1288
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.deleteModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1265
1289
  */
1266
1290
  deleteModel(ids: Id64Arg): void;
1267
1291
  /** For each specified [[GeometricModel]], attempts to obtain the union of the volumes of all geometric elements within that model.
@@ -1354,7 +1378,7 @@ export declare namespace IModelDb {
1354
1378
  * However when `elProps.federationGuid` is not present or undefined, a new Guid will be generated and stored on the resultant element. But
1355
1379
  * the value of `elProps.federationGuid` is *not* updated. Generally, it is best to re-read the element after inserting (e.g. via [[getElementProps]])
1356
1380
  * if you intend to continue working with it. That will ensure its values reflect the persistent state.
1357
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.insertElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1381
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.insertElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1358
1382
  */
1359
1383
  insertElement(elProps: ElementProps, options?: InsertElementOptions): Id64String;
1360
1384
  /**
@@ -1367,16 +1391,26 @@ export declare namespace IModelDb {
1367
1391
  * @note The values of `classFullName` and `model` *may not be changed* by this method. Further, it will permute the `elProps` object by adding or
1368
1392
  * overwriting their values to the correct values.
1369
1393
  * @throws [[ITwinError]] if update fails.
1370
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.updateElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1394
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.updateElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1371
1395
  */
1372
1396
  updateElement<T extends ElementProps>(elProps: Partial<T>): void;
1373
1397
  /** Delete one or more elements from this iModel.
1374
1398
  * @param ids The set of Ids of the element(s) to be deleted
1375
1399
  * @throws [[ITwinError]]
1376
1400
  * @see deleteDefinitionElements
1377
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.deleteElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1401
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.deleteElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1378
1402
  */
1379
1403
  deleteElement(ids: Id64Arg): void;
1404
+ /**
1405
+ * Delete multiple elements from the iModel.
1406
+ * @param ids The ids of the elements to delete. All ids must be well-formed and valid [[Id64String]]s.
1407
+ * @param deleteOptions Options for the delete operation.
1408
+ * @returns A result object containing information about the deletion operation success and the element ids that failed to delete (if any).
1409
+ * @throws [[ITwinError]] if any of the supplied ids are not well-formed/valid [[Id64String]]s.
1410
+ * @deprecated in 5.1.9 - will not be removed until after 2026-08-15. Use EditTxn.deleteElements instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1411
+ * @beta
1412
+ */
1413
+ deleteElements(ids: Id64Array, deleteOptions?: BulkDeleteElementsArgs): BulkDeleteElementsResult;
1380
1414
  /** DefinitionElements can only be deleted if it can be determined that they are not referenced by other Elements.
1381
1415
  * This *usage query* can be expensive since it may involve scanning the GeometryStreams of all GeometricElements.
1382
1416
  * Since [[deleteElement]] does not perform these additional checks, it fails in order to prevent potentially referenced DefinitionElements from being deleted.
@@ -1385,7 +1419,7 @@ export declare namespace IModelDb {
1385
1419
  * DefinitionElements rather than calling this method separately for each one. Ids that are not valid DefinitionElements will be ignored.
1386
1420
  * @returns An IdSet of the DefinitionElements that are used and were therefore not deleted.
1387
1421
  * @see deleteElement
1388
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.deleteDefinitionElements instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1422
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.deleteDefinitionElements instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1389
1423
  */
1390
1424
  deleteDefinitionElements(definitionElementIds: Id64Array): Id64Set;
1391
1425
  /** Query for the child elements of the specified element.
@@ -1434,19 +1468,19 @@ export declare namespace IModelDb {
1434
1468
  * @returns the id of the newly inserted aspect.
1435
1469
  * @note Aspect Ids may collide with element Ids, so don't put both in a container like Set or Map
1436
1470
  * use [EntityReference]($common) for that instead.
1437
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.insertAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1471
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.insertAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1438
1472
  */
1439
1473
  insertAspect(aspectProps: ElementAspectProps): Id64String;
1440
1474
  /** Update an exist ElementAspect within the iModel.
1441
1475
  * @param aspectProps The properties to use to update the ElementAspect.
1442
1476
  * @throws [[IModelError]] if unable to update the ElementAspect.
1443
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.updateAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1477
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.updateAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1444
1478
  */
1445
1479
  updateAspect(aspectProps: ElementAspectProps): void;
1446
1480
  /** Delete one or more ElementAspects from this iModel.
1447
1481
  * @param aspectInstanceIds The set of instance Ids of the ElementAspect(s) to be deleted
1448
1482
  * @throws [[IModelError]] if unable to delete the ElementAspect.
1449
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.deleteAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1483
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.deleteAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1450
1484
  */
1451
1485
  deleteAspect(aspectInstanceIds: Id64Arg): void;
1452
1486
  }
@@ -1469,7 +1503,7 @@ export declare namespace IModelDb {
1469
1503
  accessLevel?: BlobContainer.RequestAccessLevel;
1470
1504
  }): Promise<ViewStore.CloudAccess>;
1471
1505
  /**
1472
- * @beta @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.saveDefaultViewStore instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1506
+ * @beta @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use EditTxn.saveDefaultViewStore instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
1473
1507
  */
1474
1508
  saveDefaultViewStore(arg: CloudSqlite.ContainerProps): void;
1475
1509
  /** Query for the array of ViewDefinitionProps of the specified class and matching the specified IsPrivate setting.
@@ -1667,7 +1701,45 @@ export declare class BriefcaseDb extends IModelDb {
1667
1701
  enableChangesetStatTracking(): Promise<void>;
1668
1702
  disableChangesetStatTracking(): Promise<void>;
1669
1703
  getAllChangesetHealthData(): Promise<ChangesetHealthStats[]>;
1670
- /** Revert timeline changes and then push resulting changeset */
1704
+ /**
1705
+ * Whether file-based transactions are enabled for this briefcase.
1706
+ *
1707
+ * When enabled, transaction data is stored in separate temporary `.txn` files rather than in the
1708
+ * briefcase's internal transaction table. This avoids SQLite blob size limits and reduces memory
1709
+ * pressure for very large changesets, at the cost of additional disk I/O.
1710
+ * @see [[enableFileBasedTxns]] to enable, [[disableFileBasedTxns]] to disable.
1711
+ * @internal
1712
+ */
1713
+ get isFileBasedTxnsEnabled(): boolean;
1714
+ /**
1715
+ * Enable file-based transactions for this briefcase.
1716
+ * @throws IModelError with [[ChangeSetStatus.HasUncommittedChanges]] if there are unsaved changes.
1717
+ * @throws IModelError with [[ChangeSetStatus.HasLocalChanges]] if there are pending transactions.
1718
+ * @internal
1719
+ */
1720
+ enableFileBasedTxns(): void;
1721
+ /**
1722
+ * Disable file-based transactions for this briefcase, reverting to the default storage mode
1723
+ * (transactions stored within the briefcase's internal transaction table).
1724
+ * @throws IModelError with [[ChangeSetStatus.HasUncommittedChanges]] if there are unsaved changes.
1725
+ * @throws IModelError with [[ChangeSetStatus.HasLocalChanges]] if there are pending transactions.
1726
+ * @internal
1727
+ */
1728
+ disableFileBasedTxns(): void;
1729
+ private _setFileBasedTxnsSetting;
1730
+ /**
1731
+ * Revert timeline changes and push the resulting changeset.
1732
+ *
1733
+ * Pulls the latest changes, acquires the schema lock, reverts the inclusive range of
1734
+ * changesets `[toIndex..current]`, and pushes the revert as a new changeset. On failure,
1735
+ * follow the behavior specified by `arg.inCaseOfFailure`, which may discard local changes,
1736
+ * retain local changes, or delete the briefcase.
1737
+ *
1738
+ * @param arg - Arguments specifying the target changeset index, push options, access token, and failure handling behavior.
1739
+ * @throws IModelError with [[ChangeSetStatus.ApplyError]] if `toIndex` is not specified.
1740
+ * @throws IModelError with [[ChangeSetStatus.HasUncommittedChanges]] if there are unsaved changes.
1741
+ * @throws IModelError with [[ChangeSetStatus.HasLocalChanges]] if there are pending transactions.
1742
+ */
1671
1743
  revertAndPushChanges(arg: RevertChangesArgs): Promise<void>;
1672
1744
  /**
1673
1745
  * Push changes to iModelHub.