@itwin/core-backend 5.9.0-dev.9 → 5.10.0-dev.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 +18 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +6 -3
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CatalogDb.js.map +1 -1
- 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 +9 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +255 -249
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChangesetReader.d.ts +186 -0
- package/lib/cjs/ChangesetReader.d.ts.map +1 -0
- package/lib/cjs/ChangesetReader.js +372 -0
- package/lib/cjs/ChangesetReader.js.map +1 -0
- package/lib/cjs/ChangesetReaderTypes.d.ts +120 -0
- package/lib/cjs/ChangesetReaderTypes.d.ts.map +1 -0
- package/lib/cjs/ChangesetReaderTypes.js +23 -0
- package/lib/cjs/ChangesetReaderTypes.js.map +1 -0
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.js +5 -5
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +1 -1
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js +68 -13
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js.map +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.js.map +1 -1
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlRowExecutor.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/ECSqlSyncReader.js.map +1 -1
- package/lib/cjs/EditTxn.d.ts +55 -1
- package/lib/cjs/EditTxn.d.ts.map +1 -1
- package/lib/cjs/EditTxn.js +43 -1
- package/lib/cjs/EditTxn.js.map +1 -1
- package/lib/cjs/Element.d.ts +69 -0
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +36 -0
- package/lib/cjs/Element.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- 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 +15 -0
- package/lib/cjs/GeographicCRSServices.d.ts.map +1 -1
- package/lib/cjs/GeographicCRSServices.js +13 -4
- 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 +9 -1
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +32 -13
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelDbFonts.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/ImageSourceConversion.js.map +1 -1
- package/lib/cjs/IpcHost.d.ts.map +1 -1
- package/lib/cjs/IpcHost.js +20 -9
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.js +1 -1
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/LockControl.js.map +1 -1
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +34 -0
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +24 -0
- 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/PartialChangeUnifier.d.ts +77 -0
- package/lib/cjs/PartialChangeUnifier.d.ts.map +1 -0
- package/lib/cjs/PartialChangeUnifier.js +234 -0
- package/lib/cjs/PartialChangeUnifier.js.map +1 -0
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js +1 -1
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/StashManager.js.map +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +14 -0
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +25 -0
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +19 -7
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +77 -25
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.d.ts.map +1 -1
- package/lib/cjs/ViewStore.js +63 -21
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
- package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
- package/lib/cjs/core-backend.d.ts +3 -0
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +3 -0
- 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.js.map +1 -1
- package/lib/cjs/internal/FontFileImpl.js.map +1 -1
- package/lib/cjs/internal/HubMock.js.map +1 -1
- package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/cjs/internal/IntegrityCheck.d.ts +10 -10
- package/lib/cjs/internal/IntegrityCheck.js +22 -22
- package/lib/cjs/internal/IntegrityCheck.js.map +1 -1
- package/lib/cjs/internal/NativePlatform.js.map +1 -1
- package/lib/cjs/internal/NoLocks.js.map +1 -1
- package/lib/cjs/internal/OnlineStatus.js.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.js +33 -33
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/annotations/fields.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsEditorImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.js.map +1 -1
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.d.ts +6 -4
- package/lib/cjs/workspace/Settings.d.ts.map +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsDb.js.map +1 -1
- package/lib/cjs/workspace/SettingsEditor.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BackendLoggerCategory.js.map +1 -1
- package/lib/esm/BisCoreSchema.js.map +1 -1
- package/lib/esm/BlobContainerService.js.map +1 -1
- package/lib/esm/BriefcaseManager.d.ts.map +1 -1
- package/lib/esm/BriefcaseManager.js +6 -3
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/CatalogDb.js.map +1 -1
- 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 +9 -1
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +255 -249
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ChangesetReader.d.ts +186 -0
- package/lib/esm/ChangesetReader.d.ts.map +1 -0
- package/lib/esm/ChangesetReader.js +368 -0
- package/lib/esm/ChangesetReader.js.map +1 -0
- package/lib/esm/ChangesetReaderTypes.d.ts +120 -0
- package/lib/esm/ChangesetReaderTypes.d.ts.map +1 -0
- package/lib/esm/ChangesetReaderTypes.js +20 -0
- package/lib/esm/ChangesetReaderTypes.js.map +1 -0
- package/lib/esm/ChannelControl.js.map +1 -1
- package/lib/esm/CheckpointManager.js.map +1 -1
- package/lib/esm/ClassRegistry.js +5 -5
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/CloudSqlite.d.ts +1 -1
- package/lib/esm/CloudSqlite.d.ts.map +1 -1
- package/lib/esm/CloudSqlite.js +69 -14
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeService.js.map +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.js.map +1 -1
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSchemaXmlContext.js.map +1 -1
- package/lib/esm/ECSqlRowExecutor.js.map +1 -1
- package/lib/esm/ECSqlStatement.d.ts.map +1 -1
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/ECSqlSyncReader.js.map +1 -1
- package/lib/esm/EditTxn.d.ts +55 -1
- package/lib/esm/EditTxn.d.ts.map +1 -1
- package/lib/esm/EditTxn.js +43 -1
- package/lib/esm/EditTxn.js.map +1 -1
- package/lib/esm/Element.d.ts +69 -0
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +36 -0
- package/lib/esm/Element.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/EntityReferences.js.map +1 -1
- 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 +15 -0
- package/lib/esm/GeographicCRSServices.d.ts.map +1 -1
- package/lib/esm/GeographicCRSServices.js +12 -4
- 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 +9 -1
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +33 -14
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelDbFonts.js.map +1 -1
- package/lib/esm/IModelElementCloneContext.js.map +1 -1
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/IModelJsFs.js.map +1 -1
- package/lib/esm/ImageSourceConversion.js.map +1 -1
- package/lib/esm/IpcHost.d.ts.map +1 -1
- package/lib/esm/IpcHost.js +20 -9
- package/lib/esm/IpcHost.js.map +1 -1
- package/lib/esm/LineStyle.js.map +1 -1
- package/lib/esm/LocalHub.js +1 -1
- package/lib/esm/LocalHub.js.map +1 -1
- package/lib/esm/LocalhostIpcHost.js.map +1 -1
- package/lib/esm/LockControl.js.map +1 -1
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.d.ts +34 -0
- package/lib/esm/Model.d.ts.map +1 -1
- package/lib/esm/Model.js +24 -0
- 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/PartialChangeUnifier.d.ts +77 -0
- package/lib/esm/PartialChangeUnifier.d.ts.map +1 -0
- package/lib/esm/PartialChangeUnifier.js +230 -0
- package/lib/esm/PartialChangeUnifier.js.map +1 -0
- package/lib/esm/PromiseMemoizer.js.map +1 -1
- package/lib/esm/PropertyStore.js.map +1 -1
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/RpcBackend.js.map +1 -1
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/Schema.js.map +1 -1
- package/lib/esm/SchemaSync.js.map +1 -1
- package/lib/esm/SchemaUtils.js.map +1 -1
- package/lib/esm/SheetIndex.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/esm/SqliteChangesetReader.js +1 -1
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/SqliteStatement.js.map +1 -1
- package/lib/esm/StashManager.js.map +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TileStorage.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +14 -0
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +25 -0
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +19 -7
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +78 -26
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/ViewStateHydrator.js.map +1 -1
- package/lib/esm/ViewStore.d.ts.map +1 -1
- package/lib/esm/ViewStore.js +64 -22
- package/lib/esm/ViewStore.js.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/esm/annotations/FrameGeometry.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
- package/lib/esm/core-backend.d.ts +3 -0
- package/lib/esm/core-backend.d.ts.map +1 -1
- package/lib/esm/core-backend.js +3 -0
- 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.js.map +1 -1
- package/lib/esm/internal/FontFileImpl.js.map +1 -1
- package/lib/esm/internal/HubMock.js.map +1 -1
- package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/esm/internal/IntegrityCheck.d.ts +10 -10
- package/lib/esm/internal/IntegrityCheck.js +22 -22
- package/lib/esm/internal/IntegrityCheck.js.map +1 -1
- package/lib/esm/internal/NativePlatform.js.map +1 -1
- package/lib/esm/internal/NoLocks.js.map +1 -1
- package/lib/esm/internal/OnlineStatus.js.map +1 -1
- package/lib/esm/internal/ServerBasedLocks.js +33 -33
- package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/internal/annotations/fields.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsEditorImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/esm/rpc/multipart.js.map +1 -1
- package/lib/esm/rpc/tracing.js.map +1 -1
- package/lib/esm/rpc/web/logging.js.map +1 -1
- package/lib/esm/rpc/web/request.js.map +1 -1
- package/lib/esm/rpc/web/response.js.map +1 -1
- package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/esm/test/AdvancedEqual.js.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
- package/lib/esm/test/AttachDb.test.js +11 -11
- package/lib/esm/test/AttachDb.test.js.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.js +23 -23
- package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
- package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
- package/lib/esm/test/GeometryTestUtil.js.map +1 -1
- package/lib/esm/test/IModelHost.test.js.map +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts +1 -0
- package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
- package/lib/esm/test/IModelTestUtils.js +5 -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 +112 -0
- 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/SquashSchemaAndDataChanges.test.js +129 -129
- package/lib/esm/test/SquashSchemaAndDataChanges.test.js.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
- package/lib/esm/test/TestEditTxn.js.map +1 -1
- package/lib/esm/test/TestUtils.js.map +1 -1
- package/lib/esm/test/annotations/Fields.test.js +53 -53
- package/lib/esm/test/annotations/Fields.test.js.map +1 -1
- package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js +0 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
- package/lib/esm/test/categories/Category.test.js.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.js +19 -19
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDb.test.js +72 -72
- package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
- package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlAst.test.js +65 -65
- package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js +4 -4
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +332 -332
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlSyncReader.test.js.map +1 -1
- package/lib/esm/test/ecdb/QueryReaders.test.js +31 -31
- package/lib/esm/test/ecdb/QueryReaders.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 +819 -26
- 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 +283 -142
- 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/ProjectInformationRecord.test.js.map +1 -1
- package/lib/esm/test/element/SheetInformationAspect.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.js +32 -32
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js +57 -57
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
- package/lib/esm/test/hubaccess/SemanticRebase.test.js +145 -145
- package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
- package/lib/esm/test/imageData.js.map +1 -1
- package/lib/esm/test/imodel/Code.test.js.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 +45 -45
- 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 +77 -13
- package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/TestContext.js.map +1 -1
- 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 +43 -1
- package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
- package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
- package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
- package/lib/esm/test/rpc/response.test.js.map +1 -1
- package/lib/esm/test/schema/ClassRegistry.test.js +99 -99
- 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 +9 -9
- package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
- package/lib/esm/test/schema/SchemaImportCallbacks.test.js +19 -19
- package/lib/esm/test/schema/SchemaImportCallbacks.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 +4201 -1671
- 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/DeleteElements.test.d.ts +2 -0
- package/lib/esm/test/standalone/DeleteElements.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/DeleteElements.test.js +625 -0
- package/lib/esm/test/standalone/DeleteElements.test.js.map +1 -0
- 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/EditTxn.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 +14 -14
- 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.map +1 -1
- package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
- 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/ITwinWorkspace.test.js.map +1 -1
- package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
- package/lib/esm/test/standalone/IntegrityCheck.test.js +214 -5
- package/lib/esm/test/standalone/IntegrityCheck.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.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/SQliteChangesetReaderAndChangesetECAdaptor.test.d.ts +2 -0
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js +1862 -0
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js.map +1 -0
- 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.map +1 -1
- package/lib/esm/test/standalone/StandaloneDb.test.js +20 -20
- package/lib/esm/test/standalone/StandaloneDb.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 +90 -0
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewDefinition.test.js +18 -7
- 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/test/standalone/iModelDb.test.js.map +1 -1
- package/lib/esm/test/workspace/SettingsDb.test.js.map +1 -1
- package/lib/esm/workspace/Settings.d.ts +6 -4
- package/lib/esm/workspace/Settings.d.ts.map +1 -1
- package/lib/esm/workspace/Settings.js.map +1 -1
- package/lib/esm/workspace/SettingsDb.js.map +1 -1
- package/lib/esm/workspace/SettingsEditor.js.map +1 -1
- package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +15 -15
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module ECDb
|
|
7
|
+
*/
|
|
8
|
+
import { DbChangeStage, DbOpcode, IModelStatus } from "@itwin/core-bentley";
|
|
9
|
+
import { IModelError } from "@itwin/core-common";
|
|
10
|
+
import { IModelNative } from "./internal/NativePlatform";
|
|
11
|
+
import { _nativeDb } from "./internal/Symbols";
|
|
12
|
+
import { PropertyFilter } from "./ChangesetReaderTypes";
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// ChangesetReader
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
/**
|
|
17
|
+
* Reads EC-typed changeset data natively from a changeset file, changeset group,
|
|
18
|
+
* in-memory transaction, or local un-pushed changes.
|
|
19
|
+
*
|
|
20
|
+
* Implements [ChangeSource]($backend) so rows can be fed directly into
|
|
21
|
+
* [PartialChangeUnifier]($backend) to merge partial (per-table) instances into
|
|
22
|
+
* complete EC instances.
|
|
23
|
+
*
|
|
24
|
+
* When the current row is a non-EC internal SQLite table, [[isECTable]] is `false`
|
|
25
|
+
* and both [[inserted]] and [[deleted]] remain `undefined`.
|
|
26
|
+
*
|
|
27
|
+
* @note The native reader operates one SQLite table-row at a time. Multi-table EC
|
|
28
|
+
* instances must be merged using [PartialChangeUnifier]($backend).
|
|
29
|
+
* @beta
|
|
30
|
+
*/
|
|
31
|
+
export class ChangesetReader {
|
|
32
|
+
_nativeReader = new IModelNative.platform.ChangesetReader();
|
|
33
|
+
// Internal options — keep ECClassId as raw Id so the unifier can use it as-is.
|
|
34
|
+
_rowOptions;
|
|
35
|
+
_propFilter = PropertyFilter.All;
|
|
36
|
+
_changeIndex = 0;
|
|
37
|
+
_op;
|
|
38
|
+
_isECTable;
|
|
39
|
+
_tableName;
|
|
40
|
+
_isIndirectChange;
|
|
41
|
+
/** The db used for EC schema resolution. */
|
|
42
|
+
db;
|
|
43
|
+
/**
|
|
44
|
+
* `true` when the current row belongs to an EC-mapped table.
|
|
45
|
+
* Valid only after a successful call to [[step]].
|
|
46
|
+
* @beta
|
|
47
|
+
*/
|
|
48
|
+
get isECTable() {
|
|
49
|
+
if (this._isECTable === undefined)
|
|
50
|
+
throw new IModelError(IModelStatus.BadRequest, "ChangesetReader.isECTable is only valid after step() has positioned the reader on a current valid change.");
|
|
51
|
+
return this._isECTable;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Name of the SQLite table for the current change row.
|
|
55
|
+
* Valid only after a successful call to [[step]].
|
|
56
|
+
* @beta
|
|
57
|
+
*/
|
|
58
|
+
get tableName() {
|
|
59
|
+
if (this._tableName === undefined)
|
|
60
|
+
throw new IModelError(IModelStatus.BadRequest, "ChangesetReader.tableName is only valid after step() has positioned the reader on a current valid change.");
|
|
61
|
+
return this._tableName;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* `true` when the current change was applied indirectly
|
|
65
|
+
* Valid only after a successful call to [[step]].
|
|
66
|
+
* @beta
|
|
67
|
+
*/
|
|
68
|
+
get isIndirectChange() {
|
|
69
|
+
if (this._isIndirectChange === undefined)
|
|
70
|
+
throw new IModelError(IModelStatus.BadRequest, "ChangesetReader.isIndirectChange is only valid after step() has positioned the reader on a current valid change.");
|
|
71
|
+
return this._isIndirectChange;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Post-change (inserted or updated-new) EC instance, populated after each [[step]] call.
|
|
75
|
+
* `undefined` when the current row is a Delete or a non-EC table row or [[step]] returned false.
|
|
76
|
+
* @beta
|
|
77
|
+
*/
|
|
78
|
+
inserted;
|
|
79
|
+
/**
|
|
80
|
+
* Pre-change (deleted or updated-old) EC instance, populated after each [[step]] call.
|
|
81
|
+
* `undefined` when the current row is an Insert or a non-EC table row or [[step]] returned false.
|
|
82
|
+
* @beta
|
|
83
|
+
*/
|
|
84
|
+
deleted;
|
|
85
|
+
// Private — callers use static factory methods.
|
|
86
|
+
constructor(db) {
|
|
87
|
+
this.db = db;
|
|
88
|
+
}
|
|
89
|
+
/** Map public RowFormatOptions to the native adaptor options.
|
|
90
|
+
* @internal */
|
|
91
|
+
toNativeRowOptions(opts) {
|
|
92
|
+
return {
|
|
93
|
+
abbreviateBlobs: opts.abbreviateBlobs,
|
|
94
|
+
classIdsToClassNames: opts.classIdsToClassNames,
|
|
95
|
+
useJsName: opts.useJsName,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
// ---------------------------------------------------------------------------
|
|
99
|
+
// Static factory methods
|
|
100
|
+
// ---------------------------------------------------------------------------
|
|
101
|
+
/**
|
|
102
|
+
* Open a changeset file from disk.
|
|
103
|
+
* @param args.fileName Absolute path to the changeset file.
|
|
104
|
+
* @param args.db Database at or after the changeset's ending state, used for schema resolution.
|
|
105
|
+
* @param args.invert When `true`, invert all operations (Insert↔Delete).
|
|
106
|
+
* @param args.valueOptions Row adaptor options controlling how EC property values are formatted.
|
|
107
|
+
* @param args.propFilter Controls which properties are included. Defaults to `All`.
|
|
108
|
+
* @beta
|
|
109
|
+
*/
|
|
110
|
+
static openFile(args) {
|
|
111
|
+
const reader = new ChangesetReader(args.db);
|
|
112
|
+
reader._rowOptions = args.rowOptions;
|
|
113
|
+
const propFilter = args.propFilter ?? PropertyFilter.All;
|
|
114
|
+
reader._propFilter = propFilter;
|
|
115
|
+
try {
|
|
116
|
+
reader._nativeReader.openFile(args.db[_nativeDb], args.fileName, args.invert ?? false, reader._propFilter);
|
|
117
|
+
}
|
|
118
|
+
catch (e) {
|
|
119
|
+
reader.close();
|
|
120
|
+
throw e;
|
|
121
|
+
}
|
|
122
|
+
return reader;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Concatenate multiple changeset files and read them as a single logical stream.
|
|
126
|
+
* @param args.changesetFiles Ordered list of changeset file paths.
|
|
127
|
+
* @param args.db Database with schema at or ahead of the last changeset.
|
|
128
|
+
* @param args.valueOptions Row adaptor options controlling how EC property values are formatted.
|
|
129
|
+
* @param args.propFilter Controls which properties are included. Defaults to `All`.
|
|
130
|
+
* @beta
|
|
131
|
+
*/
|
|
132
|
+
static openGroup(args) {
|
|
133
|
+
if (args.changesetFiles.length === 0)
|
|
134
|
+
throw new Error("changesetFiles must contain at least one file.");
|
|
135
|
+
const reader = new ChangesetReader(args.db);
|
|
136
|
+
reader._rowOptions = args.rowOptions;
|
|
137
|
+
const propFilter = args.propFilter ?? PropertyFilter.All;
|
|
138
|
+
reader._propFilter = propFilter;
|
|
139
|
+
try {
|
|
140
|
+
reader._nativeReader.openGroup(args.db[_nativeDb], args.changesetFiles, args.invert ?? false, reader._propFilter);
|
|
141
|
+
}
|
|
142
|
+
catch (e) {
|
|
143
|
+
reader.close();
|
|
144
|
+
throw e;
|
|
145
|
+
}
|
|
146
|
+
return reader;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Read pending (not yet pushed) local changes from an open IModelDb.
|
|
150
|
+
* @param args.db Must be an [IModelDb]($backend) (not [ECDb]($backend)).
|
|
151
|
+
* @param args.includeInMemoryChanges Also include in-memory (not yet saved to disk) changes.
|
|
152
|
+
* @param args.valueOptions Row adaptor options controlling how EC property values are formatted.
|
|
153
|
+
* @param args.propFilter Controls which properties are included. Defaults to `All`.
|
|
154
|
+
* @beta
|
|
155
|
+
*/
|
|
156
|
+
static openLocalChanges(args) {
|
|
157
|
+
const reader = new ChangesetReader(args.db);
|
|
158
|
+
reader._rowOptions = args.rowOptions;
|
|
159
|
+
const propFilter = args.propFilter ?? PropertyFilter.All;
|
|
160
|
+
reader._propFilter = propFilter;
|
|
161
|
+
try {
|
|
162
|
+
reader._nativeReader.openLocalChanges(args.db[_nativeDb], args.includeInMemoryChanges ?? false, args.invert ?? false, reader._propFilter);
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
reader.close();
|
|
166
|
+
throw e;
|
|
167
|
+
}
|
|
168
|
+
return reader;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Read the in-memory (not yet saved to disk) changes of an open IModelDb.
|
|
172
|
+
* @param args.db Must be an [IModelDb]($backend).
|
|
173
|
+
* @param args.valueOptions Row adaptor options controlling how EC property values are formatted.
|
|
174
|
+
* @param args.propFilter Controls which properties are included. Defaults to `All`.
|
|
175
|
+
* @beta
|
|
176
|
+
*/
|
|
177
|
+
static openInMemoryChanges(args) {
|
|
178
|
+
const reader = new ChangesetReader(args.db);
|
|
179
|
+
reader._rowOptions = args.rowOptions;
|
|
180
|
+
const propFilter = args.propFilter ?? PropertyFilter.All;
|
|
181
|
+
reader._propFilter = propFilter;
|
|
182
|
+
try {
|
|
183
|
+
reader._nativeReader.openInMemoryChanges(args.db[_nativeDb], args.invert ?? false, reader._propFilter);
|
|
184
|
+
}
|
|
185
|
+
catch (e) {
|
|
186
|
+
reader.close();
|
|
187
|
+
throw e;
|
|
188
|
+
}
|
|
189
|
+
return reader;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Read a single saved transaction by its id.
|
|
193
|
+
* @param args.db Must be an [IModelDb]($backend) ([ECDb]($backend) does not support transactions).
|
|
194
|
+
* @param args.txnId The id of the saved transaction to read.
|
|
195
|
+
* @param args.valueOptions Row adaptor options controlling how EC property values are formatted.
|
|
196
|
+
* @param args.propFilter Controls which properties are included. Defaults to `All`.
|
|
197
|
+
* @beta
|
|
198
|
+
*/
|
|
199
|
+
static openTxn(args) {
|
|
200
|
+
const reader = new ChangesetReader(args.db);
|
|
201
|
+
reader._rowOptions = args.rowOptions ?? {};
|
|
202
|
+
const propFilter = args.propFilter ?? PropertyFilter.All;
|
|
203
|
+
reader._propFilter = propFilter;
|
|
204
|
+
try {
|
|
205
|
+
reader._nativeReader.openTxn(args.db[_nativeDb], args.txnId, args.invert ?? false, reader._propFilter);
|
|
206
|
+
}
|
|
207
|
+
catch (e) {
|
|
208
|
+
reader.close();
|
|
209
|
+
throw e;
|
|
210
|
+
}
|
|
211
|
+
return reader;
|
|
212
|
+
}
|
|
213
|
+
// ---------------------------------------------------------------------------
|
|
214
|
+
// Filtering
|
|
215
|
+
// ---------------------------------------------------------------------------
|
|
216
|
+
/**
|
|
217
|
+
* Restrict iteration to changes from the named SQLite tables.
|
|
218
|
+
* That means the rows for changes from other tables will be skipped entirely and won't be visible through the reader.
|
|
219
|
+
* @param tableNames SQLite table names to include.
|
|
220
|
+
* Note: Table names must be provided in the correct case for proper filtering.
|
|
221
|
+
* @beta
|
|
222
|
+
*/
|
|
223
|
+
setTableNameFilters(tableNames) {
|
|
224
|
+
this._nativeReader.setTableNameFilters(Array.from(tableNames));
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Restrict iteration to changes with the given operation types.
|
|
228
|
+
* That means the rows for changes with other operation types will be skipped entirely and won't be visible through the reader.
|
|
229
|
+
* @param ops Operations to include.
|
|
230
|
+
* @beta
|
|
231
|
+
*/
|
|
232
|
+
setOpCodeFilters(ops) {
|
|
233
|
+
this._nativeReader.setOpCodeFilters(Array.from(ops));
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Restrict iteration to changes for the given EC class names.
|
|
237
|
+
* That means the rows for changes from other EC classes will be skipped entirely and won't be visible through the reader.
|
|
238
|
+
* @param classNames EC class names to include. The classNames should be in the full name format(i.e. "SchemaName:ClassName").
|
|
239
|
+
* Note: Schema names and class names must be provided in the correct case for proper filtering. Derived classes are not automatically included, so they must be specified explicitly if needed.
|
|
240
|
+
* @beta
|
|
241
|
+
*/
|
|
242
|
+
setClassNameFilters(classNames) {
|
|
243
|
+
this._nativeReader.setClassNameFilters(Array.from(classNames));
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Remove the table-name filters
|
|
247
|
+
* @beta
|
|
248
|
+
*/
|
|
249
|
+
clearTableNameFilters() {
|
|
250
|
+
this._nativeReader.clearTableNameFilters();
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Remove the op-code filters
|
|
254
|
+
* @beta
|
|
255
|
+
*/
|
|
256
|
+
clearOpCodeFilters() {
|
|
257
|
+
this._nativeReader.clearOpCodeFilters();
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Remove the class-name filters
|
|
261
|
+
* @beta
|
|
262
|
+
*/
|
|
263
|
+
clearClassNameFilters() {
|
|
264
|
+
this._nativeReader.clearClassNameFilters();
|
|
265
|
+
}
|
|
266
|
+
// ---------------------------------------------------------------------------
|
|
267
|
+
// Iteration
|
|
268
|
+
// ---------------------------------------------------------------------------
|
|
269
|
+
/**
|
|
270
|
+
* Advance to the next change and populate `inserted` and/or `deleted`.
|
|
271
|
+
* @returns `true` while positioned on a valid change; `false` when the stream is exhausted.
|
|
272
|
+
* @beta
|
|
273
|
+
*/
|
|
274
|
+
step() {
|
|
275
|
+
this.inserted = undefined;
|
|
276
|
+
this.deleted = undefined;
|
|
277
|
+
this._op = undefined;
|
|
278
|
+
this._isECTable = undefined;
|
|
279
|
+
this._tableName = undefined;
|
|
280
|
+
this._isIndirectChange = undefined;
|
|
281
|
+
if (this._nativeReader.step()) {
|
|
282
|
+
this._changeIndex++;
|
|
283
|
+
const meta = this._nativeReader.getChangeMetadata();
|
|
284
|
+
const nativeOp = meta.opCode;
|
|
285
|
+
const op = nativeOp === DbOpcode.Insert ? "Inserted" : nativeOp === DbOpcode.Update ? "Updated" : "Deleted";
|
|
286
|
+
this._op = op;
|
|
287
|
+
this._tableName = meta.tableName;
|
|
288
|
+
this._isIndirectChange = meta.isIndirectChange;
|
|
289
|
+
this._isECTable = meta.isECTable;
|
|
290
|
+
const nativeRowOpts = this._rowOptions ? this.toNativeRowOptions(this._rowOptions) : {};
|
|
291
|
+
if (op === "Inserted" || op === "Updated") {
|
|
292
|
+
const rowValue = this._nativeReader.getValue(DbChangeStage.New, nativeRowOpts);
|
|
293
|
+
if (rowValue !== undefined) {
|
|
294
|
+
this.inserted = {
|
|
295
|
+
...rowValue.data,
|
|
296
|
+
$meta: {
|
|
297
|
+
op,
|
|
298
|
+
tables: [this._tableName],
|
|
299
|
+
changeIndexes: [this._changeIndex],
|
|
300
|
+
stage: "New",
|
|
301
|
+
instanceKey: rowValue.key,
|
|
302
|
+
propFilter: this._propFilter,
|
|
303
|
+
changeFetchedPropNames: rowValue.changeFetchedPropNames,
|
|
304
|
+
rowOptions: this._rowOptions,
|
|
305
|
+
isIndirectChange: this._isIndirectChange,
|
|
306
|
+
},
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (op === "Deleted" || op === "Updated") {
|
|
311
|
+
const rowValue = this._nativeReader.getValue(DbChangeStage.Old, nativeRowOpts);
|
|
312
|
+
if (rowValue !== undefined) {
|
|
313
|
+
this.deleted = {
|
|
314
|
+
...rowValue.data,
|
|
315
|
+
$meta: {
|
|
316
|
+
op,
|
|
317
|
+
tables: [this._tableName],
|
|
318
|
+
changeIndexes: [this._changeIndex],
|
|
319
|
+
stage: "Old",
|
|
320
|
+
instanceKey: rowValue.key,
|
|
321
|
+
propFilter: this._propFilter,
|
|
322
|
+
changeFetchedPropNames: rowValue.changeFetchedPropNames,
|
|
323
|
+
rowOptions: this._rowOptions,
|
|
324
|
+
isIndirectChange: this._isIndirectChange,
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return true;
|
|
330
|
+
}
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* SQLite opcode of the current change.
|
|
335
|
+
* Valid only after a successful call to [[step]].
|
|
336
|
+
* @beta
|
|
337
|
+
*/
|
|
338
|
+
get op() {
|
|
339
|
+
if (this._op === undefined)
|
|
340
|
+
throw new IModelError(IModelStatus.BadRequest, "ChangesetReader.op is only valid after step() has positioned the reader on a current valid change.");
|
|
341
|
+
return this._op;
|
|
342
|
+
}
|
|
343
|
+
// ---------------------------------------------------------------------------
|
|
344
|
+
// Lifecycle
|
|
345
|
+
// ---------------------------------------------------------------------------
|
|
346
|
+
/**
|
|
347
|
+
* Close the reader and release all native resources.
|
|
348
|
+
* @beta
|
|
349
|
+
*/
|
|
350
|
+
close() {
|
|
351
|
+
this._changeIndex = 0;
|
|
352
|
+
this._op = undefined;
|
|
353
|
+
this._isECTable = undefined;
|
|
354
|
+
this._tableName = undefined;
|
|
355
|
+
this._isIndirectChange = undefined;
|
|
356
|
+
this.inserted = undefined;
|
|
357
|
+
this.deleted = undefined;
|
|
358
|
+
this._nativeReader.close();
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Implements the `Disposable` contract — calls [[close]].
|
|
362
|
+
* @beta
|
|
363
|
+
*/
|
|
364
|
+
[Symbol.dispose]() {
|
|
365
|
+
this.close();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
//# sourceMappingURL=ChangesetReader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangesetReader.js","sourceRoot":"","sources":["../../src/ChangesetReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAqD,cAAc,EAAoB,MAAM,wBAAwB,CAAC;AAI7H,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,eAAe;IACT,aAAa,GAAmC,IAAI,YAAY,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC;IAC7G,+EAA+E;IACvE,WAAW,CAAoB;IAC/B,WAAW,GAAmB,cAAc,CAAC,GAAG,CAAC;IACjD,YAAY,GAAG,CAAC,CAAC;IACjB,GAAG,CAAkB;IACrB,UAAU,CAAW;IACrB,UAAU,CAAU;IACpB,iBAAiB,CAAW;IAEpC,4CAA4C;IAC5B,EAAE,CAAQ;IAE1B;;;;OAIG;IACH,IAAW,SAAS;QAClB,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS;YAC/B,MAAM,IAAI,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,2GAA2G,CAAC,CAAC;QAC9J,OAAO,IAAI,CAAC,UAAU,CAAC;I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AW,EAAE;QACX,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS;YACxB,MAAM,IAAI,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,oGAAoG,CAAC,CAAC;QACvJ,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED,8EAA8E;IAC9E,YAAY;IACZ,8EAA8E;IAE9E;;;OAGG;IACI,KAAK;QACV,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,GAAG,GAAG,SAAS,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF","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 ECDb\r\n */\r\nimport { DbChangeStage, DbOpcode, Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { IModelError } from \"@itwin/core-common\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\r\nimport { ChangeInstance, ChangesetReaderArgs, ChangeSource, PropertyFilter, RowFormatOptions } from \"./ChangesetReaderTypes\";\r\nimport { AnyDb, SqliteChangeOp } from \"./SqliteChangesetReader\";\r\n\r\n\r\n// ---------------------------------------------------------------------------\r\n// ChangesetReader\r\n// ---------------------------------------------------------------------------\r\n\r\n/**\r\n * Reads EC-typed changeset data natively from a changeset file, changeset group,\r\n * in-memory transaction, or local un-pushed changes.\r\n *\r\n * Implements [ChangeSource]($backend) so rows can be fed directly into\r\n * [PartialChangeUnifier]($backend) to merge partial (per-table) instances into\r\n * complete EC instances.\r\n *\r\n * When the current row is a non-EC internal SQLite table, [[isECTable]] is `false`\r\n * and both [[inserted]] and [[deleted]] remain `undefined`.\r\n *\r\n * @note The native reader operates one SQLite table-row at a time. Multi-table EC\r\n * instances must be merged using [PartialChangeUnifier]($backend).\r\n * @beta\r\n */\r\nexport class ChangesetReader implements Disposable, ChangeSource {\r\n private readonly _nativeReader: IModelJsNative.ChangesetReader = new IModelNative.platform.ChangesetReader();\r\n // Internal options — keep ECClassId as raw Id so the unifier can use it as-is.\r\n private _rowOptions?: RowFormatOptions;\r\n private _propFilter: PropertyFilter = PropertyFilter.All;\r\n private _changeIndex = 0;\r\n private _op?: SqliteChangeOp;\r\n private _isECTable?: boolean;\r\n private _tableName?: string;\r\n private _isIndirectChange?: boolean;\r\n\r\n /** The db used for EC schema resolution. */\r\n public readonly db: AnyDb;\r\n\r\n /**\r\n * `true` when the current row belongs to an EC-mapped table.\r\n * Valid only after a successful call to [[step]].\r\n * @beta\r\n */\r\n public get isECTable(): boolean {\r\n if (this._isECTable === undefined)\r\n throw new IModelError(IModelStatus.BadRequest, \"ChangesetReader.isECTable is only valid after step() has positioned the reader on a current valid change.\");\r\n return this._isECTable;\r\n }\r\n\r\n /**\r\n * Name of the SQLite table for the current change row.\r\n * Valid only after a successful call to [[step]].\r\n * @beta\r\n */\r\n public get tableName(): string {\r\n if (this._tableName === undefined)\r\n throw new IModelError(IModelStatus.BadRequest, \"ChangesetReader.tableName is only valid after step() has positioned the reader on a current valid change.\");\r\n return this._tableName;\r\n }\r\n\r\n /**\r\n * `true` when the current change was applied indirectly\r\n * Valid only after a successful call to [[step]].\r\n * @beta\r\n */\r\n public get isIndirectChange(): boolean {\r\n if (this._isIndirectChange === undefined)\r\n throw new IModelError(IModelStatus.BadRequest, \"ChangesetReader.isIndirectChange is only valid after step() has positioned the reader on a current valid change.\");\r\n return this._isIndirectChange;\r\n }\r\n\r\n /**\r\n * Post-change (inserted or updated-new) EC instance, populated after each [[step]] call.\r\n * `undefined` when the current row is a Delete or a non-EC table row or [[step]] returned false.\r\n * @beta\r\n */\r\n public inserted?: ChangeInstance;\r\n\r\n /**\r\n * Pre-change (deleted or updated-old) EC instance, populated after each [[step]] call.\r\n * `undefined` when the current row is an Insert or a non-EC table row or [[step]] returned false.\r\n * @beta\r\n */\r\n public deleted?: ChangeInstance;\r\n\r\n // Private — callers use static factory methods.\r\n private constructor(db: AnyDb) {\r\n this.db = db;\r\n }\r\n\r\n /** Map public RowFormatOptions to the native adaptor options.\r\n * @internal */\r\n private toNativeRowOptions(opts: RowFormatOptions): IModelJsNative.ECSqlRowAdaptorOptions {\r\n return {\r\n abbreviateBlobs: opts.abbreviateBlobs,\r\n classIdsToClassNames: opts.classIdsToClassNames,\r\n useJsName: opts.useJsName,\r\n };\r\n }\r\n\r\n // ---------------------------------------------------------------------------\r\n // Static factory methods\r\n // ---------------------------------------------------------------------------\r\n\r\n /**\r\n * Open a changeset file from disk.\r\n * @param args.fileName Absolute path to the changeset file.\r\n * @param args.db Database at or after the changeset's ending state, used for schema resolution.\r\n * @param args.invert When `true`, invert all operations (Insert↔Delete).\r\n * @param args.valueOptions Row adaptor options controlling how EC property values are formatted.\r\n * @param args.propFilter Controls which properties are included. Defaults to `All`.\r\n * @beta\r\n */\r\n public static openFile(args: { readonly fileName: string } & ChangesetReaderArgs): ChangesetReader {\r\n const reader = new ChangesetReader(args.db);\r\n reader._rowOptions = args.rowOptions;\r\n const propFilter = args.propFilter ?? PropertyFilter.All;\r\n reader._propFilter = propFilter;\r\n try {\r\n reader._nativeReader.openFile(args.db[_nativeDb], args.fileName, args.invert ?? false, reader._propFilter);\r\n }\r\n catch (e) {\r\n reader.close();\r\n throw e;\r\n }\r\n return reader;\r\n }\r\n\r\n /**\r\n * Concatenate multiple changeset files and read them as a single logical stream.\r\n * @param args.changesetFiles Ordered list of changeset file paths.\r\n * @param args.db Database with schema at or ahead of the last changeset.\r\n * @param args.valueOptions Row adaptor options controlling how EC property values are formatted.\r\n * @param args.propFilter Controls which properties are included. Defaults to `All`.\r\n * @beta\r\n */\r\n public static openGroup(args: { readonly changesetFiles: string[] } & ChangesetReaderArgs): ChangesetReader {\r\n if (args.changesetFiles.length === 0)\r\n throw new Error(\"changesetFiles must contain at least one file.\");\r\n const reader = new ChangesetReader(args.db);\r\n reader._rowOptions = args.rowOptions;\r\n const propFilter = args.propFilter ?? PropertyFilter.All;\r\n reader._propFilter = propFilter;\r\n try {\r\n reader._nativeReader.openGroup(args.db[_nativeDb], args.changesetFiles, args.invert ?? false, reader._propFilter);\r\n }\r\n catch (e) {\r\n reader.close();\r\n throw e;\r\n }\r\n return reader;\r\n }\r\n\r\n /**\r\n * Read pending (not yet pushed) local changes from an open IModelDb.\r\n * @param args.db Must be an [IModelDb]($backend) (not [ECDb]($backend)).\r\n * @param args.includeInMemoryChanges Also include in-memory (not yet saved to disk) changes.\r\n * @param args.valueOptions Row adaptor options controlling how EC property values are formatted.\r\n * @param args.propFilter Controls which properties are included. Defaults to `All`.\r\n * @beta\r\n */\r\n public static openLocalChanges(\r\n args: Omit<ChangesetReaderArgs, \"db\"> & { db: IModelDb; includeInMemoryChanges?: boolean },\r\n ): ChangesetReader {\r\n const reader = new ChangesetReader(args.db);\r\n reader._rowOptions = args.rowOptions;\r\n const propFilter = args.propFilter ?? PropertyFilter.All;\r\n reader._propFilter = propFilter;\r\n try {\r\n reader._nativeReader.openLocalChanges(args.db[_nativeDb], args.includeInMemoryChanges ?? false, args.invert ?? false, reader._propFilter);\r\n } catch (e) {\r\n reader.close();\r\n throw e;\r\n }\r\n return reader;\r\n }\r\n\r\n /**\r\n * Read the in-memory (not yet saved to disk) changes of an open IModelDb.\r\n * @param args.db Must be an [IModelDb]($backend).\r\n * @param args.valueOptions Row adaptor options controlling how EC property values are formatted.\r\n * @param args.propFilter Controls which properties are included. Defaults to `All`.\r\n * @beta\r\n */\r\n public static openInMemoryChanges(\r\n args: Omit<ChangesetReaderArgs, \"db\"> & { db: IModelDb },\r\n ): ChangesetReader {\r\n const reader = new ChangesetReader(args.db);\r\n reader._rowOptions = args.rowOptions;\r\n const propFilter = args.propFilter ?? PropertyFilter.All;\r\n reader._propFilter = propFilter;\r\n try {\r\n reader._nativeReader.openInMemoryChanges(args.db[_nativeDb], args.invert ?? false, reader._propFilter);\r\n } catch (e) {\r\n reader.close();\r\n throw e;\r\n }\r\n return reader;\r\n }\r\n\r\n /**\r\n * Read a single saved transaction by its id.\r\n * @param args.db Must be an [IModelDb]($backend) ([ECDb]($backend) does not support transactions).\r\n * @param args.txnId The id of the saved transaction to read.\r\n * @param args.valueOptions Row adaptor options controlling how EC property values are formatted.\r\n * @param args.propFilter Controls which properties are included. Defaults to `All`.\r\n * @beta\r\n */\r\n public static openTxn(\r\n args: Omit<ChangesetReaderArgs, \"db\"> & { db: IModelDb; txnId: Id64String },\r\n ): ChangesetReader {\r\n const reader = new ChangesetReader(args.db);\r\n reader._rowOptions = args.rowOptions ?? {};\r\n const propFilter = args.propFilter ?? PropertyFilter.All;\r\n reader._propFilter = propFilter;\r\n try {\r\n reader._nativeReader.openTxn(args.db[_nativeDb], args.txnId, args.invert ?? false, reader._propFilter);\r\n } catch (e) {\r\n reader.close();\r\n throw e;\r\n }\r\n return reader;\r\n }\r\n\r\n // ---------------------------------------------------------------------------\r\n // Filtering\r\n // ---------------------------------------------------------------------------\r\n\r\n /**\r\n * Restrict iteration to changes from the named SQLite tables.\r\n * That means the rows for changes from other tables will be skipped entirely and won't be visible through the reader.\r\n * @param tableNames SQLite table names to include.\r\n * Note: Table names must be provided in the correct case for proper filtering.\r\n * @beta\r\n */\r\n public setTableNameFilters(tableNames: Set<string>): void {\r\n this._nativeReader.setTableNameFilters(Array.from(tableNames));\r\n }\r\n\r\n /**\r\n * Restrict iteration to changes with the given operation types.\r\n * That means the rows for changes with other operation types will be skipped entirely and won't be visible through the reader.\r\n * @param ops Operations to include.\r\n * @beta\r\n */\r\n public setOpCodeFilters(ops: Set<SqliteChangeOp>): void {\r\n this._nativeReader.setOpCodeFilters(Array.from(ops));\r\n }\r\n\r\n /**\r\n * Restrict iteration to changes for the given EC class names.\r\n * That means the rows for changes from other EC classes will be skipped entirely and won't be visible through the reader.\r\n * @param classNames EC class names to include. The classNames should be in the full name format(i.e. \"SchemaName:ClassName\").\r\n * Note: Schema names and class names must be provided in the correct case for proper filtering. Derived classes are not automatically included, so they must be specified explicitly if needed.\r\n * @beta\r\n */\r\n public setClassNameFilters(classNames: Set<string>): void {\r\n this._nativeReader.setClassNameFilters(Array.from(classNames));\r\n }\r\n\r\n /**\r\n * Remove the table-name filters\r\n * @beta\r\n */\r\n public clearTableNameFilters(): void {\r\n this._nativeReader.clearTableNameFilters();\r\n }\r\n\r\n /**\r\n * Remove the op-code filters\r\n * @beta\r\n */\r\n public clearOpCodeFilters(): void {\r\n this._nativeReader.clearOpCodeFilters();\r\n }\r\n\r\n /**\r\n * Remove the class-name filters\r\n * @beta\r\n */\r\n public clearClassNameFilters(): void {\r\n this._nativeReader.clearClassNameFilters();\r\n }\r\n\r\n // ---------------------------------------------------------------------------\r\n // Iteration\r\n // ---------------------------------------------------------------------------\r\n\r\n /**\r\n * Advance to the next change and populate `inserted` and/or `deleted`.\r\n * @returns `true` while positioned on a valid change; `false` when the stream is exhausted.\r\n * @beta\r\n */\r\n public step(): boolean {\r\n this.inserted = undefined;\r\n this.deleted = undefined;\r\n this._op = undefined;\r\n this._isECTable = undefined;\r\n this._tableName = undefined;\r\n this._isIndirectChange = undefined;\r\n\r\n if (this._nativeReader.step()) {\r\n this._changeIndex++;\r\n const meta = this._nativeReader.getChangeMetadata();\r\n const nativeOp = meta.opCode;\r\n const op: SqliteChangeOp = nativeOp === DbOpcode.Insert ? \"Inserted\" : nativeOp === DbOpcode.Update ? \"Updated\" : \"Deleted\";\r\n this._op = op;\r\n\r\n this._tableName = meta.tableName;\r\n this._isIndirectChange = meta.isIndirectChange;\r\n this._isECTable = meta.isECTable;\r\n\r\n const nativeRowOpts = this._rowOptions ? this.toNativeRowOptions(this._rowOptions) : {};\r\n\r\n if (op === \"Inserted\" || op === \"Updated\") {\r\n const rowValue = this._nativeReader.getValue(DbChangeStage.New, nativeRowOpts);\r\n if (rowValue !== undefined) {\r\n this.inserted = {\r\n ...rowValue.data,\r\n $meta: {\r\n op,\r\n tables: [this._tableName],\r\n changeIndexes: [this._changeIndex],\r\n stage: \"New\",\r\n instanceKey: rowValue.key,\r\n propFilter: this._propFilter,\r\n changeFetchedPropNames: rowValue.changeFetchedPropNames,\r\n rowOptions: this._rowOptions,\r\n isIndirectChange: this._isIndirectChange,\r\n },\r\n };\r\n }\r\n }\r\n\r\n if (op === \"Deleted\" || op === \"Updated\") {\r\n const rowValue = this._nativeReader.getValue(DbChangeStage.Old, nativeRowOpts);\r\n if (rowValue !== undefined) {\r\n this.deleted = {\r\n ...rowValue.data,\r\n $meta: {\r\n op,\r\n tables: [this._tableName],\r\n changeIndexes: [this._changeIndex],\r\n stage: \"Old\",\r\n instanceKey: rowValue.key,\r\n propFilter: this._propFilter,\r\n changeFetchedPropNames: rowValue.changeFetchedPropNames,\r\n rowOptions: this._rowOptions,\r\n isIndirectChange: this._isIndirectChange,\r\n },\r\n };\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * SQLite opcode of the current change.\r\n * Valid only after a successful call to [[step]].\r\n * @beta\r\n */\r\n public get op(): SqliteChangeOp {\r\n if (this._op === undefined)\r\n throw new IModelError(IModelStatus.BadRequest, \"ChangesetReader.op is only valid after step() has positioned the reader on a current valid change.\");\r\n return this._op;\r\n }\r\n\r\n // ---------------------------------------------------------------------------\r\n // Lifecycle\r\n // ---------------------------------------------------------------------------\r\n\r\n /**\r\n * Close the reader and release all native resources.\r\n * @beta\r\n */\r\n public close(): void {\r\n this._changeIndex = 0;\r\n this._op = undefined;\r\n this._isECTable = undefined;\r\n this._tableName = undefined;\r\n this._isIndirectChange = undefined;\r\n this.inserted = undefined;\r\n this.deleted = undefined;\r\n this._nativeReader.close();\r\n }\r\n\r\n /**\r\n * Implements the `Disposable` contract — calls [[close]].\r\n * @beta\r\n */\r\n public [Symbol.dispose](): void {\r\n this.close();\r\n }\r\n}\r\n\r\n\r\n"]}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module ECDb
|
|
3
|
+
*/
|
|
4
|
+
import { AnyDb, SqliteChangeOp, SqliteValueStage } from "./SqliteChangesetReader";
|
|
5
|
+
/**
|
|
6
|
+
* Controls which properties are included in the output of [ChangesetReader]($backend).
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export declare enum PropertyFilter {
|
|
10
|
+
/** All EC properties mapped to changed tables. */
|
|
11
|
+
All = 0,
|
|
12
|
+
/** For classes whose base class is `BisCore:Element`, only `BisCore:Element` properties
|
|
13
|
+
* mapped to changed tables are returned. If no `BisCore:Element` class property changed,
|
|
14
|
+
* only `ECInstanceId` and `ECClassId` are returned. For other classes all mapped properties
|
|
15
|
+
* are returned. */
|
|
16
|
+
BisCoreElement = 1,
|
|
17
|
+
/** Only `ECInstanceId` and `ECClassId`. */
|
|
18
|
+
InstanceKey = 2
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Row-formatting options for [ChangesetReader]($backend) factory methods.
|
|
22
|
+
* Controls how EC property values are represented in the returned instances.
|
|
23
|
+
* @beta
|
|
24
|
+
*/
|
|
25
|
+
export interface RowFormatOptions {
|
|
26
|
+
/**
|
|
27
|
+
* When `false`, binary properties are returned as full `Uint8Array` values.
|
|
28
|
+
* When `true` (or omitted), binary properties are summarized as `{ bytes: N }`.
|
|
29
|
+
*/
|
|
30
|
+
abbreviateBlobs?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* When `true`, `ECClassId` and `RelECClassId` values are converted from hex strings
|
|
33
|
+
* to fully-qualified class names (e.g. `"BisCore.DrawingModel"`).
|
|
34
|
+
*/
|
|
35
|
+
classIdsToClassNames?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* When `true`, all property keys and struct sub-keys are returned in camelCase
|
|
38
|
+
* (e.g. `id`, `className`, `lastMod`). Navigation property sub-keys use
|
|
39
|
+
* `{ id, relClassName }` instead of `{ Id, RelECClassId }`.
|
|
40
|
+
*/
|
|
41
|
+
useJsName?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Metadata attached to every [[ChangeInstance]].
|
|
45
|
+
* @beta
|
|
46
|
+
*/
|
|
47
|
+
export interface ChangeMeta {
|
|
48
|
+
/** SQLite tables that contributed columns to this change row. */
|
|
49
|
+
tables: string[];
|
|
50
|
+
/** Operation that produced this change. */
|
|
51
|
+
op: SqliteChangeOp;
|
|
52
|
+
/** Whether this is the pre-change (`"Old"`) or post-change (`"New"`) snapshot. */
|
|
53
|
+
stage: SqliteValueStage;
|
|
54
|
+
/** Change-stream index positions. */
|
|
55
|
+
changeIndexes: number[];
|
|
56
|
+
/**
|
|
57
|
+
* ECInstanceId and class Id in format "<ECInstanceId>-<ECClassId>".
|
|
58
|
+
*/
|
|
59
|
+
instanceKey: string;
|
|
60
|
+
/** Reader property filter that was active when this change row was captured. */
|
|
61
|
+
propFilter: PropertyFilter;
|
|
62
|
+
/** EC property names fetched from the current row of changeset or transaction or any other change stream.
|
|
63
|
+
For compound data properties like point2d, point3d or navigation properties,
|
|
64
|
+
the full name of the property is returned in case all the components of the property are fetched from the change.
|
|
65
|
+
If all of the components are not fetched from the changes(meaning they did not change),
|
|
66
|
+
then the individual component names which changed are returned smartly by using `.` as a separator (e.g. "MyPoint.X", "MyPoint.Y" for a point3d property "MyPoint" if only X and Y changed).
|
|
67
|
+
For struct properties the property names are always returned in the "StructProp.MemberName" format.
|
|
68
|
+
So if only X changed for a point2d property named "Myp2d" inide a struct "CustomStruct", the returned property name will be "CustomStruct.Myp2d.X".
|
|
69
|
+
Similaly if both X and Y changed for the same point2d property, the returned property name will be "CustomStruct.Myp2d". */
|
|
70
|
+
changeFetchedPropNames: string[];
|
|
71
|
+
/** Row adaptor options that were active when this change row was captured. */
|
|
72
|
+
rowOptions?: RowFormatOptions;
|
|
73
|
+
/** `true` when the change was applied indirectly */
|
|
74
|
+
isIndirectChange: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* An EC instance produced by [ChangesetReader]($backend) after each `step()`.
|
|
78
|
+
* Contains the EC property bag plus mandatory `$meta` metadata.
|
|
79
|
+
* @beta
|
|
80
|
+
*/
|
|
81
|
+
export interface ChangeInstance {
|
|
82
|
+
/** Metadata describing the origin and identity of this change. */
|
|
83
|
+
$meta: ChangeMeta;
|
|
84
|
+
/** EC property bag (ECClassId, ECInstanceId, user-defined properties, ...). */
|
|
85
|
+
[key: string]: any;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Contract for any reader that produces EC-typed changed instances compatible with
|
|
89
|
+
* [PartialChangeUnifier]($backend).
|
|
90
|
+
* @beta
|
|
91
|
+
*/
|
|
92
|
+
export interface ChangeSource {
|
|
93
|
+
/** The SQLite opcode of the current change row. */
|
|
94
|
+
readonly op: SqliteChangeOp;
|
|
95
|
+
/**
|
|
96
|
+
* The newly-inserted or post-update EC instance.
|
|
97
|
+
* `undefined` when the current row is a Delete, or when `isECTable` is `false`.
|
|
98
|
+
*/
|
|
99
|
+
readonly inserted?: ChangeInstance;
|
|
100
|
+
/**
|
|
101
|
+
* The deleted or pre-update EC instance.
|
|
102
|
+
* `undefined` when the current row is an Insert, or when `isECTable` is `false`.
|
|
103
|
+
*/
|
|
104
|
+
readonly deleted?: ChangeInstance;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Arguments common to all [ChangesetReader]($backend) `open*` factory methods.
|
|
108
|
+
* @beta
|
|
109
|
+
*/
|
|
110
|
+
export interface ChangesetReaderArgs {
|
|
111
|
+
/** The db used to resolve EC schema. Must be at or ahead of the changeset being read. */
|
|
112
|
+
readonly db: AnyDb;
|
|
113
|
+
/** invert the changeset operations */
|
|
114
|
+
readonly invert?: boolean;
|
|
115
|
+
/** Row adaptor options controlling how EC property values are formatted. */
|
|
116
|
+
readonly rowOptions?: RowFormatOptions;
|
|
117
|
+
/** Controls which properties are included in the change output. Defaults to PropertyFilter.All. */
|
|
118
|
+
readonly propFilter?: PropertyFilter;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=ChangesetReaderTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangesetReaderTypes.d.ts","sourceRoot":"","sources":["../../src/ChangesetReaderTypes.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAMlF;;;GAGG;AACH,oBAAY,cAAc;IACxB,kDAAkD;IAClD,GAAG,IAAI;IACP;;;uBAGmB;IACnB,cAAc,IAAI;IAClB,2CAA2C;IAC3C,WAAW,IAAI;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAMD;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,iEAAiE;IACjE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,2CAA2C;IAC3C,EAAE,EAAE,cAAc,CAAC;IACnB,kFAAkF;IAClF,KAAK,EAAE,gBAAgB,CAAC;IACxB,qCAAqC;IACrC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,UAAU,EAAE,cAAc,CAAC;IAC3B;;;;;;;+HAO2H;IAC3H,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,8EAA8E;IAC9E,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,oDAAoD;IACpD,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,KAAK,EAAE,UAAU,CAAC;IAClB,+EAA+E;IAC/E,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;CACnC;AAMD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,yFAAyF;IACzF,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,sCAAsC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAC;IACvC,mGAAmG;IACnG,QAAQ,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC;CACtC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Type aliases
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
/**
|
|
5
|
+
* Controls which properties are included in the output of [ChangesetReader]($backend).
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export var PropertyFilter;
|
|
9
|
+
(function (PropertyFilter) {
|
|
10
|
+
/** All EC properties mapped to changed tables. */
|
|
11
|
+
PropertyFilter[PropertyFilter["All"] = 0] = "All";
|
|
12
|
+
/** For classes whose base class is `BisCore:Element`, only `BisCore:Element` properties
|
|
13
|
+
* mapped to changed tables are returned. If no `BisCore:Element` class property changed,
|
|
14
|
+
* only `ECInstanceId` and `ECClassId` are returned. For other classes all mapped properties
|
|
15
|
+
* are returned. */
|
|
16
|
+
PropertyFilter[PropertyFilter["BisCoreElement"] = 1] = "BisCoreElement";
|
|
17
|
+
/** Only `ECInstanceId` and `ECClassId`. */
|
|
18
|
+
PropertyFilter[PropertyFilter["InstanceKey"] = 2] = "InstanceKey";
|
|
19
|
+
})(PropertyFilter || (PropertyFilter = {}));
|
|
20
|
+
//# sourceMappingURL=ChangesetReaderTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangesetReaderTypes.js","sourceRoot":"","sources":["../../src/ChangesetReaderTypes.ts"],"names":[],"mappings":"AASA,8EAA8E;AAC9E,eAAe;AACf,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,CAAN,IAAY,cAUX;AAVD,WAAY,cAAc;IACxB,kDAAkD;IAClD,iDAAO,CAAA;IACP;;;uBAGmB;IACnB,uEAAkB,CAAA;IAClB,2CAA2C;IAC3C,iEAAe,CAAA;AACjB,CAAC,EAVW,cAAc,KAAd,cAAc,QAUzB","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 ECDb\r\n */\r\nimport { AnyDb, SqliteChangeOp, SqliteValueStage } from \"./SqliteChangesetReader\";\r\n\r\n// ---------------------------------------------------------------------------\r\n// Type aliases\r\n// ---------------------------------------------------------------------------\r\n\r\n/**\r\n * Controls which properties are included in the output of [ChangesetReader]($backend).\r\n * @beta\r\n */\r\nexport enum PropertyFilter {\r\n /** All EC properties mapped to changed tables. */\r\n All = 0,\r\n /** For classes whose base class is `BisCore:Element`, only `BisCore:Element` properties\r\n * mapped to changed tables are returned. If no `BisCore:Element` class property changed,\r\n * only `ECInstanceId` and `ECClassId` are returned. For other classes all mapped properties\r\n * are returned. */\r\n BisCoreElement = 1,\r\n /** Only `ECInstanceId` and `ECClassId`. */\r\n InstanceKey = 2,\r\n}\r\n\r\n/**\r\n * Row-formatting options for [ChangesetReader]($backend) factory methods.\r\n * Controls how EC property values are represented in the returned instances.\r\n * @beta\r\n */\r\nexport interface RowFormatOptions {\r\n /**\r\n * When `false`, binary properties are returned as full `Uint8Array` values.\r\n * When `true` (or omitted), binary properties are summarized as `{ bytes: N }`.\r\n */\r\n abbreviateBlobs?: boolean;\r\n /**\r\n * When `true`, `ECClassId` and `RelECClassId` values are converted from hex strings\r\n * to fully-qualified class names (e.g. `\"BisCore.DrawingModel\"`).\r\n */\r\n classIdsToClassNames?: boolean;\r\n /**\r\n * When `true`, all property keys and struct sub-keys are returned in camelCase\r\n * (e.g. `id`, `className`, `lastMod`). Navigation property sub-keys use\r\n * `{ id, relClassName }` instead of `{ Id, RelECClassId }`.\r\n */\r\n useJsName?: boolean;\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Public interfaces\r\n// ---------------------------------------------------------------------------\r\n\r\n/**\r\n * Metadata attached to every [[ChangeInstance]].\r\n * @beta\r\n */\r\nexport interface ChangeMeta {\r\n /** SQLite tables that contributed columns to this change row. */\r\n tables: string[];\r\n /** Operation that produced this change. */\r\n op: SqliteChangeOp;\r\n /** Whether this is the pre-change (`\"Old\"`) or post-change (`\"New\"`) snapshot. */\r\n stage: SqliteValueStage;\r\n /** Change-stream index positions. */\r\n changeIndexes: number[];\r\n /**\r\n * ECInstanceId and class Id in format \"<ECInstanceId>-<ECClassId>\".\r\n */\r\n instanceKey: string;\r\n /** Reader property filter that was active when this change row was captured. */\r\n propFilter: PropertyFilter;\r\n /** EC property names fetched from the current row of changeset or transaction or any other change stream.\r\n For compound data properties like point2d, point3d or navigation properties,\r\n the full name of the property is returned in case all the components of the property are fetched from the change.\r\n If all of the components are not fetched from the changes(meaning they did not change),\r\n then the individual component names which changed are returned smartly by using `.` as a separator (e.g. \"MyPoint.X\", \"MyPoint.Y\" for a point3d property \"MyPoint\" if only X and Y changed).\r\n For struct properties the property names are always returned in the \"StructProp.MemberName\" format.\r\n So if only X changed for a point2d property named \"Myp2d\" inide a struct \"CustomStruct\", the returned property name will be \"CustomStruct.Myp2d.X\".\r\n Similaly if both X and Y changed for the same point2d property, the returned property name will be \"CustomStruct.Myp2d\". */\r\n changeFetchedPropNames: string[];\r\n /** Row adaptor options that were active when this change row was captured. */\r\n rowOptions?: RowFormatOptions;\r\n /** `true` when the change was applied indirectly */\r\n isIndirectChange: boolean;\r\n}\r\n\r\n/**\r\n * An EC instance produced by [ChangesetReader]($backend) after each `step()`.\r\n * Contains the EC property bag plus mandatory `$meta` metadata.\r\n * @beta\r\n */\r\nexport interface ChangeInstance {\r\n /** Metadata describing the origin and identity of this change. */\r\n $meta: ChangeMeta;\r\n /** EC property bag (ECClassId, ECInstanceId, user-defined properties, ...). */\r\n [key: string]: any;\r\n}\r\n\r\n/**\r\n * Contract for any reader that produces EC-typed changed instances compatible with\r\n * [PartialChangeUnifier]($backend).\r\n * @beta\r\n */\r\nexport interface ChangeSource {\r\n /** The SQLite opcode of the current change row. */\r\n readonly op: SqliteChangeOp;\r\n /**\r\n * The newly-inserted or post-update EC instance.\r\n * `undefined` when the current row is a Delete, or when `isECTable` is `false`.\r\n */\r\n readonly inserted?: ChangeInstance;\r\n /**\r\n * The deleted or pre-update EC instance.\r\n * `undefined` when the current row is an Insert, or when `isECTable` is `false`.\r\n */\r\n readonly deleted?: ChangeInstance;\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// ChangesetReader args / options\r\n// ---------------------------------------------------------------------------\r\n\r\n/**\r\n * Arguments common to all [ChangesetReader]($backend) `open*` factory methods.\r\n * @beta\r\n */\r\nexport interface ChangesetReaderArgs {\r\n /** The db used to resolve EC schema. Must be at or ahead of the changeset being read. */\r\n readonly db: AnyDb;\r\n /** invert the changeset operations */\r\n readonly invert?: boolean;\r\n /** Row adaptor options controlling how EC property values are formatted. */\r\n readonly rowOptions?: RowFormatOptions;\r\n /** Controls which properties are included in the change output. Defaults to PropertyFilter.All. */\r\n readonly propFilter?: PropertyFilter;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelControl.js","sourceRoot":"","sources":["../../src/ChannelControl.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAyH/E,YAAY;AACZ,MAAM,KAAW,cAAc,CAG9B;AAHD,WAAiB,cAAc;IAC7B,wGAAwG;IAC3F,gCAAiB,GAAG,QAAQ,CAAC;AAC5C,CAAC,EAHgB,cAAc,KAAd,cAAc,QAG9B","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 */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { _implementationProhibited, _verifyChannel } from \"./internal/Symbols\";\nimport { IModelDb } from \"./IModelDb\";\nimport type { EditTxn } from \"./EditTxn\";\n\n/** The key for a channel. Used for \"allowed channels\" in [[ChannelControl]]\n * @beta\n */\nexport type ChannelKey = string;\n\n/**\n * Context provided to the channel upgrade callback.\n * @beta\n */\nexport interface ChannelUpgradeContext<T = any> {\n iModel: IModelDb;\n channelKey: string;\n fromVersion: string;\n toVersion: string;\n /** Optional data to be used during the upgrade */\n data?: T;\n}\n\n/**\n * Options for upgrading a channel before schema import.\n * The framework will automatically populate the context with iModel and data.\n * @beta\n */\nexport interface ChannelUpgradeOptions<T = any> {\n channelKey: string;\n fromVersion: string;\n toVersion: string;\n callback: (context: ChannelUpgradeContext<T>) => Promise<void>;\n}\n\n/**\n * Controls which channels of an iModel are permitted for write operations. An implementation of this interface is\n * available via [[IModelDb.channels]].\n * @see [Working With Channels]($docs/learning/backend/Channel.md) for details\n * @beta\n */\nexport interface ChannelControl {\n /** @internal */\n readonly [_implementationProhibited]: unknown;\n\n /** Add a new channel to the list of allowed channels of the [[IModelDb]] for this session.\n * @param channelKey The key for the channel to become editable in this session.\n */\n addAllowedChannel(channelKey: ChannelKey): void;\n /** Remove a channel from the list of allowed channels of the [[IModelDb]] for this session.\n * @param channelKey The key of the channel that should no longer be editable in this session.\n */\n removeAllowedChannel(channelKey: ChannelKey): void;\n /** Get the channelKey of the channel for an element by ElementId.\n * @throws if the element does not exist\n */\n getChannelKey(elementId: Id64String): ChannelKey;\n /** Make an existing element a new Channel root.\n * @throws if the element is already in a channel different than the shared channel, or if\n * there is already another channelRoot element for the specified channelKey\n */\n makeChannelRoot(args: {\n elementId: Id64String;\n channelKey: ChannelKey;\n /** The transaction to use for the operation. */\n txn: EditTxn;\n }): void;\n /** Make an existing element a new Channel root.\n * @throws if the element is already in a channel different than the shared channel, or if\n * there is already another channelRoot element for the specified channelKey\n * @deprecated Use [[makeChannelRoot]] and supply `txn`.\n */\n makeChannelRoot(args: { elementId: Id64String, channelKey: ChannelKey }): void;\n /** Insert a new Subject element that is a Channel Root in this iModel.\n * @returns the ElementId of the new Subject element.\n * @note if the parentSubject element is already in a channel, this will add the Subject element and then throw an error without making it a Channel root.\n */\n insertChannelSubject(args: {\n /** The name of the new Subject element */\n subjectName: string;\n /** The channel key for the new [[Subject]]. This is the string to pass to [[addAllowedChannel]]*/\n channelKey: ChannelKey;\n /** the Id of the parent of the new Subject. Default is [[IModel.rootSubjectId]]. */\n parentSubjectId?: Id64String;\n /** Optional description for new Subject. */\n description?: string;\n /** The EditTxn to use for the operation. */\n txn: EditTxn;\n }): Id64String;\n /** Insert a new Subject element that is a Channel Root in this iModel.\n * @returns the ElementId of the new Subject element.\n * @note if the parentSubject element is already in a channel, this will add the Subject element and then throw an error without making it a Channel root.\n * @deprecated Use [[insertChannelSubject]] and supply `txn`.\n */\n insertChannelSubject(args: {\n /** The name of the new Subject element */\n subjectName: string;\n /** The channel key for the new [[Subject]]. This is the string to pass to [[addAllowedChannel]]*/\n channelKey: ChannelKey;\n /** the Id of the parent of the new Subject. Default is [[IModel.rootSubjectId]]. */\n parentSubjectId?: Id64String;\n /** Optional description for new Subject. */\n description?: string;\n }): Id64String;\n /**\n * Queries for the element Id acting as the ChannelRoot for a given channelKey, if any\n * @param channelKey The key for the channel to query for\n * @returns The element Id of the ChannelRoot element of the specified Channel key, or undefined if\n * there is no ChannelRoot for it\n */\n queryChannelRoot(channelKey: ChannelKey): Id64String | undefined;\n\n /** @internal */\n [_verifyChannel]: (modelId: Id64String) => void;\n\n /**\n * Upgrade a channel to a new version.\n * @beta\n */\n upgradeChannel(options: ChannelUpgradeOptions, iModel: IModelDb, data?: any): Promise<void>;\n}\n\n/** @beta */\nexport namespace ChannelControl {\n /** the name of the special \"shared\" channel holding information that is editable by any application. */\n export const sharedChannelName = \"shared\";\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"ChannelControl.js","sourceRoot":"","sources":["../../src/ChannelControl.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAyH/E,YAAY;AACZ,MAAM,KAAW,cAAc,CAG9B;AAHD,WAAiB,cAAc;IAC7B,wGAAwG;IAC3F,gCAAiB,GAAG,QAAQ,CAAC;AAC5C,CAAC,EAHgB,cAAc,KAAd,cAAc,QAG9B","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\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { _implementationProhibited, _verifyChannel } from \"./internal/Symbols\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport type { EditTxn } from \"./EditTxn\";\r\n\r\n/** The key for a channel. Used for \"allowed channels\" in [[ChannelControl]]\r\n * @beta\r\n */\r\nexport type ChannelKey = string;\r\n\r\n/**\r\n * Context provided to the channel upgrade callback.\r\n * @beta\r\n */\r\nexport interface ChannelUpgradeContext<T = any> {\r\n iModel: IModelDb;\r\n channelKey: string;\r\n fromVersion: string;\r\n toVersion: string;\r\n /** Optional data to be used during the upgrade */\r\n data?: T;\r\n}\r\n\r\n/**\r\n * Options for upgrading a channel before schema import.\r\n * The framework will automatically populate the context with iModel and data.\r\n * @beta\r\n */\r\nexport interface ChannelUpgradeOptions<T = any> {\r\n channelKey: string;\r\n fromVersion: string;\r\n toVersion: string;\r\n callback: (context: ChannelUpgradeContext<T>) => Promise<void>;\r\n}\r\n\r\n/**\r\n * Controls which channels of an iModel are permitted for write operations. An implementation of this interface is\r\n * available via [[IModelDb.channels]].\r\n * @see [Working With Channels]($docs/learning/backend/Channel.md) for details\r\n * @beta\r\n */\r\nexport interface ChannelControl {\r\n /** @internal */\r\n readonly [_implementationProhibited]: unknown;\r\n\r\n /** Add a new channel to the list of allowed channels of the [[IModelDb]] for this session.\r\n * @param channelKey The key for the channel to become editable in this session.\r\n */\r\n addAllowedChannel(channelKey: ChannelKey): void;\r\n /** Remove a channel from the list of allowed channels of the [[IModelDb]] for this session.\r\n * @param channelKey The key of the channel that should no longer be editable in this session.\r\n */\r\n removeAllowedChannel(channelKey: ChannelKey): void;\r\n /** Get the channelKey of the channel for an element by ElementId.\r\n * @throws if the element does not exist\r\n */\r\n getChannelKey(elementId: Id64String): ChannelKey;\r\n /** Make an existing element a new Channel root.\r\n * @throws if the element is already in a channel different than the shared channel, or if\r\n * there is already another channelRoot element for the specified channelKey\r\n */\r\n makeChannelRoot(args: {\r\n elementId: Id64String;\r\n channelKey: ChannelKey;\r\n /** The transaction to use for the operation. */\r\n txn: EditTxn;\r\n }): void;\r\n /** Make an existing element a new Channel root.\r\n * @throws if the element is already in a channel different than the shared channel, or if\r\n * there is already another channelRoot element for the specified channelKey\r\n * @deprecated Use [[makeChannelRoot]] and supply `txn`.\r\n */\r\n makeChannelRoot(args: { elementId: Id64String, channelKey: ChannelKey }): void;\r\n /** Insert a new Subject element that is a Channel Root in this iModel.\r\n * @returns the ElementId of the new Subject element.\r\n * @note if the parentSubject element is already in a channel, this will add the Subject element and then throw an error without making it a Channel root.\r\n */\r\n insertChannelSubject(args: {\r\n /** The name of the new Subject element */\r\n subjectName: string;\r\n /** The channel key for the new [[Subject]]. This is the string to pass to [[addAllowedChannel]]*/\r\n channelKey: ChannelKey;\r\n /** the Id of the parent of the new Subject. Default is [[IModel.rootSubjectId]]. */\r\n parentSubjectId?: Id64String;\r\n /** Optional description for new Subject. */\r\n description?: string;\r\n /** The EditTxn to use for the operation. */\r\n txn: EditTxn;\r\n }): Id64String;\r\n /** Insert a new Subject element that is a Channel Root in this iModel.\r\n * @returns the ElementId of the new Subject element.\r\n * @note if the parentSubject element is already in a channel, this will add the Subject element and then throw an error without making it a Channel root.\r\n * @deprecated Use [[insertChannelSubject]] and supply `txn`.\r\n */\r\n insertChannelSubject(args: {\r\n /** The name of the new Subject element */\r\n subjectName: string;\r\n /** The channel key for the new [[Subject]]. This is the string to pass to [[addAllowedChannel]]*/\r\n channelKey: ChannelKey;\r\n /** the Id of the parent of the new Subject. Default is [[IModel.rootSubjectId]]. */\r\n parentSubjectId?: Id64String;\r\n /** Optional description for new Subject. */\r\n description?: string;\r\n }): Id64String;\r\n /**\r\n * Queries for the element Id acting as the ChannelRoot for a given channelKey, if any\r\n * @param channelKey The key for the channel to query for\r\n * @returns The element Id of the ChannelRoot element of the specified Channel key, or undefined if\r\n * there is no ChannelRoot for it\r\n */\r\n queryChannelRoot(channelKey: ChannelKey): Id64String | undefined;\r\n\r\n /** @internal */\r\n [_verifyChannel]: (modelId: Id64String) => void;\r\n\r\n /**\r\n * Upgrade a channel to a new version.\r\n * @beta\r\n */\r\n upgradeChannel(options: ChannelUpgradeOptions, iModel: IModelDb, data?: any): Promise<void>;\r\n}\r\n\r\n/** @beta */\r\nexport namespace ChannelControl {\r\n /** the name of the special \"shared\" channel holding information that is editable by any application. */\r\n export const sharedChannelName = \"shared\";\r\n}\r\n\r\n"]}
|