UNPKG

@itwin/property-validation-client

Version:
50 lines 2.92 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { OperationUtils } from "../OperationUtils"; import { OperationsBase } from "../../base/OperationsBase"; export class SchemaOperations extends OperationsBase { constructor(options) { super(options); } /** * Extracts schema/properties info. Required once per iModel before calling getPropertiesInfo(). * Extraction is only performed if needed. Wraps the {@link https://developer.bentley.com/apis/clash-detection/operations/extract-schema-info/ * Extract schema info} operation from Clash Detection API. * @param {ParamsToExtractSchemaInfo} parameters for this operation. See {@link ParamsToExtractSchemaInfo}. * @returns {Promise<void>}. * @deprecated The method should not be used */ async extractSchemaInfo(params) { const { accessToken, iModelId, projectId } = params; const body = { projectId, }; OperationUtils.ensureAccessTokenProvided(accessToken, this._options.accessTokenCallback); await this.sendPostRequest({ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : await this._options.accessTokenCallback(), url: this._options.urlFormatter.extractSchemaInfoUrl({ iModelId }), body, }); } /** * Gets properties info identified by project and iModel id. * Wraps the {@link https://developer.bentley.com/apis/validation/operations/get-validation-propertyvalue-properties/ * Get properties info} operation from Property Validation API. * @param {ParamsToGetPropertiesInfo} params parameters for this operation. See {@link ParamsToGetPropertiesInfo}. * @returns {Promise<ResponseFromGetPropertiesInfo>} status and properties info for the specified iModel and filter string. See {@link ResponseFromGetPropertiesInfo}. */ async getPropertiesInfo(params) { const { accessToken, iModelId } = params; OperationUtils.ensureAccessTokenProvided(accessToken, this._options.accessTokenCallback); const response = await this.sendGetRequest({ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : await this._options.accessTokenCallback(), url: this._options.urlFormatter.getPropertiesInfoUrl({ iModelId, urlParams: params.urlParams }), }); return response; } } //# sourceMappingURL=SchemaOperations.js.map