UNPKG

@itwin/presentation-common

Version:

Common pieces for iModel.js presentation packages

119 lines 8.03 kB
"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ /** @packageDocumentation * @module RPC */ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PresentationRpcInterface = void 0; const core_common_1 = require("@itwin/core-common"); const Utils_js_1 = require("./Utils.js"); /** * Interface used for communication between Presentation backend and frontend. * @public */ let PresentationRpcInterface = class PresentationRpcInterface extends core_common_1.RpcInterface { /** The immutable name of the interface. */ static interfaceName = "PresentationRpcInterface"; /** The semantic version of the interface. */ static interfaceVersion = "5.0.0"; /*=========================================================================================== NOTE: Any add/remove/change to the methods below requires an update of the interface version. NOTE: Please consult the README in core/common/src/rpc for the semantic versioning rules. ===========================================================================================*/ /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getNodesCount(_token, _options) { return this.forward(arguments); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getPagedNodes(_token, _options) { return (0, Utils_js_1.deepReplaceNullsToUndefined)(await this.forward(arguments)); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getNodesDescriptor(_token, _options) { return (0, Utils_js_1.deepReplaceNullsToUndefined)(await this.forward(arguments)); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ // TODO: add paged version of this (#387280) async getNodePaths(_token, _options) { return (0, Utils_js_1.deepReplaceNullsToUndefined)(await this.forward(arguments)); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ // TODO: add paged version of this (#387280) async getFilteredNodePaths(_token, _options) { return (0, Utils_js_1.deepReplaceNullsToUndefined)(await this.forward(arguments)); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getContentSources(_token, _options) { return (0, Utils_js_1.deepReplaceNullsToUndefined)(await this.forward(arguments)); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getContentDescriptor(_token, _options) { const response = await this.forward(arguments); return { ...response, ...(response.result ? { result: JSON.parse(response.result) } : {}), }; } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getContentSetSize(_token, _options) { return this.forward(arguments); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getPagedContent(_token, _options) { const rpcResponse = await this.forward(arguments); return { ...rpcResponse, ...(rpcResponse.result ? /* c8 ignore next */ { result: { ...rpcResponse.result, contentSet: (0, Utils_js_1.deepReplaceNullsToUndefined)(rpcResponse.result.contentSet) } } : {}), }; } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getPagedContentSet(_token, _options) { return (0, Utils_js_1.deepReplaceNullsToUndefined)(await this.forward(arguments)); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getElementProperties(_token, _options) { return (0, Utils_js_1.deepReplaceNullsToUndefined)(await this.forward(arguments)); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getPagedDistinctValues(_token, _options) { return (0, Utils_js_1.deepReplaceNullsToUndefined)(await this.forward(arguments)); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getContentInstanceKeys(_token, _options) { return this.forward(arguments); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getDisplayLabelDefinition(_token, _options) { return (0, Utils_js_1.deepReplaceNullsToUndefined)(await this.forward(arguments)); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ async getPagedDisplayLabelDefinitions(_token, _options) { return (0, Utils_js_1.deepReplaceNullsToUndefined)(await this.forward(arguments)); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ // eslint-disable-next-line @typescript-eslint/no-deprecated async getSelectionScopes(_token, _options) { return this.forward(arguments); } /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */ // eslint-disable-next-line @typescript-eslint/no-deprecated async computeSelection(_token, _options) { return this.forward(arguments); } }; exports.PresentationRpcInterface = PresentationRpcInterface; exports.PresentationRpcInterface = PresentationRpcInterface = __decorate([ core_common_1.RpcOperation.setDefaultPolicy({ retryInterval: () => 0 }) ], PresentationRpcInterface); //# sourceMappingURL=PresentationRpcInterface.js.map