@itwin/core-backend 3.0.0-dev.76 → 3.0.0-dev.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{AliCloudStorageService.d.ts → cjs/AliCloudStorageService.d.ts} +0 -0
- package/lib/cjs/AliCloudStorageService.d.ts.map +1 -0
- package/lib/{AliCloudStorageService.js → cjs/AliCloudStorageService.js} +0 -0
- package/lib/cjs/AliCloudStorageService.js.map +1 -0
- package/lib/{BackendHubAccess.d.ts → cjs/BackendHubAccess.d.ts} +0 -0
- package/lib/cjs/BackendHubAccess.d.ts.map +1 -0
- package/lib/{BackendHubAccess.js → cjs/BackendHubAccess.js} +0 -0
- package/lib/cjs/BackendHubAccess.js.map +1 -0
- package/lib/{BackendLoggerCategory.d.ts → cjs/BackendLoggerCategory.d.ts} +0 -0
- package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -0
- package/lib/{BackendLoggerCategory.js → cjs/BackendLoggerCategory.js} +0 -0
- package/lib/cjs/BackendLoggerCategory.js.map +1 -0
- package/lib/{BisCoreSchema.d.ts → cjs/BisCoreSchema.d.ts} +0 -0
- package/lib/cjs/BisCoreSchema.d.ts.map +1 -0
- package/lib/{BisCoreSchema.js → cjs/BisCoreSchema.js} +0 -0
- package/lib/cjs/BisCoreSchema.js.map +1 -0
- package/lib/{BriefcaseManager.d.ts → cjs/BriefcaseManager.d.ts} +0 -0
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -0
- package/lib/{BriefcaseManager.js → cjs/BriefcaseManager.js} +2 -2
- package/lib/cjs/BriefcaseManager.js.map +1 -0
- package/lib/{Category.d.ts → cjs/Category.d.ts} +0 -0
- package/lib/cjs/Category.d.ts.map +1 -0
- package/lib/{Category.js → cjs/Category.js} +0 -0
- package/lib/cjs/Category.js.map +1 -0
- package/lib/{ChangeSummaryManager.d.ts → cjs/ChangeSummaryManager.d.ts} +1 -1
- package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -0
- package/lib/{ChangeSummaryManager.js → cjs/ChangeSummaryManager.js} +0 -0
- package/lib/cjs/ChangeSummaryManager.js.map +1 -0
- package/lib/{ChangedElementsDb.d.ts → cjs/ChangedElementsDb.d.ts} +0 -0
- package/lib/cjs/ChangedElementsDb.d.ts.map +1 -0
- package/lib/{ChangedElementsDb.js → cjs/ChangedElementsDb.js} +0 -0
- package/lib/cjs/ChangedElementsDb.js.map +1 -0
- package/lib/{ChangedElementsManager.d.ts → cjs/ChangedElementsManager.d.ts} +0 -0
- package/lib/cjs/ChangedElementsManager.d.ts.map +1 -0
- package/lib/{ChangedElementsManager.js → cjs/ChangedElementsManager.js} +0 -0
- package/lib/cjs/ChangedElementsManager.js.map +1 -0
- package/lib/{CheckpointManager.d.ts → cjs/CheckpointManager.d.ts} +3 -1
- package/lib/cjs/CheckpointManager.d.ts.map +1 -0
- package/lib/{CheckpointManager.js → cjs/CheckpointManager.js} +2 -2
- package/lib/cjs/CheckpointManager.js.map +1 -0
- package/lib/{ClassRegistry.d.ts → cjs/ClassRegistry.d.ts} +0 -0
- package/lib/cjs/ClassRegistry.d.ts.map +1 -0
- package/lib/{ClassRegistry.js → cjs/ClassRegistry.js} +0 -0
- package/lib/cjs/ClassRegistry.js.map +1 -0
- package/lib/{CloudStorageBackend.d.ts → cjs/CloudStorageBackend.d.ts} +0 -0
- package/lib/cjs/CloudStorageBackend.d.ts.map +1 -0
- package/lib/{CloudStorageBackend.js → cjs/CloudStorageBackend.js} +3 -3
- package/lib/cjs/CloudStorageBackend.js.map +1 -0
- package/lib/{CodeSpecs.d.ts → cjs/CodeSpecs.d.ts} +0 -0
- package/lib/cjs/CodeSpecs.d.ts.map +1 -0
- package/lib/{CodeSpecs.js → cjs/CodeSpecs.js} +0 -0
- package/lib/cjs/CodeSpecs.js.map +1 -0
- package/lib/{ConcurrentQuery.d.ts → cjs/ConcurrentQuery.d.ts} +0 -0
- package/lib/cjs/ConcurrentQuery.d.ts.map +1 -0
- package/lib/{ConcurrentQuery.js → cjs/ConcurrentQuery.js} +0 -0
- package/lib/cjs/ConcurrentQuery.js.map +1 -0
- package/lib/{DevTools.d.ts → cjs/DevTools.d.ts} +0 -0
- package/lib/cjs/DevTools.d.ts.map +1 -0
- package/lib/{DevTools.js → cjs/DevTools.js} +3 -3
- package/lib/cjs/DevTools.js.map +1 -0
- package/lib/{DisplayStyle.d.ts → cjs/DisplayStyle.d.ts} +0 -0
- package/lib/cjs/DisplayStyle.d.ts.map +1 -0
- package/lib/{DisplayStyle.js → cjs/DisplayStyle.js} +5 -2
- package/lib/cjs/DisplayStyle.js.map +1 -0
- package/lib/{ECDb.d.ts → cjs/ECDb.d.ts} +0 -0
- package/lib/cjs/ECDb.d.ts.map +1 -0
- package/lib/{ECDb.js → cjs/ECDb.js} +51 -85
- package/lib/cjs/ECDb.js.map +1 -0
- package/lib/{ECSchemaXmlContext.d.ts → cjs/ECSchemaXmlContext.d.ts} +0 -0
- package/lib/cjs/ECSchemaXmlContext.d.ts.map +1 -0
- package/lib/{ECSchemaXmlContext.js → cjs/ECSchemaXmlContext.js} +0 -0
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -0
- package/lib/{ECSqlStatement.d.ts → cjs/ECSqlStatement.d.ts} +0 -0
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -0
- package/lib/{ECSqlStatement.js → cjs/ECSqlStatement.js} +0 -0
- package/lib/cjs/ECSqlStatement.js.map +1 -0
- package/lib/{Element.d.ts → cjs/Element.d.ts} +0 -0
- package/lib/cjs/Element.d.ts.map +1 -0
- package/lib/{Element.js → cjs/Element.js} +11 -4
- package/lib/cjs/Element.js.map +1 -0
- package/lib/{ElementAspect.d.ts → cjs/ElementAspect.d.ts} +0 -0
- package/lib/cjs/ElementAspect.d.ts.map +1 -0
- package/lib/{ElementAspect.js → cjs/ElementAspect.js} +0 -0
- package/lib/cjs/ElementAspect.js.map +1 -0
- package/lib/{ElementGraphics.d.ts → cjs/ElementGraphics.d.ts} +0 -0
- package/lib/cjs/ElementGraphics.d.ts.map +1 -0
- package/lib/{ElementGraphics.js → cjs/ElementGraphics.js} +0 -0
- package/lib/cjs/ElementGraphics.js.map +1 -0
- package/lib/{Entity.d.ts → cjs/Entity.d.ts} +0 -0
- package/lib/cjs/Entity.d.ts.map +1 -0
- package/lib/{Entity.js → cjs/Entity.js} +0 -0
- package/lib/cjs/Entity.js.map +1 -0
- package/lib/{ExportGraphics.d.ts → cjs/ExportGraphics.d.ts} +0 -0
- package/lib/cjs/ExportGraphics.d.ts.map +1 -0
- package/lib/{ExportGraphics.js → cjs/ExportGraphics.js} +0 -0
- package/lib/cjs/ExportGraphics.js.map +1 -0
- package/lib/{ExternalSource.d.ts → cjs/ExternalSource.d.ts} +0 -0
- package/lib/cjs/ExternalSource.d.ts.map +1 -0
- package/lib/{ExternalSource.js → cjs/ExternalSource.js} +0 -0
- package/lib/cjs/ExternalSource.js.map +1 -0
- package/lib/{GeometrySummary.d.ts → cjs/GeometrySummary.d.ts} +0 -0
- package/lib/cjs/GeometrySummary.d.ts.map +1 -0
- package/lib/{GeometrySummary.js → cjs/GeometrySummary.js} +0 -0
- package/lib/cjs/GeometrySummary.js.map +1 -0
- package/lib/{IModelCloneContext.d.ts → cjs/IModelCloneContext.d.ts} +0 -0
- package/lib/cjs/IModelCloneContext.d.ts.map +1 -0
- package/lib/{IModelCloneContext.js → cjs/IModelCloneContext.js} +0 -0
- package/lib/cjs/IModelCloneContext.js.map +1 -0
- package/lib/{IModelDb.d.ts → cjs/IModelDb.d.ts} +4 -6
- package/lib/cjs/IModelDb.d.ts.map +1 -0
- package/lib/{IModelDb.js → cjs/IModelDb.js} +99 -104
- package/lib/cjs/IModelDb.js.map +1 -0
- package/lib/{IModelHost.d.ts → cjs/IModelHost.d.ts} +1 -2
- package/lib/cjs/IModelHost.d.ts.map +1 -0
- package/lib/{IModelHost.js → cjs/IModelHost.js} +11 -6
- package/lib/cjs/IModelHost.js.map +1 -0
- package/lib/{IModelHubBackend.d.ts → cjs/IModelHubBackend.d.ts} +0 -0
- package/lib/cjs/IModelHubBackend.d.ts.map +1 -0
- package/lib/{IModelHubBackend.js → cjs/IModelHubBackend.js} +6 -6
- package/lib/cjs/IModelHubBackend.js.map +1 -0
- package/lib/{IModelJsFs.d.ts → cjs/IModelJsFs.d.ts} +0 -0
- package/lib/cjs/IModelJsFs.d.ts.map +1 -0
- package/lib/{IModelJsFs.js → cjs/IModelJsFs.js} +0 -0
- package/lib/cjs/IModelJsFs.js.map +1 -0
- package/lib/{IModelSchemaLoader.d.ts → cjs/IModelSchemaLoader.d.ts} +0 -0
- package/lib/cjs/IModelSchemaLoader.d.ts.map +1 -0
- package/lib/{IModelSchemaLoader.js → cjs/IModelSchemaLoader.js} +0 -0
- package/lib/cjs/IModelSchemaLoader.js.map +1 -0
- package/lib/{IpcHost.d.ts → cjs/IpcHost.d.ts} +0 -0
- package/lib/cjs/IpcHost.d.ts.map +1 -0
- package/lib/{IpcHost.js → cjs/IpcHost.js} +0 -0
- package/lib/cjs/IpcHost.js.map +1 -0
- package/lib/{LineStyle.d.ts → cjs/LineStyle.d.ts} +0 -0
- package/lib/cjs/LineStyle.d.ts.map +1 -0
- package/lib/{LineStyle.js → cjs/LineStyle.js} +0 -0
- package/lib/cjs/LineStyle.js.map +1 -0
- package/lib/{LocalhostIpcHost.d.ts → cjs/LocalhostIpcHost.d.ts} +0 -0
- package/lib/cjs/LocalhostIpcHost.d.ts.map +1 -0
- package/lib/{LocalhostIpcHost.js → cjs/LocalhostIpcHost.js} +0 -0
- package/lib/cjs/LocalhostIpcHost.js.map +1 -0
- package/lib/{Material.d.ts → cjs/Material.d.ts} +0 -0
- package/lib/cjs/Material.d.ts.map +1 -0
- package/lib/{Material.js → cjs/Material.js} +0 -0
- package/lib/cjs/Material.js.map +1 -0
- package/lib/{Model.d.ts → cjs/Model.d.ts} +0 -0
- package/lib/cjs/Model.d.ts.map +1 -0
- package/lib/{Model.js → cjs/Model.js} +1 -1
- package/lib/cjs/Model.js.map +1 -0
- package/lib/{NativeAppStorage.d.ts → cjs/NativeAppStorage.d.ts} +0 -0
- package/lib/cjs/NativeAppStorage.d.ts.map +1 -0
- package/lib/{NativeAppStorage.js → cjs/NativeAppStorage.js} +0 -0
- package/lib/cjs/NativeAppStorage.js.map +1 -0
- package/lib/{NativeHost.d.ts → cjs/NativeHost.d.ts} +2 -2
- package/lib/cjs/NativeHost.d.ts.map +1 -0
- package/lib/{NativeHost.js → cjs/NativeHost.js} +4 -1
- package/lib/cjs/NativeHost.js.map +1 -0
- package/lib/{NavigationRelationship.d.ts → cjs/NavigationRelationship.d.ts} +0 -0
- package/lib/cjs/NavigationRelationship.d.ts.map +1 -0
- package/lib/{NavigationRelationship.js → cjs/NavigationRelationship.js} +0 -0
- package/lib/cjs/NavigationRelationship.js.map +1 -0
- package/lib/{PromiseMemoizer.d.ts → cjs/PromiseMemoizer.d.ts} +0 -0
- package/lib/cjs/PromiseMemoizer.d.ts.map +1 -0
- package/lib/{PromiseMemoizer.js → cjs/PromiseMemoizer.js} +0 -0
- package/lib/cjs/PromiseMemoizer.js.map +1 -0
- package/lib/{Relationship.d.ts → cjs/Relationship.d.ts} +0 -0
- package/lib/cjs/Relationship.d.ts.map +1 -0
- package/lib/{Relationship.js → cjs/Relationship.js} +0 -0
- package/lib/cjs/Relationship.js.map +1 -0
- package/lib/{RpcBackend.d.ts → cjs/RpcBackend.d.ts} +0 -0
- package/lib/cjs/RpcBackend.d.ts.map +1 -0
- package/lib/{RpcBackend.js → cjs/RpcBackend.js} +0 -0
- package/lib/cjs/RpcBackend.js.map +1 -0
- package/lib/{SQLiteDb.d.ts → cjs/SQLiteDb.d.ts} +0 -0
- package/lib/cjs/SQLiteDb.d.ts.map +1 -0
- package/lib/{SQLiteDb.js → cjs/SQLiteDb.js} +0 -0
- package/lib/cjs/SQLiteDb.js.map +1 -0
- package/lib/{Schema.d.ts → cjs/Schema.d.ts} +0 -0
- package/lib/cjs/Schema.d.ts.map +1 -0
- package/lib/{Schema.js → cjs/Schema.js} +0 -0
- package/lib/cjs/Schema.js.map +1 -0
- package/lib/{ServerBasedLocks.d.ts → cjs/ServerBasedLocks.d.ts} +0 -0
- package/lib/cjs/ServerBasedLocks.d.ts.map +1 -0
- package/lib/{ServerBasedLocks.js → cjs/ServerBasedLocks.js} +0 -0
- package/lib/cjs/ServerBasedLocks.js.map +1 -0
- package/lib/{SqliteStatement.d.ts → cjs/SqliteStatement.d.ts} +0 -0
- package/lib/cjs/SqliteStatement.d.ts.map +1 -0
- package/lib/{SqliteStatement.js → cjs/SqliteStatement.js} +0 -0
- package/lib/cjs/SqliteStatement.js.map +1 -0
- package/lib/{Texture.d.ts → cjs/Texture.d.ts} +0 -0
- package/lib/cjs/Texture.d.ts.map +1 -0
- package/lib/{Texture.js → cjs/Texture.js} +0 -0
- package/lib/cjs/Texture.js.map +1 -0
- package/lib/{TxnManager.d.ts → cjs/TxnManager.d.ts} +0 -0
- package/lib/cjs/TxnManager.d.ts.map +1 -0
- package/lib/{TxnManager.js → cjs/TxnManager.js} +0 -0
- package/lib/cjs/TxnManager.js.map +1 -0
- package/lib/{ViewDefinition.d.ts → cjs/ViewDefinition.d.ts} +0 -0
- package/lib/cjs/ViewDefinition.d.ts.map +1 -0
- package/lib/{ViewDefinition.js → cjs/ViewDefinition.js} +0 -0
- package/lib/cjs/ViewDefinition.js.map +1 -0
- package/lib/{assets → cjs/assets}/IModelChange.02.00.00.ecschema.xml +0 -0
- package/lib/{core-backend.d.ts → cjs/core-backend.d.ts} +0 -0
- package/lib/cjs/core-backend.d.ts.map +1 -0
- package/lib/{core-backend.js → cjs/core-backend.js} +0 -0
- package/lib/cjs/core-backend.js.map +1 -0
- package/lib/{domains → cjs/domains}/FunctionalElements.d.ts +0 -0
- package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -0
- package/lib/{domains → cjs/domains}/FunctionalElements.js +0 -0
- package/lib/cjs/domains/FunctionalElements.js.map +1 -0
- package/lib/{domains → cjs/domains}/FunctionalSchema.d.ts +0 -0
- package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -0
- package/lib/{domains → cjs/domains}/FunctionalSchema.js +0 -0
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -0
- package/lib/{domains → cjs/domains}/GenericElements.d.ts +0 -0
- package/lib/cjs/domains/GenericElements.d.ts.map +1 -0
- package/lib/{domains → cjs/domains}/GenericElements.js +0 -0
- package/lib/cjs/domains/GenericElements.js.map +1 -0
- package/lib/{domains → cjs/domains}/GenericSchema.d.ts +0 -0
- package/lib/cjs/domains/GenericSchema.d.ts.map +1 -0
- package/lib/{domains → cjs/domains}/GenericSchema.js +0 -0
- package/lib/cjs/domains/GenericSchema.js.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/DevToolsRpcImpl.d.ts +0 -0
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/DevToolsRpcImpl.js +0 -0
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/IModelReadRpcImpl.d.ts +0 -0
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/IModelReadRpcImpl.js +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/IModelTileRpcImpl.d.ts +0 -0
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/IModelTileRpcImpl.js +6 -3
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/RpcBriefcaseUtility.d.ts +0 -0
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/RpcBriefcaseUtility.js +9 -8
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/SnapshotIModelRpcImpl.d.ts +0 -0
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/SnapshotIModelRpcImpl.js +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/WipRpcImpl.d.ts +1 -2
- package/lib/cjs/rpc-impl/WipRpcImpl.d.ts.map +1 -0
- package/lib/{rpc-impl → cjs/rpc-impl}/WipRpcImpl.js +1 -2
- package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -0
- package/package.json +37 -41
- package/lib/AliCloudStorageService.d.ts.map +0 -1
- package/lib/AliCloudStorageService.js.map +0 -1
- package/lib/BackendHubAccess.d.ts.map +0 -1
- package/lib/BackendHubAccess.js.map +0 -1
- package/lib/BackendLoggerCategory.d.ts.map +0 -1
- package/lib/BackendLoggerCategory.js.map +0 -1
- package/lib/BisCoreSchema.d.ts.map +0 -1
- package/lib/BisCoreSchema.js.map +0 -1
- package/lib/BriefcaseManager.d.ts.map +0 -1
- package/lib/BriefcaseManager.js.map +0 -1
- package/lib/Category.d.ts.map +0 -1
- package/lib/Category.js.map +0 -1
- package/lib/ChangeSummaryManager.d.ts.map +0 -1
- package/lib/ChangeSummaryManager.js.map +0 -1
- package/lib/ChangedElementsDb.d.ts.map +0 -1
- package/lib/ChangedElementsDb.js.map +0 -1
- package/lib/ChangedElementsManager.d.ts.map +0 -1
- package/lib/ChangedElementsManager.js.map +0 -1
- package/lib/CheckpointManager.d.ts.map +0 -1
- package/lib/CheckpointManager.js.map +0 -1
- package/lib/ClassRegistry.d.ts.map +0 -1
- package/lib/ClassRegistry.js.map +0 -1
- package/lib/CloudStorageBackend.d.ts.map +0 -1
- package/lib/CloudStorageBackend.js.map +0 -1
- package/lib/CodeSpecs.d.ts.map +0 -1
- package/lib/CodeSpecs.js.map +0 -1
- package/lib/ConcurrentQuery.d.ts.map +0 -1
- package/lib/ConcurrentQuery.js.map +0 -1
- package/lib/DevTools.d.ts.map +0 -1
- package/lib/DevTools.js.map +0 -1
- package/lib/DisplayStyle.d.ts.map +0 -1
- package/lib/DisplayStyle.js.map +0 -1
- package/lib/ECDb.d.ts.map +0 -1
- package/lib/ECDb.js.map +0 -1
- package/lib/ECSchemaXmlContext.d.ts.map +0 -1
- package/lib/ECSchemaXmlContext.js.map +0 -1
- package/lib/ECSqlStatement.d.ts.map +0 -1
- package/lib/ECSqlStatement.js.map +0 -1
- package/lib/Element.d.ts.map +0 -1
- package/lib/Element.js.map +0 -1
- package/lib/ElementAspect.d.ts.map +0 -1
- package/lib/ElementAspect.js.map +0 -1
- package/lib/ElementGraphics.d.ts.map +0 -1
- package/lib/ElementGraphics.js.map +0 -1
- package/lib/Entity.d.ts.map +0 -1
- package/lib/Entity.js.map +0 -1
- package/lib/ExportGraphics.d.ts.map +0 -1
- package/lib/ExportGraphics.js.map +0 -1
- package/lib/ExternalSource.d.ts.map +0 -1
- package/lib/ExternalSource.js.map +0 -1
- package/lib/GeometrySummary.d.ts.map +0 -1
- package/lib/GeometrySummary.js.map +0 -1
- package/lib/IModelCloneContext.d.ts.map +0 -1
- package/lib/IModelCloneContext.js.map +0 -1
- package/lib/IModelDb.d.ts.map +0 -1
- package/lib/IModelDb.js.map +0 -1
- package/lib/IModelHost.d.ts.map +0 -1
- package/lib/IModelHost.js.map +0 -1
- package/lib/IModelHubBackend.d.ts.map +0 -1
- package/lib/IModelHubBackend.js.map +0 -1
- package/lib/IModelJsFs.d.ts.map +0 -1
- package/lib/IModelJsFs.js.map +0 -1
- package/lib/IModelSchemaLoader.d.ts.map +0 -1
- package/lib/IModelSchemaLoader.js.map +0 -1
- package/lib/IpcHost.d.ts.map +0 -1
- package/lib/IpcHost.js.map +0 -1
- package/lib/LineStyle.d.ts.map +0 -1
- package/lib/LineStyle.js.map +0 -1
- package/lib/LocalhostIpcHost.d.ts.map +0 -1
- package/lib/LocalhostIpcHost.js.map +0 -1
- package/lib/Material.d.ts.map +0 -1
- package/lib/Material.js.map +0 -1
- package/lib/Model.d.ts.map +0 -1
- package/lib/Model.js.map +0 -1
- package/lib/NativeAppStorage.d.ts.map +0 -1
- package/lib/NativeAppStorage.js.map +0 -1
- package/lib/NativeHost.d.ts.map +0 -1
- package/lib/NativeHost.js.map +0 -1
- package/lib/NavigationRelationship.d.ts.map +0 -1
- package/lib/NavigationRelationship.js.map +0 -1
- package/lib/PromiseMemoizer.d.ts.map +0 -1
- package/lib/PromiseMemoizer.js.map +0 -1
- package/lib/Relationship.d.ts.map +0 -1
- package/lib/Relationship.js.map +0 -1
- package/lib/RpcBackend.d.ts.map +0 -1
- package/lib/RpcBackend.js.map +0 -1
- package/lib/SQLiteDb.d.ts.map +0 -1
- package/lib/SQLiteDb.js.map +0 -1
- package/lib/Schema.d.ts.map +0 -1
- package/lib/Schema.js.map +0 -1
- package/lib/ServerBasedLocks.d.ts.map +0 -1
- package/lib/ServerBasedLocks.js.map +0 -1
- package/lib/SqliteStatement.d.ts.map +0 -1
- package/lib/SqliteStatement.js.map +0 -1
- package/lib/Texture.d.ts.map +0 -1
- package/lib/Texture.js.map +0 -1
- package/lib/TxnManager.d.ts.map +0 -1
- package/lib/TxnManager.js.map +0 -1
- package/lib/ViewDefinition.d.ts.map +0 -1
- package/lib/ViewDefinition.js.map +0 -1
- package/lib/core-backend.d.ts.map +0 -1
- package/lib/core-backend.js.map +0 -1
- package/lib/domains/FunctionalElements.d.ts.map +0 -1
- package/lib/domains/FunctionalElements.js.map +0 -1
- package/lib/domains/FunctionalSchema.d.ts.map +0 -1
- package/lib/domains/FunctionalSchema.js.map +0 -1
- package/lib/domains/GenericElements.d.ts.map +0 -1
- package/lib/domains/GenericElements.js.map +0 -1
- package/lib/domains/GenericSchema.d.ts.map +0 -1
- package/lib/domains/GenericSchema.js.map +0 -1
- package/lib/rpc-impl/DevToolsRpcImpl.d.ts.map +0 -1
- package/lib/rpc-impl/DevToolsRpcImpl.js.map +0 -1
- package/lib/rpc-impl/IModelReadRpcImpl.d.ts.map +0 -1
- package/lib/rpc-impl/IModelReadRpcImpl.js.map +0 -1
- package/lib/rpc-impl/IModelTileRpcImpl.d.ts.map +0 -1
- package/lib/rpc-impl/IModelTileRpcImpl.js.map +0 -1
- package/lib/rpc-impl/RpcBriefcaseUtility.d.ts.map +0 -1
- package/lib/rpc-impl/RpcBriefcaseUtility.js.map +0 -1
- package/lib/rpc-impl/SnapshotIModelRpcImpl.d.ts.map +0 -1
- package/lib/rpc-impl/SnapshotIModelRpcImpl.js.map +0 -1
- package/lib/rpc-impl/WipRpcImpl.d.ts.map +0 -1
- package/lib/rpc-impl/WipRpcImpl.js.map +0 -1
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AliCloudStorageService.d.ts","sourceRoot":"","sources":["../../src/AliCloudStorageService.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACrH,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAuBvH,YAAY;AACZ,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,OAAO,CAAC,OAAO,CAAM;IAEd,EAAE,uBAAiC;gBAEvB,WAAW,EAAE,8BAA8B;IAUvD,kBAAkB,CAAC,EAAE,EAAE,+BAA+B,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,wBAAwB;IAoB7G,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAM7E,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UA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AAC,CAAC,sCAAsC;aACnH;SACsB,CAAC;QAE1B,IAAI,OAAO,IAAI,OAAO,CAAC,eAAe,KAAK,MAAM,EAAE;YAChD,UAAU,CAAC,OAAe,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC;YAC1E,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YACrC,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACtC;aAAM;YACL,MAAM,GAAG,UAAU,CAAC;SACrB;QACD,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACvD,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AArED,wDAqEC","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 { PassThrough, Readable } from \"stream\";\r\nimport * as zlib from \"zlib\";\r\nimport { CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider } from \"@itwin/core-common\";\r\nimport { CloudStorageService, CloudStorageServiceCredentials, CloudStorageUploadOptions } from \"./CloudStorageBackend\";\r\n\r\ndeclare class OSS {\r\n constructor(params: { region: string, accessKeyId: string, accessKeySecret: string })\r\n public useBucket(name: string): void;\r\n public signatureUrl(name: string, policy: OSS.SignatureUrlOptions): string;\r\n public list(params: { marker: string, \"max-keys\": number }, arg2: {}): Promise<{ objects?: Array<{ name: string }> }>;\r\n public putBucket(name: string): Promise<void>;\r\n public putBucketCORS(name: string, params: Array<{ allowedOrigin: string, allowedMethod: string[], allowedHeader: string }>): Promise<void>;\r\n public putStream(name: string, source: Readable, options: OSS.PutStreamOptions): Promise<void>;\r\n}\r\n\r\ndeclare namespace OSS { // eslint-disable-line no-redeclare\r\n interface SignatureUrlOptions {\r\n expires: number;\r\n }\r\n\r\n interface PutStreamOptions {\r\n mime: string;\r\n headers: { [index: string]: string };\r\n }\r\n}\r\n\r\n/** @beta */\r\nexport class AliCloudStorageService extends CloudStorageService {\r\n private _client: OSS;\r\n\r\n public id = CloudStorageProvider.AliCloud;\r\n\r\n public constructor(credentials: CloudStorageServiceCredentials) {\r\n super();\r\n\r\n this._client = new OSS({\r\n region: \"oss-cn-hangzhou\",\r\n accessKeyId: credentials.account,\r\n accessKeySecret: credentials.accessKey,\r\n });\r\n }\r\n\r\n public obtainContainerUrl(id: CloudStorageContainerDescriptor, expiry: Date, _clientIp?: string): CloudStorageContainerUrl {\r\n const now = new Date().getTime();\r\n\r\n const policy: OSS.SignatureUrlOptions = {\r\n expires: expiry.getTime() - now,\r\n };\r\n\r\n this._client.useBucket(id.name);\r\n\r\n const url: CloudStorageContainerUrl = {\r\n descriptor: this.makeDescriptor(id),\r\n valid: 0,\r\n expires: expiry.getTime(),\r\n url: this._client.signatureUrl(id.resource!, policy),\r\n bound: true,\r\n };\r\n\r\n return url;\r\n }\r\n\r\n public async listContainer(name: string, marker: string, count: number): Promise<string[]> {\r\n this._client.useBucket(name);\r\n const query = await this._client.list({ marker, \"max-keys\": count }, {});\r\n return query.objects ? query.objects.map((o) => o.name) : [];\r\n }\r\n\r\n public async upload(container: string, name: string, data: Uint8Array, options?: CloudStorageUploadOptions): Promise<string> {\r\n await this._client.putBucket(container);\r\n await this._client.putBucketCORS(container, [{ allowedOrigin: \"*\", allowedMethod: [\"GET\", \"POST\", \"PUT\", \"DELETE\", \"HEAD\"], allowedHeader: \"*\" }]);\r\n this._client.useBucket(container);\r\n\r\n const dataStream = new PassThrough();\r\n dataStream.end(data);\r\n\r\n let source: Readable;\r\n\r\n const putOptions = {\r\n mime: (options && options.type) ? options.type : \"application/octet-stream\",\r\n headers: {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"Cache-Control\": (options && options.cacheControl) ? options.cacheControl : \"private, max-age=31536000, immutable\",\r\n },\r\n } as OSS.PutStreamOptions;\r\n\r\n if (options && options.contentEncoding === \"gzip\") {\r\n (putOptions.headers as any)[\"Content-Encoding\"] = options.contentEncoding;\r\n const compressor = zlib.createGzip();\r\n source = dataStream.pipe(compressor);\r\n } else {\r\n source = dataStream;\r\n }\r\n await this._client.putStream(name, source, putOptions);\r\n return \"\";\r\n }\r\n}\r\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackendHubAccess.d.ts","sourceRoot":"","sources":["../../src/BackendHubAccess.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EACnJ,aAAa,EAAE,YAAY,EAAE,aAAa,EAC3C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,oBAAY,SAAS;IACnB,+BAA+B;IAC/B,IAAI,IAAI;IACR,mJAAmJ;IACnJ,MAAM,IAAI;IACV;;OAEG;IACH,SAAS,IAAI;CACd;AAED;;EAEE;AACF,qBAAa,YAAa,SAAQ,WAAW;IAEzC,mCAAmC;aACnB,WAAW,EAAE,WAAW;IACxC,sCAAsC;aACtB,cAAc,EAAE,MAAM;;IAHtC,mCAAmC;IACnB,WAAW,EAAE,WAAW;IACxC,sCAAsC;IACtB,cAAc,EAAE,MAAM,EACtC,GAAG,EAAE,qBAAqB,GAAG,gCAAgC;CAIhE;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MA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AE,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackendHubAccess.js","sourceRoot":"","sources":["../../src/BackendHubAccess.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8E;AAC9E,oDAG4B;AAI5B;;GAEG;AACH,IAAY,SASX;AATD,WAAY,SAAS;IACnB,+BAA+B;IAC/B,yCAAQ,CAAA;IACR,mJAAmJ;IACnJ,6CAAU,CAAA;IACV;;OAEG;IACH,mDAAa,CAAA;AACf,CAAC,EATW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QASpB;AAED;;EAEE;AACF,MAAa,YAAa,SAAQ,yBAAW;IAC3C;IACE,mCAAmC;IACnB,WAAwB;IACxC,sCAAsC;IACtB,cAAsB,EACtC,GAA6D;QAE7D,KAAK,CAAC,8BAAe,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAAC;QALxC,gBAAW,GAAX,WAAW,CAAa;QAExB,mBAAc,GAAd,cAAc,CAAQ;IAIxC,CAAC;CACF;AAVD,oCAUC","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 HubAccess\r\n */\r\n\r\nimport { GuidString, Id64String, IModelHubStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n BriefcaseId, ChangesetFileProps, ChangesetId, ChangesetIdWithIndex, ChangesetIndex, ChangesetIndexOrId, ChangesetProps, ChangesetRange, IModelError,\r\n IModelVersion, LocalDirName, LocalFileName,\r\n} from \"@itwin/core-common\";\r\nimport { CheckpointProps, DownloadRequest } from \"./CheckpointManager\";\r\nimport { TokenArg } from \"./IModelDb\";\r\n\r\n/** The state of a lock.\r\n * @public\r\n */\r\nexport enum LockState {\r\n /** The entity is not locked */\r\n None = 0,\r\n /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */\r\n Shared = 1,\r\n /** A Lock that permits modifications to an element and blocks other users from making modifications to it.\r\n * Holding an exclusive lock on an \"owner\" (a model or a parent element), implicitly exclusively locks all its members.\r\n */\r\n Exclusive = 2,\r\n}\r\n\r\n/** Exception thrown if lock cannot be acquired.\r\n * @beta\r\n*/\r\nexport class LockConflict extends IModelError {\r\n public constructor(\r\n /** Id of Briefcase holding lock */\r\n public readonly briefcaseId: BriefcaseId,\r\n /** Alias of Briefcase holding lock */\r\n public readonly briefcaseAlias: string,\r\n msg: \"shared lock is held\" | \"exclusive lock is already held\"\r\n ) {\r\n super(IModelHubStatus.LockOwnedByAnotherBriefcase, msg);\r\n }\r\n}\r\n\r\n/**\r\n * The properties to access a V2 checkpoint through a daemon.\r\n * @beta\r\n */\r\nexport interface V2CheckpointAccessProps {\r\n readonly container: string;\r\n readonly auth: string;\r\n /** The name of the container */\r\n readonly user: string;\r\n /** The name of the virtual file used for the Checkpoint */\r\n readonly dbAlias: string;\r\n readonly storageType: string;\r\n}\r\n\r\n/** @internal */\r\nexport type LockMap = Map<Id64String, LockState>;\r\n\r\n/**\r\n * The properties of a lock that may be obtained from a lock server.\r\n * @beta\r\n */\r\nexport interface LockProps {\r\n /** The elementId for the lock */\r\n readonly id: Id64String;\r\n /** the lock state */\r\n readonly state: LockState;\r\n}\r\n\r\n/**\r\n * Argument for methods that must supply an iTwinId\r\n * @public\r\n */\r\nexport interface ITwinIdArg {\r\n readonly iTwinId: GuidString;\r\n}\r\n\r\n/**\r\n * Argument for methods that must supply an IModelId\r\n * @public\r\n */\r\nexport interface IModelIdArg extends TokenArg {\r\n readonly iModelId: GuidString;\r\n}\r\n\r\n/**\r\n * Argument for acquiring a new BriefcaseId\r\n * @public\r\n */\r\nexport interface AcquireNewBriefcaseIdArg extends IModelIdArg {\r\n /** A string to be reported to other users to identify this briefcase, for example in the case of conflicts or lock collisions. */\r\n readonly briefcaseAlias?: string;\r\n}\r\n\r\n/** Argument for methods that must supply an IModel name and iTwinId\r\n * @public\r\n */\r\nexport interface IModelNameArg extends TokenArg, ITwinIdArg {\r\n readonly iModelName: string;\r\n}\r\n\r\n/** Argument for methods that must supply an IModelId and a BriefcaseId\r\n * @public\r\n */\r\nexport interface BriefcaseIdArg extends IModelIdArg {\r\n readonly briefcaseId: BriefcaseId;\r\n}\r\n\r\n/** Argument for methods that must supply a briefcaseId and a changeset\r\n * @public\r\n */\r\nexport interface BriefcaseDbArg extends BriefcaseIdArg {\r\n readonly changeset: ChangesetIdWithIndex;\r\n}\r\n\r\n/** Argument for methods that must supply an IModelId and a changeset\r\n * @public\r\n */\r\nexport interface ChangesetArg extends IModelIdArg {\r\n readonly changeset: ChangesetIndexOrId;\r\n}\r\n\r\n/** @internal */\r\nexport interface ChangesetIndexArg extends IModelIdArg {\r\n readonly changeset: ChangesetIdWithIndex;\r\n}\r\n\r\n/** Argument for methods that must supply an IModelId and a range of ChangesetIds.\r\n * @public\r\n */\r\nexport interface ChangesetRangeArg extends IModelIdArg {\r\n /** the range of changesets desired. If is undefined, *all* changesets are returned. */\r\n readonly range?: ChangesetRange;\r\n}\r\n\r\n/** @internal */\r\nexport type CheckPointArg = DownloadRequest;\r\n\r\n/**\r\n * Arguments to create a new iModel in iModelHub\r\n * @public\r\n */\r\nexport interface CreateNewIModelProps extends IModelNameArg {\r\n readonly description?: string;\r\n readonly revision0?: LocalFileName;\r\n readonly noLocks?: true;\r\n}\r\n\r\n/**\r\n * Methods for accessing services of IModelHub from an iTwin.js backend.\r\n * Generally direct access to these methods should not be required, since higher-level apis are provided.\r\n * @beta\r\n */\r\nexport interface BackendHubAccess {\r\n /** Download all the changesets in the specified range. */\r\n downloadChangesets(arg: ChangesetRangeArg & { targetDir: LocalDirName }): Promise<ChangesetFileProps[]>;\r\n /** Download a single changeset. */\r\n downloadChangeset(arg: ChangesetArg & { targetDir: LocalDirName }): Promise<ChangesetFileProps>;\r\n /** Query the changeset properties given a ChangesetIndex */\r\n queryChangeset(arg: ChangesetArg): Promise<ChangesetProps>;\r\n /** Query an array of changeset properties given a range of ChangesetIndexes */\r\n queryChangesets(arg: ChangesetRangeArg): Promise<ChangesetProps[]>;\r\n /** push a changeset to iMOdelHub. Returns the newly pushed changeSet's index */\r\n pushChangeset(arg: IModelIdArg & { changesetProps: ChangesetFileProps }): Promise<ChangesetIndex>;\r\n /** Get the ChangesetProps of the most recent changeset */\r\n getLatestChangeset(arg: IModelIdArg): Promise<ChangesetProps>;\r\n /** Get the ChangesetProps for an IModelVersion */\r\n getChangesetFromVersion(arg: IModelIdArg & { version: IModelVersion }): Promise<ChangesetProps>;\r\n /** Get the ChangesetProps for a named version */\r\n getChangesetFromNamedVersion(arg: IModelIdArg & { versionName: string }): Promise<ChangesetProps>;\r\n\r\n /** Acquire a new briefcaseId for the supplied iModelId\r\n * @note usually there should only be one briefcase per iModel per user.\r\n */\r\n acquireNewBriefcaseId(arg: AcquireNewBriefcaseIdArg): Promise<BriefcaseId>;\r\n /** Release a briefcaseId. After this call it is illegal to generate changesets for the released briefcaseId. */\r\n releaseBriefcase(arg: BriefcaseIdArg): Promise<void>;\r\n\r\n /** get an array of the briefcases assigned to a user. */\r\n getMyBriefcaseIds(arg: IModelIdArg): Promise<BriefcaseId[]>;\r\n\r\n /**\r\n * download a v1 checkpoint\r\n * @internal\r\n */\r\n downloadV1Checkpoint(arg: CheckPointArg): Promise<ChangesetId>;\r\n\r\n /**\r\n * Get the access props for a V2 checkpoint. Returns undefined if no V2 checkpoint exists.\r\n * @internal\r\n */\r\n queryV2Checkpoint(arg: CheckpointProps): Promise<V2CheckpointAccessProps | undefined>;\r\n /**\r\n * download a v2 checkpoint\r\n * @internal\r\n */\r\n downloadV2Checkpoint(arg: CheckPointArg): Promise<ChangesetId>;\r\n\r\n /**\r\n * acquire one or more locks. Throws if unsuccessful. If *any* lock cannot be obtained, no locks are acquired\r\n * @internal\r\n */\r\n acquireLocks(arg: BriefcaseDbArg, locks: LockMap): Promise<void>;\r\n\r\n /**\r\n * Get the list of all held locks for a briefcase. This can be very expensive and is currently used only for tests.\r\n * @internal\r\n */\r\n queryAllLocks(arg: BriefcaseDbArg): Promise<LockProps[]>;\r\n\r\n /**\r\n * Release all currently held locks\r\n * @internal\r\n */\r\n releaseAllLocks(arg: BriefcaseDbArg): Promise<void>;\r\n\r\n /** Get the iModelId of an iModel by name. Undefined if no iModel with that name exists. */\r\n queryIModelByName(arg: IModelNameArg): Promise<GuidString | undefined>;\r\n\r\n /** create a new iModel. Returns the Guid of the newly created iModel */\r\n createNewIModel(arg: CreateNewIModelProps): Promise<GuidString>;\r\n\r\n /** delete an iModel */\r\n deleteIModel(arg: IModelIdArg & ITwinIdArg): Promise<void>;\r\n}\r\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackendLoggerCategory.d.ts","sourceRoot":"","sources":["../../src/BackendLoggerCategory.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;GAIG;AACH,oBAAY,qBAAqB;IAC/B,+DAA+D;IAC/D,aAAa,+BAA+B;IAE5C;;OAEG;IACH,SAAS,2BAA2B;IAEpC;;OAEG;IACH,QAAQ,0BAA0B;IAElC;;;;OAIG;IACH,IAAI,sBAAsB;IAE1B;;OAEG;IACH,UAAU,4BAA4B;IAEtC;;OAEG;IACH,iBAAiB,mCAAmC;IAEpD;;;OAGG;IACH,QAAQ,0BAA0B;IAElC;;OAEG;IACH,UAAU,4BAA4B;IAEtC;;OAEG;IACH,oBAAoB,sCAAsC;IAE1D;;OAEG;IACH,gBAAgB,kCAAkC;IAElD;;OAEG;IACH,YAAY,8BAA8B;IAE1C;;OAEG;IACH,OAAO,yBAAyB;IAEhC;;OAEG;IACH,eAAe,iCAAiC;IAChD;;OAEG;IACH,SAAS,2BAA2B;IAEpC;;;OAGG;IACH,kBAAkB,oCAAoC;IAEtD;;;OAGG;IACH,OAAO,yBAAyB;IAEhC;;;OAGG;IACH,SAAS,2BAA2B;CACrC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackendLoggerCategory.js","sourceRoot":"","sources":["../../src/BackendLoggerCategory.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;;GAIG;AACH,IAAY,qBAwFX;AAxFD,WAAY,qBAAqB;IAC/B,+DAA+D;IAC/D,qEAA4C,CAAA;IAE5C;;OAEG;IACH,6DAAoC,CAAA;IAEpC;;OAEG;IACH,2DAAkC,CAAA;IAElC;;;;OAIG;IACH,mDAA0B,CAAA;IAE1B;;OAEG;IACH,+DAAsC,CAAA;IAEtC;;OAEG;IACH,6EAAoD,CAAA;IAEpD;;;OAGG;IACH,2DAAkC,CAAA;IAElC;;OAEG;IACH,+DAAsC,CAAA;IAEtC;;OAEG;IACH,mFAA0D,CAAA;IAE1D;;OAEG;IACH,2EAAkD,CAAA;IAElD;;OAEG;IACH,mEAA0C,CAAA;IAE1C;;OAEG;IACH,yDAAgC,CAAA;IAEhC;;OAEG;IACH,yEAAgD,CAAA;IAChD;;OAEG;IACH,6DAAoC,CAAA;IAEpC;;;OAGG;IACH,+EAAsD,CAAA;IAEtD;;;OAGG;IACH,yDAAgC,CAAA;IAEhC;;;OAGG;IACH,6DAAoC,CAAA;AACtC,CAAC,EAxFW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAwFhC","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 Logging\r\n */\r\n\r\n/** Logger categories used by this package\r\n * @note All logger categories in this package start with the `core-backend` prefix.\r\n * @see [Logger]($bentley)\r\n * @public\r\n */\r\nexport enum BackendLoggerCategory {\r\n /** The logger category used by API related to authorization */\r\n Authorization = \"core-backend.Authorization\",\r\n\r\n /** The logger category used by the following classes:\r\n * - [[CodeSpecs]]\r\n */\r\n CodeSpecs = \"core-backend.CodeSpecs\",\r\n\r\n /** The logger category used by the [[DevTools]] class and related classes.\r\n * @internal\r\n */\r\n DevTools = \"core-backend.DevTools\",\r\n\r\n /** The logger category used by the following classes:\r\n * - [[ChangeSummaryManager]]\r\n * - [[ECDb]]\r\n * - [[ECSqlStatement]]\r\n */\r\n ECDb = \"core-backend.ECDb\",\r\n\r\n /** The logger category used by the following classes:\r\n * - [[Functional]]\r\n */\r\n Functional = \"core-backend.Functional\",\r\n\r\n /** The logger category used by the following classes:\r\n * - [[LinearReferencing]]\r\n */\r\n LinearReferencing = \"core-backend.LinearReferencing\",\r\n\r\n /** The logger category used by the following classes:\r\n * - BriefcaseManager\r\n * - [[IModelDb]]\r\n */\r\n IModelDb = \"core-backend.IModelDb\",\r\n\r\n /** The logger category used by the following classes:\r\n * - [[IModelHost]]\r\n */\r\n IModelHost = \"core-backend.IModelHost\",\r\n\r\n /** The logger category used by the following classes:\r\n * - TileRequestMemoizer\r\n */\r\n IModelTileRequestRpc = \"core-backend.IModelTileRequestRpc\",\r\n\r\n /** The logger category used by the following classes:\r\n * - IModelTileRpcImpl (Tile Uploading)\r\n */\r\n IModelTileUpload = \"core-backend.IModelTileUpload\",\r\n\r\n /** The logger category used by the following classes:\r\n * - [[Relationship]]\r\n */\r\n Relationship = \"core-backend.Relationship\",\r\n\r\n /** The logger category used by the following classes:\r\n * - [[Schemas]]\r\n */\r\n Schemas = \"core-backend.Schemas\",\r\n\r\n /** The logger category used by the following classes:\r\n * - [[PromiseMemoizer]]\r\n */\r\n PromiseMemoizer = \"core-backend.PromiseMemoizer\",\r\n /** The logger category used by the following classes:\r\n * - [[EventSink]]\r\n */\r\n EventSink = \"core-backend.EventSink\",\r\n\r\n /** The logger category used by the following classes:\r\n * - [[IModelSchemaLoader]]\r\n * @alpha\r\n */\r\n IModelSchemaLoader = \"core-backend.IModelSchemaLoader\",\r\n\r\n /** The logger category used by the following classes:\r\n * - [[iModels]]\r\n * @alpha\r\n */\r\n Editing = \"core-backend.Editing\",\r\n\r\n /** The logger category used by the following classes:\r\n * - [[NativeHost]], [[NativeAppStorage]]\r\n * @internal\r\n */\r\n NativeApp = \"core-backend.NativeApp\",\r\n}\r\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BisCoreSchema.d.ts","sourceRoot":"","sources":["../../src/BisCoreSchema.ts"],"names":[],"mappings":"AAIA;;GAEG;AAYH,OAAO,EAAE,MAAM,EAAW,MAAM,UAAU,CAAC;AAK3C;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,SAAQ,MAAM;IACvC,WAA2B,UAAU,IAAI,MAAM,CAAsB;IACrE,WAAkB,cAAc,IAAI,MAAM,CAAsH;IAEhK,gBAAgB;WACF,cAAc;CAqB7B"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BisCoreSchema.js","sourceRoot":"","sources":["../../src/BisCoreSchema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6BAA6B;AAC7B,0CAA0C;AAC1C,mDAAgD;AAChD,wCAAwC;AACxC,6CAA6C;AAC7C,sDAAsD;AACtD,6CAA8C;AAC9C,0CAA0C;AAC1C,oCAAoC;AACpC,0CAA0C;AAC1C,qCAA2C;AAC3C,wCAAwC;AACxC,4CAA4C;AAC5C,kDAAkD;AAElD;;;;;;;;;;GAUG;AACH,MAAa,aAAc,SAAQ,eAAM;IAChC,MAAM,KAAc,UAAU,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IAC9D,MAAM,KAAK,cAAc,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,2BAAc,CAAC,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,UAAU,eAAe,CAAC,CAAC,CAAC,CAAC;IAEhK,gBAAgB;IACT,MAAM,CAAC,cAAc;QAC1B,IAAI,IAAI,KAAK,gBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC;YACvD,OAAO;QAET,gBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,gBAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE7B,sHAAsH;QACtH;YACE,UAAU;YACV,SAAS;YACT,QAAQ;YACR,WAAW;YACX,OAAO;YACP,OAAO;YACP,UAAU;YACV,WAAW;YACX,iBAAiB;YACjB,eAAe;SAChB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,6BAAa,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;CACF;AA1BD,sCA0BC","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 Schema\n */\n\nimport * as path from \"path\";\nimport * as categoryMod from \"./Category\";\nimport { ClassRegistry } from \"./ClassRegistry\";\nimport * as elementMod from \"./Element\";\nimport * as aspectMod from \"./ElementAspect\";\nimport * as externalSourceMod from \"./ExternalSource\";\nimport { KnownLocations } from \"./IModelHost\";\nimport * as materialMod from \"./Material\";\nimport * as modelMod from \"./Model\";\nimport * as linkMod from \"./Relationship\";\nimport { Schema, Schemas } from \"./Schema\";\nimport * as textureMod from \"./Texture\";\nimport * as viewMod from \"./ViewDefinition\";\nimport * as displayStyleMod from \"./DisplayStyle\";\n\n/**\n * The [BisCore]($docs/bis/intro/schemas-domains.md) schema is the lowest level Schema in an iModel.\n *\n * It is automatically registered when [[IModelHost.startup]] is called.\n *\n * ** Example:**\n * ``` ts\n * [[include:BisCore.registerSchemaAndGetClass]]\n * ```\n * @public\n */\nexport class BisCoreSchema extends Schema {\n public static override get schemaName(): string { return \"BisCore\"; }\n public static get schemaFilePath(): string { return path.join(KnownLocations.nativeAssetsDir, \"ECSchemas\", \"Dgn\", `${BisCoreSchema.schemaName}.ecschema.xml`); }\n\n /** @internal */\n public static registerSchema() {\n if (this === Schemas.getRegisteredSchema(this.schemaName))\n return;\n\n Schemas.unregisterSchema(this.schemaName);\n Schemas.registerSchema(this);\n\n // this list should include all backend .ts files with implementations of Entity-based classes. Order does not matter.\n [\n elementMod,\n aspectMod,\n modelMod,\n categoryMod,\n viewMod,\n linkMod,\n textureMod,\n materialMod,\n externalSourceMod,\n displayStyleMod,\n ].forEach((module) => ClassRegistry.registerModule(module, this));\n }\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BriefcaseManager.d.ts","sourceRoot":"","sources":["../../src/BriefcaseManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EACL,WAAW,EAAE,UAAU,EAAmB,UAAU,EACrD,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EAAoB,cAAc,EAAsB,cAAc,EAA6C,mBAAmB,EACjJ,YAAY,EAAE,aAAa,EAAE,wBAAwB,EAAE,WAAW,EACnE,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAsC,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAM7D;;EAEE;AACF,MAAM,WAAW,sBAAuB,SAAQ,QAAQ,EAAE,wBAAwB;IAChF;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,8EAA8E;IAC9E,WAAW,EAAE,MAAM,CAAC;IACpB,8IAA8I;IAC9I,WAAW,CAAC,EAAE,IAAI,C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,CAAC,EAAE,EAAE,WAAW;IAIhD;;;OAGG;WACiB,qBAAqB,CAAC,GAAG,EAAE,wBAAwB,GAAG,OAAO,CAAC,WAAW,CAAC;IAI9F;;;;;;;;;;;;;;;;;;;;OAoBG;WACiB,iBAAiB,CAAC,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAwChG;;OAEG;WACW,6BAA6B,CAAC,QAAQ,EAAE,MAAM;IAK5D;;;OAGG;WACiB,gBAAgB,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxG;;;;;;OAMG;WACiB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAsC3G;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAUzB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAclC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAenC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;mBAajB,oBAAoB;IAWzC,gBAAgB;WACI,sBAAsB,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IA+B7F,4EAA4E;mBACvD,WAAW;IA0ChC;;OAEG;WACiB,aAAa,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAcvF,gBAAgB;WACF,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,WAAW;CAmBhE"}
|
|
@@ -142,8 +142,8 @@ class BriefcaseManager {
|
|
|
142
142
|
if (IModelJsFs_1.IModelJsFs.existsSync(fileName))
|
|
143
143
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.FileAlreadyExists, `Briefcase "${fileName}" already exists`);
|
|
144
144
|
const asOf = (_c = arg.asOf) !== null && _c !== void 0 ? _c : core_common_1.IModelVersion.latest().toJSON();
|
|
145
|
-
const changeset = await IModelHost_1.IModelHost.hubAccess.getChangesetFromVersion(
|
|
146
|
-
const checkpoint =
|
|
145
|
+
const changeset = await IModelHost_1.IModelHost.hubAccess.getChangesetFromVersion({ ...arg, version: core_common_1.IModelVersion.fromJSON(asOf) });
|
|
146
|
+
const checkpoint = { ...arg, changeset };
|
|
147
147
|
await CheckpointManager_1.CheckpointManager.downloadCheckpoint({ localFile: fileName, checkpoint, onProgress: arg.onProgress });
|
|
148
148
|
const fileSize = (_e = (_d = IModelJsFs_1.IModelJsFs.lstatSync(fileName)) === null || _d === void 0 ? void 0 : _d.size) !== null && _e !== void 0 ? _e : 0;
|
|
149
149
|
const response = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BriefcaseManager.js","sourceRoot":"","sources":["../../src/BriefcaseManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qCAAqC;AAErC,6BAA6B;AAC7B,sDAE6B;AAC7B,oDAG4B;AAC5B,gEAA2D;AAE3D,mEAAgE;AAChE,2DAA2F;AAC3F,yCAA6D;AAC7D,6CAA0C;AAC1C,6CAA0C;AAE1C,MAAM,cAAc,GAAG,6CAAqB,CAAC,QAAQ,CAAC;AA6CtD;;GAEG;AACH,MAAa,gBAAgB;IAC3B,wFAAwF;IACjF,MAAM,CAAC,aAAa,CAAC,QAAoB,IAAkB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE/G,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAAC,QAAoB,IAAkB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAErI,gBAAgB;IACT,MAAM,CAAC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AM,gBAAgB,CAAC,sBAAsB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;gBACvD,OAAO,MAAM,gBAAgB,CAAC,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;aACpD;YAAC,OAAO,GAAQ,EAAE;gBACjB,IAAI,UAAU,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,KAAK,8BAAe,CAAC,cAAc;oBACzE,MAAM,CAAC,GAAG,CAAC,CAAC;gBACd,MAAM,CAAC,MAAA,GAAG,CAAC,eAAe,mCAAI,yBAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACjE;SACF;IACH,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,QAAQ,CAAC,MAAgB,EAAE,QAAsB;;QAE7D,MAAM,cAAc,GAAG,IAAI,iCAAc,CACvC,4BAA4B,EAC5B,sCAAsC,EAAE,wBAAwB;QAChE,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,QAAQ,EACf,MAAA,MAAM,CAAC,SAAS,0CAAE,EAAE,CACrB,CAAC;QACF,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI;YACrB,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,uBAAU,CAAC,aAAa;YACvC,kBAAkB,EAAE,uBAAU,CAAC,kBAAkB;YACjD,SAAS,EAAE,uBAAU,CAAC,SAAS;YAC/B,WAAW,EAAE,EAAE,EAAE,uDAAuD;SACzE,CAAC;QAEF,uBAAU,CAAC,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,8DAA8D;IAC9H,CAAC;;AAnaH,4CAoaC;AAvZgB,iCAAgB,GAAG,YAAY,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 iModels\r\n */\r\n\r\n// cspell:ignore cset csets ecchanges\r\n\r\nimport * as path from \"path\";\r\nimport {\r\n AccessToken, BeDuration, ChangeSetStatus, GuidString, IModelHubStatus, IModelStatus, Logger, OpenMode,\r\n} from \"@itwin/core-bentley\";\r\nimport {\r\n BriefcaseId, BriefcaseIdValue, BriefcaseProps, ChangesetFileProps, ChangesetIndex, ChangesetType, IModelError, IModelVersion, LocalBriefcaseProps,\r\n LocalDirName, LocalFileName, RequestNewBriefcaseProps, RpcActivity,\r\n} from \"@itwin/core-common\";\r\nimport { TelemetryEvent } from \"@bentley/telemetry-client\";\r\nimport { AcquireNewBriefcaseIdArg } from \"./BackendHubAccess\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { CheckpointManager, CheckpointProps, ProgressFunction } from \"./CheckpointManager\";\r\nimport { BriefcaseDb, IModelDb, TokenArg } from \"./IModelDb\";\r\nimport { IModelHost } from \"./IModelHost\";\r\nimport { IModelJsFs } from \"./IModelJsFs\";\r\n\r\nconst loggerCategory = BackendLoggerCategory.IModelDb;\r\n\r\n/** The argument for [[BriefcaseManager.downloadBriefcase]]\r\n * @public\r\n*/\r\nexport interface RequestNewBriefcaseArg extends TokenArg, RequestNewBriefcaseProps {\r\n /** If present, a function called periodically during the download to indicate progress.\r\n * @note return non-zero from this function to abort the download.\r\n */\r\n onProgress?: ProgressFunction;\r\n}\r\n\r\n/**\r\n * Parameters for pushing changesets to iModelHub\r\n * @public\r\n */\r\nexport interface PushChangesArgs extends TokenArg {\r\n /** A description of the changes. This is visible on the iModel's timeline. */\r\n description: string;\r\n /** if present, the locks are retained after the operation. Otherwise, *all* locks are released after the changeset is successfully pushed. */\r\n retainLocks?: true;\r\n /** number of times to retry pull/merge if other users are pushing at the same time. Default is 5 */\r\n mergeRetryCount?: number;\r\n /** delay to wait between pull/merge retry attempts. Default is 3 seconds */\r\n mergeRetryDelay?: BeDuration;\r\n /** the number of time to attempt to retry to push the changeset upon failure. Default is 3 */\r\n pushRetryCount?: number;\r\n /** The delay to wait between retry attempts on failed pushes. Default is 3 seconds. */\r\n pushRetryDelay?: BeDuration;\r\n}\r\n\r\n/**\r\n * Specifies a specific index for pulling changes.\r\n * @public\r\n */\r\nexport interface ToChangesetArgs extends TokenArg {\r\n /** The last ChangesetIndex to pull. If not present, pull *all* newer changesets. */\r\n toIndex?: ChangesetIndex;\r\n}\r\n\r\n/** Arguments for [[BriefcaseManager.pullAndApplyChangesets]]\r\n * @public\r\n */\r\nexport type PullChangesArgs = ToChangesetArgs;\r\n\r\n/** Manages downloading Briefcases and downloading and uploading changesets.\r\n * @public\r\n */\r\nexport class BriefcaseManager {\r\n /** Get the local path of the folder storing files that are associated with an imodel */\r\n public static getIModelPath(iModelId: GuidString): LocalDirName { return path.join(this._cacheDir, iModelId); }\r\n\r\n /** @internal */\r\n public static getChangeSetsPath(iModelId: GuidString): LocalDirName { return path.join(this.getIModelPath(iModelId), \"changesets\"); }\r\n\r\n /** @internal */\r\n public static getChangeCachePathName(iModelId: GuidString): LocalFileName { return path.join(this.getIModelPath(iModelId), iModelId.concat(\".bim.ecchanges\")); }\r\n\r\n /** @internal */\r\n public static getChangedElementsPathName(iModelId: GuidString): LocalFileName { return path.join(this.getIModelPath(iModelId), iModelId.concat(\".bim.elems\")); }\r\n\r\n private static _briefcaseSubDir = \"briefcases\";\r\n /** @internal */\r\n public static getBriefcaseBasePath(iModelId: GuidString): LocalDirName {\r\n return path.join(this.getIModelPath(iModelId), this._briefcaseSubDir);\r\n }\r\n\r\n /** Get the name of the local file that holds, or will hold, a local briefcase in the briefcase cache.\r\n * @note The briefcase cache is a local directory established in the call to [[BriefcaseManager.initialize]].\r\n * @param briefcase the iModelId and BriefcaseId for the filename\r\n * @see getIModelPath\r\n */\r\n public static getFileName(briefcase: BriefcaseProps): LocalFileName {\r\n return path.join(this.getBriefcaseBasePath(briefcase.iModelId), `${briefcase.briefcaseId}.bim`);\r\n }\r\n\r\n private static setupCacheDir(cacheRootDir: LocalDirName) {\r\n this._cacheDir = cacheRootDir;\r\n IModelJsFs.recursiveMkDirSync(this._cacheDir);\r\n }\r\n\r\n private static _initialized?: boolean;\r\n /** Initialize BriefcaseManager\r\n * @param cacheRootDir The root directory for storing a cache of downloaded briefcase files on the local computer.\r\n * Briefcases are stored relative to this path in sub-folders organized by IModelId.\r\n * @note It is perfectly valid for applications to store briefcases in locations they manage, outside of `cacheRootDir`.\r\n */\r\n public static initialize(cacheRootDir: LocalDirName) {\r\n if (this._initialized)\r\n return;\r\n this.setupCacheDir(cacheRootDir);\r\n IModelHost.onBeforeShutdown.addOnce(this.finalize, this);\r\n this._initialized = true;\r\n }\r\n\r\n private static finalize() {\r\n this._initialized = false;\r\n }\r\n\r\n /** Get a list of the local briefcase held in the briefcase cache, optionally for a single iModelId\r\n * @param iModelId if present, only briefcases for this iModelId are returned, otherwise all briefcases for all\r\n * iModels in the briefcase cache are returned.\r\n * @note usually there should only be one briefcase per iModel.\r\n */\r\n public static getCachedBriefcases(iModelId?: GuidString): LocalBriefcaseProps[] {\r\n const briefcaseList: LocalBriefcaseProps[] = [];\r\n const iModelDirs = IModelJsFs.readdirSync(this._cacheDir);\r\n for (const iModelDir of iModelDirs) {\r\n if (iModelId && iModelId !== iModelDir)\r\n continue;\r\n const bcPath = path.join(this._cacheDir, iModelDir, this._briefcaseSubDir);\r\n try {\r\n if (!IModelJsFs.lstatSync(bcPath)?.isDirectory)\r\n continue;\r\n } catch (err) {\r\n continue;\r\n }\r\n\r\n const briefcases = IModelJsFs.readdirSync(bcPath);\r\n for (const briefcaseName of briefcases) {\r\n if (briefcaseName.endsWith(\".bim\")) {\r\n try {\r\n const fileName = path.join(bcPath, briefcaseName);\r\n const fileSize = IModelJsFs.lstatSync(fileName)?.size ?? 0;\r\n const db = IModelDb.openDgnDb({ path: fileName }, OpenMode.Readonly);\r\n briefcaseList.push({ fileName, iTwinId: db.getITwinId(), iModelId: db.getIModelId(), briefcaseId: db.getBriefcaseId(), changeset: db.getCurrentChangeset(), fileSize });\r\n db.closeIModel();\r\n } catch (_err) {\r\n }\r\n }\r\n }\r\n }\r\n return briefcaseList;\r\n }\r\n\r\n private static _cacheDir: LocalDirName;\r\n /** Get the root directory for the briefcase cache */\r\n public static get cacheDir(): LocalDirName { return this._cacheDir; }\r\n\r\n /** Determine whether the supplied briefcaseId is in the range of assigned BriefcaseIds issued by iModelHub\r\n * @note this does check whether the id was actually acquired by the caller.\r\n */\r\n public static isValidBriefcaseId(id: BriefcaseId) {\r\n return id >= BriefcaseIdValue.FirstValid && id <= BriefcaseIdValue.LastValid;\r\n }\r\n\r\n /** Acquire a new briefcaseId from iModelHub for the supplied iModelId\r\n * @note usually there should only be one briefcase per iModel per user. If a single user acquires more than one briefcaseId,\r\n * it's a good idea to supply different aliases for each of them.\r\n */\r\n public static async acquireNewBriefcaseId(arg: AcquireNewBriefcaseIdArg): Promise<BriefcaseId> {\r\n return IModelHost.hubAccess.acquireNewBriefcaseId(arg);\r\n }\r\n\r\n /** Download a new briefcase from iModelHub for the supplied iModelId.\r\n *\r\n * The process of downloading a briefcase file involves first obtaining a valid BriefcaseId from IModelHub. For each IModel, IModelHub maintains\r\n * a list of BriefcaseIds assigned to users, to ensure that no two users have the same BriefcaseId. Typically a given user will have only\r\n * one briefcase on their machine for a given iModelId. Rarely, it may be necessary to use more than one briefcase to make isolated independent sets of changes,\r\n * but that is exceedingly complicated and rare. If no BriefcaseId is supplied, a new one is acquired from iModelHub.\r\n *\r\n * Then, a Checkpoint file (as of a ChangeSetId, typically \"Latest\") is downloaded from IModelHub. After the download completes,\r\n * the briefcaseId in the local file is changed to acquired briefcaseId, changing the checkpoint file into a briefcase file.\r\n *\r\n * Each of these steps requires a valid `AuthorizedClientRequestContext` to provide the user's credentials for the requests.\r\n *\r\n * @param request The properties that specify the briefcase file to be downloaded.\r\n * @returns The properties of the local briefcase in a Promise that is resolved after the briefcase is fully downloaded and the briefcase file is ready for use via [BriefcaseDb.open]($backend).\r\n * @note The location of the local file to hold the briefcase is arbitrary and may be any valid *local* path on your machine. If you don't supply\r\n * a filename, the local briefcase cache is used by creating a file with the briefcaseId as its name in the `briefcases` folder below the folder named\r\n * for the IModelId.\r\n * @note *It is invalid to edit briefcases on a shared network drive* and that is a sure way to corrupt your briefcase (see https://www.sqlite.org/howtocorrupt.html)\r\n * @note The special briefcaseId [[BriefcaseIdValue.Unassigned]] (0) can be used for a local briefcase that can accept changesets but may not be generate changesets.\r\n * @see CheckpointManager.downloadCheckpoint\r\n */\r\n public static async downloadBriefcase(arg: RequestNewBriefcaseArg): Promise<LocalBriefcaseProps> {\r\n const briefcaseId = arg.briefcaseId = arg.briefcaseId ?? await this.acquireNewBriefcaseId(arg);\r\n const fileName = arg.fileName ?? this.getFileName(arg as BriefcaseProps);\r\n\r\n if (IModelJsFs.existsSync(fileName))\r\n throw new IModelError(IModelStatus.FileAlreadyExists, `Briefcase \"${fileName}\" already exists`);\r\n\r\n const asOf = arg.asOf ?? IModelVersion.latest().toJSON();\r\n const changeset = await IModelHost.hubAccess.getChangesetFromVersion({ ...arg, version: IModelVersion.fromJSON(asOf) });\r\n const checkpoint: CheckpointProps = { ...arg, changeset };\r\n\r\n await CheckpointManager.downloadCheckpoint({ localFile: fileName, checkpoint, onProgress: arg.onProgress });\r\n const fileSize = IModelJsFs.lstatSync(fileName)?.size ?? 0;\r\n const response: LocalBriefcaseProps = {\r\n fileName,\r\n briefcaseId,\r\n iModelId: arg.iModelId,\r\n iTwinId: arg.iTwinId,\r\n changeset: checkpoint.changeset,\r\n fileSize,\r\n };\r\n\r\n // now open the downloaded checkpoint and reset its BriefcaseId\r\n const nativeDb = new IModelHost.platform.DgnDb();\r\n try {\r\n nativeDb.openIModel(fileName, OpenMode.ReadWrite);\r\n } catch (err: any) {\r\n throw new IModelError(err.errorNumber, `Could not open downloaded briefcase for write access: ${fileName}, err=${err.message}`);\r\n }\r\n try {\r\n nativeDb.resetBriefcaseId(briefcaseId);\r\n if (nativeDb.getCurrentChangeset().id !== checkpoint.changeset.id)\r\n throw new IModelError(IModelStatus.InvalidId, `Downloaded briefcase has wrong changesetId: ${fileName}`);\r\n } finally {\r\n nativeDb.saveChanges();\r\n nativeDb.closeIModel();\r\n }\r\n return response;\r\n }\r\n\r\n /** Deletes change sets of an iModel from local disk\r\n * @internal\r\n */\r\n public static deleteChangeSetsFromLocalDisk(iModelId: string) {\r\n const changeSetsPath = BriefcaseManager.getChangeSetsPath(iModelId);\r\n BriefcaseManager.deleteFolderAndContents(changeSetsPath);\r\n }\r\n\r\n /** Releases a briefcaseId from iModelHub. After this call it is illegal to generate changesets for the released briefcaseId.\r\n * @note generally, this method should not be called directly. Instead use [[deleteBriefcaseFiles]].\r\n * @see deleteBriefcaseFiles\r\n */\r\n public static async releaseBriefcase(accessToken: AccessToken, briefcase: BriefcaseProps): Promise<void> {\r\n if (this.isValidBriefcaseId(briefcase.briefcaseId))\r\n return IModelHost.hubAccess.releaseBriefcase({ accessToken, iModelId: briefcase.iModelId, briefcaseId: briefcase.briefcaseId });\r\n }\r\n\r\n /**\r\n * Delete and clean up a briefcase and all of its associated files. First, this method opens the supplied filename to determine its briefcaseId.\r\n * Then, if a requestContext is supplied, it releases a BriefcaseId from iModelHub. Finally it deletes the local briefcase file and\r\n * associated files (that is, all files in the same directory that start with the briefcase name).\r\n * @param filePath the full file name of the Briefcase to delete\r\n * @param accessToken for releasing the briefcaseId\r\n */\r\n public static async deleteBriefcaseFiles(filePath: LocalFileName, accessToken?: AccessToken): Promise<void> {\r\n try {\r\n const db = IModelDb.openDgnDb({ path: filePath }, OpenMode.Readonly);\r\n const briefcase: BriefcaseProps = {\r\n iModelId: db.getIModelId(),\r\n briefcaseId: db.getBriefcaseId(),\r\n };\r\n db.closeIModel();\r\n\r\n if (accessToken) {\r\n if (this.isValidBriefcaseId(briefcase.briefcaseId)) {\r\n await BriefcaseManager.releaseBriefcase(accessToken, briefcase);\r\n }\r\n }\r\n } catch (error) {\r\n }\r\n\r\n // first try to delete the briefcase file\r\n try {\r\n if (IModelJsFs.existsSync(filePath))\r\n IModelJsFs.unlinkSync(filePath);\r\n } catch (err) {\r\n throw new IModelError(IModelStatus.BadRequest, `cannot delete briefcase file ${err}`);\r\n }\r\n\r\n // next, delete all files that start with the briefcase's filePath (e.g. \"a.bim-locks\", \"a.bim-journal\", etc.)\r\n try {\r\n const dirName = path.dirname(filePath);\r\n const fileName = path.basename(filePath);\r\n const files = IModelJsFs.readdirSync(dirName);\r\n for (const file of files) {\r\n if (file.startsWith(fileName))\r\n this.deleteFile(path.join(dirName, file)); // don't throw on error\r\n }\r\n } catch (err) {\r\n }\r\n }\r\n\r\n /** Deletes a file\r\n * - Does not throw any error, but logs it instead\r\n * - Returns true if the delete was successful\r\n */\r\n private static deleteFile(pathname: LocalFileName): boolean {\r\n try {\r\n IModelJsFs.unlinkSync(pathname);\r\n } catch (error) {\r\n Logger.logError(loggerCategory, `Cannot delete file ${pathname}, ${error}`);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Deletes a folder, checking if it's empty\r\n * - Does not throw any error, but logs it instead\r\n * - Returns true if the delete was successful\r\n */\r\n private static deleteFolderIfEmpty(folderPathname: LocalDirName): boolean {\r\n try {\r\n const files = IModelJsFs.readdirSync(folderPathname);\r\n if (files.length > 0)\r\n return false;\r\n\r\n IModelJsFs.rmdirSync(folderPathname);\r\n } catch (error) {\r\n Logger.logError(loggerCategory, `Cannot delete folder: ${folderPathname}`);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Deletes the contents of a folder, but not the folder itself\r\n * - Does not throw any errors, but logs them.\r\n * - returns true if the delete was successful.\r\n */\r\n private static deleteFolderContents(folderPathname: LocalDirName): boolean {\r\n if (!IModelJsFs.existsSync(folderPathname))\r\n return false;\r\n\r\n let status = true;\r\n const files = IModelJsFs.readdirSync(folderPathname);\r\n for (const file of files) {\r\n const curPath = path.join(folderPathname, file);\r\n const locStatus = (IModelJsFs.lstatSync(curPath)!.isDirectory) ? BriefcaseManager.deleteFolderAndContents(curPath) : BriefcaseManager.deleteFile(curPath);\r\n if (!locStatus)\r\n status = false;\r\n }\r\n return status;\r\n }\r\n\r\n /** Deletes a folder and all it's contents.\r\n * - Does not throw any errors, but logs them.\r\n * - returns true if the delete was successful.\r\n */\r\n private static deleteFolderAndContents(folderPathname: LocalDirName): boolean {\r\n if (!IModelJsFs.existsSync(folderPathname))\r\n return true;\r\n\r\n let status = false;\r\n status = BriefcaseManager.deleteFolderContents(folderPathname);\r\n if (!status)\r\n return false;\r\n\r\n status = BriefcaseManager.deleteFolderIfEmpty(folderPathname);\r\n return status;\r\n }\r\n\r\n private static async applySingleChangeset(db: IModelDb, changesetFile: ChangesetFileProps) {\r\n if (changesetFile.changesType === ChangesetType.Schema)\r\n db.clearCaches(); // for schema changesets, statement caches may become invalid. Do this *before* applying, in case db needs to be closed (open statements hold db open.)\r\n\r\n db.nativeDb.applyChangeset(changesetFile);\r\n db.changeset = db.nativeDb.getCurrentChangeset();\r\n\r\n // we're done with this changeset, delete it\r\n IModelJsFs.removeSync(changesetFile.pathname);\r\n }\r\n\r\n /** @internal */\r\n public static async pullAndApplyChangesets(db: IModelDb, arg: ToChangesetArgs): Promise<void> {\r\n if (!db.isOpen || db.nativeDb.isReadonly()) // don't use db.isReadonly - we reopen the file writable just for this operation but db.isReadonly is still true\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"Briefcase must be open ReadWrite to process change sets\");\r\n\r\n let currentIndex = db.changeset.index;\r\n if (currentIndex === undefined)\r\n currentIndex = (await IModelHost.hubAccess.queryChangeset({ accessToken: arg.accessToken, iModelId: db.iModelId, changeset: { id: db.changeset.id } })).index;\r\n\r\n const reverse = (arg.toIndex && arg.toIndex < currentIndex) ? true : false;\r\n\r\n // Download change sets\r\n const changesets = await IModelHost.hubAccess.downloadChangesets({\r\n accessToken: arg.accessToken,\r\n iModelId: db.iModelId,\r\n range: { first: reverse ? arg.toIndex! + 1 : currentIndex + 1, end: reverse ? currentIndex : arg.toIndex },\r\n targetDir: BriefcaseManager.getChangeSetsPath(db.iModelId),\r\n });\r\n\r\n if (changesets.length === 0)\r\n return; // nothing to apply\r\n\r\n if (reverse)\r\n changesets.reverse();\r\n\r\n for (const changeset of changesets)\r\n await this.applySingleChangeset(db, changeset);\r\n\r\n // notify listeners\r\n db.notifyChangesetApplied();\r\n }\r\n\r\n /** create a changeset from the current changes, and push it to iModelHub */\r\n private static async pushChanges(db: BriefcaseDb, arg: PushChangesArgs): Promise<void> {\r\n const changesetProps = db.nativeDb.startCreateChangeset();\r\n changesetProps.briefcaseId = db.briefcaseId;\r\n changesetProps.description = arg.description;\r\n changesetProps.size = IModelJsFs.lstatSync(changesetProps.pathname)?.size;\r\n if (!changesetProps.size) // either undefined or 0 means error\r\n throw new IModelError(IModelStatus.NoContent, \"error creating changeset\");\r\n\r\n let retryCount = arg.pushRetryCount ?? 3;\r\n while (true) {\r\n try {\r\n const accessToken = await IModelHost.getAccessToken();\r\n const index = await IModelHost.hubAccess.pushChangeset({ accessToken, iModelId: db.iModelId, changesetProps });\r\n db.nativeDb.completeCreateChangeset({ index });\r\n db.changeset = db.nativeDb.getCurrentChangeset();\r\n if (!arg.retainLocks)\r\n await IModelHost.hubAccess.releaseAllLocks(db);\r\n\r\n return;\r\n } catch (err: any) {\r\n const shouldRetry = () => {\r\n if (retryCount-- <= 0)\r\n return false;\r\n switch (err.errorNumber) {\r\n case IModelHubStatus.AnotherUserPushing:\r\n case IModelHubStatus.DatabaseTemporarilyLocked:\r\n case IModelHubStatus.OperationFailed:\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n if (!shouldRetry()) {\r\n db.nativeDb.abandonCreateChangeset();\r\n throw err;\r\n }\r\n } finally {\r\n IModelJsFs.removeSync(changesetProps.pathname);\r\n }\r\n }\r\n }\r\n\r\n /** Pull/merge (if necessary), then push all local changes as a changeset. Called by [[BriefcaseDb.pushChanges]]\r\n * @internal\r\n */\r\n public static async pullMergePush(db: BriefcaseDb, arg: PushChangesArgs): Promise<void> {\r\n let retryCount = arg.mergeRetryCount ?? 5;\r\n while (true) {\r\n try {\r\n await BriefcaseManager.pullAndApplyChangesets(db, arg);\r\n return await BriefcaseManager.pushChanges(db, arg);\r\n } catch (err: any) {\r\n if (retryCount-- <= 0 || err.errorNumber !== IModelHubStatus.PullIsRequired)\r\n throw (err);\r\n await (arg.mergeRetryDelay ?? BeDuration.fromSeconds(3)).wait();\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static logUsage(imodel: IModelDb, activity?: RpcActivity) {\r\n\r\n const telemetryEvent = new TelemetryEvent(\r\n \"core-backend - Open iModel\",\r\n \"7a6424d1-2114-4e89-b13b-43670a38ccd4\", // Feature: \"iModel Use\"\r\n imodel.iTwinId,\r\n imodel.iModelId,\r\n imodel.changeset?.id,\r\n );\r\n activity = activity ?? {\r\n activityId: \"\",\r\n applicationId: IModelHost.applicationId,\r\n applicationVersion: IModelHost.applicationVersion,\r\n sessionId: IModelHost.sessionId,\r\n accessToken: \"\", // IModelHost.getAccessToken(); ACCESS_TOKEN_NEEDS_WORK\r\n };\r\n\r\n IModelHost.telemetry.postTelemetry(activity, telemetryEvent); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }\r\n}\r\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Category.d.ts","sourceRoot":"","sources":["../../src/Category.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAQ,UAAU,EAAa,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACQ,aAAa,EAAE,IAAI,EAAE,cAAc,EAAY,YAAY,EAAE,IAAI,EAAE,qBAAqB,EAAE,gBAAgB,EACxH,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;IA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iBAAiB,EAAE,IAAI,CAAC,CAAC;QAChE,MAAM,UAAU,GAAG,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC7D,QAAQ,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;QACjD,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AA7DD,0CA6DC","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 Categories\n */\n\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\nimport {\n BisCodeSpec, CategoryProps, Code, CodeScopeProps, CodeSpec, ElementProps, Rank, SubCategoryAppearance, SubCategoryProps,\n} from \"@itwin/core-common\";\nimport { DefinitionElement } from \"./Element\";\nimport { IModelDb } from \"./IModelDb\";\nimport { CategoryOwnsSubCategories } from \"./NavigationRelationship\";\n\n/** Defines the appearance for graphics in Geometric elements\n * @public\n */\nexport class SubCategory extends DefinitionElement {\n /** @internal */\n public static override get className(): string { return \"SubCategory\"; }\n /** The Appearance parameters for this SubCategory */\n public appearance: SubCategoryAppearance;\n /** Optional description of this SubCategory. */\n public description?: string;\n\n /** @internal */\n public constructor(props: SubCategoryProps, iModel: IModelDb) {\n super(props, iModel);\n this.appearance = new SubCategoryAppearance(props.appearance);\n this.description = JsonUtils.asString(props.description);\n }\n\n /** @internal */\n public override toJSON(): SubCategoryProps {\n const val = super.toJSON() as SubCategoryProps;\n val.appearance = this.appearance.toJSON();\n if (this.description && this.description.length > 0)\n val.description = this.description;\n return val;\n }\n\n /** Get the SubCategory's name (its Code value). */\n public getSubCategoryName(): string { return this.code.value; }\n /** Get the Id of the SubCategory. */\n public getSubCategoryId(): Id64String { return this.id; }\n /** Get the Id of this SubCategory's parent Category. */\n public getCategoryId(): Id64String { return this.parent ? this.parent.id : Id64.invalid; }\n /** Check if this is the default SubCategory of its parent Category. */\n public get isDefaultSubCategory(): boolean { return IModelDb.getDefaultSubCategoryId(this.getCategoryId()) === this.getSubCategoryId(); }\n\n /** Create a Code for a SubCategory given a name that is meant to be unique within the scope of the specified parent Category.\n * @param iModel The IModel\n * @param parentCategoryId The Id of the parent Category that owns the SubCategory and provides the scope for its name.\n * @param codeValue The name of the SubCategory\n */\n public static createCode(iModel: IModelDb, parentCategoryId: CodeScopeProps, codeValue: string): Code {\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.subCategory);\n return new Code({ spec: codeSpec.id, scope: parentCategoryId, value: codeValue });\n }\n\n /** Create a new SubCategory\n * @param iModelDb The iModel\n * @param parentCategoryId Create the new SubCategory as a child of this [[Category]]\n * @param name The name of the SubCategory\n * @param appearance The appearance settings to use for this SubCategory\n * @returns The newly constructed SubCategory element.\n * @throws [[IModelError]] if unable to create the element.\n */\n public static create(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): SubCategory {\n if (appearance instanceof SubCategoryAppearance)\n appearance = appearance.toJSON();\n\n const parentCategory = iModelDb.elements.getElement<Category>(parentCategoryId);\n const subCategoryProps: SubCategoryProps = {\n classFullName: this.classFullName,\n model: parentCategory.model,\n parent: new CategoryOwnsSubCategories(parentCategoryId),\n code: this.createCode(iModelDb, parentCategoryId, name),\n appearance,\n };\n return new SubCategory(subCategoryProps, iModelDb);\n }\n\n /** Insert a new SubCategory\n * @param iModelDb Insert into this iModel\n * @param parentCategoryId Insert the new SubCategory as a child of this Category\n * @param name The name of the SubCategory\n * @param appearance The appearance settings to use for this SubCategory\n * @returns The Id of the newly inserted SubCategory element.\n * @throws [[IModelError]] if unable to insert the element.\n */\n public static insert(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String {\n const subCategory = this.create(iModelDb, parentCategoryId, name, appearance);\n return iModelDb.elements.insertElement(subCategory);\n }\n}\n\n/** A Category element is the target of the `category` member of [[GeometricElement]].\n * @public\n */\nexport class Category extends DefinitionElement implements CategoryProps {\n /** @internal */\n public static override get className(): string { return \"Category\"; }\n public rank: Rank = Rank.User;\n public description?: string;\n\n /** @internal */\n public constructor(props: CategoryProps, iModel: IModelDb) {\n super(props, iModel);\n this.rank = JsonUtils.asInt(props.rank);\n this.description = JsonUtils.asString(props.description);\n }\n\n /** @internal */\n public override toJSON(): CategoryProps {\n const val = super.toJSON() as CategoryProps;\n val.rank = this.rank;\n if (this.description && this.description.length > 0)\n val.description = this.description;\n return val;\n }\n\n /** Get the Id of the default SubCategory for this Category. */\n public myDefaultSubCategoryId(): Id64String { return IModelDb.getDefaultSubCategoryId(this.id); }\n\n /** Set the appearance of the default SubCategory for this Category */\n public setDefaultAppearance(props: SubCategoryAppearance.Props | SubCategoryAppearance): void {\n if (props instanceof SubCategoryAppearance)\n props = props.toJSON();\n\n const subCat = this.iModel.elements.getElement<SubCategory>(this.myDefaultSubCategoryId());\n subCat.appearance = new SubCategoryAppearance(props);\n this.iModel.elements.updateElement(subCat);\n }\n}\n\n/** Categorizes 2d GeometricElements.\n * @public\n */\nexport class DrawingCategory extends Category {\n /** @internal */\n public static override get className(): string { return \"DrawingCategory\"; }\n\n /** Construct a DrawingCategory\n * @param opts The properties of the new DrawingCategory\n * @param iModel The IModelDb where the DrawingCategory may be inserted.\n * @internal\n */\n public constructor(opts: ElementProps, iModel: IModelDb) { super(opts, iModel); }\n\n /** Get the name of the CodeSpec that is used by DrawingCategory objects. */\n public static getCodeSpecName(): string { return BisCodeSpec.drawingCategory; }\n\n /** Looks up the CategoryId of a DrawingCategory by model and name */\n public static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined {\n const code: Code = DrawingCategory.createCode(iModel, scopeModelId, categoryName);\n return iModel.elements.queryElementIdByCode(code);\n }\n\n /** Create a Code for a DrawingCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.\n * @param iModel The IModel\n * @param scopeModelId The Id of the DefinitionModel that contains the DrawingCategory and provides the scope for its name.\n * @param codeValue The name of the category\n * @return A drawing category Code\n */\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(DrawingCategory.getCodeSpecName());\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\n }\n\n /** Create a new DrawingCategory\n * @param iModelDb The iModel\n * @param definitionModelId The [[DefinitionModel]]\n * @param name The name of the DrawingCategory\n * @returns The newly constructed DrawingCategory element.\n * @throws [[IModelError]] if unable to create the element.\n */\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): DrawingCategory {\n const categoryProps: CategoryProps = {\n classFullName: this.classFullName,\n model: definitionModelId,\n code: this.createCode(iModelDb, definitionModelId, name),\n isPrivate: false,\n };\n return new DrawingCategory(categoryProps, iModelDb);\n }\n\n /** Insert a new DrawingCategory\n * @param iModelDb Insert into this iModel\n * @param definitionModelId Insert the new DrawingCategory into this [[DefinitionModel]]\n * @param name The name of the DrawingCategory\n * @param defaultAppearance The appearance settings to use for the default SubCategory of this DrawingCategory\n * @returns The Id of the newly inserted DrawingCategory element.\n * @throws [[IModelError]] if unable to insert the element.\n */\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String {\n const category = this.create(iModelDb, definitionModelId, name);\n const elements = iModelDb.elements;\n const categoryId = elements.insertElement(category);\n category.setDefaultAppearance(defaultAppearance);\n return categoryId;\n }\n}\n\n/** Categorizes SpatialElements. See [how to create a SpatialCategory]$(docs/learning/backend/CreateElements.md#SpatialCategory).\n * @public\n */\nexport class SpatialCategory extends Category {\n /** @internal */\n public static override get className(): string { return \"SpatialCategory\"; }\n /** Construct a SpatialCategory\n * @param opts The properties of the new SpatialCategory\n * @param iModel The IModelDb where the SpatialCategory may be inserted.\n * @internal\n */\n public constructor(opts: ElementProps, iModel: IModelDb) { super(opts, iModel); }\n\n /** Get the name of the CodeSpec that is used by SpatialCategory objects. */\n public static getCodeSpecName(): string { return BisCodeSpec.spatialCategory; }\n\n /** Looks up the CategoryId of a SpatialCategory by model and name */\n public static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined {\n const code: Code = SpatialCategory.createCode(iModel, scopeModelId, categoryName);\n return iModel.elements.queryElementIdByCode(code);\n }\n\n /** Create a Code for a SpatialCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.\n * @param iModel The IModel\n * @param scopeModelId The Id of the DefinitionModel that contains the SpatialCategory and provides the scope for its name.\n * @param codeValue The name of the category\n * @return A spatial category Code\n */\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(SpatialCategory.getCodeSpecName());\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\n }\n\n /** Create a new SpatialCategory\n * @param iModelDb The iModel\n * @param definitionModelId The [[DefinitionModel]]\n * @param name The name/CodeValue of the SpatialCategory\n * @returns The newly constructed SpatialCategory element.\n * @throws [[IModelError]] if unable to create the element.\n */\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): SpatialCategory {\n const categoryProps: CategoryProps = {\n classFullName: this.classFullName,\n model: definitionModelId,\n code: this.createCode(iModelDb, definitionModelId, name),\n isPrivate: false,\n };\n return new SpatialCategory(categoryProps, iModelDb);\n }\n\n /** Insert a new SpatialCategory\n * @param iModelDb Insert into this iModel\n * @param definitionModelId Insert the new SpatialCategory into this DefinitionModel\n * @param name The name of the SpatialCategory\n * @param defaultAppearance The appearance settings to use for the default SubCategory of this SpatialCategory\n * @returns The Id of the newly inserted SpatialCategory element.\n * @throws [[IModelError]] if unable to insert the element.\n */\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String {\n const category = this.create(iModelDb, definitionModelId, name);\n const categoryId = iModelDb.elements.insertElement(category);\n category.setDefaultAppearance(defaultAppearance);\n return categoryId;\n }\n}\n"]}
|
|
@@ -58,7 +58,7 @@ export interface ChangeSummaryExtractOptions {
|
|
|
58
58
|
* @beta
|
|
59
59
|
*/
|
|
60
60
|
export interface CreateChangeSummaryArgs extends TokenArg {
|
|
61
|
-
/** Id of the
|
|
61
|
+
/** Id of the iTwin that contains the iModel */
|
|
62
62
|
iTwinId: GuidString;
|
|
63
63
|
/** Id of the iModel */
|
|
64
64
|
iModelId: GuidString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangeSummaryManager.d.ts","sourceRoot":"","sources":["../../src/ChangeSummaryManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAoB,UAAU,EAAE,UAAU,EAA2C,MAAM,qBAAqB,CAAC;AACrI,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,cAAc,EAAe,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAMjH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAM7D;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,UAAU,CAAC;IACf,SAAS,EAAE;QAAE,KAAK,EAAE,UAAU,CAAC;QAAC,WAAW,EAAE,UAAU,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,UAAU,CAAA;KAAE,CAAC;CAC3H;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,UAAU,CAAC;IACf,SAAS,EAAE,UAAU,CAAC;IACtB,eAAe,EAAE;QAAE,EAAE,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,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,EAAE,KAAK,EAAE,EAAE;gBACtD,kCAAkC;gBAClC,IAAI,KAAK,GAAG,CAAC;oBACX,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;gBAE9E,mEAAmE;gBACnE,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;gBACtE,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC5B;YACD,OAAO,UAAU,CAAC;SACnB;gBAAS;YACR,IAAI,MAAM,KAAK,SAAS;gBACtB,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,uBAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;SACjC;IACH,CAAC;;AA5eH,oDA8eC;AA7eyB,sDAAiC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,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 iModels\r\n */\r\n\r\nimport { AccessToken, assert, DbResult, GuidString, Id64String, IModelStatus, Logger, PerfLogger, using } from \"@itwin/core-bentley\";\r\nimport { ChangedValueState, ChangeOpCode, ChangesetRange, IModelError, IModelVersion } from \"@itwin/core-common\";\r\nimport * as path from \"path\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { BriefcaseManager } from \"./BriefcaseManager\";\r\nimport { ECDb, ECDbOpenMode } from \"./ECDb\";\r\nimport { ECSqlStatement } from \"./ECSqlStatement\";\r\nimport { BriefcaseDb, IModelDb, TokenArg } from \"./IModelDb\";\r\nimport { IModelHost, KnownLocations } from \"./IModelHost\";\r\nimport { IModelJsFs } from \"./IModelJsFs\";\r\n\r\nconst loggerCategory: string = BackendLoggerCategory.ECDb;\r\n\r\n/** Represents an instance of the `ChangeSummary` ECClass from the `ECDbChange` ECSchema\r\n * combined with the information from the related `Changeset` instance (from the `IModelChange` ECSchema) from\r\n * which the Change Summary was extracted.\r\n *\r\n * See also\r\n * - [ChangeSummaryManager.queryChangeSummary]($backend)\r\n * - [ChangeSummary Overview]($docs/learning/ChangeSummaries)\r\n * @beta\r\n */\r\nexport interface ChangeSummary {\r\n id: Id64String;\r\n changeSet: { wsgId: GuidString, parentWsgId: GuidString, description: string, pushDate: string, userCreated: GuidString };\r\n}\r\n\r\n/** Represents an instance of the `InstanceChange` ECClass from the `ECDbChange` ECSchema\r\n *\r\n * See also\r\n * - [ChangeSummaryManager.queryInstanceChange]($backend)\r\n * - [ChangeSummary Overview]($docs/learning/ChangeSummaries)\r\n * @beta\r\n */\r\nexport interface InstanceChange {\r\n id: Id64String;\r\n summaryId: Id64String;\r\n changedInstance: { id: Id64String, className: string };\r\n opCode: ChangeOpCode;\r\n isIndirect: boolean;\r\n}\r\n\r\n/** Options for [ChangeSummaryManager.extractChangeSummaries]($backend).\r\n * @beta\r\n * @deprecated Use [CreateChangeSummaryArgs]($core-backend) instead\r\n */\r\nexport interface ChangeSummaryExtractOptions {\r\n /** If specified, change summaries are extracted from the start version to the current version as of which the iModel\r\n * was opened. If undefined, the extraction starts at the first version of the iModel.\r\n */\r\n startVersion?: IModelVersion;\r\n /** If specified, the change summary will be extracted only for current version as of which the iModel\r\n * was opened.\r\n */\r\n currentVersionOnly?: boolean;\r\n}\r\n\r\n/** Options for [ChangeSummaryManager.createChangeSummaries]($backend).\r\n * @beta\r\n */\r\nexport interface CreateChangeSummaryArgs extends TokenArg {\r\n /** Id of the iTwin that contains the iModel */\r\n iTwinId: GuidString;\r\n\r\n /** Id of the iModel */\r\n iModelId: GuidString;\r\n\r\n /**\r\n * Range of change sets\r\n * - the Change Summary for the first and last versions are also included\r\n * - if unspecified, all change sets until the latest version are processed\r\n */\r\n range: ChangesetRange;\r\n}\r\n\r\n/** Class to extract Change Summaries for a briefcase.\r\n *\r\n * See also:\r\n * - [ChangeSummary Overview]($docs/learning/ChangeSummaries)\r\n * @beta\r\n */\r\nexport class ChangeSummaryManager {\r\n private static readonly _currentIModelChangeSchemaVersion = { read: 2, write: 0, minor: 0 };\r\n\r\n /** Determines whether the *Change Cache file* is attached to the specified iModel or not\r\n * @param iModel iModel to check whether a *Change Cache file* is attached\r\n * @returns Returns true if the *Change Cache file* is attached to the iModel. false otherwise\r\n */\r\n public static isChangeCacheAttached(iModel: IModelDb): boolean {\r\n if (!iModel || !iModel.isOpen)\r\n throw new IModelError(IModelStatus.BadRequest, \"Briefcase must be open\");\r\n\r\n return iModel.nativeDb.isChangeCacheAttached();\r\n }\r\n\r\n /** Attaches the *Change Cache file* to the specified iModel if it hasn't been attached yet.\r\n * A new *Change Cache file* will be created for the iModel if it hasn't existed before.\r\n * @param iModel iModel to attach the *Change Cache file* file to\r\n * @throws [IModelError]($common)\r\n */\r\n public static attachChangeCache(iModel: IModelDb): void {\r\n if (!iModel || !iModel.isOpen)\r\n throw new IModelError(IModelStatus.BadRequest, \"Briefcase must be open\");\r\n\r\n if (ChangeSummaryManager.isChangeCacheAttached(iModel))\r\n return;\r\n\r\n const changesCacheFilePath: string = BriefcaseManager.getChangeCachePathName(iModel.iModelId);\r\n if (!IModelJsFs.existsSync(changesCacheFilePath)) {\r\n using(new ECDb(), (changeCacheFile: ECDb) => {\r\n ChangeSummaryManager.createChangeCacheFile(iModel, changeCacheFile, changesCacheFilePath);\r\n });\r\n }\r\n\r\n assert(IModelJsFs.existsSync(changesCacheFilePath));\r\n const res: DbResult = iModel.nativeDb.attachChangeCache(changesCacheFilePath);\r\n if (res !== DbResult.BE_SQLITE_OK)\r\n throw new IModelError(res, `Failed to attach Change Cache file to ${iModel.pathName}.`);\r\n }\r\n\r\n /** Detaches the *Change Cache file* from the specified iModel.\r\n * - note that this method will cause any pending (currently running or queued) queries to fail\r\n * @param iModel iModel to detach the *Change Cache file* to\r\n * @throws [IModelError]($common) in case of errors, e.g. if no *Change Cache file* was attached before.\r\n */\r\n public static detachChangeCache(iModel: IModelDb): void {\r\n if (!iModel || !iModel.isOpen)\r\n throw new IModelError(IModelStatus.BadRequest, \"Briefcase must be open\");\r\n\r\n iModel.clearCaches();\r\n const res: DbResult = iModel.nativeDb.detachChangeCache();\r\n if (res !== DbResult.BE_SQLITE_OK)\r\n throw new IModelError(res, `Failed to detach Change Cache file from ${iModel.pathName}.`);\r\n }\r\n\r\n /** Extracts change summaries from the specified iModel.\r\n * Change summaries are extracted from the version the iModel was opened with up through the specified start version.\r\n * If no start version has been specified, the first version will be used.\r\n * @param requestContext The client request context\r\n * @param iModel iModel to extract change summaries for. The iModel must not be a standalone iModel.\r\n * Note: For every version to extract a summary from, the method moves the iModel to that version before extraction. After\r\n * the extraction has completed, the iModel is moved back to the original version.\r\n * @param options Extraction options\r\n * @return the Ids of the extracted change summaries.\r\n * @throws [IModelError]($common) if the iModel is standalone\r\n * @deprecated Use [ChangeSummaryManager.createChangeSummaries]($core-backend) instead\r\n */\r\n public static async extractChangeSummaries(accessToken: AccessToken, iModel: BriefcaseDb, options?: ChangeSummaryExtractOptions): Promise<Id64String[]> { // eslint-disable-line deprecation/deprecation\r\n if (!iModel?.isOpen)\r\n throw new IModelError(IModelStatus.BadRequest, \"Briefcase must be open\");\r\n\r\n const iModelId = iModel.iModelId;\r\n const endChangeSetId = iModel.changeset.id;\r\n assert(endChangeSetId.length !== 0);\r\n\r\n let startChangeSetId = \"\";\r\n if (options) {\r\n if (options.startVersion) {\r\n startChangeSetId = (await IModelHost.hubAccess.getChangesetFromVersion({ version: options.startVersion, accessToken, iModelId })).id;\r\n } else if (options.currentVersionOnly) {\r\n startChangeSetId = endChangeSetId;\r\n }\r\n }\r\n\r\n Logger.logInfo(loggerCategory, \"Started Change Summary extraction...\", () => ({ iModelId, startChangeSetId, endChangeSetId }));\r\n const totalPerf = new PerfLogger(`ChangeSummaryManager.extractChangeSummaries [ChangeSets: ${startChangeSetId} through ${endChangeSetId}, iModel: ${iModelId}]`);\r\n\r\n // download necessary changesets if they were not downloaded before and retrieve infos about those changesets\r\n let perfLogger = new PerfLogger(\"ChangeSummaryManager.extractChangeSummaries>Retrieve ChangeSetInfos and download Changesets from Hub\");\r\n\r\n const first = (await IModelHost.hubAccess.queryChangeset({ iModelId, changeset: { id: startChangeSetId }, accessToken })).index;\r\n const end = (await IModelHost.hubAccess.queryChangeset({ iModelId, changeset: { id: endChangeSetId }, accessToken })).index;\r\n const changeSetInfos = await IModelHost.hubAccess.downloadChangesets({ accessToken, iModelId, range: { first, end }, targetDir: BriefcaseManager.getChangeSetsPath(iModelId) });\r\n perfLogger.dispose();\r\n Logger.logTrace(loggerCategory, \"Retrieved changesets to extract from from cache or from hub.\", () => ({ iModelId, startChangeSetId, endChangeSetId, changeSets: changeSetInfos }));\r\n\r\n // Ensure change cache is detached as it's being written to during the extraction\r\n if (this.isChangeCacheAttached(iModel)) {\r\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"Change cache must be detached before extraction\");\r\n }\r\n\r\n perfLogger = new PerfLogger(\"ChangeSummaryManager.extractChangeSummaries>Open or create local Change Cache file\");\r\n const changesFile = ChangeSummaryManager.openOrCreateChangesFile(iModel);\r\n assert(changesFile.nativeDb !== undefined, \"Should not happen as an exception should have been thrown in that case\");\r\n perfLogger.dispose();\r\n Logger.logTrace(loggerCategory, \"Opened or created Changes Cachefile.\", () => ({ iModelId, startChangeSetId, endChangeSetId }));\r\n\r\n try {\r\n // extract summaries from end changeset through start changeset, so that we only have to go back in history\r\n const changeSetCount: number = changeSetInfos.length;\r\n const endChangeSetIx: number = changeSetCount - 1;\r\n const summaries: Id64String[] = [];\r\n for (let i = endChangeSetIx; i >= 0; i--) {\r\n const currentChangeSetInfo = changeSetInfos[i];\r\n const currentChangeSetId = currentChangeSetInfo.id;\r\n Logger.logInfo(loggerCategory, `Started Change Summary extraction for changeset #${i + 1}...`, () => ({ iModelId, changeSetId: currentChangeSetId }));\r\n\r\n const existingSummaryId: Id64String | undefined = ChangeSummaryManager.isSummaryAlreadyExtracted(changesFile, currentChangeSetId);\r\n if (!!existingSummaryId) {\r\n Logger.logInfo(loggerCategory, `Change Summary for changeset #${i + 1} already exists. It is not extracted again.`, () => ({ iModelId, changeSetId: currentChangeSetId }));\r\n summaries.push(existingSummaryId);\r\n continue;\r\n }\r\n\r\n // iModel is at end changeset, so no need to reverse for it.\r\n if (i !== endChangeSetIx) {\r\n perfLogger = new PerfLogger(\"ChangeSummaryManager.extractChangeSummaries>Roll iModel to previous changeset\");\r\n\r\n await iModel.pullChanges({ accessToken, toIndex: currentChangeSetInfo.index });\r\n perfLogger.dispose();\r\n Logger.logTrace(loggerCategory, `Moved iModel to changeset #${i + 1} to extract summary from.`, () => ({ iModelId, changeSetId: currentChangeSetId }));\r\n }\r\n\r\n const changeSetFilePath = currentChangeSetInfo.pathname;\r\n if (!IModelJsFs.existsSync(changeSetFilePath))\r\n throw new IModelError(IModelStatus.FileNotFound, `Failed to extract change summary: ChangeSet file \"${changeSetFilePath}\" does not exist.`);\r\n\r\n perfLogger = new PerfLogger(\"ChangeSummaryManager.extractChangeSummaries>Extract ChangeSummary\");\r\n const stat = iModel.nativeDb.extractChangeSummary(changesFile.nativeDb, changeSetFilePath);\r\n perfLogger.dispose();\r\n if (stat.error && stat.error.status !== DbResult.BE_SQLITE_OK)\r\n throw new IModelError(stat.error.status, stat.error.message);\r\n\r\n Logger.logTrace(loggerCategory, `Actual Change summary extraction done for changeset #${i + 1}.`, () => ({ iModelId, changeSetId: currentChangeSetId }));\r\n\r\n perfLogger = new PerfLogger(\"ChangeSummaryManager.extractChangeSummaries>Add ChangeSet info to ChangeSummary\");\r\n const changeSummaryId = stat.result!;\r\n summaries.push(changeSummaryId);\r\n ChangeSummaryManager.addExtendedInfos(changesFile, changeSummaryId, currentChangeSetId, currentChangeSetInfo.parentId, currentChangeSetInfo.description, currentChangeSetInfo.pushDate, currentChangeSetInfo.userCreated);\r\n perfLogger.dispose();\r\n Logger.logTrace(loggerCategory, `Added extended infos to Change Summary for changeset #${i + 1}.`, () => ({ iModelId, changeSetId: currentChangeSetId }));\r\n\r\n Logger.logInfo(loggerCategory, `Finished Change Summary extraction for changeset #${i + 1}.`, () => ({ iModelId, changeSetId: currentChangeSetId }));\r\n }\r\n\r\n changesFile.saveChanges();\r\n return summaries;\r\n } finally {\r\n changesFile.dispose();\r\n\r\n perfLogger = new PerfLogger(\"ChangeSummaryManager.extractChangeSummaries>Move iModel to original changeset\");\r\n if (iModel.changeset.id !== endChangeSetId)\r\n await iModel.pullChanges({ accessToken });\r\n perfLogger.dispose();\r\n Logger.logTrace(loggerCategory, \"Moved iModel to initial changeset (the end changeset).\", () => ({ iModelId, startChangeSetId, endChangeSetId }));\r\n\r\n totalPerf.dispose();\r\n Logger.logInfo(loggerCategory, \"Finished Change Summary extraction.\", () => ({ iModelId, startChangeSetId, endChangeSetId }));\r\n }\r\n }\r\n\r\n private static openOrCreateChangesFile(iModel: BriefcaseDb): ECDb {\r\n if (!iModel?.isOpen)\r\n throw new IModelError(IModelStatus.BadArg, \"Invalid iModel handle. iModel must be open.\");\r\n\r\n const changesFile = new ECDb();\r\n const changeCacheFilePath = BriefcaseManager.getChangeCachePathName(iModel.iModelId);\r\n if (IModelJsFs.existsSync(changeCacheFilePath)) {\r\n ChangeSummaryManager.openChangeCacheFile(changesFile, changeCacheFilePath);\r\n return changesFile;\r\n }\r\n\r\n try {\r\n ChangeSummaryManager.createChangeCacheFile(iModel, changesFile, changeCacheFilePath);\r\n return changesFile;\r\n } catch (e) {\r\n // delete cache file again in case it was created but schema import failed\r\n if (IModelJsFs.existsSync(changeCacheFilePath))\r\n IModelJsFs.removeSync(changeCacheFilePath);\r\n\r\n throw e;\r\n }\r\n }\r\n\r\n private static createChangeCacheFile(iModel: IModelDb, changesFile: ECDb, changeCacheFilePath: string): void {\r\n if (!iModel?.isOpen)\r\n throw new IModelError(IModelStatus.BadArg, \"Invalid iModel object. iModel must be open.\");\r\n\r\n const stat: DbResult = iModel.nativeDb.createChangeCache(changesFile.nativeDb, changeCacheFilePath);\r\n if (stat !== DbResult.BE_SQLITE_OK)\r\n throw new IModelError(stat, `Failed to create Change Cache file at \"${changeCacheFilePath}\".`);\r\n\r\n // Extended information like changeset ids, push dates are persisted in the IModelChange ECSchema\r\n changesFile.importSchema(ChangeSummaryManager.getExtendedSchemaPath());\r\n }\r\n\r\n private static openChangeCacheFile(changesFile: ECDb, changeCacheFilePath: string): void {\r\n changesFile.openDb(changeCacheFilePath, ECDbOpenMode.FileUpgrade);\r\n\r\n const actualSchemaVersion: { read: number, write: number, minor: number } = changesFile.withPreparedStatement(\"SELECT VersionMajor read,VersionWrite write,VersionMinor minor FROM meta.ECSchemaDef WHERE Name='IModelChange'\",\r\n (stmt: ECSqlStatement) => {\r\n if (stmt.step() !== DbResult.BE_SQLITE_ROW)\r\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"File is not a valid Change Cache file.\");\r\n\r\n return stmt.getRow();\r\n });\r\n\r\n if (actualSchemaVersion.read === ChangeSummaryManager._currentIModelChangeSchemaVersion.read &&\r\n actualSchemaVersion.write === ChangeSummaryManager._currentIModelChangeSchemaVersion.write &&\r\n actualSchemaVersion.minor === ChangeSummaryManager._currentIModelChangeSchemaVersion.minor)\r\n return;\r\n\r\n changesFile.importSchema(ChangeSummaryManager.getExtendedSchemaPath());\r\n }\r\n\r\n private static getExtendedSchemaPath(): string { return path.join(KnownLocations.packageAssetsDir, \"IModelChange.02.00.00.ecschema.xml\"); }\r\n\r\n private static isSummaryAlreadyExtracted(changesFile: ECDb, changeSetId: GuidString): Id64String | undefined {\r\n return changesFile.withPreparedStatement(\"SELECT Summary.Id summaryid FROM imodelchange.ChangeSet WHERE WsgId=?\",\r\n (stmt: ECSqlStatement) => {\r\n stmt.bindString(1, changeSetId);\r\n if (DbResult.BE_SQLITE_ROW === stmt.step())\r\n return stmt.getValue(0).getId();\r\n\r\n return undefined;\r\n });\r\n }\r\n\r\n private static addExtendedInfos(changesFile: ECDb, changeSummaryId: Id64String, changesetWsgId: GuidString, changesetParentWsgId?: GuidString, description?: string, changesetPushDate?: string, changeSetUserCreated?: GuidString): void {\r\n changesFile.withPreparedStatement(\"INSERT INTO imodelchange.ChangeSet(Summary.Id,WsgId,ParentWsgId,Description,PushDate,UserCreated) VALUES(?,?,?,?,?,?)\",\r\n (stmt: ECSqlStatement) => {\r\n stmt.bindId(1, changeSummaryId);\r\n stmt.bindString(2, changesetWsgId);\r\n if (changesetParentWsgId)\r\n stmt.bindString(3, changesetParentWsgId);\r\n\r\n if (description)\r\n stmt.bindString(4, description);\r\n\r\n if (changesetPushDate)\r\n stmt.bindDateTime(5, changesetPushDate);\r\n\r\n if (changeSetUserCreated)\r\n stmt.bindString(6, changeSetUserCreated);\r\n\r\n const r: DbResult = stmt.step();\r\n if (r !== DbResult.BE_SQLITE_DONE)\r\n throw new IModelError(r, `Failed to add changeset information to extracted change summary ${changeSummaryId}`);\r\n });\r\n }\r\n\r\n /** Queries the ChangeSummary for the specified change summary id\r\n *\r\n * See also\r\n * - `ECDbChange.ChangeSummary` ECClass in the *ECDbChange* ECSchema\r\n * - [Change Summary Overview]($docs/learning/ChangeSummaries)\r\n * @param iModel iModel\r\n * @param changeSummaryId ECInstanceId of the ChangeSummary\r\n * @returns Returns the requested ChangeSummary object\r\n * @throws [IModelError]($common) If change summary does not exist for the specified id, or if the\r\n * change cache file hasn't been attached, or in case of other errors.\r\n */\r\n public static queryChangeSummary(iModel: BriefcaseDb, changeSummaryId: Id64String): ChangeSummary {\r\n if (!ChangeSummaryManager.isChangeCacheAttached(iModel))\r\n throw new IModelError(IModelStatus.BadArg, \"Change Cache file must be attached to iModel.\");\r\n\r\n return iModel.withPreparedStatement(\"SELECT WsgId,ParentWsgId,Description,PushDate,UserCreated FROM ecchange.imodelchange.ChangeSet WHERE Summary.Id=?\",\r\n (stmt: ECSqlStatement) => {\r\n stmt.bindId(1, changeSummaryId);\r\n if (stmt.step() !== DbResult.BE_SQLITE_ROW)\r\n throw new IModelError(IModelStatus.BadArg, `No ChangeSet information found for ChangeSummary ${changeSummaryId}.`);\r\n\r\n const row = stmt.getRow();\r\n return { id: changeSummaryId, changeSet: { wsgId: row.wsgId, parentWsgId: row.parentWsgId, description: row.description, pushDate: row.pushDate, userCreated: row.userCreated } };\r\n });\r\n }\r\n\r\n /** Queries the InstanceChange for the specified instance change id.\r\n *\r\n * See also\r\n * - `ECDbChange.InstanceChange` ECClass in the *ECDbChange* ECSchema\r\n * - [Change Summary Overview]($docs/learning/ChangeSummaries)\r\n * @param iModel iModel\r\n * @param instanceChangeId ECInstanceId of the InstanceChange (see `ECDbChange.InstanceChange` ECClass in the *ECDbChange* ECSchema)\r\n * @returns Returns the requested InstanceChange object (see `ECDbChange.InstanceChange` ECClass in the *ECDbChange* ECSchema)\r\n * @throws [IModelError]($common) if instance change does not exist for the specified id, or if the\r\n * change cache file hasn't been attached, or in case of other errors.\r\n */\r\n public static queryInstanceChange(iModel: BriefcaseDb, instanceChangeId: Id64String): InstanceChange {\r\n if (!ChangeSummaryManager.isChangeCacheAttached(iModel))\r\n throw new IModelError(IModelStatus.BadArg, \"Change Cache file must be attached to iModel.\");\r\n\r\n // query instance changes\r\n const instanceChange: InstanceChange = iModel.withPreparedStatement(`SELECT ic.Summary.Id summaryId, s.Name changedInstanceSchemaName, c.Name changedInstanceClassName, ic.ChangedInstance.Id changedInstanceId,\r\n ic.OpCode, ic.IsIndirect FROM ecchange.change.InstanceChange ic JOIN main.meta.ECClassDef c ON c.ECInstanceId = ic.ChangedInstance.ClassId\r\n JOIN main.meta.ECSchemaDef s ON c.Schema.Id = s.ECInstanceId WHERE ic.ECInstanceId =? `, (stmt: ECSqlStatement) => {\r\n stmt.bindId(1, instanceChangeId);\r\n if (stmt.step() !== DbResult.BE_SQLITE_ROW)\r\n throw new IModelError(IModelStatus.BadArg, `No InstanceChange found for id ${instanceChangeId}.`);\r\n\r\n const row = stmt.getRow();\r\n const changedInstanceId: Id64String = row.changedInstanceId;\r\n const changedInstanceClassName: string = `[${row.changedInstanceSchemaName}].[${row.changedInstanceClassName}]`;\r\n const op: ChangeOpCode = row.opCode as ChangeOpCode;\r\n\r\n return {\r\n id: instanceChangeId, summaryId: row.summaryId, changedInstance: { id: changedInstanceId, className: changedInstanceClassName },\r\n opCode: op, isIndirect: row.isIndirect,\r\n };\r\n });\r\n\r\n return instanceChange;\r\n }\r\n\r\n /** Retrieves the names of the properties whose values have changed for the given instance change\r\n *\r\n * See also [Change Summary Overview]($docs/learning/ChangeSummaries)\r\n * @param iModel iModel\r\n * @param instanceChangeId Id of the InstanceChange to query the properties whose values have changed\r\n * @returns Returns names of the properties whose values have changed for the given instance change\r\n * @throws [IModelError]($common) if the change cache file hasn't been attached, or in case of other errors.\r\n */\r\n public static getChangedPropertyValueNames(iModel: IModelDb, instanceChangeId: Id64String): string[] {\r\n return iModel.withPreparedStatement(\"SELECT AccessString FROM ecchange.change.PropertyValueChange WHERE InstanceChange.Id=?\",\r\n (stmt: ECSqlStatement) => {\r\n stmt.bindId(1, instanceChangeId);\r\n\r\n const selectClauseItems: string[] = [];\r\n while (stmt.step() === DbResult.BE_SQLITE_ROW) {\r\n // access string tokens need to be escaped as they might collide with reserved words in ECSQL or SQLite\r\n const accessString: string = stmt.getValue(0).getString();\r\n const accessStringTokens: string[] = accessString.split(\".\");\r\n assert(accessStringTokens.length > 0);\r\n\r\n let isFirstToken: boolean = true;\r\n let item: string = \"\";\r\n for (const token of accessStringTokens) {\r\n if (!isFirstToken)\r\n item += \".\";\r\n\r\n item += `[${token}]`;\r\n isFirstToken = false;\r\n }\r\n selectClauseItems.push(item);\r\n }\r\n\r\n return selectClauseItems;\r\n });\r\n }\r\n\r\n /** Builds the ECSQL to query the property value changes for the specified instance change and the specified ChangedValueState.\r\n *\r\n * See also [Change Summary Overview]($docs/learning/ChangeSummaries)\r\n * @param iModel iModel\r\n * @param instanceChangeInfo InstanceChange to query the property value changes for\r\n * changedInstance.className must be fully qualified and schema and class name must be escaped with square brackets if they collide with reserved ECSQL words: `[schema name].[class name]`\r\n * @param changedValueState The Changed State to query the values for. This must correspond to the [InstanceChange.OpCode]($backend) of the InstanceChange.\r\n * @param changedPropertyNames List of the property names for which values have changed for the specified instance change.\r\n * The list can be obtained by calling [ChangeSummaryManager.getChangedPropertyValueNames]($core-backend).\r\n * If omitted, the method will call the above method by itself. The parameter allows for checking first whether\r\n * an instance change has any property value changes at all. If there are no property value changes, this method\r\n * should not be called, as it will throw an error.\r\n * @returns Returns the ECSQL that will retrieve the property value changes\r\n * @throws [IModelError]($common) if instance change does not exist, if there are not property value changes for the instance change,\r\n * if the change cache file hasn't been attached, or in case of other errors.\r\n */\r\n public static buildPropertyValueChangesECSql(iModel: IModelDb, instanceChangeInfo: { id: Id64String, summaryId: Id64String, changedInstance: { id: Id64String, className: string } }, changedValueState: ChangedValueState, changedPropertyNames?: string[]): string {\r\n let selectClauseItems: string[];\r\n if (!changedPropertyNames) {\r\n // query property value changes just to build a SELECT statement against the class of the changed instance\r\n selectClauseItems = ChangeSummaryManager.getChangedPropertyValueNames(iModel, instanceChangeInfo.id);\r\n } else\r\n selectClauseItems = changedPropertyNames;\r\n\r\n if (selectClauseItems.length === 0)\r\n throw new IModelError(IModelStatus.BadArg, `No property value changes found for InstanceChange ${instanceChangeInfo.id}.`);\r\n\r\n let ecsql: string = \"SELECT \";\r\n selectClauseItems.map((item: string, index: number) => {\r\n if (index !== 0)\r\n ecsql += \",\";\r\n\r\n ecsql += item;\r\n });\r\n\r\n // Avoiding parameters in the Changes function speeds up performance because ECDb can do optimizations\r\n // if it knows the function args at prepare time\r\n ecsql += ` FROM main.${instanceChangeInfo.changedInstance.className}.Changes(${instanceChangeInfo.summaryId},${changedValueState}) WHERE ECInstanceId=${instanceChangeInfo.changedInstance.id}`;\r\n return ecsql;\r\n }\r\n\r\n /**\r\n * Creates a change summary for the last applied change set to the iModel\r\n * @param requestContext The client request context\r\n * @param iModel iModel to extract change summaries for. The iModel must not be a standalone iModel, and must have at least one change set applied to it.\r\n * @returns The id of the extracted change summary.\r\n * @beta\r\n */\r\n public static async createChangeSummary(accessToken: AccessToken, iModel: BriefcaseDb): Promise<Id64String> {\r\n if (!iModel?.isOpen)\r\n throw new IModelError(IModelStatus.BadRequest, \"Briefcase must be open\");\r\n const changesetId = iModel.changeset.id;\r\n if (!changesetId)\r\n throw new IModelError(IModelStatus.BadRequest, \"No change set was applied to the iModel\");\r\n if (this.isChangeCacheAttached(iModel))\r\n throw new IModelError(IModelStatus.BadRequest, \"Change cache must be detached before extraction\");\r\n\r\n const iModelId = iModel.iModelId;\r\n const changesetsFolder: string = BriefcaseManager.getChangeSetsPath(iModelId);\r\n const changeset = await IModelHost.hubAccess.downloadChangeset({ accessToken, iModelId, changeset: { id: iModel.changeset.id }, targetDir: changesetsFolder });\r\n\r\n if (!IModelJsFs.existsSync(changeset.pathname))\r\n throw new IModelError(IModelStatus.FileNotFound, `Failed to download change set: ${changeset.pathname}`);\r\n\r\n let changesFile: ECDb | undefined;\r\n try {\r\n changesFile = ChangeSummaryManager.openOrCreateChangesFile(iModel);\r\n assert(changesFile.nativeDb !== undefined, \"Invalid changesFile - should've caused an exception\");\r\n\r\n let changeSummaryId = ChangeSummaryManager.isSummaryAlreadyExtracted(changesFile, changesetId);\r\n if (changeSummaryId !== undefined) {\r\n Logger.logInfo(loggerCategory, `Change Summary for changeset already exists. It is not extracted again.`, () => ({ iModelId, changeSetId: changesetId }));\r\n return changeSummaryId;\r\n }\r\n\r\n const stat = iModel.nativeDb.extractChangeSummary(changesFile.nativeDb, changeset.pathname);\r\n if (stat.error && stat.error.status !== DbResult.BE_SQLITE_OK)\r\n throw new IModelError(stat.error.status, stat.error.message);\r\n\r\n changeSummaryId = stat.result!;\r\n ChangeSummaryManager.addExtendedInfos(changesFile, changeSummaryId, changesetId, changeset.parentId, changeset.description, changeset.pushDate, changeset.userCreated);\r\n\r\n changesFile.saveChanges();\r\n return changeSummaryId;\r\n } finally {\r\n if (changesFile !== undefined)\r\n changesFile.dispose();\r\n IModelJsFs.unlinkSync(changeset.pathname);\r\n }\r\n }\r\n\r\n /**\r\n * Creates change summaries for the specified iModel and a specified range of versions\r\n * @note This may be an expensive operation - downloads the first version and starts applying the change sets, extracting summaries one by one\r\n * @param args Arguments including the range of versions for which Change Summaries are to be created, and other necessary input for creation\r\n */\r\n public static async createChangeSummaries(args: CreateChangeSummaryArgs): Promise<Id64String[]> {\r\n const accessToken = args.accessToken ?? await IModelHost.getAccessToken() ?? \"\";\r\n const { iModelId, iTwinId, range } = args;\r\n range.end = range.end ?? (await IModelHost.hubAccess.getChangesetFromVersion({ accessToken, iModelId, version: IModelVersion.latest() })).index;\r\n if (range.first > range.end)\r\n throw new IModelError(IModelStatus.BadArg, \"Invalid range of changesets\");\r\n\r\n const changesets = await IModelHost.hubAccess.queryChangesets({ accessToken, iModelId, range });\r\n\r\n // Setup a temporary briefcase to help with extracting change summaries\r\n const briefcasePath = BriefcaseManager.getBriefcaseBasePath(iModelId);\r\n const fileName: string = path.join(briefcasePath, `ChangeSummaryBriefcase.bim`);\r\n if (IModelJsFs.existsSync(fileName))\r\n IModelJsFs.removeSync(fileName);\r\n\r\n let iModel: BriefcaseDb | undefined;\r\n try {\r\n // Download a version that has the first change set applied\r\n const props = await BriefcaseManager.downloadBriefcase({ accessToken, iTwinId, iModelId, asOf: { afterChangeSetId: changesets[0].id }, briefcaseId: 0, fileName });\r\n iModel = await BriefcaseDb.open({ fileName: props.fileName });\r\n\r\n const summaryIds = new Array<Id64String>();\r\n for (let index = 0; index < changesets.length; index++) {\r\n // Apply a change set if necessary\r\n if (index > 0)\r\n await iModel.pullChanges({ accessToken, toIndex: changesets[index].index });\r\n\r\n // Create a change summary for the last change set that was applied\r\n const summaryId = await this.createChangeSummary(accessToken, iModel);\r\n summaryIds.push(summaryId);\r\n }\r\n return summaryIds;\r\n } finally {\r\n if (iModel !== undefined)\r\n iModel.close();\r\n IModelJsFs.removeSync(fileName);\r\n }\r\n }\r\n\r\n}\r\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangedElementsDb.d.ts","sourceRoot":"","sources":["../../src/ChangedElementsDb.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAA0B,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAe,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC;;;KAGK;AACL,MAAM,WAAW,uBAAuB;IACtC,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,iBAAkB,YAAW,WAAW;IACnD,OAAO,CAAC,SAAS,CAAiD;;IAM3D,OAAO,IAAI,IAAI;IAStB;;;OAGG;IACH,OAAO,CAAC,SAAS;IAMjB;;;;OAIG;IACH,OAAO,CAAC,OAAO;IAQf;;;;OAIG;WACW,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,YAAoC,GAAG,iBAAiB;IAMzG;;;;OAIG;WACW,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GA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AC,gCAAgC,CAAC,CAAC;QACzI,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAkB,CAAC;IACxD,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,gBAAwB,EAAE,cAAsB;QACnE,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;QAClF,IAAI,MAAM,CAAC,KAAK;YACd,MAAM,IAAI,yBAAW,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACnE,OAAO,MAAM,CAAC,MAAoB,CAAC;IACrC,CAAC;IAED,sDAAsD;IACtD,IAAW,MAAM,KAAc,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAE/D,mEAAmE;IAC5D,WAAW,CAAC,WAAmB,IAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAEnG;;OAEG;IACI,OAAO;QACZ,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAEM,WAAW;QAChB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC9B,CAAC;IAED,gBAAgB;IAChB,IAAW,QAAQ;QACjB,IAAI,CAAC,IAAI,CAAC,SAAS;YACjB,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,UAAU,EAAE,qDAAqD,CAAC,CAAC;QAExG,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AA3LD,8CA2LC","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 ChangedElementsDb\n */\n\nimport { AccessToken, DbResult, IDisposable, IModelStatus, OpenMode } from \"@itwin/core-bentley\";\nimport { ChangeData, ChangedElements, ChangedModels, IModelError } from \"@itwin/core-common\";\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\nimport { BriefcaseManager } from \"./BriefcaseManager\";\nimport { ECDbOpenMode } from \"./ECDb\";\nimport { IModelDb } from \"./IModelDb\";\nimport { IModelHost } from \"./IModelHost\";\n\n/**\n * Options for processChangesets function\n * @internal\n * */\nexport interface ProcessChangesetOptions {\n startChangesetId: string;\n endChangesetId: string;\n rulesetId: string;\n filterSpatial?: boolean;\n wantParents?: boolean;\n wantPropertyChecksums?: boolean;\n rulesetDir?: string;\n tempDir?: string;\n}\n\n/** An ChangedElementsDb file\n * @internal\n */\nexport class ChangedElementsDb implements IDisposable {\n private _nativeDb: IModelJsNative.ChangedElementsECDb | undefined;\n\n constructor() {\n this._nativeDb = new IModelHost.platform.ChangedElementsECDb();\n }\n\n public dispose(): void {\n if (!this._nativeDb)\n return;\n\n this.closeDb();\n this._nativeDb.dispose();\n this._nativeDb = undefined;\n }\n\n /** Create a ChangedElementsDb\n * @param pathName The path to the ECDb file to create.\n * @throws [IModelError]($common) if the operation failed.\n */\n private _createDb(briefcase: IModelDb, pathName: string): void {\n const status: DbResult = this.nativeDb.createDb(briefcase.nativeDb, pathName);\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to created ECDb\");\n }\n\n /** Open the Changed Elements Db.\n * @param pathName The path to the ECDb file to open\n * @param openMode Open mode\n * @throws [IModelError]($common) if the operation failed.\n */\n private _openDb(pathName: string, openMode: ECDbOpenMode = ECDbOpenMode.Readonly): void {\n const nativeOpenMode = openMode === ECDbOpenMode.Readonly ? OpenMode.Readonly : OpenMode.ReadWrite;\n const tryUpgrade = openMode === ECDbOpenMode.FileUpgrade;\n const status = this.nativeDb.openDb(pathName, nativeOpenMode, tryUpgrade);\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to open ECDb\");\n }\n\n /** Open the Changed Elements Db.\n * @param pathName The path to the ECDb file to open\n * @param openMode Open mode\n * @returns ChangedElementsDb\n */\n public static openDb(pathName: string, openMode: ECDbOpenMode = ECDbOpenMode.Readonly): ChangedElementsDb {\n const cacheDb = new ChangedElementsDb();\n cacheDb._openDb(pathName, openMode);\n return cacheDb;\n }\n\n /** Create the changed elements cache db\n * @param briefcase IModelDb to use\n * @param pathName The path to the ECDb file to create.\n * @returns The new cache db\n */\n public static createDb(briefcase: IModelDb, pathName: string): ChangedElementsDb {\n const cacheDb = new ChangedElementsDb();\n cacheDb._createDb(briefcase, pathName);\n return cacheDb;\n }\n\n /** Processes a range of changesets and adds it to the changed elements cache\n * @param requestContext The client request context\n * @param briefcase iModel briefcase to use\n * @param options Options for processing\n */\n public async processChangesets(accessToken: AccessToken, briefcase: IModelDb, options: ProcessChangesetOptions): Promise<DbResult> {\n const iModelId = briefcase.iModelId;\n const first = (await IModelHost.hubAccess.queryChangeset({ iModelId, changeset: { id: options.startChangesetId }, accessToken })).index;\n const end = (await IModelHost.hubAccess.queryChangeset({ iModelId, changeset: { id: options.endChangesetId }, accessToken })).index;\n const changesets = await IModelHost.hubAccess.downloadChangesets({ accessToken, iModelId, range: { first, end }, targetDir: BriefcaseManager.getChangeSetsPath(iModelId) });\n\n // ChangeSets need to be processed from newest to oldest\n changesets.reverse();\n const status = this.nativeDb.processChangesets(\n briefcase.nativeDb,\n changesets,\n options.rulesetId,\n options.filterSpatial,\n options.wantParents,\n options.wantPropertyChecksums,\n options.rulesetDir,\n options.tempDir,\n );\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to process changesets\");\n return status;\n }\n\n /** Processes a range of changesets and adds it to the changed elements cache\n * This call will close the IModelDb object as it is required for processing and applying changesets\n * @param requestContext The client request context\n * @param briefcase iModel briefcase to use\n * @param options options for processing\n */\n public async processChangesetsAndRoll(accessToken: AccessToken, briefcase: IModelDb, options: ProcessChangesetOptions): Promise<DbResult> {\n const iModelId = briefcase.iModelId;\n const first = (await IModelHost.hubAccess.queryChangeset({ iModelId, changeset: { id: options.startChangesetId }, accessToken })).index;\n const end = (await IModelHost.hubAccess.queryChangeset({ iModelId, changeset: { id: options.endChangesetId }, accessToken })).index;\n const changesets = await IModelHost.hubAccess.downloadChangesets({ accessToken, iModelId, range: { first, end }, targetDir: BriefcaseManager.getChangeSetsPath(iModelId) });\n\n // ChangeSets need to be processed from newest to oldest\n changesets.reverse();\n // Close briefcase before doing processing and rolling briefcase\n const dbFilename = briefcase.pathName;\n const dbGuid = briefcase.iModelId;\n briefcase.close();\n // Process changesets\n const status = this.nativeDb.processChangesetsAndRoll(\n dbFilename,\n dbGuid,\n changesets,\n options.rulesetId,\n options.filterSpatial,\n options.wantParents,\n options.wantPropertyChecksums,\n options.rulesetDir,\n options.tempDir,\n );\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to process changesets\");\n return status;\n }\n\n /** Get changed elements between two changesets\n * @param startChangesetId Start Changeset Id\n * @param endChangesetId End Changeset Id\n * @returns Returns the changed elements between the changesets provided\n * @throws [IModelError]($common) if the operation failed.\n */\n public getChangedElements(startChangesetId: string, endChangesetId: string): ChangedElements | undefined {\n const result = this.nativeDb.getChangedElements(startChangesetId, endChangesetId);\n if (result.error || !result.result)\n throw new IModelError(result.error ? result.error.status : -1, result.error ? result.error.message : \"Problem getting changed elements\");\n return (result.result.changedElements) as ChangedElements;\n }\n\n /** Get changed models between two changesets\n * @param startChangesetId Start Changeset Id\n * @param endChangesetId End Changeset Id\n * @returns Returns the changed models between the changesets provided\n * @throws [IModelError]($common) if the operation failed.\n */\n public getChangedModels(startChangesetId: string, endChangesetId: string): ChangedModels | undefined {\n const result = this.nativeDb.getChangedElements(startChangesetId, endChangesetId);\n if (result.error || !result.result)\n throw new IModelError(result.error ? result.error.status : -1, result.error ? result.error.message : \"Problem getting changed models\");\n return (result.result.changedModels) as ChangedModels;\n }\n\n /** Get changed models between two changesets\n * @param startChangesetId Start Changeset Id\n * @param endChangesetId End Changeset Id\n * @returns Returns the changed models between the changesets provided\n * @throws [IModelError]($common) if the operation failed.\n */\n public getChangeData(startChangesetId: string, endChangesetId: string): ChangeData | undefined {\n const result = this.nativeDb.getChangedElements(startChangesetId, endChangesetId);\n if (result.error)\n throw new IModelError(result.error.status, result.error.message);\n return result.result as ChangeData;\n }\n\n /** Returns true if the Changed Elements Db is open */\n public get isOpen(): boolean { return this.nativeDb.isOpen(); }\n\n /** Returns true if the cache already contains this changeset Id */\n public isProcessed(changesetId: string): boolean { return this.nativeDb.isProcessed(changesetId); }\n\n /** Close the Db after saving any uncommitted changes.\n * @throws [IModelError]($common) if the database is not open.\n */\n public closeDb(): void {\n this.nativeDb.closeDb();\n }\n\n public cleanCaches(): void {\n this.nativeDb.cleanCaches();\n }\n\n /** @internal */\n public get nativeDb(): IModelJsNative.ChangedElementsECDb {\n if (!this._nativeDb)\n throw new IModelError(IModelStatus.BadRequest, \"ChangedElementsDb object has already been disposed.\");\n\n return this._nativeDb;\n }\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangedElementsManager.d.ts","sourceRoot":"","sources":["../../src/ChangedElementsManager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAWhF,qDAAqD;AACrD,gBAAgB;AAChB,qBAAa,sBAAsB;IACjC,gIAAgI;IAChI,OAAO,CAAC,MAAM,CAAC,MAAM,CAA0C;WAEjD,0BAA0B,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM;IAEtE,8BAA8B;IAC9B,OAAO,CAAC,MAAM,CAAC,oBAAoB;WAyBrB,OAAO;IAQrB;;;;;OAKG;WACW,kBAAkB,CAAC,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,eAA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sBAAsB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAChG,IAAI,CAAC,EAAE;YACL,OAAO,SAAS,CAAC;QAEnB,OAAO,EAAE,CAAC,aAAa,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,QAAoB,EAAE,WAAmB;QACjE,MAAM,EAAE,GAAkC,sBAAsB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAChG,IAAI,CAAC,EAAE;YACL,OAAO,KAAK,CAAC;QAEf,OAAO,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC;CACF;AA9FD,wDA8FC","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 { GuidString } from \"@itwin/core-bentley\";\r\nimport { ChangeData, ChangedElements, ChangedModels } from \"@itwin/core-common\";\r\nimport { BriefcaseManager } from \"./BriefcaseManager\";\r\nimport { ChangedElementsDb } from \"./ChangedElementsDb\";\r\nimport { IModelJsFs } from \"./IModelJsFs\";\r\n\r\n/** @internal */\r\ninterface ChangedElementsDbCacheEntry {\r\n iModelId: GuidString;\r\n db: ChangedElementsDb;\r\n}\r\n\r\n/** Utilities for querying changed elements caches */\r\n/** @internal */\r\nexport class ChangedElementsManager {\r\n /** Maintains a single entry since we will only have a cache per iModel, which means a ChangedElementsDb per backend instance */\r\n private static _entry: ChangedElementsDbCacheEntry | undefined;\r\n\r\n public static getChangedElementsPathName(iModelId: GuidString): string { return BriefcaseManager.getChangedElementsPathName(iModelId); }\r\n\r\n /** Get changed elements Db */\r\n private static getChangedElementsDb(iModelId: GuidString): ChangedElementsDb | undefined {\r\n if (this._entry && this._entry.iModelId === iModelId)\r\n return this._entry.db;\r\n if (this._entry && this._entry.iModelId !== iModelId) {\r\n this._entry.db.closeDb();\r\n this._entry.db.cleanCaches();\r\n this._entry = undefined;\r\n }\r\n if (!this._entry) {\r\n const path = ChangedElementsManager.getChangedElementsPathName(iModelId);\r\n if (!IModelJsFs.existsSync(path))\r\n return undefined;\r\n\r\n const db: ChangedElementsDb = ChangedElementsDb.openDb(path);\r\n this._entry = {\r\n iModelId,\r\n db,\r\n };\r\n\r\n return db;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n public static cleanUp() {\r\n if (this._entry) {\r\n this._entry.db.closeDb();\r\n this._entry.db.cleanCaches();\r\n this._entry = undefined;\r\n }\r\n }\r\n\r\n /** Gets the changed elements from the cache if found\r\n * @param iModelId Id of the iModel\r\n * @param startChangesetId Start changeset Id\r\n * @param endChangesetId End changeset Id\r\n * @returns Changed elements if found\r\n */\r\n public static getChangedElements(iModelId: GuidString, startChangesetId: string, endChangesetId: string): ChangedElements | undefined {\r\n const db: ChangedElementsDb | undefined = ChangedElementsManager.getChangedElementsDb(iModelId);\r\n if (!db)\r\n return undefined;\r\n\r\n return db.getChangedElements(startChangesetId, endChangesetId);\r\n }\r\n\r\n /** Gets the changed models from the cache if found\r\n * @param iModelId Id of the iModel\r\n * @param startChangesetId Start changeset Id\r\n * @param endChangesetId End changeset Id\r\n * @returns Changed models if found\r\n */\r\n public static getChangedModels(iModelId: GuidString, startChangesetId: string, endChangesetId: string): ChangedModels | undefined {\r\n const db: ChangedElementsDb | undefined = ChangedElementsManager.getChangedElementsDb(iModelId);\r\n if (!db)\r\n return undefined;\r\n\r\n return db.getChangedModels(startChangesetId, endChangesetId);\r\n }\r\n\r\n /** Gets the change data (models and elements) from the cache if found\r\n * @param iModelId Id of the iModel\r\n * @param startChangesetId Start changeset Id\r\n * @param endChangesetId End changeset Id\r\n * @returns Changed models if found\r\n */\r\n public static getChangeData(iModelId: GuidString, startChangesetId: string, endChangesetId: string): ChangeData | undefined {\r\n const db: ChangedElementsDb | undefined = ChangedElementsManager.getChangedElementsDb(iModelId);\r\n if (!db)\r\n return undefined;\r\n\r\n return db.getChangeData(startChangesetId, endChangesetId);\r\n }\r\n\r\n /** Checks if the cache contains information about the changeset\r\n * @param iModelId Id of the iModel\r\n * @param changesetId Changeset to check for\r\n * @returns true if the changeset has been processed and exists in the cache\r\n */\r\n public static isProcessed(iModelId: GuidString, changesetId: string): boolean {\r\n const db: ChangedElementsDb | undefined = ChangedElementsManager.getChangedElementsDb(iModelId);\r\n if (!db)\r\n return false;\r\n\r\n return db.isProcessed(changesetId);\r\n }\r\n}\r\n"]}
|
|
@@ -11,12 +11,14 @@ import { SnapshotDb, TokenArg } from "./IModelDb";
|
|
|
11
11
|
*/
|
|
12
12
|
export interface CheckpointProps extends TokenArg {
|
|
13
13
|
readonly expectV2?: boolean;
|
|
14
|
-
/**
|
|
14
|
+
/** iTwin that the iModel belongs to */
|
|
15
15
|
readonly iTwinId: GuidString;
|
|
16
16
|
/** Id of the iModel */
|
|
17
17
|
readonly iModelId: GuidString;
|
|
18
18
|
/** changeset for the checkpoint */
|
|
19
19
|
readonly changeset: ChangesetIdWithIndex;
|
|
20
|
+
/** The number of seconds before the current token expires to attempt to reacquire a new token. Default is 1 hour. */
|
|
21
|
+
readonly reattachSafetySeconds?: number;
|
|
20
22
|
}
|
|
21
23
|
/** Called to show progress during a download. If this function returns non-zero, the download is aborted.
|
|
22
24
|
* @public
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckpointManager.d.ts","sourceRoot":"","sources":["../../src/CheckpointManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EAAE,OAAO,EAAmC,UAAU,EAA2C,MAAM,qBAAqB,CAAC;AACpI,OAAO,EAAoB,WAAW,EAAE,oBAAoB,EAAmD,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvK,OAAO,EAAoC,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG5F,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,C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int);
|
|
56
56
|
if (!v2props)
|
|
57
57
|
throw new Error("no checkpoint");
|
|
58
|
-
return
|
|
58
|
+
return { ...v2props, daemonDir: process.env.BLOCKCACHE_DIR, writeable: false };
|
|
59
59
|
}
|
|
60
60
|
catch (err) {
|
|
61
61
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `V2 checkpoint not found: err: ${err.message}`);
|
|
@@ -206,7 +206,7 @@ class CheckpointManager {
|
|
|
206
206
|
if (iModelId !== core_bentley_1.Guid.normalize(checkpoint.iModelId)) {
|
|
207
207
|
if (nativeDb.isReadonly())
|
|
208
208
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.ValidationFailed, "iModelId is not properly set up in the checkpoint");
|
|
209
|
-
core_bentley_1.Logger.logWarning(loggerCategory, "iModelId is not properly set up in the checkpoint. Updated checkpoint to the correct iModelId.", () => (
|
|
209
|
+
core_bentley_1.Logger.logWarning(loggerCategory, "iModelId is not properly set up in the checkpoint. Updated checkpoint to the correct iModelId.", () => ({ ...traceInfo, dbGuid: iModelId }));
|
|
210
210
|
nativeDb.setIModelId(core_bentley_1.Guid.normalize(checkpoint.iModelId));
|
|
211
211
|
// Required to reset the ChangeSetId because setDbGuid clears the value.
|
|
212
212
|
nativeDb.saveLocalValue("ParentChangeSetId", dbChangeset.id);
|