/** @packageDocumentation * @module iModelHubClient */ import { GuidString } from "@bentley/bentleyjs-core"; import { AuthorizedClientRequestContext, CancelRequest, FileHandler, ProgressCallback, WsgInstance, WsgQuery } from "@bentley/itwin-client"; import { IModelBaseHandler } from "./BaseHandler"; import { InitializationState } from "./iModels"; /** * Checkpoint is a copy of the master file, that is intended to be read-only and reduces amount of merging required to get an iModel to a specific previous state. * * File properties describe the file that would be downloaded through downloadUrl. * @internal */ export declare class Checkpoint extends WsgInstance { /** File name of the master file. */ fileName?: string; /** Description of the master file. */ fileDescription?: string; /** Size of the checkpoint file. */ fileSize?: string; /** FileId of the master file. */ fileId?: GuidString; /** State of checkpoint generation. */ state?: InitializationState; /** Id of the last [[ChangeSet]] that was merged into this checkpoint file. */ mergedChangeSetId?: string; /** Date when this checkpoint file was created. */ createdDate?: string; /** URL that can be used to download the checkpoint file from iModelHub. See [[CheckpointQuery.selectDownloadUrl]]. */ downloadUrl?: string; } /** * Query object for getting [[Checkpoint]]s. You can use this to modify the [[CheckpointHandler.get]] results. * @internal */ export declare class CheckpointQuery extends WsgQuery { /** Query will return closest [[Checkpoint]] to target [[ChangeSet]], based on ChangeSets size. * This query can return a Checkpoint that is ahead of the specified ChangeSet, if reversing ChangeSets would be faster than merging forward. This resets all previously set filters. * @returns This query. */ nearestCheckpoint(targetChangeSetId: string): this; /** Query will return closest [[Checkpoint]] to target [[ChangeSet]] that does not exceed the specified ChangeSet. * This query returns a closest Checkpoint that will reach target ChangeSet by only merging forward. This resets all previously set filters. * @returns This query. */ precedingCheckpoint(targetChangeSetId: string): this; /** Query will return [[Checkpoint]] with specified [[ChangeSet]] id. * @returns This query. */ byChangeSetId(changeSetId: string): this; /** Query will additionally select [[Checkpoint]] file download URL. This is needed to use the Checkpoint object with [[CheckpointHandler.download]]. * @returns This query. */ selectDownloadUrl(): this; } /** * Handler for managing [[Checkpoint]]s. Use [[IModelClient.checkpoints]] to get an instance of this class. * In most cases, you should use [BriefcaseDb]($backend) methods instead. * @internal */ export declare class CheckpointHandler { private _handler; private _fileHandler?; /** Constructor for CheckpointHandler. Use [[IModelClient]] instead of directly constructing this. * @param handler Handler for WSG requests. * @param fileHandler Handler for file system. * @internal */ constructor(handler: IModelBaseHandler, fileHandler?: FileHandler); /** Get relative url for Checkpoint requests. * @param iModelId Id of the iModel. See [[HubIModel]]. * @internal */ private getRelativeUrl; /** Get the [[Checkpoint]]s. * @param requestContext The client request context * @param iModelId Id of the iModel. See [[HubIModel]]. * @param query Optional query object to filter the queried Checkpoints or select different data from them. * @returns Checkpoints that match the query. * @throws [Common iModelHub errors]($docs/learning/iModelHub/CommonErrors) */ get(requestContext: AuthorizedClientRequestContext, iModelId: GuidString, query?: CheckpointQuery): Promise; /** * Make url safe for logging by removing sensitive information * @param url input url that will be strip of search and query parameters and replace them by ... for security reason */ private static getSafeUrlForLogging; /** Download the specified checkpoint file. This only downloads the file and does not update the [[Checkpoint]] id. Use [IModelDb.open]($backend) instead if you want to get a usable checkpoint file. * This method does not work on the browser. Directory containing the Checkpoint file is created if it does not exist. If there is an error during download, any partially downloaded file is deleted from disk. * @param requestContext The client request context * @param checkpoint Checkpoint to download. This needs to include a download link. See [[CheckpointQuery.selectDownloadUrl]]. * @param path Path where checkpoint file should be downloaded, including filename. * @param progressCallback Callback for tracking progress. * @param cancelRequest Request used to cancel download * @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) or [IModelHubStatus.InvalidArgumentError]($bentley) if one of the arguments is undefined or has an invalid value. * @throws [[IModelHubClientError]] with [IModelHubStatus.NotSupportedInBrowser]($bentley) if called in a browser. * @throws [[IModelHubClientError]] with [IModelHubStatus.FileHandlerNotSet]($bentley) if [[FileHandler]] instance was not set for [[IModelClient]]. * @throws [[ResponseError]] if the checkpoint cannot be downloaded. */ download(requestContext: AuthorizedClientRequestContext, checkpoint: Checkpoint, path: string, progressCallback?: ProgressCallback, cancelRequest?: CancelRequest): Promise; } //# sourceMappingURL=Checkpoints.d.ts.map