@itwin/presentation-backend 5.2.0-dev.3 → 5.2.0-dev.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -1
- package/lib/cjs/presentation-backend/NativePlatform.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/NativePlatform.js +1 -0
- package/lib/cjs/presentation-backend/NativePlatform.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManager.d.ts +28 -2
- package/lib/cjs/presentation-backend/PresentationManager.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManager.js +18 -0
- package/lib/cjs/presentation-backend/PresentationManager.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManagerDetail.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManagerDetail.js +6 -0
- package/lib/cjs/presentation-backend/PresentationManagerDetail.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationRpcImpl.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/PresentationRpcImpl.js +2 -0
- package/lib/cjs/presentation-backend/PresentationRpcImpl.js.map +1 -1
- package/lib/esm/presentation-backend/NativePlatform.d.ts.map +1 -1
- package/lib/esm/presentation-backend/NativePlatform.js +1 -0
- package/lib/esm/presentation-backend/NativePlatform.js.map +1 -1
- package/lib/esm/presentation-backend/PresentationManager.d.ts +28 -2
- package/lib/esm/presentation-backend/PresentationManager.d.ts.map +1 -1
- package/lib/esm/presentation-backend/PresentationManager.js +18 -0
- package/lib/esm/presentation-backend/PresentationManager.js.map +1 -1
- package/lib/esm/presentation-backend/PresentationManagerDetail.d.ts.map +1 -1
- package/lib/esm/presentation-backend/PresentationManagerDetail.js +6 -0
- package/lib/esm/presentation-backend/PresentationManagerDetail.js.map +1 -1
- package/lib/esm/presentation-backend/PresentationRpcImpl.d.ts.map +1 -1
- package/lib/esm/presentation-backend/PresentationRpcImpl.js +2 -0
- package/lib/esm/presentation-backend/PresentationRpcImpl.js.map +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationRpcImpl.js","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationRpcImpl.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;AAEH,sDAAyD;AACzD,sDAA4G;AAC5G,oDAAwE;AACxE,oEA2CoC;AACpC,kEAAmH;AACnH,iHAAiH;AACjH,wDAAwD;AACxD,yEAAsE;AACtE,yEAA+E;AAC/E,6DAAoE;AACpE,uDAAiD;AAEjD,iFAAkG;AAClG,+DAAyD;AAEzD,MAAM,kBAAkB,GAAG,sBAAW,CAAC,OAAO,CAAC;AAI/C,gBAAgB;AACH,QAAA,qBAAqB,GAAG,IAAI,CAAC;AAC1C,gBAAgB;AACH,QAAA,0BAA0B,GAAG,KAAK,CAAC;AAEhD,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAErC;;;;;GAKG;AACH,MAAa,mBAAoB,SAAQ,8CAAwB;IACvD,eAAe,CAAS;IACxB,gBAAgB,CAAiD;IACjE,aAAa,CAAmC;IAChD,cAAc,CAA2C;IAEjE,YAAmB,KAAmC;QACpD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,eAAe,GAAG,KAAK,EAAE,cAAc,IAAI,uBAAuB,CAAC;QACxE,IAAI,CAAC,gBAAgB,GAAG,IAAI,sCAAgB,CAAC;YAC3C,6EAA6E;YAC7E,qFAAqF;YACrF,mBAAmB,EAAE,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS;YAE5F,mCAAmC;YACnC,eAAe,EAAE,IAAI;YAErB,cAAc,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE;gBAChC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;oBACzB,qBAAM,CAAC,QAAQ,CAAC,4DAAiC,CAAC,GAAG,EA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IAAI,CAAC,KAAM,SAAQ,4BAAa;wBAC9B,IAAI,GAAG,uBAAuB,CAAC;wBAC/B,IAAI,GAAG,GAAG,CAAC;qBACnB,CAAC,EAAE,CAAC;gBACP,KAAK,wCAAkB,CAAC,QAAQ;oBAC9B,OAAO,IAAI,CAAC,KAAM,SAAQ,8BAAe;wBAChC,IAAI,GAAG,WAAW,CAAC;wBACnB,IAAI,GAAG,GAAG,CAAC;qBACnB,CAAC,EAAE,CAAC;gBACP,KAAK,wCAAkB,CAAC,iBAAiB;oBACvC,OAAO,IAAI,CAAC,KAAM,SAAQ,4BAAa;wBAC9B,IAAI,GAAG,yBAAyB,CAAC;wBACjC,IAAI,GAAG,GAAG,CAAC;qBACnB,CAAC,EAAE,CAAC;gBACP,KAAK,wCAAkB,CAAC,KAAK,CAAC;gBAC9B,KAAK,wCAAkB,CAAC,eAAe;oBACrC,OAAO,IAAI,CAAC,KAAM,SAAQ,4BAAa;wBAC9B,IAAI,GAAG,uBAAuB,CAAC;wBAC/B,IAAI,GAAG,GAAG,CAAC;qBACnB,CAAC,EAAE,CAAC;YACT,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC;AACD,mBAAmB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RPC\n */\n\nimport { IModelDb, RpcTrace } from \"@itwin/core-backend\";\nimport { BeEvent, ErrorCategory, Logger, omit, StatusCategory, SuccessCategory } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcPendingResponse } from \"@itwin/core-common\";\nimport {\n ClientDiagnostics,\n ComputeSelectionRpcRequestOptions,\n ContentDescriptorRpcRequestOptions,\n ContentFlags,\n ContentInstanceKeysRpcRequestOptions,\n ContentRpcRequestOptions,\n ContentSourcesRpcRequestOptions,\n ContentSourcesRpcResult,\n DescriptorJSON,\n Diagnostics,\n DisplayLabelRpcRequestOptions,\n DisplayLabelsRpcRequestOptions,\n DisplayValueGroup,\n DistinctValuesRpcRequestOptions,\n ElementProperties,\n FilterByInstancePathsHierarchyRpcRequestOptions,\n FilterByTextHierarchyRpcRequestOptions,\n HierarchyLevel,\n HierarchyLevelDescriptorRpcRequestOptions,\n HierarchyRpcRequestOptions,\n ItemJSON,\n KeySet,\n KeySetJSON,\n LabelDefinition,\n Node,\n NodePathElement,\n Paged,\n PagedResponse,\n PageOptions,\n PresentationError,\n PresentationRpcInterface,\n PresentationRpcResponse,\n PresentationRpcResponseData,\n PresentationStatus,\n RpcDiagnosticsOptions,\n Ruleset,\n RulesetVariable,\n RulesetVariableJSON,\n SelectClassInfo,\n SelectionScope,\n SelectionScopeRpcRequestOptions,\n SingleElementPropertiesRpcRequestOptions,\n} from \"@itwin/presentation-common\";\nimport { createCancellableTimeoutPromise, deepReplaceNullsToUndefined } from \"@itwin/presentation-common/internal\";\n// @ts-expect-error TS complains about `with` in CJS builds; The path is fine at runtime, but not at compile time\n// eslint-disable-next-line @itwin/import-within-package\nimport packageJson from \"../../../package.json\" with { type: \"json\" };\nimport { PresentationBackendLoggerCategory } from \"./BackendLoggerCategory.js\";\nimport { _presentation_manager_detail } from \"./InternalSymbols.js\";\nimport { Presentation } from \"./Presentation.js\";\nimport { PresentationManager } from \"./PresentationManager.js\";\nimport { DESCRIPTOR_ONLY_CONTENT_FLAG, getRulesetIdObject } from \"./PresentationManagerDetail.js\";\nimport { TemporaryStorage } from \"./TemporaryStorage.js\";\n\nconst packageJsonVersion = packageJson.version;\n\ntype ContentGetter<TResult = any, TOptions = any> = (requestOptions: TOptions) => TResult;\n\n/** @internal */\nexport const MAX_ALLOWED_PAGE_SIZE = 1000;\n/** @internal */\nexport const MAX_ALLOWED_KEYS_PAGE_SIZE = 10000;\n\nconst DEFAULT_REQUEST_TIMEOUT = 5000;\n\n/**\n * The backend implementation of PresentationRpcInterface. All it's basically\n * responsible for is forwarding calls to [[Presentation.manager]].\n *\n * @internal\n */\nexport class PresentationRpcImpl extends PresentationRpcInterface implements Disposable {\n private _requestTimeout: number;\n private _pendingRequests: TemporaryStorage<PresentationRpcResponse<any>>;\n private _cancelEvents: Map<string, BeEvent<() => void>>;\n private _statusHandler: (e: Error) => StatusCategory | undefined;\n\n public constructor(props?: { requestTimeout?: number }) {\n super();\n this._requestTimeout = props?.requestTimeout ?? DEFAULT_REQUEST_TIMEOUT;\n this._pendingRequests = new TemporaryStorage({\n // remove the pending request after request timeout + 10 seconds - this gives\n // frontend 10 seconds to re-send the request until it's removed from requests' cache\n unusedValueLifetime: this._requestTimeout > 0 ? this._requestTimeout + 10 * 1000 : undefined,\n\n // attempt to clean up every second\n cleanupInterval: 1000,\n\n cleanupHandler: (id, _, reason) => {\n if (reason !== \"request\") {\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Cleaning up request without frontend retrieving it: ${id}.`);\n /* c8 ignore next */\n this._cancelEvents.get(id)?.raiseEvent();\n }\n this._cancelEvents.delete(id);\n },\n });\n this._cancelEvents = new Map<string, BeEvent<() => void>>();\n\n this._statusHandler = createStatusCategoryHandler();\n StatusCategory.handlers.add(this._statusHandler);\n }\n\n public [Symbol.dispose]() {\n this._pendingRequests[Symbol.dispose]();\n StatusCategory.handlers.delete(this._statusHandler);\n }\n\n public get requestTimeout() {\n return this._requestTimeout;\n }\n\n public get pendingRequests() {\n return this._pendingRequests;\n }\n\n /** Returns an ok response with result inside */\n private successResponse<TResult>(result: TResult, diagnostics?: ClientDiagnostics) {\n return {\n statusCode: PresentationStatus.Success,\n result,\n diagnostics,\n };\n }\n\n /** Returns a bad request response with empty result and an error code */\n private errorResponse(errorCode: PresentationStatus, errorMessage?: string, diagnostics?: ClientDiagnostics) {\n return {\n statusCode: errorCode,\n result: undefined,\n errorMessage,\n diagnostics,\n };\n }\n\n /**\n * Get the [[PresentationManager]] used by this RPC impl.\n */\n public getManager(clientId?: string): PresentationManager {\n return Presentation.getManager(clientId);\n }\n\n private async getIModel(token: IModelRpcProps): Promise<IModelDb> {\n const imodel = IModelDb.findByKey(token.key);\n // call refreshContainer, just in case this is a V2 checkpoint whose sasToken is about to expire, or its default transaction is about to be restarted.\n await imodel.refreshContainerForRpc(RpcTrace.expectCurrentActivity.accessToken);\n return imodel;\n }\n\n private async makeRequest<\n TRpcOptions extends { rulesetOrId?: Ruleset | string; clientId?: string; diagnostics?: RpcDiagnosticsOptions; rulesetVariables?: RulesetVariableJSON[] },\n TResult,\n >(token: IModelRpcProps, requestId: string, requestOptions: TRpcOptions, request: ContentGetter<Promise<TResult>>): PresentationRpcResponse<TResult> {\n const serializedRequestOptionsForLogging = JSON.stringify({\n ...omit(requestOptions, [\"rulesetOrId\"]),\n ...(requestOptions.rulesetOrId ? { rulesetId: getRulesetIdObject(requestOptions.rulesetOrId).uniqueId } : undefined),\n });\n Logger.logInfo(PresentationBackendLoggerCategory.Rpc, `Received '${requestId}' request. Params: ${serializedRequestOptionsForLogging}`);\n\n const imodel = await this.getIModel(token);\n const requestKey = JSON.stringify({ iModelKey: token.key, requestId, requestOptions });\n let resultPromise = this._pendingRequests.getValue(requestKey);\n if (resultPromise) {\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Request already pending`);\n } else {\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Request not found, creating a new one`);\n const { clientId: _, diagnostics: diagnosticsOptions, rulesetVariables, ...options } = requestOptions;\n const managerRequestOptions: any = {\n ...options,\n imodel,\n cancelEvent: new BeEvent<() => void>(),\n };\n\n // set up ruleset variables\n if (rulesetVariables) {\n managerRequestOptions.rulesetVariables = rulesetVariables.map(RulesetVariable.fromJSON);\n }\n\n // set up diagnostics listener\n let diagnostics: ClientDiagnostics | undefined;\n const getDiagnostics = (): ClientDiagnostics => {\n if (!diagnostics) {\n diagnostics = {};\n }\n return diagnostics;\n };\n if (diagnosticsOptions) {\n if (diagnosticsOptions.backendVersion) {\n getDiagnostics().backendVersion = packageJsonVersion;\n }\n managerRequestOptions.diagnostics = {\n ...diagnosticsOptions,\n handler: (d: Diagnostics) => {\n if (d.logs) {\n const target = getDiagnostics();\n if (target.logs) {\n target.logs.push(...d.logs);\n } else {\n target.logs = [...d.logs];\n }\n }\n },\n };\n }\n\n // initiate request\n resultPromise = request(managerRequestOptions).then((result) => this.successResponse(result, diagnostics));\n\n // store the request promise\n this._pendingRequests.addValue(requestKey, resultPromise);\n this._cancelEvents.set(requestKey, managerRequestOptions.cancelEvent);\n }\n\n if (this._requestTimeout === 0) {\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Request timeout not configured, returning promise without a timeout.`);\n void resultPromise.finally(() => {\n this._pendingRequests.deleteValue(requestKey);\n });\n return resultPromise;\n }\n\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Returning a promise with a timeout of ${this._requestTimeout}.`);\n const timeout = createCancellableTimeoutPromise(this._requestTimeout);\n return Promise.race([\n resultPromise,\n timeout.promise.then(() => {\n // eslint-disable-next-line @typescript-eslint/only-throw-error\n throw new RpcPendingResponse(\"Timeout\");\n }),\n ])\n .then((response: PresentationRpcResponseData<TResult>) => {\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Request completed, returning result.`);\n this._pendingRequests.deleteValue(requestKey);\n return response;\n })\n .finally(() => {\n timeout.cancel();\n });\n }\n\n public override async getNodesCount(token: IModelRpcProps, requestOptions: HierarchyRpcRequestOptions): PresentationRpcResponse<number> {\n return this.makeRequest(token, \"getNodesCount\", requestOptions, async (options) => {\n return this.getManager(requestOptions.clientId).getNodesCount(options);\n });\n }\n\n public override async getPagedNodes(token: IModelRpcProps, requestOptions: Paged<HierarchyRpcRequestOptions>): PresentationRpcResponse<PagedResponse<Node>> {\n return this.makeRequest(token, \"getPagedNodes\", requestOptions, async (options) => {\n options = enforceValidPageSize(options);\n const [serializedHierarchyLevel, count] = await Promise.all([\n this.getManager(requestOptions.clientId)[_presentation_manager_detail].getNodes(options),\n this.getManager(requestOptions.clientId).getNodesCount(options),\n ]);\n const hierarchyLevel: HierarchyLevel = deepReplaceNullsToUndefined(JSON.parse(serializedHierarchyLevel));\n return {\n total: count,\n items: hierarchyLevel.nodes,\n };\n });\n }\n\n public override async getNodesDescriptor(\n token: IModelRpcProps,\n requestOptions: HierarchyLevelDescriptorRpcRequestOptions,\n ): PresentationRpcResponse<string | DescriptorJSON | undefined> {\n return this.makeRequest(token, \"getNodesDescriptor\", requestOptions, async (options) => {\n return this.getManager(requestOptions.clientId)[_presentation_manager_detail].getNodesDescriptor(options);\n });\n }\n\n public override async getNodePaths(\n token: IModelRpcProps,\n requestOptions: FilterByInstancePathsHierarchyRpcRequestOptions,\n ): PresentationRpcResponse<NodePathElement[]> {\n return this.makeRequest(token, \"getNodePaths\", requestOptions, async (options) => {\n return this.getManager(requestOptions.clientId)[_presentation_manager_detail].getNodePaths(options);\n });\n }\n\n public override async getFilteredNodePaths(\n token: IModelRpcProps,\n requestOptions: FilterByTextHierarchyRpcRequestOptions,\n ): PresentationRpcResponse<NodePathElement[]> {\n return this.makeRequest(token, \"getFilteredNodePaths\", requestOptions, async (options) => {\n return this.getManager(requestOptions.clientId)[_presentation_manager_detail].getFilteredNodePaths(options);\n });\n }\n\n public override async getContentSources(\n token: IModelRpcProps,\n requestOptions: ContentSourcesRpcRequestOptions,\n ): PresentationRpcResponse<ContentSourcesRpcResult> {\n return this.makeRequest(token, \"getContentSources\", requestOptions, async (options) => {\n const result = await this.getManager(requestOptions.clientId).getContentSources(options);\n const classesMap = {};\n const selectClasses = result.map((sci) => SelectClassInfo.toCompressedJSON(sci, classesMap));\n return { sources: selectClasses, classesMap };\n });\n }\n\n public override async getContentDescriptor(\n token: IModelRpcProps,\n requestOptions: ContentDescriptorRpcRequestOptions,\n ): PresentationRpcResponse<DescriptorJSON | undefined> {\n return this.makeRequest(token, \"getContentDescriptor\", requestOptions, async (options) => {\n options = {\n ...options,\n contentFlags: (options.contentFlags ?? 0) | DESCRIPTOR_ONLY_CONTENT_FLAG, // always append the \"descriptor only\" flag when handling request from the frontend\n keys: KeySet.fromJSON(options.keys),\n };\n // Here we send a plain JSON string but we will parse it to DescriptorJSON on the frontend. This way we are\n // bypassing unnecessary deserialization and serialization.\n return Presentation.getManager(requestOptions.clientId)[_presentation_manager_detail].getContentDescriptor(options) as unknown as\n | DescriptorJSON\n | undefined;\n });\n }\n\n public override async getContentSetSize(token: IModelRpcProps, requestOptions: ContentRpcRequestOptions): PresentationRpcResponse<number> {\n return this.makeRequest(token, \"getContentSetSize\", requestOptions, async (options) => {\n options = {\n ...options,\n keys: KeySet.fromJSON(options.keys),\n };\n return this.getManager(requestOptions.clientId).getContentSetSize(options);\n });\n }\n\n public override async getPagedContent(\n token: IModelRpcProps,\n requestOptions: Paged<ContentRpcRequestOptions>,\n ): PresentationRpcResponse<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined> {\n return this.makeRequest(token, \"getPagedContent\", requestOptions, async (options) => {\n options = enforceValidPageSize({\n ...options,\n keys: KeySet.fromJSON(options.keys),\n });\n\n const [size, content] = await Promise.all([\n this.getManager(requestOptions.clientId).getContentSetSize(options),\n this.getManager(requestOptions.clientId)[_presentation_manager_detail].getContent(options),\n ]);\n\n if (!content) {\n return undefined;\n }\n\n return {\n descriptor: content.descriptor.toJSON(),\n contentSet: {\n total: size,\n items: content.contentSet.map((i) => i.toJSON()),\n },\n };\n });\n }\n\n public override async getPagedContentSet(\n token: IModelRpcProps,\n requestOptions: Paged<ContentRpcRequestOptions>,\n ): PresentationRpcResponse<PagedResponse<ItemJSON>> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const response = await this.getPagedContent(token, requestOptions);\n if (response.statusCode !== PresentationStatus.Success) {\n return this.errorResponse(response.statusCode, response.errorMessage, response.diagnostics);\n }\n if (!response.result) {\n return this.errorResponse(PresentationStatus.Error, `Failed to get content set (received a success response with empty result)`, response.diagnostics);\n }\n return {\n ...response,\n result: response.result.contentSet,\n };\n }\n\n public override async getElementProperties(\n token: IModelRpcProps,\n requestOptions: SingleElementPropertiesRpcRequestOptions,\n ): PresentationRpcResponse<ElementProperties | undefined> {\n return this.makeRequest(token, \"getElementProperties\", { ...requestOptions }, async (options) => {\n const { clientId, ...restOptions } = options;\n return this.getManager(clientId).getElementProperties(restOptions);\n });\n }\n\n public override async getPagedDistinctValues(\n token: IModelRpcProps,\n requestOptions: DistinctValuesRpcRequestOptions,\n ): PresentationRpcResponse<PagedResponse<DisplayValueGroup>> {\n return this.makeRequest(token, \"getPagedDistinctValues\", requestOptions, async (options) => {\n options = enforceValidPageSize({\n ...options,\n keys: KeySet.fromJSON(options.keys),\n });\n return this.getManager(requestOptions.clientId)[_presentation_manager_detail].getPagedDistinctValues(options);\n });\n }\n\n public override async getContentInstanceKeys(\n token: IModelRpcProps,\n requestOptions: ContentInstanceKeysRpcRequestOptions,\n ): PresentationRpcResponse<{ total: number; items: KeySetJSON }> {\n return this.makeRequest(token, \"getContentInstanceKeys\", requestOptions, async (options) => {\n const { displayType, ...optionsNoDisplayType } = options;\n options = enforceValidPageSize(\n {\n ...optionsNoDisplayType,\n keys: KeySet.fromJSON(optionsNoDisplayType.keys),\n descriptor: {\n displayType,\n contentFlags: ContentFlags.KeysOnly,\n },\n },\n MAX_ALLOWED_KEYS_PAGE_SIZE,\n );\n\n const [size, content] = await Promise.all([\n this.getManager(requestOptions.clientId).getContentSetSize(options),\n this.getManager(requestOptions.clientId)[_presentation_manager_detail].getContent(options),\n ]);\n\n if (size === 0 || !content) {\n return { total: 0, items: new KeySet().toJSON() };\n }\n\n return {\n total: size,\n items: content.contentSet.reduce((keys, item) => keys.add(item.primaryKeys), new KeySet()).toJSON(),\n };\n });\n }\n\n public override async getDisplayLabelDefinition(\n token: IModelRpcProps,\n requestOptions: DisplayLabelRpcRequestOptions,\n ): PresentationRpcResponse<LabelDefinition> {\n return this.makeRequest(token, \"getDisplayLabelDefinition\", requestOptions, async (options) => {\n const label = await this.getManager(requestOptions.clientId)[_presentation_manager_detail].getDisplayLabelDefinition(options);\n return label;\n });\n }\n\n public override async getPagedDisplayLabelDefinitions(\n token: IModelRpcProps,\n requestOptions: DisplayLabelsRpcRequestOptions,\n ): PresentationRpcResponse<PagedResponse<LabelDefinition>> {\n const pageOpts = enforceValidPageSize({ paging: { start: 0, size: requestOptions.keys.length } });\n if (pageOpts.paging.size < requestOptions.keys.length) {\n requestOptions.keys.splice(pageOpts.paging.size);\n }\n return this.makeRequest(token, \"getPagedDisplayLabelDefinitions\", requestOptions, async (options) => {\n const labels = await this.getManager(requestOptions.clientId)[_presentation_manager_detail].getDisplayLabelDefinitions({\n ...options,\n keys: options.keys,\n });\n return {\n total: options.keys.length,\n items: labels,\n };\n });\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n public override async getSelectionScopes(token: IModelRpcProps, requestOptions: SelectionScopeRpcRequestOptions): PresentationRpcResponse<SelectionScope[]> {\n return this.makeRequest(token, \"getSelectionScopes\", requestOptions, async (options) =>\n this.getManager(requestOptions.clientId).getSelectionScopes(options),\n );\n }\n\n public override async computeSelection(token: IModelRpcProps, requestOptions: ComputeSelectionRpcRequestOptions): PresentationRpcResponse<KeySetJSON> {\n return this.makeRequest(token, \"computeSelection\", requestOptions, async (options) => {\n const keys = await this.getManager(requestOptions.clientId).computeSelection(options);\n return keys.toJSON();\n });\n }\n /* eslint-enable @typescript-eslint/no-deprecated */\n}\n\nconst enforceValidPageSize = <TOptions extends Paged<object>>(\n requestOptions: TOptions,\n maxPageSize = MAX_ALLOWED_PAGE_SIZE,\n): TOptions & { paging: PageOptions } => {\n const validPageSize = getValidPageSize(requestOptions.paging?.size, maxPageSize);\n if (!requestOptions.paging || requestOptions.paging.size !== validPageSize) {\n return { ...requestOptions, paging: { ...requestOptions.paging, size: validPageSize } };\n }\n return requestOptions as TOptions & { paging: PageOptions };\n};\n\nconst getValidPageSize = (size: number | undefined, maxPageSize: number) => {\n const requestedSize = size ?? 0;\n return requestedSize === 0 || requestedSize > maxPageSize ? maxPageSize : requestedSize;\n};\n\n// not testing temporary solution\n/* c8 ignore start */\nfunction createStatusCategoryHandler() {\n return (e: Error) => {\n if (e instanceof PresentationError) {\n switch (e.errorNumber) {\n case PresentationStatus.NotInitialized:\n return new (class extends ErrorCategory {\n public name = \"Internal server error\";\n public code = 500;\n })();\n case PresentationStatus.Canceled:\n return new (class extends SuccessCategory {\n public name = \"Cancelled\";\n public code = 204;\n })();\n case PresentationStatus.ResultSetTooLarge:\n return new (class extends ErrorCategory {\n public name = \"Result set is too large\";\n public code = 413;\n })();\n case PresentationStatus.Error:\n case PresentationStatus.InvalidArgument:\n return new (class extends ErrorCategory {\n public name = \"Invalid request props\";\n public code = 422;\n })();\n }\n }\n return undefined;\n };\n}\n/* c8 ignore end */\n"]}
|
|
1
|
+
{"version":3,"file":"PresentationRpcImpl.js","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationRpcImpl.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;AAEH,sDAAyD;AACzD,sDAA4G;AAC5G,oDAAwE;AACxE,oEA2CoC;AACpC,kEAAmH;AACnH,iHAAiH;AACjH,wDAAwD;AACxD,yEAAsE;AACtE,yEAA+E;AAC/E,6DAAoE;AACpE,uDAAiD;AAEjD,iFAAkG;AAClG,+DAAyD;AAEzD,MAAM,kBAAkB,GAAG,sBAAW,CAAC,OAAO,CAAC;AAI/C,gBAAgB;AACH,QAAA,qBAAqB,GAAG,IAAI,CAAC;AAC1C,gBAAgB;AACH,QAAA,0BAA0B,GAAG,KAAK,CAAC;AAEhD,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAErC;;;;;GAKG;AACH,MAAa,mBAAoB,SAAQ,8CAAwB;IACvD,eAAe,CAAS;IACxB,gBAAgB,CAAiD;IACjE,aAAa,CAAmC;IAChD,cAAc,CAA2C;IAEjE,YAAmB,KAAmC;QACpD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,eAAe,GAAG,KAAK,EAAE,cAAc,I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AAmB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RPC\n */\n\nimport { IModelDb, RpcTrace } from \"@itwin/core-backend\";\nimport { BeEvent, ErrorCategory, Logger, omit, StatusCategory, SuccessCategory } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcPendingResponse } from \"@itwin/core-common\";\nimport {\n ClientDiagnostics,\n ComputeSelectionRpcRequestOptions,\n ContentDescriptorRpcRequestOptions,\n ContentFlags,\n ContentInstanceKeysRpcRequestOptions,\n ContentRpcRequestOptions,\n ContentSourcesRpcRequestOptions,\n ContentSourcesRpcResult,\n DescriptorJSON,\n Diagnostics,\n DisplayLabelRpcRequestOptions,\n DisplayLabelsRpcRequestOptions,\n DisplayValueGroup,\n DistinctValuesRpcRequestOptions,\n ElementProperties,\n FilterByInstancePathsHierarchyRpcRequestOptions,\n FilterByTextHierarchyRpcRequestOptions,\n HierarchyLevel,\n HierarchyLevelDescriptorRpcRequestOptions,\n HierarchyRpcRequestOptions,\n ItemJSON,\n KeySet,\n KeySetJSON,\n LabelDefinition,\n Node,\n NodePathElement,\n Paged,\n PagedResponse,\n PageOptions,\n PresentationError,\n PresentationRpcInterface,\n PresentationRpcResponse,\n PresentationRpcResponseData,\n PresentationStatus,\n RpcDiagnosticsOptions,\n Ruleset,\n RulesetVariable,\n RulesetVariableJSON,\n SelectClassInfo,\n SelectionScope,\n SelectionScopeRpcRequestOptions,\n SingleElementPropertiesRpcRequestOptions,\n} from \"@itwin/presentation-common\";\nimport { createCancellableTimeoutPromise, deepReplaceNullsToUndefined } from \"@itwin/presentation-common/internal\";\n// @ts-expect-error TS complains about `with` in CJS builds; The path is fine at runtime, but not at compile time\n// eslint-disable-next-line @itwin/import-within-package\nimport packageJson from \"../../../package.json\" with { type: \"json\" };\nimport { PresentationBackendLoggerCategory } from \"./BackendLoggerCategory.js\";\nimport { _presentation_manager_detail } from \"./InternalSymbols.js\";\nimport { Presentation } from \"./Presentation.js\";\nimport { PresentationManager } from \"./PresentationManager.js\";\nimport { DESCRIPTOR_ONLY_CONTENT_FLAG, getRulesetIdObject } from \"./PresentationManagerDetail.js\";\nimport { TemporaryStorage } from \"./TemporaryStorage.js\";\n\nconst packageJsonVersion = packageJson.version;\n\ntype ContentGetter<TResult = any, TOptions = any> = (requestOptions: TOptions) => TResult;\n\n/** @internal */\nexport const MAX_ALLOWED_PAGE_SIZE = 1000;\n/** @internal */\nexport const MAX_ALLOWED_KEYS_PAGE_SIZE = 10000;\n\nconst DEFAULT_REQUEST_TIMEOUT = 5000;\n\n/**\n * The backend implementation of PresentationRpcInterface. All it's basically\n * responsible for is forwarding calls to [[Presentation.manager]].\n *\n * @internal\n */\nexport class PresentationRpcImpl extends PresentationRpcInterface implements Disposable {\n private _requestTimeout: number;\n private _pendingRequests: TemporaryStorage<PresentationRpcResponse<any>>;\n private _cancelEvents: Map<string, BeEvent<() => void>>;\n private _statusHandler: (e: Error) => StatusCategory | undefined;\n\n public constructor(props?: { requestTimeout?: number }) {\n super();\n this._requestTimeout = props?.requestTimeout ?? DEFAULT_REQUEST_TIMEOUT;\n this._pendingRequests = new TemporaryStorage({\n // remove the pending request after request timeout + 10 seconds - this gives\n // frontend 10 seconds to re-send the request until it's removed from requests' cache\n unusedValueLifetime: this._requestTimeout > 0 ? this._requestTimeout + 10 * 1000 : undefined,\n\n // attempt to clean up every second\n cleanupInterval: 1000,\n\n cleanupHandler: (id, _, reason) => {\n if (reason !== \"request\") {\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Cleaning up request without frontend retrieving it: ${id}.`);\n /* c8 ignore next */\n this._cancelEvents.get(id)?.raiseEvent();\n }\n this._cancelEvents.delete(id);\n },\n });\n this._cancelEvents = new Map<string, BeEvent<() => void>>();\n\n this._statusHandler = createStatusCategoryHandler();\n StatusCategory.handlers.add(this._statusHandler);\n }\n\n public [Symbol.dispose]() {\n this._pendingRequests[Symbol.dispose]();\n StatusCategory.handlers.delete(this._statusHandler);\n }\n\n public get requestTimeout() {\n return this._requestTimeout;\n }\n\n public get pendingRequests() {\n return this._pendingRequests;\n }\n\n /** Returns an ok response with result inside */\n private successResponse<TResult>(result: TResult, diagnostics?: ClientDiagnostics) {\n return {\n statusCode: PresentationStatus.Success,\n result,\n diagnostics,\n };\n }\n\n /** Returns a bad request response with empty result and an error code */\n private errorResponse(errorCode: PresentationStatus, errorMessage?: string, diagnostics?: ClientDiagnostics) {\n return {\n statusCode: errorCode,\n result: undefined,\n errorMessage,\n diagnostics,\n };\n }\n\n /**\n * Get the [[PresentationManager]] used by this RPC impl.\n */\n public getManager(clientId?: string): PresentationManager {\n return Presentation.getManager(clientId);\n }\n\n private async getIModel(token: IModelRpcProps): Promise<IModelDb> {\n const imodel = IModelDb.findByKey(token.key);\n // call refreshContainer, just in case this is a V2 checkpoint whose sasToken is about to expire, or its default transaction is about to be restarted.\n await imodel.refreshContainerForRpc(RpcTrace.expectCurrentActivity.accessToken);\n return imodel;\n }\n\n private async makeRequest<\n TRpcOptions extends { rulesetOrId?: Ruleset | string; clientId?: string; diagnostics?: RpcDiagnosticsOptions; rulesetVariables?: RulesetVariableJSON[] },\n TResult,\n >(token: IModelRpcProps, requestId: string, requestOptions: TRpcOptions, request: ContentGetter<Promise<TResult>>): PresentationRpcResponse<TResult> {\n const serializedRequestOptionsForLogging = JSON.stringify({\n ...omit(requestOptions, [\"rulesetOrId\"]),\n ...(requestOptions.rulesetOrId ? { rulesetId: getRulesetIdObject(requestOptions.rulesetOrId).uniqueId } : undefined),\n });\n Logger.logInfo(PresentationBackendLoggerCategory.Rpc, `Received '${requestId}' request. Params: ${serializedRequestOptionsForLogging}`);\n\n const imodel = await this.getIModel(token);\n const requestKey = JSON.stringify({ iModelKey: token.key, requestId, requestOptions });\n let resultPromise = this._pendingRequests.getValue(requestKey);\n if (resultPromise) {\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Request already pending`);\n } else {\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Request not found, creating a new one`);\n const { clientId: _, diagnostics: diagnosticsOptions, rulesetVariables, ...options } = requestOptions;\n const managerRequestOptions: any = {\n ...options,\n imodel,\n cancelEvent: new BeEvent<() => void>(),\n };\n\n // set up ruleset variables\n if (rulesetVariables) {\n managerRequestOptions.rulesetVariables = rulesetVariables.map(RulesetVariable.fromJSON);\n }\n\n // set up diagnostics listener\n let diagnostics: ClientDiagnostics | undefined;\n const getDiagnostics = (): ClientDiagnostics => {\n if (!diagnostics) {\n diagnostics = {};\n }\n return diagnostics;\n };\n if (diagnosticsOptions) {\n if (diagnosticsOptions.backendVersion) {\n getDiagnostics().backendVersion = packageJsonVersion;\n }\n managerRequestOptions.diagnostics = {\n ...diagnosticsOptions,\n handler: (d: Diagnostics) => {\n if (d.logs) {\n const target = getDiagnostics();\n if (target.logs) {\n target.logs.push(...d.logs);\n } else {\n target.logs = [...d.logs];\n }\n }\n },\n };\n }\n\n // initiate request\n resultPromise = request(managerRequestOptions).then((result) => this.successResponse(result, diagnostics));\n\n // store the request promise\n this._pendingRequests.addValue(requestKey, resultPromise);\n this._cancelEvents.set(requestKey, managerRequestOptions.cancelEvent);\n }\n\n if (this._requestTimeout === 0) {\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Request timeout not configured, returning promise without a timeout.`);\n void resultPromise.finally(() => {\n this._pendingRequests.deleteValue(requestKey);\n });\n return resultPromise;\n }\n\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Returning a promise with a timeout of ${this._requestTimeout}.`);\n const timeout = createCancellableTimeoutPromise(this._requestTimeout);\n return Promise.race([\n resultPromise,\n timeout.promise.then(() => {\n // eslint-disable-next-line @typescript-eslint/only-throw-error\n throw new RpcPendingResponse(\"Timeout\");\n }),\n ])\n .then((response: PresentationRpcResponseData<TResult>) => {\n Logger.logTrace(PresentationBackendLoggerCategory.Rpc, `Request completed, returning result.`);\n this._pendingRequests.deleteValue(requestKey);\n return response;\n })\n .finally(() => {\n timeout.cancel();\n });\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n\n public override async getNodesCount(token: IModelRpcProps, requestOptions: HierarchyRpcRequestOptions): PresentationRpcResponse<number> {\n return this.makeRequest(token, \"getNodesCount\", requestOptions, async (options) => {\n return this.getManager(requestOptions.clientId).getNodesCount(options);\n });\n }\n\n public override async getPagedNodes(token: IModelRpcProps, requestOptions: Paged<HierarchyRpcRequestOptions>): PresentationRpcResponse<PagedResponse<Node>> {\n return this.makeRequest(token, \"getPagedNodes\", requestOptions, async (options) => {\n options = enforceValidPageSize(options);\n const [serializedHierarchyLevel, count] = await Promise.all([\n this.getManager(requestOptions.clientId)[_presentation_manager_detail].getNodes(options),\n this.getManager(requestOptions.clientId).getNodesCount(options),\n ]);\n const hierarchyLevel: HierarchyLevel = deepReplaceNullsToUndefined(JSON.parse(serializedHierarchyLevel));\n return {\n total: count,\n items: hierarchyLevel.nodes,\n };\n });\n }\n\n public override async getNodesDescriptor(\n token: IModelRpcProps,\n requestOptions: HierarchyLevelDescriptorRpcRequestOptions,\n ): PresentationRpcResponse<string | DescriptorJSON | undefined> {\n return this.makeRequest(token, \"getNodesDescriptor\", requestOptions, async (options) => {\n return this.getManager(requestOptions.clientId)[_presentation_manager_detail].getNodesDescriptor(options);\n });\n }\n\n public override async getNodePaths(\n token: IModelRpcProps,\n requestOptions: FilterByInstancePathsHierarchyRpcRequestOptions,\n ): PresentationRpcResponse<NodePathElement[]> {\n return this.makeRequest(token, \"getNodePaths\", requestOptions, async (options) => {\n return this.getManager(requestOptions.clientId)[_presentation_manager_detail].getNodePaths(options);\n });\n }\n\n public override async getFilteredNodePaths(\n token: IModelRpcProps,\n requestOptions: FilterByTextHierarchyRpcRequestOptions,\n ): PresentationRpcResponse<NodePathElement[]> {\n return this.makeRequest(token, \"getFilteredNodePaths\", requestOptions, async (options) => {\n return this.getManager(requestOptions.clientId)[_presentation_manager_detail].getFilteredNodePaths(options);\n });\n }\n\n /* eslint-enable @typescript-eslint/no-deprecated */\n\n public override async getContentSources(\n token: IModelRpcProps,\n requestOptions: ContentSourcesRpcRequestOptions,\n ): PresentationRpcResponse<ContentSourcesRpcResult> {\n return this.makeRequest(token, \"getContentSources\", requestOptions, async (options) => {\n const result = await this.getManager(requestOptions.clientId).getContentSources(options);\n const classesMap = {};\n const selectClasses = result.map((sci) => SelectClassInfo.toCompressedJSON(sci, classesMap));\n return { sources: selectClasses, classesMap };\n });\n }\n\n public override async getContentDescriptor(\n token: IModelRpcProps,\n requestOptions: ContentDescriptorRpcRequestOptions,\n ): PresentationRpcResponse<DescriptorJSON | undefined> {\n return this.makeRequest(token, \"getContentDescriptor\", requestOptions, async (options) => {\n options = {\n ...options,\n contentFlags: (options.contentFlags ?? 0) | DESCRIPTOR_ONLY_CONTENT_FLAG, // always append the \"descriptor only\" flag when handling request from the frontend\n keys: KeySet.fromJSON(options.keys),\n };\n // Here we send a plain JSON string but we will parse it to DescriptorJSON on the frontend. This way we are\n // bypassing unnecessary deserialization and serialization.\n return Presentation.getManager(requestOptions.clientId)[_presentation_manager_detail].getContentDescriptor(options) as unknown as\n | DescriptorJSON\n | undefined;\n });\n }\n\n public override async getContentSetSize(token: IModelRpcProps, requestOptions: ContentRpcRequestOptions): PresentationRpcResponse<number> {\n return this.makeRequest(token, \"getContentSetSize\", requestOptions, async (options) => {\n options = {\n ...options,\n keys: KeySet.fromJSON(options.keys),\n };\n return this.getManager(requestOptions.clientId).getContentSetSize(options);\n });\n }\n\n public override async getPagedContent(\n token: IModelRpcProps,\n requestOptions: Paged<ContentRpcRequestOptions>,\n ): PresentationRpcResponse<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined> {\n return this.makeRequest(token, \"getPagedContent\", requestOptions, async (options) => {\n options = enforceValidPageSize({\n ...options,\n keys: KeySet.fromJSON(options.keys),\n });\n\n const [size, content] = await Promise.all([\n this.getManager(requestOptions.clientId).getContentSetSize(options),\n this.getManager(requestOptions.clientId)[_presentation_manager_detail].getContent(options),\n ]);\n\n if (!content) {\n return undefined;\n }\n\n return {\n descriptor: content.descriptor.toJSON(),\n contentSet: {\n total: size,\n items: content.contentSet.map((i) => i.toJSON()),\n },\n };\n });\n }\n\n public override async getPagedContentSet(\n token: IModelRpcProps,\n requestOptions: Paged<ContentRpcRequestOptions>,\n ): PresentationRpcResponse<PagedResponse<ItemJSON>> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const response = await this.getPagedContent(token, requestOptions);\n if (response.statusCode !== PresentationStatus.Success) {\n return this.errorResponse(response.statusCode, response.errorMessage, response.diagnostics);\n }\n if (!response.result) {\n return this.errorResponse(PresentationStatus.Error, `Failed to get content set (received a success response with empty result)`, response.diagnostics);\n }\n return {\n ...response,\n result: response.result.contentSet,\n };\n }\n\n public override async getElementProperties(\n token: IModelRpcProps,\n requestOptions: SingleElementPropertiesRpcRequestOptions,\n ): PresentationRpcResponse<ElementProperties | undefined> {\n return this.makeRequest(token, \"getElementProperties\", { ...requestOptions }, async (options) => {\n const { clientId, ...restOptions } = options;\n return this.getManager(clientId).getElementProperties(restOptions);\n });\n }\n\n public override async getPagedDistinctValues(\n token: IModelRpcProps,\n requestOptions: DistinctValuesRpcRequestOptions,\n ): PresentationRpcResponse<PagedResponse<DisplayValueGroup>> {\n return this.makeRequest(token, \"getPagedDistinctValues\", requestOptions, async (options) => {\n options = enforceValidPageSize({\n ...options,\n keys: KeySet.fromJSON(options.keys),\n });\n return this.getManager(requestOptions.clientId)[_presentation_manager_detail].getPagedDistinctValues(options);\n });\n }\n\n public override async getContentInstanceKeys(\n token: IModelRpcProps,\n requestOptions: ContentInstanceKeysRpcRequestOptions,\n ): PresentationRpcResponse<{ total: number; items: KeySetJSON }> {\n return this.makeRequest(token, \"getContentInstanceKeys\", requestOptions, async (options) => {\n const { displayType, ...optionsNoDisplayType } = options;\n options = enforceValidPageSize(\n {\n ...optionsNoDisplayType,\n keys: KeySet.fromJSON(optionsNoDisplayType.keys),\n descriptor: {\n displayType,\n contentFlags: ContentFlags.KeysOnly,\n },\n },\n MAX_ALLOWED_KEYS_PAGE_SIZE,\n );\n\n const [size, content] = await Promise.all([\n this.getManager(requestOptions.clientId).getContentSetSize(options),\n this.getManager(requestOptions.clientId)[_presentation_manager_detail].getContent(options),\n ]);\n\n if (size === 0 || !content) {\n return { total: 0, items: new KeySet().toJSON() };\n }\n\n return {\n total: size,\n items: content.contentSet.reduce((keys, item) => keys.add(item.primaryKeys), new KeySet()).toJSON(),\n };\n });\n }\n\n public override async getDisplayLabelDefinition(\n token: IModelRpcProps,\n requestOptions: DisplayLabelRpcRequestOptions,\n ): PresentationRpcResponse<LabelDefinition> {\n return this.makeRequest(token, \"getDisplayLabelDefinition\", requestOptions, async (options) => {\n const label = await this.getManager(requestOptions.clientId)[_presentation_manager_detail].getDisplayLabelDefinition(options);\n return label;\n });\n }\n\n public override async getPagedDisplayLabelDefinitions(\n token: IModelRpcProps,\n requestOptions: DisplayLabelsRpcRequestOptions,\n ): PresentationRpcResponse<PagedResponse<LabelDefinition>> {\n const pageOpts = enforceValidPageSize({ paging: { start: 0, size: requestOptions.keys.length } });\n if (pageOpts.paging.size < requestOptions.keys.length) {\n requestOptions.keys.splice(pageOpts.paging.size);\n }\n return this.makeRequest(token, \"getPagedDisplayLabelDefinitions\", requestOptions, async (options) => {\n const labels = await this.getManager(requestOptions.clientId)[_presentation_manager_detail].getDisplayLabelDefinitions({\n ...options,\n keys: options.keys,\n });\n return {\n total: options.keys.length,\n items: labels,\n };\n });\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n public override async getSelectionScopes(token: IModelRpcProps, requestOptions: SelectionScopeRpcRequestOptions): PresentationRpcResponse<SelectionScope[]> {\n return this.makeRequest(token, \"getSelectionScopes\", requestOptions, async (options) =>\n this.getManager(requestOptions.clientId).getSelectionScopes(options),\n );\n }\n\n public override async computeSelection(token: IModelRpcProps, requestOptions: ComputeSelectionRpcRequestOptions): PresentationRpcResponse<KeySetJSON> {\n return this.makeRequest(token, \"computeSelection\", requestOptions, async (options) => {\n const keys = await this.getManager(requestOptions.clientId).computeSelection(options);\n return keys.toJSON();\n });\n }\n /* eslint-enable @typescript-eslint/no-deprecated */\n}\n\nconst enforceValidPageSize = <TOptions extends Paged<object>>(\n requestOptions: TOptions,\n maxPageSize = MAX_ALLOWED_PAGE_SIZE,\n): TOptions & { paging: PageOptions } => {\n const validPageSize = getValidPageSize(requestOptions.paging?.size, maxPageSize);\n if (!requestOptions.paging || requestOptions.paging.size !== validPageSize) {\n return { ...requestOptions, paging: { ...requestOptions.paging, size: validPageSize } };\n }\n return requestOptions as TOptions & { paging: PageOptions };\n};\n\nconst getValidPageSize = (size: number | undefined, maxPageSize: number) => {\n const requestedSize = size ?? 0;\n return requestedSize === 0 || requestedSize > maxPageSize ? maxPageSize : requestedSize;\n};\n\n// not testing temporary solution\n/* c8 ignore start */\nfunction createStatusCategoryHandler() {\n return (e: Error) => {\n if (e instanceof PresentationError) {\n switch (e.errorNumber) {\n case PresentationStatus.NotInitialized:\n return new (class extends ErrorCategory {\n public name = \"Internal server error\";\n public code = 500;\n })();\n case PresentationStatus.Canceled:\n return new (class extends SuccessCategory {\n public name = \"Cancelled\";\n public code = 204;\n })();\n case PresentationStatus.ResultSetTooLarge:\n return new (class extends ErrorCategory {\n public name = \"Result set is too large\";\n public code = 413;\n })();\n case PresentationStatus.Error:\n case PresentationStatus.InvalidArgument:\n return new (class extends ErrorCategory {\n public name = \"Invalid request props\";\n public code = 422;\n })();\n }\n }\n return undefined;\n };\n}\n/* c8 ignore end */\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativePlatform.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/NativePlatform.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAa,QAAQ,EAAE,cAAc,EAAgB,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAU,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,iBAAiB,EAEjB,UAAU,EACV,aAAa,EAEb,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAGpC,gBAAgB;AAChB,oBAAY,0BAA0B;IACpC,YAAY,iBAAiB;IAC7B,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;IAC3B,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB;IACzC,YAAY,iBAAiB;IAC7B,oBAAoB,yBAAyB;IAC7C,iBAAiB,sBAAsB;IACvC,oBAAoB,yBAAyB;IAC7C,iBAAiB,sBAAsB;IACvC,aAAa,kBAAkB;IAC/B,UAAU,eAAe;IACzB,sBAAsB,2BAA2B;IACjD,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;CAC1C;AAED;;;GAGG;AACH,oBAAY,4BAA4B;IACtC,MAAM,WAAW;IACjB,eAAe,qBAAqB;IACpC,WAAW,iBAAiB;IAC5B,QAAQ,cAAc;CACvB;AAED,gBAAgB;AAChB,MAAM,WAAW,oCAAoC;IACnD,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC;QAC1B,WAAW,EAAE,4BAA4B,EAAE,CAAC;QAC5C,MAAM,EAAE,WAAW,CAAC;KACrB,CAAC,CAAC;CACJ;AAED,gBAAgB;AAChB,MAAM,WAAW,4BAA4B;IAC3C,YAAY,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"NativePlatform.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/NativePlatform.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAa,QAAQ,EAAE,cAAc,EAAgB,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAU,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OA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B,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACnD,cAAc,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,KAAK,IAAI,CAAC;IACvD,WAAW,CAAC,EAAE,cAAc,CAAC,kCAAkC,CAAC;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,cAAc,CAAC,EAAE,oCAAoC,CAAC;IACtD,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B;AAED,gBAAgB;AAChB,qBAAa,uCAAwC,SAAQ,iBAAiB;IAC5E,SAAgB,WAAW,CAAC,EAAE,oBAAoB,CAAC;gBAChC,aAAa,EAAE,cAAc,CAAC,6BAA6B,CAAC,OAAO,CAAC;CAKxF;AAcD,gBAAgB;AAChB,eAAO,MAAM,2BAA2B,UAAW,0BAA0B,KAAG,UAAU,wBAuGzF,CAAC"}
|
|
@@ -66,6 +66,7 @@ export const createDefaultNativePlatform = (props) => {
|
|
|
66
66
|
return class {
|
|
67
67
|
_nativeAddon;
|
|
68
68
|
constructor() {
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
69
70
|
const cacheConfig = props.cacheConfig ?? { mode: HierarchyCacheMode.Disk, directory: "" };
|
|
70
71
|
const defaultFormats = props.defaultFormats ? this.getSerializedDefaultFormatsMap(props.defaultFormats) : {};
|
|
71
72
|
this._nativeAddon = new IModelNative.platform.ECPresentationManager({ ...props, cacheConfig, defaultFormats });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativePlatform.js","sourceRoot":"","sources":["../../../src/presentation-backend/NativePlatform.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,SAAS,EAA4B,YAAY,EAAE,MAAM,qB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AgB,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC,CAAC;QAClE,CAAC;QACM,KAAK,CAAC,aAAa,CAAC,EAAO,EAAE,OAAe,EAAE,WAAiC;YACpF,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;YAC9D,WAAW,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;YAC9C,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;YACrC,OAAO,IAAI,CAAC,qBAAqB,CAAiB,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3F,CAAC;QACM,uBAAuB,CAAC,SAAiB,EAAE,UAAkB,EAAE,IAAwB;YAC5F,OAAO,IAAI,CAAC,YAAY,CAAgB,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;QAClH,CAAC;QACM,uBAAuB,CAAC,SAAiB,EAAE,UAAkB,EAAE,IAAwB,EAAE,KAAwB;YACtH,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QAC9G,CAAC;QACM,yBAAyB,CAAC,SAAiB,EAAE,UAAkB;YACpE,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,yBAAyB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;QACnG,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { _nativeDb, IModelDb, IModelJsNative, IModelNative } from \"@itwin/core-backend\";\nimport { assert, BeEvent } from \"@itwin/core-bentley\";\nimport { FormatProps } from \"@itwin/core-quantity\";\nimport {\n DiagnosticsScopeLogs,\n NodeKey,\n PresentationError,\n PresentationStatus,\n UpdateInfo,\n VariableValue,\n VariableValueJSON,\n VariableValueTypes,\n} from \"@itwin/presentation-common\";\nimport { HierarchyCacheMode } from \"./PresentationManager.js\";\n\n/** @internal */\nexport enum NativePlatformRequestTypes {\n GetRootNodes = \"GetRootNodes\",\n GetRootNodesCount = \"GetRootNodesCount\",\n GetChildren = \"GetChildren\",\n GetChildrenCount = \"GetChildrenCount\",\n GetNodesDescriptor = \"GetNodesDescriptor\",\n GetNodePaths = \"GetNodePaths\",\n GetFilteredNodePaths = \"GetFilteredNodePaths\",\n GetContentSources = \"GetContentSources\",\n GetContentDescriptor = \"GetContentDescriptor\",\n GetContentSetSize = \"GetContentSetSize\",\n GetContentSet = \"GetContentSet\",\n GetContent = \"GetContent\",\n GetPagedDistinctValues = \"GetPagedDistinctValues\",\n GetDisplayLabel = \"GetDisplayLabel\",\n CompareHierarchies = \"CompareHierarchies\",\n}\n\n/**\n * Enumeration of unit systems supported by native presentation manager.\n * @internal\n */\nexport enum NativePresentationUnitSystem {\n Metric = \"metric\",\n BritishImperial = \"british-imperial\",\n UsCustomary = \"us-customary\",\n UsSurvey = \"us-survey\",\n}\n\n/** @internal */\nexport interface NativePresentationDefaultUnitFormats {\n [phenomenon: string]: Array<{\n unitSystems: NativePresentationUnitSystem[];\n format: FormatProps;\n }>;\n}\n\n/** @internal */\nexport interface NativePresentationKeySetJSON {\n instanceKeys: Array<[string, string[]]>;\n nodeKeys: NodeKey[];\n}\n\n/** @internal */\nexport interface NativePlatformResponse<TResult> {\n result: TResult;\n diagnostics?: DiagnosticsScopeLogs;\n}\n\n/** @internal */\nexport interface NativePlatformDefinition extends Disposable {\n getImodelAddon(imodel: IModelDb): any;\n\n setupRulesetDirectories(directories: string[]): NativePlatformResponse<void>;\n setupSupplementalRulesetDirectories(directories: string[]): NativePlatformResponse<void>;\n\n forceLoadSchemas(db: any): Promise<NativePlatformResponse<void>>;\n\n registerSupplementalRuleset(serializedRulesetJson: string): NativePlatformResponse<string>;\n getRulesets(rulesetId: string): NativePlatformResponse<string>;\n addRuleset(serializedRulesetJson: string): NativePlatformResponse<string>;\n removeRuleset(rulesetId: string, hash: string): NativePlatformResponse<boolean>;\n clearRulesets(): NativePlatformResponse<void>;\n\n handleRequest(db: any, options: string, cancelEvent?: BeEvent<() => void>): Promise<NativePlatformResponse<string>>;\n\n getRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes): NativePlatformResponse<VariableValue>;\n setRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes, value: VariableValue): NativePlatformResponse<void>;\n unsetRulesetVariableValue(rulesetId: string, variableId: string): NativePlatformResponse<void>;\n}\n\n/** @internal */\nexport interface DefaultNativePlatformProps {\n id: string;\n taskAllocationsMap: { [priority: number]: number };\n updateCallback: (info: UpdateInfo | undefined) => void;\n cacheConfig?: IModelJsNative.ECPresentationHierarchyCacheConfig;\n contentCacheSize?: number;\n workerConnectionCacheSize?: number;\n defaultFormats?: NativePresentationDefaultUnitFormats;\n useMmap?: boolean | number;\n}\n\n/** @internal */\nexport class PresentationNativePlatformResponseError extends PresentationError {\n public readonly diagnostics?: DiagnosticsScopeLogs;\n public constructor(errorResponse: IModelJsNative.ECPresentationManagerResponse<unknown>) {\n assert(!!errorResponse.error);\n super(getPresentationStatusFromNativeResponseStatus(errorResponse.error.status), errorResponse.error.message);\n this.diagnostics = errorResponse.diagnostics;\n }\n}\n\nfunction getPresentationStatusFromNativeResponseStatus(nativeResponseStatus: IModelJsNative.ECPresentationStatus): PresentationStatus {\n switch (nativeResponseStatus) {\n case IModelJsNative.ECPresentationStatus.InvalidArgument:\n return PresentationStatus.InvalidArgument;\n case IModelJsNative.ECPresentationStatus.ResultSetTooLarge:\n return PresentationStatus.ResultSetTooLarge;\n case IModelJsNative.ECPresentationStatus.Canceled:\n return PresentationStatus.Canceled;\n }\n return PresentationStatus.Error;\n}\n\n/** @internal */\nexport const createDefaultNativePlatform = (props: DefaultNativePlatformProps): new () => NativePlatformDefinition => {\n // note the implementation is constructed here to make PresentationManager\n // usable without loading the actual addon (if addon is set to something other)\n return class implements NativePlatformDefinition {\n private _nativeAddon: IModelJsNative.ECPresentationManager;\n public constructor() {\n const cacheConfig = props.cacheConfig ?? { mode: HierarchyCacheMode.Disk, directory: \"\" };\n const defaultFormats = props.defaultFormats ? this.getSerializedDefaultFormatsMap(props.defaultFormats) : {};\n this._nativeAddon = new IModelNative.platform.ECPresentationManager({ ...props, cacheConfig, defaultFormats });\n }\n private getSerializedDefaultFormatsMap(defaultMap: NativePresentationDefaultUnitFormats) {\n const res: {\n [phenomenon: string]: Array<{\n unitSystems: string[];\n serializedFormat: string;\n }>;\n } = {};\n Object.entries(defaultMap).forEach(([phenomenon, formats]) => {\n res[phenomenon] = formats.map((value) => ({ unitSystems: value.unitSystems, serializedFormat: JSON.stringify(value.format) }));\n });\n return res;\n }\n private createSuccessResponse<T>(response: IModelJsNative.ECPresentationManagerResponse<T>): NativePlatformResponse<T> {\n const retValue: NativePlatformResponse<T> = { result: response.result! };\n if (response.diagnostics) {\n retValue.diagnostics = response.diagnostics;\n }\n return retValue;\n }\n private handleResult<T>(response: IModelJsNative.ECPresentationManagerResponse<T>): NativePlatformResponse<T> {\n if (response.error) {\n throw new PresentationNativePlatformResponseError(response);\n }\n return this.createSuccessResponse(response);\n }\n private handleConvertedResult<TSource, TTarget>(\n response: IModelJsNative.ECPresentationManagerResponse<TSource>,\n conv: (s: TSource) => TTarget,\n ): NativePlatformResponse<TTarget> {\n return this.handleResult<TTarget>(\n (response.result ? { ...response, result: conv(response.result) } : response) as IModelJsNative.ECPresentationManagerResponse<TTarget>,\n );\n }\n private handleVoidResult(response: IModelJsNative.ECPresentationManagerResponse<void>): NativePlatformResponse<void> {\n if (response.error) {\n throw new PresentationNativePlatformResponseError(response);\n }\n return this.createSuccessResponse(response);\n }\n public [Symbol.dispose]() {\n this._nativeAddon.dispose();\n }\n public async forceLoadSchemas(db: any): Promise<NativePlatformResponse<void>> {\n const response = await this._nativeAddon.forceLoadSchemas(db);\n if (response.error) {\n throw new PresentationError(PresentationStatus.Error, response.error.message);\n }\n return this.createSuccessResponse(response);\n }\n public setupRulesetDirectories(directories: string[]) {\n return this.handleVoidResult(this._nativeAddon.setupRulesetDirectories(directories));\n }\n public setupSupplementalRulesetDirectories(directories: string[]) {\n return this.handleVoidResult(this._nativeAddon.setupSupplementalRulesetDirectories(directories));\n }\n public getImodelAddon(imodel: IModelDb): any {\n if (!imodel.isOpen) {\n throw new PresentationError(PresentationStatus.InvalidArgument, \"imodel\");\n }\n return imodel[_nativeDb];\n }\n public registerSupplementalRuleset(serializedRulesetJson: string) {\n return this.handleResult<string>(this._nativeAddon.registerSupplementalRuleset(serializedRulesetJson));\n }\n public getRulesets(rulesetId: string) {\n return this.handleResult<string>(this._nativeAddon.getRulesets(rulesetId));\n }\n public addRuleset(serializedRulesetJson: string) {\n return this.handleResult<string>(this._nativeAddon.addRuleset(serializedRulesetJson));\n }\n public removeRuleset(rulesetId: string, hash: string) {\n return this.handleResult<boolean>(this._nativeAddon.removeRuleset(rulesetId, hash));\n }\n public clearRulesets() {\n return this.handleVoidResult(this._nativeAddon.clearRulesets());\n }\n public async handleRequest(db: any, options: string, cancelEvent?: BeEvent<() => void>) {\n const response = this._nativeAddon.handleRequest(db, options);\n cancelEvent?.addOnce(() => response.cancel());\n const result = await response.result;\n return this.handleConvertedResult<Buffer, string>(result, (buffer) => buffer.toString());\n }\n public getRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes) {\n return this.handleResult<VariableValue>(this._nativeAddon.getRulesetVariableValue(rulesetId, variableId, type));\n }\n public setRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes, value: VariableValueJSON) {\n return this.handleVoidResult(this._nativeAddon.setRulesetVariableValue(rulesetId, variableId, type, value));\n }\n public unsetRulesetVariableValue(rulesetId: string, variableId: string) {\n return this.handleVoidResult(this._nativeAddon.unsetRulesetVariableValue(rulesetId, variableId));\n }\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"NativePlatform.js","sourceRoot":"","sources":["../../../src/presentation-backend/NativePlatform.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,SAAS,EAA4B,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAGL,iBAAiB,EACjB,kBAAkB,GAKnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,gBAAgB;AAChB,MAAM,CAAN,IAAY,0BAgBX;AAhBD,WAAY,0BAA0B;IACpC,2DAA6B,CAAA;IAC7B,qEAAuC,CAAA;IACvC,yDAA2B,CAAA;IAC3B,mEAAqC,CAAA;IACrC,uEAAyC,CAAA;IACzC,2DAA6B,CAAA;IAC7B,2EAA6C,CAAA;IAC7C,qEAAuC,CAAA;IACvC,2EAA6C,CAAA;IAC7C,qEAAuC,CAAA;IACvC,6DAA+B,CAAA;IAC/B,uDAAyB,CAAA;IACzB,+EAAiD,CAAA;IACjD,iEAAmC,CAAA;IACnC,uEAAyC,CAAA;AAC3C,CAAC,EAhBW,0BAA0B,KAA1B,0BAA0B,QAgBrC;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACtC,iDAAiB,CAAA;IACjB,oEAAoC,CAAA;IACpC,4DAA4B,CAAA;IAC5B,sDAAsB,CAAA;AACxB,CAAC,EALW,4BAA4B,KAA5B,4BAA4B,QAKvC;AAyDD,gBAAgB;AAChB,MAAM,OAAO,uCAAwC,SAAQ,iBAAiB;IA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,EAAE,KAAK,CAAC,CAAC,CAAC;QAC9G,CAAC;QACM,yBAAyB,CAAC,SAAiB,EAAE,UAAkB;YACpE,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,yBAAyB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;QACnG,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { _nativeDb, IModelDb, IModelJsNative, IModelNative } from \"@itwin/core-backend\";\nimport { assert, BeEvent } from \"@itwin/core-bentley\";\nimport { FormatProps } from \"@itwin/core-quantity\";\nimport {\n DiagnosticsScopeLogs,\n NodeKey,\n PresentationError,\n PresentationStatus,\n UpdateInfo,\n VariableValue,\n VariableValueJSON,\n VariableValueTypes,\n} from \"@itwin/presentation-common\";\nimport { HierarchyCacheMode } from \"./PresentationManager.js\";\n\n/** @internal */\nexport enum NativePlatformRequestTypes {\n GetRootNodes = \"GetRootNodes\",\n GetRootNodesCount = \"GetRootNodesCount\",\n GetChildren = \"GetChildren\",\n GetChildrenCount = \"GetChildrenCount\",\n GetNodesDescriptor = \"GetNodesDescriptor\",\n GetNodePaths = \"GetNodePaths\",\n GetFilteredNodePaths = \"GetFilteredNodePaths\",\n GetContentSources = \"GetContentSources\",\n GetContentDescriptor = \"GetContentDescriptor\",\n GetContentSetSize = \"GetContentSetSize\",\n GetContentSet = \"GetContentSet\",\n GetContent = \"GetContent\",\n GetPagedDistinctValues = \"GetPagedDistinctValues\",\n GetDisplayLabel = \"GetDisplayLabel\",\n CompareHierarchies = \"CompareHierarchies\",\n}\n\n/**\n * Enumeration of unit systems supported by native presentation manager.\n * @internal\n */\nexport enum NativePresentationUnitSystem {\n Metric = \"metric\",\n BritishImperial = \"british-imperial\",\n UsCustomary = \"us-customary\",\n UsSurvey = \"us-survey\",\n}\n\n/** @internal */\nexport interface NativePresentationDefaultUnitFormats {\n [phenomenon: string]: Array<{\n unitSystems: NativePresentationUnitSystem[];\n format: FormatProps;\n }>;\n}\n\n/** @internal */\nexport interface NativePresentationKeySetJSON {\n instanceKeys: Array<[string, string[]]>;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n nodeKeys: NodeKey[];\n}\n\n/** @internal */\nexport interface NativePlatformResponse<TResult> {\n result: TResult;\n diagnostics?: DiagnosticsScopeLogs;\n}\n\n/** @internal */\nexport interface NativePlatformDefinition extends Disposable {\n getImodelAddon(imodel: IModelDb): any;\n\n setupRulesetDirectories(directories: string[]): NativePlatformResponse<void>;\n setupSupplementalRulesetDirectories(directories: string[]): NativePlatformResponse<void>;\n\n forceLoadSchemas(db: any): Promise<NativePlatformResponse<void>>;\n\n registerSupplementalRuleset(serializedRulesetJson: string): NativePlatformResponse<string>;\n getRulesets(rulesetId: string): NativePlatformResponse<string>;\n addRuleset(serializedRulesetJson: string): NativePlatformResponse<string>;\n removeRuleset(rulesetId: string, hash: string): NativePlatformResponse<boolean>;\n clearRulesets(): NativePlatformResponse<void>;\n\n handleRequest(db: any, options: string, cancelEvent?: BeEvent<() => void>): Promise<NativePlatformResponse<string>>;\n\n getRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes): NativePlatformResponse<VariableValue>;\n setRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes, value: VariableValue): NativePlatformResponse<void>;\n unsetRulesetVariableValue(rulesetId: string, variableId: string): NativePlatformResponse<void>;\n}\n\n/** @internal */\nexport interface DefaultNativePlatformProps {\n id: string;\n taskAllocationsMap: { [priority: number]: number };\n updateCallback: (info: UpdateInfo | undefined) => void;\n cacheConfig?: IModelJsNative.ECPresentationHierarchyCacheConfig;\n contentCacheSize?: number;\n workerConnectionCacheSize?: number;\n defaultFormats?: NativePresentationDefaultUnitFormats;\n useMmap?: boolean | number;\n}\n\n/** @internal */\nexport class PresentationNativePlatformResponseError extends PresentationError {\n public readonly diagnostics?: DiagnosticsScopeLogs;\n public constructor(errorResponse: IModelJsNative.ECPresentationManagerResponse<unknown>) {\n assert(!!errorResponse.error);\n super(getPresentationStatusFromNativeResponseStatus(errorResponse.error.status), errorResponse.error.message);\n this.diagnostics = errorResponse.diagnostics;\n }\n}\n\nfunction getPresentationStatusFromNativeResponseStatus(nativeResponseStatus: IModelJsNative.ECPresentationStatus): PresentationStatus {\n switch (nativeResponseStatus) {\n case IModelJsNative.ECPresentationStatus.InvalidArgument:\n return PresentationStatus.InvalidArgument;\n case IModelJsNative.ECPresentationStatus.ResultSetTooLarge:\n return PresentationStatus.ResultSetTooLarge;\n case IModelJsNative.ECPresentationStatus.Canceled:\n return PresentationStatus.Canceled;\n }\n return PresentationStatus.Error;\n}\n\n/** @internal */\nexport const createDefaultNativePlatform = (props: DefaultNativePlatformProps): new () => NativePlatformDefinition => {\n // note the implementation is constructed here to make PresentationManager\n // usable without loading the actual addon (if addon is set to something other)\n return class implements NativePlatformDefinition {\n private _nativeAddon: IModelJsNative.ECPresentationManager;\n public constructor() {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const cacheConfig = props.cacheConfig ?? { mode: HierarchyCacheMode.Disk, directory: \"\" };\n const defaultFormats = props.defaultFormats ? this.getSerializedDefaultFormatsMap(props.defaultFormats) : {};\n this._nativeAddon = new IModelNative.platform.ECPresentationManager({ ...props, cacheConfig, defaultFormats });\n }\n private getSerializedDefaultFormatsMap(defaultMap: NativePresentationDefaultUnitFormats) {\n const res: {\n [phenomenon: string]: Array<{\n unitSystems: string[];\n serializedFormat: string;\n }>;\n } = {};\n Object.entries(defaultMap).forEach(([phenomenon, formats]) => {\n res[phenomenon] = formats.map((value) => ({ unitSystems: value.unitSystems, serializedFormat: JSON.stringify(value.format) }));\n });\n return res;\n }\n private createSuccessResponse<T>(response: IModelJsNative.ECPresentationManagerResponse<T>): NativePlatformResponse<T> {\n const retValue: NativePlatformResponse<T> = { result: response.result! };\n if (response.diagnostics) {\n retValue.diagnostics = response.diagnostics;\n }\n return retValue;\n }\n private handleResult<T>(response: IModelJsNative.ECPresentationManagerResponse<T>): NativePlatformResponse<T> {\n if (response.error) {\n throw new PresentationNativePlatformResponseError(response);\n }\n return this.createSuccessResponse(response);\n }\n private handleConvertedResult<TSource, TTarget>(\n response: IModelJsNative.ECPresentationManagerResponse<TSource>,\n conv: (s: TSource) => TTarget,\n ): NativePlatformResponse<TTarget> {\n return this.handleResult<TTarget>(\n (response.result ? { ...response, result: conv(response.result) } : response) as IModelJsNative.ECPresentationManagerResponse<TTarget>,\n );\n }\n private handleVoidResult(response: IModelJsNative.ECPresentationManagerResponse<void>): NativePlatformResponse<void> {\n if (response.error) {\n throw new PresentationNativePlatformResponseError(response);\n }\n return this.createSuccessResponse(response);\n }\n public [Symbol.dispose]() {\n this._nativeAddon.dispose();\n }\n public async forceLoadSchemas(db: any): Promise<NativePlatformResponse<void>> {\n const response = await this._nativeAddon.forceLoadSchemas(db);\n if (response.error) {\n throw new PresentationError(PresentationStatus.Error, response.error.message);\n }\n return this.createSuccessResponse(response);\n }\n public setupRulesetDirectories(directories: string[]) {\n return this.handleVoidResult(this._nativeAddon.setupRulesetDirectories(directories));\n }\n public setupSupplementalRulesetDirectories(directories: string[]) {\n return this.handleVoidResult(this._nativeAddon.setupSupplementalRulesetDirectories(directories));\n }\n public getImodelAddon(imodel: IModelDb): any {\n if (!imodel.isOpen) {\n throw new PresentationError(PresentationStatus.InvalidArgument, \"imodel\");\n }\n return imodel[_nativeDb];\n }\n public registerSupplementalRuleset(serializedRulesetJson: string) {\n return this.handleResult<string>(this._nativeAddon.registerSupplementalRuleset(serializedRulesetJson));\n }\n public getRulesets(rulesetId: string) {\n return this.handleResult<string>(this._nativeAddon.getRulesets(rulesetId));\n }\n public addRuleset(serializedRulesetJson: string) {\n return this.handleResult<string>(this._nativeAddon.addRuleset(serializedRulesetJson));\n }\n public removeRuleset(rulesetId: string, hash: string) {\n return this.handleResult<boolean>(this._nativeAddon.removeRuleset(rulesetId, hash));\n }\n public clearRulesets() {\n return this.handleVoidResult(this._nativeAddon.clearRulesets());\n }\n public async handleRequest(db: any, options: string, cancelEvent?: BeEvent<() => void>) {\n const response = this._nativeAddon.handleRequest(db, options);\n cancelEvent?.addOnce(() => response.cancel());\n const result = await response.result;\n return this.handleConvertedResult<Buffer, string>(result, (buffer) => buffer.toString());\n }\n public getRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes) {\n return this.handleResult<VariableValue>(this._nativeAddon.getRulesetVariableValue(rulesetId, variableId, type));\n }\n public setRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes, value: VariableValueJSON) {\n return this.handleVoidResult(this._nativeAddon.setRulesetVariableValue(rulesetId, variableId, type, value));\n }\n public unsetRulesetVariableValue(rulesetId: string, variableId: string) {\n return this.handleVoidResult(this._nativeAddon.unsetRulesetVariableValue(rulesetId, variableId));\n }\n };\n};\n"]}
|
|
@@ -14,6 +14,8 @@ import { BackendDiagnosticsAttribute, BackendDiagnosticsOptions } from "./Utils.
|
|
|
14
14
|
/**
|
|
15
15
|
* Presentation hierarchy cache mode.
|
|
16
16
|
* @public
|
|
17
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
18
|
+
* package for creating hierarchies.
|
|
17
19
|
*/
|
|
18
20
|
export declare enum HierarchyCacheMode {
|
|
19
21
|
/**
|
|
@@ -36,11 +38,15 @@ export declare enum HierarchyCacheMode {
|
|
|
36
38
|
/**
|
|
37
39
|
* Configuration for hierarchy cache.
|
|
38
40
|
* @public
|
|
41
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
42
|
+
* package for creating hierarchies.
|
|
39
43
|
*/
|
|
40
44
|
export type HierarchyCacheConfig = MemoryHierarchyCacheConfig | DiskHierarchyCacheConfig | HybridCacheConfig;
|
|
41
45
|
/**
|
|
42
46
|
* Base interface for all [[HierarchyCacheConfig]] implementations.
|
|
43
47
|
* @public
|
|
48
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
49
|
+
* package for creating hierarchies.
|
|
44
50
|
*/
|
|
45
51
|
export interface HierarchyCacheConfigBase {
|
|
46
52
|
mode: HierarchyCacheMode;
|
|
@@ -50,6 +56,8 @@ export interface HierarchyCacheConfigBase {
|
|
|
50
56
|
*
|
|
51
57
|
* @see [Memory cache documentation page]($docs/presentation/advanced/Caching.md#memory-cache)
|
|
52
58
|
* @public
|
|
59
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
60
|
+
* package for creating hierarchies.
|
|
53
61
|
*/
|
|
54
62
|
export interface MemoryHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
55
63
|
mode: HierarchyCacheMode.Memory;
|
|
@@ -59,6 +67,8 @@ export interface MemoryHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
|
59
67
|
*
|
|
60
68
|
* @see [Disk cache documentation page]($docs/presentation/advanced/Caching.md#disk-cache)
|
|
61
69
|
* @public
|
|
70
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
71
|
+
* package for creating hierarchies.
|
|
62
72
|
*/
|
|
63
73
|
export interface DiskHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
64
74
|
mode: HierarchyCacheMode.Disk;
|
|
@@ -82,6 +92,8 @@ export interface DiskHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
|
82
92
|
*
|
|
83
93
|
* @see [Hybrid cache documentation page]($docs/presentation/advanced/Caching.md#hybrid-cache)
|
|
84
94
|
* @public
|
|
95
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
96
|
+
* package for creating hierarchies.
|
|
85
97
|
*/
|
|
86
98
|
export interface HybridCacheConfig extends HierarchyCacheConfigBase {
|
|
87
99
|
mode: HierarchyCacheMode.Hybrid;
|
|
@@ -111,6 +123,8 @@ export interface PresentationManagerCachingConfig {
|
|
|
111
123
|
* Hierarchies-related caching options.
|
|
112
124
|
*
|
|
113
125
|
* @see [Hierarchies cache documentation page]($docs/presentation/advanced/Caching.md#hierarchies-cache)
|
|
126
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
127
|
+
* package for creating hierarchies.
|
|
114
128
|
*/
|
|
115
129
|
hierarchies?: HierarchyCacheConfig;
|
|
116
130
|
/**
|
|
@@ -205,7 +219,7 @@ export interface PresentationManagerProps {
|
|
|
205
219
|
* A map of default unit formats to use for formatting properties that don't have a presentation format
|
|
206
220
|
* in requested unit system.
|
|
207
221
|
*
|
|
208
|
-
* @deprecated in 5.1. Use `formatsProvider` instead. Still used as a fallback if `formatsProvider` is not supplied.
|
|
222
|
+
* @deprecated in 5.1 - will not be removed until after 2026-08-08. Use `formatsProvider` instead. Still used as a fallback if `formatsProvider` is not supplied.
|
|
209
223
|
*/
|
|
210
224
|
defaultFormats?: FormatsMap;
|
|
211
225
|
/**
|
|
@@ -245,7 +259,7 @@ export interface PresentationManagerProps {
|
|
|
245
259
|
* Callback that provides [SchemaContext]($ecschema-metadata) for supplied [IModelDb]($core-backend).
|
|
246
260
|
* [SchemaContext]($ecschema-metadata) is used for getting metadata required for values formatting.
|
|
247
261
|
*
|
|
248
|
-
* @deprecated in 5.1. By default [IModelDb.schemaContext]($core-backend) is now used instead.
|
|
262
|
+
* @deprecated in 5.1 - will not be removed until after 2026-08-08. By default [IModelDb.schemaContext]($core-backend) is now used instead.
|
|
249
263
|
*/
|
|
250
264
|
schemaContextProvider?: (imodel: IModelDb) => SchemaContext;
|
|
251
265
|
/**
|
|
@@ -296,28 +310,38 @@ export declare class PresentationManager {
|
|
|
296
310
|
/**
|
|
297
311
|
* Retrieves nodes
|
|
298
312
|
* @public
|
|
313
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
314
|
+
* package for creating hierarchies.
|
|
299
315
|
*/
|
|
300
316
|
getNodes(requestOptions: WithCancelEvent<Prioritized<Paged<HierarchyRequestOptions<IModelDb, NodeKey, RulesetVariable>>>> & BackendDiagnosticsAttribute): Promise<Node[]>;
|
|
301
317
|
/**
|
|
302
318
|
* Retrieves nodes count
|
|
303
319
|
* @public
|
|
320
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
321
|
+
* package for creating hierarchies.
|
|
304
322
|
*/
|
|
305
323
|
getNodesCount(requestOptions: WithCancelEvent<Prioritized<HierarchyRequestOptions<IModelDb, NodeKey, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<number>;
|
|
306
324
|
/**
|
|
307
325
|
* Retrieves hierarchy level descriptor
|
|
308
326
|
* @public
|
|
327
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
328
|
+
* package for creating hierarchies.
|
|
309
329
|
*/
|
|
310
330
|
getNodesDescriptor(requestOptions: WithCancelEvent<Prioritized<HierarchyLevelDescriptorRequestOptions<IModelDb, NodeKey, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<Descriptor | undefined>;
|
|
311
331
|
/**
|
|
312
332
|
* Retrieves paths from root nodes to children nodes according to specified instance key paths. Intersecting paths will be merged.
|
|
313
333
|
* TODO: Return results in pages
|
|
314
334
|
* @public
|
|
335
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
336
|
+
* package for creating hierarchies.
|
|
315
337
|
*/
|
|
316
338
|
getNodePaths(requestOptions: WithCancelEvent<Prioritized<FilterByInstancePathsHierarchyRequestOptions<IModelDb, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<NodePathElement[]>;
|
|
317
339
|
/**
|
|
318
340
|
* Retrieves paths from root nodes to nodes containing filter text in their label.
|
|
319
341
|
* TODO: Return results in pages
|
|
320
342
|
* @public
|
|
343
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
344
|
+
* package for creating hierarchies.
|
|
321
345
|
*/
|
|
322
346
|
getFilteredNodePaths(requestOptions: WithCancelEvent<Prioritized<FilterByTextHierarchyRequestOptions<IModelDb, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<NodePathElement[]>;
|
|
323
347
|
/**
|
|
@@ -392,6 +416,8 @@ export declare class PresentationManager {
|
|
|
392
416
|
/**
|
|
393
417
|
* Compares two hierarchies specified in the request options
|
|
394
418
|
* @public
|
|
419
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
420
|
+
* package for creating hierarchies.
|
|
395
421
|
*/
|
|
396
422
|
compareHierarchies(requestOptions: HierarchyCompareOptions<IModelDb, NodeKey>): Promise<HierarchyCompareInfo>;
|
|
397
423
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAa,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAyB,MAAM,0BAA0B,CAAC;AAChF,OAAO,EACL,gBAAgB,IAAI,sBAAsB,EAC1C,8BAA8B,EAC9B,OAAO,EACP,+BAA+B,EAE/B,qBAAqB,EACrB,4BAA4B,EAE5B,UAAU,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,4BAA4B,EAC5B,iBAAiB,EACjB,4CAA4C,EAC5C,mCAAmC,EACnC,UAAU,EACV,oBAAoB,EACpB,uBAAuB,EAEvB,sCAAsC,EACtC,uBAAuB,EACvB,WAAW,EACX,IAAI,EACJ,MAAM,EAEN,eAAe,EACf,oCAAoC,EACpC,IAAI,EACJ,OAAO,EACP,eAAe,EACf,KAAK,EACL,aAAa,EAGb,WAAW,EACX,OAAO,EACP,eAAe,EACf,eAAe,EACf,cAAc,EACd,4BAA4B,EAC5B,qCAAqC,EACrC,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAUpC,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAsB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAA+B,MAAM,8BAA8B,CAAC;AAEpG,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAwB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"PresentationManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAa,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAyB,MAAM,0BAA0B,CAAC;AAChF,OAAO,EACL,gBAAgB,IAAI,sBAAsB,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|
import { SelectionScopesHelper } from "./SelectionScopesHelper.js";
|
|
19
19
|
import { getLocalizedStringEN } from "./Utils.js";
|
|
20
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
20
21
|
/**
|
|
21
22
|
* Presentation hierarchy cache mode.
|
|
22
23
|
* @public
|
|
24
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
25
|
+
* package for creating hierarchies.
|
|
23
26
|
*/
|
|
24
27
|
export var HierarchyCacheMode;
|
|
25
28
|
(function (HierarchyCacheMode) {
|
|
@@ -106,9 +109,12 @@ export class PresentationManager {
|
|
|
106
109
|
getRulesetId(rulesetOrId) {
|
|
107
110
|
return this._detail.getRulesetId(rulesetOrId);
|
|
108
111
|
}
|
|
112
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
109
113
|
/**
|
|
110
114
|
* Retrieves nodes
|
|
111
115
|
* @public
|
|
116
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
117
|
+
* package for creating hierarchies.
|
|
112
118
|
*/
|
|
113
119
|
async getNodes(requestOptions) {
|
|
114
120
|
const serializedHierarchyLevel = await this._detail.getNodes(requestOptions);
|
|
@@ -118,6 +124,8 @@ export class PresentationManager {
|
|
|
118
124
|
/**
|
|
119
125
|
* Retrieves nodes count
|
|
120
126
|
* @public
|
|
127
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
128
|
+
* package for creating hierarchies.
|
|
121
129
|
*/
|
|
122
130
|
async getNodesCount(requestOptions) {
|
|
123
131
|
return this._detail.getNodesCount(requestOptions);
|
|
@@ -125,6 +133,8 @@ export class PresentationManager {
|
|
|
125
133
|
/**
|
|
126
134
|
* Retrieves hierarchy level descriptor
|
|
127
135
|
* @public
|
|
136
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
137
|
+
* package for creating hierarchies.
|
|
128
138
|
*/
|
|
129
139
|
async getNodesDescriptor(requestOptions) {
|
|
130
140
|
const response = await this._detail.getNodesDescriptor(requestOptions);
|
|
@@ -135,6 +145,8 @@ export class PresentationManager {
|
|
|
135
145
|
* Retrieves paths from root nodes to children nodes according to specified instance key paths. Intersecting paths will be merged.
|
|
136
146
|
* TODO: Return results in pages
|
|
137
147
|
* @public
|
|
148
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
149
|
+
* package for creating hierarchies.
|
|
138
150
|
*/
|
|
139
151
|
async getNodePaths(requestOptions) {
|
|
140
152
|
const result = await this._detail.getNodePaths(requestOptions);
|
|
@@ -144,11 +156,14 @@ export class PresentationManager {
|
|
|
144
156
|
* Retrieves paths from root nodes to nodes containing filter text in their label.
|
|
145
157
|
* TODO: Return results in pages
|
|
146
158
|
* @public
|
|
159
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
160
|
+
* package for creating hierarchies.
|
|
147
161
|
*/
|
|
148
162
|
async getFilteredNodePaths(requestOptions) {
|
|
149
163
|
const result = await this._detail.getFilteredNodePaths(requestOptions);
|
|
150
164
|
return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));
|
|
151
165
|
}
|
|
166
|
+
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
152
167
|
/**
|
|
153
168
|
* Get information about the sources of content when building it for specific ECClasses. Sources involve classes of the primary select instance,
|
|
154
169
|
* its related instances for loading related and navigation properties.
|
|
@@ -332,7 +347,10 @@ export class PresentationManager {
|
|
|
332
347
|
/**
|
|
333
348
|
* Compares two hierarchies specified in the request options
|
|
334
349
|
* @public
|
|
350
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
351
|
+
* package for creating hierarchies.
|
|
335
352
|
*/
|
|
353
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
336
354
|
async compareHierarchies(requestOptions) {
|
|
337
355
|
if (!requestOptions.prev.rulesetOrId && !requestOptions.prev.rulesetVariables) {
|
|
338
356
|
return { changes: [] };
|