@itwin/insights-client
Version:
Insights client for the iTwin platform
28 lines • 1.52 kB
JavaScript
;
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 {
_baseUrl = `${this.basePath}/datasources/imodel-mappings`;
constructor(basePath) {
super(basePath ?? OperationsBase_1.GROUPING_AND_MAPPING_BASE_PATH);
}
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