@itwin/core-backend 5.1.0-dev.9 → 5.1.1
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 +160 -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/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
- package/lib/cjs/BisCoreSchema.js +4 -2
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.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 +16 -0
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CatalogDb.js.map +1 -1
- package/lib/cjs/Category.d.ts +4 -4
- package/lib/cjs/Category.js +4 -4
- 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 +67 -8
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +490 -275
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts +9 -1
- package/lib/cjs/ClassRegistry.d.ts.map +1 -1
- package/lib/cjs/ClassRegistry.js +14 -6
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.js +1 -1
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.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/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 +4 -4
- package/lib/cjs/DisplayStyle.js +3 -3
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +4 -4
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +4 -4
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +15 -6
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +19 -4
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +54 -51
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +67 -52
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +8 -8
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +8 -8
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.d.ts +10 -7
- package/lib/cjs/Entity.d.ts.map +1 -1
- package/lib/cjs/Entity.js +35 -13
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.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/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.d.ts +6 -2
- package/lib/cjs/GeographicCRSServices.d.ts.map +1 -1
- package/lib/cjs/GeographicCRSServices.js +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 +37 -26
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +132 -55
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelDbFonts.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 +2 -3
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +2 -3
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.d.ts +36 -0
- package/lib/cjs/IModelIncrementalSchemaLocater.d.ts.map +1 -0
- package/lib/cjs/IModelIncrementalSchemaLocater.js +69 -0
- package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -0
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/ImageSourceConversion.js.map +1 -1
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.d.ts.map +1 -1
- package/lib/cjs/LocalHub.js +6 -4
- 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 +4 -3
- package/lib/cjs/Material.d.ts.map +1 -1
- package/lib/cjs/Material.js +5 -5
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +22 -22
- package/lib/cjs/Model.js +22 -22
- 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 +3 -0
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +15 -0
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +1 -1
- package/lib/cjs/SQLiteDb.js +1 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.d.ts +25 -0
- package/lib/cjs/Schema.d.ts.map +1 -1
- package/lib/cjs/Schema.js +25 -0
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.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/Texture.d.ts +1 -1
- package/lib/cjs/Texture.js +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +4 -4
- package/lib/cjs/TxnManager.js +1 -1
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +40 -14
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +42 -14
- 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 +61 -0
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +110 -0
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -0
- package/lib/cjs/annotations/FrameGeometry.d.ts +51 -0
- package/lib/cjs/annotations/FrameGeometry.d.ts.map +1 -0
- package/lib/cjs/annotations/FrameGeometry.js +249 -0
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -0
- package/lib/cjs/annotations/LeaderGeometry.d.ts +53 -0
- package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -0
- package/lib/cjs/annotations/LeaderGeometry.js +184 -0
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -0
- package/lib/cjs/annotations/TextAnnotationElement.d.ts +204 -0
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -0
- package/lib/cjs/annotations/TextAnnotationElement.js +411 -0
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +33 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.js +137 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -0
- package/lib/cjs/annotations/TextBlockGeometry.d.ts +16 -0
- package/lib/cjs/annotations/TextBlockGeometry.d.ts.map +1 -0
- package/lib/cjs/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +28 -70
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -0
- package/lib/cjs/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +69 -22
- package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -0
- package/lib/cjs/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +174 -49
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -0
- 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 +7 -3
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +27 -6
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.d.ts +23 -0
- package/lib/cjs/internal/ElementLRUCache.d.ts.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.js +167 -3
- 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/NativePlatform.js.map +1 -1
- package/lib/cjs/internal/NoLocks.js.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/internal/Symbols.d.ts +1 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +2 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/annotations/fields.d.ts +22 -0
- package/lib/cjs/internal/annotations/fields.d.ts.map +1 -0
- package/lib/cjs/internal/annotations/fields.js +237 -0
- package/lib/cjs/internal/annotations/fields.js.map +1 -0
- package/lib/cjs/internal/cross-package.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.d.ts +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +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 +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/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +0 -1
- package/lib/cjs/workspace/Workspace.d.ts.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.d.ts +1 -1
- package/lib/esm/BackendHubAccess.js +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BackendLoggerCategory.js.map +1 -1
- package/lib/esm/BisCoreSchema.d.ts.map +1 -1
- package/lib/esm/BisCoreSchema.js +4 -2
- package/lib/esm/BisCoreSchema.js.map +1 -1
- package/lib/esm/BlobContainerService.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 +17 -1
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/CatalogDb.js.map +1 -1
- package/lib/esm/Category.d.ts +4 -4
- package/lib/esm/Category.js +4 -4
- 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 +67 -8
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +490 -275
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ChannelControl.js.map +1 -1
- package/lib/esm/CheckpointManager.js.map +1 -1
- package/lib/esm/ClassRegistry.d.ts +9 -1
- package/lib/esm/ClassRegistry.d.ts.map +1 -1
- package/lib/esm/ClassRegistry.js +14 -6
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/CloudSqlite.js +1 -1
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeService.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/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 +4 -4
- package/lib/esm/DisplayStyle.js +3 -3
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECDb.d.ts +4 -4
- package/lib/esm/ECDb.d.ts.map +1 -1
- package/lib/esm/ECDb.js +4 -4
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSchemaXmlContext.js.map +1 -1
- package/lib/esm/ECSqlStatement.d.ts +15 -6
- package/lib/esm/ECSqlStatement.d.ts.map +1 -1
- package/lib/esm/ECSqlStatement.js +19 -4
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/Element.d.ts +54 -51
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +67 -52
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +8 -8
- package/lib/esm/ElementAspect.d.ts.map +1 -1
- package/lib/esm/ElementAspect.js +8 -8
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementGraphics.js.map +1 -1
- package/lib/esm/ElementTreeWalker.js.map +1 -1
- package/lib/esm/Entity.d.ts +10 -7
- package/lib/esm/Entity.d.ts.map +1 -1
- package/lib/esm/Entity.js +36 -14
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/EntityReferences.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/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.d.ts +6 -2
- package/lib/esm/GeographicCRSServices.d.ts.map +1 -1
- package/lib/esm/GeographicCRSServices.js +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 +37 -26
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +136 -59
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelDbFonts.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 +2 -3
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +2 -3
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.d.ts +36 -0
- package/lib/esm/IModelIncrementalSchemaLocater.d.ts.map +1 -0
- package/lib/esm/IModelIncrementalSchemaLocater.js +65 -0
- package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -0
- package/lib/esm/IModelJsFs.js.map +1 -1
- package/lib/esm/ImageSourceConversion.js.map +1 -1
- package/lib/esm/IpcHost.js.map +1 -1
- package/lib/esm/LineStyle.js.map +1 -1
- package/lib/esm/LocalHub.d.ts.map +1 -1
- package/lib/esm/LocalHub.js +6 -4
- 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 +4 -3
- package/lib/esm/Material.d.ts.map +1 -1
- package/lib/esm/Material.js +5 -5
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.d.ts +22 -22
- package/lib/esm/Model.js +22 -22
- 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 +3 -0
- package/lib/esm/Relationship.d.ts.map +1 -1
- package/lib/esm/Relationship.js +15 -0
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/RpcBackend.js.map +1 -1
- package/lib/esm/SQLiteDb.d.ts +1 -1
- package/lib/esm/SQLiteDb.js +1 -1
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/Schema.d.ts +25 -0
- package/lib/esm/Schema.d.ts.map +1 -1
- package/lib/esm/Schema.js +25 -0
- package/lib/esm/Schema.js.map +1 -1
- package/lib/esm/SchemaSync.js.map +1 -1
- package/lib/esm/SchemaUtils.js.map +1 -1
- package/lib/esm/SheetIndex.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.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/Texture.d.ts +1 -1
- package/lib/esm/Texture.js +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TileStorage.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +4 -4
- package/lib/esm/TxnManager.js +1 -1
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +40 -14
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +42 -14
- 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 +61 -0
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js +105 -0
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -0
- package/lib/esm/annotations/FrameGeometry.d.ts +51 -0
- package/lib/esm/annotations/FrameGeometry.d.ts.map +1 -0
- package/lib/esm/annotations/FrameGeometry.js +244 -0
- package/lib/esm/annotations/FrameGeometry.js.map +1 -0
- package/lib/esm/annotations/LeaderGeometry.d.ts +53 -0
- package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -0
- package/lib/esm/annotations/LeaderGeometry.js +179 -0
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -0
- package/lib/esm/annotations/TextAnnotationElement.d.ts +204 -0
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -0
- package/lib/esm/annotations/TextAnnotationElement.js +405 -0
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -0
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts +33 -0
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -0
- package/lib/esm/annotations/TextAnnotationGeometry.js +134 -0
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -0
- package/lib/esm/annotations/TextBlockGeometry.d.ts +16 -0
- package/lib/esm/annotations/TextBlockGeometry.d.ts.map +1 -0
- package/lib/esm/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +28 -70
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -0
- package/lib/esm/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +69 -22
- package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -0
- package/lib/esm/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +172 -48
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -0
- package/lib/esm/core-backend.d.ts +7 -3
- package/lib/esm/core-backend.d.ts.map +1 -1
- package/lib/esm/core-backend.js +27 -3
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/domains/FunctionalElements.js.map +1 -1
- package/lib/esm/domains/FunctionalSchema.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/internal/ElementLRUCache.d.ts +23 -0
- package/lib/esm/internal/ElementLRUCache.d.ts.map +1 -1
- package/lib/esm/internal/ElementLRUCache.js +165 -2
- 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/NativePlatform.js.map +1 -1
- package/lib/esm/internal/NoLocks.js.map +1 -1
- package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
- package/lib/esm/internal/Symbols.d.ts +1 -0
- package/lib/esm/internal/Symbols.d.ts.map +1 -1
- package/lib/esm/internal/Symbols.js +1 -0
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/internal/annotations/fields.d.ts +22 -0
- package/lib/esm/internal/annotations/fields.d.ts.map +1 -0
- package/lib/esm/internal/annotations/fields.js +231 -0
- package/lib/esm/internal/annotations/fields.js.map +1 -0
- package/lib/esm/internal/cross-package.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.d.ts +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js +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 +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/AdvancedEqual.js.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.d.ts +15 -0
- package/lib/esm/test/AnnotationTestUtils.d.ts.map +1 -0
- package/lib/esm/test/AnnotationTestUtils.js +41 -0
- package/lib/esm/test/AnnotationTestUtils.js.map +1 -0
- package/lib/esm/test/AttachDb.test.js +11 -11
- package/lib/esm/test/AttachDb.test.js.map +1 -1
- package/lib/esm/test/ElementLRUCache.test.js +224 -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.map +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
- package/lib/esm/test/IModelTestUtils.js +1 -0
- 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.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/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/annotations/Fields.test.d.ts +2 -0
- package/lib/esm/test/annotations/Fields.test.d.ts.map +1 -0
- package/lib/esm/test/annotations/Fields.test.js +576 -0
- package/lib/esm/test/annotations/Fields.test.js.map +1 -0
- package/lib/esm/test/annotations/FrameGeometry.test.d.ts +2 -0
- package/lib/esm/test/annotations/FrameGeometry.test.d.ts.map +1 -0
- package/lib/esm/test/annotations/FrameGeometry.test.js +86 -0
- package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -0
- package/lib/esm/test/annotations/LeaderGeometry.test.d.ts +2 -0
- package/lib/esm/test/annotations/LeaderGeometry.test.d.ts.map +1 -0
- package/lib/esm/test/annotations/LeaderGeometry.test.js +256 -0
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -0
- package/lib/esm/test/annotations/TextAnnotation.test.js +269 -1047
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.d.ts +2 -0
- package/lib/esm/test/annotations/TextBlock.test.d.ts.map +1 -0
- package/lib/esm/test/annotations/TextBlock.test.js +1199 -0
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.d.ts +60 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.d.ts.map +1 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js +69 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts +1442 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts.map +1 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js +817 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -0
- package/lib/esm/test/categories/Category.test.js.map +1 -1
- 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.d.ts +2 -0
- package/lib/esm/test/ecdb/ConcurrentQuery.test.d.ts.map +1 -0
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js +164 -0
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -0
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +35 -45
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDb.test.js +86 -65
- 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 +65 -65
- package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js +0 -55
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlReader.test.js +16 -16
- package/lib/esm/test/ecdb/ECSqlReader.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +484 -292
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/test/element/ElementAspect.test.js +22 -22
- package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
- package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +139 -139
- package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
- package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
- package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
- package/lib/esm/test/element/NullStructArray.test.js +13 -13
- package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/test/hubaccess/ApplyChangeset.test.d.ts +2 -0
- package/lib/esm/test/hubaccess/ApplyChangeset.test.d.ts.map +1 -0
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js +86 -0
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -0
- 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/imageData.js.map +1 -1
- 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 +313 -5
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
- package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.d.ts +2 -0
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.d.ts.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js +343 -0
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.d.ts +2 -0
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.d.ts.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js +207 -0
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts +11 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js +36 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts +17 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js +116 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts +9 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js +20 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +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 +36 -10
- 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 +175 -73
- package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
- package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
- package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
- package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +575 -164
- 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.map +1 -1
- package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
- package/lib/esm/test/standalone/ExportGraphics.test.js +67 -15
- package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryChangeEvents.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.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 +27 -27
- package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
- package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
- 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 +24 -1
- package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js +19 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Texture.test.js.map +1 -1
- package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
- package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/workspace/Settings.js.map +1 -1
- package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
- package/lib/esm/workspace/Workspace.d.ts +0 -1
- package/lib/esm/workspace/Workspace.d.ts.map +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +22 -16
- package/lib/cjs/TextAnnotationElement.d.ts +0 -54
- package/lib/cjs/TextAnnotationElement.d.ts.map +0 -1
- package/lib/cjs/TextAnnotationElement.js +0 -94
- package/lib/cjs/TextAnnotationElement.js.map +0 -1
- package/lib/cjs/TextAnnotationGeometry.d.ts +0 -32
- package/lib/cjs/TextAnnotationGeometry.d.ts.map +0 -1
- package/lib/cjs/TextAnnotationGeometry.js.map +0 -1
- package/lib/cjs/TextAnnotationLayout.d.ts.map +0 -1
- package/lib/cjs/TextAnnotationLayout.js.map +0 -1
- package/lib/esm/TextAnnotationElement.d.ts +0 -54
- package/lib/esm/TextAnnotationElement.d.ts.map +0 -1
- package/lib/esm/TextAnnotationElement.js +0 -89
- package/lib/esm/TextAnnotationElement.js.map +0 -1
- package/lib/esm/TextAnnotationGeometry.d.ts +0 -32
- package/lib/esm/TextAnnotationGeometry.d.ts.map +0 -1
- package/lib/esm/TextAnnotationGeometry.js.map +0 -1
- package/lib/esm/TextAnnotationLayout.d.ts.map +0 -1
- package/lib/esm/TextAnnotationLayout.js.map +0 -1
|
@@ -31,7 +31,7 @@ export interface OnAspectIdArg extends OnAspectArg {
|
|
|
31
31
|
/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.
|
|
32
32
|
* Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.
|
|
33
33
|
* BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.
|
|
34
|
-
* @public
|
|
34
|
+
* @public @preview
|
|
35
35
|
*/
|
|
36
36
|
export declare class ElementAspect extends Entity {
|
|
37
37
|
static get className(): string;
|
|
@@ -74,30 +74,30 @@ export declare class ElementAspect extends Entity {
|
|
|
74
74
|
protected static onDeleted(_arg: OnAspectIdArg): void;
|
|
75
75
|
}
|
|
76
76
|
/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.
|
|
77
|
-
* @public
|
|
77
|
+
* @public @preview
|
|
78
78
|
*/
|
|
79
79
|
export declare class ElementUniqueAspect extends ElementAspect {
|
|
80
80
|
static get className(): string;
|
|
81
81
|
}
|
|
82
82
|
/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.
|
|
83
|
-
* @public
|
|
83
|
+
* @public @preview
|
|
84
84
|
*/
|
|
85
85
|
export declare class ElementMultiAspect extends ElementAspect {
|
|
86
86
|
static get className(): string;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
* @public
|
|
89
|
+
* @public @preview
|
|
90
90
|
*/
|
|
91
91
|
export declare class ChannelRootAspect extends ElementUniqueAspect {
|
|
92
92
|
static get className(): string;
|
|
93
93
|
/** Insert a ChannelRootAspect on the specified element.
|
|
94
|
-
* @deprecated in 4.0
|
|
94
|
+
* @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.
|
|
95
95
|
*/
|
|
96
96
|
static insert(iModel: IModelDb, ownerId: Id64String, channelName: string): void;
|
|
97
97
|
}
|
|
98
98
|
/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.
|
|
99
99
|
* @note The associated ECClass was added to the BisCore schema in version 1.0.2
|
|
100
|
-
* @public
|
|
100
|
+
* @public @preview
|
|
101
101
|
*/
|
|
102
102
|
export declare class ExternalSourceAspect extends ElementMultiAspect {
|
|
103
103
|
static get className(): string;
|
|
@@ -145,10 +145,10 @@ export declare class ExternalSourceAspect extends ElementMultiAspect {
|
|
|
145
145
|
toJSON(): ExternalSourceAspectProps;
|
|
146
146
|
protected collectReferenceIds(referenceIds: EntityReferenceSet): void;
|
|
147
147
|
}
|
|
148
|
-
/** @public */
|
|
148
|
+
/** @public @preview */
|
|
149
149
|
export declare namespace ExternalSourceAspect {
|
|
150
150
|
/** Standard values for the `Kind` property of `ExternalSourceAspect`.
|
|
151
|
-
* @public
|
|
151
|
+
* @public @preview
|
|
152
152
|
*/
|
|
153
153
|
enum Kind {
|
|
154
154
|
/** Indicates that the [[ExternalSourceAspect]] is storing [[Element]] provenance */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementAspect.d.ts","sourceRoot":"","sources":["../../src/ElementAspect.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA0B,kBAAkB,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/I,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAY,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG3D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,MAAM,EAAE,QAAQ,CAAC;IACjB,sDAAsD;IACtD,KAAK,EAAE,UAAU,CAAC;CACnB;AACD;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,+DAA+D;IAC/D,KAAK,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;CACrC;AACD;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,kDAAkD;IAClD,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,MAAM;IACvC,WAA2B,SAA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,MAAM;CAIhF;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D,WAA2B,SAAS,IAAI,MAAM,CAAmC;IAEjF;;;OAGG;IACI,KAAK,EAAE,cAAc,CAAC;IAC7B,6DAA6D;IACtD,UAAU,EAAE,MAAM,CAAC;IAC1B,uDAAuD;IAChD,IAAI,EAAE,MAAM,CAAC;IACpB,mKAAmK;IAC5J,QAAQ,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACI,OAAO,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACI,cAAc,CAAC,EAAE,MAAM,CAAC;IAC/B,iHAAiH;IAC1G,MAAM,CAAC,EAAE,cAAc,CAAC;IAE/B,kFAAkF;gBACtE,KAAK,EAAE,yBAAyB,EAAE,MAAM,EAAE,QAAQ;IAW9D;;;;;;;;;;;MAWE;WACY,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC;QAAE,SAAS,EAAE,UAAU,CAAC;QAAC,QAAQ,EAAE,UAAU,CAAA;KAAE,CAAC;IAe9I,MAAM,IAAI,yBAAyB;cAYhC,mBAAmB,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;CAQ/E;AAED,uBAAuB;AACvB,yBAAiB,oBAAoB,CAAC;IACpC;;OAEG;IACH,KAAY,IAAI;QACd,oFAAoF;QACpF,OAAO,YAAY;QACnB,yFAAyF;QACzF,YAAY,iBAAiB;QAC7B;;WAEG;QACH,KAAK,UAAU;KAChB;CACF"}
|
package/lib/cjs/ElementAspect.js
CHANGED
|
@@ -15,7 +15,7 @@ const Symbols_1 = require("./internal/Symbols");
|
|
|
15
15
|
/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.
|
|
16
16
|
* Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.
|
|
17
17
|
* BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.
|
|
18
|
-
* @public
|
|
18
|
+
* @public @preview
|
|
19
19
|
*/
|
|
20
20
|
class ElementAspect extends Entity_1.Entity {
|
|
21
21
|
static get className() { return "ElementAspect"; }
|
|
@@ -79,26 +79,26 @@ class ElementAspect extends Entity_1.Entity {
|
|
|
79
79
|
}
|
|
80
80
|
exports.ElementAspect = ElementAspect;
|
|
81
81
|
/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.
|
|
82
|
-
* @public
|
|
82
|
+
* @public @preview
|
|
83
83
|
*/
|
|
84
84
|
class ElementUniqueAspect extends ElementAspect {
|
|
85
85
|
static get className() { return "ElementUniqueAspect"; }
|
|
86
86
|
}
|
|
87
87
|
exports.ElementUniqueAspect = ElementUniqueAspect;
|
|
88
88
|
/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.
|
|
89
|
-
* @public
|
|
89
|
+
* @public @preview
|
|
90
90
|
*/
|
|
91
91
|
class ElementMultiAspect extends ElementAspect {
|
|
92
92
|
static get className() { return "ElementMultiAspect"; }
|
|
93
93
|
}
|
|
94
94
|
exports.ElementMultiAspect = ElementMultiAspect;
|
|
95
95
|
/**
|
|
96
|
-
* @public
|
|
96
|
+
* @public @preview
|
|
97
97
|
*/
|
|
98
98
|
class ChannelRootAspect extends ElementUniqueAspect {
|
|
99
99
|
static get className() { return "ChannelRootAspect"; }
|
|
100
100
|
/** Insert a ChannelRootAspect on the specified element.
|
|
101
|
-
* @deprecated in 4.0
|
|
101
|
+
* @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.
|
|
102
102
|
*/
|
|
103
103
|
static insert(iModel, ownerId, channelName) {
|
|
104
104
|
const props = { classFullName: this.classFullName, element: { id: ownerId }, owner: channelName };
|
|
@@ -108,7 +108,7 @@ class ChannelRootAspect extends ElementUniqueAspect {
|
|
|
108
108
|
exports.ChannelRootAspect = ChannelRootAspect;
|
|
109
109
|
/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.
|
|
110
110
|
* @note The associated ECClass was added to the BisCore schema in version 1.0.2
|
|
111
|
-
* @public
|
|
111
|
+
* @public @preview
|
|
112
112
|
*/
|
|
113
113
|
class ExternalSourceAspect extends ElementMultiAspect {
|
|
114
114
|
static get className() { return "ExternalSourceAspect"; }
|
|
@@ -193,10 +193,10 @@ class ExternalSourceAspect extends ElementMultiAspect {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
exports.ExternalSourceAspect = ExternalSourceAspect;
|
|
196
|
-
/** @public */
|
|
196
|
+
/** @public @preview */
|
|
197
197
|
(function (ExternalSourceAspect) {
|
|
198
198
|
/** Standard values for the `Kind` property of `ExternalSourceAspect`.
|
|
199
|
-
* @public
|
|
199
|
+
* @public @preview
|
|
200
200
|
*/
|
|
201
201
|
let Kind;
|
|
202
202
|
(function (Kind) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementAspect.js","sourceRoot":"","sources":["../../src/ElementAspect.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAA+I;AAC/I,qCAAkC;AAGlC,sDAA2D;AAC3D,gDAAoD;AA0BpD;;;;GAIG;AACH,MAAa,aAAc,SAAQ,eAAM;IAChC,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IACnE,OAAO,CAAiB;IAE/B,kFAAkF;IAClF,YAAY,KAAyB,EAAE,MAAgB;QACrD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,4BAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAE,CAAC,CAAC,+DAA+D;IACzH,CAAC;IAEe,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAwB,CA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------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ElementAspects\n */\n\nimport { ChannelRootAspectProps, ElementAspectProps, EntityReferenceSet, ExternalSourceAspectProps, RelatedElement } from \"@itwin/core-common\";\nimport { Entity } from \"./Entity\";\nimport { IModelDb } from \"./IModelDb\";\nimport { ECSqlStatement } from \"./ECSqlStatement\";\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\nimport { _verifyChannel } from \"./internal/Symbols\";\n\n/** Argument for the `ElementAspect.onXxx` static methods\n * @beta\n */\nexport interface OnAspectArg {\n /** The iModel for the aspect affected by this event. */\n iModel: IModelDb;\n /** The model for the aspect affected by this event */\n model: Id64String;\n}\n/** Argument for the `ElementAspect.onXxx` static methods that supply the properties of an aspect to be inserted or updated.\n * @beta\n */\nexport interface OnAspectPropsArg extends OnAspectArg {\n /** The new properties of the aspect affected by this event. */\n props: Readonly<ElementAspectProps>;\n}\n/** Argument for the `ElementAspect.onXxx` static methods that only supply the Id of the affected aspect.\n * @beta\n */\nexport interface OnAspectIdArg extends OnAspectArg {\n /** The Id of the aspect affected by this event */\n aspectId: Id64String;\n}\n\n/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.\n * Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.\n * BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.\n * @public\n */\nexport class ElementAspect extends Entity {\n public static override get className(): string { return \"ElementAspect\"; }\n public element: RelatedElement;\n\n /** Construct an aspect from its JSON representation and its containing iModel. */\n constructor(props: ElementAspectProps, iModel: IModelDb) {\n super(props, iModel);\n this.element = RelatedElement.fromJSON(props.element)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\n }\n\n public override toJSON(): ElementAspectProps {\n const val = super.toJSON() as ElementAspectProps;\n val.element = this.element;\n return val;\n }\n\n /** Called before a new ElementAspect is inserted.\n * @note throw an exception to disallow the insert\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onInsert(arg: OnAspectPropsArg): void {\n const { props, iModel } = arg;\n iModel.channels[_verifyChannel](arg.model);\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"insert aspect\");\n }\n\n /** Called after a new ElementAspect was inserted.\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onInserted(_arg: OnAspectPropsArg): void { }\n\n /** Called before an ElementAspect is updated.\n * @note throw an exception to disallow the update\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onUpdate(arg: OnAspectPropsArg): void {\n const { props, iModel } = arg;\n iModel.channels[_verifyChannel](arg.model);\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"update aspect\");\n }\n\n /** Called after an ElementAspect was updated.\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onUpdated(_arg: OnAspectPropsArg): void { }\n\n /** Called before an ElementAspect is deleted.\n * @note throw an exception to disallow the delete\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onDelete(arg: OnAspectIdArg): void {\n const { aspectId, iModel } = arg;\n iModel.channels[_verifyChannel](arg.model);\n const { element } = iModel.elements.getAspect(aspectId);\n iModel.locks.checkExclusiveLock(element.id, \"element\", \"delete aspect\");\n }\n\n /** Called after an ElementAspect was deleted.\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onDeleted(_arg: OnAspectIdArg): void { }\n}\n/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.\n * @public\n */\nexport class ElementUniqueAspect extends ElementAspect {\n public static override get className(): string { return \"ElementUniqueAspect\"; }\n}\n\n/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.\n * @public\n */\nexport class ElementMultiAspect extends ElementAspect {\n public static override get className(): string { return \"ElementMultiAspect\"; }\n}\n\n/**\n * @public\n */\nexport class ChannelRootAspect extends ElementUniqueAspect {\n public static override get className(): string { return \"ChannelRootAspect\"; }\n /** Insert a ChannelRootAspect on the specified element.\n * @deprecated in 4.0 use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.\n */\n public static insert(iModel: IModelDb, ownerId: Id64String, channelName: string) {\n const props: ChannelRootAspectProps = { classFullName: this.classFullName, element: { id: ownerId }, owner: channelName };\n iModel.elements.insertAspect(props);\n }\n}\n\n/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.2\n * @public\n */\nexport class ExternalSourceAspect extends ElementMultiAspect {\n public static override get className(): string { return \"ExternalSourceAspect\"; }\n\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\n */\n public scope: RelatedElement;\n /** The identifier of the object in the source repository. */\n public identifier: string;\n /** The kind of object within the source repository. */\n public kind: string;\n /** The cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\n public checksum?: string;\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\n * If present, this value must be guaranteed to change when any of the source object's content changes.\n */\n public version?: string;\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\n */\n public jsonProperties?: string;\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\n public source?: RelatedElement;\n\n /** Construct an aspect from its JSON representation and its containing iModel. */\n constructor(props: ExternalSourceAspectProps, iModel: IModelDb) {\n super(props, iModel);\n this.scope = RelatedElement.fromJSON(props.scope)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\n this.source = RelatedElement.fromJSON(props.source);\n this.identifier = props.identifier;\n this.kind = props.kind;\n this.checksum = props.checksum;\n this.version = props.version;\n this.jsonProperties = props.jsonProperties;\n }\n\n /** Look up the elements that contain one or more ExternalSourceAspect with the specified Scope, Kind, and Identifier.\n * The result of this function is an array of all of the ExternalSourceAspects that were found, each associated with the owning element.\n * A given element could have more than one ExternalSourceAspect with the given scope, kind, and identifier.\n * Also, many elements could have ExternalSourceAspect with the same scope, kind, and identifier.\n * Therefore, the result array could have more than one entry with the same elementId.\n * Aspects are never shared. Each aspect has its own unique ECInstanceId.\n * @param iModelDb The iModel to query\n * @param scope The scope of the ExternalSourceAspects to find\n * @param kind The kind of the ExternalSourceAspects to find\n * @param identifier The identifier of the ExternalSourceAspects to find\n * @returns the query results\n */\n public static findAllBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): Array<{ elementId: Id64String, aspectId: Id64String }> {\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\n const found: Array<{ elementId: Id64String, aspectId: Id64String }> = [];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\n statement.bindId(\"scope\", scope);\n statement.bindString(\"kind\", kind);\n statement.bindString(\"identifier\", identifier);\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\n found.push({ elementId: statement.getValue(0).getId(), aspectId: statement.getValue(1).getId() });\n }\n });\n return found;\n }\n\n public override toJSON(): ExternalSourceAspectProps {\n const val = super.toJSON() as ExternalSourceAspectProps;\n val.scope = this.scope;\n val.source = this.source;\n val.identifier = this.identifier;\n val.kind = this.kind;\n val.checksum = this.checksum;\n val.version = this.version;\n val.jsonProperties = this.jsonProperties;\n return val;\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n if (this.scope)\n referenceIds.addElement(this.scope.id);\n referenceIds.addElement(this.element.id);\n if (this.source)\n referenceIds.addElement(this.source.id);\n }\n}\n\n/** @public */\nexport namespace ExternalSourceAspect {\n /** Standard values for the `Kind` property of `ExternalSourceAspect`.\n * @public\n */\n export enum Kind {\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Element]] provenance */\n Element = \"Element\",\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Relationship]] provenance */\n Relationship = \"Relationship\",\n /** Indicates that the [[ExternalSourceAspect]] is storing *scope* provenance\n * @see [[ExternalSourceAspect.scope]]\n */\n Scope = \"Scope\",\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ElementAspect.js","sourceRoot":"","sources":["../../src/ElementAspect.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAA+I;AAC/I,qCAAkC;AAGlC,sDAA2D;AAC3D,gDAAoD;AA0BpD;;;;GAIG;AACH,MAAa,aAAc,SAAQ,eAAM;IAChC,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IACnE,OAAO,CAAiB;IAE/B,kFAAkF;IAClF,YAAY,KAAyB,EAAE,MAAgB;QACrD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,4BAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAE,CAAC,CAAC,+DAA+D;IACzH,CAAC;IAEe,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAwB,CAAC;QACjD,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;;OAIG;IACO,MAAM,CAAC,QAAQ,CAAC,GAAqB;QAC7C,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;QAC9B,MAAM,CAAC,QAAQ,CAAC,wBAAc,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,C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C;QACjC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACzC,OAAO,GAAG,CAAC;IACb,CAAC;IAEkB,mBAAmB,CAAC,YAAgC;QACrE,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,IAAI,IAAI,CAAC,KAAK;YACZ,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,MAAM;YACb,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF;AAtFD,oDAsFC;AAED,uBAAuB;AACvB,WAAiB,oBAAoB;IACnC;;OAEG;IACH,IAAY,IASX;IATD,WAAY,IAAI;QACd,oFAAoF;QACpF,2BAAmB,CAAA;QACnB,yFAAyF;QACzF,qCAA6B,CAAA;QAC7B;;WAEG;QACH,uBAAe,CAAA;IACjB,CAAC,EATW,IAAI,GAAJ,yBAAI,KAAJ,yBAAI,QASf;AACH,CAAC,EAdgB,oBAAoB,oCAApB,oBAAoB,QAcpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ElementAspects\r\n */\r\n\r\nimport { ChannelRootAspectProps, ElementAspectProps, EntityReferenceSet, ExternalSourceAspectProps, RelatedElement } from \"@itwin/core-common\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { ECSqlStatement } from \"./ECSqlStatement\";\r\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\r\nimport { _verifyChannel } from \"./internal/Symbols\";\r\n\r\n/** Argument for the `ElementAspect.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnAspectArg {\r\n /** The iModel for the aspect affected by this event. */\r\n iModel: IModelDb;\r\n /** The model for the aspect affected by this event */\r\n model: Id64String;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that supply the properties of an aspect to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnAspectPropsArg extends OnAspectArg {\r\n /** The new properties of the aspect affected by this event. */\r\n props: Readonly<ElementAspectProps>;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that only supply the Id of the affected aspect.\r\n * @beta\r\n */\r\nexport interface OnAspectIdArg extends OnAspectArg {\r\n /** The Id of the aspect affected by this event */\r\n aspectId: Id64String;\r\n}\r\n\r\n/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.\r\n * Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.\r\n * BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.\r\n * @public @preview\r\n */\r\nexport class ElementAspect extends Entity {\r\n public static override get className(): string { return \"ElementAspect\"; }\r\n public element: RelatedElement;\r\n\r\n /** Construct an aspect from its JSON representation and its containing iModel. */\r\n constructor(props: ElementAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.element = RelatedElement.fromJSON(props.element)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n }\r\n\r\n public override toJSON(): ElementAspectProps {\r\n const val = super.toJSON() as ElementAspectProps;\r\n val.element = this.element;\r\n return val;\r\n }\r\n\r\n /** Called before a new ElementAspect is inserted.\r\n * @note throw an exception to disallow the insert\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInsert(arg: OnAspectPropsArg): void {\r\n const { props, iModel } = arg;\r\n iModel.channels[_verifyChannel](arg.model);\r\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"insert aspect\");\r\n }\r\n\r\n /** Called after a new ElementAspect was inserted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInserted(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect is updated.\r\n * @note throw an exception to disallow the update\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdate(arg: OnAspectPropsArg): void {\r\n const { props, iModel } = arg;\r\n iModel.channels[_verifyChannel](arg.model);\r\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"update aspect\");\r\n }\r\n\r\n /** Called after an ElementAspect was updated.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect is deleted.\r\n * @note throw an exception to disallow the delete\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDelete(arg: OnAspectIdArg): void {\r\n const { aspectId, iModel } = arg;\r\n iModel.channels[_verifyChannel](arg.model);\r\n const { element } = iModel.elements.getAspect(aspectId);\r\n iModel.locks.checkExclusiveLock(element.id, \"element\", \"delete aspect\");\r\n }\r\n\r\n /** Called after an ElementAspect was deleted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnAspectIdArg): void { }\r\n}\r\n/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.\r\n * @public @preview\r\n */\r\nexport class ElementUniqueAspect extends ElementAspect {\r\n public static override get className(): string { return \"ElementUniqueAspect\"; }\r\n}\r\n\r\n/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.\r\n * @public @preview\r\n */\r\nexport class ElementMultiAspect extends ElementAspect {\r\n public static override get className(): string { return \"ElementMultiAspect\"; }\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport class ChannelRootAspect extends ElementUniqueAspect {\r\n public static override get className(): string { return \"ChannelRootAspect\"; }\r\n /** Insert a ChannelRootAspect on the specified element.\r\n * @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.\r\n */\r\n public static insert(iModel: IModelDb, ownerId: Id64String, channelName: string) {\r\n const props: ChannelRootAspectProps = { classFullName: this.classFullName, element: { id: ownerId }, owner: channelName };\r\n iModel.elements.insertAspect(props);\r\n }\r\n}\r\n\r\n/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.2\r\n * @public @preview\r\n */\r\nexport class ExternalSourceAspect extends ElementMultiAspect {\r\n public static override get className(): string { return \"ExternalSourceAspect\"; }\r\n\r\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\r\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\r\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\r\n */\r\n public scope: RelatedElement;\r\n /** The identifier of the object in the source repository. */\r\n public identifier: string;\r\n /** The kind of object within the source repository. */\r\n public kind: string;\r\n /** The cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\r\n public checksum?: string;\r\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\r\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\r\n * If present, this value must be guaranteed to change when any of the source object's content changes.\r\n */\r\n public version?: string;\r\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\r\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\r\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\r\n */\r\n public jsonProperties?: string;\r\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\r\n public source?: RelatedElement;\r\n\r\n /** Construct an aspect from its JSON representation and its containing iModel. */\r\n constructor(props: ExternalSourceAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.scope = RelatedElement.fromJSON(props.scope)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n this.source = RelatedElement.fromJSON(props.source);\r\n this.identifier = props.identifier;\r\n this.kind = props.kind;\r\n this.checksum = props.checksum;\r\n this.version = props.version;\r\n this.jsonProperties = props.jsonProperties;\r\n }\r\n\r\n /** Look up the elements that contain one or more ExternalSourceAspect with the specified Scope, Kind, and Identifier.\r\n * The result of this function is an array of all of the ExternalSourceAspects that were found, each associated with the owning element.\r\n * A given element could have more than one ExternalSourceAspect with the given scope, kind, and identifier.\r\n * Also, many elements could have ExternalSourceAspect with the same scope, kind, and identifier.\r\n * Therefore, the result array could have more than one entry with the same elementId.\r\n * Aspects are never shared. Each aspect has its own unique ECInstanceId.\r\n * @param iModelDb The iModel to query\r\n * @param scope The scope of the ExternalSourceAspects to find\r\n * @param kind The kind of the ExternalSourceAspects to find\r\n * @param identifier The identifier of the ExternalSourceAspects to find\r\n * @returns the query results\r\n */\r\n public static findAllBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): Array<{ elementId: Id64String, aspectId: Id64String }> {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n const found: Array<{ elementId: Id64String, aspectId: Id64String }> = [];\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n found.push({ elementId: statement.getValue(0).getId(), aspectId: statement.getValue(1).getId() });\r\n }\r\n });\r\n return found;\r\n }\r\n\r\n public override toJSON(): ExternalSourceAspectProps {\r\n const val = super.toJSON() as ExternalSourceAspectProps;\r\n val.scope = this.scope;\r\n val.source = this.source;\r\n val.identifier = this.identifier;\r\n val.kind = this.kind;\r\n val.checksum = this.checksum;\r\n val.version = this.version;\r\n val.jsonProperties = this.jsonProperties;\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.scope)\r\n referenceIds.addElement(this.scope.id);\r\n referenceIds.addElement(this.element.id);\r\n if (this.source)\r\n referenceIds.addElement(this.source.id);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport namespace ExternalSourceAspect {\r\n /** Standard values for the `Kind` property of `ExternalSourceAspect`.\r\n * @public @preview\r\n */\r\n export enum Kind {\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Element]] provenance */\r\n Element = \"Element\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Relationship]] provenance */\r\n Relationship = \"Relationship\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing *scope* provenance\r\n * @see [[ExternalSourceAspect.scope]]\r\n */\r\n Scope = \"Scope\",\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementGraphics.js","sourceRoot":"","sources":["../../src/ElementGraphics.ts"],"names":[],"mappings":";;AAaA,0DA0BC;AAvCD;;;+FAG+F;AAC/F,sDAA2D;AAC3D,oDAA8E;AAG9E,gDAA+C;AAE/C;;GAEG;AACI,KAAK,UAAU,uBAAuB,CAAC,OAAoC,EAAE,MAAgB;IAClG,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,mBAAS,CAAC,CAAC,uBAAuB,CAAC,OAAc,CAAC,CAAC,CAAC,2CAA2C;IAE3H,IAAI,KAAyB,CAAC;IAC9B,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,8CAAsC;QACtC;YACE,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB;YACE,KAAK,GAAG,cAAc,CAAC;YACvB,MAAM;QACR;YACE,KAAK,GAAG,8BAA8B,CAAC;YACvC,MAAM;QACR;YACE,KAAK,GAAG,cAAc,OAAO,CAAC,SAAS,YAAY,CAAC;YACpD,MAAM;QACR;YACE,KAAK,GAAG,yBAAyB,OAAO,CAAC,EAAE,GAAG,CAAC;YAC/C,MAAM;IACV,CAAC;IAED,IAAA,qBAAM,EAAC,SAAS,KAAK,KAAK,CAAC,CAAC;IAC5B,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AACxD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { assert, IModelStatus } from \"@itwin/core-bentley\";\nimport { ElementGraphicsRequestProps, IModelError } from \"@itwin/core-common\";\nimport { ElementGraphicsStatus } from \"@bentley/imodeljs-native\";\nimport { IModelDb } from \"./IModelDb\";\nimport { _nativeDb } from \"./internal/Symbols\";\n\n/** See [[IModelDb.generateElementGraphics]] and IModelTileRpcImpl.requestElementGraphics.\n * @internal\n */\nexport async function generateElementGraphics(request: ElementGraphicsRequestProps, iModel: IModelDb): Promise<Uint8Array | undefined> {\n const result = await iModel[_nativeDb].generateElementGraphics(request as any); // ###TODO update package versions in addon\n\n let error: string | undefined;\n switch (result.status) {\n case ElementGraphicsStatus.NoGeometry:\n case ElementGraphicsStatus.Canceled:\n return undefined;\n case ElementGraphicsStatus.Success:\n return result.content;\n case ElementGraphicsStatus.InvalidJson:\n error = \"Invalid JSON\";\n break;\n case ElementGraphicsStatus.UnknownMajorFormatVersion:\n error = \"Unknown major format version\";\n break;\n case ElementGraphicsStatus.ElementNotFound:\n error = `Element Id ${request.elementId} not found`;\n break;\n case ElementGraphicsStatus.DuplicateRequestId:\n error = `Duplicate request Id \"${request.id}\"`;\n break;\n }\n\n assert(undefined !== error);\n throw new IModelError(IModelStatus.BadRequest, error);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ElementGraphics.js","sourceRoot":"","sources":["../../src/ElementGraphics.ts"],"names":[],"mappings":";;AAaA,0DA0BC;AAvCD;;;+FAG+F;AAC/F,sDAA2D;AAC3D,oDAA8E;AAG9E,gDAA+C;AAE/C;;GAEG;AACI,KAAK,UAAU,uBAAuB,CAAC,OAAoC,EAAE,MAAgB;IAClG,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,mBAAS,CAAC,CAAC,uBAAuB,CAAC,OAAc,CAAC,CAAC,CAAC,2CAA2C;IAE3H,IAAI,KAAyB,CAAC;IAC9B,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,8CAAsC;QACtC;YACE,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB;YACE,KAAK,GAAG,cAAc,CAAC;YACvB,MAAM;QACR;YACE,KAAK,GAAG,8BAA8B,CAAC;YACvC,MAAM;QACR;YACE,KAAK,GAAG,cAAc,OAAO,CAAC,SAAS,YAAY,CAAC;YACpD,MAAM;QACR;YACE,KAAK,GAAG,yBAAyB,OAAO,CAAC,EAAE,GAAG,CAAC;YAC/C,MAAM;IACV,CAAC;IAED,IAAA,qBAAM,EAAC,SAAS,KAAK,KAAK,CAAC,CAAC;IAC5B,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AACxD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { assert, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { ElementGraphicsRequestProps, IModelError } from \"@itwin/core-common\";\r\nimport { ElementGraphicsStatus } from \"@bentley/imodeljs-native\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\n\r\n/** See [[IModelDb.generateElementGraphics]] and IModelTileRpcImpl.requestElementGraphics.\r\n * @internal\r\n */\r\nexport async function generateElementGraphics(request: ElementGraphicsRequestProps, iModel: IModelDb): Promise<Uint8Array | undefined> {\r\n const result = await iModel[_nativeDb].generateElementGraphics(request as any); // ###TODO update package versions in addon\r\n\r\n let error: string | undefined;\r\n switch (result.status) {\r\n case ElementGraphicsStatus.NoGeometry:\r\n case ElementGraphicsStatus.Canceled:\r\n return undefined;\r\n case ElementGraphicsStatus.Success:\r\n return result.content;\r\n case ElementGraphicsStatus.InvalidJson:\r\n error = \"Invalid JSON\";\r\n break;\r\n case ElementGraphicsStatus.UnknownMajorFormatVersion:\r\n error = \"Unknown major format version\";\r\n break;\r\n case ElementGraphicsStatus.ElementNotFound:\r\n error = `Element Id ${request.elementId} not found`;\r\n break;\r\n case ElementGraphicsStatus.DuplicateRequestId:\r\n error = `Duplicate request Id \"${request.id}\"`;\r\n break;\r\n }\r\n\r\n assert(undefined !== error);\r\n throw new IModelError(IModelStatus.BadRequest, error);\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementTreeWalker.js","sourceRoot":"","sources":["../../src/ElementTreeWalker.ts"],"names":[],"mappings":";;;AA+dA,8CAqBC;AAWD,sDAIC;AAngBD;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAgG;AAChG,oDAA4C;AAC5C,mEAAgE;AAChE,uCAA0G;AAC1G,yCAAsC;AACtC,mCAAiD;AAEjD,MAAM,cAAc,GAAG,GAAG,6CAAqB,CAAC,QAAQ,oBAAoB,CAAC;AAK7E,SAAS,yBAAyB,CAAC,MAAgB,EAAE,GAAc;IACjE,MAAM,QAAQ,GAAc,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAc,EAAE,CAAC;IAC9B,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,MA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oB,CAAC,UAAU,CAAC,CAAC;QACrC,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAC9B,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,EAAE;AAC9F,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CAAC,MAAgB,EAAE,UAAsB,EAAE,MAAkC;IAChH,MAAM,GAAG,GAAG,IAAI,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtD,GAAG,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC;IAC5C,GAAG,CAAC,4BAA4B,EAAE,CAAC;AACrC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Elements\n */\nimport { assert, DbResult, Id64Array, Id64String, Logger, LogLevel } from \"@itwin/core-bentley\";\nimport { IModel } from \"@itwin/core-common\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\nimport { DefinitionContainer, DefinitionElement, DefinitionPartition, Element, Subject } from \"./Element\";\nimport { IModelDb } from \"./IModelDb\";\nimport { DefinitionModel, Model } from \"./Model\";\n\nconst loggerCategory = `${BackendLoggerCategory.IModelDb}.ElementTreeWalker`;\n\n/** @beta */\nexport interface ElementTreeWalkerModelInfo { model: Model, isDefinitionModel: boolean }\n\nfunction sortChildrenBeforeParents(iModel: IModelDb, ids: Id64Array): Array<Id64Array> {\n const children: Id64Array = [];\n const parents: Id64Array = [];\n for (const eid of ids) {\n const parentId = iModel.elements.queryParent(eid);\n if (parentId !== undefined && ids.includes(parentId))\n children.push(eid);\n else\n parents.push(eid);\n }\n\n if (children.length === 0)\n return [parents];\n\n return [...sortChildrenBeforeParents(iModel, children), parents];\n}\n\nfunction isModelEmpty(iModel: IModelDb, modelId: Id64String): boolean {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return iModel.withPreparedStatement(`select count(*) from ${Element.classFullName} where Model.Id = ?`, (stmt) => {\n stmt.bindId(1, modelId);\n stmt.step();\n return stmt.getValue(0).getInteger() === 0;\n });\n}\n\nfunction isDefinitionModel(model: Model): boolean {\n return (model.id !== IModel.repositoryModelId) && (model instanceof DefinitionModel);\n}\n\nenum ElementPruningClassification { PRUNING_CLASS_Normal = 0, PRUNING_CLASS_Subject = 1, PRUNING_CLASS_Definition = 2, PRUNING_CLASS_DefinitionPartition = 3, }\n\nfunction classifyElementForPruning(iModel: IModelDb, elementId: Id64String): ElementPruningClassification {\n const el = iModel.elements.getElement(elementId);\n // DefinitionContainer is submodeled by a DefinitionModel and so it must be classified as PRUNING_CLASS_DefinitionPartition for tree-walking purposes.\n // Since DefinitionContainer is-a DefinitionElement the (el instanceof DefinitionElement) case below would classify it as PRUNING_CLASS_Definition.\n // That is why we special-case it here.\n if (el instanceof DefinitionContainer)\n return ElementPruningClassification.PRUNING_CLASS_DefinitionPartition;\n return (el instanceof Subject) ? ElementPruningClassification.PRUNING_CLASS_Subject :\n (el instanceof DefinitionElement) ? ElementPruningClassification.PRUNING_CLASS_Definition :\n (el instanceof DefinitionPartition) ? ElementPruningClassification.PRUNING_CLASS_DefinitionPartition :\n ElementPruningClassification.PRUNING_CLASS_Normal;\n}\n\n/** Records the path that a tree search took to reach an element or model. This object is immutable.\n * @beta\n */\nexport class ElementTreeWalkerScope {\n public readonly topElement: Id64String = \"\";\n /** path of parent elements and enclosing models */\n public readonly path: Array<Id64String | ElementTreeWalkerModelInfo> = [];\n /** cached info about the immediately enclosing model (i.e., the last model in path) */\n public readonly enclosingModelInfo: ElementTreeWalkerModelInfo;\n\n constructor(topElement: Id64String, model: Model);\n constructor(enclosingScope: ElementTreeWalkerScope, newScope: Id64String | Model);\n constructor(arg1: Id64String | ElementTreeWalkerScope, arg2: Model | Id64String) {\n if (typeof arg1 === \"string\") {\n // normal constructor\n assert(arg2 instanceof Model);\n this.topElement = arg1;\n this.path.push(this.enclosingModelInfo = { model: arg2, isDefinitionModel: isDefinitionModel(arg2) });\n } else if (arg1 instanceof ElementTreeWalkerScope) {\n // copy-like constructor\n this.topElement = arg1.topElement;\n this.path = [...arg1.path];\n if (typeof arg2 === \"string\") {\n // with new parent\n this.path.push(arg2);\n this.enclosingModelInfo = arg1.enclosingModelInfo;\n } else {\n // with new enclosing model\n this.path.push(this.enclosingModelInfo = { model: arg2, isDefinitionModel: isDefinitionModel(arg2) });\n }\n } else {\n throw new Error(\"invalid constructor signature\");\n }\n }\n\n public get enclosingModel(): Model { return this.enclosingModelInfo.model; }\n public get inDefinitionModel(): boolean { return this.enclosingModelInfo.isDefinitionModel; } // NB: this will return false for the RepositoryModel!\n public get inRepositoryModel(): boolean { return this.enclosingModelInfo.model.id === IModelDb.repositoryModelId; }\n\n public static createTopScope(iModel: IModelDb, topElementId: Id64String) {\n const topElement = iModel.elements.getElement(topElementId);\n const topElementModel = iModel.models.getModel(topElement.model);\n return new ElementTreeWalkerScope(topElementId, topElementModel);\n }\n\n private fmtItem(v: Id64String | ElementTreeWalkerModelInfo): string {\n if (typeof v === \"string\")\n return `element ${v}`;\n return `model ${v.model.id} ${v.isDefinitionModel ? \"(DEFN)\" : \"\"}`;\n }\n\n public toString(): string {\n return `[ ${this.path.map((v) => this.fmtItem(v)).join(\" / \")} ]`;\n }\n}\n\nfunction fmtElement(iModel: IModelDb, elementId: Id64String): string {\n const el = iModel.elements.getElement(elementId);\n return `${el.id} ${el.classFullName} ${el.getDisplayLabel()}`;\n}\n\nfunction fmtModel(model: Model): string {\n return `${model.id} ${model.classFullName} ${model.name}`;\n}\n\nlet isTraceEnabledChecked = -1;\n\nfunction isTraceEnabled(): boolean {\n if (isTraceEnabledChecked === -1)\n isTraceEnabledChecked = Logger.isEnabled(loggerCategory, LogLevel.Trace) ? 1 : 0;\n return isTraceEnabledChecked === 1;\n}\n\nfunction logElement(op: string, iModel: IModelDb, elementId: Id64String, scope?: ElementTreeWalkerScope, logChildren?: boolean): void {\n if (!isTraceEnabled())\n return;\n\n Logger.logTrace(loggerCategory, `${op} ${fmtElement(iModel, elementId)} ${scope ? scope.toString() : \"\"}`);\n\n if (logChildren)\n iModel.elements.queryChildren(elementId).forEach((c) => logElement(\" - \", iModel, c, undefined, true));\n}\n\nfunction logModel(op: string, iModel: IModelDb, modelId: Id64String, scope?: ElementTreeWalkerScope, logElements?: boolean): void {\n if (!isTraceEnabled())\n return;\n const model: Model = iModel.models.getModel(modelId);\n Logger.logTrace(loggerCategory, `${op} ${fmtModel(model)} ${scope ? scope.toString() : \"\"}`);\n\n if (logElements) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n iModel.withPreparedStatement(`select ecinstanceid from ${Element.classFullName} where Model.Id = ?`, (stmt) => {\n stmt.bindId(1, modelId);\n while (stmt.step() === DbResult.BE_SQLITE_ROW) {\n logElement(\" - \", iModel, stmt.getValue(0).getId());\n }\n });\n }\n}\n\n/** Does a depth-first search on the tree defined by an element and its sub-models and children.\n * Sub-models are visited before their modeled elements, and children are visited before their parents.\n *\n * The following callbacks allow the subclass to exclude elements and sub-trees from the search:\n * * [[ElementTreeBottomUp.shouldExploreModel]], [[ElementTreeBottomUp.shouldExploreChildren]]\n * * [[ElementTreeBottomUp.shouldVisitElement]], [[ElementTreeBottomUp.shouldVisitModel]]\n *\n * The [[ElementTreeBottomUp.visitElement]] and [[ElementTreeBottomUp.visitModel]] callbacks allow\n * the subclass to process the elements and models that are encountered in the search.\n * @beta\n */\nexport abstract class ElementTreeBottomUp {\n constructor(protected _iModel: IModelDb) { }\n\n /** Return true if the search should recurse into this model */\n protected shouldExploreModel(_model: Model, _scope: ElementTreeWalkerScope): boolean { return true; }\n /** Return true if the search should recurse into the children (if any) of this element */\n protected shouldExploreChildren(_parentId: Id64String, _scope: ElementTreeWalkerScope): boolean { return true; }\n /** Return true if the search should visit this element */\n protected shouldVisitElement(_elementId: Id64String, _scope: ElementTreeWalkerScope): boolean { return true; }\n /** Return true if the search should visit this model */\n protected shouldVisitModel(_model: Model, _scope: ElementTreeWalkerScope): boolean { return true; }\n\n /** Called to visit a model */\n protected abstract visitModel(model: Model, scope: ElementTreeWalkerScope): void;\n\n /** Called to visit an element */\n protected abstract visitElement(elementId: Id64String, scope: ElementTreeWalkerScope): void;\n\n /** The main tree-walking function */\n protected processElementTree(element: Id64String, scope: ElementTreeWalkerScope) {\n const subModel = this._iModel.models.tryGetModel<Model>(element);\n if (subModel !== undefined) {\n if (this.shouldExploreModel(subModel, scope))\n this._processSubModel(subModel, scope);\n\n if (this.shouldVisitModel(subModel, scope))\n this.visitModel(subModel, scope);\n }\n\n if (this.shouldExploreChildren(element, scope))\n this._processChildren(element, scope);\n\n if (this.shouldVisitElement(element, scope))\n this.visitElement(element, scope);\n }\n\n /** process the children of the specified parent element */\n private _processChildren(parentElement: Id64String, parentScope: ElementTreeWalkerScope): void {\n const children = this._iModel.elements.queryChildren(parentElement);\n if (children.length === 0)\n return;\n\n const childrenScope = new ElementTreeWalkerScope(parentScope, parentElement);\n\n for (const childElement of children)\n this.processElementTree(childElement, childrenScope);\n }\n\n /** process the elements in the specified model */\n private _processSubModel(model: Model, parenScope: ElementTreeWalkerScope): void {\n const scope = new ElementTreeWalkerScope(parenScope, model);\n // Visit only the top-level parents. processElementTree will visit their children (bottom-up).\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n model.iModel.withPreparedStatement(`select ECInstanceId from bis:Element where Model.id=? and Parent.Id is null`, (stmt) => {\n stmt.bindId(1, model.id);\n while (stmt.step() === DbResult.BE_SQLITE_ROW) {\n const elementId = stmt.getValue(0).getId();\n this.processElementTree(elementId, scope);\n }\n });\n }\n}\n\n/** Helper class that manages the deletion of definitions and subjects */\nclass SpecialElements {\n public definitionModels: Id64Array = [];\n public definitions: Id64Array = [];\n public subjects: Id64Array = [];\n\n public recordSpecialElement(iModel: IModelDb, elementId: Id64String): boolean {\n // Defer Definitions and Subjects\n const cls = classifyElementForPruning(iModel, elementId);\n if (cls === ElementPruningClassification.PRUNING_CLASS_Subject) {\n this.subjects.push(elementId);\n return true;\n } else if (cls === ElementPruningClassification.PRUNING_CLASS_Definition) {\n this.definitions.push(elementId);\n return true;\n } else if (cls === ElementPruningClassification.PRUNING_CLASS_DefinitionPartition) {\n this.definitionModels.push(elementId);\n return true;\n }\n return false; // not a special element\n }\n\n /** Delete special elements - This calls Elements.deleteDefinitionElements to process the collected definition elements as a group and then\n * calls Models.deleteModel on collected definition models. It then deletes all collected Subjects by calling Element.deleteElement on them.\n * @note Caller must ensure that the special elements were recorded in a depth-first search.\n */\n public deleteSpecialElements(iModel: IModelDb) {\n // It's dangerous to pass a mixture of SubCategories and Categories to deleteDefinitionElements.\n // That function will delete the Categories first, which automatically deletes all their child\n // SubCategories (in native code). If a SubCategory in the list is one of those children, then\n // deleteDefinitionElements will try and fail with an exception to delete that SubCategory in a subsequent step.\n // To work around this, we delete the SubCategories first, then everything else.\n // A similar problem occurs when you pass other kinds of elements to deleteDefinitionElements, where some are\n // children and others are parents. deleteDefinitionElements does not preserve the order that you specify,\n // and it does not process children before parents.\n for (const definitions of sortChildrenBeforeParents(iModel, this.definitions)) {\n if (isTraceEnabled())\n definitions.forEach((e) => logElement(\"try delete\", iModel, e));\n\n iModel.elements.deleteDefinitionElements(definitions); // will not delete definitions that are still in use.\n }\n\n for (const m of this.definitionModels) {\n if (!isModelEmpty(iModel, m)) {\n logModel(\"Model not empty - cannot delete - may contain Definitions that are still in use\", iModel, m, undefined, true);\n } else {\n logModel(\"delete\", iModel, m);\n iModel.models.deleteModel(m);\n iModel.elements.deleteElement(m);\n }\n }\n\n for (const e of this.subjects) {\n if (iModel.elements.queryChildren(e).length !== 0) {\n logElement(\"Subject still has children - cannot delete - may have child DefinitionModels\", iModel, e, undefined, true);\n } else {\n logElement(\"delete\", iModel, e);\n iModel.elements.deleteElement(e);\n }\n }\n }\n\n}\n\n/** Deletes an entire element tree, including sub-models and child elements.\n * Items are deleted in bottom-up order. Definitions and Subjects are deleted after normal elements.\n * Call deleteNormalElements on each tree. Then call deleteSpecialElements.\n * @see deleteElementTree for a simple way to use this class.\n * @beta\n */\nexport class ElementTreeDeleter extends ElementTreeBottomUp {\n protected _special: SpecialElements = new SpecialElements();\n\n protected override shouldExploreModel(_model: Model): boolean { return true; }\n protected override shouldVisitElement(_elementId: Id64String): boolean { return true; }\n\n protected override visitModel(model: Model, _scope: ElementTreeWalkerScope): void {\n if (isDefinitionModel(model))\n return; // we recorded definition models in visitElement when we encountered the DefinitionPartition elements.\n\n // visitElement has already deleted the elements in the model. So, now it's safe to delete the model itself.\n logModel(\"delete\", this._iModel, model.id, _scope);\n model.delete();\n }\n\n protected override visitElement(elementId: Id64String, _scope: ElementTreeWalkerScope): void {\n if (!this._special.recordSpecialElement(this._iModel, elementId)) {\n logElement(\"delete\", this._iModel, elementId, _scope);\n this._iModel.elements.deleteElement(elementId);\n }\n }\n\n /**\n * Delete the \"normal\" elements and record the special elements for deferred processing.\n * @param topElement The parent of the sub-tree to be deleted. Top element itself is also deleted.\n * @param scope How the parent was found\n * @see deleteSpecialElements\n */\n public deleteNormalElements(topElement: Id64String, scope?: ElementTreeWalkerScope): void {\n const topScope = scope ?? ElementTreeWalkerScope.createTopScope(this._iModel, topElement);\n this.processElementTree(topElement, topScope); //\n }\n\n /** Delete all special elements that were found and deferred by deleteNormalElements. Call this\n * function once after all element trees are processed by deleteNormalElements.\n */\n public deleteSpecialElements(): void {\n this._special.deleteSpecialElements(this._iModel);\n }\n\n}\n\n/** Does a breadth-first search on the tree defined by an element and its sub-models and children.\n * Parents are visited first, then children, then sub-models.\n * The subclass can \"prune\" sub-trees from the search. When a sub-tree is \"pruned\" the search does *not* recurse into it.\n * If a sub-tree is not pruned, then the search does recurse into it.\n * @beta\n */\nabstract class ElementTreeTopDown {\n constructor(protected _iModel: IModelDb) { }\n\n /** Should the search *not* recurse into this sub-tree? */\n protected shouldPrune(_elementId: Id64String, _scope: ElementTreeWalkerScope): boolean { return false; }\n\n protected abstract prune(_elementId: Id64String, _scope: ElementTreeWalkerScope): void;\n\n protected processElementTree(element: Id64String, scope: ElementTreeWalkerScope) {\n\n if (this.shouldPrune(element, scope)) {\n this.prune(element, scope);\n return;\n }\n\n this._processChildren(element, scope);\n\n const subModel = this._iModel.models.tryGetModel<Model>(element);\n if (subModel !== undefined) {\n this._processSubModel(subModel, scope);\n }\n }\n\n private _processChildren(element: Id64String, scope: ElementTreeWalkerScope) {\n let parentScope: ElementTreeWalkerScope | undefined;\n for (const childElement of this._iModel.elements.queryChildren(element)) {\n if (parentScope === undefined)\n parentScope = new ElementTreeWalkerScope(scope, element);\n this.processElementTree(childElement, parentScope);\n }\n }\n\n private _processSubModel(subModel: Model, scope: ElementTreeWalkerScope) {\n const subModelScope = new ElementTreeWalkerScope(scope, subModel);\n // Visit only the top-level parents. processElementTree will recurse into their children.\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this._iModel.withPreparedStatement(`select ECInstanceId from bis:Element where Model.id=? and Parent.Id is null`, (stmt) => {\n stmt.bindId(1, subModel.id);\n while (stmt.step() === DbResult.BE_SQLITE_ROW) {\n const elementId = stmt.getValue(0).getId();\n this.processElementTree(elementId, subModelScope);\n }\n });\n }\n\n}\n\n/** Signature of the filter function used by ElementSubTreeDeleter.\n * @param elementId The sub-tree parent element.\n * @param scope The path followed by the top-down search to the element\n * @return true if the element and its children and sub-models should be deleted.\n * @beta\n */\nexport type ElementSubTreeDeleteFilter = (elementId: Id64String, scope: ElementTreeWalkerScope) => boolean;\n\n/** Performs a breadth-first search to visit elements in top-down order.\n * When the supplied filter function chooses an element, ElementTreeDeleter is used to delete it and its sub-tree.\n * @beta\n */\nexport class ElementSubTreeDeleter extends ElementTreeTopDown {\n private _treeDeleter: ElementTreeDeleter;\n private _shouldPruneCb: ElementSubTreeDeleteFilter;\n\n /** Construct an ElementSubTreeDeleter.\n * @param iModel The iModel\n * @param topElement Where to start the search.\n * @param shouldPruneCb Callback that selects sub-trees that should be deleted.\n * @see deleteElementSubTrees for a simple way to use this class.\n */\n public constructor(iModel: IModelDb, shouldPruneCb: ElementSubTreeDeleteFilter) {\n super(iModel);\n this._treeDeleter = new ElementTreeDeleter(this._iModel);\n this._shouldPruneCb = shouldPruneCb;\n }\n\n protected override shouldPrune(elementId: Id64String, scope: ElementTreeWalkerScope): boolean { return this._shouldPruneCb(elementId, scope); }\n\n protected prune(elementId: Id64String, scope: ElementTreeWalkerScope): void {\n this._treeDeleter.deleteNormalElements(elementId, scope);\n }\n\n /** Traverses the tree of elements beginning with the top element, and deletes all selected sub-trees.\n * Normal elements are deleted. Any special elements that are encountered are deferred.\n * Call deleteSpecialElementSubTrees after all top elements have been processed. */\n public deleteNormalElementSubTrees(topElement: Id64String, scope?: ElementTreeWalkerScope) {\n const topScope = scope ?? ElementTreeWalkerScope.createTopScope(this._iModel, topElement);\n this.processElementTree(topElement, topScope); // deletes normal elements and their sub-trees, defers special elements\n }\n\n /** Delete all special elements and their sub-trees that were found in the course of processing.\n * The sub-trees were already expanded by ElementTreeDeleter.deleteNormalElements.\n */\n public deleteSpecialElementSubTrees() {\n this._treeDeleter.deleteSpecialElements();\n }\n}\n\n/** Arguments supplied to [[deleteElementTree]].\n * @beta\n */\nexport interface DeleteElementTreeArgs {\n /** The iModel containing the elements to delete. */\n iModel: IModelDb;\n /** The Id of the root element of the tree to delete. */\n topElement: Id64String;\n /** The maximum number of passes to make when deleting definition elements.\n * Default: 5\n */\n maxPasses?: number;\n}\n\n/** Deletes an element tree starting with the specified top element. The top element is also deleted. Uses ElementTreeDeleter.\n * @param iModel The iModel\n * @param topElement The parent of the sub-tree\n * @beta\n */\nexport function deleteElementTree(iModel: IModelDb, topElement: Id64String): void;\n/** Deletes an element tree starting with the specified top element. The top element is also deleted. Uses ElementTreeDeleter.\n * @param args Specifies the iModel and top element.\n * @beta\n */\nexport function deleteElementTree(args: DeleteElementTreeArgs): void;\n/** @internal */\nexport function deleteElementTree(arg0: DeleteElementTreeArgs | IModelDb, arg1?: Id64String): void {\n let maxPasses;\n let iModel: IModelDb;\n let topElement: Id64String;\n if (arg0 instanceof IModelDb) {\n assert(typeof arg1 === \"string\");\n iModel = arg0;\n topElement = arg1;\n } else {\n iModel = arg0.iModel;\n topElement = arg0.topElement;\n maxPasses = arg0.maxPasses;\n }\n\n maxPasses = maxPasses ?? 5;\n let pass = 0;\n do {\n const del = new ElementTreeDeleter(iModel);\n del.deleteNormalElements(topElement);\n del.deleteSpecialElements();\n } while ((iModel.elements.tryGetElement(topElement) !== undefined) && (++pass < maxPasses));\n}\n\n/** Deletes all element sub-trees that are selected by the supplied filter. Uses ElementSubTreeDeleter.\n * If the filter selects the top element itself, then the entire tree (including the top element) is deleted.\n * That has the same effect as calling [[deleteElementTree]] on the top element.\n * @note The caller may have to call this function multiple times if there are multiple layers of dependencies among definition elements.\n * @param iModel The iModel\n * @param topElement Where to start the search.\n * @param filter Callback that selects sub-trees that should be deleted.\n * @beta\n */\nexport function deleteElementSubTrees(iModel: IModelDb, topElement: Id64String, filter: ElementSubTreeDeleteFilter): void {\n const del = new ElementSubTreeDeleter(iModel, filter);\n del.deleteNormalElementSubTrees(topElement);\n del.deleteSpecialElementSubTrees();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ElementTreeWalker.js","sourceRoot":"","sources":["../../src/ElementTreeWalker.ts"],"names":[],"mappings":";;;AA+dA,8CAqBC;AAWD,sDAIC;AAngBD;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAgG;AAChG,oDAA4C;AAC5C,mEAAgE;AAChE,uCAA0G;AAC1G,yCAAsC;AACtC,mCAAiD;AAEjD,MAAM,cAAc,GAAG,GAAG,6CAAqB,CAAC,QAAQ,oBAAoB,CAAC;AAK7E,SAAS,yBAAyB,CAAC,MAAgB,EAAE,GAAc;IACjE,MAAM,QAAQ,GAAc,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAc,E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GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC3C,GAAG,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACrC,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAC9B,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,EAAE;AAC9F,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CAAC,MAAgB,EAAE,UAAsB,EAAE,MAAkC;IAChH,MAAM,GAAG,GAAG,IAAI,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtD,GAAG,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC;IAC5C,GAAG,CAAC,4BAA4B,EAAE,CAAC;AACrC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\nimport { assert, DbResult, Id64Array, Id64String, Logger, LogLevel } from \"@itwin/core-bentley\";\r\nimport { IModel } from \"@itwin/core-common\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { DefinitionContainer, DefinitionElement, DefinitionPartition, Element, Subject } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { DefinitionModel, Model } from \"./Model\";\r\n\r\nconst loggerCategory = `${BackendLoggerCategory.IModelDb}.ElementTreeWalker`;\r\n\r\n/** @beta */\r\nexport interface ElementTreeWalkerModelInfo { model: Model, isDefinitionModel: boolean }\r\n\r\nfunction sortChildrenBeforeParents(iModel: IModelDb, ids: Id64Array): Array<Id64Array> {\r\n const children: Id64Array = [];\r\n const parents: Id64Array = [];\r\n for (const eid of ids) {\r\n const parentId = iModel.elements.queryParent(eid);\r\n if (parentId !== undefined && ids.includes(parentId))\r\n children.push(eid);\r\n else\r\n parents.push(eid);\r\n }\r\n\r\n if (children.length === 0)\r\n return [parents];\r\n\r\n return [...sortChildrenBeforeParents(iModel, children), parents];\r\n}\r\n\r\nfunction isModelEmpty(iModel: IModelDb, modelId: Id64String): boolean {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return iModel.withPreparedStatement(`select count(*) from ${Element.classFullName} where Model.Id = ?`, (stmt) => {\r\n stmt.bindId(1, modelId);\r\n stmt.step();\r\n return stmt.getValue(0).getInteger() === 0;\r\n });\r\n}\r\n\r\nfunction isDefinitionModel(model: Model): boolean {\r\n return (model.id !== IModel.repositoryModelId) && (model instanceof DefinitionModel);\r\n}\r\n\r\nenum ElementPruningClassification { PRUNING_CLASS_Normal = 0, PRUNING_CLASS_Subject = 1, PRUNING_CLASS_Definition = 2, PRUNING_CLASS_DefinitionPartition = 3, }\r\n\r\nfunction classifyElementForPruning(iModel: IModelDb, elementId: Id64String): ElementPruningClassification {\r\n const el = iModel.elements.getElement(elementId);\r\n // DefinitionContainer is submodeled by a DefinitionModel and so it must be classified as PRUNING_CLASS_DefinitionPartition for tree-walking purposes.\r\n // Since DefinitionContainer is-a DefinitionElement the (el instanceof DefinitionElement) case below would classify it as PRUNING_CLASS_Definition.\r\n // That is why we special-case it here.\r\n if (el instanceof DefinitionContainer)\r\n return ElementPruningClassification.PRUNING_CLASS_DefinitionPartition;\r\n return (el instanceof Subject) ? ElementPruningClassification.PRUNING_CLASS_Subject :\r\n (el instanceof DefinitionElement) ? ElementPruningClassification.PRUNING_CLASS_Definition :\r\n (el instanceof DefinitionPartition) ? ElementPruningClassification.PRUNING_CLASS_DefinitionPartition :\r\n ElementPruningClassification.PRUNING_CLASS_Normal;\r\n}\r\n\r\n/** Records the path that a tree search took to reach an element or model. This object is immutable.\r\n * @beta\r\n */\r\nexport class ElementTreeWalkerScope {\r\n public readonly topElement: Id64String = \"\";\r\n /** path of parent elements and enclosing models */\r\n public readonly path: Array<Id64String | ElementTreeWalkerModelInfo> = [];\r\n /** cached info about the immediately enclosing model (i.e., the last model in path) */\r\n public readonly enclosingModelInfo: ElementTreeWalkerModelInfo;\r\n\r\n constructor(topElement: Id64String, model: Model);\r\n constructor(enclosingScope: ElementTreeWalkerScope, newScope: Id64String | Model);\r\n constructor(arg1: Id64String | ElementTreeWalkerScope, arg2: Model | Id64String) {\r\n if (typeof arg1 === \"string\") {\r\n // normal constructor\r\n assert(arg2 instanceof Model);\r\n this.topElement = arg1;\r\n this.path.push(this.enclosingModelInfo = { model: arg2, isDefinitionModel: isDefinitionModel(arg2) });\r\n } else if (arg1 instanceof ElementTreeWalkerScope) {\r\n // copy-like constructor\r\n this.topElement = arg1.topElement;\r\n this.path = [...arg1.path];\r\n if (typeof arg2 === \"string\") {\r\n // with new parent\r\n this.path.push(arg2);\r\n this.enclosingModelInfo = arg1.enclosingModelInfo;\r\n } else {\r\n // with new enclosing model\r\n this.path.push(this.enclosingModelInfo = { model: arg2, isDefinitionModel: isDefinitionModel(arg2) });\r\n }\r\n } else {\r\n throw new Error(\"invalid constructor signature\");\r\n }\r\n }\r\n\r\n public get enclosingModel(): Model { return this.enclosingModelInfo.model; }\r\n public get inDefinitionModel(): boolean { return this.enclosingModelInfo.isDefinitionModel; } // NB: this will return false for the RepositoryModel!\r\n public get inRepositoryModel(): boolean { return this.enclosingModelInfo.model.id === IModelDb.repositoryModelId; }\r\n\r\n public static createTopScope(iModel: IModelDb, topElementId: Id64String) {\r\n const topElement = iModel.elements.getElement(topElementId);\r\n const topElementModel = iModel.models.getModel(topElement.model);\r\n return new ElementTreeWalkerScope(topElementId, topElementModel);\r\n }\r\n\r\n private fmtItem(v: Id64String | ElementTreeWalkerModelInfo): string {\r\n if (typeof v === \"string\")\r\n return `element ${v}`;\r\n return `model ${v.model.id} ${v.isDefinitionModel ? \"(DEFN)\" : \"\"}`;\r\n }\r\n\r\n public toString(): string {\r\n return `[ ${this.path.map((v) => this.fmtItem(v)).join(\" / \")} ]`;\r\n }\r\n}\r\n\r\nfunction fmtElement(iModel: IModelDb, elementId: Id64String): string {\r\n const el = iModel.elements.getElement(elementId);\r\n return `${el.id} ${el.classFullName} ${el.getDisplayLabel()}`;\r\n}\r\n\r\nfunction fmtModel(model: Model): string {\r\n return `${model.id} ${model.classFullName} ${model.name}`;\r\n}\r\n\r\nlet isTraceEnabledChecked = -1;\r\n\r\nfunction isTraceEnabled(): boolean {\r\n if (isTraceEnabledChecked === -1)\r\n isTraceEnabledChecked = Logger.isEnabled(loggerCategory, LogLevel.Trace) ? 1 : 0;\r\n return isTraceEnabledChecked === 1;\r\n}\r\n\r\nfunction logElement(op: string, iModel: IModelDb, elementId: Id64String, scope?: ElementTreeWalkerScope, logChildren?: boolean): void {\r\n if (!isTraceEnabled())\r\n return;\r\n\r\n Logger.logTrace(loggerCategory, `${op} ${fmtElement(iModel, elementId)} ${scope ? scope.toString() : \"\"}`);\r\n\r\n if (logChildren)\r\n iModel.elements.queryChildren(elementId).forEach((c) => logElement(\" - \", iModel, c, undefined, true));\r\n}\r\n\r\nfunction logModel(op: string, iModel: IModelDb, modelId: Id64String, scope?: ElementTreeWalkerScope, logElements?: boolean): void {\r\n if (!isTraceEnabled())\r\n return;\r\n const model: Model = iModel.models.getModel(modelId);\r\n Logger.logTrace(loggerCategory, `${op} ${fmtModel(model)} ${scope ? scope.toString() : \"\"}`);\r\n\r\n if (logElements) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n iModel.withPreparedStatement(`select ecinstanceid from ${Element.classFullName} where Model.Id = ?`, (stmt) => {\r\n stmt.bindId(1, modelId);\r\n while (stmt.step() === DbResult.BE_SQLITE_ROW) {\r\n logElement(\" - \", iModel, stmt.getValue(0).getId());\r\n }\r\n });\r\n }\r\n}\r\n\r\n/** Does a depth-first search on the tree defined by an element and its sub-models and children.\r\n * Sub-models are visited before their modeled elements, and children are visited before their parents.\r\n *\r\n * The following callbacks allow the subclass to exclude elements and sub-trees from the search:\r\n * * [[ElementTreeBottomUp.shouldExploreModel]], [[ElementTreeBottomUp.shouldExploreChildren]]\r\n * * [[ElementTreeBottomUp.shouldVisitElement]], [[ElementTreeBottomUp.shouldVisitModel]]\r\n *\r\n * The [[ElementTreeBottomUp.visitElement]] and [[ElementTreeBottomUp.visitModel]] callbacks allow\r\n * the subclass to process the elements and models that are encountered in the search.\r\n * @beta\r\n */\r\nexport abstract class ElementTreeBottomUp {\r\n constructor(protected _iModel: IModelDb) { }\r\n\r\n /** Return true if the search should recurse into this model */\r\n protected shouldExploreModel(_model: Model, _scope: ElementTreeWalkerScope): boolean { return true; }\r\n /** Return true if the search should recurse into the children (if any) of this element */\r\n protected shouldExploreChildren(_parentId: Id64String, _scope: ElementTreeWalkerScope): boolean { return true; }\r\n /** Return true if the search should visit this element */\r\n protected shouldVisitElement(_elementId: Id64String, _scope: ElementTreeWalkerScope): boolean { return true; }\r\n /** Return true if the search should visit this model */\r\n protected shouldVisitModel(_model: Model, _scope: ElementTreeWalkerScope): boolean { return true; }\r\n\r\n /** Called to visit a model */\r\n protected abstract visitModel(model: Model, scope: ElementTreeWalkerScope): void;\r\n\r\n /** Called to visit an element */\r\n protected abstract visitElement(elementId: Id64String, scope: ElementTreeWalkerScope): void;\r\n\r\n /** The main tree-walking function */\r\n protected processElementTree(element: Id64String, scope: ElementTreeWalkerScope) {\r\n const subModel = this._iModel.models.tryGetModel<Model>(element);\r\n if (subModel !== undefined) {\r\n if (this.shouldExploreModel(subModel, scope))\r\n this._processSubModel(subModel, scope);\r\n\r\n if (this.shouldVisitModel(subModel, scope))\r\n this.visitModel(subModel, scope);\r\n }\r\n\r\n if (this.shouldExploreChildren(element, scope))\r\n this._processChildren(element, scope);\r\n\r\n if (this.shouldVisitElement(element, scope))\r\n this.visitElement(element, scope);\r\n }\r\n\r\n /** process the children of the specified parent element */\r\n private _processChildren(parentElement: Id64String, parentScope: ElementTreeWalkerScope): void {\r\n const children = this._iModel.elements.queryChildren(parentElement);\r\n if (children.length === 0)\r\n return;\r\n\r\n const childrenScope = new ElementTreeWalkerScope(parentScope, parentElement);\r\n\r\n for (const childElement of children)\r\n this.processElementTree(childElement, childrenScope);\r\n }\r\n\r\n /** process the elements in the specified model */\r\n private _processSubModel(model: Model, parenScope: ElementTreeWalkerScope): void {\r\n const scope = new ElementTreeWalkerScope(parenScope, model);\r\n // Visit only the top-level parents. processElementTree will visit their children (bottom-up).\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n model.iModel.withPreparedStatement(`select ECInstanceId from bis:Element where Model.id=? and Parent.Id is null`, (stmt) => {\r\n stmt.bindId(1, model.id);\r\n while (stmt.step() === DbResult.BE_SQLITE_ROW) {\r\n const elementId = stmt.getValue(0).getId();\r\n this.processElementTree(elementId, scope);\r\n }\r\n });\r\n }\r\n}\r\n\r\n/** Helper class that manages the deletion of definitions and subjects */\r\nclass SpecialElements {\r\n public definitionModels: Id64Array = [];\r\n public definitions: Id64Array = [];\r\n public subjects: Id64Array = [];\r\n\r\n public recordSpecialElement(iModel: IModelDb, elementId: Id64String): boolean {\r\n // Defer Definitions and Subjects\r\n const cls = classifyElementForPruning(iModel, elementId);\r\n if (cls === ElementPruningClassification.PRUNING_CLASS_Subject) {\r\n this.subjects.push(elementId);\r\n return true;\r\n } else if (cls === ElementPruningClassification.PRUNING_CLASS_Definition) {\r\n this.definitions.push(elementId);\r\n return true;\r\n } else if (cls === ElementPruningClassification.PRUNING_CLASS_DefinitionPartition) {\r\n this.definitionModels.push(elementId);\r\n return true;\r\n }\r\n return false; // not a special element\r\n }\r\n\r\n /** Delete special elements - This calls Elements.deleteDefinitionElements to process the collected definition elements as a group and then\r\n * calls Models.deleteModel on collected definition models. It then deletes all collected Subjects by calling Element.deleteElement on them.\r\n * @note Caller must ensure that the special elements were recorded in a depth-first search.\r\n */\r\n public deleteSpecialElements(iModel: IModelDb) {\r\n // It's dangerous to pass a mixture of SubCategories and Categories to deleteDefinitionElements.\r\n // That function will delete the Categories first, which automatically deletes all their child\r\n // SubCategories (in native code). If a SubCategory in the list is one of those children, then\r\n // deleteDefinitionElements will try and fail with an exception to delete that SubCategory in a subsequent step.\r\n // To work around this, we delete the SubCategories first, then everything else.\r\n // A similar problem occurs when you pass other kinds of elements to deleteDefinitionElements, where some are\r\n // children and others are parents. deleteDefinitionElements does not preserve the order that you specify,\r\n // and it does not process children before parents.\r\n for (const definitions of sortChildrenBeforeParents(iModel, this.definitions)) {\r\n if (isTraceEnabled())\r\n definitions.forEach((e) => logElement(\"try delete\", iModel, e));\r\n\r\n iModel.elements.deleteDefinitionElements(definitions); // will not delete definitions that are still in use.\r\n }\r\n\r\n for (const m of this.definitionModels) {\r\n if (!isModelEmpty(iModel, m)) {\r\n logModel(\"Model not empty - cannot delete - may contain Definitions that are still in use\", iModel, m, undefined, true);\r\n } else {\r\n logModel(\"delete\", iModel, m);\r\n iModel.models.deleteModel(m);\r\n iModel.elements.deleteElement(m);\r\n }\r\n }\r\n\r\n for (const e of this.subjects) {\r\n if (iModel.elements.queryChildren(e).length !== 0) {\r\n logElement(\"Subject still has children - cannot delete - may have child DefinitionModels\", iModel, e, undefined, true);\r\n } else {\r\n logElement(\"delete\", iModel, e);\r\n iModel.elements.deleteElement(e);\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\n/** Deletes an entire element tree, including sub-models and child elements.\r\n * Items are deleted in bottom-up order. Definitions and Subjects are deleted after normal elements.\r\n * Call deleteNormalElements on each tree. Then call deleteSpecialElements.\r\n * @see deleteElementTree for a simple way to use this class.\r\n * @beta\r\n */\r\nexport class ElementTreeDeleter extends ElementTreeBottomUp {\r\n protected _special: SpecialElements = new SpecialElements();\r\n\r\n protected override shouldExploreModel(_model: Model): boolean { return true; }\r\n protected override shouldVisitElement(_elementId: Id64String): boolean { return true; }\r\n\r\n protected override visitModel(model: Model, _scope: ElementTreeWalkerScope): void {\r\n if (isDefinitionModel(model))\r\n return; // we recorded definition models in visitElement when we encountered the DefinitionPartition elements.\r\n\r\n // visitElement has already deleted the elements in the model. So, now it's safe to delete the model itself.\r\n logModel(\"delete\", this._iModel, model.id, _scope);\r\n model.delete();\r\n }\r\n\r\n protected override visitElement(elementId: Id64String, _scope: ElementTreeWalkerScope): void {\r\n if (!this._special.recordSpecialElement(this._iModel, elementId)) {\r\n logElement(\"delete\", this._iModel, elementId, _scope);\r\n this._iModel.elements.deleteElement(elementId);\r\n }\r\n }\r\n\r\n /**\r\n * Delete the \"normal\" elements and record the special elements for deferred processing.\r\n * @param topElement The parent of the sub-tree to be deleted. Top element itself is also deleted.\r\n * @param scope How the parent was found\r\n * @see deleteSpecialElements\r\n */\r\n public deleteNormalElements(topElement: Id64String, scope?: ElementTreeWalkerScope): void {\r\n const topScope = scope ?? ElementTreeWalkerScope.createTopScope(this._iModel, topElement);\r\n this.processElementTree(topElement, topScope); //\r\n }\r\n\r\n /** Delete all special elements that were found and deferred by deleteNormalElements. Call this\r\n * function once after all element trees are processed by deleteNormalElements.\r\n */\r\n public deleteSpecialElements(): void {\r\n this._special.deleteSpecialElements(this._iModel);\r\n }\r\n\r\n}\r\n\r\n/** Does a breadth-first search on the tree defined by an element and its sub-models and children.\r\n * Parents are visited first, then children, then sub-models.\r\n * The subclass can \"prune\" sub-trees from the search. When a sub-tree is \"pruned\" the search does *not* recurse into it.\r\n * If a sub-tree is not pruned, then the search does recurse into it.\r\n * @beta\r\n */\r\nabstract class ElementTreeTopDown {\r\n constructor(protected _iModel: IModelDb) { }\r\n\r\n /** Should the search *not* recurse into this sub-tree? */\r\n protected shouldPrune(_elementId: Id64String, _scope: ElementTreeWalkerScope): boolean { return false; }\r\n\r\n protected abstract prune(_elementId: Id64String, _scope: ElementTreeWalkerScope): void;\r\n\r\n protected processElementTree(element: Id64String, scope: ElementTreeWalkerScope) {\r\n\r\n if (this.shouldPrune(element, scope)) {\r\n this.prune(element, scope);\r\n return;\r\n }\r\n\r\n this._processChildren(element, scope);\r\n\r\n const subModel = this._iModel.models.tryGetModel<Model>(element);\r\n if (subModel !== undefined) {\r\n this._processSubModel(subModel, scope);\r\n }\r\n }\r\n\r\n private _processChildren(element: Id64String, scope: ElementTreeWalkerScope) {\r\n let parentScope: ElementTreeWalkerScope | undefined;\r\n for (const childElement of this._iModel.elements.queryChildren(element)) {\r\n if (parentScope === undefined)\r\n parentScope = new ElementTreeWalkerScope(scope, element);\r\n this.processElementTree(childElement, parentScope);\r\n }\r\n }\r\n\r\n private _processSubModel(subModel: Model, scope: ElementTreeWalkerScope) {\r\n const subModelScope = new ElementTreeWalkerScope(scope, subModel);\r\n // Visit only the top-level parents. processElementTree will recurse into their children.\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this._iModel.withPreparedStatement(`select ECInstanceId from bis:Element where Model.id=? and Parent.Id is null`, (stmt) => {\r\n stmt.bindId(1, subModel.id);\r\n while (stmt.step() === DbResult.BE_SQLITE_ROW) {\r\n const elementId = stmt.getValue(0).getId();\r\n this.processElementTree(elementId, subModelScope);\r\n }\r\n });\r\n }\r\n\r\n}\r\n\r\n/** Signature of the filter function used by ElementSubTreeDeleter.\r\n * @param elementId The sub-tree parent element.\r\n * @param scope The path followed by the top-down search to the element\r\n * @return true if the element and its children and sub-models should be deleted.\r\n * @beta\r\n */\r\nexport type ElementSubTreeDeleteFilter = (elementId: Id64String, scope: ElementTreeWalkerScope) => boolean;\r\n\r\n/** Performs a breadth-first search to visit elements in top-down order.\r\n * When the supplied filter function chooses an element, ElementTreeDeleter is used to delete it and its sub-tree.\r\n * @beta\r\n */\r\nexport class ElementSubTreeDeleter extends ElementTreeTopDown {\r\n private _treeDeleter: ElementTreeDeleter;\r\n private _shouldPruneCb: ElementSubTreeDeleteFilter;\r\n\r\n /** Construct an ElementSubTreeDeleter.\r\n * @param iModel The iModel\r\n * @param topElement Where to start the search.\r\n * @param shouldPruneCb Callback that selects sub-trees that should be deleted.\r\n * @see deleteElementSubTrees for a simple way to use this class.\r\n */\r\n public constructor(iModel: IModelDb, shouldPruneCb: ElementSubTreeDeleteFilter) {\r\n super(iModel);\r\n this._treeDeleter = new ElementTreeDeleter(this._iModel);\r\n this._shouldPruneCb = shouldPruneCb;\r\n }\r\n\r\n protected override shouldPrune(elementId: Id64String, scope: ElementTreeWalkerScope): boolean { return this._shouldPruneCb(elementId, scope); }\r\n\r\n protected prune(elementId: Id64String, scope: ElementTreeWalkerScope): void {\r\n this._treeDeleter.deleteNormalElements(elementId, scope);\r\n }\r\n\r\n /** Traverses the tree of elements beginning with the top element, and deletes all selected sub-trees.\r\n * Normal elements are deleted. Any special elements that are encountered are deferred.\r\n * Call deleteSpecialElementSubTrees after all top elements have been processed. */\r\n public deleteNormalElementSubTrees(topElement: Id64String, scope?: ElementTreeWalkerScope) {\r\n const topScope = scope ?? ElementTreeWalkerScope.createTopScope(this._iModel, topElement);\r\n this.processElementTree(topElement, topScope); // deletes normal elements and their sub-trees, defers special elements\r\n }\r\n\r\n /** Delete all special elements and their sub-trees that were found in the course of processing.\r\n * The sub-trees were already expanded by ElementTreeDeleter.deleteNormalElements.\r\n */\r\n public deleteSpecialElementSubTrees() {\r\n this._treeDeleter.deleteSpecialElements();\r\n }\r\n}\r\n\r\n/** Arguments supplied to [[deleteElementTree]].\r\n * @beta\r\n */\r\nexport interface DeleteElementTreeArgs {\r\n /** The iModel containing the elements to delete. */\r\n iModel: IModelDb;\r\n /** The Id of the root element of the tree to delete. */\r\n topElement: Id64String;\r\n /** The maximum number of passes to make when deleting definition elements.\r\n * Default: 5\r\n */\r\n maxPasses?: number;\r\n}\r\n\r\n/** Deletes an element tree starting with the specified top element. The top element is also deleted. Uses ElementTreeDeleter.\r\n * @param iModel The iModel\r\n * @param topElement The parent of the sub-tree\r\n * @beta\r\n */\r\nexport function deleteElementTree(iModel: IModelDb, topElement: Id64String): void;\r\n/** Deletes an element tree starting with the specified top element. The top element is also deleted. Uses ElementTreeDeleter.\r\n * @param args Specifies the iModel and top element.\r\n * @beta\r\n */\r\nexport function deleteElementTree(args: DeleteElementTreeArgs): void;\r\n/** @internal */\r\nexport function deleteElementTree(arg0: DeleteElementTreeArgs | IModelDb, arg1?: Id64String): void {\r\n let maxPasses;\r\n let iModel: IModelDb;\r\n let topElement: Id64String;\r\n if (arg0 instanceof IModelDb) {\r\n assert(typeof arg1 === \"string\");\r\n iModel = arg0;\r\n topElement = arg1;\r\n } else {\r\n iModel = arg0.iModel;\r\n topElement = arg0.topElement;\r\n maxPasses = arg0.maxPasses;\r\n }\r\n\r\n maxPasses = maxPasses ?? 5;\r\n let pass = 0;\r\n do {\r\n const del = new ElementTreeDeleter(iModel);\r\n del.deleteNormalElements(topElement);\r\n del.deleteSpecialElements();\r\n } while ((iModel.elements.tryGetElement(topElement) !== undefined) && (++pass < maxPasses));\r\n}\r\n\r\n/** Deletes all element sub-trees that are selected by the supplied filter. Uses ElementSubTreeDeleter.\r\n * If the filter selects the top element itself, then the entire tree (including the top element) is deleted.\r\n * That has the same effect as calling [[deleteElementTree]] on the top element.\r\n * @note The caller may have to call this function multiple times if there are multiple layers of dependencies among definition elements.\r\n * @param iModel The iModel\r\n * @param topElement Where to start the search.\r\n * @param filter Callback that selects sub-trees that should be deleted.\r\n * @beta\r\n */\r\nexport function deleteElementSubTrees(iModel: IModelDb, topElement: Id64String, filter: ElementSubTreeDeleteFilter): void {\r\n const del = new ElementSubTreeDeleter(iModel, filter);\r\n del.deleteNormalElementSubTrees(topElement);\r\n del.deleteSpecialElementSubTrees();\r\n}\r\n"]}
|
package/lib/cjs/Entity.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Id64String } from "@itwin/core-bentley";
|
|
|
5
5
|
import { ElementLoadOptions, EntityProps, EntityReferenceSet, PropertyCallback } from "@itwin/core-common";
|
|
6
6
|
import type { IModelDb } from "./IModelDb";
|
|
7
7
|
import { Schema } from "./Schema";
|
|
8
|
-
import { EntityClass, Property, SchemaItemKey } from "@itwin/ecschema-metadata";
|
|
8
|
+
import { EntityClass, Property, RelationshipClass, SchemaItemKey } from "@itwin/ecschema-metadata";
|
|
9
9
|
/** Represents a row returned by an ECSql query. The row is returned as a map of property names to values.
|
|
10
10
|
* ECSqlRow has same schema as declared in ECSchema for the class and similar to if ECSQL SELECT * FROM <schema>:<class> were executed.
|
|
11
11
|
* @beta */
|
|
@@ -36,7 +36,7 @@ export interface CustomHandledProperty {
|
|
|
36
36
|
/** Represents one of the fundamental building block in an [[IModelDb]]: as an [[Element]], [[Model]], or [[Relationship]].
|
|
37
37
|
* Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).
|
|
38
38
|
* An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].
|
|
39
|
-
* @public
|
|
39
|
+
* @public @preview
|
|
40
40
|
*/
|
|
41
41
|
export declare class Entity {
|
|
42
42
|
/** An immutable property used to discriminate between [[Entity]] and [EntityProps]($common), used to inform the TypeScript compiler that these two types
|
|
@@ -56,7 +56,8 @@ export declare class Entity {
|
|
|
56
56
|
* @public @preview
|
|
57
57
|
*/
|
|
58
58
|
static get schemaItemKey(): SchemaItemKey;
|
|
59
|
-
|
|
59
|
+
/** Cached Metadata for the ECClass */
|
|
60
|
+
protected _metadata?: EntityClass | RelationshipClass;
|
|
60
61
|
/** When working with an Entity it can be useful to set property values directly, bypassing the compiler's type checking.
|
|
61
62
|
* This property makes such code slightly less tedious to read and write.
|
|
62
63
|
* @internal
|
|
@@ -96,7 +97,7 @@ export declare class Entity {
|
|
|
96
97
|
* @param func The callback to be invoked on each property
|
|
97
98
|
* @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
|
|
98
99
|
* @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
|
|
99
|
-
* @deprecated in 5.0. Please use `forEach` to get the metadata and iterate over the properties instead.
|
|
100
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `forEach` to get the metadata and iterate over the properties instead.
|
|
100
101
|
*
|
|
101
102
|
* @example
|
|
102
103
|
* ```typescript
|
|
@@ -136,12 +137,14 @@ export declare class Entity {
|
|
|
136
137
|
* @public @preview
|
|
137
138
|
*/
|
|
138
139
|
get schemaItemKey(): SchemaItemKey;
|
|
139
|
-
/**
|
|
140
|
+
/** Query metadata for this entity class from the iModel's schema. Returns cached metadata if available.
|
|
140
141
|
* @throws [[IModelError]] if there is a problem querying the schema
|
|
141
142
|
* @returns The metadata for the current entity
|
|
142
143
|
* @public @preview
|
|
143
144
|
*/
|
|
144
|
-
getMetaData(): Promise<EntityClass>;
|
|
145
|
+
getMetaData(): Promise<EntityClass | RelationshipClass>;
|
|
146
|
+
/** @internal */
|
|
147
|
+
getMetaDataSync(): EntityClass | RelationshipClass;
|
|
145
148
|
/** @internal */
|
|
146
149
|
static get protectedOperations(): string[];
|
|
147
150
|
/** return whether this Entity class is a subclass of another Entity class
|
|
@@ -178,7 +181,7 @@ export declare class Entity {
|
|
|
178
181
|
*/
|
|
179
182
|
export type PropertyHandler = (name: string, property: Property) => void;
|
|
180
183
|
/** Parameter type that can accept both abstract constructor types and non-abstract constructor types for `instanceof` to test.
|
|
181
|
-
* @public
|
|
184
|
+
* @public @preview
|
|
182
185
|
*/
|
|
183
186
|
export type EntityClassType<T> = Function & {
|
|
184
187
|
prototype: T;
|
package/lib/cjs/Entity.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAQ,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAoB,MAAM,oBAAoB,CAAC;AAC7H,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":"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IAAI,MAAM,EAAE,CAAe;IAEhE;;;;;OAKG;WACW,EAAE,CAAC,UAAU,EAAE,OAAO,MAAM,GAAG,OAAO;IAKpD;;;OAGG;IACH,WAAkB,gBAAgB,YAAoB;IAEtD;;;;;OAKG;IACI,eAAe,IAAI,kBAAkB;IAM5C;;;;;;;OAOG;IACH,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,GAAG,IAAI;CAGvE;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,QAAQ,GAAG;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,CAAC"}
|
package/lib/cjs/Entity.js
CHANGED
|
@@ -15,7 +15,7 @@ const Symbols_1 = require("./internal/Symbols");
|
|
|
15
15
|
/** Represents one of the fundamental building block in an [[IModelDb]]: as an [[Element]], [[Model]], or [[Relationship]].
|
|
16
16
|
* Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).
|
|
17
17
|
* An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].
|
|
18
|
-
* @public
|
|
18
|
+
* @public @preview
|
|
19
19
|
*/
|
|
20
20
|
class Entity {
|
|
21
21
|
/** An immutable property used to discriminate between [[Entity]] and [EntityProps]($common), used to inform the TypeScript compiler that these two types
|
|
@@ -38,6 +38,7 @@ class Entity {
|
|
|
38
38
|
// We cannot cache this here because the className gets overridden in subclasses
|
|
39
39
|
return new ecschema_metadata_1.SchemaItemKey(this.className, this.schema.schemaKey);
|
|
40
40
|
}
|
|
41
|
+
/** Cached Metadata for the ECClass */
|
|
41
42
|
_metadata;
|
|
42
43
|
/** When working with an Entity it can be useful to set property values directly, bypassing the compiler's type checking.
|
|
43
44
|
* This property makes such code slightly less tedious to read and write.
|
|
@@ -138,7 +139,7 @@ class Entity {
|
|
|
138
139
|
* @param func The callback to be invoked on each property
|
|
139
140
|
* @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
|
|
140
141
|
* @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
|
|
141
|
-
* @deprecated in 5.0. Please use `forEach` to get the metadata and iterate over the properties instead.
|
|
142
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `forEach` to get the metadata and iterate over the properties instead.
|
|
142
143
|
*
|
|
143
144
|
* @example
|
|
144
145
|
* ```typescript
|
|
@@ -173,12 +174,15 @@ class Entity {
|
|
|
173
174
|
* ```
|
|
174
175
|
*/
|
|
175
176
|
forEach(func, includeCustom = true) {
|
|
176
|
-
const
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
177
|
+
const item = this._metadata ?? this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey);
|
|
178
|
+
if (ecschema_metadata_1.EntityClass.isEntityClass(item) || ecschema_metadata_1.RelationshipClass.isRelationshipClass(item)) {
|
|
179
|
+
for (const property of item.getPropertiesSync()) {
|
|
180
|
+
if (includeCustom || !property.customAttributes?.has(`BisCore.CustomHandledProperty`))
|
|
181
|
+
func(property.name, property);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
throw new Error(`Cannot get metadata for ${this.classFullName}. Class is not an EntityClass or RelationshipClass.`);
|
|
182
186
|
}
|
|
183
187
|
}
|
|
184
188
|
/** Get the full BIS class name of this Entity in the form "schema:class" */
|
|
@@ -190,19 +194,37 @@ class Entity {
|
|
|
190
194
|
* @public @preview
|
|
191
195
|
*/
|
|
192
196
|
get schemaItemKey() { return this._ctor.schemaItemKey; }
|
|
193
|
-
/**
|
|
197
|
+
/** Query metadata for this entity class from the iModel's schema. Returns cached metadata if available.
|
|
194
198
|
* @throws [[IModelError]] if there is a problem querying the schema
|
|
195
199
|
* @returns The metadata for the current entity
|
|
196
200
|
* @public @preview
|
|
197
201
|
*/
|
|
198
202
|
async getMetaData() {
|
|
199
|
-
if (
|
|
200
|
-
this._metadata
|
|
203
|
+
if (this._metadata) {
|
|
204
|
+
return this._metadata;
|
|
205
|
+
}
|
|
206
|
+
const ecClass = await this.iModel.schemaContext.getSchemaItem(this.schemaItemKey, ecschema_metadata_1.ECClass);
|
|
207
|
+
if (ecschema_metadata_1.EntityClass.isEntityClass(ecClass) || ecschema_metadata_1.RelationshipClass.isRelationshipClass(ecClass)) {
|
|
208
|
+
this._metadata = ecClass;
|
|
209
|
+
return this._metadata;
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
throw new Error(`Cannot get metadata for ${this.classFullName}`);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/** @internal */
|
|
216
|
+
getMetaDataSync() {
|
|
217
|
+
if (this._metadata) {
|
|
218
|
+
return this._metadata;
|
|
219
|
+
}
|
|
220
|
+
const ecClass = this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey, ecschema_metadata_1.ECClass);
|
|
221
|
+
if (ecschema_metadata_1.EntityClass.isEntityClass(ecClass) || ecschema_metadata_1.RelationshipClass.isRelationshipClass(ecClass)) {
|
|
222
|
+
this._metadata = ecClass;
|
|
223
|
+
return this._metadata;
|
|
201
224
|
}
|
|
202
|
-
|
|
225
|
+
else {
|
|
203
226
|
throw new Error(`Cannot get metadata for ${this.classFullName}`);
|
|
204
227
|
}
|
|
205
|
-
return this._metadata;
|
|
206
228
|
}
|
|
207
229
|
/** @internal */
|
|
208
230
|
static get protectedOperations() { return []; }
|