UNPKG

@itwin/imodels-client-management

Version:

iModels API client wrapper for applications that manage iModels.

54 lines 2.94 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CheckpointOperations = void 0; /*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ const internal_1 = require("../../base/internal"); class CheckpointOperations extends internal_1.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; } } exports.CheckpointOperations = CheckpointOperations; //# sourceMappingURL=CheckpointOperations.js.map