@itwin/core-backend 5.0.0-dev.98 → 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/ChangeSummaryManager.d.ts.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +12 -5
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +1 -0
- package/lib/cjs/ChangesetECAdaptor.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 +38 -2
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +82 -1
- 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 +182 -3
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +225 -6
- 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 +9 -8
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +4 -0
- package/lib/cjs/ElementTreeWalker.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 -50
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +189 -90
- 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/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +2 -0
- package/lib/cjs/Relationship.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 +29 -28
- 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.d.ts.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js +6 -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.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +4 -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/ChangeSummaryManager.d.ts.map +1 -1
- package/lib/esm/ChangeSummaryManager.js +12 -5
- package/lib/esm/ChangeSummaryManager.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +1 -0
- package/lib/esm/ChangesetECAdaptor.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 +38 -2
- package/lib/esm/ECDb.d.ts.map +1 -1
- package/lib/esm/ECDb.js +83 -2
- 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 +182 -3
- package/lib/esm/ECSqlStatement.d.ts.map +1 -1
- package/lib/esm/ECSqlStatement.js +223 -5
- 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 +9 -8
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementTreeWalker.d.ts.map +1 -1
- package/lib/esm/ElementTreeWalker.js +4 -0
- package/lib/esm/ElementTreeWalker.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 -50
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +192 -93
- 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/Relationship.d.ts.map +1 -1
- package/lib/esm/Relationship.js +2 -0
- package/lib/esm/Relationship.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 +30 -29
- 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.d.ts.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js +7 -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.d.ts.map +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js +4 -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 +37 -6
- package/lib/esm/test/IModelTestUtils.js.map +1 -1
- package/lib/esm/test/PrintElementTree.js +1 -0
- package/lib/esm/test/PrintElementTree.js.map +1 -1
- package/lib/esm/test/SchemaUtils.test.js +2 -0
- package/lib/esm/test/SchemaUtils.test.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/ECDb.test.js +12 -1
- package/lib/esm/test/ecdb/ECDb.test.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/ECSqlAst.test.js +1 -0
- package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js +6 -23
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlReader.test.js +1 -1
- package/lib/esm/test/ecdb/ECSqlReader.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +253 -163
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/SqliteStatement.test.js +2 -0
- package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +1 -0
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js +5 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +10 -0
- package/lib/esm/test/element/ElementRoundTrip.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/ElementTreeWalker.test.js +1 -0
- package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +65 -13
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/schema/GenericDomain.test.js +1 -0
- package/lib/esm/test/schema/GenericDomain.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 +2 -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 +8 -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/RenderMaterialElement.test.js +1 -0
- package/lib/esm/test/standalone/RenderMaterialElement.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 */
|
|
@@ -100,6 +101,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
100
101
|
/** @beta */
|
|
101
102
|
channels = (0, ChannelAdmin_1.createChannelControl)(this);
|
|
102
103
|
_relationships;
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
103
105
|
_statementCache = new SqliteStatement_1.StatementCache();
|
|
104
106
|
_sqliteStatementCache = new SqliteStatement_1.StatementCache();
|
|
105
107
|
_codeSpecs;
|
|
@@ -108,7 +110,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
108
110
|
_jsClassMap;
|
|
109
111
|
_schemaMap;
|
|
110
112
|
_schemaContext;
|
|
111
|
-
/** @deprecated in 5.0.0. Use [[fonts]]. */
|
|
113
|
+
/** @deprecated in 5.0.0 - will not be removed until after 2026-06-13. Use [[fonts]]. */
|
|
112
114
|
_fontMap; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
113
115
|
_fonts = (0, IModelDbFontsImpl_1.createIModelDbFonts)(this);
|
|
114
116
|
_workspace;
|
|
@@ -135,6 +137,13 @@ class IModelDb extends core_common_1.IModel {
|
|
|
135
137
|
this._workspace = (0, WorkspaceImpl_1.constructWorkspace)(new IModelSettings());
|
|
136
138
|
return this._workspace;
|
|
137
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
|
+
}
|
|
138
147
|
/** Acquire the exclusive schema lock on this iModel.
|
|
139
148
|
* @note: To acquire the schema lock, all other briefcases must first release *all* their locks. No other briefcases
|
|
140
149
|
* will be able to acquire *any* locks while the schema lock is held.
|
|
@@ -157,7 +166,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
157
166
|
restartDefaultTxn() {
|
|
158
167
|
this[Symbols_1._nativeDb].restartDefaultTxn();
|
|
159
168
|
}
|
|
160
|
-
/** @deprecated in 5.0.0. Use [[fonts]]. */
|
|
169
|
+
/** @deprecated in 5.0.0 - will not be removed until after 2026-06-13. Use [[fonts]]. */
|
|
161
170
|
get fontMap() {
|
|
162
171
|
return this._fontMap ?? (this._fontMap = new core_common_1.FontMap(this[Symbols_1._nativeDb].readFontMap())); // eslint-disable-line @typescript-eslint/no-deprecated
|
|
163
172
|
}
|
|
@@ -334,8 +343,11 @@ class IModelDb extends core_common_1.IModel {
|
|
|
334
343
|
* @returns the value returned by `callback`.
|
|
335
344
|
* @see [[withStatement]]
|
|
336
345
|
* @public
|
|
346
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [[createQueryReader]] instead.
|
|
337
347
|
*/
|
|
348
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
338
349
|
withPreparedStatement(ecsql, callback, logErrors = true) {
|
|
350
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
339
351
|
const stmt = this._statementCache.findAndRemove(ecsql) ?? this.prepareStatement(ecsql, logErrors);
|
|
340
352
|
const release = () => this._statementCache.addOrDispose(stmt);
|
|
341
353
|
try {
|
|
@@ -363,8 +375,11 @@ class IModelDb extends core_common_1.IModel {
|
|
|
363
375
|
* @returns the value returned by `callback`.
|
|
364
376
|
* @see [[withPreparedStatement]]
|
|
365
377
|
* @public
|
|
378
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [[createQueryReader]] instead.
|
|
366
379
|
*/
|
|
380
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
367
381
|
withStatement(ecsql, callback, logErrors = true) {
|
|
382
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
368
383
|
const stmt = this.prepareStatement(ecsql, logErrors);
|
|
369
384
|
const release = () => stmt[Symbol.dispose]();
|
|
370
385
|
try {
|
|
@@ -542,6 +557,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
542
557
|
if (typeof params.offset === "number" && params.offset > 0)
|
|
543
558
|
sql += ` OFFSET ${params.offset}`;
|
|
544
559
|
const ids = new Set();
|
|
560
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
545
561
|
this.withPreparedStatement(sql, (stmt) => {
|
|
546
562
|
if (params.bindings)
|
|
547
563
|
stmt.bindValues(params.bindings);
|
|
@@ -564,6 +580,8 @@ class IModelDb extends core_common_1.IModel {
|
|
|
564
580
|
this._jsClassMap = undefined;
|
|
565
581
|
this._schemaMap = undefined;
|
|
566
582
|
this._schemaContext = undefined;
|
|
583
|
+
this.elements[Symbols_1._cache].clear();
|
|
584
|
+
this.models[Symbols_1._cache].clear();
|
|
567
585
|
}
|
|
568
586
|
/** Update the project extents for this iModel.
|
|
569
587
|
* <p><em>Example:</em>
|
|
@@ -619,6 +637,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
619
637
|
* @note This will not delete Txns that have already been saved, even if they have not yet been pushed.
|
|
620
638
|
*/
|
|
621
639
|
abandonChanges() {
|
|
640
|
+
this.clearCaches();
|
|
622
641
|
this[Symbols_1._nativeDb].abandonChanges();
|
|
623
642
|
}
|
|
624
643
|
/**
|
|
@@ -632,11 +651,14 @@ class IModelDb extends core_common_1.IModel {
|
|
|
632
651
|
performCheckpoint() {
|
|
633
652
|
if (!this.isReadonly) {
|
|
634
653
|
this.saveChanges();
|
|
654
|
+
this.clearCaches();
|
|
655
|
+
this[Symbols_1._nativeDb].concurrentQueryShutdown();
|
|
656
|
+
this[Symbols_1._nativeDb].clearECDbCache();
|
|
635
657
|
this[Symbols_1._nativeDb].performCheckpoint();
|
|
636
658
|
}
|
|
637
659
|
}
|
|
638
660
|
/** @internal
|
|
639
|
-
* @deprecated in 4.8. Use `txns.reverseTxns`.
|
|
661
|
+
* @deprecated in 4.8 - will not be removed until after 2026-06-13. Use `txns.reverseTxns`.
|
|
640
662
|
*/
|
|
641
663
|
reverseTxns(numOperations) {
|
|
642
664
|
return this[Symbols_1._nativeDb].reverseTxns(numOperations);
|
|
@@ -862,7 +884,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
862
884
|
}
|
|
863
885
|
/** The registry of entity metadata for this iModel.
|
|
864
886
|
* @internal
|
|
865
|
-
* @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.
|
|
866
888
|
*
|
|
867
889
|
* @example
|
|
868
890
|
* ```typescript
|
|
@@ -898,7 +920,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
898
920
|
}
|
|
899
921
|
/**
|
|
900
922
|
* Gets the context that allows accessing the metadata (ecschema-metadata package) of this iModel
|
|
901
|
-
* @
|
|
923
|
+
* @public @preview
|
|
902
924
|
*/
|
|
903
925
|
get schemaContext() {
|
|
904
926
|
if (this._schemaContext === undefined) {
|
|
@@ -922,8 +944,11 @@ class IModelDb extends core_common_1.IModel {
|
|
|
922
944
|
* @param sql The ECSQL statement to prepare
|
|
923
945
|
* @param logErrors Determines if error will be logged if statement fail to prepare
|
|
924
946
|
* @throws [[IModelError]] if there is a problem preparing the statement.
|
|
947
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
925
948
|
*/
|
|
949
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
926
950
|
prepareStatement(sql, logErrors = true) {
|
|
951
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
927
952
|
const stmt = new ECSqlStatement_1.ECSqlStatement();
|
|
928
953
|
stmt.prepare(this[Symbols_1._nativeDb], sql, logErrors);
|
|
929
954
|
return stmt;
|
|
@@ -931,8 +956,11 @@ class IModelDb extends core_common_1.IModel {
|
|
|
931
956
|
/** Prepare an ECSQL statement.
|
|
932
957
|
* @param sql The ECSQL statement to prepare
|
|
933
958
|
* @returns `undefined` if there is a problem preparing the statement.
|
|
959
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
934
960
|
*/
|
|
961
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
935
962
|
tryPrepareStatement(sql) {
|
|
963
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
936
964
|
const statement = new ECSqlStatement_1.ECSqlStatement();
|
|
937
965
|
const result = statement.tryPrepare(this[Symbols_1._nativeDb], sql);
|
|
938
966
|
return core_bentley_1.DbResult.BE_SQLITE_OK === result.status ? statement : undefined;
|
|
@@ -958,9 +986,27 @@ class IModelDb extends core_common_1.IModel {
|
|
|
958
986
|
return ClassRegistry_1.ClassRegistry.getClass(classFullName, this);
|
|
959
987
|
}
|
|
960
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
|
+
}
|
|
961
1007
|
/** Get metadata for a class. This method will load the metadata from the iModel into the cache as a side-effect, if necessary.
|
|
962
1008
|
* @throws [[IModelError]] if the metadata cannot be found nor loaded.
|
|
963
|
-
* @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.
|
|
964
1010
|
*
|
|
965
1011
|
* @example
|
|
966
1012
|
* * ```typescript
|
|
@@ -986,7 +1032,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
986
1032
|
return metadata;
|
|
987
1033
|
}
|
|
988
1034
|
/** Identical to [[getMetaData]], except it returns `undefined` instead of throwing an error if the metadata cannot be found nor loaded.
|
|
989
|
-
* @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.
|
|
990
1036
|
*
|
|
991
1037
|
* @example
|
|
992
1038
|
* * ```typescript
|
|
@@ -1014,7 +1060,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1014
1060
|
* @param func The callback to be invoked on each property
|
|
1015
1061
|
* @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
|
|
1016
1062
|
* @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
|
|
1017
|
-
* @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.
|
|
1018
1064
|
*
|
|
1019
1065
|
* @example
|
|
1020
1066
|
* ```typescript
|
|
@@ -1040,7 +1086,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1040
1086
|
* @param func The callback to be invoked on each property
|
|
1041
1087
|
* @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
|
|
1042
1088
|
* @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
|
|
1043
|
-
* @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.
|
|
1044
1090
|
*
|
|
1045
1091
|
* @example
|
|
1046
1092
|
* ```typescript
|
|
@@ -1070,7 +1116,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1070
1116
|
}
|
|
1071
1117
|
/**
|
|
1072
1118
|
* @internal
|
|
1073
|
-
* @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.
|
|
1074
1120
|
*/
|
|
1075
1121
|
loadMetaData(classFullName) {
|
|
1076
1122
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -1115,6 +1161,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1115
1161
|
*/
|
|
1116
1162
|
querySchemaVersion(schemaName) {
|
|
1117
1163
|
const sql = `SELECT VersionMajor,VersionWrite,VersionMinor FROM ECDbMeta.ECSchemaDef WHERE Name=:schemaName LIMIT 1`;
|
|
1164
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1118
1165
|
return this.withPreparedStatement(sql, (statement) => {
|
|
1119
1166
|
statement.bindString("schemaName", schemaName);
|
|
1120
1167
|
if (core_bentley_1.DbResult.BE_SQLITE_ROW === statement.step()) {
|
|
@@ -1435,11 +1482,13 @@ function processSchemaWriteStatus(status) {
|
|
|
1435
1482
|
/** @public */
|
|
1436
1483
|
(function (IModelDb) {
|
|
1437
1484
|
/** The collection of models in an [[IModelDb]].
|
|
1438
|
-
* @public
|
|
1485
|
+
* @public @preview
|
|
1439
1486
|
*/
|
|
1440
1487
|
class Models {
|
|
1441
1488
|
_iModel;
|
|
1442
1489
|
/** @internal */
|
|
1490
|
+
[Symbols_1._cache] = new core_bentley_1.LRUMap(500);
|
|
1491
|
+
/** @internal */
|
|
1443
1492
|
constructor(_iModel) {
|
|
1444
1493
|
this._iModel = _iModel;
|
|
1445
1494
|
}
|
|
@@ -1449,7 +1498,10 @@ function processSchemaWriteStatus(status) {
|
|
|
1449
1498
|
* @see tryGetModelProps
|
|
1450
1499
|
*/
|
|
1451
1500
|
getModelProps(id) {
|
|
1452
|
-
|
|
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;
|
|
1453
1505
|
}
|
|
1454
1506
|
/** Get the ModelProps with the specified identifier.
|
|
1455
1507
|
* @param modelId The Model identifier.
|
|
@@ -1459,7 +1511,25 @@ function processSchemaWriteStatus(status) {
|
|
|
1459
1511
|
* @see getModelProps
|
|
1460
1512
|
*/
|
|
1461
1513
|
tryGetModelProps(id) {
|
|
1462
|
-
|
|
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
|
+
}
|
|
1463
1533
|
}
|
|
1464
1534
|
/** Query for the last modified time for a [[Model]].
|
|
1465
1535
|
* @param modelId The Id of the model.
|
|
@@ -1467,6 +1537,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1467
1537
|
*/
|
|
1468
1538
|
queryLastModifiedTime(modelId) {
|
|
1469
1539
|
const sql = `SELECT LastMod FROM ${Model_1.Model.classFullName} WHERE ECInstanceId=:modelId`;
|
|
1540
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1470
1541
|
return this._iModel.withPreparedStatement(sql, (statement) => {
|
|
1471
1542
|
statement.bindId("modelId", modelId);
|
|
1472
1543
|
if (core_bentley_1.DbResult.BE_SQLITE_ROW === statement.step()) {
|
|
@@ -1505,32 +1576,22 @@ function processSchemaWriteStatus(status) {
|
|
|
1505
1576
|
return model; // modelClass was not specified, cannot call instanceof to validate
|
|
1506
1577
|
return model instanceof modelClass ? model : undefined;
|
|
1507
1578
|
}
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
* @internal
|
|
1514
|
-
*/
|
|
1515
|
-
getModelJson(modelIdArg) {
|
|
1516
|
-
const modelJson = this.tryGetModelJson(modelIdArg);
|
|
1517
|
-
if (undefined === modelJson) {
|
|
1518
|
-
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 } };
|
|
1519
1584
|
}
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
* @see getModelJson
|
|
1526
|
-
*/
|
|
1527
|
-
tryGetModelJson(modelIdArg) {
|
|
1528
|
-
try {
|
|
1529
|
-
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 } };
|
|
1530
1590
|
}
|
|
1531
|
-
|
|
1532
|
-
|
|
1591
|
+
else {
|
|
1592
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.InvalidId, `Invalid model identifier: ${JSON.stringify(modelIdArg)}`);
|
|
1533
1593
|
}
|
|
1594
|
+
return this._iModel[Symbols_1._nativeDb].resolveInstanceKey(args);
|
|
1534
1595
|
}
|
|
1535
1596
|
/** Get the sub-model of the specified Element.
|
|
1536
1597
|
* See [[IModelDb.Elements.queryElementIdByCode]] for more on how to find an element by Code.
|
|
@@ -1583,6 +1644,8 @@ function processSchemaWriteStatus(status) {
|
|
|
1583
1644
|
*/
|
|
1584
1645
|
updateModel(props) {
|
|
1585
1646
|
try {
|
|
1647
|
+
if (props.id)
|
|
1648
|
+
this[Symbols_1._cache].delete(props.id);
|
|
1586
1649
|
this._iModel[Symbols_1._nativeDb].updateModel(props);
|
|
1587
1650
|
}
|
|
1588
1651
|
catch (err) {
|
|
@@ -1599,6 +1662,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1599
1662
|
* @see [[TxnManager.onModelGeometryChanged]] for the event emitted in response to such a change.
|
|
1600
1663
|
*/
|
|
1601
1664
|
updateGeometryGuid(modelId) {
|
|
1665
|
+
this._iModel.models[Symbols_1._cache].delete(modelId);
|
|
1602
1666
|
const error = this._iModel[Symbols_1._nativeDb].updateModelGeometryGuid(modelId);
|
|
1603
1667
|
if (error !== core_bentley_1.IModelStatus.Success)
|
|
1604
1668
|
throw new core_common_1.IModelError(error, `updating geometry guid for model ${modelId}`);
|
|
@@ -1610,6 +1674,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1610
1674
|
deleteModel(ids) {
|
|
1611
1675
|
core_bentley_1.Id64.toIdSet(ids).forEach((id) => {
|
|
1612
1676
|
try {
|
|
1677
|
+
this[Symbols_1._cache].delete(id);
|
|
1613
1678
|
this._iModel[Symbols_1._nativeDb].deleteModel(id);
|
|
1614
1679
|
}
|
|
1615
1680
|
catch (err) {
|
|
@@ -1643,11 +1708,13 @@ function processSchemaWriteStatus(status) {
|
|
|
1643
1708
|
}
|
|
1644
1709
|
IModelDb.Models = Models;
|
|
1645
1710
|
/** The collection of elements in an [[IModelDb]].
|
|
1646
|
-
* @public
|
|
1711
|
+
* @public @preview
|
|
1647
1712
|
*/
|
|
1648
1713
|
class Elements {
|
|
1649
1714
|
_iModel;
|
|
1650
1715
|
/** @internal */
|
|
1716
|
+
[Symbols_1._cache] = new ElementLRUCache_1.ElementLRUCache();
|
|
1717
|
+
/** @internal */
|
|
1651
1718
|
constructor(_iModel) {
|
|
1652
1719
|
this._iModel = _iModel;
|
|
1653
1720
|
}
|
|
@@ -1663,50 +1730,40 @@ function processSchemaWriteStatus(status) {
|
|
|
1663
1730
|
return !stmt.nextRow() ? undefined : stmt.getValueId(0);
|
|
1664
1731
|
}) : undefined;
|
|
1665
1732
|
}
|
|
1666
|
-
/** Read element data from the iModel as JSON
|
|
1667
|
-
* @param elementIdArg a json string with the identity of the element to load. Must have one of "id", "federationGuid", or "code".
|
|
1668
|
-
* @returns The JSON properties of the element.
|
|
1669
|
-
* @throws [[IModelError]] if the element is not found or cannot be loaded.
|
|
1670
|
-
* @see tryGetElementJson
|
|
1671
|
-
* @internal
|
|
1672
|
-
*/
|
|
1673
|
-
getElementJson(elementId) {
|
|
1674
|
-
const elementProps = this.tryGetElementJson(elementId);
|
|
1675
|
-
if (undefined === elementProps)
|
|
1676
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `reading element={id: ${elementId.id} federationGuid: ${elementId.federationGuid}, code: ${elementId.code}}`);
|
|
1677
|
-
return elementProps;
|
|
1678
|
-
}
|
|
1679
|
-
/** Read element data from the iModel as JSON
|
|
1680
|
-
* @param loadProps - a json string with the identity of the element to load. Must have one of "id", "federationGuid", or "code".
|
|
1681
|
-
* @returns The JSON properties of the element or `undefined` if the element is not found.
|
|
1682
|
-
* @throws [[IModelError]] if the element exists, but cannot be loaded.
|
|
1683
|
-
* @see getElementJson
|
|
1684
|
-
*/
|
|
1685
|
-
tryGetElementJson(loadProps) {
|
|
1686
|
-
try {
|
|
1687
|
-
return this._iModel[Symbols_1._nativeDb].getElement(loadProps);
|
|
1688
|
-
}
|
|
1689
|
-
catch {
|
|
1690
|
-
return undefined;
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
1733
|
/** Get properties of an Element by Id, FederationGuid, or Code
|
|
1694
1734
|
* @throws [[IModelError]] if the element is not found or cannot be loaded.
|
|
1695
1735
|
* @see tryGetElementProps
|
|
1696
1736
|
*/
|
|
1697
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;
|
|
1698
1746
|
if (typeof props === "string") {
|
|
1699
|
-
|
|
1747
|
+
args = core_bentley_1.Id64.isId64(props) ? { partialKey: { id: props, baseClassName } } : { federationGuid: props };
|
|
1700
1748
|
}
|
|
1701
1749
|
else if (props instanceof core_common_1.Code) {
|
|
1702
|
-
|
|
1750
|
+
args = { code: props };
|
|
1703
1751
|
}
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
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
|
+
}
|
|
1709
1765
|
}
|
|
1766
|
+
return this._iModel[Symbols_1._nativeDb].resolveInstanceKey(args);
|
|
1710
1767
|
}
|
|
1711
1768
|
/** Get properties of an Element by Id, FederationGuid, or Code
|
|
1712
1769
|
* @returns The properties of the element or `undefined` if the element is not found.
|
|
@@ -1714,14 +1771,32 @@ function processSchemaWriteStatus(status) {
|
|
|
1714
1771
|
* @note Useful for cases when an element may or may not exist and throwing an `Error` would be overkill.
|
|
1715
1772
|
* @see getElementProps
|
|
1716
1773
|
*/
|
|
1717
|
-
tryGetElementProps(
|
|
1718
|
-
if (typeof
|
|
1719
|
-
|
|
1774
|
+
tryGetElementProps(props) {
|
|
1775
|
+
if (typeof props === "string") {
|
|
1776
|
+
props = core_bentley_1.Id64.isId64(props) ? { id: props } : { federationGuid: props };
|
|
1720
1777
|
}
|
|
1721
|
-
else if (
|
|
1722
|
-
|
|
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;
|
|
1723
1799
|
}
|
|
1724
|
-
return this.tryGetElementJson(elementId);
|
|
1725
1800
|
}
|
|
1726
1801
|
/** Get an element by Id, FederationGuid, or Code
|
|
1727
1802
|
* @param elementId either the element's Id, Code, or FederationGuid, or an ElementLoadProps
|
|
@@ -1754,7 +1829,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1754
1829
|
elementId = { code: elementId };
|
|
1755
1830
|
else
|
|
1756
1831
|
elementId.onlyBaseProperties = false; // we must load all properties to construct the element.
|
|
1757
|
-
const elementProps = this.
|
|
1832
|
+
const elementProps = this.tryGetElementProps(elementId);
|
|
1758
1833
|
if (undefined === elementProps)
|
|
1759
1834
|
return undefined; // no Element with that elementId found
|
|
1760
1835
|
const element = this._iModel.constructEntity(elementProps);
|
|
@@ -1778,6 +1853,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1778
1853
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.InvalidCodeSpec, "Invalid CodeSpec");
|
|
1779
1854
|
if (code.value === undefined)
|
|
1780
1855
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.InvalidCode, "Invalid Code");
|
|
1856
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1781
1857
|
return this._iModel.withPreparedStatement("SELECT ECInstanceId FROM BisCore:Element WHERE CodeSpec.Id=? AND CodeScope.Id=? AND CodeValue=?", (stmt) => {
|
|
1782
1858
|
stmt.bindId(1, code.spec);
|
|
1783
1859
|
stmt.bindId(2, core_bentley_1.Id64.fromString(code.scope));
|
|
@@ -1793,6 +1869,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1793
1869
|
*/
|
|
1794
1870
|
queryLastModifiedTime(elementId) {
|
|
1795
1871
|
const sql = "SELECT LastMod FROM BisCore:Element WHERE ECInstanceId=:elementId";
|
|
1872
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1796
1873
|
return this._iModel.withPreparedStatement(sql, (statement) => {
|
|
1797
1874
|
statement.bindId("elementId", elementId);
|
|
1798
1875
|
if (core_bentley_1.DbResult.BE_SQLITE_ROW === statement.step())
|
|
@@ -1816,6 +1893,11 @@ function processSchemaWriteStatus(status) {
|
|
|
1816
1893
|
*/
|
|
1817
1894
|
insertElement(elProps, options) {
|
|
1818
1895
|
try {
|
|
1896
|
+
this[Symbols_1._cache].delete({
|
|
1897
|
+
id: elProps.id,
|
|
1898
|
+
federationGuid: elProps.federationGuid,
|
|
1899
|
+
code: elProps.code,
|
|
1900
|
+
});
|
|
1819
1901
|
return elProps.id = this._iModel[Symbols_1._nativeDb].insertElement(elProps, options);
|
|
1820
1902
|
}
|
|
1821
1903
|
catch (err) {
|
|
@@ -1837,6 +1919,11 @@ function processSchemaWriteStatus(status) {
|
|
|
1837
1919
|
*/
|
|
1838
1920
|
updateElement(elProps) {
|
|
1839
1921
|
try {
|
|
1922
|
+
this[Symbols_1._cache].delete({
|
|
1923
|
+
id: elProps.id,
|
|
1924
|
+
federationGuid: elProps.federationGuid,
|
|
1925
|
+
code: elProps.code,
|
|
1926
|
+
});
|
|
1840
1927
|
this._iModel[Symbols_1._nativeDb].updateElement(elProps);
|
|
1841
1928
|
}
|
|
1842
1929
|
catch (err) {
|
|
@@ -1854,6 +1941,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1854
1941
|
const iModel = this._iModel;
|
|
1855
1942
|
core_bentley_1.Id64.toIdSet(ids).forEach((id) => {
|
|
1856
1943
|
try {
|
|
1944
|
+
this[Symbols_1._cache].delete({ id });
|
|
1857
1945
|
iModel[Symbols_1._nativeDb].deleteElement(id);
|
|
1858
1946
|
}
|
|
1859
1947
|
catch (err) {
|
|
@@ -1944,6 +2032,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1944
2032
|
*/
|
|
1945
2033
|
queryChildren(elementId) {
|
|
1946
2034
|
const sql = "SELECT ECInstanceId FROM BisCore:Element WHERE Parent.Id=:elementId";
|
|
2035
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1947
2036
|
return this._iModel.withPreparedStatement(sql, (statement) => {
|
|
1948
2037
|
statement.bindId("elementId", elementId);
|
|
1949
2038
|
const childIds = [];
|
|
@@ -1959,6 +2048,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1959
2048
|
* @throws [[IModelError]] if the element does not exist
|
|
1960
2049
|
*/
|
|
1961
2050
|
queryParent(elementId) {
|
|
2051
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1962
2052
|
return this._iModel.withPreparedStatement(`select parent.id from ${Element_1.Element.classFullName} where ecinstanceid=?`, (stmt) => {
|
|
1963
2053
|
stmt.bindId(1, elementId);
|
|
1964
2054
|
if (stmt.step() !== core_bentley_1.DbResult.BE_SQLITE_ROW)
|
|
@@ -1975,6 +2065,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1975
2065
|
return false; // Special case since the RepositoryModel does not sub-model the root Subject
|
|
1976
2066
|
// A sub-model will have the same Id value as the element it is describing
|
|
1977
2067
|
const sql = "SELECT ECInstanceId FROM BisCore:Model WHERE ECInstanceId=:elementId";
|
|
2068
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1978
2069
|
return this._iModel.withPreparedStatement(sql, (statement) => {
|
|
1979
2070
|
statement.bindId("elementId", elementId);
|
|
1980
2071
|
return core_bentley_1.DbResult.BE_SQLITE_ROW === statement.step();
|
|
@@ -1989,6 +2080,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1989
2080
|
*/
|
|
1990
2081
|
_queryAspects(elementId, fromClassFullName, excludedClassFullNames) {
|
|
1991
2082
|
const sql = `SELECT ECInstanceId,ECClassId FROM ${fromClassFullName} WHERE Element.Id=:elementId ORDER BY ECClassId,ECInstanceId`; // ORDER BY to maximize statement reuse
|
|
2083
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1992
2084
|
return this._iModel.withPreparedStatement(sql, (statement) => {
|
|
1993
2085
|
statement.bindId("elementId", elementId);
|
|
1994
2086
|
const aspects = [];
|
|
@@ -2007,6 +2099,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2007
2099
|
*/
|
|
2008
2100
|
_queryAspect(aspectInstanceId, aspectClassName) {
|
|
2009
2101
|
const sql = `SELECT * FROM ${aspectClassName} WHERE ECInstanceId=:aspectInstanceId`;
|
|
2102
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2010
2103
|
const aspect = this._iModel.withPreparedStatement(sql, (statement) => {
|
|
2011
2104
|
statement.bindId("aspectInstanceId", aspectInstanceId);
|
|
2012
2105
|
if (core_bentley_1.DbResult.BE_SQLITE_ROW === statement.step()) {
|
|
@@ -2027,6 +2120,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2027
2120
|
*/
|
|
2028
2121
|
getAspect(aspectInstanceId) {
|
|
2029
2122
|
const sql = "SELECT ECClassId FROM BisCore:ElementAspect WHERE ECInstanceId=:aspectInstanceId";
|
|
2123
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2030
2124
|
const aspectClassFullName = this._iModel.withPreparedStatement(sql, (statement) => {
|
|
2031
2125
|
statement.bindId("aspectInstanceId", aspectInstanceId);
|
|
2032
2126
|
return (core_bentley_1.DbResult.BE_SQLITE_ROW === statement.step()) ? statement.getValue(0).getClassNameForClassId().replace(".", ":") : undefined;
|
|
@@ -2038,6 +2132,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2038
2132
|
}
|
|
2039
2133
|
static classMap = new Map();
|
|
2040
2134
|
runInstanceQuery(sql, elementId, excludedClassFullNames) {
|
|
2135
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2041
2136
|
return this._iModel.withPreparedStatement(sql, (statement) => {
|
|
2042
2137
|
statement.bindId("elementId", elementId);
|
|
2043
2138
|
const aspects = [];
|
|
@@ -2087,8 +2182,11 @@ function processSchemaWriteStatus(status) {
|
|
|
2087
2182
|
let classIdList = IModelDb.Elements.classMap.get(aspectClassFullName);
|
|
2088
2183
|
if (classIdList === undefined) {
|
|
2089
2184
|
const classIds = [];
|
|
2185
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2090
2186
|
this._iModel.withPreparedStatement(`select SourceECInstanceId from meta.ClassHasAllBaseClasses where TargetECInstanceId = (select ECInstanceId from meta.ECClassDef where Name='${fullClassName[1]}'
|
|
2091
|
-
and Schema.Id = (select ECInstanceId from meta.ECSchemaDef where Name='${fullClassName[0]}')) and SourceECInstanceId != TargetECInstanceId`,
|
|
2187
|
+
and Schema.Id = (select ECInstanceId from meta.ECSchemaDef where Name='${fullClassName[0]}')) and SourceECInstanceId != TargetECInstanceId`,
|
|
2188
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2189
|
+
(statement) => {
|
|
2092
2190
|
while (statement.step() === core_bentley_1.DbResult.BE_SQLITE_ROW)
|
|
2093
2191
|
classIds.push(statement.getValue(0).getId());
|
|
2094
2192
|
});
|
|
@@ -2156,7 +2254,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2156
2254
|
}
|
|
2157
2255
|
IModelDb.Elements = Elements;
|
|
2158
2256
|
/** The collection of views in an [[IModelDb]].
|
|
2159
|
-
* @public
|
|
2257
|
+
* @public @preview
|
|
2160
2258
|
*/
|
|
2161
2259
|
class Views {
|
|
2162
2260
|
_iModel;
|
|
@@ -2332,7 +2430,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2332
2430
|
}
|
|
2333
2431
|
/** Set the default view property the iModel.
|
|
2334
2432
|
* @param viewId The Id of the ViewDefinition to use as the default
|
|
2335
|
-
* @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
|
|
2336
2434
|
* that might wish to view the contents of the iModel.
|
|
2337
2435
|
*/
|
|
2338
2436
|
setDefaultViewId(viewId) {
|
|
@@ -2346,9 +2444,9 @@ function processSchemaWriteStatus(status) {
|
|
|
2346
2444
|
}
|
|
2347
2445
|
IModelDb.Views = Views;
|
|
2348
2446
|
/** Represents the current state of a pollable tile content request.
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2447
|
+
* Note: lack of a "completed" state because polling a completed request returns the content as a Uint8Array.
|
|
2448
|
+
* @internal
|
|
2449
|
+
*/
|
|
2352
2450
|
let TileContentState;
|
|
2353
2451
|
(function (TileContentState) {
|
|
2354
2452
|
TileContentState[TileContentState["New"] = 0] = "New";
|
|
@@ -2588,7 +2686,7 @@ class BriefcaseDb extends IModelDb {
|
|
|
2588
2686
|
const file = { path: args.fileName, key: args.key };
|
|
2589
2687
|
const openMode = (args.readonly || args.watchForChanges) ? core_bentley_1.OpenMode.Readonly : core_bentley_1.OpenMode.ReadWrite;
|
|
2590
2688
|
const nativeDb = this.openDgnDb(file, openMode, undefined, args);
|
|
2591
|
-
const briefcaseDb = new
|
|
2689
|
+
const briefcaseDb = new this({ nativeDb, key: file.key ?? core_bentley_1.Guid.createValue(), openMode, briefcaseId: nativeDb.getBriefcaseId() });
|
|
2592
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.)
|
|
2593
2691
|
// Whenever there are changes, restart our defaultTxn. That loads the changes from the other connection and sends
|
|
2594
2692
|
// notifications as if they happened on this connection. Note: the watcher is called only when the backend event loop cycles.
|
|
@@ -2597,6 +2695,7 @@ class BriefcaseDb extends IModelDb {
|
|
|
2597
2695
|
touch.sync(briefcaseDb.watchFilePathName);
|
|
2598
2696
|
// Restart default txn to trigger events when watch file is changed by some other process.
|
|
2599
2697
|
const watcher = fs.watch(briefcaseDb.watchFilePathName, { persistent: false }, () => {
|
|
2698
|
+
nativeDb.clearECDbCache();
|
|
2600
2699
|
nativeDb.restartDefaultTxn();
|
|
2601
2700
|
briefcaseDb.changeset = briefcaseDb[Symbols_1._nativeDb].getCurrentChangeset();
|
|
2602
2701
|
});
|
|
@@ -2937,7 +3036,7 @@ class RefreshV2CheckpointSas {
|
|
|
2937
3036
|
core_bentley_1.Logger.logInfo(BackendLoggerCategory_1.BackendLoggerCategory.Authorization, "attempting to refresh sasToken for checkpoint");
|
|
2938
3037
|
try {
|
|
2939
3038
|
// this exchanges the supplied user accessToken for an expiring blob-store token to read the checkpoint.
|
|
2940
|
-
const container = iModel
|
|
3039
|
+
const container = iModel.cloudContainer;
|
|
2941
3040
|
if (!container)
|
|
2942
3041
|
throw new Error("checkpoint is not from a cloud container");
|
|
2943
3042
|
(0, core_bentley_1.assert)(undefined !== iModel.iTwinId);
|
|
@@ -3063,7 +3162,7 @@ class SnapshotDb extends IModelDb {
|
|
|
3063
3162
|
file.key = `${nativeDb.getIModelId()}:${nativeDb.getCurrentChangeset().id}`;
|
|
3064
3163
|
}
|
|
3065
3164
|
(0, core_bentley_1.assert)(undefined !== file.key);
|
|
3066
|
-
const db = new
|
|
3165
|
+
const db = new this(nativeDb, file.key);
|
|
3067
3166
|
this.onOpened.raiseEvent(db);
|
|
3068
3167
|
return db;
|
|
3069
3168
|
}
|
|
@@ -3089,7 +3188,7 @@ class SnapshotDb extends IModelDb {
|
|
|
3089
3188
|
snapshot._restartDefaultTxnTimer = setTimeout(() => {
|
|
3090
3189
|
snapshot.restartDefaultTxn();
|
|
3091
3190
|
}, (10 * 60) * 1000).unref(); // 10 minutes
|
|
3092
|
-
const cloudContainer = snapshot
|
|
3191
|
+
const cloudContainer = snapshot.cloudContainer;
|
|
3093
3192
|
if (cloudContainer !== undefined) {
|
|
3094
3193
|
snapshot._refreshSas = new RefreshV2CheckpointSas(cloudContainer.accessToken, checkpoint.reattachSafetySeconds);
|
|
3095
3194
|
}
|
|
@@ -3164,7 +3263,7 @@ class StandaloneDb extends BriefcaseDb {
|
|
|
3164
3263
|
nativeDb.setITwinId(core_bentley_1.Guid.empty);
|
|
3165
3264
|
nativeDb.resetBriefcaseId(core_common_1.BriefcaseIdValue.Unassigned);
|
|
3166
3265
|
nativeDb.saveChanges();
|
|
3167
|
-
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 });
|
|
3168
3267
|
db.channels.addAllowedChannel(ChannelControl_1.ChannelControl.sharedChannelName);
|
|
3169
3268
|
return db;
|
|
3170
3269
|
}
|
|
@@ -3210,7 +3309,7 @@ class StandaloneDb extends BriefcaseDb {
|
|
|
3210
3309
|
if (iTwinId !== core_bentley_1.Guid.empty) // a "standalone" iModel means it is not associated with an iTwin
|
|
3211
3310
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.WrongIModel, `${filePath} is not a Standalone iModel. iTwinId=${iTwinId}`);
|
|
3212
3311
|
(0, core_bentley_1.assert)(undefined !== file.key);
|
|
3213
|
-
const db = new
|
|
3312
|
+
const db = new this({ nativeDb, key: file.key, openMode, briefcaseId: core_common_1.BriefcaseIdValue.Unassigned });
|
|
3214
3313
|
return db;
|
|
3215
3314
|
}
|
|
3216
3315
|
catch (error) {
|