UNPKG

@itwin/insights-client

Version:

Insights client for the iTwin platform

24 lines 1.4 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { GROUPING_AND_MAPPING_BASE_PATH, OperationsBase } from "../../common/OperationsBase"; export class CDMClient extends OperationsBase { constructor(basePath) { super(basePath ?? 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; } } //# sourceMappingURL=CDMClient.js.map