@itwin/core-backend 5.9.0-dev.4 → 5.9.0-dev.6
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/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.js +3 -3
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CatalogDb.js.map +1 -1
- package/lib/cjs/Category.d.ts +37 -7
- package/lib/cjs/Category.d.ts.map +1 -1
- package/lib/cjs/Category.js +33 -42
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +2 -2
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +253 -250
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.d.ts +29 -0
- package/lib/cjs/ChannelControl.d.ts.map +1 -1
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.js +1 -1
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.js +5 -5
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +32 -3
- package/lib/cjs/CodeSpecs.d.ts.map +1 -1
- package/lib/cjs/CodeSpecs.js +48 -20
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +18 -3
- package/lib/cjs/DisplayStyle.d.ts.map +1 -1
- package/lib/cjs/DisplayStyle.js +10 -21
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlRowExecutor.js.map +1 -1
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/ECSqlSyncReader.js.map +1 -1
- package/lib/cjs/EditTxn.d.ts +262 -0
- package/lib/cjs/EditTxn.d.ts.map +1 -0
- package/lib/cjs/EditTxn.js +548 -0
- package/lib/cjs/EditTxn.js.map +1 -0
- package/lib/cjs/Element.d.ts +74 -5
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +63 -75
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +10 -0
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +21 -12
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts +56 -3
- package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +53 -40
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.d.ts +11 -2
- package/lib/cjs/ExternalSource.d.ts.map +1 -1
- package/lib/cjs/ExternalSource.js +10 -8
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/FontFile.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/GeometrySummary.js +47 -47
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +66 -22
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +182 -296
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelDbFonts.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +22 -0
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +9 -0
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/ImageSourceConversion.js.map +1 -1
- package/lib/cjs/IpcHost.js +2 -2
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.d.ts +47 -7
- package/lib/cjs/LineStyle.d.ts.map +1 -1
- package/lib/cjs/LineStyle.js +38 -33
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.js +1 -1
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/LockControl.js.map +1 -1
- package/lib/cjs/Material.d.ts +8 -1
- package/lib/cjs/Material.d.ts.map +1 -1
- package/lib/cjs/Material.js +6 -12
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +59 -20
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +38 -80
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.d.ts +72 -7
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +39 -21
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.js +4 -4
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/SheetIndex.d.ts +9 -0
- package/lib/cjs/SheetIndex.d.ts.map +1 -1
- package/lib/cjs/SheetIndex.js +38 -35
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/StashManager.js +1 -1
- package/lib/cjs/StashManager.js.map +1 -1
- package/lib/cjs/Texture.d.ts +6 -0
- package/lib/cjs/Texture.d.ts.map +1 -1
- package/lib/cjs/Texture.js +6 -14
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +5 -5
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +23 -7
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +21 -1
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +27 -66
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +14 -6
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +33 -27
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +6 -5
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
- package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
- package/lib/cjs/core-backend.d.ts +1 -0
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +1 -0
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +6 -2
- package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js +8 -13
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.d.ts +11 -4
- package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
- package/lib/cjs/domains/GenericElements.js +13 -24
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.d.ts +15 -0
- package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js +5 -3
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
- package/lib/cjs/internal/FontFileImpl.js.map +1 -1
- package/lib/cjs/internal/HubMock.js.map +1 -1
- package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/cjs/internal/IntegrityCheck.js.map +1 -1
- package/lib/cjs/internal/NativePlatform.js.map +1 -1
- package/lib/cjs/internal/NoLocks.js.map +1 -1
- package/lib/cjs/internal/OnlineStatus.js.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/internal/Symbols.d.ts +4 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +5 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/annotations/fields.d.ts +3 -2
- package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
- package/lib/cjs/internal/annotations/fields.js +7 -6
- package/lib/cjs/internal/annotations/fields.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsEditorImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.js.map +1 -1
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsDb.js.map +1 -1
- package/lib/cjs/workspace/SettingsEditor.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BackendLoggerCategory.js.map +1 -1
- package/lib/esm/BisCoreSchema.js.map +1 -1
- package/lib/esm/BlobContainerService.js.map +1 -1
- package/lib/esm/BriefcaseManager.js +3 -3
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/CatalogDb.js.map +1 -1
- package/lib/esm/Category.d.ts +37 -7
- package/lib/esm/Category.d.ts.map +1 -1
- package/lib/esm/Category.js +33 -42
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/ChangeSummaryManager.js +2 -2
- package/lib/esm/ChangeSummaryManager.js.map +1 -1
- package/lib/esm/ChangedElementsDb.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +253 -250
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ChannelControl.d.ts +29 -0
- package/lib/esm/ChannelControl.d.ts.map +1 -1
- package/lib/esm/ChannelControl.js.map +1 -1
- package/lib/esm/CheckpointManager.js +1 -1
- package/lib/esm/CheckpointManager.js.map +1 -1
- package/lib/esm/ClassRegistry.js +5 -5
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeService.js.map +1 -1
- package/lib/esm/CodeSpecs.d.ts +32 -3
- package/lib/esm/CodeSpecs.d.ts.map +1 -1
- package/lib/esm/CodeSpecs.js +49 -21
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/CustomViewState3dCreator.js.map +1 -1
- package/lib/esm/DevTools.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +18 -3
- package/lib/esm/DisplayStyle.d.ts.map +1 -1
- package/lib/esm/DisplayStyle.js +10 -21
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSchemaXmlContext.js.map +1 -1
- package/lib/esm/ECSqlRowExecutor.js.map +1 -1
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/ECSqlSyncReader.js.map +1 -1
- package/lib/esm/EditTxn.d.ts +262 -0
- package/lib/esm/EditTxn.d.ts.map +1 -0
- package/lib/esm/EditTxn.js +543 -0
- package/lib/esm/EditTxn.js.map +1 -0
- package/lib/esm/Element.d.ts +74 -5
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +64 -76
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +10 -0
- package/lib/esm/ElementAspect.d.ts.map +1 -1
- package/lib/esm/ElementAspect.js +22 -13
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementGraphics.js.map +1 -1
- package/lib/esm/ElementTreeWalker.d.ts +56 -3
- package/lib/esm/ElementTreeWalker.d.ts.map +1 -1
- package/lib/esm/ElementTreeWalker.js +53 -40
- package/lib/esm/ElementTreeWalker.js.map +1 -1
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/EntityReferences.js.map +1 -1
- package/lib/esm/ExportGraphics.js.map +1 -1
- package/lib/esm/ExternalSource.d.ts +11 -2
- package/lib/esm/ExternalSource.d.ts.map +1 -1
- package/lib/esm/ExternalSource.js +10 -8
- package/lib/esm/ExternalSource.js.map +1 -1
- package/lib/esm/FontFile.js.map +1 -1
- package/lib/esm/GeoCoordConfig.js.map +1 -1
- package/lib/esm/GeographicCRSServices.js.map +1 -1
- package/lib/esm/GeometrySummary.js +47 -47
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +66 -22
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +184 -298
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelDbFonts.js.map +1 -1
- package/lib/esm/IModelElementCloneContext.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +22 -0
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +9 -0
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/IModelJsFs.js.map +1 -1
- package/lib/esm/ImageSourceConversion.js.map +1 -1
- package/lib/esm/IpcHost.js +3 -3
- package/lib/esm/IpcHost.js.map +1 -1
- package/lib/esm/LineStyle.d.ts +47 -7
- package/lib/esm/LineStyle.d.ts.map +1 -1
- package/lib/esm/LineStyle.js +38 -33
- package/lib/esm/LineStyle.js.map +1 -1
- package/lib/esm/LocalHub.js +1 -1
- package/lib/esm/LocalHub.js.map +1 -1
- package/lib/esm/LocalhostIpcHost.js.map +1 -1
- package/lib/esm/LockControl.js.map +1 -1
- package/lib/esm/Material.d.ts +8 -1
- package/lib/esm/Material.d.ts.map +1 -1
- package/lib/esm/Material.js +6 -12
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.d.ts +59 -20
- package/lib/esm/Model.d.ts.map +1 -1
- package/lib/esm/Model.js +39 -81
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/NativeAppStorage.js.map +1 -1
- package/lib/esm/NativeHost.js.map +1 -1
- package/lib/esm/NavigationRelationship.js.map +1 -1
- package/lib/esm/PromiseMemoizer.js.map +1 -1
- package/lib/esm/PropertyStore.js.map +1 -1
- package/lib/esm/Relationship.d.ts +72 -7
- package/lib/esm/Relationship.d.ts.map +1 -1
- package/lib/esm/Relationship.js +40 -22
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/RpcBackend.js.map +1 -1
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/Schema.js.map +1 -1
- package/lib/esm/SchemaSync.js +5 -5
- package/lib/esm/SchemaSync.js.map +1 -1
- package/lib/esm/SchemaUtils.js.map +1 -1
- package/lib/esm/SheetIndex.d.ts +9 -0
- package/lib/esm/SheetIndex.d.ts.map +1 -1
- package/lib/esm/SheetIndex.js +38 -35
- package/lib/esm/SheetIndex.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/SqliteStatement.js.map +1 -1
- package/lib/esm/StashManager.js +1 -1
- package/lib/esm/StashManager.js.map +1 -1
- package/lib/esm/Texture.d.ts +6 -0
- package/lib/esm/Texture.d.ts.map +1 -1
- package/lib/esm/Texture.js +6 -14
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TileStorage.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +5 -5
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +23 -7
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +21 -1
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +27 -66
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/ViewStateHydrator.js.map +1 -1
- package/lib/esm/ViewStore.js.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +14 -6
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js +33 -27
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/esm/annotations/FrameGeometry.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +6 -5
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
- package/lib/esm/core-backend.d.ts +1 -0
- package/lib/esm/core-backend.d.ts.map +1 -1
- package/lib/esm/core-backend.js +1 -0
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/domains/FunctionalElements.d.ts +6 -2
- package/lib/esm/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/esm/domains/FunctionalElements.js +8 -13
- package/lib/esm/domains/FunctionalElements.js.map +1 -1
- package/lib/esm/domains/FunctionalSchema.js.map +1 -1
- package/lib/esm/domains/GenericElements.d.ts +11 -4
- package/lib/esm/domains/GenericElements.d.ts.map +1 -1
- package/lib/esm/domains/GenericElements.js +13 -24
- package/lib/esm/domains/GenericElements.js.map +1 -1
- package/lib/esm/domains/GenericSchema.js.map +1 -1
- package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.d.ts +15 -0
- package/lib/esm/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js +6 -4
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/internal/ElementLRUCache.js.map +1 -1
- package/lib/esm/internal/FontFileImpl.js.map +1 -1
- package/lib/esm/internal/HubMock.js.map +1 -1
- package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/esm/internal/IntegrityCheck.js.map +1 -1
- package/lib/esm/internal/NativePlatform.js.map +1 -1
- package/lib/esm/internal/NoLocks.js.map +1 -1
- package/lib/esm/internal/OnlineStatus.js.map +1 -1
- package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
- package/lib/esm/internal/Symbols.d.ts +4 -0
- package/lib/esm/internal/Symbols.d.ts.map +1 -1
- package/lib/esm/internal/Symbols.js +4 -0
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/internal/annotations/fields.d.ts +3 -2
- package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
- package/lib/esm/internal/annotations/fields.js +7 -6
- package/lib/esm/internal/annotations/fields.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsEditorImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/esm/rpc/multipart.js.map +1 -1
- package/lib/esm/rpc/tracing.js.map +1 -1
- package/lib/esm/rpc/web/logging.js.map +1 -1
- package/lib/esm/rpc/web/request.js.map +1 -1
- package/lib/esm/rpc/web/response.js.map +1 -1
- package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/esm/test/AdvancedEqual.js.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
- package/lib/esm/test/AttachDb.test.js +11 -11
- package/lib/esm/test/AttachDb.test.js.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.d.ts +20 -19
- package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.js +134 -119
- package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
- package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
- package/lib/esm/test/GeometryTestUtil.js.map +1 -1
- package/lib/esm/test/IModelHost.test.js +56 -2
- package/lib/esm/test/IModelHost.test.js.map +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts +23 -23
- package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
- package/lib/esm/test/IModelTestUtils.js +466 -449
- package/lib/esm/test/IModelTestUtils.js.map +1 -1
- package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
- package/lib/esm/test/IpcHost.test.js.map +1 -1
- package/lib/esm/test/KnownTestLocations.js.map +1 -1
- package/lib/esm/test/PrintElementTree.js.map +1 -1
- package/lib/esm/test/PropertyDb.test.js +2 -2
- package/lib/esm/test/PropertyDb.test.js.map +1 -1
- package/lib/esm/test/RevisionUtility.js.map +1 -1
- package/lib/esm/test/SchemaUtils.test.js +25 -25
- package/lib/esm/test/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
- package/lib/esm/test/SquashSchemaAndDataChanges.test.js +156 -147
- package/lib/esm/test/SquashSchemaAndDataChanges.test.js.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.d.ts.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.js +11 -7
- package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
- package/lib/esm/test/TestEditTxn.d.ts +8 -0
- package/lib/esm/test/TestEditTxn.d.ts.map +1 -0
- package/lib/esm/test/TestEditTxn.js +34 -0
- package/lib/esm/test/TestEditTxn.js.map +1 -0
- package/lib/esm/test/TestUtils.d.ts +1 -0
- package/lib/esm/test/TestUtils.d.ts.map +1 -1
- package/lib/esm/test/TestUtils.js +8 -1
- package/lib/esm/test/TestUtils.js.map +1 -1
- package/lib/esm/test/annotations/Fields.test.js +135 -143
- package/lib/esm/test/annotations/Fields.test.js.map +1 -1
- package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +156 -99
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.js +5 -3
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
- package/lib/esm/test/categories/Category.test.js +63 -3
- package/lib/esm/test/categories/Category.test.js.map +1 -1
- package/lib/esm/test/codespec/CodeSpec.test.js +88 -5
- package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
- package/lib/esm/test/ecdb/CTE.test.js +88 -88
- package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js +19 -19
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDb.test.js +72 -72
- package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
- package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlAst.test.js +68 -67
- package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js +6 -6
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +332 -333
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlSyncReader.test.js.map +1 -1
- package/lib/esm/test/ecdb/QueryReaders.test.js +47 -44
- package/lib/esm/test/ecdb/QueryReaders.test.js.map +1 -1
- package/lib/esm/test/ecdb/SqliteStatement.test.js +2 -2
- package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.d.ts.map +1 -1
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js +30 -28
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/DeleteDefinitionElements.test.js +159 -143
- package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
- package/lib/esm/test/element/ElementAspect.test.js +90 -82
- package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
- package/lib/esm/test/element/ElementDependencyGraph.test.d.ts.map +1 -1
- package/lib/esm/test/element/ElementDependencyGraph.test.js +51 -43
- package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +176 -177
- package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
- package/lib/esm/test/element/ExcludedElements.test.js +2 -2
- package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
- package/lib/esm/test/element/ExternalSource.test.js +40 -38
- package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
- package/lib/esm/test/element/NullStructArray.test.js +23 -22
- package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
- package/lib/esm/test/element/ProjectInformationRecord.test.js +5 -2
- package/lib/esm/test/element/ProjectInformationRecord.test.js.map +1 -1
- package/lib/esm/test/element/SheetInformationAspect.test.js +43 -11
- package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
- package/lib/esm/test/element/UrlLink.test.js +2 -2
- package/lib/esm/test/element/UrlLink.test.js.map +1 -1
- package/lib/esm/test/font/FontFile.test.js.map +1 -1
- package/lib/esm/test/font/IModelDbFonts.test.js +87 -73
- package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js +194 -155
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js +2 -4
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js +369 -303
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
- package/lib/esm/test/hubaccess/SemanticRebase.test.js +467 -392
- package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
- package/lib/esm/test/imageData.js.map +1 -1
- package/lib/esm/test/imodel/Code.test.js +31 -31
- package/lib/esm/test/imodel/Code.test.js.map +1 -1
- package/lib/esm/test/imodel/ElementTreeWalker.test.js +57 -48
- package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
- package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +463 -388
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/imodel/ProjectExtents.test.js +2 -2
- package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
- package/lib/esm/test/imodel/SchemaXmlImport.test.js +13 -13
- package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/TestContext.d.ts.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/TestContext.js +2 -2
- package/lib/esm/test/incrementalSchemaLocater/TestContext.js.map +1 -1
- package/lib/esm/test/index.d.ts +1 -0
- package/lib/esm/test/index.d.ts.map +1 -1
- package/lib/esm/test/index.js +1 -0
- package/lib/esm/test/index.js.map +1 -1
- package/lib/esm/test/misc/DevTools.test.js.map +1 -1
- package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
- package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
- package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
- package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
- package/lib/esm/test/rpc/response.test.js.map +1 -1
- package/lib/esm/test/schema/ClassRegistry.test.js +122 -121
- package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
- package/lib/esm/test/schema/FunctionalDomain.test.js +36 -34
- package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
- package/lib/esm/test/schema/GenericDomain.test.js +114 -94
- package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
- package/lib/esm/test/schema/IModelSchemaContext.test.js +11 -10
- package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
- package/lib/esm/test/schema/SchemaImportCallbacks.test.js +226 -211
- package/lib/esm/test/schema/SchemaImportCallbacks.test.js.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.d.ts +1 -3
- package/lib/esm/test/sheetindex/SheetIndex.test.d.ts.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.js +312 -247
- package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js +101 -82
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +242 -213
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
- package/lib/esm/test/standalone/DisplayStyle.test.js +43 -40
- package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
- package/lib/esm/test/standalone/Drawing.test.js +4 -3
- package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
- package/lib/esm/test/standalone/EditTxn.test.d.ts +2 -0
- package/lib/esm/test/standalone/EditTxn.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/EditTxn.test.js +219 -0
- package/lib/esm/test/standalone/EditTxn.test.js.map +1 -0
- package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementMesh.test.js +16 -13
- package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
- package/lib/esm/test/standalone/ExportGraphics.test.js +40 -34
- package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryChangeEvents.test.js +11 -15
- package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryStream.test.js +212 -165
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/HubMock.test.js +31 -25
- package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelLimits.test.js +11 -8
- package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.d.ts +2 -2
- package/lib/esm/test/standalone/IModelWrite.test.d.ts.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.js +211 -169
- package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
- package/lib/esm/test/standalone/ITwinWorkspace.test.js.map +1 -1
- package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js +25 -22
- package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
- package/lib/esm/test/standalone/IntegrityCheck.test.js +20 -18
- package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.d.ts +2 -2
- package/lib/esm/test/standalone/MergeConflict.test.d.ts.map +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.js +49 -33
- package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
- package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderMaterialElement.test.js +5 -5
- package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderTimeline.test.js +3 -2
- package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
- package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
- package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/standalone/SectionDrawing.test.js +7 -7
- package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
- package/lib/esm/test/standalone/ServerBasedLocks.test.js +21 -19
- package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
- package/lib/esm/test/standalone/Setting.test.js.map +1 -1
- package/lib/esm/test/standalone/Settings.test.js +7 -4
- package/lib/esm/test/standalone/Settings.test.js.map +1 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js +2 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js +3 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/lib/esm/test/standalone/StandaloneDb.test.js +27 -26
- package/lib/esm/test/standalone/StandaloneDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Texture.test.js +5 -4
- package/lib/esm/test/standalone/Texture.test.js.map +1 -1
- package/lib/esm/test/standalone/TileCache.test.d.ts.map +1 -1
- package/lib/esm/test/standalone/TileCache.test.js +5 -3
- package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
- package/lib/esm/test/standalone/TileTree.test.js +35 -31
- package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js +700 -653
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewDefinition.test.js +295 -229
- package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Workspace.test.js +25 -23
- package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
- package/lib/esm/test/standalone/iModelDb.test.js.map +1 -1
- package/lib/esm/test/workspace/SettingsDb.test.js.map +1 -1
- package/lib/esm/workspace/Settings.js.map +1 -1
- package/lib/esm/workspace/SettingsDb.js.map +1 -1
- package/lib/esm/workspace/SettingsEditor.js.map +1 -1
- package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +13 -13
package/lib/cjs/IModelDb.js
CHANGED
|
@@ -38,6 +38,7 @@ const SchemaSync_1 = require("./SchemaSync");
|
|
|
38
38
|
const ServerBasedLocks_1 = require("./internal/ServerBasedLocks");
|
|
39
39
|
const SqliteStatement_1 = require("./SqliteStatement");
|
|
40
40
|
const TxnManager_1 = require("./TxnManager");
|
|
41
|
+
const EditTxn_1 = require("./EditTxn");
|
|
41
42
|
const ViewDefinition_1 = require("./ViewDefinition");
|
|
42
43
|
const ViewStore_1 = require("./ViewStore");
|
|
43
44
|
const Settings_1 = require("./workspace/Settings");
|
|
@@ -57,6 +58,38 @@ const IntegrityCheck_1 = require("./internal/IntegrityCheck");
|
|
|
57
58
|
const ECSqlSyncReader_1 = require("./ECSqlSyncReader");
|
|
58
59
|
// spell:ignore fontid fontmap
|
|
59
60
|
const loggerCategory = BackendLoggerCategory_1.BackendLoggerCategory.IModelDb;
|
|
61
|
+
/**
|
|
62
|
+
* Internal write surface used to preserve legacy implicit-transaction mutators while callers migrate to explicit [[EditTxn]] scopes.
|
|
63
|
+
*
|
|
64
|
+
* Unlike an explicit [[EditTxn]], this transaction is always available for writable iModels and cannot be manually started or ended.
|
|
65
|
+
* When implicit-write enforcement is enabled, attempts to write through this transaction are logged or rejected.
|
|
66
|
+
*/
|
|
67
|
+
class ImplicitWriteTxn extends EditTxn_1.EditTxn {
|
|
68
|
+
constructor(iModel) {
|
|
69
|
+
super(iModel, "implicit");
|
|
70
|
+
}
|
|
71
|
+
start() {
|
|
72
|
+
throw new Error("ImplicitWriteTxn cannot be started");
|
|
73
|
+
}
|
|
74
|
+
end(_mode = "save", _args) {
|
|
75
|
+
throw new Error("ImplicitWriteTxn cannot be ended");
|
|
76
|
+
}
|
|
77
|
+
verifyWriteable() {
|
|
78
|
+
const enforcement = EditTxn_1.EditTxn.implicitWriteEnforcement;
|
|
79
|
+
if (enforcement === "allow")
|
|
80
|
+
return;
|
|
81
|
+
try {
|
|
82
|
+
core_common_1.EditTxnError.throwError("implicit-txn-write-disallowed", "Implicit transaction write is disallowed. Use an explicit EditTxn instead", this.iModel.key);
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
if (enforcement === "log") {
|
|
86
|
+
core_bentley_1.Logger.logError(loggerCategory, err);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
throw err;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
60
93
|
/** @internal */
|
|
61
94
|
var BriefcaseLocalValue;
|
|
62
95
|
(function (BriefcaseLocalValue) {
|
|
@@ -142,6 +175,25 @@ class IModelDb extends core_common_1.IModel {
|
|
|
142
175
|
_locks = (0, NoLocks_1.createNoOpLockControl)();
|
|
143
176
|
/** @internal */
|
|
144
177
|
_codeService;
|
|
178
|
+
/**
|
|
179
|
+
* The always-available implicit transaction for this iModel.
|
|
180
|
+
*
|
|
181
|
+
* Legacy mutating APIs route through this transaction for backwards compatibility until they are fully migrated to explicit [[EditTxn]] usage.
|
|
182
|
+
* @internal
|
|
183
|
+
*/
|
|
184
|
+
[Symbols_1._implicitTxn];
|
|
185
|
+
/** @internal */
|
|
186
|
+
[Symbols_1._activeTxn];
|
|
187
|
+
/** Returns the active [[EditTxn]] if one is current, otherwise the implicit transaction.
|
|
188
|
+
* Use this inside element and relationship callbacks that may be invoked either during an explicit transaction or
|
|
189
|
+
* during indirect change processing.
|
|
190
|
+
* @note This method is a temporary workaround until [[OnElementArg]] (and related callback arg types) are updated
|
|
191
|
+
* to carry the transaction directly in a future PR.
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
getIndirectTxn() {
|
|
195
|
+
return this[Symbols_1._activeTxn] ?? this[Symbols_1._implicitTxn];
|
|
196
|
+
}
|
|
145
197
|
/** @alpha */
|
|
146
198
|
get codeService() { return this._codeService; }
|
|
147
199
|
/** The [[LockControl]] that orchestrates [concurrent editing]($docs/learning/backend/ConcurrencyControl.md) of this iModel. */
|
|
@@ -230,17 +282,20 @@ class IModelDb extends core_common_1.IModel {
|
|
|
230
282
|
// Make closeIModel available so their code doesn't break.
|
|
231
283
|
this[Symbols_1._nativeDb].closeIModel = () => {
|
|
232
284
|
if (!this.isReadonly)
|
|
233
|
-
this.saveChanges(); // preserve old behavior of closeIModel that was removed when renamed to closeFile
|
|
285
|
+
this[Symbols_1._nativeDb].saveChanges(); // preserve old behavior of closeIModel that was removed when renamed to closeFile
|
|
286
|
+
this[Symbols_1._activeTxn] = undefined;
|
|
234
287
|
this[Symbols_1._nativeDb].closeFile();
|
|
235
288
|
};
|
|
236
289
|
this[Symbols_1._nativeDb].setIModelDb(this);
|
|
237
290
|
this[Symbols_1._resetIModelDb]();
|
|
238
291
|
IModelDb._openDbs.set(this._fileKey, this);
|
|
292
|
+
this[Symbols_1._implicitTxn] = new ImplicitWriteTxn(this);
|
|
293
|
+
this[Symbols_1._activeTxn] = undefined;
|
|
239
294
|
if (undefined === IModelDb._shutdownListener) { // the first time we create an IModelDb, add a listener to close any orphan files at shutdown.
|
|
240
295
|
IModelDb._shutdownListener = IModelHost_1.IModelHost.onBeforeShutdown.addListener(() => {
|
|
241
296
|
IModelDb._openDbs.forEach((db) => {
|
|
242
297
|
try {
|
|
243
|
-
db.abandonChanges();
|
|
298
|
+
db[Symbols_1._nativeDb].abandonChanges();
|
|
244
299
|
db.close();
|
|
245
300
|
}
|
|
246
301
|
catch { }
|
|
@@ -270,8 +325,8 @@ class IModelDb extends core_common_1.IModel {
|
|
|
270
325
|
}
|
|
271
326
|
/**
|
|
272
327
|
* Detach the attached file from this connection. The attached file is closed and its schemas are unregistered.
|
|
273
|
-
* @note There are some
|
|
274
|
-
* @param alias
|
|
328
|
+
* @note There are some reserved table names that cannot be used. They are 'main', 'schema_sync_db', 'ecchange' & 'temp'
|
|
329
|
+
* @param alias identifier that was used in the call to [[attachDb]]
|
|
275
330
|
*
|
|
276
331
|
* @example [[include:IModelDb_attachDb.code]]
|
|
277
332
|
*
|
|
@@ -289,7 +344,13 @@ class IModelDb extends core_common_1.IModel {
|
|
|
289
344
|
close(options) {
|
|
290
345
|
if (!this.isOpen)
|
|
291
346
|
return; // don't continue if already closed
|
|
347
|
+
// Give the active txn a chance to save or abandon before beforeClose() cleanup runs.
|
|
348
|
+
// StandaloneDb.beforeClose() saves any unsaved changes, so onClose() must run first so
|
|
349
|
+
// subclasses that override onClose() to abandon changes can do so before that save.
|
|
350
|
+
if (!this.isReadonly)
|
|
351
|
+
(this[Symbols_1._activeTxn] ?? this[Symbols_1._implicitTxn]).onClose();
|
|
292
352
|
this.beforeClose();
|
|
353
|
+
this[Symbols_1._activeTxn] = undefined;
|
|
293
354
|
if (options?.optimize)
|
|
294
355
|
this.optimize();
|
|
295
356
|
IModelDb._openDbs.delete(this._fileKey);
|
|
@@ -298,10 +359,20 @@ class IModelDb extends core_common_1.IModel {
|
|
|
298
359
|
this._locks = undefined;
|
|
299
360
|
this._codeService?.close();
|
|
300
361
|
this._codeService = undefined;
|
|
301
|
-
if (!this.isReadonly)
|
|
302
|
-
this.saveChanges();
|
|
303
362
|
this[Symbols_1._nativeDb].closeFile();
|
|
304
363
|
}
|
|
364
|
+
saveSchemaChanges(args) {
|
|
365
|
+
if (!this[Symbols_1._nativeDb].hasUnsavedChanges())
|
|
366
|
+
return;
|
|
367
|
+
const saveArgs = typeof args === "string" ? { description: args } : args;
|
|
368
|
+
saveArgs === undefined ? this[Symbols_1._nativeDb].saveChanges() : this[Symbols_1._nativeDb].saveChanges(JSON.stringify(saveArgs));
|
|
369
|
+
}
|
|
370
|
+
abandonSchemaChanges() {
|
|
371
|
+
if (!this[Symbols_1._nativeDb].hasUnsavedChanges())
|
|
372
|
+
return;
|
|
373
|
+
this.clearCaches({ instanceCachesOnly: true });
|
|
374
|
+
this[Symbols_1._nativeDb].abandonChanges();
|
|
375
|
+
}
|
|
305
376
|
/** Optimize this iModel by vacuuming, and analyzing.
|
|
306
377
|
*
|
|
307
378
|
* @note This operation requires exclusive access to the database and may take some time on large files.
|
|
@@ -738,10 +809,10 @@ class IModelDb extends core_common_1.IModel {
|
|
|
738
809
|
* ``` ts
|
|
739
810
|
* [[include:IModelDb.updateProjectExtents]]
|
|
740
811
|
* ```
|
|
812
|
+
* @deprecated Use EditTxn.updateProjectExtents instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
741
813
|
*/
|
|
742
814
|
updateProjectExtents(newExtents) {
|
|
743
|
-
this.
|
|
744
|
-
this.updateIModelProps();
|
|
815
|
+
this[Symbols_1._implicitTxn].updateProjectExtents(newExtents);
|
|
745
816
|
}
|
|
746
817
|
/** Compute an appropriate project extents for this iModel based on the ranges of all spatial elements.
|
|
747
818
|
* Typically, the result is simply the union of the ranges of all spatial elements. However, the algorithm also detects "outlier elements",
|
|
@@ -761,45 +832,26 @@ class IModelDb extends core_common_1.IModel {
|
|
|
761
832
|
outliers: result.outliers,
|
|
762
833
|
};
|
|
763
834
|
}
|
|
764
|
-
/** Update the [EcefLocation]($docs/learning/glossary#eceflocation) of this iModel.
|
|
835
|
+
/** Update the [EcefLocation]($docs/learning/glossary#eceflocation) of this iModel.
|
|
836
|
+
* @deprecated Use EditTxn.updateEcefLocation instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
837
|
+
*/
|
|
765
838
|
updateEcefLocation(ecef) {
|
|
766
|
-
this.
|
|
767
|
-
this.updateIModelProps();
|
|
839
|
+
this[Symbols_1._implicitTxn].updateEcefLocation(ecef);
|
|
768
840
|
}
|
|
769
|
-
/** Update the IModelProps of this iModel in the database.
|
|
841
|
+
/** Update the IModelProps of this iModel in the database.
|
|
842
|
+
* @deprecated Use EditTxn.updateIModelProps instead, within an explicit EditTxn scope (or via withEditTxn).
|
|
843
|
+
*/
|
|
770
844
|
updateIModelProps() {
|
|
771
|
-
this[Symbols_1.
|
|
845
|
+
this[Symbols_1._implicitTxn].updateIModelProps();
|
|
772
846
|
}
|
|
773
|
-
/** Commit unsaved changes in memory as a Txn to this iModelDb.
|
|
774
|
-
* @internal
|
|
775
|
-
* @param descriptionOrArgs Optionally provide description or [[SaveChangesArgs]] args for the changes.
|
|
776
|
-
* @throws [[IModelError]] if there is a problem saving changes or if there are pending, un-processed lock or code requests.
|
|
777
|
-
* @note This will not push changes to the iModelHub.
|
|
778
|
-
* @note This method should not be called from {TxnManager.withIndirectTxnModeAsync}, {TxnManager.withIndirectTxnMode} or {RebaseHandler.recompute}.
|
|
779
|
-
* @see [[IModelDb.pushChanges]] to push changes to the iModelHub.
|
|
780
|
-
*/
|
|
781
847
|
saveChanges(descriptionOrArgs) {
|
|
782
|
-
|
|
783
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.ReadOnly, "IModelDb was opened read-only");
|
|
784
|
-
if (this.isBriefcaseDb()) {
|
|
785
|
-
if (this.txns.isIndirectChanges) {
|
|
786
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, "Cannot save changes while in an indirect change scope");
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
const args = typeof descriptionOrArgs === "string" ? { description: descriptionOrArgs } : descriptionOrArgs;
|
|
790
|
-
const stat = this[Symbols_1._nativeDb].saveChanges(args ? JSON.stringify(args) : undefined);
|
|
791
|
-
if (core_bentley_1.DbResult.BE_SQLITE_ERROR_PropagateChangesFailed === stat)
|
|
792
|
-
throw new core_common_1.IModelError(stat, `Could not save changes due to propagation failure.`);
|
|
793
|
-
if (core_bentley_1.DbResult.BE_SQLITE_OK !== stat)
|
|
794
|
-
throw new core_common_1.IModelError(stat, `Could not save changes (${args?.description})`);
|
|
848
|
+
this[Symbols_1._implicitTxn].saveChanges(descriptionOrArgs);
|
|
795
849
|
}
|
|
796
850
|
/** Abandon changes in memory that have not been saved as a Txn to this iModelDb.
|
|
797
|
-
* @
|
|
851
|
+
* @deprecated Use EditTxn.abandonChanges instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
798
852
|
*/
|
|
799
853
|
abandonChanges() {
|
|
800
|
-
|
|
801
|
-
this.clearCaches({ instanceCachesOnly: true });
|
|
802
|
-
this[Symbols_1._nativeDb].abandonChanges();
|
|
854
|
+
this[Symbols_1._implicitTxn].abandonChanges();
|
|
803
855
|
}
|
|
804
856
|
/**
|
|
805
857
|
* Save all changes and perform a [checkpoint](https://www.sqlite.org/c3ref/wal_checkpoint_v2.html) on this IModelDb.
|
|
@@ -811,7 +863,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
811
863
|
*/
|
|
812
864
|
performCheckpoint() {
|
|
813
865
|
if (!this.isReadonly) {
|
|
814
|
-
this.saveChanges();
|
|
866
|
+
this[Symbols_1._nativeDb].saveChanges();
|
|
815
867
|
this.clearCaches();
|
|
816
868
|
this[Symbols_1._nativeDb].concurrentQueryShutdown();
|
|
817
869
|
this[Symbols_1._nativeDb].performCheckpoint();
|
|
@@ -850,7 +902,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
850
902
|
*
|
|
851
903
|
* If the removal was successful, the database is automatically saved to disk.
|
|
852
904
|
* @param schemaNames Array of schema names to drop
|
|
853
|
-
* @throws [IModelError]
|
|
905
|
+
* @throws [[IModelError]] if the operation fails.
|
|
854
906
|
* @alpha
|
|
855
907
|
*/
|
|
856
908
|
async dropSchemas(schemaNames) {
|
|
@@ -864,11 +916,11 @@ class IModelDb extends core_common_1.IModel {
|
|
|
864
916
|
await this.acquireSchemaLock();
|
|
865
917
|
try {
|
|
866
918
|
this[Symbols_1._nativeDb].dropSchemas(schemaNames);
|
|
867
|
-
this.
|
|
919
|
+
this.saveSchemaChanges("dropped unused schemas");
|
|
868
920
|
}
|
|
869
921
|
catch (error) {
|
|
870
922
|
core_bentley_1.Logger.logError(loggerCategory, `Failed to drop schemas: ${error}`);
|
|
871
|
-
this.
|
|
923
|
+
this.abandonSchemaChanges();
|
|
872
924
|
throw new core_common_1.IModelError(core_bentley_1.DbResult.BE_SQLITE_ERROR, `Failed to drop schemas: ${error}`);
|
|
873
925
|
}
|
|
874
926
|
finally {
|
|
@@ -893,8 +945,9 @@ class IModelDb extends core_common_1.IModel {
|
|
|
893
945
|
transformStrategy: DataTransformationStrategy.None,
|
|
894
946
|
};
|
|
895
947
|
try {
|
|
896
|
-
|
|
897
|
-
|
|
948
|
+
const preSchemaImportCallback = callback?.preSchemaImportCallback;
|
|
949
|
+
if (preSchemaImportCallback) {
|
|
950
|
+
const callbackResult = await preSchemaImportCallback(context);
|
|
898
951
|
callbackResources.transformStrategy = callbackResult.transformStrategy;
|
|
899
952
|
if (callbackResult.transformStrategy === DataTransformationStrategy.Snapshot) {
|
|
900
953
|
// Create temporary snapshot file
|
|
@@ -907,13 +960,12 @@ class IModelDb extends core_common_1.IModel {
|
|
|
907
960
|
}
|
|
908
961
|
callbackResources.cachedData = callbackResult.cachedData;
|
|
909
962
|
}
|
|
910
|
-
if (this.isBriefcaseDb() && IModelHost_1.IModelHost.useSemanticRebase)
|
|
911
|
-
this.
|
|
912
|
-
}
|
|
963
|
+
if (this.isBriefcaseDb() && IModelHost_1.IModelHost.useSemanticRebase)
|
|
964
|
+
this.saveSchemaChanges("Save changes from schema import pre callback");
|
|
913
965
|
}
|
|
914
966
|
}
|
|
915
967
|
catch (callbackError) {
|
|
916
|
-
this.
|
|
968
|
+
this.abandonSchemaChanges();
|
|
917
969
|
this.cleanupSnapshot(callbackResources);
|
|
918
970
|
throw new core_common_1.IModelError(callbackError.errorNumber ?? core_bentley_1.IModelStatus.BadRequest, `Failed to execute preSchemaImportCallback: ${callbackError.message}`);
|
|
919
971
|
}
|
|
@@ -927,14 +979,14 @@ class IModelDb extends core_common_1.IModel {
|
|
|
927
979
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, "InMemory transform strategy requires cachedData to be provided.");
|
|
928
980
|
}
|
|
929
981
|
try {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
982
|
+
const postSchemaImportCallback = callback?.postSchemaImportCallback;
|
|
983
|
+
if (postSchemaImportCallback)
|
|
984
|
+
await postSchemaImportCallback(context);
|
|
985
|
+
if (this.isBriefcaseDb() && IModelHost_1.IModelHost.useSemanticRebase)
|
|
986
|
+
this.saveSchemaChanges("Save changes from schema import post callback");
|
|
935
987
|
}
|
|
936
988
|
catch (callbackError) {
|
|
937
|
-
this.
|
|
989
|
+
this.abandonSchemaChanges();
|
|
938
990
|
throw new core_common_1.IModelError(callbackError.errorNumber ?? core_bentley_1.IModelStatus.BadRequest, `Failed to execute postSchemaImportCallback: ${callbackError.message}`);
|
|
939
991
|
}
|
|
940
992
|
finally {
|
|
@@ -963,15 +1015,15 @@ class IModelDb extends core_common_1.IModel {
|
|
|
963
1015
|
}
|
|
964
1016
|
}
|
|
965
1017
|
if (options?.channelUpgrade) {
|
|
1018
|
+
const channelUpgrade = options.channelUpgrade;
|
|
966
1019
|
try {
|
|
967
|
-
await this.channels.upgradeChannel(
|
|
1020
|
+
await this.channels.upgradeChannel(channelUpgrade, this, options.data);
|
|
968
1021
|
// If semantic rebase is enabled and channel upgrade made changes, save them
|
|
969
|
-
if (this.isBriefcaseDb() && IModelHost_1.IModelHost.useSemanticRebase)
|
|
970
|
-
this.
|
|
971
|
-
}
|
|
1022
|
+
if (this.isBriefcaseDb() && IModelHost_1.IModelHost.useSemanticRebase)
|
|
1023
|
+
this.saveSchemaChanges();
|
|
972
1024
|
}
|
|
973
1025
|
catch (error) {
|
|
974
|
-
this.
|
|
1026
|
+
this.abandonSchemaChanges();
|
|
975
1027
|
throw error;
|
|
976
1028
|
}
|
|
977
1029
|
}
|
|
@@ -982,13 +1034,13 @@ class IModelDb extends core_common_1.IModel {
|
|
|
982
1034
|
if (this[Symbols_1._nativeDb].schemaSyncEnabled()) {
|
|
983
1035
|
await SchemaSync_1.SchemaSync.withLockedAccess(this, { openMode: core_bentley_1.OpenMode.Readonly, operationName: "schema sync" }, async (syncAccess) => {
|
|
984
1036
|
const schemaSyncDbUri = syncAccess.getUri();
|
|
985
|
-
this.
|
|
1037
|
+
this.saveSchemaChanges();
|
|
986
1038
|
try {
|
|
987
1039
|
nativeImportOp(schemas, { schemaLockHeld: false, ecSchemaXmlContext: maybeCustomNativeContext, schemaSyncDbUri });
|
|
988
1040
|
}
|
|
989
1041
|
catch (outerErr) {
|
|
990
1042
|
if (core_bentley_1.DbResult.BE_SQLITE_ERROR_DataTransformRequired === outerErr.errorNumber) {
|
|
991
|
-
this.
|
|
1043
|
+
this.abandonSchemaChanges();
|
|
992
1044
|
if (this[Symbols_1._nativeDb].getITwinId() !== core_bentley_1.Guid.empty)
|
|
993
1045
|
await this.acquireSchemaLock();
|
|
994
1046
|
try {
|
|
@@ -1041,13 +1093,16 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1041
1093
|
if (options?.schemaImportCallbacks?.postSchemaImportCallback)
|
|
1042
1094
|
await this.postSchemaImportCallback(options.schemaImportCallbacks, { iModel: this, resources: preSchemaImportCallbackResult, data: options.data });
|
|
1043
1095
|
}
|
|
1044
|
-
/** Import
|
|
1096
|
+
/** Import ECSchema(s). On success, the schema definition is stored in the iModel.
|
|
1045
1097
|
* This method is asynchronous (must be awaited) because, in the case where this IModelDb is a briefcase, this method first obtains the schema lock from the iModel server.
|
|
1046
1098
|
* You must import a schema into an iModel before you can insert instances of the classes in that schema. See [[Element]]
|
|
1047
|
-
* @param
|
|
1099
|
+
* @param schemaFileNames Files containing serialized ECSchemas.
|
|
1048
1100
|
* @param {SchemaImportOptions} options - options during schema import.
|
|
1049
1101
|
* @throws [[IModelError]] if the schema lock cannot be obtained or there is a problem importing the schema.
|
|
1050
1102
|
* @note Changes are saved if importSchemas is successful and abandoned if not successful.
|
|
1103
|
+
* @note To turn on native logging, use NativeLoggerCategory and a console appender.
|
|
1104
|
+
* - For metadata differences between existing and imported schemas, turn on "ECDb" category.
|
|
1105
|
+
* - For import details, turn on "SchemaImport" category.
|
|
1051
1106
|
* - You can use NativeLoggerCategory to turn on the native logs. You can also control [what exactly is logged by the loggers](https://www.itwinjs.org/learning/common/logging/#controlling-what-is-logged).
|
|
1052
1107
|
* - See [Schema Versioning]($docs/bis/guide/schema-evolution/schema-versioning-and-generations.md) for more information on acceptable changes to schemas.
|
|
1053
1108
|
* @note This method should not be called from {TxnManager.withIndirectTxnModeAsync} or {RebaseHandler.recompute}.
|
|
@@ -1209,7 +1264,7 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1209
1264
|
return this._jsClassMap;
|
|
1210
1265
|
}
|
|
1211
1266
|
/**
|
|
1212
|
-
* Allows locally registering a schema for this imodel, in
|
|
1267
|
+
* Allows locally registering a schema for this imodel, in contrast to [Schemas.registerSchema] which is a global operation
|
|
1213
1268
|
*/
|
|
1214
1269
|
get schemaMap() {
|
|
1215
1270
|
if (this._schemaMap === undefined)
|
|
@@ -1521,26 +1576,18 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1521
1576
|
* @param prop the FilePropertyProps that describes the new property
|
|
1522
1577
|
* @param value either a string or a blob to save as the file property
|
|
1523
1578
|
* @note This method should not be called from {TxnManager.withIndirectTxnModeAsync} or {TxnManager.withIndirectTxnMode}.
|
|
1579
|
+
* @deprecated Use EditTxn.saveFileProperty instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
1524
1580
|
*/
|
|
1525
1581
|
saveFileProperty(prop, strValue, blobVal) {
|
|
1526
|
-
|
|
1527
|
-
if (this.txns.isIndirectChanges) {
|
|
1528
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, "Cannot save file property while in an indirect change scope");
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
this[Symbols_1._nativeDb].saveFileProperty(prop, strValue, blobVal);
|
|
1582
|
+
this[Symbols_1._implicitTxn].saveFileProperty(prop, strValue, blobVal);
|
|
1532
1583
|
}
|
|
1533
1584
|
/** delete a "file property" from this iModel
|
|
1534
1585
|
* @param prop the FilePropertyProps that describes the property
|
|
1535
1586
|
* @note This method should not be called from {TxnManager.withIndirectTxnModeAsync} or {TxnManager.withIndirectTxnMode}.
|
|
1587
|
+
* @deprecated Use EditTxn.deleteFileProperty instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
1536
1588
|
*/
|
|
1537
1589
|
deleteFileProperty(prop) {
|
|
1538
|
-
|
|
1539
|
-
if (this.txns.isIndirectChanges) {
|
|
1540
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, "Cannot delete file property while in an indirect change scope");
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
this[Symbols_1._nativeDb].saveFileProperty(prop, undefined, undefined);
|
|
1590
|
+
this[Symbols_1._implicitTxn].deleteFileProperty(prop);
|
|
1544
1591
|
}
|
|
1545
1592
|
/** Query for the next available major id for a "file property" from this iModel.
|
|
1546
1593
|
* @param prop the FilePropertyProps that describes the property
|
|
@@ -1744,28 +1791,17 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1744
1791
|
* @param name The name for the SettingDictionary. If a dictionary by that name already exists in the iModel, its value is replaced.
|
|
1745
1792
|
* @param dict The SettingDictionary object to stringify and save.
|
|
1746
1793
|
* @note All saved `SettingDictionary`s are loaded into [[workspace.settings]] every time an iModel is opened.
|
|
1747
|
-
* @beta
|
|
1794
|
+
* @beta @deprecated Use EditTxn.saveSettingDictionary instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
1748
1795
|
*/
|
|
1749
1796
|
saveSettingDictionary(name, dict) {
|
|
1750
|
-
this.
|
|
1751
|
-
stmt.bindString(1, IModelDb._settingPropNamespace);
|
|
1752
|
-
stmt.bindString(2, name);
|
|
1753
|
-
stmt.bindString(3, JSON.stringify(dict));
|
|
1754
|
-
stmt.stepForWrite();
|
|
1755
|
-
});
|
|
1756
|
-
this.saveChanges("add settings");
|
|
1797
|
+
this[Symbols_1._implicitTxn].saveSettingDictionary(name, dict);
|
|
1757
1798
|
}
|
|
1758
1799
|
/** Delete a SettingDictionary, previously added with [[saveSettingDictionary]], from this iModel.
|
|
1759
1800
|
* @param name The name of the dictionary to delete.
|
|
1760
|
-
* @beta
|
|
1801
|
+
* @beta @deprecated Use EditTxn.deleteSettingDictionary instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
1761
1802
|
*/
|
|
1762
1803
|
deleteSettingDictionary(name) {
|
|
1763
|
-
this.
|
|
1764
|
-
stmt.bindString(1, IModelDb._settingPropNamespace);
|
|
1765
|
-
stmt.bindString(2, name);
|
|
1766
|
-
stmt.stepForWrite();
|
|
1767
|
-
});
|
|
1768
|
-
this.saveChanges("delete settings");
|
|
1804
|
+
this[Symbols_1._implicitTxn].deleteSettingDictionary(name);
|
|
1769
1805
|
}
|
|
1770
1806
|
/** Load all setting dictionaries in this iModel into `this.workspace.settings` */
|
|
1771
1807
|
loadIModelSettings() {
|
|
@@ -2041,33 +2077,19 @@ function processSchemaWriteStatus(status) {
|
|
|
2041
2077
|
/** Insert a new model.
|
|
2042
2078
|
* @param props The data for the new model.
|
|
2043
2079
|
* @returns The newly inserted model's Id.
|
|
2044
|
-
* @throws [[IModelError]] if
|
|
2080
|
+
* @throws [[IModelError]] if insertion fails.
|
|
2081
|
+
* @deprecated Use EditTxn.insertModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2045
2082
|
*/
|
|
2046
2083
|
insertModel(props) {
|
|
2047
|
-
|
|
2048
|
-
return props.id = this._iModel[Symbols_1._nativeDb].insertModel(props);
|
|
2049
|
-
}
|
|
2050
|
-
catch (err) {
|
|
2051
|
-
const error = new core_common_1.IModelError(err.errorNumber, `Error inserting model [${err.message}], class=${props.classFullName}`);
|
|
2052
|
-
error.cause = err;
|
|
2053
|
-
throw error;
|
|
2054
|
-
}
|
|
2084
|
+
return this._iModel[Symbols_1._implicitTxn].insertModel(props);
|
|
2055
2085
|
}
|
|
2056
2086
|
/** Update an existing model.
|
|
2057
2087
|
* @param props the properties of the model to change
|
|
2058
|
-
* @throws [[IModelError]] if
|
|
2088
|
+
* @throws [[IModelError]] if update fails.
|
|
2089
|
+
* @deprecated Use EditTxn.updateModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2059
2090
|
*/
|
|
2060
2091
|
updateModel(props) {
|
|
2061
|
-
|
|
2062
|
-
if (props.id)
|
|
2063
|
-
this[Symbols_1._cache].delete(props.id);
|
|
2064
|
-
this._iModel[Symbols_1._nativeDb].updateModel(props);
|
|
2065
|
-
}
|
|
2066
|
-
catch (err) {
|
|
2067
|
-
const error = new core_common_1.IModelError(err.errorNumber, `Error updating model [${err.message}], id: ${props.id}`);
|
|
2068
|
-
error.cause = err;
|
|
2069
|
-
throw error;
|
|
2070
|
-
}
|
|
2092
|
+
this._iModel[Symbols_1._implicitTxn].updateModel(props);
|
|
2071
2093
|
}
|
|
2072
2094
|
/** Mark the geometry of [[GeometricModel]] as having changed, by recording an indirect change to its GeometryGuid property.
|
|
2073
2095
|
* Typically the GeometryGuid changes automatically when [[GeometricElement]]s within the model are modified, but
|
|
@@ -2075,32 +2097,20 @@ function processSchemaWriteStatus(status) {
|
|
|
2075
2097
|
* [[GeometricElement]]s that reference those definition elements in their geometry streams.
|
|
2076
2098
|
* Cached [Tile]($frontend)s are only invalidated after the geometry guid of the model changes.
|
|
2077
2099
|
* @note This will throw IModelError with [IModelStatus.VersionTooOld]($core-bentley) if a version of the BisCore schema older than 1.0.11 is present in the iModel.
|
|
2078
|
-
* @throws IModelError if
|
|
2100
|
+
* @throws [[IModelError]] if the update fails.
|
|
2101
|
+
* @deprecated Use EditTxn.updateGeometryGuid instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2079
2102
|
* @see [[TxnManager.onModelGeometryChanged]] for the event emitted in response to such a change.
|
|
2080
2103
|
*/
|
|
2081
2104
|
updateGeometryGuid(modelId) {
|
|
2082
|
-
this._iModel
|
|
2083
|
-
const error = this._iModel[Symbols_1._nativeDb].updateModelGeometryGuid(modelId);
|
|
2084
|
-
if (error !== core_bentley_1.IModelStatus.Success)
|
|
2085
|
-
throw new core_common_1.IModelError(error, `Error updating geometry guid for model ${modelId}`);
|
|
2105
|
+
this._iModel[Symbols_1._implicitTxn].updateGeometryGuid(modelId);
|
|
2086
2106
|
}
|
|
2087
2107
|
/** Delete one or more existing models.
|
|
2088
2108
|
* @param ids The Ids of the models to be deleted
|
|
2089
|
-
* @throws [[IModelError]]
|
|
2109
|
+
* @throws [[IModelError]] if deletion fails.
|
|
2110
|
+
* @deprecated Use EditTxn.deleteModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2090
2111
|
*/
|
|
2091
2112
|
deleteModel(ids) {
|
|
2092
|
-
|
|
2093
|
-
try {
|
|
2094
|
-
this[Symbols_1._cache].delete(id);
|
|
2095
|
-
this[Symbols_1._instanceKeyCache].deleteById(id);
|
|
2096
|
-
this._iModel[Symbols_1._nativeDb].deleteModel(id);
|
|
2097
|
-
}
|
|
2098
|
-
catch (err) {
|
|
2099
|
-
const error = new core_common_1.IModelError(err.errorNumber, `Error deleting model [${err.message}], id: ${id}`);
|
|
2100
|
-
error.cause = err;
|
|
2101
|
-
throw error;
|
|
2102
|
-
}
|
|
2103
|
-
});
|
|
2113
|
+
this._iModel[Symbols_1._implicitTxn].deleteModel(ids);
|
|
2104
2114
|
}
|
|
2105
2115
|
/** For each specified [[GeometricModel]], attempts to obtain the union of the volumes of all geometric elements within that model.
|
|
2106
2116
|
* @param ids The Id or Ids of the [[GeometricModel]]s for which to obtain the extents.
|
|
@@ -2318,26 +2328,15 @@ function processSchemaWriteStatus(status) {
|
|
|
2318
2328
|
/** Insert a new element into the iModel.
|
|
2319
2329
|
* @param elProps The properties of the new element.
|
|
2320
2330
|
* @returns The newly inserted element's Id.
|
|
2321
|
-
* @throws [[ITwinError]] if
|
|
2331
|
+
* @throws [[ITwinError]] if insertion fails.
|
|
2322
2332
|
* @note For convenience, the value of `elProps.id` is updated to reflect the resultant element's id.
|
|
2323
2333
|
* However when `elProps.federationGuid` is not present or undefined, a new Guid will be generated and stored on the resultant element. But
|
|
2324
2334
|
* the value of `elProps.federationGuid` is *not* updated. Generally, it is best to re-read the element after inserting (e.g. via [[getElementProps]])
|
|
2325
2335
|
* if you intend to continue working with it. That will ensure its values reflect the persistent state.
|
|
2336
|
+
* @deprecated Use EditTxn.insertElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2326
2337
|
*/
|
|
2327
2338
|
insertElement(elProps, options) {
|
|
2328
|
-
|
|
2329
|
-
this[Symbols_1._cache].delete({
|
|
2330
|
-
id: elProps.id,
|
|
2331
|
-
federationGuid: elProps.federationGuid,
|
|
2332
|
-
code: elProps.code,
|
|
2333
|
-
});
|
|
2334
|
-
return elProps.id = this._iModel[Symbols_1._nativeDb].insertElement(elProps, options);
|
|
2335
|
-
}
|
|
2336
|
-
catch (err) {
|
|
2337
|
-
err.message = `Error inserting element [${err.message}]`;
|
|
2338
|
-
err.metadata = { elProps };
|
|
2339
|
-
throw err;
|
|
2340
|
-
}
|
|
2339
|
+
return this._iModel[Symbols_1._implicitTxn].insertElement(elProps, options);
|
|
2341
2340
|
}
|
|
2342
2341
|
/**
|
|
2343
2342
|
* Update some properties of an existing element.
|
|
@@ -2348,126 +2347,33 @@ function processSchemaWriteStatus(status) {
|
|
|
2348
2347
|
* @param elProps the properties of the element to update.
|
|
2349
2348
|
* @note The values of `classFullName` and `model` *may not be changed* by this method. Further, it will permute the `elProps` object by adding or
|
|
2350
2349
|
* overwriting their values to the correct values.
|
|
2351
|
-
* @throws [[ITwinError]] if
|
|
2350
|
+
* @throws [[ITwinError]] if update fails.
|
|
2351
|
+
* @deprecated Use EditTxn.updateElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2352
2352
|
*/
|
|
2353
2353
|
updateElement(elProps) {
|
|
2354
|
-
|
|
2355
|
-
if (elProps.id) {
|
|
2356
|
-
this[Symbols_1._instanceKeyCache].deleteById(elProps.id);
|
|
2357
|
-
}
|
|
2358
|
-
else {
|
|
2359
|
-
this[Symbols_1._instanceKeyCache].delete({
|
|
2360
|
-
federationGuid: elProps.federationGuid,
|
|
2361
|
-
code: elProps.code,
|
|
2362
|
-
});
|
|
2363
|
-
}
|
|
2364
|
-
this[Symbols_1._cache].delete({
|
|
2365
|
-
id: elProps.id,
|
|
2366
|
-
federationGuid: elProps.federationGuid,
|
|
2367
|
-
code: elProps.code,
|
|
2368
|
-
});
|
|
2369
|
-
this._iModel[Symbols_1._nativeDb].updateElement(elProps);
|
|
2370
|
-
}
|
|
2371
|
-
catch (err) {
|
|
2372
|
-
err.message = `Error updating element [${err.message}], id: ${elProps.id}`;
|
|
2373
|
-
err.metadata = { elProps };
|
|
2374
|
-
throw err;
|
|
2375
|
-
}
|
|
2354
|
+
this._iModel[Symbols_1._implicitTxn].updateElement(elProps);
|
|
2376
2355
|
}
|
|
2377
2356
|
/** Delete one or more elements from this iModel.
|
|
2378
2357
|
* @param ids The set of Ids of the element(s) to be deleted
|
|
2379
2358
|
* @throws [[ITwinError]]
|
|
2380
2359
|
* @see deleteDefinitionElements
|
|
2360
|
+
* @deprecated Use EditTxn.deleteElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2381
2361
|
*/
|
|
2382
2362
|
deleteElement(ids) {
|
|
2383
|
-
|
|
2384
|
-
core_bentley_1.Id64.toIdSet(ids).forEach((id) => {
|
|
2385
|
-
try {
|
|
2386
|
-
this[Symbols_1._cache].delete({ id });
|
|
2387
|
-
this[Symbols_1._instanceKeyCache].deleteById(id);
|
|
2388
|
-
iModel[Symbols_1._nativeDb].deleteElement(id);
|
|
2389
|
-
}
|
|
2390
|
-
catch (err) {
|
|
2391
|
-
err.message = `Error deleting element [${err.message}], id: ${id}`;
|
|
2392
|
-
err.metadata = { elementId: id };
|
|
2393
|
-
throw err;
|
|
2394
|
-
}
|
|
2395
|
-
});
|
|
2363
|
+
this._iModel[Symbols_1._implicitTxn].deleteElement(ids);
|
|
2396
2364
|
}
|
|
2397
2365
|
/** DefinitionElements can only be deleted if it can be determined that they are not referenced by other Elements.
|
|
2398
2366
|
* This *usage query* can be expensive since it may involve scanning the GeometryStreams of all GeometricElements.
|
|
2399
2367
|
* Since [[deleteElement]] does not perform these additional checks, it fails in order to prevent potentially referenced DefinitionElements from being deleted.
|
|
2400
2368
|
* This method performs those expensive checks and then calls *delete* if not referenced.
|
|
2401
|
-
* @param
|
|
2369
|
+
* @param definitionElementIds The Ids of the DefinitionElements to attempt to delete. To prevent multiple passes over the same GeometricElements, it is best to pass in the entire array of
|
|
2402
2370
|
* DefinitionElements rather than calling this method separately for each one. Ids that are not valid DefinitionElements will be ignored.
|
|
2403
2371
|
* @returns An IdSet of the DefinitionElements that are used and were therefore not deleted.
|
|
2404
2372
|
* @see deleteElement
|
|
2405
|
-
* @
|
|
2373
|
+
* @deprecated Use EditTxn.deleteDefinitionElements instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2406
2374
|
*/
|
|
2407
2375
|
deleteDefinitionElements(definitionElementIds) {
|
|
2408
|
-
|
|
2409
|
-
if (!usageInfo) {
|
|
2410
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, "Error querying for DefinitionElement usage");
|
|
2411
|
-
}
|
|
2412
|
-
const usedIdSet = usageInfo.usedIds ? core_bentley_1.Id64.toIdSet(usageInfo.usedIds) : new Set();
|
|
2413
|
-
const deleteIfUnused = (ids, used) => {
|
|
2414
|
-
if (ids) {
|
|
2415
|
-
ids.forEach((id) => {
|
|
2416
|
-
if (!used.has(id))
|
|
2417
|
-
this._iModel.elements.deleteElement(id);
|
|
2418
|
-
});
|
|
2419
|
-
}
|
|
2420
|
-
};
|
|
2421
|
-
try {
|
|
2422
|
-
this._iModel[Symbols_1._nativeDb].beginPurgeOperation();
|
|
2423
|
-
deleteIfUnused(usageInfo.spatialCategoryIds, usedIdSet);
|
|
2424
|
-
deleteIfUnused(usageInfo.drawingCategoryIds, usedIdSet);
|
|
2425
|
-
deleteIfUnused(usageInfo.viewDefinitionIds, usedIdSet);
|
|
2426
|
-
deleteIfUnused(usageInfo.geometryPartIds, usedIdSet);
|
|
2427
|
-
deleteIfUnused(usageInfo.lineStyleIds, usedIdSet);
|
|
2428
|
-
deleteIfUnused(usageInfo.renderMaterialIds, usedIdSet);
|
|
2429
|
-
deleteIfUnused(usageInfo.subCategoryIds, usedIdSet);
|
|
2430
|
-
deleteIfUnused(usageInfo.textureIds, usedIdSet);
|
|
2431
|
-
deleteIfUnused(usageInfo.displayStyleIds, usedIdSet);
|
|
2432
|
-
deleteIfUnused(usageInfo.categorySelectorIds, usedIdSet);
|
|
2433
|
-
deleteIfUnused(usageInfo.modelSelectorIds, usedIdSet);
|
|
2434
|
-
if (usageInfo.otherDefinitionElementIds) {
|
|
2435
|
-
this._iModel.elements.deleteElement(usageInfo.otherDefinitionElementIds);
|
|
2436
|
-
}
|
|
2437
|
-
}
|
|
2438
|
-
finally {
|
|
2439
|
-
this._iModel[Symbols_1._nativeDb].endPurgeOperation();
|
|
2440
|
-
}
|
|
2441
|
-
if (usageInfo.viewDefinitionIds) {
|
|
2442
|
-
// take another pass in case a deleted ViewDefinition was the only usage of these view-related DefinitionElements
|
|
2443
|
-
let viewRelatedIds = [];
|
|
2444
|
-
if (usageInfo.displayStyleIds)
|
|
2445
|
-
viewRelatedIds = viewRelatedIds.concat(usageInfo.displayStyleIds.filter((id) => usedIdSet.has(id)));
|
|
2446
|
-
if (usageInfo.categorySelectorIds)
|
|
2447
|
-
viewRelatedIds = viewRelatedIds.concat(usageInfo.categorySelectorIds.filter((id) => usedIdSet.has(id)));
|
|
2448
|
-
if (usageInfo.modelSelectorIds)
|
|
2449
|
-
viewRelatedIds = viewRelatedIds.concat(usageInfo.modelSelectorIds.filter((id) => usedIdSet.has(id)));
|
|
2450
|
-
if (viewRelatedIds.length > 0) {
|
|
2451
|
-
const viewRelatedUsageInfo = this._iModel[Symbols_1._nativeDb].queryDefinitionElementUsage(viewRelatedIds);
|
|
2452
|
-
if (viewRelatedUsageInfo) {
|
|
2453
|
-
const usedViewRelatedIdSet = viewRelatedUsageInfo.usedIds ? core_bentley_1.Id64.toIdSet(viewRelatedUsageInfo.usedIds) : new Set();
|
|
2454
|
-
try {
|
|
2455
|
-
this._iModel[Symbols_1._nativeDb].beginPurgeOperation();
|
|
2456
|
-
deleteIfUnused(viewRelatedUsageInfo.displayStyleIds, usedViewRelatedIdSet);
|
|
2457
|
-
deleteIfUnused(viewRelatedUsageInfo.categorySelectorIds, usedViewRelatedIdSet);
|
|
2458
|
-
deleteIfUnused(viewRelatedUsageInfo.modelSelectorIds, usedViewRelatedIdSet);
|
|
2459
|
-
}
|
|
2460
|
-
finally {
|
|
2461
|
-
this._iModel[Symbols_1._nativeDb].endPurgeOperation();
|
|
2462
|
-
}
|
|
2463
|
-
viewRelatedIds.forEach((id) => {
|
|
2464
|
-
if (!usedViewRelatedIdSet.has(id))
|
|
2465
|
-
usedIdSet.delete(id);
|
|
2466
|
-
});
|
|
2467
|
-
}
|
|
2468
|
-
}
|
|
2469
|
-
}
|
|
2470
|
-
return usedIdSet;
|
|
2376
|
+
return this._iModel[Symbols_1._implicitTxn].deleteDefinitionElements(definitionElementIds);
|
|
2471
2377
|
}
|
|
2472
2378
|
/** Query for the child elements of the specified element.
|
|
2473
2379
|
* @returns Returns an array of child element identifiers.
|
|
@@ -2604,9 +2510,9 @@ function processSchemaWriteStatus(status) {
|
|
|
2604
2510
|
*/
|
|
2605
2511
|
getAspects(elementId, aspectClassFullName, excludedClassFullNames) {
|
|
2606
2512
|
if (aspectClassFullName === undefined) {
|
|
2607
|
-
const allAspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2608
|
-
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId
|
|
2609
|
-
UNION ALL
|
|
2513
|
+
const allAspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2514
|
+
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId
|
|
2515
|
+
UNION ALL
|
|
2610
2516
|
SELECT ECInstanceId, ECClassId FROM Bis.ElementUniqueAspect WHERE Element.Id = :elementId) OPTIONS USE_JS_PROP_NAMES DO_NOT_TRUNCATE_BLOB`, elementId, excludedClassFullNames);
|
|
2611
2517
|
if (allAspects.length === 0)
|
|
2612
2518
|
core_bentley_1.Logger.logInfo(BackendLoggerCategory_1.BackendLoggerCategory.ECDb, `No aspects found for class ${aspectClassFullName} and element ${elementId}`);
|
|
@@ -2626,7 +2532,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2626
2532
|
if (classIdList === undefined) {
|
|
2627
2533
|
const classIds = [];
|
|
2628
2534
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2629
|
-
this._iModel.withPreparedStatement(`select SourceECInstanceId from meta.ClassHasAllBaseClasses where TargetECInstanceId = (select ECInstanceId from meta.ECClassDef where Name='${fullClassName[1]}'
|
|
2535
|
+
this._iModel.withPreparedStatement(`select SourceECInstanceId from meta.ClassHasAllBaseClasses where TargetECInstanceId = (select ECInstanceId from meta.ECClassDef where Name='${fullClassName[1]}'
|
|
2630
2536
|
and Schema.Id = (select ECInstanceId from meta.ECSchemaDef where Name='${fullClassName[0]}')) and SourceECInstanceId != TargetECInstanceId`,
|
|
2631
2537
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2632
2538
|
(statement) => {
|
|
@@ -2643,10 +2549,10 @@ function processSchemaWriteStatus(status) {
|
|
|
2643
2549
|
return [];
|
|
2644
2550
|
}
|
|
2645
2551
|
// Execute an instance query to retrieve all aspects from all the derived classes
|
|
2646
|
-
const aspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2647
|
-
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2648
|
-
UNION ALL
|
|
2649
|
-
SELECT ECInstanceId, ECClassId FROM Bis.ElementUniqueAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2552
|
+
const aspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2553
|
+
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2554
|
+
UNION ALL
|
|
2555
|
+
SELECT ECInstanceId, ECClassId FROM Bis.ElementUniqueAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2650
2556
|
) OPTIONS USE_JS_PROP_NAMES DO_NOT_TRUNCATE_BLOB`, elementId, excludedClassFullNames);
|
|
2651
2557
|
if (aspects.length === 0)
|
|
2652
2558
|
core_bentley_1.Logger.logInfo(BackendLoggerCategory_1.BackendLoggerCategory.ECDb, `No aspects found for class ${aspectClassFullName} and element ${elementId}`);
|
|
@@ -2658,47 +2564,26 @@ function processSchemaWriteStatus(status) {
|
|
|
2658
2564
|
* @returns the id of the newly inserted aspect.
|
|
2659
2565
|
* @note Aspect Ids may collide with element Ids, so don't put both in a container like Set or Map
|
|
2660
2566
|
* use [EntityReference]($common) for that instead.
|
|
2567
|
+
* @deprecated Use EditTxn.insertAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2661
2568
|
*/
|
|
2662
2569
|
insertAspect(aspectProps) {
|
|
2663
|
-
|
|
2664
|
-
return this._iModel[Symbols_1._nativeDb].insertElementAspect(aspectProps);
|
|
2665
|
-
}
|
|
2666
|
-
catch (err) {
|
|
2667
|
-
const error = new core_common_1.IModelError(err.errorNumber, `Error inserting ElementAspect [${err.message}], class: ${aspectProps.classFullName}`, aspectProps);
|
|
2668
|
-
error.cause = err;
|
|
2669
|
-
throw error;
|
|
2670
|
-
}
|
|
2570
|
+
return this._iModel[Symbols_1._implicitTxn].insertAspect(aspectProps);
|
|
2671
2571
|
}
|
|
2672
2572
|
/** Update an exist ElementAspect within the iModel.
|
|
2673
2573
|
* @param aspectProps The properties to use to update the ElementAspect.
|
|
2674
2574
|
* @throws [[IModelError]] if unable to update the ElementAspect.
|
|
2575
|
+
* @deprecated Use EditTxn.updateAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2675
2576
|
*/
|
|
2676
2577
|
updateAspect(aspectProps) {
|
|
2677
|
-
|
|
2678
|
-
this._iModel[Symbols_1._nativeDb].updateElementAspect(aspectProps);
|
|
2679
|
-
}
|
|
2680
|
-
catch (err) {
|
|
2681
|
-
const error = new core_common_1.IModelError(err.errorNumber, `Error updating ElementAspect [${err.message}], id: ${aspectProps.id}`, aspectProps);
|
|
2682
|
-
error.cause = err;
|
|
2683
|
-
throw error;
|
|
2684
|
-
}
|
|
2578
|
+
this._iModel[Symbols_1._implicitTxn].updateAspect(aspectProps);
|
|
2685
2579
|
}
|
|
2686
2580
|
/** Delete one or more ElementAspects from this iModel.
|
|
2687
2581
|
* @param aspectInstanceIds The set of instance Ids of the ElementAspect(s) to be deleted
|
|
2688
2582
|
* @throws [[IModelError]] if unable to delete the ElementAspect.
|
|
2583
|
+
* @deprecated Use EditTxn.deleteAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2689
2584
|
*/
|
|
2690
2585
|
deleteAspect(aspectInstanceIds) {
|
|
2691
|
-
|
|
2692
|
-
core_bentley_1.Id64.toIdSet(aspectInstanceIds).forEach((aspectInstanceId) => {
|
|
2693
|
-
try {
|
|
2694
|
-
iModel[Symbols_1._nativeDb].deleteElementAspect(aspectInstanceId);
|
|
2695
|
-
}
|
|
2696
|
-
catch (err) {
|
|
2697
|
-
const error = new core_common_1.IModelError(err.errorNumber, `Error deleting ElementAspect [${err.message}], id: ${aspectInstanceId}`);
|
|
2698
|
-
error.cause = err;
|
|
2699
|
-
throw error;
|
|
2700
|
-
}
|
|
2701
|
-
});
|
|
2586
|
+
this._iModel[Symbols_1._implicitTxn].deleteAspect(aspectInstanceIds);
|
|
2702
2587
|
}
|
|
2703
2588
|
}
|
|
2704
2589
|
IModelDb.Elements = Elements;
|
|
@@ -2741,11 +2626,11 @@ function processSchemaWriteStatus(status) {
|
|
|
2741
2626
|
this._viewStore.container.accessToken = accessToken;
|
|
2742
2627
|
return this._viewStore;
|
|
2743
2628
|
}
|
|
2744
|
-
/**
|
|
2629
|
+
/**
|
|
2630
|
+
* @beta @deprecated Use EditTxn.saveDefaultViewStore instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2631
|
+
*/
|
|
2745
2632
|
saveDefaultViewStore(arg) {
|
|
2746
|
-
|
|
2747
|
-
this._iModel.saveFileProperty(Views.viewStoreProperty, JSON.stringify(props));
|
|
2748
|
-
this._iModel.saveChanges("update default ViewStore");
|
|
2633
|
+
this._iModel[Symbols_1._implicitTxn].saveDefaultViewStore(arg);
|
|
2749
2634
|
}
|
|
2750
2635
|
/** Query for the array of ViewDefinitionProps of the specified class and matching the specified IsPrivate setting.
|
|
2751
2636
|
* @param className Query for view definitions of this class.
|
|
@@ -2888,7 +2773,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2888
2773
|
blob32[0] = core_bentley_1.Id64.getLowerUint32(viewId);
|
|
2889
2774
|
blob32[1] = core_bentley_1.Id64.getUpperUint32(viewId);
|
|
2890
2775
|
const blob8 = new Uint8Array(blob32.buffer);
|
|
2891
|
-
this._iModel.saveFileProperty(spec, undefined, blob8);
|
|
2776
|
+
this._iModel[Symbols_1._implicitTxn].saveFileProperty(spec, undefined, blob8);
|
|
2892
2777
|
}
|
|
2893
2778
|
}
|
|
2894
2779
|
IModelDb.Views = Views;
|
|
@@ -3092,7 +2977,7 @@ class BriefcaseDb extends IModelDb {
|
|
|
3092
2977
|
executeUpgrade();
|
|
3093
2978
|
await withBriefcaseDb(briefcase, async (db) => {
|
|
3094
2979
|
db[Symbols_1._nativeDb].schemaSyncPush(schemaSyncDbUri);
|
|
3095
|
-
db.saveChanges();
|
|
2980
|
+
db[Symbols_1._nativeDb].saveChanges();
|
|
3096
2981
|
});
|
|
3097
2982
|
syncAccess.synchronizeWithCloud();
|
|
3098
2983
|
});
|
|
@@ -3457,7 +3342,7 @@ class BriefcaseDb extends IModelDb {
|
|
|
3457
3342
|
}
|
|
3458
3343
|
try {
|
|
3459
3344
|
await BriefcaseManager_1.BriefcaseManager.revertTimelineChanges(this, arg);
|
|
3460
|
-
this.saveChanges("Revert changes");
|
|
3345
|
+
this[Symbols_1._nativeDb].saveChanges("Revert changes");
|
|
3461
3346
|
if (!arg.description) {
|
|
3462
3347
|
arg.description = `Reverted changes from ${this.changeset.index} to ${arg.toIndex}${arg.skipSchemaChanges ? " (schema changes skipped)" : ""}`;
|
|
3463
3348
|
}
|
|
@@ -3480,7 +3365,7 @@ class BriefcaseDb extends IModelDb {
|
|
|
3480
3365
|
}
|
|
3481
3366
|
}
|
|
3482
3367
|
finally {
|
|
3483
|
-
this.abandonChanges();
|
|
3368
|
+
this[Symbols_1._nativeDb].abandonChanges();
|
|
3484
3369
|
}
|
|
3485
3370
|
}
|
|
3486
3371
|
/**
|
|
@@ -3510,7 +3395,7 @@ class BriefcaseDb extends IModelDb {
|
|
|
3510
3395
|
}
|
|
3511
3396
|
close(options) {
|
|
3512
3397
|
if (this.isBriefcase && this.isOpen && !this.isReadonly && this.txns.rebaser.inProgress()) {
|
|
3513
|
-
this.abandonChanges();
|
|
3398
|
+
this[Symbols_1._nativeDb].abandonChanges();
|
|
3514
3399
|
}
|
|
3515
3400
|
super.close(options);
|
|
3516
3401
|
this.onClosed.raiseEvent();
|
|
@@ -3728,7 +3613,7 @@ class SnapshotDb extends IModelDb {
|
|
|
3728
3613
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.SQLiteError, "Error creating class views");
|
|
3729
3614
|
}
|
|
3730
3615
|
else {
|
|
3731
|
-
this.saveChanges();
|
|
3616
|
+
this[Symbols_1._nativeDb].saveChanges();
|
|
3732
3617
|
}
|
|
3733
3618
|
}
|
|
3734
3619
|
}
|
|
@@ -3759,15 +3644,16 @@ class StandaloneDb extends BriefcaseDb {
|
|
|
3759
3644
|
}
|
|
3760
3645
|
/**
|
|
3761
3646
|
* @internal
|
|
3762
|
-
* Called during close of the
|
|
3647
|
+
* Called during close of the StandaloneDb. It will delete any pending txns.
|
|
3763
3648
|
*/
|
|
3764
3649
|
beforeClose() {
|
|
3765
3650
|
super.beforeClose();
|
|
3766
|
-
if (
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3651
|
+
if (this.isReadonly || !this.txns.hasLocalChanges)
|
|
3652
|
+
return;
|
|
3653
|
+
const nativeDb = this[Symbols_1._nativeDb];
|
|
3654
|
+
nativeDb.saveChanges();
|
|
3655
|
+
nativeDb.deleteAllTxns();
|
|
3656
|
+
nativeDb.saveChanges();
|
|
3771
3657
|
}
|
|
3772
3658
|
static tryFindByKey(key) {
|
|
3773
3659
|
const db = super.tryFindByKey(key);
|
|
@@ -3823,7 +3709,7 @@ class StandaloneDb extends BriefcaseDb {
|
|
|
3823
3709
|
if (core_bentley_1.BentleyStatus.SUCCESS !== result)
|
|
3824
3710
|
throw new core_common_1.IModelError(result, "Error creating class views");
|
|
3825
3711
|
else
|
|
3826
|
-
this.saveChanges();
|
|
3712
|
+
this[Symbols_1._nativeDb].saveChanges();
|
|
3827
3713
|
}
|
|
3828
3714
|
/** Open a standalone iModel file.
|
|
3829
3715
|
* @param filePath The path of the standalone iModel file.
|