@itwin/core-backend 5.8.2 → 5.9.0-dev.10

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 (751) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/lib/cjs/BackendHubAccess.d.ts +38 -0
  3. package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
  4. package/lib/cjs/BackendHubAccess.js.map +1 -1
  5. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  6. package/lib/cjs/BisCoreSchema.js.map +1 -1
  7. package/lib/cjs/BlobContainerService.js.map +1 -1
  8. package/lib/cjs/BriefcaseManager.js +3 -3
  9. package/lib/cjs/BriefcaseManager.js.map +1 -1
  10. package/lib/cjs/CatalogDb.js.map +1 -1
  11. package/lib/cjs/Category.d.ts +37 -7
  12. package/lib/cjs/Category.d.ts.map +1 -1
  13. package/lib/cjs/Category.js +33 -42
  14. package/lib/cjs/Category.js.map +1 -1
  15. package/lib/cjs/ChangeSummaryManager.js +2 -2
  16. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  17. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  18. package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
  19. package/lib/cjs/ChangesetECAdaptor.js +253 -250
  20. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  21. package/lib/cjs/ChannelControl.d.ts +29 -0
  22. package/lib/cjs/ChannelControl.d.ts.map +1 -1
  23. package/lib/cjs/ChannelControl.js.map +1 -1
  24. package/lib/cjs/CheckpointManager.js +1 -1
  25. package/lib/cjs/CheckpointManager.js.map +1 -1
  26. package/lib/cjs/ClassRegistry.js +5 -5
  27. package/lib/cjs/ClassRegistry.js.map +1 -1
  28. package/lib/cjs/CloudSqlite.d.ts +1 -1
  29. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  30. package/lib/cjs/CloudSqlite.js +68 -13
  31. package/lib/cjs/CloudSqlite.js.map +1 -1
  32. package/lib/cjs/CodeService.js.map +1 -1
  33. package/lib/cjs/CodeSpecs.d.ts +32 -3
  34. package/lib/cjs/CodeSpecs.d.ts.map +1 -1
  35. package/lib/cjs/CodeSpecs.js +48 -20
  36. package/lib/cjs/CodeSpecs.js.map +1 -1
  37. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  38. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  39. package/lib/cjs/DevTools.js.map +1 -1
  40. package/lib/cjs/DisplayStyle.d.ts +18 -3
  41. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  42. package/lib/cjs/DisplayStyle.js +10 -21
  43. package/lib/cjs/DisplayStyle.js.map +1 -1
  44. package/lib/cjs/ECDb.js.map +1 -1
  45. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  46. package/lib/cjs/ECSqlRowExecutor.js.map +1 -1
  47. package/lib/cjs/ECSqlStatement.js.map +1 -1
  48. package/lib/cjs/ECSqlSyncReader.js.map +1 -1
  49. package/lib/cjs/EditTxn.d.ts +262 -0
  50. package/lib/cjs/EditTxn.d.ts.map +1 -0
  51. package/lib/cjs/EditTxn.js +548 -0
  52. package/lib/cjs/EditTxn.js.map +1 -0
  53. package/lib/cjs/Element.d.ts +74 -5
  54. package/lib/cjs/Element.d.ts.map +1 -1
  55. package/lib/cjs/Element.js +63 -75
  56. package/lib/cjs/Element.js.map +1 -1
  57. package/lib/cjs/ElementAspect.d.ts +10 -0
  58. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  59. package/lib/cjs/ElementAspect.js +21 -12
  60. package/lib/cjs/ElementAspect.js.map +1 -1
  61. package/lib/cjs/ElementGraphics.js.map +1 -1
  62. package/lib/cjs/ElementTreeWalker.d.ts +56 -3
  63. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  64. package/lib/cjs/ElementTreeWalker.js +53 -40
  65. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  66. package/lib/cjs/Entity.js.map +1 -1
  67. package/lib/cjs/EntityReferences.js.map +1 -1
  68. package/lib/cjs/ExportGraphics.js.map +1 -1
  69. package/lib/cjs/ExternalSource.d.ts +11 -2
  70. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  71. package/lib/cjs/ExternalSource.js +10 -8
  72. package/lib/cjs/ExternalSource.js.map +1 -1
  73. package/lib/cjs/FontFile.js.map +1 -1
  74. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  75. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  76. package/lib/cjs/GeometrySummary.js +47 -47
  77. package/lib/cjs/GeometrySummary.js.map +1 -1
  78. package/lib/cjs/IModelDb.d.ts +66 -22
  79. package/lib/cjs/IModelDb.d.ts.map +1 -1
  80. package/lib/cjs/IModelDb.js +183 -297
  81. package/lib/cjs/IModelDb.js.map +1 -1
  82. package/lib/cjs/IModelDbFonts.js.map +1 -1
  83. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  84. package/lib/cjs/IModelHost.d.ts +58 -1
  85. package/lib/cjs/IModelHost.d.ts.map +1 -1
  86. package/lib/cjs/IModelHost.js +89 -0
  87. package/lib/cjs/IModelHost.js.map +1 -1
  88. package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
  89. package/lib/cjs/IModelJsFs.js.map +1 -1
  90. package/lib/cjs/ImageSourceConversion.js.map +1 -1
  91. package/lib/cjs/IpcHost.d.ts.map +1 -1
  92. package/lib/cjs/IpcHost.js +15 -6
  93. package/lib/cjs/IpcHost.js.map +1 -1
  94. package/lib/cjs/LineStyle.d.ts +47 -7
  95. package/lib/cjs/LineStyle.d.ts.map +1 -1
  96. package/lib/cjs/LineStyle.js +38 -33
  97. package/lib/cjs/LineStyle.js.map +1 -1
  98. package/lib/cjs/LocalHub.js +1 -1
  99. package/lib/cjs/LocalHub.js.map +1 -1
  100. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  101. package/lib/cjs/LockControl.d.ts +85 -1
  102. package/lib/cjs/LockControl.d.ts.map +1 -1
  103. package/lib/cjs/LockControl.js.map +1 -1
  104. package/lib/cjs/Material.d.ts +8 -1
  105. package/lib/cjs/Material.d.ts.map +1 -1
  106. package/lib/cjs/Material.js +6 -12
  107. package/lib/cjs/Material.js.map +1 -1
  108. package/lib/cjs/Model.d.ts +59 -20
  109. package/lib/cjs/Model.d.ts.map +1 -1
  110. package/lib/cjs/Model.js +38 -80
  111. package/lib/cjs/Model.js.map +1 -1
  112. package/lib/cjs/NativeAppStorage.js.map +1 -1
  113. package/lib/cjs/NativeHost.js.map +1 -1
  114. package/lib/cjs/NavigationRelationship.js.map +1 -1
  115. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  116. package/lib/cjs/PropertyStore.js.map +1 -1
  117. package/lib/cjs/Relationship.d.ts +72 -7
  118. package/lib/cjs/Relationship.d.ts.map +1 -1
  119. package/lib/cjs/Relationship.js +39 -21
  120. package/lib/cjs/Relationship.js.map +1 -1
  121. package/lib/cjs/RpcBackend.js.map +1 -1
  122. package/lib/cjs/SQLiteDb.js.map +1 -1
  123. package/lib/cjs/Schema.js.map +1 -1
  124. package/lib/cjs/SchemaSync.js +4 -4
  125. package/lib/cjs/SchemaSync.js.map +1 -1
  126. package/lib/cjs/SchemaUtils.js.map +1 -1
  127. package/lib/cjs/SheetIndex.d.ts +9 -0
  128. package/lib/cjs/SheetIndex.d.ts.map +1 -1
  129. package/lib/cjs/SheetIndex.js +38 -35
  130. package/lib/cjs/SheetIndex.js.map +1 -1
  131. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  132. package/lib/cjs/SqliteStatement.js.map +1 -1
  133. package/lib/cjs/StashManager.js +1 -1
  134. package/lib/cjs/StashManager.js.map +1 -1
  135. package/lib/cjs/Texture.d.ts +6 -0
  136. package/lib/cjs/Texture.d.ts.map +1 -1
  137. package/lib/cjs/Texture.js +6 -14
  138. package/lib/cjs/Texture.js.map +1 -1
  139. package/lib/cjs/TileStorage.js.map +1 -1
  140. package/lib/cjs/TxnManager.d.ts +105 -9
  141. package/lib/cjs/TxnManager.d.ts.map +1 -1
  142. package/lib/cjs/TxnManager.js +194 -15
  143. package/lib/cjs/TxnManager.js.map +1 -1
  144. package/lib/cjs/ViewDefinition.d.ts +21 -1
  145. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  146. package/lib/cjs/ViewDefinition.js +27 -66
  147. package/lib/cjs/ViewDefinition.js.map +1 -1
  148. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  149. package/lib/cjs/ViewStore.js.map +1 -1
  150. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +14 -6
  151. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
  152. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +33 -27
  153. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  154. package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
  155. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
  156. package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
  157. package/lib/cjs/annotations/TextAnnotationElement.js +6 -5
  158. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  159. package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
  160. package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
  161. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
  162. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  163. package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
  164. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
  165. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
  166. package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
  167. package/lib/cjs/core-backend.d.ts +1 -0
  168. package/lib/cjs/core-backend.d.ts.map +1 -1
  169. package/lib/cjs/core-backend.js +1 -0
  170. package/lib/cjs/core-backend.js.map +1 -1
  171. package/lib/cjs/domains/FunctionalElements.d.ts +6 -2
  172. package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
  173. package/lib/cjs/domains/FunctionalElements.js +8 -13
  174. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  175. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  176. package/lib/cjs/domains/GenericElements.d.ts +11 -4
  177. package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
  178. package/lib/cjs/domains/GenericElements.js +13 -24
  179. package/lib/cjs/domains/GenericElements.js.map +1 -1
  180. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  181. package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
  182. package/lib/cjs/internal/ChannelAdmin.d.ts +15 -0
  183. package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -1
  184. package/lib/cjs/internal/ChannelAdmin.js +5 -3
  185. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  186. package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
  187. package/lib/cjs/internal/FontFileImpl.js.map +1 -1
  188. package/lib/cjs/internal/HubMock.d.ts +2 -0
  189. package/lib/cjs/internal/HubMock.d.ts.map +1 -1
  190. package/lib/cjs/internal/HubMock.js +7 -0
  191. package/lib/cjs/internal/HubMock.js.map +1 -1
  192. package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
  193. package/lib/cjs/internal/IntegrityCheck.js.map +1 -1
  194. package/lib/cjs/internal/NativePlatform.js.map +1 -1
  195. package/lib/cjs/internal/NoLocks.d.ts.map +1 -1
  196. package/lib/cjs/internal/NoLocks.js +6 -0
  197. package/lib/cjs/internal/NoLocks.js.map +1 -1
  198. package/lib/cjs/internal/OnlineStatus.js.map +1 -1
  199. package/lib/cjs/internal/ServerBasedLocks.d.ts +12 -0
  200. package/lib/cjs/internal/ServerBasedLocks.d.ts.map +1 -1
  201. package/lib/cjs/internal/ServerBasedLocks.js +285 -4
  202. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
  203. package/lib/cjs/internal/Symbols.d.ts +4 -0
  204. package/lib/cjs/internal/Symbols.d.ts.map +1 -1
  205. package/lib/cjs/internal/Symbols.js +5 -1
  206. package/lib/cjs/internal/Symbols.js.map +1 -1
  207. package/lib/cjs/internal/annotations/fields.d.ts +3 -2
  208. package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
  209. package/lib/cjs/internal/annotations/fields.js +7 -6
  210. package/lib/cjs/internal/annotations/fields.js.map +1 -1
  211. package/lib/cjs/internal/cross-package.js.map +1 -1
  212. package/lib/cjs/internal/workspace/SettingsEditorImpl.d.ts +18 -3
  213. package/lib/cjs/internal/workspace/SettingsEditorImpl.d.ts.map +1 -1
  214. package/lib/cjs/internal/workspace/SettingsEditorImpl.js +49 -242
  215. package/lib/cjs/internal/workspace/SettingsEditorImpl.js.map +1 -1
  216. package/lib/cjs/internal/workspace/SettingsImpl.d.ts.map +1 -1
  217. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
  218. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  219. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts +0 -1
  220. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  221. package/lib/cjs/internal/workspace/WorkspaceImpl.js +70 -41
  222. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  223. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  224. package/lib/cjs/rpc/multipart.js.map +1 -1
  225. package/lib/cjs/rpc/tracing.js.map +1 -1
  226. package/lib/cjs/rpc/web/logging.js.map +1 -1
  227. package/lib/cjs/rpc/web/request.js.map +1 -1
  228. package/lib/cjs/rpc/web/response.js.map +1 -1
  229. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  230. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  231. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  232. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  233. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  234. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  235. package/lib/cjs/workspace/Settings.d.ts +11 -5
  236. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  237. package/lib/cjs/workspace/Settings.js.map +1 -1
  238. package/lib/cjs/workspace/SettingsDb.d.ts +20 -99
  239. package/lib/cjs/workspace/SettingsDb.d.ts.map +1 -1
  240. package/lib/cjs/workspace/SettingsDb.js +23 -7
  241. package/lib/cjs/workspace/SettingsDb.js.map +1 -1
  242. package/lib/cjs/workspace/SettingsEditor.d.ts +40 -226
  243. package/lib/cjs/workspace/SettingsEditor.d.ts.map +1 -1
  244. package/lib/cjs/workspace/SettingsEditor.js +86 -25
  245. package/lib/cjs/workspace/SettingsEditor.js.map +1 -1
  246. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  247. package/lib/cjs/workspace/Workspace.d.ts +7 -11
  248. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  249. package/lib/cjs/workspace/Workspace.js.map +1 -1
  250. package/lib/cjs/workspace/WorkspaceEditor.d.ts +14 -0
  251. package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -1
  252. package/lib/cjs/workspace/WorkspaceEditor.js +1 -1
  253. package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
  254. package/lib/esm/BackendHubAccess.d.ts +38 -0
  255. package/lib/esm/BackendHubAccess.d.ts.map +1 -1
  256. package/lib/esm/BackendHubAccess.js.map +1 -1
  257. package/lib/esm/BackendLoggerCategory.js.map +1 -1
  258. package/lib/esm/BisCoreSchema.js.map +1 -1
  259. package/lib/esm/BlobContainerService.js.map +1 -1
  260. package/lib/esm/BriefcaseManager.js +3 -3
  261. package/lib/esm/BriefcaseManager.js.map +1 -1
  262. package/lib/esm/CatalogDb.js.map +1 -1
  263. package/lib/esm/Category.d.ts +37 -7
  264. package/lib/esm/Category.d.ts.map +1 -1
  265. package/lib/esm/Category.js +33 -42
  266. package/lib/esm/Category.js.map +1 -1
  267. package/lib/esm/ChangeSummaryManager.js +2 -2
  268. package/lib/esm/ChangeSummaryManager.js.map +1 -1
  269. package/lib/esm/ChangedElementsDb.js.map +1 -1
  270. package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
  271. package/lib/esm/ChangesetECAdaptor.js +253 -250
  272. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  273. package/lib/esm/ChannelControl.d.ts +29 -0
  274. package/lib/esm/ChannelControl.d.ts.map +1 -1
  275. package/lib/esm/ChannelControl.js.map +1 -1
  276. package/lib/esm/CheckpointManager.js +1 -1
  277. package/lib/esm/CheckpointManager.js.map +1 -1
  278. package/lib/esm/ClassRegistry.js +5 -5
  279. package/lib/esm/ClassRegistry.js.map +1 -1
  280. package/lib/esm/CloudSqlite.d.ts +1 -1
  281. package/lib/esm/CloudSqlite.d.ts.map +1 -1
  282. package/lib/esm/CloudSqlite.js +69 -14
  283. package/lib/esm/CloudSqlite.js.map +1 -1
  284. package/lib/esm/CodeService.js.map +1 -1
  285. package/lib/esm/CodeSpecs.d.ts +32 -3
  286. package/lib/esm/CodeSpecs.d.ts.map +1 -1
  287. package/lib/esm/CodeSpecs.js +49 -21
  288. package/lib/esm/CodeSpecs.js.map +1 -1
  289. package/lib/esm/ConcurrentQuery.js.map +1 -1
  290. package/lib/esm/CustomViewState3dCreator.js.map +1 -1
  291. package/lib/esm/DevTools.js.map +1 -1
  292. package/lib/esm/DisplayStyle.d.ts +18 -3
  293. package/lib/esm/DisplayStyle.d.ts.map +1 -1
  294. package/lib/esm/DisplayStyle.js +10 -21
  295. package/lib/esm/DisplayStyle.js.map +1 -1
  296. package/lib/esm/ECDb.js.map +1 -1
  297. package/lib/esm/ECSchemaXmlContext.js.map +1 -1
  298. package/lib/esm/ECSqlRowExecutor.js.map +1 -1
  299. package/lib/esm/ECSqlStatement.js.map +1 -1
  300. package/lib/esm/ECSqlSyncReader.js.map +1 -1
  301. package/lib/esm/EditTxn.d.ts +262 -0
  302. package/lib/esm/EditTxn.d.ts.map +1 -0
  303. package/lib/esm/EditTxn.js +543 -0
  304. package/lib/esm/EditTxn.js.map +1 -0
  305. package/lib/esm/Element.d.ts +74 -5
  306. package/lib/esm/Element.d.ts.map +1 -1
  307. package/lib/esm/Element.js +64 -76
  308. package/lib/esm/Element.js.map +1 -1
  309. package/lib/esm/ElementAspect.d.ts +10 -0
  310. package/lib/esm/ElementAspect.d.ts.map +1 -1
  311. package/lib/esm/ElementAspect.js +22 -13
  312. package/lib/esm/ElementAspect.js.map +1 -1
  313. package/lib/esm/ElementGraphics.js.map +1 -1
  314. package/lib/esm/ElementTreeWalker.d.ts +56 -3
  315. package/lib/esm/ElementTreeWalker.d.ts.map +1 -1
  316. package/lib/esm/ElementTreeWalker.js +53 -40
  317. package/lib/esm/ElementTreeWalker.js.map +1 -1
  318. package/lib/esm/Entity.js.map +1 -1
  319. package/lib/esm/EntityReferences.js.map +1 -1
  320. package/lib/esm/ExportGraphics.js.map +1 -1
  321. package/lib/esm/ExternalSource.d.ts +11 -2
  322. package/lib/esm/ExternalSource.d.ts.map +1 -1
  323. package/lib/esm/ExternalSource.js +10 -8
  324. package/lib/esm/ExternalSource.js.map +1 -1
  325. package/lib/esm/FontFile.js.map +1 -1
  326. package/lib/esm/GeoCoordConfig.js.map +1 -1
  327. package/lib/esm/GeographicCRSServices.js.map +1 -1
  328. package/lib/esm/GeometrySummary.js +47 -47
  329. package/lib/esm/GeometrySummary.js.map +1 -1
  330. package/lib/esm/IModelDb.d.ts +66 -22
  331. package/lib/esm/IModelDb.d.ts.map +1 -1
  332. package/lib/esm/IModelDb.js +185 -299
  333. package/lib/esm/IModelDb.js.map +1 -1
  334. package/lib/esm/IModelDbFonts.js.map +1 -1
  335. package/lib/esm/IModelElementCloneContext.js.map +1 -1
  336. package/lib/esm/IModelHost.d.ts +58 -1
  337. package/lib/esm/IModelHost.d.ts.map +1 -1
  338. package/lib/esm/IModelHost.js +91 -2
  339. package/lib/esm/IModelHost.js.map +1 -1
  340. package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
  341. package/lib/esm/IModelJsFs.js.map +1 -1
  342. package/lib/esm/ImageSourceConversion.js.map +1 -1
  343. package/lib/esm/IpcHost.d.ts.map +1 -1
  344. package/lib/esm/IpcHost.js +16 -7
  345. package/lib/esm/IpcHost.js.map +1 -1
  346. package/lib/esm/LineStyle.d.ts +47 -7
  347. package/lib/esm/LineStyle.d.ts.map +1 -1
  348. package/lib/esm/LineStyle.js +38 -33
  349. package/lib/esm/LineStyle.js.map +1 -1
  350. package/lib/esm/LocalHub.js +1 -1
  351. package/lib/esm/LocalHub.js.map +1 -1
  352. package/lib/esm/LocalhostIpcHost.js.map +1 -1
  353. package/lib/esm/LockControl.d.ts +85 -1
  354. package/lib/esm/LockControl.d.ts.map +1 -1
  355. package/lib/esm/LockControl.js.map +1 -1
  356. package/lib/esm/Material.d.ts +8 -1
  357. package/lib/esm/Material.d.ts.map +1 -1
  358. package/lib/esm/Material.js +6 -12
  359. package/lib/esm/Material.js.map +1 -1
  360. package/lib/esm/Model.d.ts +59 -20
  361. package/lib/esm/Model.d.ts.map +1 -1
  362. package/lib/esm/Model.js +39 -81
  363. package/lib/esm/Model.js.map +1 -1
  364. package/lib/esm/NativeAppStorage.js.map +1 -1
  365. package/lib/esm/NativeHost.js.map +1 -1
  366. package/lib/esm/NavigationRelationship.js.map +1 -1
  367. package/lib/esm/PromiseMemoizer.js.map +1 -1
  368. package/lib/esm/PropertyStore.js.map +1 -1
  369. package/lib/esm/Relationship.d.ts +72 -7
  370. package/lib/esm/Relationship.d.ts.map +1 -1
  371. package/lib/esm/Relationship.js +40 -22
  372. package/lib/esm/Relationship.js.map +1 -1
  373. package/lib/esm/RpcBackend.js.map +1 -1
  374. package/lib/esm/SQLiteDb.js.map +1 -1
  375. package/lib/esm/Schema.js.map +1 -1
  376. package/lib/esm/SchemaSync.js +5 -5
  377. package/lib/esm/SchemaSync.js.map +1 -1
  378. package/lib/esm/SchemaUtils.js.map +1 -1
  379. package/lib/esm/SheetIndex.d.ts +9 -0
  380. package/lib/esm/SheetIndex.d.ts.map +1 -1
  381. package/lib/esm/SheetIndex.js +38 -35
  382. package/lib/esm/SheetIndex.js.map +1 -1
  383. package/lib/esm/SqliteChangesetReader.js.map +1 -1
  384. package/lib/esm/SqliteStatement.js.map +1 -1
  385. package/lib/esm/StashManager.js +1 -1
  386. package/lib/esm/StashManager.js.map +1 -1
  387. package/lib/esm/Texture.d.ts +6 -0
  388. package/lib/esm/Texture.d.ts.map +1 -1
  389. package/lib/esm/Texture.js +6 -14
  390. package/lib/esm/Texture.js.map +1 -1
  391. package/lib/esm/TileStorage.js.map +1 -1
  392. package/lib/esm/TxnManager.d.ts +105 -9
  393. package/lib/esm/TxnManager.d.ts.map +1 -1
  394. package/lib/esm/TxnManager.js +194 -15
  395. package/lib/esm/TxnManager.js.map +1 -1
  396. package/lib/esm/ViewDefinition.d.ts +21 -1
  397. package/lib/esm/ViewDefinition.d.ts.map +1 -1
  398. package/lib/esm/ViewDefinition.js +27 -66
  399. package/lib/esm/ViewDefinition.js.map +1 -1
  400. package/lib/esm/ViewStateHydrator.js.map +1 -1
  401. package/lib/esm/ViewStore.js.map +1 -1
  402. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +14 -6
  403. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
  404. package/lib/esm/annotations/ElementDrivesTextAnnotation.js +33 -27
  405. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  406. package/lib/esm/annotations/FrameGeometry.js.map +1 -1
  407. package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
  408. package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
  409. package/lib/esm/annotations/TextAnnotationElement.js +6 -5
  410. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  411. package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
  412. package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
  413. package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
  414. package/lib/esm/core-backend.d.ts +1 -0
  415. package/lib/esm/core-backend.d.ts.map +1 -1
  416. package/lib/esm/core-backend.js +1 -0
  417. package/lib/esm/core-backend.js.map +1 -1
  418. package/lib/esm/domains/FunctionalElements.d.ts +6 -2
  419. package/lib/esm/domains/FunctionalElements.d.ts.map +1 -1
  420. package/lib/esm/domains/FunctionalElements.js +8 -13
  421. package/lib/esm/domains/FunctionalElements.js.map +1 -1
  422. package/lib/esm/domains/FunctionalSchema.js.map +1 -1
  423. package/lib/esm/domains/GenericElements.d.ts +11 -4
  424. package/lib/esm/domains/GenericElements.d.ts.map +1 -1
  425. package/lib/esm/domains/GenericElements.js +13 -24
  426. package/lib/esm/domains/GenericElements.js.map +1 -1
  427. package/lib/esm/domains/GenericSchema.js.map +1 -1
  428. package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
  429. package/lib/esm/internal/ChannelAdmin.d.ts +15 -0
  430. package/lib/esm/internal/ChannelAdmin.d.ts.map +1 -1
  431. package/lib/esm/internal/ChannelAdmin.js +6 -4
  432. package/lib/esm/internal/ChannelAdmin.js.map +1 -1
  433. package/lib/esm/internal/ElementLRUCache.js.map +1 -1
  434. package/lib/esm/internal/FontFileImpl.js.map +1 -1
  435. package/lib/esm/internal/HubMock.d.ts +2 -0
  436. package/lib/esm/internal/HubMock.d.ts.map +1 -1
  437. package/lib/esm/internal/HubMock.js +7 -0
  438. package/lib/esm/internal/HubMock.js.map +1 -1
  439. package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
  440. package/lib/esm/internal/IntegrityCheck.js.map +1 -1
  441. package/lib/esm/internal/NativePlatform.js.map +1 -1
  442. package/lib/esm/internal/NoLocks.d.ts.map +1 -1
  443. package/lib/esm/internal/NoLocks.js +6 -0
  444. package/lib/esm/internal/NoLocks.js.map +1 -1
  445. package/lib/esm/internal/OnlineStatus.js.map +1 -1
  446. package/lib/esm/internal/ServerBasedLocks.d.ts +12 -0
  447. package/lib/esm/internal/ServerBasedLocks.d.ts.map +1 -1
  448. package/lib/esm/internal/ServerBasedLocks.js +286 -5
  449. package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
  450. package/lib/esm/internal/Symbols.d.ts +4 -0
  451. package/lib/esm/internal/Symbols.d.ts.map +1 -1
  452. package/lib/esm/internal/Symbols.js +4 -0
  453. package/lib/esm/internal/Symbols.js.map +1 -1
  454. package/lib/esm/internal/annotations/fields.d.ts +3 -2
  455. package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
  456. package/lib/esm/internal/annotations/fields.js +7 -6
  457. package/lib/esm/internal/annotations/fields.js.map +1 -1
  458. package/lib/esm/internal/cross-package.js.map +1 -1
  459. package/lib/esm/internal/workspace/SettingsEditorImpl.d.ts +18 -3
  460. package/lib/esm/internal/workspace/SettingsEditorImpl.d.ts.map +1 -1
  461. package/lib/esm/internal/workspace/SettingsEditorImpl.js +52 -246
  462. package/lib/esm/internal/workspace/SettingsEditorImpl.js.map +1 -1
  463. package/lib/esm/internal/workspace/SettingsImpl.d.ts.map +1 -1
  464. package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
  465. package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  466. package/lib/esm/internal/workspace/WorkspaceImpl.d.ts +0 -1
  467. package/lib/esm/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  468. package/lib/esm/internal/workspace/WorkspaceImpl.js +71 -41
  469. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  470. package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  471. package/lib/esm/rpc/multipart.js.map +1 -1
  472. package/lib/esm/rpc/tracing.js.map +1 -1
  473. package/lib/esm/rpc/web/logging.js.map +1 -1
  474. package/lib/esm/rpc/web/request.js.map +1 -1
  475. package/lib/esm/rpc/web/response.js.map +1 -1
  476. package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  477. package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  478. package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  479. package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  480. package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  481. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  482. package/lib/esm/test/AdvancedEqual.js.map +1 -1
  483. package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
  484. package/lib/esm/test/AttachDb.test.js +11 -11
  485. package/lib/esm/test/AttachDb.test.js.map +1 -1
  486. package/lib/esm/test/ElementDrivesElement.test.d.ts +20 -19
  487. package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -1
  488. package/lib/esm/test/ElementDrivesElement.test.js +134 -119
  489. package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
  490. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  491. package/lib/esm/test/GeometryTestUtil.js.map +1 -1
  492. package/lib/esm/test/IModelHost.test.js +56 -2
  493. package/lib/esm/test/IModelHost.test.js.map +1 -1
  494. package/lib/esm/test/IModelTestUtils.d.ts +23 -23
  495. package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
  496. package/lib/esm/test/IModelTestUtils.js +466 -449
  497. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  498. package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
  499. package/lib/esm/test/IpcHost.test.js.map +1 -1
  500. package/lib/esm/test/KnownTestLocations.js.map +1 -1
  501. package/lib/esm/test/PrintElementTree.js.map +1 -1
  502. package/lib/esm/test/PropertyDb.test.js +2 -2
  503. package/lib/esm/test/PropertyDb.test.js.map +1 -1
  504. package/lib/esm/test/RevisionUtility.js.map +1 -1
  505. package/lib/esm/test/SchemaUtils.test.js +25 -25
  506. package/lib/esm/test/SchemaUtils.test.js.map +1 -1
  507. package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
  508. package/lib/esm/test/SquashSchemaAndDataChanges.test.js +156 -147
  509. package/lib/esm/test/SquashSchemaAndDataChanges.test.js.map +1 -1
  510. package/lib/esm/test/TestChangeSetUtility.d.ts.map +1 -1
  511. package/lib/esm/test/TestChangeSetUtility.js +11 -7
  512. package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
  513. package/lib/esm/test/TestEditTxn.d.ts +8 -0
  514. package/lib/esm/test/TestEditTxn.d.ts.map +1 -0
  515. package/lib/esm/test/TestEditTxn.js +34 -0
  516. package/lib/esm/test/TestEditTxn.js.map +1 -0
  517. package/lib/esm/test/TestUtils.d.ts +1 -0
  518. package/lib/esm/test/TestUtils.d.ts.map +1 -1
  519. package/lib/esm/test/TestUtils.js +8 -1
  520. package/lib/esm/test/TestUtils.js.map +1 -1
  521. package/lib/esm/test/annotations/Fields.test.js +135 -143
  522. package/lib/esm/test/annotations/Fields.test.js.map +1 -1
  523. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
  524. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  525. package/lib/esm/test/annotations/TextAnnotation.test.js +156 -99
  526. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  527. package/lib/esm/test/annotations/TextBlock.test.js +5 -3
  528. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
  529. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
  530. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
  531. package/lib/esm/test/categories/Category.test.js +63 -3
  532. package/lib/esm/test/categories/Category.test.js.map +1 -1
  533. package/lib/esm/test/codespec/CodeSpec.test.js +88 -5
  534. package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
  535. package/lib/esm/test/ecdb/CTE.test.js +88 -88
  536. package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
  537. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +19 -19
  538. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
  539. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
  540. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
  541. package/lib/esm/test/ecdb/ECDb.test.js +72 -72
  542. package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
  543. package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
  544. package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
  545. package/lib/esm/test/ecdb/ECSqlAst.test.js +68 -67
  546. package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
  547. package/lib/esm/test/ecdb/ECSqlQuery.test.js +6 -6
  548. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  549. package/lib/esm/test/ecdb/ECSqlStatement.test.js +332 -333
  550. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  551. package/lib/esm/test/ecdb/ECSqlSyncReader.test.js.map +1 -1
  552. package/lib/esm/test/ecdb/QueryReaders.test.js +47 -44
  553. package/lib/esm/test/ecdb/QueryReaders.test.js.map +1 -1
  554. package/lib/esm/test/ecdb/SqliteStatement.test.js +2 -2
  555. package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
  556. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.d.ts.map +1 -1
  557. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js +30 -28
  558. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
  559. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
  560. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
  561. package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
  562. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  563. package/lib/esm/test/element/DeleteDefinitionElements.test.js +159 -143
  564. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  565. package/lib/esm/test/element/ElementAspect.test.js +90 -82
  566. package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
  567. package/lib/esm/test/element/ElementDependencyGraph.test.d.ts.map +1 -1
  568. package/lib/esm/test/element/ElementDependencyGraph.test.js +51 -43
  569. package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
  570. package/lib/esm/test/element/ElementRoundTrip.test.js +176 -177
  571. package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
  572. package/lib/esm/test/element/ExcludedElements.test.js +2 -2
  573. package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
  574. package/lib/esm/test/element/ExternalSource.test.js +40 -38
  575. package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
  576. package/lib/esm/test/element/NullStructArray.test.js +23 -22
  577. package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
  578. package/lib/esm/test/element/ProjectInformationRecord.test.js +5 -2
  579. package/lib/esm/test/element/ProjectInformationRecord.test.js.map +1 -1
  580. package/lib/esm/test/element/SheetInformationAspect.test.js +43 -11
  581. package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
  582. package/lib/esm/test/element/UrlLink.test.js +2 -2
  583. package/lib/esm/test/element/UrlLink.test.js.map +1 -1
  584. package/lib/esm/test/font/FontFile.test.js.map +1 -1
  585. package/lib/esm/test/font/IModelDbFonts.test.js +87 -73
  586. package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
  587. package/lib/esm/test/hubaccess/ApplyChangeset.test.js +194 -155
  588. package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
  589. package/lib/esm/test/hubaccess/BriefcaseManager.test.js +2 -4
  590. package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
  591. package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
  592. package/lib/esm/test/hubaccess/Rebase.test.js +369 -303
  593. package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
  594. package/lib/esm/test/hubaccess/SemanticRebase.test.js +467 -392
  595. package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
  596. package/lib/esm/test/imageData.js.map +1 -1
  597. package/lib/esm/test/imodel/Code.test.js +31 -31
  598. package/lib/esm/test/imodel/Code.test.js.map +1 -1
  599. package/lib/esm/test/imodel/ElementTreeWalker.test.js +57 -48
  600. package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
  601. package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
  602. package/lib/esm/test/imodel/IModel.test.js +463 -388
  603. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  604. package/lib/esm/test/imodel/ProjectExtents.test.js +2 -2
  605. package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
  606. package/lib/esm/test/imodel/SchemaXmlImport.test.js +13 -13
  607. package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
  608. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
  609. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
  610. package/lib/esm/test/incrementalSchemaLocater/TestContext.d.ts.map +1 -1
  611. package/lib/esm/test/incrementalSchemaLocater/TestContext.js +2 -2
  612. package/lib/esm/test/incrementalSchemaLocater/TestContext.js.map +1 -1
  613. package/lib/esm/test/index.d.ts +1 -0
  614. package/lib/esm/test/index.d.ts.map +1 -1
  615. package/lib/esm/test/index.js +1 -0
  616. package/lib/esm/test/index.js.map +1 -1
  617. package/lib/esm/test/misc/DevTools.test.js.map +1 -1
  618. package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
  619. package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
  620. package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
  621. package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
  622. package/lib/esm/test/rpc/response.test.js.map +1 -1
  623. package/lib/esm/test/schema/ClassRegistry.test.js +122 -121
  624. package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
  625. package/lib/esm/test/schema/FunctionalDomain.test.js +36 -34
  626. package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
  627. package/lib/esm/test/schema/GenericDomain.test.js +114 -94
  628. package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
  629. package/lib/esm/test/schema/IModelSchemaContext.test.js +11 -10
  630. package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
  631. package/lib/esm/test/schema/SchemaImportCallbacks.test.js +226 -211
  632. package/lib/esm/test/schema/SchemaImportCallbacks.test.js.map +1 -1
  633. package/lib/esm/test/sheetindex/SheetIndex.test.d.ts +1 -3
  634. package/lib/esm/test/sheetindex/SheetIndex.test.d.ts.map +1 -1
  635. package/lib/esm/test/sheetindex/SheetIndex.test.js +312 -247
  636. package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
  637. package/lib/esm/test/standalone/ChangeMerge.test.js +101 -82
  638. package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
  639. package/lib/esm/test/standalone/ChangesetReader.test.js +242 -213
  640. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  641. package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
  642. package/lib/esm/test/standalone/DisplayStyle.test.js +43 -40
  643. package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
  644. package/lib/esm/test/standalone/Drawing.test.js +4 -3
  645. package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
  646. package/lib/esm/test/standalone/EditTxn.test.d.ts +2 -0
  647. package/lib/esm/test/standalone/EditTxn.test.d.ts.map +1 -0
  648. package/lib/esm/test/standalone/EditTxn.test.js +219 -0
  649. package/lib/esm/test/standalone/EditTxn.test.js.map +1 -0
  650. package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
  651. package/lib/esm/test/standalone/ElementMesh.test.js +16 -13
  652. package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
  653. package/lib/esm/test/standalone/ExportGraphics.test.js +40 -34
  654. package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
  655. package/lib/esm/test/standalone/GeometryChangeEvents.test.js +11 -15
  656. package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
  657. package/lib/esm/test/standalone/GeometryStream.test.js +212 -165
  658. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  659. package/lib/esm/test/standalone/HubMock.test.js +31 -25
  660. package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
  661. package/lib/esm/test/standalone/IModelLimits.test.js +11 -8
  662. package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
  663. package/lib/esm/test/standalone/IModelWrite.test.d.ts +2 -2
  664. package/lib/esm/test/standalone/IModelWrite.test.d.ts.map +1 -1
  665. package/lib/esm/test/standalone/IModelWrite.test.js +211 -169
  666. package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
  667. package/lib/esm/test/standalone/ITwinWorkspace.test.d.ts +2 -0
  668. package/lib/esm/test/standalone/ITwinWorkspace.test.d.ts.map +1 -0
  669. package/lib/esm/test/standalone/ITwinWorkspace.test.js +236 -0
  670. package/lib/esm/test/standalone/ITwinWorkspace.test.js.map +1 -0
  671. package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js +25 -22
  672. package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
  673. package/lib/esm/test/standalone/IntegrityCheck.test.js +20 -18
  674. package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
  675. package/lib/esm/test/standalone/MergeConflict.test.d.ts +2 -2
  676. package/lib/esm/test/standalone/MergeConflict.test.d.ts.map +1 -1
  677. package/lib/esm/test/standalone/MergeConflict.test.js +49 -33
  678. package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
  679. package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
  680. package/lib/esm/test/standalone/RenderMaterialElement.test.js +5 -5
  681. package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
  682. package/lib/esm/test/standalone/RenderTimeline.test.js +3 -2
  683. package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
  684. package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
  685. package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
  686. package/lib/esm/test/standalone/SectionDrawing.test.js +7 -7
  687. package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
  688. package/lib/esm/test/standalone/ServerBasedLocks.test.js +928 -22
  689. package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
  690. package/lib/esm/test/standalone/Setting.test.js.map +1 -1
  691. package/lib/esm/test/standalone/Settings.test.js +26 -4
  692. package/lib/esm/test/standalone/Settings.test.js.map +1 -1
  693. package/lib/esm/test/standalone/SettingsSchemas.test.js +2 -1
  694. package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
  695. package/lib/esm/test/standalone/SnapshotDb.test.js +3 -1
  696. package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
  697. package/lib/esm/test/standalone/StandaloneDb.test.js +27 -26
  698. package/lib/esm/test/standalone/StandaloneDb.test.js.map +1 -1
  699. package/lib/esm/test/standalone/Texture.test.js +5 -4
  700. package/lib/esm/test/standalone/Texture.test.js.map +1 -1
  701. package/lib/esm/test/standalone/TileCache.test.d.ts.map +1 -1
  702. package/lib/esm/test/standalone/TileCache.test.js +5 -3
  703. package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
  704. package/lib/esm/test/standalone/TileTree.test.js +35 -31
  705. package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
  706. package/lib/esm/test/standalone/TxnManager.test.js +700 -653
  707. package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
  708. package/lib/esm/test/standalone/ViewDefinition.test.js +295 -229
  709. package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
  710. package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
  711. package/lib/esm/test/standalone/Workspace.test.js +72 -22
  712. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  713. package/lib/esm/test/standalone/iModelDb.test.js.map +1 -1
  714. package/lib/esm/test/workspace/SettingsDb.test.js +28 -456
  715. package/lib/esm/test/workspace/SettingsDb.test.js.map +1 -1
  716. package/lib/esm/workspace/Settings.d.ts +11 -5
  717. package/lib/esm/workspace/Settings.d.ts.map +1 -1
  718. package/lib/esm/workspace/Settings.js.map +1 -1
  719. package/lib/esm/workspace/SettingsDb.d.ts +20 -99
  720. package/lib/esm/workspace/SettingsDb.d.ts.map +1 -1
  721. package/lib/esm/workspace/SettingsDb.js +20 -6
  722. package/lib/esm/workspace/SettingsDb.js.map +1 -1
  723. package/lib/esm/workspace/SettingsEditor.d.ts +40 -226
  724. package/lib/esm/workspace/SettingsEditor.d.ts.map +1 -1
  725. package/lib/esm/workspace/SettingsEditor.js +85 -24
  726. package/lib/esm/workspace/SettingsEditor.js.map +1 -1
  727. package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
  728. package/lib/esm/workspace/Workspace.d.ts +7 -11
  729. package/lib/esm/workspace/Workspace.d.ts.map +1 -1
  730. package/lib/esm/workspace/Workspace.js.map +1 -1
  731. package/lib/esm/workspace/WorkspaceEditor.d.ts +14 -0
  732. package/lib/esm/workspace/WorkspaceEditor.d.ts.map +1 -1
  733. package/lib/esm/workspace/WorkspaceEditor.js +1 -1
  734. package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
  735. package/package.json +13 -13
  736. package/lib/cjs/internal/workspace/SettingsDbImpl.d.ts +0 -38
  737. package/lib/cjs/internal/workspace/SettingsDbImpl.d.ts.map +0 -1
  738. package/lib/cjs/internal/workspace/SettingsDbImpl.js +0 -108
  739. package/lib/cjs/internal/workspace/SettingsDbImpl.js.map +0 -1
  740. package/lib/cjs/internal/workspace/SettingsSqliteDb.d.ts +0 -14
  741. package/lib/cjs/internal/workspace/SettingsSqliteDb.d.ts.map +0 -1
  742. package/lib/cjs/internal/workspace/SettingsSqliteDb.js +0 -40
  743. package/lib/cjs/internal/workspace/SettingsSqliteDb.js.map +0 -1
  744. package/lib/esm/internal/workspace/SettingsDbImpl.d.ts +0 -38
  745. package/lib/esm/internal/workspace/SettingsDbImpl.d.ts.map +0 -1
  746. package/lib/esm/internal/workspace/SettingsDbImpl.js +0 -104
  747. package/lib/esm/internal/workspace/SettingsDbImpl.js.map +0 -1
  748. package/lib/esm/internal/workspace/SettingsSqliteDb.d.ts +0 -14
  749. package/lib/esm/internal/workspace/SettingsSqliteDb.d.ts.map +0 -1
  750. package/lib/esm/internal/workspace/SettingsSqliteDb.js +0 -36
  751. package/lib/esm/internal/workspace/SettingsSqliteDb.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ClassRegistry.test.js","sourceRoot":"","sources":["../../../../src/test/schema/ClassRegistry.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,WAAW,EAAE,IAAI,EAAE,mBAAmB,EAA0B,SAAS,EAEzE,cAAc,EAA0C,WAAW,GACpE,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAAS,cAAc,EAClI,MAAM,EAAc,qBAAqB,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,GACnF,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QA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AAC,sBAAsB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;QAC9E,OAAO,GAAG,eAAe,CAAC,sBAAsB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;QAC9E,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,GAAG,EAAE;QACT,OAAO,EAAE,KAAK,EAAE,CAAC;QACjB,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uEAAuE,EAAE,KAAK,IAAI,EAAE;QACrF,MAAM,OAAO,CAAC,mBAAmB,CAAC;YAChC;;;;;;;;;;;;;;;;;;;OAmBC;SACF,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,mBAAmB,CAAC;YAChC;;;;;;;;OAQC;SACF,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;QAC9D,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAC9D,UAAkB,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC7C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAE9D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;QAC9D,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AAGL,CAAC,CAAC,CAAC;AACH,mDAAmD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { assert, expect } from \"chai\";\r\nimport * as sinon from \"sinon\";\r\nimport * as path from \"path\";\r\nimport {\r\n BisCodeSpec, Code, ConcreteEntityTypes, DefinitionElementProps, ECJsNames, ElementAspectProps, ElementProps, EntityReferenceSet, ModelProps,\r\n PropertyMetaData,\r\n RelatedElement, RelatedElementProps, RelationshipProps, SchemaState,\r\n} from \"@itwin/core-common\";\r\nimport {\r\n DefinitionElement, DefinitionModel, ElementRefersToElements, Entity, EntityReferences, IModelDb, IModelJsFs, Model, RepositoryLink,\r\n Schema, SnapshotDb, SpatialViewDefinition, StandaloneDb, UrlLink, ViewDefinition3d,\r\n} from \"../../core-backend\";\r\nimport { IModelTestUtils } from \"../IModelTestUtils\";\r\nimport { KnownTestLocations } from \"../KnownTestLocations\";\r\nimport { Element } from \"../../Element\";\r\nimport { Schemas } from \"../../Schema\";\r\nimport { ClassRegistry } from \"../../ClassRegistry\";\r\nimport { OpenMode } from \"@itwin/core-bentley\";\r\nimport { EntityClass, NavigationProperty, PrimitiveProperty, SchemaItemKey, SchemaKey } from \"@itwin/ecschema-metadata\";\r\n\r\ndescribe(\"Class Registry\", () => {\r\n let imodel: SnapshotDb;\r\n\r\n before(() => {\r\n const seedFileName = IModelTestUtils.resolveAssetFile(\"test.bim\");\r\n const testFileName = IModelTestUtils.prepareOutputFile(\"ClassRegistry\", \"ClassRegistryTest.bim\");\r\n imodel = IModelTestUtils.createSnapshotFromSeed(testFileName, seedFileName);\r\n assert.exists(imodel);\r\n });\r\n\r\n after(() => {\r\n imodel?.close();\r\n });\r\n\r\n it(\"should verify the Entity metadata of known element subclasses\", async () => {\r\n const code1 = new Code({ spec: \"0x10\", scope: \"0x11\", value: \"RF1.dgn\" });\r\n const el = imodel.elements.getElement(code1);\r\n assert.exists(el);\r\n if (el) {\r\n const metaData = await el.getMetaData();\r\n assert.exists(metaData);\r\n\r\n assert.equal(metaData.fullName, el.classFullName.replace(\":\", \".\"));\r\n // I happen to know that this is a BisCore:RepositoryLink\r\n assert.equal(metaData.fullName, RepositoryLink.classFullName.replace(\":\", \".\"));\r\n // Check the metadata on the class itself\r\n assert.isDefined(metaData.baseClass);\r\n assert.equal(metaData.baseClass?.fullName, UrlLink.classFullName.replace(\":\", \".\"));\r\n assert.isTrue(metaData.customAttributes?.has(\"BisCore.ClassHasHandler\"));\r\n // Check the metadata on the one property that RepositoryLink defines, RepositoryGuid\r\n const repositoryGuidProperty = await metaData.getProperty(\"repositoryGuid\") as PrimitiveProperty;\r\n assert.isDefined(repositoryGuidProperty);\r\n assert.equal(repositoryGuidProperty.extendedTypeName, \"BeGuid\");\r\n assert.isTrue(repositoryGuidProperty.customAttributes?.has(\"CoreCustomAttributes.HiddenProperty\"));\r\n }\r\n const el2 = imodel.elements.getElement(\"0x34\");\r\n assert.exists(el2);\r\n if (el2) {\r\n const metaData = await el2.getMetaData();\r\n assert.exists(metaData);\r\n\r\n assert.equal(metaData.fullName, el2.classFullName.replace(\":\", \".\"));\r\n // I happen to know that this is a BisCore.SpatialViewDefinition\r\n assert.equal(metaData.fullName, SpatialViewDefinition.classFullName.replace(\":\", \".\"));\r\n assert.isDefined(metaData.baseClass);\r\n assert.equal(metaData.baseClass?.fullName, ViewDefinition3d.classFullName.replace(\":\", \".\"));\r\n const modelSelectorProperty = await metaData.getProperty(\"modelSelector\") as NavigationProperty;\r\n assert.isDefined(modelSelectorProperty);\r\n assert.equal(modelSelectorProperty.relationshipClass.fullName, \"BisCore.SpatialViewDefinitionUsesModelSelector\");\r\n }\r\n });\r\n\r\n it(\"should verify Entity metadata with both base class and mixin properties\", async () => {\r\n const schemaPathname = path.join(KnownTestLocations.assetsDir, \"TestDomain.ecschema.xml\");\r\n await imodel.importSchemas([schemaPathname]); // will throw an exception if import fails\r\n\r\n const testDomainClass = await imodel.schemaContext.getSchemaItem(\"TestDomain\", \"TestDomainClass\", EntityClass);\r\n assert.isDefined(testDomainClass);\r\n\r\n assert.isDefined(testDomainClass?.baseClass);\r\n assert.equal(testDomainClass?.baseClass?.fullName, DefinitionElement.classFullName.replace(\":\", \".\"));\r\n\r\n assert.isDefined(testDomainClass?.mixins);\r\n assert.equal(testDomainClass?.mixins.length, 1);\r\n assert.equal(testDomainClass?.mixins[0].fullName, \"TestDomain.IMixin\");\r\n\r\n // Verify that the forEach method which is called when constructing an entity\r\n // is picking up all expected properties.\r\n const testData: string[] = [];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n IModelDb.forEachMetaData(imodel, \"TestDomain:TestDomainClass\", true, (propName: string, _property: PropertyMetaData) => {\r\n testData.push(ECJsNames.toJsName(propName));\r\n }, false);\r\n\r\n const expectedString = testData.find((testString: string) => {\r\n return testString === \"testMixinProperty\";\r\n });\r\n\r\n assert.isDefined(expectedString);\r\n });\r\n});\r\n\r\ndescribe(\"Class Registry - getRootMetaData\", () => {\r\n let imodel: StandaloneDb;\r\n\r\n before(async () => {\r\n const seedFileName = IModelTestUtils.resolveAssetFile(\"test.bim\");\r\n const testFileName = IModelTestUtils.prepareOutputFile(\"ClassRegistry\", \"GetRootMetaData.bim\");\r\n IModelJsFs.copySync(seedFileName, testFileName);\r\n\r\n const schemaState: SchemaState = StandaloneDb.validateSchemas(testFileName, true);\r\n assert.strictEqual(schemaState, SchemaState.UpgradeRecommended);\r\n StandaloneDb.upgradeStandaloneSchemas(testFileName);\r\n\r\n imodel = StandaloneDb.openFile(testFileName, OpenMode.ReadWrite);\r\n assert.exists(imodel);\r\n await imodel.importSchemaStrings([\r\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <ECSchema schemaName=\"TestSchema1\" alias=\"ts1\" version=\"01.00\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.1\">\r\n <ECSchemaReference name=\"BisCore\" version=\"01.00\" alias=\"bis\"/>\r\n <ECSchemaReference name=\"CoreCustomAttributes\" version=\"01.00.03\" alias=\"CoreCA\"/>\r\n\r\n <ECEntityClass typeName=\"TestBase\">\r\n <BaseClass>bis:PhysicalElement</BaseClass>\r\n </ECEntityClass>\r\n\r\n <ECEntityClass typeName=\"TestDerived\">\r\n <BaseClass>TestBase</BaseClass>\r\n </ECEntityClass>\r\n\r\n <ECEntityClass typeName=\"ITestMixinForAspectsBase\">\r\n <ECCustomAttributes>\r\n <IsMixin xmlns=\"CoreCustomAttributes.01.00.03\">\r\n <AppliesToEntityClass>bis:ElementUniqueAspect</AppliesToEntityClass>\r\n </IsMixin>\r\n </ECCustomAttributes>\r\n </ECEntityClass>\r\n\r\n <ECEntityClass typeName=\"ITestMixinForAspectsDerived\">\r\n <BaseClass>ITestMixinForAspectsBase</BaseClass>\r\n <ECCustomAttributes>\r\n <IsMixin xmlns=\"CoreCustomAttributes.01.00.03\">\r\n <AppliesToEntityClass>bis:ElementUniqueAspect</AppliesToEntityClass>\r\n </IsMixin>\r\n </ECCustomAttributes>\r\n </ECEntityClass>\r\n\r\n <ECEntityClass typeName=\"ITestMixinForElements\" modifier=\"Abstract\">\r\n <ECCustomAttributes>\r\n <IsMixin xmlns=\"CoreCustomAttributes.01.00.03\">\r\n <AppliesToEntityClass>bis:Element</AppliesToEntityClass>\r\n </IsMixin>\r\n </ECCustomAttributes>\r\n </ECEntityClass>\r\n\r\n <ECEntityClass typeName=\"TestMixedInAndDerived\">\r\n <BaseClass>TestBase</BaseClass>\r\n <BaseClass>ITestMixinForElements</BaseClass>\r\n </ECEntityClass>\r\n\r\n </ECSchema>\r\n `,\r\n ]); // will throw an exception if import fails\r\n });\r\n\r\n after(() => {\r\n imodel?.close();\r\n });\r\n\r\n it(\"should get the root metadata\", async () => {\r\n for (const [testClass, expectedRoot] of [\r\n [\"TestSchema1.TestBase\", \"BisCore:Element\"],\r\n [\"TestSchema1.TestDerived\", \"BisCore:Element\"],\r\n [\"TestSchema1.ITestMixinForAspectsBase\", \"BisCore:ElementAspect\"],\r\n [\"TestSchema1.ITestMixinForAspectsDerived\", \"BisCore:ElementAspect\"],\r\n [\"TestSchema1.ITestMixinForElements\", \"BisCore:Element\"],\r\n [\"TestSchema1.TestMixedInAndDerived\", \"BisCore:Element\"],\r\n ] as const) {\r\n const rootMetaData = ClassRegistry.getRootEntity(imodel, testClass);\r\n expect(rootMetaData.replace(\".\", \":\")).to.equal(expectedRoot);\r\n }\r\n });\r\n});\r\n\r\ndescribe(\"Class Registry - generated classes\", () => {\r\n let imodel: SnapshotDb;\r\n const testSchemaPath = path.join(KnownTestLocations.assetsDir, \"TestGeneratedClasses.ecschema.xml\");\r\n\r\n before(async () => {\r\n const seedFileName = IModelTestUtils.resolveAssetFile(\"test.bim\");\r\n const testFileName = IModelTestUtils.prepareOutputFile(\"ClassRegistry\", \"GeneratedClasses.bim\");\r\n imodel = IModelTestUtils.createSnapshotFromSeed(testFileName, seedFileName);\r\n assert.exists(imodel);\r\n await imodel.importSchemas([testSchemaPath]); // will throw an exception if import fails\r\n });\r\n\r\n after(() => {\r\n imodel?.close();\r\n });\r\n\r\n interface TestModelWithNavPropProps extends ModelProps {\r\n elemNavProp: RelatedElementProps;\r\n aspectNavProp: RelatedElementProps;\r\n relNavProp: RelatedElementProps;\r\n }\r\n\r\n interface TestEntityProps extends DefinitionElementProps {\r\n prop: string;\r\n }\r\n\r\n interface LinkTableRelWithNavPropProps extends RelationshipProps {\r\n elemNavProp: RelatedElementProps;\r\n modelNavProp: RelatedElementProps;\r\n aspectNavProp: RelatedElementProps;\r\n }\r\n\r\n interface TestElementWithNavPropProps extends DefinitionElementProps {\r\n navProp: RelatedElementProps;\r\n }\r\n\r\n interface DerivedWithNavPropProps extends TestElementWithNavPropProps {\r\n derivedNavProp: RelatedElementProps;\r\n }\r\n\r\n interface TestAspectWithNavProp extends ElementAspectProps {\r\n navProp: RelatedElement;\r\n }\r\n\r\n class TestGeneratedClasses extends Schema {\r\n public static override get schemaName(): string { return \"TestGeneratedClasses\"; }\r\n public static get classes() {\r\n return [TestModelWithNavProp, TestElementWithNavProp, LinkTableRelWithNavProp, DerivedWithNavProp, Derived2, Derived3, Derived4, Derived5, Derived6];\r\n }\r\n public static registerSchema() {\r\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\r\n Schemas.unregisterSchema(this.schemaName);\r\n Schemas.registerSchema(this);\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n for (const class_ of this.classes) {\r\n ClassRegistry.register(class_, this);\r\n }\r\n }\r\n }\r\n\r\n public static unregisterSchema() {\r\n Schemas.unregisterSchema(this.schemaName);\r\n }\r\n }\r\n\r\n class TestElementWithNavProp extends DefinitionElement {\r\n public static override get className() { return \"TestElementWithNavProp\"; }\r\n public static override schema = TestGeneratedClasses;\r\n public navProp: RelatedElement;\r\n public constructor(props: TestElementWithNavPropProps, inIModel: IModelDb) {\r\n super(props, inIModel);\r\n this.navProp = new RelatedElement(props.navProp);\r\n }\r\n }\r\n\r\n class TestModelWithNavProp extends DefinitionModel {\r\n public static override get className() { return \"TestModelWithNavProp\"; }\r\n public static override schema = TestGeneratedClasses;\r\n public elemNavProp: RelatedElement;\r\n public aspectNavProp: RelatedElement;\r\n public relNavProp: RelatedElement;\r\n public constructor(props: TestModelWithNavPropProps, inIModel: IModelDb) {\r\n super(props, inIModel);\r\n this.elemNavProp = new RelatedElement(props.elemNavProp);\r\n this.aspectNavProp = new RelatedElement(props.aspectNavProp);\r\n this.relNavProp = new RelatedElement(props.relNavProp);\r\n }\r\n }\r\n\r\n class LinkTableRelWithNavProp extends ElementRefersToElements {\r\n public static override get className() { return \"LinkTableRelWithNavProp\"; }\r\n public static override schema = TestGeneratedClasses;\r\n public elemNavProp: RelatedElement;\r\n public aspectNavProp: RelatedElement;\r\n public modelNavProp: RelatedElement;\r\n public constructor(props: LinkTableRelWithNavPropProps, inIModel: IModelDb) {\r\n super(props, inIModel);\r\n this.elemNavProp = new RelatedElement(props.elemNavProp);\r\n this.aspectNavProp = new RelatedElement(props.aspectNavProp);\r\n this.modelNavProp = new RelatedElement(props.modelNavProp);\r\n }\r\n }\r\n\r\n class DerivedWithNavProp extends TestElementWithNavProp {\r\n public static override get className() { return \"DerivedWithNavProp\"; }\r\n public static override schema = TestGeneratedClasses;\r\n public derivedNavProp: RelatedElement;\r\n public constructor(props: DerivedWithNavPropProps, inIModel: IModelDb) {\r\n super(props, inIModel);\r\n this.derivedNavProp = new RelatedElement(props.derivedNavProp);\r\n }\r\n }\r\n\r\n class Derived2 extends DerivedWithNavProp {\r\n public static override get className() { return \"Derived2\"; }\r\n }\r\n class Derived3 extends Derived2 {\r\n public static override get className() { return \"Derived3\"; }\r\n }\r\n class Derived4 extends Derived3 {\r\n public static override get className() { return \"Derived4\"; }\r\n }\r\n class Derived5 extends Derived4 {\r\n public static override get className() { return \"Derived5\"; }\r\n }\r\n class Derived6 extends Derived5 {\r\n public static override get className() { return \"Derived6\"; }\r\n }\r\n\r\n class NonGeneratedElement extends DefinitionElement {\r\n public static override get className() { return \"NonGeneratedElement\"; }\r\n }\r\n\r\n it(\"Should provide correct schemas and full-names on generated classes\", async () => {\r\n await imodel.importSchemaStrings([\r\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <ECSchema schemaName=\"CustomA\" alias=\"custA\" version=\"1.0.0\"\r\n xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.1\">\r\n <ECSchemaReference name=\"BisCore\" version=\"01.00\" alias=\"bis\"/>\r\n <ECSchemaReference name=\"Functional\" version=\"1.00\" alias=\"func\"/>\r\n <ECEntityClass typeName=\"NonGeneratedElement\">\r\n <BaseClass>bis:DefinitionElement</BaseClass>\r\n </ECEntityClass>\r\n <ECEntityClass typeName=\"GeneratedElement\">\r\n <BaseClass>NonGeneratedElement</BaseClass>\r\n </ECEntityClass>\r\n <ECEntityClass typeName=\"ElementC\">\r\n <BaseClass>GeneratedElement</BaseClass>\r\n </ECEntityClass>\r\n </ECSchema>\r\n `,\r\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <ECSchema schemaName=\"CustomB\" alias=\"custB\" version=\"1.0.0\"\r\n xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.1\">\r\n <ECSchemaReference name=\"BisCore\" version=\"01.00\" alias=\"bis\"/>\r\n <ECSchemaReference name=\"Functional\" version=\"1.00\" alias=\"func\"/>\r\n <ECSchemaReference name=\"CustomA\" version=\"01.00\" alias=\"custA\"/>\r\n <ECEntityClass typeName=\"DummyElement\">\r\n <BaseClass>bis:DefinitionElement</BaseClass>\r\n </ECEntityClass>\r\n <ECEntityClass typeName=\"ErrorElement\">\r\n <BaseClass>custA:ElementC</BaseClass>\r\n </ECEntityClass>\r\n </ECSchema>\r\n `,\r\n ]);\r\n\r\n class CustomASchema extends Schema {\r\n public static override get schemaName(): string { return \"CustomA\"; }\r\n public static get classes(): typeof Entity[] {\r\n return [NonGeneratedElement];\r\n }\r\n public static registerSchema() {\r\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\r\n Schemas.unregisterSchema(this.schemaName);\r\n Schemas.registerSchema(this);\r\n for (const ecClass of this.classes) {\r\n ClassRegistry.register(ecClass, this);\r\n }\r\n }\r\n }\r\n\r\n public static unregisterSchema() {\r\n Schemas.unregisterSchema(this.schemaName);\r\n }\r\n }\r\n\r\n CustomASchema.registerSchema();\r\n\r\n class DummyElement extends DefinitionElement {\r\n public static override get className() { return \"DummyElement\"; }\r\n }\r\n\r\n class CustomBSchema extends Schema {\r\n public static override get schemaName(): string { return \"CustomB\"; }\r\n public static get classes() {\r\n return [DummyElement];\r\n }\r\n public static registerSchema() {\r\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\r\n Schemas.unregisterSchema(this.schemaName);\r\n Schemas.registerSchema(this);\r\n for (const ecClass of this.classes) {\r\n ClassRegistry.register(ecClass, this);\r\n }\r\n }\r\n }\r\n\r\n public static unregisterSchema() {\r\n Schemas.unregisterSchema(this.schemaName);\r\n }\r\n }\r\n\r\n CustomBSchema.registerSchema();\r\n\r\n const nonGeneratedElement = imodel.getJsClass(\"CustomA:NonGeneratedElement\");\r\n assert.equal(nonGeneratedElement.classFullName, \"CustomA:NonGeneratedElement\");\r\n const generatedElement = imodel.getJsClass(\"CustomA:GeneratedElement\");\r\n assert.equal(generatedElement.classFullName, \"CustomA:GeneratedElement\");\r\n const elementC = imodel.getJsClass(\"CustomA:ElementC\");\r\n assert.equal(elementC.classFullName, \"CustomA:ElementC\");\r\n const dummyElement = imodel.getJsClass(\"CustomB:DummyElement\");\r\n assert.equal(dummyElement.classFullName, \"CustomB:DummyElement\");\r\n\r\n //This is the class that had the wrong schema\r\n const errorElement = imodel.getJsClass(\"CustomB:ErrorElement\");\r\n assert.equal(errorElement.classFullName, \"CustomB:ErrorElement\");\r\n assert.isTrue(errorElement.schemaItemKey.matches(new SchemaItemKey(\"ErrorElement\", new SchemaKey(\"CustomB\", 1, 0, 0))));\r\n assert.equal(errorElement.className, \"ErrorElement\");\r\n assert.equal(errorElement.schema.schemaName, \"CustomB\");\r\n\r\n // Create an instance of ErrorElement\r\n const errorElementInstance = Entity.instantiate(errorElement, { classFullName: errorElement.classFullName }, imodel);\r\n assert.exists(errorElementInstance);\r\n assert.instanceOf(errorElementInstance, errorElement);\r\n assert.instanceOf(errorElementInstance, Entity);\r\n assert.equal(errorElementInstance.className, \"ErrorElement\");\r\n assert.equal(errorElementInstance.schemaName, \"CustomB\");\r\n const metadata = await errorElementInstance.getMetaData();\r\n assert.exists(metadata);\r\n assert.equal(metadata.fullName, \"CustomB.ErrorElement\");\r\n });\r\n\r\n // if a single inherited class is not generated, the entire hierarchy is considered not-generated\r\n it(\"should only generate automatic collectReferenceIds implementations for generated classes\", async () => {\r\n await imodel.importSchemas([testSchemaPath]); // will throw an exception if import fails\r\n\r\n class GeneratedTestElementWithNavProp extends imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:TestElementWithNavProp\") {\r\n constructor(props: TestElementWithNavPropProps) {\r\n super(props, imodel);\r\n }\r\n }\r\n\r\n const testEntityId = imodel.elements.insertElement({\r\n classFullName: \"TestGeneratedClasses:TestEntity\",\r\n prop: \"sample-value\",\r\n model: IModelDb.dictionaryId,\r\n code: Code.createEmpty(),\r\n } as TestEntityProps);\r\n\r\n const elemWithNavProp = new GeneratedTestElementWithNavProp({\r\n classFullName: \"TestGeneratedClasses:TestElementWithNavProp\",\r\n navProp: {\r\n id: testEntityId,\r\n relClassName: \"TestGeneratedClasses:ElemRel\",\r\n },\r\n } as TestElementWithNavPropProps);\r\n\r\n // eslint-disable-next-line @typescript-eslint/dot-notation\r\n assert.isDefined(GeneratedTestElementWithNavProp.prototype[\"collectReferenceIds\"]);\r\n expect(\r\n [...elemWithNavProp.getReferenceIds()],\r\n ).to.have.members([\r\n EntityReferences.fromEntityType(elemWithNavProp.model, ConcreteEntityTypes.Model),\r\n EntityReferences.fromEntityType(elemWithNavProp.code.scope, ConcreteEntityTypes.Element),\r\n EntityReferences.fromEntityType(testEntityId, ConcreteEntityTypes.Element),\r\n ]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const GeneratedTestAspectWithNavProp = imodel.getJsClass(\"TestGeneratedClasses:TestAspectWithNavProp\");\r\n assert.isTrue(GeneratedTestAspectWithNavProp.prototype.hasOwnProperty(\"collectReferenceIds\"));\r\n });\r\n\r\n it(\"should not override collectReferenceIds for BisCore schema classes\", async () => {\r\n // AnnotationFrameStyle is an example of an unregistered bis class without an implementation of collectReferenceIds\r\n assert.isTrue(imodel.getJsClass(\"BisCore:AnnotationFrameStyle\").prototype.hasOwnProperty(\"collectReferenceIds\"));\r\n });\r\n\r\n it(\"should get references from its bis superclass\", async () => {\r\n await imodel.importSchemas([testSchemaPath]); // will throw an exception if import fails\r\n\r\n class GeneratedTestElementWithNavProp extends imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:TestElementWithNavProp\") {\r\n constructor(props: ElementProps) {\r\n super(props, imodel);\r\n }\r\n }\r\n\r\n const testEntityId = imodel.elements.insertElement({\r\n classFullName: \"TestGeneratedClasses:TestEntity\",\r\n prop: \"sample-value\",\r\n model: IModelDb.dictionaryId,\r\n code: Code.createEmpty(),\r\n } as TestEntityProps);\r\n\r\n const elemWithNavProp = new GeneratedTestElementWithNavProp({\r\n classFullName: \"TestGeneratedClasses:TestElementWithNavProp\",\r\n navProp: new RelatedElement({\r\n id: testEntityId,\r\n relClassName: \"TestGeneratedClasses:ElemRel\",\r\n }),\r\n model: IModelDb.dictionaryId,\r\n code: new Code({\r\n scope: IModelDb.rootSubjectId,\r\n spec: imodel.codeSpecs.getByName(BisCodeSpec.spatialCategory).id,\r\n value: \"\",\r\n }),\r\n parent: new RelatedElement({\r\n // since we don't actually insert this element in this test, using an arbitrary id string\r\n id: \"0x0000ffff\",\r\n relClassName: \"BisCore:ElementOwnsChildElements\",\r\n }),\r\n } as TestElementWithNavPropProps);\r\n\r\n // super class here is Element so we should get the code.scope, model and parent as references\r\n expect(\r\n [...elemWithNavProp.getReferenceIds()],\r\n ).to.have.members([\r\n EntityReferences.fromEntityType(elemWithNavProp.model, ConcreteEntityTypes.Model),\r\n EntityReferences.fromEntityType(elemWithNavProp.code.scope, ConcreteEntityTypes.Element),\r\n elemWithNavProp.parent && EntityReferences.fromEntityType(elemWithNavProp.parent?.id, ConcreteEntityTypes.Element),\r\n EntityReferences.fromEntityType(testEntityId, ConcreteEntityTypes.Element),\r\n ].filter((x) => x !== undefined));\r\n\r\n const modelTestEntityIds = new Array(2).fill(undefined).map((_, index) => imodel.elements.insertElement({\r\n classFullName: \"TestGeneratedClasses:TestEntity\",\r\n prop: `model-value-${index}`,\r\n model: IModelDb.dictionaryId,\r\n code: Code.createEmpty(),\r\n } as TestEntityProps));\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const GeneratedTestAspectWithNavProp = imodel.getJsClass(\"TestGeneratedClasses:TestAspectWithNavProp\");\r\n\r\n const aspectWithNavPropId = imodel.elements.insertAspect({\r\n classFullName: GeneratedTestAspectWithNavProp.classFullName,\r\n navProp: { id: modelTestEntityIds[0], relClassName: \"TestGeneratedClasses:NonElemRel\" },\r\n element: { id: modelTestEntityIds[1] },\r\n } as TestAspectWithNavProp);\r\n\r\n class GeneratedTestModelWithNavProp extends imodel.getJsClass<typeof Model>(\"TestGeneratedClasses:TestModelWithNavProp\") {\r\n constructor(props: TestModelWithNavPropProps) {\r\n super(props, imodel);\r\n }\r\n }\r\n\r\n const modelWithNavProp = new GeneratedTestModelWithNavProp({\r\n classFullName: GeneratedTestModelWithNavProp.classFullName,\r\n modeledElement: { id: modelTestEntityIds[0] },\r\n parentModel: IModelDb.dictionaryId,\r\n elemNavProp: { id: modelTestEntityIds[1], relClassName: \"TestGeneratedClasses:ModelToElemNavRel\" },\r\n aspectNavProp: { id: aspectWithNavPropId, relClassName: \"TestGeneratedClasses:ModelToAspectNavRel\" },\r\n // removed due to a bug\r\n // relNavProp: { id: relWithNavPropId, relClassName: \"TestGeneratedClasses:ModelToRelNavRel\" },\r\n } as TestModelWithNavPropProps);\r\n\r\n const modelWithNavPropId = modelWithNavProp.insert();\r\n\r\n expect(\r\n [...modelWithNavProp.getReferenceIds()],\r\n ).to.have.members([\r\n EntityReferences.fromEntityType(modelTestEntityIds[1], ConcreteEntityTypes.Element),\r\n EntityReferences.fromEntityType(IModelDb.dictionaryId, ConcreteEntityTypes.Model),\r\n EntityReferences.fromEntityType(modelTestEntityIds[0], ConcreteEntityTypes.Element),\r\n EntityReferences.fromEntityType(aspectWithNavPropId, ConcreteEntityTypes.ElementAspect),\r\n // ignoring this one, because there seems to be a bug when specifying a relationship instance as a nav prop\r\n // EntityReferences.fromEntityType(relWithNavPropId, ConcreteEntityTypes.Relationship),\r\n ].filter((x) => x !== undefined));\r\n\r\n const relTestEntityIds = new Array(3).fill(undefined).map((_, index) => imodel.elements.insertElement({\r\n classFullName: \"TestGeneratedClasses:TestEntity\",\r\n prop: `rel-value-${index}`,\r\n model: IModelDb.dictionaryId,\r\n code: Code.createEmpty(),\r\n } as TestEntityProps));\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const GeneratedLinkTableRelWithNavProp = imodel.getJsClass<typeof LinkTableRelWithNavProp>(\"TestGeneratedClasses:LinkTableRelWithNavProp\");\r\n\r\n const relWithNavProp = new GeneratedLinkTableRelWithNavProp({\r\n classFullName: GeneratedLinkTableRelWithNavProp.classFullName,\r\n sourceId: relTestEntityIds[0],\r\n targetId: relTestEntityIds[1],\r\n elemNavProp: {\r\n id: relTestEntityIds[2],\r\n relClassName: \"TestGeneratedClasses:LinkTableRelToElemNavRel\",\r\n },\r\n modelNavProp: {\r\n id: modelWithNavPropId,\r\n relClassName: \"TestGeneratedClasses:LinkTableRelToModelNavRel\",\r\n },\r\n aspectNavProp: {\r\n id: aspectWithNavPropId,\r\n relClassName: \"TestGeneratedClasses:LinkTableRelToAspectNavRel\",\r\n },\r\n }, imodel);\r\n\r\n const _relWithNavPropId = relWithNavProp.insert();\r\n\r\n expect(\r\n [...relWithNavProp.getReferenceIds()],\r\n ).to.have.members([\r\n ...relTestEntityIds.map((id) => EntityReferences.fromEntityType(id, ConcreteEntityTypes.Element)),\r\n EntityReferences.fromEntityType(modelWithNavPropId, ConcreteEntityTypes.Model),\r\n EntityReferences.fromEntityType(aspectWithNavPropId, ConcreteEntityTypes.ElementAspect),\r\n ]);\r\n });\r\n\r\n it(\"should not override custom registered schema class implementations of collectReferenceIds\", async () => {\r\n const testImplReferenceId = \"TEST-INVALID-ID\";\r\n class MyTestElementWithNavProp extends TestElementWithNavProp {\r\n public override collectReferenceIds(referenceIds: EntityReferenceSet) {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(testImplReferenceId);\r\n }\r\n }\r\n class MyTestGeneratedClasses extends TestGeneratedClasses {\r\n public static override get classes() {\r\n return [MyTestElementWithNavProp, Derived2, Derived3, Derived4, Derived5, Derived6];\r\n }\r\n }\r\n imodel.jsClassMap.clear();\r\n MyTestGeneratedClasses.registerSchema();\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const ActualTestElementWithNavProp = imodel.getJsClass<typeof MyTestElementWithNavProp>(TestElementWithNavProp.classFullName);\r\n\r\n const testElementWithNavPropCollectReferencesSpy = sinon.spy(ActualTestElementWithNavProp.prototype, \"collectReferenceIds\");\r\n\r\n class ActualDerivedWithNavProp extends imodel.getJsClass<typeof Element>(DerivedWithNavProp.classFullName) {\r\n constructor(props: DerivedWithNavPropProps) {\r\n super(props, imodel);\r\n }\r\n }\r\n\r\n const testEntity1Id = imodel.elements.insertElement({\r\n classFullName: \"TestGeneratedClasses:TestEntity\",\r\n prop: \"sample-value-1\",\r\n model: IModelDb.dictionaryId,\r\n code: Code.createEmpty(),\r\n } as TestEntityProps);\r\n\r\n const testEntity2Id = imodel.elements.insertElement({\r\n classFullName: \"TestGeneratedClasses:TestEntity\",\r\n prop: \"sample-value-2\",\r\n model: IModelDb.dictionaryId,\r\n code: Code.createEmpty(),\r\n } as TestEntityProps);\r\n\r\n const elemWithNavProp = new ActualTestElementWithNavProp({\r\n classFullName: TestElementWithNavProp.classFullName,\r\n navProp: {\r\n id: testEntity1Id,\r\n relClassName: \"TestGeneratedClasses:ElemRel\",\r\n },\r\n } as TestElementWithNavPropProps, imodel);\r\n\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n assert.isDefined(ActualTestElementWithNavProp.prototype.collectReferenceIds);\r\n expect(\r\n [...elemWithNavProp.getReferenceIds()],\r\n ).to.have.members([\r\n EntityReferences.fromEntityType(elemWithNavProp.model, ConcreteEntityTypes.Model),\r\n EntityReferences.fromEntityType(elemWithNavProp.code.scope, ConcreteEntityTypes.Element),\r\n elemWithNavProp.parent && EntityReferences.fromEntityType(elemWithNavProp.parent?.id, ConcreteEntityTypes.Element),\r\n EntityReferences.fromEntityType(testImplReferenceId, ConcreteEntityTypes.Element),\r\n ].filter((x) => x !== undefined));\r\n\r\n expect(testElementWithNavPropCollectReferencesSpy.called).to.be.true;\r\n testElementWithNavPropCollectReferencesSpy.resetHistory();\r\n\r\n const derivedElemWithNavProp = new ActualDerivedWithNavProp({\r\n classFullName: DerivedWithNavProp.classFullName,\r\n navProp: {\r\n id: testEntity1Id,\r\n relClassName: \"TestGeneratedClasses:ElemRel\",\r\n },\r\n derivedNavProp: {\r\n id: testEntity2Id,\r\n relClassName: \"TestGeneratedClasses:DerivedElemRel\",\r\n },\r\n } as DerivedWithNavPropProps);\r\n\r\n // eslint-disable-next-line @typescript-eslint/dot-notation\r\n assert.isDefined(ActualDerivedWithNavProp.prototype[\"collectReferenceIds\"]);\r\n // This demonstrates that if a non-generated class has a registered non-biscore base, it will not get a generated impl,\r\n expect(\r\n [...derivedElemWithNavProp.getReferenceIds()],\r\n ).to.have.members([\r\n EntityReferences.fromEntityType(elemWithNavProp.model, ConcreteEntityTypes.Model),\r\n EntityReferences.fromEntityType(elemWithNavProp.code.scope, ConcreteEntityTypes.Element),\r\n elemWithNavProp.parent && EntityReferences.fromEntityType(elemWithNavProp.parent?.id, ConcreteEntityTypes.Element),\r\n EntityReferences.fromEntityType(testImplReferenceId, ConcreteEntityTypes.Element),\r\n ].filter((x) => x !== undefined));\r\n // explicitly check we called the super function\r\n // (we already know its implementation was called, because testImplReferenceId is in the derived call's result)\r\n expect(testElementWithNavPropCollectReferencesSpy.called).to.be.true;\r\n\r\n sinon.restore();\r\n MyTestGeneratedClasses.unregisterSchema();\r\n });\r\n\r\n it(\"should work along a complex chain of overrides\", async () => {\r\n class MyDerived2 extends Derived2 {\r\n public override collectReferenceIds(referenceIds: EntityReferenceSet) {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(\"derived-2\");\r\n }\r\n }\r\n class MyDerived4 extends Derived4 {\r\n public override collectReferenceIds(referenceIds: EntityReferenceSet) {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(\"derived-4\");\r\n }\r\n }\r\n class MyTestGeneratedClasses extends TestGeneratedClasses {\r\n public static override get classes() {\r\n // leaving Derived3,5,6 generated\r\n return [MyDerived2, MyDerived4];\r\n }\r\n }\r\n imodel.jsClassMap.clear();\r\n MyTestGeneratedClasses.registerSchema();\r\n\r\n /* eslint-disable @typescript-eslint/naming-convention */\r\n const ActualTestElementWithNavProp = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:TestElementWithNavProp\");\r\n const ActualDerivedWithNavProp = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:DerivedWithNavProp\");\r\n const ActualDerived2 = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:Derived2\");\r\n const ActualDerived3 = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:Derived3\");\r\n const ActualDerived4 = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:Derived4\");\r\n const ActualDerived5 = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:Derived5\");\r\n const ActualDerived6 = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:Derived6\");\r\n\r\n expect(ActualTestElementWithNavProp.isGeneratedClass).to.be.true;\r\n expect(ActualDerivedWithNavProp.isGeneratedClass).to.be.true;\r\n expect(ActualDerived2.isGeneratedClass).to.be.false;\r\n expect(ActualDerived3.isGeneratedClass).to.be.true;\r\n expect(ActualDerived4.isGeneratedClass).to.be.false;\r\n expect(ActualDerived5.isGeneratedClass).to.be.true;\r\n expect(ActualDerived6.isGeneratedClass).to.be.true;\r\n\r\n assert.isTrue(ActualTestElementWithNavProp.prototype.hasOwnProperty(\"collectReferenceIds\")); // should have automatic impl\r\n assert.isTrue(ActualDerivedWithNavProp.prototype.hasOwnProperty(\"collectReferenceIds\"));\r\n assert.isTrue(ActualDerived2.prototype.hasOwnProperty(\"collectReferenceIds\")); // non-generated; manually implements so has method\r\n assert.isFalse(ActualDerived3.prototype.hasOwnProperty(\"collectReferenceIds\")); // base is non-generated so it shouldn't get the automatic impl\r\n assert.isTrue(ActualDerived4.prototype.hasOwnProperty(\"collectReferenceIds\")); // manually implements so it should have the method\r\n assert.isFalse(ActualDerived5.prototype.hasOwnProperty(\"collectReferenceIds\")); // ancestor is non-generated so it shouldn't get the automatic impl\r\n assert.isFalse(ActualDerived6.prototype.hasOwnProperty(\"collectReferenceIds\")); // ancestor is non-generated so it shouldn't get the automatic impl\r\n\r\n const testEntity1Id = imodel.elements.insertElement({\r\n classFullName: \"TestGeneratedClasses:Derived6\",\r\n prop: \"sample-value-1\",\r\n model: IModelDb.dictionaryId,\r\n code: Code.createEmpty(),\r\n } as TestEntityProps);\r\n\r\n const testEntity2Id = imodel.elements.insertElement({\r\n classFullName: \"TestGeneratedClasses:TestEntity\",\r\n prop: \"sample-value-2\",\r\n model: IModelDb.dictionaryId,\r\n code: Code.createEmpty(),\r\n } as TestEntityProps);\r\n\r\n const derived6Id = imodel.elements.insertElement({\r\n classFullName: Derived6.classFullName,\r\n model: IModelDb.dictionaryId,\r\n code: Code.createEmpty(),\r\n navProp: {\r\n id: testEntity1Id,\r\n relClassName: \"TestGeneratedClasses:ElemRel\",\r\n },\r\n derivedNavProp: {\r\n id: testEntity2Id,\r\n relClassName: \"TestGeneratedClasses:DerivedElemRel\",\r\n },\r\n } as DerivedWithNavPropProps);\r\n\r\n const derived6 = imodel.elements.getElement(derived6Id);\r\n\r\n /** it is not possible to make a spy of an already existing spy, so lazy try making one\r\n * this is necessary since due to prototypes, some \"methods\" we listen to are actually the same\r\n */\r\n function spyCollectReferenceIds(cls: typeof Element): sinon.SinonSpy {\r\n if ((cls.prototype as any).collectReferenceIds.isSinonProxy) {\r\n return (cls.prototype as any).collectReferenceIds;\r\n }\r\n return sinon.spy(cls.prototype, \"collectReferenceIds\" as any);\r\n }\r\n\r\n const elementMethodSpy = spyCollectReferenceIds(Element);\r\n const testElementWithNavPropSpy = spyCollectReferenceIds(ActualTestElementWithNavProp);\r\n const derivedWithNavPropSpy = spyCollectReferenceIds(ActualDerivedWithNavProp);\r\n const derived2Spy = spyCollectReferenceIds(ActualDerived2);\r\n const derived3Spy = spyCollectReferenceIds(ActualDerived3);\r\n const derived4Spy = spyCollectReferenceIds(ActualDerived4);\r\n const derived5Spy = spyCollectReferenceIds(ActualDerived5);\r\n const derived6Spy = spyCollectReferenceIds(ActualDerived6);\r\n\r\n // This demonstrates that if a generated class (Derived6) has a non-generated ancestor, it will not get a generated impl\r\n // instead it will just call the closest non-generated ancestor (Derived4)\r\n expect([...derived6.getReferenceIds()]).to.have.members(\r\n [\r\n EntityReferences.fromEntityType(derived6.model, ConcreteEntityTypes.Model),\r\n EntityReferences.fromEntityType(derived6.code.scope, ConcreteEntityTypes.Element),\r\n derived6.parent?.id && EntityReferences.fromEntityType(derived6.parent.id, ConcreteEntityTypes.Element),\r\n // \"TestGeneratedClasses:Derived4\" is MyDerived4 above, which extends the Derived4 class, which extends up\r\n // without any custom ancestor implementing collectReferenceIds, so Element.collectReferenceIds is called as the\r\n // super, and no navigation properties or other custom implementations are called so we only get \"derived-4\"\r\n EntityReferences.fromEntityType(\"derived-4\", ConcreteEntityTypes.Element),\r\n ].filter((x) => x !== undefined),\r\n );\r\n\r\n expect(elementMethodSpy.called).to.be.true; // this is the `super.collectReferenceIds` call in MyDerived4\r\n expect(testElementWithNavPropSpy.called).to.be.false;\r\n expect(derivedWithNavPropSpy.called).to.be.false;\r\n\r\n // these are the same (tested below)\r\n expect(derived2Spy.called).to.be.false;\r\n expect(derived3Spy.called).to.be.false;\r\n\r\n // these are all the same (tested below)\r\n expect(derived4Spy.called).to.be.true;\r\n expect(derived5Spy.called).to.be.true;\r\n expect(derived6Spy.called).to.be.true;\r\n\r\n expect(\r\n new Set(\r\n [\r\n Element,\r\n ActualTestElementWithNavProp,\r\n ActualDerivedWithNavProp,\r\n Derived2,\r\n Derived3, // same as above (so will be removed from set)\r\n Derived4,\r\n Derived5, // save as above (so will be removed from set)\r\n Derived6, // save as above (so will be removed from set)\r\n ].map((e) => e.prototype[\"collectReferenceIds\"]), // eslint-disable-line @typescript-eslint/dot-notation\r\n ),\r\n ).to.deep.equal(\r\n new Set(\r\n [\r\n Element,\r\n ActualTestElementWithNavProp,\r\n ActualDerivedWithNavProp,\r\n Derived2,\r\n Derived4,\r\n ].map((e) => e.prototype[\"collectReferenceIds\"]), // eslint-disable-line @typescript-eslint/dot-notation\r\n ),\r\n );\r\n\r\n MyTestGeneratedClasses.unregisterSchema();\r\n sinon.restore();\r\n });\r\n});\r\n\r\nclass Base {\r\n public static staticProperty: string = \"base\";\r\n public static get sqlName(): string { return `s.${this.staticProperty}`; }\r\n}\r\n\r\nclass Derived extends Base {\r\n}\r\n\r\ndescribe(\"Static Properties\", () => {\r\n it(\"should be inherited, and the subclass should get its own copy\", async () => {\r\n assert.equal(Base.staticProperty, \"base\");\r\n assert.equal(Derived.staticProperty, \"base\"); // Derived inherits Base's staticProperty (via its prototype)\r\n Derived.staticProperty = \"derived\"; // Derived now gets its own copy of staticProperty\r\n assert.equal(Base.staticProperty, \"base\"); // Base's staticProperty remains as it was\r\n assert.equal(Derived.staticProperty, \"derived\"); // Derived's staticProperty is now different\r\n assert.equal(Base.sqlName, \"s.base\");\r\n const d = new Derived();\r\n assert.equal((d.constructor as any).staticProperty, \"derived\"); // Instances of Derived see Derived.staticProperty\r\n const b = new Base();\r\n assert.equal((b.constructor as any).staticProperty, \"base\"); // Instances of Base see Base.staticProperty\r\n });\r\n\r\n});\r\n\r\ndescribe(\"Global state of ClassRegistry\", () => {\r\n let imodel1: SnapshotDb;\r\n let imodel2: SnapshotDb;\r\n\r\n before(() => {\r\n const seedFileName = IModelTestUtils.resolveAssetFile(\"test.bim\");\r\n const testFileName1 = IModelTestUtils.prepareOutputFile(\"ClassRegistry\", \"GlobalState1.bim\");\r\n const testFileName2 = IModelTestUtils.prepareOutputFile(\"ClassRegistry\", \"GlobalState2.bim\");\r\n imodel1 = IModelTestUtils.createSnapshotFromSeed(testFileName1, seedFileName);\r\n imodel2 = IModelTestUtils.createSnapshotFromSeed(testFileName2, seedFileName);\r\n assert.exists(imodel1);\r\n assert.exists(imodel2);\r\n });\r\n\r\n after(() => {\r\n imodel1?.close();\r\n imodel2?.close();\r\n });\r\n\r\n it(\"registering a class in different imodels should not affect each other\", async () => {\r\n await imodel1.importSchemaStrings([\r\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <ECSchema schemaName=\"TestSchema\" alias=\"ts\" version=\"01.00\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.1\">\r\n <ECSchemaReference name=\"BisCore\" version=\"01.00\" alias=\"bis\"/>\r\n\r\n <ECEntityClass typeName=\"TestClass\">\r\n <BaseClass>bis:PhysicalElement</BaseClass>\r\n <ECProperty propertyName=\"foo\" typeName=\"string\"/>\r\n <ECNavigationProperty propertyName=\"RelatedTestClass\" relationshipName=\"MyRelationship\" direction=\"backward\"/>\r\n </ECEntityClass>\r\n\r\n <ECRelationshipClass typeName=\"MyRelationship\" modifier=\"None\" strength=\"embedding\">\r\n <Source multiplicity=\"(0..1)\" roleLabel=\"has\" polymorphic=\"false\">\r\n <Class class=\"TestClass\"/>\r\n </Source>\r\n <Target multiplicity=\"(0..*)\" roleLabel=\"has\" polymorphic=\"false\">\r\n <Class class=\"TestClass\"/>\r\n </Target>\r\n </ECRelationshipClass>\r\n </ECSchema>\r\n `,\r\n ]);\r\n await imodel2.importSchemaStrings([\r\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <ECSchema schemaName=\"TestSchema\" alias=\"ts\" version=\"01.00\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.1\">\r\n <ECSchemaReference name=\"BisCore\" version=\"01.00\" alias=\"bis\"/>\r\n <ECEntityClass typeName=\"TestClass\">\r\n <BaseClass>bis:PhysicalElement</BaseClass>\r\n <ECProperty propertyName=\"bar\" typeName=\"string\"/>\r\n </ECEntityClass>\r\n </ECSchema>\r\n `,\r\n ]);\r\n\r\n const testClass1 = imodel1.getJsClass(\"TestSchema:TestClass\");\r\n assert.isFalse(testClass1.hasOwnProperty(\"testPropertyGuard\"));\r\n (testClass1 as any).testPropertyGuard = true;\r\n assert.isTrue(testClass1.hasOwnProperty(\"testPropertyGuard\"));\r\n\r\n const testClass2 = imodel2.getJsClass(\"TestSchema:TestClass\");\r\n assert.isFalse(testClass2.hasOwnProperty(\"testPropertyGuard\"));\r\n });\r\n\r\n\r\n});\r\n// TODO: add tests on the new model/aspect prefixes\r\n"]}
1
+ {"version":3,"file":"ClassRegistry.test.js","sourceRoot":"","sources":["../../../../src/test/schema/ClassRegistry.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,WAAW,EAAE,IAAI,EAAE,mBAAmB,EAA0B,SAAS,EAEzE,cAAc,EAA0C,WAAW,GACpE,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAAS,cAAc,EAClI,MAAM,EAAc,qBAAqB,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,GACnF,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAyC,aAAa,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAExH,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,MAAkB,CAAC;IAEvB,MAAM,CAAC,GAAG,EAAE;QACV,MAAM,YAAY,GAAG,eAAe,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAClE,MA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U,CAAC,sBAAsB,CAAC,CAAC;QAC9D,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AAGL,CAAC,CAAC,CAAC;AACH,mDAAmD","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*--------------------------------------------------------------------------------------------*/\nimport { assert, expect } from \"chai\";\nimport * as sinon from \"sinon\";\nimport * as path from \"path\";\nimport { withEditTxn } from \"../../EditTxn\";\nimport {\n BisCodeSpec, Code, ConcreteEntityTypes, DefinitionElementProps, ECJsNames, ElementAspectProps, ElementProps, EntityReferenceSet, ModelProps,\n PropertyMetaData,\n RelatedElement, RelatedElementProps, RelationshipProps, SchemaState,\n} from \"@itwin/core-common\";\nimport {\n DefinitionElement, DefinitionModel, ElementRefersToElements, Entity, EntityReferences, IModelDb, IModelJsFs, Model, RepositoryLink,\n Schema, SnapshotDb, SpatialViewDefinition, StandaloneDb, UrlLink, ViewDefinition3d,\n} from \"../../core-backend\";\nimport { IModelTestUtils } from \"../IModelTestUtils\";\nimport { KnownTestLocations } from \"../KnownTestLocations\";\nimport { Element } from \"../../Element\";\nimport { Schemas } from \"../../Schema\";\nimport { ClassRegistry } from \"../../ClassRegistry\";\nimport { OpenMode } from \"@itwin/core-bentley\";\nimport { EntityClass, NavigationProperty, PrimitiveProperty, SchemaItemKey, SchemaKey } from \"@itwin/ecschema-metadata\";\n\ndescribe(\"Class Registry\", () => {\n let imodel: SnapshotDb;\n\n before(() => {\n const seedFileName = IModelTestUtils.resolveAssetFile(\"test.bim\");\n const testFileName = IModelTestUtils.prepareOutputFile(\"ClassRegistry\", \"ClassRegistryTest.bim\");\n imodel = IModelTestUtils.createSnapshotFromSeed(testFileName, seedFileName);\n assert.exists(imodel);\n });\n\n after(() => {\n imodel?.close();\n });\n\n it(\"should verify the Entity metadata of known element subclasses\", async () => {\n const code1 = new Code({ spec: \"0x10\", scope: \"0x11\", value: \"RF1.dgn\" });\n const el = imodel.elements.getElement(code1);\n assert.exists(el);\n if (el) {\n const metaData = await el.getMetaData();\n assert.exists(metaData);\n\n assert.equal(metaData.fullName, el.classFullName.replace(\":\", \".\"));\n // I happen to know that this is a BisCore:RepositoryLink\n assert.equal(metaData.fullName, RepositoryLink.classFullName.replace(\":\", \".\"));\n // Check the metadata on the class itself\n assert.isDefined(metaData.baseClass);\n assert.equal(metaData.baseClass?.fullName, UrlLink.classFullName.replace(\":\", \".\"));\n assert.isTrue(metaData.customAttributes?.has(\"BisCore.ClassHasHandler\"));\n // Check the metadata on the one property that RepositoryLink defines, RepositoryGuid\n const repositoryGuidProperty = await metaData.getProperty(\"repositoryGuid\") as PrimitiveProperty;\n assert.isDefined(repositoryGuidProperty);\n assert.equal(repositoryGuidProperty.extendedTypeName, \"BeGuid\");\n assert.isTrue(repositoryGuidProperty.customAttributes?.has(\"CoreCustomAttributes.HiddenProperty\"));\n }\n const el2 = imodel.elements.getElement(\"0x34\");\n assert.exists(el2);\n if (el2) {\n const metaData = await el2.getMetaData();\n assert.exists(metaData);\n\n assert.equal(metaData.fullName, el2.classFullName.replace(\":\", \".\"));\n // I happen to know that this is a BisCore.SpatialViewDefinition\n assert.equal(metaData.fullName, SpatialViewDefinition.classFullName.replace(\":\", \".\"));\n assert.isDefined(metaData.baseClass);\n assert.equal(metaData.baseClass?.fullName, ViewDefinition3d.classFullName.replace(\":\", \".\"));\n const modelSelectorProperty = await metaData.getProperty(\"modelSelector\") as NavigationProperty;\n assert.isDefined(modelSelectorProperty);\n assert.equal(modelSelectorProperty.relationshipClass.fullName, \"BisCore.SpatialViewDefinitionUsesModelSelector\");\n }\n });\n\n it(\"should verify Entity metadata with both base class and mixin properties\", async () => {\n const schemaPathname = path.join(KnownTestLocations.assetsDir, \"TestDomain.ecschema.xml\");\n await imodel.importSchemas([schemaPathname]); // will throw an exception if import fails\n\n const testDomainClass = await imodel.schemaContext.getSchemaItem(\"TestDomain\", \"TestDomainClass\", EntityClass);\n assert.isDefined(testDomainClass);\n\n assert.isDefined(testDomainClass?.baseClass);\n assert.equal(testDomainClass?.baseClass?.fullName, DefinitionElement.classFullName.replace(\":\", \".\"));\n\n assert.isDefined(testDomainClass?.mixins);\n assert.equal(testDomainClass?.mixins.length, 1);\n assert.equal(testDomainClass?.mixins[0].fullName, \"TestDomain.IMixin\");\n\n // Verify that the forEach method which is called when constructing an entity\n // is picking up all expected properties.\n const testData: string[] = [];\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n IModelDb.forEachMetaData(imodel, \"TestDomain:TestDomainClass\", true, (propName: string, _property: PropertyMetaData) => {\n testData.push(ECJsNames.toJsName(propName));\n }, false);\n\n const expectedString = testData.find((testString: string) => {\n return testString === \"testMixinProperty\";\n });\n\n assert.isDefined(expectedString);\n });\n});\n\ndescribe(\"Class Registry - getRootMetaData\", () => {\n let imodel: StandaloneDb;\n\n before(async () => {\n const seedFileName = IModelTestUtils.resolveAssetFile(\"test.bim\");\n const testFileName = IModelTestUtils.prepareOutputFile(\"ClassRegistry\", \"GetRootMetaData.bim\");\n IModelJsFs.copySync(seedFileName, testFileName);\n\n const schemaState: SchemaState = StandaloneDb.validateSchemas(testFileName, true);\n assert.strictEqual(schemaState, SchemaState.UpgradeRecommended);\n StandaloneDb.upgradeStandaloneSchemas(testFileName);\n\n imodel = StandaloneDb.openFile(testFileName, OpenMode.ReadWrite);\n assert.exists(imodel);\n await imodel.importSchemaStrings([\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <ECSchema schemaName=\"TestSchema1\" alias=\"ts1\" version=\"01.00\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.1\">\n <ECSchemaReference name=\"BisCore\" version=\"01.00\" alias=\"bis\"/>\n <ECSchemaReference name=\"CoreCustomAttributes\" version=\"01.00.03\" alias=\"CoreCA\"/>\n\n <ECEntityClass typeName=\"TestBase\">\n <BaseClass>bis:PhysicalElement</BaseClass>\n </ECEntityClass>\n\n <ECEntityClass typeName=\"TestDerived\">\n <BaseClass>TestBase</BaseClass>\n </ECEntityClass>\n\n <ECEntityClass typeName=\"ITestMixinForAspectsBase\">\n <ECCustomAttributes>\n <IsMixin xmlns=\"CoreCustomAttributes.01.00.03\">\n <AppliesToEntityClass>bis:ElementUniqueAspect</AppliesToEntityClass>\n </IsMixin>\n </ECCustomAttributes>\n </ECEntityClass>\n\n <ECEntityClass typeName=\"ITestMixinForAspectsDerived\">\n <BaseClass>ITestMixinForAspectsBase</BaseClass>\n <ECCustomAttributes>\n <IsMixin xmlns=\"CoreCustomAttributes.01.00.03\">\n <AppliesToEntityClass>bis:ElementUniqueAspect</AppliesToEntityClass>\n </IsMixin>\n </ECCustomAttributes>\n </ECEntityClass>\n\n <ECEntityClass typeName=\"ITestMixinForElements\" modifier=\"Abstract\">\n <ECCustomAttributes>\n <IsMixin xmlns=\"CoreCustomAttributes.01.00.03\">\n <AppliesToEntityClass>bis:Element</AppliesToEntityClass>\n </IsMixin>\n </ECCustomAttributes>\n </ECEntityClass>\n\n <ECEntityClass typeName=\"TestMixedInAndDerived\">\n <BaseClass>TestBase</BaseClass>\n <BaseClass>ITestMixinForElements</BaseClass>\n </ECEntityClass>\n\n </ECSchema>\n `,\n ]); // will throw an exception if import fails\n });\n\n after(() => {\n imodel?.close();\n });\n\n it(\"should get the root metadata\", async () => {\n for (const [testClass, expectedRoot] of [\n [\"TestSchema1.TestBase\", \"BisCore:Element\"],\n [\"TestSchema1.TestDerived\", \"BisCore:Element\"],\n [\"TestSchema1.ITestMixinForAspectsBase\", \"BisCore:ElementAspect\"],\n [\"TestSchema1.ITestMixinForAspectsDerived\", \"BisCore:ElementAspect\"],\n [\"TestSchema1.ITestMixinForElements\", \"BisCore:Element\"],\n [\"TestSchema1.TestMixedInAndDerived\", \"BisCore:Element\"],\n ] as const) {\n const rootMetaData = ClassRegistry.getRootEntity(imodel, testClass);\n expect(rootMetaData.replace(\".\", \":\")).to.equal(expectedRoot);\n }\n });\n});\n\ndescribe(\"Class Registry - generated classes\", () => {\n let imodel: SnapshotDb;\n const testSchemaPath = path.join(KnownTestLocations.assetsDir, \"TestGeneratedClasses.ecschema.xml\");\n\n before(async () => {\n const seedFileName = IModelTestUtils.resolveAssetFile(\"test.bim\");\n const testFileName = IModelTestUtils.prepareOutputFile(\"ClassRegistry\", \"GeneratedClasses.bim\");\n imodel = IModelTestUtils.createSnapshotFromSeed(testFileName, seedFileName);\n assert.exists(imodel);\n await imodel.importSchemas([testSchemaPath]); // will throw an exception if import fails\n });\n\n after(() => {\n imodel?.close();\n });\n\n interface TestModelWithNavPropProps extends ModelProps {\n elemNavProp: RelatedElementProps;\n aspectNavProp: RelatedElementProps;\n relNavProp: RelatedElementProps;\n }\n\n interface TestEntityProps extends DefinitionElementProps {\n prop: string;\n }\n\n interface LinkTableRelWithNavPropProps extends RelationshipProps {\n elemNavProp: RelatedElementProps;\n modelNavProp: RelatedElementProps;\n aspectNavProp: RelatedElementProps;\n }\n\n interface TestElementWithNavPropProps extends DefinitionElementProps {\n navProp: RelatedElementProps;\n }\n\n interface DerivedWithNavPropProps extends TestElementWithNavPropProps {\n derivedNavProp: RelatedElementProps;\n }\n\n interface TestAspectWithNavProp extends ElementAspectProps {\n navProp: RelatedElement;\n }\n\n class TestGeneratedClasses extends Schema {\n public static override get schemaName(): string { return \"TestGeneratedClasses\"; }\n public static get classes() {\n return [TestModelWithNavProp, TestElementWithNavProp, LinkTableRelWithNavProp, DerivedWithNavProp, Derived2, Derived3, Derived4, Derived5, Derived6];\n }\n public static registerSchema() {\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\n Schemas.unregisterSchema(this.schemaName);\n Schemas.registerSchema(this);\n // eslint-disable-next-line @typescript-eslint/naming-convention\n for (const class_ of this.classes) {\n ClassRegistry.register(class_, this);\n }\n }\n }\n\n public static unregisterSchema() {\n Schemas.unregisterSchema(this.schemaName);\n }\n }\n\n class TestElementWithNavProp extends DefinitionElement {\n public static override get className() { return \"TestElementWithNavProp\"; }\n public static override schema = TestGeneratedClasses;\n public navProp: RelatedElement;\n public constructor(props: TestElementWithNavPropProps, inIModel: IModelDb) {\n super(props, inIModel);\n this.navProp = new RelatedElement(props.navProp);\n }\n }\n\n class TestModelWithNavProp extends DefinitionModel {\n public static override get className() { return \"TestModelWithNavProp\"; }\n public static override schema = TestGeneratedClasses;\n public elemNavProp: RelatedElement;\n public aspectNavProp: RelatedElement;\n public relNavProp: RelatedElement;\n public constructor(props: TestModelWithNavPropProps, inIModel: IModelDb) {\n super(props, inIModel);\n this.elemNavProp = new RelatedElement(props.elemNavProp);\n this.aspectNavProp = new RelatedElement(props.aspectNavProp);\n this.relNavProp = new RelatedElement(props.relNavProp);\n }\n }\n\n class LinkTableRelWithNavProp extends ElementRefersToElements {\n public static override get className() { return \"LinkTableRelWithNavProp\"; }\n public static override schema = TestGeneratedClasses;\n public elemNavProp: RelatedElement;\n public aspectNavProp: RelatedElement;\n public modelNavProp: RelatedElement;\n public constructor(props: LinkTableRelWithNavPropProps, inIModel: IModelDb) {\n super(props, inIModel);\n this.elemNavProp = new RelatedElement(props.elemNavProp);\n this.aspectNavProp = new RelatedElement(props.aspectNavProp);\n this.modelNavProp = new RelatedElement(props.modelNavProp);\n }\n }\n\n class DerivedWithNavProp extends TestElementWithNavProp {\n public static override get className() { return \"DerivedWithNavProp\"; }\n public static override schema = TestGeneratedClasses;\n public derivedNavProp: RelatedElement;\n public constructor(props: DerivedWithNavPropProps, inIModel: IModelDb) {\n super(props, inIModel);\n this.derivedNavProp = new RelatedElement(props.derivedNavProp);\n }\n }\n\n class Derived2 extends DerivedWithNavProp {\n public static override get className() { return \"Derived2\"; }\n }\n class Derived3 extends Derived2 {\n public static override get className() { return \"Derived3\"; }\n }\n class Derived4 extends Derived3 {\n public static override get className() { return \"Derived4\"; }\n }\n class Derived5 extends Derived4 {\n public static override get className() { return \"Derived5\"; }\n }\n class Derived6 extends Derived5 {\n public static override get className() { return \"Derived6\"; }\n }\n\n class NonGeneratedElement extends DefinitionElement {\n public static override get className() { return \"NonGeneratedElement\"; }\n }\n\n it(\"Should provide correct schemas and full-names on generated classes\", async () => {\n await imodel.importSchemaStrings([\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <ECSchema schemaName=\"CustomA\" alias=\"custA\" version=\"1.0.0\"\n xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.1\">\n <ECSchemaReference name=\"BisCore\" version=\"01.00\" alias=\"bis\"/>\n <ECSchemaReference name=\"Functional\" version=\"1.00\" alias=\"func\"/>\n <ECEntityClass typeName=\"NonGeneratedElement\">\n <BaseClass>bis:DefinitionElement</BaseClass>\n </ECEntityClass>\n <ECEntityClass typeName=\"GeneratedElement\">\n <BaseClass>NonGeneratedElement</BaseClass>\n </ECEntityClass>\n <ECEntityClass typeName=\"ElementC\">\n <BaseClass>GeneratedElement</BaseClass>\n </ECEntityClass>\n </ECSchema>\n `,\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <ECSchema schemaName=\"CustomB\" alias=\"custB\" version=\"1.0.0\"\n xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.1\">\n <ECSchemaReference name=\"BisCore\" version=\"01.00\" alias=\"bis\"/>\n <ECSchemaReference name=\"Functional\" version=\"1.00\" alias=\"func\"/>\n <ECSchemaReference name=\"CustomA\" version=\"01.00\" alias=\"custA\"/>\n <ECEntityClass typeName=\"DummyElement\">\n <BaseClass>bis:DefinitionElement</BaseClass>\n </ECEntityClass>\n <ECEntityClass typeName=\"ErrorElement\">\n <BaseClass>custA:ElementC</BaseClass>\n </ECEntityClass>\n </ECSchema>\n `,\n ]);\n\n class CustomASchema extends Schema {\n public static override get schemaName(): string { return \"CustomA\"; }\n public static get classes(): typeof Entity[] {\n return [NonGeneratedElement];\n }\n public static registerSchema() {\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\n Schemas.unregisterSchema(this.schemaName);\n Schemas.registerSchema(this);\n for (const ecClass of this.classes) {\n ClassRegistry.register(ecClass, this);\n }\n }\n }\n\n public static unregisterSchema() {\n Schemas.unregisterSchema(this.schemaName);\n }\n }\n\n CustomASchema.registerSchema();\n\n class DummyElement extends DefinitionElement {\n public static override get className() { return \"DummyElement\"; }\n }\n\n class CustomBSchema extends Schema {\n public static override get schemaName(): string { return \"CustomB\"; }\n public static get classes() {\n return [DummyElement];\n }\n public static registerSchema() {\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\n Schemas.unregisterSchema(this.schemaName);\n Schemas.registerSchema(this);\n for (const ecClass of this.classes) {\n ClassRegistry.register(ecClass, this);\n }\n }\n }\n\n public static unregisterSchema() {\n Schemas.unregisterSchema(this.schemaName);\n }\n }\n\n CustomBSchema.registerSchema();\n\n const nonGeneratedElement = imodel.getJsClass(\"CustomA:NonGeneratedElement\");\n assert.equal(nonGeneratedElement.classFullName, \"CustomA:NonGeneratedElement\");\n const generatedElement = imodel.getJsClass(\"CustomA:GeneratedElement\");\n assert.equal(generatedElement.classFullName, \"CustomA:GeneratedElement\");\n const elementC = imodel.getJsClass(\"CustomA:ElementC\");\n assert.equal(elementC.classFullName, \"CustomA:ElementC\");\n const dummyElement = imodel.getJsClass(\"CustomB:DummyElement\");\n assert.equal(dummyElement.classFullName, \"CustomB:DummyElement\");\n\n //This is the class that had the wrong schema\n const errorElement = imodel.getJsClass(\"CustomB:ErrorElement\");\n assert.equal(errorElement.classFullName, \"CustomB:ErrorElement\");\n assert.isTrue(errorElement.schemaItemKey.matches(new SchemaItemKey(\"ErrorElement\", new SchemaKey(\"CustomB\", 1, 0, 0))));\n assert.equal(errorElement.className, \"ErrorElement\");\n assert.equal(errorElement.schema.schemaName, \"CustomB\");\n\n // Create an instance of ErrorElement\n const errorElementInstance = Entity.instantiate(errorElement, { classFullName: errorElement.classFullName }, imodel);\n assert.exists(errorElementInstance);\n assert.instanceOf(errorElementInstance, errorElement);\n assert.instanceOf(errorElementInstance, Entity);\n assert.equal(errorElementInstance.className, \"ErrorElement\");\n assert.equal(errorElementInstance.schemaName, \"CustomB\");\n const metadata = await errorElementInstance.getMetaData();\n assert.exists(metadata);\n assert.equal(metadata.fullName, \"CustomB.ErrorElement\");\n });\n\n // if a single inherited class is not generated, the entire hierarchy is considered not-generated\n it(\"should only generate automatic collectReferenceIds implementations for generated classes\", async () => {\n await imodel.importSchemas([testSchemaPath]); // will throw an exception if import fails\n\n class GeneratedTestElementWithNavProp extends imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:TestElementWithNavProp\") {\n constructor(props: TestElementWithNavPropProps) {\n super(props, imodel);\n }\n }\n\n const testEntityId = withEditTxn(imodel, (txn) => txn.insertElement({\n classFullName: \"TestGeneratedClasses:TestEntity\",\n prop: \"sample-value\",\n model: IModelDb.dictionaryId,\n code: Code.createEmpty(),\n } as TestEntityProps));\n\n const elemWithNavProp = new GeneratedTestElementWithNavProp({\n classFullName: \"TestGeneratedClasses:TestElementWithNavProp\",\n navProp: {\n id: testEntityId,\n relClassName: \"TestGeneratedClasses:ElemRel\",\n },\n } as TestElementWithNavPropProps);\n\n // eslint-disable-next-line @typescript-eslint/dot-notation\n assert.isDefined(GeneratedTestElementWithNavProp.prototype[\"collectReferenceIds\"]);\n expect(\n [...elemWithNavProp.getReferenceIds()],\n ).to.have.members([\n EntityReferences.fromEntityType(elemWithNavProp.model, ConcreteEntityTypes.Model),\n EntityReferences.fromEntityType(elemWithNavProp.code.scope, ConcreteEntityTypes.Element),\n EntityReferences.fromEntityType(testEntityId, ConcreteEntityTypes.Element),\n ]);\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const GeneratedTestAspectWithNavProp = imodel.getJsClass(\"TestGeneratedClasses:TestAspectWithNavProp\");\n assert.isTrue(GeneratedTestAspectWithNavProp.prototype.hasOwnProperty(\"collectReferenceIds\"));\n });\n\n it(\"should not override collectReferenceIds for BisCore schema classes\", async () => {\n // AnnotationFrameStyle is an example of an unregistered bis class without an implementation of collectReferenceIds\n assert.isTrue(imodel.getJsClass(\"BisCore:AnnotationFrameStyle\").prototype.hasOwnProperty(\"collectReferenceIds\"));\n });\n\n it(\"should get references from its bis superclass\", async () => {\n await imodel.importSchemas([testSchemaPath]); // will throw an exception if import fails\n\n class GeneratedTestElementWithNavProp extends imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:TestElementWithNavProp\") {\n constructor(props: ElementProps) {\n super(props, imodel);\n }\n }\n\n const testEntityId = withEditTxn(imodel, (txn) => txn.insertElement({\n classFullName: \"TestGeneratedClasses:TestEntity\",\n prop: \"sample-value\",\n model: IModelDb.dictionaryId,\n code: Code.createEmpty(),\n } as TestEntityProps));\n\n const elemWithNavProp = new GeneratedTestElementWithNavProp({\n classFullName: \"TestGeneratedClasses:TestElementWithNavProp\",\n navProp: new RelatedElement({\n id: testEntityId,\n relClassName: \"TestGeneratedClasses:ElemRel\",\n }),\n model: IModelDb.dictionaryId,\n code: new Code({\n scope: IModelDb.rootSubjectId,\n spec: imodel.codeSpecs.getByName(BisCodeSpec.spatialCategory).id,\n value: \"\",\n }),\n parent: new RelatedElement({\n // since we don't actually insert this element in this test, using an arbitrary id string\n id: \"0x0000ffff\",\n relClassName: \"BisCore:ElementOwnsChildElements\",\n }),\n } as TestElementWithNavPropProps);\n\n // super class here is Element so we should get the code.scope, model and parent as references\n expect(\n [...elemWithNavProp.getReferenceIds()],\n ).to.have.members([\n EntityReferences.fromEntityType(elemWithNavProp.model, ConcreteEntityTypes.Model),\n EntityReferences.fromEntityType(elemWithNavProp.code.scope, ConcreteEntityTypes.Element),\n elemWithNavProp.parent && EntityReferences.fromEntityType(elemWithNavProp.parent?.id, ConcreteEntityTypes.Element),\n EntityReferences.fromEntityType(testEntityId, ConcreteEntityTypes.Element),\n ].filter((x) => x !== undefined));\n\n const modelTestEntityIds = new Array(2).fill(undefined).map((_, index) => withEditTxn(imodel, (txn) => txn.insertElement({\n classFullName: \"TestGeneratedClasses:TestEntity\",\n prop: `model-value-${index}`,\n model: IModelDb.dictionaryId,\n code: Code.createEmpty(),\n } as TestEntityProps)));\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const GeneratedTestAspectWithNavProp = imodel.getJsClass(\"TestGeneratedClasses:TestAspectWithNavProp\");\n\n const aspectWithNavPropId = withEditTxn(imodel, (txn) => txn.insertAspect({\n classFullName: GeneratedTestAspectWithNavProp.classFullName,\n navProp: { id: modelTestEntityIds[0], relClassName: \"TestGeneratedClasses:NonElemRel\" },\n element: { id: modelTestEntityIds[1] },\n } as TestAspectWithNavProp));\n\n class GeneratedTestModelWithNavProp extends imodel.getJsClass<typeof Model>(\"TestGeneratedClasses:TestModelWithNavProp\") {\n constructor(props: TestModelWithNavPropProps) {\n super(props, imodel);\n }\n }\n\n const modelWithNavProp = new GeneratedTestModelWithNavProp({\n classFullName: GeneratedTestModelWithNavProp.classFullName,\n modeledElement: { id: modelTestEntityIds[0] },\n parentModel: IModelDb.dictionaryId,\n elemNavProp: { id: modelTestEntityIds[1], relClassName: \"TestGeneratedClasses:ModelToElemNavRel\" },\n aspectNavProp: { id: aspectWithNavPropId, relClassName: \"TestGeneratedClasses:ModelToAspectNavRel\" },\n // removed due to a bug\n // relNavProp: { id: relWithNavPropId, relClassName: \"TestGeneratedClasses:ModelToRelNavRel\" },\n } as TestModelWithNavPropProps);\n\n const modelWithNavPropId = withEditTxn(imodel, (txn) => modelWithNavProp.insert(txn));\n\n expect(\n [...modelWithNavProp.getReferenceIds()],\n ).to.have.members([\n EntityReferences.fromEntityType(modelTestEntityIds[1], ConcreteEntityTypes.Element),\n EntityReferences.fromEntityType(IModelDb.dictionaryId, ConcreteEntityTypes.Model),\n EntityReferences.fromEntityType(modelTestEntityIds[0], ConcreteEntityTypes.Element),\n EntityReferences.fromEntityType(aspectWithNavPropId, ConcreteEntityTypes.ElementAspect),\n // ignoring this one, because there seems to be a bug when specifying a relationship instance as a nav prop\n // EntityReferences.fromEntityType(relWithNavPropId, ConcreteEntityTypes.Relationship),\n ].filter((x) => x !== undefined));\n\n const relTestEntityIds = new Array(3).fill(undefined).map((_, index) => withEditTxn(imodel, (txn) => txn.insertElement({\n classFullName: \"TestGeneratedClasses:TestEntity\",\n prop: `rel-value-${index}`,\n model: IModelDb.dictionaryId,\n code: Code.createEmpty(),\n } as TestEntityProps)));\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const GeneratedLinkTableRelWithNavProp = imodel.getJsClass<typeof LinkTableRelWithNavProp>(\"TestGeneratedClasses:LinkTableRelWithNavProp\");\n\n const relWithNavProp = new GeneratedLinkTableRelWithNavProp({\n classFullName: GeneratedLinkTableRelWithNavProp.classFullName,\n sourceId: relTestEntityIds[0],\n targetId: relTestEntityIds[1],\n elemNavProp: {\n id: relTestEntityIds[2],\n relClassName: \"TestGeneratedClasses:LinkTableRelToElemNavRel\",\n },\n modelNavProp: {\n id: modelWithNavPropId,\n relClassName: \"TestGeneratedClasses:LinkTableRelToModelNavRel\",\n },\n aspectNavProp: {\n id: aspectWithNavPropId,\n relClassName: \"TestGeneratedClasses:LinkTableRelToAspectNavRel\",\n },\n }, imodel);\n\n const _relWithNavPropId = withEditTxn(imodel, (txn) => relWithNavProp.insert(txn));\n\n expect(\n [...relWithNavProp.getReferenceIds()],\n ).to.have.members([\n ...relTestEntityIds.map((id) => EntityReferences.fromEntityType(id, ConcreteEntityTypes.Element)),\n EntityReferences.fromEntityType(modelWithNavPropId, ConcreteEntityTypes.Model),\n EntityReferences.fromEntityType(aspectWithNavPropId, ConcreteEntityTypes.ElementAspect),\n ]);\n });\n\n it(\"should not override custom registered schema class implementations of collectReferenceIds\", async () => {\n const testImplReferenceId = \"TEST-INVALID-ID\";\n class MyTestElementWithNavProp extends TestElementWithNavProp {\n public override collectReferenceIds(referenceIds: EntityReferenceSet) {\n super.collectReferenceIds(referenceIds);\n referenceIds.addElement(testImplReferenceId);\n }\n }\n class MyTestGeneratedClasses extends TestGeneratedClasses {\n public static override get classes() {\n return [MyTestElementWithNavProp, Derived2, Derived3, Derived4, Derived5, Derived6];\n }\n }\n imodel.jsClassMap.clear();\n MyTestGeneratedClasses.registerSchema();\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const ActualTestElementWithNavProp = imodel.getJsClass<typeof MyTestElementWithNavProp>(TestElementWithNavProp.classFullName);\n\n const testElementWithNavPropCollectReferencesSpy = sinon.spy(ActualTestElementWithNavProp.prototype, \"collectReferenceIds\");\n\n class ActualDerivedWithNavProp extends imodel.getJsClass<typeof Element>(DerivedWithNavProp.classFullName) {\n constructor(props: DerivedWithNavPropProps) {\n super(props, imodel);\n }\n }\n\n const testEntity1Id = withEditTxn(imodel, (txn) => txn.insertElement({\n classFullName: \"TestGeneratedClasses:TestEntity\",\n prop: \"sample-value-1\",\n model: IModelDb.dictionaryId,\n code: Code.createEmpty(),\n } as TestEntityProps));\n\n const testEntity2Id = withEditTxn(imodel, (txn) => txn.insertElement({\n classFullName: \"TestGeneratedClasses:TestEntity\",\n prop: \"sample-value-2\",\n model: IModelDb.dictionaryId,\n code: Code.createEmpty(),\n } as TestEntityProps));\n\n const elemWithNavProp = new ActualTestElementWithNavProp({\n classFullName: TestElementWithNavProp.classFullName,\n navProp: {\n id: testEntity1Id,\n relClassName: \"TestGeneratedClasses:ElemRel\",\n },\n } as TestElementWithNavPropProps, imodel);\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n assert.isDefined(ActualTestElementWithNavProp.prototype.collectReferenceIds);\n expect(\n [...elemWithNavProp.getReferenceIds()],\n ).to.have.members([\n EntityReferences.fromEntityType(elemWithNavProp.model, ConcreteEntityTypes.Model),\n EntityReferences.fromEntityType(elemWithNavProp.code.scope, ConcreteEntityTypes.Element),\n elemWithNavProp.parent && EntityReferences.fromEntityType(elemWithNavProp.parent?.id, ConcreteEntityTypes.Element),\n EntityReferences.fromEntityType(testImplReferenceId, ConcreteEntityTypes.Element),\n ].filter((x) => x !== undefined));\n\n expect(testElementWithNavPropCollectReferencesSpy.called).to.be.true;\n testElementWithNavPropCollectReferencesSpy.resetHistory();\n\n const derivedElemWithNavProp = new ActualDerivedWithNavProp({\n classFullName: DerivedWithNavProp.classFullName,\n navProp: {\n id: testEntity1Id,\n relClassName: \"TestGeneratedClasses:ElemRel\",\n },\n derivedNavProp: {\n id: testEntity2Id,\n relClassName: \"TestGeneratedClasses:DerivedElemRel\",\n },\n } as DerivedWithNavPropProps);\n\n // eslint-disable-next-line @typescript-eslint/dot-notation\n assert.isDefined(ActualDerivedWithNavProp.prototype[\"collectReferenceIds\"]);\n // This demonstrates that if a non-generated class has a registered non-biscore base, it will not get a generated impl,\n expect(\n [...derivedElemWithNavProp.getReferenceIds()],\n ).to.have.members([\n EntityReferences.fromEntityType(elemWithNavProp.model, ConcreteEntityTypes.Model),\n EntityReferences.fromEntityType(elemWithNavProp.code.scope, ConcreteEntityTypes.Element),\n elemWithNavProp.parent && EntityReferences.fromEntityType(elemWithNavProp.parent?.id, ConcreteEntityTypes.Element),\n EntityReferences.fromEntityType(testImplReferenceId, ConcreteEntityTypes.Element),\n ].filter((x) => x !== undefined));\n // explicitly check we called the super function\n // (we already know its implementation was called, because testImplReferenceId is in the derived call's result)\n expect(testElementWithNavPropCollectReferencesSpy.called).to.be.true;\n\n sinon.restore();\n MyTestGeneratedClasses.unregisterSchema();\n });\n\n it(\"should work along a complex chain of overrides\", async () => {\n class MyDerived2 extends Derived2 {\n public override collectReferenceIds(referenceIds: EntityReferenceSet) {\n super.collectReferenceIds(referenceIds);\n referenceIds.addElement(\"derived-2\");\n }\n }\n class MyDerived4 extends Derived4 {\n public override collectReferenceIds(referenceIds: EntityReferenceSet) {\n super.collectReferenceIds(referenceIds);\n referenceIds.addElement(\"derived-4\");\n }\n }\n class MyTestGeneratedClasses extends TestGeneratedClasses {\n public static override get classes() {\n // leaving Derived3,5,6 generated\n return [MyDerived2, MyDerived4];\n }\n }\n imodel.jsClassMap.clear();\n MyTestGeneratedClasses.registerSchema();\n\n /* eslint-disable @typescript-eslint/naming-convention */\n const ActualTestElementWithNavProp = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:TestElementWithNavProp\");\n const ActualDerivedWithNavProp = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:DerivedWithNavProp\");\n const ActualDerived2 = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:Derived2\");\n const ActualDerived3 = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:Derived3\");\n const ActualDerived4 = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:Derived4\");\n const ActualDerived5 = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:Derived5\");\n const ActualDerived6 = imodel.getJsClass<typeof Element>(\"TestGeneratedClasses:Derived6\");\n\n expect(ActualTestElementWithNavProp.isGeneratedClass).to.be.true;\n expect(ActualDerivedWithNavProp.isGeneratedClass).to.be.true;\n expect(ActualDerived2.isGeneratedClass).to.be.false;\n expect(ActualDerived3.isGeneratedClass).to.be.true;\n expect(ActualDerived4.isGeneratedClass).to.be.false;\n expect(ActualDerived5.isGeneratedClass).to.be.true;\n expect(ActualDerived6.isGeneratedClass).to.be.true;\n\n assert.isTrue(ActualTestElementWithNavProp.prototype.hasOwnProperty(\"collectReferenceIds\")); // should have automatic impl\n assert.isTrue(ActualDerivedWithNavProp.prototype.hasOwnProperty(\"collectReferenceIds\"));\n assert.isTrue(ActualDerived2.prototype.hasOwnProperty(\"collectReferenceIds\")); // non-generated; manually implements so has method\n assert.isFalse(ActualDerived3.prototype.hasOwnProperty(\"collectReferenceIds\")); // base is non-generated so it shouldn't get the automatic impl\n assert.isTrue(ActualDerived4.prototype.hasOwnProperty(\"collectReferenceIds\")); // manually implements so it should have the method\n assert.isFalse(ActualDerived5.prototype.hasOwnProperty(\"collectReferenceIds\")); // ancestor is non-generated so it shouldn't get the automatic impl\n assert.isFalse(ActualDerived6.prototype.hasOwnProperty(\"collectReferenceIds\")); // ancestor is non-generated so it shouldn't get the automatic impl\n\n const testEntity1Id = withEditTxn(imodel, (txn) => txn.insertElement({\n classFullName: \"TestGeneratedClasses:Derived6\",\n prop: \"sample-value-1\",\n model: IModelDb.dictionaryId,\n code: Code.createEmpty(),\n } as TestEntityProps));\n\n const testEntity2Id = withEditTxn(imodel, (txn) => txn.insertElement({\n classFullName: \"TestGeneratedClasses:TestEntity\",\n prop: \"sample-value-2\",\n model: IModelDb.dictionaryId,\n code: Code.createEmpty(),\n } as TestEntityProps));\n\n const derived6Id = withEditTxn(imodel, (txn) => txn.insertElement({\n classFullName: Derived6.classFullName,\n model: IModelDb.dictionaryId,\n code: Code.createEmpty(),\n navProp: {\n id: testEntity1Id,\n relClassName: \"TestGeneratedClasses:ElemRel\",\n },\n derivedNavProp: {\n id: testEntity2Id,\n relClassName: \"TestGeneratedClasses:DerivedElemRel\",\n },\n } as DerivedWithNavPropProps));\n\n const derived6 = imodel.elements.getElement(derived6Id);\n\n /** it is not possible to make a spy of an already existing spy, so lazy try making one\n * this is necessary since due to prototypes, some \"methods\" we listen to are actually the same\n */\n function spyCollectReferenceIds(cls: typeof Element): sinon.SinonSpy {\n if ((cls.prototype as any).collectReferenceIds.isSinonProxy) {\n return (cls.prototype as any).collectReferenceIds;\n }\n return sinon.spy(cls.prototype, \"collectReferenceIds\" as any);\n }\n\n const elementMethodSpy = spyCollectReferenceIds(Element);\n const testElementWithNavPropSpy = spyCollectReferenceIds(ActualTestElementWithNavProp);\n const derivedWithNavPropSpy = spyCollectReferenceIds(ActualDerivedWithNavProp);\n const derived2Spy = spyCollectReferenceIds(ActualDerived2);\n const derived3Spy = spyCollectReferenceIds(ActualDerived3);\n const derived4Spy = spyCollectReferenceIds(ActualDerived4);\n const derived5Spy = spyCollectReferenceIds(ActualDerived5);\n const derived6Spy = spyCollectReferenceIds(ActualDerived6);\n\n // This demonstrates that if a generated class (Derived6) has a non-generated ancestor, it will not get a generated impl\n // instead it will just call the closest non-generated ancestor (Derived4)\n expect([...derived6.getReferenceIds()]).to.have.members(\n [\n EntityReferences.fromEntityType(derived6.model, ConcreteEntityTypes.Model),\n EntityReferences.fromEntityType(derived6.code.scope, ConcreteEntityTypes.Element),\n derived6.parent?.id && EntityReferences.fromEntityType(derived6.parent.id, ConcreteEntityTypes.Element),\n // \"TestGeneratedClasses:Derived4\" is MyDerived4 above, which extends the Derived4 class, which extends up\n // without any custom ancestor implementing collectReferenceIds, so Element.collectReferenceIds is called as the\n // super, and no navigation properties or other custom implementations are called so we only get \"derived-4\"\n EntityReferences.fromEntityType(\"derived-4\", ConcreteEntityTypes.Element),\n ].filter((x) => x !== undefined),\n );\n\n expect(elementMethodSpy.called).to.be.true; // this is the `super.collectReferenceIds` call in MyDerived4\n expect(testElementWithNavPropSpy.called).to.be.false;\n expect(derivedWithNavPropSpy.called).to.be.false;\n\n // these are the same (tested below)\n expect(derived2Spy.called).to.be.false;\n expect(derived3Spy.called).to.be.false;\n\n // these are all the same (tested below)\n expect(derived4Spy.called).to.be.true;\n expect(derived5Spy.called).to.be.true;\n expect(derived6Spy.called).to.be.true;\n\n expect(\n new Set(\n [\n Element,\n ActualTestElementWithNavProp,\n ActualDerivedWithNavProp,\n Derived2,\n Derived3, // same as above (so will be removed from set)\n Derived4,\n Derived5, // save as above (so will be removed from set)\n Derived6, // save as above (so will be removed from set)\n ].map((e) => e.prototype[\"collectReferenceIds\"]), // eslint-disable-line @typescript-eslint/dot-notation\n ),\n ).to.deep.equal(\n new Set(\n [\n Element,\n ActualTestElementWithNavProp,\n ActualDerivedWithNavProp,\n Derived2,\n Derived4,\n ].map((e) => e.prototype[\"collectReferenceIds\"]), // eslint-disable-line @typescript-eslint/dot-notation\n ),\n );\n\n MyTestGeneratedClasses.unregisterSchema();\n sinon.restore();\n });\n});\n\nclass Base {\n public static staticProperty: string = \"base\";\n public static get sqlName(): string { return `s.${this.staticProperty}`; }\n}\n\nclass Derived extends Base {\n}\n\ndescribe(\"Static Properties\", () => {\n it(\"should be inherited, and the subclass should get its own copy\", async () => {\n assert.equal(Base.staticProperty, \"base\");\n assert.equal(Derived.staticProperty, \"base\"); // Derived inherits Base's staticProperty (via its prototype)\n Derived.staticProperty = \"derived\"; // Derived now gets its own copy of staticProperty\n assert.equal(Base.staticProperty, \"base\"); // Base's staticProperty remains as it was\n assert.equal(Derived.staticProperty, \"derived\"); // Derived's staticProperty is now different\n assert.equal(Base.sqlName, \"s.base\");\n const d = new Derived();\n assert.equal((d.constructor as any).staticProperty, \"derived\"); // Instances of Derived see Derived.staticProperty\n const b = new Base();\n assert.equal((b.constructor as any).staticProperty, \"base\"); // Instances of Base see Base.staticProperty\n });\n\n});\n\ndescribe(\"Global state of ClassRegistry\", () => {\n let imodel1: SnapshotDb;\n let imodel2: SnapshotDb;\n\n before(() => {\n const seedFileName = IModelTestUtils.resolveAssetFile(\"test.bim\");\n const testFileName1 = IModelTestUtils.prepareOutputFile(\"ClassRegistry\", \"GlobalState1.bim\");\n const testFileName2 = IModelTestUtils.prepareOutputFile(\"ClassRegistry\", \"GlobalState2.bim\");\n imodel1 = IModelTestUtils.createSnapshotFromSeed(testFileName1, seedFileName);\n imodel2 = IModelTestUtils.createSnapshotFromSeed(testFileName2, seedFileName);\n assert.exists(imodel1);\n assert.exists(imodel2);\n });\n\n after(() => {\n imodel1?.close();\n imodel2?.close();\n });\n\n it(\"registering a class in different imodels should not affect each other\", async () => {\n await imodel1.importSchemaStrings([\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <ECSchema schemaName=\"TestSchema\" alias=\"ts\" version=\"01.00\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.1\">\n <ECSchemaReference name=\"BisCore\" version=\"01.00\" alias=\"bis\"/>\n\n <ECEntityClass typeName=\"TestClass\">\n <BaseClass>bis:PhysicalElement</BaseClass>\n <ECProperty propertyName=\"foo\" typeName=\"string\"/>\n <ECNavigationProperty propertyName=\"RelatedTestClass\" relationshipName=\"MyRelationship\" direction=\"backward\"/>\n </ECEntityClass>\n\n <ECRelationshipClass typeName=\"MyRelationship\" modifier=\"None\" strength=\"embedding\">\n <Source multiplicity=\"(0..1)\" roleLabel=\"has\" polymorphic=\"false\">\n <Class class=\"TestClass\"/>\n </Source>\n <Target multiplicity=\"(0..*)\" roleLabel=\"has\" polymorphic=\"false\">\n <Class class=\"TestClass\"/>\n </Target>\n </ECRelationshipClass>\n </ECSchema>\n `,\n ]);\n await imodel2.importSchemaStrings([\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <ECSchema schemaName=\"TestSchema\" alias=\"ts\" version=\"01.00\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.1\">\n <ECSchemaReference name=\"BisCore\" version=\"01.00\" alias=\"bis\"/>\n <ECEntityClass typeName=\"TestClass\">\n <BaseClass>bis:PhysicalElement</BaseClass>\n <ECProperty propertyName=\"bar\" typeName=\"string\"/>\n </ECEntityClass>\n </ECSchema>\n `,\n ]);\n\n const testClass1 = imodel1.getJsClass(\"TestSchema:TestClass\");\n assert.isFalse(testClass1.hasOwnProperty(\"testPropertyGuard\"));\n (testClass1 as any).testPropertyGuard = true;\n assert.isTrue(testClass1.hasOwnProperty(\"testPropertyGuard\"));\n\n const testClass2 = imodel2.getJsClass(\"TestSchema:TestClass\");\n assert.isFalse(testClass2.hasOwnProperty(\"testPropertyGuard\"));\n });\n\n\n});\n// TODO: add tests on the new model/aspect prefixes\n"]}
@@ -8,6 +8,7 @@ import { restore as sinonRestore, spy as sinonSpy } from "sinon";
8
8
  import { Guid, Id64 } from "@itwin/core-bentley";
9
9
  import { CodeScopeSpec, CodeSpec, IModel } from "@itwin/core-common";
10
10
  import { ClassRegistry } from "../../ClassRegistry";
11
+ import { EditTxn } from "../../EditTxn";
11
12
  import { ElementUniqueAspect } from "../../ElementAspect";
12
13
  import { _nativeDb, ChannelControl, FunctionalBreakdownElement, FunctionalComponentElement, FunctionalModel, FunctionalPartition, FunctionalSchema, InformationPartitionElement, Schemas, StandaloneDb, } from "../../core-backend";
13
14
  import { ElementOwnsChildElements, ElementOwnsUniqueAspect, SubjectOwnsPartitionElements } from "../../NavigationRelationship";
@@ -234,16 +235,17 @@ describe("Functional Domain", () => {
234
235
  const elements = iModelDb.elements;
235
236
  const dropCommit = iModelDb.txns.onCommit.addListener(() => commits++);
236
237
  const dropCommitted = iModelDb.txns.onCommitted.addListener(() => committed++);
237
- iModelDb.saveChanges("Import Functional schema");
238
+ iModelDb[_nativeDb].saveChanges("Import Functional schema");
238
239
  assert.equal(commits, 1);
239
240
  assert.equal(committed, 1);
240
241
  dropCommit();
241
242
  dropCommitted();
242
243
  IModelTestUtils.flushTxns(iModelDb); // importSchema below will fail if this is not called to flush local changes
243
244
  await iModelDb.importSchemas([join(KnownTestLocations.assetsDir, "TestFunctional.ecschema.xml")]);
244
- iModelDb.saveChanges("Import TestFunctional schema");
245
245
  assert.equal(commits, 1);
246
246
  assert.equal(committed, 1);
247
+ const txn = new EditTxn(iModelDb, "functional domain test");
248
+ txn.start();
247
249
  const testChannelKey1 = "channel 1 for tests";
248
250
  const testChannelKey2 = "channel 2 for tests";
249
251
  function testChannel(channelKey, fn, spies) {
@@ -303,11 +305,11 @@ describe("Functional Domain", () => {
303
305
  };
304
306
  assert.equal(iModelDb.channels.queryChannelRoot(ChannelControl.sharedChannelName), IModel.rootSubjectId);
305
307
  const codeSpec = CodeSpec.create(iModelDb, "Test Functional Elements", CodeScopeSpec.Type.Model);
306
- iModelDb.codeSpecs.insert(codeSpec);
308
+ iModelDb.codeSpecs.insert(txn, codeSpec);
307
309
  assert.isTrue(Id64.isValidId64(codeSpec.id));
308
310
  // create a channel for all elements in this test
309
311
  assert.isUndefined(iModelDb.channels.queryChannelRoot(testChannelKey1));
310
- const subject1Id = iModelDb.channels.insertChannelSubject({ subjectName: "Test Functional Subject", channelKey: testChannelKey1 });
312
+ const subject1Id = iModelDb.channels.insertChannelSubject({ subjectName: "Test Functional Subject", channelKey: testChannelKey1, txn });
311
313
  assert.equal(iModelDb.channels.queryChannelRoot(testChannelKey1), subject1Id);
312
314
  const partitionCode = FunctionalPartition.createCode(iModelDb, subject1Id, "Test Functional Model");
313
315
  const partitionProps = {
@@ -315,8 +317,8 @@ describe("Functional Domain", () => {
315
317
  parent: new SubjectOwnsPartitionElements(subject1Id), code: partitionCode,
316
318
  };
317
319
  iModelDb.channels.addAllowedChannel(testChannelKey1);
318
- let partitionId = iModelDb.elements.insertElement(partitionProps);
319
- const modelId = testChannel(testChannelKey1, () => iModelDb.models.insertModel({ classFullName: TestFuncModel.classFullName, modeledElement: { id: partitionId } }), [spy.model.onInsert]);
320
+ let partitionId = txn.insertElement(partitionProps);
321
+ const modelId = testChannel(testChannelKey1, () => txn.insertModel({ classFullName: TestFuncModel.classFullName, modeledElement: { id: partitionId } }), [spy.model.onInsert]);
320
322
  assert.isTrue(Id64.isValidId64(modelId));
321
323
  assert.isTrue(spy.model.onInsert.calledOnce);
322
324
  assert.isTrue(spy.model.onInserted.calledOnce);
@@ -326,25 +328,25 @@ describe("Functional Domain", () => {
326
328
  assert.isTrue(spy.partition.onSubModelInsert.calledOnce);
327
329
  assert.isTrue(spy.partition.onSubModelInserted.calledOnce);
328
330
  assert.equal(spy.partition.onSubModelInserted.getCall(0).args[0].subModelId, modelId, "Element.onSubModelInserted should have correct subModelId");
329
- expect(() => iModelDb.channels.insertChannelSubject({ subjectName: "Test Functional Subject 2", channelKey: testChannelKey1 })).to.throw(`Channel ${testChannelKey1} root already exist`);
330
- const subject2Id = iModelDb.channels.insertChannelSubject({ subjectName: "Test Functional Subject 2", channelKey: testChannelKey2 });
331
+ expect(() => iModelDb.channels.insertChannelSubject({ subjectName: "Test Functional Subject 2", channelKey: testChannelKey1, txn })).to.throw(`Channel ${testChannelKey1} root already exist`);
332
+ const subject2Id = iModelDb.channels.insertChannelSubject({ subjectName: "Test Functional Subject 2", channelKey: testChannelKey2, txn });
331
333
  iModelDb.channels.addAllowedChannel(testChannelKey2);
332
- expect(() => iModelDb.channels.insertChannelSubject({ subjectName: "Nested Subject", parentSubjectId: subject2Id, channelKey: "nested channel" })).to.throw("may not nest");
334
+ expect(() => iModelDb.channels.insertChannelSubject({ subjectName: "Nested Subject", parentSubjectId: subject2Id, channelKey: "nested channel", txn })).to.throw("may not nest");
333
335
  partitionProps.code.value = "Test Func 2";
334
336
  partitionProps.parent = new SubjectOwnsPartitionElements(subject2Id);
335
- partitionId = iModelDb.elements.insertElement(partitionProps);
336
- const modelId2 = iModelDb.models.insertModel({ classFullName: TestFuncModel.classFullName, modeledElement: { id: partitionId } });
337
+ partitionId = txn.insertElement(partitionProps);
338
+ const modelId2 = txn.insertModel({ classFullName: TestFuncModel.classFullName, modeledElement: { id: partitionId } });
337
339
  assert.isTrue(Id64.isValidId64(modelId2));
338
340
  assert.equal(spy.model.onInserted.getCall(1).args[0].id, modelId2, "second insert should set new id");
339
341
  assert.equal(spy.model.onInsert.callCount, 2);
340
342
  assert.equal(spy.model.onInserted.callCount, 2);
341
343
  assert.equal(spy.partition.onSubModelInserted.getCall(1).args[0].subModelId, modelId2, "Element.onSubModelInserted should have correct subModelId");
342
344
  const model2 = iModelDb.models.getModel(modelId2);
343
- testChannel(testChannelKey2, () => model2.update(), []);
345
+ testChannel(testChannelKey2, () => model2.update(txn), []);
344
346
  assert.equal(spy.model.onUpdated.getCall(0).args[0].id, modelId2);
345
347
  assert.equal(spy.model.onUpdate.callCount, 2);
346
348
  assert.equal(spy.model.onUpdated.callCount, 1);
347
- testChannel(testChannelKey2, () => model2.delete(), [spy.model.onDelete, spy.partition.onSubModelDelete]);
349
+ testChannel(testChannelKey2, () => model2.delete(txn), [spy.model.onDelete, spy.partition.onSubModelDelete]);
348
350
  assert.isTrue(spy.model.onDelete.calledOnce);
349
351
  assert.isTrue(spy.model.onDeleted.calledOnce);
350
352
  assert.equal(spy.model.onDeleted.getCall(0).args[0].id, modelId2);
@@ -352,7 +354,7 @@ describe("Functional Domain", () => {
352
354
  assert.isTrue(spy.partition.onSubModelDeleted.calledOnce);
353
355
  assert.equal(spy.partition.onSubModelDeleted.getCall(0).args[0].subModelId, modelId2);
354
356
  const breakdownProps = { classFullName: Breakdown.classFullName, model: modelId, code: { spec: codeSpec.id, scope: modelId, value: "Breakdown1" } };
355
- const breakdownId = testChannel(testChannelKey1, () => elements.insertElement(breakdownProps), [spy.model.onInsertElement, spy.breakdown.onInsert]);
357
+ const breakdownId = testChannel(testChannelKey1, () => txn.insertElement(breakdownProps), [spy.model.onInsertElement, spy.breakdown.onInsert]);
356
358
  assert.isTrue(Id64.isValidId64(breakdownId));
357
359
  assert.isTrue(spy.model.onInsertElement.calledOnce);
358
360
  assert.isTrue(spy.model.onInsertedElement.calledOnce);
@@ -363,13 +365,13 @@ describe("Functional Domain", () => {
363
365
  assert.equal(spy.breakdown.onInsert.getCall(0).args[0].props, breakdownProps);
364
366
  const breakdown2Props = { classFullName: Breakdown.classFullName, model: modelId, code: { spec: codeSpec.id, scope: modelId, value: "badval" } };
365
367
  // TestFuncModel.onInsertElement throws for this code.value
366
- expect(() => elements.insertElement(breakdown2Props)).to.throw("bad element");
368
+ expect(() => txn.insertElement(breakdown2Props)).to.throw("bad element");
367
369
  breakdown2Props.code.value = "Breakdown2";
368
370
  breakdown2Props.userLabel = "start label"; // gets overwritten in `onInsert`
369
- const bd2 = elements.insertElement(breakdown2Props);
371
+ const bd2 = txn.insertElement(breakdown2Props);
370
372
  const aspect = { classFullName: TestFuncAspect.classFullName, element: new ElementOwnsUniqueAspect(bd2), strProp: "prop 1" };
371
373
  TestFuncAspect.expectedVal = aspect.strProp;
372
- testChannel(testChannelKey1, () => elements.insertAspect(aspect), [spy.aspect.onInsert]);
374
+ testChannel(testChannelKey1, () => txn.insertAspect(aspect), [spy.aspect.onInsert]);
373
375
  assert.isTrue(spy.aspect.onInsert.calledOnce);
374
376
  assert.isTrue(spy.aspect.onInserted.calledOnce);
375
377
  assert.isFalse(spy.aspect.onUpdate.called);
@@ -377,7 +379,7 @@ describe("Functional Domain", () => {
377
379
  assert.equal(spy.aspect.onInserted.getCall(0).args[0].props.element.id, bd2, "elemId from ElementAspect.onInserted");
378
380
  aspect.strProp = "prop 2";
379
381
  TestFuncAspect.expectedVal = aspect.strProp;
380
- testChannel(testChannelKey1, () => elements.updateAspect(aspect), [spy.aspect.onUpdate]);
382
+ testChannel(testChannelKey1, () => txn.updateAspect(aspect), [spy.aspect.onUpdate]);
381
383
  assert.equal(spy.aspect.onInsert.callCount, 1, "ElementAspect.onInsert should not be called on update");
382
384
  assert.equal(spy.aspect.onInserted.callCount, 1, "ElementAspect.onInserted should should not be called on update");
383
385
  assert.equal(spy.aspect.onUpdate.callCount, 1);
@@ -385,7 +387,7 @@ describe("Functional Domain", () => {
385
387
  assert.equal(spy.aspect.onUpdated.getCall(0).args[0].props.element.id, bd2, "from ElementAspect.onUpdated");
386
388
  const aspects = elements.getAspects(bd2, TestFuncAspect.classFullName);
387
389
  assert.equal(aspects.length, 1);
388
- testChannel(testChannelKey1, () => elements.deleteAspect(aspects[0].id), [spy.aspect.onDelete]);
390
+ testChannel(testChannelKey1, () => txn.deleteAspect(aspects[0].id), [spy.aspect.onDelete]);
389
391
  assert.equal(spy.aspect.onDelete.callCount, 1);
390
392
  assert.equal(spy.aspect.onDeleted.callCount, 1);
391
393
  assert.equal(spy.aspect.onDelete.getCall(0).args[0].aspectId, aspects[0].id);
@@ -394,14 +396,14 @@ describe("Functional Domain", () => {
394
396
  assert.equal(bd2el.userLabel, insertedLabel, "label was modified by onInsert");
395
397
  expect(iModelDb.channels.getChannelKey(bd2)).equals(testChannelKey1);
396
398
  bd2el.userLabel = "nothing";
397
- testChannel(testChannelKey1, () => bd2el.update(), [spy.breakdown.onUpdate, spy.breakdown.onUpdated]);
399
+ testChannel(testChannelKey1, () => bd2el.update(txn), [spy.breakdown.onUpdate, spy.breakdown.onUpdated]);
398
400
  bd2el = elements.getElement(bd2);
399
401
  assert.equal(bd2el.userLabel, updatedLabel, "label was modified in onUpdate");
400
402
  assert.equal(spy.breakdown.onUpdate.callCount, 1);
401
403
  assert.equal(spy.breakdown.onUpdated.callCount, 1);
402
404
  assert.equal(spy.breakdown.onUpdate.getCall(0).args[0].props.id, bd2);
403
405
  assert.equal(spy.breakdown.onUpdated.getCall(0).args[0].id, bd2);
404
- testChannel(testChannelKey1, () => bd2el.delete(), [spy.breakdown.onDelete]);
406
+ testChannel(testChannelKey1, () => bd2el.delete(txn), [spy.breakdown.onDelete]);
405
407
  assert.equal(spy.breakdown.onDelete.callCount, 1);
406
408
  assert.equal(spy.breakdown.onDeleted.callCount, 1);
407
409
  const deleteArg = spy.breakdown.onDelete.getCall(0).args[0];
@@ -414,20 +416,20 @@ describe("Functional Domain", () => {
414
416
  model: modelId,
415
417
  code: { spec: codeSpec.id, scope: modelId, value: "bd3" },
416
418
  };
417
- const bd3 = elements.insertElement(breakdown3Props);
419
+ const bd3 = txn.insertElement(breakdown3Props);
418
420
  const componentProps = {
419
421
  classFullName: Component.classFullName,
420
422
  model: modelId,
421
423
  parent: { id: breakdownId, relClassName: ElementOwnsChildElements.classFullName },
422
424
  code: { spec: codeSpec.id, scope: modelId, value: "Component1" },
423
425
  };
424
- const componentId = testChannel(testChannelKey1, () => elements.insertElement(componentProps), []);
426
+ const componentId = testChannel(testChannelKey1, () => txn.insertElement(componentProps), []);
425
427
  assert.isTrue(Id64.isValidId64(componentId));
426
428
  assert.equal(spy.breakdown.onChildInserted.callCount, 1);
427
429
  assert.equal(spy.breakdown.onChildInserted.getCall(0).args[0].childId, componentId);
428
430
  // test model and element callbacks for updateElement
429
431
  const component1 = elements.getElement(componentId);
430
- testChannel(testChannelKey1, () => component1.update(), [spy.model.onUpdateElement, spy.model.onUpdatedElement]);
432
+ testChannel(testChannelKey1, () => component1.update(txn), [spy.model.onUpdateElement, spy.model.onUpdatedElement]);
431
433
  assert.equal(spy.model.onUpdateElement.callCount, 1);
432
434
  assert.equal(spy.model.onUpdatedElement.callCount, 1);
433
435
  assert.equal(spy.model.onUpdatedElement.getCall(0).args[0].elementId, componentId);
@@ -436,21 +438,21 @@ describe("Functional Domain", () => {
436
438
  assert.equal(spy.breakdown.onChildUpdate.getCall(0).args[0].parentId, breakdownId);
437
439
  assert.equal(spy.breakdown.onChildUpdated.getCall(0).args[0].childId, componentId);
438
440
  componentProps.code.value = "comp2";
439
- const comp2 = elements.insertElement(componentProps);
441
+ const comp2 = txn.insertElement(componentProps);
440
442
  assert.equal(spy.breakdown.onChildInserted.callCount, 2);
441
443
  assert.equal(spy.breakdown.onChildInserted.getCall(1).args[0].childId, comp2);
442
444
  const el2 = elements.getElement(comp2);
443
445
  spy.model.onDeleteElement.resetHistory();
444
446
  spy.model.onDeletedElement.resetHistory();
445
447
  TestFuncModel.dontDelete = comp2; // block deletion through model
446
- expect(() => el2.delete()).to.throw("dont delete my element");
448
+ expect(() => el2.delete(txn)).to.throw("dont delete my element");
447
449
  TestFuncModel.dontDelete = ""; // allow deletion through model
448
450
  Breakdown.dontDeleteChild = comp2; // but block through parent
449
- expect(() => el2.delete()).to.throw("dont delete my child"); // nope
451
+ expect(() => el2.delete(txn)).to.throw("dont delete my child"); // nope
450
452
  assert.equal(spy.model.onDeleteElement.callCount, 2, "Model.onElementDelete gets called even though element is not really deleted");
451
453
  assert.equal(spy.model.onDeletedElement.callCount, 0, "make sure Model.onElementDeleted did not get called");
452
454
  Breakdown.dontDeleteChild = ""; // now fully allow delete
453
- el2.delete();
455
+ el2.delete(txn);
454
456
  assert.equal(spy.model.onDeleteElement.callCount, 3, "Model.onElementDelete should be called again");
455
457
  assert.equal(spy.model.onDeletedElement.callCount, 1);
456
458
  assert.equal(spy.model.onDeletedElement.getCall(0).args[0].elementId, comp2);
@@ -459,10 +461,10 @@ describe("Functional Domain", () => {
459
461
  // next we make sure that changing the parent of an element calls the "onChildAdd/Drop/Added/Dropped" callbacks.
460
462
  // To do this we switch a component's parent from "breakDownId" to "bc3"
461
463
  componentProps.parent.id = bd3;
462
- const comp3 = elements.insertElement(componentProps);
464
+ const comp3 = txn.insertElement(componentProps);
463
465
  const compEl3 = elements.getElementProps(comp3);
464
466
  compEl3.parent.id = breakdownId;
465
- testChannel(testChannelKey1, () => elements.updateElement(compEl3), []);
467
+ testChannel(testChannelKey1, () => txn.updateElement(compEl3), []);
466
468
  assert.equal(spy.breakdown.onChildAdd.callCount, 1);
467
469
  assert.equal(spy.breakdown.onChildAdd.getCall(0).args[0].parentId, breakdownId);
468
470
  assert.equal(spy.breakdown.onChildAdd.getCall(0).args[0].childProps.id, comp3);
@@ -475,15 +477,15 @@ describe("Functional Domain", () => {
475
477
  assert.equal(spy.breakdown.onChildDropped.callCount, 1);
476
478
  assert.equal(spy.breakdown.onChildDropped.getCall(0).args[0].parentId, bd3);
477
479
  assert.equal(spy.breakdown.onChildDropped.getCall(0).args[0].childId, comp3);
478
- iModelDb.saveChanges("Insert Functional elements");
480
+ txn.saveChanges("Insert Functional elements");
479
481
  // unregister test schema to make sure it will throw exceptions if it is not present (since it has the "SchemaHasBehavior" custom attribute)
480
482
  Schemas.unregisterSchema(TestSchema.schemaName);
481
483
  const errMsg = "Schema [TestFunctional] not registered, but is marked with SchemaHasBehavior";
482
- expect(() => elements.deleteElement(breakdownId)).to.throw(errMsg);
484
+ expect(() => txn.deleteElement(breakdownId)).to.throw(errMsg);
483
485
  assert.isDefined(elements.getElement(breakdownId), "should not have been deleted");
484
- expect(() => elements.updateElement(breakdownProps)).to.throw(errMsg);
486
+ expect(() => txn.updateElement(breakdownProps)).to.throw(errMsg);
485
487
  breakdownProps.code.value = "Breakdown 2";
486
- expect(() => elements.insertElement(breakdownProps)).to.throw(errMsg);
488
+ expect(() => txn.insertElement(breakdownProps)).to.throw(errMsg);
487
489
  iModelDb.close();
488
490
  });
489
491
  });