@itwin/presentation-backend 5.3.0-dev.2 → 5.3.0-dev.23
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 +23 -1
- package/lib/cjs/presentation-backend/PresentationManager.d.ts +13 -13
- package/lib/cjs/presentation-backend/PresentationManager.js +7 -7
- package/lib/cjs/presentation-backend/PresentationManager.js.map +1 -1
- package/lib/esm/presentation-backend/PresentationManager.d.ts +13 -13
- package/lib/esm/presentation-backend/PresentationManager.js +7 -7
- package/lib/esm/presentation-backend/PresentationManager.js.map +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
# Change Log - @itwin/presentation-backend
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 16 Oct 2025 23:02:22 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.2.3
|
|
6
|
+
Thu, 16 Oct 2025 23:00:32 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 5.2.2
|
|
11
|
+
Fri, 10 Oct 2025 14:49:15 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 5.2.1
|
|
16
|
+
Thu, 09 Oct 2025 17:10:26 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 5.2.0
|
|
21
|
+
Wed, 01 Oct 2025 20:22:54 GMT
|
|
22
|
+
|
|
23
|
+
### Updates
|
|
24
|
+
|
|
25
|
+
- Deprecated hierarchies-related APIs
|
|
4
26
|
|
|
5
27
|
## 5.1.9
|
|
6
28
|
Wed, 24 Sep 2025 17:38:08 GMT
|
|
@@ -14,7 +14,7 @@ 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)
|
|
17
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
18
18
|
* package for creating hierarchies.
|
|
19
19
|
*/
|
|
20
20
|
export declare enum HierarchyCacheMode {
|
|
@@ -38,14 +38,14 @@ export declare enum HierarchyCacheMode {
|
|
|
38
38
|
/**
|
|
39
39
|
* Configuration for hierarchy cache.
|
|
40
40
|
* @public
|
|
41
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
41
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
42
42
|
* package for creating hierarchies.
|
|
43
43
|
*/
|
|
44
44
|
export type HierarchyCacheConfig = MemoryHierarchyCacheConfig | DiskHierarchyCacheConfig | HybridCacheConfig;
|
|
45
45
|
/**
|
|
46
46
|
* Base interface for all [[HierarchyCacheConfig]] implementations.
|
|
47
47
|
* @public
|
|
48
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
48
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
49
49
|
* package for creating hierarchies.
|
|
50
50
|
*/
|
|
51
51
|
export interface HierarchyCacheConfigBase {
|
|
@@ -56,7 +56,7 @@ export interface HierarchyCacheConfigBase {
|
|
|
56
56
|
*
|
|
57
57
|
* @see [Memory cache documentation page]($docs/presentation/advanced/Caching.md#memory-cache)
|
|
58
58
|
* @public
|
|
59
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
59
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
60
60
|
* package for creating hierarchies.
|
|
61
61
|
*/
|
|
62
62
|
export interface MemoryHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
@@ -67,7 +67,7 @@ export interface MemoryHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
|
67
67
|
*
|
|
68
68
|
* @see [Disk cache documentation page]($docs/presentation/advanced/Caching.md#disk-cache)
|
|
69
69
|
* @public
|
|
70
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
70
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
71
71
|
* package for creating hierarchies.
|
|
72
72
|
*/
|
|
73
73
|
export interface DiskHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
@@ -92,7 +92,7 @@ export interface DiskHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
|
92
92
|
*
|
|
93
93
|
* @see [Hybrid cache documentation page]($docs/presentation/advanced/Caching.md#hybrid-cache)
|
|
94
94
|
* @public
|
|
95
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
95
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
96
96
|
* package for creating hierarchies.
|
|
97
97
|
*/
|
|
98
98
|
export interface HybridCacheConfig extends HierarchyCacheConfigBase {
|
|
@@ -123,7 +123,7 @@ export interface PresentationManagerCachingConfig {
|
|
|
123
123
|
* Hierarchies-related caching options.
|
|
124
124
|
*
|
|
125
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)
|
|
126
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
127
127
|
* package for creating hierarchies.
|
|
128
128
|
*/
|
|
129
129
|
hierarchies?: HierarchyCacheConfig;
|
|
@@ -310,21 +310,21 @@ export declare class PresentationManager {
|
|
|
310
310
|
/**
|
|
311
311
|
* Retrieves nodes
|
|
312
312
|
* @public
|
|
313
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
313
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
314
314
|
* package for creating hierarchies.
|
|
315
315
|
*/
|
|
316
316
|
getNodes(requestOptions: WithCancelEvent<Prioritized<Paged<HierarchyRequestOptions<IModelDb, NodeKey, RulesetVariable>>>> & BackendDiagnosticsAttribute): Promise<Node[]>;
|
|
317
317
|
/**
|
|
318
318
|
* Retrieves nodes count
|
|
319
319
|
* @public
|
|
320
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
320
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
321
321
|
* package for creating hierarchies.
|
|
322
322
|
*/
|
|
323
323
|
getNodesCount(requestOptions: WithCancelEvent<Prioritized<HierarchyRequestOptions<IModelDb, NodeKey, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<number>;
|
|
324
324
|
/**
|
|
325
325
|
* Retrieves hierarchy level descriptor
|
|
326
326
|
* @public
|
|
327
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
327
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
328
328
|
* package for creating hierarchies.
|
|
329
329
|
*/
|
|
330
330
|
getNodesDescriptor(requestOptions: WithCancelEvent<Prioritized<HierarchyLevelDescriptorRequestOptions<IModelDb, NodeKey, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<Descriptor | undefined>;
|
|
@@ -332,7 +332,7 @@ export declare class PresentationManager {
|
|
|
332
332
|
* Retrieves paths from root nodes to children nodes according to specified instance key paths. Intersecting paths will be merged.
|
|
333
333
|
* TODO: Return results in pages
|
|
334
334
|
* @public
|
|
335
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
335
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
336
336
|
* package for creating hierarchies.
|
|
337
337
|
*/
|
|
338
338
|
getNodePaths(requestOptions: WithCancelEvent<Prioritized<FilterByInstancePathsHierarchyRequestOptions<IModelDb, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<NodePathElement[]>;
|
|
@@ -340,7 +340,7 @@ export declare class PresentationManager {
|
|
|
340
340
|
* Retrieves paths from root nodes to nodes containing filter text in their label.
|
|
341
341
|
* TODO: Return results in pages
|
|
342
342
|
* @public
|
|
343
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
343
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
344
344
|
* package for creating hierarchies.
|
|
345
345
|
*/
|
|
346
346
|
getFilteredNodePaths(requestOptions: WithCancelEvent<Prioritized<FilterByTextHierarchyRequestOptions<IModelDb, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<NodePathElement[]>;
|
|
@@ -416,7 +416,7 @@ export declare class PresentationManager {
|
|
|
416
416
|
/**
|
|
417
417
|
* Compares two hierarchies specified in the request options
|
|
418
418
|
* @public
|
|
419
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
419
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
420
420
|
* package for creating hierarchies.
|
|
421
421
|
*/
|
|
422
422
|
compareHierarchies(requestOptions: HierarchyCompareOptions<IModelDb, NodeKey>): Promise<HierarchyCompareInfo>;
|
|
@@ -24,7 +24,7 @@ const Utils_js_1 = require("./Utils.js");
|
|
|
24
24
|
/**
|
|
25
25
|
* Presentation hierarchy cache mode.
|
|
26
26
|
* @public
|
|
27
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
27
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
28
28
|
* package for creating hierarchies.
|
|
29
29
|
*/
|
|
30
30
|
var HierarchyCacheMode;
|
|
@@ -116,7 +116,7 @@ class PresentationManager {
|
|
|
116
116
|
/**
|
|
117
117
|
* Retrieves nodes
|
|
118
118
|
* @public
|
|
119
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
119
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
120
120
|
* package for creating hierarchies.
|
|
121
121
|
*/
|
|
122
122
|
async getNodes(requestOptions) {
|
|
@@ -127,7 +127,7 @@ class PresentationManager {
|
|
|
127
127
|
/**
|
|
128
128
|
* Retrieves nodes count
|
|
129
129
|
* @public
|
|
130
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
130
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
131
131
|
* package for creating hierarchies.
|
|
132
132
|
*/
|
|
133
133
|
async getNodesCount(requestOptions) {
|
|
@@ -136,7 +136,7 @@ class PresentationManager {
|
|
|
136
136
|
/**
|
|
137
137
|
* Retrieves hierarchy level descriptor
|
|
138
138
|
* @public
|
|
139
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
139
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
140
140
|
* package for creating hierarchies.
|
|
141
141
|
*/
|
|
142
142
|
async getNodesDescriptor(requestOptions) {
|
|
@@ -148,7 +148,7 @@ class PresentationManager {
|
|
|
148
148
|
* Retrieves paths from root nodes to children nodes according to specified instance key paths. Intersecting paths will be merged.
|
|
149
149
|
* TODO: Return results in pages
|
|
150
150
|
* @public
|
|
151
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
151
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
152
152
|
* package for creating hierarchies.
|
|
153
153
|
*/
|
|
154
154
|
async getNodePaths(requestOptions) {
|
|
@@ -159,7 +159,7 @@ class PresentationManager {
|
|
|
159
159
|
* Retrieves paths from root nodes to nodes containing filter text in their label.
|
|
160
160
|
* TODO: Return results in pages
|
|
161
161
|
* @public
|
|
162
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
162
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
163
163
|
* package for creating hierarchies.
|
|
164
164
|
*/
|
|
165
165
|
async getFilteredNodePaths(requestOptions) {
|
|
@@ -350,7 +350,7 @@ class PresentationManager {
|
|
|
350
350
|
/**
|
|
351
351
|
* Compares two hierarchies specified in the request options
|
|
352
352
|
* @public
|
|
353
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
353
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
354
354
|
* package for creating hierarchies.
|
|
355
355
|
*/
|
|
356
356
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -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,2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0B,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
|
+
{"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,qDAAqD;AACrD;;;;;GAKG;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;A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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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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"]}
|
|
@@ -14,7 +14,7 @@ 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)
|
|
17
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
18
18
|
* package for creating hierarchies.
|
|
19
19
|
*/
|
|
20
20
|
export declare enum HierarchyCacheMode {
|
|
@@ -38,14 +38,14 @@ export declare enum HierarchyCacheMode {
|
|
|
38
38
|
/**
|
|
39
39
|
* Configuration for hierarchy cache.
|
|
40
40
|
* @public
|
|
41
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
41
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
42
42
|
* package for creating hierarchies.
|
|
43
43
|
*/
|
|
44
44
|
export type HierarchyCacheConfig = MemoryHierarchyCacheConfig | DiskHierarchyCacheConfig | HybridCacheConfig;
|
|
45
45
|
/**
|
|
46
46
|
* Base interface for all [[HierarchyCacheConfig]] implementations.
|
|
47
47
|
* @public
|
|
48
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
48
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
49
49
|
* package for creating hierarchies.
|
|
50
50
|
*/
|
|
51
51
|
export interface HierarchyCacheConfigBase {
|
|
@@ -56,7 +56,7 @@ export interface HierarchyCacheConfigBase {
|
|
|
56
56
|
*
|
|
57
57
|
* @see [Memory cache documentation page]($docs/presentation/advanced/Caching.md#memory-cache)
|
|
58
58
|
* @public
|
|
59
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
59
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
60
60
|
* package for creating hierarchies.
|
|
61
61
|
*/
|
|
62
62
|
export interface MemoryHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
@@ -67,7 +67,7 @@ export interface MemoryHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
|
67
67
|
*
|
|
68
68
|
* @see [Disk cache documentation page]($docs/presentation/advanced/Caching.md#disk-cache)
|
|
69
69
|
* @public
|
|
70
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
70
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
71
71
|
* package for creating hierarchies.
|
|
72
72
|
*/
|
|
73
73
|
export interface DiskHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
@@ -92,7 +92,7 @@ export interface DiskHierarchyCacheConfig extends HierarchyCacheConfigBase {
|
|
|
92
92
|
*
|
|
93
93
|
* @see [Hybrid cache documentation page]($docs/presentation/advanced/Caching.md#hybrid-cache)
|
|
94
94
|
* @public
|
|
95
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
95
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
96
96
|
* package for creating hierarchies.
|
|
97
97
|
*/
|
|
98
98
|
export interface HybridCacheConfig extends HierarchyCacheConfigBase {
|
|
@@ -123,7 +123,7 @@ export interface PresentationManagerCachingConfig {
|
|
|
123
123
|
* Hierarchies-related caching options.
|
|
124
124
|
*
|
|
125
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)
|
|
126
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
127
127
|
* package for creating hierarchies.
|
|
128
128
|
*/
|
|
129
129
|
hierarchies?: HierarchyCacheConfig;
|
|
@@ -310,21 +310,21 @@ export declare class PresentationManager {
|
|
|
310
310
|
/**
|
|
311
311
|
* Retrieves nodes
|
|
312
312
|
* @public
|
|
313
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
313
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
314
314
|
* package for creating hierarchies.
|
|
315
315
|
*/
|
|
316
316
|
getNodes(requestOptions: WithCancelEvent<Prioritized<Paged<HierarchyRequestOptions<IModelDb, NodeKey, RulesetVariable>>>> & BackendDiagnosticsAttribute): Promise<Node[]>;
|
|
317
317
|
/**
|
|
318
318
|
* Retrieves nodes count
|
|
319
319
|
* @public
|
|
320
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
320
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
321
321
|
* package for creating hierarchies.
|
|
322
322
|
*/
|
|
323
323
|
getNodesCount(requestOptions: WithCancelEvent<Prioritized<HierarchyRequestOptions<IModelDb, NodeKey, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<number>;
|
|
324
324
|
/**
|
|
325
325
|
* Retrieves hierarchy level descriptor
|
|
326
326
|
* @public
|
|
327
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
327
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
328
328
|
* package for creating hierarchies.
|
|
329
329
|
*/
|
|
330
330
|
getNodesDescriptor(requestOptions: WithCancelEvent<Prioritized<HierarchyLevelDescriptorRequestOptions<IModelDb, NodeKey, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<Descriptor | undefined>;
|
|
@@ -332,7 +332,7 @@ export declare class PresentationManager {
|
|
|
332
332
|
* Retrieves paths from root nodes to children nodes according to specified instance key paths. Intersecting paths will be merged.
|
|
333
333
|
* TODO: Return results in pages
|
|
334
334
|
* @public
|
|
335
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
335
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
336
336
|
* package for creating hierarchies.
|
|
337
337
|
*/
|
|
338
338
|
getNodePaths(requestOptions: WithCancelEvent<Prioritized<FilterByInstancePathsHierarchyRequestOptions<IModelDb, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<NodePathElement[]>;
|
|
@@ -340,7 +340,7 @@ export declare class PresentationManager {
|
|
|
340
340
|
* Retrieves paths from root nodes to nodes containing filter text in their label.
|
|
341
341
|
* TODO: Return results in pages
|
|
342
342
|
* @public
|
|
343
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
343
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
344
344
|
* package for creating hierarchies.
|
|
345
345
|
*/
|
|
346
346
|
getFilteredNodePaths(requestOptions: WithCancelEvent<Prioritized<FilterByTextHierarchyRequestOptions<IModelDb, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<NodePathElement[]>;
|
|
@@ -416,7 +416,7 @@ export declare class PresentationManager {
|
|
|
416
416
|
/**
|
|
417
417
|
* Compares two hierarchies specified in the request options
|
|
418
418
|
* @public
|
|
419
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
419
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
420
420
|
* package for creating hierarchies.
|
|
421
421
|
*/
|
|
422
422
|
compareHierarchies(requestOptions: HierarchyCompareOptions<IModelDb, NodeKey>): Promise<HierarchyCompareInfo>;
|
|
@@ -21,7 +21,7 @@ import { getLocalizedStringEN } from "./Utils.js";
|
|
|
21
21
|
/**
|
|
22
22
|
* Presentation hierarchy cache mode.
|
|
23
23
|
* @public
|
|
24
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
24
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
25
25
|
* package for creating hierarchies.
|
|
26
26
|
*/
|
|
27
27
|
export var HierarchyCacheMode;
|
|
@@ -113,7 +113,7 @@ export class PresentationManager {
|
|
|
113
113
|
/**
|
|
114
114
|
* Retrieves nodes
|
|
115
115
|
* @public
|
|
116
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
116
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
117
117
|
* package for creating hierarchies.
|
|
118
118
|
*/
|
|
119
119
|
async getNodes(requestOptions) {
|
|
@@ -124,7 +124,7 @@ export class PresentationManager {
|
|
|
124
124
|
/**
|
|
125
125
|
* Retrieves nodes count
|
|
126
126
|
* @public
|
|
127
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
127
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
128
128
|
* package for creating hierarchies.
|
|
129
129
|
*/
|
|
130
130
|
async getNodesCount(requestOptions) {
|
|
@@ -133,7 +133,7 @@ export class PresentationManager {
|
|
|
133
133
|
/**
|
|
134
134
|
* Retrieves hierarchy level descriptor
|
|
135
135
|
* @public
|
|
136
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
136
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
137
137
|
* package for creating hierarchies.
|
|
138
138
|
*/
|
|
139
139
|
async getNodesDescriptor(requestOptions) {
|
|
@@ -145,7 +145,7 @@ export class PresentationManager {
|
|
|
145
145
|
* Retrieves paths from root nodes to children nodes according to specified instance key paths. Intersecting paths will be merged.
|
|
146
146
|
* TODO: Return results in pages
|
|
147
147
|
* @public
|
|
148
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
148
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
149
149
|
* package for creating hierarchies.
|
|
150
150
|
*/
|
|
151
151
|
async getNodePaths(requestOptions) {
|
|
@@ -156,7 +156,7 @@ export class PresentationManager {
|
|
|
156
156
|
* Retrieves paths from root nodes to nodes containing filter text in their label.
|
|
157
157
|
* TODO: Return results in pages
|
|
158
158
|
* @public
|
|
159
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
159
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
160
160
|
* package for creating hierarchies.
|
|
161
161
|
*/
|
|
162
162
|
async getFilteredNodePaths(requestOptions) {
|
|
@@ -347,7 +347,7 @@ export class PresentationManager {
|
|
|
347
347
|
/**
|
|
348
348
|
* Compares two hierarchies specified in the request options
|
|
349
349
|
* @public
|
|
350
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
350
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
351
351
|
* package for creating hierarchies.
|
|
352
352
|
*/
|
|
353
353
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManager.js","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI/C,OAAO,EAAiB,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAKL,YAAY,EAGZ,0BAA0B,EAC1B,UAAU,EAiBV,MAAM,EACN,yBAAyB,EAQzB,iBAAiB,EACjB,kBAAkB,GASnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,6BAA6B,EAC7B,2BAA2B,EAC3B,uCAAuC,EACvC,kBAAkB,GACnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,uCAAuC,EAAE,uCAAuC,EAAE,MAAM,8BAA8B,CAAC;AAChI,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,0B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BAAoB,GAAG,gBAAgB,IAAI,EAAE,CAAC;QACpD,MAAM,oBAAoB,GAAG,IAAI,CAAC,gBAAgB,IAAI,oBAAoB,CAAC;QAE3E,MAAM,MAAM,GAAG;YACb,SAAS,EAAE,0BAA0B,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","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
|
+
{"version":3,"file":"PresentationManager.js","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI/C,OAAO,EAAiB,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAKL,YAAY,EAGZ,0BAA0B,EAC1B,UAAU,EAiBV,MAAM,EACN,yBAAyB,EAQzB,iBAAiB,EACjB,kBAAkB,GASnB,M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AAW,CAAC,CAAC,CAAC,kBAAkB,CAAC,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,iBAAiB,CAAC,kBAAkB,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,0BAA0B,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","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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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 - will not be removed until after 2026-10-01. 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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/presentation-backend",
|
|
3
|
-
"version": "5.3.0-dev.
|
|
3
|
+
"version": "5.3.0-dev.23",
|
|
4
4
|
"description": "Backend of iTwin.js Presentation library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"./package.json": "./package.json"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@itwin/core-
|
|
40
|
-
"@itwin/core-
|
|
41
|
-
"@itwin/core-
|
|
42
|
-
"@itwin/
|
|
43
|
-
"@itwin/ecschema-metadata": "5.3.0-dev.
|
|
44
|
-
"@itwin/
|
|
39
|
+
"@itwin/core-bentley": "5.3.0-dev.23",
|
|
40
|
+
"@itwin/core-backend": "5.3.0-dev.23",
|
|
41
|
+
"@itwin/core-common": "5.3.0-dev.23",
|
|
42
|
+
"@itwin/presentation-common": "5.3.0-dev.23",
|
|
43
|
+
"@itwin/ecschema-metadata": "5.3.0-dev.23",
|
|
44
|
+
"@itwin/core-quantity": "5.3.0-dev.23"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@itwin/eslint-plugin": "5.2.2-dev.2",
|
|
@@ -76,14 +76,14 @@
|
|
|
76
76
|
"sinon-chai": "^3.7.0",
|
|
77
77
|
"typemoq": "^2.1.0",
|
|
78
78
|
"typescript": "~5.6.2",
|
|
79
|
-
"@itwin/build-tools": "5.3.0-dev.
|
|
80
|
-
"@itwin/core-backend": "5.3.0-dev.
|
|
81
|
-
"@itwin/core-common": "5.3.0-dev.
|
|
82
|
-
"@itwin/core-
|
|
83
|
-
"@itwin/
|
|
84
|
-
"
|
|
85
|
-
"@itwin/
|
|
86
|
-
"
|
|
79
|
+
"@itwin/build-tools": "5.3.0-dev.23",
|
|
80
|
+
"@itwin/core-backend": "5.3.0-dev.23",
|
|
81
|
+
"@itwin/core-common": "5.3.0-dev.23",
|
|
82
|
+
"@itwin/core-quantity": "5.3.0-dev.23",
|
|
83
|
+
"@itwin/core-bentley": "5.3.0-dev.23",
|
|
84
|
+
"@itwin/ecschema-metadata": "5.3.0-dev.23",
|
|
85
|
+
"@itwin/presentation-common": "5.3.0-dev.23",
|
|
86
|
+
"internal-tools": "3.0.0-dev.69"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@itwin/presentation-shared": "^1.2.1",
|