UNPKG

@itwin/imodels-client-management

Version:

iModels API client wrapper for applications that manage iModels.

53 lines 2.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LockOperations = 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"); const internal_2 = require("../../base/internal"); class LockOperations extends internal_2.OperationsBase { /** * Gets Locks for a specific iModel. This method returns Locks in their full representation. The returned iterator * internally queries entities in pages. Wraps the * {@link https://developer.bentley.com/apis/imodels-v2/operations/get-imodel-locks/ Get iModel Locks} operation from * iModels API. * @param {GetLockListParams} params parameters for this operation. See {@link GetLockListParams}. * @returns {EntityListIterator<Lock>} iterator for Lock list. See {@link EntityListIterator}, {@link Lock}. */ getList(params) { return new internal_1.EntityListIteratorImpl(async () => this.getEntityCollectionPage({ authorization: params.authorization, url: this._options.urlFormatter.getLockListUrl({ iModelId: params.iModelId, urlParams: params.urlParams, }), entityCollectionAccessor: (response) => response.body.locks, headers: params.headers, })); } /** * Releases Locks chunk for a specific Briefcase. This operation is used to release or abandon existing Locks. * Wraps the {@link https://developer.bentley.com/apis/imodels-v2/operations/release-imodel-locks-chunk/ * Release iModel Locks Chunk} operation from iModels API. * @param {ReleaseLocksChunkParams} params parameters for this operation. See {@link ReleaseLocksChunkParams}. * @returns {Promise<ReleaseLocksChunkResult>} result indicating if this was the last chunk. See {@link ReleaseLocksChunkResult}. */ async releaseLocksChunk(params) { const releaseLocksChunkResponse = await this.sendPostRequest({ authorization: params.authorization, url: this._options.urlFormatter.getReleaseLocksChunkUrl({ iModelId: params.iModelId, }), body: { briefcaseId: params.briefcaseId, changesetId: params.changesetId, }, headers: params.headers, }); return releaseLocksChunkResponse.body; } } exports.LockOperations = LockOperations; //# sourceMappingURL=LockOperations.js.map