@itwin/presentation-frontend 5.0.0-dev.10 → 5.0.0-dev.102

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.
Files changed (159) hide show
  1. package/CHANGELOG.md +58 -1
  2. package/lib/cjs/package.json +1 -0
  3. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts +3 -3
  4. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
  5. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +11 -9
  6. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
  7. package/lib/cjs/presentation-frontend/IModelConnectionInitialization.d.ts +13 -0
  8. package/lib/cjs/presentation-frontend/IModelConnectionInitialization.d.ts.map +1 -0
  9. package/lib/cjs/presentation-frontend/IModelConnectionInitialization.js +22 -0
  10. package/lib/cjs/presentation-frontend/IModelConnectionInitialization.js.map +1 -0
  11. package/lib/cjs/presentation-frontend/InternalSymbols.d.ts +6 -0
  12. package/lib/cjs/presentation-frontend/InternalSymbols.d.ts.map +1 -0
  13. package/lib/cjs/presentation-frontend/InternalSymbols.js +17 -0
  14. package/lib/cjs/presentation-frontend/InternalSymbols.js.map +1 -0
  15. package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts +12 -3
  16. package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts.map +1 -1
  17. package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +7 -7
  18. package/lib/cjs/presentation-frontend/IpcRequestsHandler.js.map +1 -1
  19. package/lib/cjs/presentation-frontend/LocalizationHelper.d.ts +1 -1
  20. package/lib/cjs/presentation-frontend/LocalizationHelper.d.ts.map +1 -1
  21. package/lib/cjs/presentation-frontend/LocalizationHelper.js +7 -6
  22. package/lib/cjs/presentation-frontend/LocalizationHelper.js.map +1 -1
  23. package/lib/cjs/presentation-frontend/Presentation.d.ts +15 -14
  24. package/lib/cjs/presentation-frontend/Presentation.d.ts.map +1 -1
  25. package/lib/cjs/presentation-frontend/Presentation.js +31 -45
  26. package/lib/cjs/presentation-frontend/Presentation.js.map +1 -1
  27. package/lib/cjs/presentation-frontend/PresentationManager.d.ts +12 -23
  28. package/lib/cjs/presentation-frontend/PresentationManager.d.ts.map +1 -1
  29. package/lib/cjs/presentation-frontend/PresentationManager.js +77 -74
  30. package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
  31. package/lib/cjs/presentation-frontend/RulesetManager.js +2 -4
  32. package/lib/cjs/presentation-frontend/RulesetManager.js.map +1 -1
  33. package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts +2 -4
  34. package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts.map +1 -1
  35. package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +6 -4
  36. package/lib/cjs/presentation-frontend/RulesetVariablesManager.js.map +1 -1
  37. package/lib/cjs/presentation-frontend/StreamedResponseGenerator.d.ts +1 -1
  38. package/lib/cjs/presentation-frontend/StreamedResponseGenerator.d.ts.map +1 -1
  39. package/lib/cjs/presentation-frontend/StreamedResponseGenerator.js +1 -0
  40. package/lib/cjs/presentation-frontend/StreamedResponseGenerator.js.map +1 -1
  41. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +9 -19
  42. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
  43. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +163 -153
  44. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  45. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +4 -5
  46. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
  47. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +27 -29
  48. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
  49. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts +3 -0
  50. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
  51. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +8 -2
  52. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
  53. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts +2 -1
  54. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts.map +1 -1
  55. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +1 -0
  56. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
  57. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts +5 -1
  58. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
  59. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +3 -0
  60. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
  61. package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts +8 -5
  62. package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
  63. package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +35 -13
  64. package/lib/cjs/presentation-frontend/selection/SelectionHandler.js.map +1 -1
  65. package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts +2 -0
  66. package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
  67. package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +3 -1
  68. package/lib/cjs/presentation-frontend/selection/SelectionHelper.js.map +1 -1
  69. package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts +31 -13
  70. package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
  71. package/lib/cjs/presentation-frontend/selection/SelectionManager.js +216 -116
  72. package/lib/cjs/presentation-frontend/selection/SelectionManager.js.map +1 -1
  73. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts +11 -9
  74. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
  75. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +6 -11
  76. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
  77. package/lib/cjs/presentation-frontend.d.ts +15 -15
  78. package/lib/cjs/presentation-frontend.d.ts.map +1 -1
  79. package/lib/cjs/presentation-frontend.js +30 -29
  80. package/lib/cjs/presentation-frontend.js.map +1 -1
  81. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts +3 -3
  82. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
  83. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +11 -9
  84. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
  85. package/lib/esm/presentation-frontend/IModelConnectionInitialization.d.ts +13 -0
  86. package/lib/esm/presentation-frontend/IModelConnectionInitialization.d.ts.map +1 -0
  87. package/lib/esm/presentation-frontend/IModelConnectionInitialization.js +17 -0
  88. package/lib/esm/presentation-frontend/IModelConnectionInitialization.js.map +1 -0
  89. package/lib/esm/presentation-frontend/InternalSymbols.d.ts +6 -0
  90. package/lib/esm/presentation-frontend/InternalSymbols.d.ts.map +1 -0
  91. package/lib/esm/presentation-frontend/InternalSymbols.js +14 -0
  92. package/lib/esm/presentation-frontend/InternalSymbols.js.map +1 -0
  93. package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts +12 -3
  94. package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts.map +1 -1
  95. package/lib/esm/presentation-frontend/IpcRequestsHandler.js +8 -8
  96. package/lib/esm/presentation-frontend/IpcRequestsHandler.js.map +1 -1
  97. package/lib/esm/presentation-frontend/LocalizationHelper.d.ts +1 -1
  98. package/lib/esm/presentation-frontend/LocalizationHelper.d.ts.map +1 -1
  99. package/lib/esm/presentation-frontend/LocalizationHelper.js +3 -2
  100. package/lib/esm/presentation-frontend/LocalizationHelper.js.map +1 -1
  101. package/lib/esm/presentation-frontend/Presentation.d.ts +15 -14
  102. package/lib/esm/presentation-frontend/Presentation.d.ts.map +1 -1
  103. package/lib/esm/presentation-frontend/Presentation.js +24 -38
  104. package/lib/esm/presentation-frontend/Presentation.js.map +1 -1
  105. package/lib/esm/presentation-frontend/PresentationManager.d.ts +12 -23
  106. package/lib/esm/presentation-frontend/PresentationManager.d.ts.map +1 -1
  107. package/lib/esm/presentation-frontend/PresentationManager.js +66 -63
  108. package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
  109. package/lib/esm/presentation-frontend/RulesetManager.js +2 -4
  110. package/lib/esm/presentation-frontend/RulesetManager.js.map +1 -1
  111. package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts +2 -4
  112. package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts.map +1 -1
  113. package/lib/esm/presentation-frontend/RulesetVariablesManager.js +6 -4
  114. package/lib/esm/presentation-frontend/RulesetVariablesManager.js.map +1 -1
  115. package/lib/esm/presentation-frontend/StreamedResponseGenerator.d.ts +1 -1
  116. package/lib/esm/presentation-frontend/StreamedResponseGenerator.d.ts.map +1 -1
  117. package/lib/esm/presentation-frontend/StreamedResponseGenerator.js +1 -0
  118. package/lib/esm/presentation-frontend/StreamedResponseGenerator.js.map +1 -1
  119. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +9 -19
  120. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
  121. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +164 -154
  122. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  123. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +4 -5
  124. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
  125. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +27 -29
  126. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
  127. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts +3 -0
  128. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
  129. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +8 -2
  130. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
  131. package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts +2 -1
  132. package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts.map +1 -1
  133. package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +1 -0
  134. package/lib/esm/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
  135. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts +5 -1
  136. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
  137. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +3 -0
  138. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
  139. package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts +8 -5
  140. package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
  141. package/lib/esm/presentation-frontend/selection/SelectionHandler.js +35 -13
  142. package/lib/esm/presentation-frontend/selection/SelectionHandler.js.map +1 -1
  143. package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts +2 -0
  144. package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
  145. package/lib/esm/presentation-frontend/selection/SelectionHelper.js +3 -1
  146. package/lib/esm/presentation-frontend/selection/SelectionHelper.js.map +1 -1
  147. package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts +31 -13
  148. package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
  149. package/lib/esm/presentation-frontend/selection/SelectionManager.js +202 -102
  150. package/lib/esm/presentation-frontend/selection/SelectionManager.js.map +1 -1
  151. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts +11 -9
  152. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
  153. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +7 -11
  154. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
  155. package/lib/esm/presentation-frontend.d.ts +15 -15
  156. package/lib/esm/presentation-frontend.d.ts.map +1 -1
  157. package/lib/esm/presentation-frontend.js +12 -15
  158. package/lib/esm/presentation-frontend.js.map +1 -1
  159. package/package.json +42 -42
@@ -1 +1 @@
1
- {"version":3,"file":"PresentationManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-frontend/PresentationManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAqB,WAAW,EAAuB,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAa,gBAAgB,EAAU,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAEL,0BAA0B,EAC1B,OAAO,EACP,+BAA+B,EAG/B,iCAAiC,EAEjC,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EAEjB,UAAU,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,4BAA4B,EAC5B,iBAAiB,EACjB,4CAA4C,EAC5C,mCAAmC,EACnC,UAAU,EACV,sCAAsC,EACtC,uBAAuB,EACvB,mBAAmB,EACnB,WAAW,EACX,IAAI,EAGJ,MAAM,EAEN,eAAe,EACf,IAAI,EACJ,OAAO,EACP,eAAe,EACf,KAAK,EACL,aAAa,EAGb,kBAAkB,EAElB,eAAe,EACf,eAAe,EACf,qCAAqC,EAGtC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAsB,MAAM,kBAAkB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A4B,GACrI,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,qBAAqB,CAAC,eAAe,CAAC,CAAA;KAAE,CAAC;IAgB5E;;;OAGG;IACU,0BAA0B,CACrC,cAAc,EAAE,2BAA2B,CAAC,gBAAgB,EAAE,WAAW,CAAC,GAAG,0BAA0B,GAAG,4BAA4B,GACrI,OAAO,CAAC,eAAe,EAAE,CAAC;CAI9B"}
@@ -7,13 +7,16 @@
7
7
  */
8
8
  import { BeEvent, CompressedId64Set, OrderedId64Iterable } from "@itwin/core-bentley";
9
9
  import { IModelApp, IpcApp } from "@itwin/core-frontend";
10
- import { buildElementProperties, Content, ContentFlags, ContentFormatter, ContentPropertyValueFormatter, DefaultContentDisplayTypes, Descriptor, DisplayValueGroup, Item, Key, KeySet, KoqPropertyValueFormatter, Node, NodePathElement, PresentationIpcEvents, RpcRequestsHandler, RulesetVariable, SelectClassInfo, VariableValueTypes, } from "@itwin/presentation-common";
11
- import { IpcRequestsHandler } from "./IpcRequestsHandler";
12
- import { FrontendLocalizationHelper } from "./LocalizationHelper";
13
- import { RulesetManagerImpl } from "./RulesetManager";
14
- import { RulesetVariablesManagerImpl } from "./RulesetVariablesManager";
15
- import { StreamedResponseGenerator } from "./StreamedResponseGenerator";
10
+ import { Content, ContentFlags, DefaultContentDisplayTypes, Descriptor, Item, Key, KeySet, KoqPropertyValueFormatter, RulesetVariable, SelectClassInfo, VariableValueTypes, } from "@itwin/presentation-common";
11
+ import { buildElementProperties, ContentFormatter, ContentPropertyValueFormatter, PresentationIpcEvents, RpcRequestsHandler, } from "@itwin/presentation-common/internal";
16
12
  import { TRANSIENT_ELEMENT_CLASSNAME } from "@itwin/unified-selection";
13
+ import { IpcRequestsHandler } from "./IpcRequestsHandler.js";
14
+ import { FrontendLocalizationHelper } from "./LocalizationHelper.js";
15
+ import { RulesetManagerImpl } from "./RulesetManager.js";
16
+ import { RulesetVariablesManagerImpl } from "./RulesetVariablesManager.js";
17
+ import { StreamedResponseGenerator } from "./StreamedResponseGenerator.js";
18
+ import { ensureIModelInitialized, startIModelInitialization } from "./IModelConnectionInitialization.js";
19
+ import { _presentation_manager_ipcRequestsHandler, _presentation_manager_rpcRequestsHandler } from "./InternalSymbols.js";
17
20
  /**
18
21
  * Frontend Presentation manager which basically just forwards all calls to
19
22
  * the backend implementation.
@@ -21,6 +24,23 @@ import { TRANSIENT_ELEMENT_CLASSNAME } from "@itwin/unified-selection";
21
24
  * @public
22
25
  */
23
26
  export class PresentationManager {
27
+ _requestsHandler;
28
+ _rulesets;
29
+ _localizationHelper;
30
+ _explicitActiveUnitSystem;
31
+ _rulesetVars;
32
+ _clearEventListener;
33
+ _schemaContextProvider;
34
+ _defaultFormats;
35
+ _ipcRequestsHandler;
36
+ /**
37
+ * An event raised when hierarchies created using specific ruleset change
38
+ */
39
+ onIModelHierarchyChanged = new BeEvent();
40
+ /**
41
+ * An event raised when content created using specific ruleset changes
42
+ */
43
+ onIModelContentChanged = new BeEvent();
24
44
  /**
25
45
  * Get / set active unit system used to format property values with units.
26
46
  *
@@ -35,24 +55,13 @@ export class PresentationManager {
35
55
  this._explicitActiveUnitSystem = value;
36
56
  }
37
57
  constructor(props) {
38
- /**
39
- * An event raised when hierarchies created using specific ruleset change
40
- */
41
- this.onIModelHierarchyChanged = new BeEvent();
42
- /**
43
- * An event raised when content created using specific ruleset changes
44
- */
45
- this.onIModelContentChanged = new BeEvent();
46
- this.onUpdate = (_evt, report) => {
47
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
48
- this.handleUpdateAsync(report);
49
- };
50
58
  if (props) {
51
59
  // eslint-disable-next-line @typescript-eslint/no-deprecated
52
60
  this._explicitActiveUnitSystem = props.activeUnitSystem;
53
61
  }
54
62
  this._requestsHandler =
55
- props?.rpcRequestsHandler ?? new RpcRequestsHandler(props ? { clientId: props.clientId, timeout: props.requestTimeout } : undefined);
63
+ props?.rpcRequestsHandler ??
64
+ new RpcRequestsHandler(props ? { clientId: props.clientId, timeout: props.requestTimeout } : undefined);
56
65
  this._rulesetVars = new Map();
57
66
  this._rulesets = RulesetManagerImpl.create();
58
67
  this._localizationHelper = new FrontendLocalizationHelper(props?.activeLocale);
@@ -71,22 +80,31 @@ export class PresentationManager {
71
80
  set activeLocale(locale) {
72
81
  this._localizationHelper.locale = locale;
73
82
  }
74
- dispose() {
83
+ [Symbol.dispose]() {
75
84
  if (this._clearEventListener) {
76
85
  this._clearEventListener();
77
86
  this._clearEventListener = undefined;
78
87
  }
79
88
  }
89
+ /** @deprecated in 5.0 Use [Symbol.dispose] instead. */
90
+ /* c8 ignore next 3 */
91
+ dispose() {
92
+ this[Symbol.dispose]();
93
+ }
94
+ onUpdate = (_evt, report) => {
95
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
96
+ this.handleUpdateAsync(report);
97
+ };
80
98
  /** @note This is only called in native apps after changes in iModels */
81
99
  async handleUpdateAsync(report) {
82
100
  for (const imodelKey in report) {
83
- // istanbul ignore if
101
+ /* c8 ignore next 3 */
84
102
  if (!report.hasOwnProperty(imodelKey)) {
85
103
  continue;
86
104
  }
87
105
  const imodelReport = report[imodelKey];
88
106
  for (const rulesetId in imodelReport) {
89
- // istanbul ignore if
107
+ /* c8 ignore next 3 */
90
108
  if (!imodelReport.hasOwnProperty(rulesetId)) {
91
109
  continue;
92
110
  }
@@ -100,17 +118,6 @@ export class PresentationManager {
100
118
  }
101
119
  }
102
120
  }
103
- /**
104
- * Function that is called when a new IModelConnection is used to retrieve data.
105
- * @internal
106
- */
107
- startIModelInitialization(_) { }
108
- /**
109
- * Function that should be called to finish initialization that was started at [[PresentationManager.startIModelInitialization]].
110
- * Can be removed when [[FavoritePropertiesManager.has]] and [[FavoritePropertiesManager.sortFields]] are removed.
111
- * @internal
112
- */
113
- async ensureIModelInitialized(_) { }
114
121
  /**
115
122
  * Create a new PresentationManager instance
116
123
  * @param props Optional properties used to configure the manager
@@ -119,11 +126,11 @@ export class PresentationManager {
119
126
  return new PresentationManager(props);
120
127
  }
121
128
  /** @internal */
122
- get rpcRequestsHandler() {
129
+ get [_presentation_manager_rpcRequestsHandler]() {
123
130
  return this._requestsHandler;
124
131
  }
125
132
  /** @internal */
126
- get ipcRequestsHandler() {
133
+ get [_presentation_manager_ipcRequestsHandler]() {
127
134
  return this._ipcRequestsHandler;
128
135
  }
129
136
  /**
@@ -189,7 +196,7 @@ export class PresentationManager {
189
196
  }
190
197
  /** Returns an iterator that polls nodes asynchronously. */
191
198
  async getNodesIterator(requestOptions) {
192
- this.startIModelInitialization(requestOptions.imodel);
199
+ startIModelInitialization(requestOptions.imodel);
193
200
  const options = await this.addRulesetAndVariablesToOptions(requestOptions);
194
201
  const rpcOptions = this.toRpcTokenOptions({ ...options });
195
202
  const generator = new StreamedResponseGenerator({
@@ -198,8 +205,7 @@ export class PresentationManager {
198
205
  const result = await this._requestsHandler.getPagedNodes({ ...rpcOptions, paging });
199
206
  return {
200
207
  total: result.total,
201
- // eslint-disable-next-line @typescript-eslint/no-deprecated
202
- items: this._localizationHelper.getLocalizedNodes(result.items.map(Node.fromJSON)),
208
+ items: this._localizationHelper.getLocalizedNodes(result.items),
203
209
  };
204
210
  },
205
211
  });
@@ -215,7 +221,7 @@ export class PresentationManager {
215
221
  }
216
222
  /** Retrieves nodes count. */
217
223
  async getNodesCount(requestOptions) {
218
- this.startIModelInitialization(requestOptions.imodel);
224
+ startIModelInitialization(requestOptions.imodel);
219
225
  const options = await this.addRulesetAndVariablesToOptions(requestOptions);
220
226
  const rpcOptions = this.toRpcTokenOptions({ ...options });
221
227
  return this._requestsHandler.getNodesCount(rpcOptions);
@@ -236,7 +242,7 @@ export class PresentationManager {
236
242
  * @public
237
243
  */
238
244
  async getNodesDescriptor(requestOptions) {
239
- this.startIModelInitialization(requestOptions.imodel);
245
+ startIModelInitialization(requestOptions.imodel);
240
246
  try {
241
247
  const options = await this.addRulesetAndVariablesToOptions(requestOptions);
242
248
  const rpcOptions = this.toRpcTokenOptions({ ...options });
@@ -245,25 +251,23 @@ export class PresentationManager {
245
251
  return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;
246
252
  }
247
253
  finally {
248
- await this.ensureIModelInitialized(requestOptions.imodel);
254
+ await ensureIModelInitialized(requestOptions.imodel);
249
255
  }
250
256
  }
251
257
  /** Retrieves paths from root nodes to children nodes according to specified keys. Intersecting paths will be merged. */
252
258
  async getNodePaths(requestOptions) {
253
- this.startIModelInitialization(requestOptions.imodel);
259
+ startIModelInitialization(requestOptions.imodel);
254
260
  const options = await this.addRulesetAndVariablesToOptions(requestOptions);
255
261
  const rpcOptions = this.toRpcTokenOptions({ ...options });
256
262
  const result = await this._requestsHandler.getNodePaths(rpcOptions);
257
- // eslint-disable-next-line @typescript-eslint/no-deprecated
258
- return result.map(NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));
263
+ return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));
259
264
  }
260
265
  /** Retrieves paths from root nodes to nodes containing filter text in their label. */
261
266
  async getFilteredNodePaths(requestOptions) {
262
- this.startIModelInitialization(requestOptions.imodel);
267
+ startIModelInitialization(requestOptions.imodel);
263
268
  const options = await this.addRulesetAndVariablesToOptions(requestOptions);
264
269
  const result = await this._requestsHandler.getFilteredNodePaths(this.toRpcTokenOptions(options));
265
- // eslint-disable-next-line @typescript-eslint/no-deprecated
266
- return result.map(NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));
270
+ return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));
267
271
  }
268
272
  /**
269
273
  * Get information about the sources of content when building it for specific ECClasses. Sources involve classes of the primary select instance,
@@ -271,14 +275,14 @@ export class PresentationManager {
271
275
  * @public
272
276
  */
273
277
  async getContentSources(requestOptions) {
274
- this.startIModelInitialization(requestOptions.imodel);
278
+ startIModelInitialization(requestOptions.imodel);
275
279
  const rpcOptions = this.toRpcTokenOptions(requestOptions);
276
280
  const result = await this._requestsHandler.getContentSources(rpcOptions);
277
- return SelectClassInfo.listFromCompressedJSON(result.sources, result.classesMap);
281
+ return result.sources.map((sourceJson) => SelectClassInfo.fromCompressedJSON(sourceJson, result.classesMap));
278
282
  }
279
283
  /** Retrieves the content descriptor which describes the content and can be used to customize it. */
280
284
  async getContentDescriptor(requestOptions) {
281
- this.startIModelInitialization(requestOptions.imodel);
285
+ startIModelInitialization(requestOptions.imodel);
282
286
  try {
283
287
  const options = await this.addRulesetAndVariablesToOptions(requestOptions);
284
288
  const rpcOptions = this.toRpcTokenOptions({
@@ -290,12 +294,12 @@ export class PresentationManager {
290
294
  return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;
291
295
  }
292
296
  finally {
293
- await this.ensureIModelInitialized(requestOptions.imodel);
297
+ await ensureIModelInitialized(requestOptions.imodel);
294
298
  }
295
299
  }
296
300
  /** Retrieves overall content set size. */
297
301
  async getContentSetSize(requestOptions) {
298
- this.startIModelInitialization(requestOptions.imodel);
302
+ startIModelInitialization(requestOptions.imodel);
299
303
  const options = await this.addRulesetAndVariablesToOptions(requestOptions);
300
304
  const rpcOptions = this.toRpcTokenOptions({
301
305
  ...options,
@@ -329,7 +333,7 @@ export class PresentationManager {
329
333
  descriptor = Descriptor.fromJSON(firstPageResponse?.descriptor);
330
334
  firstPage = firstPageResponse?.contentSet;
331
335
  }
332
- // istanbul ignore if
336
+ /* c8 ignore next 3 */
333
337
  if (!descriptor) {
334
338
  return undefined;
335
339
  }
@@ -358,12 +362,12 @@ export class PresentationManager {
358
362
  }
359
363
  /** Retrieves a content descriptor, item count and async generator for the items themselves. */
360
364
  async getContentIterator(requestOptions) {
361
- this.startIModelInitialization(requestOptions.imodel);
365
+ startIModelInitialization(requestOptions.imodel);
362
366
  const response = await this.getContentIteratorInternal(requestOptions);
363
367
  if (!response) {
364
368
  return undefined;
365
369
  }
366
- await this.ensureIModelInitialized(requestOptions.imodel);
370
+ await ensureIModelInitialized(requestOptions.imodel);
367
371
  return response;
368
372
  }
369
373
  /**
@@ -392,7 +396,7 @@ export class PresentationManager {
392
396
  }
393
397
  /** Returns an iterator that asynchronously polls distinct values of specific field from the content. */
394
398
  async getDistinctValuesIterator(requestOptions) {
395
- this.startIModelInitialization(requestOptions.imodel);
399
+ startIModelInitialization(requestOptions.imodel);
396
400
  const options = await this.addRulesetAndVariablesToOptions(requestOptions);
397
401
  const rpcOptions = {
398
402
  ...this.toRpcTokenOptions(options),
@@ -405,8 +409,7 @@ export class PresentationManager {
405
409
  const response = await this._requestsHandler.getPagedDistinctValues({ ...rpcOptions, paging });
406
410
  return {
407
411
  total: response.total,
408
- // eslint-disable-next-line @typescript-eslint/no-deprecated
409
- items: response.items.map((x) => this._localizationHelper.getLocalizedDisplayValueGroup(DisplayValueGroup.fromJSON(x))),
412
+ items: response.items.map((x) => this._localizationHelper.getLocalizedDisplayValueGroup(x)),
410
413
  };
411
414
  },
412
415
  });
@@ -428,7 +431,7 @@ export class PresentationManager {
428
431
  * @public
429
432
  */
430
433
  async getElementProperties(requestOptions) {
431
- this.startIModelInitialization(requestOptions.imodel);
434
+ startIModelInitialization(requestOptions.imodel);
432
435
  const { elementId, contentParser, ...optionsNoElementId } = requestOptions;
433
436
  const parser = contentParser ?? buildElementProperties;
434
437
  const iter = await this.getContentIterator({
@@ -450,7 +453,7 @@ export class PresentationManager {
450
453
  * @public
451
454
  */
452
455
  async getContentInstanceKeys(requestOptions) {
453
- this.startIModelInitialization(requestOptions.imodel);
456
+ startIModelInitialization(requestOptions.imodel);
454
457
  const options = await this.addRulesetAndVariablesToOptions(requestOptions);
455
458
  const rpcOptions = {
456
459
  ...this.toRpcTokenOptions(options),
@@ -481,14 +484,14 @@ export class PresentationManager {
481
484
  }
482
485
  /** Retrieves display label definition of specific item. */
483
486
  async getDisplayLabelDefinition(requestOptions) {
484
- this.startIModelInitialization(requestOptions.imodel);
487
+ startIModelInitialization(requestOptions.imodel);
485
488
  const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });
486
489
  const result = await this._requestsHandler.getDisplayLabelDefinition(rpcOptions);
487
490
  return this._localizationHelper.getLocalizedLabelDefinition(result);
488
491
  }
489
492
  /** Retrieves display label definition of specific items. */
490
493
  async getDisplayLabelDefinitionsIterator(requestOptions) {
491
- this.startIModelInitialization(requestOptions.imodel);
494
+ startIModelInitialization(requestOptions.imodel);
492
495
  const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });
493
496
  const generator = new StreamedResponseGenerator({
494
497
  ...requestOptions,
@@ -524,7 +527,7 @@ const stripTransientElementKeys = (keys) => {
524
527
  copy.add(keys, (key) => {
525
528
  // the callback is not going to be called with EntityProps as KeySet converts them
526
529
  // to InstanceKeys, but we want to keep the EntityProps case for correctness
527
- // istanbul ignore next
530
+ /* c8 ignore next 3 */
528
531
  const isTransient = (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) ||
529
532
  (Key.isEntityProps(key) && key.classFullName === TRANSIENT_ELEMENT_CLASSNAME);
530
533
  return !isTransient;
@@ -1 +1 @@
1
- {"version":3,"file":"PresentationManager.js","sourceRoot":"","sources":["../../../src/presentation-frontend/PresentationManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAe,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAE,SAAS,EAAoB,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG3E,OAAO,EACL,sBAAsB,EAEtB,OAAO,EAEP,YAAY,EACZ,gBAAgB,EAEhB,6BAA6B,EAI7B,0BAA0B,EAC1B,UAAU,EAIV,iBAAiB,EAUjB,IAAI,EAEJ,GAAG,EACH,MAAM,EACN,yBAAyB,EAEzB,IAAI,EAEJ,eAAe,EAIf,qBAAqB,EACrB,kBAAkB,EAElB,eAAe,EACf,eAAe,EAGf,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sB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CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,2BAA2B,CAAC,EAAE,CAAC;QACjG,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;IAC1B,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;QACrB,kFAAkF;QAClF,4EAA4E;QAC5E,uBAAuB;QACvB,MAAM,WAAW,GACf,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,2BAA2B,CAAC;YACzE,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,aAAa,KAAK,2BAA2B,CAAC,CAAC;QAChF,OAAO,CAAC,WAAW,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,KAAK,UAAU,OAAO,CAAI,IAAsB;IAC9C,MAAM,MAAM,GAAG,IAAI,KAAK,EAAK,CAAC;IAC9B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { BeEvent, CompressedId64Set, IDisposable, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\nimport { IModelApp, IModelConnection, IpcApp } from \"@itwin/core-frontend\";\r\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\r\nimport { SchemaContext } from \"@itwin/ecschema-metadata\";\r\nimport {\r\n buildElementProperties,\r\n ClientDiagnosticsAttribute,\r\n Content,\r\n ContentDescriptorRequestOptions,\r\n ContentFlags,\r\n ContentFormatter,\r\n ContentInstanceKeysRequestOptions,\r\n ContentPropertyValueFormatter,\r\n ContentRequestOptions,\r\n ContentSourcesRequestOptions,\r\n ContentUpdateInfo,\r\n DefaultContentDisplayTypes,\r\n Descriptor,\r\n DescriptorOverrides,\r\n DisplayLabelRequestOptions,\r\n DisplayLabelsRequestOptions,\r\n DisplayValueGroup,\r\n DistinctValuesRequestOptions,\r\n ElementProperties,\r\n FilterByInstancePathsHierarchyRequestOptions,\r\n FilterByTextHierarchyRequestOptions,\r\n FormatsMap,\r\n HierarchyLevelDescriptorRequestOptions,\r\n HierarchyRequestOptions,\r\n HierarchyUpdateInfo,\r\n InstanceKey,\r\n Item,\r\n ItemJSON,\r\n Key,\r\n KeySet,\r\n KoqPropertyValueFormatter,\r\n LabelDefinition,\r\n Node,\r\n NodeKey,\r\n NodePathElement,\r\n Paged,\r\n PagedResponse,\r\n PageOptions,\r\n PresentationIpcEvents,\r\n RpcRequestsHandler,\r\n Ruleset,\r\n RulesetVariable,\r\n SelectClassInfo,\r\n SingleElementPropertiesRequestOptions,\r\n UpdateInfo,\r\n VariableValueTypes,\r\n} from \"@itwin/presentation-common\";\r\nimport { IpcRequestsHandler } from \"./IpcRequestsHandler\";\r\nimport { FrontendLocalizationHelper } from \"./LocalizationHelper\";\r\nimport { RulesetManager, RulesetManagerImpl } from \"./RulesetManager\";\r\nimport { RulesetVariablesManager, RulesetVariablesManagerImpl } from \"./RulesetVariablesManager\";\r\nimport { StreamedResponseGenerator } from \"./StreamedResponseGenerator\";\r\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"@itwin/unified-selection\";\r\n\r\n/**\r\n * Data structure that describes IModel hierarchy change event arguments.\r\n * @public\r\n */\r\nexport interface IModelHierarchyChangeEventArgs {\r\n /** Id of ruleset that was used to create hierarchy. */\r\n rulesetId: string;\r\n /** Hierarchy changes info. */\r\n updateInfo: HierarchyUpdateInfo;\r\n /** Key of iModel that was used to create hierarchy. It matches [[IModelConnection.key]] property. */\r\n imodelKey: string;\r\n}\r\n\r\n/**\r\n * Data structure that describes iModel content change event arguments.\r\n * @public\r\n */\r\nexport interface IModelContentChangeEventArgs {\r\n /** Id of ruleset that was used to create content. */\r\n rulesetId: string;\r\n /** Content changes info. */\r\n updateInfo: ContentUpdateInfo;\r\n /** Key of iModel that was used to create content. It matches [[IModelConnection.key]] property. */\r\n imodelKey: string;\r\n}\r\n\r\n/**\r\n * Options for requests that can return multiple pages of items concurrently.\r\n * @public\r\n */\r\nexport type MultipleValuesRequestOptions = Paged<{\r\n /**\r\n * Max number of requests that should be made to the backend to fulfill the whole request.\r\n * `undefined` means no limit, so in that case all requests are sent at once.\r\n */\r\n maxParallelRequests?: number;\r\n\r\n /**\r\n * Size of a single batch when fetching data through multiple requests. If not set,\r\n * the fall back is requested page size. If the page size is not set, the backend\r\n * decides how many items to return.\r\n */\r\n batchSize?: number;\r\n}>;\r\n\r\n/**\r\n * Options for requests that retrieve nodes.\r\n * @public\r\n */\r\nexport type GetNodesRequestOptions = HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute;\r\n\r\n/**\r\n * Options for requests that retrieve content.\r\n * @public\r\n */\r\nexport type GetContentRequestOptions = ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> &\r\n ClientDiagnosticsAttribute;\r\n\r\n/**\r\n * Options for requests that retrieve distinct values.\r\n * @public\r\n */\r\nexport type GetDistinctValuesRequestOptions = DistinctValuesRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> &\r\n ClientDiagnosticsAttribute;\r\n\r\n/**\r\n * Properties used to configure [[PresentationManager]]\r\n * @public\r\n */\r\nexport interface PresentationManagerProps {\r\n /**\r\n * Sets the active locale to use when localizing presentation-related\r\n * strings. It can later be changed through [[PresentationManager]].\r\n */\r\n activeLocale?: string;\r\n\r\n /**\r\n * Sets the active unit system to use for formatting property values with\r\n * units. The value can later be changed through [[PresentationManager.activeUnitSystem]] setter or\r\n * overriden for each request through request parameters. If not set, `IModelApp.quantityFormatter.activeUnitSystem`\r\n * is used by default.\r\n *\r\n * @deprecated in 4.0. Use [IModelApp.quantityFormatter]($core-frontend) to set the active unit system.\r\n */\r\n activeUnitSystem?: UnitSystemKey;\r\n\r\n /**\r\n * ID used to identify client that requests data. Generally, clients should\r\n * store this ID in their local storage so the ID can be reused across\r\n * sessions - this allows reusing some caches.\r\n *\r\n * Defaults to a unique GUID as a client id.\r\n */\r\n clientId?: string;\r\n\r\n /**\r\n * Timeout (in milliseconds) for how long we're going to wait for RPC request to be fulfilled before throwing\r\n * a timeout error.\r\n *\r\n * Defaults to 10 minutes.\r\n */\r\n requestTimeout?: number;\r\n\r\n /**\r\n * Callback that provides [SchemaContext]($ecschema-metadata) for supplied [IModelConnection]($core-frontend).\r\n * [SchemaContext]($ecschema-metadata) is used for getting metadata required for values formatting.\r\n */\r\n schemaContextProvider?: (imodel: IModelConnection) => SchemaContext;\r\n\r\n /**\r\n * A map of default unit formats to use for formatting properties that don't have a presentation format\r\n * in requested unit system.\r\n *\r\n * @note Only has effect when frontend value formatting is enabled by supplying the `schemaContextProvider` prop.\r\n */\r\n defaultFormats?: FormatsMap;\r\n\r\n /** @internal */\r\n rpcRequestsHandler?: RpcRequestsHandler;\r\n\r\n /** @internal */\r\n ipcRequestsHandler?: IpcRequestsHandler;\r\n}\r\n\r\n/**\r\n * Frontend Presentation manager which basically just forwards all calls to\r\n * the backend implementation.\r\n *\r\n * @public\r\n */\r\nexport class PresentationManager implements IDisposable {\r\n private _requestsHandler: RpcRequestsHandler;\r\n private _rulesets: RulesetManager;\r\n private _localizationHelper: FrontendLocalizationHelper;\r\n private _explicitActiveUnitSystem: UnitSystemKey | undefined;\r\n private _rulesetVars: Map<string, RulesetVariablesManager>;\r\n private _clearEventListener?: () => void;\r\n private _schemaContextProvider?: (imodel: IModelConnection) => SchemaContext;\r\n private _defaultFormats?: FormatsMap;\r\n private _ipcRequestsHandler?: IpcRequestsHandler;\r\n\r\n /**\r\n * An event raised when hierarchies created using specific ruleset change\r\n */\r\n public onIModelHierarchyChanged = new BeEvent<(args: IModelHierarchyChangeEventArgs) => void>();\r\n\r\n /**\r\n * An event raised when content created using specific ruleset changes\r\n */\r\n public onIModelContentChanged = new BeEvent<(args: IModelContentChangeEventArgs) => void>();\r\n\r\n /**\r\n * Get / set active unit system used to format property values with units.\r\n *\r\n * @deprecated in 4.0. `IModelApp.quantityFormatter` should be used to get/set the active unit system. At the moment\r\n * [[PresentationManager]] allows overriding it, but returns `IModelApp.quantityFormatter.activeUnitSystem` if override\r\n * is not set.\r\n */\r\n public get activeUnitSystem(): UnitSystemKey {\r\n return this._explicitActiveUnitSystem ?? IModelApp.quantityFormatter.activeUnitSystem;\r\n }\r\n public set activeUnitSystem(value: UnitSystemKey | undefined) {\r\n this._explicitActiveUnitSystem = value;\r\n }\r\n\r\n private constructor(props?: PresentationManagerProps) {\r\n if (props) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this._explicitActiveUnitSystem = props.activeUnitSystem;\r\n }\r\n\r\n this._requestsHandler =\r\n props?.rpcRequestsHandler ?? new RpcRequestsHandler(props ? { clientId: props.clientId, timeout: props.requestTimeout } : undefined);\r\n this._rulesetVars = new Map<string, RulesetVariablesManager>();\r\n this._rulesets = RulesetManagerImpl.create();\r\n this._localizationHelper = new FrontendLocalizationHelper(props?.activeLocale);\r\n this._schemaContextProvider = props?.schemaContextProvider;\r\n this._defaultFormats = props?.defaultFormats;\r\n\r\n if (IpcApp.isValid) {\r\n // Ipc only works in ipc apps, so the `onUpdate` callback will only be called there.\r\n this._clearEventListener = IpcApp.addListener(PresentationIpcEvents.Update, this.onUpdate);\r\n this._ipcRequestsHandler = props?.ipcRequestsHandler ?? new IpcRequestsHandler(this._requestsHandler.clientId);\r\n }\r\n }\r\n\r\n /** Get / set active locale used for localizing presentation data */\r\n public get activeLocale(): string | undefined {\r\n return this._localizationHelper.locale;\r\n }\r\n public set activeLocale(locale: string | undefined) {\r\n this._localizationHelper.locale = locale;\r\n }\r\n\r\n public dispose() {\r\n if (this._clearEventListener) {\r\n this._clearEventListener();\r\n this._clearEventListener = undefined;\r\n }\r\n }\r\n\r\n private onUpdate = (_evt: Event, report: UpdateInfo) => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.handleUpdateAsync(report);\r\n };\r\n\r\n /** @note This is only called in native apps after changes in iModels */\r\n private async handleUpdateAsync(report: UpdateInfo) {\r\n for (const imodelKey in report) {\r\n // istanbul ignore if\r\n if (!report.hasOwnProperty(imodelKey)) {\r\n continue;\r\n }\r\n\r\n const imodelReport = report[imodelKey];\r\n for (const rulesetId in imodelReport) {\r\n // istanbul ignore if\r\n if (!imodelReport.hasOwnProperty(rulesetId)) {\r\n continue;\r\n }\r\n\r\n const updateInfo = imodelReport[rulesetId];\r\n if (updateInfo.content) {\r\n this.onIModelContentChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.content, imodelKey });\r\n }\r\n if (updateInfo.hierarchy) {\r\n this.onIModelHierarchyChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.hierarchy, imodelKey });\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Function that is called when a new IModelConnection is used to retrieve data.\r\n * @internal\r\n */\r\n public startIModelInitialization(_: IModelConnection) {}\r\n\r\n /**\r\n * Function that should be called to finish initialization that was started at [[PresentationManager.startIModelInitialization]].\r\n * Can be removed when [[FavoritePropertiesManager.has]] and [[FavoritePropertiesManager.sortFields]] are removed.\r\n * @internal\r\n */\r\n public async ensureIModelInitialized(_: IModelConnection) {}\r\n\r\n /**\r\n * Create a new PresentationManager instance\r\n * @param props Optional properties used to configure the manager\r\n */\r\n public static create(props?: PresentationManagerProps) {\r\n return new PresentationManager(props);\r\n }\r\n\r\n /** @internal */\r\n public get rpcRequestsHandler() {\r\n return this._requestsHandler;\r\n }\r\n\r\n /** @internal */\r\n public get ipcRequestsHandler() {\r\n return this._ipcRequestsHandler;\r\n }\r\n\r\n /**\r\n * Get rulesets manager\r\n */\r\n public rulesets() {\r\n return this._rulesets;\r\n }\r\n\r\n /**\r\n * Get ruleset variables manager for specific ruleset\r\n * @param rulesetId Id of the ruleset to get the vars manager for\r\n */\r\n public vars(rulesetId: string) {\r\n if (!this._rulesetVars.has(rulesetId)) {\r\n const varsManager = new RulesetVariablesManagerImpl(rulesetId, this._ipcRequestsHandler);\r\n this._rulesetVars.set(rulesetId, varsManager);\r\n }\r\n return this._rulesetVars.get(rulesetId)!;\r\n }\r\n\r\n private toRpcTokenOptions<TOptions extends { imodel: IModelConnection; locale?: string; unitSystem?: UnitSystemKey; rulesetVariables?: RulesetVariable[] }>(\r\n requestOptions: TOptions,\r\n ) {\r\n // 1. put default `locale` and `unitSystem`\r\n // 2. put all `requestOptions` members (if `locale` or `unitSystem` are set, they'll override the defaults put at #1)\r\n // 3. put `imodel` of type `IModelRpcProps` which overwrites the `imodel` from `requestOptions` put at #2\r\n const defaultOptions: Pick<TOptions, \"locale\" | \"unitSystem\"> = {};\r\n if (this.activeLocale) {\r\n defaultOptions.locale = this.activeLocale;\r\n }\r\n defaultOptions.unitSystem = this.activeUnitSystem; // eslint-disable-line @typescript-eslint/no-deprecated\r\n\r\n const { imodel, rulesetVariables, ...rpcRequestOptions } = requestOptions;\r\n return {\r\n ...defaultOptions,\r\n ...rpcRequestOptions,\r\n ...(rulesetVariables ? { rulesetVariables: rulesetVariables.map(RulesetVariable.toJSON) } : {}),\r\n imodel: imodel.getRpcProps(),\r\n };\r\n }\r\n\r\n private async addRulesetAndVariablesToOptions<TOptions extends { rulesetOrId: Ruleset | string; rulesetVariables?: RulesetVariable[] }>(options: TOptions) {\r\n const { rulesetOrId, rulesetVariables } = options;\r\n let foundRulesetOrId: Ruleset | string;\r\n if (typeof rulesetOrId === \"object\") {\r\n foundRulesetOrId = rulesetOrId;\r\n } else {\r\n const foundRuleset = await this._rulesets.get(rulesetOrId);\r\n foundRulesetOrId = foundRuleset ? foundRuleset.toJSON() : rulesetOrId;\r\n }\r\n const rulesetId = typeof foundRulesetOrId === \"object\" ? foundRulesetOrId.id : foundRulesetOrId;\r\n\r\n // All Id64Array variable values must be sorted for serialization to JSON to work. RulesetVariablesManager\r\n // sorts them before storing, so that part is taken care of, but we need to ensure that variables coming from\r\n // request options are also sorted.\r\n const variables = (rulesetVariables ?? []).map((variable) => {\r\n if (variable.type === VariableValueTypes.Id64Array) {\r\n return { ...variable, value: OrderedId64Iterable.sortArray(variable.value) };\r\n }\r\n return variable;\r\n });\r\n if (!this._ipcRequestsHandler) {\r\n // only need to add variables from variables manager if there's no IPC\r\n // handler - if there is one, the variables are already known by the backend\r\n variables.push(...this.vars(rulesetId).getAllVariables());\r\n }\r\n\r\n return { ...options, rulesetOrId: foundRulesetOrId, rulesetVariables: variables };\r\n }\r\n\r\n /** Returns an iterator that polls nodes asynchronously. */\r\n public async getNodesIterator(\r\n requestOptions: GetNodesRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<{ total: number; items: AsyncIterableIterator<Node> }> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n\r\n const generator = new StreamedResponseGenerator({\r\n ...requestOptions,\r\n getBatch: async (paging) => {\r\n const result = await this._requestsHandler.getPagedNodes({ ...rpcOptions, paging });\r\n return {\r\n total: result.total,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n items: this._localizationHelper.getLocalizedNodes(result.items.map(Node.fromJSON)),\r\n };\r\n },\r\n });\r\n\r\n return generator.createAsyncIteratorResponse();\r\n }\r\n\r\n /**\r\n * Retrieves nodes\r\n * @deprecated in 4.5. Use [[getNodesIterator]] instead.\r\n */\r\n public async getNodes(requestOptions: GetNodesRequestOptions & MultipleValuesRequestOptions): Promise<Node[]> {\r\n const result = await this.getNodesIterator(requestOptions);\r\n return collect(result.items);\r\n }\r\n\r\n /** Retrieves nodes count. */\r\n public async getNodesCount(requestOptions: GetNodesRequestOptions): Promise<number> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n return this._requestsHandler.getNodesCount(rpcOptions);\r\n }\r\n\r\n /**\r\n * Retrieves total nodes count and a single page of nodes.\r\n * @deprecated in 4.5. Use [[getNodesIterator]] instead.\r\n */\r\n public async getNodesAndCount(requestOptions: GetNodesRequestOptions & MultipleValuesRequestOptions): Promise<{ count: number; nodes: Node[] }> {\r\n const result = await this.getNodesIterator(requestOptions);\r\n return {\r\n count: result.total,\r\n nodes: await collect(result.items),\r\n };\r\n }\r\n\r\n /**\r\n * Retrieves hierarchy level descriptor.\r\n * @public\r\n */\r\n public async getNodesDescriptor(\r\n requestOptions: HierarchyLevelDescriptorRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<Descriptor | undefined> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n try {\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n const result = await this._requestsHandler.getNodesDescriptor(rpcOptions);\r\n const descriptor = Descriptor.fromJSON(result);\r\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\r\n } finally {\r\n await this.ensureIModelInitialized(requestOptions.imodel);\r\n }\r\n }\r\n\r\n /** Retrieves paths from root nodes to children nodes according to specified keys. Intersecting paths will be merged. */\r\n public async getNodePaths(\r\n requestOptions: FilterByInstancePathsHierarchyRequestOptions<IModelConnection, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<NodePathElement[]> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n const result = await this._requestsHandler.getNodePaths(rpcOptions);\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return result.map(NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\r\n }\r\n\r\n /** Retrieves paths from root nodes to nodes containing filter text in their label. */\r\n public async getFilteredNodePaths(\r\n requestOptions: FilterByTextHierarchyRequestOptions<IModelConnection, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<NodePathElement[]> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const result = await this._requestsHandler.getFilteredNodePaths(this.toRpcTokenOptions(options));\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return result.map(NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\r\n }\r\n\r\n /**\r\n * Get information about the sources of content when building it for specific ECClasses. Sources involve classes of the primary select instance,\r\n * its related instances for loading related and navigation properties.\r\n * @public\r\n */\r\n public async getContentSources(requestOptions: ContentSourcesRequestOptions<IModelConnection> & ClientDiagnosticsAttribute): Promise<SelectClassInfo[]> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n const rpcOptions = this.toRpcTokenOptions(requestOptions);\r\n const result = await this._requestsHandler.getContentSources(rpcOptions);\r\n return SelectClassInfo.listFromCompressedJSON(result.sources, result.classesMap);\r\n }\r\n\r\n /** Retrieves the content descriptor which describes the content and can be used to customize it. */\r\n public async getContentDescriptor(\r\n requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<Descriptor | undefined> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n try {\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({\r\n ...options,\r\n keys: stripTransientElementKeys(options.keys).toJSON(),\r\n });\r\n const result = await this._requestsHandler.getContentDescriptor(rpcOptions);\r\n const descriptor = Descriptor.fromJSON(result);\r\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\r\n } finally {\r\n await this.ensureIModelInitialized(requestOptions.imodel);\r\n }\r\n }\r\n\r\n /** Retrieves overall content set size. */\r\n public async getContentSetSize(requestOptions: GetContentRequestOptions): Promise<number> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({\r\n ...options,\r\n descriptor: getDescriptorOverrides(requestOptions.descriptor),\r\n keys: stripTransientElementKeys(requestOptions.keys).toJSON(),\r\n });\r\n return this._requestsHandler.getContentSetSize(rpcOptions);\r\n }\r\n\r\n private async getContentIteratorInternal(\r\n requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<{ descriptor: Descriptor; total: number; items: AsyncIterableIterator<Item> } | undefined> {\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const firstPageSize = options.batchSize ?? requestOptions.paging?.size;\r\n const rpcOptions = this.toRpcTokenOptions({\r\n ...options,\r\n descriptor: getDescriptorOverrides(requestOptions.descriptor),\r\n keys: stripTransientElementKeys(requestOptions.keys).toJSON(),\r\n ...(firstPageSize ? { paging: { ...requestOptions.paging, size: firstPageSize } } : undefined),\r\n ...(!requestOptions.omitFormattedValues && this._schemaContextProvider !== undefined ? { omitFormattedValues: true } : undefined),\r\n });\r\n\r\n let contentFormatter: ContentFormatter | undefined;\r\n if (!requestOptions.omitFormattedValues && this._schemaContextProvider) {\r\n const koqPropertyFormatter = new KoqPropertyValueFormatter(this._schemaContextProvider(requestOptions.imodel), this._defaultFormats);\r\n contentFormatter = new ContentFormatter(\r\n new ContentPropertyValueFormatter(koqPropertyFormatter),\r\n requestOptions.unitSystem ?? this._explicitActiveUnitSystem ?? IModelApp.quantityFormatter.activeUnitSystem,\r\n );\r\n }\r\n\r\n let descriptor = requestOptions.descriptor instanceof Descriptor ? requestOptions.descriptor : undefined;\r\n let firstPage: PagedResponse<ItemJSON> | undefined;\r\n if (!descriptor) {\r\n const firstPageResponse = await this._requestsHandler.getPagedContent(rpcOptions);\r\n if (!firstPageResponse?.descriptor || !firstPageResponse.contentSet) {\r\n return undefined;\r\n }\r\n descriptor = Descriptor.fromJSON(firstPageResponse?.descriptor);\r\n firstPage = firstPageResponse?.contentSet;\r\n }\r\n\r\n // istanbul ignore if\r\n if (!descriptor) {\r\n return undefined;\r\n }\r\n\r\n descriptor = this._localizationHelper.getLocalizedContentDescriptor(descriptor);\r\n\r\n const getPage = async (paging: Required<PageOptions>, requestIndex: number) => {\r\n let contentSet = requestIndex === 0 ? firstPage : undefined;\r\n contentSet ??= await this._requestsHandler.getPagedContentSet({ ...rpcOptions, paging });\r\n\r\n let items = contentSet.items.map((x) => Item.fromJSON(x)).filter((x): x is Item => x !== undefined);\r\n if (contentFormatter) {\r\n items = await contentFormatter.formatContentItems(items, descriptor);\r\n }\r\n\r\n items = this._localizationHelper.getLocalizedContentItems(items);\r\n return {\r\n total: contentSet.total,\r\n items,\r\n };\r\n };\r\n\r\n const generator = new StreamedResponseGenerator({\r\n ...requestOptions,\r\n getBatch: getPage,\r\n });\r\n\r\n return {\r\n ...(await generator.createAsyncIteratorResponse()),\r\n descriptor,\r\n };\r\n }\r\n\r\n /** Retrieves a content descriptor, item count and async generator for the items themselves. */\r\n public async getContentIterator(\r\n requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<{ descriptor: Descriptor; total: number; items: AsyncIterableIterator<Item> } | undefined> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n const response = await this.getContentIteratorInternal(requestOptions);\r\n if (!response) {\r\n return undefined;\r\n }\r\n\r\n await this.ensureIModelInitialized(requestOptions.imodel);\r\n return response;\r\n }\r\n\r\n /**\r\n * Retrieves content which consists of a content descriptor and a page of records.\r\n * @deprecated in 4.5. Use [[getContentIterator]] instead.\r\n */\r\n public async getContent(requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions): Promise<Content | undefined> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return (await this.getContentAndSize(requestOptions))?.content;\r\n }\r\n\r\n /**\r\n * Retrieves content set size and content which consists of a content descriptor and a page of records.\r\n * @deprecated in 4.5. Use [[getContentIterator]] instead.\r\n */\r\n public async getContentAndSize(\r\n requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<{ content: Content; size: number } | undefined> {\r\n const response = await this.getContentIterator(requestOptions);\r\n if (!response) {\r\n return undefined;\r\n }\r\n\r\n const { descriptor, total } = response;\r\n const items = await collect(response.items);\r\n return {\r\n content: new Content(descriptor, items),\r\n size: total,\r\n };\r\n }\r\n\r\n /** Returns an iterator that asynchronously polls distinct values of specific field from the content. */\r\n public async getDistinctValuesIterator(\r\n requestOptions: GetDistinctValuesRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<{ total: number; items: AsyncIterableIterator<DisplayValueGroup> }> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = {\r\n ...this.toRpcTokenOptions(options),\r\n descriptor: getDescriptorOverrides(options.descriptor),\r\n keys: stripTransientElementKeys(options.keys).toJSON(),\r\n };\r\n\r\n const generator = new StreamedResponseGenerator({\r\n ...requestOptions,\r\n getBatch: async (paging) => {\r\n const response = await this._requestsHandler.getPagedDistinctValues({ ...rpcOptions, paging });\r\n return {\r\n total: response.total,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n items: response.items.map((x) => this._localizationHelper.getLocalizedDisplayValueGroup(DisplayValueGroup.fromJSON(x))),\r\n };\r\n },\r\n });\r\n\r\n return generator.createAsyncIteratorResponse();\r\n }\r\n\r\n /**\r\n * Retrieves distinct values of specific field from the content.\r\n * @deprecated in 4.5. Use [[getDistinctValuesIterator]] instead.\r\n */\r\n public async getPagedDistinctValues(\r\n requestOptions: GetDistinctValuesRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<PagedResponse<DisplayValueGroup>> {\r\n const result = await this.getDistinctValuesIterator(requestOptions);\r\n return {\r\n total: result.total,\r\n items: await collect(result.items),\r\n };\r\n }\r\n\r\n /**\r\n * Retrieves property data in a simplified format for a single element specified by ID.\r\n * @public\r\n */\r\n public async getElementProperties<TParsedContent = ElementProperties>(\r\n requestOptions: SingleElementPropertiesRequestOptions<IModelConnection, TParsedContent> & ClientDiagnosticsAttribute,\r\n ): Promise<TParsedContent | undefined> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n type TParser = Required<typeof requestOptions>[\"contentParser\"];\r\n const { elementId, contentParser, ...optionsNoElementId } = requestOptions;\r\n const parser: TParser = contentParser ?? (buildElementProperties as TParser);\r\n const iter = await this.getContentIterator({\r\n ...optionsNoElementId,\r\n descriptor: {\r\n displayType: DefaultContentDisplayTypes.PropertyPane,\r\n contentFlags: ContentFlags.ShowLabels,\r\n },\r\n rulesetOrId: \"ElementProperties\",\r\n keys: new KeySet([{ className: \"BisCore:Element\", id: elementId }]),\r\n });\r\n if (!iter || iter.total === 0) {\r\n return undefined;\r\n }\r\n return parser(iter.descriptor, (await iter.items.next()).value);\r\n }\r\n\r\n /**\r\n * Retrieves content item instance keys.\r\n * @public\r\n */\r\n public async getContentInstanceKeys(\r\n requestOptions: ContentInstanceKeysRequestOptions<IModelConnection, KeySet, RulesetVariable> & ClientDiagnosticsAttribute & MultipleValuesRequestOptions,\r\n ): Promise<{ total: number; items: () => AsyncGenerator<InstanceKey> }> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = {\r\n ...this.toRpcTokenOptions(options),\r\n keys: stripTransientElementKeys(options.keys).toJSON(),\r\n };\r\n\r\n const generator = new StreamedResponseGenerator({\r\n ...requestOptions,\r\n getBatch: async (page) => {\r\n const keys = await this._requestsHandler.getContentInstanceKeys({ ...rpcOptions, paging: page });\r\n return {\r\n total: keys.total,\r\n items: keys.items.instanceKeys.reduce((instanceKeys, entry) => {\r\n for (const id of CompressedId64Set.iterable(entry[1])) {\r\n instanceKeys.push({ className: entry[0], id });\r\n }\r\n return instanceKeys;\r\n }, new Array<InstanceKey>()),\r\n };\r\n },\r\n });\r\n\r\n const { total, items } = await generator.createAsyncIteratorResponse();\r\n return {\r\n total,\r\n async *items() {\r\n yield* items;\r\n },\r\n };\r\n }\r\n\r\n /** Retrieves display label definition of specific item. */\r\n public async getDisplayLabelDefinition(\r\n requestOptions: DisplayLabelRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute,\r\n ): Promise<LabelDefinition> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });\r\n const result = await this._requestsHandler.getDisplayLabelDefinition(rpcOptions);\r\n return this._localizationHelper.getLocalizedLabelDefinition(result);\r\n }\r\n\r\n /** Retrieves display label definition of specific items. */\r\n public async getDisplayLabelDefinitionsIterator(\r\n requestOptions: DisplayLabelsRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute & MultipleValuesRequestOptions,\r\n ): Promise<{ total: number; items: AsyncIterableIterator<LabelDefinition> }> {\r\n this.startIModelInitialization(requestOptions.imodel);\r\n const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });\r\n const generator = new StreamedResponseGenerator({\r\n ...requestOptions,\r\n getBatch: async (page) => {\r\n const partialKeys = !page.start ? rpcOptions.keys : rpcOptions.keys.slice(page.start);\r\n const result = await this._requestsHandler.getPagedDisplayLabelDefinitions({ ...rpcOptions, keys: partialKeys });\r\n result.items = this._localizationHelper.getLocalizedLabelDefinitions(result.items);\r\n return result;\r\n },\r\n });\r\n\r\n return generator.createAsyncIteratorResponse();\r\n }\r\n\r\n /**\r\n * Retrieves display label definition of specific items.\r\n * @deprecated in 4.5. Use [[getDisplayLabelDefinitionsIterator]] instead.\r\n */\r\n public async getDisplayLabelDefinitions(\r\n requestOptions: DisplayLabelsRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute & MultipleValuesRequestOptions,\r\n ): Promise<LabelDefinition[]> {\r\n const { items } = await this.getDisplayLabelDefinitionsIterator(requestOptions);\r\n return collect(items);\r\n }\r\n}\r\n\r\nconst getDescriptorOverrides = (descriptorOrOverrides: Descriptor | DescriptorOverrides): DescriptorOverrides => {\r\n if (descriptorOrOverrides instanceof Descriptor) {\r\n return descriptorOrOverrides.createDescriptorOverrides();\r\n }\r\n return descriptorOrOverrides;\r\n};\r\n\r\nconst stripTransientElementKeys = (keys: KeySet) => {\r\n if (!keys.some((key) => Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME)) {\r\n return keys;\r\n }\r\n\r\n const copy = new KeySet();\r\n copy.add(keys, (key) => {\r\n // the callback is not going to be called with EntityProps as KeySet converts them\r\n // to InstanceKeys, but we want to keep the EntityProps case for correctness\r\n // istanbul ignore next\r\n const isTransient =\r\n (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) ||\r\n (Key.isEntityProps(key) && key.classFullName === TRANSIENT_ELEMENT_CLASSNAME);\r\n return !isTransient;\r\n });\r\n return copy;\r\n};\r\n\r\nasync function collect<T>(iter: AsyncIterable<T>): Promise<T[]> {\r\n const result = new Array<T>();\r\n for await (const value of iter) {\r\n result.push(value);\r\n }\r\n return result;\r\n}\r\n"]}
1
+ {"version":3,"file":"PresentationManager.js","sourceRoot":"","sources":["../../../src/presentation-frontend/PresentationManager.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,SAAS,EAAoB,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG3E,OAAO,EAEL,OAAO,EAEP,YAAY,EAKZ,0BAA0B,EAC1B,UAAU,EAcV,IAAI,EAEJ,GAAG,EACH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Y,UAAU,EAAE,CAAC;QAChD,OAAO,qBAAqB,CAAC,yBAAyB,EAAE,CAAC;IAC3D,CAAC;IACD,OAAO,qBAAqB,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,IAAY,EAAE,EAAE;IACjD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,2BAA2B,CAAC,EAAE,CAAC;QACjG,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;IAC1B,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;QACrB,kFAAkF;QAClF,4EAA4E;QAC5E,sBAAsB;QACtB,MAAM,WAAW,GACf,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,2BAA2B,CAAC;YACzE,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,aAAa,KAAK,2BAA2B,CAAC,CAAC;QAChF,OAAO,CAAC,WAAW,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,KAAK,UAAU,OAAO,CAAI,IAAsB;IAC9C,MAAM,MAAM,GAAG,IAAI,KAAK,EAAK,CAAC;IAC9B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { BeEvent, CompressedId64Set, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\nimport { IModelApp, IModelConnection, IpcApp } from \"@itwin/core-frontend\";\r\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\r\nimport { SchemaContext } from \"@itwin/ecschema-metadata\";\r\nimport {\r\n ClientDiagnosticsAttribute,\r\n Content,\r\n ContentDescriptorRequestOptions,\r\n ContentFlags,\r\n ContentInstanceKeysRequestOptions,\r\n ContentRequestOptions,\r\n ContentSourcesRequestOptions,\r\n ContentUpdateInfo,\r\n DefaultContentDisplayTypes,\r\n Descriptor,\r\n DescriptorOverrides,\r\n DisplayLabelRequestOptions,\r\n DisplayLabelsRequestOptions,\r\n DisplayValueGroup,\r\n DistinctValuesRequestOptions,\r\n ElementProperties,\r\n FilterByInstancePathsHierarchyRequestOptions,\r\n FilterByTextHierarchyRequestOptions,\r\n FormatsMap,\r\n HierarchyLevelDescriptorRequestOptions,\r\n HierarchyRequestOptions,\r\n HierarchyUpdateInfo,\r\n InstanceKey,\r\n Item,\r\n ItemJSON,\r\n Key,\r\n KeySet,\r\n KoqPropertyValueFormatter,\r\n LabelDefinition,\r\n Node,\r\n NodeKey,\r\n NodePathElement,\r\n Paged,\r\n PagedResponse,\r\n PageOptions,\r\n Ruleset,\r\n RulesetVariable,\r\n SelectClassInfo,\r\n SingleElementPropertiesRequestOptions,\r\n UpdateInfo,\r\n VariableValueTypes,\r\n} from \"@itwin/presentation-common\";\r\nimport {\r\n buildElementProperties,\r\n ContentFormatter,\r\n ContentPropertyValueFormatter,\r\n PresentationIpcEvents,\r\n RpcRequestsHandler,\r\n} from \"@itwin/presentation-common/internal\";\r\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"@itwin/unified-selection\";\r\nimport { IpcRequestsHandler } from \"./IpcRequestsHandler.js\";\r\nimport { FrontendLocalizationHelper } from \"./LocalizationHelper.js\";\r\nimport { RulesetManager, RulesetManagerImpl } from \"./RulesetManager.js\";\r\nimport { RulesetVariablesManager, RulesetVariablesManagerImpl } from \"./RulesetVariablesManager.js\";\r\nimport { StreamedResponseGenerator } from \"./StreamedResponseGenerator.js\";\r\nimport { ensureIModelInitialized, startIModelInitialization } from \"./IModelConnectionInitialization.js\";\r\nimport { _presentation_manager_ipcRequestsHandler, _presentation_manager_rpcRequestsHandler } from \"./InternalSymbols.js\";\r\n\r\n/**\r\n * Data structure that describes IModel hierarchy change event arguments.\r\n * @public\r\n */\r\nexport interface IModelHierarchyChangeEventArgs {\r\n /** Id of ruleset that was used to create hierarchy. */\r\n rulesetId: string;\r\n /** Hierarchy changes info. */\r\n updateInfo: HierarchyUpdateInfo;\r\n /** Key of iModel that was used to create hierarchy. It matches [[IModelConnection.key]] property. */\r\n imodelKey: string;\r\n}\r\n\r\n/**\r\n * Data structure that describes iModel content change event arguments.\r\n * @public\r\n */\r\nexport interface IModelContentChangeEventArgs {\r\n /** Id of ruleset that was used to create content. */\r\n rulesetId: string;\r\n /** Content changes info. */\r\n updateInfo: ContentUpdateInfo;\r\n /** Key of iModel that was used to create content. It matches [[IModelConnection.key]] property. */\r\n imodelKey: string;\r\n}\r\n\r\n/**\r\n * Options for requests that can return multiple pages of items concurrently.\r\n * @public\r\n */\r\nexport type MultipleValuesRequestOptions = Paged<{\r\n /**\r\n * Max number of requests that should be made to the backend to fulfill the whole request.\r\n * `undefined` means no limit, so in that case all requests are sent at once.\r\n */\r\n maxParallelRequests?: number;\r\n\r\n /**\r\n * Size of a single batch when fetching data through multiple requests. If not set,\r\n * the fall back is requested page size. If the page size is not set, the backend\r\n * decides how many items to return.\r\n */\r\n batchSize?: number;\r\n}>;\r\n\r\n/**\r\n * Options for requests that retrieve nodes.\r\n * @public\r\n */\r\nexport type GetNodesRequestOptions = HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute;\r\n\r\n/**\r\n * Options for requests that retrieve content.\r\n * @public\r\n */\r\nexport type GetContentRequestOptions = ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> &\r\n ClientDiagnosticsAttribute;\r\n\r\n/**\r\n * Options for requests that retrieve distinct values.\r\n * @public\r\n */\r\nexport type GetDistinctValuesRequestOptions = DistinctValuesRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> &\r\n ClientDiagnosticsAttribute;\r\n\r\n/**\r\n * Properties used to configure [[PresentationManager]]\r\n * @public\r\n */\r\nexport interface PresentationManagerProps {\r\n /**\r\n * Sets the active locale to use when localizing presentation-related\r\n * strings. It can later be changed through [[PresentationManager]].\r\n */\r\n activeLocale?: string;\r\n\r\n /**\r\n * Sets the active unit system to use for formatting property values with\r\n * units. The value can later be changed through [[PresentationManager.activeUnitSystem]] setter or\r\n * overriden for each request through request parameters. If not set, `IModelApp.quantityFormatter.activeUnitSystem`\r\n * is used by default.\r\n *\r\n * @deprecated in 4.0. Use [IModelApp.quantityFormatter]($core-frontend) to set the active unit system.\r\n */\r\n activeUnitSystem?: UnitSystemKey;\r\n\r\n /**\r\n * ID used to identify client that requests data. Generally, clients should\r\n * store this ID in their local storage so the ID can be reused across\r\n * sessions - this allows reusing some caches.\r\n *\r\n * Defaults to a unique GUID as a client id.\r\n */\r\n clientId?: string;\r\n\r\n /**\r\n * Timeout (in milliseconds) for how long we're going to wait for RPC request to be fulfilled before throwing\r\n * a timeout error.\r\n *\r\n * Defaults to 10 minutes.\r\n */\r\n requestTimeout?: number;\r\n\r\n /**\r\n * Callback that provides [SchemaContext]($ecschema-metadata) for supplied [IModelConnection]($core-frontend).\r\n * [SchemaContext]($ecschema-metadata) is used for getting metadata required for values formatting.\r\n */\r\n schemaContextProvider?: (imodel: IModelConnection) => SchemaContext;\r\n\r\n /**\r\n * A map of default unit formats to use for formatting properties that don't have a presentation format\r\n * in requested unit system.\r\n *\r\n * @note Only has effect when frontend value formatting is enabled by supplying the `schemaContextProvider` prop.\r\n */\r\n defaultFormats?: FormatsMap;\r\n}\r\n\r\n/** @internal */\r\ninterface PresentationManagerInternalProps {\r\n rpcRequestsHandler?: RpcRequestsHandler;\r\n ipcRequestsHandler?: IpcRequestsHandler;\r\n}\r\n\r\n/**\r\n * Frontend Presentation manager which basically just forwards all calls to\r\n * the backend implementation.\r\n *\r\n * @public\r\n */\r\nexport class PresentationManager implements Disposable {\r\n private _requestsHandler: RpcRequestsHandler;\r\n private _rulesets: RulesetManager;\r\n private _localizationHelper: FrontendLocalizationHelper;\r\n private _explicitActiveUnitSystem: UnitSystemKey | undefined;\r\n private _rulesetVars: Map<string, RulesetVariablesManager>;\r\n private _clearEventListener?: () => void;\r\n private _schemaContextProvider?: (imodel: IModelConnection) => SchemaContext;\r\n private _defaultFormats?: FormatsMap;\r\n private _ipcRequestsHandler?: IpcRequestsHandler;\r\n\r\n /**\r\n * An event raised when hierarchies created using specific ruleset change\r\n */\r\n public onIModelHierarchyChanged = new BeEvent<(args: IModelHierarchyChangeEventArgs) => void>();\r\n\r\n /**\r\n * An event raised when content created using specific ruleset changes\r\n */\r\n public onIModelContentChanged = new BeEvent<(args: IModelContentChangeEventArgs) => void>();\r\n\r\n /**\r\n * Get / set active unit system used to format property values with units.\r\n *\r\n * @deprecated in 4.0. `IModelApp.quantityFormatter` should be used to get/set the active unit system. At the moment\r\n * [[PresentationManager]] allows overriding it, but returns `IModelApp.quantityFormatter.activeUnitSystem` if override\r\n * is not set.\r\n */\r\n public get activeUnitSystem(): UnitSystemKey {\r\n return this._explicitActiveUnitSystem ?? IModelApp.quantityFormatter.activeUnitSystem;\r\n }\r\n public set activeUnitSystem(value: UnitSystemKey | undefined) {\r\n this._explicitActiveUnitSystem = value;\r\n }\r\n\r\n private constructor(props?: PresentationManagerProps) {\r\n if (props) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this._explicitActiveUnitSystem = props.activeUnitSystem;\r\n }\r\n\r\n this._requestsHandler =\r\n (props as PresentationManagerInternalProps)?.rpcRequestsHandler ??\r\n new RpcRequestsHandler(props ? { clientId: props.clientId, timeout: props.requestTimeout } : undefined);\r\n this._rulesetVars = new Map<string, RulesetVariablesManager>();\r\n this._rulesets = RulesetManagerImpl.create();\r\n this._localizationHelper = new FrontendLocalizationHelper(props?.activeLocale);\r\n this._schemaContextProvider = props?.schemaContextProvider;\r\n this._defaultFormats = props?.defaultFormats;\r\n\r\n if (IpcApp.isValid) {\r\n // Ipc only works in ipc apps, so the `onUpdate` callback will only be called there.\r\n this._clearEventListener = IpcApp.addListener(PresentationIpcEvents.Update, this.onUpdate);\r\n this._ipcRequestsHandler = (props as PresentationManagerInternalProps)?.ipcRequestsHandler ?? new IpcRequestsHandler(this._requestsHandler.clientId);\r\n }\r\n }\r\n\r\n /** Get / set active locale used for localizing presentation data */\r\n public get activeLocale(): string | undefined {\r\n return this._localizationHelper.locale;\r\n }\r\n public set activeLocale(locale: string | undefined) {\r\n this._localizationHelper.locale = locale;\r\n }\r\n\r\n public [Symbol.dispose]() {\r\n if (this._clearEventListener) {\r\n this._clearEventListener();\r\n this._clearEventListener = undefined;\r\n }\r\n }\r\n\r\n /** @deprecated in 5.0 Use [Symbol.dispose] instead. */\r\n /* c8 ignore next 3 */\r\n public dispose() {\r\n this[Symbol.dispose]();\r\n }\r\n\r\n private onUpdate = (_evt: Event, report: UpdateInfo) => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.handleUpdateAsync(report);\r\n };\r\n\r\n /** @note This is only called in native apps after changes in iModels */\r\n private async handleUpdateAsync(report: UpdateInfo) {\r\n for (const imodelKey in report) {\r\n /* c8 ignore next 3 */\r\n if (!report.hasOwnProperty(imodelKey)) {\r\n continue;\r\n }\r\n\r\n const imodelReport = report[imodelKey];\r\n for (const rulesetId in imodelReport) {\r\n /* c8 ignore next 3 */\r\n if (!imodelReport.hasOwnProperty(rulesetId)) {\r\n continue;\r\n }\r\n\r\n const updateInfo = imodelReport[rulesetId];\r\n if (updateInfo.content) {\r\n this.onIModelContentChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.content, imodelKey });\r\n }\r\n if (updateInfo.hierarchy) {\r\n this.onIModelHierarchyChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.hierarchy, imodelKey });\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Create a new PresentationManager instance\r\n * @param props Optional properties used to configure the manager\r\n */\r\n public static create(props?: PresentationManagerProps) {\r\n return new PresentationManager(props);\r\n }\r\n\r\n /** @internal */\r\n public get [_presentation_manager_rpcRequestsHandler]() {\r\n return this._requestsHandler;\r\n }\r\n\r\n /** @internal */\r\n public get [_presentation_manager_ipcRequestsHandler]() {\r\n return this._ipcRequestsHandler;\r\n }\r\n\r\n /**\r\n * Get rulesets manager\r\n */\r\n public rulesets() {\r\n return this._rulesets;\r\n }\r\n\r\n /**\r\n * Get ruleset variables manager for specific ruleset\r\n * @param rulesetId Id of the ruleset to get the vars manager for\r\n */\r\n public vars(rulesetId: string) {\r\n if (!this._rulesetVars.has(rulesetId)) {\r\n const varsManager = new RulesetVariablesManagerImpl(rulesetId, this._ipcRequestsHandler);\r\n this._rulesetVars.set(rulesetId, varsManager);\r\n }\r\n return this._rulesetVars.get(rulesetId)!;\r\n }\r\n\r\n private toRpcTokenOptions<TOptions extends { imodel: IModelConnection; locale?: string; unitSystem?: UnitSystemKey; rulesetVariables?: RulesetVariable[] }>(\r\n requestOptions: TOptions,\r\n ) {\r\n // 1. put default `locale` and `unitSystem`\r\n // 2. put all `requestOptions` members (if `locale` or `unitSystem` are set, they'll override the defaults put at #1)\r\n // 3. put `imodel` of type `IModelRpcProps` which overwrites the `imodel` from `requestOptions` put at #2\r\n const defaultOptions: Pick<TOptions, \"locale\" | \"unitSystem\"> = {};\r\n if (this.activeLocale) {\r\n defaultOptions.locale = this.activeLocale;\r\n }\r\n defaultOptions.unitSystem = this.activeUnitSystem; // eslint-disable-line @typescript-eslint/no-deprecated\r\n\r\n const { imodel, rulesetVariables, ...rpcRequestOptions } = requestOptions;\r\n return {\r\n ...defaultOptions,\r\n ...rpcRequestOptions,\r\n ...(rulesetVariables ? { rulesetVariables: rulesetVariables.map(RulesetVariable.toJSON) } : {}),\r\n imodel: imodel.getRpcProps(),\r\n };\r\n }\r\n\r\n private async addRulesetAndVariablesToOptions<TOptions extends { rulesetOrId: Ruleset | string; rulesetVariables?: RulesetVariable[] }>(options: TOptions) {\r\n const { rulesetOrId, rulesetVariables } = options;\r\n let foundRulesetOrId: Ruleset | string;\r\n if (typeof rulesetOrId === \"object\") {\r\n foundRulesetOrId = rulesetOrId;\r\n } else {\r\n const foundRuleset = await this._rulesets.get(rulesetOrId);\r\n foundRulesetOrId = foundRuleset ? foundRuleset.toJSON() : rulesetOrId;\r\n }\r\n const rulesetId = typeof foundRulesetOrId === \"object\" ? foundRulesetOrId.id : foundRulesetOrId;\r\n\r\n // All Id64Array variable values must be sorted for serialization to JSON to work. RulesetVariablesManager\r\n // sorts them before storing, so that part is taken care of, but we need to ensure that variables coming from\r\n // request options are also sorted.\r\n const variables = (rulesetVariables ?? []).map((variable) => {\r\n if (variable.type === VariableValueTypes.Id64Array) {\r\n return { ...variable, value: OrderedId64Iterable.sortArray(variable.value) };\r\n }\r\n return variable;\r\n });\r\n if (!this._ipcRequestsHandler) {\r\n // only need to add variables from variables manager if there's no IPC\r\n // handler - if there is one, the variables are already known by the backend\r\n variables.push(...this.vars(rulesetId).getAllVariables());\r\n }\r\n\r\n return { ...options, rulesetOrId: foundRulesetOrId, rulesetVariables: variables };\r\n }\r\n\r\n /** Returns an iterator that polls nodes asynchronously. */\r\n public async getNodesIterator(\r\n requestOptions: GetNodesRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<{ total: number; items: AsyncIterableIterator<Node> }> {\r\n startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n\r\n const generator = new StreamedResponseGenerator({\r\n ...requestOptions,\r\n getBatch: async (paging) => {\r\n const result = await this._requestsHandler.getPagedNodes({ ...rpcOptions, paging });\r\n return {\r\n total: result.total,\r\n items: this._localizationHelper.getLocalizedNodes(result.items),\r\n };\r\n },\r\n });\r\n\r\n return generator.createAsyncIteratorResponse();\r\n }\r\n\r\n /**\r\n * Retrieves nodes\r\n * @deprecated in 4.5. Use [[getNodesIterator]] instead.\r\n */\r\n public async getNodes(requestOptions: GetNodesRequestOptions & MultipleValuesRequestOptions): Promise<Node[]> {\r\n const result = await this.getNodesIterator(requestOptions);\r\n return collect(result.items);\r\n }\r\n\r\n /** Retrieves nodes count. */\r\n public async getNodesCount(requestOptions: GetNodesRequestOptions): Promise<number> {\r\n startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n return this._requestsHandler.getNodesCount(rpcOptions);\r\n }\r\n\r\n /**\r\n * Retrieves total nodes count and a single page of nodes.\r\n * @deprecated in 4.5. Use [[getNodesIterator]] instead.\r\n */\r\n public async getNodesAndCount(requestOptions: GetNodesRequestOptions & MultipleValuesRequestOptions): Promise<{ count: number; nodes: Node[] }> {\r\n const result = await this.getNodesIterator(requestOptions);\r\n return {\r\n count: result.total,\r\n nodes: await collect(result.items),\r\n };\r\n }\r\n\r\n /**\r\n * Retrieves hierarchy level descriptor.\r\n * @public\r\n */\r\n public async getNodesDescriptor(\r\n requestOptions: HierarchyLevelDescriptorRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<Descriptor | undefined> {\r\n startIModelInitialization(requestOptions.imodel);\r\n try {\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n const result = await this._requestsHandler.getNodesDescriptor(rpcOptions);\r\n const descriptor = Descriptor.fromJSON(result);\r\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\r\n } finally {\r\n await ensureIModelInitialized(requestOptions.imodel);\r\n }\r\n }\r\n\r\n /** Retrieves paths from root nodes to children nodes according to specified keys. Intersecting paths will be merged. */\r\n public async getNodePaths(\r\n requestOptions: FilterByInstancePathsHierarchyRequestOptions<IModelConnection, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<NodePathElement[]> {\r\n startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n const result = await this._requestsHandler.getNodePaths(rpcOptions);\r\n return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\r\n }\r\n\r\n /** Retrieves paths from root nodes to nodes containing filter text in their label. */\r\n public async getFilteredNodePaths(\r\n requestOptions: FilterByTextHierarchyRequestOptions<IModelConnection, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<NodePathElement[]> {\r\n startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const result = await this._requestsHandler.getFilteredNodePaths(this.toRpcTokenOptions(options));\r\n return result.map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\r\n }\r\n\r\n /**\r\n * Get information about the sources of content when building it for specific ECClasses. Sources involve classes of the primary select instance,\r\n * its related instances for loading related and navigation properties.\r\n * @public\r\n */\r\n public async getContentSources(requestOptions: ContentSourcesRequestOptions<IModelConnection> & ClientDiagnosticsAttribute): Promise<SelectClassInfo[]> {\r\n startIModelInitialization(requestOptions.imodel);\r\n const rpcOptions = this.toRpcTokenOptions(requestOptions);\r\n const result = await this._requestsHandler.getContentSources(rpcOptions);\r\n return result.sources.map((sourceJson) => SelectClassInfo.fromCompressedJSON(sourceJson, result.classesMap));\r\n }\r\n\r\n /** Retrieves the content descriptor which describes the content and can be used to customize it. */\r\n public async getContentDescriptor(\r\n requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<Descriptor | undefined> {\r\n startIModelInitialization(requestOptions.imodel);\r\n try {\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({\r\n ...options,\r\n keys: stripTransientElementKeys(options.keys).toJSON(),\r\n });\r\n const result = await this._requestsHandler.getContentDescriptor(rpcOptions);\r\n const descriptor = Descriptor.fromJSON(result);\r\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\r\n } finally {\r\n await ensureIModelInitialized(requestOptions.imodel);\r\n }\r\n }\r\n\r\n /** Retrieves overall content set size. */\r\n public async getContentSetSize(requestOptions: GetContentRequestOptions): Promise<number> {\r\n startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({\r\n ...options,\r\n descriptor: getDescriptorOverrides(requestOptions.descriptor),\r\n keys: stripTransientElementKeys(requestOptions.keys).toJSON(),\r\n });\r\n return this._requestsHandler.getContentSetSize(rpcOptions);\r\n }\r\n\r\n private async getContentIteratorInternal(\r\n requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<{ descriptor: Descriptor; total: number; items: AsyncIterableIterator<Item> } | undefined> {\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const firstPageSize = options.batchSize ?? requestOptions.paging?.size;\r\n const rpcOptions = this.toRpcTokenOptions({\r\n ...options,\r\n descriptor: getDescriptorOverrides(requestOptions.descriptor),\r\n keys: stripTransientElementKeys(requestOptions.keys).toJSON(),\r\n ...(firstPageSize ? { paging: { ...requestOptions.paging, size: firstPageSize } } : undefined),\r\n ...(!requestOptions.omitFormattedValues && this._schemaContextProvider !== undefined ? { omitFormattedValues: true } : undefined),\r\n });\r\n\r\n let contentFormatter: ContentFormatter | undefined;\r\n if (!requestOptions.omitFormattedValues && this._schemaContextProvider) {\r\n const koqPropertyFormatter = new KoqPropertyValueFormatter(this._schemaContextProvider(requestOptions.imodel), this._defaultFormats);\r\n contentFormatter = new ContentFormatter(\r\n new ContentPropertyValueFormatter(koqPropertyFormatter),\r\n requestOptions.unitSystem ?? this._explicitActiveUnitSystem ?? IModelApp.quantityFormatter.activeUnitSystem,\r\n );\r\n }\r\n\r\n let descriptor = requestOptions.descriptor instanceof Descriptor ? requestOptions.descriptor : undefined;\r\n let firstPage: PagedResponse<ItemJSON> | undefined;\r\n if (!descriptor) {\r\n const firstPageResponse = await this._requestsHandler.getPagedContent(rpcOptions);\r\n if (!firstPageResponse?.descriptor || !firstPageResponse.contentSet) {\r\n return undefined;\r\n }\r\n descriptor = Descriptor.fromJSON(firstPageResponse?.descriptor);\r\n firstPage = firstPageResponse?.contentSet;\r\n }\r\n\r\n /* c8 ignore next 3 */\r\n if (!descriptor) {\r\n return undefined;\r\n }\r\n\r\n descriptor = this._localizationHelper.getLocalizedContentDescriptor(descriptor);\r\n\r\n const getPage = async (paging: Required<PageOptions>, requestIndex: number) => {\r\n let contentSet = requestIndex === 0 ? firstPage : undefined;\r\n contentSet ??= await this._requestsHandler.getPagedContentSet({ ...rpcOptions, paging });\r\n\r\n let items = contentSet.items.map((x) => Item.fromJSON(x)).filter((x): x is Item => x !== undefined);\r\n if (contentFormatter) {\r\n items = await contentFormatter.formatContentItems(items, descriptor);\r\n }\r\n\r\n items = this._localizationHelper.getLocalizedContentItems(items);\r\n return {\r\n total: contentSet.total,\r\n items,\r\n };\r\n };\r\n\r\n const generator = new StreamedResponseGenerator({\r\n ...requestOptions,\r\n getBatch: getPage,\r\n });\r\n\r\n return {\r\n ...(await generator.createAsyncIteratorResponse()),\r\n descriptor,\r\n };\r\n }\r\n\r\n /** Retrieves a content descriptor, item count and async generator for the items themselves. */\r\n public async getContentIterator(\r\n requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<{ descriptor: Descriptor; total: number; items: AsyncIterableIterator<Item> } | undefined> {\r\n startIModelInitialization(requestOptions.imodel);\r\n const response = await this.getContentIteratorInternal(requestOptions);\r\n if (!response) {\r\n return undefined;\r\n }\r\n\r\n await ensureIModelInitialized(requestOptions.imodel);\r\n return response;\r\n }\r\n\r\n /**\r\n * Retrieves content which consists of a content descriptor and a page of records.\r\n * @deprecated in 4.5. Use [[getContentIterator]] instead.\r\n */\r\n public async getContent(requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions): Promise<Content | undefined> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return (await this.getContentAndSize(requestOptions))?.content;\r\n }\r\n\r\n /**\r\n * Retrieves content set size and content which consists of a content descriptor and a page of records.\r\n * @deprecated in 4.5. Use [[getContentIterator]] instead.\r\n */\r\n public async getContentAndSize(\r\n requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<{ content: Content; size: number } | undefined> {\r\n const response = await this.getContentIterator(requestOptions);\r\n if (!response) {\r\n return undefined;\r\n }\r\n\r\n const { descriptor, total } = response;\r\n const items = await collect(response.items);\r\n return {\r\n content: new Content(descriptor, items),\r\n size: total,\r\n };\r\n }\r\n\r\n /** Returns an iterator that asynchronously polls distinct values of specific field from the content. */\r\n public async getDistinctValuesIterator(\r\n requestOptions: GetDistinctValuesRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<{ total: number; items: AsyncIterableIterator<DisplayValueGroup> }> {\r\n startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = {\r\n ...this.toRpcTokenOptions(options),\r\n descriptor: getDescriptorOverrides(options.descriptor),\r\n keys: stripTransientElementKeys(options.keys).toJSON(),\r\n };\r\n\r\n const generator = new StreamedResponseGenerator({\r\n ...requestOptions,\r\n getBatch: async (paging) => {\r\n const response = await this._requestsHandler.getPagedDistinctValues({ ...rpcOptions, paging });\r\n return {\r\n total: response.total,\r\n items: response.items.map((x) => this._localizationHelper.getLocalizedDisplayValueGroup(x)),\r\n };\r\n },\r\n });\r\n\r\n return generator.createAsyncIteratorResponse();\r\n }\r\n\r\n /**\r\n * Retrieves distinct values of specific field from the content.\r\n * @deprecated in 4.5. Use [[getDistinctValuesIterator]] instead.\r\n */\r\n public async getPagedDistinctValues(\r\n requestOptions: GetDistinctValuesRequestOptions & MultipleValuesRequestOptions,\r\n ): Promise<PagedResponse<DisplayValueGroup>> {\r\n const result = await this.getDistinctValuesIterator(requestOptions);\r\n return {\r\n total: result.total,\r\n items: await collect(result.items),\r\n };\r\n }\r\n\r\n /**\r\n * Retrieves property data in a simplified format for a single element specified by ID.\r\n * @public\r\n */\r\n public async getElementProperties<TParsedContent = ElementProperties>(\r\n requestOptions: SingleElementPropertiesRequestOptions<IModelConnection, TParsedContent> & ClientDiagnosticsAttribute,\r\n ): Promise<TParsedContent | undefined> {\r\n startIModelInitialization(requestOptions.imodel);\r\n type TParser = Required<typeof requestOptions>[\"contentParser\"];\r\n const { elementId, contentParser, ...optionsNoElementId } = requestOptions;\r\n const parser: TParser = contentParser ?? (buildElementProperties as TParser);\r\n const iter = await this.getContentIterator({\r\n ...optionsNoElementId,\r\n descriptor: {\r\n displayType: DefaultContentDisplayTypes.PropertyPane,\r\n contentFlags: ContentFlags.ShowLabels,\r\n },\r\n rulesetOrId: \"ElementProperties\",\r\n keys: new KeySet([{ className: \"BisCore:Element\", id: elementId }]),\r\n });\r\n if (!iter || iter.total === 0) {\r\n return undefined;\r\n }\r\n return parser(iter.descriptor, (await iter.items.next()).value);\r\n }\r\n\r\n /**\r\n * Retrieves content item instance keys.\r\n * @public\r\n */\r\n public async getContentInstanceKeys(\r\n requestOptions: ContentInstanceKeysRequestOptions<IModelConnection, KeySet, RulesetVariable> & ClientDiagnosticsAttribute & MultipleValuesRequestOptions,\r\n ): Promise<{ total: number; items: () => AsyncGenerator<InstanceKey> }> {\r\n startIModelInitialization(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = {\r\n ...this.toRpcTokenOptions(options),\r\n keys: stripTransientElementKeys(options.keys).toJSON(),\r\n };\r\n\r\n const generator = new StreamedResponseGenerator({\r\n ...requestOptions,\r\n getBatch: async (page) => {\r\n const keys = await this._requestsHandler.getContentInstanceKeys({ ...rpcOptions, paging: page });\r\n return {\r\n total: keys.total,\r\n items: keys.items.instanceKeys.reduce((instanceKeys, entry) => {\r\n for (const id of CompressedId64Set.iterable(entry[1])) {\r\n instanceKeys.push({ className: entry[0], id });\r\n }\r\n return instanceKeys;\r\n }, new Array<InstanceKey>()),\r\n };\r\n },\r\n });\r\n\r\n const { total, items } = await generator.createAsyncIteratorResponse();\r\n return {\r\n total,\r\n async *items() {\r\n yield* items;\r\n },\r\n };\r\n }\r\n\r\n /** Retrieves display label definition of specific item. */\r\n public async getDisplayLabelDefinition(\r\n requestOptions: DisplayLabelRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute,\r\n ): Promise<LabelDefinition> {\r\n startIModelInitialization(requestOptions.imodel);\r\n const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });\r\n const result = await this._requestsHandler.getDisplayLabelDefinition(rpcOptions);\r\n return this._localizationHelper.getLocalizedLabelDefinition(result);\r\n }\r\n\r\n /** Retrieves display label definition of specific items. */\r\n public async getDisplayLabelDefinitionsIterator(\r\n requestOptions: DisplayLabelsRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute & MultipleValuesRequestOptions,\r\n ): Promise<{ total: number; items: AsyncIterableIterator<LabelDefinition> }> {\r\n startIModelInitialization(requestOptions.imodel);\r\n const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });\r\n const generator = new StreamedResponseGenerator({\r\n ...requestOptions,\r\n getBatch: async (page) => {\r\n const partialKeys = !page.start ? rpcOptions.keys : rpcOptions.keys.slice(page.start);\r\n const result = await this._requestsHandler.getPagedDisplayLabelDefinitions({ ...rpcOptions, keys: partialKeys });\r\n result.items = this._localizationHelper.getLocalizedLabelDefinitions(result.items);\r\n return result;\r\n },\r\n });\r\n\r\n return generator.createAsyncIteratorResponse();\r\n }\r\n\r\n /**\r\n * Retrieves display label definition of specific items.\r\n * @deprecated in 4.5. Use [[getDisplayLabelDefinitionsIterator]] instead.\r\n */\r\n public async getDisplayLabelDefinitions(\r\n requestOptions: DisplayLabelsRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute & MultipleValuesRequestOptions,\r\n ): Promise<LabelDefinition[]> {\r\n const { items } = await this.getDisplayLabelDefinitionsIterator(requestOptions);\r\n return collect(items);\r\n }\r\n}\r\n\r\nconst getDescriptorOverrides = (descriptorOrOverrides: Descriptor | DescriptorOverrides): DescriptorOverrides => {\r\n if (descriptorOrOverrides instanceof Descriptor) {\r\n return descriptorOrOverrides.createDescriptorOverrides();\r\n }\r\n return descriptorOrOverrides;\r\n};\r\n\r\nconst stripTransientElementKeys = (keys: KeySet) => {\r\n if (!keys.some((key) => Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME)) {\r\n return keys;\r\n }\r\n\r\n const copy = new KeySet();\r\n copy.add(keys, (key) => {\r\n // the callback is not going to be called with EntityProps as KeySet converts them\r\n // to InstanceKeys, but we want to keep the EntityProps case for correctness\r\n /* c8 ignore next 3 */\r\n const isTransient =\r\n (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) ||\r\n (Key.isEntityProps(key) && key.classFullName === TRANSIENT_ELEMENT_CLASSNAME);\r\n return !isTransient;\r\n });\r\n return copy;\r\n};\r\n\r\nasync function collect<T>(iter: AsyncIterable<T>): Promise<T[]> {\r\n const result = new Array<T>();\r\n for await (const value of iter) {\r\n result.push(value);\r\n }\r\n return result;\r\n}\r\n"]}
@@ -9,10 +9,8 @@ import { BeEvent, Guid } from "@itwin/core-bentley";
9
9
  import { RegisteredRuleset } from "@itwin/presentation-common";
10
10
  /** @internal */
11
11
  export class RulesetManagerImpl {
12
- constructor() {
13
- this._clientRulesets = new Map();
14
- this.onRulesetModified = new BeEvent();
15
- }
12
+ _clientRulesets = new Map();
13
+ onRulesetModified = new BeEvent();
16
14
  static create() {
17
15
  return new RulesetManagerImpl();
18
16
  }