UNPKG

@itwin/imodels-client-management

Version:

iModels API client wrapper for applications that manage iModels.

50 lines 2.77 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { OperationsBase } from "../../base/internal"; export class CheckpointOperations extends OperationsBase { /** * Gets a single Checkpoint generated either on a specific Changeset or for a specific Named Version. This method * returns a Checkpoint in its full representation. Wraps * {@link https://developer.bentley.com/apis/imodels-v2/operations/get-changeset-checkpoint/ Get Changeset Checkpoint}, * {@link https://developer.bentley.com/apis/imodels-v2/operations/get-named-version-checkpoint/ Get Named Version Checkpoint} and * {@link https://developer.bentley.com/apis/imodels-v2/operations/get-briefcase-checkpoint/ Get Briefcase Checkpoint} * operations from iModels API. * @param {GetSingleCheckpointParams} params parameters for this operation. See {@link GetSingleCheckpointParams}. * @returns {Promise<Checkpoint>} a Checkpoint for the specified parent entity. See {@link Checkpoint}. */ async getSingle(params) { const { authorization, iModelId, headers, ...parentEntityId } = params; const response = await this.sendGetRequest({ authorization, url: this._options.urlFormatter.getCheckpointUrl({ iModelId, ...parentEntityId, }), headers, }); return response.body.checkpoint; } /** * Reschedules failed Named Version Checkpoint. This method * returns a Checkpoint in its full representation. Wraps the * {@link https://developer.bentley.com/apis/imodels-v2/operations/update-named-version-checkpoint/ * Update Named Version Checkpoint} operation from iModels API. * @param {GetSingleNamedVersionParams} params parameters for this operation. See {@link GetSingleNamedVersionParams}. * @returns {Promise<Checkpoint>} a Checkpoint for the specified parent entity. See {@link Checkpoint}. */ async updateNamedVersionCheckpoint(params) { const response = await this.sendPutRequest({ authorization: params.authorization, url: this._options.urlFormatter.getCheckpointUrl({ iModelId: params.iModelId, namedVersionId: params.namedVersionId, }), headers: params.headers, body: new Uint8Array(), }); return response.body.checkpoint; } } //# sourceMappingURL=CheckpointOperations.js.map