@itwin/core-backend 5.2.0-dev.3 → 5.2.0-dev.30

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 (494) hide show
  1. package/CHANGELOG.md +79 -1
  2. package/lib/cjs/BackendHubAccess.js.map +1 -1
  3. package/lib/cjs/BackendLoggerCategory.d.ts +6 -0
  4. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
  5. package/lib/cjs/BackendLoggerCategory.js +6 -0
  6. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  7. package/lib/cjs/BisCoreSchema.js.map +1 -1
  8. package/lib/cjs/BlobContainerService.js.map +1 -1
  9. package/lib/cjs/BriefcaseManager.d.ts +57 -3
  10. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  11. package/lib/cjs/BriefcaseManager.js +150 -42
  12. package/lib/cjs/BriefcaseManager.js.map +1 -1
  13. package/lib/cjs/CatalogDb.js.map +1 -1
  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.js +248 -248
  19. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  20. package/lib/cjs/ChannelControl.js.map +1 -1
  21. package/lib/cjs/CheckpointManager.js.map +1 -1
  22. package/lib/cjs/ClassRegistry.js +7 -7
  23. package/lib/cjs/ClassRegistry.js.map +1 -1
  24. package/lib/cjs/CloudSqlite.d.ts +4 -0
  25. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  26. package/lib/cjs/CloudSqlite.js.map +1 -1
  27. package/lib/cjs/CodeService.js.map +1 -1
  28. package/lib/cjs/CodeSpecs.js.map +1 -1
  29. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  30. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  31. package/lib/cjs/DevTools.js.map +1 -1
  32. package/lib/cjs/DisplayStyle.js.map +1 -1
  33. package/lib/cjs/ECDb.d.ts +8 -0
  34. package/lib/cjs/ECDb.d.ts.map +1 -1
  35. package/lib/cjs/ECDb.js +22 -0
  36. package/lib/cjs/ECDb.js.map +1 -1
  37. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  38. package/lib/cjs/ECSqlStatement.js.map +1 -1
  39. package/lib/cjs/Element.js.map +1 -1
  40. package/lib/cjs/ElementAspect.js.map +1 -1
  41. package/lib/cjs/ElementGraphics.js.map +1 -1
  42. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  43. package/lib/cjs/Entity.js.map +1 -1
  44. package/lib/cjs/EntityReferences.js.map +1 -1
  45. package/lib/cjs/ExportGraphics.js.map +1 -1
  46. package/lib/cjs/ExternalSource.js.map +1 -1
  47. package/lib/cjs/FontFile.js.map +1 -1
  48. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  49. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  50. package/lib/cjs/GeometrySummary.js +47 -47
  51. package/lib/cjs/GeometrySummary.js.map +1 -1
  52. package/lib/cjs/IModelDb.d.ts +54 -3
  53. package/lib/cjs/IModelDb.d.ts.map +1 -1
  54. package/lib/cjs/IModelDb.js +96 -18
  55. package/lib/cjs/IModelDb.js.map +1 -1
  56. package/lib/cjs/IModelDbFonts.js.map +1 -1
  57. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  58. package/lib/cjs/IModelHost.d.ts +11 -1
  59. package/lib/cjs/IModelHost.d.ts.map +1 -1
  60. package/lib/cjs/IModelHost.js +5 -0
  61. package/lib/cjs/IModelHost.js.map +1 -1
  62. package/lib/cjs/IModelIncrementalSchemaLocater.d.ts +1 -5
  63. package/lib/cjs/IModelIncrementalSchemaLocater.d.ts.map +1 -1
  64. package/lib/cjs/IModelIncrementalSchemaLocater.js +0 -6
  65. package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
  66. package/lib/cjs/IModelJsFs.js.map +1 -1
  67. package/lib/cjs/ImageSourceConversion.js.map +1 -1
  68. package/lib/cjs/IpcHost.js.map +1 -1
  69. package/lib/cjs/LineStyle.js.map +1 -1
  70. package/lib/cjs/LocalHub.js +1 -1
  71. package/lib/cjs/LocalHub.js.map +1 -1
  72. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  73. package/lib/cjs/LockControl.js.map +1 -1
  74. package/lib/cjs/Material.js.map +1 -1
  75. package/lib/cjs/Model.js.map +1 -1
  76. package/lib/cjs/NativeAppStorage.js.map +1 -1
  77. package/lib/cjs/NativeHost.js.map +1 -1
  78. package/lib/cjs/NavigationRelationship.js.map +1 -1
  79. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  80. package/lib/cjs/PropertyStore.js.map +1 -1
  81. package/lib/cjs/Relationship.js.map +1 -1
  82. package/lib/cjs/RpcBackend.js.map +1 -1
  83. package/lib/cjs/SQLiteDb.js.map +1 -1
  84. package/lib/cjs/Schema.js.map +1 -1
  85. package/lib/cjs/SchemaSync.js.map +1 -1
  86. package/lib/cjs/SchemaUtils.js.map +1 -1
  87. package/lib/cjs/SheetIndex.js.map +1 -1
  88. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  89. package/lib/cjs/SqliteStatement.js.map +1 -1
  90. package/lib/cjs/StashManager.d.ts +175 -0
  91. package/lib/cjs/StashManager.d.ts.map +1 -0
  92. package/lib/cjs/StashManager.js +306 -0
  93. package/lib/cjs/StashManager.js.map +1 -0
  94. package/lib/cjs/Texture.js.map +1 -1
  95. package/lib/cjs/TileStorage.js.map +1 -1
  96. package/lib/cjs/TxnManager.d.ts +226 -15
  97. package/lib/cjs/TxnManager.d.ts.map +1 -1
  98. package/lib/cjs/TxnManager.js +249 -23
  99. package/lib/cjs/TxnManager.js.map +1 -1
  100. package/lib/cjs/ViewDefinition.js.map +1 -1
  101. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  102. package/lib/cjs/ViewStore.js.map +1 -1
  103. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +10 -1
  104. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
  105. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +12 -1
  106. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  107. package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
  108. package/lib/cjs/annotations/LeaderGeometry.d.ts +3 -2
  109. package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -1
  110. package/lib/cjs/annotations/LeaderGeometry.js +4 -3
  111. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
  112. package/lib/cjs/annotations/TextAnnotationElement.d.ts +52 -24
  113. package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
  114. package/lib/cjs/annotations/TextAnnotationElement.js +49 -59
  115. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  116. package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +2 -0
  117. package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -1
  118. package/lib/cjs/annotations/TextAnnotationGeometry.js +2 -2
  119. package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
  120. package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
  121. package/lib/cjs/annotations/TextBlockLayout.d.ts +3 -9
  122. package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -1
  123. package/lib/cjs/annotations/TextBlockLayout.js +3 -22
  124. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
  125. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  126. package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
  127. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
  128. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
  129. package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
  130. package/lib/cjs/core-backend.js.map +1 -1
  131. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  132. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  133. package/lib/cjs/domains/GenericElements.js.map +1 -1
  134. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  135. package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
  136. package/lib/cjs/internal/ChannelAdmin.js +1 -1
  137. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  138. package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
  139. package/lib/cjs/internal/FontFileImpl.js.map +1 -1
  140. package/lib/cjs/internal/HubMock.js.map +1 -1
  141. package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
  142. package/lib/cjs/internal/NativePlatform.js.map +1 -1
  143. package/lib/cjs/internal/NoLocks.js.map +1 -1
  144. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
  145. package/lib/cjs/internal/Symbols.d.ts +1 -0
  146. package/lib/cjs/internal/Symbols.d.ts.map +1 -1
  147. package/lib/cjs/internal/Symbols.js +2 -1
  148. package/lib/cjs/internal/Symbols.js.map +1 -1
  149. package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
  150. package/lib/cjs/internal/annotations/fields.js +1 -0
  151. package/lib/cjs/internal/annotations/fields.js.map +1 -1
  152. package/lib/cjs/internal/cross-package.js.map +1 -1
  153. package/lib/cjs/internal/workspace/SettingsImpl.js +1 -1
  154. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
  155. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +2 -2
  156. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  157. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  158. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  159. package/lib/cjs/rpc/multipart.js.map +1 -1
  160. package/lib/cjs/rpc/tracing.js.map +1 -1
  161. package/lib/cjs/rpc/web/logging.js.map +1 -1
  162. package/lib/cjs/rpc/web/request.js.map +1 -1
  163. package/lib/cjs/rpc/web/response.js.map +1 -1
  164. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  165. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  166. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  167. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  168. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  169. package/lib/cjs/workspace/Settings.js.map +1 -1
  170. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  171. package/lib/cjs/workspace/Workspace.d.ts +1 -1
  172. package/lib/cjs/workspace/Workspace.js.map +1 -1
  173. package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
  174. package/lib/esm/BackendHubAccess.js.map +1 -1
  175. package/lib/esm/BackendLoggerCategory.d.ts +6 -0
  176. package/lib/esm/BackendLoggerCategory.d.ts.map +1 -1
  177. package/lib/esm/BackendLoggerCategory.js +6 -0
  178. package/lib/esm/BackendLoggerCategory.js.map +1 -1
  179. package/lib/esm/BisCoreSchema.js.map +1 -1
  180. package/lib/esm/BlobContainerService.js.map +1 -1
  181. package/lib/esm/BriefcaseManager.d.ts +57 -3
  182. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  183. package/lib/esm/BriefcaseManager.js +151 -43
  184. package/lib/esm/BriefcaseManager.js.map +1 -1
  185. package/lib/esm/CatalogDb.js.map +1 -1
  186. package/lib/esm/Category.js.map +1 -1
  187. package/lib/esm/ChangeSummaryManager.js +2 -2
  188. package/lib/esm/ChangeSummaryManager.js.map +1 -1
  189. package/lib/esm/ChangedElementsDb.js.map +1 -1
  190. package/lib/esm/ChangesetECAdaptor.js +248 -248
  191. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  192. package/lib/esm/ChannelControl.js.map +1 -1
  193. package/lib/esm/CheckpointManager.js.map +1 -1
  194. package/lib/esm/ClassRegistry.js +7 -7
  195. package/lib/esm/ClassRegistry.js.map +1 -1
  196. package/lib/esm/CloudSqlite.d.ts +4 -0
  197. package/lib/esm/CloudSqlite.d.ts.map +1 -1
  198. package/lib/esm/CloudSqlite.js.map +1 -1
  199. package/lib/esm/CodeService.js.map +1 -1
  200. package/lib/esm/CodeSpecs.js.map +1 -1
  201. package/lib/esm/ConcurrentQuery.js.map +1 -1
  202. package/lib/esm/CustomViewState3dCreator.js.map +1 -1
  203. package/lib/esm/DevTools.js.map +1 -1
  204. package/lib/esm/DisplayStyle.js.map +1 -1
  205. package/lib/esm/ECDb.d.ts +8 -0
  206. package/lib/esm/ECDb.d.ts.map +1 -1
  207. package/lib/esm/ECDb.js +22 -0
  208. package/lib/esm/ECDb.js.map +1 -1
  209. package/lib/esm/ECSchemaXmlContext.js.map +1 -1
  210. package/lib/esm/ECSqlStatement.js.map +1 -1
  211. package/lib/esm/Element.js.map +1 -1
  212. package/lib/esm/ElementAspect.js.map +1 -1
  213. package/lib/esm/ElementGraphics.js.map +1 -1
  214. package/lib/esm/ElementTreeWalker.js.map +1 -1
  215. package/lib/esm/Entity.js.map +1 -1
  216. package/lib/esm/EntityReferences.js.map +1 -1
  217. package/lib/esm/ExportGraphics.js.map +1 -1
  218. package/lib/esm/ExternalSource.js.map +1 -1
  219. package/lib/esm/FontFile.js.map +1 -1
  220. package/lib/esm/GeoCoordConfig.js.map +1 -1
  221. package/lib/esm/GeographicCRSServices.js.map +1 -1
  222. package/lib/esm/GeometrySummary.js +47 -47
  223. package/lib/esm/GeometrySummary.js.map +1 -1
  224. package/lib/esm/IModelDb.d.ts +54 -3
  225. package/lib/esm/IModelDb.d.ts.map +1 -1
  226. package/lib/esm/IModelDb.js +97 -19
  227. package/lib/esm/IModelDb.js.map +1 -1
  228. package/lib/esm/IModelDbFonts.js.map +1 -1
  229. package/lib/esm/IModelElementCloneContext.js.map +1 -1
  230. package/lib/esm/IModelHost.d.ts +11 -1
  231. package/lib/esm/IModelHost.d.ts.map +1 -1
  232. package/lib/esm/IModelHost.js +5 -0
  233. package/lib/esm/IModelHost.js.map +1 -1
  234. package/lib/esm/IModelIncrementalSchemaLocater.d.ts +1 -5
  235. package/lib/esm/IModelIncrementalSchemaLocater.d.ts.map +1 -1
  236. package/lib/esm/IModelIncrementalSchemaLocater.js +0 -6
  237. package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
  238. package/lib/esm/IModelJsFs.js.map +1 -1
  239. package/lib/esm/ImageSourceConversion.js.map +1 -1
  240. package/lib/esm/IpcHost.js.map +1 -1
  241. package/lib/esm/LineStyle.js.map +1 -1
  242. package/lib/esm/LocalHub.js +1 -1
  243. package/lib/esm/LocalHub.js.map +1 -1
  244. package/lib/esm/LocalhostIpcHost.js.map +1 -1
  245. package/lib/esm/LockControl.js.map +1 -1
  246. package/lib/esm/Material.js.map +1 -1
  247. package/lib/esm/Model.js.map +1 -1
  248. package/lib/esm/NativeAppStorage.js.map +1 -1
  249. package/lib/esm/NativeHost.js.map +1 -1
  250. package/lib/esm/NavigationRelationship.js.map +1 -1
  251. package/lib/esm/PromiseMemoizer.js.map +1 -1
  252. package/lib/esm/PropertyStore.js.map +1 -1
  253. package/lib/esm/Relationship.js.map +1 -1
  254. package/lib/esm/RpcBackend.js.map +1 -1
  255. package/lib/esm/SQLiteDb.js.map +1 -1
  256. package/lib/esm/Schema.js.map +1 -1
  257. package/lib/esm/SchemaSync.js.map +1 -1
  258. package/lib/esm/SchemaUtils.js.map +1 -1
  259. package/lib/esm/SheetIndex.js.map +1 -1
  260. package/lib/esm/SqliteChangesetReader.js.map +1 -1
  261. package/lib/esm/SqliteStatement.js.map +1 -1
  262. package/lib/esm/StashManager.d.ts +175 -0
  263. package/lib/esm/StashManager.d.ts.map +1 -0
  264. package/lib/esm/StashManager.js +301 -0
  265. package/lib/esm/StashManager.js.map +1 -0
  266. package/lib/esm/Texture.js.map +1 -1
  267. package/lib/esm/TileStorage.js.map +1 -1
  268. package/lib/esm/TxnManager.d.ts +226 -15
  269. package/lib/esm/TxnManager.d.ts.map +1 -1
  270. package/lib/esm/TxnManager.js +247 -21
  271. package/lib/esm/TxnManager.js.map +1 -1
  272. package/lib/esm/ViewDefinition.js.map +1 -1
  273. package/lib/esm/ViewStateHydrator.js.map +1 -1
  274. package/lib/esm/ViewStore.js.map +1 -1
  275. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +10 -1
  276. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
  277. package/lib/esm/annotations/ElementDrivesTextAnnotation.js +10 -0
  278. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  279. package/lib/esm/annotations/FrameGeometry.js.map +1 -1
  280. package/lib/esm/annotations/LeaderGeometry.d.ts +3 -2
  281. package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -1
  282. package/lib/esm/annotations/LeaderGeometry.js +4 -3
  283. package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
  284. package/lib/esm/annotations/TextAnnotationElement.d.ts +52 -24
  285. package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
  286. package/lib/esm/annotations/TextAnnotationElement.js +51 -61
  287. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  288. package/lib/esm/annotations/TextAnnotationGeometry.d.ts +2 -0
  289. package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -1
  290. package/lib/esm/annotations/TextAnnotationGeometry.js +2 -2
  291. package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
  292. package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
  293. package/lib/esm/annotations/TextBlockLayout.d.ts +3 -9
  294. package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -1
  295. package/lib/esm/annotations/TextBlockLayout.js +3 -22
  296. package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
  297. package/lib/esm/core-backend.js.map +1 -1
  298. package/lib/esm/domains/FunctionalElements.js.map +1 -1
  299. package/lib/esm/domains/FunctionalSchema.js.map +1 -1
  300. package/lib/esm/domains/GenericElements.js.map +1 -1
  301. package/lib/esm/domains/GenericSchema.js.map +1 -1
  302. package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
  303. package/lib/esm/internal/ChannelAdmin.js +1 -1
  304. package/lib/esm/internal/ChannelAdmin.js.map +1 -1
  305. package/lib/esm/internal/ElementLRUCache.js.map +1 -1
  306. package/lib/esm/internal/FontFileImpl.js.map +1 -1
  307. package/lib/esm/internal/HubMock.js.map +1 -1
  308. package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
  309. package/lib/esm/internal/NativePlatform.js.map +1 -1
  310. package/lib/esm/internal/NoLocks.js.map +1 -1
  311. package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
  312. package/lib/esm/internal/Symbols.d.ts +1 -0
  313. package/lib/esm/internal/Symbols.d.ts.map +1 -1
  314. package/lib/esm/internal/Symbols.js +1 -0
  315. package/lib/esm/internal/Symbols.js.map +1 -1
  316. package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
  317. package/lib/esm/internal/annotations/fields.js +2 -1
  318. package/lib/esm/internal/annotations/fields.js.map +1 -1
  319. package/lib/esm/internal/cross-package.js.map +1 -1
  320. package/lib/esm/internal/workspace/SettingsImpl.js +1 -1
  321. package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
  322. package/lib/esm/internal/workspace/SettingsSchemasImpl.js +2 -2
  323. package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  324. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  325. package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  326. package/lib/esm/rpc/multipart.js.map +1 -1
  327. package/lib/esm/rpc/tracing.js.map +1 -1
  328. package/lib/esm/rpc/web/logging.js.map +1 -1
  329. package/lib/esm/rpc/web/request.js.map +1 -1
  330. package/lib/esm/rpc/web/response.js.map +1 -1
  331. package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  332. package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  333. package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  334. package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  335. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  336. package/lib/esm/test/AdvancedEqual.js.map +1 -1
  337. package/lib/esm/test/AnnotationTestUtils.d.ts +5 -1
  338. package/lib/esm/test/AnnotationTestUtils.d.ts.map +1 -1
  339. package/lib/esm/test/AnnotationTestUtils.js +6 -1
  340. package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
  341. package/lib/esm/test/AttachDb.test.js +11 -11
  342. package/lib/esm/test/AttachDb.test.js.map +1 -1
  343. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  344. package/lib/esm/test/GeometryTestUtil.js.map +1 -1
  345. package/lib/esm/test/IModelHost.test.js.map +1 -1
  346. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  347. package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
  348. package/lib/esm/test/IpcHost.test.js.map +1 -1
  349. package/lib/esm/test/KnownTestLocations.js.map +1 -1
  350. package/lib/esm/test/PrintElementTree.js.map +1 -1
  351. package/lib/esm/test/PropertyDb.test.js.map +1 -1
  352. package/lib/esm/test/RevisionUtility.js.map +1 -1
  353. package/lib/esm/test/SchemaUtils.test.js +25 -25
  354. package/lib/esm/test/SchemaUtils.test.js.map +1 -1
  355. package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
  356. package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
  357. package/lib/esm/test/TestUtils.js.map +1 -1
  358. package/lib/esm/test/annotations/Fields.test.js +42 -41
  359. package/lib/esm/test/annotations/Fields.test.js.map +1 -1
  360. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
  361. package/lib/esm/test/annotations/LeaderGeometry.test.js +12 -10
  362. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  363. package/lib/esm/test/annotations/TextAnnotation.test.js +299 -43
  364. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  365. package/lib/esm/test/annotations/TextBlock.test.js +39 -35
  366. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
  367. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
  368. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts +2 -0
  369. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts.map +1 -1
  370. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js +2 -0
  371. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
  372. package/lib/esm/test/categories/Category.test.js.map +1 -1
  373. package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
  374. package/lib/esm/test/ecdb/CTE.test.js +88 -88
  375. package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
  376. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +15 -15
  377. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
  378. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
  379. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
  380. package/lib/esm/test/ecdb/ECDb.test.js +128 -58
  381. package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
  382. package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
  383. package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
  384. package/lib/esm/test/ecdb/ECSqlAst.test.js +65 -65
  385. package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
  386. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  387. package/lib/esm/test/ecdb/ECSqlReader.test.js +16 -16
  388. package/lib/esm/test/ecdb/ECSqlReader.test.js.map +1 -1
  389. package/lib/esm/test/ecdb/ECSqlStatement.test.js +326 -326
  390. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  391. package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
  392. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.d.ts.map +1 -1
  393. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js +8 -2
  394. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
  395. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
  396. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
  397. package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
  398. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  399. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  400. package/lib/esm/test/element/ElementAspect.test.js +22 -22
  401. package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
  402. package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
  403. package/lib/esm/test/element/ElementRoundTrip.test.js +139 -139
  404. package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
  405. package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
  406. package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
  407. package/lib/esm/test/element/NullStructArray.test.js +13 -13
  408. package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
  409. package/lib/esm/test/element/UrlLink.test.js.map +1 -1
  410. package/lib/esm/test/font/FontFile.test.js.map +1 -1
  411. package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
  412. package/lib/esm/test/hubaccess/ApplyChangeset.test.js +32 -32
  413. package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
  414. package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
  415. package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
  416. package/lib/esm/test/hubaccess/Rebase.test.d.ts +2 -0
  417. package/lib/esm/test/hubaccess/Rebase.test.d.ts.map +1 -0
  418. package/lib/esm/test/hubaccess/Rebase.test.js +640 -0
  419. package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -0
  420. package/lib/esm/test/imageData.js.map +1 -1
  421. package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
  422. package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
  423. package/lib/esm/test/imodel/IModel.test.js +44 -44
  424. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  425. package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
  426. package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
  427. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js +20 -20
  428. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
  429. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js +3 -3
  430. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
  431. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +1 -1
  432. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +1 -1
  433. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts +16 -1
  434. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts.map +1 -1
  435. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js +47 -0
  436. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +1 -1
  437. package/lib/esm/test/index.js.map +1 -1
  438. package/lib/esm/test/misc/DevTools.test.js.map +1 -1
  439. package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
  440. package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
  441. package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
  442. package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
  443. package/lib/esm/test/rpc/response.test.js.map +1 -1
  444. package/lib/esm/test/schema/ClassRegistry.test.js +99 -99
  445. package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
  446. package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
  447. package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
  448. package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
  449. package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
  450. package/lib/esm/test/standalone/ChangeMerge.test.js +15 -19
  451. package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
  452. package/lib/esm/test/standalone/ChangesetReader.test.js +117 -117
  453. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  454. package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
  455. package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
  456. package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
  457. package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
  458. package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
  459. package/lib/esm/test/standalone/ExportGraphics.test.js +14 -14
  460. package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
  461. package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
  462. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  463. package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
  464. package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
  465. package/lib/esm/test/standalone/IModelWrite.test.js +27 -27
  466. package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
  467. package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
  468. package/lib/esm/test/standalone/MergeConflict.test.js +3 -3
  469. package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
  470. package/lib/esm/test/standalone/NativeAppStorage.test.js +2 -2
  471. package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
  472. package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
  473. package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
  474. package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
  475. package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
  476. package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
  477. package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
  478. package/lib/esm/test/standalone/Setting.test.js.map +1 -1
  479. package/lib/esm/test/standalone/Settings.test.js.map +1 -1
  480. package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
  481. package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
  482. package/lib/esm/test/standalone/Texture.test.js.map +1 -1
  483. package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
  484. package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
  485. package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
  486. package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
  487. package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
  488. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  489. package/lib/esm/workspace/Settings.js.map +1 -1
  490. package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
  491. package/lib/esm/workspace/Workspace.d.ts +1 -1
  492. package/lib/esm/workspace/Workspace.js.map +1 -1
  493. package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
  494. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"BlobContainerService.js","sourceRoot":"","sources":["../../src/BlobContainerService.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAOH;;;GAGG;AACH,MAAM,KAAW,aAAa,CA2K7B;AA3KD,WAAiB,aAAa;AA2K9B,CAAC,EA3KgB,aAAa,KAAb,aAAa,QA2K7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module BlobContainers\n */\n\n// spell:ignore datacenter\n\nimport { AccessToken, GuidString, Id64String } from \"@itwin/core-bentley\";\nimport { SettingsContainer } from \"./workspace/Settings\";\n\n/**\n * Types and functions for creating, deleting and authorizing access to cloud-based blob containers for an iTwin.\n * @beta\n */\nexport namespace BlobContainer {\n\n /** Object that implements the methods to create, delete, and request access to a container. */\n export let service: BlobContainer.ContainerService | undefined;\n\n /** name of cloud provider for a container. */\n export type Provider = \"azure\" | \"google\";\n\n /** the name of the container within its `Scope` */\n export type ContainerId = string;\n\n /** token that authenticates a user. This token is required to obtain a `ContainerToken`. */\n export type UserToken = AccessToken;\n\n /** token that authenticates access to a container for either read or write. */\n export type ContainerToken = AccessToken;\n\n /**\n * The scope for a container. This determines:\n * - the \"owner\" organization, including the contract that governs its legal and commercial terms and obligations\n * - the administrators who may configure RBAC permissions\n * - the datacenter for the container. Every container resides in a datacenter as determined by the iTwinId. This\n * determines the region for data residency requirements.\n * - the lifecycle constraints for the container. No container can outlive its iTwin or its iModel (if defined). That is,\n * when the iTwin/iModel is deleted (either explicitly or due to contract expiration), the container is also deleted.\n */\n export interface Scope {\n /** iTwinId of the owner of this container. */\n iTwinId: Id64String;\n /** optionally, an iModelId within the iTwin. If present, container is deleted when the iModel is deleted. */\n iModelId?: Id64String;\n /** the user GUID an individual, if this container is private. */\n ownerGuid?: GuidString;\n }\n\n /**\n * Metadata about the use of a container so that:\n * - administrators can understand why a container exists for assigning RBAC permissions appropriately\n * - usage reports can aggregate types of containers\n * - applications can identify their containers\n * - applications can store properties about their containers\n */\n export interface Metadata {\n /** The machine-readable string that describes what the container is being used for (e.g. \"workspace\"). Always lowercase and singular. */\n containerType: string;\n /** Human-readable name for the container. This will be displayed in the administrator RBAC panel, and on usage reports. Not required to be unique.*/\n label: string;\n /** Optional human-readable explanation of the information held in the container. This will be displayed in the administrator RBAC panel, and on usage reports. */\n description?: string;\n /** optional properties for the container */\n json?: SettingsContainer;\n }\n\n /**\n * Properties returned by queryContainersMetadata\n */\n export interface MetadataResponse extends Metadata {\n containerId: string;\n }\n\n /** Properties returned by `Service.requestToken` */\n export interface TokenProps {\n /**\n * Expiring token that provides the requested access to the container. Should be used in all subsequent requests for blobs within the container,\n * and must be refreshed before it expires\n */\n token: ContainerToken;\n /** Scope of the container. */\n scope: Scope;\n /** Name of the blob storage provider. */\n provider: Provider;\n /** Time at which the token will expire. The token should be refreshed (that is, a new token should be requested) before this time. */\n expiration: Date;\n /** Metadata of the container. */\n metadata: Metadata;\n /** Base URI of the storage account that hosts the container */\n baseUri: string;\n }\n\n /** The URI and Id of the container. */\n export interface UriAndId {\n baseUri: string;\n containerId: ContainerId;\n }\n\n /** Information required to access an existing container. */\n export interface AccessContainerProps extends UriAndId {\n userToken: UserToken;\n }\n\n /** Information about a newly created container. */\n export interface CreatedContainerProps extends UriAndId {\n /** name of the blob storage provider. */\n provider: Provider;\n }\n\n /**\n * Access level to request for token.\n * - `\"write\"`: request a writeable AccessToken.\n * - `\"read\"`: request a read-only AccessToken.\n * - `\"admin\"`: request a admin AccessToken.\n * - `\"writeIfPossible\"`: first request a writeable AccessToken. If the user is not authorized for write, request a read-only AccessToken.\n * If the user is not authorized for the level requested, an exception is thrown.\n */\n export type RequestAccessLevel = \"write\" | \"read\" | \"admin\" | \"writeIfPossible\";\n\n /** Information required to request an access token for a container. */\n export interface RequestTokenProps extends Omit<AccessContainerProps, \"baseUri\"> {\n /** the level of access requested. If not specified, defaults to `\"writeIfPossible\"`. */\n accessLevel?: RequestAccessLevel;\n /** the number of seconds before the token should expire.\n * @note A maximum duration is determined by the service. If no value is supplied, or the value is larger than the maximum, the maximum duration is used.\n */\n durationSeconds?: number;\n }\n\n /** Information required to create a new container. */\n export interface CreateNewContainerProps {\n /** the scope of the new container */\n scope: Scope;\n /** metadata to be stored on the new container */\n metadata: Metadata;\n /** The user's access token. The user must be authorized with \"create container\" RBAC role for the iTwin. */\n userToken: UserToken;\n /**\n * the id for the container. Useful for tests.\n * @internal\n */\n containerId?: ContainerId;\n }\n\n /**\n * Query Parameters for querying containers\n */\n export interface QueryContainerProps {\n /** the iTwinId of the containers to query */\n iTwinId: GuidString;\n /** optional iModelId of the containers to query */\n iModelId?: GuidString;\n /** optional containerType of the containers to query */\n containerType?: GuidString;\n /** optional label of the containers to query */\n label?: GuidString;\n }\n\n /** Methods to create, delete, and access blob containers. */\n export interface ContainerService {\n /** Create a new blob container. Throws on failure (e.g. access denied or container already exists.) */\n create(props: CreateNewContainerProps): Promise<CreatedContainerProps>;\n\n /**\n * Delete an existing blob container.\n * @note This method requires that the user be authorized with \"delete container\" RBAC role for the iTwin.\n */\n delete(container: AccessContainerProps): Promise<void>;\n\n /** query the Scope for a container */\n queryScope(container: AccessContainerProps): Promise<Scope>;\n\n /** query the Metadata for a specific container */\n queryMetadata(container: AccessContainerProps): Promise<Metadata>;\n\n /** Returns all containers and their metadata associated with a given iTwinId. Can be further queried by label and containerType. */\n queryContainersMetadata(userToken: UserToken, args: QueryContainerProps): Promise<MetadataResponse[]>;\n\n /** update the json properties of this container */\n updateJson(container: AccessContainerProps, json: SettingsContainer): Promise<void>;\n\n /** Request a `ContainerToken` for a container. Throws on failure. */\n requestToken(props: RequestTokenProps): Promise<TokenProps>;\n }\n}\n"]}
1
+ {"version":3,"file":"BlobContainerService.js","sourceRoot":"","sources":["../../src/BlobContainerService.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAOH;;;GAGG;AACH,MAAM,KAAW,aAAa,CA2K7B;AA3KD,WAAiB,aAAa;AA2K9B,CAAC,EA3KgB,aAAa,KAAb,aAAa,QA2K7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module BlobContainers\r\n */\r\n\r\n// spell:ignore datacenter\r\n\r\nimport { AccessToken, GuidString, Id64String } from \"@itwin/core-bentley\";\r\nimport { SettingsContainer } from \"./workspace/Settings\";\r\n\r\n/**\r\n * Types and functions for creating, deleting and authorizing access to cloud-based blob containers for an iTwin.\r\n * @beta\r\n */\r\nexport namespace BlobContainer {\r\n\r\n /** Object that implements the methods to create, delete, and request access to a container. */\r\n export let service: BlobContainer.ContainerService | undefined;\r\n\r\n /** name of cloud provider for a container. */\r\n export type Provider = \"azure\" | \"google\";\r\n\r\n /** the name of the container within its `Scope` */\r\n export type ContainerId = string;\r\n\r\n /** token that authenticates a user. This token is required to obtain a `ContainerToken`. */\r\n export type UserToken = AccessToken;\r\n\r\n /** token that authenticates access to a container for either read or write. */\r\n export type ContainerToken = AccessToken;\r\n\r\n /**\r\n * The scope for a container. This determines:\r\n * - the \"owner\" organization, including the contract that governs its legal and commercial terms and obligations\r\n * - the administrators who may configure RBAC permissions\r\n * - the datacenter for the container. Every container resides in a datacenter as determined by the iTwinId. This\r\n * determines the region for data residency requirements.\r\n * - the lifecycle constraints for the container. No container can outlive its iTwin or its iModel (if defined). That is,\r\n * when the iTwin/iModel is deleted (either explicitly or due to contract expiration), the container is also deleted.\r\n */\r\n export interface Scope {\r\n /** iTwinId of the owner of this container. */\r\n iTwinId: Id64String;\r\n /** optionally, an iModelId within the iTwin. If present, container is deleted when the iModel is deleted. */\r\n iModelId?: Id64String;\r\n /** the user GUID an individual, if this container is private. */\r\n ownerGuid?: GuidString;\r\n }\r\n\r\n /**\r\n * Metadata about the use of a container so that:\r\n * - administrators can understand why a container exists for assigning RBAC permissions appropriately\r\n * - usage reports can aggregate types of containers\r\n * - applications can identify their containers\r\n * - applications can store properties about their containers\r\n */\r\n export interface Metadata {\r\n /** The machine-readable string that describes what the container is being used for (e.g. \"workspace\"). Always lowercase and singular. */\r\n containerType: string;\r\n /** Human-readable name for the container. This will be displayed in the administrator RBAC panel, and on usage reports. Not required to be unique.*/\r\n label: string;\r\n /** Optional human-readable explanation of the information held in the container. This will be displayed in the administrator RBAC panel, and on usage reports. */\r\n description?: string;\r\n /** optional properties for the container */\r\n json?: SettingsContainer;\r\n }\r\n\r\n /**\r\n * Properties returned by queryContainersMetadata\r\n */\r\n export interface MetadataResponse extends Metadata {\r\n containerId: string;\r\n }\r\n\r\n /** Properties returned by `Service.requestToken` */\r\n export interface TokenProps {\r\n /**\r\n * Expiring token that provides the requested access to the container. Should be used in all subsequent requests for blobs within the container,\r\n * and must be refreshed before it expires\r\n */\r\n token: ContainerToken;\r\n /** Scope of the container. */\r\n scope: Scope;\r\n /** Name of the blob storage provider. */\r\n provider: Provider;\r\n /** Time at which the token will expire. The token should be refreshed (that is, a new token should be requested) before this time. */\r\n expiration: Date;\r\n /** Metadata of the container. */\r\n metadata: Metadata;\r\n /** Base URI of the storage account that hosts the container */\r\n baseUri: string;\r\n }\r\n\r\n /** The URI and Id of the container. */\r\n export interface UriAndId {\r\n baseUri: string;\r\n containerId: ContainerId;\r\n }\r\n\r\n /** Information required to access an existing container. */\r\n export interface AccessContainerProps extends UriAndId {\r\n userToken: UserToken;\r\n }\r\n\r\n /** Information about a newly created container. */\r\n export interface CreatedContainerProps extends UriAndId {\r\n /** name of the blob storage provider. */\r\n provider: Provider;\r\n }\r\n\r\n /**\r\n * Access level to request for token.\r\n * - `\"write\"`: request a writeable AccessToken.\r\n * - `\"read\"`: request a read-only AccessToken.\r\n * - `\"admin\"`: request a admin AccessToken.\r\n * - `\"writeIfPossible\"`: first request a writeable AccessToken. If the user is not authorized for write, request a read-only AccessToken.\r\n * If the user is not authorized for the level requested, an exception is thrown.\r\n */\r\n export type RequestAccessLevel = \"write\" | \"read\" | \"admin\" | \"writeIfPossible\";\r\n\r\n /** Information required to request an access token for a container. */\r\n export interface RequestTokenProps extends Omit<AccessContainerProps, \"baseUri\"> {\r\n /** the level of access requested. If not specified, defaults to `\"writeIfPossible\"`. */\r\n accessLevel?: RequestAccessLevel;\r\n /** the number of seconds before the token should expire.\r\n * @note A maximum duration is determined by the service. If no value is supplied, or the value is larger than the maximum, the maximum duration is used.\r\n */\r\n durationSeconds?: number;\r\n }\r\n\r\n /** Information required to create a new container. */\r\n export interface CreateNewContainerProps {\r\n /** the scope of the new container */\r\n scope: Scope;\r\n /** metadata to be stored on the new container */\r\n metadata: Metadata;\r\n /** The user's access token. The user must be authorized with \"create container\" RBAC role for the iTwin. */\r\n userToken: UserToken;\r\n /**\r\n * the id for the container. Useful for tests.\r\n * @internal\r\n */\r\n containerId?: ContainerId;\r\n }\r\n\r\n /**\r\n * Query Parameters for querying containers\r\n */\r\n export interface QueryContainerProps {\r\n /** the iTwinId of the containers to query */\r\n iTwinId: GuidString;\r\n /** optional iModelId of the containers to query */\r\n iModelId?: GuidString;\r\n /** optional containerType of the containers to query */\r\n containerType?: GuidString;\r\n /** optional label of the containers to query */\r\n label?: GuidString;\r\n }\r\n\r\n /** Methods to create, delete, and access blob containers. */\r\n export interface ContainerService {\r\n /** Create a new blob container. Throws on failure (e.g. access denied or container already exists.) */\r\n create(props: CreateNewContainerProps): Promise<CreatedContainerProps>;\r\n\r\n /**\r\n * Delete an existing blob container.\r\n * @note This method requires that the user be authorized with \"delete container\" RBAC role for the iTwin.\r\n */\r\n delete(container: AccessContainerProps): Promise<void>;\r\n\r\n /** query the Scope for a container */\r\n queryScope(container: AccessContainerProps): Promise<Scope>;\r\n\r\n /** query the Metadata for a specific container */\r\n queryMetadata(container: AccessContainerProps): Promise<Metadata>;\r\n\r\n /** Returns all containers and their metadata associated with a given iTwinId. Can be further queried by label and containerType. */\r\n queryContainersMetadata(userToken: UserToken, args: QueryContainerProps): Promise<MetadataResponse[]>;\r\n\r\n /** update the json properties of this container */\r\n updateJson(container: AccessContainerProps, json: SettingsContainer): Promise<void>;\r\n\r\n /** Request a `ContainerToken` for a container. Throws on failure. */\r\n requestToken(props: RequestTokenProps): Promise<TokenProps>;\r\n }\r\n}\r\n"]}
@@ -6,6 +6,7 @@ import { BriefcaseId, BriefcaseProps, ChangesetFileProps, ChangesetIndex, Change
6
6
  import { AcquireNewBriefcaseIdArg, DownloadChangesetArg, DownloadChangesetRangeArg, IModelNameArg } from "./BackendHubAccess";
7
7
  import { ProgressFunction } from "./CheckpointManager";
8
8
  import { BriefcaseDb, IModelDb, TokenArg } from "./IModelDb";
9
+ import { StashProps } from "./StashManager";
9
10
  /** The argument for [[BriefcaseManager.downloadBriefcase]]
10
11
  * @public
11
12
  */
@@ -33,7 +34,8 @@ export interface PushChangesArgs extends TokenArg {
33
34
  /** The delay to wait between retry attempts on failed pushes. Default is 3 seconds. */
34
35
  pushRetryDelay?: BeDuration;
35
36
  /**
36
- * For testing purpose
37
+ * (unused)
38
+ * @deprecated Not used by BriefcaseManager. Caller should remove this flag.
37
39
  * @internal
38
40
  */
39
41
  noFastForward?: true;
@@ -55,7 +57,8 @@ export type PullChangesArgs = ToChangesetArgs & {
55
57
  */
56
58
  onProgress?: ProgressFunction;
57
59
  /**
58
- * For testing purpose
60
+ * (unused)
61
+ * @deprecated Not used by BriefcaseManager. Caller should remove this flag.
59
62
  * @internal
60
63
  */
61
64
  noFastForward?: true;
@@ -77,6 +80,8 @@ export type RevertChangesArgs = Optional<PushChangesArgs, "description"> & {
77
80
  * @public
78
81
  */
79
82
  export declare class BriefcaseManager {
83
+ /** @internal */
84
+ static readonly PULL_MERGE_RESTORE_POINT_NAME = "$pull_merge_restore_point";
80
85
  /** Get the local path of the folder storing files that are associated with an imodel */
81
86
  static getIModelPath(iModelId: GuidString): LocalDirName;
82
87
  /** @internal */
@@ -209,8 +214,57 @@ export declare class BriefcaseManager {
209
214
  private static applySingleChangeset;
210
215
  /** @internal */
211
216
  static revertTimelineChanges(db: IModelDb, arg: RevertChangesArgs): Promise<void>;
212
- /** @internal */
217
+ /**
218
+ * @internal
219
+ * Pulls and applies changesets from the iModelHub to the specified IModelDb instance.
220
+ *
221
+ * This method downloads and applies all changesets required to bring the local briefcase up to the specified changeset index.
222
+ * It supports both forward and reverse application of changesets, depending on the `toIndex` argument.
223
+ * If there are pending local transactions and a reverse operation is requested, an error is thrown.
224
+ * The method manages restore points for safe merging, handles local transaction reversal, applies each changeset in order,
225
+ * and resumes or rebases local changes as appropriate for the type of database.
226
+ *
227
+ * @param db The IModelDb instance to which changesets will be applied. Must be open and writable.
228
+ * @param arg The arguments for pulling changesets, including access token, target changeset index, and optional progress callback.
229
+ * @throws IModelError If the briefcase is not open in read-write mode, if there are pending transactions when reversing, or if applying a changeset fails.
230
+ * @returns A promise that resolves when all required changesets have been applied.
231
+ */
213
232
  static pullAndApplyChangesets(db: IModelDb, arg: PullChangesArgs): Promise<void>;
233
+ /**
234
+ * @internal
235
+ * Creates a restore point for the specified briefcase database.
236
+ *
237
+ * @param db - The {@link BriefcaseDb} instance for which to create the restore point.
238
+ * @param name - The unique name for the restore point. Must be a non-empty string.
239
+ * @returns A promise that resolves to the created stash object representing the restore point.
240
+ */
241
+ static createRestorePoint(db: BriefcaseDb, name: string): Promise<StashProps>;
242
+ /**
243
+ * @internal
244
+ * Drops a previously created restore point from the specified briefcase database.
245
+ *
246
+ * @param db - The {@link BriefcaseDb} instance from which to drop the restore point.
247
+ * @param name - The name of the restore point to be dropped. Must be a non-empty string.
248
+ */
249
+ static dropRestorePoint(db: BriefcaseDb, name: string): void;
250
+ /**
251
+ * @internal
252
+ * Checks if a restore point with the specified name exists in the given briefcase database.
253
+ *
254
+ * @param db - The {@link BriefcaseDb} instance to search within.
255
+ * @param name - The name of the restore point to check for existence.
256
+ * @returns `true` if the restore point exists and its stash is present; otherwise, `false`.
257
+ */
258
+ static containsRestorePoint(db: BriefcaseDb, name: string): boolean;
259
+ private static makeRestorePointKey;
260
+ /**
261
+ * @internal
262
+ * Restores the state of a briefcase database to a previously saved restore point.
263
+ *
264
+ * @param db - The {@link BriefcaseDb} instance to restore.
265
+ * @param name - The name of the restore point to apply.
266
+ */
267
+ static restorePoint(db: BriefcaseDb, name: string): Promise<void>;
214
268
  /** create a changeset from the current changes, and push it to iModelHub */
215
269
  private static pushChanges;
216
270
  /** Pull/merge (if necessary), then push all local changes as a changeset. Called by [[BriefcaseDb.pushChanges]]
@@ -1 +1 @@
1
- {"version":3,"file":"Brief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AAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAW1F;;;;;;OAMG;WACW,gBAAgB,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAanE;;;;;;;OAOG;WACW,oBAAoB,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO;IAiB1E,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAOlC;;;;;;OAMG;WACiB,YAAY,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY9E,4EAA4E;mBACvD,WAAW;IAgDhC;;OAEG;WACiB,aAAa,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;CAqBxF"}
@@ -11,17 +11,20 @@ import { BeDuration, ChangeSetStatus, DbResult, IModelHubStatus, IModelStatus, L
11
11
  import { BriefcaseIdValue, ChangesetType, IModelError, IModelVersion, } from "@itwin/core-common";
12
12
  import { BackendLoggerCategory } from "./BackendLoggerCategory";
13
13
  import { CheckpointManager } from "./CheckpointManager";
14
- import { IModelDb } from "./IModelDb";
14
+ import { BriefcaseDb, IModelDb } from "./IModelDb";
15
15
  import { IModelHost } from "./IModelHost";
16
16
  import { IModelJsFs } from "./IModelJsFs";
17
17
  import { SchemaSync } from "./SchemaSync";
18
18
  import { _hubAccess, _nativeDb, _releaseAllLocks } from "./internal/Symbols";
19
19
  import { IModelNative } from "./internal/NativePlatform";
20
+ import { StashManager } from "./StashManager";
20
21
  const loggerCategory = BackendLoggerCategory.IModelDb;
21
22
  /** Manages downloading Briefcases and downloading and uploading changesets.
22
23
  * @public
23
24
  */
24
25
  export class BriefcaseManager {
26
+ /** @internal */
27
+ static PULL_MERGE_RESTORE_POINT_NAME = "$pull_merge_restore_point";
25
28
  /** Get the local path of the folder storing files that are associated with an imodel */
26
29
  static getIModelPath(iModelId) { return path.join(this._cacheDir, iModelId); }
27
30
  /** @internal */
@@ -238,7 +241,7 @@ export class BriefcaseManager {
238
241
  IModelJsFs.unlinkSync(filePath);
239
242
  }
240
243
  catch (err) {
241
- throw new IModelError(IModelStatus.BadRequest, `cannot delete briefcase file ${err}`);
244
+ throw new IModelError(IModelStatus.BadRequest, `cannot delete briefcase file ${String(err)}`);
242
245
  }
243
246
  // next, delete all files that start with the briefcase's filePath (e.g. "a.bim-locks", "a.bim-journal", etc.)
244
247
  try {
@@ -261,7 +264,7 @@ export class BriefcaseManager {
261
264
  IModelJsFs.unlinkSync(pathname);
262
265
  }
263
266
  catch (error) {
264
- Logger.logError(loggerCategory, `Cannot delete file ${pathname}, ${error}`);
267
+ Logger.logError(loggerCategory, `Cannot delete file ${pathname}, ${String(error)}`);
265
268
  return false;
266
269
  }
267
270
  return true;
@@ -397,15 +400,30 @@ export class BriefcaseManager {
397
400
  });
398
401
  db.notifyChangesetApplied();
399
402
  }
400
- /** @internal */
403
+ /**
404
+ * @internal
405
+ * Pulls and applies changesets from the iModelHub to the specified IModelDb instance.
406
+ *
407
+ * This method downloads and applies all changesets required to bring the local briefcase up to the specified changeset index.
408
+ * It supports both forward and reverse application of changesets, depending on the `toIndex` argument.
409
+ * If there are pending local transactions and a reverse operation is requested, an error is thrown.
410
+ * The method manages restore points for safe merging, handles local transaction reversal, applies each changeset in order,
411
+ * and resumes or rebases local changes as appropriate for the type of database.
412
+ *
413
+ * @param db The IModelDb instance to which changesets will be applied. Must be open and writable.
414
+ * @param arg The arguments for pulling changesets, including access token, target changeset index, and optional progress callback.
415
+ * @throws IModelError If the briefcase is not open in read-write mode, if there are pending transactions when reversing, or if applying a changeset fails.
416
+ * @returns A promise that resolves when all required changesets have been applied.
417
+ */
401
418
  static async pullAndApplyChangesets(db, arg) {
402
- if (!db.isOpen || db[_nativeDb].isReadonly()) // don't use db.isReadonly - we reopen the file writable just for this operation but db.isReadonly is still true
419
+ const nativeDb = db[_nativeDb];
420
+ if (!db.isOpen || nativeDb.isReadonly()) // don't use db.isReadonly - we reopen the file writable just for this operation but db.isReadonly is still true
403
421
  throw new IModelError(ChangeSetStatus.ApplyError, "Briefcase must be open ReadWrite to process change sets");
404
422
  let currentIndex = db.changeset.index;
405
423
  if (currentIndex === undefined)
406
424
  currentIndex = (await IModelHost[_hubAccess].queryChangeset({ accessToken: arg.accessToken, iModelId: db.iModelId, changeset: { id: db.changeset.id } })).index;
407
425
  const reverse = (arg.toIndex && arg.toIndex < currentIndex) ? true : false;
408
- if (db[_nativeDb].hasPendingTxns() && reverse) {
426
+ if (nativeDb.hasPendingTxns() && reverse) {
409
427
  throw new IModelError(ChangeSetStatus.ApplyError, "Cannot reverse changesets when there are pending changes");
410
428
  }
411
429
  // Download change sets
@@ -420,53 +438,139 @@ export class BriefcaseManager {
420
438
  return; // nothing to apply
421
439
  if (reverse)
422
440
  changesets.reverse();
423
- let appliedChangesets = -1;
424
- if (db[_nativeDb].hasPendingTxns() && !reverse && !arg.noFastForward) {
425
- // attempt to perform fast forward
426
- for (const changeset of changesets) {
427
- // do not waste time on schema changesets. They cannot be fastforwarded.
428
- if (changeset.changesType === ChangesetType.Schema || changeset.changesType === ChangesetType.SchemaSync)
429
- break;
430
- try {
431
- const stopwatch = new StopWatch(`[${changeset.id}]`, true);
432
- Logger.logInfo(loggerCategory, `Starting application of changeset with id ${stopwatch.description} using fast forward method`);
433
- await this.applySingleChangeset(db, changeset, true);
434
- Logger.logInfo(loggerCategory, `Applied changeset with id ${stopwatch.description} (${stopwatch.elapsedSeconds} seconds)`);
435
- appliedChangesets++;
436
- db.saveChanges();
437
- }
438
- catch {
439
- db.abandonChanges();
440
- break;
441
+ const briefcaseDb = db instanceof BriefcaseDb ? db : undefined;
442
+ // create restore point if certain conditions are met
443
+ if (briefcaseDb && briefcaseDb.txns.hasPendingTxns && !briefcaseDb.txns.hasPendingSchemaChanges && !reverse && !IModelHost.configuration?.disableRestorePointOnPullMerge) {
444
+ Logger.logInfo(loggerCategory, `Creating restore point ${this.PULL_MERGE_RESTORE_POINT_NAME}`);
445
+ await this.createRestorePoint(briefcaseDb, this.PULL_MERGE_RESTORE_POINT_NAME);
446
+ }
447
+ if (!reverse) {
448
+ const reversedTxns = nativeDb.pullMergeReverseLocalChanges();
449
+ Logger.logInfo(loggerCategory, `Reversed ${reversedTxns.length} local changes`);
450
+ }
451
+ // apply incoming changes
452
+ for (const changeset of changesets) {
453
+ const stopwatch = new StopWatch(`[${changeset.id}]`, true);
454
+ Logger.logInfo(loggerCategory, `Starting application of changeset with id ${stopwatch.description}`);
455
+ try {
456
+ await this.applySingleChangeset(db, changeset, false);
457
+ Logger.logInfo(loggerCategory, `Applied changeset with id ${stopwatch.description} (${stopwatch.elapsedSeconds} seconds)`);
458
+ }
459
+ catch (err) {
460
+ if (err instanceof Error) {
461
+ Logger.logError(loggerCategory, `Error applying changeset with id ${stopwatch.description}: ${err.message}`);
441
462
  }
463
+ db.abandonChanges();
464
+ throw err;
442
465
  }
443
466
  }
444
- if (appliedChangesets < changesets.length - 1) {
445
- db[_nativeDb].pullMergeBegin();
446
- for (const changeset of changesets.filter((_, index) => index > appliedChangesets)) {
447
- const stopwatch = new StopWatch(`[${changeset.id}]`, true);
448
- Logger.logInfo(loggerCategory, `Starting application of changeset with id ${stopwatch.description}`);
449
- try {
450
- await this.applySingleChangeset(db, changeset, false);
451
- Logger.logInfo(loggerCategory, `Applied changeset with id ${stopwatch.description} (${stopwatch.elapsedSeconds} seconds)`);
467
+ if (!reverse) {
468
+ if (briefcaseDb) {
469
+ await briefcaseDb.txns.rebaser.resume();
470
+ }
471
+ else {
472
+ // Only Briefcase has change management. Following is
473
+ // for test related to standalone db with txn enabled.
474
+ nativeDb.pullMergeRebaseBegin();
475
+ let txnId = nativeDb.pullMergeRebaseNext();
476
+ while (txnId) {
477
+ nativeDb.pullMergeRebaseReinstateTxn();
478
+ nativeDb.pullMergeRebaseUpdateTxn();
479
+ txnId = nativeDb.pullMergeRebaseNext();
452
480
  }
453
- catch (err) {
454
- if (err instanceof Error) {
455
- Logger.logError(loggerCategory, `Error applying changeset with id ${stopwatch.description}: ${err.message}`);
456
- }
457
- db.abandonChanges();
458
- db[_nativeDb].pullMergeEnd();
459
- throw err;
481
+ nativeDb.pullMergeRebaseEnd();
482
+ if (!nativeDb.isReadonly) {
483
+ nativeDb.saveChanges("Merge.");
460
484
  }
461
485
  }
462
- db[_nativeDb].pullMergeEnd();
463
- if (!db.isReadonly) {
464
- db.saveChanges("Merge.");
486
+ if (briefcaseDb && this.containsRestorePoint(briefcaseDb, this.PULL_MERGE_RESTORE_POINT_NAME)) {
487
+ Logger.logInfo(loggerCategory, `Dropping restore point ${this.PULL_MERGE_RESTORE_POINT_NAME}`);
488
+ this.dropRestorePoint(briefcaseDb, this.PULL_MERGE_RESTORE_POINT_NAME);
465
489
  }
466
490
  }
467
491
  // notify listeners
468
492
  db.notifyChangesetApplied();
469
493
  }
494
+ /**
495
+ * @internal
496
+ * Creates a restore point for the specified briefcase database.
497
+ *
498
+ * @param db - The {@link BriefcaseDb} instance for which to create the restore point.
499
+ * @param name - The unique name for the restore point. Must be a non-empty string.
500
+ * @returns A promise that resolves to the created stash object representing the restore point.
501
+ */
502
+ static async createRestorePoint(db, name) {
503
+ Logger.logTrace(loggerCategory, `Creating restore point ${name}`);
504
+ this.dropRestorePoint(db, name);
505
+ const stash = await StashManager.stash({ db, description: this.makeRestorePointKey(name) });
506
+ db[_nativeDb].saveLocalValue(this.makeRestorePointKey(name), stash.id);
507
+ db.saveChanges("Create restore point");
508
+ Logger.logTrace(loggerCategory, `Created restore point ${name}`, () => stash);
509
+ return stash;
510
+ }
511
+ /**
512
+ * @internal
513
+ * Drops a previously created restore point from the specified briefcase database.
514
+ *
515
+ * @param db - The {@link BriefcaseDb} instance from which to drop the restore point.
516
+ * @param name - The name of the restore point to be dropped. Must be a non-empty string.
517
+ */
518
+ static dropRestorePoint(db, name) {
519
+ Logger.logTrace(loggerCategory, `Dropping restore point ${name}`);
520
+ const restorePointId = db[_nativeDb].queryLocalValue(this.makeRestorePointKey(name));
521
+ if (restorePointId) {
522
+ StashManager.dropStash({ db, stash: restorePointId });
523
+ db[_nativeDb].deleteLocalValue(this.makeRestorePointKey(name));
524
+ db.saveChanges("Drop restore point");
525
+ Logger.logTrace(loggerCategory, `Dropped restore point ${name}`);
526
+ }
527
+ }
528
+ /**
529
+ * @internal
530
+ * Checks if a restore point with the specified name exists in the given briefcase database.
531
+ *
532
+ * @param db - The {@link BriefcaseDb} instance to search within.
533
+ * @param name - The name of the restore point to check for existence.
534
+ * @returns `true` if the restore point exists and its stash is present; otherwise, `false`.
535
+ */
536
+ static containsRestorePoint(db, name) {
537
+ Logger.logTrace(loggerCategory, `Checking if restore point ${name} exists`);
538
+ const key = this.makeRestorePointKey(name);
539
+ const restorePointId = db[_nativeDb].queryLocalValue(key);
540
+ if (!restorePointId) {
541
+ return false;
542
+ }
543
+ const stash = StashManager.tryGetStash({ db, stash: restorePointId });
544
+ if (!stash) {
545
+ Logger.logTrace(loggerCategory, `Restore point ${name} does not exist. Deleting ${key}`);
546
+ db[_nativeDb].deleteLocalValue(key);
547
+ return false;
548
+ }
549
+ return true;
550
+ }
551
+ static makeRestorePointKey(name) {
552
+ if (name.length === 0) {
553
+ throw new Error("Invalid restore point name");
554
+ }
555
+ return `restore_point/${name}`;
556
+ }
557
+ /**
558
+ * @internal
559
+ * Restores the state of a briefcase database to a previously saved restore point.
560
+ *
561
+ * @param db - The {@link BriefcaseDb} instance to restore.
562
+ * @param name - The name of the restore point to apply.
563
+ */
564
+ static async restorePoint(db, name) {
565
+ Logger.logTrace(loggerCategory, `Restoring to restore point ${name}`);
566
+ const restorePointId = db[_nativeDb].queryLocalValue(this.makeRestorePointKey(name));
567
+ if (!restorePointId) {
568
+ throw new Error(`Restore point not found: ${name}`);
569
+ }
570
+ await StashManager.restore({ db, stash: restorePointId });
571
+ Logger.logTrace(loggerCategory, `Restored to restore point ${name}`);
572
+ this.dropRestorePoint(db, name);
573
+ }
470
574
  /** create a changeset from the current changes, and push it to iModelHub */
471
575
  static async pushChanges(db, arg) {
472
576
  const changesetProps = db[_nativeDb].startCreateChangeset();
@@ -523,7 +627,11 @@ export class BriefcaseManager {
523
627
  await BriefcaseManager.pullAndApplyChangesets(db, arg);
524
628
  if (!db.skipSyncSchemasOnPullAndPush)
525
629
  await SchemaSync.pull(db);
526
- return await BriefcaseManager.pushChanges(db, arg);
630
+ // pullAndApply rebase changes and might remove redundant changes in local briefcase
631
+ // this mean hasPendingTxns was true before but now after pullAndApply it might be false
632
+ if (!db[_nativeDb].hasPendingTxns())
633
+ return;
634
+ await BriefcaseManager.pushChanges(db, arg);
527
635
  }
528
636
  catch (err) {
529
637
  if (retryCount-- <= 0 || err.errorNumber !== IModelHubStatus.PullIsRequired)