UNPKG

@itwin/imodels-client-authoring

Version:

iModels API client wrapper for applications that author iModels.

34 lines 1.69 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { LockOperations as ManagementLockOperations, } from "@itwin/imodels-client-management"; export class LockOperations extends ManagementLockOperations { /** * Updates Lock for a specific Briefcase. This operation is used to acquire new locks and change the lock level for * already existing ones. Wraps the {@link https://developer.bentley.com/apis/imodels-v2/operations/update-imodel-locks/ * Update iModel Locks} operation from iModels API. * @param {UpdateLockParams} params parameters for this operation. See {@link UpdateLockParams}. * @returns {Promise<Lock>} updated Lock. See {@link Lock}. */ async update(params) { const updateLockBody = this.getUpdateLockBody(params); const updateLockResponse = await this.sendPatchRequest({ authorization: params.authorization, url: this._options.urlFormatter.getLockListUrl({ iModelId: params.iModelId, }), body: updateLockBody, headers: params.headers, }); return updateLockResponse.body.lock; } getUpdateLockBody(params) { return { briefcaseId: params.briefcaseId, changesetId: params.changesetId, lockedObjects: params.lockedObjects, }; } } //# sourceMappingURL=LockOperations.js.map