@itwin/presentation-backend 5.1.0-dev.40 → 5.1.0-dev.41
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 +27 -1
- package/lib/cjs/presentation-backend/BackendLoggerCategory.d.ts +9 -9
- package/lib/cjs/presentation-backend/BackendLoggerCategory.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/BackendLoggerCategory.js +9 -9
- package/lib/cjs/presentation-backend/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/presentation-backend/Presentation.d.ts +3 -3
- package/lib/cjs/presentation-backend/Presentation.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManager.d.ts +14 -7
- package/lib/cjs/presentation-backend/PresentationManager.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManager.js +15 -5
- package/lib/cjs/presentation-backend/PresentationManager.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManagerDetail.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManagerDetail.js +12 -7
- package/lib/cjs/presentation-backend/PresentationManagerDetail.js.map +1 -1
- package/lib/esm/presentation-backend/BackendLoggerCategory.d.ts +9 -9
- package/lib/esm/presentation-backend/BackendLoggerCategory.d.ts.map +1 -1
- package/lib/esm/presentation-backend/BackendLoggerCategory.js +9 -9
- package/lib/esm/presentation-backend/BackendLoggerCategory.js.map +1 -1
- package/lib/esm/presentation-backend/Presentation.d.ts +3 -3
- package/lib/esm/presentation-backend/Presentation.js.map +1 -1
- package/lib/esm/presentation-backend/PresentationManager.d.ts +14 -7
- package/lib/esm/presentation-backend/PresentationManager.d.ts.map +1 -1
- package/lib/esm/presentation-backend/PresentationManager.js +15 -5
- package/lib/esm/presentation-backend/PresentationManager.js.map +1 -1
- package/lib/esm/presentation-backend/PresentationManagerDetail.d.ts.map +1 -1
- package/lib/esm/presentation-backend/PresentationManagerDetail.js +7 -2
- package/lib/esm/presentation-backend/PresentationManagerDetail.js.map +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
# Change Log - @itwin/presentation-backend
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 16 Jun 2025 15:03:02 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.0.0
|
|
6
|
+
Fri, 13 Jun 2025 20:25:38 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- Add Symbols to prevent duplicate instances of package
|
|
11
|
+
- Depreciate ECSqlStatement API
|
|
12
|
+
- Dropped support for Node 18
|
|
13
|
+
- Fix `getDisplayLabelDefinitions` implementation not taking into account different formats and casings of full class name.
|
|
14
|
+
- Added ESM support
|
|
15
|
+
- Add `type: "module"` to `package.json` to tell Node.js to load this package as ESM by default.
|
|
16
|
+
- Deprecate unified selection related APIs.
|
|
17
|
+
- Log ruleset ID rather than the whole ruleset in INFO level logs
|
|
18
|
+
- Fix Presentation RPC returning details contained within thrown errors. Instead of doing that, we now re-throw the error and let RPC system handle it (by re-throwing a generic error instead).
|
|
19
|
+
- Add `PresentationManager.getElementProperties` overload for specifying elements by id rather than class name.
|
|
20
|
+
- Remove `@internal` APIs from public barrel exports file.
|
|
21
|
+
- Clean up APIs deprecated in 3.x
|
|
22
|
+
- Clean up APIs deprecated in 3.x
|
|
23
|
+
- Return errors in a way native to our RPC system. For web cases that also means proper HTTP response status codes.
|
|
24
|
+
- Change core peer dependencies to strict version.
|
|
25
|
+
|
|
26
|
+
## 4.11.6
|
|
27
|
+
Mon, 16 Jun 2025 15:00:15 GMT
|
|
28
|
+
|
|
29
|
+
_Version update only_
|
|
4
30
|
|
|
5
31
|
## 4.11.5
|
|
6
32
|
Fri, 06 Jun 2025 13:41:18 GMT
|
|
@@ -40,23 +40,23 @@ export declare enum PresentationBackendNativeLoggerCategory {
|
|
|
40
40
|
ECPresentation_RulesetVariables = "ECPresentation.RulesetVariables",
|
|
41
41
|
ECPresentation_ECExpressions = "ECPresentation.ECExpressions",
|
|
42
42
|
ECPresentation_Serialization = "ECPresentation.Serialization",
|
|
43
|
-
/** @deprecated in 4.0 -
|
|
43
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. The logging namespace is not used anymore. */
|
|
44
44
|
ECPresentation_Localization = "ECPresentation.Localization",
|
|
45
|
-
/** @deprecated in 4.0 -
|
|
45
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation]] */
|
|
46
46
|
ECPresentation_RulesEngine = "ECPresentation.RulesEngine",
|
|
47
|
-
/** @deprecated in 4.0 -
|
|
47
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Content]] */
|
|
48
48
|
ECPresentation_RulesEngine_Content = "ECPresentation.Content",
|
|
49
|
-
/** @deprecated in 4.0 -
|
|
49
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. The logging namespace is not used anymore. */
|
|
50
50
|
ECPresentation_RulesEngine_Localization = "ECPresentation.Localization",
|
|
51
|
-
/** @deprecated in 4.0 -
|
|
51
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Hierarchies]] */
|
|
52
52
|
ECPresentation_RulesEngine_Navigation = "ECPresentation.Navigation",
|
|
53
|
-
/** @deprecated in 4.0 -
|
|
53
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Hierarchies_Cache]] */
|
|
54
54
|
ECPresentation_RulesEngine_Navigation_Cache = "ECPresentation.Navigation.Cache",
|
|
55
|
-
/** @deprecated in 4.0 -
|
|
55
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Tasks]] */
|
|
56
56
|
ECPresentation_RulesEngine_Threads = "ECPresentation.Tasks",
|
|
57
|
-
/** @deprecated in 4.0 -
|
|
57
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Update]] */
|
|
58
58
|
ECPresentation_RulesEngine_Update = "ECPresentation.Update",
|
|
59
|
-
/** @deprecated in 4.0 -
|
|
59
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_RulesetVariables]] */
|
|
60
60
|
ECPresentation_RulesEngine_RulesetVariables = "ECPresentation.RulesetVariables"
|
|
61
61
|
}
|
|
62
62
|
//# sourceMappingURL=BackendLoggerCategory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackendLoggerCategory.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/BackendLoggerCategory.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;GAKG;AACH,oBAAY,iCAAiC;IAC3C,OAAO,yBAAyB;IAEhC,+FAA+F;IAC/F,mBAAmB,6CAA6C;IAEhE,mEAAmE;IACnE,GAAG,6BAA6B;IAEhC,mEAAmE;IACnE,GAAG,6BAA6B;CACjC;AAED;;;;;GAKG;AACH,oBAAY,uCAAuC;IACjD,SAAS,cAAc;IACvB,uBAAuB,4BAA4B;IACnD,6BAA6B,kCAAkC;IAC/D,gCAAgC,qCAAqC;IAErE,cAAc,mBAAmB;IACjC,0BAA0B,+BAA+B;IACzD,oBAAoB,yBAAyB;IAC7C,0BAA0B,8BAA8B;IACxD,gCAAgC,oCAAoC;IACpE,sBAAsB,2BAA2B;IACjD,qBAAqB,0BAA0B;IAC/C,iCAAiC,sCAAsC;IACvE,6BAA6B,kCAAkC;IAC/D,oBAAoB,yBAAyB;IAC7C,+BAA+B,oCAAoC;IACnE,4BAA4B,iCAAiC;IAC7D,4BAA4B,iCAAiC;IAG7D,
|
|
1
|
+
{"version":3,"file":"BackendLoggerCategory.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/BackendLoggerCategory.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;GAKG;AACH,oBAAY,iCAAiC;IAC3C,OAAO,yBAAyB;IAEhC,+FAA+F;IAC/F,mBAAmB,6CAA6C;IAEhE,mEAAmE;IACnE,GAAG,6BAA6B;IAEhC,mEAAmE;IACnE,GAAG,6BAA6B;CACjC;AAED;;;;;GAKG;AACH,oBAAY,uCAAuC;IACjD,SAAS,cAAc;IACvB,uBAAuB,4BAA4B;IACnD,6BAA6B,kCAAkC;IAC/D,gCAAgC,qCAAqC;IAErE,cAAc,mBAAmB;IACjC,0BAA0B,+BAA+B;IACzD,oBAAoB,yBAAyB;IAC7C,0BAA0B,8BAA8B;IACxD,gCAAgC,oCAAoC;IACpE,sBAAsB,2BAA2B;IACjD,qBAAqB,0BAA0B;IAC/C,iCAAiC,sCAAsC;IACvE,6BAA6B,kCAAkC;IAC/D,oBAAoB,yBAAyB;IAC7C,+BAA+B,oCAAoC;IACnE,4BAA4B,iCAAiC;IAC7D,4BAA4B,iCAAiC;IAG7D,kHAAkH;IAClH,2BAA2B,gCAAgC;IAC3D,8FAA8F;IAC9F,0BAA0B,+BAA+B;IACzD,sGAAsG;IACtG,kCAAkC,2BAA2B;IAC7D,kHAAkH;IAClH,uCAAuC,gCAAgC;IACvE,0GAA0G;IAC1G,qCAAqC,8BAA8B;IACnE,gHAAgH;IAChH,2CAA2C,oCAAoC;IAC/E,oGAAoG;IACpG,kCAAkC,yBAAyB;IAC3D,qGAAqG;IACrG,iCAAiC,0BAA0B;IAC3D,+GAA+G;IAC/G,2CAA2C,oCAAoC;CAChF"}
|
|
@@ -50,23 +50,23 @@ var PresentationBackendNativeLoggerCategory;
|
|
|
50
50
|
PresentationBackendNativeLoggerCategory["ECPresentation_ECExpressions"] = "ECPresentation.ECExpressions";
|
|
51
51
|
PresentationBackendNativeLoggerCategory["ECPresentation_Serialization"] = "ECPresentation.Serialization";
|
|
52
52
|
/* eslint-disable @typescript-eslint/no-duplicate-enum-values */
|
|
53
|
-
/** @deprecated in 4.0 -
|
|
53
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. The logging namespace is not used anymore. */
|
|
54
54
|
PresentationBackendNativeLoggerCategory["ECPresentation_Localization"] = "ECPresentation.Localization";
|
|
55
|
-
/** @deprecated in 4.0 -
|
|
55
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation]] */
|
|
56
56
|
PresentationBackendNativeLoggerCategory["ECPresentation_RulesEngine"] = "ECPresentation.RulesEngine";
|
|
57
|
-
/** @deprecated in 4.0 -
|
|
57
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Content]] */
|
|
58
58
|
PresentationBackendNativeLoggerCategory["ECPresentation_RulesEngine_Content"] = "ECPresentation.Content";
|
|
59
|
-
/** @deprecated in 4.0 -
|
|
59
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. The logging namespace is not used anymore. */
|
|
60
60
|
PresentationBackendNativeLoggerCategory["ECPresentation_RulesEngine_Localization"] = "ECPresentation.Localization";
|
|
61
|
-
/** @deprecated in 4.0 -
|
|
61
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Hierarchies]] */
|
|
62
62
|
PresentationBackendNativeLoggerCategory["ECPresentation_RulesEngine_Navigation"] = "ECPresentation.Navigation";
|
|
63
|
-
/** @deprecated in 4.0 -
|
|
63
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Hierarchies_Cache]] */
|
|
64
64
|
PresentationBackendNativeLoggerCategory["ECPresentation_RulesEngine_Navigation_Cache"] = "ECPresentation.Navigation.Cache";
|
|
65
|
-
/** @deprecated in 4.0 -
|
|
65
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Tasks]] */
|
|
66
66
|
PresentationBackendNativeLoggerCategory["ECPresentation_RulesEngine_Threads"] = "ECPresentation.Tasks";
|
|
67
|
-
/** @deprecated in 4.0 -
|
|
67
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Update]] */
|
|
68
68
|
PresentationBackendNativeLoggerCategory["ECPresentation_RulesEngine_Update"] = "ECPresentation.Update";
|
|
69
|
-
/** @deprecated in 4.0 -
|
|
69
|
+
/** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_RulesetVariables]] */
|
|
70
70
|
PresentationBackendNativeLoggerCategory["ECPresentation_RulesEngine_RulesetVariables"] = "ECPresentation.RulesetVariables";
|
|
71
71
|
})(PresentationBackendNativeLoggerCategory || (exports.PresentationBackendNativeLoggerCategory = PresentationBackendNativeLoggerCategory = {}));
|
|
72
72
|
//# sourceMappingURL=BackendLoggerCategory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackendLoggerCategory.js","sourceRoot":"","sources":["../../../src/presentation-backend/BackendLoggerCategory.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;;;;GAKG;AACH,IAAY,iCAWX;AAXD,WAAY,iCAAiC;IAC3C,qEAAgC,CAAA;IAEhC,+FAA+F;IAC/F,qGAAgE,CAAA;IAEhE,mEAAmE;IACnE,qEAAgC,CAAA;IAEhC,mEAAmE;IACnE,qEAAgC,CAAA;AAClC,CAAC,EAXW,iCAAiC,iDAAjC,iCAAiC,QAW5C;AAED;;;;;GAKG;AACH,IAAY,uCAuCX;AAvCD,WAAY,uCAAuC;IACjD,kEAAuB,CAAA;IACvB,8FAAmD,CAAA;IACnD,0GAA+D,CAAA;IAC/D,gHAAqE,CAAA;IAErE,4EAAiC,CAAA;IACjC,oGAAyD,CAAA;IACzD,wFAA6C,CAAA;IAC7C,mGAAwD,CAAA;IACxD,+GAAoE,CAAA;IACpE,4FAAiD,CAAA;IACjD,0FAA+C,CAAA;IAC/C,kHAAuE,CAAA;IACvE,0GAA+D,CAAA;IAC/D,wFAA6C,CAAA;IAC7C,8GAAmE,CAAA;IACnE,wGAA6D,CAAA;IAC7D,wGAA6D,CAAA;IAE7D,gEAAgE;IAChE,
|
|
1
|
+
{"version":3,"file":"BackendLoggerCategory.js","sourceRoot":"","sources":["../../../src/presentation-backend/BackendLoggerCategory.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;;;;GAKG;AACH,IAAY,iCAWX;AAXD,WAAY,iCAAiC;IAC3C,qEAAgC,CAAA;IAEhC,+FAA+F;IAC/F,qGAAgE,CAAA;IAEhE,mEAAmE;IACnE,qEAAgC,CAAA;IAEhC,mEAAmE;IACnE,qEAAgC,CAAA;AAClC,CAAC,EAXW,iCAAiC,iDAAjC,iCAAiC,QAW5C;AAED;;;;;GAKG;AACH,IAAY,uCAuCX;AAvCD,WAAY,uCAAuC;IACjD,kEAAuB,CAAA;IACvB,8FAAmD,CAAA;IACnD,0GAA+D,CAAA;IAC/D,gHAAqE,CAAA;IAErE,4EAAiC,CAAA;IACjC,oGAAyD,CAAA;IACzD,wFAA6C,CAAA;IAC7C,mGAAwD,CAAA;IACxD,+GAAoE,CAAA;IACpE,4FAAiD,CAAA;IACjD,0FAA+C,CAAA;IAC/C,kHAAuE,CAAA;IACvE,0GAA+D,CAAA;IAC/D,wFAA6C,CAAA;IAC7C,8GAAmE,CAAA;IACnE,wGAA6D,CAAA;IAC7D,wGAA6D,CAAA;IAE7D,gEAAgE;IAChE,kHAAkH;IAClH,sGAA2D,CAAA;IAC3D,8FAA8F;IAC9F,oGAAyD,CAAA;IACzD,sGAAsG;IACtG,wGAA6D,CAAA;IAC7D,kHAAkH;IAClH,kHAAuE,CAAA;IACvE,0GAA0G;IAC1G,8GAAmE,CAAA;IACnE,gHAAgH;IAChH,0HAA+E,CAAA;IAC/E,oGAAoG;IACpG,sGAA2D,CAAA;IAC3D,qGAAqG;IACrG,sGAA2D,CAAA;IAC3D,+GAA+G;IAC/G,0HAA+E,CAAA;AACjF,CAAC,EAvCW,uCAAuC,uDAAvC,uCAAuC,QAuClD","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 Logging\n */\n\n/**\n * Logger categories used by this package\n * @note All logger categories in this package start with the `presentation-backend` prefix.\n * @see [Logger]($bentley)\n * @public\n */\nexport enum PresentationBackendLoggerCategory {\n Package = \"presentation-backend\",\n\n /** The logger category used by the [[PresentationManager]] class and other related classes. */\n PresentationManager = \"presentation-backend.PresentationManager\",\n\n /** The logger category used by Presentation RPC implementation. */\n Rpc = \"presentation-backend.Rpc\",\n\n /** The logger category used by Presentation IPC implementation. */\n Ipc = \"presentation-backend.Ipc\",\n}\n\n/**\n * Logger categories used by this package\n * @note Logger categories used by the [[PresentationManager]] native addon.\n * @see [Logger]($bentley)\n * @public\n */\nexport enum PresentationBackendNativeLoggerCategory {\n ECObjects = \"ECObjects\",\n ECObjects_ECExpressions = \"ECObjects.ECExpressions\",\n ECObjects_ECExpressions_Parse = \"ECObjects.ECExpressions.Parse\",\n ECObjects_ECExpressions_Evaluate = \"ECObjects.ECExpressions.Evaluate\",\n\n ECPresentation = \"ECPresentation\",\n ECPresentation_Connections = \"ECPresentation.Connections\",\n ECPresentation_Tasks = \"ECPresentation.Tasks\",\n ECPresentation_Hierarchies = \"ECPresentation.Navigation\",\n ECPresentation_Hierarchies_Cache = \"ECPresentation.Navigation.Cache\",\n ECPresentation_Content = \"ECPresentation.Content\",\n ECPresentation_Update = \"ECPresentation.Update\",\n ECPresentation_Update_Hierarchies = \"ECPresentation.Update.Hierarchies\",\n ECPresentation_Update_Content = \"ECPresentation.Update.Content\",\n ECPresentation_Rules = \"ECPresentation.Rules\",\n ECPresentation_RulesetVariables = \"ECPresentation.RulesetVariables\",\n ECPresentation_ECExpressions = \"ECPresentation.ECExpressions\",\n ECPresentation_Serialization = \"ECPresentation.Serialization\",\n\n /* eslint-disable @typescript-eslint/no-duplicate-enum-values */\n /** @deprecated in 4.0 - will not be removed until after 2026-06-13. The logging namespace is not used anymore. */\n ECPresentation_Localization = \"ECPresentation.Localization\",\n /** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation]] */\n ECPresentation_RulesEngine = \"ECPresentation.RulesEngine\",\n /** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Content]] */\n ECPresentation_RulesEngine_Content = \"ECPresentation.Content\",\n /** @deprecated in 4.0 - will not be removed until after 2026-06-13. The logging namespace is not used anymore. */\n ECPresentation_RulesEngine_Localization = \"ECPresentation.Localization\",\n /** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Hierarchies]] */\n ECPresentation_RulesEngine_Navigation = \"ECPresentation.Navigation\",\n /** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Hierarchies_Cache]] */\n ECPresentation_RulesEngine_Navigation_Cache = \"ECPresentation.Navigation.Cache\",\n /** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Tasks]] */\n ECPresentation_RulesEngine_Threads = \"ECPresentation.Tasks\",\n /** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_Update]] */\n ECPresentation_RulesEngine_Update = \"ECPresentation.Update\",\n /** @deprecated in 4.0 - will not be removed until after 2026-06-13. Use [[ECPresentation_RulesetVariables]] */\n ECPresentation_RulesEngine_RulesetVariables = \"ECPresentation.RulesetVariables\",\n}\n"]}
|
|
@@ -27,14 +27,14 @@ export interface PresentationProps extends Omit<PresentationManagerProps, "enabl
|
|
|
27
27
|
* instances, one for each frontend.
|
|
28
28
|
*
|
|
29
29
|
* @public
|
|
30
|
-
* @deprecated in 4.8 -
|
|
30
|
+
* @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[PresentationProps]] instead.
|
|
31
31
|
*/
|
|
32
32
|
export type MultiManagerPresentationProps = PresentationProps;
|
|
33
33
|
/**
|
|
34
34
|
* Base props for initializing the [[Presentation]] library.
|
|
35
35
|
*
|
|
36
36
|
* @public
|
|
37
|
-
* @deprecated in 4.8 -
|
|
37
|
+
* @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[PresentationProps]] instead.
|
|
38
38
|
*/
|
|
39
39
|
export type PresentationPropsBase = PresentationProps;
|
|
40
40
|
/**
|
|
@@ -42,7 +42,7 @@ export type PresentationPropsBase = PresentationProps;
|
|
|
42
42
|
* [[PresentationManager]] instance for handling all requests.
|
|
43
43
|
*
|
|
44
44
|
* @public
|
|
45
|
-
* @deprecated in 4.8 -
|
|
45
|
+
* @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[PresentationProps]] instead.
|
|
46
46
|
*/
|
|
47
47
|
export type SingleManagerPresentationProps = Omit<PresentationProps, "unusedClientLifetime">;
|
|
48
48
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Presentation.js","sourceRoot":"","sources":["../../../src/presentation-backend/Presentation.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAuE;AACvE,sDAA0D;AAC1D,oDAAgD;AAChD,oEAA6G;AAC7G,yEAA+E;AAC/E,2EAAqE;AACrE,qEAAyF;AACzF,qEAA+D;AAC/D,+DAAqE;AACrE,6DAAoE;AA8DpE;;;;;;;;;GASG;AACH,MAAa,YAAY;IACf,MAAM,CAAC,UAAU,CAA8D;IAC/E,MAAM,CAAC,eAAe,CAA4D;IAClF,MAAM,CAAC,kBAAkB,CAA0B;IACnD,MAAM,CAAC,iBAAiB,CAA0B;IAClD,MAAM,CAAC,4BAA4B,CAA0B;IAC7D,MAAM,CAAC,QAAQ,CAAkC;IAEzD,oBAAoB;IACpB,gBAAuB,CAAC;IAExB,+DAA+D;IACxD,MAAM,KAAK,SAAS;QACzB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,UAAU,CAAC,KAAyB;QAChD,IAAI,CAAC,UAAU,GAAG,KAAK,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,iBAAiB,GAAG,yBAAU,CAAC,gBAAgB,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,YAAY,CA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OAAO,CAAC,iDAA4B,CAAC,CAAC,iBAAiB,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC1F,CAAC,CAAC;;AA1IJ,oCA2IC","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 { BriefcaseDb, IModelHost, IpcHost } from \"@itwin/core-backend\";\nimport { DisposeFunc, Logger } from \"@itwin/core-bentley\";\nimport { RpcManager } from \"@itwin/core-common\";\nimport { PresentationError, PresentationRpcInterface, PresentationStatus } from \"@itwin/presentation-common\";\nimport { PresentationBackendLoggerCategory } from \"./BackendLoggerCategory.js\";\nimport { PresentationIpcHandler } from \"./PresentationIpcHandler.js\";\nimport { PresentationManager, PresentationManagerProps } from \"./PresentationManager.js\";\nimport { PresentationRpcImpl } from \"./PresentationRpcImpl.js\";\nimport { FactoryBasedTemporaryStorage } from \"./TemporaryStorage.js\";\nimport { _presentation_manager_detail } from \"./InternalSymbols.js\";\n\n/**\n * Properties that can be used to configure [[Presentation]] API.\n * @public\n */\nexport interface PresentationProps extends Omit<PresentationManagerProps, \"enableSchemasPreload\"> {\n /**\n * Time in milliseconds after which the request will timeout.\n */\n requestTimeout?: number;\n\n /**\n * Should schemas preloading be enabled. If true, [[Presentation]] library listens\n * for `BriefcaseDb.onOpened` event and force pre-loads all ECSchemas.\n */\n enableSchemasPreload?: boolean;\n\n /**\n * How much time should an unused client manager be stored in memory\n * before it's disposed.\n */\n unusedClientLifetime?: number;\n}\n\ninterface PresentationInternalProps {\n /**\n * Factory method for creating separate managers for each client\n */\n clientManagerFactory?: (clientId: string, props: PresentationManagerProps) => PresentationManager;\n}\n\n/**\n * Props for initializing the [[Presentation]] library for using multiple [[PresentationManager]]\n * instances, one for each frontend.\n *\n * @public\n * @deprecated in 4.8 - might be removed in next major version. Use [[PresentationProps]] instead.\n */\nexport type MultiManagerPresentationProps = PresentationProps;\n\n/**\n * Base props for initializing the [[Presentation]] library.\n *\n * @public\n * @deprecated in 4.8 - might be removed in next major version. Use [[PresentationProps]] instead.\n */\nexport type PresentationPropsBase = PresentationProps;\n\n/**\n * Props for initializing the [[Presentation]] library with ability to use a single\n * [[PresentationManager]] instance for handling all requests.\n *\n * @public\n * @deprecated in 4.8 - might be removed in next major version. Use [[PresentationProps]] instead.\n */\nexport type SingleManagerPresentationProps = Omit<PresentationProps, \"unusedClientLifetime\">;\n\ninterface ClientStoreItem {\n manager: PresentationManager;\n}\n\n/**\n * Static class used to statically set up Presentation library for the backend.\n * Basically what it does is:\n * - Register a RPC implementation\n * - Create a singleton [[PresentationManager]] instance\n * - Subscribe for [IModelHost.onBeforeShutdown]($core-backend) event and terminate\n * the presentation manager when that happens.\n *\n * @public\n */\nexport class Presentation {\n private static _initProps: (PresentationProps & PresentationInternalProps) | undefined;\n private static _clientsStorage: FactoryBasedTemporaryStorage<ClientStoreItem> | undefined;\n private static _disposeIpcHandler: DisposeFunc | undefined;\n private static _shutdownListener: DisposeFunc | undefined;\n private static _disposeIModelOpenedListener: DisposeFunc | undefined;\n private static _rpcImpl: PresentationRpcImpl | undefined;\n\n /* c8 ignore next */\n private constructor() {}\n\n /** Properties used to initialize the presentation framework */\n public static get initProps(): PresentationProps | undefined {\n return this._initProps;\n }\n\n /**\n * Initializes Presentation library for the backend.\n *\n * See [Setting up iTwin.js Presentation library documentation page]($docs/presentation/setup/index.md#backend) for an example.\n *\n * **Important:** The method should be called after a call to [IModelHost.startup]($core-backend)\n *\n * @param props Optional properties for [[PresentationManager]]\n */\n public static initialize(props?: PresentationProps): void {\n this._initProps = props || {};\n this._shutdownListener = IModelHost.onBeforeShutdown.addListener(() => Presentation.terminate());\n\n this._rpcImpl = new PresentationRpcImpl({\n requestTimeout: this._initProps.requestTimeout,\n });\n RpcManager.registerImpl(PresentationRpcInterface, PresentationRpcImpl);\n RpcManager.supplyImplInstance(PresentationRpcInterface, this._rpcImpl);\n\n if (IpcHost.isValid) {\n this._disposeIpcHandler = PresentationIpcHandler.register();\n }\n\n this._clientsStorage = new FactoryBasedTemporaryStorage<ClientStoreItem>({\n factory: this.createClientManager.bind(this),\n cleanupHandler: (_id, storeItem) => this.disposeClientManager(_id, storeItem),\n // cleanup unused managers every minute\n cleanupInterval: 60 * 1000,\n // by default, manager is disposed after 1 hour of being unused\n unusedValueLifetime: this._initProps.unusedClientLifetime ?? 60 * 60 * 1000,\n // add some logging\n /* c8 ignore next 5 */\n onDisposedSingle: (id: string) =>\n Logger.logInfo(\n PresentationBackendLoggerCategory.PresentationManager,\n `Disposed PresentationManager instance with ID: ${id}. Total instances: ${this._clientsStorage!.values.length}.`,\n ),\n /* c8 ignore next */\n onDisposedAll: () => Logger.logInfo(PresentationBackendLoggerCategory.PresentationManager, `Disposed all PresentationManager instances.`),\n });\n\n if (this._initProps.enableSchemasPreload) {\n this._disposeIModelOpenedListener = BriefcaseDb.onOpened.addListener(this.onIModelOpened);\n }\n }\n\n /**\n * Terminates Presentation. Consumers don't need to call this as it's automatically\n * called on [IModelHost.onBeforeShutdown]($core-backend) event.\n */\n public static terminate(): void {\n if (this._clientsStorage) {\n this._clientsStorage[Symbol.dispose]();\n this._clientsStorage = undefined;\n }\n if (this._disposeIModelOpenedListener) {\n this._disposeIModelOpenedListener();\n this._disposeIModelOpenedListener = undefined;\n }\n if (this._shutdownListener) {\n this._shutdownListener();\n this._shutdownListener = undefined;\n }\n RpcManager.unregisterImpl(PresentationRpcInterface);\n if (this._rpcImpl) {\n this._rpcImpl[Symbol.dispose]();\n this._rpcImpl = undefined;\n }\n if (this._disposeIpcHandler) {\n this._disposeIpcHandler();\n }\n this._initProps = undefined;\n }\n\n private static createClientManager(clientId: string, onManagerUsed: () => void): ClientStoreItem {\n const manager =\n Presentation._initProps && Presentation._initProps.clientManagerFactory\n ? Presentation._initProps.clientManagerFactory(clientId, Presentation._initProps)\n : new PresentationManager({\n ...Presentation._initProps,\n // @ts-expect-error internal prop\n id: clientId,\n });\n manager.onUsed.addListener(onManagerUsed);\n Logger.logInfo(\n PresentationBackendLoggerCategory.PresentationManager,\n `Created a PresentationManager instance with ID: ${clientId}. Total instances: ${this._clientsStorage!.values.length}.`,\n );\n return { manager };\n }\n\n private static disposeClientManager(_id: string, storeItem: ClientStoreItem) {\n storeItem.manager[Symbol.dispose]();\n }\n\n /**\n * Get an instance of [[PresentationManager]] for specific client\n * @param clientId ID of the client requesting presentation data. If no\n * ID is provided, the default [[PresentationManager]] is returned.\n */\n public static getManager(clientId?: string): PresentationManager {\n if (this._clientsStorage) {\n return this._clientsStorage.getValue(clientId || \"\").manager;\n }\n throw new PresentationError(PresentationStatus.NotInitialized, \"Presentation must be first initialized by calling Presentation.initialize\");\n }\n\n /**\n * Get the time in milliseconds that backend should respond in .\n */\n public static getRequestTimeout(): number {\n if (this._rpcImpl === undefined) {\n throw new PresentationError(PresentationStatus.NotInitialized, \"Presentation must be first initialized by calling Presentation.initialize\");\n }\n return this._rpcImpl.requestTimeout;\n }\n\n private static onIModelOpened = (imodel: BriefcaseDb) => {\n const manager = this.getManager();\n const imodelAddon = manager[_presentation_manager_detail].getNativePlatform().getImodelAddon(imodel);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n manager[_presentation_manager_detail].getNativePlatform().forceLoadSchemas(imodelAddon);\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Presentation.js","sourceRoot":"","sources":["../../../src/presentation-backend/Presentation.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAuE;AACvE,sDAA0D;AAC1D,oDAAgD;AAChD,oEAA6G;AAC7G,yEAA+E;AAC/E,2EAAqE;AACrE,qEAAyF;AACzF,qEAA+D;AAC/D,+DAAqE;AACrE,6DAAoE;AA8DpE;;;;;;;;;GASG;AACH,MAAa,YAAY;IACf,MAAM,CAAC,UAAU,CAA8D;IAC/E,MAAM,CAAC,eA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OAEG;IACI,MAAM,CAAC,iBAAiB;QAC7B,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,IAAI,uCAAiB,CAAC,wCAAkB,CAAC,cAAc,EAAE,2EAA2E,CAAC,CAAC;QAC9I,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;IACtC,CAAC;IAEO,MAAM,CAAC,cAAc,GAAG,CAAC,MAAmB,EAAE,EAAE;QACtD,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,MAAM,WAAW,GAAG,OAAO,CAAC,iDAA4B,CAAC,CAAC,iBAAiB,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACrG,mEAAmE;QACnE,OAAO,CAAC,iDAA4B,CAAC,CAAC,iBAAiB,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC1F,CAAC,CAAC;;AA1IJ,oCA2IC","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 { BriefcaseDb, IModelHost, IpcHost } from \"@itwin/core-backend\";\nimport { DisposeFunc, Logger } from \"@itwin/core-bentley\";\nimport { RpcManager } from \"@itwin/core-common\";\nimport { PresentationError, PresentationRpcInterface, PresentationStatus } from \"@itwin/presentation-common\";\nimport { PresentationBackendLoggerCategory } from \"./BackendLoggerCategory.js\";\nimport { PresentationIpcHandler } from \"./PresentationIpcHandler.js\";\nimport { PresentationManager, PresentationManagerProps } from \"./PresentationManager.js\";\nimport { PresentationRpcImpl } from \"./PresentationRpcImpl.js\";\nimport { FactoryBasedTemporaryStorage } from \"./TemporaryStorage.js\";\nimport { _presentation_manager_detail } from \"./InternalSymbols.js\";\n\n/**\n * Properties that can be used to configure [[Presentation]] API.\n * @public\n */\nexport interface PresentationProps extends Omit<PresentationManagerProps, \"enableSchemasPreload\"> {\n /**\n * Time in milliseconds after which the request will timeout.\n */\n requestTimeout?: number;\n\n /**\n * Should schemas preloading be enabled. If true, [[Presentation]] library listens\n * for `BriefcaseDb.onOpened` event and force pre-loads all ECSchemas.\n */\n enableSchemasPreload?: boolean;\n\n /**\n * How much time should an unused client manager be stored in memory\n * before it's disposed.\n */\n unusedClientLifetime?: number;\n}\n\ninterface PresentationInternalProps {\n /**\n * Factory method for creating separate managers for each client\n */\n clientManagerFactory?: (clientId: string, props: PresentationManagerProps) => PresentationManager;\n}\n\n/**\n * Props for initializing the [[Presentation]] library for using multiple [[PresentationManager]]\n * instances, one for each frontend.\n *\n * @public\n * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[PresentationProps]] instead.\n */\nexport type MultiManagerPresentationProps = PresentationProps;\n\n/**\n * Base props for initializing the [[Presentation]] library.\n *\n * @public\n * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[PresentationProps]] instead.\n */\nexport type PresentationPropsBase = PresentationProps;\n\n/**\n * Props for initializing the [[Presentation]] library with ability to use a single\n * [[PresentationManager]] instance for handling all requests.\n *\n * @public\n * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[PresentationProps]] instead.\n */\nexport type SingleManagerPresentationProps = Omit<PresentationProps, \"unusedClientLifetime\">;\n\ninterface ClientStoreItem {\n manager: PresentationManager;\n}\n\n/**\n * Static class used to statically set up Presentation library for the backend.\n * Basically what it does is:\n * - Register a RPC implementation\n * - Create a singleton [[PresentationManager]] instance\n * - Subscribe for [IModelHost.onBeforeShutdown]($core-backend) event and terminate\n * the presentation manager when that happens.\n *\n * @public\n */\nexport class Presentation {\n private static _initProps: (PresentationProps & PresentationInternalProps) | undefined;\n private static _clientsStorage: FactoryBasedTemporaryStorage<ClientStoreItem> | undefined;\n private static _disposeIpcHandler: DisposeFunc | undefined;\n private static _shutdownListener: DisposeFunc | undefined;\n private static _disposeIModelOpenedListener: DisposeFunc | undefined;\n private static _rpcImpl: PresentationRpcImpl | undefined;\n\n /* c8 ignore next */\n private constructor() {}\n\n /** Properties used to initialize the presentation framework */\n public static get initProps(): PresentationProps | undefined {\n return this._initProps;\n }\n\n /**\n * Initializes Presentation library for the backend.\n *\n * See [Setting up iTwin.js Presentation library documentation page]($docs/presentation/setup/index.md#backend) for an example.\n *\n * **Important:** The method should be called after a call to [IModelHost.startup]($core-backend)\n *\n * @param props Optional properties for [[PresentationManager]]\n */\n public static initialize(props?: PresentationProps): void {\n this._initProps = props || {};\n this._shutdownListener = IModelHost.onBeforeShutdown.addListener(() => Presentation.terminate());\n\n this._rpcImpl = new PresentationRpcImpl({\n requestTimeout: this._initProps.requestTimeout,\n });\n RpcManager.registerImpl(PresentationRpcInterface, PresentationRpcImpl);\n RpcManager.supplyImplInstance(PresentationRpcInterface, this._rpcImpl);\n\n if (IpcHost.isValid) {\n this._disposeIpcHandler = PresentationIpcHandler.register();\n }\n\n this._clientsStorage = new FactoryBasedTemporaryStorage<ClientStoreItem>({\n factory: this.createClientManager.bind(this),\n cleanupHandler: (_id, storeItem) => this.disposeClientManager(_id, storeItem),\n // cleanup unused managers every minute\n cleanupInterval: 60 * 1000,\n // by default, manager is disposed after 1 hour of being unused\n unusedValueLifetime: this._initProps.unusedClientLifetime ?? 60 * 60 * 1000,\n // add some logging\n /* c8 ignore next 5 */\n onDisposedSingle: (id: string) =>\n Logger.logInfo(\n PresentationBackendLoggerCategory.PresentationManager,\n `Disposed PresentationManager instance with ID: ${id}. Total instances: ${this._clientsStorage!.values.length}.`,\n ),\n /* c8 ignore next */\n onDisposedAll: () => Logger.logInfo(PresentationBackendLoggerCategory.PresentationManager, `Disposed all PresentationManager instances.`),\n });\n\n if (this._initProps.enableSchemasPreload) {\n this._disposeIModelOpenedListener = BriefcaseDb.onOpened.addListener(this.onIModelOpened);\n }\n }\n\n /**\n * Terminates Presentation. Consumers don't need to call this as it's automatically\n * called on [IModelHost.onBeforeShutdown]($core-backend) event.\n */\n public static terminate(): void {\n if (this._clientsStorage) {\n this._clientsStorage[Symbol.dispose]();\n this._clientsStorage = undefined;\n }\n if (this._disposeIModelOpenedListener) {\n this._disposeIModelOpenedListener();\n this._disposeIModelOpenedListener = undefined;\n }\n if (this._shutdownListener) {\n this._shutdownListener();\n this._shutdownListener = undefined;\n }\n RpcManager.unregisterImpl(PresentationRpcInterface);\n if (this._rpcImpl) {\n this._rpcImpl[Symbol.dispose]();\n this._rpcImpl = undefined;\n }\n if (this._disposeIpcHandler) {\n this._disposeIpcHandler();\n }\n this._initProps = undefined;\n }\n\n private static createClientManager(clientId: string, onManagerUsed: () => void): ClientStoreItem {\n const manager =\n Presentation._initProps && Presentation._initProps.clientManagerFactory\n ? Presentation._initProps.clientManagerFactory(clientId, Presentation._initProps)\n : new PresentationManager({\n ...Presentation._initProps,\n // @ts-expect-error internal prop\n id: clientId,\n });\n manager.onUsed.addListener(onManagerUsed);\n Logger.logInfo(\n PresentationBackendLoggerCategory.PresentationManager,\n `Created a PresentationManager instance with ID: ${clientId}. Total instances: ${this._clientsStorage!.values.length}.`,\n );\n return { manager };\n }\n\n private static disposeClientManager(_id: string, storeItem: ClientStoreItem) {\n storeItem.manager[Symbol.dispose]();\n }\n\n /**\n * Get an instance of [[PresentationManager]] for specific client\n * @param clientId ID of the client requesting presentation data. If no\n * ID is provided, the default [[PresentationManager]] is returned.\n */\n public static getManager(clientId?: string): PresentationManager {\n if (this._clientsStorage) {\n return this._clientsStorage.getValue(clientId || \"\").manager;\n }\n throw new PresentationError(PresentationStatus.NotInitialized, \"Presentation must be first initialized by calling Presentation.initialize\");\n }\n\n /**\n * Get the time in milliseconds that backend should respond in .\n */\n public static getRequestTimeout(): number {\n if (this._rpcImpl === undefined) {\n throw new PresentationError(PresentationStatus.NotInitialized, \"Presentation must be first initialized by calling Presentation.initialize\");\n }\n return this._rpcImpl.requestTimeout;\n }\n\n private static onIModelOpened = (imodel: BriefcaseDb) => {\n const manager = this.getManager();\n const imodelAddon = manager[_presentation_manager_detail].getNativePlatform().getImodelAddon(imodel);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n manager[_presentation_manager_detail].getNativePlatform().forceLoadSchemas(imodelAddon);\n };\n}\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { IModelDb } from "@itwin/core-backend";
|
|
5
5
|
import { BeEvent } from "@itwin/core-bentley";
|
|
6
|
-
import { UnitSystemKey } from "@itwin/core-quantity";
|
|
6
|
+
import { FormatsProvider, UnitSystemKey } from "@itwin/core-quantity";
|
|
7
7
|
import { SchemaContext } from "@itwin/ecschema-metadata";
|
|
8
8
|
import { UnitSystemFormat as CommonUnitSystemFormat, ComputeSelectionRequestOptions, Content, ContentDescriptorRequestOptions, ContentRequestOptions, ContentSourcesRequestOptions, Descriptor, DescriptorOverrides, DisplayLabelRequestOptions, DisplayLabelsRequestOptions, DisplayValueGroup, DistinctValuesRequestOptions, ElementProperties, FilterByInstancePathsHierarchyRequestOptions, FilterByTextHierarchyRequestOptions, FormatsMap, HierarchyCompareInfo, HierarchyCompareOptions, HierarchyLevelDescriptorRequestOptions, HierarchyRequestOptions, InstanceKey, Item, KeySet, LabelDefinition, MultiElementPropertiesRequestOptions, Node, NodeKey, NodePathElement, Paged, PagedResponse, Prioritized, Ruleset, RulesetVariable, SelectClassInfo, SelectionScope, SelectionScopeRequestOptions, SingleElementPropertiesRequestOptions, WithCancelEvent } from "@itwin/presentation-common";
|
|
9
9
|
import { _presentation_manager_detail } from "./InternalSymbols.js";
|
|
@@ -134,7 +134,7 @@ export interface PresentationManagerCachingConfig {
|
|
|
134
134
|
* assigning default unit formats for specific phenomenons (see [[PresentationManagerProps.defaultFormats]]).
|
|
135
135
|
*
|
|
136
136
|
* @public
|
|
137
|
-
* @deprecated in 4.3 -
|
|
137
|
+
* @deprecated in 4.3 - will not be removed until after 2026-06-13. The type has been moved to `@itwin/presentation-common` package.
|
|
138
138
|
*/
|
|
139
139
|
export type UnitSystemFormat = CommonUnitSystemFormat;
|
|
140
140
|
/**
|
|
@@ -177,7 +177,7 @@ export interface PresentationManagerProps {
|
|
|
177
177
|
*
|
|
178
178
|
* which means the assets can be found through a relative path `./assets/` from the `{source file being executed}`.
|
|
179
179
|
*
|
|
180
|
-
* @deprecated in 4.2 -
|
|
180
|
+
* @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.
|
|
181
181
|
*/
|
|
182
182
|
presentationAssetsRoot?: string | PresentationAssetsRootConfig;
|
|
183
183
|
/**
|
|
@@ -204,8 +204,15 @@ export interface PresentationManagerProps {
|
|
|
204
204
|
/**
|
|
205
205
|
* A map of default unit formats to use for formatting properties that don't have a presentation format
|
|
206
206
|
* in requested unit system.
|
|
207
|
+
*
|
|
208
|
+
* @deprecated in 5.1. Use `formatsProvider` instead. Still used as a fallback if `formatsProvider` is not supplied.
|
|
207
209
|
*/
|
|
208
210
|
defaultFormats?: FormatsMap;
|
|
211
|
+
/**
|
|
212
|
+
* A custom formats provider to use for formatting property values with units. Defaults to [SchemaFormatsProvider]($ecschema-metadata) if
|
|
213
|
+
* not supplied.
|
|
214
|
+
*/
|
|
215
|
+
formatsProvider?: FormatsProvider;
|
|
209
216
|
/**
|
|
210
217
|
* A number of worker threads to use for handling presentation requests. Defaults to `2`.
|
|
211
218
|
*/
|
|
@@ -215,7 +222,7 @@ export interface PresentationManagerProps {
|
|
|
215
222
|
* data changes are not tracked at all.
|
|
216
223
|
*
|
|
217
224
|
* @beta
|
|
218
|
-
* @deprecated in 4.4 -
|
|
225
|
+
* @deprecated in 4.4 - will not be removed until after 2026-06-13. The manager now always tracks for iModel data changes without polling.
|
|
219
226
|
*/
|
|
220
227
|
updatesPollInterval?: number;
|
|
221
228
|
/** Options for caching. */
|
|
@@ -270,7 +277,7 @@ export declare class PresentationManager {
|
|
|
270
277
|
set activeUnitSystem(value: UnitSystemKey | undefined);
|
|
271
278
|
/** Dispose the presentation manager. Must be called to clean up native resources. */
|
|
272
279
|
[Symbol.dispose](): void;
|
|
273
|
-
/** @deprecated in 5.0 Use [Symbol.dispose] instead. */
|
|
280
|
+
/** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */
|
|
274
281
|
dispose(): void;
|
|
275
282
|
/** An event, that this manager raises whenever any request is made on it. */
|
|
276
283
|
get onUsed(): BeEvent<() => void>;
|
|
@@ -373,13 +380,13 @@ export declare class PresentationManager {
|
|
|
373
380
|
/**
|
|
374
381
|
* Retrieves available selection scopes.
|
|
375
382
|
* @public
|
|
376
|
-
* @deprecated in 5.0. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.
|
|
383
|
+
* @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.
|
|
377
384
|
*/
|
|
378
385
|
getSelectionScopes(_requestOptions: SelectionScopeRequestOptions<IModelDb> & BackendDiagnosticsAttribute): Promise<SelectionScope[]>;
|
|
379
386
|
/**
|
|
380
387
|
* Computes selection based on provided element IDs and selection scope.
|
|
381
388
|
* @public
|
|
382
|
-
* @deprecated in 5.0. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.
|
|
389
|
+
* @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.
|
|
383
390
|
*/
|
|
384
391
|
computeSelection(requestOptions: ComputeSelectionRequestOptions<IModelDb> & BackendDiagnosticsAttribute): Promise<KeySet>;
|
|
385
392
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAa,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"PresentationManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAa,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAyB,MAAM,0BAA0B,CAAC;AAChF,OAAO,EACL,gBAAgB,IAAI,sBAAsB,EAC1C,8BAA8B,EAC9B,OAAO,EACP,+BAA+B,EAE/B,qBAAqB,EACrB,4BAA4B,EAE5B,UAAU,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,4BAA4B,EAC5B,iBAAiB,EACjB,4CAA4C,EAC5C,mCAAmC,EACnC,UAAU,EACV,oBAAoB,EACpB,uBAAuB,EAEvB,sCAAsC,EACtC,uBAAuB,EACvB,WAAW,EACX,IAAI,EACJ,MAAM,EAEN,eAAe,EACf,oCAAoC,EACpC,IAAI,EACJ,OAAO,EACP,eAAe,EACf,KAAK,EACL,aAAa,EAGb,WAAW,EACX,OAAO,EACP,eAAe,EACf,eAAe,EACf,cAAc,EACd,4BAA4B,EAC5B,qCAAqC,EACrC,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAUpC,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAsB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAA+B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AEU,kBAAkB,CAAC,eAAe,EAAE,4BAA4B,CAAC,QAAQ,CAAC,GAAG,2BAA2B,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAIjJ;;;;OAIG;IAEU,gBAAgB,CAAC,cAAc,EAAE,8BAA8B,CAAC,QAAQ,CAAC,GAAG,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IAItI;;;OAGG;IACU,kBAAkB,CAAC,cAAc,EAAE,uBAAuB,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA4B3H"}
|
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.PresentationManager = exports.HierarchyCacheMode = void 0;
|
|
11
11
|
const rxjs_1 = require("rxjs");
|
|
12
12
|
const rxjs_for_await_1 = require("rxjs-for-await");
|
|
13
|
+
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
13
14
|
const presentation_common_1 = require("@itwin/presentation-common");
|
|
14
15
|
const internal_1 = require("@itwin/presentation-common/internal");
|
|
15
16
|
const ElementPropertiesHelper_js_1 = require("./ElementPropertiesHelper.js");
|
|
@@ -76,7 +77,7 @@ class PresentationManager {
|
|
|
76
77
|
[Symbol.dispose]() {
|
|
77
78
|
this._detail[Symbol.dispose]();
|
|
78
79
|
}
|
|
79
|
-
/** @deprecated in 5.0 Use [Symbol.dispose] instead. */
|
|
80
|
+
/** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */
|
|
80
81
|
/* c8 ignore next 3 */
|
|
81
82
|
dispose() {
|
|
82
83
|
this[Symbol.dispose]();
|
|
@@ -176,8 +177,17 @@ class PresentationManager {
|
|
|
176
177
|
return this._detail.getContentSetSize(requestOptions);
|
|
177
178
|
}
|
|
178
179
|
createContentFormatter({ imodel, unitSystem }) {
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
if (!unitSystem) {
|
|
181
|
+
unitSystem = this.props.defaultUnitSystem ?? "metric";
|
|
182
|
+
}
|
|
183
|
+
const schemaContext = this._schemaContextProvider(imodel);
|
|
184
|
+
const koqPropertyFormatter = new presentation_common_1.KoqPropertyValueFormatter({
|
|
185
|
+
schemaContext,
|
|
186
|
+
formatsProvider: this.props.formatsProvider ?? new ecschema_metadata_1.SchemaFormatsProvider(schemaContext, unitSystem),
|
|
187
|
+
});
|
|
188
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
189
|
+
koqPropertyFormatter.defaultFormats = this.props.defaultFormats;
|
|
190
|
+
return new internal_1.ContentFormatter(new internal_1.ContentPropertyValueFormatter(koqPropertyFormatter), unitSystem);
|
|
181
191
|
}
|
|
182
192
|
/**
|
|
183
193
|
* Retrieves the content set based on the supplied content descriptor.
|
|
@@ -307,7 +317,7 @@ class PresentationManager {
|
|
|
307
317
|
/**
|
|
308
318
|
* Retrieves available selection scopes.
|
|
309
319
|
* @public
|
|
310
|
-
* @deprecated in 5.0. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.
|
|
320
|
+
* @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.
|
|
311
321
|
*/
|
|
312
322
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
313
323
|
async getSelectionScopes(_requestOptions) {
|
|
@@ -316,7 +326,7 @@ class PresentationManager {
|
|
|
316
326
|
/**
|
|
317
327
|
* Computes selection based on provided element IDs and selection scope.
|
|
318
328
|
* @public
|
|
319
|
-
* @deprecated in 5.0. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.
|
|
329
|
+
* @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.
|
|
320
330
|
*/
|
|
321
331
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
322
332
|
async computeSelection(requestOptions) {
|