@itwin/core-backend 5.0.0-dev.99 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -1
- package/lib/cjs/BackendHubAccess.d.ts +1 -1
- package/lib/cjs/BackendHubAccess.js +1 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts +10 -2
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +12 -0
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CatalogDb.d.ts +103 -0
- package/lib/cjs/CatalogDb.d.ts.map +1 -0
- package/lib/cjs/CatalogDb.js +271 -0
- package/lib/cjs/CatalogDb.js.map +1 -0
- package/lib/cjs/Category.d.ts +41 -4
- package/lib/cjs/Category.d.ts.map +1 -1
- package/lib/cjs/Category.js +77 -4
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts +12 -10
- package/lib/cjs/CheckpointManager.d.ts.map +1 -1
- package/lib/cjs/CheckpointManager.js +17 -41
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts +1 -1
- package/lib/cjs/ClassRegistry.js +1 -1
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +104 -20
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js +157 -46
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +1 -1
- package/lib/cjs/CodeSpecs.js +1 -1
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +9 -4
- package/lib/cjs/DisplayStyle.d.ts.map +1 -1
- package/lib/cjs/DisplayStyle.js +30 -3
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +4 -4
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +4 -4
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.d.ts +1 -1
- package/lib/cjs/ECSchemaXmlContext.js +1 -1
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +6 -6
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +4 -4
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +217 -61
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +561 -60
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +8 -8
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +8 -8
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/Entity.d.ts +52 -8
- package/lib/cjs/Entity.d.ts.map +1 -1
- package/lib/cjs/Entity.js +63 -5
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/ExportGraphics.d.ts +54 -8
- package/lib/cjs/ExportGraphics.d.ts.map +1 -1
- package/lib/cjs/ExportGraphics.js +158 -59
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +42 -54
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +164 -93
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js +1 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +16 -3
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +9 -3
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/Material.d.ts +20 -1
- package/lib/cjs/Material.d.ts.map +1 -1
- package/lib/cjs/Material.js +30 -1
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +64 -28
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +115 -27
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeHost.d.ts.map +1 -1
- package/lib/cjs/NativeHost.js +4 -1
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +1 -1
- package/lib/cjs/SQLiteDb.d.ts.map +1 -1
- package/lib/cjs/SQLiteDb.js +6 -5
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/SqliteStatement.d.ts +1 -1
- package/lib/cjs/SqliteStatement.d.ts.map +1 -1
- package/lib/cjs/SqliteStatement.js +1 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/TextAnnotationElement.d.ts +2 -2
- package/lib/cjs/TextAnnotationElement.js +2 -2
- package/lib/cjs/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/Texture.d.ts +1 -1
- package/lib/cjs/Texture.js +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +4 -4
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +2 -1
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +114 -14
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +222 -14
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.js +3 -3
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.d.ts.map +1 -1
- package/lib/cjs/ViewStore.js +27 -27
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/core-backend.d.ts +1 -1
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +21 -1
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js +4 -4
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.d.ts +28 -0
- package/lib/cjs/internal/ElementLRUCache.d.ts.map +1 -0
- package/lib/cjs/internal/ElementLRUCache.js +120 -0
- package/lib/cjs/internal/ElementLRUCache.js.map +1 -0
- package/lib/cjs/{HubMock.d.ts → internal/HubMock.d.ts} +4 -5
- package/lib/cjs/internal/HubMock.d.ts.map +1 -0
- package/lib/cjs/{HubMock.js → internal/HubMock.js} +22 -11
- package/lib/cjs/internal/HubMock.js.map +1 -0
- package/lib/cjs/internal/Symbols.d.ts +2 -2
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +3 -3
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts +2 -16
- package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js +35 -104
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +3 -3
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +6 -13
- package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.d.ts +2 -7
- package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/lib/esm/BackendHubAccess.d.ts +1 -1
- package/lib/esm/BackendHubAccess.js +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BriefcaseManager.d.ts +10 -2
- package/lib/esm/BriefcaseManager.d.ts.map +1 -1
- package/lib/esm/BriefcaseManager.js +12 -0
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/CatalogDb.d.ts +103 -0
- package/lib/esm/CatalogDb.d.ts.map +1 -0
- package/lib/esm/CatalogDb.js +267 -0
- package/lib/esm/CatalogDb.js.map +1 -0
- package/lib/esm/Category.d.ts +41 -4
- package/lib/esm/Category.d.ts.map +1 -1
- package/lib/esm/Category.js +77 -4
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/CheckpointManager.d.ts +12 -10
- package/lib/esm/CheckpointManager.d.ts.map +1 -1
- package/lib/esm/CheckpointManager.js +18 -42
- package/lib/esm/CheckpointManager.js.map +1 -1
- package/lib/esm/ClassRegistry.d.ts +1 -1
- package/lib/esm/ClassRegistry.js +1 -1
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/CloudSqlite.d.ts +104 -20
- package/lib/esm/CloudSqlite.d.ts.map +1 -1
- package/lib/esm/CloudSqlite.js +157 -46
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeSpecs.d.ts +1 -1
- package/lib/esm/CodeSpecs.js +1 -1
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +9 -4
- package/lib/esm/DisplayStyle.d.ts.map +1 -1
- package/lib/esm/DisplayStyle.js +30 -3
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECDb.d.ts +4 -4
- package/lib/esm/ECDb.d.ts.map +1 -1
- package/lib/esm/ECDb.js +4 -4
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSchemaXmlContext.d.ts +1 -1
- package/lib/esm/ECSchemaXmlContext.js +1 -1
- package/lib/esm/ECSchemaXmlContext.js.map +1 -1
- package/lib/esm/ECSqlStatement.d.ts +6 -6
- package/lib/esm/ECSqlStatement.d.ts.map +1 -1
- package/lib/esm/ECSqlStatement.js +4 -4
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/Element.d.ts +217 -61
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +564 -63
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +8 -8
- package/lib/esm/ElementAspect.d.ts.map +1 -1
- package/lib/esm/ElementAspect.js +8 -8
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/Entity.d.ts +52 -8
- package/lib/esm/Entity.d.ts.map +1 -1
- package/lib/esm/Entity.js +63 -5
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/ExportGraphics.d.ts +54 -8
- package/lib/esm/ExportGraphics.d.ts.map +1 -1
- package/lib/esm/ExportGraphics.js +156 -58
- package/lib/esm/ExportGraphics.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +42 -54
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +167 -96
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/esm/IModelElementCloneContext.js +1 -1
- package/lib/esm/IModelElementCloneContext.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +16 -3
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +9 -3
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/Material.d.ts +20 -1
- package/lib/esm/Material.d.ts.map +1 -1
- package/lib/esm/Material.js +31 -2
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.d.ts +64 -28
- package/lib/esm/Model.d.ts.map +1 -1
- package/lib/esm/Model.js +116 -28
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/NativeHost.d.ts.map +1 -1
- package/lib/esm/NativeHost.js +4 -1
- package/lib/esm/NativeHost.js.map +1 -1
- package/lib/esm/SQLiteDb.d.ts +1 -1
- package/lib/esm/SQLiteDb.d.ts.map +1 -1
- package/lib/esm/SQLiteDb.js +6 -5
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/SqliteStatement.d.ts +1 -1
- package/lib/esm/SqliteStatement.d.ts.map +1 -1
- package/lib/esm/SqliteStatement.js +1 -1
- package/lib/esm/SqliteStatement.js.map +1 -1
- package/lib/esm/TextAnnotationElement.d.ts +2 -2
- package/lib/esm/TextAnnotationElement.js +2 -2
- package/lib/esm/TextAnnotationElement.js.map +1 -1
- package/lib/esm/Texture.d.ts +1 -1
- package/lib/esm/Texture.js +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +4 -4
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +2 -1
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +114 -14
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +223 -15
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/ViewStateHydrator.js +3 -3
- package/lib/esm/ViewStateHydrator.js.map +1 -1
- package/lib/esm/ViewStore.d.ts.map +1 -1
- package/lib/esm/ViewStore.js +28 -28
- package/lib/esm/ViewStore.js.map +1 -1
- package/lib/esm/core-backend.d.ts +1 -1
- package/lib/esm/core-backend.d.ts.map +1 -1
- package/lib/esm/core-backend.js +21 -1
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js +5 -5
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/internal/ElementLRUCache.d.ts +28 -0
- package/lib/esm/internal/ElementLRUCache.d.ts.map +1 -0
- package/lib/esm/internal/ElementLRUCache.js +116 -0
- package/lib/esm/internal/ElementLRUCache.js.map +1 -0
- package/lib/esm/{HubMock.d.ts → internal/HubMock.d.ts} +4 -5
- package/lib/esm/internal/HubMock.d.ts.map +1 -0
- package/lib/esm/{HubMock.js → internal/HubMock.js} +22 -11
- package/lib/esm/internal/HubMock.js.map +1 -0
- package/lib/esm/internal/Symbols.d.ts +2 -2
- package/lib/esm/internal/Symbols.d.ts.map +1 -1
- package/lib/esm/internal/Symbols.js +2 -2
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.d.ts +2 -16
- package/lib/esm/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js +36 -100
- package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.d.ts +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js +3 -3
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/esm/test/ElementLRUCache.test.d.ts +2 -0
- package/lib/esm/test/ElementLRUCache.test.d.ts.map +1 -0
- package/lib/esm/test/ElementLRUCache.test.js +212 -0
- package/lib/esm/test/ElementLRUCache.test.js.map +1 -0
- package/lib/esm/test/IModelTestUtils.d.ts +6 -2
- package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
- package/lib/esm/test/IModelTestUtils.js +27 -6
- package/lib/esm/test/IModelTestUtils.js.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.js +1 -1
- package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
- package/lib/esm/test/TestUtils.d.ts +1 -1
- package/lib/esm/test/TestUtils.d.ts.map +1 -1
- package/lib/esm/test/TestUtils.js +1 -1
- package/lib/esm/test/TestUtils.js.map +1 -1
- package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js +4 -4
- package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js +0 -23
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/font/IModelDbFonts.test.js +1 -1
- package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js +1 -1
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/CheckpointManager.test.js +4 -3
- package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +51 -13
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/ExportGraphics.test.js +58 -41
- package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryStream.test.js +49 -1
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/HubMock.test.js +1 -1
- package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelLimits.test.d.ts +2 -0
- package/lib/esm/test/standalone/IModelLimits.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/IModelLimits.test.js +103 -0
- package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -0
- package/lib/esm/test/standalone/IModelWrite.test.js +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.js +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
- package/lib/esm/test/standalone/ServerBasedLocks.test.js +1 -1
- package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js +25 -5
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/lib/esm/test/standalone/Workspace.test.js +4 -3
- package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
- package/lib/esm/workspace/Workspace.d.ts +6 -13
- package/lib/esm/workspace/Workspace.d.ts.map +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.d.ts +2 -7
- package/lib/esm/workspace/WorkspaceEditor.d.ts.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +13 -13
- package/lib/cjs/HubMock.d.ts.map +0 -1
- package/lib/cjs/HubMock.js.map +0 -1
- package/lib/esm/HubMock.d.ts.map +0 -1
- package/lib/esm/HubMock.js.map +0 -1
- package/lib/esm/test/CloudSqliteMock.d.ts +0 -37
- package/lib/esm/test/CloudSqliteMock.d.ts.map +0 -1
- package/lib/esm/test/CloudSqliteMock.js +0 -117
- package/lib/esm/test/CloudSqliteMock.js.map +0 -1
package/lib/cjs/IModelDb.js
CHANGED
|
@@ -50,6 +50,7 @@ const IModelDbFontsImpl_1 = require("./internal/IModelDbFontsImpl");
|
|
|
50
50
|
const Symbols_1 = require("./internal/Symbols");
|
|
51
51
|
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
52
52
|
const Schema_1 = require("./Schema");
|
|
53
|
+
const ElementLRUCache_1 = require("./internal/ElementLRUCache");
|
|
53
54
|
// spell:ignore fontid fontmap
|
|
54
55
|
const loggerCategory = BackendLoggerCategory_1.BackendLoggerCategory.IModelDb;
|
|
55
56
|
/** @internal */
|
|
@@ -109,7 +110,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
109
110
|
_jsClassMap;
|
|
110
111
|
_schemaMap;
|
|
111
112
|
_schemaContext;
|
|
112
|
-
/** @deprecated in 5.0.0. Use [[fonts]]. */
|
|
113
|
+
/** @deprecated in 5.0.0 - will not be removed until after 2026-06-13. Use [[fonts]]. */
|
|
113
114
|
_fontMap; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
114
115
|
_fonts = (0, IModelDbFontsImpl_1.createIModelDbFonts)(this);
|
|
115
116
|
_workspace;
|
|
@@ -136,6 +137,13 @@ class IModelDb extends core_common_1.IModel {
|
|
|
136
137
|
this._workspace = (0, WorkspaceImpl_1.constructWorkspace)(new IModelSettings());
|
|
137
138
|
return this._workspace;
|
|
138
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* get the cloud container for this iModel, if it was opened from one
|
|
142
|
+
* @beta
|
|
143
|
+
*/
|
|
144
|
+
get cloudContainer() {
|
|
145
|
+
return this[Symbols_1._nativeDb].cloudContainer;
|
|
146
|
+
}
|
|
139
147
|
/** Acquire the exclusive schema lock on this iModel.
|
|
140
148
|
* @note: To acquire the schema lock, all other briefcases must first release *all* their locks. No other briefcases
|
|
141
149
|
* will be able to acquire *any* locks while the schema lock is held.
|
|
@@ -158,7 +166,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
158
166
|
restartDefaultTxn() {
|
|
159
167
|
this[Symbols_1._nativeDb].restartDefaultTxn();
|
|
160
168
|
}
|
|
161
|
-
/** @deprecated in 5.0.0. Use [[fonts]]. */
|
|
169
|
+
/** @deprecated in 5.0.0 - will not be removed until after 2026-06-13. Use [[fonts]]. */
|
|
162
170
|
get fontMap() {
|
|
163
171
|
return this._fontMap ?? (this._fontMap = new core_common_1.FontMap(this[Symbols_1._nativeDb].readFontMap())); // eslint-disable-line @typescript-eslint/no-deprecated
|
|
164
172
|
}
|
|
@@ -335,7 +343,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
335
343
|
* @returns the value returned by `callback`.
|
|
336
344
|
* @see [[withStatement]]
|
|
337
345
|
* @public
|
|
338
|
-
* @deprecated in 4.11. Use [[createQueryReader]] instead.
|
|
346
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [[createQueryReader]] instead.
|
|
339
347
|
*/
|
|
340
348
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
341
349
|
withPreparedStatement(ecsql, callback, logErrors = true) {
|
|
@@ -367,7 +375,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
367
375
|
* @returns the value returned by `callback`.
|
|
368
376
|
* @see [[withPreparedStatement]]
|
|
369
377
|
* @public
|
|
370
|
-
* @deprecated in 4.11. Use [[createQueryReader]] instead.
|
|
378
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [[createQueryReader]] instead.
|
|
371
379
|
*/
|
|
372
380
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
373
381
|
withStatement(ecsql, callback, logErrors = true) {
|
|
@@ -572,6 +580,8 @@ class IModelDb extends core_common_1.IModel {
|
|
|
572
580
|
this._jsClassMap = undefined;
|
|
573
581
|
this._schemaMap = undefined;
|
|
574
582
|
this._schemaContext = undefined;
|
|
583
|
+
this.elements[Symbols_1._cache].clear();
|
|
584
|
+
this.models[Symbols_1._cache].clear();
|
|
575
585
|
}
|
|
576
586
|
/** Update the project extents for this iModel.
|
|
577
587
|
* <p><em>Example:</em>
|
|
@@ -627,6 +637,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
627
637
|
* @note This will not delete Txns that have already been saved, even if they have not yet been pushed.
|
|
628
638
|
*/
|
|
629
639
|
abandonChanges() {
|
|
640
|
+
this.clearCaches();
|
|
630
641
|
this[Symbols_1._nativeDb].abandonChanges();
|
|
631
642
|
}
|
|
632
643
|
/**
|
|
@@ -640,11 +651,14 @@ class IModelDb extends core_common_1.IModel {
|
|
|
640
651
|
performCheckpoint() {
|
|
641
652
|
if (!this.isReadonly) {
|
|
642
653
|
this.saveChanges();
|
|
654
|
+
this.clearCaches();
|
|
655
|
+
this[Symbols_1._nativeDb].concurrentQueryShutdown();
|
|
656
|
+
this[Symbols_1._nativeDb].clearECDbCache();
|
|
643
657
|
this[Symbols_1._nativeDb].performCheckpoint();
|
|
644
658
|
}
|
|
645
659
|
}
|
|
646
660
|
/** @internal
|
|
647
|
-
* @deprecated in 4.8. Use `txns.reverseTxns`.
|
|
661
|
+
* @deprecated in 4.8 - will not be removed until after 2026-06-13. Use `txns.reverseTxns`.
|
|
648
662
|
*/
|
|
649
663
|
reverseTxns(numOperations) {
|
|
650
664
|
return this[Symbols_1._nativeDb].reverseTxns(numOperations);
|
|
@@ -870,7 +884,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
870
884
|
}
|
|
871
885
|
/** The registry of entity metadata for this iModel.
|
|
872
886
|
* @internal
|
|
873
|
-
* @deprecated in 5.0. Please use `schemaContext` from the `iModel` instead.
|
|
887
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `schemaContext` from the `iModel` instead.
|
|
874
888
|
*
|
|
875
889
|
* @example
|
|
876
890
|
* ```typescript
|
|
@@ -906,7 +920,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
906
920
|
}
|
|
907
921
|
/**
|
|
908
922
|
* Gets the context that allows accessing the metadata (ecschema-metadata package) of this iModel
|
|
909
|
-
* @
|
|
923
|
+
* @public @preview
|
|
910
924
|
*/
|
|
911
925
|
get schemaContext() {
|
|
912
926
|
if (this._schemaContext === undefined) {
|
|
@@ -930,7 +944,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
930
944
|
* @param sql The ECSQL statement to prepare
|
|
931
945
|
* @param logErrors Determines if error will be logged if statement fail to prepare
|
|
932
946
|
* @throws [[IModelError]] if there is a problem preparing the statement.
|
|
933
|
-
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
947
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
934
948
|
*/
|
|
935
949
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
936
950
|
prepareStatement(sql, logErrors = true) {
|
|
@@ -942,7 +956,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
942
956
|
/** Prepare an ECSQL statement.
|
|
943
957
|
* @param sql The ECSQL statement to prepare
|
|
944
958
|
* @returns `undefined` if there is a problem preparing the statement.
|
|
945
|
-
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
959
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
946
960
|
*/
|
|
947
961
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
948
962
|
tryPrepareStatement(sql) {
|
|
@@ -972,9 +986,27 @@ class IModelDb extends core_common_1.IModel {
|
|
|
972
986
|
return ClassRegistry_1.ClassRegistry.getClass(classFullName, this);
|
|
973
987
|
}
|
|
974
988
|
}
|
|
989
|
+
/** Constructs a ResolveInstanceKeyArgs from given parameters
|
|
990
|
+
* @throws [[IModelError]] if the combination of supplied parameters is invalid.
|
|
991
|
+
* @internal
|
|
992
|
+
*/
|
|
993
|
+
getInstanceArgs(instanceId, baseClassName, federationGuid, code) {
|
|
994
|
+
if (instanceId && baseClassName) {
|
|
995
|
+
return { partialKey: { id: instanceId, baseClassName } };
|
|
996
|
+
}
|
|
997
|
+
else if (federationGuid) {
|
|
998
|
+
return { federationGuid };
|
|
999
|
+
}
|
|
1000
|
+
else if (code) {
|
|
1001
|
+
return { code };
|
|
1002
|
+
}
|
|
1003
|
+
else {
|
|
1004
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.InvalidId, "Either instanceId and baseClassName or federationGuid or code must be specified");
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
975
1007
|
/** Get metadata for a class. This method will load the metadata from the iModel into the cache as a side-effect, if necessary.
|
|
976
1008
|
* @throws [[IModelError]] if the metadata cannot be found nor loaded.
|
|
977
|
-
* @deprecated in 5.0. Please use `getSchemaItem` from `SchemaContext` class instead.
|
|
1009
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `getSchemaItem` from `SchemaContext` class instead.
|
|
978
1010
|
*
|
|
979
1011
|
* @example
|
|
980
1012
|
* * ```typescript
|
|
@@ -1000,7 +1032,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1000
1032
|
return metadata;
|
|
1001
1033
|
}
|
|
1002
1034
|
/** Identical to [[getMetaData]], except it returns `undefined` instead of throwing an error if the metadata cannot be found nor loaded.
|
|
1003
|
-
* @deprecated in 5.0. Please use `getSchemaItem` from `SchemaContext` class instead.
|
|
1035
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `getSchemaItem` from `SchemaContext` class instead.
|
|
1004
1036
|
*
|
|
1005
1037
|
* @example
|
|
1006
1038
|
* * ```typescript
|
|
@@ -1028,7 +1060,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1028
1060
|
* @param func The callback to be invoked on each property
|
|
1029
1061
|
* @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
|
|
1030
1062
|
* @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
|
|
1031
|
-
* @deprecated in 5.0. Please use `forEachProperty` instead.
|
|
1063
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `forEachProperty` instead.
|
|
1032
1064
|
*
|
|
1033
1065
|
* @example
|
|
1034
1066
|
* ```typescript
|
|
@@ -1054,7 +1086,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1054
1086
|
* @param func The callback to be invoked on each property
|
|
1055
1087
|
* @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
|
|
1056
1088
|
* @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
|
|
1057
|
-
* @deprecated in 5.0. Use `forEachProperty` from `SchemaContext` class instead.
|
|
1089
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `forEachProperty` from `SchemaContext` class instead.
|
|
1058
1090
|
*
|
|
1059
1091
|
* @example
|
|
1060
1092
|
* ```typescript
|
|
@@ -1084,7 +1116,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1084
1116
|
}
|
|
1085
1117
|
/**
|
|
1086
1118
|
* @internal
|
|
1087
|
-
* @deprecated in 5.0. Please use `schemaContext` from `iModel` instead to get metadata.
|
|
1119
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `schemaContext` from `iModel` instead to get metadata.
|
|
1088
1120
|
*/
|
|
1089
1121
|
loadMetaData(classFullName) {
|
|
1090
1122
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -1450,11 +1482,13 @@ function processSchemaWriteStatus(status) {
|
|
|
1450
1482
|
/** @public */
|
|
1451
1483
|
(function (IModelDb) {
|
|
1452
1484
|
/** The collection of models in an [[IModelDb]].
|
|
1453
|
-
* @public
|
|
1485
|
+
* @public @preview
|
|
1454
1486
|
*/
|
|
1455
1487
|
class Models {
|
|
1456
1488
|
_iModel;
|
|
1457
1489
|
/** @internal */
|
|
1490
|
+
[Symbols_1._cache] = new core_bentley_1.LRUMap(500);
|
|
1491
|
+
/** @internal */
|
|
1458
1492
|
constructor(_iModel) {
|
|
1459
1493
|
this._iModel = _iModel;
|
|
1460
1494
|
}
|
|
@@ -1464,7 +1498,10 @@ function processSchemaWriteStatus(status) {
|
|
|
1464
1498
|
* @see tryGetModelProps
|
|
1465
1499
|
*/
|
|
1466
1500
|
getModelProps(id) {
|
|
1467
|
-
|
|
1501
|
+
const model = this.tryGetModelProps(id);
|
|
1502
|
+
if (undefined === model)
|
|
1503
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `Model=${id}`);
|
|
1504
|
+
return model;
|
|
1468
1505
|
}
|
|
1469
1506
|
/** Get the ModelProps with the specified identifier.
|
|
1470
1507
|
* @param modelId The Model identifier.
|
|
@@ -1474,7 +1511,25 @@ function processSchemaWriteStatus(status) {
|
|
|
1474
1511
|
* @see getModelProps
|
|
1475
1512
|
*/
|
|
1476
1513
|
tryGetModelProps(id) {
|
|
1477
|
-
|
|
1514
|
+
try {
|
|
1515
|
+
if (IModelHost_1.IModelHost.configuration?.disableThinnedNativeInstanceWorkflow) {
|
|
1516
|
+
return this._iModel[Symbols_1._nativeDb].getModel({ id });
|
|
1517
|
+
}
|
|
1518
|
+
const cachedMdl = this[Symbols_1._cache].get(id);
|
|
1519
|
+
if (cachedMdl) {
|
|
1520
|
+
return cachedMdl;
|
|
1521
|
+
}
|
|
1522
|
+
const options = { useJsNames: true };
|
|
1523
|
+
const instanceKey = this.resolveModelKey({ id });
|
|
1524
|
+
const rawInstance = this._iModel[Symbols_1._nativeDb].readInstance(instanceKey, options);
|
|
1525
|
+
const classDef = this._iModel.getJsClass(rawInstance.classFullName);
|
|
1526
|
+
const modelProps = classDef.deserialize({ row: rawInstance, iModel: this._iModel });
|
|
1527
|
+
this[Symbols_1._cache].set(id, modelProps);
|
|
1528
|
+
return modelProps;
|
|
1529
|
+
}
|
|
1530
|
+
catch {
|
|
1531
|
+
return undefined;
|
|
1532
|
+
}
|
|
1478
1533
|
}
|
|
1479
1534
|
/** Query for the last modified time for a [[Model]].
|
|
1480
1535
|
* @param modelId The Id of the model.
|
|
@@ -1521,32 +1576,22 @@ function processSchemaWriteStatus(status) {
|
|
|
1521
1576
|
return model; // modelClass was not specified, cannot call instanceof to validate
|
|
1522
1577
|
return model instanceof modelClass ? model : undefined;
|
|
1523
1578
|
}
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
* @internal
|
|
1530
|
-
*/
|
|
1531
|
-
getModelJson(modelIdArg) {
|
|
1532
|
-
const modelJson = this.tryGetModelJson(modelIdArg);
|
|
1533
|
-
if (undefined === modelJson) {
|
|
1534
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `Model=(id: ${modelIdArg.id}, code: ${modelIdArg.code})`);
|
|
1579
|
+
resolveModelKey(modelIdArg) {
|
|
1580
|
+
const baseClassName = "BisCore:Model";
|
|
1581
|
+
let args;
|
|
1582
|
+
if (modelIdArg.id) {
|
|
1583
|
+
args = { partialKey: { id: modelIdArg.id, baseClassName } };
|
|
1535
1584
|
}
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
* @see getModelJson
|
|
1542
|
-
*/
|
|
1543
|
-
tryGetModelJson(modelIdArg) {
|
|
1544
|
-
try {
|
|
1545
|
-
return this._iModel[Symbols_1._nativeDb].getModel(modelIdArg);
|
|
1585
|
+
else if (modelIdArg.code) {
|
|
1586
|
+
const modelId = this._iModel.elements.getElementProps({ code: modelIdArg.code }).id;
|
|
1587
|
+
if (!modelId)
|
|
1588
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `Model not found with code: [spec:${modelIdArg.code.spec}, scope:${modelIdArg.code.scope}, value:${modelIdArg.code.value}])`);
|
|
1589
|
+
args = { partialKey: { id: modelId, baseClassName } };
|
|
1546
1590
|
}
|
|
1547
|
-
|
|
1548
|
-
|
|
1591
|
+
else {
|
|
1592
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.InvalidId, `Invalid model identifier: ${JSON.stringify(modelIdArg)}`);
|
|
1549
1593
|
}
|
|
1594
|
+
return this._iModel[Symbols_1._nativeDb].resolveInstanceKey(args);
|
|
1550
1595
|
}
|
|
1551
1596
|
/** Get the sub-model of the specified Element.
|
|
1552
1597
|
* See [[IModelDb.Elements.queryElementIdByCode]] for more on how to find an element by Code.
|
|
@@ -1599,6 +1644,8 @@ function processSchemaWriteStatus(status) {
|
|
|
1599
1644
|
*/
|
|
1600
1645
|
updateModel(props) {
|
|
1601
1646
|
try {
|
|
1647
|
+
if (props.id)
|
|
1648
|
+
this[Symbols_1._cache].delete(props.id);
|
|
1602
1649
|
this._iModel[Symbols_1._nativeDb].updateModel(props);
|
|
1603
1650
|
}
|
|
1604
1651
|
catch (err) {
|
|
@@ -1615,6 +1662,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1615
1662
|
* @see [[TxnManager.onModelGeometryChanged]] for the event emitted in response to such a change.
|
|
1616
1663
|
*/
|
|
1617
1664
|
updateGeometryGuid(modelId) {
|
|
1665
|
+
this._iModel.models[Symbols_1._cache].delete(modelId);
|
|
1618
1666
|
const error = this._iModel[Symbols_1._nativeDb].updateModelGeometryGuid(modelId);
|
|
1619
1667
|
if (error !== core_bentley_1.IModelStatus.Success)
|
|
1620
1668
|
throw new core_common_1.IModelError(error, `updating geometry guid for model ${modelId}`);
|
|
@@ -1626,6 +1674,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1626
1674
|
deleteModel(ids) {
|
|
1627
1675
|
core_bentley_1.Id64.toIdSet(ids).forEach((id) => {
|
|
1628
1676
|
try {
|
|
1677
|
+
this[Symbols_1._cache].delete(id);
|
|
1629
1678
|
this._iModel[Symbols_1._nativeDb].deleteModel(id);
|
|
1630
1679
|
}
|
|
1631
1680
|
catch (err) {
|
|
@@ -1659,11 +1708,13 @@ function processSchemaWriteStatus(status) {
|
|
|
1659
1708
|
}
|
|
1660
1709
|
IModelDb.Models = Models;
|
|
1661
1710
|
/** The collection of elements in an [[IModelDb]].
|
|
1662
|
-
* @public
|
|
1711
|
+
* @public @preview
|
|
1663
1712
|
*/
|
|
1664
1713
|
class Elements {
|
|
1665
1714
|
_iModel;
|
|
1666
1715
|
/** @internal */
|
|
1716
|
+
[Symbols_1._cache] = new ElementLRUCache_1.ElementLRUCache();
|
|
1717
|
+
/** @internal */
|
|
1667
1718
|
constructor(_iModel) {
|
|
1668
1719
|
this._iModel = _iModel;
|
|
1669
1720
|
}
|
|
@@ -1679,50 +1730,40 @@ function processSchemaWriteStatus(status) {
|
|
|
1679
1730
|
return !stmt.nextRow() ? undefined : stmt.getValueId(0);
|
|
1680
1731
|
}) : undefined;
|
|
1681
1732
|
}
|
|
1682
|
-
/** Read element data from the iModel as JSON
|
|
1683
|
-
* @param elementIdArg a json string with the identity of the element to load. Must have one of "id", "federationGuid", or "code".
|
|
1684
|
-
* @returns The JSON properties of the element.
|
|
1685
|
-
* @throws [[IModelError]] if the element is not found or cannot be loaded.
|
|
1686
|
-
* @see tryGetElementJson
|
|
1687
|
-
* @internal
|
|
1688
|
-
*/
|
|
1689
|
-
getElementJson(elementId) {
|
|
1690
|
-
const elementProps = this.tryGetElementJson(elementId);
|
|
1691
|
-
if (undefined === elementProps)
|
|
1692
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `reading element={id: ${elementId.id} federationGuid: ${elementId.federationGuid}, code: ${elementId.code}}`);
|
|
1693
|
-
return elementProps;
|
|
1694
|
-
}
|
|
1695
|
-
/** Read element data from the iModel as JSON
|
|
1696
|
-
* @param loadProps - a json string with the identity of the element to load. Must have one of "id", "federationGuid", or "code".
|
|
1697
|
-
* @returns The JSON properties of the element or `undefined` if the element is not found.
|
|
1698
|
-
* @throws [[IModelError]] if the element exists, but cannot be loaded.
|
|
1699
|
-
* @see getElementJson
|
|
1700
|
-
*/
|
|
1701
|
-
tryGetElementJson(loadProps) {
|
|
1702
|
-
try {
|
|
1703
|
-
return this._iModel[Symbols_1._nativeDb].getElement(loadProps);
|
|
1704
|
-
}
|
|
1705
|
-
catch {
|
|
1706
|
-
return undefined;
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
1733
|
/** Get properties of an Element by Id, FederationGuid, or Code
|
|
1710
1734
|
* @throws [[IModelError]] if the element is not found or cannot be loaded.
|
|
1711
1735
|
* @see tryGetElementProps
|
|
1712
1736
|
*/
|
|
1713
1737
|
getElementProps(props) {
|
|
1738
|
+
const elProp = this.tryGetElementProps(props);
|
|
1739
|
+
if (undefined === elProp)
|
|
1740
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `element not found`);
|
|
1741
|
+
return elProp;
|
|
1742
|
+
}
|
|
1743
|
+
resolveElementKey(props) {
|
|
1744
|
+
const baseClassName = "BisCore:Element";
|
|
1745
|
+
let args;
|
|
1714
1746
|
if (typeof props === "string") {
|
|
1715
|
-
|
|
1747
|
+
args = core_bentley_1.Id64.isId64(props) ? { partialKey: { id: props, baseClassName } } : { federationGuid: props };
|
|
1716
1748
|
}
|
|
1717
1749
|
else if (props instanceof core_common_1.Code) {
|
|
1718
|
-
|
|
1750
|
+
args = { code: props };
|
|
1719
1751
|
}
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1752
|
+
else {
|
|
1753
|
+
if (props.id) {
|
|
1754
|
+
args = { partialKey: { id: props.id, baseClassName } };
|
|
1755
|
+
}
|
|
1756
|
+
else if (props.federationGuid) {
|
|
1757
|
+
args = { federationGuid: props.federationGuid };
|
|
1758
|
+
}
|
|
1759
|
+
else if (props.code) {
|
|
1760
|
+
args = { code: props.code };
|
|
1761
|
+
}
|
|
1762
|
+
else {
|
|
1763
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.InvalidId, "Element Id or FederationGuid or Code is required");
|
|
1764
|
+
}
|
|
1725
1765
|
}
|
|
1766
|
+
return this._iModel[Symbols_1._nativeDb].resolveInstanceKey(args);
|
|
1726
1767
|
}
|
|
1727
1768
|
/** Get properties of an Element by Id, FederationGuid, or Code
|
|
1728
1769
|
* @returns The properties of the element or `undefined` if the element is not found.
|
|
@@ -1730,14 +1771,32 @@ function processSchemaWriteStatus(status) {
|
|
|
1730
1771
|
* @note Useful for cases when an element may or may not exist and throwing an `Error` would be overkill.
|
|
1731
1772
|
* @see getElementProps
|
|
1732
1773
|
*/
|
|
1733
|
-
tryGetElementProps(
|
|
1734
|
-
if (typeof
|
|
1735
|
-
|
|
1774
|
+
tryGetElementProps(props) {
|
|
1775
|
+
if (typeof props === "string") {
|
|
1776
|
+
props = core_bentley_1.Id64.isId64(props) ? { id: props } : { federationGuid: props };
|
|
1736
1777
|
}
|
|
1737
|
-
else if (
|
|
1738
|
-
|
|
1778
|
+
else if (props instanceof core_common_1.Code) {
|
|
1779
|
+
props = { code: props };
|
|
1780
|
+
}
|
|
1781
|
+
try {
|
|
1782
|
+
if (IModelHost_1.IModelHost.configuration?.disableThinnedNativeInstanceWorkflow) {
|
|
1783
|
+
return this._iModel[Symbols_1._nativeDb].getElement(props);
|
|
1784
|
+
}
|
|
1785
|
+
const cachedElm = this[Symbols_1._cache].get(props);
|
|
1786
|
+
if (cachedElm) {
|
|
1787
|
+
return cachedElm.elProps;
|
|
1788
|
+
}
|
|
1789
|
+
const options = { ...props, useJsNames: true };
|
|
1790
|
+
const instanceKey = this.resolveElementKey(props);
|
|
1791
|
+
const rawInstance = this._iModel[Symbols_1._nativeDb].readInstance(instanceKey, options);
|
|
1792
|
+
const classDef = this._iModel.getJsClass(rawInstance.classFullName);
|
|
1793
|
+
const elementProps = classDef.deserialize({ row: rawInstance, iModel: this._iModel, options: { element: props } });
|
|
1794
|
+
this[Symbols_1._cache].set({ elProps: elementProps, loadOptions: props });
|
|
1795
|
+
return elementProps;
|
|
1796
|
+
}
|
|
1797
|
+
catch {
|
|
1798
|
+
return undefined;
|
|
1739
1799
|
}
|
|
1740
|
-
return this.tryGetElementJson(elementId);
|
|
1741
1800
|
}
|
|
1742
1801
|
/** Get an element by Id, FederationGuid, or Code
|
|
1743
1802
|
* @param elementId either the element's Id, Code, or FederationGuid, or an ElementLoadProps
|
|
@@ -1770,7 +1829,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1770
1829
|
elementId = { code: elementId };
|
|
1771
1830
|
else
|
|
1772
1831
|
elementId.onlyBaseProperties = false; // we must load all properties to construct the element.
|
|
1773
|
-
const elementProps = this.
|
|
1832
|
+
const elementProps = this.tryGetElementProps(elementId);
|
|
1774
1833
|
if (undefined === elementProps)
|
|
1775
1834
|
return undefined; // no Element with that elementId found
|
|
1776
1835
|
const element = this._iModel.constructEntity(elementProps);
|
|
@@ -1834,6 +1893,11 @@ function processSchemaWriteStatus(status) {
|
|
|
1834
1893
|
*/
|
|
1835
1894
|
insertElement(elProps, options) {
|
|
1836
1895
|
try {
|
|
1896
|
+
this[Symbols_1._cache].delete({
|
|
1897
|
+
id: elProps.id,
|
|
1898
|
+
federationGuid: elProps.federationGuid,
|
|
1899
|
+
code: elProps.code,
|
|
1900
|
+
});
|
|
1837
1901
|
return elProps.id = this._iModel[Symbols_1._nativeDb].insertElement(elProps, options);
|
|
1838
1902
|
}
|
|
1839
1903
|
catch (err) {
|
|
@@ -1855,6 +1919,11 @@ function processSchemaWriteStatus(status) {
|
|
|
1855
1919
|
*/
|
|
1856
1920
|
updateElement(elProps) {
|
|
1857
1921
|
try {
|
|
1922
|
+
this[Symbols_1._cache].delete({
|
|
1923
|
+
id: elProps.id,
|
|
1924
|
+
federationGuid: elProps.federationGuid,
|
|
1925
|
+
code: elProps.code,
|
|
1926
|
+
});
|
|
1858
1927
|
this._iModel[Symbols_1._nativeDb].updateElement(elProps);
|
|
1859
1928
|
}
|
|
1860
1929
|
catch (err) {
|
|
@@ -1872,6 +1941,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1872
1941
|
const iModel = this._iModel;
|
|
1873
1942
|
core_bentley_1.Id64.toIdSet(ids).forEach((id) => {
|
|
1874
1943
|
try {
|
|
1944
|
+
this[Symbols_1._cache].delete({ id });
|
|
1875
1945
|
iModel[Symbols_1._nativeDb].deleteElement(id);
|
|
1876
1946
|
}
|
|
1877
1947
|
catch (err) {
|
|
@@ -2184,7 +2254,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2184
2254
|
}
|
|
2185
2255
|
IModelDb.Elements = Elements;
|
|
2186
2256
|
/** The collection of views in an [[IModelDb]].
|
|
2187
|
-
* @public
|
|
2257
|
+
* @public @preview
|
|
2188
2258
|
*/
|
|
2189
2259
|
class Views {
|
|
2190
2260
|
_iModel;
|
|
@@ -2360,7 +2430,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2360
2430
|
}
|
|
2361
2431
|
/** Set the default view property the iModel.
|
|
2362
2432
|
* @param viewId The Id of the ViewDefinition to use as the default
|
|
2363
|
-
* @deprecated in 4.2.x. Avoid setting this property - it is not practical for one single view to serve the needs of the many applications
|
|
2433
|
+
* @deprecated in 4.2.x - will not be removed until after 2026-06-13. Avoid setting this property - it is not practical for one single view to serve the needs of the many applications
|
|
2364
2434
|
* that might wish to view the contents of the iModel.
|
|
2365
2435
|
*/
|
|
2366
2436
|
setDefaultViewId(viewId) {
|
|
@@ -2374,9 +2444,9 @@ function processSchemaWriteStatus(status) {
|
|
|
2374
2444
|
}
|
|
2375
2445
|
IModelDb.Views = Views;
|
|
2376
2446
|
/** Represents the current state of a pollable tile content request.
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2447
|
+
* Note: lack of a "completed" state because polling a completed request returns the content as a Uint8Array.
|
|
2448
|
+
* @internal
|
|
2449
|
+
*/
|
|
2380
2450
|
let TileContentState;
|
|
2381
2451
|
(function (TileContentState) {
|
|
2382
2452
|
TileContentState[TileContentState["New"] = 0] = "New";
|
|
@@ -2616,7 +2686,7 @@ class BriefcaseDb extends IModelDb {
|
|
|
2616
2686
|
const file = { path: args.fileName, key: args.key };
|
|
2617
2687
|
const openMode = (args.readonly || args.watchForChanges) ? core_bentley_1.OpenMode.Readonly : core_bentley_1.OpenMode.ReadWrite;
|
|
2618
2688
|
const nativeDb = this.openDgnDb(file, openMode, undefined, args);
|
|
2619
|
-
const briefcaseDb = new
|
|
2689
|
+
const briefcaseDb = new this({ nativeDb, key: file.key ?? core_bentley_1.Guid.createValue(), openMode, briefcaseId: nativeDb.getBriefcaseId() });
|
|
2620
2690
|
// If they asked to watch for changes, set an fs.watch on the "-watch" file (only it is modified while we hold this connection.)
|
|
2621
2691
|
// Whenever there are changes, restart our defaultTxn. That loads the changes from the other connection and sends
|
|
2622
2692
|
// notifications as if they happened on this connection. Note: the watcher is called only when the backend event loop cycles.
|
|
@@ -2625,6 +2695,7 @@ class BriefcaseDb extends IModelDb {
|
|
|
2625
2695
|
touch.sync(briefcaseDb.watchFilePathName);
|
|
2626
2696
|
// Restart default txn to trigger events when watch file is changed by some other process.
|
|
2627
2697
|
const watcher = fs.watch(briefcaseDb.watchFilePathName, { persistent: false }, () => {
|
|
2698
|
+
nativeDb.clearECDbCache();
|
|
2628
2699
|
nativeDb.restartDefaultTxn();
|
|
2629
2700
|
briefcaseDb.changeset = briefcaseDb[Symbols_1._nativeDb].getCurrentChangeset();
|
|
2630
2701
|
});
|
|
@@ -2965,7 +3036,7 @@ class RefreshV2CheckpointSas {
|
|
|
2965
3036
|
core_bentley_1.Logger.logInfo(BackendLoggerCategory_1.BackendLoggerCategory.Authorization, "attempting to refresh sasToken for checkpoint");
|
|
2966
3037
|
try {
|
|
2967
3038
|
// this exchanges the supplied user accessToken for an expiring blob-store token to read the checkpoint.
|
|
2968
|
-
const container = iModel
|
|
3039
|
+
const container = iModel.cloudContainer;
|
|
2969
3040
|
if (!container)
|
|
2970
3041
|
throw new Error("checkpoint is not from a cloud container");
|
|
2971
3042
|
(0, core_bentley_1.assert)(undefined !== iModel.iTwinId);
|
|
@@ -3091,7 +3162,7 @@ class SnapshotDb extends IModelDb {
|
|
|
3091
3162
|
file.key = `${nativeDb.getIModelId()}:${nativeDb.getCurrentChangeset().id}`;
|
|
3092
3163
|
}
|
|
3093
3164
|
(0, core_bentley_1.assert)(undefined !== file.key);
|
|
3094
|
-
const db = new
|
|
3165
|
+
const db = new this(nativeDb, file.key);
|
|
3095
3166
|
this.onOpened.raiseEvent(db);
|
|
3096
3167
|
return db;
|
|
3097
3168
|
}
|
|
@@ -3117,7 +3188,7 @@ class SnapshotDb extends IModelDb {
|
|
|
3117
3188
|
snapshot._restartDefaultTxnTimer = setTimeout(() => {
|
|
3118
3189
|
snapshot.restartDefaultTxn();
|
|
3119
3190
|
}, (10 * 60) * 1000).unref(); // 10 minutes
|
|
3120
|
-
const cloudContainer = snapshot
|
|
3191
|
+
const cloudContainer = snapshot.cloudContainer;
|
|
3121
3192
|
if (cloudContainer !== undefined) {
|
|
3122
3193
|
snapshot._refreshSas = new RefreshV2CheckpointSas(cloudContainer.accessToken, checkpoint.reattachSafetySeconds);
|
|
3123
3194
|
}
|
|
@@ -3192,7 +3263,7 @@ class StandaloneDb extends BriefcaseDb {
|
|
|
3192
3263
|
nativeDb.setITwinId(core_bentley_1.Guid.empty);
|
|
3193
3264
|
nativeDb.resetBriefcaseId(core_common_1.BriefcaseIdValue.Unassigned);
|
|
3194
3265
|
nativeDb.saveChanges();
|
|
3195
|
-
const db = new
|
|
3266
|
+
const db = new this({ nativeDb, key: core_bentley_1.Guid.createValue(), briefcaseId: core_common_1.BriefcaseIdValue.Unassigned, openMode: core_bentley_1.OpenMode.ReadWrite });
|
|
3196
3267
|
db.channels.addAllowedChannel(ChannelControl_1.ChannelControl.sharedChannelName);
|
|
3197
3268
|
return db;
|
|
3198
3269
|
}
|
|
@@ -3238,7 +3309,7 @@ class StandaloneDb extends BriefcaseDb {
|
|
|
3238
3309
|
if (iTwinId !== core_bentley_1.Guid.empty) // a "standalone" iModel means it is not associated with an iTwin
|
|
3239
3310
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.WrongIModel, `${filePath} is not a Standalone iModel. iTwinId=${iTwinId}`);
|
|
3240
3311
|
(0, core_bentley_1.assert)(undefined !== file.key);
|
|
3241
|
-
const db = new
|
|
3312
|
+
const db = new this({ nativeDb, key: file.key, openMode, briefcaseId: core_common_1.BriefcaseIdValue.Unassigned });
|
|
3242
3313
|
return db;
|
|
3243
3314
|
}
|
|
3244
3315
|
catch (error) {
|