@itwin/presentation-backend 5.2.0-dev.8 → 5.3.0-dev.2
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 +36 -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 +26 -0
- 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 +26 -0
- 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 +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
# Change Log - @itwin/presentation-backend
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 24 Sep 2025 17:43:58 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.1.9
|
|
6
|
+
Wed, 24 Sep 2025 17:38:08 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 5.1.8
|
|
11
|
+
Wed, 17 Sep 2025 17:17:16 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 5.1.7
|
|
16
|
+
Tue, 09 Sep 2025 19:28:04 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 5.1.6
|
|
21
|
+
Mon, 08 Sep 2025 13:53:47 GMT
|
|
22
|
+
|
|
23
|
+
_Version update only_
|
|
24
|
+
|
|
25
|
+
## 5.1.5
|
|
26
|
+
Thu, 04 Sep 2025 13:51:09 GMT
|
|
27
|
+
|
|
28
|
+
_Version update only_
|
|
29
|
+
|
|
30
|
+
## 5.1.4
|
|
31
|
+
Fri, 22 Aug 2025 14:22:33 GMT
|
|
32
|
+
|
|
33
|
+
_Version update only_
|
|
34
|
+
|
|
35
|
+
## 5.1.3
|
|
36
|
+
Wed, 20 Aug 2025 13:57:10 GMT
|
|
37
|
+
|
|
38
|
+
_Version update only_
|
|
4
39
|
|
|
5
40
|
## 5.1.2
|
|
6
41
|
Thu, 14 Aug 2025 19:38:08 GMT
|
|
@@ -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,OAAO,EA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M,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"}
|
|
@@ -70,6 +70,7 @@ const createDefaultNativePlatform = (props) => {
|
|
|
70
70
|
return class {
|
|
71
71
|
_nativeAddon;
|
|
72
72
|
constructor() {
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
73
74
|
const cacheConfig = props.cacheConfig ?? { mode: PresentationManager_js_1.HierarchyCacheMode.Disk, directory: "" };
|
|
74
75
|
const defaultFormats = props.defaultFormats ? this.getSerializedDefaultFormatsMap(props.defaultFormats) : {};
|
|
75
76
|
this._nativeAddon = new core_backend_1.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,sDAAwF;AACxF,sDAAsD;AAEtD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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;AAtGW,QAAA,2BAA2B,+BAsGtC","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,sDAAwF;AACxF,sDAAsD;AAEtD,oEASoC;AACpC,qEAA8D;AAE9D,gBAAgB;AAChB,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,0CAA1B,0BAA0B,QAgBrC;AAED;;;GAGG;AACH,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACtC,iDAAiB,CAAA;IACjB,oEAAoC,CAAA;IACpC,4DAA4B,CAAA;IAC5B,sDAAsB,CAAA;AACxB,CAAC,EALW,4BAA4B,4CAA5B,4BAA4B,QAKvC;AAyDD,gBAAgB;AAChB,MAAa,uCAAwC,SAAQ,uCAAiB;IAC5D,WAAW,CAAwB;IACnD,YAAmB,aAAoE;QACrF,IAAA,qBAAM,EAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9B,KAAK,CAAC,6CAA6C,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC9G,IAAI,CAAC,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;IAC/C,CAAC;CACF;AAPD,0FAOC;AAED,SAAS,6CAA6C,CAAC,oBAAyD;IAC9G,QA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YAClB,OAAO,IAAI,CAAC,gBAAgB,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;AAvGW,QAAA,2BAA2B,+BAuGtC","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
|
/**
|
|
@@ -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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AC,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA4B3H"}
|
|
@@ -20,9 +20,12 @@ const PresentationManagerDetail_js_1 = require("./PresentationManagerDetail.js")
|
|
|
20
20
|
const RulesetVariablesManager_js_1 = require("./RulesetVariablesManager.js");
|
|
21
21
|
const SelectionScopesHelper_js_1 = require("./SelectionScopesHelper.js");
|
|
22
22
|
const Utils_js_1 = require("./Utils.js");
|
|
23
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
23
24
|
/**
|
|
24
25
|
* Presentation hierarchy cache mode.
|
|
25
26
|
* @public
|
|
27
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
28
|
+
* package for creating hierarchies.
|
|
26
29
|
*/
|
|
27
30
|
var HierarchyCacheMode;
|
|
28
31
|
(function (HierarchyCacheMode) {
|
|
@@ -109,9 +112,12 @@ class PresentationManager {
|
|
|
109
112
|
getRulesetId(rulesetOrId) {
|
|
110
113
|
return this._detail.getRulesetId(rulesetOrId);
|
|
111
114
|
}
|
|
115
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
112
116
|
/**
|
|
113
117
|
* Retrieves nodes
|
|
114
118
|
* @public
|
|
119
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
120
|
+
* package for creating hierarchies.
|
|
115
121
|
*/
|
|
116
122
|
async getNodes(requestOptions) {
|
|
117
123
|
const serializedHierarchyLevel = await this._detail.getNodes(requestOptions);
|
|
@@ -121,6 +127,8 @@ class PresentationManager {
|
|
|
121
127
|
/**
|
|
122
128
|
* Retrieves nodes count
|
|
123
129
|
* @public
|
|
130
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
131
|
+
* package for creating hierarchies.
|
|
124
132
|
*/
|
|
125
133
|
async getNodesCount(requestOptions) {
|
|
126
134
|
return this._detail.getNodesCount(requestOptions);
|
|
@@ -128,6 +136,8 @@ class PresentationManager {
|
|
|
128
136
|
/**
|
|
129
137
|
* Retrieves hierarchy level descriptor
|
|
130
138
|
* @public
|
|
139
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
140
|
+
* package for creating hierarchies.
|
|
131
141
|
*/
|
|
132
142
|
async getNodesDescriptor(requestOptions) {
|
|
133
143
|
const response = await this._detail.getNodesDescriptor(requestOptions);
|
|
@@ -138,6 +148,8 @@ class PresentationManager {
|
|
|
138
148
|
* Retrieves paths from root nodes to children nodes according to specified instance key paths. Intersecting paths will be merged.
|
|
139
149
|
* TODO: Return results in pages
|
|
140
150
|
* @public
|
|
151
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
152
|
+
* package for creating hierarchies.
|
|
141
153
|
*/
|
|
142
154
|
async getNodePaths(requestOptions) {
|
|
143
155
|
const result = await this._detail.getNodePaths(requestOptions);
|
|
@@ -147,11 +159,14 @@ class PresentationManager {
|
|
|
147
159
|
* Retrieves paths from root nodes to nodes containing filter text in their label.
|
|
148
160
|
* TODO: Return results in pages
|
|
149
161
|
* @public
|
|
162
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
163
|
+
* package for creating hierarchies.
|
|
150
164
|
*/
|
|
151
165
|
async getFilteredNodePaths(requestOptions) {
|
|
152
166
|
const result = await this._detail.getFilteredNodePaths(requestOptions);
|
|
153
167
|
return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));
|
|
154
168
|
}
|
|
169
|
+
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
155
170
|
/**
|
|
156
171
|
* Get information about the sources of content when building it for specific ECClasses. Sources involve classes of the primary select instance,
|
|
157
172
|
* its related instances for loading related and navigation properties.
|
|
@@ -335,7 +350,10 @@ class PresentationManager {
|
|
|
335
350
|
/**
|
|
336
351
|
* Compares two hierarchies specified in the request options
|
|
337
352
|
* @public
|
|
353
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
354
|
+
* package for creating hierarchies.
|
|
338
355
|
*/
|
|
356
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
339
357
|
async compareHierarchies(requestOptions) {
|
|
340
358
|
if (!requestOptions.prev.rulesetOrId && !requestOptions.prev.rulesetVariables) {
|
|
341
359
|
return { changes: [] };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManager.js","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAAsC;AACtC,mDAA+C;AAI/C,gEAAgF;AAChF,oEA6CoC;AACpC,kEAO6C;AAC7C,6EAAgI;AAChI,6DAAoE;AACpE,2DAAiE;AACjE,iFAA+F;AAE/F,6EAAoG;AACpG,yEAAmE;AACnE,yCAA0G;AAE1G;;;GAGG;AACH,IAAY,kBAiBX;AAjBD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,uCAAiB,CAAA;IACjB;;;OAGG;IACH,mCAAa,CAAA;IACb;;;;;OAKG;IACH,uCAAiB,CAAA;AACnB,CAAC,EAjBW,kBAAkB,kCAAlB,kBAAkB,QAiB7B;AA8PD;;;;;GAKG;AACH,MAAa,mBAAmB;IACtB,MAAM,CAA2B;IACjC,OAAO,CAA4B;IACnC,mBAAmB,CAAqB;IACxC,sBAAsB,CAAsC;IAEpE;;;OAGG;IACH,YAAY,KAAgC;QAC1C,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,wDAAyB,CAAC,IAAI,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AAI,CAAC,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QAE1C,MAAM,aAAa,GAAG,IAAA,iDAAkB,EAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACrE,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAA,iDAAkB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;QAC9F,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,KAAK,aAAa,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;YACtD,MAAM,IAAI,uCAAiB,CAAC,wCAAkB,CAAC,eAAe,EAAE,2CAA2C,CAAC,CAAC;QAC/G,CAAC;QAED,MAAM,oBAAoB,GAAG,gBAAgB,IAAI,EAAE,CAAC;QACpD,MAAM,oBAAoB,GAAG,IAAI,CAAC,gBAAgB,IAAI,oBAAoB,CAAC;QAE3E,MAAM,MAAM,GAAG;YACb,SAAS,EAAE,8CAA0B,CAAC,kBAAkB;YACxD,GAAG,OAAO;YACV,aAAa,EAAE,aAAa,CAAC,QAAQ;YACrC,aAAa,EAAE,aAAa,CAAC,QAAQ;YACrC,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;YAC1D,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;YAC1D,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,gBAAgB,IAAI,EAAE,CAAC;SACjE,CAAC;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,CAAC;CACF;AA9aD,kDA8aC","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 { firstValueFrom } from \"rxjs\";\nimport { eachValueFrom } from \"rxjs-for-await\";\nimport { IModelDb } from \"@itwin/core-backend\";\nimport { BeEvent, Id64Array } from \"@itwin/core-bentley\";\nimport { FormatsProvider, UnitSystemKey } from \"@itwin/core-quantity\";\nimport { SchemaContext, SchemaFormatsProvider } from \"@itwin/ecschema-metadata\";\nimport {\n UnitSystemFormat as CommonUnitSystemFormat,\n ComputeSelectionRequestOptions,\n Content,\n ContentDescriptorRequestOptions,\n ContentFlags,\n ContentRequestOptions,\n ContentSourcesRequestOptions,\n DefaultContentDisplayTypes,\n Descriptor,\n DescriptorOverrides,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n DisplayValueGroup,\n DistinctValuesRequestOptions,\n ElementProperties,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n FormatsMap,\n HierarchyCompareInfo,\n HierarchyCompareOptions,\n HierarchyLevel,\n HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions,\n InstanceKey,\n Item,\n KeySet,\n KoqPropertyValueFormatter,\n LabelDefinition,\n MultiElementPropertiesRequestOptions,\n Node,\n NodeKey,\n NodePathElement,\n Paged,\n PagedResponse,\n PresentationError,\n PresentationStatus,\n Prioritized,\n Ruleset,\n RulesetVariable,\n SelectClassInfo,\n SelectionScope,\n SelectionScopeRequestOptions,\n SingleElementPropertiesRequestOptions,\n WithCancelEvent,\n} from \"@itwin/presentation-common\";\nimport {\n buildElementProperties,\n ContentFormatter,\n ContentPropertyValueFormatter,\n deepReplaceNullsToUndefined,\n isSingleElementPropertiesRequestOptions,\n LocalizationHelper,\n} from \"@itwin/presentation-common/internal\";\nimport { getContentItemsObservableFromClassNames, getContentItemsObservableFromElementIds } from \"./ElementPropertiesHelper.js\";\nimport { _presentation_manager_detail } from \"./InternalSymbols.js\";\nimport { NativePlatformRequestTypes } from \"./NativePlatform.js\";\nimport { getRulesetIdObject, PresentationManagerDetail } from \"./PresentationManagerDetail.js\";\nimport { RulesetManager } from \"./RulesetManager.js\";\nimport { RulesetVariablesManager, RulesetVariablesManagerImpl } from \"./RulesetVariablesManager.js\";\nimport { SelectionScopesHelper } from \"./SelectionScopesHelper.js\";\nimport { BackendDiagnosticsAttribute, BackendDiagnosticsOptions, getLocalizedStringEN } from \"./Utils.js\";\n\n/**\n * Presentation hierarchy cache mode.\n * @public\n */\nexport enum HierarchyCacheMode {\n /**\n * Hierarchy cache is created in memory.\n */\n Memory = \"memory\",\n /**\n * Hierarchy cache is created on disk. In this mode hierarchy cache is persisted between iModel\n * openings.\n */\n Disk = \"disk\",\n /**\n * Hierarchy cache is created on disk. In this mode everything is cached in memory while creating hierarchy level\n * and persisted in disk cache when whole hierarchy level is created.\n *\n * **Note:** This mode is still experimental.\n */\n Hybrid = \"hybrid\",\n}\n\n/**\n * Configuration for hierarchy cache.\n * @public\n */\nexport type HierarchyCacheConfig = MemoryHierarchyCacheConfig | DiskHierarchyCacheConfig | HybridCacheConfig;\n\n/**\n * Base interface for all [[HierarchyCacheConfig]] implementations.\n * @public\n */\nexport interface HierarchyCacheConfigBase {\n mode: HierarchyCacheMode;\n}\n\n/**\n * Configuration for in-memory hierarchy cache.\n *\n * @see [Memory cache documentation page]($docs/presentation/advanced/Caching.md#memory-cache)\n * @public\n */\nexport interface MemoryHierarchyCacheConfig extends HierarchyCacheConfigBase {\n mode: HierarchyCacheMode.Memory;\n}\n\n/**\n * Configuration for persistent disk hierarchy cache.\n *\n * @see [Disk cache documentation page]($docs/presentation/advanced/Caching.md#disk-cache)\n * @public\n */\nexport interface DiskHierarchyCacheConfig extends HierarchyCacheConfigBase {\n mode: HierarchyCacheMode.Disk;\n\n /**\n * A directory for hierarchy caches. If set, the directory must exist. Relative paths start from `process.cwd()`.\n *\n * The default directory depends on the iModel and the way it's opened.\n */\n directory?: string;\n\n /**\n * While the cache itself is stored on a disk, there's still a required small in-memory cache.\n * The parameter allows controlling size of that cache. Defaults to `32768000` bytes (32 MB).\n */\n memoryCacheSize?: number;\n}\n\n/**\n * Configuration for the experimental hybrid hierarchy cache.\n *\n * Hybrid cache uses a combination of in-memory and disk caches, which should make it a better\n * alternative for cases when there are lots of simultaneous requests.\n *\n * @see [Hybrid cache documentation page]($docs/presentation/advanced/Caching.md#hybrid-cache)\n * @public\n */\nexport interface HybridCacheConfig extends HierarchyCacheConfigBase {\n mode: HierarchyCacheMode.Hybrid;\n\n /** Configuration for disk cache used to persist hierarchies. */\n disk?: DiskHierarchyCacheConfig;\n}\n\n/**\n * Configuration for content cache.\n *\n * @see [Content cache documentation page]($docs/presentation/advanced/Caching.md#content-cache)\n * @public\n */\nexport interface ContentCacheConfig {\n /**\n * Maximum number of content descriptors cached in memory for quicker paged content requests.\n *\n * Defaults to `100`.\n */\n size?: number;\n}\n\n/**\n * Caching configuration options for [[PresentationManager]].\n * @public\n */\nexport interface PresentationManagerCachingConfig {\n /**\n * Hierarchies-related caching options.\n *\n * @see [Hierarchies cache documentation page]($docs/presentation/advanced/Caching.md#hierarchies-cache)\n */\n hierarchies?: HierarchyCacheConfig;\n\n /**\n * Content-related caching options.\n *\n * @see [Content cache documentation page]($docs/presentation/advanced/Caching.md#content-cache)\n */\n content?: ContentCacheConfig;\n\n /**\n * Each worker thread (see [[workerThreadsCount]]) opens a connection to an iModel used for a request. This\n * means there could be `{workerThreadsCount} * {iModels count}` number of connections. Each connection\n * uses a memory cache to increase iModel read performance. This parameter allows controlling the size of that\n * cache. Defaults to `32768000` bytes (32 MB).\n *\n * @see [Worker connections cache documentation page]($docs/presentation/advanced/Caching.md#worker-connections-cache)\n */\n workerConnectionCacheSize?: number;\n}\n\n/**\n * A data structure that associates unit systems with a format. The associations are used for\n * assigning default unit formats for specific phenomenons (see [[PresentationManagerProps.defaultFormats]]).\n *\n * @public\n * @deprecated in 4.3 - will not be removed until after 2026-06-13. The type has been moved to `@itwin/presentation-common` package.\n */\nexport type UnitSystemFormat = CommonUnitSystemFormat;\n\n/**\n * Data structure for multiple element properties request response.\n * @public\n */\nexport interface MultiElementPropertiesResponse<TParsedContent = ElementProperties> {\n total: number;\n iterator: () => AsyncGenerator<TParsedContent[]>;\n}\n\n/**\n * Configuration options for supplying asset paths to [[PresentationManager]].\n * @public\n */\nexport interface PresentationAssetsRootConfig {\n /**\n * Path to `presentation-backend` assets. Relative paths start from `process.cwd()`.\n */\n backend: string;\n}\n\n/**\n * Properties that can be used to configure [[PresentationManager]]\n * @public\n */\nexport interface PresentationManagerProps {\n /**\n * Path overrides for presentation backend assets. Need to be overriden by application if it puts these assets someplace else than the default.\n *\n * By default the path to assets directory is determined during the call of [[Presentation.initialize]] using this algorithm:\n *\n * - if path of `.js` file that contains [[PresentationManager]] definition contains \"presentation-backend\", assume the package is in `node_modules` and the directory structure is:\n * - `assets/*\\*\\/*`\n * - `presentation-backend/{presentation-backend source files}`\n *\n * which means the assets can be found through a relative path `../assets/` from the JS file being executed.\n *\n * - else, assume the backend is webpacked into a single file with assets next to it:\n * - `assets/*\\*\\/*`\n * - `{source file being executed}.js`\n *\n * which means the assets can be found through a relative path `./assets/` from the `{source file being executed}`.\n *\n * @deprecated in 4.2 - will not be removed until after 2026-06-13. This attribute is not used anymore - the package is not using private assets anymore.\n */\n presentationAssetsRoot?: string | PresentationAssetsRootConfig;\n\n /**\n * A list of directories containing application's presentation rulesets. Relative\n * paths start from `process.cwd()`. The directories are traversed recursively.\n *\n * @note Only files with `.PresentationRuleSet.json` are read.\n */\n rulesetDirectories?: string[];\n\n /**\n * A list of directories containing application's supplemental presentation rulesets. Relative\n * paths start from `process.cwd()`. The directories are traversed recursively.\n *\n * @note Only files with `.PresentationRuleSet.json` are read.\n */\n supplementalRulesetDirectories?: string[];\n\n /**\n * Sets the active unit system to use for formatting property values with\n * units. Default presentation units are used if this is not specified. The active unit\n * system can later be changed through [[PresentationManager.activeUnitSystem]] or overriden for each request\n * through request options.\n */\n defaultUnitSystem?: UnitSystemKey;\n\n /**\n * A map of default unit formats to use for formatting properties that don't have a presentation format\n * in requested unit system.\n *\n * @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.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n defaultFormats?: FormatsMap;\n\n /**\n * A custom formats provider to use for formatting property values with units. Defaults to [SchemaFormatsProvider]($ecschema-metadata) if\n * not supplied.\n */\n formatsProvider?: FormatsProvider;\n\n /**\n * A number of worker threads to use for handling presentation requests. Defaults to `2`.\n */\n workerThreadsCount?: number;\n\n /**\n * The interval (in milliseconds) used to poll for presentation data changes. If not set, presentation\n * data changes are not tracked at all.\n *\n * @beta\n * @deprecated in 4.4 - will not be removed until after 2026-06-13. The manager now always tracks for iModel data changes without polling.\n */\n updatesPollInterval?: number;\n\n /** Options for caching. */\n caching?: PresentationManagerCachingConfig;\n\n /**\n * Use [SQLite's Memory-Mapped I/O](https://sqlite.org/mmap.html) for worker connections. This mode improves performance of handling\n * requests with high I/O intensity, e.g. filtering large tables on non-indexed columns. No downsides have been noticed.\n *\n * Set to a falsy value to turn off. `true` for memory-mapping the whole iModel. Number value for memory-mapping the specified amount of bytes.\n */\n useMmap?: boolean | number;\n\n /**\n * Localization function to localize data returned by presentation manager when it's used directly on the backend (as opposed to when used through RPC, where\n * data is localized on the frontend). Defaults to English localization.\n *\n * @see [Localization]($docs/presentation/advanced/Localization)\n */\n getLocalizedString?: (key: string) => string;\n\n /**\n * Callback that provides [SchemaContext]($ecschema-metadata) for supplied [IModelDb]($core-backend).\n * [SchemaContext]($ecschema-metadata) is used for getting metadata required for values formatting.\n *\n * @deprecated in 5.1 - will not be removed until after 2026-08-08. By default [IModelDb.schemaContext]($core-backend) is now used instead.\n */\n schemaContextProvider?: (imodel: IModelDb) => SchemaContext;\n\n /**\n * Parameters for gathering diagnostics at the manager level. When supplied, they're used with every request\n * made through the manager.\n *\n * @see [Diagnostics documentation page]($docs/presentation/advanced/Diagnostics.md)\n */\n diagnostics?: BackendDiagnosticsOptions;\n}\n\n/**\n * Backend Presentation manager which pulls the presentation data from\n * an iModel using native platform.\n *\n * @public\n */\nexport class PresentationManager {\n private _props: PresentationManagerProps;\n private _detail: PresentationManagerDetail;\n private _localizationHelper: LocalizationHelper;\n private _schemaContextProvider: (imodel: IModelDb) => SchemaContext;\n\n /**\n * Creates an instance of PresentationManager.\n * @param props Optional configuration properties.\n */\n constructor(props?: PresentationManagerProps) {\n this._props = props ?? {};\n this._detail = new PresentationManagerDetail(this._props);\n this._localizationHelper = new LocalizationHelper({ getLocalizedString: props?.getLocalizedString ?? getLocalizedStringEN });\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this._schemaContextProvider = props?.schemaContextProvider ?? ((imodel: IModelDb) => imodel.schemaContext);\n }\n\n /** Get / set active unit system used to format property values with units */\n public get activeUnitSystem(): UnitSystemKey | undefined {\n return this._detail.activeUnitSystem;\n }\n /* c8 ignore next 3 */\n public set activeUnitSystem(value: UnitSystemKey | undefined) {\n this._detail.activeUnitSystem = value;\n }\n\n /** Dispose the presentation manager. Must be called to clean up native resources. */\n public [Symbol.dispose]() {\n this._detail[Symbol.dispose]();\n }\n\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */\n /* c8 ignore next 3 */\n public dispose() {\n this[Symbol.dispose]();\n }\n\n /** An event, that this manager raises whenever any request is made on it. */\n public get onUsed(): BeEvent<() => void> {\n return this._detail.onUsed;\n }\n\n /** Properties used to initialize the manager */\n public get props() {\n return this._props;\n }\n\n /** Get rulesets manager */\n public rulesets(): RulesetManager {\n return this._detail.rulesets;\n }\n\n /**\n * Get ruleset variables manager for specific ruleset\n * @param rulesetId Id of the ruleset to get variables manager for\n */\n public vars(rulesetId: string): RulesetVariablesManager {\n return new RulesetVariablesManagerImpl(() => this._detail.getNativePlatform(), rulesetId);\n }\n\n /** @internal */\n /* c8 ignore next 3 */\n public get [_presentation_manager_detail](): PresentationManagerDetail {\n return this._detail;\n }\n\n public getRulesetId(rulesetOrId: Ruleset | string) {\n return this._detail.getRulesetId(rulesetOrId);\n }\n\n /**\n * Retrieves nodes\n * @public\n */\n public async getNodes(\n requestOptions: WithCancelEvent<Prioritized<Paged<HierarchyRequestOptions<IModelDb, NodeKey, RulesetVariable>>>> & BackendDiagnosticsAttribute,\n ): Promise<Node[]> {\n const serializedHierarchyLevel = await this._detail.getNodes(requestOptions);\n const hierarchyLevel: HierarchyLevel = deepReplaceNullsToUndefined(JSON.parse(serializedHierarchyLevel));\n return this._localizationHelper.getLocalizedNodes(hierarchyLevel.nodes);\n }\n\n /**\n * Retrieves nodes count\n * @public\n */\n public async getNodesCount(\n requestOptions: WithCancelEvent<Prioritized<HierarchyRequestOptions<IModelDb, NodeKey, RulesetVariable>>> & BackendDiagnosticsAttribute,\n ): Promise<number> {\n return this._detail.getNodesCount(requestOptions);\n }\n\n /**\n * Retrieves hierarchy level descriptor\n * @public\n */\n public async getNodesDescriptor(\n requestOptions: WithCancelEvent<Prioritized<HierarchyLevelDescriptorRequestOptions<IModelDb, NodeKey, RulesetVariable>>> & BackendDiagnosticsAttribute,\n ): Promise<Descriptor | undefined> {\n const response = await this._detail.getNodesDescriptor(requestOptions);\n const descriptor = Descriptor.fromJSON(JSON.parse(response));\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\n }\n\n /**\n * Retrieves paths from root nodes to children nodes according to specified instance key paths. Intersecting paths will be merged.\n * TODO: Return results in pages\n * @public\n */\n public async getNodePaths(\n requestOptions: WithCancelEvent<Prioritized<FilterByInstancePathsHierarchyRequestOptions<IModelDb, RulesetVariable>>> & BackendDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n const result = await this._detail.getNodePaths(requestOptions);\n return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\n }\n\n /**\n * Retrieves paths from root nodes to nodes containing filter text in their label.\n * TODO: Return results in pages\n * @public\n */\n public async getFilteredNodePaths(\n requestOptions: WithCancelEvent<Prioritized<FilterByTextHierarchyRequestOptions<IModelDb, RulesetVariable>>> & BackendDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n const result = await this._detail.getFilteredNodePaths(requestOptions);\n return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\n }\n\n /**\n * Get information about the sources of content when building it for specific ECClasses. Sources involve classes of the primary select instance,\n * its related instances for loading related and navigation properties.\n * @public\n */\n public async getContentSources(\n requestOptions: WithCancelEvent<Prioritized<ContentSourcesRequestOptions<IModelDb>>> & BackendDiagnosticsAttribute,\n ): Promise<SelectClassInfo[]> {\n return this._detail.getContentSources(requestOptions);\n }\n\n /**\n * Retrieves the content descriptor which can be used to get content\n * @public\n */\n public async getContentDescriptor(\n requestOptions: WithCancelEvent<Prioritized<ContentDescriptorRequestOptions<IModelDb, KeySet, RulesetVariable>>> & BackendDiagnosticsAttribute,\n ): Promise<Descriptor | undefined> {\n const response = await this._detail.getContentDescriptor(requestOptions);\n const descriptor = Descriptor.fromJSON(JSON.parse(response));\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\n }\n\n /**\n * Retrieves the content set size based on the supplied content descriptor override\n * @public\n */\n public async getContentSetSize(\n requestOptions: WithCancelEvent<Prioritized<ContentRequestOptions<IModelDb, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>>> &\n BackendDiagnosticsAttribute,\n ): Promise<number> {\n return this._detail.getContentSetSize(requestOptions);\n }\n\n private createContentFormatter({ imodel, unitSystem }: { imodel: IModelDb; unitSystem?: UnitSystemKey }): ContentFormatter {\n if (!unitSystem) {\n unitSystem = this.props.defaultUnitSystem ?? \"metric\";\n }\n const schemaContext = this._schemaContextProvider(imodel);\n const koqPropertyFormatter = new KoqPropertyValueFormatter({\n schemaContext,\n formatsProvider: this.props.formatsProvider ?? new SchemaFormatsProvider(schemaContext, unitSystem),\n });\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n koqPropertyFormatter.defaultFormats = this.props.defaultFormats;\n return new ContentFormatter(new ContentPropertyValueFormatter(koqPropertyFormatter), unitSystem);\n }\n\n /**\n * Retrieves the content set based on the supplied content descriptor.\n * @public\n */\n public async getContentSet(\n requestOptions: WithCancelEvent<Prioritized<Paged<ContentRequestOptions<IModelDb, Descriptor, KeySet, RulesetVariable>>>> & BackendDiagnosticsAttribute,\n ): Promise<Item[]> {\n let items = await this._detail.getContentSet({ ...requestOptions, omitFormattedValues: true });\n\n if (!requestOptions.omitFormattedValues) {\n const formatter = this.createContentFormatter(requestOptions);\n items = await formatter.formatContentItems(items, requestOptions.descriptor);\n }\n\n return this._localizationHelper.getLocalizedContentItems(items);\n }\n\n /**\n * Retrieves the content based on the supplied content descriptor override.\n * @public\n */\n public async getContent(\n requestOptions: WithCancelEvent<Prioritized<Paged<ContentRequestOptions<IModelDb, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>>>> &\n BackendDiagnosticsAttribute,\n ): Promise<Content | undefined> {\n const content = await this._detail.getContent({ ...requestOptions, omitFormattedValues: true });\n if (!content) {\n return undefined;\n }\n\n if (!requestOptions.omitFormattedValues) {\n const formatter = this.createContentFormatter(requestOptions);\n await formatter.formatContent(content);\n }\n\n return this._localizationHelper.getLocalizedContent(content);\n }\n\n /**\n * Retrieves distinct values of specific field from the content based on the supplied content descriptor override.\n * @param requestOptions Options for the request\n * @return A promise object that returns either distinct values on success or an error string on error.\n * @public\n */\n public async getPagedDistinctValues(\n requestOptions: WithCancelEvent<Prioritized<DistinctValuesRequestOptions<IModelDb, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>>> &\n BackendDiagnosticsAttribute,\n ): Promise<PagedResponse<DisplayValueGroup>> {\n const result = await this._detail.getPagedDistinctValues(requestOptions);\n return {\n ...result,\n items: result.items.map((g) => this._localizationHelper.getLocalizedDisplayValueGroup(g)),\n };\n }\n\n /**\n * Retrieves property data in a simplified format for a single element specified by ID.\n * @public\n */\n public async getElementProperties<TParsedContent = ElementProperties>(\n requestOptions: WithCancelEvent<Prioritized<SingleElementPropertiesRequestOptions<IModelDb, TParsedContent>>> & BackendDiagnosticsAttribute,\n ): Promise<TParsedContent | undefined>;\n /**\n * Retrieves property data in simplified format for multiple elements specified by class or all element.\n * @return An object that contains element count and AsyncGenerator to iterate over properties of those elements in batches of undefined size.\n * @public\n */\n public async getElementProperties<TParsedContent = ElementProperties>(\n requestOptions: WithCancelEvent<Prioritized<MultiElementPropertiesRequestOptions<IModelDb, TParsedContent>>> & BackendDiagnosticsAttribute,\n ): Promise<MultiElementPropertiesResponse<TParsedContent>>;\n public async getElementProperties<TParsedContent = ElementProperties>(\n requestOptions: WithCancelEvent<\n Prioritized<SingleElementPropertiesRequestOptions<IModelDb, TParsedContent> | MultiElementPropertiesRequestOptions<IModelDb, TParsedContent>>\n > &\n BackendDiagnosticsAttribute,\n ): Promise<TParsedContent | undefined | MultiElementPropertiesResponse<TParsedContent>> {\n if (isSingleElementPropertiesRequestOptions(requestOptions)) {\n return this.getSingleElementProperties<TParsedContent>(requestOptions);\n }\n return this.getMultipleElementProperties<TParsedContent>(requestOptions);\n }\n\n private async getSingleElementProperties<TParsedContent>(\n requestOptions: WithCancelEvent<Prioritized<SingleElementPropertiesRequestOptions<IModelDb, TParsedContent>>> & BackendDiagnosticsAttribute,\n ): Promise<TParsedContent | undefined> {\n type TParser = Required<typeof requestOptions>[\"contentParser\"];\n const { elementId, contentParser, ...optionsNoElementId } = requestOptions;\n const parser: TParser = contentParser ?? (buildElementProperties as TParser);\n const content = await this.getContent({\n ...optionsNoElementId,\n descriptor: {\n displayType: DefaultContentDisplayTypes.PropertyPane,\n contentFlags: ContentFlags.ShowLabels,\n },\n rulesetOrId: \"ElementProperties\",\n keys: new KeySet([{ className: \"BisCore:Element\", id: elementId }]),\n });\n if (!content || content.contentSet.length === 0) {\n return undefined;\n }\n return parser(content.descriptor, content.contentSet[0]);\n }\n\n private async getMultipleElementProperties<TParsedContent>(\n requestOptions: WithCancelEvent<Prioritized<MultiElementPropertiesRequestOptions<IModelDb, TParsedContent>>> & BackendDiagnosticsAttribute,\n ): Promise<MultiElementPropertiesResponse<TParsedContent>> {\n type TParser = Required<typeof requestOptions>[\"contentParser\"];\n const { contentParser, batchSize: batchSizeOption, ...contentOptions } = requestOptions;\n\n const parser: TParser = contentParser ?? (buildElementProperties as TParser);\n const workerThreadsCount = this._props.workerThreadsCount ?? 2;\n\n // We don't want to request content for all classes at once - each class results in a huge content descriptor object that's cached in memory\n // and can be shared across all batch requests for that class. Handling multiple classes at the same time not only increases memory footprint,\n // but also may push descriptors out of cache, requiring us to recreate them, thus making performance worse. For those reasons we handle at\n // most `workerThreadsCount / 2` classes in parallel.\n /* c8 ignore next */\n const classParallelism = workerThreadsCount > 1 ? Math.ceil(workerThreadsCount / 2) : 1;\n\n // We want all worker threads to be constantly busy. However, there's some fairly expensive work being done after the worker thread is done,\n // but before we receive the response. That means the worker thread would be starving if we sent only `workerThreadsCount` requests in parallel.\n // To avoid that, we keep twice as much requests active.\n /* c8 ignore next */\n const batchesParallelism = workerThreadsCount > 0 ? workerThreadsCount : 1;\n\n /* c8 ignore next */\n const batchSize = batchSizeOption ?? 100;\n\n const elementsIdentifier = ((): { elementIds: Id64Array } | { elementClasses: string[] } => {\n if (\"elementIds\" in contentOptions && contentOptions.elementIds !== undefined) {\n const elementIds = contentOptions.elementIds;\n delete contentOptions.elementIds;\n return { elementIds };\n }\n if (\"elementClasses\" in contentOptions && contentOptions.elementClasses !== undefined) {\n const elementClasses = contentOptions.elementClasses;\n delete contentOptions.elementClasses;\n return { elementClasses };\n }\n /* c8 ignore next */\n return { elementClasses: [\"BisCore:Element\"] };\n })();\n\n const descriptorGetter = async (partialProps: Pick<ContentDescriptorRequestOptions<IModelDb, KeySet, RulesetVariable>, \"rulesetOrId\" | \"keys\">) =>\n this.getContentDescriptor({ ...contentOptions, displayType: DefaultContentDisplayTypes.Grid, contentFlags: ContentFlags.ShowLabels, ...partialProps });\n const contentSetGetter = async (\n partialProps: Pick<ContentRequestOptions<IModelDb, Descriptor, KeySet, RulesetVariable>, \"rulesetOrId\" | \"keys\" | \"descriptor\">,\n ) => this.getContentSet({ ...contentOptions, ...partialProps });\n const { itemBatches, count } =\n \"elementIds\" in elementsIdentifier\n ? getContentItemsObservableFromElementIds(\n requestOptions.imodel,\n descriptorGetter,\n contentSetGetter,\n elementsIdentifier.elementIds,\n classParallelism,\n batchesParallelism,\n batchSize,\n )\n : getContentItemsObservableFromClassNames(\n requestOptions.imodel,\n descriptorGetter,\n contentSetGetter,\n elementsIdentifier.elementClasses,\n classParallelism,\n batchesParallelism,\n batchSize,\n );\n return {\n total: await firstValueFrom(count),\n async *iterator() {\n for await (const itemsBatch of eachValueFrom(itemBatches)) {\n const { descriptor, items } = itemsBatch;\n yield items.map((item) => parser(descriptor, item));\n }\n },\n };\n }\n\n /**\n * Retrieves display label definition of specific item\n * @public\n */\n public async getDisplayLabelDefinition(\n requestOptions: WithCancelEvent<Prioritized<DisplayLabelRequestOptions<IModelDb, InstanceKey>>> & BackendDiagnosticsAttribute,\n ): Promise<LabelDefinition> {\n const labelDefinition = await this._detail.getDisplayLabelDefinition(requestOptions);\n return this._localizationHelper.getLocalizedLabelDefinition(labelDefinition);\n }\n\n /**\n * Retrieves display label definitions of specific items\n * @public\n */\n public async getDisplayLabelDefinitions(\n requestOptions: WithCancelEvent<Prioritized<Paged<DisplayLabelsRequestOptions<IModelDb, InstanceKey>>>> & BackendDiagnosticsAttribute,\n ): Promise<LabelDefinition[]> {\n const labelDefinitions = await this._detail.getDisplayLabelDefinitions(requestOptions);\n return this._localizationHelper.getLocalizedLabelDefinitions(labelDefinitions);\n }\n\n /**\n * Retrieves available selection scopes.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public async getSelectionScopes(_requestOptions: SelectionScopeRequestOptions<IModelDb> & BackendDiagnosticsAttribute): Promise<SelectionScope[]> {\n return SelectionScopesHelper.getSelectionScopes();\n }\n\n /**\n * Computes selection based on provided element IDs and selection scope.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public async computeSelection(requestOptions: ComputeSelectionRequestOptions<IModelDb> & BackendDiagnosticsAttribute): Promise<KeySet> {\n return SelectionScopesHelper.computeSelection(requestOptions);\n }\n\n /**\n * Compares two hierarchies specified in the request options\n * @public\n */\n public async compareHierarchies(requestOptions: HierarchyCompareOptions<IModelDb, NodeKey>): Promise<HierarchyCompareInfo> {\n if (!requestOptions.prev.rulesetOrId && !requestOptions.prev.rulesetVariables) {\n return { changes: [] };\n }\n\n const { rulesetOrId, prev, rulesetVariables, ...options } = requestOptions;\n this._detail.registerRuleset(rulesetOrId);\n\n const currRulesetId = getRulesetIdObject(requestOptions.rulesetOrId);\n const prevRulesetId = prev.rulesetOrId ? getRulesetIdObject(prev.rulesetOrId) : currRulesetId;\n if (prevRulesetId.parts.id !== currRulesetId.parts.id) {\n throw new PresentationError(PresentationStatus.InvalidArgument, \"Can't compare rulesets with different IDs\");\n }\n\n const currRulesetVariables = rulesetVariables ?? [];\n const prevRulesetVariables = prev.rulesetVariables ?? currRulesetVariables;\n\n const params = {\n requestId: NativePlatformRequestTypes.CompareHierarchies,\n ...options,\n prevRulesetId: prevRulesetId.uniqueId,\n currRulesetId: currRulesetId.uniqueId,\n prevRulesetVariables: JSON.stringify(prevRulesetVariables),\n currRulesetVariables: JSON.stringify(currRulesetVariables),\n expandedNodeKeys: JSON.stringify(options.expandedNodeKeys ?? []),\n };\n return JSON.parse(await this._detail.request(params));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PresentationManager.js","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BA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oBAAoB,GAAG,IAAI,CAAC,gBAAgB,IAAI,oBAAoB,CAAC;QAE3E,MAAM,MAAM,GAAG;YACb,SAAS,EAAE,8CAA0B,CAAC,kBAAkB;YACxD,GAAG,OAAO;YACV,aAAa,EAAE,aAAa,CAAC,QAAQ;YACrC,aAAa,EAAE,aAAa,CAAC,QAAQ;YACrC,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;YAC1D,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;YAC1D,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,gBAAgB,IAAI,EAAE,CAAC;SACjE,CAAC;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,CAAC;CACF;AA/bD,kDA+bC","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 { firstValueFrom } from \"rxjs\";\nimport { eachValueFrom } from \"rxjs-for-await\";\nimport { IModelDb } from \"@itwin/core-backend\";\nimport { BeEvent, Id64Array } from \"@itwin/core-bentley\";\nimport { FormatsProvider, UnitSystemKey } from \"@itwin/core-quantity\";\nimport { SchemaContext, SchemaFormatsProvider } from \"@itwin/ecschema-metadata\";\nimport {\n UnitSystemFormat as CommonUnitSystemFormat,\n ComputeSelectionRequestOptions,\n Content,\n ContentDescriptorRequestOptions,\n ContentFlags,\n ContentRequestOptions,\n ContentSourcesRequestOptions,\n DefaultContentDisplayTypes,\n Descriptor,\n DescriptorOverrides,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n DisplayValueGroup,\n DistinctValuesRequestOptions,\n ElementProperties,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n FormatsMap,\n HierarchyCompareInfo,\n HierarchyCompareOptions,\n HierarchyLevel,\n HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions,\n InstanceKey,\n Item,\n KeySet,\n KoqPropertyValueFormatter,\n LabelDefinition,\n MultiElementPropertiesRequestOptions,\n Node,\n NodeKey,\n NodePathElement,\n Paged,\n PagedResponse,\n PresentationError,\n PresentationStatus,\n Prioritized,\n Ruleset,\n RulesetVariable,\n SelectClassInfo,\n SelectionScope,\n SelectionScopeRequestOptions,\n SingleElementPropertiesRequestOptions,\n WithCancelEvent,\n} from \"@itwin/presentation-common\";\nimport {\n buildElementProperties,\n ContentFormatter,\n ContentPropertyValueFormatter,\n deepReplaceNullsToUndefined,\n isSingleElementPropertiesRequestOptions,\n LocalizationHelper,\n} from \"@itwin/presentation-common/internal\";\nimport { getContentItemsObservableFromClassNames, getContentItemsObservableFromElementIds } from \"./ElementPropertiesHelper.js\";\nimport { _presentation_manager_detail } from \"./InternalSymbols.js\";\nimport { NativePlatformRequestTypes } from \"./NativePlatform.js\";\nimport { getRulesetIdObject, PresentationManagerDetail } from \"./PresentationManagerDetail.js\";\nimport { RulesetManager } from \"./RulesetManager.js\";\nimport { RulesetVariablesManager, RulesetVariablesManagerImpl } from \"./RulesetVariablesManager.js\";\nimport { SelectionScopesHelper } from \"./SelectionScopesHelper.js\";\nimport { BackendDiagnosticsAttribute, BackendDiagnosticsOptions, getLocalizedStringEN } from \"./Utils.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n/**\n * Presentation hierarchy cache mode.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport enum HierarchyCacheMode {\n /**\n * Hierarchy cache is created in memory.\n */\n Memory = \"memory\",\n /**\n * Hierarchy cache is created on disk. In this mode hierarchy cache is persisted between iModel\n * openings.\n */\n Disk = \"disk\",\n /**\n * Hierarchy cache is created on disk. In this mode everything is cached in memory while creating hierarchy level\n * and persisted in disk cache when whole hierarchy level is created.\n *\n * **Note:** This mode is still experimental.\n */\n Hybrid = \"hybrid\",\n}\n\n/**\n * Configuration for hierarchy cache.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport type HierarchyCacheConfig = MemoryHierarchyCacheConfig | DiskHierarchyCacheConfig | HybridCacheConfig;\n\n/**\n * Base interface for all [[HierarchyCacheConfig]] implementations.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyCacheConfigBase {\n mode: HierarchyCacheMode;\n}\n\n/**\n * Configuration for in-memory hierarchy cache.\n *\n * @see [Memory cache documentation page]($docs/presentation/advanced/Caching.md#memory-cache)\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface MemoryHierarchyCacheConfig extends HierarchyCacheConfigBase {\n mode: HierarchyCacheMode.Memory;\n}\n\n/**\n * Configuration for persistent disk hierarchy cache.\n *\n * @see [Disk cache documentation page]($docs/presentation/advanced/Caching.md#disk-cache)\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface DiskHierarchyCacheConfig extends HierarchyCacheConfigBase {\n mode: HierarchyCacheMode.Disk;\n\n /**\n * A directory for hierarchy caches. If set, the directory must exist. Relative paths start from `process.cwd()`.\n *\n * The default directory depends on the iModel and the way it's opened.\n */\n directory?: string;\n\n /**\n * While the cache itself is stored on a disk, there's still a required small in-memory cache.\n * The parameter allows controlling size of that cache. Defaults to `32768000` bytes (32 MB).\n */\n memoryCacheSize?: number;\n}\n\n/**\n * Configuration for the experimental hybrid hierarchy cache.\n *\n * Hybrid cache uses a combination of in-memory and disk caches, which should make it a better\n * alternative for cases when there are lots of simultaneous requests.\n *\n * @see [Hybrid cache documentation page]($docs/presentation/advanced/Caching.md#hybrid-cache)\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HybridCacheConfig extends HierarchyCacheConfigBase {\n mode: HierarchyCacheMode.Hybrid;\n\n /** Configuration for disk cache used to persist hierarchies. */\n disk?: DiskHierarchyCacheConfig;\n}\n/* eslint-enable @typescript-eslint/no-deprecated */\n\n/**\n * Configuration for content cache.\n *\n * @see [Content cache documentation page]($docs/presentation/advanced/Caching.md#content-cache)\n * @public\n */\nexport interface ContentCacheConfig {\n /**\n * Maximum number of content descriptors cached in memory for quicker paged content requests.\n *\n * Defaults to `100`.\n */\n size?: number;\n}\n\n/**\n * Caching configuration options for [[PresentationManager]].\n * @public\n */\nexport interface PresentationManagerCachingConfig {\n /**\n * Hierarchies-related caching options.\n *\n * @see [Hierarchies cache documentation page]($docs/presentation/advanced/Caching.md#hierarchies-cache)\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n hierarchies?: HierarchyCacheConfig;\n\n /**\n * Content-related caching options.\n *\n * @see [Content cache documentation page]($docs/presentation/advanced/Caching.md#content-cache)\n */\n content?: ContentCacheConfig;\n\n /**\n * Each worker thread (see [[workerThreadsCount]]) opens a connection to an iModel used for a request. This\n * means there could be `{workerThreadsCount} * {iModels count}` number of connections. Each connection\n * uses a memory cache to increase iModel read performance. This parameter allows controlling the size of that\n * cache. Defaults to `32768000` bytes (32 MB).\n *\n * @see [Worker connections cache documentation page]($docs/presentation/advanced/Caching.md#worker-connections-cache)\n */\n workerConnectionCacheSize?: number;\n}\n\n/**\n * A data structure that associates unit systems with a format. The associations are used for\n * assigning default unit formats for specific phenomenons (see [[PresentationManagerProps.defaultFormats]]).\n *\n * @public\n * @deprecated in 4.3 - will not be removed until after 2026-06-13. The type has been moved to `@itwin/presentation-common` package.\n */\nexport type UnitSystemFormat = CommonUnitSystemFormat;\n\n/**\n * Data structure for multiple element properties request response.\n * @public\n */\nexport interface MultiElementPropertiesResponse<TParsedContent = ElementProperties> {\n total: number;\n iterator: () => AsyncGenerator<TParsedContent[]>;\n}\n\n/**\n * Configuration options for supplying asset paths to [[PresentationManager]].\n * @public\n */\nexport interface PresentationAssetsRootConfig {\n /**\n * Path to `presentation-backend` assets. Relative paths start from `process.cwd()`.\n */\n backend: string;\n}\n\n/**\n * Properties that can be used to configure [[PresentationManager]]\n * @public\n */\nexport interface PresentationManagerProps {\n /**\n * Path overrides for presentation backend assets. Need to be overriden by application if it puts these assets someplace else than the default.\n *\n * By default the path to assets directory is determined during the call of [[Presentation.initialize]] using this algorithm:\n *\n * - if path of `.js` file that contains [[PresentationManager]] definition contains \"presentation-backend\", assume the package is in `node_modules` and the directory structure is:\n * - `assets/*\\*\\/*`\n * - `presentation-backend/{presentation-backend source files}`\n *\n * which means the assets can be found through a relative path `../assets/` from the JS file being executed.\n *\n * - else, assume the backend is webpacked into a single file with assets next to it:\n * - `assets/*\\*\\/*`\n * - `{source file being executed}.js`\n *\n * which means the assets can be found through a relative path `./assets/` from the `{source file being executed}`.\n *\n * @deprecated in 4.2 - will not be removed until after 2026-06-13. This attribute is not used anymore - the package is not using private assets anymore.\n */\n presentationAssetsRoot?: string | PresentationAssetsRootConfig;\n\n /**\n * A list of directories containing application's presentation rulesets. Relative\n * paths start from `process.cwd()`. The directories are traversed recursively.\n *\n * @note Only files with `.PresentationRuleSet.json` are read.\n */\n rulesetDirectories?: string[];\n\n /**\n * A list of directories containing application's supplemental presentation rulesets. Relative\n * paths start from `process.cwd()`. The directories are traversed recursively.\n *\n * @note Only files with `.PresentationRuleSet.json` are read.\n */\n supplementalRulesetDirectories?: string[];\n\n /**\n * Sets the active unit system to use for formatting property values with\n * units. Default presentation units are used if this is not specified. The active unit\n * system can later be changed through [[PresentationManager.activeUnitSystem]] or overriden for each request\n * through request options.\n */\n defaultUnitSystem?: UnitSystemKey;\n\n /**\n * A map of default unit formats to use for formatting properties that don't have a presentation format\n * in requested unit system.\n *\n * @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.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n defaultFormats?: FormatsMap;\n\n /**\n * A custom formats provider to use for formatting property values with units. Defaults to [SchemaFormatsProvider]($ecschema-metadata) if\n * not supplied.\n */\n formatsProvider?: FormatsProvider;\n\n /**\n * A number of worker threads to use for handling presentation requests. Defaults to `2`.\n */\n workerThreadsCount?: number;\n\n /**\n * The interval (in milliseconds) used to poll for presentation data changes. If not set, presentation\n * data changes are not tracked at all.\n *\n * @beta\n * @deprecated in 4.4 - will not be removed until after 2026-06-13. The manager now always tracks for iModel data changes without polling.\n */\n updatesPollInterval?: number;\n\n /** Options for caching. */\n caching?: PresentationManagerCachingConfig;\n\n /**\n * Use [SQLite's Memory-Mapped I/O](https://sqlite.org/mmap.html) for worker connections. This mode improves performance of handling\n * requests with high I/O intensity, e.g. filtering large tables on non-indexed columns. No downsides have been noticed.\n *\n * Set to a falsy value to turn off. `true` for memory-mapping the whole iModel. Number value for memory-mapping the specified amount of bytes.\n */\n useMmap?: boolean | number;\n\n /**\n * Localization function to localize data returned by presentation manager when it's used directly on the backend (as opposed to when used through RPC, where\n * data is localized on the frontend). Defaults to English localization.\n *\n * @see [Localization]($docs/presentation/advanced/Localization)\n */\n getLocalizedString?: (key: string) => string;\n\n /**\n * Callback that provides [SchemaContext]($ecschema-metadata) for supplied [IModelDb]($core-backend).\n * [SchemaContext]($ecschema-metadata) is used for getting metadata required for values formatting.\n *\n * @deprecated in 5.1 - will not be removed until after 2026-08-08. By default [IModelDb.schemaContext]($core-backend) is now used instead.\n */\n schemaContextProvider?: (imodel: IModelDb) => SchemaContext;\n\n /**\n * Parameters for gathering diagnostics at the manager level. When supplied, they're used with every request\n * made through the manager.\n *\n * @see [Diagnostics documentation page]($docs/presentation/advanced/Diagnostics.md)\n */\n diagnostics?: BackendDiagnosticsOptions;\n}\n\n/**\n * Backend Presentation manager which pulls the presentation data from\n * an iModel using native platform.\n *\n * @public\n */\nexport class PresentationManager {\n private _props: PresentationManagerProps;\n private _detail: PresentationManagerDetail;\n private _localizationHelper: LocalizationHelper;\n private _schemaContextProvider: (imodel: IModelDb) => SchemaContext;\n\n /**\n * Creates an instance of PresentationManager.\n * @param props Optional configuration properties.\n */\n constructor(props?: PresentationManagerProps) {\n this._props = props ?? {};\n this._detail = new PresentationManagerDetail(this._props);\n this._localizationHelper = new LocalizationHelper({ getLocalizedString: props?.getLocalizedString ?? getLocalizedStringEN });\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this._schemaContextProvider = props?.schemaContextProvider ?? ((imodel: IModelDb) => imodel.schemaContext);\n }\n\n /** Get / set active unit system used to format property values with units */\n public get activeUnitSystem(): UnitSystemKey | undefined {\n return this._detail.activeUnitSystem;\n }\n /* c8 ignore next 3 */\n public set activeUnitSystem(value: UnitSystemKey | undefined) {\n this._detail.activeUnitSystem = value;\n }\n\n /** Dispose the presentation manager. Must be called to clean up native resources. */\n public [Symbol.dispose]() {\n this._detail[Symbol.dispose]();\n }\n\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */\n /* c8 ignore next 3 */\n public dispose() {\n this[Symbol.dispose]();\n }\n\n /** An event, that this manager raises whenever any request is made on it. */\n public get onUsed(): BeEvent<() => void> {\n return this._detail.onUsed;\n }\n\n /** Properties used to initialize the manager */\n public get props() {\n return this._props;\n }\n\n /** Get rulesets manager */\n public rulesets(): RulesetManager {\n return this._detail.rulesets;\n }\n\n /**\n * Get ruleset variables manager for specific ruleset\n * @param rulesetId Id of the ruleset to get variables manager for\n */\n public vars(rulesetId: string): RulesetVariablesManager {\n return new RulesetVariablesManagerImpl(() => this._detail.getNativePlatform(), rulesetId);\n }\n\n /** @internal */\n /* c8 ignore next 3 */\n public get [_presentation_manager_detail](): PresentationManagerDetail {\n return this._detail;\n }\n\n public getRulesetId(rulesetOrId: Ruleset | string) {\n return this._detail.getRulesetId(rulesetOrId);\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n\n /**\n * Retrieves nodes\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n public async getNodes(\n requestOptions: WithCancelEvent<Prioritized<Paged<HierarchyRequestOptions<IModelDb, NodeKey, RulesetVariable>>>> & BackendDiagnosticsAttribute,\n ): Promise<Node[]> {\n const serializedHierarchyLevel = await this._detail.getNodes(requestOptions);\n const hierarchyLevel: HierarchyLevel = deepReplaceNullsToUndefined(JSON.parse(serializedHierarchyLevel));\n return this._localizationHelper.getLocalizedNodes(hierarchyLevel.nodes);\n }\n\n /**\n * Retrieves nodes count\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n public async getNodesCount(\n requestOptions: WithCancelEvent<Prioritized<HierarchyRequestOptions<IModelDb, NodeKey, RulesetVariable>>> & BackendDiagnosticsAttribute,\n ): Promise<number> {\n return this._detail.getNodesCount(requestOptions);\n }\n\n /**\n * Retrieves hierarchy level descriptor\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n public async getNodesDescriptor(\n requestOptions: WithCancelEvent<Prioritized<HierarchyLevelDescriptorRequestOptions<IModelDb, NodeKey, RulesetVariable>>> & BackendDiagnosticsAttribute,\n ): Promise<Descriptor | undefined> {\n const response = await this._detail.getNodesDescriptor(requestOptions);\n const descriptor = Descriptor.fromJSON(JSON.parse(response));\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\n }\n\n /**\n * Retrieves paths from root nodes to children nodes according to specified instance key paths. Intersecting paths will be merged.\n * TODO: Return results in pages\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n public async getNodePaths(\n requestOptions: WithCancelEvent<Prioritized<FilterByInstancePathsHierarchyRequestOptions<IModelDb, RulesetVariable>>> & BackendDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n const result = await this._detail.getNodePaths(requestOptions);\n return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\n }\n\n /**\n * Retrieves paths from root nodes to nodes containing filter text in their label.\n * TODO: Return results in pages\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n public async getFilteredNodePaths(\n requestOptions: WithCancelEvent<Prioritized<FilterByTextHierarchyRequestOptions<IModelDb, RulesetVariable>>> & BackendDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n const result = await this._detail.getFilteredNodePaths(requestOptions);\n return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\n }\n\n /* eslint-enable @typescript-eslint/no-deprecated */\n\n /**\n * Get information about the sources of content when building it for specific ECClasses. Sources involve classes of the primary select instance,\n * its related instances for loading related and navigation properties.\n * @public\n */\n public async getContentSources(\n requestOptions: WithCancelEvent<Prioritized<ContentSourcesRequestOptions<IModelDb>>> & BackendDiagnosticsAttribute,\n ): Promise<SelectClassInfo[]> {\n return this._detail.getContentSources(requestOptions);\n }\n\n /**\n * Retrieves the content descriptor which can be used to get content\n * @public\n */\n public async getContentDescriptor(\n requestOptions: WithCancelEvent<Prioritized<ContentDescriptorRequestOptions<IModelDb, KeySet, RulesetVariable>>> & BackendDiagnosticsAttribute,\n ): Promise<Descriptor | undefined> {\n const response = await this._detail.getContentDescriptor(requestOptions);\n const descriptor = Descriptor.fromJSON(JSON.parse(response));\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\n }\n\n /**\n * Retrieves the content set size based on the supplied content descriptor override\n * @public\n */\n public async getContentSetSize(\n requestOptions: WithCancelEvent<Prioritized<ContentRequestOptions<IModelDb, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>>> &\n BackendDiagnosticsAttribute,\n ): Promise<number> {\n return this._detail.getContentSetSize(requestOptions);\n }\n\n private createContentFormatter({ imodel, unitSystem }: { imodel: IModelDb; unitSystem?: UnitSystemKey }): ContentFormatter {\n if (!unitSystem) {\n unitSystem = this.props.defaultUnitSystem ?? \"metric\";\n }\n const schemaContext = this._schemaContextProvider(imodel);\n const koqPropertyFormatter = new KoqPropertyValueFormatter({\n schemaContext,\n formatsProvider: this.props.formatsProvider ?? new SchemaFormatsProvider(schemaContext, unitSystem),\n });\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n koqPropertyFormatter.defaultFormats = this.props.defaultFormats;\n return new ContentFormatter(new ContentPropertyValueFormatter(koqPropertyFormatter), unitSystem);\n }\n\n /**\n * Retrieves the content set based on the supplied content descriptor.\n * @public\n */\n public async getContentSet(\n requestOptions: WithCancelEvent<Prioritized<Paged<ContentRequestOptions<IModelDb, Descriptor, KeySet, RulesetVariable>>>> & BackendDiagnosticsAttribute,\n ): Promise<Item[]> {\n let items = await this._detail.getContentSet({ ...requestOptions, omitFormattedValues: true });\n\n if (!requestOptions.omitFormattedValues) {\n const formatter = this.createContentFormatter(requestOptions);\n items = await formatter.formatContentItems(items, requestOptions.descriptor);\n }\n\n return this._localizationHelper.getLocalizedContentItems(items);\n }\n\n /**\n * Retrieves the content based on the supplied content descriptor override.\n * @public\n */\n public async getContent(\n requestOptions: WithCancelEvent<Prioritized<Paged<ContentRequestOptions<IModelDb, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>>>> &\n BackendDiagnosticsAttribute,\n ): Promise<Content | undefined> {\n const content = await this._detail.getContent({ ...requestOptions, omitFormattedValues: true });\n if (!content) {\n return undefined;\n }\n\n if (!requestOptions.omitFormattedValues) {\n const formatter = this.createContentFormatter(requestOptions);\n await formatter.formatContent(content);\n }\n\n return this._localizationHelper.getLocalizedContent(content);\n }\n\n /**\n * Retrieves distinct values of specific field from the content based on the supplied content descriptor override.\n * @param requestOptions Options for the request\n * @return A promise object that returns either distinct values on success or an error string on error.\n * @public\n */\n public async getPagedDistinctValues(\n requestOptions: WithCancelEvent<Prioritized<DistinctValuesRequestOptions<IModelDb, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>>> &\n BackendDiagnosticsAttribute,\n ): Promise<PagedResponse<DisplayValueGroup>> {\n const result = await this._detail.getPagedDistinctValues(requestOptions);\n return {\n ...result,\n items: result.items.map((g) => this._localizationHelper.getLocalizedDisplayValueGroup(g)),\n };\n }\n\n /**\n * Retrieves property data in a simplified format for a single element specified by ID.\n * @public\n */\n public async getElementProperties<TParsedContent = ElementProperties>(\n requestOptions: WithCancelEvent<Prioritized<SingleElementPropertiesRequestOptions<IModelDb, TParsedContent>>> & BackendDiagnosticsAttribute,\n ): Promise<TParsedContent | undefined>;\n /**\n * Retrieves property data in simplified format for multiple elements specified by class or all element.\n * @return An object that contains element count and AsyncGenerator to iterate over properties of those elements in batches of undefined size.\n * @public\n */\n public async getElementProperties<TParsedContent = ElementProperties>(\n requestOptions: WithCancelEvent<Prioritized<MultiElementPropertiesRequestOptions<IModelDb, TParsedContent>>> & BackendDiagnosticsAttribute,\n ): Promise<MultiElementPropertiesResponse<TParsedContent>>;\n public async getElementProperties<TParsedContent = ElementProperties>(\n requestOptions: WithCancelEvent<\n Prioritized<SingleElementPropertiesRequestOptions<IModelDb, TParsedContent> | MultiElementPropertiesRequestOptions<IModelDb, TParsedContent>>\n > &\n BackendDiagnosticsAttribute,\n ): Promise<TParsedContent | undefined | MultiElementPropertiesResponse<TParsedContent>> {\n if (isSingleElementPropertiesRequestOptions(requestOptions)) {\n return this.getSingleElementProperties<TParsedContent>(requestOptions);\n }\n return this.getMultipleElementProperties<TParsedContent>(requestOptions);\n }\n\n private async getSingleElementProperties<TParsedContent>(\n requestOptions: WithCancelEvent<Prioritized<SingleElementPropertiesRequestOptions<IModelDb, TParsedContent>>> & BackendDiagnosticsAttribute,\n ): Promise<TParsedContent | undefined> {\n type TParser = Required<typeof requestOptions>[\"contentParser\"];\n const { elementId, contentParser, ...optionsNoElementId } = requestOptions;\n const parser: TParser = contentParser ?? (buildElementProperties as TParser);\n const content = await this.getContent({\n ...optionsNoElementId,\n descriptor: {\n displayType: DefaultContentDisplayTypes.PropertyPane,\n contentFlags: ContentFlags.ShowLabels,\n },\n rulesetOrId: \"ElementProperties\",\n keys: new KeySet([{ className: \"BisCore:Element\", id: elementId }]),\n });\n if (!content || content.contentSet.length === 0) {\n return undefined;\n }\n return parser(content.descriptor, content.contentSet[0]);\n }\n\n private async getMultipleElementProperties<TParsedContent>(\n requestOptions: WithCancelEvent<Prioritized<MultiElementPropertiesRequestOptions<IModelDb, TParsedContent>>> & BackendDiagnosticsAttribute,\n ): Promise<MultiElementPropertiesResponse<TParsedContent>> {\n type TParser = Required<typeof requestOptions>[\"contentParser\"];\n const { contentParser, batchSize: batchSizeOption, ...contentOptions } = requestOptions;\n\n const parser: TParser = contentParser ?? (buildElementProperties as TParser);\n const workerThreadsCount = this._props.workerThreadsCount ?? 2;\n\n // We don't want to request content for all classes at once - each class results in a huge content descriptor object that's cached in memory\n // and can be shared across all batch requests for that class. Handling multiple classes at the same time not only increases memory footprint,\n // but also may push descriptors out of cache, requiring us to recreate them, thus making performance worse. For those reasons we handle at\n // most `workerThreadsCount / 2` classes in parallel.\n /* c8 ignore next */\n const classParallelism = workerThreadsCount > 1 ? Math.ceil(workerThreadsCount / 2) : 1;\n\n // We want all worker threads to be constantly busy. However, there's some fairly expensive work being done after the worker thread is done,\n // but before we receive the response. That means the worker thread would be starving if we sent only `workerThreadsCount` requests in parallel.\n // To avoid that, we keep twice as much requests active.\n /* c8 ignore next */\n const batchesParallelism = workerThreadsCount > 0 ? workerThreadsCount : 1;\n\n /* c8 ignore next */\n const batchSize = batchSizeOption ?? 100;\n\n const elementsIdentifier = ((): { elementIds: Id64Array } | { elementClasses: string[] } => {\n if (\"elementIds\" in contentOptions && contentOptions.elementIds !== undefined) {\n const elementIds = contentOptions.elementIds;\n delete contentOptions.elementIds;\n return { elementIds };\n }\n if (\"elementClasses\" in contentOptions && contentOptions.elementClasses !== undefined) {\n const elementClasses = contentOptions.elementClasses;\n delete contentOptions.elementClasses;\n return { elementClasses };\n }\n /* c8 ignore next */\n return { elementClasses: [\"BisCore:Element\"] };\n })();\n\n const descriptorGetter = async (partialProps: Pick<ContentDescriptorRequestOptions<IModelDb, KeySet, RulesetVariable>, \"rulesetOrId\" | \"keys\">) =>\n this.getContentDescriptor({ ...contentOptions, displayType: DefaultContentDisplayTypes.Grid, contentFlags: ContentFlags.ShowLabels, ...partialProps });\n const contentSetGetter = async (\n partialProps: Pick<ContentRequestOptions<IModelDb, Descriptor, KeySet, RulesetVariable>, \"rulesetOrId\" | \"keys\" | \"descriptor\">,\n ) => this.getContentSet({ ...contentOptions, ...partialProps });\n const { itemBatches, count } =\n \"elementIds\" in elementsIdentifier\n ? getContentItemsObservableFromElementIds(\n requestOptions.imodel,\n descriptorGetter,\n contentSetGetter,\n elementsIdentifier.elementIds,\n classParallelism,\n batchesParallelism,\n batchSize,\n )\n : getContentItemsObservableFromClassNames(\n requestOptions.imodel,\n descriptorGetter,\n contentSetGetter,\n elementsIdentifier.elementClasses,\n classParallelism,\n batchesParallelism,\n batchSize,\n );\n return {\n total: await firstValueFrom(count),\n async *iterator() {\n for await (const itemsBatch of eachValueFrom(itemBatches)) {\n const { descriptor, items } = itemsBatch;\n yield items.map((item) => parser(descriptor, item));\n }\n },\n };\n }\n\n /**\n * Retrieves display label definition of specific item\n * @public\n */\n public async getDisplayLabelDefinition(\n requestOptions: WithCancelEvent<Prioritized<DisplayLabelRequestOptions<IModelDb, InstanceKey>>> & BackendDiagnosticsAttribute,\n ): Promise<LabelDefinition> {\n const labelDefinition = await this._detail.getDisplayLabelDefinition(requestOptions);\n return this._localizationHelper.getLocalizedLabelDefinition(labelDefinition);\n }\n\n /**\n * Retrieves display label definitions of specific items\n * @public\n */\n public async getDisplayLabelDefinitions(\n requestOptions: WithCancelEvent<Prioritized<Paged<DisplayLabelsRequestOptions<IModelDb, InstanceKey>>>> & BackendDiagnosticsAttribute,\n ): Promise<LabelDefinition[]> {\n const labelDefinitions = await this._detail.getDisplayLabelDefinitions(requestOptions);\n return this._localizationHelper.getLocalizedLabelDefinitions(labelDefinitions);\n }\n\n /**\n * Retrieves available selection scopes.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public async getSelectionScopes(_requestOptions: SelectionScopeRequestOptions<IModelDb> & BackendDiagnosticsAttribute): Promise<SelectionScope[]> {\n return SelectionScopesHelper.getSelectionScopes();\n }\n\n /**\n * Computes selection based on provided element IDs and selection scope.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public async computeSelection(requestOptions: ComputeSelectionRequestOptions<IModelDb> & BackendDiagnosticsAttribute): Promise<KeySet> {\n return SelectionScopesHelper.computeSelection(requestOptions);\n }\n\n /**\n * Compares two hierarchies specified in the request options\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public async compareHierarchies(requestOptions: HierarchyCompareOptions<IModelDb, NodeKey>): Promise<HierarchyCompareInfo> {\n if (!requestOptions.prev.rulesetOrId && !requestOptions.prev.rulesetVariables) {\n return { changes: [] };\n }\n\n const { rulesetOrId, prev, rulesetVariables, ...options } = requestOptions;\n this._detail.registerRuleset(rulesetOrId);\n\n const currRulesetId = getRulesetIdObject(requestOptions.rulesetOrId);\n const prevRulesetId = prev.rulesetOrId ? getRulesetIdObject(prev.rulesetOrId) : currRulesetId;\n if (prevRulesetId.parts.id !== currRulesetId.parts.id) {\n throw new PresentationError(PresentationStatus.InvalidArgument, \"Can't compare rulesets with different IDs\");\n }\n\n const currRulesetVariables = rulesetVariables ?? [];\n const prevRulesetVariables = prev.rulesetVariables ?? currRulesetVariables;\n\n const params = {\n requestId: NativePlatformRequestTypes.CompareHierarchies,\n ...options,\n prevRulesetId: prevRulesetId.uniqueId,\n currRulesetId: currRulesetId.uniqueId,\n prevRulesetVariables: JSON.stringify(prevRulesetVariables),\n currRulesetVariables: JSON.stringify(currRulesetVariables),\n expandedNodeKeys: JSON.stringify(options.expandedNodeKeys ?? []),\n };\n return JSON.parse(await this._detail.request(params));\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManagerDetail.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationManagerDetail.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAA2B,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAU,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAEL,OAAO,EACP,+BAA+B,EAE/B,qBAAqB,EACrB,4BAA4B,EAE5B,UAAU,EACV,mBAAmB,EAGnB,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,4BAA4B,EAC5B,4CAA4C,EAC5C,mCAAmC,EAEnC,sCAAsC,EACtC,uBAAuB,EACvB,WAAW,EACX,IAAI,EAGJ,MAAM,EACN,eAAe,EACf,OAAO,EACP,eAAe,EACf,KAAK,EACL,aAAa,EACb,WAAW,EACX,OAAO,EACP,eAAe,EACf,eAAe,EAEf,UAAU,EACV,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAEL,wBAAwB,EAIxB,4BAA4B,EAG7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAA4C,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAG9G,OAAO,EAAE,cAAc,EAAsB,MAAM,qBAAqB,CAAC;AAKzE,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAA+D,MAAM,YAAY,CAAC;AAEjJ;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD,UAAU,8BAA+B,SAAQ,wBAAwB;IACvE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,wBAAwB,CAAC;CAClC;AAED,gBAAgB;AAChB,qBAAa,yBAA0B,YAAW,UAAU;IAC1D,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,eAAe,CAAuC;IAC9D,OAAO,CAAC,mBAAmB,CAAwC;IAE5D,QAAQ,EAAE,cAAc,CAAC;IACzB,gBAAgB,EAAE,aAAa,GAAG,SAAS,CAAC;IACnD,SAAgB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;gBAEhC,MAAM,EAAE,8BAA8B;IAuB3C,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;IAYxB,iBAAiB,IAAI,wBAAwB;
|
|
1
|
+
{"version":3,"file":"PresentationManagerDetail.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationManagerDetail.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAA2B,MAAM,qBAAqB,CAAC;AACxE,OA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