UNPKG

@itwin/insights-client

Version:

Insights client for the iTwin platform

28 lines 1.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CDMClient = 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 OperationsBase_1 = require("../../common/OperationsBase"); class CDMClient extends OperationsBase_1.OperationsBase { constructor(basePath) { super(basePath ?? OperationsBase_1.GROUPING_AND_MAPPING_BASE_PATH); this._baseUrl = `${this.basePath}/datasources/imodel-mappings`; } async getCDM(accessToken, mappingId, extractionId) { const url = `${this._baseUrl}/${mappingId}/extractions/${extractionId}/cdm`; const request = this.createRequest("GET", accessToken); const response = await this.fetchJSON(url, request); return response; } async getCDMPartition(accessToken, mappingId, extractionId, location) { const url = `${this._baseUrl}/${encodeURIComponent(mappingId)}/extractions/${encodeURIComponent(extractionId)}/cdm/partitions?location=${encodeURIComponent(location)}`; const request = this.createRequest("GET", accessToken); const response = await this.fetchData(url, request); return response; } } exports.CDMClient = CDMClient; //# sourceMappingURL=CDMClient.js.map