@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
@@ -7,9 +7,34 @@ import { Code, IModel, SubCategoryAppearance } from "@itwin/core-common";
7
7
  import * as chai from "chai";
8
8
  import { HubWrappers, IModelTestUtils, KnownTestLocations } from "..";
9
9
  import { BriefcaseManager, ChannelControl, DrawingCategory, IModelJsFs } from "../../core-backend";
10
+ import { EditTxn, withEditTxn } from "../../EditTxn";
10
11
  import { HubMock } from "../../internal/HubMock";
11
12
  import { EntityClass } from "@itwin/ecschema-metadata";
12
13
  import { TestUtils } from "../TestUtils";
14
+ function startTestTxn(iModel, description = "semantic rebase") {
15
+ const txn = new EditTxn(iModel, description);
16
+ txn.start();
17
+ return txn;
18
+ }
19
+ function endTestTxn(txn) {
20
+ if (txn.isActive)
21
+ txn.end("abandon");
22
+ }
23
+ async function importSchemaStrings(txn, schemas) {
24
+ if (txn.isActive)
25
+ txn.saveChanges();
26
+ await txn.iModel.importSchemaStrings(schemas);
27
+ }
28
+ async function pushChanges(txn, description) {
29
+ const briefcase = txn.iModel;
30
+ endTestTxn(txn);
31
+ await briefcase.pushChanges({ description });
32
+ }
33
+ async function pullChanges(txn) {
34
+ const briefcase = txn.iModel;
35
+ endTestTxn(txn);
36
+ await briefcase.pullChanges();
37
+ }
13
38
  /**
14
39
  * Test infrastructure for rebase tests in this file.
15
40
  * Manages two briefcases (far and local)
@@ -30,167 +55,167 @@ class TestIModel {
30
55
  /** Reusable schema definitions for testing rebase with schema transformations */
31
56
  static schemas = {
32
57
  /** Base schema v01.00.00 with classes A, C, D */
33
- v01x00x00: `<?xml version="1.0" encoding="UTF-8"?>
34
- <ECSchema schemaName="TestDomain" alias="td" version="01.00.00" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
35
- <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
36
- <ECEntityClass typeName="A">
37
- <BaseClass>bis:GraphicalElement2d</BaseClass>
38
- <ECProperty propertyName="PropA" typeName="string"/>
39
- </ECEntityClass>
40
- <ECEntityClass typeName="C">
41
- <BaseClass>A</BaseClass>
42
- <ECProperty propertyName="PropC" typeName="string"/>
43
- </ECEntityClass>
44
- <ECEntityClass typeName="D">
45
- <BaseClass>A</BaseClass>
46
- <ECProperty propertyName="PropD" typeName="string"/>
47
- </ECEntityClass>
58
+ v01x00x00: `<?xml version="1.0" encoding="UTF-8"?>
59
+ <ECSchema schemaName="TestDomain" alias="td" version="01.00.00" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
60
+ <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
61
+ <ECEntityClass typeName="A">
62
+ <BaseClass>bis:GraphicalElement2d</BaseClass>
63
+ <ECProperty propertyName="PropA" typeName="string"/>
64
+ </ECEntityClass>
65
+ <ECEntityClass typeName="C">
66
+ <BaseClass>A</BaseClass>
67
+ <ECProperty propertyName="PropC" typeName="string"/>
68
+ </ECEntityClass>
69
+ <ECEntityClass typeName="D">
70
+ <BaseClass>A</BaseClass>
71
+ <ECProperty propertyName="PropD" typeName="string"/>
72
+ </ECEntityClass>
48
73
  </ECSchema>`,
49
74
  /** v01.00.01 - Adds PropC2 to class C (trivial additive change) */
50
- v01x00x01AddPropC2: `<?xml version="1.0" encoding="UTF-8"?>
51
- <ECSchema schemaName="TestDomain" alias="td" version="01.00.01" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
52
- <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
53
- <ECEntityClass typeName="A">
54
- <BaseClass>bis:GraphicalElement2d</BaseClass>
55
- <ECProperty propertyName="PropA" typeName="string"/>
56
- </ECEntityClass>
57
- <ECEntityClass typeName="C">
58
- <BaseClass>A</BaseClass>
59
- <ECProperty propertyName="PropC" typeName="string"/>
60
- <ECProperty propertyName="PropC2" typeName="string"/>
61
- </ECEntityClass>
62
- <ECEntityClass typeName="D">
63
- <BaseClass>A</BaseClass>
64
- <ECProperty propertyName="PropD" typeName="string"/>
65
- </ECEntityClass>
75
+ v01x00x01AddPropC2: `<?xml version="1.0" encoding="UTF-8"?>
76
+ <ECSchema schemaName="TestDomain" alias="td" version="01.00.01" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
77
+ <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
78
+ <ECEntityClass typeName="A">
79
+ <BaseClass>bis:GraphicalElement2d</BaseClass>
80
+ <ECProperty propertyName="PropA" typeName="string"/>
81
+ </ECEntityClass>
82
+ <ECEntityClass typeName="C">
83
+ <BaseClass>A</BaseClass>
84
+ <ECProperty propertyName="PropC" typeName="string"/>
85
+ <ECProperty propertyName="PropC2" typeName="string"/>
86
+ </ECEntityClass>
87
+ <ECEntityClass typeName="D">
88
+ <BaseClass>A</BaseClass>
89
+ <ECProperty propertyName="PropD" typeName="string"/>
90
+ </ECEntityClass>
66
91
  </ECSchema>`,
67
92
  /** v01.00.02 - Adds PropD2 to class D (trivial additive change) */
68
- v01x00x02AddPropD2: `<?xml version="1.0" encoding="UTF-8"?>
69
- <ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
70
- <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
71
- <ECEntityClass typeName="A">
72
- <BaseClass>bis:GraphicalElement2d</BaseClass>
73
- <ECProperty propertyName="PropA" typeName="string"/>
74
- </ECEntityClass>
75
- <ECEntityClass typeName="C">
76
- <BaseClass>A</BaseClass>
77
- <ECProperty propertyName="PropC" typeName="string"/>
78
- <ECProperty propertyName="PropC2" typeName="string"/>
79
- </ECEntityClass>
80
- <ECEntityClass typeName="D">
81
- <BaseClass>A</BaseClass>
82
- <ECProperty propertyName="PropD" typeName="string"/>
83
- <ECProperty propertyName="PropD2" typeName="string"/>
84
- </ECEntityClass>
93
+ v01x00x02AddPropD2: `<?xml version="1.0" encoding="UTF-8"?>
94
+ <ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
95
+ <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
96
+ <ECEntityClass typeName="A">
97
+ <BaseClass>bis:GraphicalElement2d</BaseClass>
98
+ <ECProperty propertyName="PropA" typeName="string"/>
99
+ </ECEntityClass>
100
+ <ECEntityClass typeName="C">
101
+ <BaseClass>A</BaseClass>
102
+ <ECProperty propertyName="PropC" typeName="string"/>
103
+ <ECProperty propertyName="PropC2" typeName="string"/>
104
+ </ECEntityClass>
105
+ <ECEntityClass typeName="D">
106
+ <BaseClass>A</BaseClass>
107
+ <ECProperty propertyName="PropD" typeName="string"/>
108
+ <ECProperty propertyName="PropD2" typeName="string"/>
109
+ </ECEntityClass>
85
110
  </ECSchema>`,
86
111
  /** v01.00.02 - Moves PropC from C to A (requires data transformation) on top of v01.00.01 */
87
- v01x00x02MovePropCToA: `<?xml version="1.0" encoding="UTF-8"?>
88
- <ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
89
- <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
90
- <ECEntityClass typeName="A">
91
- <BaseClass>bis:GraphicalElement2d</BaseClass>
92
- <ECProperty propertyName="PropA" typeName="string"/>
93
- <ECProperty propertyName="PropC" typeName="string"/>
94
- </ECEntityClass>
95
- <ECEntityClass typeName="C">
96
- <BaseClass>A</BaseClass>
97
- <ECProperty propertyName="PropC2" typeName="string"/>
98
- </ECEntityClass>
99
- <ECEntityClass typeName="D">
100
- <BaseClass>A</BaseClass>
101
- <ECProperty propertyName="PropD" typeName="string"/>
102
- </ECEntityClass>
112
+ v01x00x02MovePropCToA: `<?xml version="1.0" encoding="UTF-8"?>
113
+ <ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
114
+ <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
115
+ <ECEntityClass typeName="A">
116
+ <BaseClass>bis:GraphicalElement2d</BaseClass>
117
+ <ECProperty propertyName="PropA" typeName="string"/>
118
+ <ECProperty propertyName="PropC" typeName="string"/>
119
+ </ECEntityClass>
120
+ <ECEntityClass typeName="C">
121
+ <BaseClass>A</BaseClass>
122
+ <ECProperty propertyName="PropC2" typeName="string"/>
123
+ </ECEntityClass>
124
+ <ECEntityClass typeName="D">
125
+ <BaseClass>A</BaseClass>
126
+ <ECProperty propertyName="PropD" typeName="string"/>
127
+ </ECEntityClass>
103
128
  </ECSchema>`,
104
129
  /** v01.00.03 - Builds on top of v01.00.02 and in addition moves PropD to base, so we can have incoming and local transforming changes */
105
- v01x00x03MovePropCAndD: `<?xml version="1.0" encoding="UTF-8"?>
106
- <ECSchema schemaName="TestDomain" alias="td" version="01.00.03" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
107
- <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
108
- <ECEntityClass typeName="A">
109
- <BaseClass>bis:GraphicalElement2d</BaseClass>
110
- <ECProperty propertyName="PropA" typeName="string"/>
111
- <ECProperty propertyName="PropC" typeName="string"/>
112
- <ECProperty propertyName="PropD" typeName="string"/>
113
- </ECEntityClass>
114
- <ECEntityClass typeName="C">
115
- <BaseClass>A</BaseClass>
116
- <ECProperty propertyName="PropC2" typeName="string"/>
117
- </ECEntityClass>
118
- <ECEntityClass typeName="D">
119
- <BaseClass>A</BaseClass>
120
- <ECProperty propertyName="PropD2" typeName="string"/>
121
- </ECEntityClass>
130
+ v01x00x03MovePropCAndD: `<?xml version="1.0" encoding="UTF-8"?>
131
+ <ECSchema schemaName="TestDomain" alias="td" version="01.00.03" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
132
+ <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
133
+ <ECEntityClass typeName="A">
134
+ <BaseClass>bis:GraphicalElement2d</BaseClass>
135
+ <ECProperty propertyName="PropA" typeName="string"/>
136
+ <ECProperty propertyName="PropC" typeName="string"/>
137
+ <ECProperty propertyName="PropD" typeName="string"/>
138
+ </ECEntityClass>
139
+ <ECEntityClass typeName="C">
140
+ <BaseClass>A</BaseClass>
141
+ <ECProperty propertyName="PropC2" typeName="string"/>
142
+ </ECEntityClass>
143
+ <ECEntityClass typeName="D">
144
+ <BaseClass>A</BaseClass>
145
+ <ECProperty propertyName="PropD2" typeName="string"/>
146
+ </ECEntityClass>
122
147
  </ECSchema>`,
123
148
  /** v01.00.01 (incompatible variant) - Adds PropC3 instead of PropC2 to class C (same version) */
124
- v01x00x01AddPropC3Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
125
- <ECSchema schemaName="TestDomain" alias="td" version="01.00.01" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
126
- <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
127
- <ECEntityClass typeName="A">
128
- <BaseClass>bis:GraphicalElement2d</BaseClass>
129
- <ECProperty propertyName="PropA" typeName="string"/>
130
- </ECEntityClass>
131
- <ECEntityClass typeName="C">
132
- <BaseClass>A</BaseClass>
133
- <ECProperty propertyName="PropC" typeName="string"/>
134
- <ECProperty propertyName="PropC3" typeName="string"/>
135
- </ECEntityClass>
136
- <ECEntityClass typeName="D">
137
- <BaseClass>A</BaseClass>
138
- <ECProperty propertyName="PropD" typeName="string"/>
139
- </ECEntityClass>
149
+ v01x00x01AddPropC3Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
150
+ <ECSchema schemaName="TestDomain" alias="td" version="01.00.01" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
151
+ <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
152
+ <ECEntityClass typeName="A">
153
+ <BaseClass>bis:GraphicalElement2d</BaseClass>
154
+ <ECProperty propertyName="PropA" typeName="string"/>
155
+ </ECEntityClass>
156
+ <ECEntityClass typeName="C">
157
+ <BaseClass>A</BaseClass>
158
+ <ECProperty propertyName="PropC" typeName="string"/>
159
+ <ECProperty propertyName="PropC3" typeName="string"/>
160
+ </ECEntityClass>
161
+ <ECEntityClass typeName="D">
162
+ <BaseClass>A</BaseClass>
163
+ <ECProperty propertyName="PropD" typeName="string"/>
164
+ </ECEntityClass>
140
165
  </ECSchema>`,
141
166
  /** v01.00.02 (incompatible variant) - Adds PropC3 instead of PropC2 to class C (higher version) */
142
- v01x00x02AddPropC3Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
143
- <ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
144
- <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
145
- <ECEntityClass typeName="A">
146
- <BaseClass>bis:GraphicalElement2d</BaseClass>
147
- <ECProperty propertyName="PropA" typeName="string"/>
148
- </ECEntityClass>
149
- <ECEntityClass typeName="C">
150
- <BaseClass>A</BaseClass>
151
- <ECProperty propertyName="PropC" typeName="string"/>
152
- <ECProperty propertyName="PropC3" typeName="string"/>
153
- </ECEntityClass>
154
- <ECEntityClass typeName="D">
155
- <BaseClass>A</BaseClass>
156
- <ECProperty propertyName="PropD" typeName="string"/>
157
- </ECEntityClass>
167
+ v01x00x02AddPropC3Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
168
+ <ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
169
+ <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
170
+ <ECEntityClass typeName="A">
171
+ <BaseClass>bis:GraphicalElement2d</BaseClass>
172
+ <ECProperty propertyName="PropA" typeName="string"/>
173
+ </ECEntityClass>
174
+ <ECEntityClass typeName="C">
175
+ <BaseClass>A</BaseClass>
176
+ <ECProperty propertyName="PropC" typeName="string"/>
177
+ <ECProperty propertyName="PropC3" typeName="string"/>
178
+ </ECEntityClass>
179
+ <ECEntityClass typeName="D">
180
+ <BaseClass>A</BaseClass>
181
+ <ECProperty propertyName="PropD" typeName="string"/>
182
+ </ECEntityClass>
158
183
  </ECSchema>`,
159
184
  /** v01.00.02 (incompatible variant) - Adds PropC2 (higher version, different type) */
160
- v01x00x02AddPropC2Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
161
- <ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
162
- <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
163
- <ECEntityClass typeName="A">
164
- <BaseClass>bis:GraphicalElement2d</BaseClass>
165
- <ECProperty propertyName="PropA" typeName="string"/>
166
- </ECEntityClass>
167
- <ECEntityClass typeName="C">
168
- <BaseClass>A</BaseClass>
169
- <ECProperty propertyName="PropC" typeName="string"/>
170
- <ECProperty propertyName="PropC2" typeName="int"/>
171
- </ECEntityClass>
172
- <ECEntityClass typeName="D">
173
- <BaseClass>A</BaseClass>
174
- <ECProperty propertyName="PropD" typeName="string"/>
175
- </ECEntityClass>
185
+ v01x00x02AddPropC2Incompatible: `<?xml version="1.0" encoding="UTF-8"?>
186
+ <ECSchema schemaName="TestDomain" alias="td" version="01.00.02" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
187
+ <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
188
+ <ECEntityClass typeName="A">
189
+ <BaseClass>bis:GraphicalElement2d</BaseClass>
190
+ <ECProperty propertyName="PropA" typeName="string"/>
191
+ </ECEntityClass>
192
+ <ECEntityClass typeName="C">
193
+ <BaseClass>A</BaseClass>
194
+ <ECProperty propertyName="PropC" typeName="string"/>
195
+ <ECProperty propertyName="PropC2" typeName="int"/>
196
+ </ECEntityClass>
197
+ <ECEntityClass typeName="D">
198
+ <BaseClass>A</BaseClass>
199
+ <ECProperty propertyName="PropD" typeName="string"/>
200
+ </ECEntityClass>
176
201
  </ECSchema>`,
177
202
  /** v01.00.03 - Adds PropC2 as string (used to test incompatibility when reinstated on top of v01.00.02 with PropC2:int) */
178
- v01x00x03AddPropC2: `<?xml version="1.0" encoding="UTF-8"?>
179
- <ECSchema schemaName="TestDomain" alias="td" version="01.00.03" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
180
- <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
181
- <ECEntityClass typeName="A">
182
- <BaseClass>bis:GraphicalElement2d</BaseClass>
183
- <ECProperty propertyName="PropA" typeName="string"/>
184
- </ECEntityClass>
185
- <ECEntityClass typeName="C">
186
- <BaseClass>A</BaseClass>
187
- <ECProperty propertyName="PropC" typeName="string"/>
188
- <ECProperty propertyName="PropC2" typeName="string"/>
189
- </ECEntityClass>
190
- <ECEntityClass typeName="D">
191
- <BaseClass>A</BaseClass>
192
- <ECProperty propertyName="PropD" typeName="string"/>
193
- </ECEntityClass>
203
+ v01x00x03AddPropC2: `<?xml version="1.0" encoding="UTF-8"?>
204
+ <ECSchema schemaName="TestDomain" alias="td" version="01.00.03" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
205
+ <ECSchemaReference name="BisCore" version="01.00.23" alias="bis"/>
206
+ <ECEntityClass typeName="A">
207
+ <BaseClass>bis:GraphicalElement2d</BaseClass>
208
+ <ECProperty propertyName="PropA" typeName="string"/>
209
+ </ECEntityClass>
210
+ <ECEntityClass typeName="C">
211
+ <BaseClass>A</BaseClass>
212
+ <ECProperty propertyName="PropC" typeName="string"/>
213
+ <ECProperty propertyName="PropC2" typeName="string"/>
214
+ </ECEntityClass>
215
+ <ECEntityClass typeName="D">
216
+ <BaseClass>A</BaseClass>
217
+ <ECProperty propertyName="PropD" typeName="string"/>
218
+ </ECEntityClass>
194
219
  </ECSchema>`,
195
220
  };
196
221
  /**
@@ -200,41 +225,54 @@ class TestIModel {
200
225
  */
201
226
  static async initialize(testName) {
202
227
  HubMock.startup(testName, KnownTestLocations.outputDir);
203
- const iModelId = await HubMock.createNewIModel({
204
- iTwinId: HubMock.iTwinId,
205
- iModelName: testName,
206
- description: `Rebase schema update with data transform tests: ${testName}`,
207
- });
208
- // Open far briefcase and use it for initialization
209
- const far = await HubWrappers.downloadAndOpenBriefcase({
210
- iTwinId: HubMock.iTwinId,
211
- iModelId,
212
- accessToken: "far-user",
213
- });
214
- far.channels.addAllowedChannel(ChannelControl.sharedChannelName);
215
- far.saveChanges();
216
- // Initialize with base schema
217
- await far.importSchemaStrings([TestIModel.schemas.v01x00x00]);
218
- far.saveChanges("import base schema");
219
- await far.pushChanges({ description: "import base schema" });
220
- // Create model and category
221
- const modelCode = IModelTestUtils.getUniqueModelCode(far, "DrawingModel");
222
- await far.locks.acquireLocks({ shared: IModel.dictionaryId });
223
- const [, drawingModelId] = IModelTestUtils.createAndInsertDrawingPartitionAndModel(far, modelCode);
224
- const drawingCategoryId = DrawingCategory.insert(far, IModel.dictionaryId, "DrawingCategory", new SubCategoryAppearance());
225
- far.saveChanges();
226
- await far.pushChanges({ description: "create model and category" });
227
- // Open local briefcase
228
- const local = await HubWrappers.downloadAndOpenBriefcase({
229
- iTwinId: HubMock.iTwinId,
230
- iModelId,
231
- accessToken: "local-user",
232
- });
233
- local.channels.addAllowedChannel(ChannelControl.sharedChannelName);
234
- local.saveChanges();
235
- return new TestIModel(iModelId, drawingModelId, drawingCategoryId, far, local);
228
+ let far;
229
+ let local;
230
+ try {
231
+ const iModelId = await HubMock.createNewIModel({
232
+ accessToken: "far-user",
233
+ iTwinId: HubMock.iTwinId,
234
+ iModelName: testName,
235
+ description: `Rebase schema update with data transform tests: ${testName}`,
236
+ });
237
+ // Open far briefcase and use it for initialization
238
+ far = await HubWrappers.downloadAndOpenBriefcase({
239
+ iTwinId: HubMock.iTwinId,
240
+ iModelId,
241
+ accessToken: "far-user",
242
+ });
243
+ far.channels.addAllowedChannel(ChannelControl.sharedChannelName);
244
+ // Initialize with base schema
245
+ await far.importSchemaStrings([TestIModel.schemas.v01x00x00]);
246
+ await far.pushChanges({ description: "import base schema" });
247
+ // Create model and category
248
+ const modelCode = IModelTestUtils.getUniqueModelCode(far, "DrawingModel");
249
+ await far.locks.acquireLocks({ shared: IModel.dictionaryId });
250
+ const [drawingModelId, drawingCategoryId] = withEditTxn(far, "create model and category", (txn) => {
251
+ const [, newDrawingModelId] = IModelTestUtils.createAndInsertDrawingPartitionAndModel(txn, modelCode);
252
+ const newDrawingCategoryId = DrawingCategory.insert(txn, IModel.dictionaryId, "DrawingCategory", new SubCategoryAppearance());
253
+ return [newDrawingModelId, newDrawingCategoryId];
254
+ });
255
+ await far.pushChanges({ description: "create model and category" });
256
+ // Open local briefcase
257
+ local = await HubWrappers.downloadAndOpenBriefcase({
258
+ iTwinId: HubMock.iTwinId,
259
+ iModelId,
260
+ accessToken: "local-user",
261
+ });
262
+ local.channels.addAllowedChannel(ChannelControl.sharedChannelName);
263
+ return new TestIModel(iModelId, drawingModelId, drawingCategoryId, far, local);
264
+ }
265
+ catch (error) {
266
+ if (local?.isOpen)
267
+ local.close();
268
+ if (far?.isOpen)
269
+ far.close();
270
+ HubMock.shutdown();
271
+ throw error;
272
+ }
236
273
  }
237
- insertElement(briefcase, className, properties) {
274
+ insertElement(txn, className, properties) {
275
+ const briefcase = txn.iModel;
238
276
  const elementProps = {
239
277
  classFullName: className,
240
278
  model: this.drawingModelId,
@@ -243,12 +281,13 @@ class TestIModel {
243
281
  ...properties,
244
282
  };
245
283
  const element = briefcase.elements.createElement(elementProps);
246
- return briefcase.elements.insertElement(element.toJSON());
284
+ return txn.insertElement(element.toJSON());
247
285
  }
248
- updateElement(briefcase, elementId, updates) {
286
+ updateElement(txn, elementId, updates) {
287
+ const briefcase = txn.iModel;
249
288
  const element = briefcase.elements.getElement(elementId);
250
289
  Object.assign(element, updates);
251
- briefcase.elements.updateElement(element.toJSON());
290
+ txn.updateElement(element.toJSON());
252
291
  }
253
292
  getElement(briefcase, elementId) {
254
293
  return briefcase.elements.getElement(elementId);
@@ -290,17 +329,21 @@ describe("Semantic Rebase", function () {
290
329
  });
291
330
  it("local data changes onto incoming trivial schema change", async () => {
292
331
  t = await TestIModel.initialize("TrivialSchemaIncoming");
332
+ let localTxn = startTestTxn(t.local, "local data changes onto incoming trivial schema change local");
333
+ let farTxn = startTestTxn(t.far, "local data changes onto incoming trivial schema change far");
293
334
  // Local creates an element
294
335
  await t.local.locks.acquireLocks({ shared: t.drawingModelId });
295
- const elementId = t.insertElement(t.local, "TestDomain:C", {
336
+ const elementId = t.insertElement(localTxn, "TestDomain:C", {
296
337
  propA: "value_a",
297
338
  propC: "value_c",
298
339
  });
299
- t.local.saveChanges("create element");
300
- await t.local.pushChanges({ description: "create test element" });
340
+ localTxn.saveChanges("create element");
341
+ await pushChanges(localTxn, "create test element");
342
+ localTxn = startTestTxn(t.local, "local data changes onto incoming trivial schema change local");
301
343
  // Far imports updated schema with new property PropC2
302
- await t.far.pullChanges();
303
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
344
+ await pullChanges(farTxn);
345
+ farTxn = startTestTxn(t.far, "local data changes onto incoming trivial schema change far");
346
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
304
347
  // Verify that we're holding a shared lock (not exclusive) for semantic rebase
305
348
  chai.expect(t.far.locks.holdsSharedLock(IModel.repositoryModelId)).to.be.true;
306
349
  chai.expect(t.far.holdsSchemaLock).to.be.false;
@@ -308,15 +351,14 @@ describe("Semantic Rebase", function () {
308
351
  chai.expect(txnProps).to.not.be.undefined;
309
352
  chai.expect(txnProps.type).to.equal("Schema");
310
353
  chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.true;
311
- t.far.saveChanges("add PropC2 to schema");
312
- await t.far.pushChanges({ description: "add PropC2 to class C" });
354
+ await pushChanges(farTxn, "add PropC2 to class C");
313
355
  chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.false; // after push the folder should not be there
314
356
  // Local makes local changes to the element
315
357
  await t.local.locks.acquireLocks({ exclusive: elementId });
316
- t.updateElement(t.local, elementId, { propA: "local_update_a" });
317
- t.local.saveChanges("local update to propA");
358
+ t.updateElement(localTxn, elementId, { propA: "local_update_a" });
359
+ localTxn.saveChanges("local update to propA");
318
360
  // Local pulls and rebases local changes onto incoming schema change
319
- await t.local.pullChanges();
361
+ await pullChanges(localTxn);
320
362
  // Verify: local changes preserved, schema updated
321
363
  const element = t.getElement(t.local, elementId);
322
364
  chai.expect(element.propA).to.equal("local_update_a", "Local property update should be preserved");
@@ -326,16 +368,19 @@ describe("Semantic Rebase", function () {
326
368
  });
327
369
  it("local trivial schema change onto incoming data changes", async () => {
328
370
  t = await TestIModel.initialize("TrivialSchemaLocal");
371
+ let localTxn = startTestTxn(t.local, "local trivial schema change onto incoming data changes local");
372
+ let farTxn = startTestTxn(t.far, "local trivial schema change onto incoming data changes far");
329
373
  // Local creates an element
330
374
  await t.local.locks.acquireLocks({ shared: t.drawingModelId });
331
- const elementId = t.insertElement(t.local, "TestDomain:C", {
375
+ const elementId = t.insertElement(localTxn, "TestDomain:C", {
332
376
  propA: "value_a",
333
377
  propC: "value_c",
334
378
  });
335
- t.local.saveChanges("create element");
336
- await t.local.pushChanges({ description: "create test element" });
379
+ localTxn.saveChanges("create element");
380
+ await pushChanges(localTxn, "create test element");
381
+ localTxn = startTestTxn(t.local, "local trivial schema change onto incoming data changes local");
337
382
  // Local imports updated schema locally
338
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
383
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
339
384
  // Verify that we're holding a shared lock (not exclusive) for semantic rebase
340
385
  chai.expect(t.local.locks.holdsSharedLock(IModel.repositoryModelId)).to.be.true;
341
386
  chai.expect(t.local.holdsSchemaLock).to.be.false;
@@ -343,15 +388,15 @@ describe("Semantic Rebase", function () {
343
388
  chai.expect(txnProps).to.not.be.undefined;
344
389
  chai.expect(txnProps.type).to.equal("Schema");
345
390
  chai.expect(t.checkIfFolderExists(t.local, txnProps.id, true)).to.be.true;
346
- t.local.saveChanges("local schema update");
347
391
  // Far pulls element, then updates it
348
- await t.far.pullChanges();
392
+ await pullChanges(farTxn);
393
+ farTxn = startTestTxn(t.far, "local trivial schema change onto incoming data changes far");
349
394
  await t.far.locks.acquireLocks({ exclusive: elementId });
350
- t.updateElement(t.far, elementId, { propA: "far_update_a" });
351
- t.far.saveChanges("far update to propA");
352
- await t.far.pushChanges({ description: "update element propA" });
395
+ t.updateElement(farTxn, elementId, { propA: "far_update_a" });
396
+ farTxn.saveChanges("far update to propA");
397
+ await pushChanges(farTxn, "update element propA");
353
398
  // Local pulls and rebases local schema change onto incoming data changes
354
- await t.local.pullChanges();
399
+ await pullChanges(localTxn);
355
400
  chai.expect(t.checkIfFolderExists(t.local, txnProps.id, true)).to.be.true; // after rebase the folder should be there until push is called
356
401
  // Verify: incoming data changes applied, local schema preserved
357
402
  const element = t.getElement(t.local, elementId);
@@ -362,35 +407,39 @@ describe("Semantic Rebase", function () {
362
407
  });
363
408
  it("local data changes onto incoming data changes", async () => {
364
409
  t = await TestIModel.initialize("DataOntoData");
410
+ let localTxn = startTestTxn(t.local, "local data changes onto incoming data changes local");
411
+ let farTxn = startTestTxn(t.far, "local data changes onto incoming data changes far");
365
412
  // Local creates two elements
366
413
  await t.local.locks.acquireLocks({ shared: t.drawingModelId });
367
- const elementId1 = t.insertElement(t.local, "TestDomain:C", {
414
+ const elementId1 = t.insertElement(localTxn, "TestDomain:C", {
368
415
  propA: "value_a1",
369
416
  propC: "value_c1",
370
417
  });
371
- const elementId2 = t.insertElement(t.local, "TestDomain:C", {
418
+ const elementId2 = t.insertElement(localTxn, "TestDomain:C", {
372
419
  propA: "value_a2",
373
420
  propC: "value_c2",
374
421
  });
375
- t.local.saveChanges("create elements");
422
+ localTxn.saveChanges("create elements");
376
423
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // its data changes on both sides semantic rebase is not used
377
- await t.local.pushChanges({ description: "create test elements" });
424
+ await pushChanges(localTxn, "create test elements");
425
+ localTxn = startTestTxn(t.local, "local data changes onto incoming data changes local");
378
426
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // its data changes on both sides semantic rebase is not used
379
427
  // Far updates first element
380
- await t.far.pullChanges();
428
+ await pullChanges(farTxn);
429
+ farTxn = startTestTxn(t.far, "local data changes onto incoming data changes far");
381
430
  await t.far.locks.acquireLocks({ exclusive: elementId1 });
382
- t.updateElement(t.far, elementId1, { propC: "far_update_c" });
383
- t.far.saveChanges("far update to propC");
431
+ t.updateElement(farTxn, elementId1, { propC: "far_update_c" });
432
+ farTxn.saveChanges("far update to propC");
384
433
  chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // its data changes on both sides semantic rebase is not used
385
- await t.far.pushChanges({ description: "update element propC" });
434
+ await pushChanges(farTxn, "update element propC");
386
435
  chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // its data changes on both sides semantic rebase is not used
387
436
  // Local makes local changes to second element
388
437
  await t.local.locks.acquireLocks({ exclusive: elementId2 });
389
- t.updateElement(t.local, elementId2, { propA: "local_update_a" });
390
- t.local.saveChanges("local update to propA");
438
+ t.updateElement(localTxn, elementId2, { propA: "local_update_a" });
439
+ localTxn.saveChanges("local update to propA");
391
440
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // its data changes on both sides semantic rebase is not used
392
441
  // Local pulls and rebases
393
- await t.local.pullChanges();
442
+ await pullChanges(localTxn);
394
443
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // its data changes on both sides semantic rebase is not used
395
444
  // Verify: both changes applied to their respective elements
396
445
  const element1 = t.getElement(t.local, elementId1);
@@ -402,24 +451,24 @@ describe("Semantic Rebase", function () {
402
451
  });
403
452
  it("local trivial schema changes onto incoming trivial schema changes (local newer)", async () => {
404
453
  t = await TestIModel.initialize("TrivialSchemaLocalNewer");
454
+ const localTxn = startTestTxn(t.local, "local trivial schema changes onto incoming trivial schema changes local newer local");
455
+ const farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming trivial schema changes local newer far");
405
456
  // Far imports v01.00.01 (adds PropC2)
406
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
457
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
407
458
  const txnProps = t.far.txns.getLastSavedTxnProps();
408
459
  chai.expect(txnProps).to.not.be.undefined;
409
460
  chai.expect(txnProps.type).to.equal("Schema");
410
461
  chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.true;
411
- t.far.saveChanges("add PropC2 to schema");
412
- await t.far.pushChanges({ description: "add PropC2 to class C" });
462
+ await pushChanges(farTxn, "add PropC2 to class C");
413
463
  chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.false; // after push the folder should not be there
414
464
  // Local imports v01.00.02 (adds PropC2 and PropD2 - newer)
415
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x02AddPropD2]);
465
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02AddPropD2]);
416
466
  const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
417
467
  chai.expect(txnPropsLocal).to.not.be.undefined;
418
468
  chai.expect(txnPropsLocal.type).to.equal("Schema");
419
469
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true;
420
- t.local.saveChanges("local schema update to v01.00.02");
421
470
  // Local pulls and rebases
422
- await t.local.pullChanges();
471
+ await pullChanges(localTxn);
423
472
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true; // after rebase the folder should be there because local is newer until push is called
424
473
  // Verify: local schema preserved (newer version)
425
474
  const schema = t.local.getSchemaProps("TestDomain");
@@ -427,24 +476,24 @@ describe("Semantic Rebase", function () {
427
476
  });
428
477
  it("local trivial schema changes onto incoming trivial schema changes (incoming newer)", async () => {
429
478
  t = await TestIModel.initialize("TrivialSchemaIncomingNewer");
479
+ const localTxn = startTestTxn(t.local, "local trivial schema changes onto incoming trivial schema changes incoming newer local");
480
+ const farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming trivial schema changes incoming newer far");
430
481
  // Far imports v01.00.02 (adds PropC2 and PropD2 - newer)
431
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x02AddPropD2]);
482
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02AddPropD2]);
432
483
  const txnProps = t.far.txns.getLastSavedTxnProps();
433
484
  chai.expect(txnProps).to.not.be.undefined;
434
485
  chai.expect(txnProps.type).to.equal("Schema");
435
486
  chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.true;
436
- t.far.saveChanges("add PropC2 and PropD2 to schema");
437
- await t.far.pushChanges({ description: "update schema to v01.00.02" });
487
+ await pushChanges(farTxn, "update schema to v01.00.02");
438
488
  chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.false; // after push the folder should not be there
439
489
  // Local imports v01.00.01 (adds only PropC2 - older)
440
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
490
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
441
491
  const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
442
492
  chai.expect(txnPropsLocal).to.not.be.undefined;
443
493
  chai.expect(txnPropsLocal.type).to.equal("Schema");
444
494
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true;
445
- t.local.saveChanges("local schema update to v01.00.01");
446
495
  // Local pulls and rebases
447
- await t.local.pullChanges();
496
+ await pullChanges(localTxn);
448
497
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.false; // after rebase the folder should not be there because incoming is newer so while rebasing it should be a no op
449
498
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because the rebase folder is deleted after rebase if it contains nothing
450
499
  // Verify: incoming schema preserved (newer version, local should not override)
@@ -453,8 +502,10 @@ describe("Semantic Rebase", function () {
453
502
  });
454
503
  it("local trivial schema changes onto incoming identical schema changes", async () => {
455
504
  t = await TestIModel.initialize("TrivialSchemaIdentical");
505
+ const localTxn = startTestTxn(t.local, "local trivial schema changes onto incoming identical schema changes local");
506
+ const farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming identical schema changes far");
456
507
  // Far imports v01.00.01 (adds PropC2)
457
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
508
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
458
509
  // Verify that we're holding a shared lock (not exclusive) for semantic rebase
459
510
  chai.expect(t.far.locks.holdsSharedLock(IModel.repositoryModelId)).to.be.true;
460
511
  chai.expect(t.far.holdsSchemaLock).to.be.false;
@@ -462,18 +513,16 @@ describe("Semantic Rebase", function () {
462
513
  chai.expect(txnProps).to.not.be.undefined;
463
514
  chai.expect(txnProps.type).to.equal("Schema");
464
515
  chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.true;
465
- t.far.saveChanges("add PropC2 to schema");
466
- await t.far.pushChanges({ description: "add PropC2 to class C" });
516
+ await pushChanges(farTxn, "add PropC2 to class C");
467
517
  chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.false; // after push the folder should not be there
468
518
  // Local imports the same v01.00.01 (adds PropC2)
469
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
519
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
470
520
  const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
471
521
  chai.expect(txnPropsLocal).to.not.be.undefined;
472
522
  chai.expect(txnPropsLocal.type).to.equal("Schema");
473
523
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true;
474
- t.local.saveChanges("local schema update to v01.00.01");
475
524
  // Local pulls and rebases
476
- await t.local.pullChanges();
525
+ await pullChanges(localTxn);
477
526
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.false; // after rebase the folder should not be there as both are identical
478
527
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because the rebase folder is deleted if it contains nothing after rebase
479
528
  // Verify: schema preserved (both sides identical)
@@ -482,39 +531,40 @@ describe("Semantic Rebase", function () {
482
531
  });
483
532
  it("local trivial schema changes onto incoming identical schema changes with data changes on both sides", async () => {
484
533
  t = await TestIModel.initialize("TrivialSchemaIdenticalWithData");
534
+ const localTxn = startTestTxn(t.local, "local trivial schema changes onto incoming identical schema changes with data local");
535
+ let farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming identical schema changes with data far");
485
536
  // Far imports v01.00.01 (adds PropC2) and creates an element
486
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
537
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
487
538
  const txnProps = t.far.txns.getLastSavedTxnProps();
488
539
  chai.expect(txnProps).to.not.be.undefined;
489
540
  chai.expect(txnProps.type).to.equal("Schema");
490
541
  chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.true;
491
- t.far.saveChanges("add PropC2 to schema");
492
- await t.far.pushChanges({ description: "add PropC2 to class C" });
542
+ await pushChanges(farTxn, "add PropC2 to class C");
543
+ farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming identical schema changes with data far");
493
544
  chai.expect(t.checkIfFolderExists(t.far, txnProps.id, true)).to.be.false; // after push the folder should not be there
494
545
  await t.far.locks.acquireLocks({ shared: t.drawingModelId });
495
- const farElementId = t.insertElement(t.far, "TestDomain:C", {
546
+ const farElementId = t.insertElement(farTxn, "TestDomain:C", {
496
547
  propA: "far_value_a",
497
548
  propC: "far_value_c",
498
549
  propC2: "far_value_c2",
499
550
  });
500
- t.far.saveChanges("far creates element with new property");
501
- await t.far.pushChanges({ description: "far creates element" });
551
+ farTxn.saveChanges("far creates element with new property");
552
+ await pushChanges(farTxn, "far creates element");
502
553
  // Local imports the same v01.00.01 (adds PropC2) and creates an element
503
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
554
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
504
555
  const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
505
556
  chai.expect(txnPropsLocal).to.not.be.undefined;
506
557
  chai.expect(txnPropsLocal.type).to.equal("Schema");
507
558
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true;
508
- t.local.saveChanges("local schema update to v01.00.01");
509
559
  await t.local.locks.acquireLocks({ shared: t.drawingModelId });
510
- const localElementId = t.insertElement(t.local, "TestDomain:C", {
560
+ const localElementId = t.insertElement(localTxn, "TestDomain:C", {
511
561
  propA: "local_value_a",
512
562
  propC: "local_value_c",
513
563
  propC2: "local_value_c2",
514
564
  });
515
- t.local.saveChanges("local creates element with new property");
565
+ localTxn.saveChanges("local creates element with new property");
516
566
  // Local pulls and rebases
517
- await t.local.pullChanges();
567
+ await pullChanges(localTxn);
518
568
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.false; // after rebase the folder should not be there as both are identical
519
569
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because the rebase folder is deleted after rebase if it contains nothing
520
570
  // Verify: schema preserved (both sides identical)
@@ -532,27 +582,27 @@ describe("Semantic Rebase", function () {
532
582
  });
533
583
  it("both add different properties, increment to same version number", async () => {
534
584
  t = await TestIModel.initialize("TrivialSchemaIncompatible");
535
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
536
- t.far.saveChanges("add PropC2 to schema");
537
- await t.far.pushChanges({ description: "add PropC2 to class C" });
538
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC3Incompatible]);
539
- t.local.saveChanges("local schema update to v01.00.01 with PropC3");
540
- await t.local.pullChanges(); // TODO: this currently passes, because same version number means no upgrade is attempted
585
+ const localTxn = startTestTxn(t.local, "both add different properties increment to same version local");
586
+ const farTxn = startTestTxn(t.far, "both add different properties increment to same version far");
587
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
588
+ await pushChanges(farTxn, "add PropC2 to class C");
589
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC3Incompatible]);
590
+ await pullChanges(localTxn); // TODO: this currently passes, because same version number means no upgrade is attempted
541
591
  //TODO: this should probably fail instead as both sides made incompatible changes to the same version, but this is unrelated to semantic rebase itself
542
592
  const schema = t.local.getSchemaProps("TestDomain");
543
593
  chai.expect(schema.version).to.equal("01.00.01", "Schema should be v01.00.01");
544
594
  });
545
595
  it("both add compatible properties, local version number higher", async () => {
546
596
  t = await TestIModel.initialize("CompatibleSchemaLocalHigher");
597
+ const localTxn = startTestTxn(t.local, "both add compatible properties local version higher local");
598
+ const farTxn = startTestTxn(t.far, "both add compatible properties local version higher far");
547
599
  // Far imports v01.00.01 (adds PropC2)
548
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
549
- t.far.saveChanges("add PropC2 to schema");
550
- await t.far.pushChanges({ description: "add PropC2 to class C" });
600
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
601
+ await pushChanges(farTxn, "add PropC2 to class C");
551
602
  // Local imports v01.00.02 (adds PropC2 and PropD2 - compatible higher version)
552
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x02AddPropD2]);
553
- t.local.saveChanges("local schema update to v01.00.02 with PropD2");
603
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02AddPropD2]);
554
604
  // Local pulls and rebases
555
- await t.local.pullChanges();
605
+ await pullChanges(localTxn);
556
606
  // Verify: Local schema wins (higher version)
557
607
  const schema = t.local.getSchemaProps("TestDomain");
558
608
  chai.expect(schema.version).to.equal("01.00.02", "Schema should be v01.00.02 (higher version wins)");
@@ -565,15 +615,15 @@ describe("Semantic Rebase", function () {
565
615
  });
566
616
  it("both add compatible properties, incoming version number higher", async () => {
567
617
  t = await TestIModel.initialize("CompatibleSchemaIncomingHigher");
618
+ const localTxn = startTestTxn(t.local, "both add compatible properties incoming version higher local");
619
+ const farTxn = startTestTxn(t.far, "both add compatible properties incoming version higher far");
568
620
  // Far imports v01.00.02 (adds PropC2 and PropD2 - higher version)
569
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x02AddPropD2]);
570
- t.far.saveChanges("add PropC2 and PropD2 to schema");
571
- await t.far.pushChanges({ description: "update schema to v01.00.02" });
621
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02AddPropD2]);
622
+ await pushChanges(farTxn, "update schema to v01.00.02");
572
623
  // Local imports v01.00.01 (adds only PropC2 - compatible lower version)
573
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
574
- t.local.saveChanges("local schema update to v01.00.01 with PropC2");
624
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
575
625
  // Local pulls and rebases
576
- await t.local.pullChanges();
626
+ await pullChanges(localTxn);
577
627
  // Verify: Incoming schema wins (higher version)
578
628
  const schema = t.local.getSchemaProps("TestDomain");
579
629
  chai.expect(schema.version).to.equal("01.00.02", "Schema should be v01.00.02 (higher version wins)");
@@ -586,58 +636,58 @@ describe("Semantic Rebase", function () {
586
636
  });
587
637
  it("both add same but incompatible property, local version number higher", async () => {
588
638
  t = await TestIModel.initialize("TrivialSchemaIncompatible");
589
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
590
- t.far.saveChanges("add PropC2 to schema");
591
- await t.far.pushChanges({ description: "add PropC2 to class C" });
592
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x02AddPropC2Incompatible]);
593
- t.local.saveChanges("local schema update to v01.00.02 with PropC2");
639
+ const localTxn = startTestTxn(t.local, "both add same but incompatible property local version higher local");
640
+ const farTxn = startTestTxn(t.far, "both add same but incompatible property local version higher far");
641
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
642
+ await pushChanges(farTxn, "add PropC2 to class C");
643
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02AddPropC2Incompatible]);
594
644
  // Local pulls and rebases - this should detect the incompatibility and fail
595
- await chai.expect(t.local.pullChanges()).to.be.rejectedWith("ECSchema Upgrade failed");
645
+ await chai.expect(pullChanges(localTxn)).to.be.rejectedWith("ECSchema Upgrade failed");
596
646
  });
597
647
  it("both add same but incompatible property, incoming version number higher", async () => {
598
648
  t = await TestIModel.initialize("TrivialSchemaIncompatible");
599
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x02AddPropC2Incompatible]);
600
- t.far.saveChanges("add PropC2 to schema");
601
- await t.far.pushChanges({ description: "import v01.00.02 with PropC2 as int" });
649
+ const localTxn = startTestTxn(t.local, "both add same but incompatible property incoming version higher local");
650
+ const farTxn = startTestTxn(t.far, "both add same but incompatible property incoming version higher far");
651
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02AddPropC2Incompatible]);
652
+ await pushChanges(farTxn, "import v01.00.02 with PropC2 as int");
602
653
  // Local uses v01.00.03 with PropC2:string — higher version ensures the upgrade is attempted
603
654
  // during reinstatement, which detects the type mismatch (string vs int)
604
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x03AddPropC2]);
605
- t.local.saveChanges("local schema update to v01.00.03 with PropC2 as string");
655
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x03AddPropC2]);
606
656
  // Local pulls and rebases - this should detect the incompatibility and fail
607
- await chai.expect(t.local.pullChanges()).to.be.rejectedWith("ECSchema Upgrade failed");
657
+ await chai.expect(pullChanges(localTxn)).to.be.rejectedWith("ECSchema Upgrade failed");
608
658
  });
609
659
  it("local transforming schema change onto incoming trivial schema change", async () => {
610
660
  t = await TestIModel.initialize("LocalTransformIncomingTrivial");
661
+ const farTxn = startTestTxn(t.far, "local transforming schema change onto incoming trivial schema change far");
662
+ const localTxn = startTestTxn(t.local, "local transforming schema change onto incoming trivial schema change local");
611
663
  // Far: Insert Element and import trivial schema change
612
664
  await t.far.locks.acquireLocks({ shared: t.drawingModelId });
613
- const farElementId = t.insertElement(t.far, "TestDomain:C", {
665
+ const farElementId = t.insertElement(farTxn, "TestDomain:C", {
614
666
  propA: "far_value_a",
615
667
  propC: "far_value_c",
616
668
  });
617
- t.far.saveChanges("far create element");
618
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
669
+ farTxn.saveChanges("far create element");
670
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
619
671
  const txnPropsFar = t.far.txns.getLastSavedTxnProps();
620
672
  chai.expect(txnPropsFar).to.not.be.undefined;
621
673
  chai.expect(txnPropsFar.type).to.equal("Schema");
622
674
  chai.expect(t.checkIfFolderExists(t.far, txnPropsFar.id, true)).to.be.true; // schema folder should exist
623
- t.far.saveChanges("far trivial schema update");
624
- await t.far.pushChanges({ description: "far add PropC2" });
675
+ await pushChanges(farTxn, "far add PropC2");
625
676
  chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
626
677
  // Local: Insert Element and import transforming schema change
627
678
  await t.local.locks.acquireLocks({ shared: t.drawingModelId });
628
- const localElementId = t.insertElement(t.local, "TestDomain:C", {
679
+ const localElementId = t.insertElement(localTxn, "TestDomain:C", {
629
680
  propA: "local_value_a",
630
681
  propC: "local_value_c",
631
682
  });
632
- t.local.saveChanges("local create element");
633
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x02MovePropCToA]);
683
+ localTxn.saveChanges("local create element");
684
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
634
685
  const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
635
686
  chai.expect(txnPropsLocal).to.not.be.undefined;
636
687
  chai.expect(txnPropsLocal.type).to.equal("Schema");
637
688
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true; // schema folder should exist
638
- t.local.saveChanges("local transforming schema update");
639
689
  // Local pulls and rebases transforming change onto incoming trivial change
640
- await t.local.pushChanges({ description: "local move PropC to A" });
690
+ await pushChanges(localTxn, "local move PropC to A");
641
691
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // after push the folder should not be there
642
692
  // Verify: both elements have PropC intact, schema transformed locally
643
693
  t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
@@ -650,31 +700,31 @@ describe("Semantic Rebase", function () {
650
700
  });
651
701
  it("local trivial schema change onto incoming transforming schema change", async () => {
652
702
  t = await TestIModel.initialize("LocalTrivialIncomingTransform");
703
+ const farTxn = startTestTxn(t.far, "local trivial schema change onto incoming transforming schema change far");
704
+ const localTxn = startTestTxn(t.local, "local trivial schema change onto incoming transforming schema change local");
653
705
  // Far: Insert Element and import transforming schema change
654
706
  await t.far.locks.acquireLocks({ shared: t.drawingModelId });
655
- const farElementId = t.insertElement(t.far, "TestDomain:C", {
707
+ const farElementId = t.insertElement(farTxn, "TestDomain:C", {
656
708
  propA: "far_value_a",
657
709
  propC: "far_value_c",
658
710
  });
659
- t.far.saveChanges("far create element");
660
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x02MovePropCToA]);
661
- t.far.saveChanges("far transforming schema update");
662
- await t.far.pushChanges({ description: "far move PropC to A" });
711
+ farTxn.saveChanges("far create element");
712
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
713
+ await pushChanges(farTxn, "far move PropC to A");
663
714
  // Local: Insert Element and import trivial schema change
664
715
  await t.local.locks.acquireLocks({ shared: t.drawingModelId });
665
- const localElementId = t.insertElement(t.local, "TestDomain:C", {
716
+ const localElementId = t.insertElement(localTxn, "TestDomain:C", {
666
717
  propA: "local_value_a",
667
718
  propC: "local_value_c",
668
719
  });
669
- t.local.saveChanges("local create element");
670
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
720
+ localTxn.saveChanges("local create element");
721
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
671
722
  const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
672
723
  chai.expect(txnPropsLocal).to.not.be.undefined;
673
724
  chai.expect(txnPropsLocal.type).to.equal("Schema");
674
725
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true; // schema folder should exist
675
- t.local.saveChanges("local trivial schema update");
676
726
  // Local pulls and rebases trivial change onto incoming transforming change
677
- await t.local.pushChanges({ description: "local add PropC2" });
727
+ await pushChanges(localTxn, "local add PropC2");
678
728
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // after push the folder should not be there
679
729
  t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
680
730
  // Verify: both elements have PropC intact after incoming transform
@@ -687,44 +737,46 @@ describe("Semantic Rebase", function () {
687
737
  });
688
738
  it("local transforming schema change onto incoming transforming schema change", async () => {
689
739
  t = await TestIModel.initialize("BothTransforming");
740
+ const farTxn = startTestTxn(t.far, "local transforming schema change onto incoming transforming schema change far");
741
+ const localTxn = startTestTxn(t.local, "local transforming schema change onto incoming transforming schema change local");
690
742
  // Far: Create elements with PropC and PropD, import transforming schema (moves PropC to A)
691
743
  await t.far.locks.acquireLocks({ shared: t.drawingModelId });
692
- const farElementC = t.insertElement(t.far, "TestDomain:C", {
744
+ const farElementC = t.insertElement(farTxn, "TestDomain:C", {
693
745
  propA: "far_value_a_c",
694
746
  propC: "far_value_c",
695
747
  });
696
- const farElementD = t.insertElement(t.far, "TestDomain:D", {
748
+ const farElementD = t.insertElement(farTxn, "TestDomain:D", {
697
749
  propA: "far_value_a_d",
698
750
  propD: "far_value_d",
699
751
  });
700
- t.far.saveChanges("far create elements");
701
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x02MovePropCToA]);
752
+ farTxn.saveChanges("far create elements");
753
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
702
754
  const txnPropsFar = t.far.txns.getLastSavedTxnProps();
703
755
  chai.expect(txnPropsFar).to.not.be.undefined;
704
756
  chai.expect(txnPropsFar.type).to.equal("Schema");
705
757
  chai.expect(t.checkIfFolderExists(t.far, txnPropsFar.id, true)).to.be.true; // schema folder should exist
706
- t.far.saveChanges("far move PropC to A");
707
- await t.far.pushChanges({ description: "far transform PropC" });
758
+ farTxn.saveChanges("far move PropC to A");
759
+ await pushChanges(farTxn, "far transform PropC");
708
760
  chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
709
761
  // Local: Create elements with PropC and PropD, import transforming schema (moves both PropC and PropD to A)
710
762
  await t.local.locks.acquireLocks({ shared: t.drawingModelId });
711
- const localElementC = t.insertElement(t.local, "TestDomain:C", {
763
+ const localElementC = t.insertElement(localTxn, "TestDomain:C", {
712
764
  propA: "local_value_a_c",
713
765
  propC: "local_value_c",
714
766
  });
715
- const localElementD = t.insertElement(t.local, "TestDomain:D", {
767
+ const localElementD = t.insertElement(localTxn, "TestDomain:D", {
716
768
  propA: "local_value_a_d",
717
769
  propD: "local_value_d",
718
770
  });
719
- t.local.saveChanges("local create elements");
720
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x03MovePropCAndD]);
771
+ localTxn.saveChanges("local create elements");
772
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x03MovePropCAndD]);
721
773
  const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
722
774
  chai.expect(txnPropsLocal).to.not.be.undefined;
723
775
  chai.expect(txnPropsLocal.type).to.equal("Schema");
724
776
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true; // schema folder should exist
725
- t.local.saveChanges("local move PropC and PropD to A");
777
+ localTxn.saveChanges("local move PropC and PropD to A");
726
778
  // Local pulls and rebases both transforming changes
727
- await t.local.pushChanges({ description: "local transform PropC and PropD" });
779
+ await pushChanges(localTxn, "local transform PropC and PropD");
728
780
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // after push the folder should not be there
729
781
  t.far.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
730
782
  t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
@@ -744,35 +796,38 @@ describe("Semantic Rebase", function () {
744
796
  });
745
797
  it("local data update onto incoming transforming schema change", async () => {
746
798
  t = await TestIModel.initialize("LocalDataIncomingTransform");
799
+ let farTxn = startTestTxn(t.far, "local data update onto incoming transforming schema change far");
800
+ let localTxn = startTestTxn(t.local, "local data update onto incoming transforming schema change local");
747
801
  // Insert one instance and populate to both far and local
748
802
  await t.far.locks.acquireLocks({ shared: t.drawingModelId });
749
- const elementId = t.insertElement(t.far, "TestDomain:C", {
803
+ const elementId = t.insertElement(farTxn, "TestDomain:C", {
750
804
  propA: "initial_value_a",
751
805
  propC: "initial_value_c",
752
806
  });
753
- t.far.saveChanges("far create element");
754
- await t.far.pushChanges({ description: "create shared element" });
807
+ farTxn.saveChanges("far create element");
808
+ await pushChanges(farTxn, "create shared element");
809
+ farTxn = startTestTxn(t.far, "local data update onto incoming transforming schema change far");
755
810
  // Local pulls to get the element
756
- await t.local.pullChanges();
811
+ await pullChanges(localTxn);
812
+ localTxn = startTestTxn(t.local, "local data update onto incoming transforming schema change local");
757
813
  // Far imports transforming schema (moves PropC from C to A)
758
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x02MovePropCToA]);
814
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
759
815
  const txnPropsFar = t.far.txns.getLastSavedTxnProps();
760
816
  chai.expect(txnPropsFar).to.not.be.undefined;
761
817
  chai.expect(txnPropsFar.type).to.equal("Schema");
762
818
  chai.expect(t.checkIfFolderExists(t.far, txnPropsFar.id, true)).to.be.true; // schema folder should exist
763
- t.far.saveChanges("far transforming schema update");
764
- await t.far.pushChanges({ description: "far move PropC to A" });
819
+ await pushChanges(farTxn, "far move PropC to A");
765
820
  chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
766
821
  // Local updates PropC on the element
767
822
  await t.local.locks.acquireLocks({ exclusive: elementId });
768
- t.updateElement(t.local, elementId, { propC: "local_modified_c" });
769
- t.local.saveChanges("local update propC");
823
+ t.updateElement(localTxn, elementId, { propC: "local_modified_c" });
824
+ localTxn.saveChanges("local update propC");
770
825
  let element = t.getElement(t.local, elementId);
771
826
  chai.expect(element.propA).to.equal("initial_value_a", "PropA should be unchanged");
772
827
  chai.expect(element.propC).to.equal("local_modified_c", "PropC should have the local modified value before incoming transform");
773
828
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // no schema change yet on local so no rebase folder
774
829
  // Local pulls and rebases data change onto incoming transforming schema change
775
- await t.local.pullChanges();
830
+ await pullChanges(localTxn);
776
831
  // after rebase the folder should not be there because data change folder is created on the fly and removed once rebased and rebase folder is also removed if it contains nothing
777
832
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false;
778
833
  t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
@@ -785,31 +840,32 @@ describe("Semantic Rebase", function () {
785
840
  });
786
841
  it("Incoming data update onto local transforming schema change", async () => {
787
842
  t = await TestIModel.initialize("IncomingDataLocalTransform");
843
+ const farTxn = startTestTxn(t.far, "Incoming data update onto local transforming schema change far");
844
+ const localTxn = startTestTxn(t.local, "Incoming data update onto local transforming schema change local");
788
845
  // Insert one instance and populate to both far and local
789
846
  await t.far.locks.acquireLocks({ shared: t.drawingModelId });
790
- const elementIdFar = t.insertElement(t.far, "TestDomain:C", {
847
+ const elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
791
848
  propA: "far_value_a",
792
849
  propC: "far_value_c",
793
850
  });
794
- t.far.saveChanges("far create element");
851
+ farTxn.saveChanges("far create element");
795
852
  chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // no schema change yet on far so no rebase folder
796
- await t.far.pushChanges({ description: "create shared element" });
853
+ await pushChanges(farTxn, "create shared element");
797
854
  chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
798
855
  await t.local.locks.acquireLocks({ shared: t.drawingModelId });
799
- const elementIdLocal = t.insertElement(t.local, "TestDomain:C", {
856
+ const elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
800
857
  propA: "local_value_a",
801
858
  propC: "local_value_c",
802
859
  });
803
- t.local.saveChanges("local create element");
860
+ localTxn.saveChanges("local create element");
804
861
  // Far imports transforming schema (moves PropC from C to A)
805
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x02MovePropCToA]);
862
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
806
863
  const txnPropsLocal = t.local.txns.getLastSavedTxnProps();
807
864
  chai.expect(txnPropsLocal).to.not.be.undefined;
808
865
  chai.expect(txnPropsLocal.type).to.equal("Schema");
809
866
  chai.expect(t.checkIfFolderExists(t.local, txnPropsLocal.id, true)).to.be.true; // schema folder should exist
810
- t.local.saveChanges("local transforming schema update");
811
867
  // local pulls and rebases and then pushes
812
- await t.local.pushChanges({ description: "far move PropC to A" });
868
+ await pushChanges(localTxn, "far move PropC to A");
813
869
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // after push the folder should not be there
814
870
  t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
815
871
  const elementFar = t.getElement(t.local, elementIdFar);
@@ -838,32 +894,35 @@ describe("Semantic Rebase", function () {
838
894
  });
839
895
  it("local multiple data transactions onto incoming transforming schema change", async () => {
840
896
  t = await TestIModel.initialize("LocalMultipleDataIncomingTransform");
897
+ let farTxn = startTestTxn(t.far, "local multiple data transactions onto incoming transforming schema change far");
898
+ let localTxn = startTestTxn(t.local, "local multiple data transactions onto incoming transforming schema change local");
841
899
  // Insert initial element and push
842
900
  await t.local.locks.acquireLocks({ shared: t.drawingModelId });
843
- const elementId1 = t.insertElement(t.local, "TestDomain:C", {
901
+ const elementId1 = t.insertElement(localTxn, "TestDomain:C", {
844
902
  propA: "initial_a",
845
903
  propC: "initial_c",
846
904
  });
847
- t.local.saveChanges("create first element");
848
- await t.local.pushChanges({ description: "create initial element" });
905
+ localTxn.saveChanges("create first element");
906
+ await pushChanges(localTxn, "create initial element");
907
+ localTxn = startTestTxn(t.local, "local multiple data transactions onto incoming transforming schema change local");
849
908
  // Far imports transforming schema (moves PropC from C to A)
850
- await t.far.pullChanges();
851
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x02MovePropCToA]);
852
- t.far.saveChanges("far transforming schema update");
853
- await t.far.pushChanges({ description: "far move PropC to A" });
909
+ await pullChanges(farTxn);
910
+ farTxn = startTestTxn(t.far, "local multiple data transactions onto incoming transforming schema change far");
911
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
912
+ await pushChanges(farTxn, "far move PropC to A");
854
913
  // Local makes first data change
855
914
  await t.local.locks.acquireLocks({ exclusive: elementId1 });
856
- t.updateElement(t.local, elementId1, { propA: "first_update_a" });
857
- t.local.saveChanges("first data change");
915
+ t.updateElement(localTxn, elementId1, { propA: "first_update_a" });
916
+ localTxn.saveChanges("first data change");
858
917
  // Local makes second data change - create new element
859
918
  await t.local.locks.acquireLocks({ shared: t.drawingModelId });
860
- const elementId2 = t.insertElement(t.local, "TestDomain:C", {
919
+ const elementId2 = t.insertElement(localTxn, "TestDomain:C", {
861
920
  propA: "second_element_a",
862
921
  propC: "second_element_c",
863
922
  });
864
- t.local.saveChanges("second data change - new element");
923
+ localTxn.saveChanges("second data change - new element");
865
924
  // Local pulls and rebases both transactions onto incoming transforming schema
866
- await t.local.pullChanges();
925
+ await pullChanges(localTxn);
867
926
  t.local.clearCaches();
868
927
  // Verify: both local data changes preserved after incoming transform
869
928
  const element1 = t.getElement(t.local, elementId1);
@@ -877,32 +936,35 @@ describe("Semantic Rebase", function () {
877
936
  });
878
937
  it("local transforming schema change onto incoming multiple data transactions", async () => {
879
938
  t = await TestIModel.initialize("LocalTransformIncomingMultipleData");
939
+ let farTxn = startTestTxn(t.far, "local transforming schema change onto incoming multiple data transactions far");
940
+ let localTxn = startTestTxn(t.local, "local transforming schema change onto incoming multiple data transactions local");
880
941
  // Create initial element
881
942
  await t.far.locks.acquireLocks({ shared: t.drawingModelId });
882
- const elementId1 = t.insertElement(t.far, "TestDomain:C", {
943
+ const elementId1 = t.insertElement(farTxn, "TestDomain:C", {
883
944
  propA: "initial_a",
884
945
  propC: "initial_c",
885
946
  });
886
- t.far.saveChanges("create first element");
887
- await t.far.pushChanges({ description: "create initial element" });
947
+ farTxn.saveChanges("create first element");
948
+ await pushChanges(farTxn, "create initial element");
949
+ farTxn = startTestTxn(t.far, "local transforming schema change onto incoming multiple data transactions far");
888
950
  // Local pulls and imports transforming schema
889
- await t.local.pullChanges();
890
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x02MovePropCToA]);
891
- t.local.saveChanges("local transforming schema update");
951
+ await pullChanges(localTxn);
952
+ localTxn = startTestTxn(t.local, "local transforming schema change onto incoming multiple data transactions local");
953
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
892
954
  // Far makes first data change
893
955
  await t.far.locks.acquireLocks({ exclusive: elementId1 });
894
- t.updateElement(t.far, elementId1, { propA: "far_first_update_a" });
895
- t.far.saveChanges("far first data change");
956
+ t.updateElement(farTxn, elementId1, { propA: "far_first_update_a" });
957
+ farTxn.saveChanges("far first data change");
896
958
  // Far makes second data change - create new element
897
959
  await t.far.locks.acquireLocks({ shared: t.drawingModelId });
898
- const elementId2 = t.insertElement(t.far, "TestDomain:C", {
960
+ const elementId2 = t.insertElement(farTxn, "TestDomain:C", {
899
961
  propA: "far_second_element_a",
900
962
  propC: "far_second_element_c",
901
963
  });
902
- t.far.saveChanges("far second data change - new element");
903
- await t.far.pushChanges({ description: "far multiple data changes" });
964
+ farTxn.saveChanges("far second data change - new element");
965
+ await pushChanges(farTxn, "far multiple data changes");
904
966
  // Local pulls and rebases local transforming schema onto incoming data changes
905
- await t.local.pullChanges();
967
+ await pullChanges(localTxn);
906
968
  t.local.clearCaches();
907
969
  // Verify: both incoming data changes applied, local schema transformation preserved
908
970
  const element1 = t.getElement(t.local, elementId1);
@@ -916,15 +978,16 @@ describe("Semantic Rebase", function () {
916
978
  });
917
979
  it("should fail when importing schema with unsaved data changes", async () => {
918
980
  t = await TestIModel.initialize("UnsavedDataChangesSchemaImport");
981
+ const localTxn = startTestTxn(t.local, "should fail when importing schema with unsaved data changes local");
919
982
  // Create element but DO NOT save changes
920
983
  await t.local.locks.acquireLocks({ shared: t.drawingModelId });
921
- t.insertElement(t.local, "TestDomain:C", {
984
+ t.insertElement(localTxn, "TestDomain:C", {
922
985
  propA: "unsaved_a",
923
986
  propC: "unsaved_c",
924
987
  });
925
- // Intentionally NOT calling t.local.saveChanges()
988
+ // Intentionally not saving the active local transaction before schema import.
926
989
  // Try to import schema - this should fail
927
- await chai.expect(t.local.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2])).to.be.rejectedWith("Cannot import schemas with unsaved changes when useSemanticRebase flag is on");
990
+ await chai.expect(localTxn.iModel.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2])).to.be.rejectedWith("Cannot import schemas with unsaved changes when useSemanticRebase flag is on");
928
991
  // Verify: element was not saved, schema was not imported
929
992
  const schema = t.local.getSchemaProps("TestDomain");
930
993
  chai.expect(schema.version).to.equal("01.00.00", "Schema should remain at v01.00.00");
@@ -952,27 +1015,29 @@ describe("Semantic Rebase with indirect changes", function () {
952
1015
  });
953
1016
  it("Incoming data update onto local data change", async () => {
954
1017
  t = await TestIModel.initialize("IncomingDataLocalDataChange");
1018
+ const farTxn = startTestTxn(t.far, "Incoming data update onto local data change far");
1019
+ const localTxn = startTestTxn(t.local, "Incoming data update onto local data change local");
955
1020
  let elementIdFar = "";
956
1021
  await t.far.txns.withIndirectTxnModeAsync(async () => {
957
1022
  // Insert one instance and populate to both far and local
958
- elementIdFar = t.insertElement(t.far, "TestDomain:C", {
1023
+ elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
959
1024
  propA: "far_value_a",
960
1025
  propC: "far_value_c",
961
1026
  });
962
1027
  });
963
- t.far.saveChanges("far create indirect element");
964
- await t.far.pushChanges({ description: "create indirect element" });
1028
+ farTxn.saveChanges("far create indirect element");
1029
+ await pushChanges(farTxn, "create indirect element");
965
1030
  let elementIdLocal = "";
966
1031
  await t.local.txns.withIndirectTxnModeAsync(async () => {
967
1032
  // Insert one instance and populate to both far and local
968
- elementIdLocal = t.insertElement(t.local, "TestDomain:C", {
1033
+ elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
969
1034
  propA: "local_value_a",
970
1035
  propC: "local_value_c",
971
1036
  });
972
1037
  });
973
- t.local.saveChanges("local create indirect element");
1038
+ localTxn.saveChanges("local create indirect element");
974
1039
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because no schema change on either side
975
- await t.local.pushChanges({ description: "local pulls andcreate indirect element" });
1040
+ await pushChanges(localTxn, "local pulls andcreate indirect element");
976
1041
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because no schema change on either side
977
1042
  chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
978
1043
  t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
@@ -985,7 +1050,9 @@ describe("Semantic Rebase with indirect changes", function () {
985
1050
  });
986
1051
  it("Incoming data and schema update onto local data change", async () => {
987
1052
  t = await TestIModel.initialize("IncomingDataAndSchemaLocalDataChange");
988
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
1053
+ const farTxn = startTestTxn(t.far, "Incoming data and schema update onto local data change far");
1054
+ const localTxn = startTestTxn(t.local, "Incoming data and schema update onto local data change local");
1055
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
989
1056
  const farTxnProps = t.far.txns.getLastSavedTxnProps();
990
1057
  chai.expect(farTxnProps).to.not.be.undefined;
991
1058
  chai.expect(farTxnProps.type).to.equal("Schema");
@@ -993,26 +1060,26 @@ describe("Semantic Rebase with indirect changes", function () {
993
1060
  let elementIdFar = "";
994
1061
  await t.far.txns.withIndirectTxnModeAsync(async () => {
995
1062
  // Insert one instance and populate to both far and local
996
- elementIdFar = t.insertElement(t.far, "TestDomain:C", {
1063
+ elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
997
1064
  propA: "far_value_a",
998
1065
  propC: "far_value_c",
999
1066
  });
1000
1067
  });
1001
- t.far.saveChanges("far create indirect element");
1002
- await t.far.pushChanges({ description: "create indirect element" });
1068
+ farTxn.saveChanges("far create indirect element");
1069
+ await pushChanges(farTxn, "create indirect element");
1003
1070
  chai.expect(t.checkIfFolderExists(t.far, farTxnProps.id, true)).to.be.false; // after push the schema folder should not be there
1004
1071
  chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
1005
1072
  let elementIdLocal = "";
1006
1073
  await t.local.txns.withIndirectTxnModeAsync(async () => {
1007
1074
  // Insert one instance and populate to both far and local
1008
- elementIdLocal = t.insertElement(t.local, "TestDomain:C", {
1075
+ elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
1009
1076
  propA: "local_value_a",
1010
1077
  propC: "local_value_c",
1011
1078
  });
1012
1079
  });
1013
- t.local.saveChanges("local create indirect element");
1080
+ localTxn.saveChanges("local create indirect element");
1014
1081
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because no schema change on local side
1015
- await t.local.pushChanges({ description: "local pulls andcreate indirect element" });
1082
+ await pushChanges(localTxn, "local pulls andcreate indirect element");
1016
1083
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false;
1017
1084
  chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
1018
1085
  t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
@@ -1027,7 +1094,9 @@ describe("Semantic Rebase with indirect changes", function () {
1027
1094
  });
1028
1095
  it("Incoming data and schema update onto local data and schema change", async () => {
1029
1096
  t = await TestIModel.initialize("IncomingDataLocalDataAndSchemaChange");
1030
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x01AddPropC2]);
1097
+ const farTxn = startTestTxn(t.far, "Incoming data and schema update onto local data and schema change far");
1098
+ const localTxn = startTestTxn(t.local, "Incoming data and schema update onto local data and schema change local");
1099
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x01AddPropC2]);
1031
1100
  const farTxnProps = t.far.txns.getLastSavedTxnProps();
1032
1101
  chai.expect(farTxnProps).to.not.be.undefined;
1033
1102
  chai.expect(farTxnProps.type).to.equal("Schema");
@@ -1035,16 +1104,16 @@ describe("Semantic Rebase with indirect changes", function () {
1035
1104
  let elementIdFar = "";
1036
1105
  await t.far.txns.withIndirectTxnModeAsync(async () => {
1037
1106
  // Insert one instance and populate to both far and local
1038
- elementIdFar = t.insertElement(t.far, "TestDomain:C", {
1107
+ elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
1039
1108
  propA: "far_value_a",
1040
1109
  propC: "far_value_c",
1041
1110
  });
1042
1111
  });
1043
- t.far.saveChanges("far create indirect element");
1044
- await t.far.pushChanges({ description: "create indirect element" });
1112
+ farTxn.saveChanges("far create indirect element");
1113
+ await pushChanges(farTxn, "create indirect element");
1045
1114
  chai.expect(t.checkIfFolderExists(t.far, farTxnProps.id, true)).to.be.false; // after push the schema folder should not be there
1046
1115
  chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
1047
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x02AddPropD2]);
1116
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02AddPropD2]);
1048
1117
  const localTxnProps = t.local.txns.getLastSavedTxnProps();
1049
1118
  chai.expect(localTxnProps).to.not.be.undefined;
1050
1119
  chai.expect(localTxnProps.type).to.equal("Schema");
@@ -1052,14 +1121,14 @@ describe("Semantic Rebase with indirect changes", function () {
1052
1121
  let elementIdLocal = "";
1053
1122
  await t.local.txns.withIndirectTxnModeAsync(async () => {
1054
1123
  // Insert one instance and populate to both far and local
1055
- elementIdLocal = t.insertElement(t.local, "TestDomain:C", {
1124
+ elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
1056
1125
  propA: "local_value_a",
1057
1126
  propC: "local_value_c",
1058
1127
  });
1059
1128
  });
1060
- t.local.saveChanges("local create indirect element");
1129
+ localTxn.saveChanges("local create indirect element");
1061
1130
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.true; // there should be a rebase folder because schema change on local side
1062
- await t.local.pushChanges({ description: "local pulls andcreate indirect element" });
1131
+ await pushChanges(localTxn, "local pulls andcreate indirect element");
1063
1132
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // after push the folder should not be there
1064
1133
  chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
1065
1134
  t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
@@ -1074,34 +1143,36 @@ describe("Semantic Rebase with indirect changes", function () {
1074
1143
  });
1075
1144
  it("Incoming data and Transforming schema update onto local data change", async () => {
1076
1145
  t = await TestIModel.initialize("IncomingDataAndTransformingSchemaLocalDataChange");
1146
+ const farTxn = startTestTxn(t.far, "Incoming data and Transforming schema update onto local data change far");
1147
+ const localTxn = startTestTxn(t.local, "Incoming data and Transforming schema update onto local data change local");
1077
1148
  let elementIdFar = "";
1078
1149
  await t.far.txns.withIndirectTxnModeAsync(async () => {
1079
1150
  // Insert one instance and populate to both far and local
1080
- elementIdFar = t.insertElement(t.far, "TestDomain:C", {
1151
+ elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
1081
1152
  propA: "far_value_a",
1082
1153
  propC: "far_value_c",
1083
1154
  });
1084
1155
  });
1085
- t.far.saveChanges("far create indirect element");
1086
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x02MovePropCToA]);
1156
+ farTxn.saveChanges("far create indirect element");
1157
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
1087
1158
  const farTxnProps = t.far.txns.getLastSavedTxnProps();
1088
1159
  chai.expect(farTxnProps).to.not.be.undefined;
1089
1160
  chai.expect(farTxnProps.type).to.equal("Schema");
1090
1161
  chai.expect(t.checkIfFolderExists(t.far, farTxnProps.id, true)).to.be.true; // schema folder should exist
1091
- await t.far.pushChanges({ description: "create indirect element" });
1162
+ await pushChanges(farTxn, "create indirect element");
1092
1163
  chai.expect(t.checkIfFolderExists(t.far, farTxnProps.id, true)).to.be.false; // after push the schema folder should not be there
1093
1164
  chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
1094
1165
  let elementIdLocal = "";
1095
1166
  await t.local.txns.withIndirectTxnModeAsync(async () => {
1096
1167
  // Insert one instance and populate to both far and local
1097
- elementIdLocal = t.insertElement(t.local, "TestDomain:C", {
1168
+ elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
1098
1169
  propA: "local_value_a",
1099
1170
  propC: "local_value_c",
1100
1171
  });
1101
1172
  });
1102
- t.local.saveChanges("local create indirect element");
1173
+ localTxn.saveChanges("local create indirect element");
1103
1174
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // there should not be a rebase folder because no schema change on local side
1104
- await t.local.pushChanges({ description: "local pulls andcreate indirect element" });
1175
+ await pushChanges(localTxn, "local pulls andcreate indirect element");
1105
1176
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false;
1106
1177
  chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
1107
1178
  t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel
@@ -1116,7 +1187,9 @@ describe("Semantic Rebase with indirect changes", function () {
1116
1187
  });
1117
1188
  it("Incoming data and transforming schema update onto local data and transforming schema change", async () => {
1118
1189
  t = await TestIModel.initialize("IncomingDataAndTransformingSchemaLocalDataAndTransformingSchemaChange");
1119
- await t.far.importSchemaStrings([TestIModel.schemas.v01x00x02MovePropCToA]);
1190
+ const farTxn = startTestTxn(t.far, "Incoming data and transforming schema update onto local data and transforming schema change far");
1191
+ const localTxn = startTestTxn(t.local, "Incoming data and transforming schema update onto local data and transforming schema change local");
1192
+ await importSchemaStrings(farTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
1120
1193
  const farTxnProps = t.far.txns.getLastSavedTxnProps();
1121
1194
  chai.expect(farTxnProps).to.not.be.undefined;
1122
1195
  chai.expect(farTxnProps.type).to.equal("Schema");
@@ -1124,16 +1197,16 @@ describe("Semantic Rebase with indirect changes", function () {
1124
1197
  let elementIdFar = "";
1125
1198
  await t.far.txns.withIndirectTxnModeAsync(async () => {
1126
1199
  // Insert one instance and populate to both far and local
1127
- elementIdFar = t.insertElement(t.far, "TestDomain:C", {
1200
+ elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
1128
1201
  propA: "far_value_a",
1129
1202
  propC: "far_value_c",
1130
1203
  });
1131
1204
  });
1132
- t.far.saveChanges("far create indirect element");
1133
- await t.far.pushChanges({ description: "create indirect element" });
1205
+ farTxn.saveChanges("far create indirect element");
1206
+ await pushChanges(farTxn, "create indirect element");
1134
1207
  chai.expect(t.checkIfFolderExists(t.far, farTxnProps.id, true)).to.be.false; // after push the schema folder should not be there
1135
1208
  chai.expect(t.checkifRebaseFolderExists(t.far)).to.be.false; // after push the folder should not be there
1136
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x02MovePropCToA]);
1209
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
1137
1210
  const localTxnProps = t.local.txns.getLastSavedTxnProps();
1138
1211
  chai.expect(localTxnProps).to.not.be.undefined;
1139
1212
  chai.expect(localTxnProps.type).to.equal("Schema");
@@ -1141,13 +1214,13 @@ describe("Semantic Rebase with indirect changes", function () {
1141
1214
  let elementIdLocal = "";
1142
1215
  await t.local.txns.withIndirectTxnModeAsync(async () => {
1143
1216
  // Insert one instance and populate to both far and local
1144
- elementIdLocal = t.insertElement(t.local, "TestDomain:C", {
1217
+ elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
1145
1218
  propA: "local_value_a",
1146
1219
  propC: "local_value_c",
1147
1220
  });
1148
1221
  });
1149
- t.local.saveChanges("local create indirect element");
1150
- await t.local.pullChanges();
1222
+ localTxn.saveChanges("local create indirect element");
1223
+ await pullChanges(localTxn);
1151
1224
  chai.expect(t.checkIfFolderExists(t.local, localTxnProps.id, true)).to.be.false; // because it is a no op change we are importing similar schema
1152
1225
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.false; // schema change is no op and data changes are generated on the fly and removed once rebased so rebase folder should not be there
1153
1226
  chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
@@ -1164,17 +1237,19 @@ describe("Semantic Rebase with indirect changes", function () {
1164
1237
  it("Incoming data update onto local data and transforming schema change", async () => {
1165
1238
  // This test fails but should not fail actually - needs investigation
1166
1239
  t = await TestIModel.initialize("IncomingDataAndSchemaLocalDataChange");
1240
+ const farTxn = startTestTxn(t.far, "Incoming data update onto local data and transforming schema change far");
1241
+ const localTxn = startTestTxn(t.local, "Incoming data update onto local data and transforming schema change local");
1167
1242
  let elementIdFar = "";
1168
1243
  await t.far.txns.withIndirectTxnModeAsync(async () => {
1169
1244
  // Insert one instance and populate to both far and local
1170
- elementIdFar = t.insertElement(t.far, "TestDomain:C", {
1245
+ elementIdFar = t.insertElement(farTxn, "TestDomain:C", {
1171
1246
  propA: "far_value_a",
1172
1247
  propC: "far_value_c",
1173
1248
  });
1174
1249
  });
1175
- t.far.saveChanges("far create indirect element");
1176
- await t.far.pushChanges({ description: "create indirect element" });
1177
- await t.local.importSchemaStrings([TestIModel.schemas.v01x00x02MovePropCToA]);
1250
+ farTxn.saveChanges("far create indirect element");
1251
+ await pushChanges(farTxn, "create indirect element");
1252
+ await importSchemaStrings(localTxn, [TestIModel.schemas.v01x00x02MovePropCToA]);
1178
1253
  const localTxnProps = t.local.txns.getLastSavedTxnProps();
1179
1254
  chai.expect(localTxnProps).to.not.be.undefined;
1180
1255
  chai.expect(localTxnProps.type).to.equal("Schema");
@@ -1182,14 +1257,14 @@ describe("Semantic Rebase with indirect changes", function () {
1182
1257
  let elementIdLocal = "";
1183
1258
  await t.local.txns.withIndirectTxnModeAsync(async () => {
1184
1259
  // Insert one instance and populate to both far and local
1185
- elementIdLocal = t.insertElement(t.local, "TestDomain:C", {
1260
+ elementIdLocal = t.insertElement(localTxn, "TestDomain:C", {
1186
1261
  propA: "local_value_a",
1187
1262
  propC: "local_value_c",
1188
1263
  });
1189
1264
  });
1190
- t.local.saveChanges("local create indirect element");
1265
+ localTxn.saveChanges("local create indirect element");
1191
1266
  chai.expect(t.checkifRebaseFolderExists(t.local)).to.be.true; // there should be a rebase folder because schema change on local side
1192
- await t.local.pushChanges({ description: "local pulls andcreate indirect element" });
1267
+ await pushChanges(localTxn, "local pulls andcreate indirect element");
1193
1268
  chai.expect(t.checkIfFolderExists(t.local, localTxnProps.id, true)).to.be.false; // after push the schema folder should not be there
1194
1269
  chai.expect(Id64.isValidId64(elementIdFar) && Id64.isValidId64(elementIdLocal)).to.be.true;
1195
1270
  t.local.clearCaches(); // Clear caches to ensure we read transformed properties from iModel